@githumbi/grabby 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/dist/angular/index.d.ts +2 -0
- package/dist/angular/index.js +536 -354
- package/dist/angular/index.js.map +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/core/index.cjs +683 -501
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +536 -354
- package/dist/core/index.js.map +1 -1
- package/dist/grabby.global.js +101 -96
- package/dist/live/index.d.cts +1 -1
- package/dist/live/index.d.ts +1 -1
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +536 -354
- package/dist/react/index.js.map +1 -1
- package/dist/{types-CMgpkvBz.d.cts → types-DjpIHekd.d.cts} +2 -0
- package/dist/{types-CMgpkvBz.d.ts → types-DjpIHekd.d.ts} +2 -0
- package/package.json +4 -4
package/dist/grabby.global.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var Ci=Object.defineProperty;var Ti=(e,t)=>()=>(e&&(t=e(e=0)),t);var ki=(e,t)=>{for(var n in t)Ci(e,n,{get:t[n],enumerable:!0})};var Dr={};ki(Dr,{createContext:()=>Cr,destroyContext:()=>Rr,domToBlob:()=>Pl,domToCanvas:()=>pt,domToDataUrl:()=>$e,domToForeignObjectSvg:()=>Pr,domToImage:()=>Ml,domToJpeg:()=>Dl,domToPixel:()=>Ol,domToPng:()=>Fl,domToSvg:()=>Mr,domToWebp:()=>Hl,loadMedia:()=>Le,waitUntilLoad:()=>xr});function sr(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}function Ss(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let o=0;o<8;o++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function Cs(e){let t=-1;on||(on=Ss());for(let n=0;n<e.length;n++)t=on[(t^e[n])&255]^t>>>8;return t^-1}function Ts(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===lr&&e[n-2]===cr&&e[n-1]===ur&&e[n]===dr)return n-3;return 0}function mr(e,t,n=!1){let o=new Uint8Array(13);t*=39.3701,o[0]=lr,o[1]=cr,o[2]=ur,o[3]=dr,o[4]=t>>>24,o[5]=t>>>16,o[6]=t>>>8,o[7]=t&255,o[8]=o[4],o[9]=o[5],o[10]=o[6],o[11]=o[7],o[12]=1;let r=Cs(o),i=new Uint8Array(4);if(i[0]=r>>>24,i[1]=r>>>16,i[2]=r>>>8,i[3]=r&255,n){let a=Ts(e);return e.set(o,a),e.set(i,a+13),e}else{let a=new Uint8Array(4);a[0]=0,a[1]=0,a[2]=0,a[3]=9;let s=new Uint8Array(54);return s.set(e,0),s.set(a,33),s.set(o,37),s.set(i,50),s}}function Rs(e){let t=e.indexOf(ks);return t===-1&&(t=e.indexOf(As)),t===-1&&(t=e.indexOf(_s)),t}function Ys(e){let t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}function hr(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(pe&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!pe)return e;let n=mt().implementation.createHTMLDocument(),o=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(o),n.body.appendChild(r),t&&(o.href=t),r.href=e,r.href}function mt(e){return(e&&J(e)?e?.ownerDocument:e)??window.document}function yr(e,t,n){let o=mt(n).createElementNS(ft,"svg");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),o}function vr(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}async function Xs(e,t="image/png",n=1){try{return await new Promise((o,r)=>{e.toBlob(i=>{i?o(i):r(new Error("Blob is null"))},t,n)})}catch(o){if(pr)return qs(e.toDataURL(t,n));throw o}}function qs(e){let[t,n]=e.split(","),o=t.match(/data:(.+);/)?.[1]??void 0,r=window.atob(n),i=r.length,a=new Uint8Array(i);for(let s=0;s<i;s+=1)a[s]=r.charCodeAt(s);return new Blob([a],{type:o})}function Er(e,t){return new Promise((n,o)=>{let r=new FileReader;r.onload=()=>n(r.result),r.onerror=()=>o(r.error),r.onabort=()=>o(new Error(`Failed read blob to ${t}`)),t==="dataUrl"?r.readAsDataURL(e):t==="arrayBuffer"&&r.readAsArrayBuffer(e)})}function Se(e,t){let n=mt(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function Le(e,t){return new Promise(n=>{let{timeout:o,ownerDocument:r,onError:i,onWarn:a}=t??{},s=typeof e=="string"?Se(e,mt(r)):e,u=null,c=null;function l(){n(s),u&&clearTimeout(u),c?.()}if(o&&(u=setTimeout(l,o)),dt(s)){let m=s.currentSrc||s.src;if(!m)return s.poster?Le(s.poster,t).then(n):l();if(s.readyState>=2)return l();let p=l,f=E=>{a?.("Failed video load",m,E),i?.(E),l()};c=()=>{s.removeEventListener("loadeddata",p),s.removeEventListener("error",f)},s.addEventListener("loadeddata",p,{once:!0}),s.addEventListener("error",f,{once:!0})}else{let m=gr(s)?s.href.baseVal:s.currentSrc||s.src;if(!m)return l();let p=async()=>{if(Ne(s)&&"decode"in s)try{await s.decode()}catch(E){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||m,E)}l()},f=E=>{a?.("Failed image load",s.dataset.originalSrc||m,E),l()};if(Ne(s)&&s.complete)return p();c=()=>{s.removeEventListener("load",p),s.removeEventListener("error",f)},s.addEventListener("load",p,{once:!0}),s.addEventListener("error",f,{once:!0})}})}async function xr(e,t){ze(e)&&(Ne(e)||dt(e)?await Le(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(o=>Le(o,t)))))}function Sr(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}function Qs(e){let t=`${fr}[#${tr}]`;return tr++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&Ws(...n)}}function el(e){return{cache:e?"no-cache":"force-cache"}}async function Q(e,t){return Ls(e)?e:Cr(e,{...t,autoDestruct:!0})}async function Cr(e,t){let{scale:n=1,workerUrl:o,workerNumber:r=1}=t||{},i=!!t?.debug,a=t?.features??!0,s=e.ownerDocument??(pe?window.document:void 0),u=e.ownerDocument?.defaultView??(pe?window:void 0),c=new Map,l={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:el(t?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:r,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:Qs(i),node:e,ownerDocument:s,ownerWindow:u,dpi:n===1?null:96*n,svgStyleElement:Tr(s),svgDefsElement:s?.createElementNS(ft,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Is&&o&&r?r:0})].map(()=>{try{let f=new Worker(o);return f.onmessage=async E=>{let{url:g,result:h}=E.data;h?c.get(g)?.resolve?.(h):c.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`))},f.onmessageerror=E=>{let{url:g}=E.data;c.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`))},f}catch(f){return l.log.warn("Failed to new Worker",f),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Ys(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:c,drawImageCount:0,tasks:[],features:a,isEnable:f=>f==="restoreScrollPosition"?typeof a=="boolean"?!1:a[f]??!1:typeof a=="boolean"?a:a[f]??!0,shadowRoots:[]};l.log.time("wait until load"),await xr(e,{timeout:l.timeout,onWarn:l.log.warn}),l.log.timeEnd("wait until load");let{width:m,height:p}=tl(e,l);return l.width=m,l.height=p,l}function Tr(e){if(!e)return;let t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
|
|
2
2
|
.______background-clip--text {
|
|
3
3
|
background-clip: text;
|
|
4
4
|
-webkit-background-clip: text;
|
|
5
5
|
}
|
|
6
|
-
`);return t.appendChild(n),t}function
|
|
7
|
-
`),
|
|
8
|
-
`))}else{let u=Array.from(n.styleSheets).filter(
|
|
9
|
-
`)):
|
|
10
|
-
`))}))})}}function
|
|
6
|
+
`);return t.appendChild(n),t}function tl(e,t){let{width:n,height:o}=t;if(J(e)&&(!n||!o)){let r=e.getBoundingClientRect();n=n||r.width||Number(e.getAttribute("width"))||0,o=o||r.height||Number(e.getAttribute("height"))||0}return{width:n,height:o}}async function nl(e,t){let{log:n,timeout:o,drawImageCount:r,drawImageInterval:i}=t;n.time("image to canvas");let a=await Le(e,{timeout:o,onWarn:t.log.warn}),{canvas:s,context2d:u}=ol(e.ownerDocument,t),c=()=>{try{u?.drawImage(a,0,0,s.width,s.height)}catch(l){t.log.warn("Failed to drawImage",l)}};if(c(),t.isEnable("fixSvgXmlDecode"))for(let l=0;l<r;l++)await new Promise(m=>{setTimeout(()=>{u?.clearRect(0,0,s.width,s.height),c(),m()},l+i)});return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function ol(e,t){let{width:n,height:o,scale:r,backgroundColor:i,maximumCanvasSize:a}=t,s=e.createElement("canvas");s.width=Math.floor(n*r),s.height=Math.floor(o*r),s.style.width=`${n}px`,s.style.height=`${o}px`,a&&(s.width>a||s.height>a)&&(s.width>a&&s.height>a?s.width>s.height?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a):s.width>a?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a));let u=s.getContext("2d");return u&&i&&(u.fillStyle=i,u.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:u}}function kr(e,t){if(e.ownerDocument)try{let i=e.toDataURL();if(i!=="data:,")return Se(i,e.ownerDocument)}catch(i){t.log.warn("Failed to clone canvas",i)}let n=e.cloneNode(!1),o=e.getContext("2d"),r=n.getContext("2d");try{return o&&r&&r.putImageData(o.getImageData(0,0,e.width,e.height),0,0),n}catch(i){t.log.warn("Failed to clone canvas",i)}return n}function rl(e,t){try{if(e?.contentDocument?.documentElement)return cn(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}function il(e){let t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}async function al(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Se(e.poster,e.ownerDocument);let n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let o=n.ownerDocument;if(o){let r=!0;if(await Le(n,{onError:()=>r=!1,onWarn:t.log.warn}),!r)return e.poster?Se(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(a=>{n.addEventListener("seeked",a,{once:!0})});let i=o.createElement("canvas");i.width=e.offsetWidth,i.height=e.offsetHeight;try{let a=i.getContext("2d");a&&a.drawImage(n,0,0,i.width,i.height)}catch(a){return t.log.warn("Failed to clone video",a),e.poster?Se(e.poster,e.ownerDocument):n}return kr(i,t)}return n}function sl(e,t){return Hs(e)?kr(e,t):js(e)?rl(e,t):Ne(e)?il(e):dt(e)?al(e,t):e.cloneNode(!1)}function ll(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement("iframe"),t.id=`__SANDBOX__${wr()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",n.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t)}catch(o){e.log.warn("Failed to getSandBox",o)}}return t}function Ar(e,t,n){let{defaultComputedStyles:o}=n,r=e.nodeName.toLowerCase(),i=je(e)&&r!=="svg",a=i?ul.map(g=>[g,e.getAttribute(g)]).filter(([,g])=>g!==null):[],s=[i&&"svg",r,a.map((g,h)=>`${g}=${h}`).join(","),t].filter(Boolean).join(":");if(o.has(s))return o.get(s);let c=ll(n)?.contentWindow;if(!c)return new Map;let l=c?.document,m,p;i?(m=l.createElementNS(ft,"svg"),p=m.ownerDocument.createElementNS(m.namespaceURI,r),a.forEach(([g,h])=>{p.setAttributeNS(null,g,h)}),m.appendChild(p)):m=p=l.createElement(r),p.textContent=" ",l.body.appendChild(m);let f=c.getComputedStyle(p,t),E=new Map;for(let g=f.length,h=0;h<g;h++){let x=f.item(h);cl.includes(x)||E.set(x,f.getPropertyValue(x))}return l.body.removeChild(m),o.set(s,E),E}function _r(e,t,n){let o=new Map,r=[],i=new Map;if(n)for(let s of n)a(s);else for(let s=e.length,u=0;u<s;u++){let c=e.item(u);a(c)}for(let s=r.length,u=0;u<s;u++)i.get(r[u])?.forEach((c,l)=>o.set(l,c));function a(s){let u=e.getPropertyValue(s),c=e.getPropertyPriority(s),l=s.lastIndexOf("-"),m=l>-1?s.substring(0,l):void 0;if(m){let p=i.get(m);p||(p=new Map,i.set(m,p)),p.set(s,[u,c])}t.get(s)===u&&!c||(m?r.push(m):o.set(s,[u,c]))}return o}function dl(e,t,n,o){let{ownerWindow:r,includeStyleProperties:i,currentParentNodeStyle:a}=o,s=t.style,u=r.getComputedStyle(e),c=Ar(e,null,o);a?.forEach((m,p)=>{c.delete(p)});let l=_r(u,c,i);l.delete("transition-property"),l.delete("all"),l.delete("d"),l.delete("content"),n&&(l.delete("position"),l.delete("margin-top"),l.delete("margin-right"),l.delete("margin-bottom"),l.delete("margin-left"),l.delete("margin-block-start"),l.delete("margin-block-end"),l.delete("margin-inline-start"),l.delete("margin-inline-end"),l.set("box-sizing",["border-box",""])),l.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text"),br&&(l.has("font-kerning")||l.set("font-kerning",["normal",""]),(l.get("overflow-x")?.[0]==="hidden"||l.get("overflow-y")?.[0]==="hidden")&&l.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&l.set("text-overflow",["clip",""]));for(let m=s.length,p=0;p<m;p++)s.removeProperty(s.item(p));return l.forEach(([m,p],f)=>{s.setProperty(f,m,p)}),l}function ml(e,t){(Us(e)||Bs(e)||zs(e))&&t.setAttribute("value",e.value)}function bl(e,t,n,o,r){let{ownerWindow:i,svgStyleElement:a,svgStyles:s,currentNodeStyle:u}=o;if(!a||!i)return;function c(l){let m=i.getComputedStyle(e,l),p=m.getPropertyValue("content");if(!p||p==="none")return;r?.(p),p=p.replace(/(')|(")|(counter\(.+\))/g,"");let f=[wr()],E=Ar(e,l,o);u?.forEach((v,y)=>{E.delete(y)});let g=_r(m,E,o.includeStyleProperties);g.delete("content"),g.delete("-webkit-locale"),g.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");let h=[`content: '${p}';`];if(g.forEach(([v,y],T)=>{h.push(`${T}: ${v}${y?" !important":""};`)}),h.length===1)return;try{t.className=[t.className,...f].join(" ")}catch(v){o.log.warn("Failed to copyPseudoClass",v);return}let x=h.join(`
|
|
7
|
+
`),b=s.get(x);b||(b=[],s.set(x,b)),b.push(`.${f[0]}${l}`)}fl.forEach(c),n&&pl.forEach(c)}async function or(e,t,n,o,r){if(J(n)&&(Gs(n)||Vs(n))||o.filter&&!o.filter(n))return;nr.has(t.nodeName)||nr.has(n.nodeName)?o.currentParentNodeStyle=void 0:o.currentParentNodeStyle=o.currentNodeStyle;let i=await cn(n,o,!1,r);o.isEnable("restoreScrollPosition")&&gl(e,i),t.appendChild(i)}async function rr(e,t,n,o){let r=e.firstChild;J(e)&&e.shadowRoot&&(r=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let i=r;i;i=i.nextSibling)if(!Os(i))if(J(i)&&Ks(i)&&typeof i.assignedNodes=="function"){let a=i.assignedNodes();for(let s=0;s<a.length;s++)await or(e,t,a[s],n,o)}else await or(e,t,i,n,o)}function gl(e,t){if(!ze(e)||!ze(t))return;let{scrollTop:n,scrollLeft:o}=e;if(!n&&!o)return;let{transform:r}=t.style,i=new DOMMatrix(r),{a,b:s,c:u,d:c}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-o,-n),i.a=a,i.b=s,i.c=u,i.d=c,t.style.transform=i.toString()}function hl(e,t){let{backgroundColor:n,width:o,height:r,style:i}=t,a=e.style;if(n&&a.setProperty("background-color",n,"important"),o&&a.setProperty("width",`${o}px`,"important"),r&&a.setProperty("height",`${r}px`,"important"),i)for(let s in i)a[s]=i[s]}async function cn(e,t,n=!1,o){let{ownerDocument:r,ownerWindow:i,fontFamilies:a,onCloneEachNode:s}=t;if(r&&Fs(e))return o&&/\S/.test(e.data)&&o(e.data),r.createTextNode(e.data);if(r&&i&&J(e)&&(ze(e)||je(e))){let c=await sl(e,t);if(t.isEnable("removeAbnormalAttributes")){let g=c.getAttributeNames();for(let h=g.length,x=0;x<h;x++){let b=g[x];yl.test(b)||c.removeAttribute(b)}}let l=t.currentNodeStyle=dl(e,c,n,t);n&&hl(c,t);let m=!1;if(t.isEnable("copyScrollbar")){let g=[l.get("overflow-x")?.[0],l.get("overflow-y")?.[0]];m=g.includes("scroll")||(g.includes("auto")||g.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let p=l.get("text-transform")?.[0],f=Sr(l.get("font-family")?.[0]),E=f?g=>{p==="uppercase"?g=g.toUpperCase():p==="lowercase"?g=g.toLowerCase():p==="capitalize"&&(g=g[0].toUpperCase()+g.substring(1)),f.forEach(h=>{let x=a.get(h);x||a.set(h,x=new Set),g.split("").forEach(b=>x.add(b))})}:void 0;return bl(e,c,m,t,E),ml(e,c),dt(e)||await rr(e,c,t,E),await s?.(c),c}let u=e.cloneNode(!1);return await rr(e,u,t),await s?.(u),u}function Rr(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn("Failed to destroyContext",t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function vl(e){let{url:t,timeout:n,responseType:o,...r}=e,i=new AbortController,a=n?setTimeout(()=>i.abort(),n):void 0;return fetch(t,{signal:i.signal,...r}).then(s=>{if(!s.ok)throw new Error("Failed fetch, not 2xx response",{cause:s});switch(o){case"arrayBuffer":return s.arrayBuffer();case"dataUrl":return s.blob().then(Zs);default:return s.text()}}).finally(()=>clearTimeout(a))}function Ke(e,t){let{url:n,requestType:o="text",responseType:r="text",imageDom:i}=t,a=n,{timeout:s,acceptOfImage:u,requests:c,fetchFn:l,fetch:{requestInit:m,bypassingCache:p,placeholderImage:f},font:E,workers:g,fontFamilies:h}=e;o==="image"&&(ut||ln)&&e.drawImageCount++;let x=c.get(n);if(!x){p&&p instanceof RegExp&&p.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());let b=o.startsWith("font")&&E&&E.minify,v=new Set;b&&o.split(";")[1].split(",").forEach(I=>{h.has(I)&&h.get(I).forEach(j=>v.add(j))});let y=b&&v.size,T={url:a,timeout:s,responseType:y?"arrayBuffer":r,headers:o==="image"?{accept:u}:void 0,...m};x={type:o,resolve:void 0,reject:void 0,response:null},x.response=(async()=>{if(l&&o==="image"){let S=await l(n);if(S)return S}return!ut&&n.startsWith("http")&&g.length?new Promise((S,I)=>{g[c.size&g.length-1].postMessage({rawUrl:n,...T}),x.resolve=S,x.reject=I}):vl(T)})().catch(S=>{if(c.delete(n),o==="image"&&f)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof f=="string"?f:f(i);throw S}),c.set(n,x)}return x.response}async function Ir(e,t,n,o){if(!Nr(e))return e;for(let[r,i]of El(e,t))try{let a=await Ke(n,{url:i,requestType:o?"image":"text",responseType:"dataUrl"});e=e.replace(xl(r),`$1${a}$3`)}catch(a){n.log.warn("Failed to fetch css data url",r,a)}return e}function Nr(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}function El(e,t){let n=[];return e.replace(Lr,(o,r,i)=>(n.push([i,hr(i,t)]),o)),n.filter(([o])=>!rn(o))}function xl(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Sl(e,t){return wl.map(n=>{let o=e.getPropertyValue(n);return!o||o==="none"?null:((ut||ln)&&t.drawImageCount++,Ir(o,null,t,!0).then(r=>{!r||o===r||e.setProperty(n,r,e.getPropertyPriority(n))}))}).filter(Boolean)}function Cl(e,t){if(Ne(e)){let n=e.currentSrc||e.src;if(!rn(n))return[Ke(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.srcset="",e.dataset.originalSrc=n,e.src=o||"")})];(ut||ln)&&t.drawImageCount++}else if(je(e)&&!rn(e.href.baseVal)){let n=e.href.baseVal;return[Ke(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.dataset.originalSrc=n,e.href.baseVal=o||"")})]}return[]}function Tl(e,t){let{ownerDocument:n,svgDefsElement:o}=t,r=e.getAttribute("href")??e.getAttribute("xlink:href");if(!r)return[];let[i,a]=r.split("#");if(a){let s=`#${a}`,u=t.shadowRoots.reduce((c,l)=>c??l.querySelector(`svg ${s}`),n?.querySelector(`svg ${s}`));if(i&&e.setAttribute("href",s),o?.querySelector(s))return[];if(u)return o?.appendChild(u.cloneNode(!0)),[];if(i)return[Ke(t,{url:i,responseType:"text"}).then(c=>{o?.insertAdjacentHTML("beforeend",c)})]}return[]}function $r(e,t){let{tasks:n}=t;J(e)&&((Ne(e)||gr(e))&&n.push(...Cl(e,t)),Ds(e)&&n.push(...Tl(e,t))),ze(e)&&n.push(...Sl(e.style,t)),e.childNodes.forEach(o=>{$r(o,t)})}async function kl(e,t){let{ownerDocument:n,svgStyleElement:o,fontFamilies:r,fontCssTexts:i,tasks:a,font:s}=t;if(!(!n||!o||!r.size))if(s&&s.cssText){let u=ar(s.cssText,t);o.appendChild(n.createTextNode(`${u}
|
|
8
|
+
`))}else{let u=Array.from(n.styleSheets).filter(f=>{try{return"cssRules"in f&&!!f.cssRules.length}catch(E){return t.log.warn(`Error while reading CSS rules from ${f.href}`,E),!1}}),c=n.implementation.createHTMLDocument(""),l=c.createElement("style");c.head.appendChild(l);let m=l.sheet;await Promise.all(u.flatMap(f=>Array.from(f.cssRules).map(async E=>{if(Ps(E)){let g=E.href,h="";try{h=await Ke(t,{url:g,requestType:"text",responseType:"text"})}catch(b){t.log.warn(`Error fetch remote css import from ${g}`,b)}let x=h.replace(Lr,(b,v,y)=>b.replace(y,hr(y,g)));for(let b of _l(x))try{m.insertRule(b,m.cssRules.length)}catch(v){t.log.warn("Error inserting rule from remote css import",{rule:b,error:v})}}}))),m.cssRules.length&&u.push(m);let p=[];u.forEach(f=>{an(f.cssRules,p)}),p.filter(f=>$s(f)&&Nr(f.style.getPropertyValue("src"))&&Sr(f.style.getPropertyValue("font-family"))?.some(E=>r.has(E))).forEach(f=>{let E=f,g=i.get(E.cssText);g?o.appendChild(n.createTextNode(`${g}
|
|
9
|
+
`)):a.push(Ir(E.cssText,E.parentStyleSheet?E.parentStyleSheet.href:null,t).then(h=>{h=ar(h,t),i.set(E.cssText,h),o.appendChild(n.createTextNode(`${h}
|
|
10
|
+
`))}))})}}function _l(e){if(e==null)return[];let t=[],n=e.replace(Al,"");for(;;){let i=ir.exec(n);if(!i)break;t.push(i[0])}n=n.replace(ir,"");let o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,r=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let i=o.exec(n);if(i)r.lastIndex=o.lastIndex;else if(i=r.exec(n),i)o.lastIndex=r.lastIndex;else break;t.push(i[0])}return t}function ar(e,t){let{font:n}=t,o=n?n?.preferredFormat:void 0;return o?e.replace(Il,r=>{for(;;){let[i,,a]=Rl.exec(r)||[];if(!a)return"";if(a===o)return`src: ${i};`}}):e}function an(e,t=[]){for(let n of Array.from(e))Ms(n)?t.push(...an(n.cssRules)):"cssRules"in n?an(n.cssRules,t):t.push(n);return t}function Ll(e){return Nl.test(e.innerHTML)}async function Pr(e,t){let n=await Q(e,t);if(J(n.node)&&je(n.node)&&!Ll(n.node))return n.node;let{ownerDocument:o,log:r,tasks:i,svgStyleElement:a,svgDefsElement:s,svgStyles:u,font:c,progress:l,autoDestruct:m,onCloneNode:p,onEmbedNode:f,onCreateForeignObjectSvg:E}=n;r.time("clone node");let g=await cn(n.node,n,!0);if(a&&o){let y="";u.forEach((T,S)=>{y+=`${T.join(`,
|
|
11
11
|
`)} {
|
|
12
12
|
${S}
|
|
13
13
|
}
|
|
14
|
-
`}),i.appendChild(o.createTextNode(y))}r.timeEnd("clone node"),await f?.(b),l!==!1&&q(b)&&(r.time("embed web font"),await dl(b,n),r.timeEnd("embed web font")),r.time("embed node"),Sr(b,n);let E=a.length,w=0,h=async()=>{for(;;){let y=a.pop();if(!y)break;try{await y}catch(T){n.log.warn("Failed to run task",T)}c?.(++w,E)}};c?.(w,E),await Promise.all([...Array.from({length:4})].map(h)),r.timeEnd("embed node"),await p?.(b);let v=yl(b,n);return s&&v.insertBefore(s,v.children[0]),i&&v.insertBefore(i,v.children[0]),m&&vr(n),await g?.(v),v}function yl(e,t){let{width:n,height:o}=t,r=lr(n,o,e.ownerDocument),a=r.ownerDocument.createElementNS(r.namespaceURI,"foreignObject");return a.setAttributeNS(null,"x","0%"),a.setAttributeNS(null,"y","0%"),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.append(e),r.appendChild(a),r}async function ut(e,t){let n=await Z(e,t),o=await Cr(n),r=cr(o,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=br(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(ct,"defs"),n.svgStyles.clear());let a=Se(r,o.ownerDocument);return await Bs(a,n)}async function vl(e,t){let n=await Z(e,t),{log:o,type:r,quality:a,dpi:i}=n,s=await ut(n);o.time("canvas to blob");let u=await Ps(s,r,a);if(["image/png","image/jpeg"].includes(r)&&i){let l=await Os(u.slice(0,33)),c=new Uint8Array(l);return r==="image/png"?c=nr(c,i):r==="image/jpeg"&&(c=Zo(c,i)),o.timeEnd("canvas to blob"),new Blob([c,u.slice(33)],{type:r})}return o.timeEnd("canvas to blob"),u}async function Ne(e,t){let n=await Z(e,t),{log:o,quality:r,type:a,dpi:i}=n,s=await ut(n);o.time("canvas to data url");let u=s.toDataURL(a,r);if(["image/png","image/jpeg"].includes(a)&&i&&rr&&gs){let[l,c]=u.split(","),m=0,f=!1;if(a==="image/png"){let v=ps(c);v>=0?(m=Math.ceil((v+28)/3)*4,f=!0):m=33/3*4}else a==="image/jpeg"&&(m=18/3*4);let p=c.substring(0,m),g=c.substring(m),b=window.atob(p),E=new Uint8Array(b.length);for(let v=0;v<E.length;v++)E[v]=b.charCodeAt(v);let w=a==="image/png"?nr(E,i,f):Zo(E,i),h=window.btoa(String.fromCharCode(...w));u=[l,",",h,g].join("")}return o.timeEnd("canvas to data url"),u}async function Tr(e,t){let n=await Z(e,t),{width:o,height:r,ownerDocument:a}=n,i=await Ne(n),s=lr(o,r,a),u=s.ownerDocument.createElementNS(s.namespaceURI,"image");return u.setAttributeNS(null,"href",i),u.setAttributeNS(null,"height","100%"),u.setAttributeNS(null,"width","100%"),s.appendChild(u),cr(s,n.isEnable("removeControlCharacter"))}async function El(e,t){let n=await Z(e,t),{ownerDocument:o,width:r,height:a,scale:i,type:s}=n,u=s==="image/svg+xml"?await Tr(n):await Ne(n),l=Se(u,o);return l.width=Math.floor(r*i),l.height=Math.floor(a*i),l.style.width=`${r}px`,l.style.height=`${a}px`,l}async function wl(e,t){return Ne(await Z(e,{...t,type:"image/jpeg"}))}async function xl(e,t){let n=await Z(e,t),o=await ut(n);return o.getContext("2d").getImageData(0,0,o.width,o.height).data}async function Sl(e,t){return Ne(await Z(e,{...t,type:"image/png"}))}async function Cl(e,t){return Ne(await Z(e,{...t,type:"image/webp"}))}var Jo,Qo,er,tr,Qt,ds,ms,fs,or,fe,bs,rr,gs,nn,ar,it,on,hs,ys,vs,Es,q,ze,ir,ws,Ge,xs,Ss,Re,st,Cs,Ts,ks,As,_s,Rs,Is,Ns,$s,en,ct,Ds,Os,mr,jo,Ys,Xs,Js,Qs,Ko,ol,xr,sl,ml,Xo,pl,bl,gl,Ar=ba(()=>{"use strict";Jo=112,Qo=72,er=89,tr=115;ds="AAlwSFlz",ms="AAAJcEhZ",fs="AAAACXBI";or="[modern-screenshot]",fe=typeof window<"u",bs=fe&&"Worker"in window,rr=fe&&"atob"in window,gs=fe&&"btoa"in window,nn=fe?window.navigator?.userAgent:"",ar=nn.includes("Chrome"),it=nn.includes("AppleWebKit")&&!ar,on=nn.includes("Firefox"),hs=e=>e&&"__CONTEXT__"in e,ys=e=>e.constructor.name==="CSSFontFaceRule",vs=e=>e.constructor.name==="CSSImportRule",Es=e=>e.constructor.name==="CSSLayerBlockRule",q=e=>e.nodeType===1,ze=e=>typeof e.className=="object",ir=e=>e.tagName==="image",ws=e=>e.tagName==="use",Ge=e=>q(e)&&typeof e.style<"u"&&!ze(e),xs=e=>e.nodeType===8,Ss=e=>e.nodeType===3,Re=e=>e.tagName==="IMG",st=e=>e.tagName==="VIDEO",Cs=e=>e.tagName==="CANVAS",Ts=e=>e.tagName==="TEXTAREA",ks=e=>e.tagName==="INPUT",As=e=>e.tagName==="STYLE",_s=e=>e.tagName==="SCRIPT",Rs=e=>e.tagName==="SELECT",Is=e=>e.tagName==="SLOT",Ns=e=>e.tagName==="IFRAME",$s=(...e)=>console.warn(or,...e);en=e=>e.startsWith("data:");ct="http://www.w3.org/2000/svg";Ds=e=>ur(e,"dataUrl"),Os=e=>ur(e,"arrayBuffer");mr=(function(){let t=0,n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();jo=0;Ys=["width","height","-webkit-text-fill-color"],Xs=["stroke","fill"];Js=["::before","::after"],Qs=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];Ko=new Set(["symbol"]);ol=/^[\w-:]+$/;xr=/url\((['"]?)([^'"]+?)\1\)/g;sl=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];ml=/(\/\*[\s\S]*?\*\/)/g,Xo=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;pl=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,bl=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;gl=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i});function xn(e){let t=new Set,n={active:!1,frozen:!1,hoveredElement:null,options:e,toolbar:{visible:e.showToolbar,themeMode:e.themeMode,comments:[]}},o=new Proxy(n,{set(r,a,i){let s=a;return r[s]===i||(Reflect.set(r,s,i),t.forEach(u=>u(o,s))),!0}});return{state:o,subscribe(r){return t.add(r),()=>t.delete(r)}}}var Sn="72px",ie="68px";var vt="grabby-root",Q=null,ye=null,yt,ee=new Map;function ha(e){try{return"adoptedStyleSheets"in e&&typeof CSSStyleSheet=="function"&&typeof CSSStyleSheet.prototype.replaceSync=="function"}catch{return!1}}function Cn(e){yt=e}function N(){if(ye&&Q?.isConnected)return ye;Q=document.createElement(vt),Q.setAttribute("data-grabby-ignore",""),ye=Q.attachShadow({mode:"open"}),document.documentElement.appendChild(Q);for(let[e,t]of Array.from(ee))t.target==="shadow"&&(ee.delete(e),_(e,t.css));return ye}function _(e,t,n="shadow"){let o=ee.get(e);if(o){o.css=t,o.sheet&&o.sheet.replaceSync(t),o.el&&(o.el.textContent=t);return}let r=n==="shadow"?N():document;if(ha(r)){let i=new CSSStyleSheet;i.replaceSync(t),r.adoptedStyleSheets=[...r.adoptedStyleSheets,i],ee.set(e,{target:n,css:t,sheet:i});return}let a=document.createElement("style");a.setAttribute("data-grabby-style",e),yt&&(a.nonce=yt),a.textContent=t,n==="shadow"?N().prepend(a):document.head.appendChild(a),ee.set(e,{target:n,css:t,el:a})}function U(e){return ee.has(e)}function R(e){let t=ee.get(e);if(t&&(ee.delete(e),t.el&&t.el.remove(),t.sheet)){let n=t.target==="shadow"?ye:document;n&&(n.adoptedStyleSheets=n.adoptedStyleSheets.filter(o=>o!==t.sheet))}}function Tn(e){return!e||!Q?!1:e===Q?!0:e.getRootNode()===ye}function se(e){let n=(typeof e.composedPath=="function"?e.composedPath():[])[0]??e.target;return n instanceof Element?n:null}function Et(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}function ve(e){if(!e)return!1;let t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable===!0}function kn(){for(let e of Array.from(ee.keys()))R(e);Q?.remove(),Q=null,ye=null}var wt="__grabby-overlay__",xt="__grabby-label__",St="__grabby-styles__",Ea=3;function An(){let e=null,t=null,n=null,o=null,r=null,a=null,i=[];function s(){U(St)||_(St,`
|
|
15
|
-
#${
|
|
14
|
+
`}),a.appendChild(o.createTextNode(y))}r.timeEnd("clone node"),await p?.(g),c!==!1&&J(g)&&(r.time("embed web font"),await kl(g,n),r.timeEnd("embed web font")),r.time("embed node"),$r(g,n);let h=i.length,x=0,b=async()=>{for(;;){let y=i.pop();if(!y)break;try{await y}catch(T){n.log.warn("Failed to run task",T)}l?.(++x,h)}};l?.(x,h),await Promise.all([...Array.from({length:4})].map(b)),r.timeEnd("embed node"),await f?.(g);let v=$l(g,n);return s&&v.insertBefore(s,v.children[0]),a&&v.insertBefore(a,v.children[0]),m&&Rr(n),await E?.(v),v}function $l(e,t){let{width:n,height:o}=t,r=yr(n,o,e.ownerDocument),i=r.ownerDocument.createElementNS(r.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(e),r.appendChild(i),r}async function pt(e,t){let n=await Q(e,t),o=await Pr(n),r=vr(o,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=Tr(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(ft,"defs"),n.svgStyles.clear());let i=Se(r,o.ownerDocument);return await nl(i,n)}async function Pl(e,t){let n=await Q(e,t),{log:o,type:r,quality:i,dpi:a}=n,s=await pt(n);o.time("canvas to blob");let u=await Xs(s,r,i);if(["image/png","image/jpeg"].includes(r)&&a){let c=await Js(u.slice(0,33)),l=new Uint8Array(c);return r==="image/png"?l=mr(l,a):r==="image/jpeg"&&(l=sr(l,a)),o.timeEnd("canvas to blob"),new Blob([l,u.slice(33)],{type:r})}return o.timeEnd("canvas to blob"),u}async function $e(e,t){let n=await Q(e,t),{log:o,quality:r,type:i,dpi:a}=n,s=await pt(n);o.time("canvas to data url");let u=s.toDataURL(i,r);if(["image/png","image/jpeg"].includes(i)&&a&&pr&&Ns){let[c,l]=u.split(","),m=0,p=!1;if(i==="image/png"){let v=Rs(l);v>=0?(m=Math.ceil((v+28)/3)*4,p=!0):m=33/3*4}else i==="image/jpeg"&&(m=18/3*4);let f=l.substring(0,m),E=l.substring(m),g=window.atob(f),h=new Uint8Array(g.length);for(let v=0;v<h.length;v++)h[v]=g.charCodeAt(v);let x=i==="image/png"?mr(h,a,p):sr(h,a),b=window.btoa(String.fromCharCode(...x));u=[c,",",b,E].join("")}return o.timeEnd("canvas to data url"),u}async function Mr(e,t){let n=await Q(e,t),{width:o,height:r,ownerDocument:i}=n,a=await $e(n),s=yr(o,r,i),u=s.ownerDocument.createElementNS(s.namespaceURI,"image");return u.setAttributeNS(null,"href",a),u.setAttributeNS(null,"height","100%"),u.setAttributeNS(null,"width","100%"),s.appendChild(u),vr(s,n.isEnable("removeControlCharacter"))}async function Ml(e,t){let n=await Q(e,t),{ownerDocument:o,width:r,height:i,scale:a,type:s}=n,u=s==="image/svg+xml"?await Mr(n):await $e(n),c=Se(u,o);return c.width=Math.floor(r*a),c.height=Math.floor(i*a),c.style.width=`${r}px`,c.style.height=`${i}px`,c}async function Dl(e,t){return $e(await Q(e,{...t,type:"image/jpeg"}))}async function Ol(e,t){let n=await Q(e,t),o=await pt(n);return o.getContext("2d").getImageData(0,0,o.width,o.height).data}async function Fl(e,t){return $e(await Q(e,{...t,type:"image/png"}))}async function Hl(e,t){return $e(await Q(e,{...t,type:"image/webp"}))}var lr,cr,ur,dr,on,ks,As,_s,fr,pe,Is,pr,Ns,sn,br,ut,ln,Ls,$s,Ps,Ms,J,je,gr,Ds,ze,Os,Fs,Ne,dt,Hs,Us,Bs,Gs,Vs,zs,Ks,js,Ws,rn,ft,Zs,Js,wr,tr,cl,ul,fl,pl,nr,yl,Lr,wl,Al,ir,Rl,Il,Nl,Or=Ti(()=>{"use strict";lr=112,cr=72,ur=89,dr=115;ks="AAlwSFlz",As="AAAJcEhZ",_s="AAAACXBI";fr="[modern-screenshot]",pe=typeof window<"u",Is=pe&&"Worker"in window,pr=pe&&"atob"in window,Ns=pe&&"btoa"in window,sn=pe?window.navigator?.userAgent:"",br=sn.includes("Chrome"),ut=sn.includes("AppleWebKit")&&!br,ln=sn.includes("Firefox"),Ls=e=>e&&"__CONTEXT__"in e,$s=e=>e.constructor.name==="CSSFontFaceRule",Ps=e=>e.constructor.name==="CSSImportRule",Ms=e=>e.constructor.name==="CSSLayerBlockRule",J=e=>e.nodeType===1,je=e=>typeof e.className=="object",gr=e=>e.tagName==="image",Ds=e=>e.tagName==="use",ze=e=>J(e)&&typeof e.style<"u"&&!je(e),Os=e=>e.nodeType===8,Fs=e=>e.nodeType===3,Ne=e=>e.tagName==="IMG",dt=e=>e.tagName==="VIDEO",Hs=e=>e.tagName==="CANVAS",Us=e=>e.tagName==="TEXTAREA",Bs=e=>e.tagName==="INPUT",Gs=e=>e.tagName==="STYLE",Vs=e=>e.tagName==="SCRIPT",zs=e=>e.tagName==="SELECT",Ks=e=>e.tagName==="SLOT",js=e=>e.tagName==="IFRAME",Ws=(...e)=>console.warn(fr,...e);rn=e=>e.startsWith("data:");ft="http://www.w3.org/2000/svg";Zs=e=>Er(e,"dataUrl"),Js=e=>Er(e,"arrayBuffer");wr=(function(){let t=0,n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();tr=0;cl=["width","height","-webkit-text-fill-color"],ul=["stroke","fill"];fl=["::before","::after"],pl=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];nr=new Set(["symbol"]);yl=/^[\w-:]+$/;Lr=/url\((['"]?)([^'"]+?)\1\)/g;wl=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];Al=/(\/\*[\s\S]*?\*\/)/g,ir=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;Rl=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Il=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;Nl=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i});function _n(e){let t=new Set,n={active:!1,frozen:!1,hoveredElement:null,options:e,toolbar:{visible:e.showToolbar,themeMode:e.themeMode,comments:[]}},o=new Proxy(n,{set(r,i,a){let s=i;return r[s]===a||(Reflect.set(r,s,a),t.forEach(u=>u(o,s))),!0}});return{state:o,subscribe(r){return t.add(r),()=>t.delete(r)}}}var Rn="72px",se="68px";var Ct="grabby-root",te=null,ye=null,St,ne=new Map;function Ai(e){try{return"adoptedStyleSheets"in e&&typeof CSSStyleSheet=="function"&&typeof CSSStyleSheet.prototype.replaceSync=="function"}catch{return!1}}function In(e){St=e}function N(){if(ye&&te?.isConnected)return ye;te=document.createElement(Ct),te.setAttribute("data-grabby-ignore",""),ye=te.attachShadow({mode:"open"}),document.documentElement.appendChild(te);for(let[e,t]of Array.from(ne))t.target==="shadow"&&(ne.delete(e),_(e,t.css));return ye}function _(e,t,n="shadow"){let o=ne.get(e);if(o){o.css=t,o.sheet&&o.sheet.replaceSync(t),o.el&&(o.el.textContent=t);return}let r=n==="shadow"?N():document;if(Ai(r)){let a=new CSSStyleSheet;a.replaceSync(t),r.adoptedStyleSheets=[...r.adoptedStyleSheets,a],ne.set(e,{target:n,css:t,sheet:a});return}let i=document.createElement("style");i.setAttribute("data-grabby-style",e),St&&(i.nonce=St),i.textContent=t,n==="shadow"?N().prepend(i):document.head.appendChild(i),ne.set(e,{target:n,css:t,el:i})}function G(e){return ne.has(e)}function R(e){let t=ne.get(e);if(t&&(ne.delete(e),t.el&&t.el.remove(),t.sheet)){let n=t.target==="shadow"?ye:document;n&&(n.adoptedStyleSheets=n.adoptedStyleSheets.filter(o=>o!==t.sheet))}}function Nn(e){return!e||!te?!1:e===te?!0:e.getRootNode()===ye}function le(e){let n=(typeof e.composedPath=="function"?e.composedPath():[])[0]??e.target;return n instanceof Element?n:null}function Tt(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}function ve(e){if(!e)return!1;let t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable===!0}function Ln(){for(let e of Array.from(ne.keys()))R(e);te?.remove(),te=null,ye=null}var _i=new Set(["BUTTON","A","SUMMARY"]),Ri=new Set(["button","link","tab","menuitem","menuitemcheckbox","menuitemradio","switch","option","checkbox","radio"]),Pn=new Set(["button","submit","reset","image"]),Ii=new Set(["INPUT","SELECT","TEXTAREA"]),Ni=new Set(["textbox","combobox","searchbox","spinbutton","slider"]),Li=new Set(["IMG","SVG","VIDEO","PICTURE","CANVAS","IFRAME","AUDIO"]),$i=new Set(["H1","H2","H3","H4","H5","H6","P","SPAN","LABEL","LI","STRONG","EM","B","I","SMALL","BLOCKQUOTE","CODE","PRE","TD","TH","DT","DD","FIGCAPTION","LEGEND","CAPTION","Q","CITE","MARK","TIME"]),Mn=new Set(["HTML","BODY","MAIN"]),Pi=new Set(["HEADER","FOOTER","NAV","ASIDE"]),Mi=.6;function tt(e){return(e.getAttribute("role")??"").toLowerCase()}function kt(e){return _i.has(e.tagName)?e.tagName!=="A"||e.hasAttribute("href")||e.hasAttribute("role"):e.tagName==="INPUT"&&Pn.has(e.type)?!0:Ri.has(tt(e))}function At(e){return e.tagName==="INPUT"?!Pn.has(e.type):Ii.has(e.tagName)||e.isContentEditable&&e.getAttribute("contenteditable")!==null?!0:Ni.has(tt(e))}function $n(e){let t=e.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;if(!n||!o)return!1;let r=Math.max(0,Math.min(t.right,n)-Math.max(t.left,0)),i=Math.max(0,Math.min(t.bottom,o)-Math.max(t.top,0));return r*i/(n*o)>=Mi}function Di(e){return e.children.length>0}function nt(e){return Mn.has(e.tagName)?"section":Li.has(e.tagName)?"media":At(e)?"field":kt(e)?"action":Pi.has(e.tagName)||tt(e)==="main"||tt(e)==="region"?$n(e)?"section":"container":$i.has(e.tagName)||!Di(e)&&(e.textContent??"").trim()?"text":$n(e)?"section":"container"}var Oi=3;function Dn(e){if(kt(e)||At(e))return e;let t=e.parentElement;for(let n=0;t&&n<Oi;n++){if(kt(t)||At(t))return t;if(Mn.has(t.tagName))break;t=t.parentElement}return e}var Fi=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,Hi=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g,Ui=/\b(Bearer|Basic|Token)\s+[A-Za-z0-9._~+/=-]{8,}/gi,Bi=/\b\d(?:[ -]?\d){8,}\b/g,Gi=/\b[A-Za-z0-9_-]{32,}\b/g,Vi=/([?&#](?:access_token|id_token|token|key|api_key|apikey|secret|password|pass|auth|code|session|sig|signature)=)[^&#\s]*/gi;function $(e,t={}){if(!e)return e;let n=e.replace(Vi,"$1[redacted]").replace(Hi,"[token]").replace(Ui,"$1 [token]");return(t.keepEmails?n:n.replace(Fi,"[email]")).replace(Bi,"[number]").replace(Gi,o=>/\d/.test(o)&&/[A-Za-z]/.test(o)?"[token]":o)}function On(e,t=[]){let n=e.pathname||"/";if(t.length>0&&e.search){let o=new URLSearchParams(e.search),r=new URLSearchParams;for(let a of t){let s=o.get(a);s!==null&&r.set(a,s)}let i=r.toString();i&&(n+=`?${i}`)}return e.hash.startsWith("#/")&&(n+=e.hash.split("?")[0]),$(n)}function Pe(e,t=typeof location<"u"?location.href:"http://localhost/"){try{let n=new URL(e,t);if(n.protocol==="javascript:"||n.protocol==="data:"||n.protocol==="vbscript:")return`${n.protocol}\u2026`;let o=new URL(t),r=n.pathname+(n.hash.startsWith("#/")?n.hash:"");return $(n.origin===o.origin?r:`${n.host}${r}`)}catch{return $(e.split(/[?#]/)[0])}}var ot="data-grabby-mask",oe="data-grabby-ignore",zi=["id","class","role","aria-label","data-testid","data-test","data-cy","name","type","href","src","alt","placeholder","title","for","aria-expanded","aria-selected","disabled"],Ki=new Set(["href","src"]),ji=8,Wi=60,Yi=80,Xi=80,Fn=300;function qi(e){return e.startsWith("_ng")||e.startsWith("ng-reflect-")||e.startsWith("data-v-")||e.startsWith("data-grabby-")||e.startsWith("data-svelte")||e==="style"||e==="value"||e.startsWith("on")}function Me(e){return e.startsWith("ng-")||e.startsWith("_ng")||/^svelte-[a-z0-9]+$/i.test(e)||/^s-[A-Za-z0-9_-]{8,}$/.test(e)}function X(e,t){return e.length<=t?e:`${e.slice(0,t-1).trimEnd()}\u2026`}function Re(e){return e.closest(`[${ot}]`)!==null}function V(e,t){if(Re(e))return"[masked]";let n="",o=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let r=o.nextNode();r;r=o.nextNode()){let i=r.parentElement;if(!(i&&/^(SCRIPT|STYLE|NOSCRIPT|TEMPLATE)$/.test(i.tagName))&&!i?.closest(`[${oe}], [${ot}]`)&&(n+=` ${r.nodeValue??""}`,n.length>t*3))break}return X($(n.replace(/\s+/g," ").trim()),t)}function Hn(e){let t="";for(let n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE&&(t+=` ${n.nodeValue??""}`);return t.replace(/\s+/g," ").trim()}function Zi(e,t,n,o){if(t==="class"){let r=o(n.split(/\s+/).filter(Boolean));return r.length===0?null:X(r.join(" "),Wi)}return Ki.has(t)?X(Pe(n),120):X($(n,{keepEmails:t==="placeholder"}),Yi)}function Ji(e,t=n=>n.filter(o=>!Me(o))){let n=e.tagName.toLowerCase(),o=[],r=new Set,i=a=>{if(o.length>=ji||r.has(a)||qi(a))return;let s=e.getAttribute(a);if(s===null)return;if(r.add(a),s===""){o.push(a);return}let u=Zi(e,a,s,t);u!==null&&o.push(`${a}="${u.replace(/"/g,""")}"`)};for(let a of zi)i(a);for(let{name:a}of Array.from(e.attributes))a.startsWith("aria-")&&i(a);return`<${n}${o.length?` ${o.join(" ")}`:""}>`}function Un(e,t){let n=e.tagName.toLowerCase(),o=Ji(e,t);if(/^(img|input|br|hr|meta|link|source|area|col|embed|wbr)$/.test(n))return X(o,Fn);let r=Array.from(e.children).filter(a=>!a.hasAttribute(oe)),i;if(Re(e))i="[masked]";else if(r.length===0)i=X($(Hn(e)),Xi);else if(r.length<=2){let a=X($(Hn(e)),40),s=r.map(u=>{let c=V(u,30);return`<${u.tagName.toLowerCase()}${c?`>${c}</${u.tagName.toLowerCase()}>`:" \u2026>"}`});i=[a,...s].filter(Boolean).join(" ")}else i=`(${r.length} elements)`;return X(`${o}${i}</${n}>`,Fn)}var De=40,Qi=/^h[1-6]$/;function ea(e){return(e.getAttribute("role")??"").toLowerCase()}function ta(e){try{let t=getComputedStyle(e),n=t.borderStyle!=="none"&&parseFloat(t.borderWidth)>0;return!!t.boxShadow&&t.boxShadow!=="none"||n&&parseFloat(t.borderRadius)>0}catch{return!1}}function Bn(e,t,n="",o="",r=!1,i=!1){switch(t){case"action":return n==="tab"?"Tab":n.startsWith("menuitem")?"Menu item":n==="checkbox"||o==="checkbox"?"Checkbox":n==="radio"||n==="option"||o==="radio"?"Option":n==="switch"?"Switch":e==="a"||n==="link"?"Link":"Button";case"field":return e==="select"||n==="combobox"?"Dropdown":e==="textarea"?"Text area":o==="checkbox"?"Checkbox":o==="radio"?"Option":o==="range"||n==="slider"?"Slider":o==="file"?"File upload":o==="search"||n==="searchbox"?"Search box":/^(date|datetime-local|month|week|time)$/.test(o)?"Date picker":"Text box";case"media":return e==="svg"?"Icon":e==="video"?"Video":e==="audio"?"Audio player":e==="iframe"?"Embedded content":e==="canvas"?"Chart or drawing":"Image";case"text":return Qi.test(e)||n==="heading"?"Heading":e==="li"?"List item":e==="label"?"Label":e==="td"||e==="th"?"Table cell":e==="blockquote"||e==="q"?"Quote":e==="code"||e==="pre"?"Code":"Text";case"section":return e==="html"||e==="body"?"Whole page":e==="main"||n==="main"?"Main content":e==="header"?"Page header":e==="footer"?"Page footer":e==="nav"?"Navigation menu":"Page section";default:return e==="nav"||n==="navigation"||n==="menu"||n==="menubar"?"Menu":e==="header"?"Header":e==="footer"?"Footer":e==="aside"?"Sidebar":e==="form"||n==="form"?"Form":e==="table"||n==="table"||n==="grid"?"Table":e==="ul"||e==="ol"||n==="list"?"List":e==="dialog"||n==="dialog"||n==="alertdialog"?"Pop-up":r?"Card":i?"Section":"Area"}}function na(e){let t=e.labels;return t&&t.length?V(t[0],De):$(e.getAttribute("aria-label")??"")||$(e.getAttribute("placeholder")??"")}function Gn(e){return e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]')}function oa(e,t){if(Re(e)||e.tagName==="BODY"||e.tagName==="HTML")return"";let n=$(e.getAttribute("aria-label")??"");switch(t){case"action":return n||V(e,De)||$(e.getAttribute("title")??"")||$(e.querySelector("img[alt]")?.getAttribute("alt")??"");case"field":return na(e);case"media":return $(e.getAttribute("alt")??"")||n||$(e.getAttribute("title")??"");case"text":return V(e,De);default:{let o=Gn(e);return n||(o?V(o,De):"")}}}function Vn(e,t){let n=X(t.replace(/\s+/g," ").trim(),De);return n?`${e} \u201C${n}\u201D`:e}function zn(e){let t=e.tagName.toLowerCase(),n=t==="svg"?"media":nt(e),o=ea(e),r=t==="input"?(e.type||"").toLowerCase():"",i=n==="container",a=Bn(t,n,o,r,i&&ta(e),i&&!!Gn(e));return Vn(a,oa(e,n))}function Kn(e){let t=e.facts??{},n=Bn(e.tag,e.kind,"",(t.type??"").toLowerCase(),!1,!!t.heading),o=t.label||t.heading||t.text||t.alt||"";return Vn(n,o)}var _t="__grabby-overlay__",rt="__grabby-label__",Rt="__grabby-styles__",aa=3;function jn(e={}){let t=null,n=null,o=null,r=null,i=null,a=null,s=[],u="";function c(){G(Rt)||_(Rt,`
|
|
15
|
+
#${_t} {
|
|
16
16
|
position: fixed;
|
|
17
17
|
pointer-events: none;
|
|
18
18
|
z-index: ${2147483646};
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
transition: top 0.05s ease, left 0.05s ease, width 0.05s ease, height 0.05s ease;
|
|
22
22
|
box-sizing: border-box;
|
|
23
23
|
}
|
|
24
|
-
#${
|
|
24
|
+
#${rt} {
|
|
25
25
|
position: fixed;
|
|
26
26
|
pointer-events: none;
|
|
27
27
|
z-index: ${2147483647};
|
|
@@ -36,7 +36,12 @@
|
|
|
36
36
|
overflow: hidden;
|
|
37
37
|
text-overflow: ellipsis;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
#${rt}.grabby-plain {
|
|
40
|
+
font: 600 12px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
41
|
+
padding: 3px 8px;
|
|
42
|
+
border-radius: 6px;
|
|
43
|
+
}
|
|
44
|
+
`)}function l(){t||(c(),t=document.createElement("div"),t.id=_t,N().appendChild(t)),n||(n=document.createElement("div"),n.id=rt,e.plainLabels&&(n.className="grabby-plain"),N().appendChild(n))}function m(){if(!r||!t||!n)return;let g=r.getBoundingClientRect();if(g.width===0&&g.height===0&&!r.isConnected){t.style.display="none",n.style.display="none";return}t.style.top=`${g.top}px`,t.style.left=`${g.left}px`,t.style.width=`${g.width}px`,t.style.height=`${g.height}px`,t.style.display="block";let x=`<${r.tagName.toLowerCase()}>`;if(e.plainLabels){n.textContent=`${u} \xB7 Click to select`,p(g);return}if(s.length>0){let b=s.slice(0,aa);x+=` .${b.join(".")}${s.length>b.length?"\u2026":""}`}i&&(x+=` in ${i}`),a&&(x+=` \u2014 ${a}`),n.textContent=x,p(g)}function p(g){if(!n)return;let h=20,x=4,b=g.top-h-x;b<0&&(b=g.bottom+x);let v=g.left;n.style.top=`${b}px`,n.style.left=`${v}px`,n.style.display="block";let y=n.getBoundingClientRect(),T=document.documentElement.clientWidth;y.right>T&&(v=Math.max(0,T-y.width),n.style.left=`${v}px`)}function f(){m(),o=requestAnimationFrame(f)}function E(){o!==null&&(cancelAnimationFrame(o),o=null)}return{show(g,h,x,b){l(),r=g,i=h,e.plainLabels&&(u=zn(g)),a=x??null,s=b??[],E(),f()},hide(){E(),r=null,i=null,a=null,s=[],t&&(t.style.display="none"),n&&(n.style.display="none")},isOverlayElement(g){return g===t||g===n||g.id===_t||g.id===rt},dispose(){E(),r=null,i=null,a=null,s=[],t?.remove(),n?.remove(),R(Rt),t=null,n=null}}}var It="__grabby-crosshair-styles__",Wn="__grabby-crosshair-cursor__",Nt="__grabby-crosshair-h__",Lt="__grabby-crosshair-v__";function Yn(){let e=null,t=null,n=!1;function o(){G(It)||(_(It,`
|
|
40
45
|
.grabby-crosshair-line {
|
|
41
46
|
position: fixed;
|
|
42
47
|
pointer-events: none;
|
|
@@ -45,18 +50,18 @@
|
|
|
45
50
|
opacity: 0.25;
|
|
46
51
|
transition: none;
|
|
47
52
|
}
|
|
48
|
-
#${
|
|
53
|
+
#${Nt} {
|
|
49
54
|
left: 0;
|
|
50
55
|
right: 0;
|
|
51
56
|
height: 1px;
|
|
52
57
|
}
|
|
53
|
-
#${
|
|
58
|
+
#${Lt} {
|
|
54
59
|
top: 0;
|
|
55
60
|
bottom: 0;
|
|
56
61
|
width: 1px;
|
|
57
62
|
}
|
|
58
|
-
`),_(
|
|
59
|
-
#${
|
|
63
|
+
`),_(Wn,"body.grabby-crosshair-active { cursor: crosshair !important; }","document"))}function r(){e||(o(),e=document.createElement("div"),e.id=Nt,e.className="grabby-crosshair-line",N().appendChild(e)),t||(t=document.createElement("div"),t.id=Lt,t.className="grabby-crosshair-line",N().appendChild(t))}function i(a){e&&(e.style.top=`${a.clientY}px`),t&&(t.style.left=`${a.clientX}px`)}return{activate(){n||(n=!0,r(),document.body.classList.add("grabby-crosshair-active"),document.addEventListener("mousemove",i,!0))},deactivate(){n&&(n=!1,document.body.classList.remove("grabby-crosshair-active"),document.removeEventListener("mousemove",i,!0),e&&(e.style.top="-10px"),t&&(t.style.left="-10px"))},isCrosshairElement(a){return a===e||a===t||a.id===Nt||a.id===Lt},dispose(){this.deactivate(),e?.remove(),t?.remove(),R(It),R(Wn),e=null,t=null}}}function sa(e,t){for(let n of t)n==null||n===!1||e.appendChild(typeof n=="object"?n:document.createTextNode(String(n)))}function w(e,t,...n){let o=document.createElement(e);if(t)for(let[r,i]of Object.entries(t))i==null||i===!1||(r==="class"?o.className=String(i):r==="style"?Object.assign(o.style,i):r==="dataset"?Object.assign(o.dataset,i):r.startsWith("on")&&typeof i=="function"?o.addEventListener(r.slice(2).toLowerCase(),i):r in o&&typeof i!="string"?o[r]=i:o.setAttribute(r,i===!0?"":String(i)));return sa(o,n),o}var Xn="http://www.w3.org/2000/svg";function ce(e,t){let n=String(e.size??16),o=document.createElementNS(Xn,"svg");o.setAttribute("width",n),o.setAttribute("height",n),o.setAttribute("viewBox",e.viewBox??"0 0 16 16"),o.setAttribute("fill",e.fill??"none"),o.setAttribute("aria-hidden","true"),(e.stroke!==void 0||e.fill===void 0)&&(o.setAttribute("stroke",e.stroke??"currentColor"),o.setAttribute("stroke-width",e.strokeWidth??"1.5"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round")),t&&o.setAttribute("class",t);for(let r of e.shapes){let i=document.createElementNS(Xn,r.tag);for(let[a,s]of Object.entries(r.attrs))i.setAttribute(a,s);o.appendChild(i)}return o}function Oe(...e){return e.map(t=>({tag:"path",attrs:{d:t}}))}var qn={shapes:Oe("M5.5 7V3.5a1 1 0 0 1 2 0V7","M7.5 6.5V2.5a1 1 0 0 1 2 0v4","M9.5 7V3.5a1 1 0 0 1 2 0V8","M5.5 7V5.5a1 1 0 0 0-2 0V9a4 4 0 0 0 4 4h1.5a4 4 0 0 0 4-4V6a1 1 0 0 0-2 0")},Zn={shapes:[{tag:"circle",attrs:{cx:"8",cy:"8",r:"6"}},...Oe("M8 4.5V8l2.5 1.5")]},Jn={shapes:Oe("M8 2v5","M4.5 4a5.5 5.5 0 1 0 7 0")},it={shapes:Oe("M4 4l8 8M12 4l-8 8")},Qn={fill:"none",shapes:[{tag:"circle",attrs:{cx:"8",cy:"8",r:"7",fill:"#22c55e"}},{tag:"path",attrs:{d:"M5 8l2 2 4-4",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}]},eo={viewBox:"0 0 10 10",size:10,fill:"none",shapes:[{tag:"path",attrs:{d:"M2 5.5l2 2 4-4",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}]};var H="__grabby-toast__",Pt="__grabby-toast-styles__",Z=null;function la(){G(Pt)||_(Pt,`
|
|
64
|
+
#${H} {
|
|
60
65
|
position: fixed;
|
|
61
66
|
bottom: var(--grabby-toast-bottom, 24px);
|
|
62
67
|
left: 50%;
|
|
@@ -75,13 +80,13 @@
|
|
|
75
80
|
max-width: 480px;
|
|
76
81
|
min-width: 260px;
|
|
77
82
|
}
|
|
78
|
-
#${
|
|
83
|
+
#${H} .grabby-toast-actions {
|
|
79
84
|
margin-left: auto;
|
|
80
85
|
display: flex;
|
|
81
86
|
gap: 6px;
|
|
82
87
|
padding-left: 12px;
|
|
83
88
|
}
|
|
84
|
-
#${
|
|
89
|
+
#${H} .grabby-toast-action {
|
|
85
90
|
pointer-events: auto;
|
|
86
91
|
font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
87
92
|
padding: 6px 10px;
|
|
@@ -92,40 +97,40 @@
|
|
|
92
97
|
cursor: pointer;
|
|
93
98
|
white-space: nowrap;
|
|
94
99
|
}
|
|
95
|
-
#${
|
|
100
|
+
#${H}:not(.grabby-toast-visible) .grabby-toast-action {
|
|
96
101
|
pointer-events: none;
|
|
97
102
|
}
|
|
98
|
-
#${
|
|
103
|
+
#${H} .grabby-toast-action:hover {
|
|
99
104
|
background: var(--grabby-surface, #f1f5f9);
|
|
100
105
|
}
|
|
101
|
-
#${
|
|
106
|
+
#${H} .grabby-toast-action-primary {
|
|
102
107
|
background: var(--grabby-accent, #2563eb);
|
|
103
108
|
border-color: var(--grabby-accent, #2563eb);
|
|
104
109
|
color: #fff;
|
|
105
110
|
}
|
|
106
|
-
#${
|
|
111
|
+
#${H} .grabby-toast-action-primary:hover {
|
|
107
112
|
background: var(--grabby-accent-hover, #1d4ed8);
|
|
108
113
|
}
|
|
109
|
-
#${
|
|
114
|
+
#${H}.grabby-toast-visible {
|
|
110
115
|
transform: translateX(-50%) translateY(0);
|
|
111
116
|
opacity: 1;
|
|
112
117
|
}
|
|
113
|
-
#${
|
|
118
|
+
#${H} .grabby-toast-header {
|
|
114
119
|
display: flex;
|
|
115
120
|
align-items: center;
|
|
116
121
|
gap: 8px;
|
|
117
122
|
margin-bottom: 0;
|
|
118
123
|
}
|
|
119
|
-
#${
|
|
124
|
+
#${H} .grabby-toast-icon {
|
|
120
125
|
flex-shrink: 0;
|
|
121
126
|
width: 16px;
|
|
122
127
|
height: 16px;
|
|
123
128
|
}
|
|
124
|
-
#${
|
|
129
|
+
#${H} .grabby-toast-title {
|
|
125
130
|
font-weight: 600;
|
|
126
131
|
color: var(--grabby-toast-title, #334155);
|
|
127
132
|
}
|
|
128
|
-
#${
|
|
133
|
+
#${H} .grabby-toast-details {
|
|
129
134
|
margin-top: 8px;
|
|
130
135
|
display: flex;
|
|
131
136
|
flex-direction: column;
|
|
@@ -133,23 +138,23 @@
|
|
|
133
138
|
font-size: 12px;
|
|
134
139
|
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
|
|
135
140
|
}
|
|
136
|
-
#${
|
|
141
|
+
#${H} .grabby-toast-row {
|
|
137
142
|
display: flex;
|
|
138
143
|
gap: 8px;
|
|
139
144
|
align-items: baseline;
|
|
140
145
|
}
|
|
141
|
-
#${
|
|
146
|
+
#${H} .grabby-toast-label {
|
|
142
147
|
color: var(--grabby-toast-label, #64748b);
|
|
143
148
|
flex-shrink: 0;
|
|
144
149
|
min-width: 72px;
|
|
145
150
|
}
|
|
146
|
-
#${
|
|
151
|
+
#${H} .grabby-toast-value {
|
|
147
152
|
color: var(--grabby-toast-text, #334155);
|
|
148
153
|
overflow: hidden;
|
|
149
154
|
text-overflow: ellipsis;
|
|
150
155
|
white-space: nowrap;
|
|
151
156
|
}
|
|
152
|
-
#${
|
|
157
|
+
#${H} .grabby-toast-file-link {
|
|
153
158
|
color: var(--grabby-toast-text, #334155);
|
|
154
159
|
text-decoration: none;
|
|
155
160
|
overflow: hidden;
|
|
@@ -158,11 +163,11 @@
|
|
|
158
163
|
pointer-events: auto;
|
|
159
164
|
cursor: pointer;
|
|
160
165
|
}
|
|
161
|
-
#${
|
|
166
|
+
#${H} .grabby-toast-file-link:hover {
|
|
162
167
|
text-decoration: underline;
|
|
163
168
|
color: var(--grabby-accent, #2563eb);
|
|
164
169
|
}
|
|
165
|
-
`)}var ce=null;function Sa(){return ce?.isConnected||(xa(),ce=x("div",{id:P,role:"status","aria-live":"polite"}),N().appendChild(ce)),ce}function Ca(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}function At(e,t){return x("div",{class:"grabby-toast-row"},x("span",{class:"grabby-toast-label"},e),typeof t=="string"?x("span",{class:"grabby-toast-value"},t):t)}function G(e,t={}){let n=Sa(),{detail:o,actions:r}=t,a=t.duration??(r?.length?8e3:3500),i=[x("div",{class:"grabby-toast-header"},le(Pn,"grabby-toast-icon"),x("span",{class:"grabby-toast-title"},e))];if(o){let s=x("div",{class:"grabby-toast-details"});if(o.componentName&&s.appendChild(At("Component",o.componentName)),o.filePath){let u=o.line!=null?`${o.filePath}:${o.line}`:o.filePath;s.appendChild(At("File",x("a",{class:"grabby-toast-file-link",href:Ca(o.filePath,o.line,o.column),title:"Open in VS Code"},u)))}o.cssClasses&&o.cssClasses.length>0&&s.appendChild(At("Classes",o.cssClasses.map(u=>`.${u}`).join(" "))),i.push(s)}r?.length&&i[0].appendChild(x("span",{class:"grabby-toast-actions"},...r.map(s=>x("button",{type:"button",class:s.primary?"grabby-toast-action grabby-toast-action-primary":"grabby-toast-action",onclick:u=>{u.stopPropagation(),Ta(),s.onClick()}},s.label)))),n.replaceChildren(...i),W&&(clearTimeout(W),W=null),n.classList.remove("grabby-toast-visible"),n.offsetHeight,n.classList.add("grabby-toast-visible"),W=setTimeout(()=>{n.classList.remove("grabby-toast-visible"),W=null},a)}function Ta(){W&&(clearTimeout(W),W=null),ce?.classList.remove("grabby-toast-visible")}function Dn(){W&&(clearTimeout(W),W=null),ce?.remove(),ce=null,R(_t)}function Fn(e){return Array.from(e).filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))}function On(e){if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(e);let t="";for(let n=0;n<e.length;n++){let o=e.charAt(n),r=e.charCodeAt(n);if(r===0){t+="\uFFFD";continue}if(r>=1&&r<=31||r===127||n===0&&r>=48&&r<=57||n===1&&r>=48&&r<=57&&e.charCodeAt(0)===45){t+=`\\${r.toString(16)} `;continue}if(n===0&&e.length===1&&r===45){t+=`\\${o}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){t+=o;continue}t+=`\\${o}`}return t}function Pe(e,t=document){if(!e)return null;try{return t.querySelector(e)}catch{return null}}var ka=["data-testid","data-test","data-cy","data-qa"],Aa=8;function Qe(e,t){try{let n=t.ownerDocument.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}function _a(e){let t=e.tagName.toLowerCase(),n=e.parentElement;if(!n)return t;let o=Array.from(n.children).filter(r=>r.tagName===e.tagName);return o.length===1?t:`${t}:nth-of-type(${o.indexOf(e)+1})`}function Hn(e){for(let o of ka){let r=e.getAttribute(o);if(r){let a=`[${o}="${r.replace(/["\\]/g,"\\$&")}"]`;if(Qe(a,e))return a}}if(e.id){let o=`#${On(e.id)}`;if(Qe(o,e))return o}let t=[],n=e;for(;n&&t.length<Aa;){if(n!==e&&n.id){let r=`#${On(n.id)}`;if(Qe(r,n)){t.unshift(r);break}}t.unshift(_a(n));let o=t.join(" > ");if(Qe(o,e))return o;if(n.tagName==="BODY"||n.tagName==="HTML")break;n=n.parentElement}return t.join(" > ")}var Ra=new Set(["BUTTON","A","SUMMARY"]),Ia=new Set(["button","link","tab","menuitem","menuitemcheckbox","menuitemradio","switch","option","checkbox","radio"]),Bn=new Set(["button","submit","reset","image"]),Na=new Set(["INPUT","SELECT","TEXTAREA"]),$a=new Set(["textbox","combobox","searchbox","spinbutton","slider"]),La=new Set(["IMG","SVG","VIDEO","PICTURE","CANVAS","IFRAME","AUDIO"]),Pa=new Set(["H1","H2","H3","H4","H5","H6","P","SPAN","LABEL","LI","STRONG","EM","B","I","SMALL","BLOCKQUOTE","CODE","PRE","TD","TH","DT","DD","FIGCAPTION","LEGEND","CAPTION","Q","CITE","MARK","TIME"]),Gn=new Set(["HTML","BODY","MAIN"]),Ma=new Set(["HEADER","FOOTER","NAV","ASIDE"]),Da=.6;function et(e){return(e.getAttribute("role")??"").toLowerCase()}function Rt(e){return Ra.has(e.tagName)?e.tagName!=="A"||e.hasAttribute("href")||e.hasAttribute("role"):e.tagName==="INPUT"&&Bn.has(e.type)?!0:Ia.has(et(e))}function It(e){return e.tagName==="INPUT"?!Bn.has(e.type):Na.has(e.tagName)||e.isContentEditable&&e.getAttribute("contenteditable")!==null?!0:$a.has(et(e))}function Un(e){let t=e.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;if(!n||!o)return!1;let r=Math.max(0,Math.min(t.right,n)-Math.max(t.left,0)),a=Math.max(0,Math.min(t.bottom,o)-Math.max(t.top,0));return r*a/(n*o)>=Da}function Oa(e){return e.children.length>0}function Vn(e){return Gn.has(e.tagName)?"section":La.has(e.tagName)?"media":It(e)?"field":Rt(e)?"action":Ma.has(e.tagName)||et(e)==="main"||et(e)==="region"?Un(e)?"section":"container":Pa.has(e.tagName)||!Oa(e)&&(e.textContent??"").trim()?"text":Un(e)?"section":"container"}var Fa=3;function zn(e){if(Rt(e)||It(e))return e;let t=e.parentElement;for(let n=0;t&&n<Fa;n++){if(Rt(t)||It(t))return t;if(Gn.has(t.tagName))break;t=t.parentElement}return e}var Ha=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,Ua=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g,Ba=/\b(Bearer|Basic|Token)\s+[A-Za-z0-9._~+/=-]{8,}/gi,Ga=/\b\d(?:[ -]?\d){8,}\b/g,Va=/\b[A-Za-z0-9_-]{32,}\b/g,za=/([?&#](?:access_token|id_token|token|key|api_key|apikey|secret|password|pass|auth|code|session|sig|signature)=)[^&#\s]*/gi;function O(e,t={}){if(!e)return e;let n=e.replace(za,"$1[redacted]").replace(Ua,"[token]").replace(Ba,"$1 [token]");return(t.keepEmails?n:n.replace(Ha,"[email]")).replace(Ga,"[number]").replace(Va,o=>/\d/.test(o)&&/[A-Za-z]/.test(o)?"[token]":o)}function jn(e,t=[]){let n=e.pathname||"/";if(t.length>0&&e.search){let o=new URLSearchParams(e.search),r=new URLSearchParams;for(let i of t){let s=o.get(i);s!==null&&r.set(i,s)}let a=r.toString();a&&(n+=`?${a}`)}return e.hash.startsWith("#/")&&(n+=e.hash.split("?")[0]),O(n)}function Me(e,t=typeof location<"u"?location.href:"http://localhost/"){try{let n=new URL(e,t);if(n.protocol==="javascript:"||n.protocol==="data:"||n.protocol==="vbscript:")return`${n.protocol}\u2026`;let o=new URL(t),r=n.pathname+(n.hash.startsWith("#/")?n.hash:"");return O(n.origin===o.origin?r:`${n.host}${r}`)}catch{return O(e.split(/[?#]/)[0])}}var tt="data-grabby-mask",te="data-grabby-ignore",ja=["id","class","role","aria-label","data-testid","data-test","data-cy","name","type","href","src","alt","placeholder","title","for","aria-expanded","aria-selected","disabled"],Ka=new Set(["href","src"]),Wa=8,Ya=60,Xa=80,qa=80,Kn=300;function Za(e){return e.startsWith("_ng")||e.startsWith("ng-reflect-")||e.startsWith("data-v-")||e.startsWith("data-grabby-")||e.startsWith("data-svelte")||e==="style"||e==="value"||e.startsWith("on")}function De(e){return e.startsWith("ng-")||e.startsWith("_ng")||/^svelte-[a-z0-9]+$/i.test(e)||/^s-[A-Za-z0-9_-]{8,}$/.test(e)}function X(e,t){return e.length<=t?e:`${e.slice(0,t-1).trimEnd()}\u2026`}function nt(e){return e.closest(`[${tt}]`)!==null}function ne(e,t){if(nt(e))return"[masked]";let n="",o=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let r=o.nextNode();r;r=o.nextNode()){let a=r.parentElement;if(!(a&&/^(SCRIPT|STYLE|NOSCRIPT|TEMPLATE)$/.test(a.tagName))&&!a?.closest(`[${te}], [${tt}]`)&&(n+=` ${r.nodeValue??""}`,n.length>t*3))break}return X(O(n.replace(/\s+/g," ").trim()),t)}function Wn(e){let t="";for(let n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE&&(t+=` ${n.nodeValue??""}`);return t.replace(/\s+/g," ").trim()}function Ja(e,t,n,o){if(t==="class"){let r=o(n.split(/\s+/).filter(Boolean));return r.length===0?null:X(r.join(" "),Ya)}return Ka.has(t)?X(Me(n),120):X(O(n,{keepEmails:t==="placeholder"}),Xa)}function Qa(e,t=n=>n.filter(o=>!De(o))){let n=e.tagName.toLowerCase(),o=[],r=new Set,a=i=>{if(o.length>=Wa||r.has(i)||Za(i))return;let s=e.getAttribute(i);if(s===null)return;if(r.add(i),s===""){o.push(i);return}let u=Ja(e,i,s,t);u!==null&&o.push(`${i}="${u.replace(/"/g,""")}"`)};for(let i of ja)a(i);for(let{name:i}of Array.from(e.attributes))i.startsWith("aria-")&&a(i);return`<${n}${o.length?` ${o.join(" ")}`:""}>`}function Yn(e,t){let n=e.tagName.toLowerCase(),o=Qa(e,t);if(/^(img|input|br|hr|meta|link|source|area|col|embed|wbr)$/.test(n))return X(o,Kn);let r=Array.from(e.children).filter(i=>!i.hasAttribute(te)),a;if(nt(e))a="[masked]";else if(r.length===0)a=X(O(Wn(e)),qa);else if(r.length<=2){let i=X(O(Wn(e)),40),s=r.map(u=>{let l=ne(u,30);return`<${u.tagName.toLowerCase()}${l?`>${l}</${u.tagName.toLowerCase()}>`:" \u2026>"}`});a=[i,...s].filter(Boolean).join(" ")}else a=`(${r.length} elements)`;return X(`${o}${a}</${n}>`,Kn)}function Xn(e){let t=null,n=!1;function o(l){let c=e.getComponentResolver();return c?c(l)?.name??null:null}function r(l){let c=e.getSourceResolver();if(!c)return null;let m=c(l);if(!m?.filePath)return null;let f=m.filePath;return m.line!=null&&(f+=`:${m.line}`),f}function a(l,c){let m=e.getFreezeElement?.();m&&(m.style.pointerEvents="none");let f=document.elementFromPoint(l,c);return m&&(m.style.pointerEvents="auto"),f}function i(l,c,m){let f=a(l,c);return!f||f.closest(`[${te}]`)?f&&e.isToolbarElement?.(f)?f:null:m?f:zn(f)}function s(l){let c=i(l.clientX,l.clientY,l.shiftKey);if(!c||e.overlay.isOverlayElement(c)||e.crosshair.isCrosshairElement(c)||e.isToolbarElement?.(c)||c===t)return;t=c;let m=o(c),f=r(c),p=Fn(c.classList);e.overlay.show(c,m,f,p),e.onHover(c)}function u(l){let c=se(l);if(c&&e.isToolbarElement?.(c))return;let m=a(l.clientX,l.clientY);m&&(e.isToolbarElement?.(m)||e.crosshair.isCrosshairElement(m))||(l.preventDefault(),l.stopPropagation(),t&&e.onSelect(t))}return{activate(){n||(n=!0,e.crosshair.activate(),document.addEventListener("mousemove",s,!0),document.addEventListener("click",u,!0))},deactivate(){n&&(n=!1,t=null,e.crosshair.deactivate(),document.removeEventListener("mousemove",s,!0),document.removeEventListener("click",u,!0),e.overlay.hide(),e.onHover(null))},getHoveredElement(){return t},dispose(){this.deactivate()}}}function qn(e){let t=e.split("+").map(o=>o.trim()),n={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let o of t){let r=o.toLowerCase();r==="meta"||r==="cmd"||r==="command"?n.meta=!0:r==="ctrl"||r==="control"?n.ctrl=!0:r==="shift"?n.shift=!0:r==="alt"||r==="option"?n.alt=!0:n.key=r}return n}function Zn(e,t){return e.key&&e.key.toLowerCase()===t?!0:e.code?/^[a-z]$/.test(t)?e.code===`Key${t.toUpperCase()}`:/^[0-9]$/.test(t)?e.code===`Digit${t}`:!1:!1}function ei(e,t){return t.meta&&!e.metaKey||t.ctrl&&!e.ctrlKey||t.shift&&!e.shiftKey||t.alt&&!e.altKey?!1:Zn(e,t.key)}function Jn(e){let t=null,n=!1,o=!1;function r(i){if(!e.getEnableInInputs()&&ve(se(i)))return;let s=qn(e.getActivationKey());if(!ei(i,s))return;let u=e.getActivationMode(),l=e.getKeyHoldDuration();if(u==="hold"){if(i.preventDefault(),n)return;if(l>0){if(t)return;t=setTimeout(()=>{n=!0,e.onActivate()},l)}else n=!0,e.onActivate()}else i.preventDefault()}function a(i){let s=qn(e.getActivationKey());if(!Zn(i,s.key))return;e.getActivationMode()==="hold"?(t&&(clearTimeout(t),t=null),n&&(n=!1,e.onDeactivate())):e.isActive()?e.onDeactivate():e.onActivate()}return{start(){o||(o=!0,document.addEventListener("keydown",r,!0),document.addEventListener("keyup",a,!0))},stop(){o&&(o=!1,t&&(clearTimeout(t),t=null),n=!1,document.removeEventListener("keydown",r,!0),document.removeEventListener("keyup",a,!0))},dispose(){this.stop()}}}function Qn(){let e=new Map,t=new Map;return{register(n,o){if(e.has(n.name)&&this.unregister(n.name),e.set(n.name,n),n.setup){let r=n.setup(o);r&&t.set(n.name,r)}},unregister(n){let o=t.get(n);o&&(o(),t.delete(n)),e.delete(n)},callHook(n,...o){for(let r of e.values()){let a=r.hooks?.[n];if(a)try{a(...o)}catch(i){console.warn(`[grabby] Plugin "${r.name}" hook "${n}" threw:`,i)}}},callTransformHook(n,o){let r=n;for(let a of e.values()){let i=a.hooks?.transformCopyContent;if(i)try{r=i(r,o)}catch(s){console.warn(`[grabby] Plugin "${a.name}" transformCopyContent threw:`,s)}}return r},getPlugins(){return Array.from(e.values())},dispose(){for(let n of t.values())try{n()}catch{}t.clear(),e.clear()}}}function ti(e){try{let t=new URL(e,typeof location<"u"?location.href:void 0);return t.protocol==="https:"?!0:t.protocol==="http:"&&/^(localhost|127\.0\.0\.1|\[::1\])$/.test(t.hostname)}catch{return!1}}function eo(e){return ti(e)?{name:"webhook",hooks:{onComment(t){fetch(e,{method:"POST",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"grabby.comment",version:1,origin:typeof location<"u"?location.origin:null,comment:t})}).catch(()=>{})}}}:(console.warn(`[grabby] webhookUrl must be https:// or http://localhost; ignoring "${e}".`),{name:"webhook"})}var to="theme-vars",no="theme-overrides",ni=`
|
|
170
|
+
`)}var ue=null;function ca(){return ue?.isConnected||(la(),ue=w("div",{id:H,role:"status","aria-live":"polite"}),N().appendChild(ue)),ue}function ua(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}function $t(e,t){return w("div",{class:"grabby-toast-row"},w("span",{class:"grabby-toast-label"},e),typeof t=="string"?w("span",{class:"grabby-toast-value"},t):t)}function K(e,t={}){let n=ca(),{detail:o,actions:r}=t,i=t.duration??(r?.length?8e3:3500),a=[w("div",{class:"grabby-toast-header"},ce(Qn,"grabby-toast-icon"),w("span",{class:"grabby-toast-title"},e))];if(o){let s=w("div",{class:"grabby-toast-details"});if(o.componentName&&s.appendChild($t("Component",o.componentName)),o.filePath){let u=o.line!=null?`${o.filePath}:${o.line}`:o.filePath;s.appendChild($t("File",w("a",{class:"grabby-toast-file-link",href:ua(o.filePath,o.line,o.column),title:"Open in VS Code"},u)))}o.cssClasses&&o.cssClasses.length>0&&s.appendChild($t("Classes",o.cssClasses.map(u=>`.${u}`).join(" "))),a.push(s)}r?.length&&a[0].appendChild(w("span",{class:"grabby-toast-actions"},...r.map(s=>w("button",{type:"button",class:s.primary?"grabby-toast-action grabby-toast-action-primary":"grabby-toast-action",onclick:u=>{u.stopPropagation(),da(),s.onClick()}},s.label)))),n.replaceChildren(...a),Z&&(clearTimeout(Z),Z=null),n.classList.remove("grabby-toast-visible"),n.offsetHeight,n.classList.add("grabby-toast-visible"),Z=setTimeout(()=>{n.classList.remove("grabby-toast-visible"),Z=null},i)}function da(){Z&&(clearTimeout(Z),Z=null),ue?.classList.remove("grabby-toast-visible")}function to(){Z&&(clearTimeout(Z),Z=null),ue?.remove(),ue=null,R(Pt)}function oo(e){return Array.from(e).filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))}function no(e){if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(e);let t="";for(let n=0;n<e.length;n++){let o=e.charAt(n),r=e.charCodeAt(n);if(r===0){t+="\uFFFD";continue}if(r>=1&&r<=31||r===127||n===0&&r>=48&&r<=57||n===1&&r>=48&&r<=57&&e.charCodeAt(0)===45){t+=`\\${r.toString(16)} `;continue}if(n===0&&e.length===1&&r===45){t+=`\\${o}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){t+=o;continue}t+=`\\${o}`}return t}function Fe(e,t=document){if(!e)return null;try{return t.querySelector(e)}catch{return null}}var ma=["data-testid","data-test","data-cy","data-qa"],fa=8;function at(e,t){try{let n=t.ownerDocument.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}function pa(e){let t=e.tagName.toLowerCase(),n=e.parentElement;if(!n)return t;let o=Array.from(n.children).filter(r=>r.tagName===e.tagName);return o.length===1?t:`${t}:nth-of-type(${o.indexOf(e)+1})`}function ro(e){for(let o of ma){let r=e.getAttribute(o);if(r){let i=`[${o}="${r.replace(/["\\]/g,"\\$&")}"]`;if(at(i,e))return i}}if(e.id){let o=`#${no(e.id)}`;if(at(o,e))return o}let t=[],n=e;for(;n&&t.length<fa;){if(n!==e&&n.id){let r=`#${no(n.id)}`;if(at(r,n)){t.unshift(r);break}}t.unshift(pa(n));let o=t.join(" > ");if(at(o,e))return o;if(n.tagName==="BODY"||n.tagName==="HTML")break;n=n.parentElement}return t.join(" > ")}function io(e){let t=null,n=!1;function o(c){let l=e.getComponentResolver();return l?l(c)?.name??null:null}function r(c){let l=e.getSourceResolver();if(!l)return null;let m=l(c);if(!m?.filePath)return null;let p=m.filePath;return m.line!=null&&(p+=`:${m.line}`),p}function i(c,l){let m=e.getFreezeElement?.();m&&(m.style.pointerEvents="none");let p=document.elementFromPoint(c,l);return m&&(m.style.pointerEvents="auto"),p}function a(c,l,m){let p=i(c,l);return!p||p.closest(`[${oe}]`)?p&&e.isToolbarElement?.(p)?p:null:m?p:Dn(p)}function s(c){let l=a(c.clientX,c.clientY,c.shiftKey);if(!l||e.overlay.isOverlayElement(l)||e.crosshair.isCrosshairElement(l)||e.isToolbarElement?.(l)||l===t)return;t=l;let m=o(l),p=r(l),f=oo(l.classList);e.overlay.show(l,m,p,f),e.onHover(l)}function u(c){let l=le(c);if(l&&e.isToolbarElement?.(l))return;let m=i(c.clientX,c.clientY);m&&(e.isToolbarElement?.(m)||e.crosshair.isCrosshairElement(m))||(c.preventDefault(),c.stopPropagation(),t&&e.onSelect(t))}return{activate(){n||(n=!0,e.crosshair.activate(),document.addEventListener("mousemove",s,!0),document.addEventListener("click",u,!0))},deactivate(){n&&(n=!1,t=null,e.crosshair.deactivate(),document.removeEventListener("mousemove",s,!0),document.removeEventListener("click",u,!0),e.overlay.hide(),e.onHover(null))},getHoveredElement(){return t},dispose(){this.deactivate()}}}function ao(e){let t=e.split("+").map(o=>o.trim()),n={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let o of t){let r=o.toLowerCase();r==="meta"||r==="cmd"||r==="command"?n.meta=!0:r==="ctrl"||r==="control"?n.ctrl=!0:r==="shift"?n.shift=!0:r==="alt"||r==="option"?n.alt=!0:n.key=r}return n}function so(e,t){return e.key&&e.key.toLowerCase()===t?!0:e.code?/^[a-z]$/.test(t)?e.code===`Key${t.toUpperCase()}`:/^[0-9]$/.test(t)?e.code===`Digit${t}`:!1:!1}function ba(e,t){return t.meta&&!e.metaKey||t.ctrl&&!e.ctrlKey||t.shift&&!e.shiftKey||t.alt&&!e.altKey?!1:so(e,t.key)}function lo(e){let t=null,n=!1,o=!1,r=!1;function i(s){if(!e.getEnableInInputs()&&ve(le(s)))return;let u=ao(e.getActivationKey());if(!ba(s,u))return;let c=e.getActivationMode(),l=e.getKeyHoldDuration();if(c==="hold"){if(s.preventDefault(),n)return;if(l>0){if(t)return;t=setTimeout(()=>{n=!0,e.onActivate()},l)}else n=!0,e.onActivate()}else s.preventDefault(),o=!0}function a(s){let u=ao(e.getActivationKey());if(!so(s,u.key))return;if(e.getActivationMode()==="hold")t&&(clearTimeout(t),t=null),n&&(n=!1,e.onDeactivate());else{if(!o)return;o=!1,e.isActive()?e.onDeactivate():e.onActivate()}}return{start(){r||(r=!0,document.addEventListener("keydown",i,!0),document.addEventListener("keyup",a,!0))},stop(){r&&(r=!1,t&&(clearTimeout(t),t=null),n=!1,o=!1,document.removeEventListener("keydown",i,!0),document.removeEventListener("keyup",a,!0))},dispose(){this.stop()}}}function co(){let e=new Map,t=new Map;return{register(n,o){if(e.has(n.name)&&this.unregister(n.name),e.set(n.name,n),n.setup){let r=n.setup(o);r&&t.set(n.name,r)}},unregister(n){let o=t.get(n);o&&(o(),t.delete(n)),e.delete(n)},callHook(n,...o){for(let r of e.values()){let i=r.hooks?.[n];if(i)try{i(...o)}catch(a){console.warn(`[grabby] Plugin "${r.name}" hook "${n}" threw:`,a)}}},callTransformHook(n,o){let r=n;for(let i of e.values()){let a=i.hooks?.transformCopyContent;if(a)try{r=a(r,o)}catch(s){console.warn(`[grabby] Plugin "${i.name}" transformCopyContent threw:`,s)}}return r},getPlugins(){return Array.from(e.values())},dispose(){for(let n of t.values())try{n()}catch{}t.clear(),e.clear()}}}function ga(e){try{let t=new URL(e,typeof location<"u"?location.href:void 0);return t.protocol==="https:"?!0:t.protocol==="http:"&&/^(localhost|127\.0\.0\.1|\[::1\])$/.test(t.hostname)}catch{return!1}}function uo(e){return ga(e)?{name:"webhook",hooks:{onComment(t){fetch(e,{method:"POST",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"grabby.comment",version:1,origin:typeof location<"u"?location.origin:null,comment:t})}).catch(()=>{})}}}:(console.warn(`[grabby] webhookUrl must be https:// or http://localhost; ignoring "${e}".`),{name:"webhook"})}var mo="theme-vars",fo="theme-overrides",ha=`
|
|
166
171
|
:host {
|
|
167
172
|
all: initial;
|
|
168
173
|
--grabby-bg: #ffffff;
|
|
@@ -193,11 +198,11 @@
|
|
|
193
198
|
--grabby-popover-hover: #f1f5f9;
|
|
194
199
|
--grabby-popover-shadow: rgba(0, 0, 0, 0.12);
|
|
195
200
|
}
|
|
196
|
-
`,
|
|
201
|
+
`,ya={overlayBorderColor:"--grabby-overlay-border",overlayBgColor:"--grabby-overlay-bg",labelBgColor:"--grabby-label-bg",labelTextColor:"--grabby-label-text",toastBgColor:"--grabby-toast-bg",toastTextColor:"--grabby-toast-text",toolbarBgColor:"--grabby-toolbar-bg",toolbarTextColor:"--grabby-toolbar-text",toolbarAccentColor:"--grabby-toolbar-active",popoverBgColor:"--grabby-popover-bg",popoverTextColor:"--grabby-popover-text",popoverBorderColor:"--grabby-popover-border"},va=/^[#a-zA-Z0-9\s(),.%-]+$/;function po(){return{apply(e){_(mo,ha)},applyOverrides(e){let t=[];for(let[n,o]of Object.entries(ya)){let r=e[n];r&&va.test(r)&&!/url\s*\(/i.test(r)&&t.push(` ${o}: ${r};`)}if(t.length===0){this.clearOverrides();return}_(fo,` :host {
|
|
197
202
|
${t.join(`
|
|
198
203
|
`)}
|
|
199
|
-
}`)},clearOverrides(){R(
|
|
200
|
-
#${
|
|
204
|
+
}`)},clearOverrides(){R(fo)},dispose(){R(mo),this.clearOverrides()}}}var P="__grabby-toolbar__",Mt="__grabby-toolbar-styles__";function Ea(e){if(e.length===0)return null;let t=0,n=0;for(let o of e)o.sync==="pending"?t++:o.sync==="failed"&&n++;return n?{text:`${n} not sent`,tone:"error"}:t?{text:"Sending\u2026",tone:"busy"}:{text:`${e.length} sent`,tone:"ok"}}function bo(e,t={}){let n=null,o=null,r={},i=new Set,a=null,s=null;function u(){G(Mt)||_(Mt,`
|
|
205
|
+
#${P} {
|
|
201
206
|
position: fixed;
|
|
202
207
|
bottom: 20px;
|
|
203
208
|
left: 50%;
|
|
@@ -215,12 +220,12 @@ ${t.join(`
|
|
|
215
220
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
216
221
|
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
217
222
|
}
|
|
218
|
-
#${
|
|
223
|
+
#${P}.grabby-toolbar-hidden {
|
|
219
224
|
opacity: 0;
|
|
220
225
|
transform: translateX(-50%) translateY(20px);
|
|
221
226
|
pointer-events: none;
|
|
222
227
|
}
|
|
223
|
-
#${
|
|
228
|
+
#${P} button {
|
|
224
229
|
display: flex;
|
|
225
230
|
align-items: center;
|
|
226
231
|
justify-content: center;
|
|
@@ -234,19 +239,19 @@ ${t.join(`
|
|
|
234
239
|
padding: 0;
|
|
235
240
|
transition: background 0.15s ease, color 0.15s ease;
|
|
236
241
|
}
|
|
237
|
-
#${
|
|
242
|
+
#${P} button:hover {
|
|
238
243
|
background: var(--grabby-toolbar-hover, #f1f5f9);
|
|
239
244
|
color: var(--grabby-accent, #2563eb);
|
|
240
245
|
}
|
|
241
|
-
#${
|
|
242
|
-
#${
|
|
246
|
+
#${P} button { position: relative; }
|
|
247
|
+
#${P} button.grabby-btn-labelled {
|
|
243
248
|
width: auto;
|
|
244
249
|
gap: 6px;
|
|
245
250
|
padding: 0 12px 0 10px;
|
|
246
251
|
font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
247
252
|
color: var(--grabby-accent, #2563eb);
|
|
248
253
|
}
|
|
249
|
-
#${
|
|
254
|
+
#${P} .grabby-badge {
|
|
250
255
|
position: absolute;
|
|
251
256
|
top: 1px;
|
|
252
257
|
right: 1px;
|
|
@@ -261,22 +266,22 @@ ${t.join(`
|
|
|
261
266
|
text-align: center;
|
|
262
267
|
pointer-events: none;
|
|
263
268
|
}
|
|
264
|
-
#${
|
|
265
|
-
#${
|
|
269
|
+
#${P} .grabby-badge[hidden] { display: none; }
|
|
270
|
+
#${P} button.grabby-btn-active {
|
|
266
271
|
color: var(--grabby-toolbar-active, #2563eb);
|
|
267
272
|
}
|
|
268
|
-
#${
|
|
273
|
+
#${P} button.grabby-btn-disabled {
|
|
269
274
|
opacity: 0.4;
|
|
270
275
|
color: var(--grabby-toolbar-text, #64748b);
|
|
271
276
|
}
|
|
272
|
-
#${
|
|
277
|
+
#${P} .grabby-toolbar-divider {
|
|
273
278
|
width: 1px;
|
|
274
279
|
height: 20px;
|
|
275
280
|
background: var(--grabby-toolbar-border, #e2e8f0);
|
|
276
281
|
margin: 0 4px;
|
|
277
282
|
flex-shrink: 0;
|
|
278
283
|
}
|
|
279
|
-
#${
|
|
284
|
+
#${P} .grabby-toolbar-left {
|
|
280
285
|
display: flex;
|
|
281
286
|
align-items: center;
|
|
282
287
|
gap: 2px;
|
|
@@ -285,18 +290,18 @@ ${t.join(`
|
|
|
285
290
|
opacity: 1;
|
|
286
291
|
transition: max-width 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
|
|
287
292
|
}
|
|
288
|
-
#${
|
|
293
|
+
#${P} .grabby-toolbar-status {
|
|
289
294
|
padding: 0 6px;
|
|
290
295
|
font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
291
296
|
white-space: nowrap;
|
|
292
297
|
color: #15803d;
|
|
293
298
|
}
|
|
294
|
-
#${
|
|
295
|
-
#${
|
|
296
|
-
#${
|
|
297
|
-
#${
|
|
298
|
-
#${
|
|
299
|
-
#${
|
|
299
|
+
#${P} .grabby-toolbar-status[data-tone="ok"]::before { content: "\u2713 "; }
|
|
300
|
+
#${P} .grabby-toolbar-status[data-tone="busy"] { color: var(--grabby-toolbar-text, #64748b); }
|
|
301
|
+
#${P} .grabby-toolbar-status[data-tone="error"] { color: #b91c1c; }
|
|
302
|
+
#${P} .grabby-toolbar-status[hidden],
|
|
303
|
+
#${P} button[hidden] { display: none; }
|
|
304
|
+
#${P} button.grabby-btn-finish {
|
|
300
305
|
width: auto;
|
|
301
306
|
padding: 0 14px;
|
|
302
307
|
margin-left: 2px;
|
|
@@ -305,23 +310,23 @@ ${t.join(`
|
|
|
305
310
|
background: var(--grabby-accent, #2563eb);
|
|
306
311
|
color: #fff;
|
|
307
312
|
}
|
|
308
|
-
#${
|
|
313
|
+
#${P} button.grabby-btn-finish:hover {
|
|
309
314
|
background: var(--grabby-accent-hover, #1d4ed8);
|
|
310
315
|
color: #fff;
|
|
311
316
|
}
|
|
312
|
-
#${
|
|
317
|
+
#${P} .grabby-toolbar-left.grabby-toolbar-left-hidden {
|
|
313
318
|
max-width: 0;
|
|
314
319
|
opacity: 0;
|
|
315
320
|
pointer-events: none;
|
|
316
321
|
}
|
|
317
|
-
`)}function
|
|
322
|
+
`)}function c(m,p,f,E){let g=document.createElement("button");return g.type="button",g.appendChild(ce(p)),g.title=f,g.setAttribute("aria-label",f),g.setAttribute("data-grabby-btn",m),g.addEventListener("click",h=>{h.preventDefault(),h.stopPropagation(),E()}),g}function l(){if(n)return;u(),n=document.createElement("div"),n.id=P,n.setAttribute("role","toolbar"),n.setAttribute("aria-label","Grabby toolbar"),r.selection=c("selection",qn,"Comment on an element (Alt+G)",e.onSelectionMode),t.label&&(r.selection.classList.add("grabby-btn-labelled"),r.selection.append(document.createTextNode(t.label))),r.history=c("history",Zn,"Comments",e.onHistory),a=document.createElement("span"),a.className="grabby-badge",a.hidden=!0,r.history.appendChild(a),r.enable=c("enable",Jn,"Enable/Disable",e.onEnableToggle),r.dismiss=c("dismiss",it,t.dismissLabel??"Dismiss toolbar",e.onDismiss);let m=document.createElement("span");m.className="grabby-toolbar-divider",o=document.createElement("div"),o.className="grabby-toolbar-left",o.appendChild(r.selection),o.appendChild(r.history),o.appendChild(m),n.appendChild(o),t.review&&(s=document.createElement("span"),s.className="grabby-toolbar-status",s.setAttribute("role","status"),s.hidden=!0,r.finish=document.createElement("button"),r.finish.type="button",r.finish.className="grabby-btn-finish",r.finish.textContent="Finish review",r.finish.setAttribute("data-grabby-btn","finish"),r.finish.hidden=!0,r.finish.addEventListener("click",p=>{p.preventDefault(),p.stopPropagation(),e.onFinish?.()}),n.appendChild(s),n.appendChild(r.finish),i.add(s)),t.hideEnable||n.appendChild(r.enable),n.appendChild(r.dismiss),N().appendChild(n),i.clear(),i.add(n),i.add(o),i.add(m);for(let p of Object.values(r))i.add(p)}return{show(){l(),n.classList.remove("grabby-toolbar-hidden")},hide(){n&&n.classList.add("grabby-toolbar-hidden")},update(m){if(!n)return;m.active?r.selection.classList.add("grabby-btn-active"):r.selection.classList.remove("grabby-btn-active");let p=m.toolbar.comments.length;if(a&&(a.hidden=p===0,a.textContent=p>99?"99+":String(p)),r.history.setAttribute("aria-label",p?`Comments (${p})`:"Comments"),s&&r.finish){let f=Ea(m.toolbar.comments);s.hidden=!f,s.textContent=f?.text??"",s.dataset.tone=f?.tone??"",r.finish.hidden=p===0}m.options.enabled?(r.enable.classList.add("grabby-btn-active"),o?.classList.remove("grabby-toolbar-left-hidden")):(r.enable.classList.remove("grabby-btn-active"),o?.classList.add("grabby-toolbar-left-hidden"))},isToolbarElement(m){if(i.has(m))return!0;let p=m;for(;p;){if(p===n||p.id===P)return!0;p=p.parentElement}return!1},dispose(){n?.remove(),R(Mt),n=null,o=null,r={},a=null,s=null,i.clear()}}}function ho(e){return Math.ceil(e.length/4)}var go=new Set(["styles","layout","computed"]),xa=new Set(["label","type","text","href","placeholder","alt","src","title"]);function wa(e,t){return t.length>0&&(e.includes(`>${t}<`)||e.includes(`"${t}"`)||e.includes(`>${t}`))}function Sa(e){return e.anonymous||!e.name?`anon:${e.sessionId}`:`name:${e.name}`}function He(e){return!e.anonymous&&e.name?e.name:`Anonymous ${e.sessionId.replace(/-/g,"").slice(0,4)}`}function Ca(e){return e.split(/[\\/]/).pop()??e}function Dt(e,t,n){let o=n?e:Ca(e);return t!=null?`${o}:${t}`:o}function yo(e,t){return e.split(`
|
|
318
323
|
`).map((n,o)=>o===0?n:`${t}${n}`).join(`
|
|
319
|
-
`)}function Ee(e){return Array.from(new Set(e))}function
|
|
320
|
-
`);let s=new Map;for(let
|
|
321
|
-
`)}var
|
|
322
|
-
#${
|
|
324
|
+
`)}function Ee(e){return Array.from(new Set(e))}function Ta(e,t,n){let o=e.length,r=[`# UI feedback \xB7 ${o} comment${o===1?"":"s"}`],i=[];t.origin&&i.push(t.origin);let a=Ee(e.map(c=>c.framework).filter(Boolean));a.length&&i.push(a.join(", "));let s=Ee(e.map(c=>c.page.route));!n.showRoutes&&s.length===1&&i.push(`page ${s[0]}`);let u=e[0]?.page.viewport;if(u&&i.push(`${u[0]}\xD7${u[1]}`),i.push((t.now??new Date).toISOString().slice(0,10)),r.push(i.join(" \xB7 ")),n.showAuthors){let c=Ee(e.map(l=>He(l.author)));r.push(`From: ${c.join(", ")}`)}return r}function ka(e,t,n){let o=e.target,i=[o.source?Dt(o.source.file,o.source.line,!0):o.selector,o.component,`<${o.tag}>`].filter(Boolean).join(" "),a=n.showAuthors?` (${He(e.author)})`:"",s=n.showRoutes?` [${e.page.route}]`:"",u=n.showIds?` [id ${e.id}]`:"";return`${t}. ${i}${s} \u2014 ${yo(e.comment," ")}${a}${u}`}function Aa(e,t,n,o,r){let i=e.target,a=n.level==="detailed",s=[`${t}. ${yo(e.comment," ")}`],u=f=>s.push(` - ${f}`),c=[`\`${i.preview}\``,`(${i.kind})`];i.component&&i.component!==r?c.push(i.source?.line!=null&&o?`${i.component} line ${i.source.line}`:i.component):i.source?.line!=null&&o&&c.push(`line ${i.source.line}`),u(c.join(" ")),(!i.source||a)&&u(`selector: \`${i.selector}\``);let l=Object.entries(i.facts).filter(([f,E])=>!go.has(f)&&!(xa.has(f)&&!a&&wa(i.preview,E)));l.length&&u(l.map(([f,E])=>`${f}: ${E}`).join(" \xB7 "));for(let[f,E]of Object.entries(i.facts))go.has(f)&&u(`${f}: ${E}`);let m=i.stack.filter((f,E)=>!(E===0&&(i.source||f.name===i.component)));if(m.length&&u(`inside: ${m.map(f=>f.file?`${f.name} (${Dt(f.file,f.line,a)})`:f.name).join(" \u203A ")}`),a){for(let[f,E]of Object.entries(i.extra))u(`${f}: ${E}`);u(`viewport: ${e.page.viewport[0]}\xD7${e.page.viewport[1]}`)}e.screenshot?.url&&u(`screenshot: ${e.screenshot.url}`);let p=[];return n.showAuthors&&p.push(`by ${He(e.author)}`),n.showRoutes&&p.push(`on ${e.page.route}`),p.length&&u(p.join(" ")),n.showIds&&u(`id: ${e.id}`),s}function vo(e,t="standard",n={}){if(e.length===0)return"";let o=[...e].sort((c,l)=>c.createdAt-l.createdAt),r=Ee(o.map(c=>Sa(c.author))),i={level:t,showIds:n.showIds===!0,showAuthors:r.length>1||o.some(c=>!c.author.anonymous&&!!c.author.name),showRoutes:Ee(o.map(c=>c.page.route)).length>1},a=Ta(o,n,i);if(t==="compact")return a.push(""),o.forEach((c,l)=>a.push(ka(c,l+1,i))),a.join(`
|
|
325
|
+
`);let s=new Map;for(let c of o){let l=c.target.source?.file??"",m=s.get(l);m?m.push(c):s.set(l,[c])}let u=0;for(let[c,l]of s){a.push("");let m=Ee(l.map(E=>E.target.component)),p=c&&m.length===1?m[0]:null,f=Ee(l.map(E=>E.target.source?.line??null));if(c){let E=f.length===1?Dt(c,f[0],!0):c;a.push(`## ${E}${p?` \xB7 ${p}`:""}`)}else a.push("## Elements without source info");for(let E of l)u+=1,a.push(...Aa(E,u,i,!!c&&f.length>1,p))}return a.join(`
|
|
326
|
+
`)}var _a="grabby",lt="screenshots";var st=null;function Ra(){return st||(st=new Promise(e=>{try{if(typeof indexedDB>"u"){e(null);return}let t=indexedDB.open(_a,1);t.onupgradeneeded=()=>{t.result.objectStoreNames.contains(lt)||t.result.createObjectStore(lt)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}catch{e(null)}}),st)}async function Ot(e,t){let n=await Ra();return n?new Promise(o=>{try{let r=n.transaction(lt,e),i=t(r.objectStore(lt));r.oncomplete=()=>o(i?i.result:null),r.onerror=()=>o(null),r.onabort=()=>o(null)}catch{o(null)}}):null}function Eo(e,t){return Ot("readwrite",n=>n.put(t,e))}function Ue(e){return Ot("readonly",t=>t.get(e))}function Ft(e){return e.length===0?Promise.resolve(null):Ot("readwrite",t=>{for(let n of e)t.delete(n)})}var Ht="__grabby-comments__",xo="comments-panel",Ia={pending:"Sending\u2026",sent:"Sent",failed:"Not sent"};function Na(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function La(e){return e.split(/[\\/]/).pop()??e}function $a(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}var Pa=`
|
|
327
|
+
#${Ht} {
|
|
323
328
|
position: fixed;
|
|
324
|
-
bottom: ${
|
|
329
|
+
bottom: ${se};
|
|
325
330
|
left: 50%;
|
|
326
331
|
transform: translateX(-50%);
|
|
327
332
|
z-index: ${2147483647};
|
|
@@ -339,7 +344,7 @@ ${t.join(`
|
|
|
339
344
|
visibility: hidden;
|
|
340
345
|
transition: opacity .15s ease, visibility .15s ease;
|
|
341
346
|
}
|
|
342
|
-
#${
|
|
347
|
+
#${Ht}.grabby-popover-visible { opacity: 1; visibility: visible; }
|
|
343
348
|
.grabby-panel-header {
|
|
344
349
|
display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
|
345
350
|
padding: 10px 12px 10px 14px;
|
|
@@ -405,8 +410,8 @@ ${t.join(`
|
|
|
405
410
|
padding: 6px 8px 6px 14px; border-top: 1px solid var(--grabby-popover-border, #e2e8f0);
|
|
406
411
|
font-size: 11px; color: var(--grabby-text-muted, #94a3b8);
|
|
407
412
|
}
|
|
408
|
-
`;function
|
|
409
|
-
#${
|
|
413
|
+
`;function wo(e,t={}){let n=t.variant==="live",o=null,r=!1,i=[];function a(){return o?.isConnected||(_(xo,Pa),o=w("div",{id:Ht,role:"dialog","aria-label":"Comments"}),N().appendChild(o)),o}function s(){for(let m of i)URL.revokeObjectURL(m);i=[]}function u(m){let p=m.screenshot?.localId;if(!p)return null;let f=w("img",{class:"grabby-thumb",alt:"",loading:"lazy"});return f.addEventListener("error",()=>f.remove(),{once:!0}),Ue(p).then(E=>{if(!E||typeof URL.createObjectURL!="function"){f.remove();return}let g=URL.createObjectURL(E);i.push(g),f.src=g}).catch(()=>f.remove()),f}function c(m,p){let f=m.target,E=n?[document.createTextNode(`${Kn(f)} `)]:[w("span",{class:"grabby-kind"},f.kind)];n||(f.component&&E.push(document.createTextNode(`${f.component} `)),f.source?E.push(w("a",{href:$a(f.source.file,f.source.line,f.source.column),title:`Open ${f.source.file} in VS Code`,onclick:b=>b.stopPropagation()},`${La(f.source.file)}${f.source.line!=null?`:${f.source.line}`:""}`)):f.component||E.push(document.createTextNode(`<${f.tag}>`)));let g=[p&&!n?He(m.author):"",Na(m.createdAt)].filter(Boolean);E.push(document.createTextNode(` \xB7 ${g.join(" \xB7 ")}`)),t.showSync&&m.sync&&(E.push(document.createTextNode(" \xB7 ")),E.push(w("span",{class:`grabby-sync grabby-sync-${m.sync}`},Ia[m.sync]??m.sync)));let h=w("button",{type:"button",class:"grabby-comment-delete","aria-label":"Delete comment",title:"Delete comment",onclick:b=>{b.stopPropagation(),e.onDelete(m)}},ce(it)),x=w("div",{class:"grabby-comment-row",role:"button",tabindex:"0","aria-label":`Edit comment: ${m.comment}`,dataset:{grabbyCommentId:m.id}},u(m),w("div",{class:"grabby-comment-body"},w("div",{class:"grabby-comment-text"},m.comment),w("div",{class:"grabby-comment-meta"},...E)),h);return Fe(f.selector)||x.classList.add("grabby-comment-missing"),x.addEventListener("mouseenter",()=>e.onHover(m)),x.addEventListener("mouseleave",()=>e.onHover(null)),x.addEventListener("click",b=>{b.stopPropagation(),e.onEdit(m,x)}),x.addEventListener("keydown",b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),e.onEdit(m,x)),(b.key==="Delete"||b.key==="Backspace")&&(b.preventDefault(),e.onDelete(m))}),x}function l(m){let p=a();s();let f=m.length,g=new Set(m.map(y=>y.author.anonymous?y.author.sessionId:y.author.name)).size>1||m.some(y=>!y.author.anonymous),h=w("div",{class:"grabby-panel-header"},w("span",{class:"grabby-panel-title"},n?"Your feedback":"Comments",w("span",{class:"grabby-panel-count"},String(f))),f>0&&!n?w("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-all":"",onclick:y=>{y.stopPropagation(),e.onCopyAll()}},"Copy all\u2026"):null),x=f===0?w("div",{class:"grabby-panel-empty"},w("strong",null,n?"Nothing sent yet":"No comments yet"),n?"Click Comment, then click the part of the page you want to talk about.":"Click the hand icon (or press Alt+G), then click anything on the page to comment on it."):w("div",{class:"grabby-panel-list"},...m.map(y=>c(y,g))),b=t.identityLabel?.()??null,v=null;n&&b?v=w("div",{class:"grabby-panel-footer"},w("span",null,`Commenting as ${b}`),w("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-change-identity":"",onclick:y=>{y.stopPropagation(),e.onChangeIdentity?.()}},"Change")):!n&&f>0&&(v=w("div",{class:"grabby-panel-footer"},w("span",null,"Click a comment to edit it"),w("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-clear-all":"",onclick:y=>{y.stopPropagation(),e.onClearAll()}},"Clear all"))),p.replaceChildren(h,x,...v?[v]:[])}return{show(m){l(m),r=!0,a().offsetHeight,a().classList.add("grabby-popover-visible")},refresh(m){r&&l(m)},hide(){r=!1,o?.classList.remove("grabby-popover-visible")},isVisible(){return r},isPanelElement(m){return!!o&&(m===o||o.contains(m))},dispose(){s(),o?.remove(),R(xo),o=null,r=!1}}}var z="__grabby-comment-popover__",Ut="__grabby-comment-styles__";function So(e){let t=null,n=null,o=!1,r={mode:"new"},i=null,a=!1,s="comment",u="",c=null,l="";function m(){G(Ut)||_(Ut,`
|
|
414
|
+
#${z} {
|
|
410
415
|
position: fixed;
|
|
411
416
|
z-index: ${2147483647};
|
|
412
417
|
background: var(--grabby-popover-bg, #ffffff);
|
|
@@ -426,7 +431,7 @@ ${t.join(`
|
|
|
426
431
|
from { opacity: 0; transform: scale(0.96); }
|
|
427
432
|
to { opacity: 1; transform: scale(1); }
|
|
428
433
|
}
|
|
429
|
-
#${
|
|
434
|
+
#${z} textarea {
|
|
430
435
|
width: 100%;
|
|
431
436
|
min-height: 64px;
|
|
432
437
|
padding: 8px 10px;
|
|
@@ -439,39 +444,39 @@ ${t.join(`
|
|
|
439
444
|
outline: none;
|
|
440
445
|
box-sizing: border-box;
|
|
441
446
|
}
|
|
442
|
-
#${
|
|
447
|
+
#${z} textarea:focus {
|
|
443
448
|
border-color: var(--grabby-accent, #2563eb);
|
|
444
449
|
}
|
|
445
|
-
#${
|
|
450
|
+
#${z} textarea::placeholder {
|
|
446
451
|
color: var(--grabby-text-muted, #94a3b8);
|
|
447
452
|
}
|
|
448
|
-
#${
|
|
449
|
-
#${
|
|
450
|
-
#${
|
|
453
|
+
#${z} .grabby-cp-title { font: 600 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-popover-text, #334155); }
|
|
454
|
+
#${z} .grabby-cp-sub { font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-text-muted, #94a3b8); }
|
|
455
|
+
#${z} .grabby-cp-name {
|
|
451
456
|
width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; outline: none;
|
|
452
457
|
border: 1px solid var(--grabby-popover-border, #e2e8f0); background: var(--grabby-surface, #f1f5f9);
|
|
453
458
|
color: var(--grabby-popover-text, #334155); font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
454
459
|
}
|
|
455
|
-
#${
|
|
456
|
-
#${
|
|
457
|
-
#${
|
|
460
|
+
#${z} .grabby-cp-name:focus { border-color: var(--grabby-accent, #2563eb); }
|
|
461
|
+
#${z} .grabby-cp-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
|
|
462
|
+
#${z} .grabby-cp-post {
|
|
458
463
|
font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 8px 14px; border-radius: 8px; cursor: pointer;
|
|
459
464
|
border: 1px solid var(--grabby-accent, #2563eb); background: var(--grabby-accent, #2563eb); color: #fff;
|
|
460
465
|
}
|
|
461
|
-
#${
|
|
466
|
+
#${z} .grabby-cp-link {
|
|
462
467
|
font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 8px 4px; border: none;
|
|
463
468
|
background: transparent; color: var(--grabby-text-muted, #64748b); cursor: pointer; text-decoration: underline;
|
|
464
469
|
}
|
|
465
|
-
#${
|
|
470
|
+
#${z} .grabby-cp-hint {
|
|
466
471
|
font-size: 11px;
|
|
467
472
|
color: var(--grabby-text-muted, #94a3b8);
|
|
468
473
|
white-space: nowrap;
|
|
469
474
|
text-align: right;
|
|
470
475
|
}
|
|
471
|
-
`)}function
|
|
472
|
-
#${
|
|
476
|
+
`)}function p(){if(t)return t;m(),t=document.createElement("div"),t.id=z,t.setAttribute("role","dialog"),t.setAttribute("aria-label","Comment"),n=document.createElement("textarea"),n.placeholder="What should change here?",n.rows=3;let y=document.createElement("span");return y.className="grabby-cp-hint",y.textContent="\u21B5 save \xB7 Esc cancel \xB7 \u21E7\u21B5 newline",t.appendChild(n),t.appendChild(y),N().appendChild(t),t}function f(y,T){let S=window.innerWidth,I=window.innerHeight,j=300,ge=120;if(!T){y.style.left="50%",y.style.top="24px",y.style.transform="translateX(-50%)";return}let U=T.getBoundingClientRect(),he,ee;U.right+16+j<=S?(he=U.right+16,ee=U.top+U.height/2-ge/2):U.left-16-j>=0?(he=U.left-16-j,ee=U.top+U.height/2-ge/2):U.bottom+12+ge<=I?(he=Math.max(12,Math.min(U.left,S-j-12)),ee=U.bottom+12):(he=Math.max(12,Math.min(U.left,S-j-12)),ee=Math.max(12,U.top-12-ge)),ee=Math.max(12,Math.min(ee,I-ge-12)),y.style.transform="",y.style.left=`${he}px`,y.style.top=`${ee}px`}function E(y){return!!y&&y!==n&&y!==c&&ve(y)}function g(y){let T=r,S=u;v(),y?e.onSubmit(S,T,y):e.onSubmit(S,T)}function h(){if(!t)return;s="identity",c=w("input",{type:"text",class:"grabby-cp-name",placeholder:"Your name",maxlength:"80",autocomplete:"name","aria-label":"Your name"});let y=()=>g({name:c?.value.trim()||null});t.replaceChildren(w("div",{class:"grabby-cp-title"},"Thanks! Who is this from?"),w("div",{class:"grabby-cp-sub"},"Your name helps the team follow up. It's remembered in this browser."),c,w("div",{class:"grabby-cp-actions"},w("button",{type:"button",class:"grabby-cp-link","data-grabby-anonymous":"",onclick:T=>{T.stopPropagation(),g({name:null})}},"Post anonymously"),w("button",{type:"button",class:"grabby-cp-post","data-grabby-post":"",onclick:T=>{T.stopPropagation(),y()}},"Post"))),c.focus()}function x(){i||(i=y=>{if(!o)return;if(s==="identity"){if(y.key==="Escape"){y.preventDefault(),y.stopImmediatePropagation();let S=r;v(),e.onCancel(S)}else y.key==="Enter"&&Tt()===c&&(y.preventDefault(),y.stopImmediatePropagation(),g({name:c?.value.trim()||null}));return}if(!n)return;let T=Tt();if(T!==n){if(E(T))return;n.focus()}if(y.stopImmediatePropagation(),y.key==="Enter"&&!y.shiftKey){y.preventDefault();let S=n.value.trim();if(!S)return;u=S,a?h():g()}else if(y.key==="Escape"){y.preventDefault();let S=r;v(),e.onCancel(S)}},document.addEventListener("keydown",i,!0))}function b(){i&&(document.removeEventListener("keydown",i,!0),i=null)}function v(){o=!1,t?.remove(),t=null,n=null,c=null,s="comment",b()}return{show(y){v();let T=p();l=y.initialValue??"",n.value=l,r={mode:y.mode,entryId:y.entryId},a=y.askIdentity===!0&&y.mode==="new",o=!0,f(T,y.anchor),x(),n?.focus(),requestAnimationFrame(()=>n?.focus())},hide(){o&&v()},isVisible(){return o},hasDraft(){if(!o)return!1;if(s==="identity")return!0;let y=n?.value.trim()??"";return y!==""&&y!==l.trim()},isPopoverElement(y){if(!t)return!1;let T=y;for(;T;){if(T===t||T.id===z)return!0;T=T.parentElement}return!1},dispose(){v(),R(Ut)}}}var ko="__grabby-copy-sheet__",Co="copy-sheet",To=[{id:"compact",label:"Compact",hint:"One line per comment: file, component and your note."},{id:"standard",label:"Standard",hint:"Adds the element, its key facts and styles. Best for most fixes."},{id:"detailed",label:"Detailed",hint:"Adds ancestors, position and all custom styles, for tricky layout bugs."}],Ma=`
|
|
477
|
+
#${ko} {
|
|
473
478
|
position: fixed;
|
|
474
|
-
bottom: ${
|
|
479
|
+
bottom: ${se};
|
|
475
480
|
left: 50%;
|
|
476
481
|
transform: translateX(-50%);
|
|
477
482
|
z-index: ${2147483647};
|
|
@@ -515,10 +520,10 @@ ${t.join(`
|
|
|
515
520
|
.grabby-sheet .grabby-btn:hover { background: var(--grabby-popover-hover, #f1f5f9); }
|
|
516
521
|
.grabby-sheet .grabby-btn-primary { background: var(--grabby-accent, #2563eb); border-color: var(--grabby-accent, #2563eb); color: #fff; }
|
|
517
522
|
.grabby-sheet .grabby-btn-primary:hover { background: var(--grabby-accent-hover, #1d4ed8); }
|
|
518
|
-
`;function
|
|
519
|
-
#${
|
|
523
|
+
`;function Da(){return typeof navigator<"u"&&/Mac|iPhone|iPad/i.test(navigator.platform||navigator.userAgent)}function Ao(e){let t=null,n=null;function o(){t&&(t.remove(),t=null,n&&(document.removeEventListener("keydown",n,!0),n=null),e.onClose?.())}function r(i){o(),_(Co,Ma);let a=i.level,s=!1,u=Da()?"\u2318":"Ctrl",c=w("span",{class:"grabby-sheet-tokens"}),l=w("div",{class:"grabby-sheet-hint"}),m=w("div",{class:"grabby-sheet-status",role:"status","aria-live":"polite"}),p=w("textarea",{"aria-label":"Text that will be copied",spellcheck:"false"}),f=new Map;function E(){c.textContent=`\u2248 ${ho(p.value).toLocaleString()} tokens`}function g(v,y=!1){if(v===a&&!y)return;let T=s&&v!==a;a=v,s=!1,p.value=i.render(a),l.textContent=To.find(S=>S.id===a)?.hint??"";for(let[S,I]of f)I.setAttribute("aria-checked",String(S===a));m.classList.remove("grabby-error"),m.textContent=T?"Your edits were replaced by the new detail level.":"",E(),e.onLevelChange?.(a)}let h=w("div",{class:"grabby-seg",role:"radiogroup","aria-label":"Detail level"},...To.map(v=>{let y=w("button",{type:"button",role:"radio","aria-checked":"false",title:v.hint,onclick:T=>{T.stopPropagation(),g(v.id)}},v.label);return f.set(v.id,y),y}));async function x(v){if(await e.onCopy(p.value,v,a)){o();return}p.focus(),p.select(),m.classList.add("grabby-error"),m.textContent=`The browser blocked the clipboard. The text is selected; press ${u}+C to copy it.`}p.addEventListener("input",()=>{s=!0,E()});let b=i.count;t=w("div",{id:ko,class:"grabby-sheet",role:"dialog","aria-modal":"false","aria-label":"Copy comments"},w("div",{class:"grabby-sheet-head"},w("span",{class:"grabby-sheet-title"},`Copy ${b} comment${b===1?"":"s"} for your AI agent`),c),h,l,p,m,w("div",{class:"grabby-sheet-actions"},w("span",{class:"grabby-spacer"},`${u}+Enter copies and clears \xB7 Esc closes`),w("button",{type:"button",class:"grabby-btn","data-grabby-copy-keep":"",onclick:v=>{v.stopPropagation(),x("keep")}},"Copy, keep comments"),w("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-clear":"",onclick:v=>{v.stopPropagation(),x("clear")}},"Copy & clear"))),n=v=>{t&&(v.key==="Escape"?(v.preventDefault(),v.stopImmediatePropagation(),o()):v.key==="Enter"&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),v.stopImmediatePropagation(),x("clear")))},document.addEventListener("keydown",n,!0),N().appendChild(t),g(a,!0),t.querySelector("[data-grabby-copy-clear]")?.focus()}return{open:r,close:o,isVisible:()=>!!t,isSheetElement:i=>!!t&&(i===t||t.contains(i)),dispose(){o(),R(Co)}}}var Ro="__grabby-finish-sheet__",_o="finish-sheet",Oa=15e3,Fa=3e3,Ha=`
|
|
524
|
+
#${Ro} {
|
|
520
525
|
position: fixed;
|
|
521
|
-
bottom: ${
|
|
526
|
+
bottom: ${se};
|
|
522
527
|
left: 50%;
|
|
523
528
|
transform: translateX(-50%);
|
|
524
529
|
z-index: ${2147483647};
|
|
@@ -549,29 +554,29 @@ ${t.join(`
|
|
|
549
554
|
.grabby-finish .grabby-btn[disabled] { opacity: .6; cursor: default; }
|
|
550
555
|
.grabby-finish .grabby-btn-primary { background: var(--grabby-accent, #2563eb); border-color: var(--grabby-accent, #2563eb); color: #fff; }
|
|
551
556
|
.grabby-finish .grabby-btn-primary:hover { background: var(--grabby-accent-hover, #1d4ed8); }
|
|
552
|
-
`;function
|
|
553
|
-
#${
|
|
554
|
-
position: fixed; bottom: ${
|
|
557
|
+
`;function Bt(e,t){return`${e} ${t}${e===1?"":"s"}`}function Io(e){let t=null,n=null,o={total:0,sent:0,pending:0,failed:0},r=!1,i=null,a=null,s=!1;function u(){r=!1,i&&clearTimeout(i),a&&clearInterval(a),i=null,a=null}function c(){u(),s=!1,t&&(t.remove(),t=null,n&&(document.removeEventListener("keydown",n,!0),n=null))}function l(){c(),e.onDone()}function m(){if(o.pending===0||s){l();return}r=!0,e.onRetry(),a=setInterval(e.onRetry,Fa),i=setTimeout(()=>{u(),s=!0,f()},Oa),f()}function p(E,g,h=!1,x=!1){let b=w("button",{type:"button",class:h?"grabby-btn grabby-btn-primary":"grabby-btn",onclick:v=>{v.stopPropagation(),g()}},E);return b.disabled=x,b}function f(){if(!t)return;let{total:E,sent:g,pending:h,failed:x}=o,b=[],v="";E===0?b.push(w("div",{class:"grabby-finish-line"},"You haven't left any comments yet.")):h===0&&x===0?(b.push(w("div",{class:"grabby-finish-line","data-tone":"ok"},E===1?"\u2713 Your comment was sent to the team.":`\u2713 All ${E} comments were sent to the team.`)),v="Press Done to start a fresh list, or just close this tab."):(g&&b.push(w("div",{class:"grabby-finish-line","data-tone":"ok"},`\u2713 ${Bt(g,"comment")} sent to the team`)),h&&b.push(w("div",{class:"grabby-finish-line"},`${Bt(h,"comment")} still sending\u2026`)),x&&b.push(w("div",{class:"grabby-finish-line","data-tone":"error"},`${Bt(x,"comment")} couldn't be sent`)),s&&h?v="They're saved in this browser and will be sent the next time you open this site. You can close this tab.":h?v="Keep this tab open for a moment.":x&&(v="Try again, or let the team know your feedback didn't go through."));let y=[p("Keep reviewing",c)];x&&y.push(p("Try again",e.onRetry)),E===0?y.push(p("Exit feedback mode",l,!0)):r?y.push(p("Sending\u2026",()=>{},!0,!0)):y.push(p("Done",m,!0)),t.replaceChildren(w("div",{class:"grabby-finish-title"},"Your review"),w("div",{class:"grabby-finish-lines",role:"status","aria-live":"polite"},...b),...v?[w("div",{class:"grabby-finish-note"},v)]:[],w("div",{class:"grabby-finish-actions"},...y)),t.querySelector(".grabby-btn-primary:not([disabled])")?.focus()}return{open(E){c(),_(_o,Ha),o=E,t=w("div",{id:Ro,class:"grabby-finish",role:"dialog","aria-modal":"false","aria-label":"Finish review"}),n=g=>{t&&g.key==="Escape"&&(g.preventDefault(),g.stopImmediatePropagation(),c())},document.addEventListener("keydown",n,!0),N().appendChild(t),f()},update(E){if(t){if(o=E,r&&E.pending===0&&(u(),E.failed===0)){l();return}f()}},close:c,isVisible:()=>!!t,isSheetElement:E=>!!t&&(E===t||t.contains(E)),dispose(){c(),R(_o)}}}var me="__grabby-coach__",No="coach-mark",Lo="grabby:v1:onboarded",Ua=`
|
|
558
|
+
#${me} {
|
|
559
|
+
position: fixed; bottom: ${se}; left: 50%; transform: translateX(-50%);
|
|
555
560
|
z-index: ${2147483647}; width: min(320px, calc(100vw - 32px)); box-sizing: border-box;
|
|
556
561
|
padding: 14px 16px; border-radius: 12px; background: #0f172a; color: #f8fafc;
|
|
557
562
|
font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
558
563
|
box-shadow: 0 12px 32px rgba(15, 23, 42, .3); animation: grabby-coach-in .2s ease;
|
|
559
564
|
}
|
|
560
|
-
#${
|
|
565
|
+
#${me}::after {
|
|
561
566
|
content: ''; position: absolute; bottom: -6px; left: 50%; margin-left: -6px;
|
|
562
567
|
border: 6px solid transparent; border-bottom: 0; border-top-color: #0f172a;
|
|
563
568
|
}
|
|
564
569
|
@keyframes grabby-coach-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
|
|
565
|
-
#${
|
|
566
|
-
#${
|
|
567
|
-
#${
|
|
568
|
-
#${
|
|
570
|
+
#${me} strong { display: block; font-size: 14px; margin-bottom: 6px; }
|
|
571
|
+
#${me} ol { margin: 0 0 10px; padding-left: 20px; }
|
|
572
|
+
#${me} li { margin: 2px 0; }
|
|
573
|
+
#${me} button {
|
|
569
574
|
font: 600 12px/1 inherit; font-family: inherit; padding: 7px 12px; border-radius: 7px; border: 0;
|
|
570
575
|
background: #f8fafc; color: #0f172a; cursor: pointer; float: right;
|
|
571
576
|
}
|
|
572
|
-
#${
|
|
573
|
-
`;function
|
|
574
|
-
#${
|
|
577
|
+
#${me} .grabby-coach-foot { overflow: hidden; color: #94a3b8; font-size: 12px; line-height: 28px; }
|
|
578
|
+
`;function Ba(){try{return localStorage.getItem(Lo)==="1"}catch{return!1}}function Ga(){try{localStorage.setItem(Lo,"1")}catch{}}function $o(){let e=null;function t(){Ga(),e?.remove(),e=null}return{maybeShow(){e||Ba()||(_(No,Ua),e=w("div",{id:me,role:"dialog","aria-label":"How to leave feedback"},w("strong",null,"Leave feedback on this page"),w("ol",null,w("li",null,"Click ",w("b",null,"Comment")," below."),w("li",null,"Click the part of the page you want to talk about."),w("li",null,"Type your note and press Enter.")),w("div",{class:"grabby-coach-foot"},"A screenshot is attached for you.",w("button",{type:"button",onclick:n=>{n.stopPropagation(),t()}},"Got it"))),N().appendChild(e))},dismiss:t,dispose(){e?.remove(),e=null,R(No)}}}var Gt="grabby:v1:outbox",Po=[2e3,1e4,3e4,12e4,3e5,6e5],Va=336*60*60*1e3,Mo=6e4;function za(){try{let e=localStorage.getItem(Gt),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n.id=="string"&&(n.kind==="comment"||n.kind==="shot"||n.kind==="delete"&&typeof n.session=="string")).map(n=>typeof n.created=="number"?n:{...n,created:Date.now()}):[]}catch{return[]}}function Ka(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t--;return e.slice(0,t)}function Vt(e){let t=Ka(e.server),n=za().map(h=>({...h,next:0})),o=null,r=!1,i=!1;function a(){try{n.length?localStorage.setItem(Gt,JSON.stringify(n)):localStorage.removeItem(Gt)}catch{}}function s(h={}){return{...e.projectKey?{"X-Grabby-Key":e.projectKey}:{},...h}}function u(h,x){n.some(b=>b.id===h&&b.kind===x)||(n.push({id:h,kind:x,attempts:0,next:0,created:Date.now()}),a(),c(0))}function c(h){i||(o&&clearTimeout(o),o=setTimeout(()=>{o=null,E()},h))}function l(h){let{screenshot:x,sync:b,...v}=h;return v}function m(h){let x=JSON.stringify({comment:l(h)});return fetch(`${t}/v1/comments`,{method:"POST",credentials:"omit",keepalive:x.length<Mo,headers:s({"Content-Type":"application/json"}),body:x})}function p(h,x){return fetch(`${t}/v1/comments/${encodeURIComponent(h)}`,{method:"DELETE",credentials:"omit",keepalive:!0,headers:s({"X-Grabby-Session":x})})}async function f(h){if(h.kind==="delete"){let I=await p(h.id,h.session);return I.ok||I.status===404?"done":I.status===429||I.status>=500?"retry":"drop"}let x=e.getComment(h.id);if(!x)return"drop";if(h.kind==="comment"){let I=await m(x);return I.ok?(e.getComment(h.id)?.screenshot?.localId&&u(h.id,"shot"),"done"):I.status===429||I.status>=500?"retry":(e.onState(h.id,"failed",await I.text().catch(()=>String(I.status))),"drop")}let b=x.screenshot?.localId,v=b?await e.getScreenshot(b):null;if(!v)return"drop";let{width:y,height:T}=x.screenshot,S=await fetch(`${t}/v1/comments/${encodeURIComponent(h.id)}/screenshot?w=${y}&h=${T}`,{method:"PUT",credentials:"omit",keepalive:v.size<Mo,headers:s({"Content-Type":v.type||"image/webp","X-Grabby-Session":x.author.sessionId}),body:v});return S.ok||S.status>=400&&S.status<500&&S.status!==429?S.ok?"done":"drop":"retry"}async function E(){if(r||i)return;r=!0;try{let x=Date.now();for(let b of[...n].sort((v,y)=>v.next-y.next)){if(b.next>x)continue;let v;try{v=await f(b)}catch{v="retry"}v==="retry"&&Date.now()-b.created<Va?(b.attempts+=1,b.next=Date.now()+Po[Math.min(b.attempts-1,Po.length-1)],b.kind==="comment"&&e.onState(b.id,"pending")):(n=n.filter(y=>y!==b),b.kind==="comment"&&v==="done"&&e.onState(b.id,"sent"),b.kind==="comment"&&v==="retry"&&e.onState(b.id,"failed","could not reach the feedback server for 14 days")),a()}}finally{r=!1}let h=n.reduce((x,b)=>Math.min(x,b.next),1/0);h!==1/0&&c(Math.max(0,h-Date.now()))}let g=()=>{for(let h of n)h.next=0;c(0)};return typeof window<"u"&&window.addEventListener("online",g),n.length&&c(500),{send:h=>u(h,"comment"),remove(h,x,b=0){n=n.filter(v=>v.id!==h),n.push({id:h,kind:"delete",session:x,attempts:0,next:Date.now()+b,created:Date.now()}),a(),c(0)},cancelRemove(h){let x=n.find(b=>b.id===h&&b.kind==="delete");return x?(n=n.filter(b=>b!==x),a(),x.attempts===0):!1},sendScreenshot:h=>{n.some(x=>x.id===h&&x.kind==="comment")||u(h,"shot")},isQueued:h=>n.some(x=>x.id===h),flush:g,flushOnExit(){for(let h of n){if(h.kind==="delete"){h.attempts+=1,p(h.id,h.session).catch(()=>{});continue}if(h.kind!=="comment")continue;let x=e.getComment(h.id);x&&m(x).catch(()=>{})}a()},dispose(){i=!0,o&&clearTimeout(o),typeof window<"u"&&window.removeEventListener("online",g)}}}var Do="grabby",zt="grabby:v1:live";function Kt(){try{return window.sessionStorage}catch{return null}}function ja(){return Kt()?.getItem(zt)==="1"}function ct(){try{Kt()?.setItem(zt,"1")}catch{}}function jt(){try{Kt()?.removeItem(zt)}catch{}}function Oo(e){try{let t=new URL(window.location.href),n=t.searchParams.get(Do);n!==null&&(n&&(!e||n===e)&&ct(),t.searchParams.delete(Do),window.history.replaceState(window.history.state,"",t.pathname+t.search+t.hash))}catch{}return ja()}var Wt="__grabby-freeze-overlay__",Yt="__grabby-freeze-styles__",Fo="__grabby-freeze-hover-styles__",Ho="__grabby-freeze-anim-styles__",Xt="data-grabby-hover",Uo=["mouseenter","mouseleave","mouseover","mouseout","pointerenter","pointerleave","pointerover","pointerout"],Bo=["focus","blur","focusin","focusout"];function Go(){let e=null,t=!1,n=!1,o=!1,r=[];function i(){G(Yt)||_(Yt,`
|
|
579
|
+
#${Wt} {
|
|
575
580
|
position: fixed;
|
|
576
581
|
top: 0;
|
|
577
582
|
left: 0;
|
|
@@ -581,14 +586,14 @@ ${t.join(`
|
|
|
581
586
|
pointer-events: auto;
|
|
582
587
|
background: transparent;
|
|
583
588
|
}
|
|
584
|
-
`)}function
|
|
585
|
-
`),"document"),n=!0)}function
|
|
586
|
-
`)} }`)}}function
|
|
589
|
+
`)}function a(){return e||(i(),e=document.createElement("div"),e.id=Wt,e.style.display="none",N().appendChild(e),e)}let s=b=>{b.stopImmediatePropagation()},u=b=>{b.preventDefault(),b.stopImmediatePropagation()};function c(){for(let b of Uo)document.addEventListener(b,s,!0);for(let b of Bo)document.addEventListener(b,u,!0)}function l(){for(let b of Uo)document.removeEventListener(b,s,!0);for(let b of Bo)document.removeEventListener(b,u,!0)}function m(b){let v=b;for(;v&&v!==document.documentElement;)v.setAttribute(Xt,""),r.push(v),v=v.parentElement}function p(){for(let b of r)b.removeAttribute(Xt);r=[]}function f(){if(n)return;let b=[];for(let v of Array.from(document.styleSheets)){let y;try{y=v.cssRules}catch{continue}E(y,b)}b.length!==0&&(_(Fo,b.join(`
|
|
590
|
+
`),"document"),n=!0)}function E(b,v){for(let y of Array.from(b))if(y instanceof CSSStyleRule){if(y.selectorText.includes(":hover")){let T=y.selectorText.replace(/:hover/g,`[${Xt}]`);v.push(`${T} { ${y.style.cssText} }`)}}else if(y instanceof CSSMediaRule){let T=[];E(y.cssRules,T),T.length>0&&v.push(`@media ${y.conditionText} { ${T.join(`
|
|
591
|
+
`)} }`)}}function g(){R(Fo),n=!1}function h(){o||(_(Ho,`
|
|
587
592
|
*, *::before, *::after {
|
|
588
593
|
animation-play-state: paused !important;
|
|
589
594
|
transition: none !important;
|
|
590
595
|
}
|
|
591
|
-
`,"document"),o=!0)}function
|
|
596
|
+
`,"document"),o=!0)}function x(){R(Ho),o=!1}return{show(b){c(),b&&(m(b),f()),h();let v=a();v.style.display="block",t=!0},hide(){e&&(e.style.display="none"),t=!1,p(),g(),x(),l()},isVisible(){return t},isFreezeElement(b){return b===e||b.id===Wt},getElement(){return e},dispose(){p(),g(),x(),l(),e?.remove(),R(Yt),e=null,t=!1}}}var qt="__grabby-feedback-styles__";function Wa(){G(qt)||_(qt,`
|
|
592
597
|
@keyframes grabby-flash {
|
|
593
598
|
0% { opacity: 1; }
|
|
594
599
|
100% { opacity: 0; transform: scale(1.02); }
|
|
@@ -632,4 +637,4 @@ ${t.join(`
|
|
|
632
637
|
height: 10px;
|
|
633
638
|
flex-shrink: 0;
|
|
634
639
|
}
|
|
635
|
-
`)}function Lo(e,t="Selected"){$i();let n=e.getBoundingClientRect(),o=document.createElement("div");o.className="grabby-select-flash",o.style.top=`${n.top}px`,o.style.left=`${n.left}px`,o.style.width=`${n.width}px`,o.style.height=`${n.height}px`,N().appendChild(o);let r=document.createElement("div");r.className="grabby-select-pill",r.append(le(Mn),` ${t}`),N().appendChild(r);let a=70,i=n.left+n.width/2-a/2,s=n.top-24;s<4&&(s=n.bottom+6);let u=document.documentElement.clientWidth;i+a>u-4&&(i=u-a-4),i<4&&(i=4),r.style.top=`${s}px`,r.style.left=`${i}px`;let l=()=>{o.remove(),r.remove()};r.addEventListener("animationend",l),setTimeout(l,1200)}function Po(){R(Kt)}var Be="grabby:v1:comments";var me=null,He=null,Ue=null,Mo=!1,Li=100;function Wt(){try{let e=localStorage.getItem(Be);if(!e)return[];let t=JSON.parse(e);return!t||typeof t!="object"||t.v!==1||!Array.isArray(t.entries)?[]:t.entries}catch{try{localStorage.removeItem(Be)}catch{}return[]}}function Yt(e){Ue=e,!(me!=null||He!=null)&&(me=requestAnimationFrame(_e),He=setTimeout(_e,Li))}function _e(){if(me!=null&&(cancelAnimationFrame(me),me=null),He!=null&&(clearTimeout(He),He=null),Ue==null)return;let e=Ue;Ue=null,Pi(e)}function Pi(e){let t={v:1,entries:e};try{localStorage.setItem(Be,JSON.stringify(t))}catch(n){if(Mi(n)){let o=e.slice(0,Math.floor(e.length/2));try{localStorage.setItem(Be,JSON.stringify({v:1,entries:o}))}catch{Do()}}else Do()}}function Mi(e){if(!e||typeof e!="object")return!1;let t=e;return t.name==="QuotaExceededError"||t.code===22}function Do(){Mo||(Mo=!0,console.warn("[grabby] saving comments to localStorage failed (quota or other error)."))}function Oo(){me!=null&&(cancelAnimationFrame(me),me=null),Ue=null;try{localStorage.removeItem(Be)}catch{}}var K=null,qt=new Map;function Di(){if(K?.isConnected&&K.contentDocument)return K.contentDocument;try{return K=document.createElement("iframe"),K.setAttribute("aria-hidden","true"),K.setAttribute("tabindex","-1"),K.setAttribute("data-grabby-ignore",""),Object.assign(K.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(K),K.contentDocument}catch{return null}}function Oi(e,t,n){let o=t?`${e}[${t}]`:e,r=qt.get(o);r||(r=new Map,qt.set(o,r));let a=n.filter(i=>!r.has(i));if(a.length>0){let i=Di(),s=i?.defaultView;if(i?.body&&s){let u=i.createElement(e);t&&u.setAttribute("type",t),i.body.appendChild(u);let l=s.getComputedStyle(u);for(let c of a)r.set(c,l.getPropertyValue(c));u.remove()}else for(let u of a)r.set(u,"")}return r}function Fo(){K?.remove(),K=null,qt.clear()}function Xt(e){return Math.round(e).toString(16).padStart(2,"0")}function Fi(e){let t=e.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?\s*\)$/);if(!t)return e;let[n,o,r]=[Number(t[1]),Number(t[2]),Number(t[3])],a=t[4]===void 0?1:t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]);if(a===0)return"transparent";let i=`#${Xt(n)}${Xt(o)}${Xt(r)}`;return a>=1?/^#(.)\1(.)\2(.)\3$/.test(i)?`#${i[1]}${i[3]}${i[5]}`:i:(a=Math.round(a*100)/100,`${i} ${Math.round(a*100)}%`)}function Hi(e,t){let n=t.trim().replace(/(\d+\.\d{2,})px/g,(r,a)=>`${Math.round(Number(a)*10)/10}px`);/color|background|border|shadow|fill|stroke/.test(e)&&(n=n.replace(/rgba?\([^)]*\)/g,r=>Fi(r))),e==="font-family"&&(n=n.split(",")[0].replace(/["']/g,"").trim());let o=n.split(" ");return o.length===4&&o.every(r=>r===o[0])?n=o[0]:o.length===4&&o[0]===o[2]&&o[1]===o[3]&&(n=`${o[0]} ${o[1]}`),n}function we(e,t){let n={},o;try{o=getComputedStyle(e)}catch{return n}let r=e.tagName.toLowerCase(),a=r==="input"||r==="button"?e.getAttribute("type"):null,i=Oi(r,a,t);for(let s of t){let u=o.getPropertyValue(s);!u||u===i.get(s)||u==="none"||u==="normal"||u==="auto"||u==="rgba(0, 0, 0, 0)"||/^border/.test(s)&&(/^0px\b/.test(u)||/\bnone\b/.test(u))||(n[s]=Hi(s,u))}return n}var Ui={"background-color":"bg","border-radius":"radius","font-size":"size","font-weight":"weight","line-height":"line-height","font-family":"font","box-shadow":"shadow","flex-direction":"direction","grid-template-columns":"columns","justify-content":"justify","align-items":"align","text-align":"text-align","object-fit":"fit"};function xe(e){return Object.entries(e).map(([t,n])=>`${Ui[t]??t} ${t==="box-shadow"?"yes":n}`).join(" \xB7 ")}var Bi=["background-color","color","font-size","font-weight","padding","border-radius","border"],Gi=["background-color","border","border-radius","padding","font-size"],Vi=["font-size","font-weight","line-height","color","font-family","text-align","letter-spacing"],zi=["object-fit","border-radius","aspect-ratio"],ji=["display","flex-direction","gap","grid-template-columns","justify-content","align-items","padding","max-width","background-color","border-radius","box-shadow","border"],Ki=["margin","color","background-color","font-size","font-weight","line-height","display","position","z-index","opacity","overflow","box-shadow","border"];function A(e,t,n){n!=null&&n!==""&&(e[t]=n)}function Uo(e){let t=e.getBoundingClientRect();return t.width||t.height?`${Math.round(t.width)}\xD7${Math.round(t.height)}`:""}function Wi(e){let t=e.getAttribute("aria-labelledby");return t?t.split(/\s+/).map(n=>e.ownerDocument.getElementById(n)).filter(n=>!!n).map(n=>ne(n,60)).join(" "):""}function Zt(e){return O(e.getAttribute("aria-label")??"")||Wi(e)}function Yi(e){let t=[];(e.disabled||e.getAttribute("aria-disabled")==="true")&&t.push("disabled");for(let n of["aria-expanded","aria-pressed","aria-selected","aria-checked"]){let o=e.getAttribute(n);o!==null&&t.push(`${n.slice(5)}=${o}`)}return e.getAttribute("aria-current")&&t.push("current"),t.join(", ")}function Xi(e){let t={},n=e.querySelector("img[alt]")?.getAttribute("alt")??"";return A(t,"label",Zt(e)||ne(e,80)||O(e.getAttribute("title")??"")||O(n)),e.tagName==="A"?A(t,"href",Me(e.getAttribute("href")??"")):(e.tagName==="BUTTON"||e.tagName==="INPUT")&&A(t,"type",e.getAttribute("type")??(e.tagName==="BUTTON"?"submit":"")),A(t,"state",Yi(e)),A(t,"styles",xe(we(e,Bi))),t}function qi(e){let t=e.labels;return t&&t.length>0?ne(t[0],60):Zt(e)||O(e.getAttribute("placeholder")??"",{keepEmails:!0})}function Zi(e){let t={};A(t,"label",qi(e));let n=e.tagName==="INPUT"?e.type||"text":e.tagName.toLowerCase();A(t,"type",n),A(t,"placeholder",O(e.getAttribute("placeholder")??"",{keepEmails:!0}));let o=[];return(e.required||e.getAttribute("aria-required")==="true")&&o.push("required"),e.disabled&&o.push("disabled"),e.getAttribute("aria-invalid")==="true"&&o.push("invalid"),A(t,"state",o.join(", ")),e.tagName==="SELECT"&&A(t,"options",String(e.options.length)),A(t,"styles",xe(we(e,Gi))),t}function Ji(e){let t={};return A(t,"text",ne(e,120)),A(t,"styles",xe(we(e,Vi))),t}function Ho(e){let t=Me(e);return t.split("/").filter(Boolean).pop()??t}function Qi(e){let t={};if(e.tagName==="IMG"){let n=e;A(t,"alt",n.hasAttribute("alt")?O(n.alt)||"(empty)":"(missing)"),A(t,"src",Ho(n.currentSrc||n.getAttribute("src")||"")),n.naturalWidth&&A(t,"natural",`${n.naturalWidth}\xD7${n.naturalHeight}`)}else e.tagName==="SVG"||e.tagName.toLowerCase()==="svg"?(A(t,"label",Zt(e)||ne(e.querySelector("title")??e,40)),A(t,"viewBox",e.getAttribute("viewBox")??"")):(e.tagName==="VIDEO"||e.tagName==="AUDIO"||e.tagName==="IFRAME")&&(A(t,"src",Ho(e.getAttribute("src")??e.querySelector("source")?.getAttribute("src")??"")),A(t,"title",O(e.getAttribute("title")??"")));return A(t,"size",Uo(e)),A(t,"styles",xe(we(e,zi))),t}function es(e,t){let n=t?.(e);if(n?.name&&n.hostElement===e)return n.name;let o=e.tagName.toLowerCase();return/^h[1-6]$/.test(o)?"heading":o==="a"?"link":o==="img"||o==="svg"?"image":o==="ul"||o==="ol"?"list":o}function Bo(e,t){let n=new Map;for(let r of Array.from(e.children)){if(r.hasAttribute(te)||/^(SCRIPT|STYLE|TEMPLATE)$/.test(r.tagName))continue;let a=es(r,t);n.set(a,(n.get(a)??0)+1)}let o=Array.from(n.entries()).slice(0,6).map(([r,a])=>a>1?`${a}\xD7 ${r}`:r);return n.size>6&&o.push("\u2026"),o.join(", ")}function Go(e){let t=e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]');return t?ne(t,60):""}function ts(e,t){let n={};return A(n,"heading",Go(e)),A(n,"contains",Bo(e,t)),A(n,"size",Uo(e)),A(n,"layout",xe(we(e,ji))),n}function ns(e,t){let n={};A(n,"title",O(e.ownerDocument.title)),A(n,"viewport",`${window.innerWidth}\xD7${window.innerHeight}`);let o=Array.from(e.querySelectorAll('header, nav, main, aside, footer, section, [role="region"]')).filter(r=>!r.parentElement?.closest('header, nav, main, aside, footer, section, [role="region"]')||r.parentElement===e).slice(0,8).map(r=>{let a=Go(r);return a?`${r.tagName.toLowerCase()} "${X(a,30)}"`:r.tagName.toLowerCase()});return A(n,"regions",o.join(", ")),A(n,"contains",Bo(e.tagName==="HTML"?e.ownerDocument.body??e:e,t)),n}function os(e,t){let n=[],o=e.parentElement;for(;o&&n.length<t&&o.tagName!=="BODY"&&o.tagName!=="HTML";){let r=Array.from(o.classList).filter(a=>!a.startsWith("ng-")&&!a.startsWith("_ng")).slice(0,2);n.push(`${o.tagName.toLowerCase()}${r.length?`.${r.join(".")}`:""}`),o=o.parentElement}return n.reverse().join(" > ")}function rs(e,t){let n={},o=e.getBoundingClientRect();return(o.width||o.height)&&A(n,"box",`${Math.round(o.left)},${Math.round(o.top)} ${Math.round(o.width)}\xD7${Math.round(o.height)}`),A(n,"ancestors",os(e,5)),A(n,"computed",xe(we(e,Ki))),t!=="section"&&t!=="field"&&!nt(e)&&A(n,"text",ne(e,240)),n}function Vo(e,t,n){let o;switch(t){case"action":o=Xi(e);break;case"field":o=Zi(e);break;case"text":o=Ji(e);break;case"media":o=Qi(e);break;case"section":o=ns(e,n);break;default:o=ts(e,n)}return{facts:o,extra:rs(e,t)}}var as=3;function Jt(e){return!!e&&!/(^|[\\/])node_modules[\\/]/.test(e)}function is(e,t){let n=t.componentResolver?.(e)??null,o=[],r=[];for(let a of n?.stack??[]){let i=a.filePath!==void 0?{filePath:a.filePath,line:a.line??null}:a.hostElement&&t.sourceResolver?t.sourceResolver(a.hostElement):null,s={name:a.name,file:i?.filePath??null,line:i?.line??null};r.push(s),Jt(s.file)&&o.length<as&&o.push(s)}return{component:n?.name??null,frames:o.length>0?o:r.slice(0,2)}}function ss(e,t,n){let o=t.sourceResolver?.(e);if(o&&Jt(o.filePath))return{file:o.filePath,line:o.line,column:o.column};let r=n.find(a=>Jt(a.file));return r?.file?{file:r.file,line:r.line,column:null}:null}function zo(e,t){let n=t.cleanClasses??(l=>l.filter(c=>!De(c))),o=Vn(e),{component:r,frames:a}=is(e,t),i=ss(e,t,a),{facts:s,extra:u}=Vo(e,o,t.componentResolver);return{kind:o,tag:e.tagName.toLowerCase(),component:r,source:i,stack:a,selector:Hn(e),preview:o==="section"?`<${e.tagName.toLowerCase()}>`:Yn(e,n),facts:s,extra:u}}var Tl=1200,kl=1600,_r=5e3;function Al(e){return e instanceof Element?e.tagName.toLowerCase()===vt?!1:!e.hasAttribute(te):!0}function _l(e){e instanceof HTMLElement&&e.hasAttribute(tt)&&(e.style.filter="blur(8px)")}var an='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',Ke=null,je;function Rl(){let e=window.trustedTypes;if(!e)return an;if(je===void 0)try{je=e.createPolicy("grabby",{createHTML:t=>t===an?t:""})}catch{je=null}return je?je.createHTML(an):null}async function Il(){if(Ke?.isConnected)return Ke;let e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1"),e.setAttribute(te,""),Object.assign(e.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(e);let t=Rl();return t!==null&&await new Promise(n=>{let o=()=>n();e.addEventListener("load",o,{once:!0}),setTimeout(o,1e3);try{e.srcdoc=t}catch{o()}}),Ke=e,e}function Rr(){Ke?.remove(),Ke=null}function Nl(e,t){return new Promise(n=>{let o=setTimeout(()=>n(null),t);e.then(r=>{clearTimeout(o),n(r)},()=>{clearTimeout(o),n(null)})})}async function Ir(e){if(typeof window>"u"||!e.isConnected)return null;let t=e.getBoundingClientRect();if(t.width<1||t.height<1)return null;let n=Math.min(t.width,document.documentElement.scrollWidth||t.width),o=Math.min(t.height,kl),r=window.devicePixelRatio||1,a=Math.min(r,Tl/Math.max(n,o));return Nl((async()=>{let{createContext:s,destroyContext:u,domToBlob:l}=await Promise.resolve().then(()=>(Ar(),kr)),c=await s(e,{width:n,height:o,scale:a,type:"image/webp",quality:.8,filter:Al,onCloneEachNode:_l,style:{margin:"0"},timeout:_r});c.sandbox=await Il();let m;try{m=await l(c)}finally{c.sandbox=void 0,u(c)}return m?{blob:m,width:Math.round(n*a),height:Math.round(o*a)}:null})(),_r+1e3)}var Nr="grabby:v1:session",sn="grabby:v1:author";function We(){let e=typeof crypto<"u"?crypto:void 0;if(e&&typeof e.randomUUID=="function")try{return e.randomUUID()}catch{}let t=new Uint8Array(16);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let o=0;o<16;o++)t[o]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}var $r=null;function dt(){try{let e=localStorage.getItem(Nr);if(e)return e;let t=We();return localStorage.setItem(Nr,t),t}catch{return $r??=We(),$r}}function mt(){try{let e=localStorage.getItem(sn);if(!e)return null;let t=JSON.parse(e);return typeof t!="object"||t===null||typeof t.anonymous!="boolean"?null:{name:typeof t.name=="string"?t.name.slice(0,80):null,anonymous:t.anonymous}}catch{return null}}function Lr(e){try{localStorage.setItem(sn,JSON.stringify(e))}catch{}}function Pr(){try{localStorage.removeItem(sn)}catch{}}function Mr(e){return{name:e&&!e.anonymous?e.name:null,anonymous:!e||e.anonymous||!e.name,sessionId:dt()}}function ft(){return typeof window>"u"?null:window.ng||null}function Ce(e){return e.startsWith("_")?e.slice(1):e}function Dr(e){let t=ft();if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=new Set,r=e;for(;r;){let i=t.getComponent(r);i&&!o.has(i)&&(o.add(i),n.push({name:Ce(i.constructor.name),hostElement:r})),r=r.parentElement}if(n.length===0){let i=e;for(;i;){let s=t.getOwningComponent(i);if(s&&!o.has(s)){o.add(s);let u=i.parentElement;for(;u&&t.getComponent(u)!==s;)u=u.parentElement;for(n.push({name:Ce(s.constructor.name),hostElement:u??i.parentElement}),r=u?.parentElement??i.parentElement?.parentElement??null;r;){let l=t.getComponent(r);l&&!o.has(l)&&(o.add(l),n.push({name:Ce(l.constructor.name),hostElement:r})),r=r.parentElement}break}i=i.parentElement}}let a=n.length>0?n[0]:{name:null,hostElement:null};return{name:a.name,hostElement:a.hostElement,stack:n}}function $l(){return globalThis.__GRABBY_SOURCE_MAP__??null}function Or(e){let t=$l();if(!t)return{filePath:null,line:null,column:null};let n=ft();if(!n)return{filePath:null,line:null,column:null};let o=Ll(e,n);if(!o)return{filePath:null,line:null,column:null};let r=t[o];return r?{filePath:r.file,line:r.line,column:null}:{filePath:null,line:null,column:null}}function Ll(e,t){let n=t.getComponent(e);if(n)return Ce(n.constructor.name);let o=e;for(;o;){let r=t.getOwningComponent(o);if(r)return Ce(r.constructor.name);o=o.parentElement}return null}var Fr={name:"Angular",resolveComponent:e=>{let t=Dr(e);return t.name?t:null},resolveSource:Or,cleanClasses:e=>e.filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))};var pt={filePath:null,line:null,column:null};function Ye(e){let t=e.replace(/\\/g,"/").replace(/^file:\/\//,"").split("?")[0];if(!/^(\/|[A-Za-z]:\/)/.test(t))return t;let n=t.lastIndexOf("/src/");if(n>=0){let o=/\/((?:packages|apps|libs)\/[^/]+)$/.exec(t.slice(0,n));return`${o?`${o[1]}/`:""}${t.slice(n+1)}`}for(let o of["app","pages","components","routes","lib"]){let r=t.lastIndexOf(`/${o}/`);if(r>=0)return t.slice(r+1)}return t.split("/").slice(-3).join("/")}function pe(e){return(e.replace(/\\/g,"/").split("/").pop()??e).replace(/\.(vue|svelte|[cm]?[jt]sx?)$/,"")}var Pl=["__reactFiber$","__reactInternalInstance$"];function gt(e){let t=Object.keys(e);for(let n of Pl){let o=t.find(r=>r.startsWith(n));if(o)return e[o]??null}return null}function bt(e,t=0){if(!e||t>4||typeof e=="string")return null;if(typeof e=="function"){let n=e;return n.displayName||n.name||null}if(typeof e=="object"){let n=e;if(n.displayName)return n.displayName;if(n.render)return bt(n.render,t+1);if(n.type)return bt(n.type,t+1)}return null}function ln(e,t=0){if(t>8)return null;if(e.stateNode instanceof Element)return e.stateNode;let n=e.child;for(;n;){let o=ln(n,t+1);if(o)return o;n=n.sibling}return null}var Ml=12,Dl=new Set(["Slot","SlotClone","Presence","Primitive","Anonymous","Unknown"]);function Ol(e){return Dl.has(e)||e.startsWith("_")||e.includes(".")}function Hr(e){let t=gt(e);if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=t;for(;o&&n.length<Ml;){let r=bt(o.type);r&&!Ol(r)&&n[n.length-1]?.name!==r&&n.push({name:r,hostElement:ln(o)}),o=o.return}return{name:n[0]?.name??null,hostElement:n[0]?.hostElement??null,stack:n}}var Ur="data-grabby-loc",Br=/^(.*?):(\d+):(\d+)(?::([A-Za-z_$][\w$.]*))?$/;function Gr(e){let t=e;for(;t;){let n=t.getAttribute?.(Ur);if(n)return Fl(n);t=t.parentElement}return{filePath:null,line:null,column:null}}function Fl(e){let t=Br.exec(e);return t?{filePath:t[1],line:Number(t[2]),column:Number(t[3])}:{filePath:e,line:null,column:null}}function Vr(e){let t=e?.getAttribute?.(Ur);if(!t)return null;let n=Br.exec(t);return n?{file:n[1],line:Number(n[2]),column:Number(n[3]),name:n[4]??null}:{file:t,line:null,column:null,name:null}}function Hl(e){return!("_debugOwner"in e)&&!("_debugSource"in e)&&!("_debugStack"in e)}function Ul(e){let t=[];for(let n of e.stack){let o=Vr(n.hostElement),r=o?.name??(o?pe(o.file):null);r&&t[t.length-1]?.name!==r&&t.push({name:r,hostElement:n.hostElement})}return t[0]?{name:t[0].name,hostElement:t[0].hostElement,stack:t}:null}var zr={name:"React",resolveComponent:e=>{let t=Hr(e);if(!t.name)return null;let n=gt(e);return n&&Hl(n)?Ul(t)??{name:null,hostElement:null,stack:[]}:t}};var jr=new Set(["KeepAlive","Transition","TransitionGroup","Teleport","Suspense","BaseTransition","RouterView","RouterLink"]),Kr=12;function Wr(e){let t=e??null;for(;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.nextSibling;return t}function Yr(e){let t=e;for(;t;){let n=t.__vueParentComponent;if(n)return n;t=t.parentElement}return null}function Bl(e){let t=e.type??{};return t.__name||t.name||t.displayName||(t.__file?pe(t.__file):null)}function Gl(e){return Wr(e.subTree?.el??e.vnode?.el)}function Xr(e){let t=e;for(;t;){let n=t.__vue__;if(n)return n;t=t.parentElement}return null}function Vl(e){let t=e.$options??{};return t.name||t._componentTag||(t.__file?pe(t.__file):null)}function zl(e){let t=Yr(e);if(t){let o=[];for(let a=t;a&&o.length<Kr;a=a.parent){let i=Bl(a);i&&!jr.has(i)&&o.push({name:i,hostElement:Gl(a)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}let n=Xr(e);if(n){let o=[];for(let a=n;a&&o.length<Kr;a=a.$parent){let i=Vl(a);i&&!jr.has(i)&&o.push({name:i,hostElement:Wr(a.$el)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}return null}function jl(e){let n=Yr(e)?.type?.__file??Xr(e)?.$options?.__file;return n?{filePath:Ye(n),line:null,column:null}:pt}var qr={name:"Vue",resolveComponent:zl,resolveSource:jl};var Kl=12;function Zr(e){let t=e;for(;t;){let n=t.__svelte_meta;if(n?.loc)return{meta:n,el:t};t=t.parentElement}return null}function Wl(e){let t=e.loc?.line;return typeof t!="number"?null:"parent"in e?t:t+1}function Yl(e){let t=Zr(e);if(!t?.meta.loc?.file)return null;let{meta:n}=t,o=pe(n.loc.file),r=[{name:o,hostElement:t.el}];for(let a=n.parent;a&&r.length<Kl;a=a.parent){if(a.type!=="component"||!a.file)continue;let i=pe(a.file);i!==r[r.length-1].name&&r.push({name:i,hostElement:null,filePath:Ye(a.file),line:typeof a.line=="number"?a.line:null})}return{name:o,hostElement:t.el,stack:r}}function Xl(e){let t=Zr(e),n=t?.meta.loc?.file;if(!t||!n)return pt;let o=t.meta.loc?.column;return{filePath:Ye(n),line:Wl(t.meta),column:typeof o=="number"?o+1:null}}var Jr={name:"Svelte",resolveComponent:Yl,resolveSource:Xl,cleanClasses:e=>e.filter(t=>!/^svelte-[a-z0-9]+$/i.test(t)&&!/^s-[A-Za-z0-9_-]{8,}$/.test(t))};var Qr={name:"HTML",resolveComponent:e=>{let t=e.closest("[data-component]"),n=t?.getAttribute("data-component");if(!t||!n)return null;let o=[];for(let r=t;r;r=r.parentElement?.closest("[data-component]")??null){let a=r.getAttribute("data-component");if(a&&o.push({name:a,hostElement:r}),o.length>=12)break}return{name:n,hostElement:t,stack:o}}};var cn=[Fr,zr,qr,Jr,Qr];function ea(e=cn){function t(n){for(let o of e)try{let r=o.resolveComponent(n);if(r?.name)return{adapter:o,result:r}}catch{}return null}return{resolveComponent(n){return t(n)?.result??null},resolveSource(n){let o=Gr(n);if(o.filePath)return o;let r=t(n),a=r?[r.adapter,...e.filter(i=>i!==r.adapter)]:e;for(let i of a)try{let s=i.resolveSource?.(n);if(s?.filePath)return s}catch{}return null},frameworkFor(n){return t(n)?.adapter.name??"HTML"},cleanClasses(n){return e.reduce((o,r)=>r.cleanClasses?r.cleanClasses(o):o,n)}}}var ql=200,na="grabby:v1:level",ta=8e3;function Zl(){return{activationKey:"Alt+G",activationMode:"toggle",keyHoldDuration:0,enabled:!0,enableInInputs:!1,devOnly:!0,showToolbar:!0,themeMode:"light",mode:"local",persistHistory:!0,copyOnComment:!1,detailLevel:"standard",screenshots:!0,captureQueryParams:[]}}function oa(e){return e?.mode==="live"&&!Ao(e.projectKey)?Jl(e):aa(e)}function Jl(e){let t=null,n=[],o=i=>{t?i(t):n.push(i)},r=e.server?Ql(e):null,a={...ra(),setOptions:i=>o(s=>s.setOptions(i)),registerPlugin:i=>o(s=>s.registerPlugin(i)),unregisterPlugin:i=>o(s=>s.unregisterPlugin(i)),setComponentResolver:i=>o(s=>s.setComponentResolver(i)),setSourceResolver:i=>o(s=>s.setSourceResolver(i)),identify:i=>o(s=>s.identify(i)),show(){if(t){t.show();return}r?.dispose(),at(),t=aa(e);for(let i of n.splice(0))i(t);Object.assign(a,t)}};return a}function Ql(e){try{if(!localStorage.getItem("grabby:v1:outbox"))return null}catch{return null}let t=Wt();return Ht({server:e.server,projectKey:e.projectKey,getComment:n=>t.find(o=>o.id===n),getScreenshot:Fe,onState(n,o){t=t.map(r=>r.id===n?{...r,sync:o}:r),Yt(t)}})}function ec(){try{if(typeof ngDevMode<"u"&&ngDevMode===!1)return!1}catch{}try{if(process.env.NODE_ENV==="production")return!1}catch{}return!0}function tc(e){try{let t=localStorage.getItem(na);if(t==="compact"||t==="standard"||t==="detailed")return t}catch{}return e}function nc(e){try{localStorage.setItem(na,e)}catch{}}function ra(){let e=()=>{};return{activate:e,deactivate:e,toggle:e,isActive:()=>!1,setOptions:e,registerPlugin:e,unregisterPlugin:e,setComponentResolver:e,setSourceResolver:e,showToolbar:e,hideToolbar:e,setThemeMode:e,getComments:()=>[],exportComments:()=>"",deleteComment:e,clearComments:e,identify:e,show:e,hide:e,dispose:e}}function aa(e){let n={...Zl(),...e},o=n.mode==="live";if(!o&&n.devOnly&&!ec())return ra();let r=n.identity??(o?"ask":"none"),a=null;Cn(n.styleNonce);let i=xn(n);if(n.persistHistory){let d=Wt();d.length>0&&(i.state.toolbar={...i.state.toolbar,comments:d})}let s=An(),u=Rn(),l=$o(),c=Qn(),m=oo(),f=So(),p=null,g=ea(n.adapters??cn),b=g.resolveComponent,E=g.resolveSource,w=d=>g.cleanClasses(d.filter(C=>!De(C))),h=null,v=null,y=tc(n.detailLevel),T=new Map;m.apply(i.state.toolbar.themeMode),qe();function S(){return i.state.toolbar.comments}function M(d){i.state.toolbar={...i.state.toolbar,comments:d},j.update(i.state),H.refresh(d),re.update(V())}function V(){let d=S(),C=k=>d.filter(L=>L.sync===k).length;return{total:d.length,sent:C("sent"),pending:C("pending"),failed:C("failed")}}function be(){return ae.hasDraft()||!!p&&S().some(d=>d.sync==="pending")}function D(d,C){let k=lo(d,C,{origin:location.host});return c.callTransformHook(k,d)}function ge(){return r==="anonymous"?{name:null,anonymous:!0,sessionId:dt()}:a?{name:a.name,anonymous:!1,sessionId:dt(),...a.id?{userId:a.id}:{}}:Mr(mt())}function J(){return r==="ask"&&!a&&!mt()}function sa(){if(r!=="ask")return null;if(a)return a.name;let d=mt();return d?d.anonymous||!d.name?"anonymous":d.name:null}function la(d,C){let k=S().find(L=>L.id===d);!k||k.sync===C||(o&&C==="sent"&&G("Feedback sent. Thank you!"),o&&C==="failed"&&G("Your feedback couldn't be sent. Please try again later."),M(S().map(L=>L.id===d?{...L,sync:C}:L)))}function un(d){return{componentName:d.target.component,filePath:d.target.source?.file??null,line:d.target.source?.line??null,column:d.target.source?.column??null}}function ca(d,C,k){let L=Date.now(),I={id:We(),createdAt:L,updatedAt:L,status:"open",comment:C,author:ge(),page:{route:jn(location,i.state.options.captureQueryParams),title:document.title,viewport:[window.innerWidth,window.innerHeight]},target:zo(d,{componentResolver:b,sourceResolver:E,cleanClasses:w}),screenshot:null,framework:g.frameworkFor(d),...p?{sync:"pending"}:{}};M([I,...S()].slice(0,ql)),c.callHook("onComment",I,d),p?.send(I.id),k&&ua(I.id,k);let F=S().length;if(o)return G("Thanks! Sending your feedback\u2026"),I;let he={label:F===1?"Copy":`Copy all ${F}`,onClick:mn,primary:!0};return i.state.options.copyOnComment?dn(D([I],y)).then(Y=>{G(Y?"Comment saved and copied":"Comment saved (clipboard blocked)",{detail:un(I),actions:F>1?[he]:[]})}):G(F===1?"Comment saved":`Comment saved \xB7 ${F} total`,{detail:un(I),actions:[he]}),I}async function ua(d,C){let k=await C;if(!k)return;await co(d,k.blob);let L=S().find(F=>F.id===d);if(!L){Pt([d]);return}let I={...L,screenshot:{localId:d,width:k.width,height:k.height}};M(S().map(F=>F.id===d?I:F)),c.callHook("onScreenshot",I,k.blob),p?.sendScreenshot(d)}function Te(d,C){if(d.length===0)return;let k=new Set(d),L=S(),I=L.filter(Y=>k.has(Y.id));M(L.filter(Y=>!k.has(Y.id)));let F=I.flatMap(Y=>Y.screenshot?.localId?[Y.screenshot.localId]:[]),he=We();T.set(he,setTimeout(()=>{T.delete(he),Pt(F)},ta+500)),C&&G(C,{duration:ta,actions:[{label:"Undo",onClick:()=>{clearTimeout(T.get(he)),T.delete(he);let Y=new Set(S().map($e=>$e.id)),ma=[...I.filter($e=>!Y.has($e.id)),...S()].sort(($e,fa)=>fa.createdAt-$e.createdAt);M(ma),G(`Restored ${I.length} comment${I.length===1?"":"s"}`)}}]})}async function dn(d){try{return await navigator.clipboard.writeText(d),!0}catch(C){return c.callHook("onCopyError",C instanceof Error?C:new Error(String(C))),!1}}function mn(){let d=S();if(d.length===0){G("No comments to copy yet");return}oe(),ke.open({count:d.length,level:y,render:C=>D(d,C)})}function fn(d){return Tn(d)||l.isFreezeElement(d)}function oe(){H.hide(),ae.hide(),ke.close(),re.close()}function pn(){if(re.isVisible()){re.close();return}oe(),z(!0),re.open(V())}function bn(){oe(),f.dismiss(),z(!0),i.state.toolbar={...i.state.toolbar,visible:!1},j.hide(),o&&Gt()}let ht=Xn({overlay:s,crosshair:u,getComponentResolver:()=>b,getSourceResolver:()=>E,isToolbarElement:fn,getFreezeElement:()=>l.getElement(),onHover(d){i.state.hoveredElement=d,d&&c.callHook("onElementHover",d)},onSelect(d){h=d,v=i.state.options.screenshots?Ir(d):null,c.callHook("onElementSelect",d),f.dismiss(),Lo(d),ae.show({anchor:d,mode:"new",askIdentity:J()})}});function Xe(){i.state.options.enabled&&(i.state.active||(i.state.toolbar.visible===!1&&i.state.options.showToolbar&&(i.state.toolbar={...i.state.toolbar,visible:!0},j.show()),oe(),i.state.active=!0,ht.activate(),c.callHook("onActivate"),j.update(i.state)))}function z(d=!1){i.state.active&&(!d&&i.state.frozen||(i.state.active=!1,i.state.frozen=!1,l.hide(),ht.deactivate(),c.callHook("onDeactivate"),j.update(i.state)))}function da(){i.state.frozen=!i.state.frozen,i.state.frozen?l.show(i.state.hoveredElement):l.hide(),j.update(i.state)}let j=ro({onSelectionMode(){i.state.active?z(!0):Xe()},onHistory(){ae.hide(),ke.close(),H.isVisible()?H.hide():H.show([...S()])},onEnableToggle(){oe();let d=!i.state.options.enabled;i.state.options={...i.state.options,enabled:d},d||z(!0),j.update(i.state)},onDismiss(){let{pending:d,failed:C}=V();if(o&&p&&(d||C)){pn();return}bn()},onFinish:pn},o?{label:"Comment",dismissLabel:"Exit feedback mode",hideEnable:!0,review:!!n.server}:{}),H=mo({onHover(d){let C=d?Pe(d.target.selector):null;C&&d?s.show(C,d.target.component,null,[]):s.hide()},onEdit(d,C){s.hide();let k=Pe(d.target.selector);H.hide(),ae.show({anchor:k??C,initialValue:d.comment,mode:"edit",entryId:d.id})},onDelete(d){s.hide(),Te([d.id],"Comment deleted")},onCopyAll(){s.hide(),mn()},onClearAll(){s.hide();let d=S().length;Te(S().map(C=>C.id),`Cleared ${d} comment${d===1?"":"s"}`),H.hide()},onChangeIdentity(){Pr(),H.refresh(S()),G("We'll ask for your name on your next comment")}},{variant:o?"live":"local",showSync:!!n.server,identityLabel:sa}),ke=ho({async onCopy(d,C){let k=S();if(!await dn(d))return!1;c.callHook("onCopySuccess",d,k);let I=`${k.length} comment${k.length===1?"":"s"}`;return C==="clear"?Te(k.map(F=>F.id),`Copied and cleared ${I}`):G(`Copied ${I}`),!0},onLevelChange(d){y=d,nc(d)}}),re=Eo({onDone(){let d=S().filter(k=>k.sync==="sent"&&!p?.isQueued(k.id)).map(k=>k.id);if(!S().length){bn();return}Te(d,null);let C=S().length;G(C?`Thanks for your review! ${C} comment${C===1?" is":"s are"} still sending.`:"Thanks for your review! Your feedback was sent.")},onRetry(){let d=S().filter(C=>C.sync==="failed");if(d.length){let C=new Set(d.map(k=>k.id));M(S().map(k=>C.has(k.id)?{...k,sync:"pending"}:k));for(let k of C)p?.send(k)}p?.flush()}}),ae=fo({onSubmit(d,C,k){if(k&&Lr({name:k.name,anonymous:!k.name}),C.mode==="new"){let I=h,F=v;h=null,v=null,I&&ca(I,d,F),z(!0);return}if(!C.entryId)return;let L=S().map(I=>I.id===C.entryId?{...I,comment:d,updatedAt:Date.now(),...p?{sync:"pending"}:{}}:I);M(L),p?.send(C.entryId),G("Comment updated"),H.show([...L])},onCancel(d){if(d.mode==="new"){h=null,v=null,z(!0);return}H.show([...S()])}});function gn(d){let C=se(d);C&&(fn(C)||(H.isVisible()||ae.isVisible()||ke.isVisible()||re.isVisible())&&oe())}document.addEventListener("click",gn);function hn(){_e(),p?.flushOnExit()}function yn(){document.visibilityState==="hidden"&&_e()}window.addEventListener("pagehide",hn),document.addEventListener("visibilitychange",yn);function vn(d){!o||!be()||(d.preventDefault(),d.returnValue="")}window.addEventListener("beforeunload",vn);function qe(){i.state.toolbar.visible?document.documentElement.style.setProperty("--grabby-toast-bottom",Sn):document.documentElement.style.removeProperty("--grabby-toast-bottom")}function En(d){d.key.toLowerCase()!=="f"||d.metaKey||d.ctrlKey||d.altKey||ve(se(d))||i.state.active&&(d.preventDefault(),da())}document.addEventListener("keydown",En,!0);function wn(d){if(d.key==="Escape"&&!ve(se(d))&&!(ae.isVisible()||ke.isVisible()||re.isVisible())){if(H.isVisible()){H.hide(),d.preventDefault();return}i.state.active&&(d.preventDefault(),z(!0))}}document.addEventListener("keydown",wn,!0);let Ze=Jn({getActivationKey:()=>i.state.options.activationKey,getActivationMode:()=>i.state.options.activationMode,getKeyHoldDuration:()=>i.state.options.keyHoldDuration,getEnableInInputs:()=>i.state.options.enableInInputs,onActivate:Xe,onDeactivate:()=>z(),isActive:()=>i.state.active}),Ae={activate:Xe,deactivate:()=>z(!0),toggle(){i.state.active?z(!0):Xe()},isActive(){return i.state.active},setOptions(d){i.state.options={...i.state.options,...d}},registerPlugin(d){d.options&&(i.state.options={...i.state.options,...d.options}),d.theme&&m.applyOverrides(d.theme),c.register(d,Ae)},unregisterPlugin(d){c.unregister(d)},setComponentResolver(d){b=d},setSourceResolver(d){E=d},showToolbar(){i.state.toolbar={...i.state.toolbar,visible:!0},j.show(),j.update(i.state),qe()},hideToolbar(){oe(),i.state.toolbar={...i.state.toolbar,visible:!1},j.hide(),qe()},setThemeMode(d){i.state.toolbar={...i.state.toolbar,themeMode:d},m.apply(d),j.update(i.state)},getComments(){return[...S()]},exportComments(d={}){let C=d.ids?new Set(d.ids):null,k=C?S().filter(L=>C.has(L.id)):S();return D(k,d.level??y)},deleteComment(d){Te([d],null)},clearComments(){Te(S().map(d=>d.id),null)},identify(d){a=d&&d.name?{id:d.id,name:d.name.slice(0,80)}:null,H.refresh(S())},show(){o&&at(),Ae.showToolbar()},hide(){o&&Gt(),Ae.hideToolbar()},dispose(){_e(),z(!0),document.removeEventListener("click",gn),window.removeEventListener("pagehide",hn),window.removeEventListener("beforeunload",vn),document.removeEventListener("visibilitychange",yn),document.removeEventListener("keydown",En,!0),document.removeEventListener("keydown",wn,!0),Ze.dispose(),ht.dispose(),s.dispose(),u.dispose(),l.dispose(),Dn(),Po(),c.dispose(),oe(),j.dispose(),H.dispose(),ae.dispose(),ke.dispose(),re.dispose(),f.dispose(),p?.dispose(),m.dispose(),Fo(),Rr(),document.documentElement.style.removeProperty("--grabby-toast-bottom"),kn()}};return i.state.options.enabled&&Ze.start(),i.state.toolbar={...i.state.toolbar,visible:!1},o&&n.showToolbar&&(Ae.showToolbar(),f.maybeShow()),i.subscribe((d,C)=>{C==="options"&&(d.options.enabled?Ze.start():(Ze.stop(),z(!0))),C==="toolbar"&&(qe(),d.options.persistHistory&&(d.toolbar.comments.length>0?Yt(d.toolbar.comments):Oo()))}),n.server&&(p=Ht({server:n.server,projectKey:n.projectKey,getComment:d=>S().find(C=>C.id===d),getScreenshot:Fe,onState:(d,C)=>la(d,C)})),n.webhookUrl&&Ae.registerPlugin(eo(n.webhookUrl)),Ae}function oc(e){let t=e?.dataset??{},n={};return(t.mode==="live"||t.mode==="local")&&(n.mode=t.mode),t.server&&(n.server=t.server),t.projectKey&&(n.projectKey=t.projectKey),(t.identity==="ask"||t.identity==="anonymous"||t.identity==="none")&&(n.identity=t.identity),t.activationKey&&(n.activationKey=t.activationKey),t.screenshots==="false"&&(n.screenshots=!1),t.webhookUrl&&(n.webhookUrl=t.webhookUrl),t.styleNonce?n.styleNonce=t.styleNonce:e?.nonce&&(n.styleNonce=e.nonce),n}var ia=oa(oc(document.currentScript));window.grabby=ia;var Xd=ia;})();
|
|
640
|
+
`)}function Vo(e,t="Selected"){Wa();let n=e.getBoundingClientRect(),o=document.createElement("div");o.className="grabby-select-flash",o.style.top=`${n.top}px`,o.style.left=`${n.left}px`,o.style.width=`${n.width}px`,o.style.height=`${n.height}px`,N().appendChild(o);let r=document.createElement("div");r.className="grabby-select-pill",r.append(ce(eo),` ${t}`),N().appendChild(r);let i=70,a=n.left+n.width/2-i/2,s=n.top-24;s<4&&(s=n.bottom+6);let u=document.documentElement.clientWidth;a+i>u-4&&(a=u-i-4),a<4&&(a=4),r.style.top=`${s}px`,r.style.left=`${a}px`;let c=()=>{o.remove(),r.remove()};r.addEventListener("animationend",c),setTimeout(c,1200)}function zo(){R(qt)}var Ve="grabby:v1:comments";var fe=null,Be=null,Ge=null,Ko=!1,Ya=100;function Zt(){try{let e=localStorage.getItem(Ve);if(!e)return[];let t=JSON.parse(e);return!t||typeof t!="object"||t.v!==1||!Array.isArray(t.entries)?[]:t.entries}catch{try{localStorage.removeItem(Ve)}catch{}return[]}}function Jt(e){Ge=e,!(fe!=null||Be!=null)&&(fe=requestAnimationFrame(Ie),Be=setTimeout(Ie,Ya))}function Ie(){if(fe!=null&&(cancelAnimationFrame(fe),fe=null),Be!=null&&(clearTimeout(Be),Be=null),Ge==null)return;let e=Ge;Ge=null,Xa(e)}function Xa(e){let t={v:1,entries:e};try{localStorage.setItem(Ve,JSON.stringify(t))}catch(n){if(qa(n)){let o=e.slice(0,Math.floor(e.length/2));try{localStorage.setItem(Ve,JSON.stringify({v:1,entries:o}))}catch{jo()}}else jo()}}function qa(e){if(!e||typeof e!="object")return!1;let t=e;return t.name==="QuotaExceededError"||t.code===22}function jo(){Ko||(Ko=!0,console.warn("[grabby] saving comments to localStorage failed (quota or other error)."))}function Wo(){fe!=null&&(cancelAnimationFrame(fe),fe=null),Ge=null;try{localStorage.removeItem(Ve)}catch{}}var q=null,en=new Map;function Za(){if(q?.isConnected&&q.contentDocument)return q.contentDocument;try{return q=document.createElement("iframe"),q.setAttribute("aria-hidden","true"),q.setAttribute("tabindex","-1"),q.setAttribute("data-grabby-ignore",""),Object.assign(q.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(q),q.contentDocument}catch{return null}}function Ja(e,t,n){let o=t?`${e}[${t}]`:e,r=en.get(o);r||(r=new Map,en.set(o,r));let i=n.filter(a=>!r.has(a));if(i.length>0){let a=Za(),s=a?.defaultView;if(a?.body&&s){let u=a.createElement(e);t&&u.setAttribute("type",t),a.body.appendChild(u);let c=s.getComputedStyle(u);for(let l of i)r.set(l,c.getPropertyValue(l));u.remove()}else for(let u of i)r.set(u,"")}return r}function Yo(){q?.remove(),q=null,en.clear()}function Qt(e){return Math.round(e).toString(16).padStart(2,"0")}function Qa(e){let t=e.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?\s*\)$/);if(!t)return e;let[n,o,r]=[Number(t[1]),Number(t[2]),Number(t[3])],i=t[4]===void 0?1:t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]);if(i===0)return"transparent";let a=`#${Qt(n)}${Qt(o)}${Qt(r)}`;return i>=1?/^#(.)\1(.)\2(.)\3$/.test(a)?`#${a[1]}${a[3]}${a[5]}`:a:(i=Math.round(i*100)/100,`${a} ${Math.round(i*100)}%`)}function es(e,t){let n=t.trim().replace(/(\d+\.\d{2,})px/g,(r,i)=>`${Math.round(Number(i)*10)/10}px`);/color|background|border|shadow|fill|stroke/.test(e)&&(n=n.replace(/rgba?\([^)]*\)/g,r=>Qa(r))),e==="font-family"&&(n=n.split(",")[0].replace(/["']/g,"").trim());let o=n.split(" ");return o.length===4&&o.every(r=>r===o[0])?n=o[0]:o.length===4&&o[0]===o[2]&&o[1]===o[3]&&(n=`${o[0]} ${o[1]}`),n}function xe(e,t){let n={},o;try{o=getComputedStyle(e)}catch{return n}let r=e.tagName.toLowerCase(),i=r==="input"||r==="button"?e.getAttribute("type"):null,a=Ja(r,i,t);for(let s of t){let u=o.getPropertyValue(s);!u||u===a.get(s)||u==="none"||u==="normal"||u==="auto"||u==="rgba(0, 0, 0, 0)"||/^border/.test(s)&&(/^0px\b/.test(u)||/\bnone\b/.test(u))||(n[s]=es(s,u))}return n}var ts={"background-color":"bg","border-radius":"radius","font-size":"size","font-weight":"weight","line-height":"line-height","font-family":"font","box-shadow":"shadow","flex-direction":"direction","grid-template-columns":"columns","justify-content":"justify","align-items":"align","text-align":"text-align","object-fit":"fit"};function we(e){return Object.entries(e).map(([t,n])=>`${ts[t]??t} ${t==="box-shadow"?"yes":n}`).join(" \xB7 ")}var ns=["background-color","color","font-size","font-weight","padding","border-radius","border"],os=["background-color","border","border-radius","padding","font-size"],rs=["font-size","font-weight","line-height","color","font-family","text-align","letter-spacing"],is=["object-fit","border-radius","aspect-ratio"],as=["display","flex-direction","gap","grid-template-columns","justify-content","align-items","padding","max-width","background-color","border-radius","box-shadow","border"],ss=["margin","color","background-color","font-size","font-weight","line-height","display","position","z-index","opacity","overflow","box-shadow","border"];function A(e,t,n){n!=null&&n!==""&&(e[t]=n)}function qo(e){let t=e.getBoundingClientRect();return t.width||t.height?`${Math.round(t.width)}\xD7${Math.round(t.height)}`:""}function ls(e){let t=e.getAttribute("aria-labelledby");return t?t.split(/\s+/).map(n=>e.ownerDocument.getElementById(n)).filter(n=>!!n).map(n=>V(n,60)).join(" "):""}function tn(e){return $(e.getAttribute("aria-label")??"")||ls(e)}function cs(e){let t=[];(e.disabled||e.getAttribute("aria-disabled")==="true")&&t.push("disabled");for(let n of["aria-expanded","aria-pressed","aria-selected","aria-checked"]){let o=e.getAttribute(n);o!==null&&t.push(`${n.slice(5)}=${o}`)}return e.getAttribute("aria-current")&&t.push("current"),t.join(", ")}function us(e){let t={},n=e.querySelector("img[alt]")?.getAttribute("alt")??"";return A(t,"label",tn(e)||V(e,80)||$(e.getAttribute("title")??"")||$(n)),e.tagName==="A"?A(t,"href",Pe(e.getAttribute("href")??"")):(e.tagName==="BUTTON"||e.tagName==="INPUT")&&A(t,"type",e.getAttribute("type")??(e.tagName==="BUTTON"?"submit":"")),A(t,"state",cs(e)),A(t,"styles",we(xe(e,ns))),t}function ds(e){let t=e.labels;return t&&t.length>0?V(t[0],60):tn(e)||$(e.getAttribute("placeholder")??"",{keepEmails:!0})}function ms(e){let t={};A(t,"label",ds(e));let n=e.tagName==="INPUT"?e.type||"text":e.tagName.toLowerCase();A(t,"type",n),A(t,"placeholder",$(e.getAttribute("placeholder")??"",{keepEmails:!0}));let o=[];return(e.required||e.getAttribute("aria-required")==="true")&&o.push("required"),e.disabled&&o.push("disabled"),e.getAttribute("aria-invalid")==="true"&&o.push("invalid"),A(t,"state",o.join(", ")),e.tagName==="SELECT"&&A(t,"options",String(e.options.length)),A(t,"styles",we(xe(e,os))),t}function fs(e){let t={};return A(t,"text",V(e,120)),A(t,"styles",we(xe(e,rs))),t}function Xo(e){let t=Pe(e);return t.split("/").filter(Boolean).pop()??t}function ps(e){let t={};if(e.tagName==="IMG"){let n=e;A(t,"alt",n.hasAttribute("alt")?$(n.alt)||"(empty)":"(missing)"),A(t,"src",Xo(n.currentSrc||n.getAttribute("src")||"")),n.naturalWidth&&A(t,"natural",`${n.naturalWidth}\xD7${n.naturalHeight}`)}else e.tagName==="SVG"||e.tagName.toLowerCase()==="svg"?(A(t,"label",tn(e)||V(e.querySelector("title")??e,40)),A(t,"viewBox",e.getAttribute("viewBox")??"")):(e.tagName==="VIDEO"||e.tagName==="AUDIO"||e.tagName==="IFRAME")&&(A(t,"src",Xo(e.getAttribute("src")??e.querySelector("source")?.getAttribute("src")??"")),A(t,"title",$(e.getAttribute("title")??"")));return A(t,"size",qo(e)),A(t,"styles",we(xe(e,is))),t}function bs(e,t){let n=t?.(e);if(n?.name&&n.hostElement===e)return n.name;let o=e.tagName.toLowerCase();return/^h[1-6]$/.test(o)?"heading":o==="a"?"link":o==="img"||o==="svg"?"image":o==="ul"||o==="ol"?"list":o}function Zo(e,t){let n=new Map;for(let r of Array.from(e.children)){if(r.hasAttribute(oe)||/^(SCRIPT|STYLE|TEMPLATE)$/.test(r.tagName))continue;let i=bs(r,t);n.set(i,(n.get(i)??0)+1)}let o=Array.from(n.entries()).slice(0,6).map(([r,i])=>i>1?`${i}\xD7 ${r}`:r);return n.size>6&&o.push("\u2026"),o.join(", ")}function Jo(e){let t=e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]');return t?V(t,60):""}function gs(e,t){let n={};return A(n,"heading",Jo(e)),A(n,"contains",Zo(e,t)),A(n,"size",qo(e)),A(n,"layout",we(xe(e,as))),n}function hs(e,t){let n={};A(n,"title",$(e.ownerDocument.title)),A(n,"viewport",`${window.innerWidth}\xD7${window.innerHeight}`);let o=Array.from(e.querySelectorAll('header, nav, main, aside, footer, section, [role="region"]')).filter(r=>!r.parentElement?.closest('header, nav, main, aside, footer, section, [role="region"]')||r.parentElement===e).slice(0,8).map(r=>{let i=Jo(r);return i?`${r.tagName.toLowerCase()} "${X(i,30)}"`:r.tagName.toLowerCase()});return A(n,"regions",o.join(", ")),A(n,"contains",Zo(e.tagName==="HTML"?e.ownerDocument.body??e:e,t)),n}function ys(e,t){let n=[],o=e.parentElement;for(;o&&n.length<t&&o.tagName!=="BODY"&&o.tagName!=="HTML";){let r=Array.from(o.classList).filter(i=>!i.startsWith("ng-")&&!i.startsWith("_ng")).slice(0,2);n.push(`${o.tagName.toLowerCase()}${r.length?`.${r.join(".")}`:""}`),o=o.parentElement}return n.reverse().join(" > ")}function vs(e,t){let n={},o=e.getBoundingClientRect();return(o.width||o.height)&&A(n,"box",`${Math.round(o.left)},${Math.round(o.top)} ${Math.round(o.width)}\xD7${Math.round(o.height)}`),A(n,"ancestors",ys(e,5)),A(n,"computed",we(xe(e,ss))),t!=="section"&&t!=="field"&&!Re(e)&&A(n,"text",V(e,240)),n}function Qo(e,t,n){let o;switch(t){case"action":o=us(e);break;case"field":o=ms(e);break;case"text":o=fs(e);break;case"media":o=ps(e);break;case"section":o=hs(e,n);break;default:o=gs(e,n)}return{facts:o,extra:vs(e,t)}}var Es=3;function nn(e){return!!e&&!/(^|[\\/])node_modules[\\/]/.test(e)}function xs(e,t){let n=t.componentResolver?.(e)??null,o=[],r=[];for(let i of n?.stack??[]){let a=i.filePath!==void 0?{filePath:i.filePath,line:i.line??null}:i.hostElement&&t.sourceResolver?t.sourceResolver(i.hostElement):null,s={name:i.name,file:a?.filePath??null,line:a?.line??null};r.push(s),nn(s.file)&&o.length<Es&&o.push(s)}return{component:n?.name??null,frames:o.length>0?o:r.slice(0,2)}}function ws(e,t,n){let o=t.sourceResolver?.(e);if(o&&nn(o.filePath))return{file:o.filePath,line:o.line,column:o.column};let r=n.find(i=>nn(i.file));return r?.file?{file:r.file,line:r.line,column:null}:null}function er(e,t){let n=t.cleanClasses??(c=>c.filter(l=>!Me(l))),o=nt(e),{component:r,frames:i}=xs(e,t),a=ws(e,t,i),{facts:s,extra:u}=Qo(e,o,t.componentResolver);return{kind:o,tag:e.tagName.toLowerCase(),component:r,source:a,stack:i,selector:ro(e),preview:o==="section"?`<${e.tagName.toLowerCase()}>`:Un(e,n),facts:s,extra:u}}var Ul=1200,Bl=1600,Fr=5e3;function Gl(e){return e instanceof Element?e.tagName.toLowerCase()===Ct?!1:!e.hasAttribute(oe):!0}function Vl(e){e instanceof HTMLElement&&e.hasAttribute(ot)&&(e.style.filter="blur(8px)")}var un='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',Ye=null,We;function zl(){let e=window.trustedTypes;if(!e)return un;if(We===void 0)try{We=e.createPolicy("grabby",{createHTML:t=>t===un?t:""})}catch{We=null}return We?We.createHTML(un):null}async function Kl(){if(Ye?.isConnected)return Ye;let e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1"),e.setAttribute(oe,""),Object.assign(e.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(e);let t=zl();return t!==null&&await new Promise(n=>{let o=()=>n();e.addEventListener("load",o,{once:!0}),setTimeout(o,1e3);try{e.srcdoc=t}catch{o()}}),Ye=e,e}function Hr(){Ye?.remove(),Ye=null}function jl(e,t){return new Promise(n=>{let o=setTimeout(()=>n(null),t);e.then(r=>{clearTimeout(o),n(r)},()=>{clearTimeout(o),n(null)})})}async function Ur(e){if(typeof window>"u"||!e.isConnected)return null;let t=e.getBoundingClientRect();if(t.width<1||t.height<1)return null;let n=Math.min(t.width,document.documentElement.scrollWidth||t.width),o=Math.min(t.height,Bl),r=window.devicePixelRatio||1,i=Math.min(r,Ul/Math.max(n,o));return jl((async()=>{let{createContext:s,destroyContext:u,domToBlob:c}=await Promise.resolve().then(()=>(Or(),Dr)),l=await s(e,{width:n,height:o,scale:i,type:"image/webp",quality:.8,filter:Gl,onCloneEachNode:Vl,style:{margin:"0"},timeout:Fr});l.sandbox=await Kl();let m;try{m=await c(l)}finally{l.sandbox=void 0,u(l)}return m?{blob:m,width:Math.round(n*i),height:Math.round(o*i)}:null})(),Fr+1e3)}var Br="grabby:v1:session",dn="grabby:v1:author";function Xe(){let e=typeof crypto<"u"?crypto:void 0;if(e&&typeof e.randomUUID=="function")try{return e.randomUUID()}catch{}let t=new Uint8Array(16);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let o=0;o<16;o++)t[o]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}var Gr=null;function bt(){try{let e=localStorage.getItem(Br);if(e)return e;let t=Xe();return localStorage.setItem(Br,t),t}catch{return Gr??=Xe(),Gr}}function gt(){try{let e=localStorage.getItem(dn);if(!e)return null;let t=JSON.parse(e);return typeof t!="object"||t===null||typeof t.anonymous!="boolean"?null:{name:typeof t.name=="string"?t.name.slice(0,80):null,anonymous:t.anonymous}}catch{return null}}function Vr(e){try{localStorage.setItem(dn,JSON.stringify(e))}catch{}}function zr(){try{localStorage.removeItem(dn)}catch{}}function Kr(e){return{name:e&&!e.anonymous?e.name:null,anonymous:!e||e.anonymous||!e.name,sessionId:bt()}}function ht(){return typeof window>"u"?null:window.ng||null}function Ce(e){return e.startsWith("_")?e.slice(1):e}function jr(e){let t=ht();if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=new Set,r=e;for(;r;){let a=t.getComponent(r);a&&!o.has(a)&&(o.add(a),n.push({name:Ce(a.constructor.name),hostElement:r})),r=r.parentElement}if(n.length===0){let a=e;for(;a;){let s=t.getOwningComponent(a);if(s&&!o.has(s)){o.add(s);let u=a.parentElement;for(;u&&t.getComponent(u)!==s;)u=u.parentElement;for(n.push({name:Ce(s.constructor.name),hostElement:u??a.parentElement}),r=u?.parentElement??a.parentElement?.parentElement??null;r;){let c=t.getComponent(r);c&&!o.has(c)&&(o.add(c),n.push({name:Ce(c.constructor.name),hostElement:r})),r=r.parentElement}break}a=a.parentElement}}let i=n.length>0?n[0]:{name:null,hostElement:null};return{name:i.name,hostElement:i.hostElement,stack:n}}function Wl(){return globalThis.__GRABBY_SOURCE_MAP__??null}function Wr(e){let t=Wl();if(!t)return{filePath:null,line:null,column:null};let n=ht();if(!n)return{filePath:null,line:null,column:null};let o=Yl(e,n);if(!o)return{filePath:null,line:null,column:null};let r=t[o];return r?{filePath:r.file,line:r.line,column:null}:{filePath:null,line:null,column:null}}function Yl(e,t){let n=t.getComponent(e);if(n)return Ce(n.constructor.name);let o=e;for(;o;){let r=t.getOwningComponent(o);if(r)return Ce(r.constructor.name);o=o.parentElement}return null}var Yr={name:"Angular",resolveComponent:e=>{let t=jr(e);return t.name?t:null},resolveSource:Wr,cleanClasses:e=>e.filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))};var yt={filePath:null,line:null,column:null};function qe(e){let t=e.replace(/\\/g,"/").replace(/^file:\/\//,"").split("?")[0];if(!/^(\/|[A-Za-z]:\/)/.test(t))return t;let n=t.lastIndexOf("/src/");if(n>=0){let o=/\/((?:packages|apps|libs)\/[^/]+)$/.exec(t.slice(0,n));return`${o?`${o[1]}/`:""}${t.slice(n+1)}`}for(let o of["app","pages","components","routes","lib"]){let r=t.lastIndexOf(`/${o}/`);if(r>=0)return t.slice(r+1)}return t.split("/").slice(-3).join("/")}function be(e){return(e.replace(/\\/g,"/").split("/").pop()??e).replace(/\.(vue|svelte|[cm]?[jt]sx?)$/,"")}var Xl=["__reactFiber$","__reactInternalInstance$"];function Et(e){let t=Object.keys(e);for(let n of Xl){let o=t.find(r=>r.startsWith(n));if(o)return e[o]??null}return null}function vt(e,t=0){if(!e||t>4||typeof e=="string")return null;if(typeof e=="function"){let n=e;return n.displayName||n.name||null}if(typeof e=="object"){let n=e;if(n.displayName)return n.displayName;if(n.render)return vt(n.render,t+1);if(n.type)return vt(n.type,t+1)}return null}function mn(e,t=0){if(t>8)return null;if(e.stateNode instanceof Element)return e.stateNode;let n=e.child;for(;n;){let o=mn(n,t+1);if(o)return o;n=n.sibling}return null}var ql=12,Zl=new Set(["Slot","SlotClone","Presence","Primitive","Anonymous","Unknown"]);function Jl(e){return Zl.has(e)||e.startsWith("_")||e.includes(".")}function Xr(e){let t=Et(e);if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=t;for(;o&&n.length<ql;){let r=vt(o.type);r&&!Jl(r)&&n[n.length-1]?.name!==r&&n.push({name:r,hostElement:mn(o)}),o=o.return}return{name:n[0]?.name??null,hostElement:n[0]?.hostElement??null,stack:n}}var qr="data-grabby-loc",Zr=/^(.*?):(\d+):(\d+)(?::([A-Za-z_$][\w$.]*))?$/;function Jr(e){let t=e;for(;t;){let n=t.getAttribute?.(qr);if(n)return Ql(n);t=t.parentElement}return{filePath:null,line:null,column:null}}function Ql(e){let t=Zr.exec(e);return t?{filePath:t[1],line:Number(t[2]),column:Number(t[3])}:{filePath:e,line:null,column:null}}function Qr(e){let t=e?.getAttribute?.(qr);if(!t)return null;let n=Zr.exec(t);return n?{file:n[1],line:Number(n[2]),column:Number(n[3]),name:n[4]??null}:{file:t,line:null,column:null,name:null}}function ec(e){return!("_debugOwner"in e)&&!("_debugSource"in e)&&!("_debugStack"in e)}function tc(e){let t=[];for(let n of e.stack){let o=Qr(n.hostElement),r=o?.name??(o?be(o.file):null);r&&t[t.length-1]?.name!==r&&t.push({name:r,hostElement:n.hostElement})}return t[0]?{name:t[0].name,hostElement:t[0].hostElement,stack:t}:null}var ei={name:"React",resolveComponent:e=>{let t=Xr(e);if(!t.name)return null;let n=Et(e);return n&&ec(n)?tc(t)??{name:null,hostElement:null,stack:[]}:t}};var ti=new Set(["KeepAlive","Transition","TransitionGroup","Teleport","Suspense","BaseTransition","RouterView","RouterLink"]),ni=12;function oi(e){let t=e??null;for(;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.nextSibling;return t}function ri(e){let t=e;for(;t;){let n=t.__vueParentComponent;if(n)return n;t=t.parentElement}return null}function nc(e){let t=e.type??{};return t.__name||t.name||t.displayName||(t.__file?be(t.__file):null)}function oc(e){return oi(e.subTree?.el??e.vnode?.el)}function ii(e){let t=e;for(;t;){let n=t.__vue__;if(n)return n;t=t.parentElement}return null}function rc(e){let t=e.$options??{};return t.name||t._componentTag||(t.__file?be(t.__file):null)}function ic(e){let t=ri(e);if(t){let o=[];for(let i=t;i&&o.length<ni;i=i.parent){let a=nc(i);a&&!ti.has(a)&&o.push({name:a,hostElement:oc(i)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}let n=ii(e);if(n){let o=[];for(let i=n;i&&o.length<ni;i=i.$parent){let a=rc(i);a&&!ti.has(a)&&o.push({name:a,hostElement:oi(i.$el)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}return null}function ac(e){let n=ri(e)?.type?.__file??ii(e)?.$options?.__file;return n?{filePath:qe(n),line:null,column:null}:yt}var ai={name:"Vue",resolveComponent:ic,resolveSource:ac};var sc=12;function si(e){let t=e;for(;t;){let n=t.__svelte_meta;if(n?.loc)return{meta:n,el:t};t=t.parentElement}return null}function lc(e){let t=e.loc?.line;return typeof t!="number"?null:"parent"in e?t:t+1}function cc(e){let t=si(e);if(!t?.meta.loc?.file)return null;let{meta:n}=t,o=be(n.loc.file),r=[{name:o,hostElement:t.el}];for(let i=n.parent;i&&r.length<sc;i=i.parent){if(i.type!=="component"||!i.file)continue;let a=be(i.file);a!==r[r.length-1].name&&r.push({name:a,hostElement:null,filePath:qe(i.file),line:typeof i.line=="number"?i.line:null})}return{name:o,hostElement:t.el,stack:r}}function uc(e){let t=si(e),n=t?.meta.loc?.file;if(!t||!n)return yt;let o=t.meta.loc?.column;return{filePath:qe(n),line:lc(t.meta),column:typeof o=="number"?o+1:null}}var li={name:"Svelte",resolveComponent:cc,resolveSource:uc,cleanClasses:e=>e.filter(t=>!/^svelte-[a-z0-9]+$/i.test(t)&&!/^s-[A-Za-z0-9_-]{8,}$/.test(t))};var ci={name:"HTML",resolveComponent:e=>{let t=e.closest("[data-component]"),n=t?.getAttribute("data-component");if(!t||!n)return null;let o=[];for(let r=t;r;r=r.parentElement?.closest("[data-component]")??null){let i=r.getAttribute("data-component");if(i&&o.push({name:i,hostElement:r}),o.length>=12)break}return{name:n,hostElement:t,stack:o}}};var fn=[Yr,ei,ai,li,ci];function ui(e=fn){function t(n){for(let o of e)try{let r=o.resolveComponent(n);if(r?.name)return{adapter:o,result:r}}catch{}return null}return{resolveComponent(n){return t(n)?.result??null},resolveSource(n){let o=Jr(n);if(o.filePath)return o;let r=t(n),i=r?[r.adapter,...e.filter(a=>a!==r.adapter)]:e;for(let a of i)try{let s=a.resolveSource?.(n);if(s?.filePath)return s}catch{}return null},frameworkFor(n){return t(n)?.adapter.name??"HTML"},cleanClasses(n){return e.reduce((o,r)=>r.cleanClasses?r.cleanClasses(o):o,n)}}}var dc=200,di="grabby:v1:level",pn=8e3;function mc(){return{activationKey:"Alt+G",activationMode:"toggle",keyHoldDuration:0,enabled:!0,enableInInputs:!1,devOnly:!0,showToolbar:!0,themeMode:"light",mode:"local",persistHistory:!0,copyOnComment:!1,detailLevel:"standard",screenshots:!0,captureQueryParams:[]}}function mi(e){return e?.mode==="live"&&!Oo(e.projectKey)?fc(e):pi(e)}function fc(e){let t=null,n=[],o=a=>{t?a(t):n.push(a)},r=e.server?pc(e):null,i={...fi(),setOptions:a=>o(s=>s.setOptions(a)),registerPlugin:a=>o(s=>s.registerPlugin(a)),unregisterPlugin:a=>o(s=>s.unregisterPlugin(a)),setComponentResolver:a=>o(s=>s.setComponentResolver(a)),setSourceResolver:a=>o(s=>s.setSourceResolver(a)),identify:a=>o(s=>s.identify(a)),show(){if(t){t.show();return}r?.dispose(),ct(),t=pi(e);for(let a of n.splice(0))a(t);Object.assign(i,t)}};return i}function pc(e){try{if(!localStorage.getItem("grabby:v1:outbox"))return null}catch{return null}let t=Zt();return Vt({server:e.server,projectKey:e.projectKey,getComment:n=>t.find(o=>o.id===n),getScreenshot:Ue,onState(n,o){t=t.map(r=>r.id===n?{...r,sync:o}:r),Jt(t)}})}function bc(){try{if(typeof ngDevMode<"u"&&ngDevMode===!1)return!1}catch{}try{if(process.env.NODE_ENV==="production")return!1}catch{}return!0}function gc(e){try{let t=localStorage.getItem(di);if(t==="compact"||t==="standard"||t==="detailed")return t}catch{}return e}function hc(e){try{localStorage.setItem(di,e)}catch{}}function fi(){let e=()=>{};return{activate:e,deactivate:e,toggle:e,isActive:()=>!1,setOptions:e,registerPlugin:e,unregisterPlugin:e,setComponentResolver:e,setSourceResolver:e,showToolbar:e,hideToolbar:e,setThemeMode:e,getComments:()=>[],exportComments:()=>"",deleteComment:e,clearComments:e,identify:e,show:e,hide:e,dispose:e}}function pi(e){let n={...mc(),...e},o=n.mode==="live";if(!o&&n.devOnly&&!bc())return fi();let r=n.identity??(o?"ask":"none"),i=null;In(n.styleNonce);let a=_n(n);if(n.persistHistory){let d=Zt();d.length>0&&(a.state.toolbar={...a.state.toolbar,comments:d})}let s=jn({plainLabels:o}),u=Yn(),c=Go(),l=co(),m=po(),p=$o(),f=null,E=ui(n.adapters??fn),g=E.resolveComponent,h=E.resolveSource,x=d=>E.cleanClasses(d.filter(C=>!Me(C))),b=null,v=null,y=gc(n.detailLevel),T=new Map;m.apply(a.state.toolbar.themeMode),Je();function S(){return a.state.toolbar.comments}function I(d){a.state.toolbar={...a.state.toolbar,comments:d},Y.update(a.state),B.refresh(d),ie.update(j())}function j(){let d=S(),C=k=>d.filter(M=>M.sync===k).length;return{total:d.length,sent:C("sent"),pending:C("pending"),failed:C("failed")}}function ge(){return ae.hasDraft()||!!f&&S().some(d=>d.sync==="pending")}function U(d,C){let k=vo(d,C,{origin:location.host});return l.callTransformHook(k,d)}function he(){return r==="anonymous"?{name:null,anonymous:!0,sessionId:bt()}:i?{name:i.name,anonymous:!1,sessionId:bt(),...i.id?{userId:i.id}:{}}:Kr(gt())}function ee(){return r==="ask"&&!i&&!gt()}function gi(){if(r!=="ask")return null;if(i)return i.name;let d=gt();return d?d.anonymous||!d.name?"anonymous":d.name:null}function hi(d,C){let k=S().find(M=>M.id===d);!k||k.sync===C||(o&&C==="sent"&&K("Feedback sent. Thank you!"),o&&C==="failed"&&K("Your feedback couldn't be sent. Please try again later."),I(S().map(M=>M.id===d?{...M,sync:C}:M)))}function bn(d){return{componentName:d.target.component,filePath:d.target.source?.file??null,line:d.target.source?.line??null,column:d.target.source?.column??null}}function yi(d,C,k){let M=Date.now(),L={id:Xe(),createdAt:M,updatedAt:M,status:"open",comment:C,author:he(),page:{route:On(location,a.state.options.captureQueryParams),title:document.title,viewport:[window.innerWidth,window.innerHeight]},target:er(d,{componentResolver:g,sourceResolver:h,cleanClasses:x}),screenshot:null,framework:E.frameworkFor(d),...f?{sync:"pending"}:{}};I([L,...S()].slice(0,dc)),l.callHook("onComment",L,d),f?.send(L.id),k&&vi(L.id,k);let D=S().length;if(o)return K("Thanks! Sending your feedback\u2026"),L;let _e={label:D===1?"Copy":`Copy all ${D}`,onClick:hn,primary:!0};return a.state.options.copyOnComment?gn(U([L],y)).then(wt=>{K(wt?"Comment saved and copied":"Comment saved (clipboard blocked)",{detail:bn(L),actions:D>1?[_e]:[]})}):K(D===1?"Comment saved":`Comment saved \xB7 ${D} total`,{detail:bn(L),actions:[_e]}),L}async function vi(d,C){let k=await C;if(!k)return;await Eo(d,k.blob);let M=S().find(D=>D.id===d);if(!M){Ft([d]);return}let L={...M,screenshot:{localId:d,width:k.width,height:k.height}};I(S().map(D=>D.id===d?L:D)),l.callHook("onScreenshot",L,k.blob),f?.sendScreenshot(d)}function Te(d,C,k=!1){if(d.length===0)return;let M=new Set(d),L=S(),D=L.filter(O=>M.has(O.id));I(L.filter(O=>!M.has(O.id)));let _e=k&&f?D.filter(O=>O.sync!==void 0):[],wt=new Set(_e.filter(O=>f.isQueued(O.id)).map(O=>O.id));for(let O of _e)f.remove(O.id,O.author.sessionId,C?pn+500:0);let xi=D.flatMap(O=>O.screenshot?.localId?[O.screenshot.localId]:[]),et=Xe();T.set(et,setTimeout(()=>{T.delete(et),Ft(xi)},pn+500)),C&&K(C,{duration:pn,actions:[{label:"Undo",onClick:()=>{clearTimeout(T.get(et)),T.delete(et);let O=new Set(S().map(F=>F.id)),An=new Set(_e.filter(F=>!O.has(F.id)&&(!f.cancelRemove(F.id)||F.sync!=="sent"||wt.has(F.id))).map(F=>F.id)),wi=[...D.filter(F=>!O.has(F.id)).map(F=>An.has(F.id)?{...F,sync:"pending"}:F),...S()].sort((F,Si)=>Si.createdAt-F.createdAt);I(wi);for(let F of An)f?.send(F);K(`Restored ${D.length} comment${D.length===1?"":"s"}`)}}]})}async function gn(d){try{return await navigator.clipboard.writeText(d),!0}catch(C){return l.callHook("onCopyError",C instanceof Error?C:new Error(String(C))),!1}}function hn(){let d=S();if(d.length===0){K("No comments to copy yet");return}re(),ke.open({count:d.length,level:y,render:C=>U(d,C)})}function yn(d){return Nn(d)||c.isFreezeElement(d)}function re(){B.hide(),ae.hide(),ke.close(),ie.close()}function vn(){if(ie.isVisible()){ie.close();return}re(),W(!0),ie.open(j())}function En(){re(),p.dismiss(),W(!0),a.state.toolbar={...a.state.toolbar,visible:!1},Y.hide(),o&&jt()}let xt=io({overlay:s,crosshair:u,getComponentResolver:()=>g,getSourceResolver:()=>h,isToolbarElement:yn,getFreezeElement:()=>c.getElement(),onHover(d){a.state.hoveredElement=d,d&&l.callHook("onElementHover",d)},onSelect(d){b=d,v=a.state.options.screenshots?Ur(d):null,l.callHook("onElementSelect",d),p.dismiss(),Vo(d),ae.show({anchor:d,mode:"new",askIdentity:ee()})}});function Ze(){a.state.options.enabled&&(a.state.active||(a.state.toolbar.visible===!1&&a.state.options.showToolbar&&(a.state.toolbar={...a.state.toolbar,visible:!0},Y.show()),re(),a.state.active=!0,xt.activate(),l.callHook("onActivate"),Y.update(a.state)))}function W(d=!1){a.state.active&&(!d&&a.state.frozen||(a.state.active=!1,a.state.frozen=!1,c.hide(),xt.deactivate(),l.callHook("onDeactivate"),Y.update(a.state)))}function Ei(){a.state.frozen=!a.state.frozen,a.state.frozen?c.show(a.state.hoveredElement):c.hide(),Y.update(a.state)}let Y=bo({onSelectionMode(){a.state.active?W(!0):Ze()},onHistory(){ae.hide(),ke.close(),B.isVisible()?B.hide():B.show([...S()])},onEnableToggle(){re();let d=!a.state.options.enabled;a.state.options={...a.state.options,enabled:d},d||W(!0),Y.update(a.state)},onDismiss(){let{pending:d,failed:C}=j();if(o&&f&&(d||C)){vn();return}En()},onFinish:vn},o?{label:"Comment",dismissLabel:"Exit feedback mode",hideEnable:!0,review:!!n.server}:{}),B=wo({onHover(d){let C=d?Fe(d.target.selector):null;C&&d?s.show(C,d.target.component,null,[]):s.hide()},onEdit(d,C){s.hide();let k=Fe(d.target.selector);B.hide(),ae.show({anchor:k??C,initialValue:d.comment,mode:"edit",entryId:d.id})},onDelete(d){s.hide(),Te([d.id],"Comment deleted",!0)},onCopyAll(){s.hide(),hn()},onClearAll(){s.hide();let d=S().length;Te(S().map(C=>C.id),`Cleared ${d} comment${d===1?"":"s"}`,!0),B.hide()},onChangeIdentity(){zr(),B.refresh(S()),K("We'll ask for your name on your next comment")}},{variant:o?"live":"local",showSync:!!n.server,identityLabel:gi}),ke=Ao({async onCopy(d,C){let k=S();if(!await gn(d))return!1;l.callHook("onCopySuccess",d,k);let L=`${k.length} comment${k.length===1?"":"s"}`;return C==="clear"?Te(k.map(D=>D.id),`Copied and cleared ${L}`):K(`Copied ${L}`),!0},onLevelChange(d){y=d,hc(d)}}),ie=Io({onDone(){let d=S().filter(k=>k.sync==="sent"&&!f?.isQueued(k.id)).map(k=>k.id);if(!S().length){En();return}Te(d,null);let C=S().length;K(C?`Thanks for your review! ${C} comment${C===1?" is":"s are"} still sending.`:"Thanks for your review! Your feedback was sent.")},onRetry(){let d=S().filter(C=>C.sync==="failed");if(d.length){let C=new Set(d.map(k=>k.id));I(S().map(k=>C.has(k.id)?{...k,sync:"pending"}:k));for(let k of C)f?.send(k)}f?.flush()}}),ae=So({onSubmit(d,C,k){if(k&&Vr({name:k.name,anonymous:!k.name}),C.mode==="new"){let L=b,D=v;b=null,v=null,L&&yi(L,d,D),W(!0);return}if(!C.entryId)return;let M=S().map(L=>L.id===C.entryId?{...L,comment:d,updatedAt:Date.now(),...f?{sync:"pending"}:{}}:L);I(M),f?.send(C.entryId),K("Comment updated"),B.show([...M])},onCancel(d){if(d.mode==="new"){b=null,v=null,W(!0);return}B.show([...S()])}});function xn(d){let C=le(d);C&&(yn(C)||(B.isVisible()||ae.isVisible()||ke.isVisible()||ie.isVisible())&&re())}document.addEventListener("click",xn);function wn(){Ie(),f?.flushOnExit()}function Sn(){document.visibilityState==="hidden"&&Ie()}window.addEventListener("pagehide",wn),document.addEventListener("visibilitychange",Sn);function Cn(d){!o||!ge()||(d.preventDefault(),d.returnValue="")}window.addEventListener("beforeunload",Cn);function Je(){a.state.toolbar.visible?document.documentElement.style.setProperty("--grabby-toast-bottom",Rn):document.documentElement.style.removeProperty("--grabby-toast-bottom")}function Tn(d){d.key.toLowerCase()!=="f"||d.metaKey||d.ctrlKey||d.altKey||ve(le(d))||a.state.active&&(d.preventDefault(),Ei())}document.addEventListener("keydown",Tn,!0);function kn(d){if(d.key==="Escape"&&!ve(le(d))&&!(ae.isVisible()||ke.isVisible()||ie.isVisible())){if(B.isVisible()){B.hide(),d.preventDefault();return}a.state.active&&(d.preventDefault(),W(!0))}}document.addEventListener("keydown",kn,!0);let Qe=lo({getActivationKey:()=>a.state.options.activationKey,getActivationMode:()=>a.state.options.activationMode,getKeyHoldDuration:()=>a.state.options.keyHoldDuration,getEnableInInputs:()=>a.state.options.enableInInputs,onActivate:Ze,onDeactivate:()=>W(),isActive:()=>a.state.active}),Ae={activate:Ze,deactivate:()=>W(!0),toggle(){a.state.active?W(!0):Ze()},isActive(){return a.state.active},setOptions(d){a.state.options={...a.state.options,...d}},registerPlugin(d){d.options&&(a.state.options={...a.state.options,...d.options}),d.theme&&m.applyOverrides(d.theme),l.register(d,Ae)},unregisterPlugin(d){l.unregister(d)},setComponentResolver(d){g=d},setSourceResolver(d){h=d},showToolbar(){a.state.toolbar={...a.state.toolbar,visible:!0},Y.show(),Y.update(a.state),Je()},hideToolbar(){re(),a.state.toolbar={...a.state.toolbar,visible:!1},Y.hide(),Je()},setThemeMode(d){a.state.toolbar={...a.state.toolbar,themeMode:d},m.apply(d),Y.update(a.state)},getComments(){return[...S()]},exportComments(d={}){let C=d.ids?new Set(d.ids):null,k=C?S().filter(M=>C.has(M.id)):S();return U(k,d.level??y)},deleteComment(d){Te([d],null,!0)},clearComments(){Te(S().map(d=>d.id),null)},identify(d){i=d&&d.name?{id:d.id,name:d.name.slice(0,80)}:null,B.refresh(S())},show(){o&&ct(),Ae.showToolbar()},hide(){o&&jt(),Ae.hideToolbar()},dispose(){Ie(),W(!0),document.removeEventListener("click",xn),window.removeEventListener("pagehide",wn),window.removeEventListener("beforeunload",Cn),document.removeEventListener("visibilitychange",Sn),document.removeEventListener("keydown",Tn,!0),document.removeEventListener("keydown",kn,!0),Qe.dispose(),xt.dispose(),s.dispose(),u.dispose(),c.dispose(),to(),zo(),l.dispose(),re(),Y.dispose(),B.dispose(),ae.dispose(),ke.dispose(),ie.dispose(),p.dispose(),f?.dispose(),m.dispose(),Yo(),Hr(),document.documentElement.style.removeProperty("--grabby-toast-bottom"),Ln()}};return a.state.options.enabled&&Qe.start(),a.state.toolbar={...a.state.toolbar,visible:!1},o&&n.showToolbar&&(Ae.showToolbar(),p.maybeShow()),a.subscribe((d,C)=>{C==="options"&&(d.options.enabled?Qe.start():(Qe.stop(),W(!0))),C==="toolbar"&&(Je(),d.options.persistHistory&&(d.toolbar.comments.length>0?Jt(d.toolbar.comments):Wo()))}),n.server&&(f=Vt({server:n.server,projectKey:n.projectKey,getComment:d=>S().find(C=>C.id===d),getScreenshot:Ue,onState:(d,C)=>hi(d,C)})),n.webhookUrl&&Ae.registerPlugin(uo(n.webhookUrl)),Ae}function yc(e){let t=e?.dataset??{},n={};return(t.mode==="live"||t.mode==="local")&&(n.mode=t.mode),t.server&&(n.server=t.server),t.projectKey&&(n.projectKey=t.projectKey),(t.identity==="ask"||t.identity==="anonymous"||t.identity==="none")&&(n.identity=t.identity),t.activationKey&&(n.activationKey=t.activationKey),t.screenshots==="false"&&(n.screenshots=!1),t.webhookUrl&&(n.webhookUrl=t.webhookUrl),t.styleNonce?n.styleNonce=t.styleNonce:e?.nonce&&(n.styleNonce=e.nonce),n}var bi=mi(yc(document.currentScript));window.grabby=bi;var hm=bi;})();
|