From 69c2bd84dfe06e64108cc95d96fb72f2939784aa Mon Sep 17 00:00:00 2001 From: Julia Evans Date: Tue, 10 Nov 2026 16:37:10 -0500 Subject: [PATCH] Add Push Feedback feedback button Add a feedback button on the center right so that users can leave feedback on the docs. - Vendor the code so that we're not including assets from a CDN. - Make sure it looks okay in dark mode and light mode by using a CSS variable. - The search bar was appearing above the feedback sidebar for some reason and it looked really bad, hack together a fix by setting a z-index. - Only include the feedback button on the docs pages. Instructions for how to upgrade the Push Feedback HTML/CSS in the future: npm install rm -rf static/js/pushfeedback/ mv node_modules/pushfeedback/dist/pushfeedback static/js Signed-off-by: Julia Evans --- assets/sass/search.scss | 1 + layouts/_default/baseof.html | 7 +++++++ package.json | 3 +++ static/js/pushfeedback/index.esm.js | 0 static/js/pushfeedback/p-a94be4c1.entry.js | 1 + static/js/pushfeedback/p-ed68abdd.js | 2 ++ static/js/pushfeedback/pushfeedback.css | 1 + static/js/pushfeedback/pushfeedback.esm.js | 1 + 8 files changed, 16 insertions(+) create mode 100644 static/js/pushfeedback/index.esm.js create mode 100644 static/js/pushfeedback/p-a94be4c1.entry.js create mode 100644 static/js/pushfeedback/p-ed68abdd.js create mode 100644 static/js/pushfeedback/pushfeedback.css create mode 100644 static/js/pushfeedback/pushfeedback.esm.js diff --git a/assets/sass/search.scss b/assets/sass/search.scss index ad3c808c23..9e2817a567 100644 --- a/assets/sass/search.scss +++ b/assets/sass/search.scss @@ -7,6 +7,7 @@ position: relative; width: 300px; padding-left: 60px; + z-index: 0; /* hack to make this work well with the Push Feedback sidebar */ * { box-sizing: border-box; diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 533c64709f..6f6c7a8db4 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -72,9 +72,16 @@

Redirecting…

