@kodaris/krubble-app-components 1.0.101 → 1.0.102
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/chatbot.d.ts +17 -0
- package/dist/chatbot.d.ts.map +1 -1
- package/dist/chatbot.js +199 -103
- package/dist/chatbot.js.map +1 -1
- package/dist/krubble-app.bundled.js +199 -103
- package/dist/krubble-app.bundled.js.map +1 -1
- package/dist/krubble-app.bundled.min.js +156 -107
- package/dist/krubble-app.bundled.min.js.map +1 -1
- package/dist/krubble-app.umd.js +199 -103
- package/dist/krubble-app.umd.js.map +1 -1
- package/dist/krubble-app.umd.min.js +152 -103
- package/dist/krubble-app.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/chatbot.d.ts
CHANGED
|
@@ -471,6 +471,16 @@ export declare class KRChatbot extends LitElement {
|
|
|
471
471
|
private _showOverlay;
|
|
472
472
|
private _handleHeaderMouseDown;
|
|
473
473
|
private _handleResizeMouseDown;
|
|
474
|
+
/**
|
|
475
|
+
* Close the `/` skill menu when the click lands outside it.
|
|
476
|
+
*
|
|
477
|
+
* Bound at the document because a click anywhere — including outside this
|
|
478
|
+
* component entirely — should dismiss the menu. `composedPath()` rather than
|
|
479
|
+
* `e.target` since the menu lives in this component's shadow root, where
|
|
480
|
+
* `target` on a document listener is retargeted to the host element and every
|
|
481
|
+
* inside click would look like an outside one.
|
|
482
|
+
*/
|
|
483
|
+
private _handleDocumentClick;
|
|
474
484
|
private _handleMouseMove;
|
|
475
485
|
private _handleMouseUp;
|
|
476
486
|
private _handleToggle;
|
|
@@ -589,6 +599,13 @@ export declare class KRChatbot extends LitElement {
|
|
|
589
599
|
private _handleDebugResizeMouseUp;
|
|
590
600
|
private _readStreamChunk;
|
|
591
601
|
private _handleStreamError;
|
|
602
|
+
/**
|
|
603
|
+
* The composer's controls: attach, the textarea, the mic, and send/stop.
|
|
604
|
+
*
|
|
605
|
+
* While dictating, only the mic swaps — to a stop button — so the textarea
|
|
606
|
+
* stays visible with the transcript streaming into it and send stays reachable.
|
|
607
|
+
*/
|
|
608
|
+
private _renderComposerControls;
|
|
592
609
|
/** The `/` skill menu shown above the composer while typing a slash command. */
|
|
593
610
|
private _renderSkillMenu;
|
|
594
611
|
/** The "Browse all skills" dialog — a searchable grid of Org / Kodaris cards. */
|
package/dist/chatbot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.d.ts","sourceRoot":"","sources":["../src/chatbot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAYrD;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;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AAC;KACzB;CACF"}
|
package/dist/chatbot.js
CHANGED
|
@@ -282,6 +282,31 @@ let KRChatbot = class KRChatbot extends LitElement {
|
|
|
282
282
|
this._skillBrowseQuery = '';
|
|
283
283
|
/** True while the mic is live and speech is being transcribed into the composer. */
|
|
284
284
|
this._isDictating = false;
|
|
285
|
+
/**
|
|
286
|
+
* Close the `/` skill menu when the click lands outside it.
|
|
287
|
+
*
|
|
288
|
+
* Bound at the document because a click anywhere — including outside this
|
|
289
|
+
* component entirely — should dismiss the menu. `composedPath()` rather than
|
|
290
|
+
* `e.target` since the menu lives in this component's shadow root, where
|
|
291
|
+
* `target` on a document listener is retargeted to the host element and every
|
|
292
|
+
* inside click would look like an outside one.
|
|
293
|
+
*/
|
|
294
|
+
this._handleDocumentClick = (e) => {
|
|
295
|
+
if (!this._skillMenuOpened) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
// Excluded: the textarea, since clicking it keeps editing the same `/` command
|
|
299
|
+
// and dismissing there would fight the user still typing it; and the plus
|
|
300
|
+
// button, which owns the menu's open/close itself. The plus exclusion matters
|
|
301
|
+
// in both directions — this listener runs after the button's own handler, so
|
|
302
|
+
// without it a click that just opened the menu would immediately close it
|
|
303
|
+
// again, and a click meant to toggle it shut would be double-handled.
|
|
304
|
+
const path = e.composedPath();
|
|
305
|
+
if (path.some((el) => el instanceof HTMLElement && (el.classList.contains('skill-menu') || el.classList.contains('input') || el.classList.contains('input-plus')))) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
this._skillMenuOpened = false;
|
|
309
|
+
};
|
|
285
310
|
this._handleMouseMove = (e) => {
|
|
286
311
|
if (this._isDragging) {
|
|
287
312
|
let newLeft = this._dragStartLeft + (e.clientX - this._dragStartX);
|
|
@@ -425,6 +450,7 @@ let KRChatbot = class KRChatbot extends LitElement {
|
|
|
425
450
|
this.opened = true;
|
|
426
451
|
}
|
|
427
452
|
this._restoreState();
|
|
453
|
+
document.addEventListener('click', this._handleDocumentClick);
|
|
428
454
|
}
|
|
429
455
|
disconnectedCallback() {
|
|
430
456
|
super.disconnectedCallback();
|
|
@@ -434,6 +460,7 @@ let KRChatbot = class KRChatbot extends LitElement {
|
|
|
434
460
|
}
|
|
435
461
|
document.removeEventListener('mousemove', this._handleMouseMove);
|
|
436
462
|
document.removeEventListener('mouseup', this._handleMouseUp);
|
|
463
|
+
document.removeEventListener('click', this._handleDocumentClick);
|
|
437
464
|
// Release the mic if the chatbot is torn down mid-dictation — otherwise the
|
|
438
465
|
// recognizer keeps the browser's recording indicator lit with nothing to
|
|
439
466
|
// transcribe into. abort() (not stop()) since the discarded text has nowhere to go.
|
|
@@ -655,7 +682,12 @@ let KRChatbot = class KRChatbot extends LitElement {
|
|
|
655
682
|
}
|
|
656
683
|
const state = JSON.parse(raw);
|
|
657
684
|
// Draft text and the debug drawer are persisted for all variants.
|
|
658
|
-
|
|
685
|
+
// A lone `/` is dropped — it's the in-progress half of a menu interaction,
|
|
686
|
+
// not a draft, and restoring it would revive a stale menu the user never
|
|
687
|
+
// used. Anything with an actual command after the slash (`/code`, `/code do
|
|
688
|
+
// the thing`) is a real draft and restores normally. Trimmed before testing
|
|
689
|
+
// so a stray space around the slash doesn't defeat the check.
|
|
690
|
+
if (typeof state.message === 'string' && state.message.trim() !== '/') {
|
|
659
691
|
this._inputValue = state.message;
|
|
660
692
|
}
|
|
661
693
|
this._debugPanelOpen = state.debugPanelOpen === 'true';
|
|
@@ -1203,6 +1235,15 @@ let KRChatbot = class KRChatbot extends LitElement {
|
|
|
1203
1235
|
// the menu interaction, and the picker is a separate window so the menu would
|
|
1204
1236
|
// otherwise linger open behind it (and after a file is chosen).
|
|
1205
1237
|
this._skillMenuOpened = false;
|
|
1238
|
+
// A lone `/` was only the means of reaching this action, so it shouldn't be
|
|
1239
|
+
// left behind in the composer once the picker opens. Nothing else is touched:
|
|
1240
|
+
// a real command (`/code`) stays because `/code` plus an attachment is a valid
|
|
1241
|
+
// invocation, and the plus button reaches this same method with an arbitrary
|
|
1242
|
+
// draft in the composer, which must survive.
|
|
1243
|
+
if (this._inputValue.trim() === '/') {
|
|
1244
|
+
this._inputValue = '';
|
|
1245
|
+
this._saveState();
|
|
1246
|
+
}
|
|
1206
1247
|
this._pendingAttachAnalyze = aiAnalyze;
|
|
1207
1248
|
this._fileInputEl?.click();
|
|
1208
1249
|
}
|
|
@@ -1764,6 +1805,122 @@ let KRChatbot = class KRChatbot extends LitElement {
|
|
|
1764
1805
|
}
|
|
1765
1806
|
}
|
|
1766
1807
|
// --- Render ---
|
|
1808
|
+
/**
|
|
1809
|
+
* The composer's controls: attach, the textarea, the mic, and send/stop.
|
|
1810
|
+
*
|
|
1811
|
+
* While dictating, only the mic swaps — to a stop button — so the textarea
|
|
1812
|
+
* stays visible with the transcript streaming into it and send stays reachable.
|
|
1813
|
+
*/
|
|
1814
|
+
_renderComposerControls() {
|
|
1815
|
+
return html `
|
|
1816
|
+
<button
|
|
1817
|
+
class="input-plus"
|
|
1818
|
+
@click=${this._handlePlusClick}
|
|
1819
|
+
>+</button>
|
|
1820
|
+
<textarea
|
|
1821
|
+
class="input"
|
|
1822
|
+
.value=${this._inputValue}
|
|
1823
|
+
placeholder=${this.placeholder}
|
|
1824
|
+
rows="1"
|
|
1825
|
+
@input=${this._handleInputChange}
|
|
1826
|
+
@keydown=${this._handleKeyDown}
|
|
1827
|
+
@paste=${this._handlePaste}
|
|
1828
|
+
></textarea>
|
|
1829
|
+
${window.SpeechRecognition || window.webkitSpeechRecognition ? html `
|
|
1830
|
+
${this._isDictating ? html `
|
|
1831
|
+
<button
|
|
1832
|
+
class="mic-stop"
|
|
1833
|
+
title="Stop dictation"
|
|
1834
|
+
aria-label="Stop dictation"
|
|
1835
|
+
@click=${this._handleMicClick}
|
|
1836
|
+
>
|
|
1837
|
+
<svg
|
|
1838
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1839
|
+
fill="currentColor"
|
|
1840
|
+
viewBox="0 0 24 24"
|
|
1841
|
+
class="mic-stop-icon"
|
|
1842
|
+
aria-hidden="true"
|
|
1843
|
+
>
|
|
1844
|
+
<rect
|
|
1845
|
+
x="6"
|
|
1846
|
+
y="6"
|
|
1847
|
+
width="12"
|
|
1848
|
+
height="12"
|
|
1849
|
+
rx="2"
|
|
1850
|
+
/>
|
|
1851
|
+
</svg>
|
|
1852
|
+
</button>
|
|
1853
|
+
` : html `
|
|
1854
|
+
<button
|
|
1855
|
+
class="mic"
|
|
1856
|
+
title="Dictate a message"
|
|
1857
|
+
aria-label="Dictate a message"
|
|
1858
|
+
@click=${this._handleMicClick}
|
|
1859
|
+
>
|
|
1860
|
+
<svg
|
|
1861
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1862
|
+
viewBox="0 0 24 24"
|
|
1863
|
+
fill="none"
|
|
1864
|
+
stroke="currentColor"
|
|
1865
|
+
stroke-width="1.75"
|
|
1866
|
+
stroke-linecap="round"
|
|
1867
|
+
stroke-linejoin="round"
|
|
1868
|
+
class="mic-icon"
|
|
1869
|
+
aria-hidden="true"
|
|
1870
|
+
>
|
|
1871
|
+
<path d="M12 15a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3Z"/>
|
|
1872
|
+
<path d="M19 11a7 7 0 0 1-14 0"/>
|
|
1873
|
+
<path d="M12 18v3"/>
|
|
1874
|
+
</svg>
|
|
1875
|
+
</button>
|
|
1876
|
+
`}
|
|
1877
|
+
` : nothing}
|
|
1878
|
+
${this._isStreaming ? html `
|
|
1879
|
+
<button
|
|
1880
|
+
class="stop"
|
|
1881
|
+
@click=${this._handleStop}
|
|
1882
|
+
title="Stop generating"
|
|
1883
|
+
>
|
|
1884
|
+
<svg
|
|
1885
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1886
|
+
fill="currentColor"
|
|
1887
|
+
viewBox="0 0 24 24"
|
|
1888
|
+
class="stop-icon"
|
|
1889
|
+
>
|
|
1890
|
+
<rect
|
|
1891
|
+
x="6"
|
|
1892
|
+
y="6"
|
|
1893
|
+
width="12"
|
|
1894
|
+
height="12"
|
|
1895
|
+
rx="2"
|
|
1896
|
+
/>
|
|
1897
|
+
</svg>
|
|
1898
|
+
</button>
|
|
1899
|
+
` : html `
|
|
1900
|
+
<button
|
|
1901
|
+
class=${classMap({
|
|
1902
|
+
'send': true,
|
|
1903
|
+
'send--disabled': !this._inputValue.trim() && !this._pendingConversationFiles.length,
|
|
1904
|
+
})}
|
|
1905
|
+
@click=${this._handleSubmit}
|
|
1906
|
+
title="Send message"
|
|
1907
|
+
>
|
|
1908
|
+
<svg
|
|
1909
|
+
width="16"
|
|
1910
|
+
height="16"
|
|
1911
|
+
viewBox="0 0 24 24"
|
|
1912
|
+
fill="none"
|
|
1913
|
+
stroke="currentColor"
|
|
1914
|
+
stroke-width="2.5"
|
|
1915
|
+
stroke-linecap="round"
|
|
1916
|
+
class="send-icon"
|
|
1917
|
+
>
|
|
1918
|
+
<path d="M12 19V5M5 12l7-7 7 7"/>
|
|
1919
|
+
</svg>
|
|
1920
|
+
</button>
|
|
1921
|
+
`}
|
|
1922
|
+
`;
|
|
1923
|
+
}
|
|
1767
1924
|
/** The `/` skill menu shown above the composer while typing a slash command. */
|
|
1768
1925
|
_renderSkillMenu() {
|
|
1769
1926
|
const skills = this._invocableSkills;
|
|
@@ -2470,88 +2627,7 @@ let KRChatbot = class KRChatbot extends LitElement {
|
|
|
2470
2627
|
/>
|
|
2471
2628
|
${this._skillMenuOpened ? this._renderSkillMenu() : nothing}
|
|
2472
2629
|
<div class="input-wrapper">
|
|
2473
|
-
|
|
2474
|
-
class="input-plus"
|
|
2475
|
-
@click=${this._handlePlusClick}
|
|
2476
|
-
>+</button>
|
|
2477
|
-
<textarea
|
|
2478
|
-
class="input"
|
|
2479
|
-
.value=${this._inputValue}
|
|
2480
|
-
placeholder=${this.placeholder}
|
|
2481
|
-
rows="1"
|
|
2482
|
-
@input=${this._handleInputChange}
|
|
2483
|
-
@keydown=${this._handleKeyDown}
|
|
2484
|
-
@paste=${this._handlePaste}
|
|
2485
|
-
></textarea>
|
|
2486
|
-
${window.SpeechRecognition || window.webkitSpeechRecognition ? html `
|
|
2487
|
-
<button
|
|
2488
|
-
class=${classMap({
|
|
2489
|
-
mic: true,
|
|
2490
|
-
'mic--recording': this._isDictating,
|
|
2491
|
-
})}
|
|
2492
|
-
title=${this._isDictating ? 'Stop dictation' : 'Dictate a message'}
|
|
2493
|
-
@click=${this._handleMicClick}
|
|
2494
|
-
>
|
|
2495
|
-
<svg
|
|
2496
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2497
|
-
viewBox="0 0 24 24"
|
|
2498
|
-
fill="none"
|
|
2499
|
-
stroke="currentColor"
|
|
2500
|
-
stroke-width="1.75"
|
|
2501
|
-
stroke-linecap="round"
|
|
2502
|
-
stroke-linejoin="round"
|
|
2503
|
-
class="mic-icon"
|
|
2504
|
-
>
|
|
2505
|
-
<path d="M12 15a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3Z"/>
|
|
2506
|
-
<path d="M19 11a7 7 0 0 1-14 0"/>
|
|
2507
|
-
<path d="M12 18v3"/>
|
|
2508
|
-
</svg>
|
|
2509
|
-
</button>
|
|
2510
|
-
` : nothing}
|
|
2511
|
-
${this._isStreaming ? html `
|
|
2512
|
-
<button
|
|
2513
|
-
class="stop"
|
|
2514
|
-
@click=${this._handleStop}
|
|
2515
|
-
title="Stop generating"
|
|
2516
|
-
>
|
|
2517
|
-
<svg
|
|
2518
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2519
|
-
fill="currentColor"
|
|
2520
|
-
viewBox="0 0 24 24"
|
|
2521
|
-
class="stop-icon"
|
|
2522
|
-
>
|
|
2523
|
-
<rect
|
|
2524
|
-
x="6"
|
|
2525
|
-
y="6"
|
|
2526
|
-
width="12"
|
|
2527
|
-
height="12"
|
|
2528
|
-
rx="2"
|
|
2529
|
-
/>
|
|
2530
|
-
</svg>
|
|
2531
|
-
</button>
|
|
2532
|
-
` : html `
|
|
2533
|
-
<button
|
|
2534
|
-
class=${classMap({
|
|
2535
|
-
'send': true,
|
|
2536
|
-
'send--disabled': !this._inputValue.trim() && !this._pendingConversationFiles.length,
|
|
2537
|
-
})}
|
|
2538
|
-
@click=${this._handleSubmit}
|
|
2539
|
-
title="Send message"
|
|
2540
|
-
>
|
|
2541
|
-
<svg
|
|
2542
|
-
width="16"
|
|
2543
|
-
height="16"
|
|
2544
|
-
viewBox="0 0 24 24"
|
|
2545
|
-
fill="none"
|
|
2546
|
-
stroke="currentColor"
|
|
2547
|
-
stroke-width="2.5"
|
|
2548
|
-
stroke-linecap="round"
|
|
2549
|
-
class="send-icon"
|
|
2550
|
-
>
|
|
2551
|
-
<path d="M12 19V5M5 12l7-7 7 7"/>
|
|
2552
|
-
</svg>
|
|
2553
|
-
</button>
|
|
2554
|
-
`}
|
|
2630
|
+
${this._renderComposerControls()}
|
|
2555
2631
|
</div>
|
|
2556
2632
|
</div>
|
|
2557
2633
|
${this._skillBrowseOpened ? this._renderSkillBrowse() : nothing}
|
|
@@ -3351,6 +3427,14 @@ KRChatbot.styles = css `
|
|
|
3351
3427
|
color: #b0b0b0;
|
|
3352
3428
|
}
|
|
3353
3429
|
|
|
3430
|
+
/* margin-right rather than a wider .input-wrapper gap, which would also push
|
|
3431
|
+
the plus button and textarea apart. Applied to both mic states so the
|
|
3432
|
+
spacing doesn't shift when dictation swaps one for the other. */
|
|
3433
|
+
.mic,
|
|
3434
|
+
.mic-stop {
|
|
3435
|
+
margin-right: 4px;
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3354
3438
|
.mic {
|
|
3355
3439
|
width: 34px;
|
|
3356
3440
|
height: 34px;
|
|
@@ -3370,30 +3454,42 @@ KRChatbot.styles = css `
|
|
|
3370
3454
|
background: #f8f9fc;
|
|
3371
3455
|
}
|
|
3372
3456
|
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3457
|
+
.mic-icon {
|
|
3458
|
+
width: 21px;
|
|
3459
|
+
height: 21px;
|
|
3460
|
+
}
|
|
3461
|
+
|
|
3462
|
+
/* Dictation swaps the mic for this stop button, sitting in the mic's slot so
|
|
3463
|
+
the composer's layout is unchanged and the textarea stays visible with the
|
|
3464
|
+
transcript streaming into it. Structurally identical to .stop; only the
|
|
3465
|
+
colors differ — dictation isn't an error state, so it takes a neutral grey
|
|
3466
|
+
instead of the error red, and that also keeps it distinct from the solid
|
|
3467
|
+
send button sitting right beside it. The icon is dark rather than white
|
|
3468
|
+
because white on this grey wouldn't meet contrast. */
|
|
3469
|
+
.mic-stop {
|
|
3470
|
+
width: 34px;
|
|
3471
|
+
height: 34px;
|
|
3472
|
+
border-radius: 50%;
|
|
3473
|
+
background: #eae7e7;
|
|
3474
|
+
color: #1f1f1f;
|
|
3475
|
+
border: none;
|
|
3476
|
+
cursor: pointer;
|
|
3477
|
+
display: flex;
|
|
3478
|
+
align-items: center;
|
|
3479
|
+
justify-content: center;
|
|
3480
|
+
flex-shrink: 0;
|
|
3481
|
+
transition: all 0.15s;
|
|
3383
3482
|
}
|
|
3384
3483
|
|
|
3385
|
-
.mic-
|
|
3386
|
-
|
|
3387
|
-
height: 18px;
|
|
3484
|
+
.mic-stop:hover {
|
|
3485
|
+
background: #ded9d9;
|
|
3388
3486
|
}
|
|
3389
3487
|
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
opacity: 0.55;
|
|
3396
|
-
}
|
|
3488
|
+
/* Larger than .stop-icon's 14px: the rect fills only half its 24-unit
|
|
3489
|
+
viewBox, so the drawn square is half this value. */
|
|
3490
|
+
.mic-stop-icon {
|
|
3491
|
+
width: 20px;
|
|
3492
|
+
height: 20px;
|
|
3397
3493
|
}
|
|
3398
3494
|
|
|
3399
3495
|
.send {
|