(()=>{const e=document.currentScript.getAttribute("data-site-id");if(!e)return void console.error("Feedback widget: Missing data-site-id attribute");const n="https://bugdrop.app",t="https://cdn.bugdrop.app",o=window.location.hostname.replace(/^www\./i,"");const i=Date.now(),r=function(e,n){const t=document.currentScript,o=t?t.src:"";return btoa([o,e,n,"bugdrop-widget"].join("|"))}(e,i);function a(){const e=navigator.userAgent;let n="Unknown",t="Unknown";return e.indexOf("Firefox")>-1?(n="Firefox",t=e.match(/Firefox\/([0-9.]+)/)[1]):e.indexOf("Chrome")>-1&&-1===e.indexOf("Edg")&&-1===e.indexOf("OPR")?(n="Chrome",t=e.match(/Chrome\/([0-9.]+)/)[1]):e.indexOf("Safari")>-1&&-1===e.indexOf("Chrome")?(n="Safari",t=e.match(/Version\/([0-9.]+)/)[1]):e.indexOf("Edg")>-1?(n="Edge",t=e.match(/Edg\/([0-9.]+)/)[1]):e.indexOf("OPR")>-1&&(n="Opera",t=e.match(/OPR\/([0-9.]+)/)[1]),{name:n,version:t}}function s(){const e=navigator.userAgent;let n="Unknown",t="";if(-1!==e.indexOf("Win"))n="Windows",-1!==e.indexOf("Windows NT 10.0")?t="10":-1!==e.indexOf("Windows NT 6.3")?t="8.1":-1!==e.indexOf("Windows NT 6.2")?t="8":-1!==e.indexOf("Windows NT 6.1")&&(t="7");else if(-1!==e.indexOf("Mac")){n="macOS";const o=e.match(/Mac OS X ([0-9_]+)/);o&&(t=o[1].replace(/_/g,"."))}else if(-1!==e.indexOf("Linux")){if(n="Linux",-1!==e.indexOf("Ubuntu"))t="Ubuntu";else if(-1!==e.indexOf("Fedora"))t="Fedora";else if(-1!==e.indexOf("Android")){n="Android";const o=e.match(/Android ([0-9.]+)/);o&&(t=o[1])}}else if(-1!==e.indexOf("iPhone")||-1!==e.indexOf("iPad")||-1!==e.indexOf("iPod")){n="iOS";const o=e.match(/OS ([0-9_]+)/);o&&(t=o[1].replace(/_/g,"."))}return{name:n,version:t,platform:navigator.platform,userAgent:navigator.userAgent}}fetch(`${n}/api/check_site_status.php?site_key=${e}&t=${i}&domain=${o}`,{headers:{"X-Widget-Signature":r,"X-Widget-Timestamp":i.toString()}}).then((e=>e.json())).then((o=>{if(!o.is_active)return void console.log("Bugdrop: Site is not active");!function(o,i,r,d,l,c,p,m,f,b){const u=document.createElement("script");u.src="proxy.php?url=https://html2canvas.hertzen.com/dist/html2canvas.min.js",document.head.appendChild(u);const h={small:"32px",medium:"48px",large:"64px",xl:"80px"},g=`\n @import url('https://fonts.googleapis.com/css2?family=Lilita+One&display=swap');\n\n /* Mobile viewport meta */\n @viewport {\n width: device-width;\n zoom: 1.0;\n }\n\n .feedback-widget {\n --widget-color: #4a90e2;\n --widget-hover: #357abd;\n --widget-text: #ffffff;\n --modal-bg: #ffffff;\n --modal-text: #333333;\n position: fixed;\n z-index: 2147483640;\n transition: transform 0.3s ease;\n touch-action: manipulation; /* Optimize for touch */\n user-select: none;\n -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */\n }\n \n .feedback-bug-icon {\n width: ${h[i]};\n height: ${h[i]};\n cursor: move;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s ease;\n user-select: none;\n min-width: ${h[i]}; /* Use the actual size from sizeMap */\n min-height: ${h[i]}; /* Use the actual size from sizeMap */\n padding: 0; /* Remove padding to prevent size increase */\n }\n \n /* Mobile-specific styles */\n @media (max-width: 768px) {\n .feedback-modal {\n width: 90vw !important; /* Use viewport width */\n max-width: 320px;\n margin: auto;\n }\n\n .feedback-modal-body {\n padding: 16px !important; /* Larger padding on mobile */\n }\n\n .feedback-modal textarea {\n min-height: 100px; /* Taller textarea on mobile */\n font-size: 16px !important; /* Prevent zoom on iOS */\n padding: 12px !important; /* Larger padding for touch */\n }\n\n .feedback-modal-footer {\n padding: 16px !important;\n flex-wrap: wrap; /* Allow wrapping on small screens */\n gap: 12px;\n }\n\n .feedback-screenshot-btn {\n width: 44px !important; /* Larger touch target */\n height: 44px !important;\n }\n\n .feedback-modal button.submit-btn {\n padding: 12px 24px !important; /* Larger touch target */\n font-size: 16px !important;\n width: 100%; /* Full width on mobile */\n margin-top: 8px;\n }\n\n .feedback-modal-close {\n width: 44px !important; /* Larger touch target */\n height: 44px !important;\n font-size: 24px !important;\n }\n\n /* Improve touch targets for screenshot preview */\n .feedback-screenshot-preview .remove-screenshot {\n width: 32px !important;\n height: 32px !important;\n font-size: 18px !important;\n }\n }\n\n .feedback-bug-icon:hover {\n transform: scale(1.1);\n }\n \n .feedback-bug-icon img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n pointer-events: none;\n display: block; /* Ensure proper sizing */\n }\n \n .feedback-modal {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: #fff;\n width: 320px;\n z-index: 2147483647;\n border-radius: 12px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n user-select: none;\n max-height: 90vh;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n }\n\n .feedback-modal.dragging {\n user-select: none;\n cursor: move;\n }\n\n .feedback-modal.dragging * {\n cursor: move;\n }\n\n .feedback-modal-header {\n display: flex;\n align-items: center;\n padding: 12px 16px;\n gap: 12px;\n cursor: move;\n border-bottom: 1px solid #f0f0f0;\n user-select: none;\n }\n\n .feedback-modal-header h3 {\n margin: 0;\n color: #1c1c1c;\n font-size: 15px;\n font-weight: 500;\n flex-grow: 1;\n }\n\n .feedback-modal-close {\n width: 24px;\n height: 24px;\n border: none;\n background: none;\n cursor: pointer;\n padding: 0;\n color: #666;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 24px;\n }\n\n .feedback-modal-close:hover {\n color: #333;\n }\n\n .feedback-modal-body {\n padding: 12px 16px;\n }\n\n .feedback-modal textarea {\n width: 100%;\n min-height: 80px;\n padding: 10px;\n border: 1px solid #e6e6e6;\n border-radius: 8px;\n font-size: 14px;\n line-height: 1.4;\n resize: none;\n font-family: inherit;\n margin: 0;\n box-sizing: border-box;\n background: white;\n user-select: text;\n }\n \n .feedback-modal textarea:focus {\n outline: none;\n border-color: #03346E;\n }\n\n .feedback-modal-footer {\n padding: 12px 16px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid #f0f0f0;\n }\n\n .feedback-modal-footer-left {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .feedback-screenshot-btn {\n width: 38px;\n height: 38px;\n border: 1px solid #e6e6e6;\n background: white;\n border-radius: 6px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #666;\n transition: all 0.2s ease;\n }\n\n .feedback-screenshot-btn:hover {\n border-color: #03346E;\n color: #03346E;\n }\n\n .feedback-screenshot-btn.active {\n background: #03346E;\n border-color: #03346E;\n color: white;\n }\n\n .feedback-screenshot-preview {\n display: none;\n margin-top: 12px;\n position: relative;\n }\n\n .feedback-screenshot-preview.visible {\n display: block;\n }\n\n .feedback-screenshot-preview img {\n width: 100%;\n border-radius: 6px;\n border: 1px solid #e6e6e6;\n }\n\n .feedback-screenshot-preview .remove-screenshot {\n position: absolute;\n top: -6px;\n right: 10px;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #fff;\n border: 1px solid #e6e6e6;\n color: #666;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n font-size: 14px;\n box-shadow: 0 1px 3px rgba(0,0,0,0.1);\n }\n\n .feedback-screenshot-preview .remove-screenshot:hover {\n background: #f5f5f5;\n color: #333;\n }\n\n .feedback-modal button.submit-btn,\n .feedback-modal button.submit-email-btn {\n padding: 8px 16px;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n border: none;\n background: ${m};\n color: ${f};\n transition: all 0.2s ease;\n }\n\n .feedback-modal button.submit-email-btn {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .feedback-modal button.submit-btn:hover,\n .feedback-modal button.submit-email-btn:hover {\n filter: brightness(110%);\n transform: translateY(-1px);\n }\n\n .feedback-modal button.submit-btn:disabled,\n .feedback-modal button.submit-email-btn:disabled {\n background: #ccc;\n cursor: not-allowed;\n transform: none;\n }\n\n .feedback-branding {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 8px;\n font-size: 11px;\n color: #666;\n gap: 4px;\n border-top: 1px solid #f0f0f0;\n }\n\n .feedback-branding a {\n color: #333;\n text-decoration: none;\n font-weight: 500;\n font-size: 12px;\n }\n\n .feedback-tooltip {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n background-color: #333;\n color: #fff;\n padding: 8px 12px;\n border-radius: 6px;\n font-size: 13px;\n width: 230px;\n text-align: center;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease, visibility 0.2s ease;\n z-index: 1;\n pointer-events: none;\n }\n\n /* Tooltip arrow styles */\n .feedback-tooltip::after {\n content: '';\n position: absolute;\n top: 50%;\n margin-top: -5px;\n border-width: 5px;\n border-style: solid;\n }\n\n /* Right position styles */\n .feedback-tooltip.tooltip-right {\n left: calc(100% + 10px);\n }\n .feedback-tooltip.tooltip-right::after {\n right: 100%;\n border-color: transparent #333 transparent transparent;\n }\n\n /* Left position styles */\n .feedback-tooltip.tooltip-left {\n right: calc(100% + 10px);\n }\n .feedback-tooltip.tooltip-left::after {\n left: 100%;\n border-color: transparent transparent transparent #333;\n }\n\n /* Mobile-specific modal styles */\n @media (max-width: 768px) {\n /* Base modal styles - remove default desktop positioning */\n .feedback-modal {\n position: static;\n top: auto;\n left: auto;\n transform: none;\n }\n\n /* Overlay styles */\n .modal-overlay {\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n background: rgba(0, 0, 0, 0.5) !important;\n z-index: 2147483646 !important;\n opacity: 0;\n transition: opacity 0.3s ease-out !important;\n }\n\n .modal-overlay.visible {\n opacity: 1;\n }\n\n .feedback-modal.mobile-fullscreen {\n position: fixed !important;\n top: auto !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n width: 100% !important;\n height: auto !important;\n max-width: none !important;\n max-height: 70vh !important;\n min-height: 300px !important;\n margin: 0 !important;\n padding: 0 !important;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n border-top-left-radius: 16px !important;\n border-top-right-radius: 16px !important;\n display: flex !important;\n flex-direction: column !important;\n background: #fff !important;\n box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12) !important;\n z-index: 2147483647 !important;\n transform: translateY(100%) !important;\n transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;\n will-change: transform !important;\n }\n\n .feedback-modal.mobile-fullscreen.visible {\n transform: translateY(0) !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-modal-header {\n padding: 16px !important;\n border-bottom: 1px solid #f0f0f0 !important;\n background: var(--modal-bg) !important;\n position: relative !important;\n z-index: 2 !important;\n border-top-left-radius: 16px !important;\n border-top-right-radius: 16px !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-modal-body {\n flex: 1 1 auto !important;\n padding: 20px !important;\n overflow-y: auto !important;\n -webkit-overflow-scrolling: touch !important;\n background: var(--modal-bg) !important;\n position: relative !important;\n z-index: 1 !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-modal-footer {\n padding: 16px !important;\n border-top: 1px solid #f0f0f0 !important;\n background: #fff !important;\n position: relative !important;\n z-index: 2 !important;\n display: flex !important;\n align-items: center !important;\n gap: 12px !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-branding {\n padding: 12px 16px !important;\n border-top: 1px solid #f0f0f0 !important;\n background: #fff !important;\n position: relative !important;\n z-index: 1 !important;\n }\n\n .feedback-modal.mobile-fullscreen textarea {\n height: 120px !important;\n font-size: 16px !important;\n padding: 12px !important;\n margin-bottom: 16px !important;\n border-radius: 8px !important;\n resize: none !important;\n position: relative !important;\n z-index: 1 !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-screenshot-preview {\n margin: 16px -20px !important;\n background: #f8f8f8 !important;\n position: relative !important;\n z-index: 1 !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-screenshot-preview img {\n border: none !important;\n width: 100% !important;\n height: auto !important;\n display: block !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-modal-close {\n width: 44px !important;\n height: 44px !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n font-size: 24px !important;\n margin-right: -8px !important;\n position: relative !important;\n z-index: 3 !important;\n background: none !important;\n border: none !important;\n cursor: pointer !important;\n color: #666 !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-screenshot-btn {\n width: 44px !important;\n height: 44px !important;\n flex-shrink: 0 !important;\n border: 1px solid #e6e6e6 !important;\n border-radius: 8px !important;\n background: white !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n color: black !important;\n }\n\n .feedback-modal.mobile-fullscreen .submit-btn {\n position: relative !important;\n z-index: 2 !important;\n flex: 1 !important;\n margin: 0 !important;\n height: 44px !important;\n border-radius: 8px !important;\n font-size: 16px !important;\n }\n }\n `,x=document.createElement("style");x.textContent=g,document.head.appendChild(x);const w=document.createElement("div");w.className="feedback-widget",w.style[r]="20px",w.style.bottom="20px",w.style.position="fixed",w.style.zIndex="2147483640",w.style.transition="transform 0.2s ease";const y=document.createElement("div");y.className="feedback-bug-icon";parseInt(h[i]);y.innerHTML=`
`,w.appendChild(y),document.body.appendChild(w);const v=document.createElement("div");v.className="feedback-tooltip tooltip-"+("right"===r?"left":"right"),v.textContent="Spotted a bug? Drag me there!",l||w.appendChild(v);let k=!1,E=0,z=0,L=0,S=0,C=0,O=0,_=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);function M(){w.style[r]="20px",w.style.bottom="20px","right"===r?w.style.left="":w.style.right="",w.style.top=""}y.style.cursor="move";let T=0,B=0,Y=!1,W=!1;function q(e){if(_&&(T=e.touches[0].clientX,B=e.touches[0].clientY,Y=!1,W=!1,y.style.opacity="0.8",e.target.closest(".feedback-bug-icon"))){W=!0;const n=e.target.closest(".feedback-bug-icon").getBoundingClientRect(),t=e.touches[0].clientX-n.left,o=e.touches[0].clientY-n.top,i=w.getBoundingClientRect();L=i.left,S=i.top,w.dataset.offsetX=t,w.dataset.offsetY=o,w.style.position="fixed",w.style.left=L+"px",w.style.top=S+"px",w.style.right="",w.style.bottom="",w.style.transition="none",w.style.transform="scale(1.1)",v.style.opacity="0",v.style.visibility="hidden"}}function R(e){if(_&&W){e.preventDefault(),Y=!0;const n=parseFloat(w.dataset.offsetX)||0,t=parseFloat(w.dataset.offsetY)||0;let o=e.touches[0].clientX-n,i=e.touches[0].clientY-t;const r=window.innerWidth,a=window.innerHeight,s=w.getBoundingClientRect(),d=s.width,l=s.height,c=20;o=Math.max(c,Math.min(o,r-d-c)),i=Math.max(c,Math.min(i,a-l-c)),w.style.left=o+"px",w.style.top=i+"px"}}function X(e){if(_&&(y.style.opacity="1",W)){W=!1,w.style.transition="transform 0.2s ease",w.style.transform="scale(1)";const n=e.changedTouches[0].clientX,t=e.changedTouches[0].clientY;$(),N(n,t)}}function j(e){if(e.target.closest(".feedback-bug-icon")){k=!0;const n=e.target.closest(".feedback-bug-icon").getBoundingClientRect(),t=e.clientX-n.left,o=e.clientY-n.top;E=e.clientX,z=e.clientY;const i=w.getBoundingClientRect();L=i.left,S=i.top,w.dataset.offsetX=t,w.dataset.offsetY=o,w.style.position="fixed",w.style.left=L+"px",w.style.top=S+"px",w.style.right="",w.style.bottom="",w.style.transition="none",w.style.transform="scale(1.1)",v.style.opacity="0",v.style.visibility="hidden"}}function P(e){if(k){e.preventDefault();const n=parseFloat(w.dataset.offsetX)||0,t=parseFloat(w.dataset.offsetY)||0;let o=e.clientX-n,i=e.clientY-t;const r=window.innerWidth,a=window.innerHeight,s=w.getBoundingClientRect(),d=s.width,l=s.height,c=20;o=Math.max(c,Math.min(o,r-d-c)),i=Math.max(c,Math.min(i,a-l-c)),w.style.left=o+"px",w.style.top=i+"px";const p=50,m=15;e.clientX
r-p&&(window.scrollBy(m,0),o-=m),e.clientY
a-p&&(window.scrollBy(0,m),i-=m),w.style.left=o+"px",w.style.top=i+"px"}}function F(e){if(k){k=!1,w.style.transition="transform 0.2s ease",w.style.transform="scale(1)",C=e.clientX,O=e.clientY;Math.sqrt(Math.pow(C-E,2)+Math.pow(O-z,2))>10&&($(),N(C,O))}}w.addEventListener("mousedown",j),document.addEventListener("mousemove",P),document.addEventListener("mouseup",F),_||(y.addEventListener("mouseenter",(()=>{k||l||(v.style.opacity="1",v.style.visibility="visible")})),y.addEventListener("mouseleave",(()=>{l||(v.style.opacity="0",v.style.visibility="hidden")})),l||setTimeout((()=>{v.style.opacity="1",v.style.visibility="visible",setTimeout((()=>{v.style.opacity="0",v.style.visibility="hidden"}),3500)}),500));function N(t,o){let i;_&&(i=document.createElement("div"),i.className="modal-overlay",document.body.appendChild(i),i.offsetHeight,i.classList.add("visible"));const r=document.createElement("div");r.className="feedback-modal",_&&(r.classList.add("mobile-fullscreen"),document.body.style.overflow="hidden");let l=!1,f=0,b=0,u=0,h=0;function g(e){if(e.target.closest(".feedback-modal-header")){l=!0,f=e.clientX,b=e.clientY;const n=r.getBoundingClientRect();u=n.left,h=n.top,r.classList.add("dragging"),r.style.transition="none"}}function x(e){if(l){e.preventDefault();const n=e.clientX-f,t=e.clientY-b;let o=u+n,i=h+t;const a=window.innerWidth,s=window.innerHeight,d=r.getBoundingClientRect(),l=d.width,c=d.height,p=20;o=Math.max(p,Math.min(o,a-l-p)),i=Math.max(p,Math.min(i,s-c-p)),r.style.left=o+"px",r.style.top=i+"px"}}function v(){l&&(l=!1,r.classList.remove("dragging"),r.style.transition="")}document.addEventListener("mousemove",x),document.addEventListener("mouseup",v),r.innerHTML=`\n
Your feedback has been submitted successfully.
\nWant to get notified about updates? (optional)
\n \n \nWe'll keep you updated!
\n