@getspot/spot-widget 4.4.2 → 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 +14 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +398 -395
- package/dist/index.umd.js +4 -8
- 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,110 +490,135 @@ 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
|
|
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 H(
|
|
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
|
-
<rect width="145" height="28"/>
|
|
593
|
-
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
|
594
|
-
<path d="M0 10C0 4.47715 4.47715 0 10 0H134.161C139.684 0 144.161 4.47715 144.161 10V18C144.161 23.5228 139.684 28 134.161 28H10C4.47716 28 0 23.5228 0 18V10Z" fill="#F3FD00"/>
|
|
595
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"/>
|
|
596
|
-
<path d="M87 15.5385C87 11.3751 90.3751 8 94.5385 8H124.867C129.03 8 132.405 11.3751 132.405 15.5385C132.405 19.7018 129.03 23.0769 124.867 23.0769H94.5385C90.3751 23.0769 87 19.7018 87 15.5385Z" fill="#F3FD00"/>
|
|
597
622
|
<g clip-path="url(#clip0_295_2094)">
|
|
598
623
|
<path d="M117.826 19.7575C116.253 19.7575 115.064 18.7369 115.064 17.2054V13.1218H113.674V11.2615H115.064V9.21918H117.172V11.2615H119.164V13.1218H117.172V17.2054C117.172 17.6501 117.373 17.8972 117.825 17.8972H119.164V19.7586H117.825M113.846 15.5591C113.846 18.4577 111.603 19.9892 109.309 19.9892C107.016 19.9892 104.757 18.4577 104.757 15.5591C104.757 12.6606 107 11.1126 109.309 11.1126C111.619 11.1126 113.846 12.6441 113.846 15.5591ZM111.653 15.5591C111.653 13.9615 110.665 13.0556 109.31 13.0556C107.956 13.0556 106.951 13.9615 106.951 15.5591C106.951 17.1568 107.939 18.0461 109.31 18.0461C110.682 18.0461 111.653 17.1403 111.653 15.5591ZM104.339 15.5591C104.339 18.4577 102.364 19.9892 100.305 19.9892C99.0996 19.9892 98.1127 19.561 97.46 18.7545V22.8877H95.3516V11.2605H97.46V12.3638C98.1127 11.5407 99.1006 11.1126 100.305 11.1126C102.364 11.1126 104.339 12.6441 104.339 15.5591ZM102.147 15.5591C102.147 13.9615 101.175 13.0556 99.8038 13.0556C98.4322 13.0556 97.461 13.9615 97.461 15.5591C97.461 17.1568 98.4322 18.0461 99.8038 18.0461C101.175 18.0461 102.147 17.1403 102.147 15.5591ZM91.0833 19.9892C93.0078 19.9892 94.8155 18.5404 94.8155 16.465C94.8155 12.0184 89.5099 13.6823 89.5099 11.3101C89.5099 10.6183 90.0123 10.1075 90.8153 10.1075C91.6183 10.1075 92.1039 10.5025 92.3214 11.2605H94.681C94.2637 9.05373 92.7744 8 90.8163 8C88.9749 8 87.2176 9.28433 87.2176 11.3597C87.2176 15.7732 92.5232 14.0773 92.5232 16.5146C92.5232 17.2395 91.9872 17.8817 91.0833 17.8817C90.1794 17.8817 89.5603 17.3874 89.3596 16.5643H87C87.3847 18.7379 88.8908 19.9892 91.0843 19.9892M126.313 19.9892C129.678 19.9892 132.406 17.3057 132.406 13.9946C132.406 10.6834 129.678 8 126.312 8C122.947 8 120.219 10.6834 120.219 13.9946C120.219 17.3057 122.947 19.9892 126.312 19.9892" fill="#111820"/>
|
|
599
624
|
</g>
|
|
@@ -604,25 +629,25 @@ function W(d, t, r = "bottom-right") {
|
|
|
604
629
|
</defs>
|
|
605
630
|
</svg>`;
|
|
606
631
|
}
|
|
607
|
-
const s =
|
|
632
|
+
const s = i("div", {
|
|
608
633
|
className: "spot-footer__container",
|
|
609
|
-
parent:
|
|
610
|
-
}),
|
|
634
|
+
parent: c
|
|
635
|
+
}), a = i("div", {
|
|
611
636
|
className: "spot-footer__terms",
|
|
612
637
|
parent: s
|
|
613
|
-
}),
|
|
638
|
+
}), n = `<a href="${t.communication.termsAndConditionsUrl}" target="_blank" class="spot-footer__terms-link">Terms & Conditions</a>`, o = t.communication.legalDisclaimer.replace(
|
|
614
639
|
/terms (and|&) conditions/gi,
|
|
615
|
-
|
|
640
|
+
n
|
|
616
641
|
);
|
|
617
|
-
if (
|
|
618
|
-
innerHTML:
|
|
619
|
-
parent:
|
|
642
|
+
if (i("span", {
|
|
643
|
+
innerHTML: o,
|
|
644
|
+
parent: a
|
|
620
645
|
}), r === "bottom-right") {
|
|
621
|
-
const
|
|
646
|
+
const e = i("p", {
|
|
622
647
|
className: "spot-footer__powered-by",
|
|
623
648
|
parent: s
|
|
624
649
|
});
|
|
625
|
-
|
|
650
|
+
e.innerHTML = `
|
|
626
651
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
627
652
|
<rect width="145" height="28"/>
|
|
628
653
|
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
|
@@ -641,75 +666,75 @@ function W(d, t, r = "bottom-right") {
|
|
|
641
666
|
}
|
|
642
667
|
return s;
|
|
643
668
|
}
|
|
644
|
-
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-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:40px;z-index:10;background:linear-gradient(to bottom,transparent 50%,inherit 50%);padding:0 .25rem}.spot-logo__top-right svg{border-radius:1.25rem;border:var(--spot-border-line-width) solid var(--spot-border-color);display:block;background:var(--spot-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)}}";
|
|
645
|
-
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) {
|
|
646
671
|
const t = document.createElement("style");
|
|
647
|
-
t.textContent =
|
|
672
|
+
t.textContent = c, document.head.appendChild(t);
|
|
648
673
|
}
|
|
649
|
-
G
|
|
674
|
+
K(G);
|
|
650
675
|
const R = {
|
|
651
676
|
sandbox: "https://api.sandbox.getspot.com/api/v1/quote",
|
|
652
677
|
production: "https://api.getspot.com/api/v1/quote",
|
|
653
678
|
local: "http://localhost:3999/api/v1/quote"
|
|
654
679
|
};
|
|
655
|
-
class
|
|
680
|
+
class X {
|
|
656
681
|
constructor(t = {}) {
|
|
657
682
|
this._destroyed = !1, this.options = {
|
|
658
683
|
location: "body",
|
|
659
684
|
showTable: !0,
|
|
660
|
-
logoPosition: "
|
|
685
|
+
logoPosition: "top-right",
|
|
661
686
|
apiConfig: { environment: "production", partnerId: "" },
|
|
662
687
|
quoteRequestData: {},
|
|
663
688
|
callbacks: {},
|
|
664
689
|
useMockData: !1,
|
|
665
690
|
...t,
|
|
666
|
-
selection: t.selection ??
|
|
691
|
+
selection: t.selection ?? w.UNSELECTED
|
|
667
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();
|
|
668
693
|
}
|
|
669
694
|
async _init() {
|
|
670
|
-
var t, r, s,
|
|
695
|
+
var t, r, s, a, n;
|
|
671
696
|
try {
|
|
672
697
|
M(this.options), this.currentState = this.options.state;
|
|
673
|
-
let
|
|
698
|
+
let o;
|
|
674
699
|
if (this.options.useMockData && this.options.mockData)
|
|
675
|
-
|
|
700
|
+
o = this.options.mockData;
|
|
676
701
|
else {
|
|
677
|
-
const { environment:
|
|
678
|
-
|
|
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(
|
|
679
704
|
f,
|
|
680
|
-
|
|
705
|
+
l,
|
|
681
706
|
this.options.quoteRequestData,
|
|
682
707
|
this._validState()
|
|
683
|
-
) : await
|
|
708
|
+
) : await S(
|
|
684
709
|
f,
|
|
685
|
-
|
|
710
|
+
l,
|
|
686
711
|
this.options.quoteRequestData,
|
|
687
712
|
this._validState()
|
|
688
713
|
);
|
|
689
714
|
}
|
|
690
715
|
if (this._destroyed) return;
|
|
691
|
-
if (
|
|
692
|
-
|
|
716
|
+
if (o.status !== "QUOTE_AVAILABLE") {
|
|
717
|
+
o.status === "NO_MATCHING_QUOTE" && ((t = this.options.callbacks) != null && t.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
|
|
693
718
|
status: "NO_MATCHING_QUOTE",
|
|
694
719
|
data: this.options.quoteRequestData
|
|
695
720
|
});
|
|
696
721
|
return;
|
|
697
722
|
}
|
|
698
|
-
if (this.quote =
|
|
723
|
+
if (this.quote = o.data, !this.quote)
|
|
699
724
|
throw new Error("No quote data in response");
|
|
700
|
-
if (this._renderWidget(), this.options.selection ===
|
|
701
|
-
const
|
|
725
|
+
if (this._renderWidget(), this.options.selection === w.YES && ((r = this.options.callbacks) != null && r.onOptIn)) {
|
|
726
|
+
const e = {
|
|
702
727
|
status: "QUOTE_ACCEPTED",
|
|
703
728
|
spotPrice: this.quote.spotPrice,
|
|
704
729
|
quoteId: this.quote.id,
|
|
705
730
|
state: this._validState()
|
|
706
731
|
};
|
|
707
732
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
708
|
-
const
|
|
709
|
-
|
|
710
|
-
var
|
|
711
|
-
const f = (
|
|
712
|
-
(
|
|
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
|
|
713
738
|
);
|
|
714
739
|
return {
|
|
715
740
|
quoteId: m.id,
|
|
@@ -718,80 +743,58 @@ class K {
|
|
|
718
743
|
};
|
|
719
744
|
});
|
|
720
745
|
}
|
|
721
|
-
this.options.callbacks.onOptIn(
|
|
746
|
+
this.options.callbacks.onOptIn(e);
|
|
722
747
|
}
|
|
723
748
|
if ((s = this.options.callbacks) != null && s.onQuoteRetrieved) {
|
|
724
|
-
const
|
|
725
|
-
|
|
749
|
+
const e = this.options.callbacks.onQuoteRetrieved(this.quote);
|
|
750
|
+
e && this._applyQuoteUpdates(e);
|
|
726
751
|
}
|
|
727
|
-
} catch (
|
|
752
|
+
} catch (o) {
|
|
728
753
|
if (this._destroyed) return;
|
|
729
|
-
if ((
|
|
730
|
-
const
|
|
731
|
-
(
|
|
732
|
-
message:
|
|
733
|
-
status:
|
|
734
|
-
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
|
|
735
760
|
});
|
|
736
761
|
}
|
|
737
762
|
}
|
|
738
763
|
}
|
|
739
764
|
_renderWidget() {
|
|
740
765
|
if (!this.quote) return;
|
|
741
|
-
this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([
|
|
742
|
-
const
|
|
743
|
-
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);
|
|
744
769
|
}), $(this.container, this.quote.communication);
|
|
745
770
|
const t = document.createElement("div");
|
|
746
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) {
|
|
747
|
-
const
|
|
748
|
-
U(t, this.quote.coveredItems,
|
|
772
|
+
const o = this._getTotalItemsInRequest();
|
|
773
|
+
U(t, this.quote.coveredItems, o);
|
|
749
774
|
}
|
|
750
|
-
this.options.showTable && !this.quote.qualifyingReasons &&
|
|
751
|
-
const r =
|
|
775
|
+
this.options.showTable && !this.quote.qualifyingReasons && j(t, this.quote.payoutSchedule, this.quote.currencyCode);
|
|
776
|
+
const r = i("div", {
|
|
752
777
|
className: "spot-selection__wrapper",
|
|
753
778
|
parent: t
|
|
754
779
|
});
|
|
755
|
-
this._isPassOrTrip() && !this.options.state && (this._stateSelectEl =
|
|
756
|
-
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(
|
|
757
782
|
r,
|
|
758
783
|
this.currentSelection,
|
|
759
784
|
this.quote.communication,
|
|
760
|
-
|
|
785
|
+
a
|
|
761
786
|
);
|
|
762
|
-
this.paymentTermsEl =
|
|
787
|
+
this.paymentTermsEl = i("div", {
|
|
763
788
|
className: "spot-payment-terms__wrapper",
|
|
764
789
|
parent: t
|
|
765
|
-
}), 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();
|
|
766
791
|
}
|
|
767
792
|
_updateLayout() {
|
|
768
793
|
if (!this.container || !this.quote) return;
|
|
769
794
|
const t = this.container.querySelector(
|
|
770
795
|
".spot-content__wrapper"
|
|
771
|
-
)
|
|
772
|
-
|
|
773
|
-
t == null || t.classList.remove("desktop-layout");
|
|
774
|
-
return;
|
|
775
|
-
}
|
|
776
|
-
const s = this._shouldUseDesktopLayout(t);
|
|
777
|
-
t.classList.toggle("desktop-layout", s);
|
|
778
|
-
}
|
|
779
|
-
_shouldUseDesktopLayout(t) {
|
|
780
|
-
const r = this.container.offsetWidth - 40, s = 325, i = 16;
|
|
781
|
-
if (r >= 900)
|
|
782
|
-
return !0;
|
|
783
|
-
if (r >= 650) {
|
|
784
|
-
const a = t.classList.contains("desktop-layout");
|
|
785
|
-
t.classList.remove("desktop-layout"), t.offsetHeight;
|
|
786
|
-
const e = t.querySelector(
|
|
787
|
-
".spot-benefits__list, .spot-qualifying-reasons__container"
|
|
788
|
-
);
|
|
789
|
-
if (!e)
|
|
790
|
-
return a && t.classList.add("desktop-layout"), a;
|
|
791
|
-
const p = Math.min(e.scrollWidth, 400) + s + i;
|
|
792
|
-
return a && t.classList.add("desktop-layout"), r >= p;
|
|
793
|
-
}
|
|
794
|
-
return !1;
|
|
796
|
+
);
|
|
797
|
+
t == null || t.classList.remove("desktop-layout");
|
|
795
798
|
}
|
|
796
799
|
_setupResizeObserver() {
|
|
797
800
|
!this.container || !window.ResizeObserver || (this._resizeObserver = new ResizeObserver(() => {
|
|
@@ -828,15 +831,15 @@ class K {
|
|
|
828
831
|
return !this._isPassOrTrip() || this.options.state ? !0 : !!this.currentState && this.currentState !== E;
|
|
829
832
|
}
|
|
830
833
|
_setRadiosDisabled(t) {
|
|
831
|
-
var
|
|
832
|
-
const r = (
|
|
833
|
-
r == null || r.forEach((
|
|
834
|
-
|
|
835
|
-
}), s == null || s.classList.toggle("spot-selection__options--disabled", t), t && (r == null || r.forEach((
|
|
836
|
-
|
|
837
|
-
}), (
|
|
838
|
-
|
|
839
|
-
}), 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 = ""));
|
|
840
843
|
}
|
|
841
844
|
_setNonUsResidentError(t) {
|
|
842
845
|
var s;
|
|
@@ -856,58 +859,58 @@ class K {
|
|
|
856
859
|
const r = t.querySelectorAll(
|
|
857
860
|
'input[type="radio"]'
|
|
858
861
|
), s = t.querySelectorAll(".spot-selection__option");
|
|
859
|
-
r.forEach((
|
|
860
|
-
|
|
861
|
-
var
|
|
862
|
-
const
|
|
863
|
-
if (this.hideSelectionError(), this.currentSelection =
|
|
864
|
-
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 = {
|
|
865
868
|
status: "QUOTE_ACCEPTED",
|
|
866
869
|
spotPrice: this.quote.spotPrice,
|
|
867
870
|
quoteId: this.quote.id,
|
|
868
871
|
state: this._validState()
|
|
869
872
|
};
|
|
870
873
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
871
|
-
const
|
|
872
|
-
|
|
874
|
+
const p = this.options.quoteRequestData;
|
|
875
|
+
g.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
873
876
|
(u) => {
|
|
874
877
|
var b;
|
|
875
|
-
const
|
|
876
|
-
(
|
|
878
|
+
const d = (b = p.items) == null ? void 0 : b.find(
|
|
879
|
+
(_) => (_.cartItemId || `item-${p.items.indexOf(_) + 1}`) === u.cartItemId
|
|
877
880
|
);
|
|
878
881
|
return {
|
|
879
882
|
quoteId: u.id,
|
|
880
|
-
productPrice: (
|
|
881
|
-
cartItemId: (
|
|
883
|
+
productPrice: (d == null ? void 0 : d.productPrice) || u.spotPrice,
|
|
884
|
+
cartItemId: (d == null ? void 0 : d.cartItemId) || ""
|
|
882
885
|
};
|
|
883
886
|
}
|
|
884
887
|
);
|
|
885
888
|
}
|
|
886
|
-
this.options.callbacks.onOptIn(
|
|
889
|
+
this.options.callbacks.onOptIn(g);
|
|
887
890
|
}
|
|
888
|
-
if (
|
|
889
|
-
const
|
|
891
|
+
if (e === w.NO && ((h = this.options.callbacks) != null && h.onOptOut)) {
|
|
892
|
+
const g = {
|
|
890
893
|
status: "QUOTE_DECLINED",
|
|
891
894
|
quoteId: this.quote.id,
|
|
892
895
|
state: this._validState()
|
|
893
896
|
};
|
|
894
897
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
895
|
-
const
|
|
896
|
-
|
|
898
|
+
const p = this.options.quoteRequestData;
|
|
899
|
+
g.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
897
900
|
(u) => {
|
|
898
901
|
var b;
|
|
899
|
-
const
|
|
900
|
-
(
|
|
902
|
+
const d = (b = p.items) == null ? void 0 : b.find(
|
|
903
|
+
(_) => (_.cartItemId || `item-${p.items.indexOf(_) + 1}`) === u.cartItemId
|
|
901
904
|
);
|
|
902
905
|
return {
|
|
903
906
|
quoteId: u.id,
|
|
904
|
-
productPrice: (
|
|
905
|
-
cartItemId: (
|
|
907
|
+
productPrice: (d == null ? void 0 : d.productPrice) || u.spotPrice,
|
|
908
|
+
cartItemId: (d == null ? void 0 : d.cartItemId) || ""
|
|
906
909
|
};
|
|
907
910
|
}
|
|
908
911
|
);
|
|
909
912
|
}
|
|
910
|
-
this.options.callbacks.onOptOut(
|
|
913
|
+
this.options.callbacks.onOptOut(g);
|
|
911
914
|
}
|
|
912
915
|
});
|
|
913
916
|
});
|
|
@@ -934,67 +937,67 @@ class K {
|
|
|
934
937
|
return t ? this.hideSelectionError() : this.showSelectionError(), t;
|
|
935
938
|
}
|
|
936
939
|
async updateQuote(t) {
|
|
937
|
-
var r, s,
|
|
940
|
+
var r, s, a, n;
|
|
938
941
|
if (this._destroyed) return !1;
|
|
939
942
|
try {
|
|
940
|
-
const
|
|
943
|
+
const o = {
|
|
941
944
|
...this.options,
|
|
942
945
|
quoteRequestData: t
|
|
943
946
|
};
|
|
944
|
-
M(
|
|
945
|
-
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(
|
|
946
949
|
f,
|
|
947
|
-
|
|
948
|
-
|
|
950
|
+
l,
|
|
951
|
+
o.quoteRequestData,
|
|
949
952
|
this._validState()
|
|
950
|
-
) : await
|
|
953
|
+
) : await S(
|
|
951
954
|
f,
|
|
952
|
-
|
|
953
|
-
|
|
955
|
+
l,
|
|
956
|
+
o.quoteRequestData,
|
|
954
957
|
this._validState()
|
|
955
958
|
);
|
|
956
959
|
if (this._destroyed) return !1;
|
|
957
|
-
if (
|
|
958
|
-
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({
|
|
959
962
|
status: "NO_MATCHING_QUOTE",
|
|
960
|
-
data:
|
|
963
|
+
data: o.quoteRequestData
|
|
961
964
|
}), !1;
|
|
962
|
-
if (this.options.quoteRequestData =
|
|
963
|
-
const
|
|
964
|
-
|
|
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);
|
|
965
968
|
}
|
|
966
969
|
return !0;
|
|
967
|
-
} catch (
|
|
970
|
+
} catch (o) {
|
|
968
971
|
if (this._destroyed) return !1;
|
|
969
|
-
const
|
|
970
|
-
return (
|
|
971
|
-
message:
|
|
972
|
-
status:
|
|
973
|
-
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
|
|
974
977
|
}), !1;
|
|
975
978
|
}
|
|
976
979
|
}
|
|
977
980
|
getSelection() {
|
|
978
|
-
var r, s,
|
|
979
|
-
if (this.currentSelection == null || this.currentSelection ==
|
|
981
|
+
var r, s, a;
|
|
982
|
+
if (this.currentSelection == null || this.currentSelection == w.UNSELECTED) return null;
|
|
980
983
|
const t = {
|
|
981
984
|
selection: this.currentSelection,
|
|
982
985
|
quoteId: (r = this.quote) == null ? void 0 : r.id,
|
|
983
986
|
spotPrice: (s = this.quote) == null ? void 0 : s.spotPrice,
|
|
984
|
-
status: this.currentSelection ===
|
|
987
|
+
status: this.currentSelection === w.YES ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED",
|
|
985
988
|
state: this.currentState
|
|
986
989
|
};
|
|
987
|
-
if ((
|
|
988
|
-
const
|
|
989
|
-
t.batchQuoteDetails = this.quote.originalQuotes.map((
|
|
990
|
-
var
|
|
991
|
-
const
|
|
992
|
-
(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
|
|
993
996
|
);
|
|
994
997
|
return {
|
|
995
|
-
quoteId:
|
|
996
|
-
productPrice: (
|
|
997
|
-
cartItemId: (
|
|
998
|
+
quoteId: o.id,
|
|
999
|
+
productPrice: (e == null ? void 0 : e.productPrice) || o.spotPrice,
|
|
1000
|
+
cartItemId: (e == null ? void 0 : e.cartItemId) || ""
|
|
998
1001
|
};
|
|
999
1002
|
});
|
|
1000
1003
|
}
|
|
@@ -1012,6 +1015,6 @@ class K {
|
|
|
1012
1015
|
}
|
|
1013
1016
|
export {
|
|
1014
1017
|
E as NON_US_RESIDENT_VALUE,
|
|
1015
|
-
|
|
1016
|
-
|
|
1018
|
+
w as SelectionEnum,
|
|
1019
|
+
X as default
|
|
1017
1020
|
};
|