@treasuredata/tdx 2026.4.55 → 2026.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.d.ts +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.d.ts +85 -0
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.d.ts +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts +2 -1
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.d.ts +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.d.ts +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.d.ts +3 -3
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.d.ts +31 -0
- package/dist/commands/table-deleted.d.ts.map +1 -0
- package/dist/commands/table-deleted.js +1 -0
- package/dist/commands/table-deleted.js.map +1 -0
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +6 -5
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/constants.js.map +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/passthrough-server.d.ts +17 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.d.ts +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +75 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.d.ts +1 -1
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.d.ts +23 -2
- package/dist/sdk/client/td-api-client.d.ts.map +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/td-api-client.js.map +1 -1
- package/dist/sdk/client/trino-api-client.d.ts +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js.map +1 -1
- package/dist/sdk/client/workflow-client.d.ts +9 -2
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-validator.js.map +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.d.ts +2 -2
- package/dist/sdk/engage/types/campaign-def.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.d.ts +256 -8
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +62 -1
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +3 -3
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.d.ts +6 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +33 -9
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/llm/user-settings.d.ts +3 -0
- package/dist/sdk/llm/user-settings.d.ts.map +1 -0
- package/dist/sdk/llm/user-settings.js +1 -0
- package/dist/sdk/llm/user-settings.js.map +1 -0
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.d.ts +19 -0
- package/dist/sdk/query/deleted-table-validation.d.ts.map +1 -0
- package/dist/sdk/query/deleted-table-validation.js +1 -0
- package/dist/sdk/query/deleted-table-validation.js.map +1 -0
- package/dist/sdk/query/index.d.ts +43 -0
- package/dist/sdk/query/index.d.ts.map +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/index.js.map +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.d.ts.map +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/file-discovery.js.map +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.d.ts +2 -2
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.d.ts +1 -1
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/segment-validator.js.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.d.ts +4 -2
- package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.d.ts +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +7 -3
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/connection.d.ts +1 -1
- package/dist/sdk/types/database.d.ts +28 -0
- package/dist/sdk/types/database.d.ts.map +1 -1
- package/dist/sdk/types/engage.d.ts +178 -1
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +2 -2
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/llm.d.ts +7 -3
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +7 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/types/workspace.js.map +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +16 -3
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.d.ts +65 -0
- package/dist/sdk/workflow/task-graph.d.ts.map +1 -0
- package/dist/sdk/workflow/task-graph.js +1 -0
- package/dist/sdk/workflow/task-graph.js.map +1 -0
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.d.ts +7 -0
- package/dist/sdk/workspace/access-tracker.d.ts.map +1 -0
- package/dist/sdk/workspace/access-tracker.js +1 -0
- package/dist/sdk/workspace/access-tracker.js.map +1 -0
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.d.ts +53 -1
- package/dist/sdk/workspace/git.d.ts.map +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/git.js.map +1 -1
- package/dist/sdk/workspace/index.d.ts +25 -1
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.d.ts.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/templates.js.map +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.d.ts +2 -0
- package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/sdk/workspace/wikilinks.js.map +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.d.ts +3 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.d.ts +10 -2
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +61 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x16b735,_0x42ca18){const _0x3855e9=a146_0x271f,_0x115fea=_0x16b735();while(!![]){try{const _0xa9f5f8=-parseInt(_0x3855e9(0x1a8))/0x1+parseInt(_0x3855e9(0x1a1))/0x2+-parseInt(_0x3855e9(0x18f))/0x3+parseInt(_0x3855e9(0x195))/0x4*(parseInt(_0x3855e9(0x110))/0x5)+parseInt(_0x3855e9(0xf7))/0x6+parseInt(_0x3855e9(0x153))/0x7*(-parseInt(_0x3855e9(0x131))/0x8)+parseInt(_0x3855e9(0x16f))/0x9;if(_0xa9f5f8===_0x42ca18)break;else _0x115fea['push'](_0x115fea['shift']());}catch(_0xd2dce1){_0x115fea['push'](_0x115fea['shift']());}}}(a146_0x2446,0xd6d4f));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x1afa60,_0x349932,_0x2e5d1f,_0x2305f9,_0x3ad197,_0x2f27ad){const _0x56748a=a146_0x271f;return{'level':_0x1afa60,'path':_0x349932,'code':_0x2e5d1f,'message':_0x2305f9,'location':getLocationFromPath(_0x3ad197[_0x56748a(0x13f)],_0x3ad197['source'],pathToArray(_0x2f27ad??_0x349932))};}function validateVersionStructure(_0x298d68,_0x57bf7f){const _0x53ea20=a146_0x271f,_0x2acba9=[];return _0x298d68[_0x53ea20(0x15b)]>MAX_STAGES&&_0x2acba9[_0x53ea20(0x105)](createIssue(_0x53ea20(0x15d),_0x53ea20(0x16c),'TOO_MANY_STAGES',_0x53ea20(0x12a)+_0x298d68[_0x53ea20(0x15b)]+_0x53ea20(0x197)+MAX_STAGES,_0x57bf7f)),_0x2acba9;}function validateStageStructure(_0x5b428c,_0x1d285e,_0x35f147,_0x336954){const _0xf77b3b=a146_0x271f,_0x2fedc7=[],_0x5df65a='stages['+_0x1d285e+']';_0x1d285e===0x0&&!_0x5b428c[_0xf77b3b(0x16e)]&&_0x2fedc7[_0xf77b3b(0x105)](createIssue('error',_0x5df65a+'.entry_criteria',_0xf77b3b(0x121),_0xf77b3b(0x11f)+_0x5b428c[_0xf77b3b(0x133)]+_0xf77b3b(0x1ab),_0x336954,_0x5df65a));const _0x4a4917=_0x1d285e===_0x35f147-0x1;!_0x4a4917&&!_0x5b428c[_0xf77b3b(0x1a2)]&&_0x2fedc7[_0xf77b3b(0x105)](createIssue('error',_0x5df65a+_0xf77b3b(0x169),_0xf77b3b(0x14c),'Stage\x20\x27'+_0x5b428c[_0xf77b3b(0x133)]+'\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone',_0x336954,_0x5df65a));(!_0x5b428c[_0xf77b3b(0x14a)]||_0x5b428c['exit_criteria'][_0xf77b3b(0x15b)]===0x0)&&_0x2fedc7['push'](createIssue('warning',_0x5df65a+'.exit_criteria','MISSING_EXIT_CRITERIA',_0xf77b3b(0x11f)+_0x5b428c['name']+_0xf77b3b(0xfe),_0x336954,_0x5df65a));const _0xe984c3=_0x5b428c[_0xf77b3b(0xf3)]?.[_0xf77b3b(0x15b)]??0x0;if(_0xe984c3===0x0)_0x2fedc7[_0xf77b3b(0x105)](createIssue(_0xf77b3b(0x15d),_0x5df65a+'.steps',_0xf77b3b(0x106),_0xf77b3b(0x11f)+_0x5b428c['name']+_0xf77b3b(0xfb),_0x336954,_0x5df65a+_0xf77b3b(0x115)));else{if(_0xe984c3===0x1)_0x2fedc7[_0xf77b3b(0x105)](createIssue(_0xf77b3b(0x194),_0x5df65a+_0xf77b3b(0x115),_0xf77b3b(0x106),_0xf77b3b(0x11f)+_0x5b428c[_0xf77b3b(0x133)]+_0xf77b3b(0x117),_0x336954,_0x5df65a+_0xf77b3b(0x115)));else _0xe984c3<=0x3&&_0x2fedc7[_0xf77b3b(0x105)](createIssue(_0xf77b3b(0x194),_0x5df65a+'.steps',_0xf77b3b(0x10c),_0xf77b3b(0x11f)+_0x5b428c[_0xf77b3b(0x133)]+_0xf77b3b(0x1a9)+_0xe984c3+_0xf77b3b(0x17a),_0x336954,_0x5df65a+'.steps'));}return _0x2fedc7;}function a146_0x271f(_0x5451f5,_0x55fa71){_0x5451f5=_0x5451f5-0xf2;const _0x244693=a146_0x2446();let _0x271ff8=_0x244693[_0x5451f5];return _0x271ff8;}function validateStep(_0xbeb9c,_0x4d6aea,_0x4b9825,_0x53a8d4){const _0x183efc=a146_0x271f,_0x274b78=[];if(_0xbeb9c[_0x183efc(0x168)]===_0x183efc(0x163))return _0xbeb9c[_0x183efc(0x157)]&&_0x274b78[_0x183efc(0x105)](createIssue(_0x183efc(0x15d),_0x4d6aea+'.next',_0x183efc(0x128),_0x183efc(0x13a)+_0xbeb9c[_0x183efc(0x133)]+_0x183efc(0x151),_0x4b9825)),'with'in _0xbeb9c&&_0xbeb9c[_0x183efc(0x11d)]!==undefined&&_0x274b78[_0x183efc(0x105)](createIssue(_0x183efc(0x15d),_0x4d6aea+'.with',_0x183efc(0x128),'End\x20step\x20\x27'+_0xbeb9c[_0x183efc(0x133)]+_0x183efc(0x17b),_0x4b9825)),_0x274b78;_0xbeb9c[_0x183efc(0x157)]&&(_0x4b9825[_0x183efc(0x12f)]&&!_0x4b9825[_0x183efc(0x12f)][_0x183efc(0x11c)](_0xbeb9c['next'])&&_0x274b78[_0x183efc(0x105)](createIssue(_0x183efc(0x15d),_0x4d6aea+'.next',_0x183efc(0x14e),_0x183efc(0x18e)+_0xbeb9c[_0x183efc(0x157)]+'\x27',_0x4b9825)));switch(_0xbeb9c[_0x183efc(0x168)]){case'wait':_0x274b78[_0x183efc(0x105)](...validateWaitStep(_0xbeb9c,_0x4d6aea,_0x4b9825,_0x53a8d4));break;case _0x183efc(0x12d):_0x274b78[_0x183efc(0x105)](...validateActivationStep(_0xbeb9c,_0x4d6aea,_0x4b9825));break;case _0x183efc(0x19e):_0x274b78[_0x183efc(0x105)](...validateDecisionPointStep(_0xbeb9c,_0x4d6aea,_0x4b9825,_0x53a8d4));break;case _0x183efc(0x10a):_0x274b78[_0x183efc(0x105)](...validateAbTestStep(_0xbeb9c,_0x4d6aea,_0x4b9825,_0x53a8d4));break;case _0x183efc(0x19c):_0x274b78[_0x183efc(0x105)](...validateJumpStep(_0xbeb9c,_0x4d6aea,_0x4b9825));break;}return _0x274b78;}function validateWaitStep(_0x3dc5ba,_0x422bf6,_0xb88c81,_0x5d0b30){const _0x518570=a146_0x271f,_0xa9af84=[];if(!_0x3dc5ba[_0x518570(0x11d)])return _0xa9af84['push'](createIssue('error',_0x422bf6+_0x518570(0x107),_0x518570(0x10d),_0x518570(0x181),_0xb88c81,_0x422bf6)),_0xa9af84;if(_0x3dc5ba[_0x518570(0x11d)][_0x518570(0x190)]){const _0x102121=_0x3dc5ba[_0x518570(0x11d)]['condition'];if(_0x102121[_0x518570(0x112)]){_0xb88c81[_0x518570(0x17d)]?.[_0x518570(0xff)](_0x102121[_0x518570(0x112)]);!_0x102121[_0x518570(0x112)][_0x518570(0x188)](_0x518570(0x16d))&&(_0xb88c81[_0x518570(0x13b)]&&!_0xb88c81[_0x518570(0x13b)][_0x518570(0x11c)](_0x102121[_0x518570(0x112)])&&_0xa9af84['push'](createIssue(_0x518570(0x15d),_0x422bf6+_0x518570(0x18c),_0x518570(0x108),_0x518570(0x138)+_0x102121['segment']+_0x518570(0x13e),_0xb88c81)));_0x102121[_0x518570(0x157)]&&_0xb88c81[_0x518570(0x12f)]&&!_0xb88c81[_0x518570(0x12f)]['has'](_0x102121[_0x518570(0x157)])&&_0xa9af84[_0x518570(0x105)](createIssue(_0x518570(0x15d),_0x422bf6+_0x518570(0x187),_0x518570(0x14e),_0x518570(0x1a4)+_0x102121[_0x518570(0x157)]+'\x27',_0xb88c81));_0x102121[_0x518570(0x1a6)]?.[_0x518570(0x157)]&&_0xb88c81['stepNames']&&!_0xb88c81[_0x518570(0x12f)][_0x518570(0x11c)](_0x102121[_0x518570(0x1a6)][_0x518570(0x157)])&&_0xa9af84[_0x518570(0x105)](createIssue(_0x518570(0x15d),_0x422bf6+_0x518570(0x186),_0x518570(0x14e),_0x518570(0x154)+_0x102121[_0x518570(0x1a6)]['next']+'\x27',_0xb88c81));const _0x1835bb=_0x102121['next']||_0x3dc5ba[_0x518570(0x157)],_0xed2240=_0x102121[_0x518570(0x1a6)]?.[_0x518570(0x157)]||_0x3dc5ba[_0x518570(0x157)];if(_0x1835bb){const _0x2b8679=_0x5d0b30[_0x518570(0xfd)](_0x1835bb);_0x2b8679?.['type']===_0x518570(0x155)&&_0xa9af84[_0x518570(0x105)](createIssue(_0x518570(0x194),_0x422bf6+_0x518570(0x187),'BRANCH_DIRECTLY_TO_MERGE','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x1835bb+_0x518570(0x1a5),_0xb88c81,_0x422bf6+_0x518570(0x1a3)));}if(_0xed2240){const _0x40add1=_0x5d0b30['get'](_0xed2240);_0x40add1?.[_0x518570(0x168)]==='merge'&&_0xa9af84['push'](createIssue(_0x518570(0x194),_0x422bf6+_0x518570(0x186),_0x518570(0x158),'Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0xed2240+_0x518570(0x1a5),_0xb88c81,_0x422bf6+_0x518570(0x162)));}}}return _0xa9af84;}function a146_0x2446(){const _0x1c3a40=['success','has','with','.entry_criteria','Stage\x20\x27','journey\x20entry','MISSING_ENTRY_CRITERIA','.with.variants[','path','indices','endsWith','source','Embedded\x20segment\x20\x27','END_STEP_HAS_NEXT_OR_WITH','wait','Journey\x20has\x20','condition\x20of\x20\x27','Jump\x20step\x20requires\x20a\x20target','activation','INVALID_JUMP_TARGET','stepNames','.with.target','3840344Hppmvl','\x20(across\x20','name','stages[','launched','ACTIVATION_SCHEMA_ERROR','segments','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','\x27\x20of\x20\x27','End\x20step\x20\x27','embeddedSegments','Criteria\x20references\x20undefined\x20segment\x20\x27','versions[','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','document','.with.branches','stage','variants','map','variant\x20\x27','branches','A/B\x20test\x20variant\x20\x27','join','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','activationKeys','exit_criteria','DUPLICATE_LATEST','MISSING_MILESTONE','.segment','INVALID_NEXT_REFERENCE','\x27\x20has\x20no\x20end\x20step','description','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','.exit_criteria[','7smtxoK','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','merge','keys','next','BRANCH_DIRECTLY_TO_MERGE','message','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','length','.next','error','latest','UNUSED_EMBEDDED_SEGMENT','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','.with.condition.timeout','end','\x27\x20(from:\x20','Merge\x20step\x20\x27','state','Activation\x20step\x20requires\x20an\x20activation\x20reference','type','.milestone','CONVERGENCE_WITHOUT_MERGE','Journey\x20can\x20have\x20at\x20most\x20one\x20','stages','ref:','entry_criteria','3987963fbQukd','step\x20\x27','entries','journey','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','filter','abs','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','\x20steps\x20(may\x20be\x20too\x20simple)','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','referencedSegments','MISSING_ACTIVATION_DEFINITION','MISSING_ACTIVATION_REF','.steps[','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','values','MISSING_STAGES','.with.variants','level','.with.condition.timeout.next','.with.condition.next','startsWith','goal','excluded','size','.with.condition.segment','.name','Step\x20references\x20non-existent\x20step\x20\x27','1837917xILysF','condition','activations','skipSchema','includes','warning','684MIGxJn','\x20versions)','\x20stages\x20but\x20maximum\x20is\x20','segments.','journeys,\x20stages,\x20or\x20versions','issues','.with.branches[','jump','version','decision_point','code','safeParse','2031960cCpozs','milestone','.with.condition','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','timeout','\x27\x20(first\x20defined\x20at\x20steps[','852037sXYhtY','\x27\x20has\x20only\x20','\x27\x20with\x20no\x20action\x20in\x20between','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','match','steps','symbol','rule','.stages','224556Bjthas','DUPLICATE_STEP_NAME','versions',').\x20Use\x20a\x20merge\x20step.','\x27\x20has\x20no\x20steps','.with.activation','get','\x27\x20has\x20no\x20exit_criteria\x20defined','add','target','journeys[','trim','journeys','Journey\x20name\x20is\x20required','push','INSUFFICIENT_STEPS','.with','MISSING_SEGMENT_REFERENCE','every','ab_test','Journey\x20has\x20no\x20goal\x20defined','FEW_STEPS','MISSING_WAIT_PARAMS','replace','branch\x20\x27','38835ZjxjEl','timeout\x20of\x20\x27','segment','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','set','.steps',').\x20Merge\x20is\x20unnecessary.','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','some','Duplicate\x20step\x20name\x20\x27','goalIsInherited'];a146_0x2446=function(){return _0x1c3a40;};return a146_0x2446();}function validateActivationStep(_0x179f53,_0x5077e9,_0xb0be56){const _0x2f2d0a=a146_0x271f,_0x57c1fa=[];if(!_0x179f53[_0x2f2d0a(0x11d)]?.[_0x2f2d0a(0x12d)])return _0x57c1fa[_0x2f2d0a(0x105)](createIssue('error',_0x5077e9+_0x2f2d0a(0xfc),_0x2f2d0a(0x17f),_0x2f2d0a(0x167),_0xb0be56,_0x5077e9)),_0x57c1fa;const _0x7fb0d6=_0x179f53[_0x2f2d0a(0x11d)][_0x2f2d0a(0x12d)];return _0xb0be56[_0x2f2d0a(0x149)]&&!_0x7fb0d6['startsWith'](_0x2f2d0a(0x16d))&&(!_0xb0be56['activationKeys'][_0x2f2d0a(0x11c)](_0x7fb0d6)&&_0x57c1fa[_0x2f2d0a(0x105)](createIssue(_0x2f2d0a(0x15d),_0x5077e9+'.with.activation',_0x2f2d0a(0x17e),_0x2f2d0a(0x148)+_0x7fb0d6+_0x2f2d0a(0x176),_0xb0be56))),_0x57c1fa;}function validateDecisionPointStep(_0x355f57,_0x37b6a,_0x7a395c,_0x4fb955){const _0x281db2=a146_0x271f,_0xb59674=[];if(!_0x355f57[_0x281db2(0x11d)]?.['branches']||_0x355f57['with']['branches']['length']===0x0)return _0xb59674[_0x281db2(0x105)](createIssue(_0x281db2(0x15d),_0x37b6a+_0x281db2(0x140),'MISSING_CONDITIONS','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch',_0x7a395c,_0x37b6a)),_0xb59674;for(let _0x19888b=0x0;_0x19888b<_0x355f57[_0x281db2(0x11d)][_0x281db2(0x145)][_0x281db2(0x15b)];_0x19888b++){const _0x3499ed=_0x355f57[_0x281db2(0x11d)][_0x281db2(0x145)][_0x19888b],_0x1fb25f=_0x37b6a+_0x281db2(0x19b)+_0x19888b+']';_0x3499ed[_0x281db2(0x112)]&&!_0x3499ed[_0x281db2(0x18a)]&&(_0x7a395c[_0x281db2(0x17d)]?.['add'](_0x3499ed[_0x281db2(0x112)]),!_0x3499ed[_0x281db2(0x112)][_0x281db2(0x188)](_0x281db2(0x16d))&&(_0x7a395c[_0x281db2(0x13b)]&&!_0x7a395c[_0x281db2(0x13b)][_0x281db2(0x11c)](_0x3499ed['segment'])&&_0xb59674['push'](createIssue(_0x281db2(0x15d),_0x1fb25f+_0x281db2(0x14d),_0x281db2(0x108),_0x281db2(0x160)+_0x3499ed[_0x281db2(0x112)]+'\x27',_0x7a395c))));_0x3499ed[_0x281db2(0x157)]&&_0x7a395c['stepNames']&&!_0x7a395c['stepNames'][_0x281db2(0x11c)](_0x3499ed[_0x281db2(0x157)])&&_0xb59674[_0x281db2(0x105)](createIssue(_0x281db2(0x15d),_0x1fb25f+_0x281db2(0x15c),_0x281db2(0x14e),_0x281db2(0x113)+_0x3499ed[_0x281db2(0x157)]+'\x27',_0x7a395c));if(_0x3499ed[_0x281db2(0x157)]){const _0x1e5931=_0x4fb955[_0x281db2(0xfd)](_0x3499ed[_0x281db2(0x157)]);_0x1e5931?.[_0x281db2(0x168)]==='merge'&&_0xb59674[_0x281db2(0x105)](createIssue('warning',_0x1fb25f+_0x281db2(0x15c),_0x281db2(0x158),'Decision\x20branch\x20\x27'+_0x3499ed[_0x281db2(0x133)]+_0x281db2(0x173)+_0x3499ed[_0x281db2(0x157)]+_0x281db2(0x1aa),_0x7a395c));}}return _0xb59674;}function validateAbTestStep(_0x44924e,_0x32393e,_0x51713e,_0x29d51c){const _0x31b6db=a146_0x271f,_0x378416=[];if(!_0x44924e['with']?.[_0x31b6db(0x142)]||_0x44924e[_0x31b6db(0x11d)][_0x31b6db(0x142)]['length']===0x0)return _0x378416[_0x31b6db(0x105)](createIssue(_0x31b6db(0x15d),_0x32393e+_0x31b6db(0x184),'MISSING_CONDITIONS','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',_0x51713e,_0x32393e)),_0x378416;const _0x2f8b36=_0x44924e[_0x31b6db(0x11d)]['variants']['reduce']((_0x10d91a,_0x38776b)=>_0x10d91a+(_0x38776b['percentage']||0x0),0x0);Math[_0x31b6db(0x178)](_0x2f8b36-0x64)>0.01&&_0x378416['push'](createIssue('error',_0x32393e+'.with.variants','INVALID_AB_TEST_PERCENTAGES',_0x31b6db(0x175)+_0x2f8b36+'%)',_0x51713e));for(let _0x5ea5f0=0x0;_0x5ea5f0<_0x44924e[_0x31b6db(0x11d)]['variants'][_0x31b6db(0x15b)];_0x5ea5f0++){const _0x6fcb5b=_0x44924e[_0x31b6db(0x11d)][_0x31b6db(0x142)][_0x5ea5f0],_0x43b245=_0x32393e+_0x31b6db(0x122)+_0x5ea5f0+']';_0x6fcb5b[_0x31b6db(0x157)]&&_0x51713e['stepNames']&&!_0x51713e[_0x31b6db(0x12f)][_0x31b6db(0x11c)](_0x6fcb5b[_0x31b6db(0x157)])&&_0x378416[_0x31b6db(0x105)](createIssue(_0x31b6db(0x15d),_0x43b245+_0x31b6db(0x15c),_0x31b6db(0x14e),_0x31b6db(0x174)+_0x6fcb5b[_0x31b6db(0x157)]+'\x27',_0x51713e));if(_0x6fcb5b['next']){const _0x39de2f=_0x29d51c[_0x31b6db(0xfd)](_0x6fcb5b['next']);_0x39de2f?.[_0x31b6db(0x168)]===_0x31b6db(0x155)&&_0x378416[_0x31b6db(0x105)](createIssue(_0x31b6db(0x194),_0x43b245+_0x31b6db(0x15c),_0x31b6db(0x158),_0x31b6db(0x146)+_0x6fcb5b[_0x31b6db(0x133)]+'\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x6fcb5b[_0x31b6db(0x157)]+_0x31b6db(0x1aa),_0x51713e));}}return _0x378416;}function validateJumpStep(_0x12ff56,_0x13dd4f,_0x1c176c){const _0x253bf6=a146_0x271f,_0x1797ea=[];if(!_0x12ff56[_0x253bf6(0x11d)]?.[_0x253bf6(0x100)])return _0x1797ea['push'](createIssue(_0x253bf6(0x15d),_0x13dd4f+_0x253bf6(0x130),_0x253bf6(0x12e),_0x253bf6(0x12c),_0x1c176c,_0x13dd4f)),_0x1797ea;return(!_0x12ff56[_0x253bf6(0x11d)][_0x253bf6(0x100)][_0x253bf6(0x172)]||!_0x12ff56[_0x253bf6(0x11d)][_0x253bf6(0x100)][_0x253bf6(0x141)])&&_0x1797ea[_0x253bf6(0x105)](createIssue(_0x253bf6(0x15d),_0x13dd4f+_0x253bf6(0x130),_0x253bf6(0x12e),_0x253bf6(0x17c),_0x1c176c)),_0x1797ea;}function buildConvergenceMap(_0x24bc32){const _0x25c3d7=a146_0x271f,_0x22cd51=new Map();function _0x4b2977(_0x5b1f08,_0x1036ab){const _0x101ba4=a146_0x271f,_0x3f20bf=_0x22cd51[_0x101ba4(0xfd)](_0x5b1f08)||[];_0x3f20bf[_0x101ba4(0x105)](_0x1036ab),_0x22cd51[_0x101ba4(0x114)](_0x5b1f08,_0x3f20bf);}for(const _0x183d8d of _0x24bc32){_0x183d8d[_0x25c3d7(0x157)]&&_0x4b2977(_0x183d8d[_0x25c3d7(0x157)],{'stepName':_0x183d8d[_0x25c3d7(0x133)],'description':_0x25c3d7(0x170)+_0x183d8d[_0x25c3d7(0x133)]+'\x27'});if(_0x183d8d['type']===_0x25c3d7(0x19e)&&_0x183d8d[_0x25c3d7(0x11d)]?.[_0x25c3d7(0x145)])for(const _0x305049 of _0x183d8d[_0x25c3d7(0x11d)][_0x25c3d7(0x145)]){_0x305049['next']&&_0x4b2977(_0x305049['next'],{'stepName':_0x183d8d[_0x25c3d7(0x133)],'description':_0x25c3d7(0x10f)+_0x305049[_0x25c3d7(0x133)]+_0x25c3d7(0x139)+_0x183d8d[_0x25c3d7(0x133)]+'\x27'});}if(_0x183d8d[_0x25c3d7(0x168)]==='ab_test'&&_0x183d8d[_0x25c3d7(0x11d)]?.['variants'])for(const _0x2de8d2 of _0x183d8d[_0x25c3d7(0x11d)][_0x25c3d7(0x142)]){_0x2de8d2[_0x25c3d7(0x157)]&&_0x4b2977(_0x2de8d2[_0x25c3d7(0x157)],{'stepName':_0x183d8d[_0x25c3d7(0x133)],'description':_0x25c3d7(0x144)+_0x2de8d2['name']+_0x25c3d7(0x139)+_0x183d8d[_0x25c3d7(0x133)]+'\x27'});}_0x183d8d[_0x25c3d7(0x168)]===_0x25c3d7(0x129)&&_0x183d8d[_0x25c3d7(0x11d)]?.[_0x25c3d7(0x190)]&&(_0x183d8d[_0x25c3d7(0x11d)][_0x25c3d7(0x190)][_0x25c3d7(0x157)]&&_0x4b2977(_0x183d8d[_0x25c3d7(0x11d)]['condition'][_0x25c3d7(0x157)],{'stepName':_0x183d8d['name'],'description':_0x25c3d7(0x12b)+_0x183d8d[_0x25c3d7(0x133)]+'\x27'}),_0x183d8d[_0x25c3d7(0x11d)][_0x25c3d7(0x190)][_0x25c3d7(0x1a6)]?.[_0x25c3d7(0x157)]&&_0x4b2977(_0x183d8d[_0x25c3d7(0x11d)][_0x25c3d7(0x190)]['timeout'][_0x25c3d7(0x157)],{'stepName':_0x183d8d['name'],'description':_0x25c3d7(0x111)+_0x183d8d['name']+'\x27'}));}return _0x22cd51;}function validateFlowControl(_0x3d163e,_0x178c2e,_0x53ba61){const _0x4abdca=a146_0x271f,_0x1d325d=[],_0x46c2d4=_0x4abdca(0x134)+_0x178c2e+']',_0x362a40=_0x3d163e[_0x4abdca(0xf3)]||[];if(_0x362a40[_0x4abdca(0x15b)]===0x0)return _0x1d325d;const _0x5d8302=new Map();for(const _0x3e5049 of _0x362a40){_0x3e5049[_0x4abdca(0x133)]&&_0x5d8302[_0x4abdca(0x114)](_0x3e5049[_0x4abdca(0x133)],_0x3e5049);}const _0x1b8a62=buildConvergenceMap(_0x362a40),_0x3738ce=_0x362a40[_0x4abdca(0x118)](_0x4e5d66=>_0x4e5d66[_0x4abdca(0x168)]===_0x4abdca(0x163));!_0x3738ce&&_0x1d325d[_0x4abdca(0x105)](createIssue(_0x4abdca(0x15d),_0x46c2d4+_0x4abdca(0x115),'MISSING_END_STEP',_0x4abdca(0x11f)+_0x3d163e['name']+_0x4abdca(0x14f),_0x53ba61));for(const [_0x3fd070,_0x103a89]of _0x1b8a62){const _0x12f7c6=_0x5d8302['get'](_0x3fd070);if(!_0x12f7c6)continue;if(_0x103a89[_0x4abdca(0x15b)]>0x1&&_0x12f7c6[_0x4abdca(0x168)]!==_0x4abdca(0x155)){const _0x285ecd=_0x103a89['map'](_0x21dfa0=>_0x21dfa0[_0x4abdca(0x150)])[_0x4abdca(0x147)](',\x20');_0x1d325d['push'](createIssue(_0x4abdca(0x15d),_0x46c2d4+_0x4abdca(0x115),_0x4abdca(0x16a),'Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27'+_0x3fd070+_0x4abdca(0x164)+_0x285ecd+_0x4abdca(0xfa),_0x53ba61));}_0x103a89[_0x4abdca(0x15b)]===0x1&&_0x12f7c6['type']===_0x4abdca(0x155)&&_0x1d325d['push'](createIssue(_0x4abdca(0x194),_0x46c2d4+_0x4abdca(0x115),'SINGLE_INPUT_MERGE',_0x4abdca(0x165)+_0x3fd070+_0x4abdca(0x15a)+_0x103a89[0x0][_0x4abdca(0x150)]+_0x4abdca(0x116),_0x53ba61));}for(const _0x276bb6 of _0x362a40){if(_0x276bb6[_0x4abdca(0x168)]===_0x4abdca(0x155)&&_0x276bb6[_0x4abdca(0x157)]){const _0x242490=_0x5d8302[_0x4abdca(0xfd)](_0x276bb6[_0x4abdca(0x157)]);_0x242490?.[_0x4abdca(0x168)]===_0x4abdca(0x155)&&_0x1d325d[_0x4abdca(0x105)](createIssue(_0x4abdca(0x15d),_0x46c2d4+'.steps','MERGE_TO_MERGE_CHAIN',_0x4abdca(0x165)+_0x276bb6[_0x4abdca(0x133)]+_0x4abdca(0x161)+_0x276bb6[_0x4abdca(0x157)]+_0x4abdca(0x179),_0x53ba61));}}return _0x1d325d;}function validateCriteria(_0x16e28f,_0x3e99c9,_0xb36ff9){const _0x51f6e8=a146_0x271f,_0x47c3a2=[];return _0x16e28f[_0x51f6e8(0x112)]&&(_0xb36ff9[_0x51f6e8(0x17d)]?.[_0x51f6e8(0xff)](_0x16e28f[_0x51f6e8(0x112)]),!_0x16e28f[_0x51f6e8(0x112)][_0x51f6e8(0x188)](_0x51f6e8(0x16d))&&(_0xb36ff9[_0x51f6e8(0x13b)]&&!_0xb36ff9[_0x51f6e8(0x13b)][_0x51f6e8(0x11c)](_0x16e28f[_0x51f6e8(0x112)])&&_0x47c3a2['push'](createIssue(_0x51f6e8(0x15d),_0x3e99c9+_0x51f6e8(0x14d),_0x51f6e8(0x108),_0x51f6e8(0x13c)+_0x16e28f['segment']+'\x27',_0xb36ff9)))),_0x47c3a2;}function validateEmbeddedSegment(_0x506c31,_0xddfa1e,_0x596e42){const _0x8ef584=a146_0x271f,_0x2246b1=[];return _0x506c31['rule']&&_0x2246b1[_0x8ef584(0x105)](...validateRuleDef(_0x506c31[_0x8ef584(0xf5)],_0xddfa1e+'.rule',_0x596e42)),_0x2246b1;}function validateStage(_0x3f8185,_0x209827,_0xc1af4,_0x34ee3c){const _0x3d3124=a146_0x271f,_0x546d9c=[],_0x308f24=_0x3d3124(0x134)+_0x209827+']',_0x47846d=new Map(),_0x5cb633=new Map();if(_0x3f8185[_0x3d3124(0xf3)]){for(let _0x3631a0=0x0;_0x3631a0<_0x3f8185[_0x3d3124(0xf3)]['length'];_0x3631a0++){const _0x57df3c=_0x3f8185[_0x3d3124(0xf3)][_0x3631a0];_0x57df3c[_0x3d3124(0x133)]&&_0x47846d['set'](_0x57df3c[_0x3d3124(0x133)],_0x57df3c);}for(let _0x175aa5=0x0;_0x175aa5<_0x3f8185[_0x3d3124(0xf3)][_0x3d3124(0x15b)];_0x175aa5++){const _0x49a3c8=_0x3f8185['steps'][_0x175aa5],_0x4067f6=_0x308f24+_0x3d3124(0x180)+_0x175aa5+']';if(_0x49a3c8[_0x3d3124(0x133)]){if(_0x5cb633[_0x3d3124(0x11c)](_0x49a3c8[_0x3d3124(0x133)])){const _0x442b34=_0x5cb633[_0x3d3124(0xfd)](_0x49a3c8[_0x3d3124(0x133)]);_0x546d9c['push'](createIssue(_0x3d3124(0x15d),_0x4067f6+_0x3d3124(0x18d),_0x3d3124(0xf8),_0x3d3124(0x119)+_0x49a3c8[_0x3d3124(0x133)]+_0x3d3124(0x1a7)+_0x442b34+'])',_0x34ee3c));}else _0x5cb633[_0x3d3124(0x114)](_0x49a3c8[_0x3d3124(0x133)],_0x175aa5);}_0x546d9c['push'](...validateStep(_0x49a3c8,_0x4067f6,_0x34ee3c,_0x47846d));}}_0x3f8185[_0x3d3124(0x16e)]&&_0x546d9c[_0x3d3124(0x105)](...validateCriteria(_0x3f8185[_0x3d3124(0x16e)],_0x308f24+_0x3d3124(0x11e),_0x34ee3c));if(_0x3f8185['exit_criteria'])for(let _0x538bad=0x0;_0x538bad<_0x3f8185[_0x3d3124(0x14a)][_0x3d3124(0x15b)];_0x538bad++){_0x546d9c['push'](...validateCriteria(_0x3f8185[_0x3d3124(0x14a)][_0x538bad],_0x308f24+_0x3d3124(0x152)+_0x538bad+']',_0x34ee3c));}return _0x3f8185[_0x3d3124(0x1a2)]&&_0x546d9c[_0x3d3124(0x105)](...validateCriteria(_0x3f8185[_0x3d3124(0x1a2)],_0x308f24+'.milestone',_0x34ee3c)),_0x546d9c[_0x3d3124(0x105)](...validateStageStructure(_0x3f8185,_0x209827,_0xc1af4,_0x34ee3c)),_0x546d9c[_0x3d3124(0x105)](...validateFlowControl(_0x3f8185,_0x209827,_0x34ee3c)),_0x546d9c;}function validateStagesForVersion(_0x200b43,_0x2fb2c4,_0x396e6b,_0x39b63b,_0x1a0566,_0x4b6519,_0x79c5a4){const _0x3ce4f9=a146_0x271f;if(_0x200b43[_0x3ce4f9(0x15b)]===0x0){_0x1a0566['push']({'level':_0x3ce4f9(0x15d),'path':_0x39b63b+_0x3ce4f9(0x16c),'code':_0x3ce4f9(0x183),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x396e6b['document'],_0x396e6b['source'],[_0x3ce4f9(0x16c)])});return;}const _0x3ea8cd=new Set();for(const _0x4e82b5 of _0x200b43){if(_0x4e82b5[_0x3ce4f9(0xf3)])for(const _0x84dc2f of _0x4e82b5[_0x3ce4f9(0xf3)]){_0x84dc2f['name']&&_0x3ea8cd[_0x3ce4f9(0xff)](_0x84dc2f['name']);}}const _0x31578e={..._0x396e6b,'stepNames':_0x3ea8cd},_0xe439ae=validateVersionStructure(_0x200b43,_0x31578e);for(const _0x520df8 of _0xe439ae){const _0x4a94fe=_0x39b63b?{..._0x520df8,'path':''+_0x39b63b+_0x520df8[_0x3ce4f9(0x123)]}:_0x520df8;if(_0x4a94fe[_0x3ce4f9(0x185)]==='error')_0x1a0566['push'](_0x4a94fe);else _0x4b6519[_0x3ce4f9(0x105)](_0x4a94fe);}for(let _0xd667fb=0x0;_0xd667fb<_0x200b43[_0x3ce4f9(0x15b)];_0xd667fb++){const _0x2b3edd=validateStage(_0x200b43[_0xd667fb],_0xd667fb,_0x200b43[_0x3ce4f9(0x15b)],_0x31578e);for(const _0x2efc1c of _0x2b3edd){const _0x61dcaa=_0x39b63b?{..._0x2efc1c,'path':''+_0x39b63b+_0x2efc1c[_0x3ce4f9(0x123)]}:_0x2efc1c;if(_0x61dcaa[_0x3ce4f9(0x185)]==='error')_0x1a0566[_0x3ce4f9(0x105)](_0x61dcaa);else _0x4b6519['push'](_0x61dcaa);}}if(_0x2fb2c4[_0x3ce4f9(0x189)]){const _0x46d715=_0x79c5a4?.[_0x3ce4f9(0x11a)]?_0x3ce4f9(0x189):_0x39b63b+_0x3ce4f9(0x189),_0x2aeb3e=validateCriteria(_0x2fb2c4[_0x3ce4f9(0x189)],_0x46d715,_0x31578e);for(const _0x1b3ca9 of _0x2aeb3e){if(_0x1b3ca9[_0x3ce4f9(0x185)]===_0x3ce4f9(0x15d))_0x1a0566[_0x3ce4f9(0x105)](_0x1b3ca9);else _0x4b6519['push'](_0x1b3ca9);}}}function extractVersionIndex(_0x53598b){const _0x393c7b=a146_0x271f,_0x37e0a5=_0x53598b[_0x393c7b(0xf2)](/^journeys\[(\d+)\]\./);return _0x37e0a5?_0x37e0a5[0x1]:undefined;}function deduplicateAcrossVersions(_0x1f4261){const _0x8a4fa7=a146_0x271f,_0x3692ca=new Map();for(let _0x242301=0x0;_0x242301<_0x1f4261[_0x8a4fa7(0x15b)];_0x242301++){const _0xd4f676=_0x1f4261[_0x242301][_0x8a4fa7(0x19f)]+':'+_0x1f4261[_0x242301]['message'],_0x4dd960=extractVersionIndex(_0x1f4261[_0x242301][_0x8a4fa7(0x123)]),_0x3bfadf=_0x3692ca[_0x8a4fa7(0xfd)](_0xd4f676);if(_0x3bfadf){_0x3bfadf[_0x8a4fa7(0x124)]['push'](_0x242301);if(_0x4dd960)_0x3bfadf[_0x8a4fa7(0xf9)][_0x8a4fa7(0xff)](_0x4dd960);}else _0x3692ca[_0x8a4fa7(0x114)](_0xd4f676,{'indices':[_0x242301],'versions':new Set(_0x4dd960?[_0x4dd960]:[])});}const _0x517311=new Set();for(const {indices:_0x2d75a0,versions:_0x4427ac}of _0x3692ca[_0x8a4fa7(0x182)]()){if(_0x4427ac['size']<=0x1)continue;const _0x50a770=_0x1f4261[_0x2d75a0[0x0]];_0x50a770[_0x8a4fa7(0x123)]=_0x50a770[_0x8a4fa7(0x123)][_0x8a4fa7(0x10e)](/^journeys\[\d+\]\./,''),_0x50a770['message']=_0x50a770['message']+_0x8a4fa7(0x132)+_0x4427ac[_0x8a4fa7(0x18b)]+_0x8a4fa7(0x196);for(let _0x4d255d=0x1;_0x4d255d<_0x2d75a0['length'];_0x4d255d++){_0x517311['add'](_0x2d75a0[_0x4d255d]);}}const _0x1f0790=[..._0x517311]['sort']((_0x4c4a39,_0x10ee1b)=>_0x10ee1b-_0x4c4a39);for(const _0x23bbe8 of _0x1f0790){_0x1f4261['splice'](_0x23bbe8,0x1);}}export function validateJourneyDef(_0x48c33a,_0x49044e={},_0x1c0e3c={}){const _0x1f9c3f=a146_0x271f;if(_0x1c0e3c[_0x1f9c3f(0x192)])return runJourneySemanticChecks(_0x48c33a,_0x49044e);const _0x55e9fa=JourneyDefSchema[_0x1f9c3f(0x1a0)](_0x48c33a);if(_0x55e9fa[_0x1f9c3f(0x11b)])return runJourneySemanticChecks(_0x55e9fa['data'],_0x49044e);return zodErrorsToJourneyValidationResult(_0x55e9fa['error'],_0x49044e);}function zodErrorsToJourneyValidationResult(_0x47c33e,_0x2340a1){const _0x20e682=a146_0x271f,_0x4bb356=flattenZodIssues(_0x47c33e[_0x20e682(0x19a)]),_0x3dd76b=_0x4bb356[_0x20e682(0x143)](_0x19b213=>{const _0x5e5817=_0x20e682,_0x275dfc=formatZodPath(_0x19b213[_0x5e5817(0x123)]),_0x316fe0=mapJourneyZodIssueToCode(_0x19b213,_0x275dfc),_0x1606e8=getLocationFromPath(_0x2340a1['document'],_0x2340a1[_0x5e5817(0x126)],_0x19b213[_0x5e5817(0x123)][_0x5e5817(0x143)](_0x43a559=>typeof _0x43a559===_0x5e5817(0xf4)?String(_0x43a559):_0x43a559));return{'level':_0x5e5817(0x15d),'path':_0x275dfc,'code':_0x316fe0,'message':_0x19b213[_0x5e5817(0x159)],..._0x1606e8&&{'location':_0x1606e8}};});return{'valid':![],'errors':_0x3dd76b,'warnings':[]};}function mapJourneyZodIssueToCode(_0x412338,_0x1528ff){const _0x4e4538=a146_0x271f;if(_0x1528ff==='name')return'MISSING_NAME';if(_0x1528ff[_0x4e4538(0x125)]('.type')&&_0x1528ff[_0x4e4538(0x193)](_0x4e4538(0xf3)))return'JOURNEY_SCHEMA_ERROR';if(_0x1528ff===_0x4e4538(0x16c)||_0x1528ff['endsWith'](_0x4e4538(0xf6)))return _0x4e4538(0x183);if(_0x1528ff===''&&_0x412338['message'][_0x4e4538(0x193)](_0x4e4538(0x199)))return _0x4e4538(0x183);if(_0x1528ff[_0x4e4538(0x193)](_0x4e4538(0x12d)))return _0x4e4538(0x136);return'JOURNEY_SCHEMA_ERROR';}function runJourneySemanticChecks(_0x4f63a3,_0x41b93b){const _0x6d2d89=a146_0x271f,_0x54433d=[],_0x24942b=[];(!_0x4f63a3[_0x6d2d89(0x133)]||_0x4f63a3['name'][_0x6d2d89(0x102)]()==='')&&_0x54433d[_0x6d2d89(0x105)]({'level':_0x6d2d89(0x15d),'path':'name','code':'MISSING_NAME','message':_0x6d2d89(0x104),'location':getLocationFromPath(_0x41b93b['document'],_0x41b93b[_0x6d2d89(0x126)],['name'])});const _0xef0bfd=new Set();if(_0x4f63a3[_0x6d2d89(0x137)])for(const _0x482727 of Object[_0x6d2d89(0x156)](_0x4f63a3[_0x6d2d89(0x137)])){_0xef0bfd[_0x6d2d89(0xff)](_0x482727);}const _0x5c1897=new Set();if(_0x4f63a3[_0x6d2d89(0x191)])for(const _0x2f21b3 of Object['keys'](_0x4f63a3[_0x6d2d89(0x191)])){_0x5c1897[_0x6d2d89(0xff)](_0x2f21b3);}const _0x4c8a5a=new Set(),_0x2ce5e5={..._0x41b93b,'embeddedSegments':_0xef0bfd,'referencedSegments':_0x4c8a5a,'activationKeys':_0x5c1897['size']>0x0?_0x5c1897:undefined};if(_0x4f63a3[_0x6d2d89(0x137)])for(const [_0xe79691,_0x112770]of Object[_0x6d2d89(0x171)](_0x4f63a3[_0x6d2d89(0x137)])){const _0xbb78c1=validateEmbeddedSegment(_0x112770,_0x6d2d89(0x198)+_0xe79691,_0x2ce5e5);for(const _0x288fd6 of _0xbb78c1){if(_0x288fd6[_0x6d2d89(0x185)]===_0x6d2d89(0x15d))_0x54433d[_0x6d2d89(0x105)](_0x288fd6);else _0x24942b[_0x6d2d89(0x105)](_0x288fd6);}}const _0x9eb637=!!_0x4f63a3[_0x6d2d89(0x189)],_0x217107=_0x4f63a3[_0x6d2d89(0x103)]?.[_0x6d2d89(0x109)](_0x372520=>!!_0x372520[_0x6d2d89(0x189)])??![];!_0x9eb637&&!_0x217107&&_0x24942b['push']({'level':_0x6d2d89(0x194),'path':'goal','code':'MISSING_GOAL','message':_0x6d2d89(0x10b),'location':getLocationFromPath(_0x41b93b['document'],_0x41b93b[_0x6d2d89(0x126)],[_0x6d2d89(0x189)])});const _0x3007d2=_0x4f63a3[_0x6d2d89(0x103)]??_0x4f63a3[_0x6d2d89(0xf9)];if(_0x3007d2&&_0x3007d2[_0x6d2d89(0x177)](_0x14b4c4=>_0x14b4c4[_0x6d2d89(0x15e)]===!![])[_0x6d2d89(0x15b)]>0x1){const _0x588de7=_0x4f63a3[_0x6d2d89(0x103)]?'journeys':_0x6d2d89(0xf9);_0x54433d[_0x6d2d89(0x105)]({'level':_0x6d2d89(0x15d),'path':_0x588de7,'code':_0x6d2d89(0x14b),'message':_0x6d2d89(0x16b)+(_0x588de7===_0x6d2d89(0x103)?_0x6d2d89(0x120):_0x6d2d89(0x19d))+'\x20with\x20latest:\x20true','location':getLocationFromPath(_0x41b93b['document'],_0x41b93b[_0x6d2d89(0x126)],[_0x588de7])});}if(_0x4f63a3['journeys']&&_0x4f63a3[_0x6d2d89(0x103)][_0x6d2d89(0x15b)]>0x0)for(let _0x1ebfab=0x0;_0x1ebfab<_0x4f63a3[_0x6d2d89(0x103)]['length'];_0x1ebfab++){const _0x542b50=_0x4f63a3[_0x6d2d89(0x103)][_0x1ebfab];if(_0x4f63a3['journeys'][_0x6d2d89(0x15b)]>0x1&&_0x542b50['state']===_0x6d2d89(0x135))continue;const _0x1b38a9=_0x542b50[_0x6d2d89(0x16c)]||[],_0x310a14=_0x6d2d89(0x101)+_0x1ebfab+'].',_0x418435=!!_0x542b50[_0x6d2d89(0x189)],_0xd1e920=_0x418435?{..._0x4f63a3,'goal':_0x542b50['goal']}:_0x4f63a3;validateStagesForVersion(_0x1b38a9,_0xd1e920,_0x2ce5e5,_0x310a14,_0x54433d,_0x24942b,{'goalIsInherited':!_0x418435});}else{if(_0x4f63a3['versions']&&_0x4f63a3['versions']['length']>0x0)for(let _0x3e5282=0x0;_0x3e5282<_0x4f63a3[_0x6d2d89(0xf9)][_0x6d2d89(0x15b)];_0x3e5282++){const _0x489ceb=_0x4f63a3[_0x6d2d89(0xf9)][_0x3e5282];if(_0x4f63a3['versions']['length']>0x1&&_0x489ceb[_0x6d2d89(0x166)]===_0x6d2d89(0x135))continue;const _0xf1d64d=_0x489ceb[_0x6d2d89(0x16c)]||[],_0x48e705=_0x6d2d89(0x13d)+_0x3e5282+'].';validateStagesForVersion(_0xf1d64d,_0x4f63a3,_0x2ce5e5,_0x48e705,_0x54433d,_0x24942b);}else{const _0x48cc73=_0x4f63a3[_0x6d2d89(0x16c)]||[];validateStagesForVersion(_0x48cc73,_0x4f63a3,_0x2ce5e5,'',_0x54433d,_0x24942b);}}_0x4f63a3['journeys']&&_0x4f63a3[_0x6d2d89(0x103)][_0x6d2d89(0x15b)]>0x1&&(deduplicateAcrossVersions(_0x54433d),deduplicateAcrossVersions(_0x24942b));for(const _0x399e9b of _0xef0bfd){!_0x4c8a5a[_0x6d2d89(0x11c)](_0x399e9b)&&!_0x399e9b[_0x6d2d89(0x188)]('excluded_')&&_0x24942b[_0x6d2d89(0x105)]({'level':_0x6d2d89(0x194),'path':'segments.'+_0x399e9b,'code':_0x6d2d89(0x15f),'message':_0x6d2d89(0x127)+_0x399e9b+'\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','location':getLocationFromPath(_0x41b93b['document'],_0x41b93b[_0x6d2d89(0x126)],['segments',_0x399e9b])});}return{'valid':_0x54433d[_0x6d2d89(0x15b)]===0x0,'errors':_0x54433d,'warnings':_0x24942b};}
|
|
1
|
+
(function(_0x410442,_0x582016){const _0x24d380=a149_0x4ad7,_0x5911ec=_0x410442();while(!![]){try{const _0x211ea7=-parseInt(_0x24d380(0x124))/0x1+-parseInt(_0x24d380(0xfb))/0x2+-parseInt(_0x24d380(0x137))/0x3+parseInt(_0x24d380(0x129))/0x4+-parseInt(_0x24d380(0x175))/0x5+-parseInt(_0x24d380(0x181))/0x6+-parseInt(_0x24d380(0x116))/0x7*(-parseInt(_0x24d380(0x172))/0x8);if(_0x211ea7===_0x582016)break;else _0x5911ec['push'](_0x5911ec['shift']());}catch(_0x23cee4){_0x5911ec['push'](_0x5911ec['shift']());}}}(a149_0x1bc7,0x9cae3));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x1001f9,_0x383a9d,_0x3da4fe,_0x24c6cf,_0x43eb9b,_0x1cb37f){const _0x477a59=a149_0x4ad7;return{'level':_0x1001f9,'path':_0x383a9d,'code':_0x3da4fe,'message':_0x24c6cf,'location':getLocationFromPath(_0x43eb9b[_0x477a59(0xf4)],_0x43eb9b[_0x477a59(0x15a)],pathToArray(_0x1cb37f??_0x383a9d))};}function validateVersionStructure(_0x3c342a,_0xcb990b){const _0x295f82=a149_0x4ad7,_0x3edcca=[];return _0x3c342a[_0x295f82(0xd6)]>MAX_STAGES&&_0x3edcca[_0x295f82(0x152)](createIssue(_0x295f82(0xf2),_0x295f82(0x102),_0x295f82(0x11b),_0x295f82(0xf0)+_0x3c342a['length']+_0x295f82(0x109)+MAX_STAGES,_0xcb990b)),_0x3edcca;}function validateStageStructure(_0x53a00b,_0x48d83d,_0x33fccc,_0x426aca){const _0x442109=a149_0x4ad7,_0x57db43=[],_0x1bc803=_0x442109(0x11e)+_0x48d83d+']';_0x48d83d===0x0&&!_0x53a00b[_0x442109(0xdf)]&&_0x57db43[_0x442109(0x152)](createIssue(_0x442109(0xf2),_0x1bc803+_0x442109(0x17d),_0x442109(0x13f),_0x442109(0x143)+_0x53a00b[_0x442109(0x17a)]+_0x442109(0xdb),_0x426aca,_0x1bc803));const _0x5e3f34=_0x48d83d===_0x33fccc-0x1;!_0x5e3f34&&!_0x53a00b[_0x442109(0x166)]&&_0x57db43[_0x442109(0x152)](createIssue(_0x442109(0xf2),_0x1bc803+_0x442109(0x114),_0x442109(0xfc),_0x442109(0x143)+_0x53a00b[_0x442109(0x17a)]+_0x442109(0xf7),_0x426aca,_0x1bc803));(!_0x53a00b[_0x442109(0xd4)]||_0x53a00b['exit_criteria']['length']===0x0)&&_0x57db43[_0x442109(0x152)](createIssue(_0x442109(0xf3),_0x1bc803+_0x442109(0x183),_0x442109(0x156),_0x442109(0x143)+_0x53a00b[_0x442109(0x17a)]+'\x27\x20has\x20no\x20exit_criteria\x20defined',_0x426aca,_0x1bc803));const _0x116b96=_0x53a00b['steps']?.[_0x442109(0xd6)]??0x0;if(_0x116b96===0x0)_0x57db43[_0x442109(0x152)](createIssue('error',_0x1bc803+_0x442109(0xea),'INSUFFICIENT_STEPS','Stage\x20\x27'+_0x53a00b[_0x442109(0x17a)]+_0x442109(0x157),_0x426aca,_0x1bc803+_0x442109(0xea)));else{if(_0x116b96===0x1)_0x57db43[_0x442109(0x152)](createIssue(_0x442109(0xf3),_0x1bc803+_0x442109(0xea),_0x442109(0x134),_0x442109(0x143)+_0x53a00b[_0x442109(0x17a)]+_0x442109(0xdd),_0x426aca,_0x1bc803+'.steps'));else _0x116b96<=0x3&&_0x57db43[_0x442109(0x152)](createIssue(_0x442109(0xf3),_0x1bc803+_0x442109(0xea),_0x442109(0x185),_0x442109(0x143)+_0x53a00b[_0x442109(0x17a)]+_0x442109(0xd9)+_0x116b96+_0x442109(0x164),_0x426aca,_0x1bc803+_0x442109(0xea)));}return _0x57db43;}function validateStep(_0xebc6cd,_0xecf011,_0x551c4e,_0x565e0f){const _0x19e97a=a149_0x4ad7,_0x1e5a44=[];if(_0xebc6cd[_0x19e97a(0x130)]===_0x19e97a(0x151))return _0xebc6cd[_0x19e97a(0x15d)]&&_0x1e5a44['push'](createIssue(_0x19e97a(0xf2),_0xecf011+'.next','END_STEP_HAS_NEXT_OR_WITH',_0x19e97a(0x186)+_0xebc6cd['name']+_0x19e97a(0x13c),_0x551c4e)),_0x19e97a(0xff)in _0xebc6cd&&_0xebc6cd[_0x19e97a(0xff)]!==undefined&&_0x1e5a44[_0x19e97a(0x152)](createIssue(_0x19e97a(0xf2),_0xecf011+'.with','END_STEP_HAS_NEXT_OR_WITH',_0x19e97a(0x186)+_0xebc6cd[_0x19e97a(0x17a)]+_0x19e97a(0x17f),_0x551c4e)),_0x1e5a44;_0xebc6cd[_0x19e97a(0x15d)]&&(_0x551c4e[_0x19e97a(0x170)]&&!_0x551c4e[_0x19e97a(0x170)][_0x19e97a(0x105)](_0xebc6cd[_0x19e97a(0x15d)])&&_0x1e5a44[_0x19e97a(0x152)](createIssue('error',_0xecf011+_0x19e97a(0xe4),_0x19e97a(0x165),_0x19e97a(0x141)+_0xebc6cd[_0x19e97a(0x15d)]+'\x27',_0x551c4e)));switch(_0xebc6cd[_0x19e97a(0x130)]){case _0x19e97a(0x145):_0x1e5a44[_0x19e97a(0x152)](...validateWaitStep(_0xebc6cd,_0xecf011,_0x551c4e,_0x565e0f));break;case _0x19e97a(0x106):_0x1e5a44[_0x19e97a(0x152)](...validateActivationStep(_0xebc6cd,_0xecf011,_0x551c4e));break;case _0x19e97a(0x140):_0x1e5a44['push'](...validateDecisionPointStep(_0xebc6cd,_0xecf011,_0x551c4e,_0x565e0f));break;case _0x19e97a(0xf5):_0x1e5a44[_0x19e97a(0x152)](...validateAbTestStep(_0xebc6cd,_0xecf011,_0x551c4e,_0x565e0f));break;case'jump':_0x1e5a44['push'](...validateJumpStep(_0xebc6cd,_0xecf011,_0x551c4e));break;}return _0x1e5a44;}function validateWaitStep(_0x226742,_0x2a4c1c,_0x556b18,_0x4b5426){const _0x5b5df8=a149_0x4ad7,_0x488847=[];if(!_0x226742[_0x5b5df8(0xff)])return _0x488847[_0x5b5df8(0x152)](createIssue(_0x5b5df8(0xf2),_0x2a4c1c+_0x5b5df8(0x10b),_0x5b5df8(0xf9),_0x5b5df8(0x158),_0x556b18,_0x2a4c1c)),_0x488847;if(_0x226742['with'][_0x5b5df8(0x18a)]){const _0x235897=_0x226742[_0x5b5df8(0xff)][_0x5b5df8(0x18a)];if(_0x235897['segment']){_0x556b18[_0x5b5df8(0x173)]?.[_0x5b5df8(0x14d)](_0x235897[_0x5b5df8(0x142)]);!_0x235897['segment'][_0x5b5df8(0xf6)](_0x5b5df8(0x104))&&(_0x556b18[_0x5b5df8(0xd5)]&&!_0x556b18[_0x5b5df8(0xd5)][_0x5b5df8(0x105)](_0x235897[_0x5b5df8(0x142)])&&_0x488847[_0x5b5df8(0x152)](createIssue(_0x5b5df8(0xf2),_0x2a4c1c+_0x5b5df8(0x136),_0x5b5df8(0x169),_0x5b5df8(0x12f)+_0x235897[_0x5b5df8(0x142)]+_0x5b5df8(0x184),_0x556b18)));_0x235897[_0x5b5df8(0x15d)]&&_0x556b18['stepNames']&&!_0x556b18[_0x5b5df8(0x170)]['has'](_0x235897[_0x5b5df8(0x15d)])&&_0x488847['push'](createIssue('error',_0x2a4c1c+_0x5b5df8(0x10c),'INVALID_NEXT_REFERENCE',_0x5b5df8(0x13a)+_0x235897['next']+'\x27',_0x556b18));_0x235897['timeout']?.[_0x5b5df8(0x15d)]&&_0x556b18[_0x5b5df8(0x170)]&&!_0x556b18[_0x5b5df8(0x170)][_0x5b5df8(0x105)](_0x235897[_0x5b5df8(0x17e)]['next'])&&_0x488847['push'](createIssue(_0x5b5df8(0xf2),_0x2a4c1c+'.with.condition.timeout.next',_0x5b5df8(0x165),_0x5b5df8(0x187)+_0x235897[_0x5b5df8(0x17e)][_0x5b5df8(0x15d)]+'\x27',_0x556b18));const _0x2e092b=_0x235897[_0x5b5df8(0x15d)]||_0x226742[_0x5b5df8(0x15d)],_0x4566dd=_0x235897['timeout']?.[_0x5b5df8(0x15d)]||_0x226742['next'];if(_0x2e092b){const _0x2e590a=_0x4b5426['get'](_0x2e092b);_0x2e590a?.[_0x5b5df8(0x130)]===_0x5b5df8(0x14b)&&_0x488847[_0x5b5df8(0x152)](createIssue('warning',_0x2a4c1c+_0x5b5df8(0x10c),'BRANCH_DIRECTLY_TO_MERGE',_0x5b5df8(0x155)+_0x2e092b+_0x5b5df8(0x161),_0x556b18,_0x2a4c1c+_0x5b5df8(0x110)));}if(_0x4566dd){const _0x64255c=_0x4b5426[_0x5b5df8(0x10f)](_0x4566dd);_0x64255c?.[_0x5b5df8(0x130)]===_0x5b5df8(0x14b)&&_0x488847[_0x5b5df8(0x152)](createIssue(_0x5b5df8(0xf3),_0x2a4c1c+_0x5b5df8(0x180),_0x5b5df8(0x14f),_0x5b5df8(0x174)+_0x4566dd+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x556b18,_0x2a4c1c+_0x5b5df8(0x125)));}}}return _0x488847;}function validateActivationStep(_0x1d6df6,_0x584e77,_0x34ab4f){const _0x1829b8=a149_0x4ad7,_0x50ae57=[];if(!_0x1d6df6[_0x1829b8(0xff)]?.['activation'])return _0x50ae57[_0x1829b8(0x152)](createIssue(_0x1829b8(0xf2),_0x584e77+_0x1829b8(0x120),'MISSING_ACTIVATION_REF','Activation\x20step\x20requires\x20an\x20activation\x20reference',_0x34ab4f,_0x584e77)),_0x50ae57;const _0x2ad385=_0x1d6df6[_0x1829b8(0xff)][_0x1829b8(0x106)];return _0x34ab4f[_0x1829b8(0x100)]&&!_0x2ad385['startsWith'](_0x1829b8(0x104))&&(!_0x34ab4f['activationKeys']['has'](_0x2ad385)&&_0x50ae57['push'](createIssue(_0x1829b8(0xf2),_0x584e77+_0x1829b8(0x120),_0x1829b8(0x107),_0x1829b8(0x12d)+_0x2ad385+'\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.',_0x34ab4f))),_0x50ae57;}function validateDecisionPointStep(_0xa79897,_0x56e809,_0x63bf62,_0x5d9d56){const _0x5e1f40=a149_0x4ad7,_0x2faa38=[];if(!_0xa79897['with']?.['branches']||_0xa79897['with'][_0x5e1f40(0xda)]['length']===0x0)return _0x2faa38['push'](createIssue('error',_0x56e809+_0x5e1f40(0x13e),'MISSING_CONDITIONS',_0x5e1f40(0xeb),_0x63bf62,_0x56e809)),_0x2faa38;for(let _0x2a4ef6=0x0;_0x2a4ef6<_0xa79897[_0x5e1f40(0xff)][_0x5e1f40(0xda)][_0x5e1f40(0xd6)];_0x2a4ef6++){const _0x394cc2=_0xa79897[_0x5e1f40(0xff)][_0x5e1f40(0xda)][_0x2a4ef6],_0x53beb7=_0x56e809+_0x5e1f40(0xe6)+_0x2a4ef6+']';_0x394cc2['segment']&&!_0x394cc2[_0x5e1f40(0x139)]&&(_0x63bf62[_0x5e1f40(0x173)]?.['add'](_0x394cc2[_0x5e1f40(0x142)]),!_0x394cc2[_0x5e1f40(0x142)]['startsWith'](_0x5e1f40(0x104))&&(_0x63bf62[_0x5e1f40(0xd5)]&&!_0x63bf62[_0x5e1f40(0xd5)]['has'](_0x394cc2['segment'])&&_0x2faa38[_0x5e1f40(0x152)](createIssue(_0x5e1f40(0xf2),_0x53beb7+_0x5e1f40(0x113),_0x5e1f40(0x169),_0x5e1f40(0x138)+_0x394cc2[_0x5e1f40(0x142)]+'\x27',_0x63bf62))));_0x394cc2[_0x5e1f40(0x15d)]&&_0x63bf62[_0x5e1f40(0x170)]&&!_0x63bf62['stepNames'][_0x5e1f40(0x105)](_0x394cc2[_0x5e1f40(0x15d)])&&_0x2faa38[_0x5e1f40(0x152)](createIssue(_0x5e1f40(0xf2),_0x53beb7+_0x5e1f40(0xe4),_0x5e1f40(0x165),_0x5e1f40(0xf8)+_0x394cc2[_0x5e1f40(0x15d)]+'\x27',_0x63bf62));if(_0x394cc2[_0x5e1f40(0x15d)]){const _0x2d33ab=_0x5d9d56[_0x5e1f40(0x10f)](_0x394cc2['next']);_0x2d33ab?.['type']===_0x5e1f40(0x14b)&&_0x2faa38[_0x5e1f40(0x152)](createIssue(_0x5e1f40(0xf3),_0x53beb7+_0x5e1f40(0xe4),'BRANCH_DIRECTLY_TO_MERGE','Decision\x20branch\x20\x27'+_0x394cc2[_0x5e1f40(0x17a)]+_0x5e1f40(0x126)+_0x394cc2['next']+'\x27\x20with\x20no\x20action\x20in\x20between',_0x63bf62));}}return _0x2faa38;}function validateAbTestStep(_0x27099c,_0x57df7d,_0x54c2eb,_0x4b2ea1){const _0x4de4f7=a149_0x4ad7,_0x3ec8ea=[];if(!_0x27099c[_0x4de4f7(0xff)]?.[_0x4de4f7(0x15c)]||_0x27099c[_0x4de4f7(0xff)][_0x4de4f7(0x15c)]['length']===0x0)return _0x3ec8ea['push'](createIssue('error',_0x57df7d+_0x4de4f7(0xe9),_0x4de4f7(0x118),_0x4de4f7(0x163),_0x54c2eb,_0x57df7d)),_0x3ec8ea;const _0x387e74=_0x27099c[_0x4de4f7(0xff)][_0x4de4f7(0x15c)][_0x4de4f7(0x150)]((_0x345f30,_0x42dfea)=>_0x345f30+(_0x42dfea[_0x4de4f7(0x176)]||0x0),0x0);Math[_0x4de4f7(0x144)](_0x387e74-0x64)>0.01&&_0x3ec8ea[_0x4de4f7(0x152)](createIssue(_0x4de4f7(0xf2),_0x57df7d+_0x4de4f7(0xe9),_0x4de4f7(0xd7),_0x4de4f7(0x12c)+_0x387e74+'%)',_0x54c2eb));for(let _0x4b6d33=0x0;_0x4b6d33<_0x27099c[_0x4de4f7(0xff)][_0x4de4f7(0x15c)][_0x4de4f7(0xd6)];_0x4b6d33++){const _0x576db4=_0x27099c['with'][_0x4de4f7(0x15c)][_0x4b6d33],_0x36f9b0=_0x57df7d+'.with.variants['+_0x4b6d33+']';_0x576db4['next']&&_0x54c2eb[_0x4de4f7(0x170)]&&!_0x54c2eb['stepNames']['has'](_0x576db4[_0x4de4f7(0x15d)])&&_0x3ec8ea['push'](createIssue(_0x4de4f7(0xf2),_0x36f9b0+_0x4de4f7(0xe4),_0x4de4f7(0x165),_0x4de4f7(0x11c)+_0x576db4['next']+'\x27',_0x54c2eb));if(_0x576db4[_0x4de4f7(0x15d)]){const _0x5c4a05=_0x4b2ea1[_0x4de4f7(0x10f)](_0x576db4['next']);_0x5c4a05?.[_0x4de4f7(0x130)]===_0x4de4f7(0x14b)&&_0x3ec8ea[_0x4de4f7(0x152)](createIssue('warning',_0x36f9b0+'.next',_0x4de4f7(0x14f),_0x4de4f7(0xfa)+_0x576db4['name']+'\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x576db4[_0x4de4f7(0x15d)]+_0x4de4f7(0x179),_0x54c2eb));}}return _0x3ec8ea;}function a149_0x4ad7(_0x6f968,_0x578306){_0x6f968=_0x6f968-0xd4;const _0x1bc7a0=a149_0x1bc7();let _0x4ad781=_0x1bc7a0[_0x6f968];return _0x4ad781;}function validateJumpStep(_0x46477c,_0x20a9f6,_0x26be4b){const _0x44928b=a149_0x4ad7,_0x532a42=[];if(!_0x46477c[_0x44928b(0xff)]?.[_0x44928b(0x162)])return _0x532a42[_0x44928b(0x152)](createIssue(_0x44928b(0xf2),_0x20a9f6+'.with.target','INVALID_JUMP_TARGET','Jump\x20step\x20requires\x20a\x20target',_0x26be4b,_0x20a9f6)),_0x532a42;return(!_0x46477c[_0x44928b(0xff)]['target'][_0x44928b(0xe8)]||!_0x46477c[_0x44928b(0xff)]['target']['stage'])&&_0x532a42['push'](createIssue('error',_0x20a9f6+'.with.target','INVALID_JUMP_TARGET',_0x44928b(0xe0),_0x26be4b)),_0x532a42;}function buildConvergenceMap(_0x1bb051){const _0x1d0c79=a149_0x4ad7,_0xd8d982=new Map();function _0xc380bb(_0x1da804,_0x2737b4){const _0x283452=a149_0x4ad7,_0xbbb67=_0xd8d982['get'](_0x1da804)||[];_0xbbb67['push'](_0x2737b4),_0xd8d982[_0x283452(0x13d)](_0x1da804,_0xbbb67);}for(const _0x1a0be2 of _0x1bb051){_0x1a0be2[_0x1d0c79(0x15d)]&&_0xc380bb(_0x1a0be2[_0x1d0c79(0x15d)],{'stepName':_0x1a0be2[_0x1d0c79(0x17a)],'description':_0x1d0c79(0xe5)+_0x1a0be2[_0x1d0c79(0x17a)]+'\x27'});if(_0x1a0be2[_0x1d0c79(0x130)]==='decision_point'&&_0x1a0be2[_0x1d0c79(0xff)]?.['branches'])for(const _0x4a42fa of _0x1a0be2[_0x1d0c79(0xff)][_0x1d0c79(0xda)]){_0x4a42fa['next']&&_0xc380bb(_0x4a42fa[_0x1d0c79(0x15d)],{'stepName':_0x1a0be2[_0x1d0c79(0x17a)],'description':_0x1d0c79(0x177)+_0x4a42fa[_0x1d0c79(0x17a)]+_0x1d0c79(0x127)+_0x1a0be2[_0x1d0c79(0x17a)]+'\x27'});}if(_0x1a0be2['type']===_0x1d0c79(0xf5)&&_0x1a0be2[_0x1d0c79(0xff)]?.[_0x1d0c79(0x15c)])for(const _0x3a20fd of _0x1a0be2[_0x1d0c79(0xff)]['variants']){_0x3a20fd[_0x1d0c79(0x15d)]&&_0xc380bb(_0x3a20fd[_0x1d0c79(0x15d)],{'stepName':_0x1a0be2[_0x1d0c79(0x17a)],'description':_0x1d0c79(0x11f)+_0x3a20fd['name']+_0x1d0c79(0x127)+_0x1a0be2[_0x1d0c79(0x17a)]+'\x27'});}_0x1a0be2[_0x1d0c79(0x130)]==='wait'&&_0x1a0be2[_0x1d0c79(0xff)]?.['condition']&&(_0x1a0be2[_0x1d0c79(0xff)][_0x1d0c79(0x18a)][_0x1d0c79(0x15d)]&&_0xc380bb(_0x1a0be2[_0x1d0c79(0xff)][_0x1d0c79(0x18a)][_0x1d0c79(0x15d)],{'stepName':_0x1a0be2[_0x1d0c79(0x17a)],'description':'condition\x20of\x20\x27'+_0x1a0be2[_0x1d0c79(0x17a)]+'\x27'}),_0x1a0be2[_0x1d0c79(0xff)][_0x1d0c79(0x18a)][_0x1d0c79(0x17e)]?.['next']&&_0xc380bb(_0x1a0be2[_0x1d0c79(0xff)][_0x1d0c79(0x18a)]['timeout'][_0x1d0c79(0x15d)],{'stepName':_0x1a0be2['name'],'description':_0x1d0c79(0x16d)+_0x1a0be2[_0x1d0c79(0x17a)]+'\x27'}));}return _0xd8d982;}function validateFlowControl(_0x3168e3,_0x4f2004,_0x20ad12){const _0x508b9d=a149_0x4ad7,_0x196eda=[],_0x1ed826=_0x508b9d(0x11e)+_0x4f2004+']',_0x4f9aba=_0x3168e3[_0x508b9d(0x16b)]||[];if(_0x4f9aba['length']===0x0)return _0x196eda;const _0x5257de=new Map();for(const _0x357ce9 of _0x4f9aba){_0x357ce9['name']&&_0x5257de['set'](_0x357ce9[_0x508b9d(0x17a)],_0x357ce9);}const _0x2ddd79=buildConvergenceMap(_0x4f9aba),_0x586ab9=_0x4f9aba[_0x508b9d(0x182)](_0x264959=>_0x264959[_0x508b9d(0x130)]===_0x508b9d(0x151));!_0x586ab9&&_0x196eda[_0x508b9d(0x152)](createIssue('error',_0x1ed826+_0x508b9d(0xea),'MISSING_END_STEP',_0x508b9d(0x143)+_0x3168e3[_0x508b9d(0x17a)]+_0x508b9d(0x14e),_0x20ad12));for(const [_0x574664,_0x481773]of _0x2ddd79){const _0x282830=_0x5257de['get'](_0x574664);if(!_0x282830)continue;if(_0x481773['length']>0x1&&_0x282830[_0x508b9d(0x130)]!==_0x508b9d(0x14b)){const _0x47460a=_0x481773[_0x508b9d(0x17b)](_0x17791e=>_0x17791e[_0x508b9d(0xfe)])[_0x508b9d(0x10d)](',\x20');_0x196eda['push'](createIssue(_0x508b9d(0xf2),_0x1ed826+_0x508b9d(0xea),_0x508b9d(0x12a),_0x508b9d(0x13b)+_0x574664+_0x508b9d(0x149)+_0x47460a+_0x508b9d(0xee),_0x20ad12));}_0x481773[_0x508b9d(0xd6)]===0x1&&_0x282830['type']===_0x508b9d(0x14b)&&_0x196eda['push'](createIssue(_0x508b9d(0xf3),_0x1ed826+_0x508b9d(0xea),_0x508b9d(0x117),_0x508b9d(0xdc)+_0x574664+_0x508b9d(0x11a)+_0x481773[0x0][_0x508b9d(0xfe)]+_0x508b9d(0x14c),_0x20ad12));}for(const _0x443709 of _0x4f9aba){if(_0x443709[_0x508b9d(0x130)]===_0x508b9d(0x14b)&&_0x443709[_0x508b9d(0x15d)]){const _0x5bda69=_0x5257de[_0x508b9d(0x10f)](_0x443709[_0x508b9d(0x15d)]);_0x5bda69?.[_0x508b9d(0x130)]===_0x508b9d(0x14b)&&_0x196eda[_0x508b9d(0x152)](createIssue(_0x508b9d(0xf2),_0x1ed826+_0x508b9d(0xea),'MERGE_TO_MERGE_CHAIN',_0x508b9d(0xdc)+_0x443709['name']+_0x508b9d(0x12e)+_0x443709['next']+'\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.',_0x20ad12));}}return _0x196eda;}function validateCriteria(_0x4c9d1f,_0x1d4dfb,_0x338a60){const _0x5e95eb=a149_0x4ad7,_0x2f0475=[];return _0x4c9d1f['segment']&&(_0x338a60['referencedSegments']?.[_0x5e95eb(0x14d)](_0x4c9d1f[_0x5e95eb(0x142)]),!_0x4c9d1f[_0x5e95eb(0x142)][_0x5e95eb(0xf6)](_0x5e95eb(0x104))&&(_0x338a60[_0x5e95eb(0xd5)]&&!_0x338a60['embeddedSegments'][_0x5e95eb(0x105)](_0x4c9d1f[_0x5e95eb(0x142)])&&_0x2f0475[_0x5e95eb(0x152)](createIssue(_0x5e95eb(0xf2),_0x1d4dfb+_0x5e95eb(0x113),_0x5e95eb(0x169),_0x5e95eb(0x154)+_0x4c9d1f[_0x5e95eb(0x142)]+'\x27',_0x338a60)))),_0x2f0475;}function validateEmbeddedSegment(_0x59380c,_0x4f9d11,_0x17af16){const _0x660a10=a149_0x4ad7,_0x12a3ff=[];return _0x59380c[_0x660a10(0x111)]&&_0x12a3ff['push'](...validateRuleDef(_0x59380c[_0x660a10(0x111)],_0x4f9d11+'.rule',_0x17af16)),_0x12a3ff;}function validateStage(_0x4e467a,_0x6e2e8a,_0x524c99,_0x174909){const _0x139619=a149_0x4ad7,_0x236a72=[],_0xaac7ad=_0x139619(0x11e)+_0x6e2e8a+']',_0x1f2a67=new Map(),_0x1db093=new Map();if(_0x4e467a[_0x139619(0x16b)]){for(let _0x5df55b=0x0;_0x5df55b<_0x4e467a[_0x139619(0x16b)][_0x139619(0xd6)];_0x5df55b++){const _0x8caabe=_0x4e467a[_0x139619(0x16b)][_0x5df55b];_0x8caabe[_0x139619(0x17a)]&&_0x1f2a67[_0x139619(0x13d)](_0x8caabe[_0x139619(0x17a)],_0x8caabe);}for(let _0x5cfdf2=0x0;_0x5cfdf2<_0x4e467a['steps'][_0x139619(0xd6)];_0x5cfdf2++){const _0x333621=_0x4e467a[_0x139619(0x16b)][_0x5cfdf2],_0x105bf2=_0xaac7ad+'.steps['+_0x5cfdf2+']';if(_0x333621[_0x139619(0x17a)]){if(_0x1db093[_0x139619(0x105)](_0x333621[_0x139619(0x17a)])){const _0x522976=_0x1db093['get'](_0x333621['name']);_0x236a72[_0x139619(0x152)](createIssue('error',_0x105bf2+_0x139619(0xed),_0x139619(0x132),_0x139619(0x115)+_0x333621['name']+_0x139619(0xd8)+_0x522976+'])',_0x174909));}else _0x1db093['set'](_0x333621['name'],_0x5cfdf2);}_0x236a72['push'](...validateStep(_0x333621,_0x105bf2,_0x174909,_0x1f2a67));}}_0x4e467a[_0x139619(0xdf)]&&_0x236a72['push'](...validateCriteria(_0x4e467a[_0x139619(0xdf)],_0xaac7ad+_0x139619(0x17d),_0x174909));if(_0x4e467a[_0x139619(0xd4)])for(let _0x2645cb=0x0;_0x2645cb<_0x4e467a[_0x139619(0xd4)]['length'];_0x2645cb++){_0x236a72[_0x139619(0x152)](...validateCriteria(_0x4e467a[_0x139619(0xd4)][_0x2645cb],_0xaac7ad+'.exit_criteria['+_0x2645cb+']',_0x174909));}return _0x4e467a[_0x139619(0x166)]&&_0x236a72[_0x139619(0x152)](...validateCriteria(_0x4e467a[_0x139619(0x166)],_0xaac7ad+_0x139619(0x114),_0x174909)),_0x236a72[_0x139619(0x152)](...validateStageStructure(_0x4e467a,_0x6e2e8a,_0x524c99,_0x174909)),_0x236a72[_0x139619(0x152)](...validateFlowControl(_0x4e467a,_0x6e2e8a,_0x174909)),_0x236a72;}function validateStagesForVersion(_0x5c78ec,_0x51b80d,_0x1840f3,_0x1b250a,_0x79b83f,_0x1906db,_0x27bfcc){const _0x3c59a1=a149_0x4ad7;if(_0x5c78ec['length']===0x0){_0x79b83f['push']({'level':_0x3c59a1(0xf2),'path':_0x1b250a+_0x3c59a1(0x102),'code':'MISSING_STAGES','message':_0x3c59a1(0x11d),'location':getLocationFromPath(_0x1840f3[_0x3c59a1(0xf4)],_0x1840f3['source'],['stages'])});return;}const _0x35c609=new Set();for(const _0x2ee7ad of _0x5c78ec){if(_0x2ee7ad[_0x3c59a1(0x16b)])for(const _0x2738ee of _0x2ee7ad[_0x3c59a1(0x16b)]){_0x2738ee['name']&&_0x35c609[_0x3c59a1(0x14d)](_0x2738ee['name']);}}const _0x2a32eb={..._0x1840f3,'stepNames':_0x35c609},_0x52d2ac=validateVersionStructure(_0x5c78ec,_0x2a32eb);for(const _0x1c51ad of _0x52d2ac){const _0x9238a0=_0x1b250a?{..._0x1c51ad,'path':''+_0x1b250a+_0x1c51ad[_0x3c59a1(0x10a)]}:_0x1c51ad;if(_0x9238a0[_0x3c59a1(0x146)]===_0x3c59a1(0xf2))_0x79b83f[_0x3c59a1(0x152)](_0x9238a0);else _0x1906db['push'](_0x9238a0);}for(let _0x4355fc=0x0;_0x4355fc<_0x5c78ec['length'];_0x4355fc++){const _0x194194=validateStage(_0x5c78ec[_0x4355fc],_0x4355fc,_0x5c78ec[_0x3c59a1(0xd6)],_0x2a32eb);for(const _0x1caa43 of _0x194194){const _0xb42a0c=_0x1b250a?{..._0x1caa43,'path':''+_0x1b250a+_0x1caa43[_0x3c59a1(0x10a)]}:_0x1caa43;if(_0xb42a0c[_0x3c59a1(0x146)]===_0x3c59a1(0xf2))_0x79b83f[_0x3c59a1(0x152)](_0xb42a0c);else _0x1906db[_0x3c59a1(0x152)](_0xb42a0c);}}if(_0x51b80d[_0x3c59a1(0x160)]){const _0x1b489d=_0x27bfcc?.[_0x3c59a1(0x17c)]?'goal':_0x1b250a+_0x3c59a1(0x160),_0x192bf5=validateCriteria(_0x51b80d[_0x3c59a1(0x160)],_0x1b489d,_0x2a32eb);for(const _0x372aa8 of _0x192bf5){if(_0x372aa8[_0x3c59a1(0x146)]===_0x3c59a1(0xf2))_0x79b83f[_0x3c59a1(0x152)](_0x372aa8);else _0x1906db[_0x3c59a1(0x152)](_0x372aa8);}}}function extractVersionIndex(_0x1fbac5){const _0x1b38f5=a149_0x4ad7,_0x4fd5dd=_0x1fbac5[_0x1b38f5(0x15b)](/^journeys\[(\d+)\]\./);return _0x4fd5dd?_0x4fd5dd[0x1]:undefined;}function a149_0x1bc7(){const _0x35df44=['excluded','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','set','.with.branches','MISSING_ENTRY_CRITERIA','decision_point','Step\x20references\x20non-existent\x20step\x20\x27','segment','Stage\x20\x27','abs','wait','level','version','.type','\x27\x20(from:\x20','size','merge',').\x20Merge\x20is\x20unnecessary.','add','\x27\x20has\x20no\x20end\x20step','BRANCH_DIRECTLY_TO_MERGE','reduce','end','push','filter','Criteria\x20references\x20undefined\x20segment\x20\x27','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','MISSING_EXIT_CRITERIA','\x27\x20has\x20no\x20steps','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','indices','source','match','variants','next','MISSING_STAGES','MISSING_NAME','goal','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','target','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','\x20steps\x20(may\x20be\x20too\x20simple)','INVALID_NEXT_REFERENCE','milestone','endsWith','message','MISSING_SEGMENT_REFERENCE','symbol','steps','Journey\x20name\x20is\x20required','timeout\x20of\x20\x27','issues','latest','stepNames','JOURNEY_SCHEMA_ERROR','448MDLiJX','referencedSegments','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','2949245VNiksk','percentage','branch\x20\x27','safeParse','\x27\x20with\x20no\x20action\x20in\x20between','name','map','goalIsInherited','.entry_criteria','timeout','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','.with.condition.timeout.next','2992818toYHbb','some','.exit_criteria','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','FEW_STEPS','End\x20step\x20\x27','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','journeys','skipSchema','condition','exit_criteria','embeddedSegments','length','INVALID_AB_TEST_PERCENTAGES','\x27\x20(first\x20defined\x20at\x20steps[','\x27\x20has\x20only\x20','branches','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','Merge\x20step\x20\x27','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','MISSING_GOAL','entry_criteria','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','versions[','data','ACTIVATION_SCHEMA_ERROR','.next','step\x20\x27','.with.branches[','includes','journey','.with.variants','.steps','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','launched','.name',').\x20Use\x20a\x20merge\x20step.','activations','Journey\x20has\x20','segments.','error','warning','document','ab_test','startsWith','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','MISSING_WAIT_PARAMS','A/B\x20test\x20variant\x20\x27','2059334rAIvyR','MISSING_MILESTONE','\x20with\x20latest:\x20true','description','with','activationKeys','\x20(across\x20','stages','journeys[','ref:','has','activation','MISSING_ACTIVATION_DEFINITION','keys','\x20stages\x20but\x20maximum\x20is\x20','path','.with','.with.condition.next','join','UNUSED_EMBEDDED_SEGMENT','get','.with.condition','rule','Embedded\x20segment\x20\x27','.segment','.milestone','Duplicate\x20step\x20name\x20\x27','538132GDUrWr','SINGLE_INPUT_MERGE','MISSING_CONDITIONS','entries','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','TOO_MANY_STAGES','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','stages[','variant\x20\x27','.with.activation','sort','journey\x20entry','replace','979586eJNSls','.with.condition.timeout','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','\x27\x20of\x20\x27','journeys,\x20stages,\x20or\x20versions','179536QnEZET','CONVERGENCE_WITHOUT_MERGE','Journey\x20has\x20no\x20goal\x20defined','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','type','segments','DUPLICATE_STEP_NAME','versions','INSUFFICIENT_STEPS','\x20versions)','.with.condition.segment','1830816QmvANm','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27'];a149_0x1bc7=function(){return _0x35df44;};return a149_0x1bc7();}function deduplicateAcrossVersions(_0x4ec366){const _0x2aad5d=a149_0x4ad7,_0x4c9fc2=new Map();for(let _0x20be3f=0x0;_0x20be3f<_0x4ec366[_0x2aad5d(0xd6)];_0x20be3f++){const _0x5e3564=_0x4ec366[_0x20be3f]['code']+':'+_0x4ec366[_0x20be3f][_0x2aad5d(0x168)],_0x58ce17=extractVersionIndex(_0x4ec366[_0x20be3f][_0x2aad5d(0x10a)]),_0x1c7c64=_0x4c9fc2[_0x2aad5d(0x10f)](_0x5e3564);if(_0x1c7c64){_0x1c7c64[_0x2aad5d(0x159)][_0x2aad5d(0x152)](_0x20be3f);if(_0x58ce17)_0x1c7c64[_0x2aad5d(0x133)]['add'](_0x58ce17);}else _0x4c9fc2[_0x2aad5d(0x13d)](_0x5e3564,{'indices':[_0x20be3f],'versions':new Set(_0x58ce17?[_0x58ce17]:[])});}const _0x3b8056=new Set();for(const {indices:_0x3640f3,versions:_0x593420}of _0x4c9fc2['values']()){if(_0x593420[_0x2aad5d(0x14a)]<=0x1)continue;const _0x3304f7=_0x4ec366[_0x3640f3[0x0]];_0x3304f7['path']=_0x3304f7[_0x2aad5d(0x10a)][_0x2aad5d(0x123)](/^journeys\[\d+\]\./,''),_0x3304f7['message']=_0x3304f7[_0x2aad5d(0x168)]+_0x2aad5d(0x101)+_0x593420[_0x2aad5d(0x14a)]+_0x2aad5d(0x135);for(let _0x29d585=0x1;_0x29d585<_0x3640f3[_0x2aad5d(0xd6)];_0x29d585++){_0x3b8056[_0x2aad5d(0x14d)](_0x3640f3[_0x29d585]);}}const _0x1cb448=[..._0x3b8056][_0x2aad5d(0x121)]((_0x59aa52,_0x23a14d)=>_0x23a14d-_0x59aa52);for(const _0x274aa4 of _0x1cb448){_0x4ec366['splice'](_0x274aa4,0x1);}}export function validateJourneyDef(_0x2c8cf5,_0x4960b8={},_0x557e75={}){const _0x292b86=a149_0x4ad7;if(_0x557e75[_0x292b86(0x189)])return runJourneySemanticChecks(_0x2c8cf5,_0x4960b8);const _0x84993c=JourneyDefSchema[_0x292b86(0x178)](_0x2c8cf5);if(_0x84993c['success'])return runJourneySemanticChecks(_0x84993c[_0x292b86(0xe2)],_0x4960b8);return zodErrorsToJourneyValidationResult(_0x84993c[_0x292b86(0xf2)],_0x4960b8);}function zodErrorsToJourneyValidationResult(_0x2a22f1,_0x208658){const _0x31698d=a149_0x4ad7,_0x3cebd9=flattenZodIssues(_0x2a22f1[_0x31698d(0x16e)]),_0x4c7070=_0x3cebd9[_0x31698d(0x17b)](_0x1a19c7=>{const _0x6b2c14=_0x31698d,_0x54c45f=formatZodPath(_0x1a19c7[_0x6b2c14(0x10a)]),_0x4e2a3b=mapJourneyZodIssueToCode(_0x1a19c7,_0x54c45f),_0x5a30c3=getLocationFromPath(_0x208658[_0x6b2c14(0xf4)],_0x208658['source'],_0x1a19c7['path'][_0x6b2c14(0x17b)](_0x414655=>typeof _0x414655===_0x6b2c14(0x16a)?String(_0x414655):_0x414655));return{'level':_0x6b2c14(0xf2),'path':_0x54c45f,'code':_0x4e2a3b,'message':_0x1a19c7['message'],..._0x5a30c3&&{'location':_0x5a30c3}};});return{'valid':![],'errors':_0x4c7070,'warnings':[]};}function mapJourneyZodIssueToCode(_0x1d8271,_0x323692){const _0x5727f1=a149_0x4ad7;if(_0x323692===_0x5727f1(0x17a))return'MISSING_NAME';if(_0x323692[_0x5727f1(0x167)](_0x5727f1(0x148))&&_0x323692['includes'](_0x5727f1(0x16b)))return'JOURNEY_SCHEMA_ERROR';if(_0x323692===_0x5727f1(0x102)||_0x323692['endsWith']('.stages'))return _0x5727f1(0x15e);if(_0x323692===''&&_0x1d8271[_0x5727f1(0x168)][_0x5727f1(0xe7)](_0x5727f1(0x128)))return _0x5727f1(0x15e);if(_0x323692['includes'](_0x5727f1(0x106)))return _0x5727f1(0xe3);return _0x5727f1(0x171);}function runJourneySemanticChecks(_0x3b60d2,_0x337573){const _0x34ec41=a149_0x4ad7,_0xfd880f=[],_0x59364d=[];(!_0x3b60d2[_0x34ec41(0x17a)]||_0x3b60d2[_0x34ec41(0x17a)]['trim']()==='')&&_0xfd880f[_0x34ec41(0x152)]({'level':_0x34ec41(0xf2),'path':'name','code':_0x34ec41(0x15f),'message':_0x34ec41(0x16c),'location':getLocationFromPath(_0x337573[_0x34ec41(0xf4)],_0x337573['source'],[_0x34ec41(0x17a)])});const _0x1df933=new Set();if(_0x3b60d2[_0x34ec41(0x131)])for(const _0x2448ae of Object[_0x34ec41(0x108)](_0x3b60d2['segments'])){_0x1df933['add'](_0x2448ae);}const _0x50675b=new Set();if(_0x3b60d2[_0x34ec41(0xef)])for(const _0x874c8a of Object[_0x34ec41(0x108)](_0x3b60d2[_0x34ec41(0xef)])){_0x50675b[_0x34ec41(0x14d)](_0x874c8a);}const _0x215ed7=new Set(),_0x4f4cef={..._0x337573,'embeddedSegments':_0x1df933,'referencedSegments':_0x215ed7,'activationKeys':_0x50675b[_0x34ec41(0x14a)]>0x0?_0x50675b:undefined};if(_0x3b60d2[_0x34ec41(0x131)])for(const [_0x15fcaa,_0x4cd444]of Object[_0x34ec41(0x119)](_0x3b60d2['segments'])){const _0x505261=validateEmbeddedSegment(_0x4cd444,_0x34ec41(0xf1)+_0x15fcaa,_0x4f4cef);for(const _0x146b5b of _0x505261){if(_0x146b5b[_0x34ec41(0x146)]===_0x34ec41(0xf2))_0xfd880f['push'](_0x146b5b);else _0x59364d[_0x34ec41(0x152)](_0x146b5b);}}const _0x4855b9=!!_0x3b60d2['goal'],_0x2d5521=_0x3b60d2[_0x34ec41(0x188)]?.['every'](_0x3261a2=>!!_0x3261a2['goal'])??![];!_0x4855b9&&!_0x2d5521&&_0x59364d[_0x34ec41(0x152)]({'level':'warning','path':'goal','code':_0x34ec41(0xde),'message':_0x34ec41(0x12b),'location':getLocationFromPath(_0x337573[_0x34ec41(0xf4)],_0x337573[_0x34ec41(0x15a)],[_0x34ec41(0x160)])});const _0x5d3dd6=_0x3b60d2['journeys']??_0x3b60d2[_0x34ec41(0x133)];if(_0x5d3dd6&&_0x5d3dd6[_0x34ec41(0x153)](_0xba7d34=>_0xba7d34[_0x34ec41(0x16f)]===!![])['length']>0x1){const _0x28daf4=_0x3b60d2[_0x34ec41(0x188)]?_0x34ec41(0x188):_0x34ec41(0x133);_0xfd880f[_0x34ec41(0x152)]({'level':_0x34ec41(0xf2),'path':_0x28daf4,'code':'DUPLICATE_LATEST','message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x28daf4===_0x34ec41(0x188)?_0x34ec41(0x122):_0x34ec41(0x147))+_0x34ec41(0xfd),'location':getLocationFromPath(_0x337573['document'],_0x337573[_0x34ec41(0x15a)],[_0x28daf4])});}if(_0x3b60d2['journeys']&&_0x3b60d2[_0x34ec41(0x188)][_0x34ec41(0xd6)]>0x0)for(let _0x569fca=0x0;_0x569fca<_0x3b60d2[_0x34ec41(0x188)][_0x34ec41(0xd6)];_0x569fca++){const _0x57cd27=_0x3b60d2[_0x34ec41(0x188)][_0x569fca];if(_0x3b60d2[_0x34ec41(0x188)][_0x34ec41(0xd6)]>0x1&&_0x57cd27['state']===_0x34ec41(0xec))continue;const _0x2feaad=_0x57cd27[_0x34ec41(0x102)]||[],_0x379d73=_0x34ec41(0x103)+_0x569fca+'].',_0x18a358=!!_0x57cd27[_0x34ec41(0x160)],_0x9d76c8=_0x18a358?{..._0x3b60d2,'goal':_0x57cd27[_0x34ec41(0x160)]}:_0x3b60d2;validateStagesForVersion(_0x2feaad,_0x9d76c8,_0x4f4cef,_0x379d73,_0xfd880f,_0x59364d,{'goalIsInherited':!_0x18a358});}else{if(_0x3b60d2[_0x34ec41(0x133)]&&_0x3b60d2[_0x34ec41(0x133)][_0x34ec41(0xd6)]>0x0)for(let _0x29ca26=0x0;_0x29ca26<_0x3b60d2[_0x34ec41(0x133)][_0x34ec41(0xd6)];_0x29ca26++){const _0x1a9a4a=_0x3b60d2[_0x34ec41(0x133)][_0x29ca26];if(_0x3b60d2[_0x34ec41(0x133)]['length']>0x1&&_0x1a9a4a['state']==='launched')continue;const _0x5df079=_0x1a9a4a[_0x34ec41(0x102)]||[],_0x2759b2=_0x34ec41(0xe1)+_0x29ca26+'].';validateStagesForVersion(_0x5df079,_0x3b60d2,_0x4f4cef,_0x2759b2,_0xfd880f,_0x59364d);}else{const _0xe41143=_0x3b60d2[_0x34ec41(0x102)]||[];validateStagesForVersion(_0xe41143,_0x3b60d2,_0x4f4cef,'',_0xfd880f,_0x59364d);}}_0x3b60d2['journeys']&&_0x3b60d2[_0x34ec41(0x188)]['length']>0x1&&(deduplicateAcrossVersions(_0xfd880f),deduplicateAcrossVersions(_0x59364d));for(const _0x43f473 of _0x1df933){!_0x215ed7[_0x34ec41(0x105)](_0x43f473)&&!_0x43f473[_0x34ec41(0xf6)]('excluded_')&&_0x59364d['push']({'level':_0x34ec41(0xf3),'path':_0x34ec41(0xf1)+_0x43f473,'code':_0x34ec41(0x10e),'message':_0x34ec41(0x112)+_0x43f473+'\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','location':getLocationFromPath(_0x337573['document'],_0x337573[_0x34ec41(0x15a)],[_0x34ec41(0x131),_0x43f473])});}return{'valid':_0xfd880f[_0x34ec41(0xd6)]===0x0,'errors':_0xfd880f,'warnings':_0x59364d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4510d7,_0x54e3a1){const _0x571202=a147_0x1f71,_0x25d51b=_0x4510d7();while(!![]){try{const _0x4e8ad9=-parseInt(_0x571202(0x169))/0x1*(parseInt(_0x571202(0x163))/0x2)+parseInt(_0x571202(0x1a4))/0x3+-parseInt(_0x571202(0x145))/0x4*(-parseInt(_0x571202(0x198))/0x5)+parseInt(_0x571202(0x18e))/0x6+-parseInt(_0x571202(0x193))/0x7+parseInt(_0x571202(0x1bf))/0x8*(parseInt(_0x571202(0x170))/0x9)+parseInt(_0x571202(0x165))/0xa;if(_0x4e8ad9===_0x54e3a1)break;else _0x25d51b['push'](_0x25d51b['shift']());}catch(_0x5b983f){_0x25d51b['push'](_0x25d51b['shift']());}}}(a147_0x1659,0xb7881));import*as a147_0x2fb881 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x3519eb){const _0x54092c=a147_0x1f71,_0x31d445=_0x3519eb['toLowerCase']();if(_0x31d445===_0x54092c(0x1a8)||_0x31d445===_0x54092c(0x1bd))return'day';if(_0x31d445==='weeks'||_0x31d445===_0x54092c(0x10c))return _0x54092c(0x10c);return _0x3519eb;}export function journeyResponseToDefSync(_0x3ab006){const _0xb2a71d=a147_0x1f71,_0x398cb2=_0x3ab006[_0xb2a71d(0x176)],_0x31d672=_0x398cb2[_0xb2a71d(0x15c)]||_0x398cb2[_0xb2a71d(0x124)],_0x177c78={'stages':_0x398cb2[_0xb2a71d(0x14b)][_0xb2a71d(0x125)](convertApiStageToYaml),'id':_0x3ab006['id']};_0x398cb2[_0xb2a71d(0x13f)]&&(_0x177c78[_0xb2a71d(0x13f)]=convertApiCriteriaToYaml(_0x398cb2[_0xb2a71d(0x13f)]));_0x398cb2['name']&&_0x398cb2['name']!==_0x31d672&&(_0x177c78[_0xb2a71d(0x17b)]=_0x398cb2[_0xb2a71d(0x124)]);_0x398cb2['versionNumber']!==undefined&&(_0x177c78[_0xb2a71d(0x183)]=_0x398cb2[_0xb2a71d(0x1b9)]);_0x398cb2['state']&&(_0x177c78[_0xb2a71d(0x13c)]=_0x398cb2['state']===_0xb2a71d(0x141)?_0xb2a71d(0x141):_0xb2a71d(0x144));const _0x5a6338={'type':_0xb2a71d(0x16d),'name':_0x31d672,'journeys':[_0x177c78]};_0x398cb2[_0xb2a71d(0x13e)]&&(_0x5a6338[_0xb2a71d(0x13e)]=_0x398cb2['description']);_0x398cb2['goal']&&(_0x5a6338[_0xb2a71d(0x13f)]=convertApiCriteriaToYaml(_0x398cb2[_0xb2a71d(0x13f)]));if(_0x398cb2[_0xb2a71d(0x143)])_0x5a6338[_0xb2a71d(0x149)]=_0x398cb2[_0xb2a71d(0x143)];else _0x398cb2[_0xb2a71d(0x153)]!==undefined&&(_0x5a6338[_0xb2a71d(0x149)]=_0x398cb2[_0xb2a71d(0x153)]?_0xb2a71d(0x1be):'no_reentry');return _0x398cb2['journeyBundleId']&&(_0x5a6338[_0xb2a71d(0x1bc)]=_0x398cb2[_0xb2a71d(0x127)]),_0x398cb2[_0xb2a71d(0x15c)]&&(_0x5a6338['bundle_name']=_0x398cb2[_0xb2a71d(0x15c)]),_0x3ab006['relationships']?.[_0xb2a71d(0x12e)]?.[_0xb2a71d(0x11c)]?.['id']&&(_0x5a6338[_0xb2a71d(0x119)]=_0x3ab006['relationships'][_0xb2a71d(0x12e)][_0xb2a71d(0x11c)]['id']),_0x5a6338;}export async function journeyResponseToDef(_0x272b48,_0x1f88cd){const _0xa2f3d0=a147_0x1f71,_0x5289b1=journeyResponseToDefSync(_0x272b48);if(!_0x1f88cd)return _0x5289b1;const _0x56eee7=new Set();collectSegmentIdsFromJourney(_0x5289b1,_0x56eee7);const _0x29dbef=new Set();collectActivationIdsFromJourney(_0x5289b1,_0x29dbef);const _0x115d89={},_0x4e542c=new Map();for(const _0x4f03c5 of Array['from'](_0x56eee7)[_0xa2f3d0(0x18d)]()){if(_0x1f88cd[_0xa2f3d0(0x1a2)]){const _0x30b3f4=await _0x1f88cd['resolveSegment'](_0x4f03c5);if(_0x30b3f4[_0xa2f3d0(0x12a)]){_0x4e542c[_0xa2f3d0(0x1aa)](_0x4f03c5,_0x30b3f4[_0xa2f3d0(0x124)]);if(_0x30b3f4['definition']){const _0x4dcf37={..._0x30b3f4[_0xa2f3d0(0x1b2)],'rule':deepSortObject(_0x30b3f4[_0xa2f3d0(0x1b2)][_0xa2f3d0(0x197)])};_0x115d89[_0x30b3f4[_0xa2f3d0(0x124)]]=_0x4dcf37;}}else _0x4e542c[_0xa2f3d0(0x1aa)](_0x4f03c5,makeSegmentRef(_0x30b3f4[_0xa2f3d0(0x124)]));}else{if(_0x1f88cd[_0xa2f3d0(0x14e)]){const _0x45169e=await _0x1f88cd[_0xa2f3d0(0x14e)](_0x4f03c5);_0x4e542c[_0xa2f3d0(0x1aa)](_0x4f03c5,_0x45169e);}}}const _0x1d484d={},_0x1b2c9a=new Map();for(const _0x1a620b of Array[_0xa2f3d0(0x166)](_0x29dbef)[_0xa2f3d0(0x18d)]()){if(_0x1f88cd['resolveActivation']){const _0x21e2da=await _0x1f88cd['resolveActivation'](_0x1a620b);_0x21e2da[_0xa2f3d0(0x12a)]?(_0x1b2c9a[_0xa2f3d0(0x1aa)](_0x1a620b,_0x21e2da[_0xa2f3d0(0x124)]),_0x21e2da[_0xa2f3d0(0x1b2)]&&(_0x1d484d[_0x21e2da[_0xa2f3d0(0x124)]]=_0x21e2da[_0xa2f3d0(0x1b2)])):_0x1b2c9a['set'](_0x1a620b,makeSegmentRef(_0x21e2da[_0xa2f3d0(0x124)]));}else{if(_0x1f88cd[_0xa2f3d0(0x195)]){const _0x4f0ddd=await _0x1f88cd[_0xa2f3d0(0x195)](_0x1a620b);_0x1b2c9a[_0xa2f3d0(0x1aa)](_0x1a620b,_0x4f0ddd);}}}_0x4e542c[_0xa2f3d0(0x16b)]>0x0&&replaceSegmentIdsInJourney(_0x5289b1,_0x4e542c);_0x1b2c9a[_0xa2f3d0(0x16b)]>0x0&&replaceActivationIdsInJourney(_0x5289b1,_0x1b2c9a);if(_0x1f88cd['resolveJumpTarget']){const _0x24b99f=[];collectJumpTargetsFromJourney(_0x5289b1,_0x24b99f);if(_0x24b99f[_0xa2f3d0(0x135)]>0x0){const _0x11210a=new Map();for(const _0x135a60 of _0x24b99f){try{const _0x22dd26=await _0x1f88cd[_0xa2f3d0(0x126)](_0x135a60['journeyId'],_0x135a60[_0xa2f3d0(0x131)]);_0x11210a[_0xa2f3d0(0x1aa)](_0x135a60[_0xa2f3d0(0x13a)]+':'+_0x135a60[_0xa2f3d0(0x131)],_0x22dd26);}catch{}}_0x11210a[_0xa2f3d0(0x16b)]>0x0&&replaceJumpTargetsInJourney(_0x5289b1,_0x11210a);}}return Object['keys'](_0x115d89)['length']>0x0&&(_0x5289b1[_0xa2f3d0(0x19a)]=_0x115d89),Object[_0xa2f3d0(0x134)](_0x1d484d)[_0xa2f3d0(0x135)]>0x0&&(_0x5289b1[_0xa2f3d0(0x121)]=_0x1d484d),_0x5289b1;}function collectSegmentIdsFromJourney(_0x28b2e1,_0x92c428){const _0x455ae0=a147_0x1f71;_0x28b2e1[_0x455ae0(0x13f)]?.[_0x455ae0(0x1ab)]&&_0x92c428[_0x455ae0(0x178)](_0x28b2e1[_0x455ae0(0x13f)][_0x455ae0(0x1ab)]);const _0x28b8cf=_0x1eedbc=>{const _0x5a792c=_0x455ae0;for(const _0x498796 of _0x1eedbc){_0x498796[_0x5a792c(0x11d)]?.['segment']&&_0x92c428['add'](_0x498796[_0x5a792c(0x11d)]['segment']);if(_0x498796[_0x5a792c(0x196)])for(const _0x50b828 of _0x498796[_0x5a792c(0x196)]){_0x50b828['segment']&&_0x92c428['add'](_0x50b828['segment']);}_0x498796[_0x5a792c(0x1b1)]?.[_0x5a792c(0x1ab)]&&_0x92c428['add'](_0x498796[_0x5a792c(0x1b1)][_0x5a792c(0x1ab)]);if(_0x498796[_0x5a792c(0x128)])for(const _0x32b079 of _0x498796[_0x5a792c(0x128)]){if(_0x32b079[_0x5a792c(0x10e)]==='decision_point'){const _0x4ae2aa=_0x32b079;for(const _0x4b3f19 of _0x4ae2aa['with'][_0x5a792c(0x130)]){_0x4b3f19['segment']&&_0x92c428[_0x5a792c(0x178)](_0x4b3f19[_0x5a792c(0x1ab)]);}}else{if(_0x32b079['type']===_0x5a792c(0x16f)){const _0x2d39b3=_0x32b079;_0x2d39b3[_0x5a792c(0x132)][_0x5a792c(0x17d)]?.['segment']&&_0x92c428[_0x5a792c(0x178)](_0x2d39b3['with'][_0x5a792c(0x17d)][_0x5a792c(0x1ab)]);}}}}};if(_0x28b2e1[_0x455ae0(0x10a)])for(const _0xd978c5 of _0x28b2e1[_0x455ae0(0x10a)]){_0xd978c5['goal']?.[_0x455ae0(0x1ab)]&&_0x92c428[_0x455ae0(0x178)](_0xd978c5['goal']['segment']),_0x28b8cf(_0xd978c5[_0x455ae0(0x192)]);}_0x28b2e1[_0x455ae0(0x192)]&&_0x28b8cf(_0x28b2e1['stages']);if(_0x28b2e1[_0x455ae0(0x15a)])for(const _0x273b45 of _0x28b2e1[_0x455ae0(0x15a)]){_0x28b8cf(_0x273b45[_0x455ae0(0x192)]);}}function replaceSegmentIdsInJourney(_0x1172d3,_0x2ddf8f){const _0x238d10=a147_0x1f71,_0xd7948b=_0x2a3fbd=>_0x2ddf8f[_0x238d10(0x15d)](_0x2a3fbd)||_0x2a3fbd;_0x1172d3[_0x238d10(0x13f)]?.['segment']&&(_0x1172d3[_0x238d10(0x13f)][_0x238d10(0x1ab)]=_0xd7948b(_0x1172d3['goal'][_0x238d10(0x1ab)]));const _0x2db0e7=_0x502dc=>{const _0x3f4779=_0x238d10;for(const _0x36748b of _0x502dc){_0x36748b[_0x3f4779(0x11d)]?.[_0x3f4779(0x1ab)]&&(_0x36748b[_0x3f4779(0x11d)][_0x3f4779(0x1ab)]=_0xd7948b(_0x36748b[_0x3f4779(0x11d)][_0x3f4779(0x1ab)]));if(_0x36748b[_0x3f4779(0x196)])for(const _0x2b8af9 of _0x36748b[_0x3f4779(0x196)]){_0x2b8af9[_0x3f4779(0x1ab)]&&(_0x2b8af9[_0x3f4779(0x1ab)]=_0xd7948b(_0x2b8af9[_0x3f4779(0x1ab)]));}_0x36748b[_0x3f4779(0x1b1)]?.['segment']&&(_0x36748b['milestone'][_0x3f4779(0x1ab)]=_0xd7948b(_0x36748b[_0x3f4779(0x1b1)][_0x3f4779(0x1ab)]));if(_0x36748b['steps'])for(const _0x14fca3 of _0x36748b['steps']){if(_0x14fca3['type']===_0x3f4779(0x18c)){const _0x551f09=_0x14fca3;for(const _0x338e8c of _0x551f09[_0x3f4779(0x132)][_0x3f4779(0x130)]){_0x338e8c[_0x3f4779(0x1ab)]&&(_0x338e8c[_0x3f4779(0x1ab)]=_0xd7948b(_0x338e8c['segment']));}}else{if(_0x14fca3['type']===_0x3f4779(0x16f)){const _0x54f4ec=_0x14fca3;_0x54f4ec[_0x3f4779(0x132)][_0x3f4779(0x17d)]?.['segment']&&(_0x54f4ec[_0x3f4779(0x132)]['condition'][_0x3f4779(0x1ab)]=_0xd7948b(_0x54f4ec['with'][_0x3f4779(0x17d)]['segment']));}}}}};if(_0x1172d3[_0x238d10(0x10a)])for(const _0x3fd224 of _0x1172d3[_0x238d10(0x10a)]){_0x3fd224['goal']?.['segment']&&(_0x3fd224[_0x238d10(0x13f)][_0x238d10(0x1ab)]=_0xd7948b(_0x3fd224['goal'][_0x238d10(0x1ab)])),_0x2db0e7(_0x3fd224[_0x238d10(0x192)]);}_0x1172d3[_0x238d10(0x192)]&&_0x2db0e7(_0x1172d3['stages']);if(_0x1172d3[_0x238d10(0x15a)])for(const _0x34165b of _0x1172d3[_0x238d10(0x15a)]){_0x2db0e7(_0x34165b[_0x238d10(0x192)]);}}function collectActivationIdsFromJourney(_0x562b75,_0x4ba463){const _0x28375c=a147_0x1f71,_0x62fe32=_0x1d8536=>{const _0x4ddc35=a147_0x1f71;for(const _0x9561a2 of _0x1d8536){if(_0x9561a2['steps'])for(const _0x185b20 of _0x9561a2[_0x4ddc35(0x128)]){if(_0x185b20[_0x4ddc35(0x10e)]===_0x4ddc35(0x1a0)){const _0x14c052=_0x185b20;_0x14c052[_0x4ddc35(0x132)][_0x4ddc35(0x1a0)]&&/^\d+$/[_0x4ddc35(0x110)](_0x14c052[_0x4ddc35(0x132)][_0x4ddc35(0x1a0)])&&_0x4ba463['add'](_0x14c052[_0x4ddc35(0x132)]['activation']);}}}};if(_0x562b75[_0x28375c(0x10a)])for(const _0x39bc7a of _0x562b75['journeys']){_0x62fe32(_0x39bc7a[_0x28375c(0x192)]);}_0x562b75[_0x28375c(0x192)]&&_0x62fe32(_0x562b75[_0x28375c(0x192)]);if(_0x562b75[_0x28375c(0x15a)])for(const _0x164b31 of _0x562b75[_0x28375c(0x15a)]){_0x62fe32(_0x164b31[_0x28375c(0x192)]);}}function replaceActivationIdsInJourney(_0x1534d2,_0x630784){const _0x1fb473=a147_0x1f71,_0x55e6bd=_0x39a65d=>_0x630784[_0x1fb473(0x15d)](_0x39a65d)||_0x39a65d,_0x53bb10=_0x93f0a4=>{const _0x6c234e=_0x1fb473;for(const _0x5b2a22 of _0x93f0a4){if(_0x5b2a22[_0x6c234e(0x128)])for(const _0xc895b5 of _0x5b2a22['steps']){if(_0xc895b5[_0x6c234e(0x10e)]==='activation'){const _0x58ad96=_0xc895b5;_0x58ad96[_0x6c234e(0x132)]['activation']&&(_0x58ad96[_0x6c234e(0x132)][_0x6c234e(0x1a0)]=_0x55e6bd(_0x58ad96[_0x6c234e(0x132)][_0x6c234e(0x1a0)]));}}}};if(_0x1534d2['journeys'])for(const _0x3f3496 of _0x1534d2['journeys']){_0x53bb10(_0x3f3496['stages']);}_0x1534d2[_0x1fb473(0x192)]&&_0x53bb10(_0x1534d2[_0x1fb473(0x192)]);if(_0x1534d2[_0x1fb473(0x15a)])for(const _0x95fd3e of _0x1534d2[_0x1fb473(0x15a)]){_0x53bb10(_0x95fd3e[_0x1fb473(0x192)]);}}function collectJumpTargetsFromJourney(_0x1f3663,_0xc5b9de){const _0x35ce00=a147_0x1f71,_0x29c581=new Set(),_0x17f744=_0x2cc772=>{const _0xc54ead=a147_0x1f71;for(const _0x25e678 of _0x2cc772){if(_0x25e678[_0xc54ead(0x128)])for(const _0x587095 of _0x25e678[_0xc54ead(0x128)]){if(_0x587095[_0xc54ead(0x10e)]===_0xc54ead(0x147)){const _0x5fcad5=_0x587095,_0x415ea2=_0x5fcad5[_0xc54ead(0x132)]['target'];if(_0x415ea2[_0xc54ead(0x16d)]&&_0x415ea2[_0xc54ead(0x1b8)]&&/^\d+$/[_0xc54ead(0x110)](_0x415ea2['journey'])&&/^\d+$/['test'](_0x415ea2['stage'])){const _0x2db5a2=_0x415ea2[_0xc54ead(0x16d)]+':'+_0x415ea2['stage'];!_0x29c581[_0xc54ead(0x175)](_0x2db5a2)&&(_0x29c581[_0xc54ead(0x178)](_0x2db5a2),_0xc5b9de['push']({'journeyId':_0x415ea2[_0xc54ead(0x16d)],'stageId':_0x415ea2[_0xc54ead(0x1b8)]}));}}}}};if(_0x1f3663[_0x35ce00(0x10a)])for(const _0x232593 of _0x1f3663['journeys']){_0x17f744(_0x232593[_0x35ce00(0x192)]);}_0x1f3663[_0x35ce00(0x192)]&&_0x17f744(_0x1f3663[_0x35ce00(0x192)]);if(_0x1f3663[_0x35ce00(0x15a)])for(const _0x467664 of _0x1f3663[_0x35ce00(0x15a)]){_0x17f744(_0x467664[_0x35ce00(0x192)]);}}function replaceJumpTargetsInJourney(_0x45418d,_0x567f92){const _0x4a44d3=a147_0x1f71,_0x28f831=_0x2c01fb=>{const _0x108260=a147_0x1f71;for(const _0x5a5b77 of _0x2c01fb){if(_0x5a5b77[_0x108260(0x128)])for(const _0x55934a of _0x5a5b77[_0x108260(0x128)]){if(_0x55934a[_0x108260(0x10e)]===_0x108260(0x147)){const _0x3a2c97=_0x55934a,_0x5a4406=_0x3a2c97['with'][_0x108260(0x172)],_0x1e0578=_0x5a4406['journey']+':'+_0x5a4406['stage'],_0x17f3dd=_0x567f92[_0x108260(0x15d)](_0x1e0578);_0x17f3dd&&(_0x5a4406['journey']=_0x17f3dd[_0x108260(0x151)],_0x5a4406[_0x108260(0x1b8)]=_0x17f3dd[_0x108260(0x1c5)]);}}}};if(_0x45418d[_0x4a44d3(0x10a)])for(const _0x3d91de of _0x45418d[_0x4a44d3(0x10a)]){_0x28f831(_0x3d91de['stages']);}_0x45418d[_0x4a44d3(0x192)]&&_0x28f831(_0x45418d[_0x4a44d3(0x192)]);if(_0x45418d['versions'])for(const _0x1ee511 of _0x45418d[_0x4a44d3(0x15a)]){_0x28f831(_0x1ee511[_0x4a44d3(0x192)]);}}function generateReadableStepName(_0x197655,_0x58521b){const _0x2d178c=a147_0x1f71;if(_0x197655[_0x2d178c(0x124)]&&_0x197655[_0x2d178c(0x124)]!==_0x197655[_0x2d178c(0x10e)]){const _0x26af56=_0x197655[_0x2d178c(0x124)]['trim']();if(_0x26af56&&/[a-z0-9\p{L}]/iu['test'](_0x26af56))return _0x26af56;}const _0x2ec479=_0x197655[_0x2d178c(0x10e)][_0x2d178c(0x137)]()['replace'](/step$/i,'');return _0x2ec479+'_'+(_0x58521b+0x1);}function getStepNextRefs(_0x1daf82){const _0x5a69f8=a147_0x1f71,_0x1dfede=[];if(_0x1daf82[_0x5a69f8(0x162)])_0x1dfede[_0x5a69f8(0x116)](_0x1daf82[_0x5a69f8(0x162)]);if(_0x1daf82[_0x5a69f8(0x130)])for(const _0x5ff62d of _0x1daf82['branches']){if(_0x5ff62d[_0x5a69f8(0x162)])_0x1dfede[_0x5a69f8(0x116)](_0x5ff62d[_0x5a69f8(0x162)]);}if(_0x1daf82[_0x5a69f8(0x10d)])for(const _0xb84cfd of _0x1daf82['variants']){if(_0xb84cfd[_0x5a69f8(0x162)])_0x1dfede['push'](_0xb84cfd[_0x5a69f8(0x162)]);}if(_0x1daf82[_0x5a69f8(0x1b3)])for(const _0x500e86 of _0x1daf82[_0x5a69f8(0x1b3)]){if(_0x500e86['next'])_0x1dfede['push'](_0x500e86[_0x5a69f8(0x162)]);}return _0x1dfede;}function parseJumpTargetDisplayName(_0x135b61){const _0x461416=a147_0x1f71,_0x580dca=_0x135b61[_0x461416(0x14f)](/^(.+?)\s*\(([^/)]+)/);if(!_0x580dca)return undefined;const _0x35e261=_0x580dca[0x1][_0x461416(0x115)](),_0x4c2ef2=_0x580dca[0x2][_0x461416(0x115)]();if(!_0x35e261||!_0x4c2ef2)return undefined;return{'stageName':_0x35e261,'journeyName':_0x4c2ef2};}function orderStepsFromRoot(_0x1b5379,_0x3f5aec){const _0x4e98d5=a147_0x1f71,_0x14e302=Object[_0x4e98d5(0x184)](_0x1b5379);if(_0x14e302[_0x4e98d5(0x135)]===0x0)return[];const _0x282da1=new Set(_0x14e302[_0x4e98d5(0x125)](([_0x240b42])=>_0x240b42)),_0x4051ab=new Set();for(const [,_0x89f280]of _0x14e302){for(const _0x5e9a5e of getStepNextRefs(_0x89f280)){if(_0x282da1['has'](_0x5e9a5e))_0x4051ab[_0x4e98d5(0x178)](_0x5e9a5e);}}let _0x32eef2=_0x3f5aec&&_0x282da1[_0x4e98d5(0x175)](_0x3f5aec)?_0x3f5aec:undefined;if(!_0x32eef2){const _0x59db21=_0x14e302['filter'](([_0x12216d])=>!_0x4051ab[_0x4e98d5(0x175)](_0x12216d));_0x59db21[_0x4e98d5(0x135)]>0x0?_0x32eef2=_0x59db21[0x0][0x0]:_0x32eef2=_0x14e302[0x0][0x0];}const _0x1f6e39=[],_0x36cf75=new Set(),_0x26f37a=[_0x32eef2];while(_0x26f37a[_0x4e98d5(0x135)]>0x0){const _0x2e9d4e=_0x26f37a['shift']();if(_0x36cf75['has'](_0x2e9d4e))continue;_0x36cf75['add'](_0x2e9d4e);const _0x470e34=_0x1b5379[_0x2e9d4e];if(!_0x470e34)continue;_0x1f6e39[_0x4e98d5(0x116)]({'uuid':_0x2e9d4e,'step':_0x470e34});for(const _0x5cf7c0 of getStepNextRefs(_0x470e34)){_0x282da1['has'](_0x5cf7c0)&&!_0x36cf75[_0x4e98d5(0x175)](_0x5cf7c0)&&_0x26f37a[_0x4e98d5(0x116)](_0x5cf7c0);}}for(const [_0x322691,_0x30cfaf]of _0x14e302){!_0x36cf75[_0x4e98d5(0x175)](_0x322691)&&_0x1f6e39[_0x4e98d5(0x116)]({'uuid':_0x322691,'step':_0x30cfaf});}return _0x1f6e39;}function resolveStepReferences(_0x488d88,_0x45ec78,_0x311077,_0xce175e){const _0x11cf5b=a147_0x1f71;if(_0x488d88[_0x11cf5b(0x10e)]!=='end'){_0x488d88[_0x11cf5b(0x162)]&&_0xce175e[_0x11cf5b(0x175)](_0x488d88[_0x11cf5b(0x162)])&&(_0x488d88[_0x11cf5b(0x162)]=_0xce175e[_0x11cf5b(0x15d)](_0x488d88[_0x11cf5b(0x162)]));const _0x1acc63=_0x45ec78+0x1;if(_0x1acc63<_0x311077[_0x11cf5b(0x135)]){const _0x16cdaa=_0xce175e[_0x11cf5b(0x15d)](_0x311077[_0x1acc63][_0x11cf5b(0x117)]);_0x488d88[_0x11cf5b(0x162)]===_0x16cdaa&&delete _0x488d88[_0x11cf5b(0x162)];}}if(_0x488d88[_0x11cf5b(0x10e)]===_0x11cf5b(0x18c))for(const _0x122f67 of _0x488d88['with']['branches']){_0x122f67['next']&&_0xce175e[_0x11cf5b(0x175)](_0x122f67['next'])&&(_0x122f67['next']=_0xce175e[_0x11cf5b(0x15d)](_0x122f67['next']));}if(_0x488d88['type']===_0x11cf5b(0x123))for(const _0x674fd0 of _0x488d88['with']['variants']){_0x674fd0[_0x11cf5b(0x162)]&&_0xce175e[_0x11cf5b(0x175)](_0x674fd0[_0x11cf5b(0x162)])&&(_0x674fd0[_0x11cf5b(0x162)]=_0xce175e['get'](_0x674fd0[_0x11cf5b(0x162)]));}if(_0x488d88['type']===_0x11cf5b(0x16f)&&_0x488d88[_0x11cf5b(0x132)]['condition']){const _0x300e56=_0x488d88[_0x11cf5b(0x132)][_0x11cf5b(0x17d)];_0x300e56['next']&&_0xce175e['has'](_0x300e56['next'])&&(_0x300e56['next']=_0xce175e[_0x11cf5b(0x15d)](_0x300e56[_0x11cf5b(0x162)])),_0x300e56['timeout']?.[_0x11cf5b(0x162)]&&_0xce175e[_0x11cf5b(0x175)](_0x300e56[_0x11cf5b(0x112)][_0x11cf5b(0x162)])&&(_0x300e56[_0x11cf5b(0x112)][_0x11cf5b(0x162)]=_0xce175e[_0x11cf5b(0x15d)](_0x300e56[_0x11cf5b(0x112)]['next']));}}function convertApiStageToYaml(_0x99e6c5){const _0x46fb97=a147_0x1f71,_0x55a564={'name':_0x99e6c5[_0x46fb97(0x124)]};_0x99e6c5['id']&&(_0x55a564['id']=_0x99e6c5['id']);_0x99e6c5[_0x46fb97(0x13e)]&&(_0x55a564[_0x46fb97(0x13e)]=_0x99e6c5[_0x46fb97(0x13e)]);_0x99e6c5['entryCriteria']&&(_0x55a564['entry_criteria']=convertApiCriteriaToYaml(_0x99e6c5[_0x46fb97(0x1b7)]));_0x99e6c5[_0x46fb97(0x15f)]&&_0x99e6c5[_0x46fb97(0x15f)][_0x46fb97(0x135)]>0x0&&(_0x55a564[_0x46fb97(0x196)]=_0x99e6c5['exitCriterias']['map'](convertApiCriteriaToYaml));_0x99e6c5[_0x46fb97(0x1b1)]&&(_0x55a564[_0x46fb97(0x1b1)]=convertApiCriteriaToYaml(_0x99e6c5['milestone']));if(_0x99e6c5[_0x46fb97(0x128)]&&Object[_0x46fb97(0x134)](_0x99e6c5[_0x46fb97(0x128)])[_0x46fb97(0x135)]>0x0){const _0x4724e7=orderStepsFromRoot(_0x99e6c5['steps'],_0x99e6c5[_0x46fb97(0x133)]),_0xeff8a2=new Map(),_0x261b63=new Set();for(let _0x2828f4=0x0;_0x2828f4<_0x4724e7['length'];_0x2828f4++){const {uuid:_0x2e9301,step:_0x42d7f0}=_0x4724e7[_0x2828f4];let _0x48bb93=generateReadableStepName(_0x42d7f0,_0x2828f4),_0x2261c3=_0x48bb93,_0x5ee76c=0x2;while(_0x261b63['has'](_0x2261c3)){_0x2261c3=_0x48bb93+'_'+_0x5ee76c,_0x5ee76c++;}_0x261b63[_0x46fb97(0x178)](_0x2261c3),_0xeff8a2['set'](_0x2e9301,_0x2261c3);}_0x55a564[_0x46fb97(0x128)]=_0x4724e7[_0x46fb97(0x125)](({uuid:_0x365e15,step:_0x2f455c},_0x3ccfcb)=>{const _0x1de4eb=_0x46fb97,_0x4649bb=convertApiStepToYaml(_0x2f455c,_0xeff8a2[_0x1de4eb(0x15d)](_0x365e15));return resolveStepReferences(_0x4649bb,_0x3ccfcb,_0x4724e7,_0xeff8a2),_0x4649bb;});}return _0x55a564;}function convertApiCriteriaToYaml(_0x1df07d){const _0x2196ec=a147_0x1f71,_0x55f05d={'name':_0x1df07d[_0x2196ec(0x124)],'segment':_0x1df07d[_0x2196ec(0x174)]};_0x1df07d['description']&&(_0x55f05d['description']=_0x1df07d[_0x2196ec(0x13e)]);if(_0x1df07d['target']){let _0x174310=_0x1df07d['target'][_0x2196ec(0x13a)],_0x3f337d=_0x1df07d[_0x2196ec(0x172)][_0x2196ec(0x1a7)];if(_0x1df07d[_0x2196ec(0x172)][_0x2196ec(0x151)]){const _0x3a8cff=parseJumpTargetDisplayName(_0x1df07d[_0x2196ec(0x172)][_0x2196ec(0x151)]);_0x3a8cff&&(_0x3f337d=_0x3a8cff[_0x2196ec(0x1c5)],_0x174310=_0x3a8cff[_0x2196ec(0x151)]);}_0x55f05d[_0x2196ec(0x172)]={'journey':_0x174310,'stage':_0x3f337d},_0x1df07d[_0x2196ec(0x172)][_0x2196ec(0x127)]&&(_0x55f05d['target'][_0x2196ec(0x1bc)]=_0x1df07d[_0x2196ec(0x172)][_0x2196ec(0x127)]);}return _0x55f05d;}function convertApiStepToYaml(_0x2605b4,_0xb32543){const _0x53b3e5=a147_0x1f71;switch(_0x2605b4['type']){case _0x53b3e5(0x11b):{const _0x23c038={};if(_0x2605b4['waitStepType']===_0x53b3e5(0x111)&&_0x2605b4[_0x53b3e5(0x164)]!==undefined)_0x23c038[_0x53b3e5(0x14c)]=_0x2605b4[_0x53b3e5(0x164)],_0x23c038[_0x53b3e5(0x12c)]=_0x2605b4[_0x53b3e5(0x12d)];else{if(_0x2605b4[_0x53b3e5(0x138)]===_0x53b3e5(0x11f)&&_0x2605b4[_0x53b3e5(0x19d)])_0x23c038[_0x53b3e5(0x1c7)]=_0x2605b4[_0x53b3e5(0x19d)];else{if(_0x2605b4[_0x53b3e5(0x138)]===_0x53b3e5(0x181)&&_0x2605b4[_0x53b3e5(0x1a3)])_0x23c038[_0x53b3e5(0x13d)]=_0x2605b4[_0x53b3e5(0x1a3)];else{if(_0x2605b4[_0x53b3e5(0x138)]===_0x53b3e5(0x18a)){if(_0x2605b4['conditions']&&_0x2605b4['conditions']['length']>0x0){const _0x505ec3=_0x2605b4[_0x53b3e5(0x1b3)][_0x53b3e5(0x19e)](_0x388f9e=>!_0x388f9e['timedOutPath']),_0x29fe7e=_0x2605b4['conditions'][_0x53b3e5(0x19e)](_0x396524=>_0x396524[_0x53b3e5(0x167)]);_0x505ec3?.[_0x53b3e5(0x174)]&&(_0x23c038[_0x53b3e5(0x17d)]={'segment':_0x505ec3[_0x53b3e5(0x174)],..._0x505ec3[_0x53b3e5(0x162)]?{'next':_0x505ec3['next']}:{}},_0x29fe7e&&_0x29fe7e[_0x53b3e5(0x136)]!==undefined&&_0x29fe7e['unit']&&(_0x23c038[_0x53b3e5(0x17d)]['timeout']={'duration':_0x29fe7e['moveAfter'],'unit':_0x29fe7e['unit'],..._0x29fe7e[_0x53b3e5(0x162)]?{'next':_0x29fe7e[_0x53b3e5(0x162)]}:{}}));}else _0x2605b4[_0x53b3e5(0x17e)]&&(_0x23c038[_0x53b3e5(0x17d)]={'segment':_0x2605b4[_0x53b3e5(0x17e)]},_0x2605b4[_0x53b3e5(0x1a9)]!==undefined&&_0x2605b4[_0x53b3e5(0x1a1)]&&(_0x23c038['condition'][_0x53b3e5(0x112)]={'duration':_0x2605b4[_0x53b3e5(0x1a9)],'unit':_0x2605b4[_0x53b3e5(0x1a1)]}));}}}}const _0x15e4d3={'type':_0x53b3e5(0x16f),'name':_0xb32543,..._0x2605b4[_0x53b3e5(0x162)]?{'next':_0x2605b4['next']}:{},'with':_0x23c038};return _0x15e4d3;}case _0x53b3e5(0x160):{const _0x559574={'type':_0x53b3e5(0x1a0),'name':_0xb32543,..._0x2605b4[_0x53b3e5(0x162)]?{'next':_0x2605b4[_0x53b3e5(0x162)]}:{},'with':{'activation':_0x2605b4[_0x53b3e5(0x1a6)]||''}};return _0x559574;}case _0x53b3e5(0x19f):{const _0x37aef3={'type':_0x53b3e5(0x18c),'name':_0xb32543,..._0x2605b4[_0x53b3e5(0x162)]?{'next':_0x2605b4[_0x53b3e5(0x162)]}:{},'with':{'branches':(_0x2605b4[_0x53b3e5(0x130)]||[])[_0x53b3e5(0x125)](_0x353d40=>({'name':_0x353d40[_0x53b3e5(0x124)],'segment':_0x353d40[_0x53b3e5(0x174)],'excluded':_0x353d40[_0x53b3e5(0x1c8)],..._0x353d40[_0x53b3e5(0x162)]?{'next':_0x353d40[_0x53b3e5(0x162)]}:{}}))}};return _0x37aef3;}case _0x53b3e5(0x1ba):case _0x53b3e5(0x114):case _0x53b3e5(0x14a):{const _0x120608=_0x2605b4[_0x53b3e5(0x10d)]||(_0x2605b4[_0x53b3e5(0x130)]||[])[_0x53b3e5(0x125)](_0x11ffc5=>({'name':_0x11ffc5[_0x53b3e5(0x124)],'percentage':0x0,'next':_0x11ffc5[_0x53b3e5(0x162)]})),_0x5eecdb={'type':_0x53b3e5(0x123),'name':_0xb32543,..._0x2605b4['next']?{'next':_0x2605b4[_0x53b3e5(0x162)]}:{},'with':{'customized_split':_0x2605b4[_0x53b3e5(0x161)],'unique_id':_0x2605b4[_0x53b3e5(0x17c)],'variants':_0x120608[_0x53b3e5(0x125)](_0x534d81=>({'name':_0x534d81[_0x53b3e5(0x124)],'percentage':_0x534d81[_0x53b3e5(0x18f)],..._0x534d81['next']?{'next':_0x534d81[_0x53b3e5(0x162)]}:{}}))}};return _0x5eecdb;}case _0x53b3e5(0x173):{const _0x46b518={'type':'merge','name':_0xb32543,..._0x2605b4[_0x53b3e5(0x162)]?{'next':_0x2605b4[_0x53b3e5(0x162)]}:{}};return _0x46b518;}case _0x53b3e5(0x155):{let _0x1726ad='',_0x1f22bb='',_0x4118f0;if(_0x2605b4['target']){_0x1726ad=_0x2605b4['target'][_0x53b3e5(0x13a)],_0x1f22bb=_0x2605b4[_0x53b3e5(0x172)][_0x53b3e5(0x1a7)],_0x4118f0=_0x2605b4[_0x53b3e5(0x172)][_0x53b3e5(0x127)];if(_0x2605b4[_0x53b3e5(0x172)][_0x53b3e5(0x151)]){const _0xab57b1=parseJumpTargetDisplayName(_0x2605b4[_0x53b3e5(0x172)]['journeyName']);_0xab57b1&&(_0x1f22bb=_0xab57b1[_0x53b3e5(0x1c5)],_0x1726ad=_0xab57b1[_0x53b3e5(0x151)]);}}const _0x2d920d={'type':'jump','name':_0xb32543,..._0x2605b4[_0x53b3e5(0x162)]?{'next':_0x2605b4['next']}:{},'with':{'target':{'journey':_0x1726ad,'stage':_0x1f22bb,..._0x4118f0?{'bundle_id':_0x4118f0}:{}}}};return _0x2d920d;}case'End':{const _0x4802f4={'type':_0x53b3e5(0x1b6),'name':_0xb32543};return _0x4802f4;}default:{const _0x652e7a={'type':'end','name':_0xb32543};return _0x652e7a;}}}export async function journeyDefToRequest(_0x4b2c75,_0x525a31,_0x2fba75){const _0x20e6dd=a147_0x1f71,_0x2137b2=_0x4b2c75[_0x20e6dd(0x192)]||getActiveStages(_0x4b2c75),_0x18ae89=isJourneysArrayMode(_0x4b2c75)||isMultiVersionMode(_0x4b2c75)?getLatestJourneyEntry(_0x4b2c75):undefined,_0x15569d=_0x18ae89?.[_0x20e6dd(0x17b)]??_0x4b2c75[_0x20e6dd(0x124)],_0x3927bc=_0x4b2c75['segments']||{},_0x585c63=_0x4b2c75[_0x20e6dd(0x121)]||{},_0x475a3f={'type':'journey','attributes':{'name':_0x15569d,'audienceId':_0x525a31,'journeyStages':await Promise['all'](_0x2137b2[_0x20e6dd(0x125)](_0x13ee11=>convertYamlStageToApi(_0x13ee11,_0x2fba75,_0x3927bc,_0x585c63)))}},_0x10ff5c=_0x18ae89?.['id']??_0x4b2c75['id'];_0x10ff5c&&(_0x475a3f['id']=_0x10ff5c);_0x4b2c75[_0x20e6dd(0x13e)]&&(_0x475a3f[_0x20e6dd(0x176)][_0x20e6dd(0x13e)]=_0x4b2c75[_0x20e6dd(0x13e)]);const _0x4ee561=getEffectiveGoal(_0x4b2c75);_0x4ee561&&(_0x475a3f[_0x20e6dd(0x176)][_0x20e6dd(0x13f)]=await convertYamlCriteriaToApi(_0x4ee561,_0x2fba75,_0x3927bc));const _0x4e145e=getEffectiveReentry(_0x4b2c75);return _0x4e145e&&(_0x475a3f[_0x20e6dd(0x176)][_0x20e6dd(0x143)]=_0x4e145e,_0x475a3f[_0x20e6dd(0x176)][_0x20e6dd(0x153)]=_0x4e145e!=='no_reentry'),_0x4b2c75[_0x20e6dd(0x119)]&&(_0x475a3f['relationships']={'parentFolder':{'data':{'id':_0x4b2c75[_0x20e6dd(0x119)],'type':_0x20e6dd(0x154)}}}),_0x475a3f;}async function convertYamlStageToApi(_0x4e61ce,_0x3639e0,_0x4ce0ac={},_0x48e49b={}){const _0x305646=a147_0x1f71,_0x1cc91b={'name':_0x4e61ce[_0x305646(0x124)]};_0x4e61ce['id']&&(_0x1cc91b['id']=_0x4e61ce['id']);_0x4e61ce[_0x305646(0x13e)]&&(_0x1cc91b[_0x305646(0x13e)]=_0x4e61ce[_0x305646(0x13e)]);_0x4e61ce[_0x305646(0x11d)]&&(_0x1cc91b[_0x305646(0x1b7)]=await convertYamlCriteriaToApi(_0x4e61ce[_0x305646(0x11d)],_0x3639e0,_0x4ce0ac));_0x4e61ce[_0x305646(0x196)]&&_0x4e61ce[_0x305646(0x196)][_0x305646(0x135)]>0x0&&(_0x1cc91b[_0x305646(0x15f)]=await Promise[_0x305646(0x1b5)](_0x4e61ce['exit_criteria'][_0x305646(0x125)](_0x57c823=>convertYamlCriteriaToApi(_0x57c823,_0x3639e0,_0x4ce0ac))));_0x4e61ce['milestone']&&(_0x1cc91b[_0x305646(0x1b1)]=await convertYamlCriteriaToApi(_0x4e61ce['milestone'],_0x3639e0,_0x4ce0ac));if(_0x4e61ce[_0x305646(0x128)]&&_0x4e61ce[_0x305646(0x128)][_0x305646(0x135)]>0x0){const _0x3d7cb6={},_0xb669b2=_0x4e61ce['steps']['map']((_0x3109ad,_0x3ca831)=>{const _0x1e04c3=_0x305646,_0x5b99ba=_0x3109ad[_0x1e04c3(0x117)]||generateUUID(),_0xf23bd5=_0x3109ad[_0x1e04c3(0x124)]||_0x3109ad[_0x1e04c3(0x10e)]+'_'+_0x3ca831;return _0x3d7cb6[_0xf23bd5]=_0x5b99ba,{..._0x3109ad,'name':_0xf23bd5};});_0x1cc91b[_0x305646(0x133)]=_0x3d7cb6[_0xb669b2[0x0][_0x305646(0x124)]],_0x1cc91b[_0x305646(0x128)]={};for(let _0x4398c7=0x0;_0x4398c7<_0xb669b2[_0x305646(0x135)];_0x4398c7++){const _0x270552=_0xb669b2[_0x4398c7],_0xc89d85=_0x3d7cb6[_0x270552[_0x305646(0x124)]],_0x11c45c=!_0x270552[_0x305646(0x162)]&&_0x4398c7<_0xb669b2[_0x305646(0x135)]-0x1&&_0x270552[_0x305646(0x10e)]!==_0x305646(0x1b6)?_0xb669b2[_0x4398c7+0x1]['name']:_0x270552[_0x305646(0x162)],_0x3de96c=_0x11c45c!==_0x270552[_0x305646(0x162)]?{..._0x270552,'next':_0x11c45c}:_0x270552;_0x1cc91b[_0x305646(0x128)][_0xc89d85]=await convertYamlStepToApi(_0x3de96c,_0x3639e0,_0x4ce0ac,_0x3d7cb6,_0x48e49b);}}else _0x4e61ce[_0x305646(0x150)]&&(_0x1cc91b[_0x305646(0x133)]=_0x4e61ce[_0x305646(0x150)]);return _0x1cc91b;}async function convertYamlCriteriaToApi(_0x251abb,_0x31be40,_0x37bc86={}){const _0x10c083=a147_0x1f71;let _0x206798=_0x251abb[_0x10c083(0x1ab)];if(_0x206798&&!/^\d+$/['test'](_0x206798)){const _0x19a4d2=parseSegmentRef(_0x206798);if(_0x19a4d2[_0x10c083(0x10e)]===_0x10c083(0x1c6))_0x31be40?.[_0x10c083(0x142)]&&(_0x206798=await _0x31be40[_0x10c083(0x142)](_0x19a4d2[_0x10c083(0x124)]));else{if(_0x19a4d2[_0x10c083(0x10e)]===_0x10c083(0x171)&&_0x37bc86[_0x19a4d2['name']])_0x31be40?.[_0x10c083(0x122)]&&(_0x206798=await _0x31be40['resolveEmbeddedSegmentId'](_0x19a4d2[_0x10c083(0x124)],_0x37bc86[_0x19a4d2[_0x10c083(0x124)]]));else _0x31be40?.[_0x10c083(0x142)]&&(_0x206798=await _0x31be40[_0x10c083(0x142)](_0x19a4d2['name']));}}const _0x41b492={'name':_0x251abb[_0x10c083(0x124)],'segmentId':_0x206798};_0x251abb[_0x10c083(0x13e)]&&(_0x41b492['description']=_0x251abb[_0x10c083(0x13e)]);if(_0x251abb[_0x10c083(0x172)]){const _0xaf129f=_0x251abb[_0x10c083(0x172)][_0x10c083(0x16d)],_0x289ef4=_0x251abb['target'][_0x10c083(0x1b8)];let _0x128df5=_0x251abb[_0x10c083(0x172)][_0x10c083(0x16d)];_0x31be40?.[_0x10c083(0x129)]&&!/^\d+$/['test'](_0x128df5)&&(_0x128df5=await _0x31be40[_0x10c083(0x129)](_0x128df5));let _0xf34302=_0x251abb[_0x10c083(0x172)][_0x10c083(0x1b8)];_0x31be40?.[_0x10c083(0x1c4)]&&!/^\d+$/[_0x10c083(0x110)](_0xf34302)&&(_0xf34302=await _0x31be40['resolveStageId'](_0x128df5,_0xf34302));const _0x2cbfd8=!/^\d+$/[_0x10c083(0x110)](_0xaf129f)&&!isLocalJourneyRef(_0xaf129f)?formatApiJourneyName(_0xaf129f,_0x289ef4):undefined;_0x41b492[_0x10c083(0x172)]={'journeyId':_0x128df5,'journeyStageId':_0xf34302,'journeyName':_0x2cbfd8,'confirmed':!![]},_0x251abb['target']['bundle_id']&&(_0x41b492['target'][_0x10c083(0x127)]=_0x251abb[_0x10c083(0x172)][_0x10c083(0x1bc)]);}return _0x41b492;}async function convertYamlStepToApi(_0x4f2ee9,_0x3cb2dc,_0xde78ca={},_0x4b7363={},_0x5ed681={}){const _0x2e120d=a147_0x1f71,_0x11fd77=async _0x43d636=>{const _0x2f18b2=a147_0x1f71;if(/^\d+$/[_0x2f18b2(0x110)](_0x43d636))return _0x43d636;const _0x3c66ac=parseSegmentRef(_0x43d636);if(_0x3c66ac['type']===_0x2f18b2(0x1c6)){if(_0x3cb2dc?.[_0x2f18b2(0x142)])return await _0x3cb2dc[_0x2f18b2(0x142)](_0x3c66ac[_0x2f18b2(0x124)]);}else{if(_0x3c66ac[_0x2f18b2(0x10e)]===_0x2f18b2(0x171)&&_0xde78ca[_0x3c66ac['name']]){if(_0x3cb2dc?.[_0x2f18b2(0x122)])return await _0x3cb2dc[_0x2f18b2(0x122)](_0x3c66ac[_0x2f18b2(0x124)],_0xde78ca[_0x3c66ac['name']]);}else{if(_0x3cb2dc?.[_0x2f18b2(0x142)])return await _0x3cb2dc[_0x2f18b2(0x142)](_0x3c66ac[_0x2f18b2(0x124)]);}}return _0x43d636;},_0x34aa45=async _0x3460ce=>{const _0x27c44b=a147_0x1f71;if(/^\d+$/[_0x27c44b(0x110)](_0x3460ce))return _0x3460ce;const _0x187f96=parseSegmentRef(_0x3460ce);if(_0x187f96[_0x27c44b(0x10e)]===_0x27c44b(0x1c6)){if(_0x3cb2dc?.[_0x27c44b(0x1b4)])return await _0x3cb2dc[_0x27c44b(0x1b4)](_0x187f96[_0x27c44b(0x124)]);return _0x187f96['name'];}else{if(_0x187f96[_0x27c44b(0x10e)]===_0x27c44b(0x171)&&_0x5ed681[_0x187f96[_0x27c44b(0x124)]]){if(_0x3cb2dc?.[_0x27c44b(0x1a5)])return await _0x3cb2dc[_0x27c44b(0x1a5)](_0x187f96[_0x27c44b(0x124)],_0x5ed681[_0x187f96[_0x27c44b(0x124)]]);if(_0x3cb2dc?.[_0x27c44b(0x1b4)])return await _0x3cb2dc[_0x27c44b(0x1b4)](_0x187f96['name']);}else{if(_0x3cb2dc?.[_0x27c44b(0x1b4)])return await _0x3cb2dc['resolveActivationId'](_0x187f96[_0x27c44b(0x124)]);}}return _0x3460ce;},_0x23fac6=_0x2c5444=>{const _0x4d6109=a147_0x1f71;if(!_0x2c5444)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x4d6109(0x110)](_0x2c5444))return _0x2c5444;return _0x4b7363[_0x2c5444]||_0x2c5444;};switch(_0x4f2ee9[_0x2e120d(0x10e)]){case'wait':{const _0x561b9f=_0x4f2ee9,_0x49042c=_0x561b9f[_0x2e120d(0x132)],_0x4e19f4={'type':_0x2e120d(0x11b),'name':_0x561b9f[_0x2e120d(0x124)],'next':_0x23fac6(_0x561b9f[_0x2e120d(0x162)])};if(_0x49042c[_0x2e120d(0x14c)]!==undefined&&_0x49042c['unit'])_0x4e19f4['waitStepType']=_0x2e120d(0x111),_0x4e19f4[_0x2e120d(0x164)]=_0x49042c['duration'],_0x4e19f4[_0x2e120d(0x12d)]=normalizeWaitUnit(_0x49042c[_0x2e120d(0x12c)]);else{if(_0x49042c[_0x2e120d(0x1c7)])_0x4e19f4[_0x2e120d(0x138)]=_0x2e120d(0x11f),_0x4e19f4[_0x2e120d(0x19d)]=_0x49042c[_0x2e120d(0x1c7)];else{if(_0x49042c[_0x2e120d(0x13d)])_0x4e19f4[_0x2e120d(0x138)]='DaysOfTheWeek',_0x4e19f4[_0x2e120d(0x1a3)]=_0x49042c[_0x2e120d(0x13d)];else{if(_0x49042c[_0x2e120d(0x17d)]){_0x4e19f4[_0x2e120d(0x138)]=_0x2e120d(0x18a);const _0x43fba0=await _0x11fd77(_0x49042c[_0x2e120d(0x17d)][_0x2e120d(0x1ab)]),_0xa46ff2=_0x49042c[_0x2e120d(0x17d)][_0x2e120d(0x112)]?.['next']!==undefined;if(_0xa46ff2){const _0x31640c=[];_0x31640c[_0x2e120d(0x116)]({'id':generateUUID(),'segmentId':_0x43fba0,'timedOutPath':![],'name':'Met\x20condition(s)','next':_0x23fac6(_0x49042c[_0x2e120d(0x17d)][_0x2e120d(0x162)]??_0x561b9f[_0x2e120d(0x162)])});if(_0x49042c[_0x2e120d(0x17d)]['timeout']){const _0x9a308d=_0x49042c['condition']['timeout'][_0x2e120d(0x14c)],_0xf2319e=normalizeWaitUnit(_0x49042c[_0x2e120d(0x17d)][_0x2e120d(0x112)]['unit']);_0x31640c['push']({'id':generateUUID(),'timedOutPath':!![],'name':'*Max\x20wait\x20'+_0x9a308d+'\x20'+_0xf2319e,'moveAfter':_0x9a308d,'unit':_0xf2319e,'next':_0x23fac6(_0x49042c['condition']['timeout'][_0x2e120d(0x162)])});}_0x4e19f4[_0x2e120d(0x1b3)]=_0x31640c,delete _0x4e19f4['next'];}else _0x4e19f4[_0x2e120d(0x17e)]=_0x43fba0,_0x49042c[_0x2e120d(0x17d)]['timeout']&&(_0x4e19f4[_0x2e120d(0x1a9)]=_0x49042c[_0x2e120d(0x17d)][_0x2e120d(0x112)][_0x2e120d(0x14c)],_0x49042c[_0x2e120d(0x17d)][_0x2e120d(0x112)][_0x2e120d(0x12c)]&&(_0x4e19f4['conditionTimeoutUnit']=normalizeWaitUnit(_0x49042c[_0x2e120d(0x17d)]['timeout'][_0x2e120d(0x12c)])));}}}}return _0x4e19f4;}case _0x2e120d(0x1a0):{const _0x44b332=_0x4f2ee9,_0x207826=_0x44b332['with']['activation'],_0x3658fa=await _0x34aa45(_0x207826);return{'type':'Activation','name':_0x44b332['name'],'journeyActivationStepId':_0x3658fa,'next':_0x23fac6(_0x44b332['next'])};}case _0x2e120d(0x18c):{const _0x378bf4=_0x4f2ee9,_0x273a6d=_0x378bf4[_0x2e120d(0x132)][_0x2e120d(0x130)];return{'type':_0x2e120d(0x19f),'name':_0x378bf4[_0x2e120d(0x124)],'branches':await Promise[_0x2e120d(0x1b5)](_0x273a6d[_0x2e120d(0x125)](async _0x21eaf1=>{const _0x12a44b=_0x2e120d;let _0x155751='';if(!_0x21eaf1[_0x12a44b(0x1b0)]){const _0x4699c3=_0x21eaf1['segment']||_0x21eaf1['segment_id']||'';_0x155751=_0x4699c3?await _0x11fd77(_0x4699c3):'';}return{'id':crypto[_0x12a44b(0x140)](),'name':_0x21eaf1['name'],'description':null,'segmentId':_0x155751,'excludedPath':_0x21eaf1[_0x12a44b(0x1b0)]??![],'next':_0x23fac6(_0x21eaf1[_0x12a44b(0x162)])};})),'next':_0x23fac6(_0x378bf4[_0x2e120d(0x162)])};}case _0x2e120d(0x123):{const _0x17ae6c=_0x4f2ee9,_0x9c16ef=_0x17ae6c[_0x2e120d(0x132)];return{'type':'ABTest','name':_0x17ae6c[_0x2e120d(0x124)],'customizedSplit':_0x9c16ef[_0x2e120d(0x159)],'uniqueId':_0x9c16ef[_0x2e120d(0x1af)],'variants':_0x9c16ef['variants'][_0x2e120d(0x125)](_0x3e95cc=>({'id':_0x3e95cc['id']||generateUUID(),'name':_0x3e95cc[_0x2e120d(0x124)],'percentage':_0x3e95cc[_0x2e120d(0x18f)],'next':_0x23fac6(_0x3e95cc[_0x2e120d(0x162)])})),'next':_0x23fac6(_0x17ae6c['next'])};}case _0x2e120d(0x187):return{'type':_0x2e120d(0x173),'name':_0x4f2ee9['name'],'next':_0x23fac6(_0x4f2ee9[_0x2e120d(0x162)])};case _0x2e120d(0x147):{const _0x507177=_0x4f2ee9,_0x13db04=_0x507177[_0x2e120d(0x132)]['target'],_0xafbb8b=_0x13db04['journey'],_0x358b73=_0x13db04[_0x2e120d(0x1b8)];let _0x1ca6a1=_0x13db04['journey'];_0x3cb2dc?.[_0x2e120d(0x129)]&&!/^\d+$/[_0x2e120d(0x110)](_0x1ca6a1)&&(_0x1ca6a1=await _0x3cb2dc[_0x2e120d(0x129)](_0x1ca6a1));let _0x1e23ab=_0x13db04[_0x2e120d(0x1b8)];_0x3cb2dc?.[_0x2e120d(0x1c4)]&&!/^\d+$/['test'](_0x1e23ab)&&(_0x1e23ab=await _0x3cb2dc[_0x2e120d(0x1c4)](_0x1ca6a1,_0x1e23ab));const _0x3a2eb4=!/^\d+$/['test'](_0xafbb8b)&&!isLocalJourneyRef(_0xafbb8b)?formatApiJourneyName(_0xafbb8b,_0x358b73):undefined;return{'type':_0x2e120d(0x155),'name':_0x507177[_0x2e120d(0x124)],'target':{'journeyId':_0x1ca6a1,'journeyStageId':_0x1e23ab,'journeyBundleId':_0x13db04[_0x2e120d(0x1bc)],'journeyName':_0x3a2eb4,'confirmed':!![]},'next':_0x23fac6(_0x507177[_0x2e120d(0x162)])};}case _0x2e120d(0x1b6):return{'type':_0x2e120d(0x168),'name':_0x4f2ee9['name']};default:{const _0x2fede5=_0x4f2ee9;return{'type':'End','name':_0x2fede5['name']};}}}export function toYamlString(_0x238a21){const _0x3df93=a147_0x1f71,_0x3c1c47=stripInternalFields(_0x238a21),_0x450f22=a147_0x2fb881[_0x3df93(0x19c)](_0x3c1c47,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3df93(0x186)}),_0x923d09=['segments:',_0x3df93(0x182),'goal:',_0x3df93(0x185),_0x3df93(0x10f),_0x3df93(0x1ad),_0x3df93(0x1ae)];let _0x180fc8=_0x450f22;for(const _0x212c1e of _0x923d09){_0x180fc8=_0x180fc8[_0x3df93(0x16e)](new RegExp('^('+_0x212c1e+')','m'),(_0x39405d,_0x31604b,_0x512c0e)=>{if(_0x512c0e===0x0||_0x180fc8[_0x512c0e-0x1]==='\x0a'&&_0x180fc8[_0x512c0e-0x2]==='\x0a')return _0x31604b;return'\x0a'+_0x31604b;});}return _0x180fc8;}function stripInternalFields(_0x277286){const _0x39a7ae=a147_0x1f71,{id:_0xdae695,folder_id:_0x1e492e,bundle_id:_0x19c031,bundle_name:_0x36cbba,version:_0x50782e,allow_reentry:_0x5eb4cb,..._0x4fbe23}=_0x277286;return _0x4fbe23[_0x39a7ae(0x10a)]&&(_0x4fbe23[_0x39a7ae(0x10a)]=_0x4fbe23[_0x39a7ae(0x10a)][_0x39a7ae(0x125)](_0x54197f=>{const _0x3ec383=_0x39a7ae,{id:_0x2448a3,..._0x5348f5}=_0x54197f;return{..._0x5348f5,'stages':_0x5348f5['stages']['map'](stripStageInternalFields),..._0x54197f[_0x3ec383(0x179)]===!![]?{'latest':!![]}:{},..._0x4fbe23[_0x3ec383(0x10a)][_0x3ec383(0x135)]===0x1&&_0x5348f5[_0x3ec383(0x17b)]==='v1'?{'version':undefined}:{}};})),_0x4fbe23['stages']&&(_0x4fbe23[_0x39a7ae(0x192)]=_0x4fbe23[_0x39a7ae(0x192)][_0x39a7ae(0x125)](stripStageInternalFields)),_0x4fbe23['versions']&&(_0x4fbe23['versions']=_0x4fbe23[_0x39a7ae(0x15a)][_0x39a7ae(0x125)](_0x40a763=>{const _0x3adb0e=_0x39a7ae,{id:_0x2a9851,..._0xba0814}=_0x40a763;return{..._0xba0814,'stages':_0xba0814[_0x3adb0e(0x192)][_0x3adb0e(0x125)](stripStageInternalFields),..._0x40a763[_0x3adb0e(0x179)]===!![]?{'latest':!![]}:{}};})),_0x4fbe23;}function stripStageInternalFields(_0x34ff7a){const {id:_0x3e058c,..._0x44ce96}=_0x34ff7a;return _0x44ce96;}export function parseYamlString(_0xb0b6ef){return safeParseYaml(_0xb0b6ef,JourneyDefSchema);}export function isJourneyDef(_0x562783){const _0x128012=a147_0x1f71;return typeof _0x562783===_0x128012(0x17f)&&_0x562783!==null&&'type'in _0x562783&&_0x562783[_0x128012(0x10e)]===_0x128012(0x16d);}export function generateTemplate(_0x3648b9,_0x1a5482){const _0x566c2e=a147_0x1f71,_0x51981f={'type':_0x566c2e(0x16d),'name':_0x3648b9,'description':_0x566c2e(0x1ac),'reentry':_0x566c2e(0x1c3),'goal':{'name':_0x566c2e(0x120),'segment':'goal-segment'},'stages':[{'name':_0x566c2e(0x18b),'description':'First\x20stage\x20of\x20the\x20journey','entry_criteria':{'name':_0x566c2e(0x113),'segment':_0x1a5482},'steps':[{'type':'wait','name':_0x566c2e(0x118),'with':{'duration':0x1,'unit':_0x566c2e(0x1bd)}},{'type':_0x566c2e(0x1a0),'name':_0x566c2e(0x13b),'with':{'activation':_0x566c2e(0x157)}},{'type':_0x566c2e(0x1b6),'name':_0x566c2e(0x15b)}]}]};return toYamlString(_0x51981f);}function generateUUID(){return crypto['randomUUID']();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x181082){const _0x56ccc7=a147_0x1f71;if(_0x181082[_0x56ccc7(0x1c2)](SEGMENT_REF_PREFIX))return{'type':_0x56ccc7(0x1c6),'name':_0x181082[_0x56ccc7(0x189)](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/[_0x56ccc7(0x110)](_0x181082))return{'type':'id','name':_0x181082};return{'type':_0x56ccc7(0x171),'name':_0x181082};}export function makeSegmentRef(_0x469782){return''+SEGMENT_REF_PREFIX+_0x469782;}export function isExternalSegmentRef(_0x327be9){const _0x43d3a0=a147_0x1f71;return _0x327be9[_0x43d3a0(0x1c2)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x8e708a){const _0x4600dd=a147_0x1f71;return!!(_0x8e708a['journeys']&&_0x8e708a[_0x4600dd(0x10a)][_0x4600dd(0x135)]>0x0);}export function isMultiVersionMode(_0x34e3e0){const _0x1fe408=a147_0x1f71;return!!(_0x34e3e0[_0x1fe408(0x15a)]&&_0x34e3e0[_0x1fe408(0x15a)]['length']>0x0);}export function isSingleVersionMode(_0x598ef9){const _0x5e2277=a147_0x1f71;return!!(_0x598ef9[_0x5e2277(0x192)]&&_0x598ef9['stages'][_0x5e2277(0x135)]>0x0);}export function hasMultipleVersions(_0x32ebe2){const _0x3f9017=a147_0x1f71;if(isJourneysArrayMode(_0x32ebe2))return(_0x32ebe2['journeys']?.[_0x3f9017(0x135)]||0x0)>0x1;if(isMultiVersionMode(_0x32ebe2))return(_0x32ebe2[_0x3f9017(0x15a)]?.[_0x3f9017(0x135)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0xf9bc8f){const _0x1eca99=a147_0x1f71;if(isJourneysArrayMode(_0xf9bc8f))return _0xf9bc8f;if(isSingleVersionMode(_0xf9bc8f)){const {stages:_0x2209bd,id:_0x155c08,version:_0x1d8fd5,version_number:_0x16ce78,..._0x3a6983}=_0xf9bc8f;return{..._0x3a6983,'journeys':[{'version':_0x1d8fd5||'v1','stages':_0x2209bd||[],'id':_0x155c08,'version_number':_0x16ce78}]};}if(isMultiVersionMode(_0xf9bc8f)){const {versions:_0x3f561d,..._0x44b913}=_0xf9bc8f;return{..._0x44b913,'journeys':(_0x3f561d||[])['map'](_0x4ae92d=>({'version':_0x4ae92d[_0x1eca99(0x124)],'state':_0x4ae92d[_0x1eca99(0x13c)],'latest':_0x4ae92d['latest'],'stages':_0x4ae92d[_0x1eca99(0x192)],'id':_0x4ae92d['id'],'version_number':_0x4ae92d[_0x1eca99(0x183)]}))};}return _0xf9bc8f;}export function normalizeJourneyDef(_0x317d67,_0x25e142){const _0x394251=a147_0x1f71,_0x416651=normalizeToJourneysFormat(_0x317d67),_0x5ad085=_0x25e142?.[_0x394251(0x19a)]?Object['keys'](_0x25e142[_0x394251(0x19a)]):undefined,_0x2b0950=_0x25e142?.[_0x394251(0x121)]?Object[_0x394251(0x134)](_0x25e142[_0x394251(0x121)]):undefined;return{'type':_0x394251(0x16d),'name':_0x416651[_0x394251(0x124)],..._0x416651[_0x394251(0x13e)]!==undefined&&{'description':_0x416651[_0x394251(0x13e)]},..._0x416651['goal']&&{'goal':normalizeJourneyCriteria(_0x416651[_0x394251(0x13f)])},..._0x416651['reentry']!==undefined&&{'reentry':_0x416651[_0x394251(0x149)]},..._0x416651[_0x394251(0x19a)]&&{'segments':normalizeEmbeddedSegments(_0x416651[_0x394251(0x19a)],_0x5ad085)},..._0x416651['activations']&&{'activations':normalizeEmbeddedActivations(_0x416651[_0x394251(0x121)],_0x2b0950)},..._0x416651[_0x394251(0x10a)]&&{'journeys':_0x416651['journeys']['map'](_0x53e822=>normalizeJourneyEntry(_0x53e822,_0x416651[_0x394251(0x10a)][_0x394251(0x135)]===0x1))}};}function normalizeJourneyEntry(_0x1d2909,_0x20f861){const _0xbf6f1c=a147_0x1f71;return{...!_0x20f861&&_0x1d2909[_0xbf6f1c(0x17b)]!==undefined&&{'version':_0x1d2909['version']},..._0x1d2909['state']!==undefined&&{'state':_0x1d2909[_0xbf6f1c(0x13c)]},...!_0x20f861&&_0x1d2909[_0xbf6f1c(0x179)]!==undefined&&{'latest':_0x1d2909[_0xbf6f1c(0x179)]},..._0x1d2909[_0xbf6f1c(0x183)]!==undefined&&{'version_number':_0x1d2909[_0xbf6f1c(0x183)]},..._0x1d2909[_0xbf6f1c(0x13f)]&&{'goal':normalizeJourneyCriteria(_0x1d2909[_0xbf6f1c(0x13f)])},..._0x1d2909[_0xbf6f1c(0x149)]!==undefined&&{'reentry':_0x1d2909['reentry']},'stages':_0x1d2909[_0xbf6f1c(0x192)][_0xbf6f1c(0x125)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x100b07){const _0x42fbab=a147_0x1f71;return{'name':_0x100b07[_0x42fbab(0x124)],..._0x100b07[_0x42fbab(0x13e)]!==undefined&&{'description':_0x100b07[_0x42fbab(0x13e)]},..._0x100b07['entry_criteria']&&{'entry_criteria':normalizeJourneyCriteria(_0x100b07[_0x42fbab(0x11d)])},..._0x100b07[_0x42fbab(0x196)]&&{'exit_criteria':_0x100b07[_0x42fbab(0x196)][_0x42fbab(0x125)](normalizeJourneyCriteria)},..._0x100b07[_0x42fbab(0x1b1)]&&{'milestone':normalizeJourneyCriteria(_0x100b07[_0x42fbab(0x1b1)])},..._0x100b07[_0x42fbab(0x128)]&&{'steps':normalizeStepsWithImplicitNext(_0x100b07[_0x42fbab(0x128)])}};}function normalizeStepsWithImplicitNext(_0x1906b5){const _0x3bd019=a147_0x1f71;return _0x1906b5[_0x3bd019(0x125)]((_0x511469,_0x31c9a9)=>{const _0x4e9fe4=_0x3bd019,_0x341138=_0x31c9a9<_0x1906b5[_0x4e9fe4(0x135)]-0x1?_0x1906b5[_0x31c9a9+0x1]['name']:undefined;return normalizeJourneyStep(_0x511469,_0x341138);});}function normalizeJourneyCriteria(_0x2e96fb){const _0x5d3a56=a147_0x1f71;return{'name':_0x2e96fb[_0x5d3a56(0x124)],..._0x2e96fb['description']!==undefined&&{'description':_0x2e96fb[_0x5d3a56(0x13e)]},'segment':_0x2e96fb[_0x5d3a56(0x1ab)],..._0x2e96fb[_0x5d3a56(0x172)]&&{'target':normalizeJumpTarget(_0x2e96fb[_0x5d3a56(0x172)])}};}function normalizeJourneyStep(_0x14309e,_0x30ee16){const _0x10fa9f=a147_0x1f71,_0x3da88c=_0x14309e[_0x10fa9f(0x162)]!==undefined&&_0x14309e[_0x10fa9f(0x162)]!==_0x30ee16,_0x2f1662={'type':_0x14309e['type'],'name':_0x14309e[_0x10fa9f(0x124)],..._0x3da88c&&{'next':_0x14309e[_0x10fa9f(0x162)]}};if(_0x10fa9f(0x132)in _0x14309e&&_0x14309e['with'])return{..._0x2f1662,'with':normalizeStepParams(_0x14309e[_0x10fa9f(0x10e)],_0x14309e['with'])};return _0x2f1662;}function normalizeStepParams(_0x4e2c6b,_0x42d52a){const _0x357a70=a147_0x1f71;switch(_0x4e2c6b){case _0x357a70(0x16f):{const _0x300c71=_0x42d52a;let _0x3bd875;return _0x300c71[_0x357a70(0x17d)]&&(_0x3bd875={'segment':_0x300c71[_0x357a70(0x17d)][_0x357a70(0x1ab)],..._0x300c71['condition']['next']!==undefined&&{'next':_0x300c71[_0x357a70(0x17d)][_0x357a70(0x162)]},..._0x300c71[_0x357a70(0x17d)]['timeout']&&{'timeout':{'duration':_0x300c71['condition'][_0x357a70(0x112)][_0x357a70(0x14c)],'unit':_0x300c71[_0x357a70(0x17d)]['timeout'][_0x357a70(0x12c)],..._0x300c71['condition'][_0x357a70(0x112)][_0x357a70(0x162)]!==undefined&&{'next':_0x300c71[_0x357a70(0x17d)][_0x357a70(0x112)][_0x357a70(0x162)]}}}}),{..._0x300c71[_0x357a70(0x14c)]!==undefined&&{'duration':_0x300c71[_0x357a70(0x14c)]},..._0x300c71['unit']!==undefined&&{'unit':_0x300c71[_0x357a70(0x12c)]},..._0x300c71[_0x357a70(0x1c7)]!==undefined&&{'wait_until':_0x300c71['wait_until']},..._0x300c71[_0x357a70(0x13d)]!==undefined&&{'days_of_week':_0x300c71[_0x357a70(0x13d)]},..._0x3bd875&&{'condition':_0x3bd875}};}case _0x357a70(0x1a0):{const _0x11ca52=_0x42d52a;return{'activation':_0x11ca52[_0x357a70(0x1a0)]};}case'decision_point':{const _0x4ddd84=_0x42d52a;return{'branches':_0x4ddd84[_0x357a70(0x130)][_0x357a70(0x125)](normalizeDecisionBranch)};}case'ab_test':{const _0x41e99e=_0x42d52a;return{..._0x41e99e[_0x357a70(0x159)]!==undefined&&{'customized_split':_0x41e99e[_0x357a70(0x159)]},..._0x41e99e[_0x357a70(0x1af)]!==undefined&&{'unique_id':_0x41e99e[_0x357a70(0x1af)]},'variants':_0x41e99e['variants'][_0x357a70(0x125)](normalizeAbTestVariant)};}case _0x357a70(0x147):{const _0x28975d=_0x42d52a;return{'target':normalizeJumpTarget(_0x28975d[_0x357a70(0x172)])};}default:return _0x42d52a;}}function a147_0x1f71(_0x1edeff,_0x1f05de){_0x1edeff=_0x1edeff-0x10a;const _0x1659d4=a147_0x1659();let _0x1f7134=_0x1659d4[_0x1edeff];return _0x1f7134;}function normalizeDecisionBranch(_0x222333){const _0x27f92c=a147_0x1f71;return{'name':_0x222333[_0x27f92c(0x124)],..._0x222333[_0x27f92c(0x1ab)]!==undefined&&{'segment':_0x222333[_0x27f92c(0x1ab)]},..._0x222333[_0x27f92c(0x1b0)]!==undefined&&{'excluded':_0x222333[_0x27f92c(0x1b0)]},..._0x222333[_0x27f92c(0x162)]!==undefined&&{'next':_0x222333[_0x27f92c(0x162)]}};}function normalizeAbTestVariant(_0x517555){const _0x4d3ad5=a147_0x1f71;return{..._0x517555['id']!==undefined&&{'id':_0x517555['id']},'name':_0x517555['name'],'percentage':_0x517555[_0x4d3ad5(0x18f)],..._0x517555[_0x4d3ad5(0x162)]!==undefined&&{'next':_0x517555[_0x4d3ad5(0x162)]}};}function normalizeJumpTarget(_0xfa9b12){const _0x14ff16=a147_0x1f71;return{'journey':_0xfa9b12[_0x14ff16(0x16d)],'stage':_0xfa9b12['stage'],..._0xfa9b12[_0x14ff16(0x1bc)]!==undefined&&{'bundle_id':_0xfa9b12['bundle_id']}};}function normalizeEmbeddedSegments(_0x2fcf66,_0x1bf7c){const _0x253dbd=a147_0x1f71,_0x5d2b33={},_0x41daa0=Object[_0x253dbd(0x134)](_0x2fcf66),_0x1f1b2b=_0x1bf7c?[..._0x1bf7c[_0x253dbd(0x11a)](_0x5aa02f=>_0x41daa0['includes'](_0x5aa02f)),..._0x41daa0['filter'](_0x332af8=>!_0x1bf7c[_0x253dbd(0x156)](_0x332af8))[_0x253dbd(0x18d)]()]:_0x41daa0[_0x253dbd(0x18d)]();for(const _0x5ef9f5 of _0x1f1b2b){const _0x3b43a8=_0x2fcf66[_0x5ef9f5];if(_0x3b43a8[_0x253dbd(0x197)]){const _0x2f83c3=_0x3b43a8['rule'];if(_0x2f83c3['type']!==_0x253dbd(0x194)&&_0x2f83c3[_0x253dbd(0x10e)]!=='Or'){const _0x40be9c=_0x2f83c3[_0x253dbd(0x10e)]??_0x253dbd(0x1c9);throw new SDKError(ErrorCode[_0x253dbd(0x14d)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x5ef9f5+_0x253dbd(0x146)+(_0x253dbd(0x188)+_0x40be9c+'\x27.\x0a')+_0x253dbd(0x15e)+'\x20\x20rule:\x0a'+_0x253dbd(0x1c0)+_0x253dbd(0x191)+_0x253dbd(0x177)+_0x253dbd(0x190)+_0x253dbd(0x199));}if(!_0x2f83c3['conditions']||!Array['isArray'](_0x2f83c3[_0x253dbd(0x1b3)]))throw new SDKError(ErrorCode[_0x253dbd(0x14d)],_0x253dbd(0x158)+_0x5ef9f5+'\x27:\x20'+_0x253dbd(0x19b)+_0x253dbd(0x15e)+_0x253dbd(0x16c)+('\x20\x20\x20\x20type:\x20'+_0x2f83c3[_0x253dbd(0x10e)]+'\x0a')+_0x253dbd(0x191)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x253dbd(0x199));}_0x5d2b33[_0x5ef9f5]={..._0x3b43a8[_0x253dbd(0x13e)]&&_0x3b43a8[_0x253dbd(0x13e)][_0x253dbd(0x115)]()&&{'description':_0x3b43a8['description']},..._0x3b43a8[_0x253dbd(0x197)]&&{'rule':deepSortObject(_0x3b43a8[_0x253dbd(0x197)])}};}return _0x5d2b33;}function normalizeEmbeddedActivations(_0x53f72b,_0x2b53dd){const _0x4248b5=a147_0x1f71,_0x5881dc={},_0x18ed72=Object[_0x4248b5(0x134)](_0x53f72b),_0x463c06=_0x2b53dd?[..._0x2b53dd[_0x4248b5(0x11a)](_0xbd4ec7=>_0x18ed72[_0x4248b5(0x156)](_0xbd4ec7)),..._0x18ed72[_0x4248b5(0x11a)](_0x1f2864=>!_0x2b53dd[_0x4248b5(0x156)](_0x1f2864))['sort']()]:_0x18ed72[_0x4248b5(0x18d)]();for(const _0x3d49e2 of _0x463c06){const _0xb4273a=_0x53f72b[_0x3d49e2];_0x5881dc[_0x3d49e2]={'name':_0xb4273a[_0x4248b5(0x124)],'connection':_0xb4273a['connection'],..._0xb4273a['description']!==undefined&&{'description':_0xb4273a[_0x4248b5(0x13e)]},..._0xb4273a[_0x4248b5(0x10b)]!==undefined&&{'all_columns':_0xb4273a[_0x4248b5(0x10b)]},..._0xb4273a[_0x4248b5(0x1bb)]!==undefined&&{'columns':_0xb4273a[_0x4248b5(0x1bb)]},..._0xb4273a[_0x4248b5(0x152)]!==undefined&&{'behavior':_0xb4273a[_0x4248b5(0x152)]},..._0xb4273a[_0x4248b5(0x1c1)]!==undefined&&{'schedule':_0xb4273a[_0x4248b5(0x1c1)]},..._0xb4273a[_0x4248b5(0x180)]!==undefined&&{'notification':_0xb4273a[_0x4248b5(0x180)]},..._0xb4273a['connector_config']!==undefined&&{'connector_config':_0xb4273a[_0x4248b5(0x139)]},..._0xb4273a[_0x4248b5(0x11e)]!==undefined&&{'activation_template_id':_0xb4273a[_0x4248b5(0x11e)]}};}return _0x5881dc;}export function getActiveStages(_0x1f05d7){const _0x454562=a147_0x1f71;if(isJourneysArrayMode(_0x1f05d7)){const _0xd0819e=_0x1f05d7['journeys']||[],_0x33800a=_0xd0819e[_0x454562(0x19e)](_0xaafd7c=>_0xaafd7c['latest']===!![])||_0xd0819e[0x0];return _0x33800a?.[_0x454562(0x192)]||[];}if(isSingleVersionMode(_0x1f05d7))return _0x1f05d7[_0x454562(0x192)]||[];if(isMultiVersionMode(_0x1f05d7)){const _0x41f027=_0x1f05d7[_0x454562(0x15a)]||[],_0x5f18c3=_0x41f027[_0x454562(0x19e)](_0x2bc0ed=>_0x2bc0ed[_0x454562(0x179)]===!![])||_0x41f027[0x0];return _0x5f18c3?.[_0x454562(0x192)]||[];}return[];}export function getLatestJourneyEntry(_0x8b7962){const _0x1e9446=a147_0x1f71;if(isJourneysArrayMode(_0x8b7962)){const _0x4e676e=_0x8b7962['journeys']||[];return _0x4e676e[_0x1e9446(0x19e)](_0x369ab3=>_0x369ab3[_0x1e9446(0x179)]===!![])||_0x4e676e[0x0];}if(isMultiVersionMode(_0x8b7962)){const _0x46de0a=_0x8b7962[_0x1e9446(0x15a)]||[],_0x170f8f=_0x46de0a['find'](_0x45abdd=>_0x45abdd[_0x1e9446(0x179)]===!![])||_0x46de0a[0x0];if(_0x170f8f)return{'version':_0x170f8f['name'],'state':_0x170f8f['state'],'latest':_0x170f8f[_0x1e9446(0x179)],'stages':_0x170f8f[_0x1e9446(0x192)],'id':_0x170f8f['id'],'version_number':_0x170f8f[_0x1e9446(0x183)]};}if(isSingleVersionMode(_0x8b7962))return{'version':_0x8b7962[_0x1e9446(0x17b)]||'v1','state':_0x1e9446(0x144),'stages':_0x8b7962[_0x1e9446(0x192)]||[],'id':_0x8b7962['id'],'version_number':_0x8b7962[_0x1e9446(0x183)],'goal':_0x8b7962[_0x1e9446(0x13f)],'reentry':_0x8b7962[_0x1e9446(0x149)]};return undefined;}function a147_0x1659(){const _0x574755=['slice','Condition','Stage\x201','decision_point','sort','922230DVEiRU','percentage','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','\x20\x20\x20\x20conditions:\x0a','stages','4060161cJFAhT','And','resolveActivationName','exit_criteria','rule','164555hNIsvX','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','segments','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','stringify','waitUntilDate','find','DecisionPoint','activation','conditionTimeoutUnit','resolveSegment','daysOfWeek','2300880zlWBjC','resolveEmbeddedActivationId','journeyActivationStepId','journeyStageId','days','conditionTimeoutDuration','set','segment','Journey\x20description','stages:','versions:','unique_id','excluded','milestone','definition','conditions','resolveActivationId','all','end','entryCriteria','stage','versionNumber','ABTest','columns','bundle_id','day','reentry_always','8vFgiBb','\x20\x20\x20\x20type:\x20And\x0a','schedule','startsWith','no_reentry','resolveStageId','stageName','ref','wait_until','excludedPath','(missing)','journeys','all_columns','week','variants','type','journeys:','test','Duration','timeout','Entry\x20Criteria','AbTest','trim','push','uuid','Wait\x201\x20Day','folder_id','filter','WaitStep','data','entry_criteria','activation_template_id','Date','Goal\x20Achieved','activations','resolveEmbeddedSegmentId','ab_test','name','map','resolveJumpTarget','journeyBundleId','steps','resolveJourneyId','isJourneyLocal','isArray','unit','waitStepUnit','parentFolder','exitCriteria','branches','stageId','with','rootStep','keys','length','moveAfter','toLowerCase','waitStepType','connector_config','journeyId','Send\x20Notification','state','days_of_week','description','goal','randomUUID','launched','resolveSegmentId','reentryMode','draft','16lHiXbz','\x27:\x20','jump','waitCondition','reentry','Variant','journeyStages','duration','JOURNEY_SYNTAX_ERROR','resolveSegmentName','match','root_step','journeyName','behavior','allowReentry','folder','Jump','includes','your-activation-name','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','customized_split','versions','Stage\x20Complete','journeyBundleName','get','Expected\x20format:\x0a','exitCriterias','Activation','customizedSplit','next','2YySvtA','waitStep','6905340gBRYlh','from','timedOutPath','End','942738ZghlUX','Unknown\x20segment\x20\x22','size','\x20\x20rule:\x0a','journey','replace','wait','4784967MEETdu','embedded','target','Merge','segmentId','has','attributes','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','add','latest','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','version','uniqueId','condition','conditionSegmentId','object','notification','DaysOfTheWeek','activations:','version_number','entries','reentry:','null','merge','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27'];a147_0x1659=function(){return _0x574755;};return a147_0x1659();}export function getLatestVersion(_0xf09b16){const _0x121f3b=a147_0x1f71;if(!isMultiVersionMode(_0xf09b16))return undefined;const _0x2a5b33=_0xf09b16['versions']||[];return _0x2a5b33['find'](_0x590a70=>_0x590a70[_0x121f3b(0x179)]===!![])||_0x2a5b33[0x0];}export function getEffectiveGoal(_0xc33f2){const _0x4a8bad=a147_0x1f71,_0x40dbf0=getLatestJourneyEntry(_0xc33f2);return _0x40dbf0?.['goal']||_0xc33f2[_0x4a8bad(0x13f)];}export function getEffectiveReentry(_0x544bc8){const _0x20054e=a147_0x1f71,_0x288844=getLatestJourneyEntry(_0x544bc8);return _0x288844?.[_0x20054e(0x149)]||_0x544bc8['reentry'];}export function collectSegmentRefs(_0x3dff80){const _0x58bb9d=a147_0x1f71,_0xb4b921=new Set();_0x3dff80[_0x58bb9d(0x13f)]?.['segment']&&_0xb4b921[_0x58bb9d(0x178)](_0x3dff80['goal'][_0x58bb9d(0x1ab)]);const _0x56effa=_0x3529f3=>{const _0x45f2d4=_0x58bb9d;for(const _0x426118 of _0x3529f3){_0x426118[_0x45f2d4(0x11d)]?.[_0x45f2d4(0x1ab)]&&_0xb4b921['add'](_0x426118['entry_criteria'][_0x45f2d4(0x1ab)]);if(_0x426118[_0x45f2d4(0x196)])for(const _0x5009af of _0x426118[_0x45f2d4(0x196)]){_0x5009af[_0x45f2d4(0x1ab)]&&_0xb4b921['add'](_0x5009af[_0x45f2d4(0x1ab)]);}_0x426118[_0x45f2d4(0x1b1)]?.['segment']&&_0xb4b921[_0x45f2d4(0x178)](_0x426118[_0x45f2d4(0x1b1)][_0x45f2d4(0x1ab)]);if(_0x426118[_0x45f2d4(0x128)])for(const _0x50a6d3 of _0x426118['steps']){if(_0x50a6d3['type']==='decision_point'){const _0x59aafa=_0x50a6d3;for(const _0x49bab3 of _0x59aafa[_0x45f2d4(0x132)][_0x45f2d4(0x130)]){_0x49bab3[_0x45f2d4(0x1ab)]&&_0xb4b921[_0x45f2d4(0x178)](_0x49bab3[_0x45f2d4(0x1ab)]);}}else{if(_0x50a6d3[_0x45f2d4(0x10e)]===_0x45f2d4(0x16f)){const _0x3aa683=_0x50a6d3;_0x3aa683[_0x45f2d4(0x132)][_0x45f2d4(0x17d)]?.[_0x45f2d4(0x1ab)]&&_0xb4b921[_0x45f2d4(0x178)](_0x3aa683[_0x45f2d4(0x132)][_0x45f2d4(0x17d)][_0x45f2d4(0x1ab)]);}}}}};_0x3dff80[_0x58bb9d(0x192)]&&_0x56effa(_0x3dff80[_0x58bb9d(0x192)]);if(_0x3dff80[_0x58bb9d(0x15a)])for(const _0x37381c of _0x3dff80[_0x58bb9d(0x15a)]){_0x56effa(_0x37381c['stages']);}return _0xb4b921;}export function validateSegmentRefs(_0x484c27){const _0x1417d9=a147_0x1f71,_0x119538=[],_0x11518c=collectSegmentRefs(_0x484c27),_0xd21a21=new Set(Object['keys'](_0x484c27[_0x1417d9(0x19a)]||{}));for(const _0x183e38 of _0x11518c){const _0x427e42=parseSegmentRef(_0x183e38);_0x427e42[_0x1417d9(0x10e)]==='embedded'&&!_0xd21a21[_0x1417d9(0x175)](_0x427e42[_0x1417d9(0x124)])&&_0x119538['push'](_0x1417d9(0x16a)+_0x427e42[_0x1417d9(0x124)]+'\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:'+_0x427e42[_0x1417d9(0x124)]+_0x1417d9(0x17a));}return _0x119538;}export function collectSegmentIdsFromJourneyApi(_0x42606a){const _0x5b0d0f=a147_0x1f71,_0x532950=new Set();_0x42606a[_0x5b0d0f(0x176)]['goal']?.[_0x5b0d0f(0x174)]&&_0x532950['add'](_0x42606a['attributes']['goal'][_0x5b0d0f(0x174)]);const _0x4eaa72=_0x42606a[_0x5b0d0f(0x176)][_0x5b0d0f(0x14b)];if(Array[_0x5b0d0f(0x12b)](_0x4eaa72))for(const _0x18dae0 of _0x4eaa72){_0x18dae0['entryCriteria']?.['segmentId']&&_0x532950['add'](_0x18dae0[_0x5b0d0f(0x1b7)][_0x5b0d0f(0x174)]);const _0x13b58a=_0x18dae0[_0x5b0d0f(0x15f)]??_0x18dae0[_0x5b0d0f(0x12f)];if(Array[_0x5b0d0f(0x12b)](_0x13b58a))for(const _0x362b27 of _0x13b58a){_0x362b27['segmentId']&&_0x532950['add'](_0x362b27[_0x5b0d0f(0x174)]);}_0x18dae0[_0x5b0d0f(0x1b1)]?.[_0x5b0d0f(0x174)]&&_0x532950[_0x5b0d0f(0x178)](_0x18dae0['milestone']['segmentId']);if(_0x18dae0[_0x5b0d0f(0x128)]&&typeof _0x18dae0[_0x5b0d0f(0x128)]===_0x5b0d0f(0x17f)){const _0x2d64c3=Array['isArray'](_0x18dae0[_0x5b0d0f(0x128)])?_0x18dae0[_0x5b0d0f(0x128)]:Object['values'](_0x18dae0['steps']);for(const _0x236cae of _0x2d64c3){_0x236cae[_0x5b0d0f(0x148)]?.['segmentId']&&_0x532950[_0x5b0d0f(0x178)](_0x236cae[_0x5b0d0f(0x148)]['segmentId']);const _0x11b7de=_0x236cae;_0x11b7de[_0x5b0d0f(0x17e)]&&_0x532950[_0x5b0d0f(0x178)](_0x11b7de[_0x5b0d0f(0x17e)]);if(Array['isArray'](_0x11b7de[_0x5b0d0f(0x1b3)]))for(const _0x51c70b of _0x11b7de[_0x5b0d0f(0x1b3)]){_0x51c70b['segmentId']&&_0x532950['add'](_0x51c70b[_0x5b0d0f(0x174)]);}if(Array['isArray'](_0x236cae[_0x5b0d0f(0x130)]))for(const _0x396a0f of _0x236cae[_0x5b0d0f(0x130)]){_0x396a0f['segmentId']&&_0x532950['add'](_0x396a0f['segmentId']);}}}}return _0x532950;}
|
|
1
|
+
(function(_0x2af8a4,_0x122b6e){const _0x2fafc6=a150_0x43fb,_0x4e493d=_0x2af8a4();while(!![]){try{const _0x7fbd60=-parseInt(_0x2fafc6(0x20a))/0x1*(-parseInt(_0x2fafc6(0x20e))/0x2)+parseInt(_0x2fafc6(0x185))/0x3+-parseInt(_0x2fafc6(0x1f8))/0x4+-parseInt(_0x2fafc6(0x205))/0x5*(parseInt(_0x2fafc6(0x20b))/0x6)+-parseInt(_0x2fafc6(0x16a))/0x7*(-parseInt(_0x2fafc6(0x1e5))/0x8)+-parseInt(_0x2fafc6(0x19e))/0x9+parseInt(_0x2fafc6(0x15f))/0xa*(parseInt(_0x2fafc6(0x19a))/0xb);if(_0x7fbd60===_0x122b6e)break;else _0x4e493d['push'](_0x4e493d['shift']());}catch(_0x2c8a98){_0x4e493d['push'](_0x4e493d['shift']());}}}(a150_0x54da,0xbc25d));import*as a150_0xd81d27 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x13dee1){const _0x40e8f5=a150_0x43fb,_0x1bd920=_0x13dee1[_0x40e8f5(0x1a3)]();if(_0x1bd920===_0x40e8f5(0x19f)||_0x1bd920===_0x40e8f5(0x203))return _0x40e8f5(0x203);if(_0x1bd920==='weeks'||_0x1bd920===_0x40e8f5(0x16e))return _0x40e8f5(0x16e);return _0x13dee1;}export function journeyResponseToDefSync(_0x2050f3){const _0x5df6ab=a150_0x43fb,_0x4913ac=_0x2050f3['attributes'],_0x416893=_0x4913ac[_0x5df6ab(0x208)]||_0x4913ac[_0x5df6ab(0x15e)],_0xd46591={'stages':_0x4913ac[_0x5df6ab(0x1df)][_0x5df6ab(0x182)](convertApiStageToYaml),'id':_0x2050f3['id']};_0x4913ac[_0x5df6ab(0x16c)]&&(_0xd46591[_0x5df6ab(0x16c)]=convertApiCriteriaToYaml(_0x4913ac[_0x5df6ab(0x16c)]));_0x4913ac[_0x5df6ab(0x15e)]&&_0x4913ac[_0x5df6ab(0x15e)]!==_0x416893&&(_0xd46591[_0x5df6ab(0x1ff)]=_0x4913ac[_0x5df6ab(0x15e)]);_0x4913ac[_0x5df6ab(0x1e6)]!==undefined&&(_0xd46591['version_number']=_0x4913ac['versionNumber']);_0x4913ac[_0x5df6ab(0x17f)]&&(_0xd46591[_0x5df6ab(0x17f)]=_0x4913ac['state']===_0x5df6ab(0x1c6)?_0x5df6ab(0x1c6):_0x5df6ab(0x181));const _0x31a231={'type':_0x5df6ab(0x1b3),'name':_0x416893,'journeys':[_0xd46591]};_0x4913ac[_0x5df6ab(0x1fb)]&&(_0x31a231[_0x5df6ab(0x1fb)]=_0x4913ac[_0x5df6ab(0x1fb)]);_0x4913ac[_0x5df6ab(0x16c)]&&(_0x31a231[_0x5df6ab(0x16c)]=convertApiCriteriaToYaml(_0x4913ac['goal']));if(_0x4913ac[_0x5df6ab(0x1ba)])_0x31a231[_0x5df6ab(0x1d1)]=_0x4913ac[_0x5df6ab(0x1ba)];else _0x4913ac[_0x5df6ab(0x1f0)]!==undefined&&(_0x31a231[_0x5df6ab(0x1d1)]=_0x4913ac[_0x5df6ab(0x1f0)]?_0x5df6ab(0x169):_0x5df6ab(0x1b4));return _0x4913ac['journeyBundleId']&&(_0x31a231['bundle_id']=_0x4913ac['journeyBundleId']),_0x4913ac['journeyBundleName']&&(_0x31a231[_0x5df6ab(0x210)]=_0x4913ac['journeyBundleName']),_0x2050f3[_0x5df6ab(0x209)]?.[_0x5df6ab(0x1fc)]?.['data']?.['id']&&(_0x31a231[_0x5df6ab(0x216)]=_0x2050f3[_0x5df6ab(0x209)][_0x5df6ab(0x1fc)]['data']['id']),_0x31a231;}export async function journeyResponseToDef(_0x53c802,_0x4c25dc){const _0x471e14=a150_0x43fb,_0x1bd2f3=journeyResponseToDefSync(_0x53c802);if(!_0x4c25dc)return _0x1bd2f3;const _0x196d68=new Set();collectSegmentIdsFromJourney(_0x1bd2f3,_0x196d68);const _0x4ede8c=new Set();collectActivationIdsFromJourney(_0x1bd2f3,_0x4ede8c);const _0x23f46d={},_0x1dca85=new Map();for(const _0x214a21 of Array[_0x471e14(0x18f)](_0x196d68)[_0x471e14(0x219)]()){if(_0x4c25dc[_0x471e14(0x1b9)]){const _0x35cbcf=await _0x4c25dc['resolveSegment'](_0x214a21);if(_0x35cbcf[_0x471e14(0x1f9)]){_0x1dca85[_0x471e14(0x1c1)](_0x214a21,_0x35cbcf[_0x471e14(0x15e)]);if(_0x35cbcf['definition']){const _0x1a5553={..._0x35cbcf[_0x471e14(0x162)],'rule':deepSortObject(_0x35cbcf[_0x471e14(0x162)][_0x471e14(0x17b)])};_0x23f46d[_0x35cbcf['name']]=_0x1a5553;}}else _0x1dca85[_0x471e14(0x1c1)](_0x214a21,makeSegmentRef(_0x35cbcf[_0x471e14(0x15e)]));}else{if(_0x4c25dc['resolveSegmentName']){const _0x636f28=await _0x4c25dc[_0x471e14(0x1a4)](_0x214a21);_0x1dca85[_0x471e14(0x1c1)](_0x214a21,_0x636f28);}}}const _0x26adcd={},_0x2bd971=new Map();for(const _0x2e9df7 of Array[_0x471e14(0x18f)](_0x4ede8c)['sort']()){if(_0x4c25dc[_0x471e14(0x1cd)]){const _0x29addd=await _0x4c25dc[_0x471e14(0x1cd)](_0x2e9df7);_0x29addd['isJourneyLocal']?(_0x2bd971['set'](_0x2e9df7,_0x29addd[_0x471e14(0x15e)]),_0x29addd[_0x471e14(0x162)]&&(_0x26adcd[_0x29addd[_0x471e14(0x15e)]]=_0x29addd[_0x471e14(0x162)])):_0x2bd971[_0x471e14(0x1c1)](_0x2e9df7,makeSegmentRef(_0x29addd[_0x471e14(0x15e)]));}else{if(_0x4c25dc[_0x471e14(0x1b5)]){const _0x1798bf=await _0x4c25dc[_0x471e14(0x1b5)](_0x2e9df7);_0x2bd971[_0x471e14(0x1c1)](_0x2e9df7,_0x1798bf);}}}_0x1dca85[_0x471e14(0x206)]>0x0&&replaceSegmentIdsInJourney(_0x1bd2f3,_0x1dca85);_0x2bd971['size']>0x0&&replaceActivationIdsInJourney(_0x1bd2f3,_0x2bd971);if(_0x4c25dc[_0x471e14(0x189)]){const _0x3e31ab=[];collectJumpTargetsFromJourney(_0x1bd2f3,_0x3e31ab);if(_0x3e31ab['length']>0x0){const _0x212588=new Map();for(const _0x53cd14 of _0x3e31ab){try{const _0x37c196=await _0x4c25dc[_0x471e14(0x189)](_0x53cd14[_0x471e14(0x20c)],_0x53cd14['stageId']);_0x212588[_0x471e14(0x1c1)](_0x53cd14['journeyId']+':'+_0x53cd14[_0x471e14(0x1ea)],_0x37c196);}catch{}}_0x212588[_0x471e14(0x206)]>0x0&&replaceJumpTargetsInJourney(_0x1bd2f3,_0x212588);}}return Object[_0x471e14(0x1ce)](_0x23f46d)['length']>0x0&&(_0x1bd2f3[_0x471e14(0x1c3)]=_0x23f46d),Object[_0x471e14(0x1ce)](_0x26adcd)[_0x471e14(0x196)]>0x0&&(_0x1bd2f3['activations']=_0x26adcd),_0x1bd2f3;}function collectSegmentIdsFromJourney(_0x31d8c9,_0xa644bc){const _0x1093fa=a150_0x43fb;_0x31d8c9[_0x1093fa(0x16c)]?.['segment']&&_0xa644bc[_0x1093fa(0x161)](_0x31d8c9[_0x1093fa(0x16c)][_0x1093fa(0x1c0)]);const _0x4cd7e4=_0xd7d213=>{const _0x3668b0=_0x1093fa;for(const _0x525d56 of _0xd7d213){_0x525d56['entry_criteria']?.[_0x3668b0(0x1c0)]&&_0xa644bc[_0x3668b0(0x161)](_0x525d56[_0x3668b0(0x1ad)]['segment']);if(_0x525d56['exit_criteria'])for(const _0x1621f0 of _0x525d56[_0x3668b0(0x1af)]){_0x1621f0[_0x3668b0(0x1c0)]&&_0xa644bc[_0x3668b0(0x161)](_0x1621f0[_0x3668b0(0x1c0)]);}_0x525d56[_0x3668b0(0x1a2)]?.[_0x3668b0(0x1c0)]&&_0xa644bc[_0x3668b0(0x161)](_0x525d56['milestone'][_0x3668b0(0x1c0)]);if(_0x525d56['steps'])for(const _0x860d74 of _0x525d56[_0x3668b0(0x186)]){if(_0x860d74[_0x3668b0(0x213)]===_0x3668b0(0x17c)){const _0x1481f9=_0x860d74;for(const _0x3f0691 of _0x1481f9[_0x3668b0(0x1c5)][_0x3668b0(0x1a5)]){_0x3f0691[_0x3668b0(0x1c0)]&&_0xa644bc[_0x3668b0(0x161)](_0x3f0691[_0x3668b0(0x1c0)]);}}else{if(_0x860d74[_0x3668b0(0x213)]===_0x3668b0(0x20f)){const _0x59cdd3=_0x860d74;_0x59cdd3[_0x3668b0(0x1c5)][_0x3668b0(0x1a9)]?.[_0x3668b0(0x1c0)]&&_0xa644bc[_0x3668b0(0x161)](_0x59cdd3[_0x3668b0(0x1c5)][_0x3668b0(0x1a9)][_0x3668b0(0x1c0)]);}}}}};if(_0x31d8c9[_0x1093fa(0x1bc)])for(const _0x20b4e7 of _0x31d8c9['journeys']){_0x20b4e7['goal']?.['segment']&&_0xa644bc[_0x1093fa(0x161)](_0x20b4e7[_0x1093fa(0x16c)][_0x1093fa(0x1c0)]),_0x4cd7e4(_0x20b4e7['stages']);}_0x31d8c9[_0x1093fa(0x1d4)]&&_0x4cd7e4(_0x31d8c9['stages']);if(_0x31d8c9[_0x1093fa(0x1de)])for(const _0x36167d of _0x31d8c9[_0x1093fa(0x1de)]){_0x4cd7e4(_0x36167d[_0x1093fa(0x1d4)]);}}function a150_0x54da(){const _0x474415=['journeyActivationStepId','segments','unit','with','launched','unique_id','resolveActivationId','trim','behavior','schedule','variants','resolveActivation','keys','journeyStageId','wait_until','reentry','duration','entries','stages','segments:','null','end','isArray','uuid','attributes','merge','Entry\x20Criteria','all','versions','journeyStages','journeys:','next','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','conditions','bundle_id','56bRGmZp','versionNumber','Jump','percentage','JOURNEY_SYNTAX_ERROR','stageId','excluded','target','\x20\x20\x20\x20type:\x20And\x0a','find','Wait\x201\x20Day','allowReentry','WaitStep','resolveStageId','ab_test','exitCriteria','Duration','excludedPath','match','5679392XsYUyB','isJourneyLocal','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','description','parentFolder','\x20\x20\x20\x20conditions:\x0a','activations:','version','segmentId','all_columns','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','day','reentry:','108425KBgapR','size','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','journeyBundleName','relationships','145698SZlWgI','366UOrsya','journeyId','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','6muECJg','wait','bundle_name','Journey\x20description','goal-segment','type','timedOutPath','conditionSegmentId','folder_id','daysOfWeek','includes','sort','object','Condition','has','test','Goal\x20Achieved','randomUUID','moveAfter','Composite','name','10zYfsaH','ABTest','add','definition','DaysOfTheWeek','stage','activation_template_id','DecisionPoint','notification','\x27:\x20','reentry_always','198359ZBVuMx','entryCriteria','goal','customized_split','week','customizedSplit','journeyBundleId','exitCriterias','jump','version_number','latest','activations','*Max\x20wait\x20','resolveEmbeddedSegmentId','root_step','waitStepType','waitUntilDate','rule','decision_point','waitStep','conditionTimeoutUnit','state','embedded','draft','map','startsWith','filter','3335286hTnDvm','steps','uniqueId','stageName','resolveJumpTarget','journeyName','Met\x20condition(s)','connector_config','waitCondition','waitStepUnit','from','rootStep','Send\x20Notification','days_of_week','resolveEmbeddedActivationId','\x20\x20\x20\x20type:\x20','conditionTimeoutDuration','length','values','Unknown\x20segment\x20\x22','AbTest','33925639iTJBQC','Stage\x201','Activation','ref','11862702InRTQR','days','And','columns','milestone','toLowerCase','resolveSegmentName','branches','Date','\x20\x20rule:\x0a','push','condition','resolveJourneyId','Variant','activation','entry_criteria','resolveSegmentId','exit_criteria','segment_id','stringify','get','journey','no_reentry','resolveActivationName','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','timeout','Merge','resolveSegment','reentryMode','slice','journeys','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','Expected\x20format:\x0a','End','segment','set'];a150_0x54da=function(){return _0x474415;};return a150_0x54da();}function replaceSegmentIdsInJourney(_0x2039f7,_0x1c885d){const _0x274e75=a150_0x43fb,_0x43d99b=_0x443d80=>_0x1c885d[_0x274e75(0x1b2)](_0x443d80)||_0x443d80;_0x2039f7['goal']?.['segment']&&(_0x2039f7[_0x274e75(0x16c)][_0x274e75(0x1c0)]=_0x43d99b(_0x2039f7[_0x274e75(0x16c)][_0x274e75(0x1c0)]));const _0x210c54=_0x147e86=>{const _0x39ec43=_0x274e75;for(const _0x3b6114 of _0x147e86){_0x3b6114[_0x39ec43(0x1ad)]?.['segment']&&(_0x3b6114[_0x39ec43(0x1ad)][_0x39ec43(0x1c0)]=_0x43d99b(_0x3b6114['entry_criteria'][_0x39ec43(0x1c0)]));if(_0x3b6114['exit_criteria'])for(const _0x4d26ea of _0x3b6114[_0x39ec43(0x1af)]){_0x4d26ea[_0x39ec43(0x1c0)]&&(_0x4d26ea[_0x39ec43(0x1c0)]=_0x43d99b(_0x4d26ea['segment']));}_0x3b6114['milestone']?.[_0x39ec43(0x1c0)]&&(_0x3b6114[_0x39ec43(0x1a2)][_0x39ec43(0x1c0)]=_0x43d99b(_0x3b6114[_0x39ec43(0x1a2)][_0x39ec43(0x1c0)]));if(_0x3b6114[_0x39ec43(0x186)])for(const _0x247001 of _0x3b6114['steps']){if(_0x247001[_0x39ec43(0x213)]===_0x39ec43(0x17c)){const _0x46962e=_0x247001;for(const _0x3dea40 of _0x46962e['with']['branches']){_0x3dea40[_0x39ec43(0x1c0)]&&(_0x3dea40[_0x39ec43(0x1c0)]=_0x43d99b(_0x3dea40[_0x39ec43(0x1c0)]));}}else{if(_0x247001['type']==='wait'){const _0x569bfa=_0x247001;_0x569bfa[_0x39ec43(0x1c5)][_0x39ec43(0x1a9)]?.[_0x39ec43(0x1c0)]&&(_0x569bfa[_0x39ec43(0x1c5)][_0x39ec43(0x1a9)][_0x39ec43(0x1c0)]=_0x43d99b(_0x569bfa[_0x39ec43(0x1c5)][_0x39ec43(0x1a9)][_0x39ec43(0x1c0)]));}}}}};if(_0x2039f7[_0x274e75(0x1bc)])for(const _0x5030d6 of _0x2039f7[_0x274e75(0x1bc)]){_0x5030d6[_0x274e75(0x16c)]?.[_0x274e75(0x1c0)]&&(_0x5030d6[_0x274e75(0x16c)][_0x274e75(0x1c0)]=_0x43d99b(_0x5030d6['goal']['segment'])),_0x210c54(_0x5030d6['stages']);}_0x2039f7['stages']&&_0x210c54(_0x2039f7[_0x274e75(0x1d4)]);if(_0x2039f7[_0x274e75(0x1de)])for(const _0x5c3292 of _0x2039f7[_0x274e75(0x1de)]){_0x210c54(_0x5c3292['stages']);}}function collectActivationIdsFromJourney(_0x2595d3,_0x910b8b){const _0x49148a=a150_0x43fb,_0x35ad24=_0x1f1eb0=>{const _0x2fe264=a150_0x43fb;for(const _0x5d4c0f of _0x1f1eb0){if(_0x5d4c0f[_0x2fe264(0x186)])for(const _0x567d37 of _0x5d4c0f[_0x2fe264(0x186)]){if(_0x567d37[_0x2fe264(0x213)]===_0x2fe264(0x1ac)){const _0x251523=_0x567d37;_0x251523[_0x2fe264(0x1c5)][_0x2fe264(0x1ac)]&&/^\d+$/['test'](_0x251523[_0x2fe264(0x1c5)][_0x2fe264(0x1ac)])&&_0x910b8b[_0x2fe264(0x161)](_0x251523[_0x2fe264(0x1c5)][_0x2fe264(0x1ac)]);}}}};if(_0x2595d3[_0x49148a(0x1bc)])for(const _0x49a446 of _0x2595d3[_0x49148a(0x1bc)]){_0x35ad24(_0x49a446['stages']);}_0x2595d3['stages']&&_0x35ad24(_0x2595d3['stages']);if(_0x2595d3[_0x49148a(0x1de)])for(const _0x1668e6 of _0x2595d3[_0x49148a(0x1de)]){_0x35ad24(_0x1668e6[_0x49148a(0x1d4)]);}}function replaceActivationIdsInJourney(_0x5cb14d,_0x32e0db){const _0x234b48=a150_0x43fb,_0x1d25fd=_0x4e9ed0=>_0x32e0db['get'](_0x4e9ed0)||_0x4e9ed0,_0x5d129b=_0xbe130f=>{const _0x431114=a150_0x43fb;for(const _0x1b25a5 of _0xbe130f){if(_0x1b25a5[_0x431114(0x186)])for(const _0x150e6d of _0x1b25a5['steps']){if(_0x150e6d[_0x431114(0x213)]===_0x431114(0x1ac)){const _0x3def5d=_0x150e6d;_0x3def5d['with'][_0x431114(0x1ac)]&&(_0x3def5d[_0x431114(0x1c5)][_0x431114(0x1ac)]=_0x1d25fd(_0x3def5d[_0x431114(0x1c5)][_0x431114(0x1ac)]));}}}};if(_0x5cb14d[_0x234b48(0x1bc)])for(const _0x383760 of _0x5cb14d[_0x234b48(0x1bc)]){_0x5d129b(_0x383760[_0x234b48(0x1d4)]);}_0x5cb14d[_0x234b48(0x1d4)]&&_0x5d129b(_0x5cb14d[_0x234b48(0x1d4)]);if(_0x5cb14d[_0x234b48(0x1de)])for(const _0x3edbda of _0x5cb14d[_0x234b48(0x1de)]){_0x5d129b(_0x3edbda[_0x234b48(0x1d4)]);}}function collectJumpTargetsFromJourney(_0x99e308,_0x33afde){const _0x29e173=a150_0x43fb,_0x3adaa3=new Set(),_0x26e2fa=_0x42fd45=>{const _0x3f16b5=a150_0x43fb;for(const _0x10fce6 of _0x42fd45){if(_0x10fce6[_0x3f16b5(0x186)])for(const _0x519ff5 of _0x10fce6['steps']){if(_0x519ff5[_0x3f16b5(0x213)]==='jump'){const _0x48555f=_0x519ff5,_0x457537=_0x48555f['with'][_0x3f16b5(0x1ec)];if(_0x457537[_0x3f16b5(0x1b3)]&&_0x457537[_0x3f16b5(0x164)]&&/^\d+$/[_0x3f16b5(0x21d)](_0x457537[_0x3f16b5(0x1b3)])&&/^\d+$/[_0x3f16b5(0x21d)](_0x457537[_0x3f16b5(0x164)])){const _0x33a5cf=_0x457537[_0x3f16b5(0x1b3)]+':'+_0x457537[_0x3f16b5(0x164)];!_0x3adaa3[_0x3f16b5(0x21c)](_0x33a5cf)&&(_0x3adaa3['add'](_0x33a5cf),_0x33afde[_0x3f16b5(0x1a8)]({'journeyId':_0x457537['journey'],'stageId':_0x457537['stage']}));}}}}};if(_0x99e308[_0x29e173(0x1bc)])for(const _0x32b073 of _0x99e308[_0x29e173(0x1bc)]){_0x26e2fa(_0x32b073[_0x29e173(0x1d4)]);}_0x99e308[_0x29e173(0x1d4)]&&_0x26e2fa(_0x99e308[_0x29e173(0x1d4)]);if(_0x99e308[_0x29e173(0x1de)])for(const _0x26d24c of _0x99e308['versions']){_0x26e2fa(_0x26d24c[_0x29e173(0x1d4)]);}}function replaceJumpTargetsInJourney(_0x334149,_0x16878){const _0x4449a4=a150_0x43fb,_0x101ca7=_0x20e3c0=>{const _0x53f8d1=a150_0x43fb;for(const _0x33e2dc of _0x20e3c0){if(_0x33e2dc['steps'])for(const _0x76dd54 of _0x33e2dc[_0x53f8d1(0x186)]){if(_0x76dd54['type']==='jump'){const _0x4ced21=_0x76dd54,_0x553509=_0x4ced21[_0x53f8d1(0x1c5)][_0x53f8d1(0x1ec)],_0x55dbea=_0x553509[_0x53f8d1(0x1b3)]+':'+_0x553509['stage'],_0x4687a0=_0x16878['get'](_0x55dbea);_0x4687a0&&(_0x553509[_0x53f8d1(0x1b3)]=_0x4687a0[_0x53f8d1(0x18a)],_0x553509['stage']=_0x4687a0[_0x53f8d1(0x188)]);}}}};if(_0x334149[_0x4449a4(0x1bc)])for(const _0x4750d0 of _0x334149[_0x4449a4(0x1bc)]){_0x101ca7(_0x4750d0['stages']);}_0x334149[_0x4449a4(0x1d4)]&&_0x101ca7(_0x334149[_0x4449a4(0x1d4)]);if(_0x334149[_0x4449a4(0x1de)])for(const _0x52a010 of _0x334149[_0x4449a4(0x1de)]){_0x101ca7(_0x52a010[_0x4449a4(0x1d4)]);}}function generateReadableStepName(_0x20e9cf,_0x49a0c3){const _0x2cdca5=a150_0x43fb;if(_0x20e9cf[_0x2cdca5(0x15e)]&&_0x20e9cf['name']!==_0x20e9cf[_0x2cdca5(0x213)]){const _0xc513eb=_0x20e9cf[_0x2cdca5(0x15e)][_0x2cdca5(0x1c9)]();if(_0xc513eb&&/[a-z0-9\p{L}]/iu[_0x2cdca5(0x21d)](_0xc513eb))return _0xc513eb;}const _0x1ad19a=_0x20e9cf[_0x2cdca5(0x213)]['toLowerCase']()['replace'](/step$/i,'');return _0x1ad19a+'_'+(_0x49a0c3+0x1);}function getStepNextRefs(_0x2d66d5){const _0x4da12a=a150_0x43fb,_0x30f049=[];if(_0x2d66d5[_0x4da12a(0x1e1)])_0x30f049[_0x4da12a(0x1a8)](_0x2d66d5[_0x4da12a(0x1e1)]);if(_0x2d66d5['branches'])for(const _0x2a4639 of _0x2d66d5[_0x4da12a(0x1a5)]){if(_0x2a4639['next'])_0x30f049[_0x4da12a(0x1a8)](_0x2a4639[_0x4da12a(0x1e1)]);}if(_0x2d66d5[_0x4da12a(0x1cc)])for(const _0x439cdf of _0x2d66d5[_0x4da12a(0x1cc)]){if(_0x439cdf['next'])_0x30f049[_0x4da12a(0x1a8)](_0x439cdf[_0x4da12a(0x1e1)]);}if(_0x2d66d5[_0x4da12a(0x1e3)])for(const _0x435acd of _0x2d66d5['conditions']){if(_0x435acd[_0x4da12a(0x1e1)])_0x30f049[_0x4da12a(0x1a8)](_0x435acd[_0x4da12a(0x1e1)]);}return _0x30f049;}function parseJumpTargetDisplayName(_0x4909d2){const _0x1469e6=a150_0x43fb,_0xe20a2d=_0x4909d2[_0x1469e6(0x1f7)](/^(.+?)\s*\(([^/)]+)/);if(!_0xe20a2d)return undefined;const _0x2bb389=_0xe20a2d[0x1][_0x1469e6(0x1c9)](),_0xd351fc=_0xe20a2d[0x2][_0x1469e6(0x1c9)]();if(!_0x2bb389||!_0xd351fc)return undefined;return{'stageName':_0x2bb389,'journeyName':_0xd351fc};}function orderStepsFromRoot(_0x3fc439,_0x415d18){const _0x50208e=a150_0x43fb,_0x6e06a3=Object[_0x50208e(0x1d3)](_0x3fc439);if(_0x6e06a3['length']===0x0)return[];const _0x47e282=new Set(_0x6e06a3[_0x50208e(0x182)](([_0x58fdcf])=>_0x58fdcf)),_0x1c1bc7=new Set();for(const [,_0x101da7]of _0x6e06a3){for(const _0x84a6be of getStepNextRefs(_0x101da7)){if(_0x47e282[_0x50208e(0x21c)](_0x84a6be))_0x1c1bc7[_0x50208e(0x161)](_0x84a6be);}}let _0x5264f0=_0x415d18&&_0x47e282[_0x50208e(0x21c)](_0x415d18)?_0x415d18:undefined;if(!_0x5264f0){const _0x1fb7cd=_0x6e06a3[_0x50208e(0x184)](([_0x4e6a0a])=>!_0x1c1bc7[_0x50208e(0x21c)](_0x4e6a0a));_0x1fb7cd[_0x50208e(0x196)]>0x0?_0x5264f0=_0x1fb7cd[0x0][0x0]:_0x5264f0=_0x6e06a3[0x0][0x0];}const _0x538171=[],_0x1af064=new Set(),_0x2ba4b1=[_0x5264f0];while(_0x2ba4b1[_0x50208e(0x196)]>0x0){const _0x244aed=_0x2ba4b1['shift']();if(_0x1af064[_0x50208e(0x21c)](_0x244aed))continue;_0x1af064[_0x50208e(0x161)](_0x244aed);const _0x20eaf=_0x3fc439[_0x244aed];if(!_0x20eaf)continue;_0x538171['push']({'uuid':_0x244aed,'step':_0x20eaf});for(const _0x404df7 of getStepNextRefs(_0x20eaf)){_0x47e282[_0x50208e(0x21c)](_0x404df7)&&!_0x1af064[_0x50208e(0x21c)](_0x404df7)&&_0x2ba4b1['push'](_0x404df7);}}for(const [_0x234fc8,_0x1fe4b0]of _0x6e06a3){!_0x1af064['has'](_0x234fc8)&&_0x538171[_0x50208e(0x1a8)]({'uuid':_0x234fc8,'step':_0x1fe4b0});}return _0x538171;}function resolveStepReferences(_0x17d856,_0x4686da,_0x48824a,_0x2999f0){const _0x11c0ce=a150_0x43fb;if(_0x17d856['type']!==_0x11c0ce(0x1d7)){_0x17d856['next']&&_0x2999f0[_0x11c0ce(0x21c)](_0x17d856['next'])&&(_0x17d856[_0x11c0ce(0x1e1)]=_0x2999f0[_0x11c0ce(0x1b2)](_0x17d856['next']));const _0x5db693=_0x4686da+0x1;if(_0x5db693<_0x48824a[_0x11c0ce(0x196)]){const _0x55f3c2=_0x2999f0[_0x11c0ce(0x1b2)](_0x48824a[_0x5db693][_0x11c0ce(0x1d9)]);_0x17d856[_0x11c0ce(0x1e1)]===_0x55f3c2&&delete _0x17d856[_0x11c0ce(0x1e1)];}}if(_0x17d856[_0x11c0ce(0x213)]===_0x11c0ce(0x17c))for(const _0x2c187a of _0x17d856[_0x11c0ce(0x1c5)][_0x11c0ce(0x1a5)]){_0x2c187a[_0x11c0ce(0x1e1)]&&_0x2999f0[_0x11c0ce(0x21c)](_0x2c187a['next'])&&(_0x2c187a[_0x11c0ce(0x1e1)]=_0x2999f0[_0x11c0ce(0x1b2)](_0x2c187a[_0x11c0ce(0x1e1)]));}if(_0x17d856[_0x11c0ce(0x213)]===_0x11c0ce(0x1f3))for(const _0x4415a1 of _0x17d856[_0x11c0ce(0x1c5)][_0x11c0ce(0x1cc)]){_0x4415a1['next']&&_0x2999f0[_0x11c0ce(0x21c)](_0x4415a1['next'])&&(_0x4415a1[_0x11c0ce(0x1e1)]=_0x2999f0[_0x11c0ce(0x1b2)](_0x4415a1[_0x11c0ce(0x1e1)]));}if(_0x17d856[_0x11c0ce(0x213)]===_0x11c0ce(0x20f)&&_0x17d856[_0x11c0ce(0x1c5)]['condition']){const _0xb0bb1b=_0x17d856[_0x11c0ce(0x1c5)][_0x11c0ce(0x1a9)];_0xb0bb1b[_0x11c0ce(0x1e1)]&&_0x2999f0['has'](_0xb0bb1b['next'])&&(_0xb0bb1b['next']=_0x2999f0['get'](_0xb0bb1b[_0x11c0ce(0x1e1)])),_0xb0bb1b[_0x11c0ce(0x1b7)]?.[_0x11c0ce(0x1e1)]&&_0x2999f0[_0x11c0ce(0x21c)](_0xb0bb1b['timeout'][_0x11c0ce(0x1e1)])&&(_0xb0bb1b['timeout'][_0x11c0ce(0x1e1)]=_0x2999f0[_0x11c0ce(0x1b2)](_0xb0bb1b[_0x11c0ce(0x1b7)]['next']));}}function convertApiStageToYaml(_0x22e955){const _0x2fad78=a150_0x43fb,_0x4b8b95={'name':_0x22e955[_0x2fad78(0x15e)]};_0x22e955['id']&&(_0x4b8b95['id']=_0x22e955['id']);_0x22e955[_0x2fad78(0x1fb)]&&(_0x4b8b95[_0x2fad78(0x1fb)]=_0x22e955[_0x2fad78(0x1fb)]);_0x22e955[_0x2fad78(0x16b)]&&(_0x4b8b95[_0x2fad78(0x1ad)]=convertApiCriteriaToYaml(_0x22e955[_0x2fad78(0x16b)]));_0x22e955['exitCriterias']&&_0x22e955[_0x2fad78(0x171)][_0x2fad78(0x196)]>0x0&&(_0x4b8b95[_0x2fad78(0x1af)]=_0x22e955[_0x2fad78(0x171)][_0x2fad78(0x182)](convertApiCriteriaToYaml));_0x22e955[_0x2fad78(0x1a2)]&&(_0x4b8b95[_0x2fad78(0x1a2)]=convertApiCriteriaToYaml(_0x22e955[_0x2fad78(0x1a2)]));if(_0x22e955[_0x2fad78(0x186)]&&Object[_0x2fad78(0x1ce)](_0x22e955[_0x2fad78(0x186)])['length']>0x0){const _0xabeef1=orderStepsFromRoot(_0x22e955['steps'],_0x22e955['rootStep']),_0x47100c=new Map(),_0x3e3b5e=new Set();for(let _0x18f23f=0x0;_0x18f23f<_0xabeef1[_0x2fad78(0x196)];_0x18f23f++){const {uuid:_0x35d657,step:_0x49155e}=_0xabeef1[_0x18f23f];let _0x73d221=generateReadableStepName(_0x49155e,_0x18f23f),_0x45d56d=_0x73d221,_0x4712a7=0x2;while(_0x3e3b5e['has'](_0x45d56d)){_0x45d56d=_0x73d221+'_'+_0x4712a7,_0x4712a7++;}_0x3e3b5e['add'](_0x45d56d),_0x47100c['set'](_0x35d657,_0x45d56d);}_0x4b8b95['steps']=_0xabeef1[_0x2fad78(0x182)](({uuid:_0x434f25,step:_0x54a06e},_0x52bd10)=>{const _0x2e95f4=_0x2fad78,_0x21716f=convertApiStepToYaml(_0x54a06e,_0x47100c[_0x2e95f4(0x1b2)](_0x434f25));return resolveStepReferences(_0x21716f,_0x52bd10,_0xabeef1,_0x47100c),_0x21716f;});}return _0x4b8b95;}function convertApiCriteriaToYaml(_0x2e8bae){const _0x26ec38=a150_0x43fb,_0x3e12c5={'name':_0x2e8bae[_0x26ec38(0x15e)],'segment':_0x2e8bae['segmentId']};_0x2e8bae[_0x26ec38(0x1fb)]&&(_0x3e12c5[_0x26ec38(0x1fb)]=_0x2e8bae['description']);if(_0x2e8bae[_0x26ec38(0x1ec)]){let _0x1dae96=_0x2e8bae[_0x26ec38(0x1ec)]['journeyId'],_0x518444=_0x2e8bae[_0x26ec38(0x1ec)][_0x26ec38(0x1cf)];if(_0x2e8bae[_0x26ec38(0x1ec)][_0x26ec38(0x18a)]){const _0x1761ba=parseJumpTargetDisplayName(_0x2e8bae['target'][_0x26ec38(0x18a)]);_0x1761ba&&(_0x518444=_0x1761ba[_0x26ec38(0x188)],_0x1dae96=_0x1761ba[_0x26ec38(0x18a)]);}_0x3e12c5[_0x26ec38(0x1ec)]={'journey':_0x1dae96,'stage':_0x518444},_0x2e8bae[_0x26ec38(0x1ec)]['journeyBundleId']&&(_0x3e12c5[_0x26ec38(0x1ec)][_0x26ec38(0x1e4)]=_0x2e8bae[_0x26ec38(0x1ec)][_0x26ec38(0x170)]);}return _0x3e12c5;}function convertApiStepToYaml(_0x2644d2,_0x3b27de){const _0x55e75c=a150_0x43fb;switch(_0x2644d2[_0x55e75c(0x213)]){case _0x55e75c(0x1f1):{const _0xbde687={};if(_0x2644d2[_0x55e75c(0x179)]===_0x55e75c(0x1f5)&&_0x2644d2[_0x55e75c(0x17d)]!==undefined)_0xbde687[_0x55e75c(0x1d2)]=_0x2644d2[_0x55e75c(0x17d)],_0xbde687[_0x55e75c(0x1c4)]=_0x2644d2[_0x55e75c(0x18e)];else{if(_0x2644d2[_0x55e75c(0x179)]===_0x55e75c(0x1a6)&&_0x2644d2[_0x55e75c(0x17a)])_0xbde687[_0x55e75c(0x1d0)]=_0x2644d2[_0x55e75c(0x17a)];else{if(_0x2644d2['waitStepType']==='DaysOfTheWeek'&&_0x2644d2['daysOfWeek'])_0xbde687[_0x55e75c(0x192)]=_0x2644d2['daysOfWeek'];else{if(_0x2644d2[_0x55e75c(0x179)]===_0x55e75c(0x21b)){if(_0x2644d2[_0x55e75c(0x1e3)]&&_0x2644d2[_0x55e75c(0x1e3)][_0x55e75c(0x196)]>0x0){const _0x3ba653=_0x2644d2['conditions']['find'](_0xaf8d55=>!_0xaf8d55[_0x55e75c(0x214)]),_0x198a9a=_0x2644d2[_0x55e75c(0x1e3)]['find'](_0x188e81=>_0x188e81['timedOutPath']);_0x3ba653?.['segmentId']&&(_0xbde687[_0x55e75c(0x1a9)]={'segment':_0x3ba653['segmentId'],..._0x3ba653[_0x55e75c(0x1e1)]?{'next':_0x3ba653['next']}:{}},_0x198a9a&&_0x198a9a[_0x55e75c(0x15c)]!==undefined&&_0x198a9a[_0x55e75c(0x1c4)]&&(_0xbde687[_0x55e75c(0x1a9)][_0x55e75c(0x1b7)]={'duration':_0x198a9a[_0x55e75c(0x15c)],'unit':_0x198a9a[_0x55e75c(0x1c4)],..._0x198a9a['next']?{'next':_0x198a9a[_0x55e75c(0x1e1)]}:{}}));}else _0x2644d2['conditionSegmentId']&&(_0xbde687[_0x55e75c(0x1a9)]={'segment':_0x2644d2[_0x55e75c(0x215)]},_0x2644d2['conditionTimeoutDuration']!==undefined&&_0x2644d2[_0x55e75c(0x17e)]&&(_0xbde687['condition']['timeout']={'duration':_0x2644d2[_0x55e75c(0x195)],'unit':_0x2644d2[_0x55e75c(0x17e)]}));}}}}const _0x63e6fe={'type':_0x55e75c(0x20f),'name':_0x3b27de,..._0x2644d2['next']?{'next':_0x2644d2[_0x55e75c(0x1e1)]}:{},'with':_0xbde687};return _0x63e6fe;}case'Activation':{const _0x31a977={'type':'activation','name':_0x3b27de,..._0x2644d2[_0x55e75c(0x1e1)]?{'next':_0x2644d2[_0x55e75c(0x1e1)]}:{},'with':{'activation':_0x2644d2[_0x55e75c(0x1c2)]||''}};return _0x31a977;}case'DecisionPoint':{const _0x547293={'type':_0x55e75c(0x17c),'name':_0x3b27de,..._0x2644d2[_0x55e75c(0x1e1)]?{'next':_0x2644d2['next']}:{},'with':{'branches':(_0x2644d2['branches']||[])[_0x55e75c(0x182)](_0x62e4cf=>({'name':_0x62e4cf[_0x55e75c(0x15e)],'segment':_0x62e4cf['segmentId'],'excluded':_0x62e4cf[_0x55e75c(0x1f6)],..._0x62e4cf[_0x55e75c(0x1e1)]?{'next':_0x62e4cf[_0x55e75c(0x1e1)]}:{}}))}};return _0x547293;}case'ABTest':case _0x55e75c(0x199):case _0x55e75c(0x1ab):{const _0x46bbff=_0x2644d2['variants']||(_0x2644d2[_0x55e75c(0x1a5)]||[])[_0x55e75c(0x182)](_0xf04a10=>({'name':_0xf04a10[_0x55e75c(0x15e)],'percentage':0x0,'next':_0xf04a10[_0x55e75c(0x1e1)]})),_0x361633={'type':_0x55e75c(0x1f3),'name':_0x3b27de,..._0x2644d2[_0x55e75c(0x1e1)]?{'next':_0x2644d2['next']}:{},'with':{'customized_split':_0x2644d2[_0x55e75c(0x16f)],'unique_id':_0x2644d2[_0x55e75c(0x187)],'variants':_0x46bbff[_0x55e75c(0x182)](_0x5dd3b5=>({'name':_0x5dd3b5[_0x55e75c(0x15e)],'percentage':_0x5dd3b5['percentage'],..._0x5dd3b5[_0x55e75c(0x1e1)]?{'next':_0x5dd3b5[_0x55e75c(0x1e1)]}:{}}))}};return _0x361633;}case _0x55e75c(0x1b8):{const _0x2c7f11={'type':'merge','name':_0x3b27de,..._0x2644d2['next']?{'next':_0x2644d2[_0x55e75c(0x1e1)]}:{}};return _0x2c7f11;}case'Jump':{let _0x5474be='',_0x5ad88f='',_0x29f9b4;if(_0x2644d2['target']){_0x5474be=_0x2644d2['target']['journeyId'],_0x5ad88f=_0x2644d2[_0x55e75c(0x1ec)][_0x55e75c(0x1cf)],_0x29f9b4=_0x2644d2[_0x55e75c(0x1ec)][_0x55e75c(0x170)];if(_0x2644d2['target'][_0x55e75c(0x18a)]){const _0x1a60e9=parseJumpTargetDisplayName(_0x2644d2[_0x55e75c(0x1ec)][_0x55e75c(0x18a)]);_0x1a60e9&&(_0x5ad88f=_0x1a60e9['stageName'],_0x5474be=_0x1a60e9[_0x55e75c(0x18a)]);}}const _0x5606ac={'type':'jump','name':_0x3b27de,..._0x2644d2[_0x55e75c(0x1e1)]?{'next':_0x2644d2[_0x55e75c(0x1e1)]}:{},'with':{'target':{'journey':_0x5474be,'stage':_0x5ad88f,..._0x29f9b4?{'bundle_id':_0x29f9b4}:{}}}};return _0x5606ac;}case _0x55e75c(0x1bf):{const _0x5134a7={'type':_0x55e75c(0x1d7),'name':_0x3b27de};return _0x5134a7;}default:{const _0x582566={'type':_0x55e75c(0x1d7),'name':_0x3b27de};return _0x582566;}}}export async function journeyDefToRequest(_0x3b618,_0x5d2c37,_0x59b1d2){const _0x57beb1=a150_0x43fb,_0x3f9edb=_0x3b618[_0x57beb1(0x1d4)]||getActiveStages(_0x3b618),_0x4d01ec=isJourneysArrayMode(_0x3b618)||isMultiVersionMode(_0x3b618)?getLatestJourneyEntry(_0x3b618):undefined,_0x4cfd35=_0x4d01ec?.[_0x57beb1(0x1ff)]??_0x3b618[_0x57beb1(0x15e)],_0xb004d=_0x3b618['segments']||{},_0x3e8add=_0x3b618[_0x57beb1(0x175)]||{},_0x145a93={'type':'journey','attributes':{'name':_0x4cfd35,'audienceId':_0x5d2c37,'journeyStages':await Promise['all'](_0x3f9edb['map'](_0x3e255b=>convertYamlStageToApi(_0x3e255b,_0x59b1d2,_0xb004d,_0x3e8add)))}},_0x4cb136=_0x4d01ec?.['id']??_0x3b618['id'];_0x4cb136&&(_0x145a93['id']=_0x4cb136);_0x3b618['description']&&(_0x145a93[_0x57beb1(0x1da)]['description']=_0x3b618[_0x57beb1(0x1fb)]);const _0x5868b6=getEffectiveGoal(_0x3b618);_0x5868b6&&(_0x145a93['attributes'][_0x57beb1(0x16c)]=await convertYamlCriteriaToApi(_0x5868b6,_0x59b1d2,_0xb004d));const _0x126960=getEffectiveReentry(_0x3b618);return _0x126960&&(_0x145a93['attributes'][_0x57beb1(0x1ba)]=_0x126960,_0x145a93[_0x57beb1(0x1da)][_0x57beb1(0x1f0)]=_0x126960!==_0x57beb1(0x1b4)),_0x3b618[_0x57beb1(0x216)]&&(_0x145a93['relationships']={'parentFolder':{'data':{'id':_0x3b618[_0x57beb1(0x216)],'type':'folder'}}}),_0x145a93;}async function convertYamlStageToApi(_0x103e1f,_0x4da3e8,_0x454821={},_0x275f68={}){const _0x18be03=a150_0x43fb,_0x23f8df={'name':_0x103e1f['name']};_0x103e1f['id']&&(_0x23f8df['id']=_0x103e1f['id']);_0x103e1f['description']&&(_0x23f8df[_0x18be03(0x1fb)]=_0x103e1f['description']);_0x103e1f[_0x18be03(0x1ad)]&&(_0x23f8df['entryCriteria']=await convertYamlCriteriaToApi(_0x103e1f[_0x18be03(0x1ad)],_0x4da3e8,_0x454821));_0x103e1f[_0x18be03(0x1af)]&&_0x103e1f[_0x18be03(0x1af)][_0x18be03(0x196)]>0x0&&(_0x23f8df[_0x18be03(0x171)]=await Promise[_0x18be03(0x1dd)](_0x103e1f[_0x18be03(0x1af)]['map'](_0x34e544=>convertYamlCriteriaToApi(_0x34e544,_0x4da3e8,_0x454821))));_0x103e1f['milestone']&&(_0x23f8df[_0x18be03(0x1a2)]=await convertYamlCriteriaToApi(_0x103e1f[_0x18be03(0x1a2)],_0x4da3e8,_0x454821));if(_0x103e1f[_0x18be03(0x186)]&&_0x103e1f[_0x18be03(0x186)][_0x18be03(0x196)]>0x0){const _0x19379a={},_0x3f2fde=_0x103e1f[_0x18be03(0x186)][_0x18be03(0x182)]((_0xc97fee,_0x2637c3)=>{const _0x328b1c=_0x18be03,_0x2edf38=_0xc97fee[_0x328b1c(0x1d9)]||generateUUID(),_0xa1b943=_0xc97fee[_0x328b1c(0x15e)]||_0xc97fee[_0x328b1c(0x213)]+'_'+_0x2637c3;return _0x19379a[_0xa1b943]=_0x2edf38,{..._0xc97fee,'name':_0xa1b943};});_0x23f8df[_0x18be03(0x190)]=_0x19379a[_0x3f2fde[0x0][_0x18be03(0x15e)]],_0x23f8df[_0x18be03(0x186)]={};for(let _0x1ada29=0x0;_0x1ada29<_0x3f2fde[_0x18be03(0x196)];_0x1ada29++){const _0x184077=_0x3f2fde[_0x1ada29],_0x4ccc94=_0x19379a[_0x184077[_0x18be03(0x15e)]],_0x52fa1c=!_0x184077[_0x18be03(0x1e1)]&&_0x1ada29<_0x3f2fde[_0x18be03(0x196)]-0x1&&_0x184077[_0x18be03(0x213)]!=='end'?_0x3f2fde[_0x1ada29+0x1]['name']:_0x184077['next'],_0x36eaba=_0x52fa1c!==_0x184077['next']?{..._0x184077,'next':_0x52fa1c}:_0x184077;_0x23f8df[_0x18be03(0x186)][_0x4ccc94]=await convertYamlStepToApi(_0x36eaba,_0x4da3e8,_0x454821,_0x19379a,_0x275f68);}}else _0x103e1f[_0x18be03(0x178)]&&(_0x23f8df[_0x18be03(0x190)]=_0x103e1f[_0x18be03(0x178)]);return _0x23f8df;}async function convertYamlCriteriaToApi(_0x577443,_0x5c52aa,_0x24b4d8={}){const _0x1cf33e=a150_0x43fb;let _0x3efa82=_0x577443[_0x1cf33e(0x1c0)];if(_0x3efa82&&!/^\d+$/['test'](_0x3efa82)){const _0x80ef37=parseSegmentRef(_0x3efa82);if(_0x80ef37[_0x1cf33e(0x213)]==='ref')_0x5c52aa?.['resolveSegmentId']&&(_0x3efa82=await _0x5c52aa[_0x1cf33e(0x1ae)](_0x80ef37[_0x1cf33e(0x15e)]));else{if(_0x80ef37['type']===_0x1cf33e(0x180)&&_0x24b4d8[_0x80ef37[_0x1cf33e(0x15e)]])_0x5c52aa?.[_0x1cf33e(0x177)]&&(_0x3efa82=await _0x5c52aa[_0x1cf33e(0x177)](_0x80ef37[_0x1cf33e(0x15e)],_0x24b4d8[_0x80ef37[_0x1cf33e(0x15e)]]));else _0x5c52aa?.[_0x1cf33e(0x1ae)]&&(_0x3efa82=await _0x5c52aa[_0x1cf33e(0x1ae)](_0x80ef37[_0x1cf33e(0x15e)]));}}const _0x2e26ce={'name':_0x577443[_0x1cf33e(0x15e)],'segmentId':_0x3efa82};_0x577443[_0x1cf33e(0x1fb)]&&(_0x2e26ce[_0x1cf33e(0x1fb)]=_0x577443[_0x1cf33e(0x1fb)]);if(_0x577443['target']){const _0x2e7bd0=_0x577443[_0x1cf33e(0x1ec)][_0x1cf33e(0x1b3)],_0x24f693=_0x577443[_0x1cf33e(0x1ec)][_0x1cf33e(0x164)];let _0x463c1b=_0x577443[_0x1cf33e(0x1ec)][_0x1cf33e(0x1b3)];_0x5c52aa?.[_0x1cf33e(0x1aa)]&&!/^\d+$/['test'](_0x463c1b)&&(_0x463c1b=await _0x5c52aa[_0x1cf33e(0x1aa)](_0x463c1b));let _0x15e86e=_0x577443[_0x1cf33e(0x1ec)][_0x1cf33e(0x164)];_0x5c52aa?.[_0x1cf33e(0x1f2)]&&!/^\d+$/['test'](_0x15e86e)&&(_0x15e86e=await _0x5c52aa[_0x1cf33e(0x1f2)](_0x463c1b,_0x15e86e));const _0xeff91e=!/^\d+$/['test'](_0x2e7bd0)&&!isLocalJourneyRef(_0x2e7bd0)?formatApiJourneyName(_0x2e7bd0,_0x24f693):undefined;_0x2e26ce[_0x1cf33e(0x1ec)]={'journeyId':_0x463c1b,'journeyStageId':_0x15e86e,'journeyName':_0xeff91e,'confirmed':!![]},_0x577443['target'][_0x1cf33e(0x1e4)]&&(_0x2e26ce[_0x1cf33e(0x1ec)][_0x1cf33e(0x170)]=_0x577443[_0x1cf33e(0x1ec)][_0x1cf33e(0x1e4)]);}return _0x2e26ce;}async function convertYamlStepToApi(_0x580d76,_0x17e1c2,_0x5b4cc3={},_0x2f492f={},_0x92d818={}){const _0x115a4a=a150_0x43fb,_0x45ae78=async _0x436479=>{const _0x346635=a150_0x43fb;if(/^\d+$/[_0x346635(0x21d)](_0x436479))return _0x436479;const _0x3dae1f=parseSegmentRef(_0x436479);if(_0x3dae1f[_0x346635(0x213)]===_0x346635(0x19d)){if(_0x17e1c2?.[_0x346635(0x1ae)])return await _0x17e1c2['resolveSegmentId'](_0x3dae1f[_0x346635(0x15e)]);}else{if(_0x3dae1f[_0x346635(0x213)]===_0x346635(0x180)&&_0x5b4cc3[_0x3dae1f[_0x346635(0x15e)]]){if(_0x17e1c2?.[_0x346635(0x177)])return await _0x17e1c2['resolveEmbeddedSegmentId'](_0x3dae1f[_0x346635(0x15e)],_0x5b4cc3[_0x3dae1f[_0x346635(0x15e)]]);}else{if(_0x17e1c2?.[_0x346635(0x1ae)])return await _0x17e1c2[_0x346635(0x1ae)](_0x3dae1f[_0x346635(0x15e)]);}}return _0x436479;},_0x543c21=async _0x3a0e8a=>{const _0x117fe4=a150_0x43fb;if(/^\d+$/[_0x117fe4(0x21d)](_0x3a0e8a))return _0x3a0e8a;const _0x1bb6ab=parseSegmentRef(_0x3a0e8a);if(_0x1bb6ab[_0x117fe4(0x213)]===_0x117fe4(0x19d)){if(_0x17e1c2?.[_0x117fe4(0x1c8)])return await _0x17e1c2[_0x117fe4(0x1c8)](_0x1bb6ab[_0x117fe4(0x15e)]);return _0x1bb6ab[_0x117fe4(0x15e)];}else{if(_0x1bb6ab[_0x117fe4(0x213)]===_0x117fe4(0x180)&&_0x92d818[_0x1bb6ab['name']]){if(_0x17e1c2?.[_0x117fe4(0x193)])return await _0x17e1c2[_0x117fe4(0x193)](_0x1bb6ab[_0x117fe4(0x15e)],_0x92d818[_0x1bb6ab['name']]);if(_0x17e1c2?.[_0x117fe4(0x1c8)])return await _0x17e1c2[_0x117fe4(0x1c8)](_0x1bb6ab[_0x117fe4(0x15e)]);}else{if(_0x17e1c2?.[_0x117fe4(0x1c8)])return await _0x17e1c2[_0x117fe4(0x1c8)](_0x1bb6ab[_0x117fe4(0x15e)]);}}return _0x3a0e8a;},_0x3894d3=_0x4103b4=>{if(!_0x4103b4)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i['test'](_0x4103b4))return _0x4103b4;return _0x2f492f[_0x4103b4]||_0x4103b4;};switch(_0x580d76[_0x115a4a(0x213)]){case _0x115a4a(0x20f):{const _0x4b71b7=_0x580d76,_0x2454ed=_0x4b71b7[_0x115a4a(0x1c5)],_0x26fd74={'type':_0x115a4a(0x1f1),'name':_0x4b71b7[_0x115a4a(0x15e)],'next':_0x3894d3(_0x4b71b7[_0x115a4a(0x1e1)])};if(_0x2454ed['duration']!==undefined&&_0x2454ed['unit'])_0x26fd74[_0x115a4a(0x179)]='Duration',_0x26fd74['waitStep']=_0x2454ed[_0x115a4a(0x1d2)],_0x26fd74['waitStepUnit']=normalizeWaitUnit(_0x2454ed[_0x115a4a(0x1c4)]);else{if(_0x2454ed[_0x115a4a(0x1d0)])_0x26fd74[_0x115a4a(0x179)]=_0x115a4a(0x1a6),_0x26fd74[_0x115a4a(0x17a)]=_0x2454ed['wait_until'];else{if(_0x2454ed[_0x115a4a(0x192)])_0x26fd74[_0x115a4a(0x179)]=_0x115a4a(0x163),_0x26fd74[_0x115a4a(0x217)]=_0x2454ed[_0x115a4a(0x192)];else{if(_0x2454ed[_0x115a4a(0x1a9)]){_0x26fd74[_0x115a4a(0x179)]=_0x115a4a(0x21b);const _0x565782=await _0x45ae78(_0x2454ed[_0x115a4a(0x1a9)]['segment']),_0x33b2c6=_0x2454ed[_0x115a4a(0x1a9)][_0x115a4a(0x1b7)]?.['next']!==undefined;if(_0x33b2c6){const _0x24fd35=[];_0x24fd35[_0x115a4a(0x1a8)]({'id':generateUUID(),'segmentId':_0x565782,'timedOutPath':![],'name':_0x115a4a(0x18b),'next':_0x3894d3(_0x2454ed[_0x115a4a(0x1a9)]['next']??_0x4b71b7[_0x115a4a(0x1e1)])});if(_0x2454ed[_0x115a4a(0x1a9)]['timeout']){const _0x28416d=_0x2454ed['condition'][_0x115a4a(0x1b7)][_0x115a4a(0x1d2)],_0xc074f7=normalizeWaitUnit(_0x2454ed[_0x115a4a(0x1a9)][_0x115a4a(0x1b7)][_0x115a4a(0x1c4)]);_0x24fd35[_0x115a4a(0x1a8)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x115a4a(0x176)+_0x28416d+'\x20'+_0xc074f7,'moveAfter':_0x28416d,'unit':_0xc074f7,'next':_0x3894d3(_0x2454ed[_0x115a4a(0x1a9)][_0x115a4a(0x1b7)][_0x115a4a(0x1e1)])});}_0x26fd74[_0x115a4a(0x1e3)]=_0x24fd35,delete _0x26fd74[_0x115a4a(0x1e1)];}else _0x26fd74['conditionSegmentId']=_0x565782,_0x2454ed[_0x115a4a(0x1a9)][_0x115a4a(0x1b7)]&&(_0x26fd74['conditionTimeoutDuration']=_0x2454ed[_0x115a4a(0x1a9)][_0x115a4a(0x1b7)][_0x115a4a(0x1d2)],_0x2454ed[_0x115a4a(0x1a9)]['timeout'][_0x115a4a(0x1c4)]&&(_0x26fd74[_0x115a4a(0x17e)]=normalizeWaitUnit(_0x2454ed['condition']['timeout'][_0x115a4a(0x1c4)])));}}}}return _0x26fd74;}case _0x115a4a(0x1ac):{const _0x2ac622=_0x580d76,_0x2af198=_0x2ac622[_0x115a4a(0x1c5)]['activation'],_0x210e86=await _0x543c21(_0x2af198);return{'type':_0x115a4a(0x19c),'name':_0x2ac622[_0x115a4a(0x15e)],'journeyActivationStepId':_0x210e86,'next':_0x3894d3(_0x2ac622['next'])};}case _0x115a4a(0x17c):{const _0x5b8a82=_0x580d76,_0x206461=_0x5b8a82[_0x115a4a(0x1c5)][_0x115a4a(0x1a5)];return{'type':_0x115a4a(0x166),'name':_0x5b8a82[_0x115a4a(0x15e)],'branches':await Promise[_0x115a4a(0x1dd)](_0x206461['map'](async _0x4494eb=>{const _0x1d4bcc=_0x115a4a;let _0x3dd5fd='';if(!_0x4494eb[_0x1d4bcc(0x1eb)]){const _0x46776b=_0x4494eb[_0x1d4bcc(0x1c0)]||_0x4494eb[_0x1d4bcc(0x1b0)]||'';_0x3dd5fd=_0x46776b?await _0x45ae78(_0x46776b):'';}return{'id':crypto[_0x1d4bcc(0x21f)](),'name':_0x4494eb[_0x1d4bcc(0x15e)],'description':null,'segmentId':_0x3dd5fd,'excludedPath':_0x4494eb[_0x1d4bcc(0x1eb)]??![],'next':_0x3894d3(_0x4494eb[_0x1d4bcc(0x1e1)])};})),'next':_0x3894d3(_0x5b8a82[_0x115a4a(0x1e1)])};}case _0x115a4a(0x1f3):{const _0x3bdfa7=_0x580d76,_0x16a960=_0x3bdfa7[_0x115a4a(0x1c5)];return{'type':_0x115a4a(0x160),'name':_0x3bdfa7[_0x115a4a(0x15e)],'customizedSplit':_0x16a960['customized_split'],'uniqueId':_0x16a960['unique_id'],'variants':_0x16a960['variants'][_0x115a4a(0x182)](_0x367455=>({'id':_0x367455['id']||generateUUID(),'name':_0x367455[_0x115a4a(0x15e)],'percentage':_0x367455[_0x115a4a(0x1e8)],'next':_0x3894d3(_0x367455[_0x115a4a(0x1e1)])})),'next':_0x3894d3(_0x3bdfa7[_0x115a4a(0x1e1)])};}case _0x115a4a(0x1db):return{'type':_0x115a4a(0x1b8),'name':_0x580d76[_0x115a4a(0x15e)],'next':_0x3894d3(_0x580d76[_0x115a4a(0x1e1)])};case _0x115a4a(0x172):{const _0x5dc2ba=_0x580d76,_0x231fc1=_0x5dc2ba['with'][_0x115a4a(0x1ec)],_0x2088e5=_0x231fc1[_0x115a4a(0x1b3)],_0x1bb398=_0x231fc1[_0x115a4a(0x164)];let _0x43aed3=_0x231fc1['journey'];_0x17e1c2?.[_0x115a4a(0x1aa)]&&!/^\d+$/[_0x115a4a(0x21d)](_0x43aed3)&&(_0x43aed3=await _0x17e1c2[_0x115a4a(0x1aa)](_0x43aed3));let _0x485300=_0x231fc1[_0x115a4a(0x164)];_0x17e1c2?.[_0x115a4a(0x1f2)]&&!/^\d+$/[_0x115a4a(0x21d)](_0x485300)&&(_0x485300=await _0x17e1c2[_0x115a4a(0x1f2)](_0x43aed3,_0x485300));const _0x59c338=!/^\d+$/[_0x115a4a(0x21d)](_0x2088e5)&&!isLocalJourneyRef(_0x2088e5)?formatApiJourneyName(_0x2088e5,_0x1bb398):undefined;return{'type':_0x115a4a(0x1e7),'name':_0x5dc2ba[_0x115a4a(0x15e)],'target':{'journeyId':_0x43aed3,'journeyStageId':_0x485300,'journeyBundleId':_0x231fc1[_0x115a4a(0x1e4)],'journeyName':_0x59c338,'confirmed':!![]},'next':_0x3894d3(_0x5dc2ba[_0x115a4a(0x1e1)])};}case _0x115a4a(0x1d7):return{'type':_0x115a4a(0x1bf),'name':_0x580d76[_0x115a4a(0x15e)]};default:{const _0x25d4ff=_0x580d76;return{'type':_0x115a4a(0x1bf),'name':_0x25d4ff[_0x115a4a(0x15e)]};}}}export function toYamlString(_0x3f9cba){const _0x5d70fa=a150_0x43fb,_0x3485f7=stripInternalFields(_0x3f9cba),_0x4fff74=a150_0xd81d27[_0x5d70fa(0x1b1)](_0x3485f7,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x5d70fa(0x1d6)}),_0x452079=[_0x5d70fa(0x1d5),_0x5d70fa(0x1fe),'goal:',_0x5d70fa(0x204),_0x5d70fa(0x1e0),'stages:','versions:'];let _0xa1e65b=_0x4fff74;for(const _0x5566a2 of _0x452079){_0xa1e65b=_0xa1e65b['replace'](new RegExp('^('+_0x5566a2+')','m'),(_0x247119,_0x48d0ae,_0x16fb48)=>{if(_0x16fb48===0x0||_0xa1e65b[_0x16fb48-0x1]==='\x0a'&&_0xa1e65b[_0x16fb48-0x2]==='\x0a')return _0x48d0ae;return'\x0a'+_0x48d0ae;});}return _0xa1e65b;}function stripInternalFields(_0x59d2d4){const _0x30386a=a150_0x43fb,{id:_0x35ae1c,folder_id:_0x205f38,bundle_id:_0x182cbf,bundle_name:_0x100467,version:_0x35abb9,allow_reentry:_0x27c105,..._0x2e7e6f}=_0x59d2d4;return _0x2e7e6f[_0x30386a(0x1bc)]&&(_0x2e7e6f[_0x30386a(0x1bc)]=_0x2e7e6f[_0x30386a(0x1bc)][_0x30386a(0x182)](_0x55ccee=>{const _0x5a98ad=_0x30386a,{id:_0x1d2be6,..._0xa3568a}=_0x55ccee;return{..._0xa3568a,'stages':_0xa3568a['stages'][_0x5a98ad(0x182)](stripStageInternalFields),..._0x55ccee[_0x5a98ad(0x174)]===!![]?{'latest':!![]}:{},..._0x2e7e6f[_0x5a98ad(0x1bc)][_0x5a98ad(0x196)]===0x1&&_0xa3568a[_0x5a98ad(0x1ff)]==='v1'?{'version':undefined}:{}};})),_0x2e7e6f[_0x30386a(0x1d4)]&&(_0x2e7e6f[_0x30386a(0x1d4)]=_0x2e7e6f[_0x30386a(0x1d4)][_0x30386a(0x182)](stripStageInternalFields)),_0x2e7e6f[_0x30386a(0x1de)]&&(_0x2e7e6f[_0x30386a(0x1de)]=_0x2e7e6f[_0x30386a(0x1de)]['map'](_0x26fa71=>{const _0x15b356=_0x30386a,{id:_0x19c1ce,..._0x577666}=_0x26fa71;return{..._0x577666,'stages':_0x577666['stages']['map'](stripStageInternalFields),..._0x26fa71[_0x15b356(0x174)]===!![]?{'latest':!![]}:{}};})),_0x2e7e6f;}function stripStageInternalFields(_0x1bd323){const {id:_0x1d51f2,..._0x486c7c}=_0x1bd323;return _0x486c7c;}export function parseYamlString(_0x580fe4){return safeParseYaml(_0x580fe4,JourneyDefSchema);}export function isJourneyDef(_0x415ece){const _0x8d89cf=a150_0x43fb;return typeof _0x415ece===_0x8d89cf(0x21a)&&_0x415ece!==null&&_0x8d89cf(0x213)in _0x415ece&&_0x415ece[_0x8d89cf(0x213)]==='journey';}export function generateTemplate(_0x5218b9,_0x2cdf10){const _0x1c5601=a150_0x43fb,_0x569def={'type':_0x1c5601(0x1b3),'name':_0x5218b9,'description':_0x1c5601(0x211),'reentry':_0x1c5601(0x1b4),'goal':{'name':_0x1c5601(0x21e),'segment':_0x1c5601(0x212)},'stages':[{'name':_0x1c5601(0x19b),'description':'First\x20stage\x20of\x20the\x20journey','entry_criteria':{'name':_0x1c5601(0x1dc),'segment':_0x2cdf10},'steps':[{'type':_0x1c5601(0x20f),'name':_0x1c5601(0x1ef),'with':{'duration':0x1,'unit':_0x1c5601(0x203)}},{'type':_0x1c5601(0x1ac),'name':_0x1c5601(0x191),'with':{'activation':'your-activation-name'}},{'type':_0x1c5601(0x1d7),'name':'Stage\x20Complete'}]}]};return toYamlString(_0x569def);}function generateUUID(){const _0x550829=a150_0x43fb;return crypto[_0x550829(0x21f)]();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x1a8697){const _0x3d2781=a150_0x43fb;if(_0x1a8697[_0x3d2781(0x183)](SEGMENT_REF_PREFIX))return{'type':'ref','name':_0x1a8697[_0x3d2781(0x1bb)](SEGMENT_REF_PREFIX[_0x3d2781(0x196)])};if(/^\d+$/[_0x3d2781(0x21d)](_0x1a8697))return{'type':'id','name':_0x1a8697};return{'type':_0x3d2781(0x180),'name':_0x1a8697};}export function makeSegmentRef(_0x4dc8c9){return''+SEGMENT_REF_PREFIX+_0x4dc8c9;}export function isExternalSegmentRef(_0x2217f2){const _0x311e03=a150_0x43fb;return _0x2217f2[_0x311e03(0x183)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x1e3d52){const _0x4a4d43=a150_0x43fb;return!!(_0x1e3d52[_0x4a4d43(0x1bc)]&&_0x1e3d52['journeys']['length']>0x0);}export function isMultiVersionMode(_0x58cc6b){const _0x4a425f=a150_0x43fb;return!!(_0x58cc6b[_0x4a425f(0x1de)]&&_0x58cc6b[_0x4a425f(0x1de)][_0x4a425f(0x196)]>0x0);}export function isSingleVersionMode(_0x4e6b51){const _0x3d6ddb=a150_0x43fb;return!!(_0x4e6b51[_0x3d6ddb(0x1d4)]&&_0x4e6b51[_0x3d6ddb(0x1d4)][_0x3d6ddb(0x196)]>0x0);}export function hasMultipleVersions(_0x4824a0){const _0x486542=a150_0x43fb;if(isJourneysArrayMode(_0x4824a0))return(_0x4824a0[_0x486542(0x1bc)]?.[_0x486542(0x196)]||0x0)>0x1;if(isMultiVersionMode(_0x4824a0))return(_0x4824a0[_0x486542(0x1de)]?.[_0x486542(0x196)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x5de638){const _0x5b727a=a150_0x43fb;if(isJourneysArrayMode(_0x5de638))return _0x5de638;if(isSingleVersionMode(_0x5de638)){const {stages:_0x789f37,id:_0x32e216,version:_0x24c9d6,version_number:_0x5c54cd,..._0x48257d}=_0x5de638;return{..._0x48257d,'journeys':[{'version':_0x24c9d6||'v1','stages':_0x789f37||[],'id':_0x32e216,'version_number':_0x5c54cd}]};}if(isMultiVersionMode(_0x5de638)){const {versions:_0x2bdbc1,..._0x52372d}=_0x5de638;return{..._0x52372d,'journeys':(_0x2bdbc1||[])[_0x5b727a(0x182)](_0x1a12fa=>({'version':_0x1a12fa[_0x5b727a(0x15e)],'state':_0x1a12fa[_0x5b727a(0x17f)],'latest':_0x1a12fa['latest'],'stages':_0x1a12fa[_0x5b727a(0x1d4)],'id':_0x1a12fa['id'],'version_number':_0x1a12fa['version_number']}))};}return _0x5de638;}export function normalizeJourneyDef(_0x4f4e30,_0x541148){const _0x51b6dd=a150_0x43fb,_0x25891d=normalizeToJourneysFormat(_0x4f4e30),_0x102edd=_0x541148?.[_0x51b6dd(0x1c3)]?Object['keys'](_0x541148[_0x51b6dd(0x1c3)]):undefined,_0x3484fa=_0x541148?.[_0x51b6dd(0x175)]?Object[_0x51b6dd(0x1ce)](_0x541148[_0x51b6dd(0x175)]):undefined;return{'type':_0x51b6dd(0x1b3),'name':_0x25891d[_0x51b6dd(0x15e)],..._0x25891d[_0x51b6dd(0x1fb)]!==undefined&&{'description':_0x25891d[_0x51b6dd(0x1fb)]},..._0x25891d[_0x51b6dd(0x16c)]&&{'goal':normalizeJourneyCriteria(_0x25891d['goal'])},..._0x25891d[_0x51b6dd(0x1d1)]!==undefined&&{'reentry':_0x25891d[_0x51b6dd(0x1d1)]},..._0x25891d['segments']&&{'segments':normalizeEmbeddedSegments(_0x25891d[_0x51b6dd(0x1c3)],_0x102edd)},..._0x25891d['activations']&&{'activations':normalizeEmbeddedActivations(_0x25891d[_0x51b6dd(0x175)],_0x3484fa)},..._0x25891d[_0x51b6dd(0x1bc)]&&{'journeys':_0x25891d[_0x51b6dd(0x1bc)]['map'](_0x527694=>normalizeJourneyEntry(_0x527694,_0x25891d['journeys']['length']===0x1))}};}function normalizeJourneyEntry(_0x2555af,_0x15815a){const _0x1138b2=a150_0x43fb;return{...!_0x15815a&&_0x2555af[_0x1138b2(0x1ff)]!==undefined&&{'version':_0x2555af['version']},..._0x2555af['state']!==undefined&&{'state':_0x2555af[_0x1138b2(0x17f)]},...!_0x15815a&&_0x2555af[_0x1138b2(0x174)]!==undefined&&{'latest':_0x2555af['latest']},..._0x2555af[_0x1138b2(0x173)]!==undefined&&{'version_number':_0x2555af['version_number']},..._0x2555af['goal']&&{'goal':normalizeJourneyCriteria(_0x2555af['goal'])},..._0x2555af[_0x1138b2(0x1d1)]!==undefined&&{'reentry':_0x2555af[_0x1138b2(0x1d1)]},'stages':_0x2555af[_0x1138b2(0x1d4)]['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0x32a6dd){const _0x4e6fdf=a150_0x43fb;return{'name':_0x32a6dd[_0x4e6fdf(0x15e)],..._0x32a6dd[_0x4e6fdf(0x1fb)]!==undefined&&{'description':_0x32a6dd[_0x4e6fdf(0x1fb)]},..._0x32a6dd['entry_criteria']&&{'entry_criteria':normalizeJourneyCriteria(_0x32a6dd[_0x4e6fdf(0x1ad)])},..._0x32a6dd[_0x4e6fdf(0x1af)]&&{'exit_criteria':_0x32a6dd['exit_criteria'][_0x4e6fdf(0x182)](normalizeJourneyCriteria)},..._0x32a6dd['milestone']&&{'milestone':normalizeJourneyCriteria(_0x32a6dd[_0x4e6fdf(0x1a2)])},..._0x32a6dd[_0x4e6fdf(0x186)]&&{'steps':normalizeStepsWithImplicitNext(_0x32a6dd[_0x4e6fdf(0x186)])}};}function normalizeStepsWithImplicitNext(_0x555c72){const _0x4292ec=a150_0x43fb;return _0x555c72[_0x4292ec(0x182)]((_0x1dc744,_0x4fb92c)=>{const _0x3dabbc=_0x4292ec,_0x3008dc=_0x4fb92c<_0x555c72['length']-0x1?_0x555c72[_0x4fb92c+0x1][_0x3dabbc(0x15e)]:undefined;return normalizeJourneyStep(_0x1dc744,_0x3008dc);});}function normalizeJourneyCriteria(_0x43c079){const _0x5f4e43=a150_0x43fb;return{'name':_0x43c079['name'],..._0x43c079['description']!==undefined&&{'description':_0x43c079[_0x5f4e43(0x1fb)]},'segment':_0x43c079[_0x5f4e43(0x1c0)],..._0x43c079['target']&&{'target':normalizeJumpTarget(_0x43c079[_0x5f4e43(0x1ec)])}};}function normalizeJourneyStep(_0x41504c,_0xe68832){const _0x5b6d0c=a150_0x43fb,_0x471af0=_0x41504c['next']!==undefined&&_0x41504c[_0x5b6d0c(0x1e1)]!==_0xe68832,_0x465da5={'type':_0x41504c[_0x5b6d0c(0x213)],'name':_0x41504c['name'],..._0x471af0&&{'next':_0x41504c[_0x5b6d0c(0x1e1)]}};if(_0x5b6d0c(0x1c5)in _0x41504c&&_0x41504c[_0x5b6d0c(0x1c5)])return{..._0x465da5,'with':normalizeStepParams(_0x41504c[_0x5b6d0c(0x213)],_0x41504c[_0x5b6d0c(0x1c5)])};return _0x465da5;}function normalizeStepParams(_0x5bf9e0,_0x5ec225){const _0x44c605=a150_0x43fb;switch(_0x5bf9e0){case _0x44c605(0x20f):{const _0x316a26=_0x5ec225;let _0x4f99aa;return _0x316a26[_0x44c605(0x1a9)]&&(_0x4f99aa={'segment':_0x316a26[_0x44c605(0x1a9)][_0x44c605(0x1c0)],..._0x316a26[_0x44c605(0x1a9)]['next']!==undefined&&{'next':_0x316a26[_0x44c605(0x1a9)][_0x44c605(0x1e1)]},..._0x316a26[_0x44c605(0x1a9)][_0x44c605(0x1b7)]&&{'timeout':{'duration':_0x316a26[_0x44c605(0x1a9)][_0x44c605(0x1b7)]['duration'],'unit':_0x316a26[_0x44c605(0x1a9)]['timeout']['unit'],..._0x316a26[_0x44c605(0x1a9)]['timeout'][_0x44c605(0x1e1)]!==undefined&&{'next':_0x316a26[_0x44c605(0x1a9)][_0x44c605(0x1b7)][_0x44c605(0x1e1)]}}}}),{..._0x316a26[_0x44c605(0x1d2)]!==undefined&&{'duration':_0x316a26[_0x44c605(0x1d2)]},..._0x316a26['unit']!==undefined&&{'unit':_0x316a26[_0x44c605(0x1c4)]},..._0x316a26['wait_until']!==undefined&&{'wait_until':_0x316a26[_0x44c605(0x1d0)]},..._0x316a26['days_of_week']!==undefined&&{'days_of_week':_0x316a26[_0x44c605(0x192)]},..._0x4f99aa&&{'condition':_0x4f99aa}};}case _0x44c605(0x1ac):{const _0x403f52=_0x5ec225;return{'activation':_0x403f52[_0x44c605(0x1ac)]};}case _0x44c605(0x17c):{const _0x4f635b=_0x5ec225;return{'branches':_0x4f635b['branches'][_0x44c605(0x182)](normalizeDecisionBranch)};}case _0x44c605(0x1f3):{const _0x65525f=_0x5ec225;return{..._0x65525f[_0x44c605(0x16d)]!==undefined&&{'customized_split':_0x65525f[_0x44c605(0x16d)]},..._0x65525f['unique_id']!==undefined&&{'unique_id':_0x65525f[_0x44c605(0x1c7)]},'variants':_0x65525f[_0x44c605(0x1cc)][_0x44c605(0x182)](normalizeAbTestVariant)};}case _0x44c605(0x172):{const _0xad1260=_0x5ec225;return{'target':normalizeJumpTarget(_0xad1260['target'])};}default:return _0x5ec225;}}function normalizeDecisionBranch(_0x5012b0){const _0x33a319=a150_0x43fb;return{'name':_0x5012b0[_0x33a319(0x15e)],..._0x5012b0['segment']!==undefined&&{'segment':_0x5012b0['segment']},..._0x5012b0[_0x33a319(0x1eb)]!==undefined&&{'excluded':_0x5012b0[_0x33a319(0x1eb)]},..._0x5012b0['next']!==undefined&&{'next':_0x5012b0[_0x33a319(0x1e1)]}};}function normalizeAbTestVariant(_0xdac08c){const _0x1de183=a150_0x43fb;return{..._0xdac08c['id']!==undefined&&{'id':_0xdac08c['id']},'name':_0xdac08c[_0x1de183(0x15e)],'percentage':_0xdac08c[_0x1de183(0x1e8)],..._0xdac08c['next']!==undefined&&{'next':_0xdac08c['next']}};}function normalizeJumpTarget(_0x2f4c71){const _0x380493=a150_0x43fb;return{'journey':_0x2f4c71[_0x380493(0x1b3)],'stage':_0x2f4c71[_0x380493(0x164)],..._0x2f4c71[_0x380493(0x1e4)]!==undefined&&{'bundle_id':_0x2f4c71[_0x380493(0x1e4)]}};}function normalizeEmbeddedSegments(_0x5bc0cc,_0x6a0902){const _0x2b0400=a150_0x43fb,_0x2578dc={},_0x52c524=Object['keys'](_0x5bc0cc),_0x5de08f=_0x6a0902?[..._0x6a0902[_0x2b0400(0x184)](_0x47b2b4=>_0x52c524['includes'](_0x47b2b4)),..._0x52c524[_0x2b0400(0x184)](_0x11cea3=>!_0x6a0902[_0x2b0400(0x218)](_0x11cea3))['sort']()]:_0x52c524[_0x2b0400(0x219)]();for(const _0x4a9caf of _0x5de08f){const _0x476d58=_0x5bc0cc[_0x4a9caf];if(_0x476d58[_0x2b0400(0x17b)]){const _0x2b9424=_0x476d58[_0x2b0400(0x17b)];if(_0x2b9424[_0x2b0400(0x213)]!==_0x2b0400(0x1a0)&&_0x2b9424[_0x2b0400(0x213)]!=='Or'&&_0x2b9424[_0x2b0400(0x213)]!==_0x2b0400(0x15d)){const _0x5f29c3=_0x2b9424[_0x2b0400(0x213)]??'(missing)';throw new SDKError(ErrorCode[_0x2b0400(0x1e9)],_0x2b0400(0x202)+_0x4a9caf+_0x2b0400(0x168)+('rule.type\x20must\x20be\x20\x27And\x27,\x20\x27Or\x27,\x20or\x20\x27Composite\x27,\x20got\x20\x27'+_0x5f29c3+'\x27.\x0a')+_0x2b0400(0x1be)+_0x2b0400(0x1a7)+_0x2b0400(0x1ed)+_0x2b0400(0x1fd)+_0x2b0400(0x20d)+_0x2b0400(0x1bd)+_0x2b0400(0x1b6));}if(!_0x2b9424[_0x2b0400(0x1e3)]||!Array['isArray'](_0x2b9424[_0x2b0400(0x1e3)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x2b0400(0x202)+_0x4a9caf+_0x2b0400(0x168)+_0x2b0400(0x1fa)+_0x2b0400(0x1be)+_0x2b0400(0x1a7)+(_0x2b0400(0x194)+_0x2b9424[_0x2b0400(0x213)]+'\x0a')+_0x2b0400(0x1fd)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x2b0400(0x1bd)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}_0x2578dc[_0x4a9caf]={..._0x476d58[_0x2b0400(0x1fb)]&&_0x476d58[_0x2b0400(0x1fb)][_0x2b0400(0x1c9)]()&&{'description':_0x476d58[_0x2b0400(0x1fb)]},..._0x476d58['rule']&&{'rule':deepSortObject(_0x476d58[_0x2b0400(0x17b)])}};}return _0x2578dc;}function normalizeEmbeddedActivations(_0x2b145c,_0x405ea9){const _0x1ca433=a150_0x43fb,_0x31ffc6={},_0x5a4e2c=Object['keys'](_0x2b145c),_0x492bb2=_0x405ea9?[..._0x405ea9[_0x1ca433(0x184)](_0x3b4f9c=>_0x5a4e2c[_0x1ca433(0x218)](_0x3b4f9c)),..._0x5a4e2c[_0x1ca433(0x184)](_0x4d9357=>!_0x405ea9['includes'](_0x4d9357))[_0x1ca433(0x219)]()]:_0x5a4e2c[_0x1ca433(0x219)]();for(const _0xc0a9f0 of _0x492bb2){const _0x2f1896=_0x2b145c[_0xc0a9f0];_0x31ffc6[_0xc0a9f0]={'name':_0x2f1896[_0x1ca433(0x15e)],'connection':_0x2f1896['connection'],..._0x2f1896['description']!==undefined&&{'description':_0x2f1896['description']},..._0x2f1896[_0x1ca433(0x201)]!==undefined&&{'all_columns':_0x2f1896['all_columns']},..._0x2f1896[_0x1ca433(0x1a1)]!==undefined&&{'columns':_0x2f1896[_0x1ca433(0x1a1)]},..._0x2f1896['behavior']!==undefined&&{'behavior':_0x2f1896[_0x1ca433(0x1ca)]},..._0x2f1896['schedule']!==undefined&&{'schedule':_0x2f1896[_0x1ca433(0x1cb)]},..._0x2f1896['notification']!==undefined&&{'notification':_0x2f1896[_0x1ca433(0x167)]},..._0x2f1896[_0x1ca433(0x18c)]!==undefined&&{'connector_config':_0x2f1896[_0x1ca433(0x18c)]},..._0x2f1896['activation_template_id']!==undefined&&{'activation_template_id':_0x2f1896[_0x1ca433(0x165)]}};}return _0x31ffc6;}function a150_0x43fb(_0x2cd43a,_0x5058b1){_0x2cd43a=_0x2cd43a-0x15c;const _0x54daa4=a150_0x54da();let _0x43fb52=_0x54daa4[_0x2cd43a];return _0x43fb52;}export function getActiveStages(_0x301e46){const _0x5cce0f=a150_0x43fb;if(isJourneysArrayMode(_0x301e46)){const _0x35997b=_0x301e46[_0x5cce0f(0x1bc)]||[],_0x2dee13=_0x35997b[_0x5cce0f(0x1ee)](_0x3aa739=>_0x3aa739['latest']===!![])||_0x35997b[0x0];return _0x2dee13?.[_0x5cce0f(0x1d4)]||[];}if(isSingleVersionMode(_0x301e46))return _0x301e46[_0x5cce0f(0x1d4)]||[];if(isMultiVersionMode(_0x301e46)){const _0x1cf1fb=_0x301e46[_0x5cce0f(0x1de)]||[],_0xf9a3f0=_0x1cf1fb[_0x5cce0f(0x1ee)](_0xc9e6f4=>_0xc9e6f4['latest']===!![])||_0x1cf1fb[0x0];return _0xf9a3f0?.[_0x5cce0f(0x1d4)]||[];}return[];}export function getLatestJourneyEntry(_0x4bedaa){const _0x47943d=a150_0x43fb;if(isJourneysArrayMode(_0x4bedaa)){const _0x1391bf=_0x4bedaa[_0x47943d(0x1bc)]||[];return _0x1391bf[_0x47943d(0x1ee)](_0x2efed3=>_0x2efed3[_0x47943d(0x174)]===!![])||_0x1391bf[0x0];}if(isMultiVersionMode(_0x4bedaa)){const _0xd9e749=_0x4bedaa['versions']||[],_0x46add3=_0xd9e749[_0x47943d(0x1ee)](_0x159d98=>_0x159d98['latest']===!![])||_0xd9e749[0x0];if(_0x46add3)return{'version':_0x46add3[_0x47943d(0x15e)],'state':_0x46add3['state'],'latest':_0x46add3[_0x47943d(0x174)],'stages':_0x46add3[_0x47943d(0x1d4)],'id':_0x46add3['id'],'version_number':_0x46add3[_0x47943d(0x173)]};}if(isSingleVersionMode(_0x4bedaa))return{'version':_0x4bedaa[_0x47943d(0x1ff)]||'v1','state':_0x47943d(0x181),'stages':_0x4bedaa[_0x47943d(0x1d4)]||[],'id':_0x4bedaa['id'],'version_number':_0x4bedaa[_0x47943d(0x173)],'goal':_0x4bedaa[_0x47943d(0x16c)],'reentry':_0x4bedaa['reentry']};return undefined;}export function getLatestVersion(_0x190cbd){const _0x3be1e0=a150_0x43fb;if(!isMultiVersionMode(_0x190cbd))return undefined;const _0x53f477=_0x190cbd[_0x3be1e0(0x1de)]||[];return _0x53f477[_0x3be1e0(0x1ee)](_0x294f25=>_0x294f25[_0x3be1e0(0x174)]===!![])||_0x53f477[0x0];}export function getEffectiveGoal(_0x2bfdec){const _0x3e42fa=a150_0x43fb,_0x569f75=getLatestJourneyEntry(_0x2bfdec);return _0x569f75?.[_0x3e42fa(0x16c)]||_0x2bfdec[_0x3e42fa(0x16c)];}export function getEffectiveReentry(_0x499755){const _0x70a2d7=getLatestJourneyEntry(_0x499755);return _0x70a2d7?.['reentry']||_0x499755['reentry'];}export function collectSegmentRefs(_0x95272a){const _0x1e78c0=a150_0x43fb,_0x2a6944=new Set();_0x95272a[_0x1e78c0(0x16c)]?.[_0x1e78c0(0x1c0)]&&_0x2a6944[_0x1e78c0(0x161)](_0x95272a['goal']['segment']);const _0x43c603=_0x536678=>{const _0x38f4a3=_0x1e78c0;for(const _0x28d6bb of _0x536678){_0x28d6bb[_0x38f4a3(0x1ad)]?.[_0x38f4a3(0x1c0)]&&_0x2a6944[_0x38f4a3(0x161)](_0x28d6bb[_0x38f4a3(0x1ad)][_0x38f4a3(0x1c0)]);if(_0x28d6bb[_0x38f4a3(0x1af)])for(const _0x31772a of _0x28d6bb[_0x38f4a3(0x1af)]){_0x31772a[_0x38f4a3(0x1c0)]&&_0x2a6944[_0x38f4a3(0x161)](_0x31772a[_0x38f4a3(0x1c0)]);}_0x28d6bb[_0x38f4a3(0x1a2)]?.[_0x38f4a3(0x1c0)]&&_0x2a6944['add'](_0x28d6bb[_0x38f4a3(0x1a2)][_0x38f4a3(0x1c0)]);if(_0x28d6bb[_0x38f4a3(0x186)])for(const _0x592cea of _0x28d6bb[_0x38f4a3(0x186)]){if(_0x592cea[_0x38f4a3(0x213)]===_0x38f4a3(0x17c)){const _0x32a944=_0x592cea;for(const _0x186e7f of _0x32a944[_0x38f4a3(0x1c5)][_0x38f4a3(0x1a5)]){_0x186e7f[_0x38f4a3(0x1c0)]&&_0x2a6944[_0x38f4a3(0x161)](_0x186e7f[_0x38f4a3(0x1c0)]);}}else{if(_0x592cea[_0x38f4a3(0x213)]===_0x38f4a3(0x20f)){const _0x6c0d88=_0x592cea;_0x6c0d88[_0x38f4a3(0x1c5)][_0x38f4a3(0x1a9)]?.[_0x38f4a3(0x1c0)]&&_0x2a6944[_0x38f4a3(0x161)](_0x6c0d88[_0x38f4a3(0x1c5)][_0x38f4a3(0x1a9)][_0x38f4a3(0x1c0)]);}}}}};_0x95272a[_0x1e78c0(0x1d4)]&&_0x43c603(_0x95272a[_0x1e78c0(0x1d4)]);if(_0x95272a[_0x1e78c0(0x1de)])for(const _0xcc5ee0 of _0x95272a['versions']){_0x43c603(_0xcc5ee0['stages']);}return _0x2a6944;}export function validateSegmentRefs(_0x4924b9){const _0x5afac1=a150_0x43fb,_0x5aab9f=[],_0xafb211=collectSegmentRefs(_0x4924b9),_0x123a71=new Set(Object[_0x5afac1(0x1ce)](_0x4924b9[_0x5afac1(0x1c3)]||{}));for(const _0x414936 of _0xafb211){const _0x59a7e0=parseSegmentRef(_0x414936);_0x59a7e0[_0x5afac1(0x213)]===_0x5afac1(0x180)&&!_0x123a71[_0x5afac1(0x21c)](_0x59a7e0[_0x5afac1(0x15e)])&&_0x5aab9f[_0x5afac1(0x1a8)](_0x5afac1(0x198)+_0x59a7e0[_0x5afac1(0x15e)]+_0x5afac1(0x207)+_0x59a7e0[_0x5afac1(0x15e)]+_0x5afac1(0x1e2));}return _0x5aab9f;}export function collectSegmentIdsFromJourneyApi(_0x1719e5){const _0x3b70fe=a150_0x43fb,_0xbdb437=new Set();_0x1719e5[_0x3b70fe(0x1da)][_0x3b70fe(0x16c)]?.[_0x3b70fe(0x200)]&&_0xbdb437[_0x3b70fe(0x161)](_0x1719e5['attributes'][_0x3b70fe(0x16c)][_0x3b70fe(0x200)]);const _0x17f9cb=_0x1719e5[_0x3b70fe(0x1da)][_0x3b70fe(0x1df)];if(Array[_0x3b70fe(0x1d8)](_0x17f9cb))for(const _0x480b58 of _0x17f9cb){_0x480b58['entryCriteria']?.[_0x3b70fe(0x200)]&&_0xbdb437['add'](_0x480b58[_0x3b70fe(0x16b)]['segmentId']);const _0x261f78=_0x480b58[_0x3b70fe(0x171)]??_0x480b58[_0x3b70fe(0x1f4)];if(Array[_0x3b70fe(0x1d8)](_0x261f78))for(const _0x291eea of _0x261f78){_0x291eea[_0x3b70fe(0x200)]&&_0xbdb437[_0x3b70fe(0x161)](_0x291eea['segmentId']);}_0x480b58[_0x3b70fe(0x1a2)]?.[_0x3b70fe(0x200)]&&_0xbdb437[_0x3b70fe(0x161)](_0x480b58[_0x3b70fe(0x1a2)][_0x3b70fe(0x200)]);if(_0x480b58[_0x3b70fe(0x186)]&&typeof _0x480b58[_0x3b70fe(0x186)]===_0x3b70fe(0x21a)){const _0x1e7603=Array['isArray'](_0x480b58[_0x3b70fe(0x186)])?_0x480b58[_0x3b70fe(0x186)]:Object[_0x3b70fe(0x197)](_0x480b58[_0x3b70fe(0x186)]);for(const _0x1a4a43 of _0x1e7603){_0x1a4a43[_0x3b70fe(0x18d)]?.[_0x3b70fe(0x200)]&&_0xbdb437['add'](_0x1a4a43[_0x3b70fe(0x18d)][_0x3b70fe(0x200)]);const _0x32a8e9=_0x1a4a43;_0x32a8e9[_0x3b70fe(0x215)]&&_0xbdb437[_0x3b70fe(0x161)](_0x32a8e9[_0x3b70fe(0x215)]);if(Array[_0x3b70fe(0x1d8)](_0x32a8e9[_0x3b70fe(0x1e3)]))for(const _0x36d0de of _0x32a8e9[_0x3b70fe(0x1e3)]){_0x36d0de['segmentId']&&_0xbdb437[_0x3b70fe(0x161)](_0x36d0de[_0x3b70fe(0x200)]);}if(Array[_0x3b70fe(0x1d8)](_0x1a4a43['branches']))for(const _0x1e3bdf of _0x1a4a43[_0x3b70fe(0x1a5)]){_0x1e3bdf[_0x3b70fe(0x200)]&&_0xbdb437[_0x3b70fe(0x161)](_0x1e3bdf[_0x3b70fe(0x200)]);}}}}return _0xbdb437;}
|