@salesforce/lds-adapters-platform-admin-success-guidance 1.100.2

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.
Files changed (66) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/platform-admin-success-guidance.js +4189 -0
  3. package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
  4. package/dist/types/src/generated/adapters/evaluateStep.d.ts +14 -0
  5. package/dist/types/src/generated/adapters/getAssistant.d.ts +27 -0
  6. package/dist/types/src/generated/adapters/getAssistantInfoList.d.ts +27 -0
  7. package/dist/types/src/generated/adapters/getAssistantList.d.ts +27 -0
  8. package/dist/types/src/generated/adapters/getAssistantTarget.d.ts +27 -0
  9. package/dist/types/src/generated/adapters/getQuestionnaire.d.ts +27 -0
  10. package/dist/types/src/generated/adapters/getQuestionnaires.d.ts +27 -0
  11. package/dist/types/src/generated/adapters/initialize.d.ts +14 -0
  12. package/dist/types/src/generated/adapters/saveAssistant.d.ts +16 -0
  13. package/dist/types/src/generated/adapters/saveAssistantList.d.ts +16 -0
  14. package/dist/types/src/generated/adapters/saveQuestionnaire.d.ts +16 -0
  15. package/dist/types/src/generated/artifacts/main.d.ts +11 -0
  16. package/dist/types/src/generated/artifacts/sfdc.d.ts +24 -0
  17. package/dist/types/src/generated/resources/getAssistantPlatformByAssistantName.d.ts +16 -0
  18. package/dist/types/src/generated/resources/getAssistantPlatformInfoByAssistantTarget.d.ts +16 -0
  19. package/dist/types/src/generated/resources/getAssistantPlatformListByAssistantTarget.d.ts +16 -0
  20. package/dist/types/src/generated/resources/getAssistantPlatformListInfoByAssistantTarget.d.ts +16 -0
  21. package/dist/types/src/generated/resources/getAssistantPlatformQuestionnaireByQuestionnaireName.d.ts +16 -0
  22. package/dist/types/src/generated/resources/getAssistantPlatformQuestionnairesByAssistantName.d.ts +16 -0
  23. package/dist/types/src/generated/resources/patchAssistantPlatformByAssistantName.d.ts +16 -0
  24. package/dist/types/src/generated/resources/patchAssistantPlatformListByAssistantTarget.d.ts +16 -0
  25. package/dist/types/src/generated/resources/patchAssistantPlatformQuestionnaireByQuestionnaireName.d.ts +16 -0
  26. package/dist/types/src/generated/resources/patchAssistantPlatformStepByStepName.d.ts +12 -0
  27. package/dist/types/src/generated/resources/putAssistantPlatformInitializeByAssistantTarget.d.ts +12 -0
  28. package/dist/types/src/generated/types/AbstractLightningAssistantActionRepresentation.d.ts +40 -0
  29. package/dist/types/src/generated/types/AssistantData.d.ts +30 -0
  30. package/dist/types/src/generated/types/LightningAssistantAnswerDataInputRepresentation.d.ts +35 -0
  31. package/dist/types/src/generated/types/LightningAssistantCategoryRepresentation.d.ts +35 -0
  32. package/dist/types/src/generated/types/LightningAssistantChoiceRepresentation.d.ts +38 -0
  33. package/dist/types/src/generated/types/LightningAssistantCustomActionRepresentation.d.ts +41 -0
  34. package/dist/types/src/generated/types/LightningAssistantInfoListRepresentation.d.ts +42 -0
  35. package/dist/types/src/generated/types/LightningAssistantInfoRepresentation.d.ts +56 -0
  36. package/dist/types/src/generated/types/LightningAssistantInitializationRepresentation.d.ts +44 -0
  37. package/dist/types/src/generated/types/LightningAssistantInputRepresentation.d.ts +29 -0
  38. package/dist/types/src/generated/types/LightningAssistantItemInputRepresentation.d.ts +38 -0
  39. package/dist/types/src/generated/types/LightningAssistantLayoutNodeRepresentation.d.ts +57 -0
  40. package/dist/types/src/generated/types/LightningAssistantLinkActionRepresentation.d.ts +37 -0
  41. package/dist/types/src/generated/types/LightningAssistantLinkRepresentation.d.ts +32 -0
  42. package/dist/types/src/generated/types/LightningAssistantListInputRepresentation.d.ts +33 -0
  43. package/dist/types/src/generated/types/LightningAssistantListRepresentation.d.ts +51 -0
  44. package/dist/types/src/generated/types/LightningAssistantLsfActionRepresentation.d.ts +44 -0
  45. package/dist/types/src/generated/types/LightningAssistantNoActionRepresentation.d.ts +27 -0
  46. package/dist/types/src/generated/types/LightningAssistantQuestionRepresentation.d.ts +43 -0
  47. package/dist/types/src/generated/types/LightningAssistantQuestionnaireInputRepresentation.d.ts +36 -0
  48. package/dist/types/src/generated/types/LightningAssistantQuestionnaireListRepresentation.d.ts +41 -0
  49. package/dist/types/src/generated/types/LightningAssistantQuestionnaireRepresentation.d.ts +54 -0
  50. package/dist/types/src/generated/types/LightningAssistantRepresentation.d.ts +99 -0
  51. package/dist/types/src/generated/types/LightningAssistantStepRepresentation.d.ts +76 -0
  52. package/dist/types/src/generated/types/LightningAssistantTargetRepresentation.d.ts +42 -0
  53. package/dist/types/src/generated/types/LightningAssistantTrailheadActionRepresentation.d.ts +37 -0
  54. package/dist/types/src/generated/types/LightningAssistantUpdateInputRepresentation.d.ts +33 -0
  55. package/dist/types/src/generated/types/LightningAssistantVideoActionRepresentation.d.ts +34 -0
  56. package/dist/types/src/generated/types/LightningAssistantWalkthroughActionRepresentation.d.ts +34 -0
  57. package/dist/types/src/generated/types/QuestionnaireData.d.ts +30 -0
  58. package/dist/types/src/generated/types/UpdateAssistantData.d.ts +30 -0
  59. package/dist/types/src/generated/types/type-utils.d.ts +39 -0
  60. package/dist/umd/es2018/platform-admin-success-guidance.js +4207 -0
  61. package/dist/umd/es5/platform-admin-success-guidance.js +4243 -0
  62. package/package.json +69 -0
  63. package/sfdc/index.d.ts +1 -0
  64. package/sfdc/index.js +4489 -0
  65. package/src/raml/api.raml +736 -0
  66. package/src/raml/luvio.raml +98 -0
