@saar-ai/web-widget 0.25.1 → 0.26.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 +3 -1
- package/dist/capture-card/capture-card-dom.d.ts.map +1 -1
- package/dist/chunks/{capture-card-D7DqAq-N.js → capture-card-DiTdcTCh.js} +0 -5
- package/dist/chunks/{capture-card-dom-C0IKjuBA.js → capture-card-dom-gYwMglNe.js} +154 -16
- package/dist/chunks/{chat-Bvu3c3dk.js → chat-B6vq8jBL.js} +1 -1
- package/dist/chunks/{host-widget-DiHyQxke.js → host-widget-4FfPd2gs.js} +14 -3
- package/dist/flow-link.d.ts +18 -0
- package/dist/flow-link.d.ts.map +1 -1
- package/dist/forms/forms-dom.d.ts +99 -0
- package/dist/forms/forms-dom.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/next/index.js +1 -1
- package/dist/use-chat-session.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -41,9 +41,11 @@ export interface CaptureCardOptions {
|
|
|
41
41
|
/** Asked for by a refused checkout: `'last'` is the final card before checkout opens. */
|
|
42
42
|
readonly checkout?: 'more' | 'last';
|
|
43
43
|
}
|
|
44
|
-
type CopyKey = 'checkoutIntro' | 'checkoutReady' | 'phoneLocal' | 'send' | 'refuse' | 'choose' | 'saved' | 'declined' | 'invalid' | 'closed' | 'failed' | CaptureCardValueError;
|
|
44
|
+
type CopyKey = 'checkoutIntro' | 'checkoutReady' | 'phoneLocal' | 'dialCode' | 'send' | 'refuse' | 'choose' | 'saved' | 'declined' | 'invalid' | 'closed' | 'failed' | CaptureCardValueError;
|
|
45
45
|
/** Lives here, not in `messages.ts`, so the copy ships in this chunk and not in `ui`. */
|
|
46
46
|
export declare const CAPTURE_CARD_COPY: Readonly<Record<'en' | 'ar' | 'hi', Readonly<Record<CopyKey, string>>>>;
|
|
47
|
+
/** The national digits to append to `+code`: the trunk prefix dropped, where there is one. */
|
|
48
|
+
export declare function nationalDigits(code: string, digits: string): string;
|
|
47
49
|
/**
|
|
48
50
|
* Returns the teardown.
|
|
49
51
|
* @param root an empty element the host owns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-card-dom.d.ts","sourceRoot":"","sources":["../../src/capture-card/capture-card-dom.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"capture-card-dom.d.ts","sourceRoot":"","sources":["../../src/capture-card/capture-card-dom.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC3B,MAAM,uCAAuC,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,yBAAyB,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1F,wFAAwF;IACxF,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,QAAQ,CAAC,EAAE,CAAC;CAC1E;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ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dist/capture-card.js
|
|
2
|
-
/**
|
|
3
|
-
* Capture card rules shared by the server and the widget's lazy card chunk.
|
|
4
|
-
* Must stay zod-free and import-free: the chunk may not pull zod. The check
|
|
5
|
-
* here must never refuse a value the server accepts (pinned in `apps/api`).
|
|
6
|
-
*/
|
|
7
2
|
/** The `type` of the widget event that carries a card. */
|
|
8
3
|
var CAPTURE_CARD_EVENT_TYPE = "capture-card";
|
|
9
4
|
/**
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import { l as captureCardOutcomeOf, u as checkCaptureCardValue } from "./capture-card-
|
|
1
|
+
import { l as captureCardOutcomeOf, u as checkCaptureCardValue } from "./capture-card-DiTdcTCh.js";
|
|
2
|
+
//#region ../widget-protocol/dist/capture-card-dial-codes.js
|
|
3
|
+
/**
|
|
4
|
+
* Calling code, then its regions as consecutive two-letter codes, entries
|
|
5
|
+
* split by `;`. The first region of a code is the one people mean by it; the rest are alphabetical.
|
|
6
|
+
*/
|
|
7
|
+
var DIAL_CODE_TABLE = "1:USAGAIASBBBMBSCADMDOGDGUJMKNKYLCMPMSPRSXTCTTVCVGVI;7:RUKZ;20:EG;27:ZA;30:GR;31:NL;32:BE;33:FR;34:ES;36:HU;39:ITVA;40:RO;41:CH;43:AT;44:GBGGIMJE;45:DK;46:SE;47:NOSJ;48:PL;49:DE;51:PE;52:MX;53:CU;54:AR;55:BR;56:CL;57:CO;58:VE;60:MY;61:AUCCCX;62:ID;63:PH;64:NZ;65:SG;66:TH;81:JP;82:KR;84:VN;86:CN;90:TR;91:IN;92:PK;93:AF;94:LK;95:MM;98:IR;211:SS;212:MAEH;213:DZ;216:TN;218:LY;220:GM;221:SN;222:MR;223:ML;224:GN;225:CI;226:BF;227:NE;228:TG;229:BJ;230:MU;231:LR;232:SL;233:GH;234:NG;235:TD;236:CF;237:CM;238:CV;239:ST;240:GQ;241:GA;242:CG;243:CD;244:AO;245:GW;246:IO;247:AC;248:SC;249:SD;250:RW;251:ET;252:SO;253:DJ;254:KE;255:TZ;256:UG;257:BI;258:MZ;260:ZM;261:MG;262:REYT;263:ZW;264:NA;265:MW;266:LS;267:BW;268:SZ;269:KM;290:SHTA;291:ER;297:AW;298:FO;299:GL;350:GI;351:PT;352:LU;353:IE;354:IS;355:AL;356:MT;357:CY;358:FIAX;359:BG;370:LT;371:LV;372:EE;373:MD;374:AM;375:BY;376:AD;377:MC;378:SM;380:UA;381:RS;382:ME;383:XK;385:HR;386:SI;387:BA;389:MK;420:CZ;421:SK;423:LI;500:FK;501:BZ;502:GT;503:SV;504:HN;505:NI;506:CR;507:PA;508:PM;509:HT;590:GPBLMF;591:BO;592:GY;593:EC;594:GF;595:PY;596:MQ;597:SR;598:UY;599:CWBQ;670:TL;672:NF;673:BN;674:NR;675:PG;676:TO;677:SB;678:VU;679:FJ;680:PW;681:WF;682:CK;683:NU;685:WS;686:KI;687:NC;688:TV;689:PF;690:TK;691:FM;692:MH;850:KP;852:HK;853:MO;855:KH;856:LA;880:BD;886:TW;960:MV;961:LB;962:JO;963:SY;964:IQ;965:KW;966:SA;967:YE;968:OM;970:PS;971:AE;972:IL;973:BH;974:QA;975:BT;976:MN;977:NP;992:TJ;993:TM;994:AZ;995:GE;996:KG;998:UZ";
|
|
8
|
+
//#endregion
|
|
2
9
|
//#region src/capture-card/capture-card-dom.ts
|
|
3
10
|
/**
|
|
4
11
|
* The capture card, plain DOM, in its own lazy chunk (`capture-card.mjs`).
|
|
@@ -13,6 +20,7 @@ var CAPTURE_CARD_COPY = {
|
|
|
13
20
|
checkoutIntro: "Needed before checkout.",
|
|
14
21
|
checkoutReady: "Thanks — you can check out now.",
|
|
15
22
|
phoneLocal: "Enter a phone number.",
|
|
23
|
+
dialCode: "Country code",
|
|
16
24
|
send: "Send",
|
|
17
25
|
refuse: "I’d rather not say",
|
|
18
26
|
choose: "Choose one",
|
|
@@ -22,7 +30,7 @@ var CAPTURE_CARD_COPY = {
|
|
|
22
30
|
length: "That is too long.",
|
|
23
31
|
characters: "That contains characters that can’t be used.",
|
|
24
32
|
email: "Enter an email address, like name@example.com.",
|
|
25
|
-
phone: "
|
|
33
|
+
phone: "Choose the country code and enter the number.",
|
|
26
34
|
choice: "Choose one of the options.",
|
|
27
35
|
number: "Enter a number, like 12.",
|
|
28
36
|
date: "Enter a date.",
|
|
@@ -36,6 +44,7 @@ var CAPTURE_CARD_COPY = {
|
|
|
36
44
|
checkoutIntro: "مطلوب قبل إتمام الشراء.",
|
|
37
45
|
checkoutReady: "شكرًا — يمكنك إتمام الشراء الآن.",
|
|
38
46
|
phoneLocal: "يُرجى إدخال رقم هاتف.",
|
|
47
|
+
dialCode: "رمز الدولة",
|
|
39
48
|
send: "إرسال",
|
|
40
49
|
refuse: "أفضّل عدم الإجابة",
|
|
41
50
|
choose: "يُرجى الاختيار",
|
|
@@ -45,7 +54,7 @@ var CAPTURE_CARD_COPY = {
|
|
|
45
54
|
length: "النص طويل جدًا.",
|
|
46
55
|
characters: "يحتوي على أحرف لا يمكن استخدامها.",
|
|
47
56
|
email: "يُرجى إدخال بريد إلكتروني، مثل name@example.com.",
|
|
48
|
-
phone: "يُرجى
|
|
57
|
+
phone: "يُرجى اختيار رمز الدولة وإدخال الرقم.",
|
|
49
58
|
choice: "يُرجى اختيار أحد الخيارات.",
|
|
50
59
|
number: "يُرجى إدخال رقم، مثل 12.",
|
|
51
60
|
date: "يُرجى إدخال تاريخ.",
|
|
@@ -59,6 +68,7 @@ var CAPTURE_CARD_COPY = {
|
|
|
59
68
|
checkoutIntro: "चेकआउट से पहले ज़रूरी।",
|
|
60
69
|
checkoutReady: "धन्यवाद — अब आप चेकआउट कर सकते हैं।",
|
|
61
70
|
phoneLocal: "फ़ोन नंबर दर्ज करें।",
|
|
71
|
+
dialCode: "देश कोड",
|
|
62
72
|
send: "भेजें",
|
|
63
73
|
refuse: "मुझे नहीं बताना",
|
|
64
74
|
choose: "एक चुनें",
|
|
@@ -68,7 +78,7 @@ var CAPTURE_CARD_COPY = {
|
|
|
68
78
|
length: "यह बहुत लंबा है।",
|
|
69
79
|
characters: "इसमें ऐसे अक्षर हैं जिनका उपयोग नहीं हो सकता।",
|
|
70
80
|
email: "ईमेल पता दर्ज करें, जैसे name@example.com।",
|
|
71
|
-
phone: "देश कोड
|
|
81
|
+
phone: "देश कोड चुनें और नंबर दर्ज करें।",
|
|
72
82
|
choice: "विकल्पों में से एक चुनें।",
|
|
73
83
|
number: "कोई संख्या दर्ज करें, जैसे 12।",
|
|
74
84
|
date: "कोई तारीख दर्ज करें।",
|
|
@@ -134,6 +144,100 @@ function countryChoices(locale) {
|
|
|
134
144
|
}
|
|
135
145
|
return out.sort((x, y) => x[1].localeCompare(y[1], locale));
|
|
136
146
|
}
|
|
147
|
+
var ASCII_ZERO_BLOCKS = [
|
|
148
|
+
1632,
|
|
149
|
+
1776,
|
|
150
|
+
1984,
|
|
151
|
+
2406,
|
|
152
|
+
2534,
|
|
153
|
+
2662,
|
|
154
|
+
2790,
|
|
155
|
+
2918,
|
|
156
|
+
3046,
|
|
157
|
+
3174,
|
|
158
|
+
3302,
|
|
159
|
+
3430,
|
|
160
|
+
3664,
|
|
161
|
+
3792,
|
|
162
|
+
3872,
|
|
163
|
+
4160,
|
|
164
|
+
6112,
|
|
165
|
+
6160,
|
|
166
|
+
65296
|
|
167
|
+
];
|
|
168
|
+
/** Digits of any script (`\p{Nd}`) as ASCII `0-9`; other characters are kept. */
|
|
169
|
+
function toAsciiDigits(value) {
|
|
170
|
+
return value.replace(/\p{Nd}/gu, (ch) => {
|
|
171
|
+
const cp = ch.codePointAt(0);
|
|
172
|
+
const zero = ASCII_ZERO_BLOCKS.find((z) => cp >= z && cp <= z + 9);
|
|
173
|
+
return zero === void 0 ? ch : String(cp - zero);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/** Calling codes whose national numbers keep their leading 0. */
|
|
177
|
+
var KEEPS_LEADING_ZERO = /* @__PURE__ */ new Set([
|
|
178
|
+
"39",
|
|
179
|
+
"378",
|
|
180
|
+
"379",
|
|
181
|
+
"225",
|
|
182
|
+
"229",
|
|
183
|
+
"241",
|
|
184
|
+
"242"
|
|
185
|
+
]);
|
|
186
|
+
/** The national digits to append to `+code`: the trunk prefix dropped, where there is one. */
|
|
187
|
+
function nationalDigits(code, digits) {
|
|
188
|
+
if (KEEPS_LEADING_ZERO.has(code)) return digits;
|
|
189
|
+
if (code === "36" && digits.startsWith("06")) return digits.slice(2);
|
|
190
|
+
return digits.replace(/^0/, "");
|
|
191
|
+
}
|
|
192
|
+
/** Every region with a calling code, in the shopper's language, as `[region, code, label]`. */
|
|
193
|
+
function dialChoices(locale) {
|
|
194
|
+
let names = null;
|
|
195
|
+
try {
|
|
196
|
+
names = new Intl.DisplayNames([locale, "en"], {
|
|
197
|
+
type: "region",
|
|
198
|
+
fallback: "code"
|
|
199
|
+
});
|
|
200
|
+
} catch {}
|
|
201
|
+
const out = [];
|
|
202
|
+
for (const entry of DIAL_CODE_TABLE.split(";")) {
|
|
203
|
+
const [code = "", regions = ""] = entry.split(":");
|
|
204
|
+
for (let i = 0; i < regions.length; i += 2) {
|
|
205
|
+
const region = regions.slice(i, i + 2);
|
|
206
|
+
const flag = String.fromCodePoint(127397 + region.charCodeAt(0), 127397 + region.charCodeAt(1));
|
|
207
|
+
out.push([
|
|
208
|
+
region,
|
|
209
|
+
code,
|
|
210
|
+
`${flag} ${names?.of(region) ?? region} (+${code})`
|
|
211
|
+
]);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return out.sort((x, y) => x[2].slice(5).localeCompare(y[2].slice(5), locale));
|
|
215
|
+
}
|
|
216
|
+
/** The region whose calling code starts `digits`: `prefer` if it shares the code, else the code's main one. */
|
|
217
|
+
function regionOfDigits(digits, prefer) {
|
|
218
|
+
const entries = DIAL_CODE_TABLE.split(";");
|
|
219
|
+
for (let n = 3; n > 0; n--) {
|
|
220
|
+
const entry = entries.find((e) => e.startsWith(`${digits.slice(0, n)}:`));
|
|
221
|
+
if (entry !== void 0) {
|
|
222
|
+
const regions = entry.slice(entry.indexOf(":") + 1);
|
|
223
|
+
return regions.match(/../g).includes(prefer) ? prefer : regions.slice(0, 2);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return "";
|
|
227
|
+
}
|
|
228
|
+
function styleField(field) {
|
|
229
|
+
Object.assign(field.style, {
|
|
230
|
+
width: field instanceof HTMLSelectElement ? "auto" : "100%",
|
|
231
|
+
minWidth: "0",
|
|
232
|
+
boxSizing: "border-box",
|
|
233
|
+
padding: "8px 10px",
|
|
234
|
+
borderRadius: "8px",
|
|
235
|
+
border: "1px solid var(--widget-foreground-muted)",
|
|
236
|
+
background: "transparent",
|
|
237
|
+
color: "inherit",
|
|
238
|
+
font: "inherit"
|
|
239
|
+
});
|
|
240
|
+
}
|
|
137
241
|
var nextId = 0;
|
|
138
242
|
/**
|
|
139
243
|
* Returns the teardown.
|
|
@@ -199,6 +303,9 @@ function mountCaptureCard(root, options) {
|
|
|
199
303
|
const choices = spec.input === "choice" && spec.choices && spec.choices.length > 0 ? spec.choices : null;
|
|
200
304
|
const listed = choices !== null ? choices.map((choice) => [choice, choice]) : spec.input === "country" ? countryChoices(options.locale) : null;
|
|
201
305
|
let field;
|
|
306
|
+
/** What the card sends for this detail: the phone's code and number joined. */
|
|
307
|
+
let read = () => field.value;
|
|
308
|
+
let holder = null;
|
|
202
309
|
if (listed !== null) {
|
|
203
310
|
const select = el("select");
|
|
204
311
|
const placeholder = el("option", copy.choose);
|
|
@@ -221,20 +328,50 @@ function mountCaptureCard(root, options) {
|
|
|
221
328
|
}
|
|
222
329
|
if (spec.maxLength !== void 0) input.maxLength = spec.maxLength;
|
|
223
330
|
field = input;
|
|
331
|
+
if (spec.input === "phone") {
|
|
332
|
+
const choices = dialChoices(options.locale);
|
|
333
|
+
const dial = el("select");
|
|
334
|
+
dial.setAttribute("aria-label", copy.dialCode);
|
|
335
|
+
const none = el("option", copy.dialCode);
|
|
336
|
+
none.value = "";
|
|
337
|
+
dial.append(none);
|
|
338
|
+
for (const [region, , text] of choices) {
|
|
339
|
+
const option = el("option", text);
|
|
340
|
+
option.value = region;
|
|
341
|
+
dial.append(option);
|
|
342
|
+
}
|
|
343
|
+
dial.value = spec.region ?? "";
|
|
344
|
+
dial.style.maxWidth = "45%";
|
|
345
|
+
input.addEventListener("input", () => {
|
|
346
|
+
if (input.value.trim().startsWith("+")) {
|
|
347
|
+
const digits = input.value.replace(/\D/g, "");
|
|
348
|
+
dial.value = regionOfDigits(digits, dial.value) || dial.value;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
read = () => {
|
|
352
|
+
const raw = input.value.trim();
|
|
353
|
+
const digits = toAsciiDigits(raw).replace(/\D/g, "");
|
|
354
|
+
const code = choices.find((c) => c[0] === dial.value)?.[1];
|
|
355
|
+
if (digits.length < 4) return raw;
|
|
356
|
+
if (raw.startsWith("+")) return raw;
|
|
357
|
+
if (digits.length > 2 && /^[0٠۰०]{2}/u.test(raw)) return `+${digits.slice(2)}`;
|
|
358
|
+
if (code === void 0 || dial.value === spec.region) return raw;
|
|
359
|
+
return `+${code}${nationalDigits(code, digits)}`;
|
|
360
|
+
};
|
|
361
|
+
holder = el("div");
|
|
362
|
+
Object.assign(holder.style, {
|
|
363
|
+
display: "flex",
|
|
364
|
+
gap: "6px",
|
|
365
|
+
direction: "ltr"
|
|
366
|
+
});
|
|
367
|
+
holder.append(dial, input);
|
|
368
|
+
styleField(dial);
|
|
369
|
+
}
|
|
224
370
|
}
|
|
225
371
|
field.id = `${rowId}-input`;
|
|
226
372
|
field.name = spec.field;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
boxSizing: "border-box",
|
|
230
|
-
padding: "8px 10px",
|
|
231
|
-
borderRadius: "8px",
|
|
232
|
-
border: "1px solid var(--widget-foreground-muted)",
|
|
233
|
-
background: "transparent",
|
|
234
|
-
color: "inherit",
|
|
235
|
-
font: "inherit"
|
|
236
|
-
});
|
|
237
|
-
form.append(field);
|
|
373
|
+
styleField(field);
|
|
374
|
+
form.append(holder ?? field);
|
|
238
375
|
const error = el("p");
|
|
239
376
|
error.id = `${rowId}-error`;
|
|
240
377
|
error.setAttribute("aria-live", "polite");
|
|
@@ -249,6 +386,7 @@ function mountCaptureCard(root, options) {
|
|
|
249
386
|
return {
|
|
250
387
|
spec,
|
|
251
388
|
field,
|
|
389
|
+
read,
|
|
252
390
|
error,
|
|
253
391
|
choices,
|
|
254
392
|
done: false
|
|
@@ -386,7 +524,7 @@ function mountCaptureCard(root, options) {
|
|
|
386
524
|
...spec.maxLength !== void 0 ? { maxLength: spec.maxLength } : {},
|
|
387
525
|
...choices !== null ? { choices } : {},
|
|
388
526
|
...spec.region ? { region: spec.region } : {}
|
|
389
|
-
},
|
|
527
|
+
}, row.read());
|
|
390
528
|
if (!checked.ok) {
|
|
391
529
|
showError(row, checked.error);
|
|
392
530
|
field.focus();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CAPTURE_CARD_INPUTS, c as CAPTURE_SAVED_EVENT_TYPE, i as CAPTURE_CARD_FIELD_PATTERN, n as CAPTURE_CARD_CONSENT_MAX, o as CAPTURE_CARD_REGION_PATTERN, r as CAPTURE_CARD_EVENT_TYPE, s as CAPTURE_CARD_VALUE_MAX, t as CAPTURE_CARD_CONSENT_CHANNELS } from "./capture-card-
|
|
1
|
+
import { a as CAPTURE_CARD_INPUTS, c as CAPTURE_SAVED_EVENT_TYPE, i as CAPTURE_CARD_FIELD_PATTERN, n as CAPTURE_CARD_CONSENT_MAX, o as CAPTURE_CARD_REGION_PATTERN, r as CAPTURE_CARD_EVENT_TYPE, s as CAPTURE_CARD_VALUE_MAX, t as CAPTURE_CARD_CONSENT_CHANNELS } from "./capture-card-DiTdcTCh.js";
|
|
2
2
|
import { a as isSafeFormSelector, i as isSafeFillValue, r as isSafeControlName, t as FILL_FORM_EVENT_TYPE } from "./form-fill-B-h6Uw1t.js";
|
|
3
3
|
import { a as httpUrl, c as number, d as string, f as union, i as discriminatedUnion, l as object, n as array, o as literal, p as uuid, r as boolean, t as _enum, u as record } from "./schemas-DgC5Pex0.js";
|
|
4
4
|
//#region ../widget-protocol/dist/act.js
|
|
@@ -14400,6 +14400,14 @@ function takeFlowLink() {
|
|
|
14400
14400
|
return {};
|
|
14401
14401
|
}
|
|
14402
14402
|
}
|
|
14403
|
+
/**
|
|
14404
|
+
* A tracked link's identify parameter, held in this tab's memory only until a
|
|
14405
|
+
* session boot carries it (`{ identifyLink }` spreads straight into the body).
|
|
14406
|
+
* One object per page, on `globalThis`, because the core and the UI are
|
|
14407
|
+
* separate bundles with their own copy of this module: whichever boots the
|
|
14408
|
+
* session sends what the core captured.
|
|
14409
|
+
*/
|
|
14410
|
+
var identifyLink = globalThis.wgtIdentifyLink ??= {};
|
|
14403
14411
|
//#endregion
|
|
14404
14412
|
//#region ../widget-bridge/dist/index.js
|
|
14405
14413
|
/**
|
|
@@ -14441,7 +14449,8 @@ var CONSENT_REQUIRED_VISITOR_EVENT_KINDS$1 = [
|
|
|
14441
14449
|
"element.clicked",
|
|
14442
14450
|
"form.submitted",
|
|
14443
14451
|
"scheduler.booked",
|
|
14444
|
-
"visit.returned"
|
|
14452
|
+
"visit.returned",
|
|
14453
|
+
"cart.seen"
|
|
14445
14454
|
];
|
|
14446
14455
|
/** How long the ring stays on screen. Long enough to be seen, short enough not to become furniture. */
|
|
14447
14456
|
var SPOTLIGHT_RING_MS = 2e3;
|
|
@@ -16084,10 +16093,12 @@ function useChatSession(options) {
|
|
|
16084
16093
|
...stored.visitorId ? { visitorId: stored.visitorId } : {},
|
|
16085
16094
|
...stored.visitorProof ? { visitorProof: stored.visitorProof } : {},
|
|
16086
16095
|
...takeFlowLink(),
|
|
16096
|
+
...identifyLink,
|
|
16087
16097
|
...hostRoutes !== void 0 ? { hostRoutes } : {}
|
|
16088
16098
|
})
|
|
16089
16099
|
});
|
|
16090
16100
|
if (!res.ok) throw new Error(BOOT_FAILED);
|
|
16101
|
+
delete identifyLink.identifyLink;
|
|
16091
16102
|
const body = await res.json();
|
|
16092
16103
|
if (isStale?.() || !mountedRef.current) return;
|
|
16093
16104
|
const receivedAt = now();
|
|
@@ -17401,7 +17412,7 @@ function callStartStamp(spoken, others) {
|
|
|
17401
17412
|
* cache makes a second `start()` after `stop()` free).
|
|
17402
17413
|
*/
|
|
17403
17414
|
async function loadVoiceProtocol() {
|
|
17404
|
-
const [telemetry, chat] = await Promise.all([import("./telemetry-ZeV7hBI7.js"), import("./chat-
|
|
17415
|
+
const [telemetry, chat] = await Promise.all([import("./telemetry-ZeV7hBI7.js"), import("./chat-B6vq8jBL.js")]);
|
|
17405
17416
|
return {
|
|
17406
17417
|
decodeTelemetry: telemetry.decodeTelemetry,
|
|
17407
17418
|
encodeCallerText: telemetry.encodeCallerText,
|
|
@@ -18892,7 +18903,7 @@ function CaptureCardHost({ options }) {
|
|
|
18892
18903
|
useEffect(() => {
|
|
18893
18904
|
let dispose;
|
|
18894
18905
|
let live = true;
|
|
18895
|
-
import("./capture-card-dom-
|
|
18906
|
+
import("./capture-card-dom-gYwMglNe.js").then(({ mountCaptureCard }) => {
|
|
18896
18907
|
if (live && ref.current) dispose = mountCaptureCard(ref.current, options);
|
|
18897
18908
|
}).catch(() => void 0);
|
|
18898
18909
|
return () => {
|
package/dist/flow-link.d.ts
CHANGED
|
@@ -10,4 +10,22 @@ export declare const FLOW_LINK_PARAM = "wgt_flow";
|
|
|
10
10
|
export declare function takeFlowLink(): {
|
|
11
11
|
flowLink?: string;
|
|
12
12
|
};
|
|
13
|
+
/** The query parameter a tracked link's redirect adds (`CLICK_IDENTIFY_PARAM` in the API). */
|
|
14
|
+
export declare const IDENTIFY_LINK_PARAM = "wgt_id";
|
|
15
|
+
/**
|
|
16
|
+
* A tracked link's identify parameter, held in this tab's memory only until a
|
|
17
|
+
* session boot carries it (`{ identifyLink }` spreads straight into the body).
|
|
18
|
+
* One object per page, on `globalThis`, because the core and the UI are
|
|
19
|
+
* separate bundles with their own copy of this module: whichever boots the
|
|
20
|
+
* session sends what the core captured.
|
|
21
|
+
*/
|
|
22
|
+
export declare const identifyLink: {
|
|
23
|
+
identifyLink?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Take a tracked link's identify parameter off the address bar NOW, before
|
|
27
|
+
* any other script on the page reads the URL, into {@link identifyLink}
|
|
28
|
+
* (never stored). The server refuses it once its 30 minutes are up.
|
|
29
|
+
*/
|
|
30
|
+
export declare function captureIdentifyLink(): void;
|
|
13
31
|
//# sourceMappingURL=flow-link.d.ts.map
|
package/dist/flow-link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-link.d.ts","sourceRoot":"","sources":["../src/flow-link.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,eAAO,MAAM,eAAe,aAAa,CAAC;AAE1C;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAapD"}
|
|
1
|
+
{"version":3,"file":"flow-link.d.ts","sourceRoot":"","sources":["../src/flow-link.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,eAAO,MAAM,eAAe,aAAa,CAAC;AAE1C;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAapD;AAED,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAEzB,CAAC;AAE1B;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAU1C"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sign-up forms and popups (Klaviyo parity epic 5.9), plain DOM in their own
|
|
3
|
+
* lazy chunk (`forms.mjs`). `core` requests this chunk only when the widget
|
|
4
|
+
* config carries `forms: true`, which the api sends only while the tenant's
|
|
5
|
+
* `forms` flag is on; without it nothing here is downloaded or run.
|
|
6
|
+
*
|
|
7
|
+
* Imports nothing: no React, no zod, no other module of this package. Tenant
|
|
8
|
+
* text is set with `textContent`, never HTML. Popups and flyouts draw inside
|
|
9
|
+
* the widget's own shadow root and read its `--wgt-*` theme; an embedded form
|
|
10
|
+
* draws in a shadow root on the page's `[data-signup-form="<id>"]` element.
|
|
11
|
+
*/
|
|
12
|
+
export type FormsLocale = 'en' | 'ar' | 'hi';
|
|
13
|
+
type FieldMode = 'off' | 'optional' | 'required';
|
|
14
|
+
type Channel = 'email' | 'sms' | 'whatsapp';
|
|
15
|
+
interface FormCopy {
|
|
16
|
+
title: string;
|
|
17
|
+
body: string;
|
|
18
|
+
button: string;
|
|
19
|
+
success: string;
|
|
20
|
+
}
|
|
21
|
+
export interface WidgetFormSpec {
|
|
22
|
+
id: string;
|
|
23
|
+
version: number;
|
|
24
|
+
kind: 'popup' | 'flyout' | 'embed';
|
|
25
|
+
fields: Record<'email' | 'phone' | 'name', FieldMode>;
|
|
26
|
+
copy: Partial<Record<FormsLocale, FormCopy>>;
|
|
27
|
+
consent: Partial<Record<Channel, Partial<Record<FormsLocale, string>>>>;
|
|
28
|
+
/** The SHA-256 of each consent text, sent back for the ticked boxes so the api knows what was shown. */
|
|
29
|
+
consentHashes?: Partial<Record<Channel, Partial<Record<FormsLocale, string>>>>;
|
|
30
|
+
targeting: {
|
|
31
|
+
showOn: string[];
|
|
32
|
+
hideOn: string[];
|
|
33
|
+
delaySeconds: number;
|
|
34
|
+
scrollPercent: number | null;
|
|
35
|
+
exitIntent: boolean;
|
|
36
|
+
audience: 'all' | 'new' | 'known';
|
|
37
|
+
device: 'all' | 'desktop' | 'mobile';
|
|
38
|
+
frequencyDays: number;
|
|
39
|
+
};
|
|
40
|
+
successPath: string | null;
|
|
41
|
+
}
|
|
42
|
+
export interface StartFormsOptions {
|
|
43
|
+
readonly win: Window;
|
|
44
|
+
readonly doc: Document;
|
|
45
|
+
/** The widget's shadow root: popups and flyouts draw here. */
|
|
46
|
+
readonly root: ShadowRoot;
|
|
47
|
+
/** The widget's host element, carrying the `--wgt-*` theme for the widget generation. */
|
|
48
|
+
readonly host: HTMLElement;
|
|
49
|
+
readonly apiBase: string;
|
|
50
|
+
readonly embedKey: string;
|
|
51
|
+
readonly fetchImpl: typeof fetch;
|
|
52
|
+
readonly locale: string;
|
|
53
|
+
readonly now?: () => number;
|
|
54
|
+
}
|
|
55
|
+
export interface FormsHandle {
|
|
56
|
+
destroy(): void;
|
|
57
|
+
}
|
|
58
|
+
/** Neutral storage keys: no brand name on the host page (package branding guardrail). */
|
|
59
|
+
export declare const FORMS_CLOSED_KEY = "wgt_fc_v1";
|
|
60
|
+
export declare const FORMS_SUBMITTED_KEY = "wgt_fs_v1";
|
|
61
|
+
export declare const FORMS_KNOWN_KEY = "wgt_fk_v1";
|
|
62
|
+
type CopyKey = 'close' | 'email' | 'phone' | 'name' | 'required' | 'emailInvalid' | 'phoneInvalid' | 'sending' | 'failed' | 'changed' | 'tooMany';
|
|
63
|
+
/** The form chrome's words; the tenant writes the title, body, button, success and consent text. */
|
|
64
|
+
export declare const FORMS_COPY: Readonly<Record<FormsLocale, Record<CopyKey, string>>>;
|
|
65
|
+
/** The language to draw a form in: the widget's, else English, else the form's first. */
|
|
66
|
+
export declare function pickLocale(form: WidgetFormSpec, locale: string): FormsLocale | null;
|
|
67
|
+
/**
|
|
68
|
+
* A URL rule against the page path (path and query): `*` matches any run of
|
|
69
|
+
* characters, and without one the path must be exactly the rule. Matched as
|
|
70
|
+
* text, never compiled to a pattern.
|
|
71
|
+
*/
|
|
72
|
+
export declare function urlRuleMatches(rule: string, path: string): boolean;
|
|
73
|
+
export declare function pageAllowed(form: WidgetFormSpec, path: string): boolean;
|
|
74
|
+
interface Memory {
|
|
75
|
+
closed: Record<string, number>;
|
|
76
|
+
submitted: string[];
|
|
77
|
+
known: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** Whether a popup or flyout may show to this browser now (audience, device, frequency). */
|
|
80
|
+
export declare function eligible(form: WidgetFormSpec, memory: Memory, now: number, mobile: boolean): boolean;
|
|
81
|
+
/** Read the server's list defensively: anything malformed is skipped, never thrown. */
|
|
82
|
+
export declare function parseForms(body: unknown): WidgetFormSpec[];
|
|
83
|
+
/**
|
|
84
|
+
* `core`'s entry: positional, because every byte of the call site is paid in
|
|
85
|
+
* `core.mjs` on every page. `site` is core's own options (`embedKey`,
|
|
86
|
+
* `apiBase`); the host's shadow root is open (core attaches it). A dock
|
|
87
|
+
* generation host sets no `--wgt-*` on itself: its shadow stylesheet's
|
|
88
|
+
* `:host` rules theme a popup drawn inside it, and an embed falls back to the
|
|
89
|
+
* stylesheet defaults.
|
|
90
|
+
*/
|
|
91
|
+
export declare function startForms(host: HTMLElement, site: {
|
|
92
|
+
readonly embedKey: string;
|
|
93
|
+
readonly apiBase?: string;
|
|
94
|
+
}, fetchImpl: typeof fetch, locale: string): FormsHandle | undefined;
|
|
95
|
+
export declare function drawForms(options: StartFormsOptions): FormsHandle;
|
|
96
|
+
/** A success path resolved on the page's own origin; anything that would leave the site is dropped. */
|
|
97
|
+
export declare function successUrl(win: Window, path: string | null): string | null;
|
|
98
|
+
export {};
|
|
99
|
+
//# sourceMappingURL=forms-dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forms-dom.d.ts","sourceRoot":"","sources":["../../src/forms/forms-dom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7C,KAAK,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,CAAC;AACjD,KAAK,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,CAAC;AAE5C,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MA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AE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,OAAO,GACd,OAAO,CAYT;AAMD,uFAAuF;AACvF,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,EAAE,CAgB1D;AAkBD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9D,SAAS,EAAE,OAAO,KAAK,EACvB,MAAM,EAAE,MAAM,GACb,WAAW,GAAG,SAAS,CAwBzB;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,CA4TjE;AAeD,uGAAuG;AACvG,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAS1E"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as IDLE_SNAPSHOT, $t as readStoredMinimised, A as rendererFor, An as formatMessage, At as MARK, B as textDirectionFor, Bn as KNOT_PATH, Bt as SHEET_PEEK_MAX, C as VoiceWidgetWithRenderer, Cn as oklchToOklab, Ct as DOCK_ALIGN_STORAGE_KEY, D as WidgetCartSummary, Dn as srgbToLinear, Dt as FLOAT_DUCK_DISMISS_MS, E as readsAsCheckoutIntent, En as rotateHue, Et as DRAG_TAP_SLOP_PX, F as CallView, Fn as MARK_VARIANTS, Ft as RADII, G as edgeOf, Gt as bottomLen, H as CONCIERGE_POSITIONS, Hn as BotFace, Ht as SHEET_TUCK, I as IDLE_CALL_RECORD, In as WIDGET_AVATARS, It as ROW_H, J as positionClasses, Jt as persistAlign, K as nearestPosition, Kt as containerAnchor, L as WidgetMarkdown, Ln as WIDGET_IDENTITY_AVATARS, Lt as SHEET_EXPANDED_DESKTOP_MAX, M as ShellRenderer, Mn as widgetMessagesFromCopy, Mt as PILL_H, N as deriveWidgetView, Nn as MorphingLoader, Nt as PILL_MARK, O as VariantOptionChips, On as withAlpha, Ot as FLOAT_GAP, P as ConciergeShell, Pn as DEFAULT_WIDGET_AVATAR, Pt as PROACTIVE_NUDGE_MS, Q as Mark, Qt as readStoredAlign, R as parseBlocks, Rn as dockAvatarFor, Rt as SHEET_EXPANDED_VH, S as VoiceWidget, Sn as oklchToHex, St as DESKTOP_WIDTHS, T as readsAsCartViewIntent, Tn as relativeLuminance, Tt as DRAG_CLICK_WINDOW_MS, U as DEFAULT_CONCIERGE_POSITION, Un as labelProps, Ut as SHORT_VIEWPORT, V as ConciergeLauncher, Vn as RopeKnot, Vt as SHEET_TOP_CLEARANCE, W as alignOf, Wn as cn, Wt as Z_INDEX, X as LAUNCHER_VARIANTS, Xt as pillAnchor, Y as positionForArrow, Yt as persistMinimised, Z as MARK_STATES, Zt as readStored, _ as useVoiceSession, _n as linearToSrgb, _t as BOTTOM_FLOOR, a as MAX_REPORTED_CART_LINES, an as SHEET_RADIUS_MAX_PX, at as latencyBetween, b as useChatSession, bn as oklabToLinearRgb, bt as DESKTOP_BREAKPOINT, c as deriveCallPhase, cn as deriveTheme, ct as deriveDockState, d as resolveCheckoutUrl, dn as themeToMarkedHostCss, dt as CONCIERGE_STATES, en as rowWidthLen, et as botStateFor, f as toChatCart, fn as contrastRatio, ft as deriveConciergeState, g as createWidgetVoiceTokenFetcher, gn as linearRgbToOklab, gt as ACTIVITY_W, h as ROOM_EVENTS, hn as hexToOklch, ht as WIDGET_MESSAGE_MAX_LENGTH, i as ConciergeWidget, in as CARD_RADIUS_MAX_PX, it as formatMs, j as DockRenderer, jn as resolveWidgetMessages, jt as MOBILE_MARGIN, k as WidgetCardList, kn as defaultWidgetMessages, kt as GLASS_IDLE_MS, l as mergeAddedCartLine, ln as themeToCss, lt as deriveDockView, m as deriveWidgetTheme, mn as hexToOklab, mt as formatMoney, n as CART_LINE_VARIANT_ID_SHAPE, nn as snapAlign, nt as SESSION_EVENTS, o as cartLinesFromSnapshot, on as SYSTEM_FONT_STACK, ot as Dock, p as WidgetThemeScope, pn as formatHex, pt as idleConciergeInput, q as panelClasses, qt as geometryVars, r as ConciergeHost, rn as writeStored, rt as SessionLog, s as chooseOptionsAction, sn as WIDGET_THEME_TOKENS, st as DOCK_STATES, t as CART_LINE_PLATFORM_VARIANT_ID_SHAPE, tn as sheetMaxHeightLen, tt as SseFrameParser, u as resolveAddToCartHandler, un as themeToInlineStyle, ut as idleDockInput, v as CHECKOUT_CAPTURE_REQUIRED, vn as mixToward, vt as CONTROL, w as basketIntentFromTurns, wn as parseHex, wt as DOCK_MINIMISED_STORAGE_KEY, xn as oklabToOklch, xt as DESKTOP_GUTTER, y as isSameOriginPath, yn as oklabToHex, yt as DESKTOP_BOTTOM, z as stripBidiControls, zn as isWidgetAvatar, zt as SHEET_GAP } from "./chunks/host-widget-
|
|
1
|
+
import { $ as IDLE_SNAPSHOT, $t as readStoredMinimised, A as rendererFor, An as formatMessage, At as MARK, B as textDirectionFor, Bn as KNOT_PATH, Bt as SHEET_PEEK_MAX, C as VoiceWidgetWithRenderer, Cn as oklchToOklab, Ct as DOCK_ALIGN_STORAGE_KEY, D as WidgetCartSummary, Dn as srgbToLinear, Dt as FLOAT_DUCK_DISMISS_MS, E as readsAsCheckoutIntent, En as rotateHue, Et as DRAG_TAP_SLOP_PX, F as CallView, Fn as MARK_VARIANTS, Ft as RADII, G as edgeOf, Gt as bottomLen, H as CONCIERGE_POSITIONS, Hn as BotFace, Ht as SHEET_TUCK, I as IDLE_CALL_RECORD, In as WIDGET_AVATARS, It as ROW_H, J as positionClasses, Jt as persistAlign, K as nearestPosition, Kt as containerAnchor, L as WidgetMarkdown, Ln as WIDGET_IDENTITY_AVATARS, Lt as SHEET_EXPANDED_DESKTOP_MAX, M as ShellRenderer, Mn as widgetMessagesFromCopy, Mt as PILL_H, N as deriveWidgetView, Nn as MorphingLoader, Nt as PILL_MARK, O as VariantOptionChips, On as withAlpha, Ot as FLOAT_GAP, P as ConciergeShell, Pn as DEFAULT_WIDGET_AVATAR, Pt as PROACTIVE_NUDGE_MS, Q as Mark, Qt as readStoredAlign, R as parseBlocks, Rn as dockAvatarFor, Rt as SHEET_EXPANDED_VH, S as VoiceWidget, Sn as oklchToHex, St as DESKTOP_WIDTHS, T as readsAsCartViewIntent, Tn as relativeLuminance, Tt as DRAG_CLICK_WINDOW_MS, U as DEFAULT_CONCIERGE_POSITION, Un as labelProps, Ut as SHORT_VIEWPORT, V as ConciergeLauncher, Vn as RopeKnot, Vt as SHEET_TOP_CLEARANCE, W as alignOf, Wn as cn, Wt as Z_INDEX, X as LAUNCHER_VARIANTS, Xt as pillAnchor, Y as positionForArrow, Yt as persistMinimised, Z as MARK_STATES, Zt as readStored, _ as useVoiceSession, _n as linearToSrgb, _t as BOTTOM_FLOOR, a as MAX_REPORTED_CART_LINES, an as SHEET_RADIUS_MAX_PX, at as latencyBetween, b as useChatSession, bn as oklabToLinearRgb, bt as DESKTOP_BREAKPOINT, c as deriveCallPhase, cn as deriveTheme, ct as deriveDockState, d as resolveCheckoutUrl, dn as themeToMarkedHostCss, dt as CONCIERGE_STATES, en as rowWidthLen, et as botStateFor, f as toChatCart, fn as contrastRatio, ft as deriveConciergeState, g as createWidgetVoiceTokenFetcher, gn as linearRgbToOklab, gt as ACTIVITY_W, h as ROOM_EVENTS, hn as hexToOklch, ht as WIDGET_MESSAGE_MAX_LENGTH, i as ConciergeWidget, in as CARD_RADIUS_MAX_PX, it as formatMs, j as DockRenderer, jn as resolveWidgetMessages, jt as MOBILE_MARGIN, k as WidgetCardList, kn as defaultWidgetMessages, kt as GLASS_IDLE_MS, l as mergeAddedCartLine, ln as themeToCss, lt as deriveDockView, m as deriveWidgetTheme, mn as hexToOklab, mt as formatMoney, n as CART_LINE_VARIANT_ID_SHAPE, nn as snapAlign, nt as SESSION_EVENTS, o as cartLinesFromSnapshot, on as SYSTEM_FONT_STACK, ot as Dock, p as WidgetThemeScope, pn as formatHex, pt as idleConciergeInput, q as panelClasses, qt as geometryVars, r as ConciergeHost, rn as writeStored, rt as SessionLog, s as chooseOptionsAction, sn as WIDGET_THEME_TOKENS, st as DOCK_STATES, t as CART_LINE_PLATFORM_VARIANT_ID_SHAPE, tn as sheetMaxHeightLen, tt as SseFrameParser, u as resolveAddToCartHandler, un as themeToInlineStyle, ut as idleDockInput, v as CHECKOUT_CAPTURE_REQUIRED, vn as mixToward, vt as CONTROL, w as basketIntentFromTurns, wn as parseHex, wt as DOCK_MINIMISED_STORAGE_KEY, xn as oklabToOklch, xt as DESKTOP_GUTTER, y as isSameOriginPath, yn as oklabToHex, yt as DESKTOP_BOTTOM, z as stripBidiControls, zn as isWidgetAvatar, zt as SHEET_GAP } from "./chunks/host-widget-4FfPd2gs.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Component, createElement, useEffect, useRef } from "react";
|
|
4
4
|
import { createRoot } from "react-dom/client";
|
package/dist/next/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ConciergeWidget, x as detectPage } from "../chunks/host-widget-
|
|
1
|
+
import { i as ConciergeWidget, x as detectPage } from "../chunks/host-widget-4FfPd2gs.js";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
3
3
|
import { usePathname, useRouter } from "next/navigation";
|
|
4
4
|
//#region src/next/use-next-bridge.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-chat-session.d.ts","sourceRoot":"","sources":["../src/use-chat-session.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAQjF,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,6BAA6B,EAC9B,MAAM,+BA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AAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5E;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,QAAQ,CAAC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IACxC;;;;;;;OAOG;IACH,QAAQ,CAAC,mBAAmB,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACvF;AA+YD,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,oBAAoB,CAm0EnF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saar-ai/web-widget",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"saar:distribution": "publishable",
|
|
5
5
|
"description": "The concierge widget's React UI — ConciergeShell chrome plus the full end-user conversation (VoiceWidget, useChatSession, useVoiceSession) — de-Nexted for the merchant-site embed (docs/WIDGET_EMBED_PLAN.md §4 Phase 3). Publishes PUBLICLY to npmjs (docs/WIDGET_EMBED_PLAN.md §5.1) — every workspace and third-party runtime dependency is bundled into dist/ at build time, so \"dependencies\" is empty. React and react-dom are peer dependencies only; next is an optional peer, needed only by the ./next subpath (Phase 5).",
|
|
6
6
|
"type": "module",
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"@wesence/vitest-presets": "0.0.1",
|
|
84
84
|
"clsx": "^2.1.1",
|
|
85
85
|
"jsdom": "^30.1.0",
|
|
86
|
+
"libphonenumber-js": "^1.13.14",
|
|
86
87
|
"livekit-client": "^2.21.0",
|
|
87
88
|
"lucide-react": "^1.47.0",
|
|
88
89
|
"next": "^16.4.1",
|