@saar-ai/web-widget 0.12.0 → 0.13.1
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-Cc0KjJwZ.js → host-widget-iQ-2t8vu.js} +961 -452
- 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.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/generated/widget-css.d.ts.map +1 -1
- 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 +140 -4
- 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-shell.d.ts +4 -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-cart-summary.d.ts +4 -3
- package/dist/widget-cart-summary.d.ts.map +1 -1
- package/dist/widget.css +1 -1
- package/package.json +18 -17
|
@@ -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",
|
|
@@ -7459,7 +7539,8 @@ function DockSheet({ snap, onSnapChange, label, peekOnly, header, children, onDi
|
|
|
7459
7539
|
* them runs in a merchant's browser.
|
|
7460
7540
|
*
|
|
7461
7541
|
* The turn tier already owned the table: `@wesence/agent-core`'s
|
|
7462
|
-
* `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
|
|
7463
7544
|
* builds the shopper-cart block BOTH legs of a conversation read, so that a
|
|
7464
7545
|
* JPY basket is not "9900 JPY" when the shopper types and "99 JPY" when they
|
|
7465
7546
|
* call. Meanwhile `@saar-ai/web-widget`'s own `format-money.ts` divided
|
|
@@ -7674,7 +7755,8 @@ function formatMoney$1(priceMinor, currency, locale) {
|
|
|
7674
7755
|
* a hardcoded 100.
|
|
7675
7756
|
*
|
|
7676
7757
|
* That simplification became a bug the moment the server side of the same
|
|
7677
|
-
* 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
|
|
7678
7760
|
* the complete ISO 4217 zero-decimal and three-decimal sets, so the concierge
|
|
7679
7761
|
* says "9900 JPY" in prose while this function drew "¥99" on the card beside
|
|
7680
7762
|
* it — two answers to one question, inside one conversation, which is the
|
|
@@ -7685,7 +7767,7 @@ function formatMoney$1(priceMinor, currency, locale) {
|
|
|
7685
7767
|
* own `AGENTS.md` already says what to do about it — "a third copy anywhere
|
|
7686
7768
|
* is the signal to extract a shared package instead of copying again" — so
|
|
7687
7769
|
* the table and the formatter moved into `@saar-ai/widget-protocol/money`,
|
|
7688
|
-
* which this package already bundles, and `@
|
|
7770
|
+
* which this package already bundles, and `@saar-ai/commerce-pack` and
|
|
7689
7771
|
* `apps/web/src/lib/money.ts` re-export the same one.
|
|
7690
7772
|
*
|
|
7691
7773
|
* `@saar-ai/widget-protocol`, not `@wesence/agent-core`, because no
|
|
@@ -8274,7 +8356,7 @@ var DEFAULT_LAYOUT = {
|
|
|
8274
8356
|
};
|
|
8275
8357
|
var INTERRUPT_SEEN_STORAGE_KEY = "wgt_dock_interrupt_seen";
|
|
8276
8358
|
function Dock(props) {
|
|
8277
|
-
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;
|
|
8278
8360
|
const scopeId = useId().replace(/[^a-zA-Z0-9_-]/g, "");
|
|
8279
8361
|
const rootRef = useRef(null);
|
|
8280
8362
|
const rowRef = useRef(null);
|
|
@@ -9303,6 +9385,13 @@ function Dock(props) {
|
|
|
9303
9385
|
target: "_blank",
|
|
9304
9386
|
rel: "noopener noreferrer",
|
|
9305
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
|
|
9306
9395
|
}) : null
|
|
9307
9396
|
]
|
|
9308
9397
|
}),
|
|
@@ -9769,38 +9858,57 @@ function botStateFor(snapshot) {
|
|
|
9769
9858
|
return "listening";
|
|
9770
9859
|
}
|
|
9771
9860
|
//#endregion
|
|
9772
|
-
//#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
|
|
9773
9862
|
/**
|
|
9774
|
-
* @license lucide-react v1.
|
|
9863
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9775
9864
|
*
|
|
9776
9865
|
* This source code is licensed under the ISC license.
|
|
9777
9866
|
* See the LICENSE file in the root directory of this source tree.
|
|
9778
9867
|
*/
|
|
9779
|
-
var
|
|
9780
|
-
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
9781
|
-
}).join(" ").trim();
|
|
9868
|
+
var toKebabCase = (string) => string?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
9782
9869
|
//#endregion
|
|
9783
|
-
//#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
|
|
9784
9871
|
/**
|
|
9785
|
-
* @license lucide-react v1.
|
|
9872
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9786
9873
|
*
|
|
9787
9874
|
* This source code is licensed under the ISC license.
|
|
9788
9875
|
* See the LICENSE file in the root directory of this source tree.
|
|
9789
9876
|
*/
|
|
9790
|
-
|
|
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
|
+
}
|
|
9791
9886
|
//#endregion
|
|
9792
|
-
//#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
|
|
9793
9888
|
/**
|
|
9794
|
-
* @license lucide-react v1.
|
|
9889
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9795
9890
|
*
|
|
9796
9891
|
* This source code is licensed under the ISC license.
|
|
9797
9892
|
* See the LICENSE file in the root directory of this source tree.
|
|
9798
9893
|
*/
|
|
9799
|
-
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
|
+
};
|
|
9800
9908
|
//#endregion
|
|
9801
|
-
//#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
|
|
9802
9910
|
/**
|
|
9803
|
-
* @license lucide-react v1.
|
|
9911
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9804
9912
|
*
|
|
9805
9913
|
* This source code is licensed under the ISC license.
|
|
9806
9914
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -9810,9 +9918,20 @@ var toPascalCase = (string) => {
|
|
|
9810
9918
|
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
9811
9919
|
};
|
|
9812
9920
|
//#endregion
|
|
9813
|
-
//#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
|
|
9814
9922
|
/**
|
|
9815
|
-
* @license lucide-react v1.
|
|
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
|
|
9933
|
+
/**
|
|
9934
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9816
9935
|
*
|
|
9817
9936
|
* This source code is licensed under the ISC license.
|
|
9818
9937
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -9824,14 +9943,90 @@ var defaultAttributes = {
|
|
|
9824
9943
|
viewBox: "0 0 24 24",
|
|
9825
9944
|
fill: "none",
|
|
9826
9945
|
stroke: "currentColor",
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
|
|
9946
|
+
"stroke-width": 2,
|
|
9947
|
+
"stroke-linecap": "round",
|
|
9948
|
+
"stroke-linejoin": "round"
|
|
9830
9949
|
};
|
|
9831
9950
|
//#endregion
|
|
9832
|
-
//#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
|
|
9833
9952
|
/**
|
|
9834
|
-
* @license lucide-react v1.
|
|
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
|
|
10028
|
+
/**
|
|
10029
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9835
10030
|
*
|
|
9836
10031
|
* This source code is licensed under the ISC license.
|
|
9837
10032
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -9841,9 +10036,9 @@ var hasA11yProp = (props) => {
|
|
|
9841
10036
|
return false;
|
|
9842
10037
|
};
|
|
9843
10038
|
//#endregion
|
|
9844
|
-
//#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
|
|
9845
10040
|
/**
|
|
9846
|
-
* @license lucide-react v1.
|
|
10041
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9847
10042
|
*
|
|
9848
10043
|
* This source code is licensed under the ISC license.
|
|
9849
10044
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -9851,206 +10046,271 @@ var hasA11yProp = (props) => {
|
|
|
9851
10046
|
var LucideContext = createContext({});
|
|
9852
10047
|
var useLucideContext = () => useContext(LucideContext);
|
|
9853
10048
|
//#endregion
|
|
9854
|
-
//#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
|
|
9855
10050
|
/**
|
|
9856
|
-
* @license lucide-react v1.
|
|
10051
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9857
10052
|
*
|
|
9858
10053
|
* This source code is licensed under the ISC license.
|
|
9859
10054
|
* See the LICENSE file in the root directory of this source tree.
|
|
9860
10055
|
*/
|
|
9861
|
-
var Icon = forwardRef(({ color, size, strokeWidth, absoluteStrokeWidth, className = "", children, iconNode
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
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, {
|
|
9865
10075
|
ref,
|
|
9866
|
-
...
|
|
9867
|
-
|
|
9868
|
-
height: size ?? contextSize ?? defaultAttributes.height,
|
|
9869
|
-
stroke: color ?? contextColor,
|
|
9870
|
-
strokeWidth: calculatedStrokeWidth,
|
|
9871
|
-
className: mergeClasses("lucide", contextClass, className),
|
|
9872
|
-
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
9873
|
-
...rest
|
|
9874
|
-
}, [...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]]);
|
|
9875
10078
|
});
|
|
9876
10079
|
//#endregion
|
|
9877
|
-
//#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
|
|
9878
10081
|
/**
|
|
9879
|
-
* @license lucide-react v1.
|
|
10082
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9880
10083
|
*
|
|
9881
10084
|
* This source code is licensed under the ISC license.
|
|
9882
10085
|
* See the LICENSE file in the root directory of this source tree.
|
|
9883
10086
|
*/
|
|
9884
|
-
|
|
10087
|
+
function createLucideIcon(iconDataOrName, iconNode = [], aliases = []) {
|
|
10088
|
+
const iconData = typeof iconDataOrName === "string" ? toLucideIconData(iconDataOrName, iconNode, aliases) : iconDataOrName;
|
|
9885
10089
|
const Component = forwardRef(({ className, ...props }, ref) => createElement(Icon, {
|
|
9886
10090
|
ref,
|
|
9887
|
-
|
|
9888
|
-
className
|
|
10091
|
+
icon: iconData,
|
|
10092
|
+
className,
|
|
9889
10093
|
...props
|
|
9890
10094
|
}));
|
|
9891
|
-
Component.displayName = toPascalCase(
|
|
10095
|
+
if (iconData.name) Component.displayName = toPascalCase(iconData.name);
|
|
9892
10096
|
return Component;
|
|
9893
|
-
}
|
|
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
|
|
9894
10100
|
/**
|
|
9895
|
-
* @license lucide-react v1.
|
|
10101
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9896
10102
|
*
|
|
9897
10103
|
* This source code is licensed under the ISC license.
|
|
9898
10104
|
* See the LICENSE file in the root directory of this source tree.
|
|
9899
10105
|
*/
|
|
9900
|
-
var
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
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
|
+
]
|
|
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
|
|
9938
10152
|
/**
|
|
9939
|
-
* @license lucide-react v1.
|
|
10153
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9940
10154
|
*
|
|
9941
10155
|
* This source code is licensed under the ISC license.
|
|
9942
10156
|
* See the LICENSE file in the root directory of this source tree.
|
|
9943
10157
|
*/
|
|
9944
|
-
var
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
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
|
|
9970
10192
|
/**
|
|
9971
|
-
* @license lucide-react v1.
|
|
10193
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9972
10194
|
*
|
|
9973
10195
|
* This source code is licensed under the ISC license.
|
|
9974
10196
|
* See the LICENSE file in the root directory of this source tree.
|
|
9975
10197
|
*/
|
|
9976
|
-
var
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
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
|
|
9994
10224
|
/**
|
|
9995
|
-
* @license lucide-react v1.
|
|
10225
|
+
* @license lucide-react v1.50.0 - ISC
|
|
9996
10226
|
*
|
|
9997
10227
|
* This source code is licensed under the ISC license.
|
|
9998
10228
|
* See the LICENSE file in the root directory of this source tree.
|
|
9999
10229
|
*/
|
|
10000
|
-
var
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
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
|
|
10014
10252
|
/**
|
|
10015
|
-
* @license lucide-react v1.
|
|
10253
|
+
* @license lucide-react v1.50.0 - ISC
|
|
10016
10254
|
*
|
|
10017
10255
|
* This source code is licensed under the ISC license.
|
|
10018
10256
|
* See the LICENSE file in the root directory of this source tree.
|
|
10019
10257
|
*/
|
|
10020
|
-
var
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
}]
|
|
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
|
|
10027
10273
|
/**
|
|
10028
|
-
* @license lucide-react v1.
|
|
10274
|
+
* @license lucide-react v1.50.0 - ISC
|
|
10029
10275
|
*
|
|
10030
10276
|
* This source code is licensed under the ISC license.
|
|
10031
10277
|
* See the LICENSE file in the root directory of this source tree.
|
|
10032
10278
|
*/
|
|
10033
|
-
var
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
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
|
|
10041
10295
|
/**
|
|
10042
|
-
* @license lucide-react v1.
|
|
10296
|
+
* @license lucide-react v1.50.0 - ISC
|
|
10043
10297
|
*
|
|
10044
10298
|
* This source code is licensed under the ISC license.
|
|
10045
10299
|
* See the LICENSE file in the root directory of this source tree.
|
|
10046
10300
|
*/
|
|
10047
|
-
var
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
}]
|
|
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);
|
|
10054
10314
|
//#endregion
|
|
10055
10315
|
//#region src/avatar-face.tsx
|
|
10056
10316
|
function AvatarFace({ avatar, state, size, label, messageArrived, tightenKey }) {
|
|
@@ -10664,7 +10924,7 @@ function voiceStatePillDotColor(pillState) {
|
|
|
10664
10924
|
}
|
|
10665
10925
|
/** How long the opening flourish runs. Matches `.widget-portal`'s own duration. */
|
|
10666
10926
|
var PORTAL_MS = 720;
|
|
10667
|
-
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 }) {
|
|
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 }) {
|
|
10668
10928
|
const triggerId = `${idPrefix}-trigger`;
|
|
10669
10929
|
const inputId = `${idPrefix}-input`;
|
|
10670
10930
|
const [portalActive, setPortalActive] = useState(false);
|
|
@@ -10885,225 +11145,235 @@ function ConciergeShell({ open, onOpenChange, state, messageArrived = false, lau
|
|
|
10885
11145
|
className: cn("pointer-events-none fixed inset-x-0 z-50 flex", panelClasses(position)),
|
|
10886
11146
|
children: /* @__PURE__ */ jsxs("div", {
|
|
10887
11147
|
className: "relative flex flex-col items-center",
|
|
10888
|
-
children: [
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
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
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
"
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
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 [&:lang(ar)]:tracking-normal [&:lang(hi)]:tracking-normal 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
|
|
10946
11216
|
})]
|
|
10947
|
-
}),
|
|
10948
|
-
|
|
10949
|
-
className:
|
|
10950
|
-
children:
|
|
10951
|
-
"
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
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",
|
|
11009
11298
|
children: [
|
|
11010
|
-
/* @__PURE__ */ jsx("
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
|
|
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" })
|
|
11014
11319
|
}),
|
|
11015
|
-
/* @__PURE__ */ jsx("
|
|
11016
|
-
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11025
|
-
|
|
11026
|
-
|
|
11027
|
-
"
|
|
11028
|
-
"
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
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
|
|
11033
11345
|
]
|
|
11034
|
-
})]
|
|
11035
|
-
})
|
|
11036
|
-
className: "mt-1 flex items-center gap-3",
|
|
11037
|
-
children: [
|
|
11038
|
-
/* @__PURE__ */ jsx("button", {
|
|
11039
|
-
type: "button",
|
|
11040
|
-
onClick: connecting ? void 0 : inCall ? voice.onToggleMute ?? voice.onStart : voice.onStart,
|
|
11041
|
-
disabled: micUnusable || connecting,
|
|
11042
|
-
"data-testid": testIds?.mic,
|
|
11043
|
-
title: micLabel,
|
|
11044
|
-
"aria-label": micLabel,
|
|
11045
|
-
...connecting ? { "aria-busy": true } : {},
|
|
11046
|
-
...inCall && !connecting ? { "aria-pressed": voice.muted ?? false } : {},
|
|
11047
|
-
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"),
|
|
11048
|
-
children: connecting ? /* @__PURE__ */ jsx("span", {
|
|
11049
|
-
"aria-hidden": "true",
|
|
11050
|
-
"data-testid": "widget-mic-spinner",
|
|
11051
|
-
className: "flex items-center justify-center",
|
|
11052
|
-
children: /* @__PURE__ */ jsx(MorphingLoader, {
|
|
11053
|
-
size: "md",
|
|
11054
|
-
variant: "light",
|
|
11055
|
-
label: connectingLabel
|
|
11056
|
-
})
|
|
11057
|
-
}) : inCall && voice.muted === true ? /* @__PURE__ */ jsx(MicOff, { className: "size-5" }) : /* @__PURE__ */ jsx(Mic, { className: "size-5" })
|
|
11058
|
-
}),
|
|
11059
|
-
inCall && voice.agentSpeaking === true && voice.onInterrupt !== void 0 ? /* @__PURE__ */ jsx("button", {
|
|
11060
|
-
type: "button",
|
|
11061
|
-
onClick: () => voice.onInterrupt?.("tap"),
|
|
11062
|
-
"data-testid": "widget-interrupt",
|
|
11063
|
-
title: voice.labels.interrupt ?? "",
|
|
11064
|
-
"aria-label": voice.labels.interrupt ?? "",
|
|
11065
|
-
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"),
|
|
11066
|
-
children: /* @__PURE__ */ jsx(Square, { className: "size-4" })
|
|
11067
|
-
}) : null,
|
|
11068
|
-
voice.phase === "blocked" && voice.onFixPermission !== void 0 ? /* @__PURE__ */ jsx("button", {
|
|
11069
|
-
type: "button",
|
|
11070
|
-
onClick: voice.onFixPermission,
|
|
11071
|
-
"data-testid": "widget-fix-permission",
|
|
11072
|
-
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"),
|
|
11073
|
-
children: voice.labels.fixBrowser ?? defaultWidgetMessages.dock_fix_browser
|
|
11074
|
-
}) : null,
|
|
11075
|
-
inCall && voice.onEnd !== void 0 ? /* @__PURE__ */ jsx("button", {
|
|
11076
|
-
type: "button",
|
|
11077
|
-
onClick: voice.onEnd,
|
|
11078
|
-
"data-testid": testIds?.endCall,
|
|
11079
|
-
title: voice.labels.end ?? "",
|
|
11080
|
-
"aria-label": voice.labels.end ?? "",
|
|
11081
|
-
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"),
|
|
11082
|
-
children: /* @__PURE__ */ jsx(PhoneOff, { className: "size-4" })
|
|
11083
|
-
}) : null
|
|
11084
|
-
]
|
|
11085
|
-
}) : null]
|
|
11346
|
+
}) : null]
|
|
11347
|
+
})
|
|
11086
11348
|
})
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
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
|
+
]
|
|
11107
11377
|
})
|
|
11108
11378
|
}),
|
|
11109
11379
|
portalActive && /* @__PURE__ */ jsx("div", {
|
|
@@ -11387,7 +11657,7 @@ function positionFor(dock) {
|
|
|
11387
11657
|
const align = dock?.layout?.desktopAlign;
|
|
11388
11658
|
return align === "left" || align === "right" ? `bottom-${align}` : DEFAULT_CONCIERGE_POSITION;
|
|
11389
11659
|
}
|
|
11390
|
-
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, voice: derivedVoice, dock }) {
|
|
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 }) {
|
|
11391
11661
|
const [open, setOpen] = useState(dock?.initialMinimised === false);
|
|
11392
11662
|
const onReady = dock?.onReady;
|
|
11393
11663
|
useLayoutEffect(() => {
|
|
@@ -11540,6 +11810,7 @@ function ShellRenderer({ turns, showMic, callPhase, micOpen, onToggleMic, onEndC
|
|
|
11540
11810
|
...skinStyle !== void 0 ? { skinStyle } : {},
|
|
11541
11811
|
...avatar !== void 0 ? { avatar } : {},
|
|
11542
11812
|
...attribution !== void 0 ? { attribution } : {},
|
|
11813
|
+
...privacyChoices !== void 0 ? { privacyChoices } : {},
|
|
11543
11814
|
launcher: view.launcher,
|
|
11544
11815
|
...view.handoff && operatorName !== void 0 ? { operatorName } : {},
|
|
11545
11816
|
launcherInitials: view.launcher.initials ? handoffInitials(operatorName) : "",
|
|
@@ -11570,7 +11841,7 @@ function ShellRenderer({ turns, showMic, callPhase, micOpen, onToggleMic, onEndC
|
|
|
11570
11841
|
role: "status",
|
|
11571
11842
|
"aria-live": "polite"
|
|
11572
11843
|
} : {},
|
|
11573
|
-
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)]",
|
|
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)] [&:lang(ar)]:tracking-normal [&:lang(hi)]:tracking-normal",
|
|
11574
11845
|
children: statusText
|
|
11575
11846
|
}),
|
|
11576
11847
|
testIds: {
|
|
@@ -11597,7 +11868,7 @@ function ShellRenderer({ turns, showMic, callPhase, micOpen, onToggleMic, onEndC
|
|
|
11597
11868
|
* Imported by `cdn/ui.ts` and by `rendererFor`; never by `voice-widget.tsx`,
|
|
11598
11869
|
* so a bundle built around the OTHER renderer does not carry this one.
|
|
11599
11870
|
*/
|
|
11600
|
-
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 }) {
|
|
11601
11872
|
return /* @__PURE__ */ jsx(Dock, {
|
|
11602
11873
|
identity: {
|
|
11603
11874
|
name: "",
|
|
@@ -11618,13 +11889,14 @@ function DockRenderer({ turns, lastTurn, operatorName, composing, onEndCall, voi
|
|
|
11618
11889
|
...onEndCall !== void 0 ? { onEndCall } : {},
|
|
11619
11890
|
...skinStyle !== void 0 ? { skinStyle } : {},
|
|
11620
11891
|
...attribution !== void 0 ? { attribution } : {},
|
|
11892
|
+
...privacyChoices !== void 0 ? { privacyChoices } : {},
|
|
11621
11893
|
...curationHref ? { curationHref } : {},
|
|
11622
11894
|
...productHref ? { productHref } : {},
|
|
11623
11895
|
...navigate ? { navigate } : {},
|
|
11624
11896
|
draft,
|
|
11625
11897
|
onDraftChange,
|
|
11626
11898
|
onSubmit: submit,
|
|
11627
|
-
revealSheet: showBasket && cart !== void 0 && cart.lines.length > 0 || attaching !== null,
|
|
11899
|
+
revealSheet: showBasket && cart !== void 0 && cart.lines.length > 0 || attaching !== null || capturing,
|
|
11628
11900
|
followKey: turns.reduce((n, turn) => n + 1 + turn.text.length + (turn.cards?.items.length ?? 0), 0) + (humanTyping ? 1 : 0),
|
|
11629
11901
|
...onAttach ? { onAttach } : {},
|
|
11630
11902
|
attachBusy: attaching !== null && !attaching.failed,
|
|
@@ -12157,7 +12429,7 @@ function WidgetCartSummary({ lines, subtotalMinor, currency, discountMinor, onCh
|
|
|
12157
12429
|
className: "rounded-2xl border border-black/10 bg-[var(--widget-bubble)] p-3",
|
|
12158
12430
|
children: [
|
|
12159
12431
|
/* @__PURE__ */ jsx("p", {
|
|
12160
|
-
className: "mb-2 text-xs font-semibold tracking-wide text-[var(--widget-foreground)] uppercase",
|
|
12432
|
+
className: "mb-2 text-xs font-semibold tracking-wide text-[var(--widget-foreground)] uppercase [&:lang(ar)]:tracking-normal [&:lang(hi)]:tracking-normal",
|
|
12161
12433
|
children: messages.cart_summary_title
|
|
12162
12434
|
}),
|
|
12163
12435
|
/* @__PURE__ */ jsx("ul", {
|
|
@@ -12231,6 +12503,10 @@ function CheckoutButton({ onCheckout, navigate, messages }) {
|
|
|
12231
12503
|
if (phase === "working") return;
|
|
12232
12504
|
setPhase("working");
|
|
12233
12505
|
const href = await onCheckout();
|
|
12506
|
+
if (href === false) {
|
|
12507
|
+
setPhase("idle");
|
|
12508
|
+
return;
|
|
12509
|
+
}
|
|
12234
12510
|
if (href === null) {
|
|
12235
12511
|
setPhase("failed");
|
|
12236
12512
|
return;
|
|
@@ -12424,7 +12700,7 @@ function TranscriptEvent({ event, awaitingReply, messages }) {
|
|
|
12424
12700
|
"data-testid": "widget-handoff-event",
|
|
12425
12701
|
"data-dock-follow": "",
|
|
12426
12702
|
children: [/* @__PURE__ */ jsxs("p", {
|
|
12427
|
-
className: "flex w-full items-center gap-3 text-[11px] font-medium tracking-wide text-[var(--widget-foreground-muted)]",
|
|
12703
|
+
className: "flex w-full items-center gap-3 text-[11px] font-medium tracking-wide text-[var(--widget-foreground-muted)] [&:lang(ar)]:tracking-normal [&:lang(hi)]:tracking-normal",
|
|
12428
12704
|
children: [
|
|
12429
12705
|
/* @__PURE__ */ jsx("span", {
|
|
12430
12706
|
"aria-hidden": "true",
|
|
@@ -12663,7 +12939,7 @@ function VoiceWidget({ renderer, generation, ...props }) {
|
|
|
12663
12939
|
});
|
|
12664
12940
|
}
|
|
12665
12941
|
/** `VoiceWidget` with the renderer decided — the component the CDN entries and `ConciergeHost` use. */
|
|
12666
|
-
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 }) {
|
|
12667
12943
|
const [draft, setDraft] = useState("");
|
|
12668
12944
|
const [sending, setSending] = useState(false);
|
|
12669
12945
|
/** Roomy mode — see the expand control in the header. Collapses back on close, so a reopened widget starts small. */
|
|
@@ -12932,20 +13208,24 @@ function VoiceWidgetWithRenderer({ renderer, state, turns, onToggleMic, onEndCal
|
|
|
12932
13208
|
onChange: (event) => void onFileSelected(event)
|
|
12933
13209
|
})] }) : null;
|
|
12934
13210
|
const onAttach = canAttach ? () => fileInputRef.current?.click() : void 0;
|
|
12935
|
-
const extras = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
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
|
+
] });
|
|
12949
13229
|
return /* @__PURE__ */ jsx(renderer, {
|
|
12950
13230
|
state,
|
|
12951
13231
|
turns,
|
|
@@ -12975,6 +13255,7 @@ function VoiceWidgetWithRenderer({ renderer, state, turns, onToggleMic, onEndCal
|
|
|
12975
13255
|
showBasket,
|
|
12976
13256
|
cart,
|
|
12977
13257
|
attaching,
|
|
13258
|
+
capturing: captureCard != null,
|
|
12978
13259
|
onAttach,
|
|
12979
13260
|
attachInput,
|
|
12980
13261
|
transcript: renderLog(turns),
|
|
@@ -12987,10 +13268,36 @@ function VoiceWidgetWithRenderer({ renderer, state, turns, onToggleMic, onEndCal
|
|
|
12987
13268
|
skinStyle,
|
|
12988
13269
|
avatar,
|
|
12989
13270
|
attribution,
|
|
13271
|
+
privacyChoices,
|
|
12990
13272
|
dock
|
|
12991
13273
|
});
|
|
12992
13274
|
}
|
|
12993
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
|
|
12994
13301
|
//#region ../widget-bridge/dist/index.js
|
|
12995
13302
|
/**
|
|
12996
13303
|
* The subset of {@link VISITOR_EVENT_KIND_NAMES} that is BEHAVIOURAL tracking
|
|
@@ -13023,7 +13330,15 @@ var CONSENT_REQUIRED_VISITOR_EVENT_KINDS$1 = [
|
|
|
13023
13330
|
"collection.viewed",
|
|
13024
13331
|
"cart.viewed",
|
|
13025
13332
|
"cart.changed",
|
|
13026
|
-
"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"
|
|
13027
13342
|
];
|
|
13028
13343
|
/** How long the ring stays on screen. Long enough to be seen, short enough not to become furniture. */
|
|
13029
13344
|
var SPOTLIGHT_RING_MS = 2e3;
|
|
@@ -13675,6 +13990,12 @@ function isSameOriginPath(value) {
|
|
|
13675
13990
|
return typeof value === "string" && SAME_ORIGIN_PATH_RE.test(value);
|
|
13676
13991
|
}
|
|
13677
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
|
+
/**
|
|
13678
13999
|
* Place a server-delivered turn by its `seq` rather than by when it arrived.
|
|
13679
14000
|
*
|
|
13680
14001
|
* `mergeIncoming` sorts within one delivered batch and then appends. A socket
|
|
@@ -13857,7 +14178,7 @@ function tokenTtlMs(res, expiresAtIso, clientNow) {
|
|
|
13857
14178
|
* proof") for why a bare `visitorId` is no longer trusted for rejoining.
|
|
13858
14179
|
*
|
|
13859
14180
|
* The client never MINTS a visitor id anymore — only the server does
|
|
13860
|
-
* (`
|
|
14181
|
+
* (`WidgetSession.resolveExternalVisitorId`). A client-minted id could
|
|
13861
14182
|
* never carry a valid proof, so under the new contract it would just be
|
|
13862
14183
|
* silently dropped and treated as a fresh visitor anyway (safe, but a wasted
|
|
13863
14184
|
* round trip and a pointless localStorage write). Instead the hook reads
|
|
@@ -14422,6 +14743,7 @@ function useChatSession(options) {
|
|
|
14422
14743
|
attribution,
|
|
14423
14744
|
...stored.visitorId ? { visitorId: stored.visitorId } : {},
|
|
14424
14745
|
...stored.visitorProof ? { visitorProof: stored.visitorProof } : {},
|
|
14746
|
+
...takeFlowLink(),
|
|
14425
14747
|
...hostRoutes !== void 0 ? { hostRoutes } : {}
|
|
14426
14748
|
})
|
|
14427
14749
|
});
|
|
@@ -14443,7 +14765,9 @@ function useChatSession(options) {
|
|
|
14443
14765
|
if (collector && body.visitorSessionId !== void 0 && ttlMs !== null) collector.setSession({
|
|
14444
14766
|
chatToken: body.chatToken,
|
|
14445
14767
|
visitorSessionId: body.visitorSessionId,
|
|
14446
|
-
expiresAt: receivedAt + ttlMs
|
|
14768
|
+
expiresAt: receivedAt + ttlMs,
|
|
14769
|
+
visitorId: body.visitorId,
|
|
14770
|
+
visitorProof: body.visitorProof
|
|
14447
14771
|
});
|
|
14448
14772
|
/**
|
|
14449
14773
|
* Paint the greeting the server just STORED — never a greeting this
|
|
@@ -14966,6 +15290,7 @@ function useChatSession(options) {
|
|
|
14966
15290
|
}
|
|
14967
15291
|
return status === 200;
|
|
14968
15292
|
}, [postSessionStateStatus]);
|
|
15293
|
+
const submitCapture = useCallback((answer) => postSessionStateStatus("/capture", answer), [postSessionStateStatus]);
|
|
14969
15294
|
/** See {@link UseChatSessionResult.pushPageContext}. */
|
|
14970
15295
|
const pushPageContext = useCallback(async (context) => postSessionState("/context", { context }), [postSessionState]);
|
|
14971
15296
|
const sendEvent = useCallback(async (events) => {
|
|
@@ -15194,6 +15519,11 @@ function useChatSession(options) {
|
|
|
15194
15519
|
...cartAttributionToken ? { cartAttributionToken } : {}
|
|
15195
15520
|
})
|
|
15196
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
|
+
}
|
|
15197
15527
|
if (!res.ok) return null;
|
|
15198
15528
|
const body = await res.json();
|
|
15199
15529
|
if (mountedRef.current) setCheckoutHandoffs((prev) => [...prev, body]);
|
|
@@ -15301,6 +15631,7 @@ function useChatSession(options) {
|
|
|
15301
15631
|
setCart,
|
|
15302
15632
|
pushCart,
|
|
15303
15633
|
pushPageContext,
|
|
15634
|
+
submitCapture,
|
|
15304
15635
|
sendEvent,
|
|
15305
15636
|
notifyTyping,
|
|
15306
15637
|
checkout,
|
|
@@ -15444,9 +15775,16 @@ async function streamReply(args) {
|
|
|
15444
15775
|
onActEvent(evt.data);
|
|
15445
15776
|
break;
|
|
15446
15777
|
}
|
|
15778
|
+
case "capture-card":
|
|
15447
15779
|
case "spotlight":
|
|
15448
15780
|
onActEvent(evt.data);
|
|
15449
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
|
+
}
|
|
15450
15788
|
case "escalated":
|
|
15451
15789
|
onEscalated();
|
|
15452
15790
|
break;
|
|
@@ -15472,7 +15810,7 @@ async function streamReply(args) {
|
|
|
15472
15810
|
* cache makes a second `start()` after `stop()` free).
|
|
15473
15811
|
*/
|
|
15474
15812
|
async function loadVoiceProtocol() {
|
|
15475
|
-
const [telemetry, chat] = await Promise.all([import("./telemetry-
|
|
15813
|
+
const [telemetry, chat] = await Promise.all([import("./telemetry-3f--vvdX.js"), import("./chat-R7z4DtMM.js")]);
|
|
15476
15814
|
return {
|
|
15477
15815
|
decodeTelemetry: telemetry.decodeTelemetry,
|
|
15478
15816
|
encodeCallerText: telemetry.encodeCallerText,
|
|
@@ -16406,6 +16744,64 @@ function place(context) {
|
|
|
16406
16744
|
return json.slice(0, json.lastIndexOf("\"capturedAt\""));
|
|
16407
16745
|
}
|
|
16408
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
|
+
/**
|
|
16409
16805
|
* The query-string parameter names a storefront's search box puts its text
|
|
16410
16806
|
* in, in the order they are tried.
|
|
16411
16807
|
*
|
|
@@ -16438,6 +16834,29 @@ function readSearchQueryParam(search) {
|
|
|
16438
16834
|
return;
|
|
16439
16835
|
}
|
|
16440
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
|
+
*/
|
|
16441
16860
|
/** The real `location.search` and `<html lang>`, or nothing outside a browser. */
|
|
16442
16861
|
function browserPageContextGlobals() {
|
|
16443
16862
|
if (typeof window === "undefined") return {};
|
|
@@ -16449,17 +16868,24 @@ function browserPageContextGlobals() {
|
|
|
16449
16868
|
/**
|
|
16450
16869
|
* `HostPageKind` → `PageContextType`.
|
|
16451
16870
|
*
|
|
16452
|
-
* The one mapping that is not the identity is `'other'
|
|
16453
|
-
*
|
|
16454
|
-
* front page because a home page is a `page.viewed` like
|
|
16455
|
-
* does need one, because "they are on the front page"
|
|
16456
|
-
* 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.
|
|
16457
16880
|
*
|
|
16458
16881
|
* @param kind the classified page kind
|
|
16459
16882
|
* @param path the page's pathname
|
|
16460
16883
|
*/
|
|
16461
16884
|
function pageContextTypeFor(kind, path) {
|
|
16462
|
-
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
|
+
}
|
|
16463
16889
|
return kind;
|
|
16464
16890
|
}
|
|
16465
16891
|
/**
|
|
@@ -16518,6 +16944,7 @@ var PageContextTracker = class {
|
|
|
16518
16944
|
started = false;
|
|
16519
16945
|
destroyed = false;
|
|
16520
16946
|
unsubscribePageChange;
|
|
16947
|
+
unsubscribeGateChange;
|
|
16521
16948
|
pending;
|
|
16522
16949
|
/** The last context that actually went out — see {@link samePageContext}. */
|
|
16523
16950
|
lastSent;
|
|
@@ -16550,12 +16977,14 @@ var PageContextTracker = class {
|
|
|
16550
16977
|
this.started = true;
|
|
16551
16978
|
this.capture();
|
|
16552
16979
|
this.unsubscribePageChange = this.bridge.onPageChange(this.pageChangeListener);
|
|
16980
|
+
this.unsubscribeGateChange = this.consent.onChange?.(this.pageChangeListener);
|
|
16553
16981
|
} catch {}
|
|
16554
16982
|
}
|
|
16555
16983
|
destroy() {
|
|
16556
16984
|
try {
|
|
16557
16985
|
this.destroyed = true;
|
|
16558
16986
|
this.unsubscribePageChange?.();
|
|
16987
|
+
this.unsubscribeGateChange?.();
|
|
16559
16988
|
if (this.pending !== void 0) this.timer.clearTimeout(this.pending);
|
|
16560
16989
|
this.pending = void 0;
|
|
16561
16990
|
} catch {}
|
|
@@ -16703,6 +17132,27 @@ function resolveHostRoutePath(url, target, routes) {
|
|
|
16703
17132
|
return `${base}${base.includes("?") ? "&" : "?"}${query}${fragment}`;
|
|
16704
17133
|
}
|
|
16705
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
|
|
16706
17156
|
//#region src/turn-order.ts
|
|
16707
17157
|
/**
|
|
16708
17158
|
* The widget's arrival clock. One instance per mounted widget (`useRef`), fed
|
|
@@ -16857,7 +17307,7 @@ var ACT_HOLD_MAX_MS = 15e3;
|
|
|
16857
17307
|
* than a silent no-op.
|
|
16858
17308
|
*/
|
|
16859
17309
|
function isActEvent(event) {
|
|
16860
|
-
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";
|
|
16861
17311
|
}
|
|
16862
17312
|
/**
|
|
16863
17313
|
* Do two storefront paths name the same PAGE — ignoring the query, the
|
|
@@ -17137,8 +17587,9 @@ function clampInteger(value, min, max) {
|
|
|
17137
17587
|
* through to (2) rather than surfacing, because a bridge that cannot answer
|
|
17138
17588
|
* is exactly the case (2) exists for. `null` from BOTH is a real outcome and
|
|
17139
17589
|
* is returned as such: `WidgetCartSummary`'s button renders its failure line
|
|
17140
|
-
* and stays pressable.
|
|
17141
|
-
*
|
|
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.
|
|
17142
17593
|
*/
|
|
17143
17594
|
async function resolveCheckoutUrl(bridge, startHandoff) {
|
|
17144
17595
|
try {
|
|
@@ -17146,7 +17597,8 @@ async function resolveCheckoutUrl(bridge, startHandoff) {
|
|
|
17146
17597
|
if (typeof hosted === "string" && hosted.length > 0) return hosted;
|
|
17147
17598
|
} catch {}
|
|
17148
17599
|
try {
|
|
17149
|
-
|
|
17600
|
+
const handoff = await startHandoff();
|
|
17601
|
+
return handoff === false ? false : handoff?.url ?? null;
|
|
17150
17602
|
} catch {
|
|
17151
17603
|
return null;
|
|
17152
17604
|
}
|
|
@@ -17197,7 +17649,7 @@ function ConciergeWidget({ renderer, ...props }) {
|
|
|
17197
17649
|
renderer: renderer ?? rendererFor(props.generation)
|
|
17198
17650
|
});
|
|
17199
17651
|
}
|
|
17200
|
-
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 }) {
|
|
17201
17653
|
/**
|
|
17202
17654
|
* Maps the tenant's semantic config fields onto the widget's historical
|
|
17203
17655
|
* CSS custom properties — this is the "one becomes the other" site
|
|
@@ -17324,6 +17776,7 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
17324
17776
|
* summary falls back to when it does.
|
|
17325
17777
|
*/
|
|
17326
17778
|
const [addedLines, setAddedLines] = useState([]);
|
|
17779
|
+
const [captureCard, setCaptureCard] = useState(null);
|
|
17327
17780
|
/** The host's own last answer, or `null` while it has given none. */
|
|
17328
17781
|
const [hostCart, setHostCart] = useState(null);
|
|
17329
17782
|
const mountedRef = useRef(true);
|
|
@@ -17893,6 +18346,31 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
17893
18346
|
while (streamingRef.current && actLiveRef.current && Date.now() < deadline) await new Promise((resolve) => setTimeout(resolve, ACT_HOLD_POLL_MS));
|
|
17894
18347
|
}, []);
|
|
17895
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
|
+
}
|
|
17896
18374
|
if (event.type !== "spotlight") {
|
|
17897
18375
|
if (!inCallRef.current) {
|
|
17898
18376
|
await waitForTypedTurnToLand();
|
|
@@ -17930,7 +18408,9 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
17930
18408
|
siteProfile,
|
|
17931
18409
|
performNavigate,
|
|
17932
18410
|
reportFailedSpotlight,
|
|
17933
|
-
waitForTypedTurnToLand
|
|
18411
|
+
waitForTypedTurnToLand,
|
|
18412
|
+
locale,
|
|
18413
|
+
session
|
|
17934
18414
|
]);
|
|
17935
18415
|
/**
|
|
17936
18416
|
* The acts the concierge asked for, from both legs, performed exactly once
|
|
@@ -18635,6 +19115,26 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
18635
19115
|
const cartLines = hostLines ?? addedLines;
|
|
18636
19116
|
const cartSubtotalMinor = hostCart?.subtotalCents ?? cartLines.reduce((total, line) => total + line.priceMinor * line.quantity, 0);
|
|
18637
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
|
+
/**
|
|
18638
19138
|
* Fire the checkout. `undefined` (rather than an `onCheckout` that always
|
|
18639
19139
|
* fails) whenever there is no basket at all, so `VoiceWidget` renders no
|
|
18640
19140
|
* summary — the same "additive per caller" posture `onAddToCart` keeps.
|
|
@@ -18644,11 +19144,18 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
18644
19144
|
variantId: line.variantId,
|
|
18645
19145
|
quantity: line.quantity
|
|
18646
19146
|
}));
|
|
18647
|
-
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
|
+
});
|
|
18648
19154
|
}, [
|
|
18649
19155
|
addedLines,
|
|
18650
19156
|
bridge,
|
|
18651
|
-
session
|
|
19157
|
+
session,
|
|
19158
|
+
showCheckoutCards
|
|
18652
19159
|
]);
|
|
18653
19160
|
/**
|
|
18654
19161
|
* The one line under the header, and the order the three claimants take it
|
|
@@ -18936,8 +19443,10 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
18936
19443
|
...skinStyle !== void 0 ? { skinStyle } : {},
|
|
18937
19444
|
...avatar !== void 0 ? { avatar } : {},
|
|
18938
19445
|
...attribution !== void 0 ? { attribution } : {},
|
|
18939
|
-
|
|
19446
|
+
...privacyChoices !== void 0 ? { privacyChoices } : {},
|
|
19447
|
+
dock: dockProps,
|
|
19448
|
+
...captureCard !== null ? { captureCard: /* @__PURE__ */ jsx(CaptureCardHost, { options: captureCard }) } : {}
|
|
18940
19449
|
});
|
|
18941
19450
|
}
|
|
18942
19451
|
//#endregion
|
|
18943
|
-
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 };
|