+ + + + + {{ if (eq $section "documentation") }} + Feedback + {{ end }}
{{ partial "header.html" . }} diff --git a/package.json b/package.json index f170d1de7e..acad748495 100644 --- a/package.json +++ b/package.json @@ -7,5 +7,8 @@ "@playwright/test": "^1.60.0", "@types/node": "^22.19.19", "node-html-parser": "^7.1.0" + }, + "dependencies": { + "pushfeedback": "^0.1.87" } } diff --git a/static/js/pushfeedback/index.esm.js b/static/js/pushfeedback/index.esm.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/static/js/pushfeedback/p-a94be4c1.entry.js b/static/js/pushfeedback/p-a94be4c1.entry.js new file mode 100644 index 0000000000..13cafe9185 --- /dev/null +++ b/static/js/pushfeedback/p-a94be4c1.entry.js @@ -0,0 +1 @@ +import{r as t,c as e,h as o,H as i,g as a}from"./p-ed68abdd.js";const s=class{constructor(o){t(this,o),this.screenshotReady=e(this,"screenshotReady",7),this.screenshotCancelled=e(this,"screenshotCancelled",7),this.screenshotFailed=e(this,"screenshotFailed",7),this.handleKeyDown=t=>{if(this.showCanvasEditor&&this.escapeClose&&"Escape"===t.key&&!this.takingScreenshot)return t.preventDefault(),this.showColorPicker?(this.showColorPicker=!1,void(this.editingColorIndex=-1)):this.selectedAnnotation?(this.selectedAnnotation=null,void this.redrawAnnotations()):void this.closeCanvasEditor()},this.pressStartedOnOverlay=!1,this.handleOverlayMouseDown=t=>{this.pressStartedOnOverlay=t.target===t.currentTarget},this.handleOverlayClick=t=>{const e=this.pressStartedOnOverlay;this.pressStartedOnOverlay=!1,this.clickOutsideClose&&e&&t.target===t.currentTarget&&this.closeCanvasEditor()},this.handleWindowResize=()=>{this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((()=>{this.showCanvasEditor&&this.originalImageData&&this.initializeCanvas()}),250)},this.openScreenShot=async()=>{this.takingScreenshot=!0,this.annotations=[],this.currentAnnotation=null,this.isDrawing=!1,this.hoveredAnnotation=null,this.hideAllFeedbackElements();try{await new Promise((t=>setTimeout(t,100)));const t=await this.captureViewportScreenshot();this.originalImageData=t,this.takingScreenshot=!1,this.showCanvasEditor=!0,this.showAllFeedbackElements(),setTimeout((()=>{this.initializeCanvas()}),100)}catch(t){console.error("Failed to capture screenshot:",t),this.takingScreenshot=!1,this.showAllFeedbackElements(),this.handleScreenshotError(t)}},this.hideAllFeedbackElements=()=>{document.querySelectorAll("feedback-button, feedback-modal").forEach((t=>{t.style.visibility="hidden"}))},this.showAllFeedbackElements=()=>{document.querySelectorAll("feedback-button, feedback-modal").forEach((t=>{t.style.visibility="visible"}))},this.handleScreenshotError=t=>{let e=this.screenshotErrorGeneral;"NotAllowedError"===t.name?e+=" "+this.screenshotErrorPermission:"NotSupportedError"===t.name?e+=" "+this.screenshotErrorNotSupported:"NotFoundError"===t.name?e+=" "+this.screenshotErrorNotFound:"AbortError"===t.name?e+=" "+this.screenshotErrorCancelled:t.message&&t.message.includes("not supported")?e+=" "+this.screenshotErrorBrowserNotSupported:e+=" "+this.screenshotErrorUnexpected,this.screenshotFailed.emit({error:e})},this.closeCanvasEditor=()=>{this.showCanvasEditor=!1,this.screenshotCancelled.emit()},this.saveAnnotations=()=>{if(this.canvasRef){const t=this.canvasRef.toDataURL("image/png");this.screenshotReady.emit({screenshot:t})}this.showCanvasEditor=!1},this.initializeCanvas=()=>{if(!this.canvasRef||!this.originalImageData)return;this.canvasContext=this.canvasRef.getContext("2d");const t=new Image;t.onload=()=>{this.canvasRef.width=t.width,this.canvasRef.height=t.height;const e=window.innerWidth>1920?1.5:window.innerWidth>1200?1.2:1,o=Math.min((this.canvasRef.parentElement.clientWidth-48)/t.width,(this.canvasRef.parentElement.clientHeight-48)/t.height,e),i=t.height*o;this.canvasRef.style.width=t.width*o+"px",this.canvasRef.style.height=`${i}px`,this.canvasContext.drawImage(t,0,0),this.redrawAnnotations()},t.src=this.originalImageData},this.redrawAnnotations=()=>{if(!this.canvasContext)return;const t=new Image;t.onload=()=>{this.canvasContext.clearRect(0,0,this.canvasRef.width,this.canvasRef.height),this.canvasContext.drawImage(t,0,0),this.annotations.forEach((t=>{this.drawAnnotation(t)}))},t.src=this.originalImageData},this.drawAnnotation=t=>{if(this.canvasContext)switch(this.canvasContext.strokeStyle=t.color,this.canvasContext.lineWidth=t.lineWidth,this.canvasContext.lineCap="round",this.canvasContext.lineJoin="round",t.type){case"rectangle":this.canvasContext.strokeRect(t.startX,t.startY,t.width,t.height),this.selectedAnnotation===t&&this.drawSelectionIndicator(t),this.hoveredAnnotation===t&&this.drawRectangleResizeHandles(t);break;case"line":this.canvasContext.beginPath(),this.canvasContext.moveTo(t.startX,t.startY),this.canvasContext.lineTo(t.endX,t.endY),this.canvasContext.stroke(),this.selectedAnnotation===t&&this.drawSelectionIndicator(t),this.hoveredAnnotation===t&&this.drawLineResizeHandles(t);break;case"arrow":this.drawArrow(t.startX,t.startY,t.endX,t.endY),this.selectedAnnotation===t&&this.drawSelectionIndicator(t),this.hoveredAnnotation===t&&this.drawLineResizeHandles(t);break;case"text":{const e=t.fontSize||24;this.canvasContext.fillStyle=t.color,this.canvasContext.font=`${e}px Arial`,this.canvasContext.fillText(t.text,t.x,t.y),this.selectedAnnotation===t&&this.drawTextSelectionIndicator(t);break}}},this.drawSelectionIndicator=t=>{if(!this.canvasContext)return;const e=this.canvasContext.strokeStyle,o=this.canvasContext.lineWidth;switch(this.canvasContext.strokeStyle="#0070F4",this.canvasContext.lineWidth=2,this.canvasContext.setLineDash([5,5]),t.type){case"rectangle":this.canvasContext.strokeRect(t.startX-2,t.startY-2,t.width+4,t.height+4);break;case"line":case"arrow":this.canvasContext.beginPath(),this.canvasContext.moveTo(t.startX,t.startY),this.canvasContext.lineTo(t.endX,t.endY),this.canvasContext.stroke()}this.canvasContext.setLineDash([]),this.canvasContext.strokeStyle=e,this.canvasContext.lineWidth=o},this.drawTextSelectionIndicator=t=>{if(!this.canvasContext)return;const e=t.fontSize||24,o=this.getTextWidth(t.text,e),i=this.canvasContext.strokeStyle,a=this.canvasContext.lineWidth;this.canvasContext.strokeStyle="#0070F4",this.canvasContext.lineWidth=2,this.canvasContext.setLineDash([3,3]),this.canvasContext.strokeRect(t.x-4,t.y-e-4,o+8,e+8),this.canvasContext.setLineDash([]),this.canvasContext.strokeStyle=i,this.canvasContext.lineWidth=a},this.drawArrow=(t,e,o,i)=>{const a=Math.atan2(i-e,o-t);this.canvasContext.beginPath(),this.canvasContext.moveTo(t,e),this.canvasContext.lineTo(o,i),this.canvasContext.stroke(),this.canvasContext.beginPath(),this.canvasContext.moveTo(o,i),this.canvasContext.lineTo(o-15*Math.cos(a-Math.PI/6),i-15*Math.sin(a-Math.PI/6)),this.canvasContext.moveTo(o,i),this.canvasContext.lineTo(o-15*Math.cos(a+Math.PI/6),i-15*Math.sin(a+Math.PI/6)),this.canvasContext.stroke()},this.undoLastAnnotation=()=>{this.annotations=this.annotations.slice(0,-1),this.redrawAnnotations()},this.deleteSelectedAnnotation=()=>{if(this.selectedAnnotation){const t=this.annotations.findIndex((t=>t===this.selectedAnnotation));-1!==t&&(this.annotations=this.annotations.filter(((e,o)=>o!==t)),this.selectedAnnotation=null,this.redrawAnnotations())}},this.handleColorSlotClick=t=>{this.editingColorIndex===t?(this.canvasDrawingColor=this.defaultColors[t],this.showColorPicker=!1,this.editingColorIndex=-1):(this.editingColorIndex=t,this.showColorPicker=!0,this.canvasDrawingColor=this.defaultColors[t])},this.updateColorSlot=t=>{this.editingColorIndex>=0&&this.editingColorIndex{t.stopPropagation();const e=t.target.value;this.editingColorIndex>=0&&this.editingColorIndex{t.stopPropagation()},this.closeColorPicker=()=>{this.showColorPicker=!1,this.editingColorIndex=-1},this.getTextWidth=(t,e)=>{if(!this.canvasContext)return t.length*e*.6;const o=this.canvasContext.font;this.canvasContext.font=`${e}px Arial`;const i=this.canvasContext.measureText(t).width;return this.canvasContext.font=o,i},this.isPointInResizeHandle=(t,e,o)=>{switch(o.type){case"rectangle":{const i=o.startX+o.width,a=o.startY+o.height;return t>=i-4&&t<=i+4&&e>=a-4&&e<=a+4}case"line":case"arrow":{const i=[{x:o.startX,y:o.startY,point:"start"},{x:o.endX,y:o.endY,point:"end"}];for(const o of i)if(t>=o.x-4&&t<=o.x+4&&e>=o.y-4&&e<=o.y+4)return o.point;return!1}default:return!1}},this.drawRectangleResizeHandles=t=>{if(!this.canvasContext||"rectangle"!==t.type)return;const e=t.startX+t.width,o=t.startY+t.height;this.canvasContext.fillStyle="#0070F4",this.canvasContext.strokeStyle="#ffffff",this.canvasContext.lineWidth=2,this.canvasContext.fillRect(e-4,o-4,8,8),this.canvasContext.strokeRect(e-4,o-4,8,8)},this.drawLineResizeHandles=t=>{if(!this.canvasContext||"line"!==t.type&&"arrow"!==t.type)return;const e=[{x:t.startX,y:t.startY},{x:t.endX,y:t.endY}];this.canvasContext.fillStyle="#0070F4",this.canvasContext.strokeStyle="#ffffff",this.canvasContext.lineWidth=2,e.forEach((t=>{this.canvasContext.fillRect(t.x-4,t.y-4,8,8),this.canvasContext.strokeRect(t.x-4,t.y-4,8,8)}))},this.startResize=(t,e,o)=>{this.isResizing=!0,this.resizingAnnotation=t,this.resizeHandle=e,this.dragStartPos=o,"rectangle"===t.type&&(this.resizeStartDimensions={width:t.width,height:t.height})},this.handleResize=t=>{if(!this.resizingAnnotation||!this.dragStartPos)return;const e=this.resizingAnnotation,o=this.annotations.findIndex((t=>t===e));if(-1===o)return;const i=Object.assign({},e);switch(e.type){case"rectangle":{const e=t.y-this.dragStartPos.y;i.width=Math.max(10,this.resizeStartDimensions.width+(t.x-this.dragStartPos.x)),i.height=Math.max(10,this.resizeStartDimensions.height+e);break}case"line":case"arrow":"start"===this.resizeHandle?(i.startX=t.x,i.startY=t.y):"end"===this.resizeHandle&&(i.endX=t.x,i.endY=t.y)}this.annotations[o]=i,this.resizingAnnotation=i,this.redrawAnnotations()},this.startTextEditing=t=>{const e=prompt(this.editTextPromptText,t.text);if(null!==e&&e.trim()){const o=this.annotations.findIndex((e=>e===t));-1!==o&&(this.annotations[o]=Object.assign(Object.assign({},t),{text:e.trim()}),this.selectedAnnotation=this.annotations[o],this.redrawAnnotations())}},this.updateSelectedTextSize=t=>{if(this.selectedAnnotation&&"text"===this.selectedAnnotation.type){const e=this.annotations.findIndex((t=>t===this.selectedAnnotation));-1!==e&&(this.annotations[e]=Object.assign(Object.assign({},this.selectedAnnotation),{fontSize:Math.max(8,Math.min(72,t))}),this.selectedAnnotation=this.annotations[e],this.redrawAnnotations())}},this.updateSelectedBorderWidth=t=>{if(this.selectedAnnotation&&["rectangle","line","arrow"].includes(this.selectedAnnotation.type)){const e=this.annotations.findIndex((t=>t===this.selectedAnnotation));-1!==e&&(this.annotations[e]=Object.assign(Object.assign({},this.selectedAnnotation),{lineWidth:Math.max(1,Math.min(20,t))}),this.selectedAnnotation=this.annotations[e],this.redrawAnnotations())}},this.handleCanvasMouseDown=t=>{if(!this.canvasRef)return;if(window.innerWidth<=768)return;this.showColorPicker&&this.closeColorPicker();const e=this.getCanvasCoordinates(t),o=this.findAnnotationAt(e.x,e.y);if(o){if(this.selectedAnnotation=o.annotation,"text"!==o.annotation.type){const t=this.isPointInResizeHandle(e.x,e.y,o.annotation);if(t)return this.startResize(o.annotation,t,e),void(this.canvasRef.style.cursor="nw-resize")}if("text"===o.annotation.type&&2===t.detail)return void this.startTextEditing(o.annotation);if(!this.isDrawing)return this.isDragging=!0,this.draggedAnnotation=o.annotation,this.dragStartPos=e,void(this.canvasRef.style.cursor="grabbing")}else this.selectedAnnotation=null;if(this.isDrawing=!0,"text"===this.canvasDrawingTool){const t=prompt(this.editTextPromptText);t&&(this.annotations=[...this.annotations,{type:"text",x:e.x,y:e.y,text:t,color:this.canvasDrawingColor,fontSize:this.canvasTextSize}],this.redrawAnnotations()),this.isDrawing=!1}else this.currentAnnotation={type:this.canvasDrawingTool,startX:e.x,startY:e.y,color:this.canvasDrawingColor,lineWidth:this.canvasLineWidth}},this.handleCanvasMouseMove=t=>{if(!this.canvasRef)return;if(window.innerWidth<=768)return;const e=this.getCanvasCoordinates(t);if(this.isResizing&&this.resizingAnnotation)return void this.handleResize(e);if(this.isDragging&&this.draggedAnnotation&&this.dragStartPos){const t=e.x-this.dragStartPos.x,o=e.y-this.dragStartPos.y,i=Object.assign({},this.draggedAnnotation);switch(i.type){case"rectangle":i.startX+=t,i.startY+=o;break;case"line":case"arrow":i.startX+=t,i.startY+=o,i.endX+=t,i.endY+=o;break;case"text":i.x+=t,i.y+=o}const a=this.annotations.findIndex((t=>t===this.draggedAnnotation));return-1!==a&&(this.annotations[a]=i,this.draggedAnnotation=i),this.dragStartPos=e,void this.redrawAnnotations()}if(this.isDrawing&&this.currentAnnotation)return"rectangle"===this.canvasDrawingTool?(this.currentAnnotation.width=e.x-this.currentAnnotation.startX,this.currentAnnotation.height=e.y-this.currentAnnotation.startY):(this.currentAnnotation.endX=e.x,this.currentAnnotation.endY=e.y),this.redrawAnnotations(),void this.drawAnnotation(this.currentAnnotation);const o=this.findAnnotationAt(e.x,e.y);if(o){if("text"!==o.annotation.type&&this.isPointInResizeHandle(e.x,e.y,o.annotation))return this.canvasRef.style.cursor="nw-resize",this.hoveredAnnotation=o.annotation,void this.redrawAnnotations();this.canvasRef.style.cursor="grab",this.hoveredAnnotation!==o.annotation&&(this.hoveredAnnotation=o.annotation,this.redrawAnnotations())}else this.canvasRef.style.cursor="crosshair",this.hoveredAnnotation&&(this.hoveredAnnotation=null,this.redrawAnnotations())},this.handleCanvasMouseUp=()=>{if(window.innerWidth<=768)return;if(this.isResizing)return this.isResizing=!1,this.resizingAnnotation=null,this.dragStartPos=null,this.resizeHandle=!1,this.resizeStartDimensions=null,void(this.canvasRef&&(this.canvasRef.style.cursor="crosshair"));if(this.isDragging)return this.isDragging=!1,this.draggedAnnotation=null,this.dragStartPos=null,void(this.canvasRef&&(this.canvasRef.style.cursor="crosshair"));if(!this.isDrawing||!this.currentAnnotation)return;this.isDrawing=!1;const t=this.currentAnnotation;this.currentAnnotation=null,this.isDegenerateAnnotation(t)||(this.annotations=[...this.annotations,t]),this.redrawAnnotations()},this.getCanvasCoordinates=t=>{if(!this.canvasRef)return{x:0,y:0};const e=this.canvasRef.getBoundingClientRect();return{x:this.canvasRef.width/e.width*(t.clientX-e.left),y:this.canvasRef.height/e.height*(t.clientY-e.top)}},this.findAnnotationAt=(t,e)=>{for(let o=this.annotations.length-1;o>=0;o--){const i=this.annotations[o];if(this.isPointInAnnotation(t,e,i))return{annotation:i,index:o}}return null},this.isPointInAnnotation=(t,e,o)=>{const i=10;switch(o.type){case"rectangle":{const a=Math.min(o.startX,o.startX+o.width),s=Math.max(o.startX,o.startX+o.width),r=Math.min(o.startY,o.startY+o.height),n=Math.max(o.startY,o.startY+o.height);return t>=a-i&&t<=s+i&&e>=r-i&&e<=n+i}case"line":case"arrow":{const a=Number.isFinite(o.endX)?o.endX:o.startX,s=Number.isFinite(o.endY)?o.endY:o.startY,r=a-o.startX,n=s-o.startY,d=r*r+n*n;let c=0;return d>0&&(c=((t-o.startX)*r+(e-o.startY)*n)/d,c=Math.max(0,Math.min(1,c))),Math.hypot(t-(o.startX+c*r),e-(o.startY+c*n))<=i}case"text":{const a=o.fontSize||24,s=this.getTextWidth(o.text,a);return t>=o.x-i&&t<=o.x+s+i&&e>=o.y-a-i&&e<=o.y+i}default:return!1}},this.canvasEditorTitle="Edit screenshot",this.canvasEditorCancelText="Cancel",this.canvasEditorSaveText="Save",this.screenshotTakingText="Taking screenshot...",this.screenshotAttachedText="Screenshot attached",this.screenshotButtonText="Add a screenshot",this.escapeClose=!0,this.clickOutsideClose=!0,this.autoStartScreenshot=!1,this.existingScreenshot="",this.editTextButtonText="Edit Text",this.sizeLabelText="Size:",this.borderLabelText="Border:",this.editTextPromptText="Edit text:",this.screenshotErrorGeneral="Failed to capture screenshot.",this.screenshotErrorPermission="Permission denied. Please allow screen sharing to take screenshots.",this.screenshotErrorNotSupported="Screen capture is not supported in this browser.",this.screenshotErrorNotFound="No screen sources available for capture.",this.screenshotErrorCancelled="Screenshot capture was cancelled.",this.screenshotErrorBrowserNotSupported="Your browser does not support screen capture. Please use a browser like Chrome, Firefox, or Safari on desktop.",this.screenshotErrorUnexpected="An unexpected error occurred. Please try again.",this.takingScreenshot=!1,this.showCanvasEditor=!1,this.canvasDrawingTool="rectangle",this.canvasDrawingColor="#ff0000",this.canvasLineWidth=3,this.canvasTextSize=24,this.isDrawing=!1,this.annotations=[],this.currentAnnotation=null,this.isDragging=!1,this.draggedAnnotation=null,this.dragStartPos=null,this.showColorPicker=!1,this.editingColorIndex=-1,this.selectedAnnotation=null,this.isResizing=!1,this.resizingAnnotation=null,this.resizeStartSize=24,this.resizeStartDimensions=null,this.hoveredAnnotation=null,this.resizeHandle=!1,this.defaultColors=["#ff0000","#00ff00","#0000ff","#000000"]}componentDidLoad(){this.autoStartScreenshot?(this.showCanvasEditor=!0,setTimeout((()=>{this.openScreenShot()}),100)):this.existingScreenshot&&(this.originalImageData=this.existingScreenshot,this.showCanvasEditor=!0,setTimeout((()=>{this.initializeCanvas()}),100)),this.handleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.handleWindowResize),document.addEventListener("keydown",this.handleKeyDown)}componentDidRender(){var t;if(this.showCanvasEditor&&(null===(t=this.overlayRef)||void 0===t?void 0:t.isConnected)){const t=this.overlayRef;t.showPopover&&!t.matches(":popover-open")&&t.showPopover()}}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),document.removeEventListener("keydown",this.handleKeyDown)}async captureViewportScreenshot(){try{if(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia)throw new Error("Screen Capture API is not supported in this browser");const t=await navigator.mediaDevices.getDisplayMedia({video:{mediaSource:"screen",width:{ideal:window.innerWidth},height:{ideal:window.innerHeight}},audio:!1,preferCurrentTab:!0}),e=document.createElement("video");return e.srcObject=t,e.autoplay=!0,e.muted=!0,new Promise(((o,i)=>{let a=!1;const s=()=>{t.getTracks().forEach((t=>t.stop()))},r=t=>{a||(a=!0,clearTimeout(n),e.onloadedmetadata=null,e.onerror=null,t())},n=setTimeout((()=>{r((()=>{s(),i(new Error("Screenshot capture timed out"))}))}),1e4);e.onloadedmetadata=()=>{e.play(),setTimeout((()=>{try{const t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight,t.getContext("2d").drawImage(e,0,0);const i=t.toDataURL("image/png");r((()=>{s(),o(i)}))}catch(t){r((()=>{s(),i(t)}))}}),100)},e.onerror=()=>{r((()=>{s(),i(new Error("Failed to load video for screenshot capture"))}))}}))}catch(t){throw console.error("Screen capture failed:",t),t}}isDegenerateAnnotation(t){return"line"===t.type||"arrow"===t.type?!Number.isFinite(t.endX)||!Number.isFinite(t.endY)||Math.hypot(t.endX-t.startX,t.endY-t.startY)<2:"rectangle"===t.type&&(!Number.isFinite(t.width)||!Number.isFinite(t.height)||Math.abs(t.width)<2&&Math.abs(t.height)<2)}render(){var t,e,i,a,s,r;return o("div",{class:"canvas-editor-wrapper"},this.showCanvasEditor&&o("div",{class:"canvas-editor-overlay",part:"overlay",ref:t=>{this.overlayRef=t,null==t||t.setAttribute("popover","manual")},onMouseDown:this.handleOverlayMouseDown,onClick:this.handleOverlayClick},o("div",{class:"canvas-editor-modal",part:"modal",role:"dialog","aria-modal":"true","aria-labelledby":"canvas-editor-title"},o("div",{class:"canvas-editor-header",part:"header"},o("div",{class:"canvas-editor-title",part:"title"},o("h3",{id:"canvas-editor-title"},this.canvasEditorTitle)),o("div",{class:"canvas-editor-toolbar",part:"toolbar"},o("div",{class:"toolbar-section"},o("div",{class:"tool-group"},o("button",{class:"tool-btn "+("rectangle"===this.canvasDrawingTool?"active":""),part:"tool-button",onClick:()=>this.canvasDrawingTool="rectangle",title:"Rectangle"},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-square"},o("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}))),o("button",{class:"tool-btn "+("line"===this.canvasDrawingTool?"active":""),part:"tool-button",onClick:()=>this.canvasDrawingTool="line",title:"Line"},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-minus"},o("path",{d:"M5 12h14"}))),o("button",{class:"tool-btn "+("arrow"===this.canvasDrawingTool?"active":""),part:"tool-button",onClick:()=>this.canvasDrawingTool="arrow",title:"Arrow"},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-move-up-right"},o("path",{d:"M13 5H19V11"}),o("path",{d:"M19 5L5 19"}))),o("button",{class:"tool-btn "+("text"===this.canvasDrawingTool?"active":""),part:"tool-button",onClick:()=>this.canvasDrawingTool="text",title:"Text"},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-type"},o("path",{d:"M12 4v16"}),o("path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}),o("path",{d:"M9 20h6"}))),o("div",{class:"toolbar-divider"}),o("button",{class:"tool-btn undo-btn",part:"tool-button",onClick:this.undoLastAnnotation,disabled:0===this.annotations.length,title:"Undo"},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-undo"},o("path",{d:"M3 7v6h6"}),o("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"}))),this.selectedAnnotation&&o("button",{class:"tool-btn delete-btn",part:"tool-button",onClick:this.deleteSelectedAnnotation,title:"Delete"},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-trash-2"},o("path",{d:"M3 6h18"}),o("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),o("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),o("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),o("line",{x1:"14",x2:"14",y1:"11",y2:"17"}))))),o("div",{class:"toolbar-section"},o("div",{class:"color-palette"},this.defaultColors.map(((t,e)=>o("div",{class:"color-slot-wrapper"},o("button",{class:`color-btn ${this.canvasDrawingColor===t?"active":""} ${this.editingColorIndex===e?"editing":""}`,style:{backgroundColor:t},onClick:()=>this.handleColorSlotClick(e),title:`Color ${e+1} - Click to customize`},this.editingColorIndex===e&&o("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"white","stroke-width":"2"},o("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}))),this.editingColorIndex===e&&this.showColorPicker&&o("div",{class:"color-picker-dropdown"},o("input",{type:"color",value:t,onInput:t=>this.handleColorPickerInput(t),onClick:t=>this.handleColorPickerClick(t)}))))))),(this.selectedAnnotation||this.canvasDrawingTool)&&o("div",{class:"toolbar-section selected-annotation-controls"},("text"===(null===(t=this.selectedAnnotation)||void 0===t?void 0:t.type)||!this.selectedAnnotation&&"text"===this.canvasDrawingTool)&&o("div",{class:"text-controls"},o("div",{class:"font-size-control"},o("label",null,this.sizeLabelText),o("input",{type:"range",min:"8",max:"72",value:(null===(e=this.selectedAnnotation)||void 0===e?void 0:e.fontSize)||this.canvasTextSize,onInput:t=>{const e=parseInt(t.target.value);this.selectedAnnotation?this.updateSelectedTextSize(e):this.canvasTextSize=e},class:"size-slider"}),o("span",{class:"size-value"},(null===(i=this.selectedAnnotation)||void 0===i?void 0:i.fontSize)||this.canvasTextSize,"px")),this.selectedAnnotation&&o("button",{class:"action-btn small",onClick:()=>this.startTextEditing(this.selectedAnnotation)},this.editTextButtonText)),(["rectangle","line","arrow"].includes(null===(a=this.selectedAnnotation)||void 0===a?void 0:a.type)||!this.selectedAnnotation&&["rectangle","line","arrow"].includes(this.canvasDrawingTool))&&o("div",{class:"shape-controls"},o("div",{class:"border-width-control"},o("label",null,this.borderLabelText),o("input",{type:"range",min:"1",max:"20",value:(null===(s=this.selectedAnnotation)||void 0===s?void 0:s.lineWidth)||this.canvasLineWidth,onInput:t=>{const e=parseInt(t.target.value);this.selectedAnnotation?this.updateSelectedBorderWidth(e):this.canvasLineWidth=e},class:"size-slider"}),o("span",{class:"size-value"},(null===(r=this.selectedAnnotation)||void 0===r?void 0:r.lineWidth)||this.canvasLineWidth,"px")))),o("div",{class:"toolbar-section"},o("button",{class:"action-btn secondary",part:"cancel-button",onClick:this.closeCanvasEditor},this.canvasEditorCancelText),o("button",{class:"action-btn primary",part:"save-button",onClick:this.saveAnnotations},this.canvasEditorSaveText))),o("div",{class:"canvas-editor-content",part:"content"},o("canvas",{ref:t=>this.canvasRef=t,class:"annotation-canvas",part:"canvas",onMouseDown:this.handleCanvasMouseDown,onMouseMove:this.handleCanvasMouseMove,onMouseUp:this.handleCanvasMouseUp,onMouseLeave:this.handleCanvasMouseUp}))))))}};s.style=":host{display:block}.canvas-editor-wrapper{position:relative}.canvas-editor-overlay{position:fixed;inset:0;margin:0;padding:0;border:0;width:100vw;height:100vh;background:rgba(0, 0, 0, 0.8);display:flex;align-items:center;justify-content:center;z-index:9999}.canvas-editor-overlay[popover]:not(:popover-open){display:none}.canvas-editor-modal{width:95vw;height:95vh;max-width:none;max-height:none;background:var(--feedback-canvas-editor-bg-color, #ffffff);border-radius:12px;border:1px solid rgba(0, 0, 0, 0.08);display:flex;flex-direction:column;overflow:hidden;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.02),\n 0 8px 16px rgba(0, 0, 0, 0.08),\n 0 16px 32px rgba(0, 0, 0, 0.08),\n 0 32px 64px rgba(0, 0, 0, 0.06)}.canvas-editor-header{background:var(--feedback-canvas-editor-header-bg-color, #fafafa);border-bottom:1px solid rgba(0, 0, 0, 0.06);padding:16px 20px;display:flex;flex-direction:column;gap:16px}.canvas-editor-title h3{margin:0;font-size:18px;font-weight:600;color:var(--feedback-canvas-editor-tool-text-color, #1a1a1a);letter-spacing:-0.02em}.canvas-editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:16px}.toolbar-section{display:flex;align-items:center;gap:8px}.tool-group{display:flex;align-items:center;gap:4px}.tool-btn{width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:var(--feedback-canvas-editor-tool-bg-color, #ffffff);border:1.5px solid rgba(0, 0, 0, 0.08);border-radius:8px;cursor:pointer;transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);padding:0;box-shadow:0 1px 2px rgba(0, 0, 0, 0.04)}.tool-btn svg{width:18px;height:18px;color:var(--feedback-canvas-editor-tool-text-color, #333)}.tool-btn:hover:not(:disabled){background:var(--feedback-canvas-editor-tool-bg-hover, #f5f5f5);border-color:rgba(0, 0, 0, 0.12);transform:translateY(-1px);box-shadow:0 2px 4px rgba(0, 0, 0, 0.08)}.tool-btn.active,.tool-btn.active:hover{background:var(--feedback-canvas-editor-tool-bg-active, #0070f4);color:var(--feedback-canvas-editor-tool-text-active, #ffffff);border-color:var(--feedback-canvas-editor-tool-bg-active, #0070f4);box-shadow:0 2px 8px rgba(0, 112, 244, 0.3)}.tool-btn.active svg{color:var(--feedback-canvas-editor-tool-text-active, #ffffff)}.tool-btn:disabled{opacity:0.4;cursor:not-allowed;color:var(--feedback-canvas-editor-tool-text-color, #333)}.toolbar-divider{width:1px;height:24px;background:var(--feedback-canvas-editor-divider-color, #e0e0e0);margin:0 4px}.undo-btn,.delete-btn{background:var(--feedback-canvas-editor-tool-bg-color, #ffffff) !important;border:1px solid var(--feedback-canvas-editor-border-color, #e0e0e0) !important}.undo-btn:hover:not(:disabled),.delete-btn:hover:not(:disabled){background:var(--feedback-canvas-editor-tool-bg-hover, #f0f0f0) !important}.undo-btn:disabled,.delete-btn:disabled{opacity:0.3;cursor:not-allowed}.delete-btn:hover:not(:disabled){background:#fee !important;border-color:#fcc !important}.delete-btn:hover:not(:disabled) svg{color:#c53030}.color-palette{display:flex;align-items:center;gap:6px}.color-slot-wrapper{position:relative;display:flex;align-items:center}.color-btn{width:32px;height:32px;border-radius:8px;border:2px solid transparent;cursor:pointer;transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);display:flex;align-items:center;justify-content:center;background:var(--feedback-canvas-editor-tool-bg-color, #ffffff);border:2px solid rgba(0, 0, 0, 0.08);box-shadow:0 1px 2px rgba(0, 0, 0, 0.04)}.color-btn:hover{transform:translateY(-2px) scale(1.05);box-shadow:0 4px 8px rgba(0, 0, 0, 0.12)}.color-btn.active{border-color:var(--feedback-primary-color, #0070f4);box-shadow:0 0 0 2px rgba(0, 112, 244, 0.2)}.color-btn.editing{border-color:var(--feedback-primary-color, #0070f4)}.color-picker-dropdown{position:absolute;top:100%;left:0;z-index:1000;margin-top:4px;background:var(--feedback-canvas-editor-tool-bg-color, #ffffff);border:1px solid var(--feedback-canvas-editor-border-color, #e0e0e0);border-radius:6px;padding:8px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.1)}.color-picker-dropdown input[type=\"color\"]{width:40px;height:40px;border:none;border-radius:4px;cursor:pointer}.size-control{display:flex;align-items:center;gap:8px;background:var(--feedback-canvas-editor-tool-bg-color, #ffffff);border:1px solid var(--feedback-canvas-editor-border-color, #e0e0e0);border-radius:6px;padding:6px 12px}.size-slider{width:80px;height:14px;-webkit-appearance:none;appearance:none;background:transparent;border-radius:2px;outline:none;cursor:pointer;border:none;position:relative}.size-slider::before{content:'';position:absolute;top:50%;left:0;right:0;height:4px;background:rgba(0, 0, 0, 0.15);border-radius:2px;transform:translateY(-50%);pointer-events:none}.size-slider::-webkit-slider-track{width:100%;height:4px;background:transparent;border-radius:2px;border:none}.size-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:14px;height:14px;background:var(--feedback-primary-color, #0070f4);border-radius:50%;cursor:pointer;position:relative;z-index:1}.size-slider::-moz-range-track{width:100%;height:4px;background:transparent;border-radius:2px;border:none}.size-slider::-moz-range-thumb{width:14px;height:14px;background:var(--feedback-primary-color, #0070f4);border-radius:50%;border:none;cursor:pointer}.size-slider::-ms-track{width:100%;height:4px;background:transparent;border-radius:2px;border:none;color:transparent}.size-slider::-ms-thumb{width:14px;height:14px;background:var(--feedback-primary-color, #0070f4);border-radius:50%;border:none;cursor:pointer}.size-value{font-weight:500;color:var(--feedback-canvas-editor-tool-text-color, #333);font-size:12px;min-width:30px}.selected-annotation-controls{border-left:2px solid var(--feedback-canvas-editor-divider-color, #e0e0e0);padding-left:12px;margin-left:8px;min-width:200px}.text-controls{display:flex;flex-direction:row;align-items:center;gap:12px}.font-size-control,.border-width-control{display:flex;align-items:center;gap:6px}.font-size-control label,.border-width-control label{font-size:12px;color:var(--feedback-canvas-editor-tool-text-color, #333);font-weight:500;min-width:35px}.action-btn{display:flex;align-items:center;gap:8px;padding:0 20px;border:1.5px solid rgba(0, 0, 0, 0.08);border-radius:8px;cursor:pointer;font-size:14px;font-weight:500;transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);min-width:80px;justify-content:center;height:40px;box-shadow:0 1px 2px rgba(0, 0, 0, 0.04)}.action-btn.secondary{background:var(--feedback-canvas-editor-tool-bg-color, #ffffff);color:var(--feedback-canvas-editor-tool-text-color, #333);border-color:rgba(0, 0, 0, 0.08)}.action-btn.secondary:hover{background:var(--feedback-canvas-editor-tool-bg-hover, #f5f5f5);border-color:rgba(0, 0, 0, 0.12);transform:translateY(-1px);box-shadow:0 4px 8px rgba(0, 0, 0, 0.08)}.action-btn.primary{background:var(--feedback-primary-color, #0070f4);color:#ffffff;border-color:var(--feedback-primary-color, #0070f4);box-shadow:0 2px 4px rgba(0, 112, 244, 0.2)}.action-btn.primary:hover{background:#0056cc;border-color:#0056cc;transform:translateY(-1px);box-shadow:0 6px 12px rgba(0, 112, 244, 0.3)}.action-btn:active{transform:translateY(0)}.action-btn.small{height:28px;padding:4px 8px;font-size:12px;min-width:65px}.shape-controls{display:flex;flex-direction:column;gap:8px}.canvas-editor-content{flex:1;display:flex;align-items:center;justify-content:center;padding:24px;background:var(--feedback-canvas-editor-content-bg, #f5f5f5);overflow:hidden;min-height:0;min-width:0;position:relative}.canvas-editor-content::-webkit-scrollbar{width:8px;height:8px}.canvas-editor-content::-webkit-scrollbar-track{background:transparent}.canvas-editor-content::-webkit-scrollbar-thumb{background:rgba(0, 0, 0, 0.2);border-radius:4px}.canvas-editor-content::-webkit-scrollbar-thumb:hover{background:rgba(0, 0, 0, 0.3)}.annotation-canvas{max-width:calc(100% - 48px);max-height:calc(100% - 48px);width:auto !important;height:auto !important;cursor:crosshair;border-radius:8px;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.04),\n 0 4px 6px rgba(0, 0, 0, 0.06),\n 0 8px 16px rgba(0, 0, 0, 0.08);background:#ffffff;transition:box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);object-fit:contain;display:block;margin:auto}.annotation-canvas:hover{box-shadow:0 0 0 1px rgba(0, 0, 0, 0.06),\n 0 6px 10px rgba(0, 0, 0, 0.08),\n 0 12px 24px rgba(0, 0, 0, 0.1)}@media screen and (min-width: 1920px){.canvas-editor-modal{width:90vw;height:90vh}.canvas-editor-content{padding:32px}}@media screen and (min-width: 1200px) and (max-width: 1919px){.canvas-editor-modal{width:92vw;height:92vh}.canvas-editor-content{padding:28px}}@media screen and (min-width: 769px) and (max-width: 1199px){.canvas-editor-modal{width:95vw;height:95vh}}@media screen and (max-width: 768px){.canvas-editor-modal{width:100vw;height:100vh;border-radius:0}.canvas-editor-toolbar{flex-direction:column;align-items:stretch;gap:8px}.toolbar-section{justify-content:center}.selected-annotation-controls{border-left:none;border-top:2px solid var(--feedback-canvas-editor-divider-color, #e0e0e0);padding-left:0;padding-top:8px;margin-left:0;margin-top:8px;min-width:auto}.canvas-editor-content{padding:16px}}";const r=class{constructor(o){t(this,o),this.feedbackSent=e(this,"feedbackSent",7),this.feedbackError=e(this,"feedbackError",7),this.feedbackEventsEnabled=!1,this.buttonPosition="default",this.buttonStyle="default",this.hideIcon=!1,this.hideMobile=!1,this.sessionId="",this.metadata="",this.submit=!1,this.apiKey="",this.clickOutsideClose=!0,this.customFont=!1,this.emailAddress="",this.historyClose=!0,this.isEmailRequired=!1,this.fetchData=!0,this.hideEmail=!1,this.hidePrivacyPolicy=!0,this.hideRating=!1,this.hideScreenshotButton=!1,this.screenshotPositioning=!1,this.modalPosition="center",this.project="",this.rating=void 0,this.ratingMode="thumbs",this.emailPlaceholder="Email address (optional)",this.errorMessage="Please try again later.",this.errorMessage401="This project requires a valid API key to submit feedback. Check the api-key attribute.",this.errorMessage403="The request URL does not match the one defined in PushFeedback for this project.",this.errorMessage404="We could not find the provided project id in PushFeedback.",this.footerText="",this.messagePlaceholder="Share your thoughts...",this.modalTitle="Share your feedback",this.modalTitleError="Oops!",this.modalTitleSuccess="Thanks for your feedback!",this.privacyPolicyText="I have read and expressly consent to the terms of the Privacy Policy.",this.ratingPlaceholder="Was this page helpful?",this.ratingStarsPlaceholder="How would you rate this page?",this.sendButtonText="Send",this.successMessage="",this.recaptchaText='This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.',this.screenshotAttachedText="Screenshot attached",this.screenshotButtonText="Add a screenshot",this.screenshotTakingText="Taking screenshot...",this.screenshotPositioningText="Scroll to the area you want to capture.",this.screenshotPositioningCaptureText="Capture this view",this.screenshotPositioningCancelText="Cancel",this.screenshotEditTextButtonText="Edit text",this.screenshotEditorTitle="Edit screenshot",this.screenshotEditorCancelText="Cancel",this.screenshotEditorSaveText="Save",this.screenshotSizeLabelText="Size:",this.screenshotBorderLabelText="Border:",this.screenshotEditTextPromptText="Edit text:",this.screenshotErrorGeneral="Failed to capture screenshot.",this.screenshotErrorPermission="Permission denied. Please allow screen sharing to take screenshots.",this.screenshotErrorNotSupported="Screen capture is not supported in this browser.",this.screenshotErrorNotFound="No screen sources available for capture.",this.screenshotErrorCancelled="Screenshot capture was cancelled.",this.screenshotErrorBrowserNotSupported="Your browser does not support screen capture. Please use a browser like Chrome, Firefox, or Safari on desktop.",this.screenshotErrorUnexpected="An unexpected error occurred. Please try again."}emitFeedbackSent(t){this.feedbackEventsEnabled&&this.feedbackSent.emit({feedback:t})}emitFeedbackError(t){this.feedbackEventsEnabled&&this.feedbackError.emit({error:t})}async fetchFeedbackEventsEnabled(){try{const t=await fetch("https://app.pushfeedback.com/api/v1/projects/"+this.project+"/");if(!t.ok)return void(this.feedbackEventsEnabled=!1);const e=await t.json();this.feedbackEventsEnabled=Array.isArray(e.features)&&e.features.includes("feedback_events")}catch(t){this.feedbackEventsEnabled=!1}}componentWillLoad(){if(this.sessionId)localStorage.setItem("pushfeedback_sessionid",this.sessionId);else{let t=localStorage.getItem("pushfeedback_sessionid");t||(t=this.generateRandomSessionId(),localStorage.setItem("pushfeedback_sessionid",t),this.sessionId=t)}this.fetchFeedbackEventsEnabled()}componentDidLoad(){if("center-right"===this.buttonPosition||"center-left"===this.buttonPosition){const t=this.el.shadowRoot.querySelector(".feedback-button-content");let e=0;this.isSafariBrowser()&&(e=5);const o=(t.offsetWidth+e)/2*-1+"px";"center-right"===this.buttonPosition?t.style.right=o:t.style.left=o}this.customFont||this.loadInterFont()}connectedCallback(){this.feedbackModal=document.createElement("feedback-modal");const t=["bottom-right","bottom-left","top-right","top-left","center-right","center-left"].includes(this.buttonPosition);["apiKey","clickOutsideClose","customFont","emailAddress","fetchData","historyClose","hideEmail","hidePrivacyPolicy","hideRating","hideScreenshotButton","screenshotPositioning","isEmailRequired","modalPosition","project","rating","ratingMode","screenshotEditorTitle","screenshotEditorCancelText","screenshotEditorSaveText","screenshotEditTextButtonText","screenshotSizeLabelText","screenshotBorderLabelText","screenshotEditTextPromptText","screenshotErrorGeneral","screenshotErrorPermission","screenshotErrorNotSupported","screenshotErrorNotFound","screenshotErrorCancelled","screenshotErrorBrowserNotSupported","screenshotErrorUnexpected","emailPlaceholder","errorMessage","errorMessage401","errorMessage403","errorMessage404","footerText","messagePlaceholder","metadata","modalTitle","modalTitleError","modalTitleSuccess","privacyPolicyText","ratingPlaceholder","ratingStarsPlaceholder","screenshotAttachedText","screenshotButtonText","screenshotTakingText","screenshotPositioningText","screenshotPositioningCaptureText","screenshotPositioningCancelText","sendButtonText","successMessage","recaptchaText"].forEach((e=>{this.feedbackModal[e]=("screenshotPositioning"!==e||!t)&&this[e]})),document.body.appendChild(this.feedbackModal)}disconnectedCallback(){document.body.removeChild(this.feedbackModal)}generateRandomSessionId(t=16){return Math.random().toString(36).substr(2,t)}isSafariBrowser(){return/safari/i.test(navigator.userAgent)&&!/chrome/i.test(navigator.userAgent)}loadInterFont(){const t=document.createElement("link");t.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap",t.rel="stylesheet",document.head.appendChild(t)}showModal(){this.submit?this.submitRatingFeedback():this.feedbackModal.openModal()}async submitRatingFeedback(){try{let t=null;if(this.feedbackModal.recaptchaEnabled&&(t=await this.feedbackModal.getRecaptchaToken(),!t))return void this.emitFeedbackError({status:500,message:"Failed to verify reCAPTCHA. Please try again."});const e=Object.assign({url:window.location.href,project:this.project,rating:this.rating||-1,ratingMode:this.ratingMode,message:"",metadata:this.metadata,session:localStorage.getItem("pushfeedback_sessionid")||""},t&&{recaptchaToken:t}),o={"Content-Type":"application/json"};this.apiKey&&(o.Authorization=`Api-Key ${this.apiKey}`);const i=await fetch("https://app.pushfeedback.com/api/v1/feedback/",{method:"POST",body:JSON.stringify(e),headers:o});if(201===i.status){const t=Object.assign(Object.assign({},e),{id:await i.json()});this.emitFeedbackSent(t)}else{const t=await i.text();this.emitFeedbackError({status:i.status,message:t})}}catch(t){this.emitFeedbackError({status:500,message:t})}}render(){return o(i,null,o("button",{type:"button",class:`feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition} ${this.customFont?"feedback-button-content--custom-font":""} ${this.hideMobile?"feedback-button-content--hide-mobile":""}`,part:"button",onClick:()=>this.showModal()},!this.hideIcon&&"default"!=this.buttonStyle&&o("span",{class:"feedback-button-content-icon",part:"icon"},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon-edit"},o("path",{d:"M12 20h9"}),o("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}))),o("slot",null)))}get el(){return a(this)}};r.style=".feedback-button-content{cursor:pointer;max-width:fit-content;letter-spacing:var(--feedback-button-letter-spacing);z-index:var(--feedback-button-z-index);font-family:var(--feedback-font-family);background:none;border:none;margin:0;padding:0;color:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;text-align:inherit}.feedback-button-content--custom-font{font-family:inherit}.feedback-button-content--light{align-items:center;background-color:var(--feedback-button-light-bg-color);border-radius:var(--feedback-button-border-radius);box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;color:var(--feedback-button-light-text-color);display:flex;font-size:var(--feedback-button-text-font-size);font-weight:var(--feedback-button-text-font-weight);padding:8px 15px}.feedback-button-content--dark{align-items:center;background-color:var(--feedback-button-dark-bg-color);border-radius:var(--feedback-button-border-radius);box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;color:var(--feedback-button-dark-text-color);display:flex;font-weight:var(--feedback-button-text-font-weight);font-size:var(--feedback-button-text-font-size);padding:8px 15px}.icon-edit{stroke:var(--feedback-button-light-icon-color)}.feedback-button-content--dark .icon-edit{stroke:var(--feedback-button-dark-icon-color)}.feedback-button-content--bottom-right{bottom:10px;position:fixed;right:10px}.feedback-button-content--bottom-left{bottom:10px;left:10px;position:fixed}.feedback-button-content--top-right{position:fixed;right:10px;top:10px}.feedback-button-content--top-left{left:10px;position:fixed;top:10px}.feedback-button-content--center-right{position:fixed;transform:rotate(-90deg) translateY(-50%);top:50%}.feedback-button-content--center-left{position:fixed;transform:rotate(90deg) translateY(-50%);top:50%}.feedback-button-content--center-right.feedback-button-content--dark,.feedback-button-content--center-right.feedback-button-content--light,.feedback-button-content--center-left.feedback-button-content--dark,.feedback-button-content--center-left.feedback-button-content--light{border-radius:4px;border-bottom-left-radius:0px;border-bottom-right-radius:0px}.feedback-button-content-icon{height:16px;margin-right:5px;width:16px}.feedback-button-content--center-right .feedback-button-content-icon{rotate:90deg}.feedback-button-content--center-left .feedback-button-content-icon{rotate:-90deg}@media screen and (max-width: 767px){.feedback-button-content--hide-mobile{display:none}}";const n=new Set(["A","B","BR","CODE","EM","I","P","SMALL","SPAN","STRONG","U"]),d=new Set(["href","target","rel","title"]),c=/^(https?:|mailto:|tel:|#|\/|\.\/|\.\.\/)/i;function h(t){const e=Array.from(t.querySelectorAll("*"));for(const o of e){if(!t.contains(o))continue;const e=o.tagName.toUpperCase();if("SCRIPT"!==e&&"STYLE"!==e&&"IFRAME"!==e&&"OBJECT"!==e)if(n.has(e)){for(const t of Array.from(o.attributes)){const e=t.name.toLowerCase();!e.startsWith("on")&&d.has(e)&&("href"!==e||c.test(t.value.trim()))||o.removeAttribute(t.name)}"A"===e&&"_blank"===o.getAttribute("target")&&o.setAttribute("rel","noopener noreferrer")}else o.replaceWith(...Array.from(o.childNodes));else o.remove()}}function l(t){if(!t)return"";const e=document.createElement("template"),o=e;if("function"==typeof o.setHTML)try{return o.setHTML(t),h(e.content),e.innerHTML}catch(t){}return e.innerHTML=t,h(e.content),e.innerHTML}const b=class{constructor(o){t(this,o),this.feedbackSent=e(this,"feedbackSent",7),this.feedbackError=e(this,"feedbackError",7),this.feedbackEventsEnabled=!1,this.shouldFocusPositionCapture=!1,this.historyEntryPushed=!1,this.historyEntryId=`pushfeedback-${Date.now()}-${Math.random().toString(36).slice(2)}`,this.previouslyFocused=null,this.handleKeyDown=t=>{if(!this.positioningScreenshot||this.showModal){if(this.showModal&&!this.embedded&&!this.showCanvasEditor)return"Escape"===t.key&&this.escapeClose?(t.preventDefault(),void this.doClose(!this.formSuccess)):void("Tab"===t.key&&this.trapFocus(t))}else"Escape"===t.key&&this.escapeClose&&(t.preventDefault(),this.cancelScreenshotPositioning())},this.handlePopState=()=>{var t;if(this.historyEntryPushed){const e=null===(t=history.state)||void 0===t?void 0:t.pushfeedbackModalEntries;if(Array.isArray(e)&&e.includes(this.historyEntryId))return;this.historyEntryPushed=!1,(this.showModal||this.positioningScreenshot)&&(this.positioningScreenshot=!1,this.close())}},this.onScrollDebounced=()=>{clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout((()=>{document.documentElement.classList.remove("feedback-modal-screenshot-closing"),document.documentElement.style.top="",window.removeEventListener("scroll",this.onScrollDebounced)}),200)},this.handleSubmit=async t=>{if(t.preventDefault(),!this.isEmailRequired||this.formEmail){this.resetOverflow(),this.showScreenshotMode=!1,this.showScreenshotTopBar=!1,this.showModal=!1,this.sending=!0;try{let t=null;if(this.recaptchaEnabled&&(t=await this.getRecaptchaToken(),!t))return this.formSuccess=!1,this.formError=!0,this.formErrorStatus=500,this.sending=!1,void(this.showModal=!0);const e=Object.assign({url:window.location.href,message:this.formMessage,email:this.formEmail,project:this.project,screenshot:this.encodedScreenshot,rating:this.selectedRating,ratingMode:this.ratingMode,metadata:this.metadata,verification:this.formVerification,session:localStorage.getItem("pushfeedback_sessionid")||""},t&&{recaptchaToken:t}),o={"Content-Type":"application/json"};this.apiKey&&(o.Authorization=`Api-Key ${this.apiKey}`);const i=await fetch("https://app.pushfeedback.com/api/v1/feedback/",{method:"POST",body:JSON.stringify(e),headers:o});if(201===i.status){const t=Object.assign(Object.assign({},e),{id:await i.json()});this.emitFeedbackSent(t),this.formSuccess=!0,this.formError=!1}else{const t=await i.text();this.emitFeedbackError({status:i.status,message:t}),this.formSuccess=!1,this.formError=!0,this.formErrorStatus=i.status}}catch(t){this.emitFeedbackError({status:500,message:t}),this.formSuccess=!1,this.formError=!0,this.formErrorStatus=500}finally{this.sending=!1,this.showModal=!0}}},this.close=()=>{this.doClose(!1)},this.handleOverlayClick=()=>{this.doClose(!this.formSuccess)},this.doClose=t=>{this.isAnimating=!1,this.popHistoryEntry(),setTimeout((()=>{this.sending=!1,this.showModal=!1,this.showScreenshotMode=!1,this.showScreenshotTopBar=!1,this.positioningScreenshot=!1,this.hasSelectedElement=!1,document.querySelectorAll(".feedback-modal-element-selected").forEach((t=>{t.classList.remove("feedback-modal-element-selected")})),this.formSuccess=!1,this.formError=!1,this.formErrorStatus=500,t||(this.encodedScreenshot=null,this.formMessage="",this.formEmail="",this.selectedRating=this.initialRating(),this.isPrivacyChecked=!1),this.resetOverflow(),this.restoreFocus()}),200)},this.handleScreenshotReady=t=>{this.encodedScreenshot=t.detail.screenshot,this.positioningScreenshot=!1,this.showModal=!0,this.takingScreenshot=!1,this.showCanvasEditor=!1,this.autoStartCapture=!1,this.focusModal()},this.handleScreenshotCancelled=()=>{this.positioningScreenshot=!1,this.showModal=!0,this.takingScreenshot=!1,this.showCanvasEditor=!1,this.autoStartCapture=!1,this.focusModal()},this.handleScreenshotError=t=>{console.error("Screenshot error:",t.detail.error),this.screenshotError=t.detail.error,this.showScreenshotError=!0,this.positioningScreenshot=!1,this.showModal=!0,this.takingScreenshot=!1,this.showCanvasEditor=!1,this.autoStartCapture=!1,this.focusModal(),setTimeout((()=>{this.showScreenshotError=!1}),8e3)},this.openScreenShot=()=>{if(this.embedded||this.screenshotPositioning)return this.showModal=!1,this.positioningScreenshot=!0,void(this.shouldFocusPositionCapture=!0);this.startScreenshotCapture()},this.startScreenshotCapture=()=>{this.positioningScreenshot=!1,this.showModal=!1,this.takingScreenshot=!0,this.autoStartCapture=!0,this.showCanvasEditor=!0},this.cancelScreenshotPositioning=()=>{this.positioningScreenshot=!1,this.showModal=!0,requestAnimationFrame((()=>{var t;return null===(t=this.screenshotButtonRef)||void 0===t?void 0:t.focus()}))},this.openCanvasEditor=t=>{t&&t.stopPropagation(),this.showModal=!1,this.autoStartCapture=!1,this.showCanvasEditor=!0},this.sending=!1,this.formMessage="",this.formEmail="",this.formSuccess=!1,this.formVerification="",this.formError=!1,this.formErrorStatus=500,this.encodedScreenshot=void 0,this.isPrivacyChecked=!1,this.whitelabel=!1,this.selectedRating=-1,this.overlayVisible=!1,this.isAnimating=!1,this.recaptchaEnabled=!1,this.recaptchaSiteKey=null,this.takingScreenshot=!1,this.showScreenshotError=!1,this.screenshotError="",this.showCanvasEditor=!1,this.autoStartCapture=!1,this.positioningScreenshot=!1,this.apiKey="",this.customFont=!1,this.emailAddress="",this.hideEmail=!1,this.isEmailRequired=!1,this.ratingMode="thumbs",this.hasSelectedElement=!1,this.hidePrivacyPolicy=!0,this.hideRating=!1,this.hideScreenshotButton=!1,this.screenshotPositioning=!1,this.project="",this.showScreenshotMode=!1,this.showScreenshotTopBar=!1,this.showModal=!1,this.rating=void 0,this.metadata=void 0,this.fetchData=!0,this.embedded=!1,this.clickOutsideClose=!0,this.historyClose=!0,this.escapeClose=!0,this.emailPlaceholder="Email address (optional)",this.errorMessage="Please try again later.",this.errorMessage401="This project requires a valid API key to submit feedback. Check the api-key attribute.",this.errorMessage403="The request URL does not match the one defined in PushFeedback for this project.",this.errorMessage404="We could not find the provided project ID in PushFeedback.",this.messagePlaceholder="Share your thoughts...",this.footerText="",this.modalPosition="center",this.modalTitle="Share your feedback",this.modalTitleError="Oops!",this.modalTitleSuccess="Thanks for your feedback!",this.privacyPolicyText="I have read and expressly consent to the terms of the Privacy Policy.",this.ratingPlaceholder="Was this page helpful?",this.ratingStarsPlaceholder="How would you rate this page?",this.sendButtonText="Send",this.closeButtonLabel="Close feedback form",this.ratingPositiveLabel="Yes",this.ratingNegativeLabel="No",this.ratingStarLabel="Rate {rating} out of 5",this.successMessage="",this.recaptchaText='This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.',this.screenshotAttachedText="Screenshot attached",this.screenshotButtonText="Add a screenshot",this.screenshotTakingText="Taking screenshot...",this.screenshotPositioningText="Scroll to the area you want to capture.",this.screenshotPositioningCaptureText="Capture this view",this.screenshotPositioningCancelText="Cancel",this.screenshotEditTextButtonText="Edit text",this.screenshotEditorTitle="Edit screenshot",this.screenshotEditorCancelText="Cancel",this.screenshotEditorSaveText="Save",this.screenshotSizeLabelText="Size:",this.screenshotBorderLabelText="Border:",this.screenshotEditTextPromptText="Edit text:",this.screenshotErrorGeneral="Failed to capture screenshot.",this.screenshotErrorPermission="Permission denied. Please allow screen sharing to take screenshots.",this.screenshotErrorNotSupported="Screen capture is not supported in this browser.",this.screenshotErrorNotFound="No screen sources available for capture.",this.screenshotErrorCancelled="Screenshot capture was cancelled.",this.screenshotErrorBrowserNotSupported="Your browser does not support screen capture. Please use a browser like Chrome, Firefox, or Safari on desktop.",this.screenshotErrorUnexpected="An unexpected error occurred. Please try again."}handleShowModalChange(t){t&&(this.positioningScreenshot=!1,this.shouldFocusPositionCapture=!1)}connectedCallback(){window.addEventListener("popstate",this.handlePopState),document.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){window.removeEventListener("popstate",this.handlePopState),document.removeEventListener("keydown",this.handleKeyDown)}trapFocus(t){var e,o;const i=this.getFocusableElements();if(0===i.length)return;const a=i[0],s=i[i.length-1],r=null===(e=this.modalContent)||void 0===e?void 0:e.getRootNode(),n=null==r?void 0:r.activeElement;n===this.modalContent?t.shiftKey&&(t.preventDefault(),s.focus()):t.shiftKey&&n===a?(t.preventDefault(),s.focus()):(t.shiftKey||n!==s)&&n&&(null===(o=this.modalContent)||void 0===o?void 0:o.contains(n))||(t.preventDefault(),a.focus())}isFocusable(t){return!t.hidden&&0!==t.getClientRects().length&&"hidden"!==getComputedStyle(t).visibility}getFocusableElements(){return this.modalContent?Array.from(this.modalContent.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter((t=>this.isFocusable(t))):[]}focusModal(){requestAnimationFrame((()=>{this.modalContent&&this.modalContent.focus()}))}restoreFocus(){const t=this.previouslyFocused;this.previouslyFocused=null,t&&"function"==typeof t.focus&&t.isConnected&&t.focus()}initialRating(){return"thumbs"==this.ratingMode&&0==this.rating?5:this.rating?this.rating:-1}componentWillLoad(){this.fetchData&&this.fetchProjectData(),this.formEmail=this.emailAddress,this.selectedRating=this.initialRating(),this.embedded&&(this.showModal=!0)}emitFeedbackSent(t){this.feedbackEventsEnabled&&this.feedbackSent.emit({feedback:t})}emitFeedbackError(t){this.feedbackEventsEnabled&&this.feedbackError.emit({error:t})}async fetchProjectData(){try{const t=await fetch("https://app.pushfeedback.com/api/v1/projects/"+this.project+"/");if(!t.ok)return void(this.feedbackEventsEnabled=!1);const e=await t.json();this.whitelabel=e.whitelabel,this.recaptchaEnabled=e.recaptcha_enabled||!1,this.recaptchaSiteKey=e.recaptcha_site_key||null,this.feedbackEventsEnabled=Array.isArray(e.features)&&e.features.includes("feedback_events"),this.recaptchaEnabled&&this.recaptchaSiteKey&&this.loadRecaptchaScript()}catch(t){console.log(t)}}loadRecaptchaScript(){if(document.querySelector('script[src*="google.com/recaptcha"]'))return;const t=document.createElement("script");t.src=`https://www.google.com/recaptcha/api.js?render=${this.recaptchaSiteKey}`,t.async=!0,t.defer=!0,document.head.appendChild(t)}async getRecaptchaToken(){if(!this.recaptchaEnabled||!this.recaptchaSiteKey)return null;try{let t=0;for(;!window.grecaptcha&&t<50;)await new Promise((t=>setTimeout(t,100))),t++;return window.grecaptcha?await new Promise(((t,e)=>{window.grecaptcha.ready((async()=>{try{const e=await window.grecaptcha.execute(this.recaptchaSiteKey,{action:"submit_feedback"});t(e)}catch(t){console.error("reCAPTCHA execution error:",t),e(t)}}))})):(console.error("reCAPTCHA script not loaded"),null)}catch(t){return console.error("reCAPTCHA error:",t),null}}resetOverflow(){document.documentElement.classList.remove("feedback-modal-screenshot-open"),document.documentElement.classList.remove("feedback-modal-screenshot-open--scroll"),document.documentElement.classList.remove("feedback-modal-screenshot-closing")}handleMessageInput(t){this.formMessage=t.target.value}handleEmailInput(t){this.formEmail=t.target.value}popHistoryEntry(){this.historyEntryPushed&&(this.historyEntryPushed=!1,history.back())}handleCheckboxChange(t){this.isPrivacyChecked=t.target.checked}handleVerification(t){this.formVerification=t.target.value}handleRatingChange(t){this.selectedRating=t}render(){const t=this.embedded&&!this.showModal&&(this.positioningScreenshot||this.takingScreenshot||this.showCanvasEditor);return o("div",{class:`feedback-modal-wrapper ${this.customFont?"feedback-modal-wrapper--custom-font":""} ${this.embedded?"feedback-modal-wrapper--embedded":""}`,part:"wrapper"},this.positioningScreenshot&&!this.showModal&&o("div",{class:"screenshot-positioner",part:"screenshot-positioner",ref:t=>{this.positionerRef=t,null==t||t.setAttribute("popover","manual")},role:"dialog","aria-modal":"false","aria-labelledby":"screenshot-positioner-message"},o("div",{id:"screenshot-positioner-message",class:"screenshot-positioner-message",part:"screenshot-positioner-message"},o("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},o("path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}),o("path",{d:"M16 3h3a2 2 0 0 1 2 2v3"}),o("path",{d:"M8 21H5a2 2 0 0 1-2-2v-3"}),o("path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"})),o("span",null,this.screenshotPositioningText)),o("div",{class:"screenshot-positioner-actions"},o("button",{type:"button",class:"feedback-modal-button screenshot-positioner-cancel",part:"screenshot-positioner-cancel-button",onClick:this.cancelScreenshotPositioning},this.screenshotPositioningCancelText),o("button",{type:"button",class:"feedback-modal-button feedback-modal-button--submit screenshot-positioner-capture",part:"screenshot-positioner-capture-button",onClick:this.startScreenshotCapture,ref:t=>this.positionCaptureButtonRef=t},this.screenshotPositioningCaptureText))),this.showCanvasEditor&&o("canvas-editor",{ref:t=>this.canvasEditorRef=t,exportparts:"overlay: canvas-editor-overlay, modal: canvas-editor-modal, header: canvas-editor-header, title: canvas-editor-title, toolbar: canvas-editor-toolbar, tool-button: canvas-editor-tool-button, cancel-button: canvas-editor-cancel-button, save-button: canvas-editor-save-button, content: canvas-editor-content, canvas: canvas-editor-canvas","canvas-editor-title":this.screenshotEditorTitle,"canvas-editor-cancel-text":this.screenshotEditorCancelText,"canvas-editor-save-text":this.screenshotEditorSaveText,"screenshot-taking-text":this.screenshotTakingText,"screenshot-attached-text":this.screenshotAttachedText,"screenshot-button-text":this.screenshotButtonText,"escape-close":this.escapeClose?"true":"false","click-outside-close":this.clickOutsideClose?"true":"false","auto-start-screenshot":this.autoStartCapture,"existing-screenshot":this.encodedScreenshot||"","edit-text-button-text":this.screenshotEditTextButtonText,"size-label-text":this.screenshotSizeLabelText,"border-label-text":this.screenshotBorderLabelText,"edit-text-prompt-text":this.screenshotEditTextPromptText,"screenshot-error-general":this.screenshotErrorGeneral,"screenshot-error-permission":this.screenshotErrorPermission,"screenshot-error-not-supported":this.screenshotErrorNotSupported,"screenshot-error-not-found":this.screenshotErrorNotFound,"screenshot-error-cancelled":this.screenshotErrorCancelled,"screenshot-error-browser-not-supported":this.screenshotErrorBrowserNotSupported,"screenshot-error-unexpected":this.screenshotErrorUnexpected,onScreenshotReady:this.handleScreenshotReady,onScreenshotCancelled:this.handleScreenshotCancelled,onScreenshotFailed:this.handleScreenshotError}),this.showScreenshotError&&o("div",{class:"screenshot-error-notification"},o("div",{class:"screenshot-error-content"},o("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},o("circle",{cx:"12",cy:"12",r:"10"}),o("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),o("line",{x1:"9",y1:"9",x2:"15",y2:"15"})),o("span",null,this.screenshotError),o("button",{class:"error-close-btn",onClick:()=>this.showScreenshotError=!1,title:"Close"},o("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},o("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))))),this.showModal&&!this.embedded&&o("div",{class:"feedback-overlay "+(this.isAnimating?"feedback-overlay--visible":""),part:"overlay","aria-hidden":"true",onClick:this.clickOutsideClose?this.handleOverlayClick:void 0}),(this.showModal||t)&&o("div",{class:`feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.isAnimating?"feedback-modal-content--open":""} ${this.embedded?"feedback-modal-content--embedded":""} ${t?"feedback-modal-content--capture-placeholder":""}`,part:"modal",role:this.embedded?"region":"dialog","aria-modal":this.embedded?void 0:"true","aria-hidden":t?"true":void 0,"aria-labelledby":"feedback-modal-title",tabindex:"-1",ref:t=>this.modalContent=t},o("div",{class:"feedback-modal-header "+(this.formSuccess&&!this.successMessage||this.formError&&!this.errorMessage?"feedback-modal-header--no-content":""),part:"header"},o("div",{class:"feedback-modal-header-content"},this.formSuccess||this.formError?o("span",{id:"feedback-modal-title",class:"feedback-modal-title",part:"title"},this.formSuccess?this.modalTitleSuccess:this.modalTitleError):o("div",{class:"feedback-modal-header-text"},o("span",{id:"feedback-modal-title",class:"feedback-modal-title",part:"title"},this.modalTitle),!this.whitelabel&&o("span",{class:"feedback-modal-powered-by",part:"powered-by"},"Powered by"," ",o("a",{target:"_blank",href:"https://pushfeedback.com"},"PushFeedback")))),!this.embedded&&o("button",{class:"feedback-modal-close",part:"close-button",type:"button","aria-label":this.closeButtonLabel,onClick:this.close},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#191919","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},o("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),o("div",{class:"feedback-modal-body",part:"body"},this.formSuccess||this.formError?this.formSuccess&&!this.formError?o("div",{class:"feedback-modal-success"},o("p",{class:"feedback-modal-message",part:"success-message"},this.successMessage)):this.formError&&404==this.formErrorStatus?o("p",{class:"feedback-modal-message",part:"error-message"},this.errorMessage404):this.formError&&401==this.formErrorStatus?o("p",{class:"feedback-modal-message",part:"error-message"},this.errorMessage401):this.formError&&403==this.formErrorStatus?o("p",{class:"feedback-modal-message",part:"error-message"},this.errorMessage403):this.formError?o("p",{class:"feedback-modal-message",part:"error-message"},this.errorMessage):o("span",null):o("form",{part:"form",onSubmit:this.handleSubmit},!this.hideRating&&o("div",{class:"feedback-modal-rating",part:"rating"},"thumbs"===this.ratingMode?o("div",{class:"feedback-modal-rating-content"},o("span",{class:"feedback-modal-input-heading",part:"rating-title"},this.ratingPlaceholder),o("div",{class:"feedback-modal-rating-buttons feedback-modal-rating-buttons--thumbs",part:"rating-buttons"},o("button",{type:"button",title:this.ratingPositiveLabel,"aria-label":this.ratingPositiveLabel,"aria-pressed":1===this.selectedRating?"true":"false",class:"feedback-modal-rating-button feedback-modal-rating-button--positive "+(1===this.selectedRating?"feedback-modal-rating-button--selected":""),part:"rating-button rating-button-positive",onClick:t=>{t.preventDefault(),this.handleRatingChange(1)}},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#5F6368","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},o("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"}))),o("button",{type:"button",title:this.ratingNegativeLabel,"aria-label":this.ratingNegativeLabel,"aria-pressed":5===this.selectedRating?"true":"false",class:"feedback-modal-rating-button feedback-modal-rating-button--negative "+(5===this.selectedRating?"feedback-modal-rating-button--selected":""),part:"rating-button rating-button-negative",onClick:t=>{t.preventDefault(),this.handleRatingChange(5)}},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#5F6368","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},o("path",{d:"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"}))))):o("div",{class:"feedback-modal-rating-content"},o("span",{class:"feedback-modal-input-heading",part:"rating-title"},this.ratingStarsPlaceholder),o("div",{class:"feedback-modal-rating-buttons feedback-modal-rating-buttons--stars",part:"rating-buttons"},[1,2,3,4,5].map((t=>o("button",{key:t,type:"button","aria-label":this.ratingStarLabel.replace("{rating}",String(t)),"aria-pressed":this.selectedRating===t?"true":"false",class:"feedback-modal-rating-button "+(this.selectedRating>=t?"feedback-modal-rating-button--selected":""),part:"rating-button",onClick:e=>{e.preventDefault(),this.handleRatingChange(t)}},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#5F6368","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},o("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})))))))),o("div",{class:"feedback-modal-text"},o("textarea",{part:"message-input",placeholder:this.messagePlaceholder,value:this.formMessage,onInput:t=>this.handleMessageInput(t)})),!this.hideEmail&&o("div",{class:"feedback-modal-email"},o("input",{part:"email-input",placeholder:this.emailPlaceholder,type:"email",onInput:t=>this.handleEmailInput(t),value:this.formEmail,required:this.isEmailRequired})),o("div",{class:"feedback-verification"},o("input",{type:"text",name:"verification",style:{display:"none"},onInput:t=>this.handleVerification(t),value:this.formVerification})),!this.hidePrivacyPolicy&&o("div",{class:"feedback-modal-privacy",part:"privacy"},o("input",{type:"checkbox",id:"privacyPolicy",onChange:t=>this.handleCheckboxChange(t),required:!0}),o("span",{innerHTML:l(this.privacyPolicyText)})),o("div",{class:"feedback-modal-buttons "+(this.hideScreenshotButton?"single":""),part:"buttons"},!this.hideScreenshotButton&&o("button",{type:"button",class:"feedback-modal-button feedback-modal-button--screenshot "+(this.encodedScreenshot?"feedback-modal-button--active":""),part:"screenshot-button",onClick:this.openScreenShot,disabled:this.sending||this.takingScreenshot,ref:t=>this.screenshotButtonRef=t},this.encodedScreenshot&&o("div",{class:"screenshot-preview",onClick:this.openCanvasEditor},o("img",{src:this.encodedScreenshot,alt:"Screenshot Preview"})),!this.encodedScreenshot&&!this.takingScreenshot&&o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24"},o("path",{d:"M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-200v-200h80v120h120v80H200Zm0-360v-200h200v80H280v120h-80Zm480 0v-120H560v-80h200v200h-80Z"})),this.takingScreenshot&&o("div",{class:"screenshot-loading"},o("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather-loader"},o("line",{x1:"12",y1:"2",x2:"12",y2:"6"}),o("line",{x1:"12",y1:"18",x2:"12",y2:"22"}),o("line",{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"}),o("line",{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"}),o("line",{x1:"2",y1:"12",x2:"6",y2:"12"}),o("line",{x1:"18",y1:"12",x2:"22",y2:"12"}),o("line",{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"}),o("line",{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"}))),this.takingScreenshot?this.screenshotTakingText:this.encodedScreenshot?this.screenshotAttachedText:this.screenshotButtonText),o("button",{class:"feedback-modal-button feedback-modal-button--submit",part:"submit-button",type:"submit",disabled:this.sending},this.sendButtonText)))),!this.formSuccess&&!this.formError&&(this.recaptchaEnabled||this.footerText)&&o("div",{class:"feedback-modal-footer",part:"footer"},o("div",{class:"feedback-footer-combined"},this.recaptchaEnabled&&o("span",{innerHTML:l(this.recaptchaText)}),this.recaptchaEnabled&&this.footerText&&" ",this.footerText&&o("span",{innerHTML:l(this.footerText)})))))}componentDidRender(){var t;if((null===(t=this.positionerRef)||void 0===t?void 0:t.isConnected)&&this.positioningScreenshot&&!this.showModal){const t=this.positionerRef;t.showPopover&&!t.matches(":popover-open")&&t.showPopover()}this.shouldFocusPositionCapture&&this.positioningScreenshot&&!this.showModal&&(this.shouldFocusPositionCapture=!1,requestAnimationFrame((()=>{var t;return null===(t=this.positionCaptureButtonRef)||void 0===t?void 0:t.focus()}))),this.showModal&&requestAnimationFrame((()=>{this.overlayVisible=!0}))}async openModal(){if(!this.embedded){const t=document.activeElement;this.previouslyFocused=t&&t!==document.body?t:null}if(this.positioningScreenshot=!1,this.shouldFocusPositionCapture=!1,this.showModal=!0,this.focusModal(),this.historyClose&&!this.embedded&&!this.historyEntryPushed){const t=history.state&&"object"==typeof history.state?history.state:{},e=Array.isArray(t.pushfeedbackModalEntries)?t.pushfeedbackModalEntries:[];history.pushState(Object.assign(Object.assign({},t),{pushfeedbackModalEntries:[...e,this.historyEntryId]}),""),this.historyEntryPushed=!0}requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.isAnimating=!0}))}))}static get watchers(){return{showModal:["handleShowModalChange"]}}};b.style=".text-center{flex-grow:1;text-align:center}.feedback-modal-wrapper *{font-family:var(--feedback-font-family)}.feedback-modal-wrapper--custom-font *{font-family:inherit}.feedback-modal-wrapper{position:absolute;z-index:var(--feedback-modal-modal-wrapper-z-index)}.feedback-overlay{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;opacity:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index);transition:opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}.feedback-overlay--visible{opacity:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border:1px solid rgba(0, 0, 0, 0.08);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.02),\n 0px 2px 4px rgba(0, 0, 0, 0.04),\n 0px 8px 16px rgba(0, 0, 0, 0.06),\n 0px 16px 32px rgba(0, 0, 0, 0.04);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;left:50%;max-width:90%;padding:24px;position:fixed;top:50%;transform:translate(-50%, -50%) scale(0.96);opacity:0;width:100%;z-index:var(--feedback-modal-content-z-index);transition:transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1)}.feedback-modal-content--open{transform:translate(-50%, -50%) scale(1);opacity:1}.feedback-modal-content:focus{outline:none}.feedback-modal-header{color:var(--feedback-modal-header-text-color);display:flex;font-size:var(--feedback-modal-header-font-size);font-weight:var(--feedback-modal-header-font-weight);justify-content:space-between;align-items:flex-start;margin-bottom:24px;letter-spacing:-0.01em}.feedback-modal-header-content{flex:1}.feedback-modal-header-text{display:flex;flex-direction:column;gap:6px}.feedback-modal-title{display:block}.feedback-modal-powered-by{display:block;font-size:13px;font-weight:400;color:var(--feedback-color-gray-500);line-height:1.4}.feedback-modal-powered-by a{color:var(--feedback-modal-header-text-color);text-decoration:none;font-weight:500}.feedback-modal-powered-by a:hover{text-decoration:underline}.feedback-modal-header--no-content{margin-bottom:0}.feedback-modal-rating-buttons{width:100%;margin-bottom:24px;display:flex;gap:4px}.feedback-modal-rating-button{padding:0;background-color:transparent;border:transparent;margin-right:8px;cursor:pointer}.feedback-modal-rating-buttons--stars .feedback-modal-rating-button{transition:transform 0.15s ease, opacity 0.15s ease}.feedback-modal-rating-buttons--stars .feedback-modal-rating-button:hover{transform:scale(1.1)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button{border:1.5px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);font-size:var(--feedback-modal-button-font-size);font-weight:500;margin-right:12px;justify-content:center;padding:10px 16px;transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);box-shadow:0 1px 2px rgba(0, 0, 0, 0.04)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive{background-color:var(--feedback-modal-rating-button-positive-bg-color);border-color:var(--feedback-modal-rating-button-positive-border-color)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative{background-color:var(--feedback-modal-rating-button-negative-bg-color);border-color:var(--feedback-modal-rating-button-negative-border-color)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover{transform:translateY(-2px);box-shadow:0 4px 8px rgba(0, 0, 0, 0.12)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected{background-color:var(--feedback-modal-button-bg-color-active);border:1.5px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover svg,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected svg{stroke:var(--feedback-modal-rating-button-selected-color)}.feedback-modal-rating-buttons svg{stroke:var(--feedback-modal-rating-button-color);cursor:pointer}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive svg{stroke:var(--feedback-modal-rating-button-positive-color)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative svg{stroke:var(--feedback-modal-rating-button-negative-color)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive:hover,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive.feedback-modal-rating-button--selected{background-color:var(--feedback-modal-rating-button-positive-selected-bg-color);border-color:var(--feedback-modal-rating-button-positive-selected-border-color)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative:hover,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative.feedback-modal-rating-button--selected{background-color:var(--feedback-modal-rating-button-negative-selected-bg-color);border-color:var(--feedback-modal-rating-button-negative-selected-border-color)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive:hover svg,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive.feedback-modal-rating-button--selected svg{stroke:var(--feedback-modal-rating-button-positive-selected-color)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative:hover svg,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative.feedback-modal-rating-button--selected svg{stroke:var(--feedback-modal-rating-button-negative-selected-color)}.feedback-modal-rating-buttons--stars .feedback-modal-rating-button--selected svg{fill:var(--feedback-modal-rating-button-stars-selected-color);stroke:var(--feedback-modal-rating-button-stars-selected-color)}.feedback-modal-text textarea{background-color:var(--feedback-modal-input-bg-color);border:1.5px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:100px;min-height:100px;padding:12px;resize:vertical;width:100%;transition:border-color 0.2s ease, box-shadow 0.2s ease;line-height:1.5}.feedback-modal-text textarea:hover{border-color:var(--feedback-modal-input-border-color-hover)}.feedback-modal-email input{background-color:var(--feedback-modal-input-bg-color);border:1.5px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:44px;padding:12px;width:100%;transition:border-color 0.2s ease, box-shadow 0.2s ease}.feedback-modal-email input:hover{border-color:var(--feedback-modal-input-border-color-hover)}.feedback-modal-text textarea:-webkit-autofill,.feedback-modal-email input:-webkit-autofill,.feedback-modal-email input:-webkit-autofill:hover,.feedback-modal-email input:-webkit-autofill:focus,.feedback-modal-email input:-webkit-autofill:active{-webkit-box-shadow:0 0 0 1000px var(--feedback-modal-input-bg-color) inset !important;-webkit-text-fill-color:var(--feedback-modal-input-text-color) !important;transition:background-color 5000s ease-in-out 0s}.feedback-modal-privacy{font-size:var(--feedback-modal-input-font-size);margin-bottom:20px}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1.5px solid var(--feedback-modal-input-border-color-focused);outline:none;box-shadow:0 0 0 3px rgba(59, 130, 246, 0.1)}.feedback-modal-buttons{display:flex;flex-direction:column}.feedback-modal-buttons .feedback-modal-button{margin-bottom:20px}.feedback-modal-button{align-items:center;background-color:transparent;border:1.5px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;display:flex;font-size:var(--feedback-modal-button-font-size);font-weight:500;justify-content:center;min-height:44px;padding:10px 16px;transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);box-shadow:0 1px 2px rgba(0, 0, 0, 0.04)}.feedback-modal-button svg{margin-right:6px}.feedback-modal-button path{fill:var(--feedback-modal-button-icon-color)}.feedback-modal-button:hover path,.feedback-modal-button--active path{fill:var(--feedback-modal-button-icon-color-active)}.feedback-modal-button--submit{background-color:var(--feedback-modal-button-submit-bg-color);border:1.5px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-submit-text-color);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}.feedback-modal-button:hover,.feedback-modal-button--active{background-color:var(--feedback-modal-button-bg-color-active);border:1.5px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active);transform:translateY(-1px);box-shadow:0 4px 8px rgba(0, 0, 0, 0.12)}.feedback-modal-button--submit:hover{background-color:var(--feedback-modal-button-submit-bg-color-hover);border:1.5px solid var(--feedback-modal-button-submit-border-color-hover);color:var(--feedback-modal-button-submit-text-color-hover);transform:translateY(-1px);box-shadow:0 6px 12px rgba(0, 0, 0, 0.15)}.feedback-modal-button--submit:active{transform:translateY(0);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}.screenshot-positioner{align-items:center;background:var(--feedback-modal-content-bg-color);border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);box-sizing:border-box;color:var(--feedback-modal-header-text-color);display:flex;gap:20px;inset:auto;justify-content:space-between;left:50%;margin:0;max-width:calc(100vw - 32px);padding:12px;position:fixed;top:20px;transform:translateX(-50%);width:max-content;z-index:var(--feedback-modal-content-z-index)}.screenshot-positioner[popover]:not(:popover-open){display:none}.screenshot-positioner-message{align-items:center;display:flex;font-size:var(--feedback-modal-button-font-size);font-weight:500;gap:8px;line-height:1.4;padding-left:4px}.screenshot-positioner-message svg{color:var(--feedback-primary-color);flex:0 0 auto}.screenshot-positioner-actions{display:flex;gap:8px}.screenshot-positioner .feedback-modal-button{margin:0;min-height:38px;padding:8px 12px;white-space:nowrap}.feedback-modal-input-heading{display:block;font-size:14px;font-weight:500;padding-bottom:12px;color:var(--feedback-modal-header-text-color);letter-spacing:-0.01em}.feedback-modal-footer{font-size:12px;text-align:center}.feedback-modal-footer a{color:var(--feedback-modal-footer-link);font-weight:500;text-decoration:none}.feedback-logo,.feedback-footer-text{display:block;text-align:center;margin-top:5px}.feedback-footer-text{margin-top:10px;line-height:1.5}.feedback-footer-combined{display:block;text-align:center;font-size:11px;color:#666;line-height:1.5}.feedback-footer-combined a{color:#666;text-decoration:underline}.feedback-recaptcha-notice{display:block;text-align:center;margin-bottom:10px;font-size:11px;color:#666;line-height:1.4}.feedback-recaptcha-notice a{color:#666;text-decoration:underline}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:6px;cursor:pointer;height:32px;width:32px;margin-left:auto;padding:0;display:flex;align-items:center;justify-content:center;transition:all 0.2s ease}.feedback-modal-close:hover{background-color:rgba(0, 0, 0, 0.06);transform:scale(1.05)}.feedback-modal-close:active{transform:scale(0.95)}.feedback-modal-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index)}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-screenshot-header-text-color);cursor:pointer;display:flex;left:50%;top:20px;transform:translateX(-50%);padding:10px;position:fixed;width:max-content;z-index:var(--feedback-modal-screenshot-header-z-index)}.feedback-modal-screenshot-close{height:24px;padding-left:10px;width:24px}.feedback-modal-screenshot-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-message{font-size:var(--feedback-modal-message-font-size);margin:0;line-height:1.6;color:var(--feedback-modal-content-text-color)}.feedback-modal-element-hover{background-color:transparent;cursor:pointer;border:1px solid var(--feedback-modal-element-hover-border-color)}.feedback-modal-element-selected{background-color:transparent;border:3px solid var(--feedback-modal-element-selected-border-color) !important;box-shadow:0 0 0 2px rgba(0, 123, 255, 0.3) !important}.screenshot-preview{display:inline-block;width:32px;height:32px;overflow:hidden;border-radius:6px;margin-right:10px;box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);cursor:pointer;transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);border:2px solid rgba(255, 255, 255, 0.8)}.screenshot-preview:hover{transform:scale(1.15);box-shadow:0 4px 8px rgba(0, 0, 0, 0.15)}.screenshot-preview img{width:100%;height:100%;object-fit:cover}.screenshot-loading{display:inline-flex;align-items:center;margin-right:8px}@media screen and (min-width: 768px){.feedback-modal-content{max-width:var(--feedback-modal-content-max-width)}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);left:initial;right:var(--feedback-modal-content-position-right);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--center-left{left:5px;right:auto;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--center-right{left:auto;right:5px;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--sidebar-left.feedback-modal-content--open,.feedback-modal-content.feedback-modal-content--sidebar-right.feedback-modal-content--open{transform:translateX(0)}.feedback-modal-content.feedback-modal-content--sidebar-left{max-width:var(--feedback-modal-content-sidebar-max-width);left:0;right:auto;height:100vh;top:0;transform:translateX(-100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-content.feedback-modal-content--sidebar-right{max-width:var(--feedback-modal-content-sidebar-max-width);left:auto;right:0;height:100vh;top:0;transform:translateX(100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-text textarea{height:150px;min-height:150px}.feedback-modal-content.feedback-modal-content--bottom-right{transform:translateY(20px)}.feedback-modal-content.feedback-modal-content--bottom-right.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--bottom-left{transform:translateY(20px)}.feedback-modal-content.feedback-modal-content--bottom-left.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--top-right{transform:translateY(-20px)}.feedback-modal-content.feedback-modal-content--top-right.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--top-left{transform:translateY(-20px)}.feedback-modal-content.feedback-modal-content--top-left.feedback-modal-content--open{transform:translateY(0)}}@keyframes feather-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.feather-loader{animation:feather-spin 1s linear infinite;display:block}.screenshot-error-notification{position:fixed;top:20px;left:50%;transform:translateX(-50%);z-index:10001;max-width:500px;width:90%;animation:slideDown 0.3s ease-out}@keyframes slideDown{from{opacity:0;transform:translateX(-50%) translateY(-20px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}.screenshot-error-content{background:#fee;border:1.5px solid #fcc;border-radius:10px;padding:14px 18px;display:flex;align-items:center;gap:12px;box-shadow:0 0 0 1px rgba(197, 48, 48, 0.05),\n 0 4px 6px rgba(0, 0, 0, 0.07),\n 0 10px 20px rgba(0, 0, 0, 0.1);color:#c53030}.screenshot-error-content svg:first-child{color:#e53e3e;flex-shrink:0}.screenshot-error-content span{flex:1;font-size:14px;line-height:1.4;font-weight:500}.error-close-btn{background:none;border:none;cursor:pointer;padding:6px;border-radius:6px;color:#c53030;flex-shrink:0;transition:all 0.2s ease;display:flex;align-items:center;justify-content:center}.error-close-btn:hover{background:rgba(197, 48, 48, 0.15);transform:scale(1.1)}.error-close-btn:active{transform:scale(0.95)}@media screen and (max-width: 768px){.feedback-modal-content{width:100vw;height:100dvh;max-width:none;border-radius:0;top:0;left:0;transform:scale(0.95);padding:24px 20px;display:flex;flex-direction:column}.feedback-modal-content--open{transform:scale(1)}.feedback-modal-buttons{display:flex;flex-direction:column;gap:12px}.feedback-modal-button--screenshot{display:none !important}.feedback-modal-button--submit{width:100%}.feedback-modal-text textarea{flex:1;min-height:120px;resize:none}}.feedback-modal-wrapper--embedded{position:relative;z-index:auto;display:block;width:100%}.feedback-modal-content--embedded{position:relative !important;left:auto !important;right:auto !important;top:auto !important;bottom:auto !important;transform:none !important;opacity:1 !important;max-width:100%;margin:0 auto;box-shadow:0 2px 8px rgba(0, 0, 0, 0.1);text-align:left}.feedback-modal-content--embedded.feedback-modal-content--open{transform:none !important}.feedback-modal-content--embedded.feedback-modal-content--capture-placeholder{pointer-events:none;visibility:hidden}@media screen and (max-width: 768px){.feedback-modal-content--embedded{width:100%;height:auto;border-radius:var(--feedback-modal-content-border-radius);padding:24px}.feedback-modal-content--embedded .feedback-modal-button--screenshot{display:flex !important}.screenshot-positioner{align-items:stretch;flex-direction:column;gap:10px;top:12px;width:calc(100vw - 24px)}.screenshot-positioner-actions .feedback-modal-button{flex:1}}";export{s as canvas_editor,r as feedback_button,b as feedback_modal} \ No newline at end of file diff --git a/static/js/pushfeedback/p-ed68abdd.js b/static/js/pushfeedback/p-ed68abdd.js new file mode 100644 index 0000000000..c2318d8d0f --- /dev/null +++ b/static/js/pushfeedback/p-ed68abdd.js @@ -0,0 +1,2 @@ +let e,n,t=!1,l=!1;const s={},o=e=>"object"==(e=typeof e)||"function"===e;function i(e){var n,t,l;return null!==(l=null===(t=null===(n=e.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===t?void 0:t.getAttribute("content"))&&void 0!==l?l:void 0}const c=(e,n,...t)=>{let l=null,s=null,i=!1,c=!1;const u=[],a=n=>{for(let t=0;te[n])).join(" "))}}const f=r(e,null);return f.l=n,u.length>0&&(f.o=u),f.i=s,f},r=(e,n)=>({u:0,h:e,t:n,p:null,o:null,l:null,i:null}),u={},a=e=>U(e).m,f=(e,n,t)=>{const l=a(e);return{emit:e=>d(l,n,{bubbles:!!(4&t),composed:!!(2&t),cancelable:!!(1&t),detail:e})}},d=(e,n,t)=>{const l=Q.ce(n,t);return e.dispatchEvent(l),l},h=new WeakMap,p=e=>"sc-"+e.$,m=(e,n,t,l,s,i)=>{if(t!==l){let c=_(e,n),r=n.toLowerCase();if("class"===n){const n=e.classList,s=$(t),o=$(l);n.remove(...s.filter((e=>e&&!o.includes(e)))),n.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===n){for(const n in t)l&&null!=l[n]||(n.includes("-")?e.style.removeProperty(n):e.style[n]="");for(const n in l)t&&l[n]===t[n]||(n.includes("-")?e.style.setProperty(n,l[n]):e.style[n]=l[n])}else if("key"===n);else if("ref"===n)l&&l(e);else if(c||"o"!==n[0]||"n"!==n[1]){const r=o(l);if((c||r&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[n]=l;else{const s=null==l?"":l;"list"===n?c=!1:null!=t&&e[n]==s||(e[n]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(n)||e.removeAttribute(n):(!c||4&i||s)&&!r&&e.setAttribute(n,l=!0===l?"":l)}else n="-"===n[2]?n.slice(3):_(J,r)?r.slice(2):r[2]+n.slice(3),t&&Q.rel(e,n,t,!1),l&&Q.ael(e,n,l,!1)}},y=/\s/,$=e=>e?e.split(y):[],b=(e,n,t,l)=>{const o=11===n.p.nodeType&&n.p.host?n.p.host:n.p,i=e&&e.l||s,c=n.l||s;for(l in i)l in c||m(o,l,i[l],void 0,t,n.u);for(l in c)m(o,l,i[l],c[l],t,n.u)},w=(n,l,s)=>{const o=l.o[s];let i,c,r=0;if(null!==o.t)i=o.p=K.createTextNode(o.t);else{if(t||(t="svg"===o.h),i=o.p=K.createElementNS(t?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.h),t&&"foreignObject"===o.h&&(t=!1),b(null,o,t),null!=e&&i["s-si"]!==e&&i.classList.add(i["s-si"]=e),o.o)for(r=0;r{let c,r=e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);o<=i;++o)s[o]&&(c=w(null,l,o),c&&(s[o].p=c,r.insertBefore(c,t)))},g=(e,n,t,l,s)=>{for(;n<=t;++n)(l=e[n])&&(s=l.p,k(l),s.remove())},j=(e,n)=>e.h===n.h&&e.i===n.i,S=(e,n)=>{const l=n.p=e.p,s=e.o,o=n.o,i=n.h,c=n.t;null===c?(t="svg"===i||"foreignObject"!==i&&t,"slot"===i||b(e,n,t),null!==s&&null!==o?((e,n,t,l)=>{let s,o,i=0,c=0,r=0,u=0,a=n.length-1,f=n[0],d=n[a],h=l.length-1,p=l[0],m=l[h];for(;i<=a&&c<=h;)if(null==f)f=n[++i];else if(null==d)d=n[--a];else if(null==p)p=l[++c];else if(null==m)m=l[--h];else if(j(f,p))S(f,p),f=n[++i],p=l[++c];else if(j(d,m))S(d,m),d=n[--a],m=l[--h];else if(j(f,m))S(f,m),e.insertBefore(f.p,d.p.nextSibling),f=n[++i],m=l[--h];else if(j(d,p))S(d,p),e.insertBefore(d.p,f.p),d=n[--a],p=l[++c];else{for(r=-1,u=i;u<=a;++u)if(n[u]&&null!==n[u].i&&n[u].i===p.i){r=u;break}r>=0?(o=n[r],o.h!==p.h?s=w(n&&n[c],t,r):(S(o,p),n[r]=void 0,s=o.p),p=l[++c]):(s=w(n&&n[c],t,c),p=l[++c]),s&&f.p.parentNode.insertBefore(s,f.p)}i>a?v(e,null==l[h+1]?null:l[h+1].p,t,l,c,h):c>h&&g(n,i,a)})(l,s,n,o):null!==o?(null!==e.t&&(l.textContent=""),v(l,null,n,o,0,o.length-1)):null!==s&&g(s,0,s.length-1),t&&"svg"===i&&(t=!1)):e.t!==c&&(l.data=c)},k=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(k)},O=(e,n)=>{n&&!e.v&&n["s-p"]&&n["s-p"].push(new Promise((n=>e.v=n)))},C=(e,n)=>{if(e.u|=16,!(4&e.u))return O(e,e.g),oe((()=>M(e,n)));e.u|=512},M=(e,n)=>{const t=e.j;let l;return n&&(l=N(t,"componentWillLoad")),R(l,(()=>P(e,t,n)))},P=async(e,n,t)=>{const l=e.m,s=l["s-rc"];t&&(e=>{const n=e.S,t=e.m,l=n.u,s=((e,n)=>{var t;let l=p(n);const s=I.get(l);if(e=11===e.nodeType?e:K,s)if("string"==typeof s){let n,o=h.get(e=e.head||e);if(o||h.set(e,o=new Set),!o.has(l)){{n=K.createElement("style"),n.innerHTML=s;const l=null!==(t=Q.k)&&void 0!==t?t:i(K);null!=l&&n.setAttribute("nonce",l),e.insertBefore(n,e.querySelector("link"))}o&&o.add(l)}}else e.adoptedStyleSheets.includes(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]);return l})(t.shadowRoot?t.shadowRoot:t.getRootNode(),n);10&l&&(t["s-sc"]=s,t.classList.add(s+"-h"))})(e);x(e,n),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const n=l["s-p"],t=()=>L(e);0===n.length?t():(Promise.all(n).then(t),e.u|=4,n.length=0)}},x=(t,l)=>{try{l=l.render(),t.u&=-17,t.u|=2,((t,l)=>{const s=t.m,o=t.S,i=t.O||r(null,null),a=(e=>e&&e.h===u)(l)?l:c(null,null,l);n=s.tagName,o.C&&(a.l=a.l||{},o.C.map((([e,n])=>a.l[n]=s[e]))),a.h=null,a.u|=4,t.O=a,a.p=i.p=s.shadowRoot||s,e=s["s-sc"],S(i,a)})(t,l)}catch(e){z(e,t.m)}return null},L=e=>{const n=e.m,t=e.j,l=e.g;N(t,"componentDidRender"),64&e.u||(e.u|=64,T(n),N(t,"componentDidLoad"),e.M(n),l||E()),e.P(n),e.v&&(e.v(),e.v=void 0),512&e.u&&se((()=>C(e,!1))),e.u&=-517},E=()=>{T(K.documentElement),se((()=>d(J,"appload",{detail:{namespace:"pushfeedback"}})))},N=(e,n,t)=>{if(e&&e[n])try{return e[n](t)}catch(e){z(e)}},R=(e,n)=>e&&e.then?e.then(n):n(),T=e=>e.classList.add("hydrated"),W=(e,n,t)=>{if(n.L){e.watchers&&(n.N=e.watchers);const l=Object.entries(n.L),s=e.prototype;if(l.map((([e,[l]])=>{31&l||2&t&&32&l?Object.defineProperty(s,e,{get(){return((e,n)=>U(this).R.get(n))(0,e)},set(t){((e,n,t,l)=>{const s=U(e),i=s.m,c=s.R.get(n),r=s.u,u=s.j;if(t=((e,n)=>null==e||o(e)?e:4&n?"false"!==e&&(""===e||!!e):2&n?parseFloat(e):1&n?e+"":e)(t,l.L[n][0]),(!(8&r)||void 0===c)&&t!==c&&(!Number.isNaN(c)||!Number.isNaN(t))&&(s.R.set(n,t),u)){if(l.N&&128&r){const e=l.N[n];e&&e.map((e=>{try{u[e](t,c,n)}catch(e){z(e,i)}}))}2==(18&r)&&C(s,!1)}})(this,e,t,n)},configurable:!0,enumerable:!0}):1&t&&64&l&&Object.defineProperty(s,e,{value(...n){const t=U(this);return t.T.then((()=>t.j[e](...n)))}})})),1&t){const t=new Map;s.attributeChangedCallback=function(e,n,l){Q.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,n])=>15&n[0])).map((([e,l])=>{const s=l[1]||e;return t.set(s,e),512&l[0]&&n.C.push([e,s]),s}))}}return e},A=e=>{N(e,"connectedCallback")},D=(e,n={})=>{var t;const l=[],s=n.exclude||[],o=J.customElements,c=K.head,r=c.querySelector("meta[charset]"),u=K.createElement("style"),a=[];let f,d=!0;Object.assign(Q,n),Q.W=new URL(n.resourcesUrl||"./",K.baseURI).href,e.map((e=>{e[1].map((n=>{const t={u:n[0],$:n[1],L:n[2],A:n[3]};t.L=n[2],t.C=[],t.N={};const i=t.$,c=class extends HTMLElement{constructor(e){super(e),V(e=this,t),1&t.u&&e.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),d?a.push(this):Q.jmp((()=>(e=>{if(0==(1&Q.u)){const n=U(e),t=n.S,l=()=>{};if(1&n.u)A(n.j);else{n.u|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){O(n,n.g=t);break}}t.L&&Object.entries(t.L).map((([n,[t]])=>{if(31&t&&e.hasOwnProperty(n)){const t=e[n];delete e[n],e[n]=t}})),(async(e,n,t,l,s)=>{if(0==(32&n.u)){{if(n.u|=32,(s=G(t)).then){const e=()=>{};s=await s,e()}s.isProxied||(t.N=s.watchers,W(s,t,2),s.isProxied=!0);const e=()=>{};n.u|=8;try{new s(n)}catch(e){z(e)}n.u&=-9,n.u|=128,e(),A(n.j)}if(s.style){let e=s.style;const n=p(t);if(!I.has(n)){const l=()=>{};((e,n,t)=>{let l=I.get(e);Y&&t?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,I.set(e,l)})(n,e,!!(1&t.u)),l()}}}const o=n.g,i=()=>C(n,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,n,t)}l()}})(this)))}disconnectedCallback(){Q.jmp((()=>(()=>{0==(1&Q.u)&&N(U(this).j,"disconnectedCallback")})()))}componentOnReady(){return U(this).D}};t.F=e[0],s.includes(i)||o.get(i)||(l.push(i),o.define(i,W(c,t,1)))}))}));{u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const e=null!==(t=Q.k)&&void 0!==t?t:i(K);null!=e&&u.setAttribute("nonce",e),c.insertBefore(u,r?r.nextSibling:c.firstChild)}d=!1,a.length?a.map((e=>e.connectedCallback())):Q.jmp((()=>f=setTimeout(E,30)))},F=e=>Q.k=e,H=new WeakMap,U=e=>H.get(e),q=(e,n)=>H.set(n.j=e,n),V=(e,n)=>{const t={u:0,m:e,S:n,R:new Map};return t.T=new Promise((e=>t.P=e)),t.D=new Promise((e=>t.M=e)),e["s-p"]=[],e["s-rc"]=[],H.set(e,t)},_=(e,n)=>n in e,z=(e,n)=>(0,console.error)(e,n),B=new Map,G=e=>{const n=e.$.replace(/-/g,"_"),t=e.F,l=B.get(t);return l?l[n]:import(`./${t}.entry.js`).then((e=>(B.set(t,e),e[n])),z) +/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},I=new Map,J="undefined"!=typeof window?window:{},K=J.document||{head:{}},Q={u:0,W:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,n,t,l)=>e.addEventListener(n,t,l),rel:(e,n,t,l)=>e.removeEventListener(n,t,l),ce:(e,n)=>new CustomEvent(e,n)},X=e=>Promise.resolve(e),Y=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),Z=[],ee=[],ne=(e,n)=>t=>{e.push(t),l||(l=!0,n&&4&Q.u?se(le):Q.raf(le))},te=e=>{for(let n=0;n{te(Z),te(ee),(l=Z.length>0)&&Q.raf(le)},se=e=>X().then(e),oe=ne(ee,!0);export{u as H,D as b,f as c,a as g,c as h,X as p,q as r,F as s} \ No newline at end of file diff --git a/static/js/pushfeedback/pushfeedback.css b/static/js/pushfeedback/pushfeedback.css new file mode 100644 index 0000000000..fa0b7b252d --- /dev/null +++ b/static/js/pushfeedback/pushfeedback.css @@ -0,0 +1 @@ +:root{--feedback-color-white:#ffffff;--feedback-color-black:#191919;--feedback-color-gray-100:#f1f3f4;--feedback-color-gray-300:#d1d5db;--feedback-color-gray-400:#9ca3af;--feedback-color-gray-500:#999999;--feedback-color-gray-600:#5f6368;--feedback-color-gray-700:#363636;--feedback-color-gray-800:#2a2a2a;--feedback-color-blue-500:#3b82f6;--feedback-color-blue-600:#0070F4;--feedback-color-orange:#ffb422;--feedback-color-light:#ccc;--feedback-primary-color:var(--feedback-color-blue-600);--feedback-secondary-color:var(--feedback-color-gray-100);--feedback-light-color:var(--feedback-color-light);--feedback-dark-color:var(--feedback-color-black);--feedback-text-color:var(--feedback-color-gray-600);--feedback-white-color:var(--feedback-color-white);--feedback-highlight-color:var(--feedback-color-orange);--feedback-font-family:"Inter", "Tahoma", "sans-serif";--feedback-heading-font-size:20px;--feedback-text-font-size:14px;--feedback-button-border-radius:20px;--feedback-button-dark-bg-color:var(--feedback-primary-color);--feedback-button-dark-text-color:var(--feedback-white-color);--feedback-button-dark-icon-color:var(--feedback-white-color);--feedback-button-light-bg-color:var(--feedback-white-color);--feedback-button-light-text-color:var(--feedback-primary-color);--feedback-button-light-icon-color:var(--feedback-primary-color);--feedback-button-letter-spacing:0.02em;--feedback-button-text-font-size:var(--feedback-text-font-size);--feedback-button-text-font-weight:600;--feedback-button-z-index:300;--feedback-thumbs-border-color:#cbd5e1;--feedback-thumbs-bg-color:var(--feedback-white-color);--feedback-thumbs-icon-color:var(--feedback-color-gray-600);--feedback-modal-button-bg-color:var(--feedback-white-color);--feedback-modal-button-bg-color-active:var(--feedback-white-color);--feedback-modal-button-border-color:var(--feedback-light-color);--feedback-modal-button-border-color-active:var(--feedback-primary-color);--feedback-modal-button-border-radius:4px;--feedback-modal-button-font-size:var(--feedback-text-font-size);--feedback-modal-button-icon-color:var(--feedback-dark-color);--feedback-modal-button-icon-color-active:var(--feedback-primary-color);--feedback-modal-button-submit-bg-color:var(--feedback-primary-color);--feedback-modal-button-submit-bg-color-hover:var(--feedback-primary-color);--feedback-modal-button-submit-border-color-hover:var(--feedback-primary-color);--feedback-modal-button-submit-text-color:var(--feedback-white-color);--feedback-modal-button-submit-text-color-hover:var(--feedback-white-color);--feedback-modal-button-text-color:var(--feedback-dark-color);--feedback-modal-button-text-color-active:var(--feedback-primary-color);--feedback-modal-close-bg-color:var(--feedback-white-color);--feedback-modal-close-color:var(--feedback-dark-color);--feedback-modal-content-bg-color:var(--feedback-white-color);--feedback-modal-content-border-color:var(--feedback-light-color);--feedback-modal-content-border-radius:8px;--feedback-modal-content-font-family:var(--feedback-font-family);--feedback-modal-content-position-bottom:10px;--feedback-modal-content-position-left:10px;--feedback-modal-content-position-right:10px;--feedback-modal-content-position-top:10px;--feedback-modal-content-max-width:600px;--feedback-modal-content-sidebar-max-width:300px;--feedback-modal-content-text-color:var(--feedback-text-color);--feedback-modal-content-z-index:300;--feedback-modal-element-hover-border-color:var(--feedback-primary-color);--feedback-modal-element-selected-border-color:var(--feedback-primary-color);--feedback-modal-footer-link:var(--feedback-dark-color);--feedback-modal-header-font-family:var(--feedback-font-family);--feedback-modal-header-font-size:var(--feedback-heading-font-size);--feedback-modal-header-font-weight:500;--feedback-modal-header-text-color:var(--feedback-dark-color);--feedback-modal-input-bg-color:var(--feedback-color-white);--feedback-modal-input-border-color:rgba(0, 0, 0, 0.12);--feedback-modal-input-border-color-hover:rgba(0, 0, 0, 0.24);--feedback-modal-input-border-color-focused:var(--feedback-primary-color);--feedback-modal-input-border-radius:4px;--feedback-modal-input-font-size:var(--feedback-text-font-size);--feedback-modal-input-text-color:var(--feedback-text-color);--feedback-modal-message-font-size:var(--feedback-text-font-size);--feedback-modal-modal-wrapper-z-index:300;--feedback-modal-rating-button-color:var(--feedback-text-color);--feedback-modal-rating-button-selected-color:var(--feedback-primary-color);--feedback-modal-rating-button-positive-color:var(--feedback-modal-rating-button-color);--feedback-modal-rating-button-positive-bg-color:transparent;--feedback-modal-rating-button-positive-border-color:var(--feedback-modal-button-border-color);--feedback-modal-rating-button-positive-selected-color:var(--feedback-modal-rating-button-selected-color);--feedback-modal-rating-button-positive-selected-bg-color:var(--feedback-modal-button-bg-color-active);--feedback-modal-rating-button-positive-selected-border-color:var(--feedback-modal-button-border-color-active);--feedback-modal-rating-button-negative-color:var(--feedback-modal-rating-button-color);--feedback-modal-rating-button-negative-bg-color:transparent;--feedback-modal-rating-button-negative-border-color:var(--feedback-modal-button-border-color);--feedback-modal-rating-button-negative-selected-color:var(--feedback-modal-rating-button-selected-color);--feedback-modal-rating-button-negative-selected-bg-color:var(--feedback-modal-button-bg-color-active);--feedback-modal-rating-button-negative-selected-border-color:var(--feedback-modal-button-border-color-active);--feedback-modal-rating-button-stars-selected-color:var(--feedback-highlight-color);--feedback-modal-screenshot-bg-color:rgba(0, 0, 0, 0.4);--feedback-modal-screenshot-close-color:var(--feedback-dark-color);--feedback-modal-screenshot-header-bg-color:var(--feedback-white-color);--feedback-modal-screenshot-header-text-color:var(--feedback-dark-color);--feedback-modal-screenshot-header-z-index:250;--feedback-modal-screnshot-z-index:100;--feedback-canvas-editor-bg-color:var(--feedback-white-color);--feedback-canvas-editor-border-color:var(--feedback-light-color);--feedback-canvas-editor-header-bg-color:var(--feedback-secondary-color);--feedback-canvas-editor-tool-bg-color:var(--feedback-white-color);--feedback-canvas-editor-tool-bg-hover:var(--feedback-secondary-color);--feedback-canvas-editor-tool-bg-active:var(--feedback-primary-color);--feedback-canvas-editor-tool-text-color:var(--feedback-text-color);--feedback-canvas-editor-tool-text-active:var(--feedback-white-color);--feedback-canvas-editor-action-primary-bg:var(--feedback-primary-color);--feedback-canvas-editor-action-primary-text:var(--feedback-white-color);--feedback-canvas-editor-action-secondary-bg:var(--feedback-white-color);--feedback-canvas-editor-action-secondary-text:var(--feedback-text-color);--feedback-canvas-editor-action-secondary-border:var(--feedback-light-color);--feedback-canvas-editor-divider-color:var(--feedback-light-color);--feedback-canvas-editor-content-bg:var(--feedback-secondary-color);--feedback-canvas-editor-resize-handle-color:var(--feedback-primary-color);--feedback-canvas-editor-slider-track:var(--feedback-light-color)}[data-theme='dark']{--feedback-text-color:var(--feedback-color-gray-400);--feedback-thumbs-border-color:var(--feedback-color-gray-600);--feedback-thumbs-bg-color:var(--feedback-color-gray-800);--feedback-thumbs-icon-color:var(--feedback-color-gray-300);--feedback-light-color:var(--feedback-color-gray-700);--feedback-modal-button-bg-color-active:transparent;--feedback-modal-button-icon-color:var(--feedback-color-gray-300);--feedback-modal-button-text-color:var(--feedback-color-gray-300);--feedback-modal-close-bg-color:transparent;--feedback-modal-close-color:var(--feedback-color-gray-300);--feedback-modal-content-bg-color:var(--feedback-dark-color);--feedback-modal-content-text-color:var(--feedback-color-gray-400);--feedback-modal-footer-link:var(--feedback-color-gray-400);--feedback-modal-header-text-color:var(--feedback-white-color);--feedback-modal-input-bg-color:var(--feedback-color-gray-800);--feedback-modal-input-border-color:rgba(255, 255, 255, 0.1);--feedback-modal-input-border-color-hover:rgba(255, 255, 255, 0.2);--feedback-modal-input-border-color-focused:var(--feedback-primary-color);--feedback-modal-input-text-color:var(--feedback-color-gray-300);--feedback-modal-rating-button-color:var(--feedback-color-gray-300);--feedback-modal-screenshot-close-color:var(--feedback-white-color);--feedback-modal-screenshot-header-bg-color:var(--feedback-dark-color);--feedback-modal-screenshot-header-text-color:var(--feedback-white-color);--feedback-canvas-editor-bg-color:var(--feedback-dark-color);--feedback-canvas-editor-border-color:var(--feedback-light-color);--feedback-canvas-editor-header-bg-color:var(--feedback-light-color);--feedback-canvas-editor-tool-bg-color:var(--feedback-light-color);--feedback-canvas-editor-tool-bg-hover:#4a4a4a;--feedback-canvas-editor-tool-text-color:var(--feedback-white-color);--feedback-canvas-editor-action-secondary-bg:var(--feedback-light-color);--feedback-canvas-editor-action-secondary-text:var(--feedback-white-color);--feedback-canvas-editor-action-secondary-border:var(--feedback-light-color);--feedback-canvas-editor-content-bg:var(--feedback-light-color);--feedback-canvas-editor-divider-color:#4a4a4a;--feedback-canvas-editor-slider-track:#4a4a4a}.grecaptcha-badge{visibility:hidden !important}.pushfeedback-thumbs-row{display:flex;align-items:center;gap:12px}.pushfeedback-thumbs-row feedback-button{display:inline-flex}.pushfeedback-thumbs-row>button,.pushfeedback-thumbs-row feedback-button::part(button){display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:48px;height:48px;max-width:none;padding:0;cursor:pointer;border:1px solid var(--feedback-thumbs-border-color);border-radius:8px;background:var(--feedback-thumbs-bg-color);color:var(--feedback-thumbs-icon-color)}.pushfeedback-thumbs-row feedback-button>button{display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%;padding:0;border:0;background:transparent;color:inherit}.pushfeedback-thumbs-row svg{display:block;flex:none}.pushfeedback-thumbs-row .pushfeedback-thumb-label{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.feedback-modal-screenshot-open{position:fixed;width:100%}.feedback-modal-screenshot-open--scroll{overflow-y:scroll} \ No newline at end of file diff --git a/static/js/pushfeedback/pushfeedback.esm.js b/static/js/pushfeedback/pushfeedback.esm.js new file mode 100644 index 0000000000..78b207d583 --- /dev/null +++ b/static/js/pushfeedback/pushfeedback.esm.js @@ -0,0 +1 @@ +import{p as e,b as t}from"./p-ed68abdd.js";export{s as setNonce}from"./p-ed68abdd.js";(()=>{const t=import.meta.url,r={};return""!==t&&(r.resourcesUrl=new URL(".",t).href),e(r)})().then((e=>t([["p-a94be4c1",[[1,"feedback-button",{buttonPosition:[1,"button-position"],buttonStyle:[1,"button-style"],hideIcon:[4,"hide-icon"],hideMobile:[4,"hide-mobile"],sessionId:[1537,"session-id"],metadata:[1],submit:[4],apiKey:[1,"api-key"],clickOutsideClose:[4,"click-outside-close"],customFont:[4,"custom-font"],emailAddress:[1,"email-address"],historyClose:[4,"history-close"],isEmailRequired:[4,"is-email-required"],fetchData:[4,"fetch-data"],hideEmail:[4,"hide-email"],hidePrivacyPolicy:[4,"hide-privacy-policy"],hideRating:[4,"hide-rating"],hideScreenshotButton:[4,"hide-screenshot-button"],screenshotPositioning:[4,"screenshot-positioning"],modalPosition:[1,"modal-position"],project:[1],rating:[2],ratingMode:[1,"rating-mode"],emailPlaceholder:[1,"email-placeholder"],errorMessage:[1,"error-message"],errorMessage401:[1,"error-message-4-0-1"],errorMessage403:[1,"error-message-4-0-3"],errorMessage404:[1,"error-message-4-0-4"],footerText:[1,"footer-text"],messagePlaceholder:[1,"message-placeholder"],modalTitle:[1,"modal-title"],modalTitleError:[1,"modal-title-error"],modalTitleSuccess:[1,"modal-title-success"],privacyPolicyText:[1,"privacy-policy-text"],ratingPlaceholder:[1,"rating-placeholder"],ratingStarsPlaceholder:[1,"rating-stars-placeholder"],sendButtonText:[1,"send-button-text"],successMessage:[1,"success-message"],recaptchaText:[1,"recaptcha-text"],screenshotAttachedText:[1,"screenshot-attached-text"],screenshotButtonText:[1,"screenshot-button-text"],screenshotTakingText:[1,"screenshot-taking-text"],screenshotPositioningText:[1,"screenshot-positioning-text"],screenshotPositioningCaptureText:[1,"screenshot-positioning-capture-text"],screenshotPositioningCancelText:[1,"screenshot-positioning-cancel-text"],screenshotEditTextButtonText:[1,"screenshot-edit-text-button-text"],screenshotEditorTitle:[1,"screenshot-editor-title"],screenshotEditorCancelText:[1,"screenshot-editor-cancel-text"],screenshotEditorSaveText:[1,"screenshot-editor-save-text"],screenshotSizeLabelText:[1,"screenshot-size-label-text"],screenshotBorderLabelText:[1,"screenshot-border-label-text"],screenshotEditTextPromptText:[1,"screenshot-edit-text-prompt-text"],screenshotErrorGeneral:[1,"screenshot-error-general"],screenshotErrorPermission:[1,"screenshot-error-permission"],screenshotErrorNotSupported:[1,"screenshot-error-not-supported"],screenshotErrorNotFound:[1,"screenshot-error-not-found"],screenshotErrorCancelled:[1,"screenshot-error-cancelled"],screenshotErrorBrowserNotSupported:[1,"screenshot-error-browser-not-supported"],screenshotErrorUnexpected:[1,"screenshot-error-unexpected"]}],[1,"feedback-modal",{apiKey:[1,"api-key"],customFont:[4,"custom-font"],emailAddress:[1,"email-address"],hideEmail:[4,"hide-email"],isEmailRequired:[4,"is-email-required"],ratingMode:[1,"rating-mode"],hasSelectedElement:[1540,"has-selected-element"],hidePrivacyPolicy:[4,"hide-privacy-policy"],hideRating:[4,"hide-rating"],hideScreenshotButton:[4,"hide-screenshot-button"],screenshotPositioning:[4,"screenshot-positioning"],project:[1],showScreenshotMode:[1540,"show-screenshot-mode"],showScreenshotTopBar:[1540,"show-screenshot-top-bar"],showModal:[1540,"show-modal"],rating:[2],metadata:[1],fetchData:[4,"fetch-data"],embedded:[4],clickOutsideClose:[4,"click-outside-close"],historyClose:[4,"history-close"],escapeClose:[4,"escape-close"],emailPlaceholder:[1,"email-placeholder"],errorMessage:[1,"error-message"],errorMessage401:[1,"error-message-4-0-1"],errorMessage403:[1,"error-message-4-0-3"],errorMessage404:[1,"error-message-4-0-4"],messagePlaceholder:[1,"message-placeholder"],footerText:[1,"footer-text"],modalPosition:[1,"modal-position"],modalTitle:[1,"modal-title"],modalTitleError:[1,"modal-title-error"],modalTitleSuccess:[1,"modal-title-success"],privacyPolicyText:[1,"privacy-policy-text"],ratingPlaceholder:[1,"rating-placeholder"],ratingStarsPlaceholder:[1,"rating-stars-placeholder"],sendButtonText:[1,"send-button-text"],closeButtonLabel:[1,"close-button-label"],ratingPositiveLabel:[1,"rating-positive-label"],ratingNegativeLabel:[1,"rating-negative-label"],ratingStarLabel:[1,"rating-star-label"],successMessage:[1,"success-message"],recaptchaText:[1,"recaptcha-text"],screenshotAttachedText:[1,"screenshot-attached-text"],screenshotButtonText:[1,"screenshot-button-text"],screenshotTakingText:[1,"screenshot-taking-text"],screenshotPositioningText:[1,"screenshot-positioning-text"],screenshotPositioningCaptureText:[1,"screenshot-positioning-capture-text"],screenshotPositioningCancelText:[1,"screenshot-positioning-cancel-text"],screenshotEditTextButtonText:[1,"screenshot-edit-text-button-text"],screenshotEditorTitle:[1,"screenshot-editor-title"],screenshotEditorCancelText:[1,"screenshot-editor-cancel-text"],screenshotEditorSaveText:[1,"screenshot-editor-save-text"],screenshotSizeLabelText:[1,"screenshot-size-label-text"],screenshotBorderLabelText:[1,"screenshot-border-label-text"],screenshotEditTextPromptText:[1,"screenshot-edit-text-prompt-text"],screenshotErrorGeneral:[1,"screenshot-error-general"],screenshotErrorPermission:[1,"screenshot-error-permission"],screenshotErrorNotSupported:[1,"screenshot-error-not-supported"],screenshotErrorNotFound:[1,"screenshot-error-not-found"],screenshotErrorCancelled:[1,"screenshot-error-cancelled"],screenshotErrorBrowserNotSupported:[1,"screenshot-error-browser-not-supported"],screenshotErrorUnexpected:[1,"screenshot-error-unexpected"],sending:[32],formMessage:[32],formEmail:[32],formSuccess:[32],formVerification:[32],formError:[32],formErrorStatus:[32],encodedScreenshot:[32],isPrivacyChecked:[32],whitelabel:[32],selectedRating:[32],overlayVisible:[32],isAnimating:[32],recaptchaEnabled:[32],recaptchaSiteKey:[32],takingScreenshot:[32],showScreenshotError:[32],screenshotError:[32],showCanvasEditor:[32],autoStartCapture:[32],positioningScreenshot:[32],openModal:[64]}],[1,"canvas-editor",{canvasEditorTitle:[1,"canvas-editor-title"],canvasEditorCancelText:[1,"canvas-editor-cancel-text"],canvasEditorSaveText:[1,"canvas-editor-save-text"],screenshotTakingText:[1,"screenshot-taking-text"],screenshotAttachedText:[1,"screenshot-attached-text"],screenshotButtonText:[1,"screenshot-button-text"],escapeClose:[4,"escape-close"],clickOutsideClose:[4,"click-outside-close"],autoStartScreenshot:[4,"auto-start-screenshot"],existingScreenshot:[1,"existing-screenshot"],editTextButtonText:[1,"edit-text-button-text"],sizeLabelText:[1,"size-label-text"],borderLabelText:[1,"border-label-text"],editTextPromptText:[1,"edit-text-prompt-text"],screenshotErrorGeneral:[1,"screenshot-error-general"],screenshotErrorPermission:[1,"screenshot-error-permission"],screenshotErrorNotSupported:[1,"screenshot-error-not-supported"],screenshotErrorNotFound:[1,"screenshot-error-not-found"],screenshotErrorCancelled:[1,"screenshot-error-cancelled"],screenshotErrorBrowserNotSupported:[1,"screenshot-error-browser-not-supported"],screenshotErrorUnexpected:[1,"screenshot-error-unexpected"],takingScreenshot:[32],showCanvasEditor:[32],canvasDrawingTool:[32],canvasDrawingColor:[32],canvasLineWidth:[32],canvasTextSize:[32],isDrawing:[32],annotations:[32],currentAnnotation:[32],isDragging:[32],draggedAnnotation:[32],dragStartPos:[32],showColorPicker:[32],editingColorIndex:[32],selectedAnnotation:[32],isResizing:[32],resizingAnnotation:[32],resizeStartSize:[32],resizeStartDimensions:[32],hoveredAnnotation:[32],resizeHandle:[32],defaultColors:[32]}]]]],e))); \ No newline at end of file