@wajub/js 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # @wajub/js
2
+
3
+ JavaScript SDK for **Wajub Components**.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @wajub/js
9
+ ```
10
+
11
+ Or load from CDN (no bundler):
12
+
13
+ ```html
14
+ <script src="https://js.wajub.com"></script>
15
+ ```
16
+
17
+ ## Quick start
18
+
19
+ ```typescript
20
+ import { loadWajub, mount } from "@wajub/js";
21
+
22
+ // Returns null on the server (SSR) — mount in the browser only.
23
+ const rt = await loadWajub();
24
+ if (!rt) return;
25
+
26
+ rt.wajub.mount("#checkout", {
27
+ sessionId: "YOUR_SESSION_TOKEN",
28
+ onSuccess: (txn) => console.log("paid", txn),
29
+ });
30
+
31
+ // Async helper:
32
+ await mount("#checkout", {
33
+ sessionId: "YOUR_SESSION_TOKEN",
34
+ onSuccess: () => (window.location.href = "/thanks"),
35
+ });
36
+ ```
37
+
38
+ Create `sessionId` on your server, then pass it to the client. Never expose secret keys (`sk_...`) in the browser.
39
+
40
+ ## Deferred load
41
+
42
+ Import without auto-loading the SDK:
43
+
44
+ ```typescript
45
+ import { loadWajub } from "@wajub/js/pure";
46
+
47
+ const { Wajub } = (await loadWajub())!;
48
+ const client = Wajub.session("YOUR_SESSION_TOKEN");
49
+ ```
50
+
51
+ ## Components
52
+
53
+ ```typescript
54
+ const { Wajub } = (await loadWajub())!;
55
+ const client = Wajub.session(sessionId);
56
+ const card = client.components().create("card").mount("#card");
57
+ await client.confirmPayment({ components: card });
58
+ ```
59
+
60
+ ## Framework packages
61
+
62
+ Full documentation on this site — install via npm, integrate using the guides below:
63
+
64
+ | Package | Guide |
65
+ |---------|-------|
66
+ | `@wajub/react` | [React / Next.js](/tools/components/react) |
67
+ | `@wajub/vue` | [Vue 3 / Nuxt](/tools/components/vue) |
68
+ | `@wajub/svelte` | [Svelte / SvelteKit](/tools/components/svelte) |
69
+
70
+ Each package provides `WajubProvider`, embed components, and helpers — same public API, framework-native syntax.
71
+
72
+ ## Documentation
73
+
74
+ [docs.wajub.com/tools/components/js](https://docs.wajub.com/tools/components/js)
75
+
76
+ ## License
77
+
78
+ MIT
@@ -0,0 +1,431 @@
1
+ /**
2
+ * Wajub Checkout SDK — TypeScript definitions
3
+ *
4
+ * npm loader (recommended — loads runtime from CDN):
5
+ * npm install @wajub/js
6
+ * import { loadWajub, mount } from "@wajub/js";
7
+ * const rt = await loadWajub();
8
+ *
9
+ * Deferred load (no side effect on import):
10
+ * import { loadWajub } from "@wajub/js/pure";
11
+ *
12
+ * CDN script tag (full runtime):
13
+ * <script src="https://js.wajub.com"></script>
14
+ *
15
+ * CDN ESM (full runtime):
16
+ * import { mount } from "https://js.wajub.com/wajub.mjs";
17
+ */
18
+
19
+ export interface LoadWajubOptions {
20
+ /** CDN origin (default https://js.wajub.com). */
21
+ jsOrigin?: string;
22
+ /** Full script URL override (default `{jsOrigin}/wajub.js`). */
23
+ jsUrl?: string;
24
+ }
25
+
26
+ /** Runtime globals after Wajub.js CDN script loads. */
27
+ export interface WajubRuntime {
28
+ wajub: WajubSDK;
29
+ Wajub: WajubFactory;
30
+ WajubError: typeof WajubError;
31
+ }
32
+
33
+ export interface LoadWajubFn {
34
+ (options?: LoadWajubOptions): Promise<WajubRuntime | null>;
35
+ setLoadParameters(params: LoadWajubOptions): void;
36
+ }
37
+
38
+ /**
39
+ * Load Wajub.js from the CDN. Resolves to `null` on the server (SSR-safe).
40
+ */
41
+ export const loadWajub: LoadWajubFn;
42
+
43
+ /** @wajub/js async helpers — load CDN then call API. Return null on SSR. */
44
+ export function mount(
45
+ container: string | HTMLElement,
46
+ config: EmbeddedConfig,
47
+ ): Promise<CheckoutInstance | null>;
48
+ export function open(config: PopupConfig): Promise<PopupInstance | null>;
49
+ export function checkout(config: EmbeddedConfig): Promise<void | null>;
50
+ export function preload(sessionId: string, options?: { iframe?: boolean }): Promise<void | null>;
51
+ export function fetchSession(sessionId: string): Promise<SessionPreview>;
52
+ export function components(
53
+ sessionId: string,
54
+ options?: Partial<ComponentConfig>,
55
+ ): Promise<ComponentsFactory | null>;
56
+ export function confirmPayment(
57
+ options: ConfirmPaymentOptions,
58
+ ): Promise<{ status: string; transaction?: Record<string, unknown> | null }>;
59
+ export function getVersion(): Promise<string | null>;
60
+ export function getCheckoutOrigin(): Promise<string | null>;
61
+
62
+ export type CheckoutState =
63
+ | "INITIATED"
64
+ | "COLLECTING_DETAILS"
65
+ | "PROCESSING"
66
+ | "OTP_REQUIRED"
67
+ | "3DS_REQUIRED"
68
+ | "USSD_REQUIRED"
69
+ | "APPROVAL_REQUIRED"
70
+ | "VERIFYING"
71
+ | "PENDING"
72
+ | "SUCCESS"
73
+ | "FAILED"
74
+ | "EXPIRED"
75
+ | "CANCELLED";
76
+
77
+ export type WajubErrorType =
78
+ | "api_error"
79
+ | "authentication_error"
80
+ | "invalid_request_error"
81
+ | "payment_error"
82
+ | "rate_limit_error";
83
+
84
+ export interface WajubErrorShape {
85
+ name: "WajubError";
86
+ message: string;
87
+ type: WajubErrorType;
88
+ code: string;
89
+ decline_code: string | null;
90
+ retryable: boolean;
91
+ param: string | null;
92
+ }
93
+
94
+ export declare class WajubError extends Error implements WajubErrorShape {
95
+ type: WajubErrorType;
96
+ code: string;
97
+ decline_code: string | null;
98
+ retryable: boolean;
99
+ param: string | null;
100
+ static fromPayload(payload: unknown): WajubError;
101
+ toJSON(): WajubErrorShape;
102
+ }
103
+
104
+ export type AppearanceThemePreset = "stripe" | "night" | "flat" | "none";
105
+ export type AppearanceColorScheme = "light" | "dark" | "auto";
106
+ export type AppearanceLabels = "above" | "floating";
107
+
108
+ export interface AppearanceVariables {
109
+ colorPrimary?: string;
110
+ colorBackground?: string;
111
+ colorText?: string;
112
+ colorTextSecondary?: string;
113
+ colorTextPlaceholder?: string;
114
+ colorDanger?: string;
115
+ colorSuccess?: string;
116
+ fontFamily?: string;
117
+ fontSizeBase?: string;
118
+ fontWeightNormal?: string;
119
+ fontWeightMedium?: string;
120
+ fontWeightBold?: string;
121
+ spacingUnit?: string;
122
+ borderRadius?: string;
123
+ spacingGridRow?: string;
124
+ spacingGridColumn?: string;
125
+ }
126
+
127
+ export type AppearanceRules = Record<string, Record<string, string>>;
128
+
129
+ export interface AppearanceConfig {
130
+ /** Built-in preset (layered before explicit keys). */
131
+ theme?: AppearanceThemePreset;
132
+ primaryColor?: string;
133
+ secondaryColor?: string;
134
+ backgroundColor?: string;
135
+ fontFamily?: string;
136
+ borderRadius?: string;
137
+ buttonTextColor?: string;
138
+ inputBackgroundColor?: string;
139
+ inputBorderColor?: string;
140
+ textMutedColor?: string;
141
+ successColor?: string;
142
+ errorColor?: string;
143
+ shadow?: string;
144
+ colorScheme?: AppearanceColorScheme;
145
+ labels?: AppearanceLabels;
146
+ disableAnimations?: boolean;
147
+ variables?: AppearanceVariables;
148
+ rules?: AppearanceRules;
149
+ }
150
+
151
+ /** @deprecated Use AppearanceConfig */
152
+ export interface EmbedTheme {
153
+ primaryColor?: string;
154
+ fontFamily?: string;
155
+ borderRadius?: string;
156
+ }
157
+
158
+ export type CheckoutLayout = "classic" | "compact" | "tabs" | "accordion";
159
+
160
+ export interface EmbedBreakdown {
161
+ subtotal: number;
162
+ discount: number;
163
+ tax: number;
164
+ total: number;
165
+ currency: string;
166
+ }
167
+
168
+ export interface SessionPreview {
169
+ session_id: string;
170
+ status: string;
171
+ environment: "sandbox" | "live";
172
+ amount: number;
173
+ currency: string;
174
+ merchant_name: string;
175
+ payment_methods: Array<{ id: string; type: string; label: string }>;
176
+ saved_methods?: Array<{ id: string; type: string; label: string }>;
177
+ features: Record<string, boolean>;
178
+ }
179
+
180
+ export interface EmbeddedConfig {
181
+ sessionId: string;
182
+ locale?: string;
183
+ embedOrigin?: string;
184
+ /** @deprecated Prefer appearance */
185
+ theme?: EmbedTheme;
186
+ appearance?: AppearanceConfig;
187
+ layout?: CheckoutLayout;
188
+ loadingText?: string;
189
+ showLoading?: boolean;
190
+ onReady?: (instance: CheckoutInstance) => void;
191
+ onSuccess?: (transaction: Record<string, unknown>) => void;
192
+ onError?: (error: WajubError | Record<string, unknown>) => void;
193
+ onLoadError?: (error: WajubError | Record<string, unknown>) => void;
194
+ onCancel?: () => void;
195
+ onExpired?: () => void;
196
+ onStateChange?: (payload: { state?: CheckoutState; method?: string }) => void;
197
+ onMethodChange?: (payload: { methodId?: string; method_id?: string }) => void;
198
+ onBreakdown?: (breakdown: EmbedBreakdown) => void;
199
+ onResize?: (height: number) => void;
200
+ onClose?: () => void;
201
+ }
202
+
203
+ export interface CheckoutInstance {
204
+ mount(): void;
205
+ unmount(): void;
206
+ update(
207
+ config: Partial<
208
+ Pick<EmbeddedConfig, "locale" | "theme" | "appearance" | "layout"> & { currency?: string }
209
+ >,
210
+ ): void;
211
+ getState(): CheckoutState | string;
212
+ submit(): void;
213
+ cancel(): void;
214
+ retry(): void;
215
+ selectMethod(methodId: string): void;
216
+ close(): void;
217
+ destroy(): void;
218
+ }
219
+
220
+ export interface PopupConfig extends EmbeddedConfig {
221
+ width?: number;
222
+ height?: number;
223
+ closeOnOverlay?: boolean;
224
+ closeOnEscape?: boolean;
225
+ }
226
+
227
+ export interface PopupInstance extends CheckoutInstance {
228
+ isOpen?(): boolean;
229
+ }
230
+
231
+ export type ComponentType = "card" | "mobileMoney" | "wallet" | "payment" | "address";
232
+
233
+ export type AddressMode = "shipping" | "billing";
234
+ export type PhoneFieldMode = "always" | "auto" | "never";
235
+ export type CollectAddressMode = "shipping" | "billing";
236
+
237
+ export interface AddressValue {
238
+ line1: string;
239
+ line2?: string;
240
+ city: string;
241
+ state?: string;
242
+ postal_code?: string;
243
+ country: string;
244
+ }
245
+
246
+ export interface ComponentAddressValue {
247
+ name?: string;
248
+ phone?: string;
249
+ address?: AddressValue | null;
250
+ mode?: AddressMode;
251
+ }
252
+
253
+ export interface ComponentChangeEvent {
254
+ complete?: boolean;
255
+ empty?: boolean;
256
+ error?: WajubErrorShape | Record<string, unknown>;
257
+ value?: ComponentAddressValue | Record<string, unknown>;
258
+ }
259
+
260
+ export interface ComponentFieldsConfig {
261
+ phone?: PhoneFieldMode;
262
+ }
263
+
264
+ export interface ComponentConfig {
265
+ sessionId: string;
266
+ locale?: string;
267
+ componentOrigin?: string;
268
+ appearance?: AppearanceConfig;
269
+ layout?: CheckoutLayout;
270
+ /** Payment component — collect shipping/billing address inline. */
271
+ collectAddress?: CollectAddressMode;
272
+ /** Address component — shipping vs billing labels. */
273
+ addressMode?: AddressMode;
274
+ collectName?: boolean;
275
+ fields?: ComponentFieldsConfig;
276
+ onReady?: (component: ComponentInstance) => void;
277
+ onChange?: (event: ComponentChangeEvent) => void;
278
+ onFocus?: () => void;
279
+ onBlur?: () => void;
280
+ onLoadError?: (error: WajubError | Record<string, unknown>) => void;
281
+ onSuccess?: (transaction: Record<string, unknown>) => void;
282
+ onError?: (error: WajubError | Record<string, unknown>) => void;
283
+ onMethodChange?: (payload: { methodId?: string }) => void;
284
+ }
285
+
286
+ export interface ComponentInstance {
287
+ mount(container: string | HTMLElement): ComponentInstance;
288
+ unmount(): void;
289
+ destroy(): void;
290
+ on(event: string, fn: (data?: unknown) => void): ComponentInstance;
291
+ off(event: string, fn: (data?: unknown) => void): ComponentInstance;
292
+ update(config: Partial<Pick<ComponentConfig, "locale" | "appearance" | "layout">>): ComponentInstance;
293
+ focus(): ComponentInstance;
294
+ blur(): ComponentInstance;
295
+ submit(): ComponentInstance;
296
+ selectMethod(methodId: string): ComponentInstance;
297
+ getState(): CheckoutState | string;
298
+ isComplete(): boolean;
299
+ getError(): WajubError | null;
300
+ /** Address component — current field values (also on `change.value`). */
301
+ getValue(): ComponentAddressValue | Record<string, unknown> | null;
302
+ }
303
+
304
+ export interface ComponentsFactory {
305
+ sessionId: string;
306
+ create(type: ComponentType, config?: Partial<ComponentConfig>): ComponentInstance;
307
+ }
308
+
309
+ export interface ConfirmPaymentOptions {
310
+ sessionId: string;
311
+ components?: ComponentInstance & { _paymentComponent?: ComponentInstance };
312
+ callback?: string;
313
+ }
314
+
315
+ export interface CreatePaymentParams {
316
+ amount: number;
317
+ currency: string;
318
+ reference?: string;
319
+ description?: string;
320
+ customer?: {
321
+ email?: string;
322
+ name?: string;
323
+ phone?: string;
324
+ country?: string;
325
+ };
326
+ bearer?: "merchant" | "customer";
327
+ /** URL HTTPS where the payer is redirected after payment (redirect flow). */
328
+ callback?: string;
329
+ metadata?: Record<string, string>;
330
+ }
331
+
332
+ export interface CreatePaymentResult {
333
+ sessionId: string;
334
+ authorizationToken: string;
335
+ authorizationUrl: string | null;
336
+ transaction: Record<string, unknown> | null;
337
+ raw: Record<string, unknown>;
338
+ }
339
+
340
+ export interface WajubInitOptions {
341
+ /** Existing session token from your backend (authorization_token). */
342
+ sessionId?: string;
343
+ /** Publishable key when using object form: Wajub({ publishableKey, sessionId }). */
344
+ publishableKey?: string;
345
+ /** @deprecated Alias for publishableKey */
346
+ apiKey?: string;
347
+ /** API origin (default baked at SDK build — https://api.wajub.com). */
348
+ apiBase?: string;
349
+ /** Full POST /payments URL override. */
350
+ paymentsUrl?: string;
351
+ /** Route via checkout BFF (/api/payments) — useful for local demos / CORS. */
352
+ useCheckoutProxy?: boolean;
353
+ componentOrigin?: string;
354
+ }
355
+
356
+ export interface InitCheckoutOptions extends Partial<EmbeddedConfig> {
357
+ mode?: "inline" | "overlay" | "redirect";
358
+ container?: string | HTMLElement;
359
+ /** Use an existing session — skips createPayment(). */
360
+ sessionId?: string;
361
+ payment?: CreatePaymentParams;
362
+ checkout?: Partial<EmbeddedConfig>;
363
+ }
364
+
365
+ export interface InitCheckoutResult {
366
+ session: CreatePaymentResult | { sessionId: string };
367
+ instance: CheckoutInstance | PopupInstance | null;
368
+ }
369
+
370
+ /** Wajub.js client — create a session (pk) and/or use an existing sessionId. */
371
+ export interface WajubClient {
372
+ publishableKey: string | null;
373
+ sessionId: string | null;
374
+ environment: "sandbox" | "live" | null;
375
+ apiBase: string;
376
+ checkoutOrigin: string;
377
+ useSession(sessionId: string): WajubClient;
378
+ createPayment(params: CreatePaymentParams): Promise<CreatePaymentResult>;
379
+ initCheckout(options: InitCheckoutOptions): Promise<InitCheckoutResult>;
380
+ fetchSession(sessionId?: string): Promise<SessionPreview>;
381
+ preload(sessionId?: string, options?: { iframe?: boolean }): void;
382
+ checkout(config?: Partial<EmbeddedConfig>): void;
383
+ mount(container: string | HTMLElement, config?: Partial<EmbeddedConfig>): CheckoutInstance;
384
+ open(config?: Partial<PopupConfig>): PopupInstance;
385
+ components(sessionIdOrConfig?: string | Partial<ComponentConfig>, config?: Partial<ComponentConfig>): ComponentsFactory;
386
+ confirmPayment(options?: ConfirmPaymentOptions): Promise<{ status: string; transaction?: Record<string, unknown> | null }>;
387
+ }
388
+
389
+ export interface WajubFactory {
390
+ (publishableKeyOrSessionId: string, options?: WajubInitOptions): WajubClient;
391
+ (options: WajubInitOptions): WajubClient;
392
+ session(sessionId: string, options?: WajubInitOptions): WajubClient;
393
+ parsePublishableKey(key: string): { key: string; environment: "sandbox" | "live" };
394
+ createPayment(
395
+ publishableKey: string,
396
+ params: CreatePaymentParams,
397
+ options?: WajubInitOptions,
398
+ ): Promise<CreatePaymentResult>;
399
+ }
400
+
401
+ export interface WajubSDK {
402
+ checkout(config: EmbeddedConfig): void;
403
+ mount(container: string | HTMLElement, config: EmbeddedConfig): CheckoutInstance;
404
+ open(config: PopupConfig): PopupInstance;
405
+ preload(sessionId: string, options?: { iframe?: boolean }): void;
406
+ fetchSession(sessionId: string): Promise<SessionPreview>;
407
+ components(sessionId: string, options?: Partial<ComponentConfig>): ComponentsFactory;
408
+ confirmPayment(options: ConfirmPaymentOptions): Promise<{ status: string }>;
409
+ /** @deprecated Removed in SDK 2.1 — use components or mount(). */
410
+ createHeadless(config: EmbeddedConfig): never;
411
+ /** Wajub(pk | sessionId | options) — session-bound client with createPayment + mount. */
412
+ create: WajubFactory;
413
+ version: string;
414
+ sdkMajor: string;
415
+ checkoutOrigin: string;
416
+ }
417
+
418
+ declare global {
419
+ interface Window {
420
+ wajub: WajubSDK;
421
+ Wajub: WajubFactory;
422
+ WajubError: typeof WajubError;
423
+ WajubPay: { create(opts: EmbeddedConfig & { container: string | HTMLElement }): unknown };
424
+ __WajubCheckoutCore?: unknown;
425
+ __WajubComponentsCore?: unknown;
426
+ __WajubAppearance?: unknown;
427
+ __WajubError?: unknown;
428
+ }
429
+ }
430
+
431
+ export {};
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ /*! @wajub/js v1.3.0 — loader only · runtime from https://js.wajub.com/wajub.js */
2
+ var _0x153f0c=_0x26b2;(function(_0x107680,_0x49e3bb){var _0x2348fb={_0x981496:0x14e,_0x4a3f62:0x132,_0x16663b:0x14b,_0x39cd7b:0x124,_0x139d30:0x113},_0x213dd3=_0x26b2,_0x2f0c37=_0x107680();while(!![]){try{var _0x4a6a30=-parseInt(_0x213dd3(0x133))/(0x65b*-0x1+0x1c04+-0x15a8)*(-parseInt(_0x213dd3(_0x2348fb._0x981496))/(0x21a8+0x2135*-0x1+-0x71))+parseInt(_0x213dd3(0x139))/(0x451*-0x8+-0xc1d+-0x2ea8*-0x1)+-parseInt(_0x213dd3(_0x2348fb._0x4a3f62))/(-0x1b44*0x1+-0x7e0*0x1+0x14*0x1c2)*(-parseInt(_0x213dd3(_0x2348fb._0x16663b))/(-0x2537+0x1fb4+-0x162*-0x4))+-parseInt(_0x213dd3(_0x2348fb._0x39cd7b))/(-0x8*-0x152+0x104+0x3a*-0x33)*(parseInt(_0x213dd3(0x10f))/(-0xaa6+-0x2165+0x1609*0x2))+parseInt(_0x213dd3(0x10a))/(-0x2588+-0x1580+0x3b10)*(-parseInt(_0x213dd3(_0x2348fb._0x139d30))/(-0x98b+0x556+0x43e))+parseInt(_0x213dd3(0x134))/(-0x1*-0x2ff+-0x6*-0x4ff+0x20ef*-0x1)+-parseInt(_0x213dd3(0x12a))/(-0x2186+-0xaf7+0xb22*0x4);if(_0x4a6a30===_0x49e3bb)break;else _0x2f0c37['push'](_0x2f0c37['shift']());}catch(_0x3fd0e5){_0x2f0c37['push'](_0x2f0c37['shift']());}}}(_0x427b,0x2*-0x573e5+0xc1*-0xa34+-0x1a*-0xf73d));var JS_ORIGIN=_0x153f0c(0x11b)+_0x153f0c(0x137)+_0x153f0c(0x10c),loadPromise=null,loadParameters={'jsOrigin':null,'jsUrl':null};function isBrowser(){var _0x273ded={_0x2856ce:0x118,_0x332597:0x117,_0x553f28:0x13d},_0xcab40f=_0x153f0c,_0x159dce={'gheKD':_0xcab40f(_0x273ded._0x2856ce)+'d','KCcaE':function(_0x305657,_0x29e5dc){return _0x305657!==_0x29e5dc;}};return typeof window!==_0x159dce[_0xcab40f(_0x273ded._0x332597)]&&_0x159dce[_0xcab40f(_0x273ded._0x553f28)](typeof document,'undefine'+'d');}function scriptReady(){return isBrowser()&&window['wajub']&&window['Wajub'];}function resolveScriptUrl(_0x10c2b0){var _0x2e7432={_0x440917:0x11e,_0x4731b1:0x129,_0x475e70:0x143},_0x26fbdc=_0x153f0c,_0xfe0a39={'etjGX':function(_0x665182,_0x4078fb){return _0x665182||_0x4078fb;},'abmOo':function(_0x40539e,_0x819885){return _0x40539e(_0x819885);}},_0x4c14d4=_0xfe0a39['etjGX'](_0x10c2b0,{}),_0x5993f8=_0x4c14d4['jsOrigin']||loadParameters['jsOrigin']||JS_ORIGIN;if(_0x4c14d4[_0x26fbdc(0x11e)]||loadParameters[_0x26fbdc(_0x2e7432._0x440917)])return _0x4c14d4[_0x26fbdc(0x11e)]||loadParameters[_0x26fbdc(0x11e)];return _0xfe0a39[_0x26fbdc(_0x2e7432._0x4731b1)](String,_0x5993f8)['replace'](/\/+$/,'')+(_0x26fbdc(_0x2e7432._0x475e70)+'s');}function injectScript(_0x88fa0b){var _0x34d2be={_0x27d9c7:0x14a},_0x441123={_0x2d0862:0x135,_0x339899:0x146,_0x508672:0x119,_0x51d7bf:0x11a,_0x5879b2:0x142,_0x420f8c:0x131,_0x2cae0e:0x14c},_0x53f700=_0x153f0c,_0x4c9161={'zNtCq':function(_0x5435e7,_0x5affe5){return _0x5435e7(_0x5affe5);},'yJeCt':_0x53f700(0x148)+_0x53f700(0x144)+_0x53f700(0x110),'gCAyC':function(_0x52ebb2){return _0x52ebb2();}};if(_0x4c9161[_0x53f700(0x135)](scriptReady))return Promise[_0x53f700(_0x34d2be._0x27d9c7)]();if(loadPromise)return loadPromise;return loadPromise=new Promise(function(_0x4b0783,_0x2db1f7){var _0x816972={_0x5a257d:0x13b},_0x11c445={_0x3ec295:0x122},_0x122519={_0x2b6ffa:0x136,_0x4d587e:0x13a},_0x434d18={_0x469c41:0x130},_0x190fe6=_0x53f700,_0x1eb971={'SvqlV':function(_0x49c4f0){return _0x49c4f0();},'cIzjL':function(_0x3c46c4,_0x1c8638){var _0x49c993=_0x26b2;return _0x4c9161[_0x49c993(0x136)](_0x3c46c4,_0x1c8638);},'mnlsI':function(_0x588447,_0x153ca8){return _0x588447+_0x153ca8;}},_0x177a79=document[_0x190fe6(0x111)+'ector']('script[data-wajub-js="true"]');if(_0x177a79){function _0x1c4137(){var _0x392f5c=_0x190fe6;if(_0x1eb971['SvqlV'](scriptReady))_0x4b0783();else _0x1eb971['cIzjL'](_0x2db1f7,new Error(_0x392f5c(0x148)+'\x20script\x20'+_0x392f5c(0x120)+_0x392f5c(0x10b)+'als\x20miss'+_0x392f5c(_0x434d18._0x469c41)));}if(_0x4c9161[_0x190fe6(_0x441123._0x2d0862)](scriptReady)){_0x4c9161['gCAyC'](_0x4b0783);return;}_0x177a79[_0x190fe6(0x12e)+'Listener'](_0x190fe6(0x149),_0x1c4137),_0x177a79['addEvent'+_0x190fe6(_0x441123._0x339899)](_0x190fe6(0x147),function(){var _0x3b0c0f=_0x190fe6;_0x4c9161[_0x3b0c0f(_0x122519._0x2b6ffa)](_0x2db1f7,new Error(_0x4c9161[_0x3b0c0f(_0x122519._0x4d587e)]));});return;}var _0x52a7df=document[_0x190fe6(_0x441123._0x508672)+_0x190fe6(_0x441123._0x51d7bf)](_0x190fe6(0x13f));_0x52a7df['src']=_0x88fa0b,_0x52a7df[_0x190fe6(0x11f)]=!![],_0x52a7df[_0x190fe6(_0x441123._0x5879b2)+'bute']('data-wajub-js',_0x190fe6(0x121)),_0x52a7df['onload']=function(){var _0x53a2e1=_0x190fe6;if(!scriptReady()){loadPromise=null,_0x2db1f7(new Error(_0x53a2e1(0x148)+_0x53a2e1(0x128)+_0x53a2e1(0x10b)+_0x53a2e1(_0x11c445._0x3ec295)+'ing'));return;}_0x4c9161[_0x53a2e1(0x135)](_0x4b0783);},_0x52a7df[_0x190fe6(_0x441123._0x420f8c)]=function(){var _0xcf44be=_0x190fe6;loadPromise=null,_0x2db1f7(new Error(_0x1eb971['mnlsI'](_0xcf44be(_0x816972._0x5a257d)+'o\x20load\x20W'+'ajub.js\x20'+_0xcf44be(0x150),_0x88fa0b)));},(document['head']||document[_0x190fe6(_0x441123._0x2cae0e)+_0x190fe6(0x12f)])[_0x190fe6(0x14f)+_0x190fe6(0x12b)](_0x52a7df);}),loadPromise;}export function loadWajub(_0x5c3996){var _0x253ace={_0x4518f2:0x14a},_0x4d8868=_0x153f0c,_0x8c72da={'LIhbh':function(_0x348d34,_0x5bce3b){return _0x348d34(_0x5bce3b);}};if(!isBrowser())return Promise[_0x4d8868(_0x253ace._0x4518f2)](null);return _0x8c72da['LIhbh'](injectScript,resolveScriptUrl(_0x5c3996))[_0x4d8868(0x115)](function(){var _0xa9e2e=_0x4d8868;return{'wajub':window['wajub'],'Wajub':window[_0xa9e2e(0x153)],'WajubError':window['WajubErr'+'or']};});}loadWajub[_0x153f0c(0x11d)+_0x153f0c(0x116)+'s']=function(_0x52e7c1){var _0x4ab160={_0x3baa86:0x151},_0xd085b6=_0x153f0c;loadParameters=Object[_0xd085b6(_0x4ab160._0x3baa86)]({},loadParameters,_0x52e7c1||{});};async function getRuntime(){return loadWajub();}export async function mount(_0x2445a6,_0x95717b){var _0x4741ff={_0x4986e3:0x125,_0x3d846e:0x112,_0x155ccc:0x114},_0x52ee46=_0x153f0c,_0x568095={'lDIXE':function(_0x296150){return _0x296150();}},_0x5badce=await _0x568095[_0x52ee46(_0x4741ff._0x4986e3)](getRuntime);if(!_0x5badce)return null;return _0x5badce[_0x52ee46(_0x4741ff._0x3d846e)][_0x52ee46(_0x4741ff._0x155ccc)](_0x2445a6,_0x95717b);}export async function open(_0x2ec8b4){var _0x33be1d={_0x363fbf:0x112},_0x5744a3=_0x153f0c,_0x244fec={'JtDUD':function(_0x2f8556){return _0x2f8556();}},_0x3824d9=await _0x244fec[_0x5744a3(0x11c)](getRuntime);if(!_0x3824d9)return null;return _0x3824d9[_0x5744a3(_0x33be1d._0x363fbf)]['open'](_0x2ec8b4);}function _0x427b(){var _0x229539=['CMvZB2X2zq','mJiZme1IswTfwa','zg9JDw1LBNq','yxLTzw50oIa','ota5ofDQz09PDG','yxbWzw5Kq2G','zNjVBsa','yxnZAwDU','B25SEq','v2fQDwi','ndbeDhrgsfe','yNv0igDSB2i','lMnVBq','CMvQzwn0','y29TCg9Uzw4','mtrJyNLLq1i','Dg8GBg9Hza','CxvLCNLtzwW','D2fQDwi','nZaYnJaZBLDotLLb','Bw91BNq','DgHLBG','yxjHBwv0zxi','z2HLs0q','Dw5KzwzPBMu','y3jLyxrLrwW','zw1LBNq','Ahr0Chm6lY8','sNrevuq','C2v0tg9Hzfa','ANnvCMW','yxn5BMm','ChjLC2vUDca','Dhj1zq','ywXZig1PC3m','y2HLy2TVDxq','odG1mdmWvM95Bgno','Berjweu','yxLTzw50','B3DZzxiGB24','igXVywrLzca','ywjTt28','mZu3ode2ogPVv1P2wq','AwXK','ChjLBg9Hza','zMv0y2Htzxm','ywrKrxzLBNq','rwXLBwvUDa','Aw5N','B25LCNjVCG','nta3mNfHB0nrEG','ndL0r3DyrfO','mJm5ntC2mhfAr2z3Aa','z0nbEum','EK50q3e','ANmUD2fQDwi','t3jPz2LU','mtiYodi5nLzNzuXoAG','EuPLq3q','rMfPBgvKihq','y29UzMLYBva','s0nJyuu','C2LVBJOGyNi','C2nYAxb0','tLHWsvO','y2f0y2G','C2v0qxr0CMK','l3DHANvIlMO','igzHAwXLzca','vhf2uLC','tgLZDgvUzxi','zxjYB3i','v2fQDwiUANm','Bg9Hza'];_0x427b=function(){return _0x229539;};return _0x427b();}export async function checkout(_0x1f9a40){var _0x59e981={_0x25b3f2:0x123},_0x55b527=_0x153f0c,_0x31e4d9=await getRuntime();if(!_0x31e4d9)return;return _0x31e4d9[_0x55b527(0x112)][_0x55b527(_0x59e981._0x25b3f2)](_0x1f9a40);}export async function preload(_0x1e75b1,_0x5add9f){var _0x1731bb={_0x48169a:0x12c},_0x62955d=_0x153f0c,_0x1e2df1={'cGonB':function(_0x1f29e7){return _0x1f29e7();}},_0x90b9cb=await _0x1e2df1['cGonB'](getRuntime);if(!_0x90b9cb)return;return _0x90b9cb['wajub'][_0x62955d(_0x1731bb._0x48169a)](_0x1e75b1,_0x5add9f);}export async function fetchSession(_0x47bf64){var _0x3a96e4={_0x50b6bb:0x127,_0x2fc863:0x112},_0x684632=_0x153f0c,_0x2a2016={'WhZxI':_0x684632(0x12d)+_0x684632(0x13e)+_0x684632(_0x3a96e4._0x50b6bb)+'ly'},_0x16d4f3=await getRuntime();if(!_0x16d4f3)return Promise[_0x684632(0x10d)](new Error(_0x2a2016['WhZxI']));return _0x16d4f3[_0x684632(_0x3a96e4._0x2fc863)]['fetchSes'+'sion'](_0x47bf64);}export async function components(_0x7e025c,_0x1406b7){var _0x4d6e28={_0x30da0b:0x10e},_0x18a84e=_0x153f0c,_0x4bee3a=await getRuntime();if(!_0x4bee3a)return null;return _0x4bee3a[_0x18a84e(0x112)][_0x18a84e(_0x4d6e28._0x30da0b)+'ts'](_0x7e025c,_0x1406b7);}function _0x26b2(_0x172b15,_0x524d6a){_0x172b15=_0x172b15-(-0x4*0x82f+0xcf6+0x14d0);var _0x27f3ec=_0x427b();var _0x1ee2d4=_0x27f3ec[_0x172b15];if(_0x26b2['hEAvTG']===undefined){var _0x15fb16=function(_0x4db491){var _0x5558a4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3f9095='',_0x2f8edb='';for(var _0x11fa0e=0x319*0x9+0x1*-0x24bf+-0x5*-0x1c6,_0x44a5dc,_0x4cc2f7,_0x183f6c=0xcda+0x4f7*0x2+-0x16c8;_0x4cc2f7=_0x4db491['charAt'](_0x183f6c++);~_0x4cc2f7&&(_0x44a5dc=_0x11fa0e%(-0x1ab1+-0x1d31+0x6*0x951)?_0x44a5dc*(0x2*-0xc66+-0xfc7+0x28d3)+_0x4cc2f7:_0x4cc2f7,_0x11fa0e++%(0x699+-0x48c+-0x209*0x1))?_0x3f9095+=String['fromCharCode'](-0x75*0x35+0x1ca1+-0x123*0x3&_0x44a5dc>>(-(0x2342+0xbb2*0x1+0x1*-0x2ef2)*_0x11fa0e&-0x1732+0x164e+0xea)):0xa2e+-0x501*-0x7+-0x2d35){_0x4cc2f7=_0x5558a4['indexOf'](_0x4cc2f7);}for(var _0x431dab=-0x126+-0x951*-0x1+-0x82b,_0x37ad43=_0x3f9095['length'];_0x431dab<_0x37ad43;_0x431dab++){_0x2f8edb+='%'+('00'+_0x3f9095['charCodeAt'](_0x431dab)['toString'](-0x14c4+0x1515+-0x41))['slice'](-(-0x91+-0x15*-0x1af+-0x2e6*0xc));}return decodeURIComponent(_0x2f8edb);};_0x26b2['VWNJIp']=_0x15fb16,_0x26b2['lgjGQD']={},_0x26b2['hEAvTG']=!![];}var _0x56a445=_0x27f3ec[0x73+-0x267a+0x2607],_0x46e157=_0x172b15+_0x56a445,_0xc08db1=_0x26b2['lgjGQD'][_0x46e157];return!_0xc08db1?(_0x1ee2d4=_0x26b2['VWNJIp'](_0x1ee2d4),_0x26b2['lgjGQD'][_0x46e157]=_0x1ee2d4):_0x1ee2d4=_0xc08db1,_0x1ee2d4;}export async function confirmPayment(_0x98f3e6){var _0x2220c7={_0x5d327b:0x145,_0x1faf64:0x152,_0x1bac98:0x112,_0x3e9904:0x13c},_0x5d3b53=_0x153f0c,_0x3f1cc2={'TqvRW':function(_0x57ff50){return _0x57ff50();}},_0x2ccd4a=await _0x3f1cc2[_0x5d3b53(_0x2220c7._0x5d327b)](getRuntime);if(!_0x2ccd4a)return Promise[_0x5d3b53(0x10d)](new Error(_0x5d3b53(0x13c)+_0x5d3b53(0x14d)+'browser\x20'+_0x5d3b53(_0x2220c7._0x1faf64)));return _0x2ccd4a[_0x5d3b53(_0x2220c7._0x1bac98)][_0x5d3b53(_0x2220c7._0x3e9904)+_0x5d3b53(0x126)](_0x98f3e6);}export async function getVersion(){var _0x4fe4a8=_0x153f0c,_0x2c29d0={'NXpIZ':function(_0x1a13ed){return _0x1a13ed();}},_0x8422ec=await _0x2c29d0[_0x4fe4a8(0x140)](getRuntime);return _0x8422ec?_0x8422ec[_0x4fe4a8(0x112)]['version']:null;}export async function getCheckoutOrigin(){var _0x43d56e={_0x1a8712:0x112},_0x2a3216=_0x153f0c,_0x3a8aee={'FAfol':function(_0x1fe324){return _0x1fe324();}},_0xdb4ddd=await _0x3a8aee['FAfol'](getRuntime);return _0xdb4ddd?_0xdb4ddd[_0x2a3216(_0x43d56e._0x1a8712)]['checkout'+_0x2a3216(0x138)]:null;}export default{'loadWajub':loadWajub,'mount':mount,'open':open,'checkout':checkout,'preload':preload,'fetchSession':fetchSession,'components':components,'confirmPayment':confirmPayment,'getVersion':getVersion,'getCheckoutOrigin':getCheckoutOrigin};typeof window!==_0x153f0c(0x118)+'d'&&loadWajub()[_0x153f0c(0x141)](function(){});