@progress/kendo-vue-conversational-ui 7.0.0-develop.3 → 7.0.0-develop.4

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.
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),c=require("./AIPromptHeader.js"),m=require("./views/AIPromptView.js"),u=require("./views/AIPromptOutputView.js"),i=require("@progress/kendo-vue-common"),p=o.defineComponent({name:"KendoAIPrompt",props:{activeView:{type:String,required:!0},dir:String,toolbarItems:Array,outputs:Array,promptPlaceholder:String},provide(){return{kendoAIPrompt:this.$data.contextState}},data(){return{contextState:{activeView:this.$props.activeView,onActiveViewChange:this.onActiveViewChange,onPromptRequest:this.onPromptRequest,onCommandExecute:this.onCommandExecute,onStateAction:this.onStateAction}}},watch:{activeView(t){this.contextState.activeView=t}},methods:{onStateAction(t){this.contextState.activeView=t.activeView},onActiveViewChange(t){this.$emit("activeviewchange",t)},onPromptRequest(t,e){this.$emit("promptrequest",t,e)},onCommandExecute(t){this.$emit("commandexecute",t)}},render(){const t=i.getDefaultSlots(this),{toolbarItems:e,dir:r}=this.$props,a=(e||[m.promptViewDefaults,u.outputViewDefaults]).map(n=>{const s=i.templateRendering.call(this,n.content,i.getListeners.call(this));return{...n,content:s}});return o.createVNode("div",{class:"k-prompt",dir:r},[o.createVNode(c.AIPromptHeader,{activeView:this.contextState.activeView,toolbarItems:a,onActiveviewchange:this.onActiveViewChange},null),t])}});exports.AIPrompt=p;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),m=require("./AIPromptHeader.js"),a=require("./views/constants.js"),i=require("@progress/kendo-vue-common"),p=o.defineComponent({name:"KendoAIPrompt",props:{activeView:{type:String,required:!0},dir:String,toolbarItems:Array,outputs:Array,promptPlaceholder:String,streaming:Boolean,loading:Boolean},provide(){return{kendoAIPrompt:this.$data.contextState}},data(){return{contextState:{activeView:this.$props.activeView,streaming:this.$props.streaming,loading:this.$props.loading,onCancel:this.onCancel,onActiveViewChange:this.onActiveViewChange,onPromptRequest:this.onPromptRequest,onCommandExecute:this.onCommandExecute,onStateAction:this.onStateAction}}},watch:{activeView(t){this.contextState.activeView=t},streaming(t){this.contextState.streaming=t},loading(t){this.contextState.loading=t}},methods:{onStateAction(t){this.contextState.activeView=t.activeView},onActiveViewChange(t){this.$emit("activeviewchange",t)},onPromptRequest(t,e){this.$emit("promptrequest",t,e)},onCommandExecute(t){this.$emit("commandexecute",t)},onCancel(){this.$emit("cancel")}},render(){const t=i.getDefaultSlots(this),{toolbarItems:e,dir:r}=this.$props,s=(e||[a.promptViewDefaults,a.outputViewDefaults]).map(n=>{const c=i.templateRendering.call(this,n.content,i.getListeners.call(this));return{...n,content:c}});return o.createVNode("div",{class:"k-prompt",dir:r},[o.createVNode(m.AIPromptHeader,{activeView:this.contextState.activeView,toolbarItems:s,onActiveviewchange:this.onActiveViewChange},null),t])}});exports.AIPrompt=p;
@@ -7,10 +7,9 @@
7
7
  */
8
8
  import { defineComponent as s, createVNode as i } from "vue";
9
9
  import { AIPromptHeader as c } from "./AIPromptHeader.mjs";
