'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-fa857a86.js');

class Review {
    constructor() {
        this.like = '';
        this.dislike = '';
        this.rating = 0;
        this.date = null;
    }
}
////////////////////////////////////////////////////////////////
// Enumerations
////////////////////////////////////////////////////////////////
var LeavingReviewMode;
(function (LeavingReviewMode) {
    LeavingReviewMode["EXIT_TOUR"] = "exitTour";
    LeavingReviewMode["CONTINUE"] = "continue";
    LeavingReviewMode["END_TOUR"] = "endTour";
})(LeavingReviewMode || (LeavingReviewMode = {}));

const feedbackReviewContentCss = "@-webkit-keyframes fade{0%{opacity:0}100%{opacity:1}}@keyframes fade{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes corner-expand{0%{width:0;opacity:0}100%{width:20px;opacity:1}}@keyframes corner-expand{0%{width:0;opacity:0}100%{width:20px;opacity:1}}@-webkit-keyframes slide-right{0%{opacity:0;-webkit-transform:translateX(-200px);transform:translateX(-200px)}}@keyframes slide-right{0%{opacity:0;-webkit-transform:translateX(-200px);transform:translateX(-200px)}}@keyframes bounce2{0%,20%,50%,80%,100%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-20px);transform:translateY(-20px)}60%{-webkit-transform:translateY(-10px);transform:translateY(-10px)}}@-webkit-keyframes bounce2{0%,20%,50%,80%,100%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-20px);transform:translateY(-20px)}60%{-webkit-transform:translateY(-10px);transform:translateY(-10px)}}@-webkit-keyframes heartbeat{from{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:center center;transform-origin:center center;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}8%{-webkit-transform:scale(0.94);transform:scale(0.94);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}14%{-webkit-transform:scale(0.98);transform:scale(0.98);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}28%{-webkit-transform:scale(0.92);transform:scale(0.92);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}40%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes heartbeat{from{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:center center;transform-origin:center center;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}8%{-webkit-transform:scale(0.94);transform:scale(0.94);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}14%{-webkit-transform:scale(0.98);transform:scale(0.98);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}28%{-webkit-transform:scale(0.92);transform:scale(0.92);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}40%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}:root{--ion-color-primary:#00b7b3;--ion-color-primary-rgb:0, 183, 179;--ion-color-primary-contrast:#ffffff;--ion-color-primary-contrast-rgb:255, 255, 255;--ion-color-primary-shade:#00a19e;--ion-color-primary-tint:#1abebb;--ion-color-secondary:#00B1D0;--ion-color-secondary-rgb:0, 177, 208;--ion-color-secondary-contrast:#ffffff;--ion-color-secondary-contrast-rgb:255, 255, 255;--ion-color-secondary-shade:#009cb7;--ion-color-secondary-tint:#1ab9d5;--ion-color-tertiary:#3b3f3f;--ion-color-tertiary-rgb:76, 110, 121;--ion-color-tertiary-contrast:#ffffff;--ion-color-tertiary-contrast-rgb:255, 255, 255;--ion-color-tertiary-shade:#343737;--ion-color-tertiary-tint:#4f5252;--ion-color-success:#10dc60;--ion-color-success-rgb:16, 220, 96;--ion-color-success-contrast:#fff;--ion-color-success-contrast-rgb:255, 255, 255;--ion-color-success-shade:#0ec254;--ion-color-success-tint:#28e070;--ion-color-warning:#ffce00;--ion-color-warning-rgb:255, 206, 0;--ion-color-warning-contrast:#000;--ion-color-warning-contrast-rgb:0, 0, 0;--ion-color-warning-shade:#e0b500;--ion-color-warning-tint:#ffd31a;--ion-color-danger:#f53d3d;--ion-color-danger-rgb:245, 61, 61;--ion-color-danger-contrast:#fff;--ion-color-danger-contrast-rgb:255, 255, 255;--ion-color-danger-shade:#d83636;--ion-color-danger-tint:#f65050;--ion-color-light:#fdfdfd;--ion-color-light-rgb:244, 244, 244;--ion-color-light-contrast:#000;--ion-color-light-contrast-rgb:0, 0, 0;--ion-color-light-shade:#d7d7d7;--ion-color-light-tint:#f5f5f5;--ion-color-medium:#989aa2;--ion-color-medium-rgb:152, 154, 162;--ion-color-medium-contrast:#000;--ion-color-medium-contrast-rgb:0, 0, 0;--ion-color-medium-shade:#86888f;--ion-color-medium-tint:#a2a4ab;--ion-color-dark:#222;--ion-color-dark-rgb:34, 34, 34;--ion-color-dark-contrast:#fff;--ion-color-dark-contrast-rgb:255, 255, 255;--ion-color-dark-shade:#1e1e1e;--ion-color-dark-tint:#383838;--ion-color-mainPlaces:#c06457;--ion-color-mainPlaces-rgb:192, 100, 87;--ion-color-mainPlaces-contrast:#ffffff;--ion-color-mainPlaces-contrast-rgb:255, 255, 255;--ion-color-mainPlaces-shade:#a9584d;--ion-color-mainPlaces-tint:#c67468;--ion-color-aroundPlaces:#222;--ion-color-aroundPlaces-rgb:34, 34, 34;--ion-color-aroundPlaces-contrast:#fff;--ion-color-aroundPlaces-contrast-rgb:255, 255, 255;--ion-color-aroundPlaces-shade:#1e1e1e;--ion-color-aroundPlaces-tint:#383838;--ion-toolbar-md-background-color:var(--ion-color-primary);--ion-toolbar-md-text-color:#fff;--ion-color-gold:#b9b029}body{margin:0px !important;padding:0px;font-family:\"Raleway\", serif}.hidden{opacity:0}.heartbeat-button{-webkit-animation:heartbeat 1.5s ease-in-out infinite both;animation:heartbeat 1.5s ease-in-out infinite both}p,h1,h2,h3,h4,h5,h6{font-family:\"Nunito\", serif}.title{text-transform:uppercase;font-size:1.2em;font-weight:600}@keyframes fade{0%{opacity:0}100%{opacity:1}}@keyframes corner-expand{0%{width:0;opacity:0}100%{width:20px;opacity:1}}@keyframes slide-right{0%{opacity:0;-webkit-transform:translateX(-200px);transform:translateX(-200px)}}@keyframes bounce2{0%,20%,50%,80%,100%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-20px);transform:translateY(-20px)}60%{-webkit-transform:translateY(-10px);transform:translateY(-10px)}}@-webkit-keyframes bounce2{0%,20%,50%,80%,100%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-20px);transform:translateY(-20px)}60%{-webkit-transform:translateY(-10px);transform:translateY(-10px)}}@-webkit-keyframes heartbeat{from{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:center center;transform-origin:center center;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}8%{-webkit-transform:scale(0.94);transform:scale(0.94);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}14%{-webkit-transform:scale(0.98);transform:scale(0.98);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}28%{-webkit-transform:scale(0.92);transform:scale(0.92);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}40%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes heartbeat{from{-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:center center;transform-origin:center center;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}8%{-webkit-transform:scale(0.94);transform:scale(0.94);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}14%{-webkit-transform:scale(0.98);transform:scale(0.98);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}28%{-webkit-transform:scale(0.92);transform:scale(0.92);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}40%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}:root{--ion-color-primary:#00b7b3;--ion-color-primary-rgb:0, 183, 179;--ion-color-primary-contrast:#ffffff;--ion-color-primary-contrast-rgb:255, 255, 255;--ion-color-primary-shade:#00a19e;--ion-color-primary-tint:#1abebb;--ion-color-secondary:#00B1D0;--ion-color-secondary-rgb:0, 177, 208;--ion-color-secondary-contrast:#ffffff;--ion-color-secondary-contrast-rgb:255, 255, 255;--ion-color-secondary-shade:#009cb7;--ion-color-secondary-tint:#1ab9d5;--ion-color-tertiary:#3b3f3f;--ion-color-tertiary-rgb:76, 110, 121;--ion-color-tertiary-contrast:#ffffff;--ion-color-tertiary-contrast-rgb:255, 255, 255;--ion-color-tertiary-shade:#343737;--ion-color-tertiary-tint:#4f5252;--ion-color-success:#10dc60;--ion-color-success-rgb:16, 220, 96;--ion-color-success-contrast:#fff;--ion-color-success-contrast-rgb:255, 255, 255;--ion-color-success-shade:#0ec254;--ion-color-success-tint:#28e070;--ion-color-warning:#ffce00;--ion-color-warning-rgb:255, 206, 0;--ion-color-warning-contrast:#000;--ion-color-warning-contrast-rgb:0, 0, 0;--ion-color-warning-shade:#e0b500;--ion-color-warning-tint:#ffd31a;--ion-color-danger:#f53d3d;--ion-color-danger-rgb:245, 61, 61;--ion-color-danger-contrast:#fff;--ion-color-danger-contrast-rgb:255, 255, 255;--ion-color-danger-shade:#d83636;--ion-color-danger-tint:#f65050;--ion-color-light:#fdfdfd;--ion-color-light-rgb:244, 244, 244;--ion-color-light-contrast:#000;--ion-color-light-contrast-rgb:0, 0, 0;--ion-color-light-shade:#d7d7d7;--ion-color-light-tint:#f5f5f5;--ion-color-medium:#989aa2;--ion-color-medium-rgb:152, 154, 162;--ion-color-medium-contrast:#000;--ion-color-medium-contrast-rgb:0, 0, 0;--ion-color-medium-shade:#86888f;--ion-color-medium-tint:#a2a4ab;--ion-color-dark:#222;--ion-color-dark-rgb:34, 34, 34;--ion-color-dark-contrast:#fff;--ion-color-dark-contrast-rgb:255, 255, 255;--ion-color-dark-shade:#1e1e1e;--ion-color-dark-tint:#383838;--ion-color-mainPlaces:#c06457;--ion-color-mainPlaces-rgb:192, 100, 87;--ion-color-mainPlaces-contrast:#ffffff;--ion-color-mainPlaces-contrast-rgb:255, 255, 255;--ion-color-mainPlaces-shade:#a9584d;--ion-color-mainPlaces-tint:#c67468;--ion-color-aroundPlaces:#222;--ion-color-aroundPlaces-rgb:34, 34, 34;--ion-color-aroundPlaces-contrast:#fff;--ion-color-aroundPlaces-contrast-rgb:255, 255, 255;--ion-color-aroundPlaces-shade:#1e1e1e;--ion-color-aroundPlaces-tint:#383838;--ion-toolbar-md-background-color:var(--ion-color-primary);--ion-toolbar-md-text-color:#fff;--ion-color-gold:#b9b029}body{margin:0px !important;padding:0px;font-family:\"Raleway\", serif}.hidden{opacity:0}.heartbeat-button{-webkit-animation:heartbeat 1.5s ease-in-out infinite both;animation:heartbeat 1.5s ease-in-out infinite both}p,h1,h2,h3,h4,h5,h6{font-family:\"Nunito\", serif}.title{text-transform:uppercase;font-size:1.2em;font-weight:600}feedback-review-content{width:calc(100% - 32px)}feedback-review-content .main-review-container{min-height:300px;padding:0px 0px 0px 16px;border-radius:8px}feedback-review-content .main-review-container .form-list{background:transparent;margin-bottom:0px;--ion-item-background-color:transparent}feedback-review-content .main-review-container .form-list .list-item{--background:transparent}feedback-review-content .main-review-container .form-list .list-item .like-label{font-size:1em}feedback-review-content .main-review-container .form-list .form-label{font-family:\"Caveat\", serif;font-size:1.4em}feedback-review-content .message-text{font-family:\"Caveat\", serif;margin:16px;font-size:1.6em;text-align:center}feedback-review-content .buttons-container{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;margin:32px 16px 0 0}feedback-review-content .buttons-container .form-button{margin-bottom:16px;font-size:1.3em;font-family:\"Caveat\", serif}feedback-review-content .light-background-mode{background-color:var(--ion-color-light)}feedback-review-content .color-background-mode{background-color:var(--ion-color-secondary)}feedback-review-content .light-item-mode{--highlight-color-focused:var(--ion-color-secondary);--highlight-color-active:var(--ion-color-secondary);--highlight-color-invalid:var(--ion-color-secondary)}feedback-review-content .color-item-mode{--highlight-color-focused:var(--ion-color-light);--highlight-color-active:var(--ion-color-light);--highlight-color-invalid:var(--ion-color-light)}feedback-review-content .message-thanks-container{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}feedback-review-content .message-thanks-container .message-thanks-text{font-family:\"Caveat\", serif;font-size:1.5em;margin:16px;text-align:center}";

