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