@getspot/spot-widget 4.1.0 → 4.2.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 +9 -0
- 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 +497 -356
- package/dist/index.umd.js +4 -4
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/ui.d.ts +5 -2
- 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,168 @@
|
|
|
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 L(
|
|
20
|
+
async function L(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 I(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 L(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
|
+
(g, h) => (g.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 k = "non-us-resident", z = [
|
|
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(z.map((c) => c.value)), P = {
|
|
87
145
|
sandbox: "https://api.sandbox.getspot.com/v1/quote",
|
|
88
146
|
production: "https://api.getspot.com/v1/quote",
|
|
89
147
|
local: "http://localhost:3999/api/v1/quote"
|
|
90
148
|
};
|
|
91
|
-
function
|
|
149
|
+
function M(c) {
|
|
92
150
|
const {
|
|
93
151
|
apiConfig: t = {},
|
|
94
|
-
quoteRequestData:
|
|
152
|
+
quoteRequestData: r,
|
|
95
153
|
callbacks: s = {},
|
|
96
154
|
location: i,
|
|
97
|
-
theme:
|
|
98
|
-
} =
|
|
99
|
-
environment:
|
|
100
|
-
partnerId:
|
|
101
|
-
customEndpoint:
|
|
155
|
+
theme: a
|
|
156
|
+
} = c, {
|
|
157
|
+
environment: e = "sandbox",
|
|
158
|
+
partnerId: o,
|
|
159
|
+
customEndpoint: l
|
|
102
160
|
} = t;
|
|
103
|
-
if (!
|
|
161
|
+
if (!o || typeof o != "string")
|
|
104
162
|
throw new Error("Invalid or missing partnerId in apiConfig");
|
|
105
|
-
if (!(
|
|
106
|
-
throw new Error(`Invalid environment in apiConfig: ${
|
|
107
|
-
if (!
|
|
163
|
+
if (!(l || P[e]))
|
|
164
|
+
throw new Error(`Invalid environment in apiConfig: ${e}`);
|
|
165
|
+
if (!r || typeof r != "object" && !Array.isArray(r))
|
|
108
166
|
throw new Error("quoteRequestData must be a non-null object or array");
|
|
109
167
|
const f = [
|
|
110
168
|
"startDate",
|
|
@@ -118,49 +176,49 @@ function N(m) {
|
|
|
118
176
|
"cartId",
|
|
119
177
|
"productName"
|
|
120
178
|
];
|
|
121
|
-
function g(
|
|
122
|
-
const d =
|
|
179
|
+
function g(p, u = null) {
|
|
180
|
+
const d = u !== null ? `quoteRequestData[${u}]` : "quoteRequestData";
|
|
123
181
|
f.forEach((v) => {
|
|
124
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
182
|
+
if (!Object.prototype.hasOwnProperty.call(p, v) || p[v] === void 0 || p[v] === null)
|
|
125
183
|
throw new Error(`Missing required ${d} field: '${v}'`);
|
|
126
184
|
});
|
|
127
185
|
const y = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
128
|
-
if (!y.test(
|
|
186
|
+
if (!y.test(p.startDate))
|
|
129
187
|
throw new Error(`${d}.startDate must be a valid ISO8601 string`);
|
|
130
|
-
if (!y.test(
|
|
188
|
+
if (!y.test(p.endDate))
|
|
131
189
|
throw new Error(`${d}.endDate must be a valid ISO8601 string`);
|
|
132
|
-
if (typeof
|
|
190
|
+
if (typeof p.currencyCode != "string")
|
|
133
191
|
throw new Error(`${d}.currencyCode must be a string`);
|
|
134
|
-
if (!["USD", "CAD", "AUD", "NZD", "EUR", "MXN", "AED", "GBP", "MAD", "SAR"].includes(
|
|
135
|
-
throw new Error(`Invalid ${d}.currencyCode: ${
|
|
136
|
-
if (typeof
|
|
192
|
+
if (!["USD", "CAD", "AUD", "NZD", "EUR", "MXN", "AED", "GBP", "MAD", "SAR"].includes(p.currencyCode))
|
|
193
|
+
throw new Error(`Invalid ${d}.currencyCode: ${p.currencyCode}`);
|
|
194
|
+
if (typeof p.eventType != "string")
|
|
137
195
|
throw new Error(`${d}.eventType must be a string`);
|
|
138
|
-
if (typeof
|
|
196
|
+
if (typeof p.productType != "string")
|
|
139
197
|
throw new Error(`${d}.productType must be a string`);
|
|
140
198
|
const q = ["Pass", "Trip", "Registration"];
|
|
141
|
-
if (!q.includes(
|
|
199
|
+
if (!q.includes(p.productType))
|
|
142
200
|
throw new Error(
|
|
143
201
|
`${d}.productType must be one of ${q.join(", ")}`
|
|
144
202
|
);
|
|
145
|
-
if (typeof
|
|
203
|
+
if (typeof p.productDuration != "string")
|
|
146
204
|
throw new Error(`${d}.productDuration must be a string`);
|
|
147
205
|
const C = ["Daily", "Seasonal", "Trip", "Event"];
|
|
148
|
-
if (!C.includes(
|
|
206
|
+
if (!C.includes(p.productDuration))
|
|
149
207
|
throw new Error(
|
|
150
208
|
`${d}.productDuration must be one of ${C.join(", ")}`
|
|
151
209
|
);
|
|
152
|
-
if (typeof
|
|
210
|
+
if (typeof p.productPrice != "number" || isNaN(p.productPrice))
|
|
153
211
|
throw new Error(`${d}.productPrice must be a valid number`);
|
|
154
|
-
if (typeof
|
|
212
|
+
if (typeof p.productId != "string")
|
|
155
213
|
throw new Error(`${d}.productId must be a string`);
|
|
156
|
-
if (typeof
|
|
214
|
+
if (typeof p.cartId != "string")
|
|
157
215
|
throw new Error(`${d}.cartId must be a string`);
|
|
158
|
-
if (typeof
|
|
216
|
+
if (typeof p.productName != "string")
|
|
159
217
|
throw new Error(`${d}.productName must be a string`);
|
|
160
218
|
}
|
|
161
|
-
if ("items" in
|
|
162
|
-
const
|
|
163
|
-
if (!
|
|
219
|
+
if ("items" in r) {
|
|
220
|
+
const p = r, { cartId: u, cartName: d, currencyCode: y, items: w } = p;
|
|
221
|
+
if (!u || typeof u != "string")
|
|
164
222
|
throw new Error("quoteRequestData.cartId must be a string");
|
|
165
223
|
if (!d || typeof d != "string")
|
|
166
224
|
throw new Error("quoteRequestData.cartName must be a string");
|
|
@@ -180,31 +238,31 @@ function N(m) {
|
|
|
180
238
|
"productId",
|
|
181
239
|
"productName"
|
|
182
240
|
];
|
|
183
|
-
w.forEach((v,
|
|
241
|
+
w.forEach((v, x) => {
|
|
184
242
|
if (!v || typeof v != "object")
|
|
185
|
-
throw new Error(`quoteRequestData.items[${
|
|
186
|
-
const _ = `quoteRequestData.items[${
|
|
243
|
+
throw new Error(`quoteRequestData.items[${x}] must be a non-null object`);
|
|
244
|
+
const _ = `quoteRequestData.items[${x}]`;
|
|
187
245
|
C.forEach((E) => {
|
|
188
246
|
if (!Object.prototype.hasOwnProperty.call(v, E) || v[E] === void 0 || v[E] === null)
|
|
189
247
|
throw new Error(`Missing required ${_} field: '${E}'`);
|
|
190
248
|
});
|
|
191
|
-
const
|
|
192
|
-
if (!
|
|
249
|
+
const D = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
250
|
+
if (!D.test(v.startDate))
|
|
193
251
|
throw new Error(`${_}.startDate must be a valid ISO8601 string`);
|
|
194
|
-
if (!
|
|
252
|
+
if (!D.test(v.endDate))
|
|
195
253
|
throw new Error(`${_}.endDate must be a valid ISO8601 string`);
|
|
196
254
|
if (typeof v.eventType != "string")
|
|
197
255
|
throw new Error(`${_}.eventType must be a string`);
|
|
198
256
|
if (typeof v.productType != "string")
|
|
199
257
|
throw new Error(`${_}.productType must be a string`);
|
|
200
|
-
const
|
|
201
|
-
if (!
|
|
202
|
-
throw new Error(`${_}.productType must be one of ${
|
|
258
|
+
const T = ["Pass", "Trip", "Registration"];
|
|
259
|
+
if (!T.includes(v.productType))
|
|
260
|
+
throw new Error(`${_}.productType must be one of ${T.join(", ")}`);
|
|
203
261
|
if (typeof v.productDuration != "string")
|
|
204
262
|
throw new Error(`${_}.productDuration must be a string`);
|
|
205
|
-
const
|
|
206
|
-
if (!
|
|
207
|
-
throw new Error(`${_}.productDuration must be one of ${
|
|
263
|
+
const S = ["Daily", "Seasonal", "Trip", "Event"];
|
|
264
|
+
if (!S.includes(v.productDuration))
|
|
265
|
+
throw new Error(`${_}.productDuration must be one of ${S.join(", ")}`);
|
|
208
266
|
if (typeof v.productPrice != "number" || isNaN(v.productPrice))
|
|
209
267
|
throw new Error(`${_}.productPrice must be a valid number`);
|
|
210
268
|
if (typeof v.productId != "string")
|
|
@@ -212,72 +270,74 @@ function N(m) {
|
|
|
212
270
|
if (typeof v.productName != "string")
|
|
213
271
|
throw new Error(`${_}.productName must be a string`);
|
|
214
272
|
});
|
|
215
|
-
} else if (Array.isArray(
|
|
216
|
-
if (
|
|
273
|
+
} else if (Array.isArray(r)) {
|
|
274
|
+
if (r.length === 0)
|
|
217
275
|
throw new Error("quoteRequestData array cannot be empty");
|
|
218
|
-
|
|
219
|
-
if (!
|
|
220
|
-
throw new Error(`quoteRequestData[${
|
|
221
|
-
g(
|
|
276
|
+
r.forEach((p, u) => {
|
|
277
|
+
if (!p || typeof p != "object")
|
|
278
|
+
throw new Error(`quoteRequestData[${u}] must be a non-null object`);
|
|
279
|
+
g(p, u);
|
|
222
280
|
});
|
|
223
281
|
} else
|
|
224
|
-
g(
|
|
282
|
+
g(r);
|
|
225
283
|
if ([
|
|
226
284
|
"onOptIn",
|
|
227
285
|
"onOptOut",
|
|
228
286
|
"onQuoteRetrieved",
|
|
229
287
|
"onError",
|
|
230
288
|
"noMatchingQuote"
|
|
231
|
-
].forEach((
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
234
|
-
throw new Error(`Callback '${
|
|
289
|
+
].forEach((p) => {
|
|
290
|
+
const u = s[p];
|
|
291
|
+
if (u && typeof u != "function")
|
|
292
|
+
throw new Error(`Callback '${p}' must be a function.`);
|
|
235
293
|
}), typeof i == "string" && !document.querySelector(i))
|
|
236
294
|
throw new Error(`Invalid location selector: '${i}'`);
|
|
237
|
-
if (
|
|
295
|
+
if (a && typeof a != "object")
|
|
238
296
|
throw new Error(
|
|
239
297
|
"Theme must be an object with CSS variables, do not include the '--' prefix"
|
|
240
298
|
);
|
|
299
|
+
if (c.state && !O.has(c.state))
|
|
300
|
+
throw new Error(`Invalid state: '${c.state}'. Must be a 2-character US state or territory code.`);
|
|
241
301
|
}
|
|
242
|
-
var b = /* @__PURE__ */ ((
|
|
243
|
-
function
|
|
244
|
-
const
|
|
245
|
-
return
|
|
302
|
+
var b = /* @__PURE__ */ ((c) => (c.YES = "yes", c.NO = "no", c.UNSELECTED = "unselected", c))(b || {});
|
|
303
|
+
function n(c, { text: t, className: r, parent: s, innerHTML: i, href: a, target: e } = {}) {
|
|
304
|
+
const o = document.createElement(c);
|
|
305
|
+
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
306
|
}
|
|
247
|
-
function
|
|
248
|
-
|
|
307
|
+
function R(c, { name: t, description: r }) {
|
|
308
|
+
n("div", {
|
|
249
309
|
className: "spot-header__title",
|
|
250
310
|
text: t,
|
|
251
|
-
parent:
|
|
252
|
-
}),
|
|
311
|
+
parent: c
|
|
312
|
+
}), n("div", {
|
|
253
313
|
className: "spot-header__description",
|
|
254
|
-
text:
|
|
255
|
-
parent:
|
|
314
|
+
text: r,
|
|
315
|
+
parent: c
|
|
256
316
|
});
|
|
257
317
|
}
|
|
258
|
-
function
|
|
259
|
-
const
|
|
318
|
+
function $(c, t = []) {
|
|
319
|
+
const r = n("ul", {
|
|
260
320
|
className: "spot-benefits__list",
|
|
261
|
-
parent:
|
|
321
|
+
parent: c
|
|
262
322
|
});
|
|
263
323
|
t.forEach((s) => {
|
|
264
|
-
const i =
|
|
324
|
+
const i = n("li", { parent: r });
|
|
265
325
|
i.innerHTML = `
|
|
266
326
|
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" class="spot-bullets__checkmark">
|
|
267
327
|
<path d="M11.6666 3.5L5.24998 9.91667L2.33331 7"
|
|
268
328
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
269
|
-
</svg>`,
|
|
329
|
+
</svg>`, n("span", { text: s, parent: i });
|
|
270
330
|
});
|
|
271
331
|
}
|
|
272
|
-
function
|
|
332
|
+
function V(c, t = []) {
|
|
273
333
|
if (!t || t.length === 0) return;
|
|
274
|
-
const
|
|
334
|
+
const r = n("div", {
|
|
275
335
|
className: "spot-qualifying-reasons__container",
|
|
276
|
-
parent:
|
|
277
|
-
}), s = [...t].sort((
|
|
336
|
+
parent: c
|
|
337
|
+
}), s = [...t].sort((o, l) => o.rank - l.rank), i = n("div", {
|
|
278
338
|
className: "spot-qualifying-reasons__grid",
|
|
279
|
-
parent:
|
|
280
|
-
}),
|
|
339
|
+
parent: r
|
|
340
|
+
}), a = {
|
|
281
341
|
"Accident & Illness": "cross.svg",
|
|
282
342
|
"Family Emergencies": "users.svg",
|
|
283
343
|
Layoffs: "building.svg",
|
|
@@ -287,101 +347,101 @@ function P(m, t = []) {
|
|
|
287
347
|
"Travel Interruption": "plane.svg",
|
|
288
348
|
"Military Duty": "medal.svg"
|
|
289
349
|
};
|
|
290
|
-
let
|
|
350
|
+
let e;
|
|
291
351
|
try {
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
295
|
-
|
|
352
|
+
const o = document.currentScript;
|
|
353
|
+
if (o != null && o.src) {
|
|
354
|
+
const l = new URL(o.src);
|
|
355
|
+
e = l.origin + l.pathname.replace(/\/[^/]*$/, "/");
|
|
296
356
|
} else
|
|
297
|
-
|
|
298
|
-
|
|
357
|
+
e = window.location.origin + window.location.pathname.replace(/\/[^/]*$/, "/");
|
|
358
|
+
e += "assets/";
|
|
299
359
|
} catch {
|
|
300
|
-
|
|
360
|
+
e = "./assets/";
|
|
301
361
|
}
|
|
302
|
-
s.forEach((
|
|
303
|
-
var g, h,
|
|
304
|
-
const
|
|
362
|
+
s.forEach((o) => {
|
|
363
|
+
var g, h, p;
|
|
364
|
+
const l = n("div", {
|
|
305
365
|
className: "spot-qualifying-reasons__item",
|
|
306
366
|
parent: i
|
|
307
|
-
}),
|
|
367
|
+
}), m = n("div", {
|
|
308
368
|
className: "spot-qualifying-reasons__icon-wrapper",
|
|
309
|
-
parent:
|
|
310
|
-
}), f =
|
|
369
|
+
parent: l
|
|
370
|
+
}), f = a[((g = o.benefitType) == null ? void 0 : g.name) || ""] || a[o.name || ""];
|
|
311
371
|
if (f) {
|
|
312
|
-
const
|
|
313
|
-
parent:
|
|
372
|
+
const u = n("img", {
|
|
373
|
+
parent: m
|
|
314
374
|
});
|
|
315
|
-
|
|
375
|
+
u.src = e + f, u.alt = ((h = o.benefitType) == null ? void 0 : h.name) || o.name || "", u.className = "spot-qualifying-reasons__icon";
|
|
316
376
|
}
|
|
317
|
-
|
|
377
|
+
n("span", {
|
|
318
378
|
className: "spot-qualifying-reasons__label",
|
|
319
|
-
text: ((
|
|
320
|
-
parent:
|
|
379
|
+
text: ((p = o.benefitType) == null ? void 0 : p.name) || o.name || "",
|
|
380
|
+
parent: l
|
|
321
381
|
});
|
|
322
382
|
});
|
|
323
383
|
}
|
|
324
|
-
function
|
|
325
|
-
if (t.length === 0 || !
|
|
384
|
+
function Q(c, t = [], r) {
|
|
385
|
+
if (t.length === 0 || !r || r <= 1)
|
|
326
386
|
return;
|
|
327
387
|
const s = /* @__PURE__ */ new Map();
|
|
328
|
-
t.forEach((
|
|
329
|
-
s.set(
|
|
388
|
+
t.forEach((u) => {
|
|
389
|
+
s.set(u, (s.get(u) || 0) + 1);
|
|
330
390
|
});
|
|
331
|
-
const
|
|
332
|
-
([
|
|
333
|
-
item:
|
|
391
|
+
const a = Array.from(s.entries()).map(
|
|
392
|
+
([u, d]) => ({
|
|
393
|
+
item: u,
|
|
334
394
|
count: d,
|
|
335
|
-
displayText: d > 1 ? `${d} x ${
|
|
395
|
+
displayText: d > 1 ? `${d} x ${u}` : u
|
|
336
396
|
})
|
|
337
|
-
).sort((
|
|
338
|
-
const y =
|
|
339
|
-
return !q && C ? -1 : q && !C ? 1 :
|
|
340
|
-
}),
|
|
397
|
+
).sort((u, d) => {
|
|
398
|
+
const y = u.item.charAt(0), w = d.item.charAt(0), q = /[a-zA-Z]/.test(y), C = /[a-zA-Z]/.test(w);
|
|
399
|
+
return !q && C ? -1 : q && !C ? 1 : u.item.localeCompare(d.item, void 0, { sensitivity: "base" });
|
|
400
|
+
}), e = n("div", {
|
|
341
401
|
className: "spot-covered-items__container",
|
|
342
|
-
parent:
|
|
343
|
-
}),
|
|
402
|
+
parent: c
|
|
403
|
+
}), o = n("div", {
|
|
344
404
|
className: "spot-covered-items__header",
|
|
345
|
-
parent: n
|
|
346
|
-
}), p = a("button", {
|
|
347
|
-
className: "spot-covered-items__toggle",
|
|
348
405
|
parent: e
|
|
406
|
+
}), l = n("button", {
|
|
407
|
+
className: "spot-covered-items__toggle",
|
|
408
|
+
parent: o
|
|
349
409
|
});
|
|
350
|
-
|
|
410
|
+
n("span", {
|
|
351
411
|
className: "spot-covered-items__title",
|
|
352
412
|
text: `Items Covered in Your Cart (${t.length})`,
|
|
353
|
-
parent:
|
|
413
|
+
parent: l
|
|
354
414
|
});
|
|
355
|
-
const
|
|
415
|
+
const m = n("div", {
|
|
356
416
|
className: "spot-covered-items__right-section",
|
|
357
|
-
parent:
|
|
417
|
+
parent: l
|
|
358
418
|
});
|
|
359
|
-
|
|
419
|
+
n("span", {
|
|
360
420
|
className: "spot-covered-items__view-all",
|
|
361
421
|
text: "View All",
|
|
362
|
-
parent:
|
|
422
|
+
parent: m
|
|
363
423
|
});
|
|
364
|
-
const f =
|
|
424
|
+
const f = n("span", {
|
|
365
425
|
className: "spot-covered-items__arrow",
|
|
366
426
|
innerHTML: "▼",
|
|
367
|
-
parent:
|
|
368
|
-
}), g =
|
|
427
|
+
parent: m
|
|
428
|
+
}), g = n("div", {
|
|
369
429
|
className: "spot-covered-items__content",
|
|
370
|
-
parent:
|
|
371
|
-
}), h =
|
|
430
|
+
parent: e
|
|
431
|
+
}), h = n("ul", {
|
|
372
432
|
className: "spot-covered-items__list",
|
|
373
433
|
parent: g
|
|
374
434
|
});
|
|
375
|
-
|
|
376
|
-
const d =
|
|
377
|
-
|
|
435
|
+
a.forEach(({ displayText: u }) => {
|
|
436
|
+
const d = n("li", { parent: h });
|
|
437
|
+
n("span", { text: u, parent: d });
|
|
378
438
|
});
|
|
379
|
-
let
|
|
380
|
-
g.style.display = "none",
|
|
381
|
-
|
|
382
|
-
}),
|
|
439
|
+
let p = !1;
|
|
440
|
+
g.style.display = "none", l.addEventListener("click", (u) => {
|
|
441
|
+
u.stopPropagation(), p = !p, g.style.display = p ? "block" : "none", f.innerHTML = p ? "▲" : "▼", l.setAttribute("aria-expanded", p.toString());
|
|
442
|
+
}), l.setAttribute("aria-expanded", "false"), l.setAttribute("aria-controls", "covered-items-list"), g.setAttribute("id", "covered-items-list");
|
|
383
443
|
}
|
|
384
|
-
const
|
|
444
|
+
const U = {
|
|
385
445
|
USD: "$",
|
|
386
446
|
CAD: "CAD $",
|
|
387
447
|
AUD: "AUD $",
|
|
@@ -393,68 +453,100 @@ const R = {
|
|
|
393
453
|
MAD: "MAD ",
|
|
394
454
|
SAR: "SAR "
|
|
395
455
|
};
|
|
396
|
-
function
|
|
397
|
-
const s =
|
|
456
|
+
function Z(c, t = [], r = "USD") {
|
|
457
|
+
const s = U[r] ?? `${r} `, i = n("div", {
|
|
398
458
|
className: "spot-table__container",
|
|
399
|
-
parent:
|
|
400
|
-
}),
|
|
459
|
+
parent: c
|
|
460
|
+
}), a = n("table", {
|
|
401
461
|
className: "spot-refund__table spot-table--dynamic",
|
|
402
462
|
parent: i
|
|
403
|
-
}),
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
t.forEach(({ text:
|
|
407
|
-
const h =
|
|
408
|
-
|
|
409
|
-
const
|
|
410
|
-
|
|
463
|
+
}), e = n("thead", { parent: a }), o = n("tr", { parent: e });
|
|
464
|
+
n("th", { text: "When you cancel", parent: o }), n("th", { text: "You will receive", parent: o });
|
|
465
|
+
const l = n("tbody", { parent: a });
|
|
466
|
+
t.forEach(({ text: m, percent: f, amount: g }) => {
|
|
467
|
+
const h = n("tr", { parent: l });
|
|
468
|
+
n("td", { text: m, parent: h });
|
|
469
|
+
const p = f === "Not eligible for refund" ? "Not eligible for a refund" : `${s}${g} refund`;
|
|
470
|
+
n("td", { text: p, parent: h });
|
|
411
471
|
});
|
|
412
472
|
}
|
|
413
|
-
function
|
|
414
|
-
const
|
|
415
|
-
className: "spot-
|
|
416
|
-
parent:
|
|
417
|
-
})
|
|
418
|
-
|
|
473
|
+
function B(c, t) {
|
|
474
|
+
const r = n("div", {
|
|
475
|
+
className: "spot-state-dropdown__wrapper",
|
|
476
|
+
parent: c
|
|
477
|
+
});
|
|
478
|
+
n("label", {
|
|
479
|
+
className: "spot-state-dropdown__label",
|
|
480
|
+
text: "State of Residence",
|
|
481
|
+
parent: r
|
|
482
|
+
});
|
|
483
|
+
const s = n("select", {
|
|
484
|
+
className: "spot-state-dropdown__select",
|
|
485
|
+
parent: r
|
|
486
|
+
});
|
|
487
|
+
s.setAttribute("aria-label", "State of Residence");
|
|
488
|
+
const i = n("option", {
|
|
489
|
+
text: "Select a state...",
|
|
490
|
+
parent: s
|
|
491
|
+
});
|
|
492
|
+
i.value = "", i.selected = !t, z.forEach(({ value: e, label: o }) => {
|
|
493
|
+
const l = n("option", { text: o, parent: s });
|
|
494
|
+
l.value = e, e === t && (l.selected = !0);
|
|
495
|
+
});
|
|
496
|
+
const a = n("option", {
|
|
497
|
+
text: "Not a US Resident",
|
|
419
498
|
parent: s
|
|
420
|
-
})
|
|
421
|
-
|
|
422
|
-
|
|
499
|
+
});
|
|
500
|
+
return a.value = k, t === k && (a.selected = !0), s;
|
|
501
|
+
}
|
|
502
|
+
function j(c, t, r, s = !1) {
|
|
503
|
+
const i = n("div", {
|
|
504
|
+
className: `spot-selection__options${s ? " spot-selection__options--disabled" : ""}`,
|
|
505
|
+
parent: c
|
|
506
|
+
}), a = n("label", {
|
|
507
|
+
className: `spot-selection__option ${t === b.YES ? "selected" : ""}`,
|
|
423
508
|
parent: i
|
|
424
|
-
}),
|
|
509
|
+
}), e = n("input", { parent: a });
|
|
510
|
+
e.type = "radio", e.name = "selection", e.value = b.YES, t === b.YES && (e.checked = !0), s && (e.disabled = !0), n("strong", {
|
|
511
|
+
text: r.yesOptionText,
|
|
512
|
+
parent: a
|
|
513
|
+
}), n("span", {
|
|
425
514
|
className: "spot-selection__recommended-tag",
|
|
426
515
|
text: "Recommended",
|
|
427
|
-
parent:
|
|
516
|
+
parent: a
|
|
428
517
|
});
|
|
429
|
-
const
|
|
518
|
+
const o = n("label", {
|
|
430
519
|
className: `spot-selection__option ${t === b.NO ? "selected" : ""}`,
|
|
431
|
-
parent:
|
|
432
|
-
}),
|
|
433
|
-
return
|
|
520
|
+
parent: i
|
|
521
|
+
}), l = n("input", { parent: o });
|
|
522
|
+
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
523
|
}
|
|
435
|
-
function
|
|
436
|
-
var
|
|
437
|
-
const
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
524
|
+
function H(c, t) {
|
|
525
|
+
var s;
|
|
526
|
+
const r = (s = t.communication) == null ? void 0 : s.paymentTerms;
|
|
527
|
+
if (r) {
|
|
528
|
+
const i = n("div", {
|
|
529
|
+
className: "spot-payment-terms",
|
|
530
|
+
parent: c
|
|
531
|
+
});
|
|
532
|
+
return n("div", {
|
|
533
|
+
className: "spot-payment-terms__header",
|
|
534
|
+
text: "PAYMENT TERMS",
|
|
535
|
+
parent: i
|
|
536
|
+
}), n("div", {
|
|
537
|
+
className: "spot-payment-terms__body",
|
|
538
|
+
text: r || "",
|
|
539
|
+
parent: i
|
|
540
|
+
}), i;
|
|
541
|
+
}
|
|
450
542
|
}
|
|
451
|
-
function
|
|
452
|
-
if (
|
|
453
|
-
const
|
|
543
|
+
function F(c, t, r = "bottom-right") {
|
|
544
|
+
if (r === "top-right") {
|
|
545
|
+
const o = n("div", {
|
|
454
546
|
className: "spot-logo__top-right",
|
|
455
|
-
parent:
|
|
547
|
+
parent: c
|
|
456
548
|
});
|
|
457
|
-
|
|
549
|
+
o.innerHTML = `
|
|
458
550
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
459
551
|
<rect width="145" height="28"/>
|
|
460
552
|
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
|
@@ -471,25 +563,25 @@ function Z(m, t, o = "bottom-right") {
|
|
|
471
563
|
</defs>
|
|
472
564
|
</svg>`;
|
|
473
565
|
}
|
|
474
|
-
const s =
|
|
566
|
+
const s = n("div", {
|
|
475
567
|
className: "spot-footer__container",
|
|
476
|
-
parent:
|
|
477
|
-
}), i =
|
|
568
|
+
parent: c
|
|
569
|
+
}), i = n("div", {
|
|
478
570
|
className: "spot-footer__terms",
|
|
479
571
|
parent: s
|
|
480
|
-
}),
|
|
572
|
+
}), a = `<a href="${t.communication.termsAndConditionsUrl}" target="_blank" class="spot-footer__terms-link">Terms & Conditions</a>`, e = t.communication.legalDisclaimer.replace(
|
|
481
573
|
/terms (and|&) conditions/gi,
|
|
482
|
-
|
|
574
|
+
a
|
|
483
575
|
);
|
|
484
|
-
if (
|
|
485
|
-
innerHTML:
|
|
576
|
+
if (n("span", {
|
|
577
|
+
innerHTML: e,
|
|
486
578
|
parent: i
|
|
487
|
-
}),
|
|
488
|
-
const
|
|
579
|
+
}), r === "bottom-right") {
|
|
580
|
+
const o = n("p", {
|
|
489
581
|
className: "spot-footer__powered-by",
|
|
490
582
|
parent: s
|
|
491
583
|
});
|
|
492
|
-
|
|
584
|
+
o.innerHTML = `
|
|
493
585
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
494
586
|
<rect width="145" height="28"/>
|
|
495
587
|
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
|
@@ -508,18 +600,18 @@ function Z(m, t, o = "bottom-right") {
|
|
|
508
600
|
}
|
|
509
601
|
return s;
|
|
510
602
|
}
|
|
511
|
-
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)}}";
|
|
512
|
-
function
|
|
603
|
+
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)}}";
|
|
604
|
+
function Y(c) {
|
|
513
605
|
const t = document.createElement("style");
|
|
514
|
-
t.textContent =
|
|
606
|
+
t.textContent = c, document.head.appendChild(t);
|
|
515
607
|
}
|
|
516
|
-
|
|
517
|
-
const
|
|
608
|
+
Y(W);
|
|
609
|
+
const A = {
|
|
518
610
|
sandbox: "https://api.sandbox.getspot.com/api/v1/quote",
|
|
519
611
|
production: "https://api.getspot.com/api/v1/quote",
|
|
520
612
|
local: "http://localhost:3999/api/v1/quote"
|
|
521
613
|
};
|
|
522
|
-
class
|
|
614
|
+
class G {
|
|
523
615
|
constructor(t = {}) {
|
|
524
616
|
this.options = {
|
|
525
617
|
location: "body",
|
|
@@ -534,98 +626,107 @@ class j {
|
|
|
534
626
|
}, 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();
|
|
535
627
|
}
|
|
536
628
|
async _init() {
|
|
537
|
-
var t,
|
|
629
|
+
var t, r, s, i, a;
|
|
538
630
|
try {
|
|
539
|
-
|
|
540
|
-
let
|
|
631
|
+
M(this.options), this.currentState = this.options.state;
|
|
632
|
+
let e;
|
|
541
633
|
if (this.options.useMockData && this.options.mockData)
|
|
542
|
-
|
|
634
|
+
e = this.options.mockData;
|
|
543
635
|
else {
|
|
544
|
-
const { environment:
|
|
545
|
-
|
|
636
|
+
const { environment: o, partnerId: l } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || A[o];
|
|
637
|
+
e = "items" in this.options.quoteRequestData ? await I(
|
|
546
638
|
f,
|
|
547
|
-
|
|
548
|
-
this.options.quoteRequestData
|
|
549
|
-
|
|
639
|
+
l,
|
|
640
|
+
this.options.quoteRequestData,
|
|
641
|
+
this._validState()
|
|
642
|
+
) : await N(
|
|
550
643
|
f,
|
|
551
|
-
|
|
552
|
-
this.options.quoteRequestData
|
|
644
|
+
l,
|
|
645
|
+
this.options.quoteRequestData,
|
|
646
|
+
this._validState()
|
|
553
647
|
);
|
|
554
648
|
}
|
|
555
|
-
if (
|
|
556
|
-
|
|
649
|
+
if (e.status !== "QUOTE_AVAILABLE") {
|
|
650
|
+
e.status === "NO_MATCHING_QUOTE" && ((t = this.options.callbacks) != null && t.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
|
|
557
651
|
status: "NO_MATCHING_QUOTE",
|
|
558
652
|
data: this.options.quoteRequestData
|
|
559
653
|
});
|
|
560
654
|
return;
|
|
561
655
|
}
|
|
562
|
-
if (this.quote =
|
|
656
|
+
if (this.quote = e.data, !this.quote)
|
|
563
657
|
throw new Error("No quote data in response");
|
|
564
|
-
if (this._renderWidget(), this.options.selection === b.YES && ((
|
|
565
|
-
const
|
|
658
|
+
if (this._renderWidget(), this.options.selection === b.YES && ((r = this.options.callbacks) != null && r.onOptIn)) {
|
|
659
|
+
const o = {
|
|
566
660
|
status: "QUOTE_ACCEPTED",
|
|
567
661
|
spotPrice: this.quote.spotPrice,
|
|
568
|
-
quoteId: this.quote.id
|
|
662
|
+
quoteId: this.quote.id,
|
|
663
|
+
state: this._validState()
|
|
569
664
|
};
|
|
570
665
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
571
|
-
const
|
|
572
|
-
|
|
666
|
+
const l = this.options.quoteRequestData;
|
|
667
|
+
o.batchQuoteDetails = this.quote.originalQuotes.map((m) => {
|
|
573
668
|
var g;
|
|
574
|
-
const f = (g =
|
|
575
|
-
(h) => (h.cartItemId || `item-${
|
|
669
|
+
const f = (g = l.items) == null ? void 0 : g.find(
|
|
670
|
+
(h) => (h.cartItemId || `item-${l.items.indexOf(h) + 1}`) === m.cartItemId
|
|
576
671
|
);
|
|
577
672
|
return {
|
|
578
|
-
quoteId:
|
|
579
|
-
productPrice: (f == null ? void 0 : f.productPrice) ||
|
|
673
|
+
quoteId: m.id,
|
|
674
|
+
productPrice: (f == null ? void 0 : f.productPrice) || m.spotPrice,
|
|
580
675
|
cartItemId: (f == null ? void 0 : f.cartItemId) || ""
|
|
581
676
|
};
|
|
582
677
|
});
|
|
583
678
|
}
|
|
584
|
-
this.options.callbacks.onOptIn(
|
|
679
|
+
this.options.callbacks.onOptIn(o);
|
|
585
680
|
}
|
|
586
681
|
if ((s = this.options.callbacks) != null && s.onQuoteRetrieved) {
|
|
587
|
-
const
|
|
588
|
-
|
|
682
|
+
const o = this.options.callbacks.onQuoteRetrieved(this.quote);
|
|
683
|
+
o && this._applyQuoteUpdates(o);
|
|
589
684
|
}
|
|
590
|
-
} catch (
|
|
685
|
+
} catch (e) {
|
|
591
686
|
if ((i = this.options.callbacks) != null && i.onError) {
|
|
592
|
-
const
|
|
593
|
-
(
|
|
594
|
-
message:
|
|
595
|
-
status:
|
|
596
|
-
responseBody:
|
|
687
|
+
const o = e;
|
|
688
|
+
(a = this.options.callbacks) == null || a.onError({
|
|
689
|
+
message: o.message,
|
|
690
|
+
status: o.status,
|
|
691
|
+
responseBody: o.responseBody
|
|
597
692
|
});
|
|
598
693
|
}
|
|
599
694
|
}
|
|
600
695
|
}
|
|
601
696
|
_renderWidget() {
|
|
602
697
|
if (!this.quote) return;
|
|
603
|
-
this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([
|
|
604
|
-
const
|
|
605
|
-
this.container.style.setProperty(
|
|
606
|
-
}),
|
|
698
|
+
this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([e, o]) => {
|
|
699
|
+
const l = `--${e}`;
|
|
700
|
+
this.container.style.setProperty(l, o);
|
|
701
|
+
}), R(this.container, this.quote.communication);
|
|
607
702
|
const t = document.createElement("div");
|
|
608
|
-
if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ?
|
|
609
|
-
const
|
|
610
|
-
|
|
703
|
+
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) {
|
|
704
|
+
const e = this._getTotalItemsInRequest();
|
|
705
|
+
Q(t, this.quote.coveredItems, e);
|
|
611
706
|
}
|
|
612
|
-
this.options.showTable && !this.quote.qualifyingReasons &&
|
|
613
|
-
const
|
|
614
|
-
|
|
707
|
+
this.options.showTable && !this.quote.qualifyingReasons && Z(t, this.quote.payoutSchedule, this.quote.currencyCode);
|
|
708
|
+
const r = n("div", {
|
|
709
|
+
className: "spot-selection__wrapper",
|
|
710
|
+
parent: t
|
|
711
|
+
});
|
|
712
|
+
this._isPassOrTrip() && !this.options.state && (this._stateSelectEl = B(r, this.currentState));
|
|
713
|
+
const i = !this._isQuotingAvailable(), a = j(
|
|
714
|
+
r,
|
|
615
715
|
this.options.selection,
|
|
616
|
-
this.quote.communication
|
|
716
|
+
this.quote.communication,
|
|
717
|
+
i
|
|
617
718
|
);
|
|
618
|
-
|
|
719
|
+
this.paymentTermsEl = n("div", {
|
|
619
720
|
className: "spot-payment-terms__wrapper",
|
|
620
721
|
parent: t
|
|
621
|
-
}), this.currentSelection === b.YES &&
|
|
722
|
+
}), 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();
|
|
622
723
|
}
|
|
623
724
|
_updateLayout() {
|
|
624
725
|
if (!this.container || !this.quote) return;
|
|
625
726
|
const t = this.container.querySelector(
|
|
626
727
|
".spot-content__wrapper"
|
|
627
|
-
),
|
|
628
|
-
if (!t || !
|
|
728
|
+
), r = this.options.showTable && !this.quote.qualifyingReasons;
|
|
729
|
+
if (!t || !r) {
|
|
629
730
|
t == null || t.classList.remove("desktop-layout");
|
|
630
731
|
return;
|
|
631
732
|
}
|
|
@@ -633,19 +734,19 @@ class j {
|
|
|
633
734
|
t.classList.toggle("desktop-layout", s);
|
|
634
735
|
}
|
|
635
736
|
_shouldUseDesktopLayout(t) {
|
|
636
|
-
const
|
|
637
|
-
if (
|
|
737
|
+
const r = this.container.offsetWidth - 40, s = 325, i = 16;
|
|
738
|
+
if (r >= 900)
|
|
638
739
|
return !0;
|
|
639
|
-
if (
|
|
640
|
-
const
|
|
740
|
+
if (r >= 650) {
|
|
741
|
+
const a = t.classList.contains("desktop-layout");
|
|
641
742
|
t.classList.remove("desktop-layout"), t.offsetHeight;
|
|
642
|
-
const
|
|
743
|
+
const e = t.querySelector(
|
|
643
744
|
".spot-benefits__list, .spot-qualifying-reasons__container"
|
|
644
745
|
);
|
|
645
|
-
if (!
|
|
646
|
-
return
|
|
647
|
-
const
|
|
648
|
-
return
|
|
746
|
+
if (!e)
|
|
747
|
+
return a && t.classList.add("desktop-layout"), a;
|
|
748
|
+
const l = Math.min(e.scrollWidth, 400) + s + i;
|
|
749
|
+
return a && t.classList.add("desktop-layout"), r >= l;
|
|
649
750
|
}
|
|
650
751
|
return !1;
|
|
651
752
|
}
|
|
@@ -665,31 +766,66 @@ class j {
|
|
|
665
766
|
`$${t.spotPriceWithFees.toFixed(2)}`
|
|
666
767
|
)), this.destroy(), this._renderWidget());
|
|
667
768
|
}
|
|
769
|
+
_isPassOrTrip() {
|
|
770
|
+
const t = this.options.quoteRequestData;
|
|
771
|
+
if (Array.isArray(t))
|
|
772
|
+
return t.some((s) => s.productType === "Pass" || s.productType === "Trip");
|
|
773
|
+
if ("items" in t)
|
|
774
|
+
return t.items.some(
|
|
775
|
+
(s) => s.productType === "Pass" || s.productType === "Trip"
|
|
776
|
+
);
|
|
777
|
+
const r = t;
|
|
778
|
+
return r.productType === "Pass" || r.productType === "Trip";
|
|
779
|
+
}
|
|
780
|
+
_validState() {
|
|
781
|
+
if (this._isPassOrTrip() && !(!this.currentState || this.currentState === k))
|
|
782
|
+
return this.currentState;
|
|
783
|
+
}
|
|
784
|
+
_isQuotingAvailable() {
|
|
785
|
+
return !this._isPassOrTrip() || this.options.state ? !0 : !!this.currentState && this.currentState !== k;
|
|
786
|
+
}
|
|
787
|
+
_setRadiosDisabled(t) {
|
|
788
|
+
var i, a, e;
|
|
789
|
+
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");
|
|
790
|
+
r == null || r.forEach((o) => {
|
|
791
|
+
o.disabled = t;
|
|
792
|
+
}), s == null || s.classList.toggle("spot-selection__options--disabled", t), t && (r == null || r.forEach((o) => {
|
|
793
|
+
o.checked = !1;
|
|
794
|
+
}), (e = this.container) == null || e.querySelectorAll(".spot-selection__option").forEach((o) => {
|
|
795
|
+
o.classList.remove("selected");
|
|
796
|
+
}), this.currentSelection = b.UNSELECTED, this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""));
|
|
797
|
+
}
|
|
798
|
+
_setupStateDropdownListener() {
|
|
799
|
+
this._stateSelectEl && this._stateSelectEl.addEventListener("change", () => {
|
|
800
|
+
this.currentState = this._stateSelectEl.value, this._setRadiosDisabled(!this._isQuotingAvailable());
|
|
801
|
+
});
|
|
802
|
+
}
|
|
668
803
|
_setupOptionListeners(t) {
|
|
669
|
-
const
|
|
804
|
+
const r = t.querySelectorAll(
|
|
670
805
|
'input[type="radio"]'
|
|
671
806
|
), s = t.querySelectorAll(".spot-selection__option");
|
|
672
|
-
|
|
673
|
-
i.addEventListener("change", (
|
|
674
|
-
var
|
|
675
|
-
const
|
|
676
|
-
if (this.hideSelectionError(), this.currentSelection =
|
|
807
|
+
r.forEach((i) => {
|
|
808
|
+
i.addEventListener("change", (a) => {
|
|
809
|
+
var l, m, f, g;
|
|
810
|
+
const e = a.target, o = e.value;
|
|
811
|
+
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)) {
|
|
677
812
|
const h = {
|
|
678
813
|
status: "QUOTE_ACCEPTED",
|
|
679
814
|
spotPrice: this.quote.spotPrice,
|
|
680
|
-
quoteId: this.quote.id
|
|
815
|
+
quoteId: this.quote.id,
|
|
816
|
+
state: this._validState()
|
|
681
817
|
};
|
|
682
818
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
683
|
-
const
|
|
819
|
+
const p = this.options.quoteRequestData;
|
|
684
820
|
h.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
685
|
-
(
|
|
821
|
+
(u) => {
|
|
686
822
|
var y;
|
|
687
|
-
const d = (y =
|
|
688
|
-
(w) => (w.cartItemId || `item-${
|
|
823
|
+
const d = (y = p.items) == null ? void 0 : y.find(
|
|
824
|
+
(w) => (w.cartItemId || `item-${p.items.indexOf(w) + 1}`) === u.cartItemId
|
|
689
825
|
);
|
|
690
826
|
return {
|
|
691
|
-
quoteId:
|
|
692
|
-
productPrice: (d == null ? void 0 : d.productPrice) ||
|
|
827
|
+
quoteId: u.id,
|
|
828
|
+
productPrice: (d == null ? void 0 : d.productPrice) || u.spotPrice,
|
|
693
829
|
cartItemId: (d == null ? void 0 : d.cartItemId) || ""
|
|
694
830
|
};
|
|
695
831
|
}
|
|
@@ -697,22 +833,23 @@ class j {
|
|
|
697
833
|
}
|
|
698
834
|
this.options.callbacks.onOptIn(h);
|
|
699
835
|
}
|
|
700
|
-
if (
|
|
836
|
+
if (o === b.NO && ((g = this.options.callbacks) != null && g.onOptOut)) {
|
|
701
837
|
const h = {
|
|
702
838
|
status: "QUOTE_DECLINED",
|
|
703
|
-
quoteId: this.quote.id
|
|
839
|
+
quoteId: this.quote.id,
|
|
840
|
+
state: this._validState()
|
|
704
841
|
};
|
|
705
842
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
706
|
-
const
|
|
843
|
+
const p = this.options.quoteRequestData;
|
|
707
844
|
h.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
708
|
-
(
|
|
845
|
+
(u) => {
|
|
709
846
|
var y;
|
|
710
|
-
const d = (y =
|
|
711
|
-
(w) => (w.cartItemId || `item-${
|
|
847
|
+
const d = (y = p.items) == null ? void 0 : y.find(
|
|
848
|
+
(w) => (w.cartItemId || `item-${p.items.indexOf(w) + 1}`) === u.cartItemId
|
|
712
849
|
);
|
|
713
850
|
return {
|
|
714
|
-
quoteId:
|
|
715
|
-
productPrice: (d == null ? void 0 : d.productPrice) ||
|
|
851
|
+
quoteId: u.id,
|
|
852
|
+
productPrice: (d == null ? void 0 : d.productPrice) || u.spotPrice,
|
|
716
853
|
cartItemId: (d == null ? void 0 : d.cartItemId) || ""
|
|
717
854
|
};
|
|
718
855
|
}
|
|
@@ -727,10 +864,10 @@ class j {
|
|
|
727
864
|
var t;
|
|
728
865
|
if (!this.errorEl) {
|
|
729
866
|
this.errorEl = document.createElement("div"), this.errorEl.className = "spot-selection__error", this.errorEl.textContent = "Please make a selection";
|
|
730
|
-
const
|
|
867
|
+
const r = (t = this.container) == null ? void 0 : t.querySelector(
|
|
731
868
|
".spot-selection__options"
|
|
732
869
|
);
|
|
733
|
-
|
|
870
|
+
r && r.insertAdjacentElement("afterend", this.errorEl);
|
|
734
871
|
}
|
|
735
872
|
this.errorEl.style.display = "block";
|
|
736
873
|
}
|
|
@@ -745,61 +882,64 @@ class j {
|
|
|
745
882
|
return t ? this.hideSelectionError() : this.showSelectionError(), t;
|
|
746
883
|
}
|
|
747
884
|
async updateQuote(t) {
|
|
748
|
-
var
|
|
885
|
+
var r, s, i, a;
|
|
749
886
|
try {
|
|
750
|
-
const
|
|
887
|
+
const e = {
|
|
751
888
|
...this.options,
|
|
752
889
|
quoteRequestData: t
|
|
753
890
|
};
|
|
754
|
-
|
|
755
|
-
const { environment:
|
|
891
|
+
M(e);
|
|
892
|
+
const { environment: o, partnerId: l, customEndpoint: m } = this.options.apiConfig, f = m || A[o], h = "items" in e.quoteRequestData ? await I(
|
|
756
893
|
f,
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
894
|
+
l,
|
|
895
|
+
e.quoteRequestData,
|
|
896
|
+
this._validState()
|
|
897
|
+
) : await N(
|
|
760
898
|
f,
|
|
761
|
-
|
|
762
|
-
|
|
899
|
+
l,
|
|
900
|
+
e.quoteRequestData,
|
|
901
|
+
this._validState()
|
|
763
902
|
);
|
|
764
903
|
if (h.status !== "QUOTE_AVAILABLE")
|
|
765
|
-
return this.destroy(), h.status === "NO_MATCHING_QUOTE" && ((
|
|
904
|
+
return this.destroy(), h.status === "NO_MATCHING_QUOTE" && ((r = this.options.callbacks) != null && r.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
|
|
766
905
|
status: "NO_MATCHING_QUOTE",
|
|
767
|
-
data:
|
|
906
|
+
data: e.quoteRequestData
|
|
768
907
|
}), !1;
|
|
769
|
-
if (this.options.quoteRequestData =
|
|
770
|
-
const
|
|
771
|
-
|
|
908
|
+
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) {
|
|
909
|
+
const p = this.options.callbacks.onQuoteRetrieved(this.quote);
|
|
910
|
+
p && this._applyQuoteUpdates(p);
|
|
772
911
|
}
|
|
773
912
|
return !0;
|
|
774
|
-
} catch (
|
|
775
|
-
const
|
|
776
|
-
return (
|
|
777
|
-
message:
|
|
778
|
-
status:
|
|
779
|
-
responseBody:
|
|
913
|
+
} catch (e) {
|
|
914
|
+
const o = e;
|
|
915
|
+
return (a = (i = this.options.callbacks) == null ? void 0 : i.onError) == null || a.call(i, {
|
|
916
|
+
message: o.message,
|
|
917
|
+
status: o.status,
|
|
918
|
+
responseBody: o.responseBody
|
|
780
919
|
}), !1;
|
|
781
920
|
}
|
|
782
921
|
}
|
|
783
922
|
getSelection() {
|
|
784
|
-
var
|
|
923
|
+
var r, s, i;
|
|
785
924
|
if (this.currentSelection == null || this.currentSelection == b.UNSELECTED) return null;
|
|
786
925
|
const t = {
|
|
787
926
|
selection: this.currentSelection,
|
|
788
|
-
quoteId: (
|
|
927
|
+
quoteId: (r = this.quote) == null ? void 0 : r.id,
|
|
789
928
|
spotPrice: (s = this.quote) == null ? void 0 : s.spotPrice,
|
|
790
|
-
status: this.currentSelection === b.YES ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED"
|
|
929
|
+
status: this.currentSelection === b.YES ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED",
|
|
930
|
+
state: this.currentState
|
|
791
931
|
};
|
|
792
932
|
if ((i = this.quote) != null && i.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
793
|
-
const
|
|
794
|
-
t.batchQuoteDetails = this.quote.originalQuotes.map((
|
|
795
|
-
var
|
|
796
|
-
const
|
|
797
|
-
(
|
|
933
|
+
const a = this.options.quoteRequestData;
|
|
934
|
+
t.batchQuoteDetails = this.quote.originalQuotes.map((e) => {
|
|
935
|
+
var l;
|
|
936
|
+
const o = (l = a.items) == null ? void 0 : l.find(
|
|
937
|
+
(m) => (m.cartItemId || `item-${a.items.indexOf(m) + 1}`) === e.cartItemId
|
|
798
938
|
);
|
|
799
939
|
return {
|
|
800
|
-
quoteId:
|
|
801
|
-
productPrice: (
|
|
802
|
-
cartItemId: (
|
|
940
|
+
quoteId: e.id,
|
|
941
|
+
productPrice: (o == null ? void 0 : o.productPrice) || e.spotPrice,
|
|
942
|
+
cartItemId: (o == null ? void 0 : o.cartItemId) || ""
|
|
803
943
|
};
|
|
804
944
|
});
|
|
805
945
|
}
|
|
@@ -810,6 +950,7 @@ class j {
|
|
|
810
950
|
}
|
|
811
951
|
}
|
|
812
952
|
export {
|
|
953
|
+
k as NON_US_RESIDENT_VALUE,
|
|
813
954
|
b as SelectionEnum,
|
|
814
|
-
|
|
955
|
+
G as default
|
|
815
956
|
};
|