pushfeedback 0.1.42 → 0.1.44

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.
@@ -4,112 +4,124 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b596cc3a.js');
6
6
 
7
- const feedbackButtonCss = ".feedback-button-content{cursor:pointer;max-width:fit-content;z-index:var(--feedback-button-z-index)}.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-family:var(--feedback-font-family);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-family:var(--feedback-font-family);font-weight:var(--feedback-button-text-font-weight);font-size:var(--feedback-button-text-font-size);padding:8px 15px}.feedback-button-content--bottom-right{bottom:10px;position:fixed;right:10px}.feedback-button-content--center-right{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{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}";
7
+ const feedbackButtonCss = ".feedback-button-content{cursor:pointer;max-width:fit-content;z-index:var(--feedback-button-z-index)}.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-family:var(--feedback-font-family);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-family:var(--feedback-font-family);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-text-color)}.feedback-button-content--dark .icon-edit{stroke:var(--feedback-button-dark-text-color)}.feedback-button-content--bottom-right{bottom:10px;position:fixed;right:10px}.feedback-button-content--center-right{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{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}";
8
8
 
9
- const FeedbackButton = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.sessionId = "";
13
- this.customFont = false;
14
- this.errorMessage = "Please try again later.";
15
- this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
16
- this.errorMessage404 = "We could not find the provided project id in PushFeedback.";
17
- this.modalTitle = 'Share your feedback';
18
- this.modalTitleSuccess = 'Thanks for your feedback!';
19
- this.modalTitleError = "Oops!";
20
- this.modalPosition = 'center';
21
- this.sendButtonText = 'Send';
22
- this.successMessage = "";
23
- this.project = '';
24
- this.screenshotButtonText = 'Add a screenshot';
25
- this.screenshotTopbarText = 'Select an element on this page';
26
- this.hideEmail = false;
27
- this.emailAddress = '';
28
- this.emailPlaceholder = 'Email address (optional)';
29
- this.messagePlaceholder = 'Comments';
30
- this.hideRating = false;
31
- this.rating = undefined;
32
- this.ratingMode = 'thumbs';
33
- this.ratingPlaceholder = 'Was this page helpful?';
34
- this.ratingStarsPlaceholder = 'How would you rate this page?';
35
- this.buttonStyle = 'default';
36
- this.buttonPosition = 'default';
37
- this.hideIcon = false;
38
- this.hideScreenshotButton = false;
39
- this.hidePrivacyPolicy = true;
40
- this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
41
- this.fetchData = true;
42
- }
43
- connectedCallback() {
44
- this.feedbackModal = document.createElement('feedback-modal');
45
- const props = [
46
- 'sessionId',
47
- 'customFont',
48
- 'errorMessage',
49
- 'errorMessage403',
50
- 'errorMessage404',
51
- 'modalTitle',
52
- 'modalTitleSuccess',
53
- 'modalTitleError',
54
- 'modalPosition',
55
- 'sendButtonText',
56
- 'successMessage',
57
- 'project',
58
- 'screenshotButtonText',
59
- 'screenshotTopbarText',
60
- 'hideEmail',
61
- 'emailAddress',
62
- 'emailPlaceholder',
63
- 'messagePlaceholder',
64
- 'hideRating',
65
- 'rating',
66
- 'ratingMode',
67
- 'ratingPlaceholder',
68
- 'ratingStarsPlaceholder',
69
- 'hideScreenshotButton',
70
- 'hidePrivacyPolicy',
71
- 'privacyPolicyText',
72
- 'fetchData'
73
- ];
74
- props.forEach(prop => {
75
- this.feedbackModal[prop] = this[prop];
76
- });
77
- document.body.appendChild(this.feedbackModal);
78
- }
79
- disconnectedCallback() {
80
- document.body.removeChild(this.feedbackModal);
81
- }
82
- isSafariBrowser() {
83
- const isSafari = /safari/i.test(navigator.userAgent) && !/chrome/i.test(navigator.userAgent);
84
- return isSafari;
85
- }
86
- componentDidLoad() {
87
- if (this.buttonPosition === 'center-right') {
88
- const buttonContent = this.el.shadowRoot.querySelector('.feedback-button-content');
89
- let adjustement = 0;
90
- if (this.isSafariBrowser()) {
91
- adjustement = 10;
92
- }
93
- buttonContent.style.right = `${(buttonContent.offsetWidth + adjustement) / 2 * -1}px`;
94
- }
95
- if (!this.customFont) {
96
- this.loadInterFont();
97
- }
98
- }
99
- loadInterFont() {
100
- const link = document.createElement('link');
101
- link.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap';
102
- link.rel = 'stylesheet';
103
- document.head.appendChild(link);
104
- }
105
- showModal() {
106
- this.feedbackModal.showModal = true;
107
- }
108
- render() {
109
- return (index.h(index.Host, null, index.h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition}`, onClick: () => this.showModal() }, !this.hideIcon && this.buttonStyle === 'dark' && (index.h("span", { class: "feedback-button-content-icon" }, index.h("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: "feather feather-edit-3" }, index.h("path", { d: "M12 20h9" }), index.h("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })))), !this.hideIcon && this.buttonStyle === 'light' && (index.h("span", { class: "feedback-button-content-icon" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#0070F4", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-edit-3" }, index.h("path", { d: "M12 20h9" }), index.h("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })))), index.h("slot", null))));
110
- }
111
- get el() { return index.getElement(this); }
112
- };
9
+ const FeedbackButton = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.sessionId = "";
13
+ this.customFont = false;
14
+ this.errorMessage = "Please try again later.";
15
+ this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
16
+ this.errorMessage404 = "We could not find the provided project id in PushFeedback.";
17
+ this.modalTitle = 'Share your feedback';
18
+ this.modalTitleSuccess = 'Thanks for your feedback!';
19
+ this.modalTitleError = "Oops!";
20
+ this.modalPosition = 'center';
21
+ this.sendButtonText = 'Send';
22
+ this.successMessage = "";
23
+ this.project = '';
24
+ this.screenshotButtonText = 'Add a screenshot';
25
+ this.screenshotTopbarText = 'Select an element on this page';
26
+ this.hideEmail = false;
27
+ this.emailAddress = '';
28
+ this.emailPlaceholder = 'Email address (optional)';
29
+ this.messagePlaceholder = 'Comments';
30
+ this.hideRating = false;
31
+ this.rating = undefined;
32
+ this.ratingMode = 'thumbs';
33
+ this.ratingPlaceholder = 'Was this page helpful?';
34
+ this.ratingStarsPlaceholder = 'How would you rate this page?';
35
+ this.buttonStyle = 'default';
36
+ this.buttonPosition = 'default';
37
+ this.hideIcon = false;
38
+ this.hideScreenshotButton = false;
39
+ this.hidePrivacyPolicy = true;
40
+ this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
41
+ this.fetchData = true;
42
+ }
43
+ componentWillLoad() {
44
+ if (!this.sessionId) {
45
+ let storedSessionId = localStorage.getItem('pushfeedback_sessionid');
46
+ if (!storedSessionId) {
47
+ storedSessionId = this.generateRandomSessionId();
48
+ localStorage.setItem('pushfeedback_sessionid', storedSessionId);
49
+ this.sessionId = storedSessionId;
50
+ }
51
+ }
52
+ }
53
+ componentDidLoad() {
54
+ if (this.buttonPosition === 'center-right') {
55
+ const buttonContent = this.el.shadowRoot.querySelector('.feedback-button-content');
56
+ let adjustement = 0;
57
+ if (this.isSafariBrowser()) {
58
+ adjustement = 10;
59
+ }
60
+ buttonContent.style.right = `${(buttonContent.offsetWidth + adjustement) / 2 * -1}px`;
61
+ }
62
+ if (!this.customFont) {
63
+ this.loadInterFont();
64
+ }
65
+ }
66
+ connectedCallback() {
67
+ this.feedbackModal = document.createElement('feedback-modal');
68
+ const props = [
69
+ 'customFont',
70
+ 'errorMessage',
71
+ 'errorMessage403',
72
+ 'errorMessage404',
73
+ 'modalTitle',
74
+ 'modalTitleSuccess',
75
+ 'modalTitleError',
76
+ 'modalPosition',
77
+ 'sendButtonText',
78
+ 'successMessage',
79
+ 'project',
80
+ 'screenshotButtonText',
81
+ 'screenshotTopbarText',
82
+ 'hideEmail',
83
+ 'emailAddress',
84
+ 'emailPlaceholder',
85
+ 'messagePlaceholder',
86
+ 'hideRating',
87
+ 'rating',
88
+ 'ratingMode',
89
+ 'ratingPlaceholder',
90
+ 'ratingStarsPlaceholder',
91
+ 'hideScreenshotButton',
92
+ 'hidePrivacyPolicy',
93
+ 'privacyPolicyText',
94
+ 'fetchData'
95
+ ];
96
+ props.forEach(prop => {
97
+ this.feedbackModal[prop] = this[prop];
98
+ });
99
+ document.body.appendChild(this.feedbackModal);
100
+ }
101
+ disconnectedCallback() {
102
+ document.body.removeChild(this.feedbackModal);
103
+ }
104
+ generateRandomSessionId(length = 16) {
105
+ return Math.random().toString(36).substr(2, length);
106
+ }
107
+ isSafariBrowser() {
108
+ const isSafari = /safari/i.test(navigator.userAgent) && !/chrome/i.test(navigator.userAgent);
109
+ return isSafari;
110
+ }
111
+ loadInterFont() {
112
+ const link = document.createElement('link');
113
+ link.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap';
114
+ link.rel = 'stylesheet';
115
+ document.head.appendChild(link);
116
+ }
117
+ showModal() {
118
+ this.feedbackModal.showModal = true;
119
+ }
120
+ render() {
121
+ return (index.h(index.Host, null, index.h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition}`, onClick: () => this.showModal() }, !this.hideIcon && (index.h("span", { class: "feedback-button-content-icon" }, index.h("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" }, index.h("path", { d: "M12 20h9" }), index.h("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })))), index.h("slot", null))));
122
+ }
123
+ get el() { return index.getElement(this); }
124
+ };
113
125
  FeedbackButton.style = feedbackButtonCss;
114
126
 
115
127
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -7956,311 +7968,299 @@ var html2canvas = createCommonjsModule(function (module, exports) {
7956
7968
  //# sourceMappingURL=html2canvas.js.map
7957
7969
  });
7958
7970
 
7959
- const feedbackModalCss = ".text-center{flex-grow:1;text-align:center}.feedback-modal-wrapper{position:absolute;z-index:var(--feedback-modal-wrapper-z-index)}.feedback-overlay{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{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-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-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);left:50%;max-width:90%;padding:20px;position:fixed;top:50%;transform:translate(-50%, -50%);width:100%;z-index:var(--feedback-modal-content-z-index)}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);display:flex;font-family:var(--feedback-modal-header-font-family);font-size:var(--feedback-header-font-size);font-weight:var(--feedback-modal-header-font-weight);justify-content:space-between;margin-bottom:20px}.feedback-modal-rating-buttons{width:100%;margin-bottom:20px}.feedback-modal-rating-button{padding:0;background-color:transparent;border:transparent;margin-right:5px;cursor:pointer}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button{border:1px 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-family:var(--feedback-modal-content-font-family);font-weight:500;margin-right:10px;justify-content:center;padding:5px 10px}.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:1px 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--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:1px 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-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:100px;min-height:100px;padding:10px;resize:vertical;width:100%}.feedback-modal-email input{background-color:var(--feedback-modal-input-bg-color);border:1px 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-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:40px;padding:10px;width:100%;margin-bottom:20px}.feedback-modal-privacy{font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.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:1px 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-family:var(--feedback-modal-content-font-family);font-weight:500;justify-content:center;min-height:40px;padding:5px 10px}.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:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-submit-text-color)}.feedback-modal-button:hover,.feedback-modal-button--active{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-button--submit:hover{background-color:var(--feedback-modal-button-submit-bg-color-hover);border:1px solid var(--feedback-modal-button-submit-border-color-hover);color:var(--feedback-modal-button-submit-text-color-hover)}.feedback-modal-input-heading{display:block;font-size:14px;font-weight:300;padding-bottom:10px;font-family:var(--feedback-modal-content-font-family)}.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{align-items:center;display:flex;justify-content:center;margin-top:5px}.feedback-logo a{margin-left:3px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;height:22px;margin-left:auto;padding:0;width:22px}.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;font-family:var(--feedback-modal-content-font-family);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-top:0}.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:1px solid var(--feedback-modal-element-selected-border-color)}@media screen and (min-width: 768px){.feedback-modal-content{max-width:600px}.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:300px;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:300px;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}}";
7971
+ const feedbackModalCss = ".text-center{flex-grow:1;text-align:center}.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;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index)}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-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-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);left:50%;max-width:90%;padding:20px;position:fixed;top:50%;transform:translate(-50%, -50%);width:100%;z-index:var(--feedback-modal-content-z-index)}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);display:flex;font-family:var(--feedback-modal-header-font-family);font-size:var(--feedback-header-font-size);font-weight:var(--feedback-modal-header-font-weight);justify-content:space-between;margin-bottom:20px}.feedback-modal-rating-buttons{width:100%;margin-bottom:20px}.feedback-modal-rating-button{padding:0;background-color:transparent;border:transparent;margin-right:5px;cursor:pointer}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button{border:1px 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-family:var(--feedback-modal-content-font-family);font-weight:500;margin-right:10px;justify-content:center;padding:5px 10px}.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:1px 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--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:1px 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-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:100px;min-height:100px;padding:10px;resize:vertical;width:100%}.feedback-modal-email input{background-color:var(--feedback-modal-input-bg-color);border:1px 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-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:40px;padding:10px;width:100%;margin-bottom:20px}.feedback-modal-privacy{font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.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:1px 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-family:var(--feedback-modal-content-font-family);font-weight:500;justify-content:center;min-height:40px;padding:5px 10px}.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:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-submit-text-color)}.feedback-modal-button:hover,.feedback-modal-button--active{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-button--submit:hover{background-color:var(--feedback-modal-button-submit-bg-color-hover);border:1px solid var(--feedback-modal-button-submit-border-color-hover);color:var(--feedback-modal-button-submit-text-color-hover)}.feedback-modal-input-heading{display:block;font-size:14px;font-weight:300;padding-bottom:10px;font-family:var(--feedback-modal-content-font-family)}.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{align-items:center;display:flex;justify-content:center;margin-top:5px}.feedback-logo a{margin-left:3px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;height:22px;margin-left:auto;padding:0;width:22px}.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;font-family:var(--feedback-modal-content-font-family);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-top:0}.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:1px solid var(--feedback-modal-element-selected-border-color)}@media screen and (min-width: 768px){.feedback-modal-content{max-width:600px}.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:300px;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:300px;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}}";
7960
7972
 
7961
- const FeedbackModal = class {
7962
- constructor(hostRef) {
7963
- index.registerInstance(this, hostRef);
7964
- this.onScrollDebounced = () => {
7965
- clearTimeout(this.scrollTimeout);
7966
- this.scrollTimeout = setTimeout(() => {
7967
- document.documentElement.classList.remove('feedback-modal-screenshot-closing');
7968
- document.documentElement.style.top = "";
7969
- window.removeEventListener('scroll', this.onScrollDebounced);
7970
- }, 200);
7971
- };
7972
- this.handleSubmit = async (event) => {
7973
- event.preventDefault();
7974
- this.resetOverflow();
7975
- this.showScreenshotMode = false;
7976
- this.showScreenshotTopBar = false;
7977
- this.showModal = false;
7978
- this.sending = true;
7979
- try {
7980
- const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
7981
- method: 'POST',
7982
- body: JSON.stringify({
7983
- url: window.location.href,
7984
- message: this.formMessage,
7985
- email: this.formEmail,
7986
- project: this.project,
7987
- screenshot: this.encodedScreenshot,
7988
- rating: this.selectedRating,
7989
- ratingMode: this.ratingMode,
7990
- verification: this.formVerification,
7991
- session: this.session,
7992
- }),
7993
- headers: {
7994
- 'Content-Type': 'application/json'
7995
- }
7996
- });
7997
- if (res.status === 201) {
7998
- this.formSuccess = true;
7999
- this.formError = false;
8000
- }
8001
- else {
8002
- this.formSuccess = false;
8003
- this.formError = true;
8004
- this.formErrorStatus = res.status;
8005
- }
8006
- }
8007
- catch (error) {
8008
- console.log(error);
8009
- this.formSuccess = false;
8010
- this.formError = true;
8011
- this.formErrorStatus = 500;
8012
- }
8013
- finally {
8014
- this.sending = false;
8015
- this.showModal = true;
8016
- }
8017
- };
8018
- this.close = () => {
8019
- this.sending = false;
8020
- this.showModal = false;
8021
- this.showScreenshotMode = false;
8022
- this.showScreenshotTopBar = false;
8023
- this.hasSelectedElement = false;
8024
- this.encodedScreenshot = null;
8025
- this.formSuccess = false;
8026
- this.formError = false;
8027
- this.formErrorStatus = 500;
8028
- this.formMessage = '';
8029
- this.formEmail = '';
8030
- this.resetOverflow();
8031
- };
8032
- this.openScreenShot = () => {
8033
- this.hasSelectedElement = false;
8034
- this.showModal = false;
8035
- this.showScreenshotMode = true;
8036
- this.showScreenshotTopBar = true;
8037
- this.encodedScreenshot = null;
8038
- if (window.innerWidth > document.documentElement.clientWidth) {
8039
- document.documentElement.classList.add('feedback-modal-screenshot-open--scroll');
8040
- }
8041
- const scrollY = window.scrollY;
8042
- document.documentElement.style.top = `-${scrollY}px`;
8043
- window.scrollTo(0, parseInt(document.documentElement.style.top || '0') * -1);
8044
- document.documentElement.classList.add('feedback-modal-screenshot-open');
8045
- };
8046
- this.closeScreenShot = () => {
8047
- this.showModal = false;
8048
- this.showScreenshotMode = false;
8049
- this.showScreenshotTopBar = false;
8050
- this.hasSelectedElement = false;
8051
- this.encodedScreenshot = null;
8052
- this.resetOverflow();
8053
- };
8054
- this.handleMouseOverScreenShot = (event) => {
8055
- event.preventDefault();
8056
- if (this.hasSelectedElement)
8057
- return;
8058
- const borderOffset = 2;
8059
- this.screenshotModal.style.display = 'none';
8060
- const elementUnder = document.elementFromPoint(event.clientX, event.clientY);
8061
- const rect = elementUnder.getBoundingClientRect();
8062
- this.screenshotModal.style.display = '';
8063
- // Get the bounding box of the element selected
8064
- this.elementSelected.style.position = "absolute";
8065
- this.elementSelected.style.left = `${rect.left}px`;
8066
- this.elementSelected.style.top = `${rect.top}px`;
8067
- this.elementSelected.style.width = `${rect.width}px`;
8068
- this.elementSelected.style.height = `${rect.height}px`;
8069
- this.elementSelected.classList.add('feedback-modal-element-hover');
8070
- // Set the background color of nonselected areas
8071
- // Top
8072
- this.topSide.style.position = "absolute";
8073
- this.topSide.style.left = `${rect.left}px`;
8074
- this.topSide.style.top = '0px';
8075
- this.topSide.style.width = `${rect.width + borderOffset}px`;
8076
- this.topSide.style.height = `${rect.top}px`;
8077
- this.topSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8078
- // Left
8079
- this.leftSide.style.position = "absolute";
8080
- this.leftSide.style.left = '0px';
8081
- this.leftSide.style.top = '0px';
8082
- this.leftSide.style.width = `${rect.left}px`;
8083
- this.leftSide.style.height = '100vh';
8084
- this.leftSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8085
- // Bottom
8086
- this.bottomSide.style.position = "absolute";
8087
- this.bottomSide.style.left = `${rect.left}px`;
8088
- this.bottomSide.style.top = `${rect.bottom + borderOffset}px`;
8089
- this.bottomSide.style.width = `${rect.width + borderOffset}px`;
8090
- this.bottomSide.style.height = '100vh';
8091
- this.bottomSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8092
- // Right
8093
- this.rightSide.style.position = "absolute";
8094
- this.rightSide.style.left = `${rect.right + borderOffset}px`;
8095
- this.rightSide.style.top = '0px';
8096
- this.rightSide.style.width = '100%';
8097
- this.rightSide.style.height = '100vh';
8098
- this.rightSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8099
- // Restore the visibility of the screenshot-modal
8100
- this.screenshotModal.style.backgroundColor = 'transparent';
8101
- };
8102
- this.handleMouseClickedSelectedElement = async (event) => {
8103
- event.preventDefault();
8104
- if (!this.elementSelected) {
8105
- return;
8106
- }
8107
- this.hasSelectedElement = true;
8108
- this.elementSelected.classList.add('feedback-modal-element-selected');
8109
- // Get the top position including the scroll offset
8110
- const rectTop = this.elementSelected.getBoundingClientRect().top;
8111
- const topWithScroll = rectTop + window.scrollY;
8112
- // Move the element with the scroll offset
8113
- this.elementSelected.style.top = `${topWithScroll}px`;
8114
- // Clone the selected element and append it to the body
8115
- const clonedElementSelected = this.elementSelected.cloneNode(true);
8116
- document.body.appendChild(clonedElementSelected);
8117
- // Reset the top position of the original element
8118
- this.elementSelected.style.top = `${rectTop}px`;
8119
- this.showScreenshotTopBar = false;
8120
- this.showModal = false;
8121
- try {
8122
- const dataUrl = await this.captureScreenshot();
8123
- console.log('Screenshot captured');
8124
- this.encodedScreenshot = dataUrl;
8125
- }
8126
- catch (error) {
8127
- console.error('Failed to capture screenshot:', error);
8128
- this.hasSelectedElement = false;
8129
- }
8130
- finally {
8131
- // Remove the cloned element and show the modal again
8132
- document.body.removeChild(clonedElementSelected);
8133
- this.showModal = true;
8134
- }
8135
- };
8136
- this.sending = false;
8137
- this.formMessage = '';
8138
- this.formEmail = '';
8139
- this.formSuccess = false;
8140
- this.formVerification = '';
8141
- this.formError = false;
8142
- this.formErrorStatus = 500;
8143
- this.encodedScreenshot = undefined;
8144
- this.isPrivacyChecked = false;
8145
- this.whitelabel = false;
8146
- this.selectedRating = 0;
8147
- this.session = '';
8148
- this.sessionId = "";
8149
- this.errorMessage = "Please try again later.";
8150
- this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
8151
- this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
8152
- this.modalTitle = 'Share your feedback';
8153
- this.modalTitleSuccess = 'Thanks for your feedback!';
8154
- this.modalTitleError = "Oops!";
8155
- this.modalPosition = 'center';
8156
- this.sendButtonText = 'Send';
8157
- this.successMessage = "";
8158
- this.project = '';
8159
- this.screenshotButtonText = 'Add a screenshot';
8160
- this.screenshotTopbarText = 'Select an element on this page';
8161
- this.hideEmail = false;
8162
- this.emailAddress = '';
8163
- this.emailPlaceholder = 'Email address (optional)';
8164
- this.messagePlaceholder = 'Comments';
8165
- this.hideRating = false;
8166
- this.rating = undefined;
8167
- this.ratingMode = 'thumbs';
8168
- this.ratingPlaceholder = 'Was this page helpful?';
8169
- this.ratingStarsPlaceholder = 'How would you rate this page?';
8170
- this.showModal = false;
8171
- this.showScreenshotMode = false;
8172
- this.showScreenshotTopBar = false;
8173
- this.hasSelectedElement = false;
8174
- this.hideScreenshotButton = false;
8175
- this.hidePrivacyPolicy = true;
8176
- this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
8177
- this.fetchData = true;
8178
- }
8179
- componentWillLoad() {
8180
- if (this.fetchData)
8181
- this.fetchProjectData();
8182
- this.formEmail = this.emailAddress;
8183
- if (!this.sessionId) {
8184
- this.session = this.generateRandomSessionId();
8185
- }
8186
- else {
8187
- this.session = this.sessionId;
8188
- }
8189
- console.log(this.session);
8190
- if (this.rating) {
8191
- this.selectedRating = this.rating;
8192
- }
8193
- if (this.ratingMode == "thumbs" && this.rating == 0) {
8194
- this.selectedRating = 5;
8195
- }
8196
- }
8197
- async fetchProjectData() {
8198
- try {
8199
- const response = await fetch('https://app.pushfeedback.com/api/projects/' + this.project + '/');
8200
- const data = await response.json();
8201
- this.whitelabel = data.whitelabel;
8202
- }
8203
- catch (error) {
8204
- console.log(error);
8205
- }
8206
- }
8207
- generateRandomSessionId(length = 16) {
8208
- return Math.random().toString(36).substr(2, length);
8209
- }
8210
- resetOverflow() {
8211
- document.documentElement.classList.remove('feedback-modal-screenshot-open');
8212
- document.documentElement.classList.remove('feedback-modal-screenshot-open--scroll');
8213
- document.documentElement.classList.add('feedback-modal-screenshot-closing');
8214
- window.scrollTo(0, parseInt(document.documentElement.style.top || '0') * -1);
8215
- window.addEventListener('scroll', this.onScrollDebounced);
8216
- }
8217
- handleMessageInput(event) {
8218
- this.formMessage = event.target.value;
8219
- }
8220
- handleEmailInput(event) {
8221
- this.formEmail = event.target.value;
8222
- }
8223
- captureScreenshot() {
8224
- return new Promise((resolve, reject) => {
8225
- requestAnimationFrame(() => {
8226
- html2canvas(document.body, {
8227
- x: window.scrollX,
8228
- y: window.scrollY,
8229
- width: window.innerWidth,
8230
- height: window.innerHeight,
8231
- }).then(canvas => {
8232
- const dataUrl = canvas.toDataURL();
8233
- resolve(dataUrl);
8234
- })
8235
- .catch(error => {
8236
- console.error(error);
8237
- reject(error);
8238
- });
8239
- });
8240
- });
8241
- }
8242
- handleCheckboxChange(event) {
8243
- this.isPrivacyChecked = event.target.checked;
8244
- }
8245
- handleVerification(event) {
8246
- this.formVerification = event.target.value;
8247
- }
8248
- handleRatingChange(newRating) {
8249
- this.selectedRating = newRating;
8250
- }
8251
- render() {
8252
- return (index.h("div", { class: 'feedback-modal-wrapper' }, 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.showModal && (index.h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.showModal ? '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) => {
8253
- event.preventDefault();
8254
- this.handleRatingChange(1);
8255
- } }, 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) => {
8256
- event.preventDefault();
8257
- this.handleRatingChange(5);
8258
- } }, 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) => {
8259
- event.preventDefault();
8260
- this.handleRatingChange(rating);
8261
- } }, 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("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", style: { display: this.whitelabel ? 'none' : 'block' } }, index.h("div", { class: "feedback-logo" }, "Powered by ", index.h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")))))));
8262
- }
8263
- };
7973
+ const FeedbackModal = class {
7974
+ constructor(hostRef) {
7975
+ index.registerInstance(this, hostRef);
7976
+ this.onScrollDebounced = () => {
7977
+ clearTimeout(this.scrollTimeout);
7978
+ this.scrollTimeout = setTimeout(() => {
7979
+ document.documentElement.classList.remove('feedback-modal-screenshot-closing');
7980
+ document.documentElement.style.top = "";
7981
+ window.removeEventListener('scroll', this.onScrollDebounced);
7982
+ }, 200);
7983
+ };
7984
+ this.handleSubmit = async (event) => {
7985
+ event.preventDefault();
7986
+ this.resetOverflow();
7987
+ this.showScreenshotMode = false;
7988
+ this.showScreenshotTopBar = false;
7989
+ this.showModal = false;
7990
+ this.sending = true;
7991
+ try {
7992
+ const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
7993
+ method: 'POST',
7994
+ body: JSON.stringify({
7995
+ url: window.location.href,
7996
+ message: this.formMessage,
7997
+ email: this.formEmail,
7998
+ project: this.project,
7999
+ screenshot: this.encodedScreenshot,
8000
+ rating: this.selectedRating,
8001
+ ratingMode: this.ratingMode,
8002
+ verification: this.formVerification,
8003
+ session: localStorage.getItem('pushfeedback_sessionid') || '',
8004
+ }),
8005
+ headers: {
8006
+ 'Content-Type': 'application/json'
8007
+ }
8008
+ });
8009
+ if (res.status === 201) {
8010
+ this.formSuccess = true;
8011
+ this.formError = false;
8012
+ }
8013
+ else {
8014
+ this.formSuccess = false;
8015
+ this.formError = true;
8016
+ this.formErrorStatus = res.status;
8017
+ }
8018
+ }
8019
+ catch (error) {
8020
+ console.log(error);
8021
+ this.formSuccess = false;
8022
+ this.formError = true;
8023
+ this.formErrorStatus = 500;
8024
+ }
8025
+ finally {
8026
+ this.sending = false;
8027
+ this.showModal = true;
8028
+ }
8029
+ };
8030
+ this.close = () => {
8031
+ this.sending = false;
8032
+ this.showModal = false;
8033
+ this.showScreenshotMode = false;
8034
+ this.showScreenshotTopBar = false;
8035
+ this.hasSelectedElement = false;
8036
+ this.encodedScreenshot = null;
8037
+ this.formSuccess = false;
8038
+ this.formError = false;
8039
+ this.formErrorStatus = 500;
8040
+ this.formMessage = '';
8041
+ this.formEmail = '';
8042
+ this.resetOverflow();
8043
+ };
8044
+ this.openScreenShot = () => {
8045
+ this.hasSelectedElement = false;
8046
+ this.showModal = false;
8047
+ this.showScreenshotMode = true;
8048
+ this.showScreenshotTopBar = true;
8049
+ this.encodedScreenshot = null;
8050
+ if (window.innerWidth > document.documentElement.clientWidth) {
8051
+ document.documentElement.classList.add('feedback-modal-screenshot-open--scroll');
8052
+ }
8053
+ const scrollY = window.scrollY;
8054
+ document.documentElement.style.top = `-${scrollY}px`;
8055
+ window.scrollTo(0, parseInt(document.documentElement.style.top || '0') * -1);
8056
+ document.documentElement.classList.add('feedback-modal-screenshot-open');
8057
+ };
8058
+ this.closeScreenShot = () => {
8059
+ this.showModal = false;
8060
+ this.showScreenshotMode = false;
8061
+ this.showScreenshotTopBar = false;
8062
+ this.hasSelectedElement = false;
8063
+ this.encodedScreenshot = null;
8064
+ this.resetOverflow();
8065
+ };
8066
+ this.handleMouseOverScreenShot = (event) => {
8067
+ event.preventDefault();
8068
+ if (this.hasSelectedElement)
8069
+ return;
8070
+ const borderOffset = 2;
8071
+ this.screenshotModal.style.display = 'none';
8072
+ const elementUnder = document.elementFromPoint(event.clientX, event.clientY);
8073
+ const rect = elementUnder.getBoundingClientRect();
8074
+ this.screenshotModal.style.display = '';
8075
+ // Get the bounding box of the element selected
8076
+ this.elementSelected.style.position = "absolute";
8077
+ this.elementSelected.style.left = `${rect.left}px`;
8078
+ this.elementSelected.style.top = `${rect.top}px`;
8079
+ this.elementSelected.style.width = `${rect.width}px`;
8080
+ this.elementSelected.style.height = `${rect.height}px`;
8081
+ this.elementSelected.classList.add('feedback-modal-element-hover');
8082
+ // Set the background color of nonselected areas
8083
+ // Top
8084
+ this.topSide.style.position = "absolute";
8085
+ this.topSide.style.left = `${rect.left}px`;
8086
+ this.topSide.style.top = '0px';
8087
+ this.topSide.style.width = `${rect.width + borderOffset}px`;
8088
+ this.topSide.style.height = `${rect.top}px`;
8089
+ this.topSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8090
+ // Left
8091
+ this.leftSide.style.position = "absolute";
8092
+ this.leftSide.style.left = '0px';
8093
+ this.leftSide.style.top = '0px';
8094
+ this.leftSide.style.width = `${rect.left}px`;
8095
+ this.leftSide.style.height = '100vh';
8096
+ this.leftSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8097
+ // Bottom
8098
+ this.bottomSide.style.position = "absolute";
8099
+ this.bottomSide.style.left = `${rect.left}px`;
8100
+ this.bottomSide.style.top = `${rect.bottom + borderOffset}px`;
8101
+ this.bottomSide.style.width = `${rect.width + borderOffset}px`;
8102
+ this.bottomSide.style.height = '100vh';
8103
+ this.bottomSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8104
+ // Right
8105
+ this.rightSide.style.position = "absolute";
8106
+ this.rightSide.style.left = `${rect.right + borderOffset}px`;
8107
+ this.rightSide.style.top = '0px';
8108
+ this.rightSide.style.width = '100%';
8109
+ this.rightSide.style.height = '100vh';
8110
+ this.rightSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8111
+ // Restore the visibility of the screenshot-modal
8112
+ this.screenshotModal.style.backgroundColor = 'transparent';
8113
+ };
8114
+ this.handleMouseClickedSelectedElement = async (event) => {
8115
+ event.preventDefault();
8116
+ if (!this.elementSelected) {
8117
+ return;
8118
+ }
8119
+ this.hasSelectedElement = true;
8120
+ this.elementSelected.classList.add('feedback-modal-element-selected');
8121
+ // Get the top position including the scroll offset
8122
+ const rectTop = this.elementSelected.getBoundingClientRect().top;
8123
+ const topWithScroll = rectTop + window.scrollY;
8124
+ // Move the element with the scroll offset
8125
+ this.elementSelected.style.top = `${topWithScroll}px`;
8126
+ // Clone the selected element and append it to the body
8127
+ const clonedElementSelected = this.elementSelected.cloneNode(true);
8128
+ document.body.appendChild(clonedElementSelected);
8129
+ // Reset the top position of the original element
8130
+ this.elementSelected.style.top = `${rectTop}px`;
8131
+ this.showScreenshotTopBar = false;
8132
+ this.showModal = false;
8133
+ try {
8134
+ const dataUrl = await this.captureScreenshot();
8135
+ console.log('Screenshot captured');
8136
+ this.encodedScreenshot = dataUrl;
8137
+ }
8138
+ catch (error) {
8139
+ console.error('Failed to capture screenshot:', error);
8140
+ this.hasSelectedElement = false;
8141
+ }
8142
+ finally {
8143
+ // Remove the cloned element and show the modal again
8144
+ document.body.removeChild(clonedElementSelected);
8145
+ this.showModal = true;
8146
+ }
8147
+ };
8148
+ this.sending = false;
8149
+ this.formMessage = '';
8150
+ this.formEmail = '';
8151
+ this.formSuccess = false;
8152
+ this.formVerification = '';
8153
+ this.formError = false;
8154
+ this.formErrorStatus = 500;
8155
+ this.encodedScreenshot = undefined;
8156
+ this.isPrivacyChecked = false;
8157
+ this.whitelabel = false;
8158
+ this.selectedRating = 0;
8159
+ this.errorMessage = "Please try again later.";
8160
+ this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
8161
+ this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
8162
+ this.modalTitle = 'Share your feedback';
8163
+ this.modalTitleSuccess = 'Thanks for your feedback!';
8164
+ this.modalTitleError = "Oops!";
8165
+ this.modalPosition = 'center';
8166
+ this.sendButtonText = 'Send';
8167
+ this.successMessage = "";
8168
+ this.project = '';
8169
+ this.screenshotButtonText = 'Add a screenshot';
8170
+ this.screenshotTopbarText = 'Select an element on this page';
8171
+ this.hideEmail = false;
8172
+ this.emailAddress = '';
8173
+ this.emailPlaceholder = 'Email address (optional)';
8174
+ this.messagePlaceholder = 'Comments';
8175
+ this.hideRating = false;
8176
+ this.rating = undefined;
8177
+ this.ratingMode = 'thumbs';
8178
+ this.ratingPlaceholder = 'Was this page helpful?';
8179
+ this.ratingStarsPlaceholder = 'How would you rate this page?';
8180
+ this.showModal = false;
8181
+ this.showScreenshotMode = false;
8182
+ this.showScreenshotTopBar = false;
8183
+ this.hasSelectedElement = false;
8184
+ this.hideScreenshotButton = false;
8185
+ this.hidePrivacyPolicy = true;
8186
+ this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
8187
+ this.fetchData = true;
8188
+ }
8189
+ componentWillLoad() {
8190
+ if (this.fetchData)
8191
+ this.fetchProjectData();
8192
+ this.formEmail = this.emailAddress;
8193
+ if (this.rating) {
8194
+ this.selectedRating = this.rating;
8195
+ }
8196
+ if (this.ratingMode == "thumbs" && this.rating == 0) {
8197
+ this.selectedRating = 5;
8198
+ }
8199
+ }
8200
+ async fetchProjectData() {
8201
+ try {
8202
+ const response = await fetch('https://app.pushfeedback.com/api/projects/' + this.project + '/');
8203
+ const data = await response.json();
8204
+ this.whitelabel = data.whitelabel;
8205
+ }
8206
+ catch (error) {
8207
+ console.log(error);
8208
+ }
8209
+ }
8210
+ resetOverflow() {
8211
+ document.documentElement.classList.remove('feedback-modal-screenshot-open');
8212
+ document.documentElement.classList.remove('feedback-modal-screenshot-open--scroll');
8213
+ document.documentElement.classList.add('feedback-modal-screenshot-closing');
8214
+ window.scrollTo(0, parseInt(document.documentElement.style.top || '0') * -1);
8215
+ window.addEventListener('scroll', this.onScrollDebounced);
8216
+ }
8217
+ handleMessageInput(event) {
8218
+ this.formMessage = event.target.value;
8219
+ }
8220
+ handleEmailInput(event) {
8221
+ this.formEmail = event.target.value;
8222
+ }
8223
+ captureScreenshot() {
8224
+ return new Promise((resolve, reject) => {
8225
+ requestAnimationFrame(() => {
8226
+ html2canvas(document.body, {
8227
+ x: window.scrollX,
8228
+ y: window.scrollY,
8229
+ width: window.innerWidth,
8230
+ height: window.innerHeight,
8231
+ }).then(canvas => {
8232
+ const dataUrl = canvas.toDataURL();
8233
+ resolve(dataUrl);
8234
+ })
8235
+ .catch(error => {
8236
+ console.error(error);
8237
+ reject(error);
8238
+ });
8239
+ });
8240
+ });
8241
+ }
8242
+ handleCheckboxChange(event) {
8243
+ this.isPrivacyChecked = event.target.checked;
8244
+ }
8245
+ handleVerification(event) {
8246
+ this.formVerification = event.target.value;
8247
+ }
8248
+ handleRatingChange(newRating) {
8249
+ this.selectedRating = newRating;
8250
+ }
8251
+ render() {
8252
+ return (index.h("div", { class: 'feedback-modal-wrapper' }, 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.showModal && (index.h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.showModal ? '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) => {
8253
+ event.preventDefault();
8254
+ this.handleRatingChange(1);
8255
+ } }, 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) => {
8256
+ event.preventDefault();
8257
+ this.handleRatingChange(5);
8258
+ } }, 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) => {
8259
+ event.preventDefault();
8260
+ this.handleRatingChange(rating);
8261
+ } }, 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("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", style: { display: this.whitelabel ? 'none' : 'block' } }, index.h("div", { class: "feedback-logo" }, "Powered by ", index.h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")))))));
8262
+ }
8263
+ };
8264
8264
  FeedbackModal.style = feedbackModalCss;
8265
8265
 
8266
8266
  exports.feedback_button = FeedbackButton;