const FeedbackReviewContent = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.onSubmit = index.createEvent(this, "onSubmit", 7);
        this.message = "Thank you for leaving us a feedback. This is very important to us.";
        this.messageOfThanks = 'Thank you for your feedback! ❤';
        this.showMessageOfThanks = true;
        this.showSkipButton = false;
        this.showCancelButton = false;
        this.lightMode = false;
        // States
        this.review = new Review();
        this.submitted = false;
    }
    ////////////////////////////////////////////////////////////////
    // User interactions
    ////////////////////////////////////////////////////////////////
    /**
     * The user submits the form
     * @param e
     */
    handleSubmit(e) {
        e.preventDefault();
        this.review.date = new Date();
        this.review.group = this.group;
        this.onSubmit.emit(this.review);
        this.submitted = true;
    }
    /**
     * The user cancels or skips the form
     * @param e
     */
    handleCancel(e) {
        e.preventDefault();
        this.onSubmit.emit(null);
    }
    /**
     * The rating has changed
     * @param event
     */
    handleRatingChange(event) {
        this.review.rating = event.detail;
    }
    /**
     * The like comment has changed
     * @param event
     */
    handleLikeChange(event) {
        this.review.like = event.target.value;
    }
    /**
     * The dislike comment has changed
     * @param event
     */
    handleDislikeChange(event) {
        this.review.dislike = event.target.value;
    }
    /**
     * The comment has changed
     * @param event
     */
    handleCommentChange(event) {
        this.review.comment = event.target.value;
    }
    ////////////////////////////////////////////////////////////////
    // Render
    ////////////////////////////////////////////////////////////////
    renderMessageOfThanks() {
        return (index.h("div", { class: "message-thanks-container" }, index.h("ion-text", { color: this.lightMode ? 'tertiary' : 'light' }, index.h("p", { class: "message-thanks-text" }, this.messageOfThanks))));
    }
    render() {
        return (index.h("div", { class: 'main-review-container ' + (this.lightMode ? 'light-background-mode' : 'color-background-mode') }, this.submitted
            ? index.h("span", null, this.renderMessageOfThanks())
            : index.h("div", null, index.h("ion-list", { class: "form-list" }, index.h("form", { onSubmit: (e) => this.handleSubmit(e) }, index.h("ion-text", { color: this.lightMode ? 'tertiary' : 'light' }, index.h("p", { class: "message-text" }, this.message)), index.h("star-rating", { light: !this.lightMode, onRatingChanged: (e) => this.handleRatingChange(e) }), !this.commentOnly &&
                index.h("ion-item", { class: "list-item" }, index.h("ion-label", { class: 'form-label', color: this.lightMode ? 'tertiary' : 'light', position: "floating" }, this.positiveCommentLabel), index.h("ion-textarea", { color: this.lightMode ? 'dark' : 'light', rows: 3, value: this.review.like, onInput: (event) => this.handleLikeChange(event) })), !this.commentOnly &&
                index.h("ion-item", { class: "list-item" }, index.h("ion-label", { class: 'form-label', color: this.lightMode ? 'tertiary' : 'light', position: "floating" }, this.negativeCommentLabel), index.h("ion-textarea", { color: this.lightMode ? 'dark' : 'light', rows: 3, value: this.review.dislike, onInput: (event) => this.handleDislikeChange(event) })), this.commentOnly &&
                index.h("ion-item", { class: "list-item" }, index.h("ion-label", { class: 'form-label', color: this.lightMode ? 'tertiary' : 'light', position: "floating" }, this.neutralCommentLabel), index.h("ion-textarea", { color: this.lightMode ? 'dark' : 'light', rows: 3, value: this.review.comment, onInput: (event) => this.handleCommentChange(event) })))), index.h("div", { class: "buttons-container" }, this.showCancelButton &&
                index.h("ion-button", { color: this.lightMode ? 'secondary' : 'light', size: "default", fill: "clear", type: "submit", class: "form-button", onClick: (e) => this.handleCancel(e) }, this.cancelButton), this.showSkipButton &&
                index.h("ion-button", { color: this.lightMode ? 'secondary' : 'light', size: "default", fill: "clear", type: "submit", class: "form-button", onClick: (e) => this.handleCancel(e) }, this.skipButton), index.h("ion-button", { color: this.lightMode ? 'secondary' : 'light', size: "default", type: "submit", class: "form-button", onClick: (e) => this.handleSubmit(e) }, this.submitButton)))));
    }
};
FeedbackReviewContent.style = feedbackReviewContentCss;

exports.feedback_review_content = FeedbackReviewContent;
