@twilltac/compliance-sdk 0.5.0 → 0.6.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.
@@ -1 +1 @@
1
- 29591325450-1
1
+ 30003827874-1
package/index.d.ts ADDED
@@ -0,0 +1,212 @@
1
+ declare enum CompliancePluginFlow {
2
+ JOURNEY = "journey",
3
+ HANDOVER = "handover"
4
+ }
5
+ declare enum PluginInitialisationSizing {
6
+ CONTAINER = "container",
7
+ CONTENT = "content"
8
+ }
9
+ declare enum CompliancePluginThemeAppearance {
10
+ LIGHT = "light",
11
+ DARK = "dark"
12
+ }
13
+ interface CompliancePluginTheme {
14
+ readonly appearance: CompliancePluginThemeAppearance;
15
+ }
16
+ interface CompliancePluginInitialisationData {
17
+ readonly workspaceSubdomain?: string;
18
+ readonly workspaceReference?: string;
19
+ readonly flow: CompliancePluginFlow;
20
+ readonly customerReference: string;
21
+ readonly offerReference: string;
22
+ readonly authToken: string;
23
+ readonly sizing: PluginInitialisationSizing;
24
+ readonly theme: CompliancePluginTheme;
25
+ }
26
+
27
+ interface InitialisationData {
28
+ readonly appInstanceId: string;
29
+ readonly documentHeight: number;
30
+ }
31
+ interface StandardPluginPostMessages {
32
+ ['window:resize']: {
33
+ payload: {
34
+ height: number;
35
+ };
36
+ };
37
+ ['theme:change']: {
38
+ payload: {
39
+ theme: CompliancePluginTheme;
40
+ };
41
+ };
42
+ ['navigation:start']: void;
43
+ ['navigation:end']: void;
44
+ ['initialisation:success']: {
45
+ payload: InitialisationData;
46
+ };
47
+ ['initialisation:error']: {
48
+ payload: {
49
+ error: Error;
50
+ };
51
+ response: {
52
+ error: Error;
53
+ };
54
+ };
55
+ }
56
+ interface SectionStartedEvent$1 {
57
+ readonly name: string;
58
+ readonly reference: string;
59
+ }
60
+ interface SectionEndedEvent$1 {
61
+ readonly name: string;
62
+ readonly reference: string;
63
+ readonly recommendations: ProductRecommendation[];
64
+ }
65
+ interface ProductRecommendation {
66
+ readonly externalReference: string;
67
+ readonly price: number | null;
68
+ readonly regulated: boolean;
69
+ readonly title: string;
70
+ readonly description: string;
71
+ }
72
+ interface ComplianceDocument {
73
+ readonly name: string;
74
+ readonly reference: string;
75
+ }
76
+ interface CompliancePluginPostMessages extends StandardPluginPostMessages {
77
+ ['session:expired-token']: void;
78
+ ['journey:started']: void;
79
+ ['journey:completed']: void;
80
+ ['journey.section:started']: {
81
+ payload: SectionStartedEvent$1;
82
+ };
83
+ ['journey.section:completed']: {
84
+ payload: SectionEndedEvent$1;
85
+ };
86
+ ['documents:loaded']: {
87
+ payload: ComplianceDocument[];
88
+ };
89
+ }
90
+
91
+ type EventHandler<T = unknown> = (data: T) => void;
92
+ type ExtractEventData<T> = T extends void ? void : T;
93
+
94
+ type MessageHandler<T = unknown> = (payload: T) => void;
95
+ type RequestHandler<TRequest = unknown, TResponse = unknown> = (payload: TRequest) => TResponse | Promise<TResponse>;
96
+ type ExtractPayload<T> = T extends {
97
+ payload: infer P;
98
+ } ? P : never;
99
+ type ExtractResponse<T> = T extends {
100
+ response: infer R;
101
+ } ? R : undefined;
102
+ type HasPayload<T> = T extends {
103
+ payload: unknown;
104
+ } ? true : false;
105
+ type SendArgs<T> = T extends {
106
+ payload: infer P;
107
+ } ? [payload: P] : [];
108
+ interface PostMessageBusOptions {
109
+ channel: string;
110
+ targetOrigin?: string;
111
+ targetWindow?: Window;
112
+ defaultTimeout?: number;
113
+ }
114
+ interface IPostMessageBus<TMessages = Record<string, {
115
+ payload: unknown;
116
+ response?: unknown;
117
+ }>> {
118
+ send<K extends keyof TMessages & string>(type: K, ...args: SendArgs<TMessages[K]>): void;
119
+ on<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): () => void;
120
+ off<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): void;
121
+ once<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): () => void;
122
+ request<K extends keyof TMessages & string>(type: K, ...args: HasPayload<TMessages[K]> extends true ? [payload: ExtractPayload<TMessages[K]>, timeout?: number] : [timeout?: number]): Promise<ExtractResponse<TMessages[K]>>;
123
+ onRequest<K extends keyof TMessages & string>(type: K, handler: RequestHandler<ExtractPayload<TMessages[K]>, ExtractResponse<TMessages[K]>>): () => void;
124
+ destroy(): void;
125
+ }
126
+
127
+ /** @internal */
128
+ declare class PostMessageBus<TMessages = Record<string, {
129
+ payload: unknown;
130
+ response?: unknown;
131
+ }>> implements IPostMessageBus<TMessages> {
132
+ private readonly _channel;
133
+ private readonly _targetOrigin;
134
+ private readonly _targetWindow;
135
+ private readonly _defaultTimeout;
136
+ private readonly _handlers;
137
+ private readonly _requestHandlers;
138
+ private readonly _pendingRequests;
139
+ private readonly _boundMessageHandler;
140
+ constructor(options: PostMessageBusOptions);
141
+ send<K extends keyof TMessages & string>(type: K, ...args: SendArgs<TMessages[K]>): void;
142
+ on<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): () => void;
143
+ off<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): void;
144
+ once<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): () => void;
145
+ request<K extends keyof TMessages & string>(type: K, ...args: HasPayload<TMessages[K]> extends true ? [payload: ExtractPayload<TMessages[K]>, timeout?: number] : [timeout?: number]): Promise<ExtractResponse<TMessages[K]>>;
146
+ onRequest<K extends keyof TMessages & string>(type: K, handler: RequestHandler<ExtractPayload<TMessages[K]>, ExtractResponse<TMessages[K]>>): () => void;
147
+ destroy(): void;
148
+ private handleMessage;
149
+ private handleResponse;
150
+ private handleRequest;
151
+ private sendResponse;
152
+ private generateCorrelationId;
153
+ }
154
+
155
+ interface SectionStartedEvent {
156
+ readonly name: string;
157
+ readonly reference: string;
158
+ }
159
+ interface SectionEndedEvent {
160
+ readonly name: string;
161
+ readonly reference: string;
162
+ readonly recommendations: {
163
+ readonly externalReference: string;
164
+ readonly price: number | null;
165
+ readonly regulated: boolean;
166
+ readonly title: string;
167
+ readonly description: string;
168
+ }[];
169
+ }
170
+ interface CompliancePluginEvents {
171
+ /** Emits when the user starts the journey and Initial Disclosure Document is generated. */
172
+ ['flow.journey.started']: void;
173
+ /** Emits when the user starts a section. */
174
+ ['flow.journey.section:started']: SectionStartedEvent;
175
+ /** Emits when the user completes the question set and submits their recommendations. */
176
+ ['flow.journey.section:completed']: SectionEndedEvent;
177
+ /** Emits when the user completes the journey and summary page is presented. */
178
+ ['flow.journey:completed']: void;
179
+ /** Emits when the session has expired. This would typically trigger your auth flow followed by re-initialising the plugin. */
180
+ ['session:expired']: void;
181
+ }
182
+
183
+ type WildcardHandler = (event: keyof CompliancePluginEvents & string, data: ExtractEventData<CompliancePluginEvents[keyof CompliancePluginEvents]>) => void;
184
+ interface CompliancePluginData {
185
+ postMessageBus: PostMessageBus<CompliancePluginPostMessages>;
186
+ initialisationData: InitialisationData;
187
+ initialisationOptions: CompliancePluginInitialisationData;
188
+ iframeElement: HTMLIFrameElement;
189
+ }
190
+ declare class CompliancePlugin {
191
+ private readonly _events;
192
+ private readonly _wildcardHandlers;
193
+ private readonly _postMessageBus;
194
+ private _theme;
195
+ constructor(opts: CompliancePluginData);
196
+ on(handler: WildcardHandler): () => void;
197
+ on<K extends keyof CompliancePluginEvents & string>(event: K, handler: EventHandler<ExtractEventData<CompliancePluginEvents[K]>>): () => void;
198
+ get theme(): CompliancePluginTheme;
199
+ setTheme(theme: CompliancePluginTheme): void;
200
+ destroy(): void;
201
+ }
202
+
203
+ interface InitialisationOptions {
204
+ readonly containerElement: HTMLElement;
205
+ readonly data: Omit<CompliancePluginInitialisationData, 'sizing' | 'theme'> & {
206
+ readonly sizing?: PluginInitialisationSizing;
207
+ readonly theme?: CompliancePluginTheme;
208
+ };
209
+ }
210
+ declare function createCompliancePlugin(options: InitialisationOptions): Promise<CompliancePlugin>;
211
+
212
+ export { CompliancePlugin, createCompliancePlugin };
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@twilltac/compliance-sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
- "main": "./src/index.js",
6
- "types": "./src/index.d.ts",
5
+ "main": "./index.cjs",
6
+ "module": "./index.js",
7
+ "types": "./index.d.ts",
7
8
  "dependencies": {}
