@treasuredata/tdx 2026.8.4 → 2026.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +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.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.d.ts.map +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/cas-segment-command.js.map +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +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-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.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.js +1 -1
- package/dist/commands/journey-command.js +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/p13n-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.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-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +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.js +1 -1
- 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.js +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/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/site-mismatch.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +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.js +1 -1
- package/dist/sdk/auth-token.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-schema.d.ts +63 -0
- package/dist/sdk/cas/cas-segment-schema.d.ts.map +1 -0
- package/dist/sdk/cas/cas-segment-schema.js +1 -0
- package/dist/sdk/cas/cas-segment-schema.js.map +1 -0
- package/dist/sdk/cas/cas-segment-validator.d.ts +76 -0
- package/dist/sdk/cas/cas-segment-validator.d.ts.map +1 -0
- package/dist/sdk/cas/cas-segment-validator.js +1 -0
- package/dist/sdk/cas/cas-segment-validator.js.map +1 -0
- 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/cas/validate-files.d.ts +23 -6
- package/dist/sdk/cas/validate-files.d.ts.map +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/cas/validate-files.js.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +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.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/p13n-studio-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- 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/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.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/always-on-campaign-schema.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.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.js +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.js +1 -1
- package/dist/sdk/p13n-studio.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +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/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +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/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.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.d.ts +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +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/util/tree-search.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.js +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/claude-code-state.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/proxy-fetch.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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a173_0x16416b=a173_0xf2da;(function(_0x32a76b,_0x55df6b){const _0x2965b1=a173_0xf2da,_0x137195=_0x32a76b();while(!![]){try{const _0x10a9df=parseInt(_0x2965b1(0x123))/0x1+parseInt(_0x2965b1(0x10e))/0x2*(-parseInt(_0x2965b1(0x111))/0x3)+-parseInt(_0x2965b1(0x126))/0x4+parseInt(_0x2965b1(0x118))/0x5+parseInt(_0x2965b1(0x113))/0x6*(-parseInt(_0x2965b1(0x121))/0x7)+parseInt(_0x2965b1(0x120))/0x8+parseInt(_0x2965b1(0x10d))/0x9*(parseInt(_0x2965b1(0x11d))/0xa);if(_0x10a9df===_0x55df6b)break;else _0x137195['push'](_0x137195['shift']());}catch(_0x387d6f){_0x137195['push'](_0x137195['shift']());}}}(a173_0x2bcf,0xa0e9f));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a173_0x25ce90 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a173_0x16416b(0x128));export function getPushRecoveryPath(_0x226748){const _0x5bc61c=a173_0x16416b,_0xb20569=a173_0x25ce90[_0x5bc61c(0x110)](_0x226748),_0x20fa28=a173_0x25ce90[_0x5bc61c(0x11c)](_0x226748);return a173_0x25ce90[_0x5bc61c(0x10f)](_0xb20569,'.'+_0x20fa28+_0x5bc61c(0x11f));}export function readPushRecovery(_0x3d1625){const _0x21dad9=a173_0x16416b,_0x365aea=getPushRecoveryPath(_0x3d1625);if(!existsSync(_0x365aea))return undefined;try{const _0x4a128a=readFileSync(_0x365aea,_0x21dad9(0x127)),_0x1006f0=JSON[_0x21dad9(0x11a)](_0x4a128a);if(_0x1006f0?.[_0x21dad9(0x112)]!==0x1||typeof _0x1006f0[_0x21dad9(0x117)]!==_0x21dad9(0x11e))return undefined;return _0x1006f0;}catch(_0x302ebf){return _0x302ebf instanceof SyntaxError?logger[_0x21dad9(0x11b)](_0x21dad9(0x115)+_0x302ebf):logger[_0x21dad9(0x124)](_0x21dad9(0x122)+_0x302ebf),undefined;}}export function writePushRecovery(_0x14ee40,_0x1b7a67){const _0x33b695=a173_0x16416b,_0x29dd4e=getPushRecoveryPath(_0x14ee40),_0x28ee3c=_0x29dd4e+'.tmp';writeFileSync(_0x28ee3c,JSON[_0x33b695(0x10c)](_0x1b7a67,null,0x2)+'\x0a',_0x33b695(0x127)),renameSync(_0x28ee3c,_0x29dd4e);}export function deletePushRecovery(_0x2b1dc1){const _0x45c372=a173_0x16416b,_0x2d1792=getPushRecoveryPath(_0x2b1dc1);try{unlinkSync(_0x2d1792);}catch(_0x56eb93){_0x56eb93[_0x45c372(0x119)]!==_0x45c372(0x125)&&logger['debug']('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x56eb93);}}export function saveSegmentToPushRecovery(_0x107ca0,_0x5715f1,_0x541f6b,_0xa76748){const _0x19a4c8=a173_0x16416b,_0x321b76=readPushRecovery(_0x107ca0),_0x4e156e=_0x321b76?.['journeyName']===_0x5715f1?{..._0x321b76,'updatedAt':new Date()[_0x19a4c8(0x114)]()}:{'version':0x1,'journeyName':_0x5715f1,'updatedAt':new Date()[_0x19a4c8(0x114)](),'segments':{}};_0x4e156e[_0x19a4c8(0x116)][_0x541f6b]=_0xa76748,writePushRecovery(_0x107ca0,_0x4e156e);}function a173_0xf2da(_0xb31774,_0x499a98){_0xb31774=_0xb31774-0x10c;const _0x2bcf9c=a173_0x2bcf();let _0xf2da97=_0x2bcf9c[_0xb31774];return _0xf2da97;}function a173_0x2bcf(){const _0x22c94b=['version','614274XxLJwp','toISOString','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','segments','journeyName','3535680AZuydl','code','parse','debug','basename','2146730RNCSum','string','.push-recovery.json','6240992gXvmYm','21rNjnQK','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','370038KCJYSz','warn','ENOENT','4851008ZSUyko','utf-8','tdx.sdk.push-recovery','stringify','36JuXoYl','308jsmdvM','join','dirname','10461WAsERW'];a173_0x2bcf=function(){return _0x22c94b;};return a173_0x2bcf();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a172_0x504867=a172_0xbe52;(function(_0x41af4c,_0x3cb1e2){const _0xdb2a56=a172_0xbe52,_0x48fcf0=_0x41af4c();while(!![]){try{const _0x46cbb4=-parseInt(_0xdb2a56(0x109))/0x1*(-parseInt(_0xdb2a56(0xc0))/0x2)+-parseInt(_0xdb2a56(0x102))/0x3*(parseInt(_0xdb2a56(0xf1))/0x4)+parseInt(_0xdb2a56(0x125))/0x5+-parseInt(_0xdb2a56(0x9d))/0x6+parseInt(_0xdb2a56(0x162))/0x7+parseInt(_0xdb2a56(0x6f))/0x8+-parseInt(_0xdb2a56(0xe9))/0x9*(parseInt(_0xdb2a56(0xe7))/0xa);if(_0x46cbb4===_0x3cb1e2)break;else _0x48fcf0['push'](_0x48fcf0['shift']());}catch(_0x23a750){_0x48fcf0['push'](_0x48fcf0['shift']());}}}(a172_0x113d,0x4e304));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a172_0x504867(0xcb);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x5d1a6c){return''+PENDING_SEGMENT_PREFIX+_0x5d1a6c+'__';}export function isPendingSegmentId(_0x120d24){const _0x35de34=a172_0x504867;return _0x120d24[_0x35de34(0x155)](PENDING_SEGMENT_PREFIX)&&!_0x120d24[_0x35de34(0x155)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x45791b){const _0x301968=a172_0x504867;return _0x45791b[_0x301968(0x15b)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xf75d7b){return''+PENDING_ACTIVATION_PREFIX+_0xf75d7b+'__';}export function isPendingActivationId(_0x2ab0e2){return _0x2ab0e2['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x49bc8d){return _0x49bc8d['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x37a906,_0xe29388){const _0x53e9cf=a172_0x504867,_0x1fa31e=_0x37a906+'::'+(_0xe29388[_0x53e9cf(0xbb)]()||_0x53e9cf(0x165)),_0xe022d5=createHash(_0x53e9cf(0xbc))[_0x53e9cf(0xc3)](_0x1fa31e)['digest']('hex')[_0x53e9cf(0x91)](0x0,0xc);return _0x53e9cf(0xb2)+_0xe022d5;}export function ensureJourneyDefaults(_0x423a92){const _0x2e2fa6=a172_0x504867;!_0x423a92[_0x2e2fa6(0xfa)]&&(_0x423a92[_0x2e2fa6(0xfa)]=''),!_0x423a92[_0x2e2fa6(0x154)]&&(_0x423a92[_0x2e2fa6(0x154)]=_0x2e2fa6(0x163));}export function injectExistingStageIds(_0x40cff1,_0x191734){const _0x5ce3eb=a172_0x504867,_0x1d0396=new Map(_0x191734['map'](_0x391dad=>[_0x391dad[_0x5ce3eb(0xa2)],_0x391dad['id']]));for(const _0xa2f4c3 of _0x40cff1){if(!_0xa2f4c3['id']){const _0x217890=_0x1d0396[_0x5ce3eb(0x153)](_0xa2f4c3[_0x5ce3eb(0xa2)]);_0x217890&&(_0xa2f4c3['id']=_0x217890);}}}export function resolveTDFolderPath(_0x2da9d9,_0x54f2ed,_0x4a622a){const _0x32bd4c=a172_0x504867;if(!_0x54f2ed)return _0x2da9d9;if(_0x2da9d9===_0x4a622a||_0x2da9d9[_0x32bd4c(0x155)](_0x4a622a+'/'))return _0x2da9d9;return _0x2da9d9?_0x4a622a+'/'+_0x2da9d9:_0x4a622a;}export function addFoldersToCreate(_0x134ae0,_0x506bfe,_0x3028ba){const _0xf126f9=a172_0x504867;if(!_0x134ae0)return;if(_0x506bfe[_0xf126f9(0xff)](_0x134ae0))return;const _0x3fcf18=_0x134ae0[_0xf126f9(0x145)]('/');let _0x5315e1='';for(const _0x261f32 of _0x3fcf18){_0x5315e1=_0x5315e1?_0x5315e1+'/'+_0x261f32:_0x261f32,!_0x506bfe[_0xf126f9(0xff)](_0x5315e1)&&_0x3028ba['add'](_0x5315e1);}}export function sortFoldersByDepth(_0x16e424){const _0x5bce84=a172_0x504867;return[..._0x16e424][_0x5bce84(0xb5)]((_0x29398a,_0x38f770)=>{const _0x59f3a7=_0x5bce84,_0x3edfa7=(_0x29398a[_0x59f3a7(0x9e)](/\//g)||[])[_0x59f3a7(0xdc)],_0x5b93f7=(_0x38f770[_0x59f3a7(0x9e)](/\//g)||[])[_0x59f3a7(0xdc)];return _0x3edfa7-_0x5b93f7;});}import*as a172_0x42c49c from'yaml';import{readFileSync}from'fs';import a172_0x5b835a from'path';import{isJourneyDef,parseYamlString as a172_0x58880,toYamlString as a172_0x37f0cf,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';function a172_0x113d(){const _0x455c13=['getSegmentEntity','embedded_segment_creating','toISOString','DecisionPoint','entry_criteria','trim','sha1','activationParams','journeyById','isNew','60TiDHNr','notification','createActivation','update','./journey-yaml.js','ACTIVATION_UPDATE_ERROR','resolveSegment','Updating\x20segment\x20\x27','delete','keys','\x20(referenced\x20in\x20journey\x20','__pending_','null','activation_updating','embeddedSegmentNameToId','segmentId','reduce','data','activations','conditionTimeoutUnit','debug','add','day','Failed\x20to\x20resolve\x20segment\x20','utf-8','schedule','nameToId','fetchJourney','length','type','Created\x20activation\x20\x27','journeyActivationStepId','all_columns','Duration','folderPath','Created\x20journey\x20\x27','size','SEGMENT_UPDATE_ERROR','waitStepUnit','10lAtUJS','with','6769017QmJqHJ','activationStepsById','dirname','connectionIdToNameMap','onProgress','withProgress',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','stage\x20\x27','4qJHwQM','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','journey_creating','segment_updating','Entry\x20criteria:\x20','validatedRequest','segmentNameToId','entries','folderId','description','rule','Deleted\x20segment\x20\x27','map','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','has','existingJourney','join','1059546zsriwB','NOT_FOUND','idToName','Name\x20has\x20already\x20been\x20taken','list','parentId','create','9443uxTwzL','Updated\x20activation\x20\x27','connector_config','segment_creating','folder_created','idToEmailMap','Failed\x20to\x20resolve\x20activation\x20','SEGMENT_NOT_FOUND','results','segment_created','logDeleted','activation_template_id','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','behavior','nameToType','branches','find','connection','exitCriterias','journey_updated','conditionTimeoutDuration','goal','Created\x20folder\x20\x27','getJourney','\x0a\x20\x20','parentSegmentFolder','ACTIVATION_SYNTAX_ERROR',').\x20','2556315UtOauA','\x27...','logWarning','journeyId','set','folderPathToId','activation_deleted','\x20segment\x20from\x20file:\x20','existingSegments','Creating\x20activation\x20\x27','Journey\x20\x27','journeyActivationNameToId','journeyBundlesByFolderAndName','rootFolderId','isArray','run_after_journey_refresh','Segment\x20not\x20found:\x20','buildUserMaps','activation_created','logSuccess','activation_updated','some','stringify','Activation\x20not\x20found:\x20','activation_creating','):\x20','\x27\x20for\x20','../../utils/async.js','.$1.push-recovery.json','push','segmentFolderId','flatMap','split','journeyBundleId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','toString','getSegment','uniqueServerName','progress','Delete\x20the\x20push\x20recovery\x20file\x20(','\x27\x20wait\x20condition','journeyStages','created','segments','yamlActivation','entry','get','state','startsWith','journeys','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','behaviors','entryCriteria','and\x20the\x20server\x20segment,\x20then\x20retry.','replace','from','journeyBundleName','Created\x20segment\x20\x27','versionNumber','steps','getActivation','2966054nJxbZc','draft','waitStep','segment','max','getSegment\x20failed\x20for\x20','activationsBySegmentId','parseDocument','conditions','Activation','WaitStep','embedded_segment_created','localName','4026440yamdAU','Fetching\x20','absolutePath','updated','updateSegmentById','existingSegment','all','createdSegmentId','Segment\x20not\x20found','getSegmentEntity\x20also\x20failed\x20for\x20','Creating\x20folder\x20\x27','Updated\x20segment\x20\x27','\x27\x20to\x20local\x20\x27','embedded_activation_creating','uniqueSegmentName','\x27\x20decision\x20point\x20branch\x20\x27','createdSegmentIds','Stage\x20\x27','relationships','journey','kind','embedded_activation_created','Creating\x20segment\x20\x27','resolveJourneyId','valid','existingActivation','columns','waitStepType','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','diff','toLowerCase','journey_created','\x27\x20milestone','INTERNAL','slice','parse','conditionSegmentId','action','segmentByFolderAndName','Matched\x20server\x20segment\x20\x27','relative','Condition','deps','logInfo','folder','Failed\x20to\x20fetch\x20referenced\x20segment\x20','1776150Ujvqba','match','attributes','\x27\x20not\x20found\x20in\x20journey\x20\x27','Deleting\x20activation\x20\x27','name','createSegment','hasChanges','filter','Failed\x20to\x20','Updated\x20journey\x20\x27','yamlConfig','createJourneySegment','item','journeyName','resolvedRule','deleted','effectiveFolderId','activationActions','Deleted\x20activation\x20\x27','milestone','journey_entry_criteria_','index','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','sort'];a172_0x113d=function(){return _0x455c13;};return a172_0x113d();}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(_0x26c037){const _0x24f34c=a172_0x504867;if(Array[_0x24f34c(0x133)](_0x26c037))return'['+_0x26c037['map'](_0x5eb86c=>stableStringify(_0x5eb86c))['join'](',')+']';if(_0x26c037&&typeof _0x26c037==='object'){const _0x442d17=_0x26c037,_0x493868=Object['keys'](_0x442d17)[_0x24f34c(0xb5)](),_0x4b391a=_0x493868[_0x24f34c(0xfd)](_0x1e52de=>'\x22'+_0x1e52de+'\x22:'+stableStringify(_0x442d17[_0x1e52de]));return'{'+_0x4b391a[_0x24f34c(0x101)](',')+'}';}const _0x45cf27=JSON[_0x24f34c(0x13b)](_0x26c037);return _0x45cf27===undefined?_0x24f34c(0xcc):_0x45cf27;}function activationSignature(_0x282047){const _0x309502=a172_0x504867,_0x2a8832={'connection':_0x282047[_0x309502(0x11a)],..._0x282047['all_columns']!==undefined&&{'all_columns':_0x282047[_0x309502(0xe0)]},..._0x282047[_0x309502(0x89)]!==undefined&&{'columns':_0x282047[_0x309502(0x89)]},..._0x282047[_0x309502(0x116)]!==undefined&&{'behavior':_0x282047['behavior']},..._0x282047[_0x309502(0x158)]!==undefined&&{'behaviors':_0x282047[_0x309502(0x158)]},..._0x282047[_0x309502(0xd9)]!==undefined&&{'schedule':_0x282047[_0x309502(0xd9)]},..._0x282047['notification']!==undefined&&{'notification':_0x282047[_0x309502(0xc1)]},..._0x282047[_0x309502(0x10b)]!==undefined&&{'connector_config':_0x282047[_0x309502(0x10b)]},..._0x282047[_0x309502(0x114)]!==undefined&&{'activation_template_id':_0x282047[_0x309502(0x114)]}};return stableStringify(_0x2a8832);}async function fetchSegment(_0x39f158,_0x3b231e,_0x5c3cbd,_0xb048ab){const _0x1b2212=a172_0x504867,_0x30b148=_0xb048ab?.[_0x1b2212(0x119)](_0x3c299f=>_0x3c299f['id']===_0x5c3cbd);if(_0x30b148)return _0x30b148;try{return await _0x39f158['segment'][_0x1b2212(0x149)](_0x3b231e,_0x5c3cbd);}catch(_0x39e205){logger[_0x1b2212(0xd4)](_0x1b2212(0x67)+_0x5c3cbd+_0x1b2212(0xef)+_0x39e205);try{return await _0x39f158[_0x1b2212(0x165)][_0x1b2212(0xb6)](_0x5c3cbd);}catch(_0x525c7b){return logger[_0x1b2212(0xd4)](_0x1b2212(0x78)+_0x5c3cbd+':\x20'+_0x525c7b),null;}}}function recoverSegmentIdsFromPushRecovery(_0x634e30,_0x44f232,_0x13123f){const _0xdbcd9e=a172_0x504867,_0x3a5311=readPushRecovery(_0x634e30['absolutePath']);if(_0x3a5311?.[_0xdbcd9e(0xab)]===_0x634e30['yamlConfig']['name'])for(const [_0x3a553b,_0x1f14f9]of Object['entries'](_0x3a5311[_0xdbcd9e(0x150)])){const _0x170be1=generateDeterministicJourneySegmentName(_0x634e30[_0xdbcd9e(0xa8)][_0xdbcd9e(0xa2)],_0x3a553b);_0x1f14f9[_0xdbcd9e(0x14a)]===_0x170be1&&(_0x44f232[_0xdbcd9e(0x129)](_0x3a553b,_0x1f14f9['segmentId']),_0x13123f[_0xdbcd9e(0x129)](_0x3a553b,_0x1f14f9[_0xdbcd9e(0xcf)]));}}async function createOrRecoverEmbeddedSegment(_0x2c67ac,_0x2091a0,_0x4e1343,_0x4aab81){const _0x2e8f10=a172_0x504867;let _0x63abd2;try{_0x63abd2=await _0x2c67ac[_0x2e8f10(0x165)][_0x2e8f10(0xa9)]({'name':_0x4e1343['uniqueSegmentName'],'description':_0x4e1343['description'],'journeyId':_0x4e1343[_0x2e8f10(0x128)],'rule':_0x4aab81(_0x4e1343[_0x2e8f10(0xac)],!![]),'countPopulation':!![],'parentFolderId':_0x4e1343[_0x2e8f10(0xf9)],'audienceId':_0x4e1343[_0x2e8f10(0x107)]});}catch(_0x3e80ac){const _0x49f3e5=_0x3e80ac instanceof Error&&_0x3e80ac['message']['includes'](_0x2e8f10(0x105));if(_0x49f3e5){const _0x1a1159=readPushRecovery(_0x2091a0['absolutePath']),_0x37c34c=_0x1a1159?.[_0x2e8f10(0xab)]===_0x2091a0['yamlConfig'][_0x2e8f10(0xa2)]?_0x1a1159[_0x2e8f10(0x150)][_0x4e1343['localName']]:undefined;if(_0x37c34c?.[_0x2e8f10(0x14a)]===_0x4e1343[_0x2e8f10(0x7d)])await _0x2c67ac[_0x2e8f10(0x165)][_0x2e8f10(0x73)](_0x4e1343[_0x2e8f10(0x107)],_0x37c34c[_0x2e8f10(0xcf)],{'description':_0x4e1343[_0x2e8f10(0xfa)],'rule':_0x4aab81(_0x4e1343[_0x2e8f10(0xac)],!![]),'countPopulation':!![]}),_0x63abd2=_0x37c34c[_0x2e8f10(0xcf)];else throw new SDKError(ErrorCode[_0x2e8f10(0xe5)],'Embedded\x20segment\x20\x27'+_0x4e1343[_0x2e8f10(0x6e)]+_0x2e8f10(0xfe)+(_0x2e8f10(0x14c)+_0x2091a0[_0x2e8f10(0x71)][_0x2e8f10(0x15b)](/([^/]+)$/,_0x2e8f10(0x141))+')\x20')+_0x2e8f10(0x15a),_0x3e80ac);}else throw _0x3e80ac;}return saveSegmentToPushRecovery(_0x2091a0[_0x2e8f10(0x71)],_0x2091a0['yamlConfig']['name'],_0x4e1343[_0x2e8f10(0x6e)],{'segmentId':_0x63abd2,'uniqueServerName':_0x4e1343[_0x2e8f10(0x7d)],'createdAt':new Date()[_0x2e8f10(0xb8)]()}),_0x63abd2;}export async function prepareSegmentFiles(_0x22e0ae,_0x3edd67,_0x1a3317,_0x2ee24c,_0x20288e){const _0x318153=a172_0x504867,{activationDefToCreateRequest:_0x2ace95}=await import('./child-segment-yaml.js'),_0xb1a1f=[],_0x1e9e63=new Set();for(const {yamlConfig:_0x115dd3,folderPath:_0x19855e,sourcePath:_0x2af658}of _0x22e0ae){const _0x4ae518=resolveTDFolderPath(_0x19855e,_0x2ee24c,_0x20288e),_0x81e0ef=_0x4ae518+':'+_0x115dd3[_0x318153(0xa2)],_0x22fcf8=_0x3edd67[_0x318153(0x95)][_0x318153(0x153)](_0x81e0ef),_0x53699c=_0x22fcf8?_0x3edd67[_0x318153(0x68)][_0x318153(0x153)](_0x22fcf8['id'])||[]:[];addFoldersToCreate(_0x4ae518,_0x3edd67[_0x318153(0x12a)],_0x1e9e63);const _0x2aebad=calculateActivationActions(_0x115dd3[_0x318153(0xd2)]||[],_0x53699c,_0x3edd67['idToEmailMap'],_0x3edd67[_0x318153(0xec)]);for(const _0x53d247 of _0x2aebad){(_0x53d247[_0x318153(0xdd)]==='create'||_0x53d247['type']===_0x318153(0xc3))&&_0x53d247['yamlActivation']&&(_0x53d247[_0x318153(0xf6)]=await _0x2ace95(_0x53d247[_0x318153(0x151)],_0x1a3317));}const _0x13bfdb=calculateSegmentDiff(_0x115dd3,_0x22fcf8,_0x53699c,_0x3edd67[_0x318153(0x10e)],_0x3edd67['connectionIdToNameMap']);_0xb1a1f[_0x318153(0x142)]({'relativePath':_0x115dd3[_0x318153(0xa2)],'absolutePath':_0x2af658,'yamlConfig':_0x115dd3,'folderPath':_0x4ae518,'existingSegment':_0x22fcf8,'existingActivations':_0x53699c,'isNew':_0x13bfdb[_0x318153(0xbf)],'hasChanges':_0x13bfdb[_0x318153(0xa4)],'diff':_0x13bfdb[_0x318153(0x8c)],'activationActions':_0x2aebad});}return{'segmentFiles':_0xb1a1f,'foldersToCreate':_0x1e9e63};}export async function prepareJourneyFiles(_0x3ea4ab,_0x2e9e29,_0x41e4c3,_0x3434de){const _0x456b2c=a172_0x504867,_0x276b6a=[],_0x1a6708=new Set();for(const {yamlConfig:_0x195bc2,folderPath:_0x47c91d,sourcePath:_0x1b47cf}of _0x3ea4ab){const _0x43b0fe=resolveTDFolderPath(_0x47c91d,_0x41e4c3,_0x3434de),_0x5070bf=_0x43b0fe+':'+_0x195bc2[_0x456b2c(0xa2)],_0x4b2d5d=_0x2e9e29[_0x456b2c(0x131)][_0x456b2c(0x153)](_0x5070bf);let _0x1984e7,_0x4950b7;if(_0x4b2d5d&&_0x4b2d5d[_0x456b2c(0xdc)]>0x0){const _0x222718=buildLocalExpandedRuleMappings(_0x195bc2),{createYamlContext:_0x2a73b5,prefetchJourneySegments:_0x2d8c09}=createPushYamlContextForBundle(_0x2e9e29[_0x456b2c(0x99)],_0x2e9e29[_0x456b2c(0x107)],_0x2e9e29[_0x456b2c(0x12d)],_0x222718,_0x2e9e29[_0x456b2c(0x10e)],_0x2e9e29['connectionIdToNameMap'],_0x2e9e29[_0x456b2c(0xea)],_0x2e9e29[_0x456b2c(0xbe)]);await _0x2d8c09(_0x4b2d5d[_0x456b2c(0xfd)](_0x16b5d9=>_0x16b5d9['id']));const _0x30bf67=await _0x2e9e29['deps'][_0x456b2c(0x82)]['getLatestJourneyId'](_0x4b2d5d[0x0][_0x456b2c(0x146)]),_0x56f99f=hasMultipleVersions(_0x195bc2),_0x4618d2=async _0x3883de=>{const _0x3aff03=_0x456b2c,_0x2f5a32=_0x2e9e29[_0x3aff03(0xbe)]?.[_0x3aff03(0x153)](_0x3883de);if(_0x2f5a32)return _0x2f5a32;return _0x2e9e29[_0x3aff03(0xdb)]({'journeyId':_0x3883de,'journeyName':_0x195bc2[_0x3aff03(0xa2)],'isMultiVersion':_0x4b2d5d[_0x3aff03(0xdc)]>0x1});};if(_0x56f99f&&_0x4b2d5d['length']>0x1){const _0x5a5558=[];for(const _0x5a5195 of _0x4b2d5d){const _0x4c8b1c=_0x5a5195[_0x456b2c(0x15f)]||0x1;_0x2e9e29[_0x456b2c(0x14b)]?.[_0x456b2c(0xc3)]('Fetching\x20'+_0x195bc2[_0x456b2c(0xa2)]+'\x20v'+_0x4c8b1c);const _0x325a16=await _0x4618d2(_0x5a5195['id']),_0xcfc8a0=_0x2a73b5(_0x5a5195['id']),_0x519cd6=await journeyResponseToDef(_0x325a16,_0xcfc8a0);_0x5a5558[_0x456b2c(0x142)]({'item':_0x5a5195,'yaml':_0x519cd6});}const _0x151124=buildLocalRuleToNameMappingFromJourney(_0x195bc2);_0x4950b7=buildMergedJourneyDef(_0x5a5558,_0x151124,_0x30bf67);const _0x5e267c=Math[_0x456b2c(0x66)](..._0x5a5558[_0x456b2c(0xfd)](_0x524a0d=>_0x524a0d[_0x456b2c(0xaa)][_0x456b2c(0x15f)]||0x0)),_0x23c624=_0x4b2d5d[_0x456b2c(0x119)](_0xa35d3d=>(_0xa35d3d['versionNumber']||0x0)===_0x5e267c);_0x23c624&&(_0x2e9e29['progress']?.[_0x456b2c(0xc3)](_0x456b2c(0x70)+_0x195bc2[_0x456b2c(0xa2)]+'\x20v'+_0x5e267c),_0x1984e7=await _0x4618d2(_0x23c624['id']));}else{const _0x411b32=_0x4b2d5d[_0x4b2d5d[_0x456b2c(0xdc)]-0x1];_0x2e9e29[_0x456b2c(0x14b)]?.[_0x456b2c(0xc3)](_0x456b2c(0x70)+_0x195bc2[_0x456b2c(0xa2)]),_0x1984e7=await _0x4618d2(_0x411b32['id']);const _0x294045=_0x2a73b5(_0x411b32['id']),_0x1102d9=await journeyResponseToDef(_0x1984e7,_0x294045),_0x36b7d0=buildLocalRuleToNameMappingFromJourney(_0x195bc2);_0x4950b7=buildMergedJourneyDef([{'item':_0x411b32,'yaml':_0x1102d9}],_0x36b7d0,_0x30bf67);}}addFoldersToCreate(_0x43b0fe,_0x2e9e29['folderPathToId'],_0x1a6708);const _0x49e868=calculateJourneyDiff(_0x195bc2,_0x4950b7);_0x276b6a[_0x456b2c(0x142)]({'relativePath':_0x195bc2[_0x456b2c(0xa2)],'absolutePath':_0x1b47cf,'yamlConfig':_0x195bc2,'folderPath':_0x43b0fe,'existingJourney':_0x1984e7,'isNew':_0x49e868[_0x456b2c(0xbf)],'hasChanges':_0x49e868[_0x456b2c(0xa4)],'diff':_0x49e868[_0x456b2c(0x8c)]});}return{'journeyFiles':_0x276b6a,'foldersToCreate':_0x1a6708};}export function calculateActivationActions(_0x89fbb8,_0x10a12a,_0x2fd489,_0x24d8c8){const _0x391692=a172_0x504867,_0x4c2031=[],_0x817e36=new Map();for(const _0x586ad7 of _0x10a12a){_0x817e36['set'](_0x586ad7[_0x391692(0xa2)],_0x586ad7);}const _0x32800c=new Map();for(const _0x134801 of _0x89fbb8){_0x32800c[_0x391692(0x129)](_0x134801['name'],_0x134801);}for(const _0x1887cf of _0x89fbb8){const _0x13270c=_0x817e36[_0x391692(0x153)](_0x1887cf[_0x391692(0xa2)]);if(!_0x13270c)_0x4c2031[_0x391692(0x142)]({'type':_0x391692(0x108),'name':_0x1887cf[_0x391692(0xa2)],'yamlActivation':_0x1887cf});else{const _0x29bd63=activationResponseToDef(_0x13270c,_0x2fd489,_0x24d8c8),_0x246c52=a172_0x42c49c[_0x391692(0x13b)](_0x29bd63),_0x3aa1ac=a172_0x42c49c[_0x391692(0x13b)](_0x1887cf);_0x246c52!==_0x3aa1ac&&_0x4c2031[_0x391692(0x142)]({'type':_0x391692(0xc3),'name':_0x1887cf[_0x391692(0xa2)],'yamlActivation':_0x1887cf,'existingActivation':_0x13270c});}}for(const _0x1deb17 of _0x10a12a){!_0x32800c[_0x391692(0xff)](_0x1deb17[_0x391692(0xa2)])&&_0x4c2031[_0x391692(0x142)]({'type':'delete','name':_0x1deb17['name'],'existingActivation':_0x1deb17});}return _0x4c2031;}function calculateYamlDiff(_0x463632,_0x10e9be){if(_0x10e9be){const _0xa46908=generateDiff(_0x10e9be,_0x463632),_0x52c97e=hasChanges(_0xa46908);return{'isNew':![],'hasChanges':_0x52c97e,'diff':_0x52c97e?formatDiffWithColors(_0xa46908):undefined};}const _0x51f296=generateDiff('',_0x463632);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x51f296)};}export function calculateSegmentDiff(_0x278ba9,_0x281e0b,_0x5372ad,_0x55b9b7,_0x21b5dd){const _0x76e7b0=segmentToYamlString(_0x278ba9),_0x1babe7=_0x281e0b?segmentToYamlString(segmentWithActivationsToYaml(_0x281e0b,_0x5372ad,undefined,_0x55b9b7,_0x21b5dd)):undefined;return calculateYamlDiff(_0x76e7b0,_0x1babe7);}export function calculateJourneyDiff(_0x392e84,_0x3f08f3){const _0x3f25c6=normalizeJourneyDef(_0x392e84,_0x392e84),_0x38a65e=a172_0x37f0cf(_0x3f25c6),_0x2f0156=_0x3f08f3?a172_0x37f0cf(normalizeJourneyDef(_0x3f08f3,_0x392e84)):undefined;return calculateYamlDiff(_0x38a65e,_0x2f0156);}export function findSegmentsToDelete(_0x5bdcb4,_0x1f2f72,_0x4cba65,_0x59a745,_0x56bcdc){const _0x5714e3=a172_0x504867,_0x4ab338=new Set();for(const {yamlConfig:_0x5133ae,folderPath:_0x1a8f44}of _0x1f2f72){_0x4ab338[_0x5714e3(0xd5)](_0x1a8f44+':'+_0x5133ae['name']);}return _0x5bdcb4[_0x5714e3(0xa5)](_0x33f3cc=>{const _0xfbade6=_0x5714e3,_0x353037=_0x33f3cc[_0xfbade6(0x143)]?_0x4cba65[_0xfbade6(0x153)](_0x33f3cc['segmentFolderId'][_0xfbade6(0x148)]())||'':'',_0x354e13=_0x353037+':'+_0x33f3cc[_0xfbade6(0xa2)];if(_0x4ab338[_0xfbade6(0xff)](_0x354e13))return![];if(_0x56bcdc)return _0x353037===_0x59a745||_0x353037['startsWith'](_0x59a745+'/');return!![];});}export function findJourneysToDelete(_0x30552c,_0x13e4ec,_0x392820,_0x30460c,_0x4a5213){const _0xb4d1d1=a172_0x504867,_0x5e0aca=new Set();for(const {yamlConfig:_0x6a47be,folderPath:_0x4a8a6f}of _0x13e4ec){_0x5e0aca[_0xb4d1d1(0xd5)](_0x4a8a6f+':'+_0x6a47be[_0xb4d1d1(0xa2)]);}return _0x30552c['filter'](_0x352645=>{const _0x1b8c8a=_0xb4d1d1,_0x55e741=_0x352645['folderId']?_0x392820['get'](_0x352645[_0x1b8c8a(0xf9)])||'':'',_0xef178f=_0x55e741+':'+_0x352645[_0x1b8c8a(0x15d)];if(_0x5e0aca[_0x1b8c8a(0xff)](_0xef178f))return![];if(_0x4a5213)return _0x55e741===_0x30460c||_0x55e741[_0x1b8c8a(0x155)](_0x30460c+'/');return!![];});}export function buildSegmentLookupMap(_0xa7c10f,_0xbc5d08){const _0x5c9455=a172_0x504867,_0x1cd6f4=new Map();for(const _0x5bf347 of _0xa7c10f){const _0x3b781d=_0x5bf347[_0x5c9455(0x143)]?_0xbc5d08[_0x5c9455(0x153)](_0x5bf347[_0x5c9455(0x143)][_0x5c9455(0x148)]())||'':'',_0x345070=_0x3b781d+':'+_0x5bf347[_0x5c9455(0xa2)];_0x1cd6f4['set'](_0x345070,_0x5bf347);}return _0x1cd6f4;}export function buildSegmentNameToIdMap(_0xdfb1ef){const _0x536fad=a172_0x504867,_0x50b84c=new Map();for(const _0x349969 of _0xdfb1ef){_0x50b84c[_0x536fad(0x129)](_0x349969[_0x536fad(0xa2)],_0x349969['id']);}return _0x50b84c;}export function buildJourneyBundleLookupMap(_0x4b0bf4,_0x2bd03e){const _0x17f1b5=a172_0x504867,_0x4a8479=new Map();for(const _0x5526c8 of _0x4b0bf4){const _0xa8e91b=_0x5526c8[_0x17f1b5(0xf9)]?_0x2bd03e['get'](_0x5526c8[_0x17f1b5(0xf9)])||'':'',_0x1593bc=_0xa8e91b+':'+_0x5526c8[_0x17f1b5(0x15d)];!_0x4a8479[_0x17f1b5(0xff)](_0x1593bc)&&_0x4a8479['set'](_0x1593bc,[]),_0x4a8479[_0x17f1b5(0x153)](_0x1593bc)['push'](_0x5526c8);}for(const _0x1d72f3 of _0x4a8479['values']()){_0x1d72f3[_0x17f1b5(0xb5)]((_0xef221b,_0x50499b)=>(_0xef221b[_0x17f1b5(0x15f)]||0x0)-(_0x50499b[_0x17f1b5(0x15f)]||0x0));}return _0x4a8479;}export function collectFoldersToCreate(_0x2254a1,_0x67fc69){const _0x1642ad=a172_0x504867,_0x467238=new Set();for(const _0x159ca2 of _0x2254a1){if(!_0x159ca2)continue;if(_0x67fc69[_0x1642ad(0xff)](_0x159ca2))continue;const _0xeed612=_0x159ca2[_0x1642ad(0x145)]('/');let _0xf54432='';for(const _0xafaa7b of _0xeed612){_0xf54432=_0xf54432?_0xf54432+'/'+_0xafaa7b:_0xafaa7b,!_0x67fc69[_0x1642ad(0xff)](_0xf54432)&&_0x467238[_0x1642ad(0xd5)](_0xf54432);}}return _0x467238;}export function parseAndClassifyYamlFiles(_0x170ce1,_0x322bfd,_0x1aa2fb){const _0x421384=a172_0x504867,_0x7d236=[],_0x53732b=[];for(const _0x57e6c8 of _0x170ce1){const _0x3893d3=a172_0x5b835a[_0x421384(0x97)](_0x322bfd,a172_0x5b835a[_0x421384(0xeb)](_0x57e6c8)),_0x191449=_0x3893d3==='.'?'':_0x3893d3[_0x421384(0x15b)](/\\/g,'/'),_0x13884c=readFileSync(_0x57e6c8,'utf-8'),_0x3b70e6=a172_0x42c49c['parse'](_0x13884c);if(isJourneyDef(_0x3b70e6,_0x57e6c8)){const _0x39aabe=a172_0x58880(_0x13884c);_0x53732b[_0x421384(0x142)]({'yamlConfig':_0x39aabe,'folderPath':_0x191449,'sourcePath':_0x57e6c8});}else{if(!_0x1aa2fb?.['skipSegments']){const _0x2ddb08=parseSegmentYamlFile(_0x13884c),_0x42f66d=normalizeChildSegmentYaml(_0x2ddb08);_0x7d236[_0x421384(0x142)]({'yamlConfig':_0x42f66d,'folderPath':_0x191449,'sourcePath':_0x57e6c8});}}}return{'segments':_0x7d236,'journeys':_0x53732b};}function a172_0xbe52(_0x2157b0,_0x356b7f){_0x2157b0=_0x2157b0-0x66;const _0x113da9=a172_0x113d();let _0xbe525a=_0x113da9[_0x2157b0];return _0xbe525a;}export function validateParsedFiles(_0x2bce05,_0x294865){const _0x97fb40=a172_0x504867,_0x5c8810=[];for(const {yamlConfig:_0x1fabcb,sourcePath:_0x5c7fa5}of _0x2bce05[_0x97fb40(0x150)]){const _0x120e42=readFileSync(_0x5c7fa5,_0x97fb40(0xd8)),_0xb3b64f=a172_0x42c49c[_0x97fb40(0x69)](_0x120e42),_0x3ec4e8=validateSegmentDef(_0x1fabcb,{'source':_0x120e42,'document':_0xb3b64f},{'skipSchema':!![]});if(!_0x3ec4e8['valid']){const _0x5e6bc7=a172_0x5b835a[_0x97fb40(0x97)](_0x294865,_0x5c7fa5);_0x5c8810['push']({'filePath':_0x5e6bc7,'source':_0x120e42,'result':_0x3ec4e8,'isJourney':![]});}}for(const {yamlConfig:_0x28f072,sourcePath:_0x555ef3}of _0x2bce05[_0x97fb40(0x156)]){const _0x2f106d=readFileSync(_0x555ef3,_0x97fb40(0xd8)),_0x21bd4e=a172_0x42c49c[_0x97fb40(0x69)](_0x2f106d),_0x3b5ca3=validateJourneyDef(_0x28f072,{'source':_0x2f106d,'document':_0x21bd4e},{'skipSchema':!![]});if(!_0x3b5ca3[_0x97fb40(0x87)]){const _0x359a80=a172_0x5b835a[_0x97fb40(0x97)](_0x294865,_0x555ef3);_0x5c8810['push']({'filePath':_0x359a80,'source':_0x2f106d,'result':_0x3b5ca3,'isJourney':!![]});}}return _0x5c8810;}export function formatValidationErrors(_0x4213ab){const _0x18e50f=a172_0x504867,_0x402c8e=[];for(const {filePath:_0x8cf4a3,source:_0x2eb3ca,result:_0x377c4c,isJourney:_0x4b3df9}of _0x4213ab){const _0x58cc2b=_0x4b3df9?'journey':_0x18e50f(0x165);_0x402c8e[_0x18e50f(0x142)]('\x0a'+_0x8cf4a3+'\x20('+_0x58cc2b+_0x18e50f(0x13e)+_0x377c4c['errors'][_0x18e50f(0xdc)]+'\x20error(s)'),_0x402c8e[_0x18e50f(0x142)](formatValidationResult(_0x377c4c,_0x2eb3ca,_0x8cf4a3));}return _0x402c8e[_0x18e50f(0x101)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x190df7){const _0x5a8f7a=a172_0x504867,_0x331d78=new Set(),_0x47681a=new Map(),_0x2dfa5d=collectSegmentUsageCounts(_0x190df7);if(_0x190df7['segments'])for(const [_0x3b18e2,_0x924842]of Object[_0x5a8f7a(0xf8)](_0x190df7[_0x5a8f7a(0x150)])){_0x331d78[_0x5a8f7a(0xd5)](_0x3b18e2);if(_0x924842[_0x5a8f7a(0xfb)]){const _0x5a26fa=yamlRuleToApi(_0x924842[_0x5a8f7a(0xfb)]),_0x488d11=apiRuleToYaml(_0x5a26fa);_0x47681a[_0x5a8f7a(0x129)](_0x3b18e2,_0x488d11);}}const _0x3d2549=new Map();let _0x36e0cc=0x0;for(const [_0x1cc1aa,_0x248c9b]of _0x47681a){const _0x5e7b2f=serializeExpandedRule(_0x248c9b,_0x47681a),_0x3366ea=_0x3d2549[_0x5a8f7a(0x153)](_0x5e7b2f)||[];_0x3366ea['push']({'name':_0x1cc1aa,'index':_0x36e0cc}),_0x3d2549[_0x5a8f7a(0x129)](_0x5e7b2f,_0x3366ea),_0x36e0cc++;}const _0x195fdf=new Map();for(const [_0x36a285,_0x45e415]of _0x3d2549){const _0x47f858=_0x45e415['slice']()[_0x5a8f7a(0xb5)]((_0x34333d,_0x27e68f)=>{const _0x94140a=_0x5a8f7a,_0x1df334=_0x2dfa5d[_0x94140a(0x153)](_0x34333d[_0x94140a(0xa2)])||0x0,_0x2b6064=_0x2dfa5d['get'](_0x27e68f[_0x94140a(0xa2)])||0x0;if(_0x1df334!==_0x2b6064)return _0x2b6064-_0x1df334;return _0x34333d[_0x94140a(0xb3)]-_0x27e68f[_0x94140a(0xb3)];})[_0x5a8f7a(0xfd)](_0x1acdf5=>_0x1acdf5['name']),_0x23c3ad=[];for(const _0x50260c of _0x47f858){const _0x524627=_0x2dfa5d[_0x5a8f7a(0x153)](_0x50260c)||0x0,_0x389eaa=Math['max'](_0x524627,0x1);for(let _0x2eae16=0x0;_0x2eae16<_0x389eaa;_0x2eae16++){_0x23c3ad[_0x5a8f7a(0x142)](_0x50260c);}}_0x195fdf[_0x5a8f7a(0x129)](_0x36a285,_0x23c3ad);}return{'existingLocalSegmentNames':_0x331d78,'localSegmentRules':_0x47681a,'localExpandedRuleToNames':_0x195fdf};}export function createSegmentIdResolver(_0x2d3d79,_0x4878bb){return async _0x561ff3=>{const _0x44f214=a172_0xbe52,_0x5d9423=_0x2d3d79['get'](_0x561ff3);if(!_0x5d9423)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x44f214(0x135)+_0x561ff3+_0x44f214(0x147)+_0x4878bb+'\x27)');return _0x5d9423;};}export function extractRootFolderId(_0x26b129){const _0x5780b6=a172_0x504867;return _0x26b129[_0x5780b6(0x81)]?.[_0x5780b6(0x122)]?.[_0x5780b6(0xd1)]?.['id']||_0x26b129['relationships']?.['parentFolder']?.[_0x5780b6(0xd1)]?.['id'];}export function buildConnectionMaps(_0x4baa40){const _0x4fac9f=a172_0x504867,_0x2ec231=new Map(),_0x6a1d2e=new Map(),_0x1282a5=new Map();for(const _0x4e4acd of _0x4baa40){_0x2ec231[_0x4fac9f(0x129)](_0x4e4acd[_0x4fac9f(0xa2)],parseInt(_0x4e4acd['id'],0xa)),_0x6a1d2e[_0x4fac9f(0x129)](_0x4e4acd['id'],_0x4e4acd[_0x4fac9f(0xa2)]),_0x1282a5[_0x4fac9f(0x129)](_0x4e4acd[_0x4fac9f(0xa2)],_0x4e4acd[_0x4fac9f(0xdd)]);}return{'nameToId':_0x2ec231,'idToName':_0x6a1d2e,'nameToType':_0x1282a5};}export function calculatePushStats(_0x27f2d0,_0x4115a5,_0x1fe71a,_0x4d95d2,_0x385399,_0x56fdb9,_0x132169){const _0x27e11d=a172_0x504867,_0x5b004b=_0x27f2d0[_0x27e11d(0xa5)](_0x32b57f=>_0x32b57f['isNew']),_0x3010fb=_0x27f2d0[_0x27e11d(0xa5)](_0xea9e02=>!_0xea9e02[_0x27e11d(0xbf)]&&_0xea9e02[_0x27e11d(0xa4)]),_0x59ade4=_0x27f2d0[_0x27e11d(0xa5)](_0x5da1f0=>!_0x5da1f0[_0x27e11d(0xbf)]&&!_0x5da1f0[_0x27e11d(0xa4)]),_0x5c0386=_0x56fdb9?_0x4d95d2:[],_0x176921=_0x4115a5[_0x27e11d(0xa5)](_0x740fa9=>_0x740fa9[_0x27e11d(0xbf)]),_0xc08dab=_0x4115a5[_0x27e11d(0xa5)](_0x5814a7=>!_0x5814a7[_0x27e11d(0xbf)]&&_0x5814a7['hasChanges']),_0x3d283a=_0x4115a5[_0x27e11d(0xa5)](_0x436bdc=>!_0x436bdc[_0x27e11d(0xbf)]&&!_0x436bdc[_0x27e11d(0xa4)]),_0x2f69fa=_0x56fdb9?_0x385399:[],_0x353af0=_0x27f2d0[_0x27e11d(0x144)](_0x2bbd80=>_0x2bbd80[_0x27e11d(0xaf)]),_0x1b6ccb=_0x353af0[_0x27e11d(0xa5)](_0x244788=>_0x244788[_0x27e11d(0xdd)]===_0x27e11d(0x108)),_0x8118c1=_0x353af0[_0x27e11d(0xa5)](_0x5e3085=>_0x5e3085[_0x27e11d(0xdd)]===_0x27e11d(0xc3)),_0x46e1af=_0x353af0[_0x27e11d(0xa5)](_0x4f2a16=>_0x4f2a16['type']===_0x27e11d(0xc8)),_0xc68ed6=Array[_0x27e11d(0x15c)](_0x1fe71a)[_0x27e11d(0xb5)](),_0x2df5b9=_0x132169?![]:_0x5b004b[_0x27e11d(0xdc)]>0x0||_0x3010fb[_0x27e11d(0xdc)]>0x0||_0x5c0386[_0x27e11d(0xdc)]>0x0,_0x29771b=_0x176921[_0x27e11d(0xdc)]>0x0||_0xc08dab[_0x27e11d(0xdc)]>0x0||_0x2f69fa[_0x27e11d(0xdc)]>0x0,_0x42c6cc=_0x132169?![]:_0x353af0[_0x27e11d(0xdc)]>0x0,_0x2200ec=_0xc68ed6[_0x27e11d(0xdc)]>0x0;return{'segments':{'new':_0x5b004b,'changed':_0x3010fb,'unchanged':_0x59ade4,'toDelete':_0x5c0386},'journeys':{'new':_0x176921,'changed':_0xc08dab,'unchanged':_0x3d283a,'toDelete':_0x2f69fa},'activations':{'all':_0x353af0,'toCreate':_0x1b6ccb,'toUpdate':_0x8118c1,'toDelete':_0x46e1af},'folders':{'toCreate':_0xc68ed6},'counts':{'segments':{'new':_0x5b004b[_0x27e11d(0xdc)],'changed':_0x3010fb[_0x27e11d(0xdc)],'unchanged':_0x59ade4[_0x27e11d(0xdc)],'toDelete':_0x5c0386[_0x27e11d(0xdc)]},'journeys':{'new':_0x176921['length'],'changed':_0xc08dab[_0x27e11d(0xdc)],'unchanged':_0x3d283a[_0x27e11d(0xdc)],'toDelete':_0x2f69fa['length']},'activations':{'create':_0x1b6ccb['length'],'update':_0x8118c1['length'],'delete':_0x46e1af[_0x27e11d(0xdc)]},'folders':_0xc68ed6['length']},'hasChanges':_0x2df5b9||_0x29771b||_0x42c6cc||_0x2200ec};}export async function buildPushExecutionContext(_0x1fcc4c,_0x379b70,_0x4cca8a,_0x580c2f,_0x31001a,_0x20fcc8){const _0x27e51e=a172_0x504867,_0x1cfc85=extractRootFolderId(_0x4cca8a),{pathToId:_0x4bf93d,idToPath:_0x3eb752}=buildFolderMaps(_0x31001a),_0xdffe73=buildSegmentNameToIdMap(_0x580c2f),_0x1202b5=new Map(),{batchAsync:_0x288049}=await import(_0x27e51e(0x140)),[_0x2a2f42,_0x2f8383]=await Promise[_0x27e51e(0x75)]([_0x1fcc4c['user'][_0x27e51e(0x136)](),_0x1fcc4c[_0x27e51e(0x11a)][_0x27e51e(0x106)](),((async()=>{const _0x5f0dcb=_0x27e51e;!_0x20fcc8&&_0x580c2f[_0x5f0dcb(0xdc)]>0x0&&await _0x288049(_0x580c2f,async _0x524a5e=>{const _0x5cea7c=_0x5f0dcb,_0x36b1ce=await _0x1fcc4c[_0x5cea7c(0x165)]['listActivations'](_0x379b70,_0x524a5e['id']);_0x1202b5[_0x5cea7c(0x129)](_0x524a5e['id'],_0x36b1ce);});})())]),{emailToId:_0x511624,idToEmail:_0x50763d}=_0x2a2f42,_0x3161c3=buildConnectionMaps(_0x2f8383);return{'rootFolderId':_0x1cfc85,'folderPathToId':_0x4bf93d,'folderIdToPath':_0x3eb752,'segmentNameToId':_0xdffe73,'activationsBySegmentId':_0x1202b5,'emailToIdMap':_0x511624,'idToEmailMap':_0x50763d,'connectionNameToIdMap':_0x3161c3[_0x27e51e(0xda)],'connectionIdToNameMap':_0x3161c3[_0x27e51e(0x104)],'connectionNameToTypeMap':_0x3161c3[_0x27e51e(0x117)]};}export function createPushYamlContextForBundle(_0x4967b2,_0x398856,_0x27fea6,_0x2ad7f4,_0x11154b,_0x45dc2f,_0x542288,_0x1c69de){const {existingLocalSegmentNames:_0x1dc1cb,localExpandedRuleToNames:_0x17a10d}=_0x2ad7f4,_0xdc7918=new Set(),_0x56e77b=new Map(),_0x26df7b=new Map(),_0x580169=new Map(),_0x4417e4=createJumpTargetCache(),_0x143fa5=new Map(),_0x587c2e=new Map(),_0x3bccdd=new Set();let _0x31e16f;const _0x4af5c6=_0x25edd2=>{const _0xd35c5d={'resolveSegment':async _0x4425da=>{const _0x29bd86=a172_0xbe52,_0x320090=_0x580169[_0x29bd86(0x153)](_0x4425da);if(_0x320090!==undefined)return{'name':_0x320090,'isJourneyLocal':!![]};try{const _0xa77d5e=await fetchSegment(_0x4967b2,_0x398856,_0x4425da,_0x27fea6);if(!_0xa77d5e)throw new Error(_0x29bd86(0x77));const _0x5e56c6=generateJourneyLocalName(_0xa77d5e['name']),_0x21aac0=_0xa77d5e[_0x29bd86(0x83)]===SEGMENT_KIND_JOURNEY&&_0x5e56c6!==undefined;let _0x403ed7=_0xa77d5e[_0x29bd86(0xa2)],_0x333ecf;if(_0x21aac0&&_0xa77d5e[_0x29bd86(0xfb)]){const _0x4c10ed=apiRuleToYaml(_0xa77d5e[_0x29bd86(0xfb)]);_0x587c2e[_0x29bd86(0x129)](_0x4425da,_0x4c10ed);const _0x5b6ce9=async _0x332a4c=>{const _0xb71eac=_0x29bd86,_0x215224=collectSegmentRefsFromRule(_0x332a4c);for(const _0x46c18e of _0x215224){if(!_0x587c2e['has'](_0x46c18e))try{const _0x8e54d6=await fetchSegment(_0x4967b2,_0x398856,_0x46c18e,_0x27fea6);if(_0x8e54d6?.[_0xb71eac(0xfb)]){const _0x2977eb=apiRuleToYaml(_0x8e54d6['rule']);_0x587c2e['set'](_0x46c18e,_0x2977eb),await _0x5b6ce9(_0x2977eb);}}catch(_0x1aa93f){logger[_0xb71eac(0xd4)](_0xb71eac(0x9c)+_0x46c18e+':\x20'+_0x1aa93f);}}};await _0x5b6ce9(_0x4c10ed);const _0xd1314a=serializeExpandedRule(_0x4c10ed,_0x587c2e),_0x4d17a4=_0x17a10d['get'](_0xd1314a);if(_0x4d17a4&&_0x4d17a4[_0x29bd86(0xdc)]>0x0){const _0x400fa5=_0x56e77b[_0x29bd86(0x153)](_0xd1314a)||0x0,_0x5c8978=_0x4d17a4[_0x400fa5]||_0x4d17a4[_0x4d17a4['length']-0x1];_0x56e77b[_0x29bd86(0x129)](_0xd1314a,_0x400fa5+0x1),_0x403ed7=_0x5c8978,_0xdc7918['add'](_0x403ed7),_0x580169['set'](_0x4425da,_0x403ed7);const _0x5e4a20=await resolveRuleSegmentRefs(_0x4c10ed,async _0x10fb2e=>{const _0x17af4c=_0x29bd86,_0x170059=_0x580169[_0x17af4c(0x153)](_0x10fb2e);if(_0x170059)return _0x170059;const _0x47d5c1=await _0x31e16f[_0x17af4c(0xc6)](_0x10fb2e);return _0x47d5c1[_0x17af4c(0xa2)];});_0x333ecf={'description':_0xa77d5e[_0x29bd86(0xfa)],'rule':_0x5e4a20};}else{const _0x527361=_0x143fa5[_0x29bd86(0x153)](_0xd1314a);if(_0x527361)_0x403ed7=_0x527361,_0x580169[_0x29bd86(0x129)](_0x4425da,_0x403ed7);else{if(_0x5e56c6){let _0x25b963=_0x5e56c6,_0x416c6f=0x2;while(_0xdc7918['has'](_0x25b963)||_0x1dc1cb['has'](_0x25b963)){_0x25b963=_0x5e56c6+'_'+_0x416c6f,_0x416c6f++;}_0xdc7918[_0x29bd86(0xd5)](_0x25b963),_0x403ed7=_0x25b963;}_0x580169[_0x29bd86(0x129)](_0x4425da,_0x403ed7),_0x143fa5[_0x29bd86(0x129)](_0xd1314a,_0x403ed7);const _0xafd126=await resolveRuleSegmentRefs(_0x4c10ed,async _0x5a5cdd=>{const _0x1f0fe8=_0x29bd86,_0x2201b1=_0x580169['get'](_0x5a5cdd);if(_0x2201b1)return _0x2201b1;const _0x551da9=await _0x31e16f[_0x1f0fe8(0xc6)](_0x5a5cdd);return _0x551da9[_0x1f0fe8(0xa2)];});_0x333ecf={'description':_0xa77d5e[_0x29bd86(0xfa)],'rule':_0xafd126};}}}return{'name':_0x403ed7,'isJourneyLocal':_0x21aac0,'definition':_0x333ecf};}catch(_0x408673){return logger[_0x29bd86(0xd4)](_0x29bd86(0xd7)+_0x4425da+':\x20'+_0x408673),{'name':_0x4425da,'isJourneyLocal':![]};}},'resolveActivation':async _0x1fa021=>{const _0x8a8e54=a172_0xbe52,_0x33c6d2=_0x26df7b['get'](_0x1fa021);if(_0x33c6d2!==undefined)return{'name':_0x33c6d2,'isJourneyLocal':!![]};try{let _0x20435a=_0x542288?.[_0x8a8e54(0x153)](_0x1fa021);!_0x20435a&&(_0x20435a=await _0x4967b2[_0x8a8e54(0x82)][_0x8a8e54(0x161)](_0x25edd2,_0x1fa021));const _0x3e392e=_0x20435a[_0x8a8e54(0x9f)][_0x8a8e54(0xbd)][_0x8a8e54(0xa2)]||_0x1fa021,_0x284dd9=sanitizeYamlKey(_0x3e392e)||'activation_'+_0x1fa021,_0x202f6e=_0x284dd9;_0x26df7b[_0x8a8e54(0x129)](_0x1fa021,_0x202f6e);const _0x170614=journeyActivationStepToYaml(_0x20435a,_0x11154b,_0x45dc2f);return{'name':_0x202f6e,'isJourneyLocal':!![],'definition':_0x170614};}catch(_0x1a8fda){return logger[_0x8a8e54(0xd4)](_0x8a8e54(0x10f)+_0x1fa021+':\x20'+_0x1a8fda),{'name':_0x1fa021,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2448cf,_0x17d76a)=>resolveJumpTarget(_0x2448cf,_0x17d76a,_0x4417e4,async _0x434ad5=>{const _0x5a7897=a172_0xbe52,_0x3df51f=_0x1c69de?.['get'](_0x434ad5);if(_0x3df51f)return _0x3df51f;return _0x4967b2['journey'][_0x5a7897(0x120)](_0x434ad5);})};return _0x31e16f=_0xd35c5d,_0xd35c5d;},_0x19618c=async _0x53f600=>{const _0x3ed6cb=a172_0xbe52,{collectSegmentIdsFromJourneyApi:_0x10d496}=await import(_0x3ed6cb(0xc4)),{batchAsync:_0x4816eb}=await import('../../utils/async.js'),_0x200e2a=new Set();for(const _0x5450ec of _0x53f600){let _0x4e5cc2=_0x1c69de?.[_0x3ed6cb(0x153)](_0x5450ec);!_0x4e5cc2&&(_0x4e5cc2=await _0x4967b2[_0x3ed6cb(0x82)][_0x3ed6cb(0x120)](_0x5450ec));const _0x4625b6=_0x10d496(_0x4e5cc2);for(const _0x1aa5a9 of _0x4625b6){_0x200e2a[_0x3ed6cb(0xd5)](_0x1aa5a9);}}let _0x572d00=Array['from'](_0x200e2a);while(_0x572d00[_0x3ed6cb(0xdc)]>0x0){const _0x55e4bc=_0x572d00[_0x3ed6cb(0xa5)](_0x5b5dea=>!_0x3bccdd[_0x3ed6cb(0xff)](_0x5b5dea));if(_0x55e4bc[_0x3ed6cb(0xdc)]===0x0)break;const _0x451c67=await _0x4816eb(_0x55e4bc,async _0x218e33=>{const _0x111f57=_0x3ed6cb;_0x3bccdd[_0x111f57(0xd5)](_0x218e33);const _0x214b22=await fetchSegment(_0x4967b2,_0x398856,_0x218e33,_0x27fea6);if(!_0x214b22)return null;return{'segmentId':_0x218e33,'segment':_0x214b22};},0xa),_0x5de573=new Set();for(const _0x2da804 of _0x451c67){if(!_0x2da804?.[_0x3ed6cb(0x165)]?.[_0x3ed6cb(0xfb)])continue;const _0x1ddb75=apiRuleToYaml(_0x2da804['segment'][_0x3ed6cb(0xfb)]);_0x587c2e['set'](_0x2da804[_0x3ed6cb(0xcf)],_0x1ddb75);const _0x3f5f7a=collectSegmentRefsFromRule(_0x1ddb75);for(const _0x3a36ce of _0x3f5f7a){!_0x3bccdd['has'](_0x3a36ce)&&_0x5de573[_0x3ed6cb(0xd5)](_0x3a36ce);}}_0x572d00=Array[_0x3ed6cb(0x15c)](_0x5de573);}};return{'createYamlContext':_0x4af5c6,'prefetchJourneySegments':_0x19618c};}export async function executePushSegments(_0x44007d,_0x7ce3ec,_0x314994,_0x38705a,_0x23c2d4){const _0x969212=a172_0x504867,{segmentDefToCreateRequest:_0xa9512a,segmentDefToUpdateRequest:_0x28a95e}=await import('./child-segment-yaml.js'),_0xefbc35=_0x314994[_0x969212(0x12a)],_0x434e43=0x5,_0x255a63=async _0x53ff1b=>{const _0x397971=_0x969212,_0x14c292=_0x53ff1b[_0x397971(0xe2)]?_0xefbc35[_0x397971(0x153)](_0x53ff1b['folderPath']):undefined;let _0x5b627c;const _0xe5b64e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x14047b=_0x53ff1b[_0x397971(0xa8)];if(_0x53ff1b['yamlConfig'][_0x397971(0xfb)]){const _0x51f21e=createSegmentIdResolver(_0x314994['segmentNameToId'],_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]),_0x5635fc=await resolveRuleSegmentIds(_0x53ff1b[_0x397971(0xa8)][_0x397971(0xfb)],_0x51f21e);_0x14047b={..._0x53ff1b[_0x397971(0xa8)],'rule':_0x5635fc};}try{if(_0x53ff1b[_0x397971(0xbf)]){_0x23c2d4[_0x397971(0xed)]?.({'type':_0x397971(0x10c),'name':_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]});const _0x561722=_0xa9512a(_0x14047b,_0x14c292),_0x5ea569=await _0x23c2d4[_0x397971(0xee)](_0x397971(0x85)+_0x53ff1b[_0x397971(0xa8)]['name']+'\x27...',()=>_0x44007d['segment'][_0x397971(0xa3)](_0x38705a[_0x397971(0x107)],_0x561722));_0x5b627c=_0x5ea569[_0x397971(0xd1)]['id'],_0x314994[_0x397971(0xf7)][_0x397971(0x129)](_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)],_0x5b627c),_0xe5b64e[_0x397971(0x76)]={'name':_0x53ff1b[_0x397971(0xa8)]['name'],'id':_0x5b627c},_0x23c2d4[_0x397971(0xed)]?.({'type':_0x397971(0x112),'name':_0x53ff1b['yamlConfig'][_0x397971(0xa2)],'segmentId':_0x5b627c}),_0x23c2d4[_0x397971(0x138)]?.(_0x397971(0x15e)+_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]+'\x27'),_0xe5b64e['created']=0x1;}else{if(_0x53ff1b[_0x397971(0xa4)]){_0x23c2d4['onProgress']?.({'type':_0x397971(0xf4),'name':_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]});const _0x528b17=_0x28a95e(_0x14047b);_0x14c292!==_0x53ff1b[_0x397971(0x74)]?.[_0x397971(0x143)]&&(_0x528b17[_0x397971(0x143)]=_0x14c292?parseInt(_0x14c292,0xa):undefined),await _0x23c2d4[_0x397971(0xee)](_0x397971(0xc7)+_0x53ff1b[_0x397971(0xa8)]['name']+_0x397971(0x126),()=>_0x44007d[_0x397971(0x165)][_0x397971(0x73)](_0x38705a[_0x397971(0x107)],_0x53ff1b[_0x397971(0x74)]['id'],_0x528b17)),_0x5b627c=_0x53ff1b[_0x397971(0x74)]['id'],_0x23c2d4[_0x397971(0xed)]?.({'type':'segment_updated','name':_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]}),_0x23c2d4['logSuccess']?.(_0x397971(0x7a)+_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]+'\x27'),_0xe5b64e['updated']=0x1;}else _0x5b627c=_0x53ff1b['existingSegment']['id'];}}catch(_0x5b88c0){const _0x42808f=isHttp400Error(_0x5b88c0),_0x14a491=_0x42808f?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x5a7877=getErrorMessage(_0x5b88c0);throw new SDKError(_0x14a491,_0x397971(0xa6)+(_0x53ff1b[_0x397971(0xbf)]?_0x397971(0x108):_0x397971(0xc3))+_0x397971(0x12c)+_0x53ff1b['absolutePath']+_0x397971(0x121)+_0x5a7877,_0x5b88c0);}try{const _0x4166f2=await syncActivationsForSegment(_0x44007d,_0x38705a[_0x397971(0x107)],_0x5b627c,_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)],_0x53ff1b['activationActions'],_0x23c2d4,_0x53ff1b['absolutePath']);_0xe5b64e[_0x397971(0xd2)]=_0x4166f2;}catch(_0x55a41a){if(_0x55a41a instanceof SDKError)throw _0x55a41a;throw new SDKError(ErrorCode[_0x397971(0xc5)],_0x397971(0x157)+_0x53ff1b[_0x397971(0xa8)]['name']+'\x27\x20from\x20file:\x20'+_0x53ff1b[_0x397971(0x71)]+_0x397971(0x121)+getErrorMessage(_0x55a41a),_0x55a41a);}return _0xe5b64e;},_0x562f1f=await batchAsync(_0x7ce3ec,_0x255a63,_0x434e43),_0xfb7c3c={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4ab08c of _0x562f1f){_0xfb7c3c[_0x969212(0x14f)]+=_0x4ab08c[_0x969212(0x14f)],_0xfb7c3c[_0x969212(0x72)]+=_0x4ab08c[_0x969212(0x72)],_0x4ab08c[_0x969212(0x76)]&&_0xfb7c3c[_0x969212(0x7f)][_0x969212(0x129)](_0x4ab08c[_0x969212(0x76)]['name'],_0x4ab08c[_0x969212(0x76)]['id']),_0xfb7c3c['activations']['created']+=_0x4ab08c[_0x969212(0xd2)][_0x969212(0x14f)],_0xfb7c3c[_0x969212(0xd2)]['updated']+=_0x4ab08c['activations'][_0x969212(0x72)],_0xfb7c3c[_0x969212(0xd2)][_0x969212(0xad)]+=_0x4ab08c['activations'][_0x969212(0xad)];}return _0xfb7c3c;}async function syncActivationsForSegment(_0x5a286c,_0x512859,_0x117c94,_0x5f0bdb,_0x2da01e,_0xcced39,_0x2ec826){const _0x50ee64=a172_0x504867,_0x380ab8={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3b30dd of _0x2da01e){try{if(_0x3b30dd[_0x50ee64(0xdd)]===_0x50ee64(0x108)&&_0x3b30dd[_0x50ee64(0xf6)])_0xcced39['onProgress']?.({'type':_0x50ee64(0x13d),'segmentName':_0x5f0bdb,'activationName':_0x3b30dd[_0x50ee64(0xa2)]}),await _0xcced39[_0x50ee64(0xee)](_0x50ee64(0x12e)+_0x3b30dd['name']+_0x50ee64(0x126),()=>_0x5a286c[_0x50ee64(0x165)][_0x50ee64(0xc2)](_0x512859,_0x117c94,_0x3b30dd[_0x50ee64(0xf6)])),_0xcced39[_0x50ee64(0xed)]?.({'type':_0x50ee64(0x137),'segmentName':_0x5f0bdb,'activationName':_0x3b30dd[_0x50ee64(0xa2)]}),_0xcced39[_0x50ee64(0x138)]?.(_0x50ee64(0xde)+_0x3b30dd['name']+'\x27'),_0x380ab8['created']++;else{if(_0x3b30dd[_0x50ee64(0xdd)]===_0x50ee64(0xc3)&&_0x3b30dd[_0x50ee64(0xf6)]&&_0x3b30dd[_0x50ee64(0x88)])_0xcced39['onProgress']?.({'type':_0x50ee64(0xcd),'segmentName':_0x5f0bdb,'activationName':_0x3b30dd[_0x50ee64(0xa2)]}),await _0xcced39[_0x50ee64(0xee)]('Updating\x20activation\x20\x27'+_0x3b30dd[_0x50ee64(0xa2)]+_0x50ee64(0x126),()=>_0x5a286c[_0x50ee64(0x165)]['updateActivation'](_0x512859,_0x117c94,_0x3b30dd[_0x50ee64(0x88)]['id'],_0x3b30dd[_0x50ee64(0xf6)])),_0xcced39['onProgress']?.({'type':_0x50ee64(0x139),'segmentName':_0x5f0bdb,'activationName':_0x3b30dd['name']}),_0xcced39[_0x50ee64(0x138)]?.(_0x50ee64(0x10a)+_0x3b30dd['name']+'\x27'),_0x380ab8[_0x50ee64(0x72)]++;else _0x3b30dd[_0x50ee64(0xdd)]===_0x50ee64(0xc8)&&_0x3b30dd[_0x50ee64(0x88)]&&(_0xcced39['onProgress']?.({'type':'activation_deleting','segmentName':_0x5f0bdb,'activationName':_0x3b30dd[_0x50ee64(0xa2)]}),await _0xcced39[_0x50ee64(0xee)](_0x50ee64(0xa1)+_0x3b30dd[_0x50ee64(0xa2)]+'\x27...',()=>_0x5a286c[_0x50ee64(0x165)]['deleteActivation'](_0x512859,_0x117c94,_0x3b30dd['existingActivation']['id'])),_0xcced39[_0x50ee64(0xed)]?.({'type':_0x50ee64(0x12b),'segmentName':_0x5f0bdb,'activationName':_0x3b30dd[_0x50ee64(0xa2)]}),_0xcced39['logDeleted']?.(_0x50ee64(0xb0)+_0x3b30dd[_0x50ee64(0xa2)]+'\x27'),_0x380ab8[_0x50ee64(0xad)]++);}}catch(_0x588047){const _0x5c4ff6=isHttp400Error(_0x588047),_0x16873e=_0x5c4ff6?ErrorCode[_0x50ee64(0x123)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x3ddbd3=getErrorMessage(_0x588047);throw new SDKError(_0x16873e,_0x50ee64(0xa6)+_0x3b30dd[_0x50ee64(0xdd)]+'\x20activation\x20\x27'+_0x3b30dd['name']+'\x27\x20from\x20file:\x20'+_0x2ec826+_0x50ee64(0x121)+_0x3ddbd3,_0x588047);}}return _0x380ab8;}export async function executePushFolders(_0x3763a1,_0xa3779d,_0x2818db,_0x2e916d,_0x5e35b8){const _0x490bef=a172_0x504867,_0x564fb4=new Map(_0x2818db),_0x457812=sortFoldersByDepth(_0xa3779d);for(const _0x4e8b07 of _0x457812){const _0x5d4514=_0x4e8b07['split']('/'),_0x209f39=_0x5d4514[_0x5d4514['length']-0x1],_0x2a09ad=_0x5d4514[_0x490bef(0x91)](0x0,-0x1)[_0x490bef(0x101)]('/'),_0x426037=_0x564fb4[_0x490bef(0x153)](_0x2a09ad);_0x5e35b8[_0x490bef(0xed)]?.({'type':'folder_creating','folder':_0x4e8b07});const _0x19fa7e={'name':_0x209f39,'parentFolderId':_0x426037},_0x1a6371=await _0x5e35b8[_0x490bef(0xee)](_0x490bef(0x79)+_0x4e8b07+'\x27...',()=>_0x3763a1[_0x490bef(0x165)]['createFolder'](_0x2e916d[_0x490bef(0x107)],_0x19fa7e));_0x564fb4[_0x490bef(0x129)](_0x4e8b07,_0x1a6371[_0x490bef(0xd1)]['id']),_0x5e35b8['onProgress']?.({'type':_0x490bef(0x10d),'folder':_0x4e8b07,'folderId':_0x1a6371[_0x490bef(0xd1)]['id']}),_0x5e35b8[_0x490bef(0x9a)]?.(_0x490bef(0x11f)+_0x4e8b07+'\x27');}return _0x564fb4;}export async function executePushSegmentDeletions(_0x5b40ac,_0x1d1104,_0x5a69b7){const _0x2f9f26=a172_0x504867;if(_0x1d1104[_0x2f9f26(0xdc)]===0x0)return 0x0;const {batchAsync:_0x599a9e}=await import(_0x2f9f26(0x140)),_0x3f14b2=0x5,_0xd1f1de=await _0x599a9e(_0x1d1104,async _0x287af7=>{const _0x234542=_0x2f9f26;return _0x5a69b7[_0x234542(0xed)]?.({'type':'segment_deleting','name':_0x287af7[_0x234542(0xa2)]}),await _0x5b40ac[_0x234542(0x165)]['deleteSegment'](_0x287af7['id']),_0x5a69b7['onProgress']?.({'type':'segment_deleted','name':_0x287af7['name']}),_0x5a69b7[_0x234542(0x113)]?.(_0x234542(0xfc)+_0x287af7['name']+'\x27'),0x1;},_0x3f14b2);return _0xd1f1de[_0x2f9f26(0xd0)]((_0x27a80f,_0x2d86e1)=>_0x27a80f+_0x2d86e1,0x0);}export async function executePushJourneys(_0x269988,_0x38cc69,_0x18b95b,_0x372651,_0x384da7){const _0x3d5404=a172_0x504867,{journeyDefToRequest:_0x1846b9}=await import(_0x3d5404(0xc4)),{activationDefToCreateRequest:_0x2678e1,yamlRuleToApi:_0x4962b2,validateSegmentRule:_0x3a021b}=await import('./child-segment-yaml.js'),_0x46f4e3={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x597da1=new Map(_0x18b95b[_0x3d5404(0xf7)]),_0x32de44=0x5;for(let _0x4a934a=0x0;_0x4a934a<_0x38cc69['length'];_0x4a934a+=_0x32de44){const _0x4b186e=_0x38cc69[_0x3d5404(0x91)](_0x4a934a,_0x4a934a+_0x32de44),_0x237e59=await Promise[_0x3d5404(0x75)](_0x4b186e[_0x3d5404(0xfd)](async _0x14d914=>{const _0x902f9=_0x3d5404;if(!_0x14d914[_0x902f9(0xbf)]&&!_0x14d914[_0x902f9(0xa4)])return{'action':'unchanged','name':_0x14d914[_0x902f9(0xa8)][_0x902f9(0xa2)],'journeyId':_0x14d914['existingJourney']?.['id']};const _0x2ced70=_0x14d914['folderPath']?_0x18b95b[_0x902f9(0x12a)][_0x902f9(0x153)](_0x14d914[_0x902f9(0xe2)]):undefined;_0x384da7['onProgress']?.({'type':_0x14d914['isNew']?_0x902f9(0xf3):'journey_updating','name':_0x14d914[_0x902f9(0xa8)][_0x902f9(0xa2)]});try{const _0x35a13d=await executeSingleJourneyPush(_0x269988,_0x14d914,{..._0x18b95b,'segmentNameToId':_0x597da1},{'parentId':_0x372651['parentId'],'rootFolderId':_0x372651[_0x902f9(0x132)],'folderId':_0x2ced70,'verbose':_0x372651['verbose']},_0x384da7,{'journeyDefToRequest':_0x1846b9,'activationDefToCreateRequest':_0x2678e1,'yamlRuleToApi':_0x4962b2,'validateSegmentRule':_0x3a021b});for(const [_0x569361,_0x1b355b]of _0x35a13d[_0x902f9(0xce)]){_0x597da1[_0x902f9(0x129)](_0x569361,_0x1b355b),_0x46f4e3['embeddedSegmentNameToId']['set'](_0x569361,_0x1b355b);}if(_0x35a13d[_0x902f9(0x94)]===_0x902f9(0x14f))_0x384da7[_0x902f9(0xed)]?.({'type':_0x902f9(0x8e),'name':_0x14d914['yamlConfig'][_0x902f9(0xa2)],'journeyId':_0x35a13d[_0x902f9(0x128)]}),_0x384da7[_0x902f9(0x138)]?.(_0x902f9(0xe3)+_0x14d914[_0x902f9(0xa8)]['name']+'\x27'),_0x46f4e3[_0x902f9(0x14f)]++;else _0x35a13d[_0x902f9(0x94)]===_0x902f9(0x72)&&(_0x384da7['onProgress']?.({'type':_0x902f9(0x11c),'name':_0x14d914[_0x902f9(0xa8)]['name']}),_0x384da7['logSuccess']?.(_0x902f9(0xa7)+_0x14d914[_0x902f9(0xa8)][_0x902f9(0xa2)]+'\x27'),_0x46f4e3[_0x902f9(0x72)]++);return{'action':_0x35a13d[_0x902f9(0x94)],'name':_0x14d914[_0x902f9(0xa8)][_0x902f9(0xa2)],'journeyId':_0x35a13d['journeyId']};}catch(_0x2d3864){const _0x40c9b5=isHttp400Error(_0x2d3864),_0x50b233=_0x40c9b5?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x2c3d92=getErrorMessage(_0x2d3864);throw new SDKError(_0x50b233,_0x902f9(0xa6)+(_0x14d914[_0x902f9(0xbf)]?_0x902f9(0x108):_0x902f9(0xc3))+'\x20journey\x20from\x20file:\x20'+_0x14d914[_0x902f9(0x71)]+_0x902f9(0x121)+_0x2c3d92,_0x2d3864);}}));_0x46f4e3[_0x3d5404(0x111)][_0x3d5404(0x142)](..._0x237e59);}return _0x46f4e3;}async function matchExistingJourneySegments(_0x487d39,_0x878f90,_0x3e4a95,_0x4d4874,_0x139bcd){const _0x4c1e1d=a172_0x504867;if(!_0x878f90['existingJourney']||!_0x878f90[_0x4c1e1d(0xa8)]['segments'])return;const _0x12d610=new Map(),_0x278957=new Set();for(const _0x57fcc5 of Object['keys'](_0x878f90[_0x4c1e1d(0xa8)][_0x4c1e1d(0x150)])){const _0x542adb=generateDeterministicJourneySegmentName(_0x878f90[_0x4c1e1d(0xa8)][_0x4c1e1d(0xa2)],_0x57fcc5);_0x12d610[_0x4c1e1d(0x129)](_0x542adb,_0x57fcc5),_0x278957['add'](_0x57fcc5);}const _0x23235b=[],_0x96210e=collectSegmentIdsFromJourneyApi(_0x878f90[_0x4c1e1d(0x100)]);for(const _0x354d8b of _0x96210e){const _0x5e85ee=await fetchSegment(_0x487d39,_0x3e4a95,_0x354d8b,_0x4d4874);if(!_0x5e85ee?.[_0x4c1e1d(0xa2)])continue;const _0x521a5e=_0x12d610['get'](_0x5e85ee[_0x4c1e1d(0xa2)]);_0x521a5e?(_0x139bcd[_0x4c1e1d(0x129)](_0x521a5e,_0x354d8b),_0x278957[_0x4c1e1d(0xc8)](_0x521a5e)):_0x23235b[_0x4c1e1d(0x142)]({'id':_0x354d8b,'seg':_0x5e85ee});}if(_0x278957['size']>0x0&&_0x23235b[_0x4c1e1d(0xdc)]>0x0){const {localExpandedRuleToNames:_0x1f520f}=buildLocalExpandedRuleMappings(_0x878f90[_0x4c1e1d(0xa8)]),_0x3dc3e4=new Map();for(const {id:_0x170857,seg:_0x14535a}of _0x23235b){if(_0x14535a[_0x4c1e1d(0xfb)]){const _0x354e89=apiRuleToYaml(_0x14535a[_0x4c1e1d(0xfb)]);_0x3dc3e4[_0x4c1e1d(0x129)](_0x170857,_0x354e89);}}for(const {id:_0x2ea5aa,seg:_0x33a09d}of _0x23235b){if(!_0x33a09d[_0x4c1e1d(0xfb)])continue;const _0x2c0aae=_0x3dc3e4['get'](_0x2ea5aa);if(!_0x2c0aae)continue;const _0x51e218=serializeExpandedRule(_0x2c0aae,_0x3dc3e4),_0x4d3f89=_0x1f520f[_0x4c1e1d(0x153)](_0x51e218);if(_0x4d3f89){const _0x438482=_0x4d3f89[_0x4c1e1d(0x119)](_0x519e00=>_0x278957[_0x4c1e1d(0xff)](_0x519e00));_0x438482&&(_0x139bcd['set'](_0x438482,_0x2ea5aa),_0x278957[_0x4c1e1d(0xc8)](_0x438482),logger[_0x4c1e1d(0xd4)](_0x4c1e1d(0x96)+_0x33a09d[_0x4c1e1d(0xa2)]+_0x4c1e1d(0x7b)+_0x438482+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0xd6ee78,_0xc4bc65,_0x2ebb62,_0x59c191,_0x263e22,_0x23f29e){const _0x597bf1=a172_0x504867,{journeyDefToRequest:_0x76ba8b,activationDefToCreateRequest:_0x35e680,yamlRuleToApi:_0x13712b,validateSegmentRule:_0x5ca1d3}=_0x23f29e,_0x571d00=new Map(),_0x459f41=new Map();recoverSegmentIdsFromPushRecovery(_0xc4bc65,_0x571d00,_0x2ebb62[_0x597bf1(0xf7)]);const _0x2ffd6c=new Map(),_0x20195b=new Map(),_0x27c947=new Map();let _0x24c250;const _0x4c62f3=async()=>{const _0xbcd57=_0x597bf1;if(_0x24c250)return;_0x24c250=new Map();if(!_0xc4bc65['existingJourney'])return;const _0x38461e=await _0xd6ee78[_0xbcd57(0x82)]['listActivations'](_0xc4bc65[_0xbcd57(0x100)]['id']);for(const _0x3e46f3 of _0x38461e){const _0x55748e=journeyActivationStepToYaml(_0x3e46f3,_0x2ebb62['idToEmailMap'],_0x2ebb62['connectionIdToNameMap']),_0x897ad0=activationSignature(_0x55748e);!_0x24c250[_0xbcd57(0xff)](_0x897ad0)&&_0x24c250['set'](_0x897ad0,_0x3e46f3['id']),_0x55748e[_0xbcd57(0xa2)]&&_0x459f41[_0xbcd57(0x129)](_0x55748e[_0xbcd57(0xa2)],_0x3e46f3['id']);}};await matchExistingJourneySegments(_0xd6ee78,_0xc4bc65,_0x59c191[_0x597bf1(0x107)],_0x2ebb62['existingSegments'],_0x2ebb62[_0x597bf1(0xf7)]);const _0x303fad={'resolveSegmentId':async _0x3e22f1=>{const _0x43dd0c=_0x597bf1,_0x102ae8=_0x2ebb62['segmentNameToId'][_0x43dd0c(0x153)](_0x3e22f1);if(!_0x102ae8)throw new SDKError(ErrorCode[_0x43dd0c(0x110)],_0x43dd0c(0x135)+_0x3e22f1+_0x43dd0c(0xca)+_0xc4bc65[_0x43dd0c(0xa8)][_0x43dd0c(0xa2)]+')');return _0x102ae8;},'resolveEmbeddedSegmentId':async(_0x191f4d,_0x30193a)=>{const _0x11dc41=_0x597bf1,_0x1cd5f8=_0x2ebb62['segmentNameToId'][_0x11dc41(0x153)](_0x191f4d);if(_0x1cd5f8)return _0x1cd5f8;const _0x329903=_0x2ebb62[_0x11dc41(0x12d)][_0x11dc41(0x119)](_0x1135ea=>_0x1135ea['name']===_0x191f4d);if(_0x329903)return _0x2ebb62[_0x11dc41(0xf7)]['set'](_0x191f4d,_0x329903['id']),_0x329903['id'];if(_0xc4bc65['isNew']){const {stageName:_0x393a78,criteriaName:_0xd3ce5d}=findSegmentCriteriaLocation(_0xc4bc65[_0x11dc41(0xa8)],_0x191f4d);return _0x5ca1d3(_0x191f4d,_0x30193a[_0x11dc41(0xfb)]),_0x20195b['set'](_0x191f4d,{'definition':_0x30193a,'stageName':_0x393a78,'criteriaName':_0xd3ce5d}),createPendingSegmentId(_0x191f4d);}const _0x505a23=_0xc4bc65[_0x11dc41(0x100)]?.['id'];if(!_0x505a23)throw new SDKError(ErrorCode[_0x11dc41(0x90)],_0x11dc41(0xf2));const _0x3fe738=_0x2ffd6c[_0x11dc41(0x153)](_0x191f4d);if(_0x3fe738)return _0x3fe738;const _0x2f4cba=((async()=>{const _0x47ac4c=_0x11dc41;_0x5ca1d3(_0x191f4d,_0x30193a['rule']);const _0xf82742=generateDeterministicJourneySegmentName(_0xc4bc65[_0x47ac4c(0xa8)][_0x47ac4c(0xa2)],_0x191f4d),_0x120edd=_0x2ebb62['existingSegments'][_0x47ac4c(0x119)](_0x27a240=>_0x27a240[_0x47ac4c(0xa2)]===_0xf82742),_0x3c1678=createSegmentIdResolver(_0x2ebb62[_0x47ac4c(0xf7)],_0x191f4d),_0x38f09c=await resolveRuleSegmentIds(_0x30193a[_0x47ac4c(0xfb)],_0x3c1678);let _0x24607f;return _0x120edd?(await _0xd6ee78[_0x47ac4c(0x165)][_0x47ac4c(0x73)](_0x59c191[_0x47ac4c(0x107)],_0x120edd['id'],{'description':_0x30193a['description']||_0x47ac4c(0xf5)+_0x191f4d,'rule':_0x13712b(_0x38f09c),'countPopulation':!![]}),_0x24607f=_0x120edd['id'],saveSegmentToPushRecovery(_0xc4bc65[_0x47ac4c(0x71)],_0xc4bc65[_0x47ac4c(0xa8)][_0x47ac4c(0xa2)],_0x191f4d,{'segmentId':_0x24607f,'uniqueServerName':_0xf82742,'createdAt':new Date()['toISOString']()})):_0x24607f=await createOrRecoverEmbeddedSegment(_0xd6ee78,_0xc4bc65,{'localName':_0x191f4d,'uniqueSegmentName':_0xf82742,'description':_0x30193a[_0x47ac4c(0xfa)]||_0x47ac4c(0xf5)+_0x191f4d,'journeyId':_0x505a23,'resolvedRule':_0x38f09c,'parentId':_0x59c191['parentId'],'folderId':_0x59c191['rootFolderId']||''},_0x13712b),_0x2ebb62['segmentNameToId'][_0x47ac4c(0x129)](_0x191f4d,_0x24607f),_0x571d00[_0x47ac4c(0x129)](_0x191f4d,_0x24607f),_0x24607f;})());_0x2ffd6c['set'](_0x191f4d,_0x2f4cba);try{return await _0x2f4cba;}finally{_0x2ffd6c[_0x11dc41(0xc8)](_0x191f4d);}},'resolveActivationId':async _0x548306=>{const _0x2ba5a5=_0x597bf1,_0x29a20d=_0x459f41[_0x2ba5a5(0x153)](_0x548306);if(_0x29a20d)return _0x29a20d;if(_0xc4bc65[_0x2ba5a5(0x100)]){await _0x4c62f3();const _0x7b303d=_0x459f41[_0x2ba5a5(0x153)](_0x548306);if(_0x7b303d)return _0x7b303d;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x2ba5a5(0x13c)+_0x548306+_0x2ba5a5(0xca)+_0xc4bc65[_0x2ba5a5(0xa8)][_0x2ba5a5(0xa2)]+_0x2ba5a5(0x124)+_0x2ba5a5(0xb4));},'resolveEmbeddedActivationId':async(_0x24acb2,_0x5d911b)=>{const _0x442d54=_0x597bf1,_0x5f36e7=_0x459f41[_0x442d54(0x153)](_0x24acb2);if(_0x5f36e7)return _0x5f36e7;if(_0xc4bc65[_0x442d54(0xbf)])return _0x27c947[_0x442d54(0x129)](_0x24acb2,_0x5d911b),createPendingActivationId(_0x24acb2);if(_0xc4bc65[_0x442d54(0x100)]){await _0x4c62f3();const _0x5a8666=_0x459f41[_0x442d54(0x153)](_0x5d911b[_0x442d54(0xa2)]);if(_0x5a8666)return _0x459f41['set'](_0x24acb2,_0x5a8666),_0x5a8666;const _0x4f2ca0=activationSignature(_0x5d911b),_0x37fa38=_0x24c250?.['get'](_0x4f2ca0);if(_0x37fa38)return _0x459f41[_0x442d54(0x129)](_0x24acb2,_0x37fa38),_0x37fa38;const _0x3177f1=await _0x35e680(_0x5d911b,_0x2ebb62['activationContext']),_0x54f782={..._0x3177f1,..._0x5d911b['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x5d911b[_0x442d54(0x134)]}},_0x27369=await _0xd6ee78[_0x442d54(0x82)][_0x442d54(0xc2)](_0xc4bc65[_0x442d54(0x100)]['id'],_0x54f782);return _0x459f41[_0x442d54(0x129)](_0x24acb2,_0x27369['id']),_0x27369['id'];}throw new SDKError(ErrorCode[_0x442d54(0x90)],_0x442d54(0x115));},'resolveJourneyId':async _0x56527d=>{const _0xf00cd4=_0x597bf1;try{return await _0xd6ee78[_0xf00cd4(0x82)][_0xf00cd4(0x86)](_0x59c191[_0xf00cd4(0x107)],_0x56527d);}catch(_0x1b6a14){throw new SDKError(ErrorCode[_0xf00cd4(0x103)],_0xf00cd4(0x12f)+_0x56527d+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0xc4bc65[_0xf00cd4(0xa8)][_0xf00cd4(0xa2)]+'\x27)',_0x1b6a14);}},'resolveStageId':async(_0xf30d4f,_0x535de6)=>{const _0x342159=_0x597bf1,_0x2bd85a=await _0xd6ee78[_0x342159(0x82)][_0x342159(0x120)](_0xf30d4f),_0x5e4bd4=_0x2bd85a[_0x342159(0x9f)][_0x342159(0x14e)][_0x342159(0x119)](_0x40ea8d=>_0x40ea8d[_0x342159(0xa2)][_0x342159(0x8d)]()===_0x535de6[_0x342159(0x8d)]());if(!_0x5e4bd4?.['id'])throw new SDKError(ErrorCode[_0x342159(0x103)],_0x342159(0x80)+_0x535de6+_0x342159(0xa0)+(_0x2bd85a[_0x342159(0x9f)][_0x342159(0x15d)]||_0x2bd85a[_0x342159(0x9f)]['name'])+'\x27');return _0x5e4bd4['id'];}},_0xf7a7c1=await _0x76ba8b(_0xc4bc65[_0x597bf1(0xa8)],_0x59c191[_0x597bf1(0x107)],_0x303fad),_0x1fd85f=_0x59c191['folderId']||_0x59c191[_0x597bf1(0x132)];_0x1fd85f&&(_0xf7a7c1[_0x597bf1(0x81)]={'parentFolder':{'data':{'id':_0x1fd85f,'type':_0x597bf1(0x9b)}}});if(_0xc4bc65[_0x597bf1(0xbf)]){if(_0x20195b[_0x597bf1(0xe4)]>0x0||_0x27c947['size']>0x0)return await executeThreeStepJourneyCreate(_0xd6ee78,_0xc4bc65,_0xf7a7c1,{'pendingEmbeddedSegments':_0x20195b,'pendingEmbeddedActivations':_0x27c947,'embeddedSegmentNameToId':_0x571d00,'journeyActivationNameToId':_0x459f41},{..._0x59c191,'effectiveFolderId':_0x1fd85f},_0x2ebb62,_0x263e22,_0x23f29e);else{ensureJourneyDefaults(_0xf7a7c1[_0x597bf1(0x9f)]);const _0x2ff468=await _0xd6ee78[_0x597bf1(0x82)][_0x597bf1(0x108)](_0xf7a7c1);return deletePushRecovery(_0xc4bc65['absolutePath']),{'action':_0x597bf1(0x14f),'journeyId':_0x2ff468['id'],'embeddedSegmentNameToId':_0x571d00};}}else{if(_0xc4bc65[_0x597bf1(0xa4)]&&_0xc4bc65[_0x597bf1(0x100)]){_0xf7a7c1['id']=_0xc4bc65[_0x597bf1(0x100)]['id'];const _0x97b3ee=_0xf7a7c1[_0x597bf1(0x9f)];_0xc4bc65[_0x597bf1(0x100)][_0x597bf1(0x9f)]?.[_0x597bf1(0x15d)]&&(_0x97b3ee[_0x597bf1(0x15d)]=_0xc4bc65['existingJourney']['attributes'][_0x597bf1(0x15d)]);const _0x27b823=_0xc4bc65[_0x597bf1(0x100)][_0x597bf1(0x9f)]?.[_0x597bf1(0x14e)];return _0x27b823&&_0xf7a7c1[_0x597bf1(0x9f)]['journeyStages']&&injectExistingStageIds(_0xf7a7c1[_0x597bf1(0x9f)][_0x597bf1(0x14e)],_0x27b823),ensureJourneyDefaults(_0x97b3ee),await _0xd6ee78[_0x597bf1(0x82)][_0x597bf1(0xc3)](_0xc4bc65[_0x597bf1(0x100)]['id'],_0xf7a7c1),deletePushRecovery(_0xc4bc65[_0x597bf1(0x71)]),{'action':_0x597bf1(0x72),'journeyId':_0xc4bc65[_0x597bf1(0x100)]['id'],'embeddedSegmentNameToId':_0x571d00};}}return deletePushRecovery(_0xc4bc65[_0x597bf1(0x71)]),{'action':'unchanged','journeyId':_0xc4bc65[_0x597bf1(0x100)]?.['id'],'embeddedSegmentNameToId':_0x571d00};}function findSegmentCriteriaLocation(_0x480f13,_0x59d338){const _0x40a5f0=a172_0x504867,_0x4f8d82=_0x480f13['stages']||_0x480f13['journeys']?.[0x0]?.['stages']||[];let _0xdbf25f=_0x40a5f0(0x152),_0x5b2eef=_0x59d338;const _0x1b8ad7=_0x480f13[_0x40a5f0(0x11e)]||_0x480f13[_0x40a5f0(0x156)]?.[0x0]?.[_0x40a5f0(0x11e)];if(_0x1b8ad7?.[_0x40a5f0(0x165)]===_0x59d338)return{'stageName':'goal','criteriaName':_0x1b8ad7[_0x40a5f0(0xa2)]||_0x59d338};_0x46d080:for(const _0x36d58c of _0x4f8d82){if(_0x36d58c[_0x40a5f0(0xba)]?.['segment']===_0x59d338){_0xdbf25f=_0x36d58c[_0x40a5f0(0xa2)],_0x5b2eef=_0x36d58c['entry_criteria']['name']||_0x59d338;break;}if(_0x36d58c[_0x40a5f0(0x160)])for(const _0x276d15 of _0x36d58c[_0x40a5f0(0x160)]){if(_0x276d15['type']==='decision_point'&&_0x276d15[_0x40a5f0(0xe8)]?.['branches'])for(const _0x42a973 of _0x276d15[_0x40a5f0(0xe8)][_0x40a5f0(0x118)]){if(_0x42a973[_0x40a5f0(0x165)]===_0x59d338){_0xdbf25f=_0x36d58c['name'],_0x5b2eef=_0x42a973['name']||_0x59d338;break _0x46d080;}}}}return{'stageName':_0xdbf25f,'criteriaName':_0x5b2eef};}async function executeThreeStepJourneyCreate(_0x46ada0,_0x312d2f,_0x59455c,_0x2cec98,_0x101039,_0x2a50d4,_0x5567e3,_0x2df378){const _0x13dfcc=a172_0x504867,{activationDefToCreateRequest:_0x36cf40,yamlRuleToApi:_0x92800f}=_0x2df378,{pendingEmbeddedSegments:_0xeaafd0,pendingEmbeddedActivations:_0x45cbd8,embeddedSegmentNameToId:_0x544100}=_0x2cec98,_0x3fec90=JSON[_0x13dfcc(0x92)](JSON[_0x13dfcc(0x13b)](_0x59455c));ensureJourneyDefaults(_0x3fec90[_0x13dfcc(0x9f)]),stripPendingIds(_0x3fec90);const _0xff7a25=await _0x46ada0[_0x13dfcc(0x82)]['create'](_0x3fec90),_0x61edb0=_0xff7a25['id'],_0x3a705b=new Map();for(const _0x1f63a4 of _0xff7a25[_0x13dfcc(0x9f)]['journeyStages']){_0x3a705b[_0x13dfcc(0x129)](_0x1f63a4[_0x13dfcc(0xa2)]['toLowerCase'](),_0x1f63a4['id']);}recoverSegmentIdsFromPushRecovery(_0x312d2f,_0x544100,_0x2a50d4[_0x13dfcc(0xf7)]);for(const [_0x365493,{definition:_0x2a8740}]of _0xeaafd0){if(_0x544100[_0x13dfcc(0xff)](_0x365493)){_0x5567e3[_0x13dfcc(0xed)]?.({'type':_0x13dfcc(0x6d),'journeyName':_0x312d2f[_0x13dfcc(0xa8)]['name'],'segmentName':_0x365493});continue;}const _0x1ecc88=generateDeterministicJourneySegmentName(_0x312d2f['yamlConfig']['name'],_0x365493);_0x5567e3[_0x13dfcc(0xed)]?.({'type':_0x13dfcc(0xb7),'journeyName':_0x312d2f['yamlConfig'][_0x13dfcc(0xa2)],'segmentName':_0x365493});const _0x415ded=createSegmentIdResolver(_0x2a50d4[_0x13dfcc(0xf7)],_0x365493),_0x4f76ab=await resolveRuleSegmentIds(_0x2a8740[_0x13dfcc(0xfb)],_0x415ded),_0x18004b=await createOrRecoverEmbeddedSegment(_0x46ada0,_0x312d2f,{'localName':_0x365493,'uniqueSegmentName':_0x1ecc88,'description':_0x2a8740['description']||_0x13dfcc(0xf5)+_0x365493,'journeyId':_0x61edb0,'resolvedRule':_0x4f76ab,'parentId':_0x101039[_0x13dfcc(0x107)],'folderId':_0x101039[_0x13dfcc(0xae)]||''},_0x92800f);_0x544100[_0x13dfcc(0x129)](_0x365493,_0x18004b),_0x2a50d4['segmentNameToId'][_0x13dfcc(0x129)](_0x365493,_0x18004b),_0x5567e3[_0x13dfcc(0xed)]?.({'type':_0x13dfcc(0x6d),'journeyName':_0x312d2f[_0x13dfcc(0xa8)][_0x13dfcc(0xa2)],'segmentName':_0x365493});}const _0x3acb78=new Map();for(const [_0x25cce3,_0x1d448e]of _0x45cbd8){_0x5567e3[_0x13dfcc(0xed)]?.({'type':_0x13dfcc(0x7c),'journeyName':_0x312d2f['yamlConfig'][_0x13dfcc(0xa2)],'activationName':_0x25cce3});const _0x39d85d=await _0x36cf40(_0x1d448e,_0x2a50d4['activationContext']),_0x53d2de={..._0x39d85d,..._0x1d448e[_0x13dfcc(0x134)]!==undefined&&{'runAfterJourneyRefresh':_0x1d448e[_0x13dfcc(0x134)]}},_0x6d469d=await _0x46ada0[_0x13dfcc(0x82)][_0x13dfcc(0xc2)](_0x61edb0,_0x53d2de);_0x3acb78[_0x13dfcc(0x129)](_0x25cce3,_0x6d469d['id']),_0x2cec98[_0x13dfcc(0x130)]['set'](_0x25cce3,_0x6d469d['id']),_0x5567e3[_0x13dfcc(0xed)]?.({'type':_0x13dfcc(0x84),'journeyName':_0x312d2f[_0x13dfcc(0xa8)][_0x13dfcc(0xa2)],'activationName':_0x25cce3});}const _0x127a0c=JSON[_0x13dfcc(0x92)](JSON[_0x13dfcc(0x13b)](_0x59455c));return _0x127a0c['id']=_0x61edb0,ensureJourneyDefaults(_0x127a0c[_0x13dfcc(0x9f)]),resolvePendingIdsInRequest(_0x127a0c,_0x59455c,_0x3a705b,_0x544100,_0x3acb78,_0x5567e3),await _0x46ada0[_0x13dfcc(0x82)][_0x13dfcc(0xc3)](_0x61edb0,_0x127a0c),deletePushRecovery(_0x312d2f[_0x13dfcc(0x71)]),{'action':'created','journeyId':_0x61edb0,'embeddedSegmentNameToId':_0x544100};}export function stripWaitStepPendingIds(_0x5e0086){const _0x4d2b13=a172_0x504867,_0x29705c=_0x5e0086[_0x4d2b13(0x93)]&&isPendingSegmentId(_0x5e0086[_0x4d2b13(0x93)]),_0x4d9bd6=_0x5e0086['conditions']?.[_0x4d2b13(0x13a)](_0x2aeb73=>_0x2aeb73[_0x4d2b13(0xcf)]&&isPendingSegmentId(_0x2aeb73[_0x4d2b13(0xcf)]));(_0x29705c||_0x4d9bd6)&&(_0x5e0086[_0x4d2b13(0x8a)]=_0x4d2b13(0xe1),_0x5e0086['waitStep']=0x1,_0x5e0086['waitStepUnit']=_0x4d2b13(0xd6),delete _0x5e0086[_0x4d2b13(0x93)],delete _0x5e0086[_0x4d2b13(0x11d)],delete _0x5e0086[_0x4d2b13(0xd3)],delete _0x5e0086[_0x4d2b13(0x6a)]);}export function resolveWaitStepPendingIds(_0x948418,_0x5e2d91,_0x428a2a,_0x43d8d4){const _0x171891=a172_0x504867;if(_0x5e2d91[_0x171891(0x93)]&&isPendingSegmentId(_0x5e2d91[_0x171891(0x93)])){const _0x3abb60=_0x428a2a(_0x5e2d91[_0x171891(0x93)],_0x171891(0xf0)+_0x43d8d4+_0x171891(0x14d));_0x3abb60&&(_0x948418[_0x171891(0x8a)]=_0x171891(0x98),_0x948418[_0x171891(0x93)]=_0x3abb60,delete _0x948418[_0x171891(0x164)],delete _0x948418['waitStepUnit'],_0x5e2d91['conditionTimeoutDuration']!==undefined&&(_0x948418[_0x171891(0x11d)]=_0x5e2d91[_0x171891(0x11d)]),_0x5e2d91[_0x171891(0xd3)]&&(_0x948418['conditionTimeoutUnit']=_0x5e2d91[_0x171891(0xd3)]));}if(_0x5e2d91[_0x171891(0x6a)]){const _0x37f9e7=_0x5e2d91[_0x171891(0x6a)][_0x171891(0x13a)](_0x5c3c8=>_0x5c3c8[_0x171891(0xcf)]&&isPendingSegmentId(_0x5c3c8['segmentId']));if(_0x37f9e7){const _0x57e892=_0x5e2d91['conditions']['map'](_0xf62320=>{const _0x5deec1=_0x171891;if(_0xf62320[_0x5deec1(0xcf)]&&isPendingSegmentId(_0xf62320['segmentId'])){const _0x5edcdd=_0x428a2a(_0xf62320[_0x5deec1(0xcf)],_0x5deec1(0xf0)+_0x43d8d4+'\x27\x20wait\x20condition');return{..._0xf62320,'segmentId':_0x5edcdd||_0xf62320[_0x5deec1(0xcf)]};}return{..._0xf62320};});_0x948418[_0x171891(0x8a)]=_0x171891(0x98),_0x948418[_0x171891(0x6a)]=_0x57e892,delete _0x948418[_0x171891(0x164)],delete _0x948418[_0x171891(0xe6)],delete _0x948418[_0x171891(0x93)],delete _0x948418[_0x171891(0x11d)],delete _0x948418[_0x171891(0xd3)];}}}function stripPendingIds(_0x5acaef){const _0x452fd5=a172_0x504867;_0x5acaef['attributes'][_0x452fd5(0x11e)]?.[_0x452fd5(0xcf)]&&isPendingSegmentId(_0x5acaef[_0x452fd5(0x9f)][_0x452fd5(0x11e)][_0x452fd5(0xcf)])&&delete _0x5acaef['attributes'][_0x452fd5(0x11e)];for(const _0x322c42 of _0x5acaef[_0x452fd5(0x9f)][_0x452fd5(0x14e)]||[]){_0x322c42[_0x452fd5(0x159)]?.[_0x452fd5(0xcf)]&&isPendingSegmentId(_0x322c42[_0x452fd5(0x159)][_0x452fd5(0xcf)])&&delete _0x322c42[_0x452fd5(0x159)];_0x322c42[_0x452fd5(0xb1)]?.[_0x452fd5(0xcf)]&&isPendingSegmentId(_0x322c42[_0x452fd5(0xb1)]['segmentId'])&&delete _0x322c42[_0x452fd5(0xb1)];_0x322c42['exitCriterias']&&(_0x322c42[_0x452fd5(0x11b)]=_0x322c42[_0x452fd5(0x11b)][_0x452fd5(0xa5)](_0x59ecf6=>!_0x59ecf6[_0x452fd5(0xcf)]||!isPendingSegmentId(_0x59ecf6[_0x452fd5(0xcf)])));if(_0x322c42['steps'])for(const _0x20ddd8 of Object[_0x452fd5(0xc9)](_0x322c42[_0x452fd5(0x160)])){const _0xe3d2f1=_0x322c42[_0x452fd5(0x160)][_0x20ddd8];_0xe3d2f1['type']===_0x452fd5(0x6b)&&_0xe3d2f1[_0x452fd5(0xdf)]&&isPendingActivationId(_0xe3d2f1[_0x452fd5(0xdf)])&&(_0xe3d2f1[_0x452fd5(0xdf)]='');if(_0xe3d2f1[_0x452fd5(0xdd)]===_0x452fd5(0xb9)&&_0xe3d2f1[_0x452fd5(0x118)])for(const _0x273973 of _0xe3d2f1['branches']){_0x273973[_0x452fd5(0xcf)]&&isPendingSegmentId(_0x273973[_0x452fd5(0xcf)])&&(_0x273973[_0x452fd5(0xcf)]='');}_0xe3d2f1[_0x452fd5(0xdd)]===_0x452fd5(0x6c)&&stripWaitStepPendingIds(_0xe3d2f1);}}}function resolvePendingIdsInRequest(_0x387eb6,_0x19fd14,_0x584bad,_0x57507a,_0x4dbdc0,_0x3b5253){const _0xe489dd=a172_0x504867,_0x55569c=(_0x4be93c,_0xadbe82)=>{const _0x327ddc=a172_0xbe52;if(!isPendingSegmentId(_0x4be93c))return _0x4be93c;const _0x49d852=extractPendingSegmentName(_0x4be93c),_0x4438de=_0x57507a[_0x327ddc(0x153)](_0x49d852);return!_0x4438de&&_0x3b5253[_0x327ddc(0x127)]?.(_0x327ddc(0x8b)+_0x49d852+_0x327ddc(0x13f)+_0xadbe82),_0x4438de;};if(_0x387eb6['attributes'][_0xe489dd(0x11e)]?.[_0xe489dd(0xcf)]&&isPendingSegmentId(_0x387eb6[_0xe489dd(0x9f)][_0xe489dd(0x11e)][_0xe489dd(0xcf)])){const _0x3814a3=_0x55569c(_0x387eb6[_0xe489dd(0x9f)][_0xe489dd(0x11e)][_0xe489dd(0xcf)],'goal\x20criteria');_0x3814a3&&(_0x387eb6[_0xe489dd(0x9f)][_0xe489dd(0x11e)][_0xe489dd(0xcf)]=_0x3814a3);}for(const _0x1f8b78 of _0x387eb6[_0xe489dd(0x9f)][_0xe489dd(0x14e)]||[]){const _0x142625=_0x584bad[_0xe489dd(0x153)](_0x1f8b78[_0xe489dd(0xa2)][_0xe489dd(0x8d)]());_0x142625&&(_0x1f8b78['id']=_0x142625);if(_0x1f8b78[_0xe489dd(0x159)]?.[_0xe489dd(0xcf)]&&isPendingSegmentId(_0x1f8b78['entryCriteria'][_0xe489dd(0xcf)])){const _0xc2664c=_0x55569c(_0x1f8b78[_0xe489dd(0x159)]['segmentId'],_0xe489dd(0xf0)+_0x1f8b78['name']+'\x27\x20entry\x20criteria');_0xc2664c&&(_0x1f8b78[_0xe489dd(0x159)][_0xe489dd(0xcf)]=_0xc2664c);}if(_0x1f8b78[_0xe489dd(0x11b)])for(const _0x19ae34 of _0x1f8b78[_0xe489dd(0x11b)]){if(_0x19ae34[_0xe489dd(0xcf)]&&isPendingSegmentId(_0x19ae34[_0xe489dd(0xcf)])){const _0x53e0d5=_0x55569c(_0x19ae34[_0xe489dd(0xcf)],_0xe489dd(0xf0)+_0x1f8b78[_0xe489dd(0xa2)]+'\x27\x20exit\x20criteria');_0x53e0d5&&(_0x19ae34['segmentId']=_0x53e0d5);}}if(_0x1f8b78['milestone']?.[_0xe489dd(0xcf)]&&isPendingSegmentId(_0x1f8b78[_0xe489dd(0xb1)][_0xe489dd(0xcf)])){const _0x1bc370=_0x55569c(_0x1f8b78['milestone'][_0xe489dd(0xcf)],_0xe489dd(0xf0)+_0x1f8b78[_0xe489dd(0xa2)]+_0xe489dd(0x8f));_0x1bc370&&(_0x1f8b78[_0xe489dd(0xb1)][_0xe489dd(0xcf)]=_0x1bc370);}if(_0x1f8b78[_0xe489dd(0x160)]){const _0x1e639c=_0x2caee1=>_0x19fd14[_0xe489dd(0x9f)][_0xe489dd(0x14e)]?.['find'](_0x429e17=>_0x429e17[_0xe489dd(0xa2)][_0xe489dd(0x8d)]()===_0x1f8b78['name'][_0xe489dd(0x8d)]())?.[_0xe489dd(0x160)]?.[_0x2caee1];for(const _0x4c27dd of Object[_0xe489dd(0xc9)](_0x1f8b78['steps'])){const _0x40a66b=_0x1f8b78[_0xe489dd(0x160)][_0x4c27dd],_0x95e223=_0x1e639c(_0x4c27dd);if(_0x40a66b[_0xe489dd(0xdd)]==='Activation'&&_0x40a66b['journeyActivationStepId']&&(isPendingActivationId(_0x40a66b[_0xe489dd(0xdf)])||_0x40a66b[_0xe489dd(0xdf)]==='')){if(_0x95e223?.['journeyActivationStepId']&&isPendingActivationId(_0x95e223[_0xe489dd(0xdf)])){const _0x29ae26=extractPendingActivationName(_0x95e223['journeyActivationStepId']),_0x4b92d7=_0x4dbdc0[_0xe489dd(0x153)](_0x29ae26);_0x4b92d7&&(_0x40a66b[_0xe489dd(0xdf)]=_0x4b92d7);}}if(_0x40a66b[_0xe489dd(0xdd)]===_0xe489dd(0xb9)&&_0x40a66b[_0xe489dd(0x118)]&&_0x95e223?.['branches'])for(let _0xa32952=0x0;_0xa32952<_0x40a66b[_0xe489dd(0x118)]['length'];_0xa32952++){const _0x37817d=_0x40a66b['branches'][_0xa32952],_0x5dad84=_0x95e223[_0xe489dd(0x118)][_0xa32952];if(_0x5dad84?.[_0xe489dd(0xcf)]&&isPendingSegmentId(_0x5dad84[_0xe489dd(0xcf)])){const _0x44d3ae=_0x55569c(_0x5dad84[_0xe489dd(0xcf)],_0xe489dd(0xf0)+_0x1f8b78[_0xe489dd(0xa2)]+_0xe489dd(0x7e)+(_0x37817d[_0xe489dd(0xa2)]||_0xa32952)+'\x27');_0x44d3ae&&(_0x37817d[_0xe489dd(0xcf)]=_0x44d3ae);}}_0x40a66b[_0xe489dd(0xdd)]===_0xe489dd(0x6c)&&_0x95e223?.['type']==='WaitStep'&&resolveWaitStepPendingIds(_0x40a66b,_0x95e223,_0x55569c,_0x1f8b78[_0xe489dd(0xa2)]);}}}}
|
|
1
|
+
const a174_0x32cc05=a174_0x1505;(function(_0x9d5f7f,_0x185a6e){const _0x54ad0b=a174_0x1505,_0x979c33=_0x9d5f7f();while(!![]){try{const _0x406374=-parseInt(_0x54ad0b(0x293))/0x1*(parseInt(_0x54ad0b(0x28d))/0x2)+-parseInt(_0x54ad0b(0x1cb))/0x3+parseInt(_0x54ad0b(0x211))/0x4*(-parseInt(_0x54ad0b(0x288))/0x5)+parseInt(_0x54ad0b(0x19b))/0x6*(-parseInt(_0x54ad0b(0x1c6))/0x7)+parseInt(_0x54ad0b(0x269))/0x8*(parseInt(_0x54ad0b(0x197))/0x9)+parseInt(_0x54ad0b(0x1a2))/0xa*(-parseInt(_0x54ad0b(0x284))/0xb)+-parseInt(_0x54ad0b(0x1a5))/0xc*(-parseInt(_0x54ad0b(0x1ad))/0xd);if(_0x406374===_0x185a6e)break;else _0x979c33['push'](_0x979c33['shift']());}catch(_0x1c7cf2){_0x979c33['push'](_0x979c33['shift']());}}}(a174_0x4452,0x4b638));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a174_0x32cc05(0x1d3));export const PENDING_SEGMENT_PREFIX=a174_0x32cc05(0x1fe);export const PENDING_ACTIVATION_PREFIX=a174_0x32cc05(0x1f6);export function createPendingSegmentId(_0x24288c){return''+PENDING_SEGMENT_PREFIX+_0x24288c+'__';}export function isPendingSegmentId(_0x41b2ab){const _0x2e31bf=a174_0x32cc05;return _0x41b2ab[_0x2e31bf(0x1fa)](PENDING_SEGMENT_PREFIX)&&!_0x41b2ab[_0x2e31bf(0x1fa)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1c2f3e){return _0x1c2f3e['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4c688b){return''+PENDING_ACTIVATION_PREFIX+_0x4c688b+'__';}export function isPendingActivationId(_0x4d91ee){const _0x3abca5=a174_0x32cc05;return _0x4d91ee[_0x3abca5(0x1fa)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x9ca93f){return _0x9ca93f['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3c6232,_0x466637){const _0x2fcdbb=a174_0x32cc05,_0x3f6b71=_0x3c6232+'::'+(_0x466637[_0x2fcdbb(0x227)]()||_0x2fcdbb(0x290)),_0x346e71=createHash(_0x2fcdbb(0x212))[_0x2fcdbb(0x27a)](_0x3f6b71)['digest'](_0x2fcdbb(0x1ee))[_0x2fcdbb(0x27f)](0x0,0xc);return _0x2fcdbb(0x263)+_0x346e71;}function a174_0x4452(){const _0x2129d2=['5fTyYrj','journey','goal\x20criteria','\x27\x20from\x20file:\x20','Embedded\x20segment\x20\x27','59776KZFgyz','segments','connectionIdToNameMap','segment','activation_deleted','existingSegments','18GWQUYh','existingSegment','journeyId','ACTIVATION_SYNTAX_ERROR','Updated\x20segment\x20\x27','columns','createActivation','created','schedule','utf-8','\x27\x20wait\x20condition','conditionTimeoutUnit','some','and\x20the\x20server\x20segment,\x20then\x20retry.','logInfo','journeyStages','updated','journeyName','18moCOdh','match','\x27\x20decision\x20point\x20branch\x20\x27','validatedRequest','369918YIWMgg','waitStep','embedded_segment_created','segment_created','SEGMENT_SYNTAX_ERROR','Failed\x20to\x20','Condition','10oVoUsr','max','\x20segment\x20from\x20file:\x20','261672eTfrIc','waitStepType','\x20journey\x20from\x20file:\x20','WaitStep','activationsBySegmentId','uniqueSegmentName','folderId','effectiveFolderId','949cGadRf','segment_updated','push','Journey\x20\x27','journeys','activations','all_columns','map','journeyById','journeyBundleId','stringify','activation_updating','JOURNEY_UPDATE_ERROR','relationships','name','object','activation_created','day','attributes','localName','behavior','SEGMENT_UPDATE_ERROR','onProgress','isArray','journeyActivationNameToId','35qHcsAL','length','yamlActivation','replace','createSegment','1141227JAvnHS','getSegment\x20failed\x20for\x20','message','journeyBundleName','logDeleted','folder','Failed\x20to\x20resolve\x20activation\x20','Creating\x20activation\x20\x27','tdx.sdk.push-workflow','keys','draft','deleted','\x27\x20entry\x20criteria','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','errors','goal','rootFolderId','parentFolder','sort','item','state','exitCriterias','description','delete',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','connection','Entry\x20criteria:\x20','parentId','toString','SEGMENT_NOT_FOUND','yamlConfig','flatMap','createdSegmentIds','NOT_FOUND','join','hex','user','updateSegmentById','set','valid','journeyBundlesByFolderAndName','Activation','from','__pending_act_','Updating\x20segment\x20\x27','reduce','resolvedRule','startsWith','existingJourney','run_after_journey_refresh','has','__pending_','embedded_activation_creating','segmentId','segmentFolderId','segmentByFolderAndName','resolveJourneyId','Created\x20folder\x20\x27','parentSegmentFolder','./child-segment-yaml.js','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','activation_','Segment\x20not\x20found:\x20','activation_template_id','getJourney','debug','Deleted\x20segment\x20\x27','deps','activation_deleting','kind','1958840WyZPNA','sha1','rule','getSegment','\x27\x20not\x20found\x20in\x20journey\x20\x27','all','conditions','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','fetchJourney','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Duration','index','verbose','Created\x20journey\x20\x27','embeddedSegmentNameToId','create','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','folder_created','data','createJourneySegment','type','segment_deleted','trim','createdSegmentId','embedded_activation_created','entry_criteria','journey_created','includes','nameToId','Failed\x20to\x20fetch\x20referenced\x20segment\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.',').\x20','entries','isNew','\x20activation\x20\x27','getSegmentEntity','behaviors','hasChanges','null','existingActivation','uniqueServerName','branches','getLatestJourneyId','Updating\x20activation\x20\x27','activationContext','Segment\x20not\x20found','Activation\x20not\x20found:\x20','listActivations','folderPathToId','\x27\x20to\x20local\x20\x27','waitStepUnit','withProgress','\x27...','journey_updated','createFolder','progress','stage\x20\x27','conditionTimeoutDuration','action','activationParams','../../utils/async.js','\x0a\x20\x20','\x27\x20by\x20rule\x20content','\x27\x20for\x20','versionNumber','toLowerCase','get','Delete\x20the\x20push\x20recovery\x20file\x20(','Fetching\x20','relative','find','unchanged','updateActivation','connector_config','parse','JOURNEY_SYNTAX_ERROR','Created\x20activation\x20\x27','folder_creating','):\x20','folderPath','ACTIVATION_UPDATE_ERROR','deleteSegment','journey_entry_criteria_','idToEmailMap','activationActions','./journey-yaml.js','conditionSegmentId','entryCriteria','2346608ULRhdh','Deleting\x20activation\x20\x27','filter','Created\x20segment\x20\x27','add','dirname','.$1.push-recovery.json','embedded_segment_creating','INTERNAL','logWarning','\x27\x20milestone','DecisionPoint','segmentNameToId','parseDocument','milestone','decision_point','\x20(referenced\x20in\x20journey\x20','update','journeyActivationStepId','activation_creating','Stage\x20\x27','absolutePath','slice','notification','segment_updating','steps','activation_updated','1686630ALthSI','size','logSuccess','segment_creating'];a174_0x4452=function(){return _0x2129d2;};return a174_0x4452();}export function ensureJourneyDefaults(_0x3843d5){const _0x4e3b88=a174_0x32cc05;!_0x3843d5[_0x4e3b88(0x1e1)]&&(_0x3843d5[_0x4e3b88(0x1e1)]=''),!_0x3843d5[_0x4e3b88(0x1df)]&&(_0x3843d5[_0x4e3b88(0x1df)]=_0x4e3b88(0x1d5));}export function injectExistingStageIds(_0x1e488d,_0x8bd298){const _0x1c2693=a174_0x32cc05,_0x1b14be=new Map(_0x8bd298['map'](_0xdd55c9=>[_0xdd55c9[_0x1c2693(0x1bb)],_0xdd55c9['id']]));for(const _0x63fd34 of _0x1e488d){if(!_0x63fd34['id']){const _0x5b13e7=_0x1b14be[_0x1c2693(0x253)](_0x63fd34['name']);_0x5b13e7&&(_0x63fd34['id']=_0x5b13e7);}}}export function resolveTDFolderPath(_0x46ac12,_0x3e0e33,_0x2d52de){const _0x3eac43=a174_0x32cc05;if(!_0x3e0e33)return _0x46ac12;if(_0x46ac12===_0x2d52de||_0x46ac12[_0x3eac43(0x1fa)](_0x2d52de+'/'))return _0x46ac12;return _0x46ac12?_0x2d52de+'/'+_0x46ac12:_0x2d52de;}export function addFoldersToCreate(_0x359272,_0x300f5a,_0x1f3760){const _0xb5957d=a174_0x32cc05;if(!_0x359272)return;if(_0x300f5a[_0xb5957d(0x1fd)](_0x359272))return;const _0x12936d=_0x359272['split']('/');let _0xeec98c='';for(const _0x2a9397 of _0x12936d){_0xeec98c=_0xeec98c?_0xeec98c+'/'+_0x2a9397:_0x2a9397,!_0x300f5a[_0xb5957d(0x1fd)](_0xeec98c)&&_0x1f3760[_0xb5957d(0x26d)](_0xeec98c);}}export function sortFoldersByDepth(_0x3fc69e){const _0x33f589=a174_0x32cc05;return[..._0x3fc69e][_0x33f589(0x1dd)]((_0x24b031,_0x35d2f3)=>{const _0x4e9101=_0x33f589,_0x504cdb=(_0x24b031[_0x4e9101(0x198)](/\//g)||[])['length'],_0x2052f7=(_0x35d2f3[_0x4e9101(0x198)](/\//g)||[])['length'];return _0x504cdb-_0x2052f7;});}import*as a174_0x454c22 from'yaml';import{readFileSync}from'fs';import a174_0x4d34ce from'path';import{isJourneyDef,parseYamlString as a174_0x236a99,toYamlString as a174_0x49ab5c,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(_0x5f20a9){const _0x379ddc=a174_0x32cc05;if(Array[_0x379ddc(0x1c4)](_0x5f20a9))return'['+_0x5f20a9[_0x379ddc(0x1b4)](_0x495680=>stableStringify(_0x495680))[_0x379ddc(0x1ed)](',')+']';if(_0x5f20a9&&typeof _0x5f20a9===_0x379ddc(0x1bc)){const _0x311035=_0x5f20a9,_0x56888e=Object[_0x379ddc(0x1d4)](_0x311035)[_0x379ddc(0x1dd)](),_0xa50f4b=_0x56888e[_0x379ddc(0x1b4)](_0x44e1d7=>'\x22'+_0x44e1d7+'\x22:'+stableStringify(_0x311035[_0x44e1d7]));return'{'+_0xa50f4b['join'](',')+'}';}const _0x523a87=JSON[_0x379ddc(0x1b7)](_0x5f20a9);return _0x523a87===undefined?_0x379ddc(0x237):_0x523a87;}function activationSignature(_0x4be2c2){const _0x58c04e=a174_0x32cc05,_0x4b6bbb={'connection':_0x4be2c2[_0x58c04e(0x1e4)],..._0x4be2c2[_0x58c04e(0x1b3)]!==undefined&&{'all_columns':_0x4be2c2[_0x58c04e(0x1b3)]},..._0x4be2c2[_0x58c04e(0x298)]!==undefined&&{'columns':_0x4be2c2[_0x58c04e(0x298)]},..._0x4be2c2[_0x58c04e(0x1c1)]!==undefined&&{'behavior':_0x4be2c2[_0x58c04e(0x1c1)]},..._0x4be2c2[_0x58c04e(0x235)]!==undefined&&{'behaviors':_0x4be2c2[_0x58c04e(0x235)]},..._0x4be2c2[_0x58c04e(0x18d)]!==undefined&&{'schedule':_0x4be2c2[_0x58c04e(0x18d)]},..._0x4be2c2[_0x58c04e(0x280)]!==undefined&&{'notification':_0x4be2c2[_0x58c04e(0x280)]},..._0x4be2c2[_0x58c04e(0x25a)]!==undefined&&{'connector_config':_0x4be2c2[_0x58c04e(0x25a)]},..._0x4be2c2['activation_template_id']!==undefined&&{'activation_template_id':_0x4be2c2[_0x58c04e(0x20a)]}};return stableStringify(_0x4b6bbb);}async function fetchSegment(_0xfc7167,_0x34541a,_0x338dc8,_0x4b5877){const _0x56f3fc=a174_0x32cc05,_0x45c5ea=_0x4b5877?.[_0x56f3fc(0x257)](_0x521cb3=>_0x521cb3['id']===_0x338dc8);if(_0x45c5ea)return _0x45c5ea;try{return await _0xfc7167[_0x56f3fc(0x290)][_0x56f3fc(0x214)](_0x34541a,_0x338dc8);}catch(_0x141399){logger[_0x56f3fc(0x20c)](_0x56f3fc(0x1cc)+_0x338dc8+_0x56f3fc(0x1e3)+_0x141399);try{return await _0xfc7167[_0x56f3fc(0x290)][_0x56f3fc(0x234)](_0x338dc8);}catch(_0x11b3e7){return logger[_0x56f3fc(0x20c)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x338dc8+':\x20'+_0x11b3e7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x439817,_0x102402,_0x306550){const _0x260893=a174_0x32cc05,_0x1f0956=readPushRecovery(_0x439817[_0x260893(0x27e)]);if(_0x1f0956?.[_0x260893(0x196)]===_0x439817[_0x260893(0x1e9)][_0x260893(0x1bb)])for(const [_0x26df06,_0x9ae7a]of Object[_0x260893(0x231)](_0x1f0956[_0x260893(0x28e)])){const _0x3853c0=generateDeterministicJourneySegmentName(_0x439817['yamlConfig']['name'],_0x26df06);_0x9ae7a[_0x260893(0x239)]===_0x3853c0&&(_0x102402[_0x260893(0x1f1)](_0x26df06,_0x9ae7a['segmentId']),_0x306550[_0x260893(0x1f1)](_0x26df06,_0x9ae7a[_0x260893(0x200)]));}}async function createOrRecoverEmbeddedSegment(_0x1c0646,_0x2e13f5,_0x218973,_0x3dc5bd){const _0x9a91f0=a174_0x32cc05;let _0x1e71e3;try{_0x1e71e3=await _0x1c0646[_0x9a91f0(0x290)][_0x9a91f0(0x224)]({'name':_0x218973[_0x9a91f0(0x1aa)],'description':_0x218973[_0x9a91f0(0x1e1)],'journeyId':_0x218973[_0x9a91f0(0x295)],'rule':_0x3dc5bd(_0x218973[_0x9a91f0(0x1f9)],!![]),'countPopulation':!![],'parentFolderId':_0x218973[_0x9a91f0(0x1ab)],'audienceId':_0x218973[_0x9a91f0(0x1e6)]});}catch(_0x333053){const _0x19ea04=_0x333053 instanceof Error&&_0x333053[_0x9a91f0(0x1cd)][_0x9a91f0(0x22c)]('Name\x20has\x20already\x20been\x20taken');if(_0x19ea04){const _0x180ff2=readPushRecovery(_0x2e13f5['absolutePath']),_0x3d011b=_0x180ff2?.[_0x9a91f0(0x196)]===_0x2e13f5[_0x9a91f0(0x1e9)]['name']?_0x180ff2[_0x9a91f0(0x28e)][_0x218973[_0x9a91f0(0x1c0)]]:undefined;if(_0x3d011b?.['uniqueServerName']===_0x218973[_0x9a91f0(0x1aa)])await _0x1c0646[_0x9a91f0(0x290)]['updateSegmentById'](_0x218973[_0x9a91f0(0x1e6)],_0x3d011b[_0x9a91f0(0x200)],{'description':_0x218973[_0x9a91f0(0x1e1)],'rule':_0x3dc5bd(_0x218973[_0x9a91f0(0x1f9)],!![]),'countPopulation':!![]}),_0x1e71e3=_0x3d011b[_0x9a91f0(0x200)];else throw new SDKError(ErrorCode[_0x9a91f0(0x1c2)],_0x9a91f0(0x28c)+_0x218973['localName']+_0x9a91f0(0x21a)+(_0x9a91f0(0x254)+_0x2e13f5[_0x9a91f0(0x27e)][_0x9a91f0(0x1c9)](/([^/]+)$/,_0x9a91f0(0x26f))+')\x20')+_0x9a91f0(0x192),_0x333053);}else throw _0x333053;}return saveSegmentToPushRecovery(_0x2e13f5[_0x9a91f0(0x27e)],_0x2e13f5[_0x9a91f0(0x1e9)][_0x9a91f0(0x1bb)],_0x218973['localName'],{'segmentId':_0x1e71e3,'uniqueServerName':_0x218973[_0x9a91f0(0x1aa)],'createdAt':new Date()['toISOString']()}),_0x1e71e3;}export async function prepareSegmentFiles(_0x3ae81c,_0x588e78,_0x221484,_0xd4f417,_0x5f2035){const _0x4d4263=a174_0x32cc05,{activationDefToCreateRequest:_0x2d132c}=await import(_0x4d4263(0x206)),_0x289fbd=[],_0x23b8de=new Set();for(const {yamlConfig:_0x29ac02,folderPath:_0x1587cd,sourcePath:_0x4429eb}of _0x3ae81c){const _0x5e306f=resolveTDFolderPath(_0x1587cd,_0xd4f417,_0x5f2035),_0x3ab8d0=_0x5e306f+':'+_0x29ac02[_0x4d4263(0x1bb)],_0x3b3aa0=_0x588e78[_0x4d4263(0x202)][_0x4d4263(0x253)](_0x3ab8d0),_0x3c5292=_0x3b3aa0?_0x588e78[_0x4d4263(0x1a9)][_0x4d4263(0x253)](_0x3b3aa0['id'])||[]:[];addFoldersToCreate(_0x5e306f,_0x588e78['folderPathToId'],_0x23b8de);const _0x4068c7=calculateActivationActions(_0x29ac02[_0x4d4263(0x1b2)]||[],_0x3c5292,_0x588e78[_0x4d4263(0x264)],_0x588e78[_0x4d4263(0x28f)]);for(const _0x5f1dc2 of _0x4068c7){(_0x5f1dc2[_0x4d4263(0x225)]===_0x4d4263(0x220)||_0x5f1dc2[_0x4d4263(0x225)]===_0x4d4263(0x27a))&&_0x5f1dc2[_0x4d4263(0x1c8)]&&(_0x5f1dc2['validatedRequest']=await _0x2d132c(_0x5f1dc2[_0x4d4263(0x1c8)],_0x221484));}const _0x13e682=calculateSegmentDiff(_0x29ac02,_0x3b3aa0,_0x3c5292,_0x588e78[_0x4d4263(0x264)],_0x588e78['connectionIdToNameMap']);_0x289fbd[_0x4d4263(0x1af)]({'relativePath':_0x29ac02[_0x4d4263(0x1bb)],'absolutePath':_0x4429eb,'yamlConfig':_0x29ac02,'folderPath':_0x5e306f,'existingSegment':_0x3b3aa0,'existingActivations':_0x3c5292,'isNew':_0x13e682[_0x4d4263(0x232)],'hasChanges':_0x13e682[_0x4d4263(0x236)],'diff':_0x13e682['diff'],'activationActions':_0x4068c7});}return{'segmentFiles':_0x289fbd,'foldersToCreate':_0x23b8de};}export async function prepareJourneyFiles(_0x4339b4,_0xb3d2fb,_0x2626ba,_0x4f9128){const _0x1a7528=a174_0x32cc05,_0x478684=[],_0x4ab3e5=new Set();for(const {yamlConfig:_0x30d8e8,folderPath:_0x3a1bf8,sourcePath:_0x500de0}of _0x4339b4){const _0x3e5edd=resolveTDFolderPath(_0x3a1bf8,_0x2626ba,_0x4f9128),_0x5113bc=_0x3e5edd+':'+_0x30d8e8[_0x1a7528(0x1bb)],_0x164ed2=_0xb3d2fb[_0x1a7528(0x1f3)][_0x1a7528(0x253)](_0x5113bc);let _0x2c4a37,_0x2f48c;if(_0x164ed2&&_0x164ed2[_0x1a7528(0x1c7)]>0x0){const _0x45edc9=buildLocalExpandedRuleMappings(_0x30d8e8),{createYamlContext:_0x25190f,prefetchJourneySegments:_0x1a39a6}=createPushYamlContextForBundle(_0xb3d2fb[_0x1a7528(0x20e)],_0xb3d2fb[_0x1a7528(0x1e6)],_0xb3d2fb[_0x1a7528(0x292)],_0x45edc9,_0xb3d2fb['idToEmailMap'],_0xb3d2fb[_0x1a7528(0x28f)],_0xb3d2fb['activationStepsById'],_0xb3d2fb[_0x1a7528(0x1b5)]);await _0x1a39a6(_0x164ed2[_0x1a7528(0x1b4)](_0x43ff0c=>_0x43ff0c['id']));const _0x58b35c=await _0xb3d2fb[_0x1a7528(0x20e)][_0x1a7528(0x289)][_0x1a7528(0x23b)](_0x164ed2[0x0][_0x1a7528(0x1b6)]),_0x1484e9=hasMultipleVersions(_0x30d8e8),_0x227082=async _0x431eeb=>{const _0x4f4f2a=_0x1a7528,_0xa5ed73=_0xb3d2fb[_0x4f4f2a(0x1b5)]?.[_0x4f4f2a(0x253)](_0x431eeb);if(_0xa5ed73)return _0xa5ed73;return _0xb3d2fb[_0x4f4f2a(0x219)]({'journeyId':_0x431eeb,'journeyName':_0x30d8e8['name'],'isMultiVersion':_0x164ed2[_0x4f4f2a(0x1c7)]>0x1});};if(_0x1484e9&&_0x164ed2[_0x1a7528(0x1c7)]>0x1){const _0x15626b=[];for(const _0x211615 of _0x164ed2){const _0x1b611d=_0x211615[_0x1a7528(0x251)]||0x1;_0xb3d2fb[_0x1a7528(0x248)]?.[_0x1a7528(0x27a)](_0x1a7528(0x255)+_0x30d8e8[_0x1a7528(0x1bb)]+'\x20v'+_0x1b611d);const _0x550d1f=await _0x227082(_0x211615['id']),_0x24eacd=_0x25190f(_0x211615['id']),_0x4a9bae=await journeyResponseToDef(_0x550d1f,_0x24eacd);_0x15626b[_0x1a7528(0x1af)]({'item':_0x211615,'yaml':_0x4a9bae});}const _0x405347=buildLocalRuleToNameMappingFromJourney(_0x30d8e8);_0x2f48c=buildMergedJourneyDef(_0x15626b,_0x405347,_0x58b35c);const _0x57e8aa=Math[_0x1a7528(0x1a3)](..._0x15626b[_0x1a7528(0x1b4)](_0x365a99=>_0x365a99[_0x1a7528(0x1de)][_0x1a7528(0x251)]||0x0)),_0x412c2e=_0x164ed2['find'](_0x2cbfd9=>(_0x2cbfd9['versionNumber']||0x0)===_0x57e8aa);_0x412c2e&&(_0xb3d2fb[_0x1a7528(0x248)]?.[_0x1a7528(0x27a)]('Fetching\x20'+_0x30d8e8[_0x1a7528(0x1bb)]+'\x20v'+_0x57e8aa),_0x2c4a37=await _0x227082(_0x412c2e['id']));}else{const _0x4f2533=_0x164ed2[_0x164ed2[_0x1a7528(0x1c7)]-0x1];_0xb3d2fb['progress']?.['update']('Fetching\x20'+_0x30d8e8['name']),_0x2c4a37=await _0x227082(_0x4f2533['id']);const _0x1a5771=_0x25190f(_0x4f2533['id']),_0x435b53=await journeyResponseToDef(_0x2c4a37,_0x1a5771),_0x37351d=buildLocalRuleToNameMappingFromJourney(_0x30d8e8);_0x2f48c=buildMergedJourneyDef([{'item':_0x4f2533,'yaml':_0x435b53}],_0x37351d,_0x58b35c);}}addFoldersToCreate(_0x3e5edd,_0xb3d2fb['folderPathToId'],_0x4ab3e5);const _0x311e83=calculateJourneyDiff(_0x30d8e8,_0x2f48c);_0x478684[_0x1a7528(0x1af)]({'relativePath':_0x30d8e8[_0x1a7528(0x1bb)],'absolutePath':_0x500de0,'yamlConfig':_0x30d8e8,'folderPath':_0x3e5edd,'existingJourney':_0x2c4a37,'isNew':_0x311e83[_0x1a7528(0x232)],'hasChanges':_0x311e83[_0x1a7528(0x236)],'diff':_0x311e83['diff']});}return{'journeyFiles':_0x478684,'foldersToCreate':_0x4ab3e5};}export function calculateActivationActions(_0x11af3d,_0x4560f5,_0x44b8ef,_0x4fb812){const _0xef30fc=a174_0x32cc05,_0x5868fc=[],_0x44b262=new Map();for(const _0x70b028 of _0x4560f5){_0x44b262[_0xef30fc(0x1f1)](_0x70b028[_0xef30fc(0x1bb)],_0x70b028);}const _0x4b21f6=new Map();for(const _0x2d0d90 of _0x11af3d){_0x4b21f6[_0xef30fc(0x1f1)](_0x2d0d90[_0xef30fc(0x1bb)],_0x2d0d90);}for(const _0x536ce0 of _0x11af3d){const _0x16cc55=_0x44b262[_0xef30fc(0x253)](_0x536ce0['name']);if(!_0x16cc55)_0x5868fc[_0xef30fc(0x1af)]({'type':_0xef30fc(0x220),'name':_0x536ce0[_0xef30fc(0x1bb)],'yamlActivation':_0x536ce0});else{const _0x5f56b7=activationResponseToDef(_0x16cc55,_0x44b8ef,_0x4fb812),_0x793930=a174_0x454c22['stringify'](_0x5f56b7),_0x4fe0f3=a174_0x454c22[_0xef30fc(0x1b7)](_0x536ce0);_0x793930!==_0x4fe0f3&&_0x5868fc[_0xef30fc(0x1af)]({'type':_0xef30fc(0x27a),'name':_0x536ce0['name'],'yamlActivation':_0x536ce0,'existingActivation':_0x16cc55});}}for(const _0x43aaee of _0x4560f5){!_0x4b21f6[_0xef30fc(0x1fd)](_0x43aaee[_0xef30fc(0x1bb)])&&_0x5868fc[_0xef30fc(0x1af)]({'type':'delete','name':_0x43aaee[_0xef30fc(0x1bb)],'existingActivation':_0x43aaee});}return _0x5868fc;}function calculateYamlDiff(_0x31a511,_0x1955c1){if(_0x1955c1){const _0x3dbff7=generateDiff(_0x1955c1,_0x31a511),_0x50547a=hasChanges(_0x3dbff7);return{'isNew':![],'hasChanges':_0x50547a,'diff':_0x50547a?formatDiffWithColors(_0x3dbff7):undefined};}const _0xc7574b=generateDiff('',_0x31a511);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xc7574b)};}export function calculateSegmentDiff(_0x239eac,_0x118ddb,_0x444a3b,_0x451707,_0x16df03){const _0x3d99fc=segmentToYamlString(_0x239eac),_0x10c011=_0x118ddb?segmentToYamlString(segmentWithActivationsToYaml(_0x118ddb,_0x444a3b,undefined,_0x451707,_0x16df03)):undefined;return calculateYamlDiff(_0x3d99fc,_0x10c011);}export function calculateJourneyDiff(_0x29340a,_0x4d1e68){const _0x4f0325=normalizeJourneyDef(_0x29340a,_0x29340a),_0x325eb5=a174_0x49ab5c(_0x4f0325),_0xea8172=_0x4d1e68?a174_0x49ab5c(normalizeJourneyDef(_0x4d1e68,_0x29340a)):undefined;return calculateYamlDiff(_0x325eb5,_0xea8172);}export function findSegmentsToDelete(_0x4c04c2,_0x7b8053,_0x1f450a,_0x3eae3c,_0x1d2d62){const _0x3f83fa=a174_0x32cc05,_0x31de00=new Set();for(const {yamlConfig:_0x4b9108,folderPath:_0x29c023}of _0x7b8053){_0x31de00[_0x3f83fa(0x26d)](_0x29c023+':'+_0x4b9108[_0x3f83fa(0x1bb)]);}return _0x4c04c2[_0x3f83fa(0x26b)](_0x221f03=>{const _0x5a3f49=_0x3f83fa,_0xdc93ff=_0x221f03[_0x5a3f49(0x201)]?_0x1f450a[_0x5a3f49(0x253)](_0x221f03[_0x5a3f49(0x201)]['toString']())||'':'',_0x5bce23=_0xdc93ff+':'+_0x221f03[_0x5a3f49(0x1bb)];if(_0x31de00[_0x5a3f49(0x1fd)](_0x5bce23))return![];if(_0x1d2d62)return _0xdc93ff===_0x3eae3c||_0xdc93ff[_0x5a3f49(0x1fa)](_0x3eae3c+'/');return!![];});}export function findJourneysToDelete(_0x53a39b,_0x13d696,_0x37d889,_0x5d929c,_0x2b3d37){const _0x243867=a174_0x32cc05,_0x310ba8=new Set();for(const {yamlConfig:_0x2b6377,folderPath:_0xc5e969}of _0x13d696){_0x310ba8[_0x243867(0x26d)](_0xc5e969+':'+_0x2b6377[_0x243867(0x1bb)]);}return _0x53a39b[_0x243867(0x26b)](_0x1eb3b1=>{const _0x1f0d75=_0x243867,_0x1c51e2=_0x1eb3b1[_0x1f0d75(0x1ab)]?_0x37d889[_0x1f0d75(0x253)](_0x1eb3b1[_0x1f0d75(0x1ab)])||'':'',_0x2cff21=_0x1c51e2+':'+_0x1eb3b1['journeyBundleName'];if(_0x310ba8[_0x1f0d75(0x1fd)](_0x2cff21))return![];if(_0x2b3d37)return _0x1c51e2===_0x5d929c||_0x1c51e2[_0x1f0d75(0x1fa)](_0x5d929c+'/');return!![];});}export function buildSegmentLookupMap(_0x5e9789,_0x22e957){const _0x30aa92=a174_0x32cc05,_0x33f4c1=new Map();for(const _0x169b00 of _0x5e9789){const _0x325ce=_0x169b00[_0x30aa92(0x201)]?_0x22e957['get'](_0x169b00['segmentFolderId'][_0x30aa92(0x1e7)]())||'':'',_0x526d57=_0x325ce+':'+_0x169b00[_0x30aa92(0x1bb)];_0x33f4c1[_0x30aa92(0x1f1)](_0x526d57,_0x169b00);}return _0x33f4c1;}export function buildSegmentNameToIdMap(_0x3c2a47){const _0x3acb83=a174_0x32cc05,_0x26b6b6=new Map();for(const _0x2ae0ae of _0x3c2a47){_0x26b6b6[_0x3acb83(0x1f1)](_0x2ae0ae[_0x3acb83(0x1bb)],_0x2ae0ae['id']);}return _0x26b6b6;}export function buildJourneyBundleLookupMap(_0x351889,_0x10ed24){const _0x4ef18c=a174_0x32cc05,_0x5566cd=new Map();for(const _0x33ca60 of _0x351889){const _0xb9aa23=_0x33ca60['folderId']?_0x10ed24[_0x4ef18c(0x253)](_0x33ca60[_0x4ef18c(0x1ab)])||'':'',_0x156bbe=_0xb9aa23+':'+_0x33ca60[_0x4ef18c(0x1ce)];!_0x5566cd[_0x4ef18c(0x1fd)](_0x156bbe)&&_0x5566cd[_0x4ef18c(0x1f1)](_0x156bbe,[]),_0x5566cd['get'](_0x156bbe)['push'](_0x33ca60);}for(const _0x36322d of _0x5566cd['values']()){_0x36322d[_0x4ef18c(0x1dd)]((_0x34b457,_0x4b8d9e)=>(_0x34b457[_0x4ef18c(0x251)]||0x0)-(_0x4b8d9e[_0x4ef18c(0x251)]||0x0));}return _0x5566cd;}export function collectFoldersToCreate(_0x2d64be,_0x1b8ef2){const _0x4e712a=a174_0x32cc05,_0x4d0a53=new Set();for(const _0x24bcfc of _0x2d64be){if(!_0x24bcfc)continue;if(_0x1b8ef2[_0x4e712a(0x1fd)](_0x24bcfc))continue;const _0x5f11ba=_0x24bcfc['split']('/');let _0x3be47c='';for(const _0xa8e3c9 of _0x5f11ba){_0x3be47c=_0x3be47c?_0x3be47c+'/'+_0xa8e3c9:_0xa8e3c9,!_0x1b8ef2[_0x4e712a(0x1fd)](_0x3be47c)&&_0x4d0a53[_0x4e712a(0x26d)](_0x3be47c);}}return _0x4d0a53;}export function parseAndClassifyYamlFiles(_0x2afbc5,_0x4b6aa1,_0x321832){const _0x43e4b1=a174_0x32cc05,_0x20c95d=[],_0x34172a=[];for(const _0x23d4fa of _0x2afbc5){const _0x1071a7=a174_0x4d34ce['relative'](_0x4b6aa1,a174_0x4d34ce[_0x43e4b1(0x26e)](_0x23d4fa)),_0x49c132=_0x1071a7==='.'?'':_0x1071a7[_0x43e4b1(0x1c9)](/\\/g,'/'),_0x4a0da3=readFileSync(_0x23d4fa,_0x43e4b1(0x18e)),_0x12f6fe=a174_0x454c22[_0x43e4b1(0x25b)](_0x4a0da3);if(isJourneyDef(_0x12f6fe,_0x23d4fa)){const _0x1926c1=a174_0x236a99(_0x4a0da3);_0x34172a[_0x43e4b1(0x1af)]({'yamlConfig':_0x1926c1,'folderPath':_0x49c132,'sourcePath':_0x23d4fa});}else{if(!_0x321832?.['skipSegments']){const _0x8b9fd9=parseSegmentYamlFile(_0x4a0da3),_0x595a2d=normalizeChildSegmentYaml(_0x8b9fd9);_0x20c95d[_0x43e4b1(0x1af)]({'yamlConfig':_0x595a2d,'folderPath':_0x49c132,'sourcePath':_0x23d4fa});}}}return{'segments':_0x20c95d,'journeys':_0x34172a};}export function validateParsedFiles(_0x3961a1,_0x3f26f3){const _0x2673fc=a174_0x32cc05,_0x3851cf=[];for(const {yamlConfig:_0x7983fe,sourcePath:_0x41bf92}of _0x3961a1[_0x2673fc(0x28e)]){const _0x17ed6d=readFileSync(_0x41bf92,_0x2673fc(0x18e)),_0xb8d62e=a174_0x454c22[_0x2673fc(0x276)](_0x17ed6d),_0x4f5157=validateSegmentDef(_0x7983fe,{'source':_0x17ed6d,'document':_0xb8d62e},{'skipSchema':!![]});if(!_0x4f5157['valid']){const _0x566117=a174_0x4d34ce[_0x2673fc(0x256)](_0x3f26f3,_0x41bf92);_0x3851cf[_0x2673fc(0x1af)]({'filePath':_0x566117,'source':_0x17ed6d,'result':_0x4f5157,'isJourney':![]});}}for(const {yamlConfig:_0x13b64e,sourcePath:_0x59b622}of _0x3961a1[_0x2673fc(0x1b1)]){const _0x299cec=readFileSync(_0x59b622,_0x2673fc(0x18e)),_0x1e306d=a174_0x454c22[_0x2673fc(0x276)](_0x299cec),_0x2ae338=validateJourneyDef(_0x13b64e,{'source':_0x299cec,'document':_0x1e306d},{'skipSchema':!![]});if(!_0x2ae338[_0x2673fc(0x1f2)]){const _0xf2e4c=a174_0x4d34ce[_0x2673fc(0x256)](_0x3f26f3,_0x59b622);_0x3851cf['push']({'filePath':_0xf2e4c,'source':_0x299cec,'result':_0x2ae338,'isJourney':!![]});}}return _0x3851cf;}export function formatValidationErrors(_0x4efd91){const _0x3a399b=a174_0x32cc05,_0x5e5547=[];for(const {filePath:_0x14bc30,source:_0x469c7e,result:_0x234a9d,isJourney:_0x2f99f4}of _0x4efd91){const _0xf0f215=_0x2f99f4?_0x3a399b(0x289):_0x3a399b(0x290);_0x5e5547[_0x3a399b(0x1af)]('\x0a'+_0x14bc30+'\x20('+_0xf0f215+_0x3a399b(0x25f)+_0x234a9d[_0x3a399b(0x1d9)]['length']+'\x20error(s)'),_0x5e5547[_0x3a399b(0x1af)](formatValidationResult(_0x234a9d,_0x469c7e,_0x14bc30));}return _0x5e5547['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x3e8912){const _0x2b069d=a174_0x32cc05,_0x2f6e28=new Set(),_0x849d20=new Map(),_0x18d2f9=collectSegmentUsageCounts(_0x3e8912);if(_0x3e8912[_0x2b069d(0x28e)])for(const [_0x1c77d6,_0x54b80b]of Object['entries'](_0x3e8912[_0x2b069d(0x28e)])){_0x2f6e28[_0x2b069d(0x26d)](_0x1c77d6);if(_0x54b80b['rule']){const _0x412449=yamlRuleToApi(_0x54b80b['rule']),_0x2542da=apiRuleToYaml(_0x412449);_0x849d20['set'](_0x1c77d6,_0x2542da);}}const _0x42e200=new Map();let _0x58eb56=0x0;for(const [_0x21c01b,_0x2cda03]of _0x849d20){const _0xa9c915=serializeExpandedRule(_0x2cda03,_0x849d20),_0x433a64=_0x42e200[_0x2b069d(0x253)](_0xa9c915)||[];_0x433a64[_0x2b069d(0x1af)]({'name':_0x21c01b,'index':_0x58eb56}),_0x42e200['set'](_0xa9c915,_0x433a64),_0x58eb56++;}const _0x294b56=new Map();for(const [_0x19936d,_0x1dbb9f]of _0x42e200){const _0x13746c=_0x1dbb9f[_0x2b069d(0x27f)]()[_0x2b069d(0x1dd)]((_0x2ff3d2,_0x379d71)=>{const _0x3fbd1b=_0x2b069d,_0x47e98d=_0x18d2f9[_0x3fbd1b(0x253)](_0x2ff3d2['name'])||0x0,_0xb4493e=_0x18d2f9[_0x3fbd1b(0x253)](_0x379d71[_0x3fbd1b(0x1bb)])||0x0;if(_0x47e98d!==_0xb4493e)return _0xb4493e-_0x47e98d;return _0x2ff3d2[_0x3fbd1b(0x21c)]-_0x379d71['index'];})[_0x2b069d(0x1b4)](_0x49dcb8=>_0x49dcb8[_0x2b069d(0x1bb)]),_0x1bc1b8=[];for(const _0x4e4af1 of _0x13746c){const _0x597aa0=_0x18d2f9[_0x2b069d(0x253)](_0x4e4af1)||0x0,_0x453992=Math[_0x2b069d(0x1a3)](_0x597aa0,0x1);for(let _0x4855a6=0x0;_0x4855a6<_0x453992;_0x4855a6++){_0x1bc1b8[_0x2b069d(0x1af)](_0x4e4af1);}}_0x294b56[_0x2b069d(0x1f1)](_0x19936d,_0x1bc1b8);}return{'existingLocalSegmentNames':_0x2f6e28,'localSegmentRules':_0x849d20,'localExpandedRuleToNames':_0x294b56};}export function createSegmentIdResolver(_0xd83a42,_0x32df2f){return async _0x496b9a=>{const _0x10852f=a174_0x1505,_0x4bcfb7=_0xd83a42[_0x10852f(0x253)](_0x496b9a);if(!_0x4bcfb7)throw new SDKError(ErrorCode[_0x10852f(0x1e8)],_0x10852f(0x209)+_0x496b9a+_0x10852f(0x1d8)+_0x32df2f+'\x27)');return _0x4bcfb7;};}export function extractRootFolderId(_0x578dc8){const _0x579f96=a174_0x32cc05;return _0x578dc8[_0x579f96(0x1ba)]?.[_0x579f96(0x205)]?.[_0x579f96(0x223)]?.['id']||_0x578dc8[_0x579f96(0x1ba)]?.[_0x579f96(0x1dc)]?.[_0x579f96(0x223)]?.['id'];}export function buildConnectionMaps(_0x4600b7){const _0x356d28=a174_0x32cc05,_0xf54412=new Map(),_0x5b1d3a=new Map(),_0x3c208f=new Map();for(const _0x510c0e of _0x4600b7){_0xf54412[_0x356d28(0x1f1)](_0x510c0e[_0x356d28(0x1bb)],parseInt(_0x510c0e['id'],0xa)),_0x5b1d3a[_0x356d28(0x1f1)](_0x510c0e['id'],_0x510c0e['name']),_0x3c208f[_0x356d28(0x1f1)](_0x510c0e[_0x356d28(0x1bb)],_0x510c0e[_0x356d28(0x225)]);}return{'nameToId':_0xf54412,'idToName':_0x5b1d3a,'nameToType':_0x3c208f};}export function calculatePushStats(_0x15afe6,_0x3c2f72,_0x34e654,_0x13b397,_0x54a5dc,_0x2b268e,_0x3c71f5){const _0x14ae38=a174_0x32cc05,_0x296d0e=_0x15afe6['filter'](_0x11c165=>_0x11c165[_0x14ae38(0x232)]),_0x2a4fce=_0x15afe6[_0x14ae38(0x26b)](_0x2ca689=>!_0x2ca689[_0x14ae38(0x232)]&&_0x2ca689[_0x14ae38(0x236)]),_0x7cec26=_0x15afe6['filter'](_0x28b9d5=>!_0x28b9d5[_0x14ae38(0x232)]&&!_0x28b9d5[_0x14ae38(0x236)]),_0x4e19a0=_0x2b268e?_0x13b397:[],_0x22e25e=_0x3c2f72['filter'](_0x32cdb1=>_0x32cdb1['isNew']),_0x830c5c=_0x3c2f72['filter'](_0x405c94=>!_0x405c94[_0x14ae38(0x232)]&&_0x405c94['hasChanges']),_0x19e63f=_0x3c2f72[_0x14ae38(0x26b)](_0x5c6620=>!_0x5c6620[_0x14ae38(0x232)]&&!_0x5c6620[_0x14ae38(0x236)]),_0x1aa8f4=_0x2b268e?_0x54a5dc:[],_0x476da2=_0x15afe6[_0x14ae38(0x1ea)](_0x333d0b=>_0x333d0b[_0x14ae38(0x265)]),_0x16298d=_0x476da2[_0x14ae38(0x26b)](_0x2e80ac=>_0x2e80ac[_0x14ae38(0x225)]==='create'),_0x50ed92=_0x476da2['filter'](_0x246f53=>_0x246f53[_0x14ae38(0x225)]==='update'),_0x5a7f50=_0x476da2[_0x14ae38(0x26b)](_0x154507=>_0x154507[_0x14ae38(0x225)]===_0x14ae38(0x1e2)),_0x4f6e51=Array[_0x14ae38(0x1f5)](_0x34e654)[_0x14ae38(0x1dd)](),_0x909fde=_0x3c71f5?![]:_0x296d0e['length']>0x0||_0x2a4fce['length']>0x0||_0x4e19a0['length']>0x0,_0xb2fb6b=_0x22e25e['length']>0x0||_0x830c5c['length']>0x0||_0x1aa8f4[_0x14ae38(0x1c7)]>0x0,_0xab6d0f=_0x3c71f5?![]:_0x476da2[_0x14ae38(0x1c7)]>0x0,_0x51e67c=_0x4f6e51[_0x14ae38(0x1c7)]>0x0;return{'segments':{'new':_0x296d0e,'changed':_0x2a4fce,'unchanged':_0x7cec26,'toDelete':_0x4e19a0},'journeys':{'new':_0x22e25e,'changed':_0x830c5c,'unchanged':_0x19e63f,'toDelete':_0x1aa8f4},'activations':{'all':_0x476da2,'toCreate':_0x16298d,'toUpdate':_0x50ed92,'toDelete':_0x5a7f50},'folders':{'toCreate':_0x4f6e51},'counts':{'segments':{'new':_0x296d0e[_0x14ae38(0x1c7)],'changed':_0x2a4fce[_0x14ae38(0x1c7)],'unchanged':_0x7cec26['length'],'toDelete':_0x4e19a0[_0x14ae38(0x1c7)]},'journeys':{'new':_0x22e25e[_0x14ae38(0x1c7)],'changed':_0x830c5c[_0x14ae38(0x1c7)],'unchanged':_0x19e63f['length'],'toDelete':_0x1aa8f4['length']},'activations':{'create':_0x16298d['length'],'update':_0x50ed92['length'],'delete':_0x5a7f50['length']},'folders':_0x4f6e51['length']},'hasChanges':_0x909fde||_0xb2fb6b||_0xab6d0f||_0x51e67c};}export async function buildPushExecutionContext(_0x47c45a,_0x1178fc,_0x3a3636,_0x1e1d58,_0x29427d,_0xd352f1){const _0x4b2837=a174_0x32cc05,_0x3ed823=extractRootFolderId(_0x3a3636),{pathToId:_0x2a79e4,idToPath:_0x1af02b}=buildFolderMaps(_0x29427d),_0x19d7b7=buildSegmentNameToIdMap(_0x1e1d58),_0x4937e4=new Map(),{batchAsync:_0x380b52}=await import(_0x4b2837(0x24d)),[_0xfd5e8,_0x360b36]=await Promise[_0x4b2837(0x216)]([_0x47c45a[_0x4b2837(0x1ef)]['buildUserMaps'](),_0x47c45a[_0x4b2837(0x1e4)]['list'](),((async()=>{const _0x1bfbb0=_0x4b2837;!_0xd352f1&&_0x1e1d58[_0x1bfbb0(0x1c7)]>0x0&&await _0x380b52(_0x1e1d58,async _0x19915b=>{const _0x44b650=_0x1bfbb0,_0x2f1e26=await _0x47c45a[_0x44b650(0x290)][_0x44b650(0x240)](_0x1178fc,_0x19915b['id']);_0x4937e4[_0x44b650(0x1f1)](_0x19915b['id'],_0x2f1e26);});})())]),{emailToId:_0x379928,idToEmail:_0x2bd0fc}=_0xfd5e8,_0x164ce9=buildConnectionMaps(_0x360b36);return{'rootFolderId':_0x3ed823,'folderPathToId':_0x2a79e4,'folderIdToPath':_0x1af02b,'segmentNameToId':_0x19d7b7,'activationsBySegmentId':_0x4937e4,'emailToIdMap':_0x379928,'idToEmailMap':_0x2bd0fc,'connectionNameToIdMap':_0x164ce9[_0x4b2837(0x22d)],'connectionIdToNameMap':_0x164ce9['idToName'],'connectionNameToTypeMap':_0x164ce9['nameToType']};}export function createPushYamlContextForBundle(_0x30b846,_0x423fb7,_0x95f1a3,_0x4904c7,_0x3431d5,_0x4af1cb,_0x39f822,_0x33e7e6){const {existingLocalSegmentNames:_0x2beaf7,localExpandedRuleToNames:_0x42338f}=_0x4904c7,_0x1c1008=new Set(),_0x1a58bd=new Map(),_0x4bbd1f=new Map(),_0x2f3516=new Map(),_0x44bcfe=createJumpTargetCache(),_0x3a2cb2=new Map(),_0x512e50=new Map(),_0x1a82e6=new Set();let _0x3fe0f8;const _0x47d61e=_0x358d49=>{const _0x246c17={'resolveSegment':async _0x37e89f=>{const _0x2fd818=a174_0x1505,_0x5ba480=_0x2f3516[_0x2fd818(0x253)](_0x37e89f);if(_0x5ba480!==undefined)return{'name':_0x5ba480,'isJourneyLocal':!![]};try{const _0x4c5103=await fetchSegment(_0x30b846,_0x423fb7,_0x37e89f,_0x95f1a3);if(!_0x4c5103)throw new Error(_0x2fd818(0x23e));const _0x501ff3=generateJourneyLocalName(_0x4c5103[_0x2fd818(0x1bb)]),_0x108aaa=_0x4c5103[_0x2fd818(0x210)]===SEGMENT_KIND_JOURNEY&&_0x501ff3!==undefined;let _0x1b77d1=_0x4c5103['name'],_0x154401;if(_0x108aaa&&_0x4c5103[_0x2fd818(0x213)]){const _0x25567b=apiRuleToYaml(_0x4c5103['rule']);_0x512e50['set'](_0x37e89f,_0x25567b);const _0x204a01=async _0x3c5b77=>{const _0xf8332f=_0x2fd818,_0x345f3a=collectSegmentRefsFromRule(_0x3c5b77);for(const _0x34d9a8 of _0x345f3a){if(!_0x512e50['has'](_0x34d9a8))try{const _0x203151=await fetchSegment(_0x30b846,_0x423fb7,_0x34d9a8,_0x95f1a3);if(_0x203151?.[_0xf8332f(0x213)]){const _0x3496a5=apiRuleToYaml(_0x203151[_0xf8332f(0x213)]);_0x512e50[_0xf8332f(0x1f1)](_0x34d9a8,_0x3496a5),await _0x204a01(_0x3496a5);}}catch(_0x33afcc){logger[_0xf8332f(0x20c)](_0xf8332f(0x22e)+_0x34d9a8+':\x20'+_0x33afcc);}}};await _0x204a01(_0x25567b);const _0x4f5dcc=serializeExpandedRule(_0x25567b,_0x512e50),_0x5b0bbf=_0x42338f['get'](_0x4f5dcc);if(_0x5b0bbf&&_0x5b0bbf[_0x2fd818(0x1c7)]>0x0){const _0x295bcf=_0x1a58bd[_0x2fd818(0x253)](_0x4f5dcc)||0x0,_0x496849=_0x5b0bbf[_0x295bcf]||_0x5b0bbf[_0x5b0bbf[_0x2fd818(0x1c7)]-0x1];_0x1a58bd[_0x2fd818(0x1f1)](_0x4f5dcc,_0x295bcf+0x1),_0x1b77d1=_0x496849,_0x1c1008[_0x2fd818(0x26d)](_0x1b77d1),_0x2f3516[_0x2fd818(0x1f1)](_0x37e89f,_0x1b77d1);const _0x5e8b3d=await resolveRuleSegmentRefs(_0x25567b,async _0x1f2619=>{const _0x367eef=_0x2fd818,_0x38acae=_0x2f3516[_0x367eef(0x253)](_0x1f2619);if(_0x38acae)return _0x38acae;const _0x122929=await _0x3fe0f8['resolveSegment'](_0x1f2619);return _0x122929['name'];});_0x154401={'description':_0x4c5103[_0x2fd818(0x1e1)],'rule':_0x5e8b3d};}else{const _0x484476=_0x3a2cb2[_0x2fd818(0x253)](_0x4f5dcc);if(_0x484476)_0x1b77d1=_0x484476,_0x2f3516['set'](_0x37e89f,_0x1b77d1);else{if(_0x501ff3){let _0x3c7002=_0x501ff3,_0x735026=0x2;while(_0x1c1008[_0x2fd818(0x1fd)](_0x3c7002)||_0x2beaf7[_0x2fd818(0x1fd)](_0x3c7002)){_0x3c7002=_0x501ff3+'_'+_0x735026,_0x735026++;}_0x1c1008['add'](_0x3c7002),_0x1b77d1=_0x3c7002;}_0x2f3516[_0x2fd818(0x1f1)](_0x37e89f,_0x1b77d1),_0x3a2cb2[_0x2fd818(0x1f1)](_0x4f5dcc,_0x1b77d1);const _0x573adc=await resolveRuleSegmentRefs(_0x25567b,async _0x591c70=>{const _0x5187e8=_0x2fd818,_0xd6cf55=_0x2f3516[_0x5187e8(0x253)](_0x591c70);if(_0xd6cf55)return _0xd6cf55;const _0x379d07=await _0x3fe0f8['resolveSegment'](_0x591c70);return _0x379d07[_0x5187e8(0x1bb)];});_0x154401={'description':_0x4c5103[_0x2fd818(0x1e1)],'rule':_0x573adc};}}}return{'name':_0x1b77d1,'isJourneyLocal':_0x108aaa,'definition':_0x154401};}catch(_0x3f9b85){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x37e89f+':\x20'+_0x3f9b85),{'name':_0x37e89f,'isJourneyLocal':![]};}},'resolveActivation':async _0x4c7bca=>{const _0x444bae=a174_0x1505,_0x2184d4=_0x4bbd1f['get'](_0x4c7bca);if(_0x2184d4!==undefined)return{'name':_0x2184d4,'isJourneyLocal':!![]};try{let _0x22289d=_0x39f822?.['get'](_0x4c7bca);!_0x22289d&&(_0x22289d=await _0x30b846['journey']['getActivation'](_0x358d49,_0x4c7bca));const _0x412b74=_0x22289d[_0x444bae(0x1bf)][_0x444bae(0x24c)][_0x444bae(0x1bb)]||_0x4c7bca,_0x1dcf2a=sanitizeYamlKey(_0x412b74)||_0x444bae(0x208)+_0x4c7bca,_0xfb92e5=_0x1dcf2a;_0x4bbd1f['set'](_0x4c7bca,_0xfb92e5);const _0x1a9f55=journeyActivationStepToYaml(_0x22289d,_0x3431d5,_0x4af1cb);return{'name':_0xfb92e5,'isJourneyLocal':!![],'definition':_0x1a9f55};}catch(_0x5ad024){return logger['debug'](_0x444bae(0x1d1)+_0x4c7bca+':\x20'+_0x5ad024),{'name':_0x4c7bca,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5844b1,_0x2cfd53)=>resolveJumpTarget(_0x5844b1,_0x2cfd53,_0x44bcfe,async _0xef2e9e=>{const _0x24eea3=a174_0x1505,_0x1f898f=_0x33e7e6?.[_0x24eea3(0x253)](_0xef2e9e);if(_0x1f898f)return _0x1f898f;return _0x30b846[_0x24eea3(0x289)][_0x24eea3(0x20b)](_0xef2e9e);})};return _0x3fe0f8=_0x246c17,_0x246c17;},_0x2d3219=async _0x25f23f=>{const _0x1cedd6=a174_0x1505,{collectSegmentIdsFromJourneyApi:_0x5a9a67}=await import(_0x1cedd6(0x266)),{batchAsync:_0x49cbae}=await import('../../utils/async.js'),_0x32d639=new Set();for(const _0x118337 of _0x25f23f){let _0x1c563b=_0x33e7e6?.[_0x1cedd6(0x253)](_0x118337);!_0x1c563b&&(_0x1c563b=await _0x30b846[_0x1cedd6(0x289)][_0x1cedd6(0x20b)](_0x118337));const _0x574853=_0x5a9a67(_0x1c563b);for(const _0x4d172e of _0x574853){_0x32d639[_0x1cedd6(0x26d)](_0x4d172e);}}let _0x4ba5da=Array[_0x1cedd6(0x1f5)](_0x32d639);while(_0x4ba5da[_0x1cedd6(0x1c7)]>0x0){const _0x37a522=_0x4ba5da['filter'](_0x4ec87f=>!_0x1a82e6['has'](_0x4ec87f));if(_0x37a522[_0x1cedd6(0x1c7)]===0x0)break;const _0x46fb83=await _0x49cbae(_0x37a522,async _0x3b1d51=>{const _0x1a2787=_0x1cedd6;_0x1a82e6[_0x1a2787(0x26d)](_0x3b1d51);const _0x1698af=await fetchSegment(_0x30b846,_0x423fb7,_0x3b1d51,_0x95f1a3);if(!_0x1698af)return null;return{'segmentId':_0x3b1d51,'segment':_0x1698af};},0xa),_0x2b3b98=new Set();for(const _0x940b4d of _0x46fb83){if(!_0x940b4d?.[_0x1cedd6(0x290)]?.[_0x1cedd6(0x213)])continue;const _0x8f76f6=apiRuleToYaml(_0x940b4d['segment'][_0x1cedd6(0x213)]);_0x512e50[_0x1cedd6(0x1f1)](_0x940b4d[_0x1cedd6(0x200)],_0x8f76f6);const _0xa4df09=collectSegmentRefsFromRule(_0x8f76f6);for(const _0x50e97e of _0xa4df09){!_0x1a82e6[_0x1cedd6(0x1fd)](_0x50e97e)&&_0x2b3b98[_0x1cedd6(0x26d)](_0x50e97e);}}_0x4ba5da=Array[_0x1cedd6(0x1f5)](_0x2b3b98);}};return{'createYamlContext':_0x47d61e,'prefetchJourneySegments':_0x2d3219};}export async function executePushSegments(_0x32072a,_0x493bf1,_0x105244,_0x38acfe,_0x5472e8){const _0x83ae3d=a174_0x32cc05,{segmentDefToCreateRequest:_0x27c263,segmentDefToUpdateRequest:_0x371493}=await import(_0x83ae3d(0x206)),_0x5dd648=_0x105244[_0x83ae3d(0x241)],_0x201ec1=0x5,_0x1441bd=async _0x1cfaf1=>{const _0x58024d=_0x83ae3d,_0x250b50=_0x1cfaf1['folderPath']?_0x5dd648[_0x58024d(0x253)](_0x1cfaf1['folderPath']):undefined;let _0x2d5075;const _0x316f1c={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x28c202=_0x1cfaf1[_0x58024d(0x1e9)];if(_0x1cfaf1[_0x58024d(0x1e9)]['rule']){const _0x4a1c0c=createSegmentIdResolver(_0x105244['segmentNameToId'],_0x1cfaf1[_0x58024d(0x1e9)]['name']),_0x2eea0e=await resolveRuleSegmentIds(_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x213)],_0x4a1c0c);_0x28c202={..._0x1cfaf1[_0x58024d(0x1e9)],'rule':_0x2eea0e};}try{if(_0x1cfaf1[_0x58024d(0x232)]){_0x5472e8[_0x58024d(0x1c3)]?.({'type':_0x58024d(0x287),'name':_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)]});const _0x578783=_0x27c263(_0x28c202,_0x250b50),_0x4e87d3=await _0x5472e8[_0x58024d(0x244)]('Creating\x20segment\x20\x27'+_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)]+_0x58024d(0x245),()=>_0x32072a['segment'][_0x58024d(0x1ca)](_0x38acfe[_0x58024d(0x1e6)],_0x578783));_0x2d5075=_0x4e87d3[_0x58024d(0x223)]['id'],_0x105244[_0x58024d(0x275)][_0x58024d(0x1f1)](_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)],_0x2d5075),_0x316f1c[_0x58024d(0x228)]={'name':_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)],'id':_0x2d5075},_0x5472e8[_0x58024d(0x1c3)]?.({'type':_0x58024d(0x19e),'name':_0x1cfaf1['yamlConfig'][_0x58024d(0x1bb)],'segmentId':_0x2d5075}),_0x5472e8['logSuccess']?.(_0x58024d(0x26c)+_0x1cfaf1[_0x58024d(0x1e9)]['name']+'\x27'),_0x316f1c['created']=0x1;}else{if(_0x1cfaf1[_0x58024d(0x236)]){_0x5472e8['onProgress']?.({'type':_0x58024d(0x281),'name':_0x1cfaf1['yamlConfig'][_0x58024d(0x1bb)]});const _0x2d4694=_0x371493(_0x28c202);_0x250b50!==_0x1cfaf1[_0x58024d(0x294)]?.[_0x58024d(0x201)]&&(_0x2d4694['segmentFolderId']=_0x250b50?parseInt(_0x250b50,0xa):undefined),await _0x5472e8['withProgress'](_0x58024d(0x1f7)+_0x1cfaf1['yamlConfig'][_0x58024d(0x1bb)]+_0x58024d(0x245),()=>_0x32072a[_0x58024d(0x290)]['updateSegmentById'](_0x38acfe['parentId'],_0x1cfaf1['existingSegment']['id'],_0x2d4694)),_0x2d5075=_0x1cfaf1[_0x58024d(0x294)]['id'],_0x5472e8[_0x58024d(0x1c3)]?.({'type':_0x58024d(0x1ae),'name':_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)]}),_0x5472e8[_0x58024d(0x286)]?.(_0x58024d(0x297)+_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)]+'\x27'),_0x316f1c[_0x58024d(0x195)]=0x1;}else _0x2d5075=_0x1cfaf1[_0x58024d(0x294)]['id'];}}catch(_0x4da7bb){const _0x2a7476=isHttp400Error(_0x4da7bb),_0x2351b2=_0x2a7476?ErrorCode[_0x58024d(0x19f)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x3d550a=getErrorMessage(_0x4da7bb);throw new SDKError(_0x2351b2,_0x58024d(0x1a0)+(_0x1cfaf1[_0x58024d(0x232)]?_0x58024d(0x220):_0x58024d(0x27a))+_0x58024d(0x1a4)+_0x1cfaf1[_0x58024d(0x27e)]+_0x58024d(0x24e)+_0x3d550a,_0x4da7bb);}try{const _0x3b9f2d=await syncActivationsForSegment(_0x32072a,_0x38acfe['parentId'],_0x2d5075,_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)],_0x1cfaf1[_0x58024d(0x265)],_0x5472e8,_0x1cfaf1[_0x58024d(0x27e)]);_0x316f1c[_0x58024d(0x1b2)]=_0x3b9f2d;}catch(_0x474033){if(_0x474033 instanceof SDKError)throw _0x474033;throw new SDKError(ErrorCode[_0x58024d(0x261)],_0x58024d(0x207)+_0x1cfaf1[_0x58024d(0x1e9)]['name']+_0x58024d(0x28b)+_0x1cfaf1[_0x58024d(0x27e)]+_0x58024d(0x24e)+getErrorMessage(_0x474033),_0x474033);}return _0x316f1c;},_0x2f46e3=await batchAsync(_0x493bf1,_0x1441bd,_0x201ec1),_0x5f4894={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3e5980 of _0x2f46e3){_0x5f4894['created']+=_0x3e5980[_0x83ae3d(0x18c)],_0x5f4894[_0x83ae3d(0x195)]+=_0x3e5980[_0x83ae3d(0x195)],_0x3e5980[_0x83ae3d(0x228)]&&_0x5f4894[_0x83ae3d(0x1eb)]['set'](_0x3e5980[_0x83ae3d(0x228)][_0x83ae3d(0x1bb)],_0x3e5980[_0x83ae3d(0x228)]['id']),_0x5f4894[_0x83ae3d(0x1b2)][_0x83ae3d(0x18c)]+=_0x3e5980[_0x83ae3d(0x1b2)]['created'],_0x5f4894['activations'][_0x83ae3d(0x195)]+=_0x3e5980[_0x83ae3d(0x1b2)][_0x83ae3d(0x195)],_0x5f4894['activations']['deleted']+=_0x3e5980[_0x83ae3d(0x1b2)][_0x83ae3d(0x1d6)];}return _0x5f4894;}async function syncActivationsForSegment(_0x1f81fb,_0x1d06f4,_0x487e72,_0x11caf0,_0x294584,_0x188e54,_0x4a265d){const _0x403e78=a174_0x32cc05,_0x127e98={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x100a9f of _0x294584){try{if(_0x100a9f[_0x403e78(0x225)]===_0x403e78(0x220)&&_0x100a9f[_0x403e78(0x19a)])_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x27c),'segmentName':_0x11caf0,'activationName':_0x100a9f[_0x403e78(0x1bb)]}),await _0x188e54[_0x403e78(0x244)](_0x403e78(0x1d2)+_0x100a9f['name']+_0x403e78(0x245),()=>_0x1f81fb[_0x403e78(0x290)][_0x403e78(0x299)](_0x1d06f4,_0x487e72,_0x100a9f[_0x403e78(0x19a)])),_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x1bd),'segmentName':_0x11caf0,'activationName':_0x100a9f[_0x403e78(0x1bb)]}),_0x188e54['logSuccess']?.(_0x403e78(0x25d)+_0x100a9f[_0x403e78(0x1bb)]+'\x27'),_0x127e98['created']++;else{if(_0x100a9f['type']===_0x403e78(0x27a)&&_0x100a9f[_0x403e78(0x19a)]&&_0x100a9f[_0x403e78(0x238)])_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x1b8),'segmentName':_0x11caf0,'activationName':_0x100a9f[_0x403e78(0x1bb)]}),await _0x188e54[_0x403e78(0x244)](_0x403e78(0x23c)+_0x100a9f[_0x403e78(0x1bb)]+'\x27...',()=>_0x1f81fb['segment'][_0x403e78(0x259)](_0x1d06f4,_0x487e72,_0x100a9f[_0x403e78(0x238)]['id'],_0x100a9f[_0x403e78(0x19a)])),_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x283),'segmentName':_0x11caf0,'activationName':_0x100a9f[_0x403e78(0x1bb)]}),_0x188e54[_0x403e78(0x286)]?.('Updated\x20activation\x20\x27'+_0x100a9f[_0x403e78(0x1bb)]+'\x27'),_0x127e98[_0x403e78(0x195)]++;else _0x100a9f[_0x403e78(0x225)]==='delete'&&_0x100a9f[_0x403e78(0x238)]&&(_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x20f),'segmentName':_0x11caf0,'activationName':_0x100a9f[_0x403e78(0x1bb)]}),await _0x188e54['withProgress'](_0x403e78(0x26a)+_0x100a9f['name']+_0x403e78(0x245),()=>_0x1f81fb[_0x403e78(0x290)]['deleteActivation'](_0x1d06f4,_0x487e72,_0x100a9f[_0x403e78(0x238)]['id'])),_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x291),'segmentName':_0x11caf0,'activationName':_0x100a9f['name']}),_0x188e54[_0x403e78(0x1cf)]?.('Deleted\x20activation\x20\x27'+_0x100a9f['name']+'\x27'),_0x127e98['deleted']++);}}catch(_0x4f8b83){const _0x564caf=isHttp400Error(_0x4f8b83),_0x3dca31=_0x564caf?ErrorCode[_0x403e78(0x296)]:ErrorCode[_0x403e78(0x261)],_0x10fb22=getErrorMessage(_0x4f8b83);throw new SDKError(_0x3dca31,_0x403e78(0x1a0)+_0x100a9f[_0x403e78(0x225)]+_0x403e78(0x233)+_0x100a9f[_0x403e78(0x1bb)]+_0x403e78(0x28b)+_0x4a265d+_0x403e78(0x24e)+_0x10fb22,_0x4f8b83);}}return _0x127e98;}export async function executePushFolders(_0x24dab4,_0x51693f,_0x523ab4,_0xc0c299,_0x2d1030){const _0x41385c=a174_0x32cc05,_0x5549fc=new Map(_0x523ab4),_0x22a40a=sortFoldersByDepth(_0x51693f);for(const _0x50e6f8 of _0x22a40a){const _0x31bb33=_0x50e6f8['split']('/'),_0x1c6a1f=_0x31bb33[_0x31bb33[_0x41385c(0x1c7)]-0x1],_0x5a6532=_0x31bb33[_0x41385c(0x27f)](0x0,-0x1)[_0x41385c(0x1ed)]('/'),_0x518690=_0x5549fc[_0x41385c(0x253)](_0x5a6532);_0x2d1030[_0x41385c(0x1c3)]?.({'type':_0x41385c(0x25e),'folder':_0x50e6f8});const _0x126bbc={'name':_0x1c6a1f,'parentFolderId':_0x518690},_0x2d1726=await _0x2d1030[_0x41385c(0x244)]('Creating\x20folder\x20\x27'+_0x50e6f8+_0x41385c(0x245),()=>_0x24dab4['segment'][_0x41385c(0x247)](_0xc0c299[_0x41385c(0x1e6)],_0x126bbc));_0x5549fc[_0x41385c(0x1f1)](_0x50e6f8,_0x2d1726['data']['id']),_0x2d1030[_0x41385c(0x1c3)]?.({'type':_0x41385c(0x222),'folder':_0x50e6f8,'folderId':_0x2d1726[_0x41385c(0x223)]['id']}),_0x2d1030[_0x41385c(0x193)]?.(_0x41385c(0x204)+_0x50e6f8+'\x27');}return _0x5549fc;}export async function executePushSegmentDeletions(_0x236195,_0x42d830,_0x493939){const _0x2462e5=a174_0x32cc05;if(_0x42d830[_0x2462e5(0x1c7)]===0x0)return 0x0;const {batchAsync:_0x3e16c7}=await import(_0x2462e5(0x24d)),_0x2cc99d=0x5,_0x3256fd=await _0x3e16c7(_0x42d830,async _0x55af7e=>{const _0xd6a61a=_0x2462e5;return _0x493939[_0xd6a61a(0x1c3)]?.({'type':'segment_deleting','name':_0x55af7e['name']}),await _0x236195[_0xd6a61a(0x290)][_0xd6a61a(0x262)](_0x55af7e['id']),_0x493939[_0xd6a61a(0x1c3)]?.({'type':_0xd6a61a(0x226),'name':_0x55af7e['name']}),_0x493939[_0xd6a61a(0x1cf)]?.(_0xd6a61a(0x20d)+_0x55af7e[_0xd6a61a(0x1bb)]+'\x27'),0x1;},_0x2cc99d);return _0x3256fd[_0x2462e5(0x1f8)]((_0x152bad,_0x1a1f3c)=>_0x152bad+_0x1a1f3c,0x0);}export async function executePushJourneys(_0x1582fa,_0x6080b7,_0x535e6d,_0x1e6ca2,_0x271189){const _0x42ca3f=a174_0x32cc05,{journeyDefToRequest:_0x371250}=await import(_0x42ca3f(0x266)),{activationDefToCreateRequest:_0x430e2e,yamlRuleToApi:_0x29d1b9,validateSegmentRule:_0x4b0cfc}=await import('./child-segment-yaml.js'),_0x291898={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x36c05b=new Map(_0x535e6d[_0x42ca3f(0x275)]),_0x5310fd=0x5;for(let _0x3c3efa=0x0;_0x3c3efa<_0x6080b7[_0x42ca3f(0x1c7)];_0x3c3efa+=_0x5310fd){const _0x182e55=_0x6080b7['slice'](_0x3c3efa,_0x3c3efa+_0x5310fd),_0x520a62=await Promise[_0x42ca3f(0x216)](_0x182e55[_0x42ca3f(0x1b4)](async _0x22905c=>{const _0x5723cf=_0x42ca3f;if(!_0x22905c[_0x5723cf(0x232)]&&!_0x22905c['hasChanges'])return{'action':_0x5723cf(0x258),'name':_0x22905c[_0x5723cf(0x1e9)][_0x5723cf(0x1bb)],'journeyId':_0x22905c[_0x5723cf(0x1fb)]?.['id']};const _0x421e6b=_0x22905c[_0x5723cf(0x260)]?_0x535e6d[_0x5723cf(0x241)][_0x5723cf(0x253)](_0x22905c[_0x5723cf(0x260)]):undefined;_0x271189[_0x5723cf(0x1c3)]?.({'type':_0x22905c[_0x5723cf(0x232)]?'journey_creating':'journey_updating','name':_0x22905c[_0x5723cf(0x1e9)][_0x5723cf(0x1bb)]});try{const _0x24a37b=await executeSingleJourneyPush(_0x1582fa,_0x22905c,{..._0x535e6d,'segmentNameToId':_0x36c05b},{'parentId':_0x1e6ca2[_0x5723cf(0x1e6)],'rootFolderId':_0x1e6ca2[_0x5723cf(0x1db)],'folderId':_0x421e6b,'verbose':_0x1e6ca2[_0x5723cf(0x21d)]},_0x271189,{'journeyDefToRequest':_0x371250,'activationDefToCreateRequest':_0x430e2e,'yamlRuleToApi':_0x29d1b9,'validateSegmentRule':_0x4b0cfc});for(const [_0x44b3ea,_0x51fef4]of _0x24a37b[_0x5723cf(0x21f)]){_0x36c05b[_0x5723cf(0x1f1)](_0x44b3ea,_0x51fef4),_0x291898[_0x5723cf(0x21f)][_0x5723cf(0x1f1)](_0x44b3ea,_0x51fef4);}if(_0x24a37b['action']===_0x5723cf(0x18c))_0x271189['onProgress']?.({'type':_0x5723cf(0x22b),'name':_0x22905c[_0x5723cf(0x1e9)][_0x5723cf(0x1bb)],'journeyId':_0x24a37b[_0x5723cf(0x295)]}),_0x271189[_0x5723cf(0x286)]?.(_0x5723cf(0x21e)+_0x22905c[_0x5723cf(0x1e9)][_0x5723cf(0x1bb)]+'\x27'),_0x291898[_0x5723cf(0x18c)]++;else _0x24a37b[_0x5723cf(0x24b)]===_0x5723cf(0x195)&&(_0x271189[_0x5723cf(0x1c3)]?.({'type':_0x5723cf(0x246),'name':_0x22905c[_0x5723cf(0x1e9)]['name']}),_0x271189[_0x5723cf(0x286)]?.('Updated\x20journey\x20\x27'+_0x22905c[_0x5723cf(0x1e9)]['name']+'\x27'),_0x291898[_0x5723cf(0x195)]++);return{'action':_0x24a37b[_0x5723cf(0x24b)],'name':_0x22905c[_0x5723cf(0x1e9)]['name'],'journeyId':_0x24a37b[_0x5723cf(0x295)]};}catch(_0x57d929){const _0x2bd739=isHttp400Error(_0x57d929),_0x184666=_0x2bd739?ErrorCode[_0x5723cf(0x25c)]:ErrorCode[_0x5723cf(0x1b9)],_0x3195e6=getErrorMessage(_0x57d929);throw new SDKError(_0x184666,_0x5723cf(0x1a0)+(_0x22905c['isNew']?_0x5723cf(0x220):_0x5723cf(0x27a))+_0x5723cf(0x1a7)+_0x22905c['absolutePath']+_0x5723cf(0x24e)+_0x3195e6,_0x57d929);}}));_0x291898['results'][_0x42ca3f(0x1af)](..._0x520a62);}return _0x291898;}function a174_0x1505(_0x49d67e,_0x32fa23){_0x49d67e=_0x49d67e-0x18c;const _0x445272=a174_0x4452();let _0x150505=_0x445272[_0x49d67e];return _0x150505;}async function matchExistingJourneySegments(_0x56a9fe,_0x11f826,_0x19b5c6,_0x33541e,_0x2c5866){const _0x115c77=a174_0x32cc05;if(!_0x11f826[_0x115c77(0x1fb)]||!_0x11f826[_0x115c77(0x1e9)][_0x115c77(0x28e)])return;const _0xa34be4=new Map(),_0x3595df=new Set();for(const _0x3c4e7b of Object[_0x115c77(0x1d4)](_0x11f826['yamlConfig'][_0x115c77(0x28e)])){const _0x49e486=generateDeterministicJourneySegmentName(_0x11f826[_0x115c77(0x1e9)]['name'],_0x3c4e7b);_0xa34be4[_0x115c77(0x1f1)](_0x49e486,_0x3c4e7b),_0x3595df[_0x115c77(0x26d)](_0x3c4e7b);}const _0x454c49=[],_0x48c6a8=collectSegmentIdsFromJourneyApi(_0x11f826['existingJourney']);for(const _0x338c7d of _0x48c6a8){const _0x207fda=await fetchSegment(_0x56a9fe,_0x19b5c6,_0x338c7d,_0x33541e);if(!_0x207fda?.[_0x115c77(0x1bb)])continue;const _0x214255=_0xa34be4[_0x115c77(0x253)](_0x207fda[_0x115c77(0x1bb)]);_0x214255?(_0x2c5866[_0x115c77(0x1f1)](_0x214255,_0x338c7d),_0x3595df[_0x115c77(0x1e2)](_0x214255)):_0x454c49[_0x115c77(0x1af)]({'id':_0x338c7d,'seg':_0x207fda});}if(_0x3595df[_0x115c77(0x285)]>0x0&&_0x454c49[_0x115c77(0x1c7)]>0x0){const {localExpandedRuleToNames:_0x31232d}=buildLocalExpandedRuleMappings(_0x11f826[_0x115c77(0x1e9)]),_0xe87a6b=new Map();for(const {id:_0x4a69d7,seg:_0x33d0d5}of _0x454c49){if(_0x33d0d5[_0x115c77(0x213)]){const _0x275198=apiRuleToYaml(_0x33d0d5[_0x115c77(0x213)]);_0xe87a6b['set'](_0x4a69d7,_0x275198);}}for(const {id:_0x5f3d5b,seg:_0xdd1d3b}of _0x454c49){if(!_0xdd1d3b['rule'])continue;const _0x4731c6=_0xe87a6b['get'](_0x5f3d5b);if(!_0x4731c6)continue;const _0x490874=serializeExpandedRule(_0x4731c6,_0xe87a6b),_0x5631de=_0x31232d[_0x115c77(0x253)](_0x490874);if(_0x5631de){const _0x29c746=_0x5631de[_0x115c77(0x257)](_0x3867be=>_0x3595df[_0x115c77(0x1fd)](_0x3867be));_0x29c746&&(_0x2c5866[_0x115c77(0x1f1)](_0x29c746,_0x5f3d5b),_0x3595df['delete'](_0x29c746),logger[_0x115c77(0x20c)]('Matched\x20server\x20segment\x20\x27'+_0xdd1d3b[_0x115c77(0x1bb)]+_0x115c77(0x242)+_0x29c746+_0x115c77(0x24f)));}}}}async function executeSingleJourneyPush(_0x2c5848,_0x49225b,_0x2b67ee,_0x32712f,_0xc923bc,_0x209929){const _0x3924c7=a174_0x32cc05,{journeyDefToRequest:_0x37eedb,activationDefToCreateRequest:_0x11779d,yamlRuleToApi:_0x59de19,validateSegmentRule:_0x5e2f4b}=_0x209929,_0x916154=new Map(),_0xc158c6=new Map();recoverSegmentIdsFromPushRecovery(_0x49225b,_0x916154,_0x2b67ee['segmentNameToId']);const _0x2f0260=new Map(),_0x49d22c=new Map(),_0x433128=new Map();let _0x2c415c;const _0x468da9=async()=>{const _0x5c252f=a174_0x1505;if(_0x2c415c)return;_0x2c415c=new Map();if(!_0x49225b[_0x5c252f(0x1fb)])return;const _0x4242a5=await _0x2c5848['journey'][_0x5c252f(0x240)](_0x49225b[_0x5c252f(0x1fb)]['id']);for(const _0x509606 of _0x4242a5){const _0x5691c3=journeyActivationStepToYaml(_0x509606,_0x2b67ee[_0x5c252f(0x264)],_0x2b67ee[_0x5c252f(0x28f)]),_0x17d89b=activationSignature(_0x5691c3);!_0x2c415c['has'](_0x17d89b)&&_0x2c415c['set'](_0x17d89b,_0x509606['id']),_0x5691c3[_0x5c252f(0x1bb)]&&_0xc158c6[_0x5c252f(0x1f1)](_0x5691c3['name'],_0x509606['id']);}};await matchExistingJourneySegments(_0x2c5848,_0x49225b,_0x32712f[_0x3924c7(0x1e6)],_0x2b67ee[_0x3924c7(0x292)],_0x2b67ee[_0x3924c7(0x275)]);const _0x3ab920={'resolveSegmentId':async _0x48605b=>{const _0x1274ae=_0x3924c7,_0x3389ae=_0x2b67ee[_0x1274ae(0x275)][_0x1274ae(0x253)](_0x48605b);if(!_0x3389ae)throw new SDKError(ErrorCode[_0x1274ae(0x1e8)],_0x1274ae(0x209)+_0x48605b+_0x1274ae(0x279)+_0x49225b[_0x1274ae(0x1e9)][_0x1274ae(0x1bb)]+')');return _0x3389ae;},'resolveEmbeddedSegmentId':async(_0x19df70,_0x39a762)=>{const _0x441620=_0x3924c7,_0x2accd3=_0x2b67ee['segmentNameToId'][_0x441620(0x253)](_0x19df70);if(_0x2accd3)return _0x2accd3;const _0x45080d=_0x2b67ee['existingSegments'][_0x441620(0x257)](_0x22af92=>_0x22af92[_0x441620(0x1bb)]===_0x19df70);if(_0x45080d)return _0x2b67ee[_0x441620(0x275)][_0x441620(0x1f1)](_0x19df70,_0x45080d['id']),_0x45080d['id'];if(_0x49225b['isNew']){const {stageName:_0x1f3c87,criteriaName:_0x239b69}=findSegmentCriteriaLocation(_0x49225b[_0x441620(0x1e9)],_0x19df70);return _0x5e2f4b(_0x19df70,_0x39a762[_0x441620(0x213)]),_0x49d22c['set'](_0x19df70,{'definition':_0x39a762,'stageName':_0x1f3c87,'criteriaName':_0x239b69}),createPendingSegmentId(_0x19df70);}const _0x21f707=_0x49225b[_0x441620(0x1fb)]?.['id'];if(!_0x21f707)throw new SDKError(ErrorCode[_0x441620(0x271)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x15bc1c=_0x2f0260['get'](_0x19df70);if(_0x15bc1c)return _0x15bc1c;const _0x211b67=((async()=>{const _0x445280=_0x441620;_0x5e2f4b(_0x19df70,_0x39a762[_0x445280(0x213)]);const _0x940c57=generateDeterministicJourneySegmentName(_0x49225b[_0x445280(0x1e9)][_0x445280(0x1bb)],_0x19df70),_0x3edc45=_0x2b67ee[_0x445280(0x292)][_0x445280(0x257)](_0x33ce04=>_0x33ce04['name']===_0x940c57),_0x3aa71b=createSegmentIdResolver(_0x2b67ee['segmentNameToId'],_0x19df70),_0x439193=await resolveRuleSegmentIds(_0x39a762[_0x445280(0x213)],_0x3aa71b);let _0x3992a0;return _0x3edc45?(await _0x2c5848[_0x445280(0x290)][_0x445280(0x1f0)](_0x32712f[_0x445280(0x1e6)],_0x3edc45['id'],{'description':_0x39a762[_0x445280(0x1e1)]||_0x445280(0x1e5)+_0x19df70,'rule':_0x59de19(_0x439193),'countPopulation':!![]}),_0x3992a0=_0x3edc45['id'],saveSegmentToPushRecovery(_0x49225b['absolutePath'],_0x49225b[_0x445280(0x1e9)][_0x445280(0x1bb)],_0x19df70,{'segmentId':_0x3992a0,'uniqueServerName':_0x940c57,'createdAt':new Date()['toISOString']()})):_0x3992a0=await createOrRecoverEmbeddedSegment(_0x2c5848,_0x49225b,{'localName':_0x19df70,'uniqueSegmentName':_0x940c57,'description':_0x39a762[_0x445280(0x1e1)]||_0x445280(0x1e5)+_0x19df70,'journeyId':_0x21f707,'resolvedRule':_0x439193,'parentId':_0x32712f['parentId'],'folderId':_0x32712f[_0x445280(0x1db)]||''},_0x59de19),_0x2b67ee['segmentNameToId']['set'](_0x19df70,_0x3992a0),_0x916154[_0x445280(0x1f1)](_0x19df70,_0x3992a0),_0x3992a0;})());_0x2f0260[_0x441620(0x1f1)](_0x19df70,_0x211b67);try{return await _0x211b67;}finally{_0x2f0260['delete'](_0x19df70);}},'resolveActivationId':async _0x31171e=>{const _0x4c8c87=_0x3924c7,_0x1727b7=_0xc158c6[_0x4c8c87(0x253)](_0x31171e);if(_0x1727b7)return _0x1727b7;if(_0x49225b[_0x4c8c87(0x1fb)]){await _0x468da9();const _0x5495c1=_0xc158c6[_0x4c8c87(0x253)](_0x31171e);if(_0x5495c1)return _0x5495c1;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x4c8c87(0x23f)+_0x31171e+'\x20(referenced\x20in\x20journey\x20'+_0x49225b[_0x4c8c87(0x1e9)]['name']+_0x4c8c87(0x230)+_0x4c8c87(0x22f));},'resolveEmbeddedActivationId':async(_0x489484,_0x5deaa6)=>{const _0x5875a3=_0x3924c7,_0x11a7bf=_0xc158c6[_0x5875a3(0x253)](_0x489484);if(_0x11a7bf)return _0x11a7bf;if(_0x49225b['isNew'])return _0x433128[_0x5875a3(0x1f1)](_0x489484,_0x5deaa6),createPendingActivationId(_0x489484);if(_0x49225b[_0x5875a3(0x1fb)]){await _0x468da9();const _0x2680a4=_0xc158c6[_0x5875a3(0x253)](_0x5deaa6[_0x5875a3(0x1bb)]);if(_0x2680a4)return _0xc158c6['set'](_0x489484,_0x2680a4),_0x2680a4;const _0x88d8e9=activationSignature(_0x5deaa6),_0x272d34=_0x2c415c?.[_0x5875a3(0x253)](_0x88d8e9);if(_0x272d34)return _0xc158c6['set'](_0x489484,_0x272d34),_0x272d34;const _0x4b0b25=await _0x11779d(_0x5deaa6,_0x2b67ee[_0x5875a3(0x23d)]),_0x4cc875={..._0x4b0b25,..._0x5deaa6[_0x5875a3(0x1fc)]!==undefined&&{'runAfterJourneyRefresh':_0x5deaa6[_0x5875a3(0x1fc)]}},_0x146de9=await _0x2c5848[_0x5875a3(0x289)][_0x5875a3(0x299)](_0x49225b[_0x5875a3(0x1fb)]['id'],_0x4cc875);return _0xc158c6[_0x5875a3(0x1f1)](_0x489484,_0x146de9['id']),_0x146de9['id'];}throw new SDKError(ErrorCode[_0x5875a3(0x271)],_0x5875a3(0x218));},'resolveJourneyId':async _0x4741d8=>{const _0x21b307=_0x3924c7;try{return await _0x2c5848[_0x21b307(0x289)][_0x21b307(0x203)](_0x32712f[_0x21b307(0x1e6)],_0x4741d8);}catch(_0x50b0ed){throw new SDKError(ErrorCode[_0x21b307(0x1ec)],_0x21b307(0x1b0)+_0x4741d8+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x49225b['yamlConfig'][_0x21b307(0x1bb)]+'\x27)',_0x50b0ed);}},'resolveStageId':async(_0x55e9c8,_0x6ebf32)=>{const _0x4c98d7=_0x3924c7,_0x41a6dc=await _0x2c5848[_0x4c98d7(0x289)][_0x4c98d7(0x20b)](_0x55e9c8),_0x2bd0f0=_0x41a6dc[_0x4c98d7(0x1bf)][_0x4c98d7(0x194)][_0x4c98d7(0x257)](_0x32a14a=>_0x32a14a['name'][_0x4c98d7(0x252)]()===_0x6ebf32[_0x4c98d7(0x252)]());if(!_0x2bd0f0?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x4c98d7(0x27d)+_0x6ebf32+_0x4c98d7(0x215)+(_0x41a6dc['attributes']['journeyBundleName']||_0x41a6dc[_0x4c98d7(0x1bf)][_0x4c98d7(0x1bb)])+'\x27');return _0x2bd0f0['id'];}},_0x2d7706=await _0x37eedb(_0x49225b[_0x3924c7(0x1e9)],_0x32712f['parentId'],_0x3ab920),_0x188ca6=_0x32712f['folderId']||_0x32712f['rootFolderId'];_0x188ca6&&(_0x2d7706[_0x3924c7(0x1ba)]={'parentFolder':{'data':{'id':_0x188ca6,'type':_0x3924c7(0x1d0)}}});if(_0x49225b[_0x3924c7(0x232)]){if(_0x49d22c['size']>0x0||_0x433128[_0x3924c7(0x285)]>0x0)return await executeThreeStepJourneyCreate(_0x2c5848,_0x49225b,_0x2d7706,{'pendingEmbeddedSegments':_0x49d22c,'pendingEmbeddedActivations':_0x433128,'embeddedSegmentNameToId':_0x916154,'journeyActivationNameToId':_0xc158c6},{..._0x32712f,'effectiveFolderId':_0x188ca6},_0x2b67ee,_0xc923bc,_0x209929);else{ensureJourneyDefaults(_0x2d7706[_0x3924c7(0x1bf)]);const _0x3f5080=await _0x2c5848[_0x3924c7(0x289)][_0x3924c7(0x220)](_0x2d7706);return deletePushRecovery(_0x49225b[_0x3924c7(0x27e)]),{'action':_0x3924c7(0x18c),'journeyId':_0x3f5080['id'],'embeddedSegmentNameToId':_0x916154};}}else{if(_0x49225b[_0x3924c7(0x236)]&&_0x49225b[_0x3924c7(0x1fb)]){_0x2d7706['id']=_0x49225b['existingJourney']['id'];const _0x2c5c4f=_0x2d7706[_0x3924c7(0x1bf)];_0x49225b[_0x3924c7(0x1fb)]['attributes']?.[_0x3924c7(0x1ce)]&&(_0x2c5c4f[_0x3924c7(0x1ce)]=_0x49225b[_0x3924c7(0x1fb)][_0x3924c7(0x1bf)]['journeyBundleName']);const _0x2b24a6=_0x49225b[_0x3924c7(0x1fb)]['attributes']?.[_0x3924c7(0x194)];return _0x2b24a6&&_0x2d7706[_0x3924c7(0x1bf)][_0x3924c7(0x194)]&&injectExistingStageIds(_0x2d7706[_0x3924c7(0x1bf)][_0x3924c7(0x194)],_0x2b24a6),ensureJourneyDefaults(_0x2c5c4f),await _0x2c5848[_0x3924c7(0x289)][_0x3924c7(0x27a)](_0x49225b[_0x3924c7(0x1fb)]['id'],_0x2d7706),deletePushRecovery(_0x49225b[_0x3924c7(0x27e)]),{'action':_0x3924c7(0x195),'journeyId':_0x49225b[_0x3924c7(0x1fb)]['id'],'embeddedSegmentNameToId':_0x916154};}}return deletePushRecovery(_0x49225b['absolutePath']),{'action':_0x3924c7(0x258),'journeyId':_0x49225b['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x916154};}function findSegmentCriteriaLocation(_0x44ba79,_0x559e70){const _0x325dc4=a174_0x32cc05,_0x4cad16=_0x44ba79['stages']||_0x44ba79[_0x325dc4(0x1b1)]?.[0x0]?.['stages']||[];let _0x537b58='entry',_0x1f7a19=_0x559e70;const _0x33c787=_0x44ba79[_0x325dc4(0x1da)]||_0x44ba79['journeys']?.[0x0]?.['goal'];if(_0x33c787?.[_0x325dc4(0x290)]===_0x559e70)return{'stageName':_0x325dc4(0x1da),'criteriaName':_0x33c787[_0x325dc4(0x1bb)]||_0x559e70};_0x13d437:for(const _0x440447 of _0x4cad16){if(_0x440447[_0x325dc4(0x22a)]?.[_0x325dc4(0x290)]===_0x559e70){_0x537b58=_0x440447[_0x325dc4(0x1bb)],_0x1f7a19=_0x440447[_0x325dc4(0x22a)][_0x325dc4(0x1bb)]||_0x559e70;break;}if(_0x440447[_0x325dc4(0x282)])for(const _0x4e0a46 of _0x440447[_0x325dc4(0x282)]){if(_0x4e0a46[_0x325dc4(0x225)]===_0x325dc4(0x278)&&_0x4e0a46['with']?.[_0x325dc4(0x23a)])for(const _0x389412 of _0x4e0a46['with']['branches']){if(_0x389412['segment']===_0x559e70){_0x537b58=_0x440447[_0x325dc4(0x1bb)],_0x1f7a19=_0x389412[_0x325dc4(0x1bb)]||_0x559e70;break _0x13d437;}}}}return{'stageName':_0x537b58,'criteriaName':_0x1f7a19};}async function executeThreeStepJourneyCreate(_0x32ebf7,_0x495e85,_0x4e5dfd,_0x124cfe,_0x1b507d,_0x490a23,_0x144aa8,_0x21abd3){const _0x5ef169=a174_0x32cc05,{activationDefToCreateRequest:_0x3317f4,yamlRuleToApi:_0x543dbb}=_0x21abd3,{pendingEmbeddedSegments:_0x366184,pendingEmbeddedActivations:_0x3a6009,embeddedSegmentNameToId:_0xfd4280}=_0x124cfe,_0x1af048=JSON[_0x5ef169(0x25b)](JSON['stringify'](_0x4e5dfd));ensureJourneyDefaults(_0x1af048['attributes']),stripPendingIds(_0x1af048);const _0x287e93=await _0x32ebf7[_0x5ef169(0x289)][_0x5ef169(0x220)](_0x1af048),_0x14e764=_0x287e93['id'],_0x305206=new Map();for(const _0x5dffee of _0x287e93[_0x5ef169(0x1bf)][_0x5ef169(0x194)]){_0x305206[_0x5ef169(0x1f1)](_0x5dffee[_0x5ef169(0x1bb)]['toLowerCase'](),_0x5dffee['id']);}recoverSegmentIdsFromPushRecovery(_0x495e85,_0xfd4280,_0x490a23[_0x5ef169(0x275)]);for(const [_0xcdcdb2,{definition:_0x2063a7}]of _0x366184){if(_0xfd4280[_0x5ef169(0x1fd)](_0xcdcdb2)){_0x144aa8[_0x5ef169(0x1c3)]?.({'type':_0x5ef169(0x19d),'journeyName':_0x495e85[_0x5ef169(0x1e9)][_0x5ef169(0x1bb)],'segmentName':_0xcdcdb2});continue;}const _0x3001ce=generateDeterministicJourneySegmentName(_0x495e85['yamlConfig']['name'],_0xcdcdb2);_0x144aa8[_0x5ef169(0x1c3)]?.({'type':_0x5ef169(0x270),'journeyName':_0x495e85['yamlConfig'][_0x5ef169(0x1bb)],'segmentName':_0xcdcdb2});const _0x4a60b5=createSegmentIdResolver(_0x490a23[_0x5ef169(0x275)],_0xcdcdb2),_0x4395a3=await resolveRuleSegmentIds(_0x2063a7['rule'],_0x4a60b5),_0x5ef7e2=await createOrRecoverEmbeddedSegment(_0x32ebf7,_0x495e85,{'localName':_0xcdcdb2,'uniqueSegmentName':_0x3001ce,'description':_0x2063a7[_0x5ef169(0x1e1)]||_0x5ef169(0x1e5)+_0xcdcdb2,'journeyId':_0x14e764,'resolvedRule':_0x4395a3,'parentId':_0x1b507d[_0x5ef169(0x1e6)],'folderId':_0x1b507d[_0x5ef169(0x1ac)]||''},_0x543dbb);_0xfd4280[_0x5ef169(0x1f1)](_0xcdcdb2,_0x5ef7e2),_0x490a23[_0x5ef169(0x275)]['set'](_0xcdcdb2,_0x5ef7e2),_0x144aa8['onProgress']?.({'type':'embedded_segment_created','journeyName':_0x495e85[_0x5ef169(0x1e9)][_0x5ef169(0x1bb)],'segmentName':_0xcdcdb2});}const _0x392906=new Map();for(const [_0x448a79,_0x49c4a7]of _0x3a6009){_0x144aa8['onProgress']?.({'type':_0x5ef169(0x1ff),'journeyName':_0x495e85[_0x5ef169(0x1e9)]['name'],'activationName':_0x448a79});const _0x22e954=await _0x3317f4(_0x49c4a7,_0x490a23[_0x5ef169(0x23d)]),_0x9b9c49={..._0x22e954,..._0x49c4a7[_0x5ef169(0x1fc)]!==undefined&&{'runAfterJourneyRefresh':_0x49c4a7[_0x5ef169(0x1fc)]}},_0x426913=await _0x32ebf7[_0x5ef169(0x289)][_0x5ef169(0x299)](_0x14e764,_0x9b9c49);_0x392906[_0x5ef169(0x1f1)](_0x448a79,_0x426913['id']),_0x124cfe[_0x5ef169(0x1c5)][_0x5ef169(0x1f1)](_0x448a79,_0x426913['id']),_0x144aa8[_0x5ef169(0x1c3)]?.({'type':_0x5ef169(0x229),'journeyName':_0x495e85[_0x5ef169(0x1e9)][_0x5ef169(0x1bb)],'activationName':_0x448a79});}const _0x53bb2c=JSON[_0x5ef169(0x25b)](JSON[_0x5ef169(0x1b7)](_0x4e5dfd));return _0x53bb2c['id']=_0x14e764,ensureJourneyDefaults(_0x53bb2c[_0x5ef169(0x1bf)]),resolvePendingIdsInRequest(_0x53bb2c,_0x4e5dfd,_0x305206,_0xfd4280,_0x392906,_0x144aa8),await _0x32ebf7['journey'][_0x5ef169(0x27a)](_0x14e764,_0x53bb2c),deletePushRecovery(_0x495e85['absolutePath']),{'action':_0x5ef169(0x18c),'journeyId':_0x14e764,'embeddedSegmentNameToId':_0xfd4280};}export function stripWaitStepPendingIds(_0x565df5){const _0x13ae0e=a174_0x32cc05,_0x4eba5a=_0x565df5['conditionSegmentId']&&isPendingSegmentId(_0x565df5[_0x13ae0e(0x267)]),_0x442cc2=_0x565df5[_0x13ae0e(0x217)]?.[_0x13ae0e(0x191)](_0x45b86c=>_0x45b86c['segmentId']&&isPendingSegmentId(_0x45b86c[_0x13ae0e(0x200)]));(_0x4eba5a||_0x442cc2)&&(_0x565df5[_0x13ae0e(0x1a6)]=_0x13ae0e(0x21b),_0x565df5[_0x13ae0e(0x19c)]=0x1,_0x565df5[_0x13ae0e(0x243)]=_0x13ae0e(0x1be),delete _0x565df5[_0x13ae0e(0x267)],delete _0x565df5[_0x13ae0e(0x24a)],delete _0x565df5[_0x13ae0e(0x190)],delete _0x565df5[_0x13ae0e(0x217)]);}export function resolveWaitStepPendingIds(_0x242dee,_0x52a48d,_0x4afe7c,_0xf062ae){const _0x331dd1=a174_0x32cc05;if(_0x52a48d[_0x331dd1(0x267)]&&isPendingSegmentId(_0x52a48d[_0x331dd1(0x267)])){const _0x4836ba=_0x4afe7c(_0x52a48d[_0x331dd1(0x267)],_0x331dd1(0x249)+_0xf062ae+_0x331dd1(0x18f));_0x4836ba&&(_0x242dee[_0x331dd1(0x1a6)]=_0x331dd1(0x1a1),_0x242dee[_0x331dd1(0x267)]=_0x4836ba,delete _0x242dee['waitStep'],delete _0x242dee[_0x331dd1(0x243)],_0x52a48d[_0x331dd1(0x24a)]!==undefined&&(_0x242dee[_0x331dd1(0x24a)]=_0x52a48d['conditionTimeoutDuration']),_0x52a48d['conditionTimeoutUnit']&&(_0x242dee['conditionTimeoutUnit']=_0x52a48d[_0x331dd1(0x190)]));}if(_0x52a48d[_0x331dd1(0x217)]){const _0x5a20b0=_0x52a48d[_0x331dd1(0x217)][_0x331dd1(0x191)](_0x4a8dc3=>_0x4a8dc3['segmentId']&&isPendingSegmentId(_0x4a8dc3['segmentId']));if(_0x5a20b0){const _0xa13d1f=_0x52a48d[_0x331dd1(0x217)][_0x331dd1(0x1b4)](_0xaa3dc8=>{const _0x4636e5=_0x331dd1;if(_0xaa3dc8[_0x4636e5(0x200)]&&isPendingSegmentId(_0xaa3dc8['segmentId'])){const _0x3ad4cb=_0x4afe7c(_0xaa3dc8[_0x4636e5(0x200)],'stage\x20\x27'+_0xf062ae+'\x27\x20wait\x20condition');return{..._0xaa3dc8,'segmentId':_0x3ad4cb||_0xaa3dc8[_0x4636e5(0x200)]};}return{..._0xaa3dc8};});_0x242dee['waitStepType']=_0x331dd1(0x1a1),_0x242dee[_0x331dd1(0x217)]=_0xa13d1f,delete _0x242dee[_0x331dd1(0x19c)],delete _0x242dee[_0x331dd1(0x243)],delete _0x242dee[_0x331dd1(0x267)],delete _0x242dee['conditionTimeoutDuration'],delete _0x242dee[_0x331dd1(0x190)];}}}function stripPendingIds(_0x44d3f1){const _0x1ae447=a174_0x32cc05;_0x44d3f1['attributes'][_0x1ae447(0x1da)]?.[_0x1ae447(0x200)]&&isPendingSegmentId(_0x44d3f1[_0x1ae447(0x1bf)]['goal']['segmentId'])&&delete _0x44d3f1['attributes']['goal'];for(const _0x3d1b1a of _0x44d3f1[_0x1ae447(0x1bf)][_0x1ae447(0x194)]||[]){_0x3d1b1a[_0x1ae447(0x268)]?.[_0x1ae447(0x200)]&&isPendingSegmentId(_0x3d1b1a[_0x1ae447(0x268)][_0x1ae447(0x200)])&&delete _0x3d1b1a[_0x1ae447(0x268)];_0x3d1b1a[_0x1ae447(0x277)]?.['segmentId']&&isPendingSegmentId(_0x3d1b1a['milestone'][_0x1ae447(0x200)])&&delete _0x3d1b1a[_0x1ae447(0x277)];_0x3d1b1a[_0x1ae447(0x1e0)]&&(_0x3d1b1a[_0x1ae447(0x1e0)]=_0x3d1b1a[_0x1ae447(0x1e0)]['filter'](_0x5818aa=>!_0x5818aa['segmentId']||!isPendingSegmentId(_0x5818aa['segmentId'])));if(_0x3d1b1a[_0x1ae447(0x282)])for(const _0x4113f8 of Object[_0x1ae447(0x1d4)](_0x3d1b1a[_0x1ae447(0x282)])){const _0x1bfc17=_0x3d1b1a[_0x1ae447(0x282)][_0x4113f8];_0x1bfc17[_0x1ae447(0x225)]===_0x1ae447(0x1f4)&&_0x1bfc17[_0x1ae447(0x27b)]&&isPendingActivationId(_0x1bfc17[_0x1ae447(0x27b)])&&(_0x1bfc17[_0x1ae447(0x27b)]='');if(_0x1bfc17[_0x1ae447(0x225)]===_0x1ae447(0x274)&&_0x1bfc17[_0x1ae447(0x23a)])for(const _0xb74a75 of _0x1bfc17[_0x1ae447(0x23a)]){_0xb74a75[_0x1ae447(0x200)]&&isPendingSegmentId(_0xb74a75['segmentId'])&&(_0xb74a75[_0x1ae447(0x200)]='');}_0x1bfc17[_0x1ae447(0x225)]===_0x1ae447(0x1a8)&&stripWaitStepPendingIds(_0x1bfc17);}}}function resolvePendingIdsInRequest(_0x3619a6,_0x3a862e,_0xd86a2e,_0x30f33e,_0x577393,_0x17d1b7){const _0x4208fb=a174_0x32cc05,_0x1b3321=(_0x31529c,_0xeca886)=>{const _0x561c47=a174_0x1505;if(!isPendingSegmentId(_0x31529c))return _0x31529c;const _0x89ebe1=extractPendingSegmentName(_0x31529c),_0x175178=_0x30f33e['get'](_0x89ebe1);return!_0x175178&&_0x17d1b7[_0x561c47(0x272)]?.(_0x561c47(0x221)+_0x89ebe1+_0x561c47(0x250)+_0xeca886),_0x175178;};if(_0x3619a6[_0x4208fb(0x1bf)][_0x4208fb(0x1da)]?.[_0x4208fb(0x200)]&&isPendingSegmentId(_0x3619a6[_0x4208fb(0x1bf)][_0x4208fb(0x1da)][_0x4208fb(0x200)])){const _0x406545=_0x1b3321(_0x3619a6[_0x4208fb(0x1bf)]['goal'][_0x4208fb(0x200)],_0x4208fb(0x28a));_0x406545&&(_0x3619a6[_0x4208fb(0x1bf)][_0x4208fb(0x1da)][_0x4208fb(0x200)]=_0x406545);}for(const _0x537798 of _0x3619a6['attributes'][_0x4208fb(0x194)]||[]){const _0x15a0e3=_0xd86a2e[_0x4208fb(0x253)](_0x537798[_0x4208fb(0x1bb)]['toLowerCase']());_0x15a0e3&&(_0x537798['id']=_0x15a0e3);if(_0x537798[_0x4208fb(0x268)]?.[_0x4208fb(0x200)]&&isPendingSegmentId(_0x537798[_0x4208fb(0x268)][_0x4208fb(0x200)])){const _0x594883=_0x1b3321(_0x537798[_0x4208fb(0x268)][_0x4208fb(0x200)],_0x4208fb(0x249)+_0x537798[_0x4208fb(0x1bb)]+_0x4208fb(0x1d7));_0x594883&&(_0x537798[_0x4208fb(0x268)][_0x4208fb(0x200)]=_0x594883);}if(_0x537798[_0x4208fb(0x1e0)])for(const _0x1da2f3 of _0x537798[_0x4208fb(0x1e0)]){if(_0x1da2f3[_0x4208fb(0x200)]&&isPendingSegmentId(_0x1da2f3[_0x4208fb(0x200)])){const _0x47e020=_0x1b3321(_0x1da2f3[_0x4208fb(0x200)],_0x4208fb(0x249)+_0x537798[_0x4208fb(0x1bb)]+'\x27\x20exit\x20criteria');_0x47e020&&(_0x1da2f3['segmentId']=_0x47e020);}}if(_0x537798[_0x4208fb(0x277)]?.[_0x4208fb(0x200)]&&isPendingSegmentId(_0x537798[_0x4208fb(0x277)][_0x4208fb(0x200)])){const _0x3be31f=_0x1b3321(_0x537798[_0x4208fb(0x277)][_0x4208fb(0x200)],_0x4208fb(0x249)+_0x537798[_0x4208fb(0x1bb)]+_0x4208fb(0x273));_0x3be31f&&(_0x537798[_0x4208fb(0x277)][_0x4208fb(0x200)]=_0x3be31f);}if(_0x537798[_0x4208fb(0x282)]){const _0x57db63=_0x1650d3=>_0x3a862e[_0x4208fb(0x1bf)][_0x4208fb(0x194)]?.[_0x4208fb(0x257)](_0x2149f0=>_0x2149f0[_0x4208fb(0x1bb)][_0x4208fb(0x252)]()===_0x537798[_0x4208fb(0x1bb)][_0x4208fb(0x252)]())?.[_0x4208fb(0x282)]?.[_0x1650d3];for(const _0x580850 of Object[_0x4208fb(0x1d4)](_0x537798[_0x4208fb(0x282)])){const _0x28d925=_0x537798[_0x4208fb(0x282)][_0x580850],_0x2ca26b=_0x57db63(_0x580850);if(_0x28d925[_0x4208fb(0x225)]===_0x4208fb(0x1f4)&&_0x28d925[_0x4208fb(0x27b)]&&(isPendingActivationId(_0x28d925[_0x4208fb(0x27b)])||_0x28d925[_0x4208fb(0x27b)]==='')){if(_0x2ca26b?.['journeyActivationStepId']&&isPendingActivationId(_0x2ca26b['journeyActivationStepId'])){const _0x377ff7=extractPendingActivationName(_0x2ca26b[_0x4208fb(0x27b)]),_0x36c5e7=_0x577393['get'](_0x377ff7);_0x36c5e7&&(_0x28d925['journeyActivationStepId']=_0x36c5e7);}}if(_0x28d925[_0x4208fb(0x225)]==='DecisionPoint'&&_0x28d925[_0x4208fb(0x23a)]&&_0x2ca26b?.['branches'])for(let _0x39d026=0x0;_0x39d026<_0x28d925[_0x4208fb(0x23a)]['length'];_0x39d026++){const _0x552548=_0x28d925[_0x4208fb(0x23a)][_0x39d026],_0x24be24=_0x2ca26b[_0x4208fb(0x23a)][_0x39d026];if(_0x24be24?.['segmentId']&&isPendingSegmentId(_0x24be24[_0x4208fb(0x200)])){const _0x3f1acd=_0x1b3321(_0x24be24[_0x4208fb(0x200)],_0x4208fb(0x249)+_0x537798[_0x4208fb(0x1bb)]+_0x4208fb(0x199)+(_0x552548['name']||_0x39d026)+'\x27');_0x3f1acd&&(_0x552548[_0x4208fb(0x200)]=_0x3f1acd);}}_0x28d925[_0x4208fb(0x225)]===_0x4208fb(0x1a8)&&_0x2ca26b?.['type']===_0x4208fb(0x1a8)&&resolveWaitStepPendingIds(_0x28d925,_0x2ca26b,_0x1b3321,_0x537798['name']);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1f3985,_0x5ee2b8){const _0x3fd28c=a175_0x28a0,_0x2aa0c3=_0x1f3985();while(!![]){try{const _0x4ef66d=-parseInt(_0x3fd28c(0x1ce))/0x1+parseInt(_0x3fd28c(0x1d2))/0x2*(-parseInt(_0x3fd28c(0x1c3))/0x3)+parseInt(_0x3fd28c(0x1d0))/0x4*(-parseInt(_0x3fd28c(0x1c5))/0x5)+parseInt(_0x3fd28c(0x1c7))/0x6*(parseInt(_0x3fd28c(0x1d3))/0x7)+parseInt(_0x3fd28c(0x1c8))/0x8*(-parseInt(_0x3fd28c(0x1cb))/0x9)+-parseInt(_0x3fd28c(0x1cd))/0xa*(parseInt(_0x3fd28c(0x1c4))/0xb)+parseInt(_0x3fd28c(0x1cf))/0xc*(parseInt(_0x3fd28c(0x1d1))/0xd);if(_0x4ef66d===_0x5ee2b8)break;else _0x2aa0c3['push'](_0x2aa0c3['shift']());}catch(_0x16ed42){_0x2aa0c3['push'](_0x2aa0c3['shift']());}}}(a175_0x5a42,0x72e05));function a175_0x5a42(){const _0x2d2713=['set','243170kpYpCL','94891bEJzLg','1572ACjIBg','16sQYmAx','179764kCYgqS','12EuWOgb','1260609icLpem','name','add','67539macecz','396WKYWkp','517315FIAOVf','get','6qBbCNb','14312XGxEPh','has','parentFolderId','9kHdTpI'];a175_0x5a42=function(){return _0x2d2713;};return a175_0x5a42();}export function buildFolderIdToPathMap(_0x410a2c){const _0x5a31e5=a175_0x28a0,_0x2269ce=new Map(),_0x41d9a0=new Map();for(const _0x3fe9bb of _0x410a2c){_0x41d9a0['set'](_0x3fe9bb['id'],_0x3fe9bb);}const _0x32ac87=new Set();for(const _0x2a2c60 of _0x410a2c){!_0x2a2c60[_0x5a31e5(0x1ca)]&&_0x32ac87[_0x5a31e5(0x1c2)](_0x2a2c60['id']);}function _0x3ce412(_0x46dca3){const _0x40e81b=_0x5a31e5;if(_0x2269ce[_0x40e81b(0x1c9)](_0x46dca3['id']))return _0x2269ce[_0x40e81b(0x1c6)](_0x46dca3['id']);if(_0x32ac87[_0x40e81b(0x1c9)](_0x46dca3['id']))return _0x2269ce[_0x40e81b(0x1cc)](_0x46dca3['id'],''),'';if(_0x46dca3[_0x40e81b(0x1ca)]){const _0x409178=_0x41d9a0['get'](_0x46dca3[_0x40e81b(0x1ca)]);if(_0x409178){const _0x2a4434=_0x3ce412(_0x409178),_0xc10dc2=_0x2a4434?_0x2a4434+'/'+_0x46dca3[_0x40e81b(0x1c1)]:_0x46dca3['name'];return _0x2269ce[_0x40e81b(0x1cc)](_0x46dca3['id'],_0xc10dc2),_0xc10dc2;}}const _0x2bc28e=_0x46dca3['name'];return _0x2269ce[_0x40e81b(0x1cc)](_0x46dca3['id'],_0x2bc28e),_0x2bc28e;}for(const _0x545ca1 of _0x410a2c){_0x3ce412(_0x545ca1);}return _0x2269ce;}export function buildFolderPathToIdMap(_0x4f130f){const _0x26076f=a175_0x28a0,_0x26b197=new Map(),_0x349c37=new Map();for(const _0x43c17c of _0x4f130f){_0x349c37[_0x26076f(0x1cc)](_0x43c17c['id'],_0x43c17c);}const _0x5a2baa=new Set();for(const _0x3c1998 of _0x4f130f){!_0x3c1998['parentFolderId']&&_0x5a2baa[_0x26076f(0x1c2)](_0x3c1998['id']);}function _0x4d684c(_0xd3dfac){const _0x29af79=_0x26076f;if(_0x5a2baa[_0x29af79(0x1c9)](_0xd3dfac['id']))return'';if(_0xd3dfac[_0x29af79(0x1ca)]){const _0x14d957=_0x349c37['get'](_0xd3dfac[_0x29af79(0x1ca)]);if(_0x14d957){const _0x4c02ae=_0x4d684c(_0x14d957);return _0x4c02ae?_0x4c02ae+'/'+_0xd3dfac[_0x29af79(0x1c1)]:_0xd3dfac[_0x29af79(0x1c1)];}}return _0xd3dfac[_0x29af79(0x1c1)];}for(const _0x3f0782 of _0x4f130f){const _0x1132ab=_0x4d684c(_0x3f0782);_0x26b197[_0x26076f(0x1cc)](_0x1132ab,_0x3f0782['id']);}return _0x26b197;}function a175_0x28a0(_0x4f72ea,_0x52b69a){_0x4f72ea=_0x4f72ea-0x1c1;const _0x5a4228=a175_0x5a42();let _0x28a067=_0x5a4228[_0x4f72ea];return _0x28a067;}export function buildFolderMaps(_0x3e184a){const _0x18f7bc=a175_0x28a0,_0x56152d=buildFolderIdToPathMap(_0x3e184a),_0x1fe660=new Map();for(const [_0x4ac7c8,_0x28cd00]of _0x56152d){_0x1fe660[_0x18f7bc(0x1cc)](_0x28cd00,_0x4ac7c8);}return{'idToPath':_0x56152d,'pathToId':_0x1fe660};}export function getFolderPath(_0x498b74,_0x401b22){const _0x206696=a175_0x28a0;if(!_0x498b74)return'';return _0x401b22[_0x206696(0x1c6)](_0x498b74)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d504a,_0x231c5f){const _0x5a4844=a176_0x2b90,_0x5f3ad9=_0x3d504a();while(!![]){try{const _0x2cf8a2=parseInt(_0x5a4844(0x89))/0x1*(-parseInt(_0x5a4844(0xa0))/0x2)+-parseInt(_0x5a4844(0x7b))/0x3*(parseInt(_0x5a4844(0x97))/0x4)+parseInt(_0x5a4844(0x87))/0x5*(parseInt(_0x5a4844(0xa2))/0x6)+parseInt(_0x5a4844(0x83))/0x7*(-parseInt(_0x5a4844(0x9c))/0x8)+parseInt(_0x5a4844(0x77))/0x9*(parseInt(_0x5a4844(0x88))/0xa)+parseInt(_0x5a4844(0x9b))/0xb+parseInt(_0x5a4844(0x85))/0xc*(parseInt(_0x5a4844(0x8a))/0xd);if(_0x2cf8a2===_0x231c5f)break;else _0x5f3ad9['push'](_0x5f3ad9['shift']());}catch(_0x1869b0){_0x5f3ad9['push'](_0x5f3ad9['shift']());}}}(a176_0x3a13,0x91ee1));import a176_0x236478 from'path';import{parse as a176_0x5cf722}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0xfcf982){const _0x3ec210=a176_0x2b90;if(!_0xfcf982||_0xfcf982[_0x3ec210(0x90)]()==='')throw new Error(_0x3ec210(0x91));const _0x438398=_0xfcf982[_0x3ec210(0x90)]();if(_0x438398==='/')return{'segments':[],'isAbsolute':!![],'raw':_0xfcf982};const _0x53a727=_0x438398[_0x3ec210(0x81)]('/')?_0x438398[_0x3ec210(0x94)](0x1):_0x438398,_0x1ade7f=_0x53a727[_0x3ec210(0x9d)]('/')['filter'](_0x254681=>_0x254681!=='');if(_0x1ade7f['length']===0x0)throw new Error(_0x3ec210(0x86));const _0x34fae5=_0x438398[_0x3ec210(0x81)]('/')||!isRelativePathSegment(_0x1ade7f[0x0]);for(const _0x6c198d of _0x1ade7f){validatePathSegment(_0x6c198d);}return{'segments':_0x1ade7f,'isAbsolute':_0x34fae5,'raw':_0xfcf982};}function isRelativePathSegment(_0x579d3b){return _0x579d3b==='.'||_0x579d3b==='..';}function validatePathSegment(_0x424fe1){const _0x251c8a=a176_0x2b90;if(_0x424fe1==='')throw new Error(_0x251c8a(0x8c));if(_0x424fe1==='.'||_0x424fe1==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x424fe1))throw new Error(_0x251c8a(0x8d)+_0x424fe1);if(_0x424fe1!==_0x424fe1['trim']()){}}export function validatePath(_0xfe9a89){const _0xb33ef5=a176_0x2b90;if(_0xfe9a89[_0xb33ef5(0x98)][_0xb33ef5(0x79)]===0x0&&!_0xfe9a89['isAbsolute'])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0xfe9a89[_0xb33ef5(0x8e)]){if(_0xfe9a89[_0xb33ef5(0x98)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x13ad69=0x0;for(const _0x32927c of _0xfe9a89[_0xb33ef5(0x98)]){if(_0x32927c==='..'){if(_0x13ad69===0x0)throw new Error(_0xb33ef5(0x99));_0x13ad69--;}else _0x32927c!=='.'&&_0x13ad69++;}}}export function joinPaths(_0x43e740,_0x3eded6){const _0x2e5ec0=a176_0x2b90;if(!_0x43e740||_0x43e740==='/')return _0x3eded6;if(!_0x3eded6||_0x3eded6==='.')return _0x43e740;if(_0x3eded6[_0x2e5ec0(0x81)]('/'))return _0x3eded6;const _0x2bfbda=parsePath(_0x43e740),_0x104b7f=parsePath(_0x3eded6),_0x61325b=[..._0x2bfbda['segments']];for(const _0x223b94 of _0x104b7f[_0x2e5ec0(0x98)]){if(_0x223b94==='.')continue;else{if(_0x223b94==='..'){if(_0x61325b[_0x2e5ec0(0x79)]===0x0)throw new Error(_0x2e5ec0(0x7f));_0x61325b[_0x2e5ec0(0xa1)]();}else _0x61325b['push'](_0x223b94);}}const _0x2a9f21=_0x61325b[_0x2e5ec0(0x84)]('/');return _0x2bfbda[_0x2e5ec0(0x96)][_0x2e5ec0(0x81)]('/')?'/'+_0x2a9f21:_0x2a9f21;}export function normalizePath(_0x5ea672){const _0x490e9d=a176_0x2b90,_0x5d5228=parsePath(_0x5ea672),_0xb6cf91=[];for(const _0x42ab67 of _0x5d5228[_0x490e9d(0x98)]){if(_0x42ab67==='.')continue;else{if(_0x42ab67==='..'){if(_0xb6cf91['length']===0x0){if(_0x5d5228[_0x490e9d(0x8e)])throw new Error(_0x490e9d(0x7f));_0xb6cf91['push']('..');}else _0xb6cf91[_0xb6cf91[_0x490e9d(0x79)]-0x1]==='..'?_0xb6cf91[_0x490e9d(0xa3)]('..'):_0xb6cf91[_0x490e9d(0xa1)]();}else _0xb6cf91[_0x490e9d(0xa3)](_0x42ab67);}}if(_0xb6cf91['length']===0x0)return _0x5d5228[_0x490e9d(0x8e)]?'/':'.';const _0x4799cf=_0xb6cf91['join']('/');return _0x5d5228['raw'][_0x490e9d(0x81)]('/')?'/'+_0x4799cf:_0x4799cf;}export function getParentPath(_0x2a7cca){const _0x139665=a176_0x2b90,_0x1b6faf=parsePath(_0x2a7cca);if(_0x1b6faf['segments'][_0x139665(0x79)]<=0x1)return'/';const _0x21a320=_0x1b6faf['segments']['slice'](0x0,-0x1)['join']('/');return _0x1b6faf['raw'][_0x139665(0x81)]('/')?'/'+_0x21a320:_0x21a320;}export function getBaseName(_0x188bd8){const _0x3d477a=a176_0x2b90,_0x4240ba=parsePath(_0x188bd8);return _0x4240ba[_0x3d477a(0x98)][_0x4240ba['segments'][_0x3d477a(0x79)]-0x1]||'';}export function isChildPath(_0x2dabfe,_0x2cda3f){const _0xc48cf7=a176_0x2b90,_0x4ed322=parsePath(_0x2dabfe),_0x5b1333=parsePath(_0x2cda3f);if(_0x4ed322[_0xc48cf7(0x98)][_0xc48cf7(0x79)]<=_0x5b1333[_0xc48cf7(0x98)]['length'])return![];for(let _0x2a3f31=0x0;_0x2a3f31<_0x5b1333[_0xc48cf7(0x98)][_0xc48cf7(0x79)];_0x2a3f31++){if(_0x4ed322[_0xc48cf7(0x98)][_0x2a3f31]!==_0x5b1333[_0xc48cf7(0x98)][_0x2a3f31])return![];}return!![];}export function splitPath(_0x1f839b){const _0x13c195=a176_0x2b90,_0xb6048e=parsePath(_0x1f839b);if(_0xb6048e[_0x13c195(0x98)][_0x13c195(0x79)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0xb6048e[_0x13c195(0x98)][_0x13c195(0x79)]===0x1)return{'parent':_0xb6048e['segments'][0x0]};return{'parent':_0xb6048e[_0x13c195(0x98)][0x0],'child':_0xb6048e[_0x13c195(0x98)][_0x13c195(0x80)](0x1)['join']('/')};}export function isYamlFilePath(_0x38f359){const _0x3b5086=a176_0x2b90;return _0x38f359['endsWith'](_0x3b5086(0x8b))||_0x38f359[_0x3b5086(0x95)](_0x3b5086(0x7d));}function a176_0x2b90(_0x2793b4,_0x5291a2){_0x2793b4=_0x2793b4-0x77;const _0x3a13cf=a176_0x3a13();let _0x2b9080=_0x3a13cf[_0x2793b4];return _0x2b9080;}function a176_0x3a13(){const _0x395fb9=['Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','isAbsolute','readFile','trim','Path\x20cannot\x20be\x20empty','File\x20not\x20found:\x20','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','substring','endsWith','raw','28AzFGpm','segments','Path\x20attempts\x20to\x20navigate\x20above\x20root','parent_segment','1379290LYIiqP','508616FgzPLE','split','tdx.json','parse','1633066LBZAdn','pop','24138MpnFZA','push','9WtdycW','No\x20tdx.json\x20found\x20for\x20file:\x20','length','name','449142MZYnUK','replace','.yaml','segment','Cannot\x20navigate\x20above\x20root','slice','startsWith','exists','35UZwlqm','join','3225324imDEwO','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','875fzMOEd','6068450BvfbDp','1BZlpBg','65ypBbkF','.yml','Path\x20segment\x20cannot\x20be\x20empty'];a176_0x3a13=function(){return _0x395fb9;};return a176_0x3a13();}export async function resolveYamlFilePath(_0x9a9de4,_0x581fb0=nodeFileSystem){const _0x50193f=a176_0x2b90,_0x25ad9a=a176_0x236478['resolve'](_0x9a9de4);if(!await _0x581fb0['exists'](_0x25ad9a))throw new Error(_0x50193f(0x92)+_0x9a9de4);let _0xab2b95=a176_0x236478['dirname'](_0x25ad9a),_0x51ff9f=null,_0x479dcb=null;const _0x2f01a9=a176_0x236478['parse'](_0xab2b95)['root'];while(_0xab2b95!==_0x2f01a9){const _0x88de76=a176_0x236478[_0x50193f(0x84)](_0xab2b95,_0x50193f(0x9e));if(await _0x581fb0[_0x50193f(0x82)](_0x88de76)){_0x51ff9f=_0x88de76,_0x479dcb=_0xab2b95;break;}_0xab2b95=a176_0x236478['dirname'](_0xab2b95);}if(!_0x51ff9f||!_0x479dcb)throw new Error(_0x50193f(0x78)+_0x9a9de4+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x1e55d7=await _0x581fb0[_0x50193f(0x8f)](_0x51ff9f),_0x21163d=JSON[_0x50193f(0x9f)](_0x1e55d7),_0x35ca7c=_0x21163d[_0x50193f(0x9a)];if(!_0x35ca7c)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x495693=await _0x581fb0[_0x50193f(0x8f)](_0x25ad9a),_0x4b7aa6=a176_0x5cf722(_0x495693),_0x53277a=_0x4b7aa6[_0x50193f(0x7a)];if(!_0x53277a)throw new Error(_0x50193f(0x93)+_0x9a9de4);const _0x3fca04=isJourneyDef(_0x4b7aa6,_0x25ad9a)?'journey':_0x50193f(0x7e),_0x2197cf=a176_0x236478['relative'](_0x479dcb,_0x25ad9a),_0x30bf06=a176_0x236478['dirname'](_0x2197cf),_0x5734db=_0x30bf06==='.'?'':_0x30bf06[_0x50193f(0x7c)](/\\/g,'/'),_0x45a902=_0x5734db?_0x35ca7c+'/'+_0x5734db+'/'+_0x53277a:_0x35ca7c+'/'+_0x53277a;return{'parentSegment':_0x35ca7c,'segmentName':_0x53277a,'folderPath':_0x5734db,'fullPath':_0x45a902,'resourceType':_0x3fca04,'content':_0x495693};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4823f7,_0x2df6fe){const _0x25847d=a177_0x4731,_0x3221ee=_0x4823f7();while(!![]){try{const _0x1f4ed0=-parseInt(_0x25847d(0x72))/0x1*(-parseInt(_0x25847d(0x6e))/0x2)+-parseInt(_0x25847d(0x69))/0x3+parseInt(_0x25847d(0x68))/0x4+-parseInt(_0x25847d(0x6c))/0x5*(-parseInt(_0x25847d(0x70))/0x6)+-parseInt(_0x25847d(0x6f))/0x7+-parseInt(_0x25847d(0x66))/0x8*(parseInt(_0x25847d(0x67))/0x9)+parseInt(_0x25847d(0x71))/0xa;if(_0x1f4ed0===_0x2df6fe)break;else _0x3221ee['push'](_0x3221ee['shift']());}catch(_0x367ea8){_0x3221ee['push'](_0x3221ee['shift']());}}}(a177_0x386b,0xd51fe));function a177_0x386b(){const _0x1a7ecc=['indexOf','.\x20Child\x20name\x20cannot\x20be\x20empty','213848hrneAe','27GHUNIK','673016JbKHVv','3606753SCuPwa','.\x20Parent\x20name\x20cannot\x20be\x20empty','Invalid\x20segment\x20reference\x20format:\x20','5DlKfAh','substring','4RulrRL','714518bqCxcH','2373402uwiZyM','14101470LocsCE','141754nKyMxQ'];a177_0x386b=function(){return _0x1a7ecc;};return a177_0x386b();}function a177_0x4731(_0x2ef9a1,_0x576f32){_0x2ef9a1=_0x2ef9a1-0x64;const _0x386b07=a177_0x386b();let _0x4731bc=_0x386b07[_0x2ef9a1];return _0x4731bc;}export function parseSegmentRef(_0x49e5c9){const _0x108cc1=a177_0x4731,_0x9e8f3c=_0x49e5c9[_0x108cc1(0x64)]('/');if(_0x9e8f3c===-0x1)return{'parentId':_0x49e5c9};if(_0x9e8f3c===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x49e5c9+_0x108cc1(0x6a));const _0x19e99b=_0x49e5c9[_0x108cc1(0x6d)](0x0,_0x9e8f3c),_0x57ea36=_0x49e5c9[_0x108cc1(0x6d)](_0x9e8f3c+0x1);if(_0x57ea36==='')throw new Error(_0x108cc1(0x6b)+_0x49e5c9+_0x108cc1(0x65));return{'parentId':_0x19e99b,'childId':_0x57ea36};}
|