@saar-ai/web-widget 0.11.0 → 0.13.0
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/capture-card/capture-card-dom.d.ts +52 -0
- package/dist/capture-card/capture-card-dom.d.ts.map +1 -0
- package/dist/capture-card/capture-card-host.d.ts +9 -0
- package/dist/capture-card/capture-card-host.d.ts.map +1 -0
- package/dist/chunks/capture-card-BlJ6EkWn.js +156 -0
- package/dist/chunks/capture-card-dom-BqDqOvQF.js +383 -0
- package/dist/chunks/{chat-CU9VPqVO.js → chat-R7z4DtMM.js} +110 -8
- package/dist/chunks/form-fill-B-h6Uw1t.js +45 -0
- package/dist/chunks/form-fill-dom-skU-ZwLB.js +191 -0
- package/dist/chunks/{host-widget-BZKCb7yR.js → host-widget-BZAYL5tQ.js} +1370 -425
- package/dist/chunks/{schemas-YN3wGSGZ.js → schemas-B2B3k74u.js} +2427 -1167
- package/dist/chunks/{telemetry-B1xBTk1s.js → telemetry-3f--vvdX.js} +18 -12
- package/dist/concierge-shell.css +1 -1
- package/dist/consent/consent-prompt-dom.d.ts +57 -0
- package/dist/consent/consent-prompt-dom.d.ts.map +1 -0
- package/dist/consent/consent-prompt-preview.d.ts +16 -0
- package/dist/consent/consent-prompt-preview.d.ts.map +1 -0
- package/dist/dock/dock-renderer.d.ts +1 -1
- package/dist/dock/dock-renderer.d.ts.map +1 -1
- package/dist/dock/dock-row.d.ts +3 -23
- package/dist/dock/dock-row.d.ts.map +1 -1
- package/dist/dock/dock.d.ts +11 -0
- package/dist/dock/dock.d.ts.map +1 -1
- package/dist/flow-link.d.ts +13 -0
- package/dist/flow-link.d.ts.map +1 -0
- package/dist/form-fill/form-fill-dom.d.ts +39 -0
- package/dist/form-fill/form-fill-dom.d.ts.map +1 -0
- package/dist/format-money.d.ts +3 -2
- package/dist/format-money.d.ts.map +1 -1
- package/dist/generated/concierge-shell-css.d.ts.map +1 -1
- package/dist/handoff-initials.d.ts +34 -0
- package/dist/handoff-initials.d.ts.map +1 -0
- package/dist/host-widget.d.ts +8 -5
- package/dist/host-widget.d.ts.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +139 -173
- package/dist/next/index.js +1 -1
- package/dist/use-chat-session.d.ts +23 -3
- package/dist/use-chat-session.d.ts.map +1 -1
- package/dist/use-voice-session.d.ts +39 -4
- package/dist/use-voice-session.d.ts.map +1 -1
- package/dist/voice-widget.d.ts +11 -5
- package/dist/voice-widget.d.ts.map +1 -1
- package/dist/widget/concierge-launcher.d.ts +16 -1
- package/dist/widget/concierge-launcher.d.ts.map +1 -1
- package/dist/widget/concierge-shell.d.ts +48 -2
- package/dist/widget/concierge-shell.d.ts.map +1 -1
- package/dist/widget/shell-renderer.d.ts +1 -1
- package/dist/widget/shell-renderer.d.ts.map +1 -1
- package/dist/widget/widget-view.d.ts +66 -2
- package/dist/widget/widget-view.d.ts.map +1 -1
- package/dist/widget-cart-summary.d.ts +4 -3
- package/dist/widget-cart-summary.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/styles/brand.css +51 -0
- package/src/styles/concierge-shell-entry.css +13 -0
- package/src/styles/concierge.css +9 -38
|
@@ -15,7 +15,7 @@ function clsx() {
|
|
|
15
15
|
return n;
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
|
-
//#region ../../node_modules/.pnpm/tailwind-merge@3.
|
|
18
|
+
//#region ../../node_modules/.pnpm/tailwind-merge@3.7.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
19
19
|
/**
|
|
20
20
|
* Concatenates two arrays faster than the array spread operator.
|
|
21
21
|
*/
|
|
@@ -423,6 +423,7 @@ var fallbackThemeArr = [];
|
|
|
423
423
|
var fromTheme = (key) => {
|
|
424
424
|
const themeGetter = (theme) => theme[key] || fallbackThemeArr;
|
|
425
425
|
themeGetter.isThemeGetter = true;
|
|
426
|
+
themeGetter.themeKey = key;
|
|
426
427
|
return themeGetter;
|
|
427
428
|
};
|
|
428
429
|
var arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
|
|
@@ -430,7 +431,7 @@ var arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
|
|
|
430
431
|
var fractionRegex = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/;
|
|
431
432
|
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
432
433
|
var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
|
|
433
|
-
var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
|
|
434
|
+
var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/;
|
|
434
435
|
var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
435
436
|
var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
436
437
|
var isFraction = (value) => fractionRegex.test(value);
|
|
@@ -639,6 +640,7 @@ var getDefaultConfig = () => {
|
|
|
639
640
|
...scaleUnambiguousSpacing()
|
|
640
641
|
];
|
|
641
642
|
const scaleSizingInline = () => [
|
|
643
|
+
themeContainer,
|
|
642
644
|
isFraction,
|
|
643
645
|
"screen",
|
|
644
646
|
"full",
|
|
@@ -871,6 +873,7 @@ var getDefaultConfig = () => {
|
|
|
871
873
|
*/
|
|
872
874
|
columns: [{ columns: [
|
|
873
875
|
isNumber,
|
|
876
|
+
"auto",
|
|
874
877
|
isArbitraryValue,
|
|
875
878
|
isArbitraryVariable,
|
|
876
879
|
themeContainer
|
|
@@ -1448,32 +1451,32 @@ var getDefaultConfig = () => {
|
|
|
1448
1451
|
size: [{ size: scaleSizing() }],
|
|
1449
1452
|
/**
|
|
1450
1453
|
* Inline Size
|
|
1451
|
-
* @see https://tailwindcss.com/docs/
|
|
1454
|
+
* @see https://tailwindcss.com/docs/inline-size
|
|
1452
1455
|
*/
|
|
1453
1456
|
"inline-size": [{ inline: ["auto", ...scaleSizingInline()] }],
|
|
1454
1457
|
/**
|
|
1455
1458
|
* Min-Inline Size
|
|
1456
|
-
* @see https://tailwindcss.com/docs/min-
|
|
1459
|
+
* @see https://tailwindcss.com/docs/min-inline-size
|
|
1457
1460
|
*/
|
|
1458
1461
|
"min-inline-size": [{ "min-inline": ["auto", ...scaleSizingInline()] }],
|
|
1459
1462
|
/**
|
|
1460
1463
|
* Max-Inline Size
|
|
1461
|
-
* @see https://tailwindcss.com/docs/max-
|
|
1464
|
+
* @see https://tailwindcss.com/docs/max-inline-size
|
|
1462
1465
|
*/
|
|
1463
1466
|
"max-inline-size": [{ "max-inline": ["none", ...scaleSizingInline()] }],
|
|
1464
1467
|
/**
|
|
1465
1468
|
* Block Size
|
|
1466
|
-
* @see https://tailwindcss.com/docs/
|
|
1469
|
+
* @see https://tailwindcss.com/docs/block-size
|
|
1467
1470
|
*/
|
|
1468
1471
|
"block-size": [{ block: ["auto", ...scaleSizingBlock()] }],
|
|
1469
1472
|
/**
|
|
1470
1473
|
* Min-Block Size
|
|
1471
|
-
* @see https://tailwindcss.com/docs/min-
|
|
1474
|
+
* @see https://tailwindcss.com/docs/min-block-size
|
|
1472
1475
|
*/
|
|
1473
1476
|
"min-block-size": [{ "min-block": ["auto", ...scaleSizingBlock()] }],
|
|
1474
1477
|
/**
|
|
1475
1478
|
* Max-Block Size
|
|
1476
|
-
* @see https://tailwindcss.com/docs/max-
|
|
1479
|
+
* @see https://tailwindcss.com/docs/max-block-size
|
|
1477
1480
|
*/
|
|
1478
1481
|
"max-block-size": [{ "max-block": ["none", ...scaleSizingBlock()] }],
|
|
1479
1482
|
/**
|
|
@@ -1533,6 +1536,7 @@ var getDefaultConfig = () => {
|
|
|
1533
1536
|
"max-h": [{ "max-h": [
|
|
1534
1537
|
"screen",
|
|
1535
1538
|
"lh",
|
|
1539
|
+
"none",
|
|
1536
1540
|
...scaleSizing()
|
|
1537
1541
|
] }],
|
|
1538
1542
|
/**
|
|
@@ -1648,7 +1652,11 @@ var getDefaultConfig = () => {
|
|
|
1648
1652
|
* Line Height
|
|
1649
1653
|
* @see https://tailwindcss.com/docs/line-height
|
|
1650
1654
|
*/
|
|
1651
|
-
leading: [{ leading: [
|
|
1655
|
+
leading: [{ leading: [
|
|
1656
|
+
"none",
|
|
1657
|
+
themeLeading,
|
|
1658
|
+
...scaleUnambiguousSpacing()
|
|
1659
|
+
] }],
|
|
1652
1660
|
/**
|
|
1653
1661
|
* List Style Image
|
|
1654
1662
|
* @see https://tailwindcss.com/docs/list-style-image
|
|
@@ -1917,6 +1925,7 @@ var getDefaultConfig = () => {
|
|
|
1917
1925
|
isArbitraryValue
|
|
1918
1926
|
],
|
|
1919
1927
|
conic: [
|
|
1928
|
+
"",
|
|
1920
1929
|
isInteger,
|
|
1921
1930
|
isArbitraryVariable,
|
|
1922
1931
|
isArbitraryValue
|
|
@@ -2227,6 +2236,7 @@ var getDefaultConfig = () => {
|
|
|
2227
2236
|
*/
|
|
2228
2237
|
shadow: [{ shadow: [
|
|
2229
2238
|
"",
|
|
2239
|
+
"inner",
|
|
2230
2240
|
"none",
|
|
2231
2241
|
themeShadow,
|
|
2232
2242
|
isArbitraryVariableShadow,
|
|
@@ -3224,8 +3234,18 @@ var getDefaultConfig = () => {
|
|
|
3224
3234
|
"bottom",
|
|
3225
3235
|
"left"
|
|
3226
3236
|
],
|
|
3227
|
-
"inset-x": [
|
|
3228
|
-
|
|
3237
|
+
"inset-x": [
|
|
3238
|
+
"start",
|
|
3239
|
+
"end",
|
|
3240
|
+
"right",
|
|
3241
|
+
"left"
|
|
3242
|
+
],
|
|
3243
|
+
"inset-y": [
|
|
3244
|
+
"inset-bs",
|
|
3245
|
+
"inset-be",
|
|
3246
|
+
"top",
|
|
3247
|
+
"bottom"
|
|
3248
|
+
],
|
|
3229
3249
|
flex: [
|
|
3230
3250
|
"basis",
|
|
3231
3251
|
"grow",
|
|
@@ -3244,8 +3264,18 @@ var getDefaultConfig = () => {
|
|
|
3244
3264
|
"pb",
|
|
3245
3265
|
"pl"
|
|
3246
3266
|
],
|
|
3247
|
-
px: [
|
|
3248
|
-
|
|
3267
|
+
px: [
|
|
3268
|
+
"ps",
|
|
3269
|
+
"pe",
|
|
3270
|
+
"pr",
|
|
3271
|
+
"pl"
|
|
3272
|
+
],
|
|
3273
|
+
py: [
|
|
3274
|
+
"pbs",
|
|
3275
|
+
"pbe",
|
|
3276
|
+
"pt",
|
|
3277
|
+
"pb"
|
|
3278
|
+
],
|
|
3249
3279
|
m: [
|
|
3250
3280
|
"mx",
|
|
3251
3281
|
"my",
|
|
@@ -3258,8 +3288,18 @@ var getDefaultConfig = () => {
|
|
|
3258
3288
|
"mb",
|
|
3259
3289
|
"ml"
|
|
3260
3290
|
],
|
|
3261
|
-
mx: [
|
|
3262
|
-
|
|
3291
|
+
mx: [
|
|
3292
|
+
"ms",
|
|
3293
|
+
"me",
|
|
3294
|
+
"mr",
|
|
3295
|
+
"ml"
|
|
3296
|
+
],
|
|
3297
|
+
my: [
|
|
3298
|
+
"mbs",
|
|
3299
|
+
"mbe",
|
|
3300
|
+
"mt",
|
|
3301
|
+
"mb"
|
|
3302
|
+
],
|
|
3263
3303
|
size: ["w", "h"],
|
|
3264
3304
|
"font-size": ["leading"],
|
|
3265
3305
|
"fvn-normal": [
|
|
@@ -3310,8 +3350,18 @@ var getDefaultConfig = () => {
|
|
|
3310
3350
|
"border-w-b",
|
|
3311
3351
|
"border-w-l"
|
|
3312
3352
|
],
|
|
3313
|
-
"border-w-x": [
|
|
3314
|
-
|
|
3353
|
+
"border-w-x": [
|
|
3354
|
+
"border-w-s",
|
|
3355
|
+
"border-w-e",
|
|
3356
|
+
"border-w-r",
|
|
3357
|
+
"border-w-l"
|
|
3358
|
+
],
|
|
3359
|
+
"border-w-y": [
|
|
3360
|
+
"border-w-bs",
|
|
3361
|
+
"border-w-be",
|
|
3362
|
+
"border-w-t",
|
|
3363
|
+
"border-w-b"
|
|
3364
|
+
],
|
|
3315
3365
|
"border-color": [
|
|
3316
3366
|
"border-color-x",
|
|
3317
3367
|
"border-color-y",
|
|
@@ -3324,8 +3374,18 @@ var getDefaultConfig = () => {
|
|
|
3324
3374
|
"border-color-b",
|
|
3325
3375
|
"border-color-l"
|
|
3326
3376
|
],
|
|
3327
|
-
"border-color-x": [
|
|
3328
|
-
|
|
3377
|
+
"border-color-x": [
|
|
3378
|
+
"border-color-s",
|
|
3379
|
+
"border-color-e",
|
|
3380
|
+
"border-color-r",
|
|
3381
|
+
"border-color-l"
|
|
3382
|
+
],
|
|
3383
|
+
"border-color-y": [
|
|
3384
|
+
"border-color-bs",
|
|
3385
|
+
"border-color-be",
|
|
3386
|
+
"border-color-t",
|
|
3387
|
+
"border-color-b"
|
|
3388
|
+
],
|
|
3329
3389
|
translate: [
|
|
3330
3390
|
"translate-x",
|
|
3331
3391
|
"translate-y",
|
|
@@ -3349,8 +3409,18 @@ var getDefaultConfig = () => {
|
|
|
3349
3409
|
"scroll-mb",
|
|
3350
3410
|
"scroll-ml"
|
|
3351
3411
|
],
|
|
3352
|
-
"scroll-mx": [
|
|
3353
|
-
|
|
3412
|
+
"scroll-mx": [
|
|
3413
|
+
"scroll-ms",
|
|
3414
|
+
"scroll-me",
|
|
3415
|
+
"scroll-mr",
|
|
3416
|
+
"scroll-ml"
|
|
3417
|
+
],
|
|
3418
|
+
"scroll-my": [
|
|
3419
|
+
"scroll-mbs",
|
|
3420
|
+
"scroll-mbe",
|
|
3421
|
+
"scroll-mt",
|
|
3422
|
+
"scroll-mb"
|
|
3423
|
+
],
|
|
3354
3424
|
"scroll-p": [
|
|
3355
3425
|
"scroll-px",
|
|
3356
3426
|
"scroll-py",
|
|
@@ -3363,8 +3433,18 @@ var getDefaultConfig = () => {
|
|
|
3363
3433
|
"scroll-pb",
|
|
3364
3434
|
"scroll-pl"
|
|
3365
3435
|
],
|
|
3366
|
-
"scroll-px": [
|
|
3367
|
-
|
|
3436
|
+
"scroll-px": [
|
|
3437
|
+
"scroll-ps",
|
|
3438
|
+
"scroll-pe",
|
|
3439
|
+
"scroll-pr",
|
|
3440
|
+
"scroll-pl"
|
|
3441
|
+
],
|
|
3442
|
+
"scroll-py": [
|
|
3443
|
+
"scroll-pbs",
|
|
3444
|
+
"scroll-pbe",
|
|
3445
|
+
"scroll-pt",
|
|
3446
|
+
"scroll-pb"
|
|
3447
|
+
],
|
|
3368
3448
|
touch: [
|
|
3369
3449
|
"touch-x",
|
|
3370
3450
|
"touch-y",
|
|
@@ -6672,20 +6752,18 @@ function DockFloat({ turn, suppressed, ducked, agentName, youLabel, label, dismi
|
|
|
6672
6752
|
});
|
|
6673
6753
|
}
|
|
6674
6754
|
//#endregion
|
|
6675
|
-
//#region src/
|
|
6755
|
+
//#region src/handoff-initials.ts
|
|
6676
6756
|
/**
|
|
6677
|
-
*
|
|
6757
|
+
* The operator's initials — SHARED chrome, not the dock's.
|
|
6758
|
+
*
|
|
6759
|
+
* Moved out of `dock/dock-row.tsx` for docs/CONCIERGE_GENERATIONS.md §4's
|
|
6760
|
+
* surfaces row: the dock draws them in its handoff disc and the widget draws
|
|
6761
|
+
* them in the launcher's face, and two renderers computing initials two ways
|
|
6762
|
+
* would let the same operator read as `AR` in one and `A` in the other.
|
|
6763
|
+
* `dock-row.tsx` re-exports it, so every existing import still resolves.
|
|
6764
|
+
*
|
|
6765
|
+
* Everything below is the original, unchanged.
|
|
6678
6766
|
*
|
|
6679
|
-
* A thumb HOLDS and a desktop pointer TOGGLES, and `pen` is a desktop pointer
|
|
6680
|
-
* for this purpose: it is aimed, so a press with it is a click. Written once
|
|
6681
|
-
* rather than at each of the three handlers that need it — they have to agree,
|
|
6682
|
-
* and a `pointercancel` that classified itself differently from the
|
|
6683
|
-
* `pointerdown` it cancels would leave the microphone open.
|
|
6684
|
-
*/
|
|
6685
|
-
function micSourceOf(event) {
|
|
6686
|
-
return event.pointerType === "touch" ? "touch" : "pointer";
|
|
6687
|
-
}
|
|
6688
|
-
/**
|
|
6689
6767
|
* The INITIALS a handoff disc draws for `name` — one or two letters, or `''`
|
|
6690
6768
|
* when there is no name to derive them from (DOCK_SPEC §2).
|
|
6691
6769
|
*
|
|
@@ -6710,6 +6788,20 @@ function micSourceOf(event) {
|
|
|
6710
6788
|
function handoffInitials(name) {
|
|
6711
6789
|
return (name ?? "").trim().split(/\s+/).filter(Boolean).slice(0, 2).map((word) => Array.from(word)[0] ?? "").join("").toUpperCase();
|
|
6712
6790
|
}
|
|
6791
|
+
//#endregion
|
|
6792
|
+
//#region src/dock/dock-row.tsx
|
|
6793
|
+
/**
|
|
6794
|
+
* §5.2's gesture split, from one pointer event.
|
|
6795
|
+
*
|
|
6796
|
+
* A thumb HOLDS and a desktop pointer TOGGLES, and `pen` is a desktop pointer
|
|
6797
|
+
* for this purpose: it is aimed, so a press with it is a click. Written once
|
|
6798
|
+
* rather than at each of the three handlers that need it — they have to agree,
|
|
6799
|
+
* and a `pointercancel` that classified itself differently from the
|
|
6800
|
+
* `pointerdown` it cancels would leave the microphone open.
|
|
6801
|
+
*/
|
|
6802
|
+
function micSourceOf(event) {
|
|
6803
|
+
return event.pointerType === "touch" ? "touch" : "pointer";
|
|
6804
|
+
}
|
|
6713
6805
|
/**
|
|
6714
6806
|
* The tenant's mark, at whatever size the row (32 px) or the pill (28 px)
|
|
6715
6807
|
* asks for — or, while a PERSON holds the conversation, that person's disc.
|
|
@@ -7447,7 +7539,8 @@ function DockSheet({ snap, onSnapChange, label, peekOnly, header, children, onDi
|
|
|
7447
7539
|
* them runs in a merchant's browser.
|
|
7448
7540
|
*
|
|
7449
7541
|
* The turn tier already owned the table: `@wesence/agent-core`'s
|
|
7450
|
-
* `commerce/money.ts`
|
|
7542
|
+
* `commerce/money.ts` held `formatMinorUnitsForModel` (it now lives in the
|
|
7543
|
+
* product-owned `@saar-ai/commerce-pack`, ADR 0022 D11), the renderer that
|
|
7451
7544
|
* builds the shopper-cart block BOTH legs of a conversation read, so that a
|
|
7452
7545
|
* JPY basket is not "9900 JPY" when the shopper types and "99 JPY" when they
|
|
7453
7546
|
* call. Meanwhile `@saar-ai/web-widget`'s own `format-money.ts` divided
|
|
@@ -7662,7 +7755,8 @@ function formatMoney$1(priceMinor, currency, locale) {
|
|
|
7662
7755
|
* a hardcoded 100.
|
|
7663
7756
|
*
|
|
7664
7757
|
* That simplification became a bug the moment the server side of the same
|
|
7665
|
-
* question was fixed.
|
|
7758
|
+
* question was fixed. The model-facing money module (then in
|
|
7759
|
+
* `@wesence/agent-core`, now in `@saar-ai/commerce-pack`) carried
|
|
7666
7760
|
* the complete ISO 4217 zero-decimal and three-decimal sets, so the concierge
|
|
7667
7761
|
* says "9900 JPY" in prose while this function drew "¥99" on the card beside
|
|
7668
7762
|
* it — two answers to one question, inside one conversation, which is the
|
|
@@ -7673,7 +7767,7 @@ function formatMoney$1(priceMinor, currency, locale) {
|
|
|
7673
7767
|
* own `AGENTS.md` already says what to do about it — "a third copy anywhere
|
|
7674
7768
|
* is the signal to extract a shared package instead of copying again" — so
|
|
7675
7769
|
* the table and the formatter moved into `@saar-ai/widget-protocol/money`,
|
|
7676
|
-
* which this package already bundles, and `@
|
|
7770
|
+
* which this package already bundles, and `@saar-ai/commerce-pack` and
|
|
7677
7771
|
* `apps/web/src/lib/money.ts` re-export the same one.
|
|
7678
7772
|
*
|
|
7679
7773
|
* `@saar-ai/widget-protocol`, not `@wesence/agent-core`, because no
|
|
@@ -8262,7 +8356,7 @@ var DEFAULT_LAYOUT = {
|
|
|
8262
8356
|
};
|
|
8263
8357
|
var INTERRUPT_SEEN_STORAGE_KEY = "wgt_dock_interrupt_seen";
|
|
8264
8358
|
function Dock(props) {
|
|
8265
|
-
const { identity, color = DEFAULT_COLOR, type = DEFAULT_TYPE, layout = DEFAULT_LAYOUT, copy = {}, direction = "ltr", locale = "en", messages = defaultWidgetMessages, voice, escalated = false, offline = false, status, notice, statusKind, operatorLine, operatorName, reconnecting = false, roomDropped = false, partialTranscript, preamble, clause, channel = "text", shelf, transcript, transcriptCount, lastTurn, composing = false, unread = false, sheetExtra, followKey, revealSheet = false, showPrice = true, cardImageAspect = DEFAULT_CARD_ASPECT, bottomOffset = "auto", curationHref, productHref, navigate, draft, onDraftChange, onSubmit, composerDisabled = false, onAttach, attachSlot, attachBusy, proactive, pageKey, conciergeScrollRef, onEndCall, skinStyle, skin, preview = false, announcement, attribution, initialDraft, initialSelection, initialFocus, initialMinimised, insets, hold, audio, onReady } = props;
|
|
8359
|
+
const { identity, color = DEFAULT_COLOR, type = DEFAULT_TYPE, layout = DEFAULT_LAYOUT, copy = {}, direction = "ltr", locale = "en", messages = defaultWidgetMessages, voice, escalated = false, offline = false, status, notice, statusKind, operatorLine, operatorName, reconnecting = false, roomDropped = false, partialTranscript, preamble, clause, channel = "text", shelf, transcript, transcriptCount, lastTurn, composing = false, unread = false, sheetExtra, followKey, revealSheet = false, showPrice = true, cardImageAspect = DEFAULT_CARD_ASPECT, bottomOffset = "auto", curationHref, productHref, navigate, draft, onDraftChange, onSubmit, composerDisabled = false, onAttach, attachSlot, attachBusy, proactive, pageKey, conciergeScrollRef, onEndCall, skinStyle, skin, preview = false, announcement, attribution, privacyChoices, initialDraft, initialSelection, initialFocus, initialMinimised, insets, hold, audio, onReady } = props;
|
|
8266
8360
|
const scopeId = useId().replace(/[^a-zA-Z0-9_-]/g, "");
|
|
8267
8361
|
const rootRef = useRef(null);
|
|
8268
8362
|
const rowRef = useRef(null);
|
|
@@ -9291,6 +9385,13 @@ function Dock(props) {
|
|
|
9291
9385
|
target: "_blank",
|
|
9292
9386
|
rel: "noopener noreferrer",
|
|
9293
9387
|
children: attribution.name
|
|
9388
|
+
}) : null,
|
|
9389
|
+
privacyChoices !== void 0 ? /* @__PURE__ */ jsx("button", {
|
|
9390
|
+
type: "button",
|
|
9391
|
+
className: "wgt-shelf-more",
|
|
9392
|
+
"data-testid": "widget-privacy-choices",
|
|
9393
|
+
onClick: privacyChoices.open,
|
|
9394
|
+
children: privacyChoices.label
|
|
9294
9395
|
}) : null
|
|
9295
9396
|
]
|
|
9296
9397
|
}),
|
|
@@ -9757,38 +9858,57 @@ function botStateFor(snapshot) {
|
|
|
9757
9858
|
return "listening";
|
|
9758
9859
|
}
|
|
9759
9860
|
//#endregion
|
|
9760
|
-
//#region ../../node_modules/.pnpm/lucide-react@1.
|
|
9861
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs
|
|
9761
9862
|
/**
|
|
9762
|
-
* @license lucide-react v1.
|
|
9863
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9763
9864
|
*
|
|
9764
9865
|
* This source code is licensed under the ISC license.
|
|
9765
9866
|
* See the LICENSE file in the root directory of this source tree.
|
|
9766
9867
|
*/
|
|
9767
|
-
var
|
|
9768
|
-
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
9769
|
-
}).join(" ").trim();
|
|
9868
|
+
var toKebabCase = (string) => string?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
9770
9869
|
//#endregion
|
|
9771
|
-
//#region ../../node_modules/.pnpm/lucide-react@1.
|
|
9870
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.mjs
|
|
9772
9871
|
/**
|
|
9773
|
-
* @license lucide-react v1.
|
|
9872
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9774
9873
|
*
|
|
9775
9874
|
* This source code is licensed under the ISC license.
|
|
9776
9875
|
* See the LICENSE file in the root directory of this source tree.
|
|
9777
9876
|
*/
|
|
9778
|
-
|
|
9877
|
+
function toLucideIconData(iconName, iconNode, aliases = []) {
|
|
9878
|
+
if (iconNode == null) throw new Error("[lucide]: iconNode is required when icon name is used");
|
|
9879
|
+
return {
|
|
9880
|
+
name: toKebabCase(iconName),
|
|
9881
|
+
size: 24,
|
|
9882
|
+
node: iconNode,
|
|
9883
|
+
...aliases.length > 0 ? { aliases } : {}
|
|
9884
|
+
};
|
|
9885
|
+
}
|
|
9779
9886
|
//#endregion
|
|
9780
|
-
//#region ../../node_modules/.pnpm/lucide-react@1.
|
|
9887
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.mjs
|
|
9781
9888
|
/**
|
|
9782
|
-
* @license lucide-react v1.
|
|
9889
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9783
9890
|
*
|
|
9784
9891
|
* This source code is licensed under the ISC license.
|
|
9785
9892
|
* See the LICENSE file in the root directory of this source tree.
|
|
9786
9893
|
*/
|
|
9787
|
-
var toCamelCase = (string) =>
|
|
9894
|
+
var toCamelCase = (string) => {
|
|
9895
|
+
let out = "";
|
|
9896
|
+
let upperNext = false;
|
|
9897
|
+
for (const ch of string) {
|
|
9898
|
+
if (ch === "-" || ch === "_" || ch <= " ") {
|
|
9899
|
+
upperNext = out.length > 0;
|
|
9900
|
+
continue;
|
|
9901
|
+
}
|
|
9902
|
+
if (out.length === 0) out += ch.toLowerCase();
|
|
9903
|
+
else out += upperNext ? ch.toUpperCase() : ch;
|
|
9904
|
+
upperNext = false;
|
|
9905
|
+
}
|
|
9906
|
+
return out;
|
|
9907
|
+
};
|
|
9788
9908
|
//#endregion
|
|
9789
|
-
//#region ../../node_modules/.pnpm/lucide-react@1.
|
|
9909
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.mjs
|
|
9790
9910
|
/**
|
|
9791
|
-
* @license lucide-react v1.
|
|
9911
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9792
9912
|
*
|
|
9793
9913
|
* This source code is licensed under the ISC license.
|
|
9794
9914
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -9798,9 +9918,20 @@ var toPascalCase = (string) => {
|
|
|
9798
9918
|
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
9799
9919
|
};
|
|
9800
9920
|
//#endregion
|
|
9801
|
-
//#region ../../node_modules/.pnpm/lucide-react@1.
|
|
9921
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
|
|
9922
|
+
/**
|
|
9923
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9924
|
+
*
|
|
9925
|
+
* This source code is licensed under the ISC license.
|
|
9926
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
9927
|
+
*/
|
|
9928
|
+
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
9929
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
9930
|
+
}).join(" ").trim();
|
|
9931
|
+
//#endregion
|
|
9932
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.mjs
|
|
9802
9933
|
/**
|
|
9803
|
-
* @license lucide-react v1.
|
|
9934
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9804
9935
|
*
|
|
9805
9936
|
* This source code is licensed under the ISC license.
|
|
9806
9937
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -9812,14 +9943,90 @@ var defaultAttributes = {
|
|
|
9812
9943
|
viewBox: "0 0 24 24",
|
|
9813
9944
|
fill: "none",
|
|
9814
9945
|
stroke: "currentColor",
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9946
|
+
"stroke-width": 2,
|
|
9947
|
+
"stroke-linecap": "round",
|
|
9948
|
+
"stroke-linejoin": "round"
|
|
9818
9949
|
};
|
|
9819
9950
|
//#endregion
|
|
9820
|
-
//#region ../../node_modules/.pnpm/lucide-react@1.
|
|
9951
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.mjs
|
|
9952
|
+
/**
|
|
9953
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9954
|
+
*
|
|
9955
|
+
* This source code is licensed under the ISC license.
|
|
9956
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
9957
|
+
*/
|
|
9958
|
+
function isDefined(value) {
|
|
9959
|
+
return value !== null && value !== void 0;
|
|
9960
|
+
}
|
|
9961
|
+
function buildLucideIconNode(icon, params = {}) {
|
|
9962
|
+
const attributeNames = params.attributeNames ?? {};
|
|
9963
|
+
const getAttributeName = (attributeName) => attributeNames[attributeName] ?? attributeName;
|
|
9964
|
+
const viewBoxWidth = icon.size ?? icon.width ?? defaultAttributes["width"];
|
|
9965
|
+
const viewBoxHeight = icon.size ?? icon.height ?? defaultAttributes["height"];
|
|
9966
|
+
const aliasClassNames = icon.aliases?.filter((alias) => typeof alias === "string" && alias.trim() !== "").map((alias) => `lucide-${alias}`) ?? [];
|
|
9967
|
+
const iconClassNames = [...icon.name ? [`lucide-${icon.name}`] : [], ...aliasClassNames];
|
|
9968
|
+
const classNamesFromClassName = params.className?.split(" ").filter(Boolean) ?? [];
|
|
9969
|
+
const className = params.includeDefaultClasses === false ? mergeClasses(...classNamesFromClassName) : mergeClasses("lucide", ...iconClassNames, ...classNamesFromClassName);
|
|
9970
|
+
const calculatedStrokeWidth = params.absoluteStrokeWidth ? Number(params.strokeWidth ?? defaultAttributes["stroke-width"]) * Number(icon.size ?? icon.width ?? defaultAttributes["width"]) / Number(params.size ?? params.width ?? defaultAttributes["width"]) : params.strokeWidth ?? defaultAttributes["stroke-width"];
|
|
9971
|
+
return [
|
|
9972
|
+
"svg",
|
|
9973
|
+
{
|
|
9974
|
+
...Object.entries(defaultAttributes).reduce((attrs, [attrName, value]) => {
|
|
9975
|
+
attrs[getAttributeName(attrName)] = value;
|
|
9976
|
+
return attrs;
|
|
9977
|
+
}, {}),
|
|
9978
|
+
..."color" in params && params.color && { [getAttributeName("stroke")]: params.color },
|
|
9979
|
+
..."size" in params && isDefined(params.size) && {
|
|
9980
|
+
[getAttributeName("width")]: params.size,
|
|
9981
|
+
[getAttributeName("height")]: params.size
|
|
9982
|
+
},
|
|
9983
|
+
..."width" in params && isDefined(params.width) && { [getAttributeName("width")]: params.width },
|
|
9984
|
+
..."height" in params && isDefined(params.height) && { [getAttributeName("height")]: params.height },
|
|
9985
|
+
[getAttributeName("stroke-width")]: calculatedStrokeWidth,
|
|
9986
|
+
...className && { [getAttributeName("class")]: className },
|
|
9987
|
+
[getAttributeName("viewBox")]: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,
|
|
9988
|
+
...params.hasA11yProp === false ? { [getAttributeName("aria-hidden")]: "true" } : {},
|
|
9989
|
+
..."attributes" in params && params.attributes
|
|
9990
|
+
},
|
|
9991
|
+
icon.node.map((child) => {
|
|
9992
|
+
const [name, attrs, children] = child;
|
|
9993
|
+
const nextAttrs = params.nonScalingStroke ? {
|
|
9994
|
+
[getAttributeName("vector-effect")]: "non-scaling-stroke",
|
|
9995
|
+
...attrs
|
|
9996
|
+
} : attrs;
|
|
9997
|
+
return children ? [
|
|
9998
|
+
name,
|
|
9999
|
+
nextAttrs,
|
|
10000
|
+
children
|
|
10001
|
+
] : [name, nextAttrs];
|
|
10002
|
+
})
|
|
10003
|
+
];
|
|
10004
|
+
}
|
|
10005
|
+
//#endregion
|
|
10006
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.mjs
|
|
10007
|
+
/**
|
|
10008
|
+
* @license lucide-react v1.50.0 - ISC
|
|
10009
|
+
*
|
|
10010
|
+
* This source code is licensed under the ISC license.
|
|
10011
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
10012
|
+
*/
|
|
10013
|
+
function buildLucideIconForReact(icon, params = {}) {
|
|
10014
|
+
return buildLucideIconNode(icon, {
|
|
10015
|
+
...params,
|
|
10016
|
+
attributeNames: {
|
|
10017
|
+
...params.attributeNames,
|
|
10018
|
+
class: "className",
|
|
10019
|
+
"stroke-width": "strokeWidth",
|
|
10020
|
+
"stroke-linecap": "strokeLinecap",
|
|
10021
|
+
"stroke-linejoin": "strokeLinejoin",
|
|
10022
|
+
"vector-effect": "vectorEffect"
|
|
10023
|
+
}
|
|
10024
|
+
});
|
|
10025
|
+
}
|
|
10026
|
+
//#endregion
|
|
10027
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs
|
|
9821
10028
|
/**
|
|
9822
|
-
* @license lucide-react v1.
|
|
10029
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9823
10030
|
*
|
|
9824
10031
|
* This source code is licensed under the ISC license.
|
|
9825
10032
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -9829,9 +10036,9 @@ var hasA11yProp = (props) => {
|
|
|
9829
10036
|
return false;
|
|
9830
10037
|
};
|
|
9831
10038
|
//#endregion
|
|
9832
|
-
//#region ../../node_modules/.pnpm/lucide-react@1.
|
|
10039
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/context.mjs
|
|
9833
10040
|
/**
|
|
9834
|
-
* @license lucide-react v1.
|
|
10041
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9835
10042
|
*
|
|
9836
10043
|
* This source code is licensed under the ISC license.
|
|
9837
10044
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -9839,192 +10046,271 @@ var hasA11yProp = (props) => {
|
|
|
9839
10046
|
var LucideContext = createContext({});
|
|
9840
10047
|
var useLucideContext = () => useContext(LucideContext);
|
|
9841
10048
|
//#endregion
|
|
9842
|
-
//#region ../../node_modules/.pnpm/lucide-react@1.
|
|
10049
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/Icon.mjs
|
|
9843
10050
|
/**
|
|
9844
|
-
* @license lucide-react v1.
|
|
10051
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9845
10052
|
*
|
|
9846
10053
|
* This source code is licensed under the ISC license.
|
|
9847
10054
|
* See the LICENSE file in the root directory of this source tree.
|
|
9848
10055
|
*/
|
|
9849
|
-
var Icon = forwardRef(({ color, size, strokeWidth, absoluteStrokeWidth, className = "", children, iconNode
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
10056
|
+
var Icon = forwardRef(({ color, size, width, height, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className = "", children, iconNode = [], icon = {
|
|
10057
|
+
node: iconNode,
|
|
10058
|
+
aliases: [],
|
|
10059
|
+
size: 24
|
|
10060
|
+
}, ...rest }, ref) => {
|
|
10061
|
+
const { size: contextSize = 24, strokeWidth: contextStrokeWidth = 2, absoluteStrokeWidth: contextAbsoluteStrokeWidth = false, nonScalingStroke: contextNonScalingStroke = false, color: contextColor = "currentColor", className: contextClass = "" } = useLucideContext() ?? {};
|
|
10062
|
+
const hasAccessibleProp = Boolean(children) || hasA11yProp(rest);
|
|
10063
|
+
const [name, svgAttributes, builtIconNode = []] = buildLucideIconForReact(icon, {
|
|
10064
|
+
color: color ?? contextColor,
|
|
10065
|
+
width: width ?? size ?? contextSize,
|
|
10066
|
+
height: height ?? size ?? contextSize,
|
|
10067
|
+
strokeWidth: strokeWidth ?? contextStrokeWidth,
|
|
10068
|
+
absoluteStrokeWidth: absoluteStrokeWidth ?? contextAbsoluteStrokeWidth,
|
|
10069
|
+
nonScalingStroke: nonScalingStroke ?? contextNonScalingStroke,
|
|
10070
|
+
className: mergeClasses(contextClass, className),
|
|
10071
|
+
hasA11yProp: hasAccessibleProp,
|
|
10072
|
+
attributes: rest
|
|
10073
|
+
});
|
|
10074
|
+
return createElement(name, {
|
|
9853
10075
|
ref,
|
|
9854
|
-
...
|
|
9855
|
-
|
|
9856
|
-
height: size ?? contextSize ?? defaultAttributes.height,
|
|
9857
|
-
stroke: color ?? contextColor,
|
|
9858
|
-
strokeWidth: calculatedStrokeWidth,
|
|
9859
|
-
className: mergeClasses("lucide", contextClass, className),
|
|
9860
|
-
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
9861
|
-
...rest
|
|
9862
|
-
}, [...iconNode.map(([tag, attrs]) => createElement(tag, attrs)), ...Array.isArray(children) ? children : [children]]);
|
|
10076
|
+
...svgAttributes
|
|
10077
|
+
}, [...builtIconNode.map(([tag, attrs]) => createElement(tag, attrs)), ...Array.isArray(children) ? children : [children]]);
|
|
9863
10078
|
});
|
|
9864
10079
|
//#endregion
|
|
9865
|
-
//#region ../../node_modules/.pnpm/lucide-react@1.
|
|
10080
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/createLucideIcon.mjs
|
|
9866
10081
|
/**
|
|
9867
|
-
* @license lucide-react v1.
|
|
10082
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9868
10083
|
*
|
|
9869
10084
|
* This source code is licensed under the ISC license.
|
|
9870
10085
|
* See the LICENSE file in the root directory of this source tree.
|
|
9871
10086
|
*/
|
|
9872
|
-
|
|
10087
|
+
function createLucideIcon(iconDataOrName, iconNode = [], aliases = []) {
|
|
10088
|
+
const iconData = typeof iconDataOrName === "string" ? toLucideIconData(iconDataOrName, iconNode, aliases) : iconDataOrName;
|
|
9873
10089
|
const Component = forwardRef(({ className, ...props }, ref) => createElement(Icon, {
|
|
9874
10090
|
ref,
|
|
9875
|
-
|
|
9876
|
-
className
|
|
10091
|
+
icon: iconData,
|
|
10092
|
+
className,
|
|
9877
10093
|
...props
|
|
9878
10094
|
}));
|
|
9879
|
-
Component.displayName = toPascalCase(
|
|
10095
|
+
if (iconData.name) Component.displayName = toPascalCase(iconData.name);
|
|
9880
10096
|
return Component;
|
|
10097
|
+
}
|
|
10098
|
+
//#endregion
|
|
10099
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/grip-vertical.mjs
|
|
10100
|
+
/**
|
|
10101
|
+
* @license lucide-react v1.50.0 - ISC
|
|
10102
|
+
*
|
|
10103
|
+
* This source code is licensed under the ISC license.
|
|
10104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
10105
|
+
*/
|
|
10106
|
+
var __iconData$6 = {
|
|
10107
|
+
name: "grip-vertical",
|
|
10108
|
+
size: 24,
|
|
10109
|
+
node: [
|
|
10110
|
+
["circle", {
|
|
10111
|
+
cx: "9",
|
|
10112
|
+
cy: "12",
|
|
10113
|
+
r: "1",
|
|
10114
|
+
key: "1vctgf"
|
|
10115
|
+
}],
|
|
10116
|
+
["circle", {
|
|
10117
|
+
cx: "9",
|
|
10118
|
+
cy: "5",
|
|
10119
|
+
r: "1",
|
|
10120
|
+
key: "hp0tcf"
|
|
10121
|
+
}],
|
|
10122
|
+
["circle", {
|
|
10123
|
+
cx: "9",
|
|
10124
|
+
cy: "19",
|
|
10125
|
+
r: "1",
|
|
10126
|
+
key: "fkjjf6"
|
|
10127
|
+
}],
|
|
10128
|
+
["circle", {
|
|
10129
|
+
cx: "15",
|
|
10130
|
+
cy: "12",
|
|
10131
|
+
r: "1",
|
|
10132
|
+
key: "1tmaij"
|
|
10133
|
+
}],
|
|
10134
|
+
["circle", {
|
|
10135
|
+
cx: "15",
|
|
10136
|
+
cy: "5",
|
|
10137
|
+
r: "1",
|
|
10138
|
+
key: "19l28e"
|
|
10139
|
+
}],
|
|
10140
|
+
["circle", {
|
|
10141
|
+
cx: "15",
|
|
10142
|
+
cy: "19",
|
|
10143
|
+
r: "1",
|
|
10144
|
+
key: "f4zoj3"
|
|
10145
|
+
}]
|
|
10146
|
+
]
|
|
9881
10147
|
};
|
|
10148
|
+
__iconData$6.node;
|
|
10149
|
+
var GripVertical = createLucideIcon(__iconData$6);
|
|
10150
|
+
//#endregion
|
|
10151
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/mic-off.mjs
|
|
9882
10152
|
/**
|
|
9883
|
-
* @license lucide-react v1.
|
|
10153
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9884
10154
|
*
|
|
9885
10155
|
* This source code is licensed under the ISC license.
|
|
9886
10156
|
* See the LICENSE file in the root directory of this source tree.
|
|
9887
10157
|
*/
|
|
9888
|
-
var
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
r: "1",
|
|
9923
|
-
key: "f4zoj3"
|
|
9924
|
-
}]
|
|
9925
|
-
]);
|
|
10158
|
+
var __iconData$5 = {
|
|
10159
|
+
name: "mic-off",
|
|
10160
|
+
size: 24,
|
|
10161
|
+
node: [
|
|
10162
|
+
["path", {
|
|
10163
|
+
d: "M12 19v3",
|
|
10164
|
+
key: "npa21l"
|
|
10165
|
+
}],
|
|
10166
|
+
["path", {
|
|
10167
|
+
d: "M15 9.34V5a3 3 0 0 0-5.68-1.33",
|
|
10168
|
+
key: "1gzdoj"
|
|
10169
|
+
}],
|
|
10170
|
+
["path", {
|
|
10171
|
+
d: "M16.95 16.95A7 7 0 0 1 5 12v-2",
|
|
10172
|
+
key: "cqa7eg"
|
|
10173
|
+
}],
|
|
10174
|
+
["path", {
|
|
10175
|
+
d: "M18.89 13.23A7 7 0 0 0 19 12v-2",
|
|
10176
|
+
key: "16hl24"
|
|
10177
|
+
}],
|
|
10178
|
+
["path", {
|
|
10179
|
+
d: "m2 2 20 20",
|
|
10180
|
+
key: "1ooewy"
|
|
10181
|
+
}],
|
|
10182
|
+
["path", {
|
|
10183
|
+
d: "M9 9v3a3 3 0 0 0 5.12 2.12",
|
|
10184
|
+
key: "r2i35w"
|
|
10185
|
+
}]
|
|
10186
|
+
]
|
|
10187
|
+
};
|
|
10188
|
+
__iconData$5.node;
|
|
10189
|
+
var MicOff = createLucideIcon(__iconData$5);
|
|
10190
|
+
//#endregion
|
|
10191
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/mic.mjs
|
|
9926
10192
|
/**
|
|
9927
|
-
* @license lucide-react v1.
|
|
10193
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9928
10194
|
*
|
|
9929
10195
|
* This source code is licensed under the ISC license.
|
|
9930
10196
|
* See the LICENSE file in the root directory of this source tree.
|
|
9931
10197
|
*/
|
|
9932
|
-
var
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
10198
|
+
var __iconData$4 = {
|
|
10199
|
+
name: "mic",
|
|
10200
|
+
size: 24,
|
|
10201
|
+
node: [
|
|
10202
|
+
["path", {
|
|
10203
|
+
d: "M12 19v3",
|
|
10204
|
+
key: "npa21l"
|
|
10205
|
+
}],
|
|
10206
|
+
["path", {
|
|
10207
|
+
d: "M19 10v2a7 7 0 0 1-14 0v-2",
|
|
10208
|
+
key: "1vc78b"
|
|
10209
|
+
}],
|
|
10210
|
+
["rect", {
|
|
10211
|
+
x: "9",
|
|
10212
|
+
y: "2",
|
|
10213
|
+
width: "6",
|
|
10214
|
+
height: "13",
|
|
10215
|
+
rx: "3",
|
|
10216
|
+
key: "s6n7sd"
|
|
10217
|
+
}]
|
|
10218
|
+
]
|
|
10219
|
+
};
|
|
10220
|
+
__iconData$4.node;
|
|
10221
|
+
var Mic = createLucideIcon(__iconData$4);
|
|
10222
|
+
//#endregion
|
|
10223
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/phone-off.mjs
|
|
9958
10224
|
/**
|
|
9959
|
-
* @license lucide-react v1.
|
|
10225
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9960
10226
|
*
|
|
9961
10227
|
* This source code is licensed under the ISC license.
|
|
9962
10228
|
* See the LICENSE file in the root directory of this source tree.
|
|
9963
10229
|
*/
|
|
9964
|
-
var
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
10230
|
+
var __iconData$3 = {
|
|
10231
|
+
name: "phone-off",
|
|
10232
|
+
size: 24,
|
|
10233
|
+
node: [
|
|
10234
|
+
["path", {
|
|
10235
|
+
d: "M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",
|
|
10236
|
+
key: "1wngk7"
|
|
10237
|
+
}],
|
|
10238
|
+
["path", {
|
|
10239
|
+
d: "M22 2 2 22",
|
|
10240
|
+
key: "y4kqgn"
|
|
10241
|
+
}],
|
|
10242
|
+
["path", {
|
|
10243
|
+
d: "M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",
|
|
10244
|
+
key: "10hv5p"
|
|
10245
|
+
}]
|
|
10246
|
+
]
|
|
10247
|
+
};
|
|
10248
|
+
__iconData$3.node;
|
|
10249
|
+
var PhoneOff = createLucideIcon(__iconData$3);
|
|
10250
|
+
//#endregion
|
|
10251
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/send.mjs
|
|
9982
10252
|
/**
|
|
9983
|
-
* @license lucide-react v1.
|
|
10253
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9984
10254
|
*
|
|
9985
10255
|
* This source code is licensed under the ISC license.
|
|
9986
10256
|
* See the LICENSE file in the root directory of this source tree.
|
|
9987
10257
|
*/
|
|
9988
|
-
var
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10258
|
+
var __iconData$2 = {
|
|
10259
|
+
name: "send",
|
|
10260
|
+
size: 24,
|
|
10261
|
+
node: [["path", {
|
|
10262
|
+
d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
|
|
10263
|
+
key: "1ffxy3"
|
|
10264
|
+
}], ["path", {
|
|
10265
|
+
d: "m21.854 2.147-10.94 10.939",
|
|
10266
|
+
key: "12cjpa"
|
|
10267
|
+
}]]
|
|
10268
|
+
};
|
|
10269
|
+
__iconData$2.node;
|
|
10270
|
+
var Send = createLucideIcon(__iconData$2);
|
|
10271
|
+
//#endregion
|
|
10272
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/square.mjs
|
|
10002
10273
|
/**
|
|
10003
|
-
* @license lucide-react v1.
|
|
10274
|
+
* @license lucide-react v1.50.0 - ISC
|
|
10004
10275
|
*
|
|
10005
10276
|
* This source code is licensed under the ISC license.
|
|
10006
10277
|
* See the LICENSE file in the root directory of this source tree.
|
|
10007
10278
|
*/
|
|
10008
|
-
var
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10279
|
+
var __iconData$1 = {
|
|
10280
|
+
name: "square",
|
|
10281
|
+
size: 24,
|
|
10282
|
+
node: [["rect", {
|
|
10283
|
+
width: "18",
|
|
10284
|
+
height: "18",
|
|
10285
|
+
x: "3",
|
|
10286
|
+
y: "3",
|
|
10287
|
+
rx: "2",
|
|
10288
|
+
key: "afitv7"
|
|
10289
|
+
}]]
|
|
10290
|
+
};
|
|
10291
|
+
__iconData$1.node;
|
|
10292
|
+
var Square = createLucideIcon(__iconData$1);
|
|
10293
|
+
//#endregion
|
|
10294
|
+
//#region ../../node_modules/.pnpm/lucide-react@1.50.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/x.mjs
|
|
10015
10295
|
/**
|
|
10016
|
-
* @license lucide-react v1.
|
|
10296
|
+
* @license lucide-react v1.50.0 - ISC
|
|
10017
10297
|
*
|
|
10018
10298
|
* This source code is licensed under the ISC license.
|
|
10019
10299
|
* See the LICENSE file in the root directory of this source tree.
|
|
10020
10300
|
*/
|
|
10021
|
-
var
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
}]
|
|
10301
|
+
var __iconData = {
|
|
10302
|
+
name: "x",
|
|
10303
|
+
size: 24,
|
|
10304
|
+
node: [["path", {
|
|
10305
|
+
d: "M18 6 6 18",
|
|
10306
|
+
key: "1bl5f8"
|
|
10307
|
+
}], ["path", {
|
|
10308
|
+
d: "m6 6 12 12",
|
|
10309
|
+
key: "d8bk6v"
|
|
10310
|
+
}]]
|
|
10311
|
+
};
|
|
10312
|
+
__iconData.node;
|
|
10313
|
+
var X = createLucideIcon(__iconData);
|
|
10028
10314
|
//#endregion
|
|
10029
10315
|
//#region src/avatar-face.tsx
|
|
10030
10316
|
function AvatarFace({ avatar, state, size, label, messageArrived, tightenKey }) {
|
|
@@ -10142,7 +10428,15 @@ function panelClasses(position) {
|
|
|
10142
10428
|
}
|
|
10143
10429
|
//#endregion
|
|
10144
10430
|
//#region src/widget/concierge-launcher.tsx
|
|
10145
|
-
|
|
10431
|
+
/** Nothing to say — what a launcher rendered without a `spec` draws. */
|
|
10432
|
+
var QUIET = {
|
|
10433
|
+
busy: false,
|
|
10434
|
+
dimmed: false,
|
|
10435
|
+
disabled: false,
|
|
10436
|
+
badge: false,
|
|
10437
|
+
initials: false
|
|
10438
|
+
};
|
|
10439
|
+
function ConciergeLauncher({ label, srLabel, moveLabel, position, onPositionChange, onOpen, hidden, id, testId, avatar = "orb", spec = QUIET, initials = "" }) {
|
|
10146
10440
|
const rootRef = useRef(null);
|
|
10147
10441
|
/** Pixel offset while a drag is in flight; `null` when it is not. */
|
|
10148
10442
|
const [drag, setDrag] = useState(null);
|
|
@@ -10232,7 +10526,7 @@ function ConciergeLauncher({ label, srLabel, moveLabel, position, onPositionChan
|
|
|
10232
10526
|
"data-testid": testId,
|
|
10233
10527
|
"data-position": position,
|
|
10234
10528
|
"aria-hidden": hidden,
|
|
10235
|
-
className: cn("fixed z-50 flex items-center gap-1 rounded-full border border-white/40 bg-[var(--widget-card)] py-1.5 pe-4 ps-2 shadow-[0_12px_32px_-12px_color-mix(in_oklab,var(--brand-plum)_35%,transparent)] backdrop-blur-xl", positionClasses(position), dragging ? "cursor-grabbing" : "transition-[opacity,scale] duration-300 ease-out", hidden ? "pointer-events-none scale-75 opacity-0" : "pointer-events-auto opacity-100"),
|
|
10529
|
+
className: cn("fixed z-50 flex items-center gap-1 rounded-full border border-white/40 bg-[var(--widget-card)] py-1.5 pe-4 ps-2 shadow-[0_12px_32px_-12px_color-mix(in_oklab,var(--brand-plum)_35%,transparent)] backdrop-blur-xl", positionClasses(position), dragging ? "cursor-grabbing" : "transition-[opacity,scale] duration-300 ease-out", hidden ? "pointer-events-none scale-75 opacity-0" : "pointer-events-auto opacity-100", !hidden && spec.dimmed ? "opacity-60" : null, spec.disabled ? "cursor-default opacity-70" : null),
|
|
10236
10530
|
style: drag ? { transform: `translate(${drag.dx}px, ${drag.dy}px)` } : void 0,
|
|
10237
10531
|
children: [onPositionChange ? /* @__PURE__ */ jsx("button", {
|
|
10238
10532
|
type: "button",
|
|
@@ -10253,25 +10547,43 @@ function ConciergeLauncher({ label, srLabel, moveLabel, position, onPositionChan
|
|
|
10253
10547
|
}) : null, /* @__PURE__ */ jsxs("button", {
|
|
10254
10548
|
type: "button",
|
|
10255
10549
|
"aria-label": label === void 0 ? srLabel : void 0,
|
|
10256
|
-
tabIndex: hidden ? -1 : 0,
|
|
10550
|
+
tabIndex: hidden || spec.disabled ? -1 : 0,
|
|
10551
|
+
disabled: spec.disabled,
|
|
10552
|
+
...spec.busy ? { "aria-busy": true } : {},
|
|
10553
|
+
"data-launcher-state": spec.disabled ? "offline" : spec.busy ? "busy" : spec.dimmed ? "ducked" : void 0,
|
|
10257
10554
|
onClick: () => {
|
|
10555
|
+
if (spec.disabled) return;
|
|
10258
10556
|
setTightenKey((k) => k + 1);
|
|
10259
10557
|
onOpen();
|
|
10260
10558
|
},
|
|
10261
10559
|
"data-testid": testId ? `${testId}-open` : void 0,
|
|
10262
10560
|
className: "flex items-center gap-2.5 rounded-full focus-visible:ring-brand-plum/30 focus-visible:ring-2 focus-visible:outline-none",
|
|
10263
|
-
children: [/* @__PURE__ */
|
|
10561
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
10264
10562
|
"aria-hidden": true,
|
|
10265
10563
|
className: "relative block size-12 shrink-0",
|
|
10266
|
-
children:
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10564
|
+
children: [
|
|
10565
|
+
spec.initials && initials !== "" ? /* @__PURE__ */ jsx("span", {
|
|
10566
|
+
"data-testid": "widget-launcher-initials",
|
|
10567
|
+
className: "absolute start-1/2 top-1/2 flex size-9 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full bg-[var(--widget-accent)] text-[13px] font-semibold text-[var(--widget-accent-foreground)] rtl:translate-x-1/2",
|
|
10568
|
+
children: initials
|
|
10569
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
10570
|
+
className: "absolute start-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 scale-[0.75] rtl:translate-x-1/2",
|
|
10571
|
+
children: /* @__PURE__ */ jsx(AvatarFace, {
|
|
10572
|
+
avatar,
|
|
10573
|
+
state: "idle",
|
|
10574
|
+
size: "sm",
|
|
10575
|
+
tightenKey
|
|
10576
|
+
})
|
|
10577
|
+
}),
|
|
10578
|
+
spec.busy ? /* @__PURE__ */ jsx("span", {
|
|
10579
|
+
"data-testid": "widget-launcher-busy",
|
|
10580
|
+
className: "pointer-events-none absolute inset-0 animate-spin rounded-full border-2 border-transparent border-t-[var(--widget-accent)] motion-reduce:animate-none"
|
|
10581
|
+
}) : null,
|
|
10582
|
+
spec.badge ? /* @__PURE__ */ jsx("span", {
|
|
10583
|
+
"data-testid": "widget-launcher-badge",
|
|
10584
|
+
className: "absolute end-0 top-0 size-3 rounded-full bg-[var(--widget-accent)] ring-2 ring-[var(--widget-card)]"
|
|
10585
|
+
}) : null
|
|
10586
|
+
]
|
|
10275
10587
|
}), label === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
10276
10588
|
dir: "auto",
|
|
10277
10589
|
className: "max-w-[14rem] truncate text-sm font-medium text-[var(--widget-foreground)]",
|
|
@@ -10612,7 +10924,7 @@ function voiceStatePillDotColor(pillState) {
|
|
|
10612
10924
|
}
|
|
10613
10925
|
/** How long the opening flourish runs. Matches `.widget-portal`'s own duration. */
|
|
10614
10926
|
var PORTAL_MS = 720;
|
|
10615
|
-
function ConciergeShell({ open, onOpenChange, state, messageArrived = false, avatar = "orb", labels, children, badge, draft, onDraftChange, onSubmit, composerDisabled = false, voice, announcement, skin, skinStyle, idPrefix = "concierge", scrollKey, composerLeading, testIds, position = DEFAULT_CONCIERGE_POSITION, onPositionChange, attribution }) {
|
|
10927
|
+
function ConciergeShell({ open, onOpenChange, state, messageArrived = false, launcher, launcherInitials, typing = false, operatorName, avatar = "orb", labels, children, badge, draft, onDraftChange, onSubmit, composerDisabled = false, voice, announcement, skin, skinStyle, idPrefix = "concierge", scrollKey, composerLeading, testIds, position = DEFAULT_CONCIERGE_POSITION, onPositionChange, attribution, privacyChoices }) {
|
|
10616
10928
|
const triggerId = `${idPrefix}-trigger`;
|
|
10617
10929
|
const inputId = `${idPrefix}-input`;
|
|
10618
10930
|
const [portalActive, setPortalActive] = useState(false);
|
|
@@ -10820,7 +11132,9 @@ function ConciergeShell({ open, onOpenChange, state, messageArrived = false, ava
|
|
|
10820
11132
|
...onPositionChange !== void 0 ? { onPositionChange } : {},
|
|
10821
11133
|
onOpen: () => onOpenChange(true),
|
|
10822
11134
|
hidden: open,
|
|
10823
|
-
avatar
|
|
11135
|
+
avatar,
|
|
11136
|
+
...launcher !== void 0 ? { spec: launcher } : {},
|
|
11137
|
+
...launcherInitials !== void 0 ? { initials: launcherInitials } : {}
|
|
10824
11138
|
}),
|
|
10825
11139
|
/* @__PURE__ */ jsx("div", {
|
|
10826
11140
|
"aria-hidden": true,
|
|
@@ -10831,183 +11145,235 @@ function ConciergeShell({ open, onOpenChange, state, messageArrived = false, ava
|
|
|
10831
11145
|
className: cn("pointer-events-none fixed inset-x-0 z-50 flex", panelClasses(position)),
|
|
10832
11146
|
children: /* @__PURE__ */ jsxs("div", {
|
|
10833
11147
|
className: "relative flex flex-col items-center",
|
|
10834
|
-
children: [
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
"
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
"
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
"
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
"
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
"
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
11148
|
+
children: [
|
|
11149
|
+
/* @__PURE__ */ jsxs("div", {
|
|
11150
|
+
ref: panelRef,
|
|
11151
|
+
role: "dialog",
|
|
11152
|
+
"aria-modal": "true",
|
|
11153
|
+
"aria-label": labels.dialog,
|
|
11154
|
+
"data-testid": testIds?.panel,
|
|
11155
|
+
className: cn("origin-bottom rounded-full transition-[transform,opacity] duration-[700ms] motion-reduce:transition-none", open ? "pointer-events-auto aspect-[5/8] w-[min(97vw,50dvh)] min-h-0 scale-100 opacity-100 [container-type:size]" : "pointer-events-none size-16 scale-90 opacity-0"),
|
|
11156
|
+
style: { transitionTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)" },
|
|
11157
|
+
children: [
|
|
11158
|
+
/* @__PURE__ */ jsx("div", {
|
|
11159
|
+
"aria-hidden": true,
|
|
11160
|
+
className: cn("pointer-events-none absolute -inset-4 rounded-full opacity-25 blur-xl motion-reduce:animate-none", open ? "animate-[spin_18s_linear_infinite]" : "opacity-0"),
|
|
11161
|
+
style: { background: "conic-gradient(from 0deg, color-mix(in oklab, var(--brand-plum) 14%, transparent), color-mix(in oklab, var(--brand-rose) 16%, transparent), color-mix(in oklab, var(--brand-amber) 16%, transparent), color-mix(in oklab, var(--brand-plum) 14%, transparent))" }
|
|
11162
|
+
}),
|
|
11163
|
+
/* @__PURE__ */ jsx("div", {
|
|
11164
|
+
"aria-hidden": true,
|
|
11165
|
+
className: "pointer-events-none absolute inset-0 rounded-full p-[1.5px]",
|
|
11166
|
+
style: {
|
|
11167
|
+
background: "conic-gradient(from 140deg, color-mix(in oklab, var(--brand-plum) 45%, transparent), color-mix(in oklab, var(--brand-rose) 40%, transparent), color-mix(in oklab, var(--brand-amber) 45%, transparent), color-mix(in oklab, var(--brand-plum) 45%, transparent))",
|
|
11168
|
+
WebkitMask: "linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",
|
|
11169
|
+
WebkitMaskComposite: "xor",
|
|
11170
|
+
maskComposite: "exclude"
|
|
11171
|
+
}
|
|
11172
|
+
}),
|
|
11173
|
+
/* @__PURE__ */ jsx("button", {
|
|
11174
|
+
type: "button",
|
|
11175
|
+
"aria-label": labels.close,
|
|
11176
|
+
onClick: handleClose,
|
|
11177
|
+
className: cn("absolute end-[8%] top-[8%] z-20 rounded-full bg-[var(--widget-card)] p-1.5 text-[var(--widget-foreground)] shadow-[0_2px_10px_-2px_color-mix(in_oklab,var(--brand-plum)_35%,transparent)] ring-1 ring-black/5", "hover:text-brand-plum hover:ring-brand-plum/30 focus-visible:ring-brand-plum/50 focus-visible:ring-2 focus-visible:outline-none", open ? "opacity-100 delay-[350ms]" : "opacity-0"),
|
|
11178
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-4" })
|
|
11179
|
+
}),
|
|
11180
|
+
/* @__PURE__ */ jsxs("div", {
|
|
11181
|
+
className: cn("relative flex h-full w-full flex-col items-center overflow-clip rounded-full border border-white/40 bg-[var(--widget-card)] backdrop-blur-xl", "shadow-[0_30px_80px_-20px_color-mix(in_oklab,var(--brand-plum)_25%,transparent),inset_0_1px_0_rgba(255,255,255,0.75)]"),
|
|
11182
|
+
children: [
|
|
11183
|
+
/* @__PURE__ */ jsx("div", {
|
|
11184
|
+
"aria-hidden": true,
|
|
11185
|
+
className: "pointer-events-none absolute -top-16 -right-10 h-56 w-56 rounded-full bg-[radial-gradient(circle,color-mix(in_oklab,var(--brand-amber)_7%,transparent),transparent_70%)] blur-2xl"
|
|
11186
|
+
}),
|
|
11187
|
+
/* @__PURE__ */ jsx("div", {
|
|
11188
|
+
"aria-hidden": true,
|
|
11189
|
+
className: "pointer-events-none absolute -bottom-20 -left-12 h-52 w-52 rounded-full bg-[radial-gradient(circle,color-mix(in_oklab,var(--brand-rose)_5%,transparent),transparent_70%)] blur-2xl"
|
|
11190
|
+
}),
|
|
11191
|
+
/* @__PURE__ */ jsxs("div", {
|
|
11192
|
+
className: cn("relative flex h-full w-full flex-col items-center justify-center px-2.5 py-1.5 transition-opacity duration-300 motion-reduce:transition-none", open ? "translate-y-0 opacity-100 delay-[300ms]" : "translate-y-2 opacity-0"),
|
|
11193
|
+
children: [
|
|
11194
|
+
/* @__PURE__ */ jsxs("div", {
|
|
11195
|
+
className: "pointer-events-none absolute inset-x-0 top-1.5 z-10 flex flex-col items-center gap-1",
|
|
11196
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
11197
|
+
className: "relative",
|
|
11198
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
11199
|
+
"aria-hidden": true,
|
|
11200
|
+
className: "absolute inset-0 rounded-full bg-[radial-gradient(circle,var(--widget-card)_58%,transparent_72%)]"
|
|
11201
|
+
}), /* @__PURE__ */ jsx(AvatarFace, {
|
|
11202
|
+
avatar,
|
|
11203
|
+
state,
|
|
11204
|
+
size: "lg",
|
|
11205
|
+
messageArrived,
|
|
11206
|
+
tightenKey: knotTightenKey
|
|
11207
|
+
})]
|
|
11208
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
11209
|
+
"data-testid": "widget-voice-state",
|
|
11210
|
+
className: cn("flex items-center gap-1.5 rounded-full bg-[var(--widget-card)] px-2.5 py-1 text-[10px] font-medium tracking-wider text-[var(--widget-foreground-muted)] uppercase ring-1 ring-black/5 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.15)] transition-opacity duration-300", voicePillState ? "opacity-100" : "opacity-0"),
|
|
11211
|
+
children: voicePillState ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
11212
|
+
"aria-hidden": true,
|
|
11213
|
+
className: cn("size-1.5 shrink-0 rounded-full", voicePillState !== "listening" && "animate-pulse motion-reduce:animate-none"),
|
|
11214
|
+
style: { backgroundColor: voiceStatePillDotColor(voicePillState) }
|
|
11215
|
+
}), /* @__PURE__ */ jsx("span", { children: voiceStatePillLabel(voicePillState, voice?.labels) })] }) : null
|
|
10892
11216
|
})]
|
|
10893
|
-
}),
|
|
10894
|
-
|
|
10895
|
-
className:
|
|
10896
|
-
children:
|
|
10897
|
-
"
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
|
|
10922
|
-
|
|
10923
|
-
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
11217
|
+
}),
|
|
11218
|
+
badge == null && operatorName === void 0 ? null : /* @__PURE__ */ jsxs("div", {
|
|
11219
|
+
className: "z-10 mt-[104px] w-[68%] shrink-0 text-center",
|
|
11220
|
+
children: [operatorName === void 0 ? null : /* @__PURE__ */ jsx("p", {
|
|
11221
|
+
"data-testid": "widget-operator-name",
|
|
11222
|
+
dir: "auto",
|
|
11223
|
+
className: "text-[11px] font-medium text-[var(--widget-foreground-muted)]",
|
|
11224
|
+
children: operatorName
|
|
11225
|
+
}), badge]
|
|
11226
|
+
}),
|
|
11227
|
+
/* @__PURE__ */ jsx("div", {
|
|
11228
|
+
ref: transcriptRef,
|
|
11229
|
+
className: "no-scrollbar w-full min-h-0 flex-1 overflow-y-auto",
|
|
11230
|
+
style: badge == null ? TRANSCRIPT_EDGE_FADE : TRANSCRIPT_EDGE_FADE_WITH_BADGE,
|
|
11231
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
11232
|
+
ref: transcriptContentRef,
|
|
11233
|
+
children: [children, typing ? /* @__PURE__ */ jsxs("p", {
|
|
11234
|
+
"data-testid": "widget-typing-indicator",
|
|
11235
|
+
className: "flex items-center gap-1 px-1 py-1 text-[var(--widget-foreground-muted)]",
|
|
11236
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
11237
|
+
className: "sr-only",
|
|
11238
|
+
children: defaultWidgetMessages.typing
|
|
11239
|
+
}), [
|
|
11240
|
+
0,
|
|
11241
|
+
1,
|
|
11242
|
+
2
|
|
11243
|
+
].map((i) => /* @__PURE__ */ jsx("span", {
|
|
11244
|
+
"aria-hidden": "true",
|
|
11245
|
+
className: "h-1.5 w-1.5 animate-bounce rounded-full bg-current motion-reduce:animate-none",
|
|
11246
|
+
style: {
|
|
11247
|
+
animationDelay: `${i * 140}ms`,
|
|
11248
|
+
animationDuration: "1s"
|
|
11249
|
+
}
|
|
11250
|
+
}, i))]
|
|
11251
|
+
}) : null]
|
|
11252
|
+
})
|
|
11253
|
+
}),
|
|
11254
|
+
/* @__PURE__ */ jsx("div", {
|
|
11255
|
+
"aria-hidden": true,
|
|
11256
|
+
className: "pointer-events-none absolute inset-x-0 bottom-0 z-10 bg-[linear-gradient(to_bottom,transparent,var(--widget-card)_38%,var(--widget-card))]",
|
|
11257
|
+
style: { height: COMPOSER_GROUND_LEN }
|
|
11258
|
+
}),
|
|
11259
|
+
/* @__PURE__ */ jsx("div", {
|
|
11260
|
+
className: "pointer-events-none absolute inset-x-0 z-20 flex justify-center",
|
|
11261
|
+
style: { bottom: voice ? COMPOSER_BOTTOM_LEN : COMPOSER_BOTTOM_NO_VOICE_LEN },
|
|
11262
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
11263
|
+
className: cn("flex w-[71%] flex-col items-center gap-2.5", open ? "pointer-events-auto" : "pointer-events-none"),
|
|
11264
|
+
style: { maxWidth: COMPOSER_MAX_WIDTH_LEN },
|
|
11265
|
+
children: [/* @__PURE__ */ jsxs("form", {
|
|
11266
|
+
className: "flex w-full items-center gap-2",
|
|
11267
|
+
onSubmit: submit,
|
|
11268
|
+
children: [composerLeading, /* @__PURE__ */ jsxs("div", {
|
|
11269
|
+
className: "relative flex-1",
|
|
11270
|
+
children: [
|
|
11271
|
+
/* @__PURE__ */ jsx("label", {
|
|
11272
|
+
htmlFor: inputId,
|
|
11273
|
+
className: "sr-only",
|
|
11274
|
+
children: labels.composerPlaceholder
|
|
11275
|
+
}),
|
|
11276
|
+
/* @__PURE__ */ jsx("input", {
|
|
11277
|
+
id: inputId,
|
|
11278
|
+
"data-testid": testIds?.input,
|
|
11279
|
+
value: draft,
|
|
11280
|
+
onChange: (e) => onDraftChange(e.target.value),
|
|
11281
|
+
placeholder: labels.composerPlaceholder,
|
|
11282
|
+
dir: "auto",
|
|
11283
|
+
disabled: composerDisabled,
|
|
11284
|
+
className: cn("border-brand-plum/12 h-[40px] w-full rounded-3xl border bg-[var(--widget-chip)] ps-4 pe-12 text-[14px] text-[var(--widget-foreground)] placeholder:text-[var(--widget-foreground-muted)]", "focus:border-brand-plum/30 focus:ring-brand-plum/15 transition-[border-color] focus:bg-[var(--widget-bubble)] focus:ring-2 focus:outline-none disabled:opacity-50", inCall && draft === "" && "opacity-60 focus:opacity-100")
|
|
11285
|
+
}),
|
|
11286
|
+
draft.trim() && /* @__PURE__ */ jsx("button", {
|
|
11287
|
+
type: "submit",
|
|
11288
|
+
"aria-label": labels.send,
|
|
11289
|
+
"data-testid": testIds?.send,
|
|
11290
|
+
disabled: composerDisabled,
|
|
11291
|
+
className: "from-brand-plum to-brand-rose text-[var(--widget-accent-foreground)] absolute end-2 top-1/2 flex size-9 -translate-y-1/2 items-center justify-center rounded-full bg-gradient-to-br transition-[transform,opacity] hover:scale-105 disabled:opacity-40",
|
|
11292
|
+
children: /* @__PURE__ */ jsx(Send, { className: "size-4 rtl:-scale-x-100" })
|
|
11293
|
+
})
|
|
11294
|
+
]
|
|
11295
|
+
})]
|
|
11296
|
+
}), voice ? /* @__PURE__ */ jsxs("div", {
|
|
11297
|
+
className: "mt-1 flex items-center gap-3",
|
|
10932
11298
|
children: [
|
|
10933
|
-
/* @__PURE__ */ jsx("
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
11299
|
+
/* @__PURE__ */ jsx("button", {
|
|
11300
|
+
type: "button",
|
|
11301
|
+
onClick: connecting ? void 0 : inCall ? voice.onToggleMute ?? voice.onStart : voice.onStart,
|
|
11302
|
+
disabled: micUnusable || connecting,
|
|
11303
|
+
"data-testid": testIds?.mic,
|
|
11304
|
+
title: micLabel,
|
|
11305
|
+
"aria-label": micLabel,
|
|
11306
|
+
...connecting ? { "aria-busy": true } : {},
|
|
11307
|
+
...inCall && !connecting ? { "aria-pressed": voice.muted ?? false } : {},
|
|
11308
|
+
className: cn("from-brand-plum to-brand-rose text-[var(--widget-accent-foreground)] flex size-12 shrink-0 items-center justify-center rounded-full bg-gradient-to-br transition-[transform,opacity]", micUnusable ? "cursor-not-allowed opacity-40" : connecting ? "cursor-wait" : cn("hover:scale-105 focus-visible:ring-2 focus-visible:ring-white/50 focus-visible:outline-none", "shadow-[0_0_0_1px_color-mix(in_oklab,var(--brand-plum)_18%,transparent),0_4px_14px_-2px_color-mix(in_oklab,var(--brand-plum)_45%,transparent),0_0_22px_-4px_color-mix(in_oklab,var(--brand-rose)_40%,transparent)]", "hover:shadow-[0_0_0_1px_color-mix(in_oklab,var(--brand-plum)_26%,transparent),0_6px_18px_-2px_color-mix(in_oklab,var(--brand-plum)_60%,transparent),0_0_30px_-4px_color-mix(in_oklab,var(--brand-rose)_55%,transparent)]"), inCall && !connecting && voice.muted !== true && "ring-brand-rose/50 ring-4"),
|
|
11309
|
+
children: connecting ? /* @__PURE__ */ jsx("span", {
|
|
11310
|
+
"aria-hidden": "true",
|
|
11311
|
+
"data-testid": "widget-mic-spinner",
|
|
11312
|
+
className: "flex items-center justify-center",
|
|
11313
|
+
children: /* @__PURE__ */ jsx(MorphingLoader, {
|
|
11314
|
+
size: "md",
|
|
11315
|
+
variant: "light",
|
|
11316
|
+
label: connectingLabel
|
|
11317
|
+
})
|
|
11318
|
+
}) : inCall && voice.muted === true ? /* @__PURE__ */ jsx(MicOff, { className: "size-5" }) : /* @__PURE__ */ jsx(Mic, { className: "size-5" })
|
|
10937
11319
|
}),
|
|
10938
|
-
/* @__PURE__ */ jsx("
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
"
|
|
10951
|
-
"
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
11320
|
+
inCall && voice.agentSpeaking === true && voice.onInterrupt !== void 0 ? /* @__PURE__ */ jsx("button", {
|
|
11321
|
+
type: "button",
|
|
11322
|
+
onClick: () => voice.onInterrupt?.("tap"),
|
|
11323
|
+
"data-testid": "widget-interrupt",
|
|
11324
|
+
title: voice.labels.interrupt ?? "",
|
|
11325
|
+
"aria-label": voice.labels.interrupt ?? "",
|
|
11326
|
+
className: cn("flex size-10 shrink-0 items-center justify-center rounded-full bg-[var(--widget-chip)] text-[var(--widget-foreground)] transition-colors", "hover:bg-[var(--widget-bubble)] focus-visible:ring-2 focus-visible:ring-[var(--widget-accent-ring)] focus-visible:outline-none"),
|
|
11327
|
+
children: /* @__PURE__ */ jsx(Square, { className: "size-4" })
|
|
11328
|
+
}) : null,
|
|
11329
|
+
voice.phase === "blocked" && voice.onFixPermission !== void 0 ? /* @__PURE__ */ jsx("button", {
|
|
11330
|
+
type: "button",
|
|
11331
|
+
onClick: voice.onFixPermission,
|
|
11332
|
+
"data-testid": "widget-fix-permission",
|
|
11333
|
+
className: cn("shrink-0 rounded-full bg-[var(--widget-chip)] px-3 py-2 text-xs font-medium text-[var(--widget-foreground)] transition-colors", "hover:bg-[var(--widget-bubble)] focus-visible:ring-2 focus-visible:ring-[var(--widget-accent-ring)] focus-visible:outline-none"),
|
|
11334
|
+
children: voice.labels.fixBrowser ?? defaultWidgetMessages.dock_fix_browser
|
|
11335
|
+
}) : null,
|
|
11336
|
+
inCall && voice.onEnd !== void 0 ? /* @__PURE__ */ jsx("button", {
|
|
11337
|
+
type: "button",
|
|
11338
|
+
onClick: voice.onEnd,
|
|
11339
|
+
"data-testid": testIds?.endCall,
|
|
11340
|
+
title: voice.labels.end ?? "",
|
|
11341
|
+
"aria-label": voice.labels.end ?? "",
|
|
11342
|
+
className: cn("bg-destructive/10 text-destructive hover:bg-destructive/20 flex size-10 shrink-0 items-center justify-center rounded-full transition-colors", "focus-visible:ring-destructive/30 focus-visible:ring-2 focus-visible:outline-none"),
|
|
11343
|
+
children: /* @__PURE__ */ jsx(PhoneOff, { className: "size-4" })
|
|
11344
|
+
}) : null
|
|
10956
11345
|
]
|
|
10957
|
-
})]
|
|
10958
|
-
}), voice ? /* @__PURE__ */ jsxs("div", {
|
|
10959
|
-
className: "mt-1 flex items-center gap-3",
|
|
10960
|
-
children: [/* @__PURE__ */ jsx("button", {
|
|
10961
|
-
type: "button",
|
|
10962
|
-
onClick: connecting ? void 0 : inCall ? voice.onToggleMute ?? voice.onStart : voice.onStart,
|
|
10963
|
-
disabled: micUnusable || connecting,
|
|
10964
|
-
"data-testid": testIds?.mic,
|
|
10965
|
-
title: micLabel,
|
|
10966
|
-
"aria-label": micLabel,
|
|
10967
|
-
...connecting ? { "aria-busy": true } : {},
|
|
10968
|
-
...inCall && !connecting ? { "aria-pressed": voice.muted ?? false } : {},
|
|
10969
|
-
className: cn("from-brand-plum to-brand-rose text-[var(--widget-accent-foreground)] flex size-12 shrink-0 items-center justify-center rounded-full bg-gradient-to-br transition-[transform,opacity]", micUnusable ? "cursor-not-allowed opacity-40" : connecting ? "cursor-wait" : cn("hover:scale-105 focus-visible:ring-2 focus-visible:ring-white/50 focus-visible:outline-none", "shadow-[0_0_0_1px_color-mix(in_oklab,var(--brand-plum)_18%,transparent),0_4px_14px_-2px_color-mix(in_oklab,var(--brand-plum)_45%,transparent),0_0_22px_-4px_color-mix(in_oklab,var(--brand-rose)_40%,transparent)]", "hover:shadow-[0_0_0_1px_color-mix(in_oklab,var(--brand-plum)_26%,transparent),0_6px_18px_-2px_color-mix(in_oklab,var(--brand-plum)_60%,transparent),0_0_30px_-4px_color-mix(in_oklab,var(--brand-rose)_55%,transparent)]"), inCall && !connecting && voice.muted !== true && "ring-brand-rose/50 ring-4"),
|
|
10970
|
-
children: connecting ? /* @__PURE__ */ jsx("span", {
|
|
10971
|
-
"aria-hidden": "true",
|
|
10972
|
-
"data-testid": "widget-mic-spinner",
|
|
10973
|
-
className: "flex items-center justify-center",
|
|
10974
|
-
children: /* @__PURE__ */ jsx(MorphingLoader, {
|
|
10975
|
-
size: "md",
|
|
10976
|
-
variant: "light",
|
|
10977
|
-
label: connectingLabel
|
|
10978
|
-
})
|
|
10979
|
-
}) : inCall && voice.muted === true ? /* @__PURE__ */ jsx(MicOff, { className: "size-5" }) : /* @__PURE__ */ jsx(Mic, { className: "size-5" })
|
|
10980
|
-
}), inCall && voice.onEnd !== void 0 ? /* @__PURE__ */ jsx("button", {
|
|
10981
|
-
type: "button",
|
|
10982
|
-
onClick: voice.onEnd,
|
|
10983
|
-
"data-testid": testIds?.endCall,
|
|
10984
|
-
title: voice.labels.end ?? "",
|
|
10985
|
-
"aria-label": voice.labels.end ?? "",
|
|
10986
|
-
className: cn("bg-destructive/10 text-destructive hover:bg-destructive/20 flex size-10 shrink-0 items-center justify-center rounded-full transition-colors", "focus-visible:ring-destructive/30 focus-visible:ring-2 focus-visible:outline-none"),
|
|
10987
|
-
children: /* @__PURE__ */ jsx(PhoneOff, { className: "size-4" })
|
|
10988
11346
|
}) : null]
|
|
10989
|
-
})
|
|
11347
|
+
})
|
|
10990
11348
|
})
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11349
|
+
]
|
|
11350
|
+
})
|
|
11351
|
+
]
|
|
11352
|
+
})
|
|
11353
|
+
]
|
|
11354
|
+
}),
|
|
11355
|
+
attribution ? /* @__PURE__ */ jsxs("a", {
|
|
11356
|
+
href: attribution.href,
|
|
11357
|
+
target: "_blank",
|
|
11358
|
+
rel: "noopener noreferrer",
|
|
11359
|
+
"data-testid": "widget-branding",
|
|
11360
|
+
className: cn("absolute top-full left-1/2 mt-2 inline-flex -translate-x-1/2 items-center gap-1.5 whitespace-nowrap text-xs transition-opacity duration-300", open ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0"),
|
|
11361
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
11362
|
+
"aria-hidden": true,
|
|
11363
|
+
className: "size-2.5 rounded-full bg-gradient-to-br from-brand-rose to-brand-amber"
|
|
11364
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
11365
|
+
className: "text-brand-plum font-semibold tracking-tight",
|
|
11366
|
+
children: attribution.name
|
|
11367
|
+
})]
|
|
11368
|
+
}) : null,
|
|
11369
|
+
privacyChoices ? /* @__PURE__ */ jsx("button", {
|
|
11370
|
+
type: "button",
|
|
11371
|
+
onClick: privacyChoices.open,
|
|
11372
|
+
"data-testid": "widget-privacy-choices",
|
|
11373
|
+
className: cn("absolute top-full right-0 mt-2 text-xs underline transition-opacity duration-300", open ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0"),
|
|
11374
|
+
children: privacyChoices.label
|
|
11375
|
+
}) : null
|
|
11376
|
+
]
|
|
11011
11377
|
})
|
|
11012
11378
|
}),
|
|
11013
11379
|
portalActive && /* @__PURE__ */ jsx("div", {
|
|
@@ -11031,6 +11397,244 @@ function ConciergeShell({ open, onOpenChange, state, messageArrived = false, ava
|
|
|
11031
11397
|
});
|
|
11032
11398
|
}
|
|
11033
11399
|
//#endregion
|
|
11400
|
+
//#region src/widget/widget-view.ts
|
|
11401
|
+
/** Every launcher field off — the shape most states return. */
|
|
11402
|
+
var QUIET_LAUNCHER = {
|
|
11403
|
+
busy: false,
|
|
11404
|
+
dimmed: false,
|
|
11405
|
+
disabled: false,
|
|
11406
|
+
badge: false,
|
|
11407
|
+
initials: false
|
|
11408
|
+
};
|
|
11409
|
+
/**
|
|
11410
|
+
* The widget's presentation of a state the shared machine already decided.
|
|
11411
|
+
*
|
|
11412
|
+
* @param snapshot the state and the shared facts — see {@link ConciergeSnapshot}
|
|
11413
|
+
* @param input the session, read for CONTENT only (a partial transcript, an
|
|
11414
|
+
* operator's line, the host's error text) — never to decide the state
|
|
11415
|
+
*/
|
|
11416
|
+
function deriveWidgetView(snapshot, input) {
|
|
11417
|
+
const { state } = snapshot;
|
|
11418
|
+
const shared = {
|
|
11419
|
+
state,
|
|
11420
|
+
handoff: snapshot.handoff,
|
|
11421
|
+
callActive: snapshot.callActive,
|
|
11422
|
+
shelfCount: snapshot.shelfCount
|
|
11423
|
+
};
|
|
11424
|
+
const text = (value) => value !== void 0 && value !== "" ? {
|
|
11425
|
+
kind: "text",
|
|
11426
|
+
text: value
|
|
11427
|
+
} : null;
|
|
11428
|
+
switch (state) {
|
|
11429
|
+
case "dormant": return {
|
|
11430
|
+
...shared,
|
|
11431
|
+
avatar: "idle",
|
|
11432
|
+
launcher: QUIET_LAUNCHER,
|
|
11433
|
+
announce: false,
|
|
11434
|
+
typing: false,
|
|
11435
|
+
interrupt: false,
|
|
11436
|
+
panel: "as-is",
|
|
11437
|
+
status: null,
|
|
11438
|
+
composerDisabled: false
|
|
11439
|
+
};
|
|
11440
|
+
case "connecting": return {
|
|
11441
|
+
...shared,
|
|
11442
|
+
avatar: "thinking",
|
|
11443
|
+
launcher: {
|
|
11444
|
+
...QUIET_LAUNCHER,
|
|
11445
|
+
busy: true
|
|
11446
|
+
},
|
|
11447
|
+
announce: false,
|
|
11448
|
+
typing: false,
|
|
11449
|
+
interrupt: false,
|
|
11450
|
+
panel: "as-is",
|
|
11451
|
+
status: {
|
|
11452
|
+
kind: "message",
|
|
11453
|
+
key: "dock_connecting"
|
|
11454
|
+
},
|
|
11455
|
+
composerDisabled: false
|
|
11456
|
+
};
|
|
11457
|
+
case "listening": return {
|
|
11458
|
+
...shared,
|
|
11459
|
+
avatar: "listening",
|
|
11460
|
+
launcher: QUIET_LAUNCHER,
|
|
11461
|
+
announce: false,
|
|
11462
|
+
typing: false,
|
|
11463
|
+
interrupt: false,
|
|
11464
|
+
panel: "as-is",
|
|
11465
|
+
status: text(input.partialTranscript) ?? {
|
|
11466
|
+
kind: "message",
|
|
11467
|
+
key: "dock_listening"
|
|
11468
|
+
},
|
|
11469
|
+
composerDisabled: false
|
|
11470
|
+
};
|
|
11471
|
+
case "thinking": return {
|
|
11472
|
+
...shared,
|
|
11473
|
+
avatar: "thinking",
|
|
11474
|
+
launcher: QUIET_LAUNCHER,
|
|
11475
|
+
announce: false,
|
|
11476
|
+
typing: false,
|
|
11477
|
+
interrupt: false,
|
|
11478
|
+
panel: "as-is",
|
|
11479
|
+
status: text(input.preamble) ?? {
|
|
11480
|
+
kind: "message",
|
|
11481
|
+
key: "dock_thinking"
|
|
11482
|
+
},
|
|
11483
|
+
composerDisabled: false
|
|
11484
|
+
};
|
|
11485
|
+
case "speaking": return {
|
|
11486
|
+
...shared,
|
|
11487
|
+
avatar: "speaking",
|
|
11488
|
+
launcher: QUIET_LAUNCHER,
|
|
11489
|
+
announce: false,
|
|
11490
|
+
typing: false,
|
|
11491
|
+
interrupt: true,
|
|
11492
|
+
panel: "as-is",
|
|
11493
|
+
status: text(input.clause) ?? {
|
|
11494
|
+
kind: "message",
|
|
11495
|
+
key: "dock_thinking"
|
|
11496
|
+
},
|
|
11497
|
+
composerDisabled: false
|
|
11498
|
+
};
|
|
11499
|
+
case "ducked": return {
|
|
11500
|
+
...shared,
|
|
11501
|
+
avatar: "idle",
|
|
11502
|
+
launcher: {
|
|
11503
|
+
...QUIET_LAUNCHER,
|
|
11504
|
+
dimmed: true
|
|
11505
|
+
},
|
|
11506
|
+
announce: false,
|
|
11507
|
+
typing: false,
|
|
11508
|
+
interrupt: false,
|
|
11509
|
+
panel: "as-is",
|
|
11510
|
+
status: {
|
|
11511
|
+
kind: "message",
|
|
11512
|
+
key: "dock_ducked"
|
|
11513
|
+
},
|
|
11514
|
+
composerDisabled: false
|
|
11515
|
+
};
|
|
11516
|
+
case "reconnecting": return {
|
|
11517
|
+
...shared,
|
|
11518
|
+
avatar: "idle",
|
|
11519
|
+
launcher: {
|
|
11520
|
+
...QUIET_LAUNCHER,
|
|
11521
|
+
badge: true
|
|
11522
|
+
},
|
|
11523
|
+
announce: true,
|
|
11524
|
+
typing: false,
|
|
11525
|
+
interrupt: false,
|
|
11526
|
+
panel: "as-is",
|
|
11527
|
+
status: {
|
|
11528
|
+
kind: "message",
|
|
11529
|
+
key: input.roomDropped ? "dock_still_here_resume" : "dock_still_here"
|
|
11530
|
+
},
|
|
11531
|
+
composerDisabled: false
|
|
11532
|
+
};
|
|
11533
|
+
case "muted": return {
|
|
11534
|
+
...shared,
|
|
11535
|
+
avatar: "idle",
|
|
11536
|
+
launcher: QUIET_LAUNCHER,
|
|
11537
|
+
announce: true,
|
|
11538
|
+
typing: false,
|
|
11539
|
+
interrupt: false,
|
|
11540
|
+
panel: "as-is",
|
|
11541
|
+
status: {
|
|
11542
|
+
kind: "message",
|
|
11543
|
+
key: "dock_muted"
|
|
11544
|
+
},
|
|
11545
|
+
composerDisabled: false
|
|
11546
|
+
};
|
|
11547
|
+
case "mic_blocked": return {
|
|
11548
|
+
...shared,
|
|
11549
|
+
avatar: "idle",
|
|
11550
|
+
launcher: QUIET_LAUNCHER,
|
|
11551
|
+
announce: true,
|
|
11552
|
+
typing: false,
|
|
11553
|
+
interrupt: false,
|
|
11554
|
+
panel: "as-is",
|
|
11555
|
+
status: {
|
|
11556
|
+
kind: "message",
|
|
11557
|
+
key: "dock_mic_blocked"
|
|
11558
|
+
},
|
|
11559
|
+
composerDisabled: false
|
|
11560
|
+
};
|
|
11561
|
+
case "typing": return {
|
|
11562
|
+
...shared,
|
|
11563
|
+
avatar: "idle",
|
|
11564
|
+
launcher: QUIET_LAUNCHER,
|
|
11565
|
+
announce: false,
|
|
11566
|
+
typing: input.composing,
|
|
11567
|
+
interrupt: false,
|
|
11568
|
+
panel: "as-is",
|
|
11569
|
+
status: null,
|
|
11570
|
+
composerDisabled: false
|
|
11571
|
+
};
|
|
11572
|
+
case "human": return {
|
|
11573
|
+
...shared,
|
|
11574
|
+
avatar: "idle",
|
|
11575
|
+
launcher: {
|
|
11576
|
+
...QUIET_LAUNCHER,
|
|
11577
|
+
initials: true
|
|
11578
|
+
},
|
|
11579
|
+
announce: true,
|
|
11580
|
+
typing: input.composing,
|
|
11581
|
+
interrupt: false,
|
|
11582
|
+
panel: "as-is",
|
|
11583
|
+
status: text(input.operatorLine) ?? {
|
|
11584
|
+
kind: "message",
|
|
11585
|
+
key: "escalated_banner"
|
|
11586
|
+
},
|
|
11587
|
+
composerDisabled: false
|
|
11588
|
+
};
|
|
11589
|
+
case "offline": return {
|
|
11590
|
+
...shared,
|
|
11591
|
+
avatar: "idle",
|
|
11592
|
+
launcher: {
|
|
11593
|
+
...QUIET_LAUNCHER,
|
|
11594
|
+
disabled: true
|
|
11595
|
+
},
|
|
11596
|
+
announce: true,
|
|
11597
|
+
typing: false,
|
|
11598
|
+
interrupt: false,
|
|
11599
|
+
panel: "as-is",
|
|
11600
|
+
status: text(input.offlineMessage),
|
|
11601
|
+
composerDisabled: true
|
|
11602
|
+
};
|
|
11603
|
+
case "error": return {
|
|
11604
|
+
...shared,
|
|
11605
|
+
avatar: "idle",
|
|
11606
|
+
launcher: QUIET_LAUNCHER,
|
|
11607
|
+
announce: true,
|
|
11608
|
+
typing: false,
|
|
11609
|
+
interrupt: false,
|
|
11610
|
+
panel: "as-is",
|
|
11611
|
+
status: input.errorSource === "voice" && input.voice.enabled && input.voice.phase === "failed" ? {
|
|
11612
|
+
kind: "message",
|
|
11613
|
+
key: "dock_voice_failed"
|
|
11614
|
+
} : text(input.error),
|
|
11615
|
+
composerDisabled: false
|
|
11616
|
+
};
|
|
11617
|
+
case "cards": return {
|
|
11618
|
+
...shared,
|
|
11619
|
+
avatar: "idle",
|
|
11620
|
+
launcher: {
|
|
11621
|
+
...QUIET_LAUNCHER,
|
|
11622
|
+
badge: true
|
|
11623
|
+
},
|
|
11624
|
+
announce: false,
|
|
11625
|
+
typing: false,
|
|
11626
|
+
interrupt: false,
|
|
11627
|
+
panel: "as-is",
|
|
11628
|
+
status: {
|
|
11629
|
+
kind: "message",
|
|
11630
|
+
key: "dock_cards"
|
|
11631
|
+
},
|
|
11632
|
+
composerDisabled: false
|
|
11633
|
+
};
|
|
11634
|
+
}
|
|
11635
|
+
throw new TypeError(`Unknown concierge state: ${JSON.stringify(state)}`);
|
|
11636
|
+
}
|
|
11637
|
+
//#endregion
|
|
11034
11638
|
//#region src/widget/shell-renderer.tsx
|
|
11035
11639
|
/**
|
|
11036
11640
|
* The widget — launcher and panel — as a `ConciergeRenderer`
|
|
@@ -11053,7 +11657,7 @@ function positionFor(dock) {
|
|
|
11053
11657
|
const align = dock?.layout?.desktopAlign;
|
|
11054
11658
|
return align === "left" || align === "right" ? `bottom-${align}` : DEFAULT_CONCIERGE_POSITION;
|
|
11055
11659
|
}
|
|
11056
|
-
function ShellRenderer({
|
|
11660
|
+
function ShellRenderer({ turns, showMic, callPhase, micOpen, onToggleMic, onEndCall, statusKind, statusLine, escalated, operatorName, humanTyping, composing, channel, draft, onDraftChange, submit, attaching, onAttach, attachInput, transcript, extras, messages, skinStyle, avatar, attribution, privacyChoices, voice: derivedVoice, dock }) {
|
|
11057
11661
|
const [open, setOpen] = useState(dock?.initialMinimised === false);
|
|
11058
11662
|
const onReady = dock?.onReady;
|
|
11059
11663
|
useLayoutEffect(() => {
|
|
@@ -11062,14 +11666,106 @@ function ShellRenderer({ state, turns, showMic, callPhase, micOpen, onToggleMic,
|
|
|
11062
11666
|
const [position, setPosition] = useState(() => positionFor(dock));
|
|
11063
11667
|
const draggable = dock?.layout?.draggable !== false;
|
|
11064
11668
|
const launcherLabel = dock?.copy?.minimisedLabel?.trim();
|
|
11669
|
+
/**
|
|
11670
|
+
* The host's voice bag, merged the same way `DockRenderer` merges it: the
|
|
11671
|
+
* conversation derives the PHASE fields (`agentSpeaking`, `micOpen` …) and
|
|
11672
|
+
* the host supplies the CALLBACKS (`onInterrupt`, `onFixPermission`) on
|
|
11673
|
+
* `dock.voice`. A renderer that read only the derived half would draw a
|
|
11674
|
+
* control the host never gets told about.
|
|
11675
|
+
*/
|
|
11676
|
+
const voiceInput = {
|
|
11677
|
+
...derivedVoice,
|
|
11678
|
+
...dock?.voice ?? {}
|
|
11679
|
+
};
|
|
11065
11680
|
const voiceUnavailable = showMic && escalated ? messages.voice_unavailable_escalated : void 0;
|
|
11066
11681
|
const lastTurn = turns[turns.length - 1];
|
|
11682
|
+
/**
|
|
11683
|
+
* The SAME state machine the dock runs (docs/CONCIERGE_GENERATIONS.md §2:
|
|
11684
|
+
* one state, two presentations). `Dock` builds a `DockStateInput` from its
|
|
11685
|
+
* props and calls `deriveDockState`; this is that, in the widget's terms.
|
|
11686
|
+
*
|
|
11687
|
+
* Two fields the dock reads from its own internals rather than from props,
|
|
11688
|
+
* answered here the widget's way:
|
|
11689
|
+
*
|
|
11690
|
+
* - `engaged` — the dock tracks a row that has been woken. The widget's
|
|
11691
|
+
* equivalent is a panel the shopper opened, or a call that is running.
|
|
11692
|
+
* - `sheetOpen` — the dock's sheet is the widget's panel.
|
|
11693
|
+
*
|
|
11694
|
+
* And two the widget does not have yet: `ducked` and `textIdle` are timers
|
|
11695
|
+
* the dock runs to recede its row. The widget has no row, and §4's answer —
|
|
11696
|
+
* the launcher dims — is a row of its own with its own timer; until that
|
|
11697
|
+
* lands, the widget never ducks, which is visible here rather than hidden
|
|
11698
|
+
* behind a prop that silently reads `false`.
|
|
11699
|
+
*/
|
|
11700
|
+
const stateInput = useMemo(() => ({
|
|
11701
|
+
...idleConciergeInput,
|
|
11702
|
+
engaged: open || callPhase !== "idle",
|
|
11703
|
+
voice: {
|
|
11704
|
+
enabled: voiceInput.enabled === true,
|
|
11705
|
+
phase: voiceInput.phase ?? "idle",
|
|
11706
|
+
micOpen: voiceInput.micOpen === true,
|
|
11707
|
+
micPending: voiceInput.micPending === true,
|
|
11708
|
+
micBlocked: voiceInput.micBlocked === true,
|
|
11709
|
+
agentPresent: voiceInput.agentPresent === true,
|
|
11710
|
+
agentSpeaking: voiceInput.agentSpeaking === true,
|
|
11711
|
+
callerSpeaking: voiceInput.callerSpeaking === true,
|
|
11712
|
+
awaitingAgent: voiceInput.awaitingAgent === true
|
|
11713
|
+
},
|
|
11714
|
+
draft,
|
|
11715
|
+
escalated,
|
|
11716
|
+
canAttach: onAttach !== void 0,
|
|
11717
|
+
canFixPermission: voiceInput.onFixPermission !== void 0,
|
|
11718
|
+
offline: dock?.offline === true,
|
|
11719
|
+
reconnecting: dock?.reconnecting === true,
|
|
11720
|
+
roomDropped: dock?.roomDropped === true,
|
|
11721
|
+
sheetOpen: open,
|
|
11722
|
+
shelfCount: dock?.shelf?.items.length ?? 0,
|
|
11723
|
+
hasTranscript: turns.length > 0,
|
|
11724
|
+
channel,
|
|
11725
|
+
composing,
|
|
11726
|
+
...operatorName !== void 0 ? { operatorLine: operatorName } : {},
|
|
11727
|
+
...dock?.copy?.offlineMessage !== void 0 ? { offlineMessage: dock.copy.offlineMessage } : {},
|
|
11728
|
+
...statusLine !== void 0 && statusLine !== "" ? {
|
|
11729
|
+
error: statusLine,
|
|
11730
|
+
...statusKind !== void 0 ? { errorSource: statusKind } : {}
|
|
11731
|
+
} : {},
|
|
11732
|
+
...dock?.partialTranscript !== void 0 ? { partialTranscript: dock.partialTranscript } : {},
|
|
11733
|
+
...dock?.preamble !== void 0 ? { preamble: dock.preamble } : {},
|
|
11734
|
+
...dock?.clause !== void 0 ? { clause: dock.clause } : {}
|
|
11735
|
+
}), [
|
|
11736
|
+
open,
|
|
11737
|
+
callPhase,
|
|
11738
|
+
voiceInput,
|
|
11739
|
+
draft,
|
|
11740
|
+
escalated,
|
|
11741
|
+
onAttach,
|
|
11742
|
+
dock,
|
|
11743
|
+
turns.length,
|
|
11744
|
+
channel,
|
|
11745
|
+
composing,
|
|
11746
|
+
operatorName,
|
|
11747
|
+
statusLine,
|
|
11748
|
+
statusKind
|
|
11749
|
+
]);
|
|
11750
|
+
const view = useMemo(() => deriveWidgetView(deriveConciergeState(stateInput), stateInput), [stateInput]);
|
|
11751
|
+
/**
|
|
11752
|
+
* The status line in the shopper's own language. The view decides WHICH
|
|
11753
|
+
* line, never its words: a `text` status is the host's own string (a
|
|
11754
|
+
* partial transcript, an operator's line, an error) and a `message` status
|
|
11755
|
+
* is a key into the tenant's catalogue. Same split the dock's
|
|
11756
|
+
* `resolveCaption` makes, for the same reason — a renderer that invented
|
|
11757
|
+
* copy would need translating twice.
|
|
11758
|
+
*/
|
|
11759
|
+
const statusText = view.status === null ? void 0 : view.status.kind === "text" ? view.status.text : messages[view.status.key] ?? void 0;
|
|
11067
11760
|
const voice = showMic ? {
|
|
11068
11761
|
phase: callPhase,
|
|
11069
11762
|
onStart: onToggleMic,
|
|
11070
11763
|
...onEndCall !== void 0 ? { onEnd: onEndCall } : {},
|
|
11071
11764
|
onToggleMute: onToggleMic,
|
|
11072
11765
|
muted: !micOpen,
|
|
11766
|
+
agentSpeaking: view.interrupt,
|
|
11767
|
+
...voiceInput.onInterrupt !== void 0 ? { onInterrupt: voiceInput.onInterrupt } : {},
|
|
11768
|
+
...voiceInput.onFixPermission !== void 0 ? { onFixPermission: voiceInput.onFixPermission } : {},
|
|
11073
11769
|
...voiceUnavailable !== void 0 ? { disabled: true } : {},
|
|
11074
11770
|
labels: {
|
|
11075
11771
|
start: messages.mic_start,
|
|
@@ -11077,6 +11773,7 @@ function ShellRenderer({ state, turns, showMic, callPhase, micOpen, onToggleMic,
|
|
|
11077
11773
|
mute: messages.mic_stop,
|
|
11078
11774
|
unmute: messages.mic_start,
|
|
11079
11775
|
connecting: messages.voice_state_connecting,
|
|
11776
|
+
...messages.dock_fix_browser !== void 0 ? { fixBrowser: messages.dock_fix_browser } : {},
|
|
11080
11777
|
listening: messages.voice_state_listening,
|
|
11081
11778
|
thinking: messages.voice_state_thinking,
|
|
11082
11779
|
speaking: messages.voice_state_speaking,
|
|
@@ -11109,16 +11806,22 @@ function ShellRenderer({ state, turns, showMic, callPhase, micOpen, onToggleMic,
|
|
|
11109
11806
|
return /* @__PURE__ */ jsxs(ConciergeShell, {
|
|
11110
11807
|
open,
|
|
11111
11808
|
onOpenChange: setOpen,
|
|
11112
|
-
state,
|
|
11809
|
+
state: view.avatar,
|
|
11113
11810
|
...skinStyle !== void 0 ? { skinStyle } : {},
|
|
11114
11811
|
...avatar !== void 0 ? { avatar } : {},
|
|
11115
11812
|
...attribution !== void 0 ? { attribution } : {},
|
|
11813
|
+
...privacyChoices !== void 0 ? { privacyChoices } : {},
|
|
11814
|
+
launcher: view.launcher,
|
|
11815
|
+
...view.handoff && operatorName !== void 0 ? { operatorName } : {},
|
|
11816
|
+
launcherInitials: view.launcher.initials ? handoffInitials(operatorName) : "",
|
|
11817
|
+
typing: view.typing,
|
|
11116
11818
|
messageArrived: lastTurn?.speaker === "caller",
|
|
11117
11819
|
idPrefix: "widget",
|
|
11118
11820
|
scrollKey: turns.length + (humanTyping ? 1 : 0),
|
|
11119
11821
|
draft,
|
|
11120
11822
|
onDraftChange,
|
|
11121
11823
|
onSubmit: submit,
|
|
11824
|
+
composerDisabled: view.composerDisabled,
|
|
11122
11825
|
position,
|
|
11123
11826
|
...draggable ? { onPositionChange: setPosition } : {},
|
|
11124
11827
|
labels: {
|
|
@@ -11132,10 +11835,14 @@ function ShellRenderer({ state, turns, showMic, callPhase, micOpen, onToggleMic,
|
|
|
11132
11835
|
},
|
|
11133
11836
|
...voice !== void 0 ? { voice } : {},
|
|
11134
11837
|
composerLeading,
|
|
11135
|
-
badge:
|
|
11838
|
+
badge: statusText === void 0 ? null : /* @__PURE__ */ jsx("p", {
|
|
11136
11839
|
"data-testid": "widget-status",
|
|
11840
|
+
...view.announce ? {
|
|
11841
|
+
role: "status",
|
|
11842
|
+
"aria-live": "polite"
|
|
11843
|
+
} : {},
|
|
11137
11844
|
className: "mt-1 max-w-full rounded-2xl bg-[var(--widget-chip)] px-2.5 py-1 text-center text-[10px] leading-snug font-semibold tracking-wide text-[var(--widget-foreground-muted)]",
|
|
11138
|
-
children:
|
|
11845
|
+
children: statusText
|
|
11139
11846
|
}),
|
|
11140
11847
|
testIds: {
|
|
11141
11848
|
trigger: "voice-widget-launcher",
|
|
@@ -11161,7 +11868,7 @@ function ShellRenderer({ state, turns, showMic, callPhase, micOpen, onToggleMic,
|
|
|
11161
11868
|
* Imported by `cdn/ui.ts` and by `rendererFor`; never by `voice-widget.tsx`,
|
|
11162
11869
|
* so a bundle built around the OTHER renderer does not carry this one.
|
|
11163
11870
|
*/
|
|
11164
|
-
function DockRenderer({ turns, lastTurn, operatorName, composing, onEndCall, voice, statusLine, statusKind, notice, escalated, humanTyping, draft, onDraftChange, submit, showBasket, cart, attaching, onAttach, attachInput, transcript, extras, messages, locale, navigate, curationHref, productHref, skinStyle, avatar, attribution, dock }) {
|
|
11871
|
+
function DockRenderer({ turns, lastTurn, operatorName, composing, onEndCall, voice, statusLine, statusKind, notice, escalated, humanTyping, draft, onDraftChange, submit, showBasket, cart, attaching, capturing, onAttach, attachInput, transcript, extras, messages, locale, navigate, curationHref, productHref, skinStyle, avatar, attribution, privacyChoices, dock }) {
|
|
11165
11872
|
return /* @__PURE__ */ jsx(Dock, {
|
|
11166
11873
|
identity: {
|
|
11167
11874
|
name: "",
|
|
@@ -11182,13 +11889,14 @@ function DockRenderer({ turns, lastTurn, operatorName, composing, onEndCall, voi
|
|
|
11182
11889
|
...onEndCall !== void 0 ? { onEndCall } : {},
|
|
11183
11890
|
...skinStyle !== void 0 ? { skinStyle } : {},
|
|
11184
11891
|
...attribution !== void 0 ? { attribution } : {},
|
|
11892
|
+
...privacyChoices !== void 0 ? { privacyChoices } : {},
|
|
11185
11893
|
...curationHref ? { curationHref } : {},
|
|
11186
11894
|
...productHref ? { productHref } : {},
|
|
11187
11895
|
...navigate ? { navigate } : {},
|
|
11188
11896
|
draft,
|
|
11189
11897
|
onDraftChange,
|
|
11190
11898
|
onSubmit: submit,
|
|
11191
|
-
revealSheet: showBasket && cart !== void 0 && cart.lines.length > 0 || attaching !== null,
|
|
11899
|
+
revealSheet: showBasket && cart !== void 0 && cart.lines.length > 0 || attaching !== null || capturing,
|
|
11192
11900
|
followKey: turns.reduce((n, turn) => n + 1 + turn.text.length + (turn.cards?.items.length ?? 0), 0) + (humanTyping ? 1 : 0),
|
|
11193
11901
|
...onAttach ? { onAttach } : {},
|
|
11194
11902
|
attachBusy: attaching !== null && !attaching.failed,
|
|
@@ -11795,6 +12503,10 @@ function CheckoutButton({ onCheckout, navigate, messages }) {
|
|
|
11795
12503
|
if (phase === "working") return;
|
|
11796
12504
|
setPhase("working");
|
|
11797
12505
|
const href = await onCheckout();
|
|
12506
|
+
if (href === false) {
|
|
12507
|
+
setPhase("idle");
|
|
12508
|
+
return;
|
|
12509
|
+
}
|
|
11798
12510
|
if (href === null) {
|
|
11799
12511
|
setPhase("failed");
|
|
11800
12512
|
return;
|
|
@@ -12227,7 +12939,7 @@ function VoiceWidget({ renderer, generation, ...props }) {
|
|
|
12227
12939
|
});
|
|
12228
12940
|
}
|
|
12229
12941
|
/** `VoiceWidget` with the renderer decided — the component the CDN entries and `ConciergeHost` use. */
|
|
12230
|
-
function VoiceWidgetWithRenderer({ renderer, state, turns, onToggleMic, onEndCall, callPhase = "idle", onSendText, micOpen, status, statusKind, notice, mode = "voice", escalated = false, humanTyping = false, onTyping, onAddToCart, onChooseOptions, chooseOptionsBusy = false, curationHref, productHref, onAttachFile, cart, messages = defaultWidgetMessages, navigate, locale = "en", skinStyle, avatar, attribution, dock }) {
|
|
12942
|
+
function VoiceWidgetWithRenderer({ renderer, state, turns, onToggleMic, onEndCall, callPhase = "idle", onSendText, micOpen, status, statusKind, notice, mode = "voice", escalated = false, humanTyping = false, onTyping, onAddToCart, onChooseOptions, chooseOptionsBusy = false, curationHref, productHref, onAttachFile, cart, captureCard, messages = defaultWidgetMessages, navigate, locale = "en", skinStyle, avatar, attribution, privacyChoices, dock }) {
|
|
12231
12943
|
const [draft, setDraft] = useState("");
|
|
12232
12944
|
const [sending, setSending] = useState(false);
|
|
12233
12945
|
/** Roomy mode — see the expand control in the header. Collapses back on close, so a reopened widget starts small. */
|
|
@@ -12496,20 +13208,24 @@ function VoiceWidgetWithRenderer({ renderer, state, turns, onToggleMic, onEndCal
|
|
|
12496
13208
|
onChange: (event) => void onFileSelected(event)
|
|
12497
13209
|
})] }) : null;
|
|
12498
13210
|
const onAttach = canAttach ? () => fileInputRef.current?.click() : void 0;
|
|
12499
|
-
const extras = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12500
|
-
|
|
12501
|
-
|
|
12502
|
-
|
|
12503
|
-
|
|
12504
|
-
|
|
12505
|
-
|
|
12506
|
-
|
|
12507
|
-
|
|
12508
|
-
|
|
12509
|
-
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
|
|
13211
|
+
const extras = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13212
|
+
cart && cart.lines.length > 0 && showBasket ? /* @__PURE__ */ jsx(WidgetCartSummary, {
|
|
13213
|
+
lines: cart.lines,
|
|
13214
|
+
subtotalMinor: cart.subtotalMinor,
|
|
13215
|
+
currency: cart.currency,
|
|
13216
|
+
...cart.discountMinor !== void 0 ? { discountMinor: cart.discountMinor } : {},
|
|
13217
|
+
onCheckout: cart.onCheckout,
|
|
13218
|
+
locale,
|
|
13219
|
+
messages,
|
|
13220
|
+
...navigate ? { navigate } : {}
|
|
13221
|
+
}) : null,
|
|
13222
|
+
captureCard,
|
|
13223
|
+
attaching ? /* @__PURE__ */ jsx("p", {
|
|
13224
|
+
role: "status",
|
|
13225
|
+
className: `text-xs ${attaching.failed ? "text-destructive" : "text-[var(--widget-foreground-muted)]"}`,
|
|
13226
|
+
children: attaching.failed ? formatMessage(messages.attach_error, { filename: attaching.filename }) : formatMessage(messages.attach_uploading, { filename: attaching.filename })
|
|
13227
|
+
}) : null
|
|
13228
|
+
] });
|
|
12513
13229
|
return /* @__PURE__ */ jsx(renderer, {
|
|
12514
13230
|
state,
|
|
12515
13231
|
turns,
|
|
@@ -12539,6 +13255,7 @@ function VoiceWidgetWithRenderer({ renderer, state, turns, onToggleMic, onEndCal
|
|
|
12539
13255
|
showBasket,
|
|
12540
13256
|
cart,
|
|
12541
13257
|
attaching,
|
|
13258
|
+
capturing: captureCard != null,
|
|
12542
13259
|
onAttach,
|
|
12543
13260
|
attachInput,
|
|
12544
13261
|
transcript: renderLog(turns),
|
|
@@ -12551,10 +13268,36 @@ function VoiceWidgetWithRenderer({ renderer, state, turns, onToggleMic, onEndCal
|
|
|
12551
13268
|
skinStyle,
|
|
12552
13269
|
avatar,
|
|
12553
13270
|
attribution,
|
|
13271
|
+
privacyChoices,
|
|
12554
13272
|
dock
|
|
12555
13273
|
});
|
|
12556
13274
|
}
|
|
12557
13275
|
//#endregion
|
|
13276
|
+
//#region src/flow-link.ts
|
|
13277
|
+
/** The query parameter a Flow message's link carries (`FLOW_LINK_PARAM` in the API). */
|
|
13278
|
+
var FLOW_LINK_PARAM = "wgt_flow";
|
|
13279
|
+
/**
|
|
13280
|
+
* A Flow message's conversation link (ADR 0021 D8). Taken off
|
|
13281
|
+
* the address bar so it is not shared or sent on as a referrer, and kept for
|
|
13282
|
+
* this tab so every later boot (the next page, the chat session when the dock
|
|
13283
|
+
* opens) asks for the same conversation. The token is opaque; the server
|
|
13284
|
+
* decides whether it opens anything.
|
|
13285
|
+
*/
|
|
13286
|
+
function takeFlowLink() {
|
|
13287
|
+
try {
|
|
13288
|
+
const url = new URL(location.href);
|
|
13289
|
+
let link = url.searchParams.get(FLOW_LINK_PARAM);
|
|
13290
|
+
if (link) {
|
|
13291
|
+
sessionStorage.setItem("wgt_flow_link", link);
|
|
13292
|
+
url.searchParams.delete(FLOW_LINK_PARAM);
|
|
13293
|
+
history.replaceState(history.state, "", url);
|
|
13294
|
+
} else link = sessionStorage.getItem("wgt_flow_link");
|
|
13295
|
+
return link ? { flowLink: link } : {};
|
|
13296
|
+
} catch {
|
|
13297
|
+
return {};
|
|
13298
|
+
}
|
|
13299
|
+
}
|
|
13300
|
+
//#endregion
|
|
12558
13301
|
//#region ../widget-bridge/dist/index.js
|
|
12559
13302
|
/**
|
|
12560
13303
|
* The subset of {@link VISITOR_EVENT_KIND_NAMES} that is BEHAVIOURAL tracking
|
|
@@ -12587,7 +13330,15 @@ var CONSENT_REQUIRED_VISITOR_EVENT_KINDS$1 = [
|
|
|
12587
13330
|
"collection.viewed",
|
|
12588
13331
|
"cart.viewed",
|
|
12589
13332
|
"cart.changed",
|
|
12590
|
-
"product.hovered"
|
|
13333
|
+
"product.hovered",
|
|
13334
|
+
"page.dwell",
|
|
13335
|
+
"form.started",
|
|
13336
|
+
"form.abandoned",
|
|
13337
|
+
"campaign.landed",
|
|
13338
|
+
"element.clicked",
|
|
13339
|
+
"form.submitted",
|
|
13340
|
+
"scheduler.booked",
|
|
13341
|
+
"visit.returned"
|
|
12591
13342
|
];
|
|
12592
13343
|
/** How long the ring stays on screen. Long enough to be seen, short enough not to become furniture. */
|
|
12593
13344
|
var SPOTLIGHT_RING_MS = 2e3;
|
|
@@ -13239,6 +13990,12 @@ function isSameOriginPath(value) {
|
|
|
13239
13990
|
return typeof value === "string" && SAME_ORIGIN_PATH_RE.test(value);
|
|
13240
13991
|
}
|
|
13241
13992
|
/**
|
|
13993
|
+
* `@saar-ai/widget-protocol`'s `CHECKOUT_CAPTURE_REQUIRED`, copied: importing
|
|
13994
|
+
* that module here would pull the card chunk's rules into `ui` (a test pins
|
|
13995
|
+
* the two together).
|
|
13996
|
+
*/
|
|
13997
|
+
var CHECKOUT_CAPTURE_REQUIRED = "CAPTURE_REQUIRED";
|
|
13998
|
+
/**
|
|
13242
13999
|
* Place a server-delivered turn by its `seq` rather than by when it arrived.
|
|
13243
14000
|
*
|
|
13244
14001
|
* `mergeIncoming` sorts within one delivered batch and then appends. A socket
|
|
@@ -13421,7 +14178,7 @@ function tokenTtlMs(res, expiresAtIso, clientNow) {
|
|
|
13421
14178
|
* proof") for why a bare `visitorId` is no longer trusted for rejoining.
|
|
13422
14179
|
*
|
|
13423
14180
|
* The client never MINTS a visitor id anymore — only the server does
|
|
13424
|
-
* (`
|
|
14181
|
+
* (`WidgetSession.resolveExternalVisitorId`). A client-minted id could
|
|
13425
14182
|
* never carry a valid proof, so under the new contract it would just be
|
|
13426
14183
|
* silently dropped and treated as a fresh visitor anyway (safe, but a wasted
|
|
13427
14184
|
* round trip and a pointless localStorage write). Instead the hook reads
|
|
@@ -13986,6 +14743,7 @@ function useChatSession(options) {
|
|
|
13986
14743
|
attribution,
|
|
13987
14744
|
...stored.visitorId ? { visitorId: stored.visitorId } : {},
|
|
13988
14745
|
...stored.visitorProof ? { visitorProof: stored.visitorProof } : {},
|
|
14746
|
+
...takeFlowLink(),
|
|
13989
14747
|
...hostRoutes !== void 0 ? { hostRoutes } : {}
|
|
13990
14748
|
})
|
|
13991
14749
|
});
|
|
@@ -14007,7 +14765,9 @@ function useChatSession(options) {
|
|
|
14007
14765
|
if (collector && body.visitorSessionId !== void 0 && ttlMs !== null) collector.setSession({
|
|
14008
14766
|
chatToken: body.chatToken,
|
|
14009
14767
|
visitorSessionId: body.visitorSessionId,
|
|
14010
|
-
expiresAt: receivedAt + ttlMs
|
|
14768
|
+
expiresAt: receivedAt + ttlMs,
|
|
14769
|
+
visitorId: body.visitorId,
|
|
14770
|
+
visitorProof: body.visitorProof
|
|
14011
14771
|
});
|
|
14012
14772
|
/**
|
|
14013
14773
|
* Paint the greeting the server just STORED — never a greeting this
|
|
@@ -14530,6 +15290,7 @@ function useChatSession(options) {
|
|
|
14530
15290
|
}
|
|
14531
15291
|
return status === 200;
|
|
14532
15292
|
}, [postSessionStateStatus]);
|
|
15293
|
+
const submitCapture = useCallback((answer) => postSessionStateStatus("/capture", answer), [postSessionStateStatus]);
|
|
14533
15294
|
/** See {@link UseChatSessionResult.pushPageContext}. */
|
|
14534
15295
|
const pushPageContext = useCallback(async (context) => postSessionState("/context", { context }), [postSessionState]);
|
|
14535
15296
|
const sendEvent = useCallback(async (events) => {
|
|
@@ -14758,6 +15519,11 @@ function useChatSession(options) {
|
|
|
14758
15519
|
...cartAttributionToken ? { cartAttributionToken } : {}
|
|
14759
15520
|
})
|
|
14760
15521
|
});
|
|
15522
|
+
if (res.status === 409) {
|
|
15523
|
+
const details = (await res.json()).error?.details;
|
|
15524
|
+
const cards = details?.["cards"];
|
|
15525
|
+
return details?.["reason"] === "CAPTURE_REQUIRED" && Array.isArray(cards) ? { captureRequired: cards } : null;
|
|
15526
|
+
}
|
|
14761
15527
|
if (!res.ok) return null;
|
|
14762
15528
|
const body = await res.json();
|
|
14763
15529
|
if (mountedRef.current) setCheckoutHandoffs((prev) => [...prev, body]);
|
|
@@ -14865,6 +15631,7 @@ function useChatSession(options) {
|
|
|
14865
15631
|
setCart,
|
|
14866
15632
|
pushCart,
|
|
14867
15633
|
pushPageContext,
|
|
15634
|
+
submitCapture,
|
|
14868
15635
|
sendEvent,
|
|
14869
15636
|
notifyTyping,
|
|
14870
15637
|
checkout,
|
|
@@ -15008,9 +15775,16 @@ async function streamReply(args) {
|
|
|
15008
15775
|
onActEvent(evt.data);
|
|
15009
15776
|
break;
|
|
15010
15777
|
}
|
|
15778
|
+
case "capture-card":
|
|
15011
15779
|
case "spotlight":
|
|
15012
15780
|
onActEvent(evt.data);
|
|
15013
15781
|
break;
|
|
15782
|
+
case "fill-form": {
|
|
15783
|
+
const data = evt.data;
|
|
15784
|
+
if (typeof data?.formSelector !== "string" || !Array.isArray(data.fields)) break;
|
|
15785
|
+
onActEvent(evt.data);
|
|
15786
|
+
break;
|
|
15787
|
+
}
|
|
15014
15788
|
case "escalated":
|
|
15015
15789
|
onEscalated();
|
|
15016
15790
|
break;
|
|
@@ -15036,7 +15810,7 @@ async function streamReply(args) {
|
|
|
15036
15810
|
* cache makes a second `start()` after `stop()` free).
|
|
15037
15811
|
*/
|
|
15038
15812
|
async function loadVoiceProtocol() {
|
|
15039
|
-
const [telemetry, chat] = await Promise.all([import("./telemetry-
|
|
15813
|
+
const [telemetry, chat] = await Promise.all([import("./telemetry-3f--vvdX.js"), import("./chat-R7z4DtMM.js")]);
|
|
15040
15814
|
return {
|
|
15041
15815
|
decodeTelemetry: telemetry.decodeTelemetry,
|
|
15042
15816
|
encodeCallerText: telemetry.encodeCallerText,
|
|
@@ -15970,6 +16744,64 @@ function place(context) {
|
|
|
15970
16744
|
return json.slice(0, json.lastIndexOf("\"capturedAt\""));
|
|
15971
16745
|
}
|
|
15972
16746
|
/**
|
|
16747
|
+
* First-segment name (lower-case) to kind. `satisfies` keeps every value a real
|
|
16748
|
+
* `BusinessPageKind`; `Uncovered` below fails to compile when a kind added to
|
|
16749
|
+
* `@saar-ai/widget-protocol/page-kinds` has no head here. That is the
|
|
16750
|
+
* single-source guarantee for the classifier, and it costs no bytes: both are
|
|
16751
|
+
* types.
|
|
16752
|
+
*/
|
|
16753
|
+
var HEADS = {
|
|
16754
|
+
pricing: "pricing",
|
|
16755
|
+
plans: "pricing",
|
|
16756
|
+
contact: "contact",
|
|
16757
|
+
"contact-us": "contact",
|
|
16758
|
+
demo: "demo",
|
|
16759
|
+
"book-a-demo": "demo",
|
|
16760
|
+
"book-demo": "demo",
|
|
16761
|
+
"request-a-demo": "demo",
|
|
16762
|
+
"request-demo": "demo",
|
|
16763
|
+
"case-studies": "case_study",
|
|
16764
|
+
"case-study": "case_study",
|
|
16765
|
+
customers: "case_study",
|
|
16766
|
+
docs: "docs",
|
|
16767
|
+
documentation: "docs",
|
|
16768
|
+
blog: "article",
|
|
16769
|
+
articles: "article"
|
|
16770
|
+
};
|
|
16771
|
+
/** Heads whose bare form is a listing page, not an instance of the kind (`/blog`, `/case-studies`, `/customers`). */
|
|
16772
|
+
var NEEDS_CHILD = new Set([
|
|
16773
|
+
"blog",
|
|
16774
|
+
"articles",
|
|
16775
|
+
"case-studies",
|
|
16776
|
+
"case-study",
|
|
16777
|
+
"customers"
|
|
16778
|
+
]);
|
|
16779
|
+
/** `en`, `fr`, `en-gb`: the locale prefix an i18n router or Shopify Markets puts in front of a path. */
|
|
16780
|
+
var LOCALE_SEGMENT = /^[a-z]{2}(?:-[a-z]{2})?$/u;
|
|
16781
|
+
/** Slugs under `/customers/` that are account pages, never a case study. */
|
|
16782
|
+
var ACCOUNT_SLUGS = new Set([
|
|
16783
|
+
"login",
|
|
16784
|
+
"logout",
|
|
16785
|
+
"register",
|
|
16786
|
+
"account",
|
|
16787
|
+
"orders"
|
|
16788
|
+
]);
|
|
16789
|
+
/**
|
|
16790
|
+
* @param path a PATHNAME (leading `/`, no query, no fragment); anything else
|
|
16791
|
+
* is `null`
|
|
16792
|
+
*/
|
|
16793
|
+
function classifyBusinessPage(path) {
|
|
16794
|
+
if (!path.startsWith("/")) return null;
|
|
16795
|
+
const segments = path.toLowerCase().split("/").filter(Boolean);
|
|
16796
|
+
const first = segments[0];
|
|
16797
|
+
if (first !== void 0 && segments.length > 1 && LOCALE_SEGMENT.test(first)) segments.shift();
|
|
16798
|
+
const [head, child] = segments;
|
|
16799
|
+
if (head === void 0 || !Object.prototype.hasOwnProperty.call(HEADS, head)) return null;
|
|
16800
|
+
const kind = HEADS[head];
|
|
16801
|
+
if (child === void 0 ? NEEDS_CHILD.has(head) : head === "customers" && ACCOUNT_SLUGS.has(child)) return null;
|
|
16802
|
+
return kind;
|
|
16803
|
+
}
|
|
16804
|
+
/**
|
|
15973
16805
|
* The query-string parameter names a storefront's search box puts its text
|
|
15974
16806
|
* in, in the order they are tried.
|
|
15975
16807
|
*
|
|
@@ -16002,6 +16834,29 @@ function readSearchQueryParam(search) {
|
|
|
16002
16834
|
return;
|
|
16003
16835
|
}
|
|
16004
16836
|
}
|
|
16837
|
+
/**
|
|
16838
|
+
* `currentPageContext(bridge)` — the whole page-context answer, assembled from
|
|
16839
|
+
* a `HostBridge`.
|
|
16840
|
+
*
|
|
16841
|
+
* ## Why this is a FREE FUNCTION and not a bridge method
|
|
16842
|
+
*
|
|
16843
|
+
* It reads like a method. It was one, briefly. It cannot be one, and the
|
|
16844
|
+
* reason is a hard number rather than a preference: `core.mjs` constructs a
|
|
16845
|
+
* bridge on EVERY merchant page, before the shopper has touched anything, and
|
|
16846
|
+
* it has a min+gz budget with a couple of hundred bytes of headroom
|
|
16847
|
+
* (`tools/check-config.json`, `bundle-budget.artefacts.core`). A method on a
|
|
16848
|
+
* class `core` instantiates is in `core`'s bundle whether `core` calls it or
|
|
16849
|
+
* not — a bundler can drop an unused module, never an unused prototype
|
|
16850
|
+
* member. Page context is used only once the shopper OPENS the concierge,
|
|
16851
|
+
* which is `ui.mjs`, which has room.
|
|
16852
|
+
*
|
|
16853
|
+
* So the split follows the budget exactly: the adapters keep the cheap,
|
|
16854
|
+
* platform-specific `pageContextExtras()` hook (Shopify's `filter.*` facets,
|
|
16855
|
+
* `window.Shopify.locale`, the host's own declaration), and everything
|
|
16856
|
+
* generic — the kind mapping, the clamping, the byte trimming — lives here,
|
|
16857
|
+
* in a module `core` never imports. Measured: the hook costs `core` about 200
|
|
16858
|
+
* bytes; this module would have cost it another ~780.
|
|
16859
|
+
*/
|
|
16005
16860
|
/** The real `location.search` and `<html lang>`, or nothing outside a browser. */
|
|
16006
16861
|
function browserPageContextGlobals() {
|
|
16007
16862
|
if (typeof window === "undefined") return {};
|
|
@@ -16013,17 +16868,24 @@ function browserPageContextGlobals() {
|
|
|
16013
16868
|
/**
|
|
16014
16869
|
* `HostPageKind` → `PageContextType`.
|
|
16015
16870
|
*
|
|
16016
|
-
* The one mapping that is not the identity is `'other'
|
|
16017
|
-
*
|
|
16018
|
-
* front page because a home page is a `page.viewed` like
|
|
16019
|
-
* does need one, because "they are on the front page"
|
|
16020
|
-
* page we could not classify" call for different
|
|
16871
|
+
* The one mapping that is not the identity is `'other'`, which is refined two
|
|
16872
|
+
* ways. At the site root it becomes `'home'`: the bridge's kind list never
|
|
16873
|
+
* needed a name for the front page because a home page is a `page.viewed` like
|
|
16874
|
+
* any other, but the model does need one, because "they are on the front page"
|
|
16875
|
+
* and "they are on some page we could not classify" call for different
|
|
16876
|
+
* opening sentences. Anywhere else it becomes a business kind (`pricing`,
|
|
16877
|
+
* `docs`, ...) when the path is unmistakably one (`classifyBusinessPage`), and
|
|
16878
|
+
* stays `'other'` otherwise. A kind the bridge already named is never
|
|
16879
|
+
* reclassified, so commerce pages are unchanged.
|
|
16021
16880
|
*
|
|
16022
16881
|
* @param kind the classified page kind
|
|
16023
16882
|
* @param path the page's pathname
|
|
16024
16883
|
*/
|
|
16025
16884
|
function pageContextTypeFor(kind, path) {
|
|
16026
|
-
if (kind === "other")
|
|
16885
|
+
if (kind === "other") {
|
|
16886
|
+
if (/^\/(?:[a-z]{2}(?:-[a-z]{2})?\/?)?$/iu.test(path)) return "home";
|
|
16887
|
+
return classifyBusinessPage(path) ?? "other";
|
|
16888
|
+
}
|
|
16027
16889
|
return kind;
|
|
16028
16890
|
}
|
|
16029
16891
|
/**
|
|
@@ -16082,6 +16944,7 @@ var PageContextTracker = class {
|
|
|
16082
16944
|
started = false;
|
|
16083
16945
|
destroyed = false;
|
|
16084
16946
|
unsubscribePageChange;
|
|
16947
|
+
unsubscribeGateChange;
|
|
16085
16948
|
pending;
|
|
16086
16949
|
/** The last context that actually went out — see {@link samePageContext}. */
|
|
16087
16950
|
lastSent;
|
|
@@ -16114,12 +16977,14 @@ var PageContextTracker = class {
|
|
|
16114
16977
|
this.started = true;
|
|
16115
16978
|
this.capture();
|
|
16116
16979
|
this.unsubscribePageChange = this.bridge.onPageChange(this.pageChangeListener);
|
|
16980
|
+
this.unsubscribeGateChange = this.consent.onChange?.(this.pageChangeListener);
|
|
16117
16981
|
} catch {}
|
|
16118
16982
|
}
|
|
16119
16983
|
destroy() {
|
|
16120
16984
|
try {
|
|
16121
16985
|
this.destroyed = true;
|
|
16122
16986
|
this.unsubscribePageChange?.();
|
|
16987
|
+
this.unsubscribeGateChange?.();
|
|
16123
16988
|
if (this.pending !== void 0) this.timer.clearTimeout(this.pending);
|
|
16124
16989
|
this.pending = void 0;
|
|
16125
16990
|
} catch {}
|
|
@@ -16267,6 +17132,27 @@ function resolveHostRoutePath(url, target, routes) {
|
|
|
16267
17132
|
return `${base}${base.includes("?") ? "&" : "?"}${query}${fragment}`;
|
|
16268
17133
|
}
|
|
16269
17134
|
//#endregion
|
|
17135
|
+
//#region src/capture-card/capture-card-host.tsx
|
|
17136
|
+
/**
|
|
17137
|
+
* Loads the card chunk into an empty element. Keyed by the options object
|
|
17138
|
+
* (one per card), so a re-render never redraws a card being typed into.
|
|
17139
|
+
*/
|
|
17140
|
+
function CaptureCardHost({ options }) {
|
|
17141
|
+
const ref = useRef(null);
|
|
17142
|
+
useEffect(() => {
|
|
17143
|
+
let dispose;
|
|
17144
|
+
let live = true;
|
|
17145
|
+
import("./capture-card-dom-BqDqOvQF.js").then(({ mountCaptureCard }) => {
|
|
17146
|
+
if (live && ref.current) dispose = mountCaptureCard(ref.current, options);
|
|
17147
|
+
}).catch(() => void 0);
|
|
17148
|
+
return () => {
|
|
17149
|
+
live = false;
|
|
17150
|
+
dispose?.();
|
|
17151
|
+
};
|
|
17152
|
+
}, [options]);
|
|
17153
|
+
return /* @__PURE__ */ jsx("div", { ref });
|
|
17154
|
+
}
|
|
17155
|
+
//#endregion
|
|
16270
17156
|
//#region src/turn-order.ts
|
|
16271
17157
|
/**
|
|
16272
17158
|
* The widget's arrival clock. One instance per mounted widget (`useRef`), fed
|
|
@@ -16421,7 +17307,7 @@ var ACT_HOLD_MAX_MS = 15e3;
|
|
|
16421
17307
|
* than a silent no-op.
|
|
16422
17308
|
*/
|
|
16423
17309
|
function isActEvent(event) {
|
|
16424
|
-
return event.type === "navigate" || event.type === "filter" || event.type === "spotlight";
|
|
17310
|
+
return event.type === "navigate" || event.type === "filter" || event.type === "spotlight" || event.type === "capture-card" || event.type === "fill-form";
|
|
16425
17311
|
}
|
|
16426
17312
|
/**
|
|
16427
17313
|
* Do two storefront paths name the same PAGE — ignoring the query, the
|
|
@@ -16701,8 +17587,9 @@ function clampInteger(value, min, max) {
|
|
|
16701
17587
|
* through to (2) rather than surfacing, because a bridge that cannot answer
|
|
16702
17588
|
* is exactly the case (2) exists for. `null` from BOTH is a real outcome and
|
|
16703
17589
|
* is returned as such: `WidgetCartSummary`'s button renders its failure line
|
|
16704
|
-
* and stays pressable.
|
|
16705
|
-
*
|
|
17590
|
+
* and stays pressable. `false` from (2) means the store needs details first
|
|
17591
|
+
* and the widget is already showing cards for them. It must never throw — the
|
|
17592
|
+
* button's own `await` has no catch, so a throw here is a permanent spinner.
|
|
16706
17593
|
*/
|
|
16707
17594
|
async function resolveCheckoutUrl(bridge, startHandoff) {
|
|
16708
17595
|
try {
|
|
@@ -16710,7 +17597,8 @@ async function resolveCheckoutUrl(bridge, startHandoff) {
|
|
|
16710
17597
|
if (typeof hosted === "string" && hosted.length > 0) return hosted;
|
|
16711
17598
|
} catch {}
|
|
16712
17599
|
try {
|
|
16713
|
-
|
|
17600
|
+
const handoff = await startHandoff();
|
|
17601
|
+
return handoff === false ? false : handoff?.url ?? null;
|
|
16714
17602
|
} catch {
|
|
16715
17603
|
return null;
|
|
16716
17604
|
}
|
|
@@ -16761,7 +17649,7 @@ function ConciergeWidget({ renderer, ...props }) {
|
|
|
16761
17649
|
renderer: renderer ?? rendererFor(props.generation)
|
|
16762
17650
|
});
|
|
16763
17651
|
}
|
|
16764
|
-
function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bridge, siteProfile, collector, messages = defaultWidgetMessages, locale = "en", productHref, hostRoutes, curationHref, brandPrimary, brandSecondary, brandAccent, avatar, attribution, color, type, identity, layout, copy, bottomOffset, showPrice, cardImageAspect, voiceAvailable, direction, proactive, initialDraft, initialSelection, initialFocus, initialMinimised, insets, hold, audio, onReady, cartLineIds }) {
|
|
17652
|
+
function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bridge, siteProfile, collector, messages = defaultWidgetMessages, locale = "en", productHref, hostRoutes, curationHref, brandPrimary, brandSecondary, brandAccent, avatar, attribution, privacyChoices, color, type, identity, layout, copy, bottomOffset, showPrice, cardImageAspect, voiceAvailable, direction, proactive, initialDraft, initialSelection, initialFocus, initialMinimised, insets, hold, audio, onReady, cartLineIds }) {
|
|
16765
17653
|
/**
|
|
16766
17654
|
* Maps the tenant's semantic config fields onto the widget's historical
|
|
16767
17655
|
* CSS custom properties — this is the "one becomes the other" site
|
|
@@ -16888,6 +17776,7 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
16888
17776
|
* summary falls back to when it does.
|
|
16889
17777
|
*/
|
|
16890
17778
|
const [addedLines, setAddedLines] = useState([]);
|
|
17779
|
+
const [captureCard, setCaptureCard] = useState(null);
|
|
16891
17780
|
/** The host's own last answer, or `null` while it has given none. */
|
|
16892
17781
|
const [hostCart, setHostCart] = useState(null);
|
|
16893
17782
|
const mountedRef = useRef(true);
|
|
@@ -17457,6 +18346,31 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
17457
18346
|
while (streamingRef.current && actLiveRef.current && Date.now() < deadline) await new Promise((resolve) => setTimeout(resolve, ACT_HOLD_POLL_MS));
|
|
17458
18347
|
}, []);
|
|
17459
18348
|
const performAct = useCallback(async (event) => {
|
|
18349
|
+
if (event.type === "capture-card") {
|
|
18350
|
+
setCaptureCard({
|
|
18351
|
+
card: event,
|
|
18352
|
+
locale,
|
|
18353
|
+
autoFocus: !inCallRef.current,
|
|
18354
|
+
submit: session.submitCapture,
|
|
18355
|
+
onAnswered: (outcome) => {
|
|
18356
|
+
if (!inCallRef.current) session.sendReport({
|
|
18357
|
+
kind: "capture_card",
|
|
18358
|
+
field: event.field,
|
|
18359
|
+
outcome
|
|
18360
|
+
}).catch(() => void 0);
|
|
18361
|
+
}
|
|
18362
|
+
});
|
|
18363
|
+
return;
|
|
18364
|
+
}
|
|
18365
|
+
if (event.type === "fill-form") {
|
|
18366
|
+
if (!inCallRef.current) await waitForTypedTurnToLand();
|
|
18367
|
+
if (!actLiveRef.current || typeof window === "undefined") return;
|
|
18368
|
+
try {
|
|
18369
|
+
const { fillHostForm } = await import("./form-fill-dom-skU-ZwLB.js");
|
|
18370
|
+
if (actLiveRef.current) fillHostForm(window.document, event);
|
|
18371
|
+
} catch {}
|
|
18372
|
+
return;
|
|
18373
|
+
}
|
|
17460
18374
|
if (event.type !== "spotlight") {
|
|
17461
18375
|
if (!inCallRef.current) {
|
|
17462
18376
|
await waitForTypedTurnToLand();
|
|
@@ -17494,7 +18408,9 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
17494
18408
|
siteProfile,
|
|
17495
18409
|
performNavigate,
|
|
17496
18410
|
reportFailedSpotlight,
|
|
17497
|
-
waitForTypedTurnToLand
|
|
18411
|
+
waitForTypedTurnToLand,
|
|
18412
|
+
locale,
|
|
18413
|
+
session
|
|
17498
18414
|
]);
|
|
17499
18415
|
/**
|
|
17500
18416
|
* The acts the concierge asked for, from both legs, performed exactly once
|
|
@@ -18199,6 +19115,26 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
18199
19115
|
const cartLines = hostLines ?? addedLines;
|
|
18200
19116
|
const cartSubtotalMinor = hostCart?.subtotalCents ?? cartLines.reduce((total, line) => total + line.priceMinor * line.quantity, 0);
|
|
18201
19117
|
/**
|
|
19118
|
+
* The cards a refused checkout asked for, one at a time in the one card
|
|
19119
|
+
* slot. No `capture_card` report: the server already marked each answer,
|
|
19120
|
+
* and a report would start a concierge turn the shopper did not ask for.
|
|
19121
|
+
*/
|
|
19122
|
+
const showCheckoutCards = useCallback((cards) => {
|
|
19123
|
+
const show = (index) => {
|
|
19124
|
+
const card = cards[index];
|
|
19125
|
+
if (card === void 0) return;
|
|
19126
|
+
setCaptureCard({
|
|
19127
|
+
card,
|
|
19128
|
+
locale,
|
|
19129
|
+
autoFocus: !inCallRef.current,
|
|
19130
|
+
submit: session.submitCapture,
|
|
19131
|
+
checkout: index < cards.length - 1 ? "more" : "last",
|
|
19132
|
+
onAnswered: () => show(index + 1)
|
|
19133
|
+
});
|
|
19134
|
+
};
|
|
19135
|
+
show(0);
|
|
19136
|
+
}, [locale, session.submitCapture]);
|
|
19137
|
+
/**
|
|
18202
19138
|
* Fire the checkout. `undefined` (rather than an `onCheckout` that always
|
|
18203
19139
|
* fails) whenever there is no basket at all, so `VoiceWidget` renders no
|
|
18204
19140
|
* summary — the same "additive per caller" posture `onAddToCart` keeps.
|
|
@@ -18208,11 +19144,18 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
18208
19144
|
variantId: line.variantId,
|
|
18209
19145
|
quantity: line.quantity
|
|
18210
19146
|
}));
|
|
18211
|
-
return resolveCheckoutUrl(bridge, () =>
|
|
19147
|
+
return resolveCheckoutUrl(bridge, async () => {
|
|
19148
|
+
const result = await session.checkout(items, void 0, session.cartAttributionToken ?? void 0);
|
|
19149
|
+
if (result === null || !("captureRequired" in result)) return result;
|
|
19150
|
+
if (result.captureRequired.length === 0) return null;
|
|
19151
|
+
showCheckoutCards(result.captureRequired);
|
|
19152
|
+
return false;
|
|
19153
|
+
});
|
|
18212
19154
|
}, [
|
|
18213
19155
|
addedLines,
|
|
18214
19156
|
bridge,
|
|
18215
|
-
session
|
|
19157
|
+
session,
|
|
19158
|
+
showCheckoutCards
|
|
18216
19159
|
]);
|
|
18217
19160
|
/**
|
|
18218
19161
|
* The one line under the header, and the order the three claimants take it
|
|
@@ -18500,8 +19443,10 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
18500
19443
|
...skinStyle !== void 0 ? { skinStyle } : {},
|
|
18501
19444
|
...avatar !== void 0 ? { avatar } : {},
|
|
18502
19445
|
...attribution !== void 0 ? { attribution } : {},
|
|
18503
|
-
|
|
19446
|
+
...privacyChoices !== void 0 ? { privacyChoices } : {},
|
|
19447
|
+
dock: dockProps,
|
|
19448
|
+
...captureCard !== null ? { captureCard: /* @__PURE__ */ jsx(CaptureCardHost, { options: captureCard }) } : {}
|
|
18504
19449
|
});
|
|
18505
19450
|
}
|
|
18506
19451
|
//#endregion
|
|
18507
|
-
export {
|
|
19452
|
+
export { deriveDockState as $, WIDGET_THEME_TOKENS as $t, rendererFor as A, BotFace as An, SHEET_EXPANDED_VH as At, nearestPosition as B, persistAlign as Bt, readsAsCartViewIntent as C, widgetMessagesFromCopy as Cn, MOBILE_MARGIN as Ct, WidgetCardList as D, isWidgetAvatar as Dn, RADII as Dt, WidgetCartSummary as E, WIDGET_AVATARS as En, PROACTIVE_NUDGE_MS as Et, ConciergeLauncher as F, SHORT_VIEWPORT as Ft, botStateFor as G, readStoredMinimised as Gt, positionClasses as H, pillAnchor as Ht, CONCIERGE_POSITIONS as I, Z_INDEX as It, SessionLog as J, snapAlign as Jt, SseFrameParser as K, rowWidthLen as Kt, DEFAULT_CONCIERGE_POSITION as L, bottomLen as Lt, ShellRenderer as M, cn as Mn, SHEET_PEEK_MAX as Mt, deriveWidgetView as N, SHEET_TOP_CLEARANCE as Nt, WidgetMarkdown as O, KNOT_PATH as On, ROW_H as Ot, ConciergeShell as P, SHEET_TUCK as Pt, DOCK_STATES as Q, SYSTEM_FONT_STACK as Qt, alignOf as R, containerAnchor as Rt, basketIntentFromTurns as S, resolveWidgetMessages as Sn, MARK as St, textDirectionFor as T, DEFAULT_WIDGET_AVATAR as Tn, PILL_MARK as Tt, positionForArrow as U, readStored as Ut, panelClasses as V, persistMinimised as Vt, IDLE_SNAPSHOT as W, readStoredAlign as Wt, latencyBetween as X, CARD_RADIUS_MAX_PX as Xt, formatMs as Y, writeStored as Yt, Dock as Z, SHEET_RADIUS_MAX_PX as Zt, isSameOriginPath as _, rotateHue as _n, DRAG_CLICK_WINDOW_MS as _t, MAX_REPORTED_CART_LINES as a, hexToOklab as an, deriveConciergeState as at, VoiceWidget as b, defaultWidgetMessages as bn, FLOAT_GAP as bt, deriveCallPhase as c, linearToSrgb as cn, ACTIVITY_W as ct, resolveCheckoutUrl as d, oklabToLinearRgb as dn, DESKTOP_BOTTOM as dt, deriveTheme as en, deriveDockView as et, toChatCart as f, oklabToOklch as fn, DESKTOP_BREAKPOINT as ft, CHECKOUT_CAPTURE_REQUIRED as g, relativeLuminance as gn, DOCK_MINIMISED_STORAGE_KEY as gt, useVoiceSession as h, parseHex as hn, DOCK_ALIGN_STORAGE_KEY as ht, ConciergeWidget as i, formatHex as in, CONCIERGE_STATES as it, DockRenderer as j, labelProps as jn, SHEET_GAP as jt, parseBlocks as k, RopeKnot as kn, SHEET_EXPANDED_DESKTOP_MAX as kt, mergeAddedCartLine as l, mixToward as ln, BOTTOM_FLOOR as lt, createWidgetVoiceTokenFetcher as m, oklchToOklab as mn, DESKTOP_WIDTHS as mt, CART_LINE_VARIANT_ID_SHAPE as n, themeToInlineStyle as nn, idleDockInput as nt, cartLinesFromSnapshot as o, hexToOklch as on, idleConciergeInput as ot, ROOM_EVENTS as p, oklchToHex as pn, DESKTOP_GUTTER as pt, SESSION_EVENTS as q, sheetMaxHeightLen as qt, ConciergeHost as r, contrastRatio as rn, latestExchangeStart as rt, chooseOptionsAction as s, linearRgbToOklab as sn, formatMoney as st, CART_LINE_PLATFORM_VARIANT_ID_SHAPE as t, themeToCss as tn, exchangeCount as tt, resolveAddToCartHandler as u, oklabToHex as un, CONTROL as ut, useChatSession as v, srgbToLinear as vn, DRAG_TAP_SLOP_PX as vt, readsAsCheckoutIntent as w, MorphingLoader as wn, PILL_H as wt, VoiceWidgetWithRenderer as x, formatMessage as xn, GLASS_IDLE_MS as xt, detectPage as y, withAlpha as yn, FLOAT_DUCK_DISMISS_MS as yt, edgeOf as z, geometryVars as zt };
|