@opentiny/tiny-robot 0.2.0-alpha.6 → 0.2.0-alpha.7
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/dist/bubble/index.js +256 -255
- package/dist/dropdown-menu/index.js +37 -36
- package/dist/feedback/index.js +44 -44
- package/dist/index.d.ts +204 -131
- package/dist/index3.js +233 -202
- package/dist/sender/index.js +898 -712
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +156 -99
- package/dist/suggestion-popover/index.js +34 -33
- package/package.json +3 -3
package/dist/sender/index.js
CHANGED
|
@@ -1,322 +1,329 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { I as
|
|
3
|
-
import { B as
|
|
4
|
-
import { T as
|
|
5
|
-
import { i as
|
|
6
|
-
import { I as
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
|
|
1
|
+
import { ref as I, watch as J, reactive as xe, computed as $, nextTick as V, defineComponent as he, createElementBlock as O, openBlock as R, createCommentVNode as B, createBlock as X, unref as w, withCtx as G, createVNode as U, normalizeClass as ne, resolveDynamicComponent as He, createElementVNode as W, mergeModels as Se, useModel as je, onMounted as qe, useSlots as Ue, Transition as fe, renderSlot as Z, isRef as _e, createTextVNode as Ee, toDisplayString as te, normalizeStyle as ze, Fragment as Te, renderList as Ne, withModifiers as Xe } from "vue";
|
|
2
|
+
import { I as Ge } from "../index6.js";
|
|
3
|
+
import { B as ie } from "../index5.js";
|
|
4
|
+
import { T as pe } from "../index4.js";
|
|
5
|
+
import { i as Je } from "../close.js";
|
|
6
|
+
import { I as Qe, L as Ye, u as Ze, w as et, P as tt, _ as nt } from "../tiny-robot-svgs.js";
|
|
7
|
+
function st(n, b) {
|
|
8
|
+
const g = I(n.modelValue || n.defaultValue || ""), a = I(null);
|
|
9
|
+
J(
|
|
10
10
|
() => n.modelValue,
|
|
11
|
-
(
|
|
12
|
-
|
|
11
|
+
(p) => {
|
|
12
|
+
p !== void 0 && p !== g.value && (g.value = p);
|
|
13
13
|
}
|
|
14
|
-
),
|
|
15
|
-
() =>
|
|
16
|
-
(
|
|
17
|
-
b("update:modelValue",
|
|
14
|
+
), J(
|
|
15
|
+
() => g.value,
|
|
16
|
+
(p) => {
|
|
17
|
+
b("update:modelValue", p);
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
const S =
|
|
20
|
+
const C = (p) => {
|
|
21
|
+
g.value = p, b("update:modelValue", p);
|
|
22
|
+
}, i = (p) => {
|
|
23
|
+
p == null || p.preventDefault();
|
|
24
|
+
const S = g.value;
|
|
25
25
|
!n.disabled && !n.loading && S.trim() && b("submit", S);
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
},
|
|
26
|
+
}, f = () => {
|
|
27
|
+
g.value = "", b("update:modelValue", ""), b("clear");
|
|
28
|
+
}, r = I(!1);
|
|
29
29
|
return {
|
|
30
|
-
inputValue:
|
|
31
|
-
inputWrapper:
|
|
32
|
-
isComposing:
|
|
33
|
-
handleChange:
|
|
34
|
-
handleSubmit:
|
|
35
|
-
handleClear:
|
|
30
|
+
inputValue: g,
|
|
31
|
+
inputWrapper: a,
|
|
32
|
+
isComposing: r,
|
|
33
|
+
handleChange: C,
|
|
34
|
+
handleSubmit: i,
|
|
35
|
+
handleClear: f,
|
|
36
36
|
clearInput: () => {
|
|
37
|
-
|
|
37
|
+
f();
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
if (!(
|
|
46
|
-
switch (
|
|
41
|
+
function lt(n, b, g, a, C, i, f, r, s, p, S, t, E) {
|
|
42
|
+
const F = (y) => !n.disabled && !n.loading && y.trim().length > 0, v = () => {
|
|
43
|
+
F(g.value) && b("submit", g.value.trim());
|
|
44
|
+
}, k = (y, K) => {
|
|
45
|
+
if (!(y.key === "Enter")) return !1;
|
|
46
|
+
switch (K) {
|
|
47
47
|
case "enter":
|
|
48
|
-
return !
|
|
48
|
+
return !y.shiftKey && !y.ctrlKey && !y.metaKey;
|
|
49
49
|
case "ctrlEnter":
|
|
50
|
-
return (
|
|
50
|
+
return (y.ctrlKey || y.metaKey) && !y.shiftKey;
|
|
51
51
|
case "shiftEnter":
|
|
52
|
-
return
|
|
52
|
+
return y.shiftKey && !y.ctrlKey && !y.metaKey;
|
|
53
53
|
default:
|
|
54
54
|
return !1;
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
return {
|
|
58
|
-
handleKeyPress: (
|
|
59
|
-
if (
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
` +
|
|
65
|
-
|
|
58
|
+
handleKeyPress: (y) => {
|
|
59
|
+
if (a.value) return;
|
|
60
|
+
if (y.key === "Enter" && y.shiftKey && (t == null ? void 0 : t.value) === "single" && E) {
|
|
61
|
+
y.preventDefault(), E();
|
|
62
|
+
const P = y.target, H = P.selectionStart, z = g.value;
|
|
63
|
+
g.value = z.substring(0, H) + `
|
|
64
|
+
` + z.substring(H), setTimeout(() => {
|
|
65
|
+
P.selectionStart = P.selectionEnd = H + 1;
|
|
66
66
|
}, 0);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
if (
|
|
70
|
-
|
|
69
|
+
if (y.key === "Tab" && i.value && f.value) {
|
|
70
|
+
y.preventDefault(), r();
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
if (
|
|
74
|
-
if (
|
|
75
|
-
|
|
73
|
+
if (i.value) {
|
|
74
|
+
if (y.key === "ArrowDown") {
|
|
75
|
+
y.preventDefault(), p("down");
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
if (
|
|
79
|
-
|
|
78
|
+
if (y.key === "ArrowUp") {
|
|
79
|
+
y.preventDefault(), p("up");
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
if (
|
|
83
|
-
|
|
82
|
+
if (y.key === "Enter" && f.value) {
|
|
83
|
+
y.preventDefault(), r();
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
if (
|
|
88
|
-
|
|
87
|
+
if (y.key === "Escape") {
|
|
88
|
+
i.value ? (s(), y.preventDefault()) : C.isRecording && (S(), y.preventDefault()), b("escape-press");
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
k(y, n.submitType) && F(g.value) && (y.preventDefault(), v());
|
|
92
92
|
},
|
|
93
|
-
triggerSubmit:
|
|
93
|
+
triggerSubmit: v
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
const b = (
|
|
98
|
-
var
|
|
99
|
-
const { startContainer:
|
|
96
|
+
function at(n) {
|
|
97
|
+
const b = (i, f, r) => {
|
|
98
|
+
var F;
|
|
99
|
+
const { startContainer: s, startOffset: p, collapsed: S } = f;
|
|
100
100
|
if (!S) return !1;
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
let
|
|
104
|
-
if (
|
|
105
|
-
if (
|
|
106
|
-
|
|
101
|
+
const t = s.nodeType === Node.TEXT_NODE && p === 0 && i.key === "ArrowLeft", E = s.nodeType === Node.TEXT_NODE && p === (((F = s.textContent) == null ? void 0 : F.length) || 0) && i.key === "ArrowRight";
|
|
102
|
+
if (t || E) {
|
|
103
|
+
let v = null, k = "inside";
|
|
104
|
+
if (t)
|
|
105
|
+
if (s.parentNode && s.parentNode.classList.contains("template-field"))
|
|
106
|
+
v = s.parentNode, k = "before";
|
|
107
107
|
else {
|
|
108
|
-
let
|
|
109
|
-
!
|
|
108
|
+
let x = s.previousSibling;
|
|
109
|
+
!x && s.parentNode && s.parentNode !== r && (x = s.parentNode.previousSibling), x && x.nodeType === Node.ELEMENT_NODE && x.classList.contains("template-field") && (v = x, k = "inside");
|
|
110
110
|
}
|
|
111
|
-
else if (
|
|
112
|
-
if (
|
|
113
|
-
|
|
111
|
+
else if (E)
|
|
112
|
+
if (s.parentNode && s.parentNode.classList.contains("template-field"))
|
|
113
|
+
v = s.parentNode, k = "after";
|
|
114
114
|
else {
|
|
115
|
-
let
|
|
116
|
-
!
|
|
115
|
+
let x = s.nextSibling;
|
|
116
|
+
!x && s.parentNode && s.parentNode !== r && (x = s.parentNode.nextSibling), x && x.nodeType === Node.ELEMENT_NODE && x.classList.contains("template-field") && (v = x, k = "inside");
|
|
117
117
|
}
|
|
118
|
-
if (
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
return
|
|
118
|
+
if (v) {
|
|
119
|
+
i.preventDefault();
|
|
120
|
+
const x = document.createRange(), y = window.getSelection();
|
|
121
|
+
return y && (k === "before" ? x.setStartBefore(v) : k === "after" ? x.setStartAfter(v) : (x.selectNodeContents(v), x.collapse(i.key === "ArrowLeft")), y.removeAllRanges(), y.addRange(x)), !0;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
return
|
|
124
|
+
if (s.nodeType === Node.ELEMENT_NODE && s.classList.contains("template-field") && !s.textContent) {
|
|
125
|
+
i.preventDefault();
|
|
126
|
+
const v = document.createRange(), k = window.getSelection();
|
|
127
|
+
return k && (i.key === "ArrowLeft" ? v.setStartBefore(s) : v.setStartAfter(s), v.collapse(!0), k.removeAllRanges(), k.addRange(v)), !0;
|
|
128
128
|
}
|
|
129
129
|
return !1;
|
|
130
|
-
},
|
|
131
|
-
if (!
|
|
132
|
-
const { startContainer:
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
137
|
-
const
|
|
138
|
-
|
|
130
|
+
}, g = (i, f, r) => {
|
|
131
|
+
if (!f.collapsed) return !1;
|
|
132
|
+
const { startContainer: s, startOffset: p } = f;
|
|
133
|
+
if (s.nodeType === Node.TEXT_NODE && s.parentNode && s.parentNode.classList.contains("template-field") && s.textContent && s.textContent.length === 1 && p === 1) {
|
|
134
|
+
i.preventDefault(), s.textContent = "";
|
|
135
|
+
const E = s.parentNode, F = window.getSelection();
|
|
136
|
+
if (F) {
|
|
137
|
+
const v = document.createRange();
|
|
138
|
+
v.selectNodeContents(E), v.collapse(!0), F.removeAllRanges(), F.addRange(v);
|
|
139
139
|
}
|
|
140
140
|
return n.handleInput(), !0;
|
|
141
141
|
}
|
|
142
|
-
if (
|
|
143
|
-
let
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
return
|
|
142
|
+
if (p === 0) {
|
|
143
|
+
let E = null;
|
|
144
|
+
if (s.nodeType === Node.ELEMENT_NODE && s.classList.contains("template-field") ? E = s : s.nodeType === Node.TEXT_NODE && s.parentNode && s.parentNode.classList.contains("template-field") && (E = s.parentNode), E) {
|
|
145
|
+
i.preventDefault();
|
|
146
|
+
const F = window.getSelection();
|
|
147
|
+
return F && (f.setStartBefore(E), f.collapse(!0), F.removeAllRanges(), F.addRange(f)), !0;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
let
|
|
151
|
-
return
|
|
152
|
-
},
|
|
153
|
-
var
|
|
154
|
-
if (!
|
|
155
|
-
const { startContainer:
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
|
|
150
|
+
let t = null;
|
|
151
|
+
return s === r && p > 0 ? t = r.childNodes[p - 1] : s.nodeType === Node.TEXT_NODE && p === 0 && (t = s.previousSibling), t && t.nodeType === Node.ELEMENT_NODE && t.classList.contains("template-field") && t.textContent === "" ? (i.preventDefault(), t.parentNode && t.parentNode.removeChild(t), n.handleInput(), !0) : !1;
|
|
152
|
+
}, a = (i, f, r) => {
|
|
153
|
+
var E;
|
|
154
|
+
if (!f.collapsed) return !1;
|
|
155
|
+
const { startContainer: s, startOffset: p } = f;
|
|
156
|
+
if (s.nodeType === Node.TEXT_NODE && s.parentNode && s.parentNode.classList.contains("template-field") && s.textContent && p === s.textContent.length && s.textContent.length === 1) {
|
|
157
|
+
i.preventDefault(), s.textContent = "";
|
|
158
|
+
const F = s.parentNode, v = window.getSelection();
|
|
159
|
+
if (v) {
|
|
160
|
+
const k = document.createRange();
|
|
161
|
+
k.selectNodeContents(F), k.collapse(!0), v.removeAllRanges(), v.addRange(k);
|
|
162
162
|
}
|
|
163
163
|
return n.handleInput(), !0;
|
|
164
164
|
}
|
|
165
|
-
let
|
|
166
|
-
return
|
|
165
|
+
let t = null;
|
|
166
|
+
return s === r && p < r.childNodes.length ? t = r.childNodes[p] : s.nodeType === Node.TEXT_NODE && p === (((E = s.textContent) == null ? void 0 : E.length) || 0) && (t = s.nextSibling), t && t.nodeType === Node.ELEMENT_NODE && t.classList.contains("template-field") && t.textContent === "" ? (i.preventDefault(), t.parentNode && t.parentNode.removeChild(t), n.handleInput(), !0) : !1;
|
|
167
167
|
};
|
|
168
168
|
return {
|
|
169
|
-
handleTemplateKeyDown: (
|
|
169
|
+
handleTemplateKeyDown: (i) => {
|
|
170
170
|
if (n.isComposing.value) return;
|
|
171
|
-
const
|
|
172
|
-
if (!
|
|
173
|
-
const
|
|
174
|
-
if (!
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
|
|
171
|
+
const f = n.editor.value;
|
|
172
|
+
if (!f) return;
|
|
173
|
+
const r = window.getSelection();
|
|
174
|
+
if (!r || r.rangeCount === 0) return;
|
|
175
|
+
const s = r.getRangeAt(0);
|
|
176
|
+
if (i.key === "Enter") {
|
|
177
|
+
i.preventDefault(), n.onSubmit(n.getValueFromDOM());
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
|
-
(
|
|
180
|
+
(i.key === "ArrowLeft" || i.key === "ArrowRight") && !i.shiftKey && b(i, s, f) || i.key === "Backspace" && g(i, s, f) || i.key === "Delete" && a(i, s, f);
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
const b =
|
|
184
|
+
function ot(n) {
|
|
185
|
+
const b = xe({
|
|
186
186
|
isRecording: !1,
|
|
187
187
|
isSupported: typeof window < "u" && "webkitSpeechRecognition" in window || "SpeechRecognition" in window,
|
|
188
188
|
error: void 0
|
|
189
|
-
}),
|
|
190
|
-
|
|
191
|
-
var
|
|
192
|
-
b.isRecording = !0, b.error = void 0, (
|
|
193
|
-
},
|
|
194
|
-
var
|
|
195
|
-
b.isRecording = !1, (
|
|
196
|
-
},
|
|
197
|
-
var
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
},
|
|
201
|
-
var
|
|
202
|
-
b.error = new Error(
|
|
189
|
+
}), g = b.isSupported ? new (window.webkitSpeechRecognition || window.SpeechRecognition)() : void 0;
|
|
190
|
+
g !== void 0 && (g.continuous = n.continuous ?? !1, g.interimResults = n.interimResults ?? !0, g.lang = n.lang ?? navigator.language, g.onstart = () => {
|
|
191
|
+
var f;
|
|
192
|
+
b.isRecording = !0, b.error = void 0, (f = n.onStart) == null || f.call(n);
|
|
193
|
+
}, g.onend = () => {
|
|
194
|
+
var f;
|
|
195
|
+
b.isRecording = !1, (f = n.onEnd) == null || f.call(n);
|
|
196
|
+
}, g.onresult = (f) => {
|
|
197
|
+
var s, p;
|
|
198
|
+
const r = Array.from(f.results).map((S) => S[0].transcript).join("");
|
|
199
|
+
f.results[0].isFinal ? (s = n.onFinal) == null || s.call(n, r) : (p = n.onInterim) == null || p.call(n, r);
|
|
200
|
+
}, g.onerror = (f) => {
|
|
201
|
+
var r;
|
|
202
|
+
b.error = new Error(f.error), b.isRecording = !1, (r = n.onError) == null || r.call(n, b.error);
|
|
203
203
|
});
|
|
204
|
-
const
|
|
205
|
-
var
|
|
206
|
-
if (!
|
|
207
|
-
const
|
|
208
|
-
b.error =
|
|
204
|
+
const a = () => {
|
|
205
|
+
var f;
|
|
206
|
+
if (!g) {
|
|
207
|
+
const r = new Error("浏览器不支持语音识别");
|
|
208
|
+
b.error = r, (f = n.onError) == null || f.call(n, r);
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
211
|
if (b.isRecording) {
|
|
212
212
|
try {
|
|
213
|
-
|
|
213
|
+
g.stop(), setTimeout(() => {
|
|
214
214
|
try {
|
|
215
|
-
|
|
216
|
-
} catch (
|
|
217
|
-
|
|
215
|
+
g.start();
|
|
216
|
+
} catch (r) {
|
|
217
|
+
i(r);
|
|
218
218
|
}
|
|
219
219
|
}, 100);
|
|
220
|
-
} catch (
|
|
221
|
-
|
|
220
|
+
} catch (r) {
|
|
221
|
+
i(r);
|
|
222
222
|
}
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
225
|
try {
|
|
226
|
-
|
|
227
|
-
} catch (
|
|
228
|
-
|
|
226
|
+
g.start();
|
|
227
|
+
} catch (r) {
|
|
228
|
+
i(r);
|
|
229
229
|
}
|
|
230
|
-
},
|
|
231
|
-
if (
|
|
230
|
+
}, C = () => {
|
|
231
|
+
if (g && b.isRecording)
|
|
232
232
|
try {
|
|
233
|
-
|
|
234
|
-
} catch (
|
|
235
|
-
|
|
233
|
+
g.stop();
|
|
234
|
+
} catch (f) {
|
|
235
|
+
i(f);
|
|
236
236
|
}
|
|
237
|
-
},
|
|
238
|
-
var
|
|
239
|
-
b.error =
|
|
237
|
+
}, i = (f) => {
|
|
238
|
+
var r;
|
|
239
|
+
b.error = f instanceof Error ? f : new Error("语音识别操作失败"), b.isRecording = !1, (r = n.onError) == null || r.call(n, b.error);
|
|
240
240
|
};
|
|
241
241
|
return {
|
|
242
242
|
speechState: b,
|
|
243
|
-
start:
|
|
244
|
-
stop:
|
|
243
|
+
start: a,
|
|
244
|
+
stop: C
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
const
|
|
247
|
+
const it = (n, b) => {
|
|
248
248
|
if (!b || !n)
|
|
249
249
|
return [{ text: n, isMatch: !1 }];
|
|
250
|
-
const
|
|
251
|
-
if (
|
|
250
|
+
const g = n.toLowerCase(), a = b.toLowerCase(), C = g.indexOf(a);
|
|
251
|
+
if (C === -1)
|
|
252
252
|
return [{ text: n, isMatch: !1 }];
|
|
253
|
-
const
|
|
254
|
-
return
|
|
255
|
-
text: n.substring(0,
|
|
253
|
+
const i = [];
|
|
254
|
+
return C > 0 && i.push({
|
|
255
|
+
text: n.substring(0, C),
|
|
256
256
|
isMatch: !1
|
|
257
|
-
}),
|
|
258
|
-
text: n.substring(
|
|
257
|
+
}), i.push({
|
|
258
|
+
text: n.substring(C, C + b.length),
|
|
259
259
|
isMatch: !0
|
|
260
|
-
}),
|
|
261
|
-
text: n.substring(
|
|
260
|
+
}), C + b.length < n.length && i.push({
|
|
261
|
+
text: n.substring(C + b.length),
|
|
262
262
|
isMatch: !1
|
|
263
|
-
}),
|
|
263
|
+
}), i;
|
|
264
264
|
};
|
|
265
|
-
function
|
|
266
|
-
const
|
|
267
|
-
if (!n.suggestions || !
|
|
268
|
-
const
|
|
269
|
-
return n.suggestions.filter((
|
|
270
|
-
}),
|
|
271
|
-
const
|
|
272
|
-
|
|
265
|
+
function rt(n, b, g, a) {
|
|
266
|
+
const C = I(!1), i = I(-1), f = I(""), r = I(!1), s = I(null), p = I(!1), S = $(() => {
|
|
267
|
+
if (!n.suggestions || !g.value || n.template) return [];
|
|
268
|
+
const h = g.value.toLowerCase();
|
|
269
|
+
return n.suggestions.filter((m) => m.toLowerCase().includes(h));
|
|
270
|
+
}), t = $(() => S.value[i.value] || null), E = (h) => {
|
|
271
|
+
const m = h || (S.value.length > 0 ? S.value[0] : null);
|
|
272
|
+
m && g.value && m.toLowerCase().startsWith(g.value.toLowerCase()) ? f.value = m.substring(g.value.length) : f.value = "";
|
|
273
|
+
}, F = () => {
|
|
274
|
+
C.value = !1, i.value = -1, f.value = "", r.value = !1;
|
|
275
|
+
}, v = () => {
|
|
276
|
+
C.value = !0, i.value = 0, E(), r.value = !0;
|
|
277
|
+
}, k = () => {
|
|
278
|
+
a.value || p.value || V(() => {
|
|
279
|
+
g.value && n.suggestions && n.suggestions.length > 0 && !n.template && S.value.length > 0 ? v() : F();
|
|
280
|
+
});
|
|
273
281
|
};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
g.value = !0, d.value = k, b("update:modelValue", k), b("suggestion-select", k), p(), P(() => {
|
|
279
|
-
g.value = !1;
|
|
282
|
+
J(g, k), J(() => n.suggestions, k);
|
|
283
|
+
const x = (h) => {
|
|
284
|
+
p.value = !0, g.value = h, b("update:modelValue", h), b("suggestion-select", h), K(), V(() => {
|
|
285
|
+
p.value = !1;
|
|
280
286
|
});
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
},
|
|
284
|
-
|
|
287
|
+
}, y = () => {
|
|
288
|
+
t.value && x(t.value);
|
|
289
|
+
}, K = () => {
|
|
290
|
+
F();
|
|
285
291
|
};
|
|
286
292
|
return {
|
|
287
|
-
showSuggestionsPopup:
|
|
288
|
-
highlightedIndex:
|
|
289
|
-
completionPlaceholder:
|
|
290
|
-
showTabHint:
|
|
291
|
-
suggestionsListRef:
|
|
293
|
+
showSuggestionsPopup: C,
|
|
294
|
+
highlightedIndex: i,
|
|
295
|
+
completionPlaceholder: f,
|
|
296
|
+
showTabHint: r,
|
|
297
|
+
suggestionsListRef: s,
|
|
292
298
|
filteredSuggestions: S,
|
|
293
|
-
activeSuggestion:
|
|
294
|
-
updateCompletionPlaceholder:
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
299
|
+
activeSuggestion: t,
|
|
300
|
+
updateCompletionPlaceholder: E,
|
|
301
|
+
updateSuggestionsState: k,
|
|
302
|
+
selectSuggestion: x,
|
|
303
|
+
acceptCurrentSuggestion: y,
|
|
304
|
+
closeSuggestionsPopup: K,
|
|
305
|
+
navigateSuggestions: (h) => {
|
|
306
|
+
if (!C.value || S.value.length === 0) return;
|
|
307
|
+
h === "down" ? i.value = (i.value + 1) % S.value.length : i.value = (i.value - 1 + S.value.length) % S.value.length, t.value && E(t.value);
|
|
308
|
+
const m = s.value;
|
|
309
|
+
if (m) {
|
|
310
|
+
const _ = m.children[i.value];
|
|
311
|
+
_ && _.scrollIntoView({ block: "nearest" });
|
|
305
312
|
}
|
|
306
313
|
},
|
|
307
|
-
handleSuggestionItemHover: (
|
|
308
|
-
|
|
314
|
+
handleSuggestionItemHover: (h) => {
|
|
315
|
+
i.value = h, E(S.value[h]);
|
|
309
316
|
},
|
|
310
317
|
handleClickOutside: () => {
|
|
311
|
-
|
|
318
|
+
K();
|
|
312
319
|
},
|
|
313
|
-
highlightSuggestionText:
|
|
320
|
+
highlightSuggestionText: it
|
|
314
321
|
};
|
|
315
322
|
}
|
|
316
|
-
const
|
|
323
|
+
const ut = { class: "action-buttons" }, ct = {
|
|
317
324
|
key: 0,
|
|
318
325
|
class: "action-buttons__utility"
|
|
319
|
-
},
|
|
326
|
+
}, dt = { class: "action-buttons__submit-content" }, ft = { class: "action-buttons__cancel" }, ke = /* @__PURE__ */ he({
|
|
320
327
|
__name: "ActionButtons",
|
|
321
328
|
props: {
|
|
322
329
|
loading: { type: Boolean, default: !1 },
|
|
@@ -335,33 +342,33 @@ const st = { class: "action-buttons" }, lt = {
|
|
|
335
342
|
},
|
|
336
343
|
emits: ["clear", "toggle-speech", "submit", "cancel"],
|
|
337
344
|
setup(n, { emit: b }) {
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
},
|
|
341
|
-
if (!
|
|
342
|
-
const
|
|
343
|
-
|
|
345
|
+
const g = Je(), a = n, C = b, i = $(() => a.allowSpeech), f = $(() => a.speechStatus.isRecording), r = $(() => a.disabled), s = $(() => r.value || a.isOverLimit), p = $(() => a.allowFiles || a.allowSpeech || a.showClear), S = () => {
|
|
346
|
+
r.value || C("clear");
|
|
347
|
+
}, t = () => {
|
|
348
|
+
if (!r.value) {
|
|
349
|
+
const v = !a.speechStatus.isRecording;
|
|
350
|
+
C("toggle-speech", v);
|
|
344
351
|
}
|
|
345
|
-
},
|
|
346
|
-
|
|
347
|
-
},
|
|
348
|
-
|
|
352
|
+
}, E = () => {
|
|
353
|
+
s.value || C("submit");
|
|
354
|
+
}, F = () => {
|
|
355
|
+
r.value || C("cancel");
|
|
349
356
|
};
|
|
350
|
-
return (
|
|
351
|
-
|
|
352
|
-
|
|
357
|
+
return (v, k) => (R(), O("div", ut, [
|
|
358
|
+
p.value ? (R(), O("div", ct, [
|
|
359
|
+
v.allowFiles && !v.loading ? (R(), X(w(pe), {
|
|
353
360
|
key: 0,
|
|
354
361
|
content: "上传文件",
|
|
355
362
|
placement: "top"
|
|
356
363
|
}, {
|
|
357
|
-
default:
|
|
358
|
-
|
|
364
|
+
default: G(() => [
|
|
365
|
+
U(w(ie), {
|
|
359
366
|
class: "action-buttons__button action-buttons__file-button",
|
|
360
367
|
type: "text",
|
|
361
|
-
disabled:
|
|
368
|
+
disabled: r.value
|
|
362
369
|
}, {
|
|
363
|
-
default:
|
|
364
|
-
|
|
370
|
+
default: G(() => [
|
|
371
|
+
U(w(Qe), {
|
|
365
372
|
class: "action-buttons__icon",
|
|
366
373
|
alt: "上传文件"
|
|
367
374
|
})
|
|
@@ -371,19 +378,19 @@ const st = { class: "action-buttons" }, lt = {
|
|
|
371
378
|
]),
|
|
372
379
|
_: 1
|
|
373
380
|
})) : B("", !0),
|
|
374
|
-
|
|
381
|
+
i.value && !v.loading ? (R(), X(w(ie), {
|
|
375
382
|
key: 1,
|
|
376
|
-
class:
|
|
383
|
+
class: ne(["action-buttons__button action-buttons__speech-button", { "is-recording": f.value }]),
|
|
377
384
|
type: "text",
|
|
378
|
-
disabled:
|
|
379
|
-
onClick:
|
|
385
|
+
disabled: r.value,
|
|
386
|
+
onClick: t
|
|
380
387
|
}, {
|
|
381
|
-
default:
|
|
382
|
-
|
|
388
|
+
default: G(() => [
|
|
389
|
+
f.value ? (R(), X(w(Ze), {
|
|
383
390
|
key: 1,
|
|
384
391
|
class: "action-buttons__icon action-buttons__icon--recording",
|
|
385
392
|
alt: "语音中"
|
|
386
|
-
})) : (
|
|
393
|
+
})) : (R(), X(w(Ye), {
|
|
387
394
|
key: 0,
|
|
388
395
|
class: "action-buttons__icon",
|
|
389
396
|
alt: "录音"
|
|
@@ -391,20 +398,20 @@ const st = { class: "action-buttons" }, lt = {
|
|
|
391
398
|
]),
|
|
392
399
|
_: 1
|
|
393
400
|
}, 8, ["disabled", "class"])) : B("", !0),
|
|
394
|
-
|
|
401
|
+
v.showClear ? (R(), X(w(pe), {
|
|
395
402
|
key: 2,
|
|
396
403
|
content: "清空内容",
|
|
397
404
|
placement: "top"
|
|
398
405
|
}, {
|
|
399
|
-
default:
|
|
400
|
-
|
|
406
|
+
default: G(() => [
|
|
407
|
+
U(w(ie), {
|
|
401
408
|
class: "action-buttons__button action-buttons__clear-button",
|
|
402
409
|
type: "text",
|
|
403
|
-
disabled:
|
|
410
|
+
disabled: r.value || !v.hasContent,
|
|
404
411
|
onClick: S
|
|
405
412
|
}, {
|
|
406
|
-
default:
|
|
407
|
-
(
|
|
413
|
+
default: G(() => [
|
|
414
|
+
(R(), X(He(w(g)), { class: "action-buttons__icon action-buttons__icon--close" }))
|
|
408
415
|
]),
|
|
409
416
|
_: 1
|
|
410
417
|
}, 8, ["disabled"])
|
|
@@ -412,31 +419,31 @@ const st = { class: "action-buttons" }, lt = {
|
|
|
412
419
|
_: 1
|
|
413
420
|
})) : B("", !0)
|
|
414
421
|
])) : B("", !0),
|
|
415
|
-
|
|
422
|
+
v.hasContent || v.loading ? (R(), X(w(ie), {
|
|
416
423
|
key: 1,
|
|
417
424
|
type: "text",
|
|
418
425
|
class: "action-buttons__button action-buttons__submit",
|
|
419
|
-
disabled:
|
|
420
|
-
onClick:
|
|
426
|
+
disabled: v.loading ? r.value : s.value,
|
|
427
|
+
onClick: k[0] || (k[0] = (x) => v.loading ? F() : E())
|
|
421
428
|
}, {
|
|
422
|
-
default:
|
|
423
|
-
|
|
424
|
-
|
|
429
|
+
default: G(() => [
|
|
430
|
+
W("div", dt, [
|
|
431
|
+
v.loading ? (R(), X(w(pe), {
|
|
425
432
|
key: 1,
|
|
426
433
|
content: "停止生成",
|
|
427
434
|
placement: "top"
|
|
428
435
|
}, {
|
|
429
|
-
default:
|
|
430
|
-
|
|
431
|
-
|
|
436
|
+
default: G(() => [
|
|
437
|
+
W("div", ft, [
|
|
438
|
+
U(w(tt), {
|
|
432
439
|
class: "action-buttons__icon action-buttons__icon--stop",
|
|
433
440
|
alt: "加载中"
|
|
434
441
|
}),
|
|
435
|
-
|
|
442
|
+
k[1] || (k[1] = W("span", { class: "action-buttons__cancel-text" }, "停止回答", -1))
|
|
436
443
|
])
|
|
437
444
|
]),
|
|
438
445
|
_: 1
|
|
439
|
-
})) : (
|
|
446
|
+
})) : (R(), X(w(et), {
|
|
440
447
|
key: 0,
|
|
441
448
|
class: "action-buttons__icon action-buttons__icon--send",
|
|
442
449
|
alt: "发送"
|
|
@@ -448,312 +455,479 @@ const st = { class: "action-buttons" }, lt = {
|
|
|
448
455
|
]));
|
|
449
456
|
}
|
|
450
457
|
});
|
|
451
|
-
function
|
|
452
|
-
const
|
|
453
|
-
Object.assign(
|
|
454
|
-
},
|
|
455
|
-
const
|
|
456
|
-
let
|
|
457
|
-
const
|
|
458
|
-
let
|
|
459
|
-
for (; (
|
|
460
|
-
|
|
461
|
-
return
|
|
462
|
-
},
|
|
458
|
+
function pt(n, b) {
|
|
459
|
+
const g = I(!1), a = xe({ ...b }), C = (e) => {
|
|
460
|
+
Object.assign(a, e);
|
|
461
|
+
}, i = (e) => {
|
|
462
|
+
const o = [];
|
|
463
|
+
let l = 0;
|
|
464
|
+
const u = /\[(.*?)\]/g;
|
|
465
|
+
let d;
|
|
466
|
+
for (; (d = u.exec(e)) !== null; )
|
|
467
|
+
d.index > l && o.push({ type: "text", content: e.substring(l, d.index) }), o.push({ type: "field", content: d[1] }), l = d.index + d[0].length;
|
|
468
|
+
return l < e.length && o.push({ type: "text", content: e.substring(l) }), o;
|
|
469
|
+
}, f = () => {
|
|
463
470
|
if (!n.value) return "";
|
|
464
|
-
let
|
|
465
|
-
|
|
466
|
-
|
|
471
|
+
let e = "";
|
|
472
|
+
const o = (l) => {
|
|
473
|
+
let u = "";
|
|
474
|
+
if (l.nodeType === Node.TEXT_NODE)
|
|
475
|
+
u += l.textContent || "";
|
|
476
|
+
else if (l.nodeType === Node.ELEMENT_NODE) {
|
|
477
|
+
const d = l;
|
|
478
|
+
if (d.classList.contains("template-field"))
|
|
479
|
+
u += d.textContent || "";
|
|
480
|
+
else if (d.tagName.toLowerCase() === "span")
|
|
481
|
+
u += d.textContent || "";
|
|
482
|
+
else if (d.tagName.toLowerCase() === "br")
|
|
483
|
+
u += `
|
|
484
|
+
`;
|
|
485
|
+
else
|
|
486
|
+
for (const T of Array.from(d.childNodes))
|
|
487
|
+
u += o(T);
|
|
488
|
+
}
|
|
489
|
+
return u;
|
|
490
|
+
};
|
|
491
|
+
return n.value.childNodes.forEach((l) => {
|
|
492
|
+
e += o(l);
|
|
493
|
+
}), e;
|
|
494
|
+
}, r = (e) => a.initialValues && typeof a.initialValues[e] == "string" ? a.initialValues[e] : "", s = (e, o) => {
|
|
495
|
+
const l = document.createElement("span");
|
|
496
|
+
return l.className = "template-field", l.setAttribute("data-placeholder", e), o && (l.textContent = o), V(() => {
|
|
497
|
+
p(l, o || "");
|
|
467
498
|
}), l;
|
|
468
|
-
},
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}), h;
|
|
473
|
-
}, g = (l, c) => {
|
|
474
|
-
if (!c || c.trim() === "") {
|
|
475
|
-
const h = l.getAttribute("data-placeholder") || "";
|
|
476
|
-
h ? S(l, h, !0) : (l.style.minWidth = "", l.style.width = "");
|
|
499
|
+
}, p = (e, o) => {
|
|
500
|
+
if (!o || o.trim() === "") {
|
|
501
|
+
const l = e.getAttribute("data-placeholder") || "";
|
|
502
|
+
l ? S(e, l, !0) : (e.style.minWidth = "", e.style.width = "");
|
|
477
503
|
return;
|
|
478
504
|
}
|
|
479
|
-
S(
|
|
480
|
-
}, S = (
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
const
|
|
484
|
-
document.body.removeChild(
|
|
485
|
-
const
|
|
486
|
-
|
|
505
|
+
S(e, o, !1);
|
|
506
|
+
}, S = (e, o, l) => {
|
|
507
|
+
const u = document.createElement("span");
|
|
508
|
+
u.className = "template-field", u.style.visibility = "hidden", u.style.position = "absolute", u.style.top = "-9999px", u.style.left = "-9999px", u.style.whiteSpace = "nowrap", u.style.padding = "3px 8px", u.style.margin = "0 2px", u.style.boxSizing = "border-box", u.textContent = o, document.body.appendChild(u);
|
|
509
|
+
const d = getComputedStyle(u), T = u.offsetWidth, D = parseFloat(d.fontSize);
|
|
510
|
+
document.body.removeChild(u);
|
|
511
|
+
const M = l ? 1.5 : 2, j = T / D, A = Math.max(M, Math.ceil(j));
|
|
512
|
+
e.style.setProperty("min-width", `${A}em`, "important");
|
|
487
513
|
const q = 20;
|
|
488
|
-
|
|
489
|
-
},
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
},
|
|
493
|
-
|
|
494
|
-
const
|
|
495
|
-
if (!
|
|
496
|
-
const
|
|
497
|
-
switch (
|
|
514
|
+
A > q ? (e.style.setProperty("max-width", `${q}em`, "important"), e.style.setProperty("white-space", "normal", "important"), e.style.setProperty("word-break", "break-word", "important")) : e.style.removeProperty("max-width");
|
|
515
|
+
}, t = (e) => {
|
|
516
|
+
const l = (e === void 0 ? f() : e).trim().length > 0;
|
|
517
|
+
g.value !== l && (g.value = l, a.onContentStatusChange(l));
|
|
518
|
+
}, E = (e, o = "inside", l = !1) => {
|
|
519
|
+
V(() => {
|
|
520
|
+
const u = window.getSelection();
|
|
521
|
+
if (!u) return;
|
|
522
|
+
const d = document.createRange();
|
|
523
|
+
switch (o) {
|
|
498
524
|
case "before":
|
|
499
|
-
|
|
525
|
+
d.setStartBefore(e);
|
|
500
526
|
break;
|
|
501
527
|
case "after":
|
|
502
|
-
|
|
528
|
+
d.setStartAfter(e);
|
|
503
529
|
break;
|
|
504
530
|
case "inside":
|
|
505
531
|
default:
|
|
506
|
-
|
|
532
|
+
d.selectNodeContents(e), d.collapse(l);
|
|
507
533
|
break;
|
|
508
534
|
}
|
|
509
|
-
|
|
535
|
+
u.removeAllRanges(), u.addRange(d), e.focus && e.focus();
|
|
510
536
|
});
|
|
511
|
-
},
|
|
512
|
-
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
515
|
-
const
|
|
516
|
-
|
|
537
|
+
}, F = () => {
|
|
538
|
+
V(() => {
|
|
539
|
+
const e = n.value;
|
|
540
|
+
if (e) {
|
|
541
|
+
const o = document.createRange(), l = window.getSelection();
|
|
542
|
+
o.selectNodeContents(e), o.collapse(!1), l && (l.removeAllRanges(), l.addRange(o)), e.focus();
|
|
517
543
|
}
|
|
518
544
|
});
|
|
519
|
-
},
|
|
520
|
-
const
|
|
521
|
-
if (!
|
|
522
|
-
|
|
523
|
-
let
|
|
524
|
-
if (!
|
|
525
|
-
|
|
526
|
-
if (
|
|
527
|
-
const
|
|
528
|
-
|
|
545
|
+
}, v = (e, o) => {
|
|
546
|
+
const l = n.value;
|
|
547
|
+
if (!l) return null;
|
|
548
|
+
l.innerHTML = "";
|
|
549
|
+
let u = null;
|
|
550
|
+
if (!o || o === a.template)
|
|
551
|
+
e.forEach((d) => {
|
|
552
|
+
if (d.type === "field") {
|
|
553
|
+
const T = r(d.content), D = s(d.content, T);
|
|
554
|
+
l.appendChild(D), u || (u = D);
|
|
529
555
|
} else
|
|
530
|
-
|
|
531
|
-
}),
|
|
532
|
-
const
|
|
533
|
-
|
|
556
|
+
l.appendChild(document.createTextNode(d.content));
|
|
557
|
+
}), a.initialValues && Object.keys(a.initialValues).length > 0 && V(() => {
|
|
558
|
+
const d = f();
|
|
559
|
+
d !== a.value && (a.onValueChange(d), a.onInput(d));
|
|
534
560
|
});
|
|
535
561
|
else {
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}) : (
|
|
562
|
+
const d = k(e, o);
|
|
563
|
+
d.success ? d.elements.forEach((T) => {
|
|
564
|
+
l.appendChild(T.node), T.isField && !u && (u = T.node);
|
|
565
|
+
}) : (l.appendChild(document.createTextNode(o)), u = null);
|
|
540
566
|
}
|
|
541
|
-
return
|
|
542
|
-
},
|
|
543
|
-
const
|
|
544
|
-
let
|
|
545
|
-
for (;
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
548
|
-
|
|
549
|
-
node: document.createTextNode(
|
|
567
|
+
return u;
|
|
568
|
+
}, k = (e, o) => {
|
|
569
|
+
const l = [];
|
|
570
|
+
let u = 0, d = 0, T = !0;
|
|
571
|
+
for (; d < e.length && u <= o.length && T; ) {
|
|
572
|
+
const D = e[d];
|
|
573
|
+
if (D.type === "text")
|
|
574
|
+
o.substring(u).startsWith(D.content) ? (l.push({
|
|
575
|
+
node: document.createTextNode(D.content),
|
|
550
576
|
isField: !1
|
|
551
|
-
}),
|
|
577
|
+
}), u += D.content.length, d++) : T = !1;
|
|
552
578
|
else {
|
|
553
|
-
let
|
|
554
|
-
const
|
|
555
|
-
if (
|
|
556
|
-
const
|
|
557
|
-
q !== -1 ? (
|
|
579
|
+
let M = "";
|
|
580
|
+
const j = e.find((A, q) => q > d && A.type === "text");
|
|
581
|
+
if (j) {
|
|
582
|
+
const A = o.substring(u), q = A.indexOf(j.content);
|
|
583
|
+
q !== -1 ? (M = A.substring(0, q), u += M.length) : T = !1;
|
|
558
584
|
} else
|
|
559
|
-
|
|
560
|
-
if (
|
|
561
|
-
const
|
|
562
|
-
|
|
585
|
+
M = o.substring(u), u = o.length;
|
|
586
|
+
if (T) {
|
|
587
|
+
const A = s(D.content, M);
|
|
588
|
+
l.push({ node: A, isField: !0 }), d++;
|
|
563
589
|
}
|
|
564
590
|
}
|
|
565
591
|
}
|
|
566
|
-
if (
|
|
567
|
-
for (let
|
|
568
|
-
const
|
|
569
|
-
if (
|
|
570
|
-
const
|
|
571
|
-
|
|
592
|
+
if (T && d < e.length)
|
|
593
|
+
for (let D = d; D < e.length; D++) {
|
|
594
|
+
const M = e[D];
|
|
595
|
+
if (M.type === "field") {
|
|
596
|
+
const j = !a.value || a.value === "" ? r(M.content) : "", A = s(M.content, j);
|
|
597
|
+
l.push({ node: A, isField: !0 });
|
|
572
598
|
} else
|
|
573
|
-
|
|
574
|
-
node: document.createTextNode(
|
|
599
|
+
l.push({
|
|
600
|
+
node: document.createTextNode(M.content),
|
|
575
601
|
isField: !1
|
|
576
602
|
});
|
|
577
603
|
}
|
|
578
|
-
return { success:
|
|
579
|
-
},
|
|
604
|
+
return { success: T, elements: l };
|
|
605
|
+
}, x = () => {
|
|
580
606
|
if (!n.value) return;
|
|
581
|
-
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
607
|
+
a.isInternalUpdate = !0;
|
|
608
|
+
const e = i(a.template), o = v(e, a.value);
|
|
609
|
+
t(), V(() => {
|
|
610
|
+
h(), o && o.textContent ? E(o, "inside", !1) : o ? E(o, "inside", !0) : F(), a.isInternalUpdate = !1;
|
|
585
611
|
});
|
|
586
|
-
},
|
|
587
|
-
if (
|
|
588
|
-
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
},
|
|
612
|
+
}, y = () => {
|
|
613
|
+
if (a.isComposing) return;
|
|
614
|
+
K(), z(), h();
|
|
615
|
+
const e = f();
|
|
616
|
+
e !== a.value && (a.onValueChange(e), a.onInput(e)), t(e), e === "" && n.value && Array.from(n.value.childNodes).every((l) => l.nodeType === Node.ELEMENT_NODE && l.classList.contains("template-field") ? !l.textContent || l.textContent.trim() === "" : !1) && K();
|
|
617
|
+
}, K = () => {
|
|
618
|
+
if (!n.value) return;
|
|
619
|
+
const e = [];
|
|
620
|
+
n.value.childNodes.forEach((o) => {
|
|
621
|
+
o.nodeType === Node.TEXT_NODE ? (o.textContent || "").trim() === "" && e.push(o) : o.nodeType === Node.ELEMENT_NODE && o.tagName.toLowerCase() === "br" && e.push(o);
|
|
622
|
+
}), e.forEach((o) => {
|
|
623
|
+
o.parentNode && o.parentNode.removeChild(o);
|
|
624
|
+
});
|
|
625
|
+
}, P = (e) => {
|
|
626
|
+
if (!a.template || !a.initialValues)
|
|
627
|
+
return "字段";
|
|
628
|
+
for (const [o, l] of Object.entries(a.initialValues))
|
|
629
|
+
if (l === e)
|
|
630
|
+
return o;
|
|
631
|
+
return e.length <= 2 || /^[[\]{}()]+$/.test(e) || e.includes("[") && e.includes("]") ? e : "字段";
|
|
632
|
+
}, H = (e) => {
|
|
633
|
+
const o = e.getAttribute("data-placeholder");
|
|
634
|
+
if (o)
|
|
635
|
+
return o;
|
|
636
|
+
const l = e.getAttribute("title") || e.getAttribute("data-field") || e.getAttribute("data-key") || e.getAttribute("placeholder") || "";
|
|
637
|
+
if (l)
|
|
638
|
+
return l;
|
|
639
|
+
const u = e.textContent || "";
|
|
640
|
+
return P(u);
|
|
641
|
+
}, z = () => {
|
|
642
|
+
if (!n.value) return;
|
|
643
|
+
n.value.querySelectorAll("span").forEach((o) => {
|
|
644
|
+
const l = o, u = l.style, d = l.classList.contains("template-field"), T = l.hasAttribute("data-placeholder");
|
|
645
|
+
if (d && T)
|
|
646
|
+
return;
|
|
647
|
+
const D = u.backgroundColor && // 标准格式
|
|
648
|
+
(u.backgroundColor === "rgba(0, 0, 0, 0.05)" || u.backgroundColor === "rgba(0, 0, 0, 0.08)" || // 可能的变体格式
|
|
649
|
+
u.backgroundColor.includes("rgba(0, 0, 0, 0.05)") || u.backgroundColor.includes("rgba(0, 0, 0, 0.08)") || // 十六进制或其他可能的格式
|
|
650
|
+
u.backgroundColor.toLowerCase().includes("0.05") || u.backgroundColor.toLowerCase().includes("0.08")), M = u.borderRadius === "4px" || u.padding === "3px 8px" || u.margin === "0px 2px" || u.whiteSpace === "nowrap" && u.padding && u.margin;
|
|
651
|
+
if (D || M || T) {
|
|
652
|
+
if (l.className = "template-field", !l.getAttribute("data-placeholder")) {
|
|
653
|
+
const A = H(l);
|
|
654
|
+
A && l.setAttribute("data-placeholder", A);
|
|
655
|
+
}
|
|
656
|
+
l.removeAttribute("style");
|
|
657
|
+
const j = l.textContent || "";
|
|
658
|
+
p(l, j);
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
}, h = () => {
|
|
592
662
|
if (!n.value) return;
|
|
593
|
-
n.value.querySelectorAll(".template-field").forEach((
|
|
594
|
-
const
|
|
595
|
-
|
|
663
|
+
n.value.querySelectorAll(".template-field").forEach((o) => {
|
|
664
|
+
const l = o.textContent || "";
|
|
665
|
+
p(o, l);
|
|
596
666
|
});
|
|
597
667
|
};
|
|
598
668
|
return {
|
|
599
669
|
// 状态
|
|
600
|
-
hasContent:
|
|
670
|
+
hasContent: g,
|
|
601
671
|
// 解析和DOM操作
|
|
602
|
-
parseTemplateToParts:
|
|
603
|
-
getValueFromDOM:
|
|
604
|
-
getInitialContentForField:
|
|
605
|
-
createFieldElement:
|
|
672
|
+
parseTemplateToParts: i,
|
|
673
|
+
getValueFromDOM: f,
|
|
674
|
+
getInitialContentForField: r,
|
|
675
|
+
createFieldElement: s,
|
|
606
676
|
// 光标操作
|
|
607
|
-
setCursorTo:
|
|
608
|
-
setCursorToEnd:
|
|
677
|
+
setCursorTo: E,
|
|
678
|
+
setCursorToEnd: F,
|
|
609
679
|
// DOM更新
|
|
610
|
-
updateEditorDOM:
|
|
611
|
-
renderTemplateToDOM:
|
|
680
|
+
updateEditorDOM: x,
|
|
681
|
+
renderTemplateToDOM: v,
|
|
612
682
|
// 事件处理
|
|
613
|
-
handleInput:
|
|
614
|
-
checkHasContent:
|
|
683
|
+
handleInput: y,
|
|
684
|
+
checkHasContent: t,
|
|
685
|
+
cleanupEmptyTextNodes: K,
|
|
686
|
+
// 推断 placeholder
|
|
687
|
+
inferPlaceholderForContent: P,
|
|
688
|
+
extractPlaceholderFromElement: H,
|
|
615
689
|
// 方法
|
|
616
690
|
resetFields: () => {
|
|
617
691
|
if (!n.value) return;
|
|
618
|
-
|
|
619
|
-
const
|
|
620
|
-
|
|
621
|
-
const
|
|
622
|
-
let
|
|
623
|
-
|
|
624
|
-
if (
|
|
625
|
-
const
|
|
626
|
-
|
|
692
|
+
a.isInternalUpdate = !0;
|
|
693
|
+
const e = n.value;
|
|
694
|
+
e.innerHTML = "";
|
|
695
|
+
const o = i(a.template);
|
|
696
|
+
let l = "";
|
|
697
|
+
o.forEach((u) => {
|
|
698
|
+
if (u.type === "field") {
|
|
699
|
+
const d = r(u.content), T = s(u.content, d);
|
|
700
|
+
d && (l += d), e.appendChild(T);
|
|
627
701
|
} else
|
|
628
|
-
|
|
629
|
-
}),
|
|
630
|
-
|
|
702
|
+
e.appendChild(document.createTextNode(u.content)), l += u.content;
|
|
703
|
+
}), a.onValueChange(l), F(), t(l), V(() => {
|
|
704
|
+
a.isInternalUpdate = !1;
|
|
631
705
|
});
|
|
632
706
|
},
|
|
633
707
|
activateFirstField: () => {
|
|
634
|
-
var
|
|
635
|
-
const
|
|
636
|
-
|
|
708
|
+
var o;
|
|
709
|
+
const e = (o = n.value) == null ? void 0 : o.querySelector(".template-field");
|
|
710
|
+
e ? E(e, "inside", !1) : F();
|
|
637
711
|
},
|
|
638
712
|
// 选项更新
|
|
639
|
-
updateOptions:
|
|
713
|
+
updateOptions: C
|
|
640
714
|
};
|
|
641
715
|
}
|
|
642
|
-
const
|
|
716
|
+
const ht = /* @__PURE__ */ he({
|
|
643
717
|
__name: "TemplateEditor",
|
|
644
|
-
props: {
|
|
645
|
-
template: {},
|
|
718
|
+
props: /* @__PURE__ */ Se({
|
|
646
719
|
value: {},
|
|
647
|
-
autofocus: { type: Boolean }
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
720
|
+
autofocus: { type: Boolean }
|
|
721
|
+
}, {
|
|
722
|
+
value: { default: "" },
|
|
723
|
+
valueModifiers: {}
|
|
724
|
+
}),
|
|
725
|
+
emits: /* @__PURE__ */ Se(["input", "content-status", "submit", "focus", "blur", "empty-content"], ["update:value"]),
|
|
726
|
+
setup(n, { expose: b, emit: g }) {
|
|
727
|
+
const a = je(n, "value"), C = n, i = g, f = I(null), r = I(""), s = I({}), p = I(!1), S = I(!1), t = pt(f, {
|
|
728
|
+
template: r.value,
|
|
729
|
+
value: a.value,
|
|
730
|
+
initialValues: s.value,
|
|
731
|
+
isInternalUpdate: p,
|
|
732
|
+
isComposing: S,
|
|
733
|
+
onValueChange: (h) => {
|
|
734
|
+
if (a.value !== h) {
|
|
735
|
+
const m = p.value;
|
|
736
|
+
p.value = !0, a.value = h, V(() => {
|
|
737
|
+
p.value = m;
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
onInput: (h) => {
|
|
742
|
+
i("input", h);
|
|
743
|
+
},
|
|
744
|
+
onContentStatusChange: (h) => i("content-status", h),
|
|
745
|
+
onSubmit: (h) => i("submit", h)
|
|
746
|
+
}), E = at({
|
|
747
|
+
editor: f,
|
|
748
|
+
isComposing: S,
|
|
749
|
+
getValueFromDOM: t.getValueFromDOM,
|
|
750
|
+
handleInput: t.handleInput,
|
|
751
|
+
onSubmit: (h) => i("submit", h)
|
|
752
|
+
}), F = (h, m) => {
|
|
753
|
+
let _ = h;
|
|
754
|
+
return Object.entries(m).forEach(([e, o]) => {
|
|
755
|
+
const l = `[${e}]`;
|
|
756
|
+
_ = _.replace(new RegExp(l.replace(/[[\]]/g, "\\$&"), "g"), o);
|
|
757
|
+
}), _;
|
|
758
|
+
}, v = (h) => {
|
|
759
|
+
p.value = !0, r.value = h.template, s.value = h.initialValues || {};
|
|
760
|
+
const m = F(r.value, s.value);
|
|
761
|
+
t.updateOptions({
|
|
762
|
+
template: r.value,
|
|
763
|
+
value: m,
|
|
764
|
+
// 使用新生成的内容而不是旧的inputValue
|
|
765
|
+
initialValues: s.value
|
|
766
|
+
}), t.updateEditorDOM(), a.value = m, V(() => {
|
|
767
|
+
p.value = !1;
|
|
768
|
+
});
|
|
769
|
+
}, k = () => {
|
|
770
|
+
S.value = !0;
|
|
771
|
+
}, x = () => {
|
|
772
|
+
S.value = !1, t.handleInput();
|
|
773
|
+
}, y = (h) => {
|
|
774
|
+
var e;
|
|
775
|
+
if (!f.value) return;
|
|
776
|
+
const m = h.target;
|
|
777
|
+
let _ = null;
|
|
778
|
+
if (m.classList.contains("template-field") ? _ = m : (e = m.parentElement) != null && e.classList.contains("template-field") && (_ = m.parentElement), _ && (!_.textContent || _.textContent.trim() === "")) {
|
|
779
|
+
const o = window.getSelection(), l = document.createRange();
|
|
780
|
+
o && (l.selectNodeContents(_), l.collapse(!0), o.removeAllRanges(), o.addRange(l), _.focus(), h.preventDefault(), h.stopPropagation());
|
|
781
|
+
}
|
|
782
|
+
}, K = (h) => {
|
|
783
|
+
h.preventDefault();
|
|
784
|
+
const m = h.clipboardData;
|
|
785
|
+
if (!m) return;
|
|
786
|
+
const _ = m.getData("text/html"), e = m.getData("text/plain");
|
|
787
|
+
if (_) {
|
|
788
|
+
const o = document.createElement("div");
|
|
789
|
+
o.innerHTML = _;
|
|
790
|
+
const l = o.querySelectorAll("span");
|
|
791
|
+
let u = !1;
|
|
792
|
+
if (l.forEach((d) => {
|
|
793
|
+
const T = d, D = T.style, M = T.classList.contains("template-field"), j = T.hasAttribute("data-placeholder"), A = D.backgroundColor && // 标准格式
|
|
794
|
+
(D.backgroundColor === "rgba(0, 0, 0, 0.05)" || D.backgroundColor === "rgba(0, 0, 0, 0.08)" || // 可能的变体格式
|
|
795
|
+
D.backgroundColor.includes("rgba(0, 0, 0, 0.05)") || D.backgroundColor.includes("rgba(0, 0, 0, 0.08)") || // 十六进制或其他可能的格式
|
|
796
|
+
D.backgroundColor.toLowerCase().includes("0.05") || D.backgroundColor.toLowerCase().includes("0.08")), q = D.borderRadius === "4px" || D.padding === "3px 8px" || D.margin === "0px 2px" || D.whiteSpace === "nowrap";
|
|
797
|
+
if (M || j || A || q) {
|
|
798
|
+
if (u = !0, T.className = "template-field", !T.getAttribute("data-placeholder")) {
|
|
799
|
+
const ee = t.extractPlaceholderFromElement(T);
|
|
800
|
+
ee && T.setAttribute("data-placeholder", ee);
|
|
801
|
+
}
|
|
802
|
+
T.removeAttribute("style");
|
|
803
|
+
}
|
|
804
|
+
}), u) {
|
|
805
|
+
P(o);
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
e && H(e);
|
|
810
|
+
}, P = (h) => {
|
|
811
|
+
const m = window.getSelection();
|
|
812
|
+
if (m && m.rangeCount > 0) {
|
|
813
|
+
const _ = m.getRangeAt(0);
|
|
814
|
+
_.deleteContents();
|
|
815
|
+
const e = document.createDocumentFragment();
|
|
816
|
+
for (; h.firstChild; )
|
|
817
|
+
e.appendChild(h.firstChild);
|
|
818
|
+
_.insertNode(e), _.collapse(!1), m.removeAllRanges(), m.addRange(_), z();
|
|
680
819
|
}
|
|
820
|
+
}, H = (h) => {
|
|
821
|
+
const m = window.getSelection();
|
|
822
|
+
if (m && m.rangeCount > 0) {
|
|
823
|
+
const _ = m.getRangeAt(0);
|
|
824
|
+
_.deleteContents(), _.insertNode(document.createTextNode(h)), _.collapse(!1), m.removeAllRanges(), m.addRange(_), z();
|
|
825
|
+
}
|
|
826
|
+
}, z = () => {
|
|
827
|
+
S.value = !1, V(() => {
|
|
828
|
+
t.handleInput();
|
|
829
|
+
const h = t.getValueFromDOM();
|
|
830
|
+
if (h !== a.value) {
|
|
831
|
+
const m = p.value;
|
|
832
|
+
p.value = !0, a.value = h, i("input", h), V(() => {
|
|
833
|
+
p.value = m;
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
setTimeout(() => {
|
|
837
|
+
const m = t.getValueFromDOM();
|
|
838
|
+
m !== a.value && (p.value = !0, a.value = m, i("input", m), V(() => {
|
|
839
|
+
p.value = !1;
|
|
840
|
+
}));
|
|
841
|
+
}, 50);
|
|
842
|
+
});
|
|
681
843
|
};
|
|
682
|
-
return
|
|
683
|
-
|
|
684
|
-
}),
|
|
685
|
-
() =>
|
|
844
|
+
return qe(() => {
|
|
845
|
+
r.value && t.updateEditorDOM(), C.autofocus && f.value && t.setCursorToEnd();
|
|
846
|
+
}), J(
|
|
847
|
+
() => r.value,
|
|
686
848
|
() => {
|
|
687
|
-
|
|
688
|
-
template:
|
|
689
|
-
value:
|
|
690
|
-
initialValues:
|
|
691
|
-
}),
|
|
849
|
+
p.value || (t.updateOptions({
|
|
850
|
+
template: r.value,
|
|
851
|
+
value: a.value,
|
|
852
|
+
initialValues: s.value
|
|
853
|
+
}), t.updateEditorDOM());
|
|
692
854
|
}
|
|
693
|
-
),
|
|
694
|
-
() =>
|
|
695
|
-
(
|
|
696
|
-
|
|
697
|
-
template:
|
|
698
|
-
value:
|
|
699
|
-
initialValues:
|
|
700
|
-
}),
|
|
855
|
+
), J(
|
|
856
|
+
() => s.value,
|
|
857
|
+
() => {
|
|
858
|
+
p.value || (t.updateOptions({
|
|
859
|
+
template: r.value,
|
|
860
|
+
value: a.value,
|
|
861
|
+
initialValues: s.value
|
|
862
|
+
}), t.updateEditorDOM());
|
|
701
863
|
},
|
|
702
|
-
{ deep: !
|
|
864
|
+
{ deep: !0 }
|
|
865
|
+
), J(
|
|
866
|
+
() => a.value,
|
|
867
|
+
(h) => {
|
|
868
|
+
p.value || (t.updateOptions({
|
|
869
|
+
template: r.value,
|
|
870
|
+
value: h,
|
|
871
|
+
initialValues: s.value
|
|
872
|
+
}), t.updateEditorDOM()), (!h || h.trim() === "") && i("empty-content");
|
|
873
|
+
}
|
|
703
874
|
), b({
|
|
704
875
|
focus: () => {
|
|
705
|
-
var
|
|
706
|
-
(
|
|
876
|
+
var h;
|
|
877
|
+
(h = f.value) == null || h.focus(), t.setCursorToEnd();
|
|
707
878
|
},
|
|
708
|
-
resetFields:
|
|
709
|
-
activateFirstField:
|
|
710
|
-
|
|
879
|
+
resetFields: t.resetFields,
|
|
880
|
+
activateFirstField: t.activateFirstField,
|
|
881
|
+
getValueFromDOM: t.getValueFromDOM,
|
|
882
|
+
setTemplate: v
|
|
883
|
+
}), (h, m) => (R(), O("div", {
|
|
711
884
|
class: "template-editor",
|
|
712
885
|
ref_key: "contentEditableRef",
|
|
713
|
-
ref:
|
|
886
|
+
ref: f,
|
|
714
887
|
contenteditable: "true",
|
|
715
|
-
onInput:
|
|
716
|
-
(...
|
|
717
|
-
onKeydown:
|
|
718
|
-
(...
|
|
719
|
-
onClick:
|
|
720
|
-
onCompositionstart:
|
|
721
|
-
onCompositionend:
|
|
722
|
-
onFocus:
|
|
723
|
-
onBlur:
|
|
888
|
+
onInput: m[0] || (m[0] = //@ts-ignore
|
|
889
|
+
(..._) => w(t).handleInput && w(t).handleInput(..._)),
|
|
890
|
+
onKeydown: m[1] || (m[1] = //@ts-ignore
|
|
891
|
+
(..._) => w(E).handleTemplateKeyDown && w(E).handleTemplateKeyDown(..._)),
|
|
892
|
+
onClick: y,
|
|
893
|
+
onCompositionstart: k,
|
|
894
|
+
onCompositionend: x,
|
|
895
|
+
onFocus: m[2] || (m[2] = (_) => h.$emit("focus", _)),
|
|
896
|
+
onBlur: m[3] || (m[3] = (_) => h.$emit("blur", _)),
|
|
897
|
+
onPaste: K
|
|
724
898
|
}, null, 544));
|
|
725
899
|
}
|
|
726
|
-
}),
|
|
900
|
+
}), mt = ["data-theme"], gt = { class: "tiny-sender__container" }, vt = {
|
|
727
901
|
key: 0,
|
|
728
902
|
class: "tiny-sender__header-slot"
|
|
729
|
-
},
|
|
903
|
+
}, yt = {
|
|
730
904
|
key: 0,
|
|
731
905
|
class: "tiny-sender__prefix-slot"
|
|
732
|
-
},
|
|
906
|
+
}, bt = { class: "tiny-sender__content-area" }, Ct = {
|
|
733
907
|
key: 0,
|
|
734
908
|
class: "tiny-sender__decorative-content"
|
|
735
|
-
},
|
|
909
|
+
}, wt = {
|
|
736
910
|
key: 2,
|
|
737
911
|
class: "tiny-sender__input-field-wrapper"
|
|
738
|
-
},
|
|
912
|
+
}, St = {
|
|
739
913
|
key: 0,
|
|
740
914
|
class: "tiny-sender__completion-placeholder"
|
|
741
|
-
},
|
|
915
|
+
}, _t = { class: "user-input-mirror" }, Et = {
|
|
742
916
|
key: 0,
|
|
743
917
|
class: "tiny-sender__tab-hint"
|
|
744
|
-
},
|
|
918
|
+
}, Tt = {
|
|
745
919
|
key: 1,
|
|
746
920
|
class: "tiny-sender__actions-slot"
|
|
747
|
-
},
|
|
921
|
+
}, Nt = { class: "tiny-sender__footer-left" }, kt = { class: "tiny-sender__footer-right" }, xt = { class: "real-word-length" }, Rt = {
|
|
748
922
|
key: 1,
|
|
749
923
|
class: "tiny-sender__toolbar"
|
|
750
|
-
},
|
|
924
|
+
}, Dt = { class: "tiny-sender__buttons-container" }, Ft = {
|
|
751
925
|
key: 1,
|
|
752
926
|
class: "tiny-sender__footer-slot"
|
|
753
|
-
},
|
|
927
|
+
}, Lt = ["onMouseenter", "onMousedown"], It = { class: "suggestion-item__icon" }, Ot = { class: "suggestion-item__text" }, At = {
|
|
754
928
|
key: 0,
|
|
755
929
|
class: "tiny-sender__error"
|
|
756
|
-
},
|
|
930
|
+
}, re = /* @__PURE__ */ he({
|
|
757
931
|
__name: "index",
|
|
758
932
|
props: {
|
|
759
933
|
autofocus: { type: Boolean, default: !1 },
|
|
@@ -778,325 +952,337 @@ const rt = /* @__PURE__ */ ce({
|
|
|
778
952
|
templateInitialValues: { default: () => ({}) }
|
|
779
953
|
},
|
|
780
954
|
emits: ["update:modelValue", "submit", "clear", "speech-start", "speech-end", "speech-interim", "speech-error", "suggestion-select", "focus", "blur", "escape-press", "cancel", "reset-template"],
|
|
781
|
-
setup(n, { expose: b, emit:
|
|
782
|
-
const
|
|
783
|
-
showSuggestionsPopup:
|
|
784
|
-
highlightedIndex:
|
|
785
|
-
completionPlaceholder:
|
|
786
|
-
showTabHint:
|
|
787
|
-
suggestionsListRef:
|
|
788
|
-
filteredSuggestions:
|
|
789
|
-
activeSuggestion:
|
|
790
|
-
updateCompletionPlaceholder:
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
955
|
+
setup(n, { expose: b, emit: g }) {
|
|
956
|
+
const a = n, C = g, i = I(null), f = I(null), r = I(null), s = I(null), p = I(null), S = I(!1), { inputValue: t, isComposing: E, clearInput: F } = st(a, C), {
|
|
957
|
+
showSuggestionsPopup: v,
|
|
958
|
+
highlightedIndex: k,
|
|
959
|
+
completionPlaceholder: x,
|
|
960
|
+
showTabHint: y,
|
|
961
|
+
suggestionsListRef: K,
|
|
962
|
+
filteredSuggestions: P,
|
|
963
|
+
activeSuggestion: H,
|
|
964
|
+
updateCompletionPlaceholder: z,
|
|
965
|
+
updateSuggestionsState: h,
|
|
966
|
+
selectSuggestion: m,
|
|
967
|
+
acceptCurrentSuggestion: _,
|
|
968
|
+
closeSuggestionsPopup: e,
|
|
969
|
+
navigateSuggestions: o,
|
|
970
|
+
handleSuggestionItemHover: l,
|
|
971
|
+
highlightSuggestionText: u
|
|
972
|
+
} = rt(a, C, t, E), d = I(a.mode), T = I(!1), D = () => {
|
|
973
|
+
d.value === "single" && (d.value = "multiple", V(() => {
|
|
799
974
|
setTimeout(() => {
|
|
800
|
-
const
|
|
801
|
-
if (
|
|
802
|
-
|
|
803
|
-
const
|
|
804
|
-
|
|
975
|
+
const c = document.querySelector(".tiny-textarea__inner");
|
|
976
|
+
if (c) {
|
|
977
|
+
c.style.whiteSpace = "pre-wrap";
|
|
978
|
+
const N = t.value.length;
|
|
979
|
+
c.focus(), c.setSelectionRange(N, N);
|
|
805
980
|
}
|
|
806
981
|
}, 50);
|
|
807
982
|
}));
|
|
808
|
-
},
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
const
|
|
812
|
-
return document.body.removeChild(
|
|
813
|
-
},
|
|
814
|
-
if (
|
|
815
|
-
const
|
|
816
|
-
if (!
|
|
817
|
-
const
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
const
|
|
821
|
-
if (
|
|
822
|
-
|
|
823
|
-
const
|
|
824
|
-
|
|
983
|
+
}, M = (c, N) => {
|
|
984
|
+
const L = document.createElement("span");
|
|
985
|
+
L.style.visibility = "hidden", L.style.position = "absolute", L.style.whiteSpace = "nowrap", L.style.font = N, L.textContent = c, document.body.appendChild(L);
|
|
986
|
+
const Q = L.offsetWidth;
|
|
987
|
+
return document.body.removeChild(L), Q;
|
|
988
|
+
}, j = () => {
|
|
989
|
+
if (a.mode !== "single" || !i.value || T.value) return;
|
|
990
|
+
const N = document.querySelector(".tiny-sender__content-area").querySelector(".tiny-input__inner"), L = p.value || document.querySelector(".tiny-sender__buttons-container");
|
|
991
|
+
if (!N) return;
|
|
992
|
+
const Q = window.getComputedStyle(N).font, Y = M(t.value, Q), Ke = N.offsetWidth - ((L == null ? void 0 : L.offsetWidth) || 0) - 20;
|
|
993
|
+
Y > Ke && d.value === "single" && (T.value = !0, d.value = "multiple", V(() => {
|
|
994
|
+
i.value ? setTimeout(() => {
|
|
995
|
+
const oe = document.querySelector(".tiny-textarea__inner");
|
|
996
|
+
if (oe) {
|
|
997
|
+
oe.style.whiteSpace = "pre-wrap";
|
|
998
|
+
const we = t.value.length;
|
|
999
|
+
oe.focus(), oe.setSelectionRange(we, we);
|
|
825
1000
|
}
|
|
826
|
-
|
|
827
|
-
}, 300) :
|
|
1001
|
+
T.value = !1;
|
|
1002
|
+
}, 300) : T.value = !1;
|
|
828
1003
|
}));
|
|
829
|
-
},
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
1004
|
+
}, A = () => {
|
|
1005
|
+
if (S.value && r.value)
|
|
1006
|
+
me();
|
|
1007
|
+
else if (i.value)
|
|
1008
|
+
i.value.focus();
|
|
1009
|
+
else {
|
|
1010
|
+
const c = document.querySelector(".tiny-input__inner");
|
|
1011
|
+
c == null || c.focus();
|
|
1012
|
+
}
|
|
1013
|
+
}, q = () => {
|
|
1014
|
+
S.value = !1, C("reset-template"), V(() => {
|
|
1015
|
+
t.value === "" && (d.value = a.mode || "single"), setTimeout(() => {
|
|
1016
|
+
A();
|
|
1017
|
+
}, 50);
|
|
1018
|
+
});
|
|
1019
|
+
}, ee = () => {
|
|
1020
|
+
var c;
|
|
1021
|
+
F(), S.value ? q() : (c = f.value) == null || c.focus(), V(() => {
|
|
1022
|
+
t.value === "" && (d.value = a.mode || "single");
|
|
1023
|
+
}), e();
|
|
1024
|
+
}, Re = (c) => {
|
|
1025
|
+
C("update:modelValue", c);
|
|
1026
|
+
}, me = () => {
|
|
1027
|
+
r.value && r.value.activateFirstField();
|
|
1028
|
+
}, De = (c, N) => {
|
|
1029
|
+
S.value = !0, V(() => {
|
|
1030
|
+
r.value && r.value.setTemplate({ template: c, initialValues: N });
|
|
1031
|
+
});
|
|
1032
|
+
}, Fe = $(() => {
|
|
1033
|
+
const c = typeof a.speech == "object" ? a.speech : {};
|
|
839
1034
|
return {
|
|
840
|
-
...
|
|
841
|
-
onStart: () =>
|
|
842
|
-
onEnd: (
|
|
843
|
-
onInterim: (
|
|
844
|
-
onFinal: (
|
|
845
|
-
if (
|
|
846
|
-
|
|
1035
|
+
...c,
|
|
1036
|
+
onStart: () => C("speech-start"),
|
|
1037
|
+
onEnd: (N) => C("speech-end", N),
|
|
1038
|
+
onInterim: (N) => C("speech-interim", N),
|
|
1039
|
+
onFinal: (N) => {
|
|
1040
|
+
if (c.autoReplace)
|
|
1041
|
+
t.value = N;
|
|
847
1042
|
else {
|
|
848
|
-
const
|
|
849
|
-
|
|
1043
|
+
const L = t.value;
|
|
1044
|
+
L && N && !L.endsWith(" ") && !N.startsWith(" ") && L.length > 0 ? t.value = L + " " + N : t.value = L + N;
|
|
850
1045
|
}
|
|
851
|
-
|
|
1046
|
+
C("speech-end", N);
|
|
852
1047
|
},
|
|
853
|
-
onError: (
|
|
854
|
-
|
|
1048
|
+
onError: (N) => {
|
|
1049
|
+
Pe(N.message), C("speech-error", N);
|
|
855
1050
|
}
|
|
856
1051
|
};
|
|
857
|
-
}), { speechState:
|
|
858
|
-
|
|
859
|
-
}, { handleKeyPress:
|
|
860
|
-
t,
|
|
861
|
-
m,
|
|
1052
|
+
}), { speechState: le, start: ge, stop: ve } = ot(Fe.value), ue = () => {
|
|
1053
|
+
le.isRecording ? ve() : ge();
|
|
1054
|
+
}, { handleKeyPress: Le, triggerSubmit: ce } = lt(
|
|
862
1055
|
a,
|
|
863
1056
|
C,
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
},
|
|
1057
|
+
t,
|
|
1058
|
+
E,
|
|
1059
|
+
le,
|
|
1060
|
+
v,
|
|
1061
|
+
H,
|
|
1062
|
+
_,
|
|
1063
|
+
e,
|
|
1064
|
+
o,
|
|
1065
|
+
ue,
|
|
1066
|
+
d,
|
|
1067
|
+
D
|
|
1068
|
+
), Ie = (c) => {
|
|
1069
|
+
C("focus", c), t.value && P.value.length > 0 && !a.template && (v.value = !0, y.value = !0, k.value === -1 && (k.value = 0), z(H.value || P.value[0]));
|
|
1070
|
+
}, Oe = (c) => {
|
|
1071
|
+
C("blur", c);
|
|
1072
|
+
}, Ae = $(() => d.value === "multiple" ? "textarea" : "text"), Ve = $(
|
|
878
1073
|
() => ({
|
|
879
1074
|
display: "flex",
|
|
880
|
-
justifyContent:
|
|
1075
|
+
justifyContent: a.showWordLimit && a.maxLength !== 1 / 0 ? "space-between" : "flex-end",
|
|
881
1076
|
alignItems: "center"
|
|
882
1077
|
})
|
|
883
|
-
),
|
|
884
|
-
"is-disabled":
|
|
885
|
-
"is-loading":
|
|
886
|
-
"has-error": !!
|
|
887
|
-
"is-auto-switching":
|
|
888
|
-
})),
|
|
889
|
-
|
|
890
|
-
},
|
|
891
|
-
|
|
892
|
-
|
|
1078
|
+
), Me = Ue(), Be = $(() => !!Me.decorativeContent), ae = $(() => a.disabled || Be.value), ye = $(() => a.loading), be = $(() => a.hasContent !== void 0 ? a.hasContent : !!t.value), $e = $(() => ({
|
|
1079
|
+
"is-disabled": ae.value,
|
|
1080
|
+
"is-loading": ye.value,
|
|
1081
|
+
"has-error": !!se.value,
|
|
1082
|
+
"is-auto-switching": T.value
|
|
1083
|
+
})), se = I(""), Pe = (c) => {
|
|
1084
|
+
se.value = c, setTimeout(() => se.value = "", 5e3);
|
|
1085
|
+
}, We = () => {
|
|
1086
|
+
E.value = !1, setTimeout(() => {
|
|
1087
|
+
E.value = !1, h();
|
|
893
1088
|
}, 50);
|
|
894
|
-
},
|
|
895
|
-
return
|
|
896
|
-
|
|
897
|
-
}),
|
|
1089
|
+
}, de = $(() => a.maxLength !== 1 / 0 && t.value.length > a.maxLength);
|
|
1090
|
+
return J(t, () => {
|
|
1091
|
+
V(j), t.value === "" && a.mode === "single" && (d.value = "single");
|
|
1092
|
+
}), J(
|
|
898
1093
|
() => S.value,
|
|
899
|
-
(
|
|
900
|
-
|
|
1094
|
+
(c) => {
|
|
1095
|
+
c && (d.value = "multiple");
|
|
901
1096
|
}
|
|
902
1097
|
), b({
|
|
903
|
-
focus:
|
|
904
|
-
if (S.value && o.value)
|
|
905
|
-
fe();
|
|
906
|
-
else if (s.value)
|
|
907
|
-
s.value.focus();
|
|
908
|
-
else {
|
|
909
|
-
const i = document.querySelector(".tiny-input__inner");
|
|
910
|
-
i == null || i.focus();
|
|
911
|
-
}
|
|
912
|
-
},
|
|
1098
|
+
focus: A,
|
|
913
1099
|
blur: () => {
|
|
914
|
-
if (
|
|
915
|
-
|
|
1100
|
+
if (i.value)
|
|
1101
|
+
i.value.blur();
|
|
916
1102
|
else {
|
|
917
|
-
const
|
|
918
|
-
|
|
1103
|
+
const c = document.querySelector(".tiny-input__inner");
|
|
1104
|
+
c == null || c.blur();
|
|
919
1105
|
}
|
|
920
1106
|
},
|
|
921
|
-
clear:
|
|
922
|
-
submit:
|
|
923
|
-
startSpeech:
|
|
924
|
-
stopSpeech:
|
|
925
|
-
activateTemplateFirstField:
|
|
926
|
-
|
|
1107
|
+
clear: ee,
|
|
1108
|
+
submit: ce,
|
|
1109
|
+
startSpeech: ge,
|
|
1110
|
+
stopSpeech: ve,
|
|
1111
|
+
activateTemplateFirstField: me,
|
|
1112
|
+
setTemplate: De
|
|
1113
|
+
}), (c, N) => (R(), O("div", {
|
|
927
1114
|
ref_key: "senderRef",
|
|
928
|
-
ref:
|
|
929
|
-
class:
|
|
930
|
-
"data-theme":
|
|
1115
|
+
ref: f,
|
|
1116
|
+
class: ne(["tiny-sender", [$e.value, `theme-${c.theme}`, `mode-${d.value}`]]),
|
|
1117
|
+
"data-theme": c.theme
|
|
931
1118
|
}, [
|
|
932
|
-
|
|
933
|
-
|
|
1119
|
+
W("div", gt, [
|
|
1120
|
+
W("div", {
|
|
934
1121
|
class: "tiny-sender__input-wrapper",
|
|
935
1122
|
ref_key: "inputWrapperRef",
|
|
936
|
-
ref:
|
|
1123
|
+
ref: s
|
|
937
1124
|
}, [
|
|
938
|
-
|
|
939
|
-
default:
|
|
940
|
-
|
|
941
|
-
|
|
1125
|
+
U(fe, { name: "tiny-sender-slide-down" }, {
|
|
1126
|
+
default: G(() => [
|
|
1127
|
+
c.$slots.header ? (R(), O("div", vt, [
|
|
1128
|
+
Z(c.$slots, "header")
|
|
942
1129
|
])) : B("", !0)
|
|
943
1130
|
]),
|
|
944
1131
|
_: 3
|
|
945
1132
|
}),
|
|
946
|
-
|
|
947
|
-
class:
|
|
1133
|
+
W("div", {
|
|
1134
|
+
class: ne(["tiny-sender__input-row", { "has-prefix": c.$slots.prefix, "has-header": c.$slots.header }])
|
|
948
1135
|
}, [
|
|
949
|
-
|
|
950
|
-
|
|
1136
|
+
c.$slots.prefix ? (R(), O("div", yt, [
|
|
1137
|
+
Z(c.$slots, "prefix")
|
|
951
1138
|
])) : B("", !0),
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1139
|
+
W("div", bt, [
|
|
1140
|
+
c.$slots.decorativeContent ? (R(), O("div", Ct, [
|
|
1141
|
+
Z(c.$slots, "decorativeContent")
|
|
955
1142
|
])) : B("", !0),
|
|
956
|
-
S.value ? (
|
|
1143
|
+
S.value ? (R(), X(ht, {
|
|
957
1144
|
key: 1,
|
|
958
1145
|
ref_key: "templateEditorRef",
|
|
959
|
-
ref:
|
|
960
|
-
|
|
961
|
-
value:
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
K(_(He), {
|
|
1146
|
+
ref: r,
|
|
1147
|
+
value: w(t),
|
|
1148
|
+
"onUpdate:value": N[0] || (N[0] = (L) => _e(t) ? t.value = L : null),
|
|
1149
|
+
onInput: Re,
|
|
1150
|
+
onEmptyContent: q
|
|
1151
|
+
}, null, 8, ["value"])) : (R(), O("div", wt, [
|
|
1152
|
+
U(w(Ge), {
|
|
967
1153
|
ref_key: "inputRef",
|
|
968
|
-
ref:
|
|
969
|
-
autosize:
|
|
970
|
-
type:
|
|
971
|
-
readonly:
|
|
1154
|
+
ref: i,
|
|
1155
|
+
autosize: c.autoSize,
|
|
1156
|
+
type: Ae.value,
|
|
1157
|
+
readonly: ye.value,
|
|
972
1158
|
resize: "none",
|
|
973
|
-
modelValue:
|
|
974
|
-
"onUpdate:modelValue":
|
|
975
|
-
disabled:
|
|
976
|
-
placeholder:
|
|
977
|
-
autofocus:
|
|
978
|
-
onKeydown:
|
|
979
|
-
onCompositionstart:
|
|
980
|
-
onCompositionend:
|
|
981
|
-
onFocus:
|
|
982
|
-
onBlur:
|
|
1159
|
+
modelValue: w(t),
|
|
1160
|
+
"onUpdate:modelValue": N[1] || (N[1] = (L) => _e(t) ? t.value = L : null),
|
|
1161
|
+
disabled: ae.value,
|
|
1162
|
+
placeholder: c.placeholder,
|
|
1163
|
+
autofocus: c.autofocus,
|
|
1164
|
+
onKeydown: w(Le),
|
|
1165
|
+
onCompositionstart: N[2] || (N[2] = (L) => E.value = !0),
|
|
1166
|
+
onCompositionend: We,
|
|
1167
|
+
onFocus: Ie,
|
|
1168
|
+
onBlur: Oe
|
|
983
1169
|
}, null, 8, ["autosize", "type", "readonly", "modelValue", "disabled", "placeholder", "autofocus", "onKeydown"]),
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1170
|
+
w(x) && !w(E) ? (R(), O("div", St, [
|
|
1171
|
+
W("span", _t, te(w(t)), 1),
|
|
1172
|
+
Ee(te(w(x)) + " ", 1),
|
|
1173
|
+
w(y) ? (R(), O("div", Et, "TAB")) : B("", !0)
|
|
988
1174
|
])) : B("", !0)
|
|
989
1175
|
]))
|
|
990
1176
|
]),
|
|
991
|
-
|
|
992
|
-
|
|
1177
|
+
d.value === "single" ? (R(), O("div", Tt, [
|
|
1178
|
+
W("div", {
|
|
993
1179
|
class: "tiny-sender__buttons-container",
|
|
994
1180
|
ref_key: "buttonsContainerRef",
|
|
995
|
-
ref:
|
|
1181
|
+
ref: p
|
|
996
1182
|
}, [
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
"allow-speech":
|
|
1000
|
-
"allow-files":
|
|
1001
|
-
loading:
|
|
1002
|
-
disabled:
|
|
1003
|
-
"show-clear":
|
|
1004
|
-
"has-content":
|
|
1005
|
-
"speech-status":
|
|
1006
|
-
"submit-type":
|
|
1007
|
-
"is-over-limit":
|
|
1008
|
-
onClear:
|
|
1009
|
-
onToggleSpeech:
|
|
1010
|
-
onSubmit:
|
|
1011
|
-
onCancel:
|
|
1183
|
+
Z(c.$slots, "actions"),
|
|
1184
|
+
U(ke, {
|
|
1185
|
+
"allow-speech": c.allowSpeech,
|
|
1186
|
+
"allow-files": c.allowFiles,
|
|
1187
|
+
loading: c.loading,
|
|
1188
|
+
disabled: ae.value,
|
|
1189
|
+
"show-clear": c.clearable,
|
|
1190
|
+
"has-content": be.value,
|
|
1191
|
+
"speech-status": w(le),
|
|
1192
|
+
"submit-type": c.submitType,
|
|
1193
|
+
"is-over-limit": de.value,
|
|
1194
|
+
onClear: ee,
|
|
1195
|
+
onToggleSpeech: ue,
|
|
1196
|
+
onSubmit: w(ce),
|
|
1197
|
+
onCancel: N[3] || (N[3] = (L) => c.$emit("cancel"))
|
|
1012
1198
|
}, null, 8, ["allow-speech", "allow-files", "loading", "disabled", "show-clear", "has-content", "speech-status", "submit-type", "is-over-limit", "onSubmit"])
|
|
1013
1199
|
], 512)
|
|
1014
1200
|
])) : B("", !0)
|
|
1015
1201
|
], 2),
|
|
1016
|
-
|
|
1017
|
-
default:
|
|
1018
|
-
|
|
1202
|
+
U(fe, { name: "tiny-sender-slide-up" }, {
|
|
1203
|
+
default: G(() => [
|
|
1204
|
+
d.value === "multiple" ? (R(), O("div", {
|
|
1019
1205
|
key: 0,
|
|
1020
|
-
style:
|
|
1206
|
+
style: ze(Ve.value),
|
|
1021
1207
|
class: "tiny-sender__footer-slot tiny-sender__bottom-row"
|
|
1022
1208
|
}, [
|
|
1023
|
-
|
|
1024
|
-
|
|
1209
|
+
W("div", Nt, [
|
|
1210
|
+
Z(c.$slots, "footer-left")
|
|
1025
1211
|
]),
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1212
|
+
W("div", kt, [
|
|
1213
|
+
Z(c.$slots, "footer-right"),
|
|
1214
|
+
c.showWordLimit && c.maxLength !== 1 / 0 ? (R(), O("div", {
|
|
1029
1215
|
key: 0,
|
|
1030
|
-
class:
|
|
1216
|
+
class: ne(["tiny-sender__word-limit", { "is-over-limit": de.value }])
|
|
1031
1217
|
}, [
|
|
1032
|
-
|
|
1033
|
-
|
|
1218
|
+
W("span", xt, te(w(t).length), 1),
|
|
1219
|
+
Ee("/" + te(c.maxLength), 1)
|
|
1034
1220
|
], 2)) : B("", !0),
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
"allow-speech":
|
|
1039
|
-
"allow-files":
|
|
1040
|
-
loading:
|
|
1041
|
-
disabled:
|
|
1042
|
-
"show-clear":
|
|
1043
|
-
"has-content":
|
|
1044
|
-
"speech-status":
|
|
1045
|
-
"submit-type":
|
|
1046
|
-
"is-over-limit":
|
|
1047
|
-
onClear:
|
|
1048
|
-
onToggleSpeech:
|
|
1049
|
-
onSubmit:
|
|
1050
|
-
onCancel:
|
|
1221
|
+
d.value === "multiple" ? (R(), O("div", Rt, [
|
|
1222
|
+
W("div", Dt, [
|
|
1223
|
+
U(ke, {
|
|
1224
|
+
"allow-speech": c.allowSpeech,
|
|
1225
|
+
"allow-files": c.allowFiles,
|
|
1226
|
+
loading: c.loading,
|
|
1227
|
+
disabled: ae.value,
|
|
1228
|
+
"show-clear": c.clearable,
|
|
1229
|
+
"has-content": be.value,
|
|
1230
|
+
"speech-status": w(le),
|
|
1231
|
+
"submit-type": c.submitType,
|
|
1232
|
+
"is-over-limit": de.value,
|
|
1233
|
+
onClear: ee,
|
|
1234
|
+
onToggleSpeech: ue,
|
|
1235
|
+
onSubmit: w(ce),
|
|
1236
|
+
onCancel: N[4] || (N[4] = (L) => c.$emit("cancel"))
|
|
1051
1237
|
}, null, 8, ["allow-speech", "allow-files", "loading", "disabled", "show-clear", "has-content", "speech-status", "submit-type", "is-over-limit", "onSubmit"])
|
|
1052
1238
|
])
|
|
1053
1239
|
])) : B("", !0)
|
|
1054
1240
|
])
|
|
1055
|
-
], 4)) :
|
|
1056
|
-
|
|
1241
|
+
], 4)) : c.$slots.footer ? (R(), O("div", Ft, [
|
|
1242
|
+
Z(c.$slots, "footer")
|
|
1057
1243
|
])) : B("", !0)
|
|
1058
1244
|
]),
|
|
1059
1245
|
_: 3
|
|
1060
1246
|
})
|
|
1061
1247
|
], 512)
|
|
1062
1248
|
]),
|
|
1063
|
-
|
|
1064
|
-
default:
|
|
1065
|
-
|
|
1249
|
+
U(fe, { name: "tiny-sender-slide-up" }, {
|
|
1250
|
+
default: G(() => [
|
|
1251
|
+
w(v) && w(P).length ? (R(), O("div", {
|
|
1066
1252
|
key: 0,
|
|
1067
1253
|
ref_key: "suggestionsListRef",
|
|
1068
|
-
ref:
|
|
1254
|
+
ref: K,
|
|
1069
1255
|
class: "tiny-sender__suggestions"
|
|
1070
1256
|
}, [
|
|
1071
|
-
(
|
|
1072
|
-
key:
|
|
1073
|
-
class:
|
|
1074
|
-
onMouseenter: (
|
|
1075
|
-
onMousedown:
|
|
1257
|
+
(R(!0), O(Te, null, Ne(w(P), (L, Q) => (R(), O("div", {
|
|
1258
|
+
key: Q,
|
|
1259
|
+
class: ne(["suggestion-item", { highlighted: Q === w(k) }]),
|
|
1260
|
+
onMouseenter: (Y) => w(l)(Q),
|
|
1261
|
+
onMousedown: Xe((Y) => w(m)(L), ["prevent"])
|
|
1076
1262
|
}, [
|
|
1077
|
-
|
|
1078
|
-
|
|
1263
|
+
W("span", It, [
|
|
1264
|
+
U(w(nt))
|
|
1079
1265
|
]),
|
|
1080
|
-
|
|
1081
|
-
(
|
|
1082
|
-
key:
|
|
1083
|
-
class:
|
|
1084
|
-
},
|
|
1266
|
+
W("span", Ot, [
|
|
1267
|
+
(R(!0), O(Te, null, Ne(w(u)(L, w(t)), (Y, Ce) => (R(), O("span", {
|
|
1268
|
+
key: Ce,
|
|
1269
|
+
class: ne({ "suggestion-item__text--match": Y.isMatch, "suggestion-item__text--normal": !Y.isMatch })
|
|
1270
|
+
}, te(Y.text), 3))), 128))
|
|
1085
1271
|
])
|
|
1086
|
-
], 42,
|
|
1272
|
+
], 42, Lt))), 128))
|
|
1087
1273
|
], 512)) : B("", !0)
|
|
1088
1274
|
]),
|
|
1089
1275
|
_: 1
|
|
1090
1276
|
}),
|
|
1091
|
-
|
|
1092
|
-
], 10,
|
|
1277
|
+
se.value ? (R(), O("div", At, te(se.value), 1)) : B("", !0)
|
|
1278
|
+
], 10, mt));
|
|
1093
1279
|
}
|
|
1094
1280
|
});
|
|
1095
|
-
|
|
1096
|
-
const
|
|
1097
|
-
n.component(
|
|
1281
|
+
re.name = "TrSender";
|
|
1282
|
+
const Vt = function(n) {
|
|
1283
|
+
n.component(re.name, re);
|
|
1098
1284
|
};
|
|
1099
|
-
|
|
1285
|
+
re.install = Vt;
|
|
1100
1286
|
export {
|
|
1101
|
-
|
|
1287
|
+
re as default
|
|
1102
1288
|
};
|