@treasuredata/tdx 2026.4.23 → 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 +5 -5
- 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.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.js +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 +1 -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 +5 -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.js +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.js +1 -1
- package/dist/proxy/passthrough-server.js +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.js +1 -1
- package/dist/sdk/client/http-client.js +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 +2 -2
- package/dist/sdk/client/workflow-client.js +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-yaml.js +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.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.js +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.js +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.js +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.js +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.js +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/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +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.js +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 +2 -2
- 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.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +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.js +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.js +1 -1
- package/package.json +17 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a154_0x70cc(_0xa74253,_0x1d5e22){_0xa74253=_0xa74253-0x1cb;const _0x57a6f1=a154_0x57a6();let _0x70cccb=_0x57a6f1[_0xa74253];return _0x70cccb;}const a154_0x2becae=a154_0x70cc;function a154_0x57a6(){const _0x31f21b=['130uhzvTS','segments','code','980VGrMBE','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','12912XClGFZ','debug','version','dirname','utf-8','6KBRJwR','journeyName','tdx.sdk.push-recovery','.push-recovery.json','toISOString','warn','2670579GCpRbY','2oRkknk','513751BczqJD','496cSDjJm','join','parse','.tmp','472571CQUEOu','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','4706484sueLog','477258AseyWo','43569ilLDYy','ENOENT','stringify'];a154_0x57a6=function(){return _0x31f21b;};return a154_0x57a6();}(function(_0x3ce6b0,_0x414fc7){const _0x541cd1=a154_0x70cc,_0x27e701=_0x3ce6b0();while(!![]){try{const _0x39397b=-parseInt(_0x541cd1(0x1e5))/0x1+parseInt(_0x541cd1(0x1dc))/0x2*(parseInt(_0x541cd1(0x1db))/0x3)+-parseInt(_0x541cd1(0x1d0))/0x4*(-parseInt(_0x541cd1(0x1ce))/0x5)+parseInt(_0x541cd1(0x1d5))/0x6*(parseInt(_0x541cd1(0x1dd))/0x7)+-parseInt(_0x541cd1(0x1de))/0x8*(-parseInt(_0x541cd1(0x1e6))/0x9)+-parseInt(_0x541cd1(0x1cb))/0xa*(parseInt(_0x541cd1(0x1e2))/0xb)+-parseInt(_0x541cd1(0x1e4))/0xc;if(_0x39397b===_0x414fc7)break;else _0x27e701['push'](_0x27e701['shift']());}catch(_0x5495c8){_0x27e701['push'](_0x27e701['shift']());}}}(a154_0x57a6,0x725ea));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a154_0xdc8089 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a154_0x2becae(0x1d7));export function getPushRecoveryPath(_0x24b3ac){const _0x2b0323=a154_0x2becae,_0x12adb3=a154_0xdc8089[_0x2b0323(0x1d3)](_0x24b3ac),_0x1dc7e6=a154_0xdc8089['basename'](_0x24b3ac);return a154_0xdc8089[_0x2b0323(0x1df)](_0x12adb3,'.'+_0x1dc7e6+_0x2b0323(0x1d8));}export function readPushRecovery(_0x53e566){const _0x6168d1=a154_0x2becae,_0x5c501c=getPushRecoveryPath(_0x53e566);if(!existsSync(_0x5c501c))return undefined;try{const _0x2a393d=readFileSync(_0x5c501c,_0x6168d1(0x1d4)),_0x2d7881=JSON[_0x6168d1(0x1e0)](_0x2a393d);if(_0x2d7881?.[_0x6168d1(0x1d2)]!==0x1||typeof _0x2d7881[_0x6168d1(0x1d6)]!=='string')return undefined;return _0x2d7881;}catch(_0x15cb17){return _0x15cb17 instanceof SyntaxError?logger[_0x6168d1(0x1d1)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x15cb17):logger[_0x6168d1(0x1da)](_0x6168d1(0x1cf)+_0x15cb17),undefined;}}export function writePushRecovery(_0x4b8d1d,_0xf465bf){const _0xe3e642=a154_0x2becae,_0x4530c0=getPushRecoveryPath(_0x4b8d1d),_0x4f4f3f=_0x4530c0+_0xe3e642(0x1e1);writeFileSync(_0x4f4f3f,JSON[_0xe3e642(0x1e8)](_0xf465bf,null,0x2)+'\x0a',_0xe3e642(0x1d4)),renameSync(_0x4f4f3f,_0x4530c0);}export function deletePushRecovery(_0x4f1789){const _0xb4bd9f=a154_0x2becae,_0x26af05=getPushRecoveryPath(_0x4f1789);try{unlinkSync(_0x26af05);}catch(_0x52ba40){_0x52ba40[_0xb4bd9f(0x1cd)]!==_0xb4bd9f(0x1e7)&&logger[_0xb4bd9f(0x1d1)](_0xb4bd9f(0x1e3)+_0x52ba40);}}export function saveSegmentToPushRecovery(_0x2d7fa6,_0x2c8ec2,_0x29df80,_0x24c3ed){const _0x21f4eb=a154_0x2becae,_0x103549=readPushRecovery(_0x2d7fa6),_0x5bb3b2=_0x103549?.[_0x21f4eb(0x1d6)]===_0x2c8ec2?{..._0x103549,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x2c8ec2,'updatedAt':new Date()[_0x21f4eb(0x1d9)](),'segments':{}};_0x5bb3b2[_0x21f4eb(0x1cc)][_0x29df80]=_0x24c3ed,writePushRecovery(_0x2d7fa6,_0x5bb3b2);}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Push workflow for child segments and journeys.
|
|
3
3
|
*
|
|
4
4
|
* This module provides types and helper functions for pushing child segments
|
|
5
|
-
* and journeys to Treasure
|
|
5
|
+
* and journeys to Treasure AI. The complex execution logic with progress
|
|
6
6
|
* reporting remains in the command layer.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a152_0x547b34=a152_0x57d7;(function(_0x1ef6e3,_0x544879){const _0x195237=a152_0x57d7,_0x4bf6ce=_0x1ef6e3();while(!![]){try{const _0x1b8406=-parseInt(_0x195237(0x174))/0x1*(parseInt(_0x195237(0x1f3))/0x2)+parseInt(_0x195237(0x1e5))/0x3*(-parseInt(_0x195237(0x1f6))/0x4)+parseInt(_0x195237(0x1bb))/0x5+parseInt(_0x195237(0x180))/0x6*(-parseInt(_0x195237(0x1b4))/0x7)+-parseInt(_0x195237(0x194))/0x8+-parseInt(_0x195237(0x15d))/0x9*(parseInt(_0x195237(0x234))/0xa)+parseInt(_0x195237(0x216))/0xb;if(_0x1b8406===_0x544879)break;else _0x4bf6ce['push'](_0x4bf6ce['shift']());}catch(_0x183c52){_0x4bf6ce['push'](_0x4bf6ce['shift']());}}}(a152_0x2ff5,0xa0fcf));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a152_0x547b34(0x248);export const PENDING_ACTIVATION_PREFIX=a152_0x547b34(0x1ee);export function createPendingSegmentId(_0x2f4ebf){return''+PENDING_SEGMENT_PREFIX+_0x2f4ebf+'__';}export function isPendingSegmentId(_0x7f3a06){return _0x7f3a06['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x7f3a06['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x27ea0f){const _0x3a2d8e=a152_0x547b34;return _0x27ea0f[_0x3a2d8e(0x220)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3a0a13){return''+PENDING_ACTIVATION_PREFIX+_0x3a0a13+'__';}export function isPendingActivationId(_0x98fcf7){return _0x98fcf7['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3f0a6d){const _0x25af7d=a152_0x547b34;return _0x3f0a6d[_0x25af7d(0x220)](/^__pending_act_(.+)__$/,'$1');}function a152_0x2ff5(){const _0x264207=['relative','1276532mfydOU','split','Activation\x20not\x20found:\x20','journeys','localName','list','JOURNEY_UPDATE_ERROR','decision_point','INTERNAL','get','existingJourney','effectiveFolderId','push',').\x20','Name\x20has\x20already\x20been\x20taken','valid','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','nameToType','Failed\x20to\x20','buildUserMaps','journey_creating','existingSegments','folderPath','description','NOT_FOUND','\x20segment\x20from\x20file:\x20','./child-segment-yaml.js','conditionTimeoutDuration','run_after_journey_refresh','./journey-yaml.js','embeddedSegmentNameToId','deleteActivation','37140323PAfcGt','existingSegment','activationActions','segments','journeyBundleId','all_columns','createFolder','milestone','activations','stages','replace','folder_created','createdSegmentIds','getLatestJourneyId','item','notification','embedded_segment_created','Creating\x20activation\x20\x27','data','created','journeyBundleName','Created\x20activation\x20\x27','state','stage\x20\x27','schedule','set','createActivation','utf-8','match','\x20activation\x20\x27','10MtFfrK','debug','index','deps','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','isNew','all','segmentId','rootFolderId','../../utils/async.js','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','slice','dirname','JOURNEY_SYNTAX_ERROR','has','segment_created','segment','filter','journeyName','startsWith','__pending_','listActivations','existingActivation','createdSegmentId','attributes','size','Created\x20journey\x20\x27','Stage\x20\x27','getSegment','some','.$1.push-recovery.json','Created\x20folder\x20\x27','hasChanges','toISOString','rule','max','embedded_activation_created','waitStepType','relationships','\x27\x20not\x20found\x20in\x20journey\x20\x27','\x27\x20to\x20local\x20\x27','behavior','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','conditions','activation_updated','toString','logSuccess','isArray','updated','SEGMENT_UPDATE_ERROR','diff','9086751VRRtwS','DecisionPoint','\x27\x20by\x20rule\x20content','day','errors','Entry\x20criteria:\x20','Segment\x20not\x20found','getJourney','parentId','entry_criteria','Updated\x20journey\x20\x27','entries','\x27\x20decision\x20point\x20branch\x20\x27','WaitStep','Failed\x20to\x20resolve\x20segment\x20','toLowerCase','connector_config','update','from','steps','uniqueSegmentName','embedded_activation_creating','flatMap','707CaRitO','\x20error(s)','and\x20the\x20server\x20segment,\x20then\x20retry.','Creating\x20segment\x20\x27','includes','Segment\x20not\x20found:\x20','results','journey_updating','createJourneySegment','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Activation','resolveSegment','25188qiDZEK','activation_deleted','segment_updated','keys','parse','\x27\x20wait\x20condition','activation_template_id','unchanged','user','length','journey_created','segment_deleted','\x20(referenced\x20in\x20journey\x20','\x0a\x20\x20','conditionSegmentId','yamlActivation','verbose','\x27\x20for\x20','goal','idToEmailMap','385184oBlebt','Deleted\x20activation\x20\x27','onProgress','folderPathToId','segmentByFolderAndName','Updating\x20activation\x20\x27','parseDocument','yamlConfig','\x27\x20milestone','add','name','skipSegments','exitCriterias','map','Updated\x20segment\x20\x27','Created\x20segment\x20\x27','absolutePath','find','delete','join','idToName','progress','segment_creating','Updating\x20segment\x20\x27','waitStepUnit','resolveJourneyId','journeyStages','getSegment\x20failed\x20for\x20','Condition','ACTIVATION_UPDATE_ERROR','waitStep','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','602rfxnLQ','journeyId','folder','\x27\x20entry\x20criteria','Journey\x20\x27','withProgress','segment_deleting','3858075SSpOuL','SEGMENT_SYNTAX_ERROR','Failed\x20to\x20fetch\x20referenced\x20segment\x20','Failed\x20to\x20resolve\x20activation\x20','branches','create','journeyActivationNameToId','entryCriteria','updateSegmentById','uniqueServerName','Deleting\x20activation\x20\x27','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','columns','connectionIdToNameMap','action','logDeleted',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','conditionTimeoutUnit','Matched\x20server\x20segment\x20\x27','activation_created','journeyById','\x27...','fetchJourney','journey','sort','parentSegmentFolder','connection','activationStepsById','reduce','Creating\x20folder\x20\x27','embedded_segment_creating','goal\x20criteria','versionNumber','resolvedRule','Fetching\x20','Duration','activation_creating','type','activation_deleting','sha1','with','folder_creating','12XvVJfE','validatedRequest','deleted','journeyBundlesByFolderAndName','segmentFolderId','logWarning','segmentNameToId','segment_updating','journeyActivationStepId','__pending_act_','message','activationContext','folderId','SEGMENT_NOT_FOUND','2244oYCGWW','stringify'];a152_0x2ff5=function(){return _0x264207;};return a152_0x2ff5();}export function generateDeterministicJourneySegmentName(_0x5379e5,_0x141f02){const _0x5a027b=a152_0x547b34,_0x169d14=_0x5379e5+'::'+(_0x141f02['trim']()||_0x5a027b(0x244)),_0x55b4a2=createHash(_0x5a027b(0x1e2))[_0x5a027b(0x16e)](_0x169d14)['digest']('hex')['slice'](0x0,0xc);return'journey_entry_criteria_'+_0x55b4a2;}export function ensureJourneyDefaults(_0x315e43){const _0x4416c4=a152_0x547b34;!_0x315e43['description']&&(_0x315e43[_0x4416c4(0x20d)]=''),!_0x315e43[_0x4416c4(0x22c)]&&(_0x315e43['state']='draft');}export function injectExistingStageIds(_0x377ea1,_0x23abd7){const _0x1173a7=a152_0x547b34,_0x5abd86=new Map(_0x23abd7['map'](_0x5a023f=>[_0x5a023f[_0x1173a7(0x19e)],_0x5a023f['id']]));for(const _0x2593f0 of _0x377ea1){if(!_0x2593f0['id']){const _0x2d70ad=_0x5abd86[_0x1173a7(0x1ff)](_0x2593f0['name']);_0x2d70ad&&(_0x2593f0['id']=_0x2d70ad);}}}export function resolveTDFolderPath(_0x4fcb50,_0x38a290,_0x259952){const _0x41e1ef=a152_0x547b34;if(!_0x38a290)return _0x4fcb50;if(_0x4fcb50===_0x259952||_0x4fcb50[_0x41e1ef(0x247)](_0x259952+'/'))return _0x4fcb50;return _0x4fcb50?_0x259952+'/'+_0x4fcb50:_0x259952;}export function addFoldersToCreate(_0x585d1d,_0x1d49f1,_0x43bb80){const _0x3ea224=a152_0x547b34;if(!_0x585d1d)return;if(_0x1d49f1['has'](_0x585d1d))return;const _0x3a792b=_0x585d1d['split']('/');let _0x402bca='';for(const _0x196a47 of _0x3a792b){_0x402bca=_0x402bca?_0x402bca+'/'+_0x196a47:_0x196a47,!_0x1d49f1['has'](_0x402bca)&&_0x43bb80[_0x3ea224(0x19d)](_0x402bca);}}export function sortFoldersByDepth(_0x169e21){const _0x140a7f=a152_0x547b34;return[..._0x169e21][_0x140a7f(0x1d3)]((_0x5f271f,_0x4ae736)=>{const _0x4d254e=_0x140a7f,_0x58958b=(_0x5f271f['match'](/\//g)||[])['length'],_0x45b74f=(_0x4ae736[_0x4d254e(0x232)](/\//g)||[])[_0x4d254e(0x189)];return _0x58958b-_0x45b74f;});}import*as a152_0x2edd9c from'yaml';import{readFileSync}from'fs';import a152_0x339632 from'path';import{isJourneyDef,parseYamlString as a152_0x27da22,toYamlString as a152_0x3aa9ed,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x1dcd37){const _0x8a5867=a152_0x547b34;if(Array[_0x8a5867(0x159)](_0x1dcd37))return'['+_0x1dcd37[_0x8a5867(0x1a1)](_0x3295a7=>stableStringify(_0x3295a7))[_0x8a5867(0x1a7)](',')+']';if(_0x1dcd37&&typeof _0x1dcd37==='object'){const _0xeafb6=_0x1dcd37,_0x52e2b1=Object[_0x8a5867(0x183)](_0xeafb6)[_0x8a5867(0x1d3)](),_0xcd6ebe=_0x52e2b1[_0x8a5867(0x1a1)](_0x8f1dfa=>'\x22'+_0x8f1dfa+'\x22:'+stableStringify(_0xeafb6[_0x8f1dfa]));return'{'+_0xcd6ebe['join'](',')+'}';}const _0x5850ba=JSON[_0x8a5867(0x1f4)](_0x1dcd37);return _0x5850ba===undefined?'null':_0x5850ba;}function activationSignature(_0x5b35f9){const _0x5664ed=a152_0x547b34,_0x146729={'connection':_0x5b35f9[_0x5664ed(0x1d5)],..._0x5b35f9[_0x5664ed(0x21b)]!==undefined&&{'all_columns':_0x5b35f9['all_columns']},..._0x5b35f9[_0x5664ed(0x1c7)]!==undefined&&{'columns':_0x5b35f9[_0x5664ed(0x1c7)]},..._0x5b35f9['behavior']!==undefined&&{'behavior':_0x5b35f9[_0x5664ed(0x152)]},..._0x5b35f9[_0x5664ed(0x22e)]!==undefined&&{'schedule':_0x5b35f9['schedule']},..._0x5b35f9[_0x5664ed(0x225)]!==undefined&&{'notification':_0x5b35f9['notification']},..._0x5b35f9[_0x5664ed(0x16d)]!==undefined&&{'connector_config':_0x5b35f9[_0x5664ed(0x16d)]},..._0x5b35f9[_0x5664ed(0x186)]!==undefined&&{'activation_template_id':_0x5b35f9[_0x5664ed(0x186)]}};return stableStringify(_0x146729);}async function fetchSegment(_0x476734,_0x36e05e,_0x105df8,_0x2c9db9){const _0x54d378=a152_0x547b34,_0x120183=_0x2c9db9?.[_0x54d378(0x1a5)](_0x3120d5=>_0x3120d5['id']===_0x105df8);if(_0x120183)return _0x120183;try{return await _0x476734[_0x54d378(0x244)][_0x54d378(0x250)](_0x36e05e,_0x105df8);}catch(_0x1311d9){logger[_0x54d378(0x235)](_0x54d378(0x1af)+_0x105df8+_0x54d378(0x1cb)+_0x1311d9);try{return await _0x476734[_0x54d378(0x244)]['getSegmentEntity'](_0x105df8);}catch(_0x1b22b9){return logger[_0x54d378(0x235)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x105df8+':\x20'+_0x1b22b9),null;}}}function recoverSegmentIdsFromPushRecovery(_0x4b16ee,_0x57d393,_0x4b6d7a){const _0x284e85=a152_0x547b34,_0x3b1bba=readPushRecovery(_0x4b16ee[_0x284e85(0x1a4)]);if(_0x3b1bba?.['journeyName']===_0x4b16ee['yamlConfig']['name'])for(const [_0x3cdd85,_0x5b33ad]of Object[_0x284e85(0x168)](_0x3b1bba[_0x284e85(0x219)])){const _0x5ee21e=generateDeterministicJourneySegmentName(_0x4b16ee[_0x284e85(0x19b)]['name'],_0x3cdd85);_0x5b33ad[_0x284e85(0x1c4)]===_0x5ee21e&&(_0x57d393[_0x284e85(0x22f)](_0x3cdd85,_0x5b33ad[_0x284e85(0x23b)]),_0x4b6d7a[_0x284e85(0x22f)](_0x3cdd85,_0x5b33ad[_0x284e85(0x23b)]));}}async function createOrRecoverEmbeddedSegment(_0x549b70,_0x469a09,_0x12e61f,_0x3559f1){const _0x5d8c76=a152_0x547b34;let _0x27cb4b;try{_0x27cb4b=await _0x549b70['segment'][_0x5d8c76(0x17c)]({'name':_0x12e61f[_0x5d8c76(0x171)],'description':_0x12e61f[_0x5d8c76(0x20d)],'journeyId':_0x12e61f[_0x5d8c76(0x1b5)],'rule':_0x3559f1(_0x12e61f[_0x5d8c76(0x1dc)],!![]),'countPopulation':!![],'parentFolderId':_0x12e61f[_0x5d8c76(0x1f1)],'audienceId':_0x12e61f[_0x5d8c76(0x165)]});}catch(_0x35b4d3){const _0x19ca16=_0x35b4d3 instanceof Error&&_0x35b4d3[_0x5d8c76(0x1ef)][_0x5d8c76(0x178)](_0x5d8c76(0x204));if(_0x19ca16){const _0x36fe79=readPushRecovery(_0x469a09[_0x5d8c76(0x1a4)]),_0x151098=_0x36fe79?.[_0x5d8c76(0x246)]===_0x469a09[_0x5d8c76(0x19b)][_0x5d8c76(0x19e)]?_0x36fe79['segments'][_0x12e61f[_0x5d8c76(0x1fa)]]:undefined;if(_0x151098?.['uniqueServerName']===_0x12e61f[_0x5d8c76(0x171)])await _0x549b70['segment'][_0x5d8c76(0x1c3)](_0x12e61f[_0x5d8c76(0x165)],_0x151098[_0x5d8c76(0x23b)],{'description':_0x12e61f[_0x5d8c76(0x20d)],'rule':_0x3559f1(_0x12e61f[_0x5d8c76(0x1dc)],!![]),'countPopulation':!![]}),_0x27cb4b=_0x151098[_0x5d8c76(0x23b)];else throw new SDKError(ErrorCode[_0x5d8c76(0x15b)],'Embedded\x20segment\x20\x27'+_0x12e61f[_0x5d8c76(0x1fa)]+_0x5d8c76(0x17d)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x469a09[_0x5d8c76(0x1a4)]['replace'](/([^/]+)$/,_0x5d8c76(0x147))+')\x20')+_0x5d8c76(0x176),_0x35b4d3);}else throw _0x35b4d3;}return saveSegmentToPushRecovery(_0x469a09[_0x5d8c76(0x1a4)],_0x469a09[_0x5d8c76(0x19b)][_0x5d8c76(0x19e)],_0x12e61f[_0x5d8c76(0x1fa)],{'segmentId':_0x27cb4b,'uniqueServerName':_0x12e61f[_0x5d8c76(0x171)],'createdAt':new Date()[_0x5d8c76(0x14a)]()}),_0x27cb4b;}function a152_0x57d7(_0xa67ad2,_0xe04426){_0xa67ad2=_0xa67ad2-0x147;const _0x2ff589=a152_0x2ff5();let _0x57d70b=_0x2ff589[_0xa67ad2];return _0x57d70b;}export async function prepareSegmentFiles(_0x4c25c1,_0x5d99c7,_0x5cd59a,_0x2d64e0,_0xf2e2b5){const _0x547d0f=a152_0x547b34,{activationDefToCreateRequest:_0xeeb588}=await import(_0x547d0f(0x210)),_0xbc970=[],_0x4d6c55=new Set();for(const {yamlConfig:_0x1f12bb,folderPath:_0x2ce1c8,sourcePath:_0xeb31a7}of _0x4c25c1){const _0x43de31=resolveTDFolderPath(_0x2ce1c8,_0x2d64e0,_0xf2e2b5),_0x47348a=_0x43de31+':'+_0x1f12bb['name'],_0x32e662=_0x5d99c7[_0x547d0f(0x198)][_0x547d0f(0x1ff)](_0x47348a),_0x4b03b9=_0x32e662?_0x5d99c7['activationsBySegmentId'][_0x547d0f(0x1ff)](_0x32e662['id'])||[]:[];addFoldersToCreate(_0x43de31,_0x5d99c7[_0x547d0f(0x197)],_0x4d6c55);const _0x212edc=calculateActivationActions(_0x1f12bb[_0x547d0f(0x21e)]||[],_0x4b03b9,_0x5d99c7[_0x547d0f(0x193)],_0x5d99c7[_0x547d0f(0x1c8)]);for(const _0x4690ea of _0x212edc){(_0x4690ea['type']===_0x547d0f(0x1c0)||_0x4690ea[_0x547d0f(0x1e0)]==='update')&&_0x4690ea[_0x547d0f(0x18f)]&&(_0x4690ea[_0x547d0f(0x1e6)]=await _0xeeb588(_0x4690ea['yamlActivation'],_0x5cd59a));}const _0x935b74=calculateSegmentDiff(_0x1f12bb,_0x32e662,_0x4b03b9,_0x5d99c7[_0x547d0f(0x193)],_0x5d99c7[_0x547d0f(0x1c8)]);_0xbc970[_0x547d0f(0x202)]({'relativePath':_0x1f12bb[_0x547d0f(0x19e)],'absolutePath':_0xeb31a7,'yamlConfig':_0x1f12bb,'folderPath':_0x43de31,'existingSegment':_0x32e662,'existingActivations':_0x4b03b9,'isNew':_0x935b74['isNew'],'hasChanges':_0x935b74[_0x547d0f(0x149)],'diff':_0x935b74[_0x547d0f(0x15c)],'activationActions':_0x212edc});}return{'segmentFiles':_0xbc970,'foldersToCreate':_0x4d6c55};}export async function prepareJourneyFiles(_0x1c52dd,_0x3fe5ec,_0xaf524e,_0x36d46b){const _0xd8c6c8=a152_0x547b34,_0x274dab=[],_0x1f5f1b=new Set();for(const {yamlConfig:_0x4ade12,folderPath:_0x47ffd5,sourcePath:_0x85362c}of _0x1c52dd){const _0x54b409=resolveTDFolderPath(_0x47ffd5,_0xaf524e,_0x36d46b),_0x33d3c6=_0x54b409+':'+_0x4ade12['name'],_0x232484=_0x3fe5ec[_0xd8c6c8(0x1e8)][_0xd8c6c8(0x1ff)](_0x33d3c6);let _0x26c753,_0x371817;if(_0x232484&&_0x232484[_0xd8c6c8(0x189)]>0x0){const _0x238af3=buildLocalExpandedRuleMappings(_0x4ade12),{createYamlContext:_0x43ab7a,prefetchJourneySegments:_0x2d80f1}=createPushYamlContextForBundle(_0x3fe5ec['deps'],_0x3fe5ec[_0xd8c6c8(0x165)],_0x3fe5ec[_0xd8c6c8(0x20b)],_0x238af3,_0x3fe5ec['idToEmailMap'],_0x3fe5ec[_0xd8c6c8(0x1c8)],_0x3fe5ec[_0xd8c6c8(0x1d6)],_0x3fe5ec[_0xd8c6c8(0x1cf)]);await _0x2d80f1(_0x232484['map'](_0x4e826c=>_0x4e826c['id']));const _0x127f88=await _0x3fe5ec[_0xd8c6c8(0x237)][_0xd8c6c8(0x1d2)][_0xd8c6c8(0x223)](_0x232484[0x0][_0xd8c6c8(0x21a)]),_0x2907e9=hasMultipleVersions(_0x4ade12),_0x32ca88=async _0x3e5372=>{const _0x5b260a=_0xd8c6c8,_0xe59ed7=_0x3fe5ec[_0x5b260a(0x1cf)]?.['get'](_0x3e5372);if(_0xe59ed7)return _0xe59ed7;return _0x3fe5ec[_0x5b260a(0x1d1)]({'journeyId':_0x3e5372,'journeyName':_0x4ade12[_0x5b260a(0x19e)],'isMultiVersion':_0x232484[_0x5b260a(0x189)]>0x1});};if(_0x2907e9&&_0x232484['length']>0x1){const _0x51ef3f=[];for(const _0x315f2e of _0x232484){const _0x297153=_0x315f2e[_0xd8c6c8(0x1db)]||0x1;_0x3fe5ec[_0xd8c6c8(0x1a9)]?.[_0xd8c6c8(0x16e)](_0xd8c6c8(0x1dd)+_0x4ade12[_0xd8c6c8(0x19e)]+'\x20v'+_0x297153);const _0x15bb57=await _0x32ca88(_0x315f2e['id']),_0x326461=_0x43ab7a(_0x315f2e['id']),_0x36d4d3=await journeyResponseToDef(_0x15bb57,_0x326461);_0x51ef3f['push']({'item':_0x315f2e,'yaml':_0x36d4d3});}const _0x5df5f0=buildLocalRuleToNameMappingFromJourney(_0x4ade12);_0x371817=buildMergedJourneyDef(_0x51ef3f,_0x5df5f0,_0x127f88);const _0x2852fd=Math[_0xd8c6c8(0x14c)](..._0x51ef3f['map'](_0x233517=>_0x233517[_0xd8c6c8(0x224)][_0xd8c6c8(0x1db)]||0x0)),_0xd87b5d=_0x232484[_0xd8c6c8(0x1a5)](_0x80a182=>(_0x80a182[_0xd8c6c8(0x1db)]||0x0)===_0x2852fd);_0xd87b5d&&(_0x3fe5ec[_0xd8c6c8(0x1a9)]?.[_0xd8c6c8(0x16e)](_0xd8c6c8(0x1dd)+_0x4ade12['name']+'\x20v'+_0x2852fd),_0x26c753=await _0x32ca88(_0xd87b5d['id']));}else{const _0x4c35ad=_0x232484[_0x232484[_0xd8c6c8(0x189)]-0x1];_0x3fe5ec[_0xd8c6c8(0x1a9)]?.[_0xd8c6c8(0x16e)](_0xd8c6c8(0x1dd)+_0x4ade12[_0xd8c6c8(0x19e)]),_0x26c753=await _0x32ca88(_0x4c35ad['id']);const _0x118350=_0x43ab7a(_0x4c35ad['id']),_0x202e53=await journeyResponseToDef(_0x26c753,_0x118350),_0x40c45d=buildLocalRuleToNameMappingFromJourney(_0x4ade12);_0x371817=buildMergedJourneyDef([{'item':_0x4c35ad,'yaml':_0x202e53}],_0x40c45d,_0x127f88);}}addFoldersToCreate(_0x54b409,_0x3fe5ec['folderPathToId'],_0x1f5f1b);const _0x195acf=calculateJourneyDiff(_0x4ade12,_0x371817);_0x274dab[_0xd8c6c8(0x202)]({'relativePath':_0x4ade12['name'],'absolutePath':_0x85362c,'yamlConfig':_0x4ade12,'folderPath':_0x54b409,'existingJourney':_0x26c753,'isNew':_0x195acf['isNew'],'hasChanges':_0x195acf[_0xd8c6c8(0x149)],'diff':_0x195acf['diff']});}return{'journeyFiles':_0x274dab,'foldersToCreate':_0x1f5f1b};}export function calculateActivationActions(_0x2b0c8b,_0x48c460,_0x50f694,_0x14e994){const _0x155af2=a152_0x547b34,_0xf528ea=[],_0x5c51f9=new Map();for(const _0x5b38a0 of _0x48c460){_0x5c51f9[_0x155af2(0x22f)](_0x5b38a0[_0x155af2(0x19e)],_0x5b38a0);}const _0x1f8961=new Map();for(const _0x480e47 of _0x2b0c8b){_0x1f8961[_0x155af2(0x22f)](_0x480e47[_0x155af2(0x19e)],_0x480e47);}for(const _0x4c2714 of _0x2b0c8b){const _0x4daf1b=_0x5c51f9[_0x155af2(0x1ff)](_0x4c2714[_0x155af2(0x19e)]);if(!_0x4daf1b)_0xf528ea[_0x155af2(0x202)]({'type':_0x155af2(0x1c0),'name':_0x4c2714['name'],'yamlActivation':_0x4c2714});else{const _0x2a1be3=activationResponseToDef(_0x4daf1b,_0x50f694,_0x14e994),_0x1c4376=a152_0x2edd9c[_0x155af2(0x1f4)](_0x2a1be3),_0x562611=a152_0x2edd9c[_0x155af2(0x1f4)](_0x4c2714);_0x1c4376!==_0x562611&&_0xf528ea['push']({'type':_0x155af2(0x16e),'name':_0x4c2714[_0x155af2(0x19e)],'yamlActivation':_0x4c2714,'existingActivation':_0x4daf1b});}}for(const _0x166911 of _0x48c460){!_0x1f8961[_0x155af2(0x242)](_0x166911[_0x155af2(0x19e)])&&_0xf528ea['push']({'type':_0x155af2(0x1a6),'name':_0x166911[_0x155af2(0x19e)],'existingActivation':_0x166911});}return _0xf528ea;}function calculateYamlDiff(_0xcbc963,_0x55ed3b){if(_0x55ed3b){const _0x191931=generateDiff(_0x55ed3b,_0xcbc963),_0x4edc1d=hasChanges(_0x191931);return{'isNew':![],'hasChanges':_0x4edc1d,'diff':_0x4edc1d?formatDiffWithColors(_0x191931):undefined};}const _0x50b989=generateDiff('',_0xcbc963);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x50b989)};}export function calculateSegmentDiff(_0x33acd2,_0x448dcd,_0x4151d2,_0x2695b2,_0x411e79){const _0x17df91=segmentToYamlString(_0x33acd2),_0x1aed88=_0x448dcd?segmentToYamlString(segmentWithActivationsToYaml(_0x448dcd,_0x4151d2,undefined,_0x2695b2,_0x411e79)):undefined;return calculateYamlDiff(_0x17df91,_0x1aed88);}export function calculateJourneyDiff(_0x5f2eb5,_0x23dd6c){const _0x164523=normalizeJourneyDef(_0x5f2eb5,_0x5f2eb5),_0x15b739=a152_0x3aa9ed(_0x164523),_0x4aa784=_0x23dd6c?a152_0x3aa9ed(normalizeJourneyDef(_0x23dd6c,_0x5f2eb5)):undefined;return calculateYamlDiff(_0x15b739,_0x4aa784);}export function findSegmentsToDelete(_0x47b199,_0x3d71b,_0x390196,_0x35ffc6,_0x98bcd6){const _0xbb9678=a152_0x547b34,_0x41dd77=new Set();for(const {yamlConfig:_0x4ba77b,folderPath:_0x32a27f}of _0x3d71b){_0x41dd77[_0xbb9678(0x19d)](_0x32a27f+':'+_0x4ba77b[_0xbb9678(0x19e)]);}return _0x47b199[_0xbb9678(0x245)](_0x1509bc=>{const _0x2dfa4f=_0xbb9678,_0x52ad32=_0x1509bc['segmentFolderId']?_0x390196[_0x2dfa4f(0x1ff)](_0x1509bc[_0x2dfa4f(0x1e9)][_0x2dfa4f(0x157)]())||'':'',_0x2eeaf4=_0x52ad32+':'+_0x1509bc[_0x2dfa4f(0x19e)];if(_0x41dd77[_0x2dfa4f(0x242)](_0x2eeaf4))return![];if(_0x98bcd6)return _0x52ad32===_0x35ffc6||_0x52ad32[_0x2dfa4f(0x247)](_0x35ffc6+'/');return!![];});}export function findJourneysToDelete(_0x3504a8,_0x5bcaa9,_0x45e298,_0x4bbab8,_0x1988f3){const _0x1f1ffc=a152_0x547b34,_0x1e3c72=new Set();for(const {yamlConfig:_0x9698ab,folderPath:_0x1c0f43}of _0x5bcaa9){_0x1e3c72['add'](_0x1c0f43+':'+_0x9698ab[_0x1f1ffc(0x19e)]);}return _0x3504a8[_0x1f1ffc(0x245)](_0x4b9062=>{const _0x9904ef=_0x1f1ffc,_0x3a84bf=_0x4b9062[_0x9904ef(0x1f1)]?_0x45e298['get'](_0x4b9062[_0x9904ef(0x1f1)])||'':'',_0x3018e4=_0x3a84bf+':'+_0x4b9062[_0x9904ef(0x22a)];if(_0x1e3c72['has'](_0x3018e4))return![];if(_0x1988f3)return _0x3a84bf===_0x4bbab8||_0x3a84bf['startsWith'](_0x4bbab8+'/');return!![];});}export function buildSegmentLookupMap(_0x14e185,_0x432afd){const _0xc14349=a152_0x547b34,_0x3b43ed=new Map();for(const _0x274eed of _0x14e185){const _0xceeffe=_0x274eed[_0xc14349(0x1e9)]?_0x432afd['get'](_0x274eed['segmentFolderId'][_0xc14349(0x157)]())||'':'',_0x4d5beb=_0xceeffe+':'+_0x274eed['name'];_0x3b43ed[_0xc14349(0x22f)](_0x4d5beb,_0x274eed);}return _0x3b43ed;}export function buildSegmentNameToIdMap(_0x4eb3a1){const _0x40c71f=a152_0x547b34,_0x19656d=new Map();for(const _0x1edbb3 of _0x4eb3a1){_0x19656d[_0x40c71f(0x22f)](_0x1edbb3[_0x40c71f(0x19e)],_0x1edbb3['id']);}return _0x19656d;}export function buildJourneyBundleLookupMap(_0x209ccb,_0x3e3edb){const _0x2c8d13=a152_0x547b34,_0x56d1e9=new Map();for(const _0xdb4db4 of _0x209ccb){const _0x224fa2=_0xdb4db4[_0x2c8d13(0x1f1)]?_0x3e3edb[_0x2c8d13(0x1ff)](_0xdb4db4[_0x2c8d13(0x1f1)])||'':'',_0x19aaa9=_0x224fa2+':'+_0xdb4db4['journeyBundleName'];!_0x56d1e9[_0x2c8d13(0x242)](_0x19aaa9)&&_0x56d1e9[_0x2c8d13(0x22f)](_0x19aaa9,[]),_0x56d1e9[_0x2c8d13(0x1ff)](_0x19aaa9)['push'](_0xdb4db4);}for(const _0xa31830 of _0x56d1e9['values']()){_0xa31830[_0x2c8d13(0x1d3)]((_0x55ed8d,_0x374b8d)=>(_0x55ed8d[_0x2c8d13(0x1db)]||0x0)-(_0x374b8d[_0x2c8d13(0x1db)]||0x0));}return _0x56d1e9;}export function collectFoldersToCreate(_0xfbcfc0,_0x5d7df4){const _0x1f8674=a152_0x547b34,_0x31953e=new Set();for(const _0x5b34f2 of _0xfbcfc0){if(!_0x5b34f2)continue;if(_0x5d7df4[_0x1f8674(0x242)](_0x5b34f2))continue;const _0x25bdd2=_0x5b34f2[_0x1f8674(0x1f7)]('/');let _0x4b1df6='';for(const _0x3276e1 of _0x25bdd2){_0x4b1df6=_0x4b1df6?_0x4b1df6+'/'+_0x3276e1:_0x3276e1,!_0x5d7df4[_0x1f8674(0x242)](_0x4b1df6)&&_0x31953e[_0x1f8674(0x19d)](_0x4b1df6);}}return _0x31953e;}export function parseAndClassifyYamlFiles(_0x256426,_0x2c96a1,_0xbdb643){const _0x46778e=a152_0x547b34,_0x2db356=[],_0x1e3c3d=[];for(const _0x1a04ea of _0x256426){const _0x5979db=a152_0x339632[_0x46778e(0x1f5)](_0x2c96a1,a152_0x339632[_0x46778e(0x240)](_0x1a04ea)),_0x5d8874=_0x5979db==='.'?'':_0x5979db['replace'](/\\/g,'/'),_0x172b6c=readFileSync(_0x1a04ea,_0x46778e(0x231)),_0x9bdfc9=a152_0x2edd9c['parse'](_0x172b6c);if(isJourneyDef(_0x9bdfc9)){const _0x618835=a152_0x27da22(_0x172b6c);_0x1e3c3d[_0x46778e(0x202)]({'yamlConfig':_0x618835,'folderPath':_0x5d8874,'sourcePath':_0x1a04ea});}else{if(!_0xbdb643?.[_0x46778e(0x19f)]){const _0x5316bf=parseSegmentYamlFile(_0x172b6c),_0x27b453=normalizeChildSegmentYaml(_0x5316bf);_0x2db356[_0x46778e(0x202)]({'yamlConfig':_0x27b453,'folderPath':_0x5d8874,'sourcePath':_0x1a04ea});}}}return{'segments':_0x2db356,'journeys':_0x1e3c3d};}export function validateParsedFiles(_0x25d3d3,_0x38ad34){const _0x5a5c4f=a152_0x547b34,_0x157c5a=[];for(const {yamlConfig:_0x7be0e1,sourcePath:_0x314524}of _0x25d3d3[_0x5a5c4f(0x219)]){const _0x90ae9c=readFileSync(_0x314524,_0x5a5c4f(0x231)),_0x2b72ab=a152_0x2edd9c[_0x5a5c4f(0x19a)](_0x90ae9c),_0x5a8eec=validateSegmentDef(_0x7be0e1,{'source':_0x90ae9c,'document':_0x2b72ab},{'skipSchema':!![]});if(!_0x5a8eec[_0x5a5c4f(0x205)]){const _0x3b8531=a152_0x339632[_0x5a5c4f(0x1f5)](_0x38ad34,_0x314524);_0x157c5a[_0x5a5c4f(0x202)]({'filePath':_0x3b8531,'source':_0x90ae9c,'result':_0x5a8eec,'isJourney':![]});}}for(const {yamlConfig:_0x5d15c5,sourcePath:_0x4f5a89}of _0x25d3d3[_0x5a5c4f(0x1f9)]){const _0x402f3c=readFileSync(_0x4f5a89,_0x5a5c4f(0x231)),_0x3be16b=a152_0x2edd9c['parseDocument'](_0x402f3c),_0x384844=validateJourneyDef(_0x5d15c5,{'source':_0x402f3c,'document':_0x3be16b},{'skipSchema':!![]});if(!_0x384844[_0x5a5c4f(0x205)]){const _0x47ccbc=a152_0x339632[_0x5a5c4f(0x1f5)](_0x38ad34,_0x4f5a89);_0x157c5a['push']({'filePath':_0x47ccbc,'source':_0x402f3c,'result':_0x384844,'isJourney':!![]});}}return _0x157c5a;}export function formatValidationErrors(_0x41ddb8){const _0x19030a=a152_0x547b34,_0x179b39=[];for(const {filePath:_0x59be94,source:_0x1ccf9c,result:_0x46df7f,isJourney:_0x430402}of _0x41ddb8){const _0x1a3c4b=_0x430402?_0x19030a(0x1d2):_0x19030a(0x244);_0x179b39[_0x19030a(0x202)]('\x0a'+_0x59be94+'\x20('+_0x1a3c4b+'):\x20'+_0x46df7f[_0x19030a(0x161)][_0x19030a(0x189)]+_0x19030a(0x175)),_0x179b39[_0x19030a(0x202)](formatValidationResult(_0x46df7f,_0x1ccf9c,_0x59be94));}return _0x179b39['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x1adc1b){const _0x2c5c2a=a152_0x547b34,_0x2687cf=new Set(),_0x2511b0=new Map(),_0x2c68ad=collectSegmentUsageCounts(_0x1adc1b);if(_0x1adc1b[_0x2c5c2a(0x219)])for(const [_0x3e15b8,_0x433793]of Object[_0x2c5c2a(0x168)](_0x1adc1b[_0x2c5c2a(0x219)])){_0x2687cf['add'](_0x3e15b8);if(_0x433793['rule']){const _0x382c86=yamlRuleToApi(_0x433793[_0x2c5c2a(0x14b)]),_0x1b68e4=apiRuleToYaml(_0x382c86);_0x2511b0['set'](_0x3e15b8,_0x1b68e4);}}const _0x1d5f2e=new Map();let _0x36543c=0x0;for(const [_0x37dea3,_0x10f7f8]of _0x2511b0){const _0x2b4e45=serializeExpandedRule(_0x10f7f8,_0x2511b0),_0x1be5c8=_0x1d5f2e[_0x2c5c2a(0x1ff)](_0x2b4e45)||[];_0x1be5c8['push']({'name':_0x37dea3,'index':_0x36543c}),_0x1d5f2e[_0x2c5c2a(0x22f)](_0x2b4e45,_0x1be5c8),_0x36543c++;}const _0x568f4a=new Map();for(const [_0x3ae46a,_0x25ec82]of _0x1d5f2e){const _0x571890=_0x25ec82[_0x2c5c2a(0x23f)]()['sort']((_0x3de692,_0xe53ff)=>{const _0x4253da=_0x2c5c2a,_0x39ea30=_0x2c68ad[_0x4253da(0x1ff)](_0x3de692[_0x4253da(0x19e)])||0x0,_0x5ca007=_0x2c68ad[_0x4253da(0x1ff)](_0xe53ff[_0x4253da(0x19e)])||0x0;if(_0x39ea30!==_0x5ca007)return _0x5ca007-_0x39ea30;return _0x3de692['index']-_0xe53ff[_0x4253da(0x236)];})[_0x2c5c2a(0x1a1)](_0xa84a6b=>_0xa84a6b[_0x2c5c2a(0x19e)]),_0xe99dfc=[];for(const _0x129eee of _0x571890){const _0x2a00b6=_0x2c68ad['get'](_0x129eee)||0x0,_0x4fa7ca=Math['max'](_0x2a00b6,0x1);for(let _0x2a9d17=0x0;_0x2a9d17<_0x4fa7ca;_0x2a9d17++){_0xe99dfc[_0x2c5c2a(0x202)](_0x129eee);}}_0x568f4a[_0x2c5c2a(0x22f)](_0x3ae46a,_0xe99dfc);}return{'existingLocalSegmentNames':_0x2687cf,'localSegmentRules':_0x2511b0,'localExpandedRuleToNames':_0x568f4a};}export function createSegmentIdResolver(_0xe65d50,_0x1bbebf){return async _0x449d4e=>{const _0xeedc99=a152_0x57d7,_0x6f8fc4=_0xe65d50[_0xeedc99(0x1ff)](_0x449d4e);if(!_0x6f8fc4)throw new SDKError(ErrorCode[_0xeedc99(0x1f2)],'Segment\x20not\x20found:\x20'+_0x449d4e+_0xeedc99(0x23e)+_0x1bbebf+'\x27)');return _0x6f8fc4;};}export function extractRootFolderId(_0x565a6f){const _0x186972=a152_0x547b34;return _0x565a6f['relationships']?.[_0x186972(0x1d4)]?.[_0x186972(0x228)]?.['id']||_0x565a6f['relationships']?.['parentFolder']?.[_0x186972(0x228)]?.['id'];}export function buildConnectionMaps(_0x4386ee){const _0x1b7993=a152_0x547b34,_0xac8844=new Map(),_0x1bdbb3=new Map(),_0x30d22f=new Map();for(const _0x315d05 of _0x4386ee){_0xac8844['set'](_0x315d05['name'],parseInt(_0x315d05['id'],0xa)),_0x1bdbb3['set'](_0x315d05['id'],_0x315d05[_0x1b7993(0x19e)]),_0x30d22f[_0x1b7993(0x22f)](_0x315d05[_0x1b7993(0x19e)],_0x315d05['type']);}return{'nameToId':_0xac8844,'idToName':_0x1bdbb3,'nameToType':_0x30d22f};}export function calculatePushStats(_0x2a88d4,_0x33f8b1,_0x454dcf,_0x2eb637,_0x10cc3d,_0x2dcf9f,_0xe001fd){const _0x3064f4=a152_0x547b34,_0x234709=_0x2a88d4[_0x3064f4(0x245)](_0x251886=>_0x251886['isNew']),_0x63be0d=_0x2a88d4['filter'](_0x5a5817=>!_0x5a5817[_0x3064f4(0x239)]&&_0x5a5817[_0x3064f4(0x149)]),_0xaa1337=_0x2a88d4[_0x3064f4(0x245)](_0x4b0d34=>!_0x4b0d34['isNew']&&!_0x4b0d34['hasChanges']),_0x1e3878=_0x2dcf9f?_0x2eb637:[],_0x229896=_0x33f8b1[_0x3064f4(0x245)](_0x247432=>_0x247432[_0x3064f4(0x239)]),_0x25ff59=_0x33f8b1['filter'](_0x269262=>!_0x269262[_0x3064f4(0x239)]&&_0x269262[_0x3064f4(0x149)]),_0x3a8780=_0x33f8b1[_0x3064f4(0x245)](_0x20def6=>!_0x20def6['isNew']&&!_0x20def6['hasChanges']),_0x175ede=_0x2dcf9f?_0x10cc3d:[],_0x5dc12d=_0x2a88d4[_0x3064f4(0x173)](_0x5586e2=>_0x5586e2[_0x3064f4(0x218)]),_0x73a333=_0x5dc12d['filter'](_0xbdaacf=>_0xbdaacf[_0x3064f4(0x1e0)]==='create'),_0x1dc16d=_0x5dc12d['filter'](_0x44e4ba=>_0x44e4ba[_0x3064f4(0x1e0)]===_0x3064f4(0x16e)),_0x28bb8d=_0x5dc12d[_0x3064f4(0x245)](_0x2e8622=>_0x2e8622[_0x3064f4(0x1e0)]==='delete'),_0x51d35c=Array[_0x3064f4(0x16f)](_0x454dcf)[_0x3064f4(0x1d3)](),_0x27ed43=_0xe001fd?![]:_0x234709['length']>0x0||_0x63be0d[_0x3064f4(0x189)]>0x0||_0x1e3878[_0x3064f4(0x189)]>0x0,_0x1935a6=_0x229896['length']>0x0||_0x25ff59['length']>0x0||_0x175ede[_0x3064f4(0x189)]>0x0,_0x3bbd21=_0xe001fd?![]:_0x5dc12d[_0x3064f4(0x189)]>0x0,_0xae4f8d=_0x51d35c['length']>0x0;return{'segments':{'new':_0x234709,'changed':_0x63be0d,'unchanged':_0xaa1337,'toDelete':_0x1e3878},'journeys':{'new':_0x229896,'changed':_0x25ff59,'unchanged':_0x3a8780,'toDelete':_0x175ede},'activations':{'all':_0x5dc12d,'toCreate':_0x73a333,'toUpdate':_0x1dc16d,'toDelete':_0x28bb8d},'folders':{'toCreate':_0x51d35c},'counts':{'segments':{'new':_0x234709[_0x3064f4(0x189)],'changed':_0x63be0d[_0x3064f4(0x189)],'unchanged':_0xaa1337[_0x3064f4(0x189)],'toDelete':_0x1e3878[_0x3064f4(0x189)]},'journeys':{'new':_0x229896[_0x3064f4(0x189)],'changed':_0x25ff59[_0x3064f4(0x189)],'unchanged':_0x3a8780[_0x3064f4(0x189)],'toDelete':_0x175ede[_0x3064f4(0x189)]},'activations':{'create':_0x73a333[_0x3064f4(0x189)],'update':_0x1dc16d[_0x3064f4(0x189)],'delete':_0x28bb8d[_0x3064f4(0x189)]},'folders':_0x51d35c[_0x3064f4(0x189)]},'hasChanges':_0x27ed43||_0x1935a6||_0x3bbd21||_0xae4f8d};}export async function buildPushExecutionContext(_0x553d6c,_0x5a2c69,_0x461208,_0x38ff02,_0x477fe8,_0x449392){const _0x587811=a152_0x547b34,_0x24f42d=extractRootFolderId(_0x461208),{pathToId:_0xcaae49,idToPath:_0x2d4b9a}=buildFolderMaps(_0x477fe8),_0x1262ca=buildSegmentNameToIdMap(_0x38ff02),_0x12085e=new Map(),{batchAsync:_0x38ea96}=await import(_0x587811(0x23d)),[_0x83165c,_0x5e0341]=await Promise['all']([_0x553d6c[_0x587811(0x188)][_0x587811(0x209)](),_0x553d6c['connection'][_0x587811(0x1fb)](),((async()=>{const _0x49d397=_0x587811;!_0x449392&&_0x38ff02[_0x49d397(0x189)]>0x0&&await _0x38ea96(_0x38ff02,async _0x4a3c8f=>{const _0x373360=_0x49d397,_0x50ef78=await _0x553d6c[_0x373360(0x244)][_0x373360(0x249)](_0x5a2c69,_0x4a3c8f['id']);_0x12085e['set'](_0x4a3c8f['id'],_0x50ef78);});})())]),{emailToId:_0x4043ce,idToEmail:_0x39bbd7}=_0x83165c,_0x4a343a=buildConnectionMaps(_0x5e0341);return{'rootFolderId':_0x24f42d,'folderPathToId':_0xcaae49,'folderIdToPath':_0x2d4b9a,'segmentNameToId':_0x1262ca,'activationsBySegmentId':_0x12085e,'emailToIdMap':_0x4043ce,'idToEmailMap':_0x39bbd7,'connectionNameToIdMap':_0x4a343a['nameToId'],'connectionIdToNameMap':_0x4a343a[_0x587811(0x1a8)],'connectionNameToTypeMap':_0x4a343a[_0x587811(0x207)]};}export function createPushYamlContextForBundle(_0x272510,_0x15dbdf,_0x2b1bde,_0x349010,_0x11452f,_0x4f8a12,_0x596df2,_0x595922){const {existingLocalSegmentNames:_0x6e6817,localExpandedRuleToNames:_0x213d38}=_0x349010,_0x264928=new Set(),_0x227c52=new Map(),_0x591bf5=new Map(),_0x1f8e1f=new Map(),_0x48aacd=createJumpTargetCache(),_0x2fe59f=new Map(),_0x5e60d6=new Map(),_0x2cad72=new Set();let _0x4056ed;const _0xff15a=_0x122c92=>{const _0x367b48={'resolveSegment':async _0x87a69f=>{const _0x3c31c2=a152_0x57d7,_0x1685de=_0x1f8e1f[_0x3c31c2(0x1ff)](_0x87a69f);if(_0x1685de!==undefined)return{'name':_0x1685de,'isJourneyLocal':!![]};try{const _0x37abfb=await fetchSegment(_0x272510,_0x15dbdf,_0x87a69f,_0x2b1bde);if(!_0x37abfb)throw new Error(_0x3c31c2(0x163));const _0x2c74f6=generateJourneyLocalName(_0x37abfb[_0x3c31c2(0x19e)]),_0xa0fa0f=_0x37abfb['kind']===SEGMENT_KIND_JOURNEY&&_0x2c74f6!==undefined;let _0x3ddc67=_0x37abfb[_0x3c31c2(0x19e)],_0x2128d5;if(_0xa0fa0f&&_0x37abfb[_0x3c31c2(0x14b)]){const _0x267bd8=apiRuleToYaml(_0x37abfb[_0x3c31c2(0x14b)]);_0x5e60d6[_0x3c31c2(0x22f)](_0x87a69f,_0x267bd8);const _0x3063aa=async _0x2a8912=>{const _0x51b942=_0x3c31c2,_0x571dc9=collectSegmentRefsFromRule(_0x2a8912);for(const _0x2efbde of _0x571dc9){if(!_0x5e60d6[_0x51b942(0x242)](_0x2efbde))try{const _0x32717a=await fetchSegment(_0x272510,_0x15dbdf,_0x2efbde,_0x2b1bde);if(_0x32717a?.['rule']){const _0xf2f2ef=apiRuleToYaml(_0x32717a[_0x51b942(0x14b)]);_0x5e60d6[_0x51b942(0x22f)](_0x2efbde,_0xf2f2ef),await _0x3063aa(_0xf2f2ef);}}catch(_0x627297){logger[_0x51b942(0x235)](_0x51b942(0x1bd)+_0x2efbde+':\x20'+_0x627297);}}};await _0x3063aa(_0x267bd8);const _0x30a560=serializeExpandedRule(_0x267bd8,_0x5e60d6),_0x5aabc2=_0x213d38[_0x3c31c2(0x1ff)](_0x30a560);if(_0x5aabc2&&_0x5aabc2[_0x3c31c2(0x189)]>0x0){const _0x506309=_0x227c52[_0x3c31c2(0x1ff)](_0x30a560)||0x0,_0x1f9aee=_0x5aabc2[_0x506309]||_0x5aabc2[_0x5aabc2['length']-0x1];_0x227c52[_0x3c31c2(0x22f)](_0x30a560,_0x506309+0x1),_0x3ddc67=_0x1f9aee,_0x264928[_0x3c31c2(0x19d)](_0x3ddc67),_0x1f8e1f[_0x3c31c2(0x22f)](_0x87a69f,_0x3ddc67);const _0x15aa1d=await resolveRuleSegmentRefs(_0x267bd8,async _0x918b21=>{const _0x6ad2d8=_0x3c31c2,_0xcdc2a2=_0x1f8e1f[_0x6ad2d8(0x1ff)](_0x918b21);if(_0xcdc2a2)return _0xcdc2a2;const _0x469371=await _0x4056ed[_0x6ad2d8(0x17f)](_0x918b21);return _0x469371[_0x6ad2d8(0x19e)];});_0x2128d5={'description':_0x37abfb[_0x3c31c2(0x20d)],'rule':_0x15aa1d};}else{const _0x147d9f=_0x2fe59f['get'](_0x30a560);if(_0x147d9f)_0x3ddc67=_0x147d9f,_0x1f8e1f[_0x3c31c2(0x22f)](_0x87a69f,_0x3ddc67);else{if(_0x2c74f6){let _0x140c59=_0x2c74f6,_0x5e49c9=0x2;while(_0x264928[_0x3c31c2(0x242)](_0x140c59)||_0x6e6817['has'](_0x140c59)){_0x140c59=_0x2c74f6+'_'+_0x5e49c9,_0x5e49c9++;}_0x264928[_0x3c31c2(0x19d)](_0x140c59),_0x3ddc67=_0x140c59;}_0x1f8e1f[_0x3c31c2(0x22f)](_0x87a69f,_0x3ddc67),_0x2fe59f[_0x3c31c2(0x22f)](_0x30a560,_0x3ddc67);const _0x21801c=await resolveRuleSegmentRefs(_0x267bd8,async _0x485346=>{const _0x55a671=_0x3c31c2,_0x18285b=_0x1f8e1f['get'](_0x485346);if(_0x18285b)return _0x18285b;const _0x782da6=await _0x4056ed[_0x55a671(0x17f)](_0x485346);return _0x782da6[_0x55a671(0x19e)];});_0x2128d5={'description':_0x37abfb[_0x3c31c2(0x20d)],'rule':_0x21801c};}}}return{'name':_0x3ddc67,'isJourneyLocal':_0xa0fa0f,'definition':_0x2128d5};}catch(_0x29d5be){return logger[_0x3c31c2(0x235)](_0x3c31c2(0x16b)+_0x87a69f+':\x20'+_0x29d5be),{'name':_0x87a69f,'isJourneyLocal':![]};}},'resolveActivation':async _0xb9c740=>{const _0x350c33=a152_0x57d7,_0x5e8472=_0x591bf5['get'](_0xb9c740);if(_0x5e8472!==undefined)return{'name':_0x5e8472,'isJourneyLocal':!![]};try{let _0x1430f0=_0x596df2?.['get'](_0xb9c740);!_0x1430f0&&(_0x1430f0=await _0x272510[_0x350c33(0x1d2)]['getActivation'](_0x122c92,_0xb9c740));const _0x2ebd89=_0x1430f0[_0x350c33(0x24c)]['activationParams'][_0x350c33(0x19e)]||_0xb9c740,_0xf81cc5=sanitizeYamlKey(_0x2ebd89)||'activation_'+_0xb9c740,_0x60217d=_0xf81cc5;_0x591bf5[_0x350c33(0x22f)](_0xb9c740,_0x60217d);const _0x186e24=journeyActivationStepToYaml(_0x1430f0,_0x11452f,_0x4f8a12);return{'name':_0x60217d,'isJourneyLocal':!![],'definition':_0x186e24};}catch(_0x4d42b5){return logger[_0x350c33(0x235)](_0x350c33(0x1be)+_0xb9c740+':\x20'+_0x4d42b5),{'name':_0xb9c740,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2a82e6,_0xd71d5e)=>resolveJumpTarget(_0x2a82e6,_0xd71d5e,_0x48aacd,async _0x27183b=>{const _0x555fb8=a152_0x57d7,_0x217c45=_0x595922?.[_0x555fb8(0x1ff)](_0x27183b);if(_0x217c45)return _0x217c45;return _0x272510[_0x555fb8(0x1d2)][_0x555fb8(0x164)](_0x27183b);})};return _0x4056ed=_0x367b48,_0x367b48;},_0x710666=async _0x19e7a9=>{const _0x1c69a6=a152_0x57d7,{collectSegmentIdsFromJourneyApi:_0x3b0ea7}=await import(_0x1c69a6(0x213)),{batchAsync:_0x514b7f}=await import(_0x1c69a6(0x23d)),_0x524ee0=new Set();for(const _0x47a80e of _0x19e7a9){let _0xbe378c=_0x595922?.[_0x1c69a6(0x1ff)](_0x47a80e);!_0xbe378c&&(_0xbe378c=await _0x272510[_0x1c69a6(0x1d2)][_0x1c69a6(0x164)](_0x47a80e));const _0x41626d=_0x3b0ea7(_0xbe378c);for(const _0x2be9f6 of _0x41626d){_0x524ee0[_0x1c69a6(0x19d)](_0x2be9f6);}}let _0x35f81b=Array[_0x1c69a6(0x16f)](_0x524ee0);while(_0x35f81b[_0x1c69a6(0x189)]>0x0){const _0x7526f7=_0x35f81b[_0x1c69a6(0x245)](_0x3e832e=>!_0x2cad72['has'](_0x3e832e));if(_0x7526f7[_0x1c69a6(0x189)]===0x0)break;const _0x474780=await _0x514b7f(_0x7526f7,async _0xef40eb=>{const _0xdc78a3=_0x1c69a6;_0x2cad72[_0xdc78a3(0x19d)](_0xef40eb);const _0x16c449=await fetchSegment(_0x272510,_0x15dbdf,_0xef40eb,_0x2b1bde);if(!_0x16c449)return null;return{'segmentId':_0xef40eb,'segment':_0x16c449};},0xa),_0x1703c6=new Set();for(const _0x47f2cb of _0x474780){if(!_0x47f2cb?.[_0x1c69a6(0x244)]?.[_0x1c69a6(0x14b)])continue;const _0x2fffd6=apiRuleToYaml(_0x47f2cb[_0x1c69a6(0x244)]['rule']);_0x5e60d6['set'](_0x47f2cb[_0x1c69a6(0x23b)],_0x2fffd6);const _0x3f3cee=collectSegmentRefsFromRule(_0x2fffd6);for(const _0x29299e of _0x3f3cee){!_0x2cad72[_0x1c69a6(0x242)](_0x29299e)&&_0x1703c6['add'](_0x29299e);}}_0x35f81b=Array[_0x1c69a6(0x16f)](_0x1703c6);}};return{'createYamlContext':_0xff15a,'prefetchJourneySegments':_0x710666};}export async function executePushSegments(_0x4bf5f0,_0x2c01b8,_0x20b00c,_0x511e9e,_0x343bca){const _0x57a46e=a152_0x547b34,{segmentDefToCreateRequest:_0x30f6ed,segmentDefToUpdateRequest:_0x6dd503}=await import('./child-segment-yaml.js'),_0x39059b=_0x20b00c[_0x57a46e(0x197)],_0x111024=0x5,_0x4c4a88=async _0x24c11d=>{const _0xc54177=_0x57a46e,_0x556e1b=_0x24c11d[_0xc54177(0x20c)]?_0x39059b[_0xc54177(0x1ff)](_0x24c11d[_0xc54177(0x20c)]):undefined;let _0x43fefc;const _0x13c977={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x5aa785=_0x24c11d['yamlConfig'];if(_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x14b)]){const _0x9de5e9=createSegmentIdResolver(_0x20b00c[_0xc54177(0x1eb)],_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x19e)]),_0x44753b=await resolveRuleSegmentIds(_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x14b)],_0x9de5e9);_0x5aa785={..._0x24c11d[_0xc54177(0x19b)],'rule':_0x44753b};}try{if(_0x24c11d['isNew']){_0x343bca[_0xc54177(0x196)]?.({'type':_0xc54177(0x1aa),'name':_0x24c11d[_0xc54177(0x19b)]['name']});const _0x92cdaa=_0x30f6ed(_0x5aa785,_0x556e1b),_0x200cc2=await _0x343bca[_0xc54177(0x1b9)](_0xc54177(0x177)+_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x19e)]+_0xc54177(0x1d0),()=>_0x4bf5f0[_0xc54177(0x244)]['createSegment'](_0x511e9e[_0xc54177(0x165)],_0x92cdaa));_0x43fefc=_0x200cc2[_0xc54177(0x228)]['id'],_0x20b00c['segmentNameToId'][_0xc54177(0x22f)](_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x19e)],_0x43fefc),_0x13c977[_0xc54177(0x24b)]={'name':_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x19e)],'id':_0x43fefc},_0x343bca[_0xc54177(0x196)]?.({'type':_0xc54177(0x243),'name':_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x19e)],'segmentId':_0x43fefc}),_0x343bca[_0xc54177(0x158)]?.(_0xc54177(0x1a3)+_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x19e)]+'\x27'),_0x13c977[_0xc54177(0x229)]=0x1;}else{if(_0x24c11d['hasChanges']){_0x343bca[_0xc54177(0x196)]?.({'type':_0xc54177(0x1ec),'name':_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x19e)]});const _0x451640=_0x6dd503(_0x5aa785);_0x556e1b!==_0x24c11d[_0xc54177(0x217)]?.[_0xc54177(0x1e9)]&&(_0x451640[_0xc54177(0x1e9)]=_0x556e1b?parseInt(_0x556e1b,0xa):undefined),await _0x343bca[_0xc54177(0x1b9)](_0xc54177(0x1ab)+_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x19e)]+_0xc54177(0x1d0),()=>_0x4bf5f0['segment']['updateSegmentById'](_0x511e9e[_0xc54177(0x165)],_0x24c11d['existingSegment']['id'],_0x451640)),_0x43fefc=_0x24c11d['existingSegment']['id'],_0x343bca[_0xc54177(0x196)]?.({'type':_0xc54177(0x182),'name':_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x19e)]}),_0x343bca[_0xc54177(0x158)]?.(_0xc54177(0x1a2)+_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x19e)]+'\x27'),_0x13c977[_0xc54177(0x15a)]=0x1;}else _0x43fefc=_0x24c11d[_0xc54177(0x217)]['id'];}}catch(_0x686bcb){const _0x3afd07=isHttp400Error(_0x686bcb),_0x1164d5=_0x3afd07?ErrorCode[_0xc54177(0x1bc)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x27e01a=getErrorMessage(_0x686bcb);throw new SDKError(_0x1164d5,_0xc54177(0x208)+(_0x24c11d['isNew']?_0xc54177(0x1c0):_0xc54177(0x16e))+_0xc54177(0x20f)+_0x24c11d['absolutePath']+_0xc54177(0x18d)+_0x27e01a,_0x686bcb);}try{const _0x1ed26e=await syncActivationsForSegment(_0x4bf5f0,_0x511e9e['parentId'],_0x43fefc,_0x24c11d[_0xc54177(0x19b)][_0xc54177(0x19e)],_0x24c11d[_0xc54177(0x218)],_0x343bca,_0x24c11d['absolutePath']);_0x13c977['activations']=_0x1ed26e;}catch(_0x1ff70f){if(_0x1ff70f instanceof SDKError)throw _0x1ff70f;throw new SDKError(ErrorCode[_0xc54177(0x1b1)],_0xc54177(0x153)+_0x24c11d[_0xc54177(0x19b)]['name']+'\x27\x20from\x20file:\x20'+_0x24c11d[_0xc54177(0x1a4)]+_0xc54177(0x18d)+getErrorMessage(_0x1ff70f),_0x1ff70f);}return _0x13c977;},_0x3e823e=await batchAsync(_0x2c01b8,_0x4c4a88,_0x111024),_0x2eff6d={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x265f90 of _0x3e823e){_0x2eff6d[_0x57a46e(0x229)]+=_0x265f90[_0x57a46e(0x229)],_0x2eff6d[_0x57a46e(0x15a)]+=_0x265f90[_0x57a46e(0x15a)],_0x265f90[_0x57a46e(0x24b)]&&_0x2eff6d[_0x57a46e(0x222)][_0x57a46e(0x22f)](_0x265f90[_0x57a46e(0x24b)][_0x57a46e(0x19e)],_0x265f90[_0x57a46e(0x24b)]['id']),_0x2eff6d[_0x57a46e(0x21e)][_0x57a46e(0x229)]+=_0x265f90[_0x57a46e(0x21e)][_0x57a46e(0x229)],_0x2eff6d['activations']['updated']+=_0x265f90[_0x57a46e(0x21e)]['updated'],_0x2eff6d[_0x57a46e(0x21e)][_0x57a46e(0x1e7)]+=_0x265f90['activations']['deleted'];}return _0x2eff6d;}async function syncActivationsForSegment(_0x1e865c,_0x4ba063,_0x1b7892,_0x461909,_0x43f95a,_0x1cc348,_0x3e719c){const _0xfc6ed8=a152_0x547b34,_0x3f9b48={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xd0f04a of _0x43f95a){try{if(_0xd0f04a[_0xfc6ed8(0x1e0)]===_0xfc6ed8(0x1c0)&&_0xd0f04a[_0xfc6ed8(0x1e6)])_0x1cc348[_0xfc6ed8(0x196)]?.({'type':_0xfc6ed8(0x1df),'segmentName':_0x461909,'activationName':_0xd0f04a['name']}),await _0x1cc348[_0xfc6ed8(0x1b9)](_0xfc6ed8(0x227)+_0xd0f04a[_0xfc6ed8(0x19e)]+_0xfc6ed8(0x1d0),()=>_0x1e865c[_0xfc6ed8(0x244)][_0xfc6ed8(0x230)](_0x4ba063,_0x1b7892,_0xd0f04a[_0xfc6ed8(0x1e6)])),_0x1cc348[_0xfc6ed8(0x196)]?.({'type':_0xfc6ed8(0x1ce),'segmentName':_0x461909,'activationName':_0xd0f04a['name']}),_0x1cc348[_0xfc6ed8(0x158)]?.(_0xfc6ed8(0x22b)+_0xd0f04a[_0xfc6ed8(0x19e)]+'\x27'),_0x3f9b48['created']++;else{if(_0xd0f04a[_0xfc6ed8(0x1e0)]===_0xfc6ed8(0x16e)&&_0xd0f04a[_0xfc6ed8(0x1e6)]&&_0xd0f04a[_0xfc6ed8(0x24a)])_0x1cc348[_0xfc6ed8(0x196)]?.({'type':'activation_updating','segmentName':_0x461909,'activationName':_0xd0f04a[_0xfc6ed8(0x19e)]}),await _0x1cc348[_0xfc6ed8(0x1b9)](_0xfc6ed8(0x199)+_0xd0f04a[_0xfc6ed8(0x19e)]+_0xfc6ed8(0x1d0),()=>_0x1e865c[_0xfc6ed8(0x244)]['updateActivation'](_0x4ba063,_0x1b7892,_0xd0f04a['existingActivation']['id'],_0xd0f04a[_0xfc6ed8(0x1e6)])),_0x1cc348[_0xfc6ed8(0x196)]?.({'type':_0xfc6ed8(0x156),'segmentName':_0x461909,'activationName':_0xd0f04a[_0xfc6ed8(0x19e)]}),_0x1cc348['logSuccess']?.('Updated\x20activation\x20\x27'+_0xd0f04a[_0xfc6ed8(0x19e)]+'\x27'),_0x3f9b48['updated']++;else _0xd0f04a[_0xfc6ed8(0x1e0)]===_0xfc6ed8(0x1a6)&&_0xd0f04a[_0xfc6ed8(0x24a)]&&(_0x1cc348[_0xfc6ed8(0x196)]?.({'type':_0xfc6ed8(0x1e1),'segmentName':_0x461909,'activationName':_0xd0f04a[_0xfc6ed8(0x19e)]}),await _0x1cc348[_0xfc6ed8(0x1b9)](_0xfc6ed8(0x1c5)+_0xd0f04a['name']+'\x27...',()=>_0x1e865c['segment'][_0xfc6ed8(0x215)](_0x4ba063,_0x1b7892,_0xd0f04a[_0xfc6ed8(0x24a)]['id'])),_0x1cc348[_0xfc6ed8(0x196)]?.({'type':_0xfc6ed8(0x181),'segmentName':_0x461909,'activationName':_0xd0f04a[_0xfc6ed8(0x19e)]}),_0x1cc348[_0xfc6ed8(0x1ca)]?.(_0xfc6ed8(0x195)+_0xd0f04a[_0xfc6ed8(0x19e)]+'\x27'),_0x3f9b48['deleted']++);}}catch(_0x41df82){const _0x3cc43e=isHttp400Error(_0x41df82),_0x1d0daf=_0x3cc43e?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0xfc6ed8(0x1b1)],_0xe64495=getErrorMessage(_0x41df82);throw new SDKError(_0x1d0daf,_0xfc6ed8(0x208)+_0xd0f04a[_0xfc6ed8(0x1e0)]+_0xfc6ed8(0x233)+_0xd0f04a[_0xfc6ed8(0x19e)]+'\x27\x20from\x20file:\x20'+_0x3e719c+_0xfc6ed8(0x18d)+_0xe64495,_0x41df82);}}return _0x3f9b48;}export async function executePushFolders(_0x32b515,_0x337a38,_0x426063,_0xac7c0d,_0x355018){const _0x268fc7=a152_0x547b34,_0x10abde=new Map(_0x426063),_0x417451=sortFoldersByDepth(_0x337a38);for(const _0x2600d6 of _0x417451){const _0x2c0a0c=_0x2600d6[_0x268fc7(0x1f7)]('/'),_0x5b2dd7=_0x2c0a0c[_0x2c0a0c[_0x268fc7(0x189)]-0x1],_0xdc3124=_0x2c0a0c[_0x268fc7(0x23f)](0x0,-0x1)['join']('/'),_0x2276e0=_0x10abde[_0x268fc7(0x1ff)](_0xdc3124);_0x355018[_0x268fc7(0x196)]?.({'type':_0x268fc7(0x1e4),'folder':_0x2600d6});const _0x1a0d76={'name':_0x5b2dd7,'parentFolderId':_0x2276e0},_0x4d04a0=await _0x355018[_0x268fc7(0x1b9)](_0x268fc7(0x1d8)+_0x2600d6+'\x27...',()=>_0x32b515[_0x268fc7(0x244)][_0x268fc7(0x21c)](_0xac7c0d['parentId'],_0x1a0d76));_0x10abde[_0x268fc7(0x22f)](_0x2600d6,_0x4d04a0[_0x268fc7(0x228)]['id']),_0x355018[_0x268fc7(0x196)]?.({'type':_0x268fc7(0x221),'folder':_0x2600d6,'folderId':_0x4d04a0[_0x268fc7(0x228)]['id']}),_0x355018['logInfo']?.(_0x268fc7(0x148)+_0x2600d6+'\x27');}return _0x10abde;}export async function executePushSegmentDeletions(_0xedb0ed,_0x161b88,_0x24918e){const _0x4bb2d6=a152_0x547b34;if(_0x161b88[_0x4bb2d6(0x189)]===0x0)return 0x0;const {batchAsync:_0x7f9e23}=await import(_0x4bb2d6(0x23d)),_0x206624=0x5,_0x5a35f2=await _0x7f9e23(_0x161b88,async _0x2e03ad=>{const _0x4f947b=_0x4bb2d6;return _0x24918e[_0x4f947b(0x196)]?.({'type':_0x4f947b(0x1ba),'name':_0x2e03ad[_0x4f947b(0x19e)]}),await _0xedb0ed[_0x4f947b(0x244)]['deleteSegment'](_0x2e03ad['id']),_0x24918e[_0x4f947b(0x196)]?.({'type':_0x4f947b(0x18b),'name':_0x2e03ad[_0x4f947b(0x19e)]}),_0x24918e[_0x4f947b(0x1ca)]?.('Deleted\x20segment\x20\x27'+_0x2e03ad[_0x4f947b(0x19e)]+'\x27'),0x1;},_0x206624);return _0x5a35f2[_0x4bb2d6(0x1d7)]((_0x58803b,_0x366e98)=>_0x58803b+_0x366e98,0x0);}export async function executePushJourneys(_0xfab6f9,_0x25b28e,_0x12773f,_0x15c976,_0xcab0c9){const _0x515f52=a152_0x547b34,{journeyDefToRequest:_0x22e933}=await import(_0x515f52(0x213)),{activationDefToCreateRequest:_0x5d1af6,yamlRuleToApi:_0x59fddc,validateSegmentRule:_0xd85787}=await import(_0x515f52(0x210)),_0x4fcec5={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x547357=new Map(_0x12773f[_0x515f52(0x1eb)]),_0xfdae3a=0x5;for(let _0x5c28e7=0x0;_0x5c28e7<_0x25b28e[_0x515f52(0x189)];_0x5c28e7+=_0xfdae3a){const _0x23d0fe=_0x25b28e[_0x515f52(0x23f)](_0x5c28e7,_0x5c28e7+_0xfdae3a),_0x116c5a=await Promise[_0x515f52(0x23a)](_0x23d0fe['map'](async _0x132113=>{const _0x5b95a6=_0x515f52;if(!_0x132113[_0x5b95a6(0x239)]&&!_0x132113[_0x5b95a6(0x149)])return{'action':_0x5b95a6(0x187),'name':_0x132113[_0x5b95a6(0x19b)]['name'],'journeyId':_0x132113[_0x5b95a6(0x200)]?.['id']};const _0x589ad6=_0x132113['folderPath']?_0x12773f[_0x5b95a6(0x197)][_0x5b95a6(0x1ff)](_0x132113[_0x5b95a6(0x20c)]):undefined;_0xcab0c9[_0x5b95a6(0x196)]?.({'type':_0x132113[_0x5b95a6(0x239)]?_0x5b95a6(0x20a):_0x5b95a6(0x17b),'name':_0x132113['yamlConfig'][_0x5b95a6(0x19e)]});try{const _0x3c8dda=await executeSingleJourneyPush(_0xfab6f9,_0x132113,{..._0x12773f,'segmentNameToId':_0x547357},{'parentId':_0x15c976[_0x5b95a6(0x165)],'rootFolderId':_0x15c976[_0x5b95a6(0x23c)],'folderId':_0x589ad6,'verbose':_0x15c976[_0x5b95a6(0x190)]},_0xcab0c9,{'journeyDefToRequest':_0x22e933,'activationDefToCreateRequest':_0x5d1af6,'yamlRuleToApi':_0x59fddc,'validateSegmentRule':_0xd85787});for(const [_0x39c799,_0x3aa608]of _0x3c8dda[_0x5b95a6(0x214)]){_0x547357['set'](_0x39c799,_0x3aa608),_0x4fcec5[_0x5b95a6(0x214)]['set'](_0x39c799,_0x3aa608);}if(_0x3c8dda['action']===_0x5b95a6(0x229))_0xcab0c9[_0x5b95a6(0x196)]?.({'type':_0x5b95a6(0x18a),'name':_0x132113[_0x5b95a6(0x19b)][_0x5b95a6(0x19e)],'journeyId':_0x3c8dda[_0x5b95a6(0x1b5)]}),_0xcab0c9[_0x5b95a6(0x158)]?.(_0x5b95a6(0x24e)+_0x132113[_0x5b95a6(0x19b)][_0x5b95a6(0x19e)]+'\x27'),_0x4fcec5['created']++;else _0x3c8dda[_0x5b95a6(0x1c9)]===_0x5b95a6(0x15a)&&(_0xcab0c9[_0x5b95a6(0x196)]?.({'type':'journey_updated','name':_0x132113[_0x5b95a6(0x19b)][_0x5b95a6(0x19e)]}),_0xcab0c9[_0x5b95a6(0x158)]?.(_0x5b95a6(0x167)+_0x132113[_0x5b95a6(0x19b)]['name']+'\x27'),_0x4fcec5['updated']++);return{'action':_0x3c8dda[_0x5b95a6(0x1c9)],'name':_0x132113['yamlConfig'][_0x5b95a6(0x19e)],'journeyId':_0x3c8dda[_0x5b95a6(0x1b5)]};}catch(_0x2491d3){const _0x6f9407=isHttp400Error(_0x2491d3),_0x214304=_0x6f9407?ErrorCode[_0x5b95a6(0x241)]:ErrorCode[_0x5b95a6(0x1fc)],_0x2deb1d=getErrorMessage(_0x2491d3);throw new SDKError(_0x214304,'Failed\x20to\x20'+(_0x132113[_0x5b95a6(0x239)]?_0x5b95a6(0x1c0):_0x5b95a6(0x16e))+'\x20journey\x20from\x20file:\x20'+_0x132113['absolutePath']+_0x5b95a6(0x18d)+_0x2deb1d,_0x2491d3);}}));_0x4fcec5[_0x515f52(0x17a)][_0x515f52(0x202)](..._0x116c5a);}return _0x4fcec5;}async function matchExistingJourneySegments(_0x57f901,_0x6fe8e0,_0x15cca8,_0x3aeb0e,_0x49badc){const _0x23f147=a152_0x547b34;if(!_0x6fe8e0[_0x23f147(0x200)]||!_0x6fe8e0[_0x23f147(0x19b)]['segments'])return;const _0x8418b5=new Map(),_0x2940bd=new Set();for(const _0x1e35c1 of Object[_0x23f147(0x183)](_0x6fe8e0[_0x23f147(0x19b)]['segments'])){const _0x32eab2=generateDeterministicJourneySegmentName(_0x6fe8e0[_0x23f147(0x19b)][_0x23f147(0x19e)],_0x1e35c1);_0x8418b5[_0x23f147(0x22f)](_0x32eab2,_0x1e35c1),_0x2940bd[_0x23f147(0x19d)](_0x1e35c1);}const _0x37f769=[],_0x14892b=collectSegmentIdsFromJourneyApi(_0x6fe8e0['existingJourney']);for(const _0x30ae26 of _0x14892b){const _0x1387c7=await fetchSegment(_0x57f901,_0x15cca8,_0x30ae26,_0x3aeb0e);if(!_0x1387c7?.[_0x23f147(0x19e)])continue;const _0x111eb0=_0x8418b5['get'](_0x1387c7['name']);_0x111eb0?(_0x49badc[_0x23f147(0x22f)](_0x111eb0,_0x30ae26),_0x2940bd[_0x23f147(0x1a6)](_0x111eb0)):_0x37f769[_0x23f147(0x202)]({'id':_0x30ae26,'seg':_0x1387c7});}if(_0x2940bd[_0x23f147(0x24d)]>0x0&&_0x37f769['length']>0x0){const {localExpandedRuleToNames:_0x3513aa}=buildLocalExpandedRuleMappings(_0x6fe8e0['yamlConfig']),_0xefb764=new Map();for(const {id:_0x2f32d7,seg:_0x479dc3}of _0x37f769){if(_0x479dc3['rule']){const _0x37b6cc=apiRuleToYaml(_0x479dc3[_0x23f147(0x14b)]);_0xefb764[_0x23f147(0x22f)](_0x2f32d7,_0x37b6cc);}}for(const {id:_0x50fa31,seg:_0x3038ee}of _0x37f769){if(!_0x3038ee[_0x23f147(0x14b)])continue;const _0x5db973=_0xefb764[_0x23f147(0x1ff)](_0x50fa31);if(!_0x5db973)continue;const _0x2c079d=serializeExpandedRule(_0x5db973,_0xefb764),_0x2031b3=_0x3513aa[_0x23f147(0x1ff)](_0x2c079d);if(_0x2031b3){const _0x3f465e=_0x2031b3[_0x23f147(0x1a5)](_0x3172ed=>_0x2940bd[_0x23f147(0x242)](_0x3172ed));_0x3f465e&&(_0x49badc[_0x23f147(0x22f)](_0x3f465e,_0x50fa31),_0x2940bd[_0x23f147(0x1a6)](_0x3f465e),logger[_0x23f147(0x235)](_0x23f147(0x1cd)+_0x3038ee[_0x23f147(0x19e)]+_0x23f147(0x151)+_0x3f465e+_0x23f147(0x15f)));}}}}async function executeSingleJourneyPush(_0x5850df,_0x1e2fe3,_0x4a5978,_0x5d82bd,_0x2ea48f,_0x1a3a76){const _0x252e70=a152_0x547b34,{journeyDefToRequest:_0x22ea62,activationDefToCreateRequest:_0x14028b,yamlRuleToApi:_0x455a46,validateSegmentRule:_0xa8c6c9}=_0x1a3a76,_0xf3f02b=new Map(),_0x4ffbb6=new Map();recoverSegmentIdsFromPushRecovery(_0x1e2fe3,_0xf3f02b,_0x4a5978[_0x252e70(0x1eb)]);const _0x16e885=new Map(),_0x10de09=new Map(),_0x59462b=new Map();let _0x1f9696;const _0x1773ca=async()=>{const _0x36fbaa=_0x252e70;if(_0x1f9696)return;_0x1f9696=new Map();if(!_0x1e2fe3[_0x36fbaa(0x200)])return;const _0x250381=await _0x5850df[_0x36fbaa(0x1d2)][_0x36fbaa(0x249)](_0x1e2fe3[_0x36fbaa(0x200)]['id']);for(const _0x405319 of _0x250381){const _0x5be6dd=journeyActivationStepToYaml(_0x405319,_0x4a5978[_0x36fbaa(0x193)],_0x4a5978[_0x36fbaa(0x1c8)]),_0x2d256a=activationSignature(_0x5be6dd);!_0x1f9696[_0x36fbaa(0x242)](_0x2d256a)&&_0x1f9696[_0x36fbaa(0x22f)](_0x2d256a,_0x405319['id']),_0x5be6dd[_0x36fbaa(0x19e)]&&_0x4ffbb6[_0x36fbaa(0x22f)](_0x5be6dd[_0x36fbaa(0x19e)],_0x405319['id']);}};await matchExistingJourneySegments(_0x5850df,_0x1e2fe3,_0x5d82bd[_0x252e70(0x165)],_0x4a5978[_0x252e70(0x20b)],_0x4a5978[_0x252e70(0x1eb)]);const _0x5e543f={'resolveSegmentId':async _0x36e489=>{const _0x186ea2=_0x252e70,_0x11857a=_0x4a5978['segmentNameToId'][_0x186ea2(0x1ff)](_0x36e489);if(!_0x11857a)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x186ea2(0x179)+_0x36e489+_0x186ea2(0x18c)+_0x1e2fe3[_0x186ea2(0x19b)][_0x186ea2(0x19e)]+')');return _0x11857a;},'resolveEmbeddedSegmentId':async(_0x5743f2,_0x3a6419)=>{const _0x33c00e=_0x252e70,_0x2bb3a2=_0x4a5978[_0x33c00e(0x1eb)][_0x33c00e(0x1ff)](_0x5743f2);if(_0x2bb3a2)return _0x2bb3a2;const _0x26e142=_0x4a5978['existingSegments'][_0x33c00e(0x1a5)](_0x2e4902=>_0x2e4902[_0x33c00e(0x19e)]===_0x5743f2);if(_0x26e142)return _0x4a5978[_0x33c00e(0x1eb)]['set'](_0x5743f2,_0x26e142['id']),_0x26e142['id'];if(_0x1e2fe3[_0x33c00e(0x239)]){const {stageName:_0x295ac1,criteriaName:_0x20dded}=findSegmentCriteriaLocation(_0x1e2fe3[_0x33c00e(0x19b)],_0x5743f2);return _0xa8c6c9(_0x5743f2,_0x3a6419[_0x33c00e(0x14b)]),_0x10de09[_0x33c00e(0x22f)](_0x5743f2,{'definition':_0x3a6419,'stageName':_0x295ac1,'criteriaName':_0x20dded}),createPendingSegmentId(_0x5743f2);}const _0x4008bd=_0x1e2fe3['existingJourney']?.['id'];if(!_0x4008bd)throw new SDKError(ErrorCode[_0x33c00e(0x1fe)],_0x33c00e(0x1b3));const _0x31b2bd=_0x16e885[_0x33c00e(0x1ff)](_0x5743f2);if(_0x31b2bd)return _0x31b2bd;const _0x4e64d8=((async()=>{const _0x1f296c=_0x33c00e;_0xa8c6c9(_0x5743f2,_0x3a6419[_0x1f296c(0x14b)]);const _0x125b14=generateDeterministicJourneySegmentName(_0x1e2fe3[_0x1f296c(0x19b)]['name'],_0x5743f2),_0x10b209=_0x4a5978[_0x1f296c(0x20b)][_0x1f296c(0x1a5)](_0x2cc809=>_0x2cc809[_0x1f296c(0x19e)]===_0x125b14),_0x8b096f=createSegmentIdResolver(_0x4a5978[_0x1f296c(0x1eb)],_0x5743f2),_0x43f63c=await resolveRuleSegmentIds(_0x3a6419[_0x1f296c(0x14b)],_0x8b096f);let _0x2d3e4e;return _0x10b209?(await _0x5850df[_0x1f296c(0x244)][_0x1f296c(0x1c3)](_0x5d82bd[_0x1f296c(0x165)],_0x10b209['id'],{'description':_0x3a6419[_0x1f296c(0x20d)]||_0x1f296c(0x162)+_0x5743f2,'rule':_0x455a46(_0x43f63c),'countPopulation':!![]}),_0x2d3e4e=_0x10b209['id'],saveSegmentToPushRecovery(_0x1e2fe3['absolutePath'],_0x1e2fe3[_0x1f296c(0x19b)][_0x1f296c(0x19e)],_0x5743f2,{'segmentId':_0x2d3e4e,'uniqueServerName':_0x125b14,'createdAt':new Date()['toISOString']()})):_0x2d3e4e=await createOrRecoverEmbeddedSegment(_0x5850df,_0x1e2fe3,{'localName':_0x5743f2,'uniqueSegmentName':_0x125b14,'description':_0x3a6419[_0x1f296c(0x20d)]||_0x1f296c(0x162)+_0x5743f2,'journeyId':_0x4008bd,'resolvedRule':_0x43f63c,'parentId':_0x5d82bd['parentId'],'folderId':_0x5d82bd[_0x1f296c(0x23c)]||''},_0x455a46),_0x4a5978[_0x1f296c(0x1eb)][_0x1f296c(0x22f)](_0x5743f2,_0x2d3e4e),_0xf3f02b[_0x1f296c(0x22f)](_0x5743f2,_0x2d3e4e),_0x2d3e4e;})());_0x16e885[_0x33c00e(0x22f)](_0x5743f2,_0x4e64d8);try{return await _0x4e64d8;}finally{_0x16e885['delete'](_0x5743f2);}},'resolveActivationId':async _0x701edc=>{const _0x7578a2=_0x252e70,_0x11dc11=_0x4ffbb6[_0x7578a2(0x1ff)](_0x701edc);if(_0x11dc11)return _0x11dc11;if(_0x1e2fe3[_0x7578a2(0x200)]){await _0x1773ca();const _0x37f452=_0x4ffbb6[_0x7578a2(0x1ff)](_0x701edc);if(_0x37f452)return _0x37f452;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x7578a2(0x1f8)+_0x701edc+_0x7578a2(0x18c)+_0x1e2fe3[_0x7578a2(0x19b)]['name']+_0x7578a2(0x203)+_0x7578a2(0x206));},'resolveEmbeddedActivationId':async(_0x4ec027,_0x1152b9)=>{const _0x1b324a=_0x252e70,_0x46c8c1=_0x4ffbb6[_0x1b324a(0x1ff)](_0x4ec027);if(_0x46c8c1)return _0x46c8c1;if(_0x1e2fe3[_0x1b324a(0x239)])return _0x59462b[_0x1b324a(0x22f)](_0x4ec027,_0x1152b9),createPendingActivationId(_0x4ec027);if(_0x1e2fe3[_0x1b324a(0x200)]){await _0x1773ca();const _0x4cc9df=_0x4ffbb6[_0x1b324a(0x1ff)](_0x1152b9[_0x1b324a(0x19e)]);if(_0x4cc9df)return _0x4ffbb6['set'](_0x4ec027,_0x4cc9df),_0x4cc9df;const _0x2d423d=activationSignature(_0x1152b9),_0x29262d=_0x1f9696?.['get'](_0x2d423d);if(_0x29262d)return _0x4ffbb6[_0x1b324a(0x22f)](_0x4ec027,_0x29262d),_0x29262d;const _0x2c9f1a=await _0x14028b(_0x1152b9,_0x4a5978['activationContext']),_0x3c23d1={..._0x2c9f1a,..._0x1152b9[_0x1b324a(0x212)]!==undefined&&{'runAfterJourneyRefresh':_0x1152b9[_0x1b324a(0x212)]}},_0x5301e2=await _0x5850df['journey']['createActivation'](_0x1e2fe3['existingJourney']['id'],_0x3c23d1);return _0x4ffbb6[_0x1b324a(0x22f)](_0x4ec027,_0x5301e2['id']),_0x5301e2['id'];}throw new SDKError(ErrorCode[_0x1b324a(0x1fe)],_0x1b324a(0x238));},'resolveJourneyId':async _0x408f1f=>{const _0x4f8b30=_0x252e70;try{return await _0x5850df[_0x4f8b30(0x1d2)][_0x4f8b30(0x1ad)](_0x5d82bd[_0x4f8b30(0x165)],_0x408f1f);}catch(_0x542e88){throw new SDKError(ErrorCode['NOT_FOUND'],_0x4f8b30(0x1b8)+_0x408f1f+_0x4f8b30(0x1c6)+_0x1e2fe3[_0x4f8b30(0x19b)][_0x4f8b30(0x19e)]+'\x27)',_0x542e88);}},'resolveStageId':async(_0x20e79,_0x36da83)=>{const _0x93b809=_0x252e70,_0x574afe=await _0x5850df['journey'][_0x93b809(0x164)](_0x20e79),_0x223519=_0x574afe['attributes']['journeyStages'][_0x93b809(0x1a5)](_0x2cf562=>_0x2cf562[_0x93b809(0x19e)][_0x93b809(0x16c)]()===_0x36da83[_0x93b809(0x16c)]());if(!_0x223519?.['id'])throw new SDKError(ErrorCode[_0x93b809(0x20e)],_0x93b809(0x24f)+_0x36da83+_0x93b809(0x150)+(_0x574afe[_0x93b809(0x24c)]['journeyBundleName']||_0x574afe[_0x93b809(0x24c)][_0x93b809(0x19e)])+'\x27');return _0x223519['id'];}},_0x1aed60=await _0x22ea62(_0x1e2fe3[_0x252e70(0x19b)],_0x5d82bd[_0x252e70(0x165)],_0x5e543f),_0x799f6=_0x5d82bd[_0x252e70(0x1f1)]||_0x5d82bd[_0x252e70(0x23c)];_0x799f6&&(_0x1aed60[_0x252e70(0x14f)]={'parentFolder':{'data':{'id':_0x799f6,'type':_0x252e70(0x1b6)}}});if(_0x1e2fe3[_0x252e70(0x239)]){if(_0x10de09[_0x252e70(0x24d)]>0x0||_0x59462b[_0x252e70(0x24d)]>0x0)return await executeThreeStepJourneyCreate(_0x5850df,_0x1e2fe3,_0x1aed60,{'pendingEmbeddedSegments':_0x10de09,'pendingEmbeddedActivations':_0x59462b,'embeddedSegmentNameToId':_0xf3f02b,'journeyActivationNameToId':_0x4ffbb6},{..._0x5d82bd,'effectiveFolderId':_0x799f6},_0x4a5978,_0x2ea48f,_0x1a3a76);else{ensureJourneyDefaults(_0x1aed60[_0x252e70(0x24c)]);const _0x3ebc89=await _0x5850df[_0x252e70(0x1d2)][_0x252e70(0x1c0)](_0x1aed60);return deletePushRecovery(_0x1e2fe3[_0x252e70(0x1a4)]),{'action':_0x252e70(0x229),'journeyId':_0x3ebc89['id'],'embeddedSegmentNameToId':_0xf3f02b};}}else{if(_0x1e2fe3['hasChanges']&&_0x1e2fe3[_0x252e70(0x200)]){_0x1aed60['id']=_0x1e2fe3['existingJourney']['id'];const _0x51bd9a=_0x1aed60[_0x252e70(0x24c)];_0x1e2fe3[_0x252e70(0x200)][_0x252e70(0x24c)]?.[_0x252e70(0x22a)]&&(_0x51bd9a[_0x252e70(0x22a)]=_0x1e2fe3['existingJourney']['attributes']['journeyBundleName']);const _0x4cdaa4=_0x1e2fe3[_0x252e70(0x200)]['attributes']?.['journeyStages'];return _0x4cdaa4&&_0x1aed60[_0x252e70(0x24c)][_0x252e70(0x1ae)]&&injectExistingStageIds(_0x1aed60['attributes']['journeyStages'],_0x4cdaa4),ensureJourneyDefaults(_0x51bd9a),await _0x5850df['journey']['update'](_0x1e2fe3[_0x252e70(0x200)]['id'],_0x1aed60),deletePushRecovery(_0x1e2fe3[_0x252e70(0x1a4)]),{'action':_0x252e70(0x15a),'journeyId':_0x1e2fe3[_0x252e70(0x200)]['id'],'embeddedSegmentNameToId':_0xf3f02b};}}return deletePushRecovery(_0x1e2fe3[_0x252e70(0x1a4)]),{'action':_0x252e70(0x187),'journeyId':_0x1e2fe3[_0x252e70(0x200)]?.['id'],'embeddedSegmentNameToId':_0xf3f02b};}function findSegmentCriteriaLocation(_0x1842be,_0xd462fd){const _0x3f0a9d=a152_0x547b34,_0xe39ad1=_0x1842be[_0x3f0a9d(0x21f)]||_0x1842be['journeys']?.[0x0]?.['stages']||[];let _0x3b377d='entry',_0x30d45e=_0xd462fd;const _0x4fb5dc=_0x1842be[_0x3f0a9d(0x192)]||_0x1842be[_0x3f0a9d(0x1f9)]?.[0x0]?.[_0x3f0a9d(0x192)];if(_0x4fb5dc?.[_0x3f0a9d(0x244)]===_0xd462fd)return{'stageName':'goal','criteriaName':_0x4fb5dc['name']||_0xd462fd};_0x4122c0:for(const _0x386955 of _0xe39ad1){if(_0x386955[_0x3f0a9d(0x166)]?.['segment']===_0xd462fd){_0x3b377d=_0x386955[_0x3f0a9d(0x19e)],_0x30d45e=_0x386955[_0x3f0a9d(0x166)][_0x3f0a9d(0x19e)]||_0xd462fd;break;}if(_0x386955['steps'])for(const _0x58bb80 of _0x386955['steps']){if(_0x58bb80['type']===_0x3f0a9d(0x1fd)&&_0x58bb80[_0x3f0a9d(0x1e3)]?.[_0x3f0a9d(0x1bf)])for(const _0x3ed243 of _0x58bb80[_0x3f0a9d(0x1e3)][_0x3f0a9d(0x1bf)]){if(_0x3ed243['segment']===_0xd462fd){_0x3b377d=_0x386955[_0x3f0a9d(0x19e)],_0x30d45e=_0x3ed243[_0x3f0a9d(0x19e)]||_0xd462fd;break _0x4122c0;}}}}return{'stageName':_0x3b377d,'criteriaName':_0x30d45e};}async function executeThreeStepJourneyCreate(_0x3d6cef,_0x30c967,_0x39bf72,_0x1d1021,_0x4cbaee,_0x3ad2ee,_0x102b33,_0x57c35f){const _0x241986=a152_0x547b34,{activationDefToCreateRequest:_0x455cfb,yamlRuleToApi:_0x2d10e0}=_0x57c35f,{pendingEmbeddedSegments:_0x5628d6,pendingEmbeddedActivations:_0x2f178a,embeddedSegmentNameToId:_0x5da67a}=_0x1d1021,_0x286fe8=JSON[_0x241986(0x184)](JSON['stringify'](_0x39bf72));ensureJourneyDefaults(_0x286fe8[_0x241986(0x24c)]),stripPendingIds(_0x286fe8);const _0x2e4836=await _0x3d6cef[_0x241986(0x1d2)][_0x241986(0x1c0)](_0x286fe8),_0x19bd23=_0x2e4836['id'],_0x46ec5e=new Map();for(const _0x5f3389 of _0x2e4836['attributes']['journeyStages']){_0x46ec5e[_0x241986(0x22f)](_0x5f3389[_0x241986(0x19e)][_0x241986(0x16c)](),_0x5f3389['id']);}recoverSegmentIdsFromPushRecovery(_0x30c967,_0x5da67a,_0x3ad2ee[_0x241986(0x1eb)]);for(const [_0x5a9ce3,{definition:_0x415d83}]of _0x5628d6){if(_0x5da67a['has'](_0x5a9ce3)){_0x102b33[_0x241986(0x196)]?.({'type':_0x241986(0x226),'journeyName':_0x30c967['yamlConfig'][_0x241986(0x19e)],'segmentName':_0x5a9ce3});continue;}const _0x322213=generateDeterministicJourneySegmentName(_0x30c967[_0x241986(0x19b)][_0x241986(0x19e)],_0x5a9ce3);_0x102b33[_0x241986(0x196)]?.({'type':_0x241986(0x1d9),'journeyName':_0x30c967[_0x241986(0x19b)][_0x241986(0x19e)],'segmentName':_0x5a9ce3});const _0x280cd8=createSegmentIdResolver(_0x3ad2ee[_0x241986(0x1eb)],_0x5a9ce3),_0x2bc42f=await resolveRuleSegmentIds(_0x415d83[_0x241986(0x14b)],_0x280cd8),_0x55e85d=await createOrRecoverEmbeddedSegment(_0x3d6cef,_0x30c967,{'localName':_0x5a9ce3,'uniqueSegmentName':_0x322213,'description':_0x415d83[_0x241986(0x20d)]||_0x241986(0x162)+_0x5a9ce3,'journeyId':_0x19bd23,'resolvedRule':_0x2bc42f,'parentId':_0x4cbaee[_0x241986(0x165)],'folderId':_0x4cbaee[_0x241986(0x201)]||''},_0x2d10e0);_0x5da67a[_0x241986(0x22f)](_0x5a9ce3,_0x55e85d),_0x3ad2ee['segmentNameToId'][_0x241986(0x22f)](_0x5a9ce3,_0x55e85d),_0x102b33[_0x241986(0x196)]?.({'type':_0x241986(0x226),'journeyName':_0x30c967[_0x241986(0x19b)][_0x241986(0x19e)],'segmentName':_0x5a9ce3});}const _0x2957c6=new Map();for(const [_0x2249f7,_0x121796]of _0x2f178a){_0x102b33[_0x241986(0x196)]?.({'type':_0x241986(0x172),'journeyName':_0x30c967['yamlConfig'][_0x241986(0x19e)],'activationName':_0x2249f7});const _0x32f8b6=await _0x455cfb(_0x121796,_0x3ad2ee[_0x241986(0x1f0)]),_0x112d11={..._0x32f8b6,..._0x121796['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x121796['run_after_journey_refresh']}},_0x4ed264=await _0x3d6cef[_0x241986(0x1d2)][_0x241986(0x230)](_0x19bd23,_0x112d11);_0x2957c6[_0x241986(0x22f)](_0x2249f7,_0x4ed264['id']),_0x1d1021[_0x241986(0x1c1)]['set'](_0x2249f7,_0x4ed264['id']),_0x102b33[_0x241986(0x196)]?.({'type':_0x241986(0x14d),'journeyName':_0x30c967['yamlConfig'][_0x241986(0x19e)],'activationName':_0x2249f7});}const _0x54ad80=JSON[_0x241986(0x184)](JSON[_0x241986(0x1f4)](_0x39bf72));return _0x54ad80['id']=_0x19bd23,ensureJourneyDefaults(_0x54ad80[_0x241986(0x24c)]),resolvePendingIdsInRequest(_0x54ad80,_0x39bf72,_0x46ec5e,_0x5da67a,_0x2957c6,_0x102b33),await _0x3d6cef['journey'][_0x241986(0x16e)](_0x19bd23,_0x54ad80),deletePushRecovery(_0x30c967['absolutePath']),{'action':_0x241986(0x229),'journeyId':_0x19bd23,'embeddedSegmentNameToId':_0x5da67a};}export function stripWaitStepPendingIds(_0x458ba8){const _0x1f530c=a152_0x547b34,_0x509b6a=_0x458ba8[_0x1f530c(0x18e)]&&isPendingSegmentId(_0x458ba8[_0x1f530c(0x18e)]),_0x4013fc=_0x458ba8['conditions']?.[_0x1f530c(0x251)](_0x34be67=>_0x34be67[_0x1f530c(0x23b)]&&isPendingSegmentId(_0x34be67[_0x1f530c(0x23b)]));(_0x509b6a||_0x4013fc)&&(_0x458ba8['waitStepType']=_0x1f530c(0x1de),_0x458ba8[_0x1f530c(0x1b2)]=0x1,_0x458ba8[_0x1f530c(0x1ac)]=_0x1f530c(0x160),delete _0x458ba8['conditionSegmentId'],delete _0x458ba8[_0x1f530c(0x211)],delete _0x458ba8[_0x1f530c(0x1cc)],delete _0x458ba8[_0x1f530c(0x155)]);}export function resolveWaitStepPendingIds(_0x384cef,_0x3f6325,_0x3360a8,_0x55a724){const _0x414ca8=a152_0x547b34;if(_0x3f6325['conditionSegmentId']&&isPendingSegmentId(_0x3f6325[_0x414ca8(0x18e)])){const _0x49c2fd=_0x3360a8(_0x3f6325[_0x414ca8(0x18e)],'stage\x20\x27'+_0x55a724+_0x414ca8(0x185));_0x49c2fd&&(_0x384cef['waitStepType']=_0x414ca8(0x1b0),_0x384cef[_0x414ca8(0x18e)]=_0x49c2fd,delete _0x384cef[_0x414ca8(0x1b2)],delete _0x384cef['waitStepUnit'],_0x3f6325[_0x414ca8(0x211)]!==undefined&&(_0x384cef[_0x414ca8(0x211)]=_0x3f6325[_0x414ca8(0x211)]),_0x3f6325[_0x414ca8(0x1cc)]&&(_0x384cef['conditionTimeoutUnit']=_0x3f6325[_0x414ca8(0x1cc)]));}if(_0x3f6325[_0x414ca8(0x155)]){const _0x558e0e=_0x3f6325[_0x414ca8(0x155)][_0x414ca8(0x251)](_0x25b29b=>_0x25b29b[_0x414ca8(0x23b)]&&isPendingSegmentId(_0x25b29b['segmentId']));if(_0x558e0e){const _0x112c27=_0x3f6325['conditions']['map'](_0x5b308f=>{const _0x594ae0=_0x414ca8;if(_0x5b308f[_0x594ae0(0x23b)]&&isPendingSegmentId(_0x5b308f[_0x594ae0(0x23b)])){const _0x3ce599=_0x3360a8(_0x5b308f[_0x594ae0(0x23b)],'stage\x20\x27'+_0x55a724+_0x594ae0(0x185));return{..._0x5b308f,'segmentId':_0x3ce599||_0x5b308f[_0x594ae0(0x23b)]};}return{..._0x5b308f};});_0x384cef[_0x414ca8(0x14e)]=_0x414ca8(0x1b0),_0x384cef[_0x414ca8(0x155)]=_0x112c27,delete _0x384cef[_0x414ca8(0x1b2)],delete _0x384cef[_0x414ca8(0x1ac)],delete _0x384cef[_0x414ca8(0x18e)],delete _0x384cef[_0x414ca8(0x211)],delete _0x384cef['conditionTimeoutUnit'];}}}function stripPendingIds(_0x4c5dc1){const _0x59e5d8=a152_0x547b34;_0x4c5dc1[_0x59e5d8(0x24c)][_0x59e5d8(0x192)]?.[_0x59e5d8(0x23b)]&&isPendingSegmentId(_0x4c5dc1[_0x59e5d8(0x24c)][_0x59e5d8(0x192)][_0x59e5d8(0x23b)])&&delete _0x4c5dc1['attributes'][_0x59e5d8(0x192)];for(const _0x583d22 of _0x4c5dc1['attributes'][_0x59e5d8(0x1ae)]||[]){_0x583d22[_0x59e5d8(0x1c2)]?.[_0x59e5d8(0x23b)]&&isPendingSegmentId(_0x583d22[_0x59e5d8(0x1c2)]['segmentId'])&&delete _0x583d22['entryCriteria'];_0x583d22[_0x59e5d8(0x21d)]?.[_0x59e5d8(0x23b)]&&isPendingSegmentId(_0x583d22[_0x59e5d8(0x21d)][_0x59e5d8(0x23b)])&&delete _0x583d22[_0x59e5d8(0x21d)];_0x583d22[_0x59e5d8(0x1a0)]&&(_0x583d22['exitCriterias']=_0x583d22[_0x59e5d8(0x1a0)]['filter'](_0x50b479=>!_0x50b479[_0x59e5d8(0x23b)]||!isPendingSegmentId(_0x50b479['segmentId'])));if(_0x583d22[_0x59e5d8(0x170)])for(const _0x19294d of Object[_0x59e5d8(0x183)](_0x583d22[_0x59e5d8(0x170)])){const _0x248093=_0x583d22[_0x59e5d8(0x170)][_0x19294d];_0x248093[_0x59e5d8(0x1e0)]==='Activation'&&_0x248093[_0x59e5d8(0x1ed)]&&isPendingActivationId(_0x248093['journeyActivationStepId'])&&(_0x248093[_0x59e5d8(0x1ed)]='');if(_0x248093[_0x59e5d8(0x1e0)]===_0x59e5d8(0x15e)&&_0x248093[_0x59e5d8(0x1bf)])for(const _0x115407 of _0x248093[_0x59e5d8(0x1bf)]){_0x115407[_0x59e5d8(0x23b)]&&isPendingSegmentId(_0x115407[_0x59e5d8(0x23b)])&&(_0x115407['segmentId']='');}_0x248093['type']==='WaitStep'&&stripWaitStepPendingIds(_0x248093);}}}function resolvePendingIdsInRequest(_0x5e926a,_0xd557ad,_0x30e578,_0xb7a08b,_0x378c36,_0x45a2a5){const _0x136046=a152_0x547b34,_0x2625a6=(_0x24507a,_0xf4c273)=>{const _0x4c7423=a152_0x57d7;if(!isPendingSegmentId(_0x24507a))return _0x24507a;const _0x45f2b4=extractPendingSegmentName(_0x24507a),_0x30dca4=_0xb7a08b[_0x4c7423(0x1ff)](_0x45f2b4);return!_0x30dca4&&_0x45a2a5[_0x4c7423(0x1ea)]?.(_0x4c7423(0x154)+_0x45f2b4+_0x4c7423(0x191)+_0xf4c273),_0x30dca4;};if(_0x5e926a['attributes']['goal']?.[_0x136046(0x23b)]&&isPendingSegmentId(_0x5e926a[_0x136046(0x24c)][_0x136046(0x192)][_0x136046(0x23b)])){const _0x20b7a0=_0x2625a6(_0x5e926a[_0x136046(0x24c)][_0x136046(0x192)][_0x136046(0x23b)],_0x136046(0x1da));_0x20b7a0&&(_0x5e926a[_0x136046(0x24c)]['goal'][_0x136046(0x23b)]=_0x20b7a0);}for(const _0x2c541d of _0x5e926a[_0x136046(0x24c)][_0x136046(0x1ae)]||[]){const _0x357484=_0x30e578[_0x136046(0x1ff)](_0x2c541d[_0x136046(0x19e)][_0x136046(0x16c)]());_0x357484&&(_0x2c541d['id']=_0x357484);if(_0x2c541d[_0x136046(0x1c2)]?.['segmentId']&&isPendingSegmentId(_0x2c541d[_0x136046(0x1c2)][_0x136046(0x23b)])){const _0x31cbf2=_0x2625a6(_0x2c541d[_0x136046(0x1c2)][_0x136046(0x23b)],_0x136046(0x22d)+_0x2c541d[_0x136046(0x19e)]+_0x136046(0x1b7));_0x31cbf2&&(_0x2c541d['entryCriteria'][_0x136046(0x23b)]=_0x31cbf2);}if(_0x2c541d[_0x136046(0x1a0)])for(const _0x4905c2 of _0x2c541d['exitCriterias']){if(_0x4905c2[_0x136046(0x23b)]&&isPendingSegmentId(_0x4905c2[_0x136046(0x23b)])){const _0xba6d56=_0x2625a6(_0x4905c2[_0x136046(0x23b)],'stage\x20\x27'+_0x2c541d[_0x136046(0x19e)]+'\x27\x20exit\x20criteria');_0xba6d56&&(_0x4905c2[_0x136046(0x23b)]=_0xba6d56);}}if(_0x2c541d[_0x136046(0x21d)]?.['segmentId']&&isPendingSegmentId(_0x2c541d[_0x136046(0x21d)][_0x136046(0x23b)])){const _0x5c0a28=_0x2625a6(_0x2c541d['milestone'][_0x136046(0x23b)],'stage\x20\x27'+_0x2c541d[_0x136046(0x19e)]+_0x136046(0x19c));_0x5c0a28&&(_0x2c541d['milestone'][_0x136046(0x23b)]=_0x5c0a28);}if(_0x2c541d[_0x136046(0x170)]){const _0x1d0fa0=_0x118304=>_0xd557ad[_0x136046(0x24c)][_0x136046(0x1ae)]?.['find'](_0x653e81=>_0x653e81[_0x136046(0x19e)]['toLowerCase']()===_0x2c541d[_0x136046(0x19e)]['toLowerCase']())?.['steps']?.[_0x118304];for(const _0x55c76d of Object['keys'](_0x2c541d[_0x136046(0x170)])){const _0x55a90d=_0x2c541d['steps'][_0x55c76d],_0x526e06=_0x1d0fa0(_0x55c76d);if(_0x55a90d[_0x136046(0x1e0)]===_0x136046(0x17e)&&_0x55a90d[_0x136046(0x1ed)]&&(isPendingActivationId(_0x55a90d[_0x136046(0x1ed)])||_0x55a90d[_0x136046(0x1ed)]==='')){if(_0x526e06?.[_0x136046(0x1ed)]&&isPendingActivationId(_0x526e06[_0x136046(0x1ed)])){const _0x2c4aca=extractPendingActivationName(_0x526e06[_0x136046(0x1ed)]),_0x54a4c5=_0x378c36[_0x136046(0x1ff)](_0x2c4aca);_0x54a4c5&&(_0x55a90d[_0x136046(0x1ed)]=_0x54a4c5);}}if(_0x55a90d[_0x136046(0x1e0)]==='DecisionPoint'&&_0x55a90d[_0x136046(0x1bf)]&&_0x526e06?.[_0x136046(0x1bf)])for(let _0xefaf36=0x0;_0xefaf36<_0x55a90d[_0x136046(0x1bf)]['length'];_0xefaf36++){const _0x32a84d=_0x55a90d['branches'][_0xefaf36],_0x1a7326=_0x526e06['branches'][_0xefaf36];if(_0x1a7326?.['segmentId']&&isPendingSegmentId(_0x1a7326[_0x136046(0x23b)])){const _0x2ee94d=_0x2625a6(_0x1a7326[_0x136046(0x23b)],_0x136046(0x22d)+_0x2c541d[_0x136046(0x19e)]+_0x136046(0x169)+(_0x32a84d[_0x136046(0x19e)]||_0xefaf36)+'\x27');_0x2ee94d&&(_0x32a84d[_0x136046(0x23b)]=_0x2ee94d);}}_0x55a90d[_0x136046(0x1e0)]===_0x136046(0x16a)&&_0x526e06?.[_0x136046(0x1e0)]===_0x136046(0x16a)&&resolveWaitStepPendingIds(_0x55a90d,_0x526e06,_0x2625a6,_0x2c541d['name']);}}}}
|
|
1
|
+
const a155_0x24d83c=a155_0xe8d7;(function(_0x237e04,_0x465c7a){const _0x23be2e=a155_0xe8d7,_0x14ff36=_0x237e04();while(!![]){try{const _0x126f29=parseInt(_0x23be2e(0x22d))/0x1*(parseInt(_0x23be2e(0x235))/0x2)+parseInt(_0x23be2e(0x248))/0x3*(parseInt(_0x23be2e(0x23c))/0x4)+parseInt(_0x23be2e(0x1b7))/0x5*(-parseInt(_0x23be2e(0x1eb))/0x6)+-parseInt(_0x23be2e(0x253))/0x7*(parseInt(_0x23be2e(0x212))/0x8)+-parseInt(_0x23be2e(0x179))/0x9+parseInt(_0x23be2e(0x1f5))/0xa*(-parseInt(_0x23be2e(0x260))/0xb)+parseInt(_0x23be2e(0x18f))/0xc*(parseInt(_0x23be2e(0x1d7))/0xd);if(_0x126f29===_0x465c7a)break;else _0x14ff36['push'](_0x14ff36['shift']());}catch(_0x56a4d0){_0x14ff36['push'](_0x14ff36['shift']());}}}(a155_0x4115,0xe0e13));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a155_0x24d83c(0x1f6));function a155_0x4115(){const _0x4a1fb7=['filter','SEGMENT_NOT_FOUND','createdSegmentId','segment_updated','day','keys','segment_deleting','resolveJourneyId','entryCriteria','activation_deleted','journeyId','updateActivation','diff','entry_criteria','\x27\x20milestone','uniqueSegmentName','\x27\x20wait\x20condition','kind','\x27\x20decision\x20point\x20branch\x20\x27','and\x20the\x20server\x20segment,\x20then\x20retry.','logWarning','valid','\x20activation\x20\x27','Fetching\x20','activation_created','activation_','connectionIdToNameMap',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','length','deleteSegment','resolveSegment','\x27\x20from\x20file:\x20','290TkTdQM','toString','stages','unchanged','add','folderPath','folder','folderId','embedded_segment_created','listActivations','journey_created','idToName','decision_point','\x27\x20for\x20','Deleting\x20activation\x20\x27','trim','relationships','Created\x20segment\x20\x27','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','debug','entries','journeys','segment_deleted','\x27...','yamlConfig','validatedRequest','relative','JOURNEY_UPDATE_ERROR','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','delete','Entry\x20criteria:\x20','activationParams','884NVAnMz','):\x20','deleteActivation','Deleted\x20activation\x20\x27','ACTIVATION_UPDATE_ERROR','embedded_segment_creating','conditionTimeoutUnit','activations','Activation\x20not\x20found:\x20','nameToId','activation_creating','hasChanges','existingSegments','Segment\x20not\x20found','nameToType','journey_creating','\x20error(s)','getSegment','SEGMENT_SYNTAX_ERROR','\x27\x20entry\x20criteria','153744ehkLZG','slice','deps','journeyActivationStepId','onProgress','all','state','connection','from','Journey\x20\x27','90LJSSSx','tdx.sdk.push-workflow','schedule','Segment\x20not\x20found:\x20','logInfo','get','updateSegmentById','name','localName','activation_template_id','Created\x20activation\x20\x27','attributes','Failed\x20to\x20','activationStepsById','segmentFolderId','logSuccess','results','segment','conditionSegmentId','startsWith','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','absolutePath','embedded_activation_created','createActivation','.$1.push-recovery.json','segmentByFolderAndName','toLowerCase','waitStepUnit','isArray','16kVYize','Matched\x20server\x20segment\x20\x27','Creating\x20folder\x20\x27','existingActivation','createFolder','resolvedRule','match','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','rule','milestone','journey','push','\x20(referenced\x20in\x20journey\x20','__pending_act_','folderPathToId','Activation','Updated\x20activation\x20\x27','digest','./child-segment-yaml.js','all_columns','user','goal\x20criteria','folder_created','segment_updating','ACTIVATION_SYNTAX_ERROR','fetchJourney','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','50XtolTE','create','journeyStages','waitStepType','segments','Creating\x20activation\x20\x27',').\x20','run_after_journey_refresh','2400vaPQWh','goal','values','withProgress','activation_updating','getJourney','activation_deleting','6355780cHLAcl','buildUserMaps','../../utils/async.js','action','sha1','journeyBundleId','journeyName','description','reduce','sort','existingSegment','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','3RHVWlT','activationsBySegmentId','steps','segmentNameToId','update','Deleted\x20segment\x20\x27','getActivation','created','getSegmentEntity\x20also\x20failed\x20for\x20','getSegment\x20failed\x20for\x20','journeyActivationNameToId','5289578UoWnlQ','idToEmailMap','createSegment','errors','\x27\x20exit\x20criteria','isNew','\x27\x20to\x20local\x20\x27','INTERNAL','stringify','NOT_FOUND','versionNumber','yamlActivation','conditionTimeoutDuration','2198273RrTdWg','journeyById','deleted','activationActions','utf-8','replace','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','rootFolderId','null','\x20journey\x20from\x20file:\x20','object','WaitStep','Failed\x20to\x20resolve\x20activation\x20','index','segment_creating','set','existingJourney','progress','Condition','Name\x20has\x20already\x20been\x20taken','map','logDeleted','branches','parentId','find','some','Updating\x20activation\x20\x27','has','journey_updating','columns','stage\x20\x27','12858003ulmRGq','\x20segment\x20from\x20file:\x20','exitCriterias','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','parentFolder','./journey-yaml.js','size','data','Created\x20journey\x20\x27','journeyBundleName','parse','connector_config','behavior','\x0a\x20\x20','split','join','max','conditions','SEGMENT_UPDATE_ERROR','updated','type','segmentId','970044cKlLtq','DecisionPoint','parseDocument','journey_entry_criteria_','\x27\x20not\x20found\x20in\x20journey\x20\x27','notification','with','uniqueServerName'];a155_0x4115=function(){return _0x4a1fb7;};return a155_0x4115();}export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a155_0x24d83c(0x21f);export function createPendingSegmentId(_0x4e1ec1){return''+PENDING_SEGMENT_PREFIX+_0x4e1ec1+'__';}export function isPendingSegmentId(_0x477889){const _0x456f68=a155_0x24d83c;return _0x477889[_0x456f68(0x208)](PENDING_SEGMENT_PREFIX)&&!_0x477889['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1375e3){const _0x1f67e9=a155_0x24d83c;return _0x1375e3[_0x1f67e9(0x265)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4c4001){return''+PENDING_ACTIVATION_PREFIX+_0x4c4001+'__';}export function isPendingActivationId(_0x4b92f2){return _0x4b92f2['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x2e3593){return _0x2e3593['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x38fa22,_0x3ecba4){const _0x197e3a=a155_0x24d83c,_0x31f690=_0x38fa22+'::'+(_0x3ecba4[_0x197e3a(0x1c6)]()||_0x197e3a(0x206)),_0x163f5f=createHash(_0x197e3a(0x240))[_0x197e3a(0x24c)](_0x31f690)[_0x197e3a(0x223)]('hex')[_0x197e3a(0x1ec)](0x0,0xc);return _0x197e3a(0x192)+_0x163f5f;}export function ensureJourneyDefaults(_0x520d62){const _0x54994d=a155_0x24d83c;!_0x520d62[_0x54994d(0x243)]&&(_0x520d62[_0x54994d(0x243)]=''),!_0x520d62[_0x54994d(0x1f1)]&&(_0x520d62[_0x54994d(0x1f1)]='draft');}export function injectExistingStageIds(_0x2b23db,_0x266cf1){const _0x1b22e3=a155_0x24d83c,_0x369fa1=new Map(_0x266cf1[_0x1b22e3(0x16e)](_0x3bb8fd=>[_0x3bb8fd['name'],_0x3bb8fd['id']]));for(const _0x180566 of _0x2b23db){if(!_0x180566['id']){const _0x177d90=_0x369fa1['get'](_0x180566['name']);_0x177d90&&(_0x180566['id']=_0x177d90);}}}export function resolveTDFolderPath(_0xf22939,_0x11f2b3,_0x500275){const _0x48d2d5=a155_0x24d83c;if(!_0x11f2b3)return _0xf22939;if(_0xf22939===_0x500275||_0xf22939[_0x48d2d5(0x208)](_0x500275+'/'))return _0xf22939;return _0xf22939?_0x500275+'/'+_0xf22939:_0x500275;}export function addFoldersToCreate(_0x374ff6,_0x22050a,_0x932937){const _0x378ba9=a155_0x24d83c;if(!_0x374ff6)return;if(_0x22050a['has'](_0x374ff6))return;const _0x4f9f67=_0x374ff6[_0x378ba9(0x187)]('/');let _0x51c6ba='';for(const _0x226806 of _0x4f9f67){_0x51c6ba=_0x51c6ba?_0x51c6ba+'/'+_0x226806:_0x226806,!_0x22050a['has'](_0x51c6ba)&&_0x932937[_0x378ba9(0x1bb)](_0x51c6ba);}}export function sortFoldersByDepth(_0x19e66c){return[..._0x19e66c]['sort']((_0x50de3c,_0x548f5c)=>{const _0x319e8f=a155_0xe8d7,_0x75ed79=(_0x50de3c[_0x319e8f(0x218)](/\//g)||[])[_0x319e8f(0x1b3)],_0x24dc56=(_0x548f5c[_0x319e8f(0x218)](/\//g)||[])[_0x319e8f(0x1b3)];return _0x75ed79-_0x24dc56;});}import*as a155_0x1b98de from'yaml';import{readFileSync}from'fs';import a155_0x3076d8 from'path';import{isJourneyDef,parseYamlString as a155_0x384924,toYamlString as a155_0x771727,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x15b4d3){const _0x236aa0=a155_0x24d83c;if(Array[_0x236aa0(0x211)](_0x15b4d3))return'['+_0x15b4d3[_0x236aa0(0x16e)](_0x96b3fb=>stableStringify(_0x96b3fb))[_0x236aa0(0x188)](',')+']';if(_0x15b4d3&&typeof _0x15b4d3===_0x236aa0(0x26a)){const _0x4ac61a=_0x15b4d3,_0x5980b6=Object[_0x236aa0(0x19c)](_0x4ac61a)[_0x236aa0(0x245)](),_0x5bd414=_0x5980b6['map'](_0x35f6f2=>'\x22'+_0x35f6f2+'\x22:'+stableStringify(_0x4ac61a[_0x35f6f2]));return'{'+_0x5bd414[_0x236aa0(0x188)](',')+'}';}const _0x4b837f=JSON['stringify'](_0x15b4d3);return _0x4b837f===undefined?_0x236aa0(0x268):_0x4b837f;}function activationSignature(_0x5c05cc){const _0x53c641=a155_0x24d83c,_0x4a6e14={'connection':_0x5c05cc[_0x53c641(0x1f2)],..._0x5c05cc[_0x53c641(0x225)]!==undefined&&{'all_columns':_0x5c05cc[_0x53c641(0x225)]},..._0x5c05cc[_0x53c641(0x177)]!==undefined&&{'columns':_0x5c05cc[_0x53c641(0x177)]},..._0x5c05cc[_0x53c641(0x185)]!==undefined&&{'behavior':_0x5c05cc[_0x53c641(0x185)]},..._0x5c05cc[_0x53c641(0x1f7)]!==undefined&&{'schedule':_0x5c05cc[_0x53c641(0x1f7)]},..._0x5c05cc[_0x53c641(0x194)]!==undefined&&{'notification':_0x5c05cc[_0x53c641(0x194)]},..._0x5c05cc[_0x53c641(0x184)]!==undefined&&{'connector_config':_0x5c05cc[_0x53c641(0x184)]},..._0x5c05cc[_0x53c641(0x1fe)]!==undefined&&{'activation_template_id':_0x5c05cc[_0x53c641(0x1fe)]}};return stableStringify(_0x4a6e14);}async function fetchSegment(_0x353de5,_0x42d5a2,_0x34e000,_0x3f2b3d){const _0x1b297d=a155_0x24d83c,_0x85517a=_0x3f2b3d?.['find'](_0x44d8dd=>_0x44d8dd['id']===_0x34e000);if(_0x85517a)return _0x85517a;try{return await _0x353de5[_0x1b297d(0x206)][_0x1b297d(0x1e8)](_0x42d5a2,_0x34e000);}catch(_0x905b99){logger[_0x1b297d(0x1ca)](_0x1b297d(0x251)+_0x34e000+_0x1b297d(0x1b2)+_0x905b99);try{return await _0x353de5[_0x1b297d(0x206)]['getSegmentEntity'](_0x34e000);}catch(_0x5716c6){return logger['debug'](_0x1b297d(0x250)+_0x34e000+':\x20'+_0x5716c6),null;}}}function a155_0xe8d7(_0x36ecdd,_0x350b7b){_0x36ecdd=_0x36ecdd-0x169;const _0x411514=a155_0x4115();let _0xe8d71a=_0x411514[_0x36ecdd];return _0xe8d71a;}function recoverSegmentIdsFromPushRecovery(_0x583f80,_0x3d5faa,_0x58b6ea){const _0x446760=a155_0x24d83c,_0x377f29=readPushRecovery(_0x583f80[_0x446760(0x20a)]);if(_0x377f29?.[_0x446760(0x242)]===_0x583f80[_0x446760(0x1cf)]['name'])for(const [_0x1f9da8,_0x427132]of Object[_0x446760(0x1cb)](_0x377f29[_0x446760(0x231)])){const _0x5761bd=generateDeterministicJourneySegmentName(_0x583f80[_0x446760(0x1cf)][_0x446760(0x1fc)],_0x1f9da8);_0x427132[_0x446760(0x196)]===_0x5761bd&&(_0x3d5faa['set'](_0x1f9da8,_0x427132[_0x446760(0x18e)]),_0x58b6ea['set'](_0x1f9da8,_0x427132['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x1ed316,_0xf089cf,_0x44d0d5,_0x3642da){const _0x502dd0=a155_0x24d83c;let _0x36d072;try{_0x36d072=await _0x1ed316[_0x502dd0(0x206)]['createJourneySegment']({'name':_0x44d0d5['uniqueSegmentName'],'description':_0x44d0d5[_0x502dd0(0x243)],'journeyId':_0x44d0d5[_0x502dd0(0x1a1)],'rule':_0x3642da(_0x44d0d5['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x44d0d5[_0x502dd0(0x1be)],'audienceId':_0x44d0d5[_0x502dd0(0x171)]});}catch(_0x57398f){const _0xbb1abf=_0x57398f instanceof Error&&_0x57398f['message']['includes'](_0x502dd0(0x16d));if(_0xbb1abf){const _0x2ef260=readPushRecovery(_0xf089cf[_0x502dd0(0x20a)]),_0x3d7104=_0x2ef260?.[_0x502dd0(0x242)]===_0xf089cf['yamlConfig'][_0x502dd0(0x1fc)]?_0x2ef260[_0x502dd0(0x231)][_0x44d0d5[_0x502dd0(0x1fd)]]:undefined;if(_0x3d7104?.['uniqueServerName']===_0x44d0d5['uniqueSegmentName'])await _0x1ed316[_0x502dd0(0x206)][_0x502dd0(0x1fb)](_0x44d0d5['parentId'],_0x3d7104[_0x502dd0(0x18e)],{'description':_0x44d0d5[_0x502dd0(0x243)],'rule':_0x3642da(_0x44d0d5[_0x502dd0(0x217)],!![]),'countPopulation':!![]}),_0x36d072=_0x3d7104[_0x502dd0(0x18e)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],'Embedded\x20segment\x20\x27'+_0x44d0d5[_0x502dd0(0x1fd)]+_0x502dd0(0x1c9)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0xf089cf['absolutePath'][_0x502dd0(0x265)](/([^/]+)$/,_0x502dd0(0x20d))+')\x20')+_0x502dd0(0x1aa),_0x57398f);}else throw _0x57398f;}return saveSegmentToPushRecovery(_0xf089cf[_0x502dd0(0x20a)],_0xf089cf[_0x502dd0(0x1cf)][_0x502dd0(0x1fc)],_0x44d0d5['localName'],{'segmentId':_0x36d072,'uniqueServerName':_0x44d0d5[_0x502dd0(0x1a6)],'createdAt':new Date()['toISOString']()}),_0x36d072;}export async function prepareSegmentFiles(_0xcb005a,_0x17eda5,_0x548742,_0x5a2604,_0x1e35f1){const _0x2c0e2e=a155_0x24d83c,{activationDefToCreateRequest:_0x321cb1}=await import('./child-segment-yaml.js'),_0xb36860=[],_0x1784e7=new Set();for(const {yamlConfig:_0x1fc920,folderPath:_0x1e021e,sourcePath:_0x3bbe23}of _0xcb005a){const _0x254004=resolveTDFolderPath(_0x1e021e,_0x5a2604,_0x1e35f1),_0xbf0e1a=_0x254004+':'+_0x1fc920[_0x2c0e2e(0x1fc)],_0x63e936=_0x17eda5[_0x2c0e2e(0x20e)][_0x2c0e2e(0x1fa)](_0xbf0e1a),_0x356533=_0x63e936?_0x17eda5[_0x2c0e2e(0x249)][_0x2c0e2e(0x1fa)](_0x63e936['id'])||[]:[];addFoldersToCreate(_0x254004,_0x17eda5[_0x2c0e2e(0x220)],_0x1784e7);const _0x4f4467=calculateActivationActions(_0x1fc920[_0x2c0e2e(0x1de)]||[],_0x356533,_0x17eda5[_0x2c0e2e(0x254)],_0x17eda5[_0x2c0e2e(0x1b1)]);for(const _0x4db2a3 of _0x4f4467){(_0x4db2a3[_0x2c0e2e(0x18d)]===_0x2c0e2e(0x22e)||_0x4db2a3[_0x2c0e2e(0x18d)]===_0x2c0e2e(0x24c))&&_0x4db2a3['yamlActivation']&&(_0x4db2a3[_0x2c0e2e(0x1d0)]=await _0x321cb1(_0x4db2a3[_0x2c0e2e(0x25e)],_0x548742));}const _0x9dd73f=calculateSegmentDiff(_0x1fc920,_0x63e936,_0x356533,_0x17eda5[_0x2c0e2e(0x254)],_0x17eda5[_0x2c0e2e(0x1b1)]);_0xb36860[_0x2c0e2e(0x21d)]({'relativePath':_0x1fc920['name'],'absolutePath':_0x3bbe23,'yamlConfig':_0x1fc920,'folderPath':_0x254004,'existingSegment':_0x63e936,'existingActivations':_0x356533,'isNew':_0x9dd73f['isNew'],'hasChanges':_0x9dd73f['hasChanges'],'diff':_0x9dd73f[_0x2c0e2e(0x1a3)],'activationActions':_0x4f4467});}return{'segmentFiles':_0xb36860,'foldersToCreate':_0x1784e7};}export async function prepareJourneyFiles(_0x1c7aa5,_0x501471,_0x26ef04,_0x2c3335){const _0x363d34=a155_0x24d83c,_0x336472=[],_0xf4cbdb=new Set();for(const {yamlConfig:_0x41068f,folderPath:_0x5b0c05,sourcePath:_0x32063a}of _0x1c7aa5){const _0x54c6ad=resolveTDFolderPath(_0x5b0c05,_0x26ef04,_0x2c3335),_0x77d71f=_0x54c6ad+':'+_0x41068f[_0x363d34(0x1fc)],_0x3d57c3=_0x501471['journeyBundlesByFolderAndName'][_0x363d34(0x1fa)](_0x77d71f);let _0x222df0,_0x42d43b;if(_0x3d57c3&&_0x3d57c3[_0x363d34(0x1b3)]>0x0){const _0xfc4a97=buildLocalExpandedRuleMappings(_0x41068f),{createYamlContext:_0x3e2602,prefetchJourneySegments:_0x773015}=createPushYamlContextForBundle(_0x501471[_0x363d34(0x1ed)],_0x501471[_0x363d34(0x171)],_0x501471[_0x363d34(0x1e3)],_0xfc4a97,_0x501471[_0x363d34(0x254)],_0x501471[_0x363d34(0x1b1)],_0x501471[_0x363d34(0x202)],_0x501471[_0x363d34(0x261)]);await _0x773015(_0x3d57c3[_0x363d34(0x16e)](_0x4248a1=>_0x4248a1['id']));const _0x3efb1b=await _0x501471['deps']['journey']['getLatestJourneyId'](_0x3d57c3[0x0][_0x363d34(0x241)]),_0x6c0c96=hasMultipleVersions(_0x41068f),_0x34ff19=async _0x12b7f3=>{const _0x5272ba=_0x363d34,_0x38706a=_0x501471['journeyById']?.[_0x5272ba(0x1fa)](_0x12b7f3);if(_0x38706a)return _0x38706a;return _0x501471[_0x5272ba(0x22b)]({'journeyId':_0x12b7f3,'journeyName':_0x41068f[_0x5272ba(0x1fc)],'isMultiVersion':_0x3d57c3[_0x5272ba(0x1b3)]>0x1});};if(_0x6c0c96&&_0x3d57c3[_0x363d34(0x1b3)]>0x1){const _0x5584f2=[];for(const _0x12df2c of _0x3d57c3){const _0x4ab784=_0x12df2c[_0x363d34(0x25d)]||0x1;_0x501471[_0x363d34(0x16b)]?.[_0x363d34(0x24c)](_0x363d34(0x1ae)+_0x41068f[_0x363d34(0x1fc)]+'\x20v'+_0x4ab784);const _0x1e3521=await _0x34ff19(_0x12df2c['id']),_0xa6525c=_0x3e2602(_0x12df2c['id']),_0x2731c9=await journeyResponseToDef(_0x1e3521,_0xa6525c);_0x5584f2[_0x363d34(0x21d)]({'item':_0x12df2c,'yaml':_0x2731c9});}const _0x47e4ea=buildLocalRuleToNameMappingFromJourney(_0x41068f);_0x42d43b=buildMergedJourneyDef(_0x5584f2,_0x47e4ea,_0x3efb1b);const _0x2df730=Math[_0x363d34(0x189)](..._0x5584f2['map'](_0x27ee15=>_0x27ee15['item'][_0x363d34(0x25d)]||0x0)),_0x3d1ec9=_0x3d57c3[_0x363d34(0x172)](_0x1dad03=>(_0x1dad03[_0x363d34(0x25d)]||0x0)===_0x2df730);_0x3d1ec9&&(_0x501471[_0x363d34(0x16b)]?.[_0x363d34(0x24c)](_0x363d34(0x1ae)+_0x41068f[_0x363d34(0x1fc)]+'\x20v'+_0x2df730),_0x222df0=await _0x34ff19(_0x3d1ec9['id']));}else{const _0x32ab72=_0x3d57c3[_0x3d57c3[_0x363d34(0x1b3)]-0x1];_0x501471[_0x363d34(0x16b)]?.[_0x363d34(0x24c)](_0x363d34(0x1ae)+_0x41068f[_0x363d34(0x1fc)]),_0x222df0=await _0x34ff19(_0x32ab72['id']);const _0x29267b=_0x3e2602(_0x32ab72['id']),_0x460179=await journeyResponseToDef(_0x222df0,_0x29267b),_0x22b417=buildLocalRuleToNameMappingFromJourney(_0x41068f);_0x42d43b=buildMergedJourneyDef([{'item':_0x32ab72,'yaml':_0x460179}],_0x22b417,_0x3efb1b);}}addFoldersToCreate(_0x54c6ad,_0x501471[_0x363d34(0x220)],_0xf4cbdb);const _0x38e2fa=calculateJourneyDiff(_0x41068f,_0x42d43b);_0x336472['push']({'relativePath':_0x41068f['name'],'absolutePath':_0x32063a,'yamlConfig':_0x41068f,'folderPath':_0x54c6ad,'existingJourney':_0x222df0,'isNew':_0x38e2fa[_0x363d34(0x258)],'hasChanges':_0x38e2fa['hasChanges'],'diff':_0x38e2fa[_0x363d34(0x1a3)]});}return{'journeyFiles':_0x336472,'foldersToCreate':_0xf4cbdb};}export function calculateActivationActions(_0xd36a6c,_0x399cd8,_0x5a30f0,_0x3c69d6){const _0x53134c=a155_0x24d83c,_0x57fe71=[],_0x439aca=new Map();for(const _0xd1f454 of _0x399cd8){_0x439aca['set'](_0xd1f454[_0x53134c(0x1fc)],_0xd1f454);}const _0x3bd1ff=new Map();for(const _0x3e0a55 of _0xd36a6c){_0x3bd1ff['set'](_0x3e0a55['name'],_0x3e0a55);}for(const _0x12ad7a of _0xd36a6c){const _0x595f86=_0x439aca[_0x53134c(0x1fa)](_0x12ad7a[_0x53134c(0x1fc)]);if(!_0x595f86)_0x57fe71[_0x53134c(0x21d)]({'type':_0x53134c(0x22e),'name':_0x12ad7a[_0x53134c(0x1fc)],'yamlActivation':_0x12ad7a});else{const _0x537a5e=activationResponseToDef(_0x595f86,_0x5a30f0,_0x3c69d6),_0x22f1c9=a155_0x1b98de[_0x53134c(0x25b)](_0x537a5e),_0x40fbd3=a155_0x1b98de[_0x53134c(0x25b)](_0x12ad7a);_0x22f1c9!==_0x40fbd3&&_0x57fe71['push']({'type':'update','name':_0x12ad7a['name'],'yamlActivation':_0x12ad7a,'existingActivation':_0x595f86});}}for(const _0x4ecf02 of _0x399cd8){!_0x3bd1ff[_0x53134c(0x175)](_0x4ecf02['name'])&&_0x57fe71[_0x53134c(0x21d)]({'type':_0x53134c(0x1d4),'name':_0x4ecf02[_0x53134c(0x1fc)],'existingActivation':_0x4ecf02});}return _0x57fe71;}function calculateYamlDiff(_0x38a494,_0x288eb5){if(_0x288eb5){const _0x5be259=generateDiff(_0x288eb5,_0x38a494),_0x15676d=hasChanges(_0x5be259);return{'isNew':![],'hasChanges':_0x15676d,'diff':_0x15676d?formatDiffWithColors(_0x5be259):undefined};}const _0x1a1b69=generateDiff('',_0x38a494);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1a1b69)};}export function calculateSegmentDiff(_0x26141b,_0x5f2f8d,_0x4e332c,_0x1c6fae,_0x3bca01){const _0x3c969c=segmentToYamlString(_0x26141b),_0x1c6e5c=_0x5f2f8d?segmentToYamlString(segmentWithActivationsToYaml(_0x5f2f8d,_0x4e332c,undefined,_0x1c6fae,_0x3bca01)):undefined;return calculateYamlDiff(_0x3c969c,_0x1c6e5c);}export function calculateJourneyDiff(_0x553743,_0x196f5c){const _0x1c054b=normalizeJourneyDef(_0x553743,_0x553743),_0x164ffb=a155_0x771727(_0x1c054b),_0x550038=_0x196f5c?a155_0x771727(normalizeJourneyDef(_0x196f5c,_0x553743)):undefined;return calculateYamlDiff(_0x164ffb,_0x550038);}export function findSegmentsToDelete(_0x312e36,_0x52b0eb,_0x14f00f,_0xd06c54,_0x1b53c6){const _0x3663cf=a155_0x24d83c,_0x3de45c=new Set();for(const {yamlConfig:_0x4f9f0e,folderPath:_0x2bf370}of _0x52b0eb){_0x3de45c['add'](_0x2bf370+':'+_0x4f9f0e[_0x3663cf(0x1fc)]);}return _0x312e36['filter'](_0x15caf3=>{const _0x5ebb13=_0x3663cf,_0xa277d0=_0x15caf3[_0x5ebb13(0x203)]?_0x14f00f[_0x5ebb13(0x1fa)](_0x15caf3['segmentFolderId'][_0x5ebb13(0x1b8)]())||'':'',_0x4cb2c6=_0xa277d0+':'+_0x15caf3['name'];if(_0x3de45c[_0x5ebb13(0x175)](_0x4cb2c6))return![];if(_0x1b53c6)return _0xa277d0===_0xd06c54||_0xa277d0[_0x5ebb13(0x208)](_0xd06c54+'/');return!![];});}export function findJourneysToDelete(_0x493c55,_0x3e807e,_0x15ff68,_0x4cf303,_0x4008bd){const _0x430ba1=a155_0x24d83c,_0x430d98=new Set();for(const {yamlConfig:_0x1b0f59,folderPath:_0x404554}of _0x3e807e){_0x430d98[_0x430ba1(0x1bb)](_0x404554+':'+_0x1b0f59['name']);}return _0x493c55[_0x430ba1(0x197)](_0x2be61c=>{const _0x391b3b=_0x430ba1,_0xf076c3=_0x2be61c[_0x391b3b(0x1be)]?_0x15ff68['get'](_0x2be61c['folderId'])||'':'',_0x1d2452=_0xf076c3+':'+_0x2be61c[_0x391b3b(0x182)];if(_0x430d98[_0x391b3b(0x175)](_0x1d2452))return![];if(_0x4008bd)return _0xf076c3===_0x4cf303||_0xf076c3['startsWith'](_0x4cf303+'/');return!![];});}export function buildSegmentLookupMap(_0x54f1e1,_0x41e3f1){const _0x36e506=a155_0x24d83c,_0x1e6b9d=new Map();for(const _0x1ad31e of _0x54f1e1){const _0x4ee25b=_0x1ad31e[_0x36e506(0x203)]?_0x41e3f1[_0x36e506(0x1fa)](_0x1ad31e[_0x36e506(0x203)][_0x36e506(0x1b8)]())||'':'',_0x516e83=_0x4ee25b+':'+_0x1ad31e[_0x36e506(0x1fc)];_0x1e6b9d[_0x36e506(0x169)](_0x516e83,_0x1ad31e);}return _0x1e6b9d;}export function buildSegmentNameToIdMap(_0x42abcf){const _0x3ba382=a155_0x24d83c,_0xffb546=new Map();for(const _0x4a37b5 of _0x42abcf){_0xffb546['set'](_0x4a37b5[_0x3ba382(0x1fc)],_0x4a37b5['id']);}return _0xffb546;}export function buildJourneyBundleLookupMap(_0x50d2e9,_0x195e66){const _0x4ec32b=a155_0x24d83c,_0x1b82fd=new Map();for(const _0x52641e of _0x50d2e9){const _0x399024=_0x52641e[_0x4ec32b(0x1be)]?_0x195e66[_0x4ec32b(0x1fa)](_0x52641e[_0x4ec32b(0x1be)])||'':'',_0x59a40=_0x399024+':'+_0x52641e[_0x4ec32b(0x182)];!_0x1b82fd[_0x4ec32b(0x175)](_0x59a40)&&_0x1b82fd['set'](_0x59a40,[]),_0x1b82fd[_0x4ec32b(0x1fa)](_0x59a40)[_0x4ec32b(0x21d)](_0x52641e);}for(const _0x21d9ed of _0x1b82fd[_0x4ec32b(0x237)]()){_0x21d9ed[_0x4ec32b(0x245)]((_0x16aad9,_0x42dbad)=>(_0x16aad9['versionNumber']||0x0)-(_0x42dbad['versionNumber']||0x0));}return _0x1b82fd;}export function collectFoldersToCreate(_0x241e96,_0x478cc4){const _0x27bd6=a155_0x24d83c,_0x388231=new Set();for(const _0x30ddab of _0x241e96){if(!_0x30ddab)continue;if(_0x478cc4['has'](_0x30ddab))continue;const _0xbe8278=_0x30ddab[_0x27bd6(0x187)]('/');let _0xe5f58='';for(const _0x4a47c1 of _0xbe8278){_0xe5f58=_0xe5f58?_0xe5f58+'/'+_0x4a47c1:_0x4a47c1,!_0x478cc4[_0x27bd6(0x175)](_0xe5f58)&&_0x388231[_0x27bd6(0x1bb)](_0xe5f58);}}return _0x388231;}export function parseAndClassifyYamlFiles(_0x2548cb,_0x51a7f2,_0x4566b0){const _0x4661fb=a155_0x24d83c,_0x28702d=[],_0x34cf8d=[];for(const _0x24c87b of _0x2548cb){const _0x3412fd=a155_0x3076d8['relative'](_0x51a7f2,a155_0x3076d8['dirname'](_0x24c87b)),_0x31237a=_0x3412fd==='.'?'':_0x3412fd[_0x4661fb(0x265)](/\\/g,'/'),_0x4cc79=readFileSync(_0x24c87b,_0x4661fb(0x264)),_0xbb8cc4=a155_0x1b98de['parse'](_0x4cc79);if(isJourneyDef(_0xbb8cc4)){const _0x2f3117=a155_0x384924(_0x4cc79);_0x34cf8d[_0x4661fb(0x21d)]({'yamlConfig':_0x2f3117,'folderPath':_0x31237a,'sourcePath':_0x24c87b});}else{if(!_0x4566b0?.['skipSegments']){const _0x3136c2=parseSegmentYamlFile(_0x4cc79),_0x162a00=normalizeChildSegmentYaml(_0x3136c2);_0x28702d[_0x4661fb(0x21d)]({'yamlConfig':_0x162a00,'folderPath':_0x31237a,'sourcePath':_0x24c87b});}}}return{'segments':_0x28702d,'journeys':_0x34cf8d};}export function validateParsedFiles(_0x12d0f6,_0x256b0a){const _0x3507f9=a155_0x24d83c,_0x26a0a2=[];for(const {yamlConfig:_0x55649b,sourcePath:_0x2a6125}of _0x12d0f6[_0x3507f9(0x231)]){const _0x3cc02e=readFileSync(_0x2a6125,_0x3507f9(0x264)),_0x469a31=a155_0x1b98de[_0x3507f9(0x191)](_0x3cc02e),_0x4ccc87=validateSegmentDef(_0x55649b,{'source':_0x3cc02e,'document':_0x469a31},{'skipSchema':!![]});if(!_0x4ccc87['valid']){const _0x4cf983=a155_0x3076d8[_0x3507f9(0x1d1)](_0x256b0a,_0x2a6125);_0x26a0a2[_0x3507f9(0x21d)]({'filePath':_0x4cf983,'source':_0x3cc02e,'result':_0x4ccc87,'isJourney':![]});}}for(const {yamlConfig:_0x57d1ca,sourcePath:_0x19ff98}of _0x12d0f6[_0x3507f9(0x1cc)]){const _0x3a4849=readFileSync(_0x19ff98,_0x3507f9(0x264)),_0x58b74d=a155_0x1b98de[_0x3507f9(0x191)](_0x3a4849),_0x3c51af=validateJourneyDef(_0x57d1ca,{'source':_0x3a4849,'document':_0x58b74d},{'skipSchema':!![]});if(!_0x3c51af[_0x3507f9(0x1ac)]){const _0x2692c7=a155_0x3076d8[_0x3507f9(0x1d1)](_0x256b0a,_0x19ff98);_0x26a0a2[_0x3507f9(0x21d)]({'filePath':_0x2692c7,'source':_0x3a4849,'result':_0x3c51af,'isJourney':!![]});}}return _0x26a0a2;}export function formatValidationErrors(_0x29713b){const _0x173daf=a155_0x24d83c,_0x15a8d8=[];for(const {filePath:_0x2601cf,source:_0x44c99a,result:_0x5311b7,isJourney:_0xbf9cd1}of _0x29713b){const _0x987ae2=_0xbf9cd1?'journey':'segment';_0x15a8d8[_0x173daf(0x21d)]('\x0a'+_0x2601cf+'\x20('+_0x987ae2+_0x173daf(0x1d8)+_0x5311b7[_0x173daf(0x256)][_0x173daf(0x1b3)]+_0x173daf(0x1e7)),_0x15a8d8['push'](formatValidationResult(_0x5311b7,_0x44c99a,_0x2601cf));}return _0x15a8d8[_0x173daf(0x188)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x791041){const _0x20b0cb=a155_0x24d83c,_0x9819ce=new Set(),_0x5c4da4=new Map(),_0x3099ee=collectSegmentUsageCounts(_0x791041);if(_0x791041[_0x20b0cb(0x231)])for(const [_0x19df27,_0x4bda1f]of Object[_0x20b0cb(0x1cb)](_0x791041[_0x20b0cb(0x231)])){_0x9819ce[_0x20b0cb(0x1bb)](_0x19df27);if(_0x4bda1f[_0x20b0cb(0x21a)]){const _0x1028f3=yamlRuleToApi(_0x4bda1f[_0x20b0cb(0x21a)]),_0x58644c=apiRuleToYaml(_0x1028f3);_0x5c4da4['set'](_0x19df27,_0x58644c);}}const _0x1107b2=new Map();let _0x78bb2a=0x0;for(const [_0x26d707,_0x170071]of _0x5c4da4){const _0x32ff88=serializeExpandedRule(_0x170071,_0x5c4da4),_0x804b24=_0x1107b2[_0x20b0cb(0x1fa)](_0x32ff88)||[];_0x804b24[_0x20b0cb(0x21d)]({'name':_0x26d707,'index':_0x78bb2a}),_0x1107b2[_0x20b0cb(0x169)](_0x32ff88,_0x804b24),_0x78bb2a++;}const _0x1ce357=new Map();for(const [_0x364fb4,_0x50665e]of _0x1107b2){const _0x577332=_0x50665e[_0x20b0cb(0x1ec)]()['sort']((_0x44a303,_0x166e68)=>{const _0x2715e4=_0x20b0cb,_0x3832e3=_0x3099ee[_0x2715e4(0x1fa)](_0x44a303[_0x2715e4(0x1fc)])||0x0,_0x375d68=_0x3099ee['get'](_0x166e68[_0x2715e4(0x1fc)])||0x0;if(_0x3832e3!==_0x375d68)return _0x375d68-_0x3832e3;return _0x44a303['index']-_0x166e68[_0x2715e4(0x26d)];})[_0x20b0cb(0x16e)](_0x194066=>_0x194066[_0x20b0cb(0x1fc)]),_0x467820=[];for(const _0x4951e5 of _0x577332){const _0x55fa95=_0x3099ee[_0x20b0cb(0x1fa)](_0x4951e5)||0x0,_0x2562c7=Math['max'](_0x55fa95,0x1);for(let _0x1e9329=0x0;_0x1e9329<_0x2562c7;_0x1e9329++){_0x467820['push'](_0x4951e5);}}_0x1ce357[_0x20b0cb(0x169)](_0x364fb4,_0x467820);}return{'existingLocalSegmentNames':_0x9819ce,'localSegmentRules':_0x5c4da4,'localExpandedRuleToNames':_0x1ce357};}export function createSegmentIdResolver(_0xfe77bc,_0x12f30b){return async _0x7cbf6c=>{const _0x26de91=a155_0xe8d7,_0xd69b3e=_0xfe77bc[_0x26de91(0x1fa)](_0x7cbf6c);if(!_0xd69b3e)throw new SDKError(ErrorCode[_0x26de91(0x198)],_0x26de91(0x1f8)+_0x7cbf6c+_0x26de91(0x22c)+_0x12f30b+'\x27)');return _0xd69b3e;};}export function extractRootFolderId(_0x54488d){const _0x4a44e3=a155_0x24d83c;return _0x54488d[_0x4a44e3(0x1c7)]?.['parentSegmentFolder']?.['data']?.['id']||_0x54488d[_0x4a44e3(0x1c7)]?.[_0x4a44e3(0x17d)]?.[_0x4a44e3(0x180)]?.['id'];}export function buildConnectionMaps(_0x2a6357){const _0x1ee603=a155_0x24d83c,_0x4e4209=new Map(),_0x591ea1=new Map(),_0x32838f=new Map();for(const _0x41742d of _0x2a6357){_0x4e4209['set'](_0x41742d[_0x1ee603(0x1fc)],parseInt(_0x41742d['id'],0xa)),_0x591ea1[_0x1ee603(0x169)](_0x41742d['id'],_0x41742d[_0x1ee603(0x1fc)]),_0x32838f[_0x1ee603(0x169)](_0x41742d[_0x1ee603(0x1fc)],_0x41742d['type']);}return{'nameToId':_0x4e4209,'idToName':_0x591ea1,'nameToType':_0x32838f};}export function calculatePushStats(_0x58a941,_0x3534c7,_0x4471e8,_0x2409ff,_0x5a75d6,_0xa1526a,_0x908bb4){const _0x1bc72c=a155_0x24d83c,_0x1229af=_0x58a941['filter'](_0x373454=>_0x373454[_0x1bc72c(0x258)]),_0x20f58e=_0x58a941[_0x1bc72c(0x197)](_0x43716c=>!_0x43716c[_0x1bc72c(0x258)]&&_0x43716c[_0x1bc72c(0x1e2)]),_0x594781=_0x58a941[_0x1bc72c(0x197)](_0x14cef4=>!_0x14cef4[_0x1bc72c(0x258)]&&!_0x14cef4[_0x1bc72c(0x1e2)]),_0x4d44ca=_0xa1526a?_0x2409ff:[],_0x3618ff=_0x3534c7[_0x1bc72c(0x197)](_0x24c9e8=>_0x24c9e8[_0x1bc72c(0x258)]),_0x464139=_0x3534c7[_0x1bc72c(0x197)](_0x8ecb26=>!_0x8ecb26[_0x1bc72c(0x258)]&&_0x8ecb26[_0x1bc72c(0x1e2)]),_0x24c036=_0x3534c7[_0x1bc72c(0x197)](_0x50c6db=>!_0x50c6db[_0x1bc72c(0x258)]&&!_0x50c6db[_0x1bc72c(0x1e2)]),_0x3d683f=_0xa1526a?_0x5a75d6:[],_0x28126c=_0x58a941['flatMap'](_0x38afc4=>_0x38afc4[_0x1bc72c(0x263)]),_0x427dbc=_0x28126c[_0x1bc72c(0x197)](_0x366451=>_0x366451[_0x1bc72c(0x18d)]===_0x1bc72c(0x22e)),_0x5d236c=_0x28126c[_0x1bc72c(0x197)](_0x5d7385=>_0x5d7385[_0x1bc72c(0x18d)]===_0x1bc72c(0x24c)),_0x141edd=_0x28126c[_0x1bc72c(0x197)](_0x20f750=>_0x20f750['type']===_0x1bc72c(0x1d4)),_0x2cd14f=Array[_0x1bc72c(0x1f3)](_0x4471e8)['sort'](),_0x7ef4a7=_0x908bb4?![]:_0x1229af[_0x1bc72c(0x1b3)]>0x0||_0x20f58e[_0x1bc72c(0x1b3)]>0x0||_0x4d44ca['length']>0x0,_0x3d5702=_0x3618ff[_0x1bc72c(0x1b3)]>0x0||_0x464139['length']>0x0||_0x3d683f[_0x1bc72c(0x1b3)]>0x0,_0x48a031=_0x908bb4?![]:_0x28126c[_0x1bc72c(0x1b3)]>0x0,_0x50ffee=_0x2cd14f['length']>0x0;return{'segments':{'new':_0x1229af,'changed':_0x20f58e,'unchanged':_0x594781,'toDelete':_0x4d44ca},'journeys':{'new':_0x3618ff,'changed':_0x464139,'unchanged':_0x24c036,'toDelete':_0x3d683f},'activations':{'all':_0x28126c,'toCreate':_0x427dbc,'toUpdate':_0x5d236c,'toDelete':_0x141edd},'folders':{'toCreate':_0x2cd14f},'counts':{'segments':{'new':_0x1229af[_0x1bc72c(0x1b3)],'changed':_0x20f58e[_0x1bc72c(0x1b3)],'unchanged':_0x594781['length'],'toDelete':_0x4d44ca['length']},'journeys':{'new':_0x3618ff[_0x1bc72c(0x1b3)],'changed':_0x464139[_0x1bc72c(0x1b3)],'unchanged':_0x24c036[_0x1bc72c(0x1b3)],'toDelete':_0x3d683f['length']},'activations':{'create':_0x427dbc[_0x1bc72c(0x1b3)],'update':_0x5d236c[_0x1bc72c(0x1b3)],'delete':_0x141edd[_0x1bc72c(0x1b3)]},'folders':_0x2cd14f[_0x1bc72c(0x1b3)]},'hasChanges':_0x7ef4a7||_0x3d5702||_0x48a031||_0x50ffee};}export async function buildPushExecutionContext(_0x1e1bb3,_0x51add7,_0x371805,_0xb4e655,_0x547e58,_0x432749){const _0x37f321=a155_0x24d83c,_0x4ab70b=extractRootFolderId(_0x371805),{pathToId:_0x4fa357,idToPath:_0xe7ac0}=buildFolderMaps(_0x547e58),_0x43dbab=buildSegmentNameToIdMap(_0xb4e655),_0x2828df=new Map(),{batchAsync:_0x4abde0}=await import('../../utils/async.js'),[_0xf9a988,_0x44f159]=await Promise[_0x37f321(0x1f0)]([_0x1e1bb3[_0x37f321(0x226)][_0x37f321(0x23d)](),_0x1e1bb3[_0x37f321(0x1f2)]['list'](),((async()=>{!_0x432749&&_0xb4e655['length']>0x0&&await _0x4abde0(_0xb4e655,async _0x5da4bc=>{const _0x21ac05=a155_0xe8d7,_0x53e99a=await _0x1e1bb3[_0x21ac05(0x206)][_0x21ac05(0x1c0)](_0x51add7,_0x5da4bc['id']);_0x2828df[_0x21ac05(0x169)](_0x5da4bc['id'],_0x53e99a);});})())]),{emailToId:_0x8b5e64,idToEmail:_0x2410d1}=_0xf9a988,_0x5e2f8c=buildConnectionMaps(_0x44f159);return{'rootFolderId':_0x4ab70b,'folderPathToId':_0x4fa357,'folderIdToPath':_0xe7ac0,'segmentNameToId':_0x43dbab,'activationsBySegmentId':_0x2828df,'emailToIdMap':_0x8b5e64,'idToEmailMap':_0x2410d1,'connectionNameToIdMap':_0x5e2f8c[_0x37f321(0x1e0)],'connectionIdToNameMap':_0x5e2f8c[_0x37f321(0x1c2)],'connectionNameToTypeMap':_0x5e2f8c[_0x37f321(0x1e5)]};}export function createPushYamlContextForBundle(_0x5b1cd0,_0x5e5394,_0x1b0727,_0x421227,_0x3a8bb2,_0xe6f081,_0x92d162,_0x23dfa9){const {existingLocalSegmentNames:_0x270293,localExpandedRuleToNames:_0x3fccf4}=_0x421227,_0x5ca56e=new Set(),_0x494ede=new Map(),_0x32e326=new Map(),_0x3ef9f2=new Map(),_0x41cab4=createJumpTargetCache(),_0x1c3f9d=new Map(),_0x297eab=new Map(),_0x15c0ae=new Set();let _0x30bd91;const _0xa97ee2=_0x4f96d0=>{const _0x219bc1={'resolveSegment':async _0x5c8e5e=>{const _0x48bd7=a155_0xe8d7,_0x3769a2=_0x3ef9f2[_0x48bd7(0x1fa)](_0x5c8e5e);if(_0x3769a2!==undefined)return{'name':_0x3769a2,'isJourneyLocal':!![]};try{const _0x3de607=await fetchSegment(_0x5b1cd0,_0x5e5394,_0x5c8e5e,_0x1b0727);if(!_0x3de607)throw new Error(_0x48bd7(0x1e4));const _0x2ec8a6=generateJourneyLocalName(_0x3de607[_0x48bd7(0x1fc)]),_0x234f1c=_0x3de607[_0x48bd7(0x1a8)]===SEGMENT_KIND_JOURNEY&&_0x2ec8a6!==undefined;let _0x13952f=_0x3de607['name'],_0x5aa228;if(_0x234f1c&&_0x3de607[_0x48bd7(0x21a)]){const _0x3e51c1=apiRuleToYaml(_0x3de607[_0x48bd7(0x21a)]);_0x297eab[_0x48bd7(0x169)](_0x5c8e5e,_0x3e51c1);const _0x2b5a01=async _0x115fef=>{const _0x47c3af=_0x48bd7,_0xdc83db=collectSegmentRefsFromRule(_0x115fef);for(const _0x26f48d of _0xdc83db){if(!_0x297eab[_0x47c3af(0x175)](_0x26f48d))try{const _0xf70949=await fetchSegment(_0x5b1cd0,_0x5e5394,_0x26f48d,_0x1b0727);if(_0xf70949?.[_0x47c3af(0x21a)]){const _0x4f2d0=apiRuleToYaml(_0xf70949[_0x47c3af(0x21a)]);_0x297eab[_0x47c3af(0x169)](_0x26f48d,_0x4f2d0),await _0x2b5a01(_0x4f2d0);}}catch(_0xcd1ed3){logger[_0x47c3af(0x1ca)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x26f48d+':\x20'+_0xcd1ed3);}}};await _0x2b5a01(_0x3e51c1);const _0x19b0b9=serializeExpandedRule(_0x3e51c1,_0x297eab),_0x20e9a7=_0x3fccf4[_0x48bd7(0x1fa)](_0x19b0b9);if(_0x20e9a7&&_0x20e9a7['length']>0x0){const _0x53a1ae=_0x494ede['get'](_0x19b0b9)||0x0,_0x57a8d8=_0x20e9a7[_0x53a1ae]||_0x20e9a7[_0x20e9a7[_0x48bd7(0x1b3)]-0x1];_0x494ede[_0x48bd7(0x169)](_0x19b0b9,_0x53a1ae+0x1),_0x13952f=_0x57a8d8,_0x5ca56e[_0x48bd7(0x1bb)](_0x13952f),_0x3ef9f2['set'](_0x5c8e5e,_0x13952f);const _0x464202=await resolveRuleSegmentRefs(_0x3e51c1,async _0x399548=>{const _0x45355e=_0x48bd7,_0x2f5a93=_0x3ef9f2[_0x45355e(0x1fa)](_0x399548);if(_0x2f5a93)return _0x2f5a93;const _0x6f717=await _0x30bd91[_0x45355e(0x1b5)](_0x399548);return _0x6f717[_0x45355e(0x1fc)];});_0x5aa228={'description':_0x3de607[_0x48bd7(0x243)],'rule':_0x464202};}else{const _0x4409fe=_0x1c3f9d[_0x48bd7(0x1fa)](_0x19b0b9);if(_0x4409fe)_0x13952f=_0x4409fe,_0x3ef9f2[_0x48bd7(0x169)](_0x5c8e5e,_0x13952f);else{if(_0x2ec8a6){let _0x3dc5bb=_0x2ec8a6,_0x17a365=0x2;while(_0x5ca56e[_0x48bd7(0x175)](_0x3dc5bb)||_0x270293[_0x48bd7(0x175)](_0x3dc5bb)){_0x3dc5bb=_0x2ec8a6+'_'+_0x17a365,_0x17a365++;}_0x5ca56e[_0x48bd7(0x1bb)](_0x3dc5bb),_0x13952f=_0x3dc5bb;}_0x3ef9f2['set'](_0x5c8e5e,_0x13952f),_0x1c3f9d[_0x48bd7(0x169)](_0x19b0b9,_0x13952f);const _0x53bdcd=await resolveRuleSegmentRefs(_0x3e51c1,async _0x444da4=>{const _0x1567de=_0x48bd7,_0x3ed8c8=_0x3ef9f2[_0x1567de(0x1fa)](_0x444da4);if(_0x3ed8c8)return _0x3ed8c8;const _0x1c0a15=await _0x30bd91[_0x1567de(0x1b5)](_0x444da4);return _0x1c0a15[_0x1567de(0x1fc)];});_0x5aa228={'description':_0x3de607[_0x48bd7(0x243)],'rule':_0x53bdcd};}}}return{'name':_0x13952f,'isJourneyLocal':_0x234f1c,'definition':_0x5aa228};}catch(_0x5ad4d8){return logger[_0x48bd7(0x1ca)]('Failed\x20to\x20resolve\x20segment\x20'+_0x5c8e5e+':\x20'+_0x5ad4d8),{'name':_0x5c8e5e,'isJourneyLocal':![]};}},'resolveActivation':async _0x59d299=>{const _0x42d006=a155_0xe8d7,_0x39f34e=_0x32e326[_0x42d006(0x1fa)](_0x59d299);if(_0x39f34e!==undefined)return{'name':_0x39f34e,'isJourneyLocal':!![]};try{let _0x895646=_0x92d162?.[_0x42d006(0x1fa)](_0x59d299);!_0x895646&&(_0x895646=await _0x5b1cd0[_0x42d006(0x21c)][_0x42d006(0x24e)](_0x4f96d0,_0x59d299));const _0x1a5ed6=_0x895646[_0x42d006(0x200)][_0x42d006(0x1d6)][_0x42d006(0x1fc)]||_0x59d299,_0x25cbfa=sanitizeYamlKey(_0x1a5ed6)||_0x42d006(0x1b0)+_0x59d299,_0x199918=_0x25cbfa;_0x32e326['set'](_0x59d299,_0x199918);const _0x20cd85=journeyActivationStepToYaml(_0x895646,_0x3a8bb2,_0xe6f081);return{'name':_0x199918,'isJourneyLocal':!![],'definition':_0x20cd85};}catch(_0xdc6a99){return logger['debug'](_0x42d006(0x26c)+_0x59d299+':\x20'+_0xdc6a99),{'name':_0x59d299,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x39d64c,_0x4dc019)=>resolveJumpTarget(_0x39d64c,_0x4dc019,_0x41cab4,async _0x3b6503=>{const _0x1b9c06=a155_0xe8d7,_0x3f47c2=_0x23dfa9?.[_0x1b9c06(0x1fa)](_0x3b6503);if(_0x3f47c2)return _0x3f47c2;return _0x5b1cd0['journey'][_0x1b9c06(0x23a)](_0x3b6503);})};return _0x30bd91=_0x219bc1,_0x219bc1;},_0x3bd605=async _0x2d5ffc=>{const _0x449c76=a155_0xe8d7,{collectSegmentIdsFromJourneyApi:_0x31468e}=await import('./journey-yaml.js'),{batchAsync:_0x5e0625}=await import('../../utils/async.js'),_0xd63e1d=new Set();for(const _0x4a0532 of _0x2d5ffc){let _0x26ef65=_0x23dfa9?.[_0x449c76(0x1fa)](_0x4a0532);!_0x26ef65&&(_0x26ef65=await _0x5b1cd0[_0x449c76(0x21c)][_0x449c76(0x23a)](_0x4a0532));const _0x54dc75=_0x31468e(_0x26ef65);for(const _0x5b416b of _0x54dc75){_0xd63e1d['add'](_0x5b416b);}}let _0x17c454=Array[_0x449c76(0x1f3)](_0xd63e1d);while(_0x17c454['length']>0x0){const _0x49c1a9=_0x17c454[_0x449c76(0x197)](_0x2c4ded=>!_0x15c0ae[_0x449c76(0x175)](_0x2c4ded));if(_0x49c1a9['length']===0x0)break;const _0x565208=await _0x5e0625(_0x49c1a9,async _0x58586b=>{_0x15c0ae['add'](_0x58586b);const _0x565cfe=await fetchSegment(_0x5b1cd0,_0x5e5394,_0x58586b,_0x1b0727);if(!_0x565cfe)return null;return{'segmentId':_0x58586b,'segment':_0x565cfe};},0xa),_0x3df747=new Set();for(const _0x3a4fe3 of _0x565208){if(!_0x3a4fe3?.[_0x449c76(0x206)]?.[_0x449c76(0x21a)])continue;const _0xb088d0=apiRuleToYaml(_0x3a4fe3[_0x449c76(0x206)][_0x449c76(0x21a)]);_0x297eab['set'](_0x3a4fe3[_0x449c76(0x18e)],_0xb088d0);const _0x46a43d=collectSegmentRefsFromRule(_0xb088d0);for(const _0x5c5c26 of _0x46a43d){!_0x15c0ae[_0x449c76(0x175)](_0x5c5c26)&&_0x3df747[_0x449c76(0x1bb)](_0x5c5c26);}}_0x17c454=Array['from'](_0x3df747);}};return{'createYamlContext':_0xa97ee2,'prefetchJourneySegments':_0x3bd605};}export async function executePushSegments(_0x496d95,_0x34f89f,_0x2e88e7,_0x2e8ea8,_0x505405){const _0xdc72ee=a155_0x24d83c,{segmentDefToCreateRequest:_0x13be7d,segmentDefToUpdateRequest:_0x3153eb}=await import(_0xdc72ee(0x224)),_0x221947=_0x2e88e7[_0xdc72ee(0x220)],_0x31338c=0x5,_0x1d5cf9=async _0x331f58=>{const _0x112eef=_0xdc72ee,_0xd31707=_0x331f58[_0x112eef(0x1bc)]?_0x221947[_0x112eef(0x1fa)](_0x331f58['folderPath']):undefined;let _0x2e94cb;const _0x46f67f={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x64e868=_0x331f58[_0x112eef(0x1cf)];if(_0x331f58['yamlConfig'][_0x112eef(0x21a)]){const _0x4906ba=createSegmentIdResolver(_0x2e88e7['segmentNameToId'],_0x331f58['yamlConfig'][_0x112eef(0x1fc)]),_0x377ebf=await resolveRuleSegmentIds(_0x331f58['yamlConfig'][_0x112eef(0x21a)],_0x4906ba);_0x64e868={..._0x331f58[_0x112eef(0x1cf)],'rule':_0x377ebf};}try{if(_0x331f58[_0x112eef(0x258)]){_0x505405[_0x112eef(0x1ef)]?.({'type':_0x112eef(0x26e),'name':_0x331f58[_0x112eef(0x1cf)][_0x112eef(0x1fc)]});const _0x2aaea1=_0x13be7d(_0x64e868,_0xd31707),_0x32e4dc=await _0x505405[_0x112eef(0x238)]('Creating\x20segment\x20\x27'+_0x331f58[_0x112eef(0x1cf)][_0x112eef(0x1fc)]+'\x27...',()=>_0x496d95[_0x112eef(0x206)][_0x112eef(0x255)](_0x2e8ea8[_0x112eef(0x171)],_0x2aaea1));_0x2e94cb=_0x32e4dc['data']['id'],_0x2e88e7['segmentNameToId'][_0x112eef(0x169)](_0x331f58['yamlConfig'][_0x112eef(0x1fc)],_0x2e94cb),_0x46f67f[_0x112eef(0x199)]={'name':_0x331f58[_0x112eef(0x1cf)][_0x112eef(0x1fc)],'id':_0x2e94cb},_0x505405[_0x112eef(0x1ef)]?.({'type':'segment_created','name':_0x331f58[_0x112eef(0x1cf)][_0x112eef(0x1fc)],'segmentId':_0x2e94cb}),_0x505405[_0x112eef(0x204)]?.(_0x112eef(0x1c8)+_0x331f58['yamlConfig'][_0x112eef(0x1fc)]+'\x27'),_0x46f67f[_0x112eef(0x24f)]=0x1;}else{if(_0x331f58[_0x112eef(0x1e2)]){_0x505405[_0x112eef(0x1ef)]?.({'type':_0x112eef(0x229),'name':_0x331f58[_0x112eef(0x1cf)][_0x112eef(0x1fc)]});const _0x3cbc2c=_0x3153eb(_0x64e868);_0xd31707!==_0x331f58[_0x112eef(0x246)]?.[_0x112eef(0x203)]&&(_0x3cbc2c[_0x112eef(0x203)]=_0xd31707?parseInt(_0xd31707,0xa):undefined),await _0x505405['withProgress']('Updating\x20segment\x20\x27'+_0x331f58[_0x112eef(0x1cf)][_0x112eef(0x1fc)]+_0x112eef(0x1ce),()=>_0x496d95[_0x112eef(0x206)]['updateSegmentById'](_0x2e8ea8[_0x112eef(0x171)],_0x331f58[_0x112eef(0x246)]['id'],_0x3cbc2c)),_0x2e94cb=_0x331f58[_0x112eef(0x246)]['id'],_0x505405['onProgress']?.({'type':_0x112eef(0x19a),'name':_0x331f58[_0x112eef(0x1cf)][_0x112eef(0x1fc)]}),_0x505405[_0x112eef(0x204)]?.('Updated\x20segment\x20\x27'+_0x331f58[_0x112eef(0x1cf)][_0x112eef(0x1fc)]+'\x27'),_0x46f67f['updated']=0x1;}else _0x2e94cb=_0x331f58[_0x112eef(0x246)]['id'];}}catch(_0x13e420){const _0x241bde=isHttp400Error(_0x13e420),_0x226b22=_0x241bde?ErrorCode[_0x112eef(0x1e9)]:ErrorCode[_0x112eef(0x18b)],_0x4e6bc4=getErrorMessage(_0x13e420);throw new SDKError(_0x226b22,_0x112eef(0x201)+(_0x331f58[_0x112eef(0x258)]?_0x112eef(0x22e):_0x112eef(0x24c))+_0x112eef(0x17a)+_0x331f58[_0x112eef(0x20a)]+'\x0a\x20\x20'+_0x4e6bc4,_0x13e420);}try{const _0x3d9edb=await syncActivationsForSegment(_0x496d95,_0x2e8ea8[_0x112eef(0x171)],_0x2e94cb,_0x331f58[_0x112eef(0x1cf)][_0x112eef(0x1fc)],_0x331f58[_0x112eef(0x263)],_0x505405,_0x331f58['absolutePath']);_0x46f67f[_0x112eef(0x1de)]=_0x3d9edb;}catch(_0x329449){if(_0x329449 instanceof SDKError)throw _0x329449;throw new SDKError(ErrorCode[_0x112eef(0x1db)],_0x112eef(0x266)+_0x331f58[_0x112eef(0x1cf)][_0x112eef(0x1fc)]+_0x112eef(0x1b6)+_0x331f58[_0x112eef(0x20a)]+_0x112eef(0x186)+getErrorMessage(_0x329449),_0x329449);}return _0x46f67f;},_0x29d285=await batchAsync(_0x34f89f,_0x1d5cf9,_0x31338c),_0x5756c6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2e9ca0 of _0x29d285){_0x5756c6[_0xdc72ee(0x24f)]+=_0x2e9ca0[_0xdc72ee(0x24f)],_0x5756c6[_0xdc72ee(0x18c)]+=_0x2e9ca0[_0xdc72ee(0x18c)],_0x2e9ca0[_0xdc72ee(0x199)]&&_0x5756c6['createdSegmentIds'][_0xdc72ee(0x169)](_0x2e9ca0[_0xdc72ee(0x199)][_0xdc72ee(0x1fc)],_0x2e9ca0[_0xdc72ee(0x199)]['id']),_0x5756c6[_0xdc72ee(0x1de)]['created']+=_0x2e9ca0[_0xdc72ee(0x1de)]['created'],_0x5756c6[_0xdc72ee(0x1de)][_0xdc72ee(0x18c)]+=_0x2e9ca0[_0xdc72ee(0x1de)][_0xdc72ee(0x18c)],_0x5756c6[_0xdc72ee(0x1de)]['deleted']+=_0x2e9ca0[_0xdc72ee(0x1de)]['deleted'];}return _0x5756c6;}async function syncActivationsForSegment(_0x370e57,_0x2fa39b,_0x51b6c2,_0x2d1503,_0x4175af,_0x23dd92,_0x587e42){const _0x5c15d3=a155_0x24d83c,_0x400191={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5b2d7f of _0x4175af){try{if(_0x5b2d7f[_0x5c15d3(0x18d)]==='create'&&_0x5b2d7f[_0x5c15d3(0x1d0)])_0x23dd92['onProgress']?.({'type':_0x5c15d3(0x1e1),'segmentName':_0x2d1503,'activationName':_0x5b2d7f[_0x5c15d3(0x1fc)]}),await _0x23dd92['withProgress'](_0x5c15d3(0x232)+_0x5b2d7f[_0x5c15d3(0x1fc)]+_0x5c15d3(0x1ce),()=>_0x370e57[_0x5c15d3(0x206)][_0x5c15d3(0x20c)](_0x2fa39b,_0x51b6c2,_0x5b2d7f[_0x5c15d3(0x1d0)])),_0x23dd92[_0x5c15d3(0x1ef)]?.({'type':_0x5c15d3(0x1af),'segmentName':_0x2d1503,'activationName':_0x5b2d7f[_0x5c15d3(0x1fc)]}),_0x23dd92[_0x5c15d3(0x204)]?.(_0x5c15d3(0x1ff)+_0x5b2d7f[_0x5c15d3(0x1fc)]+'\x27'),_0x400191[_0x5c15d3(0x24f)]++;else{if(_0x5b2d7f['type']===_0x5c15d3(0x24c)&&_0x5b2d7f[_0x5c15d3(0x1d0)]&&_0x5b2d7f[_0x5c15d3(0x215)])_0x23dd92[_0x5c15d3(0x1ef)]?.({'type':_0x5c15d3(0x239),'segmentName':_0x2d1503,'activationName':_0x5b2d7f[_0x5c15d3(0x1fc)]}),await _0x23dd92[_0x5c15d3(0x238)](_0x5c15d3(0x174)+_0x5b2d7f[_0x5c15d3(0x1fc)]+_0x5c15d3(0x1ce),()=>_0x370e57[_0x5c15d3(0x206)][_0x5c15d3(0x1a2)](_0x2fa39b,_0x51b6c2,_0x5b2d7f[_0x5c15d3(0x215)]['id'],_0x5b2d7f['validatedRequest'])),_0x23dd92[_0x5c15d3(0x1ef)]?.({'type':'activation_updated','segmentName':_0x2d1503,'activationName':_0x5b2d7f[_0x5c15d3(0x1fc)]}),_0x23dd92[_0x5c15d3(0x204)]?.(_0x5c15d3(0x222)+_0x5b2d7f[_0x5c15d3(0x1fc)]+'\x27'),_0x400191[_0x5c15d3(0x18c)]++;else _0x5b2d7f['type']===_0x5c15d3(0x1d4)&&_0x5b2d7f['existingActivation']&&(_0x23dd92[_0x5c15d3(0x1ef)]?.({'type':_0x5c15d3(0x23b),'segmentName':_0x2d1503,'activationName':_0x5b2d7f['name']}),await _0x23dd92[_0x5c15d3(0x238)](_0x5c15d3(0x1c5)+_0x5b2d7f[_0x5c15d3(0x1fc)]+_0x5c15d3(0x1ce),()=>_0x370e57[_0x5c15d3(0x206)][_0x5c15d3(0x1d9)](_0x2fa39b,_0x51b6c2,_0x5b2d7f[_0x5c15d3(0x215)]['id'])),_0x23dd92['onProgress']?.({'type':_0x5c15d3(0x1a0),'segmentName':_0x2d1503,'activationName':_0x5b2d7f['name']}),_0x23dd92[_0x5c15d3(0x16f)]?.(_0x5c15d3(0x1da)+_0x5b2d7f[_0x5c15d3(0x1fc)]+'\x27'),_0x400191[_0x5c15d3(0x262)]++);}}catch(_0x2f45f7){const _0x4962de=isHttp400Error(_0x2f45f7),_0x563de8=_0x4962de?ErrorCode[_0x5c15d3(0x22a)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x388d7a=getErrorMessage(_0x2f45f7);throw new SDKError(_0x563de8,_0x5c15d3(0x201)+_0x5b2d7f[_0x5c15d3(0x18d)]+_0x5c15d3(0x1ad)+_0x5b2d7f['name']+_0x5c15d3(0x1b6)+_0x587e42+'\x0a\x20\x20'+_0x388d7a,_0x2f45f7);}}return _0x400191;}export async function executePushFolders(_0x56dab8,_0x16ced8,_0x2e9425,_0x1be0bd,_0x167265){const _0x1bfeca=a155_0x24d83c,_0x50528b=new Map(_0x2e9425),_0x8cf7dc=sortFoldersByDepth(_0x16ced8);for(const _0x2001fb of _0x8cf7dc){const _0x257b8=_0x2001fb[_0x1bfeca(0x187)]('/'),_0x3a8900=_0x257b8[_0x257b8[_0x1bfeca(0x1b3)]-0x1],_0x3de86c=_0x257b8[_0x1bfeca(0x1ec)](0x0,-0x1)['join']('/'),_0x483bb1=_0x50528b[_0x1bfeca(0x1fa)](_0x3de86c);_0x167265[_0x1bfeca(0x1ef)]?.({'type':'folder_creating','folder':_0x2001fb});const _0x5b391a={'name':_0x3a8900,'parentFolderId':_0x483bb1},_0x5905ef=await _0x167265[_0x1bfeca(0x238)](_0x1bfeca(0x214)+_0x2001fb+_0x1bfeca(0x1ce),()=>_0x56dab8[_0x1bfeca(0x206)][_0x1bfeca(0x216)](_0x1be0bd['parentId'],_0x5b391a));_0x50528b[_0x1bfeca(0x169)](_0x2001fb,_0x5905ef['data']['id']),_0x167265[_0x1bfeca(0x1ef)]?.({'type':_0x1bfeca(0x228),'folder':_0x2001fb,'folderId':_0x5905ef[_0x1bfeca(0x180)]['id']}),_0x167265[_0x1bfeca(0x1f9)]?.('Created\x20folder\x20\x27'+_0x2001fb+'\x27');}return _0x50528b;}export async function executePushSegmentDeletions(_0x2f4594,_0x387f49,_0x31cb5b){const _0x2644ff=a155_0x24d83c;if(_0x387f49[_0x2644ff(0x1b3)]===0x0)return 0x0;const {batchAsync:_0x532f54}=await import(_0x2644ff(0x23e)),_0x47d112=0x5,_0x5e4561=await _0x532f54(_0x387f49,async _0x2c13a5=>{const _0x19d92f=_0x2644ff;return _0x31cb5b[_0x19d92f(0x1ef)]?.({'type':_0x19d92f(0x19d),'name':_0x2c13a5[_0x19d92f(0x1fc)]}),await _0x2f4594[_0x19d92f(0x206)][_0x19d92f(0x1b4)](_0x2c13a5['id']),_0x31cb5b['onProgress']?.({'type':_0x19d92f(0x1cd),'name':_0x2c13a5[_0x19d92f(0x1fc)]}),_0x31cb5b['logDeleted']?.(_0x19d92f(0x24d)+_0x2c13a5['name']+'\x27'),0x1;},_0x47d112);return _0x5e4561[_0x2644ff(0x244)]((_0x107a84,_0x1354f7)=>_0x107a84+_0x1354f7,0x0);}export async function executePushJourneys(_0x90512a,_0x37c41e,_0x18c3ff,_0x283455,_0x2efb1e){const _0x699f49=a155_0x24d83c,{journeyDefToRequest:_0xcc4f3d}=await import(_0x699f49(0x17e)),{activationDefToCreateRequest:_0x42ed09,yamlRuleToApi:_0x3c8f37,validateSegmentRule:_0x43b7cd}=await import(_0x699f49(0x224)),_0x2c5aa0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x406bb4=new Map(_0x18c3ff['segmentNameToId']),_0x45793f=0x5;for(let _0x31b93d=0x0;_0x31b93d<_0x37c41e['length'];_0x31b93d+=_0x45793f){const _0x17de8a=_0x37c41e[_0x699f49(0x1ec)](_0x31b93d,_0x31b93d+_0x45793f),_0x3c5bf5=await Promise[_0x699f49(0x1f0)](_0x17de8a['map'](async _0x34d77a=>{const _0x4e5e13=_0x699f49;if(!_0x34d77a[_0x4e5e13(0x258)]&&!_0x34d77a[_0x4e5e13(0x1e2)])return{'action':_0x4e5e13(0x1ba),'name':_0x34d77a[_0x4e5e13(0x1cf)]['name'],'journeyId':_0x34d77a[_0x4e5e13(0x16a)]?.['id']};const _0x11a520=_0x34d77a['folderPath']?_0x18c3ff['folderPathToId'][_0x4e5e13(0x1fa)](_0x34d77a[_0x4e5e13(0x1bc)]):undefined;_0x2efb1e[_0x4e5e13(0x1ef)]?.({'type':_0x34d77a[_0x4e5e13(0x258)]?_0x4e5e13(0x1e6):_0x4e5e13(0x176),'name':_0x34d77a[_0x4e5e13(0x1cf)]['name']});try{const _0x1db120=await executeSingleJourneyPush(_0x90512a,_0x34d77a,{..._0x18c3ff,'segmentNameToId':_0x406bb4},{'parentId':_0x283455[_0x4e5e13(0x171)],'rootFolderId':_0x283455[_0x4e5e13(0x267)],'folderId':_0x11a520,'verbose':_0x283455['verbose']},_0x2efb1e,{'journeyDefToRequest':_0xcc4f3d,'activationDefToCreateRequest':_0x42ed09,'yamlRuleToApi':_0x3c8f37,'validateSegmentRule':_0x43b7cd});for(const [_0x550088,_0x21e1f9]of _0x1db120['embeddedSegmentNameToId']){_0x406bb4[_0x4e5e13(0x169)](_0x550088,_0x21e1f9),_0x2c5aa0['embeddedSegmentNameToId']['set'](_0x550088,_0x21e1f9);}if(_0x1db120[_0x4e5e13(0x23f)]===_0x4e5e13(0x24f))_0x2efb1e[_0x4e5e13(0x1ef)]?.({'type':_0x4e5e13(0x1c1),'name':_0x34d77a[_0x4e5e13(0x1cf)][_0x4e5e13(0x1fc)],'journeyId':_0x1db120[_0x4e5e13(0x1a1)]}),_0x2efb1e[_0x4e5e13(0x204)]?.(_0x4e5e13(0x181)+_0x34d77a[_0x4e5e13(0x1cf)][_0x4e5e13(0x1fc)]+'\x27'),_0x2c5aa0[_0x4e5e13(0x24f)]++;else _0x1db120[_0x4e5e13(0x23f)]==='updated'&&(_0x2efb1e[_0x4e5e13(0x1ef)]?.({'type':'journey_updated','name':_0x34d77a[_0x4e5e13(0x1cf)][_0x4e5e13(0x1fc)]}),_0x2efb1e[_0x4e5e13(0x204)]?.('Updated\x20journey\x20\x27'+_0x34d77a[_0x4e5e13(0x1cf)][_0x4e5e13(0x1fc)]+'\x27'),_0x2c5aa0['updated']++);return{'action':_0x1db120[_0x4e5e13(0x23f)],'name':_0x34d77a[_0x4e5e13(0x1cf)][_0x4e5e13(0x1fc)],'journeyId':_0x1db120[_0x4e5e13(0x1a1)]};}catch(_0x226250){const _0x378a21=isHttp400Error(_0x226250),_0xd6bbb6=_0x378a21?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x4e5e13(0x1d2)],_0x2de798=getErrorMessage(_0x226250);throw new SDKError(_0xd6bbb6,_0x4e5e13(0x201)+(_0x34d77a[_0x4e5e13(0x258)]?_0x4e5e13(0x22e):'update')+_0x4e5e13(0x269)+_0x34d77a[_0x4e5e13(0x20a)]+_0x4e5e13(0x186)+_0x2de798,_0x226250);}}));_0x2c5aa0[_0x699f49(0x205)][_0x699f49(0x21d)](..._0x3c5bf5);}return _0x2c5aa0;}async function matchExistingJourneySegments(_0x1982bf,_0x21e44d,_0x2df260,_0x5bc171,_0x4ddd4b){const _0x5e470c=a155_0x24d83c;if(!_0x21e44d['existingJourney']||!_0x21e44d[_0x5e470c(0x1cf)][_0x5e470c(0x231)])return;const _0x35e923=new Map(),_0xc4305d=new Set();for(const _0x21e5d8 of Object[_0x5e470c(0x19c)](_0x21e44d['yamlConfig'][_0x5e470c(0x231)])){const _0x18204c=generateDeterministicJourneySegmentName(_0x21e44d['yamlConfig'][_0x5e470c(0x1fc)],_0x21e5d8);_0x35e923['set'](_0x18204c,_0x21e5d8),_0xc4305d[_0x5e470c(0x1bb)](_0x21e5d8);}const _0x5e1b0a=[],_0x59d627=collectSegmentIdsFromJourneyApi(_0x21e44d[_0x5e470c(0x16a)]);for(const _0x515755 of _0x59d627){const _0x519938=await fetchSegment(_0x1982bf,_0x2df260,_0x515755,_0x5bc171);if(!_0x519938?.[_0x5e470c(0x1fc)])continue;const _0x3fb8bb=_0x35e923[_0x5e470c(0x1fa)](_0x519938[_0x5e470c(0x1fc)]);_0x3fb8bb?(_0x4ddd4b[_0x5e470c(0x169)](_0x3fb8bb,_0x515755),_0xc4305d[_0x5e470c(0x1d4)](_0x3fb8bb)):_0x5e1b0a['push']({'id':_0x515755,'seg':_0x519938});}if(_0xc4305d[_0x5e470c(0x17f)]>0x0&&_0x5e1b0a[_0x5e470c(0x1b3)]>0x0){const {localExpandedRuleToNames:_0xa55fcd}=buildLocalExpandedRuleMappings(_0x21e44d[_0x5e470c(0x1cf)]),_0x3eb365=new Map();for(const {id:_0x462e03,seg:_0x38552b}of _0x5e1b0a){if(_0x38552b[_0x5e470c(0x21a)]){const _0x232e09=apiRuleToYaml(_0x38552b[_0x5e470c(0x21a)]);_0x3eb365[_0x5e470c(0x169)](_0x462e03,_0x232e09);}}for(const {id:_0x1f63f0,seg:_0x3920c0}of _0x5e1b0a){if(!_0x3920c0[_0x5e470c(0x21a)])continue;const _0x1bd83b=_0x3eb365[_0x5e470c(0x1fa)](_0x1f63f0);if(!_0x1bd83b)continue;const _0x1e566c=serializeExpandedRule(_0x1bd83b,_0x3eb365),_0x58ccaa=_0xa55fcd[_0x5e470c(0x1fa)](_0x1e566c);if(_0x58ccaa){const _0x39006f=_0x58ccaa[_0x5e470c(0x172)](_0x46a86f=>_0xc4305d[_0x5e470c(0x175)](_0x46a86f));_0x39006f&&(_0x4ddd4b[_0x5e470c(0x169)](_0x39006f,_0x1f63f0),_0xc4305d[_0x5e470c(0x1d4)](_0x39006f),logger[_0x5e470c(0x1ca)](_0x5e470c(0x213)+_0x3920c0['name']+_0x5e470c(0x259)+_0x39006f+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x5338b9,_0x2cd705,_0x3e8653,_0x4b6551,_0x263f58,_0x507707){const _0x3e78d4=a155_0x24d83c,{journeyDefToRequest:_0x132216,activationDefToCreateRequest:_0x3c05bc,yamlRuleToApi:_0x287c3e,validateSegmentRule:_0x5df5ae}=_0x507707,_0x35b646=new Map(),_0x2ad25c=new Map();recoverSegmentIdsFromPushRecovery(_0x2cd705,_0x35b646,_0x3e8653['segmentNameToId']);const _0x55359a=new Map(),_0x5ba672=new Map(),_0x2cca0b=new Map();let _0x232edf;const _0x4a989c=async()=>{const _0x244171=a155_0xe8d7;if(_0x232edf)return;_0x232edf=new Map();if(!_0x2cd705[_0x244171(0x16a)])return;const _0x3213a5=await _0x5338b9[_0x244171(0x21c)][_0x244171(0x1c0)](_0x2cd705[_0x244171(0x16a)]['id']);for(const _0x222c60 of _0x3213a5){const _0x29f61b=journeyActivationStepToYaml(_0x222c60,_0x3e8653[_0x244171(0x254)],_0x3e8653[_0x244171(0x1b1)]),_0x241dc3=activationSignature(_0x29f61b);!_0x232edf[_0x244171(0x175)](_0x241dc3)&&_0x232edf[_0x244171(0x169)](_0x241dc3,_0x222c60['id']),_0x29f61b[_0x244171(0x1fc)]&&_0x2ad25c['set'](_0x29f61b[_0x244171(0x1fc)],_0x222c60['id']);}};await matchExistingJourneySegments(_0x5338b9,_0x2cd705,_0x4b6551[_0x3e78d4(0x171)],_0x3e8653[_0x3e78d4(0x1e3)],_0x3e8653['segmentNameToId']);const _0x108930={'resolveSegmentId':async _0x47e6f8=>{const _0x2e831b=_0x3e78d4,_0x1adfe8=_0x3e8653[_0x2e831b(0x24b)]['get'](_0x47e6f8);if(!_0x1adfe8)throw new SDKError(ErrorCode[_0x2e831b(0x198)],_0x2e831b(0x1f8)+_0x47e6f8+'\x20(referenced\x20in\x20journey\x20'+_0x2cd705[_0x2e831b(0x1cf)][_0x2e831b(0x1fc)]+')');return _0x1adfe8;},'resolveEmbeddedSegmentId':async(_0x2e7a24,_0x37803f)=>{const _0x5bca94=_0x3e78d4,_0x3adc9b=_0x3e8653[_0x5bca94(0x24b)][_0x5bca94(0x1fa)](_0x2e7a24);if(_0x3adc9b)return _0x3adc9b;const _0x314a5c=_0x3e8653['existingSegments'][_0x5bca94(0x172)](_0x42c41c=>_0x42c41c[_0x5bca94(0x1fc)]===_0x2e7a24);if(_0x314a5c)return _0x3e8653['segmentNameToId']['set'](_0x2e7a24,_0x314a5c['id']),_0x314a5c['id'];if(_0x2cd705['isNew']){const {stageName:_0x16e2a6,criteriaName:_0x30875a}=findSegmentCriteriaLocation(_0x2cd705['yamlConfig'],_0x2e7a24);return _0x5df5ae(_0x2e7a24,_0x37803f[_0x5bca94(0x21a)]),_0x5ba672[_0x5bca94(0x169)](_0x2e7a24,{'definition':_0x37803f,'stageName':_0x16e2a6,'criteriaName':_0x30875a}),createPendingSegmentId(_0x2e7a24);}const _0x47c03b=_0x2cd705['existingJourney']?.['id'];if(!_0x47c03b)throw new SDKError(ErrorCode['INTERNAL'],_0x5bca94(0x209));const _0x249cec=_0x55359a[_0x5bca94(0x1fa)](_0x2e7a24);if(_0x249cec)return _0x249cec;const _0x86f21b=((async()=>{const _0x3fabdf=_0x5bca94;_0x5df5ae(_0x2e7a24,_0x37803f['rule']);const _0x6d8985=generateDeterministicJourneySegmentName(_0x2cd705[_0x3fabdf(0x1cf)]['name'],_0x2e7a24),_0x392190=_0x3e8653[_0x3fabdf(0x1e3)][_0x3fabdf(0x172)](_0x57ce50=>_0x57ce50['name']===_0x6d8985),_0x42dd2a=createSegmentIdResolver(_0x3e8653['segmentNameToId'],_0x2e7a24),_0x24a3e7=await resolveRuleSegmentIds(_0x37803f['rule'],_0x42dd2a);let _0x2aa1b9;return _0x392190?(await _0x5338b9[_0x3fabdf(0x206)]['updateSegmentById'](_0x4b6551[_0x3fabdf(0x171)],_0x392190['id'],{'description':_0x37803f[_0x3fabdf(0x243)]||_0x3fabdf(0x1d5)+_0x2e7a24,'rule':_0x287c3e(_0x24a3e7),'countPopulation':!![]}),_0x2aa1b9=_0x392190['id'],saveSegmentToPushRecovery(_0x2cd705[_0x3fabdf(0x20a)],_0x2cd705[_0x3fabdf(0x1cf)]['name'],_0x2e7a24,{'segmentId':_0x2aa1b9,'uniqueServerName':_0x6d8985,'createdAt':new Date()['toISOString']()})):_0x2aa1b9=await createOrRecoverEmbeddedSegment(_0x5338b9,_0x2cd705,{'localName':_0x2e7a24,'uniqueSegmentName':_0x6d8985,'description':_0x37803f[_0x3fabdf(0x243)]||_0x3fabdf(0x1d5)+_0x2e7a24,'journeyId':_0x47c03b,'resolvedRule':_0x24a3e7,'parentId':_0x4b6551['parentId'],'folderId':_0x4b6551[_0x3fabdf(0x267)]||''},_0x287c3e),_0x3e8653[_0x3fabdf(0x24b)][_0x3fabdf(0x169)](_0x2e7a24,_0x2aa1b9),_0x35b646[_0x3fabdf(0x169)](_0x2e7a24,_0x2aa1b9),_0x2aa1b9;})());_0x55359a[_0x5bca94(0x169)](_0x2e7a24,_0x86f21b);try{return await _0x86f21b;}finally{_0x55359a[_0x5bca94(0x1d4)](_0x2e7a24);}},'resolveActivationId':async _0x34fb04=>{const _0x3a0eb2=_0x3e78d4,_0x1aa13e=_0x2ad25c[_0x3a0eb2(0x1fa)](_0x34fb04);if(_0x1aa13e)return _0x1aa13e;if(_0x2cd705[_0x3a0eb2(0x16a)]){await _0x4a989c();const _0x5cbbe6=_0x2ad25c['get'](_0x34fb04);if(_0x5cbbe6)return _0x5cbbe6;}throw new SDKError(ErrorCode[_0x3a0eb2(0x25c)],_0x3a0eb2(0x1df)+_0x34fb04+_0x3a0eb2(0x21e)+_0x2cd705[_0x3a0eb2(0x1cf)][_0x3a0eb2(0x1fc)]+_0x3a0eb2(0x233)+_0x3a0eb2(0x247));},'resolveEmbeddedActivationId':async(_0x2aa776,_0xb05aff)=>{const _0x2099fd=_0x3e78d4,_0x5bdcf0=_0x2ad25c['get'](_0x2aa776);if(_0x5bdcf0)return _0x5bdcf0;if(_0x2cd705['isNew'])return _0x2cca0b[_0x2099fd(0x169)](_0x2aa776,_0xb05aff),createPendingActivationId(_0x2aa776);if(_0x2cd705[_0x2099fd(0x16a)]){await _0x4a989c();const _0x20e73a=_0x2ad25c[_0x2099fd(0x1fa)](_0xb05aff[_0x2099fd(0x1fc)]);if(_0x20e73a)return _0x2ad25c[_0x2099fd(0x169)](_0x2aa776,_0x20e73a),_0x20e73a;const _0x273a28=activationSignature(_0xb05aff),_0x42773b=_0x232edf?.['get'](_0x273a28);if(_0x42773b)return _0x2ad25c[_0x2099fd(0x169)](_0x2aa776,_0x42773b),_0x42773b;const _0x418eae=await _0x3c05bc(_0xb05aff,_0x3e8653['activationContext']),_0x2fcc41={..._0x418eae,..._0xb05aff[_0x2099fd(0x234)]!==undefined&&{'runAfterJourneyRefresh':_0xb05aff['run_after_journey_refresh']}},_0x408b14=await _0x5338b9[_0x2099fd(0x21c)]['createActivation'](_0x2cd705[_0x2099fd(0x16a)]['id'],_0x2fcc41);return _0x2ad25c['set'](_0x2aa776,_0x408b14['id']),_0x408b14['id'];}throw new SDKError(ErrorCode[_0x2099fd(0x25a)],_0x2099fd(0x219));},'resolveJourneyId':async _0x129c7a=>{const _0x70357f=_0x3e78d4;try{return await _0x5338b9['journey'][_0x70357f(0x19e)](_0x4b6551[_0x70357f(0x171)],_0x129c7a);}catch(_0x9f204b){throw new SDKError(ErrorCode[_0x70357f(0x25c)],_0x70357f(0x1f4)+_0x129c7a+_0x70357f(0x1d3)+_0x2cd705['yamlConfig'][_0x70357f(0x1fc)]+'\x27)',_0x9f204b);}},'resolveStageId':async(_0x3ff193,_0x371b27)=>{const _0x59b7c1=_0x3e78d4,_0x5ece8c=await _0x5338b9[_0x59b7c1(0x21c)][_0x59b7c1(0x23a)](_0x3ff193),_0xdd5198=_0x5ece8c[_0x59b7c1(0x200)][_0x59b7c1(0x22f)][_0x59b7c1(0x172)](_0x5f1268=>_0x5f1268[_0x59b7c1(0x1fc)][_0x59b7c1(0x20f)]()===_0x371b27[_0x59b7c1(0x20f)]());if(!_0xdd5198?.['id'])throw new SDKError(ErrorCode[_0x59b7c1(0x25c)],'Stage\x20\x27'+_0x371b27+_0x59b7c1(0x193)+(_0x5ece8c[_0x59b7c1(0x200)][_0x59b7c1(0x182)]||_0x5ece8c[_0x59b7c1(0x200)][_0x59b7c1(0x1fc)])+'\x27');return _0xdd5198['id'];}},_0x1c0616=await _0x132216(_0x2cd705[_0x3e78d4(0x1cf)],_0x4b6551['parentId'],_0x108930),_0x1ab2d1=_0x4b6551[_0x3e78d4(0x1be)]||_0x4b6551[_0x3e78d4(0x267)];_0x1ab2d1&&(_0x1c0616[_0x3e78d4(0x1c7)]={'parentFolder':{'data':{'id':_0x1ab2d1,'type':_0x3e78d4(0x1bd)}}});if(_0x2cd705[_0x3e78d4(0x258)]){if(_0x5ba672[_0x3e78d4(0x17f)]>0x0||_0x2cca0b[_0x3e78d4(0x17f)]>0x0)return await executeThreeStepJourneyCreate(_0x5338b9,_0x2cd705,_0x1c0616,{'pendingEmbeddedSegments':_0x5ba672,'pendingEmbeddedActivations':_0x2cca0b,'embeddedSegmentNameToId':_0x35b646,'journeyActivationNameToId':_0x2ad25c},{..._0x4b6551,'effectiveFolderId':_0x1ab2d1},_0x3e8653,_0x263f58,_0x507707);else{ensureJourneyDefaults(_0x1c0616[_0x3e78d4(0x200)]);const _0x20623f=await _0x5338b9[_0x3e78d4(0x21c)][_0x3e78d4(0x22e)](_0x1c0616);return deletePushRecovery(_0x2cd705['absolutePath']),{'action':_0x3e78d4(0x24f),'journeyId':_0x20623f['id'],'embeddedSegmentNameToId':_0x35b646};}}else{if(_0x2cd705[_0x3e78d4(0x1e2)]&&_0x2cd705[_0x3e78d4(0x16a)]){_0x1c0616['id']=_0x2cd705[_0x3e78d4(0x16a)]['id'];const _0x7b6688=_0x1c0616[_0x3e78d4(0x200)];_0x2cd705['existingJourney'][_0x3e78d4(0x200)]?.[_0x3e78d4(0x182)]&&(_0x7b6688[_0x3e78d4(0x182)]=_0x2cd705[_0x3e78d4(0x16a)][_0x3e78d4(0x200)][_0x3e78d4(0x182)]);const _0x342d14=_0x2cd705[_0x3e78d4(0x16a)][_0x3e78d4(0x200)]?.[_0x3e78d4(0x22f)];return _0x342d14&&_0x1c0616['attributes'][_0x3e78d4(0x22f)]&&injectExistingStageIds(_0x1c0616['attributes'][_0x3e78d4(0x22f)],_0x342d14),ensureJourneyDefaults(_0x7b6688),await _0x5338b9['journey'][_0x3e78d4(0x24c)](_0x2cd705[_0x3e78d4(0x16a)]['id'],_0x1c0616),deletePushRecovery(_0x2cd705['absolutePath']),{'action':_0x3e78d4(0x18c),'journeyId':_0x2cd705[_0x3e78d4(0x16a)]['id'],'embeddedSegmentNameToId':_0x35b646};}}return deletePushRecovery(_0x2cd705[_0x3e78d4(0x20a)]),{'action':_0x3e78d4(0x1ba),'journeyId':_0x2cd705['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x35b646};}function findSegmentCriteriaLocation(_0x10b856,_0x5eb296){const _0x4c9163=a155_0x24d83c,_0x5e0d0f=_0x10b856[_0x4c9163(0x1b9)]||_0x10b856[_0x4c9163(0x1cc)]?.[0x0]?.['stages']||[];let _0x54e5fe='entry',_0x452fd4=_0x5eb296;const _0x13e40f=_0x10b856['goal']||_0x10b856['journeys']?.[0x0]?.[_0x4c9163(0x236)];if(_0x13e40f?.[_0x4c9163(0x206)]===_0x5eb296)return{'stageName':_0x4c9163(0x236),'criteriaName':_0x13e40f['name']||_0x5eb296};_0x558fc3:for(const _0x478312 of _0x5e0d0f){if(_0x478312[_0x4c9163(0x1a4)]?.[_0x4c9163(0x206)]===_0x5eb296){_0x54e5fe=_0x478312[_0x4c9163(0x1fc)],_0x452fd4=_0x478312[_0x4c9163(0x1a4)][_0x4c9163(0x1fc)]||_0x5eb296;break;}if(_0x478312[_0x4c9163(0x24a)])for(const _0x146ce9 of _0x478312[_0x4c9163(0x24a)]){if(_0x146ce9[_0x4c9163(0x18d)]===_0x4c9163(0x1c3)&&_0x146ce9['with']?.[_0x4c9163(0x170)])for(const _0x12c709 of _0x146ce9[_0x4c9163(0x195)][_0x4c9163(0x170)]){if(_0x12c709[_0x4c9163(0x206)]===_0x5eb296){_0x54e5fe=_0x478312[_0x4c9163(0x1fc)],_0x452fd4=_0x12c709[_0x4c9163(0x1fc)]||_0x5eb296;break _0x558fc3;}}}}return{'stageName':_0x54e5fe,'criteriaName':_0x452fd4};}async function executeThreeStepJourneyCreate(_0x51a279,_0x30cc30,_0x4c14d5,_0x81eff,_0x47f221,_0x4416c8,_0x52907e,_0x302c68){const _0x52e71c=a155_0x24d83c,{activationDefToCreateRequest:_0x1c3094,yamlRuleToApi:_0x3aba6f}=_0x302c68,{pendingEmbeddedSegments:_0x5f03c7,pendingEmbeddedActivations:_0x204e09,embeddedSegmentNameToId:_0x51f655}=_0x81eff,_0x41f586=JSON['parse'](JSON[_0x52e71c(0x25b)](_0x4c14d5));ensureJourneyDefaults(_0x41f586['attributes']),stripPendingIds(_0x41f586);const _0x483be4=await _0x51a279[_0x52e71c(0x21c)][_0x52e71c(0x22e)](_0x41f586),_0x2152b9=_0x483be4['id'],_0xf318cf=new Map();for(const _0x390f25 of _0x483be4[_0x52e71c(0x200)][_0x52e71c(0x22f)]){_0xf318cf[_0x52e71c(0x169)](_0x390f25['name']['toLowerCase'](),_0x390f25['id']);}recoverSegmentIdsFromPushRecovery(_0x30cc30,_0x51f655,_0x4416c8[_0x52e71c(0x24b)]);for(const [_0x349f0f,{definition:_0x1f3619}]of _0x5f03c7){if(_0x51f655['has'](_0x349f0f)){_0x52907e['onProgress']?.({'type':_0x52e71c(0x1bf),'journeyName':_0x30cc30[_0x52e71c(0x1cf)]['name'],'segmentName':_0x349f0f});continue;}const _0xc4f453=generateDeterministicJourneySegmentName(_0x30cc30['yamlConfig']['name'],_0x349f0f);_0x52907e[_0x52e71c(0x1ef)]?.({'type':_0x52e71c(0x1dc),'journeyName':_0x30cc30[_0x52e71c(0x1cf)][_0x52e71c(0x1fc)],'segmentName':_0x349f0f});const _0x159d5a=createSegmentIdResolver(_0x4416c8[_0x52e71c(0x24b)],_0x349f0f),_0x3f3da1=await resolveRuleSegmentIds(_0x1f3619[_0x52e71c(0x21a)],_0x159d5a),_0x4ccaa9=await createOrRecoverEmbeddedSegment(_0x51a279,_0x30cc30,{'localName':_0x349f0f,'uniqueSegmentName':_0xc4f453,'description':_0x1f3619[_0x52e71c(0x243)]||_0x52e71c(0x1d5)+_0x349f0f,'journeyId':_0x2152b9,'resolvedRule':_0x3f3da1,'parentId':_0x47f221['parentId'],'folderId':_0x47f221['effectiveFolderId']||''},_0x3aba6f);_0x51f655[_0x52e71c(0x169)](_0x349f0f,_0x4ccaa9),_0x4416c8[_0x52e71c(0x24b)][_0x52e71c(0x169)](_0x349f0f,_0x4ccaa9),_0x52907e[_0x52e71c(0x1ef)]?.({'type':_0x52e71c(0x1bf),'journeyName':_0x30cc30[_0x52e71c(0x1cf)][_0x52e71c(0x1fc)],'segmentName':_0x349f0f});}const _0x5b9065=new Map();for(const [_0x50b528,_0x44ff07]of _0x204e09){_0x52907e['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x30cc30['yamlConfig'][_0x52e71c(0x1fc)],'activationName':_0x50b528});const _0x5924c4=await _0x1c3094(_0x44ff07,_0x4416c8['activationContext']),_0x153992={..._0x5924c4,..._0x44ff07[_0x52e71c(0x234)]!==undefined&&{'runAfterJourneyRefresh':_0x44ff07['run_after_journey_refresh']}},_0x3fab28=await _0x51a279[_0x52e71c(0x21c)][_0x52e71c(0x20c)](_0x2152b9,_0x153992);_0x5b9065[_0x52e71c(0x169)](_0x50b528,_0x3fab28['id']),_0x81eff[_0x52e71c(0x252)]['set'](_0x50b528,_0x3fab28['id']),_0x52907e[_0x52e71c(0x1ef)]?.({'type':_0x52e71c(0x20b),'journeyName':_0x30cc30[_0x52e71c(0x1cf)][_0x52e71c(0x1fc)],'activationName':_0x50b528});}const _0x4217d4=JSON[_0x52e71c(0x183)](JSON['stringify'](_0x4c14d5));return _0x4217d4['id']=_0x2152b9,ensureJourneyDefaults(_0x4217d4[_0x52e71c(0x200)]),resolvePendingIdsInRequest(_0x4217d4,_0x4c14d5,_0xf318cf,_0x51f655,_0x5b9065,_0x52907e),await _0x51a279[_0x52e71c(0x21c)][_0x52e71c(0x24c)](_0x2152b9,_0x4217d4),deletePushRecovery(_0x30cc30[_0x52e71c(0x20a)]),{'action':_0x52e71c(0x24f),'journeyId':_0x2152b9,'embeddedSegmentNameToId':_0x51f655};}export function stripWaitStepPendingIds(_0x4eb4db){const _0x5dc5b9=a155_0x24d83c,_0x6d26c4=_0x4eb4db['conditionSegmentId']&&isPendingSegmentId(_0x4eb4db['conditionSegmentId']),_0x6005ab=_0x4eb4db['conditions']?.[_0x5dc5b9(0x173)](_0x4e78f6=>_0x4e78f6[_0x5dc5b9(0x18e)]&&isPendingSegmentId(_0x4e78f6[_0x5dc5b9(0x18e)]));(_0x6d26c4||_0x6005ab)&&(_0x4eb4db[_0x5dc5b9(0x230)]='Duration',_0x4eb4db['waitStep']=0x1,_0x4eb4db['waitStepUnit']=_0x5dc5b9(0x19b),delete _0x4eb4db[_0x5dc5b9(0x207)],delete _0x4eb4db[_0x5dc5b9(0x25f)],delete _0x4eb4db[_0x5dc5b9(0x1dd)],delete _0x4eb4db[_0x5dc5b9(0x18a)]);}export function resolveWaitStepPendingIds(_0x27e56d,_0x20f6fe,_0x44cc75,_0x4bc030){const _0x120ebe=a155_0x24d83c;if(_0x20f6fe[_0x120ebe(0x207)]&&isPendingSegmentId(_0x20f6fe[_0x120ebe(0x207)])){const _0x495bfb=_0x44cc75(_0x20f6fe[_0x120ebe(0x207)],_0x120ebe(0x178)+_0x4bc030+_0x120ebe(0x1a7));_0x495bfb&&(_0x27e56d[_0x120ebe(0x230)]=_0x120ebe(0x16c),_0x27e56d[_0x120ebe(0x207)]=_0x495bfb,delete _0x27e56d['waitStep'],delete _0x27e56d[_0x120ebe(0x210)],_0x20f6fe[_0x120ebe(0x25f)]!==undefined&&(_0x27e56d[_0x120ebe(0x25f)]=_0x20f6fe['conditionTimeoutDuration']),_0x20f6fe[_0x120ebe(0x1dd)]&&(_0x27e56d['conditionTimeoutUnit']=_0x20f6fe[_0x120ebe(0x1dd)]));}if(_0x20f6fe[_0x120ebe(0x18a)]){const _0x1a79fb=_0x20f6fe[_0x120ebe(0x18a)]['some'](_0x157b5f=>_0x157b5f[_0x120ebe(0x18e)]&&isPendingSegmentId(_0x157b5f[_0x120ebe(0x18e)]));if(_0x1a79fb){const _0x5e75c0=_0x20f6fe[_0x120ebe(0x18a)]['map'](_0x5deb16=>{const _0xb82cfc=_0x120ebe;if(_0x5deb16[_0xb82cfc(0x18e)]&&isPendingSegmentId(_0x5deb16[_0xb82cfc(0x18e)])){const _0x5a7b17=_0x44cc75(_0x5deb16[_0xb82cfc(0x18e)],_0xb82cfc(0x178)+_0x4bc030+_0xb82cfc(0x1a7));return{..._0x5deb16,'segmentId':_0x5a7b17||_0x5deb16[_0xb82cfc(0x18e)]};}return{..._0x5deb16};});_0x27e56d[_0x120ebe(0x230)]=_0x120ebe(0x16c),_0x27e56d[_0x120ebe(0x18a)]=_0x5e75c0,delete _0x27e56d['waitStep'],delete _0x27e56d['waitStepUnit'],delete _0x27e56d[_0x120ebe(0x207)],delete _0x27e56d['conditionTimeoutDuration'],delete _0x27e56d[_0x120ebe(0x1dd)];}}}function stripPendingIds(_0x9051d4){const _0x52827b=a155_0x24d83c;_0x9051d4[_0x52827b(0x200)][_0x52827b(0x236)]?.[_0x52827b(0x18e)]&&isPendingSegmentId(_0x9051d4[_0x52827b(0x200)][_0x52827b(0x236)][_0x52827b(0x18e)])&&delete _0x9051d4['attributes'][_0x52827b(0x236)];for(const _0x26b5e5 of _0x9051d4['attributes'][_0x52827b(0x22f)]||[]){_0x26b5e5[_0x52827b(0x19f)]?.[_0x52827b(0x18e)]&&isPendingSegmentId(_0x26b5e5[_0x52827b(0x19f)][_0x52827b(0x18e)])&&delete _0x26b5e5[_0x52827b(0x19f)];_0x26b5e5[_0x52827b(0x21b)]?.[_0x52827b(0x18e)]&&isPendingSegmentId(_0x26b5e5[_0x52827b(0x21b)][_0x52827b(0x18e)])&&delete _0x26b5e5[_0x52827b(0x21b)];_0x26b5e5['exitCriterias']&&(_0x26b5e5[_0x52827b(0x17b)]=_0x26b5e5[_0x52827b(0x17b)][_0x52827b(0x197)](_0x534da9=>!_0x534da9[_0x52827b(0x18e)]||!isPendingSegmentId(_0x534da9[_0x52827b(0x18e)])));if(_0x26b5e5[_0x52827b(0x24a)])for(const _0x31c9db of Object[_0x52827b(0x19c)](_0x26b5e5[_0x52827b(0x24a)])){const _0x2bfc60=_0x26b5e5[_0x52827b(0x24a)][_0x31c9db];_0x2bfc60['type']===_0x52827b(0x221)&&_0x2bfc60['journeyActivationStepId']&&isPendingActivationId(_0x2bfc60['journeyActivationStepId'])&&(_0x2bfc60[_0x52827b(0x1ee)]='');if(_0x2bfc60['type']==='DecisionPoint'&&_0x2bfc60[_0x52827b(0x170)])for(const _0x236557 of _0x2bfc60[_0x52827b(0x170)]){_0x236557['segmentId']&&isPendingSegmentId(_0x236557['segmentId'])&&(_0x236557[_0x52827b(0x18e)]='');}_0x2bfc60[_0x52827b(0x18d)]==='WaitStep'&&stripWaitStepPendingIds(_0x2bfc60);}}}function resolvePendingIdsInRequest(_0x3627e2,_0x9ca34c,_0x3a1f70,_0x4dfd72,_0x28d8fb,_0xa75a0e){const _0x2b9fc4=a155_0x24d83c,_0x2f5688=(_0x110342,_0xeae538)=>{const _0xc3c831=a155_0xe8d7;if(!isPendingSegmentId(_0x110342))return _0x110342;const _0x411f31=extractPendingSegmentName(_0x110342),_0x15091a=_0x4dfd72['get'](_0x411f31);return!_0x15091a&&_0xa75a0e[_0xc3c831(0x1ab)]?.(_0xc3c831(0x17c)+_0x411f31+_0xc3c831(0x1c4)+_0xeae538),_0x15091a;};if(_0x3627e2[_0x2b9fc4(0x200)][_0x2b9fc4(0x236)]?.[_0x2b9fc4(0x18e)]&&isPendingSegmentId(_0x3627e2[_0x2b9fc4(0x200)][_0x2b9fc4(0x236)][_0x2b9fc4(0x18e)])){const _0x8d21a4=_0x2f5688(_0x3627e2[_0x2b9fc4(0x200)][_0x2b9fc4(0x236)][_0x2b9fc4(0x18e)],_0x2b9fc4(0x227));_0x8d21a4&&(_0x3627e2[_0x2b9fc4(0x200)]['goal'][_0x2b9fc4(0x18e)]=_0x8d21a4);}for(const _0xd9096f of _0x3627e2[_0x2b9fc4(0x200)]['journeyStages']||[]){const _0x5d9d26=_0x3a1f70[_0x2b9fc4(0x1fa)](_0xd9096f[_0x2b9fc4(0x1fc)]['toLowerCase']());_0x5d9d26&&(_0xd9096f['id']=_0x5d9d26);if(_0xd9096f[_0x2b9fc4(0x19f)]?.['segmentId']&&isPendingSegmentId(_0xd9096f['entryCriteria'][_0x2b9fc4(0x18e)])){const _0x333026=_0x2f5688(_0xd9096f[_0x2b9fc4(0x19f)]['segmentId'],'stage\x20\x27'+_0xd9096f[_0x2b9fc4(0x1fc)]+_0x2b9fc4(0x1ea));_0x333026&&(_0xd9096f['entryCriteria'][_0x2b9fc4(0x18e)]=_0x333026);}if(_0xd9096f['exitCriterias'])for(const _0x4eda6b of _0xd9096f[_0x2b9fc4(0x17b)]){if(_0x4eda6b[_0x2b9fc4(0x18e)]&&isPendingSegmentId(_0x4eda6b[_0x2b9fc4(0x18e)])){const _0x265e33=_0x2f5688(_0x4eda6b[_0x2b9fc4(0x18e)],'stage\x20\x27'+_0xd9096f['name']+_0x2b9fc4(0x257));_0x265e33&&(_0x4eda6b[_0x2b9fc4(0x18e)]=_0x265e33);}}if(_0xd9096f[_0x2b9fc4(0x21b)]?.['segmentId']&&isPendingSegmentId(_0xd9096f['milestone'][_0x2b9fc4(0x18e)])){const _0x1c9f83=_0x2f5688(_0xd9096f[_0x2b9fc4(0x21b)]['segmentId'],_0x2b9fc4(0x178)+_0xd9096f[_0x2b9fc4(0x1fc)]+_0x2b9fc4(0x1a5));_0x1c9f83&&(_0xd9096f[_0x2b9fc4(0x21b)][_0x2b9fc4(0x18e)]=_0x1c9f83);}if(_0xd9096f[_0x2b9fc4(0x24a)]){const _0x1508ba=_0xe29bd4=>_0x9ca34c[_0x2b9fc4(0x200)][_0x2b9fc4(0x22f)]?.['find'](_0x24118b=>_0x24118b['name'][_0x2b9fc4(0x20f)]()===_0xd9096f[_0x2b9fc4(0x1fc)][_0x2b9fc4(0x20f)]())?.[_0x2b9fc4(0x24a)]?.[_0xe29bd4];for(const _0x15ca5d of Object[_0x2b9fc4(0x19c)](_0xd9096f[_0x2b9fc4(0x24a)])){const _0x54928f=_0xd9096f[_0x2b9fc4(0x24a)][_0x15ca5d],_0x17f623=_0x1508ba(_0x15ca5d);if(_0x54928f[_0x2b9fc4(0x18d)]===_0x2b9fc4(0x221)&&_0x54928f[_0x2b9fc4(0x1ee)]&&(isPendingActivationId(_0x54928f[_0x2b9fc4(0x1ee)])||_0x54928f[_0x2b9fc4(0x1ee)]==='')){if(_0x17f623?.[_0x2b9fc4(0x1ee)]&&isPendingActivationId(_0x17f623['journeyActivationStepId'])){const _0x4f18cd=extractPendingActivationName(_0x17f623[_0x2b9fc4(0x1ee)]),_0x2a4438=_0x28d8fb[_0x2b9fc4(0x1fa)](_0x4f18cd);_0x2a4438&&(_0x54928f[_0x2b9fc4(0x1ee)]=_0x2a4438);}}if(_0x54928f[_0x2b9fc4(0x18d)]===_0x2b9fc4(0x190)&&_0x54928f[_0x2b9fc4(0x170)]&&_0x17f623?.[_0x2b9fc4(0x170)])for(let _0x585ca8=0x0;_0x585ca8<_0x54928f[_0x2b9fc4(0x170)][_0x2b9fc4(0x1b3)];_0x585ca8++){const _0x1ec90c=_0x54928f[_0x2b9fc4(0x170)][_0x585ca8],_0x215caa=_0x17f623[_0x2b9fc4(0x170)][_0x585ca8];if(_0x215caa?.[_0x2b9fc4(0x18e)]&&isPendingSegmentId(_0x215caa[_0x2b9fc4(0x18e)])){const _0x469ad8=_0x2f5688(_0x215caa[_0x2b9fc4(0x18e)],'stage\x20\x27'+_0xd9096f['name']+_0x2b9fc4(0x1a9)+(_0x1ec90c['name']||_0x585ca8)+'\x27');_0x469ad8&&(_0x1ec90c[_0x2b9fc4(0x18e)]=_0x469ad8);}}_0x54928f[_0x2b9fc4(0x18d)]===_0x2b9fc4(0x26b)&&_0x17f623?.[_0x2b9fc4(0x18d)]===_0x2b9fc4(0x26b)&&resolveWaitStepPendingIds(_0x54928f,_0x17f623,_0x2f5688,_0xd9096f[_0x2b9fc4(0x1fc)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e7db1,_0x47871f){const _0x366f0a=a156_0x272f,_0xabf624=_0x4e7db1();while(!![]){try{const _0xca44ca=-parseInt(_0x366f0a(0x168))/0x1+parseInt(_0x366f0a(0x16a))/0x2+-parseInt(_0x366f0a(0x166))/0x3+-parseInt(_0x366f0a(0x169))/0x4*(-parseInt(_0x366f0a(0x165))/0x5)+-parseInt(_0x366f0a(0x16b))/0x6+parseInt(_0x366f0a(0x16f))/0x7+parseInt(_0x366f0a(0x16c))/0x8;if(_0xca44ca===_0x47871f)break;else _0xabf624['push'](_0xabf624['shift']());}catch(_0x1b5861){_0xabf624['push'](_0xabf624['shift']());}}}(a156_0x56f6,0xe6e4f));export function buildFolderIdToPathMap(_0x5d327e){const _0x22d340=a156_0x272f,_0xe59698=new Map(),_0x25fb00=new Map();for(const _0x355a35 of _0x5d327e){_0x25fb00[_0x22d340(0x164)](_0x355a35['id'],_0x355a35);}const _0x2d2231=new Set();for(const _0x5f31d6 of _0x5d327e){!_0x5f31d6[_0x22d340(0x167)]&&_0x2d2231[_0x22d340(0x16d)](_0x5f31d6['id']);}function _0x1ad150(_0x4fa8dc){const _0x5e7631=_0x22d340;if(_0xe59698[_0x5e7631(0x170)](_0x4fa8dc['id']))return _0xe59698[_0x5e7631(0x171)](_0x4fa8dc['id']);if(_0x2d2231[_0x5e7631(0x170)](_0x4fa8dc['id']))return _0xe59698[_0x5e7631(0x164)](_0x4fa8dc['id'],''),'';if(_0x4fa8dc['parentFolderId']){const _0x30893e=_0x25fb00[_0x5e7631(0x171)](_0x4fa8dc[_0x5e7631(0x167)]);if(_0x30893e){const _0xb85ec3=_0x1ad150(_0x30893e),_0x7d5de5=_0xb85ec3?_0xb85ec3+'/'+_0x4fa8dc[_0x5e7631(0x16e)]:_0x4fa8dc[_0x5e7631(0x16e)];return _0xe59698['set'](_0x4fa8dc['id'],_0x7d5de5),_0x7d5de5;}}const _0x2d7240=_0x4fa8dc['name'];return _0xe59698[_0x5e7631(0x164)](_0x4fa8dc['id'],_0x2d7240),_0x2d7240;}for(const _0x4b9287 of _0x5d327e){_0x1ad150(_0x4b9287);}return _0xe59698;}function a156_0x56f6(){const _0x12e56e=['has','get','set','982185ikDpwS','3175212EJPigy','parentFolderId','1876429eJSQAs','36HOguwr','2106842qaqJeq','3197784PremRx','5344792gfBiQe','add','name','6468609SWjnjD'];a156_0x56f6=function(){return _0x12e56e;};return a156_0x56f6();}export function buildFolderPathToIdMap(_0x5b0168){const _0x3e42fa=a156_0x272f,_0x5efc6c=new Map(),_0x4d5547=new Map();for(const _0x1feb07 of _0x5b0168){_0x4d5547[_0x3e42fa(0x164)](_0x1feb07['id'],_0x1feb07);}const _0x4898cc=new Set();for(const _0x1a76c1 of _0x5b0168){!_0x1a76c1[_0x3e42fa(0x167)]&&_0x4898cc[_0x3e42fa(0x16d)](_0x1a76c1['id']);}function _0x465d31(_0x11512f){const _0x1f693c=_0x3e42fa;if(_0x4898cc[_0x1f693c(0x170)](_0x11512f['id']))return'';if(_0x11512f[_0x1f693c(0x167)]){const _0x3659a6=_0x4d5547[_0x1f693c(0x171)](_0x11512f['parentFolderId']);if(_0x3659a6){const _0x4e49ff=_0x465d31(_0x3659a6);return _0x4e49ff?_0x4e49ff+'/'+_0x11512f['name']:_0x11512f['name'];}}return _0x11512f[_0x1f693c(0x16e)];}for(const _0x5dfae5 of _0x5b0168){const _0xa662=_0x465d31(_0x5dfae5);_0x5efc6c['set'](_0xa662,_0x5dfae5['id']);}return _0x5efc6c;}export function buildFolderMaps(_0x38f249){const _0x1eabeb=a156_0x272f,_0x18da8b=buildFolderIdToPathMap(_0x38f249),_0x1e75b3=new Map();for(const [_0x33bff2,_0x384ae8]of _0x18da8b){_0x1e75b3[_0x1eabeb(0x164)](_0x384ae8,_0x33bff2);}return{'idToPath':_0x18da8b,'pathToId':_0x1e75b3};}function a156_0x272f(_0x3163c8,_0x4b1a9e){_0x3163c8=_0x3163c8-0x164;const _0x56f656=a156_0x56f6();let _0x272f89=_0x56f656[_0x3163c8];return _0x272f89;}export function getFolderPath(_0x5780fb,_0x58356b){if(!_0x5780fb)return'';return _0x58356b['get'](_0x5780fb)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x32fa07,_0x44a2d4){const _0x1aa9fb=a157_0x52ec,_0x373677=_0x32fa07();while(!![]){try{const _0x452090=-parseInt(_0x1aa9fb(0x11c))/0x1+parseInt(_0x1aa9fb(0x125))/0x2*(parseInt(_0x1aa9fb(0x12e))/0x3)+-parseInt(_0x1aa9fb(0x132))/0x4*(-parseInt(_0x1aa9fb(0x129))/0x5)+-parseInt(_0x1aa9fb(0x133))/0x6*(parseInt(_0x1aa9fb(0x111))/0x7)+parseInt(_0x1aa9fb(0x109))/0x8*(parseInt(_0x1aa9fb(0x127))/0x9)+parseInt(_0x1aa9fb(0x119))/0xa+parseInt(_0x1aa9fb(0x118))/0xb*(-parseInt(_0x1aa9fb(0x113))/0xc);if(_0x452090===_0x44a2d4)break;else _0x373677['push'](_0x373677['shift']());}catch(_0x219872){_0x373677['push'](_0x373677['shift']());}}}(a157_0x314a,0x22970));import a157_0x7087ec from'path';import{parse as a157_0x5f247d}from'yaml';function a157_0x314a(){const _0x2ad7b8=['trim','339164sPbPQX','Path\x20cannot\x20be\x20empty','1308gSMOYb','Cannot\x20split\x20empty\x20path','filter','root','resolve','20075bZgTjI','2771380hoGfsO','exists','length','223802QwCHKA','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','readFile','name','test','type','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','No\x20tdx.json\x20found\x20for\x20file:\x20','startsWith','10598ZFaJhv','Path\x20attempts\x20to\x20navigate\x20above\x20root','836577yutPcn','parse','5DUdhso','.yml','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','endsWith','journey','99ONshff','substring','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','dirname','853028QbhaLT','24JaunkG','segment','isAbsolute','pop','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','slice','segments','split','8kxDHew','replace','join','push','raw','relative','.yaml'];a157_0x314a=function(){return _0x2ad7b8;};return a157_0x314a();}import{nodeFileSystem}from'../io/node-filesystem.js';function a157_0x52ec(_0x4c5142,_0x5474fe){_0x4c5142=_0x4c5142-0x104;const _0x314aea=a157_0x314a();let _0x52ec2c=_0x314aea[_0x4c5142];return _0x52ec2c;}export function parsePath(_0x5f471b){const _0xe6197a=a157_0x52ec;if(!_0x5f471b||_0x5f471b['trim']()==='')throw new Error(_0xe6197a(0x112));const _0x193edb=_0x5f471b[_0xe6197a(0x110)]();if(_0x193edb==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5f471b};const _0x118c70=_0x193edb[_0xe6197a(0x124)]('/')?_0x193edb[_0xe6197a(0x12f)](0x1):_0x193edb,_0x3a02f0=_0x118c70[_0xe6197a(0x108)]('/')[_0xe6197a(0x115)](_0x21eace=>_0x21eace!=='');if(_0x3a02f0[_0xe6197a(0x11b)]===0x0)throw new Error(_0xe6197a(0x105));const _0x105ee2=_0x193edb[_0xe6197a(0x124)]('/')||!isRelativePathSegment(_0x3a02f0[0x0]);for(const _0x13d4a2 of _0x3a02f0){validatePathSegment(_0x13d4a2);}return{'segments':_0x3a02f0,'isAbsolute':_0x105ee2,'raw':_0x5f471b};}function isRelativePathSegment(_0x43945a){return _0x43945a==='.'||_0x43945a==='..';}function validatePathSegment(_0x1230a5){const _0x393610=a157_0x52ec;if(_0x1230a5==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x1230a5==='.'||_0x1230a5==='..')return;if(/[\x00-\x1F\x7F]/[_0x393610(0x120)](_0x1230a5))throw new Error(_0x393610(0x122)+_0x1230a5);if(_0x1230a5!==_0x1230a5[_0x393610(0x110)]()){}}export function validatePath(_0x4f9454){const _0x18a30f=a157_0x52ec;if(_0x4f9454[_0x18a30f(0x107)][_0x18a30f(0x11b)]===0x0&&!_0x4f9454['isAbsolute'])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x4f9454[_0x18a30f(0x135)]){if(_0x4f9454[_0x18a30f(0x107)][0x0]==='..')throw new Error(_0x18a30f(0x130));let _0x2bb9c1=0x0;for(const _0x108b2a of _0x4f9454[_0x18a30f(0x107)]){if(_0x108b2a==='..'){if(_0x2bb9c1===0x0)throw new Error(_0x18a30f(0x126));_0x2bb9c1--;}else _0x108b2a!=='.'&&_0x2bb9c1++;}}}export function joinPaths(_0x2eb0bd,_0x52ff8a){const _0x3fe652=a157_0x52ec;if(!_0x2eb0bd||_0x2eb0bd==='/')return _0x52ff8a;if(!_0x52ff8a||_0x52ff8a==='.')return _0x2eb0bd;if(_0x52ff8a['startsWith']('/'))return _0x52ff8a;const _0x233557=parsePath(_0x2eb0bd),_0xec02f=parsePath(_0x52ff8a),_0x200d70=[..._0x233557['segments']];for(const _0x7069f5 of _0xec02f['segments']){if(_0x7069f5==='.')continue;else{if(_0x7069f5==='..'){if(_0x200d70['length']===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x200d70[_0x3fe652(0x104)]();}else _0x200d70['push'](_0x7069f5);}}const _0x242db3=_0x200d70[_0x3fe652(0x10b)]('/');return _0x233557[_0x3fe652(0x10d)][_0x3fe652(0x124)]('/')?'/'+_0x242db3:_0x242db3;}export function normalizePath(_0x56cd05){const _0x5b3cb7=a157_0x52ec,_0x3c493f=parsePath(_0x56cd05),_0x9648cb=[];for(const _0x62af30 of _0x3c493f[_0x5b3cb7(0x107)]){if(_0x62af30==='.')continue;else{if(_0x62af30==='..'){if(_0x9648cb['length']===0x0){if(_0x3c493f[_0x5b3cb7(0x135)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x9648cb[_0x5b3cb7(0x10c)]('..');}else _0x9648cb[_0x9648cb[_0x5b3cb7(0x11b)]-0x1]==='..'?_0x9648cb[_0x5b3cb7(0x10c)]('..'):_0x9648cb[_0x5b3cb7(0x104)]();}else _0x9648cb[_0x5b3cb7(0x10c)](_0x62af30);}}if(_0x9648cb[_0x5b3cb7(0x11b)]===0x0)return _0x3c493f[_0x5b3cb7(0x135)]?'/':'.';const _0x57e475=_0x9648cb[_0x5b3cb7(0x10b)]('/');return _0x3c493f[_0x5b3cb7(0x10d)][_0x5b3cb7(0x124)]('/')?'/'+_0x57e475:_0x57e475;}export function getParentPath(_0x25252b){const _0x47a2bf=a157_0x52ec,_0x781c68=parsePath(_0x25252b);if(_0x781c68[_0x47a2bf(0x107)]['length']<=0x1)return'/';const _0x5555a4=_0x781c68[_0x47a2bf(0x107)]['slice'](0x0,-0x1)[_0x47a2bf(0x10b)]('/');return _0x781c68[_0x47a2bf(0x10d)][_0x47a2bf(0x124)]('/')?'/'+_0x5555a4:_0x5555a4;}export function getBaseName(_0x3cbd57){const _0x3f05be=a157_0x52ec,_0x47dd8f=parsePath(_0x3cbd57);return _0x47dd8f['segments'][_0x47dd8f[_0x3f05be(0x107)][_0x3f05be(0x11b)]-0x1]||'';}export function isChildPath(_0x148900,_0x236102){const _0x16aa24=a157_0x52ec,_0x1a7a51=parsePath(_0x148900),_0x493e99=parsePath(_0x236102);if(_0x1a7a51[_0x16aa24(0x107)]['length']<=_0x493e99[_0x16aa24(0x107)]['length'])return![];for(let _0x1fa4b8=0x0;_0x1fa4b8<_0x493e99['segments'][_0x16aa24(0x11b)];_0x1fa4b8++){if(_0x1a7a51['segments'][_0x1fa4b8]!==_0x493e99[_0x16aa24(0x107)][_0x1fa4b8])return![];}return!![];}export function splitPath(_0x40bcb1){const _0x361f58=a157_0x52ec,_0xa3d8f4=parsePath(_0x40bcb1);if(_0xa3d8f4['segments'][_0x361f58(0x11b)]===0x0)throw new Error(_0x361f58(0x114));if(_0xa3d8f4['segments']['length']===0x1)return{'parent':_0xa3d8f4[_0x361f58(0x107)][0x0]};return{'parent':_0xa3d8f4['segments'][0x0],'child':_0xa3d8f4[_0x361f58(0x107)][_0x361f58(0x106)](0x1)['join']('/')};}export function isYamlFilePath(_0x1d20ee){const _0x40a6bd=a157_0x52ec;return _0x1d20ee[_0x40a6bd(0x12c)](_0x40a6bd(0x12a))||_0x1d20ee[_0x40a6bd(0x12c)](_0x40a6bd(0x10f));}export async function resolveYamlFilePath(_0x2e1e2f,_0x3483cb=nodeFileSystem){const _0xdc5c76=a157_0x52ec,_0x4a6c54=a157_0x7087ec[_0xdc5c76(0x117)](_0x2e1e2f);if(!await _0x3483cb['exists'](_0x4a6c54))throw new Error('File\x20not\x20found:\x20'+_0x2e1e2f);let _0x5c4cb8=a157_0x7087ec[_0xdc5c76(0x131)](_0x4a6c54),_0x5990d3=null,_0x1d10df=null;const _0x11fa01=a157_0x7087ec[_0xdc5c76(0x128)](_0x5c4cb8)[_0xdc5c76(0x116)];while(_0x5c4cb8!==_0x11fa01){const _0x160b23=a157_0x7087ec[_0xdc5c76(0x10b)](_0x5c4cb8,'tdx.json');if(await _0x3483cb[_0xdc5c76(0x11a)](_0x160b23)){_0x5990d3=_0x160b23,_0x1d10df=_0x5c4cb8;break;}_0x5c4cb8=a157_0x7087ec[_0xdc5c76(0x131)](_0x5c4cb8);}if(!_0x5990d3||!_0x1d10df)throw new Error(_0xdc5c76(0x123)+_0x2e1e2f+'\x0a'+_0xdc5c76(0x11d));const _0x130d41=await _0x3483cb[_0xdc5c76(0x11e)](_0x5990d3),_0x3597ee=JSON[_0xdc5c76(0x128)](_0x130d41),_0x1c5f27=_0x3597ee['parent_segment'];if(!_0x1c5f27)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x3287c6=await _0x3483cb[_0xdc5c76(0x11e)](_0x4a6c54),_0xa5a61=a157_0x5f247d(_0x3287c6),_0x4e4edd=_0xa5a61[_0xdc5c76(0x11f)];if(!_0x4e4edd)throw new Error(_0xdc5c76(0x12b)+_0x2e1e2f);const _0x4e5ef4=_0xa5a61[_0xdc5c76(0x121)]===_0xdc5c76(0x12d)?'journey':_0xdc5c76(0x134),_0x3a78f3=a157_0x7087ec[_0xdc5c76(0x10e)](_0x1d10df,_0x4a6c54),_0x4f3257=a157_0x7087ec[_0xdc5c76(0x131)](_0x3a78f3),_0x46b1d4=_0x4f3257==='.'?'':_0x4f3257[_0xdc5c76(0x10a)](/\\/g,'/'),_0x475ccf=_0x46b1d4?_0x1c5f27+'/'+_0x46b1d4+'/'+_0x4e4edd:_0x1c5f27+'/'+_0x4e4edd;return{'parentSegment':_0x1c5f27,'segmentName':_0x4e4edd,'folderPath':_0x46b1d4,'fullPath':_0x475ccf,'resourceType':_0x4e5ef4,'content':_0x3287c6};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a158_0x56d4(_0x4f3550,_0x401cce){_0x4f3550=_0x4f3550-0x11e;const _0x2a44e5=a158_0x2a44();let _0x56d4d8=_0x2a44e5[_0x4f3550];return _0x56d4d8;}(function(_0x4758b1,_0x223bd7){const _0xef757c=a158_0x56d4,_0x3b1ea8=_0x4758b1();while(!![]){try{const _0x4cf608=parseInt(_0xef757c(0x129))/0x1*(parseInt(_0xef757c(0x121))/0x2)+parseInt(_0xef757c(0x12b))/0x3*(parseInt(_0xef757c(0x12a))/0x4)+parseInt(_0xef757c(0x128))/0x5*(parseInt(_0xef757c(0x124))/0x6)+parseInt(_0xef757c(0x122))/0x7+parseInt(_0xef757c(0x12d))/0x8*(-parseInt(_0xef757c(0x12c))/0x9)+-parseInt(_0xef757c(0x126))/0xa+-parseInt(_0xef757c(0x120))/0xb*(parseInt(_0xef757c(0x125))/0xc);if(_0x4cf608===_0x223bd7)break;else _0x3b1ea8['push'](_0x3b1ea8['shift']());}catch(_0x5dbbfd){_0x3b1ea8['push'](_0x3b1ea8['shift']());}}}(a158_0x2a44,0x336bb));export function parseSegmentRef(_0x57f585){const _0x59058a=a158_0x56d4,_0x4c77fb=_0x57f585['indexOf']('/');if(_0x4c77fb===-0x1)return{'parentId':_0x57f585};if(_0x4c77fb===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x57f585+_0x59058a(0x11f));const _0x242eb7=_0x57f585['substring'](0x0,_0x4c77fb),_0xcfc3fa=_0x57f585[_0x59058a(0x127)](_0x4c77fb+0x1);if(_0xcfc3fa==='')throw new Error(_0x59058a(0x11e)+_0x57f585+_0x59058a(0x123));return{'parentId':_0x242eb7,'childId':_0xcfc3fa};}function a158_0x2a44(){const _0x42994f=['454008EilWfo','Invalid\x20segment\x20reference\x20format:\x20','.\x20Parent\x20name\x20cannot\x20be\x20empty','5845796lBdrfs','16482KqqZjU','2576588fYAdsq','.\x20Child\x20name\x20cannot\x20be\x20empty','30ezlOpo','12Lifwyh','1686370YjxzWH','substring','267770EaFJRa','41zFXade','214420MzMLfv','6lZmMyt','27WihxHs'];a158_0x2a44=function(){return _0x42994f;};return a158_0x2a44();}
|