@getspot/spot-widget 4.1.1 → 4.3.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/README.md +59 -4
- package/dist/api.d.ts +4 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +539 -364
- package/dist/index.umd.js +4 -4
- package/dist/types.d.ts +10 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/ui.d.ts +4 -1
- package/dist/ui.d.ts.map +1 -1
- package/dist/validateOptions.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,110 +1,192 @@
|
|
|
1
|
-
async function
|
|
1
|
+
async function N(c, t, r, s) {
|
|
2
2
|
try {
|
|
3
|
-
const s = await fetch(
|
|
3
|
+
const i = s ? { ...r, state: s } : r, a = 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(i)
|
|
10
|
+
}), e = await a.json();
|
|
11
|
+
if (!a.ok) {
|
|
12
|
+
const o = new Error((e == null ? void 0 : e.message) || "Failed to fetch quote");
|
|
13
|
+
throw o.status = a.status, o.responseBody = e, o;
|
|
14
14
|
}
|
|
15
|
-
return
|
|
16
|
-
} catch (
|
|
17
|
-
throw
|
|
15
|
+
return e;
|
|
16
|
+
} catch (i) {
|
|
17
|
+
throw i instanceof Error ? i : new Error("Unknown error occurred while fetching quote");
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
20
|
+
async function z(c, t, r) {
|
|
21
21
|
try {
|
|
22
|
-
const s =
|
|
22
|
+
const s = c.replace("/quote", "/quote/batch"), i = 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
|
-
body: JSON.stringify(
|
|
29
|
-
}),
|
|
28
|
+
body: JSON.stringify(r)
|
|
29
|
+
}), a = await i.json();
|
|
30
30
|
if (!i.ok) {
|
|
31
|
-
const
|
|
32
|
-
throw
|
|
31
|
+
const e = new Error((a == null ? void 0 : a.message) || "Failed to fetch batch quote");
|
|
32
|
+
throw e.status = i.status, e.responseBody = a, e;
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return a;
|
|
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 S(c, t, r, s) {
|
|
40
|
+
var i;
|
|
41
41
|
try {
|
|
42
|
-
const
|
|
43
|
-
...
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
const a = {
|
|
43
|
+
...r,
|
|
44
|
+
...s ? { state: s } : {},
|
|
45
|
+
isPartialPayment: r.isPartialPayment || !1,
|
|
46
|
+
roundTo: r.roundTo || void 0,
|
|
47
|
+
items: r.items.map((m, f) => ({
|
|
48
|
+
...m,
|
|
49
|
+
cartItemId: m.cartItemId || `item-${f + 1}`
|
|
49
50
|
}))
|
|
50
|
-
},
|
|
51
|
-
if (
|
|
51
|
+
}, e = await z(c, t, a);
|
|
52
|
+
if (e.status !== "QUOTES_AVAILABLE" && e.status !== "QUOTE_AVAILABLE")
|
|
52
53
|
return { status: "NO_MATCHING_QUOTE" };
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
(
|
|
54
|
+
const o = e.quotes.map((m) => {
|
|
55
|
+
const f = r.items.find(
|
|
56
|
+
(v, h) => (v.cartItemId || `item-${h + 1}`) === m.cartItemId
|
|
56
57
|
);
|
|
57
|
-
return
|
|
58
|
-
}),
|
|
58
|
+
return f ? f.participantDescription ? `${f.productName} - ${f.participantDescription}` : f.productName : `Item ${m.id}`;
|
|
59
|
+
}), l = Math.round((e.totalSpotPrice || e.spotPrice || 0) * 100) / 100;
|
|
59
60
|
return {
|
|
60
61
|
status: "QUOTE_AVAILABLE",
|
|
61
62
|
data: {
|
|
62
|
-
id:
|
|
63
|
-
spotPrice:
|
|
64
|
-
currencyCode:
|
|
63
|
+
id: e.quotes ? e.quotes.map((m) => m.id).join(",") : ((i = e.data) == null ? void 0 : i.id) || "",
|
|
64
|
+
spotPrice: l,
|
|
65
|
+
currencyCode: e.currencyCode || "",
|
|
65
66
|
communication: {
|
|
66
|
-
...
|
|
67
|
-
yesOptionText:
|
|
68
|
-
String(
|
|
69
|
-
String(
|
|
67
|
+
...e.communication,
|
|
68
|
+
yesOptionText: e.communication.yesOptionText.replace(
|
|
69
|
+
String(e.totalSpotPrice),
|
|
70
|
+
String(l)
|
|
70
71
|
)
|
|
71
72
|
},
|
|
72
|
-
payoutSchedule:
|
|
73
|
-
...
|
|
74
|
-
amount:
|
|
73
|
+
payoutSchedule: e.payoutSchedule.map((m) => ({
|
|
74
|
+
...m,
|
|
75
|
+
amount: m.amount !== void 0 ? m.amount : 0
|
|
75
76
|
})),
|
|
76
|
-
coveredItems:
|
|
77
|
-
originalQuotes:
|
|
77
|
+
coveredItems: o,
|
|
78
|
+
originalQuotes: e.quotes || (e.data ? [e.data] : [])
|
|
78
79
|
},
|
|
79
|
-
spotPrice:
|
|
80
|
-
coveredItems:
|
|
80
|
+
spotPrice: l,
|
|
81
|
+
coveredItems: o
|
|
81
82
|
};
|
|
82
|
-
} catch (
|
|
83
|
-
throw
|
|
83
|
+
} catch (a) {
|
|
84
|
+
throw a instanceof Error ? a : new Error("Unknown error occurred while fetching multiple quotes");
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
const
|
|
87
|
+
const q = "non-us-resident", A = [
|
|
88
|
+
{ value: "AL", label: "Alabama" },
|
|
89
|
+
{ value: "AK", label: "Alaska" },
|
|
90
|
+
{ value: "AS", label: "American Samoa" },
|
|
91
|
+
{ value: "AZ", label: "Arizona" },
|
|
92
|
+
{ value: "AR", label: "Arkansas" },
|
|
93
|
+
{ value: "CA", label: "California" },
|
|
94
|
+
{ value: "CO", label: "Colorado" },
|
|
95
|
+
{ value: "CT", label: "Connecticut" },
|
|
96
|
+
{ value: "DE", label: "Delaware" },
|
|
97
|
+
{ value: "DC", label: "District of Columbia" },
|
|
98
|
+
{ value: "FL", label: "Florida" },
|
|
99
|
+
{ value: "GA", label: "Georgia" },
|
|
100
|
+
{ value: "GU", label: "Guam" },
|
|
101
|
+
{ value: "HI", label: "Hawaii" },
|
|
102
|
+
{ value: "ID", label: "Idaho" },
|
|
103
|
+
{ value: "IL", label: "Illinois" },
|
|
104
|
+
{ value: "IN", label: "Indiana" },
|
|
105
|
+
{ value: "IA", label: "Iowa" },
|
|
106
|
+
{ value: "KS", label: "Kansas" },
|
|
107
|
+
{ value: "KY", label: "Kentucky" },
|
|
108
|
+
{ value: "LA", label: "Louisiana" },
|
|
109
|
+
{ value: "ME", label: "Maine" },
|
|
110
|
+
{ value: "MD", label: "Maryland" },
|
|
111
|
+
{ value: "MA", label: "Massachusetts" },
|
|
112
|
+
{ value: "MI", label: "Michigan" },
|
|
113
|
+
{ value: "MN", label: "Minnesota" },
|
|
114
|
+
{ value: "MS", label: "Mississippi" },
|
|
115
|
+
{ value: "MO", label: "Missouri" },
|
|
116
|
+
{ value: "MT", label: "Montana" },
|
|
117
|
+
{ value: "NE", label: "Nebraska" },
|
|
118
|
+
{ value: "NV", label: "Nevada" },
|
|
119
|
+
{ value: "NH", label: "New Hampshire" },
|
|
120
|
+
{ value: "NJ", label: "New Jersey" },
|
|
121
|
+
{ value: "NM", label: "New Mexico" },
|
|
122
|
+
{ value: "NY", label: "New York" },
|
|
123
|
+
{ value: "NC", label: "North Carolina" },
|
|
124
|
+
{ value: "ND", label: "North Dakota" },
|
|
125
|
+
{ value: "MP", label: "Northern Mariana Islands" },
|
|
126
|
+
{ value: "OH", label: "Ohio" },
|
|
127
|
+
{ value: "OK", label: "Oklahoma" },
|
|
128
|
+
{ value: "OR", label: "Oregon" },
|
|
129
|
+
{ value: "PA", label: "Pennsylvania" },
|
|
130
|
+
{ value: "PR", label: "Puerto Rico" },
|
|
131
|
+
{ value: "RI", label: "Rhode Island" },
|
|
132
|
+
{ value: "SC", label: "South Carolina" },
|
|
133
|
+
{ value: "SD", label: "South Dakota" },
|
|
134
|
+
{ value: "TN", label: "Tennessee" },
|
|
135
|
+
{ value: "TX", label: "Texas" },
|
|
136
|
+
{ value: "VI", label: "U.S. Virgin Islands" },
|
|
137
|
+
{ value: "UT", label: "Utah" },
|
|
138
|
+
{ value: "VT", label: "Vermont" },
|
|
139
|
+
{ value: "VA", label: "Virginia" },
|
|
140
|
+
{ value: "WA", label: "Washington" },
|
|
141
|
+
{ value: "WV", label: "West Virginia" },
|
|
142
|
+
{ value: "WI", label: "Wisconsin" },
|
|
143
|
+
{ value: "WY", label: "Wyoming" }
|
|
144
|
+
], O = new Set(A.map((c) => c.value)), I = [
|
|
145
|
+
"USD",
|
|
146
|
+
"CAD",
|
|
147
|
+
"AUD",
|
|
148
|
+
"NZD",
|
|
149
|
+
"EUR",
|
|
150
|
+
"MXN",
|
|
151
|
+
"AED",
|
|
152
|
+
"GBP",
|
|
153
|
+
"MAD",
|
|
154
|
+
"SAR",
|
|
155
|
+
"BGN",
|
|
156
|
+
"BRL",
|
|
157
|
+
"CHF",
|
|
158
|
+
"DKK",
|
|
159
|
+
"INR",
|
|
160
|
+
"JPY",
|
|
161
|
+
"MYR",
|
|
162
|
+
"NOK",
|
|
163
|
+
"PLN",
|
|
164
|
+
"SEK",
|
|
165
|
+
"SGD",
|
|
166
|
+
"THB",
|
|
167
|
+
"ZAR"
|
|
168
|
+
], R = {
|
|
87
169
|
sandbox: "https://api.sandbox.getspot.com/v1/quote",
|
|
88
170
|
production: "https://api.getspot.com/v1/quote",
|
|
89
171
|
local: "http://localhost:3999/api/v1/quote"
|
|
90
172
|
};
|
|
91
|
-
function
|
|
173
|
+
function M(c) {
|
|
92
174
|
const {
|
|
93
175
|
apiConfig: t = {},
|
|
94
|
-
quoteRequestData:
|
|
176
|
+
quoteRequestData: r,
|
|
95
177
|
callbacks: s = {},
|
|
96
178
|
location: i,
|
|
97
|
-
theme:
|
|
98
|
-
} =
|
|
99
|
-
environment:
|
|
100
|
-
partnerId:
|
|
101
|
-
customEndpoint:
|
|
179
|
+
theme: a
|
|
180
|
+
} = c, {
|
|
181
|
+
environment: e = "sandbox",
|
|
182
|
+
partnerId: o,
|
|
183
|
+
customEndpoint: l
|
|
102
184
|
} = t;
|
|
103
|
-
if (!
|
|
185
|
+
if (!o || typeof o != "string")
|
|
104
186
|
throw new Error("Invalid or missing partnerId in apiConfig");
|
|
105
|
-
if (!(
|
|
106
|
-
throw new Error(`Invalid environment in apiConfig: ${
|
|
107
|
-
if (!
|
|
187
|
+
if (!(l || R[e]))
|
|
188
|
+
throw new Error(`Invalid environment in apiConfig: ${e}`);
|
|
189
|
+
if (!r || typeof r != "object" && !Array.isArray(r))
|
|
108
190
|
throw new Error("quoteRequestData must be a non-null object or array");
|
|
109
191
|
const f = [
|
|
110
192
|
"startDate",
|
|
@@ -118,57 +200,57 @@ function N(m) {
|
|
|
118
200
|
"cartId",
|
|
119
201
|
"productName"
|
|
120
202
|
];
|
|
121
|
-
function
|
|
122
|
-
const d =
|
|
123
|
-
f.forEach((
|
|
124
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
125
|
-
throw new Error(`Missing required ${d} field: '${
|
|
203
|
+
function v(p, u = null) {
|
|
204
|
+
const d = u !== null ? `quoteRequestData[${u}]` : "quoteRequestData";
|
|
205
|
+
f.forEach((g) => {
|
|
206
|
+
if (!Object.prototype.hasOwnProperty.call(p, g) || p[g] === void 0 || p[g] === null)
|
|
207
|
+
throw new Error(`Missing required ${d} field: '${g}'`);
|
|
126
208
|
});
|
|
127
|
-
const
|
|
128
|
-
if (!
|
|
209
|
+
const w = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
210
|
+
if (!w.test(p.startDate))
|
|
129
211
|
throw new Error(`${d}.startDate must be a valid ISO8601 string`);
|
|
130
|
-
if (!
|
|
212
|
+
if (!w.test(p.endDate))
|
|
131
213
|
throw new Error(`${d}.endDate must be a valid ISO8601 string`);
|
|
132
|
-
if (typeof
|
|
214
|
+
if (typeof p.currencyCode != "string")
|
|
133
215
|
throw new Error(`${d}.currencyCode must be a string`);
|
|
134
|
-
if (!
|
|
135
|
-
throw new Error(`Invalid ${d}.currencyCode: ${
|
|
136
|
-
if (typeof
|
|
216
|
+
if (!I.includes(p.currencyCode))
|
|
217
|
+
throw new Error(`Invalid ${d}.currencyCode: ${p.currencyCode}`);
|
|
218
|
+
if (typeof p.eventType != "string")
|
|
137
219
|
throw new Error(`${d}.eventType must be a string`);
|
|
138
|
-
if (typeof
|
|
220
|
+
if (typeof p.productType != "string")
|
|
139
221
|
throw new Error(`${d}.productType must be a string`);
|
|
140
|
-
const
|
|
141
|
-
if (!
|
|
222
|
+
const y = ["Pass", "Trip", "Registration"];
|
|
223
|
+
if (!y.includes(p.productType))
|
|
142
224
|
throw new Error(
|
|
143
|
-
`${d}.productType must be one of ${
|
|
225
|
+
`${d}.productType must be one of ${y.join(", ")}`
|
|
144
226
|
);
|
|
145
|
-
if (typeof
|
|
227
|
+
if (typeof p.productDuration != "string")
|
|
146
228
|
throw new Error(`${d}.productDuration must be a string`);
|
|
147
229
|
const C = ["Daily", "Seasonal", "Trip", "Event"];
|
|
148
|
-
if (!C.includes(
|
|
230
|
+
if (!C.includes(p.productDuration))
|
|
149
231
|
throw new Error(
|
|
150
232
|
`${d}.productDuration must be one of ${C.join(", ")}`
|
|
151
233
|
);
|
|
152
|
-
if (typeof
|
|
234
|
+
if (typeof p.productPrice != "number" || isNaN(p.productPrice))
|
|
153
235
|
throw new Error(`${d}.productPrice must be a valid number`);
|
|
154
|
-
if (typeof
|
|
236
|
+
if (typeof p.productId != "string")
|
|
155
237
|
throw new Error(`${d}.productId must be a string`);
|
|
156
|
-
if (typeof
|
|
238
|
+
if (typeof p.cartId != "string")
|
|
157
239
|
throw new Error(`${d}.cartId must be a string`);
|
|
158
|
-
if (typeof
|
|
240
|
+
if (typeof p.productName != "string")
|
|
159
241
|
throw new Error(`${d}.productName must be a string`);
|
|
160
242
|
}
|
|
161
|
-
if ("items" in
|
|
162
|
-
const
|
|
163
|
-
if (!
|
|
243
|
+
if ("items" in r) {
|
|
244
|
+
const p = r, { cartId: u, cartName: d, currencyCode: w, items: y } = p;
|
|
245
|
+
if (!u || typeof u != "string")
|
|
164
246
|
throw new Error("quoteRequestData.cartId must be a string");
|
|
165
247
|
if (!d || typeof d != "string")
|
|
166
248
|
throw new Error("quoteRequestData.cartName must be a string");
|
|
167
|
-
if (!
|
|
249
|
+
if (!w || typeof w != "string")
|
|
168
250
|
throw new Error("quoteRequestData.currencyCode must be a string");
|
|
169
|
-
if (!
|
|
170
|
-
throw new Error(`Invalid quoteRequestData.currencyCode: ${
|
|
171
|
-
if (!Array.isArray(
|
|
251
|
+
if (!I.includes(w))
|
|
252
|
+
throw new Error(`Invalid quoteRequestData.currencyCode: ${w}`);
|
|
253
|
+
if (!Array.isArray(y) || y.length === 0)
|
|
172
254
|
throw new Error("quoteRequestData.items must be a non-empty array");
|
|
173
255
|
const C = [
|
|
174
256
|
"startDate",
|
|
@@ -180,104 +262,106 @@ function N(m) {
|
|
|
180
262
|
"productId",
|
|
181
263
|
"productName"
|
|
182
264
|
];
|
|
183
|
-
|
|
184
|
-
if (!
|
|
265
|
+
y.forEach((g, k) => {
|
|
266
|
+
if (!g || typeof g != "object")
|
|
185
267
|
throw new Error(`quoteRequestData.items[${k}] must be a non-null object`);
|
|
186
268
|
const _ = `quoteRequestData.items[${k}]`;
|
|
187
269
|
C.forEach((E) => {
|
|
188
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
270
|
+
if (!Object.prototype.hasOwnProperty.call(g, E) || g[E] === void 0 || g[E] === null)
|
|
189
271
|
throw new Error(`Missing required ${_} field: '${E}'`);
|
|
190
272
|
});
|
|
191
273
|
const x = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
192
|
-
if (!x.test(
|
|
274
|
+
if (!x.test(g.startDate))
|
|
193
275
|
throw new Error(`${_}.startDate must be a valid ISO8601 string`);
|
|
194
|
-
if (!x.test(
|
|
276
|
+
if (!x.test(g.endDate))
|
|
195
277
|
throw new Error(`${_}.endDate must be a valid ISO8601 string`);
|
|
196
|
-
if (typeof
|
|
278
|
+
if (typeof g.eventType != "string")
|
|
197
279
|
throw new Error(`${_}.eventType must be a string`);
|
|
198
|
-
if (typeof
|
|
280
|
+
if (typeof g.productType != "string")
|
|
199
281
|
throw new Error(`${_}.productType must be a string`);
|
|
200
282
|
const D = ["Pass", "Trip", "Registration"];
|
|
201
|
-
if (!D.includes(
|
|
283
|
+
if (!D.includes(g.productType))
|
|
202
284
|
throw new Error(`${_}.productType must be one of ${D.join(", ")}`);
|
|
203
|
-
if (typeof
|
|
285
|
+
if (typeof g.productDuration != "string")
|
|
204
286
|
throw new Error(`${_}.productDuration must be a string`);
|
|
205
287
|
const T = ["Daily", "Seasonal", "Trip", "Event"];
|
|
206
|
-
if (!T.includes(
|
|
288
|
+
if (!T.includes(g.productDuration))
|
|
207
289
|
throw new Error(`${_}.productDuration must be one of ${T.join(", ")}`);
|
|
208
|
-
if (typeof
|
|
290
|
+
if (typeof g.productPrice != "number" || isNaN(g.productPrice))
|
|
209
291
|
throw new Error(`${_}.productPrice must be a valid number`);
|
|
210
|
-
if (typeof
|
|
292
|
+
if (typeof g.productId != "string")
|
|
211
293
|
throw new Error(`${_}.productId must be a string`);
|
|
212
|
-
if (typeof
|
|
294
|
+
if (typeof g.productName != "string")
|
|
213
295
|
throw new Error(`${_}.productName must be a string`);
|
|
214
296
|
});
|
|
215
|
-
} else if (Array.isArray(
|
|
216
|
-
if (
|
|
297
|
+
} else if (Array.isArray(r)) {
|
|
298
|
+
if (r.length === 0)
|
|
217
299
|
throw new Error("quoteRequestData array cannot be empty");
|
|
218
|
-
|
|
219
|
-
if (!
|
|
220
|
-
throw new Error(`quoteRequestData[${
|
|
221
|
-
|
|
300
|
+
r.forEach((p, u) => {
|
|
301
|
+
if (!p || typeof p != "object")
|
|
302
|
+
throw new Error(`quoteRequestData[${u}] must be a non-null object`);
|
|
303
|
+
v(p, u);
|
|
222
304
|
});
|
|
223
305
|
} else
|
|
224
|
-
|
|
306
|
+
v(r);
|
|
225
307
|
if ([
|
|
226
308
|
"onOptIn",
|
|
227
309
|
"onOptOut",
|
|
228
310
|
"onQuoteRetrieved",
|
|
229
311
|
"onError",
|
|
230
312
|
"noMatchingQuote"
|
|
231
|
-
].forEach((
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
234
|
-
throw new Error(`Callback '${
|
|
313
|
+
].forEach((p) => {
|
|
314
|
+
const u = s[p];
|
|
315
|
+
if (u && typeof u != "function")
|
|
316
|
+
throw new Error(`Callback '${p}' must be a function.`);
|
|
235
317
|
}), typeof i == "string" && !document.querySelector(i))
|
|
236
318
|
throw new Error(`Invalid location selector: '${i}'`);
|
|
237
|
-
if (
|
|
319
|
+
if (a && typeof a != "object")
|
|
238
320
|
throw new Error(
|
|
239
321
|
"Theme must be an object with CSS variables, do not include the '--' prefix"
|
|
240
322
|
);
|
|
323
|
+
if (c.state && !O.has(c.state))
|
|
324
|
+
throw new Error(`Invalid state: '${c.state}'. Must be a 2-character US state or territory code.`);
|
|
241
325
|
}
|
|
242
|
-
var b = /* @__PURE__ */ ((
|
|
243
|
-
function
|
|
244
|
-
const
|
|
245
|
-
return
|
|
326
|
+
var b = /* @__PURE__ */ ((c) => (c.YES = "yes", c.NO = "no", c.UNSELECTED = "unselected", c))(b || {});
|
|
327
|
+
function n(c, { text: t, className: r, parent: s, innerHTML: i, href: a, target: e } = {}) {
|
|
328
|
+
const o = document.createElement(c);
|
|
329
|
+
return r && (o.className = r), t != null && (o.textContent = t), i != null && (o.innerHTML = i), a && "href" in o && (o.href = a), e && "target" in o && (o.target = e), s && s.appendChild(o), o;
|
|
246
330
|
}
|
|
247
|
-
function
|
|
248
|
-
|
|
331
|
+
function P(c, { name: t, description: r }) {
|
|
332
|
+
n("div", {
|
|
249
333
|
className: "spot-header__title",
|
|
250
334
|
text: t,
|
|
251
|
-
parent:
|
|
252
|
-
}),
|
|
335
|
+
parent: c
|
|
336
|
+
}), n("div", {
|
|
253
337
|
className: "spot-header__description",
|
|
254
|
-
text:
|
|
255
|
-
parent:
|
|
338
|
+
text: r,
|
|
339
|
+
parent: c
|
|
256
340
|
});
|
|
257
341
|
}
|
|
258
|
-
function
|
|
259
|
-
const
|
|
342
|
+
function $(c, t = []) {
|
|
343
|
+
const r = n("ul", {
|
|
260
344
|
className: "spot-benefits__list",
|
|
261
|
-
parent:
|
|
345
|
+
parent: c
|
|
262
346
|
});
|
|
263
347
|
t.forEach((s) => {
|
|
264
|
-
const i =
|
|
348
|
+
const i = n("li", { parent: r });
|
|
265
349
|
i.innerHTML = `
|
|
266
350
|
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" class="spot-bullets__checkmark">
|
|
267
351
|
<path d="M11.6666 3.5L5.24998 9.91667L2.33331 7"
|
|
268
352
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
269
|
-
</svg>`,
|
|
353
|
+
</svg>`, n("span", { text: s, parent: i });
|
|
270
354
|
});
|
|
271
355
|
}
|
|
272
|
-
function
|
|
356
|
+
function V(c, t = []) {
|
|
273
357
|
if (!t || t.length === 0) return;
|
|
274
|
-
const
|
|
358
|
+
const r = n("div", {
|
|
275
359
|
className: "spot-qualifying-reasons__container",
|
|
276
|
-
parent:
|
|
277
|
-
}), s = [...t].sort((
|
|
360
|
+
parent: c
|
|
361
|
+
}), s = [...t].sort((o, l) => o.rank - l.rank), i = n("div", {
|
|
278
362
|
className: "spot-qualifying-reasons__grid",
|
|
279
|
-
parent:
|
|
280
|
-
}),
|
|
363
|
+
parent: r
|
|
364
|
+
}), a = {
|
|
281
365
|
"Accident & Illness": "cross.svg",
|
|
282
366
|
"Family Emergencies": "users.svg",
|
|
283
367
|
Layoffs: "building.svg",
|
|
@@ -287,101 +371,101 @@ function P(m, t = []) {
|
|
|
287
371
|
"Travel Interruption": "plane.svg",
|
|
288
372
|
"Military Duty": "medal.svg"
|
|
289
373
|
};
|
|
290
|
-
let
|
|
374
|
+
let e;
|
|
291
375
|
try {
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
295
|
-
|
|
376
|
+
const o = document.currentScript;
|
|
377
|
+
if (o != null && o.src) {
|
|
378
|
+
const l = new URL(o.src);
|
|
379
|
+
e = l.origin + l.pathname.replace(/\/[^/]*$/, "/");
|
|
296
380
|
} else
|
|
297
|
-
|
|
298
|
-
|
|
381
|
+
e = window.location.origin + window.location.pathname.replace(/\/[^/]*$/, "/");
|
|
382
|
+
e += "assets/";
|
|
299
383
|
} catch {
|
|
300
|
-
|
|
384
|
+
e = "./assets/";
|
|
301
385
|
}
|
|
302
|
-
s.forEach((
|
|
303
|
-
var
|
|
304
|
-
const
|
|
386
|
+
s.forEach((o) => {
|
|
387
|
+
var v, h, p;
|
|
388
|
+
const l = n("div", {
|
|
305
389
|
className: "spot-qualifying-reasons__item",
|
|
306
390
|
parent: i
|
|
307
|
-
}),
|
|
391
|
+
}), m = n("div", {
|
|
308
392
|
className: "spot-qualifying-reasons__icon-wrapper",
|
|
309
|
-
parent:
|
|
310
|
-
}), f =
|
|
393
|
+
parent: l
|
|
394
|
+
}), f = a[((v = o.benefitType) == null ? void 0 : v.name) || ""] || a[o.name || ""];
|
|
311
395
|
if (f) {
|
|
312
|
-
const
|
|
313
|
-
parent:
|
|
396
|
+
const u = n("img", {
|
|
397
|
+
parent: m
|
|
314
398
|
});
|
|
315
|
-
|
|
399
|
+
u.src = e + f, u.alt = ((h = o.benefitType) == null ? void 0 : h.name) || o.name || "", u.className = "spot-qualifying-reasons__icon";
|
|
316
400
|
}
|
|
317
|
-
|
|
401
|
+
n("span", {
|
|
318
402
|
className: "spot-qualifying-reasons__label",
|
|
319
|
-
text: ((
|
|
320
|
-
parent:
|
|
403
|
+
text: ((p = o.benefitType) == null ? void 0 : p.name) || o.name || "",
|
|
404
|
+
parent: l
|
|
321
405
|
});
|
|
322
406
|
});
|
|
323
407
|
}
|
|
324
|
-
function
|
|
325
|
-
if (t.length === 0 || !
|
|
408
|
+
function Q(c, t = [], r) {
|
|
409
|
+
if (t.length === 0 || !r || r <= 1)
|
|
326
410
|
return;
|
|
327
411
|
const s = /* @__PURE__ */ new Map();
|
|
328
|
-
t.forEach((
|
|
329
|
-
s.set(
|
|
412
|
+
t.forEach((u) => {
|
|
413
|
+
s.set(u, (s.get(u) || 0) + 1);
|
|
330
414
|
});
|
|
331
|
-
const
|
|
332
|
-
([
|
|
333
|
-
item:
|
|
415
|
+
const a = Array.from(s.entries()).map(
|
|
416
|
+
([u, d]) => ({
|
|
417
|
+
item: u,
|
|
334
418
|
count: d,
|
|
335
|
-
displayText: d > 1 ? `${d} x ${
|
|
419
|
+
displayText: d > 1 ? `${d} x ${u}` : u
|
|
336
420
|
})
|
|
337
|
-
).sort((
|
|
338
|
-
const
|
|
339
|
-
return !
|
|
340
|
-
}),
|
|
421
|
+
).sort((u, d) => {
|
|
422
|
+
const w = u.item.charAt(0), y = d.item.charAt(0), C = /[a-zA-Z]/.test(w), g = /[a-zA-Z]/.test(y);
|
|
423
|
+
return !C && g ? -1 : C && !g ? 1 : u.item.localeCompare(d.item, void 0, { sensitivity: "base" });
|
|
424
|
+
}), e = n("div", {
|
|
341
425
|
className: "spot-covered-items__container",
|
|
342
|
-
parent:
|
|
343
|
-
}),
|
|
426
|
+
parent: c
|
|
427
|
+
}), o = n("div", {
|
|
344
428
|
className: "spot-covered-items__header",
|
|
345
|
-
parent: n
|
|
346
|
-
}), p = a("button", {
|
|
347
|
-
className: "spot-covered-items__toggle",
|
|
348
429
|
parent: e
|
|
430
|
+
}), l = n("button", {
|
|
431
|
+
className: "spot-covered-items__toggle",
|
|
432
|
+
parent: o
|
|
349
433
|
});
|
|
350
|
-
|
|
434
|
+
n("span", {
|
|
351
435
|
className: "spot-covered-items__title",
|
|
352
436
|
text: `Items Covered in Your Cart (${t.length})`,
|
|
353
|
-
parent:
|
|
437
|
+
parent: l
|
|
354
438
|
});
|
|
355
|
-
const
|
|
439
|
+
const m = n("div", {
|
|
356
440
|
className: "spot-covered-items__right-section",
|
|
357
|
-
parent:
|
|
441
|
+
parent: l
|
|
358
442
|
});
|
|
359
|
-
|
|
443
|
+
n("span", {
|
|
360
444
|
className: "spot-covered-items__view-all",
|
|
361
445
|
text: "View All",
|
|
362
|
-
parent:
|
|
446
|
+
parent: m
|
|
363
447
|
});
|
|
364
|
-
const f =
|
|
448
|
+
const f = n("span", {
|
|
365
449
|
className: "spot-covered-items__arrow",
|
|
366
450
|
innerHTML: "▼",
|
|
367
|
-
parent:
|
|
368
|
-
}),
|
|
451
|
+
parent: m
|
|
452
|
+
}), v = n("div", {
|
|
369
453
|
className: "spot-covered-items__content",
|
|
370
|
-
parent:
|
|
371
|
-
}), h =
|
|
454
|
+
parent: e
|
|
455
|
+
}), h = n("ul", {
|
|
372
456
|
className: "spot-covered-items__list",
|
|
373
|
-
parent:
|
|
457
|
+
parent: v
|
|
374
458
|
});
|
|
375
|
-
|
|
376
|
-
const d =
|
|
377
|
-
|
|
459
|
+
a.forEach(({ displayText: u }) => {
|
|
460
|
+
const d = n("li", { parent: h });
|
|
461
|
+
n("span", { text: u, parent: d });
|
|
378
462
|
});
|
|
379
|
-
let
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}),
|
|
463
|
+
let p = !1;
|
|
464
|
+
v.style.display = "none", l.addEventListener("click", (u) => {
|
|
465
|
+
u.stopPropagation(), p = !p, v.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"), v.setAttribute("id", "covered-items-list");
|
|
383
467
|
}
|
|
384
|
-
const
|
|
468
|
+
const U = {
|
|
385
469
|
USD: "$",
|
|
386
470
|
CAD: "CAD $",
|
|
387
471
|
AUD: "AUD $",
|
|
@@ -391,73 +475,115 @@ const R = {
|
|
|
391
475
|
GBP: "GBP £",
|
|
392
476
|
AED: "AED ",
|
|
393
477
|
MAD: "MAD ",
|
|
394
|
-
SAR: "SAR "
|
|
478
|
+
SAR: "SAR ",
|
|
479
|
+
BGN: "BGN лв",
|
|
480
|
+
BRL: "BRL R$",
|
|
481
|
+
CHF: "CHF ",
|
|
482
|
+
DKK: "DKK kr",
|
|
483
|
+
INR: "INR ₹",
|
|
484
|
+
JPY: "JPY ¥",
|
|
485
|
+
MYR: "MYR RM",
|
|
486
|
+
NOK: "NOK kr",
|
|
487
|
+
PLN: "PLN zł",
|
|
488
|
+
SEK: "SEK kr",
|
|
489
|
+
SGD: "SGD $",
|
|
490
|
+
THB: "THB ฿",
|
|
491
|
+
ZAR: "ZAR R"
|
|
395
492
|
};
|
|
396
|
-
function
|
|
397
|
-
const s =
|
|
493
|
+
function Z(c, t = [], r = "USD") {
|
|
494
|
+
const s = U[r] ?? `${r} `, i = n("div", {
|
|
398
495
|
className: "spot-table__container",
|
|
399
|
-
parent:
|
|
400
|
-
}),
|
|
496
|
+
parent: c
|
|
497
|
+
}), a = n("table", {
|
|
401
498
|
className: "spot-refund__table spot-table--dynamic",
|
|
402
499
|
parent: i
|
|
403
|
-
}),
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
t.forEach(({ text:
|
|
407
|
-
const h =
|
|
408
|
-
|
|
409
|
-
const
|
|
410
|
-
|
|
500
|
+
}), e = n("thead", { parent: a }), o = n("tr", { parent: e });
|
|
501
|
+
n("th", { text: "When you cancel", parent: o }), n("th", { text: "You will receive", parent: o });
|
|
502
|
+
const l = n("tbody", { parent: a });
|
|
503
|
+
t.forEach(({ text: m, percent: f, amount: v }) => {
|
|
504
|
+
const h = n("tr", { parent: l });
|
|
505
|
+
n("td", { text: m, parent: h });
|
|
506
|
+
const p = f === "Not eligible for refund" ? "Not eligible for a refund" : `${s}${v} refund`;
|
|
507
|
+
n("td", { text: p, parent: h });
|
|
411
508
|
});
|
|
412
509
|
}
|
|
413
|
-
function
|
|
414
|
-
const
|
|
415
|
-
className: "spot-
|
|
416
|
-
parent:
|
|
417
|
-
})
|
|
418
|
-
|
|
510
|
+
function B(c, t) {
|
|
511
|
+
const r = n("div", {
|
|
512
|
+
className: "spot-state-dropdown__wrapper",
|
|
513
|
+
parent: c
|
|
514
|
+
});
|
|
515
|
+
n("label", {
|
|
516
|
+
className: "spot-state-dropdown__label",
|
|
517
|
+
text: "State of Residence",
|
|
518
|
+
parent: r
|
|
519
|
+
});
|
|
520
|
+
const s = n("select", {
|
|
521
|
+
className: "spot-state-dropdown__select",
|
|
522
|
+
parent: r
|
|
523
|
+
});
|
|
524
|
+
s.setAttribute("aria-label", "State of Residence");
|
|
525
|
+
const i = n("option", {
|
|
526
|
+
text: "Select a state...",
|
|
419
527
|
parent: s
|
|
420
|
-
})
|
|
421
|
-
|
|
422
|
-
text: o
|
|
528
|
+
});
|
|
529
|
+
i.value = "", i.selected = !t, A.forEach(({ value: e, label: o }) => {
|
|
530
|
+
const l = n("option", { text: o, parent: s });
|
|
531
|
+
l.value = e, e === t && (l.selected = !0);
|
|
532
|
+
});
|
|
533
|
+
const a = n("option", {
|
|
534
|
+
text: "Not a US Resident",
|
|
535
|
+
parent: s
|
|
536
|
+
});
|
|
537
|
+
return a.value = q, t === q && (a.selected = !0), s;
|
|
538
|
+
}
|
|
539
|
+
function j(c, t, r, s = !1) {
|
|
540
|
+
const i = n("div", {
|
|
541
|
+
className: `spot-selection__options${s ? " spot-selection__options--disabled" : ""}`,
|
|
542
|
+
parent: c
|
|
543
|
+
}), a = n("label", {
|
|
544
|
+
className: `spot-selection__option ${t === b.YES ? "selected" : ""}`,
|
|
423
545
|
parent: i
|
|
424
|
-
}),
|
|
546
|
+
}), e = n("input", { parent: a });
|
|
547
|
+
e.type = "radio", e.name = "selection", e.value = b.YES, t === b.YES && (e.checked = !0), s && (e.disabled = !0), n("strong", {
|
|
548
|
+
text: r.yesOptionText,
|
|
549
|
+
parent: a
|
|
550
|
+
}), n("span", {
|
|
425
551
|
className: "spot-selection__recommended-tag",
|
|
426
552
|
text: "Recommended",
|
|
427
|
-
parent:
|
|
553
|
+
parent: a
|
|
428
554
|
});
|
|
429
|
-
const
|
|
555
|
+
const o = n("label", {
|
|
430
556
|
className: `spot-selection__option ${t === b.NO ? "selected" : ""}`,
|
|
431
|
-
parent:
|
|
432
|
-
}),
|
|
433
|
-
return
|
|
557
|
+
parent: i
|
|
558
|
+
}), l = n("input", { parent: o });
|
|
559
|
+
return l.type = "radio", l.name = "selection", l.value = b.NO, t === b.NO && (l.checked = !0), s && (l.disabled = !0), n("span", { text: r.noOptionText, parent: o }), i;
|
|
434
560
|
}
|
|
435
|
-
function
|
|
561
|
+
function H(c, t) {
|
|
436
562
|
var s;
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
439
|
-
const i =
|
|
563
|
+
const r = (s = t.communication) == null ? void 0 : s.paymentTerms;
|
|
564
|
+
if (r) {
|
|
565
|
+
const i = n("div", {
|
|
440
566
|
className: "spot-payment-terms",
|
|
441
|
-
parent:
|
|
567
|
+
parent: c
|
|
442
568
|
});
|
|
443
|
-
return
|
|
569
|
+
return n("div", {
|
|
444
570
|
className: "spot-payment-terms__header",
|
|
445
571
|
text: "PAYMENT TERMS",
|
|
446
572
|
parent: i
|
|
447
|
-
}),
|
|
573
|
+
}), n("div", {
|
|
448
574
|
className: "spot-payment-terms__body",
|
|
449
|
-
text:
|
|
575
|
+
text: r || "",
|
|
450
576
|
parent: i
|
|
451
577
|
}), i;
|
|
452
578
|
}
|
|
453
579
|
}
|
|
454
|
-
function
|
|
455
|
-
if (
|
|
456
|
-
const
|
|
580
|
+
function F(c, t, r = "bottom-right") {
|
|
581
|
+
if (r === "top-right") {
|
|
582
|
+
const o = n("div", {
|
|
457
583
|
className: "spot-logo__top-right",
|
|
458
|
-
parent:
|
|
584
|
+
parent: c
|
|
459
585
|
});
|
|
460
|
-
|
|
586
|
+
o.innerHTML = `
|
|
461
587
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
462
588
|
<rect width="145" height="28"/>
|
|
463
589
|
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
|
@@ -474,25 +600,25 @@ function Z(m, t, o = "bottom-right") {
|
|
|
474
600
|
</defs>
|
|
475
601
|
</svg>`;
|
|
476
602
|
}
|
|
477
|
-
const s =
|
|
603
|
+
const s = n("div", {
|
|
478
604
|
className: "spot-footer__container",
|
|
479
|
-
parent:
|
|
480
|
-
}), i =
|
|
605
|
+
parent: c
|
|
606
|
+
}), i = n("div", {
|
|
481
607
|
className: "spot-footer__terms",
|
|
482
608
|
parent: s
|
|
483
|
-
}),
|
|
609
|
+
}), a = `<a href="${t.communication.termsAndConditionsUrl}" target="_blank" class="spot-footer__terms-link">Terms & Conditions</a>`, e = t.communication.legalDisclaimer.replace(
|
|
484
610
|
/terms (and|&) conditions/gi,
|
|
485
|
-
|
|
611
|
+
a
|
|
486
612
|
);
|
|
487
|
-
if (
|
|
488
|
-
innerHTML:
|
|
613
|
+
if (n("span", {
|
|
614
|
+
innerHTML: e,
|
|
489
615
|
parent: i
|
|
490
|
-
}),
|
|
491
|
-
const
|
|
616
|
+
}), r === "bottom-right") {
|
|
617
|
+
const o = n("p", {
|
|
492
618
|
className: "spot-footer__powered-by",
|
|
493
619
|
parent: s
|
|
494
620
|
});
|
|
495
|
-
|
|
621
|
+
o.innerHTML = `
|
|
496
622
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
497
623
|
<rect width="145" height="28"/>
|
|
498
624
|
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
|
@@ -511,18 +637,18 @@ function Z(m, t, o = "bottom-right") {
|
|
|
511
637
|
}
|
|
512
638
|
return s;
|
|
513
639
|
}
|
|
514
|
-
const U = ":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-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__options{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__options{grid-row:3;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;padding-left:.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)}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-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);margin-right:.5rem;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)}}";
|
|
515
|
-
function
|
|
640
|
+
const W = ":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-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}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)}}";
|
|
641
|
+
function Y(c) {
|
|
516
642
|
const t = document.createElement("style");
|
|
517
|
-
t.textContent =
|
|
643
|
+
t.textContent = c, document.head.appendChild(t);
|
|
518
644
|
}
|
|
519
|
-
|
|
520
|
-
const
|
|
645
|
+
Y(W);
|
|
646
|
+
const L = {
|
|
521
647
|
sandbox: "https://api.sandbox.getspot.com/api/v1/quote",
|
|
522
648
|
production: "https://api.getspot.com/api/v1/quote",
|
|
523
649
|
local: "http://localhost:3999/api/v1/quote"
|
|
524
650
|
};
|
|
525
|
-
class
|
|
651
|
+
class G {
|
|
526
652
|
constructor(t = {}) {
|
|
527
653
|
this.options = {
|
|
528
654
|
location: "body",
|
|
@@ -537,98 +663,107 @@ class j {
|
|
|
537
663
|
}, 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();
|
|
538
664
|
}
|
|
539
665
|
async _init() {
|
|
540
|
-
var t,
|
|
666
|
+
var t, r, s, i, a;
|
|
541
667
|
try {
|
|
542
|
-
|
|
543
|
-
let
|
|
668
|
+
M(this.options), this.currentState = this.options.state;
|
|
669
|
+
let e;
|
|
544
670
|
if (this.options.useMockData && this.options.mockData)
|
|
545
|
-
|
|
671
|
+
e = this.options.mockData;
|
|
546
672
|
else {
|
|
547
|
-
const { environment:
|
|
548
|
-
|
|
673
|
+
const { environment: o, partnerId: l } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || L[o];
|
|
674
|
+
e = "items" in this.options.quoteRequestData ? await S(
|
|
549
675
|
f,
|
|
550
|
-
|
|
551
|
-
this.options.quoteRequestData
|
|
552
|
-
|
|
676
|
+
l,
|
|
677
|
+
this.options.quoteRequestData,
|
|
678
|
+
this._validState()
|
|
679
|
+
) : await N(
|
|
553
680
|
f,
|
|
554
|
-
|
|
555
|
-
this.options.quoteRequestData
|
|
681
|
+
l,
|
|
682
|
+
this.options.quoteRequestData,
|
|
683
|
+
this._validState()
|
|
556
684
|
);
|
|
557
685
|
}
|
|
558
|
-
if (
|
|
559
|
-
|
|
686
|
+
if (e.status !== "QUOTE_AVAILABLE") {
|
|
687
|
+
e.status === "NO_MATCHING_QUOTE" && ((t = this.options.callbacks) != null && t.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
|
|
560
688
|
status: "NO_MATCHING_QUOTE",
|
|
561
689
|
data: this.options.quoteRequestData
|
|
562
690
|
});
|
|
563
691
|
return;
|
|
564
692
|
}
|
|
565
|
-
if (this.quote =
|
|
693
|
+
if (this.quote = e.data, !this.quote)
|
|
566
694
|
throw new Error("No quote data in response");
|
|
567
|
-
if (this._renderWidget(), this.options.selection === b.YES && ((
|
|
568
|
-
const
|
|
695
|
+
if (this._renderWidget(), this.options.selection === b.YES && ((r = this.options.callbacks) != null && r.onOptIn)) {
|
|
696
|
+
const o = {
|
|
569
697
|
status: "QUOTE_ACCEPTED",
|
|
570
698
|
spotPrice: this.quote.spotPrice,
|
|
571
|
-
quoteId: this.quote.id
|
|
699
|
+
quoteId: this.quote.id,
|
|
700
|
+
state: this._validState()
|
|
572
701
|
};
|
|
573
702
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
var
|
|
577
|
-
const f = (
|
|
578
|
-
(h) => (h.cartItemId || `item-${
|
|
703
|
+
const l = this.options.quoteRequestData;
|
|
704
|
+
o.batchQuoteDetails = this.quote.originalQuotes.map((m) => {
|
|
705
|
+
var v;
|
|
706
|
+
const f = (v = l.items) == null ? void 0 : v.find(
|
|
707
|
+
(h) => (h.cartItemId || `item-${l.items.indexOf(h) + 1}`) === m.cartItemId
|
|
579
708
|
);
|
|
580
709
|
return {
|
|
581
|
-
quoteId:
|
|
582
|
-
productPrice: (f == null ? void 0 : f.productPrice) ||
|
|
710
|
+
quoteId: m.id,
|
|
711
|
+
productPrice: (f == null ? void 0 : f.productPrice) || m.spotPrice,
|
|
583
712
|
cartItemId: (f == null ? void 0 : f.cartItemId) || ""
|
|
584
713
|
};
|
|
585
714
|
});
|
|
586
715
|
}
|
|
587
|
-
this.options.callbacks.onOptIn(
|
|
716
|
+
this.options.callbacks.onOptIn(o);
|
|
588
717
|
}
|
|
589
718
|
if ((s = this.options.callbacks) != null && s.onQuoteRetrieved) {
|
|
590
|
-
const
|
|
591
|
-
|
|
719
|
+
const o = this.options.callbacks.onQuoteRetrieved(this.quote);
|
|
720
|
+
o && this._applyQuoteUpdates(o);
|
|
592
721
|
}
|
|
593
|
-
} catch (
|
|
722
|
+
} catch (e) {
|
|
594
723
|
if ((i = this.options.callbacks) != null && i.onError) {
|
|
595
|
-
const
|
|
596
|
-
(
|
|
597
|
-
message:
|
|
598
|
-
status:
|
|
599
|
-
responseBody:
|
|
724
|
+
const o = e;
|
|
725
|
+
(a = this.options.callbacks) == null || a.onError({
|
|
726
|
+
message: o.message,
|
|
727
|
+
status: o.status,
|
|
728
|
+
responseBody: o.responseBody
|
|
600
729
|
});
|
|
601
730
|
}
|
|
602
731
|
}
|
|
603
732
|
}
|
|
604
733
|
_renderWidget() {
|
|
605
734
|
if (!this.quote) return;
|
|
606
|
-
this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([
|
|
607
|
-
const
|
|
608
|
-
this.container.style.setProperty(
|
|
609
|
-
}),
|
|
735
|
+
this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([e, o]) => {
|
|
736
|
+
const l = `--${e}`;
|
|
737
|
+
this.container.style.setProperty(l, o);
|
|
738
|
+
}), P(this.container, this.quote.communication);
|
|
610
739
|
const t = document.createElement("div");
|
|
611
|
-
if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ?
|
|
612
|
-
const
|
|
613
|
-
|
|
740
|
+
if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ? V(t, this.quote.qualifyingReasons) : $(t, this.quote.communication.bulletPoints), this.quote.coveredItems) {
|
|
741
|
+
const e = this._getTotalItemsInRequest();
|
|
742
|
+
Q(t, this.quote.coveredItems, e);
|
|
614
743
|
}
|
|
615
|
-
this.options.showTable && !this.quote.qualifyingReasons &&
|
|
616
|
-
const
|
|
617
|
-
|
|
744
|
+
this.options.showTable && !this.quote.qualifyingReasons && Z(t, this.quote.payoutSchedule, this.quote.currencyCode);
|
|
745
|
+
const r = n("div", {
|
|
746
|
+
className: "spot-selection__wrapper",
|
|
747
|
+
parent: t
|
|
748
|
+
});
|
|
749
|
+
this._isPassOrTrip() && !this.options.state && (this._stateSelectEl = B(r, this.currentState));
|
|
750
|
+
const i = !this._isQuotingAvailable(), a = j(
|
|
751
|
+
r,
|
|
618
752
|
this.options.selection,
|
|
619
|
-
this.quote.communication
|
|
753
|
+
this.quote.communication,
|
|
754
|
+
i
|
|
620
755
|
);
|
|
621
|
-
|
|
756
|
+
this.paymentTermsEl = n("div", {
|
|
622
757
|
className: "spot-payment-terms__wrapper",
|
|
623
758
|
parent: t
|
|
624
|
-
}), this.currentSelection === b.YES &&
|
|
759
|
+
}), this.currentSelection === b.YES && H(this.paymentTermsEl, this.quote), F(this.container, this.quote, this.options.logoPosition), window.addEventListener("resize", this._onResize), this._setupResizeObserver(), this._updateLayout(), this._setupOptionListeners(a), this._setupStateDropdownListener();
|
|
625
760
|
}
|
|
626
761
|
_updateLayout() {
|
|
627
762
|
if (!this.container || !this.quote) return;
|
|
628
763
|
const t = this.container.querySelector(
|
|
629
764
|
".spot-content__wrapper"
|
|
630
|
-
),
|
|
631
|
-
if (!t || !
|
|
765
|
+
), r = this.options.showTable && !this.quote.qualifyingReasons;
|
|
766
|
+
if (!t || !r) {
|
|
632
767
|
t == null || t.classList.remove("desktop-layout");
|
|
633
768
|
return;
|
|
634
769
|
}
|
|
@@ -636,19 +771,19 @@ class j {
|
|
|
636
771
|
t.classList.toggle("desktop-layout", s);
|
|
637
772
|
}
|
|
638
773
|
_shouldUseDesktopLayout(t) {
|
|
639
|
-
const
|
|
640
|
-
if (
|
|
774
|
+
const r = this.container.offsetWidth - 40, s = 325, i = 16;
|
|
775
|
+
if (r >= 900)
|
|
641
776
|
return !0;
|
|
642
|
-
if (
|
|
643
|
-
const
|
|
777
|
+
if (r >= 650) {
|
|
778
|
+
const a = t.classList.contains("desktop-layout");
|
|
644
779
|
t.classList.remove("desktop-layout"), t.offsetHeight;
|
|
645
|
-
const
|
|
780
|
+
const e = t.querySelector(
|
|
646
781
|
".spot-benefits__list, .spot-qualifying-reasons__container"
|
|
647
782
|
);
|
|
648
|
-
if (!
|
|
649
|
-
return
|
|
650
|
-
const
|
|
651
|
-
return
|
|
783
|
+
if (!e)
|
|
784
|
+
return a && t.classList.add("desktop-layout"), a;
|
|
785
|
+
const l = Math.min(e.scrollWidth, 400) + s + i;
|
|
786
|
+
return a && t.classList.add("desktop-layout"), r >= l;
|
|
652
787
|
}
|
|
653
788
|
return !1;
|
|
654
789
|
}
|
|
@@ -668,31 +803,66 @@ class j {
|
|
|
668
803
|
`$${t.spotPriceWithFees.toFixed(2)}`
|
|
669
804
|
)), this.destroy(), this._renderWidget());
|
|
670
805
|
}
|
|
806
|
+
_isPassOrTrip() {
|
|
807
|
+
const t = this.options.quoteRequestData;
|
|
808
|
+
if (Array.isArray(t))
|
|
809
|
+
return t.some((s) => s.productType === "Pass" || s.productType === "Trip");
|
|
810
|
+
if ("items" in t)
|
|
811
|
+
return t.items.some(
|
|
812
|
+
(s) => s.productType === "Pass" || s.productType === "Trip"
|
|
813
|
+
);
|
|
814
|
+
const r = t;
|
|
815
|
+
return r.productType === "Pass" || r.productType === "Trip";
|
|
816
|
+
}
|
|
817
|
+
_validState() {
|
|
818
|
+
if (this._isPassOrTrip() && !(!this.currentState || this.currentState === q))
|
|
819
|
+
return this.currentState;
|
|
820
|
+
}
|
|
821
|
+
_isQuotingAvailable() {
|
|
822
|
+
return !this._isPassOrTrip() || this.options.state ? !0 : !!this.currentState && this.currentState !== q;
|
|
823
|
+
}
|
|
824
|
+
_setRadiosDisabled(t) {
|
|
825
|
+
var i, a, e;
|
|
826
|
+
const r = (i = this.container) == null ? void 0 : i.querySelectorAll('input[name="selection"]'), s = (a = this.container) == null ? void 0 : a.querySelector(".spot-selection__options");
|
|
827
|
+
r == null || r.forEach((o) => {
|
|
828
|
+
o.disabled = t;
|
|
829
|
+
}), s == null || s.classList.toggle("spot-selection__options--disabled", t), t && (r == null || r.forEach((o) => {
|
|
830
|
+
o.checked = !1;
|
|
831
|
+
}), (e = this.container) == null || e.querySelectorAll(".spot-selection__option").forEach((o) => {
|
|
832
|
+
o.classList.remove("selected");
|
|
833
|
+
}), this.currentSelection = b.UNSELECTED, this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""));
|
|
834
|
+
}
|
|
835
|
+
_setupStateDropdownListener() {
|
|
836
|
+
this._stateSelectEl && this._stateSelectEl.addEventListener("change", () => {
|
|
837
|
+
this.currentState = this._stateSelectEl.value, this._setRadiosDisabled(!this._isQuotingAvailable());
|
|
838
|
+
});
|
|
839
|
+
}
|
|
671
840
|
_setupOptionListeners(t) {
|
|
672
|
-
const
|
|
841
|
+
const r = t.querySelectorAll(
|
|
673
842
|
'input[type="radio"]'
|
|
674
843
|
), s = t.querySelectorAll(".spot-selection__option");
|
|
675
|
-
|
|
676
|
-
i.addEventListener("change", (
|
|
677
|
-
var
|
|
678
|
-
const
|
|
679
|
-
if (this.hideSelectionError(), this.currentSelection =
|
|
844
|
+
r.forEach((i) => {
|
|
845
|
+
i.addEventListener("change", (a) => {
|
|
846
|
+
var l, m, f, v;
|
|
847
|
+
const e = a.target, o = e.value;
|
|
848
|
+
if (this.hideSelectionError(), this.currentSelection = o, s.forEach((h) => h.classList.remove("selected")), (l = e.closest(".spot-selection__option")) == null || l.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), o === b.YES && ((m = this.quote) != null && m.communication.paymentTerms && H(this.paymentTermsEl, this.quote), (f = this.options.callbacks) != null && f.onOptIn)) {
|
|
680
849
|
const h = {
|
|
681
850
|
status: "QUOTE_ACCEPTED",
|
|
682
851
|
spotPrice: this.quote.spotPrice,
|
|
683
|
-
quoteId: this.quote.id
|
|
852
|
+
quoteId: this.quote.id,
|
|
853
|
+
state: this._validState()
|
|
684
854
|
};
|
|
685
855
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
686
|
-
const
|
|
856
|
+
const p = this.options.quoteRequestData;
|
|
687
857
|
h.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
688
|
-
(
|
|
689
|
-
var
|
|
690
|
-
const d = (
|
|
691
|
-
(
|
|
858
|
+
(u) => {
|
|
859
|
+
var w;
|
|
860
|
+
const d = (w = p.items) == null ? void 0 : w.find(
|
|
861
|
+
(y) => (y.cartItemId || `item-${p.items.indexOf(y) + 1}`) === u.cartItemId
|
|
692
862
|
);
|
|
693
863
|
return {
|
|
694
|
-
quoteId:
|
|
695
|
-
productPrice: (d == null ? void 0 : d.productPrice) ||
|
|
864
|
+
quoteId: u.id,
|
|
865
|
+
productPrice: (d == null ? void 0 : d.productPrice) || u.spotPrice,
|
|
696
866
|
cartItemId: (d == null ? void 0 : d.cartItemId) || ""
|
|
697
867
|
};
|
|
698
868
|
}
|
|
@@ -700,22 +870,23 @@ class j {
|
|
|
700
870
|
}
|
|
701
871
|
this.options.callbacks.onOptIn(h);
|
|
702
872
|
}
|
|
703
|
-
if (
|
|
873
|
+
if (o === b.NO && ((v = this.options.callbacks) != null && v.onOptOut)) {
|
|
704
874
|
const h = {
|
|
705
875
|
status: "QUOTE_DECLINED",
|
|
706
|
-
quoteId: this.quote.id
|
|
876
|
+
quoteId: this.quote.id,
|
|
877
|
+
state: this._validState()
|
|
707
878
|
};
|
|
708
879
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
709
|
-
const
|
|
880
|
+
const p = this.options.quoteRequestData;
|
|
710
881
|
h.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
711
|
-
(
|
|
712
|
-
var
|
|
713
|
-
const d = (
|
|
714
|
-
(
|
|
882
|
+
(u) => {
|
|
883
|
+
var w;
|
|
884
|
+
const d = (w = p.items) == null ? void 0 : w.find(
|
|
885
|
+
(y) => (y.cartItemId || `item-${p.items.indexOf(y) + 1}`) === u.cartItemId
|
|
715
886
|
);
|
|
716
887
|
return {
|
|
717
|
-
quoteId:
|
|
718
|
-
productPrice: (d == null ? void 0 : d.productPrice) ||
|
|
888
|
+
quoteId: u.id,
|
|
889
|
+
productPrice: (d == null ? void 0 : d.productPrice) || u.spotPrice,
|
|
719
890
|
cartItemId: (d == null ? void 0 : d.cartItemId) || ""
|
|
720
891
|
};
|
|
721
892
|
}
|
|
@@ -730,10 +901,10 @@ class j {
|
|
|
730
901
|
var t;
|
|
731
902
|
if (!this.errorEl) {
|
|
732
903
|
this.errorEl = document.createElement("div"), this.errorEl.className = "spot-selection__error", this.errorEl.textContent = "Please make a selection";
|
|
733
|
-
const
|
|
904
|
+
const r = (t = this.container) == null ? void 0 : t.querySelector(
|
|
734
905
|
".spot-selection__options"
|
|
735
906
|
);
|
|
736
|
-
|
|
907
|
+
r && r.insertAdjacentElement("afterend", this.errorEl);
|
|
737
908
|
}
|
|
738
909
|
this.errorEl.style.display = "block";
|
|
739
910
|
}
|
|
@@ -748,61 +919,64 @@ class j {
|
|
|
748
919
|
return t ? this.hideSelectionError() : this.showSelectionError(), t;
|
|
749
920
|
}
|
|
750
921
|
async updateQuote(t) {
|
|
751
|
-
var
|
|
922
|
+
var r, s, i, a;
|
|
752
923
|
try {
|
|
753
|
-
const
|
|
924
|
+
const e = {
|
|
754
925
|
...this.options,
|
|
755
926
|
quoteRequestData: t
|
|
756
927
|
};
|
|
757
|
-
|
|
758
|
-
const { environment:
|
|
928
|
+
M(e);
|
|
929
|
+
const { environment: o, partnerId: l, customEndpoint: m } = this.options.apiConfig, f = m || L[o], h = "items" in e.quoteRequestData ? await S(
|
|
759
930
|
f,
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
931
|
+
l,
|
|
932
|
+
e.quoteRequestData,
|
|
933
|
+
this._validState()
|
|
934
|
+
) : await N(
|
|
763
935
|
f,
|
|
764
|
-
|
|
765
|
-
|
|
936
|
+
l,
|
|
937
|
+
e.quoteRequestData,
|
|
938
|
+
this._validState()
|
|
766
939
|
);
|
|
767
940
|
if (h.status !== "QUOTE_AVAILABLE")
|
|
768
|
-
return this.destroy(), h.status === "NO_MATCHING_QUOTE" && ((
|
|
941
|
+
return this.destroy(), h.status === "NO_MATCHING_QUOTE" && ((r = this.options.callbacks) != null && r.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
|
|
769
942
|
status: "NO_MATCHING_QUOTE",
|
|
770
|
-
data:
|
|
943
|
+
data: e.quoteRequestData
|
|
771
944
|
}), !1;
|
|
772
|
-
if (this.options.quoteRequestData =
|
|
773
|
-
const
|
|
774
|
-
|
|
945
|
+
if (this.options.quoteRequestData = e.quoteRequestData, this.quote = h.data, this.currentSelection = b.UNSELECTED, this.destroy(), this._renderWidget(), (s = this.options.callbacks) != null && s.onQuoteRetrieved) {
|
|
946
|
+
const p = this.options.callbacks.onQuoteRetrieved(this.quote);
|
|
947
|
+
p && this._applyQuoteUpdates(p);
|
|
775
948
|
}
|
|
776
949
|
return !0;
|
|
777
|
-
} catch (
|
|
778
|
-
const
|
|
779
|
-
return (
|
|
780
|
-
message:
|
|
781
|
-
status:
|
|
782
|
-
responseBody:
|
|
950
|
+
} catch (e) {
|
|
951
|
+
const o = e;
|
|
952
|
+
return (a = (i = this.options.callbacks) == null ? void 0 : i.onError) == null || a.call(i, {
|
|
953
|
+
message: o.message,
|
|
954
|
+
status: o.status,
|
|
955
|
+
responseBody: o.responseBody
|
|
783
956
|
}), !1;
|
|
784
957
|
}
|
|
785
958
|
}
|
|
786
959
|
getSelection() {
|
|
787
|
-
var
|
|
960
|
+
var r, s, i;
|
|
788
961
|
if (this.currentSelection == null || this.currentSelection == b.UNSELECTED) return null;
|
|
789
962
|
const t = {
|
|
790
963
|
selection: this.currentSelection,
|
|
791
|
-
quoteId: (
|
|
964
|
+
quoteId: (r = this.quote) == null ? void 0 : r.id,
|
|
792
965
|
spotPrice: (s = this.quote) == null ? void 0 : s.spotPrice,
|
|
793
|
-
status: this.currentSelection === b.YES ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED"
|
|
966
|
+
status: this.currentSelection === b.YES ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED",
|
|
967
|
+
state: this.currentState
|
|
794
968
|
};
|
|
795
969
|
if ((i = this.quote) != null && i.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
796
|
-
const
|
|
797
|
-
t.batchQuoteDetails = this.quote.originalQuotes.map((
|
|
798
|
-
var
|
|
799
|
-
const
|
|
800
|
-
(
|
|
970
|
+
const a = this.options.quoteRequestData;
|
|
971
|
+
t.batchQuoteDetails = this.quote.originalQuotes.map((e) => {
|
|
972
|
+
var l;
|
|
973
|
+
const o = (l = a.items) == null ? void 0 : l.find(
|
|
974
|
+
(m) => (m.cartItemId || `item-${a.items.indexOf(m) + 1}`) === e.cartItemId
|
|
801
975
|
);
|
|
802
976
|
return {
|
|
803
|
-
quoteId:
|
|
804
|
-
productPrice: (
|
|
805
|
-
cartItemId: (
|
|
977
|
+
quoteId: e.id,
|
|
978
|
+
productPrice: (o == null ? void 0 : o.productPrice) || e.spotPrice,
|
|
979
|
+
cartItemId: (o == null ? void 0 : o.cartItemId) || ""
|
|
806
980
|
};
|
|
807
981
|
});
|
|
808
982
|
}
|
|
@@ -813,6 +987,7 @@ class j {
|
|
|
813
987
|
}
|
|
814
988
|
}
|
|
815
989
|
export {
|
|
990
|
+
q as NON_US_RESIDENT_VALUE,
|
|
816
991
|
b as SelectionEnum,
|
|
817
|
-
|
|
992
|
+
G as default
|
|
818
993
|
};
|