@getspot/spot-widget 4.3.1 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
- async function N(c, t, r, s) {
1
+ async function T(d, t, r, s) {
2
2
  try {
3
- const i = s ? { ...r, state: s } : r, a = await fetch(c, {
3
+ const i = s ? { ...r, state: s } : r, a = await fetch(d, {
4
4
  method: "POST",
5
5
  headers: {
6
6
  "Content-Type": "application/json",
@@ -17,9 +17,9 @@ async function N(c, t, r, s) {
17
17
  throw i instanceof Error ? i : new Error("Unknown error occurred while fetching quote");
18
18
  }
19
19
  }
20
- async function z(c, t, r) {
20
+ async function z(d, t, r) {
21
21
  try {
22
- const s = c.replace("/quote", "/quote/batch"), i = await fetch(s, {
22
+ const s = d.replace("/quote", "/quote/batch"), i = await fetch(s, {
23
23
  method: "POST",
24
24
  headers: {
25
25
  "Content-Type": "application/json",
@@ -36,7 +36,7 @@ async function z(c, t, r) {
36
36
  throw s instanceof Error ? s : new Error("Unknown error occurred while fetching batch quote");
37
37
  }
38
38
  }
39
- async function S(c, t, r, s) {
39
+ async function N(d, t, r, s) {
40
40
  var i;
41
41
  try {
42
42
  const a = {
@@ -48,7 +48,7 @@ async function S(c, t, r, s) {
48
48
  ...m,
49
49
  cartItemId: m.cartItemId || `item-${f + 1}`
50
50
  }))
51
- }, e = await z(c, t, a);
51
+ }, e = await z(d, t, a);
52
52
  if (e.status !== "QUOTES_AVAILABLE" && e.status !== "QUOTE_AVAILABLE")
53
53
  return { status: "NO_MATCHING_QUOTE" };
54
54
  const o = e.quotes.map((m) => {
@@ -56,18 +56,18 @@ async function S(c, t, r, s) {
56
56
  (v, h) => (v.cartItemId || `item-${h + 1}`) === m.cartItemId
57
57
  );
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
+ }), p = Math.round((e.totalSpotPrice || e.spotPrice || 0) * 100) / 100;
60
60
  return {
61
61
  status: "QUOTE_AVAILABLE",
62
62
  data: {
63
63
  id: e.quotes ? e.quotes.map((m) => m.id).join(",") : ((i = e.data) == null ? void 0 : i.id) || "",
64
- spotPrice: l,
64
+ spotPrice: p,
65
65
  currencyCode: e.currencyCode || "",
66
66
  communication: {
67
67
  ...e.communication,
68
68
  yesOptionText: e.communication.yesOptionText.replace(
69
69
  String(e.totalSpotPrice),
70
- String(l)
70
+ String(p)
71
71
  )
72
72
  },
73
73
  payoutSchedule: e.payoutSchedule.map((m) => ({
@@ -77,14 +77,14 @@ async function S(c, t, r, s) {
77
77
  coveredItems: o,
78
78
  originalQuotes: e.quotes || (e.data ? [e.data] : [])
79
79
  },
80
- spotPrice: l,
80
+ spotPrice: p,
81
81
  coveredItems: o
82
82
  };
83
83
  } catch (a) {
84
84
  throw a instanceof Error ? a : new Error("Unknown error occurred while fetching multiple quotes");
85
85
  }
86
86
  }
87
- const E = "non-us-resident", L = [
87
+ const E = "non-us-resident", A = "Unfortunately, we are currently unable to offer coverage or process claims for non-US residents.", L = [
88
88
  { value: "AL", label: "Alabama" },
89
89
  { value: "AK", label: "Alaska" },
90
90
  { value: "AS", label: "American Samoa" },
@@ -141,7 +141,7 @@ const E = "non-us-resident", L = [
141
141
  { value: "WV", label: "West Virginia" },
142
142
  { value: "WI", label: "Wisconsin" },
143
143
  { value: "WY", label: "Wyoming" }
144
- ], O = new Set(L.map((c) => c.value)), I = [
144
+ ], O = new Set(L.map((d) => d.value)), I = [
145
145
  "USD",
146
146
  "CAD",
147
147
  "AUD",
@@ -165,26 +165,26 @@ const E = "non-us-resident", L = [
165
165
  "SGD",
166
166
  "THB",
167
167
  "ZAR"
168
- ], R = {
168
+ ], P = {
169
169
  sandbox: "https://api.sandbox.getspot.com/v1/quote",
170
170
  production: "https://api.getspot.com/v1/quote",
171
171
  local: "http://localhost:3999/api/v1/quote"
172
172
  };
173
- function M(c) {
173
+ function M(d) {
174
174
  const {
175
175
  apiConfig: t = {},
176
176
  quoteRequestData: r,
177
177
  callbacks: s = {},
178
178
  location: i,
179
179
  theme: a
180
- } = c, {
180
+ } = d, {
181
181
  environment: e = "sandbox",
182
182
  partnerId: o,
183
- customEndpoint: l
183
+ customEndpoint: p
184
184
  } = t;
185
185
  if (!o || typeof o != "string")
186
186
  throw new Error("Invalid or missing partnerId in apiConfig");
187
- if (!(l || R[e]))
187
+ if (!(p || P[e]))
188
188
  throw new Error(`Invalid environment in apiConfig: ${e}`);
189
189
  if (!r || typeof r != "object" && !Array.isArray(r))
190
190
  throw new Error("quoteRequestData must be a non-null object or array");
@@ -200,57 +200,57 @@ function M(c) {
200
200
  "cartId",
201
201
  "productName"
202
202
  ];
203
- function v(p, u = null) {
204
- const d = u !== null ? `quoteRequestData[${u}]` : "quoteRequestData";
203
+ function v(l, u = null) {
204
+ const c = u !== null ? `quoteRequestData[${u}]` : "quoteRequestData";
205
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}'`);
206
+ if (!Object.prototype.hasOwnProperty.call(l, g) || l[g] === void 0 || l[g] === null)
207
+ throw new Error(`Missing required ${c} field: '${g}'`);
208
208
  });
209
209
  const b = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
210
- if (!b.test(p.startDate))
211
- throw new Error(`${d}.startDate must be a valid ISO8601 string`);
212
- if (!b.test(p.endDate))
213
- throw new Error(`${d}.endDate must be a valid ISO8601 string`);
214
- if (typeof p.currencyCode != "string")
215
- throw new Error(`${d}.currencyCode must be a string`);
216
- if (!I.includes(p.currencyCode))
217
- throw new Error(`Invalid ${d}.currencyCode: ${p.currencyCode}`);
218
- if (typeof p.eventType != "string")
219
- throw new Error(`${d}.eventType must be a string`);
220
- if (typeof p.productType != "string")
221
- throw new Error(`${d}.productType must be a string`);
222
- const y = ["Pass", "Trip", "Registration"];
223
- if (!y.includes(p.productType))
210
+ if (!b.test(l.startDate))
211
+ throw new Error(`${c}.startDate must be a valid ISO8601 string`);
212
+ if (!b.test(l.endDate))
213
+ throw new Error(`${c}.endDate must be a valid ISO8601 string`);
214
+ if (typeof l.currencyCode != "string")
215
+ throw new Error(`${c}.currencyCode must be a string`);
216
+ if (!I.includes(l.currencyCode))
217
+ throw new Error(`Invalid ${c}.currencyCode: ${l.currencyCode}`);
218
+ if (typeof l.eventType != "string")
219
+ throw new Error(`${c}.eventType must be a string`);
220
+ if (typeof l.productType != "string")
221
+ throw new Error(`${c}.productType must be a string`);
222
+ const w = ["Pass", "Trip", "Registration"];
223
+ if (!w.includes(l.productType))
224
224
  throw new Error(
225
- `${d}.productType must be one of ${y.join(", ")}`
225
+ `${c}.productType must be one of ${w.join(", ")}`
226
226
  );
227
- if (typeof p.productDuration != "string")
228
- throw new Error(`${d}.productDuration must be a string`);
227
+ if (typeof l.productDuration != "string")
228
+ throw new Error(`${c}.productDuration must be a string`);
229
229
  const C = ["Daily", "Seasonal", "Trip", "Event"];
230
- if (!C.includes(p.productDuration))
230
+ if (!C.includes(l.productDuration))
231
231
  throw new Error(
232
- `${d}.productDuration must be one of ${C.join(", ")}`
232
+ `${c}.productDuration must be one of ${C.join(", ")}`
233
233
  );
234
- if (typeof p.productPrice != "number" || isNaN(p.productPrice))
235
- throw new Error(`${d}.productPrice must be a valid number`);
236
- if (typeof p.productId != "string")
237
- throw new Error(`${d}.productId must be a string`);
238
- if (typeof p.cartId != "string")
239
- throw new Error(`${d}.cartId must be a string`);
240
- if (typeof p.productName != "string")
241
- throw new Error(`${d}.productName must be a string`);
234
+ if (typeof l.productPrice != "number" || isNaN(l.productPrice))
235
+ throw new Error(`${c}.productPrice must be a valid number`);
236
+ if (typeof l.productId != "string")
237
+ throw new Error(`${c}.productId must be a string`);
238
+ if (typeof l.cartId != "string")
239
+ throw new Error(`${c}.cartId must be a string`);
240
+ if (typeof l.productName != "string")
241
+ throw new Error(`${c}.productName must be a string`);
242
242
  }
243
243
  if ("items" in r) {
244
- const p = r, { cartId: u, cartName: d, currencyCode: b, items: y } = p;
244
+ const l = r, { cartId: u, cartName: c, currencyCode: b, items: w } = l;
245
245
  if (!u || typeof u != "string")
246
246
  throw new Error("quoteRequestData.cartId must be a string");
247
- if (!d || typeof d != "string")
247
+ if (!c || typeof c != "string")
248
248
  throw new Error("quoteRequestData.cartName must be a string");
249
249
  if (!b || typeof b != "string")
250
250
  throw new Error("quoteRequestData.currencyCode must be a string");
251
251
  if (!I.includes(b))
252
252
  throw new Error(`Invalid quoteRequestData.currencyCode: ${b}`);
253
- if (!Array.isArray(y) || y.length === 0)
253
+ if (!Array.isArray(w) || w.length === 0)
254
254
  throw new Error("quoteRequestData.items must be a non-empty array");
255
255
  const C = [
256
256
  "startDate",
@@ -262,45 +262,45 @@ function M(c) {
262
262
  "productId",
263
263
  "productName"
264
264
  ];
265
- y.forEach((g, k) => {
265
+ w.forEach((g, k) => {
266
266
  if (!g || typeof g != "object")
267
267
  throw new Error(`quoteRequestData.items[${k}] must be a non-null object`);
268
- const _ = `quoteRequestData.items[${k}]`;
268
+ const y = `quoteRequestData.items[${k}]`;
269
269
  C.forEach((q) => {
270
270
  if (!Object.prototype.hasOwnProperty.call(g, q) || g[q] === void 0 || g[q] === null)
271
- throw new Error(`Missing required ${_} field: '${q}'`);
271
+ throw new Error(`Missing required ${y} field: '${q}'`);
272
272
  });
273
273
  const x = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
274
274
  if (!x.test(g.startDate))
275
- throw new Error(`${_}.startDate must be a valid ISO8601 string`);
275
+ throw new Error(`${y}.startDate must be a valid ISO8601 string`);
276
276
  if (!x.test(g.endDate))
277
- throw new Error(`${_}.endDate must be a valid ISO8601 string`);
277
+ throw new Error(`${y}.endDate must be a valid ISO8601 string`);
278
278
  if (typeof g.eventType != "string")
279
- throw new Error(`${_}.eventType must be a string`);
279
+ throw new Error(`${y}.eventType must be a string`);
280
280
  if (typeof g.productType != "string")
281
- throw new Error(`${_}.productType must be a string`);
281
+ throw new Error(`${y}.productType must be a string`);
282
282
  const D = ["Pass", "Trip", "Registration"];
283
283
  if (!D.includes(g.productType))
284
- throw new Error(`${_}.productType must be one of ${D.join(", ")}`);
284
+ throw new Error(`${y}.productType must be one of ${D.join(", ")}`);
285
285
  if (typeof g.productDuration != "string")
286
- throw new Error(`${_}.productDuration must be a string`);
287
- const T = ["Daily", "Seasonal", "Trip", "Event"];
288
- if (!T.includes(g.productDuration))
289
- throw new Error(`${_}.productDuration must be one of ${T.join(", ")}`);
286
+ throw new Error(`${y}.productDuration must be a string`);
287
+ const S = ["Daily", "Seasonal", "Trip", "Event"];
288
+ if (!S.includes(g.productDuration))
289
+ throw new Error(`${y}.productDuration must be one of ${S.join(", ")}`);
290
290
  if (typeof g.productPrice != "number" || isNaN(g.productPrice))
291
- throw new Error(`${_}.productPrice must be a valid number`);
291
+ throw new Error(`${y}.productPrice must be a valid number`);
292
292
  if (typeof g.productId != "string")
293
- throw new Error(`${_}.productId must be a string`);
293
+ throw new Error(`${y}.productId must be a string`);
294
294
  if (typeof g.productName != "string")
295
- throw new Error(`${_}.productName must be a string`);
295
+ throw new Error(`${y}.productName must be a string`);
296
296
  });
297
297
  } else if (Array.isArray(r)) {
298
298
  if (r.length === 0)
299
299
  throw new Error("quoteRequestData array cannot be empty");
300
- r.forEach((p, u) => {
301
- if (!p || typeof p != "object")
300
+ r.forEach((l, u) => {
301
+ if (!l || typeof l != "object")
302
302
  throw new Error(`quoteRequestData[${u}] must be a non-null object`);
303
- v(p, u);
303
+ v(l, u);
304
304
  });
305
305
  } else
306
306
  v(r);
@@ -310,39 +310,39 @@ function M(c) {
310
310
  "onQuoteRetrieved",
311
311
  "onError",
312
312
  "noMatchingQuote"
313
- ].forEach((p) => {
314
- const u = s[p];
313
+ ].forEach((l) => {
314
+ const u = s[l];
315
315
  if (u && typeof u != "function")
316
- throw new Error(`Callback '${p}' must be a function.`);
316
+ throw new Error(`Callback '${l}' must be a function.`);
317
317
  }), typeof i == "string" && !document.querySelector(i))
318
318
  throw new Error(`Invalid location selector: '${i}'`);
319
319
  if (a && typeof a != "object")
320
320
  throw new Error(
321
321
  "Theme must be an object with CSS variables, do not include the '--' prefix"
322
322
  );
323
- if (c.state && !O.has(c.state))
324
- throw new Error(`Invalid state: '${c.state}'. Must be a 2-character US state or territory code.`);
323
+ if (d.state && !O.has(d.state))
324
+ throw new Error(`Invalid state: '${d.state}'. Must be a 2-character US state or territory code.`);
325
325
  }
326
- var w = /* @__PURE__ */ ((c) => (c.YES = "yes", c.NO = "no", c.UNSELECTED = "unselected", c))(w || {});
327
- function n(c, { text: t, className: r, parent: s, innerHTML: i, href: a, target: e } = {}) {
328
- const o = document.createElement(c);
326
+ var _ = /* @__PURE__ */ ((d) => (d.YES = "yes", d.NO = "no", d.UNSELECTED = "unselected", d))(_ || {});
327
+ function n(d, { text: t, className: r, parent: s, innerHTML: i, href: a, target: e } = {}) {
328
+ const o = document.createElement(d);
329
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;
330
330
  }
331
- function P(c, { name: t, description: r }) {
331
+ function $(d, { name: t, description: r }) {
332
332
  n("div", {
333
333
  className: "spot-header__title",
334
334
  text: t,
335
- parent: c
335
+ parent: d
336
336
  }), n("div", {
337
337
  className: "spot-header__description",
338
338
  text: r,
339
- parent: c
339
+ parent: d
340
340
  });
341
341
  }
342
- function $(c, t = []) {
342
+ function V(d, t = []) {
343
343
  const r = n("ul", {
344
344
  className: "spot-benefits__list",
345
- parent: c
345
+ parent: d
346
346
  });
347
347
  t.forEach((s) => {
348
348
  const i = n("li", { parent: r });
@@ -353,12 +353,12 @@ function $(c, t = []) {
353
353
  </svg>`, n("span", { text: s, parent: i });
354
354
  });
355
355
  }
356
- function V(c, t = []) {
356
+ function Q(d, t = []) {
357
357
  if (!t || t.length === 0) return;
358
358
  const r = n("div", {
359
359
  className: "spot-qualifying-reasons__container",
360
- parent: c
361
- }), s = [...t].sort((o, l) => o.rank - l.rank), i = n("div", {
360
+ parent: d
361
+ }), s = [...t].sort((o, p) => o.rank - p.rank), i = n("div", {
362
362
  className: "spot-qualifying-reasons__grid",
363
363
  parent: r
364
364
  }), a = {
@@ -375,8 +375,8 @@ function V(c, t = []) {
375
375
  try {
376
376
  const o = document.currentScript;
377
377
  if (o != null && o.src) {
378
- const l = new URL(o.src);
379
- e = l.origin + l.pathname.replace(/\/[^/]*$/, "/");
378
+ const p = new URL(o.src);
379
+ e = p.origin + p.pathname.replace(/\/[^/]*$/, "/");
380
380
  } else
381
381
  e = window.location.origin + window.location.pathname.replace(/\/[^/]*$/, "/");
382
382
  e += "assets/";
@@ -384,13 +384,13 @@ function V(c, t = []) {
384
384
  e = "./assets/";
385
385
  }
386
386
  s.forEach((o) => {
387
- var v, h, p;
388
- const l = n("div", {
387
+ var v, h, l;
388
+ const p = n("div", {
389
389
  className: "spot-qualifying-reasons__item",
390
390
  parent: i
391
391
  }), m = n("div", {
392
392
  className: "spot-qualifying-reasons__icon-wrapper",
393
- parent: l
393
+ parent: p
394
394
  }), f = a[((v = o.benefitType) == null ? void 0 : v.name) || ""] || a[o.name || ""];
395
395
  if (f) {
396
396
  const u = n("img", {
@@ -400,12 +400,12 @@ function V(c, t = []) {
400
400
  }
401
401
  n("span", {
402
402
  className: "spot-qualifying-reasons__label",
403
- text: ((p = o.benefitType) == null ? void 0 : p.name) || o.name || "",
404
- parent: l
403
+ text: ((l = o.benefitType) == null ? void 0 : l.name) || o.name || "",
404
+ parent: p
405
405
  });
406
406
  });
407
407
  }
408
- function Q(c, t = [], r) {
408
+ function U(d, t = [], r) {
409
409
  if (t.length === 0 || !r || r <= 1)
410
410
  return;
411
411
  const s = /* @__PURE__ */ new Map();
@@ -413,32 +413,32 @@ function Q(c, t = [], r) {
413
413
  s.set(u, (s.get(u) || 0) + 1);
414
414
  });
415
415
  const a = Array.from(s.entries()).map(
416
- ([u, d]) => ({
416
+ ([u, c]) => ({
417
417
  item: u,
418
- count: d,
419
- displayText: d > 1 ? `${d} x ${u}` : u
418
+ count: c,
419
+ displayText: c > 1 ? `${c} x ${u}` : u
420
420
  })
421
- ).sort((u, d) => {
422
- const b = u.item.charAt(0), y = d.item.charAt(0), C = /[a-zA-Z]/.test(b), g = /[a-zA-Z]/.test(y);
423
- return !C && g ? -1 : C && !g ? 1 : u.item.localeCompare(d.item, void 0, { sensitivity: "base" });
421
+ ).sort((u, c) => {
422
+ const b = u.item.charAt(0), w = c.item.charAt(0), C = /[a-zA-Z]/.test(b), g = /[a-zA-Z]/.test(w);
423
+ return !C && g ? -1 : C && !g ? 1 : u.item.localeCompare(c.item, void 0, { sensitivity: "base" });
424
424
  }), e = n("div", {
425
425
  className: "spot-covered-items__container",
426
- parent: c
426
+ parent: d
427
427
  }), o = n("div", {
428
428
  className: "spot-covered-items__header",
429
429
  parent: e
430
- }), l = n("button", {
430
+ }), p = n("button", {
431
431
  className: "spot-covered-items__toggle",
432
432
  parent: o
433
433
  });
434
434
  n("span", {
435
435
  className: "spot-covered-items__title",
436
436
  text: `Items Covered in Your Cart (${t.length})`,
437
- parent: l
437
+ parent: p
438
438
  });
439
439
  const m = n("div", {
440
440
  className: "spot-covered-items__right-section",
441
- parent: l
441
+ parent: p
442
442
  });
443
443
  n("span", {
444
444
  className: "spot-covered-items__view-all",
@@ -457,15 +457,15 @@ function Q(c, t = [], r) {
457
457
  parent: v
458
458
  });
459
459
  a.forEach(({ displayText: u }) => {
460
- const d = n("li", { parent: h });
461
- n("span", { text: u, parent: d });
460
+ const c = n("li", { parent: h });
461
+ n("span", { text: u, parent: c });
462
462
  });
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");
463
+ let l = !1;
464
+ v.style.display = "none", p.addEventListener("click", (u) => {
465
+ u.stopPropagation(), l = !l, v.style.display = l ? "block" : "none", f.innerHTML = l ? "▲" : "▼", p.setAttribute("aria-expanded", l.toString());
466
+ }), p.setAttribute("aria-expanded", "false"), p.setAttribute("aria-controls", "covered-items-list"), v.setAttribute("id", "covered-items-list");
467
467
  }
468
- const U = {
468
+ const Z = {
469
469
  USD: "$",
470
470
  CAD: "CAD $",
471
471
  AUD: "AUD $",
@@ -490,27 +490,27 @@ const U = {
490
490
  THB: "THB ฿",
491
491
  ZAR: "ZAR R"
492
492
  };
493
- function Z(c, t = [], r = "USD") {
494
- const s = U[r] ?? `${r} `, i = n("div", {
493
+ function B(d, t = [], r = "USD") {
494
+ const s = Z[r] ?? `${r} `, i = n("div", {
495
495
  className: "spot-table__container",
496
- parent: c
496
+ parent: d
497
497
  }), a = n("table", {
498
498
  className: "spot-refund__table spot-table--dynamic",
499
499
  parent: i
500
500
  }), e = n("thead", { parent: a }), o = n("tr", { parent: e });
501
501
  n("th", { text: "When you cancel", parent: o }), n("th", { text: "You will receive", parent: o });
502
- const l = n("tbody", { parent: a });
502
+ const p = n("tbody", { parent: a });
503
503
  t.forEach(({ text: m, percent: f, amount: v }) => {
504
- const h = n("tr", { parent: l });
504
+ const h = n("tr", { parent: p });
505
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 });
506
+ const l = f === "Not eligible for refund" ? "Not eligible for a refund" : `${s}${v} refund`;
507
+ n("td", { text: l, parent: h });
508
508
  });
509
509
  }
510
- function B(c, t) {
510
+ function j(d, t) {
511
511
  const r = n("div", {
512
512
  className: "spot-state-dropdown__wrapper",
513
- parent: c
513
+ parent: d
514
514
  });
515
515
  n("label", {
516
516
  className: "spot-state-dropdown__label",
@@ -527,24 +527,28 @@ function B(c, t) {
527
527
  parent: s
528
528
  });
529
529
  i.value = "", i.selected = !t, L.forEach(({ value: e, label: o }) => {
530
- const l = n("option", { text: o, parent: s });
531
- l.value = e, e === t && (l.selected = !0);
530
+ const p = n("option", { text: o, parent: s });
531
+ p.value = e, e === t && (p.selected = !0);
532
532
  });
533
533
  const a = n("option", {
534
534
  text: "Not a US Resident",
535
535
  parent: s
536
536
  });
537
- return a.value = E, t === E && (a.selected = !0), s;
537
+ return a.value = E, t === E && (a.selected = !0), n("div", {
538
+ className: "spot-state-dropdown__error",
539
+ text: A,
540
+ parent: r
541
+ }), s;
538
542
  }
539
- function j(c, t, r, s = !1) {
543
+ function F(d, t, r, s = !1) {
540
544
  const i = n("div", {
541
545
  className: `spot-selection__options${s ? " spot-selection__options--disabled" : ""}`,
542
- parent: c
546
+ parent: d
543
547
  }), a = n("label", {
544
- className: `spot-selection__option ${t === w.YES ? "selected" : ""}`,
548
+ className: `spot-selection__option ${t === _.YES ? "selected" : ""}`,
545
549
  parent: i
546
550
  }), e = n("input", { parent: a });
547
- e.type = "radio", e.name = "selection", e.value = w.YES, t === w.YES && (e.checked = !0), s && (e.disabled = !0), n("strong", {
551
+ e.type = "radio", e.name = "selection", e.value = _.YES, t === _.YES && (e.checked = !0), s && (e.disabled = !0), n("strong", {
548
552
  text: r.yesOptionText,
549
553
  parent: a
550
554
  }), n("span", {
@@ -553,18 +557,18 @@ function j(c, t, r, s = !1) {
553
557
  parent: a
554
558
  });
555
559
  const o = n("label", {
556
- className: `spot-selection__option ${t === w.NO ? "selected" : ""}`,
560
+ className: `spot-selection__option ${t === _.NO ? "selected" : ""}`,
557
561
  parent: i
558
- }), l = n("input", { parent: o });
559
- return l.type = "radio", l.name = "selection", l.value = w.NO, t === w.NO && (l.checked = !0), s && (l.disabled = !0), n("span", { text: r.noOptionText, parent: o }), i;
562
+ }), p = n("input", { parent: o });
563
+ return p.type = "radio", p.name = "selection", p.value = _.NO, t === _.NO && (p.checked = !0), s && (p.disabled = !0), n("span", { text: r.noOptionText, parent: o }), i;
560
564
  }
561
- function H(c, t) {
565
+ function H(d, t) {
562
566
  var s;
563
567
  const r = (s = t.communication) == null ? void 0 : s.paymentTerms;
564
568
  if (r) {
565
569
  const i = n("div", {
566
570
  className: "spot-payment-terms",
567
- parent: c
571
+ parent: d
568
572
  });
569
573
  return n("div", {
570
574
  className: "spot-payment-terms__header",
@@ -577,11 +581,11 @@ function H(c, t) {
577
581
  }), i;
578
582
  }
579
583
  }
580
- function F(c, t, r = "bottom-right") {
584
+ function W(d, t, r = "bottom-right") {
581
585
  if (r === "top-right") {
582
586
  const o = n("div", {
583
587
  className: "spot-logo__top-right",
584
- parent: c
588
+ parent: d
585
589
  });
586
590
  o.innerHTML = `
587
591
  <svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -602,7 +606,7 @@ function F(c, t, r = "bottom-right") {
602
606
  }
603
607
  const s = n("div", {
604
608
  className: "spot-footer__container",
605
- parent: c
609
+ parent: d
606
610
  }), i = n("div", {
607
611
  className: "spot-footer__terms",
608
612
  parent: s
@@ -637,20 +641,20 @@ function F(c, t, r = "bottom-right") {
637
641
  }
638
642
  return s;
639
643
  }
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) {
644
+ const Y = ":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-border-line-width: .0625rem;--spot-border-color: #e0e0e0;--spot-max-width: 51rem;--spot-margin: 1rem;--spot-title-font-size: 1.25rem;--spot-title-font-weight: 700;--spot-title-padding: 0 0 1.25rem 0;--spot-description-font-size: .875rem;--spot-description-font-weight: 400;--spot-description-padding: 0 0 .5rem 0;--spot-bullets-font-size: .875rem;--spot-bullets-font-weight: 400;--spot-bullets-padding: .3125rem;--spot-bullets-checkmark-color: #2e2e2e;--spot-table-border-radius: .625rem;--spot-table-header-font-size: .875rem;--spot-table-header-font-weight: 700;--spot-table-header-padding: 0 .5rem .625rem;--spot-table-cell-font-size: .815rem;--spot-table-cell-font-weight: 400;--spot-table-cell-padding: 0 .625rem;--spot-radio-border: #000000;--spot-radio-border-radius: .625rem;--spot-radio-checked-background: #000000;--spot-radio-text-font-size: .875rem;--spot-radio-text-font-weight: 400;--spot-radio-text-padding: .625rem;--spot-radio-selection-background: #f4f4f4;--spot-radio-selection-border-radius: .625rem;--spot-radio-selection-padding: .625rem;--spot-recommended-tag-background: #000000;--spot-recommended-tag-font-color: #ffffff;--spot-recommended-tag-font-size: .875rem;--spot-recommended-tag-font-weight: 700;--spot-recommended-tag-padding: .25rem .5rem;--spot-recommended-tag-border-radius: .5rem;--spot-state-dropdown-label-font-size: .875rem;--spot-state-dropdown-label-font-weight: 600;--spot-state-dropdown-label-margin-bottom: .25rem;--spot-state-dropdown-select-border: .0625rem solid #e0e0e0;--spot-state-dropdown-select-border-radius: .375rem;--spot-state-dropdown-select-padding: .5rem .75rem;--spot-state-dropdown-select-font-size: .875rem;--spot-state-dropdown-select-background: #ffffff;--spot-state-dropdown-wrapper-margin-bottom: .75rem;--spot-state-dropdown-error-color: var(--spot-selection-error-font-color);--spot-state-dropdown-error-font-size: .8125rem;--spot-state-dropdown-error-margin-top: .25rem;--spot-selection-error-font-color: #ff0000;--spot-selection-error-font-size: .875rem;--spot-qualifying-reasons-margin: .75rem 0;--spot-qualifying-reasons-padding: 0 .3125rem;--spot-qualifying-reasons-column-gap: 3rem;--spot-qualifying-reasons-row-gap: .25rem;--spot-qualifying-reasons-grid-padding-left: 1rem;--spot-qualifying-reasons-icon-wrapper-size: 1.125rem;--spot-qualifying-reasons-icon-size: .75rem;--spot-qualifying-reasons-icon-border-color: #2e2e2e;--spot-qualifying-reasons-icon-border-width: 1px;--spot-qualifying-reasons-icon-background: #ffffff;--spot-qualifying-reasons-item-gap: .625rem;--spot-qualifying-reasons-label-font-size: .8rem;--spot-qualifying-reasons-label-font-weight: 400;--spot-qualifying-reasons-label-font-color: #000000;--spot-qualifying-reasons-label-font-family: Arial;--spot-selection-error-padding: .5rem;--spot-payment-terms-background: #f4f4f4;--spot-payment-terms-border-radius: .625rem;--spot-payment-terms-padding: 1rem;--spot-payment-terms-font-color: #636569;--spot-payment-terms-font-size: .75rem;--spot-payment-terms-header-font-weight: 700;--spot-payment-terms-header-font-size: .875rem;--spot-payment-terms-header-margin-bottom: .5rem;--spot-payment-terms-header-border-color: #c2c2c2;--spot-payment-terms-header-padding: 0 0 .5rem 0;--spot-terms-font-size: .75rem;--spot-terms-font-weight: 400;--spot-terms-font-color: #636569;--spot-terms-padding: 0;--spot-terms-link-text-decoration: underline;--spot-terms-link-font-size: .75rem;--spot-terms-link-font-weight: 400;--spot-terms-link-font-color: #636569;--spot-terms-link-padding: 0;--spot-covered-items-background: #f1f3f5;--spot-covered-items-hover-background: #e9ecef;--spot-covered-items-border-radius: .5rem;--spot-covered-items-padding: .75rem 1rem;--spot-covered-items-font-size: .875rem;--spot-covered-items-font-weight: 400;--spot-covered-items-font-color: #000000;--spot-covered-items-font-family: Arial;--spot-covered-items-arrow-font-size: .6rem;--spot-covered-items-arrow-color: #636569;--spot-covered-items-view-all-color: #636569;--spot-covered-items-view-all-font-size: .875rem;--spot-covered-items-view-all-font-weight: 400;--spot-covered-items-content-background: #f8f9fa;--spot-covered-items-content-border: 1px solid #e0e0e0;--spot-covered-items-content-border-radius: .5rem;--spot-covered-items-content-padding: .75rem 1rem;--spot-desktop-radio-margin-top: -1.5rem;--spot-benefits-margin-bottom: 0rem;--spot-covered-items-margin-bottom: 1.5rem;--spot-footer-gap: 1rem;--spot-footer-terms-margin-right: 7rem;--spot-payment-terms-margin-top: .5rem;--spot-logo-top-right-margin: 1rem}.spot-refund-guarantee{font-family:var(--spot-font-family);padding:var(--spot-padding);background-color:var(--spot-background-color);color:var(--spot-font-color);border:var(--spot-border-line-width) solid var(--spot-border-color);border-radius:var(--spot-border-radius);max-width:var(--spot-max-width);margin:var(--spot-margin);container-type:inline-size;position:relative;word-wrap:normal;overflow-wrap:normal;-webkit-hyphens:none;hyphens:none}.spot-refund-guarantee *{color:inherit}.spot-header__title{font-size:var(--spot-title-font-size);font-weight:var(--spot-title-font-weight);padding:var(--spot-title-padding);color:var(--spot-title-font-color);font-family:var(--spot-title-font-family);line-height:120%;letter-spacing:-.03125rem}.spot-header__description{font-size:var(--spot-description-font-size);font-weight:var(--spot-description-font-weight);color:var(--spot-description-font-color);font-family:var(--spot-description-font-family);padding:var(--spot-description-padding);line-height:125%;letter-spacing:-.025rem}.spot-content__wrapper{display:flex;flex-direction:column}.spot-content__wrapper.desktop-layout{display:grid;grid-template-columns:1fr auto;align-items:start;gap:1rem}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container,.desktop-layout .spot-covered-items__container,.desktop-layout .spot-selection__wrapper{min-width:0;word-wrap:normal}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container{grid-row:1;margin-bottom:var(--spot-benefits-margin-bottom)}.desktop-layout .spot-covered-items__container{grid-row:2;grid-column:1;margin-bottom:var(--spot-covered-items-margin-bottom)}.desktop-layout .spot-selection__wrapper{grid-row:3;grid-column:1;margin-top:var(--spot-desktop-radio-margin-top)}.desktop-layout .spot-payment-terms__wrapper{grid-row:4;grid-column:1;margin-top:var(--spot-payment-terms-margin-top)}.desktop-layout .spot-table__container{grid-row:1 / span 4;grid-column:2;width:auto;min-width:20.3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-table__container{display:flex;justify-content:flex-start;margin-top:1rem;margin-bottom:1rem;box-sizing:border-box;padding:0 .3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-refund__table{width:100%;max-width:22rem;table-layout:auto}@media (max-width: 850px){.spot-selection__recommended-tag{display:inline-block;margin-left:0}}@media (max-width: 500px){.spot-selection__recommended-tag{margin-top:.5rem}}@media (max-width: 600px){.spot-refund__table th{padding:0rem}}.spot-benefits__list{list-style-type:none;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-benefits__list li{margin-bottom:.375rem;display:flex;align-items:flex-start;gap:.5rem}.spot-benefits__list li svg{flex-shrink:0;position:relative;top:.125rem}.spot-bullets__checkmark path{stroke:var(--spot-bullets-checkmark-color)}.spot-qualifying-reasons__container{margin:var(--spot-qualifying-reasons-margin);padding:var(--spot-qualifying-reasons-padding)}.spot-qualifying-reasons__grid{display:grid;grid-template-columns:repeat(2,minmax(0,max-content));column-gap:var(--spot-qualifying-reasons-column-gap);row-gap:var(--spot-qualifying-reasons-row-gap);max-width:100%;padding-left:var(--spot-qualifying-reasons-grid-padding-left)}.spot-qualifying-reasons__item{display:flex;align-items:center;gap:var(--spot-qualifying-reasons-item-gap)}.spot-qualifying-reasons__icon-wrapper{width:var(--spot-qualifying-reasons-icon-wrapper-size);height:var(--spot-qualifying-reasons-icon-wrapper-size);border-radius:50%;border:var(--spot-qualifying-reasons-icon-border-width) solid var(--spot-qualifying-reasons-icon-border-color);background-color:var(--spot-qualifying-reasons-icon-background);display:flex;align-items:center;justify-content:center;flex-shrink:0}.spot-qualifying-reasons__icon{width:var(--spot-qualifying-reasons-icon-size);height:var(--spot-qualifying-reasons-icon-size)}.spot-qualifying-reasons__label{font-size:var(--spot-qualifying-reasons-label-font-size);font-weight:var(--spot-qualifying-reasons-label-font-weight);color:var(--spot-qualifying-reasons-label-font-color);font-family:var(--spot-qualifying-reasons-label-font-family);line-height:1.2}@media (max-width: 480px){.spot-qualifying-reasons__grid{grid-template-columns:1fr}}.spot-covered-items__container{margin-top:.85rem;margin-bottom:.5rem;max-width:26rem}.spot-content__wrapper.desktop-layout:has(.spot-table__container) .spot-covered-items__container{margin-top:0rem;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);padding:0 .3125rem .25rem;line-height:125%;margin:0}.spot-covered-items__list{list-style-type:disc;list-style-position:inside;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-covered-items__list li{margin-bottom:.3rem;text-align:left}.spot-covered-items__list li:last-child{margin-bottom:0}.spot-covered-items__header{margin-bottom:.5rem}.spot-covered-items__toggle{background:var(--spot-covered-items-background);border:none;border-radius:var(--spot-covered-items-border-radius);padding:var(--spot-covered-items-padding);cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;transition:all .2s ease}.spot-covered-items__toggle:hover{background-color:var(--spot-covered-items-hover-background)}.spot-covered-items__toggle:focus{outline:none;box-shadow:0 0 0 2px #0000001a}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;margin:0;padding:0}.spot-covered-items__right-section{display:flex;align-items:center;gap:.5rem;margin-left:auto}.spot-covered-items__view-all{font-size:var(--spot-covered-items-view-all-font-size);font-weight:var(--spot-covered-items-view-all-font-weight);color:var(--spot-covered-items-view-all-color);font-family:var(--spot-covered-items-font-family);line-height:125%}.spot-covered-items__arrow{font-size:var(--spot-covered-items-arrow-font-size);transition:transform .2s ease;color:var(--spot-covered-items-arrow-color);flex-shrink:0;transform:scaleX(1.5)}.spot-covered-items__content{margin-top:.5rem;transition:all .2s ease;overflow:hidden}.spot-covered-items__list{background-color:var(--spot-covered-items-content-background);border:var(--spot-covered-items-content-border);border-radius:var(--spot-covered-items-content-border-radius);margin:0;padding:var(--spot-covered-items-content-padding)}.spot-table__container{width:100%}.spot-refund__table{max-width:22rem;border-radius:var(--spot-table-border-radius);overflow:hidden;border:.09375rem solid #636569;table-layout:fixed;margin-bottom:.5rem;margin-top:.25rem;padding:.625rem}.spot-refund__table--dynamic{height:auto!important;min-height:7.5rem}.spot-refund__table td,.spot-refund__table th{padding:.375rem .625rem;text-align:left}.spot-refund__table th{text-align:left;font-size:var(--spot-table-header-font-size);font-weight:var(--spot-table-header-font-weight);color:var(--spot-table-header-font-color);font-family:var(--spot-table-header-font-family);padding:var(--spot-table-header-padding)}.spot-refund__table td{text-align:left;font-size:var(--spot-table-cell-font-size);font-weight:var(--spot-table-cell-font-weight);color:var(--spot-table-cell-font-color);font-family:var(--spot-table-cell-font-family);padding:var(--spot-table-cell-padding)}.spot-state-dropdown__wrapper{display:flex;flex-direction:column;margin-bottom:var(--spot-state-dropdown-wrapper-margin-bottom)}.spot-state-dropdown__label{font-size:var(--spot-state-dropdown-label-font-size);font-weight:var(--spot-state-dropdown-label-font-weight);font-family:var(--spot-font-family);color:var(--spot-font-color);margin-bottom:var(--spot-state-dropdown-label-margin-bottom)}.spot-state-dropdown__select{width:100%;box-sizing:border-box;border:var(--spot-state-dropdown-select-border);border-radius:var(--spot-state-dropdown-select-border-radius);padding:var(--spot-state-dropdown-select-padding);font-size:var(--spot-state-dropdown-select-font-size);font-family:var(--spot-font-family);color:var(--spot-font-color);background-color:var(--spot-state-dropdown-select-background);cursor:pointer;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.spot-state-dropdown__select:focus{outline:none;box-shadow:0 0 0 2px #00000026}.spot-state-dropdown__select--error{border-color:var(--spot-state-dropdown-error-color)}.spot-state-dropdown__select--error:focus{box-shadow:0 0 0 2px #ff000026}.spot-state-dropdown__error{display:none;color:var(--spot-state-dropdown-error-color);font-size:var(--spot-state-dropdown-error-font-size);font-family:var(--spot-font-family);margin-top:var(--spot-state-dropdown-error-margin-top)}.spot-state-dropdown__error--visible{display:block}input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:.75rem;height:.75rem;min-width:.75rem;border:.0625rem solid var(--spot-radio-border);border-radius:var(--spot-radio-border-radius);margin-right:.5rem;position:relative;vertical-align:middle;top:-.0625rem;cursor:pointer;flex-shrink:0}input[type=radio]:checked{background:var(--spot-radio-checked-background);box-shadow:inset 0 0 0 .0625rem #fff}.spot-selection__options{display:flex;flex-direction:column;gap:.5rem}.spot-selection__option{display:flex;align-items:center;flex-wrap:nowrap;position:relative;transition:background .2s;cursor:pointer;font-size:var(--spot-radio-text-font-size);font-weight:var(--spot-radio-text-font-weight);color:var(--spot-radio-text-font-color);font-family:var(--spot-radio-text-font-family);padding:var(--spot-radio-text-padding);margin-right:.5rem}.spot-selection__option.selected{background:var(--spot-radio-selection-background);border-radius:var(--spot-radio-selection-border-radius);padding:var(--spot-radio-selection-padding)}.spot-selection__recommended-tag{background:var(--spot-recommended-tag-background);color:var(--spot-recommended-tag-font-color);font-size:var(--spot-recommended-tag-font-size);font-weight:var(--spot-recommended-tag-font-weight);padding:var(--spot-recommended-tag-padding);border-radius:var(--spot-recommended-tag-border-radius);margin-left:.75rem;white-space:nowrap;flex-shrink:0}@media (max-width: 850px){.spot-selection__recommended-tag{margin-left:.5rem}}@media (max-width: 600px){.spot-selection__recommended-tag{margin-left:.5rem;font-size:.75rem;padding:.1875rem .4375rem}}.spot-selection__error{color:var(--spot-selection-error-font-color);font-size:var(--spot-selection-error-font-size);padding:var(--spot-selection-error-padding);display:none}.spot-selection__options--disabled .spot-selection__option{opacity:.4;cursor:not-allowed;pointer-events:none}.spot-selection__options--disabled input[type=radio]{cursor:not-allowed}.spot-payment-terms__wrapper{margin-top:1rem}.spot-payment-terms__header{font-weight:var(--spot-payment-terms-header-font-weight);margin-bottom:.5rem;padding:var(--spot-payment-terms-header-padding);font-size:var(--spot-payment-terms-header-font-size);border-bottom:1px solid var(--spot-payment-terms-header-border-color)}.spot-payment-terms{background-color:var(--spot-payment-terms-background);border-radius:var(--spot-payment-terms-border-radius);padding:var(--spot-payment-terms-padding);color:var(--spot-payment-terms-font-color);font-size:var(--spot-payment-terms-font-size)}.spot-footer__terms{margin-top:.625rem;margin-right:.25rem;font-size:var(--spot-terms-font-size);font-weight:var(--spot-terms-font-weight);color:var(--spot-terms-font-color);font-family:var(--spot-terms-font-family);padding:var(--spot-terms-padding);line-height:1.4;word-wrap:normal;-webkit-hyphens:none;hyphens:none;flex:1;min-width:0;overflow-wrap:normal}.spot-footer__terms-link{text-decoration:var(--spot-terms-link-text-decoration);font-size:var(--spot-terms-link-font-size);font-weight:var(--spot-terms-link-font-weight);color:var(--spot-terms-link-font-color);font-family:var(--spot-terms-link-font-family);padding:var(--spot-terms-link-padding)}.spot-footer__container{display:flex;flex-direction:row;justify-content:space-between;align-items:flex-start;flex-wrap:nowrap;gap:var(--spot-footer-gap)}@container (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}@media (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}.spot-footer__powered-by{margin-top:0;flex-shrink:0}.spot-logo__top-right{position:absolute;top:-14px;right:40px;z-index:10;background:linear-gradient(to bottom,transparent 50%,inherit 50%);padding:0 .25rem}.spot-logo__top-right svg{border-radius:1.25rem;border:var(--spot-border-line-width) solid var(--spot-border-color);display:block;background:var(--spot-background-color)}@container (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}@media (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}";
645
+ function G(d) {
642
646
  const t = document.createElement("style");
643
- t.textContent = c, document.head.appendChild(t);
647
+ t.textContent = d, document.head.appendChild(t);
644
648
  }
645
- Y(W);
646
- const A = {
649
+ G(Y);
650
+ const R = {
647
651
  sandbox: "https://api.sandbox.getspot.com/api/v1/quote",
648
652
  production: "https://api.getspot.com/api/v1/quote",
649
653
  local: "http://localhost:3999/api/v1/quote"
650
654
  };
651
- class G {
655
+ class K {
652
656
  constructor(t = {}) {
653
- this.options = {
657
+ this._destroyed = !1, this.options = {
654
658
  location: "body",
655
659
  showTable: !0,
656
660
  logoPosition: "bottom-right",
@@ -659,7 +663,7 @@ class G {
659
663
  callbacks: {},
660
664
  useMockData: !1,
661
665
  ...t,
662
- selection: t.selection ?? w.UNSELECTED
666
+ selection: t.selection ?? _.UNSELECTED
663
667
  }, this._onResize = this._updateLayout.bind(this), this.root = typeof this.options.location == "string" ? document.querySelector(this.options.location) : this.options.location, this.currentSelection = this.options.selection, this._init();
664
668
  }
665
669
  async _init() {
@@ -670,19 +674,20 @@ class G {
670
674
  if (this.options.useMockData && this.options.mockData)
671
675
  e = this.options.mockData;
672
676
  else {
673
- const { environment: o, partnerId: l } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || A[o];
674
- e = "items" in this.options.quoteRequestData ? await S(
677
+ const { environment: o, partnerId: p } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || R[o];
678
+ e = "items" in this.options.quoteRequestData ? await N(
675
679
  f,
676
- l,
680
+ p,
677
681
  this.options.quoteRequestData,
678
682
  this._validState()
679
- ) : await N(
683
+ ) : await T(
680
684
  f,
681
- l,
685
+ p,
682
686
  this.options.quoteRequestData,
683
687
  this._validState()
684
688
  );
685
689
  }
690
+ if (this._destroyed) return;
686
691
  if (e.status !== "QUOTE_AVAILABLE") {
687
692
  e.status === "NO_MATCHING_QUOTE" && ((t = this.options.callbacks) != null && t.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
688
693
  status: "NO_MATCHING_QUOTE",
@@ -692,7 +697,7 @@ class G {
692
697
  }
693
698
  if (this.quote = e.data, !this.quote)
694
699
  throw new Error("No quote data in response");
695
- if (this._renderWidget(), this.options.selection === w.YES && ((r = this.options.callbacks) != null && r.onOptIn)) {
700
+ if (this._renderWidget(), this.options.selection === _.YES && ((r = this.options.callbacks) != null && r.onOptIn)) {
696
701
  const o = {
697
702
  status: "QUOTE_ACCEPTED",
698
703
  spotPrice: this.quote.spotPrice,
@@ -700,11 +705,11 @@ class G {
700
705
  state: this._validState()
701
706
  };
702
707
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
703
- const l = this.options.quoteRequestData;
708
+ const p = this.options.quoteRequestData;
704
709
  o.batchQuoteDetails = this.quote.originalQuotes.map((m) => {
705
710
  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
711
+ const f = (v = p.items) == null ? void 0 : v.find(
712
+ (h) => (h.cartItemId || `item-${p.items.indexOf(h) + 1}`) === m.cartItemId
708
713
  );
709
714
  return {
710
715
  quoteId: m.id,
@@ -720,6 +725,7 @@ class G {
720
725
  o && this._applyQuoteUpdates(o);
721
726
  }
722
727
  } catch (e) {
728
+ if (this._destroyed) return;
723
729
  if ((i = this.options.callbacks) != null && i.onError) {
724
730
  const o = e;
725
731
  (a = this.options.callbacks) == null || a.onError({
@@ -733,21 +739,21 @@ class G {
733
739
  _renderWidget() {
734
740
  if (!this.quote) return;
735
741
  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);
742
+ const p = `--${e}`;
743
+ this.container.style.setProperty(p, o);
744
+ }), $(this.container, this.quote.communication);
739
745
  const t = document.createElement("div");
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) {
746
+ if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ? Q(t, this.quote.qualifyingReasons) : V(t, this.quote.communication.bulletPoints), this.quote.coveredItems) {
741
747
  const e = this._getTotalItemsInRequest();
742
- Q(t, this.quote.coveredItems, e);
748
+ U(t, this.quote.coveredItems, e);
743
749
  }
744
- this.options.showTable && !this.quote.qualifyingReasons && Z(t, this.quote.payoutSchedule, this.quote.currencyCode);
750
+ this.options.showTable && !this.quote.qualifyingReasons && B(t, this.quote.payoutSchedule, this.quote.currencyCode);
745
751
  const r = n("div", {
746
752
  className: "spot-selection__wrapper",
747
753
  parent: t
748
754
  });
749
- this._isPassOrTrip() && !this.options.state && (this._stateSelectEl = B(r, this.currentState));
750
- const i = !this._isQuotingAvailable(), a = j(
755
+ this._isPassOrTrip() && !this.options.state && (this._stateSelectEl = j(r, this.currentState), this._setNonUsResidentError(this.currentState === E));
756
+ const i = !this._isQuotingAvailable(), a = F(
751
757
  r,
752
758
  this.currentSelection,
753
759
  this.quote.communication,
@@ -756,7 +762,7 @@ class G {
756
762
  this.paymentTermsEl = n("div", {
757
763
  className: "spot-payment-terms__wrapper",
758
764
  parent: t
759
- }), this.currentSelection === w.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();
765
+ }), this.currentSelection === _.YES && H(this.paymentTermsEl, this.quote), W(this.container, this.quote, this.options.logoPosition), window.addEventListener("resize", this._onResize), this._setupResizeObserver(), this._updateLayout(), this._setupOptionListeners(a), this._setupStateDropdownListener();
760
766
  }
761
767
  _updateLayout() {
762
768
  if (!this.container || !this.quote) return;
@@ -782,8 +788,8 @@ class G {
782
788
  );
783
789
  if (!e)
784
790
  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;
791
+ const p = Math.min(e.scrollWidth, 400) + s + i;
792
+ return a && t.classList.add("desktop-layout"), r >= p;
787
793
  }
788
794
  return !1;
789
795
  }
@@ -801,7 +807,7 @@ class G {
801
807
  !this.quote || !this.container || (t.spotPriceWithFees !== void 0 && (this.quote.communication.yesOptionText = this.quote.communication.yesOptionText.replace(
802
808
  `$${this.quote.spotPrice.toFixed(2)}`,
803
809
  `$${t.spotPriceWithFees.toFixed(2)}`
804
- )), this.destroy(), this._renderWidget());
810
+ )), this._teardownDom(), this._renderWidget());
805
811
  }
806
812
  _isPassOrTrip() {
807
813
  const t = this.options.quoteRequestData;
@@ -830,11 +836,20 @@ class G {
830
836
  o.checked = !1;
831
837
  }), (e = this.container) == null || e.querySelectorAll(".spot-selection__option").forEach((o) => {
832
838
  o.classList.remove("selected");
833
- }), this.currentSelection = w.UNSELECTED, this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""));
839
+ }), this.currentSelection = _.UNSELECTED, this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""));
840
+ }
841
+ _setNonUsResidentError(t) {
842
+ var s;
843
+ if (!this._stateSelectEl) return;
844
+ this._stateSelectEl.classList.toggle("spot-state-dropdown__select--error", t);
845
+ const r = (s = this._stateSelectEl.parentElement) == null ? void 0 : s.querySelector(
846
+ ".spot-state-dropdown__error"
847
+ );
848
+ r == null || r.classList.toggle("spot-state-dropdown__error--visible", t);
834
849
  }
835
850
  _setupStateDropdownListener() {
836
851
  this._stateSelectEl && this._stateSelectEl.addEventListener("change", () => {
837
- this.currentState = this._stateSelectEl.value, this._setRadiosDisabled(!this._isQuotingAvailable());
852
+ this.currentState = this._stateSelectEl.value, this._setRadiosDisabled(!this._isQuotingAvailable()), this._setNonUsResidentError(this.currentState === E);
838
853
  });
839
854
  }
840
855
  _setupOptionListeners(t) {
@@ -843,9 +858,9 @@ class G {
843
858
  ), s = t.querySelectorAll(".spot-selection__option");
844
859
  r.forEach((i) => {
845
860
  i.addEventListener("change", (a) => {
846
- var l, m, f, v;
861
+ var p, m, f, v;
847
862
  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 === w.YES && ((m = this.quote) != null && m.communication.paymentTerms && H(this.paymentTermsEl, this.quote), (f = this.options.callbacks) != null && f.onOptIn)) {
863
+ if (this.hideSelectionError(), this.currentSelection = o, s.forEach((h) => h.classList.remove("selected")), (p = e.closest(".spot-selection__option")) == null || p.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), o === _.YES && ((m = this.quote) != null && m.communication.paymentTerms && H(this.paymentTermsEl, this.quote), (f = this.options.callbacks) != null && f.onOptIn)) {
849
864
  const h = {
850
865
  status: "QUOTE_ACCEPTED",
851
866
  spotPrice: this.quote.spotPrice,
@@ -853,41 +868,41 @@ class G {
853
868
  state: this._validState()
854
869
  };
855
870
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
856
- const p = this.options.quoteRequestData;
871
+ const l = this.options.quoteRequestData;
857
872
  h.batchQuoteDetails = this.quote.originalQuotes.map(
858
873
  (u) => {
859
874
  var b;
860
- const d = (b = p.items) == null ? void 0 : b.find(
861
- (y) => (y.cartItemId || `item-${p.items.indexOf(y) + 1}`) === u.cartItemId
875
+ const c = (b = l.items) == null ? void 0 : b.find(
876
+ (w) => (w.cartItemId || `item-${l.items.indexOf(w) + 1}`) === u.cartItemId
862
877
  );
863
878
  return {
864
879
  quoteId: u.id,
865
- productPrice: (d == null ? void 0 : d.productPrice) || u.spotPrice,
866
- cartItemId: (d == null ? void 0 : d.cartItemId) || ""
880
+ productPrice: (c == null ? void 0 : c.productPrice) || u.spotPrice,
881
+ cartItemId: (c == null ? void 0 : c.cartItemId) || ""
867
882
  };
868
883
  }
869
884
  );
870
885
  }
871
886
  this.options.callbacks.onOptIn(h);
872
887
  }
873
- if (o === w.NO && ((v = this.options.callbacks) != null && v.onOptOut)) {
888
+ if (o === _.NO && ((v = this.options.callbacks) != null && v.onOptOut)) {
874
889
  const h = {
875
890
  status: "QUOTE_DECLINED",
876
891
  quoteId: this.quote.id,
877
892
  state: this._validState()
878
893
  };
879
894
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
880
- const p = this.options.quoteRequestData;
895
+ const l = this.options.quoteRequestData;
881
896
  h.batchQuoteDetails = this.quote.originalQuotes.map(
882
897
  (u) => {
883
898
  var b;
884
- const d = (b = p.items) == null ? void 0 : b.find(
885
- (y) => (y.cartItemId || `item-${p.items.indexOf(y) + 1}`) === u.cartItemId
899
+ const c = (b = l.items) == null ? void 0 : b.find(
900
+ (w) => (w.cartItemId || `item-${l.items.indexOf(w) + 1}`) === u.cartItemId
886
901
  );
887
902
  return {
888
903
  quoteId: u.id,
889
- productPrice: (d == null ? void 0 : d.productPrice) || u.spotPrice,
890
- cartItemId: (d == null ? void 0 : d.cartItemId) || ""
904
+ productPrice: (c == null ? void 0 : c.productPrice) || u.spotPrice,
905
+ cartItemId: (c == null ? void 0 : c.cartItemId) || ""
891
906
  };
892
907
  }
893
908
  );
@@ -920,34 +935,37 @@ class G {
920
935
  }
921
936
  async updateQuote(t) {
922
937
  var r, s, i, a;
938
+ if (this._destroyed) return !1;
923
939
  try {
924
940
  const e = {
925
941
  ...this.options,
926
942
  quoteRequestData: t
927
943
  };
928
944
  M(e);
929
- const { environment: o, partnerId: l, customEndpoint: m } = this.options.apiConfig, f = m || A[o], h = "items" in e.quoteRequestData ? await S(
945
+ const { environment: o, partnerId: p, customEndpoint: m } = this.options.apiConfig, f = m || R[o], h = "items" in e.quoteRequestData ? await N(
930
946
  f,
931
- l,
947
+ p,
932
948
  e.quoteRequestData,
933
949
  this._validState()
934
- ) : await N(
950
+ ) : await T(
935
951
  f,
936
- l,
952
+ p,
937
953
  e.quoteRequestData,
938
954
  this._validState()
939
955
  );
956
+ if (this._destroyed) return !1;
940
957
  if (h.status !== "QUOTE_AVAILABLE")
941
- return this.destroy(), h.status === "NO_MATCHING_QUOTE" && ((r = this.options.callbacks) != null && r.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
958
+ return this._teardownDom(), h.status === "NO_MATCHING_QUOTE" && ((r = this.options.callbacks) != null && r.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
942
959
  status: "NO_MATCHING_QUOTE",
943
960
  data: e.quoteRequestData
944
961
  }), !1;
945
- if (this.options.quoteRequestData = e.quoteRequestData, this.quote = h.data, 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);
962
+ if (this.options.quoteRequestData = e.quoteRequestData, this.quote = h.data, this._teardownDom(), this._renderWidget(), (s = this.options.callbacks) != null && s.onQuoteRetrieved) {
963
+ const l = this.options.callbacks.onQuoteRetrieved(this.quote);
964
+ l && this._applyQuoteUpdates(l);
948
965
  }
949
966
  return !0;
950
967
  } catch (e) {
968
+ if (this._destroyed) return !1;
951
969
  const o = e;
952
970
  return (a = (i = this.options.callbacks) == null ? void 0 : i.onError) == null || a.call(i, {
953
971
  message: o.message,
@@ -958,19 +976,19 @@ class G {
958
976
  }
959
977
  getSelection() {
960
978
  var r, s, i;
961
- if (this.currentSelection == null || this.currentSelection == w.UNSELECTED) return null;
979
+ if (this.currentSelection == null || this.currentSelection == _.UNSELECTED) return null;
962
980
  const t = {
963
981
  selection: this.currentSelection,
964
982
  quoteId: (r = this.quote) == null ? void 0 : r.id,
965
983
  spotPrice: (s = this.quote) == null ? void 0 : s.spotPrice,
966
- status: this.currentSelection === w.YES ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED",
984
+ status: this.currentSelection === _.YES ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED",
967
985
  state: this.currentState
968
986
  };
969
987
  if ((i = this.quote) != null && i.originalQuotes && this.quote.originalQuotes.length > 0) {
970
988
  const a = this.options.quoteRequestData;
971
989
  t.batchQuoteDetails = this.quote.originalQuotes.map((e) => {
972
- var l;
973
- const o = (l = a.items) == null ? void 0 : l.find(
990
+ var p;
991
+ const o = (p = a.items) == null ? void 0 : p.find(
974
992
  (m) => (m.cartItemId || `item-${a.items.indexOf(m) + 1}`) === e.cartItemId
975
993
  );
976
994
  return {
@@ -983,11 +1001,17 @@ class G {
983
1001
  return t;
984
1002
  }
985
1003
  destroy() {
1004
+ this._destroyed = !0, this._teardownDom();
1005
+ }
1006
+ // Detaches the rendered DOM and its listeners without marking the instance
1007
+ // as permanently destroyed. Used by destroy() and by internal re-renders
1008
+ // (updateQuote, quote updates) that tear down and rebuild the same instance.
1009
+ _teardownDom() {
986
1010
  window.removeEventListener("resize", this._onResize), this._resizeObserver && (this._resizeObserver.disconnect(), this._resizeObserver = void 0), this._resizeTimeout && window.clearTimeout(this._resizeTimeout), this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container);
987
1011
  }
988
1012
  }
989
1013
  export {
990
1014
  E as NON_US_RESIDENT_VALUE,
991
- w as SelectionEnum,
992
- G as default
1015
+ _ as SelectionEnum,
1016
+ K as default
993
1017
  };