8
9
  }
@@ -1,2 +0,0 @@
1
- export { CompliancePlugin } from './lib/compliance.plugin';
2
- export { createCompliancePlugin } from './lib/create-compliance.plugin';
@@ -1,28 +0,0 @@
1
- interface SectionStartedEvent {
2
- readonly name: string;
3
- readonly reference: string;
4
- }
5
- interface SectionEndedEvent {
6
- readonly name: string;
7
- readonly reference: string;
8
- readonly recommendations: {
9
- readonly externalReference: string;
10
- readonly price: number | null;
11
- readonly regulated: boolean;
12
- readonly title: string;
13
- readonly description: string;
14
- }[];
15
- }
16
- export interface CompliancePluginEvents {
17
- /** Emits when the user starts the journey and Initial Disclosure Document is generated. */
18
- ['flow.journey.started']: void;
19
- /** Emits when the user starts a section. */
20
- ['flow.journey.section:started']: SectionStartedEvent;
21
- /** Emits when the user completes the question set and submits their recommendations. */
22
- ['flow.journey.section:completed']: SectionEndedEvent;
23
- /** Emits when the user completes the journey and summary page is presented. */
24
- ['flow.journey:completed']: void;
25
- /** Emits when the session has expired. This would typically trigger your auth flow followed by re-initialising the plugin. */
26
- ['session:expired']: void;
27
- }
28
- export {};
@@ -1,24 +0,0 @@
1
- import { CompliancePluginInitialisationData, CompliancePluginPostMessages, CompliancePluginTheme, InitialisationData } from '@twilltac/compliance-plugin-types';
2
- import { EventHandler, ExtractEventData } from '@twilltac/plugin-skd-event-emitter';
3
- import { PostMessageBus } from '@twilltac/plugin-skd-post-messenger';
4
- import { CompliancePluginEvents } from './compliance-plugin.events';
5
- type WildcardHandler = (event: keyof CompliancePluginEvents & string, data: ExtractEventData<CompliancePluginEvents[keyof CompliancePluginEvents]>) => void;
6
- interface CompliancePluginData {
7
- postMessageBus: PostMessageBus<CompliancePluginPostMessages>;
8
- initialisationData: InitialisationData;
9
- initialisationOptions: CompliancePluginInitialisationData;
10
- iframeElement: HTMLIFrameElement;
11
- }
12
- export declare class CompliancePlugin {
13
- private readonly _events;
14
- private readonly _wildcardHandlers;
15
- private readonly _postMessageBus;
16
- private _theme;
17
- constructor(opts: CompliancePluginData);
18
- on(handler: WildcardHandler): () => void;
19
- on<K extends keyof CompliancePluginEvents & string>(event: K, handler: EventHandler<ExtractEventData<CompliancePluginEvents[K]>>): () => void;
20
- get theme(): CompliancePluginTheme;
21
- setTheme(theme: CompliancePluginTheme): void;
22
- destroy(): void;
23
- }
24
- export {};
@@ -1,11 +0,0 @@
1
- import { CompliancePluginInitialisationData, CompliancePluginTheme, PluginInitialisationSizing } from '@twilltac/compliance-plugin-types';
2
- import { CompliancePlugin } from './compliance.plugin';
3
- interface InitialisationOptions {
4
- readonly containerElement: HTMLElement;
5
- readonly data: Omit<CompliancePluginInitialisationData, 'sizing' | 'theme'> & {
6
- readonly sizing?: PluginInitialisationSizing;
7
- readonly theme?: CompliancePluginTheme;
8
- };
9
- }
10
- export declare function createCompliancePlugin(options: InitialisationOptions): Promise<CompliancePlugin>;
11
- export {};
@@ -1,2 +0,0 @@
1
- export * from './lib/compliance-plugin-initialisation.data';
2
- export * from './lib/compliance-plugin-post.messages';
@@ -1,25 +0,0 @@
1
- export declare enum CompliancePluginFlow {
2
- JOURNEY = "journey",
3
- HANDOVER = "handover"
4
- }
5
- export declare enum PluginInitialisationSizing {
6
- CONTAINER = "container",
7
- CONTENT = "content"
8
- }
9
- export declare enum CompliancePluginThemeAppearance {
10
- LIGHT = "light",
11
- DARK = "dark"
12
- }
13
- export interface CompliancePluginTheme {
14
- readonly appearance: CompliancePluginThemeAppearance;
15
- }
16
- export interface CompliancePluginInitialisationData {
17
- readonly workspaceSubdomain?: string;
18
- readonly workspaceReference?: string;
19
- readonly flow: CompliancePluginFlow;
20
- readonly customerReference: string;
21
- readonly offerReference: string;
22
- readonly authToken: string;
23
- readonly sizing: PluginInitialisationSizing;
24
- readonly theme: CompliancePluginTheme;
25
- }
@@ -1,65 +0,0 @@
1
- import { CompliancePluginTheme } from './compliance-plugin-initialisation.data';
2
- export interface InitialisationData {
3
- readonly appInstanceId: string;
4
- readonly documentHeight: number;
5
- }
6
- export interface StandardPluginPostMessages {
7
- ['window:resize']: {
8
- payload: {
9
- height: number;
10
- };
11
- };
12
- ['theme:change']: {
13
- payload: {
14
- theme: CompliancePluginTheme;
15
- };
16
- };
17
- ['navigation:start']: void;
18
- ['navigation:end']: void;
19
- ['initialisation:success']: {
20
- payload: InitialisationData;
21
- };
22
- ['initialisation:error']: {
23
- payload: {
24
- error: Error;
25
- };
26
- response: {
27
- error: Error;
28
- };
29
- };
30
- }
31
- interface SectionStartedEvent {
32
- readonly name: string;
33
- readonly reference: string;
34
- }
35
- interface SectionEndedEvent {
36
- readonly name: string;
37
- readonly reference: string;
38
- readonly recommendations: ProductRecommendation[];
39
- }
40
- interface ProductRecommendation {
41
- readonly externalReference: string;
42
- readonly price: number | null;
43
- readonly regulated: boolean;
44
- readonly title: string;
45
- readonly description: string;
46
- }
47
- interface ComplianceDocument {
48
- readonly name: string;
49
- readonly reference: string;
50
- }
51
- export interface CompliancePluginPostMessages extends StandardPluginPostMessages {
52
- ['session:expired-token']: void;
53
- ['journey:started']: void;
54
- ['journey:completed']: void;
55
- ['journey.section:started']: {
56
- payload: SectionStartedEvent;
57
- };
58
- ['journey.section:completed']: {
59
- payload: SectionEndedEvent;
60
- };
61
- ['documents:loaded']: {
62
- payload: ComplianceDocument[];
63
- };
64
- }
65
- export {};
@@ -1,3 +0,0 @@
1
- export { NoopPostMessageBus } from './lib/noop-post-message.bus';
2
- export type { ExtractPayload, HasPayload, IPostMessageBus } from './lib/post-message-bus.interface';
3
- export { PostMessageBus } from './lib/post-message.bus';
@@ -1,13 +0,0 @@
1
- import { ExtractPayload, ExtractResponse, HasPayload, IPostMessageBus, MessageHandler, SendArgs } from './post-message-bus.interface';
2
- export declare class NoopPostMessageBus<TMessages = Record<string, {
3
- payload: unknown;
4
- response?: unknown;
5
- }>> implements IPostMessageBus<TMessages> {
6
- send<K extends keyof TMessages & string>(_type: K, ..._args: SendArgs<TMessages[K]>): void;
7
- on<K extends keyof TMessages & string>(_type: K, _handler: MessageHandler<ExtractPayload<TMessages[K]>>): () => void;
8
- off<K extends keyof TMessages & string>(_type: K, _handler: MessageHandler<ExtractPayload<TMessages[K]>>): void;
9
- once<K extends keyof TMessages & string>(_type: K, _handler: MessageHandler<ExtractPayload<TMessages[K]>>): () => void;
10
- request<K extends keyof TMessages & string>(_type: K, ..._args: HasPayload<TMessages[K]> extends true ? [payload: ExtractPayload<TMessages[K]>, timeout?: number] : [timeout?: number]): Promise<ExtractResponse<TMessages[K]>>;
11
- onRequest(): () => void;
12
- destroy(): void;
13
- }
@@ -1,45 +0,0 @@
1
- export type MessageHandler<T = unknown> = (payload: T) => void;
2
- export type RequestHandler<TRequest = unknown, TResponse = unknown> = (payload: TRequest) => TResponse | Promise<TResponse>;
3
- export type ExtractPayload<T> = T extends {
4
- payload: infer P;
5
- } ? P : never;
6
- export type ExtractResponse<T> = T extends {
7
- response: infer R;
8
- } ? R : undefined;
9
- export type HasPayload<T> = T extends {
10
- payload: unknown;
11
- } ? true : false;
12
- export type SendArgs<T> = T extends {
13
- payload: infer P;
14
- } ? [payload: P] : [];
15
- export interface PostMessageEnvelope<T = unknown> {
16
- channel: string;
17
- type: string;
18
- payload: T;
19
- correlationId?: string;
20
- isResponse?: boolean;
21
- isError?: boolean;
22
- }
23
- export interface PendingRequest<T> {
24
- resolve: (value: T) => void;
25
- reject: (reason: unknown) => void;
26
- timeoutId: ReturnType<typeof setTimeout>;
27
- }
28
- export interface PostMessageBusOptions {
29
- channel: string;
30
- targetOrigin?: string;
31
- targetWindow?: Window;
32
- defaultTimeout?: number;
33
- }
34
- export interface IPostMessageBus<TMessages = Record<string, {
35
- payload: unknown;
36
- response?: unknown;
37
- }>> {
38
- send<K extends keyof TMessages & string>(type: K, ...args: SendArgs<TMessages[K]>): void;
39
- on<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): () => void;
40
- off<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): void;
41
- once<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): () => void;
42
- request<K extends keyof TMessages & string>(type: K, ...args: HasPayload<TMessages[K]> extends true ? [payload: ExtractPayload<TMessages[K]>, timeout?: number] : [timeout?: number]): Promise<ExtractResponse<TMessages[K]>>;
43
- onRequest<K extends keyof TMessages & string>(type: K, handler: RequestHandler<ExtractPayload<TMessages[K]>, ExtractResponse<TMessages[K]>>): () => void;
44
- destroy(): void;
45
- }
@@ -1,28 +0,0 @@
1
- import { ExtractPayload, ExtractResponse, HasPayload, IPostMessageBus, MessageHandler, PostMessageBusOptions, RequestHandler, SendArgs } from './post-message-bus.interface';
2
- /** @internal */
3
- export declare class PostMessageBus<TMessages = Record<string, {
4
- payload: unknown;
5
- response?: unknown;
6
- }>> implements IPostMessageBus<TMessages> {
7
- private readonly _channel;
8
- private readonly _targetOrigin;
9
- private readonly _targetWindow;
10
- private readonly _defaultTimeout;
11
- private readonly _handlers;
12
- private readonly _requestHandlers;
13
- private readonly _pendingRequests;
14
- private readonly _boundMessageHandler;
15
- constructor(options: PostMessageBusOptions);
16
- send<K extends keyof TMessages & string>(type: K, ...args: SendArgs<TMessages[K]>): void;
17
- on<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): () => void;
18
- off<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): void;
19
- once<K extends keyof TMessages & string>(type: K, handler: MessageHandler<ExtractPayload<TMessages[K]>>): () => void;
20
- request<K extends keyof TMessages & string>(type: K, ...args: HasPayload<TMessages[K]> extends true ? [payload: ExtractPayload<TMessages[K]>, timeout?: number] : [timeout?: number]): Promise<ExtractResponse<TMessages[K]>>;
21
- onRequest<K extends keyof TMessages & string>(type: K, handler: RequestHandler<ExtractPayload<TMessages[K]>, ExtractResponse<TMessages[K]>>): () => void;
22
- destroy(): void;
23
- private handleMessage;
24
- private handleResponse;
25
- private handleRequest;
26
- private sendResponse;
27
- private generateCorrelationId;
28
- }
@@ -1,2 +0,0 @@
1
- export * from './lib/typed-event-emitter';
2
- export * from './lib/typed-event-emitter.interface';
@@ -1,11 +0,0 @@
1
- import { EventHandler, ExtractEventData, ITypedEventEmitter, OptionalIfVoid } from './typed-event-emitter.interface';
2
- export declare class TypedEventEmitter<TEvents = Record<string, {
3
- data: unknown;
4
- }>> implements ITypedEventEmitter<TEvents> {
5
- private readonly _handlers;
6
- on<K extends keyof TEvents & string>(event: K, handler: EventHandler<ExtractEventData<TEvents[K]>>): () => void;
7
- off<K extends keyof TEvents & string>(event: K, handler: EventHandler<ExtractEventData<TEvents[K]>>): void;
8
- once<K extends keyof TEvents & string>(event: K, handler: EventHandler<ExtractEventData<TEvents[K]>>): () => void;
9
- emit<K extends keyof TEvents & string>(event: K, ...args: OptionalIfVoid<ExtractEventData<TEvents[K]>>): void;
10
- clear(): void;
11
- }
@@ -1,11 +0,0 @@
1
- export type EventHandler<T = unknown> = (data: T) => void;
2
- export type ExtractEventData<T> = T extends void ? void : T;
3
- export type OptionalIfVoid<T> = T extends void ? [] : [data: T];
4
- export interface ITypedEventEmitter<TEvents = Record<string, {
5
- data: unknown;
6
- }>> {
7
- on<K extends keyof TEvents & string>(event: K, handler: EventHandler<ExtractEventData<TEvents[K]>>): () => void;
8
- off<K extends keyof TEvents & string>(event: K, handler: EventHandler<ExtractEventData<TEvents[K]>>): void;
9
- once<K extends keyof TEvents & string>(event: K, handler: EventHandler<ExtractEventData<TEvents[K]>>): () => void;
10
- emit<K extends keyof TEvents & string>(event: K, ...args: OptionalIfVoid<ExtractEventData<TEvents[K]>>): void;
11
- }