bugstash 0.1.24 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +435 -251
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +435 -251
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
${
|
|
1
|
+
var ne=[],Vn=50,re=null,se=null,oe=null,ie=null;function $e(t){if(t.id)return`#${t.id}`;let e=t.tagName.toLowerCase(),n=t.className&&typeof t.className=="string"?"."+t.className.trim().split(/\s+/).slice(0,2).join("."):"",r=(t.textContent||"").trim().slice(0,30),s=r?` "${r}"`:"";return`${e}${n}${s}`}function V(t){ne.push(t),ne.length>Vn&&ne.shift()}function Jn(t){t&&(Vn=t),re=n=>{let r=n.target;!r||!r.tagName||V({type:"click",category:"ui",message:`Clicked ${$e(r)}`,timestamp:Date.now(),data:{x:n.clientX,y:n.clientY,selector:$e(r)}})},document.addEventListener("click",re,!0);let e=new WeakMap;se=n=>{let r=n.target;if(!r||!r.tagName)return;let s=r.tagName.toLowerCase();if(s!=="input"&&s!=="textarea"&&s!=="select")return;let o=e.get(r);o&&clearTimeout(o),e.set(r,window.setTimeout(()=>{let i=r instanceof HTMLInputElement&&r.type==="password";V({type:"input",category:"ui",message:`Input ${$e(r)}`,timestamp:Date.now(),data:{selector:$e(r),value:i?"[redacted]":void 0}})},300))},document.addEventListener("input",se,!0),oe=()=>{V({type:"navigation",category:"navigation",message:`Navigated to ${window.location.pathname}`,timestamp:Date.now(),data:{url:window.location.href}})},window.addEventListener("popstate",oe),ie=()=>{V({type:"navigation",category:"navigation",message:`Hash changed to ${window.location.hash}`,timestamp:Date.now(),data:{url:window.location.href}})},window.addEventListener("hashchange",ie),V({type:"navigation",category:"navigation",message:`Page loaded: ${window.location.pathname}`,timestamp:Date.now(),data:{url:window.location.href}})}function zt(){return[...ne]}function Kn(){ne=[]}function Gn(){re&&document.removeEventListener("click",re,!0),se&&document.removeEventListener("input",se,!0),oe&&window.removeEventListener("popstate",oe),ie&&window.removeEventListener("hashchange",ie),re=null,se=null,oe=null,ie=null}var pn="[REDACTED]",Hs=[[/\b(?:\d[ -]*?){13,19}\b/g,"[CC_REDACTED]"],[/\b\d{3}-\d{2}-\d{4}\b/g,"[SSN_REDACTED]"],[/Bearer\s+[A-Za-z0-9\-._~+/]+=*/g,"Bearer [TOKEN_REDACTED]"],[/eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,"[JWT_REDACTED]"],[/(?:api[_-]?key|apikey|secret|token|password|passwd|authorization)['":\s=]+['"]?([A-Za-z0-9\-._~+/]{20,})['"]?/gi,t=>{let e=t.search(/[=:]/);return t.slice(0,e+1)+" "+pn}],[/AKIA[0-9A-Z]{16}/g,"[AWS_KEY_REDACTED]"],[/"(?:password|passwd|secret|token|access_token|refresh_token|api_key|apiKey|private_key)":\s*"[^"]*"/gi,t=>{let e=t.indexOf(":");return t.slice(0,e+1)+' "'+pn+'"'}]];function It(t){let e=t;for(let[n,r]of Hs)e=e.replace(n,r);return e}function Qn(t){return t.map(It)}function Me(t){if(typeof t=="string")return It(t);if(Array.isArray(t))return t.map(Me);if(t&&typeof t=="object"){let e={};for(let[n,r]of Object.entries(t)){let s=n.toLowerCase();s.includes("password")||s.includes("secret")||s.includes("token")||s.includes("apikey")||s.includes("api_key")||s.includes("private")?e[n]=pn:e[n]=Me(r)}return e}return t}var Ae={log:console.log,warn:console.warn,error:console.error,debug:console.debug,info:console.info},ae=[],Zn=50;function Ds(t){return t.map(e=>{if(e instanceof Error)return`${e.name}: ${e.message}
|
|
2
|
+
${e.stack??""}`;if(typeof e=="object")try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)})}function Bs(t,e){let n={level:t,args:Qn(Ds(e)),timestamp:Date.now()};t==="error"&&(n.stack=new Error().stack?.split(`
|
|
3
3
|
`).slice(2).join(`
|
|
4
|
-
`)),et.push(n),et.length>Wn&&et.shift(),Y({type:"console",category:`console.${e}`,message:n.args.join(" ").slice(0,200),timestamp:n.timestamp})}function _n(e){e&&(Wn=e);for(let t of Object.keys(St))console[t]=function(...n){vs(t,n),St[t].apply(console,n)}}function le(){return[...et]}function Xn(){et=[]}function Yn(){for(let e of Object.keys(St))console[e]=St[e]}var $e=[],Vn=50,Lt,Ct,Tt;function on(e){$e.push(e),$e.length>Vn&&$e.shift(),Y({type:"network",category:e.failed?"network.error":"network.ok",message:`${e.method} ${e.url} \u2192 ${e.status} (${e.duration}ms)`,timestamp:e.timestamp,data:{status:e.status,duration:e.duration}})}function Jn(e){try{let t=new URL(e,window.location.origin),n=new URLSearchParams(t.search);for(let s of n.keys()){let o=s.toLowerCase();(o.includes("token")||o.includes("key")||o.includes("secret")||o.includes("password")||o.includes("auth"))&&n.set(s,"[REDACTED]")}let r=n.toString();return t.pathname+(r?"?"+r:"")}catch{return Pe(e)}}function ws(){Lt=window.fetch,window.fetch=async function(e,t){let n=t?.method?.toUpperCase()??"GET",r=typeof e=="string"?e:e instanceof URL?e.href:e.url,s=Jn(r),o=Date.now();try{let i=await Lt.call(window,e,t);return on({method:n,url:s,status:i.status,statusText:i.statusText,duration:Date.now()-o,responseType:i.headers.get("content-type")??void 0,timestamp:o,failed:i.status>=400}),i}catch(i){throw on({method:n,url:s,status:0,statusText:"Network Error",duration:Date.now()-o,timestamp:o,failed:!0}),i}}}function ks(){Ct=XMLHttpRequest.prototype.open,Tt=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=function(e,t,...n){return this.__bs_method=e.toUpperCase(),this.__bs_url=Jn(typeof t=="string"?t:t.href),Ct.apply(this,[e,t,...n])},XMLHttpRequest.prototype.send=function(e){let t=Date.now();return this.addEventListener("loadend",function(){on({method:this.__bs_method??"GET",url:this.__bs_url??"",status:this.status,statusText:this.statusText,duration:Date.now()-t,responseType:this.getResponseHeader("content-type")??void 0,timestamp:t,failed:this.status>=400||this.status===0})}),Tt.call(this,e)}}function Kn(e){e&&(Vn=e),ws(),ks()}function Me(){return[...$e]}function fe(){return $e.filter(e=>e.failed)}function Gn(){$e=[]}function Qn(){Lt&&(window.fetch=Lt),Ct&&(XMLHttpRequest.prototype.open=Ct),Tt&&(XMLHttpRequest.prototype.send=Tt)}var Pt=[],tt=null,nt=null;function Zn(){tt=e=>{let t={message:e.message||"Unknown error",source:e.filename,lineno:e.lineno,colno:e.colno,stack:e.error?.stack,type:"error",timestamp:Date.now()};Pt.push(t),Y({type:"error",category:"exception",message:t.message,timestamp:t.timestamp,data:{source:t.source,lineno:t.lineno}})},nt=e=>{let t=e.reason,n=t instanceof Error?t.message:typeof t=="string"?t:"Unhandled promise rejection",r={message:n,stack:t instanceof Error?t.stack:void 0,type:"unhandledrejection",timestamp:Date.now()};Pt.push(r),Y({type:"error",category:"promise",message:n,timestamp:r.timestamp})},window.addEventListener("error",tt),window.addEventListener("unhandledrejection",nt)}function ce(){return[...Pt]}function er(){Pt=[]}function tr(){tt&&window.removeEventListener("error",tt),nt&&window.removeEventListener("unhandledrejection",nt),tt=null,nt=null}var P=null,$t=null,Mt=null,At=null;function nr(){if(P={timestamp:Date.now()},performance.getEntriesByType){let e=()=>{let[t]=performance.getEntriesByType("navigation");t&&P&&(P.pageLoadTime=Math.round(t.loadEventEnd-t.startTime),P.domContentLoaded=Math.round(t.domContentLoadedEventEnd-t.startTime));let n=performance.getEntriesByType("paint");for(let s of n)s.name==="first-paint"&&P&&(P.firstPaint=Math.round(s.startTime)),s.name==="first-contentful-paint"&&P&&(P.firstContentfulPaint=Math.round(s.startTime));P&&(P.resourceCount=performance.getEntriesByType("resource").length);let r=performance.memory;r&&P&&(P.memoryUsage={usedJSHeapSize:r.usedJSHeapSize,totalJSHeapSize:r.totalJSHeapSize})};document.readyState==="complete"?setTimeout(e,0):window.addEventListener("load",()=>setTimeout(e,100))}if(typeof PerformanceObserver<"u"){try{$t=new PerformanceObserver(e=>{let t=e.getEntries(),n=t[t.length-1];n&&P&&(P.largestContentfulPaint=Math.round(n.startTime))}),$t.observe({type:"largest-contentful-paint",buffered:!0})}catch{}try{let e=0;Mt=new PerformanceObserver(t=>{for(let n of t.getEntries())n.hadRecentInput||(e+=n.value);P&&(P.cumulativeLayoutShift=Math.round(e*1e3)/1e3)}),Mt.observe({type:"layout-shift",buffered:!0})}catch{}try{At=new PerformanceObserver(e=>{let[t]=e.getEntries();t&&P&&(P.firstInputDelay=Math.round(t.processingStart-t.startTime))}),At.observe({type:"first-input",buffered:!0})}catch{}}}function Ae(){return P&&(P.timestamp=Date.now()),P?{...P}:null}function rr(){$t?.disconnect(),Mt?.disconnect(),At?.disconnect(),$t=null,Mt=null,At=null,P=null}function sr(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement("base"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),t&&(r.href=t),s.href=e,s.href}var or=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function te(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}var Re=null;function zt(e={}){return Re||(e.includeStyleProperties?(Re=e.includeStyleProperties,Re):(Re=te(window.getComputedStyle(document.documentElement)),Re))}function Rt(e,t){let r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Es(e){let t=Rt(e,"border-left-width"),n=Rt(e,"border-right-width");return e.clientWidth+t+n}function Ss(e){let t=Rt(e,"border-top-width"),n=Rt(e,"border-bottom-width");return e.clientHeight+t+n}function an(e,t={}){let n=t.width||Es(e),r=t.height||Ss(e);return{width:n,height:r}}function ir(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var K=16384;function ar(e){(e.width>K||e.height>K)&&(e.width>K&&e.height>K?e.width>e.height?(e.height*=K/e.width,e.width=K):(e.width*=K/e.height,e.height=K):e.width>K?(e.height*=K/e.width,e.width=K):(e.width*=K/e.height,e.height=K))}function ze(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Ls(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function lr(e,t,n){let r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return s.setAttribute("width",`${t}`),s.setAttribute("height",`${n}`),s.setAttribute("viewBox",`0 0 ${t} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),s.appendChild(o),o.appendChild(e),Ls(s)}var W=(e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||W(n,t)};function Cs(e){let t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ts(e,t){return zt(t).map(n=>{let r=e.getPropertyValue(n),s=e.getPropertyPriority(n);return`${n}: ${r}${s?" !important":""};`}).join(" ")}function Ps(e,t,n,r){let s=`.${e}:${t}`,o=n.cssText?Cs(n):Ts(n,r);return document.createTextNode(`${s}{${o}}`)}function cr(e,t,n,r){let s=window.getComputedStyle(e,n),o=s.getPropertyValue("content");if(o===""||o==="none")return;let i=or();try{t.className=`${t.className} ${i}`}catch{return}let a=document.createElement("style");a.appendChild(Ps(i,n,s,r)),t.appendChild(a)}function dr(e,t,n){cr(e,t,":before",n),cr(e,t,":after",n)}var pr="application/font-woff",br="image/jpeg",$s={woff:pr,woff2:pr,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:br,jpeg:br,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Ms(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ie(e){let t=Ms(e).toLowerCase();return $s[t]||""}function As(e){return e.split(/,/)[1]}function rt(e){return e.search(/^(data:)/)!==-1}function cn(e,t){return`data:${t};base64,${e}`}async function dn(e,t,n){let r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);let s=await r.blob();return new Promise((o,i)=>{let a=new FileReader;a.onerror=i,a.onloadend=()=>{try{o(n({res:r,result:a.result}))}catch(d){i(d)}},a.readAsDataURL(s)})}var ln={};function Rs(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function He(e,t,n){let r=Rs(e,t,n.includeQueryParams);if(ln[r]!=null)return ln[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{let o=await dn(e,n.fetchRequestInit,({res:i,result:a})=>(t||(t=i.headers.get("Content-Type")||""),As(a)));s=cn(o,t)}catch(o){s=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;o&&(i=typeof o=="string"?o:o.message),i&&console.warn(i)}return ln[r]=s,s}async function zs(e){let t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ze(t)}async function Is(e,t){if(e.currentSrc){let o=document.createElement("canvas"),i=o.getContext("2d");o.width=e.clientWidth,o.height=e.clientHeight,i?.drawImage(e,0,0,o.width,o.height);let a=o.toDataURL();return ze(a)}let n=e.poster,r=Ie(n),s=await He(n,r,t);return ze(s)}async function Hs(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await st(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Ds(e,t){return W(e,HTMLCanvasElement)?zs(e):W(e,HTMLVideoElement)?Is(e,t):W(e,HTMLIFrameElement)?Hs(e,t):e.cloneNode(ur(e))}var Bs=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ur=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Os(e,t,n){var r,s;if(ur(t))return t;let o=[];return Bs(e)&&e.assignedNodes?o=te(e.assignedNodes()):W(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?o=te(e.contentDocument.body.childNodes):o=te(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),o.length===0||W(e,HTMLVideoElement)||await o.reduce((i,a)=>i.then(()=>st(a,n)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function Ns(e,t,n){let r=t.style;if(!r)return;let s=window.getComputedStyle(e);s.cssText?(r.cssText=s.cssText,r.transformOrigin=s.transformOrigin):zt(n).forEach(o=>{let i=s.getPropertyValue(o);o==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),W(e,HTMLIFrameElement)&&o==="display"&&i==="inline"&&(i="block"),o==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),r.setProperty(o,i,s.getPropertyPriority(o))})}function js(e,t){W(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),W(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function qs(e,t){if(W(e,HTMLSelectElement)){let r=Array.from(t.children).find(s=>e.value===s.getAttribute("value"));r&&r.setAttribute("selected","")}}function Us(e,t,n){return W(t,Element)&&(Ns(e,t,n),dr(e,t,n),js(e,t),qs(e,t)),t}async function Fs(e,t){let n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;let r={};for(let o=0;o<n.length;o++){let a=n[o].getAttribute("xlink:href");if(a){let d=e.querySelector(a),p=document.querySelector(a);!d&&p&&!r[a]&&(r[a]=await st(p,t,!0))}}let s=Object.values(r);if(s.length){let o="http://www.w3.org/1999/xhtml",i=document.createElementNS(o,"svg");i.setAttribute("xmlns",o),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";let a=document.createElementNS(o,"defs");i.appendChild(a);for(let d=0;d<s.length;d++)a.appendChild(s[d]);e.appendChild(i)}return e}async function st(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Ds(r,t)).then(r=>Os(e,r,t)).then(r=>Us(e,r,t)).then(r=>Fs(r,t))}var mr=/url\((['"]?)([^'"]+?)\1\)/g,Ws=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,_s=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Xs(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Ys(e){let t=[];return e.replace(mr,(n,r,s)=>(t.push(s),n)),t.filter(n=>!rt(n))}async function Vs(e,t,n,r,s){try{let o=n?sr(t,n):t,i=Ie(t),a;if(s){let d=await s(o);a=cn(d,i)}else a=await He(o,i,r);return e.replace(Xs(t),`$1${a}$3`)}catch{}return e}function Js(e,{preferredFontFormat:t}){return t?e.replace(_s,n=>{for(;;){let[r,,s]=Ws.exec(n)||[];if(!s)return"";if(s===t)return`src: ${r};`}}):e}function pn(e){return e.search(mr)!==-1}async function It(e,t,n){if(!pn(e))return e;let r=Js(e,n);return Ys(r).reduce((o,i)=>o.then(a=>Vs(a,i,t,n)),Promise.resolve(r))}async function De(e,t,n){var r;let s=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(s){let o=await It(s,null,n);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function Ks(e,t){await De("background",e,t)||await De("background-image",e,t),await De("mask",e,t)||await De("-webkit-mask",e,t)||await De("mask-image",e,t)||await De("-webkit-mask-image",e,t)}async function Gs(e,t){let n=W(e,HTMLImageElement);if(!(n&&!rt(e.src))&&!(W(e,SVGImageElement)&&!rt(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,s=await He(r,Ie(r),t);await new Promise((o,i)=>{e.onload=o,e.onerror=t.onImageErrorHandler?(...d)=>{try{o(t.onImageErrorHandler(...d))}catch(p){i(p)}}:i;let a=e;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),n?(e.srcset="",e.src=s):e.href.baseVal=s})}async function Qs(e,t){let r=te(e.childNodes).map(s=>bn(s,t));await Promise.all(r).then(()=>e)}async function bn(e,t){W(e,Element)&&(await Ks(e,t),await Gs(e,t),await Qs(e,t))}function fr(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(s=>{n[s]=r[s]}),e}var gr={};async function hr(e){let t=gr[e];if(t!=null)return t;let r=await(await fetch(e)).text();return t={url:e,cssText:r},gr[e]=t,t}async function yr(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),dn(a,t.fetchRequestInit,({result:d})=>(n=n.replace(i,`url(${d})`),[i,d]))});return Promise.all(o).then(()=>n)}function xr(e){if(e==null)return[];let t=[],n=/(\/\*[\s\S]*?\*\/)/gi,r=e.replace(n,""),s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){let d=s.exec(r);if(d===null)break;t.push(d[0])}r=r.replace(s,"");let o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(i,"gi");for(;;){let d=o.exec(r);if(d===null){if(d=a.exec(r),d===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;t.push(d[0])}return t}async function Zs(e,t){let n=[],r=[];return e.forEach(s=>{if("cssRules"in s)try{te(s.cssRules||[]).forEach((o,i)=>{if(o.type===CSSRule.IMPORT_RULE){let a=i+1,d=o.href,p=hr(d).then(b=>yr(b,t)).then(b=>xr(b).forEach(y=>{try{s.insertRule(y,y.startsWith("@import")?a+=1:s.cssRules.length)}catch(w){console.error("Error inserting rule from remote css",{rule:y,error:w})}})).catch(b=>{console.error("Error loading remote css",b.toString())});r.push(p)}})}catch(o){let i=e.find(a=>a.href==null)||document.styleSheets[0];s.href!=null&&r.push(hr(s.href).then(a=>yr(a,t)).then(a=>xr(a).forEach(d=>{i.insertRule(d,i.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(e.forEach(s=>{if("cssRules"in s)try{te(s.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${s.href}`,o)}}),n))}function eo(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pn(t.style.getPropertyValue("src")))}async function to(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");let n=te(e.ownerDocument.styleSheets),r=await Zs(n,t);return eo(r)}function vr(e){return e.trim().replace(/["']/g,"")}function no(e){let t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(o=>{t.add(vr(o))}),Array.from(r.children).forEach(o=>{o instanceof HTMLElement&&n(o)})}return n(e),t}async function wr(e,t){let n=await to(e,t),r=no(e);return(await Promise.all(n.filter(o=>r.has(vr(o.style.fontFamily))).map(o=>{let i=o.parentStyleSheet?o.parentStyleSheet.href:null;return It(o.cssText,i,t)}))).join(`
|
|
5
|
-
`)}async function
|
|
4
|
+
`)),ae.push(n),ae.length>Zn&&ae.shift(),V({type:"console",category:`console.${t}`,message:n.args.join(" ").slice(0,200),timestamp:n.timestamp})}function tr(t){t&&(Zn=t);for(let e of Object.keys(Ae))console[e]=function(...n){Bs(e,n),Ae[e].apply(console,n)}}function ut(){return[...ae]}function er(){ae=[]}function nr(){for(let t of Object.keys(Ae))console[t]=Ae[t]}var Ht=[],rr=50,Re,ze,Ie;function bn(t){Ht.push(t),Ht.length>rr&&Ht.shift(),V({type:"network",category:t.failed?"network.error":"network.ok",message:`${t.method} ${t.url} \u2192 ${t.status} (${t.duration}ms)`,timestamp:t.timestamp,data:{status:t.status,duration:t.duration}})}function sr(t){try{let e=new URL(t,window.location.origin),n=new URLSearchParams(e.search);for(let s of n.keys()){let o=s.toLowerCase();(o.includes("token")||o.includes("key")||o.includes("secret")||o.includes("password")||o.includes("auth"))&&n.set(s,"[REDACTED]")}let r=n.toString();return e.pathname+(r?"?"+r:"")}catch{return It(t)}}function Os(){Re=window.fetch,window.fetch=async function(t,e){let n=e?.method?.toUpperCase()??"GET",r=typeof t=="string"?t:t instanceof URL?t.href:t.url,s=sr(r),o=Date.now();try{let i=await Re.call(window,t,e);return bn({method:n,url:s,status:i.status,statusText:i.statusText,duration:Date.now()-o,responseType:i.headers.get("content-type")??void 0,timestamp:o,failed:i.status>=400}),i}catch(i){throw bn({method:n,url:s,status:0,statusText:"Network Error",duration:Date.now()-o,timestamp:o,failed:!0}),i}}}function Ns(){ze=XMLHttpRequest.prototype.open,Ie=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=function(t,e,...n){return this.__bs_method=t.toUpperCase(),this.__bs_url=sr(typeof e=="string"?e:e.href),ze.apply(this,[t,e,...n])},XMLHttpRequest.prototype.send=function(t){let e=Date.now();return this.addEventListener("loadend",function(){bn({method:this.__bs_method??"GET",url:this.__bs_url??"",status:this.status,statusText:this.statusText,duration:Date.now()-e,responseType:this.getResponseHeader("content-type")??void 0,timestamp:e,failed:this.status>=400||this.status===0})}),Ie.call(this,t)}}function or(t){t&&(rr=t),Os(),Ns()}function Dt(){return[...Ht]}function vt(){return Ht.filter(t=>t.failed)}function ir(){Ht=[]}function ar(){Re&&(window.fetch=Re),ze&&(XMLHttpRequest.prototype.open=ze),Ie&&(XMLHttpRequest.prototype.send=Ie)}var He=[],le=null,ce=null;function lr(){le=t=>{let e={message:t.message||"Unknown error",source:t.filename,lineno:t.lineno,colno:t.colno,stack:t.error?.stack,type:"error",timestamp:Date.now()};He.push(e),V({type:"error",category:"exception",message:e.message,timestamp:e.timestamp,data:{source:e.source,lineno:e.lineno}})},ce=t=>{let e=t.reason,n=e instanceof Error?e.message:typeof e=="string"?e:"Unhandled promise rejection",r={message:n,stack:e instanceof Error?e.stack:void 0,type:"unhandledrejection",timestamp:Date.now()};He.push(r),V({type:"error",category:"promise",message:n,timestamp:r.timestamp})},window.addEventListener("error",le),window.addEventListener("unhandledrejection",ce)}function ft(){return[...He]}function cr(){He=[]}function dr(){le&&window.removeEventListener("error",le),ce&&window.removeEventListener("unhandledrejection",ce),le=null,ce=null}var H=null,De=null,Be=null,Oe=null;function pr(){if(H={timestamp:Date.now()},performance.getEntriesByType){let t=()=>{let[e]=performance.getEntriesByType("navigation");e&&H&&(H.pageLoadTime=Math.round(e.loadEventEnd-e.startTime),H.domContentLoaded=Math.round(e.domContentLoadedEventEnd-e.startTime));let n=performance.getEntriesByType("paint");for(let s of n)s.name==="first-paint"&&H&&(H.firstPaint=Math.round(s.startTime)),s.name==="first-contentful-paint"&&H&&(H.firstContentfulPaint=Math.round(s.startTime));H&&(H.resourceCount=performance.getEntriesByType("resource").length);let r=performance.memory;r&&H&&(H.memoryUsage={usedJSHeapSize:r.usedJSHeapSize,totalJSHeapSize:r.totalJSHeapSize})};document.readyState==="complete"?setTimeout(t,0):window.addEventListener("load",()=>setTimeout(t,100))}if(typeof PerformanceObserver<"u"){try{De=new PerformanceObserver(t=>{let e=t.getEntries(),n=e[e.length-1];n&&H&&(H.largestContentfulPaint=Math.round(n.startTime))}),De.observe({type:"largest-contentful-paint",buffered:!0})}catch{}try{let t=0;Be=new PerformanceObserver(e=>{for(let n of e.getEntries())n.hadRecentInput||(t+=n.value);H&&(H.cumulativeLayoutShift=Math.round(t*1e3)/1e3)}),Be.observe({type:"layout-shift",buffered:!0})}catch{}try{Oe=new PerformanceObserver(t=>{let[e]=t.getEntries();e&&H&&(H.firstInputDelay=Math.round(e.processingStart-e.startTime))}),Oe.observe({type:"first-input",buffered:!0})}catch{}}}function Bt(){return H&&(H.timestamp=Date.now()),H?{...H}:null}function br(){De?.disconnect(),Be?.disconnect(),Oe?.disconnect(),De=null,Be=null,Oe=null,H=null}function ur(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;let n=document.implementation.createHTMLDocument(),r=n.createElement("base"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),e&&(r.href=e),s.href=t,s.href}var fr=(()=>{let t=0,e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function st(t){let e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n]);return e}var Ot=null;function je(t={}){return Ot||(t.includeStyleProperties?(Ot=t.includeStyleProperties,Ot):(Ot=st(window.getComputedStyle(document.documentElement)),Ot))}function Ne(t,e){let r=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return r?parseFloat(r.replace("px","")):0}function js(t){let e=Ne(t,"border-left-width"),n=Ne(t,"border-right-width");return t.clientWidth+e+n}function qs(t){let e=Ne(t,"border-top-width"),n=Ne(t,"border-bottom-width");return t.clientHeight+e+n}function un(t,e={}){let n=e.width||js(t),r=e.height||qs(t);return{width:n,height:r}}function mr(){let t,e;try{e=process}catch{}let n=e&&e.env?e.env.devicePixelRatio:null;return n&&(t=parseInt(n,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}var tt=16384;function gr(t){(t.width>tt||t.height>tt)&&(t.width>tt&&t.height>tt?t.width>t.height?(t.height*=tt/t.width,t.width=tt):(t.width*=tt/t.height,t.height=tt):t.width>tt?(t.height*=tt/t.width,t.width=tt):(t.width*=tt/t.height,t.height=tt))}function Nt(t){return new Promise((e,n)=>{let r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>e(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t})}async function Us(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function hr(t,e,n){let r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return s.setAttribute("width",`${e}`),s.setAttribute("height",`${n}`),s.setAttribute("viewBox",`0 0 ${e} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),s.appendChild(o),o.appendChild(t),Us(s)}var W=(t,e)=>{if(t instanceof e)return!0;let n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||W(n,e)};function Fs(t){let e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function _s(t,e){return je(e).map(n=>{let r=t.getPropertyValue(n),s=t.getPropertyPriority(n);return`${n}: ${r}${s?" !important":""};`}).join(" ")}function Ws(t,e,n,r){let s=`.${t}:${e}`,o=n.cssText?Fs(n):_s(n,r);return document.createTextNode(`${s}{${o}}`)}function vr(t,e,n,r){let s=window.getComputedStyle(t,n),o=s.getPropertyValue("content");if(o===""||o==="none")return;let i=fr();try{e.className=`${e.className} ${i}`}catch{return}let a=document.createElement("style");a.appendChild(Ws(i,n,s,r)),e.appendChild(a)}function yr(t,e,n){vr(t,e,":before",n),vr(t,e,":after",n)}var xr="application/font-woff",wr="image/jpeg",Ys={woff:xr,woff2:xr,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:wr,jpeg:wr,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Xs(t){let e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function jt(t){let e=Xs(t).toLowerCase();return Ys[e]||""}function Vs(t){return t.split(/,/)[1]}function de(t){return t.search(/^(data:)/)!==-1}function mn(t,e){return`data:${e};base64,${t}`}async function gn(t,e,n){let r=await fetch(t,e);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);let s=await r.blob();return new Promise((o,i)=>{let a=new FileReader;a.onerror=i,a.onloadend=()=>{try{o(n({res:r,result:a.result}))}catch(c){i(c)}},a.readAsDataURL(s)})}var fn={};function Js(t,e,n){let r=t.replace(/\?.*/,"");return n&&(r=t),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),e?`[${e}]${r}`:r}async function qt(t,e,n){let r=Js(t,e,n.includeQueryParams);if(fn[r]!=null)return fn[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let s;try{let o=await gn(t,n.fetchRequestInit,({res:i,result:a})=>(e||(e=i.headers.get("Content-Type")||""),Vs(a)));s=mn(o,e)}catch(o){s=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${t}`;o&&(i=typeof o=="string"?o:o.message),i&&console.warn(i)}return fn[r]=s,s}async function Ks(t){let e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):Nt(e)}async function Gs(t,e){if(t.currentSrc){let o=document.createElement("canvas"),i=o.getContext("2d");o.width=t.clientWidth,o.height=t.clientHeight,i?.drawImage(t,0,0,o.width,o.height);let a=o.toDataURL();return Nt(a)}let n=t.poster,r=jt(n),s=await qt(n,r,e);return Nt(s)}async function Qs(t,e){var n;try{if(!((n=t?.contentDocument)===null||n===void 0)&&n.body)return await pe(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function Zs(t,e){return W(t,HTMLCanvasElement)?Ks(t):W(t,HTMLVideoElement)?Gs(t,e):W(t,HTMLIFrameElement)?Qs(t,e):t.cloneNode(kr(t))}var to=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",kr=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function eo(t,e,n){var r,s;if(kr(e))return e;let o=[];return to(t)&&t.assignedNodes?o=st(t.assignedNodes()):W(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?o=st(t.contentDocument.body.childNodes):o=st(((s=t.shadowRoot)!==null&&s!==void 0?s:t).childNodes),o.length===0||W(t,HTMLVideoElement)||await o.reduce((i,a)=>i.then(()=>pe(a,n)).then(c=>{c&&e.appendChild(c)}),Promise.resolve()),e}function no(t,e,n){let r=e.style;if(!r)return;let s=window.getComputedStyle(t);s.cssText?(r.cssText=s.cssText,r.transformOrigin=s.transformOrigin):je(n).forEach(o=>{let i=s.getPropertyValue(o);o==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),W(t,HTMLIFrameElement)&&o==="display"&&i==="inline"&&(i="block"),o==="d"&&e.getAttribute("d")&&(i=`path(${e.getAttribute("d")})`),r.setProperty(o,i,s.getPropertyPriority(o))})}function ro(t,e){W(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),W(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function so(t,e){if(W(t,HTMLSelectElement)){let r=Array.from(e.children).find(s=>t.value===s.getAttribute("value"));r&&r.setAttribute("selected","")}}function oo(t,e,n){return W(e,Element)&&(no(t,e,n),yr(t,e,n),ro(t,e),so(t,e)),e}async function io(t,e){let n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;let r={};for(let o=0;o<n.length;o++){let a=n[o].getAttribute("xlink:href");if(a){let c=t.querySelector(a),p=document.querySelector(a);!c&&p&&!r[a]&&(r[a]=await pe(p,e,!0))}}let s=Object.values(r);if(s.length){let o="http://www.w3.org/1999/xhtml",i=document.createElementNS(o,"svg");i.setAttribute("xmlns",o),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";let a=document.createElementNS(o,"defs");i.appendChild(a);for(let c=0;c<s.length;c++)a.appendChild(s[c]);t.appendChild(i)}return t}async function pe(t,e,n){return!n&&e.filter&&!e.filter(t)?null:Promise.resolve(t).then(r=>Zs(r,e)).then(r=>eo(t,r,e)).then(r=>oo(t,r,e)).then(r=>io(r,e))}var Er=/url\((['"]?)([^'"]+?)\1\)/g,ao=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,lo=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function co(t){let e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function po(t){let e=[];return t.replace(Er,(n,r,s)=>(e.push(s),n)),e.filter(n=>!de(n))}async function bo(t,e,n,r,s){try{let o=n?ur(e,n):e,i=jt(e),a;if(s){let c=await s(o);a=mn(c,i)}else a=await qt(o,i,r);return t.replace(co(e),`$1${a}$3`)}catch{}return t}function uo(t,{preferredFontFormat:e}){return e?t.replace(lo,n=>{for(;;){let[r,,s]=ao.exec(n)||[];if(!s)return"";if(s===e)return`src: ${r};`}}):t}function hn(t){return t.search(Er)!==-1}async function qe(t,e,n){if(!hn(t))return t;let r=uo(t,n);return po(r).reduce((o,i)=>o.then(a=>bo(a,i,e,n)),Promise.resolve(r))}async function Ut(t,e,n){var r;let s=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(s){let o=await qe(s,null,n);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function fo(t,e){await Ut("background",t,e)||await Ut("background-image",t,e),await Ut("mask",t,e)||await Ut("-webkit-mask",t,e)||await Ut("mask-image",t,e)||await Ut("-webkit-mask-image",t,e)}async function mo(t,e){let n=W(t,HTMLImageElement);if(!(n&&!de(t.src))&&!(W(t,SVGImageElement)&&!de(t.href.baseVal)))return;let r=n?t.src:t.href.baseVal,s=await qt(r,jt(r),e);await new Promise((o,i)=>{t.onload=o,t.onerror=e.onImageErrorHandler?(...c)=>{try{o(e.onImageErrorHandler(...c))}catch(p){i(p)}}:i;let a=t;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),n?(t.srcset="",t.src=s):t.href.baseVal=s})}async function go(t,e){let r=st(t.childNodes).map(s=>vn(s,e));await Promise.all(r).then(()=>t)}async function vn(t,e){W(t,Element)&&(await fo(t,e),await mo(t,e),await go(t,e))}function Lr(t,e){let{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);let r=e.style;return r!=null&&Object.keys(r).forEach(s=>{n[s]=r[s]}),t}var Sr={};async function Cr(t){let e=Sr[t];if(e!=null)return e;let r=await(await fetch(t)).text();return e={url:t,cssText:r},Sr[t]=e,e}async function Pr(t,e){let n=t.cssText,r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,t.url).href),gn(a,e.fetchRequestInit,({result:c})=>(n=n.replace(i,`url(${c})`),[i,c]))});return Promise.all(o).then(()=>n)}function Tr(t){if(t==null)return[];let e=[],n=/(\/\*[\s\S]*?\*\/)/gi,r=t.replace(n,""),s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){let c=s.exec(r);if(c===null)break;e.push(c[0])}r=r.replace(s,"");let o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(i,"gi");for(;;){let c=o.exec(r);if(c===null){if(c=a.exec(r),c===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;e.push(c[0])}return e}async function ho(t,e){let n=[],r=[];return t.forEach(s=>{if("cssRules"in s)try{st(s.cssRules||[]).forEach((o,i)=>{if(o.type===CSSRule.IMPORT_RULE){let a=i+1,c=o.href,p=Cr(c).then(b=>Pr(b,e)).then(b=>Tr(b).forEach(v=>{try{s.insertRule(v,v.startsWith("@import")?a+=1:s.cssRules.length)}catch(S){console.error("Error inserting rule from remote css",{rule:v,error:S})}})).catch(b=>{console.error("Error loading remote css",b.toString())});r.push(p)}})}catch(o){let i=t.find(a=>a.href==null)||document.styleSheets[0];s.href!=null&&r.push(Cr(s.href).then(a=>Pr(a,e)).then(a=>Tr(a).forEach(c=>{i.insertRule(c,i.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(t.forEach(s=>{if("cssRules"in s)try{st(s.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${s.href}`,o)}}),n))}function vo(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>hn(e.style.getPropertyValue("src")))}async function yo(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");let n=st(t.ownerDocument.styleSheets),r=await ho(n,e);return vo(r)}function $r(t){return t.trim().replace(/["']/g,"")}function xo(t){let e=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(o=>{e.add($r(o))}),Array.from(r.children).forEach(o=>{o instanceof HTMLElement&&n(o)})}return n(t),e}async function Mr(t,e){let n=await yo(t,e),r=xo(t);return(await Promise.all(n.filter(o=>r.has($r(o.style.fontFamily))).map(o=>{let i=o.parentStyleSheet?o.parentStyleSheet.href:null;return qe(o.cssText,i,e)}))).join(`
|
|
5
|
+
`)}async function Ar(t,e){let n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await Mr(t,e);if(n){let r=document.createElement("style"),s=document.createTextNode(n);r.appendChild(s),t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)}}async function wo(t,e={}){let{width:n,height:r}=un(t,e),s=await pe(t,e,!0);return await Ar(s,e),await vn(s,e),Lr(s,e),await hr(s,n,r)}async function ko(t,e={}){let{width:n,height:r}=un(t,e),s=await wo(t,e),o=await Nt(s),i=document.createElement("canvas"),a=i.getContext("2d"),c=e.pixelRatio||mr(),p=e.canvasWidth||n,b=e.canvasHeight||r;return i.width=p*c,i.height=b*c,e.skipAutoScale||gr(i),i.style.width=`${p}`,i.style.height=`${b}`,e.backgroundColor&&(a.fillStyle=e.backgroundColor,a.fillRect(0,0,i.width,i.height)),a.drawImage(o,0,0,i.width,i.height),i}async function Rr(t,e={}){return(await ko(t,e)).toDataURL()}function Eo(){let t=document.createElement("div");if(t.style.cssText=`
|
|
6
6
|
position: fixed; inset: 0; z-index: 2147483647;
|
|
7
7
|
background: white; opacity: 0;
|
|
8
8
|
pointer-events: none;
|
|
9
9
|
animation: bs-flash 0.4s ease-out forwards;
|
|
10
|
-
`,!document.getElementById("bs-flash-style")){let
|
|
10
|
+
`,!document.getElementById("bs-flash-style")){let e=document.createElement("style");e.id="bs-flash-style",e.textContent=`
|
|
11
11
|
@keyframes bs-flash {
|
|
12
12
|
0% { opacity: 0; }
|
|
13
13
|
15% { opacity: 0.7; }
|
|
14
14
|
100% { opacity: 0; }
|
|
15
15
|
}
|
|
16
|
-
`,document.head.appendChild(
|
|
16
|
+
`,document.head.appendChild(e)}document.body.appendChild(t),t.addEventListener("animationend",()=>t.remove())}var Lo=t=>{let e=t.tagName.toLowerCase();return e==="bugstash-root"||e==="bugstash-overlay"||t.classList?.contains("bs-fab")||t.classList?.contains("bs-toolbar")||t.classList?.contains("bs-modal")||t.classList?.contains("bs-backdrop")||t.id==="bs-flash-style"||t.id==="bugstash-live-pins"||t.id==="bugstash-pin-overlay"};async function Ue(t=!1){t&&Eo();try{let e=await So();if(e)return e}catch{}try{return await zr()}catch{try{return await zr(!0)}catch{return null}}}async function So(){if(!navigator.mediaDevices?.getDisplayMedia)return null;let t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:{ideal:window.screen.width*(window.devicePixelRatio||1)},height:{ideal:window.screen.height*(window.devicePixelRatio||1)}},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include",monitorTypeSurfaces:"exclude"});try{if(!t.getVideoTracks()[0])return null;let n=document.createElement("video");n.srcObject=t,n.muted=!0,n.playsInline=!0,await n.play(),await new Promise(o=>{if(n.readyState>=2){o();return}n.onloadeddata=()=>o()}),await new Promise(o=>requestAnimationFrame(()=>o()));let r=document.createElement("canvas");r.width=n.videoWidth,r.height=n.videoHeight;let s=r.getContext("2d");return s?(s.drawImage(n,0,0),r.toDataURL("image/png")):null}finally{t.getTracks().forEach(e=>e.stop())}}async function zr(t=!1){let e=window.getComputedStyle(document.body).backgroundColor,n=window.getComputedStyle(document.documentElement).backgroundColor,r=i=>!i||i==="transparent"||i==="rgba(0, 0, 0, 0)",s=r(e)?r(n)?"#ffffff":n:e;return await Rr(document.body,{pixelRatio:Math.min(window.devicePixelRatio||1,2),backgroundColor:s,width:window.innerWidth,height:window.innerHeight,filter:i=>{if(t&&i.tagName==="IMG"){let a=i.src||"";if(a&&!a.startsWith(window.location.origin)&&!a.startsWith("data:"))return!1}return!Lo(i)},imagePlaceholder:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"})}var Co="https://bugstash-backend.vercel.app",Ir="https://bugstash-backend.vercel.app",X=Co,yn=!1;function Hr(t){X=t.replace(/\/$/,""),yn=!1}function Dr(){return X}async function ct(t,e){try{return await fetch(t,e)}catch(n){if(yn)throw n;yn=!0;let r=X;X=Ir;let s=t.replace(r,Ir);return fetch(s,e)}}var xn="bugstash_auth";function wn(){try{let t=localStorage.getItem(xn);if(!t)return null;let e=JSON.parse(t);return e.tokens.expiresAt<Date.now(),e}catch{return null}}function Br(t){localStorage.setItem(xn,JSON.stringify(t))}function Po(){localStorage.removeItem(xn)}function ot(){return wn()?.user||null}function Or(){return wn()?.tokens.accessToken||null}async function yt(){let t=wn();if(!t)return{"Content-Type":"application/json"};if(t.tokens.expiresAt<Date.now()+6e4)try{let e=await ct(`${X}/api/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t.tokens.refreshToken})});if(e.ok){let n=await e.json();n.success&&(t.tokens=n.data,Br(t))}}catch{}return{"Content-Type":"application/json",Authorization:`Bearer ${t.tokens.accessToken}`}}async function _e(t,e,n){try{let s=await(await ct(`${X}/api/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:e,projectId:n})})).json();return s.success&&Br({user:s.data.user,tokens:s.data.tokens}),s}catch{return{success:!1,error:"Network error"}}}async function We(){Po()}async function kn(t){try{let e=await yt();return await(await ct(`${X}/api/reports`,{method:"POST",headers:e,body:JSON.stringify(t)})).json()}catch{return{success:!1,error:"Network error - could not reach BugStash"}}}async function Nr(t,e){try{let n=await yt();return await(await ct(`${X}/api/pins/by-page?projectId=${t}&pathname=${encodeURIComponent(e)}`,{headers:n})).json()}catch{return{success:!1,error:"Network error"}}}async function En(t){try{let e=await yt();return await(await ct(`${X}/api/pins`,{method:"POST",headers:e,body:JSON.stringify(t)})).json()}catch{return{success:!1,error:"Network error"}}}async function Ye(t,e){try{let n=await yt();return await(await ct(`${X}/api/pins/${t}`,{method:"PUT",headers:n,body:JSON.stringify(e)})).json()}catch{return{success:!1,error:"Network error"}}}async function jr(t){try{let e=await yt();return await(await ct(`${X}/api/pins/${t}`,{method:"DELETE",headers:e})).json()}catch{return{success:!1,error:"Network error"}}}async function qr(t){try{let e=await yt();return await(await ct(`${X}/api/pins/${t}/comments`,{headers:e})).json()}catch{return{success:!1,error:"Network error"}}}async function Ln(t,e,n=[]){try{let r=await yt();return await(await ct(`${X}/api/pins/${t}/comments`,{method:"POST",headers:r,body:JSON.stringify({body:e,mentions:n})})).json()}catch{return{success:!1,error:"Network error"}}}async function Ur(t){try{let e=await yt();return await(await ct(`${X}/api/members/for-project/${t}`,{headers:e})).json()}catch{return{success:!1,error:"Network error"}}}var Fe=null;function Fr(t){return Fe||(Fe=(async()=>{try{let e=await fetch(`${X}/api/orgs/projects/${encodeURIComponent(t)}/verify-domain`,{headers:{"Content-Type":"application/json"}});return e.ok?(await e.json()).allowed===!0:!1}catch{return!1}})(),Fe)}var Sn="bugstash_offline_queue";function Cn(t){let e=_r();e.push({...t,id:Math.random().toString(36).slice(2),timestamp:Date.now()}),localStorage.setItem(Sn,JSON.stringify(e))}function _r(){try{return JSON.parse(localStorage.getItem(Sn)||"[]")}catch{return[]}}async function To(){let t=_r();if(t.length===0)return 0;let e=0,n=[];for(let r of t)try{let s;switch(r.type){case"create_pin":s=await En(r.data);break;case"create_comment":s=await Ln(r.data.pinId,r.data.body,r.data.mentions);break;case"update_pin":s=await Ye(r.data.pinId,r.data.updates);break;case"submit_report":s=await kn(r.data);break;default:s={success:!1,error:"Unknown action"}}s.success?e++:n.push(r)}catch{n.push(r)}return localStorage.setItem(Sn,JSON.stringify(n)),e}typeof window<"u"&&window.addEventListener("online",()=>{To().catch(()=>{})});var Pn=[{id:"slate",name:"Slate",preview:["#0f1117","#6E9ED0"],vars:{"--bs-bg":"#0f1117","--bs-bg2":"#1a1d27","--bs-bg3":"#2a2d37","--bs-text":"#e8eaed","--bs-muted":"#9ca3af","--bs-border":"#2a2d37","--bs-accent":"#6E9ED0","--bs-accent2":"#C3CAD6","--bs-fab1":"#6E9ED0","--bs-fab2":"#4a7ba8","--bs-radius":"12px","--bs-radius-sm":"8px","--bs-red":"#ef4444","--bs-green":"#22c55e","--bs-orange":"#f97316","--bs-yellow":"#eab308"}},{id:"black",name:"Dark",preview:["#0a0a0a","#ffffff"],vars:{"--bs-bg":"#0a0a0a","--bs-bg2":"#141414","--bs-bg3":"#1e1e1e","--bs-text":"#f5f5f5","--bs-muted":"#737373","--bs-border":"#262626","--bs-accent":"#f5f5f5","--bs-accent2":"#d4d4d4","--bs-fab1":"#262626","--bs-fab2":"#171717","--bs-radius":"12px","--bs-radius-sm":"8px","--bs-red":"#ef4444","--bs-green":"#22c55e","--bs-orange":"#f97316","--bs-yellow":"#eab308"}},{id:"white",name:"Light",preview:["#ffffff","#0a0a0a"],vars:{"--bs-bg":"#ffffff","--bs-bg2":"#f5f5f5","--bs-bg3":"#e5e5e5","--bs-text":"#0a0a0a","--bs-muted":"#737373","--bs-border":"#e5e5e5","--bs-accent":"#0a0a0a","--bs-accent2":"#404040","--bs-fab1":"#0a0a0a","--bs-fab2":"#262626","--bs-radius":"12px","--bs-radius-sm":"8px","--bs-red":"#dc2626","--bs-green":"#16a34a","--bs-orange":"#ea580c","--bs-yellow":"#ca8a04"}}];function Xe(){return Pn}function Ve(t){return Pn.find(e=>e.id===t)}function Wr(){return Pn[0]}var Tn=[{id:"classic",name:"Center",description:"Centered modal",tabPosition:"top"},{id:"drawer-right",name:"Right Drawer",description:"Slides from right",tabPosition:"top"},{id:"bottom-sheet",name:"Bottom Sheet",description:"Slides from bottom",tabPosition:"top"},{id:"sidebar-tabs",name:"Sidebar",description:"Side navigation",tabPosition:"left"}];function Je(){return Tn}function be(t){return Tn.find(e=>e.id===t)}function Yr(){return Tn[0]}var Xr=`
|
|
17
17
|
/* \u2500\u2500 1. Classic (default \u2014 no overrides) \u2500\u2500 */
|
|
18
18
|
|
|
19
19
|
/* \u2500\u2500 2. Drawer Right \u2500\u2500 */
|
|
@@ -73,229 +73,374 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
73
73
|
}
|
|
74
74
|
.bs-ly-sidebar-tabs .bs-tab-divider { display: none; }
|
|
75
75
|
.bs-ly-sidebar-tabs .bs-scroll { flex: 1; }
|
|
76
|
-
`;var
|
|
76
|
+
`;var Wt=null,Ke=0,$o=5e3,Ft=new Map,_t=null,Ge=new Set;function Yt(t){_t=t,Ke=Date.now(),Mo()}function Mo(){Wt||(Wt=setInterval(Ao,$o))}async function Ao(){if(!_t)return;let t=Or();if(t)try{let e=Dr(),n=window.location.pathname,r=await fetch(`${e}/api/pins/poll?projectId=${_t}&pathname=${encodeURIComponent(n)}&since=${Ke}`,{headers:{Authorization:`Bearer ${t}`}});if(!r.ok)return;let s=await r.json();if(!s.success)return;let o=Array.isArray(s.data)?s.data:s.data?.pins||[];Ke=s.serverTime||s.data?.serverTime||Date.now();for(let i of o)Ge.has(i.id)?Vr("pin:updated",{type:"pin:updated",projectId:_t,data:i,userId:"",timestamp:Date.now()}):(Ge.add(i.id),Vr("pin:created",{type:"pin:created",projectId:_t,data:i,userId:"",timestamp:Date.now()}))}catch{}}function Jr(){Wt&&(clearInterval(Wt),Wt=null),_t=null,Ge.clear(),Ke=0}function ue(t,e){return Ft.has(t)||Ft.set(t,new Set),Ft.get(t).add(e),()=>{Ft.get(t)?.delete(e)}}function Vr(t,e){Ft.get(t)?.forEach(n=>n(e)),Ft.get("*")?.forEach(n=>n(e))}function $n(t){Ge=new Set(t)}function Kr(){return Wt!==null}var en,Y=null,L=null,$=[],rs=[],Xt=!1,Jt=null,Ro="",Vt=null,Ze=null,An=[],fe=null,me=null,Pt={x:0,y:0};function ss(){if(!me)return;let t=document.createElement("div");t.style.cssText="position:fixed!important;top:0!important;left:0!important;width:1px!important;height:1px!important;pointer-events:none!important;visibility:hidden!important;z-index:-1!important;opacity:0!important;",me.appendChild(t);try{let e=t.getBoundingClientRect();Pt={x:-e.left,y:-e.top}}finally{t.remove()}}function os(t){return Pt.x===0&&Pt.y===0?t:{left:`${parseFloat(t.left)+Pt.x}px`,top:`${parseFloat(t.top)+Pt.y}px`,hidden:t.hidden}}function Gr(t,e){return{left:`${t+Pt.x}px`,top:`${e+Pt.y}px`}}var tn={open:"#f97316",in_progress:"#3b82f6",resolved:"#22c55e",closed:"#6b7280"},Qr={critical:"#ef4444",high:"#f97316",medium:"#eab308",low:"#6b7280"};function Kt(t,e){en=t,me=e,Ro=window.location.pathname,No(),ss(),ds(),jo(),Yo(),Xo(),Io()}function is(){Ho(),Y?.remove(),Y=null,L?.remove(),L=null,me=null,$=[]}function $t(t){return Xt=t!==void 0?t:!Xt,L&&L.style.setProperty("display",Xt?"block":"none","important"),Xt}function nn(){return Xt}function as(t){try{let e=document.documentElement.scrollWidth||document.body.scrollWidth||1,n=document.documentElement.scrollHeight||document.body.scrollHeight||1,r=window.scrollX,s=window.scrollY,o=zn(t.elementSelector,t.elementXPath),i=Qe(t)&&t.xPercent>=0&&t.xPercent<=1&&t.yPercent>=0&&t.yPercent<=1,a=o?zo(o):!1;if(i&&o){let c=o.getBoundingClientRect();if(c.width>0&&c.height>0){let p=c.left+t.xPercent*c.width,b=c.top+t.yPercent*c.height;return{left:`${p}px`,top:`${b}px`,hidden:a}}}if(i)return t.pageX>0||t.pageY>0?{left:`${t.pageX-r}px`,top:`${t.pageY-s}px`,hidden:!1}:{left:`${t.xPercent*e-r}px`,top:`${t.yPercent*n-s}px`,hidden:!1};if(o){let c=o.getBoundingClientRect();if(c.width>0&&c.height>0){if(t.pageX>0||t.pageY>0){let p=Qe(t)?t.xPercent/100*e:t.pageX,b=Qe(t)?t.yPercent/100*n:t.pageY,v=c.left+c.width/2,S=c.top+c.height/2,D=p-r,R=b-s;return Math.abs(D-v)+Math.abs(R-S)>100?{left:`${v}px`,top:`${S}px`,hidden:a}:{left:`${D}px`,top:`${R}px`,hidden:a}}return{left:`${c.left+c.width/2}px`,top:`${c.top+c.height/2}px`,hidden:a}}}return Qe(t)?{left:`${t.xPercent/100*e-r}px`,top:`${t.yPercent/100*n-s}px`,hidden:!1}:{left:`${t.pageX-r}px`,top:`${t.pageY-s}px`,hidden:!1}}catch{let e=(t.pageX||0)-(window.scrollX||0),n=(t.pageY||0)-(window.scrollY||0);return{left:`${e}px`,top:`${n}px`,hidden:!1}}}function Qe(t){return t.xPercent!=null&&t.yPercent!=null&&(t.xPercent!==0||t.yPercent!==0||t.pageX===0&&t.pageY===0)}function zn(t,e){let n;if(t&&t.startsWith('["')&&t.endsWith('"]'))try{let r=JSON.parse(t);n=Array.isArray(r)?r.filter(s=>typeof s=="string"):[t]}catch{n=[t]}else n=t?[t]:[];for(let r of n)if(r&&r!=="body")try{let s=document.querySelector(r);if(s)return s}catch{}if(e)try{let r=document.evaluate(e,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null);if(r.singleNodeValue instanceof Element)return r.singleNodeValue}catch{}return null}function zo(t){let e=t.getBoundingClientRect();if(e.bottom<=0||e.top>=window.innerHeight||e.right<=0||e.left>=window.innerWidth)return!0;let n=t.parentElement;for(;n&&n!==document.documentElement;){let r=window.getComputedStyle(n),s=r.overflowY,o=r.overflowX;if(s==="hidden"||s==="scroll"||s==="auto"||o==="hidden"||o==="scroll"||o==="auto"){let i=n.getBoundingClientRect();if(e.bottom<=i.top||e.top>=i.bottom||e.right<=i.left||e.left>=i.right)return!0}n=n.parentElement}return!1}function Io(){window.addEventListener("scroll",Tt,{passive:!0}),window.addEventListener("resize",Tt,{passive:!0}),window.addEventListener("keydown",ls),Ze=new MutationObserver(t=>{t.every(n=>Y?.contains(n.target)||L?.contains(n.target))||Tt()}),Ze.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}),typeof ResizeObserver<"u"&&(fe=new ResizeObserver(()=>Tt()))}function Ho(){window.removeEventListener("scroll",Tt),window.removeEventListener("resize",Tt),window.removeEventListener("keydown",ls),cs(),Ze?.disconnect(),Ze=null,fe?.disconnect(),fe=null,Vt&&(cancelAnimationFrame(Vt),Vt=null)}function ls(t){t.key==="Escape"&&(Jt?xt():Xt&&(Y?.querySelectorAll(".bs-lp-form").forEach(e=>e.remove()),$t(!1)))}function Tt(){Vt||(Vt=requestAnimationFrame(()=>{Vt=null,ss(),Do()}))}function Do(){if(!Y)return;Y.querySelectorAll(".bs-lp").forEach(e=>{let n=e.dataset.pinId,r=$.find(o=>o.id===n);if(!r)return;let s=os(as(r));e.style.left=s.left,e.style.top=s.top,e.style.display=s.hidden?"none":""})}function Bo(t){let e=[],n=t.parentElement;for(;n&&n!==document.documentElement;){let r=window.getComputedStyle(n),s=r.overflowY,o=r.overflowX;(s==="auto"||s==="scroll"||o==="auto"||o==="scroll")&&(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&e.push(n),n=n.parentElement}return e}function Oo(){cs();let t=new Set;for(let e of $){let n=zn(e.elementSelector,e.elementXPath);if(!n)continue;let r=Bo(n);for(let s of r){if(t.has(s))continue;t.add(s);let o=()=>Tt();s.addEventListener("scroll",o,{passive:!0}),An.push(()=>s.removeEventListener("scroll",o))}}}function cs(){for(let t of An)t();An=[]}function No(){if(Y)return;Y=document.createElement("div"),Y.id="bugstash-live-pins",L=document.createElement("bugstash-overlay"),L.style.setProperty("display","none","important"),L.style.setProperty("position","fixed","important"),L.style.setProperty("inset","0","important"),L.style.setProperty("z-index","2147483641","important"),L.style.setProperty("cursor","crosshair","important"),L.style.setProperty("background","rgba(0,0,0,0.05)","important"),L.style.setProperty("margin","0","important"),L.style.setProperty("padding","0","important"),L.style.setProperty("border","none","important"),L.style.setProperty("opacity","1","important"),L.style.setProperty("visibility","visible","important"),L.style.setProperty("pointer-events","auto","important"),L.style.setProperty("transform","none","important"),L.style.setProperty("filter","none","important"),L.style.setProperty("perspective","none","important"),L.style.setProperty("will-change","auto","important"),L.style.setProperty("contain","none","important"),L.style.setProperty("clip-path","none","important"),L.style.setProperty("isolation","auto","important"),L.style.setProperty("mix-blend-mode","normal","important"),L.style.setProperty("box-sizing","border-box","important"),L.style.setProperty("overflow","visible","important"),L.style.setProperty("float","none","important");let t=document.createElement("style");t.textContent=`
|
|
77
|
+
/* \u2500\u2500\u2500 Isolation Reset \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
78
|
+
:host {
|
|
79
|
+
all: initial !important;
|
|
80
|
+
position: fixed !important;
|
|
81
|
+
inset: 0 !important;
|
|
82
|
+
pointer-events: none !important;
|
|
83
|
+
z-index: 2147483640 !important;
|
|
84
|
+
display: block !important;
|
|
85
|
+
visibility: visible !important;
|
|
86
|
+
opacity: 1 !important;
|
|
87
|
+
transform: none !important;
|
|
88
|
+
perspective: none !important;
|
|
89
|
+
filter: none !important;
|
|
90
|
+
will-change: auto !important;
|
|
91
|
+
contain: none !important;
|
|
92
|
+
isolation: auto !important;
|
|
93
|
+
}
|
|
94
|
+
*, *::before, *::after {
|
|
95
|
+
box-sizing: border-box !important;
|
|
96
|
+
margin: 0;
|
|
97
|
+
padding: 0;
|
|
98
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
99
|
+
line-height: 1.5;
|
|
100
|
+
direction: ltr;
|
|
101
|
+
text-align: left;
|
|
102
|
+
-webkit-text-size-adjust: 100%;
|
|
103
|
+
-webkit-font-smoothing: antialiased;
|
|
104
|
+
-moz-osx-font-smoothing: grayscale;
|
|
105
|
+
}
|
|
106
|
+
/* Color scheme support */
|
|
107
|
+
@media (prefers-color-scheme: light) {
|
|
108
|
+
:host { --bs-pin-bg: #ffffff; --bs-pin-text: #171717; --bs-pin-muted: #6b7280; --bs-pin-border: #eaeaea; --bs-pin-surface: #fafafa; --bs-pin-input-bg: #ffffff; --bs-pin-hover: #f5f5f5; --bs-pin-shadow: rgba(0,0,0,0.08); --bs-pin-shadow-lg: rgba(0,0,0,0.12); }
|
|
109
|
+
}
|
|
110
|
+
@media (prefers-color-scheme: dark) {
|
|
111
|
+
:host { --bs-pin-bg: #1a1a1a; --bs-pin-text: #ededed; --bs-pin-muted: #888; --bs-pin-border: #333; --bs-pin-surface: #222; --bs-pin-input-bg: #2a2a2a; --bs-pin-hover: #2a2a2a; --bs-pin-shadow: rgba(0,0,0,0.2); --bs-pin-shadow-lg: rgba(0,0,0,0.4); }
|
|
112
|
+
}
|
|
113
|
+
/* Fallback (default to light) */
|
|
114
|
+
:host {
|
|
115
|
+
--bs-pin-bg: #ffffff; --bs-pin-text: #171717; --bs-pin-muted: #6b7280; --bs-pin-border: #eaeaea; --bs-pin-surface: #fafafa; --bs-pin-input-bg: #ffffff; --bs-pin-hover: #f5f5f5; --bs-pin-shadow: rgba(0,0,0,0.08); --bs-pin-shadow-lg: rgba(0,0,0,0.12);
|
|
116
|
+
}
|
|
117
|
+
@media (prefers-color-scheme: dark) {
|
|
118
|
+
:host { --bs-pin-bg: #1a1a1a; --bs-pin-text: #ededed; --bs-pin-muted: #888; --bs-pin-border: #333; --bs-pin-surface: #222; --bs-pin-input-bg: #2a2a2a; --bs-pin-hover: #2a2a2a; --bs-pin-shadow: rgba(0,0,0,0.2); --bs-pin-shadow-lg: rgba(0,0,0,0.4); }
|
|
119
|
+
}
|
|
77
120
|
#bugstash-live-pins {
|
|
78
|
-
position: fixed;
|
|
79
|
-
top: 0;
|
|
80
|
-
left: 0;
|
|
81
|
-
width: 0;
|
|
82
|
-
height: 0;
|
|
83
|
-
overflow: visible;
|
|
84
|
-
z-index: 2147483640;
|
|
85
|
-
pointer-events: none;
|
|
121
|
+
position: fixed !important;
|
|
122
|
+
top: 0 !important;
|
|
123
|
+
left: 0 !important;
|
|
124
|
+
width: 0 !important;
|
|
125
|
+
height: 0 !important;
|
|
126
|
+
overflow: visible !important;
|
|
127
|
+
z-index: 2147483640 !important;
|
|
128
|
+
pointer-events: none !important;
|
|
129
|
+
transform: none !important;
|
|
130
|
+
perspective: none !important;
|
|
131
|
+
filter: none !important;
|
|
132
|
+
will-change: auto !important;
|
|
133
|
+
contain: none !important;
|
|
86
134
|
}
|
|
87
|
-
|
|
135
|
+
|
|
136
|
+
/* \u2500\u2500 Pin Marker (Avatar-based) \u2500\u2500 */
|
|
88
137
|
.bs-lp {
|
|
89
|
-
position: fixed;
|
|
90
|
-
pointer-events: auto;
|
|
91
|
-
cursor: pointer;
|
|
92
|
-
transform: translate(-50%, -50%);
|
|
138
|
+
position: fixed !important;
|
|
139
|
+
pointer-events: auto !important;
|
|
140
|
+
cursor: pointer !important;
|
|
141
|
+
transform: translate(-50%, -50%) !important;
|
|
93
142
|
z-index: 1;
|
|
94
|
-
transition: transform 0.
|
|
143
|
+
transition: transform 0.15s ease, box-shadow 0.15s ease;
|
|
95
144
|
}
|
|
96
|
-
.bs-lp:hover { transform: translate(-50%, -50%) scale(1.
|
|
145
|
+
.bs-lp:hover { transform: translate(-50%, -50%) scale(1.1) !important; z-index: 5; }
|
|
97
146
|
.bs-lp-dot {
|
|
98
|
-
width:
|
|
99
|
-
height:
|
|
147
|
+
width: 32px;
|
|
148
|
+
height: 32px;
|
|
100
149
|
border-radius: 50%;
|
|
101
150
|
display: flex;
|
|
102
151
|
align-items: center;
|
|
103
152
|
justify-content: center;
|
|
104
|
-
font-size:
|
|
105
|
-
font-weight:
|
|
153
|
+
font-size: 12px;
|
|
154
|
+
font-weight: 600;
|
|
106
155
|
font-family: -apple-system, system-ui, sans-serif;
|
|
107
156
|
color: #fff;
|
|
108
|
-
box-shadow: 0 2px 8px rgba(0,0,0,0.
|
|
157
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
|
109
158
|
position: relative;
|
|
159
|
+
overflow: hidden;
|
|
160
|
+
background-size: cover;
|
|
161
|
+
background-position: center;
|
|
110
162
|
}
|
|
111
|
-
.bs-lp-
|
|
112
|
-
|
|
113
|
-
|
|
163
|
+
.bs-lp-avatar {
|
|
164
|
+
width: 100%;
|
|
165
|
+
height: 100%;
|
|
114
166
|
border-radius: 50%;
|
|
115
|
-
|
|
116
|
-
opacity: 0;
|
|
117
|
-
animation: bs-lp-pulse 2s ease-out infinite;
|
|
167
|
+
object-fit: cover;
|
|
118
168
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
169
|
+
.bs-lp-initials {
|
|
170
|
+
width: 100%;
|
|
171
|
+
height: 100%;
|
|
172
|
+
border-radius: 50%;
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
font-size: 12px;
|
|
177
|
+
font-weight: 600;
|
|
178
|
+
color: #fff;
|
|
179
|
+
}
|
|
180
|
+
.bs-lp-badge {
|
|
181
|
+
position: absolute;
|
|
182
|
+
top: -3px;
|
|
183
|
+
right: -3px;
|
|
184
|
+
min-width: 14px;
|
|
185
|
+
height: 14px;
|
|
186
|
+
border-radius: 7px;
|
|
187
|
+
background: var(--bs-pin-text, #171717);
|
|
188
|
+
color: var(--bs-pin-bg, #fff);
|
|
189
|
+
font-size: 9px;
|
|
190
|
+
font-weight: 700;
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
justify-content: center;
|
|
194
|
+
padding: 0 3px;
|
|
195
|
+
line-height: 1;
|
|
196
|
+
z-index: 2;
|
|
122
197
|
}
|
|
123
198
|
|
|
124
|
-
/* \u2500\u2500 Popup \u2500\u2500 */
|
|
199
|
+
/* \u2500\u2500 Popup (Clean Card) \u2500\u2500 */
|
|
125
200
|
.bs-lp-popup {
|
|
126
201
|
position: absolute;
|
|
127
|
-
left:
|
|
202
|
+
left: 40px;
|
|
128
203
|
top: -8px;
|
|
129
|
-
width: min(
|
|
130
|
-
background:
|
|
131
|
-
border: 1px solid
|
|
132
|
-
border-radius:
|
|
133
|
-
box-shadow: 0
|
|
204
|
+
width: min(360px, calc(100vw - 48px));
|
|
205
|
+
background: var(--bs-pin-bg);
|
|
206
|
+
border: 1px solid var(--bs-pin-border);
|
|
207
|
+
border-radius: 14px;
|
|
208
|
+
box-shadow: 0 8px 30px var(--bs-pin-shadow-lg), 0 0 0 1px var(--bs-pin-shadow);
|
|
209
|
+
backdrop-filter: blur(12px);
|
|
134
210
|
z-index: 10;
|
|
135
211
|
pointer-events: auto;
|
|
136
212
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
137
|
-
color:
|
|
213
|
+
color: var(--bs-pin-text);
|
|
138
214
|
overflow: hidden;
|
|
139
|
-
animation: bs-lp-pop-in 0.2s
|
|
215
|
+
animation: bs-lp-pop-in 0.2s ease;
|
|
140
216
|
}
|
|
141
217
|
@keyframes bs-lp-pop-in {
|
|
142
|
-
from { opacity: 0; transform:
|
|
143
|
-
to { opacity: 1; transform:
|
|
218
|
+
from { opacity: 0; transform: translateY(4px); }
|
|
219
|
+
to { opacity: 1; transform: translateY(0); }
|
|
144
220
|
}
|
|
145
221
|
.bs-lp-popup-hdr {
|
|
146
|
-
padding:
|
|
222
|
+
padding: 14px 16px 12px;
|
|
147
223
|
display: flex;
|
|
148
224
|
align-items: flex-start;
|
|
149
|
-
gap:
|
|
225
|
+
gap: 10px;
|
|
150
226
|
}
|
|
151
|
-
.bs-lp-popup-
|
|
152
|
-
|
|
153
|
-
|
|
227
|
+
.bs-lp-popup-hdr-avatar {
|
|
228
|
+
width: 24px;
|
|
229
|
+
height: 24px;
|
|
230
|
+
border-radius: 50%;
|
|
231
|
+
flex-shrink: 0;
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
justify-content: center;
|
|
235
|
+
font-size: 10px;
|
|
236
|
+
font-weight: 600;
|
|
237
|
+
color: #fff;
|
|
238
|
+
overflow: hidden;
|
|
239
|
+
}
|
|
240
|
+
.bs-lp-popup-hdr-avatar img {
|
|
241
|
+
width: 100%;
|
|
242
|
+
height: 100%;
|
|
243
|
+
object-fit: cover;
|
|
244
|
+
}
|
|
245
|
+
.bs-lp-popup-hdr-body {
|
|
154
246
|
flex: 1;
|
|
247
|
+
min-width: 0;
|
|
248
|
+
}
|
|
249
|
+
.bs-lp-popup-title {
|
|
250
|
+
font-size: 14px;
|
|
251
|
+
font-weight: 600;
|
|
252
|
+
color: var(--bs-pin-text);
|
|
155
253
|
line-height: 1.3;
|
|
254
|
+
margin-bottom: 2px;
|
|
156
255
|
}
|
|
157
|
-
.bs-lp-popup-
|
|
158
|
-
font-size:
|
|
159
|
-
|
|
256
|
+
.bs-lp-popup-meta {
|
|
257
|
+
font-size: 12px;
|
|
258
|
+
color: var(--bs-pin-muted);
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
gap: 6px;
|
|
262
|
+
flex-wrap: wrap;
|
|
263
|
+
}
|
|
264
|
+
.bs-lp-popup-pill {
|
|
265
|
+
font-size: 11px;
|
|
266
|
+
padding: 2px 8px;
|
|
160
267
|
border-radius: 99px;
|
|
161
|
-
font-weight:
|
|
162
|
-
text-transform: uppercase;
|
|
163
|
-
letter-spacing: 0.4px;
|
|
268
|
+
font-weight: 500;
|
|
164
269
|
white-space: nowrap;
|
|
165
|
-
flex-shrink: 0;
|
|
166
270
|
}
|
|
167
271
|
.bs-lp-popup-close {
|
|
168
272
|
all: initial;
|
|
169
|
-
color:
|
|
170
|
-
font-size: 18px;
|
|
273
|
+
color: var(--bs-pin-muted);
|
|
171
274
|
cursor: pointer;
|
|
172
|
-
|
|
173
|
-
padding: 0 2px;
|
|
275
|
+
padding: 2px;
|
|
174
276
|
flex-shrink: 0;
|
|
277
|
+
display: flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
justify-content: center;
|
|
280
|
+
border-radius: 6px;
|
|
281
|
+
transition: background 0.15s, color 0.15s;
|
|
175
282
|
}
|
|
176
|
-
.bs-lp-popup-close:hover { color:
|
|
283
|
+
.bs-lp-popup-close:hover { color: var(--bs-pin-text); background: var(--bs-pin-hover); }
|
|
284
|
+
.bs-lp-popup-close svg { width: 16px; height: 16px; }
|
|
177
285
|
.bs-lp-popup-desc {
|
|
178
|
-
padding: 0
|
|
179
|
-
font-size:
|
|
180
|
-
line-height: 1.
|
|
181
|
-
color:
|
|
286
|
+
padding: 0 16px 12px;
|
|
287
|
+
font-size: 13px;
|
|
288
|
+
line-height: 1.6;
|
|
289
|
+
color: var(--bs-pin-muted);
|
|
182
290
|
}
|
|
183
291
|
.bs-lp-popup-info {
|
|
184
|
-
padding: 8px
|
|
185
|
-
font-size:
|
|
186
|
-
color:
|
|
187
|
-
background:
|
|
188
|
-
border-top: 1px solid
|
|
292
|
+
padding: 8px 16px;
|
|
293
|
+
font-size: 11px;
|
|
294
|
+
color: var(--bs-pin-muted);
|
|
295
|
+
background: var(--bs-pin-surface);
|
|
296
|
+
border-top: 1px solid var(--bs-pin-border);
|
|
189
297
|
display: flex;
|
|
190
298
|
justify-content: space-between;
|
|
191
299
|
}
|
|
192
300
|
|
|
193
301
|
/* Comments */
|
|
194
302
|
.bs-lp-cmts {
|
|
195
|
-
max-height:
|
|
303
|
+
max-height: 220px;
|
|
196
304
|
overflow-y: auto;
|
|
197
|
-
border-top: 1px solid
|
|
305
|
+
border-top: 1px solid var(--bs-pin-border);
|
|
198
306
|
}
|
|
199
307
|
.bs-lp-cmts::-webkit-scrollbar { width: 4px; }
|
|
200
|
-
.bs-lp-cmts::-webkit-scrollbar-thumb { background:
|
|
308
|
+
.bs-lp-cmts::-webkit-scrollbar-thumb { background: var(--bs-pin-border); border-radius: 2px; }
|
|
201
309
|
.bs-lp-cmt {
|
|
202
|
-
padding: 10px
|
|
203
|
-
|
|
310
|
+
padding: 10px 16px;
|
|
311
|
+
display: flex;
|
|
312
|
+
gap: 8px;
|
|
313
|
+
align-items: flex-start;
|
|
314
|
+
border-bottom: 1px solid var(--bs-pin-border);
|
|
204
315
|
}
|
|
205
316
|
.bs-lp-cmt:last-child { border-bottom: none; }
|
|
317
|
+
.bs-lp-cmt-avatar {
|
|
318
|
+
width: 20px;
|
|
319
|
+
height: 20px;
|
|
320
|
+
border-radius: 50%;
|
|
321
|
+
flex-shrink: 0;
|
|
322
|
+
display: flex;
|
|
323
|
+
align-items: center;
|
|
324
|
+
justify-content: center;
|
|
325
|
+
font-size: 8px;
|
|
326
|
+
font-weight: 600;
|
|
327
|
+
color: #fff;
|
|
328
|
+
overflow: hidden;
|
|
329
|
+
}
|
|
330
|
+
.bs-lp-cmt-avatar img { width: 100%; height: 100%; object-fit: cover; }
|
|
331
|
+
.bs-lp-cmt-content { flex: 1; min-width: 0; }
|
|
206
332
|
.bs-lp-cmt-top {
|
|
207
333
|
display: flex;
|
|
208
334
|
align-items: center;
|
|
209
335
|
justify-content: space-between;
|
|
210
|
-
margin-bottom:
|
|
336
|
+
margin-bottom: 2px;
|
|
211
337
|
}
|
|
212
338
|
.bs-lp-cmt-author {
|
|
213
339
|
font-weight: 600;
|
|
214
|
-
color:
|
|
215
|
-
font-size:
|
|
340
|
+
color: var(--bs-pin-text);
|
|
341
|
+
font-size: 12px;
|
|
216
342
|
}
|
|
217
343
|
.bs-lp-cmt-time {
|
|
218
|
-
font-size:
|
|
219
|
-
color:
|
|
344
|
+
font-size: 11px;
|
|
345
|
+
color: var(--bs-pin-muted);
|
|
220
346
|
}
|
|
221
347
|
.bs-lp-cmt-body {
|
|
222
|
-
color:
|
|
223
|
-
font-size:
|
|
224
|
-
line-height: 1.
|
|
348
|
+
color: var(--bs-pin-text);
|
|
349
|
+
font-size: 13px;
|
|
350
|
+
line-height: 1.5;
|
|
225
351
|
}
|
|
226
352
|
|
|
227
353
|
/* Comment input */
|
|
228
354
|
.bs-lp-input {
|
|
229
355
|
display: flex;
|
|
230
|
-
|
|
356
|
+
align-items: center;
|
|
357
|
+
border-top: 1px solid var(--bs-pin-border);
|
|
358
|
+
padding: 4px;
|
|
359
|
+
gap: 4px;
|
|
231
360
|
}
|
|
232
361
|
.bs-lp-input input {
|
|
233
362
|
all: initial;
|
|
234
363
|
flex: 1;
|
|
235
|
-
padding:
|
|
236
|
-
color:
|
|
237
|
-
font-size:
|
|
364
|
+
padding: 8px 12px;
|
|
365
|
+
color: var(--bs-pin-text);
|
|
366
|
+
font-size: 13px;
|
|
367
|
+
font-family: inherit;
|
|
368
|
+
background: var(--bs-pin-input-bg);
|
|
369
|
+
border: 1px solid var(--bs-pin-border);
|
|
370
|
+
border-radius: 8px;
|
|
371
|
+
box-sizing: border-box;
|
|
372
|
+
transition: border-color 0.15s;
|
|
238
373
|
}
|
|
239
|
-
.bs-lp-input input
|
|
374
|
+
.bs-lp-input input:focus { border-color: #6E9ED0; outline: none; }
|
|
375
|
+
.bs-lp-input input::placeholder { color: var(--bs-pin-muted); }
|
|
240
376
|
.bs-lp-input button {
|
|
241
377
|
all: initial;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
378
|
+
width: 32px;
|
|
379
|
+
height: 32px;
|
|
380
|
+
border-radius: 8px;
|
|
381
|
+
background: #6E9ED0;
|
|
382
|
+
color: #fff;
|
|
246
383
|
cursor: pointer;
|
|
384
|
+
display: flex;
|
|
385
|
+
align-items: center;
|
|
386
|
+
justify-content: center;
|
|
387
|
+
flex-shrink: 0;
|
|
388
|
+
transition: opacity 0.15s;
|
|
247
389
|
}
|
|
248
|
-
.bs-lp-input button:hover {
|
|
390
|
+
.bs-lp-input button:hover { opacity: 0.85; }
|
|
391
|
+
.bs-lp-input button svg { width: 14px; height: 14px; }
|
|
249
392
|
|
|
250
393
|
/* Actions */
|
|
251
394
|
.bs-lp-acts {
|
|
252
|
-
padding: 8px
|
|
395
|
+
padding: 8px 16px 10px;
|
|
253
396
|
display: flex;
|
|
254
|
-
gap:
|
|
255
|
-
border-top: 1px solid
|
|
397
|
+
gap: 8px;
|
|
398
|
+
border-top: 1px solid var(--bs-pin-border);
|
|
256
399
|
}
|
|
257
400
|
.bs-lp-act {
|
|
258
401
|
all: initial;
|
|
259
|
-
padding:
|
|
260
|
-
border-radius:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
font-
|
|
265
|
-
font-
|
|
402
|
+
padding: 6px 14px;
|
|
403
|
+
border-radius: 8px;
|
|
404
|
+
background: var(--bs-pin-surface);
|
|
405
|
+
color: var(--bs-pin-muted);
|
|
406
|
+
font-size: 12px;
|
|
407
|
+
font-weight: 500;
|
|
408
|
+
font-family: inherit;
|
|
266
409
|
cursor: pointer;
|
|
267
410
|
transition: all 0.15s;
|
|
411
|
+
display: flex;
|
|
412
|
+
align-items: center;
|
|
413
|
+
gap: 5px;
|
|
268
414
|
}
|
|
269
|
-
.bs-lp-act:hover { background:
|
|
270
|
-
.bs-lp-act.resolve { color: #
|
|
415
|
+
.bs-lp-act:hover { background: var(--bs-pin-hover); color: var(--bs-pin-text); }
|
|
416
|
+
.bs-lp-act.resolve { color: #22c55e; }
|
|
271
417
|
.bs-lp-act.resolve:hover { background: rgba(34,197,94,0.1); }
|
|
272
|
-
.bs-lp-act.delete { color: #
|
|
418
|
+
.bs-lp-act.delete { color: #ef4444; }
|
|
273
419
|
.bs-lp-act.delete:hover { background: rgba(239,68,68,0.1); }
|
|
274
420
|
|
|
275
421
|
/* \u2500\u2500 New Pin Form \u2500\u2500 */
|
|
276
422
|
.bs-lp-form {
|
|
277
423
|
position: fixed;
|
|
278
|
-
width: min(
|
|
279
|
-
background:
|
|
280
|
-
border: 1px solid
|
|
281
|
-
border-radius:
|
|
282
|
-
box-shadow: 0
|
|
424
|
+
width: min(320px, calc(100vw - 32px));
|
|
425
|
+
background: var(--bs-pin-bg);
|
|
426
|
+
border: 1px solid var(--bs-pin-border);
|
|
427
|
+
border-radius: 14px;
|
|
428
|
+
box-shadow: 0 8px 30px var(--bs-pin-shadow-lg);
|
|
429
|
+
backdrop-filter: blur(12px);
|
|
283
430
|
z-index: 2147483645;
|
|
284
431
|
pointer-events: auto;
|
|
285
432
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
286
|
-
color:
|
|
287
|
-
padding:
|
|
288
|
-
animation: bs-lp-pop-in 0.2s
|
|
433
|
+
color: var(--bs-pin-text);
|
|
434
|
+
padding: 16px;
|
|
435
|
+
animation: bs-lp-pop-in 0.2s ease;
|
|
289
436
|
}
|
|
290
437
|
.bs-lp-form-label {
|
|
291
438
|
display: block;
|
|
292
|
-
font-size:
|
|
293
|
-
color:
|
|
439
|
+
font-size: 12px;
|
|
440
|
+
color: var(--bs-pin-muted);
|
|
294
441
|
margin-bottom: 4px;
|
|
295
|
-
margin-top:
|
|
296
|
-
font-weight:
|
|
297
|
-
text-transform: uppercase;
|
|
298
|
-
letter-spacing: 0.5px;
|
|
442
|
+
margin-top: 12px;
|
|
443
|
+
font-weight: 500;
|
|
299
444
|
}
|
|
300
445
|
.bs-lp-form-label:first-child { margin-top: 0; }
|
|
301
446
|
.bs-lp-form input,
|
|
@@ -304,11 +449,11 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
304
449
|
all: initial;
|
|
305
450
|
display: block;
|
|
306
451
|
width: 100%;
|
|
307
|
-
background:
|
|
308
|
-
border: 1px solid
|
|
309
|
-
border-radius:
|
|
310
|
-
padding: 8px
|
|
311
|
-
color:
|
|
452
|
+
background: var(--bs-pin-input-bg);
|
|
453
|
+
border: 1px solid var(--bs-pin-border);
|
|
454
|
+
border-radius: 10px;
|
|
455
|
+
padding: 8px 12px;
|
|
456
|
+
color: var(--bs-pin-text);
|
|
312
457
|
font-size: 13px;
|
|
313
458
|
font-family: inherit;
|
|
314
459
|
box-sizing: border-box;
|
|
@@ -323,21 +468,51 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
323
468
|
.bs-lp-form textarea:focus,
|
|
324
469
|
.bs-lp-form select:focus {
|
|
325
470
|
border-color: #6E9ED0;
|
|
471
|
+
outline: none;
|
|
326
472
|
}
|
|
327
473
|
.bs-lp-form input::placeholder,
|
|
328
|
-
.bs-lp-form textarea::placeholder { color:
|
|
474
|
+
.bs-lp-form textarea::placeholder { color: var(--bs-pin-muted); }
|
|
475
|
+
/* Segmented buttons for priority/category */
|
|
476
|
+
.bs-lp-seg-row {
|
|
477
|
+
display: flex;
|
|
478
|
+
gap: 0;
|
|
479
|
+
border: 1px solid var(--bs-pin-border);
|
|
480
|
+
border-radius: 10px;
|
|
481
|
+
overflow: hidden;
|
|
482
|
+
}
|
|
483
|
+
.bs-lp-seg-btn {
|
|
484
|
+
all: initial;
|
|
485
|
+
flex: 1;
|
|
486
|
+
padding: 7px 4px;
|
|
487
|
+
text-align: center;
|
|
488
|
+
font-size: 12px;
|
|
489
|
+
font-weight: 500;
|
|
490
|
+
font-family: inherit;
|
|
491
|
+
cursor: pointer;
|
|
492
|
+
color: var(--bs-pin-muted);
|
|
493
|
+
background: var(--bs-pin-input-bg);
|
|
494
|
+
border-right: 1px solid var(--bs-pin-border);
|
|
495
|
+
transition: all 0.15s;
|
|
496
|
+
box-sizing: border-box;
|
|
497
|
+
}
|
|
498
|
+
.bs-lp-seg-btn:last-child { border-right: none; }
|
|
499
|
+
.bs-lp-seg-btn:hover { color: var(--bs-pin-text); background: var(--bs-pin-hover); }
|
|
500
|
+
.bs-lp-seg-btn.bs-active {
|
|
501
|
+
background: #6E9ED0;
|
|
502
|
+
color: #fff;
|
|
503
|
+
}
|
|
329
504
|
.bs-lp-form-btns {
|
|
330
505
|
display: flex;
|
|
331
506
|
gap: 8px;
|
|
332
|
-
margin-top:
|
|
507
|
+
margin-top: 14px;
|
|
333
508
|
}
|
|
334
509
|
.bs-lp-form-btns button {
|
|
335
510
|
all: initial;
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
font-
|
|
340
|
-
font-
|
|
511
|
+
padding: 9px 16px;
|
|
512
|
+
border-radius: 10px;
|
|
513
|
+
font-size: 13px;
|
|
514
|
+
font-weight: 600;
|
|
515
|
+
font-family: inherit;
|
|
341
516
|
cursor: pointer;
|
|
342
517
|
text-align: center;
|
|
343
518
|
transition: opacity 0.15s;
|
|
@@ -345,97 +520,94 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
345
520
|
.bs-lp-form-submit {
|
|
346
521
|
background: #6E9ED0;
|
|
347
522
|
color: #fff;
|
|
523
|
+
flex: 1;
|
|
348
524
|
}
|
|
349
525
|
.bs-lp-form-submit:hover { opacity: 0.85; }
|
|
350
526
|
.bs-lp-form-cancel {
|
|
351
|
-
background:
|
|
352
|
-
color:
|
|
527
|
+
background: transparent;
|
|
528
|
+
color: var(--bs-pin-muted);
|
|
353
529
|
}
|
|
354
|
-
.bs-lp-form-cancel:hover {
|
|
355
|
-
`,
|
|
356
|
-
<div class="bs-lp-dot" style="
|
|
357
|
-
${
|
|
358
|
-
|
|
530
|
+
.bs-lp-form-cancel:hover { color: var(--bs-pin-text); }
|
|
531
|
+
`,Y.appendChild(t),me.appendChild(Y),document.body.appendChild(L),L.addEventListener("click",e=>{let n=e.clientX,r=e.clientY,s=null;try{L.style.setProperty("pointer-events","none","important"),s=document.elementFromPoint(n,r)}finally{L.style.setProperty("pointer-events","auto","important")}let o=n+window.scrollX,i=r+window.scrollY,a,c;if(s&&s!==document.body&&s!==document.documentElement){let p=s.getBoundingClientRect();if(p.width>0&&p.height>0)a=(n-p.left)/p.width,c=(r-p.top)/p.height;else{let b=document.documentElement.scrollWidth||document.body.scrollWidth||1,v=document.documentElement.scrollHeight||document.body.scrollHeight||1;a=o/b*100,c=i/v*100}}else{let p=document.documentElement.scrollWidth||document.body.scrollWidth||1,b=document.documentElement.scrollHeight||document.body.scrollHeight||1;a=o/p*100,c=i/b*100}Wo(o,i,a,c,n,r,s)})}async function ds(){let t=await Nr(en,window.location.pathname);t.success&&t.data&&($=t.data,$n($.map(e=>e.id)),gt())}async function jo(){let t=await Ur(en);t.success&&t.data&&(rs=t.data)}function gt(){if(Y){Y.querySelectorAll(".bs-lp").forEach(t=>t.remove()),$.forEach(t=>{let e=document.createElement("div");e.className="bs-lp",e.dataset.pinId=t.id;let n=os(as(t));e.style.left=n.left,e.style.top=n.top,n.hidden&&(e.style.display="none");let r=tn[t.status]||tn.open,s=In(t.creatorName||"U"),o=Hn(t.creatorName||"U"),i=t.creatorAvatar?`<img class="bs-lp-avatar" src="${mt(t.creatorAvatar)}" alt="" />`:`<div class="bs-lp-initials" style="background:${o}">${s}</div>`,a=t.commentCount>0?`<span class="bs-lp-badge">${t.commentCount>99?"99+":t.commentCount}</span>`:"";e.innerHTML=`
|
|
532
|
+
<div class="bs-lp-dot" style="border:2px solid ${r}; background:transparent;">
|
|
533
|
+
${i}
|
|
534
|
+
${a}
|
|
359
535
|
</div>
|
|
360
|
-
`,
|
|
536
|
+
`,e.addEventListener("click",c=>{c.stopPropagation(),qo(t,e)}),Y.appendChild(e)}),Oo(),fe?.disconnect();for(let t of $){let e=zn(t.elementSelector,t.elementXPath);e&&fe?.observe(e)}}}function ps(t){let e=typeof t=="string"?new Date(t).getTime():t;if(isNaN(e))return"";let n=Date.now()-e,r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;let s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function Zr(t){requestAnimationFrame(()=>{let e=t.getBoundingClientRect(),n=16,r=0,s=0;if(e.right>window.innerWidth-n&&(r=window.innerWidth-n-e.right),e.left+r<n&&(r=n-e.left),e.bottom>window.innerHeight-n&&(s=window.innerHeight-n-e.bottom),e.top+s<n&&(s=n-e.top),r!==0||s!==0){let o=parseFloat(t.style.left)||0,i=parseFloat(t.style.top)||0;t.style.left=`${o+r}px`,t.style.top=`${i+s}px`,t.style.right="auto",t.style.bottom="auto"}})}async function qo(t,e){xt();let n=document.createElement("div");n.className="bs-lp-popup";let r=ot(),s=t.createdBy||t.createdById,o=r&&(r.role==="owner"||r.role==="admin"||r.id===s),i=tn[t.status]||tn.open,a=Qr[t.priority]||Qr.medium,c=t.priority?t.priority.charAt(0).toUpperCase()+t.priority.slice(1):"Medium",p=In(t.creatorName||"U"),b=Hn(t.creatorName||"U"),v=t.creatorAvatar?`<img src="${mt(t.creatorAvatar)}" alt="" style="width:100%;height:100%;object-fit:cover;border-radius:50%;" />`:`<span>${p}</span>`,S=t.status.replace("_"," "),D='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>',R='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>';n.innerHTML=`
|
|
361
537
|
<div class="bs-lp-popup-hdr">
|
|
362
|
-
<div class="bs-lp-popup-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
<
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
538
|
+
<div class="bs-lp-popup-hdr-avatar" style="background:${b}">
|
|
539
|
+
${v}
|
|
540
|
+
</div>
|
|
541
|
+
<div class="bs-lp-popup-hdr-body">
|
|
542
|
+
<div class="bs-lp-popup-title">${mt(t.title)}</div>
|
|
543
|
+
<div class="bs-lp-popup-meta">
|
|
544
|
+
<span>${t.creatorName||"Unknown"}</span>
|
|
545
|
+
<span>·</span>
|
|
546
|
+
<span>${ps(t.createdAt)}</span>
|
|
547
|
+
<span class="bs-lp-popup-pill" style="background:${i}18;color:${i}">${S}</span>
|
|
548
|
+
<span class="bs-lp-popup-pill" style="background:${a}18;color:${a}">${c}</span>
|
|
549
|
+
</div>
|
|
550
|
+
</div>
|
|
551
|
+
<button class="bs-lp-popup-close">${R}</button>
|
|
371
552
|
</div>
|
|
553
|
+
${t.description?`<div class="bs-lp-popup-desc">${mt(t.description)}</div>`:""}
|
|
554
|
+
${t.assigneeName?`<div class="bs-lp-popup-info"><span>Assigned to ${mt(t.assigneeName)}</span></div>`:""}
|
|
372
555
|
<div class="bs-lp-cmts" id="bs-lp-cmts">
|
|
373
|
-
<div
|
|
556
|
+
<div style="text-align:center;color:var(--bs-pin-muted);padding:12px;font-size:12px">Loading comments...</div>
|
|
374
557
|
</div>
|
|
375
558
|
<div class="bs-lp-input">
|
|
376
|
-
<input type="text" placeholder="
|
|
377
|
-
<button id="bs-lp-cmt-send"
|
|
559
|
+
<input type="text" placeholder="Write a comment..." id="bs-lp-cmt-in" name="pin-comment" />
|
|
560
|
+
<button id="bs-lp-cmt-send">${D}</button>
|
|
378
561
|
</div>
|
|
379
562
|
<div class="bs-lp-acts">
|
|
380
|
-
${
|
|
381
|
-
${
|
|
563
|
+
${t.status!=="resolved"?'<button class="bs-lp-act resolve" id="bs-lp-resolve">✓ Resolve</button>':'<button class="bs-lp-act" id="bs-lp-reopen">↺ Reopen</button>'}
|
|
564
|
+
${o?'<button class="bs-lp-act delete" id="bs-lp-delete">✕ Delete</button>':""}
|
|
382
565
|
</div>
|
|
383
|
-
`,
|
|
384
|
-
|
|
385
|
-
<div class="bs-lp-cmt-top">
|
|
386
|
-
<span class="bs-lp-cmt-author">${de(w.author?.name||w.authorName||"Unknown")}</span>
|
|
387
|
-
<span class="bs-lp-cmt-time">${Fr(new Date(w.createdAt).getTime())}</span>
|
|
388
|
-
</div>
|
|
389
|
-
<div class="bs-lp-cmt-body">${de(w.body)}</div>
|
|
390
|
-
</div>
|
|
391
|
-
`).join(""):"",Wr(n)}),Wr(n),n.querySelector(".bs-lp-popup-close").addEventListener("click",p=>{p.stopPropagation(),he()}),n.querySelector("#bs-lp-cmt-send")?.addEventListener("click",async()=>{let p=n.querySelector("#bs-lp-cmt-in"),b=p.value.trim();if(b)if(p.value="",navigator.onLine){let y=await xn(e.id,b);if(y.success&&y.data){let w=n.querySelector("#bs-lp-cmts"),k=y.data;w.innerHTML+=`
|
|
392
|
-
<div class="bs-lp-cmt">
|
|
393
|
-
<div class="bs-lp-cmt-top">
|
|
394
|
-
<span class="bs-lp-cmt-author">${de(k.authorName||r?.name||"You")}</span>
|
|
395
|
-
<span class="bs-lp-cmt-time">just now</span>
|
|
396
|
-
</div>
|
|
397
|
-
<div class="bs-lp-cmt-body">${de(k.body)}</div>
|
|
398
|
-
</div>
|
|
399
|
-
`,w.scrollTop=w.scrollHeight}}else wn({type:"create_comment",data:{pinId:e.id,body:b}})}),n.querySelector("#bs-lp-cmt-in")?.addEventListener("keydown",p=>{p.key==="Enter"&&n.querySelector("#bs-lp-cmt-send")?.dispatchEvent(new Event("click"))}),n.querySelector("#bs-lp-resolve")?.addEventListener("click",async()=>{await Ot(e.id,{status:"resolved"}),e.status="resolved",he(),pe()}),n.querySelector("#bs-lp-reopen")?.addEventListener("click",async()=>{await Ot(e.id,{status:"open"}),e.status="open",he(),pe()});let d=!1;n.querySelector("#bs-lp-delete")?.addEventListener("click",async()=>{d||confirm("Delete this pin?")&&(d=!0,await Ar(e.id),z=z.filter(p=>p.id!==e.id),he(),pe())}),n.addEventListener("click",p=>p.stopPropagation())}function he(){Ue?.remove(),Ue=null}var Ln=e=>e?typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1"):"";function So(e){if(!e||e===document.body||e===document.documentElement)return["body"];let t=[];for(let r of["data-testid","data-test-id","data-cy"]){let s=e.getAttribute(r);if(s){t.push(`[${r}="${Ln(s)}"]`);break}}if(e.id)try{let r=`#${Ln(e.id)}`;document.querySelectorAll(r).length===1&&t.push(r)}catch{}let n=e.getAttribute("aria-label");if(n){let r=`${e.tagName.toLowerCase()}[aria-label="${Ln(n)}"]`;try{document.querySelectorAll(r).length===1&&t.push(r)}catch{}}return t.push(Lo(e)),t}function Lo(e){let t=[],n=e;for(;n&&n!==document.body&&n!==document.documentElement;){let r=n,s=r.parentElement;if(!s)break;let o=r.tagName.toLowerCase(),i=Array.from(s.children).filter(a=>a.tagName===r.tagName);i.length>1&&(o+=`:nth-of-type(${i.indexOf(r)+1})`),t.unshift(o),n=s}return t.join(" > ")}function Co(e){if(!e)return"";let t=[],n=e;for(;n&&n!==document.body;){let r=1,s=n.previousElementSibling;for(;s;)s.tagName===n.tagName&&r++,s=s.previousElementSibling;t.unshift(`${n.tagName.toLowerCase()}[${r}]`),n=n.parentElement}return"/body/"+t.join("/")}function To(e,t,n,r,s,o,i){he(),_?.querySelectorAll(".bs-lp-form").forEach(k=>k.remove());let a=document.createElement("div");a.className="bs-lp-form";let d=Math.min(300,window.innerWidth-32),p=16,b=s+p,y=o-8;b+d>window.innerWidth-p&&(b=s-d-p),b<p&&(b=p),a.style.left=`${b}px`,a.style.top=`${y}px`,requestAnimationFrame(()=>{let k=a.getBoundingClientRect();k.bottom>window.innerHeight-p&&(a.style.top=`${Math.max(p,o-k.height)}px`)});let w=_r.filter(k=>k.userId!==ne()?.id).map(k=>`<option value="${k.userId}">${de(k.name)}</option>`).join("");a.innerHTML=`
|
|
400
|
-
<label class="bs-lp-form-label">Title *</label>
|
|
566
|
+
`,e.appendChild(n),Jt=n,qr(t.id).then(w=>{let E=n.querySelector("#bs-lp-cmts");if(!E)return;let T=w.success&&w.data?w.data:[];E.innerHTML=T.length?T.map(pt=>Rn(pt)).join(""):"",Zr(n)}),Zr(n),n.querySelector(".bs-lp-popup-close").addEventListener("click",w=>{w.stopPropagation(),xt()}),n.querySelector("#bs-lp-cmt-send")?.addEventListener("click",async()=>{let w=n.querySelector("#bs-lp-cmt-in"),E=w.value.trim();if(E)if(w.value="",navigator.onLine){let T=await Ln(t.id,E);if(T.success&&T.data){let pt=n.querySelector("#bs-lp-cmts");pt.innerHTML+=Rn(T.data),pt.scrollTop=pt.scrollHeight}}else Cn({type:"create_comment",data:{pinId:t.id,body:E}})}),n.querySelector("#bs-lp-cmt-in")?.addEventListener("keydown",w=>{w.key==="Enter"&&n.querySelector("#bs-lp-cmt-send")?.dispatchEvent(new Event("click"))}),n.querySelector("#bs-lp-resolve")?.addEventListener("click",async()=>{await Ye(t.id,{status:"resolved"});let w=$.findIndex(E=>E.id===t.id);w>=0&&($=$.map((E,T)=>T===w?{...E,status:"resolved"}:E)),xt(),gt()}),n.querySelector("#bs-lp-reopen")?.addEventListener("click",async()=>{await Ye(t.id,{status:"open"});let w=$.findIndex(E=>E.id===t.id);w>=0&&($=$.map((E,T)=>T===w?{...E,status:"open"}:E)),xt(),gt()});let Z=!1;n.querySelector("#bs-lp-delete")?.addEventListener("click",async()=>{Z||confirm("Delete this pin?")&&(Z=!0,await jr(t.id),$=$.filter(w=>w.id!==t.id),xt(),gt())}),n.addEventListener("click",w=>w.stopPropagation())}function xt(){Jt?.remove(),Jt=null}var Mn=t=>t?typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(t):t.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1"):"";function Uo(t){if(!t||t===document.body||t===document.documentElement)return["body"];let e=[];for(let r of["data-testid","data-test-id","data-cy"]){let s=t.getAttribute(r);if(s){e.push(`[${r}="${Mn(s)}"]`);break}}if(t.id)try{let r=`#${Mn(t.id)}`;document.querySelectorAll(r).length===1&&e.push(r)}catch{}let n=t.getAttribute("aria-label");if(n){let r=`${t.tagName.toLowerCase()}[aria-label="${Mn(n)}"]`;try{document.querySelectorAll(r).length===1&&e.push(r)}catch{}}return e.push(Fo(t)),e}function Fo(t){let e=[],n=t;for(;n&&n!==document.body&&n!==document.documentElement;){let r=n,s=r.parentElement;if(!s)break;let o=r.tagName.toLowerCase(),i=Array.from(s.children).filter(a=>a.tagName===r.tagName);i.length>1&&(o+=`:nth-of-type(${i.indexOf(r)+1})`),e.unshift(o),n=s}return e.join(" > ")}function _o(t){if(!t)return"";let e=[],n=t;for(;n&&n!==document.body;){let r=1,s=n.previousElementSibling;for(;s;)s.tagName===n.tagName&&r++,s=s.previousElementSibling;e.unshift(`${n.tagName.toLowerCase()}[${r}]`),n=n.parentElement}return"/body/"+e.join("/")}function Wo(t,e,n,r,s,o,i){xt(),Y?.querySelectorAll(".bs-lp-form").forEach(R=>R.remove());let a=document.createElement("div");a.className="bs-lp-form";let c=Math.min(300,window.innerWidth-32),p=16,b=s+p,v=o-8;b+c>window.innerWidth-p&&(b=s-c-p),b<p&&(b=p);let S=Gr(b,v);a.style.left=S.left,a.style.top=S.top,requestAnimationFrame(()=>{let R=a.getBoundingClientRect();if(R.bottom>window.innerHeight-p){let Z=Gr(b,Math.max(p,o-R.height));a.style.top=Z.top}});let D=rs.filter(R=>R.userId!==ot()?.id).map(R=>`<option value="${R.userId}">${mt(R.name)}</option>`).join("");a.innerHTML=`
|
|
567
|
+
<label class="bs-lp-form-label">Title</label>
|
|
401
568
|
<input type="text" id="bs-np-title" name="pin-title" placeholder="What's the issue?" autofocus />
|
|
402
569
|
<label class="bs-lp-form-label">Description</label>
|
|
403
|
-
<textarea id="bs-np-desc" name="pin-desc" placeholder="
|
|
570
|
+
<textarea id="bs-np-desc" name="pin-desc" placeholder="Add more details..."></textarea>
|
|
404
571
|
<label class="bs-lp-form-label">Priority</label>
|
|
405
|
-
<
|
|
406
|
-
<
|
|
407
|
-
<
|
|
408
|
-
<
|
|
409
|
-
<
|
|
410
|
-
</
|
|
572
|
+
<div class="bs-lp-seg-row" id="bs-np-priority-row">
|
|
573
|
+
<button class="bs-lp-seg-btn" data-value="low">Low</button>
|
|
574
|
+
<button class="bs-lp-seg-btn bs-active" data-value="medium">Medium</button>
|
|
575
|
+
<button class="bs-lp-seg-btn" data-value="high">High</button>
|
|
576
|
+
<button class="bs-lp-seg-btn" data-value="critical">Critical</button>
|
|
577
|
+
</div>
|
|
411
578
|
<label class="bs-lp-form-label">Category</label>
|
|
412
|
-
<
|
|
413
|
-
<
|
|
414
|
-
<
|
|
415
|
-
<
|
|
416
|
-
<
|
|
417
|
-
<
|
|
418
|
-
</
|
|
419
|
-
${
|
|
579
|
+
<div class="bs-lp-seg-row" id="bs-np-category-row">
|
|
580
|
+
<button class="bs-lp-seg-btn" data-value="ui">UI</button>
|
|
581
|
+
<button class="bs-lp-seg-btn" data-value="functionality">Func</button>
|
|
582
|
+
<button class="bs-lp-seg-btn" data-value="performance">Perf</button>
|
|
583
|
+
<button class="bs-lp-seg-btn" data-value="content">Content</button>
|
|
584
|
+
<button class="bs-lp-seg-btn bs-active" data-value="other">Other</button>
|
|
585
|
+
</div>
|
|
586
|
+
${D?`
|
|
420
587
|
<label class="bs-lp-form-label">Assign to</label>
|
|
421
588
|
<select id="bs-np-assignee" name="pin-assignee">
|
|
422
589
|
<option value="">Unassigned</option>
|
|
423
|
-
${
|
|
590
|
+
${D}
|
|
424
591
|
</select>
|
|
425
592
|
`:""}
|
|
426
593
|
<div class="bs-lp-form-btns">
|
|
427
594
|
<button class="bs-lp-form-cancel" id="bs-np-cancel">Cancel</button>
|
|
428
|
-
<button class="bs-lp-form-submit" id="bs-np-submit">Create
|
|
595
|
+
<button class="bs-lp-form-submit" id="bs-np-submit">Create pin</button>
|
|
429
596
|
</div>
|
|
430
|
-
`,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
</
|
|
438
|
-
|
|
597
|
+
`,Y.appendChild(a),a.addEventListener("click",R=>R.stopPropagation()),es(a,"#bs-np-priority-row"),es(a,"#bs-np-category-row"),a.querySelector("#bs-np-cancel").addEventListener("click",()=>a.remove()),a.querySelector("#bs-np-submit").addEventListener("click",async()=>{let R=a.querySelector("#bs-np-title").value.trim();if(!R){a.querySelector("#bs-np-title").style.borderColor="#ef4444";return}let Z=a.querySelector("#bs-np-submit");Z.textContent="Creating...",Z.style.opacity="0.6",Z.style.pointerEvents="none";let w=a.querySelector("#bs-np-desc").value.trim(),E=ns(a,"#bs-np-priority-row")||"medium",T=ns(a,"#bs-np-category-row")||"other",lt=a.querySelector("#bs-np-assignee")?.value||void 0,Lt=JSON.stringify(Uo(i)),St=_o(i),k=ut().slice(-20).map(B=>`[${B.level}] ${B.args.join(" ")}`),rt=ft().slice(-10).map(B=>`${B.message} at ${B.source}:${B.lineno}`),Ee=vt().slice(-10).map(B=>`${B.method} ${B.url} \u2192 ${B.status}`),te={projectId:en,pageUrl:window.location.href,pathname:window.location.pathname,elementSelector:Lt,elementXPath:St,xPercent:n,yPercent:r,pageX:t,pageY:e,title:R,description:w,priority:E,category:T,assigneeId:lt,browserInfo:navigator.userAgent,screenSize:`${screen.width}x${screen.height}`,viewportSize:`${window.innerWidth}x${window.innerHeight}`,devicePixelRatio:window.devicePixelRatio,consoleLogs:k,networkErrors:Ee,jsErrors:rt};if(a.remove(),navigator.onLine){let B=await En(te);B.success&&B.data&&($=[...$,B.data],gt())}else{Cn({type:"create_pin",data:te});let B=ot();$=[...$,{...te,id:"local-"+Date.now(),orgId:"",status:"open",tags:[],createdBy:B?.id||"",creatorName:B?.name||"",commentCount:0,createdAt:Date.now(),updatedAt:Date.now()}],gt()}}),setTimeout(()=>a.querySelector("#bs-np-title")?.focus(),50)}function Yo(){ue("pin:created",t=>{let e=t.data;e.pathname===window.location.pathname&&($.find(n=>n.id===e.id)||($=[...$,e],$n($.map(n=>n.id)),gt()))}),ue("pin:updated",t=>{let e=t.data,n=$.findIndex(r=>r.id===e.id);n>=0&&($=$.map((r,s)=>s===n?{...r,...e}:r),gt())}),ue("pin:deleted",t=>{let{id:e}=t.data;$=$.filter(n=>n.id!==e),xt(),gt()}),ue("comment:created",t=>{let e=t.data;if(Jt){let n=Jt.querySelector("#bs-lp-cmts");n&&(n.innerHTML+=Rn(e),n.scrollTop=n.scrollHeight)}})}function Xo(){let t=window.location.pathname,e=()=>{window.location.pathname!==t&&(t=window.location.pathname,window.location.href,ds())},n=history.pushState,r=history.replaceState;history.pushState=function(...s){n.apply(this,s),e()},history.replaceState=function(...s){r.apply(this,s),e()},window.addEventListener("popstate",e)}function In(t){return t.split(" ").map(e=>e[0]||"").join("").toUpperCase().slice(0,2)||"U"}var ts=["linear-gradient(135deg, #667eea, #764ba2)","linear-gradient(135deg, #f093fb, #f5576c)","linear-gradient(135deg, #4facfe, #00f2fe)","linear-gradient(135deg, #43e97b, #38f9d7)","linear-gradient(135deg, #fa709a, #fee140)","linear-gradient(135deg, #a18cd1, #fbc2eb)","linear-gradient(135deg, #fccb90, #d57eeb)","linear-gradient(135deg, #e0c3fc, #8ec5fc)"];function Hn(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return ts[Math.abs(e)%ts.length]}function Rn(t){let e=t.author?.name||t.authorName||"Unknown",n=t.author?.avatar||t.authorAvatar,r=In(e),s=Hn(e),o=n?`<img src="${mt(n)}" alt="" />`:`<span style="font-size:8px">${r}</span>`;return`
|
|
598
|
+
<div class="bs-lp-cmt">
|
|
599
|
+
<div class="bs-lp-cmt-avatar" style="background:${s}">
|
|
600
|
+
${o}
|
|
601
|
+
</div>
|
|
602
|
+
<div class="bs-lp-cmt-content">
|
|
603
|
+
<div class="bs-lp-cmt-top">
|
|
604
|
+
<span class="bs-lp-cmt-author">${mt(e)}</span>
|
|
605
|
+
<span class="bs-lp-cmt-time">${ps(t.createdAt?new Date(t.createdAt).getTime():Date.now())}</span>
|
|
606
|
+
</div>
|
|
607
|
+
<div class="bs-lp-cmt-body">${mt(t.body)}</div>
|
|
608
|
+
</div>
|
|
609
|
+
</div>
|
|
610
|
+
`}function es(t,e){let n=t.querySelector(e);n&&n.querySelectorAll(".bs-lp-seg-btn").forEach(r=>{r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),n.querySelectorAll(".bs-lp-seg-btn").forEach(o=>o.classList.remove("bs-active")),r.classList.add("bs-active")})})}function ns(t,e){return t.querySelector(`${e} .bs-lp-seg-btn.bs-active`)?.dataset.value||""}function mt(t){let e=document.createElement("div");return e.textContent=t,e.innerHTML}var G,x=null,P=null,g=null,et=null,ge=null,Et=null,wt=null,J=null,K=!1,rn=!1,Mt=!1,he=null,Dn=null,us="bugstash_fab_position",Gt="report";var it=Wr(),At=Yr(),O={bug:'<svg width="28" height="28" viewBox="55 38 60 105" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M95.8 44h-29c-3 0-5.4 2.4-5.4 5.4v29c0 3 2.4 5.4 5.4 5.4h19.5c13 0 23.5-10.5 23.5-23.5v-2.8c0-7.5-6-13.5-13.5-13.5h-.5zm-6.2 28.2H74.8V57.4h14.8c5.8 0 10.4 4.7 10.4 10.4s-4.7 10.4-10.4 10.4z" fill="rgba(255,255,255,0.85)"/><path d="M100.4 96h-33.6c-3 0-5.4 2.4-5.4 5.4v33.6c0 3 2.4 5.4 5.4 5.4h22c15 0 27-12 27-27v-3.9c0-7.5-6-13.5-13.5-13.5h-1.9zm-7.8 32.2H74.8v-20h17.8c6.7 0 12.2 5.5 12.2 12.2 0 4.3-3.5 7.8-7.8 7.8h-4.6z" fill="rgba(255,255,255,1)"/></svg>',x:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',cam:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>',check:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round"><polyline points="20 6 9 17 4 12"/></svg>',report:'<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="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>',console:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>',network:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',ctx:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>',settings:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="21" x2="4" y2="14"/><line x1="4" y1="10" x2="4" y2="3"/><line x1="12" y1="21" x2="12" y2="12"/><line x1="12" y1="8" x2="12" y2="3"/><line x1="20" y1="21" x2="20" y2="16"/><line x1="20" y1="12" x2="20" y2="3"/><line x1="1" y1="14" x2="7" y2="14"/><line x1="9" y1="8" x2="15" y2="8"/><line x1="17" y1="16" x2="23" y2="16"/></svg>',history:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',pin:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>',sun:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg>',moon:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>',keyboard:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="2" y="4" width="20" height="16" rx="2"/><line x1="6" y1="8" x2="6" y2="8"/><line x1="10" y1="8" x2="10" y2="8"/><line x1="14" y1="8" x2="14" y2="8"/><line x1="18" y1="8" x2="18" y2="8"/><line x1="8" y1="12" x2="16" y2="12"/><line x1="6" y1="16" x2="18" y2="16"/></svg>'},Vo=`
|
|
439
611
|
/* \u2500\u2500 Shadow Boundary Reset \u2500\u2500
|
|
440
612
|
* Cuts ALL inherited CSS from host page (color, font, line-height, etc.)
|
|
441
613
|
* Every element below must declare its own styles explicitly. */
|
|
@@ -461,13 +633,21 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
461
633
|
border-radius: var(--bs-radius);
|
|
462
634
|
background: linear-gradient(135deg, var(--bs-fab1), var(--bs-fab2));
|
|
463
635
|
color: #fff;
|
|
464
|
-
cursor:
|
|
636
|
+
cursor: grab;
|
|
465
637
|
box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 0 0 rgba(0,0,0,0.15);
|
|
466
638
|
display: flex;
|
|
467
639
|
align-items: center;
|
|
468
640
|
justify-content: center;
|
|
469
641
|
transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
|
|
470
642
|
animation: bs-pulse 3s ease-in-out infinite;
|
|
643
|
+
touch-action: none;
|
|
644
|
+
user-select: none;
|
|
645
|
+
-webkit-user-select: none;
|
|
646
|
+
}
|
|
647
|
+
.bs-fab.bs-dragging {
|
|
648
|
+
cursor: grabbing;
|
|
649
|
+
transition: none;
|
|
650
|
+
animation: none;
|
|
471
651
|
}
|
|
472
652
|
.bs-fab:hover {
|
|
473
653
|
transform: scale(1.08) translateY(-2px);
|
|
@@ -1521,7 +1701,7 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1521
1701
|
.bs-set-ly.bs-picked { border-color: var(--bs-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bs-accent) 25%, transparent); }
|
|
1522
1702
|
.bs-set-ly-name { font-size: 12px; font-weight: 600; color: var(--bs-text); margin-bottom: 2px; }
|
|
1523
1703
|
.bs-set-ly-desc { font-size: 10px; color: var(--bs-muted); }
|
|
1524
|
-
`;function
|
|
1704
|
+
`;function Jo(){return`
|
|
1525
1705
|
<div class="bs-login-form">
|
|
1526
1706
|
<div class="bs-login-logo">BugStash</div>
|
|
1527
1707
|
<div class="bs-login-subtitle">Sign in to report bugs & collaborate</div>
|
|
@@ -1531,11 +1711,11 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1531
1711
|
<button class="bs-login-btn" id="bs-login-submit">Sign In</button>
|
|
1532
1712
|
<div style="font-size:11px;color:var(--bs-muted);margin-top:4px">Contact your admin for an account</div>
|
|
1533
1713
|
</div>
|
|
1534
|
-
`}function
|
|
1714
|
+
`}function j(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ko(t){let e=Math.floor((Date.now()-t)/1e3);return e<5?"now":e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:new Date(t).toLocaleTimeString()}function fs(t){return new Date(t).toLocaleTimeString("en",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}var ms="bugstash_history";function Qt(){try{return JSON.parse(localStorage.getItem(ms)||"[]")}catch{return[]}}function On(t){try{localStorage.setItem(ms,JSON.stringify(t))}catch{}}function Go(t){let e=Qt(),n=Date.now();e.unshift({...t,id:n}),e.length>50&&(e.length=50),On(e)}function Qo(t){let e=Qt().filter(n=>n.id!==t);On(e)}function Zo(t,e){let n=Qt(),r=n.findIndex(s=>s.id===t);r>=0&&(n[r]={...n[r],...e},On(n))}function gs(){return{url:window.location.href,userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language,cookiesEnabled:navigator.cookieEnabled,online:navigator.onLine,screenWidth:screen.width,screenHeight:screen.height,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,devicePixelRatio:window.devicePixelRatio,timestamp:Date.now(),environment:G.environment??"development",commitHash:G.commitHash,user:G.user}}function hs(){let t=ft(),e=ut(),n=Dt(),r=vt(),s=zt(),o=Bt(),i=e.filter(p=>p.level==="error"),a="low";t.length>=3||r.length>=3?a="critical":t.length>=1||r.length>=2?a="high":(i.length>0||r.length>=1)&&(a="medium");let c=[];return t.length&&c.push("has-errors"),r.length&&c.push("network-failures"),i.length&&c.push("console-errors"),o?.pageLoadTime&&o.pageLoadTime>3e3&&c.push("slow-load"),o?.cumulativeLayoutShift&&o.cumulativeLayoutShift>.25&&c.push("layout-shift"),navigator.onLine||c.push("offline"),window.innerWidth<768&&c.push("mobile"),{severity:a,tags:c,counts:{logs:e.length,network:n.length,failedNet:r.length,errors:t.length,crumbs:s.length}}}function vs(){let t=hs(),e=[{id:"ui",label:"UI"},{id:"functionality",label:"Feature"},{id:"performance",label:"Speed"},{id:"crash",label:"Crash"},{id:"security",label:"Security"},{id:"other",label:"Other"}],n=t.counts.errors>0||t.counts.failedNet>0;return`<div class="bs-view">
|
|
1535
1715
|
<form data-bs-form>
|
|
1536
|
-
<div class="bs-report-summary${n?" bs-alert":
|
|
1716
|
+
<div class="bs-report-summary${n?" bs-alert":t.counts.logs>0?" bs-has":""}">
|
|
1537
1717
|
<div class="bs-report-summary-left">
|
|
1538
|
-
${n?`<div class="bs-report-summary-icon bs-warn">!</div><span>${
|
|
1718
|
+
${n?`<div class="bs-report-summary-icon bs-warn">!</div><span>${t.counts.errors} error${t.counts.errors!==1?"s":""}, ${t.counts.failedNet} failed request${t.counts.failedNet!==1?"s":""} detected</span>`:`<div class="bs-report-summary-icon">${O.check}</div><span>Auto-collecting ${t.counts.logs} logs, ${t.counts.network} requests, ${t.counts.crumbs} actions</span>`}
|
|
1539
1719
|
</div>
|
|
1540
1720
|
</div>
|
|
1541
1721
|
<div class="bs-field">
|
|
@@ -1548,21 +1728,21 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1548
1728
|
<div class="bs-field-label">Category</div>
|
|
1549
1729
|
<input type="hidden" name="category" value="functionality" />
|
|
1550
1730
|
<div class="bs-cat-row">
|
|
1551
|
-
${
|
|
1731
|
+
${e.map(s=>`<button type="button" class="bs-cat-btn${s.id==="functionality"?" bs-picked":""}" data-cat="${s.id}">${s.label}</button>`).join("")}
|
|
1552
1732
|
</div>
|
|
1553
1733
|
</div>
|
|
1554
1734
|
<div class="bs-field">
|
|
1555
1735
|
<div class="bs-field-label">Severity</div>
|
|
1556
|
-
<input type="hidden" name="severity" value="${
|
|
1736
|
+
<input type="hidden" name="severity" value="${t.severity}" />
|
|
1557
1737
|
<div class="bs-sev-row">
|
|
1558
|
-
<button type="button" class="bs-sev-btn bs-sev-low${
|
|
1559
|
-
<button type="button" class="bs-sev-btn bs-sev-medium${
|
|
1560
|
-
<button type="button" class="bs-sev-btn bs-sev-high${
|
|
1561
|
-
<button type="button" class="bs-sev-btn bs-sev-critical${
|
|
1738
|
+
<button type="button" class="bs-sev-btn bs-sev-low${t.severity==="low"?" bs-picked":""}" data-sev="low">Low</button>
|
|
1739
|
+
<button type="button" class="bs-sev-btn bs-sev-medium${t.severity==="medium"?" bs-picked":""}" data-sev="medium">Med</button>
|
|
1740
|
+
<button type="button" class="bs-sev-btn bs-sev-high${t.severity==="high"?" bs-picked":""}" data-sev="high">High</button>
|
|
1741
|
+
<button type="button" class="bs-sev-btn bs-sev-critical${t.severity==="critical"?" bs-picked":""}" data-sev="critical">Critical</button>
|
|
1562
1742
|
</div>
|
|
1563
1743
|
</div>
|
|
1564
1744
|
<div class="bs-shot-area" data-bs-screenshot>
|
|
1565
|
-
<div class="bs-shot-icon">${
|
|
1745
|
+
<div class="bs-shot-icon">${O.cam}</div>
|
|
1566
1746
|
<div class="bs-shot-text">
|
|
1567
1747
|
<div class="bs-shot-title" data-bs-shot-title>Attach screenshot</div>
|
|
1568
1748
|
<div class="bs-shot-sub" data-bs-shot-sub>Capture & annotate the current view</div>
|
|
@@ -1571,17 +1751,17 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1571
1751
|
<div data-bs-annotate></div>
|
|
1572
1752
|
<button type="submit" class="bs-submit-btn">Submit Report</button>
|
|
1573
1753
|
</form>
|
|
1574
|
-
</div>`}function
|
|
1575
|
-
<span class="bs-kv-k">URL</span><span class="bs-kv-v">${
|
|
1754
|
+
</div>`}function ti(){let t=ut(),e={error:"bs-le",warn:"bs-lw",log:"bs-ll",info:"bs-li",debug:"bs-ld"};return t.length?`<div class="bs-view">${t.slice().reverse().map(n=>`<div class="bs-log"><span class="bs-log-lv ${e[n.level]||"bs-ll"}">${n.level}</span><span class="bs-log-m">${j(n.args.join(" ")).slice(0,500)}</span><span class="bs-log-t">${fs(n.timestamp)}</span></div>`).join("")}</div>`:'<div class="bs-view"><div class="bs-empty"><p>No console logs captured yet.<br>Use the app \u2014 logs will appear here automatically.</p></div></div>'}function ei(){let t=Dt();return t.length?`<div class="bs-view">${t.slice().reverse().map(e=>`<div class="bs-net"><span class="bs-net-m">${e.method}</span><span class="bs-net-s ${e.failed?"bs-fail":"bs-ok"}">${e.status||"ERR"}</span><span class="bs-net-u" title="${j(e.url)}">${j(e.url)}</span><span class="bs-net-d">${e.duration}ms</span></div>`).join("")}</div>`:'<div class="bs-view"><div class="bs-empty"><p>No network requests captured yet.<br>API calls will show up here automatically.</p></div></div>'}function ni(){let t='<div class="bs-view">',e=ft();e.length&&(t+=`<div class="bs-sec">Errors <span class="bs-sec-n">${e.length}</span></div>`,t+=e.slice().reverse().map(o=>`<div class="bs-err-card"><div class="bs-err-m">${j(o.message)}</div>${o.stack?`<div class="bs-err-stack">${j(o.stack)}</div>`:""}<div class="bs-err-meta">${o.type} · ${fs(o.timestamp)}${o.source?` · ${j(o.source)}:${o.lineno}`:""}</div></div>`).join(""));let n=Bt();if(n){t+='<div class="bs-sec">Performance</div>';let o=[["Page Load",n.pageLoadTime,5e3],["DOM Ready",n.domContentLoaded,3e3],["First Paint",n.firstPaint,2e3],["FCP",n.firstContentfulPaint,2500],["LCP",n.largestContentfulPaint,4e3],["FID",n.firstInputDelay,300]];for(let[i,a,c]of o){if(a===void 0)continue;let p=Math.min(100,a/c*100);t+=`<div class="bs-pf"><span class="bs-pf-l">${i}</span><div class="bs-pf-tr"><div class="bs-pf-fl${p>75?" bs-slow":""}" style="width:${p}%"></div></div><span class="bs-pf-v">${a}ms</span></div>`}if(n.cumulativeLayoutShift!==void 0){let i=Math.min(100,n.cumulativeLayoutShift*400);t+=`<div class="bs-pf"><span class="bs-pf-l">CLS</span><div class="bs-pf-tr"><div class="bs-pf-fl${i>40?" bs-slow":""}" style="width:${i}%"></div></div><span class="bs-pf-v">${n.cumulativeLayoutShift}</span></div>`}}let r=zt();r.length&&(t+=`<div class="bs-sec">Your activity trail <span class="bs-sec-n">${r.length}</span></div>`,t+=r.slice().reverse().map(o=>`<div class="bs-bc"><span class="bs-bc-t bs-t-${o.type}">${o.type}</span><span class="bs-bc-m">${j(o.message).slice(0,120)}</span><span class="bs-bc-time">${Ko(o.timestamp)}</span></div>`).join(""));let s=gs();return t+='<div class="bs-sec">Environment</div>',t+=`<div class="bs-kv">
|
|
1755
|
+
<span class="bs-kv-k">URL</span><span class="bs-kv-v">${j(s.url)}</span>
|
|
1576
1756
|
<span class="bs-kv-k">Viewport</span><span class="bs-kv-v">${s.viewportWidth}×${s.viewportHeight} @${s.devicePixelRatio}x</span>
|
|
1577
1757
|
<span class="bs-kv-k">Screen</span><span class="bs-kv-v">${s.screenWidth}×${s.screenHeight}</span>
|
|
1578
|
-
<span class="bs-kv-k">Platform</span><span class="bs-kv-v">${
|
|
1758
|
+
<span class="bs-kv-k">Platform</span><span class="bs-kv-v">${j(s.platform)}</span>
|
|
1579
1759
|
<span class="bs-kv-k">Language</span><span class="bs-kv-v">${s.language}</span>
|
|
1580
|
-
${
|
|
1581
|
-
${
|
|
1582
|
-
</div>`,
|
|
1760
|
+
${G.commitHash?`<span class="bs-kv-k">Commit</span><span class="bs-kv-v">${j(G.commitHash)}</span>`:""}
|
|
1761
|
+
${G.user?.email?`<span class="bs-kv-k">User</span><span class="bs-kv-v">${j(G.user.email)}</span>`:""}
|
|
1762
|
+
</div>`,t+="</div>",t}function ri(){let t=Qt();if(!t.length)return'<div class="bs-view"><div class="bs-empty"><p>No reports yet.<br>Submitted bugs will appear here.</p></div></div>';let e={ui:"UI",functionality:"Feature",performance:"Perf",crash:"Crash",security:"Security",other:"Other"},n=s=>{let o=new Date(s),a=new Date().getTime()-o.getTime(),c=Math.floor(a/6e4);if(c<1)return"Just now";if(c<60)return`${c}m ago`;let p=Math.floor(c/60);if(p<24)return`${p}h ago`;let b=Math.floor(p/24);return b<7?`${b}d ago`:o.toLocaleDateString("en",{month:"short",day:"numeric"})},r='<div class="bs-view">';for(let s of t){let o=s.pins?.length?`<div class="bs-hist-pins">${s.pins.slice(0,5).map(i=>`<div class="bs-hist-pin-dot" style="background:${["#ef4444","#3b82f6","#f59e0b","#10b981","#8b5cf6"][i.number%5]}">${i.number}</div>`).join("")}${s.pins.length>5?`<span>+${s.pins.length-5}</span>`:""}</div>`:"";r+=`<div class="bs-hist-card" data-hist-id="${s.id}">
|
|
1583
1763
|
<div class="bs-hist-top">
|
|
1584
|
-
<div class="bs-hist-title">${
|
|
1764
|
+
<div class="bs-hist-title">${j(s.title)}</div>
|
|
1585
1765
|
${s.screenshot?`<img class="bs-hist-thumb" src="${s.screenshot}" alt=""/>`:""}
|
|
1586
1766
|
<div class="bs-hist-actions">
|
|
1587
1767
|
<button class="bs-hist-btn" data-hist-edit="${s.id}" title="Edit"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/></svg></button>
|
|
@@ -1589,26 +1769,26 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1589
1769
|
</div>
|
|
1590
1770
|
</div>
|
|
1591
1771
|
<div class="bs-hist-meta">
|
|
1592
|
-
<span class="bs-hist-badge bs-cat">${
|
|
1772
|
+
<span class="bs-hist-badge bs-cat">${e[s.category]||s.category}</span>
|
|
1593
1773
|
<span class="bs-hist-badge bs-sev-${s.severity}">${s.severity}</span>
|
|
1594
1774
|
<span class="bs-hist-badge bs-status-${s.status}">${s.status}</span>
|
|
1595
1775
|
</div>
|
|
1596
|
-
${s.description?`<div class="bs-hist-desc">${
|
|
1776
|
+
${s.description?`<div class="bs-hist-desc">${j(s.description)}</div>`:""}
|
|
1597
1777
|
<div class="bs-hist-foot">
|
|
1598
|
-
<span>${n(s.createdAt)} · ${
|
|
1778
|
+
<span>${n(s.createdAt)} · ${j(s.url.replace(/^https?:\/\//,"").slice(0,40))}</span>
|
|
1599
1779
|
${o}
|
|
1600
1780
|
</div>
|
|
1601
|
-
</div>`}return r+="</div>",r}function
|
|
1602
|
-
<div class="bs-ann-pin-num" style="background:${l.color}">${
|
|
1781
|
+
</div>`}return r+="</div>",r}function si(){let t=Xe(),e=Je(),n='<div class="bs-view">';n+='<div class="bs-set-sec">Layout</div>',n+='<div class="bs-set-ly-grid">';for(let r of e)n+=`<button class="bs-set-ly${r.id===At.id?" bs-picked":""}" data-set-layout="${r.id}"><div class="bs-set-ly-name">${j(r.name)}</div><div class="bs-set-ly-desc">${j(r.description)}</div></button>`;n+="</div>",n+='<div class="bs-set-sec">Theme</div>',n+='<div class="bs-set-grid">';for(let r of t)n+=`<button class="bs-set-card${r.id===it.id?" bs-picked":""}" data-set-theme="${r.id}"><div class="bs-set-preview" style="background:${r.preview[0]}"><div class="bs-set-dot" style="background:${r.preview[1]}"></div><div class="bs-set-dot" style="background:${r.vars["--bs-accent2"]||r.preview[1]};opacity:0.6"></div></div><div class="bs-set-name">${j(r.name)}</div></button>`;return n+="</div>",n+="</div>",n}function oi(t,e){let n=["#f87171","#3b82f6","#fb923c","#4ade80","#a78bfa","#facc15"],r=n[0],s="draw",o=4,i=1,a=!1,c=[],p=[],b=-1,v=-1,S=!1,D=!1,R=0,Z=0,w=0,E=0,T=[],pt=["#ef4444","#3b82f6","#f59e0b","#10b981","#8b5cf6","#ec4899"],lt=new Image;lt.src=e;let Lt=document.createElement("div");Lt.className="bs-ann-wrap";let St=document.createElement("div");St.className="bs-ann-viewport";let k=document.createElement("canvas");k.className="bs-ann-canvas bs-draw";let rt=document.createElement("div");rt.className="bs-ann-toolbar";let Ee={select:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/><path d="M13 13l6 6"/></svg>',draw:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M12 19l7-7 3 3-7 7-3-3z"/><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><path d="M2 2l7.586 7.586"/></svg>',arrow:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg>',rect:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/></svg>',circle:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>',text:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><polyline points="4 7 4 4 20 4 20 7"/><line x1="9.5" y1="20" x2="14.5" y2="20"/><line x1="12" y1="4" x2="12" y2="20"/></svg>',highlight:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M9 11l-6 6v3h9l3-3"/><path d="M22 12l-4.6 4.6a2 2 0 01-2.8 0l-5.2-5.2a2 2 0 010-2.8L14 4"/></svg>',pin:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z"/><circle cx="12" cy="10" r="3"/></svg>'},te={select:"Select & Move",draw:"Draw",arrow:"Arrow",rect:"Rectangle",circle:"Circle",text:"Text",highlight:"Highlight",pin:"Pin Issue"},B=[],As=l=>{s=l,b=-1,k.className=`bs-ann-canvas bs-${l}`,B.forEach(m=>m.classList.remove("bs-sel")),B.find(m=>m.dataset.tool===l)?.classList.add("bs-sel")};Object.keys(Ee).forEach(l=>{let m=document.createElement("button");m.type="button",m.dataset.tool=l,m.className=`bs-ann-btn${l===s?" bs-sel":""}`,m.title=te[l],m.innerHTML=Ee[l],m.addEventListener("click",()=>As(l)),B.push(m),rt.appendChild(m)}),rt.appendChild(Object.assign(document.createElement("div"),{className:"bs-ann-sep"})),n.forEach((l,m)=>{let h=document.createElement("button");h.type="button",h.className=`bs-ann-dot${m===0?" bs-sel":""}`,h.style.background=l,h.addEventListener("click",()=>{r=l,rt.querySelectorAll(".bs-ann-dot").forEach(z=>z.classList.remove("bs-sel")),h.classList.add("bs-sel")}),rt.appendChild(h)}),rt.appendChild(Object.assign(document.createElement("div"),{className:"bs-ann-sep"}));let bt=document.createElement("input");bt.type="range",bt.min="1",bt.max="12",bt.value="4",bt.className="bs-ann-size",bt.title="Brush size",bt.addEventListener("input",()=>{o=parseInt(bt.value)}),rt.appendChild(bt);let Le=document.createElement("div");Le.className="bs-ann-right";let Se=(l,m)=>{let h=document.createElement("button");return h.type="button",h.className="bs-ann-btn",h.title=l,h.innerHTML=m,h},qn=Se("Zoom out",'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="8" y1="11" x2="14" y2="11"/></svg>'),Un=Object.assign(document.createElement("span"),{className:"bs-ann-zoom-label",textContent:"100%"}),Fn=Se("Zoom in",'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg>'),_n=Se("Fit",'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M15 3h6v6"/><path d="M9 21H3v-6"/><path d="M21 3l-7 7"/><path d="M3 21l7-7"/></svg>'),Wn=Se("Undo",'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 105.42-8.49L1 10"/></svg>'),Yn=Object.assign(document.createElement("button"),{type:"button",className:"bs-ann-clr-btn",textContent:"Clear"}),cn=()=>{k.style.transform=`scale(${i})`,Un.textContent=`${Math.round(i*100)}%`};Fn.addEventListener("click",()=>{i<3&&(i=Math.min(3,i+.25),cn())}),qn.addEventListener("click",()=>{i>.5&&(i=Math.max(.5,i-.25),cn())}),_n.addEventListener("click",()=>{i=1,cn()}),Le.appendChild(Object.assign(document.createElement("div"),{className:"bs-ann-sep"})),[qn,Un,Fn,_n,Wn,Yn].forEach(l=>Le.appendChild(l)),rt.appendChild(Le);let Ce=document.createElement("div");Ce.className="bs-ann-pins";let Rt=document.createElement("div");Rt.className="bs-ann-pin-list",Rt.style.display="none",St.appendChild(k),St.appendChild(Ce),Lt.appendChild(St),Lt.appendChild(rt),Lt.appendChild(Rt),t.innerHTML="",t.appendChild(Lt);let Pe=()=>{Ce.innerHTML="",Rt.innerHTML="",Rt.style.display=p.length?"":"none",p.forEach((l,m)=>{let h=document.createElement("div");h.className="bs-ann-pin",h.style.background=l.color,h.style.color=l.color;let z=l.x/(k.width||1)*100,f=l.y/(k.height||1)*100;h.style.left=`${z}%`,h.style.top=`${f}%`,h.innerHTML=`<span class="bs-ann-pin-n">${m+1}</span><span class="bs-ann-pin-pulse"></span>`,h.title=`#${m+1}: ${l.note}`;let I=!1;h.addEventListener("mousedown",N=>{N.stopPropagation(),I=!0,h.classList.add("bs-dragging");let u=M=>{if(!I)return;let A=St.getBoundingClientRect();l.x=(M.clientX-A.left)/A.width*k.width,l.y=(M.clientY-A.top)/A.height*k.height,h.style.left=`${(M.clientX-A.left)/A.width*100}%`,h.style.top=`${(M.clientY-A.top)/A.height*100}%`},y=()=>{I=!1,h.classList.remove("bs-dragging"),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",y),Pe()};document.addEventListener("mousemove",u),document.addEventListener("mouseup",y)}),Ce.appendChild(h);let U=document.createElement("div");U.className="bs-ann-pin-item",U.innerHTML=`
|
|
1782
|
+
<div class="bs-ann-pin-num" style="background:${l.color}">${m+1}</div>
|
|
1603
1783
|
<div class="bs-ann-pin-body">
|
|
1604
|
-
<div class="bs-ann-pin-note">${
|
|
1605
|
-
<div class="bs-ann-pin-loc">${Math.round(
|
|
1606
|
-
</div>`;let
|
|
1784
|
+
<div class="bs-ann-pin-note">${j(l.note)}</div>
|
|
1785
|
+
<div class="bs-ann-pin-loc">${Math.round(z)}% \xD7 ${Math.round(f)}%</div>
|
|
1786
|
+
</div>`;let _=document.createElement("button");_.type="button",_.className="bs-ann-pin-del",_.innerHTML="×",_.title="Remove pin",_.addEventListener("click",()=>{p.splice(m,1),Pe()}),U.appendChild(_),Rt.appendChild(U)})},d,dn=()=>a?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.35)",Ct=(l,m)=>{d.save(),d.strokeStyle=dn(),d.lineWidth=m+3,d.lineCap="round",d.lineJoin="round",d.globalAlpha=.5,l(),d.restore()},Rs=(l,m=!1)=>{if(l.type==="draw"||l.type==="highlight"){if(l.points.length<2)return;let f=l.type==="highlight"?.25:1,I=l.type==="highlight"?l.size*4+10:l.size,U=()=>{d.beginPath(),d.moveTo(l.points[0].x,l.points[0].y);for(let _=1;_<l.points.length;_++)d.lineTo(l.points[_].x,l.points[_].y);d.stroke()};l.type!=="highlight"&&Ct(U,I),d.strokeStyle=l.color,d.lineWidth=I,d.lineCap="round",d.lineJoin="round",d.globalAlpha=f,U(),d.globalAlpha=1}else if(l.type==="rect"){let f=()=>d.strokeRect(l.x,l.y,l.w,l.h);Ct(f,l.size),d.strokeStyle=l.color,d.lineWidth=l.size,d.lineCap="round",d.lineJoin="round",f()}else if(l.type==="circle"){let f=()=>{d.beginPath(),d.ellipse(l.cx,l.cy,Math.abs(l.rx),Math.abs(l.ry),0,0,Math.PI*2),d.stroke()};Ct(f,l.size),d.strokeStyle=l.color,d.lineWidth=l.size,f()}else if(l.type==="arrow"){let f=Math.atan2(l.y2-l.y1,l.x2-l.x1),I=12+l.size*2,U=()=>{d.beginPath(),d.moveTo(l.x1,l.y1),d.lineTo(l.x2,l.y2),d.stroke(),d.beginPath(),d.moveTo(l.x2,l.y2),d.lineTo(l.x2-I*Math.cos(f-.45),l.y2-I*Math.sin(f-.45)),d.moveTo(l.x2,l.y2),d.lineTo(l.x2-I*Math.cos(f+.45),l.y2-I*Math.sin(f+.45)),d.stroke()};Ct(U,l.size),d.strokeStyle=l.color,d.lineWidth=l.size,d.lineCap="round",d.lineJoin="round",U()}else if(l.type==="text"){let f=l.size*5+12;d.font=`bold ${f}px Inter, -apple-system, sans-serif`,d.fillStyle=dn(),d.globalAlpha=.6,d.fillText(l.text,l.x+1,l.y+1),d.globalAlpha=1,d.fillStyle=l.color,d.fillText(l.text,l.x,l.y)}let h=!m&&b>=0&&c[b]===l,z=!m&&!h&&v>=0&&c[v]===l;if(h||z){let f=ee(l);if(d.save(),d.setLineDash([6,4]),d.strokeStyle=a?"#fff":"#000",d.lineWidth=h?1.5:1,d.globalAlpha=h?.7:.45,d.strokeRect(f.x-4,f.y-4,f.w+8,f.h+8),l.type==="rect"||l.type==="circle"){d.setLineDash([]),d.globalAlpha=h?.9:.6;let U=l.type==="rect"?[[f.x,f.y],[f.x+f.w,f.y],[f.x,f.y+f.h],[f.x+f.w,f.y+f.h]]:[[f.x+f.w/2,f.y],[f.x+f.w,f.y+f.h/2],[f.x+f.w/2,f.y+f.h],[f.x,f.y+f.h/2]];for(let[_,N]of U)d.fillStyle="#fff",d.fillRect(_-5,N-5,10,10),d.strokeStyle=a?"#aaa":"#333",d.lineWidth=1.2,d.strokeRect(_-5,N-5,10,10)}d.restore()}},F=()=>{d.clearRect(0,0,k.width,k.height),d.drawImage(lt,0,0);for(let l of c)Rs(l)},ee=l=>{if(l.type==="rect")return{x:Math.min(l.x,l.x+l.w),y:Math.min(l.y,l.y+l.h),w:Math.abs(l.w),h:Math.abs(l.h)};if(l.type==="circle")return{x:l.cx-Math.abs(l.rx),y:l.cy-Math.abs(l.ry),w:Math.abs(l.rx)*2,h:Math.abs(l.ry)*2};if(l.type==="arrow"){let I=Math.min(l.x1,l.x2),U=Math.min(l.y1,l.y2);return{x:I,y:U,w:Math.abs(l.x2-l.x1)||20,h:Math.abs(l.y2-l.y1)||20}}if(l.type==="text")return{x:l.x,y:l.y-(l.size*5+12),w:l.text.length*(l.size*3+8),h:l.size*5+16};if(l.points.length===0)return{x:0,y:0,w:0,h:0};let m=1/0,h=1/0,z=-1/0,f=-1/0;for(let I of l.points)m=Math.min(m,I.x),h=Math.min(h,I.y),z=Math.max(z,I.x),f=Math.max(f,I.y);return{x:m,y:h,w:z-m||10,h:f-h||10}},Te=(l,m)=>{for(let h=c.length-1;h>=0;h--){let z=ee(c[h]),f=8;if(l>=z.x-f&&l<=z.x+z.w+f&&m>=z.y-f&&m<=z.y+z.h+f)return h}return-1},zs=(l,m,h)=>{if(l.type==="draw"||l.type==="highlight")for(let z of l.points)z.x+=m,z.y+=h;else l.type==="rect"?(l.x+=m,l.y+=h):l.type==="circle"?(l.cx+=m,l.cy+=h):l.type==="arrow"?(l.x1+=m,l.y1+=h,l.x2+=m,l.y2+=h):l.type==="text"&&(l.x+=m,l.y+=h)};lt.onload=()=>{let m=(t.clientWidth||450)/lt.width;k.width=lt.width,k.height=lt.height,k.style.height=`${lt.height*m}px`,d=k.getContext("2d"),d.drawImage(lt,0,0);let h=[[10,10],[k.width-10,10],[10,k.height-10],[k.width-10,k.height-10],[k.width/2,k.height/2]],z=0;for(let[N,u]of h){let y=d.getImageData(N,u,1,1).data;z+=(y[0]*299+y[1]*587+y[2]*114)/1e3}a=z/h.length<128;let f=N=>{let u=k.getBoundingClientRect();return{x:(N.clientX-u.left)*(k.width/u.width),y:(N.clientY-u.top)*(k.height/u.height)}},I=!1;k.addEventListener("mousedown",N=>{let u=f(N);if(s==="select"){let y=Te(u.x,u.y);if(y>=0){b=y,S=!0;let M=ee(c[y]);R=u.x-M.x,Z=u.y-M.y,k.classList.add("bs-grabbing"),k.classList.remove("bs-grab"),F()}else b=-1,F();return}if(s!=="pin"&&s!=="text"){let y=Te(u.x,u.y);if(y>=0){b=y,S=!0,I=!0;let M=ee(c[y]);R=u.x-M.x,Z=u.y-M.y,k.classList.add("bs-grabbing"),F();return}}if(D=!0,w=u.x,E=u.y,s==="pin"){D=!1;let y=prompt("Describe the issue at this spot:");if(y){let M=pt[p.length%pt.length];p.push({x:u.x,y:u.y,note:y,color:M}),Pe()}return}if(s==="text"){D=!1;let y=prompt("Enter text:");y&&(c.push({type:"text",color:r,size:o,x:u.x,y:u.y,text:y}),F());return}(s==="draw"||s==="highlight")&&(T=[{x:u.x,y:u.y}])}),k.addEventListener("mousemove",N=>{let u=f(N);if(S&&b>=0){let y=ee(c[b]),M=u.x-R-y.x,A=u.y-Z-y.y;zs(c[b],M,A),F();return}if(s==="select"){let y=Te(u.x,u.y);k.classList.toggle("bs-grab",y>=0),v!==y&&(v=y,F());return}if(s!=="pin"&&s!=="text"&&!D){let y=Te(u.x,u.y);k.classList.toggle("bs-grab",y>=0),v!==y&&(v=y,F())}if(D){if(s==="draw"||s==="highlight"){T.push({x:u.x,y:u.y}),F();let y=s==="highlight"?.25:1,M=s==="highlight"?o*4+10:o;if(s!=="highlight"){d.save(),d.strokeStyle=dn(),d.lineWidth=M+3,d.lineCap="round",d.lineJoin="round",d.globalAlpha=.5,d.beginPath(),d.moveTo(T[0].x,T[0].y);for(let A=1;A<T.length;A++)d.lineTo(T[A].x,T[A].y);d.stroke(),d.restore()}d.strokeStyle=r,d.lineWidth=M,d.lineCap="round",d.lineJoin="round",d.globalAlpha=y,d.beginPath(),d.moveTo(T[0].x,T[0].y);for(let A=1;A<T.length;A++)d.lineTo(T[A].x,T[A].y);d.stroke(),d.globalAlpha=1}else if(F(),d.strokeStyle=r,d.lineWidth=o,d.lineCap="round",d.lineJoin="round",s==="rect")Ct(()=>d.strokeRect(w,E,u.x-w,u.y-E),o),d.strokeStyle=r,d.lineWidth=o,d.strokeRect(w,E,u.x-w,u.y-E);else if(s==="circle"){let y=Math.abs(u.x-w)/2,M=Math.abs(u.y-E)/2,A=w+(u.x-w)/2,Xn=E+(u.y-E)/2;Ct(()=>{d.beginPath(),d.ellipse(A,Xn,y,M,0,0,Math.PI*2),d.stroke()},o),d.strokeStyle=r,d.lineWidth=o,d.beginPath(),d.ellipse(A,Xn,y,M,0,0,Math.PI*2),d.stroke()}else if(s==="arrow"){let y=Math.atan2(u.y-E,u.x-w),M=12+o*2,A=()=>{d.beginPath(),d.moveTo(w,E),d.lineTo(u.x,u.y),d.stroke(),d.beginPath(),d.moveTo(u.x,u.y),d.lineTo(u.x-M*Math.cos(y-.45),u.y-M*Math.sin(y-.45)),d.moveTo(u.x,u.y),d.lineTo(u.x-M*Math.cos(y+.45),u.y-M*Math.sin(y+.45)),d.stroke()};Ct(A,o),d.strokeStyle=r,d.lineWidth=o,d.lineCap="round",d.lineJoin="round",A()}}});let U=N=>{if(S)return S=!1,I=!1,b=-1,k.classList.remove("bs-grabbing"),k.classList.remove("bs-grab"),F(),void 0;if(!D)return;D=!1;let u=f(N);if(s==="draw"||s==="highlight")T.length>1&&c.push({type:s,color:r,size:o,alpha:s==="highlight"?.25:1,points:[...T]}),T=[];else if(s==="rect")c.push({type:"rect",color:r,size:o,x:w,y:E,w:u.x-w,h:u.y-E});else if(s==="circle"){let y=Math.abs(u.x-w)/2,M=Math.abs(u.y-E)/2;c.push({type:"circle",color:r,size:o,cx:w+(u.x-w)/2,cy:E+(u.y-E)/2,rx:y,ry:M})}else s==="arrow"&&c.push({type:"arrow",color:r,size:o,x1:w,y1:E,x2:u.x,y2:u.y});F()};k.addEventListener("mouseup",U),k.addEventListener("mouseleave",N=>{S?(S=!1,I=!1,k.classList.remove("bs-grabbing"),k.classList.remove("bs-grab"),F()):D&&U(N)});let _=N=>{b>=0&&(N.key==="Delete"||N.key==="Backspace")&&(c.splice(b,1),b=-1,F())};document.addEventListener("keydown",_),Wn.addEventListener("click",()=>{c.length&&(c.pop(),b=-1,F())}),Yn.addEventListener("click",()=>{c.length=0,p.length=0,b=-1,F(),Pe()})};let Is=()=>{for(let l=0;l<p.length;l++){let m=p[l],h=16;d.beginPath(),d.arc(m.x,m.y-h,h,0,Math.PI*2),d.fillStyle=m.color,d.fill(),d.strokeStyle="#fff",d.lineWidth=2,d.stroke(),d.beginPath(),d.moveTo(m.x-8,m.y-6),d.lineTo(m.x,m.y+4),d.lineTo(m.x+8,m.y-6),d.fillStyle=m.color,d.fill(),d.fillStyle="#fff",d.font="bold 14px Inter, sans-serif",d.textAlign="center",d.textBaseline="middle",d.fillText(`${l+1}`,m.x,m.y-h),d.textAlign="start",d.textBaseline="alphabetic"}};return{getAnnotation:()=>{try{return b=-1,F(),Is(),k.toDataURL("image/jpeg",.7)}catch{return null}},getPins:()=>p.map((l,m)=>({number:m+1,x:Math.round(l.x),y:Math.round(l.y),note:l.note}))}}function ve(t){if(!g)return;Gt=t,g.querySelectorAll(".bs-tab").forEach(r=>{r.classList.toggle("bs-active",r.dataset.tab===t)});let e=g.querySelector(".bs-scroll"),n={report:vs,console:ti,network:ei,context:ni,history:ri,settings:si};e.innerHTML=n[t](),e.scrollTop=0,ys()}function ys(){if(!g)return;if(Gt==="history"){g.querySelectorAll("[data-hist-del]").forEach(n=>{n.addEventListener("click",()=>{let r=parseInt(n.dataset.histDel),s=g.querySelector(`[data-hist-id="${r}"]`);if(!s)return;let o=s.querySelector(".bs-hist-confirm");if(o){o.remove();return}let i=document.createElement("div");i.className="bs-hist-confirm",i.innerHTML="<span>Delete this report?</span>";let a=document.createElement("button");a.type="button",a.className="bs-hist-confirm-yes",a.textContent="Delete";let c=document.createElement("button");c.type="button",c.className="bs-hist-confirm-no",c.textContent="Cancel",a.addEventListener("click",()=>{Qo(r),ve("history")}),c.addEventListener("click",()=>i.remove()),i.appendChild(a),i.appendChild(c),s.appendChild(i)})}),g.querySelectorAll("[data-hist-edit]").forEach(n=>{n.addEventListener("click",()=>{let r=parseInt(n.dataset.histEdit),s=g.querySelector(`[data-hist-id="${r}"]`);if(!s)return;let o=s.querySelector(".bs-hist-edit-wrap");if(o){o.remove();return}s.querySelector(".bs-hist-confirm")?.remove();let i=Qt().find(S=>S.id===r);if(!i)return;let a=document.createElement("div");a.className="bs-hist-edit-wrap",a.innerHTML=`
|
|
1607
1787
|
<div class="bs-field" style="margin-bottom:8px">
|
|
1608
|
-
<input class="bs-input" data-edit-title value="${
|
|
1788
|
+
<input class="bs-input" data-edit-title value="${j(i.title)}" />
|
|
1609
1789
|
</div>
|
|
1610
1790
|
<div class="bs-field" style="margin-bottom:8px">
|
|
1611
|
-
<textarea class="bs-textarea" data-edit-desc style="min-height:56px">${
|
|
1791
|
+
<textarea class="bs-textarea" data-edit-desc style="min-height:56px">${j(i.description)}</textarea>
|
|
1612
1792
|
</div>
|
|
1613
1793
|
<div class="bs-field" style="margin-bottom:8px">
|
|
1614
1794
|
<div class="bs-sev-row">
|
|
@@ -1618,14 +1798,14 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1618
1798
|
<button type="button" class="bs-sev-btn bs-sev-critical${i.severity==="critical"?" bs-picked":""}" data-edit-sev="critical">Critical</button>
|
|
1619
1799
|
</div>
|
|
1620
1800
|
</div>
|
|
1621
|
-
<div class="bs-hist-edit-row"></div>`;let
|
|
1801
|
+
<div class="bs-hist-edit-row"></div>`;let c=i.severity;s.appendChild(a),a.querySelectorAll("[data-edit-sev]").forEach(S=>{S.addEventListener("click",()=>{c=S.dataset.editSev,a.querySelectorAll(".bs-sev-btn").forEach(D=>D.classList.remove("bs-picked")),S.classList.add("bs-picked")})});let p=a.querySelector(".bs-hist-edit-row"),b=document.createElement("button");b.type="button",b.className="bs-hist-save",b.textContent="Save";let v=document.createElement("button");v.type="button",v.className="bs-hist-cancel",v.textContent="Cancel",b.addEventListener("click",()=>{let S=a.querySelector("[data-edit-title]").value.trim(),D=a.querySelector("[data-edit-desc]").value.trim();S&&(Zo(r,{title:S,description:D,severity:c}),ve("history"))}),v.addEventListener("click",()=>a.remove()),p.appendChild(b),p.appendChild(v)})});return}if(Gt==="settings"){g.querySelectorAll("[data-set-theme]").forEach(n=>{n.addEventListener("click",()=>{let r=n.dataset.setTheme;ye(r),g.querySelectorAll("[data-set-theme]").forEach(s=>s.classList.remove("bs-picked")),n.classList.add("bs-picked")})}),g.querySelectorAll("[data-set-layout]").forEach(n=>{n.addEventListener("click",()=>{let r=n.dataset.setLayout,s=be(r);s&&(At=s,nt(),setTimeout(()=>{Gt="settings",at(),setTimeout(()=>ve("settings"),50)},400))})});return}if(Gt!=="report")return;g.querySelectorAll(".bs-cat-btn").forEach(n=>{n.addEventListener("click",()=>{let r=n.dataset.cat;g.querySelector('input[name="category"]').value=r,g.querySelectorAll(".bs-cat-btn").forEach(s=>s.classList.remove("bs-picked")),n.classList.add("bs-picked")})}),g.querySelectorAll(".bs-sev-btn").forEach(n=>{n.addEventListener("click",()=>{let r=n.dataset.sev;g.querySelector('input[name="severity"]').value=r,g.querySelectorAll(".bs-sev-btn").forEach(s=>s.classList.remove("bs-picked")),n.classList.add("bs-picked")})});let t=null,e=null;g.querySelector("[data-bs-screenshot]")?.addEventListener("click",async()=>{let n=g?.querySelector("[data-bs-shot-title]"),r=g?.querySelector("[data-bs-shot-sub]"),s=g?.querySelector("[data-bs-screenshot]");if(n&&(n.textContent="Capturing..."),g&&(g.style.visibility="hidden"),et&&(et.style.visibility="hidden"),await new Promise(o=>setTimeout(o,200)),t=await Ue(!0),g&&(g.style.visibility=""),et&&(et.style.visibility=""),t){n&&(n.textContent="Screenshot captured!"),r&&(r.textContent="Draw on the image below to highlight the issue"),s?.classList.add("bs-captured");let o=g?.querySelector("[data-bs-annotate]");o&&(e=oi(o,t))}else n&&(n.textContent="Screenshot unavailable"),r&&(r.textContent="Could not capture screenshot on this page")}),g.querySelector("[data-bs-form]")?.addEventListener("submit",async n=>{n.preventDefault();let r=n.target,s=r.querySelector(".bs-submit-btn"),o=r.elements.namedItem("title").value.trim(),i=r.elements.namedItem("description").value.trim(),a=r.elements.namedItem("severity").value,c=r.elements.namedItem("category").value;if(!o)return;s.disabled=!0,s.textContent="Sending...";let p=hs(),b={projectId:G.projectId,title:o,description:i,category:c,severity:a,tags:p.tags.length?p.tags:void 0,context:gs(),consoleLogs:ut(),errors:ft(),networkCaptures:vt(),breadcrumbs:zt(),performance:Bt()??void 0,screenshot:t??void 0,annotation:e?.getAnnotation()??void 0,pins:e?.getPins().length?e.getPins():void 0,createdAt:Date.now()},v=await kn(b);Go({title:b.title,description:b.description,category:b.category,severity:b.severity,tags:b.tags,screenshot:b.screenshot,pins:b.pins,url:window.location.href,createdAt:b.createdAt,status:v.success?"sent":"draft"}),v.success?(s.innerHTML=`${O.check} Bug reported!`,s.classList.add("bs-submit-ok"),setTimeout(nt,1200)):(s.textContent=v.error??"Failed \u2014 saved as draft",s.classList.add("bs-submit-err"),setTimeout(()=>{s.disabled=!1,s.textContent="Submit Report",s.classList.remove("bs-submit-err")},2500))})}function at(){if(!J||K)return;K=!0,Gt="report",Bn(),et=J.createElement("div"),et.className="bs-backdrop",J.body.appendChild(et);let t=vt().length,e=ft().length;g=J.createElement("div"),g.className=`bs-modal bs-ly-${At.id}`,kt(g);let n=`
|
|
1622
1802
|
<div class="bs-tabs">
|
|
1623
|
-
<button class="bs-tab bs-active" data-tab="report">${
|
|
1624
|
-
<button class="bs-tab" data-tab="console">${
|
|
1625
|
-
<button class="bs-tab" data-tab="network">${
|
|
1626
|
-
<button class="bs-tab" data-tab="context">${
|
|
1627
|
-
<button class="bs-tab" data-tab="history">${
|
|
1628
|
-
</div>`,r=
|
|
1803
|
+
<button class="bs-tab bs-active" data-tab="report">${O.report} Report</button>
|
|
1804
|
+
<button class="bs-tab" data-tab="console">${O.console} Console <span class="bs-tab-badge">${ut().length}</span></button>
|
|
1805
|
+
<button class="bs-tab" data-tab="network">${O.network} Network ${t?`<span class="bs-tab-badge bs-warn">${t}</span>`:`<span class="bs-tab-badge">${Dt().length}</span>`}</button>
|
|
1806
|
+
<button class="bs-tab" data-tab="context">${O.ctx} Context ${e?`<span class="bs-tab-badge bs-warn">${e}</span>`:""}</button>
|
|
1807
|
+
<button class="bs-tab" data-tab="history">${O.history} History <span class="bs-tab-badge">${Qt().length}</span></button>
|
|
1808
|
+
</div>`,r=ot(),s=r?r.name.split(" ").map(v=>v[0]).join("").toUpperCase().slice(0,2):"",o=nn(),i=r?`
|
|
1629
1809
|
<div class="bs-hdr">
|
|
1630
1810
|
<div class="bs-logo">BugStash</div>
|
|
1631
1811
|
<div class="bs-hdr-right">
|
|
@@ -1637,35 +1817,39 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1637
1817
|
<div class="bs-user-avatar">${s}</div>
|
|
1638
1818
|
<span>${r.name.split(" ")[0]}</span>
|
|
1639
1819
|
</div>
|
|
1640
|
-
<button class="bs-hdr-icon" data-tab="settings" title="Settings">${
|
|
1820
|
+
<button class="bs-hdr-icon" data-tab="settings" title="Settings">${O.settings}</button>
|
|
1641
1821
|
<button class="bs-login-logout" data-bs-logout title="Sign out">Logout</button>
|
|
1642
|
-
<button class="bs-close-btn" data-bs-close title="Close">${
|
|
1822
|
+
<button class="bs-close-btn" data-bs-close title="Close">${O.x}</button>
|
|
1643
1823
|
</div>
|
|
1644
1824
|
</div>`:`
|
|
1645
1825
|
<div class="bs-hdr" style="justify-content:flex-end">
|
|
1646
|
-
<button class="bs-close-btn" data-bs-close title="Close">${
|
|
1647
|
-
</div>`,a=
|
|
1826
|
+
<button class="bs-close-btn" data-bs-close title="Close">${O.x}</button>
|
|
1827
|
+
</div>`,a=At.tabPosition==="left",c=At.tabPosition==="bottom",p=r?vs():Jo();a?g.innerHTML=`
|
|
1648
1828
|
${i}
|
|
1649
1829
|
<div class="bs-body-wrap">
|
|
1650
1830
|
${r?n:""}
|
|
1651
1831
|
<div class="bs-scroll">${p}</div>
|
|
1652
|
-
</div>`:
|
|
1832
|
+
</div>`:c?g.innerHTML=`
|
|
1653
1833
|
${i}
|
|
1654
1834
|
<div class="bs-scroll">${p}</div>
|
|
1655
|
-
${r?`<div class="bs-tab-divider"></div>${n}`:""}`:
|
|
1835
|
+
${r?`<div class="bs-tab-divider"></div>${n}`:""}`:g.innerHTML=`
|
|
1656
1836
|
${i}
|
|
1657
1837
|
${r?`${n}<div class="bs-tab-divider"></div>`:""}
|
|
1658
|
-
<div class="bs-scroll">${p}</div>`,
|
|
1838
|
+
<div class="bs-scroll">${p}</div>`,J.body.appendChild(g),x&&x.classList.add("bs-open"),requestAnimationFrame(()=>{et?.classList.add("bs-in"),g?.classList.add("bs-in")}),g.querySelectorAll(".bs-tab").forEach(v=>{v.addEventListener("click",()=>ve(v.dataset.tab))}),g.querySelector('.bs-hdr-icon[data-tab="settings"]')?.addEventListener("click",()=>ve("settings")),g.querySelector("[data-bs-close]")?.addEventListener("click",nt),et.addEventListener("click",nt),g.querySelector("[data-bs-pin-toggle]")?.addEventListener("click",()=>{let v=$t(),S=g?.querySelector("[data-bs-pin-toggle]");S&&(S.classList.toggle("active",v),S.innerHTML=`
|
|
1659
1839
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
|
|
1660
|
-
Pins ${
|
|
1661
|
-
`)}),
|
|
1840
|
+
Pins ${v?"ON":"OFF"}
|
|
1841
|
+
`)}),g.querySelector("[data-bs-logout]")?.addEventListener("click",()=>{We(),nt(),setTimeout(()=>at(),300)}),r?ys():ii();let b=v=>{v.key==="Escape"&&(nt(),document.removeEventListener("keydown",b))};document.addEventListener("keydown",b)}function ii(){if(!g)return;let t=g.querySelector("#bs-login-submit"),e=g.querySelector("#bs-login-email"),n=g.querySelector("#bs-login-pass"),r=g.querySelector("#bs-login-error");if(!t||!e||!n)return;let s=async()=>{let o=e.value.trim(),i=n.value;if(!o||!i){r.textContent="Please enter email and password",r.style.display="block";return}t.setAttribute("disabled","true"),t.textContent="Signing in...",r.style.display="none";let a=await _e(o,i,G.projectId);a.success?(Kt(G.projectId,Et),Yt(G.projectId),nt(),setTimeout(()=>at(),300)):(r.textContent=a.error||"Invalid credentials",r.style.display="block",t.removeAttribute("disabled"),t.textContent="Sign In")};t.addEventListener("click",s),n.addEventListener("keydown",o=>{o.key==="Enter"&&s()}),e.addEventListener("keydown",o=>{o.key==="Enter"&&n.focus()}),setTimeout(()=>e.focus(),100)}function nt(){K&&(x&&x.classList.remove("bs-open"),g&&(g.classList.remove("bs-in"),g.classList.add("bs-out")),et&&et.classList.remove("bs-in"),setTimeout(()=>{g?.remove(),et?.remove(),g=null,et=null,K=!1},350))}function kt(t){for(let[e,n]of Object.entries(it.vars))t.style.setProperty(e,n)}function ye(t){let e=Ve(t);e&&(it=e,g&&kt(g),x&&kt(x),P&&kt(P))}function xs(){return it.id}function ws(t){let e=be(t);e&&(At=e,K&&(nt(),setTimeout(at,400)))}function ks(){return At.id}function ai(){try{let t=localStorage.getItem(us);if(!t)return null;let e=JSON.parse(t);if(typeof e.top=="number"&&typeof e.left=="number")return e}catch{}return null}function li(t,e){try{localStorage.setItem(us,JSON.stringify({top:t,left:e}))}catch{}}function ci(t,e){let s=window.innerWidth,o=window.innerHeight;return{top:Math.max(8,Math.min(o-56-8,t)),left:Math.max(8,Math.min(s-56-8,e))}}function Nn(t,e){if(!x)return;let n=ci(t,e);x.style.top=`${n.top}px`,x.style.left=`${n.left}px`,x.style.bottom="auto",x.style.right="auto",Es(n.top,n.left)}function Es(t,e){if(!P)return;let n=56,r=8,s=P.offsetHeight||200,o=t-s-r;o<8&&(o=t+n+r),P.style.top=`${o}px`,P.style.bottom="auto",P.style.left=`${e+n/2-20}px`,P.style.right="auto"}function di(){if(!x)return;let t=0,e=0,n=0,r=0,s=!1;function o(){x&&(x.removeEventListener("pointermove",a),x.removeEventListener("pointerup",c),x.classList.remove("bs-dragging")),Dn=null}function i(p){if(!x)return;Mt=!1,s=!1,t=p.clientX,e=p.clientY;let b=x.getBoundingClientRect();n=b.top,r=b.left,x.setPointerCapture(p.pointerId),x.addEventListener("pointermove",a),x.addEventListener("pointerup",c),Dn=o}function a(p){let b=p.clientX-t,v=p.clientY-e;if(!s&&Math.abs(b)<5&&Math.abs(v)<5)return;s=!0,Mt=!0,x?.classList.add("bs-dragging");let S=n+v,D=r+b;Nn(S,D)}function c(p){if(x?.releasePointerCapture(p.pointerId),o(),s&&x){let b=x.getBoundingClientRect();li(b.top,b.left),p.preventDefault(),p.stopPropagation(),setTimeout(()=>{Mt=!1},10)}else Mt=!1}x.addEventListener("pointerdown",i)}function Ls(t,e){G=t,Et=e,wt=document.createElement("iframe"),wt.style.cssText="position:fixed;inset:0;z-index:2147483640;pointer-events:none;border:none;background:transparent;width:100%;height:100%;color-scheme:normal;";let n=`
|
|
1662
1842
|
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');
|
|
1663
|
-
${
|
|
1664
|
-
${
|
|
1665
|
-
|
|
1843
|
+
${Vo}
|
|
1844
|
+
${Xr}
|
|
1845
|
+
html, body { margin: 0; padding: 0; background: transparent; pointer-events: none; overflow: hidden; }
|
|
1846
|
+
`;wt.srcdoc=`<!DOCTYPE html><html><head><style>${n}</style></head><body></body></html>`,wt.addEventListener("load",()=>{J=wt.contentDocument,J&&pi(t)}),Et.appendChild(wt),bi(t),he=()=>{if(!(!x||Mt)&&x.style.top&&x.style.top!=="auto"){let r=x.getBoundingClientRect();Nn(r.top,r.left)}},window.addEventListener("resize",he)}function pi(t){if(!J)return;let e=t.panelPosition==="bottom-left"?"left":"right";x=J.createElement("button"),x.className="bs-fab",kt(x),x.innerHTML=`${O.bug}<span class="bs-fab-label">Report a bug</span>`;let n=ai();n?Nn(n.top,n.left):x.style[e]="24px",x.addEventListener("click",()=>{Mt||(K?nt():at())}),J.body.appendChild(x),di(),P=J.createElement("div"),P.className="bs-toolbar",n?Es(n.top,n.left):P.style[e]="32px",kt(P);let s=navigator.platform.toUpperCase().includes("MAC")?"\u2318":"Ctrl",o=[{icon:O.cam,tip:"Screenshot",kbd:`${s}+Shift+S`,action:async()=>{let i=await Ue(!0);i&&(K||at(),setTimeout(()=>{let a=g?.querySelector("[data-bs-screenshot]");if(a){a.__screenshot=i,a.classList.add("bs-captured");let c=a.querySelector("[data-bs-shot-title]"),p=a.querySelector("[data-bs-shot-sub]");c&&(c.textContent="Screenshot captured!"),p&&(p.textContent="Click to retake or annotate"),a.click()}},400))}},{icon:O.pin,tip:"Toggle Pins",kbd:`${s}+Shift+P`,id:"bs-tb-pin",action:()=>{if(!ot()){K||at();return}Et?.querySelector("#bugstash-live-pins")||(Kt(G.projectId,Et),Yt(G.projectId));let a=$t(),c=P?.querySelector("#bs-tb-pin");c&&c.classList.toggle("bs-active",a);let p=g?.querySelector("[data-bs-pin-toggle]");p&&(p.classList.toggle("active",a),p.innerHTML=`
|
|
1666
1847
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
|
|
1667
1848
|
Pins ${a?"ON":"OFF"}
|
|
1668
|
-
`)}},{icon:
|
|
1849
|
+
`)}},{icon:it.id==="black"?O.sun:O.moon,tip:"Toggle Theme",kbd:`${s}+Shift+T`,id:"bs-tb-theme",action:()=>{let i=it.id==="black"?"white":"black";ye(i),P&&kt(P);let a=P?.querySelector("#bs-tb-theme");a&&(a.innerHTML=`${it.id==="black"?O.sun:O.moon}<span class="bs-toolbar-tip">${it.id==="black"?"Light":"Dark"} Mode<span class="bs-toolbar-kbd">${s}+Shift+T</span></span>`)}},{icon:O.report,tip:"Open Panel",kbd:`${s}+Shift+B`,action:()=>{K?nt():at()}}];for(let i of o){let a=J.createElement("button");a.className="bs-toolbar-btn",i.id&&(a.id=i.id),a.innerHTML=`${i.icon}<span class="bs-toolbar-tip">${i.tip}<span class="bs-toolbar-kbd">${i.kbd}</span></span>`,a.addEventListener("click",c=>{c.stopPropagation(),i.action()}),P.appendChild(a)}J.body.appendChild(P),x.addEventListener("mouseenter",()=>{K||bs()}),x.addEventListener("mouseleave",i=>{let a=i.relatedTarget;P?.contains(a)||Bn()}),P.addEventListener("mouseenter",()=>bs()),P.addEventListener("mouseleave",i=>{let a=i.relatedTarget;x?.contains(a)||Bn()})}function bi(t){let n=navigator.platform.toUpperCase().includes("MAC")?"\u2318":"Ctrl";ge=r=>{if((r.ctrlKey||r.metaKey)&&r.shiftKey){if(r.key==="B"||r.key==="b")r.preventDefault(),K?nt():at();else if(r.key==="S"||r.key==="s")r.preventDefault(),Ue(!0).then(o=>{o&&(K||at(),setTimeout(()=>{let i=g?.querySelector("[data-bs-screenshot]");if(i){i.__screenshot=o,i.classList.add("bs-captured");let a=i.querySelector("[data-bs-shot-title]"),c=i.querySelector("[data-bs-shot-sub]");a&&(a.textContent="Screenshot captured!"),c&&(c.textContent="Click to retake or annotate"),i.click()}},400))});else if(r.key==="P"||r.key==="p"){if(r.preventDefault(),!ot()){K||at();return}Et?.querySelector("#bugstash-live-pins")||(Kt(t.projectId,Et),Yt(t.projectId));let i=$t(),a=P?.querySelector("#bs-tb-pin");a&&a.classList.toggle("bs-active",i);let c=g?.querySelector("[data-bs-pin-toggle]");c&&(c.classList.toggle("active",i),c.innerHTML=`
|
|
1850
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
|
|
1851
|
+
Pins ${i?"ON":"OFF"}
|
|
1852
|
+
`)}else if(r.key==="T"||r.key==="t"){r.preventDefault();let i=navigator.platform.toUpperCase().includes("MAC")?"\u2318":"Ctrl",a=it.id==="black"?"white":"black";ye(a),P&&kt(P);let c=P?.querySelector("#bs-tb-theme");c&&(c.innerHTML=`${it.id==="black"?O.sun:O.moon}<span class="bs-toolbar-tip">${it.id==="black"?"Light":"Dark"} Mode<span class="bs-toolbar-kbd">${i}+Shift+T</span></span>`)}}},document.addEventListener("keydown",ge)}function bs(){rn||K||(rn=!0,P?.classList.add("bs-show"))}function Bn(){rn=!1,P?.classList.remove("bs-show")}function Ss(){nt(),Dn?.(),Mt=!1,x?.remove(),x=null,P?.remove(),P=null,rn=!1,wt?.remove(),wt=null,J=null,Et=null,ge&&document.removeEventListener("keydown",ge),ge=null,he&&window.removeEventListener("resize",he),he=null}var dt=null,q=null,C=null,ht=null,sn="freehand",on="#ef4444",ui=3,Zt=[],Q=null,xe=!1,an=null,fi=[{id:"freehand",label:"Draw",icon:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25z"},{id:"rectangle",label:"Rect",icon:"M3 3h18v18H3V3zm2 2v14h14V5H5z"},{id:"circle",label:"Circle",icon:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},{id:"arrow",label:"Arrow",icon:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}],mi=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#ffffff","#000000"];function Ts(t){return new Promise(e=>{an=e,Zt=[],Q=null,sn="freehand",on="#ef4444",gi(t)})}function gi(t){dt&&dt.remove(),dt=document.createElement("div"),dt.id="bs-annotation-overlay";let e=document.createElement("style");e.textContent=`
|
|
1669
1853
|
#bs-annotation-overlay {
|
|
1670
1854
|
position: fixed; inset: 0; z-index: 2147483647;
|
|
1671
1855
|
background: rgba(0,0,0,0.85);
|
|
@@ -1710,5 +1894,5 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1710
1894
|
overflow: hidden; padding: 16px;
|
|
1711
1895
|
}
|
|
1712
1896
|
.bs-ann-canvas-wrap canvas { cursor: crosshair; border-radius: 4px; }
|
|
1713
|
-
`,
|
|
1897
|
+
`,dt.appendChild(e);let n=document.createElement("div");n.className="bs-ann-toolbar";for(let a of fi){let c=document.createElement("button");c.className=`bs-ann-tool${a.id===sn?" active":""}`,c.title=a.label,c.innerHTML=`<svg viewBox="0 0 24 24"><path d="${a.icon}"/></svg>`,c.addEventListener("click",()=>{sn=a.id,n.querySelectorAll(".bs-ann-tool").forEach(p=>p.classList.remove("active")),c.classList.add("active")}),n.appendChild(c)}n.appendChild(Cs());for(let a of mi){let c=document.createElement("button");c.className=`bs-ann-color${a===on?" active":""}`,c.style.background=a,c.addEventListener("click",()=>{on=a,n.querySelectorAll(".bs-ann-color").forEach(p=>p.classList.remove("active")),c.classList.add("active")}),n.appendChild(c)}n.appendChild(Cs());let r=document.createElement("button");r.className="bs-ann-btn bs-ann-undo",r.textContent="Undo",r.addEventListener("click",()=>{Zt.pop(),ln()}),n.appendChild(r);let s=document.createElement("button");s.className="bs-ann-btn bs-ann-save",s.textContent="Save",s.addEventListener("click",vi);let o=document.createElement("button");o.className="bs-ann-btn bs-ann-cancel",o.textContent="Cancel",o.addEventListener("click",()=>{jn(),an?.(null)}),n.appendChild(s),n.appendChild(o),dt.appendChild(n);let i=document.createElement("div");i.className="bs-ann-canvas-wrap",q=document.createElement("canvas"),C=q.getContext("2d"),i.appendChild(q),dt.appendChild(i),document.body.appendChild(dt),ht=new Image,ht.onload=()=>{if(!q||!C||!ht)return;let a=window.innerWidth-32,c=window.innerHeight-100,p=ht.width,b=ht.height,v=Math.min(1,a/p,c/b);p=Math.round(p*v),b=Math.round(b*v),q.width=p,q.height=b,ln(),hi()},ht.src=t}function Cs(){let t=document.createElement("div");return t.className="bs-ann-sep",t}function hi(){if(!q)return;q.addEventListener("mousedown",e=>{xe=!0;let{x:n,y:r}=Ps(e);Q={type:sn,color:on,lineWidth:ui,points:[{x:n,y:r}],x:n,y:r,width:0,height:0}}),q.addEventListener("mousemove",e=>{if(!xe||!Q)return;let{x:n,y:r}=Ps(e);Q.type==="freehand"?Q.points.push({x:n,y:r}):(Q.width=n-Q.x,Q.height=r-Q.y),ln(),$s(Q)});let t=()=>{xe&&Q&&(Zt.push(Q),Q=null),xe=!1,ln()};q.addEventListener("mouseup",t),q.addEventListener("mouseleave",t)}function Ps(t){let e=q.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}function ln(){if(!(!C||!q||!ht)){C.clearRect(0,0,q.width,q.height),C.drawImage(ht,0,0,q.width,q.height);for(let t of Zt)$s(t)}}function $s(t){if(C)switch(C.strokeStyle=t.color,C.fillStyle=t.color,C.lineWidth=t.lineWidth,C.lineCap="round",C.lineJoin="round",t.type){case"freehand":{if(!t.points||t.points.length<2)return;C.beginPath(),C.moveTo(t.points[0].x,t.points[0].y);for(let e=1;e<t.points.length;e++)C.lineTo(t.points[e].x,t.points[e].y);C.stroke();break}case"rectangle":{C.strokeRect(t.x,t.y,t.width,t.height);break}case"circle":{let e=t.x+t.width/2,n=t.y+t.height/2,r=Math.abs(t.width)/2,s=Math.abs(t.height)/2;C.beginPath(),C.ellipse(e,n,r,s,0,0,Math.PI*2),C.stroke();break}case"arrow":{let e=t.x,n=t.y,r=t.x+t.width,s=t.y+t.height,o=14,i=Math.atan2(s-n,r-e);C.beginPath(),C.moveTo(e,n),C.lineTo(r,s),C.stroke(),C.beginPath(),C.moveTo(r,s),C.lineTo(r-o*Math.cos(i-Math.PI/6),s-o*Math.sin(i-Math.PI/6)),C.lineTo(r-o*Math.cos(i+Math.PI/6),s-o*Math.sin(i+Math.PI/6)),C.closePath(),C.fill();break}}}function vi(){if(!q){jn(),an?.(null);return}let e={dataUrl:q.toDataURL("image/png"),annotations:Zt};jn(),an?.(e)}function jn(){dt?.remove(),dt=null,q=null,C=null,ht=null,Zt=[],Q=null,xe=!1}var ke=!1,we=null;function yi(){if(we)return we;let t=document.createElement("bugstash-root");return t.style.setProperty("position","fixed","important"),t.style.setProperty("inset","0","important"),t.style.setProperty("pointer-events","none","important"),t.style.setProperty("z-index","2147483640","important"),t.style.setProperty("display","block","important"),t.style.setProperty("visibility","visible","important"),t.style.setProperty("opacity","1","important"),t.style.setProperty("transform","none","important"),t.style.setProperty("perspective","none","important"),t.style.setProperty("filter","none","important"),t.style.setProperty("will-change","auto","important"),t.style.setProperty("contain","none","important"),t.style.setProperty("isolation","auto","important"),t.style.setProperty("mix-blend-mode","normal","important"),t.style.setProperty("clip-path","none","important"),t.style.setProperty("margin","0","important"),t.style.setProperty("padding","0","important"),t.style.setProperty("border","none","important"),t.style.setProperty("background","none","important"),t.style.setProperty("box-sizing","border-box","important"),t.style.setProperty("overflow","visible","important"),t.style.setProperty("min-width","0","important"),t.style.setProperty("min-height","0","important"),t.style.setProperty("max-width","none","important"),t.style.setProperty("max-height","none","important"),t.style.setProperty("float","none","important"),t.style.setProperty("clear","none","important"),t.style.setProperty("columns","auto","important"),t.style.setProperty("font-size","16px","important"),t.style.setProperty("line-height","normal","important"),t.style.setProperty("text-align","left","important"),t.style.setProperty("direction","ltr","important"),we=t.attachShadow({mode:"closed"}),document.body.appendChild(t),we}function Ms(t){if(ke)return;ke=!0;let e=yi();Jn(t.maxBreadcrumbs),tr(t.maxLogs),or(t.maxNetworkCaptures),lr(),t.enablePerformance!==!1&&pr(),Ls(t,e),t.enableLivePins!==!1&&ot()&&(Kt(t.projectId,e),Yt(t.projectId))}function xi(){if(typeof window>"u")return"production";let t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"||t==="0.0.0.0"||t.endsWith(".local")||/^192\.168\./.test(t)||/^10\./.test(t)||/^172\.(1[6-9]|2\d|3[01])\./.test(t)?"development":t.includes("staging")||t.includes("stage")||t.includes("preview")||t.includes("preprod")||t.includes("pre-prod")||t.includes("qa.")||t.includes(".qa")||t.includes("test.")||t.includes(".dev.")||t.includes("vercel.app")||t.includes("netlify.app")||t.includes("pages.dev")||t.includes("ngrok.io")||t.includes("ngrok-free.app")||t.includes("localhost.run")||t.includes("loca.lt")?"staging":"production"}var wi={init(t){if(ke||typeof window>"u"||(t.environment??xi())==="production")return;t.endpoint&&Hr(t.endpoint);let n=window.location.hostname;n==="localhost"||n==="127.0.0.1"||n==="0.0.0.0"||n.endsWith(".local")||/^192\.168\./.test(n)||/^10\./.test(n)||/^172\.(1[6-9]|2\d|3[01])\./.test(n)?Ms(t):Fr(t.projectId).then(s=>{s&&Ms(t)}).catch(()=>{})},destroy(){ke&&(Ss(),is(),Jr(),nr(),ar(),dr(),Gn(),br(),document.querySelector("bugstash-root")?.remove(),we=null,ke=!1)},getLogs:ut,clearLogs:er,getNetworkCaptures:Dt,getFailedNetworkCaptures:vt,clearNetworkCaptures:ir,getErrors:ft,clearErrors:cr,getBreadcrumbs:zt,clearBreadcrumbs:Kn,getPerformanceMetrics:Bt,addBreadcrumb:V,getThemes:Xe,getThemeById:Ve,setTheme:ye,getCurrentThemeId:xs,getLayouts:Je,getLayoutById:be,setLayout:ws,getCurrentLayoutId:ks,getCurrentUser:ot,login:_e,logout:We,togglePinMode:$t,isPinModeActive:nn,isConnected:Kr,openAnnotationEditor:Ts,redactString:It,redactObject:Me},Ka=wi;export{wi as BugStash,Ka as default};
|
|
1714
1898
|
//# sourceMappingURL=index.js.map
|