pushfeedback 0.1.63 → 0.1.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,39 +11,40 @@ const FeedbackButton = class {
11
11
  index.registerInstance(this, hostRef);
12
12
  this.feedbackSent = index.createEvent(this, "feedbackSent", 7);
13
13
  this.feedbackError = index.createEvent(this, "feedbackError", 7);
14
- this.sessionId = "";
14
+ this.buttonPosition = 'default';
15
+ this.buttonStyle = 'default';
16
+ this.hideIcon = false;
17
+ this.hideMobile = false;
18
+ this.sessionId = '';
19
+ this.submit = false;
15
20
  this.customFont = false;
16
- this.errorMessage = "Please try again later.";
17
- this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
18
- this.errorMessage404 = "We could not find the provided project id in PushFeedback.";
19
- this.modalTitle = 'Share your feedback';
20
- this.modalTitleSuccess = 'Thanks for your feedback!';
21
- this.modalTitleError = "Oops!";
22
- this.modalPosition = 'center';
23
- this.sendButtonText = 'Send';
24
- this.successMessage = "";
25
- this.project = '';
26
- this.screenshotButtonText = 'Add a screenshot';
27
- this.screenshotTopbarText = 'Select an element on this page';
28
- this.hideEmail = false;
29
21
  this.emailAddress = '';
30
- this.emailPlaceholder = 'Email address (optional)';
31
- this.messagePlaceholder = 'Comments';
22
+ this.isEmailRequired = false;
23
+ this.fetchData = true;
24
+ this.hideEmail = false;
25
+ this.hidePrivacyPolicy = true;
32
26
  this.hideRating = false;
27
+ this.hideScreenshotButton = false;
28
+ this.modalPosition = 'center';
29
+ this.project = '';
33
30
  this.rating = undefined;
34
31
  this.ratingMode = 'thumbs';
35
- this.ratingPlaceholder = 'Was this page helpful?';
36
- this.ratingStarsPlaceholder = 'How would you rate this page?';
32
+ this.emailPlaceholder = 'Email address (optional)';
33
+ this.errorMessage = 'Please try again later.';
34
+ this.errorMessage403 = 'The request URL does not match the one defined in PushFeedback for this project.';
35
+ this.errorMessage404 = 'We could not find the provided project id in PushFeedback.';
37
36
  this.footerText = '';
38
- this.buttonStyle = 'default';
39
- this.buttonPosition = 'default';
40
- this.hideIcon = false;
41
- this.hideScreenshotButton = false;
42
- this.hidePrivacyPolicy = true;
43
- this.hideMobile = false;
37
+ this.messagePlaceholder = 'Comments';
38
+ this.modalTitle = 'Share your feedback';
39
+ this.modalTitleError = 'Oops!';
40
+ this.modalTitleSuccess = 'Thanks for your feedback!';
44
41
  this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
45
- this.fetchData = true;
46
- this.submit = false;
42
+ this.ratingPlaceholder = 'Was this page helpful?';
43
+ this.ratingStarsPlaceholder = 'How would you rate this page?';
44
+ this.screenshotButtonText = 'Add a screenshot';
45
+ this.screenshotTopbarText = 'Select an element on this page';
46
+ this.sendButtonText = 'Send';
47
+ this.successMessage = '';
47
48
  }
