@turquoisehealth/pit-viper 2.224.1-dev.2 → 2.224.1-dev.3
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.
- package/_site/assets/css/pit-viper-a11y.css +79 -1
- package/_site/assets/css/pit-viper-consumer.css +79 -1
- package/_site/assets/css/pit-viper-v2-scoped.css +68 -1
- package/_site/assets/css/pit-viper-v2.css +118 -1
- package/_site/assets/css/pit-viper.css +79 -1
- package/package.json +1 -1
- package/pv-components/dist/stats/vue/ai/stats.html +1 -1
- package/pv-components/dist/stats/vue/base/stats.html +1 -1
- package/pv-components/dist/stats/vue/visualizations/stats.html +1 -1
- package/pv-components/dist/stats/web/pv-action-button-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-filter-modal-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-filter-panel-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-hover-action-menu-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-menu-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-multi-select-button-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-popover-v2-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-query-builder-input-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-reasoning-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-segmented-control-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-select-button-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-sidebar-v2-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-split-button-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-step-list-stats.html +4950 -0
- package/pv-components/dist/stats/web/pv-toggle-group-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-tooltip-v2-stats.html +1 -1
- package/pv-components/dist/vue/ai/components/ai/PvReasoning/PvReasoning.vue.d.ts +11 -3
- package/pv-components/dist/vue/ai/components/ai/PvReasoning/types.d.ts +3 -0
- package/pv-components/dist/vue/ai/components/ai/PvStepList/PvStepList.vue.d.ts +7 -0
- package/pv-components/dist/vue/ai/components/ai/PvStepList/types.d.ts +42 -0
- package/pv-components/dist/vue/ai/components/ai/index.d.ts +2 -0
- package/pv-components/dist/vue/ai/components/base/PvQueryBuilderInput/PvQueryBuilderInput.vue.d.ts +4 -0
- package/pv-components/dist/vue/ai/components/base/PvSidebarV2/PvSidebarV2.vue.d.ts +3 -1
- package/pv-components/dist/vue/ai/components/base/PvSidebarV2/types.d.ts +2 -0
- package/pv-components/dist/vue/ai/pv-components-ai.mjs +490 -327
- package/pv-components/dist/vue/ai/pv-components-ai.mjs.map +1 -1
- package/pv-components/dist/vue/base/components/base/PvQueryBuilderInput/PvQueryBuilderInput.vue.d.ts +4 -0
- package/pv-components/dist/vue/base/components/base/PvSidebarV2/PvSidebarV2.vue.d.ts +3 -1
- package/pv-components/dist/vue/base/components/base/PvSidebarV2/types.d.ts +2 -0
- package/pv-components/dist/vue/base/pv-components-base.mjs +1091 -983
- package/pv-components/dist/vue/base/pv-components-base.mjs.map +1 -1
- package/pv-components/dist/vue/visualizations/components/base/PvQueryBuilderInput/PvQueryBuilderInput.vue.d.ts +4 -0
- package/pv-components/dist/vue/visualizations/components/base/PvSidebarV2/PvSidebarV2.vue.d.ts +3 -1
- package/pv-components/dist/vue/visualizations/components/base/PvSidebarV2/types.d.ts +2 -0
- package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs +13 -8
- package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs.map +1 -1
- package/pv-components/dist/web/components/pv-action-button/pv-action-button.js +8 -4
- package/pv-components/dist/web/components/pv-filter-modal/pv-filter-modal.js +8 -4
- package/pv-components/dist/web/components/pv-filter-panel/pv-filter-panel.js +8 -4
- package/pv-components/dist/web/components/pv-hover-action-menu/pv-hover-action-menu.js +197 -193
- package/pv-components/dist/web/components/pv-menu/pv-menu.js +8 -4
- package/pv-components/dist/web/components/pv-multi-select-button/pv-multi-select-button.js +8 -4
- package/pv-components/dist/web/components/pv-popover-v2/pv-popover-v2.js +8 -4
- package/pv-components/dist/web/components/pv-query-builder-input/pv-query-builder-input.js +16 -8
- package/pv-components/dist/web/components/pv-reasoning/pv-reasoning.js +640 -466
- package/pv-components/dist/web/components/pv-segmented-control/pv-segmented-control.js +230 -226
- package/pv-components/dist/web/components/pv-select-button/pv-select-button.js +8 -4
- package/pv-components/dist/web/components/pv-sidebar-v2/pv-sidebar-v2.js +1431 -1322
- package/pv-components/dist/web/components/pv-split-button/pv-split-button.js +213 -209
- package/pv-components/dist/web/components/pv-step-list/pv-step-list.js +6309 -0
- package/pv-components/dist/web/components/pv-toggle-group/pv-toggle-group.js +8 -4
- package/pv-components/dist/web/components/pv-tooltip-v2/pv-tooltip-v2.js +8 -4
- package/pv-components/dist/web/pv-components.iife.js +39 -39
- package/pv-components/dist/web/pv-components.iife.js.map +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.pv-badge-md[data-v-013a5d76]{--inset-size:2px 2px;min-width:20px;min-height:20px;max-height:20px;font-weight:500}.pv-badge-sm[data-v-013a5d76]{--inset-size:0 2px;min-width:16px;min-height:16px;max-height:16px;font-weight:500}.input-icon-position{pointer-events:none;position:absolute;top:8px;left:12px}.pv-question[data-v-38f26601]{--card-radius:.75rem;box-shadow:0 4px 16px #00000029}.pv-question__listbox[data-v-38f26601]:focus-visible{outline:2px solid var(--color-border-accent,#36c5ba);outline-offset:2px;border-radius:.5rem}.pv-question__option[data-v-38f26601],.pv-question__chat[data-v-38f26601]{cursor:pointer;min-width:0}.pv-question__option[data-active][data-v-38f26601],.pv-question__chat[data-active][data-v-38f26601]{background-color:var(--card-hover-background-color,#e8f2f4)}.pv-question__option[data-v-38f26601]:active,.pv-question__chat[data-v-38f26601]:active{background-color:var(--card-pressed-background-color,#c7d8db)}.pv-question__chevron[data-v-38f26601]{visibility:hidden;margin-inline-start:auto}.pv-question__option[data-active] .pv-question__chevron[data-v-38f26601],.pv-question__chat[data-active] .pv-question__chevron[data-v-38f26601]{visibility:visible}.pv-question__check[data-v-38f26601]{margin-inline-start:auto}.pv-question__option[aria-selected=true] .pv-question__chevron[data-v-38f26601]{display:none}.pv-question__chat-badge[data-v-38f26601]{--flex-gap:0;background-color:#e0e5e4;flex:0 0 1rem;justify-content:center;height:1rem}.pv-question__chat-input[data-v-38f26601] .pv-input-text{min-width:0}.pv-confirmation__actions[data-v-c200deca]{--flex-justify:flex-end}.pv-prompt-input[data-v-155361b4]{--flex-align:stretch;cursor:text;transition-property:border-color,box-shadow;transition-duration:.125s}.pv-prompt-input[data-v-155361b4]:hover{border-color:var(--text-input-hover-border-color,#d2d8dc);box-shadow:0 .25px 3px #0003}.pv-prompt-input[data-v-155361b4]:focus-within{border-color:var(--text-input-focus-border-color,#36c5ba)}.pv-prompt-input__textarea[data-v-155361b4]{--flex-align:stretch;width:100%}.pv-prompt-input__textarea[data-v-155361b4] textarea{field-sizing:content;max-height:var(--prompt-input-max-height);resize:none;background-color:#0000;border:0;width:100%;min-width:0;padding:0;overflow-y:auto}.pv-prompt-input__textarea[data-v-155361b4] textarea:focus,.pv-prompt-input__textarea[data-v-155361b4] textarea:focus-visible{outline:none}.pv-prompt-input__footer[data-v-155361b4]{--flex-justify:space-between}.pv-prompt-input__actions[data-v-155361b4]{min-width:0}summary[data-v-a64056ef]{background-image:none;padding-right:2px}.pv-reasoning__content[data-v-
|
|
2
|
-
/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import {
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.pv-badge-md[data-v-013a5d76]{--inset-size:2px 2px;min-width:20px;min-height:20px;max-height:20px;font-weight:500}.pv-badge-sm[data-v-013a5d76]{--inset-size:0 2px;min-width:16px;min-height:16px;max-height:16px;font-weight:500}.input-icon-position{pointer-events:none;position:absolute;top:8px;left:12px}.pv-question[data-v-38f26601]{--card-radius:.75rem;box-shadow:0 4px 16px #00000029}.pv-question__listbox[data-v-38f26601]:focus-visible{outline:2px solid var(--color-border-accent,#36c5ba);outline-offset:2px;border-radius:.5rem}.pv-question__option[data-v-38f26601],.pv-question__chat[data-v-38f26601]{cursor:pointer;min-width:0}.pv-question__option[data-active][data-v-38f26601],.pv-question__chat[data-active][data-v-38f26601]{background-color:var(--card-hover-background-color,#e8f2f4)}.pv-question__option[data-v-38f26601]:active,.pv-question__chat[data-v-38f26601]:active{background-color:var(--card-pressed-background-color,#c7d8db)}.pv-question__chevron[data-v-38f26601]{visibility:hidden;margin-inline-start:auto}.pv-question__option[data-active] .pv-question__chevron[data-v-38f26601],.pv-question__chat[data-active] .pv-question__chevron[data-v-38f26601]{visibility:visible}.pv-question__check[data-v-38f26601]{margin-inline-start:auto}.pv-question__option[aria-selected=true] .pv-question__chevron[data-v-38f26601]{display:none}.pv-question__chat-badge[data-v-38f26601]{--flex-gap:0;background-color:#e0e5e4;flex:0 0 1rem;justify-content:center;height:1rem}.pv-question__chat-input[data-v-38f26601] .pv-input-text{min-width:0}.pv-confirmation__actions[data-v-c200deca]{--flex-justify:flex-end}.pv-prompt-input[data-v-155361b4]{--flex-align:stretch;cursor:text;transition-property:border-color,box-shadow;transition-duration:.125s}.pv-prompt-input[data-v-155361b4]:hover{border-color:var(--text-input-hover-border-color,#d2d8dc);box-shadow:0 .25px 3px #0003}.pv-prompt-input[data-v-155361b4]:focus-within{border-color:var(--text-input-focus-border-color,#36c5ba)}.pv-prompt-input__textarea[data-v-155361b4]{--flex-align:stretch;width:100%}.pv-prompt-input__textarea[data-v-155361b4] textarea{field-sizing:content;max-height:var(--prompt-input-max-height);resize:none;background-color:#0000;border:0;width:100%;min-width:0;padding:0;overflow-y:auto}.pv-prompt-input__textarea[data-v-155361b4] textarea:focus,.pv-prompt-input__textarea[data-v-155361b4] textarea:focus-visible{outline:none}.pv-prompt-input__footer[data-v-155361b4]{--flex-justify:space-between}.pv-prompt-input__actions[data-v-155361b4]{min-width:0}summary[data-v-a64056ef]{background-image:none;padding-right:2px}.pv-step-aside[data-v-5ab7d271]{white-space:pre-line}.pv-step-enter-active[data-v-5ab7d271]{transition-property:opacity,transform;transition-duration:.32s;transition-timing-function:ease}.pv-step-enter-from[data-v-5ab7d271]{opacity:0;transform:translateY(6px)}.pv-reasoning[data-v-91e8312e]{--accordion-background-color:var(--reasoning-background-color,transparent);--accordion-summary-background-color:var(--reasoning-trigger-background-color,transparent);--accordion-summary-hover-background-color:var(--reasoning-trigger-background-color,transparent);--accordion-summary-pressed-background-color:var(--reasoning-trigger-background-color,transparent);--accordion-arrow-left-summary-padding:var(--reasoning-trigger-padding,4px 4px 4px 0);--accordion-arrow-right-summary-padding:var(--reasoning-trigger-padding,4px 4px 4px 0);--accordion-content-padding:0}.pv-reasoning__trigger .pv-shimmer[data-v-91e8312e]{--shimmer-rgb:var(--reasoning-shimmer-rgb,247, 248, 248)}.pv-reasoning__standalone[data-v-91e8312e]{padding:var(--reasoning-trigger-padding,4px 4px 4px 0);margin-inline-start:calc(1rem + var(--flex-gap,.5rem))}.pv-reasoning__content[data-v-91e8312e]{white-space:pre-wrap;padding:8px 0 8px 20px}.pv-reasoning__content[data-v-91e8312e] :where(ol,ul,dl,table,figure){white-space:normal}.pv-tool__disclosure-content[data-v-a5e28b1a]{padding:0 12px 12px}.pv-tool__heading[data-v-a5e28b1a]{min-width:0}.pv-tool__content[data-v-a5e28b1a]{padding-top:12px}pre[data-v-a5e28b1a]{white-space:pre-wrap;word-break:break-word;max-width:100%;margin:0;overflow-x:auto}
|
|
2
|
+
/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { Comment as e, Fragment as t, Text as n, TransitionGroup as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f, mergeModels as p, mergeProps as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onBeforeUpdate as y, onMounted as b, onScopeDispose as x, openBlock as S, ref as C, renderList as w, renderSlot as T, toDisplayString as E, unref as D, useId as O, useModel as k, useSlots as A, useTemplateRef as j, vModelDynamic as M, vModelText as N, watch as P, withCtx as F, withDirectives as I, withKeys as ee, withModifiers as L } from "vue";
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region src/components/base/PvSpinner/PvSpinner.vue
|
|
5
|
-
var
|
|
5
|
+
var R = /* @__PURE__ */ d({
|
|
6
6
|
__name: "PvSpinner",
|
|
7
7
|
props: {
|
|
8
8
|
size: { default: "lg" },
|
|
@@ -20,26 +20,26 @@ var k = /* @__PURE__ */ c({
|
|
|
20
20
|
dark: "pv-spinner-dark",
|
|
21
21
|
white: "pv-spinner-light"
|
|
22
22
|
};
|
|
23
|
-
return (r,
|
|
23
|
+
return (r, i) => (S(), s("div", {
|
|
24
24
|
"data-testid": "pv-spinner",
|
|
25
|
-
class:
|
|
26
|
-
style:
|
|
25
|
+
class: g(n[e.variant]),
|
|
26
|
+
style: _({ "--size": t[e.size] })
|
|
27
27
|
}, null, 6));
|
|
28
28
|
}
|
|
29
|
-
}),
|
|
29
|
+
}), z = ["ghost"], B = {
|
|
30
30
|
md: "pv-button-small",
|
|
31
31
|
lg: void 0,
|
|
32
32
|
xl: "pv-button-large"
|
|
33
|
-
},
|
|
33
|
+
}, V = (e) => e == null || !B.hasOwnProperty(e) ? null : B[e] || null;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/web-components/utils.ts
|
|
36
|
-
function
|
|
37
|
-
let e =
|
|
36
|
+
function H() {
|
|
37
|
+
let e = C(!1), t = f()?.root || {};
|
|
38
38
|
return "isCE" in t && t.isCE === !0 && (e.value = !0), e;
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/components/base/baseProps.ts
|
|
42
|
-
var
|
|
42
|
+
var te = [
|
|
43
43
|
void 0,
|
|
44
44
|
10,
|
|
45
45
|
12,
|
|
@@ -47,24 +47,24 @@ var P = [
|
|
|
47
47
|
24,
|
|
48
48
|
32,
|
|
49
49
|
64
|
|
50
|
-
],
|
|
50
|
+
], ne = ["xlink:href"], U = /* @__PURE__ */ d({
|
|
51
51
|
__name: "PvIcon",
|
|
52
52
|
props: {
|
|
53
53
|
name: {},
|
|
54
54
|
size: {}
|
|
55
55
|
},
|
|
56
56
|
setup(e) {
|
|
57
|
-
let
|
|
57
|
+
let t = e, n = H(), r = C(null), a = i(() => ({
|
|
58
58
|
"pv-icon": !0,
|
|
59
|
-
[`pv-icon-${
|
|
60
|
-
})),
|
|
61
|
-
return globalThis.__PV_GLOBAL_SPRITE_PATH__ && (
|
|
59
|
+
[`pv-icon-${t.size}`]: t.size != null && te.includes(t.size)
|
|
60
|
+
})), o = i(() => n.value && r.value ? `${r.value}#${t.name}` : `#${t.name}`);
|
|
61
|
+
return globalThis.__PV_GLOBAL_SPRITE_PATH__ && (r.value = globalThis.__PV_GLOBAL_SPRITE_PATH__), (e, t) => (S(), s("svg", {
|
|
62
62
|
"data-testid": "pv-icon",
|
|
63
63
|
"aria-hidden": "true",
|
|
64
|
-
class:
|
|
65
|
-
}, [
|
|
64
|
+
class: g(a.value)
|
|
65
|
+
}, [c("use", { "xlink:href": o.value }, null, 8, ne)], 2));
|
|
66
66
|
}
|
|
67
|
-
}),
|
|
67
|
+
}), re = /* @__PURE__ */ d({
|
|
68
68
|
__name: "PvCounterBadge",
|
|
69
69
|
props: {
|
|
70
70
|
maxValue: { default: 99 },
|
|
@@ -74,29 +74,29 @@ var P = [
|
|
|
74
74
|
variant: { default: "primary" }
|
|
75
75
|
},
|
|
76
76
|
setup(e) {
|
|
77
|
-
let
|
|
77
|
+
let t = e, n = i(() => t.maxValue && t.value && t.value > t.maxValue ? `${t.maxValue}+` : t.value == null ? "-" : `${t.prefix}${t.value}`), r = i(() => ({
|
|
78
78
|
"pv-inline-block pv-inset-square pv-radius pv-text-center": !0,
|
|
79
|
-
"pv-badge-md pv-text-body-md":
|
|
80
|
-
"pv-badge-sm pv-text-body-sm":
|
|
81
|
-
"pv-surface-brand-inverse pv-text-inverse":
|
|
82
|
-
"pv-badge-secondary":
|
|
83
|
-
"pv-surface-lighten-5":
|
|
84
|
-
"pv-text-tertiary":
|
|
85
|
-
"pv-surface":
|
|
79
|
+
"pv-badge-md pv-text-body-md": t.size == "md",
|
|
80
|
+
"pv-badge-sm pv-text-body-sm": t.size == "sm",
|
|
81
|
+
"pv-surface-brand-inverse pv-text-inverse": t.variant == "primary",
|
|
82
|
+
"pv-badge-secondary": t.variant == "secondary",
|
|
83
|
+
"pv-surface-lighten-5": t.variant == "tertiary",
|
|
84
|
+
"pv-text-tertiary": t.variant == "ghost" || t.variant == "tertiary",
|
|
85
|
+
"pv-surface": t.variant == "ghost"
|
|
86
86
|
}));
|
|
87
|
-
return (e, t) => (
|
|
88
|
-
class:
|
|
87
|
+
return (e, t) => (S(), s("div", {
|
|
88
|
+
class: g(r.value),
|
|
89
89
|
"data-testid": "pv-counter-badge"
|
|
90
|
-
},
|
|
90
|
+
}, E(n.value), 3));
|
|
91
91
|
}
|
|
92
|
-
}),
|
|
92
|
+
}), W = (e, t) => {
|
|
93
93
|
let n = e.__vccOpts || e;
|
|
94
94
|
for (let [e, r] of t) n[e] = r;
|
|
95
95
|
return n;
|
|
96
|
-
},
|
|
96
|
+
}, G = /* @__PURE__ */ W(re, [["__scopeId", "data-v-013a5d76"]]), ie = ["disabled", "aria-label"], ae = {
|
|
97
97
|
key: 2,
|
|
98
98
|
"data-testid": "pv-button-label"
|
|
99
|
-
},
|
|
99
|
+
}, K = /* @__PURE__ */ d({
|
|
100
100
|
__name: "PvButton",
|
|
101
101
|
props: {
|
|
102
102
|
variant: { default: "primary" },
|
|
@@ -120,60 +120,60 @@ var P = [
|
|
|
120
120
|
rightCounterBadge: {},
|
|
121
121
|
ariaLabel: {}
|
|
122
122
|
},
|
|
123
|
-
setup(
|
|
124
|
-
let
|
|
123
|
+
setup(e) {
|
|
124
|
+
let n = e, r = i(() => !n.label || n.loading ? n.label || n.ariaLabel : void 0), c = i(() => {
|
|
125
125
|
let e = [];
|
|
126
|
-
|
|
127
|
-
let t =
|
|
126
|
+
n.inverse && z.includes(n.variant) ? e.push(`pv-button-${n.variant}-inverse`) : e.push(`pv-button-${n.variant}`);
|
|
127
|
+
let t = V(n.size);
|
|
128
128
|
return t && e.push(t), e;
|
|
129
129
|
});
|
|
130
|
-
return (
|
|
130
|
+
return (n, i) => (S(), s("button", {
|
|
131
131
|
type: "button",
|
|
132
|
-
class:
|
|
133
|
-
disabled:
|
|
134
|
-
"aria-label":
|
|
132
|
+
class: g(c.value),
|
|
133
|
+
disabled: e.disabled,
|
|
134
|
+
"aria-label": r.value,
|
|
135
135
|
"data-testid": "pv-button"
|
|
136
|
-
}, [
|
|
136
|
+
}, [e.loading ? (S(), a(R, {
|
|
137
137
|
key: 0,
|
|
138
138
|
size: "sm"
|
|
139
|
-
})) : (
|
|
140
|
-
|
|
139
|
+
})) : (S(), s(t, { key: 1 }, [
|
|
140
|
+
e.leftCounterBadge ? (S(), a(G, {
|
|
141
141
|
key: 0,
|
|
142
|
-
value:
|
|
142
|
+
value: e.leftCounterBadge,
|
|
143
143
|
variant: "tertiary"
|
|
144
|
-
}, null, 8, ["value"])) :
|
|
145
|
-
|
|
144
|
+
}, null, 8, ["value"])) : o("", !0),
|
|
145
|
+
e.leftIcon ? (S(), a(U, {
|
|
146
146
|
key: 1,
|
|
147
|
-
name:
|
|
147
|
+
name: e.leftIcon,
|
|
148
148
|
"data-testid": "pv-button-left-icon"
|
|
149
|
-
}, null, 8, ["name"])) :
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
}, null, 8, ["name"])) : o("", !0),
|
|
150
|
+
e.label ? (S(), s("span", ae, E(e.label), 1)) : o("", !0),
|
|
151
|
+
e.rightCounterBadge ? (S(), a(G, {
|
|
152
152
|
key: 3,
|
|
153
|
-
value:
|
|
153
|
+
value: e.rightCounterBadge,
|
|
154
154
|
variant: "tertiary"
|
|
155
|
-
}, null, 8, ["value"])) :
|
|
156
|
-
|
|
155
|
+
}, null, 8, ["value"])) : o("", !0),
|
|
156
|
+
e.rightIcon ? (S(), a(U, {
|
|
157
157
|
key: 4,
|
|
158
|
-
name:
|
|
158
|
+
name: e.rightIcon,
|
|
159
159
|
"data-testid": "pv-button-right-icon"
|
|
160
|
-
}, null, 8, ["name"])) :
|
|
161
|
-
], 64))], 10,
|
|
160
|
+
}, null, 8, ["name"])) : o("", !0)
|
|
161
|
+
], 64))], 10, ie));
|
|
162
162
|
}
|
|
163
|
-
}),
|
|
163
|
+
}), q = ["for"], J = {
|
|
164
164
|
key: 0,
|
|
165
165
|
class: "pv-surface-accent pv-inset-square pv-text-body-md pv-radius pv-bordered",
|
|
166
166
|
style: { "--inset-size": "6px 10px" }
|
|
167
|
-
},
|
|
167
|
+
}, oe = { class: "pv-relative pv-flex-item" }, se = [
|
|
168
168
|
"disabled",
|
|
169
169
|
"type",
|
|
170
170
|
"placeholder",
|
|
171
171
|
"id",
|
|
172
172
|
"data-invalid",
|
|
173
173
|
"step"
|
|
174
|
-
],
|
|
174
|
+
], ce = /* @__PURE__ */ d({
|
|
175
175
|
__name: "PvInput",
|
|
176
|
-
props: /* @__PURE__ */
|
|
176
|
+
props: /* @__PURE__ */ p({
|
|
177
177
|
showLabel: { type: Boolean },
|
|
178
178
|
error: { type: Boolean },
|
|
179
179
|
disabled: { type: Boolean },
|
|
@@ -190,84 +190,84 @@ var P = [
|
|
|
190
190
|
modelModifiers: {}
|
|
191
191
|
}),
|
|
192
192
|
emits: ["update:modelValue"],
|
|
193
|
-
setup(
|
|
194
|
-
let
|
|
195
|
-
return (
|
|
196
|
-
|
|
193
|
+
setup(e) {
|
|
194
|
+
let n = e, r = k(e, "modelValue"), l = i(() => n.inputIcon ? { "--inset-size": "8px 12px 6px 36px" } : {});
|
|
195
|
+
return (n, i) => (S(), s(t, null, [
|
|
196
|
+
n.$slots.label || e.showLabel ? (S(), s("label", {
|
|
197
197
|
key: 0,
|
|
198
198
|
"data-testid": "pv-input-label",
|
|
199
199
|
class: "pv-label pv-stack-8",
|
|
200
|
-
for:
|
|
201
|
-
}, [
|
|
202
|
-
|
|
200
|
+
for: e.id
|
|
201
|
+
}, [T(n.$slots, "label")], 8, q)) : o("", !0),
|
|
202
|
+
c("div", { class: g(["pv-flex pv-flex-item", { "pv-stack-8": e.lowerLabel }]) }, [e.prefixLabel ? (S(), s("div", J, E(e.prefixLabel), 1)) : o("", !0), c("div", oe, [e.inputIcon ? (S(), a(U, {
|
|
203
203
|
key: 0,
|
|
204
204
|
class: "pv-absolute input-icon-position",
|
|
205
|
-
name:
|
|
206
|
-
}, null, 8, ["name"])) :
|
|
207
|
-
"onUpdate:modelValue":
|
|
205
|
+
name: e.inputIcon
|
|
206
|
+
}, null, 8, ["name"])) : o("", !0), I(c("input", m(n.$attrs, {
|
|
207
|
+
"onUpdate:modelValue": i[0] ||= (e) => r.value = e,
|
|
208
208
|
"data-testid": "pv-input",
|
|
209
209
|
class: ["pv-input-text", {
|
|
210
|
-
"pv-inset-square":
|
|
211
|
-
"pv-surface-accent":
|
|
210
|
+
"pv-inset-square": e.inputIcon,
|
|
211
|
+
"pv-surface-accent": e.variant === "grey"
|
|
212
212
|
}],
|
|
213
213
|
style: [l.value, { width: "100%" }],
|
|
214
|
-
disabled:
|
|
215
|
-
type:
|
|
216
|
-
placeholder:
|
|
217
|
-
id:
|
|
218
|
-
"data-invalid":
|
|
219
|
-
step:
|
|
220
|
-
}), null, 16,
|
|
221
|
-
|
|
214
|
+
disabled: e.disabled,
|
|
215
|
+
type: e.type,
|
|
216
|
+
placeholder: e.placeholder,
|
|
217
|
+
id: e.id,
|
|
218
|
+
"data-invalid": e.error ? !0 : void 0,
|
|
219
|
+
step: e.step
|
|
220
|
+
}), null, 16, se), [[M, r.value]])])], 2),
|
|
221
|
+
e.lowerLabel ? (S(), s("p", {
|
|
222
222
|
key: 1,
|
|
223
223
|
"data-testid": "pv-input-lower-label",
|
|
224
224
|
style: { "margin-left": "12px" },
|
|
225
|
-
class:
|
|
226
|
-
"pv-text-red":
|
|
227
|
-
"pv-text-subdued": !
|
|
225
|
+
class: g(["pv-text-body-xs", {
|
|
226
|
+
"pv-text-red": e.error,
|
|
227
|
+
"pv-text-subdued": !e.error
|
|
228
228
|
}])
|
|
229
|
-
},
|
|
229
|
+
}, E(e.lowerLabel), 3)) : o("", !0)
|
|
230
230
|
], 64));
|
|
231
231
|
}
|
|
232
|
-
}),
|
|
232
|
+
}), le = ["onKeydown"], ue = { class: "pv-question__header pv-inset-square-16 pv-space-between" }, de = {
|
|
233
233
|
class: "pv-question__header-copy pv-flex-vertical pv-flex-item",
|
|
234
234
|
style: {
|
|
235
235
|
"--flex-align": "flex-start",
|
|
236
236
|
"--flex-gap": "4px",
|
|
237
237
|
"min-width": "0"
|
|
238
238
|
}
|
|
239
|
-
},
|
|
239
|
+
}, fe = {
|
|
240
240
|
key: 0,
|
|
241
241
|
class: "pv-text-body-md pv-text-tertiary"
|
|
242
|
-
},
|
|
242
|
+
}, pe = { class: "pv-question__header-actions pv-flex" }, me = {
|
|
243
243
|
key: 0,
|
|
244
244
|
class: "pv-text-body-xs pv-text-tertiary",
|
|
245
245
|
role: "status",
|
|
246
246
|
"aria-live": "polite"
|
|
247
|
-
},
|
|
247
|
+
}, he = {
|
|
248
248
|
class: "pv-question__body pv-border-bottom",
|
|
249
249
|
style: { "padding-bottom": "2px" }
|
|
250
|
-
},
|
|
250
|
+
}, ge = {
|
|
251
251
|
class: "pv-question__options pv-flex-vertical pv-inset-inline-16",
|
|
252
252
|
style: {
|
|
253
253
|
"--flex-align": "stretch",
|
|
254
254
|
"--flex-gap": "2px"
|
|
255
255
|
}
|
|
256
|
-
},
|
|
256
|
+
}, _e = ["aria-activedescendant"], ve = [
|
|
257
257
|
"id",
|
|
258
258
|
"aria-selected",
|
|
259
259
|
"data-active",
|
|
260
260
|
"onClick",
|
|
261
261
|
"onMouseenter"
|
|
262
|
-
],
|
|
262
|
+
], ye = {
|
|
263
263
|
class: "pv-question__answer-text pv-flex-item pv-text-title-md",
|
|
264
264
|
style: { "min-width": "0" }
|
|
265
|
-
},
|
|
265
|
+
}, be = ["title"], xe = { class: "pv-visually-hidden" }, Se = ["data-active"], Ce = { class: "pv-question__chat-badge pv-flex pv-radius pv-text-subdued" }, we = {
|
|
266
266
|
class: "pv-question__chat-input pv-flex-item",
|
|
267
267
|
style: { "min-width": "0" }
|
|
268
|
-
},
|
|
268
|
+
}, Te = { class: "pv-question__footer pv-inset-squish-12 pv-space-between" }, Ee = /* @__PURE__ */ W(/* @__PURE__ */ d({
|
|
269
269
|
__name: "PvQuestion",
|
|
270
|
-
props: /* @__PURE__ */
|
|
270
|
+
props: /* @__PURE__ */ p({
|
|
271
271
|
chatInputLabel: { default: "Other answer" },
|
|
272
272
|
chatInputPlaceholder: { default: "Something else..." },
|
|
273
273
|
currentQuestion: { default: 1 },
|
|
@@ -281,90 +281,90 @@ var P = [
|
|
|
281
281
|
chatInput: { default: "" },
|
|
282
282
|
chatInputModifiers: {}
|
|
283
283
|
}),
|
|
284
|
-
emits: /* @__PURE__ */
|
|
284
|
+
emits: /* @__PURE__ */ p([
|
|
285
285
|
"close",
|
|
286
286
|
"select",
|
|
287
287
|
"skip",
|
|
288
288
|
"submit"
|
|
289
289
|
], ["update:modelValue", "update:chatInput"]),
|
|
290
|
-
setup(
|
|
291
|
-
let
|
|
292
|
-
|
|
293
|
-
let t =
|
|
294
|
-
t >= 0 && (
|
|
295
|
-
}),
|
|
290
|
+
setup(e, { emit: n }) {
|
|
291
|
+
let r = e, l = n, d = k(e, "modelValue"), f = k(e, "chatInput"), p = O(), m = `${p}-heading`, g = `${p}-keyboard-hint`, _ = C(), v = C(), y = r.options.findIndex((e) => e.id === d.value), b = C(Math.max(y, 0)), x = i(() => r.totalQuestions > 1), T = i(() => b.value < r.options.length ? D(b.value) : void 0);
|
|
292
|
+
P(d, (e) => {
|
|
293
|
+
let t = r.options.findIndex((t) => t.id === e);
|
|
294
|
+
t >= 0 && (b.value = t);
|
|
295
|
+
}), P(() => r.options.map((e) => e.id), (e, t) => {
|
|
296
296
|
let n = e.findIndex((e) => e === d.value);
|
|
297
297
|
if (n >= 0) {
|
|
298
|
-
|
|
298
|
+
b.value = n;
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
|
-
if (
|
|
302
|
-
|
|
301
|
+
if (b.value === t.length) {
|
|
302
|
+
b.value = e.length;
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
let r = t[
|
|
306
|
-
|
|
305
|
+
let r = t[b.value], i = e.indexOf(r);
|
|
306
|
+
b.value = i >= 0 ? i : Math.min(b.value, Math.max(e.length - 1, 0));
|
|
307
307
|
});
|
|
308
|
+
function D(e) {
|
|
309
|
+
return `${p}-option-${e}`;
|
|
310
|
+
}
|
|
308
311
|
function A(e) {
|
|
309
|
-
|
|
312
|
+
r.options.length && (b.value = e, h(() => _.value?.focus()));
|
|
310
313
|
}
|
|
311
|
-
function j(
|
|
312
|
-
|
|
314
|
+
function j() {
|
|
315
|
+
b.value = r.options.length, h(() => v.value?.querySelector("input")?.focus());
|
|
313
316
|
}
|
|
314
|
-
function M() {
|
|
315
|
-
|
|
317
|
+
function M(e, t) {
|
|
318
|
+
b.value = t, d.value = e.id, l("select", e);
|
|
316
319
|
}
|
|
317
320
|
function N(e, t) {
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
function P(e, t) {
|
|
321
|
-
N(e, t), f(() => b.value?.focus());
|
|
321
|
+
M(e, t), h(() => _.value?.focus());
|
|
322
322
|
}
|
|
323
323
|
function F() {
|
|
324
|
-
|
|
324
|
+
b.value >= r.options.length && (b.value = 0);
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
e.key === "ArrowDown" ? (e.preventDefault(),
|
|
326
|
+
function I(e) {
|
|
327
|
+
e.key === "ArrowDown" ? (e.preventDefault(), b.value >= r.options.length - 1 ? j() : b.value += 1) : e.key === "ArrowUp" ? (e.preventDefault(), b.value <= 0 ? j() : --b.value) : e.key === "Enter" && r.options[b.value] && (e.preventDefault(), M(r.options[b.value], b.value));
|
|
328
328
|
}
|
|
329
329
|
function R() {
|
|
330
|
-
|
|
330
|
+
b.value = r.options.length, d.value = void 0;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
if (!(!
|
|
334
|
-
if (e.key === "ArrowDown") e.preventDefault(),
|
|
335
|
-
else if (e.key === "ArrowUp") e.preventDefault(),
|
|
332
|
+
function z(e) {
|
|
333
|
+
if (!(!r.options.length && (e.key === "ArrowDown" || e.key === "ArrowUp"))) {
|
|
334
|
+
if (e.key === "ArrowDown") e.preventDefault(), A(0);
|
|
335
|
+
else if (e.key === "ArrowUp") e.preventDefault(), A(r.options.length - 1);
|
|
336
336
|
else if (e.key === "Enter" && !e.isComposing) {
|
|
337
337
|
e.preventDefault();
|
|
338
|
-
let t =
|
|
339
|
-
t &&
|
|
338
|
+
let t = f.value.trim();
|
|
339
|
+
t && l("submit", t);
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
function
|
|
344
|
-
|
|
343
|
+
function B() {
|
|
344
|
+
l("close");
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
346
|
+
function V() {
|
|
347
|
+
l("skip");
|
|
348
348
|
}
|
|
349
|
-
return (
|
|
349
|
+
return (n, r) => (S(), s("section", {
|
|
350
350
|
class: "pv-question pv-card pv-surface pv-full-width",
|
|
351
351
|
"data-testid": "pv-question",
|
|
352
|
-
"aria-labelledby":
|
|
353
|
-
onKeydown:
|
|
352
|
+
"aria-labelledby": m,
|
|
353
|
+
onKeydown: ee(L(V, ["stop", "prevent"]), ["esc"])
|
|
354
354
|
}, [
|
|
355
|
-
|
|
356
|
-
id:
|
|
355
|
+
c("header", ue, [c("div", de, [c("h3", {
|
|
356
|
+
id: m,
|
|
357
357
|
class: "pv-heading-3"
|
|
358
|
-
},
|
|
358
|
+
}, E(e.headerLabel), 1), e.subheader ? (S(), s("p", fe, E(e.subheader), 1)) : o("", !0)]), c("div", pe, [x.value ? (S(), s("span", me, E(e.currentQuestion) + " of " + E(e.totalQuestions), 1)) : o("", !0), u(K, {
|
|
359
359
|
ariaLabel: "Close",
|
|
360
360
|
leftIcon: "close",
|
|
361
361
|
size: "md",
|
|
362
362
|
variant: "ghost",
|
|
363
|
-
onClick:
|
|
363
|
+
onClick: B
|
|
364
364
|
})])]),
|
|
365
|
-
|
|
365
|
+
c("div", he, [c("div", ge, [c("div", {
|
|
366
366
|
ref_key: "listboxRef",
|
|
367
|
-
ref:
|
|
367
|
+
ref: _,
|
|
368
368
|
class: "pv-question__listbox pv-flex-vertical",
|
|
369
369
|
style: {
|
|
370
370
|
"--flex-align": "stretch",
|
|
@@ -373,103 +373,103 @@ var P = [
|
|
|
373
373
|
"data-testid": "pv-question-listbox",
|
|
374
374
|
role: "listbox",
|
|
375
375
|
tabindex: "0",
|
|
376
|
-
"aria-activedescendant":
|
|
376
|
+
"aria-activedescendant": T.value,
|
|
377
377
|
"aria-describedby": g,
|
|
378
|
-
"aria-labelledby":
|
|
378
|
+
"aria-labelledby": m,
|
|
379
379
|
onFocus: F,
|
|
380
|
-
onKeydown:
|
|
381
|
-
}, [(
|
|
382
|
-
id:
|
|
380
|
+
onKeydown: I
|
|
381
|
+
}, [(S(!0), s(t, null, w(e.options, (e, t) => (S(), s("div", {
|
|
382
|
+
id: D(t),
|
|
383
383
|
key: e.id,
|
|
384
384
|
class: "pv-question__option pv-flex pv-inset-squish-12 pv-radius-lg",
|
|
385
385
|
"data-testid": "pv-question-option",
|
|
386
386
|
role: "option",
|
|
387
387
|
"aria-selected": d.value === e.id,
|
|
388
|
-
"data-active":
|
|
389
|
-
onClick: (n) =>
|
|
390
|
-
onMouseenter: (e) =>
|
|
388
|
+
"data-active": b.value === t || void 0,
|
|
389
|
+
onClick: (n) => N(e, t),
|
|
390
|
+
onMouseenter: (e) => b.value = t
|
|
391
391
|
}, [
|
|
392
|
-
|
|
392
|
+
u(G, {
|
|
393
393
|
value: t + 1,
|
|
394
394
|
size: "sm",
|
|
395
395
|
variant: "tertiary"
|
|
396
396
|
}, null, 8, ["value"]),
|
|
397
|
-
|
|
398
|
-
e.helpText ? (
|
|
397
|
+
c("span", ye, E(e.label), 1),
|
|
398
|
+
e.helpText ? (S(), s("span", {
|
|
399
399
|
key: 0,
|
|
400
400
|
class: "pv-question__help pv-flex",
|
|
401
401
|
style: { "--flex-gap": "0" },
|
|
402
402
|
title: e.helpText
|
|
403
|
-
}, [
|
|
403
|
+
}, [u(U, {
|
|
404
404
|
class: "pv-text-tertiary",
|
|
405
405
|
name: "info-circle",
|
|
406
406
|
size: 12
|
|
407
|
-
}),
|
|
408
|
-
d.value === e.id ? (
|
|
407
|
+
}), c("span", xe, E(e.helpText), 1)], 8, be)) : o("", !0),
|
|
408
|
+
d.value === e.id ? (S(), a(U, {
|
|
409
409
|
key: 1,
|
|
410
410
|
class: "pv-question__check pv-text-brand",
|
|
411
411
|
name: "check"
|
|
412
|
-
})) :
|
|
413
|
-
|
|
412
|
+
})) : o("", !0),
|
|
413
|
+
u(U, {
|
|
414
414
|
class: "pv-question__chevron pv-text-tertiary",
|
|
415
415
|
name: "chevron-right"
|
|
416
416
|
})
|
|
417
|
-
], 40,
|
|
417
|
+
], 40, ve))), 128))], 40, _e), c("div", {
|
|
418
418
|
ref_key: "chatInputWrapperRef",
|
|
419
|
-
ref:
|
|
419
|
+
ref: v,
|
|
420
420
|
class: "pv-question__chat pv-flex pv-inset-squish-12 pv-radius-lg",
|
|
421
421
|
"data-testid": "pv-question-chat",
|
|
422
|
-
"data-active":
|
|
423
|
-
onClick:
|
|
424
|
-
onMouseenter:
|
|
422
|
+
"data-active": b.value === e.options.length || void 0,
|
|
423
|
+
onClick: j,
|
|
424
|
+
onMouseenter: r[1] ||= (t) => b.value = e.options.length
|
|
425
425
|
}, [
|
|
426
|
-
|
|
426
|
+
c("span", Ce, [u(U, {
|
|
427
427
|
name: "text-search",
|
|
428
428
|
size: 12
|
|
429
429
|
})]),
|
|
430
|
-
|
|
431
|
-
modelValue:
|
|
432
|
-
"onUpdate:modelValue":
|
|
433
|
-
"aria-label":
|
|
434
|
-
placeholder:
|
|
430
|
+
c("div", we, [u(ce, {
|
|
431
|
+
modelValue: f.value,
|
|
432
|
+
"onUpdate:modelValue": r[0] ||= (e) => f.value = e,
|
|
433
|
+
"aria-label": e.chatInputLabel,
|
|
434
|
+
placeholder: e.chatInputPlaceholder,
|
|
435
435
|
onFocus: R,
|
|
436
|
-
onKeydown:
|
|
436
|
+
onKeydown: z
|
|
437
437
|
}, null, 8, [
|
|
438
438
|
"modelValue",
|
|
439
439
|
"aria-label",
|
|
440
440
|
"placeholder"
|
|
441
441
|
])]),
|
|
442
|
-
|
|
442
|
+
u(U, {
|
|
443
443
|
class: "pv-question__chevron pv-text-tertiary",
|
|
444
444
|
name: "chevron-right"
|
|
445
445
|
})
|
|
446
|
-
], 40,
|
|
447
|
-
|
|
446
|
+
], 40, Se)])]),
|
|
447
|
+
c("footer", Te, [c("span", {
|
|
448
448
|
id: g,
|
|
449
449
|
class: "pv-text-body-xs pv-text-tertiary"
|
|
450
|
-
}, "↑↓ to navigate • Enter to select • Esc to skip"),
|
|
450
|
+
}, "↑↓ to navigate • Enter to select • Esc to skip"), u(K, {
|
|
451
451
|
class: "pv-question__skip",
|
|
452
452
|
label: "Skip",
|
|
453
453
|
size: "lg",
|
|
454
454
|
variant: "secondary",
|
|
455
|
-
onClick:
|
|
455
|
+
onClick: V
|
|
456
456
|
})])
|
|
457
|
-
], 40,
|
|
457
|
+
], 40, le));
|
|
458
458
|
}
|
|
459
|
-
}), [["__scopeId", "data-v-38f26601"]]),
|
|
459
|
+
}), [["__scopeId", "data-v-38f26601"]]), De = {
|
|
460
460
|
key: 0,
|
|
461
461
|
class: "pv-confirmation pv-bordered pv-radius pv-inset-square-16 pv-flow-16",
|
|
462
462
|
"data-testid": "pv-confirmation",
|
|
463
463
|
"aria-label": "Tool approval"
|
|
464
|
-
},
|
|
464
|
+
}, Oe = { class: "pv-text-body-sm" }, ke = { class: "pv-flex pv-confirmation__actions" }, Ae = {
|
|
465
465
|
key: 1,
|
|
466
466
|
class: "pv-flex pv-text-body-sm pv-text-success",
|
|
467
467
|
role: "status"
|
|
468
|
-
},
|
|
468
|
+
}, je = {
|
|
469
469
|
key: 2,
|
|
470
470
|
class: "pv-flex pv-text-body-sm pv-text-critical",
|
|
471
471
|
role: "status"
|
|
472
|
-
},
|
|
472
|
+
}, Me = /* @__PURE__ */ W(/* @__PURE__ */ d({
|
|
473
473
|
__name: "PvConfirmation",
|
|
474
474
|
props: {
|
|
475
475
|
approval: {},
|
|
@@ -483,45 +483,45 @@ var P = [
|
|
|
483
483
|
state: {}
|
|
484
484
|
},
|
|
485
485
|
emits: ["respond"],
|
|
486
|
-
setup(
|
|
487
|
-
let
|
|
486
|
+
setup(e, { emit: n }) {
|
|
487
|
+
let r = e, a = n, d = i(() => r.state === "approval-requested" && r.approval !== void 0 && r.approval.approved === void 0), f = i(() => r.approval?.approved === !0 && (r.state === "approval-responded" || r.state === "input-available" || r.state === "output-available")), p = i(() => r.approval?.approved === !1 || r.state === "output-denied");
|
|
488
488
|
function m(e) {
|
|
489
|
-
|
|
490
|
-
id:
|
|
489
|
+
a("respond", {
|
|
490
|
+
id: r.approval.id,
|
|
491
491
|
approved: e
|
|
492
492
|
});
|
|
493
493
|
}
|
|
494
|
-
return (
|
|
494
|
+
return (n, r) => d.value || f.value || p.value ? (S(), s("section", De, [d.value ? (S(), s(t, { key: 0 }, [c("div", Oe, [T(n.$slots, "default", {}, () => [l(E(e.message), 1)], !0)]), c("div", ke, [u(K, {
|
|
495
495
|
variant: "secondary",
|
|
496
496
|
size: "md",
|
|
497
|
-
label:
|
|
498
|
-
disabled:
|
|
499
|
-
onClick:
|
|
500
|
-
}, null, 8, ["label", "disabled"]),
|
|
497
|
+
label: e.rejectLabel,
|
|
498
|
+
disabled: e.disabled,
|
|
499
|
+
onClick: r[0] ||= (e) => m(!1)
|
|
500
|
+
}, null, 8, ["label", "disabled"]), u(K, {
|
|
501
501
|
size: "md",
|
|
502
|
-
label:
|
|
503
|
-
disabled:
|
|
504
|
-
onClick:
|
|
505
|
-
}, null, 8, ["label", "disabled"])])], 64)) : f.value ? (
|
|
502
|
+
label: e.approveLabel,
|
|
503
|
+
disabled: e.disabled,
|
|
504
|
+
onClick: r[1] ||= (e) => m(!0)
|
|
505
|
+
}, null, 8, ["label", "disabled"])])], 64)) : f.value ? (S(), s("p", Ae, [u(U, {
|
|
506
506
|
name: "check-circle",
|
|
507
507
|
size: 20
|
|
508
|
-
}),
|
|
508
|
+
}), T(n.$slots, "accepted", {}, () => [r[2] ||= l("You approved this tool execution.", -1)], !0)])) : (S(), s("p", je, [u(U, {
|
|
509
509
|
name: "close-circle",
|
|
510
510
|
size: 20
|
|
511
|
-
}),
|
|
511
|
+
}), T(n.$slots, "rejected", {}, () => [r[3] ||= l("You rejected this tool execution.", -1)], !0)]))])) : o("", !0);
|
|
512
512
|
}
|
|
513
|
-
}), [["__scopeId", "data-v-c200deca"]]),
|
|
513
|
+
}), [["__scopeId", "data-v-c200deca"]]), Ne = {
|
|
514
514
|
class: "pv-flex-vertical",
|
|
515
515
|
style: { "--flex-align": "flex-start" }
|
|
516
|
-
},
|
|
516
|
+
}, Pe = ["for"], Fe = [
|
|
517
517
|
"rows",
|
|
518
518
|
"disabled",
|
|
519
519
|
"placeholder",
|
|
520
520
|
"id",
|
|
521
521
|
"data-invalid"
|
|
522
|
-
],
|
|
522
|
+
], Ie = /* @__PURE__ */ d({
|
|
523
523
|
__name: "PvTextArea",
|
|
524
|
-
props: /* @__PURE__ */
|
|
524
|
+
props: /* @__PURE__ */ p({
|
|
525
525
|
error: { type: Boolean },
|
|
526
526
|
disabled: { type: Boolean },
|
|
527
527
|
placeholder: {},
|
|
@@ -535,41 +535,41 @@ var P = [
|
|
|
535
535
|
}),
|
|
536
536
|
emits: ["update:modelValue"],
|
|
537
537
|
setup(e) {
|
|
538
|
-
let t =
|
|
539
|
-
return (n,
|
|
540
|
-
n.$slots.label ? (
|
|
538
|
+
let t = k(e, "modelValue");
|
|
539
|
+
return (n, r) => (S(), s("div", Ne, [
|
|
540
|
+
n.$slots.label ? (S(), s("label", {
|
|
541
541
|
key: 0,
|
|
542
542
|
class: "pv-label",
|
|
543
543
|
for: e.id
|
|
544
|
-
}, [
|
|
545
|
-
|
|
546
|
-
"onUpdate:modelValue":
|
|
544
|
+
}, [T(n.$slots, "label")], 8, Pe)) : o("", !0),
|
|
545
|
+
I(c("textarea", m(n.$attrs, {
|
|
546
|
+
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
547
547
|
class: ["pv-textarea", { "pv-surface-accent": e.variant === "grey" }],
|
|
548
548
|
rows: e.rows,
|
|
549
549
|
disabled: e.disabled,
|
|
550
550
|
placeholder: e.placeholder,
|
|
551
551
|
id: e.id,
|
|
552
552
|
"data-invalid": e.error ? !0 : void 0
|
|
553
|
-
}), null, 16,
|
|
554
|
-
e.lowerLabel ? (
|
|
553
|
+
}), null, 16, Fe), [[N, t.value]]),
|
|
554
|
+
e.lowerLabel ? (S(), s("p", {
|
|
555
555
|
key: 1,
|
|
556
556
|
style: { "margin-left": "12px" },
|
|
557
|
-
class:
|
|
557
|
+
class: g(["pv-text-body-xs", {
|
|
558
558
|
"pv-text-red": e.error,
|
|
559
559
|
"pv-text-subdued": !e.error
|
|
560
560
|
}])
|
|
561
|
-
},
|
|
561
|
+
}, E(e.lowerLabel), 3)) : o("", !0)
|
|
562
562
|
]));
|
|
563
563
|
}
|
|
564
|
-
}),
|
|
564
|
+
}), Le = ["aria-busy"], Re = {
|
|
565
565
|
key: 0,
|
|
566
566
|
class: "pv-full-width pv-flow-8"
|
|
567
|
-
},
|
|
567
|
+
}, ze = { class: "pv-prompt-input__footer pv-flex pv-full-width" }, Be = { class: "pv-prompt-input__actions pv-flex pv-flex-item" }, Ve = {
|
|
568
568
|
class: "pv-visually-hidden",
|
|
569
569
|
"aria-live": "polite"
|
|
570
|
-
},
|
|
570
|
+
}, He = /* @__PURE__ */ W(/* @__PURE__ */ d({
|
|
571
571
|
__name: "PvPromptInput",
|
|
572
|
-
props: /* @__PURE__ */
|
|
572
|
+
props: /* @__PURE__ */ p({
|
|
573
573
|
ariaLabel: { default: "Message" },
|
|
574
574
|
disabled: {
|
|
575
575
|
type: Boolean,
|
|
@@ -585,38 +585,38 @@ var P = [
|
|
|
585
585
|
modelValue: { default: "" },
|
|
586
586
|
modelModifiers: {}
|
|
587
587
|
}),
|
|
588
|
-
emits: /* @__PURE__ */
|
|
589
|
-
setup(
|
|
590
|
-
let
|
|
591
|
-
function
|
|
592
|
-
|
|
588
|
+
emits: /* @__PURE__ */ p(["submit", "stop"], ["update:modelValue"]),
|
|
589
|
+
setup(e, { emit: n }) {
|
|
590
|
+
let r = e, a = n, d = k(e, "modelValue"), f = C(), p = i(() => r.status === "submitted" || r.status === "streaming"), m = i(() => !r.disabled && !p.value && d.value.trim().length > 0);
|
|
591
|
+
function h() {
|
|
592
|
+
m.value && a("submit", d.value.trim());
|
|
593
593
|
}
|
|
594
|
-
function
|
|
595
|
-
|
|
594
|
+
function g(e) {
|
|
595
|
+
r.disabled || e.target?.closest("button, a, input, textarea, select, [tabindex]") || f.value?.querySelector("textarea")?.focus();
|
|
596
596
|
}
|
|
597
|
-
function
|
|
598
|
-
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), e.stopPropagation(),
|
|
597
|
+
function v(e) {
|
|
598
|
+
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), e.stopPropagation(), h());
|
|
599
599
|
}
|
|
600
|
-
return (
|
|
600
|
+
return (n, r) => (S(), s("form", {
|
|
601
601
|
ref_key: "formRef",
|
|
602
602
|
ref: f,
|
|
603
603
|
class: "pv-prompt-input pv-bordered pv-radius pv-inset-square-8 pv-flex-vertical",
|
|
604
604
|
"data-testid": "pv-prompt-input",
|
|
605
605
|
"aria-busy": p.value,
|
|
606
|
-
onSubmit:
|
|
607
|
-
onClick:
|
|
606
|
+
onSubmit: L(h, ["prevent"]),
|
|
607
|
+
onClick: g
|
|
608
608
|
}, [
|
|
609
|
-
|
|
610
|
-
|
|
609
|
+
n.$slots.header ? (S(), s("div", Re, [T(n.$slots, "header", {}, void 0, !0)])) : o("", !0),
|
|
610
|
+
u(Ie, {
|
|
611
611
|
modelValue: d.value,
|
|
612
|
-
"onUpdate:modelValue":
|
|
612
|
+
"onUpdate:modelValue": r[0] ||= (e) => d.value = e,
|
|
613
613
|
class: "pv-prompt-input__textarea",
|
|
614
|
-
style:
|
|
615
|
-
rows:
|
|
616
|
-
placeholder:
|
|
617
|
-
disabled:
|
|
618
|
-
"aria-label":
|
|
619
|
-
onKeydown:
|
|
614
|
+
style: _({ "--prompt-input-max-height": e.maxHeight }),
|
|
615
|
+
rows: e.rows,
|
|
616
|
+
placeholder: e.placeholder,
|
|
617
|
+
disabled: e.disabled,
|
|
618
|
+
"aria-label": e.ariaLabel,
|
|
619
|
+
onKeydown: v
|
|
620
620
|
}, null, 8, [
|
|
621
621
|
"modelValue",
|
|
622
622
|
"style",
|
|
@@ -625,14 +625,14 @@ var P = [
|
|
|
625
625
|
"disabled",
|
|
626
626
|
"aria-label"
|
|
627
627
|
]),
|
|
628
|
-
|
|
628
|
+
c("div", ze, [c("div", Be, [T(n.$slots, "actions", {}, void 0, !0)]), u(K, {
|
|
629
629
|
type: p.value ? "button" : "submit",
|
|
630
630
|
variant: p.value ? "secondary" : "primary",
|
|
631
631
|
size: "md",
|
|
632
632
|
"left-icon": p.value ? "stop" : "send",
|
|
633
|
-
"aria-label": p.value ?
|
|
634
|
-
disabled:
|
|
635
|
-
onClick:
|
|
633
|
+
"aria-label": p.value ? e.stopLabel : e.submitLabel,
|
|
634
|
+
disabled: e.disabled || !p.value && !m.value,
|
|
635
|
+
onClick: r[1] ||= (e) => p.value && a("stop")
|
|
636
636
|
}, null, 8, [
|
|
637
637
|
"type",
|
|
638
638
|
"variant",
|
|
@@ -640,17 +640,17 @@ var P = [
|
|
|
640
640
|
"aria-label",
|
|
641
641
|
"disabled"
|
|
642
642
|
])]),
|
|
643
|
-
|
|
644
|
-
], 40,
|
|
643
|
+
c("p", Ve, [e.status === "submitted" ? (S(), s(t, { key: 0 }, [l("Message submitted.")], 64)) : e.status === "streaming" ? (S(), s(t, { key: 1 }, [l("Response is streaming.")], 64)) : e.status === "error" ? (S(), s(t, { key: 2 }, [l("The message could not be sent.")], 64)) : o("", !0)])
|
|
644
|
+
], 40, Le));
|
|
645
645
|
}
|
|
646
|
-
}), [["__scopeId", "data-v-155361b4"]]),
|
|
646
|
+
}), [["__scopeId", "data-v-155361b4"]]), Ue = [
|
|
647
647
|
"ready",
|
|
648
648
|
"submitted",
|
|
649
649
|
"streaming",
|
|
650
650
|
"error"
|
|
651
|
-
],
|
|
651
|
+
], We = ["open"], Y = /* @__PURE__ */ W(/* @__PURE__ */ d({
|
|
652
652
|
__name: "PvAccordion",
|
|
653
|
-
props: /* @__PURE__ */
|
|
653
|
+
props: /* @__PURE__ */ p({
|
|
654
654
|
chevronPosition: { default: "right" },
|
|
655
655
|
chevronVariant: { default: "vertical" },
|
|
656
656
|
defaultOpen: { type: Boolean },
|
|
@@ -672,49 +672,186 @@ var P = [
|
|
|
672
672
|
modelValue: { type: Boolean },
|
|
673
673
|
modelModifiers: {}
|
|
674
674
|
}),
|
|
675
|
-
emits: /* @__PURE__ */
|
|
676
|
-
setup(
|
|
677
|
-
let
|
|
678
|
-
|
|
675
|
+
emits: /* @__PURE__ */ p(["summary-mouseenter", "summary-mouseleave"], ["update:modelValue"]),
|
|
676
|
+
setup(e) {
|
|
677
|
+
let n = e, r = k(e, "modelValue");
|
|
678
|
+
n.defaultOpen !== void 0 && (r.value = n.defaultOpen);
|
|
679
679
|
let l = (e) => {
|
|
680
|
-
|
|
681
|
-
}, u = { width:
|
|
682
|
-
return (
|
|
680
|
+
r.value = e.target.open;
|
|
681
|
+
}, u = { width: n.enableTriggerFullWidth ? "100%" : "fit-content" }, d = i(() => n.chevronVariant === "horizontal" ? n.chevronPosition === "left" ? r.value ? "chevron-down" : "chevron-right" : r.value ? "chevron-down" : "chevron-left" : r.value ? "chevron-up" : "chevron-down");
|
|
682
|
+
return (n, i) => (S(), s("details", {
|
|
683
683
|
"data-testid": "pv-accordion",
|
|
684
684
|
class: "pv-accordion",
|
|
685
|
-
open:
|
|
685
|
+
open: r.value,
|
|
686
686
|
onToggle: l
|
|
687
|
-
}, [
|
|
688
|
-
class: ["pv-flex pv-space-between pv-relative",
|
|
687
|
+
}, [c("summary", m(e.summaryAttrs, {
|
|
688
|
+
class: ["pv-flex pv-space-between pv-relative", e.summaryClasses],
|
|
689
689
|
style: {
|
|
690
690
|
...u,
|
|
691
|
-
...
|
|
691
|
+
...e.summaryStyles
|
|
692
692
|
},
|
|
693
|
-
onMouseenter:
|
|
694
|
-
onMouseleave:
|
|
693
|
+
onMouseenter: i[0] ||= (e) => n.$emit("summary-mouseenter"),
|
|
694
|
+
onMouseleave: i[1] ||= (e) => n.$emit("summary-mouseleave")
|
|
695
695
|
}), [
|
|
696
|
-
|
|
696
|
+
e.chevronPosition === "left" ? (S(), a(U, {
|
|
697
697
|
key: 0,
|
|
698
|
-
name:
|
|
699
|
-
}, null, 8, ["name"])) :
|
|
700
|
-
|
|
698
|
+
name: d.value
|
|
699
|
+
}, null, 8, ["name"])) : o("", !0),
|
|
700
|
+
e.enableTriggerSlot ? T(n.$slots, "trigger", { key: 1 }, void 0, !0) : (S(), s(t, { key: 2 }, [c("span", null, E(e.header), 1), e.counter ? (S(), a(G, {
|
|
701
701
|
key: 0,
|
|
702
|
-
value:
|
|
702
|
+
value: e.counter,
|
|
703
703
|
variant: "secondary",
|
|
704
704
|
size: "sm"
|
|
705
|
-
}, null, 8, ["value"])) :
|
|
706
|
-
|
|
705
|
+
}, null, 8, ["value"])) : o("", !0)], 64)),
|
|
706
|
+
e.chevronPosition === "right" ? (S(), a(U, {
|
|
707
707
|
key: 3,
|
|
708
|
-
name:
|
|
709
|
-
}, null, 8, ["name"])) :
|
|
710
|
-
], 16),
|
|
708
|
+
name: d.value
|
|
709
|
+
}, null, 8, ["name"])) : o("", !0)
|
|
710
|
+
], 16), c("div", { style: _(e.contentStyles) }, [T(n.$slots, "default", {}, void 0, !0)], 4)], 40, We));
|
|
711
711
|
}
|
|
712
|
-
}), [["__scopeId", "data-v-a64056ef"]])
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
712
|
+
}), [["__scopeId", "data-v-a64056ef"]]);
|
|
713
|
+
//#endregion
|
|
714
|
+
//#region src/composables/useSlotPresence.ts
|
|
715
|
+
function X(e, t) {
|
|
716
|
+
if (e.nodeType !== Node.TEXT_NODE) return !1;
|
|
717
|
+
let n = e.textContent ?? "";
|
|
718
|
+
return t ? n.length > 0 : n.trim().length > 0;
|
|
719
|
+
}
|
|
720
|
+
function Ge(e, t, n) {
|
|
721
|
+
let r = t === "default" ? "" : t, i = Array.from(e.childNodes);
|
|
722
|
+
return r === "" ? i.some((e) => e.nodeType === Node.ELEMENT_NODE ? !e.hasAttribute("slot") : X(e, n)) : i.some((e) => e.nodeType === Node.ELEMENT_NODE ? e.getAttribute("slot") === r : !1);
|
|
723
|
+
}
|
|
724
|
+
function Z(e, t) {
|
|
725
|
+
let n = e.shadowRoot;
|
|
726
|
+
return n ? t === "default" || t === "" ? n.querySelector("slot:not([name])") : n.querySelector(`slot[name="${CSS.escape(t)}"]`) : null;
|
|
727
|
+
}
|
|
728
|
+
function Ke(e, t = {}) {
|
|
729
|
+
let { host: n, vueSlots: r, observe: a = !0, listenSlotChange: o = !0, countWhitespaceTextInDefaultSlot: s = !1 } = t, c = H(), l = r ?? A(), u = e === "default" || e === "" ? "default" : e, d = () => !!l && !!l[u], f = C(d());
|
|
730
|
+
y(() => {
|
|
731
|
+
f.value = d();
|
|
732
|
+
});
|
|
733
|
+
let p = C(!1), m = null, h = null, g = () => {
|
|
734
|
+
m &&= (m.disconnect(), null), h &&= (h.removeEventListener("slotchange", _), null);
|
|
735
|
+
}, _ = () => {
|
|
736
|
+
if (!c.value) {
|
|
737
|
+
p.value = !1;
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
let t = D(n);
|
|
741
|
+
if (!t) {
|
|
742
|
+
p.value = !1;
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
let r = o ? Z(t, e) : null;
|
|
746
|
+
if (r) {
|
|
747
|
+
p.value = r.assignedNodes({ flatten: !0 }).some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : X(e, s));
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
p.value = Ge(t, e, s);
|
|
751
|
+
}, x = () => {
|
|
752
|
+
if (!c.value) return;
|
|
753
|
+
g();
|
|
754
|
+
let t = D(n);
|
|
755
|
+
if (!t) {
|
|
756
|
+
p.value = !1;
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
_(), o && (h = Z(t, e), h && h.addEventListener("slotchange", _)), a && (m = new MutationObserver(() => _()), m.observe(t, {
|
|
760
|
+
childList: !0,
|
|
761
|
+
subtree: !1,
|
|
762
|
+
attributes: !0,
|
|
763
|
+
attributeFilter: ["slot"],
|
|
764
|
+
characterData: !0
|
|
765
|
+
}));
|
|
766
|
+
};
|
|
767
|
+
return b(x), v(g), P(() => D(n), () => {
|
|
768
|
+
c.value && x();
|
|
769
|
+
}), {
|
|
770
|
+
present: i(() => c.value ? p.value : f.value),
|
|
771
|
+
hasVueSlot: f,
|
|
772
|
+
hasNativeSlot: p,
|
|
773
|
+
refresh: _
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
//#endregion
|
|
777
|
+
//#region src/components/ai/PvStepList/PvStepList.vue?vue&type=script&setup=true&lang.ts
|
|
778
|
+
var qe = ["data-status"], Je = {
|
|
779
|
+
key: 0,
|
|
780
|
+
class: "pv-step-marker",
|
|
781
|
+
"aria-hidden": "true"
|
|
782
|
+
}, Ye = {
|
|
783
|
+
key: 1,
|
|
784
|
+
class: "pv-step-dot"
|
|
785
|
+
}, Xe = { class: "pv-step-body pv-flow-4" }, Ze = {
|
|
786
|
+
key: 0,
|
|
787
|
+
class: "pv-step-aside pv-text-body-md pv-text-tertiary"
|
|
788
|
+
}, Qe = {
|
|
789
|
+
class: "pv-flex pv-text-body-md pv-text-medium pv-text-default",
|
|
790
|
+
style: { "--flex-wrap": "wrap" }
|
|
791
|
+
}, $e = {
|
|
792
|
+
key: 0,
|
|
793
|
+
class: "pv-tag-highlight"
|
|
794
|
+
}, et = {
|
|
795
|
+
key: 0,
|
|
796
|
+
class: "pv-text-body-md pv-text-tertiary"
|
|
797
|
+
}, tt = {
|
|
798
|
+
key: 1,
|
|
799
|
+
class: "pv-flex",
|
|
800
|
+
role: "list",
|
|
801
|
+
style: {
|
|
802
|
+
"--flex-wrap": "wrap",
|
|
803
|
+
"--flex-gap": "4px"
|
|
804
|
+
}
|
|
805
|
+
}, nt = {
|
|
806
|
+
key: 2,
|
|
807
|
+
class: "pv-text-body-md pv-text-medium pv-text-brand"
|
|
808
|
+
}, Q = /* @__PURE__ */ W(/* @__PURE__ */ d({
|
|
809
|
+
__name: "PvStepList",
|
|
810
|
+
props: {
|
|
811
|
+
inProgress: {
|
|
812
|
+
type: Boolean,
|
|
813
|
+
default: !1
|
|
814
|
+
},
|
|
815
|
+
steps: { default: () => [] }
|
|
816
|
+
},
|
|
817
|
+
setup(e) {
|
|
818
|
+
let n = e, l = i(() => {
|
|
819
|
+
for (let e = n.steps.length - 1; e >= 0; --e) if (n.steps[e].variant !== "aside") return e;
|
|
820
|
+
return -1;
|
|
821
|
+
});
|
|
822
|
+
function u(e, t) {
|
|
823
|
+
return e.status ? e.status : e.variant === "aside" ? "complete" : n.inProgress && t === l.value ? "active" : "complete";
|
|
824
|
+
}
|
|
825
|
+
return (n, i) => (S(), a(r, {
|
|
826
|
+
tag: "ol",
|
|
827
|
+
name: "pv-step",
|
|
828
|
+
class: "pv-step-list",
|
|
829
|
+
role: "list"
|
|
830
|
+
}, {
|
|
831
|
+
default: F(() => [(S(!0), s(t, null, w(e.steps, (e, n) => (S(), s("li", {
|
|
832
|
+
key: e.id ?? n,
|
|
833
|
+
class: "pv-step",
|
|
834
|
+
"data-status": u(e, n)
|
|
835
|
+
}, [e.variant === "aside" ? o("", !0) : (S(), s("span", Je, [e.icon ? (S(), a(U, {
|
|
836
|
+
key: 0,
|
|
837
|
+
name: e.icon,
|
|
838
|
+
size: 12
|
|
839
|
+
}, null, 8, ["name"])) : (S(), s("span", Ye))])), c("div", Xe, [e.variant === "aside" ? (S(), s("p", Ze, [c("em", null, E(e.label), 1)])) : (S(), s(t, { key: 1 }, [
|
|
840
|
+
c("p", Qe, [c("span", { class: g({ "pv-shimmer": u(e, n) === "active" }) }, E(e.label), 3), e.artifact ? (S(), s("span", $e, E(e.artifact), 1)) : o("", !0)]),
|
|
841
|
+
e.note ? (S(), s("p", et, E(e.note), 1)) : o("", !0),
|
|
842
|
+
e.tags && e.tags.length > 0 ? (S(), s("ul", tt, [(S(!0), s(t, null, w(e.tags, (e, t) => (S(), s("li", {
|
|
843
|
+
key: t,
|
|
844
|
+
class: g(["pv-tag-secondary", { "pv-text-quaternary": e.variant === "muted" }]),
|
|
845
|
+
"data-style": "rounded"
|
|
846
|
+
}, E(e.label), 3))), 128))])) : o("", !0),
|
|
847
|
+
e.outcome ? (S(), s("p", nt, " →\xA0" + E(e.outcome), 1)) : o("", !0)
|
|
848
|
+
], 64))])], 8, qe))), 128))]),
|
|
849
|
+
_: 1
|
|
850
|
+
}));
|
|
851
|
+
}
|
|
852
|
+
}), [["__scopeId", "data-v-5ab7d271"]]), rt = { class: "pv-reasoning__content pv-text-body-sm pv-text-subdued" }, it = /* @__PURE__ */ W(/* @__PURE__ */ d({
|
|
716
853
|
__name: "PvReasoning",
|
|
717
|
-
props: /* @__PURE__ */
|
|
854
|
+
props: /* @__PURE__ */ p({
|
|
718
855
|
autoCloseDelay: { default: 1e3 },
|
|
719
856
|
completedLabel: { default: "Reasoning" },
|
|
720
857
|
defaultOpen: {
|
|
@@ -726,6 +863,7 @@ var P = [
|
|
|
726
863
|
type: Boolean,
|
|
727
864
|
default: !1
|
|
728
865
|
},
|
|
866
|
+
steps: { default: () => [] },
|
|
729
867
|
streamingLabel: { default: "Thinking..." }
|
|
730
868
|
}, {
|
|
731
869
|
open: {
|
|
@@ -735,67 +873,92 @@ var P = [
|
|
|
735
873
|
openModifiers: {}
|
|
736
874
|
}),
|
|
737
875
|
emits: ["update:open"],
|
|
738
|
-
setup(
|
|
739
|
-
let
|
|
740
|
-
(
|
|
741
|
-
let
|
|
742
|
-
if (
|
|
743
|
-
if (
|
|
744
|
-
let e = Math.max(1, Math.round(
|
|
876
|
+
setup(r) {
|
|
877
|
+
let l = r, d = k(r, "open"), f = C(), p = C(), m = C(!1), h;
|
|
878
|
+
(l.defaultOpen || l.isStreaming) && (d.value = !0), l.isStreaming && (p.value = Date.now());
|
|
879
|
+
let _ = i(() => l.duration ?? f.value), y = i(() => {
|
|
880
|
+
if (l.isStreaming) return l.streamingLabel;
|
|
881
|
+
if (_.value === void 0) return l.completedLabel;
|
|
882
|
+
let e = Math.max(1, Math.round(_.value));
|
|
745
883
|
return `Thought for ${e} ${e === 1 ? "second" : "seconds"}`;
|
|
746
|
-
})
|
|
747
|
-
|
|
748
|
-
|
|
884
|
+
}), b = A(), x = j("triggerRef"), { hasNativeSlot: w } = Ke("default", { host: i(() => {
|
|
885
|
+
let e = x.value?.getRootNode();
|
|
886
|
+
return e instanceof ShadowRoot ? e.host : null;
|
|
887
|
+
}) });
|
|
888
|
+
function D(r) {
|
|
889
|
+
return r.some((r) => r.type === e ? !1 : r.type === n ? String(r.children ?? "").trim().length > 0 : r.type === t ? Array.isArray(r.children) && D(r.children) : !0);
|
|
890
|
+
}
|
|
891
|
+
function O() {
|
|
892
|
+
return l.steps.length > 0 || w.value ? !0 : D(b.default?.() ?? []);
|
|
749
893
|
}
|
|
750
|
-
function
|
|
751
|
-
|
|
894
|
+
function M() {
|
|
895
|
+
h !== void 0 && (clearTimeout(h), h = void 0);
|
|
896
|
+
}
|
|
897
|
+
function N(e) {
|
|
898
|
+
let t = e.target?.closest?.("summary");
|
|
899
|
+
!t || t.parentElement !== e.currentTarget || (m.value = !0, M());
|
|
752
900
|
}
|
|
753
|
-
return
|
|
754
|
-
if (
|
|
755
|
-
|
|
901
|
+
return P(() => l.isStreaming, (e, t) => {
|
|
902
|
+
if (M(), e) {
|
|
903
|
+
p.value = Date.now(), f.value = void 0, m.value = !1, d.value = !0;
|
|
756
904
|
return;
|
|
757
905
|
}
|
|
758
|
-
t && (
|
|
759
|
-
|
|
760
|
-
},
|
|
761
|
-
}),
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
"
|
|
906
|
+
t && (p.value !== void 0 && (f.value = (Date.now() - p.value) / 1e3), m.value || (h = setTimeout(() => {
|
|
907
|
+
m.value || (d.value = !1);
|
|
908
|
+
}, l.autoCloseDelay)));
|
|
909
|
+
}), v(M), (e, t) => O() ? (S(), a(Y, {
|
|
910
|
+
key: 0,
|
|
911
|
+
modelValue: d.value,
|
|
912
|
+
"onUpdate:modelValue": t[0] ||= (e) => d.value = e,
|
|
913
|
+
"default-open": d.value,
|
|
765
914
|
class: "pv-reasoning",
|
|
766
915
|
"chevron-position": "left",
|
|
767
916
|
"chevron-variant": "horizontal",
|
|
768
917
|
"enable-trigger-full-width": "",
|
|
769
918
|
"enable-trigger-slot": "",
|
|
770
|
-
"summary-classes": {
|
|
771
|
-
"pv-button-ghost": !0,
|
|
772
|
-
"pv-button-small": !0
|
|
773
|
-
},
|
|
774
919
|
"summary-styles": { justifyContent: "flex-start" },
|
|
775
|
-
onClick:
|
|
920
|
+
onClick: N
|
|
776
921
|
}, {
|
|
777
|
-
trigger:
|
|
922
|
+
trigger: F(() => [c("span", {
|
|
923
|
+
ref_key: "triggerRef",
|
|
924
|
+
ref: x,
|
|
925
|
+
class: "pv-reasoning__trigger pv-flex pv-text-title-md pv-text-subdued",
|
|
926
|
+
"aria-live": "polite"
|
|
927
|
+
}, [T(e.$slots, "trigger", {}, () => [u(U, {
|
|
778
928
|
name: "brain",
|
|
779
929
|
size: 20
|
|
780
|
-
}),
|
|
781
|
-
default:
|
|
930
|
+
}), c("span", { class: g({ "pv-shimmer": r.isStreaming }) }, E(y.value), 3)], !0)], 512)]),
|
|
931
|
+
default: F(() => [c("div", rt, [r.steps.length > 0 ? (S(), a(Q, {
|
|
932
|
+
key: 0,
|
|
933
|
+
steps: r.steps,
|
|
934
|
+
"in-progress": r.isStreaming
|
|
935
|
+
}, null, 8, ["steps", "in-progress"])) : o("", !0), T(e.$slots, "default", {}, void 0, !0)])]),
|
|
782
936
|
_: 3
|
|
783
|
-
}, 8, ["modelValue", "default-open"]))
|
|
937
|
+
}, 8, ["modelValue", "default-open"])) : (S(), s("span", {
|
|
938
|
+
key: 1,
|
|
939
|
+
ref_key: "triggerRef",
|
|
940
|
+
ref: x,
|
|
941
|
+
class: "pv-reasoning__trigger pv-reasoning__standalone pv-flex pv-text-title-md pv-text-subdued",
|
|
942
|
+
"aria-live": "polite"
|
|
943
|
+
}, [T(e.$slots, "trigger", {}, () => [u(U, {
|
|
944
|
+
name: "brain",
|
|
945
|
+
size: 20
|
|
946
|
+
}), c("span", { class: g({ "pv-shimmer": r.isStreaming }) }, E(y.value), 3)], !0)], 512));
|
|
784
947
|
}
|
|
785
|
-
}), [["__scopeId", "data-v-
|
|
948
|
+
}), [["__scopeId", "data-v-91e8312e"]]), $ = { class: "pv-tool__heading pv-flex pv-flex-item" }, at = { class: "pv-text-title-sm pv-truncate" }, ot = { class: "pv-tool__disclosure-content" }, st = { class: "pv-flow-16 pv-border-top pv-tool__content" }, ct = {
|
|
786
949
|
key: 0,
|
|
787
950
|
class: "pv-flow-8"
|
|
788
|
-
},
|
|
951
|
+
}, lt = { class: "pv-surface-accent pv-inset-square-12 pv-radius-sm pv-text-body-xs" }, ut = {
|
|
789
952
|
key: 1,
|
|
790
953
|
class: "pv-flow-8",
|
|
791
954
|
role: "alert",
|
|
792
955
|
"aria-label": "Tool error"
|
|
793
|
-
},
|
|
956
|
+
}, dt = { class: "pv-surface-critical pv-inset-square-12 pv-radius-sm pv-text-body-xs pv-text-critical" }, ft = {
|
|
794
957
|
key: 2,
|
|
795
958
|
class: "pv-flow-8"
|
|
796
|
-
},
|
|
959
|
+
}, pt = { class: "pv-surface-accent pv-inset-square-12 pv-radius-sm pv-text-body-xs" }, mt = /* @__PURE__ */ W(/* @__PURE__ */ d({
|
|
797
960
|
__name: "PvTool",
|
|
798
|
-
props: /* @__PURE__ */
|
|
961
|
+
props: /* @__PURE__ */ p({
|
|
799
962
|
defaultOpen: {
|
|
800
963
|
type: Boolean,
|
|
801
964
|
default: !1
|
|
@@ -828,9 +991,9 @@ var P = [
|
|
|
828
991
|
}),
|
|
829
992
|
emits: ["update:open"],
|
|
830
993
|
setup(e) {
|
|
831
|
-
let
|
|
832
|
-
(
|
|
833
|
-
let
|
|
994
|
+
let t = e, n = k(e, "open"), r = ["output-available", "output-error"];
|
|
995
|
+
(t.defaultOpen || r.includes(t.state)) && (n.value = !0);
|
|
996
|
+
let l = i(() => ({
|
|
834
997
|
"input-streaming": {
|
|
835
998
|
label: "Pending",
|
|
836
999
|
className: "pv-tag-tertiary"
|
|
@@ -859,7 +1022,7 @@ var P = [
|
|
|
859
1022
|
label: "Denied",
|
|
860
1023
|
className: "pv-tag-error"
|
|
861
1024
|
}
|
|
862
|
-
})[
|
|
1025
|
+
})[t.state]);
|
|
863
1026
|
function d(e) {
|
|
864
1027
|
if (typeof e == "string") return e;
|
|
865
1028
|
try {
|
|
@@ -868,12 +1031,12 @@ var P = [
|
|
|
868
1031
|
return String(e);
|
|
869
1032
|
}
|
|
870
1033
|
}
|
|
871
|
-
return
|
|
872
|
-
e !== t &&
|
|
873
|
-
}), (t,
|
|
874
|
-
modelValue:
|
|
875
|
-
"onUpdate:modelValue":
|
|
876
|
-
"default-open":
|
|
1034
|
+
return P(() => t.state, (e, t) => {
|
|
1035
|
+
e !== t && r.includes(e) && (n.value = !0);
|
|
1036
|
+
}), (t, r) => (S(), a(Y, {
|
|
1037
|
+
modelValue: n.value,
|
|
1038
|
+
"onUpdate:modelValue": r[0] ||= (e) => n.value = e,
|
|
1039
|
+
"default-open": n.value,
|
|
877
1040
|
class: "pv-tool pv-bordered pv-radius",
|
|
878
1041
|
"chevron-position": "right",
|
|
879
1042
|
"chevron-variant": "horizontal",
|
|
@@ -881,22 +1044,22 @@ var P = [
|
|
|
881
1044
|
"enable-trigger-slot": "",
|
|
882
1045
|
"summary-classes": { "pv-inset-square-12": !0 }
|
|
883
1046
|
}, {
|
|
884
|
-
trigger:
|
|
885
|
-
|
|
1047
|
+
trigger: F(() => [c("span", $, [
|
|
1048
|
+
u(U, {
|
|
886
1049
|
name: "settings",
|
|
887
1050
|
size: 20
|
|
888
1051
|
}),
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
class:
|
|
1052
|
+
c("span", at, E(e.toolName), 1),
|
|
1053
|
+
c("span", {
|
|
1054
|
+
class: g([l.value.className, "pv-tag-sm"]),
|
|
892
1055
|
role: "status"
|
|
893
|
-
},
|
|
1056
|
+
}, E(l.value.label), 3)
|
|
894
1057
|
])]),
|
|
895
|
-
default:
|
|
1058
|
+
default: F(() => [c("div", ot, [c("div", st, [t.$slots.input || e.input !== void 0 ? (S(), s("section", ct, [r[1] ||= c("h3", { class: "pv-text-title-xs" }, "Parameters", -1), T(t.$slots, "input", { input: e.input }, () => [c("pre", lt, [c("code", null, E(d(e.input)), 1)])], !0)])) : o("", !0), e.errorText ? (S(), s("section", ut, [r[2] ||= c("h3", { class: "pv-text-title-xs pv-text-critical" }, "Error", -1), c("pre", dt, E(e.errorText), 1)])) : t.$slots.output || e.output !== void 0 ? (S(), s("section", ft, [r[3] ||= c("h3", { class: "pv-text-title-xs" }, "Result", -1), T(t.$slots, "output", { output: e.output }, () => [c("pre", pt, [c("code", null, E(d(e.output)), 1)])], !0)])) : o("", !0)])])]),
|
|
896
1059
|
_: 3
|
|
897
1060
|
}, 8, ["modelValue", "default-open"]));
|
|
898
1061
|
}
|
|
899
|
-
}), [["__scopeId", "data-v-a5e28b1a"]]),
|
|
1062
|
+
}), [["__scopeId", "data-v-a5e28b1a"]]), ht = [
|
|
900
1063
|
"input-streaming",
|
|
901
1064
|
"input-available",
|
|
902
1065
|
"approval-requested",
|
|
@@ -907,8 +1070,8 @@ var P = [
|
|
|
907
1070
|
];
|
|
908
1071
|
//#endregion
|
|
909
1072
|
//#region src/components/ai/useStickToBottom.ts
|
|
910
|
-
function
|
|
911
|
-
let n = t.threshold ?? 32, r =
|
|
1073
|
+
function gt(e, t = {}) {
|
|
1074
|
+
let n = t.threshold ?? 32, r = C(!0);
|
|
912
1075
|
function i() {
|
|
913
1076
|
let t = e.value;
|
|
914
1077
|
t && (r.value = t.scrollHeight - t.scrollTop - t.clientHeight <= n);
|
|
@@ -939,14 +1102,14 @@ function Je(e, t = {}) {
|
|
|
939
1102
|
e.removeEventListener("scroll", t), s.forEach((e) => e.disconnect());
|
|
940
1103
|
};
|
|
941
1104
|
}
|
|
942
|
-
return
|
|
1105
|
+
return P(e, (e) => {
|
|
943
1106
|
o?.(), o = void 0, e && s(e);
|
|
944
|
-
}, { immediate: !0 }),
|
|
1107
|
+
}, { immediate: !0 }), x(() => o?.()), {
|
|
945
1108
|
isAtBottom: r,
|
|
946
1109
|
scrollToBottom: a
|
|
947
1110
|
};
|
|
948
1111
|
}
|
|
949
1112
|
//#endregion
|
|
950
|
-
export {
|
|
1113
|
+
export { Me as PvConfirmation, He as PvPromptInput, Ee as PvQuestion, it as PvReasoning, Q as PvStepList, mt as PvTool, Ue as promptInputStatuses, ht as toolLifecycleStates, gt as useStickToBottom };
|
|
951
1114
|
|
|
952
1115
|
//# sourceMappingURL=pv-components-ai.mjs.map
|