@@ -0,0 +1,4189 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import { serializeStructuredKey, StoreKeyMap } from '@luvio/engine';
8
+
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
11
+ const { isArray: ArrayIsArray$1 } = Array;
12
+ /**
13
+ * Validates an adapter config is well-formed.
14
+ * @param config The config to validate.
15
+ * @param adapter The adapter validation configuration.
16
+ * @param oneOf The keys the config must contain at least one of.
17
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
+ */
19
+ function validateConfig(config, adapter, oneOf) {
20
+ const { displayName } = adapter;
21
+ const { required, optional, unsupported } = adapter.parameters;
22
+ if (config === undefined ||
23
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
+ }
26
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
+ }
29
+ if (unsupported !== undefined &&
30
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
+ }
33
+ const supported = required.concat(optional);
34
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
35
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
+ }
37
+ }
38
+ function untrustedIsObject(untrusted) {
39
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
+ }
41
+ function areRequiredParametersPresent(config, configPropertyNames) {
42
+ return configPropertyNames.parameters.required.every(req => req in config);
43
+ }
44
+ const snapshotRefreshOptions = {
45
+ overrides: {
46
+ headers: {
47
+ 'Cache-Control': 'no-cache',
48
+ },
49
+ }
50
+ };
51
+ const keyPrefix = 'LEAP';
52
+
53
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
54
+ const { isArray: ArrayIsArray } = Array;
55
+ const { stringify: JSONStringify } = JSON;
56
+ function equalsArray(a, b, equalsItem) {
57
+ const aLength = a.length;
58
+ const bLength = b.length;
59
+ if (aLength !== bLength) {
60
+ return false;
61
+ }
62
+ for (let i = 0; i < aLength; i++) {
63
+ if (equalsItem(a[i], b[i]) === false) {
64
+ return false;
65
+ }
66
+ }
67
+ return true;
68
+ }
69
+ function deepFreeze(value) {
70
+ // No need to freeze primitives
71
+ if (typeof value !== 'object' || value === null) {
72
+ return;
73
+ }
74
+ if (ArrayIsArray(value)) {
75
+ for (let i = 0, len = value.length; i < len; i += 1) {
76
+ deepFreeze(value[i]);
77
+ }
78
+ }
79
+ else {
80
+ const keys = ObjectKeys(value);
81
+ for (let i = 0, len = keys.length; i < len; i += 1) {
82
+ deepFreeze(value[keys[i]]);
83
+ }
84
+ }
85
+ ObjectFreeze(value);
86
+ }
87
+ function createLink(ref) {
88
+ return {
89
+ __ref: serializeStructuredKey(ref),
90
+ };
91
+ }
92
+
93
+ const VERSION$l = "fec1ea773d37039808d8d9e4e4d7c085";
94
+ function validate$h(obj, path = 'LightningAssistantChoiceRepresentation') {
95
+ const v_error = (() => {
96
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
97
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
98
+ }
99
+ if (obj.description !== undefined) {
100
+ const obj_description = obj.description;
101
+ const path_description = path + '.description';
102
+ if (typeof obj_description !== 'string') {
103
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
104
+ }
105
+ }
106
+ const obj_developerName = obj.developerName;
107
+ const path_developerName = path + '.developerName';
108
+ if (typeof obj_developerName !== 'string') {
109
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
110
+ }
111
+ const obj_next = obj.next;
112
+ const path_next = path + '.next';
113
+ if (typeof obj_next !== 'string') {
114
+ return new TypeError('Expected "string" but received "' + typeof obj_next + '" (at "' + path_next + '")');
115
+ }
116
+ const obj_title = obj.title;
117
+ const path_title = path + '.title';
118
+ if (typeof obj_title !== 'string') {
119
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
120
+ }
121
+ })();
122
+ return v_error === undefined ? null : v_error;
123
+ }
124
+ const select$w = function LightningAssistantChoiceRepresentationSelect() {
125
+ return {
126
+ kind: 'Fragment',
127
+ version: VERSION$l,
128
+ private: [],
129
+ selections: [
130
+ {
131
+ name: 'description',
132
+ kind: 'Scalar',
133
+ required: false
134
+ },
135
+ {
136
+ name: 'developerName',
137
+ kind: 'Scalar'
138
+ },
139
+ {
140
+ name: 'next',
141
+ kind: 'Scalar'
142
+ },
143
+ {
144
+ name: 'title',
145
+ kind: 'Scalar'
146
+ }
147
+ ]
148
+ };
149
+ };
150
+ function equals$e(existing, incoming) {
151
+ const existing_description = existing.description;
152
+ const incoming_description = incoming.description;
153
+ // if at least one of these optionals is defined
154
+ if (existing_description !== undefined || incoming_description !== undefined) {
155
+ // if one of these is not defined we know the other is defined and therefore
156
+ // not equal
157
+ if (existing_description === undefined || incoming_description === undefined) {
158
+ return false;
159
+ }
160
+ if (!(existing_description === incoming_description)) {
161
+ return false;
162
+ }
163
+ }
164
+ const existing_developerName = existing.developerName;
165
+ const incoming_developerName = incoming.developerName;
166
+ if (!(existing_developerName === incoming_developerName)) {
167
+ return false;
168
+ }
169
+ const existing_next = existing.next;
170
+ const incoming_next = incoming.next;
171
+ if (!(existing_next === incoming_next)) {
172
+ return false;
173
+ }
174
+ const existing_title = existing.title;
175
+ const incoming_title = incoming.title;
176
+ if (!(existing_title === incoming_title)) {
177
+ return false;
178
+ }
179
+ return true;
180
+ }
181
+
182
+ const VERSION$k = "545ec40aff7b3db184e84760ae732370";
183
+ function validate$g(obj, path = 'LightningAssistantLinkRepresentation') {
184
+ const v_error = (() => {
185
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
186
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
187
+ }
188
+ const obj_label = obj.label;
189
+ const path_label = path + '.label';
190
+ if (typeof obj_label !== 'string') {
191
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
192
+ }
193
+ const obj_url = obj.url;
194
+ const path_url = path + '.url';
195
+ if (typeof obj_url !== 'string') {
196
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
197
+ }
198
+ })();
199
+ return v_error === undefined ? null : v_error;
200
+ }
201
+ const select$v = function LightningAssistantLinkRepresentationSelect() {
202
+ return {
203
+ kind: 'Fragment',
204
+ version: VERSION$k,
205
+ private: [],
206
+ selections: [
207
+ {
208
+ name: 'label',
209
+ kind: 'Scalar'
210
+ },
211
+ {
212
+ name: 'url',
213
+ kind: 'Scalar'
214
+ }
215
+ ]
216
+ };
217
+ };
218
+ function equals$d(existing, incoming) {
219
+ const existing_label = existing.label;
220
+ const incoming_label = incoming.label;
221
+ if (!(existing_label === incoming_label)) {
222
+ return false;
223
+ }
224
+ const existing_url = existing.url;
225
+ const incoming_url = incoming.url;
226
+ if (!(existing_url === incoming_url)) {
227
+ return false;
228
+ }
229
+ return true;
230
+ }
231
+
232
+ const VERSION$j = "33d491734169be0180f670c757b53a34";
233
+ function validate$f(obj, path = 'LightningAssistantQuestionRepresentation') {
234
+ const v_error = (() => {
235
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
236
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
237
+ }
238
+ const obj_choices = obj.choices;
239
+ const path_choices = path + '.choices';
240
+ if (!ArrayIsArray(obj_choices)) {
241
+ return new TypeError('Expected "array" but received "' + typeof obj_choices + '" (at "' + path_choices + '")');
242
+ }
243
+ for (let i = 0; i < obj_choices.length; i++) {
244
+ const obj_choices_item = obj_choices[i];
245
+ const path_choices_item = path_choices + '[' + i + ']';
246
+ const referencepath_choices_itemValidationError = validate$h(obj_choices_item, path_choices_item);
247
+ if (referencepath_choices_itemValidationError !== null) {
248
+ let message = 'Object doesn\'t match LightningAssistantChoiceRepresentation (at "' + path_choices_item + '")\n';
249
+ message += referencepath_choices_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
250
+ return new TypeError(message);
251
+ }
252
+ }
253
+ if (obj.description !== undefined) {
254
+ const obj_description = obj.description;
255
+ const path_description = path + '.description';
256
+ if (typeof obj_description !== 'string') {
257
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
258
+ }
259
+ }
260
+ const obj_developerName = obj.developerName;
261
+ const path_developerName = path + '.developerName';
262
+ if (typeof obj_developerName !== 'string') {
263
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
264
+ }
265
+ if (obj.link !== undefined) {
266
+ const obj_link = obj.link;
267
+ const path_link = path + '.link';
268
+ let obj_link_union0 = null;
269
+ const obj_link_union0_error = (() => {
270
+ const referencepath_linkValidationError = validate$g(obj_link, path_link);
271
+ if (referencepath_linkValidationError !== null) {
272
+ let message = 'Object doesn\'t match LightningAssistantLinkRepresentation (at "' + path_link + '")\n';
273
+ message += referencepath_linkValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
274
+ return new TypeError(message);
275
+ }
276
+ })();
277
+ if (obj_link_union0_error != null) {
278
+ obj_link_union0 = obj_link_union0_error.message;
279
+ }
280
+ let obj_link_union1 = null;
281
+ const obj_link_union1_error = (() => {
282
+ if (obj_link !== null) {
283
+ return new TypeError('Expected "null" but received "' + typeof obj_link + '" (at "' + path_link + '")');
284
+ }
285
+ })();
286
+ if (obj_link_union1_error != null) {
287
+ obj_link_union1 = obj_link_union1_error.message;
288
+ }
289
+ if (obj_link_union0 && obj_link_union1) {
290
+ let message = 'Object doesn\'t match union (at "' + path_link + '")';
291
+ message += '\n' + obj_link_union0.split('\n').map((line) => '\t' + line).join('\n');
292
+ message += '\n' + obj_link_union1.split('\n').map((line) => '\t' + line).join('\n');
293
+ return new TypeError(message);
294
+ }
295
+ }
296
+ const obj_title = obj.title;
297
+ const path_title = path + '.title';
298
+ if (typeof obj_title !== 'string') {
299
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
300
+ }
301
+ })();
302
+ return v_error === undefined ? null : v_error;
303
+ }
304
+ const select$u = function LightningAssistantQuestionRepresentationSelect() {
305
+ const { selections: LightningAssistantChoiceRepresentation__selections, opaque: LightningAssistantChoiceRepresentation__opaque, } = select$w();
306
+ const { selections: LightningAssistantLinkRepresentation__selections, opaque: LightningAssistantLinkRepresentation__opaque, } = select$v();
307
+ return {
308
+ kind: 'Fragment',
309
+ version: VERSION$j,
310
+ private: [],
311
+ selections: [
312
+ {
313
+ name: 'choices',
314
+ kind: 'Object',
315
+ plural: true,
316
+ selections: LightningAssistantChoiceRepresentation__selections
317
+ },
318
+ {
319
+ name: 'description',
320
+ kind: 'Scalar',
321
+ required: false
322
+ },
323
+ {
324
+ name: 'developerName',
325
+ kind: 'Scalar'
326
+ },
327
+ {
328
+ name: 'link',
329
+ kind: 'Object',
330
+ nullable: true,
331
+ selections: LightningAssistantLinkRepresentation__selections,
332
+ required: false
333
+ },
334
+ {
335
+ name: 'title',
336
+ kind: 'Scalar'
337
+ }
338
+ ]
339
+ };
340
+ };
341
+ function equals$c(existing, incoming) {
342
+ const existing_description = existing.description;
343
+ const incoming_description = incoming.description;
344
+ // if at least one of these optionals is defined
345
+ if (existing_description !== undefined || incoming_description !== undefined) {
346
+ // if one of these is not defined we know the other is defined and therefore
347
+ // not equal
348
+ if (existing_description === undefined || incoming_description === undefined) {
349
+ return false;
350
+ }
351
+ if (!(existing_description === incoming_description)) {
352
+ return false;
353
+ }
354
+ }
355
+ const existing_developerName = existing.developerName;
356
+ const incoming_developerName = incoming.developerName;
357
+ if (!(existing_developerName === incoming_developerName)) {
358
+ return false;
359
+ }
360
+ const existing_title = existing.title;
361
+ const incoming_title = incoming.title;
362
+ if (!(existing_title === incoming_title)) {
363
+ return false;
364
+ }
365
+ const existing_choices = existing.choices;
366
+ const incoming_choices = incoming.choices;
367
+ const equals_choices_items = equalsArray(existing_choices, incoming_choices, (existing_choices_item, incoming_choices_item) => {
368
+ if (!(equals$e(existing_choices_item, incoming_choices_item))) {
369
+ return false;
370
+ }
371
+ });
372
+ if (equals_choices_items === false) {
373
+ return false;
374
+ }
375
+ const existing_link = existing.link;
376
+ const incoming_link = incoming.link;
377
+ // if at least one of these optionals is defined
378
+ if (existing_link !== undefined || incoming_link !== undefined) {
379
+ // if one of these is not defined we know the other is defined and therefore
380
+ // not equal
381
+ if (existing_link === undefined || incoming_link === undefined) {
382
+ return false;
383
+ }
384
+ if (!(existing_link === incoming_link
385
+ || (existing_link != null &&
386
+ incoming_link != null &&
387
+ equals$d(existing_link, incoming_link)))) {
388
+ return false;
389
+ }
390
+ }
391
+ return true;
392
+ }
393
+
394
+ const VERSION$i = "defc7152bc133ff8e890226cd2092bf0";
395
+ function validate$e(obj, path = 'LightningAssistantQuestionnaireRepresentation') {
396
+ const v_error = (() => {
397
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
398
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
399
+ }
400
+ const obj_assistantTarget = obj.assistantTarget;
401
+ const path_assistantTarget = path + '.assistantTarget';
402
+ if (typeof obj_assistantTarget !== 'string') {
403
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
404
+ }
405
+ if (obj.description !== undefined) {
406
+ const obj_description = obj.description;
407
+ const path_description = path + '.description';
408
+ if (typeof obj_description !== 'string') {
409
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
410
+ }
411
+ }
412
+ const obj_developerName = obj.developerName;
413
+ const path_developerName = path + '.developerName';
414
+ if (typeof obj_developerName !== 'string') {
415
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
416
+ }
417
+ const obj_questions = obj.questions;
418
+ const path_questions = path + '.questions';
419
+ if (!ArrayIsArray(obj_questions)) {
420
+ return new TypeError('Expected "array" but received "' + typeof obj_questions + '" (at "' + path_questions + '")');
421
+ }
422
+ for (let i = 0; i < obj_questions.length; i++) {
423
+ const obj_questions_item = obj_questions[i];
424
+ const path_questions_item = path_questions + '[' + i + ']';
425
+ const referencepath_questions_itemValidationError = validate$f(obj_questions_item, path_questions_item);
426
+ if (referencepath_questions_itemValidationError !== null) {
427
+ let message = 'Object doesn\'t match LightningAssistantQuestionRepresentation (at "' + path_questions_item + '")\n';
428
+ message += referencepath_questions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
429
+ return new TypeError(message);
430
+ }
431
+ }
432
+ const obj_status = obj.status;
433
+ const path_status = path + '.status';
434
+ if (typeof obj_status !== 'string') {
435
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
436
+ }
437
+ const obj_title = obj.title;
438
+ const path_title = path + '.title';
439
+ if (typeof obj_title !== 'string') {
440
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
441
+ }
442
+ })();
443
+ return v_error === undefined ? null : v_error;
444
+ }
445
+ const RepresentationType$8 = 'LightningAssistantQuestionnaireRepresentation';
446
+ function keyBuilder$j(luvio, config) {
447
+ return keyPrefix + '::' + RepresentationType$8 + ':' + config.questionnaire_name;
448
+ }
449
+ function keyBuilderFromType$7(luvio, object) {
450
+ const keyParams = {
451
+ questionnaire_name: object.developerName
452
+ };
453
+ return keyBuilder$j(luvio, keyParams);
454
+ }
455
+ function normalize$8(input, existing, path, luvio, store, timestamp) {
456
+ return input;
457
+ }
458
+ const select$t = function LightningAssistantQuestionnaireRepresentationSelect() {
459
+ const { selections: LightningAssistantQuestionRepresentation__selections, opaque: LightningAssistantQuestionRepresentation__opaque, } = select$u();
460
+ return {
461
+ kind: 'Fragment',
462
+ version: VERSION$i,
463
+ private: [],
464
+ selections: [
465
+ {
466
+ name: 'assistantTarget',
467
+ kind: 'Scalar'
468
+ },
469
+ {
470
+ name: 'description',
471
+ kind: 'Scalar',
472
+ required: false
473
+ },
474
+ {
475
+ name: 'developerName',
476
+ kind: 'Scalar'
477
+ },
478
+ {
479
+ name: 'questions',
480
+ kind: 'Object',
481
+ plural: true,
482
+ selections: LightningAssistantQuestionRepresentation__selections
483
+ },
484
+ {
485
+ name: 'status',
486
+ kind: 'Scalar'
487
+ },
488
+ {
489
+ name: 'title',
490
+ kind: 'Scalar'
491
+ }
492
+ ]
493
+ };
494
+ };
495
+ function equals$b(existing, incoming) {
496
+ const existing_assistantTarget = existing.assistantTarget;
497
+ const incoming_assistantTarget = incoming.assistantTarget;
498
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
499
+ return false;
500
+ }
501
+ const existing_description = existing.description;
502
+ const incoming_description = incoming.description;
503
+ // if at least one of these optionals is defined
504
+ if (existing_description !== undefined || incoming_description !== undefined) {
505
+ // if one of these is not defined we know the other is defined and therefore
506
+ // not equal
507
+ if (existing_description === undefined || incoming_description === undefined) {
508
+ return false;
509
+ }
510
+ if (!(existing_description === incoming_description)) {
511
+ return false;
512
+ }
513
+ }
514
+ const existing_developerName = existing.developerName;
515
+ const incoming_developerName = incoming.developerName;
516
+ if (!(existing_developerName === incoming_developerName)) {
517
+ return false;
518
+ }
519
+ const existing_status = existing.status;
520
+ const incoming_status = incoming.status;
521
+ if (!(existing_status === incoming_status)) {
522
+ return false;
523
+ }
524
+ const existing_title = existing.title;
525
+ const incoming_title = incoming.title;
526
+ if (!(existing_title === incoming_title)) {
527
+ return false;
528
+ }
529
+ const existing_questions = existing.questions;
530
+ const incoming_questions = incoming.questions;
531
+ const equals_questions_items = equalsArray(existing_questions, incoming_questions, (existing_questions_item, incoming_questions_item) => {
532
+ if (!(equals$c(existing_questions_item, incoming_questions_item))) {
533
+ return false;
534
+ }
535
+ });
536
+ if (equals_questions_items === false) {
537
+ return false;
538
+ }
539
+ return true;
540
+ }
541
+ const ingest$8 = function LightningAssistantQuestionnaireRepresentationIngest(input, path, luvio, store, timestamp) {
542
+ if (process.env.NODE_ENV !== 'production') {
543
+ const validateError = validate$e(input);
544
+ if (validateError !== null) {
545
+ throw validateError;
546
+ }
547
+ }
548
+ const key = keyBuilderFromType$7(luvio, input);
549
+ const existingRecord = store.readEntry(key);
550
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
551
+ let incomingRecord = normalize$8(input, store.readEntry(key), {
552
+ fullPath: key,
553
+ parent: path.parent,
554
+ propertyName: path.propertyName,
555
+ ttl: ttlToUse
556
+ });
557
+ if (existingRecord === undefined || equals$b(existingRecord, incomingRecord) === false) {
558
+ luvio.storePublish(key, incomingRecord);
559
+ }
560
+ if (ttlToUse !== undefined) {
561
+ const storeMetadataParams = {
562
+ ttl: ttlToUse,
563
+ namespace: "LEAP",
564
+ version: VERSION$i,
565
+ representationName: RepresentationType$8,
566
+ };
567
+ luvio.publishStoreMetadata(key, storeMetadataParams);
568
+ }
569
+ return createLink(key);
570
+ };
571
+ function getTypeCacheKeys$8(luvio, input, fullPathFactory) {
572
+ const rootKeySet = new StoreKeyMap();
573
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
574
+ const rootKey = keyBuilderFromType$7(luvio, input);
575
+ rootKeySet.set(rootKey, {
576
+ namespace: keyPrefix,
577
+ representationName: RepresentationType$8,
578
+ mergeable: false
579
+ });
580
+ return rootKeySet;
581
+ }
582
+
583
+ function select$s(luvio, params) {
584
+ return select$t();
585
+ }
586
+ function keyBuilder$i(luvio, params) {
587
+ return keyBuilder$j(luvio, {
588
+ questionnaire_name: params.urlParams.questionnaireName
589
+ });
590
+ }
591
+ function getResponseCacheKeys$a(luvio, resourceParams, response) {
592
+ return getTypeCacheKeys$8(luvio, response);
593
+ }
594
+ function ingestSuccess$a(luvio, resourceParams, response, snapshotRefresh) {
595
+ const { body } = response;
596
+ const key = keyBuilder$i(luvio, resourceParams);
597
+ luvio.storeIngest(key, ingest$8, body);
598
+ const snapshot = luvio.storeLookup({
599
+ recordId: key,
600
+ node: select$s(),
601
+ variables: {},
602
+ }, snapshotRefresh);
603
+ if (process.env.NODE_ENV !== 'production') {
604
+ if (snapshot.state !== 'Fulfilled') {
605
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
606
+ }
607
+ }
608
+ return snapshot;
609
+ }
610
+ function ingestError$5(luvio, params, error, snapshotRefresh) {
611
+ const key = keyBuilder$i(luvio, params);
612
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
613
+ luvio.storeIngestError(key, errorSnapshot);
614
+ return errorSnapshot;
615
+ }
616
+ function createResourceRequest$a(config) {
617
+ const headers = {};
618
+ return {
619
+ baseUri: '/services/data/v58.0',
620
+ basePath: '/assistant-platform/questionnaire/' + config.urlParams.questionnaireName + '',
621
+ method: 'get',
622
+ body: null,
623
+ urlParams: config.urlParams,
624
+ queryParams: {},
625
+ headers,
626
+ priority: 'normal',
627
+ };
628
+ }
629
+
630
+ const getQuestionnaire_ConfigPropertyNames = {
631
+ displayName: 'getQuestionnaire',
632
+ parameters: {
633
+ required: ['questionnaireName'],
634
+ optional: []
635
+ }
636
+ };
637
+ function createResourceParams$a(config) {
638
+ const resourceParams = {
639
+ urlParams: {
640
+ questionnaireName: config.questionnaireName
641
+ }
642
+ };
643
+ return resourceParams;
644
+ }
645
+ function keyBuilder$h(luvio, config) {
646
+ const resourceParams = createResourceParams$a(config);
647
+ return keyBuilder$i(luvio, resourceParams);
648
+ }
649
+ function typeCheckConfig$a(untrustedConfig) {
650
+ const config = {};
651
+ const untrustedConfig_questionnaireName = untrustedConfig.questionnaireName;
652
+ if (typeof untrustedConfig_questionnaireName === 'string') {
653
+ config.questionnaireName = untrustedConfig_questionnaireName;
654
+ }
655
+ return config;
656
+ }
657
+ function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
658
+ if (!untrustedIsObject(untrustedConfig)) {
659
+ return null;
660
+ }
661
+ if (process.env.NODE_ENV !== 'production') {
662
+ validateConfig(untrustedConfig, configPropertyNames);
663
+ }
664
+ const config = typeCheckConfig$a(untrustedConfig);
665
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
666
+ return null;
667
+ }
668
+ return config;
669
+ }
670
+ function adapterFragment$5(luvio, config) {
671
+ createResourceParams$a(config);
672
+ return select$s();
673
+ }
674
+ function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
675
+ const snapshot = ingestSuccess$a(luvio, resourceParams, response, {
676
+ config,
677
+ resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
678
+ });
679
+ return luvio.storeBroadcast().then(() => snapshot);
680
+ }
681
+ function onFetchResponseError$5(luvio, config, resourceParams, response) {
682
+ const snapshot = ingestError$5(luvio, resourceParams, response, {
683
+ config,
684
+ resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
685
+ });
686
+ return luvio.storeBroadcast().then(() => snapshot);
687
+ }
688
+ function buildNetworkSnapshot$a(luvio, config, options) {
689
+ const resourceParams = createResourceParams$a(config);
690
+ const request = createResourceRequest$a(resourceParams);
691
+ return luvio.dispatchResourceRequest(request, options)
692
+ .then((response) => {
693
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => getResponseCacheKeys$a(luvio, resourceParams, response.body));
694
+ }, (response) => {
695
+ return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
696
+ });
697
+ }
698
+ function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
699
+ const { luvio, config } = context;
700
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
701
+ const dispatchOptions = {
702
+ resourceRequestContext: {
703
+ requestCorrelator,
704
+ luvioRequestMethod: undefined,
705
+ },
706
+ eventObservers
707
+ };
708
+ if (networkPriority !== 'normal') {
709
+ dispatchOptions.overrides = {
710
+ priority: networkPriority
711
+ };
712
+ }
713
+ return buildNetworkSnapshot$a(luvio, config, dispatchOptions);
714
+ }
715
+ function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
716
+ const { luvio, config } = context;
717
+ const selector = {
718
+ recordId: keyBuilder$h(luvio, config),
719
+ node: adapterFragment$5(luvio, config),
720
+ variables: {},
721
+ };
722
+ const cacheSnapshot = storeLookup(selector, {
723
+ config,
724
+ resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
725
+ });
726
+ return cacheSnapshot;
727
+ }
728
+ const getQuestionnaireAdapterFactory = (luvio) => function LEAP__getQuestionnaire(untrustedConfig, requestContext) {
729
+ const config = validateAdapterConfig$a(untrustedConfig, getQuestionnaire_ConfigPropertyNames);
730
+ // Invalid or incomplete config
731
+ if (config === null) {
732
+ return null;
733
+ }
734
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
735
+ buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
736
+ };
737
+
738
+ function validate$d(obj, path = 'LightningAssistantQuestionnaireInputRepresentation') {
739
+ const v_error = (() => {
740
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
741
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
742
+ }
743
+ const obj_questionToAnswer = obj.questionToAnswer;
744
+ const path_questionToAnswer = path + '.questionToAnswer';
745
+ if (typeof obj_questionToAnswer !== 'object' || ArrayIsArray(obj_questionToAnswer) || obj_questionToAnswer === null) {
746
+ return new TypeError('Expected "object" but received "' + typeof obj_questionToAnswer + '" (at "' + path_questionToAnswer + '")');
747
+ }
748
+ const obj_questionToAnswer_keys = ObjectKeys(obj_questionToAnswer);
749
+ for (let i = 0; i < obj_questionToAnswer_keys.length; i++) {
750
+ const key = obj_questionToAnswer_keys[i];
751
+ const obj_questionToAnswer_prop = obj_questionToAnswer[key];
752
+ const path_questionToAnswer_prop = path_questionToAnswer + '["' + key + '"]';
753
+ if (typeof obj_questionToAnswer_prop !== 'object' || ArrayIsArray(obj_questionToAnswer_prop) || obj_questionToAnswer_prop === null) {
754
+ return new TypeError('Expected "object" but received "' + typeof obj_questionToAnswer_prop + '" (at "' + path_questionToAnswer_prop + '")');
755
+ }
756
+ }
757
+ const obj_status = obj.status;
758
+ const path_status = path + '.status';
759
+ if (typeof obj_status !== 'string') {
760
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
761
+ }
762
+ })();
763
+ return v_error === undefined ? null : v_error;
764
+ }
765
+
766
+ function select$r(luvio, params) {
767
+ return select$t();
768
+ }
769
+ function getResponseCacheKeys$9(luvio, resourceParams, response) {
770
+ return getTypeCacheKeys$8(luvio, response);
771
+ }
772
+ function ingestSuccess$9(luvio, resourceParams, response) {
773
+ const { body } = response;
774
+ const key = keyBuilderFromType$7(luvio, body);
775
+ luvio.storeIngest(key, ingest$8, body);
776
+ const snapshot = luvio.storeLookup({
777
+ recordId: key,
778
+ node: select$r(),
779
+ variables: {},
780
+ });
781
+ if (process.env.NODE_ENV !== 'production') {
782
+ if (snapshot.state !== 'Fulfilled') {
783
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
784
+ }
785
+ }
786
+ return snapshot;
787
+ }
788
+ function createResourceRequest$9(config) {
789
+ const headers = {};
790
+ return {
791
+ baseUri: '/services/data/v58.0',
792
+ basePath: '/assistant-platform/questionnaire/' + config.urlParams.questionnaireName + '',
793
+ method: 'patch',
794
+ body: config.body,
795
+ urlParams: config.urlParams,
796
+ queryParams: {},
797
+ headers,
798
+ priority: 'normal',
799
+ };
800
+ }
801
+
802
+ const saveQuestionnaire_ConfigPropertyNames = {
803
+ displayName: 'saveQuestionnaire',
804
+ parameters: {
805
+ required: ['questionnaireName', 'questionnaireData'],
806
+ optional: []
807
+ }
808
+ };
809
+ function createResourceParams$9(config) {
810
+ const resourceParams = {
811
+ urlParams: {
812
+ questionnaireName: config.questionnaireName
813
+ },
814
+ body: {
815
+ questionnaireData: config.questionnaireData
816
+ }
817
+ };
818
+ return resourceParams;
819
+ }
820
+ function typeCheckConfig$9(untrustedConfig) {
821
+ const config = {};
822
+ const untrustedConfig_questionnaireName = untrustedConfig.questionnaireName;
823
+ if (typeof untrustedConfig_questionnaireName === 'string') {
824
+ config.questionnaireName = untrustedConfig_questionnaireName;
825
+ }
826
+ const untrustedConfig_questionnaireData = untrustedConfig.questionnaireData;
827
+ const referenceLightningAssistantQuestionnaireInputRepresentationValidationError = validate$d(untrustedConfig_questionnaireData);
828
+ if (referenceLightningAssistantQuestionnaireInputRepresentationValidationError === null) {
829
+ config.questionnaireData = untrustedConfig_questionnaireData;
830
+ }
831
+ return config;
832
+ }
833
+ function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
834
+ if (!untrustedIsObject(untrustedConfig)) {
835
+ return null;
836
+ }
837
+ if (process.env.NODE_ENV !== 'production') {
838
+ validateConfig(untrustedConfig, configPropertyNames);
839
+ }
840
+ const config = typeCheckConfig$9(untrustedConfig);
841
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
842
+ return null;
843
+ }
844
+ return config;
845
+ }
846
+ function buildNetworkSnapshot$9(luvio, config, options) {
847
+ const resourceParams = createResourceParams$9(config);
848
+ const request = createResourceRequest$9(resourceParams);
849
+ return luvio.dispatchResourceRequest(request, options)
850
+ .then((response) => {
851
+ return luvio.handleSuccessResponse(() => {
852
+ const snapshot = ingestSuccess$9(luvio, resourceParams, response);
853
+ return luvio.storeBroadcast().then(() => snapshot);
854
+ }, () => getResponseCacheKeys$9(luvio, resourceParams, response.body));
855
+ }, (response) => {
856
+ deepFreeze(response);
857
+ throw response;
858
+ });
859
+ }
860
+ const saveQuestionnaireAdapterFactory = (luvio) => {
861
+ return function saveQuestionnaire(untrustedConfig) {
862
+ const config = validateAdapterConfig$9(untrustedConfig, saveQuestionnaire_ConfigPropertyNames);
863
+ // Invalid or incomplete config
864
+ if (config === null) {
865
+ throw new Error('Invalid config for "saveQuestionnaire"');
866
+ }
867
+ return buildNetworkSnapshot$9(luvio, config);
868
+ };
869
+ };
870
+
871
+ const VERSION$h = "a9a46e0cf983e314934e0703d28f75bf";
872
+ const select$q = function LightningAssistantLinkActionRepresentationSelect() {
873
+ const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$j();
874
+ return {
875
+ kind: 'Fragment',
876
+ version: VERSION$h,
877
+ private: [],
878
+ selections: [
879
+ ...AbstractLightningAssistantActionRepresentationSelections,
880
+ {
881
+ name: 'iconName',
882
+ kind: 'Scalar',
883
+ required: false
884
+ },
885
+ {
886
+ name: 'label',
887
+ kind: 'Scalar',
888
+ required: false
889
+ },
890
+ {
891
+ name: 'url',
892
+ kind: 'Scalar'
893
+ }
894
+ ]
895
+ };
896
+ };
897
+
898
+ const VERSION$g = "c2fb7ece6f9eba9ca7b25608a670310a";
899
+ const select$p = function LightningAssistantCustomActionRepresentationSelect() {
900
+ const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$j();
901
+ return {
902
+ kind: 'Fragment',
903
+ version: VERSION$g,
904
+ private: [],
905
+ selections: [
906
+ ...AbstractLightningAssistantActionRepresentationSelections,
907
+ {
908
+ name: 'actionComponent',
909
+ kind: 'Scalar'
910
+ },
911
+ {
912
+ name: 'customData',
913
+ kind: 'Scalar',
914
+ map: true
915
+ },
916
+ {
917
+ name: 'iconName',
918
+ kind: 'Scalar',
919
+ required: false
920
+ }
921
+ ]
922
+ };
923
+ };
924
+
925
+ const VERSION$f = "376fdaae939e8f46021d153816e03c56";
926
+ const select$o = function LightningAssistantNoActionRepresentationSelect() {
927
+ const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$j();
928
+ return {
929
+ kind: 'Fragment',
930
+ version: VERSION$f,
931
+ private: [],
932
+ selections: [
933
+ ...AbstractLightningAssistantActionRepresentationSelections,
934
+ ]
935
+ };
936
+ };
937
+
938
+ const VERSION$e = "2e0cc24f5c0ab2bbf7b6dade0eecb17e";
939
+ const select$n = function LightningAssistantLsfActionRepresentationSelect() {
940
+ const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$j();
941
+ return {
942
+ kind: 'Fragment',
943
+ version: VERSION$e,
944
+ private: [],
945
+ selections: [
946
+ ...AbstractLightningAssistantActionRepresentationSelections,
947
+ {
948
+ name: 'customData',
949
+ kind: 'Scalar',
950
+ map: true,
951
+ required: false
952
+ },
953
+ {
954
+ name: 'iconName',
955
+ kind: 'Scalar',
956
+ required: false
957
+ },
958
+ {
959
+ name: 'label',
960
+ kind: 'Scalar',
961
+ required: false
962
+ },
963
+ {
964
+ name: 'lsf',
965
+ kind: 'Scalar'
966
+ }
967
+ ]
968
+ };
969
+ };
970
+
971
+ const VERSION$d = "d7605ace66fce89a8ae0436b797d125d";
972
+ const select$m = function LightningAssistantVideoActionRepresentationSelect() {
973
+ const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$j();
974
+ return {
975
+ kind: 'Fragment',
976
+ version: VERSION$d,
977
+ private: [],
978
+ selections: [
979
+ ...AbstractLightningAssistantActionRepresentationSelections,
980
+ {
981
+ name: 'iconName',
982
+ kind: 'Scalar',
983
+ required: false
984
+ },
985
+ {
986
+ name: 'url',
987
+ kind: 'Scalar'
988
+ }
989
+ ]
990
+ };
991
+ };
992
+
993
+ const VERSION$c = "fe9b2afa38e1fc9af6abd29c7fd3e307";
994
+ const select$l = function LightningAssistantWalkthroughActionRepresentationSelect() {
995
+ const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$j();
996
+ return {
997
+ kind: 'Fragment',
998
+ version: VERSION$c,
999
+ private: [],
1000
+ selections: [
1001
+ ...AbstractLightningAssistantActionRepresentationSelections,
1002
+ {
1003
+ name: 'iconName',
1004
+ kind: 'Scalar',
1005
+ required: false
1006
+ },
1007
+ {
1008
+ name: 'promptId',
1009
+ kind: 'Scalar'
1010
+ }
1011
+ ]
1012
+ };
1013
+ };
1014
+
1015
+ const VERSION$b = "2abd7cd970bb200649e8944e43b72de5";
1016
+ const select$k = function LightningAssistantTrailheadActionRepresentationSelect() {
1017
+ const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$j();
1018
+ return {
1019
+ kind: 'Fragment',
1020
+ version: VERSION$b,
1021
+ private: [],
1022
+ selections: [
1023
+ ...AbstractLightningAssistantActionRepresentationSelections,
1024
+ {
1025
+ name: 'iconName',
1026
+ kind: 'Scalar',
1027
+ required: false
1028
+ },
1029
+ {
1030
+ name: 'moduleId',
1031
+ kind: 'Scalar'
1032
+ },
1033
+ {
1034
+ name: 'url',
1035
+ kind: 'Scalar'
1036
+ }
1037
+ ]
1038
+ };
1039
+ };
1040
+
1041
+ var DiscriminatorValues;
1042
+ (function (DiscriminatorValues) {
1043
+ DiscriminatorValues["Link"] = "Link";
1044
+ DiscriminatorValues["Custom"] = "Custom";
1045
+ DiscriminatorValues["NoAction"] = "NoAction";
1046
+ DiscriminatorValues["Lsf"] = "Lsf";
1047
+ DiscriminatorValues["Video"] = "Video";
1048
+ DiscriminatorValues["Walkthrough"] = "Walkthrough";
1049
+ DiscriminatorValues["TlxModule"] = "TlxModule";
1050
+ })(DiscriminatorValues || (DiscriminatorValues = {}));
1051
+ const VERSION$a = "ee8eb1dcdc27527e958bea3bc608ab0c";
1052
+ function validate$c(obj, path = 'AbstractLightningAssistantActionRepresentation') {
1053
+ const v_error = (() => {
1054
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1055
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1056
+ }
1057
+ const obj_actionType = obj.actionType;
1058
+ const path_actionType = path + '.actionType';
1059
+ if (typeof obj_actionType !== 'string') {
1060
+ return new TypeError('Expected "string" but received "' + typeof obj_actionType + '" (at "' + path_actionType + '")');
1061
+ }
1062
+ })();
1063
+ return v_error === undefined ? null : v_error;
1064
+ }
1065
+ const selectChildren = function AbstractLightningAssistantActionRepresentationSelectChildren() {
1066
+ const lightningAssistantLinkActionRepresentationSelections = select$q();
1067
+ const lightningAssistantCustomActionRepresentationSelections = select$p();
1068
+ const lightningAssistantNoActionRepresentationSelections = select$o();
1069
+ const lightningAssistantLsfActionRepresentationSelections = select$n();
1070
+ const lightningAssistantVideoActionRepresentationSelections = select$m();
1071
+ const lightningAssistantWalkthroughActionRepresentationSelections = select$l();
1072
+ const lightningAssistantTrailheadActionRepresentationSelections = select$k();
1073
+ return {
1074
+ kind: 'Fragment',
1075
+ union: true,
1076
+ discriminator: 'actionType',
1077
+ unionSelections: {
1078
+ [DiscriminatorValues.Link]: lightningAssistantLinkActionRepresentationSelections,
1079
+ [DiscriminatorValues.Custom]: lightningAssistantCustomActionRepresentationSelections,
1080
+ [DiscriminatorValues.NoAction]: lightningAssistantNoActionRepresentationSelections,
1081
+ [DiscriminatorValues.Lsf]: lightningAssistantLsfActionRepresentationSelections,
1082
+ [DiscriminatorValues.Video]: lightningAssistantVideoActionRepresentationSelections,
1083
+ [DiscriminatorValues.Walkthrough]: lightningAssistantWalkthroughActionRepresentationSelections,
1084
+ [DiscriminatorValues.TlxModule]: lightningAssistantTrailheadActionRepresentationSelections
1085
+ }
1086
+ };
1087
+ };
1088
+ const select$j = function AbstractLightningAssistantActionRepresentationSelect() {
1089
+ return {
1090
+ kind: 'Fragment',
1091
+ version: VERSION$a,
1092
+ private: [],
1093
+ selections: [
1094
+ {
1095
+ name: 'actionType',
1096
+ kind: 'Scalar'
1097
+ }
1098
+ ]
1099
+ };
1100
+ };
1101
+ function equals$a(existing, incoming) {
1102
+ const existing_actionType = existing.actionType;
1103
+ const incoming_actionType = incoming.actionType;
1104
+ if (!(existing_actionType === incoming_actionType)) {
1105
+ return false;
1106
+ }
1107
+ return true;
1108
+ }
1109
+
1110
+ const VERSION$9 = "28b96e40cf73e94d0650007d61c3214a";
1111
+ function validate$b(obj, path = 'LightningAssistantStepRepresentation') {
1112
+ const v_error = (() => {
1113
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1114
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1115
+ }
1116
+ const obj_action = obj.action;
1117
+ const path_action = path + '.action';
1118
+ const referencepath_actionValidationError = validate$c(obj_action, path_action);
1119
+ if (referencepath_actionValidationError !== null) {
1120
+ let message = 'Object doesn\'t match AbstractLightningAssistantActionRepresentation (at "' + path_action + '")\n';
1121
+ message += referencepath_actionValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1122
+ return new TypeError(message);
1123
+ }
1124
+ if (obj.description !== undefined) {
1125
+ const obj_description = obj.description;
1126
+ const path_description = path + '.description';
1127
+ if (typeof obj_description !== 'string') {
1128
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1129
+ }
1130
+ }
1131
+ if (obj.figureComponent !== undefined) {
1132
+ const obj_figureComponent = obj.figureComponent;
1133
+ const path_figureComponent = path + '.figureComponent';
1134
+ if (typeof obj_figureComponent !== 'string') {
1135
+ return new TypeError('Expected "string" but received "' + typeof obj_figureComponent + '" (at "' + path_figureComponent + '")');
1136
+ }
1137
+ }
1138
+ if (obj.firstSeenTime !== undefined) {
1139
+ const obj_firstSeenTime = obj.firstSeenTime;
1140
+ const path_firstSeenTime = path + '.firstSeenTime';
1141
+ if (typeof obj_firstSeenTime !== 'string') {
1142
+ return new TypeError('Expected "string" but received "' + typeof obj_firstSeenTime + '" (at "' + path_firstSeenTime + '")');
1143
+ }
1144
+ }
1145
+ const obj_id = obj.id;
1146
+ const path_id = path + '.id';
1147
+ if (typeof obj_id !== 'string') {
1148
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1149
+ }
1150
+ const obj_isManaged = obj.isManaged;
1151
+ const path_isManaged = path + '.isManaged';
1152
+ if (typeof obj_isManaged !== 'boolean') {
1153
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isManaged + '" (at "' + path_isManaged + '")');
1154
+ }
1155
+ const obj_status = obj.status;
1156
+ const path_status = path + '.status';
1157
+ if (typeof obj_status !== 'string') {
1158
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1159
+ }
1160
+ if (obj.stepComponent !== undefined) {
1161
+ const obj_stepComponent = obj.stepComponent;
1162
+ const path_stepComponent = path + '.stepComponent';
1163
+ if (typeof obj_stepComponent !== 'string') {
1164
+ return new TypeError('Expected "string" but received "' + typeof obj_stepComponent + '" (at "' + path_stepComponent + '")');
1165
+ }
1166
+ }
1167
+ const obj_tags = obj.tags;
1168
+ const path_tags = path + '.tags';
1169
+ if (!ArrayIsArray(obj_tags)) {
1170
+ return new TypeError('Expected "array" but received "' + typeof obj_tags + '" (at "' + path_tags + '")');
1171
+ }
1172
+ for (let i = 0; i < obj_tags.length; i++) {
1173
+ const obj_tags_item = obj_tags[i];
1174
+ const path_tags_item = path_tags + '[' + i + ']';
1175
+ if (typeof obj_tags_item !== 'string') {
1176
+ return new TypeError('Expected "string" but received "' + typeof obj_tags_item + '" (at "' + path_tags_item + '")');
1177
+ }
1178
+ }
1179
+ const obj_title = obj.title;
1180
+ const path_title = path + '.title';
1181
+ if (typeof obj_title !== 'string') {
1182
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1183
+ }
1184
+ const obj_updateStrategy = obj.updateStrategy;
1185
+ const path_updateStrategy = path + '.updateStrategy';
1186
+ if (typeof obj_updateStrategy !== 'string') {
1187
+ return new TypeError('Expected "string" but received "' + typeof obj_updateStrategy + '" (at "' + path_updateStrategy + '")');
1188
+ }
1189
+ })();
1190
+ return v_error === undefined ? null : v_error;
1191
+ }
1192
+ const RepresentationType$7 = 'LightningAssistantStepRepresentation';
1193
+ function keyBuilder$g(luvio, config) {
1194
+ return keyPrefix + '::' + RepresentationType$7 + ':' + config.step_id;
1195
+ }
1196
+ function keyBuilderFromType$6(luvio, object) {
1197
+ const keyParams = {
1198
+ step_id: object.id
1199
+ };
1200
+ return keyBuilder$g(luvio, keyParams);
1201
+ }
1202
+ function normalize$7(input, existing, path, luvio, store, timestamp) {
1203
+ return input;
1204
+ }
1205
+ const select$i = function LightningAssistantStepRepresentationSelect() {
1206
+ const AbstractLightningAssistantActionRepresentation__unionSelections = selectChildren();
1207
+ return {
1208
+ kind: 'Fragment',
1209
+ version: VERSION$9,
1210
+ private: [],
1211
+ selections: [
1212
+ {
1213
+ kind: 'Object',
1214
+ name: 'action',
1215
+ discriminator: AbstractLightningAssistantActionRepresentation__unionSelections.discriminator,
1216
+ union: true,
1217
+ nullable: false,
1218
+ unionSelections: AbstractLightningAssistantActionRepresentation__unionSelections.unionSelections
1219
+ },
1220
+ {
1221
+ name: 'description',
1222
+ kind: 'Scalar',
1223
+ required: false
1224
+ },
1225
+ {
1226
+ name: 'figureComponent',
1227
+ kind: 'Scalar',
1228
+ required: false
1229
+ },
1230
+ {
1231
+ name: 'firstSeenTime',
1232
+ kind: 'Scalar',
1233
+ required: false
1234
+ },
1235
+ {
1236
+ name: 'id',
1237
+ kind: 'Scalar'
1238
+ },
1239
+ {
1240
+ name: 'isManaged',
1241
+ kind: 'Scalar'
1242
+ },
1243
+ {
1244
+ name: 'status',
1245
+ kind: 'Scalar'
1246
+ },
1247
+ {
1248
+ name: 'stepComponent',
1249
+ kind: 'Scalar',
1250
+ required: false
1251
+ },
1252
+ {
1253
+ name: 'tags',
1254
+ kind: 'Scalar',
1255
+ plural: true
1256
+ },
1257
+ {
1258
+ name: 'title',
1259
+ kind: 'Scalar'
1260
+ },
1261
+ {
1262
+ name: 'updateStrategy',
1263
+ kind: 'Scalar'
1264
+ }
1265
+ ]
1266
+ };
1267
+ };
1268
+ function equals$9(existing, incoming) {
1269
+ const existing_isManaged = existing.isManaged;
1270
+ const incoming_isManaged = incoming.isManaged;
1271
+ if (!(existing_isManaged === incoming_isManaged)) {
1272
+ return false;
1273
+ }
1274
+ const existing_description = existing.description;
1275
+ const incoming_description = incoming.description;
1276
+ // if at least one of these optionals is defined
1277
+ if (existing_description !== undefined || incoming_description !== undefined) {
1278
+ // if one of these is not defined we know the other is defined and therefore
1279
+ // not equal
1280
+ if (existing_description === undefined || incoming_description === undefined) {
1281
+ return false;
1282
+ }
1283
+ if (!(existing_description === incoming_description)) {
1284
+ return false;
1285
+ }
1286
+ }
1287
+ const existing_figureComponent = existing.figureComponent;
1288
+ const incoming_figureComponent = incoming.figureComponent;
1289
+ // if at least one of these optionals is defined
1290
+ if (existing_figureComponent !== undefined || incoming_figureComponent !== undefined) {
1291
+ // if one of these is not defined we know the other is defined and therefore
1292
+ // not equal
1293
+ if (existing_figureComponent === undefined || incoming_figureComponent === undefined) {
1294
+ return false;
1295
+ }
1296
+ if (!(existing_figureComponent === incoming_figureComponent)) {
1297
+ return false;
1298
+ }
1299
+ }
1300
+ const existing_firstSeenTime = existing.firstSeenTime;
1301
+ const incoming_firstSeenTime = incoming.firstSeenTime;
1302
+ // if at least one of these optionals is defined
1303
+ if (existing_firstSeenTime !== undefined || incoming_firstSeenTime !== undefined) {
1304
+ // if one of these is not defined we know the other is defined and therefore
1305
+ // not equal
1306
+ if (existing_firstSeenTime === undefined || incoming_firstSeenTime === undefined) {
1307
+ return false;
1308
+ }
1309
+ if (!(existing_firstSeenTime === incoming_firstSeenTime)) {
1310
+ return false;
1311
+ }
1312
+ }
1313
+ const existing_id = existing.id;
1314
+ const incoming_id = incoming.id;
1315
+ if (!(existing_id === incoming_id)) {
1316
+ return false;
1317
+ }
1318
+ const existing_status = existing.status;
1319
+ const incoming_status = incoming.status;
1320
+ if (!(existing_status === incoming_status)) {
1321
+ return false;
1322
+ }
1323
+ const existing_stepComponent = existing.stepComponent;
1324
+ const incoming_stepComponent = incoming.stepComponent;
1325
+ // if at least one of these optionals is defined
1326
+ if (existing_stepComponent !== undefined || incoming_stepComponent !== undefined) {
1327
+ // if one of these is not defined we know the other is defined and therefore
1328
+ // not equal
1329
+ if (existing_stepComponent === undefined || incoming_stepComponent === undefined) {
1330
+ return false;
1331
+ }
1332
+ if (!(existing_stepComponent === incoming_stepComponent)) {
1333
+ return false;
1334
+ }
1335
+ }
1336
+ const existing_title = existing.title;
1337
+ const incoming_title = incoming.title;
1338
+ if (!(existing_title === incoming_title)) {
1339
+ return false;
1340
+ }
1341
+ const existing_updateStrategy = existing.updateStrategy;
1342
+ const incoming_updateStrategy = incoming.updateStrategy;
1343
+ if (!(existing_updateStrategy === incoming_updateStrategy)) {
1344
+ return false;
1345
+ }
1346
+ const existing_action = existing.action;
1347
+ const incoming_action = incoming.action;
1348
+ if (!(equals$a(existing_action, incoming_action))) {
1349
+ return false;
1350
+ }
1351
+ const existing_tags = existing.tags;
1352
+ const incoming_tags = incoming.tags;
1353
+ const equals_tags_items = equalsArray(existing_tags, incoming_tags, (existing_tags_item, incoming_tags_item) => {
1354
+ if (!(existing_tags_item === incoming_tags_item)) {
1355
+ return false;
1356
+ }
1357
+ });
1358
+ if (equals_tags_items === false) {
1359
+ return false;
1360
+ }
1361
+ return true;
1362
+ }
1363
+ const ingest$7 = function LightningAssistantStepRepresentationIngest(input, path, luvio, store, timestamp) {
1364
+ if (process.env.NODE_ENV !== 'production') {
1365
+ const validateError = validate$b(input);
1366
+ if (validateError !== null) {
1367
+ throw validateError;
1368
+ }
1369
+ }
1370
+ const key = keyBuilderFromType$6(luvio, input);
1371
+ const existingRecord = store.readEntry(key);
1372
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
1373
+ let incomingRecord = normalize$7(input, store.readEntry(key), {
1374
+ fullPath: key,
1375
+ parent: path.parent,
1376
+ propertyName: path.propertyName,
1377
+ ttl: ttlToUse
1378
+ });
1379
+ if (existingRecord === undefined || equals$9(existingRecord, incomingRecord) === false) {
1380
+ luvio.storePublish(key, incomingRecord);
1381
+ }
1382
+ if (ttlToUse !== undefined) {
1383
+ const storeMetadataParams = {
1384
+ ttl: ttlToUse,
1385
+ namespace: "LEAP",
1386
+ version: VERSION$9,
1387
+ representationName: RepresentationType$7,
1388
+ };
1389
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1390
+ }
1391
+ return createLink(key);
1392
+ };
1393
+ function getTypeCacheKeys$7(luvio, input, fullPathFactory) {
1394
+ const rootKeySet = new StoreKeyMap();
1395
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1396
+ const rootKey = keyBuilderFromType$6(luvio, input);
1397
+ rootKeySet.set(rootKey, {
1398
+ namespace: keyPrefix,
1399
+ representationName: RepresentationType$7,
1400
+ mergeable: false
1401
+ });
1402
+ return rootKeySet;
1403
+ }
1404
+
1405
+ function select$h(luvio, params) {
1406
+ return select$i();
1407
+ }
1408
+ function getResponseCacheKeys$8(luvio, resourceParams, response) {
1409
+ return getTypeCacheKeys$7(luvio, response);
1410
+ }
1411
+ function ingestSuccess$8(luvio, resourceParams, response) {
1412
+ const { body } = response;
1413
+ const key = keyBuilderFromType$6(luvio, body);
1414
+ luvio.storeIngest(key, ingest$7, body);
1415
+ const snapshot = luvio.storeLookup({
1416
+ recordId: key,
1417
+ node: select$h(),
1418
+ variables: {},
1419
+ });
1420
+ if (process.env.NODE_ENV !== 'production') {
1421
+ if (snapshot.state !== 'Fulfilled') {
1422
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1423
+ }
1424
+ }
1425
+ return snapshot;
1426
+ }
1427
+ function createResourceRequest$8(config) {
1428
+ const headers = {};
1429
+ return {
1430
+ baseUri: '/services/data/v58.0',
1431
+ basePath: '/assistant-platform/step/' + config.urlParams.stepName + '',
1432
+ method: 'patch',
1433
+ body: null,
1434
+ urlParams: config.urlParams,
1435
+ queryParams: {},
1436
+ headers,
1437
+ priority: 'normal',
1438
+ };
1439
+ }
1440
+
1441
+ const evaluateStep_ConfigPropertyNames = {
1442
+ displayName: 'evaluateStep',
1443
+ parameters: {
1444
+ required: ['stepName'],
1445
+ optional: []
1446
+ }
1447
+ };
1448
+ function createResourceParams$8(config) {
1449
+ const resourceParams = {
1450
+ urlParams: {
1451
+ stepName: config.stepName
1452
+ }
1453
+ };
1454
+ return resourceParams;
1455
+ }
1456
+ function typeCheckConfig$8(untrustedConfig) {
1457
+ const config = {};
1458
+ const untrustedConfig_stepName = untrustedConfig.stepName;
1459
+ if (typeof untrustedConfig_stepName === 'string') {
1460
+ config.stepName = untrustedConfig_stepName;
1461
+ }
1462
+ return config;
1463
+ }
1464
+ function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
1465
+ if (!untrustedIsObject(untrustedConfig)) {
1466
+ return null;
1467
+ }
1468
+ if (process.env.NODE_ENV !== 'production') {
1469
+ validateConfig(untrustedConfig, configPropertyNames);
1470
+ }
1471
+ const config = typeCheckConfig$8(untrustedConfig);
1472
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1473
+ return null;
1474
+ }
1475
+ return config;
1476
+ }
1477
+ function buildNetworkSnapshot$8(luvio, config, options) {
1478
+ const resourceParams = createResourceParams$8(config);
1479
+ const request = createResourceRequest$8(resourceParams);
1480
+ return luvio.dispatchResourceRequest(request, options)
1481
+ .then((response) => {
1482
+ return luvio.handleSuccessResponse(() => {
1483
+ const snapshot = ingestSuccess$8(luvio, resourceParams, response);
1484
+ return luvio.storeBroadcast().then(() => snapshot);
1485
+ }, () => getResponseCacheKeys$8(luvio, resourceParams, response.body));
1486
+ }, (response) => {
1487
+ deepFreeze(response);
1488
+ throw response;
1489
+ });
1490
+ }
1491
+ const evaluateStepAdapterFactory = (luvio) => {
1492
+ return function evaluateStep(untrustedConfig) {
1493
+ const config = validateAdapterConfig$8(untrustedConfig, evaluateStep_ConfigPropertyNames);
1494
+ // Invalid or incomplete config
1495
+ if (config === null) {
1496
+ throw new Error('Invalid config for "evaluateStep"');
1497
+ }
1498
+ return buildNetworkSnapshot$8(luvio, config);
1499
+ };
1500
+ };
1501
+
1502
+ const VERSION$8 = "bc99d93cdafe8300d6f09b735c390bcd";
1503
+ function validate$a(obj, path = 'LightningAssistantLayoutNodeRepresentation') {
1504
+ const v_error = (() => {
1505
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1506
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1507
+ }
1508
+ const obj_children = obj.children;
1509
+ const path_children = path + '.children';
1510
+ if (!ArrayIsArray(obj_children)) {
1511
+ return new TypeError('Expected "array" but received "' + typeof obj_children + '" (at "' + path_children + '")');
1512
+ }
1513
+ for (let i = 0; i < obj_children.length; i++) {
1514
+ const obj_children_item = obj_children[i];
1515
+ const path_children_item = path_children + '[' + i + ']';
1516
+ if (obj_children_item === undefined) {
1517
+ return new TypeError('Expected "defined" but received "' + typeof obj_children_item + '" (at "' + path_children_item + '")');
1518
+ }
1519
+ }
1520
+ const obj_description = obj.description;
1521
+ const path_description = path + '.description';
1522
+ let obj_description_union0 = null;
1523
+ const obj_description_union0_error = (() => {
1524
+ if (typeof obj_description !== 'string') {
1525
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1526
+ }
1527
+ })();
1528
+ if (obj_description_union0_error != null) {
1529
+ obj_description_union0 = obj_description_union0_error.message;
1530
+ }
1531
+ let obj_description_union1 = null;
1532
+ const obj_description_union1_error = (() => {
1533
+ if (obj_description !== null) {
1534
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1535
+ }
1536
+ })();
1537
+ if (obj_description_union1_error != null) {
1538
+ obj_description_union1 = obj_description_union1_error.message;
1539
+ }
1540
+ if (obj_description_union0 && obj_description_union1) {
1541
+ let message = 'Object doesn\'t match union (at "' + path_description + '")';
1542
+ message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
1543
+ message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
1544
+ return new TypeError(message);
1545
+ }
1546
+ const obj_status = obj.status;
1547
+ const path_status = path + '.status';
1548
+ let obj_status_union0 = null;
1549
+ const obj_status_union0_error = (() => {
1550
+ if (typeof obj_status !== 'string') {
1551
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1552
+ }
1553
+ })();
1554
+ if (obj_status_union0_error != null) {
1555
+ obj_status_union0 = obj_status_union0_error.message;
1556
+ }
1557
+ let obj_status_union1 = null;
1558
+ const obj_status_union1_error = (() => {
1559
+ if (obj_status !== null) {
1560
+ return new TypeError('Expected "null" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1561
+ }
1562
+ })();
1563
+ if (obj_status_union1_error != null) {
1564
+ obj_status_union1 = obj_status_union1_error.message;
1565
+ }
1566
+ if (obj_status_union0 && obj_status_union1) {
1567
+ let message = 'Object doesn\'t match union (at "' + path_status + '")';
1568
+ message += '\n' + obj_status_union0.split('\n').map((line) => '\t' + line).join('\n');
1569
+ message += '\n' + obj_status_union1.split('\n').map((line) => '\t' + line).join('\n');
1570
+ return new TypeError(message);
1571
+ }
1572
+ const obj_step = obj.step;
1573
+ const path_step = path + '.step';
1574
+ let obj_step_union0 = null;
1575
+ const obj_step_union0_error = (() => {
1576
+ if (typeof obj_step !== 'object') {
1577
+ return new TypeError('Expected "object" but received "' + typeof obj_step + '" (at "' + path_step + '")');
1578
+ }
1579
+ })();
1580
+ if (obj_step_union0_error != null) {
1581
+ obj_step_union0 = obj_step_union0_error.message;
1582
+ }
1583
+ let obj_step_union1 = null;
1584
+ const obj_step_union1_error = (() => {
1585
+ if (obj_step !== null) {
1586
+ return new TypeError('Expected "null" but received "' + typeof obj_step + '" (at "' + path_step + '")');
1587
+ }
1588
+ })();
1589
+ if (obj_step_union1_error != null) {
1590
+ obj_step_union1 = obj_step_union1_error.message;
1591
+ }
1592
+ if (obj_step_union0 && obj_step_union1) {
1593
+ let message = 'Object doesn\'t match union (at "' + path_step + '")';
1594
+ message += '\n' + obj_step_union0.split('\n').map((line) => '\t' + line).join('\n');
1595
+ message += '\n' + obj_step_union1.split('\n').map((line) => '\t' + line).join('\n');
1596
+ return new TypeError(message);
1597
+ }
1598
+ const obj_tags = obj.tags;
1599
+ const path_tags = path + '.tags';
1600
+ if (!ArrayIsArray(obj_tags)) {
1601
+ return new TypeError('Expected "array" but received "' + typeof obj_tags + '" (at "' + path_tags + '")');
1602
+ }
1603
+ for (let i = 0; i < obj_tags.length; i++) {
1604
+ const obj_tags_item = obj_tags[i];
1605
+ const path_tags_item = path_tags + '[' + i + ']';
1606
+ if (typeof obj_tags_item !== 'string') {
1607
+ return new TypeError('Expected "string" but received "' + typeof obj_tags_item + '" (at "' + path_tags_item + '")');
1608
+ }
1609
+ }
1610
+ const obj_title = obj.title;
1611
+ const path_title = path + '.title';
1612
+ let obj_title_union0 = null;
1613
+ const obj_title_union0_error = (() => {
1614
+ if (typeof obj_title !== 'string') {
1615
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1616
+ }
1617
+ })();
1618
+ if (obj_title_union0_error != null) {
1619
+ obj_title_union0 = obj_title_union0_error.message;
1620
+ }
1621
+ let obj_title_union1 = null;
1622
+ const obj_title_union1_error = (() => {
1623
+ if (obj_title !== null) {
1624
+ return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1625
+ }
1626
+ })();
1627
+ if (obj_title_union1_error != null) {
1628
+ obj_title_union1 = obj_title_union1_error.message;
1629
+ }
1630
+ if (obj_title_union0 && obj_title_union1) {
1631
+ let message = 'Object doesn\'t match union (at "' + path_title + '")';
1632
+ message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
1633
+ message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
1634
+ return new TypeError(message);
1635
+ }
1636
+ const obj_type = obj.type;
1637
+ const path_type = path + '.type';
1638
+ if (typeof obj_type !== 'string') {
1639
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1640
+ }
1641
+ })();
1642
+ return v_error === undefined ? null : v_error;
1643
+ }
1644
+ const RepresentationType$6 = 'LightningAssistantLayoutNodeRepresentation';
1645
+ function normalize$6(input, existing, path, luvio, store, timestamp) {
1646
+ const input_step = input.step;
1647
+ const input_step_id = path.fullPath + '__step';
1648
+ if (input_step !== null && typeof input_step === 'object') {
1649
+ input.step = ingest$7(input_step, {
1650
+ fullPath: input_step_id,
1651
+ propertyName: 'step',
1652
+ parent: {
1653
+ data: input,
1654
+ key: path.fullPath,
1655
+ existing: existing,
1656
+ },
1657
+ ttl: path.ttl
1658
+ }, luvio, store);
1659
+ }
1660
+ return input;
1661
+ }
1662
+ const select$g = function LightningAssistantLayoutNodeRepresentationSelect() {
1663
+ return {
1664
+ kind: 'Fragment',
1665
+ version: VERSION$8,
1666
+ private: [],
1667
+ selections: [
1668
+ {
1669
+ name: 'children',
1670
+ kind: 'Object',
1671
+ // any
1672
+ },
1673
+ {
1674
+ name: 'description',
1675
+ kind: 'Scalar'
1676
+ },
1677
+ {
1678
+ name: 'status',
1679
+ kind: 'Scalar'
1680
+ },
1681
+ {
1682
+ name: 'step',
1683
+ kind: 'Link',
1684
+ nullable: true,
1685
+ fragment: select$i()
1686
+ },
1687
+ {
1688
+ name: 'tags',
1689
+ kind: 'Scalar',
1690
+ plural: true
1691
+ },
1692
+ {
1693
+ name: 'title',
1694
+ kind: 'Scalar'
1695
+ },
1696
+ {
1697
+ name: 'type',
1698
+ kind: 'Scalar'
1699
+ }
1700
+ ]
1701
+ };
1702
+ };
1703
+ function equals$8(existing, incoming) {
1704
+ const existing_type = existing.type;
1705
+ const incoming_type = incoming.type;
1706
+ if (!(existing_type === incoming_type)) {
1707
+ return false;
1708
+ }
1709
+ const existing_children = existing.children;
1710
+ const incoming_children = incoming.children;
1711
+ const equals_children_items = equalsArray(existing_children, incoming_children, (existing_children_item, incoming_children_item) => {
1712
+ if (JSONStringify(incoming_children_item) !== JSONStringify(existing_children_item)) {
1713
+ return false;
1714
+ }
1715
+ });
1716
+ if (equals_children_items === false) {
1717
+ return false;
1718
+ }
1719
+ const existing_description = existing.description;
1720
+ const incoming_description = incoming.description;
1721
+ if (!(existing_description === incoming_description)) {
1722
+ return false;
1723
+ }
1724
+ const existing_status = existing.status;
1725
+ const incoming_status = incoming.status;
1726
+ if (!(existing_status === incoming_status)) {
1727
+ return false;
1728
+ }
1729
+ const existing_step = existing.step;
1730
+ const incoming_step = incoming.step;
1731
+ if (!(existing_step === incoming_step
1732
+ || (existing_step != null &&
1733
+ incoming_step != null &&
1734
+ existing_step.__ref != null &&
1735
+ incoming_step.__ref != null &&
1736
+ existing_step.__ref === incoming_step.__ref))) {
1737
+ return false;
1738
+ }
1739
+ const existing_tags = existing.tags;
1740
+ const incoming_tags = incoming.tags;
1741
+ const equals_tags_items = equalsArray(existing_tags, incoming_tags, (existing_tags_item, incoming_tags_item) => {
1742
+ if (!(existing_tags_item === incoming_tags_item)) {
1743
+ return false;
1744
+ }
1745
+ });
1746
+ if (equals_tags_items === false) {
1747
+ return false;
1748
+ }
1749
+ const existing_title = existing.title;
1750
+ const incoming_title = incoming.title;
1751
+ if (!(existing_title === incoming_title)) {
1752
+ return false;
1753
+ }
1754
+ return true;
1755
+ }
1756
+ const ingest$6 = function LightningAssistantLayoutNodeRepresentationIngest(input, path, luvio, store, timestamp) {
1757
+ if (process.env.NODE_ENV !== 'production') {
1758
+ const validateError = validate$a(input);
1759
+ if (validateError !== null) {
1760
+ throw validateError;
1761
+ }
1762
+ }
1763
+ const key = path.fullPath;
1764
+ const existingRecord = store.readEntry(key);
1765
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
1766
+ let incomingRecord = normalize$6(input, store.readEntry(key), {
1767
+ fullPath: key,
1768
+ parent: path.parent,
1769
+ propertyName: path.propertyName,
1770
+ ttl: ttlToUse
1771
+ }, luvio, store);
1772
+ if (existingRecord === undefined || equals$8(existingRecord, incomingRecord) === false) {
1773
+ luvio.storePublish(key, incomingRecord);
1774
+ }
1775
+ if (ttlToUse !== undefined) {
1776
+ const storeMetadataParams = {
1777
+ ttl: ttlToUse,
1778
+ namespace: "LEAP",
1779
+ version: VERSION$8,
1780
+ representationName: RepresentationType$6,
1781
+ };
1782
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1783
+ }
1784
+ return createLink(key);
1785
+ };
1786
+ function getTypeCacheKeys$6(luvio, input, fullPathFactory) {
1787
+ const rootKeySet = new StoreKeyMap();
1788
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1789
+ const rootKey = fullPathFactory();
1790
+ rootKeySet.set(rootKey, {
1791
+ namespace: keyPrefix,
1792
+ representationName: RepresentationType$6,
1793
+ mergeable: false
1794
+ });
1795
+ if (input.step !== null && typeof input.step === 'object') {
1796
+ const input_step = getTypeCacheKeys$7(luvio, input.step);
1797
+ rootKeySet.merge(input_step);
1798
+ }
1799
+ return rootKeySet;
1800
+ }
1801
+
1802
+ const VERSION$7 = "596a25b0bee0b1db5495fe57dd7bd025";
1803
+ function validate$9(obj, path = 'LightningAssistantRepresentation') {
1804
+ const v_error = (() => {
1805
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1806
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1807
+ }
1808
+ const obj_assistantTarget = obj.assistantTarget;
1809
+ const path_assistantTarget = path + '.assistantTarget';
1810
+ if (typeof obj_assistantTarget !== 'string') {
1811
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
1812
+ }
1813
+ if (obj.category !== undefined) {
1814
+ const obj_category = obj.category;
1815
+ const path_category = path + '.category';
1816
+ if (typeof obj_category !== 'string') {
1817
+ return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
1818
+ }
1819
+ }
1820
+ if (obj.categoryName !== undefined) {
1821
+ const obj_categoryName = obj.categoryName;
1822
+ const path_categoryName = path + '.categoryName';
1823
+ if (typeof obj_categoryName !== 'string') {
1824
+ return new TypeError('Expected "string" but received "' + typeof obj_categoryName + '" (at "' + path_categoryName + '")');
1825
+ }
1826
+ }
1827
+ if (obj.completionDate !== undefined) {
1828
+ const obj_completionDate = obj.completionDate;
1829
+ const path_completionDate = path + '.completionDate';
1830
+ if (typeof obj_completionDate !== 'string') {
1831
+ return new TypeError('Expected "string" but received "' + typeof obj_completionDate + '" (at "' + path_completionDate + '")');
1832
+ }
1833
+ }
1834
+ const obj_contentVersion = obj.contentVersion;
1835
+ const path_contentVersion = path + '.contentVersion';
1836
+ if (typeof obj_contentVersion !== 'string') {
1837
+ return new TypeError('Expected "string" but received "' + typeof obj_contentVersion + '" (at "' + path_contentVersion + '")');
1838
+ }
1839
+ const obj_debugModeEnabled = obj.debugModeEnabled;
1840
+ const path_debugModeEnabled = path + '.debugModeEnabled';
1841
+ if (typeof obj_debugModeEnabled !== 'boolean') {
1842
+ return new TypeError('Expected "boolean" but received "' + typeof obj_debugModeEnabled + '" (at "' + path_debugModeEnabled + '")');
1843
+ }
1844
+ if (obj.description !== undefined) {
1845
+ const obj_description = obj.description;
1846
+ const path_description = path + '.description';
1847
+ if (typeof obj_description !== 'string') {
1848
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1849
+ }
1850
+ }
1851
+ const obj_developerName = obj.developerName;
1852
+ const path_developerName = path + '.developerName';
1853
+ if (typeof obj_developerName !== 'string') {
1854
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
1855
+ }
1856
+ if (obj.estimatedMinutesToComplete !== undefined) {
1857
+ const obj_estimatedMinutesToComplete = obj.estimatedMinutesToComplete;
1858
+ const path_estimatedMinutesToComplete = path + '.estimatedMinutesToComplete';
1859
+ if (typeof obj_estimatedMinutesToComplete !== 'number' || (typeof obj_estimatedMinutesToComplete === 'number' && Math.floor(obj_estimatedMinutesToComplete) !== obj_estimatedMinutesToComplete)) {
1860
+ return new TypeError('Expected "integer" but received "' + typeof obj_estimatedMinutesToComplete + '" (at "' + path_estimatedMinutesToComplete + '")');
1861
+ }
1862
+ }
1863
+ const obj_icon = obj.icon;
1864
+ const path_icon = path + '.icon';
1865
+ if (typeof obj_icon !== 'string') {
1866
+ return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
1867
+ }
1868
+ const obj_isArchived = obj.isArchived;
1869
+ const path_isArchived = path + '.isArchived';
1870
+ if (typeof obj_isArchived !== 'boolean') {
1871
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isArchived + '" (at "' + path_isArchived + '")');
1872
+ }
1873
+ const obj_isPreview = obj.isPreview;
1874
+ const path_isPreview = path + '.isPreview';
1875
+ if (typeof obj_isPreview !== 'boolean') {
1876
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isPreview + '" (at "' + path_isPreview + '")');
1877
+ }
1878
+ const obj_layout = obj.layout;
1879
+ const path_layout = path + '.layout';
1880
+ if (typeof obj_layout !== 'object') {
1881
+ return new TypeError('Expected "object" but received "' + typeof obj_layout + '" (at "' + path_layout + '")');
1882
+ }
1883
+ const obj_numberOfSteps = obj.numberOfSteps;
1884
+ const path_numberOfSteps = path + '.numberOfSteps';
1885
+ if (typeof obj_numberOfSteps !== 'number' || (typeof obj_numberOfSteps === 'number' && Math.floor(obj_numberOfSteps) !== obj_numberOfSteps)) {
1886
+ return new TypeError('Expected "integer" but received "' + typeof obj_numberOfSteps + '" (at "' + path_numberOfSteps + '")');
1887
+ }
1888
+ obj.progress;
1889
+ const obj_questionnaireIds = obj.questionnaireIds;
1890
+ const path_questionnaireIds = path + '.questionnaireIds';
1891
+ if (!ArrayIsArray(obj_questionnaireIds)) {
1892
+ return new TypeError('Expected "array" but received "' + typeof obj_questionnaireIds + '" (at "' + path_questionnaireIds + '")');
1893
+ }
1894
+ for (let i = 0; i < obj_questionnaireIds.length; i++) {
1895
+ const obj_questionnaireIds_item = obj_questionnaireIds[i];
1896
+ const path_questionnaireIds_item = path_questionnaireIds + '[' + i + ']';
1897
+ if (typeof obj_questionnaireIds_item !== 'string') {
1898
+ return new TypeError('Expected "string" but received "' + typeof obj_questionnaireIds_item + '" (at "' + path_questionnaireIds_item + '")');
1899
+ }
1900
+ }
1901
+ const obj_status = obj.status;
1902
+ const path_status = path + '.status';
1903
+ if (typeof obj_status !== 'string') {
1904
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1905
+ }
1906
+ const obj_title = obj.title;
1907
+ const path_title = path + '.title';
1908
+ if (typeof obj_title !== 'string') {
1909
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1910
+ }
1911
+ })();
1912
+ return v_error === undefined ? null : v_error;
1913
+ }
1914
+ const RepresentationType$5 = 'LightningAssistantRepresentation';
1915
+ function keyBuilder$f(luvio, config) {
1916
+ return keyPrefix + '::' + RepresentationType$5 + ':' + config.assistant_name;
1917
+ }
1918
+ function keyBuilderFromType$5(luvio, object) {
1919
+ const keyParams = {
1920
+ assistant_name: object.developerName
1921
+ };
1922
+ return keyBuilder$f(luvio, keyParams);
1923
+ }
1924
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
1925
+ const input_layout = input.layout;
1926
+ const input_layout_id = path.fullPath + '__layout';
1927
+ input.layout = ingest$6(input_layout, {
1928
+ fullPath: input_layout_id,
1929
+ propertyName: 'layout',
1930
+ parent: {
1931
+ data: input,
1932
+ key: path.fullPath,
1933
+ existing: existing,
1934
+ },
1935
+ ttl: path.ttl
1936
+ }, luvio, store);
1937
+ return input;
1938
+ }
1939
+ const select$f = function LightningAssistantRepresentationSelect() {
1940
+ return {
1941
+ kind: 'Fragment',
1942
+ version: VERSION$7,
1943
+ private: [],
1944
+ selections: [
1945
+ {
1946
+ name: 'assistantTarget',
1947
+ kind: 'Scalar'
1948
+ },
1949
+ {
1950
+ name: 'category',
1951
+ kind: 'Scalar',
1952
+ required: false
1953
+ },
1954
+ {
1955
+ name: 'categoryName',
1956
+ kind: 'Scalar',
1957
+ required: false
1958
+ },
1959
+ {
1960
+ name: 'completionDate',
1961
+ kind: 'Scalar',
1962
+ required: false
1963
+ },
1964
+ {
1965
+ name: 'contentVersion',
1966
+ kind: 'Scalar'
1967
+ },
1968
+ {
1969
+ name: 'debugModeEnabled',
1970
+ kind: 'Scalar'
1971
+ },
1972
+ {
1973
+ name: 'description',
1974
+ kind: 'Scalar',
1975
+ required: false
1976
+ },
1977
+ {
1978
+ name: 'developerName',
1979
+ kind: 'Scalar'
1980
+ },
1981
+ {
1982
+ name: 'estimatedMinutesToComplete',
1983
+ kind: 'Scalar',
1984
+ required: false
1985
+ },
1986
+ {
1987
+ name: 'icon',
1988
+ kind: 'Scalar'
1989
+ },
1990
+ {
1991
+ name: 'isArchived',
1992
+ kind: 'Scalar'
1993
+ },
1994
+ {
1995
+ name: 'isPreview',
1996
+ kind: 'Scalar'
1997
+ },
1998
+ {
1999
+ name: 'layout',
2000
+ kind: 'Link',
2001
+ fragment: select$g()
2002
+ },
2003
+ {
2004
+ name: 'numberOfSteps',
2005
+ kind: 'Scalar'
2006
+ },
2007
+ {
2008
+ name: 'progress',
2009
+ kind: 'Scalar'
2010
+ },
2011
+ {
2012
+ name: 'questionnaireIds',
2013
+ kind: 'Scalar',
2014
+ plural: true
2015
+ },
2016
+ {
2017
+ name: 'status',
2018
+ kind: 'Scalar'
2019
+ },
2020
+ {
2021
+ name: 'title',
2022
+ kind: 'Scalar'
2023
+ }
2024
+ ]
2025
+ };
2026
+ };
2027
+ function equals$7(existing, incoming) {
2028
+ const existing_debugModeEnabled = existing.debugModeEnabled;
2029
+ const incoming_debugModeEnabled = incoming.debugModeEnabled;
2030
+ if (!(existing_debugModeEnabled === incoming_debugModeEnabled)) {
2031
+ return false;
2032
+ }
2033
+ const existing_isArchived = existing.isArchived;
2034
+ const incoming_isArchived = incoming.isArchived;
2035
+ if (!(existing_isArchived === incoming_isArchived)) {
2036
+ return false;
2037
+ }
2038
+ const existing_isPreview = existing.isPreview;
2039
+ const incoming_isPreview = incoming.isPreview;
2040
+ if (!(existing_isPreview === incoming_isPreview)) {
2041
+ return false;
2042
+ }
2043
+ const existing_estimatedMinutesToComplete = existing.estimatedMinutesToComplete;
2044
+ const incoming_estimatedMinutesToComplete = incoming.estimatedMinutesToComplete;
2045
+ // if at least one of these optionals is defined
2046
+ if (existing_estimatedMinutesToComplete !== undefined || incoming_estimatedMinutesToComplete !== undefined) {
2047
+ // if one of these is not defined we know the other is defined and therefore
2048
+ // not equal
2049
+ if (existing_estimatedMinutesToComplete === undefined || incoming_estimatedMinutesToComplete === undefined) {
2050
+ return false;
2051
+ }
2052
+ if (!(existing_estimatedMinutesToComplete === incoming_estimatedMinutesToComplete)) {
2053
+ return false;
2054
+ }
2055
+ }
2056
+ const existing_numberOfSteps = existing.numberOfSteps;
2057
+ const incoming_numberOfSteps = incoming.numberOfSteps;
2058
+ if (!(existing_numberOfSteps === incoming_numberOfSteps)) {
2059
+ return false;
2060
+ }
2061
+ const existing_assistantTarget = existing.assistantTarget;
2062
+ const incoming_assistantTarget = incoming.assistantTarget;
2063
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
2064
+ return false;
2065
+ }
2066
+ const existing_category = existing.category;
2067
+ const incoming_category = incoming.category;
2068
+ // if at least one of these optionals is defined
2069
+ if (existing_category !== undefined || incoming_category !== undefined) {
2070
+ // if one of these is not defined we know the other is defined and therefore
2071
+ // not equal
2072
+ if (existing_category === undefined || incoming_category === undefined) {
2073
+ return false;
2074
+ }
2075
+ if (!(existing_category === incoming_category)) {
2076
+ return false;
2077
+ }
2078
+ }
2079
+ const existing_categoryName = existing.categoryName;
2080
+ const incoming_categoryName = incoming.categoryName;
2081
+ // if at least one of these optionals is defined
2082
+ if (existing_categoryName !== undefined || incoming_categoryName !== undefined) {
2083
+ // if one of these is not defined we know the other is defined and therefore
2084
+ // not equal
2085
+ if (existing_categoryName === undefined || incoming_categoryName === undefined) {
2086
+ return false;
2087
+ }
2088
+ if (!(existing_categoryName === incoming_categoryName)) {
2089
+ return false;
2090
+ }
2091
+ }
2092
+ const existing_completionDate = existing.completionDate;
2093
+ const incoming_completionDate = incoming.completionDate;
2094
+ // if at least one of these optionals is defined
2095
+ if (existing_completionDate !== undefined || incoming_completionDate !== undefined) {
2096
+ // if one of these is not defined we know the other is defined and therefore
2097
+ // not equal
2098
+ if (existing_completionDate === undefined || incoming_completionDate === undefined) {
2099
+ return false;
2100
+ }
2101
+ if (!(existing_completionDate === incoming_completionDate)) {
2102
+ return false;
2103
+ }
2104
+ }
2105
+ const existing_contentVersion = existing.contentVersion;
2106
+ const incoming_contentVersion = incoming.contentVersion;
2107
+ if (!(existing_contentVersion === incoming_contentVersion)) {
2108
+ return false;
2109
+ }
2110
+ const existing_description = existing.description;
2111
+ const incoming_description = incoming.description;
2112
+ // if at least one of these optionals is defined
2113
+ if (existing_description !== undefined || incoming_description !== undefined) {
2114
+ // if one of these is not defined we know the other is defined and therefore
2115
+ // not equal
2116
+ if (existing_description === undefined || incoming_description === undefined) {
2117
+ return false;
2118
+ }
2119
+ if (!(existing_description === incoming_description)) {
2120
+ return false;
2121
+ }
2122
+ }
2123
+ const existing_developerName = existing.developerName;
2124
+ const incoming_developerName = incoming.developerName;
2125
+ if (!(existing_developerName === incoming_developerName)) {
2126
+ return false;
2127
+ }
2128
+ const existing_icon = existing.icon;
2129
+ const incoming_icon = incoming.icon;
2130
+ if (!(existing_icon === incoming_icon)) {
2131
+ return false;
2132
+ }
2133
+ const existing_status = existing.status;
2134
+ const incoming_status = incoming.status;
2135
+ if (!(existing_status === incoming_status)) {
2136
+ return false;
2137
+ }
2138
+ const existing_title = existing.title;
2139
+ const incoming_title = incoming.title;
2140
+ if (!(existing_title === incoming_title)) {
2141
+ return false;
2142
+ }
2143
+ const existing_progress = existing.progress;
2144
+ const incoming_progress = incoming.progress;
2145
+ if (!(existing_progress === incoming_progress)) {
2146
+ return false;
2147
+ }
2148
+ const existing_layout = existing.layout;
2149
+ const incoming_layout = incoming.layout;
2150
+ if (!(existing_layout.__ref === incoming_layout.__ref)) {
2151
+ return false;
2152
+ }
2153
+ const existing_questionnaireIds = existing.questionnaireIds;
2154
+ const incoming_questionnaireIds = incoming.questionnaireIds;
2155
+ const equals_questionnaireIds_items = equalsArray(existing_questionnaireIds, incoming_questionnaireIds, (existing_questionnaireIds_item, incoming_questionnaireIds_item) => {
2156
+ if (!(existing_questionnaireIds_item === incoming_questionnaireIds_item)) {
2157
+ return false;
2158
+ }
2159
+ });
2160
+ if (equals_questionnaireIds_items === false) {
2161
+ return false;
2162
+ }
2163
+ return true;
2164
+ }
2165
+ const ingest$5 = function LightningAssistantRepresentationIngest(input, path, luvio, store, timestamp) {
2166
+ if (process.env.NODE_ENV !== 'production') {
2167
+ const validateError = validate$9(input);
2168
+ if (validateError !== null) {
2169
+ throw validateError;
2170
+ }
2171
+ }
2172
+ const key = keyBuilderFromType$5(luvio, input);
2173
+ const existingRecord = store.readEntry(key);
2174
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
2175
+ let incomingRecord = normalize$5(input, store.readEntry(key), {
2176
+ fullPath: key,
2177
+ parent: path.parent,
2178
+ propertyName: path.propertyName,
2179
+ ttl: ttlToUse
2180
+ }, luvio, store);
2181
+ if (existingRecord === undefined || equals$7(existingRecord, incomingRecord) === false) {
2182
+ luvio.storePublish(key, incomingRecord);
2183
+ }
2184
+ if (ttlToUse !== undefined) {
2185
+ const storeMetadataParams = {
2186
+ ttl: ttlToUse,
2187
+ namespace: "LEAP",
2188
+ version: VERSION$7,
2189
+ representationName: RepresentationType$5,
2190
+ };
2191
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2192
+ }
2193
+ return createLink(key);
2194
+ };
2195
+ function getTypeCacheKeys$5(luvio, input, fullPathFactory) {
2196
+ const rootKeySet = new StoreKeyMap();
2197
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2198
+ const rootKey = keyBuilderFromType$5(luvio, input);
2199
+ rootKeySet.set(rootKey, {
2200
+ namespace: keyPrefix,
2201
+ representationName: RepresentationType$5,
2202
+ mergeable: false
2203
+ });
2204
+ const input_layout = getTypeCacheKeys$6(luvio, input.layout, () => rootKey + "__" + "layout");
2205
+ rootKeySet.merge(input_layout);
2206
+ return rootKeySet;
2207
+ }
2208
+
2209
+ function select$e(luvio, params) {
2210
+ return select$f();
2211
+ }
2212
+ function keyBuilder$e(luvio, params) {
2213
+ return keyBuilder$f(luvio, {
2214
+ assistant_name: params.urlParams.assistantName
2215
+ });
2216
+ }
2217
+ function getResponseCacheKeys$7(luvio, resourceParams, response) {
2218
+ return getTypeCacheKeys$5(luvio, response);
2219
+ }
2220
+ function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
2221
+ const { body } = response;
2222
+ const key = keyBuilder$e(luvio, resourceParams);
2223
+ luvio.storeIngest(key, ingest$5, body);
2224
+ const snapshot = luvio.storeLookup({
2225
+ recordId: key,
2226
+ node: select$e(),
2227
+ variables: {},
2228
+ }, snapshotRefresh);
2229
+ if (process.env.NODE_ENV !== 'production') {
2230
+ if (snapshot.state !== 'Fulfilled') {
2231
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2232
+ }
2233
+ }
2234
+ return snapshot;
2235
+ }
2236
+ function ingestError$4(luvio, params, error, snapshotRefresh) {
2237
+ const key = keyBuilder$e(luvio, params);
2238
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2239
+ luvio.storeIngestError(key, errorSnapshot);
2240
+ return errorSnapshot;
2241
+ }
2242
+ function createResourceRequest$7(config) {
2243
+ const headers = {};
2244
+ return {
2245
+ baseUri: '/services/data/v58.0',
2246
+ basePath: '/assistant-platform/' + config.urlParams.assistantName + '',
2247
+ method: 'get',
2248
+ body: null,
2249
+ urlParams: config.urlParams,
2250
+ queryParams: {},
2251
+ headers,
2252
+ priority: 'normal',
2253
+ };
2254
+ }
2255
+
2256
+ const getAssistant_ConfigPropertyNames = {
2257
+ displayName: 'getAssistant',
2258
+ parameters: {
2259
+ required: ['assistantName'],
2260
+ optional: []
2261
+ }
2262
+ };
2263
+ function createResourceParams$7(config) {
2264
+ const resourceParams = {
2265
+ urlParams: {
2266
+ assistantName: config.assistantName
2267
+ }
2268
+ };
2269
+ return resourceParams;
2270
+ }
2271
+ function keyBuilder$d(luvio, config) {
2272
+ const resourceParams = createResourceParams$7(config);
2273
+ return keyBuilder$e(luvio, resourceParams);
2274
+ }
2275
+ function typeCheckConfig$7(untrustedConfig) {
2276
+ const config = {};
2277
+ const untrustedConfig_assistantName = untrustedConfig.assistantName;
2278
+ if (typeof untrustedConfig_assistantName === 'string') {
2279
+ config.assistantName = untrustedConfig_assistantName;
2280
+ }
2281
+ return config;
2282
+ }
2283
+ function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
2284
+ if (!untrustedIsObject(untrustedConfig)) {
2285
+ return null;
2286
+ }
2287
+ if (process.env.NODE_ENV !== 'production') {
2288
+ validateConfig(untrustedConfig, configPropertyNames);
2289
+ }
2290
+ const config = typeCheckConfig$7(untrustedConfig);
2291
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2292
+ return null;
2293
+ }
2294
+ return config;
2295
+ }
2296
+ function adapterFragment$4(luvio, config) {
2297
+ createResourceParams$7(config);
2298
+ return select$e();
2299
+ }
2300
+ function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
2301
+ const snapshot = ingestSuccess$7(luvio, resourceParams, response, {
2302
+ config,
2303
+ resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
2304
+ });
2305
+ return luvio.storeBroadcast().then(() => snapshot);
2306
+ }
2307
+ function onFetchResponseError$4(luvio, config, resourceParams, response) {
2308
+ const snapshot = ingestError$4(luvio, resourceParams, response, {
2309
+ config,
2310
+ resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
2311
+ });
2312
+ return luvio.storeBroadcast().then(() => snapshot);
2313
+ }
2314
+ function buildNetworkSnapshot$7(luvio, config, options) {
2315
+ const resourceParams = createResourceParams$7(config);
2316
+ const request = createResourceRequest$7(resourceParams);
2317
+ return luvio.dispatchResourceRequest(request, options)
2318
+ .then((response) => {
2319
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => getResponseCacheKeys$7(luvio, resourceParams, response.body));
2320
+ }, (response) => {
2321
+ return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
2322
+ });
2323
+ }
2324
+ function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
2325
+ const { luvio, config } = context;
2326
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
2327
+ const dispatchOptions = {
2328
+ resourceRequestContext: {
2329
+ requestCorrelator,
2330
+ luvioRequestMethod: undefined,
2331
+ },
2332
+ eventObservers
2333
+ };
2334
+ if (networkPriority !== 'normal') {
2335
+ dispatchOptions.overrides = {
2336
+ priority: networkPriority
2337
+ };
2338
+ }
2339
+ return buildNetworkSnapshot$7(luvio, config, dispatchOptions);
2340
+ }
2341
+ function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
2342
+ const { luvio, config } = context;
2343
+ const selector = {
2344
+ recordId: keyBuilder$d(luvio, config),
2345
+ node: adapterFragment$4(luvio, config),
2346
+ variables: {},
2347
+ };
2348
+ const cacheSnapshot = storeLookup(selector, {
2349
+ config,
2350
+ resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
2351
+ });
2352
+ return cacheSnapshot;
2353
+ }
2354
+ const getAssistantAdapterFactory = (luvio) => function LEAP__getAssistant(untrustedConfig, requestContext) {
2355
+ const config = validateAdapterConfig$7(untrustedConfig, getAssistant_ConfigPropertyNames);
2356
+ // Invalid or incomplete config
2357
+ if (config === null) {
2358
+ return null;
2359
+ }
2360
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2361
+ buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
2362
+ };
2363
+
2364
+ function validate$8(obj, path = 'LightningAssistantUpdateInputRepresentation') {
2365
+ const v_error = (() => {
2366
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2367
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2368
+ }
2369
+ const obj_items = obj.items;
2370
+ const path_items = path + '.items';
2371
+ if (typeof obj_items !== 'object' || ArrayIsArray(obj_items) || obj_items === null) {
2372
+ return new TypeError('Expected "object" but received "' + typeof obj_items + '" (at "' + path_items + '")');
2373
+ }
2374
+ const obj_items_keys = ObjectKeys(obj_items);
2375
+ for (let i = 0; i < obj_items_keys.length; i++) {
2376
+ const key = obj_items_keys[i];
2377
+ const obj_items_prop = obj_items[key];
2378
+ const path_items_prop = path_items + '["' + key + '"]';
2379
+ if (typeof obj_items_prop !== 'object' || ArrayIsArray(obj_items_prop) || obj_items_prop === null) {
2380
+ return new TypeError('Expected "object" but received "' + typeof obj_items_prop + '" (at "' + path_items_prop + '")');
2381
+ }
2382
+ }
2383
+ })();
2384
+ return v_error === undefined ? null : v_error;
2385
+ }
2386
+
2387
+ function select$d(luvio, params) {
2388
+ return select$f();
2389
+ }
2390
+ function getResponseCacheKeys$6(luvio, resourceParams, response) {
2391
+ return getTypeCacheKeys$5(luvio, response);
2392
+ }
2393
+ function ingestSuccess$6(luvio, resourceParams, response) {
2394
+ const { body } = response;
2395
+ const key = keyBuilderFromType$5(luvio, body);
2396
+ luvio.storeIngest(key, ingest$5, body);
2397
+ const snapshot = luvio.storeLookup({
2398
+ recordId: key,
2399
+ node: select$d(),
2400
+ variables: {},
2401
+ });
2402
+ if (process.env.NODE_ENV !== 'production') {
2403
+ if (snapshot.state !== 'Fulfilled') {
2404
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2405
+ }
2406
+ }
2407
+ return snapshot;
2408
+ }
2409
+ function createResourceRequest$6(config) {
2410
+ const headers = {};
2411
+ return {
2412
+ baseUri: '/services/data/v58.0',
2413
+ basePath: '/assistant-platform/' + config.urlParams.assistantName + '',
2414
+ method: 'patch',
2415
+ body: config.body,
2416
+ urlParams: config.urlParams,
2417
+ queryParams: {},
2418
+ headers,
2419
+ priority: 'normal',
2420
+ };
2421
+ }
2422
+
2423
+ const saveAssistant_ConfigPropertyNames = {
2424
+ displayName: 'saveAssistant',
2425
+ parameters: {
2426
+ required: ['assistantName', 'assistantData'],
2427
+ optional: []
2428
+ }
2429
+ };
2430
+ function createResourceParams$6(config) {
2431
+ const resourceParams = {
2432
+ urlParams: {
2433
+ assistantName: config.assistantName
2434
+ },
2435
+ body: {
2436
+ assistantData: config.assistantData
2437
+ }
2438
+ };
2439
+ return resourceParams;
2440
+ }
2441
+ function typeCheckConfig$6(untrustedConfig) {
2442
+ const config = {};
2443
+ const untrustedConfig_assistantName = untrustedConfig.assistantName;
2444
+ if (typeof untrustedConfig_assistantName === 'string') {
2445
+ config.assistantName = untrustedConfig_assistantName;
2446
+ }
2447
+ const untrustedConfig_assistantData = untrustedConfig.assistantData;
2448
+ const referenceLightningAssistantUpdateInputRepresentationValidationError = validate$8(untrustedConfig_assistantData);
2449
+ if (referenceLightningAssistantUpdateInputRepresentationValidationError === null) {
2450
+ config.assistantData = untrustedConfig_assistantData;
2451
+ }
2452
+ return config;
2453
+ }
2454
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
2455
+ if (!untrustedIsObject(untrustedConfig)) {
2456
+ return null;
2457
+ }
2458
+ if (process.env.NODE_ENV !== 'production') {
2459
+ validateConfig(untrustedConfig, configPropertyNames);
2460
+ }
2461
+ const config = typeCheckConfig$6(untrustedConfig);
2462
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2463
+ return null;
2464
+ }
2465
+ return config;
2466
+ }
2467
+ function buildNetworkSnapshot$6(luvio, config, options) {
2468
+ const resourceParams = createResourceParams$6(config);
2469
+ const request = createResourceRequest$6(resourceParams);
2470
+ return luvio.dispatchResourceRequest(request, options)
2471
+ .then((response) => {
2472
+ return luvio.handleSuccessResponse(() => {
2473
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response);
2474
+ return luvio.storeBroadcast().then(() => snapshot);
2475
+ }, () => getResponseCacheKeys$6(luvio, resourceParams, response.body));
2476
+ }, (response) => {
2477
+ deepFreeze(response);
2478
+ throw response;
2479
+ });
2480
+ }
2481
+ const saveAssistantAdapterFactory = (luvio) => {
2482
+ return function saveAssistant(untrustedConfig) {
2483
+ const config = validateAdapterConfig$6(untrustedConfig, saveAssistant_ConfigPropertyNames);
2484
+ // Invalid or incomplete config
2485
+ if (config === null) {
2486
+ throw new Error('Invalid config for "saveAssistant"');
2487
+ }
2488
+ return buildNetworkSnapshot$6(luvio, config);
2489
+ };
2490
+ };
2491
+
2492
+ const VERSION$6 = "042081dc16ad8bafa711efc0ff696bde";
2493
+ function validate$7(obj, path = 'LightningAssistantQuestionnaireListRepresentation') {
2494
+ const v_error = (() => {
2495
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2496
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2497
+ }
2498
+ const obj_assistantName = obj.assistantName;
2499
+ const path_assistantName = path + '.assistantName';
2500
+ if (typeof obj_assistantName !== 'string') {
2501
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantName + '" (at "' + path_assistantName + '")');
2502
+ }
2503
+ const obj_questionnaireNames = obj.questionnaireNames;
2504
+ const path_questionnaireNames = path + '.questionnaireNames';
2505
+ if (!ArrayIsArray(obj_questionnaireNames)) {
2506
+ return new TypeError('Expected "array" but received "' + typeof obj_questionnaireNames + '" (at "' + path_questionnaireNames + '")');
2507
+ }
2508
+ for (let i = 0; i < obj_questionnaireNames.length; i++) {
2509
+ const obj_questionnaireNames_item = obj_questionnaireNames[i];
2510
+ const path_questionnaireNames_item = path_questionnaireNames + '[' + i + ']';
2511
+ if (typeof obj_questionnaireNames_item !== 'string') {
2512
+ return new TypeError('Expected "string" but received "' + typeof obj_questionnaireNames_item + '" (at "' + path_questionnaireNames_item + '")');
2513
+ }
2514
+ }
2515
+ })();
2516
+ return v_error === undefined ? null : v_error;
2517
+ }
2518
+ const RepresentationType$4 = 'LightningAssistantQuestionnaireListRepresentation';
2519
+ function keyBuilder$c(luvio, config) {
2520
+ return keyPrefix + '::' + RepresentationType$4 + ':' + config.assistant_name;
2521
+ }
2522
+ function keyBuilderFromType$4(luvio, object) {
2523
+ const keyParams = {
2524
+ assistant_name: object.assistantName
2525
+ };
2526
+ return keyBuilder$c(luvio, keyParams);
2527
+ }
2528
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
2529
+ return input;
2530
+ }
2531
+ const select$c = function LightningAssistantQuestionnaireListRepresentationSelect() {
2532
+ return {
2533
+ kind: 'Fragment',
2534
+ version: VERSION$6,
2535
+ private: [],
2536
+ selections: [
2537
+ {
2538
+ name: 'assistantName',
2539
+ kind: 'Scalar'
2540
+ },
2541
+ {
2542
+ name: 'questionnaireNames',
2543
+ kind: 'Scalar',
2544
+ plural: true
2545
+ }
2546
+ ]
2547
+ };
2548
+ };
2549
+ function equals$6(existing, incoming) {
2550
+ const existing_assistantName = existing.assistantName;
2551
+ const incoming_assistantName = incoming.assistantName;
2552
+ if (!(existing_assistantName === incoming_assistantName)) {
2553
+ return false;
2554
+ }
2555
+ const existing_questionnaireNames = existing.questionnaireNames;
2556
+ const incoming_questionnaireNames = incoming.questionnaireNames;
2557
+ const equals_questionnaireNames_items = equalsArray(existing_questionnaireNames, incoming_questionnaireNames, (existing_questionnaireNames_item, incoming_questionnaireNames_item) => {
2558
+ if (!(existing_questionnaireNames_item === incoming_questionnaireNames_item)) {
2559
+ return false;
2560
+ }
2561
+ });
2562
+ if (equals_questionnaireNames_items === false) {
2563
+ return false;
2564
+ }
2565
+ return true;
2566
+ }
2567
+ const ingest$4 = function LightningAssistantQuestionnaireListRepresentationIngest(input, path, luvio, store, timestamp) {
2568
+ if (process.env.NODE_ENV !== 'production') {
2569
+ const validateError = validate$7(input);
2570
+ if (validateError !== null) {
2571
+ throw validateError;
2572
+ }
2573
+ }
2574
+ const key = keyBuilderFromType$4(luvio, input);
2575
+ const existingRecord = store.readEntry(key);
2576
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
2577
+ let incomingRecord = normalize$4(input, store.readEntry(key), {
2578
+ fullPath: key,
2579
+ parent: path.parent,
2580
+ propertyName: path.propertyName,
2581
+ ttl: ttlToUse
2582
+ });
2583
+ if (existingRecord === undefined || equals$6(existingRecord, incomingRecord) === false) {
2584
+ luvio.storePublish(key, incomingRecord);
2585
+ }
2586
+ if (ttlToUse !== undefined) {
2587
+ const storeMetadataParams = {
2588
+ ttl: ttlToUse,
2589
+ namespace: "LEAP",
2590
+ version: VERSION$6,
2591
+ representationName: RepresentationType$4,
2592
+ };
2593
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2594
+ }
2595
+ return createLink(key);
2596
+ };
2597
+ function getTypeCacheKeys$4(luvio, input, fullPathFactory) {
2598
+ const rootKeySet = new StoreKeyMap();
2599
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2600
+ const rootKey = keyBuilderFromType$4(luvio, input);
2601
+ rootKeySet.set(rootKey, {
2602
+ namespace: keyPrefix,
2603
+ representationName: RepresentationType$4,
2604
+ mergeable: false
2605
+ });
2606
+ return rootKeySet;
2607
+ }
2608
+
2609
+ function select$b(luvio, params) {
2610
+ return select$c();
2611
+ }
2612
+ function keyBuilder$b(luvio, params) {
2613
+ return keyBuilder$c(luvio, {
2614
+ assistant_name: params.urlParams.assistantName
2615
+ });
2616
+ }
2617
+ function getResponseCacheKeys$5(luvio, resourceParams, response) {
2618
+ return getTypeCacheKeys$4(luvio, response);
2619
+ }
2620
+ function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
2621
+ const { body } = response;
2622
+ const key = keyBuilder$b(luvio, resourceParams);
2623
+ luvio.storeIngest(key, ingest$4, body);
2624
+ const snapshot = luvio.storeLookup({
2625
+ recordId: key,
2626
+ node: select$b(),
2627
+ variables: {},
2628
+ }, snapshotRefresh);
2629
+ if (process.env.NODE_ENV !== 'production') {
2630
+ if (snapshot.state !== 'Fulfilled') {
2631
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2632
+ }
2633
+ }
2634
+ return snapshot;
2635
+ }
2636
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
2637
+ const key = keyBuilder$b(luvio, params);
2638
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2639
+ luvio.storeIngestError(key, errorSnapshot);
2640
+ return errorSnapshot;
2641
+ }
2642
+ function createResourceRequest$5(config) {
2643
+ const headers = {};
2644
+ return {
2645
+ baseUri: '/services/data/v58.0',
2646
+ basePath: '/assistant-platform/' + config.urlParams.assistantName + '/questionnaires',
2647
+ method: 'get',
2648
+ body: null,
2649
+ urlParams: config.urlParams,
2650
+ queryParams: {},
2651
+ headers,
2652
+ priority: 'normal',
2653
+ };
2654
+ }
2655
+
2656
+ const getQuestionnaires_ConfigPropertyNames = {
2657
+ displayName: 'getQuestionnaires',
2658
+ parameters: {
2659
+ required: ['assistantName'],
2660
+ optional: []
2661
+ }
2662
+ };
2663
+ function createResourceParams$5(config) {
2664
+ const resourceParams = {
2665
+ urlParams: {
2666
+ assistantName: config.assistantName
2667
+ }
2668
+ };
2669
+ return resourceParams;
2670
+ }
2671
+ function keyBuilder$a(luvio, config) {
2672
+ const resourceParams = createResourceParams$5(config);
2673
+ return keyBuilder$b(luvio, resourceParams);
2674
+ }
2675
+ function typeCheckConfig$5(untrustedConfig) {
2676
+ const config = {};
2677
+ const untrustedConfig_assistantName = untrustedConfig.assistantName;
2678
+ if (typeof untrustedConfig_assistantName === 'string') {
2679
+ config.assistantName = untrustedConfig_assistantName;
2680
+ }
2681
+ return config;
2682
+ }
2683
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
2684
+ if (!untrustedIsObject(untrustedConfig)) {
2685
+ return null;
2686
+ }
2687
+ if (process.env.NODE_ENV !== 'production') {
2688
+ validateConfig(untrustedConfig, configPropertyNames);
2689
+ }
2690
+ const config = typeCheckConfig$5(untrustedConfig);
2691
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2692
+ return null;
2693
+ }
2694
+ return config;
2695
+ }
2696
+ function adapterFragment$3(luvio, config) {
2697
+ createResourceParams$5(config);
2698
+ return select$b();
2699
+ }
2700
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
2701
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
2702
+ config,
2703
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
2704
+ });
2705
+ return luvio.storeBroadcast().then(() => snapshot);
2706
+ }
2707
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
2708
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
2709
+ config,
2710
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
2711
+ });
2712
+ return luvio.storeBroadcast().then(() => snapshot);
2713
+ }
2714
+ function buildNetworkSnapshot$5(luvio, config, options) {
2715
+ const resourceParams = createResourceParams$5(config);
2716
+ const request = createResourceRequest$5(resourceParams);
2717
+ return luvio.dispatchResourceRequest(request, options)
2718
+ .then((response) => {
2719
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => getResponseCacheKeys$5(luvio, resourceParams, response.body));
2720
+ }, (response) => {
2721
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
2722
+ });
2723
+ }
2724
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
2725
+ const { luvio, config } = context;
2726
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
2727
+ const dispatchOptions = {
2728
+ resourceRequestContext: {
2729
+ requestCorrelator,
2730
+ luvioRequestMethod: undefined,
2731
+ },
2732
+ eventObservers
2733
+ };
2734
+ if (networkPriority !== 'normal') {
2735
+ dispatchOptions.overrides = {
2736
+ priority: networkPriority
2737
+ };
2738
+ }
2739
+ return buildNetworkSnapshot$5(luvio, config, dispatchOptions);
2740
+ }
2741
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
2742
+ const { luvio, config } = context;
2743
+ const selector = {
2744
+ recordId: keyBuilder$a(luvio, config),
2745
+ node: adapterFragment$3(luvio, config),
2746
+ variables: {},
2747
+ };
2748
+ const cacheSnapshot = storeLookup(selector, {
2749
+ config,
2750
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
2751
+ });
2752
+ return cacheSnapshot;
2753
+ }
2754
+ const getQuestionnairesAdapterFactory = (luvio) => function LEAP__getQuestionnaires(untrustedConfig, requestContext) {
2755
+ const config = validateAdapterConfig$5(untrustedConfig, getQuestionnaires_ConfigPropertyNames);
2756
+ // Invalid or incomplete config
2757
+ if (config === null) {
2758
+ return null;
2759
+ }
2760
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2761
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
2762
+ };
2763
+
2764
+ const VERSION$5 = "107898f86df2248eab831be29f7e7205";
2765
+ function validate$6(obj, path = 'LightningAssistantCategoryRepresentation') {
2766
+ const v_error = (() => {
2767
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2768
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2769
+ }
2770
+ const obj_developerName = obj.developerName;
2771
+ const path_developerName = path + '.developerName';
2772
+ if (typeof obj_developerName !== 'string') {
2773
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
2774
+ }
2775
+ const obj_recommended = obj.recommended;
2776
+ const path_recommended = path + '.recommended';
2777
+ if (typeof obj_recommended !== 'boolean') {
2778
+ return new TypeError('Expected "boolean" but received "' + typeof obj_recommended + '" (at "' + path_recommended + '")');
2779
+ }
2780
+ const obj_title = obj.title;
2781
+ const path_title = path + '.title';
2782
+ if (typeof obj_title !== 'string') {
2783
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
2784
+ }
2785
+ })();
2786
+ return v_error === undefined ? null : v_error;
2787
+ }
2788
+ const select$a = function LightningAssistantCategoryRepresentationSelect() {
2789
+ return {
2790
+ kind: 'Fragment',
2791
+ version: VERSION$5,
2792
+ private: [],
2793
+ selections: [
2794
+ {
2795
+ name: 'developerName',
2796
+ kind: 'Scalar'
2797
+ },
2798
+ {
2799
+ name: 'recommended',
2800
+ kind: 'Scalar'
2801
+ },
2802
+ {
2803
+ name: 'title',
2804
+ kind: 'Scalar'
2805
+ }
2806
+ ]
2807
+ };
2808
+ };
2809
+ function equals$5(existing, incoming) {
2810
+ const existing_recommended = existing.recommended;
2811
+ const incoming_recommended = incoming.recommended;
2812
+ if (!(existing_recommended === incoming_recommended)) {
2813
+ return false;
2814
+ }
2815
+ const existing_developerName = existing.developerName;
2816
+ const incoming_developerName = incoming.developerName;
2817
+ if (!(existing_developerName === incoming_developerName)) {
2818
+ return false;
2819
+ }
2820
+ const existing_title = existing.title;
2821
+ const incoming_title = incoming.title;
2822
+ if (!(existing_title === incoming_title)) {
2823
+ return false;
2824
+ }
2825
+ return true;
2826
+ }
2827
+
2828
+ const VERSION$4 = "f629b70d652ad385840baede1ec16739";
2829
+ function validate$5(obj, path = 'LightningAssistantTargetRepresentation') {
2830
+ const v_error = (() => {
2831
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2832
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2833
+ }
2834
+ const obj_categoryList = obj.categoryList;
2835
+ const path_categoryList = path + '.categoryList';
2836
+ if (!ArrayIsArray(obj_categoryList)) {
2837
+ return new TypeError('Expected "array" but received "' + typeof obj_categoryList + '" (at "' + path_categoryList + '")');
2838
+ }
2839
+ for (let i = 0; i < obj_categoryList.length; i++) {
2840
+ const obj_categoryList_item = obj_categoryList[i];
2841
+ const path_categoryList_item = path_categoryList + '[' + i + ']';
2842
+ const referencepath_categoryList_itemValidationError = validate$6(obj_categoryList_item, path_categoryList_item);
2843
+ if (referencepath_categoryList_itemValidationError !== null) {
2844
+ let message = 'Object doesn\'t match LightningAssistantCategoryRepresentation (at "' + path_categoryList_item + '")\n';
2845
+ message += referencepath_categoryList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2846
+ return new TypeError(message);
2847
+ }
2848
+ }
2849
+ const obj_developerName = obj.developerName;
2850
+ const path_developerName = path + '.developerName';
2851
+ if (typeof obj_developerName !== 'string') {
2852
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
2853
+ }
2854
+ })();
2855
+ return v_error === undefined ? null : v_error;
2856
+ }
2857
+ const RepresentationType$3 = 'LightningAssistantTargetRepresentation';
2858
+ function keyBuilder$9(luvio, config) {
2859
+ return keyPrefix + '::' + RepresentationType$3 + ':' + config.assistant_target;
2860
+ }
2861
+ function keyBuilderFromType$3(luvio, object) {
2862
+ const keyParams = {
2863
+ assistant_target: object.developerName
2864
+ };
2865
+ return keyBuilder$9(luvio, keyParams);
2866
+ }
2867
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
2868
+ return input;
2869
+ }
2870
+ const select$9 = function LightningAssistantTargetRepresentationSelect() {
2871
+ const { selections: LightningAssistantCategoryRepresentation__selections, opaque: LightningAssistantCategoryRepresentation__opaque, } = select$a();
2872
+ return {
2873
+ kind: 'Fragment',
2874
+ version: VERSION$4,
2875
+ private: [],
2876
+ selections: [
2877
+ {
2878
+ name: 'categoryList',
2879
+ kind: 'Object',
2880
+ plural: true,
2881
+ selections: LightningAssistantCategoryRepresentation__selections
2882
+ },
2883
+ {
2884
+ name: 'developerName',
2885
+ kind: 'Scalar'
2886
+ }
2887
+ ]
2888
+ };
2889
+ };
2890
+ function equals$4(existing, incoming) {
2891
+ const existing_developerName = existing.developerName;
2892
+ const incoming_developerName = incoming.developerName;
2893
+ if (!(existing_developerName === incoming_developerName)) {
2894
+ return false;
2895
+ }
2896
+ const existing_categoryList = existing.categoryList;
2897
+ const incoming_categoryList = incoming.categoryList;
2898
+ const equals_categoryList_items = equalsArray(existing_categoryList, incoming_categoryList, (existing_categoryList_item, incoming_categoryList_item) => {
2899
+ if (!(equals$5(existing_categoryList_item, incoming_categoryList_item))) {
2900
+ return false;
2901
+ }
2902
+ });
2903
+ if (equals_categoryList_items === false) {
2904
+ return false;
2905
+ }
2906
+ return true;
2907
+ }
2908
+ const ingest$3 = function LightningAssistantTargetRepresentationIngest(input, path, luvio, store, timestamp) {
2909
+ if (process.env.NODE_ENV !== 'production') {
2910
+ const validateError = validate$5(input);
2911
+ if (validateError !== null) {
2912
+ throw validateError;
2913
+ }
2914
+ }
2915
+ const key = keyBuilderFromType$3(luvio, input);
2916
+ const existingRecord = store.readEntry(key);
2917
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
2918
+ let incomingRecord = normalize$3(input, store.readEntry(key), {
2919
+ fullPath: key,
2920
+ parent: path.parent,
2921
+ propertyName: path.propertyName,
2922
+ ttl: ttlToUse
2923
+ });
2924
+ if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
2925
+ luvio.storePublish(key, incomingRecord);
2926
+ }
2927
+ if (ttlToUse !== undefined) {
2928
+ const storeMetadataParams = {
2929
+ ttl: ttlToUse,
2930
+ namespace: "LEAP",
2931
+ version: VERSION$4,
2932
+ representationName: RepresentationType$3,
2933
+ };
2934
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2935
+ }
2936
+ return createLink(key);
2937
+ };
2938
+ function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
2939
+ const rootKeySet = new StoreKeyMap();
2940
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2941
+ const rootKey = keyBuilderFromType$3(luvio, input);
2942
+ rootKeySet.set(rootKey, {
2943
+ namespace: keyPrefix,
2944
+ representationName: RepresentationType$3,
2945
+ mergeable: false
2946
+ });
2947
+ return rootKeySet;
2948
+ }
2949
+
2950
+ function select$8(luvio, params) {
2951
+ return select$9();
2952
+ }
2953
+ function keyBuilder$8(luvio, params) {
2954
+ return keyBuilder$9(luvio, {
2955
+ assistant_target: params.urlParams.assistantTarget
2956
+ });
2957
+ }
2958
+ function getResponseCacheKeys$4(luvio, resourceParams, response) {
2959
+ return getTypeCacheKeys$3(luvio, response);
2960
+ }
2961
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
2962
+ const { body } = response;
2963
+ const key = keyBuilder$8(luvio, resourceParams);
2964
+ luvio.storeIngest(key, ingest$3, body);
2965
+ const snapshot = luvio.storeLookup({
2966
+ recordId: key,
2967
+ node: select$8(),
2968
+ variables: {},
2969
+ }, snapshotRefresh);
2970
+ if (process.env.NODE_ENV !== 'production') {
2971
+ if (snapshot.state !== 'Fulfilled') {
2972
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2973
+ }
2974
+ }
2975
+ return snapshot;
2976
+ }
2977
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
2978
+ const key = keyBuilder$8(luvio, params);
2979
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2980
+ luvio.storeIngestError(key, errorSnapshot);
2981
+ return errorSnapshot;
2982
+ }
2983
+ function createResourceRequest$4(config) {
2984
+ const headers = {};
2985
+ return {
2986
+ baseUri: '/services/data/v58.0',
2987
+ basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/info',
2988
+ method: 'get',
2989
+ body: null,
2990
+ urlParams: config.urlParams,
2991
+ queryParams: {},
2992
+ headers,
2993
+ priority: 'normal',
2994
+ };
2995
+ }
2996
+
2997
+ const getAssistantTarget_ConfigPropertyNames = {
2998
+ displayName: 'getAssistantTarget',
2999
+ parameters: {
3000
+ required: ['assistantTarget'],
3001
+ optional: []
3002
+ }
3003
+ };
3004
+ function createResourceParams$4(config) {
3005
+ const resourceParams = {
3006
+ urlParams: {
3007
+ assistantTarget: config.assistantTarget
3008
+ }
3009
+ };
3010
+ return resourceParams;
3011
+ }
3012
+ function keyBuilder$7(luvio, config) {
3013
+ const resourceParams = createResourceParams$4(config);
3014
+ return keyBuilder$8(luvio, resourceParams);
3015
+ }
3016
+ function typeCheckConfig$4(untrustedConfig) {
3017
+ const config = {};
3018
+ const untrustedConfig_assistantTarget = untrustedConfig.assistantTarget;
3019
+ if (typeof untrustedConfig_assistantTarget === 'string') {
3020
+ config.assistantTarget = untrustedConfig_assistantTarget;
3021
+ }
3022
+ return config;
3023
+ }
3024
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
3025
+ if (!untrustedIsObject(untrustedConfig)) {
3026
+ return null;
3027
+ }
3028
+ if (process.env.NODE_ENV !== 'production') {
3029
+ validateConfig(untrustedConfig, configPropertyNames);
3030
+ }
3031
+ const config = typeCheckConfig$4(untrustedConfig);
3032
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3033
+ return null;
3034
+ }
3035
+ return config;
3036
+ }
3037
+ function adapterFragment$2(luvio, config) {
3038
+ createResourceParams$4(config);
3039
+ return select$8();
3040
+ }
3041
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
3042
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
3043
+ config,
3044
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
3045
+ });
3046
+ return luvio.storeBroadcast().then(() => snapshot);
3047
+ }
3048
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
3049
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
3050
+ config,
3051
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
3052
+ });
3053
+ return luvio.storeBroadcast().then(() => snapshot);
3054
+ }
3055
+ function buildNetworkSnapshot$4(luvio, config, options) {
3056
+ const resourceParams = createResourceParams$4(config);
3057
+ const request = createResourceRequest$4(resourceParams);
3058
+ return luvio.dispatchResourceRequest(request, options)
3059
+ .then((response) => {
3060
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$4(luvio, resourceParams, response.body));
3061
+ }, (response) => {
3062
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
3063
+ });
3064
+ }
3065
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
3066
+ const { luvio, config } = context;
3067
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
3068
+ const dispatchOptions = {
3069
+ resourceRequestContext: {
3070
+ requestCorrelator,
3071
+ luvioRequestMethod: undefined,
3072
+ },
3073
+ eventObservers
3074
+ };
3075
+ if (networkPriority !== 'normal') {
3076
+ dispatchOptions.overrides = {
3077
+ priority: networkPriority
3078
+ };
3079
+ }
3080
+ return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
3081
+ }
3082
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
3083
+ const { luvio, config } = context;
3084
+ const selector = {
3085
+ recordId: keyBuilder$7(luvio, config),
3086
+ node: adapterFragment$2(luvio, config),
3087
+ variables: {},
3088
+ };
3089
+ const cacheSnapshot = storeLookup(selector, {
3090
+ config,
3091
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
3092
+ });
3093
+ return cacheSnapshot;
3094
+ }
3095
+ const getAssistantTargetAdapterFactory = (luvio) => function LEAP__getAssistantTarget(untrustedConfig, requestContext) {
3096
+ const config = validateAdapterConfig$4(untrustedConfig, getAssistantTarget_ConfigPropertyNames);
3097
+ // Invalid or incomplete config
3098
+ if (config === null) {
3099
+ return null;
3100
+ }
3101
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3102
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
3103
+ };
3104
+
3105
+ const VERSION$3 = "f2e480ff95d6a6b46f4a4b00d2d40a04";
3106
+ function validate$4(obj, path = 'LightningAssistantInitializationRepresentation') {
3107
+ const v_error = (() => {
3108
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3109
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3110
+ }
3111
+ const obj_assistantTarget = obj.assistantTarget;
3112
+ const path_assistantTarget = path + '.assistantTarget';
3113
+ if (typeof obj_assistantTarget !== 'string') {
3114
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
3115
+ }
3116
+ const obj_isInitialized = obj.isInitialized;
3117
+ const path_isInitialized = path + '.isInitialized';
3118
+ if (typeof obj_isInitialized !== 'boolean') {
3119
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isInitialized + '" (at "' + path_isInitialized + '")');
3120
+ }
3121
+ })();
3122
+ return v_error === undefined ? null : v_error;
3123
+ }
3124
+ const RepresentationType$2 = 'LightningAssistantInitializationRepresentation';
3125
+ function keyBuilder$6(luvio, config) {
3126
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.is_initialized + ':' + config.assistant_target;
3127
+ }
3128
+ function keyBuilderFromType$2(luvio, object) {
3129
+ const keyParams = {
3130
+ is_initialized: object.isInitialized,
3131
+ assistant_target: object.assistantTarget
3132
+ };
3133
+ return keyBuilder$6(luvio, keyParams);
3134
+ }
3135
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
3136
+ return input;
3137
+ }
3138
+ const select$7 = function LightningAssistantInitializationRepresentationSelect() {
3139
+ return {
3140
+ kind: 'Fragment',
3141
+ version: VERSION$3,
3142
+ private: [],
3143
+ selections: [
3144
+ {
3145
+ name: 'assistantTarget',
3146
+ kind: 'Scalar'
3147
+ },
3148
+ {
3149
+ name: 'isInitialized',
3150
+ kind: 'Scalar'
3151
+ }
3152
+ ]
3153
+ };
3154
+ };
3155
+ function equals$3(existing, incoming) {
3156
+ const existing_isInitialized = existing.isInitialized;
3157
+ const incoming_isInitialized = incoming.isInitialized;
3158
+ if (!(existing_isInitialized === incoming_isInitialized)) {
3159
+ return false;
3160
+ }
3161
+ const existing_assistantTarget = existing.assistantTarget;
3162
+ const incoming_assistantTarget = incoming.assistantTarget;
3163
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
3164
+ return false;
3165
+ }
3166
+ return true;
3167
+ }
3168
+ const ingest$2 = function LightningAssistantInitializationRepresentationIngest(input, path, luvio, store, timestamp) {
3169
+ if (process.env.NODE_ENV !== 'production') {
3170
+ const validateError = validate$4(input);
3171
+ if (validateError !== null) {
3172
+ throw validateError;
3173
+ }
3174
+ }
3175
+ const key = keyBuilderFromType$2(luvio, input);
3176
+ const existingRecord = store.readEntry(key);
3177
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
3178
+ let incomingRecord = normalize$2(input, store.readEntry(key), {
3179
+ fullPath: key,
3180
+ parent: path.parent,
3181
+ propertyName: path.propertyName,
3182
+ ttl: ttlToUse
3183
+ });
3184
+ if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
3185
+ luvio.storePublish(key, incomingRecord);
3186
+ }
3187
+ if (ttlToUse !== undefined) {
3188
+ const storeMetadataParams = {
3189
+ ttl: ttlToUse,
3190
+ namespace: "LEAP",
3191
+ version: VERSION$3,
3192
+ representationName: RepresentationType$2,
3193
+ };
3194
+ luvio.publishStoreMetadata(key, storeMetadataParams);
3195
+ }
3196
+ return createLink(key);
3197
+ };
3198
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
3199
+ const rootKeySet = new StoreKeyMap();
3200
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3201
+ const rootKey = keyBuilderFromType$2(luvio, input);
3202
+ rootKeySet.set(rootKey, {
3203
+ namespace: keyPrefix,
3204
+ representationName: RepresentationType$2,
3205
+ mergeable: false
3206
+ });
3207
+ return rootKeySet;
3208
+ }
3209
+
3210
+ function select$6(luvio, params) {
3211
+ return select$7();
3212
+ }
3213
+ function getResponseCacheKeys$3(luvio, resourceParams, response) {
3214
+ return getTypeCacheKeys$2(luvio, response);
3215
+ }
3216
+ function ingestSuccess$3(luvio, resourceParams, response) {
3217
+ const { body } = response;
3218
+ const key = keyBuilderFromType$2(luvio, body);
3219
+ luvio.storeIngest(key, ingest$2, body);
3220
+ const snapshot = luvio.storeLookup({
3221
+ recordId: key,
3222
+ node: select$6(),
3223
+ variables: {},
3224
+ });
3225
+ if (process.env.NODE_ENV !== 'production') {
3226
+ if (snapshot.state !== 'Fulfilled') {
3227
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3228
+ }
3229
+ }
3230
+ return snapshot;
3231
+ }
3232
+ function createResourceRequest$3(config) {
3233
+ const headers = {};
3234
+ return {
3235
+ baseUri: '/services/data/v58.0',
3236
+ basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/initialize',
3237
+ method: 'put',
3238
+ body: null,
3239
+ urlParams: config.urlParams,
3240
+ queryParams: {},
3241
+ headers,
3242
+ priority: 'normal',
3243
+ };
3244
+ }
3245
+
3246
+ const initialize_ConfigPropertyNames = {
3247
+ displayName: 'initialize',
3248
+ parameters: {
3249
+ required: ['assistantTarget'],
3250
+ optional: []
3251
+ }
3252
+ };
3253
+ function createResourceParams$3(config) {
3254
+ const resourceParams = {
3255
+ urlParams: {
3256
+ assistantTarget: config.assistantTarget
3257
+ }
3258
+ };
3259
+ return resourceParams;
3260
+ }
3261
+ function typeCheckConfig$3(untrustedConfig) {
3262
+ const config = {};
3263
+ const untrustedConfig_assistantTarget = untrustedConfig.assistantTarget;
3264
+ if (typeof untrustedConfig_assistantTarget === 'string') {
3265
+ config.assistantTarget = untrustedConfig_assistantTarget;
3266
+ }
3267
+ return config;
3268
+ }
3269
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
3270
+ if (!untrustedIsObject(untrustedConfig)) {
3271
+ return null;
3272
+ }
3273
+ if (process.env.NODE_ENV !== 'production') {
3274
+ validateConfig(untrustedConfig, configPropertyNames);
3275
+ }
3276
+ const config = typeCheckConfig$3(untrustedConfig);
3277
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3278
+ return null;
3279
+ }
3280
+ return config;
3281
+ }
3282
+ function buildNetworkSnapshot$3(luvio, config, options) {
3283
+ const resourceParams = createResourceParams$3(config);
3284
+ const request = createResourceRequest$3(resourceParams);
3285
+ return luvio.dispatchResourceRequest(request, options)
3286
+ .then((response) => {
3287
+ return luvio.handleSuccessResponse(() => {
3288
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
3289
+ return luvio.storeBroadcast().then(() => snapshot);
3290
+ }, () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
3291
+ }, (response) => {
3292
+ deepFreeze(response);
3293
+ throw response;
3294
+ });
3295
+ }
3296
+ const initializeAdapterFactory = (luvio) => {
3297
+ return function initialize(untrustedConfig) {
3298
+ const config = validateAdapterConfig$3(untrustedConfig, initialize_ConfigPropertyNames);
3299
+ // Invalid or incomplete config
3300
+ if (config === null) {
3301
+ throw new Error('Invalid config for "initialize"');
3302
+ }
3303
+ return buildNetworkSnapshot$3(luvio, config);
3304
+ };
3305
+ };
3306
+
3307
+ const VERSION$2 = "86eec990f47f496e2991fb9e5ccf0802";
3308
+ function validate$3(obj, path = 'LightningAssistantListRepresentation') {
3309
+ const v_error = (() => {
3310
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3311
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3312
+ }
3313
+ const obj_assistantList = obj.assistantList;
3314
+ const path_assistantList = path + '.assistantList';
3315
+ if (!ArrayIsArray(obj_assistantList)) {
3316
+ return new TypeError('Expected "array" but received "' + typeof obj_assistantList + '" (at "' + path_assistantList + '")');
3317
+ }
3318
+ for (let i = 0; i < obj_assistantList.length; i++) {
3319
+ const obj_assistantList_item = obj_assistantList[i];
3320
+ const path_assistantList_item = path_assistantList + '[' + i + ']';
3321
+ if (typeof obj_assistantList_item !== 'object') {
3322
+ return new TypeError('Expected "object" but received "' + typeof obj_assistantList_item + '" (at "' + path_assistantList_item + '")');
3323
+ }
3324
+ }
3325
+ const obj_assistantTarget = obj.assistantTarget;
3326
+ const path_assistantTarget = path + '.assistantTarget';
3327
+ if (typeof obj_assistantTarget !== 'string') {
3328
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
3329
+ }
3330
+ })();
3331
+ return v_error === undefined ? null : v_error;
3332
+ }
3333
+ const RepresentationType$1 = 'LightningAssistantListRepresentation';
3334
+ function keyBuilder$5(luvio, config) {
3335
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.assistant_target;
3336
+ }
3337
+ function keyBuilderFromType$1(luvio, object) {
3338
+ const keyParams = {
3339
+ assistant_target: object.assistantTarget
3340
+ };
3341
+ return keyBuilder$5(luvio, keyParams);
3342
+ }
3343
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
3344
+ const input_assistantList = input.assistantList;
3345
+ const input_assistantList_id = path.fullPath + '__assistantList';
3346
+ for (let i = 0; i < input_assistantList.length; i++) {
3347
+ const input_assistantList_item = input_assistantList[i];
3348
+ let input_assistantList_item_id = input_assistantList_id + '__' + i;
3349
+ input_assistantList[i] = ingest$5(input_assistantList_item, {
3350
+ fullPath: input_assistantList_item_id,
3351
+ propertyName: i,
3352
+ parent: {
3353
+ data: input,
3354
+ key: path.fullPath,
3355
+ existing: existing,
3356
+ },
3357
+ ttl: path.ttl
3358
+ }, luvio, store);
3359
+ }
3360
+ return input;
3361
+ }
3362
+ const select$5 = function LightningAssistantListRepresentationSelect() {
3363
+ return {
3364
+ kind: 'Fragment',
3365
+ version: VERSION$2,
3366
+ private: [],
3367
+ selections: [
3368
+ {
3369
+ name: 'assistantList',
3370
+ kind: 'Link',
3371
+ plural: true,
3372
+ fragment: select$f()
3373
+ },
3374
+ {
3375
+ name: 'assistantTarget',
3376
+ kind: 'Scalar'
3377
+ }
3378
+ ]
3379
+ };
3380
+ };
3381
+ function equals$2(existing, incoming) {
3382
+ const existing_assistantTarget = existing.assistantTarget;
3383
+ const incoming_assistantTarget = incoming.assistantTarget;
3384
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
3385
+ return false;
3386
+ }
3387
+ const existing_assistantList = existing.assistantList;
3388
+ const incoming_assistantList = incoming.assistantList;
3389
+ const equals_assistantList_items = equalsArray(existing_assistantList, incoming_assistantList, (existing_assistantList_item, incoming_assistantList_item) => {
3390
+ if (!(existing_assistantList_item.__ref === incoming_assistantList_item.__ref)) {
3391
+ return false;
3392
+ }
3393
+ });
3394
+ if (equals_assistantList_items === false) {
3395
+ return false;
3396
+ }
3397
+ return true;
3398
+ }
3399
+ const ingest$1 = function LightningAssistantListRepresentationIngest(input, path, luvio, store, timestamp) {
3400
+ if (process.env.NODE_ENV !== 'production') {
3401
+ const validateError = validate$3(input);
3402
+ if (validateError !== null) {
3403
+ throw validateError;
3404
+ }
3405
+ }
3406
+ const key = keyBuilderFromType$1(luvio, input);
3407
+ const existingRecord = store.readEntry(key);
3408
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
3409
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
3410
+ fullPath: key,
3411
+ parent: path.parent,
3412
+ propertyName: path.propertyName,
3413
+ ttl: ttlToUse
3414
+ }, luvio, store);
3415
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
3416
+ luvio.storePublish(key, incomingRecord);
3417
+ }
3418
+ if (ttlToUse !== undefined) {
3419
+ const storeMetadataParams = {
3420
+ ttl: ttlToUse,
3421
+ namespace: "LEAP",
3422
+ version: VERSION$2,
3423
+ representationName: RepresentationType$1,
3424
+ };
3425
+ luvio.publishStoreMetadata(key, storeMetadataParams);
3426
+ }
3427
+ return createLink(key);
3428
+ };
3429
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
3430
+ const rootKeySet = new StoreKeyMap();
3431
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3432
+ const rootKey = keyBuilderFromType$1(luvio, input);
3433
+ rootKeySet.set(rootKey, {
3434
+ namespace: keyPrefix,
3435
+ representationName: RepresentationType$1,
3436
+ mergeable: false
3437
+ });
3438
+ const input_assistantList_length = input.assistantList.length;
3439
+ for (let i = 0; i < input_assistantList_length; i++) {
3440
+ rootKeySet.merge(getTypeCacheKeys$5(luvio, input.assistantList[i]));
3441
+ }
3442
+ return rootKeySet;
3443
+ }
3444
+
3445
+ function select$4(luvio, params) {
3446
+ return select$5();
3447
+ }
3448
+ function keyBuilder$4(luvio, params) {
3449
+ return keyBuilder$5(luvio, {
3450
+ assistant_target: params.urlParams.assistantTarget
3451
+ });
3452
+ }
3453
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
3454
+ return getTypeCacheKeys$1(luvio, response);
3455
+ }
3456
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
3457
+ const { body } = response;
3458
+ const key = keyBuilder$4(luvio, resourceParams);
3459
+ luvio.storeIngest(key, ingest$1, body);
3460
+ const snapshot = luvio.storeLookup({
3461
+ recordId: key,
3462
+ node: select$4(),
3463
+ variables: {},
3464
+ }, snapshotRefresh);
3465
+ if (process.env.NODE_ENV !== 'production') {
3466
+ if (snapshot.state !== 'Fulfilled') {
3467
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3468
+ }
3469
+ }
3470
+ return snapshot;
3471
+ }
3472
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
3473
+ const key = keyBuilder$4(luvio, params);
3474
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3475
+ luvio.storeIngestError(key, errorSnapshot);
3476
+ return errorSnapshot;
3477
+ }
3478
+ function createResourceRequest$2(config) {
3479
+ const headers = {};
3480
+ return {
3481
+ baseUri: '/services/data/v58.0',
3482
+ basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/list',
3483
+ method: 'get',
3484
+ body: null,
3485
+ urlParams: config.urlParams,
3486
+ queryParams: {},
3487
+ headers,
3488
+ priority: 'normal',
3489
+ };
3490
+ }
3491
+
3492
+ const getAssistantList_ConfigPropertyNames = {
3493
+ displayName: 'getAssistantList',
3494
+ parameters: {
3495
+ required: ['assistantTarget'],
3496
+ optional: []
3497
+ }
3498
+ };
3499
+ function createResourceParams$2(config) {
3500
+ const resourceParams = {
3501
+ urlParams: {
3502
+ assistantTarget: config.assistantTarget
3503
+ }
3504
+ };
3505
+ return resourceParams;
3506
+ }
3507
+ function keyBuilder$3(luvio, config) {
3508
+ const resourceParams = createResourceParams$2(config);
3509
+ return keyBuilder$4(luvio, resourceParams);
3510
+ }
3511
+ function typeCheckConfig$2(untrustedConfig) {
3512
+ const config = {};
3513
+ const untrustedConfig_assistantTarget = untrustedConfig.assistantTarget;
3514
+ if (typeof untrustedConfig_assistantTarget === 'string') {
3515
+ config.assistantTarget = untrustedConfig_assistantTarget;
3516
+ }
3517
+ return config;
3518
+ }
3519
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
3520
+ if (!untrustedIsObject(untrustedConfig)) {
3521
+ return null;
3522
+ }
3523
+ if (process.env.NODE_ENV !== 'production') {
3524
+ validateConfig(untrustedConfig, configPropertyNames);
3525
+ }
3526
+ const config = typeCheckConfig$2(untrustedConfig);
3527
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3528
+ return null;
3529
+ }
3530
+ return config;
3531
+ }
3532
+ function adapterFragment$1(luvio, config) {
3533
+ createResourceParams$2(config);
3534
+ return select$4();
3535
+ }
3536
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
3537
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
3538
+ config,
3539
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
3540
+ });
3541
+ return luvio.storeBroadcast().then(() => snapshot);
3542
+ }
3543
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
3544
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
3545
+ config,
3546
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
3547
+ });
3548
+ return luvio.storeBroadcast().then(() => snapshot);
3549
+ }
3550
+ function buildNetworkSnapshot$2(luvio, config, options) {
3551
+ const resourceParams = createResourceParams$2(config);
3552
+ const request = createResourceRequest$2(resourceParams);
3553
+ return luvio.dispatchResourceRequest(request, options)
3554
+ .then((response) => {
3555
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
3556
+ }, (response) => {
3557
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
3558
+ });
3559
+ }
3560
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
3561
+ const { luvio, config } = context;
3562
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
3563
+ const dispatchOptions = {
3564
+ resourceRequestContext: {
3565
+ requestCorrelator,
3566
+ luvioRequestMethod: undefined,
3567
+ },
3568
+ eventObservers
3569
+ };
3570
+ if (networkPriority !== 'normal') {
3571
+ dispatchOptions.overrides = {
3572
+ priority: networkPriority
3573
+ };
3574
+ }
3575
+ return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
3576
+ }
3577
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
3578
+ const { luvio, config } = context;
3579
+ const selector = {
3580
+ recordId: keyBuilder$3(luvio, config),
3581
+ node: adapterFragment$1(luvio, config),
3582
+ variables: {},
3583
+ };
3584
+ const cacheSnapshot = storeLookup(selector, {
3585
+ config,
3586
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
3587
+ });
3588
+ return cacheSnapshot;
3589
+ }
3590
+ const getAssistantListAdapterFactory = (luvio) => function LEAP__getAssistantList(untrustedConfig, requestContext) {
3591
+ const config = validateAdapterConfig$2(untrustedConfig, getAssistantList_ConfigPropertyNames);
3592
+ // Invalid or incomplete config
3593
+ if (config === null) {
3594
+ return null;
3595
+ }
3596
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3597
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
3598
+ };
3599
+
3600
+ function validate$2(obj, path = 'LightningAssistantListInputRepresentation') {
3601
+ const v_error = (() => {
3602
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3603
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3604
+ }
3605
+ const obj_assistantList = obj.assistantList;
3606
+ const path_assistantList = path + '.assistantList';
3607
+ if (typeof obj_assistantList !== 'object' || ArrayIsArray(obj_assistantList) || obj_assistantList === null) {
3608
+ return new TypeError('Expected "object" but received "' + typeof obj_assistantList + '" (at "' + path_assistantList + '")');
3609
+ }
3610
+ const obj_assistantList_keys = ObjectKeys(obj_assistantList);
3611
+ for (let i = 0; i < obj_assistantList_keys.length; i++) {
3612
+ const key = obj_assistantList_keys[i];
3613
+ const obj_assistantList_prop = obj_assistantList[key];
3614
+ const path_assistantList_prop = path_assistantList + '["' + key + '"]';
3615
+ if (typeof obj_assistantList_prop !== 'object' || ArrayIsArray(obj_assistantList_prop) || obj_assistantList_prop === null) {
3616
+ return new TypeError('Expected "object" but received "' + typeof obj_assistantList_prop + '" (at "' + path_assistantList_prop + '")');
3617
+ }
3618
+ }
3619
+ })();
3620
+ return v_error === undefined ? null : v_error;
3621
+ }
3622
+
3623
+ function select$3(luvio, params) {
3624
+ return select$5();
3625
+ }
3626
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
3627
+ return getTypeCacheKeys$1(luvio, response);
3628
+ }
3629
+ function ingestSuccess$1(luvio, resourceParams, response) {
3630
+ const { body } = response;
3631
+ const key = keyBuilderFromType$1(luvio, body);
3632
+ luvio.storeIngest(key, ingest$1, body);
3633
+ const snapshot = luvio.storeLookup({
3634
+ recordId: key,
3635
+ node: select$3(),
3636
+ variables: {},
3637
+ });
3638
+ if (process.env.NODE_ENV !== 'production') {
3639
+ if (snapshot.state !== 'Fulfilled') {
3640
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3641
+ }
3642
+ }
3643
+ return snapshot;
3644
+ }
3645
+ function createResourceRequest$1(config) {
3646
+ const headers = {};
3647
+ return {
3648
+ baseUri: '/services/data/v58.0',
3649
+ basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/list',
3650
+ method: 'patch',
3651
+ body: config.body,
3652
+ urlParams: config.urlParams,
3653
+ queryParams: {},
3654
+ headers,
3655
+ priority: 'normal',
3656
+ };
3657
+ }
3658
+
3659
+ const saveAssistantList_ConfigPropertyNames = {
3660
+ displayName: 'saveAssistantList',
3661
+ parameters: {
3662
+ required: ['assistantTarget', 'assistantData'],
3663
+ optional: []
3664
+ }
3665
+ };
3666
+ function createResourceParams$1(config) {
3667
+ const resourceParams = {
3668
+ urlParams: {
3669
+ assistantTarget: config.assistantTarget
3670
+ },
3671
+ body: {
3672
+ assistantData: config.assistantData
3673
+ }
3674
+ };
3675
+ return resourceParams;
3676
+ }
3677
+ function typeCheckConfig$1(untrustedConfig) {
3678
+ const config = {};
3679
+ const untrustedConfig_assistantTarget = untrustedConfig.assistantTarget;
3680
+ if (typeof untrustedConfig_assistantTarget === 'string') {
3681
+ config.assistantTarget = untrustedConfig_assistantTarget;
3682
+ }
3683
+ const untrustedConfig_assistantData = untrustedConfig.assistantData;
3684
+ const referenceLightningAssistantListInputRepresentationValidationError = validate$2(untrustedConfig_assistantData);
3685
+ if (referenceLightningAssistantListInputRepresentationValidationError === null) {
3686
+ config.assistantData = untrustedConfig_assistantData;
3687
+ }
3688
+ return config;
3689
+ }
3690
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
3691
+ if (!untrustedIsObject(untrustedConfig)) {
3692
+ return null;
3693
+ }
3694
+ if (process.env.NODE_ENV !== 'production') {
3695
+ validateConfig(untrustedConfig, configPropertyNames);
3696
+ }
3697
+ const config = typeCheckConfig$1(untrustedConfig);
3698
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3699
+ return null;
3700
+ }
3701
+ return config;
3702
+ }
3703
+ function buildNetworkSnapshot$1(luvio, config, options) {
3704
+ const resourceParams = createResourceParams$1(config);
3705
+ const request = createResourceRequest$1(resourceParams);
3706
+ return luvio.dispatchResourceRequest(request, options)
3707
+ .then((response) => {
3708
+ return luvio.handleSuccessResponse(() => {
3709
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
3710
+ return luvio.storeBroadcast().then(() => snapshot);
3711
+ }, () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
3712
+ }, (response) => {
3713
+ deepFreeze(response);
3714
+ throw response;
3715
+ });
3716
+ }
3717
+ const saveAssistantListAdapterFactory = (luvio) => {
3718
+ return function saveAssistantList(untrustedConfig) {
3719
+ const config = validateAdapterConfig$1(untrustedConfig, saveAssistantList_ConfigPropertyNames);
3720
+ // Invalid or incomplete config
3721
+ if (config === null) {
3722
+ throw new Error('Invalid config for "saveAssistantList"');
3723
+ }
3724
+ return buildNetworkSnapshot$1(luvio, config);
3725
+ };
3726
+ };
3727
+
3728
+ const VERSION$1 = "60c238eb770e68fa40b048eee3d01775";
3729
+ function validate$1(obj, path = 'LightningAssistantInfoRepresentation') {
3730
+ const v_error = (() => {
3731
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3732
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3733
+ }
3734
+ const obj_assistantTarget = obj.assistantTarget;
3735
+ const path_assistantTarget = path + '.assistantTarget';
3736
+ if (typeof obj_assistantTarget !== 'string') {
3737
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
3738
+ }
3739
+ if (obj.category !== undefined) {
3740
+ const obj_category = obj.category;
3741
+ const path_category = path + '.category';
3742
+ if (typeof obj_category !== 'string') {
3743
+ return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
3744
+ }
3745
+ }
3746
+ if (obj.categoryName !== undefined) {
3747
+ const obj_categoryName = obj.categoryName;
3748
+ const path_categoryName = path + '.categoryName';
3749
+ if (typeof obj_categoryName !== 'string') {
3750
+ return new TypeError('Expected "string" but received "' + typeof obj_categoryName + '" (at "' + path_categoryName + '")');
3751
+ }
3752
+ }
3753
+ const obj_contentVersion = obj.contentVersion;
3754
+ const path_contentVersion = path + '.contentVersion';
3755
+ if (typeof obj_contentVersion !== 'string') {
3756
+ return new TypeError('Expected "string" but received "' + typeof obj_contentVersion + '" (at "' + path_contentVersion + '")');
3757
+ }
3758
+ const obj_debugModeEnabled = obj.debugModeEnabled;
3759
+ const path_debugModeEnabled = path + '.debugModeEnabled';
3760
+ if (typeof obj_debugModeEnabled !== 'boolean') {
3761
+ return new TypeError('Expected "boolean" but received "' + typeof obj_debugModeEnabled + '" (at "' + path_debugModeEnabled + '")');
3762
+ }
3763
+ const obj_description = obj.description;
3764
+ const path_description = path + '.description';
3765
+ if (typeof obj_description !== 'string') {
3766
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
3767
+ }
3768
+ const obj_developerName = obj.developerName;
3769
+ const path_developerName = path + '.developerName';
3770
+ if (typeof obj_developerName !== 'string') {
3771
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
3772
+ }
3773
+ const obj_icon = obj.icon;
3774
+ const path_icon = path + '.icon';
3775
+ if (typeof obj_icon !== 'string') {
3776
+ return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
3777
+ }
3778
+ const obj_isPreview = obj.isPreview;
3779
+ const path_isPreview = path + '.isPreview';
3780
+ if (typeof obj_isPreview !== 'boolean') {
3781
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isPreview + '" (at "' + path_isPreview + '")');
3782
+ }
3783
+ const obj_title = obj.title;
3784
+ const path_title = path + '.title';
3785
+ if (typeof obj_title !== 'string') {
3786
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
3787
+ }
3788
+ })();
3789
+ return v_error === undefined ? null : v_error;
3790
+ }
3791
+ const select$2 = function LightningAssistantInfoRepresentationSelect() {
3792
+ return {
3793
+ kind: 'Fragment',
3794
+ version: VERSION$1,
3795
+ private: [],
3796
+ selections: [
3797
+ {
3798
+ name: 'assistantTarget',
3799
+ kind: 'Scalar'
3800
+ },
3801
+ {
3802
+ name: 'category',
3803
+ kind: 'Scalar',
3804
+ required: false
3805
+ },
3806
+ {
3807
+ name: 'categoryName',
3808
+ kind: 'Scalar',
3809
+ required: false
3810
+ },
3811
+ {
3812
+ name: 'contentVersion',
3813
+ kind: 'Scalar'
3814
+ },
3815
+ {
3816
+ name: 'debugModeEnabled',
3817
+ kind: 'Scalar'
3818
+ },
3819
+ {
3820
+ name: 'description',
3821
+ kind: 'Scalar'
3822
+ },
3823
+ {
3824
+ name: 'developerName',
3825
+ kind: 'Scalar'
3826
+ },
3827
+ {
3828
+ name: 'icon',
3829
+ kind: 'Scalar'
3830
+ },
3831
+ {
3832
+ name: 'isPreview',
3833
+ kind: 'Scalar'
3834
+ },
3835
+ {
3836
+ name: 'title',
3837
+ kind: 'Scalar'
3838
+ }
3839
+ ]
3840
+ };
3841
+ };
3842
+ function equals$1(existing, incoming) {
3843
+ const existing_debugModeEnabled = existing.debugModeEnabled;
3844
+ const incoming_debugModeEnabled = incoming.debugModeEnabled;
3845
+ if (!(existing_debugModeEnabled === incoming_debugModeEnabled)) {
3846
+ return false;
3847
+ }
3848
+ const existing_isPreview = existing.isPreview;
3849
+ const incoming_isPreview = incoming.isPreview;
3850
+ if (!(existing_isPreview === incoming_isPreview)) {
3851
+ return false;
3852
+ }
3853
+ const existing_assistantTarget = existing.assistantTarget;
3854
+ const incoming_assistantTarget = incoming.assistantTarget;
3855
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
3856
+ return false;
3857
+ }
3858
+ const existing_category = existing.category;
3859
+ const incoming_category = incoming.category;
3860
+ // if at least one of these optionals is defined
3861
+ if (existing_category !== undefined || incoming_category !== undefined) {
3862
+ // if one of these is not defined we know the other is defined and therefore
3863
+ // not equal
3864
+ if (existing_category === undefined || incoming_category === undefined) {
3865
+ return false;
3866
+ }
3867
+ if (!(existing_category === incoming_category)) {
3868
+ return false;
3869
+ }
3870
+ }
3871
+ const existing_categoryName = existing.categoryName;
3872
+ const incoming_categoryName = incoming.categoryName;
3873
+ // if at least one of these optionals is defined
3874
+ if (existing_categoryName !== undefined || incoming_categoryName !== undefined) {
3875
+ // if one of these is not defined we know the other is defined and therefore
3876
+ // not equal
3877
+ if (existing_categoryName === undefined || incoming_categoryName === undefined) {
3878
+ return false;
3879
+ }
3880
+ if (!(existing_categoryName === incoming_categoryName)) {
3881
+ return false;
3882
+ }
3883
+ }
3884
+ const existing_contentVersion = existing.contentVersion;
3885
+ const incoming_contentVersion = incoming.contentVersion;
3886
+ if (!(existing_contentVersion === incoming_contentVersion)) {
3887
+ return false;
3888
+ }
3889
+ const existing_description = existing.description;
3890
+ const incoming_description = incoming.description;
3891
+ if (!(existing_description === incoming_description)) {
3892
+ return false;
3893
+ }
3894
+ const existing_developerName = existing.developerName;
3895
+ const incoming_developerName = incoming.developerName;
3896
+ if (!(existing_developerName === incoming_developerName)) {
3897
+ return false;
3898
+ }
3899
+ const existing_icon = existing.icon;
3900
+ const incoming_icon = incoming.icon;
3901
+ if (!(existing_icon === incoming_icon)) {
3902
+ return false;
3903
+ }
3904
+ const existing_title = existing.title;
3905
+ const incoming_title = incoming.title;
3906
+ if (!(existing_title === incoming_title)) {
3907
+ return false;
3908
+ }
3909
+ return true;
3910
+ }
3911
+
3912
+ const VERSION = "d3f2957d23e995fb380f62e85e1d26ea";
3913
+ function validate(obj, path = 'LightningAssistantInfoListRepresentation') {
3914
+ const v_error = (() => {
3915
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3916
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3917
+ }
3918
+ const obj_assistantInfoList = obj.assistantInfoList;
3919
+ const path_assistantInfoList = path + '.assistantInfoList';
3920
+ if (!ArrayIsArray(obj_assistantInfoList)) {
3921
+ return new TypeError('Expected "array" but received "' + typeof obj_assistantInfoList + '" (at "' + path_assistantInfoList + '")');
3922
+ }
3923
+ for (let i = 0; i < obj_assistantInfoList.length; i++) {
3924
+ const obj_assistantInfoList_item = obj_assistantInfoList[i];
3925
+ const path_assistantInfoList_item = path_assistantInfoList + '[' + i + ']';
3926
+ const referencepath_assistantInfoList_itemValidationError = validate$1(obj_assistantInfoList_item, path_assistantInfoList_item);
3927
+ if (referencepath_assistantInfoList_itemValidationError !== null) {
3928
+ let message = 'Object doesn\'t match LightningAssistantInfoRepresentation (at "' + path_assistantInfoList_item + '")\n';
3929
+ message += referencepath_assistantInfoList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3930
+ return new TypeError(message);
3931
+ }
3932
+ }
3933
+ const obj_assistantTarget = obj.assistantTarget;
3934
+ const path_assistantTarget = path + '.assistantTarget';
3935
+ if (typeof obj_assistantTarget !== 'string') {
3936
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
3937
+ }
3938
+ })();
3939
+ return v_error === undefined ? null : v_error;
3940
+ }
3941
+ const RepresentationType = 'LightningAssistantInfoListRepresentation';
3942
+ function keyBuilder$2(luvio, config) {
3943
+ return keyPrefix + '::' + RepresentationType + ':' + config.assistant_target;
3944
+ }
3945
+ function keyBuilderFromType(luvio, object) {
3946
+ const keyParams = {
3947
+ assistant_target: object.assistantTarget
3948
+ };
3949
+ return keyBuilder$2(luvio, keyParams);
3950
+ }
3951
+ function normalize(input, existing, path, luvio, store, timestamp) {
3952
+ return input;
3953
+ }
3954
+ const select$1 = function LightningAssistantInfoListRepresentationSelect() {
3955
+ const { selections: LightningAssistantInfoRepresentation__selections, opaque: LightningAssistantInfoRepresentation__opaque, } = select$2();
3956
+ return {
3957
+ kind: 'Fragment',
3958
+ version: VERSION,
3959
+ private: [],
3960
+ selections: [
3961
+ {
3962
+ name: 'assistantInfoList',
3963
+ kind: 'Object',
3964
+ plural: true,
3965
+ selections: LightningAssistantInfoRepresentation__selections
3966
+ },
3967
+ {
3968
+ name: 'assistantTarget',
3969
+ kind: 'Scalar'
3970
+ }
3971
+ ]
3972
+ };
3973
+ };
3974
+ function equals(existing, incoming) {
3975
+ const existing_assistantTarget = existing.assistantTarget;
3976
+ const incoming_assistantTarget = incoming.assistantTarget;
3977
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
3978
+ return false;
3979
+ }
3980
+ const existing_assistantInfoList = existing.assistantInfoList;
3981
+ const incoming_assistantInfoList = incoming.assistantInfoList;
3982
+ const equals_assistantInfoList_items = equalsArray(existing_assistantInfoList, incoming_assistantInfoList, (existing_assistantInfoList_item, incoming_assistantInfoList_item) => {
3983
+ if (!(equals$1(existing_assistantInfoList_item, incoming_assistantInfoList_item))) {
3984
+ return false;
3985
+ }
3986
+ });
3987
+ if (equals_assistantInfoList_items === false) {
3988
+ return false;
3989
+ }
3990
+ return true;
3991
+ }
3992
+ const ingest = function LightningAssistantInfoListRepresentationIngest(input, path, luvio, store, timestamp) {
3993
+ if (process.env.NODE_ENV !== 'production') {
3994
+ const validateError = validate(input);
3995
+ if (validateError !== null) {
3996
+ throw validateError;
3997
+ }
3998
+ }
3999
+ const key = keyBuilderFromType(luvio, input);
4000
+ const existingRecord = store.readEntry(key);
4001
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
4002
+ let incomingRecord = normalize(input, store.readEntry(key), {
4003
+ fullPath: key,
4004
+ parent: path.parent,
4005
+ propertyName: path.propertyName,
4006
+ ttl: ttlToUse
4007
+ });
4008
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
4009
+ luvio.storePublish(key, incomingRecord);
4010
+ }
4011
+ if (ttlToUse !== undefined) {
4012
+ const storeMetadataParams = {
4013
+ ttl: ttlToUse,
4014
+ namespace: "LEAP",
4015
+ version: VERSION,
4016
+ representationName: RepresentationType,
4017
+ };
4018
+ luvio.publishStoreMetadata(key, storeMetadataParams);
4019
+ }
4020
+ return createLink(key);
4021
+ };
4022
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
4023
+ const rootKeySet = new StoreKeyMap();
4024
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
4025
+ const rootKey = keyBuilderFromType(luvio, input);
4026
+ rootKeySet.set(rootKey, {
4027
+ namespace: keyPrefix,
4028
+ representationName: RepresentationType,
4029
+ mergeable: false
4030
+ });
4031
+ return rootKeySet;
4032
+ }
4033
+
4034
+ function select(luvio, params) {
4035
+ return select$1();
4036
+ }
4037
+ function keyBuilder$1(luvio, params) {
4038
+ return keyBuilder$2(luvio, {
4039
+ assistant_target: params.urlParams.assistantTarget
4040
+ });
4041
+ }
4042
+ function getResponseCacheKeys(luvio, resourceParams, response) {
4043
+ return getTypeCacheKeys(luvio, response);
4044
+ }
4045
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
4046
+ const { body } = response;
4047
+ const key = keyBuilder$1(luvio, resourceParams);
4048
+ luvio.storeIngest(key, ingest, body);
4049
+ const snapshot = luvio.storeLookup({
4050
+ recordId: key,
4051
+ node: select(),
4052
+ variables: {},
4053
+ }, snapshotRefresh);
4054
+ if (process.env.NODE_ENV !== 'production') {
4055
+ if (snapshot.state !== 'Fulfilled') {
4056
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4057
+ }
4058
+ }
4059
+ return snapshot;
4060
+ }
4061
+ function ingestError(luvio, params, error, snapshotRefresh) {
4062
+ const key = keyBuilder$1(luvio, params);
4063
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
4064
+ luvio.storeIngestError(key, errorSnapshot);
4065
+ return errorSnapshot;
4066
+ }
4067
+ function createResourceRequest(config) {
4068
+ const headers = {};
4069
+ return {
4070
+ baseUri: '/services/data/v58.0',
4071
+ basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/list/info',
4072
+ method: 'get',
4073
+ body: null,
4074
+ urlParams: config.urlParams,
4075
+ queryParams: {},
4076
+ headers,
4077
+ priority: 'normal',
4078
+ };
4079
+ }
4080
+
4081
+ const getAssistantInfoList_ConfigPropertyNames = {
4082
+ displayName: 'getAssistantInfoList',
4083
+ parameters: {
4084
+ required: ['assistantTarget'],
4085
+ optional: []
4086
+ }
4087
+ };
4088
+ function createResourceParams(config) {
4089
+ const resourceParams = {
4090
+ urlParams: {
4091
+ assistantTarget: config.assistantTarget
4092
+ }
4093
+ };
4094
+ return resourceParams;
4095
+ }
4096
+ function keyBuilder(luvio, config) {
4097
+ const resourceParams = createResourceParams(config);
4098
+ return keyBuilder$1(luvio, resourceParams);
4099
+ }
4100
+ function typeCheckConfig(untrustedConfig) {
4101
+ const config = {};
4102
+ const untrustedConfig_assistantTarget = untrustedConfig.assistantTarget;
4103
+ if (typeof untrustedConfig_assistantTarget === 'string') {
4104
+ config.assistantTarget = untrustedConfig_assistantTarget;
4105
+ }
4106
+ return config;
4107
+ }
4108
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
4109
+ if (!untrustedIsObject(untrustedConfig)) {
4110
+ return null;
4111
+ }
4112
+ if (process.env.NODE_ENV !== 'production') {
4113
+ validateConfig(untrustedConfig, configPropertyNames);
4114
+ }
4115
+ const config = typeCheckConfig(untrustedConfig);
4116
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4117
+ return null;
4118
+ }
4119
+ return config;
4120
+ }
4121
+ function adapterFragment(luvio, config) {
4122
+ createResourceParams(config);
4123
+ return select();
4124
+ }
4125
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
4126
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
4127
+ config,
4128
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
4129
+ });
4130
+ return luvio.storeBroadcast().then(() => snapshot);
4131
+ }
4132
+ function onFetchResponseError(luvio, config, resourceParams, response) {
4133
+ const snapshot = ingestError(luvio, resourceParams, response, {
4134
+ config,
4135
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
4136
+ });
4137
+ return luvio.storeBroadcast().then(() => snapshot);
4138
+ }
4139
+ function buildNetworkSnapshot(luvio, config, options) {
4140
+ const resourceParams = createResourceParams(config);
4141
+ const request = createResourceRequest(resourceParams);
4142
+ return luvio.dispatchResourceRequest(request, options)
4143
+ .then((response) => {
4144
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
4145
+ }, (response) => {
4146
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
4147
+ });
4148
+ }
4149
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
4150
+ const { luvio, config } = context;
4151
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
4152
+ const dispatchOptions = {
4153
+ resourceRequestContext: {
4154
+ requestCorrelator,
4155
+ luvioRequestMethod: undefined,
4156
+ },
4157
+ eventObservers
4158
+ };
4159
+ if (networkPriority !== 'normal') {
4160
+ dispatchOptions.overrides = {
4161
+ priority: networkPriority
4162
+ };
4163
+ }
4164
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
4165
+ }
4166
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
4167
+ const { luvio, config } = context;
4168
+ const selector = {
4169
+ recordId: keyBuilder(luvio, config),
4170
+ node: adapterFragment(luvio, config),
4171
+ variables: {},
4172
+ };
4173
+ const cacheSnapshot = storeLookup(selector, {
4174
+ config,
4175
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
4176
+ });
4177
+ return cacheSnapshot;
4178
+ }
4179
+ const getAssistantInfoListAdapterFactory = (luvio) => function LEAP__getAssistantInfoList(untrustedConfig, requestContext) {
4180
+ const config = validateAdapterConfig(untrustedConfig, getAssistantInfoList_ConfigPropertyNames);
4181
+ // Invalid or incomplete config
4182
+ if (config === null) {
4183
+ return null;
4184
+ }
4185
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
4186
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
4187
+ };
4188
+
4189
+ export { evaluateStepAdapterFactory, getAssistantAdapterFactory, getAssistantInfoListAdapterFactory, getAssistantListAdapterFactory, getAssistantTargetAdapterFactory, getQuestionnaireAdapterFactory, getQuestionnairesAdapterFactory, initializeAdapterFactory, saveAssistantAdapterFactory, saveAssistantListAdapterFactory, saveQuestionnaireAdapterFactory };