@claspo/common 7.5.13-usbscr → 7.5.14-pnc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PrizePool.interface.d.ts +2 -1
- package/PrizePool.interface.js +1 -1
- package/component-manifest/PropertyPaneManifest.interface.d.ts +2 -90
- package/component-manifest/PropertyPaneManifest.interface.js +1 -1
- package/document/Document.interface.d.ts +0 -1
- package/document/ViewNavigationGraph.d.ts +2 -4
- package/document/ViewNavigationGraph.js +1 -1
- package/package.json +1 -1
package/PrizePool.interface.d.ts
CHANGED
package/PrizePool.interface.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export var PrizeSourceType;!function(T){T.MANUAL="MANUAL",T.SHOPIFY="SHOPIFY"}(PrizeSourceType||(PrizeSourceType={}));export var PrizeDistributionType;!function(T){T.PERCENT_CHANCE="PERCENT_CHANCE"}(PrizeDistributionType||(PrizeDistributionType={}));export var PrizeOptionValueType;!function(T){T.DISCOUNT_PERCENTAGE="DISCOUNT_PERCENTAGE",T.CUSTOM="CUSTOM",T.PROMOCODE="PROMOCODE"}(PrizeOptionValueType||(PrizeOptionValueType={}));export var PrizeCodeType;!function(T){T.STATIC="STATIC",T.UNIQUE="UNIQUE"}(PrizeCodeType||(PrizeCodeType={}));export var ShopifyDiscountType;!function(T){T.PERCENTAGE="PERCENTAGE",T.FIXED_AMOUNT="FIXED_AMOUNT"}(ShopifyDiscountType||(ShopifyDiscountType={}));export var ShopifyPromoUnavailableReason;!function(T){T.SHOPIFY_UNAVAILABLE="SHOPIFY_UNAVAILABLE",T.DISCOUNT_NOT_FOUND="DISCOUNT_NOT_FOUND",T.EXPIRED="EXPIRED",T.NOT_STARTED="NOT_STARTED",T.UNSUPPORTED_DISCOUNT="UNSUPPORTED_DISCOUNT",T.NOT_CLASPO_OWNED="NOT_CLASPO_OWNED",T.NO_AVAILABLE_CODES="NO_AVAILABLE_CODES",T.BATCH_FAILED="BATCH_FAILED"}(ShopifyPromoUnavailableReason||(ShopifyPromoUnavailableReason={}));
|
|
1
|
+
export var PrizeSourceType;!function(T){T.MANUAL="MANUAL",T.SHOPIFY="SHOPIFY"}(PrizeSourceType||(PrizeSourceType={}));export var PrizeDistributionType;!function(T){T.PERCENT_CHANCE="PERCENT_CHANCE"}(PrizeDistributionType||(PrizeDistributionType={}));export var PrizeOptionValueType;!function(T){T.DISCOUNT_PERCENTAGE="DISCOUNT_PERCENTAGE",T.CUSTOM="CUSTOM",T.PROMOCODE="PROMOCODE"}(PrizeOptionValueType||(PrizeOptionValueType={}));export var PrizeCodeType;!function(T){T.STATIC="STATIC",T.UNIQUE="UNIQUE",T.NO_CODE="NO_CODE"}(PrizeCodeType||(PrizeCodeType={}));export var ShopifyDiscountType;!function(T){T.PERCENTAGE="PERCENTAGE",T.FIXED_AMOUNT="FIXED_AMOUNT"}(ShopifyDiscountType||(ShopifyDiscountType={}));export var ShopifyPromoUnavailableReason;!function(T){T.SHOPIFY_UNAVAILABLE="SHOPIFY_UNAVAILABLE",T.DISCOUNT_NOT_FOUND="DISCOUNT_NOT_FOUND",T.EXPIRED="EXPIRED",T.NOT_STARTED="NOT_STARTED",T.UNSUPPORTED_DISCOUNT="UNSUPPORTED_DISCOUNT",T.NOT_CLASPO_OWNED="NOT_CLASPO_OWNED",T.NO_AVAILABLE_CODES="NO_AVAILABLE_CODES",T.BATCH_FAILED="BATCH_FAILED"}(ShopifyPromoUnavailableReason||(ShopifyPromoUnavailableReason={}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClBaseComponentI, ClComponentType, ClDocumentActionType } from '../document/Document.interface';
|
|
2
|
-
import { DisplayConditionCallbackI
|
|
2
|
+
import { DisplayConditionCallbackI } from './DisplayCondition.interface';
|
|
3
3
|
import { PropPathConditionCallbackI } from './PropPathCondition.interface';
|
|
4
4
|
export interface PropertyPaneManifestI {
|
|
5
5
|
content: BasePropertyPaneManifestModelI[];
|
|
@@ -43,8 +43,7 @@ export declare enum ValueTransformerName {
|
|
|
43
43
|
export declare enum PropertyPaneManifestModelType {
|
|
44
44
|
CONTROL = "CONTROL",
|
|
45
45
|
TEXT = "TEXT",
|
|
46
|
-
GROUP = "GROUP"
|
|
47
|
-
NOTIFICATION = "NOTIFICATION"
|
|
46
|
+
GROUP = "GROUP"
|
|
48
47
|
}
|
|
49
48
|
export declare enum ClPropertyPaneManifestModelName {
|
|
50
49
|
SIZE = "SIZE",
|
|
@@ -162,98 +161,11 @@ export interface TextPropertyPaneManifestParamsI {
|
|
|
162
161
|
type?: TextPropertyPaneManifestParamsType;
|
|
163
162
|
styles?: string[];
|
|
164
163
|
classes?: string[];
|
|
165
|
-
html?: boolean;
|
|
166
164
|
}
|
|
167
165
|
export declare enum TextPropertyPaneManifestParamsType {
|
|
168
166
|
PRIMARY = "PRIMARY",
|
|
169
167
|
SECONDARY = "SECONDARY"
|
|
170
168
|
}
|
|
171
|
-
export interface PropertyPaneTranslationI {
|
|
172
|
-
key: string;
|
|
173
|
-
param?: {
|
|
174
|
-
[name: string]: string;
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
export type PropertyPaneCallbackI = (sdk: DisplayConditionSdkI) => void | Promise<void>;
|
|
178
|
-
export interface NotificationPropertyPaneManifestModelI extends BasePropertyPaneManifestModelI {
|
|
179
|
-
params: NotificationPropertyPaneManifestParamsI;
|
|
180
|
-
}
|
|
181
|
-
export interface NotificationPropertyPaneManifestParamsI {
|
|
182
|
-
notificationType: PropertyPaneNotificationType;
|
|
183
|
-
title?: PropertyPaneTranslationI;
|
|
184
|
-
description?: PropertyPaneTranslationI;
|
|
185
|
-
messages?: NotificationPropertyPaneMessageI[];
|
|
186
|
-
actions?: NotificationPropertyPaneActionI[];
|
|
187
|
-
closable?: boolean;
|
|
188
|
-
onClose?: PropertyPaneCallbackI;
|
|
189
|
-
hideIcon?: boolean;
|
|
190
|
-
}
|
|
191
|
-
export declare enum PropertyPaneNotificationType {
|
|
192
|
-
SUCCESS = "SUCCESS",
|
|
193
|
-
INFO = "INFO",
|
|
194
|
-
INFO_SECONDARY = "INFO_SECONDARY",
|
|
195
|
-
WARNING = "WARNING",
|
|
196
|
-
ERROR = "ERROR"
|
|
197
|
-
}
|
|
198
|
-
export interface NotificationPropertyPaneMessageI extends PropertyPaneTranslationI {
|
|
199
|
-
href?: string;
|
|
200
|
-
targetBlank?: boolean;
|
|
201
|
-
classes?: string;
|
|
202
|
-
tooltips?: PropertyPaneTooltipI[];
|
|
203
|
-
iconAfterMessage?: PropertyPaneIconWithTooltipI;
|
|
204
|
-
copyToClipboard?: string;
|
|
205
|
-
}
|
|
206
|
-
export interface PropertyPaneIconWithTooltipI {
|
|
207
|
-
iconMode: string;
|
|
208
|
-
tooltips: PropertyPaneTooltipI[];
|
|
209
|
-
}
|
|
210
|
-
export interface PropertyPaneTooltipI {
|
|
211
|
-
message?: PropertyPaneTranslationI;
|
|
212
|
-
interactiveElement?: PropertyPaneTooltipInteractiveElementI;
|
|
213
|
-
interactiveMessage?: boolean;
|
|
214
|
-
className?: string;
|
|
215
|
-
onClick?: PropertyPaneCallbackI;
|
|
216
|
-
hideTooltipOnClick?: boolean;
|
|
217
|
-
}
|
|
218
|
-
export interface PropertyPaneTooltipInteractiveElementI {
|
|
219
|
-
type: PropertyPaneTooltipInteractiveElementType;
|
|
220
|
-
name: PropertyPaneTranslationI;
|
|
221
|
-
href?: string;
|
|
222
|
-
target?: string;
|
|
223
|
-
buttonType?: PropertyPaneTooltipButtonType;
|
|
224
|
-
onClick?: PropertyPaneCallbackI;
|
|
225
|
-
hideTooltipOnClick?: boolean;
|
|
226
|
-
userActivityKey?: string;
|
|
227
|
-
}
|
|
228
|
-
export declare enum PropertyPaneTooltipInteractiveElementType {
|
|
229
|
-
BUTTON = "BUTTON",
|
|
230
|
-
LINK = "LINK"
|
|
231
|
-
}
|
|
232
|
-
export declare enum PropertyPaneTooltipButtonType {
|
|
233
|
-
PRIMARY = "primary",
|
|
234
|
-
SECONDARY = "secondary"
|
|
235
|
-
}
|
|
236
|
-
export type NotificationPropertyPaneActionI = NotificationPropertyPaneLinkActionI | NotificationPropertyPaneButtonActionI;
|
|
237
|
-
export declare enum NotificationPropertyPaneActionType {
|
|
238
|
-
BUTTON = "BUTTON",
|
|
239
|
-
LINK = "LINK"
|
|
240
|
-
}
|
|
241
|
-
export interface NotificationPropertyPaneLinkActionI {
|
|
242
|
-
type: NotificationPropertyPaneActionType.LINK;
|
|
243
|
-
label: PropertyPaneTranslationI;
|
|
244
|
-
href: string;
|
|
245
|
-
cssClass?: string;
|
|
246
|
-
targetBlank?: boolean;
|
|
247
|
-
onClick?: PropertyPaneCallbackI;
|
|
248
|
-
}
|
|
249
|
-
export interface NotificationPropertyPaneButtonActionI {
|
|
250
|
-
type: NotificationPropertyPaneActionType.BUTTON;
|
|
251
|
-
label: PropertyPaneTranslationI;
|
|
252
|
-
onClick: PropertyPaneCallbackI;
|
|
253
|
-
buttonType?: string;
|
|
254
|
-
iconBefore?: string;
|
|
255
|
-
iconAfter?: string;
|
|
256
|
-
}
|
|
257
169
|
export interface SizePropertyPaneManifestModelI extends BasePropertyPaneManifestModelI {
|
|
258
170
|
params: {
|
|
259
171
|
[key: string]: SizePropertyPaneManifestParamsI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var ValueTransformerName;!function(T){T.PIXELS="px"}(ValueTransformerName||(ValueTransformerName={}));export var PropertyPaneManifestModelType;!function(T){T.CONTROL="CONTROL",T.TEXT="TEXT",T.GROUP="GROUP"
|
|
1
|
+
export var ValueTransformerName;!function(T){T.PIXELS="px"}(ValueTransformerName||(ValueTransformerName={}));export var PropertyPaneManifestModelType;!function(T){T.CONTROL="CONTROL",T.TEXT="TEXT",T.GROUP="GROUP"}(PropertyPaneManifestModelType||(PropertyPaneManifestModelType={}));export var ClPropertyPaneManifestModelName;!function(T){T.SIZE="SIZE",T.INDENTATION="INDENTATION",T.ALIGNMENT="ALIGNMENT",T.BACKGROUND="BACKGROUND",T.BACKDROP_FILTER="BACKDROP_FILTER",T.BACKGROUND_MARKER_SELECTED="BACKGROUND_MARKER_SELECTED",T.BORDERS="BORDERS",T.BOX_SHADOW="BOX_SHADOW",T.BORDER_RADIUS="BORDER_RADIUS",T.TEXT_PARAMS="TEXT_PARAMS",T.TEXT_INPUT="TEXT_INPUT",T.SWITCH="SWITCH",T.SWITCH_WITH_INPUT="SWITCH_WITH_INPUT",T.INPUT_VALIDATION="INPUT_VALIDATION",T.INPUT_LABEL="INPUT_LABEL",T.AUTOFILL="AUTOFILL",T.TEXT_COLOR="TEXT_COLOR",T.SELECT="SELECT",T.RADIO_BUTTONS="RADIO_BUTTONS",T.IMAGE_SOURCES="IMAGE_SOURCES",T.COUNTRY_PHONE_SELECT="COUNTRY_PHONE_SELECT",T.HOVER_ANIMATION="HOVER_ANIMATION",T.ACTIONS="ACTIONS",T.NPS_ACTIONS="NPS_ACTIONS",T.DATEPICKER="DATEPICKER",T.DATEPICKER_COUNTDOWN_TIMER="DATEPICKER_COUNTDOWN_TIMER",T.DISPLAY="DISPLAY",T.COMPONENT_OPTIONS="COMPONENT_OPTIONS",T.COLOR_SELECT="COLOR_SELECT",T.FLOATING_COMPONENT_POSITION="FLOATING_COMPONENT_POSITION",T.LOOP_ANIMATION="LOOP_ANIMATION",T.VIDEO_URL="VIDEO_URL",T.VIDEO_CUSTOM_COVER="VIDEO_CUSTOM_COVER",T.WIDGET_LAYOUT_SELECT="WIDGET_LAYOUT_SELECT",T.MULTIPLE_INPUT_SIZE="MULTIPLE_INPUT_SIZE",T.DATE_FORMAT="DATE_FORMAT",T.ICON="ICON",T.PROMOCODE_ICON="PROMOCODE_ICON",T.ICON_SELECT="ICON_SELECT",T.TEXT_VISIBILITY="TEXT_VISIBILITY",T.SLIDER_SETTINGS="SLIDER_SETTINGS",T.SLIDER_MANAGE_SLIDES="SLIDER_MANAGE_SLIDES",T.SLIDER_MODES="SLIDER_MODES",T.SLIDER_NAVIGATION_BUTTONS="SLIDER_NAVIGATION_BUTTONS",T.SLIDER_INDICATION="SLIDER_INDICATION",T.SLIDER_SLIDESHOW_ANIMATION="SLIDER_SLIDESHOW_ANIMATION",T.INTEGRATION_FIELD_MAPPING="INTEGRATION_FIELD_MAPPING",T.SUPPORTED_LANGUAGES="SUPPORTED_LANGUAGES",T.LIST_POSITION="LIST_POSITION",T.SOCIAL_ICON_SIZE="SOCIAL_ICON_SIZE",T.SOCIAL_TYPE_AND_ICON_SELECT="SOCIAL_TYPE_AND_ICON_SELECT",T.COLUMNS="COLUMNS",T.INSERT_BLOCK="INSERT_BLOCK",T.NUMBER_INPUT="NUMBER_INPUT",T.PRIZE_SETTINGS="PRIZE_SETTINGS",T.ROOT_COMPONENT_SELECT="ROOT_COMPONENT_SELECT",T.FEEDBACK_TYPE="FEEDBACK_TYPE",T.FEEDBACK_ICONS_SELECT="FEEDBACK_ICONS_SELECT",T.FEEDBACK_ACTIONS="FEEDBACK_ACTIONS",T.FLOATING_BOX_POSITION="FLOATING_BOX_POSITION",T.OVERLAY_POSITION="OVERLAY_POSITION",T.OVERLAY_BACKGROUND="OVERLAY_BACKGROUND",T.OVERLAY_BACKDROP_FILTER="OVERLAY_BACKDROP_FILTER",T.WIDGET_THEME_SELECT="WIDGET_THEME_SELECT"}(ClPropertyPaneManifestModelName||(ClPropertyPaneManifestModelName={}));export var TabPropertyPaneManifestType;!function(T){T.DESKTOP_STYLES="DESKTOP_STYLES",T.MOBILE_STYLES="MOBILE_STYLES"}(TabPropertyPaneManifestType||(TabPropertyPaneManifestType={}));export var TextPropertyPaneManifestParamsType;!function(T){T.PRIMARY="PRIMARY",T.SECONDARY="SECONDARY"}(TextPropertyPaneManifestParamsType||(TextPropertyPaneManifestParamsType={}));export var SizePropertyPaneOption;!function(T){T.FIXED="fixed",T.FILL="fill",T.HUG="hug"}(SizePropertyPaneOption||(SizePropertyPaneOption={}));export var IndentationPropertyPaneManifestType;!function(T){T.PADDING="PADDING",T.MARGIN="MARGIN"}(IndentationPropertyPaneManifestType||(IndentationPropertyPaneManifestType={}));
|
|
@@ -140,7 +140,6 @@ export interface ClDocumentRequestActionParamsI {
|
|
|
140
140
|
}
|
|
141
141
|
export interface ClDocumentDispatchEventActionParamsI {
|
|
142
142
|
eventName: string;
|
|
143
|
-
submitActionParams?: Pick<ClSubmitActionParamsI, 'successViewId' | 'errorViewId'> | null;
|
|
144
143
|
}
|
|
145
144
|
export declare enum DefaultSchemaTokens {
|
|
146
145
|
ACCENT = "accent"
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { ClBaseComponentI,
|
|
1
|
+
import { ClBaseComponentI, ClDocumentSharedI, ClSubmitActionParamsI } from './Document.interface';
|
|
2
2
|
export declare enum ViewNavEdgeKind {
|
|
3
3
|
GO_TO_VIEW = "GO_TO_VIEW",
|
|
4
4
|
GO_TO_NEXT_VIEW = "GO_TO_NEXT_VIEW",
|
|
5
5
|
GO_TO_PREVIOUS_VIEW = "GO_TO_PREVIOUS_VIEW",
|
|
6
6
|
SUBMIT = "SUBMIT",
|
|
7
7
|
NPS_CONDITIONAL = "NPS_CONDITIONAL",
|
|
8
|
-
PRIZE_CONDITIONAL = "PRIZE_CONDITIONAL"
|
|
9
|
-
ACTION_CONDITIONAL = "ACTION_CONDITIONAL"
|
|
8
|
+
PRIZE_CONDITIONAL = "PRIZE_CONDITIONAL"
|
|
10
9
|
}
|
|
11
10
|
export declare enum ViewTerminalKind {
|
|
12
11
|
TRUE_TERMINAL = "TRUE_TERMINAL",
|
|
@@ -37,7 +36,6 @@ export declare const SUCCESS_LEGACY_LABELS: string[];
|
|
|
37
36
|
export declare const ERROR_LEGACY_LABELS: string[];
|
|
38
37
|
export declare const ALREADY_SUBSCRIBED_LEGACY_LABELS: string[];
|
|
39
38
|
export declare const SYSTEM_RESULT_STATE_LABELS: string[];
|
|
40
|
-
export declare function getActionSubmitActionParams(action: ClDocumentActionI | null | undefined): ClDocumentDispatchEventActionParamsI['submitActionParams'];
|
|
41
39
|
export declare function viewHasControls(viewModel: ClBaseComponentI | undefined | null): boolean;
|
|
42
40
|
export declare function isResultView(viewModel: ClBaseComponentI | undefined | null, resultViewIds: string[]): boolean;
|
|
43
41
|
export declare function getConfiguredResultViewIds(submitActionParams: ClSubmitActionParamsI | undefined | null, hasFormControls: boolean): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ClDocumentActionType}from"./Document.interface";import{iterateDepthFirst}from"./DocumentUtils";export var ViewNavEdgeKind;!function(e){e.GO_TO_VIEW="GO_TO_VIEW",e.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",e.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",e.SUBMIT="SUBMIT",e.NPS_CONDITIONAL="NPS_CONDITIONAL",e.PRIZE_CONDITIONAL="PRIZE_CONDITIONAL"
|
|
1
|
+
import{ClDocumentActionType}from"./Document.interface";import{iterateDepthFirst}from"./DocumentUtils";export var ViewNavEdgeKind;!function(e){e.GO_TO_VIEW="GO_TO_VIEW",e.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",e.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",e.SUBMIT="SUBMIT",e.NPS_CONDITIONAL="NPS_CONDITIONAL",e.PRIZE_CONDITIONAL="PRIZE_CONDITIONAL"}(ViewNavEdgeKind||(ViewNavEdgeKind={}));export var ViewTerminalKind;!function(e){e.TRUE_TERMINAL="TRUE_TERMINAL",e.INTERMEDIATE="INTERMEDIATE"}(ViewTerminalKind||(ViewTerminalKind={}));const SUBMIT_ACTION_TYPES=[ClDocumentActionType.REQUEST,ClDocumentActionType.SUBSCRIBE_CONTACT],NPS_BAND_KEYS=["detractor","passive","promoter"],GAMING_COMPONENT_TYPE="PRIZE_BASED_GAMING";export const SUCCESS_LEGACY_LABELS=["DOCUMENT_VIEW_TYPE_SUCCESS","DOCUMENT_VIEW_TYPE_SUCCESSFUL_REQUEST","REQUEST_FORM_VIEW_TYPE_SUCCESS"];export const ERROR_LEGACY_LABELS=["DOCUMENT_VIEW_TYPE_ERROR"];export const ALREADY_SUBSCRIBED_LEGACY_LABELS=["DOCUMENT_VIEW_TYPE_SUBSCRIBED"];export const SYSTEM_RESULT_STATE_LABELS=[...SUCCESS_LEGACY_LABELS,...ERROR_LEGACY_LABELS,...ALREADY_SUBSCRIBED_LEGACY_LABELS];function componentModelHasSubmitAction(e){var n,i;try{return!!(null===(i=null===(n=e.props)||void 0===n?void 0:n.handlers)||void 0===i?void 0:i.find(e=>{var n;return null===(n=null==e?void 0:e.actions)||void 0===n?void 0:n.find(e=>SUBMIT_ACTION_TYPES.includes(e.type))}))}catch(e){return!1}}export function viewHasControls(e){if(!e)return!1;let n=0;return iterateDepthFirst(e,e=>{(["INPUT","MULTIPLE_INPUT",GAMING_COMPONENT_TYPE].includes(e.type)||componentModelHasSubmitAction(e))&&n++}),n>0}export function isResultView(e,n){return!!e&&(SYSTEM_RESULT_STATE_LABELS.includes(e.label)||n.includes(e.id))}export function getConfiguredResultViewIds(e,n){return n?!e||e.runAction?[]:[e.successViewId,e.errorViewId,e.alreadySubscribedViewId].filter(Boolean):[]}function resolveResultViewIndex(e,n,i,o){const t=null==n?void 0:n[i];if(t){const n=e.findIndex(e=>e.id===t);if(-1!==n)return n}return e.findIndex(e=>o.includes(e.label))}export function submitAdvancesToNextStep(e,n,i,o){const t=n[i+1];if(!t||isResultView(t,o))return!1;return!e.edges.some(e=>e.toIndex===i+1&&e.fromIndex!==i&&e.isForward&&e.kind!==ViewNavEdgeKind.SUBMIT)}export function buildViewNavigationGraph(e,n,i){var o;const t=new Map;e.forEach((e,n)=>t.set(e.id,n));const d=null!==(o=null==n?void 0:n.submitActionParams)&&void 0!==o?o:void 0,r=e.some(e=>viewHasControls(e)),E=getConfiguredResultViewIds(d,r),s=r?d:void 0,l=[],a=[],u=(e,n,i)=>{switch(i){case ViewNavEdgeKind.GO_TO_NEXT_VIEW:case ViewNavEdgeKind.SUBMIT:case ViewNavEdgeKind.NPS_CONDITIONAL:case ViewNavEdgeKind.PRIZE_CONDITIONAL:return!0;case ViewNavEdgeKind.GO_TO_PREVIOUS_VIEW:return!1;default:return n>e}},I=(n,i,o,t)=>{void 0===i||i<0||i>=e.length||l.push({fromIndex:n,toIndex:i,kind:o,isForward:u(n,i,o),label:t})},_=(n,i)=>{var o,d;switch(i.type){case ClDocumentActionType.GO_TO_VIEW:return(null===(o=i.params)||void 0===o?void 0:o.viewId)?t.get(i.params.viewId):"number"==typeof(null===(d=i.params)||void 0===d?void 0:d.viewIndex)?i.params.viewIndex:void 0;case ClDocumentActionType.GO_TO_NEXT_VIEW:return n+1<e.length?n+1:void 0;case ClDocumentActionType.GO_TO_PREVIOUS_VIEW:return n-1>=0?n-1:void 0;default:return}},c=e.map(()=>new Set),T=(e,n,i,o)=>{if(void 0===n||-1===n||n===e)return;const t=`${n}:${i}`;c[e].has(t)||(c[e].add(t),I(e,n,i,o))},S=[];e.forEach((e,n)=>{const i=new Set;let o;iterateDepthFirst(e,e=>{var t,d,r,E,s,l,a;const u=null===(t=e.props)||void 0===t?void 0:t.content,c=[];for(const n of null!==(r=null===(d=e.props)||void 0===d?void 0:d.handlers)&&void 0!==r?r:[])for(const e of null!==(E=n.actions)&&void 0!==E?E:[])c.push({action:e,label:null!==(s=null==u?void 0:u.text)&&void 0!==s?s:""});if(Array.isArray(null==u?void 0:u.options))for(const e of u.options)(null==e?void 0:e.action)&&c.push({action:e.action,label:null!==(a=null!==(l=null==e?void 0:e.label)&&void 0!==l?l:null==e?void 0:e.value)&&void 0!==a?a:""});e.type===GAMING_COMPONENT_TYPE&&(o=null!=o?o:"");for(const{action:e,label:i}of c)SUBMIT_ACTION_TYPES.includes(e.type)?o=null!=o?o:i:e.type!==ClDocumentActionType.GO_TO_VIEW&&e.type!==ClDocumentActionType.GO_TO_NEXT_VIEW&&e.type!==ClDocumentActionType.GO_TO_PREVIOUS_VIEW||I(n,_(n,e),e.type,i);NPS_BAND_KEYS.map(e=>(u||{})[e]||null).filter(e=>e).forEach(e=>i.add(e))}),i.forEach(e=>{T(n,t.get(e),ViewNavEdgeKind.NPS_CONDITIONAL,"")}),S[n]=o,a[n]=void 0!==o}),(null!=i?i:[]).forEach(({fromViewId:e,toViewId:n})=>{const i=t.get(e);void 0!==i&&T(i,t.get(n),ViewNavEdgeKind.PRIZE_CONDITIONAL,"")}),e.forEach((n,i)=>{const o=S[i];if(void 0===o)return;const t=e[i+1],d=submitAdvancesToNextStep({edges:l},e,i,E),a=o,u=()=>{T(i,resolveResultViewIndex(e,s,"errorViewId",ERROR_LEGACY_LABELS),ViewNavEdgeKind.SUBMIT,a),s&&!s.alreadySubscribedViewId?T(i,resolveResultViewIndex(e,s,"successViewId",SUCCESS_LEGACY_LABELS),ViewNavEdgeKind.SUBMIT,a):T(i,resolveResultViewIndex(e,s,"alreadySubscribedViewId",ALREADY_SUBSCRIBED_LEGACY_LABELS),ViewNavEdgeKind.SUBMIT,a)};if(d)return T(i,i+1,ViewNavEdgeKind.SUBMIT,a),void(!viewHasControls(t)&&r&&u());const I=null==s?void 0:s.runAction;I?T(i,_(i,I),I.type,a):(T(i,resolveResultViewIndex(e,s,"successViewId",SUCCESS_LEGACY_LABELS),ViewNavEdgeKind.SUBMIT,a),u())});const v=e.map((e,n)=>{var i,o;return{index:n,id:e.id,label:null!==(i=e.label)&&void 0!==i?i:e.id,hasSubmitAction:null!==(o=a[n])&&void 0!==o&&o}});return{nodes:v,edges:l}}export function classifyView(e,n){return e.edges.some(e=>e.fromIndex===n)?ViewTerminalKind.INTERMEDIATE:ViewTerminalKind.TRUE_TERMINAL}export function classifyViews(e){return e.nodes.map(n=>classifyView(e,n.index))}export function isAutoCommitTerminal(e,n){const i=e.nodes[n];return!!i&&(classifyView(e,n)===ViewTerminalKind.TRUE_TERMINAL&&!i.hasSubmitAction)}export function isMultiViewFlow(e){if(e.nodes.length<2)return!1;const n=new Set([0]),i=[0];for(;i.length;){const o=i.shift();for(const t of e.edges)t.fromIndex!==o||n.has(t.toIndex)||(n.add(t.toIndex),i.push(t.toIndex))}return n.size>1}export function isNonLinearFlow(e){return e.edges.some(e=>e.kind===ViewNavEdgeKind.GO_TO_VIEW||e.kind===ViewNavEdgeKind.NPS_CONDITIONAL||e.kind===ViewNavEdgeKind.PRIZE_CONDITIONAL||e.kind===ViewNavEdgeKind.SUBMIT&&e.toIndex<e.fromIndex)}
|