@getspot/spot-widget 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +398 -391
- package/dist/index.umd.js +4 -4
- package/dist/ui.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
async function
|
|
1
|
+
async function S(c, t, r, s) {
|
|
2
2
|
try {
|
|
3
|
-
const
|
|
3
|
+
const a = s ? { ...r, state: s } : r, n = await fetch(c, {
|
|
4
4
|
method: "POST",
|
|
5
5
|
headers: {
|
|
6
6
|
"Content-Type": "application/json",
|
|
7
7
|
"X-Spot-Partner-Id": t
|
|
8
8
|
},
|
|
9
|
-
body: JSON.stringify(
|
|
10
|
-
}),
|
|
11
|
-
if (!
|
|
12
|
-
const
|
|
13
|
-
throw
|
|
9
|
+
body: JSON.stringify(a)
|
|
10
|
+
}), o = await n.json();
|
|
11
|
+
if (!n.ok) {
|
|
12
|
+
const e = new Error((o == null ? void 0 : o.message) || "Failed to fetch quote");
|
|
13
|
+
throw e.status = n.status, e.responseBody = o, e;
|
|
14
14
|
}
|
|
15
|
-
return
|
|
16
|
-
} catch (
|
|
17
|
-
throw
|
|
15
|
+
return o;
|
|
16
|
+
} catch (a) {
|
|
17
|
+
throw a instanceof Error ? a : new Error("Unknown error occurred while fetching quote");
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
async function z(
|
|
20
|
+
async function z(c, t, r) {
|
|
21
21
|
try {
|
|
22
|
-
const s =
|
|
22
|
+
const s = c.replace("/quote", "/quote/batch"), a = await fetch(s, {
|
|
23
23
|
method: "POST",
|
|
24
24
|
headers: {
|
|
25
25
|
"Content-Type": "application/json",
|
|
26
26
|
"X-Spot-Partner-Id": t
|
|
27
27
|
},
|
|
28
28
|
body: JSON.stringify(r)
|
|
29
|
-
}),
|
|
30
|
-
if (!
|
|
31
|
-
const
|
|
32
|
-
throw
|
|
29
|
+
}), n = await a.json();
|
|
30
|
+
if (!a.ok) {
|
|
31
|
+
const o = new Error((n == null ? void 0 : n.message) || "Failed to fetch batch quote");
|
|
32
|
+
throw o.status = a.status, o.responseBody = n, o;
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return n;
|
|
35
35
|
} catch (s) {
|
|
36
36
|
throw s instanceof Error ? s : new Error("Unknown error occurred while fetching batch quote");
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
async function
|
|
40
|
-
var
|
|
39
|
+
async function T(c, t, r, s) {
|
|
40
|
+
var a;
|
|
41
41
|
try {
|
|
42
|
-
const
|
|
42
|
+
const n = {
|
|
43
43
|
...r,
|
|
44
44
|
...s ? { state: s } : {},
|
|
45
45
|
isPartialPayment: r.isPartialPayment || !1,
|
|
@@ -48,43 +48,43 @@ async function N(d, t, r, s) {
|
|
|
48
48
|
...m,
|
|
49
49
|
cartItemId: m.cartItemId || `item-${f + 1}`
|
|
50
50
|
}))
|
|
51
|
-
},
|
|
52
|
-
if (
|
|
51
|
+
}, o = await z(c, t, n);
|
|
52
|
+
if (o.status !== "QUOTES_AVAILABLE" && o.status !== "QUOTE_AVAILABLE")
|
|
53
53
|
return { status: "NO_MATCHING_QUOTE" };
|
|
54
|
-
const
|
|
54
|
+
const e = o.quotes.map((m) => {
|
|
55
55
|
const f = r.items.find(
|
|
56
|
-
(
|
|
56
|
+
(h, g) => (h.cartItemId || `item-${g + 1}`) === m.cartItemId
|
|
57
57
|
);
|
|
58
58
|
return f ? f.participantDescription ? `${f.productName} - ${f.participantDescription}` : f.productName : `Item ${m.id}`;
|
|
59
|
-
}),
|
|
59
|
+
}), l = Math.round((o.totalSpotPrice || o.spotPrice || 0) * 100) / 100;
|
|
60
60
|
return {
|
|
61
61
|
status: "QUOTE_AVAILABLE",
|
|
62
62
|
data: {
|
|
63
|
-
id:
|
|
64
|
-
spotPrice:
|
|
65
|
-
currencyCode:
|
|
63
|
+
id: o.quotes ? o.quotes.map((m) => m.id).join(",") : ((a = o.data) == null ? void 0 : a.id) || "",
|
|
64
|
+
spotPrice: l,
|
|
65
|
+
currencyCode: o.currencyCode || "",
|
|
66
66
|
communication: {
|
|
67
|
-
...
|
|
68
|
-
yesOptionText:
|
|
69
|
-
String(
|
|
70
|
-
String(
|
|
67
|
+
...o.communication,
|
|
68
|
+
yesOptionText: o.communication.yesOptionText.replace(
|
|
69
|
+
String(o.totalSpotPrice),
|
|
70
|
+
String(l)
|
|
71
71
|
)
|
|
72
72
|
},
|
|
73
|
-
payoutSchedule:
|
|
73
|
+
payoutSchedule: o.payoutSchedule.map((m) => ({
|
|
74
74
|
...m,
|
|
75
75
|
amount: m.amount !== void 0 ? m.amount : 0
|
|
76
76
|
})),
|
|
77
|
-
coveredItems:
|
|
78
|
-
originalQuotes:
|
|
77
|
+
coveredItems: e,
|
|
78
|
+
originalQuotes: o.quotes || (o.data ? [o.data] : [])
|
|
79
79
|
},
|
|
80
|
-
spotPrice:
|
|
81
|
-
coveredItems:
|
|
80
|
+
spotPrice: l,
|
|
81
|
+
coveredItems: e
|
|
82
82
|
};
|
|
83
|
-
} catch (
|
|
84
|
-
throw
|
|
83
|
+
} catch (n) {
|
|
84
|
+
throw n instanceof Error ? n : new Error("Unknown error occurred while fetching multiple quotes");
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
const E = "non-us-resident",
|
|
87
|
+
const E = "non-us-resident", O = "Unfortunately, we are currently unable to offer coverage or process claims for non-US residents.", A = [
|
|
88
88
|
{ value: "AL", label: "Alabama" },
|
|
89
89
|
{ value: "AK", label: "Alaska" },
|
|
90
90
|
{ value: "AS", label: "American Samoa" },
|
|
@@ -141,7 +141,7 @@ const E = "non-us-resident", A = "Unfortunately, we are currently unable to offe
|
|
|
141
141
|
{ value: "WV", label: "West Virginia" },
|
|
142
142
|
{ value: "WI", label: "Wisconsin" },
|
|
143
143
|
{ value: "WY", label: "Wyoming" }
|
|
144
|
-
],
|
|
144
|
+
], L = new Set(A.map((c) => c.value)), I = [
|
|
145
145
|
"USD",
|
|
146
146
|
"CAD",
|
|
147
147
|
"AUD",
|
|
@@ -170,22 +170,22 @@ const E = "non-us-resident", A = "Unfortunately, we are currently unable to offe
|
|
|
170
170
|
production: "https://api.getspot.com/v1/quote",
|
|
171
171
|
local: "http://localhost:3999/api/v1/quote"
|
|
172
172
|
};
|
|
173
|
-
function M(
|
|
173
|
+
function M(c) {
|
|
174
174
|
const {
|
|
175
175
|
apiConfig: t = {},
|
|
176
176
|
quoteRequestData: r,
|
|
177
177
|
callbacks: s = {},
|
|
178
|
-
location:
|
|
179
|
-
theme:
|
|
180
|
-
} =
|
|
181
|
-
environment:
|
|
182
|
-
partnerId:
|
|
183
|
-
customEndpoint:
|
|
178
|
+
location: a,
|
|
179
|
+
theme: n
|
|
180
|
+
} = c, {
|
|
181
|
+
environment: o = "sandbox",
|
|
182
|
+
partnerId: e,
|
|
183
|
+
customEndpoint: l
|
|
184
184
|
} = t;
|
|
185
|
-
if (!
|
|
185
|
+
if (!e || typeof e != "string")
|
|
186
186
|
throw new Error("Invalid or missing partnerId in apiConfig");
|
|
187
|
-
if (!(
|
|
188
|
-
throw new Error(`Invalid environment in apiConfig: ${
|
|
187
|
+
if (!(l || P[o]))
|
|
188
|
+
throw new Error(`Invalid environment in apiConfig: ${o}`);
|
|
189
189
|
if (!r || typeof r != "object" && !Array.isArray(r))
|
|
190
190
|
throw new Error("quoteRequestData must be a non-null object or array");
|
|
191
191
|
const f = [
|
|
@@ -200,57 +200,57 @@ function M(d) {
|
|
|
200
200
|
"cartId",
|
|
201
201
|
"productName"
|
|
202
202
|
];
|
|
203
|
-
function
|
|
204
|
-
const
|
|
205
|
-
f.forEach((
|
|
206
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
207
|
-
throw new Error(`Missing required ${
|
|
203
|
+
function h(p, u = null) {
|
|
204
|
+
const d = u !== null ? `quoteRequestData[${u}]` : "quoteRequestData";
|
|
205
|
+
f.forEach((v) => {
|
|
206
|
+
if (!Object.prototype.hasOwnProperty.call(p, v) || p[v] === void 0 || p[v] === null)
|
|
207
|
+
throw new Error(`Missing required ${d} field: '${v}'`);
|
|
208
208
|
});
|
|
209
209
|
const b = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
210
|
-
if (!b.test(
|
|
211
|
-
throw new Error(`${
|
|
212
|
-
if (!b.test(
|
|
213
|
-
throw new Error(`${
|
|
214
|
-
if (typeof
|
|
215
|
-
throw new Error(`${
|
|
216
|
-
if (!I.includes(
|
|
217
|
-
throw new Error(`Invalid ${
|
|
218
|
-
if (typeof
|
|
219
|
-
throw new Error(`${
|
|
220
|
-
if (typeof
|
|
221
|
-
throw new Error(`${
|
|
222
|
-
const
|
|
223
|
-
if (!
|
|
210
|
+
if (!b.test(p.startDate))
|
|
211
|
+
throw new Error(`${d}.startDate must be a valid ISO8601 string`);
|
|
212
|
+
if (!b.test(p.endDate))
|
|
213
|
+
throw new Error(`${d}.endDate must be a valid ISO8601 string`);
|
|
214
|
+
if (typeof p.currencyCode != "string")
|
|
215
|
+
throw new Error(`${d}.currencyCode must be a string`);
|
|
216
|
+
if (!I.includes(p.currencyCode))
|
|
217
|
+
throw new Error(`Invalid ${d}.currencyCode: ${p.currencyCode}`);
|
|
218
|
+
if (typeof p.eventType != "string")
|
|
219
|
+
throw new Error(`${d}.eventType must be a string`);
|
|
220
|
+
if (typeof p.productType != "string")
|
|
221
|
+
throw new Error(`${d}.productType must be a string`);
|
|
222
|
+
const _ = ["Pass", "Trip", "Registration"];
|
|
223
|
+
if (!_.includes(p.productType))
|
|
224
224
|
throw new Error(
|
|
225
|
-
`${
|
|
225
|
+
`${d}.productType must be one of ${_.join(", ")}`
|
|
226
226
|
);
|
|
227
|
-
if (typeof
|
|
228
|
-
throw new Error(`${
|
|
227
|
+
if (typeof p.productDuration != "string")
|
|
228
|
+
throw new Error(`${d}.productDuration must be a string`);
|
|
229
229
|
const C = ["Daily", "Seasonal", "Trip", "Event"];
|
|
230
|
-
if (!C.includes(
|
|
230
|
+
if (!C.includes(p.productDuration))
|
|
231
231
|
throw new Error(
|
|
232
|
-
`${
|
|
232
|
+
`${d}.productDuration must be one of ${C.join(", ")}`
|
|
233
233
|
);
|
|
234
|
-
if (typeof
|
|
235
|
-
throw new Error(`${
|
|
236
|
-
if (typeof
|
|
237
|
-
throw new Error(`${
|
|
238
|
-
if (typeof
|
|
239
|
-
throw new Error(`${
|
|
240
|
-
if (typeof
|
|
241
|
-
throw new Error(`${
|
|
234
|
+
if (typeof p.productPrice != "number" || isNaN(p.productPrice))
|
|
235
|
+
throw new Error(`${d}.productPrice must be a valid number`);
|
|
236
|
+
if (typeof p.productId != "string")
|
|
237
|
+
throw new Error(`${d}.productId must be a string`);
|
|
238
|
+
if (typeof p.cartId != "string")
|
|
239
|
+
throw new Error(`${d}.cartId must be a string`);
|
|
240
|
+
if (typeof p.productName != "string")
|
|
241
|
+
throw new Error(`${d}.productName must be a string`);
|
|
242
242
|
}
|
|
243
243
|
if ("items" in r) {
|
|
244
|
-
const
|
|
244
|
+
const p = r, { cartId: u, cartName: d, currencyCode: b, items: _ } = p;
|
|
245
245
|
if (!u || typeof u != "string")
|
|
246
246
|
throw new Error("quoteRequestData.cartId must be a string");
|
|
247
|
-
if (!
|
|
247
|
+
if (!d || typeof d != "string")
|
|
248
248
|
throw new Error("quoteRequestData.cartName must be a string");
|
|
249
249
|
if (!b || typeof b != "string")
|
|
250
250
|
throw new Error("quoteRequestData.currencyCode must be a string");
|
|
251
251
|
if (!I.includes(b))
|
|
252
252
|
throw new Error(`Invalid quoteRequestData.currencyCode: ${b}`);
|
|
253
|
-
if (!Array.isArray(
|
|
253
|
+
if (!Array.isArray(_) || _.length === 0)
|
|
254
254
|
throw new Error("quoteRequestData.items must be a non-empty array");
|
|
255
255
|
const C = [
|
|
256
256
|
"startDate",
|
|
@@ -262,106 +262,106 @@ function M(d) {
|
|
|
262
262
|
"productId",
|
|
263
263
|
"productName"
|
|
264
264
|
];
|
|
265
|
-
|
|
266
|
-
if (!
|
|
267
|
-
throw new Error(`quoteRequestData.items[${
|
|
268
|
-
const y = `quoteRequestData.items[${
|
|
265
|
+
_.forEach((v, x) => {
|
|
266
|
+
if (!v || typeof v != "object")
|
|
267
|
+
throw new Error(`quoteRequestData.items[${x}] must be a non-null object`);
|
|
268
|
+
const y = `quoteRequestData.items[${x}]`;
|
|
269
269
|
C.forEach((q) => {
|
|
270
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
270
|
+
if (!Object.prototype.hasOwnProperty.call(v, q) || v[q] === void 0 || v[q] === null)
|
|
271
271
|
throw new Error(`Missing required ${y} field: '${q}'`);
|
|
272
272
|
});
|
|
273
|
-
const
|
|
274
|
-
if (!
|
|
273
|
+
const k = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
274
|
+
if (!k.test(v.startDate))
|
|
275
275
|
throw new Error(`${y}.startDate must be a valid ISO8601 string`);
|
|
276
|
-
if (!
|
|
276
|
+
if (!k.test(v.endDate))
|
|
277
277
|
throw new Error(`${y}.endDate must be a valid ISO8601 string`);
|
|
278
|
-
if (typeof
|
|
278
|
+
if (typeof v.eventType != "string")
|
|
279
279
|
throw new Error(`${y}.eventType must be a string`);
|
|
280
|
-
if (typeof
|
|
280
|
+
if (typeof v.productType != "string")
|
|
281
281
|
throw new Error(`${y}.productType must be a string`);
|
|
282
|
-
const
|
|
283
|
-
if (!
|
|
284
|
-
throw new Error(`${y}.productType must be one of ${
|
|
285
|
-
if (typeof
|
|
282
|
+
const N = ["Pass", "Trip", "Registration"];
|
|
283
|
+
if (!N.includes(v.productType))
|
|
284
|
+
throw new Error(`${y}.productType must be one of ${N.join(", ")}`);
|
|
285
|
+
if (typeof v.productDuration != "string")
|
|
286
286
|
throw new Error(`${y}.productDuration must be a string`);
|
|
287
|
-
const
|
|
288
|
-
if (!
|
|
289
|
-
throw new Error(`${y}.productDuration must be one of ${
|
|
290
|
-
if (typeof
|
|
287
|
+
const D = ["Daily", "Seasonal", "Trip", "Event"];
|
|
288
|
+
if (!D.includes(v.productDuration))
|
|
289
|
+
throw new Error(`${y}.productDuration must be one of ${D.join(", ")}`);
|
|
290
|
+
if (typeof v.productPrice != "number" || isNaN(v.productPrice))
|
|
291
291
|
throw new Error(`${y}.productPrice must be a valid number`);
|
|
292
|
-
if (typeof
|
|
292
|
+
if (typeof v.productId != "string")
|
|
293
293
|
throw new Error(`${y}.productId must be a string`);
|
|
294
|
-
if (typeof
|
|
294
|
+
if (typeof v.productName != "string")
|
|
295
295
|
throw new Error(`${y}.productName must be a string`);
|
|
296
296
|
});
|
|
297
297
|
} else if (Array.isArray(r)) {
|
|
298
298
|
if (r.length === 0)
|
|
299
299
|
throw new Error("quoteRequestData array cannot be empty");
|
|
300
|
-
r.forEach((
|
|
301
|
-
if (!
|
|
300
|
+
r.forEach((p, u) => {
|
|
301
|
+
if (!p || typeof p != "object")
|
|
302
302
|
throw new Error(`quoteRequestData[${u}] must be a non-null object`);
|
|
303
|
-
|
|
303
|
+
h(p, u);
|
|
304
304
|
});
|
|
305
305
|
} else
|
|
306
|
-
|
|
306
|
+
h(r);
|
|
307
307
|
if ([
|
|
308
308
|
"onOptIn",
|
|
309
309
|
"onOptOut",
|
|
310
310
|
"onQuoteRetrieved",
|
|
311
311
|
"onError",
|
|
312
312
|
"noMatchingQuote"
|
|
313
|
-
].forEach((
|
|
314
|
-
const u = s[
|
|
313
|
+
].forEach((p) => {
|
|
314
|
+
const u = s[p];
|
|
315
315
|
if (u && typeof u != "function")
|
|
316
|
-
throw new Error(`Callback '${
|
|
317
|
-
}), typeof
|
|
318
|
-
throw new Error(`Invalid location selector: '${
|
|
319
|
-
if (
|
|
316
|
+
throw new Error(`Callback '${p}' must be a function.`);
|
|
317
|
+
}), typeof a == "string" && !document.querySelector(a))
|
|
318
|
+
throw new Error(`Invalid location selector: '${a}'`);
|
|
319
|
+
if (n && typeof n != "object")
|
|
320
320
|
throw new Error(
|
|
321
321
|
"Theme must be an object with CSS variables, do not include the '--' prefix"
|
|
322
322
|
);
|
|
323
|
-
if (
|
|
324
|
-
throw new Error(`Invalid state: '${
|
|
323
|
+
if (c.state && !L.has(c.state))
|
|
324
|
+
throw new Error(`Invalid state: '${c.state}'. Must be a 2-character US state or territory code.`);
|
|
325
325
|
}
|
|
326
|
-
var
|
|
327
|
-
function
|
|
328
|
-
const
|
|
329
|
-
return r && (
|
|
326
|
+
var w = /* @__PURE__ */ ((c) => (c.YES = "yes", c.NO = "no", c.UNSELECTED = "unselected", c))(w || {});
|
|
327
|
+
function i(c, { text: t, className: r, parent: s, innerHTML: a, href: n, target: o } = {}) {
|
|
328
|
+
const e = document.createElement(c);
|
|
329
|
+
return r && (e.className = r), t != null && (e.textContent = t), a != null && (e.innerHTML = a), n && "href" in e && (e.href = n), o && "target" in e && (e.target = o), s && s.appendChild(e), e;
|
|
330
330
|
}
|
|
331
|
-
function $(
|
|
332
|
-
|
|
331
|
+
function $(c, { name: t, description: r }) {
|
|
332
|
+
i("div", {
|
|
333
333
|
className: "spot-header__title",
|
|
334
334
|
text: t,
|
|
335
|
-
parent:
|
|
336
|
-
}),
|
|
335
|
+
parent: c
|
|
336
|
+
}), i("div", {
|
|
337
337
|
className: "spot-header__description",
|
|
338
338
|
text: r,
|
|
339
|
-
parent:
|
|
339
|
+
parent: c
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
|
-
function V(
|
|
343
|
-
const r =
|
|
342
|
+
function V(c, t = []) {
|
|
343
|
+
const r = i("ul", {
|
|
344
344
|
className: "spot-benefits__list",
|
|
345
|
-
parent:
|
|
345
|
+
parent: c
|
|
346
346
|
});
|
|
347
347
|
t.forEach((s) => {
|
|
348
|
-
const
|
|
349
|
-
|
|
348
|
+
const a = i("li", { parent: r });
|
|
349
|
+
a.innerHTML = `
|
|
350
350
|
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" class="spot-bullets__checkmark">
|
|
351
351
|
<path d="M11.6666 3.5L5.24998 9.91667L2.33331 7"
|
|
352
352
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
353
|
-
</svg>`,
|
|
353
|
+
</svg>`, i("span", { text: s, parent: a });
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
|
-
function Q(
|
|
356
|
+
function Q(c, t = []) {
|
|
357
357
|
if (!t || t.length === 0) return;
|
|
358
|
-
const r =
|
|
358
|
+
const r = i("div", {
|
|
359
359
|
className: "spot-qualifying-reasons__container",
|
|
360
|
-
parent:
|
|
361
|
-
}), s = [...t].sort((
|
|
360
|
+
parent: c
|
|
361
|
+
}), s = [...t].sort((e, l) => e.rank - l.rank), a = i("div", {
|
|
362
362
|
className: "spot-qualifying-reasons__grid",
|
|
363
363
|
parent: r
|
|
364
|
-
}),
|
|
364
|
+
}), n = {
|
|
365
365
|
"Accident & Illness": "cross.svg",
|
|
366
366
|
"Family Emergencies": "users.svg",
|
|
367
367
|
Layoffs: "building.svg",
|
|
@@ -371,99 +371,99 @@ function Q(d, t = []) {
|
|
|
371
371
|
"Travel Interruption": "plane.svg",
|
|
372
372
|
"Military Duty": "medal.svg"
|
|
373
373
|
};
|
|
374
|
-
let
|
|
374
|
+
let o;
|
|
375
375
|
try {
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
const
|
|
379
|
-
|
|
376
|
+
const e = document.currentScript;
|
|
377
|
+
if (e != null && e.src) {
|
|
378
|
+
const l = new URL(e.src);
|
|
379
|
+
o = l.origin + l.pathname.replace(/\/[^/]*$/, "/");
|
|
380
380
|
} else
|
|
381
|
-
|
|
382
|
-
|
|
381
|
+
o = window.location.origin + window.location.pathname.replace(/\/[^/]*$/, "/");
|
|
382
|
+
o += "assets/";
|
|
383
383
|
} catch {
|
|
384
|
-
|
|
384
|
+
o = "./assets/";
|
|
385
385
|
}
|
|
386
|
-
s.forEach((
|
|
387
|
-
var
|
|
388
|
-
const
|
|
386
|
+
s.forEach((e) => {
|
|
387
|
+
var h, g, p;
|
|
388
|
+
const l = i("div", {
|
|
389
389
|
className: "spot-qualifying-reasons__item",
|
|
390
|
-
parent:
|
|
391
|
-
}), m =
|
|
390
|
+
parent: a
|
|
391
|
+
}), m = i("div", {
|
|
392
392
|
className: "spot-qualifying-reasons__icon-wrapper",
|
|
393
|
-
parent:
|
|
394
|
-
}), f =
|
|
393
|
+
parent: l
|
|
394
|
+
}), f = n[((h = e.benefitType) == null ? void 0 : h.name) || ""] || n[e.name || ""];
|
|
395
395
|
if (f) {
|
|
396
|
-
const u =
|
|
396
|
+
const u = i("img", {
|
|
397
397
|
parent: m
|
|
398
398
|
});
|
|
399
|
-
u.src =
|
|
399
|
+
u.src = o + f, u.alt = ((g = e.benefitType) == null ? void 0 : g.name) || e.name || "", u.className = "spot-qualifying-reasons__icon";
|
|
400
400
|
}
|
|
401
|
-
|
|
401
|
+
i("span", {
|
|
402
402
|
className: "spot-qualifying-reasons__label",
|
|
403
|
-
text: ((
|
|
404
|
-
parent:
|
|
403
|
+
text: ((p = e.benefitType) == null ? void 0 : p.name) || e.name || "",
|
|
404
|
+
parent: l
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
|
-
function U(
|
|
408
|
+
function U(c, t = [], r) {
|
|
409
409
|
if (t.length === 0 || !r || r <= 1)
|
|
410
410
|
return;
|
|
411
411
|
const s = /* @__PURE__ */ new Map();
|
|
412
412
|
t.forEach((u) => {
|
|
413
413
|
s.set(u, (s.get(u) || 0) + 1);
|
|
414
414
|
});
|
|
415
|
-
const
|
|
416
|
-
([u,
|
|
415
|
+
const n = Array.from(s.entries()).map(
|
|
416
|
+
([u, d]) => ({
|
|
417
417
|
item: u,
|
|
418
|
-
count:
|
|
419
|
-
displayText:
|
|
418
|
+
count: d,
|
|
419
|
+
displayText: d > 1 ? `${d} x ${u}` : u
|
|
420
420
|
})
|
|
421
|
-
).sort((u,
|
|
422
|
-
const b = u.item.charAt(0),
|
|
423
|
-
return !C &&
|
|
424
|
-
}),
|
|
421
|
+
).sort((u, d) => {
|
|
422
|
+
const b = u.item.charAt(0), _ = d.item.charAt(0), C = /[a-zA-Z]/.test(b), v = /[a-zA-Z]/.test(_);
|
|
423
|
+
return !C && v ? -1 : C && !v ? 1 : u.item.localeCompare(d.item, void 0, { sensitivity: "base" });
|
|
424
|
+
}), o = i("div", {
|
|
425
425
|
className: "spot-covered-items__container",
|
|
426
|
-
parent:
|
|
427
|
-
}),
|
|
426
|
+
parent: c
|
|
427
|
+
}), e = i("div", {
|
|
428
428
|
className: "spot-covered-items__header",
|
|
429
|
-
parent: e
|
|
430
|
-
}), p = n("button", {
|
|
431
|
-
className: "spot-covered-items__toggle",
|
|
432
429
|
parent: o
|
|
430
|
+
}), l = i("button", {
|
|
431
|
+
className: "spot-covered-items__toggle",
|
|
432
|
+
parent: e
|
|
433
433
|
});
|
|
434
|
-
|
|
434
|
+
l.type = "button", i("span", {
|
|
435
435
|
className: "spot-covered-items__title",
|
|
436
436
|
text: `Items Covered in Your Cart (${t.length})`,
|
|
437
|
-
parent:
|
|
437
|
+
parent: l
|
|
438
438
|
});
|
|
439
|
-
const m =
|
|
439
|
+
const m = i("div", {
|
|
440
440
|
className: "spot-covered-items__right-section",
|
|
441
|
-
parent:
|
|
441
|
+
parent: l
|
|
442
442
|
});
|
|
443
|
-
|
|
443
|
+
i("span", {
|
|
444
444
|
className: "spot-covered-items__view-all",
|
|
445
445
|
text: "View All",
|
|
446
446
|
parent: m
|
|
447
447
|
});
|
|
448
|
-
const f =
|
|
448
|
+
const f = i("span", {
|
|
449
449
|
className: "spot-covered-items__arrow",
|
|
450
450
|
innerHTML: "▼",
|
|
451
451
|
parent: m
|
|
452
|
-
}),
|
|
452
|
+
}), h = i("div", {
|
|
453
453
|
className: "spot-covered-items__content",
|
|
454
|
-
parent:
|
|
455
|
-
}),
|
|
454
|
+
parent: o
|
|
455
|
+
}), g = i("ul", {
|
|
456
456
|
className: "spot-covered-items__list",
|
|
457
|
-
parent:
|
|
457
|
+
parent: h
|
|
458
458
|
});
|
|
459
|
-
|
|
460
|
-
const
|
|
461
|
-
|
|
459
|
+
n.forEach(({ displayText: u }) => {
|
|
460
|
+
const d = i("li", { parent: g });
|
|
461
|
+
i("span", { text: u, parent: d });
|
|
462
462
|
});
|
|
463
|
-
let
|
|
464
|
-
|
|
465
|
-
u.stopPropagation(), u.preventDefault(),
|
|
466
|
-
}),
|
|
463
|
+
let p = !1;
|
|
464
|
+
h.style.display = "none", l.addEventListener("click", (u) => {
|
|
465
|
+
u.stopPropagation(), u.preventDefault(), p = !p, h.style.display = p ? "block" : "none", f.innerHTML = p ? "▲" : "▼", l.setAttribute("aria-expanded", p.toString());
|
|
466
|
+
}), l.setAttribute("aria-expanded", "false"), l.setAttribute("aria-controls", "covered-items-list"), h.setAttribute("id", "covered-items-list");
|
|
467
467
|
}
|
|
468
468
|
const Z = {
|
|
469
469
|
USD: "$",
|
|
@@ -490,104 +490,133 @@ const Z = {
|
|
|
490
490
|
THB: "THB ฿",
|
|
491
491
|
ZAR: "ZAR R"
|
|
492
492
|
};
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
493
|
+
let B = 0;
|
|
494
|
+
function j(c, t = [], r = "USD") {
|
|
495
|
+
const s = Z[r] ?? `${r} `, a = `refund-schedule-content-${++B}`, n = i("div", {
|
|
496
|
+
className: "spot-covered-items__container spot-refund-schedule",
|
|
497
|
+
parent: c
|
|
498
|
+
}), o = i("div", {
|
|
499
|
+
className: "spot-covered-items__header",
|
|
500
|
+
parent: n
|
|
501
|
+
}), e = i("button", {
|
|
502
|
+
className: "spot-covered-items__toggle",
|
|
503
|
+
parent: o
|
|
504
|
+
});
|
|
505
|
+
i("span", {
|
|
506
|
+
className: "spot-covered-items__title",
|
|
507
|
+
text: "Refund Schedule",
|
|
508
|
+
parent: e
|
|
509
|
+
});
|
|
510
|
+
const l = i("div", {
|
|
511
|
+
className: "spot-covered-items__right-section",
|
|
512
|
+
parent: e
|
|
513
|
+
}), m = i("span", {
|
|
514
|
+
className: "spot-covered-items__view-all",
|
|
515
|
+
text: "View",
|
|
516
|
+
parent: l
|
|
517
|
+
}), f = i("span", {
|
|
518
|
+
className: "spot-covered-items__arrow",
|
|
519
|
+
innerHTML: "▼",
|
|
520
|
+
parent: l
|
|
521
|
+
}), h = i("div", {
|
|
522
|
+
className: "spot-covered-items__content",
|
|
523
|
+
parent: n
|
|
524
|
+
}), g = i("ul", {
|
|
525
|
+
className: "spot-covered-items__list",
|
|
526
|
+
parent: h
|
|
527
|
+
});
|
|
528
|
+
t.forEach(({ text: u, percent: d, amount: b }) => {
|
|
529
|
+
const _ = i("li", { parent: g });
|
|
530
|
+
i("span", { text: u, parent: _ });
|
|
531
|
+
const C = d === "Not eligible for refund" ? "Not eligible for a refund" : `${d} (${s}${b.toFixed(2)})`;
|
|
532
|
+
i("span", { text: C, parent: _ });
|
|
508
533
|
});
|
|
534
|
+
let p = !1;
|
|
535
|
+
h.style.display = "none", e.addEventListener("click", (u) => {
|
|
536
|
+
u.stopPropagation(), p = !p, h.style.display = p ? "block" : "none", m.textContent = p ? "Close" : "View", f.innerHTML = p ? "▲" : "▼", e.setAttribute("aria-expanded", p.toString());
|
|
537
|
+
}), e.setAttribute("aria-expanded", "false"), e.setAttribute("aria-controls", a), h.setAttribute("id", a);
|
|
509
538
|
}
|
|
510
|
-
function
|
|
511
|
-
const r =
|
|
539
|
+
function F(c, t) {
|
|
540
|
+
const r = i("div", {
|
|
512
541
|
className: "spot-state-dropdown__wrapper",
|
|
513
|
-
parent:
|
|
542
|
+
parent: c
|
|
514
543
|
});
|
|
515
|
-
|
|
544
|
+
i("label", {
|
|
516
545
|
className: "spot-state-dropdown__label",
|
|
517
546
|
text: "State of Residence",
|
|
518
547
|
parent: r
|
|
519
548
|
});
|
|
520
|
-
const s =
|
|
549
|
+
const s = i("select", {
|
|
521
550
|
className: "spot-state-dropdown__select",
|
|
522
551
|
parent: r
|
|
523
552
|
});
|
|
524
553
|
s.setAttribute("aria-label", "State of Residence");
|
|
525
|
-
const
|
|
554
|
+
const a = i("option", {
|
|
526
555
|
text: "Select a state...",
|
|
527
556
|
parent: s
|
|
528
557
|
});
|
|
529
|
-
|
|
530
|
-
const
|
|
531
|
-
|
|
558
|
+
a.value = "", a.selected = !t, A.forEach(({ value: o, label: e }) => {
|
|
559
|
+
const l = i("option", { text: e, parent: s });
|
|
560
|
+
l.value = o, o === t && (l.selected = !0);
|
|
532
561
|
});
|
|
533
|
-
const
|
|
562
|
+
const n = i("option", {
|
|
534
563
|
text: "Not a US Resident",
|
|
535
564
|
parent: s
|
|
536
565
|
});
|
|
537
|
-
return
|
|
566
|
+
return n.value = E, t === E && (n.selected = !0), i("div", {
|
|
538
567
|
className: "spot-state-dropdown__error",
|
|
539
|
-
text:
|
|
568
|
+
text: O,
|
|
540
569
|
parent: r
|
|
541
570
|
}), s;
|
|
542
571
|
}
|
|
543
|
-
function W(
|
|
544
|
-
const
|
|
572
|
+
function W(c, t, r, s = !1) {
|
|
573
|
+
const a = i("div", {
|
|
545
574
|
className: `spot-selection__options${s ? " spot-selection__options--disabled" : ""}`,
|
|
546
|
-
parent:
|
|
547
|
-
}),
|
|
548
|
-
className: `spot-selection__option ${t ===
|
|
549
|
-
parent: i
|
|
550
|
-
}), e = n("input", { parent: a });
|
|
551
|
-
e.type = "radio", e.name = "selection", e.value = _.YES, t === _.YES && (e.checked = !0), s && (e.disabled = !0), n("strong", {
|
|
552
|
-
text: r.yesOptionText,
|
|
575
|
+
parent: c
|
|
576
|
+
}), n = i("label", {
|
|
577
|
+
className: `spot-selection__option ${t === w.YES ? "selected" : ""}`,
|
|
553
578
|
parent: a
|
|
554
|
-
}),
|
|
579
|
+
}), o = i("input", { parent: n });
|
|
580
|
+
o.type = "radio", o.name = "selection", o.value = w.YES, t === w.YES && (o.checked = !0), s && (o.disabled = !0), i("strong", {
|
|
581
|
+
text: r.yesOptionText,
|
|
582
|
+
parent: n
|
|
583
|
+
}), i("span", {
|
|
555
584
|
className: "spot-selection__recommended-tag",
|
|
556
585
|
text: "Recommended",
|
|
557
|
-
parent:
|
|
586
|
+
parent: n
|
|
558
587
|
});
|
|
559
|
-
const
|
|
560
|
-
className: `spot-selection__option ${t ===
|
|
561
|
-
parent:
|
|
562
|
-
}),
|
|
563
|
-
return
|
|
588
|
+
const e = i("label", {
|
|
589
|
+
className: `spot-selection__option ${t === w.NO ? "selected" : ""}`,
|
|
590
|
+
parent: a
|
|
591
|
+
}), l = i("input", { parent: e });
|
|
592
|
+
return l.type = "radio", l.name = "selection", l.value = w.NO, t === w.NO && (l.checked = !0), s && (l.disabled = !0), i("span", { text: r.noOptionText, parent: e }), a;
|
|
564
593
|
}
|
|
565
|
-
function
|
|
594
|
+
function H(c, t) {
|
|
566
595
|
var s;
|
|
567
596
|
const r = (s = t.communication) == null ? void 0 : s.paymentTerms;
|
|
568
597
|
if (r) {
|
|
569
|
-
const
|
|
598
|
+
const a = i("div", {
|
|
570
599
|
className: "spot-payment-terms",
|
|
571
|
-
parent:
|
|
600
|
+
parent: c
|
|
572
601
|
});
|
|
573
|
-
return
|
|
602
|
+
return i("div", {
|
|
574
603
|
className: "spot-payment-terms__header",
|
|
575
604
|
text: "PAYMENT TERMS",
|
|
576
|
-
parent:
|
|
577
|
-
}),
|
|
605
|
+
parent: a
|
|
606
|
+
}), i("div", {
|
|
578
607
|
className: "spot-payment-terms__body",
|
|
579
608
|
text: r || "",
|
|
580
|
-
parent:
|
|
581
|
-
}),
|
|
609
|
+
parent: a
|
|
610
|
+
}), a;
|
|
582
611
|
}
|
|
583
612
|
}
|
|
584
|
-
function
|
|
613
|
+
function Y(c, t, r = "top-right") {
|
|
585
614
|
if (r === "top-right") {
|
|
586
|
-
const
|
|
615
|
+
const e = i("div", {
|
|
587
616
|
className: "spot-logo__top-right",
|
|
588
|
-
parent:
|
|
617
|
+
parent: c
|
|
589
618
|
});
|
|
590
|
-
|
|
619
|
+
e.innerHTML = `
|
|
591
620
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
592
621
|
<path d="M11.98 19V9.2H14.878C16.754 9.2 18.154 10.474 18.154 12.364C18.154 14.254 16.754 15.528 14.878 15.528H13.828V19H11.98ZM13.828 13.806H14.878C15.746 13.806 16.236 13.176 16.236 12.364C16.236 11.552 15.746 10.936 14.878 10.936H13.828V13.806ZM22.0258 19.196C20.0938 19.196 18.2178 17.894 18.2178 15.43C18.2178 12.952 20.0938 11.65 22.0258 11.65C23.9438 11.65 25.8198 12.952 25.8198 15.43C25.8198 17.894 23.9438 19.196 22.0258 19.196ZM20.0518 15.43C20.0518 16.774 20.8778 17.544 22.0258 17.544C23.1598 17.544 23.9858 16.774 23.9858 15.43C23.9858 14.072 23.1598 13.302 22.0258 13.302C20.8778 13.302 20.0518 14.072 20.0518 15.43ZM27.7226 19L25.2446 11.846H27.0926L28.7026 16.732L29.9486 11.846H31.7266L33.0146 16.746L34.5966 11.846H36.4026L33.9946 19H32.1186L30.8446 14.198L29.6266 19H27.7226ZM39.531 19.196C37.683 19.196 35.849 17.894 35.849 15.43C35.849 12.952 37.641 11.65 39.461 11.65C41.253 11.65 43.073 12.924 43.073 15.416V15.962H37.599C37.795 17.096 38.607 17.614 39.531 17.614C40.161 17.614 40.609 17.418 40.889 17.054H42.933C42.317 18.496 40.889 19.196 39.531 19.196ZM37.627 14.702H41.211C41.043 13.526 40.217 13.092 39.461 13.092C38.607 13.092 37.851 13.624 37.627 14.702ZM44.0159 19V11.846H45.7799V12.798C46.3539 12.028 47.2219 11.65 48.0759 11.65V13.47C46.5919 13.19 45.7799 13.834 45.7799 15.024V19H44.0159ZM51.967 19.196C50.119 19.196 48.285 17.894 48.285 15.43C48.285 12.952 50.077 11.65 51.897 11.65C53.689 11.65 55.509 12.924 55.509 15.416V15.962H50.035C50.231 17.096 51.043 17.614 51.967 17.614C52.597 17.614 53.045 17.418 53.325 17.054H55.369C54.753 18.496 53.325 19.196 51.967 19.196ZM50.063 14.702H53.647C53.479 13.526 52.653 13.092 51.897 13.092C51.043 13.092 50.287 13.624 50.063 14.702ZM59.4762 19.196C57.7542 19.196 56.1022 17.894 56.1022 15.43C56.1022 12.952 57.7542 11.65 59.4762 11.65C60.4842 11.65 61.3102 12.014 61.8562 12.714V9.2H63.6202V19H61.8562V18.146C61.3102 18.832 60.4842 19.196 59.4762 19.196ZM57.9362 15.43C57.9362 16.774 58.7622 17.544 59.8962 17.544C61.0442 17.544 61.8562 16.774 61.8562 15.43C61.8562 14.072 61.0442 13.302 59.8962 13.302C58.7622 13.302 57.9362 14.072 57.9362 15.43ZM72.526 19.196C71.518 19.196 70.692 18.832 70.146 18.146V19H68.382V9.2H70.146V12.714C70.692 12.014 71.518 11.65 72.526 11.65C74.248 11.65 75.9 12.952 75.9 15.43C75.9 17.894 74.248 19.196 72.526 19.196ZM70.146 15.43C70.146 16.774 70.958 17.544 72.106 17.544C73.254 17.544 74.066 16.774 74.066 15.43C74.066 14.072 73.254 13.302 72.106 13.302C70.958 13.302 70.146 14.072 70.146 15.43ZM76.9259 21.66L78.2699 18.342L75.4559 11.846H77.3879L79.2079 16.158L80.9299 11.846H82.7639L78.7599 21.66H76.9259Z" fill="#111820"/>
|
|
593
622
|
<g clip-path="url(#clip0_295_2094)">
|
|
@@ -600,25 +629,25 @@ function F(d, t, r = "top-right") {
|
|
|
600
629
|
</defs>
|
|
601
630
|
</svg>`;
|
|
602
631
|
}
|
|
603
|
-
const s =
|
|
632
|
+
const s = i("div", {
|
|
604
633
|
className: "spot-footer__container",
|
|
605
|
-
parent:
|
|
606
|
-
}),
|
|
634
|
+
parent: c
|
|
635
|
+
}), a = i("div", {
|
|
607
636
|
className: "spot-footer__terms",
|
|
608
637
|
parent: s
|
|
609
|
-
}),
|
|
638
|
+
}), n = `<a href="${t.communication.termsAndConditionsUrl}" target="_blank" class="spot-footer__terms-link">Terms & Conditions</a>`, o = t.communication.legalDisclaimer.replace(
|
|
610
639
|
/terms (and|&) conditions/gi,
|
|
611
|
-
|
|
640
|
+
n
|
|
612
641
|
);
|
|
613
|
-
if (
|
|
614
|
-
innerHTML:
|
|
615
|
-
parent:
|
|
642
|
+
if (i("span", {
|
|
643
|
+
innerHTML: o,
|
|
644
|
+
parent: a
|
|
616
645
|
}), r === "bottom-right") {
|
|
617
|
-
const
|
|
646
|
+
const e = i("p", {
|
|
618
647
|
className: "spot-footer__powered-by",
|
|
619
648
|
parent: s
|
|
620
649
|
});
|
|
621
|
-
|
|
650
|
+
e.innerHTML = `
|
|
622
651
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
623
652
|
<rect width="145" height="28"/>
|
|
624
653
|
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
|
@@ -637,18 +666,18 @@ function F(d, t, r = "top-right") {
|
|
|
637
666
|
}
|
|
638
667
|
return s;
|
|
639
668
|
}
|
|
640
|
-
const Y = ":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-border-line-width: .0625rem;--spot-border-color: #e0e0e0;--spot-logo-background-color: #f3fd00;--spot-max-width: 51rem;--spot-margin: 1rem;--spot-title-font-size: 1.25rem;--spot-title-font-weight: 700;--spot-title-padding: 0 0 1.25rem 0;--spot-description-font-size: .875rem;--spot-description-font-weight: 400;--spot-description-padding: 0 0 .5rem 0;--spot-bullets-font-size: .875rem;--spot-bullets-font-weight: 400;--spot-bullets-padding: .3125rem;--spot-bullets-checkmark-color: #2e2e2e;--spot-table-border-radius: .625rem;--spot-table-header-font-size: .875rem;--spot-table-header-font-weight: 700;--spot-table-header-padding: 0 .5rem .625rem;--spot-table-cell-font-size: .815rem;--spot-table-cell-font-weight: 400;--spot-table-cell-padding: 0 .625rem;--spot-radio-border: #000000;--spot-radio-border-radius: .625rem;--spot-radio-checked-background: #000000;--spot-radio-text-font-size: .875rem;--spot-radio-text-font-weight: 400;--spot-radio-text-padding: .625rem;--spot-radio-selection-background: #f4f4f4;--spot-radio-selection-border-radius: .625rem;--spot-radio-selection-padding: .625rem;--spot-recommended-tag-background: #000000;--spot-recommended-tag-font-color: #ffffff;--spot-recommended-tag-font-size: .875rem;--spot-recommended-tag-font-weight: 700;--spot-recommended-tag-padding: .25rem .5rem;--spot-recommended-tag-border-radius: .5rem;--spot-state-dropdown-label-font-size: .875rem;--spot-state-dropdown-label-font-weight: 600;--spot-state-dropdown-label-margin-bottom: .25rem;--spot-state-dropdown-select-border: .0625rem solid #e0e0e0;--spot-state-dropdown-select-border-radius: .375rem;--spot-state-dropdown-select-padding: .5rem .75rem;--spot-state-dropdown-select-font-size: .875rem;--spot-state-dropdown-select-background: #ffffff;--spot-state-dropdown-wrapper-margin-bottom: .75rem;--spot-state-dropdown-error-color: var(--spot-selection-error-font-color);--spot-state-dropdown-error-font-size: .8125rem;--spot-state-dropdown-error-margin-top: .25rem;--spot-selection-error-font-color: #ff0000;--spot-selection-error-font-size: .875rem;--spot-qualifying-reasons-margin: .75rem 0;--spot-qualifying-reasons-padding: 0 .3125rem;--spot-qualifying-reasons-column-gap: 3rem;--spot-qualifying-reasons-row-gap: .25rem;--spot-qualifying-reasons-grid-padding-left: 1rem;--spot-qualifying-reasons-icon-wrapper-size: 1.125rem;--spot-qualifying-reasons-icon-size: .75rem;--spot-qualifying-reasons-icon-border-color: #2e2e2e;--spot-qualifying-reasons-icon-border-width: 1px;--spot-qualifying-reasons-icon-background: #ffffff;--spot-qualifying-reasons-item-gap: .625rem;--spot-qualifying-reasons-label-font-size: .8rem;--spot-qualifying-reasons-label-font-weight: 400;--spot-qualifying-reasons-label-font-color: #000000;--spot-qualifying-reasons-label-font-family: Arial;--spot-selection-error-padding: .5rem;--spot-payment-terms-background: #f4f4f4;--spot-payment-terms-border-radius: .625rem;--spot-payment-terms-padding: 1rem;--spot-payment-terms-font-color: #636569;--spot-payment-terms-font-size: .75rem;--spot-payment-terms-header-font-weight: 700;--spot-payment-terms-header-font-size: .875rem;--spot-payment-terms-header-margin-bottom: .5rem;--spot-payment-terms-header-border-color: #c2c2c2;--spot-payment-terms-header-padding: 0 0 .5rem 0;--spot-terms-font-size: .75rem;--spot-terms-font-weight: 400;--spot-terms-font-color: #636569;--spot-terms-padding: 0;--spot-terms-link-text-decoration: underline;--spot-terms-link-font-size: .75rem;--spot-terms-link-font-weight: 400;--spot-terms-link-font-color: #636569;--spot-terms-link-padding: 0;--spot-covered-items-background: #f1f3f5;--spot-covered-items-hover-background: #e9ecef;--spot-covered-items-border-radius: .5rem;--spot-covered-items-padding: .75rem 1rem;--spot-covered-items-font-size: .875rem;--spot-covered-items-font-weight: 400;--spot-covered-items-font-color: #000000;--spot-covered-items-font-family: Arial;--spot-covered-items-arrow-font-size: .6rem;--spot-covered-items-arrow-color: #636569;--spot-covered-items-view-all-color: #636569;--spot-covered-items-view-all-font-size: .875rem;--spot-covered-items-view-all-font-weight: 400;--spot-covered-items-content-background: #f8f9fa;--spot-covered-items-content-border: 1px solid #e0e0e0;--spot-covered-items-content-border-radius: .5rem;--spot-covered-items-content-padding: .75rem 1rem;--spot-desktop-radio-margin-top: -1.5rem;--spot-benefits-margin-bottom: 0rem;--spot-covered-items-margin-bottom: 1.5rem;--spot-footer-gap: 1rem;--spot-footer-terms-margin-right: 7rem;--spot-payment-terms-margin-top: .5rem;--spot-logo-top-right-margin: 1rem}.spot-refund-guarantee{font-family:var(--spot-font-family);padding:var(--spot-padding);background-color:var(--spot-background-color);color:var(--spot-font-color);border:var(--spot-border-line-width) solid var(--spot-border-color);border-radius:var(--spot-border-radius);max-width:var(--spot-max-width);margin:var(--spot-margin);container-type:inline-size;position:relative;word-wrap:normal;overflow-wrap:normal;-webkit-hyphens:none;hyphens:none}.spot-refund-guarantee *{color:inherit}.spot-header__title{font-size:var(--spot-title-font-size);font-weight:var(--spot-title-font-weight);padding:var(--spot-title-padding);color:var(--spot-title-font-color);font-family:var(--spot-title-font-family);line-height:120%;letter-spacing:-.03125rem}.spot-header__description{font-size:var(--spot-description-font-size);font-weight:var(--spot-description-font-weight);color:var(--spot-description-font-color);font-family:var(--spot-description-font-family);padding:var(--spot-description-padding);line-height:125%;letter-spacing:-.025rem}.spot-content__wrapper{display:flex;flex-direction:column}.spot-content__wrapper.desktop-layout{display:grid;grid-template-columns:1fr auto;align-items:start;gap:1rem}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container,.desktop-layout .spot-covered-items__container,.desktop-layout .spot-selection__wrapper{min-width:0;word-wrap:normal}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container{grid-row:1;margin-bottom:var(--spot-benefits-margin-bottom)}.desktop-layout .spot-covered-items__container{grid-row:2;grid-column:1;margin-bottom:var(--spot-covered-items-margin-bottom)}.desktop-layout .spot-selection__wrapper{grid-row:3;grid-column:1;margin-top:var(--spot-desktop-radio-margin-top)}.desktop-layout .spot-payment-terms__wrapper{grid-row:4;grid-column:1;margin-top:var(--spot-payment-terms-margin-top)}.desktop-layout .spot-table__container{grid-row:1 / span 4;grid-column:2;width:auto;min-width:20.3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-table__container{display:flex;justify-content:flex-start;margin-top:1rem;margin-bottom:1rem;box-sizing:border-box;padding:0 .3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-refund__table{width:100%;max-width:22rem;table-layout:auto}@media (max-width: 850px){.spot-selection__recommended-tag{display:inline-block;margin-left:0}}@media (max-width: 500px){.spot-selection__recommended-tag{margin-top:.5rem}}@media (max-width: 600px){.spot-refund__table th{padding:0rem}}.spot-benefits__list{list-style-type:none;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-benefits__list li{margin-bottom:.375rem;display:flex;align-items:flex-start;gap:.5rem}.spot-benefits__list li svg{flex-shrink:0;position:relative;top:.125rem}.spot-bullets__checkmark path{stroke:var(--spot-bullets-checkmark-color)}.spot-qualifying-reasons__container{margin:var(--spot-qualifying-reasons-margin);padding:var(--spot-qualifying-reasons-padding)}.spot-qualifying-reasons__grid{display:grid;grid-template-columns:repeat(2,minmax(0,max-content));column-gap:var(--spot-qualifying-reasons-column-gap);row-gap:var(--spot-qualifying-reasons-row-gap);max-width:100%;padding-left:var(--spot-qualifying-reasons-grid-padding-left)}.spot-qualifying-reasons__item{display:flex;align-items:center;gap:var(--spot-qualifying-reasons-item-gap)}.spot-qualifying-reasons__icon-wrapper{width:var(--spot-qualifying-reasons-icon-wrapper-size);height:var(--spot-qualifying-reasons-icon-wrapper-size);border-radius:50%;border:var(--spot-qualifying-reasons-icon-border-width) solid var(--spot-qualifying-reasons-icon-border-color);background-color:var(--spot-qualifying-reasons-icon-background);display:flex;align-items:center;justify-content:center;flex-shrink:0}.spot-qualifying-reasons__icon{width:var(--spot-qualifying-reasons-icon-size);height:var(--spot-qualifying-reasons-icon-size)}.spot-qualifying-reasons__label{font-size:var(--spot-qualifying-reasons-label-font-size);font-weight:var(--spot-qualifying-reasons-label-font-weight);color:var(--spot-qualifying-reasons-label-font-color);font-family:var(--spot-qualifying-reasons-label-font-family);line-height:1.2}@media (max-width: 480px){.spot-qualifying-reasons__grid{grid-template-columns:1fr}}.spot-covered-items__container{margin-top:.85rem;margin-bottom:.5rem;max-width:26rem}.spot-content__wrapper.desktop-layout:has(.spot-table__container) .spot-covered-items__container{margin-top:0rem;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);padding:0 .3125rem .25rem;line-height:125%;margin:0}.spot-covered-items__list{list-style-type:disc;list-style-position:inside;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-covered-items__list li{margin-bottom:.3rem;text-align:left}.spot-covered-items__list li:last-child{margin-bottom:0}.spot-covered-items__header{margin-bottom:.5rem}.spot-covered-items__toggle{background:var(--spot-covered-items-background);border:none;border-radius:var(--spot-covered-items-border-radius);padding:var(--spot-covered-items-padding);cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;transition:all .2s ease}.spot-covered-items__toggle:hover{background-color:var(--spot-covered-items-hover-background)}.spot-covered-items__toggle:focus{outline:none;box-shadow:0 0 0 2px #0000001a}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;margin:0;padding:0}.spot-covered-items__right-section{display:flex;align-items:center;gap:.5rem;margin-left:auto}.spot-covered-items__view-all{font-size:var(--spot-covered-items-view-all-font-size);font-weight:var(--spot-covered-items-view-all-font-weight);color:var(--spot-covered-items-view-all-color);font-family:var(--spot-covered-items-font-family);line-height:125%}.spot-covered-items__arrow{font-size:var(--spot-covered-items-arrow-font-size);transition:transform .2s ease;color:var(--spot-covered-items-arrow-color);flex-shrink:0;transform:scaleX(1.5)}.spot-covered-items__content{margin-top:.5rem;transition:all .2s ease;overflow:hidden}.spot-covered-items__list{background-color:var(--spot-covered-items-content-background);border:var(--spot-covered-items-content-border);border-radius:var(--spot-covered-items-content-border-radius);margin:0;padding:var(--spot-covered-items-content-padding)}.spot-table__container{width:100%}.spot-refund__table{max-width:22rem;border-radius:var(--spot-table-border-radius);overflow:hidden;border:.09375rem solid #636569;table-layout:fixed;margin-bottom:.5rem;margin-top:.25rem;padding:.625rem}.spot-refund__table--dynamic{height:auto!important;min-height:7.5rem}.spot-refund__table td,.spot-refund__table th{padding:.375rem .625rem;text-align:left}.spot-refund__table th{text-align:left;font-size:var(--spot-table-header-font-size);font-weight:var(--spot-table-header-font-weight);color:var(--spot-table-header-font-color);font-family:var(--spot-table-header-font-family);padding:var(--spot-table-header-padding)}.spot-refund__table td{text-align:left;font-size:var(--spot-table-cell-font-size);font-weight:var(--spot-table-cell-font-weight);color:var(--spot-table-cell-font-color);font-family:var(--spot-table-cell-font-family);padding:var(--spot-table-cell-padding)}.spot-state-dropdown__wrapper{display:flex;flex-direction:column;margin-bottom:var(--spot-state-dropdown-wrapper-margin-bottom)}.spot-state-dropdown__label{font-size:var(--spot-state-dropdown-label-font-size);font-weight:var(--spot-state-dropdown-label-font-weight);font-family:var(--spot-font-family);color:var(--spot-font-color);margin-bottom:var(--spot-state-dropdown-label-margin-bottom)}.spot-state-dropdown__select{width:100%;box-sizing:border-box;border:var(--spot-state-dropdown-select-border);border-radius:var(--spot-state-dropdown-select-border-radius);padding:var(--spot-state-dropdown-select-padding);font-size:var(--spot-state-dropdown-select-font-size);font-family:var(--spot-font-family);color:var(--spot-font-color);background-color:var(--spot-state-dropdown-select-background);cursor:pointer;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.spot-state-dropdown__select:focus{outline:none;box-shadow:0 0 0 2px #00000026}.spot-state-dropdown__select--error{border-color:var(--spot-state-dropdown-error-color)}.spot-state-dropdown__select--error:focus{box-shadow:0 0 0 2px #ff000026}.spot-state-dropdown__error{display:none;color:var(--spot-state-dropdown-error-color);font-size:var(--spot-state-dropdown-error-font-size);font-family:var(--spot-font-family);margin-top:var(--spot-state-dropdown-error-margin-top)}.spot-state-dropdown__error--visible{display:block}input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:.75rem;height:.75rem;min-width:.75rem;border:.0625rem solid var(--spot-radio-border);border-radius:var(--spot-radio-border-radius);margin-right:.5rem;position:relative;vertical-align:middle;top:-.0625rem;cursor:pointer;flex-shrink:0}input[type=radio]:checked{background:var(--spot-radio-checked-background);box-shadow:inset 0 0 0 .0625rem #fff}.spot-selection__options{display:flex;flex-direction:column;gap:.5rem}.spot-selection__option{display:flex;align-items:center;flex-wrap:nowrap;position:relative;transition:background .2s;cursor:pointer;font-size:var(--spot-radio-text-font-size);font-weight:var(--spot-radio-text-font-weight);color:var(--spot-radio-text-font-color);font-family:var(--spot-radio-text-font-family);padding:var(--spot-radio-text-padding);margin-right:.5rem}.spot-selection__option.selected{background:var(--spot-radio-selection-background);border-radius:var(--spot-radio-selection-border-radius);padding:var(--spot-radio-selection-padding)}.spot-selection__recommended-tag{background:var(--spot-recommended-tag-background);color:var(--spot-recommended-tag-font-color);font-size:var(--spot-recommended-tag-font-size);font-weight:var(--spot-recommended-tag-font-weight);padding:var(--spot-recommended-tag-padding);border-radius:var(--spot-recommended-tag-border-radius);margin-left:.75rem;white-space:nowrap;flex-shrink:0}@media (max-width: 850px){.spot-selection__recommended-tag{margin-left:.5rem}}@media (max-width: 600px){.spot-selection__recommended-tag{margin-left:.5rem;font-size:.75rem;padding:.1875rem .4375rem}}.spot-selection__error{color:var(--spot-selection-error-font-color);font-size:var(--spot-selection-error-font-size);padding:var(--spot-selection-error-padding);display:none}.spot-selection__options--disabled .spot-selection__option{opacity:.4;cursor:not-allowed;pointer-events:none}.spot-selection__options--disabled input[type=radio]{cursor:not-allowed}.spot-payment-terms__wrapper{margin-top:1rem}.spot-payment-terms__header{font-weight:var(--spot-payment-terms-header-font-weight);margin-bottom:.5rem;padding:var(--spot-payment-terms-header-padding);font-size:var(--spot-payment-terms-header-font-size);border-bottom:1px solid var(--spot-payment-terms-header-border-color)}.spot-payment-terms{background-color:var(--spot-payment-terms-background);border-radius:var(--spot-payment-terms-border-radius);padding:var(--spot-payment-terms-padding);color:var(--spot-payment-terms-font-color);font-size:var(--spot-payment-terms-font-size)}.spot-footer__terms{margin-top:.625rem;margin-right:.25rem;font-size:var(--spot-terms-font-size);font-weight:var(--spot-terms-font-weight);color:var(--spot-terms-font-color);font-family:var(--spot-terms-font-family);padding:var(--spot-terms-padding);line-height:1.4;word-wrap:normal;-webkit-hyphens:none;hyphens:none;flex:1;min-width:0;overflow-wrap:normal}.spot-footer__terms-link{text-decoration:var(--spot-terms-link-text-decoration);font-size:var(--spot-terms-link-font-size);font-weight:var(--spot-terms-link-font-weight);color:var(--spot-terms-link-font-color);font-family:var(--spot-terms-link-font-family);padding:var(--spot-terms-link-padding)}.spot-footer__container{display:flex;flex-direction:row;justify-content:space-between;align-items:flex-start;flex-wrap:nowrap;gap:var(--spot-footer-gap)}@container (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}@media (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}.spot-footer__powered-by{margin-top:0;flex-shrink:0}.spot-logo__top-right{position:absolute;top:-14px;right:5%;z-index:10;background:linear-gradient(to bottom,transparent 50%,inherit 50%);padding:0 .25rem}.spot-logo__top-right svg{border-radius:9999px;overflow:hidden;border:var(--spot-border-line-width) solid var(--spot-border-color);display:block;background:var(--spot-logo-background-color)}@container (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}@media (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}";
|
|
641
|
-
function
|
|
669
|
+
const G = ":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-border-line-width: .0625rem;--spot-border-color: #e0e0e0;--spot-logo-background-color: #f3fd00;--spot-max-width: 51rem;--spot-margin: 1rem;--spot-title-font-size: 1.25rem;--spot-title-font-weight: 700;--spot-title-padding: 0 0 1.25rem 0;--spot-description-font-size: .875rem;--spot-description-font-weight: 400;--spot-description-padding: 0 0 .5rem 0;--spot-bullets-font-size: .875rem;--spot-bullets-font-weight: 400;--spot-bullets-padding: .3125rem;--spot-bullets-checkmark-color: #2e2e2e;--spot-table-border-radius: .625rem;--spot-table-header-font-size: .875rem;--spot-table-header-font-weight: 700;--spot-table-header-padding: 0 .5rem .625rem;--spot-table-cell-font-size: .815rem;--spot-table-cell-font-weight: 400;--spot-table-cell-padding: 0 .625rem;--spot-radio-border: #000000;--spot-radio-border-radius: .625rem;--spot-radio-checked-background: #000000;--spot-radio-text-font-size: .875rem;--spot-radio-text-font-weight: 400;--spot-radio-text-padding: .625rem;--spot-radio-selection-background: #f4f4f4;--spot-radio-selection-border-radius: .625rem;--spot-radio-selection-padding: .625rem;--spot-recommended-tag-background: #000000;--spot-recommended-tag-font-color: #ffffff;--spot-recommended-tag-font-size: .875rem;--spot-recommended-tag-font-weight: 700;--spot-recommended-tag-padding: .25rem .5rem;--spot-recommended-tag-border-radius: .5rem;--spot-state-dropdown-label-font-size: .875rem;--spot-state-dropdown-label-font-weight: 600;--spot-state-dropdown-label-margin-bottom: .25rem;--spot-state-dropdown-select-border: .0625rem solid #e0e0e0;--spot-state-dropdown-select-border-radius: .375rem;--spot-state-dropdown-select-padding: .5rem .75rem;--spot-state-dropdown-select-font-size: .875rem;--spot-state-dropdown-select-background: #ffffff;--spot-state-dropdown-wrapper-margin-bottom: .75rem;--spot-state-dropdown-error-color: var(--spot-selection-error-font-color);--spot-state-dropdown-error-font-size: .8125rem;--spot-state-dropdown-error-margin-top: .25rem;--spot-selection-error-font-color: #ff0000;--spot-selection-error-font-size: .875rem;--spot-qualifying-reasons-margin: .75rem 0;--spot-qualifying-reasons-padding: 0 .3125rem;--spot-qualifying-reasons-column-gap: 3rem;--spot-qualifying-reasons-row-gap: .25rem;--spot-qualifying-reasons-grid-padding-left: 1rem;--spot-qualifying-reasons-icon-wrapper-size: 1.125rem;--spot-qualifying-reasons-icon-size: .75rem;--spot-qualifying-reasons-icon-border-color: #2e2e2e;--spot-qualifying-reasons-icon-border-width: 1px;--spot-qualifying-reasons-icon-background: #ffffff;--spot-qualifying-reasons-item-gap: .625rem;--spot-qualifying-reasons-label-font-size: .8rem;--spot-qualifying-reasons-label-font-weight: 400;--spot-qualifying-reasons-label-font-color: #000000;--spot-qualifying-reasons-label-font-family: Arial;--spot-selection-error-padding: .5rem;--spot-payment-terms-background: #f4f4f4;--spot-payment-terms-border-radius: .625rem;--spot-payment-terms-padding: 1rem;--spot-payment-terms-font-color: #636569;--spot-payment-terms-font-size: .75rem;--spot-payment-terms-header-font-weight: 700;--spot-payment-terms-header-font-size: .875rem;--spot-payment-terms-header-margin-bottom: .5rem;--spot-payment-terms-header-border-color: #c2c2c2;--spot-payment-terms-header-padding: 0 0 .5rem 0;--spot-terms-font-size: .75rem;--spot-terms-font-weight: 400;--spot-terms-font-color: #636569;--spot-terms-padding: 0;--spot-terms-link-text-decoration: underline;--spot-terms-link-font-size: .75rem;--spot-terms-link-font-weight: 400;--spot-terms-link-font-color: #636569;--spot-terms-link-padding: 0;--spot-covered-items-background: #f1f3f5;--spot-covered-items-hover-background: #e9ecef;--spot-covered-items-border-radius: .5rem;--spot-covered-items-padding: .75rem 1rem;--spot-covered-items-font-size: .875rem;--spot-covered-items-font-weight: 400;--spot-covered-items-font-color: #000000;--spot-covered-items-font-family: Arial;--spot-covered-items-arrow-font-size: .6rem;--spot-covered-items-arrow-color: #636569;--spot-covered-items-view-all-color: #636569;--spot-covered-items-view-all-font-size: .875rem;--spot-covered-items-view-all-font-weight: 400;--spot-covered-items-content-background: #f8f9fa;--spot-covered-items-content-border: 1px solid #e0e0e0;--spot-covered-items-content-border-radius: .5rem;--spot-covered-items-content-padding: .75rem 1rem;--spot-desktop-radio-margin-top: -1.5rem;--spot-benefits-margin-bottom: 0rem;--spot-covered-items-margin-bottom: 1.5rem;--spot-footer-gap: 1rem;--spot-footer-terms-margin-right: 7rem;--spot-payment-terms-margin-top: .5rem;--spot-logo-top-right-margin: 1rem}.spot-refund-guarantee{font-family:var(--spot-font-family);padding:var(--spot-padding);background-color:var(--spot-background-color);color:var(--spot-font-color);border:var(--spot-border-line-width) solid var(--spot-border-color);border-radius:var(--spot-border-radius);max-width:var(--spot-max-width);margin:var(--spot-margin);container-type:inline-size;position:relative;word-wrap:normal;overflow-wrap:normal;-webkit-hyphens:none;hyphens:none}.spot-refund-guarantee *{color:inherit}.spot-header__title{font-size:var(--spot-title-font-size);font-weight:var(--spot-title-font-weight);padding:var(--spot-title-padding);color:var(--spot-title-font-color);font-family:var(--spot-title-font-family);line-height:120%;letter-spacing:-.03125rem}.spot-header__description{font-size:var(--spot-description-font-size);font-weight:var(--spot-description-font-weight);color:var(--spot-description-font-color);font-family:var(--spot-description-font-family);padding:var(--spot-description-padding);line-height:125%;letter-spacing:-.025rem}.spot-content__wrapper{display:flex;flex-direction:column}.spot-content__wrapper.desktop-layout{display:grid;grid-template-columns:1fr auto;align-items:start;gap:1rem}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container,.desktop-layout .spot-covered-items__container,.desktop-layout .spot-selection__wrapper{min-width:0;word-wrap:normal}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container{grid-row:1;margin-bottom:var(--spot-benefits-margin-bottom)}.desktop-layout .spot-covered-items__container{grid-row:2;grid-column:1;margin-bottom:var(--spot-covered-items-margin-bottom)}.desktop-layout .spot-selection__wrapper{grid-row:3;grid-column:1;margin-top:var(--spot-desktop-radio-margin-top)}.desktop-layout .spot-payment-terms__wrapper{grid-row:4;grid-column:1;margin-top:var(--spot-payment-terms-margin-top)}.desktop-layout .spot-table__container{grid-row:1 / span 4;grid-column:2;width:auto;min-width:20.3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-table__container{display:flex;justify-content:flex-start;margin-top:1rem;margin-bottom:1rem;box-sizing:border-box;padding:0 .3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-refund__table{width:100%;max-width:22rem;table-layout:auto}@media (max-width: 850px){.spot-selection__recommended-tag{display:inline-block;margin-left:0}}@media (max-width: 500px){.spot-selection__recommended-tag{margin-top:.5rem}}@media (max-width: 600px){.spot-refund__table th{padding:0rem}}.spot-benefits__list{list-style-type:none;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-benefits__list li{margin-bottom:.375rem;display:flex;align-items:flex-start;gap:.5rem}.spot-benefits__list li svg{flex-shrink:0;position:relative;top:.125rem}.spot-bullets__checkmark path{stroke:var(--spot-bullets-checkmark-color)}.spot-qualifying-reasons__container{margin:var(--spot-qualifying-reasons-margin);padding:var(--spot-qualifying-reasons-padding)}.spot-qualifying-reasons__grid{display:grid;grid-template-columns:repeat(2,minmax(0,max-content));column-gap:var(--spot-qualifying-reasons-column-gap);row-gap:var(--spot-qualifying-reasons-row-gap);max-width:100%;padding-left:var(--spot-qualifying-reasons-grid-padding-left)}.spot-qualifying-reasons__item{display:flex;align-items:center;gap:var(--spot-qualifying-reasons-item-gap)}.spot-qualifying-reasons__icon-wrapper{width:var(--spot-qualifying-reasons-icon-wrapper-size);height:var(--spot-qualifying-reasons-icon-wrapper-size);border-radius:50%;border:var(--spot-qualifying-reasons-icon-border-width) solid var(--spot-qualifying-reasons-icon-border-color);background-color:var(--spot-qualifying-reasons-icon-background);display:flex;align-items:center;justify-content:center;flex-shrink:0}.spot-qualifying-reasons__icon{width:var(--spot-qualifying-reasons-icon-size);height:var(--spot-qualifying-reasons-icon-size)}.spot-qualifying-reasons__label{font-size:var(--spot-qualifying-reasons-label-font-size);font-weight:var(--spot-qualifying-reasons-label-font-weight);color:var(--spot-qualifying-reasons-label-font-color);font-family:var(--spot-qualifying-reasons-label-font-family);line-height:1.2}@media (max-width: 480px){.spot-qualifying-reasons__grid{grid-template-columns:1fr}}.spot-covered-items__container{margin-top:.85rem;margin-bottom:.5rem;max-width:26rem}.spot-content__wrapper.desktop-layout:has(.spot-table__container) .spot-covered-items__container{margin-top:0rem;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);padding:0 .3125rem .25rem;line-height:125%;margin:0}.spot-covered-items__list{list-style-type:disc;list-style-position:inside;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-covered-items__list li{margin-bottom:.3rem;text-align:left}.spot-covered-items__list li:last-child{margin-bottom:0}.spot-covered-items__header{margin-bottom:.5rem}.spot-covered-items__toggle{background:var(--spot-covered-items-background);border:none;border-radius:var(--spot-covered-items-border-radius);padding:var(--spot-covered-items-padding);cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;transition:all .2s ease}.spot-covered-items__toggle:hover{background-color:var(--spot-covered-items-hover-background)}.spot-covered-items__toggle:focus{outline:none;box-shadow:0 0 0 2px #0000001a}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;margin:0;padding:0}.spot-covered-items__right-section{display:flex;align-items:center;gap:.5rem;margin-left:auto}.spot-covered-items__view-all{font-size:var(--spot-covered-items-view-all-font-size);font-weight:var(--spot-covered-items-view-all-font-weight);color:var(--spot-covered-items-view-all-color);font-family:var(--spot-covered-items-font-family);line-height:125%}.spot-covered-items__arrow{font-size:var(--spot-covered-items-arrow-font-size);transition:transform .2s ease;color:var(--spot-covered-items-arrow-color);flex-shrink:0;transform:scaleX(1.5)}.spot-covered-items__content{margin-top:.5rem;transition:all .2s ease;overflow:hidden}.spot-covered-items__list{background-color:var(--spot-covered-items-content-background);border:var(--spot-covered-items-content-border);border-radius:var(--spot-covered-items-content-border-radius);margin:0;padding:var(--spot-covered-items-content-padding)}.spot-refund-schedule{border:var(--spot-covered-items-content-border);border-radius:var(--spot-covered-items-border-radius);overflow:hidden;margin-bottom:1rem}.spot-refund-schedule .spot-covered-items__header{margin-bottom:0}.spot-refund-schedule .spot-covered-items__toggle{border-radius:0}.spot-refund-schedule .spot-covered-items__content{margin-top:0}.spot-refund-schedule .spot-covered-items__list{border:none;border-radius:0;background:transparent;padding:.5rem 1rem;list-style:none}.spot-refund-schedule .spot-covered-items__list li{display:flex;justify-content:space-between;padding:.375rem 0;margin:0;gap:.75rem}.spot-refund-schedule .spot-covered-items__list li>span:first-child{min-width:0}.spot-refund-schedule .spot-covered-items__list li>span:last-child{text-align:right;white-space:nowrap}.spot-table__container{width:100%}.spot-refund__table{max-width:22rem;border-radius:var(--spot-table-border-radius);overflow:hidden;border:.09375rem solid #636569;table-layout:fixed;margin-bottom:.5rem;margin-top:.25rem;padding:.625rem}.spot-refund__table--dynamic{height:auto!important;min-height:7.5rem}.spot-refund__table td,.spot-refund__table th{padding:.375rem .625rem;text-align:left}.spot-refund__table th{text-align:left;font-size:var(--spot-table-header-font-size);font-weight:var(--spot-table-header-font-weight);color:var(--spot-table-header-font-color);font-family:var(--spot-table-header-font-family);padding:var(--spot-table-header-padding)}.spot-refund__table td{text-align:left;font-size:var(--spot-table-cell-font-size);font-weight:var(--spot-table-cell-font-weight);color:var(--spot-table-cell-font-color);font-family:var(--spot-table-cell-font-family);padding:var(--spot-table-cell-padding)}.spot-state-dropdown__wrapper{display:flex;flex-direction:column;margin-bottom:var(--spot-state-dropdown-wrapper-margin-bottom)}.spot-state-dropdown__label{font-size:var(--spot-state-dropdown-label-font-size);font-weight:var(--spot-state-dropdown-label-font-weight);font-family:var(--spot-font-family);color:var(--spot-font-color);margin-bottom:var(--spot-state-dropdown-label-margin-bottom)}.spot-state-dropdown__select{width:100%;box-sizing:border-box;border:var(--spot-state-dropdown-select-border);border-radius:var(--spot-state-dropdown-select-border-radius);padding:var(--spot-state-dropdown-select-padding);font-size:var(--spot-state-dropdown-select-font-size);font-family:var(--spot-font-family);color:var(--spot-font-color);background-color:var(--spot-state-dropdown-select-background);cursor:pointer;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.spot-state-dropdown__select:focus{outline:none;box-shadow:0 0 0 2px #00000026}.spot-state-dropdown__select--error{border-color:var(--spot-state-dropdown-error-color)}.spot-state-dropdown__select--error:focus{box-shadow:0 0 0 2px #ff000026}.spot-state-dropdown__error{display:none;color:var(--spot-state-dropdown-error-color);font-size:var(--spot-state-dropdown-error-font-size);font-family:var(--spot-font-family);margin-top:var(--spot-state-dropdown-error-margin-top)}.spot-state-dropdown__error--visible{display:block}input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:.75rem;height:.75rem;min-width:.75rem;border:.0625rem solid var(--spot-radio-border);border-radius:var(--spot-radio-border-radius);margin-right:.5rem;position:relative;vertical-align:middle;top:-.0625rem;cursor:pointer;flex-shrink:0}input[type=radio]:checked{background:var(--spot-radio-checked-background);box-shadow:inset 0 0 0 .0625rem #fff}.spot-selection__wrapper{max-width:26rem}.spot-selection__options{display:flex;flex-direction:column;gap:.5rem}.spot-selection__option{display:flex;align-items:center;flex-wrap:nowrap;position:relative;transition:background .2s;cursor:pointer;font-size:var(--spot-radio-text-font-size);font-weight:var(--spot-radio-text-font-weight);color:var(--spot-radio-text-font-color);font-family:var(--spot-radio-text-font-family);padding:var(--spot-radio-text-padding);margin-right:.5rem}.spot-selection__option.selected{background:var(--spot-radio-selection-background);border-radius:var(--spot-radio-selection-border-radius);padding:var(--spot-radio-selection-padding)}.spot-selection__recommended-tag{background:var(--spot-recommended-tag-background);color:var(--spot-recommended-tag-font-color);font-size:var(--spot-recommended-tag-font-size);font-weight:var(--spot-recommended-tag-font-weight);padding:var(--spot-recommended-tag-padding);border-radius:var(--spot-recommended-tag-border-radius);margin-left:.75rem;white-space:nowrap;flex-shrink:0}@media (max-width: 850px){.spot-selection__recommended-tag{margin-left:.5rem}}@media (max-width: 600px){.spot-selection__recommended-tag{margin-left:.5rem;font-size:.75rem;padding:.1875rem .4375rem}}.spot-selection__error{color:var(--spot-selection-error-font-color);font-size:var(--spot-selection-error-font-size);padding:var(--spot-selection-error-padding);display:none}.spot-selection__options--disabled .spot-selection__option{opacity:.4;cursor:not-allowed;pointer-events:none}.spot-selection__options--disabled input[type=radio]{cursor:not-allowed}.spot-payment-terms__wrapper{margin-top:1rem;max-width:26rem}.spot-payment-terms__header{font-weight:var(--spot-payment-terms-header-font-weight);margin-bottom:.5rem;padding:var(--spot-payment-terms-header-padding);font-size:var(--spot-payment-terms-header-font-size);border-bottom:1px solid var(--spot-payment-terms-header-border-color)}.spot-payment-terms{background-color:var(--spot-payment-terms-background);border-radius:var(--spot-payment-terms-border-radius);padding:var(--spot-payment-terms-padding);color:var(--spot-payment-terms-font-color);font-size:var(--spot-payment-terms-font-size)}.spot-footer__terms{margin-top:.625rem;margin-right:.25rem;font-size:var(--spot-terms-font-size);font-weight:var(--spot-terms-font-weight);color:var(--spot-terms-font-color);font-family:var(--spot-terms-font-family);padding:var(--spot-terms-padding);line-height:1.4;word-wrap:normal;-webkit-hyphens:none;hyphens:none;flex:1;min-width:0;overflow-wrap:normal}.spot-footer__terms-link{text-decoration:var(--spot-terms-link-text-decoration);font-size:var(--spot-terms-link-font-size);font-weight:var(--spot-terms-link-font-weight);color:var(--spot-terms-link-font-color);font-family:var(--spot-terms-link-font-family);padding:var(--spot-terms-link-padding)}.spot-footer__container{display:flex;flex-direction:row;justify-content:space-between;align-items:flex-start;flex-wrap:nowrap;gap:var(--spot-footer-gap)}@container (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}@media (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}.spot-footer__powered-by{margin-top:0;flex-shrink:0}.spot-logo__top-right{position:absolute;top:-14px;right:5%;z-index:10;background:linear-gradient(to bottom,transparent 50%,inherit 50%);padding:0 .25rem}.spot-logo__top-right svg{border-radius:9999px;overflow:hidden;border:var(--spot-border-line-width) solid var(--spot-border-color);display:block;background:var(--spot-logo-background-color)}@container (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}@media (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}";
|
|
670
|
+
function K(c) {
|
|
642
671
|
const t = document.createElement("style");
|
|
643
|
-
t.textContent =
|
|
672
|
+
t.textContent = c, document.head.appendChild(t);
|
|
644
673
|
}
|
|
645
|
-
G
|
|
646
|
-
const
|
|
674
|
+
K(G);
|
|
675
|
+
const R = {
|
|
647
676
|
sandbox: "https://api.sandbox.getspot.com/api/v1/quote",
|
|
648
677
|
production: "https://api.getspot.com/api/v1/quote",
|
|
649
678
|
local: "http://localhost:3999/api/v1/quote"
|
|
650
679
|
};
|
|
651
|
-
class
|
|
680
|
+
class X {
|
|
652
681
|
constructor(t = {}) {
|
|
653
682
|
this._destroyed = !1, this.options = {
|
|
654
683
|
location: "body",
|
|
@@ -659,53 +688,53 @@ class K {
|
|
|
659
688
|
callbacks: {},
|
|
660
689
|
useMockData: !1,
|
|
661
690
|
...t,
|
|
662
|
-
selection: t.selection ??
|
|
691
|
+
selection: t.selection ?? w.UNSELECTED
|
|
663
692
|
}, this._onResize = this._updateLayout.bind(this), this.root = typeof this.options.location == "string" ? document.querySelector(this.options.location) : this.options.location, this.currentSelection = this.options.selection, this._init();
|
|
664
693
|
}
|
|
665
694
|
async _init() {
|
|
666
|
-
var t, r, s,
|
|
695
|
+
var t, r, s, a, n;
|
|
667
696
|
try {
|
|
668
697
|
M(this.options), this.currentState = this.options.state;
|
|
669
|
-
let
|
|
698
|
+
let o;
|
|
670
699
|
if (this.options.useMockData && this.options.mockData)
|
|
671
|
-
|
|
700
|
+
o = this.options.mockData;
|
|
672
701
|
else {
|
|
673
|
-
const { environment:
|
|
674
|
-
|
|
702
|
+
const { environment: e, partnerId: l } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || R[e];
|
|
703
|
+
o = "items" in this.options.quoteRequestData ? await T(
|
|
675
704
|
f,
|
|
676
|
-
|
|
705
|
+
l,
|
|
677
706
|
this.options.quoteRequestData,
|
|
678
707
|
this._validState()
|
|
679
|
-
) : await
|
|
708
|
+
) : await S(
|
|
680
709
|
f,
|
|
681
|
-
|
|
710
|
+
l,
|
|
682
711
|
this.options.quoteRequestData,
|
|
683
712
|
this._validState()
|
|
684
713
|
);
|
|
685
714
|
}
|
|
686
715
|
if (this._destroyed) return;
|
|
687
|
-
if (
|
|
688
|
-
|
|
716
|
+
if (o.status !== "QUOTE_AVAILABLE") {
|
|
717
|
+
o.status === "NO_MATCHING_QUOTE" && ((t = this.options.callbacks) != null && t.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
|
|
689
718
|
status: "NO_MATCHING_QUOTE",
|
|
690
719
|
data: this.options.quoteRequestData
|
|
691
720
|
});
|
|
692
721
|
return;
|
|
693
722
|
}
|
|
694
|
-
if (this.quote =
|
|
723
|
+
if (this.quote = o.data, !this.quote)
|
|
695
724
|
throw new Error("No quote data in response");
|
|
696
|
-
if (this._renderWidget(), this.options.selection ===
|
|
697
|
-
const
|
|
725
|
+
if (this._renderWidget(), this.options.selection === w.YES && ((r = this.options.callbacks) != null && r.onOptIn)) {
|
|
726
|
+
const e = {
|
|
698
727
|
status: "QUOTE_ACCEPTED",
|
|
699
728
|
spotPrice: this.quote.spotPrice,
|
|
700
729
|
quoteId: this.quote.id,
|
|
701
730
|
state: this._validState()
|
|
702
731
|
};
|
|
703
732
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
var
|
|
707
|
-
const f = (
|
|
708
|
-
(
|
|
733
|
+
const l = this.options.quoteRequestData;
|
|
734
|
+
e.batchQuoteDetails = this.quote.originalQuotes.map((m) => {
|
|
735
|
+
var h;
|
|
736
|
+
const f = (h = l.items) == null ? void 0 : h.find(
|
|
737
|
+
(g) => (g.cartItemId || `item-${l.items.indexOf(g) + 1}`) === m.cartItemId
|
|
709
738
|
);
|
|
710
739
|
return {
|
|
711
740
|
quoteId: m.id,
|
|
@@ -714,80 +743,58 @@ class K {
|
|
|
714
743
|
};
|
|
715
744
|
});
|
|
716
745
|
}
|
|
717
|
-
this.options.callbacks.onOptIn(
|
|
746
|
+
this.options.callbacks.onOptIn(e);
|
|
718
747
|
}
|
|
719
748
|
if ((s = this.options.callbacks) != null && s.onQuoteRetrieved) {
|
|
720
|
-
const
|
|
721
|
-
|
|
749
|
+
const e = this.options.callbacks.onQuoteRetrieved(this.quote);
|
|
750
|
+
e && this._applyQuoteUpdates(e);
|
|
722
751
|
}
|
|
723
|
-
} catch (
|
|
752
|
+
} catch (o) {
|
|
724
753
|
if (this._destroyed) return;
|
|
725
|
-
if ((
|
|
726
|
-
const
|
|
727
|
-
(
|
|
728
|
-
message:
|
|
729
|
-
status:
|
|
730
|
-
responseBody:
|
|
754
|
+
if ((a = this.options.callbacks) != null && a.onError) {
|
|
755
|
+
const e = o;
|
|
756
|
+
(n = this.options.callbacks) == null || n.onError({
|
|
757
|
+
message: e.message,
|
|
758
|
+
status: e.status,
|
|
759
|
+
responseBody: e.responseBody
|
|
731
760
|
});
|
|
732
761
|
}
|
|
733
762
|
}
|
|
734
763
|
}
|
|
735
764
|
_renderWidget() {
|
|
736
765
|
if (!this.quote) return;
|
|
737
|
-
this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([
|
|
738
|
-
const
|
|
739
|
-
this.container.style.setProperty(
|
|
766
|
+
this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([o, e]) => {
|
|
767
|
+
const l = `--${o}`;
|
|
768
|
+
this.container.style.setProperty(l, e);
|
|
740
769
|
}), $(this.container, this.quote.communication);
|
|
741
770
|
const t = document.createElement("div");
|
|
742
771
|
if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ? Q(t, this.quote.qualifyingReasons) : V(t, this.quote.communication.bulletPoints), this.quote.coveredItems) {
|
|
743
|
-
const
|
|
744
|
-
U(t, this.quote.coveredItems,
|
|
772
|
+
const o = this._getTotalItemsInRequest();
|
|
773
|
+
U(t, this.quote.coveredItems, o);
|
|
745
774
|
}
|
|
746
|
-
this.options.showTable && !this.quote.qualifyingReasons &&
|
|
747
|
-
const r =
|
|
775
|
+
this.options.showTable && !this.quote.qualifyingReasons && j(t, this.quote.payoutSchedule, this.quote.currencyCode);
|
|
776
|
+
const r = i("div", {
|
|
748
777
|
className: "spot-selection__wrapper",
|
|
749
778
|
parent: t
|
|
750
779
|
});
|
|
751
|
-
this._isPassOrTrip() && !this.options.state && (this._stateSelectEl =
|
|
752
|
-
const
|
|
780
|
+
this._isPassOrTrip() && !this.options.state && (this._stateSelectEl = F(r, this.currentState), this._setNonUsResidentError(this.currentState === E));
|
|
781
|
+
const a = !this._isQuotingAvailable(), n = W(
|
|
753
782
|
r,
|
|
754
783
|
this.currentSelection,
|
|
755
784
|
this.quote.communication,
|
|
756
|
-
|
|
785
|
+
a
|
|
757
786
|
);
|
|
758
|
-
this.paymentTermsEl =
|
|
787
|
+
this.paymentTermsEl = i("div", {
|
|
759
788
|
className: "spot-payment-terms__wrapper",
|
|
760
789
|
parent: t
|
|
761
|
-
}), this.currentSelection ===
|
|
790
|
+
}), this.currentSelection === w.YES && H(this.paymentTermsEl, this.quote), Y(this.container, this.quote, this.options.logoPosition), window.addEventListener("resize", this._onResize), this._setupResizeObserver(), this._updateLayout(), this._setupOptionListeners(n), this._setupStateDropdownListener();
|
|
762
791
|
}
|
|
763
792
|
_updateLayout() {
|
|
764
793
|
if (!this.container || !this.quote) return;
|
|
765
794
|
const t = this.container.querySelector(
|
|
766
795
|
".spot-content__wrapper"
|
|
767
|
-
)
|
|
768
|
-
|
|
769
|
-
t == null || t.classList.remove("desktop-layout");
|
|
770
|
-
return;
|
|
771
|
-
}
|
|
772
|
-
const s = this._shouldUseDesktopLayout(t);
|
|
773
|
-
t.classList.toggle("desktop-layout", s);
|
|
774
|
-
}
|
|
775
|
-
_shouldUseDesktopLayout(t) {
|
|
776
|
-
const r = this.container.offsetWidth - 40, s = 325, i = 16;
|
|
777
|
-
if (r >= 900)
|
|
778
|
-
return !0;
|
|
779
|
-
if (r >= 650) {
|
|
780
|
-
const a = t.classList.contains("desktop-layout");
|
|
781
|
-
t.classList.remove("desktop-layout"), t.offsetHeight;
|
|
782
|
-
const e = t.querySelector(
|
|
783
|
-
".spot-benefits__list, .spot-qualifying-reasons__container"
|
|
784
|
-
);
|
|
785
|
-
if (!e)
|
|
786
|
-
return a && t.classList.add("desktop-layout"), a;
|
|
787
|
-
const p = Math.min(e.scrollWidth, 400) + s + i;
|
|
788
|
-
return a && t.classList.add("desktop-layout"), r >= p;
|
|
789
|
-
}
|
|
790
|
-
return !1;
|
|
796
|
+
);
|
|
797
|
+
t == null || t.classList.remove("desktop-layout");
|
|
791
798
|
}
|
|
792
799
|
_setupResizeObserver() {
|
|
793
800
|
!this.container || !window.ResizeObserver || (this._resizeObserver = new ResizeObserver(() => {
|
|
@@ -824,15 +831,15 @@ class K {
|
|
|
824
831
|
return !this._isPassOrTrip() || this.options.state ? !0 : !!this.currentState && this.currentState !== E;
|
|
825
832
|
}
|
|
826
833
|
_setRadiosDisabled(t) {
|
|
827
|
-
var
|
|
828
|
-
const r = (
|
|
829
|
-
r == null || r.forEach((
|
|
830
|
-
|
|
831
|
-
}), s == null || s.classList.toggle("spot-selection__options--disabled", t), t && (r == null || r.forEach((
|
|
832
|
-
|
|
833
|
-
}), (
|
|
834
|
-
|
|
835
|
-
}), this.currentSelection =
|
|
834
|
+
var a, n, o;
|
|
835
|
+
const r = (a = this.container) == null ? void 0 : a.querySelectorAll('input[name="selection"]'), s = (n = this.container) == null ? void 0 : n.querySelector(".spot-selection__options");
|
|
836
|
+
r == null || r.forEach((e) => {
|
|
837
|
+
e.disabled = t;
|
|
838
|
+
}), s == null || s.classList.toggle("spot-selection__options--disabled", t), t && (r == null || r.forEach((e) => {
|
|
839
|
+
e.checked = !1;
|
|
840
|
+
}), (o = this.container) == null || o.querySelectorAll(".spot-selection__option").forEach((e) => {
|
|
841
|
+
e.classList.remove("selected");
|
|
842
|
+
}), this.currentSelection = w.UNSELECTED, this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""));
|
|
836
843
|
}
|
|
837
844
|
_setNonUsResidentError(t) {
|
|
838
845
|
var s;
|
|
@@ -852,58 +859,58 @@ class K {
|
|
|
852
859
|
const r = t.querySelectorAll(
|
|
853
860
|
'input[type="radio"]'
|
|
854
861
|
), s = t.querySelectorAll(".spot-selection__option");
|
|
855
|
-
r.forEach((
|
|
856
|
-
|
|
857
|
-
var
|
|
858
|
-
const
|
|
859
|
-
if (this.hideSelectionError(), this.currentSelection =
|
|
860
|
-
const
|
|
862
|
+
r.forEach((a) => {
|
|
863
|
+
a.addEventListener("change", (n) => {
|
|
864
|
+
var l, m, f, h;
|
|
865
|
+
const o = n.target, e = o.value;
|
|
866
|
+
if (this.hideSelectionError(), this.currentSelection = e, s.forEach((g) => g.classList.remove("selected")), (l = o.closest(".spot-selection__option")) == null || l.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), e === w.YES && ((m = this.quote) != null && m.communication.paymentTerms && H(this.paymentTermsEl, this.quote), (f = this.options.callbacks) != null && f.onOptIn)) {
|
|
867
|
+
const g = {
|
|
861
868
|
status: "QUOTE_ACCEPTED",
|
|
862
869
|
spotPrice: this.quote.spotPrice,
|
|
863
870
|
quoteId: this.quote.id,
|
|
864
871
|
state: this._validState()
|
|
865
872
|
};
|
|
866
873
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
867
|
-
const
|
|
868
|
-
|
|
874
|
+
const p = this.options.quoteRequestData;
|
|
875
|
+
g.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
869
876
|
(u) => {
|
|
870
877
|
var b;
|
|
871
|
-
const
|
|
872
|
-
(
|
|
878
|
+
const d = (b = p.items) == null ? void 0 : b.find(
|
|
879
|
+
(_) => (_.cartItemId || `item-${p.items.indexOf(_) + 1}`) === u.cartItemId
|
|
873
880
|
);
|
|
874
881
|
return {
|
|
875
882
|
quoteId: u.id,
|
|
876
|
-
productPrice: (
|
|
877
|
-
cartItemId: (
|
|
883
|
+
productPrice: (d == null ? void 0 : d.productPrice) || u.spotPrice,
|
|
884
|
+
cartItemId: (d == null ? void 0 : d.cartItemId) || ""
|
|
878
885
|
};
|
|
879
886
|
}
|
|
880
887
|
);
|
|
881
888
|
}
|
|
882
|
-
this.options.callbacks.onOptIn(
|
|
889
|
+
this.options.callbacks.onOptIn(g);
|
|
883
890
|
}
|
|
884
|
-
if (
|
|
885
|
-
const
|
|
891
|
+
if (e === w.NO && ((h = this.options.callbacks) != null && h.onOptOut)) {
|
|
892
|
+
const g = {
|
|
886
893
|
status: "QUOTE_DECLINED",
|
|
887
894
|
quoteId: this.quote.id,
|
|
888
895
|
state: this._validState()
|
|
889
896
|
};
|
|
890
897
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
891
|
-
const
|
|
892
|
-
|
|
898
|
+
const p = this.options.quoteRequestData;
|
|
899
|
+
g.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
893
900
|
(u) => {
|
|
894
901
|
var b;
|
|
895
|
-
const
|
|
896
|
-
(
|
|
902
|
+
const d = (b = p.items) == null ? void 0 : b.find(
|
|
903
|
+
(_) => (_.cartItemId || `item-${p.items.indexOf(_) + 1}`) === u.cartItemId
|
|
897
904
|
);
|
|
898
905
|
return {
|
|
899
906
|
quoteId: u.id,
|
|
900
|
-
productPrice: (
|
|
901
|
-
cartItemId: (
|
|
907
|
+
productPrice: (d == null ? void 0 : d.productPrice) || u.spotPrice,
|
|
908
|
+
cartItemId: (d == null ? void 0 : d.cartItemId) || ""
|
|
902
909
|
};
|
|
903
910
|
}
|
|
904
911
|
);
|
|
905
912
|
}
|
|
906
|
-
this.options.callbacks.onOptOut(
|
|
913
|
+
this.options.callbacks.onOptOut(g);
|
|
907
914
|
}
|
|
908
915
|
});
|
|
909
916
|
});
|
|
@@ -930,67 +937,67 @@ class K {
|
|
|
930
937
|
return t ? this.hideSelectionError() : this.showSelectionError(), t;
|
|
931
938
|
}
|
|
932
939
|
async updateQuote(t) {
|
|
933
|
-
var r, s,
|
|
940
|
+
var r, s, a, n;
|
|
934
941
|
if (this._destroyed) return !1;
|
|
935
942
|
try {
|
|
936
|
-
const
|
|
943
|
+
const o = {
|
|
937
944
|
...this.options,
|
|
938
945
|
quoteRequestData: t
|
|
939
946
|
};
|
|
940
|
-
M(
|
|
941
|
-
const { environment:
|
|
947
|
+
M(o);
|
|
948
|
+
const { environment: e, partnerId: l, customEndpoint: m } = this.options.apiConfig, f = m || R[e], g = "items" in o.quoteRequestData ? await T(
|
|
942
949
|
f,
|
|
943
|
-
|
|
944
|
-
|
|
950
|
+
l,
|
|
951
|
+
o.quoteRequestData,
|
|
945
952
|
this._validState()
|
|
946
|
-
) : await
|
|
953
|
+
) : await S(
|
|
947
954
|
f,
|
|
948
|
-
|
|
949
|
-
|
|
955
|
+
l,
|
|
956
|
+
o.quoteRequestData,
|
|
950
957
|
this._validState()
|
|
951
958
|
);
|
|
952
959
|
if (this._destroyed) return !1;
|
|
953
|
-
if (
|
|
954
|
-
return this._teardownDom(),
|
|
960
|
+
if (g.status !== "QUOTE_AVAILABLE")
|
|
961
|
+
return this._teardownDom(), g.status === "NO_MATCHING_QUOTE" && ((r = this.options.callbacks) != null && r.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
|
|
955
962
|
status: "NO_MATCHING_QUOTE",
|
|
956
|
-
data:
|
|
963
|
+
data: o.quoteRequestData
|
|
957
964
|
}), !1;
|
|
958
|
-
if (this.options.quoteRequestData =
|
|
959
|
-
const
|
|
960
|
-
|
|
965
|
+
if (this.options.quoteRequestData = o.quoteRequestData, this.quote = g.data, this._teardownDom(), this._renderWidget(), (s = this.options.callbacks) != null && s.onQuoteRetrieved) {
|
|
966
|
+
const p = this.options.callbacks.onQuoteRetrieved(this.quote);
|
|
967
|
+
p && this._applyQuoteUpdates(p);
|
|
961
968
|
}
|
|
962
969
|
return !0;
|
|
963
|
-
} catch (
|
|
970
|
+
} catch (o) {
|
|
964
971
|
if (this._destroyed) return !1;
|
|
965
|
-
const
|
|
966
|
-
return (
|
|
967
|
-
message:
|
|
968
|
-
status:
|
|
969
|
-
responseBody:
|
|
972
|
+
const e = o;
|
|
973
|
+
return (n = (a = this.options.callbacks) == null ? void 0 : a.onError) == null || n.call(a, {
|
|
974
|
+
message: e.message,
|
|
975
|
+
status: e.status,
|
|
976
|
+
responseBody: e.responseBody
|
|
970
977
|
}), !1;
|
|
971
978
|
}
|
|
972
979
|
}
|
|
973
980
|
getSelection() {
|
|
974
|
-
var r, s,
|
|
975
|
-
if (this.currentSelection == null || this.currentSelection ==
|
|
981
|
+
var r, s, a;
|
|
982
|
+
if (this.currentSelection == null || this.currentSelection == w.UNSELECTED) return null;
|
|
976
983
|
const t = {
|
|
977
984
|
selection: this.currentSelection,
|
|
978
985
|
quoteId: (r = this.quote) == null ? void 0 : r.id,
|
|
979
986
|
spotPrice: (s = this.quote) == null ? void 0 : s.spotPrice,
|
|
980
|
-
status: this.currentSelection ===
|
|
987
|
+
status: this.currentSelection === w.YES ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED",
|
|
981
988
|
state: this.currentState
|
|
982
989
|
};
|
|
983
|
-
if ((
|
|
984
|
-
const
|
|
985
|
-
t.batchQuoteDetails = this.quote.originalQuotes.map((
|
|
986
|
-
var
|
|
987
|
-
const
|
|
988
|
-
(m) => (m.cartItemId || `item-${
|
|
990
|
+
if ((a = this.quote) != null && a.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
991
|
+
const n = this.options.quoteRequestData;
|
|
992
|
+
t.batchQuoteDetails = this.quote.originalQuotes.map((o) => {
|
|
993
|
+
var l;
|
|
994
|
+
const e = (l = n.items) == null ? void 0 : l.find(
|
|
995
|
+
(m) => (m.cartItemId || `item-${n.items.indexOf(m) + 1}`) === o.cartItemId
|
|
989
996
|
);
|
|
990
997
|
return {
|
|
991
|
-
quoteId:
|
|
992
|
-
productPrice: (
|
|
993
|
-
cartItemId: (
|
|
998
|
+
quoteId: o.id,
|
|
999
|
+
productPrice: (e == null ? void 0 : e.productPrice) || o.spotPrice,
|
|
1000
|
+
cartItemId: (e == null ? void 0 : e.cartItemId) || ""
|
|
994
1001
|
};
|
|
995
1002
|
});
|
|
996
1003
|
}
|
|
@@ -1008,6 +1015,6 @@ class K {
|
|
|
1008
1015
|
}
|
|
1009
1016
|
export {
|
|
1010
1017
|
E as NON_US_RESIDENT_VALUE,
|
|
1011
|
-
|
|
1012
|
-
|
|
1018
|
+
w as SelectionEnum,
|
|
1019
|
+
X as default
|
|
1013
1020
|
};
|