10
- import { promptViewDefaults as m } from "./views/AIPromptView.mjs";
11
- import { outputViewDefaults as p } from "./views/AIPromptOutputView.mjs";
12
- import { getDefaultSlots as h, templateRendering as u, getListeners as d } from "@progress/kendo-vue-common";
13
- const g = /* @__PURE__ */ s({
10
+ import { promptViewDefaults as m, outputViewDefaults as p } from "./views/constants.mjs";
11
+ import { getDefaultSlots as h, templateRendering as l, getListeners as d } from "@progress/kendo-vue-common";
12
+ const V = /* @__PURE__ */ s({
14
13
  name: "KendoAIPrompt",
15
14
  props: {
16
15
  activeView: {
@@ -20,7 +19,9 @@ const g = /* @__PURE__ */ s({
20
19
  dir: String,
21
20
  toolbarItems: Array,
22
21
  outputs: Array,
23
- promptPlaceholder: String
22
+ promptPlaceholder: String,
23
+ streaming: Boolean,
24
+ loading: Boolean
24
25
  },
25
26
  provide() {
26
27
  return {
@@ -31,6 +32,9 @@ const g = /* @__PURE__ */ s({
31
32
  return {
32
33
  contextState: {
33
34
  activeView: this.$props.activeView,
35
+ streaming: this.$props.streaming,
36
+ loading: this.$props.loading,
37
+ onCancel: this.onCancel,
34
38
  onActiveViewChange: this.onActiveViewChange,
35
39
  onPromptRequest: this.onPromptRequest,
36
40
  onCommandExecute: this.onCommandExecute,
@@ -41,6 +45,12 @@ const g = /* @__PURE__ */ s({
41
45
  watch: {
42
46
  activeView(t) {
43
47
  this.contextState.activeView = t;
48
+ },
49
+ streaming(t) {
50
+ this.contextState.streaming = t;
51
+ },
52
+ loading(t) {
53
+ this.contextState.loading = t;
44
54
  }
45
55
  },
46
56
  methods: {
@@ -55,17 +65,20 @@ const g = /* @__PURE__ */ s({
55
65
  },
56
66
  onCommandExecute(t) {
57
67
  this.$emit("commandexecute", t);
68
+ },
69
+ onCancel() {
70
+ this.$emit("cancel");
58
71
  }
59
72
  },
60
73
  render() {
61
74
  const t = h(this), {
62
75
  toolbarItems: e,
63
76
  dir: n
64
- } = this.$props, r = (e || [m, p]).map((o) => {
65
- const a = u.call(this, o.content, d.call(this));
77
+ } = this.$props, a = (e || [m, p]).map((o) => {
78
+ const r = l.call(this, o.content, d.call(this));
66
79
  return {
67
80
  ...o,
68
- content: a
81
+ content: r
69
82
  };
70
83
  });
71
84
  return i("div", {
@@ -73,11 +86,11 @@ const g = /* @__PURE__ */ s({
73
86
  dir: n
74
87
  }, [i(c, {
75
88
  activeView: this.contextState.activeView,
76
- toolbarItems: r,
89
+ toolbarItems: a,
77
90
  onActiveviewchange: this.onActiveViewChange
78
91
  }, null), t]);
79
92
  }
80
93
  });
81
94
  export {
82
- g as AIPrompt
95
+ V as AIPrompt
83
96
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("@progress/kendo-vue-common"),n=e.defineComponent({name:"KendoAIPromptContent",render(){const t=o.getDefaultSlots(this);return e.createVNode("div",{class:"k-prompt-content"},[e.createVNode("div",{class:"k-prompt-view"},[t])])}});exports.AIPromptContent=n;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("@progress/kendo-vue-common"),s=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-vue-buttons"),r=require("./views/constants.js"),a=e.defineComponent({name:"KendoAIPromptContent",props:{onCancel:Function,streaming:Boolean},inject:{kendoAIPrompt:{default:null}},computed:{showFloatingButton(){var o;const t=((o=this.kendoAIPrompt)==null?void 0:o.activeView)===r.outputViewDefaults.name;return this.streaming&&t}},methods:{handleKeyDown(t){t.key==="Escape"&&this.showFloatingButton&&this.onCancel&&(t.preventDefault(),this.$props.onCancel())}},render(){const t=n.getDefaultSlots(this);return e.createVNode("div",{class:"k-prompt-content",onKeydown:this.handleKeyDown},[this.showFloatingButton&&e.createVNode(i.FloatingActionButton,{onClick:this.onCancel,svgIcon:s.stopSmIcon,size:"small",positionMode:"absolute",class:"k-prompt-stop-fab k-generating"},null),e.createVNode("div",{class:"k-prompt-view"},[t])])}});exports.AIPromptContent=a;
@@ -5,19 +5,50 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as e, createVNode as t } from "vue";
9
- import { getDefaultSlots as n } from "@progress/kendo-vue-common";
10
- const p = /* @__PURE__ */ e({
8
+ import { defineComponent as e, createVNode as o } from "vue";
9
+ import { getDefaultSlots as i } from "@progress/kendo-vue-common";
10
+ import { stopSmIcon as s } from "@progress/kendo-svg-icons";
11
+ import { FloatingActionButton as r } from "@progress/kendo-vue-buttons";
12
+ import { outputViewDefaults as a } from "./views/constants.mjs";
13
+ const d = /* @__PURE__ */ e({
11
14
  name: "KendoAIPromptContent",
15
+ props: {
16
+ onCancel: Function,
17
+ streaming: Boolean
18
+ },
19
+ inject: {
20
+ kendoAIPrompt: {
21
+ default: null
22
+ }
23
+ },
24
+ computed: {
25
+ showFloatingButton() {
26
+ var n;
27
+ const t = ((n = this.kendoAIPrompt) == null ? void 0 : n.activeView) === a.name;
28
+ return this.streaming && t;
29
+ }
30
+ },
31
+ methods: {
32
+ handleKeyDown(t) {
33
+ t.key === "Escape" && this.showFloatingButton && this.onCancel && (t.preventDefault(), this.$props.onCancel());
34
+ }
35
+ },
12
36
  render() {
13
- const o = n(this);
14
- return t("div", {
15
- class: "k-prompt-content"
16
- }, [t("div", {
37
+ const t = i(this);
38
+ return o("div", {
39
+ class: "k-prompt-content",
40
+ onKeydown: this.handleKeyDown
41
+ }, [this.showFloatingButton && o(r, {
42
+ onClick: this.onCancel,
43
+ svgIcon: s,
44
+ size: "small",
45
+ positionMode: "absolute",
46
+ class: "k-prompt-stop-fab k-generating"
47
+ }, null), o("div", {
17
48
  class: "k-prompt-view"
18
- }, [o])]);
49
+ }, [t])]);
19
50
  }
20
51
  });
21
52
  export {
22
- p as AIPromptContent
53
+ d as AIPromptContent
23
54
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),n=require("@progress/kendo-vue-common"),r=require("@progress/kendo-vue-buttons");function c(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!o.isVNode(e)}const s=o.defineComponent({name:"KendoAIPromptHeader",props:{activeView:String,toolbarItems:Array,onActiveviewchange:Function},methods:{handleClick(e){this.$emit("activeviewchange",e)}},render(){let e;const{activeView:a,toolbarItems:l}=this.$props;return o.createVNode("div",{class:"k-prompt-header"},[o.createVNode(r.Toolbar,{overflow:"none",keyboardNavigation:!1,class:"k-toolbar-flat"},c(e=l.map(function(t){const i=n.getTemplate.call(this,{h:o.h,template:t.content,defaultRendering:null,additionalProps:{item:t}});return t.content?i:o.createVNode(r.Button,{type:"button",key:t.name,class:n.classNames("k-toolbar-item",{"k-selected":a===t.name}),size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:t.buttonText,svgIcon:t.buttonIcon,"aria-hidden":"true",onClick:()=>this.handleClick(t.name)},{default:()=>[t.buttonText]})},this))?e:{default:()=>[e]})])}});exports.AIPromptHeader=s;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),n=require("@progress/kendo-vue-common"),r=require("@progress/kendo-vue-buttons");function i(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!o.isVNode(e)}const s=o.defineComponent({name:"KendoAIPromptHeader",props:{activeView:String,toolbarItems:Array,onActiveviewchange:Function},methods:{handleClick(e){this.$emit("activeviewchange",e)}},render(){let e;const{activeView:a,toolbarItems:l}=this.$props;return o.createVNode("div",{class:"k-prompt-header"},[o.createVNode(r.Toolbar,{overflow:"none",keyboardNavigation:!1,class:"k-toolbar-flat"},i(e=l.map(function(t){const c=n.getTemplate.call(this,{h:o.h,template:t.content,defaultRendering:null,additionalProps:{item:t}});return t.content?c:o.createVNode(r.Button,{type:"button",key:t.name,class:n.classNames("k-toolbar-item",{"k-selected":a===t.name}),size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:t.buttonText,svgIcon:t.buttonIcon,onClick:()=>this.handleClick(t.name)},{default:()=>[t.buttonText]})},this))?e:{default:()=>[e]})])}});exports.AIPromptHeader=s;
@@ -56,7 +56,6 @@ const v = /* @__PURE__ */ l({
56
56
  rounded: "full",
57
57
  title: e.buttonText,
58
58
  svgIcon: e.buttonIcon,
59
- "aria-hidden": "true",
60
59
  onClick: () => this.handleClick(e.name)
61
60
  }, {
62
61
  default: () => [e.buttonText]
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("../AIPromptContent.js"),d=require("./AIPromptViewRender.js"),s=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-vue-layout"),t={name:"commands-view",buttonIcon:s.moreHorizontalIcon},u=e.defineComponent({name:"KendoAIPromptCommandsView",props:{commands:Array},inject:{kendoAIPrompt:{default:null}},render(){const{commands:m}=this.$props,r=a=>{var n;const o=a.target;!((n=o.items)!=null&&n.length)&&this.kendoAIPrompt.onCommandExecute&&(this.$emit("commandexecute",o),this.kendoAIPrompt.onCommandExecute.call(null,o))};return e.createVNode(d.AIPromptViewRender,{name:t.name},{default:()=>[e.createVNode(c.AIPromptContent,null,{default:()=>[e.createVNode("div",{class:"k-prompt-view"},[e.createVNode(i.PanelBar,{onSelect:r,items:m},null)])]})]})}});exports.AIPromptCommandsView=u;exports.commandsViewDefaults=t;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),a=require("../AIPromptContent.js"),s=require("./AIPromptViewRender.js"),d=require("./constants.js"),c=require("@progress/kendo-vue-layout"),i=t.defineComponent({name:"KendoAIPromptCommandsView",props:{commands:Array},inject:{kendoAIPrompt:{default:null}},render(){const{commands:m}=this.$props,r=o=>{var n;const e=o.target;!((n=e.items)!=null&&n.length)&&this.kendoAIPrompt.onCommandExecute&&(this.$emit("commandexecute",e),this.kendoAIPrompt.onCommandExecute.call(null,e))};return t.createVNode(s.AIPromptViewRender,{name:d.commandsViewDefaults.name},{default:()=>{var o,e;return[t.createVNode(a.AIPromptContent,{streaming:(o=this.kendoAIPrompt)==null?void 0:o.streaming,onCancel:(e=this.kendoAIPrompt)==null?void 0:e.onCancel},{default:()=>[t.createVNode("div",{class:"k-prompt-view"},[t.createVNode(c.PanelBar,{onSelect:r,items:m},null)])]})]}})}});exports.AIPromptCommandsView=i;
@@ -5,15 +5,12 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as a, createVNode as o } from "vue";
8
+ import { defineComponent as a, createVNode as m } from "vue";
9
9
  import { AIPromptContent as i } from "../AIPromptContent.mjs";
10
10
  import { AIPromptViewRender as d } from "./AIPromptViewRender.mjs";
11
- import { moreHorizontalIcon as c } from "@progress/kendo-svg-icons";
12
- import { PanelBar as s } from "@progress/kendo-vue-layout";
13
- const l = {
14
- name: "commands-view",
15
- buttonIcon: c
16
- }, C = /* @__PURE__ */ a({
11
+ import { commandsViewDefaults as s } from "./constants.mjs";
12
+ import { PanelBar as p } from "@progress/kendo-vue-layout";
13
+ const C = /* @__PURE__ */ a({
17
14
  name: "KendoAIPromptCommandsView",
18
15
  props: {
19
16
  commands: Array
@@ -26,26 +23,31 @@ const l = {
26
23
  render() {
27
24
  const {
28
25
  commands: n
29
- } = this.$props, t = (r) => {
30
- var e;
31
- const m = r.target;
32
- !((e = m.items) != null && e.length) && this.kendoAIPrompt.onCommandExecute && (this.$emit("commandexecute", m), this.kendoAIPrompt.onCommandExecute.call(null, m));
26
+ } = this.$props, r = (e) => {
27
+ var t;
28
+ const o = e.target;
29
+ !((t = o.items) != null && t.length) && this.kendoAIPrompt.onCommandExecute && (this.$emit("commandexecute", o), this.kendoAIPrompt.onCommandExecute.call(null, o));
33
30
  };
34
- return o(d, {
35
- name: l.name
31
+ return m(d, {
32
+ name: s.name
36
33
  }, {
37
- default: () => [o(i, null, {
38
- default: () => [o("div", {
39
- class: "k-prompt-view"
40
- }, [o(s, {
41
- onSelect: t,
42
- items: n
43
- }, null)])]
44
- })]
34
+ default: () => {
35
+ var e, o;
36
+ return [m(i, {
37
+ streaming: (e = this.kendoAIPrompt) == null ? void 0 : e.streaming,
38
+ onCancel: (o = this.kendoAIPrompt) == null ? void 0 : o.onCancel
39
+ }, {
40
+ default: () => [m("div", {
41
+ class: "k-prompt-view"
42
+ }, [m(p, {
43
+ onSelect: r,
44
+ items: n
45
+ }, null)])]
46
+ })];
47
+ }
45
48
  });
46
49
  }
47
50
  });
48
51
  export {
49
- C as AIPromptCommandsView,
50
- l as commandsViewDefaults
52
+ C as AIPromptCommandsView
51
53
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),I=require("../AIPromptContent.js"),s=require("../../messages/main.js"),f=require("./AIPromptViewRender.js"),i=require("@progress/kendo-vue-layout"),r=require("@progress/kendo-svg-icons"),a=require("@progress/kendo-vue-buttons"),g=require("@progress/kendo-vue-intl"),c=require("@progress/kendo-vue-common");function C(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}let V=function(e){return e.positive="positive",e.negative="negative",e}({});const p={name:"output-view",buttonText:"Output",buttonIcon:r.commentIcon},b=t.defineComponent({name:"KendoAIPromptOutputView",emits:{copy:null,retry:null,rating:null},props:{outputs:Array,outputCard:[String,Function,Object],showOutputRating:Boolean},inject:{kendoAIPrompt:{default:null},kendoLocalizationService:{default:null}},data(){return{copiedIndex:-1,copyButtonIcon:r.copyIcon}},methods:{retryPrompt(e){this.$emit("retry",e),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0})},copyToClipboard(e,n){e!=null&&e.responseContent&&navigator.clipboard.writeText(e.responseContent),this.copiedIndex=n,this.copyButtonIcon=r.checkIcon,this.$emit("copy",e==null?void 0:e.responseContent),setTimeout(()=>{this.copyButtonIcon=r.copyIcon,this.copiedIndex=-1},1e3)},outputRating(e,n){this.$emit("rating",e,n),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,e.prompt,{...e,ratingType:n,isRetry:!1})}},render(){let e;const{outputs:n,showOutputRating:l,outputCard:u}=this.$props,m=g.provideLocalizationService(this),h=c.templateRendering.call(this,u,c.getListeners.call(this));return t.createVNode(f.AIPromptViewRender,{name:p.name},{default:()=>[t.createVNode(I.AIPromptContent,null,{default:()=>[t.createVNode("div",{class:"k-card-list"},[n&&n.length>0?n.map(function(o,d){const y=c.getTemplate.call(this,{h:t.h,template:h,defaultRendering:null,additionalProps:{output:o}});return u?y:t.createVNode(i.Card,{key:o.id,class:o.class},{default:()=>[t.createVNode(i.CardHeader,null,{default:()=>[o.title&&t.createVNode(i.CardTitle,null,{default:()=>[o.title]}),o.subTitle&&t.createVNode(i.CardSubtitle,null,{default:()=>[o.subTitle]})]}),t.createVNode(i.CardBody,null,{default:()=>[o.responseContent]}),t.createVNode(i.CardActions,null,{default:()=>[t.createVNode(a.Button,{type:"button",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:this.copiedIndex===d?this.copyButtonIcon:r.copyIcon,"aria-hidden":"true",onClick:()=>this.copyToClipboard(o,d)},{default:()=>["Copy"]}),t.createVNode(a.Button,{type:"button",size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:r.rotateIcon,"aria-hidden":"true",onClick:()=>this.retryPrompt(o,d)},{default:()=>["Retry"]}),l&&t.createVNode("span",{class:"k-spacer"},null),l&&t.createVNode(a.Button,{type:"button",size:"medium",themeColor:o.ratingType==="positive"?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:r.thumbUpOutlineIcon,"aria-hidden":"true",onClick:()=>this.outputRating(o,"positive")},null),l&&t.createVNode(a.Button,{type:"button",size:"medium",themeColor:o.ratingType==="negative"?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:r.thumbDownOutlineIcon,"aria-hidden":"true",onClick:()=>this.outputRating(o,"negative")},null)]})]})},this):t.createVNode(i.Card,null,{default:()=>[t.createVNode(i.CardBody,null,C(e=m.toLanguageString(s.aIPromptNoOutputs,s.messages[s.aIPromptNoOutputs]))?e:{default:()=>[e]})]})])]})]})}});exports.AIPromptOutputRating=V;exports.AIPromptOutputView=b;exports.outputViewDefaults=p;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),C=require("../AIPromptContent.js"),c=require("../../messages/main.js"),g=require("./AIPromptViewRender.js"),N=require("./constants.js"),n=require("@progress/kendo-vue-layout"),l=require("@progress/kendo-svg-icons"),s=require("@progress/kendo-vue-buttons"),P=require("@progress/kendo-vue-intl");function b(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}let R=function(t){return t.positive="positive",t.negative="negative",t}({});const v=e.defineComponent({name:"KendoAIPromptOutputView",emits:{copy:null,retry:null,rating:null},props:{outputs:Array,outputCard:Object,showOutputRating:Boolean},inject:{kendoAIPrompt:{default:null},kendoLocalizationService:{default:null}},data(){return{copiedIndex:-1,copyButtonIcon:l.copyIcon,contentRef:null}},methods:{retryPrompt(t){this.$emit("retry",t),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,t.prompt,{...t,isRetry:!0}),this.scrollToTopOutput()},copyToClipboard(t,r){t!=null&&t.responseContent&&navigator.clipboard.writeText(t.responseContent),this.copiedIndex=r,this.copyButtonIcon=l.checkIcon,this.$emit("copy",t==null?void 0:t.responseContent),setTimeout(()=>{this.copyButtonIcon=l.copyIcon,this.copiedIndex=-1},1e3)},outputRating(t,r){this.$emit("rating",t,r),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,t.prompt,{...t,ratingType:r,isRetry:!1}),this.scrollToTopOutput()},scrollToTopOutput(){var t,r;(r=(t=this.contentRef)==null?void 0:t.scrollTo)==null||r.call(t,{top:0,behavior:"smooth"})}},render(){let t;const{outputs:r,showOutputRating:k,outputCard:y}=this.$props,f=P.provideLocalizationService(this),{header:u,body:p,actions:m}=y||{},I=e.createVNode(n.Card,null,{default:()=>[e.createVNode(n.CardHeader,null,{default:()=>[e.createVNode(n.CardTitle,null,{default:()=>[e.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}},null)]}),e.createVNode(n.CardSubtitle,null,{default:()=>[e.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}},null)]})]}),e.createVNode(n.CardBody,null,{default:()=>[e.createVNode("span",{class:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}},null)]}),e.createVNode(n.CardActions,null,{default:()=>[e.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}},null)]})]}),d=r==null?void 0:r.map((o,a)=>e.createVNode(n.Card,{key:`${o.id}_${a}`,class:o.class},{default:()=>[e.createVNode(n.CardHeader,null,{default:()=>[u?u(o):e.createVNode(e.Fragment,null,[o.title&&e.createVNode(n.CardTitle,null,{default:()=>[o.title]}),o.subTitle&&e.createVNode(n.CardSubtitle,null,{default:()=>[o.subTitle]})])]}),e.createVNode(n.CardBody,null,{default:()=>[p?p(o):o.responseContent]}),e.createVNode(n.CardActions,null,{default:()=>[m?m(o):e.createVNode(e.Fragment,null,[e.createVNode(s.Button,{type:"button",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:this.copiedIndex===a?this.copyButtonIcon:l.copyIcon,"aria-hidden":"true",onClick:()=>this.copyToClipboard(o,a)},{default:()=>["Copy"]}),e.createVNode(s.Button,{type:"button",size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:l.arrowRotateCwIcon,"aria-hidden":"true",onClick:()=>this.retryPrompt(o)},{default:()=>["Retry"]}),k&&e.createVNode(e.Fragment,null,[e.createVNode("span",{class:"k-spacer"},null),e.createVNode(s.Button,{type:"button",size:"medium",themeColor:o.ratingType==="positive"?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:l.thumbUpOutlineIcon,"aria-hidden":"true",onClick:()=>this.outputRating(o,"positive")},null),e.createVNode(s.Button,{type:"button",size:"medium",themeColor:o.ratingType==="negative"?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:l.thumbDownOutlineIcon,"aria-hidden":"true",onClick:()=>this.outputRating(o,"negative")},null)])])]})]})),V=e.createVNode(n.Card,null,{default:()=>[e.createVNode(n.CardBody,null,b(t=f.toLanguageString(c.aIPromptNoOutputs,c.messages[c.aIPromptNoOutputs]))?t:{default:()=>[t]})]});return e.createVNode(g.AIPromptViewRender,{name:N.outputViewDefaults.name},{default:()=>{var o,a;return[e.createVNode(C.AIPromptContent,{ref:i=>this.contentRef=i,streaming:(o=this.kendoAIPrompt)==null?void 0:o.streaming,onCancel:(a=this.kendoAIPrompt)==null?void 0:a.onCancel},{default:()=>{var i,h;return[e.createVNode("div",{class:"k-card-list"},[((i=this.kendoAIPrompt)==null?void 0:i.loading)&&I,d,(!d||d.length===0)&&!((h=this.kendoAIPrompt)!=null&&h.loading)&&V])]}})]}})}});exports.AIPromptOutputRating=R;exports.AIPromptOutputView=v;
@@ -5,26 +5,22 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as h, createVNode as t, h as y, isVNode as g } from "vue";
9
- import { AIPromptContent as I } from "../AIPromptContent.mjs";
10
- import { aIPromptNoOutputs as d, messages as C } from "../../messages/main.mjs";
11
- import { AIPromptViewRender as b } from "./AIPromptViewRender.mjs";
12
- import { Card as m, CardHeader as v, CardTitle as R, CardSubtitle as P, CardBody as c, CardActions as k } from "@progress/kendo-vue-layout";
13
- import { commentIcon as T, copyIcon as a, rotateIcon as w, thumbUpOutlineIcon as A, thumbDownOutlineIcon as O, checkIcon as B } from "@progress/kendo-svg-icons";
14
- import { Button as i } from "@progress/kendo-vue-buttons";
15
- import { provideLocalizationService as S } from "@progress/kendo-vue-intl";
16
- import { templateRendering as z, getListeners as V, getTemplate as j } from "@progress/kendo-vue-common";
17
- function x(e) {
18
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
8
+ import { defineComponent as w, createVNode as t, Fragment as a, isVNode as A } from "vue";
9
+ import { AIPromptContent as O } from "../AIPromptContent.mjs";
10
+ import { aIPromptNoOutputs as k, messages as x } from "../../messages/main.mjs";
11
+ import { AIPromptViewRender as B } from "./AIPromptViewRender.mjs";
12
+ import { outputViewDefaults as z } from "./constants.mjs";
13
+ import { Card as d, CardHeader as y, CardTitle as g, CardSubtitle as I, CardBody as p, CardActions as C } from "@progress/kendo-vue-layout";
14
+ import { copyIcon as m, arrowRotateCwIcon as S, thumbUpOutlineIcon as V, thumbDownOutlineIcon as $, checkIcon as j } from "@progress/kendo-svg-icons";
15
+ import { Button as r } from "@progress/kendo-vue-buttons";
16
+ import { provideLocalizationService as q } from "@progress/kendo-vue-intl";
17
+ function M(e) {
18
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !A(e);
19
19
  }
20
- let U = /* @__PURE__ */ function(e) {
20
+ let G = /* @__PURE__ */ function(e) {
21
21
  return e.positive = "positive", e.negative = "negative", e;
22
22
  }({});
23
- const q = {
24
- name: "output-view",
25
- buttonText: "Output",
26
- buttonIcon: T
27
- }, E = /* @__PURE__ */ h({
23
+ const J = /* @__PURE__ */ w({
28
24
  name: "KendoAIPromptOutputView",
29
25
  emits: {
30
26
  copy: null,
@@ -33,7 +29,7 @@ const q = {
33
29
  },
34
30
  props: {
35
31
  outputs: Array,
36
- outputCard: [String, Function, Object],
32
+ outputCard: Object,
37
33
  showOutputRating: Boolean
38
34
  },
39
35
  inject: {
@@ -47,7 +43,8 @@ const q = {
47
43
  data() {
48
44
  return {
49
45
  copiedIndex: -1,
50
- copyButtonIcon: a
46
+ copyButtonIcon: m,
47
+ contentRef: null
51
48
  };
52
49
  },
53
50
  methods: {
@@ -55,11 +52,11 @@ const q = {
55
52
  this.$emit("retry", e), this.kendoAIPrompt.onPromptRequest && this.kendoAIPrompt.onPromptRequest.call(null, e.prompt, {
56
53
  ...e,
57
54
  isRetry: !0
58
- });
55
+ }), this.scrollToTopOutput();
59
56
  },
60
57
  copyToClipboard(e, n) {
61
- e != null && e.responseContent && navigator.clipboard.writeText(e.responseContent), this.copiedIndex = n, this.copyButtonIcon = B, this.$emit("copy", e == null ? void 0 : e.responseContent), setTimeout(() => {
62
- this.copyButtonIcon = a, this.copiedIndex = -1;
58
+ e != null && e.responseContent && navigator.clipboard.writeText(e.responseContent), this.copiedIndex = n, this.copyButtonIcon = j, this.$emit("copy", e == null ? void 0 : e.responseContent), setTimeout(() => {
59
+ this.copyButtonIcon = m, this.copiedIndex = -1;
63
60
  }, 1e3);
64
61
  },
65
62
  outputRating(e, n) {
@@ -67,6 +64,13 @@ const q = {
67
64
  ...e,
68
65
  ratingType: n,
69
66
  isRetry: !1
67
+ }), this.scrollToTopOutput();
68
+ },
69
+ scrollToTopOutput() {
70
+ var e, n;
71
+ (n = (e = this.contentRef) == null ? void 0 : e.scrollTo) == null || n.call(e, {
72
+ top: 0,
73
+ behavior: "smooth"
70
74
  });
71
75
  }
72
76
  },
@@ -74,97 +78,132 @@ const q = {
74
78
  let e;
75
79
  const {
76
80
  outputs: n,
77
- showOutputRating: r,
78
- outputCard: s
79
- } = this.$props, p = S(this), u = z.call(this, s, V.call(this));
80
- return t(b, {
81
- name: q.name
82
- }, {
83
- default: () => [t(I, null, {
84
- default: () => [t("div", {
85
- class: "k-card-list"
86
- }, [n && n.length > 0 ? n.map(function(o, l) {
87
- const f = j.call(this, {
88
- h: y,
89
- template: u,
90
- defaultRendering: null,
91
- additionalProps: {
92
- output: o
81
+ showOutputRating: R,
82
+ outputCard: b
83
+ } = this.$props, P = q(this), {
84
+ header: c,
85
+ body: u,
86
+ actions: f
87
+ } = b || {}, T = t(d, null, {
88
+ default: () => [t(y, null, {
89
+ default: () => [t(g, null, {
90
+ default: () => [t("span", {
91
+ class: "k-skeleton k-skeleton-text k-skeleton-pulse",
92
+ style: {
93
+ width: "200px"
93
94
  }
94
- });
95
- return s ? f : t(m, {
96
- key: o.id,
97
- class: o.class
98
- }, {
99
- default: () => [t(v, null, {
100
- default: () => [o.title && t(R, null, {
101
- default: () => [o.title]
102
- }), o.subTitle && t(P, null, {
103
- default: () => [o.subTitle]
104
- })]
105
- }), t(c, null, {
106
- default: () => [o.responseContent]
107
- }), t(k, null, {
108
- default: () => [t(i, {
109
- type: "button",
110
- size: "medium",
111
- themeColor: "primary",
112
- fillMode: "flat",
113
- rounded: "medium",
114
- title: "Copy",
115
- svgIcon: this.copiedIndex === l ? this.copyButtonIcon : a,
116
- "aria-hidden": "true",
117
- onClick: () => this.copyToClipboard(o, l)
118
- }, {
119
- default: () => ["Copy"]
120
- }), t(i, {
121
- type: "button",
122
- size: "medium",
123
- themeColor: "base",
124
- fillMode: "flat",
125
- rounded: "medium",
126
- title: "Retry",
127
- svgIcon: w,
128
- "aria-hidden": "true",
129
- onClick: () => this.retryPrompt(o, l)
130
- }, {
131
- default: () => ["Retry"]
132
- }), r && t("span", {
133
- class: "k-spacer"
134
- }, null), r && t(i, {
135
- type: "button",
136
- size: "medium",
137
- themeColor: o.ratingType === "positive" ? "primary" : "base",
138
- fillMode: "flat",
139
- rounded: "medium",
140
- title: "Rate up",
141
- svgIcon: A,
142
- "aria-hidden": "true",
143
- onClick: () => this.outputRating(o, "positive")
144
- }, null), r && t(i, {
145
- type: "button",
146
- size: "medium",
147
- themeColor: o.ratingType === "negative" ? "primary" : "base",
148
- fillMode: "flat",
149
- rounded: "medium",
150
- title: "Rate down",
151
- svgIcon: O,
152
- "aria-hidden": "true",
153
- onClick: () => this.outputRating(o, "negative")
154
- }, null)]
155
- })]
156
- });
157
- }, this) : t(m, null, {
158
- default: () => [t(c, null, x(e = p.toLanguageString(d, C[d])) ? e : {
159
- default: () => [e]
160
- })]
95
+ }, null)]
96
+ }), t(I, null, {
97
+ default: () => [t("span", {
98
+ class: "k-skeleton k-skeleton-text k-skeleton-pulse",
99
+ style: {
100
+ width: "100%"
101
+ }
102
+ }, null)]
103
+ })]
104
+ }), t(p, null, {
105
+ default: () => [t("span", {
106
+ class: "k-skeleton k-skeleton-rect k-skeleton-pulse",
107
+ style: {
108
+ height: "80px"
109
+ }
110
+ }, null)]
111
+ }), t(C, null, {
112
+ default: () => [t("span", {
113
+ class: "k-skeleton k-skeleton-text k-skeleton-pulse",
114
+ style: {
115
+ width: "100%"
116
+ }
117
+ }, null)]
118
+ })]
119
+ }), s = n == null ? void 0 : n.map((o, l) => t(d, {
120
+ key: `${o.id}_${l}`,
121
+ class: o.class
122
+ }, {
123
+ default: () => [t(y, null, {
124
+ default: () => [c ? c(o) : t(a, null, [o.title && t(g, null, {
125
+ default: () => [o.title]
126
+ }), o.subTitle && t(I, null, {
127
+ default: () => [o.subTitle]
161
128
  })])]
129
+ }), t(p, null, {
130
+ default: () => [u ? u(o) : o.responseContent]
131
+ }), t(C, null, {
132
+ default: () => [f ? f(o) : t(a, null, [t(r, {
133
+ type: "button",
134
+ size: "medium",
135
+ themeColor: "primary",
136
+ fillMode: "flat",
137
+ rounded: "medium",
138
+ title: "Copy",
139
+ svgIcon: this.copiedIndex === l ? this.copyButtonIcon : m,
140
+ "aria-hidden": "true",
141
+ onClick: () => this.copyToClipboard(o, l)
142
+ }, {
143
+ default: () => ["Copy"]
144
+ }), t(r, {
145
+ type: "button",
146
+ size: "medium",
147
+ themeColor: "base",
148
+ fillMode: "flat",
149
+ rounded: "medium",
150
+ title: "Retry",
151
+ svgIcon: S,
152
+ "aria-hidden": "true",
153
+ onClick: () => this.retryPrompt(o)
154
+ }, {
155
+ default: () => ["Retry"]
156
+ }), R && t(a, null, [t("span", {
157
+ class: "k-spacer"
158
+ }, null), t(r, {
159
+ type: "button",
160
+ size: "medium",
161
+ themeColor: o.ratingType === "positive" ? "primary" : "base",
162
+ fillMode: "flat",
163
+ rounded: "medium",
164
+ title: "Rate up",
165
+ svgIcon: V,
166
+ "aria-hidden": "true",
167
+ onClick: () => this.outputRating(o, "positive")
168
+ }, null), t(r, {
169
+ type: "button",
170
+ size: "medium",
171
+ themeColor: o.ratingType === "negative" ? "primary" : "base",
172
+ fillMode: "flat",
173
+ rounded: "medium",
174
+ title: "Rate down",
175
+ svgIcon: $,
176
+ "aria-hidden": "true",
177
+ onClick: () => this.outputRating(o, "negative")
178
+ }, null)])])]
179
+ })]
180
+ })), v = t(d, null, {
181
+ default: () => [t(p, null, M(e = P.toLanguageString(k, x[k])) ? e : {
182
+ default: () => [e]
162
183
  })]
163
184
  });
185
+ return t(B, {
186
+ name: z.name
187
+ }, {
188
+ default: () => {
189
+ var o, l;
190
+ return [t(O, {
191
+ ref: (i) => this.contentRef = i,
192
+ streaming: (o = this.kendoAIPrompt) == null ? void 0 : o.streaming,
193
+ onCancel: (l = this.kendoAIPrompt) == null ? void 0 : l.onCancel
194
+ }, {
195
+ default: () => {
196
+ var i, h;
197
+ return [t("div", {
198
+ class: "k-card-list"
199
+ }, [((i = this.kendoAIPrompt) == null ? void 0 : i.loading) && T, s, (!s || s.length === 0) && !((h = this.kendoAIPrompt) != null && h.loading) && v])];
200
+ }
201
+ })];
202
+ }
203
+ });
164
204
  }
165
205
  });
166
206
  export {
167
- U as AIPromptOutputRating,
168
- E as AIPromptOutputView,
169
- q as outputViewDefaults
207
+ G as AIPromptOutputRating,
208
+ J as AIPromptOutputView
170
209
  };
@@ -5,4 +5,5 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("../AIPromptContent.js"),I=require("../AIPromptFooter.js"),V=require("@progress/kendo-vue-buttons"),f=require("@progress/kendo-vue-inputs"),i=require("@progress/kendo-svg-icons"),A=require("./AIPromptViewRender.js"),P=require("../AIPromptExpander.js"),n=require("@progress/kendo-vue-common");function p(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const s={name:"prompt-view",buttonText:"Ask AI",buttonIcon:i.sparklesIcon},k=t.defineComponent({name:"KendoAIPromptView",props:{promptInput:[Object,String],generateButton:[Object,String],promptValue:String,promptSuggestions:Array},inject:{kendoAIPrompt:{default:null}},computed:{computedValue(){return this.$props.promptValue!==void 0?this.$props.promptValue:this.value}},data(){return{value:""}},methods:{handleOnRequest(){this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,this.value),this.value=""},handleSuggestionSelect(e){this.value=e},onTextChange(e){this.value=e.value}},render(){let e;const o="Generate",{promptSuggestions:r}=this.$props,a=n.templateRendering.call(this,this.$props.promptInput,n.getListeners.call(this)),c=t.createVNode(f.TextArea,{value:this.computedValue,onChange:this.onTextChange,placeholder:"Ask or generate content with AI ...",rows:2},null),d=n.getTemplate.call(this,{h:t.h,template:a,defaultRendering:c}),m=n.templateRendering.call(this,this.$props.generateButton,n.getListeners.call(this)),h=t.createVNode(V.Button,{type:"button",themeColor:"primary",fillMode:"solid","aria-hidden":"true",rounded:"full",size:"medium",onClick:this.handleOnRequest,title:"Generate",svgIcon:i.sparklesIcon},p(o)?o:{default:()=>[o]}),u=n.getTemplate.call(this,{h:t.h,template:m,defaultRendering:h});return t.createVNode(A.AIPromptViewRender,{name:s.name},{default:()=>[t.createVNode(g.AIPromptContent,null,{default:()=>[d,r&&r.length>0&&t.createVNode(P.AIPromptExpander,{title:"Prompt Suggestions"},p(e=r.map(function(l){return t.createVNode("div",{key:l,class:"k-prompt-suggestion",onClick:()=>this.handleSuggestionSelect(l)},[l])},this))?e:{default:()=>[e]})]}),t.createVNode(I.AIPromptFooter,null,p(u)?u:{default:()=>[u]})]})}});exports.AIPromptView=k;exports.promptViewDefaults=s;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),I=require("../AIPromptContent.js"),V=require("../AIPromptFooter.js"),P=require("./constants.js"),A=require("@progress/kendo-vue-inputs"),c=require("@progress/kendo-vue-buttons"),x=require("@progress/kendo-svg-icons"),R=require("./AIPromptViewRender.js"),b=require("../AIPromptExpander.js"),k=require("../../chat/components/SuggestionGroup.js"),o=require("@progress/kendo-vue-common");function d(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const v=t.defineComponent({name:"KendoAIPromptView",props:{promptInput:[Object,String],generateButton:[Object,String],promptValue:String,promptSuggestions:Array,enableSpeechToText:[Boolean,Object]},inject:{kendoAIPrompt:{default:null}},computed:{computedValue(){return this.$props.promptValue!==void 0?this.$props.promptValue:this.value}},data(){return{value:""}},methods:{handleOnRequest(){this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,this.computedValue),this.value=""},handleSuggestionSelect(e){this.value=e},onTextChange(e){this.value=e.value},onSpeechResult(e){if(e.isFinal&&e.alternatives.length>0){const r=e.alternatives[0].transcript,n=this.value,s=n&&!n.endsWith(" ")&&!n.endsWith(`
9
+ `);this.value=n+(s?" ":"")+r}},onSpeechStart(){},onSpeechEnd(){},getButtonDisabledState(){const e=this.$props.promptValue!==void 0?this.$props.promptValue:this.value;return!(e!=null&&e.trim())}},render(){const e="Generate",{promptSuggestions:r,enableSpeechToText:n}=this.$props,s=o.templateRendering.call(this,this.$props.promptInput,o.getListeners.call(this)),h=()=>n?t.createVNode("div",{class:"k-input-suffix k-input-suffix-horizontal"},[t.createVNode(c.SpeechToTextButton,t.mergeProps({fillMode:"flat",onStart:this.onSpeechStart,onEnd:this.onSpeechEnd,onResult:this.onSpeechResult},typeof n=="object"?n:{}),null)]):null,m=t.createVNode(A.TextArea,{value:this.computedValue,onInput:this.onTextChange,placeholder:"Ask or generate content with AI ...",rows:2,class:"!k-flex-col",inputSuffix:h},null),g=o.getTemplate.call(this,{h:t.h,template:s,defaultRendering:m}),f=o.templateRendering.call(this,this.$props.generateButton,o.getListeners.call(this)),S=t.createVNode(c.Button,{type:"button",themeColor:"primary",fillMode:"solid","aria-hidden":"true",rounded:"full",size:"medium",onClick:this.handleOnRequest,disabled:this.getButtonDisabledState(),title:"Generate",svgIcon:x.sparklesIcon},d(e)?e:{default:()=>[e]}),i=o.getTemplate.call(this,{h:t.h,template:f,defaultRendering:S});return t.createVNode(R.AIPromptViewRender,{name:P.promptViewDefaults.name},{default:()=>{var a,p;return[t.createVNode(I.AIPromptContent,{streaming:(a=this.kendoAIPrompt)==null?void 0:a.streaming,onCancel:(p=this.kendoAIPrompt)==null?void 0:p.onCancel},{default:()=>[g,r&&r.length>0&&t.createVNode(b.AIPromptExpander,{title:"Prompt Suggestions"},{default:()=>[t.createVNode(k.SuggestionGroup,{suggestions:r.map((u,l)=>({id:l,text:u,description:u})),onSuggestionClick:(u,l)=>this.handleSuggestionSelect(l.text)},null)]})]}),t.createVNode(V.AIPromptFooter,null,d(i)?i:{default:()=>[i]})]}})}});exports.AIPromptView=v;