UNPKG

@empathyco/x-components

Version:
184 lines (181 loc) • 6.93 kB
import _sfc_main from './ai-overview.vue2.js'; import { resolveComponent, resolveDirective, openBlock, createBlock, withCtx, withDirectives, createElementVNode, normalizeClass, createVNode, createElementBlock, createTextVNode, toDisplayString, Fragment, renderList, normalizeStyle, renderSlot, createCommentVNode, vShow } from 'vue'; import './ai-overview.vue3.js'; import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js'; const _hoisted_1 = { class: "x-ai-overview-main" }; const _hoisted_2 = { key: 0, class: "x-ai-overview-title-loading", "data-test": "ai-overview-title-loading" }; const _hoisted_3 = /* @__PURE__ */ createElementVNode( "span", { class: "x-ai-overview-title-loading-indicator" }, null, -1 /* HOISTED */ ); const _hoisted_4 = { class: "x-ai-overview-title-loading-text", "data-test": "ai-overview-title-loading-text" }; const _hoisted_5 = { key: 1, class: "x-ai-overview-title", "data-test": "ai-overview-title" }; const _hoisted_6 = { key: 0, class: "x-ai-overview-loading-content", "data-test": "ai-overview-loading-content" }; const _hoisted_7 = { key: 1, class: "x-ai-overview-content", "data-test": "ai-overview-content" }; const _hoisted_8 = { "data-test": "ai-overview-slot" }; const _hoisted_9 = { class: "x-ai-overview-expand-wrapper" }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_AIStarIcon = resolveComponent("AIStarIcon"); const _component_Fade = resolveComponent("Fade"); const _component_ChangeHeight = resolveComponent("ChangeHeight"); const _component_AiQuestionResults = resolveComponent("AiQuestionResults"); const _component_CollapseHeight = resolveComponent("CollapseHeight"); const _component_ChevronDownIcon = resolveComponent("ChevronDownIcon"); const _directive_typing = resolveDirective("typing"); return openBlock(), createBlock(_component_CollapseHeight, null, { default: withCtx(() => [ withDirectives(createElementVNode( "div", { class: normalizeClass(["x-ai-overview", { "x-ai-overview--expanded": _ctx.expanded, "x-ai-overview--loading": _ctx.loading }]) }, [ createElementVNode("div", _hoisted_1, [ createVNode(_component_Fade, { mode: "out-in" }, { default: withCtx(() => [ _ctx.loading ? (openBlock(), createElementBlock("span", _hoisted_2, [ _hoisted_3, withDirectives(createElementVNode( "span", _hoisted_4, null, 512 /* NEED_PATCH */ ), [ [_directive_typing, { text: _ctx.titleLoading, speed: 50 }] ]) ])) : (openBlock(), createElementBlock("span", _hoisted_5, [ createVNode(_component_AIStarIcon, { class: "x-ai-overview-title-icon" }), createTextVNode( toDisplayString(_ctx.title), 1 /* TEXT */ ) ])) ]), _: 1 /* STABLE */ }), createVNode(_component_ChangeHeight, null, { default: withCtx(() => [ _ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_6, [ (openBlock(), createElementBlock( Fragment, null, renderList(4, (i) => { return createElementVNode("span", { key: i }); }), 64 /* STABLE_FRAGMENT */ )) ])) : (openBlock(), createElementBlock("div", _hoisted_7, [ createElementVNode( "span", null, toDisplayString(_ctx.question?.suggestionText), 1 /* TEXT */ ), createElementVNode( "p", null, toDisplayString(_ctx.question?.content.responseText), 1 /* TEXT */ ) ])) ]), _: 1 /* STABLE */ }) ]), _ctx.question?.content.searchQueries.length ? (openBlock(), createBlock(_component_CollapseHeight, { key: 0, style: normalizeStyle({ "--x-collapse-height-transition-duration": `${300 * _ctx.question.content.searchQueries.length}ms` }) }, { default: withCtx(() => [ withDirectives(createElementVNode( "div", _hoisted_8, [ renderSlot(_ctx.$slots, "default", { question: _ctx.question }, () => [ _ctx.question ? (openBlock(), createBlock(_component_AiQuestionResults, { key: 0, question: _ctx.question }, null, 8, ["question"])) : createCommentVNode("v-if", true) ]) ], 512 /* NEED_PATCH */ ), [ [vShow, _ctx.expanded] ]) ]), _: 3 /* FORWARDED */ }, 8, ["style"])) : createCommentVNode("v-if", true), !_ctx.loading && !_ctx.expanded ? (openBlock(), createElementBlock( Fragment, { key: 1 }, [ createElementVNode("div", { class: "x-ai-overview-gradient", "data-test": "ai-overview-gradient", onClick: _cache[0] || (_cache[0] = (...args) => _ctx.open && _ctx.open(...args)) }), createElementVNode("div", _hoisted_9, [ createElementVNode("button", { class: "x-ai-overview-expand-btn", "data-test": "ai-overview-expand-btn", onClick: _cache[1] || (_cache[1] = (...args) => _ctx.open && _ctx.open(...args)) }, [ createTextVNode( toDisplayString(_ctx.buttonText) + " ", 1 /* TEXT */ ), createVNode(_component_ChevronDownIcon, { class: "x-ai-overview-expand-btn-icon" }) ]) ]) ], 64 /* STABLE_FRAGMENT */ )) : createCommentVNode("v-if", true) ], 2 /* CLASS */ ), [ [vShow, _ctx.loading || _ctx.question] ]) ]), _: 3 /* FORWARDED */ }); } var aiOverview = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); export { aiOverview as default }; //# sourceMappingURL=ai-overview.vue.js.map