"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    renderFeedbackAndCopyButtons: ()=>renderFeedbackAndCopyButtons
});
const external_lit_namespaceObject = require("lit");
const class_map_js_namespaceObject = require("lit/directives/class-map.js");
const when_js_namespaceObject = require("lit/directives/when.js");
const external_copy_button_cjs_namespaceObject = require("./copy-button.cjs");
const external_feedback_button_cjs_namespaceObject = require("./feedback-button.cjs");
const external_generated_answer_utils_cjs_namespaceObject = require("./generated-answer-utils.cjs");
const renderFeedbackAndCopyButtons = ({ props })=>{
    const { i18n, generatedAnswerActionsState, copied, copyError, getCopyToClipboardTooltip, onClickLike, onClickDislike, onCopyToClipboard } = props;
    const { liked, disliked, answer, isStreaming, isLoading } = generatedAnswerActionsState ?? {};
    const shouldShowButtons = !!answer && !isStreaming && !isLoading;
    return (0, external_lit_namespaceObject.html)`${(0, when_js_namespaceObject.when)(shouldShowButtons, ()=>(0, external_lit_namespaceObject.html)`
      <div
        class="${(0, class_map_js_namespaceObject.classMap)({
            'feedback-buttons flex h-9 items-center shrink-0 gap-2': true
        })}"
      >
        ${(0, external_feedback_button_cjs_namespaceObject.renderFeedbackButton)({
            props: {
                title: i18n.t('this-answer-was-helpful'),
                variant: 'like',
                active: !!liked,
                onClick: onClickLike
            }
        })}
        ${(0, external_feedback_button_cjs_namespaceObject.renderFeedbackButton)({
            props: {
                title: i18n.t('this-answer-was-not-helpful'),
                variant: 'dislike',
                active: !!disliked,
                onClick: onClickDislike
            }
        })}
        ${(0, external_generated_answer_utils_cjs_namespaceObject.hasClipboardSupport)() ? (0, external_copy_button_cjs_namespaceObject.renderCopyButton)({
            props: {
                title: getCopyToClipboardTooltip(),
                isCopied: copied,
                error: copyError,
                onClick: async ()=>{
                    if (answer) await onCopyToClipboard(answer);
                }
            }
        }) : external_lit_namespaceObject.nothing}
      </div>
    `)}`;
};
exports.renderFeedbackAndCopyButtons = __webpack_exports__.renderFeedbackAndCopyButtons;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "renderFeedbackAndCopyButtons"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
