straumur-web-component 0.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/dist/index.mjs ADDED
@@ -0,0 +1,2000 @@
1
+ // src/straumur-checkout.tsx
2
+ import { h as h29, render } from "preact";
3
+ import "@adyen/adyen-web/styles/adyen.css";
4
+
5
+ // #style-inject:#style-inject
6
+ function styleInject(css, { insertAt } = {}) {
7
+ if (!css || typeof document === "undefined") return;
8
+ const head = document.head || document.getElementsByTagName("head")[0];
9
+ const style = document.createElement("style");
10
+ style.type = "text/css";
11
+ if (insertAt === "top") {
12
+ if (head.firstChild) {
13
+ head.insertBefore(style, head.firstChild);
14
+ } else {
15
+ head.appendChild(style);
16
+ }
17
+ } else {
18
+ head.appendChild(style);
19
+ }
20
+ if (style.styleSheet) {
21
+ style.styleSheet.cssText = css;
22
+ } else {
23
+ style.appendChild(document.createTextNode(css));
24
+ }
25
+ }
26
+
27
+ // src/styles/main.css
28
+ styleInject('* {\n font-family: "AkzidenzGroteskPro", sans-serif;\n max-width: 440px;\n}\n.render-brand-icons__overflow {\n color: #72889d;\n}\n.component {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 300px;\n background-color: white;\n border-radius: 16px;\n}\n');
29
+
30
+ // src/env.ts
31
+ var getEnv = () => {
32
+ return {
33
+ STAGING_BASE_URL: "https://checkout-api.staging.straumur.is/api/v1/embeddedcheckout",
34
+ PRODUCTION_BASE_URL: "",
35
+ GET_PAYMENT_METHODS_URL: "payment-methods",
36
+ POST_PAYMENT_URL: "payment",
37
+ POST_DETAILS_URL: "details",
38
+ POST_DISABLE_TOKEN_URL: "disable-token"
39
+ };
40
+ };
41
+ var env = getEnv();
42
+
43
+ // src/adapter/straumur-adapter.ts
44
+ function getBaseUrl(environment) {
45
+ switch (environment) {
46
+ case "test":
47
+ return env.STAGING_BASE_URL;
48
+ case "live":
49
+ return env.PRODUCTION_BASE_URL;
50
+ default:
51
+ throw new Error(`Unknown environment: ${environment}`);
52
+ }
53
+ }
54
+ function getPaymentMethods(environment, body) {
55
+ return fetch(`${getBaseUrl(environment)}/${env.GET_PAYMENT_METHODS_URL}`, {
56
+ method: "POST",
57
+ headers: {
58
+ "Content-Type": "application/json"
59
+ },
60
+ body: JSON.stringify(body)
61
+ });
62
+ }
63
+ function createPaymentRequest(environment, body) {
64
+ return fetch(`${getBaseUrl(environment)}/${env.POST_PAYMENT_URL}`, {
65
+ method: "POST",
66
+ headers: {
67
+ "Content-Type": "application/json"
68
+ },
69
+ body: JSON.stringify(body)
70
+ });
71
+ }
72
+ function createDetailsRequest(environment, body) {
73
+ return fetch(`${getBaseUrl(environment)}/${env.POST_DETAILS_URL}`, {
74
+ method: "POST",
75
+ headers: {
76
+ "Content-Type": "application/json"
77
+ },
78
+ body: JSON.stringify(body)
79
+ });
80
+ }
81
+ function postDisableTokenRequest(environment, body) {
82
+ return fetch(`${getBaseUrl(environment)}/${env.POST_DISABLE_TOKEN_URL}`, {
83
+ method: "POST",
84
+ headers: {
85
+ "Content-Type": "application/json"
86
+ },
87
+ body: JSON.stringify(body)
88
+ });
89
+ }
90
+
91
+ // src/services/straumur-service.ts
92
+ async function setupPaymentMethods(environment, sessionId) {
93
+ try {
94
+ const fetchResponse = await getPaymentMethods(environment, {
95
+ sessionId
96
+ });
97
+ if (!fetchResponse.ok) {
98
+ const contentType = fetchResponse.headers.get("content-type");
99
+ let errorMessage = "error.failedToInitializePaymentMethods";
100
+ if (contentType && contentType.includes("application/json")) {
101
+ errorMessage = (await fetchResponse.json()).errorMessage;
102
+ }
103
+ return {
104
+ resultCode: "Error",
105
+ error: errorMessage
106
+ };
107
+ }
108
+ const data = await fetchResponse.json();
109
+ return {
110
+ resultCode: "Success",
111
+ ...data
112
+ };
113
+ } catch (error) {
114
+ return {
115
+ resultCode: "Error",
116
+ error: "error.failedToInitializePaymentMethods"
117
+ };
118
+ }
119
+ }
120
+
121
+ // src/features/straumur-checkout-container.tsx
122
+ import { h as h28 } from "preact";
123
+
124
+ // src/features/card/card-component.tsx
125
+ import { Fragment as Fragment3, h as h16 } from "preact";
126
+ import { useRef as useRef3, useState as useState4, useEffect as useEffect2 } from "preact/hooks";
127
+
128
+ // src/features/card/card-component.css
129
+ styleInject('.card-component {\n position: relative;\n cursor: pointer;\n background: white;\n border-radius: 12px;\n transition: all 0.3s ease;\n padding: 16px 24px;\n}\n.card-component__radio-selector {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n}\n.card-component__content {\n display: grid;\n grid-template-columns: 26px 40px auto 1fr;\n align-items: center;\n gap: 12px;\n transition: background-color 0.3s ease;\n}\n.card-component__radio-selector:checked + .card-component__content {\n padding-bottom: 16px;\n}\n.card-component--circle {\n width: 24px;\n height: 24px;\n border: 1px solid #e6ebef;\n background: #eef0f2;\n border-radius: 50%;\n position: relative;\n transition: all 0.3s ease;\n}\n.card-component__content:hover .card-component--circle {\n border: 1px solid #cdd8e2;\n}\n.card-component--circle::after {\n content: "";\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0);\n transition: transform 0.2s ease;\n}\n.card-component__radio-selector:checked + .card-component__content .card-component--circle {\n background: #bce6f3;\n border-color: transparent;\n}\n.card-component__radio-selector:checked + .card-component__content .card-component--circle::after {\n transform: translate(-50%, -50%) scale(1);\n background: #002649;\n height: 10px;\n width: 10px;\n}\n.card-component--text {\n color: #213547;\n font-size: 1rem;\n user-select: none;\n}\n.card-component--brands {\n display: flex;\n margin-left: auto;\n align-items: center;\n gap: 4px;\n}\n.card-component__expandable {\n background: white;\n max-height: 0;\n overflow: hidden;\n transition: all 0.3s ease;\n opacity: 0;\n}\n.card-component__loading-text {\n display: flex;\n justify-content: center;\n}\n.card-component__radio-selector:checked ~ .card-component__expandable {\n max-height: 400px;\n opacity: 1;\n}\n.card-component__form {\n display: flex;\n padding-top: 16px;\n flex-direction: column;\n gap: 24px;\n}\n.card-component__form--wrapper {\n display: flex;\n flex-direction: column;\n justify-items: start;\n position: relative;\n width: 100%;\n}\n.card-component__form--wrapper--error {\n color: #ff4d4f;\n font-size: 12px;\n}\n.card-component__form--wrapper--label {\n transform: translateX(10px) translateY(-50%);\n z-index: 1;\n background:\n linear-gradient(\n to top,\n #eef0f2 53%,\n transparent 50%);\n position: absolute;\n font-weight: 500;\n font-size: 14px;\n padding: 0 4px;\n}\n.card-component__form--wrapper--label--error {\n color: #ff4d4f;\n background:\n linear-gradient(\n to top,\n #fff8f5 53%,\n transparent 50%);\n}\n.card-component__form--wrapper--label--info {\n position: absolute;\n top: 33%;\n right: 10px;\n}\n.card-component__form--wrapper--input {\n background: #eef0f2;\n color: #00112c;\n display: block;\n font-family: inherit;\n border: 1px solid transparent;\n border-radius: 8px;\n font-size: 1rem;\n height: 48px;\n outline: none;\n padding-left: 12px;\n transition: border 0.2s ease-out, box-shadow 0.2s ease-out;\n}\n.card-component__form--wrapper--input:hover {\n border: 1px solid #cdd8e2;\n}\n.card-component__form--wrapper--input--error {\n background: #fff8f5;\n border: 1px solid #ff4d4f;\n}\n.card-component__form--wrapper--input--error:hover {\n border: 1px solid #ff4d4f;\n}\n.card-component__form--field-wrapper {\n display: flex;\n width: 100%;\n gap: 24px;\n}\n.card-component__submit-button {\n background: #002649;\n border: none;\n border-radius: 8px;\n color: #ffffff;\n cursor: pointer;\n font-size: 1rem;\n height: 40px;\n outline: none;\n padding: 0 16px;\n transition: background 0.2s ease-out;\n width: 100%;\n}\n.card-component__submit-button:hover {\n background: #002649;\n border: 1px solid #dbdee2;\n}\n.card-component__submit-button:disabled {\n background: #72889d;\n border: 1px solid #dbdee2;\n cursor: not-allowed;\n}\n.card-component__form--wrapper--label-checkbox {\n height: 38px;\n display: flex;\n align-items: center;\n padding: 8px;\n gap: 8px;\n border-radius: 8px;\n cursor: pointer;\n user-select: none;\n transition: background-color 0.25s ease-in-out;\n}\n.card-component__form--wrapper--label-checkbox:hover {\n background-color: #eff8fa;\n}\n.card-component__form--wrapper--label-checkbox:hover .card-component__form--wrapper--label-checkbox--checkmark {\n border: 1px solid #cdd8e2;\n}\n.card-component__form--wrapper--label-checkbox--checkmark {\n height: 24px;\n width: 24px;\n background-color: #eef0f2;\n border-radius: 4px;\n flex-shrink: 0;\n border: 1px solid transparent;\n transition: all 0.2s ease-in;\n}\n.card-component__form--wrapper--label-checkbox:hover .card-component__form--wrapper--label-checkbox--checkmark.card-component__form--wrapper--label-checkbox--checkmark--checked {\n border: 1px solid transparent;\n}\n.card-component__form--wrapper--label-checkbox--checkmark--checked {\n background-color: #bce6f3;\n}\n.card-component__form--wrapper--label-checkbox--checkmark--icon {\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 9px;\n opacity: 0;\n visibility: hidden;\n transition: all 0.2s ease-in;\n}\n.card-component__form--wrapper--label-checkbox--checkmark--icon--checked {\n opacity: 1;\n visibility: visible;\n}\n.card-component__form--wrapper--label-checkbox--checkbox {\n display: none;\n}\n');
130
+
131
+ // src/components/payment-method-group/payment-method-group-context.tsx
132
+ import { h } from "preact";
133
+ import { createContext } from "preact";
134
+ import { useState, useContext, useRef } from "preact/hooks";
135
+ var PaymentMethodContext = createContext(void 0);
136
+ var defaultIsInitialized = {
137
+ card: false,
138
+ storedcard: false,
139
+ googlepay: false,
140
+ applepay: false
141
+ };
142
+ var PaymentMethodGroupContext = ({
143
+ children,
144
+ initialValue
145
+ }) => {
146
+ const [activePaymentMethod, setActivePaymentMethod] = useState(initialValue);
147
+ const [activeStoredPaymentMethodId, setActiveStoredPaymentMethodId] = useState(null);
148
+ const [threeDSecureActive, setThreeDSecureActive] = useState(false);
149
+ const [isPaymentMethodInitialized, setIsPaymentMethodInitialized] = useState(defaultIsInitialized);
150
+ const [isStoredCardInitialized, setIsStoredCardInitialized] = useState({});
151
+ const threeDSecureRef = useRef(null);
152
+ const [success, setSuccess] = useState(null);
153
+ const [error, setError] = useState(null);
154
+ const updatePaymentMethodInitialization = (paymentMethod, isInitialized) => {
155
+ setIsPaymentMethodInitialized((prevState) => ({
156
+ ...prevState,
157
+ [paymentMethod]: isInitialized
158
+ }));
159
+ };
160
+ const updateStoredCardInitialization = (storedPaymentMethod, isInitialized) => {
161
+ setIsStoredCardInitialized((prevState) => ({
162
+ ...prevState,
163
+ [storedPaymentMethod]: isInitialized
164
+ }));
165
+ };
166
+ const handleError = (error2) => {
167
+ setError(error2);
168
+ };
169
+ const handleSuccess = (success2) => {
170
+ setSuccess(success2);
171
+ };
172
+ const setThreeDSecureRef = (ref) => {
173
+ threeDSecureRef.current = ref;
174
+ };
175
+ return /* @__PURE__ */ h(
176
+ PaymentMethodContext.Provider,
177
+ {
178
+ value: {
179
+ activePaymentMethod,
180
+ setActivePaymentMethod,
181
+ activeStoredPaymentMethodId,
182
+ setActiveStoredPaymentMethodId,
183
+ isPaymentMethodInitialized,
184
+ updatePaymentMethodInitialization,
185
+ isStoredCardInitialized,
186
+ updateStoredCardInitialization,
187
+ handleSuccess,
188
+ success,
189
+ handleError,
190
+ error,
191
+ threeDSecureRef,
192
+ setThreeDSecureRef,
193
+ threeDSecureActive,
194
+ setThreeDSecureActive
195
+ }
196
+ },
197
+ children
198
+ );
199
+ };
200
+ var usePaymentMethodGroup = () => {
201
+ const context = useContext(PaymentMethodContext);
202
+ if (context === void 0) {
203
+ throw new Error("usePaymentMethodGroup must be used within a PaymentMethodGroup");
204
+ }
205
+ return context;
206
+ };
207
+
208
+ // src/features/card/card-component.tsx
209
+ import {
210
+ AdyenCheckout,
211
+ CustomCard
212
+ } from "@adyen/adyen-web";
213
+
214
+ // src/localizations/translations.ts
215
+ var translations = {
216
+ "en-US": {
217
+ "cards.title": "Card payment",
218
+ "cards.cardNumber": "Card number",
219
+ "cards.expiryDate": "Expiry date",
220
+ "cards.securityCode3Digits": "Security code",
221
+ "cards.securityCode3DigitsOptional": "Security code (optional)",
222
+ "cards.securityCode3DigitsInfo": "3-digit on the back of the card",
223
+ "cards.securityCode4DigitsInfo": "4-digit on the back of the card",
224
+ "cards.storePaymentMethod": "Store payment information",
225
+ "googlepay.title": "Google Pay",
226
+ "stored-cards.expiryDate": "Expiry date",
227
+ "stored-cards.securityCode3Digits": "Security code",
228
+ "stored-cards.securityCode3DigitsOptional": "Security code (optional)",
229
+ "stored-cards.securityCode3DigitsInfo": "3-digit on the back of the card",
230
+ "stored-cards.securityCode4DigitsInfo": "4-digit on the back of the card",
231
+ "stored-cards.removeStoredCard": "Remove",
232
+ "stored-cards.removeStoredCardQuestion": "Remove stored payment method?",
233
+ "stored-cards.removeStoredCardQuestionYesRemove": "Yes, remove",
234
+ "stored-cards.removeStoredCardQuestionCancel": "Cancel",
235
+ "success.paymentAuthorized": "Payment authorized",
236
+ "error.unknownError": "Unknown error occurred",
237
+ "error.failedToInitializeStraumurWebComponent": "Failed to initialize Straumur Web component",
238
+ "error.failedToInitializePaymentMethods": "Failed to initialize payment methods",
239
+ "error.failedToSubmitPayment": "Failed to submit payment",
240
+ "error.paymentFailed": "Payment failed",
241
+ "error.paymentUnsuccessful": "Payment unsuccessful",
242
+ "error.failedToSubmitPaymentDetails": "Failed to submit payment details",
243
+ "error.paymentDetailsFailed": "Payment details failed",
244
+ "error.googlePayNotAvailable": "Google Pay not available",
245
+ "error.failedToSubmitRemoveStoredPaymentCard": "Failed to remove stored payment card",
246
+ "error.failedToRemoveStoredPaymentCard": "Stored payment card was not removed"
247
+ },
248
+ "is-IS": {
249
+ "cards.title": "Grei\xF0a me\xF0 korti",
250
+ "cards.cardNumber": "Kortan\xFAmer",
251
+ "cards.expiryDate": "Gildisdagur",
252
+ "cards.securityCode3Digits": "\xD6ryggisk\xF3\xF0i",
253
+ "cards.securityCode3DigitsOptional": "\xD6ryggisk\xF3\xF0i (valkv\xE6tt)",
254
+ "cards.securityCode3DigitsInfo": "3 t\xF6lustafir aftan \xE1 kortinu",
255
+ "cards.securityCode4DigitsInfo": "4 t\xF6lustafir aftan \xE1 kortinu",
256
+ "cards.storePaymentMethod": "Vista grei\xF0sluuppl\xFDsingar",
257
+ "googlepay.title": "Google Pay",
258
+ "stored-cards.expiryDate": "Gildisdagur",
259
+ "stored-cards.securityCode3Digits": "\xD6ryggisk\xF3\xF0i",
260
+ "stored-cards.securityCode3DigitsOptional": "\xD6ryggisk\xF3\xF0i (valkv\xE6tt)",
261
+ "stored-cards.securityCode3DigitsInfo": "3 t\xF6lustafir aftan \xE1 kortinu",
262
+ "stored-cards.securityCode4DigitsInfo": "4 t\xF6lustafir aftan \xE1 kortinu",
263
+ "stored-cards.removeStoredCard": "Fjarl\xE6gja",
264
+ "stored-cards.removeStoredCardQuestion": "Fjarl\xE6gja geymdan grei\xF0slum\xE1ta?",
265
+ "stored-cards.removeStoredCardQuestionYesRemove": "J\xE1, fjarl\xE6gja",
266
+ "stored-cards.removeStoredCardQuestionCancel": "H\xE6tta vi\xF0",
267
+ "success.paymentAuthorized": "Grei\xF0sla sam\xFEykkt",
268
+ "error.unknownError": "\xD3\xFEekkt villa kom upp",
269
+ "error.failedToInitializeStraumurWebComponent": "Mist\xF3kst a\xF0 s\xE6kja Straumur Web hluta",
270
+ "error.failedToInitializePaymentMethods": "Mist\xF3kst a\xF0 s\xE6kja grei\xF0slum\xE1ta",
271
+ "error.failedToSubmitPayment": "Mist\xF3kst a\xF0 senda grei\xF0slu",
272
+ "error.paymentFailed": "Grei\xF0sla mist\xF3kst",
273
+ "error.paymentUnsuccessful": "Grei\xF0sla ekki tekin",
274
+ "error.failedToSubmitPaymentDetails": "Mist\xF3kst a\xF0 senda grei\xF0sluuppl\xFDsingar",
275
+ "error.paymentDetailsFailed": "Mist\xF3kst a\xF0 s\xE6kja grei\xF0sluuppl\xFDsingar",
276
+ "error.googlePayNotAvailable": "Google Pay ekki \xED bo\xF0i",
277
+ "error.failedToSubmitRemoveStoredPaymentCard": "Mist\xF3kst a\xF0 fjarl\xE6gja geymdan grei\xF0slum\xE1ta",
278
+ "error.failedToRemoveStoredPaymentCard": "Geymdur grei\xF0slum\xE1ti var ekki fjarl\xE6g\xF0ur"
279
+ }
280
+ };
281
+
282
+ // src/localizations/i18n.ts
283
+ function i18n(language, key) {
284
+ return translations[language][key] || key;
285
+ }
286
+
287
+ // src/components/tooltip/tooltip.tsx
288
+ import { h as h2 } from "preact";
289
+
290
+ // src/components/tooltip/tooltip.css
291
+ styleInject(".core-tooltip__content {\n position: absolute;\n z-index: 50;\n padding: 0.5rem;\n border-radius: 0.5rem;\n right: 40%;\n top: 100%;\n width: max-content;\n color: #ffffff;\n background-color: #002649;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n}\n");
292
+
293
+ // src/components/tooltip/tooltip.tsx
294
+ import { useRef as useRef2, useState as useState2 } from "preact/hooks";
295
+ var Tooltip = ({ children, content }) => {
296
+ const [isVisible, setIsVisible] = useState2(false);
297
+ const triggerRef = useRef2(null);
298
+ const handleMouseEnter = () => {
299
+ setIsVisible(true);
300
+ };
301
+ const handleMouseLeave = () => {
302
+ setIsVisible(false);
303
+ };
304
+ return /* @__PURE__ */ h2("div", { style: { position: "relative" } }, /* @__PURE__ */ h2("div", { ref: triggerRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, children), isVisible && triggerRef && /* @__PURE__ */ h2("div", { className: "core-tooltip__content" }, content));
305
+ };
306
+
307
+ // src/assets/icons/card.tsx
308
+ import { h as h3 } from "preact";
309
+ var CardIcon = () => /* @__PURE__ */ h3(
310
+ "svg",
311
+ {
312
+ xmlns: "http://www.w3.org/2000/svg",
313
+ width: "40",
314
+ height: "26",
315
+ viewBox: "0 0 24 24",
316
+ fill: "none"
317
+ },
318
+ /* @__PURE__ */ h3("path", { d: "M24 11H0V7H24V11Z", fill: "#002649" }),
319
+ /* @__PURE__ */ h3(
320
+ "path",
321
+ {
322
+ opacity: "0.4",
323
+ d: "M21.3333 3C22.8042 3 24 4.19375 24 5.66667V7H0V5.66667C0 4.19375 1.19375 3 2.66667 3H21.3333ZM24 19C24 20.4708 22.8042 21.6667 21.3333 21.6667H2.66667C1.19375 21.6667 0 20.4708 0 19V11H24V19ZM4.66667 16.3333C4.3 16.3333 4 16.6333 4 17C4 17.3667 4.3 17.6667 4.66667 17.6667H7.33333C7.7 17.6667 8 17.3667 8 17C8 16.6333 7.7 16.3333 7.33333 16.3333H4.66667ZM10 17.6667H15.3333C15.7 17.6667 16 17.3667 16 17C16 16.6333 15.7 16.3333 15.3333 16.3333H10C9.63333 16.3333 9.33333 16.6333 9.33333 17C9.33333 17.3667 9.63333 17.6667 10 17.6667Z",
324
+ fill: "#002649"
325
+ }
326
+ )
327
+ );
328
+ var card_default = CardIcon;
329
+
330
+ // src/assets/icons/info.tsx
331
+ import { h as h4 } from "preact";
332
+ var InfoIcon = () => /* @__PURE__ */ h4("svg", { width: "21", height: "20", viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ h4("g", { "clip-path": "url(#clip0_10626_39119)" }, /* @__PURE__ */ h4(
333
+ "path",
334
+ {
335
+ d: "M10.6641 7.5C11.3543 7.5 11.9141 6.94023 11.9141 6.25C11.9141 5.55977 11.3543 5 10.6641 5C9.97383 5 9.41406 5.55859 9.41406 6.25C9.41406 6.94141 9.97266 7.5 10.6641 7.5ZM12.2266 13.125H11.6016V9.6875C11.6016 9.17188 11.1836 8.75 10.6641 8.75H9.41406C8.89844 8.75 8.47656 9.17188 8.47656 9.6875C8.47656 10.2031 8.89844 10.625 9.41406 10.625H9.72656V13.125H9.10156C8.58594 13.125 8.16406 13.5469 8.16406 14.0625C8.16406 14.5781 8.58594 15 9.10156 15H12.2266C12.7441 15 13.1641 14.5801 13.1641 14.0625C13.1641 13.5449 12.7461 13.125 12.2266 13.125Z",
336
+ fill: "#002649"
337
+ }
338
+ ), /* @__PURE__ */ h4(
339
+ "path",
340
+ {
341
+ opacity: "0.4",
342
+ d: "M10.6641 0C5.14062 0 0.664062 4.47656 0.664062 10C0.664062 15.5234 5.14062 20 10.6641 20C16.1875 20 20.6641 15.5234 20.6641 10C20.6641 4.47656 16.1875 0 10.6641 0ZM10.6641 5C11.3543 5 11.9141 5.55977 11.9141 6.25C11.9141 6.94023 11.3543 7.5 10.6641 7.5C9.97383 7.5 9.41406 6.94141 9.41406 6.25C9.41406 5.55859 9.97266 5 10.6641 5ZM12.2266 15H9.10156C8.58594 15 8.16406 14.582 8.16406 14.0625C8.16406 13.543 8.58398 13.125 9.10156 13.125H9.72656V10.625H9.41406C8.89648 10.625 8.47656 10.2051 8.47656 9.6875C8.47656 9.16992 8.89844 8.75 9.41406 8.75H10.6641C11.1816 8.75 11.6016 9.16992 11.6016 9.6875V13.125H12.2266C12.7441 13.125 13.1641 13.5449 13.1641 14.0625C13.1641 14.5801 12.7461 15 12.2266 15Z",
343
+ fill: "#002649"
344
+ }
345
+ )), /* @__PURE__ */ h4("defs", null, /* @__PURE__ */ h4("clipPath", { id: "clip0_10626_39119" }, /* @__PURE__ */ h4("rect", { width: "20", height: "20", fill: "white", transform: "translate(0.664062)" }))));
346
+ var info_default = InfoIcon;
347
+
348
+ // src/utils/renderBrandIcons.tsx
349
+ import { Fragment as Fragment2, h as h13 } from "preact";
350
+
351
+ // src/assets/icons/mastercard.tsx
352
+ import { h as h5 } from "preact";
353
+ var MasterCardIcon = ({ opacity = 1 }) => /* @__PURE__ */ h5(
354
+ "svg",
355
+ {
356
+ xmlns: "http://www.w3.org/2000/svg",
357
+ width: "40",
358
+ height: "26",
359
+ viewBox: "0 0 40 26",
360
+ opacity
361
+ },
362
+ /* @__PURE__ */ h5("path", { fill: "#fff", d: "M0 0h40v26H0z" }),
363
+ /* @__PURE__ */ h5("path", { fill: "#F06022", d: "M16.13 19.29h7.74V6.7h-7.74v12.58z" }),
364
+ /* @__PURE__ */ h5(
365
+ "path",
366
+ {
367
+ fill: "#EA1D25",
368
+ d: "M16.93 13A7.93 7.93 0 0 1 20 6.71a8.02 8.02 0 0 0-10.65.65 7.96 7.96 0 0 0 0 11.28 8.02 8.02 0 0 0 10.65.65A8.02 8.02 0 0 1 16.93 13"
369
+ }
370
+ ),
371
+ /* @__PURE__ */ h5(
372
+ "path",
373
+ {
374
+ fill: "#F79D1D",
375
+ d: "M33 13c0 2.12-.84 4.15-2.34 5.65a8.1 8.1 0 0 1-10.66.64A8.05 8.05 0 0 0 23.07 13 7.96 7.96 0 0 0 20 6.71a8.02 8.02 0 0 1 10.66.64A7.93 7.93 0 0 1 33 13"
376
+ }
377
+ )
378
+ );
379
+ var mastercard_default = MasterCardIcon;
380
+
381
+ // src/assets/icons/visa.tsx
382
+ import { h as h6 } from "preact";
383
+ var VisaIcon = ({ opacity = 1 }) => /* @__PURE__ */ h6(
384
+ "svg",
385
+ {
386
+ xmlns: "http://www.w3.org/2000/svg",
387
+ width: "40",
388
+ height: "26",
389
+ fill: "none",
390
+ viewBox: "0 0 40 26",
391
+ opacity
392
+ },
393
+ /* @__PURE__ */ h6("path", { fill: "#fff", d: "M0 0h40v26H0z" }),
394
+ /* @__PURE__ */ h6(
395
+ "path",
396
+ {
397
+ fill: "#1434CB",
398
+ d: "m15.9 7.7-4.43 10.6h-2.9l-2.2-8.47c-.13-.52-.25-.71-.65-.93C5.05 8.55 3.96 8.2 3 8l.07-.32h4.67c.6 0 1.13.4 1.27 1.09l1.15 6.14 2.86-7.23h2.89Zm11.39 7.15c0-2.8-3.88-2.96-3.85-4.21 0-.38.37-.79 1.16-.9a5.2 5.2 0 0 1 2.71.48l.48-2.25a7.4 7.4 0 0 0-2.57-.47c-2.71 0-4.62 1.44-4.64 3.51-.02 1.53 1.36 2.38 2.4 2.9 1.08.51 1.44.85 1.43 1.31 0 .71-.85 1.03-1.64 1.04-1.39.02-2.19-.37-2.82-.67l-.5 2.33c.64.29 1.82.55 3.05.56 2.89 0 4.78-1.42 4.79-3.63Zm7.17 3.46H37L34.78 7.7h-2.34c-.53 0-.98.3-1.17.78l-4.12 9.84h2.88l.57-1.58h3.53l.33 1.58Zm-3.07-3.76 1.45-3.99.83 4H31.4ZM19.83 7.7l-2.27 10.62h-2.74L17.09 7.7h2.74Z"
399
+ }
400
+ )
401
+ );
402
+ var visa_default = VisaIcon;
403
+
404
+ // src/assets/icons/maestro.tsx
405
+ import { h as h7 } from "preact";
406
+ var MaestroIcon = ({ opacity = 1 }) => /* @__PURE__ */ h7(
407
+ "svg",
408
+ {
409
+ xmlns: "http://www.w3.org/2000/svg",
410
+ width: "40",
411
+ height: "26",
412
+ fill: "none",
413
+ viewBox: "0 0 40 26",
414
+ opacity
415
+ },
416
+ /* @__PURE__ */ h7("path", { fill: "#fff", d: "M0 0h40v26H0z" }),
417
+ /* @__PURE__ */ h7("path", { fill: "#7773B4", d: "M16.13 19.29h7.74V6.7h-7.74v12.58z" }),
418
+ /* @__PURE__ */ h7(
419
+ "path",
420
+ {
421
+ fill: "#EA1D25",
422
+ d: "M16.93 13A7.93 7.93 0 0 1 20 6.71a8.02 8.02 0 0 0-10.65.65 7.96 7.96 0 0 0 0 11.28 8.02 8.02 0 0 0 10.65.65A8.02 8.02 0 0 1 16.93 13"
423
+ }
424
+ ),
425
+ /* @__PURE__ */ h7(
426
+ "path",
427
+ {
428
+ fill: "#139FDA",
429
+ d: "M33 13c0 2.12-.84 4.15-2.34 5.65a8.1 8.1 0 0 1-10.66.64A8.05 8.05 0 0 0 23.07 13 7.96 7.96 0 0 0 20 6.71a8.02 8.02 0 0 1 10.66.64A7.93 7.93 0 0 1 33 13"
430
+ }
431
+ )
432
+ );
433
+ var maestro_default = MaestroIcon;
434
+
435
+ // src/assets/icons/amex.tsx
436
+ import { h as h8 } from "preact";
437
+ var AmexIcon = ({ opacity = 1 }) => /* @__PURE__ */ h8(
438
+ "svg",
439
+ {
440
+ xmlns: "http://www.w3.org/2000/svg",
441
+ viewBox: "0 0 40 26",
442
+ width: "40",
443
+ height: "26",
444
+ opacity
445
+ },
446
+ /* @__PURE__ */ h8("path", { fill: "#016FD0", d: "M0 26h40V0H0v26z" }),
447
+ /* @__PURE__ */ h8(
448
+ "path",
449
+ {
450
+ fill: "#fff",
451
+ "fill-rule": "evenodd",
452
+ d: "M30.69 13.63v1.64h-4.17v1.14h4.07v1.64h-4.07v1.12h4.17v1.66l3.38-3.6-3.38-3.6zm-1.1-6.14-1.4-3.19h-4l-4.1 9.32h3.33v8.27l10.28.01 1.61-1.8 1.63 1.8H40v-2.63l-1.92-2.06L40 15.16v-2.59l-1.93.01V7.6l-1.81 4.98H34.5l-1.86-5v5h-4.2l-.6-1.46h-3.3l-.6 1.46h-2.22l3.23-7.27V5.3h2.55l3.19 7.21V5.3l3.1.01 1.6 4.47 1.62-4.48H40v-1h-3.77l-.85 2.39-.85-2.39h-4.94v3.19zm-5.06 6.11v7.27h6.16v-.01h2.54l2.1-2.32 2.12 2.32H40v-.1l-3.34-3.53L40 13.65v-.05h-2.52l-2.1 2.3-2.08-2.3h-8.77zm.7-4.11.96-2.31.97 2.31h-1.93z"
453
+ }
454
+ )
455
+ );
456
+ var amex_default = AmexIcon;
457
+
458
+ // src/assets/icons/jcb.tsx
459
+ import { h as h9 } from "preact";
460
+ var JcbIcon = ({ opacity = 1 }) => /* @__PURE__ */ h9(
461
+ "svg",
462
+ {
463
+ xmlns: "http://www.w3.org/2000/svg",
464
+ width: "40",
465
+ height: "26",
466
+ fill: "none",
467
+ viewBox: "0 0 40 26",
468
+ opacity
469
+ },
470
+ /* @__PURE__ */ h9("g", { "clip-path": "url(#a)" }, /* @__PURE__ */ h9("path", { fill: "#fff", d: "M0 0h40v26H0V0Z" }), /* @__PURE__ */ h9(
471
+ "path",
472
+ {
473
+ fill: "#fff",
474
+ d: "M36.6 20.66a5.22 5.22 0 0 1-5.22 5.22H3V5.22A5.22 5.22 0 0 1 8.22 0H36.6v20.66Z"
475
+ }
476
+ ), /* @__PURE__ */ h9(
477
+ "path",
478
+ {
479
+ fill: "url(#b)",
480
+ d: "M27.36 15.36h2.15l.27-.02a.96.96 0 0 0 .76-.96 1 1 0 0 0-.76-.97c-.06-.02-.19-.02-.27-.02h-2.15v1.97Z"
481
+ }
482
+ ), /* @__PURE__ */ h9(
483
+ "path",
484
+ {
485
+ fill: "url(#c)",
486
+ d: "M29.27 1.75a3.74 3.74 0 0 0-3.74 3.73v3.89h5.28c.12 0 .26 0 .37.02 1.19.06 2.07.67 2.07 1.74 0 .84-.6 1.56-1.7 1.7v.05c1.2.08 2.13.76 2.13 1.8 0 1.13-1.03 1.87-2.38 1.87h-5.8v7.6H31a3.74 3.74 0 0 0 3.73-3.74V1.75h-5.46Z"
487
+ }
488
+ ), /* @__PURE__ */ h9(
489
+ "path",
490
+ {
491
+ fill: "url(#d)",
492
+ d: "M30.27 11.38c0-.5-.35-.82-.76-.89l-.2-.02h-1.95v1.81h1.95c.06 0 .18 0 .2-.02a.87.87 0 0 0 .76-.88Z"
493
+ }
494
+ ), /* @__PURE__ */ h9(
495
+ "path",
496
+ {
497
+ fill: "url(#e)",
498
+ d: "M8.6 1.75a3.74 3.74 0 0 0-3.73 3.73v9.22a7.4 7.4 0 0 0 3.22.85c1.3 0 2-.78 2-1.85V9.34h3.2v4.34c0 1.68-1.05 3.06-4.6 3.06-2.16 0-3.84-.47-3.84-.47v7.86h5.48a3.74 3.74 0 0 0 3.74-3.74V1.75H8.6Z"
499
+ }
500
+ ), /* @__PURE__ */ h9(
501
+ "path",
502
+ {
503
+ fill: "url(#f)",
504
+ d: "M18.94 1.75a3.74 3.74 0 0 0-3.74 3.73v4.9c.94-.8 2.59-1.32 5.24-1.2 1.41.06 2.93.45 2.93.45v1.58a7.1 7.1 0 0 0-2.83-.82c-2.01-.14-3.23.84-3.23 2.57 0 1.74 1.22 2.73 3.23 2.57a7.46 7.46 0 0 0 2.83-.82v1.58s-1.5.39-2.93.45c-2.65.12-4.3-.4-5.24-1.2v8.63h5.48a3.74 3.74 0 0 0 3.74-3.74V1.75h-5.48Z"
505
+ }
506
+ )),
507
+ /* @__PURE__ */ h9("defs", null, /* @__PURE__ */ h9(
508
+ "linearGradient",
509
+ {
510
+ id: "b",
511
+ x1: "25.52",
512
+ x2: "34.75",
513
+ y1: "14.38",
514
+ y2: "14.38",
515
+ gradientUnits: "userSpaceOnUse"
516
+ },
517
+ /* @__PURE__ */ h9("stop", { offset: "0", "stop-color": "#007940" }),
518
+ /* @__PURE__ */ h9("stop", { offset: ".23", "stop-color": "#00873F" }),
519
+ /* @__PURE__ */ h9("stop", { offset: ".74", "stop-color": "#40A737" }),
520
+ /* @__PURE__ */ h9("stop", { offset: "1", "stop-color": "#5CB531" })
521
+ ), /* @__PURE__ */ h9(
522
+ "linearGradient",
523
+ {
524
+ id: "c",
525
+ x1: "25.52",
526
+ x2: "34.75",
527
+ y1: "12.94",
528
+ y2: "12.94",
529
+ gradientUnits: "userSpaceOnUse"
530
+ },
531
+ /* @__PURE__ */ h9("stop", { offset: "0", "stop-color": "#007940" }),
532
+ /* @__PURE__ */ h9("stop", { offset: ".23", "stop-color": "#00873F" }),
533
+ /* @__PURE__ */ h9("stop", { offset: ".74", "stop-color": "#40A737" }),
534
+ /* @__PURE__ */ h9("stop", { offset: "1", "stop-color": "#5CB531" })
535
+ ), /* @__PURE__ */ h9(
536
+ "linearGradient",
537
+ {
538
+ id: "d",
539
+ x1: "25.52",
540
+ x2: "34.75",
541
+ y1: "11.37",
542
+ y2: "11.37",
543
+ gradientUnits: "userSpaceOnUse"
544
+ },
545
+ /* @__PURE__ */ h9("stop", { offset: "0", "stop-color": "#007940" }),
546
+ /* @__PURE__ */ h9("stop", { offset: ".23", "stop-color": "#00873F" }),
547
+ /* @__PURE__ */ h9("stop", { offset: ".74", "stop-color": "#40A737" }),
548
+ /* @__PURE__ */ h9("stop", { offset: "1", "stop-color": "#5CB531" })
549
+ ), /* @__PURE__ */ h9(
550
+ "linearGradient",
551
+ {
552
+ id: "e",
553
+ x1: "4.86",
554
+ x2: "14.24",
555
+ y1: "12.94",
556
+ y2: "12.94",
557
+ gradientUnits: "userSpaceOnUse"
558
+ },
559
+ /* @__PURE__ */ h9("stop", { offset: "0", "stop-color": "#1F286F" }),
560
+ /* @__PURE__ */ h9("stop", { offset: ".48", "stop-color": "#004E94" }),
561
+ /* @__PURE__ */ h9("stop", { offset: ".83", "stop-color": "#0066B1" }),
562
+ /* @__PURE__ */ h9("stop", { offset: "1", "stop-color": "#006FBC" })
563
+ ), /* @__PURE__ */ h9(
564
+ "linearGradient",
565
+ {
566
+ id: "f",
567
+ x1: "15.15",
568
+ x2: "24.25",
569
+ y1: "12.94",
570
+ y2: "12.94",
571
+ gradientUnits: "userSpaceOnUse"
572
+ },
573
+ /* @__PURE__ */ h9("stop", { offset: "0", "stop-color": "#6C2C2F" }),
574
+ /* @__PURE__ */ h9("stop", { offset: ".17", "stop-color": "#882730" }),
575
+ /* @__PURE__ */ h9("stop", { offset: ".57", "stop-color": "#BE1833" }),
576
+ /* @__PURE__ */ h9("stop", { offset: ".86", "stop-color": "#DC0436" }),
577
+ /* @__PURE__ */ h9("stop", { offset: "1", "stop-color": "#E60039" })
578
+ ), /* @__PURE__ */ h9("clipPath", { id: "a" }, /* @__PURE__ */ h9("path", { fill: "#fff", d: "M0 0h40v26H0z" })))
579
+ );
580
+ var jcb_default = JcbIcon;
581
+
582
+ // src/assets/icons/diners.tsx
583
+ import { h as h10 } from "preact";
584
+ var DinersIcon = ({ opacity = 1 }) => /* @__PURE__ */ h10(
585
+ "svg",
586
+ {
587
+ xmlns: "http://www.w3.org/2000/svg",
588
+ viewBox: "0 0 40 26",
589
+ width: "40",
590
+ height: "26",
591
+ opacity
592
+ },
593
+ /* @__PURE__ */ h10("path", { fill: "#fff", d: "M0 0h40v26H0z" }),
594
+ /* @__PURE__ */ h10("g", { fill: "#1a1918" }, /* @__PURE__ */ h10("path", { d: "M5.96 15.58c0-.56-.3-.52-.58-.53v-.16H7.2a2.28 2.28 0 0 1 2.5 2.2c0 .61-.36 2.17-2.57 2.17H5.38v-.16c.38-.04.56-.05.58-.48zm.61 2.94c0 .49.35.54.65.54a1.75 1.75 0 0 0 1.8-1.95 1.88 1.88 0 0 0-1.96-2.02c-.26 0-.37.02-.49.02zm3.36.58h.12c.17 0 .3 0 .3-.2v-1.7c0-.28-.1-.32-.33-.44v-.1l.67-.23a.22.22 0 0 1 .11-.03c.03 0 .05.04.05.09v2.4c0 .21.13.21.3.21h.11v.16H9.93zm.67-3.67a.3.3 0 0 1 0-.61.3.3 0 0 1 .3.3.31.31 0 0 1-.3.31zm1.26 1.8c0-.23-.07-.3-.36-.41v-.12a8.44 8.44 0 0 0 .82-.3c.02 0 .04.01.04.06v.4a1.83 1.83 0 0 1 1.08-.46c.53 0 .72.39.72.88v1.61c0 .21.14.21.31.21h.12v.16h-1.34v-.16h.11c.18 0 .3 0 .3-.2v-1.63c0-.36-.22-.53-.57-.53a1.66 1.66 0 0 0-.73.3v1.85c0 .21.14.21.31.21h.12v.16h-1.34v-.16h.1c.18 0 .3 0 .3-.2v-1.67m3.21.3a1.55 1.55 0 0 0 0 .37 1.05 1.05 0 0 0 .92 1.08 1.2 1.2 0 0 0 .85-.42l.08.09a1.47 1.47 0 0 1-1.15.7 1.26 1.26 0 0 1-1.2-1.36c0-1.23.83-1.6 1.27-1.6a1 1 0 0 1 1.05 1 .74.74 0 0 1 0 .1l-.06.04zm1.11-.2c.16 0 .18-.08.18-.16a.53.53 0 0 0-.55-.57c-.38 0-.64.28-.72.73zm.86 1.77h.17c.17 0 .3 0 .3-.2v-1.77c0-.2-.23-.23-.33-.28v-.1c.46-.19.7-.35.77-.35.03 0 .05.02.05.08v.56H18c.16-.24.42-.64.8-.64a.34.34 0 0 1 .36.33.3.3 0 0 1-.3.32c-.19 0-.19-.15-.4-.15a.53.53 0 0 0-.46.52v1.47c0 .21.12.21.3.21h.35v.16h-.88a26 26 0 0 0-.74 0zm2.41-.7a.83.83 0 0 0 .78.76.44.44 0 0 0 .51-.45c0-.74-1.36-.5-1.36-1.5a.86.86 0 0 1 .97-.81 1.64 1.64 0 0 1 .71.18l.04.64h-.14a.64.64 0 0 0-.68-.62.44.44 0 0 0-.49.41c0 .74 1.45.51 1.45 1.5 0 .4-.33.85-1.07.85a1.64 1.64 0 0 1-.77-.22l-.07-.72.12-.03m7.44-2.37h-.15A1.2 1.2 0 0 0 25.39 15a1.79 1.79 0 0 0-1.77 2 2.04 2.04 0 0 0 1.87 2.17 1.27 1.27 0 0 0 1.25-1.09l.15.04-.15.91a3.5 3.5 0 0 1-1.38.34A2.23 2.23 0 0 1 22.97 17a2.3 2.3 0 0 1 2.37-2.2 4.5 4.5 0 0 1 1.48.33l.06.9m.22 3.07h.13c.17 0 .3 0 .3-.2v-3.5c0-.4-.1-.42-.34-.49v-.1a3.96 3.96 0 0 0 .65-.27.66.66 0 0 1 .14-.07c.03 0 .05.04.05.1v4.32c0 .21.13.21.3.21h.12v.16H27.1zm4.02-.18c0 .11.07.12.18.12h.25v.12a6.33 6.33 0 0 0-.9.2l-.03-.02v-.5a1.69 1.69 0 0 1-1.11.52.68.68 0 0 1-.69-.75v-1.6c0-.17-.02-.32-.37-.35v-.12l.8-.05c.07 0 .07.05.07.18v1.62c0 .19 0 .73.55.73a1.4 1.4 0 0 0 .75-.38v-1.7c0-.12-.3-.18-.52-.25v-.11c.56-.04.91-.09.97-.09.05 0 .05.05.05.11zm1.25-2.07a1.58 1.58 0 0 1 .93-.45 1.22 1.22 0 0 1 1.16 1.31 1.58 1.58 0 0 1-1.5 1.65 1.84 1.84 0 0 1-.86-.22l-.19.14-.13-.07a7.37 7.37 0 0 0 .09-1.11v-2.7c0-.4-.1-.42-.33-.49v-.1a3.93 3.93 0 0 0 .64-.27.67.67 0 0 1 .14-.07c.04 0 .05.04.05.1zm0 1.7a.67.67 0 0 0 .64.64c.67 0 .95-.65.95-1.21a1.2 1.2 0 0 0-1-1.24.96.96 0 0 0-.6.3v1.51zM5.38 22.91h.04c.13 0 .26-.02.26-.2v-1.78c0-.18-.13-.2-.26-.2h-.04v-.1l.5.01.54-.01v.1h-.05c-.12 0-.25.02-.25.2v1.79c0 .17.13.19.25.19h.05v.1L5.88 23l-.5.01z" }), /* @__PURE__ */ h10("path", { d: "M6.42 23.03 5.88 23l-.5.02h-.02v-.14h.06c.13 0 .24 0 .24-.17v-1.8c0-.16-.11-.17-.24-.17h-.06v-.13h1.07v.13h-.06c-.13 0-.24.01-.24.18v1.79c0 .16.11.17.24.17h.06v.14zM6.4 23v-.08h-.03c-.12 0-.27-.02-.27-.2v-1.8c0-.18.15-.2.27-.2h.03v-.07h-1v.07h.03c.13 0 .27.02.27.2v1.8c0 .18-.14.2-.27.2H5.4V23l.49-.02.52.02zm2.35-.66h.01v-1.29a.28.28 0 0 0-.3-.32H8.4v-.1l.48.01.42-.01v.1h-.06c-.14 0-.3.03-.3.44v1.55a2.27 2.27 0 0 0 .02.34h-.13L7.07 21.1v1.41c0 .3.06.4.32.4h.06v.1L7 23l-.47.01v-.1h.05c.24 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.4.01.3-.01 1.51 1.71" }), /* @__PURE__ */ h10("path", { d: "M8.95 23.08h-.14l-1.73-1.94v1.37c0 .3.05.38.3.38h.08v.14h-.01L7 23l-.47.02h-.01v-.14h.06c.23 0 .3-.14.3-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.72l1.5 1.69v-1.26c0-.27-.19-.3-.29-.3h-.09v-.13h.94v.13h-.07c-.14 0-.28.01-.28.42v1.55a2.27 2.27 0 0 0 .02.34v.02zm-.13-.03h.11a2.3 2.3 0 0 1-.01-.33v-1.55c0-.41.17-.45.31-.45h.04v-.07H8.4v.07h.06a.3.3 0 0 1 .32.33v1.3h-.02v.01l-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .32.32v1.44c0 .27-.07.44-.32.45h-.03V23l.45-.02.42.02v-.07H7.4c-.27 0-.34-.12-.34-.42v-1.44l1.77 1.98zm-.07-.71.01-.01v.01zm0 0v-.01zM9.8 20.8c-.26 0-.27.06-.32.31h-.1l.04-.29a2.04 2.04 0 0 0 .02-.29h.08c.03.1.11.1.2.1h1.76c.1 0 .18 0 .18-.1h.09l-.04.28v.28l-.11.04c0-.13-.02-.33-.25-.33h-.56v1.82c0 .26.12.29.28.29h.07v.1l-.56-.01-.57.01v-.1h.06c.19 0 .28-.02.28-.29V20.8z" }), /* @__PURE__ */ h10("path", { d: "m11.14 23.03-.56-.02-.57.02h-.02v-.14h.08c.19 0 .26 0 .27-.27v-1.8H9.8v-.03h.57v1.83c0 .28-.11.3-.3.3h-.05V23l.56-.02.54.02v-.07h-.05c-.16 0-.3-.05-.3-.31v-1.83h.58c.23 0 .26.2.26.32l.08-.03a3.96 3.96 0 0 1 .04-.53h-.05c-.02.1-.11.1-.2.1H9.71c-.08 0-.17 0-.2-.1h-.06a2.04 2.04 0 0 1-.02.27c0 .1-.02.19-.04.28h.08c.04-.24.07-.32.33-.31v.03c-.26 0-.25.04-.3.3h-.14v-.01l.04-.3a1.93 1.93 0 0 0 .02-.28v-.01h.11c.03.1.09.1.18.1h1.77c.1 0 .16 0 .17-.1v-.01h.02l.1.02-.01.01-.04.28v.28h-.01l-.12.05v-.02c-.01-.13-.03-.31-.24-.31h-.55v1.8c0 .25.11.27.27.27h.08v.14zm.71-.12h.05c.12 0 .25-.02.25-.2v-1.78c0-.18-.13-.2-.25-.2h-.05v-.1l.85.01.87-.01.01.52-.1.03c-.02-.22-.06-.4-.42-.4h-.47v.9h.4c.2 0 .25-.12.27-.3h.1v.78l-.1.02c-.02-.2-.03-.33-.26-.33h-.4v.79c0 .22.19.22.4.22.41 0 .6-.03.7-.41l.1.02a7.7 7.7 0 0 0-.12.54l-.92-.01-.9.01v-.1" }), /* @__PURE__ */ h10("path", { d: "m13.68 23.03-.92-.02-.9.02h-.02v-.14h.06c.13 0 .24 0 .24-.17v-1.8c0-.16-.11-.17-.24-.17h-.06v-.13h1.75v.01a4.18 4.18 0 0 0 0 .52v.01l-.13.04v-.02c-.02-.22-.05-.38-.4-.38h-.46v.86h.4c.2 0 .23-.1.25-.29v-.01h.13v.01a8.08 8.08 0 0 0 0 .8h-.01l-.12.03v-.02c-.02-.2-.03-.32-.25-.32h-.4v.78c0 .2.18.2.4.2.42 0 .58-.02.68-.4v-.01h.02l.1.03v.01a7.8 7.8 0 0 0-.11.54v.02zm-.02-.03.11-.52-.06-.02c-.1.39-.3.42-.7.42-.22 0-.43 0-.44-.24v-.8H13c.24-.01.26.13.28.33l.07-.02a7.25 7.25 0 0 1 0-.76h-.07c-.02.18-.08.3-.29.3h-.42v-.92h.5c.35 0 .4.18.42.4l.07-.03a5.76 5.76 0 0 1 0-.5l-.86.02-.83-.01v.07h.03c.12 0 .27.02.27.2v1.8c0 .18-.15.2-.27.2h-.03V23l.89-.02zm.59-2c0-.26-.14-.27-.24-.27h-.06v-.1l.53.01.54-.01c.43 0 .81.12.81.6a.64.64 0 0 1-.47.6l.58.87a.38.38 0 0 0 .33.21v.1l-.33-.01-.32.01a9.45 9.45 0 0 1-.7-1.1h-.23v.73c0 .26.12.27.28.27h.06v.1l-.59-.01-.5.01v-.1h.07c.13 0 .24-.06.24-.18v-1.74zm.44.78h.16c.34 0 .53-.13.53-.53a.47.47 0 0 0-.5-.5 1.65 1.65 0 0 0-.2.02v1.01z" }), /* @__PURE__ */ h10("path", { d: "m16.27 23.03-.33-.02c-.1 0-.21.02-.33.01a9.54 9.54 0 0 1-.7-1.1h-.2v.72c0 .25.1.25.26.25h.07v.14h-.01l-.59-.02-.5.02v-.14H14c.12 0 .22-.05.23-.16v-1.74c0-.24-.13-.24-.23-.24h-.08v-.13h1.09c.43 0 .83.11.83.61a.65.65 0 0 1-.47.6l.57.87a.37.37 0 0 0 .32.2h.02v.13zm-1.58-1.14h.23a10.55 10.55 0 0 0 .7 1.1h.64v-.07a.39.39 0 0 1-.33-.2l-.6-.9h.02a.63.63 0 0 0 .47-.59c0-.47-.37-.58-.8-.58h-1.06v.07h.05c.1 0 .26.02.26.27v1.74c0 .13-.13.2-.26.2h-.05V23l.48-.02.57.02v-.07h-.04c-.16 0-.3-.02-.3-.3v-.74zm0-.1h-.02v-1.04h.01a1.63 1.63 0 0 1 .2-.01.48.48 0 0 1 .51.51c0 .4-.2.55-.54.55zm.16-.02c.34 0 .51-.12.51-.52a.45.45 0 0 0-.48-.48 1.33 1.33 0 0 0-.18.01v.99zm3.73.57h.01v-1.29a.28.28 0 0 0-.3-.32h-.07v-.1l.48.01.42-.01v.1h-.06c-.14 0-.3.03-.3.44v1.55a2.27 2.27 0 0 0 .02.34h-.13L16.9 21.1v1.41c0 .3.06.4.32.4h.06v.1l-.44-.01-.47.01v-.1h.05c.24 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.4.01.3-.01z" }), /* @__PURE__ */ h10("path", { d: "M18.78 23.08h-.14l-1.73-1.94v1.37c0 .3.05.38.3.38h.08v.14h-.01l-.44-.02-.47.02h-.01v-.14h.06c.23 0 .3-.14.3-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.71l1.5 1.69v-1.26c0-.27-.18-.3-.28-.3h-.09v-.13h.93v.13h-.07c-.14 0-.28.01-.28.42v1.55a2.15 2.15 0 0 0 .02.34v.02zm-.13-.03h.11a2.34 2.34 0 0 1-.01-.33v-1.55c0-.41.17-.45.31-.45h.04v-.07h-.87v.07h.06a.3.3 0 0 1 .32.33v1.3h-.02v.01l-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .32.32v1.44c0 .27-.07.44-.32.45h-.03V23l.45-.02.42.02v-.07h-.04c-.27 0-.34-.12-.34-.42v-1.44zm-.07-.71.01-.01v.01zm0 0v-.01zm1.08.18a1.38 1.38 0 0 0-.07.27c0 .1.14.12.25.12h.04v.1a7.72 7.72 0 0 0-.78 0v-.1h.02a.3.3 0 0 0 .3-.22l.54-1.57a2.87 2.87 0 0 0 .13-.42 1.73 1.73 0 0 0 .3-.15.08.08 0 0 1 .04 0 .02.02 0 0 1 .02 0l.03.1.63 1.78.12.34a.22.22 0 0 0 .23.14h.02v.1a9.66 9.66 0 0 0-.98 0v-.1h.03c.08 0 .22-.01.22-.1a1.1 1.1 0 0 0-.07-.25l-.14-.4h-.77l-.1.36zm.5-1.5-.32.96h.63l-.31-.97z" }), /* @__PURE__ */ h10("path", { d: "M21.48 23.03 21 23l-.51.02h-.02v-.14h.05c.08 0 .2-.01.2-.08a1.1 1.1 0 0 0-.07-.24l-.13-.39h-.75l-.1.35a1.41 1.41 0 0 0-.08.26c0 .08.13.1.24.1h.06v.14h-.02l-.41-.02-.37.02h-.01v-.14h.03a.3.3 0 0 0 .28-.2l.55-1.57a4.05 4.05 0 0 0 .13-.44 1.75 1.75 0 0 0 .31-.14.09.09 0 0 1 .03-.01.04.04 0 0 1 .04.02l.03.09.63 1.78c.04.12.08.25.13.35a.2.2 0 0 0 .2.12h.04v.14h-.01zM20.5 23l.5-.02.45.02v-.07a.23.23 0 0 1-.24-.15c-.05-.1-.09-.23-.13-.35l-.62-1.78-.03-.09h-.02a.08.08 0 0 0-.01 0 1.26 1.26 0 0 1-.3.14 2.83 2.83 0 0 1-.13.43l-.55 1.56a.32.32 0 0 1-.3.24h-.01V23l.35-.02.4.02v-.07h-.03c-.1 0-.26-.02-.27-.14a1.35 1.35 0 0 1 .08-.27h.01-.01l.11-.36h.8l.13.4a1.04 1.04 0 0 1 .07.25c0 .1-.15.11-.23.12h-.02zm-.7-1 .33-1h.03l.32 1zm.05-.04h.6l-.3-.91zm.28-.94h.01zm1.5-.22c-.26 0-.27.06-.32.31h-.1l.04-.29a2.1 2.1 0 0 0 .02-.29h.08c.03.1.11.1.2.1h1.76c.1 0 .18 0 .19-.1h.08l-.04.28v.28l-.1.04c-.02-.13-.03-.33-.26-.33h-.56v1.82c0 .26.12.29.28.29h.07v.1L22.4 23l-.57.01v-.1h.06c.19 0 .29-.02.29-.29V20.8h-.56" }), /* @__PURE__ */ h10("path", { d: "M22.97 23.03 22.4 23l-.57.02h-.02v-.14h.08c.19 0 .27 0 .27-.27v-1.8h-.54v-.03h.57v1.83c0 .28-.11.3-.3.3h-.05V23l.56-.02.54.02v-.07h-.05c-.16 0-.3-.05-.3-.31v-1.83h.58c.23 0 .26.2.26.32l.08-.03v-.27l.04-.26h-.05c-.02.1-.11.1-.2.1h-1.77c-.08 0-.17 0-.2-.1h-.06a2 2 0 0 1-.02.27c0 .1-.02.19-.04.28h.08c.04-.24.07-.32.33-.31v.03c-.26 0-.25.04-.3.3h-.14v-.01l.04-.29a1.98 1.98 0 0 0 .02-.29v-.01h.11c.03.1.1.1.18.1h1.77c.1 0 .17 0 .17-.1v-.01h.02l.1.02v.01l-.05.28v.28h-.01l-.12.05v-.02c-.01-.13-.03-.31-.24-.31h-.54v1.8c0 .25.1.27.26.27h.08v.14h-.01m.74-.12h.05c.12 0 .25-.02.25-.2v-1.78c0-.18-.13-.2-.25-.2h-.05v-.1l.5.01.54-.01v.1h-.05c-.12 0-.25.02-.25.2v1.79c0 .17.13.19.25.19h.05v.1L24.2 23l-.5.01z" }), /* @__PURE__ */ h10("path", { d: "M24.74 23.03 24.2 23l-.5.02h-.01v-.14h.06c.12 0 .24 0 .24-.17v-1.8c0-.16-.12-.17-.24-.17h-.06v-.13h1.07v.13h-.07c-.12 0-.23.01-.23.18v1.79c0 .16.1.17.23.17h.07v.14zm-.01-.03v-.07h-.04c-.12 0-.26-.03-.26-.21v-1.8c0-.18.14-.2.26-.2h.04v-.07H23.7v.07h.04c.12 0 .27.02.27.2v1.8c0 .18-.15.2-.27.2h-.03V23l.48-.02.53.02zm1.37-2.42a1.2 1.2 0 0 1 1.3 1.18 1.25 1.25 0 0 1-1.28 1.3 1.2 1.2 0 0 1-1.28-1.22 1.24 1.24 0 0 1 1.26-1.26m.05 2.33c.66 0 .78-.58.78-1.08s-.27-1.1-.84-1.1c-.6 0-.77.53-.77.99 0 .6.28 1.2.83 1.2" }), /* @__PURE__ */ h10("path", { d: "M24.83 21.84a1.26 1.26 0 0 1 1.27-1.28v.03a1.23 1.23 0 0 0-1.24 1.25 1.19 1.19 0 0 0 1.26 1.2 1.24 1.24 0 0 0 1.27-1.28 1.18 1.18 0 0 0-1.3-1.17v-.03a1.21 1.21 0 0 1 1.33 1.2 1.27 1.27 0 0 1-1.3 1.32 1.22 1.22 0 0 1-1.3-1.24m.48-.12c0-.46.18-1 .8-1 .57 0 .84.61.84 1.11s-.12 1.1-.79 1.1v-.03c.65 0 .76-.57.76-1.07s-.26-1.08-.82-1.09c-.58 0-.75.52-.76.98 0 .6.28 1.18.82 1.18v.03c-.56 0-.84-.6-.85-1.21m4.4.62v-1.29a.28.28 0 0 0-.3-.32h-.07v-.1l.48.01.42-.01v.1h-.05c-.15 0-.3.03-.3.44v1.55a2.2 2.2 0 0 0 .01.34h-.12L28 21.1v1.41c0 .3.06.4.32.4h.06v.1l-.44-.01-.46.01v-.1h.05c.23 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.39.01.3-.01 1.52 1.71" }), /* @__PURE__ */ h10("path", { d: "M29.9 23.08h-.15l-1.72-1.94v1.37c0 .3.05.38.3.38h.07v.14h-.01l-.44-.02-.46.02h-.02v-.14h.07c.22 0 .28-.14.29-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.72l1.5 1.69v-1.26c0-.27-.18-.3-.28-.3h-.1v-.13h.94v.13h-.06c-.14 0-.29.01-.3.42v1.55a2.26 2.26 0 0 0 .03.34v.02zm-.13-.03h.1a2.42 2.42 0 0 1-.01-.33v-1.55c0-.41.17-.45.32-.45h.03v-.07h-.86v.07h.06a.3.3 0 0 1 .3.33v1.3l-.01.01-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .33.32v1.44c0 .27-.08.44-.32.45h-.04V23l.45-.02.43.02v-.07h-.05c-.27 0-.33-.12-.33-.42v-1.44zm-.07-.71v-.01zm-.01 0v-.01zm1.09.18a1.43 1.43 0 0 0-.08.27c0 .1.14.12.26.12h.03v.1a7.71 7.71 0 0 0-.78 0v-.1h.02a.3.3 0 0 0 .3-.22l.55-1.57a2.79 2.79 0 0 0 .12-.42 1.75 1.75 0 0 0 .31-.15.07.07 0 0 1 .03 0 .02.02 0 0 1 .02 0l.03.1.63 1.78c.04.11.08.24.13.34a.22.22 0 0 0 .22.14h.02v.1a9.66 9.66 0 0 0-.98 0v-.1h.04c.08 0 .2-.01.2-.1a1.1 1.1 0 0 0-.06-.25l-.13-.4h-.78zm.5-1.5h-.01l-.32.96h.64l-.32-.97z" }), /* @__PURE__ */ h10("path", { d: "m32.59 23.03-.47-.02-.5.02h-.02v-.14h.05c.08 0 .2-.01.2-.08a1.06 1.06 0 0 0-.07-.24l-.13-.39h-.76l-.1.35a1.44 1.44 0 0 0-.07.26c0 .08.12.1.24.1H31v.14h-.02l-.4-.02-.38.02h-.01v-.14h.03a.3.3 0 0 0 .29-.2l.54-1.57a4.27 4.27 0 0 0 .14-.44 1.85 1.85 0 0 0 .3-.14.08.08 0 0 1 .04 0 .04.04 0 0 1 .04.01l.03.09.62 1.78c.04.12.08.25.13.35a.2.2 0 0 0 .2.12h.04v.14h-.01zm-.97-.03.5-.02.46.02v-.08h-.01a.23.23 0 0 1-.24-.14l-.12-.35-.63-1.78a3.61 3.61 0 0 1-.03-.09h-.01a.06.06 0 0 0-.02 0 1.3 1.3 0 0 1-.3.14 2.94 2.94 0 0 1-.13.43l-.55 1.56a.32.32 0 0 1-.3.24h-.01V23l.35-.02.4.02v-.07h-.02c-.11 0-.27-.02-.27-.14a1.42 1.42 0 0 1 .07-.27h.02-.02l.11-.36h.8l.13.4a1.07 1.07 0 0 1 .07.25c0 .1-.15.11-.22.12h-.03zm-.7-1 .34-1h.02l.33 1zm.05-.04h.6l-.3-.91zm2.48.72c0 .13.1.18.2.19a2.47 2.47 0 0 0 .45 0 .48.48 0 0 0 .33-.2.78.78 0 0 0 .1-.24h.1l-.12.58-.9-.01-.9.01v-.1h.05c.12 0 .25-.02.25-.23v-1.75c0-.18-.13-.2-.25-.2h-.05v-.1l.54.01.51-.01v.1h-.08c-.13 0-.23 0-.23.19z" }), /* @__PURE__ */ h10("path", { d: "m34.5 23.03-.9-.02-.9.02v-.14h.06c.12 0 .24 0 .24-.2v-1.76c0-.17-.12-.18-.24-.18h-.07v-.13h1.09v.13h-.1c-.13 0-.21 0-.22.17v1.76c0 .13.09.16.2.17l.18.01a2.46 2.46 0 0 0 .26-.01.48.48 0 0 0 .32-.18.77.77 0 0 0 .1-.24v-.01h.13v.02l-.13.58zm0-.03.11-.55h-.07a.77.77 0 0 1-.1.24.5.5 0 0 1-.34.19 2.6 2.6 0 0 1-.26.01h-.19c-.11-.02-.22-.07-.22-.21v-1.76c0-.2.12-.2.25-.2h.07v-.07h-1.03v.07h.04c.12 0 .27.02.27.2v1.76c0 .22-.15.24-.27.24h-.04V23l.89-.02.88.02zm.1-2.47a.36.36 0 1 1-.37.36.35.35 0 0 1 .36-.36zm0 .66a.3.3 0 1 0-.3-.3.29.29 0 0 0 .3.3zm-.19-.1v-.02c.05-.01.05 0 .05-.04v-.26c0-.04 0-.05-.05-.05v-.02h.19c.06 0 .12.03.12.1a.11.11 0 0 1-.09.1l.06.09a.38.38 0 0 0 .08.08v.01h-.07c-.03 0-.06-.07-.13-.16h-.04v.12c0 .02.01.02.06.03v.01zm.12-.2h.05c.04 0 .06-.03.06-.09s-.03-.08-.07-.08h-.04z" })),
595
+ /* @__PURE__ */ h10(
596
+ "path",
597
+ {
598
+ fill: "#fff",
599
+ d: "M13.33 8.58a5.77 5.77 0 1 1 5.76 5.78 5.77 5.77 0 0 1-5.76-5.78"
600
+ }
601
+ ),
602
+ /* @__PURE__ */ h10(
603
+ "path",
604
+ {
605
+ fill: "#154a78",
606
+ d: "M22.58 8.47a3.48 3.48 0 0 0-2.23-3.24v6.48a3.48 3.48 0 0 0 2.23-3.24zm-4.7 3.24V5.23a3.47 3.47 0 0 0 0 6.48zM19.1 3a5.48 5.48 0 1 0 5.47 5.48A5.47 5.47 0 0 0 19.11 3zm0 11.48a5.99 5.99 0 0 1-6.03-5.94A5.9 5.9 0 0 1 19.1 2.5h1.55a6.1 6.1 0 0 1 6.24 6.03 6.22 6.22 0 0 1-6.24 5.94z"
607
+ }
608
+ )
609
+ );
610
+ var diners_default = DinersIcon;
611
+
612
+ // src/assets/icons/discover.tsx
613
+ import { h as h11 } from "preact";
614
+ var DiscoverIcon = ({ opacity = 1 }) => /* @__PURE__ */ h11(
615
+ "svg",
616
+ {
617
+ xmlns: "http://www.w3.org/2000/svg",
618
+ width: "40",
619
+ height: "26",
620
+ fill: "none",
621
+ viewBox: "0 0 40 26",
622
+ opacity
623
+ },
624
+ /* @__PURE__ */ h11("path", { fill: "#fff", d: "M0 0h40v26H0z" }),
625
+ /* @__PURE__ */ h11("g", { "clip-path": "url(#a)" }, /* @__PURE__ */ h11("g", { "clip-path": "url(#b)" }, /* @__PURE__ */ h11(
626
+ "path",
627
+ {
628
+ fill: "#000",
629
+ d: "M3.5 19.56a1.6 1.6 0 0 1 1.54-1.6h.06a1.52 1.52 0 0 1 1.42.77l-.43.25a1.02 1.02 0 0 0-.99-.59 1.13 1.13 0 0 0-1.14 1.11v.03a1.05 1.05 0 0 0 .99 1.14h.1a.94.94 0 0 0 1.04-.83H5.01v-.43h1.51v1.66h-.46v-.49l.03-.12a1.08 1.08 0 0 1-1.08.64 1.49 1.49 0 0 1-1.51-1.48v-.06Zm3.58-1.79h.46v3.33h-.46v-3.33Zm.92 2.2a1.2 1.2 0 1 1 .74 1.11A1.19 1.19 0 0 1 8 19.96Zm1.91 0a.74.74 0 1 0-1.48.06.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm1.36.8v.33h-.46v-3.36h.46v1.4a.98.98 0 0 1 .77-.38 1.19 1.19 0 0 1 0 2.38.9.9 0 0 1-.77-.37Zm1.48-.8a.75.75 0 1 0-1.5-.04v.03a.76.76 0 1 0 1.5 0Zm.8.55c0-.46.28-.65.9-.74.43-.06.58-.1.58-.25s-.12-.37-.46-.37a.54.54 0 0 0-.58.43l-.44-.18a1.01 1.01 0 0 1 1.02-.65c.59 0 .96.3.96.86v1.48h-.43v-.33a.75.75 0 0 1-.74.4c-.5 0-.8-.28-.8-.65Zm1.33.06a.5.5 0 0 0 .19-.4v-.19c0 .1-.16.13-.5.16-.4.06-.55.15-.55.34 0 .15.15.28.37.28.18 0 .35-.07.49-.19Zm1.14-2.8h.46v3.32h-.46v-3.33Zm2.04.24h.5l1.53 2.34v-2.34h.47v3.12h-.47l-1.57-2.41v2.4h-.46v-3.11Zm2.96 1.94a1.18 1.18 0 0 1 1.17-1.2h.03a1.14 1.14 0 0 1 1.17 1.11v.25h-1.94a.77.77 0 0 0 .96.58c.2-.05.37-.17.49-.34l.37.22a1.18 1.18 0 0 1-1.05.56 1.15 1.15 0 0 1-1.2-1.11v-.07Zm.46-.21h1.45a.67.67 0 0 0-.7-.56.7.7 0 0 0-.75.56Zm2.56.61v-1.14h-.46v-.4h.46v-.5l.46-.3v.8h.62v.4h-.65v1.14c0 .25.13.37.31.37.12 0 .24-.03.34-.09v.43a.82.82 0 0 1-.37.1c-.46 0-.71-.25-.71-.8Zm1.36-1.54h.46l.52 1.67.62-1.67h.43l.62 1.67.55-1.67h.47l-.8 2.28h-.44l-.61-1.66-.65 1.7h-.46l-.71-2.32Zm3.88 1.14a1.2 1.2 0 1 1 .74 1.12 1.19 1.19 0 0 1-.74-1.12Zm1.92 0a.74.74 0 1 0-1.48.07.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm.89-1.14h.46v.4a.72.72 0 0 1 .65-.4h.19v.46h-.28c-.37 0-.56.16-.56.6v1.22h-.46v-2.28Zm2.59 1.24-.4.43v.58h-.46v-3.3h.46V20l1.08-1.17h.55l-.89.96.92 1.32h-.52l-.74-1.04ZM5.2 10.16H3.72v5.18H5.2c.66.03 1.32-.18 1.85-.59a2.56 2.56 0 0 0 .92-1.97c0-1.54-1.14-2.62-2.77-2.62Zm1.2 3.88c-.3.28-.74.4-1.39.4h-.28v-3.39h.28a1.88 1.88 0 0 1 1.39.43 1.73 1.73 0 0 1 .55 1.3c0 .48-.2.93-.55 1.26Zm2.03-3.88h1.02v5.18H8.43v-5.18Zm3.49 2c-.62-.22-.77-.37-.77-.65 0-.34.3-.58.74-.58a.97.97 0 0 1 .8.43l.53-.68a2.32 2.32 0 0 0-1.52-.59 1.52 1.52 0 0 0-1.6 1.42v.06c0 .71.34 1.08 1.26 1.42.25.08.49.18.71.31a.64.64 0 0 1 .31.53.75.75 0 0 1-.74.74h-.03a1.29 1.29 0 0 1-1.1-.68l-.66.61a2 2 0 0 0 1.8 1 1.68 1.68 0 0 0 1.78-1.7c-.03-.87-.37-1.24-1.51-1.64Zm1.82.59a2.66 2.66 0 0 0 2.65 2.68h.06c.44 0 .88-.1 1.27-.3v-1.18a1.54 1.54 0 0 1-1.2.55 1.69 1.69 0 0 1-1.73-1.63v-.15a1.72 1.72 0 0 1 1.66-1.8h.03a1.64 1.64 0 0 1 1.27.6v-1.15c-.38-.2-.8-.31-1.23-.3a2.69 2.69 0 0 0-2.78 2.68Zm11.97.9-1.4-3.5h-1.07l2.19 5.31h.52l2.25-5.3h-1.1l-1.4 3.48Zm2.96 1.69h2.83v-.87h-1.85v-1.41h1.8v-.87h-1.8v-1.14h1.85v-.9h-2.83v5.19Zm6.84-3.64c0-.96-.68-1.51-1.82-1.51h-1.48v5.18h1.02v-2.1h.12l1.4 2.07h1.23l-1.64-2.2a1.36 1.36 0 0 0 1.17-1.44Zm-2.03.86h-.31V11h.3c.62 0 .96.28.96.77.03.52-.3.8-.95.8Zm2.84-2.13c0-.09-.07-.15-.19-.15h-.15v.46h.12v-.15l.12.18h.13l-.13-.21c.06 0 .1-.06.1-.13Zm-.19.07-.03-.13h.03c.06 0 .1.03.1.06-.04.07-.07.07-.1.07Z"
630
+ }
631
+ )), /* @__PURE__ */ h11(
632
+ "path",
633
+ {
634
+ fill: "#000",
635
+ d: "M36.16 10.13a.4.4 0 0 0-.4.4.4.4 0 1 0 .8 0 .4.4 0 0 0-.4-.4Zm0 .74a.32.32 0 0 1-.34-.31.32.32 0 0 1 .65-.03.34.34 0 0 1-.3.34Z"
636
+ }
637
+ ), /* @__PURE__ */ h11(
638
+ "path",
639
+ {
640
+ fill: "url(#c)",
641
+ d: "M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z"
642
+ }
643
+ ), /* @__PURE__ */ h11(
644
+ "path",
645
+ {
646
+ fill: "url(#d)",
647
+ d: "M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z"
648
+ }
649
+ ), /* @__PURE__ */ h11(
650
+ "mask",
651
+ {
652
+ id: "e",
653
+ width: "6",
654
+ height: "6",
655
+ x: "18",
656
+ y: "10",
657
+ maskUnits: "userSpaceOnUse",
658
+ style: "mask-type:luminance"
659
+ },
660
+ /* @__PURE__ */ h11(
661
+ "path",
662
+ {
663
+ fill: "#fff",
664
+ d: "M18.06 12.75a2.74 2.74 0 1 0 5.49 0 2.74 2.74 0 0 0-5.5 0Z"
665
+ }
666
+ )
667
+ ), /* @__PURE__ */ h11("g", { mask: "url(#e)" }, /* @__PURE__ */ h11(
668
+ "path",
669
+ {
670
+ fill: "url(#f)",
671
+ d: "M17.75 12.87a3.36 3.36 0 1 0 6.72 0 3.36 3.36 0 0 0-6.72 0Z"
672
+ }
673
+ ))),
674
+ /* @__PURE__ */ h11("g", { "clip-path": "url(#g)" }, /* @__PURE__ */ h11("g", { "clip-path": "url(#h)" }, /* @__PURE__ */ h11(
675
+ "path",
676
+ {
677
+ fill: "#000",
678
+ d: "M3.5 19.56a1.6 1.6 0 0 1 1.54-1.6h.06a1.52 1.52 0 0 1 1.42.77l-.43.25a1.02 1.02 0 0 0-.99-.59 1.13 1.13 0 0 0-1.14 1.11v.03a1.05 1.05 0 0 0 .99 1.14h.1a.94.94 0 0 0 1.04-.83H5.01v-.43h1.51v1.66h-.46v-.49l.03-.12a1.08 1.08 0 0 1-1.08.64 1.49 1.49 0 0 1-1.51-1.48v-.06Zm3.58-1.79h.46v3.33h-.46v-3.33Zm.92 2.2a1.2 1.2 0 1 1 .74 1.11A1.19 1.19 0 0 1 8 19.96Zm1.91 0a.74.74 0 1 0-1.48.06.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm1.36.8v.33h-.46v-3.36h.46v1.4a.98.98 0 0 1 .77-.38 1.19 1.19 0 0 1 0 2.38.9.9 0 0 1-.77-.37Zm1.48-.8a.75.75 0 1 0-1.5-.04v.03a.76.76 0 1 0 1.5 0Zm.8.55c0-.46.28-.65.9-.74.43-.06.58-.1.58-.25s-.12-.37-.46-.37a.54.54 0 0 0-.58.43l-.44-.18a1.01 1.01 0 0 1 1.02-.65c.59 0 .96.3.96.86v1.48h-.43v-.33a.75.75 0 0 1-.74.4c-.5 0-.8-.28-.8-.65Zm1.33.06a.5.5 0 0 0 .19-.4v-.19c0 .1-.16.13-.5.16-.4.06-.55.15-.55.34 0 .15.15.28.37.28.18 0 .35-.07.49-.19Zm1.14-2.8h.46v3.32h-.46v-3.33Zm2.04.24h.5l1.53 2.34v-2.34h.47v3.12h-.47l-1.57-2.41v2.4h-.46v-3.11Zm2.96 1.94a1.18 1.18 0 0 1 1.17-1.2h.03a1.14 1.14 0 0 1 1.17 1.11v.25h-1.94a.77.77 0 0 0 .96.58c.2-.05.37-.17.49-.34l.37.22a1.18 1.18 0 0 1-1.05.56 1.15 1.15 0 0 1-1.2-1.11v-.07Zm.46-.21h1.45a.67.67 0 0 0-.7-.56.7.7 0 0 0-.75.56Zm2.56.61v-1.14h-.46v-.4h.46v-.5l.46-.3v.8h.62v.4h-.65v1.14c0 .25.13.37.31.37.12 0 .24-.03.34-.09v.43a.82.82 0 0 1-.37.1c-.46 0-.71-.25-.71-.8Zm1.36-1.54h.46l.52 1.67.62-1.67h.43l.62 1.67.55-1.67h.47l-.8 2.28h-.44l-.61-1.66-.65 1.7h-.46l-.71-2.32Zm3.88 1.14a1.2 1.2 0 1 1 .74 1.12 1.19 1.19 0 0 1-.74-1.12Zm1.92 0a.74.74 0 1 0-1.48.07.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm.89-1.14h.46v.4a.72.72 0 0 1 .65-.4h.19v.46h-.28c-.37 0-.56.16-.56.6v1.22h-.46v-2.28Zm2.59 1.24-.4.43v.58h-.46v-3.3h.46V20l1.08-1.17h.55l-.89.96.92 1.32h-.52l-.74-1.04ZM5.2 10.16H3.72v5.18H5.2c.66.03 1.32-.18 1.85-.59a2.56 2.56 0 0 0 .92-1.97c0-1.54-1.14-2.62-2.77-2.62Zm1.2 3.88c-.3.28-.74.4-1.39.4h-.28v-3.39h.28a1.88 1.88 0 0 1 1.39.43 1.73 1.73 0 0 1 .55 1.3c0 .48-.2.93-.55 1.26Zm2.03-3.88h1.02v5.18H8.43v-5.18Zm3.49 2c-.62-.22-.77-.37-.77-.65 0-.34.3-.58.74-.58a.97.97 0 0 1 .8.43l.53-.68a2.32 2.32 0 0 0-1.52-.59 1.52 1.52 0 0 0-1.6 1.42v.06c0 .71.34 1.08 1.26 1.42.25.08.49.18.71.31a.64.64 0 0 1 .31.53.75.75 0 0 1-.74.74h-.03a1.29 1.29 0 0 1-1.1-.68l-.66.61a2 2 0 0 0 1.8 1 1.68 1.68 0 0 0 1.78-1.7c-.03-.87-.37-1.24-1.51-1.64Zm1.82.59a2.66 2.66 0 0 0 2.65 2.68h.06c.44 0 .88-.1 1.27-.3v-1.18a1.54 1.54 0 0 1-1.2.55 1.69 1.69 0 0 1-1.73-1.63v-.15a1.72 1.72 0 0 1 1.66-1.8h.03a1.64 1.64 0 0 1 1.27.6v-1.15c-.38-.2-.8-.31-1.23-.3a2.69 2.69 0 0 0-2.78 2.68Zm11.97.9-1.4-3.5h-1.07l2.19 5.31h.52l2.25-5.3h-1.1l-1.4 3.48Zm2.96 1.69h2.83v-.87h-1.85v-1.41h1.8v-.87h-1.8v-1.14h1.85v-.9h-2.83v5.19Zm6.84-3.64c0-.96-.68-1.51-1.82-1.51h-1.48v5.18h1.02v-2.1h.12l1.4 2.07h1.23l-1.64-2.2a1.36 1.36 0 0 0 1.17-1.44Zm-2.03.86h-.31V11h.3c.62 0 .96.28.96.77.03.52-.3.8-.95.8Zm2.84-2.13c0-.09-.07-.15-.19-.15h-.15v.46h.12v-.15l.12.18h.13l-.13-.21c.06 0 .1-.06.1-.13Zm-.19.07-.03-.13h.03c.06 0 .1.03.1.06-.04.07-.07.07-.1.07Z"
679
+ }
680
+ )), /* @__PURE__ */ h11(
681
+ "path",
682
+ {
683
+ fill: "#000",
684
+ d: "M36.16 10.13a.4.4 0 0 0-.4.4.4.4 0 1 0 .8 0 .4.4 0 0 0-.4-.4Zm0 .74a.32.32 0 0 1-.34-.31.32.32 0 0 1 .65-.03.34.34 0 0 1-.3.34Z"
685
+ }
686
+ ), /* @__PURE__ */ h11(
687
+ "path",
688
+ {
689
+ fill: "url(#i)",
690
+ d: "M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z"
691
+ }
692
+ ), /* @__PURE__ */ h11(
693
+ "path",
694
+ {
695
+ fill: "url(#j)",
696
+ d: "M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z"
697
+ }
698
+ ), /* @__PURE__ */ h11(
699
+ "mask",
700
+ {
701
+ id: "k",
702
+ width: "6",
703
+ height: "6",
704
+ x: "18",
705
+ y: "10",
706
+ maskUnits: "userSpaceOnUse",
707
+ style: "mask-type:luminance"
708
+ },
709
+ /* @__PURE__ */ h11(
710
+ "path",
711
+ {
712
+ fill: "#fff",
713
+ d: "M18.06 12.75a2.74 2.74 0 1 0 5.49 0 2.74 2.74 0 0 0-5.5 0Z"
714
+ }
715
+ )
716
+ ), /* @__PURE__ */ h11("g", { mask: "url(#k)" }, /* @__PURE__ */ h11(
717
+ "path",
718
+ {
719
+ fill: "url(#l)",
720
+ d: "M17.75 12.87a3.36 3.36 0 1 0 6.72 0 3.36 3.36 0 0 0-6.72 0Z"
721
+ }
722
+ ))),
723
+ /* @__PURE__ */ h11("defs", null, /* @__PURE__ */ h11(
724
+ "linearGradient",
725
+ {
726
+ id: "c",
727
+ x1: "22.25",
728
+ x2: "19.35",
729
+ y1: "15.06",
730
+ y2: "10.42",
731
+ gradientUnits: "userSpaceOnUse"
732
+ },
733
+ /* @__PURE__ */ h11("stop", { offset: "0", "stop-color": "#F59F00" }),
734
+ /* @__PURE__ */ h11("stop", { offset: ".19", "stop-color": "#F49B00" }),
735
+ /* @__PURE__ */ h11("stop", { offset: ".37", "stop-color": "#F29101" }),
736
+ /* @__PURE__ */ h11("stop", { offset: ".5", "stop-color": "#F08302" }),
737
+ /* @__PURE__ */ h11("stop", { offset: ".6", "stop-color": "#EE7905" }),
738
+ /* @__PURE__ */ h11("stop", { offset: ".76", "stop-color": "#EC7008" }),
739
+ /* @__PURE__ */ h11("stop", { offset: "1", "stop-color": "#EC6D09" })
740
+ ), /* @__PURE__ */ h11(
741
+ "linearGradient",
742
+ {
743
+ id: "d",
744
+ x1: "22.25",
745
+ x2: "19.35",
746
+ y1: "15.06",
747
+ y2: "10.42",
748
+ gradientUnits: "userSpaceOnUse"
749
+ },
750
+ /* @__PURE__ */ h11("stop", { offset: "0", "stop-color": "#F3941E", "stop-opacity": "0" }),
751
+ /* @__PURE__ */ h11("stop", { offset: ".04", "stop-color": "#F48C1C", "stop-opacity": ".08" }),
752
+ /* @__PURE__ */ h11("stop", { offset: ".2", "stop-color": "#F77314", "stop-opacity": ".32" }),
753
+ /* @__PURE__ */ h11("stop", { offset: ".35", "stop-color": "#F95D0E", "stop-opacity": ".53" }),
754
+ /* @__PURE__ */ h11("stop", { offset: ".5", "stop-color": "#FB4B09", "stop-opacity": ".7" }),
755
+ /* @__PURE__ */ h11("stop", { offset: ".64", "stop-color": "#FD3D05", "stop-opacity": ".83" }),
756
+ /* @__PURE__ */ h11("stop", { offset: ".77", "stop-color": "#FE3302", "stop-opacity": ".92" }),
757
+ /* @__PURE__ */ h11("stop", { offset: ".9", "stop-color": "#FF2D01", "stop-opacity": ".98" }),
758
+ /* @__PURE__ */ h11("stop", { offset: "1", "stop-color": "#FF2B00" })
759
+ ), /* @__PURE__ */ h11(
760
+ "radialGradient",
761
+ {
762
+ id: "f",
763
+ cx: "0",
764
+ cy: "0",
765
+ r: "1",
766
+ gradientTransform: "rotate(4.24 -167.26 291.02) scale(3.3208)",
767
+ gradientUnits: "userSpaceOnUse"
768
+ },
769
+ /* @__PURE__ */ h11("stop", { offset: "0", "stop-color": "#F3941E", "stop-opacity": "0" }),
770
+ /* @__PURE__ */ h11("stop", { offset: ".45", "stop-color": "#EA8D1D", "stop-opacity": ".05" }),
771
+ /* @__PURE__ */ h11("stop", { offset: ".66", "stop-color": "#CA7618", "stop-opacity": ".2" }),
772
+ /* @__PURE__ */ h11("stop", { offset: ".83", "stop-color": "#924D10", "stop-opacity": ".48" }),
773
+ /* @__PURE__ */ h11("stop", { offset: ".96", "stop-color": "#441304", "stop-opacity": ".87" }),
774
+ /* @__PURE__ */ h11("stop", { offset: ".99", "stop-color": "#2F0401", "stop-opacity": ".97" })
775
+ ), /* @__PURE__ */ h11(
776
+ "linearGradient",
777
+ {
778
+ id: "i",
779
+ x1: "22.25",
780
+ x2: "19.35",
781
+ y1: "15.06",
782
+ y2: "10.42",
783
+ gradientUnits: "userSpaceOnUse"
784
+ },
785
+ /* @__PURE__ */ h11("stop", { offset: "0", "stop-color": "#F59F00" }),
786
+ /* @__PURE__ */ h11("stop", { offset: ".19", "stop-color": "#F49B00" }),
787
+ /* @__PURE__ */ h11("stop", { offset: ".37", "stop-color": "#F29101" }),
788
+ /* @__PURE__ */ h11("stop", { offset: ".5", "stop-color": "#F08302" }),
789
+ /* @__PURE__ */ h11("stop", { offset: ".6", "stop-color": "#EE7905" }),
790
+ /* @__PURE__ */ h11("stop", { offset: ".76", "stop-color": "#EC7008" }),
791
+ /* @__PURE__ */ h11("stop", { offset: "1", "stop-color": "#EC6D09" })
792
+ ), /* @__PURE__ */ h11(
793
+ "linearGradient",
794
+ {
795
+ id: "j",
796
+ x1: "22.25",
797
+ x2: "19.35",
798
+ y1: "15.06",
799
+ y2: "10.42",
800
+ gradientUnits: "userSpaceOnUse"
801
+ },
802
+ /* @__PURE__ */ h11("stop", { offset: "0", "stop-color": "#F3941E", "stop-opacity": "0" }),
803
+ /* @__PURE__ */ h11("stop", { offset: ".04", "stop-color": "#F48C1C", "stop-opacity": ".08" }),
804
+ /* @__PURE__ */ h11("stop", { offset: ".2", "stop-color": "#F77314", "stop-opacity": ".32" }),
805
+ /* @__PURE__ */ h11("stop", { offset: ".35", "stop-color": "#F95D0E", "stop-opacity": ".53" }),
806
+ /* @__PURE__ */ h11("stop", { offset: ".5", "stop-color": "#FB4B09", "stop-opacity": ".7" }),
807
+ /* @__PURE__ */ h11("stop", { offset: ".64", "stop-color": "#FD3D05", "stop-opacity": ".83" }),
808
+ /* @__PURE__ */ h11("stop", { offset: ".77", "stop-color": "#FE3302", "stop-opacity": ".92" }),
809
+ /* @__PURE__ */ h11("stop", { offset: ".9", "stop-color": "#FF2D01", "stop-opacity": ".98" }),
810
+ /* @__PURE__ */ h11("stop", { offset: "1", "stop-color": "#FF2B00" })
811
+ ), /* @__PURE__ */ h11(
812
+ "radialGradient",
813
+ {
814
+ id: "l",
815
+ cx: "0",
816
+ cy: "0",
817
+ r: "1",
818
+ gradientTransform: "rotate(4.24 -167.26 291.02) scale(3.3208)",
819
+ gradientUnits: "userSpaceOnUse"
820
+ },
821
+ /* @__PURE__ */ h11("stop", { offset: "0", "stop-color": "#F3941E", "stop-opacity": "0" }),
822
+ /* @__PURE__ */ h11("stop", { offset: ".45", "stop-color": "#EA8D1D", "stop-opacity": ".05" }),
823
+ /* @__PURE__ */ h11("stop", { offset: ".66", "stop-color": "#CA7618", "stop-opacity": ".2" }),
824
+ /* @__PURE__ */ h11("stop", { offset: ".83", "stop-color": "#924D10", "stop-opacity": ".48" }),
825
+ /* @__PURE__ */ h11("stop", { offset: ".96", "stop-color": "#441304", "stop-opacity": ".87" }),
826
+ /* @__PURE__ */ h11("stop", { offset: ".99", "stop-color": "#2F0401", "stop-opacity": ".97" })
827
+ ), /* @__PURE__ */ h11("clipPath", { id: "a" }, /* @__PURE__ */ h11("path", { fill: "#fff", d: "M0 0h33v5.55H0z", transform: "translate(3.5 10)" })), /* @__PURE__ */ h11("clipPath", { id: "b" }, /* @__PURE__ */ h11("path", { fill: "#fff", d: "M0 0h33v5.86H0z", transform: "translate(3.5 10)" })), /* @__PURE__ */ h11("clipPath", { id: "g" }, /* @__PURE__ */ h11("path", { fill: "#fff", d: "M0 0h33v5.55H0z", transform: "translate(3.5 10)" })), /* @__PURE__ */ h11("clipPath", { id: "h" }, /* @__PURE__ */ h11("path", { fill: "#fff", d: "M0 0h33v5.86H0z", transform: "translate(3.5 10)" })))
828
+ );
829
+ var discover_default = DiscoverIcon;
830
+
831
+ // src/assets/icons/cup.tsx
832
+ import { h as h12 } from "preact";
833
+ var CupIcon = ({ opacity = 1 }) => /* @__PURE__ */ h12(
834
+ "svg",
835
+ {
836
+ xmlns: "http://www.w3.org/2000/svg",
837
+ viewBox: "0 0 40 26",
838
+ width: "40",
839
+ height: "26",
840
+ opacity
841
+ },
842
+ /* @__PURE__ */ h12("rect", { width: "45.3", height: "27", x: "-3.3", y: "-.79", fill: "#fff", rx: "2.82" }),
843
+ /* @__PURE__ */ h12(
844
+ "path",
845
+ {
846
+ fill: "#01798a",
847
+ d: "M27.27-.79a4.06 4.06 0 0 0-3.6 2.8l-4.96 23.42a2.14 2.14 0 0 0 2 2.8h18.35a2.81 2.81 0 0 0 2.8-2.82V1.15A2.25 2.25 0 0 0 40-.8"
848
+ }
849
+ ),
850
+ /* @__PURE__ */ h12(
851
+ "rect",
852
+ {
853
+ width: "20.38",
854
+ height: "29.02",
855
+ x: "-4",
856
+ y: "-.79",
857
+ fill: "#dc1f2b",
858
+ rx: "2.82"
859
+ }
860
+ ),
861
+ /* @__PURE__ */ h12(
862
+ "path",
863
+ {
864
+ fill: "#1a4580",
865
+ d: "M24.37 2.02a3.98 3.98 0 0 1 3.48-2.8H14.18a3.97 3.97 0 0 0-3.5 2.8l-4.85 23.4a2.13 2.13 0 0 0 1.94 2.81h13.7a2.13 2.13 0 0 1-1.94-2.8z"
866
+ }
867
+ ),
868
+ /* @__PURE__ */ h12(
869
+ "path",
870
+ {
871
+ fill: "#fff",
872
+ d: "M16.63 15.04h.18a.32.32 0 0 0 .32-.17l.46-.7h1.24l-.26.47h1.49l-.2.7H18.1a.82.82 0 0 1-.75.44h-.92zm-.2 1h3.25l-.21.77h-1.3l-.2.74h1.27l-.21.77h-1.27l-.3 1.09c-.07.18.02.26.29.24h1.03l-.19.71H16.6q-.57 0-.39-.65l.38-1.4h-.81l.2-.76h.82l.2-.74h-.78l.2-.76zm5.19-1.87-.06.45a2.37 2.37 0 0 1 1.18-.47h2.05l-.78 2.88q-.1.5-.84.5h-2.34l-.54 2.01c-.03.11.01.17.13.17h.46l-.17.62h-1.17q-.67 0-.56-.4l1.54-5.76zm1.74.81h-1.84l-.22.78a1.52 1.52 0 0 1 .82-.23h1.1zm-.67 1.8c.14.02.22-.03.22-.16l.12-.4h-1.84l-.16.57zm-1.24.93h1.06l-.02.47h.29c.14 0 .2-.05.2-.14l.1-.3h.87l-.11.44a.76.76 0 0 1-.8.57h-.56v.8c-.01.12.1.18.33.18h.53l-.17.63H21.9c-.36.02-.53-.15-.53-.52zM8.6 10.34a2.62 2.62 0 0 1-1 1.64 3.24 3.24 0 0 1-1.98.58 2.16 2.16 0 0 1-1.68-.59 1.54 1.54 0 0 1-.37-1.06 2.86 2.86 0 0 1 .06-.57l.87-4.2h1.3l-.85 4.15a1.35 1.35 0 0 0-.04.32.82.82 0 0 0 .16.52.89.89 0 0 0 .75.3 1.56 1.56 0 0 0 1-.3 1.37 1.37 0 0 0 .5-.84l.84-4.15h1.3zm5.47-1.65h1.02l-.8 3.74h-1.02zm.32-1.37h1.03l-.2.91H14.2l.19-.9M16 12.15a1.39 1.39 0 0 1-.41-1.05 2.45 2.45 0 0 1 .01-.25l.04-.27a2.55 2.55 0 0 1 .78-1.45 2.07 2.07 0 0 1 1.43-.54 1.5 1.5 0 0 1 1.1.39 1.4 1.4 0 0 1 .4 1.06 2.59 2.59 0 0 1-.02.26l-.05.28a2.48 2.48 0 0 1-.77 1.42 2.08 2.08 0 0 1-1.43.53 1.5 1.5 0 0 1-1.09-.38m1.95-.74a1.84 1.84 0 0 0 .38-.9.58.58 0 0 0 .03-.19 1.74 1.74 0 0 0 .01-.17.76.76 0 0 0-.17-.54.64.64 0 0 0-.5-.2.89.89 0 0 0-.7.3 1.9 1.9 0 0 0-.38.92l-.03.18a1.36 1.36 0 0 0-.01.17.75.75 0 0 0 .17.54.64.64 0 0 0 .5.18.9.9 0 0 0 .7-.3m8.02 3.67.25-.87h1.24l-.05.32a3.1 3.1 0 0 1 1.09-.32h1.54l-.25.87h-.24l-1.16 4.12h.24l-.23.82h-.24l-.1.36h-1.2l.1-.36h-2.38l.23-.82h.24l1.16-4.12zm1.34 0L27 16.2a5.13 5.13 0 0 1 1-.27c.1-.4.24-.85.24-.85zm-.46 1.64-.32 1.17a3.44 3.44 0 0 1 1.01-.33l.24-.84zm.23 2.48.24-.84h-.93l-.24.84zm3.01-5.05h1.17l.05.44c0 .11.06.16.2.16h.2l-.2.74h-.87c-.32.02-.5-.1-.5-.38zm-.34 1.59h3.79l-.23.79h-1.2l-.2.74h1.2l-.23.79h-1.34l-.3.46h.65l.16.93c.01.09.1.13.23.13h.2l-.2.77h-.73c-.37.02-.57-.1-.58-.38l-.18-.85-.6.9a.65.65 0 0 1-.65.36h-1.1l.22-.77h.34a.46.46 0 0 0 .36-.19l.94-1.36h-1.2l.22-.8h1.3l.21-.73h-1.3l.22-.8zM9.8 8.69h.92l-.1.54.12-.16a1.43 1.43 0 0 1 1.1-.48 1 1 0 0 1 .83.34 1.15 1.15 0 0 1 .14.95l-.5 2.56h-.95l.46-2.32a.74.74 0 0 0-.04-.53.44.44 0 0 0-.4-.17.88.88 0 0 0-.62.23 1.14 1.14 0 0 0-.34.63L10 12.44h-.94zm10.55 0h.92l-.1.54.13-.16a1.43 1.43 0 0 1 1.08-.48.99.99 0 0 1 .85.34 1.14 1.14 0 0 1 .13.95l-.5 2.56h-.95l.46-2.32a.75.75 0 0 0-.04-.53.45.45 0 0 0-.4-.17.89.89 0 0 0-.62.23 1.12 1.12 0 0 0-.33.63l-.43 2.16h-.94zm4.55-2.33h2.67a1.8 1.8 0 0 1 1.19.35 1.25 1.25 0 0 1 .4 1v.02a3.77 3.77 0 0 1-.06.59 2.38 2.38 0 0 1-.81 1.4 2.29 2.29 0 0 1-1.5.52h-1.44l-.44 2.2h-1.24zm.67 2.82h1.19a1.14 1.14 0 0 0 .73-.21 1.14 1.14 0 0 0 .36-.67l.03-.15v-.13a.52.52 0 0 0-.22-.47 1.35 1.35 0 0 0-.72-.15h-1zm9.15 3.98a5.91 5.91 0 0 1-.98 1.56 1.99 1.99 0 0 1-1.7.71l.08-.64c.89-.27 1.36-1.51 1.64-2.06l-.33-4.03.68-.01h.58l.06 2.53 1.07-2.53h1.09zM31.68 9l-.43.3a1.35 1.35 0 0 0-1.66-.21c-1.08.5-1.98 4.4 1 3.11l.17.2 1.17.04.77-3.54zm-.66 1.92c-.2.56-.61.94-.94.83-.33-.1-.45-.64-.26-1.2.19-.57.61-.94.94-.83.33.1.45.64.26 1.2"
873
+ }
874
+ )
875
+ );
876
+ var cup_default = CupIcon;
877
+
878
+ // src/utils/custom-hooks/use-media-query.ts
879
+ import { useEffect, useState as useState3 } from "preact/hooks";
880
+ function useMediaQuery(query) {
881
+ const getMatch = () => window.matchMedia(query).matches;
882
+ const [matches, setMatches] = useState3(getMatch);
883
+ useEffect(() => {
884
+ const mediaQueryList = window.matchMedia(query);
885
+ const listener = (event) => setMatches(event.matches);
886
+ setMatches(mediaQueryList.matches);
887
+ mediaQueryList.addEventListener("change", listener);
888
+ return () => {
889
+ mediaQueryList.removeEventListener("change", listener);
890
+ };
891
+ }, [query]);
892
+ return matches;
893
+ }
894
+
895
+ // src/utils/renderBrandIcons.tsx
896
+ function RenderBrandIcons({ brands, brandHidden = [], limit = 3 }) {
897
+ const isWidth380 = useMediaQuery("(max-width: 380px)");
898
+ const isWidth335 = useMediaQuery("(max-width: 335px)");
899
+ const widthLimit = isWidth335 ? 1 : isWidth380 ? 2 : limit;
900
+ const brandToShow = brands.filter((brand) => {
901
+ const { brand: brandName } = brand;
902
+ const hidden = brandHidden.some((x) => x.brand === brandName);
903
+ return !hidden;
904
+ });
905
+ return /* @__PURE__ */ h13(Fragment2, null, brandToShow.map(({ brand }, index) => {
906
+ if (index >= Math.min(limit, widthLimit)) {
907
+ if (index === Math.min(limit, widthLimit)) {
908
+ return /* @__PURE__ */ h13(
909
+ Tooltip,
910
+ {
911
+ content: /* @__PURE__ */ h13("span", { style: { display: "flex", gap: "4px", overflow: "visible" } }, brandToShow.slice(Math.min(limit, widthLimit)).map(({ brand: brand2 }) => /* @__PURE__ */ h13(RenderBrandIcon, { key: brand2, brand: brand2 })))
912
+ },
913
+ /* @__PURE__ */ h13("span", { key: brand, className: "render-brand-icons__overflow" }, "+", brandToShow.length - Math.min(limit, widthLimit))
914
+ );
915
+ }
916
+ return null;
917
+ }
918
+ return /* @__PURE__ */ h13(RenderBrandIcon, { key: brand, brand });
919
+ }));
920
+ }
921
+ var RenderBrandIcon = ({ brand }) => {
922
+ switch (brand) {
923
+ case "visa":
924
+ return /* @__PURE__ */ h13(visa_default, null);
925
+ case "mc":
926
+ return /* @__PURE__ */ h13(mastercard_default, null);
927
+ case "maestro":
928
+ return /* @__PURE__ */ h13(maestro_default, null);
929
+ case "amex":
930
+ return /* @__PURE__ */ h13(amex_default, null);
931
+ case "jcb":
932
+ return /* @__PURE__ */ h13(jcb_default, null);
933
+ case "diners":
934
+ return /* @__PURE__ */ h13(diners_default, null);
935
+ case "discover":
936
+ return /* @__PURE__ */ h13(discover_default, null);
937
+ case "cup":
938
+ return /* @__PURE__ */ h13(cup_default, null);
939
+ default:
940
+ return /* @__PURE__ */ h13("span", null, brand);
941
+ }
942
+ };
943
+
944
+ // src/assets/icons/loader.tsx
945
+ import { h as h14 } from "preact";
946
+ var LoaderIcon = () => /* @__PURE__ */ h14("svg", { width: "40", height: "40", viewBox: "0 0 40 40", xmlns: "http://www.w3.org/2000/svg", stroke: "#002649" }, /* @__PURE__ */ h14("g", { fill: "none", "fill-rule": "evenodd" }, /* @__PURE__ */ h14("g", { transform: "translate(2 2)", "stroke-width": "4" }, /* @__PURE__ */ h14("circle", { "stroke-opacity": ".3", cx: "18", cy: "18", r: "18" }), /* @__PURE__ */ h14("path", { d: "M36 18c0-9.94-8.06-18-18-18" }, /* @__PURE__ */ h14(
947
+ "animateTransform",
948
+ {
949
+ attributeName: "transform",
950
+ type: "rotate",
951
+ from: "0 18 18",
952
+ to: "360 18 18",
953
+ dur: "1s",
954
+ repeatCount: "indefinite"
955
+ }
956
+ )))));
957
+ var loader_default = LoaderIcon;
958
+
959
+ // src/assets/icons/checkmark.tsx
960
+ import { h as h15 } from "preact";
961
+ var CheckmarkIcon = () => /* @__PURE__ */ h15("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "13", viewBox: "0 0 16 13", fill: "none" }, /* @__PURE__ */ h15("path", { d: "M2 7L6 11L14 2", stroke: "#002649", "stroke-width": "3", "stroke-linecap": "round", "stroke-linejoin": "round" }));
962
+ var checkmark_default = CheckmarkIcon;
963
+
964
+ // src/features/card/card-component.tsx
965
+ function CardComponent({ configuration, paymentMethods }) {
966
+ var _a, _b, _c;
967
+ const cardElementRef = useRef3(null);
968
+ const adyenCardRef = useRef3();
969
+ const customCardRef = useRef3();
970
+ const [payButtonDisabled, setPayButtonDisabled] = useState4(true);
971
+ const [securityCodePolicy, setSecurityCodePolicy] = useState4("required");
972
+ const [storePaymentMethod, setStorePaymentMethod] = useState4(false);
973
+ const storePaymentMethodRef = useRef3(false);
974
+ const [brandHidden, setBrandHidden] = useState4([]);
975
+ const [formErrors, setFormErrors] = useState4({
976
+ encryptedCardNumber: { visible: false },
977
+ encryptedExpiryDate: { visible: false },
978
+ encryptedSecurityCode: { visible: false }
979
+ });
980
+ if (!((_a = paymentMethods.paymentMethods.paymentMethods) == null ? void 0 : _a.some((x) => x.type === "scheme"))) {
981
+ return null;
982
+ }
983
+ const {
984
+ activePaymentMethod,
985
+ setActivePaymentMethod,
986
+ isPaymentMethodInitialized,
987
+ updatePaymentMethodInitialization,
988
+ threeDSecureRef,
989
+ handleSuccess,
990
+ handleError,
991
+ setThreeDSecureActive
992
+ } = usePaymentMethodGroup();
993
+ const schemeBrands = paymentMethods.paymentMethods.paymentMethods.find((x) => x.type === "scheme").brands;
994
+ const initializeAdyenComponent = async () => {
995
+ adyenCardRef.current = await AdyenCheckout({
996
+ clientKey: paymentMethods.clientKey,
997
+ locale: configuration.locale,
998
+ environment: configuration.environment,
999
+ countryCode: "IS",
1000
+ paymentMethodsResponse: paymentMethods.paymentMethods,
1001
+ onError: handleOnError,
1002
+ onSubmit: handleOnSubmit,
1003
+ onAdditionalDetails: handleOnSubmitAdditionalData,
1004
+ onPaymentCompleted: configuration.onPaymentCompleted,
1005
+ onPaymentFailed: configuration.onPaymentFailed
1006
+ });
1007
+ customCardRef.current = new CustomCard(adyenCardRef.current, {
1008
+ placeholders: configuration.placeholders,
1009
+ challengeWindowSize: "05",
1010
+ // looks like not working
1011
+ brands: schemeBrands,
1012
+ onBrand: (event) => {
1013
+ setSecurityCodePolicy(event.cvcPolicy);
1014
+ if (event.brand === "card") {
1015
+ setBrandHidden([]);
1016
+ return;
1017
+ }
1018
+ setBrandHidden(
1019
+ schemeBrands.filter((x) => x !== event.brand).map((x) => {
1020
+ return {
1021
+ brand: x
1022
+ };
1023
+ })
1024
+ );
1025
+ },
1026
+ onConfigSuccess() {
1027
+ updatePaymentMethodInitialization("card", true);
1028
+ },
1029
+ onValidationError: (event) => {
1030
+ const defaultErrors = {
1031
+ encryptedCardNumber: { visible: false, message: void 0 },
1032
+ encryptedExpiryDate: { visible: false, message: void 0 },
1033
+ encryptedSecurityCode: { visible: false, message: void 0 }
1034
+ };
1035
+ event.filter((x) => x.error).forEach((x) => {
1036
+ defaultErrors[x.fieldType].visible = true;
1037
+ defaultErrors[x.fieldType].message = x.errorI18n;
1038
+ });
1039
+ setFormErrors(defaultErrors);
1040
+ },
1041
+ onAllValid: (event) => {
1042
+ setPayButtonDisabled(!event.allValid);
1043
+ }
1044
+ });
1045
+ if (cardElementRef.current) {
1046
+ customCardRef.current.mount(cardElementRef.current);
1047
+ }
1048
+ };
1049
+ useEffect2(() => {
1050
+ if (activePaymentMethod === "card" && !isPaymentMethodInitialized.card) {
1051
+ initializeAdyenComponent();
1052
+ }
1053
+ }, [configuration, activePaymentMethod]);
1054
+ useEffect2(() => {
1055
+ if (customCardRef.current && isPaymentMethodInitialized.card) {
1056
+ initializeAdyenComponent();
1057
+ setFormErrors({
1058
+ encryptedCardNumber: { visible: false, message: void 0 },
1059
+ encryptedExpiryDate: { visible: false, message: void 0 },
1060
+ encryptedSecurityCode: { visible: false, message: void 0 }
1061
+ });
1062
+ }
1063
+ }, [configuration]);
1064
+ const handleBoxChange = () => {
1065
+ setActivePaymentMethod("card");
1066
+ };
1067
+ if (((_c = (_b = paymentMethods.paymentMethods) == null ? void 0 : _b.paymentMethods) == null ? void 0 : _c.length) === 0) {
1068
+ return null;
1069
+ }
1070
+ const brands = schemeBrands.map((x) => {
1071
+ return { brand: x, brandFullName: x };
1072
+ });
1073
+ function handleStorePaymentMethodChange(event) {
1074
+ setStorePaymentMethod(event.currentTarget.checked);
1075
+ }
1076
+ function handleOnError(_, __) {
1077
+ handleError("error.unknownError");
1078
+ }
1079
+ useEffect2(() => {
1080
+ storePaymentMethodRef.current = storePaymentMethod;
1081
+ }, [storePaymentMethod]);
1082
+ async function handleOnSubmit(state, _, actions) {
1083
+ const data = {
1084
+ ...state.data,
1085
+ origin: window.location.origin,
1086
+ storePaymentMethod: storePaymentMethodRef.current,
1087
+ sessionId: configuration.sessionId
1088
+ };
1089
+ const fetchResponse = await createPaymentRequest(configuration.environment, data);
1090
+ if (!fetchResponse.ok) {
1091
+ actions.reject();
1092
+ handleError("error.failedToSubmitPayment");
1093
+ return;
1094
+ }
1095
+ const response = await fetchResponse.json();
1096
+ if (!response.resultCode) {
1097
+ actions.reject();
1098
+ handleError("error.paymentFailed");
1099
+ return;
1100
+ }
1101
+ const { resultCode, action } = response;
1102
+ if (resultCode === "RedirectShopper" || resultCode === "IdentifyShopper") {
1103
+ setThreeDSecureActive(true);
1104
+ adyenCardRef.current.createFromAction(action).mount(threeDSecureRef == null ? void 0 : threeDSecureRef.current);
1105
+ return;
1106
+ }
1107
+ actions.resolve({ resultCode, action });
1108
+ if (resultCode === "Authorised") {
1109
+ handleSuccess("success.paymentAuthorized");
1110
+ } else {
1111
+ handleError("error.paymentUnsuccessful");
1112
+ }
1113
+ }
1114
+ async function handleOnSubmitAdditionalData(state, _, actions) {
1115
+ const data = {
1116
+ ...state.data,
1117
+ sessionId: configuration.sessionId
1118
+ };
1119
+ const fetchResponse = await createDetailsRequest(configuration.environment, data);
1120
+ if (!fetchResponse.ok) {
1121
+ actions.reject();
1122
+ handleError("error.failedToSubmitPaymentDetails");
1123
+ return;
1124
+ }
1125
+ const response = await fetchResponse.json();
1126
+ if (!response.resultCode) {
1127
+ actions.reject();
1128
+ handleError("error.paymentDetailsFailed");
1129
+ return;
1130
+ }
1131
+ const { resultCode, action } = response;
1132
+ actions.resolve({ resultCode, action });
1133
+ if (resultCode === "Authorised") {
1134
+ handleSuccess("success.paymentAuthorized");
1135
+ } else {
1136
+ handleError("error.paymentUnsuccessful");
1137
+ }
1138
+ }
1139
+ function handleSubmitClick() {
1140
+ if (!customCardRef.current) return;
1141
+ customCardRef.current.submit();
1142
+ }
1143
+ return /* @__PURE__ */ h16("label", { className: "card-component" }, /* @__PURE__ */ h16(
1144
+ "input",
1145
+ {
1146
+ type: "radio",
1147
+ className: "card-component__radio-selector",
1148
+ checked: activePaymentMethod === "card",
1149
+ onChange: handleBoxChange
1150
+ }
1151
+ ), /* @__PURE__ */ h16("span", { className: "card-component__content" }, /* @__PURE__ */ h16("span", { className: "card-component--circle" }), /* @__PURE__ */ h16(card_default, null), /* @__PURE__ */ h16("span", { className: "card-component--text" }, i18n(configuration.locale, "cards.title")), /* @__PURE__ */ h16("span", { className: "card-component--brands" }, /* @__PURE__ */ h16(RenderBrandIcons, { brands, brandHidden }))), /* @__PURE__ */ h16("div", { className: "card-component__expandable", ref: cardElementRef }, !isPaymentMethodInitialized.card && /* @__PURE__ */ h16("div", { className: "card-component__loading-text" }, /* @__PURE__ */ h16(loader_default, null)), /* @__PURE__ */ h16(
1152
+ "div",
1153
+ {
1154
+ className: "card-component__form",
1155
+ style: {
1156
+ opacity: isPaymentMethodInitialized.card ? 1 : 0,
1157
+ position: isPaymentMethodInitialized.card ? "relative" : "absolute",
1158
+ transition: "opacity 0.3s ease-in-out"
1159
+ }
1160
+ },
1161
+ /* @__PURE__ */ h16("div", { className: "card-component__form--wrapper" }, /* @__PURE__ */ h16(
1162
+ "label",
1163
+ {
1164
+ className: `${"card-component__form--wrapper--label"} ${formErrors.encryptedCardNumber.visible ? "card-component__form--wrapper--label--error" : ""}`
1165
+ },
1166
+ i18n(configuration.locale, "cards.cardNumber")
1167
+ ), /* @__PURE__ */ h16(
1168
+ "span",
1169
+ {
1170
+ className: `${"card-component__form--wrapper--input"} ${formErrors.encryptedCardNumber.visible ? "card-component__form--wrapper--input--error" : ""}`,
1171
+ "data-cse": "encryptedCardNumber"
1172
+ }
1173
+ ), formErrors.encryptedCardNumber.visible && /* @__PURE__ */ h16("span", { className: "card-component__form--wrapper--error" }, formErrors.encryptedCardNumber.message)),
1174
+ /* @__PURE__ */ h16("div", { className: "card-component__form--field-wrapper" }, /* @__PURE__ */ h16("div", { className: "card-component__form--wrapper" }, /* @__PURE__ */ h16(
1175
+ "label",
1176
+ {
1177
+ className: `${"card-component__form--wrapper--label"} ${formErrors.encryptedExpiryDate.visible ? "card-component__form--wrapper--label--error" : ""}`
1178
+ },
1179
+ i18n(configuration.locale, "cards.expiryDate")
1180
+ ), /* @__PURE__ */ h16(
1181
+ "span",
1182
+ {
1183
+ className: `${"card-component__form--wrapper--input"} ${formErrors.encryptedExpiryDate.visible ? "card-component__form--wrapper--input--error" : ""}`,
1184
+ "data-cse": "encryptedExpiryDate"
1185
+ }
1186
+ ), formErrors.encryptedExpiryDate.visible && /* @__PURE__ */ h16("span", { className: "card-component__form--wrapper--error" }, formErrors.encryptedExpiryDate.message)), /* @__PURE__ */ h16("div", { className: "card-component__form--wrapper" }, (securityCodePolicy === "optional" || securityCodePolicy === "required") && /* @__PURE__ */ h16(Fragment3, null, /* @__PURE__ */ h16(
1187
+ "label",
1188
+ {
1189
+ className: `${"card-component__form--wrapper--label"} ${formErrors.encryptedSecurityCode.visible ? "card-component__form--wrapper--label--error" : ""}`
1190
+ },
1191
+ securityCodePolicy === "optional" ? i18n(configuration.locale, "cards.securityCode3DigitsOptional") : i18n(configuration.locale, "cards.securityCode3Digits")
1192
+ ), /* @__PURE__ */ h16(
1193
+ "span",
1194
+ {
1195
+ className: `${"card-component__form--wrapper--input"} ${formErrors.encryptedSecurityCode.visible ? "card-component__form--wrapper--input--error" : ""}`,
1196
+ "data-cse": "encryptedSecurityCode"
1197
+ }
1198
+ ), formErrors.encryptedSecurityCode.visible && /* @__PURE__ */ h16("span", { className: "card-component__form--wrapper--error" }, formErrors.encryptedSecurityCode.message), /* @__PURE__ */ h16("div", { className: "card-component__form--wrapper--label--info" }, /* @__PURE__ */ h16(Tooltip, { content: /* @__PURE__ */ h16("span", null, i18n(configuration.locale, "cards.securityCode3DigitsInfo")) }, /* @__PURE__ */ h16(info_default, null)))))),
1199
+ paymentMethods.enableStoreDetails === "AskForConsent" && /* @__PURE__ */ h16("label", { className: "card-component__form--wrapper--label-checkbox" }, /* @__PURE__ */ h16(
1200
+ "div",
1201
+ {
1202
+ className: `${"card-component__form--wrapper--label-checkbox--checkmark"} ${storePaymentMethod ? "card-component__form--wrapper--label-checkbox--checkmark--checked" : ""}`
1203
+ },
1204
+ /* @__PURE__ */ h16(
1205
+ "div",
1206
+ {
1207
+ className: `${"card-component__form--wrapper--label-checkbox--checkmark--icon"} ${storePaymentMethod ? "card-component__form--wrapper--label-checkbox--checkmark--icon--checked" : ""}`
1208
+ },
1209
+ /* @__PURE__ */ h16(checkmark_default, null)
1210
+ )
1211
+ ), /* @__PURE__ */ h16(
1212
+ "input",
1213
+ {
1214
+ type: "checkbox",
1215
+ className: "card-component__form--wrapper--label-checkbox--checkbox",
1216
+ checked: storePaymentMethod,
1217
+ onChange: handleStorePaymentMethodChange
1218
+ }
1219
+ ), i18n(configuration.locale, "cards.storePaymentMethod")),
1220
+ /* @__PURE__ */ h16("button", { className: "card-component__submit-button", disabled: payButtonDisabled, onClick: handleSubmitClick }, paymentMethods.formattedAmount)
1221
+ )));
1222
+ }
1223
+ var card_component_default = CardComponent;
1224
+
1225
+ // src/features/google-pay/google-pay-component.tsx
1226
+ import { h as h18 } from "preact";
1227
+ import { useEffect as useEffect3, useRef as useRef4 } from "preact/hooks";
1228
+
1229
+ // src/features/google-pay/google-pay-component.css
1230
+ styleInject('.google-pay-component {\n position: relative;\n cursor: pointer;\n background: white;\n border-radius: 12px;\n transition: all 0.3s ease;\n padding: 16px 24px;\n}\n.google-pay-component__radio-selector {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n}\n.google-pay-component__content {\n display: flex;\n align-items: center;\n gap: 12px;\n transition: background-color 0.3s ease;\n}\n.google-pay-component__radio-selector:checked + .google-pay-component__content {\n padding-bottom: 16px;\n}\n.google-pay-component--circle {\n width: 24px;\n height: 24px;\n border: 1px solid #e6ebef;\n background: #eef0f2;\n border-radius: 50%;\n position: relative;\n transition: all 0.3s ease;\n}\n.google-pay-component__content:hover .google-pay-component--circle {\n border: 1px solid #cdd8e2;\n}\n.google-pay-component--circle::after {\n content: "";\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0);\n transition: transform 0.2s ease;\n}\n.google-pay-component__radio-selector:checked + .google-pay-component__content .google-pay-component--circle {\n background: #bce6f3;\n border-color: transparent;\n}\n.google-pay-component__radio-selector:checked + .google-pay-component__content .google-pay-component--circle::after {\n transform: translate(-50%, -50%) scale(1);\n background: #002649;\n height: 10px;\n width: 10px;\n}\n.google-pay-component--text {\n color: #213547;\n font-size: 1rem;\n user-select: none;\n}\n.google-pay-component__expandable {\n background: white;\n max-height: 0;\n overflow: hidden;\n transition: all 0.3s ease;\n opacity: 0;\n}\n.google-pay-component__radio-selector:checked ~ .google-pay-component__expandable {\n max-height: 400px;\n opacity: 1;\n}\n.google-pay-component__expandable p {\n margin: 0;\n color: #213547;\n font-size: 0.9rem;\n}\n');
1231
+
1232
+ // src/features/google-pay/google-pay-component.tsx
1233
+ import {
1234
+ AdyenCheckout as AdyenCheckout2,
1235
+ GooglePay
1236
+ } from "@adyen/adyen-web";
1237
+
1238
+ // src/assets/icons/googlepay.tsx
1239
+ import { h as h17 } from "preact";
1240
+ var GooglePayIcon = () => /* @__PURE__ */ h17(
1241
+ "svg",
1242
+ {
1243
+ xmlns: "http://www.w3.org/2000/svg",
1244
+ width: "40",
1245
+ height: "26",
1246
+ fill: "none",
1247
+ viewBox: "0 0 40 26"
1248
+ },
1249
+ /* @__PURE__ */ h17(
1250
+ "path",
1251
+ {
1252
+ fill: "#fff",
1253
+ d: "M29.13 2.41H10.87C5.17 2.41.5 7.18.5 13.01a10.5 10.5 0 0 0 10.37 10.58h18.26c5.7 0 10.37-4.76 10.37-10.59 0-5.82-4.67-10.59-10.37-10.59Z"
1254
+ }
1255
+ ),
1256
+ /* @__PURE__ */ h17(
1257
+ "path",
1258
+ {
1259
+ fill: "#3C4043",
1260
+ d: "M29.13 3.27c1.28 0 2.52.26 3.7.77a9.6 9.6 0 0 1 5.08 5.19 9.78 9.78 0 0 1 0 7.55 9.83 9.83 0 0 1-5.08 5.18 9.26 9.26 0 0 1-3.7.77H10.87a9.24 9.24 0 0 1-3.7-.77 9.6 9.6 0 0 1-5.08-5.18 9.78 9.78 0 0 1 0-7.55 9.83 9.83 0 0 1 5.08-5.19 9.24 9.24 0 0 1 3.7-.77h18.26Zm0-.86H10.87C5.17 2.41.5 7.18.5 13.01a10.5 10.5 0 0 0 10.37 10.58h18.26c5.7 0 10.37-4.76 10.37-10.59 0-5.82-4.67-10.59-10.37-10.59Z"
1261
+ }
1262
+ ),
1263
+ /* @__PURE__ */ h17(
1264
+ "path",
1265
+ {
1266
+ fill: "#3C4043",
1267
+ d: "M19.1 13.75v3.2h-1v-7.9h2.64c.67 0 1.24.23 1.7.68.49.46.72 1.01.72 1.67a2.2 2.2 0 0 1-.71 1.68c-.46.45-1.03.67-1.7.67H19.1Zm0-3.73v2.76h1.66c.4 0 .73-.14.99-.4.26-.28.4-.6.4-.98 0-.36-.14-.68-.4-.95a1.28 1.28 0 0 0-.99-.42H19.1Zm6.67 1.35c.73 0 1.31.2 1.74.6.42.4.64.95.64 1.65v3.34h-.95v-.76h-.04a1.9 1.9 0 0 1-1.65.93 2.1 2.1 0 0 1-1.46-.53c-.4-.35-.6-.8-.6-1.32 0-.56.21-1 .63-1.34.41-.33.97-.5 1.66-.5.59 0 1.07.12 1.45.34v-.23c0-.36-.13-.65-.4-.9a1.4 1.4 0 0 0-.97-.37c-.56 0-1 .24-1.32.72l-.88-.56a2.42 2.42 0 0 1 2.15-1.07Zm-1.29 3.92c0 .27.11.5.33.67.22.17.48.26.78.26.42 0 .79-.16 1.12-.48.32-.31.49-.68.49-1.11a2.02 2.02 0 0 0-1.3-.38c-.4 0-.74.1-1.01.3a.9.9 0 0 0-.4.74Zm9.08-3.75-3.32 7.8h-1.02l1.23-2.73-2.19-5.07h1.09l1.57 3.89h.02l1.54-3.89h1.08Z"
1268
+ }
1269
+ ),
1270
+ /* @__PURE__ */ h17(
1271
+ "path",
1272
+ {
1273
+ fill: "#4285F4",
1274
+ d: "M15.14 13.1c0-.32-.03-.64-.09-.95h-4.17v1.75h2.4a2.1 2.1 0 0 1-.89 1.4v1.14h1.43a4.49 4.49 0 0 0 1.32-3.33Z"
1275
+ }
1276
+ ),
1277
+ /* @__PURE__ */ h17(
1278
+ "path",
1279
+ {
1280
+ fill: "#34A853",
1281
+ d: "M12.4 15.3a2.66 2.66 0 0 1-4-1.44H6.9v1.18a4.43 4.43 0 0 0 6.91 1.4l-1.43-1.13Z"
1282
+ }
1283
+ ),
1284
+ /* @__PURE__ */ h17(
1285
+ "path",
1286
+ {
1287
+ fill: "#FABB05",
1288
+ d: "M8.25 13c0-.3.05-.59.14-.86v-1.17H6.9a4.59 4.59 0 0 0 0 4.07l1.48-1.17a2.79 2.79 0 0 1-.14-.86Z"
1289
+ }
1290
+ ),
1291
+ /* @__PURE__ */ h17(
1292
+ "path",
1293
+ {
1294
+ fill: "#E94235",
1295
+ d: "M10.88 10.27c.66 0 1.24.23 1.7.68l1.27-1.3a4.22 4.22 0 0 0-2.97-1.18 4.44 4.44 0 0 0-3.97 2.5l1.48 1.17a2.66 2.66 0 0 1 2.5-1.87Z"
1296
+ }
1297
+ )
1298
+ );
1299
+ var googlepay_default = GooglePayIcon;
1300
+
1301
+ // src/features/google-pay/google-pay-component.tsx
1302
+ function GooglePayComponent({ configuration, paymentMethods }) {
1303
+ var _a;
1304
+ const googlePayElementRef = useRef4(null);
1305
+ const adyenCardRef = useRef4();
1306
+ const googlePayRef = useRef4();
1307
+ const {
1308
+ activePaymentMethod,
1309
+ setActivePaymentMethod,
1310
+ isPaymentMethodInitialized,
1311
+ updatePaymentMethodInitialization,
1312
+ threeDSecureRef,
1313
+ handleSuccess,
1314
+ handleError,
1315
+ setThreeDSecureActive
1316
+ } = usePaymentMethodGroup();
1317
+ const initializeAdyenComponent = async () => {
1318
+ adyenCardRef.current = await AdyenCheckout2({
1319
+ clientKey: paymentMethods.clientKey,
1320
+ locale: paymentMethods.locale,
1321
+ environment: configuration.environment,
1322
+ countryCode: "IS",
1323
+ onError: handleOnError,
1324
+ onSubmit: handleOnSubmit,
1325
+ onAdditionalDetails: handleOnSubmitAdditionalData,
1326
+ onPaymentCompleted: configuration.onPaymentCompleted,
1327
+ onPaymentFailed: configuration.onPaymentFailed
1328
+ });
1329
+ const gpayConfig = paymentMethods.paymentMethods.paymentMethods.find((x) => x.type === "googlepay").configuration;
1330
+ const googlePayConfiguration = {
1331
+ amount: {
1332
+ value: paymentMethods.minorUnitsAmount,
1333
+ currency: paymentMethods.currency
1334
+ },
1335
+ countryCode: "IS",
1336
+ environment: configuration.environment,
1337
+ configuration: {
1338
+ ...gpayConfig,
1339
+ merchantName: paymentMethods.merchantName
1340
+ }
1341
+ };
1342
+ googlePayRef.current = new GooglePay(adyenCardRef.current, googlePayConfiguration);
1343
+ googlePayRef.current.isAvailable().then(() => {
1344
+ googlePayRef.current.mount(googlePayElementRef.current);
1345
+ updatePaymentMethodInitialization("googlepay", true);
1346
+ }).catch((e) => {
1347
+ handleError("error.googlePayNotAvailable");
1348
+ });
1349
+ };
1350
+ useEffect3(() => {
1351
+ if (activePaymentMethod === "googlepay" && !isPaymentMethodInitialized.googlepay) {
1352
+ initializeAdyenComponent();
1353
+ }
1354
+ }, [configuration, activePaymentMethod]);
1355
+ useEffect3(() => {
1356
+ if (googlePayRef.current && isPaymentMethodInitialized.googlepay) {
1357
+ initializeAdyenComponent();
1358
+ }
1359
+ }, [configuration]);
1360
+ const handleBoxChange = () => {
1361
+ setActivePaymentMethod("googlepay");
1362
+ };
1363
+ function handleOnError(error, _) {
1364
+ handleError("error.unknownError");
1365
+ }
1366
+ async function handleOnSubmit(state, _, actions) {
1367
+ const data = {
1368
+ ...state.data,
1369
+ origin: window.location.origin,
1370
+ sessionId: configuration.sessionId
1371
+ };
1372
+ const fetchResponse = await createPaymentRequest(configuration.environment, data);
1373
+ if (!fetchResponse.ok) {
1374
+ actions.reject();
1375
+ handleError("error.failedToSubmitPayment");
1376
+ return;
1377
+ }
1378
+ const response = await fetchResponse.json();
1379
+ if (!response.resultCode) {
1380
+ actions.reject();
1381
+ handleError("error.paymentFailed");
1382
+ return;
1383
+ }
1384
+ const { resultCode, action } = response;
1385
+ if (resultCode === "RedirectShopper" || resultCode === "IdentifyShopper") {
1386
+ setThreeDSecureActive(true);
1387
+ adyenCardRef.current.createFromAction(action).mount(threeDSecureRef == null ? void 0 : threeDSecureRef.current);
1388
+ return;
1389
+ }
1390
+ actions.resolve({ resultCode, action });
1391
+ if (resultCode === "Authorised") {
1392
+ handleSuccess("success.paymentAuthorized");
1393
+ } else {
1394
+ handleError("error.paymentUnsuccessful");
1395
+ }
1396
+ }
1397
+ async function handleOnSubmitAdditionalData(state, _, actions) {
1398
+ const data = {
1399
+ ...state.data,
1400
+ sessionId: configuration.sessionId
1401
+ };
1402
+ const fetchResponse = await createDetailsRequest(configuration.environment, data);
1403
+ if (!fetchResponse.ok) {
1404
+ actions.reject();
1405
+ handleError("error.failedToSubmitPaymentDetails");
1406
+ return;
1407
+ }
1408
+ const response = await fetchResponse.json();
1409
+ if (!response.resultCode) {
1410
+ actions.reject();
1411
+ handleError("error.paymentDetailsFailed");
1412
+ return;
1413
+ }
1414
+ const { resultCode, action } = response;
1415
+ actions.resolve({ resultCode, action });
1416
+ if (resultCode === "Authorised") {
1417
+ handleSuccess("success.paymentAuthorized");
1418
+ } else {
1419
+ handleError("error.paymentUnsuccessful");
1420
+ }
1421
+ }
1422
+ const hasGooglePay = (_a = paymentMethods.paymentMethods.paymentMethods) == null ? void 0 : _a.some((x) => x.type === "googlepay");
1423
+ if (!hasGooglePay) {
1424
+ return null;
1425
+ }
1426
+ return /* @__PURE__ */ h18("label", { className: "google-pay-component" }, /* @__PURE__ */ h18(
1427
+ "input",
1428
+ {
1429
+ type: "radio",
1430
+ className: "google-pay-component__radio-selector",
1431
+ checked: activePaymentMethod === "googlepay",
1432
+ onChange: handleBoxChange
1433
+ }
1434
+ ), /* @__PURE__ */ h18("span", { className: "google-pay-component__content" }, /* @__PURE__ */ h18("span", { className: "google-pay-component--circle" }), /* @__PURE__ */ h18(googlepay_default, null), /* @__PURE__ */ h18("span", { className: "google-pay-component--text" }, i18n(configuration.locale, "googlepay.title"))), /* @__PURE__ */ h18("div", { className: "google-pay-component__expandable" }, /* @__PURE__ */ h18("div", { ref: googlePayElementRef })));
1435
+ }
1436
+ var google_pay_component_default = GooglePayComponent;
1437
+
1438
+ // src/features/stored-card/stored-card-container-component.tsx
1439
+ import { Fragment as Fragment5, h as h21 } from "preact";
1440
+
1441
+ // src/features/stored-card/stored-card-component.tsx
1442
+ import { Fragment as Fragment4, h as h20 } from "preact";
1443
+ import { useEffect as useEffect4, useRef as useRef5, useState as useState5 } from "preact/hooks";
1444
+
1445
+ // src/features/stored-card/stored-card-component.css
1446
+ styleInject('.stored-card-component {\n position: relative;\n background: white;\n border-radius: 12px;\n transition: all 0.3s ease;\n padding: 16px 24px;\n cursor: pointer;\n}\n.stored-card-component:has(.stored-card-component__radio-selector:checked) {\n cursor: default;\n}\n.stored-card-component__radio-selector {\n position: absolute;\n opacity: 0;\n}\n.stored-card-component__content {\n display: flex;\n align-items: center;\n gap: 12px;\n transition: background-color 0.3s ease;\n}\n.stored-card-component__radio-selector:checked + .stored-card-component__content {\n padding-bottom: 16px;\n cursor: default;\n}\n.stored-card-component--circle {\n width: 24px;\n height: 24px;\n border: 1px solid #e6ebef;\n background: #eef0f2;\n border-radius: 50%;\n position: relative;\n transition: all 0.3s ease;\n}\n.stored-card-component__content:hover .stored-card-component--circle {\n border: 1px solid #cdd8e2;\n}\n.stored-card-component--circle::after {\n content: "";\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0);\n transition: transform 0.2s ease;\n}\n.stored-card-component__radio-selector:checked + .stored-card-component__content .stored-card-component--circle {\n background: #bce6f3;\n border-color: transparent;\n}\n.stored-card-component__radio-selector:checked + .stored-card-component__content .stored-card-component--circle::after {\n transform: translate(-50%, -50%) scale(1);\n background: #002649;\n height: 10px;\n width: 10px;\n}\n.stored-card-component--text {\n color: #213547;\n font-size: 1rem;\n user-select: none;\n}\n.stored-card-component--brands {\n display: flex;\n margin-left: auto;\n align-items: center;\n gap: 4px;\n}\n.stored-card-component--brands > svg {\n transition: all 0.2s ease;\n}\n.stored-card-component__remove-stored-card-button {\n margin-left: auto;\n}\n.stored-card-component__remove-stored-card-button--text {\n color: #d03e00;\n text-decoration: none;\n background: none;\n border: none;\n cursor: pointer;\n transition: all 0.2s ease;\n}\n.stored-card-component__remove-stored-card-button--text:disabled {\n cursor: not-allowed;\n color: #72889d;\n}\n.stored-card-component__confirm-remove-stored-card {\n background-color: #fff7db;\n border-radius: 8px;\n max-height: 0;\n overflow: hidden;\n transition: all 0.3s ease;\n opacity: 0;\n}\n.stored-card-component__confirm-remove-stored-card--expanded {\n padding: 16px;\n max-height: 400px;\n opacity: 1;\n}\n.stored-card-component__confirm-remove-stored-card--header {\n display: flex;\n align-items: center;\n gap: 12px;\n color: #262b31;\n padding-bottom: 16px;\n}\n.stored-card-component__confirm-remove-stored-card--actions {\n display: flex;\n gap: 12px;\n justify-content: end;\n}\n.stored-card-component__confirm-remove-stored-card--actions--button {\n color: #775d00;\n background: none;\n border: none;\n cursor: pointer;\n text-decoration: none;\n font-weight: bold;\n}\n.stored-card-component__expandable {\n background: white;\n max-height: 0;\n overflow: hidden;\n transition: all 0.3s ease;\n opacity: 0;\n}\n.stored-card-component__loading-text {\n display: flex;\n justify-content: center;\n}\n.stored-card-component__radio-selector:checked ~ .stored-card-component__expandable {\n max-height: 400px;\n opacity: 1;\n}\n.stored-card-component__form {\n display: flex;\n padding-top: 16px;\n flex-direction: column;\n gap: 24px;\n}\n.stored-card-component__form--wrapper {\n display: flex;\n flex-direction: column;\n justify-items: start;\n position: relative;\n width: 100%;\n}\n.stored-card-component__form--wrapper--error {\n color: #ff4d4f;\n font-size: 12px;\n}\n.stored-card-component__form--wrapper--label {\n transform: translateX(10px) translateY(-50%);\n z-index: 1;\n background:\n linear-gradient(\n to top,\n #eef0f2 53%,\n transparent 50%);\n position: absolute;\n font-weight: 500;\n font-size: 14px;\n padding: 0 4px;\n}\n.stored-card-component__form--wrapper--label--readonly {\n background:\n linear-gradient(\n to top,\n #e7e7e7 53%,\n transparent 50%);\n}\n.stored-card-component__form--wrapper--label--error {\n color: #ff4d4f;\n background:\n linear-gradient(\n to top,\n #fff8f5 53%,\n transparent 50%);\n font-size: 13px;\n font-weight: 500;\n}\n.stored-card-component__form--wrapper--label--info {\n position: absolute;\n top: 33%;\n right: 10px;\n}\n.stored-card-component__form--wrapper--input {\n background: #eef0f2;\n color: #00112c;\n display: flex;\n align-items: center;\n border: 1px solid transparent;\n border-radius: 8px;\n font-size: 1rem;\n height: 48px;\n outline: none;\n padding-left: 12px;\n transition: border 0.2s ease-out, box-shadow 0.2s ease-out;\n position: relative;\n}\n.stored-card-component__form--wrapper--input--readonly {\n background-color: #e7e7e7;\n}\n.stored-card-component__form--wrapper--input:hover {\n border: 1px solid #cdd8e2;\n}\n.stored-card-component__form--wrapper--input--readonly:hover {\n border: 1px solid transparent;\n}\n.stored-card-component__form--wrapper--input--error {\n background: #fff8f5;\n border: 1px solid #ff4d4f;\n}\n.stored-card-component__form--wrapper--input--error:hover {\n border: 1px solid #ff4d4f;\n}\n.stored-card-component__form--field-wrapper {\n display: flex;\n width: 100%;\n gap: 24px;\n}\n.stored-card-component__submit-button {\n background: #002649;\n border: none;\n border-radius: 8px;\n color: #ffffff;\n cursor: pointer;\n font-size: 1rem;\n height: 40px;\n outline: none;\n padding: 0 16px;\n transition: background 0.2s ease-out;\n width: 100%;\n}\n.stored-card-component__submit-button:hover {\n background: #002649;\n border: 1px solid #dbdee2;\n}\n.stored-card-component__submit-button:disabled {\n background: #72889d;\n border: 1px solid #dbdee2;\n cursor: not-allowed;\n}\n');
1447
+
1448
+ // src/features/stored-card/stored-card-component.tsx
1449
+ import {
1450
+ AdyenCheckout as AdyenCheckout3,
1451
+ CustomCard as CustomCard2
1452
+ } from "@adyen/adyen-web";
1453
+
1454
+ // src/assets/icons/warning.tsx
1455
+ import { h as h19 } from "preact";
1456
+ var WarningIcon = () => /* @__PURE__ */ h19("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ h19("g", { "clip-path": "url(#clip0_10650_34968)" }, /* @__PURE__ */ h19(
1457
+ "path",
1458
+ {
1459
+ d: "M12.0011 15C12.6245 15 13.1261 14.4984 13.1261 13.875V7.875C13.1261 7.25391 12.6222 6.75 12.0433 6.75C11.4644 6.75 10.8761 7.25625 10.8761 7.875V13.875C10.8761 14.4984 11.3823 15 12.0011 15ZM12.0011 16.5516C11.1873 16.5516 10.5273 17.2116 10.5273 18.0253C10.5292 18.8391 11.1855 19.5 12.0011 19.5C12.8167 19.5 13.4748 18.84 13.4748 18.0262C13.473 17.2125 12.8167 16.5516 12.0011 16.5516Z",
1460
+ fill: "#DFAE00"
1461
+ }
1462
+ ), /* @__PURE__ */ h19(
1463
+ "path",
1464
+ {
1465
+ opacity: "0.4",
1466
+ d: "M23.7312 19.5469L13.7328 2.48438C12.9673 1.17188 11.0356 1.17188 10.2649 2.48438L0.271188 19.5469C-0.49803 20.8547 0.460048 22.5 2.00181 22.5H21.9987C23.5343 22.5 24.4953 20.8594 23.7312 19.5469ZM10.8734 7.875C10.8734 7.25391 11.3773 6.75 11.9984 6.75C12.6195 6.75 13.1234 7.25625 13.1234 7.875V13.875C13.1234 14.4961 12.6195 15 12.0406 15C11.4617 15 10.8734 14.4984 10.8734 13.875V7.875ZM11.9984 19.5C11.1846 19.5 10.5246 18.84 10.5246 18.0262C10.5246 17.2125 11.1842 16.5525 11.9984 16.5525C12.8126 16.5525 13.4721 17.2125 13.4721 18.0262C13.4703 18.8391 12.814 19.5 11.9984 19.5Z",
1467
+ fill: "#DFAE00"
1468
+ }
1469
+ )), /* @__PURE__ */ h19("defs", null, /* @__PURE__ */ h19("clipPath", { id: "clip0_10650_34968" }, /* @__PURE__ */ h19("rect", { width: "24", height: "24", fill: "white" }))));
1470
+ var warning_default = WarningIcon;
1471
+
1472
+ // src/features/stored-card/stored-card-component.tsx
1473
+ function StoredCardComponent({
1474
+ configuration,
1475
+ paymentMethods,
1476
+ storedPaymentMethod,
1477
+ onStoredCardRemoved
1478
+ }) {
1479
+ const storedCardElementRef = useRef5(null);
1480
+ const adyenCardRef = useRef5();
1481
+ const customCardRef = useRef5();
1482
+ const [payButtonDisabled, setPayButtonDisabled] = useState5(true);
1483
+ const [securityCodePolicy, setSecurityCodePolicy] = useState5("required");
1484
+ const [askConfirmRemoveStoredCard, setAskConfirmRemoveStoredCard] = useState5(false);
1485
+ const [formErrors, setFormErrors] = useState5({
1486
+ encryptedSecurityCode: { visible: false }
1487
+ });
1488
+ const {
1489
+ activePaymentMethod,
1490
+ setActivePaymentMethod,
1491
+ activeStoredPaymentMethodId,
1492
+ setActiveStoredPaymentMethodId,
1493
+ isStoredCardInitialized,
1494
+ updateStoredCardInitialization,
1495
+ threeDSecureRef,
1496
+ handleSuccess,
1497
+ handleError,
1498
+ setThreeDSecureActive
1499
+ } = usePaymentMethodGroup();
1500
+ const initializeAdyenComponent = async () => {
1501
+ adyenCardRef.current = await AdyenCheckout3({
1502
+ clientKey: paymentMethods.clientKey,
1503
+ locale: configuration.locale,
1504
+ environment: configuration.environment,
1505
+ countryCode: "IS",
1506
+ paymentMethodsResponse: paymentMethods.paymentMethods,
1507
+ onError: handleOnError,
1508
+ onSubmit: handleOnSubmit,
1509
+ onAdditionalDetails: handleOnSubmitAdditionalData,
1510
+ onPaymentCompleted: configuration.onPaymentCompleted,
1511
+ onPaymentFailed: configuration.onPaymentFailed
1512
+ });
1513
+ customCardRef.current = new CustomCard2(adyenCardRef.current, {
1514
+ brands: [storedPaymentMethod.brand],
1515
+ onConfigSuccess() {
1516
+ updateStoredCardInitialization(storedPaymentMethod.id, true);
1517
+ },
1518
+ onBrand: (event) => {
1519
+ setSecurityCodePolicy(event.cvcPolicy);
1520
+ },
1521
+ onValidationError: (event) => {
1522
+ const defaultErrors = {
1523
+ encryptedSecurityCode: { visible: false, message: void 0 }
1524
+ };
1525
+ event.filter((x) => x.error).forEach((x) => {
1526
+ defaultErrors[x.fieldType].visible = true;
1527
+ defaultErrors[x.fieldType].message = x.errorI18n;
1528
+ });
1529
+ setFormErrors(defaultErrors);
1530
+ },
1531
+ onAllValid: (event) => {
1532
+ setPayButtonDisabled(!event.allValid);
1533
+ },
1534
+ placeholders: configuration.placeholders,
1535
+ challengeWindowSize: "05"
1536
+ // looks like not working
1537
+ });
1538
+ if (storedCardElementRef.current) {
1539
+ customCardRef.current.mount(storedCardElementRef.current);
1540
+ }
1541
+ };
1542
+ useEffect4(() => {
1543
+ if (activePaymentMethod === "storedcard" && activeStoredPaymentMethodId === storedPaymentMethod.id && !isStoredCardInitialized[activeStoredPaymentMethodId]) {
1544
+ initializeAdyenComponent();
1545
+ }
1546
+ }, [configuration, activePaymentMethod, activeStoredPaymentMethodId]);
1547
+ useEffect4(() => {
1548
+ if (customCardRef.current && isStoredCardInitialized[activeStoredPaymentMethodId]) {
1549
+ initializeAdyenComponent();
1550
+ setFormErrors({ encryptedSecurityCode: { visible: false, message: void 0 } });
1551
+ }
1552
+ }, [configuration]);
1553
+ useEffect4(() => {
1554
+ setAskConfirmRemoveStoredCard(false);
1555
+ }, [activePaymentMethod, activeStoredPaymentMethodId]);
1556
+ function handleBoxChange() {
1557
+ setActivePaymentMethod("storedcard");
1558
+ setActiveStoredPaymentMethodId(storedPaymentMethod.id);
1559
+ }
1560
+ function handleAskToConfirmRemoveCard() {
1561
+ setAskConfirmRemoveStoredCard(true);
1562
+ }
1563
+ function handleCancelRemoveStoredCard() {
1564
+ setAskConfirmRemoveStoredCard(false);
1565
+ }
1566
+ async function handleConfirmRemoveStoredCard() {
1567
+ const data = {
1568
+ storedPaymentMethodId: storedPaymentMethod.id,
1569
+ sessionId: configuration.sessionId
1570
+ };
1571
+ const fetchResponse = await postDisableTokenRequest(configuration.environment, data);
1572
+ if (!fetchResponse.ok) {
1573
+ handleError("error.failedToSubmitRemoveStoredPaymentCard");
1574
+ return;
1575
+ }
1576
+ const disableTokenResponse = await fetchResponse.json();
1577
+ if (!disableTokenResponse.success) {
1578
+ handleError("error.failedToRemoveStoredPaymentCard");
1579
+ return;
1580
+ }
1581
+ onStoredCardRemoved(storedPaymentMethod.id);
1582
+ }
1583
+ function handleOnError(_, __) {
1584
+ handleError("error.unknownError");
1585
+ }
1586
+ async function handleOnSubmit(state, _, actions) {
1587
+ const data = {
1588
+ ...state.data,
1589
+ origin: window.location.origin,
1590
+ sessionId: configuration.sessionId,
1591
+ paymentMethod: {
1592
+ ...state.data.paymentMethod,
1593
+ storedPaymentMethodId: storedPaymentMethod.id
1594
+ }
1595
+ };
1596
+ const fetchResponse = await createPaymentRequest(configuration.environment, data);
1597
+ if (!fetchResponse.ok) {
1598
+ actions.reject();
1599
+ handleError("error.failedToSubmitPayment");
1600
+ return;
1601
+ }
1602
+ const response = await fetchResponse.json();
1603
+ if (!response.resultCode) {
1604
+ actions.reject();
1605
+ handleError("error.paymentFailed");
1606
+ return;
1607
+ }
1608
+ const { resultCode, action } = response;
1609
+ if (resultCode === "RedirectShopper" || resultCode === "IdentifyShopper") {
1610
+ setThreeDSecureActive(true);
1611
+ adyenCardRef.current.createFromAction(action).mount(threeDSecureRef == null ? void 0 : threeDSecureRef.current);
1612
+ return;
1613
+ }
1614
+ actions.resolve({ resultCode, action });
1615
+ if (resultCode === "Authorised") {
1616
+ handleSuccess("success.paymentAuthorized");
1617
+ } else {
1618
+ handleError("error.paymentUnsuccessful");
1619
+ }
1620
+ }
1621
+ async function handleOnSubmitAdditionalData(state, _, actions) {
1622
+ const data = {
1623
+ ...state.data,
1624
+ sessionId: configuration.sessionId
1625
+ };
1626
+ const fetchResponse = await createDetailsRequest(configuration.environment, data);
1627
+ if (!fetchResponse.ok) {
1628
+ actions.reject();
1629
+ handleError("error.failedToSubmitPaymentDetails");
1630
+ return;
1631
+ }
1632
+ const response = await fetchResponse.json();
1633
+ if (!response.resultCode) {
1634
+ actions.reject();
1635
+ handleError("error.paymentDetailsFailed");
1636
+ return;
1637
+ }
1638
+ const { resultCode, action } = response;
1639
+ actions.resolve({ resultCode, action });
1640
+ if (resultCode === "Authorised") {
1641
+ handleSuccess("success.paymentAuthorized");
1642
+ } else {
1643
+ handleError("error.paymentUnsuccessful");
1644
+ }
1645
+ }
1646
+ function handleSubmitClick() {
1647
+ if (!customCardRef.current) return;
1648
+ customCardRef.current.submit();
1649
+ }
1650
+ return /* @__PURE__ */ h20("label", { className: "stored-card-component" }, /* @__PURE__ */ h20(
1651
+ "input",
1652
+ {
1653
+ type: "radio",
1654
+ className: "stored-card-component__radio-selector",
1655
+ checked: activePaymentMethod === "storedcard" && activeStoredPaymentMethodId === storedPaymentMethod.id,
1656
+ onChange: handleBoxChange
1657
+ }
1658
+ ), /* @__PURE__ */ h20("span", { className: "stored-card-component__content" }, /* @__PURE__ */ h20("span", { className: "stored-card-component--circle" }), /* @__PURE__ */ h20(
1659
+ RenderBrandIcons,
1660
+ {
1661
+ brands: [
1662
+ {
1663
+ brand: storedPaymentMethod.brand,
1664
+ brandFullName: storedPaymentMethod.name
1665
+ }
1666
+ ]
1667
+ }
1668
+ ), /* @__PURE__ */ h20("span", { className: "stored-card-component--text" }, "\u2022\u2022\u2022\u2022 ", storedPaymentMethod.lastFour), activePaymentMethod === "storedcard" && activeStoredPaymentMethodId === storedPaymentMethod.id && /* @__PURE__ */ h20("div", { className: "stored-card-component__remove-stored-card-button" }, /* @__PURE__ */ h20(
1669
+ "button",
1670
+ {
1671
+ onClick: handleAskToConfirmRemoveCard,
1672
+ className: "stored-card-component__remove-stored-card-button--text",
1673
+ disabled: askConfirmRemoveStoredCard
1674
+ },
1675
+ i18n(configuration.locale, "stored-cards.removeStoredCard")
1676
+ ))), /* @__PURE__ */ h20(
1677
+ "div",
1678
+ {
1679
+ className: `${"stored-card-component__confirm-remove-stored-card"} ${askConfirmRemoveStoredCard ? "stored-card-component__confirm-remove-stored-card--expanded" : ""}`
1680
+ },
1681
+ /* @__PURE__ */ h20("div", { className: "stored-card-component__confirm-remove-stored-card--header" }, /* @__PURE__ */ h20(warning_default, null), /* @__PURE__ */ h20("span", { className: "stored-card-component__confirm-remove-stored-card--header--title" }, i18n(configuration.locale, "stored-cards.removeStoredCardQuestion"))),
1682
+ /* @__PURE__ */ h20("div", { className: "stored-card-component__confirm-remove-stored-card--actions" }, /* @__PURE__ */ h20(
1683
+ "button",
1684
+ {
1685
+ className: "stored-card-component__confirm-remove-stored-card--actions--button",
1686
+ onClick: handleConfirmRemoveStoredCard
1687
+ },
1688
+ i18n(configuration.locale, "stored-cards.removeStoredCardQuestionYesRemove")
1689
+ ), /* @__PURE__ */ h20(
1690
+ "button",
1691
+ {
1692
+ className: "stored-card-component__confirm-remove-stored-card--actions--button",
1693
+ onClick: handleCancelRemoveStoredCard
1694
+ },
1695
+ i18n(configuration.locale, "stored-cards.removeStoredCardQuestionCancel")
1696
+ ))
1697
+ ), /* @__PURE__ */ h20("div", { className: "stored-card-component__expandable", ref: storedCardElementRef }, !isStoredCardInitialized[storedPaymentMethod.id] && /* @__PURE__ */ h20("div", { className: "stored-card-component__loading-text" }, /* @__PURE__ */ h20(loader_default, null)), /* @__PURE__ */ h20(
1698
+ "div",
1699
+ {
1700
+ className: "stored-card-component__form",
1701
+ style: {
1702
+ opacity: isStoredCardInitialized[storedPaymentMethod.id] ? 1 : 0,
1703
+ position: isStoredCardInitialized[storedPaymentMethod.id] ? "relative" : "absolute",
1704
+ transition: "opacity 0.3s ease-in-out"
1705
+ }
1706
+ },
1707
+ /* @__PURE__ */ h20("div", { className: "stored-card-component__form--field-wrapper" }, /* @__PURE__ */ h20("div", { className: "stored-card-component__form--wrapper" }, /* @__PURE__ */ h20("label", { className: "stored-card-component__form--wrapper--label stored-card-component__form--wrapper--label--readonly" }, i18n(configuration.locale, "stored-cards.expiryDate")), /* @__PURE__ */ h20("span", { className: "stored-card-component__form--wrapper--input stored-card-component__form--wrapper--input--readonly" }, storedPaymentMethod.expiryMonth, "/", storedPaymentMethod.expiryYear)), /* @__PURE__ */ h20("div", { className: "stored-card-component__form--wrapper" }, (securityCodePolicy === "optional" || securityCodePolicy === "required") && /* @__PURE__ */ h20(Fragment4, null, /* @__PURE__ */ h20(
1708
+ "label",
1709
+ {
1710
+ className: `${"stored-card-component__form--wrapper--label"} ${formErrors.encryptedSecurityCode.visible ? "stored-card-component__form--wrapper--label--error" : ""}`
1711
+ },
1712
+ securityCodePolicy === "optional" ? i18n(configuration.locale, "stored-cards.securityCode3DigitsOptional") : i18n(configuration.locale, "stored-cards.securityCode3Digits")
1713
+ ), /* @__PURE__ */ h20(
1714
+ "span",
1715
+ {
1716
+ className: `${"stored-card-component__form--wrapper--input"} ${formErrors.encryptedSecurityCode.visible ? "stored-card-component__form--wrapper--input--error" : ""}`,
1717
+ "data-cse": "encryptedSecurityCode"
1718
+ },
1719
+ /* @__PURE__ */ h20("div", { className: "stored-card-component__form--wrapper--label--info" }, /* @__PURE__ */ h20(Tooltip, { content: i18n(configuration.locale, "stored-cards.securityCode3DigitsInfo") }, /* @__PURE__ */ h20(info_default, null)))
1720
+ )), formErrors.encryptedSecurityCode.visible && /* @__PURE__ */ h20("span", { className: "stored-card-component__form--wrapper--error" }, formErrors.encryptedSecurityCode.message))),
1721
+ /* @__PURE__ */ h20(
1722
+ "button",
1723
+ {
1724
+ id: "stored-card-component-submit-button",
1725
+ className: "stored-card-component__submit-button",
1726
+ disabled: payButtonDisabled,
1727
+ onClick: handleSubmitClick
1728
+ },
1729
+ paymentMethods.formattedAmount
1730
+ )
1731
+ )));
1732
+ }
1733
+ var stored_card_component_default = StoredCardComponent;
1734
+
1735
+ // src/features/stored-card/stored-card-container-component.tsx
1736
+ import { useState as useState6 } from "preact/hooks";
1737
+ function StoredCardContainerComponent({
1738
+ configuration,
1739
+ paymentMethods
1740
+ }) {
1741
+ var _a;
1742
+ const [storedPaymentMethods, setStoredPaymentMethods] = useState6(
1743
+ (_a = paymentMethods.paymentMethods.storedPaymentMethods) != null ? _a : []
1744
+ );
1745
+ if (!storedPaymentMethods || (storedPaymentMethods == null ? void 0 : storedPaymentMethods.length) === 0) {
1746
+ return null;
1747
+ }
1748
+ function handleStoredCardRemoved(storedPaymentMethodId) {
1749
+ setStoredPaymentMethods(
1750
+ (prevStoredPaymentMethods) => prevStoredPaymentMethods.filter((storedPaymentMethod) => storedPaymentMethod.id !== storedPaymentMethodId)
1751
+ );
1752
+ }
1753
+ return /* @__PURE__ */ h21(Fragment5, null, storedPaymentMethods == null ? void 0 : storedPaymentMethods.map((storedPaymentMethod) => /* @__PURE__ */ h21(
1754
+ stored_card_component_default,
1755
+ {
1756
+ key: storedPaymentMethod.id,
1757
+ configuration,
1758
+ storedPaymentMethod,
1759
+ paymentMethods,
1760
+ onStoredCardRemoved: handleStoredCardRemoved
1761
+ }
1762
+ )));
1763
+ }
1764
+ var stored_card_container_component_default = StoredCardContainerComponent;
1765
+
1766
+ // src/components/payment-method-group/payment-method-group.tsx
1767
+ import { h as h22 } from "preact";
1768
+
1769
+ // src/components/payment-method-group/payment-method-group.css
1770
+ styleInject(".payment-method-group {\n display: flex;\n flex-direction: column;\n gap: 16px;\n width: 100%;\n}\n");
1771
+
1772
+ // src/components/payment-method-group/payment-method-group.tsx
1773
+ function PaymentMethodGroup({ children, initialValue }) {
1774
+ return /* @__PURE__ */ h22(PaymentMethodGroupContext, { initialValue }, /* @__PURE__ */ h22("div", { className: "payment-method-group" }, children));
1775
+ }
1776
+ var payment_method_group_default = PaymentMethodGroup;
1777
+
1778
+ // src/features/result-component/result-component.tsx
1779
+ import { h as h25 } from "preact";
1780
+
1781
+ // src/features/result-component/result-component.css
1782
+ styleInject(".result-component {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 300px;\n background-color: white;\n border-radius: 16px;\n}\n");
1783
+
1784
+ // src/assets/icons/success.tsx
1785
+ import { h as h23 } from "preact";
1786
+ var SuccessIcon = () => /* @__PURE__ */ h23("svg", { xmlns: "http://www.w3.org/2000/svg", width: "120", height: "120", viewBox: "0 0 120 120" }, /* @__PURE__ */ h23(
1787
+ "circle",
1788
+ {
1789
+ cx: "60",
1790
+ cy: "60",
1791
+ r: "50",
1792
+ fill: "none",
1793
+ stroke: "#5b8206",
1794
+ "stroke-width": "5",
1795
+ "stroke-dasharray": "314",
1796
+ "stroke-dashoffset": "314"
1797
+ },
1798
+ /* @__PURE__ */ h23("animate", { attributeName: "stroke-dashoffset", from: "314", to: "0", dur: "1s", fill: "freeze" })
1799
+ ), /* @__PURE__ */ h23("g", { transform: "translate(60,60)" }, /* @__PURE__ */ h23(
1800
+ "path",
1801
+ {
1802
+ d: "M-25 5 L-5 25 L25 -15",
1803
+ fill: "none",
1804
+ stroke: "#5b8206",
1805
+ "stroke-width": "6",
1806
+ "stroke-linecap": "round",
1807
+ "stroke-linejoin": "round",
1808
+ "stroke-dasharray": "100",
1809
+ "stroke-dashoffset": "100"
1810
+ },
1811
+ /* @__PURE__ */ h23("animate", { attributeName: "stroke-dashoffset", from: "100", to: "0", dur: "0.5s", begin: "1s", fill: "freeze" }),
1812
+ /* @__PURE__ */ h23(
1813
+ "animateTransform",
1814
+ {
1815
+ attributeName: "transform",
1816
+ type: "scale",
1817
+ from: "1 1",
1818
+ to: "1.2 1.2",
1819
+ begin: "1.5s",
1820
+ dur: "0.2s",
1821
+ fill: "freeze",
1822
+ additive: "sum"
1823
+ }
1824
+ ),
1825
+ /* @__PURE__ */ h23(
1826
+ "animateTransform",
1827
+ {
1828
+ attributeName: "transform",
1829
+ type: "scale",
1830
+ from: "1.2 1.2",
1831
+ to: "1 1",
1832
+ begin: "1.7s",
1833
+ dur: "0.2s",
1834
+ fill: "freeze",
1835
+ additive: "sum"
1836
+ }
1837
+ )
1838
+ )));
1839
+ var success_default = SuccessIcon;
1840
+
1841
+ // src/assets/icons/failure.tsx
1842
+ import { h as h24 } from "preact";
1843
+ var FailureIcon = () => /* @__PURE__ */ h24("svg", { xmlns: "http://www.w3.org/2000/svg", width: "120", height: "120", viewBox: "0 0 120 120" }, /* @__PURE__ */ h24(
1844
+ "circle",
1845
+ {
1846
+ cx: "60",
1847
+ cy: "60",
1848
+ r: "50",
1849
+ fill: "none",
1850
+ stroke: "#d03e00",
1851
+ "stroke-width": "5",
1852
+ "stroke-dasharray": "314",
1853
+ "stroke-dashoffset": "314"
1854
+ },
1855
+ /* @__PURE__ */ h24("animate", { attributeName: "stroke-dashoffset", from: "314", to: "0", dur: "1s", fill: "freeze" })
1856
+ ), /* @__PURE__ */ h24("g", { transform: "translate(60,60)" }, /* @__PURE__ */ h24("g", { id: "crossGroup" }, /* @__PURE__ */ h24(
1857
+ "line",
1858
+ {
1859
+ x1: "-20",
1860
+ y1: "-20",
1861
+ x2: "20",
1862
+ y2: "20",
1863
+ stroke: "#d03e00",
1864
+ "stroke-width": "6",
1865
+ "stroke-linecap": "round",
1866
+ "stroke-dasharray": "57",
1867
+ "stroke-dashoffset": "57"
1868
+ },
1869
+ /* @__PURE__ */ h24("animate", { attributeName: "stroke-dashoffset", from: "57", to: "0", dur: "0.3s", begin: "1s", fill: "freeze" })
1870
+ ), /* @__PURE__ */ h24(
1871
+ "line",
1872
+ {
1873
+ x1: "20",
1874
+ y1: "-20",
1875
+ x2: "-20",
1876
+ y2: "20",
1877
+ stroke: "#d03e00",
1878
+ "stroke-width": "6",
1879
+ "stroke-linecap": "round",
1880
+ "stroke-dasharray": "57",
1881
+ "stroke-dashoffset": "57"
1882
+ },
1883
+ /* @__PURE__ */ h24("animate", { attributeName: "stroke-dashoffset", from: "57", to: "0", dur: "0.3s", begin: "1.3s", fill: "freeze" })
1884
+ ))));
1885
+ var failure_default = FailureIcon;
1886
+
1887
+ // src/features/result-component/result-component.tsx
1888
+ function ResultComponent({ configuration }) {
1889
+ const { error, success } = usePaymentMethodGroup();
1890
+ if (!error && !success) {
1891
+ return null;
1892
+ }
1893
+ return /* @__PURE__ */ h25("div", { className: "result-component" }, error && /* @__PURE__ */ h25("div", { className: "result-component__error" }, /* @__PURE__ */ h25(failure_default, null), /* @__PURE__ */ h25("p", { className: "result-component__error--message" }, i18n(configuration.locale, error))), success && /* @__PURE__ */ h25("div", { className: "result-component__success" }, /* @__PURE__ */ h25(success_default, null), /* @__PURE__ */ h25("p", { className: "result-component__success--message" }, i18n(configuration.locale, success))));
1894
+ }
1895
+ var result_component_default = ResultComponent;
1896
+
1897
+ // src/features/three-d-secure-component/three-d-secure-component.tsx
1898
+ import { h as h26 } from "preact";
1899
+ import { useEffect as useEffect5, useRef as useRef6 } from "preact/hooks";
1900
+
1901
+ // src/features/three-d-secure-component/three-d-secure-component.css
1902
+ styleInject(".three-d-secure {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n background-color: white;\n border-radius: 16px;\n}\n");
1903
+
1904
+ // src/features/three-d-secure-component/three-d-secure-component.tsx
1905
+ function StraumurCheckoutContainer() {
1906
+ const threeDSecureRef = useRef6(null);
1907
+ const { setThreeDSecureRef } = usePaymentMethodGroup();
1908
+ useEffect5(() => {
1909
+ if (threeDSecureRef.current) {
1910
+ setThreeDSecureRef(threeDSecureRef.current);
1911
+ }
1912
+ }, []);
1913
+ return /* @__PURE__ */ h26("div", { className: "three-d-secure", ref: threeDSecureRef });
1914
+ }
1915
+ var three_d_secure_component_default = StraumurCheckoutContainer;
1916
+
1917
+ // src/features/payment-methods-wrapper/payment-methods-wrapper.tsx
1918
+ import { Fragment as Fragment6, h as h27 } from "preact";
1919
+ function PaymentMethodsWrapper({ children }) {
1920
+ const { error, success, threeDSecureActive } = usePaymentMethodGroup();
1921
+ if (error || success || threeDSecureActive) {
1922
+ return null;
1923
+ }
1924
+ return /* @__PURE__ */ h27(Fragment6, null, children);
1925
+ }
1926
+ var payment_methods_wrapper_default = PaymentMethodsWrapper;
1927
+
1928
+ // src/features/straumur-checkout-container.tsx
1929
+ function StraumurCheckoutContainer2({ configuration, paymentMethods }) {
1930
+ return /* @__PURE__ */ h28(payment_method_group_default, { initialValue: null }, /* @__PURE__ */ h28(payment_methods_wrapper_default, null, /* @__PURE__ */ h28(stored_card_container_component_default, { configuration, paymentMethods }), /* @__PURE__ */ h28(card_component_default, { configuration, paymentMethods }), /* @__PURE__ */ h28(google_pay_component_default, { configuration, paymentMethods })), /* @__PURE__ */ h28(three_d_secure_component_default, null), /* @__PURE__ */ h28(result_component_default, { configuration }));
1931
+ }
1932
+ var straumur_checkout_container_default = StraumurCheckoutContainer2;
1933
+
1934
+ // src/straumur-checkout.tsx
1935
+ var StraumurCheckout = class {
1936
+ constructor(config) {
1937
+ this.paymentMethods = null;
1938
+ this.mountElement = null;
1939
+ this.configuration = { ...config, locale: config.locale || "en-US" };
1940
+ }
1941
+ async mount(selector) {
1942
+ try {
1943
+ this.mountElement = typeof selector === "string" ? document.querySelector(selector) : selector;
1944
+ if (!this.mountElement) {
1945
+ this.handleError("error.failedToInitializeStraumurWebComponent");
1946
+ return;
1947
+ }
1948
+ render(
1949
+ /* @__PURE__ */ h29("div", { className: "component" }, /* @__PURE__ */ h29(loader_default, null)),
1950
+ this.mountElement
1951
+ );
1952
+ const response = await setupPaymentMethods(this.configuration.environment, this.configuration.sessionId);
1953
+ if (response.resultCode === "Error") {
1954
+ this.handleError(response.error);
1955
+ return;
1956
+ }
1957
+ this.paymentMethods = response;
1958
+ this.configuration.locale = this.configuration.locale || this.paymentMethods.locale;
1959
+ this.renderComponent();
1960
+ } catch (error) {
1961
+ }
1962
+ }
1963
+ renderComponent() {
1964
+ if (!this.mountElement) return;
1965
+ render(
1966
+ /* @__PURE__ */ h29(straumur_checkout_container_default, { configuration: this.configuration, paymentMethods: this.paymentMethods }),
1967
+ this.mountElement
1968
+ );
1969
+ }
1970
+ updateConfig(newConfig) {
1971
+ this.configuration = {
1972
+ ...this.configuration,
1973
+ ...newConfig
1974
+ };
1975
+ if (this.mountElement) {
1976
+ this.renderComponent();
1977
+ }
1978
+ }
1979
+ setLanguage(locale) {
1980
+ this.updateConfig({
1981
+ locale
1982
+ });
1983
+ }
1984
+ destroy() {
1985
+ if (this.mountElement) {
1986
+ render(null, this.mountElement);
1987
+ this.mountElement = null;
1988
+ }
1989
+ }
1990
+ handleError(message) {
1991
+ render(
1992
+ /* @__PURE__ */ h29("div", { className: "component" }, /* @__PURE__ */ h29(failure_default, null), /* @__PURE__ */ h29("p", null, i18n(this.configuration.locale, message))),
1993
+ this.mountElement
1994
+ );
1995
+ }
1996
+ };
1997
+ var straumur_checkout_default = StraumurCheckout;
1998
+ export {
1999
+ straumur_checkout_default as StraumurCheckout
2000
+ };