@getspot/spot-widget 4.0.4 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +4 -4
- package/dist/index.es.js +97 -85
- package/dist/index.umd.js +3 -3
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [4.1.0](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@4.0.4...@getspot/spot-widget@4.1.0) (2026-03-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **core:** add support for AED, GBP, MAD, and SAR currencies ([00203e3](https://gitlab.com/getspot/spot-widget/commit/00203e3c492b472a311161b58d02d2af56543dac))
|
|
7
|
+
|
|
1
8
|
## [4.0.4](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@4.0.3...@getspot/spot-widget@4.0.4) (2026-02-12)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -97,7 +97,7 @@ const widget = new SpotWidget(options);
|
|
|
97
97
|
{
|
|
98
98
|
startDate: string; // ISO 8601 date
|
|
99
99
|
endDate: string; // ISO 8601 date
|
|
100
|
-
currencyCode: 'USD' | 'CAD' | 'AUD';
|
|
100
|
+
currencyCode: 'USD' | 'CAD' | 'AUD' | 'NZD' | 'EUR' | 'MXN' | 'AED' | 'GBP' | 'MAD' | 'SAR';
|
|
101
101
|
eventType: string; // Event description
|
|
102
102
|
productType: 'Pass' | 'Trip' | 'Registration';
|
|
103
103
|
productDuration: 'Daily' | 'Seasonal' | 'Trip' | 'Event';
|
|
@@ -115,7 +115,7 @@ const widget = new SpotWidget(options);
|
|
|
115
115
|
{
|
|
116
116
|
cartId: string;
|
|
117
117
|
cartName: string;
|
|
118
|
-
currencyCode: 'USD' | 'CAD' | 'AUD';
|
|
118
|
+
currencyCode: 'USD' | 'CAD' | 'AUD' | 'NZD' | 'EUR' | 'MXN' | 'AED' | 'GBP' | 'MAD' | 'SAR';
|
|
119
119
|
items: Array<{
|
|
120
120
|
// All single product fields except cartId and currencyCode
|
|
121
121
|
cartItemId?: string; // Optional item identifier
|
|
@@ -369,7 +369,7 @@ export interface QuoteItem {
|
|
|
369
369
|
participantDescription?: string;
|
|
370
370
|
eventType: string;
|
|
371
371
|
eventId?: string;
|
|
372
|
-
currencyCode: "USD" | "CAD" | "AUD";
|
|
372
|
+
currencyCode: "USD" | "CAD" | "AUD" | "NZD" | "EUR" | "MXN" | "AED" | "GBP" | "MAD" | "SAR";
|
|
373
373
|
startDate: string;
|
|
374
374
|
endDate: string;
|
|
375
375
|
partnerRiskEnd?: Date;
|
|
@@ -389,7 +389,7 @@ export interface QuoteItem {
|
|
|
389
389
|
export interface BatchQuoteRequest {
|
|
390
390
|
cartId: string;
|
|
391
391
|
cartName: string;
|
|
392
|
-
currencyCode: "USD" | "CAD" | "AUD";
|
|
392
|
+
currencyCode: "USD" | "CAD" | "AUD" | "NZD" | "EUR" | "MXN" | "AED" | "GBP" | "MAD" | "SAR";
|
|
393
393
|
metadata?: QuoteMetadata;
|
|
394
394
|
isPartialPayment?: boolean;
|
|
395
395
|
roundTo?: number;
|
package/dist/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ async function I(m, t, o) {
|
|
|
17
17
|
throw s instanceof Error ? s : new Error("Unknown error occurred while fetching quote");
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
20
|
+
async function L(m, t, o) {
|
|
21
21
|
try {
|
|
22
22
|
const s = m.replace("/quote", "/quote/batch"), i = await fetch(s, {
|
|
23
23
|
method: "POST",
|
|
@@ -47,12 +47,12 @@ async function H(m, t, o) {
|
|
|
47
47
|
...p,
|
|
48
48
|
cartItemId: p.cartItemId || `item-${u + 1}`
|
|
49
49
|
}))
|
|
50
|
-
}, r = await
|
|
50
|
+
}, r = await L(m, t, i);
|
|
51
51
|
if (r.status !== "QUOTES_AVAILABLE" && r.status !== "QUOTE_AVAILABLE")
|
|
52
52
|
return { status: "NO_MATCHING_QUOTE" };
|
|
53
53
|
const n = r.quotes.map((p) => {
|
|
54
54
|
const u = o.items.find(
|
|
55
|
-
(f,
|
|
55
|
+
(f, g) => (f.cartItemId || `item-${g + 1}`) === p.cartItemId
|
|
56
56
|
);
|
|
57
57
|
return u ? u.participantDescription ? `${u.productName} - ${u.participantDescription}` : u.productName : `Item ${p.id}`;
|
|
58
58
|
}), e = Math.round((r.totalSpotPrice || r.spotPrice || 0) * 100) / 100;
|
|
@@ -88,7 +88,7 @@ const O = {
|
|
|
88
88
|
production: "https://api.getspot.com/v1/quote",
|
|
89
89
|
local: "http://localhost:3999/api/v1/quote"
|
|
90
90
|
};
|
|
91
|
-
function
|
|
91
|
+
function N(m) {
|
|
92
92
|
const {
|
|
93
93
|
apiConfig: t = {},
|
|
94
94
|
quoteRequestData: o,
|
|
@@ -118,11 +118,11 @@ function z(m) {
|
|
|
118
118
|
"cartId",
|
|
119
119
|
"productName"
|
|
120
120
|
];
|
|
121
|
-
function
|
|
121
|
+
function g(c, l = null) {
|
|
122
122
|
const d = l !== null ? `quoteRequestData[${l}]` : "quoteRequestData";
|
|
123
|
-
f.forEach((
|
|
124
|
-
if (!Object.prototype.hasOwnProperty.call(c,
|
|
125
|
-
throw new Error(`Missing required ${d} field: '${
|
|
123
|
+
f.forEach((v) => {
|
|
124
|
+
if (!Object.prototype.hasOwnProperty.call(c, v) || c[v] === void 0 || c[v] === null)
|
|
125
|
+
throw new Error(`Missing required ${d} field: '${v}'`);
|
|
126
126
|
});
|
|
127
127
|
const y = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
128
128
|
if (!y.test(c.startDate))
|
|
@@ -131,7 +131,7 @@ function z(m) {
|
|
|
131
131
|
throw new Error(`${d}.endDate must be a valid ISO8601 string`);
|
|
132
132
|
if (typeof c.currencyCode != "string")
|
|
133
133
|
throw new Error(`${d}.currencyCode must be a string`);
|
|
134
|
-
if (!["USD", "CAD", "AUD"].includes(c.currencyCode))
|
|
134
|
+
if (!["USD", "CAD", "AUD", "NZD", "EUR", "MXN", "AED", "GBP", "MAD", "SAR"].includes(c.currencyCode))
|
|
135
135
|
throw new Error(`Invalid ${d}.currencyCode: ${c.currencyCode}`);
|
|
136
136
|
if (typeof c.eventType != "string")
|
|
137
137
|
throw new Error(`${d}.eventType must be a string`);
|
|
@@ -166,7 +166,7 @@ function z(m) {
|
|
|
166
166
|
throw new Error("quoteRequestData.cartName must be a string");
|
|
167
167
|
if (!y || typeof y != "string")
|
|
168
168
|
throw new Error("quoteRequestData.currencyCode must be a string");
|
|
169
|
-
if (!["USD", "CAD", "AUD"].includes(y))
|
|
169
|
+
if (!["USD", "CAD", "AUD", "NZD", "EUR", "MXN", "AED", "GBP", "MAD", "SAR"].includes(y))
|
|
170
170
|
throw new Error(`Invalid quoteRequestData.currencyCode: ${y}`);
|
|
171
171
|
if (!Array.isArray(w) || w.length === 0)
|
|
172
172
|
throw new Error("quoteRequestData.items must be a non-empty array");
|
|
@@ -180,36 +180,36 @@ function z(m) {
|
|
|
180
180
|
"productId",
|
|
181
181
|
"productName"
|
|
182
182
|
];
|
|
183
|
-
w.forEach((
|
|
184
|
-
if (!
|
|
183
|
+
w.forEach((v, k) => {
|
|
184
|
+
if (!v || typeof v != "object")
|
|
185
185
|
throw new Error(`quoteRequestData.items[${k}] must be a non-null object`);
|
|
186
186
|
const _ = `quoteRequestData.items[${k}]`;
|
|
187
187
|
C.forEach((E) => {
|
|
188
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
188
|
+
if (!Object.prototype.hasOwnProperty.call(v, E) || v[E] === void 0 || v[E] === null)
|
|
189
189
|
throw new Error(`Missing required ${_} field: '${E}'`);
|
|
190
190
|
});
|
|
191
191
|
const x = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
192
|
-
if (!x.test(
|
|
192
|
+
if (!x.test(v.startDate))
|
|
193
193
|
throw new Error(`${_}.startDate must be a valid ISO8601 string`);
|
|
194
|
-
if (!x.test(
|
|
194
|
+
if (!x.test(v.endDate))
|
|
195
195
|
throw new Error(`${_}.endDate must be a valid ISO8601 string`);
|
|
196
|
-
if (typeof
|
|
196
|
+
if (typeof v.eventType != "string")
|
|
197
197
|
throw new Error(`${_}.eventType must be a string`);
|
|
198
|
-
if (typeof
|
|
198
|
+
if (typeof v.productType != "string")
|
|
199
199
|
throw new Error(`${_}.productType must be a string`);
|
|
200
|
-
const
|
|
201
|
-
if (!
|
|
202
|
-
throw new Error(`${_}.productType must be one of ${
|
|
203
|
-
if (typeof
|
|
200
|
+
const D = ["Pass", "Trip", "Registration"];
|
|
201
|
+
if (!D.includes(v.productType))
|
|
202
|
+
throw new Error(`${_}.productType must be one of ${D.join(", ")}`);
|
|
203
|
+
if (typeof v.productDuration != "string")
|
|
204
204
|
throw new Error(`${_}.productDuration must be a string`);
|
|
205
|
-
const
|
|
206
|
-
if (!
|
|
207
|
-
throw new Error(`${_}.productDuration must be one of ${
|
|
208
|
-
if (typeof
|
|
205
|
+
const T = ["Daily", "Seasonal", "Trip", "Event"];
|
|
206
|
+
if (!T.includes(v.productDuration))
|
|
207
|
+
throw new Error(`${_}.productDuration must be one of ${T.join(", ")}`);
|
|
208
|
+
if (typeof v.productPrice != "number" || isNaN(v.productPrice))
|
|
209
209
|
throw new Error(`${_}.productPrice must be a valid number`);
|
|
210
|
-
if (typeof
|
|
210
|
+
if (typeof v.productId != "string")
|
|
211
211
|
throw new Error(`${_}.productId must be a string`);
|
|
212
|
-
if (typeof
|
|
212
|
+
if (typeof v.productName != "string")
|
|
213
213
|
throw new Error(`${_}.productName must be a string`);
|
|
214
214
|
});
|
|
215
215
|
} else if (Array.isArray(o)) {
|
|
@@ -218,10 +218,10 @@ function z(m) {
|
|
|
218
218
|
o.forEach((c, l) => {
|
|
219
219
|
if (!c || typeof c != "object")
|
|
220
220
|
throw new Error(`quoteRequestData[${l}] must be a non-null object`);
|
|
221
|
-
|
|
221
|
+
g(c, l);
|
|
222
222
|
});
|
|
223
223
|
} else
|
|
224
|
-
|
|
224
|
+
g(o);
|
|
225
225
|
if ([
|
|
226
226
|
"onOptIn",
|
|
227
227
|
"onOptOut",
|
|
@@ -255,7 +255,7 @@ function $(m, { name: t, description: o }) {
|
|
|
255
255
|
parent: m
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function S(m, t = []) {
|
|
259
259
|
const o = a("ul", {
|
|
260
260
|
className: "spot-benefits__list",
|
|
261
261
|
parent: m
|
|
@@ -269,7 +269,7 @@ function P(m, t = []) {
|
|
|
269
269
|
</svg>`, a("span", { text: s, parent: i });
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function P(m, t = []) {
|
|
273
273
|
if (!t || t.length === 0) return;
|
|
274
274
|
const o = a("div", {
|
|
275
275
|
className: "spot-qualifying-reasons__container",
|
|
@@ -300,19 +300,19 @@ function S(m, t = []) {
|
|
|
300
300
|
n = "./assets/";
|
|
301
301
|
}
|
|
302
302
|
s.forEach((e) => {
|
|
303
|
-
var
|
|
303
|
+
var g, h, c;
|
|
304
304
|
const p = a("div", {
|
|
305
305
|
className: "spot-qualifying-reasons__item",
|
|
306
306
|
parent: i
|
|
307
307
|
}), u = a("div", {
|
|
308
308
|
className: "spot-qualifying-reasons__icon-wrapper",
|
|
309
309
|
parent: p
|
|
310
|
-
}), f = r[((
|
|
310
|
+
}), f = r[((g = e.benefitType) == null ? void 0 : g.name) || ""] || r[e.name || ""];
|
|
311
311
|
if (f) {
|
|
312
312
|
const l = a("img", {
|
|
313
313
|
parent: u
|
|
314
314
|
});
|
|
315
|
-
l.src = n + f, l.alt = ((
|
|
315
|
+
l.src = n + f, l.alt = ((h = e.benefitType) == null ? void 0 : h.name) || e.name || "", l.className = "spot-qualifying-reasons__icon";
|
|
316
316
|
}
|
|
317
317
|
a("span", {
|
|
318
318
|
className: "spot-qualifying-reasons__label",
|
|
@@ -321,7 +321,7 @@ function S(m, t = []) {
|
|
|
321
321
|
});
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function A(m, t = [], o) {
|
|
325
325
|
if (t.length === 0 || !o || o <= 1)
|
|
326
326
|
return;
|
|
327
327
|
const s = /* @__PURE__ */ new Map();
|
|
@@ -365,40 +365,52 @@ function V(m, t = [], o) {
|
|
|
365
365
|
className: "spot-covered-items__arrow",
|
|
366
366
|
innerHTML: "▼",
|
|
367
367
|
parent: u
|
|
368
|
-
}),
|
|
368
|
+
}), g = a("div", {
|
|
369
369
|
className: "spot-covered-items__content",
|
|
370
370
|
parent: n
|
|
371
|
-
}),
|
|
371
|
+
}), h = a("ul", {
|
|
372
372
|
className: "spot-covered-items__list",
|
|
373
|
-
parent:
|
|
373
|
+
parent: g
|
|
374
374
|
});
|
|
375
375
|
r.forEach(({ displayText: l }) => {
|
|
376
|
-
const d = a("li", { parent:
|
|
376
|
+
const d = a("li", { parent: h });
|
|
377
377
|
a("span", { text: l, parent: d });
|
|
378
378
|
});
|
|
379
379
|
let c = !1;
|
|
380
|
-
|
|
381
|
-
l.stopPropagation(), c = !c,
|
|
382
|
-
}), p.setAttribute("aria-expanded", "false"), p.setAttribute("aria-controls", "covered-items-list"),
|
|
380
|
+
g.style.display = "none", p.addEventListener("click", (l) => {
|
|
381
|
+
l.stopPropagation(), c = !c, g.style.display = c ? "block" : "none", f.innerHTML = c ? "▲" : "▼", p.setAttribute("aria-expanded", c.toString());
|
|
382
|
+
}), p.setAttribute("aria-expanded", "false"), p.setAttribute("aria-controls", "covered-items-list"), g.setAttribute("id", "covered-items-list");
|
|
383
383
|
}
|
|
384
|
-
|
|
385
|
-
|
|
384
|
+
const R = {
|
|
385
|
+
USD: "$",
|
|
386
|
+
CAD: "CAD $",
|
|
387
|
+
AUD: "AUD $",
|
|
388
|
+
NZD: "NZD $",
|
|
389
|
+
MXN: "MXN $",
|
|
390
|
+
EUR: "EUR €",
|
|
391
|
+
GBP: "GBP £",
|
|
392
|
+
AED: "AED ",
|
|
393
|
+
MAD: "MAD ",
|
|
394
|
+
SAR: "SAR "
|
|
395
|
+
};
|
|
396
|
+
function V(m, t = [], o = "USD") {
|
|
397
|
+
const s = R[o] ?? `${o} `, i = a("div", {
|
|
386
398
|
className: "spot-table__container",
|
|
387
399
|
parent: m
|
|
388
|
-
}),
|
|
400
|
+
}), r = a("table", {
|
|
389
401
|
className: "spot-refund__table spot-table--dynamic",
|
|
390
|
-
parent:
|
|
391
|
-
}),
|
|
392
|
-
a("th", { text: "When you cancel", parent:
|
|
393
|
-
const
|
|
394
|
-
t.forEach(({ text:
|
|
395
|
-
const
|
|
396
|
-
a("td", { text:
|
|
397
|
-
const
|
|
398
|
-
a("td", { text:
|
|
402
|
+
parent: i
|
|
403
|
+
}), n = a("thead", { parent: r }), e = a("tr", { parent: n });
|
|
404
|
+
a("th", { text: "When you cancel", parent: e }), a("th", { text: "You will receive", parent: e });
|
|
405
|
+
const p = a("tbody", { parent: r });
|
|
406
|
+
t.forEach(({ text: u, percent: f, amount: g }) => {
|
|
407
|
+
const h = a("tr", { parent: p });
|
|
408
|
+
a("td", { text: u, parent: h });
|
|
409
|
+
const c = f === "Not eligible for refund" ? "Not eligible for a refund" : `${s}${g} refund`;
|
|
410
|
+
a("td", { text: c, parent: h });
|
|
399
411
|
});
|
|
400
412
|
}
|
|
401
|
-
function
|
|
413
|
+
function Q(m, t, o) {
|
|
402
414
|
const s = a("div", {
|
|
403
415
|
className: "spot-selection__options",
|
|
404
416
|
parent: m
|
|
@@ -420,7 +432,7 @@ function R(m, t, o) {
|
|
|
420
432
|
}), e = a("input", { parent: n });
|
|
421
433
|
return e.type = "radio", e.name = "selection", e.value = b.NO, t === b.NO && (e.checked = !0), a("span", { text: o.noOptionText, parent: n }), s;
|
|
422
434
|
}
|
|
423
|
-
function
|
|
435
|
+
function M(m, t) {
|
|
424
436
|
var i;
|
|
425
437
|
const o = (i = t.communication) == null ? void 0 : i.paymentTerms, s = a("div", {
|
|
426
438
|
className: "spot-payment-terms",
|
|
@@ -436,7 +448,7 @@ function N(m, t) {
|
|
|
436
448
|
parent: s
|
|
437
449
|
}), s;
|
|
438
450
|
}
|
|
439
|
-
function
|
|
451
|
+
function Z(m, t, o = "bottom-right") {
|
|
440
452
|
if (o === "top-right") {
|
|
441
453
|
const e = a("div", {
|
|
442
454
|
className: "spot-logo__top-right",
|
|
@@ -496,13 +508,13 @@ function A(m, t, o = "bottom-right") {
|
|
|
496
508
|
}
|
|
497
509
|
return s;
|
|
498
510
|
}
|
|
499
|
-
const Z = ":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)}}";
|
|
500
|
-
function
|
|
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 B(m) {
|
|
501
513
|
const t = document.createElement("style");
|
|
502
514
|
t.textContent = m, document.head.appendChild(t);
|
|
503
515
|
}
|
|
504
|
-
U
|
|
505
|
-
const
|
|
516
|
+
B(U);
|
|
517
|
+
const z = {
|
|
506
518
|
sandbox: "https://api.sandbox.getspot.com/api/v1/quote",
|
|
507
519
|
production: "https://api.getspot.com/api/v1/quote",
|
|
508
520
|
local: "http://localhost:3999/api/v1/quote"
|
|
@@ -524,12 +536,12 @@ class j {
|
|
|
524
536
|
async _init() {
|
|
525
537
|
var t, o, s, i, r;
|
|
526
538
|
try {
|
|
527
|
-
|
|
539
|
+
N(this.options);
|
|
528
540
|
let n;
|
|
529
541
|
if (this.options.useMockData && this.options.mockData)
|
|
530
542
|
n = this.options.mockData;
|
|
531
543
|
else {
|
|
532
|
-
const { environment: e, partnerId: p } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint ||
|
|
544
|
+
const { environment: e, partnerId: p } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || z[e];
|
|
533
545
|
n = "items" in this.options.quoteRequestData ? await H(
|
|
534
546
|
f,
|
|
535
547
|
p,
|
|
@@ -558,9 +570,9 @@ class j {
|
|
|
558
570
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
559
571
|
const p = this.options.quoteRequestData;
|
|
560
572
|
e.batchQuoteDetails = this.quote.originalQuotes.map((u) => {
|
|
561
|
-
var
|
|
562
|
-
const f = (
|
|
563
|
-
(
|
|
573
|
+
var g;
|
|
574
|
+
const f = (g = p.items) == null ? void 0 : g.find(
|
|
575
|
+
(h) => (h.cartItemId || `item-${p.items.indexOf(h) + 1}`) === u.cartItemId
|
|
564
576
|
);
|
|
565
577
|
return {
|
|
566
578
|
quoteId: u.id,
|
|
@@ -593,12 +605,12 @@ class j {
|
|
|
593
605
|
this.container.style.setProperty(r, i);
|
|
594
606
|
}), $(this.container, this.quote.communication);
|
|
595
607
|
const t = document.createElement("div");
|
|
596
|
-
if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ?
|
|
608
|
+
if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ? P(t, this.quote.qualifyingReasons) : S(t, this.quote.communication.bulletPoints), this.quote.coveredItems) {
|
|
597
609
|
const s = this._getTotalItemsInRequest();
|
|
598
|
-
|
|
610
|
+
A(t, this.quote.coveredItems, s);
|
|
599
611
|
}
|
|
600
|
-
this.options.showTable && !this.quote.qualifyingReasons &&
|
|
601
|
-
const o =
|
|
612
|
+
this.options.showTable && !this.quote.qualifyingReasons && V(t, this.quote.payoutSchedule, this.quote.currencyCode);
|
|
613
|
+
const o = Q(
|
|
602
614
|
t,
|
|
603
615
|
this.options.selection,
|
|
604
616
|
this.quote.communication
|
|
@@ -606,7 +618,7 @@ class j {
|
|
|
606
618
|
t.appendChild(o), this.paymentTermsEl = a("div", {
|
|
607
619
|
className: "spot-payment-terms__wrapper",
|
|
608
620
|
parent: t
|
|
609
|
-
}), this.currentSelection === b.YES &&
|
|
621
|
+
}), this.currentSelection === b.YES && M(this.paymentTermsEl, this.quote), Z(this.container, this.quote, this.options.logoPosition), window.addEventListener("resize", this._onResize), this._setupResizeObserver(), this._updateLayout(), this._setupOptionListeners(o);
|
|
610
622
|
}
|
|
611
623
|
_updateLayout() {
|
|
612
624
|
if (!this.container || !this.quote) return;
|
|
@@ -659,17 +671,17 @@ class j {
|
|
|
659
671
|
), s = t.querySelectorAll(".spot-selection__option");
|
|
660
672
|
o.forEach((i) => {
|
|
661
673
|
i.addEventListener("change", (r) => {
|
|
662
|
-
var p, u, f,
|
|
674
|
+
var p, u, f, g;
|
|
663
675
|
const n = r.target, e = n.value;
|
|
664
|
-
if (this.hideSelectionError(), this.currentSelection = e, s.forEach((
|
|
665
|
-
const
|
|
676
|
+
if (this.hideSelectionError(), this.currentSelection = e, s.forEach((h) => h.classList.remove("selected")), (p = n.closest(".spot-selection__option")) == null || p.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), e === b.YES && ((u = this.quote) != null && u.communication.paymentTerms && M(this.paymentTermsEl, this.quote), (f = this.options.callbacks) != null && f.onOptIn)) {
|
|
677
|
+
const h = {
|
|
666
678
|
status: "QUOTE_ACCEPTED",
|
|
667
679
|
spotPrice: this.quote.spotPrice,
|
|
668
680
|
quoteId: this.quote.id
|
|
669
681
|
};
|
|
670
682
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
671
683
|
const c = this.options.quoteRequestData;
|
|
672
|
-
|
|
684
|
+
h.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
673
685
|
(l) => {
|
|
674
686
|
var y;
|
|
675
687
|
const d = (y = c.items) == null ? void 0 : y.find(
|
|
@@ -683,16 +695,16 @@ class j {
|
|
|
683
695
|
}
|
|
684
696
|
);
|
|
685
697
|
}
|
|
686
|
-
this.options.callbacks.onOptIn(
|
|
698
|
+
this.options.callbacks.onOptIn(h);
|
|
687
699
|
}
|
|
688
|
-
if (e === b.NO && ((
|
|
689
|
-
const
|
|
700
|
+
if (e === b.NO && ((g = this.options.callbacks) != null && g.onOptOut)) {
|
|
701
|
+
const h = {
|
|
690
702
|
status: "QUOTE_DECLINED",
|
|
691
703
|
quoteId: this.quote.id
|
|
692
704
|
};
|
|
693
705
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
694
706
|
const c = this.options.quoteRequestData;
|
|
695
|
-
|
|
707
|
+
h.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
696
708
|
(l) => {
|
|
697
709
|
var y;
|
|
698
710
|
const d = (y = c.items) == null ? void 0 : y.find(
|
|
@@ -706,7 +718,7 @@ class j {
|
|
|
706
718
|
}
|
|
707
719
|
);
|
|
708
720
|
}
|
|
709
|
-
this.options.callbacks.onOptOut(
|
|
721
|
+
this.options.callbacks.onOptOut(h);
|
|
710
722
|
}
|
|
711
723
|
});
|
|
712
724
|
});
|
|
@@ -739,8 +751,8 @@ class j {
|
|
|
739
751
|
...this.options,
|
|
740
752
|
quoteRequestData: t
|
|
741
753
|
};
|
|
742
|
-
|
|
743
|
-
const { environment: e, partnerId: p, customEndpoint: u } = this.options.apiConfig, f = u ||
|
|
754
|
+
N(n);
|
|
755
|
+
const { environment: e, partnerId: p, customEndpoint: u } = this.options.apiConfig, f = u || z[e], h = "items" in n.quoteRequestData ? await H(
|
|
744
756
|
f,
|
|
745
757
|
p,
|
|
746
758
|
n.quoteRequestData
|
|
@@ -749,12 +761,12 @@ class j {
|
|
|
749
761
|
p,
|
|
750
762
|
n.quoteRequestData
|
|
751
763
|
);
|
|
752
|
-
if (
|
|
753
|
-
return this.destroy(),
|
|
764
|
+
if (h.status !== "QUOTE_AVAILABLE")
|
|
765
|
+
return this.destroy(), h.status === "NO_MATCHING_QUOTE" && ((o = this.options.callbacks) != null && o.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
|
|
754
766
|
status: "NO_MATCHING_QUOTE",
|
|
755
767
|
data: n.quoteRequestData
|
|
756
768
|
}), !1;
|
|
757
|
-
if (this.options.quoteRequestData = n.quoteRequestData, this.quote =
|
|
769
|
+
if (this.options.quoteRequestData = n.quoteRequestData, this.quote = h.data, this.currentSelection = b.UNSELECTED, this.destroy(), this._renderWidget(), (s = this.options.callbacks) != null && s.onQuoteRetrieved) {
|
|
758
770
|
const c = this.options.callbacks.onQuoteRetrieved(this.quote);
|
|
759
771
|
c && this._applyQuoteUpdates(c);
|
|
760
772
|
}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(C,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(C=typeof globalThis<"u"?globalThis:C||self,E(C.SpotWidget={}))})(this,function(C){"use strict";async function E(m,t,o){try{const s=await fetch(m,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),i=await s.json();if(!s.ok){const r=new Error((i==null?void 0:i.message)||"Failed to fetch quote");throw r.status=s.status,r.responseBody=i,r}return i}catch(s){throw s instanceof Error?s:new Error("Unknown error occurred while fetching quote")}}async function O(m,t,o){try{const s=m.replace("/quote","/quote/batch"),i=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),r=await i.json();if(!i.ok){const n=new Error((r==null?void 0:r.message)||"Failed to fetch batch quote");throw n.status=i.status,n.responseBody=r,n}return r}catch(s){throw s instanceof Error?s:new Error("Unknown error occurred while fetching batch quote")}}async function
|
|
1
|
+
(function(C,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(C=typeof globalThis<"u"?globalThis:C||self,E(C.SpotWidget={}))})(this,function(C){"use strict";async function E(m,t,o){try{const s=await fetch(m,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),i=await s.json();if(!s.ok){const r=new Error((i==null?void 0:i.message)||"Failed to fetch quote");throw r.status=s.status,r.responseBody=i,r}return i}catch(s){throw s instanceof Error?s:new Error("Unknown error occurred while fetching quote")}}async function O(m,t,o){try{const s=m.replace("/quote","/quote/batch"),i=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),r=await i.json();if(!i.ok){const n=new Error((r==null?void 0:r.message)||"Failed to fetch batch quote");throw n.status=i.status,n.responseBody=r,n}return r}catch(s){throw s instanceof Error?s:new Error("Unknown error occurred while fetching batch quote")}}async function D(m,t,o){var s;try{const i={...o,isPartialPayment:o.isPartialPayment||!1,roundTo:o.roundTo||void 0,items:o.items.map((p,u)=>({...p,cartItemId:p.cartItemId||`item-${u+1}`}))},r=await O(m,t,i);if(r.status!=="QUOTES_AVAILABLE"&&r.status!=="QUOTE_AVAILABLE")return{status:"NO_MATCHING_QUOTE"};const n=r.quotes.map(p=>{const u=o.items.find((f,g)=>(f.cartItemId||`item-${g+1}`)===p.cartItemId);return u?u.participantDescription?`${u.productName} - ${u.participantDescription}`:u.productName:`Item ${p.id}`}),e=Math.round((r.totalSpotPrice||r.spotPrice||0)*100)/100;return{status:"QUOTE_AVAILABLE",data:{id:r.quotes?r.quotes.map(p=>p.id).join(","):((s=r.data)==null?void 0:s.id)||"",spotPrice:e,currencyCode:r.currencyCode||"",communication:{...r.communication,yesOptionText:r.communication.yesOptionText.replace(String(r.totalSpotPrice),String(e))},payoutSchedule:r.payoutSchedule.map(p=>({...p,amount:p.amount!==void 0?p.amount:0})),coveredItems:n,originalQuotes:r.quotes||(r.data?[r.data]:[])},spotPrice:e,coveredItems:n}}catch(i){throw i instanceof Error?i:new Error("Unknown error occurred while fetching multiple quotes")}}const S={sandbox:"https://api.sandbox.getspot.com/v1/quote",production:"https://api.getspot.com/v1/quote",local:"http://localhost:3999/api/v1/quote"};function T(m){const{apiConfig:t={},quoteRequestData:o,callbacks:s={},location:i,theme:r}=m,{environment:n="sandbox",partnerId:e,customEndpoint:p}=t;if(!e||typeof e!="string")throw new Error("Invalid or missing partnerId in apiConfig");if(!(p||S[n]))throw new Error(`Invalid environment in apiConfig: ${n}`);if(!o||typeof o!="object"&&!Array.isArray(o))throw new Error("quoteRequestData must be a non-null object or array");const f=["startDate","endDate","currencyCode","eventType","productType","productDuration","productPrice","productId","cartId","productName"];function g(c,l=null){const d=l!==null?`quoteRequestData[${l}]`:"quoteRequestData";f.forEach(v=>{if(!Object.prototype.hasOwnProperty.call(c,v)||c[v]===void 0||c[v]===null)throw new Error(`Missing required ${d} field: '${v}'`)});const b=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!b.test(c.startDate))throw new Error(`${d}.startDate must be a valid ISO8601 string`);if(!b.test(c.endDate))throw new Error(`${d}.endDate must be a valid ISO8601 string`);if(typeof c.currencyCode!="string")throw new Error(`${d}.currencyCode must be a string`);if(!["USD","CAD","AUD","NZD","EUR","MXN","AED","GBP","MAD","SAR"].includes(c.currencyCode))throw new Error(`Invalid ${d}.currencyCode: ${c.currencyCode}`);if(typeof c.eventType!="string")throw new Error(`${d}.eventType must be a string`);if(typeof c.productType!="string")throw new Error(`${d}.productType must be a string`);const k=["Pass","Trip","Registration"];if(!k.includes(c.productType))throw new Error(`${d}.productType must be one of ${k.join(", ")}`);if(typeof c.productDuration!="string")throw new Error(`${d}.productDuration must be a string`);const q=["Daily","Seasonal","Trip","Event"];if(!q.includes(c.productDuration))throw new Error(`${d}.productDuration must be one of ${q.join(", ")}`);if(typeof c.productPrice!="number"||isNaN(c.productPrice))throw new Error(`${d}.productPrice must be a valid number`);if(typeof c.productId!="string")throw new Error(`${d}.productId must be a string`);if(typeof c.cartId!="string")throw new Error(`${d}.cartId must be a string`);if(typeof c.productName!="string")throw new Error(`${d}.productName must be a string`)}if("items"in o){const c=o,{cartId:l,cartName:d,currencyCode:b,items:w}=c;if(!l||typeof l!="string")throw new Error("quoteRequestData.cartId must be a string");if(!d||typeof d!="string")throw new Error("quoteRequestData.cartName must be a string");if(!b||typeof b!="string")throw new Error("quoteRequestData.currencyCode must be a string");if(!["USD","CAD","AUD","NZD","EUR","MXN","AED","GBP","MAD","SAR"].includes(b))throw new Error(`Invalid quoteRequestData.currencyCode: ${b}`);if(!Array.isArray(w)||w.length===0)throw new Error("quoteRequestData.items must be a non-empty array");const q=["startDate","endDate","eventType","productType","productDuration","productPrice","productId","productName"];w.forEach((v,N)=>{if(!v||typeof v!="object")throw new Error(`quoteRequestData.items[${N}] must be a non-null object`);const _=`quoteRequestData.items[${N}]`;q.forEach(x=>{if(!Object.prototype.hasOwnProperty.call(v,x)||v[x]===void 0||v[x]===null)throw new Error(`Missing required ${_} field: '${x}'`)});const M=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!M.test(v.startDate))throw new Error(`${_}.startDate must be a valid ISO8601 string`);if(!M.test(v.endDate))throw new Error(`${_}.endDate must be a valid ISO8601 string`);if(typeof v.eventType!="string")throw new Error(`${_}.eventType must be a string`);if(typeof v.productType!="string")throw new Error(`${_}.productType must be a string`);const z=["Pass","Trip","Registration"];if(!z.includes(v.productType))throw new Error(`${_}.productType must be one of ${z.join(", ")}`);if(typeof v.productDuration!="string")throw new Error(`${_}.productDuration must be a string`);const L=["Daily","Seasonal","Trip","Event"];if(!L.includes(v.productDuration))throw new Error(`${_}.productDuration must be one of ${L.join(", ")}`);if(typeof v.productPrice!="number"||isNaN(v.productPrice))throw new Error(`${_}.productPrice must be a valid number`);if(typeof v.productId!="string")throw new Error(`${_}.productId must be a string`);if(typeof v.productName!="string")throw new Error(`${_}.productName must be a string`)})}else if(Array.isArray(o)){if(o.length===0)throw new Error("quoteRequestData array cannot be empty");o.forEach((c,l)=>{if(!c||typeof c!="object")throw new Error(`quoteRequestData[${l}] must be a non-null object`);g(c,l)})}else g(o);if(["onOptIn","onOptOut","onQuoteRetrieved","onError","noMatchingQuote"].forEach(c=>{const l=s[c];if(l&&typeof l!="function")throw new Error(`Callback '${c}' must be a function.`)}),typeof i=="string"&&!document.querySelector(i))throw new Error(`Invalid location selector: '${i}'`);if(r&&typeof r!="object")throw new Error("Theme must be an object with CSS variables, do not include the '--' prefix")}var y=(m=>(m.YES="yes",m.NO="no",m.UNSELECTED="unselected",m))(y||{});function a(m,{text:t,className:o,parent:s,innerHTML:i,href:r,target:n}={}){const e=document.createElement(m);return o&&(e.className=o),t!=null&&(e.textContent=t),i!=null&&(e.innerHTML=i),r&&"href"in e&&(e.href=r),n&&"target"in e&&(e.target=n),s&&s.appendChild(e),e}function $(m,{name:t,description:o}){a("div",{className:"spot-header__title",text:t,parent:m}),a("div",{className:"spot-header__description",text:o,parent:m})}function P(m,t=[]){const o=a("ul",{className:"spot-benefits__list",parent:m});t.forEach(s=>{const i=a("li",{parent:o});i.innerHTML=`
|
|
2
2
|
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" class="spot-bullets__checkmark">
|
|
3
3
|
<path d="M11.6666 3.5L5.24998 9.91667L2.33331 7"
|
|
4
4
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
-
</svg>`,a("span",{text:s,parent:i})})}function
|
|
5
|
+
</svg>`,a("span",{text:s,parent:i})})}function A(m,t=[]){if(!t||t.length===0)return;const o=a("div",{className:"spot-qualifying-reasons__container",parent:m}),s=[...t].sort((e,p)=>e.rank-p.rank),i=a("div",{className:"spot-qualifying-reasons__grid",parent:o}),r={"Accident & Illness":"cross.svg","Family Emergencies":"users.svg",Layoffs:"building.svg","Jury Duty":"scale.svg","Work Travel Conflict":"briefcase.svg","Severe Weather":"umbrella.svg","Travel Interruption":"plane.svg","Military Duty":"medal.svg"};let n;try{const e=document.currentScript;if(e!=null&&e.src){const p=new URL(e.src);n=p.origin+p.pathname.replace(/\/[^/]*$/,"/")}else n=window.location.origin+window.location.pathname.replace(/\/[^/]*$/,"/");n+="assets/"}catch{n="./assets/"}s.forEach(e=>{var g,h,c;const p=a("div",{className:"spot-qualifying-reasons__item",parent:i}),u=a("div",{className:"spot-qualifying-reasons__icon-wrapper",parent:p}),f=r[((g=e.benefitType)==null?void 0:g.name)||""]||r[e.name||""];if(f){const l=a("img",{parent:u});l.src=n+f,l.alt=((h=e.benefitType)==null?void 0:h.name)||e.name||"",l.className="spot-qualifying-reasons__icon"}a("span",{className:"spot-qualifying-reasons__label",text:((c=e.benefitType)==null?void 0:c.name)||e.name||"",parent:p})})}function R(m,t=[],o){if(t.length===0||!o||o<=1)return;const s=new Map;t.forEach(l=>{s.set(l,(s.get(l)||0)+1)});const r=Array.from(s.entries()).map(([l,d])=>({item:l,count:d,displayText:d>1?`${d} x ${l}`:l})).sort((l,d)=>{const b=l.item.charAt(0),w=d.item.charAt(0),k=/[a-zA-Z]/.test(b),q=/[a-zA-Z]/.test(w);return!k&&q?-1:k&&!q?1:l.item.localeCompare(d.item,void 0,{sensitivity:"base"})}),n=a("div",{className:"spot-covered-items__container",parent:m}),e=a("div",{className:"spot-covered-items__header",parent:n}),p=a("button",{className:"spot-covered-items__toggle",parent:e});a("span",{className:"spot-covered-items__title",text:`Items Covered in Your Cart (${t.length})`,parent:p});const u=a("div",{className:"spot-covered-items__right-section",parent:p});a("span",{className:"spot-covered-items__view-all",text:"View All",parent:u});const f=a("span",{className:"spot-covered-items__arrow",innerHTML:"▼",parent:u}),g=a("div",{className:"spot-covered-items__content",parent:n}),h=a("ul",{className:"spot-covered-items__list",parent:g});r.forEach(({displayText:l})=>{const d=a("li",{parent:h});a("span",{text:l,parent:d})});let c=!1;g.style.display="none",p.addEventListener("click",l=>{l.stopPropagation(),c=!c,g.style.display=c?"block":"none",f.innerHTML=c?"▲":"▼",p.setAttribute("aria-expanded",c.toString())}),p.setAttribute("aria-expanded","false"),p.setAttribute("aria-controls","covered-items-list"),g.setAttribute("id","covered-items-list")}const V={USD:"$",CAD:"CAD $",AUD:"AUD $",NZD:"NZD $",MXN:"MXN $",EUR:"EUR €",GBP:"GBP £",AED:"AED ",MAD:"MAD ",SAR:"SAR "};function Q(m,t=[],o="USD"){const s=V[o]??`${o} `,i=a("div",{className:"spot-table__container",parent:m}),r=a("table",{className:"spot-refund__table spot-table--dynamic",parent:i}),n=a("thead",{parent:r}),e=a("tr",{parent:n});a("th",{text:"When you cancel",parent:e}),a("th",{text:"You will receive",parent:e});const p=a("tbody",{parent:r});t.forEach(({text:u,percent:f,amount:g})=>{const h=a("tr",{parent:p});a("td",{text:u,parent:h});const c=f==="Not eligible for refund"?"Not eligible for a refund":`${s}${g} refund`;a("td",{text:c,parent:h})})}function Z(m,t,o){const s=a("div",{className:"spot-selection__options",parent:m}),i=a("label",{className:`spot-selection__option ${t===y.YES?"selected":""}`,parent:s}),r=a("input",{parent:i});r.type="radio",r.name="selection",r.value=y.YES,t===y.YES&&(r.checked=!0),a("strong",{text:o.yesOptionText,parent:i}),a("span",{className:"spot-selection__recommended-tag",text:"Recommended",parent:i});const n=a("label",{className:`spot-selection__option ${t===y.NO?"selected":""}`,parent:s}),e=a("input",{parent:n});return e.type="radio",e.name="selection",e.value=y.NO,t===y.NO&&(e.checked=!0),a("span",{text:o.noOptionText,parent:n}),s}function I(m,t){var i;const o=(i=t.communication)==null?void 0:i.paymentTerms,s=a("div",{className:"spot-payment-terms",parent:m});return a("div",{className:"spot-payment-terms__header",text:"PAYMENT TERMS",parent:s}),a("div",{className:"spot-payment-terms__body",text:o||"",parent:s}),s}function U(m,t,o="bottom-right"){if(o==="top-right"){const e=a("div",{className:"spot-logo__top-right",parent:m});e.innerHTML=`
|
|
6
6
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
7
|
<rect width="145" height="28"/>
|
|
8
8
|
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
<rect width="45.405" height="14.8867" fill="white" transform="translate(87 8)"/>
|
|
33
33
|
</clipPath>
|
|
34
34
|
</defs>
|
|
35
|
-
</svg>`}return s}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)}}";function j(m){const t=document.createElement("style");t.textContent=m,document.head.appendChild(t)}j(U);const H={sandbox:"https://api.sandbox.getspot.com/api/v1/quote",production:"https://api.getspot.com/api/v1/quote",local:"http://localhost:3999/api/v1/quote"};class B{constructor(t={}){this.options={location:"body",showTable:!0,logoPosition:"bottom-right",apiConfig:{environment:"production",partnerId:""},quoteRequestData:{},callbacks:{},useMockData:!1,...t,selection:t.selection??y.UNSELECTED},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()}async _init(){var t,o,s,i,r;try{D(this.options);let n;if(this.options.useMockData&&this.options.mockData)n=this.options.mockData;else{const{environment:e,partnerId:p}=this.options.apiConfig,f=this.options.apiConfig.customEndpoint||H[e];n="items"in this.options.quoteRequestData?await T(f,p,this.options.quoteRequestData):await E(f,p,this.options.quoteRequestData)}if(n.status!=="QUOTE_AVAILABLE"){n.status==="NO_MATCHING_QUOTE"&&((t=this.options.callbacks)!=null&&t.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:this.options.quoteRequestData});return}if(this.quote=n.data,!this.quote)throw new Error("No quote data in response");if(this._renderWidget(),this.options.selection===y.YES&&((o=this.options.callbacks)!=null&&o.onOptIn)){const e={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const p=this.options.quoteRequestData;e.batchQuoteDetails=this.quote.originalQuotes.map(u=>{var h;const f=(h=p.items)==null?void 0:h.find(v=>(v.cartItemId||`item-${p.items.indexOf(v)+1}`)===u.cartItemId);return{quoteId:u.id,productPrice:(f==null?void 0:f.productPrice)||u.spotPrice,cartItemId:(f==null?void 0:f.cartItemId)||""}})}this.options.callbacks.onOptIn(e)}if((s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const e=this.options.callbacks.onQuoteRetrieved(this.quote);e&&this._applyQuoteUpdates(e)}}catch(n){if((i=this.options.callbacks)!=null&&i.onError){const e=n;(r=this.options.callbacks)==null||r.onError({message:e.message,status:e.status,responseBody:e.responseBody})}}}_renderWidget(){if(!this.quote)return;this.container=document.createElement("div"),this.container.className="spot-refund-guarantee",this.root.appendChild(this.container),Object.entries(this.options.theme||{}).forEach(([s,i])=>{const r=`--${s}`;this.container.style.setProperty(r,i)}),P(this.container,this.quote.communication);const t=document.createElement("div");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){const s=this._getTotalItemsInRequest();Q(t,this.quote.coveredItems,s)}this.options.showTable&&!this.quote.qualifyingReasons&&R(t,this.quote.payoutSchedule);const o=A(t,this.options.selection,this.quote.communication);t.appendChild(o),this.paymentTermsEl=a("div",{className:"spot-payment-terms__wrapper",parent:t}),this.currentSelection===y.YES&&I(this.paymentTermsEl,this.quote),Z(this.container,this.quote,this.options.logoPosition),window.addEventListener("resize",this._onResize),this._setupResizeObserver(),this._updateLayout(),this._setupOptionListeners(o)}_updateLayout(){if(!this.container||!this.quote)return;const t=this.container.querySelector(".spot-content__wrapper"),o=this.options.showTable&&!this.quote.qualifyingReasons;if(!t||!o){t==null||t.classList.remove("desktop-layout");return}const s=this._shouldUseDesktopLayout(t);t.classList.toggle("desktop-layout",s)}_shouldUseDesktopLayout(t){const o=this.container.offsetWidth-40,s=325,i=16;if(o>=900)return!0;if(o>=650){const r=t.classList.contains("desktop-layout");t.classList.remove("desktop-layout"),t.offsetHeight;const n=t.querySelector(".spot-benefits__list, .spot-qualifying-reasons__container");if(!n)return r&&t.classList.add("desktop-layout"),r;const p=Math.min(n.scrollWidth,400)+s+i;return r&&t.classList.add("desktop-layout"),o>=p}return!1}_setupResizeObserver(){!this.container||!window.ResizeObserver||(this._resizeObserver=new ResizeObserver(()=>{this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=window.setTimeout(()=>{this._updateLayout()},100)}),this._resizeObserver.observe(this.container))}_getTotalItemsInRequest(){return"items"in this.options.quoteRequestData?this.options.quoteRequestData.items.length:1}_applyQuoteUpdates(t){!this.quote||!this.container||(t.spotPriceWithFees!==void 0&&(this.quote.communication.yesOptionText=this.quote.communication.yesOptionText.replace(`$${this.quote.spotPrice.toFixed(2)}`,`$${t.spotPriceWithFees.toFixed(2)}`)),this.destroy(),this._renderWidget())}_setupOptionListeners(t){const o=t.querySelectorAll('input[type="radio"]'),s=t.querySelectorAll(".spot-selection__option");o.forEach(i=>{i.addEventListener("change",r=>{var p,u,f,h;const n=r.target,e=n.value;if(this.hideSelectionError(),this.currentSelection=e,s.forEach(v=>v.classList.remove("selected")),(p=n.closest(".spot-selection__option"))==null||p.classList.add("selected"),this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""),e===y.YES&&((u=this.quote)!=null&&u.communication.paymentTerms&&I(this.paymentTermsEl,this.quote),(f=this.options.callbacks)!=null&&f.onOptIn)){const v={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const c=this.options.quoteRequestData;v.batchQuoteDetails=this.quote.originalQuotes.map(l=>{var b;const d=(b=c.items)==null?void 0:b.find(w=>(w.cartItemId||`item-${c.items.indexOf(w)+1}`)===l.cartItemId);return{quoteId:l.id,productPrice:(d==null?void 0:d.productPrice)||l.spotPrice,cartItemId:(d==null?void 0:d.cartItemId)||""}})}this.options.callbacks.onOptIn(v)}if(e===y.NO&&((h=this.options.callbacks)!=null&&h.onOptOut)){const v={status:"QUOTE_DECLINED",quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const c=this.options.quoteRequestData;v.batchQuoteDetails=this.quote.originalQuotes.map(l=>{var b;const d=(b=c.items)==null?void 0:b.find(w=>(w.cartItemId||`item-${c.items.indexOf(w)+1}`)===l.cartItemId);return{quoteId:l.id,productPrice:(d==null?void 0:d.productPrice)||l.spotPrice,cartItemId:(d==null?void 0:d.cartItemId)||""}})}this.options.callbacks.onOptOut(v)}})})}showSelectionError(){var t;if(!this.errorEl){this.errorEl=document.createElement("div"),this.errorEl.className="spot-selection__error",this.errorEl.textContent="Please make a selection";const o=(t=this.container)==null?void 0:t.querySelector(".spot-selection__options");o&&o.insertAdjacentElement("afterend",this.errorEl)}this.errorEl.style.display="block"}hideSelectionError(){this.errorEl&&(this.errorEl.style.display="none")}validateSelection(){if(!this.container)return!1;const t=!!this.container.querySelector('input[name="selection"]:checked');return t?this.hideSelectionError():this.showSelectionError(),t}async updateQuote(t){var o,s,i,r;try{const n={...this.options,quoteRequestData:t};D(n);const{environment:e,partnerId:p,customEndpoint:u}=this.options.apiConfig,f=u||H[e],v="items"in n.quoteRequestData?await T(f,p,n.quoteRequestData):await E(f,p,n.quoteRequestData);if(v.status!=="QUOTE_AVAILABLE")return this.destroy(),v.status==="NO_MATCHING_QUOTE"&&((o=this.options.callbacks)!=null&&o.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:n.quoteRequestData}),!1;if(this.options.quoteRequestData=n.quoteRequestData,this.quote=v.data,this.currentSelection=y.UNSELECTED,this.destroy(),this._renderWidget(),(s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const c=this.options.callbacks.onQuoteRetrieved(this.quote);c&&this._applyQuoteUpdates(c)}return!0}catch(n){const e=n;return(r=(i=this.options.callbacks)==null?void 0:i.onError)==null||r.call(i,{message:e.message,status:e.status,responseBody:e.responseBody}),!1}}getSelection(){var o,s,i;if(this.currentSelection==null||this.currentSelection==y.UNSELECTED)return null;const t={selection:this.currentSelection,quoteId:(o=this.quote)==null?void 0:o.id,spotPrice:(s=this.quote)==null?void 0:s.spotPrice,status:this.currentSelection===y.YES?"QUOTE_ACCEPTED":"QUOTE_DECLINED"};if((i=this.quote)!=null&&i.originalQuotes&&this.quote.originalQuotes.length>0){const r=this.options.quoteRequestData;t.batchQuoteDetails=this.quote.originalQuotes.map(n=>{var p;const e=(p=r.items)==null?void 0:p.find(u=>(u.cartItemId||`item-${r.items.indexOf(u)+1}`)===n.cartItemId);return{quoteId:n.id,productPrice:(e==null?void 0:e.productPrice)||n.spotPrice,cartItemId:(e==null?void 0:e.cartItemId)||""}})}return t}destroy(){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)}}C.SelectionEnum=y,C.default=B,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
35
|
+
</svg>`}return s}const B=":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)}}";function j(m){const t=document.createElement("style");t.textContent=m,document.head.appendChild(t)}j(B);const H={sandbox:"https://api.sandbox.getspot.com/api/v1/quote",production:"https://api.getspot.com/api/v1/quote",local:"http://localhost:3999/api/v1/quote"};class F{constructor(t={}){this.options={location:"body",showTable:!0,logoPosition:"bottom-right",apiConfig:{environment:"production",partnerId:""},quoteRequestData:{},callbacks:{},useMockData:!1,...t,selection:t.selection??y.UNSELECTED},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()}async _init(){var t,o,s,i,r;try{T(this.options);let n;if(this.options.useMockData&&this.options.mockData)n=this.options.mockData;else{const{environment:e,partnerId:p}=this.options.apiConfig,f=this.options.apiConfig.customEndpoint||H[e];n="items"in this.options.quoteRequestData?await D(f,p,this.options.quoteRequestData):await E(f,p,this.options.quoteRequestData)}if(n.status!=="QUOTE_AVAILABLE"){n.status==="NO_MATCHING_QUOTE"&&((t=this.options.callbacks)!=null&&t.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:this.options.quoteRequestData});return}if(this.quote=n.data,!this.quote)throw new Error("No quote data in response");if(this._renderWidget(),this.options.selection===y.YES&&((o=this.options.callbacks)!=null&&o.onOptIn)){const e={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const p=this.options.quoteRequestData;e.batchQuoteDetails=this.quote.originalQuotes.map(u=>{var g;const f=(g=p.items)==null?void 0:g.find(h=>(h.cartItemId||`item-${p.items.indexOf(h)+1}`)===u.cartItemId);return{quoteId:u.id,productPrice:(f==null?void 0:f.productPrice)||u.spotPrice,cartItemId:(f==null?void 0:f.cartItemId)||""}})}this.options.callbacks.onOptIn(e)}if((s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const e=this.options.callbacks.onQuoteRetrieved(this.quote);e&&this._applyQuoteUpdates(e)}}catch(n){if((i=this.options.callbacks)!=null&&i.onError){const e=n;(r=this.options.callbacks)==null||r.onError({message:e.message,status:e.status,responseBody:e.responseBody})}}}_renderWidget(){if(!this.quote)return;this.container=document.createElement("div"),this.container.className="spot-refund-guarantee",this.root.appendChild(this.container),Object.entries(this.options.theme||{}).forEach(([s,i])=>{const r=`--${s}`;this.container.style.setProperty(r,i)}),$(this.container,this.quote.communication);const t=document.createElement("div");if(t.className="spot-content__wrapper",this.container.appendChild(t),this.quote.qualifyingReasons?A(t,this.quote.qualifyingReasons):P(t,this.quote.communication.bulletPoints),this.quote.coveredItems){const s=this._getTotalItemsInRequest();R(t,this.quote.coveredItems,s)}this.options.showTable&&!this.quote.qualifyingReasons&&Q(t,this.quote.payoutSchedule,this.quote.currencyCode);const o=Z(t,this.options.selection,this.quote.communication);t.appendChild(o),this.paymentTermsEl=a("div",{className:"spot-payment-terms__wrapper",parent:t}),this.currentSelection===y.YES&&I(this.paymentTermsEl,this.quote),U(this.container,this.quote,this.options.logoPosition),window.addEventListener("resize",this._onResize),this._setupResizeObserver(),this._updateLayout(),this._setupOptionListeners(o)}_updateLayout(){if(!this.container||!this.quote)return;const t=this.container.querySelector(".spot-content__wrapper"),o=this.options.showTable&&!this.quote.qualifyingReasons;if(!t||!o){t==null||t.classList.remove("desktop-layout");return}const s=this._shouldUseDesktopLayout(t);t.classList.toggle("desktop-layout",s)}_shouldUseDesktopLayout(t){const o=this.container.offsetWidth-40,s=325,i=16;if(o>=900)return!0;if(o>=650){const r=t.classList.contains("desktop-layout");t.classList.remove("desktop-layout"),t.offsetHeight;const n=t.querySelector(".spot-benefits__list, .spot-qualifying-reasons__container");if(!n)return r&&t.classList.add("desktop-layout"),r;const p=Math.min(n.scrollWidth,400)+s+i;return r&&t.classList.add("desktop-layout"),o>=p}return!1}_setupResizeObserver(){!this.container||!window.ResizeObserver||(this._resizeObserver=new ResizeObserver(()=>{this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=window.setTimeout(()=>{this._updateLayout()},100)}),this._resizeObserver.observe(this.container))}_getTotalItemsInRequest(){return"items"in this.options.quoteRequestData?this.options.quoteRequestData.items.length:1}_applyQuoteUpdates(t){!this.quote||!this.container||(t.spotPriceWithFees!==void 0&&(this.quote.communication.yesOptionText=this.quote.communication.yesOptionText.replace(`$${this.quote.spotPrice.toFixed(2)}`,`$${t.spotPriceWithFees.toFixed(2)}`)),this.destroy(),this._renderWidget())}_setupOptionListeners(t){const o=t.querySelectorAll('input[type="radio"]'),s=t.querySelectorAll(".spot-selection__option");o.forEach(i=>{i.addEventListener("change",r=>{var p,u,f,g;const n=r.target,e=n.value;if(this.hideSelectionError(),this.currentSelection=e,s.forEach(h=>h.classList.remove("selected")),(p=n.closest(".spot-selection__option"))==null||p.classList.add("selected"),this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""),e===y.YES&&((u=this.quote)!=null&&u.communication.paymentTerms&&I(this.paymentTermsEl,this.quote),(f=this.options.callbacks)!=null&&f.onOptIn)){const h={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const c=this.options.quoteRequestData;h.batchQuoteDetails=this.quote.originalQuotes.map(l=>{var b;const d=(b=c.items)==null?void 0:b.find(w=>(w.cartItemId||`item-${c.items.indexOf(w)+1}`)===l.cartItemId);return{quoteId:l.id,productPrice:(d==null?void 0:d.productPrice)||l.spotPrice,cartItemId:(d==null?void 0:d.cartItemId)||""}})}this.options.callbacks.onOptIn(h)}if(e===y.NO&&((g=this.options.callbacks)!=null&&g.onOptOut)){const h={status:"QUOTE_DECLINED",quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const c=this.options.quoteRequestData;h.batchQuoteDetails=this.quote.originalQuotes.map(l=>{var b;const d=(b=c.items)==null?void 0:b.find(w=>(w.cartItemId||`item-${c.items.indexOf(w)+1}`)===l.cartItemId);return{quoteId:l.id,productPrice:(d==null?void 0:d.productPrice)||l.spotPrice,cartItemId:(d==null?void 0:d.cartItemId)||""}})}this.options.callbacks.onOptOut(h)}})})}showSelectionError(){var t;if(!this.errorEl){this.errorEl=document.createElement("div"),this.errorEl.className="spot-selection__error",this.errorEl.textContent="Please make a selection";const o=(t=this.container)==null?void 0:t.querySelector(".spot-selection__options");o&&o.insertAdjacentElement("afterend",this.errorEl)}this.errorEl.style.display="block"}hideSelectionError(){this.errorEl&&(this.errorEl.style.display="none")}validateSelection(){if(!this.container)return!1;const t=!!this.container.querySelector('input[name="selection"]:checked');return t?this.hideSelectionError():this.showSelectionError(),t}async updateQuote(t){var o,s,i,r;try{const n={...this.options,quoteRequestData:t};T(n);const{environment:e,partnerId:p,customEndpoint:u}=this.options.apiConfig,f=u||H[e],h="items"in n.quoteRequestData?await D(f,p,n.quoteRequestData):await E(f,p,n.quoteRequestData);if(h.status!=="QUOTE_AVAILABLE")return this.destroy(),h.status==="NO_MATCHING_QUOTE"&&((o=this.options.callbacks)!=null&&o.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:n.quoteRequestData}),!1;if(this.options.quoteRequestData=n.quoteRequestData,this.quote=h.data,this.currentSelection=y.UNSELECTED,this.destroy(),this._renderWidget(),(s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const c=this.options.callbacks.onQuoteRetrieved(this.quote);c&&this._applyQuoteUpdates(c)}return!0}catch(n){const e=n;return(r=(i=this.options.callbacks)==null?void 0:i.onError)==null||r.call(i,{message:e.message,status:e.status,responseBody:e.responseBody}),!1}}getSelection(){var o,s,i;if(this.currentSelection==null||this.currentSelection==y.UNSELECTED)return null;const t={selection:this.currentSelection,quoteId:(o=this.quote)==null?void 0:o.id,spotPrice:(s=this.quote)==null?void 0:s.spotPrice,status:this.currentSelection===y.YES?"QUOTE_ACCEPTED":"QUOTE_DECLINED"};if((i=this.quote)!=null&&i.originalQuotes&&this.quote.originalQuotes.length>0){const r=this.options.quoteRequestData;t.batchQuoteDetails=this.quote.originalQuotes.map(n=>{var p;const e=(p=r.items)==null?void 0:p.find(u=>(u.cartItemId||`item-${r.items.indexOf(u)+1}`)===n.cartItemId);return{quoteId:n.id,productPrice:(e==null?void 0:e.productPrice)||n.spotPrice,cartItemId:(e==null?void 0:e.cartItemId)||""}})}return t}destroy(){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)}}C.SelectionEnum=y,C.default=F,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/types.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface QuoteItem {
|
|
|
21
21
|
participantDescription?: string;
|
|
22
22
|
eventType: string;
|
|
23
23
|
eventId?: string;
|
|
24
|
-
currencyCode: "USD" | "CAD" | "AUD";
|
|
24
|
+
currencyCode: "USD" | "CAD" | "AUD" | "NZD" | "EUR" | "MXN" | "AED" | "GBP" | "MAD" | "SAR";
|
|
25
25
|
startDate: string;
|
|
26
26
|
endDate: string;
|
|
27
27
|
partnerRiskEnd?: Date;
|
|
@@ -40,7 +40,7 @@ export interface BatchQuoteItem extends BatchItem {
|
|
|
40
40
|
export interface BatchQuoteRequest {
|
|
41
41
|
cartId: string;
|
|
42
42
|
cartName: string;
|
|
43
|
-
currencyCode: "USD" | "CAD" | "AUD";
|
|
43
|
+
currencyCode: "USD" | "CAD" | "AUD" | "NZD" | "EUR" | "MXN" | "AED" | "GBP" | "MAD" | "SAR";
|
|
44
44
|
metadata?: QuoteMetadata;
|
|
45
45
|
isPartialPayment?: boolean;
|
|
46
46
|
roundTo?: number;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,SAAS,GAAG,YAAY,GAAG,OAAO,CAAC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AACD,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,cAAc,CAAC;IAC9C,eAAe,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,SAAS,GAAG,YAAY,GAAG,OAAO,CAAC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AACD,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,cAAc,CAAC;IAC9C,eAAe,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAC5F,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,SAAS,GAAG,IAAI,CACnB,SAAS,EACT,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,cAAc,GAAG,kBAAkB,GAAG,UAAU,GAAG,SAAS,CACpG,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAC5F,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,iBAAiB,GAAG,SAAS,EAAE,CAAC;AAE3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,kBAAkB,EAAE,CAAC;IACrC,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,KAAK,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;IACrE,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,cAAc,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,KAAK,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,YAAY,GAAG,IAAI,CAAC;IACzD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI,CAAC;IACpF,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,gBAAgB,CAAA;KAAE,KAAK,IAAI,CAAC;CAC9E;AAED,MAAM,WAAW,KAAK;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,UAAU,eAAe;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,YAAY,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC;IAC5C,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB;AAED,MAAM,WAAW,QAAS,SAAQ,KAAK;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/ui.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare function renderHeader(container: HTMLElement, { name, description
|
|
|
4
4
|
export declare function renderBenefits(container: HTMLElement, bullets?: string[]): void;
|
|
5
5
|
export declare function renderQualifyingReasons(container: HTMLElement, qualifyingReasons?: QualifyingReason[]): void;
|
|
6
6
|
export declare function renderCoveredItems(container: HTMLElement, coveredItems?: string[], totalItemsInRequest?: number): void;
|
|
7
|
-
export declare function renderTable(container: HTMLElement, schedule?: PayoutScheduleItem[]): void;
|
|
7
|
+
export declare function renderTable(container: HTMLElement, schedule?: PayoutScheduleItem[], currencyCode?: string): void;
|
|
8
8
|
export declare function renderOptions(container: HTMLElement, selection: SelectionEnum, communication: Communication): HTMLElement;
|
|
9
9
|
export declare function renderPaymentTerms(container: HTMLElement, quote: Quote): HTMLElement;
|
|
10
10
|
export declare function renderFooter(container: HTMLElement, quote: Quote, logoPosition?: "bottom-right" | "top-right"): HTMLElement;
|
package/dist/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,EACL,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,qBAAqB,EAC1D,GAAG,EAAE,CAAC,EACN,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAE,cAAmB,GACxE,qBAAqB,CAAC,CAAC,CAAC,CAS1B;AAGD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,WAAW,EACtB,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAAC,GACjE,IAAI,CAWN;AAGD,wBAAgB,cAAc,CAC5B,SAAS,EAAE,WAAW,EACtB,OAAO,GAAE,MAAM,EAAO,GACrB,IAAI,CAcN;AAGD,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,WAAW,EACtB,iBAAiB,GAAE,gBAAgB,EAAO,GACzC,IAAI,CA0EN;AAGD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,WAAW,EACtB,YAAY,GAAE,MAAM,EAAO,EAC3B,mBAAmB,CAAC,EAAE,MAAM,GAC3B,IAAI,CAiHN;
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,EACL,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,qBAAqB,EAC1D,GAAG,EAAE,CAAC,EACN,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAE,cAAmB,GACxE,qBAAqB,CAAC,CAAC,CAAC,CAS1B;AAGD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,WAAW,EACtB,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAAC,GACjE,IAAI,CAWN;AAGD,wBAAgB,cAAc,CAC5B,SAAS,EAAE,WAAW,EACtB,OAAO,GAAE,MAAM,EAAO,GACrB,IAAI,CAcN;AAGD,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,WAAW,EACtB,iBAAiB,GAAE,gBAAgB,EAAO,GACzC,IAAI,CA0EN;AAGD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,WAAW,EACtB,YAAY,GAAE,MAAM,EAAO,EAC3B,mBAAmB,CAAC,EAAE,MAAM,GAC3B,IAAI,CAiHN;AAgBD,wBAAgB,WAAW,CACzB,SAAS,EAAE,WAAW,EACtB,QAAQ,GAAE,kBAAkB,EAAO,EACnC,YAAY,GAAE,MAAc,GAC3B,IAAI,CA2BN;AAGD,wBAAgB,aAAa,CAC3B,SAAS,EAAE,WAAW,EACtB,SAAS,EAAE,aAAa,EACxB,aAAa,EAAE,aAAa,GAC3B,WAAW,CA0Cb;AAGD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,KAAK,GACX,WAAW,CAqBb;AAGD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,KAAK,EACZ,YAAY,GAAE,cAAc,GAAG,WAA4B,GAC1D,WAAW,CAwEb"}
|