@picked/client 0.0.50 → 0.0.51-next.10
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/api-CHy9HcU7.cjs +1 -0
- package/dist/{api-DWBcrf98.js → api-mlYS-lDj.js} +1 -1
- package/dist/cjs/form/index.js +1 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/form/index.js +472 -0
- package/dist/esm/index.js +473 -383
- package/dist/esm/plugins/create-experience/index.js +198 -165
- package/dist/esm/plugins/dynamic-experiences/index.js +52 -30
- package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
- package/dist/esm/plugins/history-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +7 -9
- package/dist/esm/plugins/responses-indexeddb/index.js +11 -11
- package/dist/esm/plugins/single-page-app/index.js +4 -4
- package/dist/esm/server/index.js +1 -1
- package/dist/experience-instance-DOcd8XI1.cjs +1 -0
- package/dist/experience-instance-NHU1moID.js +486 -0
- package/dist/{object-Clj5zVr1.js → object-C82v79xc.js} +2 -1
- package/dist/object-CUJOjanb.cjs +1 -0
- package/dist/rules-logic-CnVktz2l.js +240 -0
- package/dist/rules-logic-nMHNVLn7.cjs +1 -0
- package/dist/{storage-DyxpJ0pg.js → storage-6Xk0uAxB.js} +3 -1
- package/dist/storage-B6lQtc4-.cjs +1 -0
- package/dist/types/client.d.ts +47 -43
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/action/action.d.ts +37 -5
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/condition/condition.d.ts +20 -0
- package/dist/types/entities/condition/condition.d.ts.map +1 -0
- package/dist/types/entities/experience/experience.d.ts +67 -51
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +22 -2
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +24 -10
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/response/response-validation.d.ts +74 -0
- package/dist/types/entities/response/response-validation.d.ts.map +1 -0
- package/dist/types/entities/response/response.d.ts +24 -20
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/entities/step/step.d.ts +42 -0
- package/dist/types/entities/step/step.d.ts.map +1 -0
- package/dist/types/exports.d.ts +0 -1
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/form/build-responses.d.ts +17 -0
- package/dist/types/form/build-responses.d.ts.map +1 -0
- package/dist/types/form/create-field-evaluator.d.ts +27 -0
- package/dist/types/form/create-field-evaluator.d.ts.map +1 -0
- package/dist/types/form/create-field-validation.d.ts +59 -0
- package/dist/types/form/create-field-validation.d.ts.map +1 -0
- package/dist/types/form/create-form.d.ts +97 -0
- package/dist/types/form/create-form.d.ts.map +1 -0
- package/dist/types/form/create-submit-pipeline.d.ts +70 -0
- package/dist/types/form/create-submit-pipeline.d.ts.map +1 -0
- package/dist/types/form/get-step-fields.d.ts +18 -0
- package/dist/types/form/get-step-fields.d.ts.map +1 -0
- package/dist/types/form/index.d.ts +10 -0
- package/dist/types/form/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +12 -10
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +99 -33
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +53 -31
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +2 -2
- package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +21 -4
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +45 -0
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +2 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -0
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +2 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +0 -3
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +2 -2
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +0 -1
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +2 -1
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +16 -0
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts.map +1 -0
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +2 -2
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/object.d.ts +0 -8
- package/dist/types/utils/object.d.ts.map +1 -1
- package/dist/types/utils/picked-config.d.ts +1 -1
- package/dist/types/utils/picked-config.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts +31 -0
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/dist/types/utils/search-params.d.ts.map +1 -1
- package/dist/types/utils/state-snaphot.d.ts +11 -1
- package/dist/types/utils/state-snaphot.d.ts.map +1 -1
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/package.json +43 -7
- package/dist/api-BwTaomem.cjs +0 -1
- package/dist/experience-instance-BRpI9I4s.js +0 -710
- package/dist/experience-instance-BUTnwbSJ.cjs +0 -1
- package/dist/object-BReQiaSS.cjs +0 -1
- package/dist/storage-BFjb8azI.cjs +0 -1
- package/dist/types/entities/project/project.d.ts +0 -9
- package/dist/types/entities/project/project.d.ts.map +0 -1
- package/dist/types/utils/get-step-fields.d.ts +0 -4
- package/dist/types/utils/get-step-fields.d.ts.map +0 -1
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts +0 -3
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts.map +0 -1
- /package/dist/{id-CIbS4P60.cjs → id-Bv44ilEo.cjs} +0 -0
- /package/dist/{id-BniPxOdF.js → id-CRqy981z.js} +0 -0
package/dist/types/picked.d.ts
CHANGED
|
@@ -8,14 +8,15 @@ import { Predicate } from './entities/predicate/predicate';
|
|
|
8
8
|
import { Feature } from './entities/feature/feature';
|
|
9
9
|
import { EventBusPayload, EventHistoryStore } from './utils/events';
|
|
10
10
|
import { Field } from './entities/field/field';
|
|
11
|
+
import { ExperienceStep } from './entities/step/step';
|
|
11
12
|
import { Action } from './entities/action/action';
|
|
13
|
+
import { Condition } from './entities/condition/condition';
|
|
12
14
|
import { SessionStore } from './utils/user-session';
|
|
13
15
|
import { LogicRule } from './logic-engine';
|
|
14
16
|
export declare class Picked {
|
|
15
17
|
static readonly logger: (level: "log" | "warn" | "info" | "error", ...args: Parameters<Console["log"]>) => void;
|
|
16
18
|
private readonly options;
|
|
17
19
|
isReady: boolean;
|
|
18
|
-
private project?;
|
|
19
20
|
private readonly plugins;
|
|
20
21
|
private readonly pluginStartHooks;
|
|
21
22
|
readonly eventBus: import('effector').EventCallable<EventBusPayload>;
|
|
@@ -29,7 +30,7 @@ export declare class Picked {
|
|
|
29
30
|
readonly precondition?: LogicRule | boolean;
|
|
30
31
|
readonly condition?: LogicRule | boolean;
|
|
31
32
|
preconditionPassed?: boolean;
|
|
32
|
-
readonly searchParams: import('
|
|
33
|
+
readonly searchParams: import('.').PickedSearchParams;
|
|
33
34
|
readonly history: {
|
|
34
35
|
push: import('effector').EventCallable<{
|
|
35
36
|
experienceId: string;
|
|
@@ -61,6 +62,7 @@ export declare class Picked {
|
|
|
61
62
|
};
|
|
62
63
|
readonly experienceInstances: {
|
|
63
64
|
spawn: (experience: import('.').ExperienceStore, target: HTMLElement, options?: LaunchExperienceOptions) => void;
|
|
65
|
+
getByExperienceKey: (key: Experience["key"]) => import('effector').Store<import('.').ExperienceInstance[]>;
|
|
64
66
|
getByExperienceId: (id: Experience["id"]) => import('effector').Store<import('.').ExperienceInstance[]>;
|
|
65
67
|
listStore: import('effector').Store<import('.').ExperienceInstance[]>;
|
|
66
68
|
};
|
|
@@ -68,6 +70,8 @@ export declare class Picked {
|
|
|
68
70
|
register: (experience: Experience) => void;
|
|
69
71
|
get: (id: Experience["id"]) => import('effector').Store<{
|
|
70
72
|
id: string;
|
|
73
|
+
key: string;
|
|
74
|
+
name: string;
|
|
71
75
|
configStore: import('effector').Store<{
|
|
72
76
|
name: string;
|
|
73
77
|
decisionLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
@@ -75,12 +79,11 @@ export declare class Picked {
|
|
|
75
79
|
initializeOpenLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
76
80
|
}>;
|
|
77
81
|
treeStore: import('effector').Store<{
|
|
78
|
-
steps:
|
|
82
|
+
steps: ExperienceStep[];
|
|
79
83
|
nodes: import('.').ExperienceNode[];
|
|
80
84
|
edges: import('.').ExperienceEdge[];
|
|
81
|
-
|
|
85
|
+
conditions: Condition[];
|
|
82
86
|
}>;
|
|
83
|
-
fieldsStore: import('effector').Store<Field[]>;
|
|
84
87
|
componentStore: import('effector').Store<{
|
|
85
88
|
name: string;
|
|
86
89
|
component: AdaptedComponent<string, unknown>;
|
|
@@ -94,6 +97,8 @@ export declare class Picked {
|
|
|
94
97
|
} | undefined>;
|
|
95
98
|
getById: (id: Experience["id"]) => import('effector').Store<{
|
|
96
99
|
id: string;
|
|
100
|
+
key: string;
|
|
101
|
+
name: string;
|
|
97
102
|
configStore: import('effector').Store<{
|
|
98
103
|
name: string;
|
|
99
104
|
decisionLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
@@ -101,12 +106,11 @@ export declare class Picked {
|
|
|
101
106
|
initializeOpenLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
102
107
|
}>;
|
|
103
108
|
treeStore: import('effector').Store<{
|
|
104
|
-
steps:
|
|
109
|
+
steps: ExperienceStep[];
|
|
105
110
|
nodes: import('.').ExperienceNode[];
|
|
106
111
|
edges: import('.').ExperienceEdge[];
|
|
107
|
-
|
|
112
|
+
conditions: Condition[];
|
|
108
113
|
}>;
|
|
109
|
-
fieldsStore: import('effector').Store<Field[]>;
|
|
110
114
|
componentStore: import('effector').Store<{
|
|
111
115
|
name: string;
|
|
112
116
|
component: AdaptedComponent<string, unknown>;
|
|
@@ -118,16 +122,25 @@ export declare class Picked {
|
|
|
118
122
|
strategy: "override";
|
|
119
123
|
}>;
|
|
120
124
|
} | undefined>;
|
|
125
|
+
getByKey: (key: Experience["key"]) => import('effector').Store<import('.').ExperienceStore | undefined>;
|
|
121
126
|
launch: import('effector').Effect<{
|
|
127
|
+
key: string;
|
|
128
|
+
options?: LaunchExperienceOptions;
|
|
129
|
+
} | {
|
|
122
130
|
id: string;
|
|
123
131
|
options?: LaunchExperienceOptions;
|
|
124
132
|
}, void, Error>;
|
|
125
133
|
open: import('effector').Effect<{
|
|
134
|
+
key: string;
|
|
135
|
+
options?: import('./exports').OpenExperienceOptions;
|
|
136
|
+
} | {
|
|
126
137
|
id: string;
|
|
127
138
|
options?: import('./exports').OpenExperienceOptions;
|
|
128
139
|
}, void, Error>;
|
|
129
140
|
listStore: import('effector').Store<{
|
|
130
141
|
id: string;
|
|
142
|
+
key: string;
|
|
143
|
+
name: string;
|
|
131
144
|
configStore: import('effector').Store<{
|
|
132
145
|
name: string;
|
|
133
146
|
decisionLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
@@ -135,12 +148,11 @@ export declare class Picked {
|
|
|
135
148
|
initializeOpenLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
136
149
|
}>;
|
|
137
150
|
treeStore: import('effector').Store<{
|
|
138
|
-
steps:
|
|
151
|
+
steps: ExperienceStep[];
|
|
139
152
|
nodes: import('.').ExperienceNode[];
|
|
140
153
|
edges: import('.').ExperienceEdge[];
|
|
141
|
-
|
|
154
|
+
conditions: Condition[];
|
|
142
155
|
}>;
|
|
143
|
-
fieldsStore: import('effector').Store<Field[]>;
|
|
144
156
|
componentStore: import('effector').Store<{
|
|
145
157
|
name: string;
|
|
146
158
|
component: AdaptedComponent<string, unknown>;
|
|
@@ -174,10 +186,27 @@ export declare class Picked {
|
|
|
174
186
|
listStore: import('effector').Store<import('.').FeatureBucket[]>;
|
|
175
187
|
getEvokableFeature: (featureName: string) => import('effector').Store<() => Promise<boolean | string | undefined>>;
|
|
176
188
|
};
|
|
189
|
+
readonly conditions: {
|
|
190
|
+
register: (condition: Condition) => void;
|
|
191
|
+
getById: (id: Condition["id"]) => import('effector').Store<Condition | null>;
|
|
192
|
+
getByKey: (key: Condition["key"]) => import('effector').Store<Condition | null>;
|
|
193
|
+
listStore: import('effector').Store<Condition[]>;
|
|
194
|
+
indexStore: import('effector').StoreWritable<{
|
|
195
|
+
[id: string]: Condition;
|
|
196
|
+
}>;
|
|
197
|
+
};
|
|
198
|
+
readonly fields: {
|
|
199
|
+
register: (field: Field) => void;
|
|
200
|
+
update: (key: import('.').FieldBase["key"], updates: Partial<Field>) => void;
|
|
201
|
+
getById: (id: import('.').FieldBase["id"]) => import('effector').Store<Field | null>;
|
|
202
|
+
getByKey: (key: import('.').FieldBase["key"]) => import('effector').Store<Field | null>;
|
|
203
|
+
listStore: import('effector').Store<Field[]>;
|
|
204
|
+
getByName: (name: import('.').FieldBase["name"]) => import('effector').Store<Field | null>;
|
|
205
|
+
};
|
|
177
206
|
readonly responses: {
|
|
178
207
|
register: {
|
|
179
|
-
(
|
|
180
|
-
(payload: Record<Field["
|
|
208
|
+
(fieldKey: Field["key"], response: import('.').Response): void;
|
|
209
|
+
(payload: Record<Field["key"], import('.').Response>, response?: never): void;
|
|
181
210
|
};
|
|
182
211
|
clearAll: import('effector').EventCallable<void>;
|
|
183
212
|
clear: import('effector').EventCallable<string>;
|
|
@@ -189,30 +218,30 @@ export declare class Picked {
|
|
|
189
218
|
validationErrors: import('.').ValidationError[];
|
|
190
219
|
}>;
|
|
191
220
|
listStore: import('effector').Store<{
|
|
192
|
-
|
|
193
|
-
value: import('.').FieldValue
|
|
221
|
+
fieldKey: string;
|
|
222
|
+
value: import('.').FieldValue;
|
|
194
223
|
}[]>;
|
|
195
224
|
getAllStore: import('effector').Store<{
|
|
196
|
-
[
|
|
225
|
+
[fieldKey: string]: import('.').FieldValue;
|
|
197
226
|
}>;
|
|
198
|
-
getByFieldId:
|
|
199
|
-
|
|
200
|
-
<T extends import('.').JsonValue>(fieldId: Field["id"]): import('effector').Store<T | null>;
|
|
201
|
-
};
|
|
227
|
+
getByFieldId: (id: Field["id"]) => import('effector').Store<import('.').FieldValue>;
|
|
228
|
+
getByFieldKey: (key: Field["key"]) => import('effector').Store<import('.').FieldValue>;
|
|
202
229
|
getByFieldName: (fieldName: Field["name"]) => import('effector').Store<import('.').FieldValue>;
|
|
203
230
|
};
|
|
204
|
-
readonly
|
|
205
|
-
register: (
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
listStore: import('effector').Store<
|
|
209
|
-
|
|
231
|
+
readonly steps: {
|
|
232
|
+
register: (step: ExperienceStep) => void;
|
|
233
|
+
getById: (id: ExperienceStep["id"]) => import('effector').Store<ExperienceStep | null>;
|
|
234
|
+
getByKey: (key: ExperienceStep["key"]) => import('effector').Store<ExperienceStep | null>;
|
|
235
|
+
listStore: import('effector').Store<ExperienceStep[]>;
|
|
236
|
+
indexStore: import('effector').StoreWritable<{
|
|
237
|
+
[id: string]: ExperienceStep;
|
|
238
|
+
}>;
|
|
210
239
|
};
|
|
211
240
|
readonly actions: {
|
|
212
241
|
register: (name: string, action: Action) => void;
|
|
213
|
-
getByName: (name: string) => import('effector').Store<
|
|
242
|
+
getByName: (name: string) => import('effector').Store<Action | undefined>;
|
|
214
243
|
listStore: import('effector').Store<import('.').ActionIndexItem[]>;
|
|
215
|
-
getEvokableAction: (actionName: string) => import('effector').Store<(
|
|
244
|
+
getEvokableAction: (actionName: string) => import('effector').Store<() => ReturnType<Action>>;
|
|
216
245
|
};
|
|
217
246
|
constructor(options: CreateClientOptions);
|
|
218
247
|
start: () => void;
|
|
@@ -221,14 +250,54 @@ export declare class Picked {
|
|
|
221
250
|
registerPlugin: (plugin: Plugin) => void;
|
|
222
251
|
registerFeature: (name: string, feature: Feature) => void;
|
|
223
252
|
registerPredicate: (name: string, predicate: Predicate) => void;
|
|
253
|
+
registerCondition: (condition: Condition) => void;
|
|
224
254
|
registerField: (field: Field) => void;
|
|
255
|
+
registerStep: (step: ExperienceStep) => void;
|
|
225
256
|
registerAction: (name: string, action: Action) => void;
|
|
226
257
|
registerExperience: (experience: Experience) => void;
|
|
227
258
|
getStateSnapshot: () => StateSnapshot;
|
|
228
|
-
/**
|
|
259
|
+
/**
|
|
260
|
+
* Launches an experience by ID.
|
|
261
|
+
*
|
|
262
|
+
* @param experienceId - The experience id to launch.
|
|
263
|
+
* @param options - Optional launch options.
|
|
264
|
+
* @example
|
|
265
|
+
* ```typescript
|
|
266
|
+
* await client.launchExperienceById('exp-1')
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
229
269
|
launchExperienceById: (experienceId: string, options?: LaunchExperienceOptions) => Promise<void>;
|
|
230
|
-
/**
|
|
270
|
+
/**
|
|
271
|
+
* Launches an experience by Key.
|
|
272
|
+
*
|
|
273
|
+
* @param experienceKey - The experience key to launch.
|
|
274
|
+
* @param options - Optional launch options.
|
|
275
|
+
* @example
|
|
276
|
+
* ```typescript
|
|
277
|
+
* await client.launchExperienceByKey('exp-1')
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
launchExperienceByKey: (experienceKey: string, options?: LaunchExperienceOptions) => Promise<void>;
|
|
281
|
+
/**
|
|
282
|
+
* Opens an experience by ID.
|
|
283
|
+
*
|
|
284
|
+
* @param experienceId - The experience ID to open.
|
|
285
|
+
* @example
|
|
286
|
+
* ```typescript
|
|
287
|
+
* await client.openExperienceById('exp-1')
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
231
290
|
openExperienceById: (experienceId: string) => Promise<void>;
|
|
291
|
+
/**
|
|
292
|
+
* Opens an experience by Key.
|
|
293
|
+
*
|
|
294
|
+
* @param experienceKey - The experience Key to open.
|
|
295
|
+
* @example
|
|
296
|
+
* ```typescript
|
|
297
|
+
* await client.openExperienceById('exp-1')
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
300
|
+
openExperienceByKey: (experienceKey: string) => Promise<void>;
|
|
232
301
|
private runPluginStartHooks;
|
|
233
302
|
private evaluateGate;
|
|
234
303
|
private setupPlugins;
|
|
@@ -266,15 +335,12 @@ export declare class Picked {
|
|
|
266
335
|
* @param template Template containing placeholders.
|
|
267
336
|
* @param context Optional data for interpolation. Non-responses.* keys belong here; function values are executed.
|
|
268
337
|
* @returns Interpolated string.
|
|
269
|
-
*
|
|
270
338
|
* @example
|
|
271
339
|
* renderString("Hello {{ name | default: 'Guest' | capitalize }}! Email: {{ responses.email | lower }}.", { name: "ALICE" })
|
|
272
340
|
* // => "Hello Alice! Email: alice@example.com."
|
|
273
|
-
*
|
|
274
341
|
* @example
|
|
275
342
|
* renderString("User: {{ getName | capitalize }}", { getName: () => "alice" })
|
|
276
343
|
* // => "User: Alice"
|
|
277
|
-
*
|
|
278
344
|
* @example
|
|
279
345
|
* renderString("Fruits: {{ fruits | list }}", { fruits: ["apple", "banana", "cherry"] })
|
|
280
346
|
* // => "Fruits: apple, banana, and cherry"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,uBAAuB,
|
|
1
|
+
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,uBAAuB,EAC7B,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,iBAAiB,EAAe,MAAM,0BAA0B,CAAA;AAC3F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAEL,KAAK,SAAS,EAEf,MAAM,gCAAgC,CAAA;AAGvC,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAE/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAKzD,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACjG,OAAO,KAAK,EAAE,KAAK,EAAE,M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C,IAAI,CAAC,CAEf;IACD;;;;;;;;;OASG;IAEH,qBAAqB,GACnB,eAAe,MAAM,EACrB,UAAU,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IAED;;;;;;;;OAQG;IAEH,kBAAkB,GAAU,cAAc,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAE/D;IAED;;;;;;;;OAQG;IAEH,mBAAmB,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;YAEa,mBAAmB;YAMnB,YAAY;IAc1B,OAAO,CAAC,YAAY;IA6BpB,OAAO,CAAC,aAAa;IA8CrB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,eAAe;IAWvB,eAAe,GAAI,YAAY,MAAM,KAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1F;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,YAAY,GAAI,UAAU,MAAM,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAAM,CAY3E;CACF"}
|
|
@@ -1,28 +1,40 @@
|
|
|
1
|
-
import { ActionNode, Experience,
|
|
1
|
+
import { ActionNode, Experience, ExperienceEdge, ExperienceNode, ExperienceTarget } from '../../entities/experience/experience';
|
|
2
|
+
import { ExperienceStep } from '../../entities/step/step';
|
|
3
|
+
import { Condition } from '../../entities/condition/condition';
|
|
2
4
|
import { AdaptedComponent } from '../../entities/component/component';
|
|
3
5
|
import { LogicRule, LogicValue } from '../../logic-engine';
|
|
4
6
|
import { Field, FieldBooleanMultiple, FieldBooleanSingular, FieldNumberMultiple, FieldNumberSingular, FieldObjectMultiple, FieldObjectSingular, FieldTextMultiple, FieldTextSingular, JsonValue } from '../../entities/field/field';
|
|
5
7
|
import { Serialized } from './serialization';
|
|
8
|
+
export interface SerializedExperience extends Experience {
|
|
9
|
+
steps: ExperienceStep[];
|
|
10
|
+
conditions: Condition[];
|
|
11
|
+
fields: Field[];
|
|
12
|
+
}
|
|
6
13
|
export interface Nodeable {
|
|
7
14
|
node: SerializableNode | null;
|
|
8
15
|
}
|
|
9
16
|
export interface SerializableStep extends Nodeable {
|
|
10
17
|
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
key: string;
|
|
11
20
|
label: string;
|
|
12
21
|
fields: SerializableField[];
|
|
13
22
|
experience: SerializableExperience;
|
|
14
23
|
nextStep: (stepOptions: CreateStepOptions | SerializableStep) => SerializableStep;
|
|
15
|
-
|
|
24
|
+
nextCondition: (conditionOptions: CreateConditionOptions | SerializableCondition) => SerializableCondition;
|
|
25
|
+
/** @deprecated Use `nextCondition` instead. */
|
|
26
|
+
nextConditional: (conditionOptions: CreateConditionOptions | SerializableCondition) => SerializableCondition;
|
|
16
27
|
addNextExperience: (experience: SerializableExperience) => SerializableExperience;
|
|
17
28
|
addField: (fieldOptions: CreateFieldOptions | SerializableField) => SerializableField;
|
|
18
29
|
serialize: () => Serialized<ExperienceStep>;
|
|
19
30
|
}
|
|
20
31
|
export interface CreateStepOptions {
|
|
21
32
|
id?: string;
|
|
22
|
-
|
|
33
|
+
key?: string;
|
|
34
|
+
name: string;
|
|
23
35
|
fields?: SerializableField[];
|
|
24
36
|
}
|
|
25
|
-
export type SerializableNode = SerializableStepNode |
|
|
37
|
+
export type SerializableNode = SerializableStepNode | SerializableConditionNode | SerializableLaunchExperienceNode | SerializableOriginNode | SerializableActionNode;
|
|
26
38
|
export interface SerializableActionNode extends SerializableBaseNode {
|
|
27
39
|
type: 'action';
|
|
28
40
|
action: string;
|
|
@@ -44,9 +56,9 @@ export interface SerializableStepNode extends SerializableBaseNode {
|
|
|
44
56
|
type: 'step';
|
|
45
57
|
connectedStep: SerializableStep;
|
|
46
58
|
}
|
|
47
|
-
export interface
|
|
48
|
-
type: '
|
|
49
|
-
|
|
59
|
+
export interface SerializableConditionNode extends SerializableBaseNode {
|
|
60
|
+
type: 'condition';
|
|
61
|
+
connectedCondition: SerializableCondition;
|
|
50
62
|
}
|
|
51
63
|
export interface SerializableLaunchExperienceNode extends SerializableBaseNode {
|
|
52
64
|
type: 'experience';
|
|
@@ -59,8 +71,8 @@ export type CreateNodeOptions = {
|
|
|
59
71
|
step: SerializableStep;
|
|
60
72
|
type: 'step';
|
|
61
73
|
} | {
|
|
62
|
-
|
|
63
|
-
type: '
|
|
74
|
+
condition: SerializableCondition;
|
|
75
|
+
type: 'condition';
|
|
64
76
|
} | {
|
|
65
77
|
type: 'origin';
|
|
66
78
|
} | {
|
|
@@ -73,30 +85,36 @@ export type CreateNodeOptions = {
|
|
|
73
85
|
export interface SerializableEdge {
|
|
74
86
|
id: string;
|
|
75
87
|
sourceNode: SerializableNode;
|
|
76
|
-
|
|
88
|
+
sourceHandle: 'true' | 'false' | null;
|
|
77
89
|
destinationNode: SerializableNode;
|
|
78
90
|
experience: SerializableExperience;
|
|
79
91
|
serialize: () => Serialized<ExperienceEdge>;
|
|
80
92
|
}
|
|
81
93
|
export interface CreateEdgeOptions {
|
|
82
94
|
sourceNode: SerializableNode;
|
|
83
|
-
|
|
95
|
+
sourceHandle: 'true' | 'false' | null;
|
|
84
96
|
destinationNode: SerializableNode;
|
|
85
97
|
}
|
|
86
|
-
export interface
|
|
98
|
+
export interface SerializableCondition extends Nodeable {
|
|
87
99
|
id: string;
|
|
100
|
+
key: string;
|
|
101
|
+
name: string;
|
|
88
102
|
label?: string;
|
|
89
|
-
|
|
103
|
+
logic: LogicRule;
|
|
90
104
|
experience: SerializableExperience;
|
|
91
105
|
addTrue: (nodeable: Nodeable) => undefined;
|
|
92
106
|
addFalse: (nodeable: Nodeable) => undefined;
|
|
93
|
-
serialize: () => Serialized<
|
|
107
|
+
serialize: () => Serialized<Condition>;
|
|
94
108
|
}
|
|
95
|
-
export interface
|
|
109
|
+
export interface CreateConditionOptions {
|
|
96
110
|
condition: LogicRule;
|
|
111
|
+
name?: string;
|
|
112
|
+
key?: string;
|
|
97
113
|
label?: string;
|
|
98
114
|
}
|
|
99
|
-
export type CreateFieldOptions = Omit<Field, 'options' | 'placeholder' | 'description' | 'helpText' | 'validation' | 'policies' | 'defaultValue'> & {
|
|
115
|
+
export type CreateFieldOptions = Omit<Field, 'id' | 'key' | 'options' | 'placeholder' | 'description' | 'helpText' | 'validation' | 'policies' | 'defaultValue'> & {
|
|
116
|
+
id?: string;
|
|
117
|
+
key?: string;
|
|
100
118
|
defaultValue?: string | number | boolean | object | null | string[] | number[] | boolean[] | object[];
|
|
101
119
|
placeholder?: string;
|
|
102
120
|
description?: string;
|
|
@@ -110,6 +128,7 @@ export type CreateFieldOptions = Omit<Field, 'options' | 'placeholder' | 'descri
|
|
|
110
128
|
};
|
|
111
129
|
export type SerializableField<T extends JsonValue = JsonValue> = {
|
|
112
130
|
id: string;
|
|
131
|
+
key: string;
|
|
113
132
|
name: string;
|
|
114
133
|
label: string;
|
|
115
134
|
type: 'text' | 'number' | 'object' | 'boolean';
|
|
@@ -132,17 +151,12 @@ export type SerializableField<T extends JsonValue = JsonValue> = {
|
|
|
132
151
|
value: JsonValue;
|
|
133
152
|
condition?: LogicRule;
|
|
134
153
|
}[] | null;
|
|
135
|
-
/**
|
|
136
|
-
* Phantom type property for TypeScript type inference.
|
|
137
|
-
* This property never exists at runtime but enables type-safe field value access.
|
|
138
|
-
* @internal
|
|
139
|
-
*/
|
|
140
|
-
__fieldType?: T;
|
|
141
154
|
} & {
|
|
142
155
|
serialize: () => Serialized<Field>;
|
|
143
156
|
};
|
|
144
157
|
export interface SerializableExperience {
|
|
145
158
|
id: string;
|
|
159
|
+
key: string;
|
|
146
160
|
component?: AdaptedComponent;
|
|
147
161
|
name: string;
|
|
148
162
|
condition?: LogicRule | LogicValue;
|
|
@@ -152,13 +166,17 @@ export interface SerializableExperience {
|
|
|
152
166
|
nodes: SerializableNode[];
|
|
153
167
|
edges: SerializableEdge[];
|
|
154
168
|
fields: SerializableField[];
|
|
155
|
-
|
|
169
|
+
conditions: SerializableCondition[];
|
|
156
170
|
addStep: (stepOptions: CreateStepOptions | SerializableStep | OrphanStep, after?: {
|
|
157
171
|
node: SerializableNode | null;
|
|
158
172
|
}) => SerializableStep;
|
|
159
|
-
|
|
173
|
+
addCondition: (conditionOptions: CreateConditionOptions | SerializableCondition, after?: {
|
|
160
174
|
node: SerializableNode | null;
|
|
161
|
-
}) =>
|
|
175
|
+
}) => SerializableCondition;
|
|
176
|
+
/** @deprecated Use `addCondition` instead. */
|
|
177
|
+
addConditional: (conditionOptions: CreateConditionOptions | SerializableCondition, after?: {
|
|
178
|
+
node: SerializableNode | null;
|
|
179
|
+
}) => SerializableCondition;
|
|
162
180
|
addExperience: (experience: SerializableExperience, after?: {
|
|
163
181
|
node: SerializableNode | null;
|
|
164
182
|
}) => SerializableExperience;
|
|
@@ -166,29 +184,33 @@ export interface SerializableExperience {
|
|
|
166
184
|
addAction: (actionOptions: CreateActionOptions | SerializableActionNode, after?: {
|
|
167
185
|
node: SerializableNode | null;
|
|
168
186
|
}) => SerializableActionNode;
|
|
169
|
-
serialize: () => Serialized<
|
|
187
|
+
serialize: () => Serialized<SerializedExperience>;
|
|
170
188
|
}
|
|
171
189
|
export interface CreateExperienceOptions {
|
|
172
190
|
id: string;
|
|
191
|
+
key?: string;
|
|
173
192
|
name: string;
|
|
174
193
|
condition?: LogicRule | LogicValue;
|
|
175
194
|
initializeOpen?: LogicRule | LogicValue;
|
|
176
195
|
targets: ExperienceTarget[];
|
|
177
196
|
component?: AdaptedComponent;
|
|
178
197
|
}
|
|
179
|
-
export type OrphanStep = Omit<SerializableStep, 'nextStep' | 'nextConditional' | 'addNextExperience' | 'node' | 'serialize' | 'addField' | 'experience'> & {
|
|
198
|
+
export type OrphanStep = Omit<SerializableStep, 'nextStep' | 'nextCondition' | 'nextConditional' | 'addNextExperience' | 'node' | 'serialize' | 'addField' | 'experience'> & {
|
|
180
199
|
addField: (fieldOrFieldOptions: CreateFieldOptions | SerializableField) => void;
|
|
181
200
|
};
|
|
182
201
|
export declare const createStep: (stepOptions: CreateStepOptions) => OrphanStep;
|
|
183
202
|
export declare const bindExperienceStep: (stepOptions: CreateStepOptions | OrphanStep, experience: SerializableExperience) => SerializableStep;
|
|
184
203
|
export declare const createNode: (nodeOptions: CreateNodeOptions, experience: SerializableExperience) => SerializableNode;
|
|
185
204
|
export declare const createEdge: (edgeOptions: CreateEdgeOptions, experience: SerializableExperience) => SerializableEdge;
|
|
186
|
-
export declare const
|
|
205
|
+
export declare const createCondition: (conditionOptions: CreateConditionOptions, experience: SerializableExperience) => SerializableCondition;
|
|
206
|
+
/** @deprecated Use `createCondition` instead. */
|
|
207
|
+
export declare const createConditional: (conditionOptions: CreateConditionOptions, experience: SerializableExperience) => SerializableCondition;
|
|
187
208
|
/**
|
|
188
209
|
* Creates a field with optional generic type parameter for object field type safety.
|
|
189
|
-
*
|
|
190
|
-
* @
|
|
191
|
-
* @
|
|
210
|
+
*
|
|
211
|
+
* @template T - The type of the object field value (only applicable for type: 'object').
|
|
212
|
+
* @param {CreateFieldOptions} fieldOptions - The field configuration options.
|
|
213
|
+
* @returns {SerializableField<T>} A serializable field with type information.
|
|
192
214
|
* @example
|
|
193
215
|
* ```typescript
|
|
194
216
|
* // Without type parameter (default JsonValue)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-experience.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/create-experience.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAEV,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"create-experience.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/create-experience.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,KAAK,EACV,UAAU,EAEV,UAAU,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAGjB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAA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iBAAiB,EAC9B,YAAY,sBAAsB,KACjC,gBA4EF,CAAA;AAED,eAAO,MAAM,UAAU,GACrB,aAAa,iBAAiB,EAC9B,YAAY,sBAAsB,KACjC,gBAkBF,CAAA;AAED,eAAO,MAAM,eAAe,GAC1B,kBAAkB,sBAAsB,EACxC,YAAY,sBAAsB,KACjC,qBAmDF,CAAA;AAED,iDAAiD;AACjD,eAAO,MAAM,iBAAiB,qBAxDV,sBAAsB,cAC5B,sBAAsB,KACjC,qBAsD6C,CAAA;AAEhD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EACzD,cAAc,kBAAkB,KAC/B,iBAAiB,CAAC,CAAC,CAsOrB,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,YAAY,uBAAuB,KAAG,sBA4LtE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
/** @file Public API for the create-experience plugin. */
|
|
1
2
|
export { createExperiencePlugin } from './plugin';
|
|
2
3
|
export type * from './plugin';
|
|
3
4
|
export type * from './create-experience';
|
|
4
|
-
export {
|
|
5
|
-
export { serialization } from './serialization';
|
|
5
|
+
export { createCondition, createEdge, createExperience, createNode, createField, createStep, } from './create-experience';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjD,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,qBAAqB,CAAA;AACxC,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjD,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,qBAAqB,CAAA;AACxC,OAAO,EACL,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,UAAU,GACX,MAAM,qBAAqB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/plugin.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAE1D,OAAO,KAAK,EAAwB,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAGvF,UAAU,6BAA6B;IACrC,WAAW,EAAE,sBAAsB,EAAE,CAAA;CACtC;AAED,eAAO,MAAM,sBAAsB,GAAI,SAAS,6BAA6B,KAAG,MA0B/E,CAAA"}
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
import { Plugin } from '../../entities/plugin/plugin';
|
|
2
2
|
import { DynamicExperiencesPluginOptions, FetchProjectOptions, ProjectConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Fetches the project configuration from the Picked REST API.
|
|
5
|
+
*
|
|
6
|
+
* Returns `null` on network failure, non-OK responses, or invalid JSON shape.
|
|
7
|
+
* Connection-refused errors from local URLs are suppressed silently.
|
|
8
|
+
*
|
|
9
|
+
* @param apiUrl - Base URL for the Picked API.
|
|
10
|
+
* @param projectId - Project ID to fetch config for.
|
|
11
|
+
* @param options - Optional headers and preview token.
|
|
12
|
+
* @returns Validated project config, or `null` on any failure.
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const config = await fetchProject('https://api.picked.app', 'proj_123')
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
3
18
|
export declare function fetchProject(apiUrl: string, projectId: string, options?: FetchProjectOptions): Promise<ProjectConfig | null>;
|
|
4
19
|
/**
|
|
5
|
-
* Plugin that fetches
|
|
6
|
-
* and
|
|
20
|
+
* Plugin that fetches project configuration from the Picked REST API and registers
|
|
21
|
+
* features, steps, fields, and experiences with the client.
|
|
7
22
|
*
|
|
8
|
-
* Features are fetched during the `onStart` hook, before experience
|
|
9
|
-
*
|
|
23
|
+
* Features are fetched during the `onStart` hook, before experience initialisation.
|
|
24
|
+
* Search param feature overrides take precedence over API-provided values.
|
|
10
25
|
*
|
|
26
|
+
* @param options - Optional plugin configuration.
|
|
27
|
+
* @returns A configured Picked plugin.
|
|
11
28
|
* @example
|
|
12
29
|
* ```typescript
|
|
13
30
|
* import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,OAAO,KAAK,EACV,+BAA+B,EAC/B,mBAAmB,EACnB,aAAa,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,OAAO,KAAK,EACV,+BAA+B,EAC/B,mBAAmB,EACnB,aAAa,EAGd,MAAM,SAAS,CAAA;AAmUhB;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAmC/B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,+BAA+B,GAAG,MAAM,CAgD1F"}
|