jat-feedback 1.6.6 → 1.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jat-feedback.js +2 -2
- package/dist/jat-feedback.mjs +3 -2
- package/package.json +1 -1
package/dist/jat-feedback.js
CHANGED
|
@@ -29,7 +29,7 @@ var Tv=Object.defineProperty;var jl=de=>{throw TypeError(de)};var Nv=(de,ve,Ce)=
|
|
|
29
29
|
z-index: 2147483646;
|
|
30
30
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
31
31
|
pointer-events: none;
|
|
32
|
-
`,document.body.appendChild(e),e}function Ra(e){if(!ir||!Jt)return;const t=e.target;if(t===Jt||t.id==="jat-feedback-picker-tooltip")return;const n=t.getBoundingClientRect();Jt.style.top=`${n.top}px`,Jt.style.left=`${n.left}px`,Jt.style.width=`${n.width}px`,Jt.style.height=`${n.height}px`}function ja(e){var o;if(!ir)return;e.preventDefault(),e.stopPropagation();const t=e.target,n=t.getBoundingClientRect(),r=Uo;La();const s={tagName:t.tagName,className:typeof t.className=="string"?t.className:"",id:t.id,textContent:((o=t.textContent)==null?void 0:o.substring(0,100))||"",attributes:Array.from(t.attributes).reduce((i,l)=>(i[l.name]=l.value,i),{}),xpath:Ta(t),selector:kf(t),boundingRect:{x:n.x,y:n.y,width:n.width,height:n.height,top:n.top,left:n.left,bottom:n.bottom,right:n.right},screenshot:null,timestamp:new Date().toISOString(),url:window.location.href};r==null||r(s)}function Ia(e){e.key==="Escape"&&La()}function Ma(e){ir||(ir=!0,Uo=e,Na=document.body.style.cursor,document.body.style.cursor="crosshair",Jt=Sf(),Qs=$f(),document.addEventListener("mousemove",Ra,!0),document.addEventListener("click",ja,!0),document.addEventListener("keydown",Ia,!0))}function La(){ir&&(ir=!1,Uo=null,document.body.style.cursor=Na,Jt&&(Jt.remove(),Jt=null),Qs&&(Qs.remove(),Qs=null),document.removeEventListener("mousemove",Ra,!0),document.removeEventListener("click",ja,!0),document.removeEventListener("keydown",Ia,!0))}function Cf(){return ir}const Pa=["#ef4444","#eab308","#22c55e","#3b82f6","#ffffff","#111827"],Da=3;let qa=!1;function Oa(e){qa=e}function Af(){return qa}let Tf=1;function ls(){return Tf++}function Nf(e,t){const{start:n,end:r,color:s,strokeWidth:o}=t;e.strokeStyle=s,e.lineWidth=o,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.stroke();const i=Math.atan2(r.y-n.y,r.x-n.x),l=14,c=Math.PI/7;e.beginPath(),e.moveTo(r.x,r.y),e.lineTo(r.x-l*Math.cos(i-c),r.y-l*Math.sin(i-c)),e.moveTo(r.x,r.y),e.lineTo(r.x-l*Math.cos(i+c),r.y-l*Math.sin(i+c)),e.stroke()}function Rf(e,t){const{start:n,end:r,color:s,strokeWidth:o}=t;e.strokeStyle=s,e.lineWidth=o,e.lineJoin="round";const i=Math.min(n.x,r.x),l=Math.min(n.y,r.y),c=Math.abs(r.x-n.x),u=Math.abs(r.y-n.y);e.strokeRect(i,l,c,u)}function jf(e,t){const{start:n,end:r,color:s,strokeWidth:o}=t;e.strokeStyle=s,e.lineWidth=o;const i=(n.x+r.x)/2,l=(n.y+r.y)/2,c=Math.abs(r.x-n.x)/2,u=Math.abs(r.y-n.y)/2;c<1||u<1||(e.beginPath(),e.ellipse(i,l,c,u,0,0,Math.PI*2),e.stroke())}function If(e,t){const{points:n,color:r,strokeWidth:s}=t;if(!(n.length<2)){e.strokeStyle=r,e.lineWidth=s,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(n[0].x,n[0].y);for(let o=1;o<n.length;o++)e.lineTo(n[o].x,n[o].y);e.stroke()}}function Mf(e,t){const{position:n,content:r,color:s,fontSize:o}=t;r&&(e.font=`bold ${o}px sans-serif`,e.textBaseline="top",e.strokeStyle="#000000",e.lineWidth=2,e.lineJoin="round",e.strokeText(r,n.x,n.y),e.fillStyle=s,e.fillText(r,n.x,n.y))}function Fa(e,t){switch(e.save(),t.type){case"arrow":Nf(e,t);break;case"rectangle":Rf(e,t);break;case"ellipse":jf(e,t);break;case"freehand":If(e,t);break;case"text":Mf(e,t);break}e.restore()}function za(e,t){for(const n of t)Fa(e,n)}function Lf(e,t,n,r){return new Promise((s,o)=>{const i=new Image;i.onload=()=>{const l=document.createElement("canvas");l.width=n,l.height=r;const c=l.getContext("2d");if(!c){o(new Error("Canvas context unavailable"));return}c.drawImage(i,0,0,n,r),za(c,t),s(l.toDataURL("image/jpeg",.85))},i.onerror=()=>o(new Error("Failed to load image")),i.src=e})}async function Ba(e,t){const n=`${e.replace(/\/$/,"")}/api/feedback/report`,r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),s=await r.json();return r.ok?{ok:!0,id:s.id}:{ok:!1,error:s.error||`HTTP ${r.status}`}}async function Pf(e){try{const t=`${e.replace(/\/$/,"")}/api/feedback/reports`,n=await fetch(t,{method:"GET"});if(!n.ok){const s=await n.json().catch(()=>({error:`HTTP ${n.status}`}));return{reports:[],error:s.error||`HTTP ${n.status}`}}return{reports:(await n.json()).reports||[]}}catch(t){return{reports:[],error:t instanceof Error?t.message:"Failed to fetch"}}}async function Df(e,t,n,r,s){try{const o=`${e.replace(/\/$/,"")}/api/feedback/reports/${t}/respond`,i={response:n};r&&(i.reason=r),s!=null&&s.screenshots&&s.screenshots.length>0&&(i.screenshots=s.screenshots),s!=null&&s.elements&&s.elements.length>0&&(i.elements=s.elements);const l=await fetch(o,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),c=await l.json();return l.ok?{ok:!0}:{ok:!1,error:c.error||`HTTP ${l.status}`}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"Failed to respond"}}}const Ua="jat-feedback-queue",qf=50,Of=3e4;let cs=null;function Ha(){try{const e=localStorage.getItem(Ua);return e?JSON.parse(e):[]}catch{return[]}}function Va(e){try{localStorage.setItem(Ua,JSON.stringify(e))}catch{}}function Wa(e,t){const n=Ha();for(n.push({report:t,endpoint:e,queuedAt:new Date().toISOString(),attempts:0});n.length>qf;)n.shift();Va(n)}async function Ya(){const e=Ha();if(e.length===0)return;const t=[];for(const n of e)try{(await Ba(n.endpoint,n.report)).ok||(n.attempts++,t.push(n))}catch{n.attempts++,t.push(n)}Va(t)}function Ff(){cs||(Ya(),cs=setInterval(Ya,Of))}function zf(){cs&&(clearInterval(cs),cs=null)}var Bf=sr('<svg width="20" height="20" viewBox="0 0 20 20" fill="none"><path d="M15 5L5 15M5 5L15 15" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>'),Uf=sr('<svg width="22" height="22" viewBox="0 0 24 24" fill="none"><path d="M12 2C6.48 2 2 6.48 2 12C2 13.85 2.5 15.55 3.36 17L2 22L7 20.64C8.45 21.5 10.15 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2Z" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8 10H8.01M12 10H12.01M16 10H16.01" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>'),Hf=j("<button><!></button>");const Vf={hash:"svelte-joatup",code:".jat-fb-btn.svelte-joatup {width:52px;height:52px;border-radius:50%;border:none;background:var(--jat-btn-color, #3b82f6);color:white;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 14px rgba(0, 0, 0, 0.25);transition:transform 0.2s, box-shadow 0.2s, background 0.2s;}.jat-fb-btn.svelte-joatup:hover {transform:scale(1.08);box-shadow:0 6px 20px rgba(0, 0, 0, 0.3);}.jat-fb-btn.svelte-joatup:active {transform:scale(0.95);}.jat-fb-btn.open.svelte-joatup {background:#6b7280;}"};function Xa(e,t){pn(t,!0),Pn(e,Vf);let n=Y(t,"onmousedown",7),r=Y(t,"open",7,!1);var s={get onmousedown(){return n()},set onmousedown(f){n(f),U()},get open(){return r()},set open(f=!1){r(f),U()}},o=Hf();let i;var l=x(o);{var c=f=>{var d=Bf();$(f,d)},u=f=>{var d=Uf();$(f,d)};B(l,f=>{r()?f(c):f(u,!1)})}return w(o),F(()=>{i=Ye(o,1,"jat-fb-btn svelte-joatup",null,i,{open:r()}),ce(o,"aria-label",r()?"Close feedback":"Send feedback"),ce(o,"title",r()?"Close feedback":"Send feedback")}),H("mousedown",o,function(...f){var d;(d=n())==null||d.apply(this,f)}),$(e,o),hn(s)}ns(["mousedown"]),Dn(Xa,{onmousedown:{},open:{}},[],[],{mode:"open"});const Ka="[modern-screenshot]",Ir=typeof window<"u",Wf=Ir&&"Worker"in window,Ho=Ir?(Rl=window.navigator)==null?void 0:Rl.userAgent:"",Ga=Ho.includes("Chrome"),eo=Ho.includes("AppleWebKit")&&!Ga,Vo=Ho.includes("Firefox"),Yf=e=>e&&"__CONTEXT__"in e,Xf=e=>e.constructor.name==="CSSFontFaceRule",Kf=e=>e.constructor.name==="CSSImportRule",Gf=e=>e.constructor.name==="CSSLayerBlockRule",Zt=e=>e.nodeType===1,fs=e=>typeof e.className=="object",Ja=e=>e.tagName==="image",Jf=e=>e.tagName==="use",us=e=>Zt(e)&&typeof e.style<"u"&&!fs(e),Zf=e=>e.nodeType===8,Qf=e=>e.nodeType===3,Mr=e=>e.tagName==="IMG",to=e=>e.tagName==="VIDEO",eu=e=>e.tagName==="CANVAS",tu=e=>e.tagName==="TEXTAREA",nu=e=>e.tagName==="INPUT",ru=e=>e.tagName==="STYLE",su=e=>e.tagName==="SCRIPT",ou=e=>e.tagName==="SELECT",iu=e=>e.tagName==="SLOT",au=e=>e.tagName==="IFRAME",lu=(...e)=>console.warn(Ka,...e);function cu(e){var n;const t=(n=e==null?void 0:e.createElement)==null?void 0:n.call(e,"canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}const Wo=e=>e.startsWith("data:");function Za(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Ir&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!Ir)return e;const n=no().implementation.createHTMLDocument(),r=n.createElement("base"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),t&&(r.href=t),s.href=e,s.href}function no(e){return(e&&Zt(e)?e==null?void 0:e.ownerDocument:e)??window.document}const ro="http://www.w3.org/2000/svg";function fu(e,t,n){const r=no(n).createElementNS(ro,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function uu(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)}`}function du(e,t){return new Promise((n,r)=>{const s=new FileReader;s.onload=()=>n(s.result),s.onerror=()=>r(s.error),s.onabort=()=>r(new Error(`Failed read blob to ${t}`)),s.readAsDataURL(e)})}const vu=e=>du(e,"dataUrl");function Lr(e,t){const n=no(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function ds(e,t){return new Promise(n=>{const{timeout:r,ownerDocument:s,onError:o,onWarn:i}=t??{},l=typeof e=="string"?Lr(e,no(s)):e;let c=null,u=null;function f(){n(l),c&&clearTimeout(c),u==null||u()}if(r&&(c=setTimeout(f,r)),to(l)){const d=l.currentSrc||l.src;if(!d)return l.poster?ds(l.poster,t).then(n):f();if(l.readyState>=2)return f();const v=f,h=b=>{i==null||i("Failed video load",d,b),o==null||o(b),f()};u=()=>{l.removeEventListener("loadeddata",v),l.removeEventListener("error",h)},l.addEventListener("loadeddata",v,{once:!0}),l.addEventListener("error",h,{once:!0})}else{const d=Ja(l)?l.href.baseVal:l.currentSrc||l.src;if(!d)return f();const v=async()=>{if(Mr(l)&&"decode"in l)try{await l.decode()}catch(b){i==null||i("Failed to decode image, trying to render anyway",l.dataset.originalSrc||d,b)}f()},h=b=>{i==null||i("Failed image load",l.dataset.originalSrc||d,b),f()};if(Mr(l)&&l.complete)return v();u=()=>{l.removeEventListener("load",v),l.removeEventListener("error",h)},l.addEventListener("load",v,{once:!0}),l.addEventListener("error",h,{once:!0})}})}async function pu(e,t){us(e)&&(Mr(e)||to(e)?await ds(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(r=>ds(r,t)))))}const Qa=(function(){let t=0;const n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();function el(e){return e==null?void 0:e.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}let tl=0;function hu(e){const t=`${Ka}[#${tl}]`;return tl++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&lu(...n)}}function gu(e){return{cache:e?"no-cache":"force-cache"}}async function nl(e,t){return Yf(e)?e:mu(e,{...t,autoDestruct:!0})}async function mu(e,t){var h,b;const{scale:n=1,workerUrl:r,workerNumber:s=1}=t||{},o=!!(t!=null&&t.debug),i=(t==null?void 0:t.features)??!0,l=e.ownerDocument??(Ir?window.document:void 0),c=((h=e.ownerDocument)==null?void 0:h.defaultView)??(Ir?window:void 0),u=new Map,f={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:o,fetch:{requestInit:gu((b=t==null?void 0:t.fetch)==null?void 0:b.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t==null?void 0:t.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:s,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:hu(o),node:e,ownerDocument:l,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:rl(l),svgDefsElement:l==null?void 0:l.createElementNS(ro,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Wf&&r&&s?s:0})].map(()=>{try{const _=new Worker(r);return _.onmessage=async p=>{var k,M,L,z;const{url:m,result:T}=p.data;T?(M=(k=u.get(m))==null?void 0:k.resolve)==null||M.call(k,T):(z=(L=u.get(m))==null?void 0:L.reject)==null||z.call(L,new Error(`Error receiving message from worker: ${m}`))},_.onmessageerror=p=>{var T,k;const{url:m}=p.data;(k=(T=u.get(m))==null?void 0:T.reject)==null||k.call(T,new Error(`Error receiving message from worker: ${m}`))},_}catch(_){return f.log.warn("Failed to new Worker",_),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[cu(l)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:u,drawImageCount:0,tasks:[],features:i,isEnable:_=>_==="restoreScrollPosition"?typeof i=="boolean"?!1:i[_]??!1:typeof i=="boolean"?i:i[_]??!0,shadowRoots:[]};f.log.time("wait until load"),await pu(e,{timeout:f.timeout,onWarn:f.log.warn}),f.log.timeEnd("wait until load");const{width:d,height:v}=bu(e,f);return f.width=d,f.height=v,f}function rl(e){if(!e)return;const t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
|
|
32
|
+
`,document.body.appendChild(e),e}function Ra(e){if(!ir||!Jt)return;const t=e.target;if(t===Jt||t.id==="jat-feedback-picker-tooltip")return;const n=t.getBoundingClientRect();Jt.style.top=`${n.top}px`,Jt.style.left=`${n.left}px`,Jt.style.width=`${n.width}px`,Jt.style.height=`${n.height}px`}function ja(e){var o;if(!ir)return;e.preventDefault(),e.stopPropagation();const t=e.target,n=t.getBoundingClientRect(),r=Uo;La();const s={tagName:t.tagName,className:typeof t.className=="string"?t.className:"",id:t.id,textContent:((o=t.textContent)==null?void 0:o.substring(0,100))||"",attributes:Array.from(t.attributes).reduce((i,l)=>(i[l.name]=l.value,i),{}),xpath:Ta(t),selector:kf(t),boundingRect:{x:n.x,y:n.y,width:n.width,height:n.height,top:n.top,left:n.left,bottom:n.bottom,right:n.right},screenshot:null,timestamp:new Date().toISOString(),url:window.location.href};r==null||r(s)}function Ia(e){e.key==="Escape"&&La()}function Ma(e){ir||(ir=!0,Uo=e,Na=document.body.style.cursor,document.body.style.cursor="crosshair",Jt=Sf(),Qs=$f(),document.addEventListener("mousemove",Ra,!0),document.addEventListener("click",ja,!0),document.addEventListener("keydown",Ia,!0))}function La(){ir&&(ir=!1,Uo=null,document.body.style.cursor=Na,Jt&&(Jt.remove(),Jt=null),Qs&&(Qs.remove(),Qs=null),document.removeEventListener("mousemove",Ra,!0),document.removeEventListener("click",ja,!0),document.removeEventListener("keydown",Ia,!0))}function Cf(){return ir}const Pa=["#ef4444","#eab308","#22c55e","#3b82f6","#ffffff","#111827"],Da=3;let qa=!1;function Oa(e){qa=e}function Af(){return qa}let Tf=1;function ls(){return Tf++}function Nf(e,t){const{start:n,end:r,color:s,strokeWidth:o}=t;e.strokeStyle=s,e.lineWidth=o,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.stroke();const i=Math.atan2(r.y-n.y,r.x-n.x),l=14,c=Math.PI/7;e.beginPath(),e.moveTo(r.x,r.y),e.lineTo(r.x-l*Math.cos(i-c),r.y-l*Math.sin(i-c)),e.moveTo(r.x,r.y),e.lineTo(r.x-l*Math.cos(i+c),r.y-l*Math.sin(i+c)),e.stroke()}function Rf(e,t){const{start:n,end:r,color:s,strokeWidth:o}=t;e.strokeStyle=s,e.lineWidth=o,e.lineJoin="round";const i=Math.min(n.x,r.x),l=Math.min(n.y,r.y),c=Math.abs(r.x-n.x),u=Math.abs(r.y-n.y);e.strokeRect(i,l,c,u)}function jf(e,t){const{start:n,end:r,color:s,strokeWidth:o}=t;e.strokeStyle=s,e.lineWidth=o;const i=(n.x+r.x)/2,l=(n.y+r.y)/2,c=Math.abs(r.x-n.x)/2,u=Math.abs(r.y-n.y)/2;c<1||u<1||(e.beginPath(),e.ellipse(i,l,c,u,0,0,Math.PI*2),e.stroke())}function If(e,t){const{points:n,color:r,strokeWidth:s}=t;if(!(n.length<2)){e.strokeStyle=r,e.lineWidth=s,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(n[0].x,n[0].y);for(let o=1;o<n.length;o++)e.lineTo(n[o].x,n[o].y);e.stroke()}}function Mf(e,t){const{position:n,content:r,color:s,fontSize:o}=t;r&&(e.font=`bold ${o}px sans-serif`,e.textBaseline="top",e.strokeStyle="#000000",e.lineWidth=2,e.lineJoin="round",e.strokeText(r,n.x,n.y),e.fillStyle=s,e.fillText(r,n.x,n.y))}function Fa(e,t){switch(e.save(),t.type){case"arrow":Nf(e,t);break;case"rectangle":Rf(e,t);break;case"ellipse":jf(e,t);break;case"freehand":If(e,t);break;case"text":Mf(e,t);break}e.restore()}function za(e,t){for(const n of t)Fa(e,n)}function Lf(e,t,n,r){return new Promise((s,o)=>{const i=new Image;i.onload=()=>{const l=document.createElement("canvas");l.width=n,l.height=r;const c=l.getContext("2d");if(!c){o(new Error("Canvas context unavailable"));return}c.drawImage(i,0,0,n,r),za(c,t),s(l.toDataURL("image/jpeg",.85))},i.onerror=()=>o(new Error("Failed to load image")),i.src=e})}async function Ba(e,t){const n=`${e.replace(/\/$/,"")}/api/feedback/report`,r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),s=await r.json();return r.ok?{ok:!0,id:s.id}:{ok:!1,error:s.error||`HTTP ${r.status}`}}async function Pf(e){try{const t=`${e.replace(/\/$/,"")}/api/feedback/reports`,n=await fetch(t,{method:"GET",credentials:"same-origin"});if(!n.ok){const s=await n.json().catch(()=>({error:`HTTP ${n.status}`}));return{reports:[],error:s.error||`HTTP ${n.status}`}}return{reports:(await n.json()).reports||[]}}catch(t){return{reports:[],error:t instanceof Error?t.message:"Failed to fetch"}}}async function Df(e,t,n,r,s){try{const o=`${e.replace(/\/$/,"")}/api/feedback/reports/${t}/respond`,i={response:n};r&&(i.reason=r),s!=null&&s.screenshots&&s.screenshots.length>0&&(i.screenshots=s.screenshots),s!=null&&s.elements&&s.elements.length>0&&(i.elements=s.elements);const l=await fetch(o,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),c=await l.json();return l.ok?{ok:!0}:{ok:!1,error:c.error||`HTTP ${l.status}`}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"Failed to respond"}}}const Ua="jat-feedback-queue",qf=50,Of=3e4;let cs=null;function Ha(){try{const e=localStorage.getItem(Ua);return e?JSON.parse(e):[]}catch{return[]}}function Va(e){try{localStorage.setItem(Ua,JSON.stringify(e))}catch{}}function Wa(e,t){const n=Ha();for(n.push({report:t,endpoint:e,queuedAt:new Date().toISOString(),attempts:0});n.length>qf;)n.shift();Va(n)}async function Ya(){const e=Ha();if(e.length===0)return;const t=[];for(const n of e)try{(await Ba(n.endpoint,n.report)).ok||(n.attempts++,t.push(n))}catch{n.attempts++,t.push(n)}Va(t)}function Ff(){cs||(Ya(),cs=setInterval(Ya,Of))}function zf(){cs&&(clearInterval(cs),cs=null)}var Bf=sr('<svg width="20" height="20" viewBox="0 0 20 20" fill="none"><path d="M15 5L5 15M5 5L15 15" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>'),Uf=sr('<svg width="22" height="22" viewBox="0 0 24 24" fill="none"><path d="M12 2C6.48 2 2 6.48 2 12C2 13.85 2.5 15.55 3.36 17L2 22L7 20.64C8.45 21.5 10.15 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2Z" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8 10H8.01M12 10H12.01M16 10H16.01" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>'),Hf=j("<button><!></button>");const Vf={hash:"svelte-joatup",code:".jat-fb-btn.svelte-joatup {width:52px;height:52px;border-radius:50%;border:none;background:var(--jat-btn-color, #3b82f6);color:white;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 14px rgba(0, 0, 0, 0.25);transition:transform 0.2s, box-shadow 0.2s, background 0.2s;}.jat-fb-btn.svelte-joatup:hover {transform:scale(1.08);box-shadow:0 6px 20px rgba(0, 0, 0, 0.3);}.jat-fb-btn.svelte-joatup:active {transform:scale(0.95);}.jat-fb-btn.open.svelte-joatup {background:#6b7280;}"};function Xa(e,t){pn(t,!0),Pn(e,Vf);let n=Y(t,"onmousedown",7),r=Y(t,"open",7,!1);var s={get onmousedown(){return n()},set onmousedown(f){n(f),U()},get open(){return r()},set open(f=!1){r(f),U()}},o=Hf();let i;var l=x(o);{var c=f=>{var d=Bf();$(f,d)},u=f=>{var d=Uf();$(f,d)};B(l,f=>{r()?f(c):f(u,!1)})}return w(o),F(()=>{i=Ye(o,1,"jat-fb-btn svelte-joatup",null,i,{open:r()}),ce(o,"aria-label",r()?"Close feedback":"Send feedback"),ce(o,"title",r()?"Close feedback":"Send feedback")}),H("mousedown",o,function(...f){var d;(d=n())==null||d.apply(this,f)}),$(e,o),hn(s)}ns(["mousedown"]),Dn(Xa,{onmousedown:{},open:{}},[],[],{mode:"open"});const Ka="[modern-screenshot]",Ir=typeof window<"u",Wf=Ir&&"Worker"in window,Ho=Ir?(Rl=window.navigator)==null?void 0:Rl.userAgent:"",Ga=Ho.includes("Chrome"),eo=Ho.includes("AppleWebKit")&&!Ga,Vo=Ho.includes("Firefox"),Yf=e=>e&&"__CONTEXT__"in e,Xf=e=>e.constructor.name==="CSSFontFaceRule",Kf=e=>e.constructor.name==="CSSImportRule",Gf=e=>e.constructor.name==="CSSLayerBlockRule",Zt=e=>e.nodeType===1,fs=e=>typeof e.className=="object",Ja=e=>e.tagName==="image",Jf=e=>e.tagName==="use",us=e=>Zt(e)&&typeof e.style<"u"&&!fs(e),Zf=e=>e.nodeType===8,Qf=e=>e.nodeType===3,Mr=e=>e.tagName==="IMG",to=e=>e.tagName==="VIDEO",eu=e=>e.tagName==="CANVAS",tu=e=>e.tagName==="TEXTAREA",nu=e=>e.tagName==="INPUT",ru=e=>e.tagName==="STYLE",su=e=>e.tagName==="SCRIPT",ou=e=>e.tagName==="SELECT",iu=e=>e.tagName==="SLOT",au=e=>e.tagName==="IFRAME",lu=(...e)=>console.warn(Ka,...e);function cu(e){var n;const t=(n=e==null?void 0:e.createElement)==null?void 0:n.call(e,"canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}const Wo=e=>e.startsWith("data:");function Za(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Ir&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!Ir)return e;const n=no().implementation.createHTMLDocument(),r=n.createElement("base"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),t&&(r.href=t),s.href=e,s.href}function no(e){return(e&&Zt(e)?e==null?void 0:e.ownerDocument:e)??window.document}const ro="http://www.w3.org/2000/svg";function fu(e,t,n){const r=no(n).createElementNS(ro,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function uu(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)}`}function du(e,t){return new Promise((n,r)=>{const s=new FileReader;s.onload=()=>n(s.result),s.onerror=()=>r(s.error),s.onabort=()=>r(new Error(`Failed read blob to ${t}`)),s.readAsDataURL(e)})}const vu=e=>du(e,"dataUrl");function Lr(e,t){const n=no(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function ds(e,t){return new Promise(n=>{const{timeout:r,ownerDocument:s,onError:o,onWarn:i}=t??{},l=typeof e=="string"?Lr(e,no(s)):e;let c=null,u=null;function f(){n(l),c&&clearTimeout(c),u==null||u()}if(r&&(c=setTimeout(f,r)),to(l)){const d=l.currentSrc||l.src;if(!d)return l.poster?ds(l.poster,t).then(n):f();if(l.readyState>=2)return f();const v=f,h=b=>{i==null||i("Failed video load",d,b),o==null||o(b),f()};u=()=>{l.removeEventListener("loadeddata",v),l.removeEventListener("error",h)},l.addEventListener("loadeddata",v,{once:!0}),l.addEventListener("error",h,{once:!0})}else{const d=Ja(l)?l.href.baseVal:l.currentSrc||l.src;if(!d)return f();const v=async()=>{if(Mr(l)&&"decode"in l)try{await l.decode()}catch(b){i==null||i("Failed to decode image, trying to render anyway",l.dataset.originalSrc||d,b)}f()},h=b=>{i==null||i("Failed image load",l.dataset.originalSrc||d,b),f()};if(Mr(l)&&l.complete)return v();u=()=>{l.removeEventListener("load",v),l.removeEventListener("error",h)},l.addEventListener("load",v,{once:!0}),l.addEventListener("error",h,{once:!0})}})}async function pu(e,t){us(e)&&(Mr(e)||to(e)?await ds(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(r=>ds(r,t)))))}const Qa=(function(){let t=0;const n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();function el(e){return e==null?void 0:e.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}let tl=0;function hu(e){const t=`${Ka}[#${tl}]`;return tl++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&lu(...n)}}function gu(e){return{cache:e?"no-cache":"force-cache"}}async function nl(e,t){return Yf(e)?e:mu(e,{...t,autoDestruct:!0})}async function mu(e,t){var h,b;const{scale:n=1,workerUrl:r,workerNumber:s=1}=t||{},o=!!(t!=null&&t.debug),i=(t==null?void 0:t.features)??!0,l=e.ownerDocument??(Ir?window.document:void 0),c=((h=e.ownerDocument)==null?void 0:h.defaultView)??(Ir?window:void 0),u=new Map,f={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:o,fetch:{requestInit:gu((b=t==null?void 0:t.fetch)==null?void 0:b.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t==null?void 0:t.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:s,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:hu(o),node:e,ownerDocument:l,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:rl(l),svgDefsElement:l==null?void 0:l.createElementNS(ro,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Wf&&r&&s?s:0})].map(()=>{try{const _=new Worker(r);return _.onmessage=async p=>{var k,M,L,z;const{url:m,result:T}=p.data;T?(M=(k=u.get(m))==null?void 0:k.resolve)==null||M.call(k,T):(z=(L=u.get(m))==null?void 0:L.reject)==null||z.call(L,new Error(`Error receiving message from worker: ${m}`))},_.onmessageerror=p=>{var T,k;const{url:m}=p.data;(k=(T=u.get(m))==null?void 0:T.reject)==null||k.call(T,new Error(`Error receiving message from worker: ${m}`))},_}catch(_){return f.log.warn("Failed to new Worker",_),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[cu(l)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:u,drawImageCount:0,tasks:[],features:i,isEnable:_=>_==="restoreScrollPosition"?typeof i=="boolean"?!1:i[_]??!1:typeof i=="boolean"?i:i[_]??!0,shadowRoots:[]};f.log.time("wait until load"),await pu(e,{timeout:f.timeout,onWarn:f.log.warn}),f.log.timeEnd("wait until load");const{width:d,height:v}=bu(e,f);return f.width=d,f.height=v,f}function rl(e){if(!e)return;const t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
|
|
33
33
|
.______background-clip--text {
|
|
34
34
|
background-clip: text;
|
|
35
35
|
-webkit-background-clip: text;
|
|
@@ -72,7 +72,7 @@ var Tv=Object.defineProperty;var jl=de=>{throw TypeError(de)};var Nv=(de,ve,Ce)=
|
|
|
72
72
|
animation: svelte-nv4d5v-spin 0.6s linear infinite;}
|
|
73
73
|
@keyframes svelte-nv4d5v-spin {
|
|
74
74
|
to { transform: rotate(360deg); }
|
|
75
|
-
}.requests-wrapper.svelte-nv4d5v {flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;}.panel-version.svelte-nv4d5v {font-size:10px;color:#4b5563;margin-right:auto;align-self:flex-end;padding-bottom:6px;}`};function Sl(e,t){pn(t,!0),Pn(e,kv);const n="1.6.
|
|
75
|
+
}.requests-wrapper.svelte-nv4d5v {flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;}.panel-version.svelte-nv4d5v {font-size:10px;color:#4b5563;margin-right:auto;align-self:flex-end;padding-bottom:6px;}`};function Sl(e,t){pn(t,!0),Pn(e,kv);const n="1.6.7";let r=Y(t,"endpoint",7),s=Y(t,"project",7),o=Y(t,"isOpen",7,!1),i=Y(t,"userId",7,""),l=Y(t,"userEmail",7,""),c=Y(t,"userName",7,""),u=Y(t,"userRole",7,""),f=Y(t,"orgId",7,""),d=Y(t,"orgName",7,""),v=Y(t,"onclose",7),h=Y(t,"ongrip",7),b=P("new"),_=P(qe([])),p=P(!1),m=P(""),T=Yt(()=>a(_).filter(A=>A.status==="completed").length);async function k(){y(p,!0),y(m,"");const A=await Pf(r());y(_,A.reports,!0),A.error&&y(m,A.error,!0),y(p,!1)}qs(()=>{r()&&k()});let M=P(""),L=P(""),z=P("bug"),Q=P("medium"),q=P(qe([])),re=P(qe([])),ae=P(qe([])),be=P(!1),Ae=P(!1),Oe=P(!1),Te=P(null),$e=P(""),Xe=P(void 0),Ft=!1;qs(()=>{o()&&!Ft&&(requestAnimationFrame(()=>{requestAnimationFrame(()=>{var A;(A=a(Xe))==null||A.focus()})}),a(b)==="new"&&a(q).length===0&&setTimeout(()=>{Qu().then(A=>{y(q,[...a(q),A],!0)}).catch(()=>{})},300)),Ft=o()});let ht=P(""),je=P("success"),I=P(!1);function ie(A,V){y(ht,A,!0),y(je,V,!0),y(I,!0),setTimeout(()=>{y(I,!1)},3e3)}async function Ke(){y(Ae,!0);try{const A=await _l();y($e,A,!0),y(Te,a(q).length,!0)}catch(A){console.error("[jat-feedback] Screenshot failed:",A),ie("Screenshot failed: "+(A instanceof Error?A.message:"unknown error"),"error")}finally{y(Ae,!1)}}function sn(A){y(q,a(q).filter((V,pe)=>pe!==A),!0)}function gt(A){y($e,a(q)[A],!0),y(Te,A,!0)}function zt(A){a(Te)!==null&&(a(Te)>=a(q).length?(y(q,[...a(q),A],!0),ie(`Screenshot captured (${a(q).length})`,"success")):(y(q,a(q).map((V,pe)=>pe===a(Te)?A:V),!0),ie("Screenshot updated","success"))),y(Te,null),y($e,"")}function mt(){a(Te)!==null&&a(Te)>=a(q).length&&(y(q,[...a(q),a($e)],!0),ie(`Screenshot captured (${a(q).length})`,"success")),y(Te,null),y($e,"")}function Bt(){y(Oe,!0),Ma(A=>{y(re,[...a(re),A],!0),y(Oe,!1),ie(`Element captured: <${A.tagName.toLowerCase()}>`,"success")})}function it(){y(ae,xf(),!0)}async function kn(A){if(A.preventDefault(),!a(M).trim())return;y(be,!0),it();const V={};(i()||l()||c()||u())&&(V.reporter={},i()&&(V.reporter.userId=i()),l()&&(V.reporter.email=l()),c()&&(V.reporter.name=c()),u()&&(V.reporter.role=u())),(f()||d())&&(V.organization={},f()&&(V.organization.id=f()),d()&&(V.organization.name=d()));const pe={title:a(M).trim(),description:a(L).trim(),type:a(z),priority:a(Q),project:s()||"",page_url:window.location.href,user_agent:navigator.userAgent,console_logs:a(ae).length>0?a(ae):null,selected_elements:a(re).length>0?a(re):null,screenshots:a(q).length>0?a(q):null,metadata:Object.keys(V).length>0?V:null};try{const ze=await Ba(r(),pe);ze.ok?(ie(`Report submitted (${ze.id})`,"success"),En(),setTimeout(()=>{k(),y(b,"requests")},1200)):(Wa(r(),pe),ie("Queued for retry (endpoint unreachable)","error"))}catch{Wa(r(),pe),ie("Queued for retry (endpoint unreachable)","error")}finally{y(be,!1)}}function En(){y(M,""),y(L,""),y(z,"bug"),y(Q,"medium"),y(q,[],!0),y(re,[],!0),y(ae,[],!0)}qs(()=>{it()});function on(A){A.stopPropagation()}const C=[{value:"bug",label:"Bug"},{value:"enhancement",label:"Enhancement"},{value:"other",label:"Other"}],le=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"critical",label:"Critical"}];function ke(){return a(q).length+a(re).length}var Sn={get endpoint(){return r()},set endpoint(A){r(A),U()},get project(){return s()},set project(A){s(A),U()},get isOpen(){return o()},set isOpen(A=!1){o(A),U()},get userId(){return i()},set userId(A=""){i(A),U()},get userEmail(){return l()},set userEmail(A=""){l(A),U()},get userName(){return c()},set userName(A=""){c(A),U()},get userRole(){return u()},set userRole(A=""){u(A),U()},get orgId(){return f()},set orgId(A=""){f(A),U()},get orgName(){return d()},set orgName(A=""){d(A),U()},get onclose(){return v()},set onclose(A){v(A),U()},get ongrip(){return h()},set ongrip(A){h(A),U()}},Tt=xv(),Ne=ft(Tt),an=x(Ne),Ur=x(an);{var E=A=>{var V=av();H("mousedown",V,function(...pe){var ze;(ze=h())==null||ze.apply(this,pe)}),$(A,V)};B(Ur,A=>{h()&&A(E)})}var N=S(Ur,2),D=x(N);let R;var Fe=S(D,2);let bt;var Ut=S(x(Fe),2);{var On=A=>{var V=lv(),pe=x(V,!0);w(V),F(()=>K(pe,a(T))),$(A,V)};B(Ut,A=>{a(T)>0&&A(On)})}w(Fe),w(N);var _s=S(N,2);w(an);var _t=S(an,2);{var $n=A=>{var V=yv(),pe=x(V),ze=S(x(pe),2);Ea(ze),is(ze,O=>y(Xe,O),()=>a(Xe)),w(pe);var vr=S(pe,2),Fn=S(x(vr),2);Vi(Fn),w(vr);var ys=S(vr,2),Hr=x(ys),Vr=S(x(Hr),2);We(Vr,21,()=>C,dt,(O,G)=>{var he=cv(),ge=x(he,!0);w(he);var we={};F(()=>{K(ge,a(G).label),we!==(we=a(G).value)&&(he.value=(he.__value=a(G).value)??"")}),$(O,he)}),w(Vr),w(Hr);var lo=S(Hr,2),pr=S(x(lo),2);We(pr,21,()=>le,dt,(O,G)=>{var he=fv(),ge=x(he,!0);w(he);var we={};F(()=>{K(ge,a(G).label),we!==(we=a(G).value)&&(he.value=(he.__value=a(G).value)??"")}),$(O,he)}),w(pr),w(lo),w(ys);var ws=S(ys,2),Wr=x(ws),hr=x(Wr),co=x(hr);{var xs=O=>{var G=uv();Rs(),$(O,G)},Qo=O=>{var G=vv(),he=S(ft(G),2);{var ge=we=>{var Je=dv(),Nt=x(Je,!0);w(Je),F(()=>K(Nt,a(q).length)),$(we,Je)};B(he,we=>{a(q).length>0&&we(ge)})}$(O,G)};B(co,O=>{a(Ae)?O(xs):O(Qo,!1)})}w(hr);var Yr=S(hr,2),ei=S(x(Yr),2);{var ti=O=>{var G=va("Click an element...");$(O,G)},ni=O=>{var G=hv(),he=S(ft(G));{var ge=we=>{var Je=pv(),Nt=x(Je,!0);w(Je),F(()=>K(Nt,a(re).length)),$(we,Je)};B(he,we=>{a(re).length>0&&we(ge)})}$(O,G)};B(ei,O=>{a(Oe)?O(ti):O(ni,!1)})}w(Yr),w(Wr);var ne=S(Wr,2);yl(ne,{get screenshots(){return a(q)},get capturing(){return a(Ae)},oncapture:Ke,onremove:sn,onedit:gt}),w(ws);var se=S(ws,2);{var _e=O=>{var G=mv();We(G,21,()=>a(re),dt,(he,ge,we)=>{var Je=gv(),Nt=x(Je),ks=x(Nt);w(Nt);var me=S(Nt,2),Ze=x(me,!0);w(me);var ln=S(me,2);w(Je),F((Qe,Vt)=>{K(ks,`<${Qe??""}>`),K(Ze,Vt)},[()=>a(ge).tagName.toLowerCase(),()=>{var Qe;return((Qe=a(ge).textContent)==null?void 0:Qe.substring(0,40))||a(ge).selector}]),H("click",ln,()=>{y(re,a(re).filter((Qe,Vt)=>Vt!==we),!0)}),$(he,Je)}),w(G),$(O,G)};B(se,O=>{a(re).length>0&&O(_e)})}var Ge=S(se,2);xl(Ge,{get logs(){return a(ae)}});var Ht=S(Ge,2);{var yt=O=>{var G=bv(),he=x(G);w(G),F((ge,we)=>K(he,`${ge??""} attachment${we??""} will be included`),[ke,()=>ke()>1?"s":""]),$(O,G)},Be=Yt(()=>ke()>0);B(Ht,O=>{a(Be)&&O(yt)})}var ye=S(Ht,2),Ue=x(ye),fe=x(Ue);w(Ue);var at=S(Ue,2),An=S(at,2),ue=x(An);{var zn=O=>{var G=_v();Rs(),$(O,G)},gr=O=>{var G=va("Submit");$(O,G)};B(ue,O=>{a(be)?O(zn):O(gr,!1)})}w(An),w(ye),w(V),F(O=>{ze.disabled=a(be),Fn.disabled=a(be),Vr.disabled=a(be),pr.disabled=a(be),hr.disabled=a(Ae),Yr.disabled=a(Oe),K(fe,`v${n}`),at.disabled=a(be),An.disabled=O},[()=>a(be)||!a(M).trim()]),Hs("submit",V,kn),Xs(ze,()=>a(M),O=>y(M,O)),Xs(Fn,()=>a(L),O=>y(L,O)),ka(Vr,()=>a(z),O=>y(z,O)),ka(pr,()=>a(Q),O=>y(Q,O)),H("click",hr,Ke),H("click",Yr,Bt),H("click",at,function(...O){var G;(G=v())==null||G.apply(this,O)}),Ys(3,V,()=>so,()=>({duration:200})),$(A,V)};B(_t,A=>{a(b)==="new"&&A($n)})}var Cn=S(_t,2);{var Go=A=>{var V=wv(),pe=x(V);El(pe,{get endpoint(){return r()},get loading(){return a(p)},get error(){return a(m)},onreload:k,get reports(){return a(_)},set reports(ze){y(_,ze,!0)}}),w(V),Ys(3,V,()=>so,()=>({duration:200})),$(A,V)};B(Cn,A=>{a(b)==="requests"&&A(Go)})}var Jo=S(Cn,2);kl(Jo,{get message(){return a(ht)},get type(){return a(je)},get visible(){return a(I)}}),w(Ne);var ao=S(Ne,2);{var Zo=A=>{wl(A,{get imageDataUrl(){return a($e)},onsave:zt,oncancel:mt})};B(ao,A=>{a(Te)!==null&&A(Zo)})}return F(()=>{R=Ye(D,1,"tab svelte-nv4d5v",null,R,{active:a(b)==="new"}),bt=Ye(Fe,1,"tab svelte-nv4d5v",null,bt,{active:a(b)==="requests"})}),H("keydown",Ne,on),H("keyup",Ne,on),Hs("keypress",Ne,on),H("click",D,()=>y(b,"new")),H("click",Fe,()=>y(b,"requests")),H("click",_s,function(...A){var V;(V=v())==null||V.apply(this,A)}),$(e,Tt),hn(Sn)}ns(["keydown","keyup","mousedown","click"]),Dn(Sl,{endpoint:{},project:{},isOpen:{},userId:{},userEmail:{},userName:{},userRole:{},orgId:{},orgName:{},onclose:{},ongrip:{}},[],[],{mode:"open"});var Ev=j("<div><!></div>"),Sv=j('<div class="jat-feedback-panel svelte-qpyrvv"><div class="no-endpoint svelte-qpyrvv"><p class="svelte-qpyrvv">No endpoint configured.</p> <p class="svelte-qpyrvv">Add the <code class="svelte-qpyrvv">endpoint</code> attribute:</p> <code class="example svelte-qpyrvv"><jat-feedback endpoint="http://localhost:3333"></code></div></div>'),$v=j('<div class="jat-feedback-root svelte-qpyrvv"><!> <!></div>');const Cv={hash:"svelte-qpyrvv",code:`.jat-feedback-root.svelte-qpyrvv {position:fixed;z-index:2147483647;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;}.jat-feedback-panel.svelte-qpyrvv {position:absolute;
|
|
76
76
|
animation: svelte-qpyrvv-panel-in 0.2s ease;}.jat-feedback-panel.hidden.svelte-qpyrvv {display:none;}.jat-feedback-panel.dragging.svelte-qpyrvv {pointer-events:none;opacity:0.9;}.no-endpoint.svelte-qpyrvv {width:320px;background:#111827;border:1px solid #374151;border-radius:12px;padding:20px;color:#d1d5db;font-size:13px;box-shadow:0 20px 60px rgba(0,0,0,0.4);}.no-endpoint.svelte-qpyrvv p:where(.svelte-qpyrvv) {margin:0 0 8px;}.no-endpoint.svelte-qpyrvv code:where(.svelte-qpyrvv) {font-family:'SF Mono', 'Fira Code', monospace;font-size:11px;color:#93c5fd;}.no-endpoint.svelte-qpyrvv code.example:where(.svelte-qpyrvv) {display:block;background:#1f2937;padding:8px 10px;border-radius:4px;margin-top:4px;}
|
|
77
77
|
@keyframes svelte-qpyrvv-panel-in {
|
|
78
78
|
from { opacity: 0; transform: translateY(8px) scale(0.96); }
|
package/dist/jat-feedback.mjs
CHANGED
|
@@ -3663,7 +3663,8 @@ async function rl(e, t) {
|
|
|
3663
3663
|
async function Df(e) {
|
|
3664
3664
|
try {
|
|
3665
3665
|
const t = `${e.replace(/\/$/, "")}/api/feedback/reports`, n = await fetch(t, {
|
|
3666
|
-
method: "GET"
|
|
3666
|
+
method: "GET",
|
|
3667
|
+
credentials: "same-origin"
|
|
3667
3668
|
});
|
|
3668
3669
|
if (!n.ok) {
|
|
3669
3670
|
const s = await n.json().catch(() => ({ error: `HTTP ${n.status}` }));
|
|
@@ -5851,7 +5852,7 @@ const Ev = {
|
|
|
5851
5852
|
};
|
|
5852
5853
|
function jl(e, t) {
|
|
5853
5854
|
$n(t, !0), Fn(e, Ev);
|
|
5854
|
-
const n = "1.6.
|
|
5855
|
+
const n = "1.6.7";
|
|
5855
5856
|
let r = Y(t, "endpoint", 7), s = Y(t, "project", 7), o = Y(t, "isOpen", 7, !1), i = Y(t, "userId", 7, ""), a = Y(t, "userEmail", 7, ""), c = Y(t, "userName", 7, ""), u = Y(t, "userRole", 7, ""), f = Y(t, "orgId", 7, ""), d = Y(t, "orgName", 7, ""), v = Y(t, "onclose", 7), h = Y(t, "ongrip", 7), b = /* @__PURE__ */ P("new"), _ = /* @__PURE__ */ P(qe([])), p = /* @__PURE__ */ P(!1), m = /* @__PURE__ */ P(""), T = /* @__PURE__ */ Qt(() => l(_).filter((A) => A.status === "completed").length);
|
|
5856
5857
|
async function k() {
|
|
5857
5858
|
y(p, !0), y(m, "");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jat-feedback",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.7",
|
|
4
4
|
"description": "Embeddable feedback widget for bug reports and feature requests. Captures screenshots, console logs, and user context as a web component.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/jat-feedback.js",
|