48
49
  componentWillLoad() {
49
50
  if (!this.sessionId) {
@@ -62,7 +63,7 @@ const FeedbackButton = class {
62
63
  if (this.isSafariBrowser()) {
63
64
  adjustement = 5;
64
65
  }
65
- buttonContent.style.right = `${(buttonContent.offsetWidth + adjustement) / 2 * -1}px`;
66
+ buttonContent.style.right = `${((buttonContent.offsetWidth + adjustement) / 2) * -1}px`;
66
67
  }
67
68
  if (!this.customFont) {
68
69
  this.loadInterFont();
@@ -72,34 +73,35 @@ const FeedbackButton = class {
72
73
  this.feedbackModal = document.createElement('feedback-modal');
73
74
  const props = [
74
75
  'customFont',
76
+ 'emailAddress',
77
+ 'fetchData',
78
+ 'hideEmail',
79
+ 'hidePrivacyPolicy',
80
+ 'hideRating',
81
+ 'hideScreenshotButton',
82
+ 'isEmailRequired',
83
+ 'modalPosition',
84
+ 'project',
85
+ 'rating',
86
+ 'ratingMode',
87
+ 'emailPlaceholder',
75
88
  'errorMessage',
76
89
  'errorMessage403',
77
90
  'errorMessage404',
91
+ 'footerText',
92
+ 'messagePlaceholder',
78
93
  'modalTitle',
79
- 'modalTitleSuccess',
80
94
  'modalTitleError',
81
- 'modalPosition',
82
- 'sendButtonText',
83
- 'successMessage',
84
- 'project',
85
- 'screenshotButtonText',
86
- 'screenshotTopbarText',
87
- 'hideEmail',
88
- 'emailAddress',
89
- 'emailPlaceholder',
90
- 'messagePlaceholder',
91
- 'hideRating',
92
- 'rating',
93
- 'ratingMode',
95
+ 'modalTitleSuccess',
96
+ 'privacyPolicyText',
94
97
  'ratingPlaceholder',
95
98
  'ratingStarsPlaceholder',
96
- 'footerText',
97
- 'hideScreenshotButton',
98
- 'hidePrivacyPolicy',
99
- 'privacyPolicyText',
100
- 'fetchData',
99
+ 'screenshotButtonText',
100
+ 'screenshotTopbarText',
101
+ 'sendButtonText',
102
+ 'successMessage',
101
103
  ];
102
- props.forEach(prop => {
104
+ props.forEach((prop) => {
103
105
  this.feedbackModal[prop] = this[prop];
104
106
  });
105
107
  document.body.appendChild(this.feedbackModal);
@@ -135,15 +137,15 @@ const FeedbackButton = class {
135
137
  project: this.project,
136
138
  rating: this.rating || -1,
137
139
  ratingMode: this.ratingMode,
138
- message: "",
140
+ message: '',
139
141
  session: localStorage.getItem('pushfeedback_sessionid') || '',
140
142
  };
141
143
  const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
142
144
  method: 'POST',
143
145
  body: JSON.stringify(body),
144
146
  headers: {
145
- 'Content-Type': 'application/json'
146
- }
147
+ 'Content-Type': 'application/json',
148
+ },
147
149
  });
148
150
  if (res.status === 201) {
149
151
  const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
@@ -8975,12 +8977,15 @@ const FeedbackModal = class {
8975
8977
  clearTimeout(this.scrollTimeout);
8976
8978
  this.scrollTimeout = setTimeout(() => {
8977
8979
  document.documentElement.classList.remove('feedback-modal-screenshot-closing');
8978
- document.documentElement.style.top = "";
8980
+ document.documentElement.style.top = '';
8979
8981
  window.removeEventListener('scroll', this.onScrollDebounced);
8980
8982
  }, 200);
8981
8983
  };
8982
8984
  this.handleSubmit = async (event) => {
8983
8985
  event.preventDefault();
8986
+ if (this.isEmailRequired && !this.formEmail) {
8987
+ return;
8988
+ }
8984
8989
  this.resetOverflow();
8985
8990
  this.showScreenshotMode = false;
8986
8991
  this.showScreenshotTopBar = false;
@@ -9002,8 +9007,8 @@ const FeedbackModal = class {
9002
9007
  method: 'POST',
9003
9008
  body: JSON.stringify(body),
9004
9009
  headers: {
9005
- 'Content-Type': 'application/json'
9006
- }
9010
+ 'Content-Type': 'application/json',
9011
+ },
9007
9012
  });
9008
9013
  if (res.status === 201) {
9009
9014
  const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
@@ -9087,7 +9092,7 @@ const FeedbackModal = class {
9087
9092
  const rect = elementUnder.getBoundingClientRect();
9088
9093
  this.screenshotModal.style.display = '';
9089
9094
  // Get the bounding box of the element selected
9090
- this.elementSelected.style.position = "absolute";
9095
+ this.elementSelected.style.position = 'absolute';
9091
9096
  this.elementSelected.style.left = `${rect.left}px`;
9092
9097
  this.elementSelected.style.top = `${rect.top}px`;
9093
9098
  this.elementSelected.style.width = `${rect.width}px`;
@@ -9095,33 +9100,33 @@ const FeedbackModal = class {
9095
9100
  this.elementSelected.classList.add('feedback-modal-element-hover');
9096
9101
  // Set the background color of nonselected areas
9097
9102
  // Top
9098
- this.topSide.style.position = "absolute";
9103
+ this.topSide.style.position = 'absolute';
9099
9104
  this.topSide.style.left = `${rect.left}px`;
9100
9105
  this.topSide.style.top = '0px';
9101
9106
  this.topSide.style.width = `${rect.width + borderOffset}px`;
9102
9107
  this.topSide.style.height = `${rect.top}px`;
9103
- this.topSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
9108
+ this.topSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
9104
9109
  // Left
9105
- this.leftSide.style.position = "absolute";
9110
+ this.leftSide.style.position = 'absolute';
9106
9111
  this.leftSide.style.left = '0px';
9107
9112
  this.leftSide.style.top = '0px';
9108
9113
  this.leftSide.style.width = `${rect.left}px`;
9109
9114
  this.leftSide.style.height = '100vh';
9110
- this.leftSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
9115
+ this.leftSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
9111
9116
  // Bottom
9112
- this.bottomSide.style.position = "absolute";
9117
+ this.bottomSide.style.position = 'absolute';
9113
9118
  this.bottomSide.style.left = `${rect.left}px`;
9114
9119
  this.bottomSide.style.top = `${rect.bottom + borderOffset}px`;
9115
9120
  this.bottomSide.style.width = `${rect.width + borderOffset}px`;
9116
9121
  this.bottomSide.style.height = '100vh';
9117
- this.bottomSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
9122
+ this.bottomSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
9118
9123
  // Right
9119
- this.rightSide.style.position = "absolute";
9124
+ this.rightSide.style.position = 'absolute';
9120
9125
  this.rightSide.style.left = `${rect.right + borderOffset}px`;
9121
9126
  this.rightSide.style.top = '0px';
9122
9127
  this.rightSide.style.width = '100%';
9123
9128
  this.rightSide.style.height = '100vh';
9124
- this.rightSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
9129
+ this.rightSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
9125
9130
  // Restore the visibility of the screenshot-modal
9126
9131
  this.screenshotModal.style.backgroundColor = 'transparent';
9127
9132
  };
@@ -9173,36 +9178,37 @@ const FeedbackModal = class {
9173
9178
  this.overlayVisible = false;
9174
9179
  this.isAnimating = false;
9175
9180
  this.customFont = false;
9176
- this.errorMessage = "Please try again later.";
9177
- this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
9178
- this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
9179
- this.modalTitle = 'Share your feedback';
9180
- this.modalTitleSuccess = 'Thanks for your feedback!';
9181
- this.modalTitleError = "Oops!";
9182
- this.modalPosition = 'center';
9183
- this.sendButtonText = 'Send';
9184
- this.successMessage = "";
9185
- this.project = '';
9186
- this.screenshotButtonText = 'Add a screenshot';
9187
- this.screenshotTopbarText = 'Select an element on this page';
9188
- this.hideEmail = false;
9189
9181
  this.emailAddress = '';
9190
- this.emailPlaceholder = 'Email address (optional)';
9191
- this.messagePlaceholder = 'Comments';
9192
- this.hideRating = false;
9193
- this.rating = undefined;
9182
+ this.hideEmail = false;
9183
+ this.isEmailRequired = false;
9194
9184
  this.ratingMode = 'thumbs';
9195
- this.ratingPlaceholder = 'Was this page helpful?';
9196
- this.ratingStarsPlaceholder = 'How would you rate this page?';
9197
- this.footerText = '';
9198
- this.showModal = false;
9199
- this.showScreenshotMode = false;
9200
- this.showScreenshotTopBar = false;
9201
9185
  this.hasSelectedElement = false;
9202
- this.hideScreenshotButton = false;
9203
9186
  this.hidePrivacyPolicy = true;
9204
- this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
9187
+ this.hideRating = false;
9188
+ this.hideScreenshotButton = false;
9189
+ this.project = '';
9190
+ this.showScreenshotMode = false;
9191
+ this.showScreenshotTopBar = false;
9192
+ this.showModal = false;
9193
+ this.rating = undefined;
9205
9194
  this.fetchData = true;
9195
+ this.emailPlaceholder = 'Email address (optional)';
9196
+ this.errorMessage = 'Please try again later.';
9197
+ this.errorMessage403 = 'The request URL does not match the one defined in PushFeedback for this project.';
9198
+ this.errorMessage404 = 'We could not find the provided project ID in PushFeedback.';
9199
+ this.messagePlaceholder = 'Comments';
9200
+ this.footerText = '';
9201
+ this.modalPosition = 'center';
9202
+ this.modalTitle = 'Share your feedback';
9203
+ this.modalTitleError = 'Oops!';
9204
+ this.modalTitleSuccess = 'Thanks for your feedback!';
9205
+ this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
9206
+ this.ratingPlaceholder = 'Was this page helpful?';
9207
+ this.ratingStarsPlaceholder = 'How would you rate this page?';
9208
+ this.sendButtonText = 'Send';
9209
+ this.screenshotButtonText = 'Add a screenshot';
9210
+ this.screenshotTopbarText = 'Select an element on this page';
9211
+ this.successMessage = '';
9206
9212
  }
9207
9213
  componentWillLoad() {
9208
9214
  if (this.fetchData)
@@ -9211,7 +9217,7 @@ const FeedbackModal = class {
9211
9217
  if (this.rating) {
9212
9218
  this.selectedRating = this.rating;
9213
9219
  }
9214
- if (this.ratingMode == "thumbs" && this.rating == 0) {
9220
+ if (this.ratingMode == 'thumbs' && this.rating == 0) {
9215
9221
  this.selectedRating = 5;
9216
9222
  }
9217
9223
  }
@@ -9250,11 +9256,12 @@ const FeedbackModal = class {
9250
9256
  y: window.scrollY,
9251
9257
  width: window.innerWidth,
9252
9258
  height: window.innerHeight,
9253
- }).then(canvas => {
9259
+ })
9260
+ .then((canvas) => {
9254
9261
  const dataUrl = canvas.toDataURL();
9255
9262
  resolve(dataUrl);
9256
9263
  })
9257
- .catch(error => {
9264
+ .catch((error) => {
9258
9265
  console.error(error);
9259
9266
  reject(error);
9260
9267
  });
@@ -9271,16 +9278,22 @@ const FeedbackModal = class {
9271
9278
  this.selectedRating = newRating;
9272
9279
  }
9273
9280
  render() {
9274
- return (index.h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''}` }, this.showScreenshotMode && (index.h("div", { class: "feedback-modal-screenshot", ref: el => (this.screenshotModal = el), onMouseMove: this.handleMouseOverScreenShot }, index.h("div", { class: "feedback-modal-screenshot-element-selected", ref: el => (this.elementSelected = el), onClick: this.handleMouseClickedSelectedElement }), index.h("div", { class: "top-side", ref: el => (this.topSide = el) }), index.h("div", { class: "left-side", ref: el => (this.leftSide = el) }), index.h("div", { class: "bottom-side", ref: el => (this.bottomSide = el) }), index.h("div", { class: "right-side", ref: el => (this.rightSide = el) }), this.showScreenshotTopBar && (index.h("div", { class: "feedback-modal-screenshot-header", onClick: this.closeScreenShot }, index.h("span", null, this.screenshotTopbarText), index.h("span", { class: "feedback-modal-screenshot-close" }, index.h("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" }, index.h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), index.h("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))))))), this.showModal && (index.h("div", { class: `feedback-overlay ${this.isAnimating ? 'feedback-overlay--visible' : ''}` })), this.showModal && (index.h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.isAnimating ? 'feedback-modal-content--open' : ''}`, ref: el => (this.modalContent = el) }, index.h("div", { class: "feedback-modal-header" }, !this.formSuccess && !this.formError ? (index.h("span", null, this.modalTitle)) : this.formSuccess ? (index.h("span", null, this.modalTitleSuccess)) : index.h("span", null, this.modalTitleError), index.h("button", { class: "feedback-modal-close", onClick: this.close }, index.h("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" }, index.h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), index.h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), index.h("div", { class: "feedback-modal-body" }, !this.formSuccess && !this.formError ? (index.h("form", { onSubmit: this.handleSubmit }, !this.hideRating && (index.h("div", { class: "feedback-modal-rating" }, this.ratingMode === 'thumbs' ? (index.h("div", { class: "feedback-modal-rating-content" }, index.h("span", { class: "feedback-modal-input-heading" }, this.ratingPlaceholder), index.h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--thumbs" }, index.h("button", { title: "Yes", class: `feedback-modal-rating-button ${this.selectedRating === 1 ? 'feedback-modal-rating-button--selected' : ''}`, onClick: (event) => {
9281
+ return (index.h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''}` }, this.showScreenshotMode && (index.h("div", { class: "feedback-modal-screenshot", ref: (el) => (this.screenshotModal = el), onMouseMove: this.handleMouseOverScreenShot }, index.h("div", { class: "feedback-modal-screenshot-element-selected", ref: (el) => (this.elementSelected = el), onClick: this.handleMouseClickedSelectedElement }), index.h("div", { class: "top-side", ref: (el) => (this.topSide = el) }), index.h("div", { class: "left-side", ref: (el) => (this.leftSide = el) }), index.h("div", { class: "bottom-side", ref: (el) => (this.bottomSide = el) }), index.h("div", { class: "right-side", ref: (el) => (this.rightSide = el) }), this.showScreenshotTopBar && (index.h("div", { class: "feedback-modal-screenshot-header", onClick: this.closeScreenShot }, index.h("span", null, this.screenshotTopbarText), index.h("span", { class: "feedback-modal-screenshot-close" }, index.h("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" }, index.h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), index.h("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))))))), this.showModal && (index.h("div", { class: `feedback-overlay ${this.isAnimating ? 'feedback-overlay--visible' : ''}` })), this.showModal && (index.h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.isAnimating ? 'feedback-modal-content--open' : ''}`, ref: (el) => (this.modalContent = el) }, index.h("div", { class: "feedback-modal-header" }, !this.formSuccess && !this.formError ? (index.h("span", null, this.modalTitle)) : this.formSuccess ? (index.h("span", null, this.modalTitleSuccess)) : (index.h("span", null, this.modalTitleError)), index.h("button", { class: "feedback-modal-close", onClick: this.close }, index.h("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" }, index.h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), index.h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), index.h("div", { class: "feedback-modal-body" }, !this.formSuccess && !this.formError ? (index.h("form", { onSubmit: this.handleSubmit }, !this.hideRating && (index.h("div", { class: "feedback-modal-rating" }, this.ratingMode === 'thumbs' ? (index.h("div", { class: "feedback-modal-rating-content" }, index.h("span", { class: "feedback-modal-input-heading" }, this.ratingPlaceholder), index.h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--thumbs" }, index.h("button", { title: "Yes", class: `feedback-modal-rating-button ${this.selectedRating === 1
9282
+ ? 'feedback-modal-rating-button--selected'
9283
+ : ''}`, onClick: (event) => {
9275
9284
  event.preventDefault();
9276
9285
  this.handleRatingChange(1);
9277
- } }, index.h("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" }, index.h("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" }))), index.h("button", { title: "No", class: `feedback-modal-rating-button ${this.selectedRating === 5 ? 'feedback-modal-rating-button--selected' : ''}`, onClick: (event) => {
9286
+ } }, index.h("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" }, index.h("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" }))), index.h("button", { title: "No", class: `feedback-modal-rating-button ${this.selectedRating === 5
9287
+ ? 'feedback-modal-rating-button--selected'
9288
+ : ''}`, onClick: (event) => {
9278
9289
  event.preventDefault();
9279
9290
  this.handleRatingChange(5);
9280
- } }, index.h("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" }, index.h("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" })))))) : (index.h("div", { class: "feedback-modal-rating-content" }, index.h("span", { class: "feedback-modal-input-heading" }, this.ratingStarsPlaceholder), index.h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--stars" }, [1, 2, 3, 4, 5].map((rating) => (index.h("button", { key: rating, class: `feedback-modal-rating-button ${this.selectedRating >= rating ? 'feedback-modal-rating-button--selected' : ''}`, onClick: (event) => {
9291
+ } }, index.h("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" }, index.h("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" })))))) : (index.h("div", { class: "feedback-modal-rating-content" }, index.h("span", { class: "feedback-modal-input-heading" }, this.ratingStarsPlaceholder), index.h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--stars" }, [1, 2, 3, 4, 5].map((rating) => (index.h("button", { key: rating, class: `feedback-modal-rating-button ${this.selectedRating >= rating
9292
+ ? 'feedback-modal-rating-button--selected'
9293
+ : ''}`, onClick: (event) => {
9281
9294
  event.preventDefault();
9282
9295
  this.handleRatingChange(rating);
9283
- } }, index.h("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" }, index.h("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" })))))))))), index.h("div", { class: "feedback-modal-text" }, index.h("textarea", { placeholder: this.messagePlaceholder, value: this.formMessage, onInput: (event) => this.handleMessageInput(event) })), !this.hideEmail && (index.h("div", { class: "feedback-modal-email" }, index.h("input", { placeholder: this.emailPlaceholder, type: "email", onInput: (event) => this.handleEmailInput(event), value: this.formEmail }))), index.h("div", { class: "feedback-verification" }, index.h("input", { type: "text", name: "verification", style: { display: 'none' }, onInput: (event) => this.handleVerification(event), value: this.formVerification })), !this.hidePrivacyPolicy && (index.h("div", { class: "feedback-modal-privacy" }, index.h("input", { type: "checkbox", id: "privacyPolicy", onChange: (ev) => this.handleCheckboxChange(ev), required: true }), index.h("span", { innerHTML: this.privacyPolicyText }))), index.h("div", { class: `feedback-modal-buttons ${this.hideScreenshotButton ? 'single' : ''}` }, !this.hideScreenshotButton && (index.h("button", { type: "button", class: `feedback-modal-button feedback-modal-button--screenshot ${this.encodedScreenshot ? "feedback-modal-button--active" : ""}`, onClick: this.openScreenShot, disabled: this.sending }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 -960 960 960", width: "24" }, index.h("path", { d: "M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-200v-200h80v120h120v80H200Zm0-360v-200h200v80H280v120h-80Zm480 0v-120H560v-80h200v200h-80Z" })), this.screenshotButtonText)), index.h("button", { class: "feedback-modal-button feedback-modal-button--submit", type: "submit", disabled: this.sending }, this.sendButtonText)))) : this.formSuccess && !this.formError ? (index.h("div", { class: "feedback-modal-success" }, index.h("p", { class: "feedback-modal-message" }, this.successMessage))) : this.formError && this.formErrorStatus == 404 ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage404)) : this.formError && this.formErrorStatus == 403 ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage403)) : this.formError ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage)) : index.h("span", null)), index.h("div", { class: "feedback-modal-footer" }, index.h("div", { class: "feedback-logo", style: { display: this.whitelabel ? 'none' : 'block' } }, "Powered by ", index.h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")), this.footerText && index.h("div", { class: "feedback-footer-text" }, index.h("span", { innerHTML: this.footerText })))))));
9296
+ } }, index.h("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" }, index.h("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" })))))))))), index.h("div", { class: "feedback-modal-text" }, index.h("textarea", { placeholder: this.messagePlaceholder, value: this.formMessage, onInput: (event) => this.handleMessageInput(event) })), !this.hideEmail && (index.h("div", { class: "feedback-modal-email" }, index.h("input", { placeholder: this.emailPlaceholder, type: "email", onInput: (event) => this.handleEmailInput(event), value: this.formEmail, required: this.isEmailRequired }))), index.h("div", { class: "feedback-verification" }, index.h("input", { type: "text", name: "verification", style: { display: 'none' }, onInput: (event) => this.handleVerification(event), value: this.formVerification })), !this.hidePrivacyPolicy && (index.h("div", { class: "feedback-modal-privacy" }, index.h("input", { type: "checkbox", id: "privacyPolicy", onChange: (ev) => this.handleCheckboxChange(ev), required: true }), index.h("span", { innerHTML: this.privacyPolicyText }))), index.h("div", { class: `feedback-modal-buttons ${this.hideScreenshotButton ? 'single' : ''}` }, !this.hideScreenshotButton && (index.h("button", { type: "button", class: `feedback-modal-button feedback-modal-button--screenshot ${this.encodedScreenshot ? 'feedback-modal-button--active' : ''}`, onClick: this.openScreenShot, disabled: this.sending }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 -960 960 960", width: "24" }, index.h("path", { d: "M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-200v-200h80v120h120v80H200Zm0-360v-200h200v80H280v120h-80Zm480 0v-120H560v-80h200v200h-80Z" })), this.screenshotButtonText)), index.h("button", { class: "feedback-modal-button feedback-modal-button--submit", type: "submit", disabled: this.sending }, this.sendButtonText)))) : this.formSuccess && !this.formError ? (index.h("div", { class: "feedback-modal-success" }, index.h("p", { class: "feedback-modal-message" }, this.successMessage))) : this.formError && this.formErrorStatus == 404 ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage404)) : this.formError && this.formErrorStatus == 403 ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage403)) : this.formError ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage)) : (index.h("span", null))), index.h("div", { class: "feedback-modal-footer" }, index.h("div", { class: "feedback-logo", style: { display: this.whitelabel ? 'none' : 'block' } }, "Powered by", ' ', index.h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")), this.footerText && (index.h("div", { class: "feedback-footer-text" }, index.h("span", { innerHTML: this.footerText }))))))));
9284
9297
  }
9285
9298
  componentDidRender() {
9286
9299
  if (this.showModal) {
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"sessionId":[1537,"session-id"],"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"footerText":[1,"footer-text"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"hideMobile":[4,"hide-mobile"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"submit":[4]}],[1,"feedback-modal",{"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"footerText":[1,"footer-text"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"hasSelectedElement":[1540,"has-selected-element"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"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],"openModal":[64]}]]]], options);
17
+ return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"buttonPosition":[1,"button-position"],"buttonStyle":[1,"button-style"],"hideIcon":[4,"hide-icon"],"hideMobile":[4,"hide-mobile"],"sessionId":[1537,"session-id"],"submit":[4],"customFont":[4,"custom-font"],"emailAddress":[1,"email-address"],"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"],"modalPosition":[1,"modal-position"],"project":[1],"rating":[2],"ratingMode":[1,"rating-mode"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"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"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"]}],[1,"feedback-modal",{"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"],"project":[1],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"showModal":[1540,"show-modal"],"rating":[2],"fetchData":[4,"fetch-data"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"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"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"successMessage":[1,"success-message"],"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],"openModal":[64]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"sessionId":[1537,"session-id"],"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"footerText":[1,"footer-text"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"hideMobile":[4,"hide-mobile"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"submit":[4]}],[1,"feedback-modal",{"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"footerText":[1,"footer-text"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"hasSelectedElement":[1540,"has-selected-element"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"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],"openModal":[64]}]]]], options);
20
+ return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"buttonPosition":[1,"button-position"],"buttonStyle":[1,"button-style"],"hideIcon":[4,"hide-icon"],"hideMobile":[4,"hide-mobile"],"sessionId":[1537,"session-id"],"submit":[4],"customFont":[4,"custom-font"],"emailAddress":[1,"email-address"],"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"],"modalPosition":[1,"modal-position"],"project":[1],"rating":[2],"ratingMode":[1,"rating-mode"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"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"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"]}],[1,"feedback-modal",{"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"],"project":[1],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"showModal":[1540,"show-modal"],"rating":[2],"fetchData":[4,"fetch-data"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"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"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"successMessage":[1,"success-message"],"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],"openModal":[64]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;