@treasuredata/tdx 2026.3.21 → 2026.3.23
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/auth-login-command.js +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-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/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-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/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/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/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/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/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/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/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.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/personalization.js +1 -1
- package/dist/sdk/policy.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.js +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.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +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/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.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/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a141_0x39b92e=a141_0x273c;(function(_0x57a756,_0x5e51cc){const _0x2d8732=a141_0x273c,_0x296052=_0x57a756();while(!![]){try{const _0x151e7d=-parseInt(_0x2d8732(0x146))/0x1+-parseInt(_0x2d8732(0x134))/0x2*(-parseInt(_0x2d8732(0x13a))/0x3)+parseInt(_0x2d8732(0x14c))/0x4*(parseInt(_0x2d8732(0x139))/0x5)+-parseInt(_0x2d8732(0x137))/0x6*(-parseInt(_0x2d8732(0x135))/0x7)+-parseInt(_0x2d8732(0x13f))/0x8+parseInt(_0x2d8732(0x13b))/0x9+parseInt(_0x2d8732(0x140))/0xa*(-parseInt(_0x2d8732(0x138))/0xb);if(_0x151e7d===_0x5e51cc)break;else _0x296052['push'](_0x296052['shift']());}catch(_0x364660){_0x296052['push'](_0x296052['shift']());}}}(a141_0x58c4,0x49296));function a141_0x58c4(){const _0x37fba2=['journeyName','parse','.push-recovery.json','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','1928056IUtRsv','tdx.sdk.push-recovery','ENOENT','dirname','segments','9700JoxJPt','21SUxzkH','code','937518DSsQop','3820388ctPPCY','5peEbho','30zEDFdd','3119742LQmBOO','toISOString','debug','.tmp','944480wXmuNJ','10LBdVDA','version','utf-8','warn','string','join','580873PxUzsG','stringify'];a141_0x58c4=function(){return _0x37fba2;};return a141_0x58c4();}import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x1836b7 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a141_0x39b92e(0x130));export function getPushRecoveryPath(_0x53894c){const _0xd700af=a141_0x39b92e,_0x1c4d40=a141_0x1836b7[_0xd700af(0x132)](_0x53894c),_0x406037=a141_0x1836b7['basename'](_0x53894c);return a141_0x1836b7[_0xd700af(0x145)](_0x1c4d40,'.'+_0x406037+_0xd700af(0x14a));}function a141_0x273c(_0x228ef0,_0x3aa800){_0x228ef0=_0x228ef0-0x130;const _0x58c404=a141_0x58c4();let _0x273c90=_0x58c404[_0x228ef0];return _0x273c90;}export function readPushRecovery(_0x5c7d90){const _0x569308=a141_0x39b92e,_0x671145=getPushRecoveryPath(_0x5c7d90);if(!existsSync(_0x671145))return undefined;try{const _0x65dd80=readFileSync(_0x671145,_0x569308(0x142)),_0x3f2a31=JSON[_0x569308(0x149)](_0x65dd80);if(_0x3f2a31?.[_0x569308(0x141)]!==0x1||typeof _0x3f2a31[_0x569308(0x148)]!==_0x569308(0x144))return undefined;return _0x3f2a31;}catch(_0x2154a4){return _0x2154a4 instanceof SyntaxError?logger[_0x569308(0x13d)](_0x569308(0x14b)+_0x2154a4):logger[_0x569308(0x143)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x2154a4),undefined;}}export function writePushRecovery(_0x1c84bb,_0x3075a2){const _0x536f25=a141_0x39b92e,_0xaa5ee6=getPushRecoveryPath(_0x1c84bb),_0x3d1c23=_0xaa5ee6+_0x536f25(0x13e);writeFileSync(_0x3d1c23,JSON[_0x536f25(0x147)](_0x3075a2,null,0x2)+'\x0a','utf-8'),renameSync(_0x3d1c23,_0xaa5ee6);}export function deletePushRecovery(_0x2510ec){const _0x557ceb=a141_0x39b92e,_0x62b188=getPushRecoveryPath(_0x2510ec);try{unlinkSync(_0x62b188);}catch(_0x1c4448){_0x1c4448[_0x557ceb(0x136)]!==_0x557ceb(0x131)&&logger[_0x557ceb(0x13d)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x1c4448);}}export function saveSegmentToPushRecovery(_0x5c16f5,_0xc07eea,_0x57ba64,_0x44bea3){const _0x79c99d=a141_0x39b92e,_0x2588fe=readPushRecovery(_0x5c16f5),_0x6d905a=_0x2588fe?.['journeyName']===_0xc07eea?{..._0x2588fe,'updatedAt':new Date()[_0x79c99d(0x13c)]()}:{'version':0x1,'journeyName':_0xc07eea,'updatedAt':new Date()[_0x79c99d(0x13c)](),'segments':{}};_0x6d905a[_0x79c99d(0x133)][_0x57ba64]=_0x44bea3,writePushRecovery(_0x5c16f5,_0x6d905a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a142_0x5a51=a142_0x42c6;(function(_0x4f7c7d,_0x492334){const _0xda4d1d=a142_0x42c6,_0x541bb6=_0x4f7c7d();while(!![]){try{const _0x522e54=parseInt(_0xda4d1d(0x181))/0x1*(parseInt(_0xda4d1d(0xff))/0x2)+-parseInt(_0xda4d1d(0x14f))/0x3*(parseInt(_0xda4d1d(0x14c))/0x4)+parseInt(_0xda4d1d(0x92))/0x5*(parseInt(_0xda4d1d(0x132))/0x6)+-parseInt(_0xda4d1d(0x13e))/0x7+-parseInt(_0xda4d1d(0xb9))/0x8+-parseInt(_0xda4d1d(0x9e))/0x9*(parseInt(_0xda4d1d(0xbd))/0xa)+-parseInt(_0xda4d1d(0x10d))/0xb*(-parseInt(_0xda4d1d(0xa0))/0xc);if(_0x522e54===_0x492334)break;else _0x541bb6['push'](_0x541bb6['shift']());}catch(_0x2faf8b){_0x541bb6['push'](_0x541bb6['shift']());}}}(a142_0x2daf,0x63b1e));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a142_0x5a51(0x119);export const PENDING_ACTIVATION_PREFIX=a142_0x5a51(0x109);export function createPendingSegmentId(_0x571aae){return''+PENDING_SEGMENT_PREFIX+_0x571aae+'__';}export function isPendingSegmentId(_0xe3897f){const _0x2dde29=a142_0x5a51;return _0xe3897f[_0x2dde29(0x129)](PENDING_SEGMENT_PREFIX)&&!_0xe3897f['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x5e6e5a){const _0x10e9f1=a142_0x5a51;return _0x5e6e5a[_0x10e9f1(0xb8)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5cf379){return''+PENDING_ACTIVATION_PREFIX+_0x5cf379+'__';}export function isPendingActivationId(_0x407f34){const _0x2fb25c=a142_0x5a51;return _0x407f34[_0x2fb25c(0x129)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x2ac047){const _0x18bef9=a142_0x5a51;return _0x2ac047[_0x18bef9(0xb8)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5eb90a,_0x5c7cb3){const _0x1c635e=a142_0x5a51,_0x1e53fc=_0x5eb90a+'::'+(_0x5c7cb3[_0x1c635e(0xc7)]()||_0x1c635e(0xf2)),_0x47ddcf=createHash(_0x1c635e(0x147))[_0x1c635e(0x17b)](_0x1e53fc)[_0x1c635e(0x12c)](_0x1c635e(0xca))['slice'](0x0,0xc);return _0x1c635e(0x174)+_0x47ddcf;}export function ensureJourneyDefaults(_0xacaa0d){const _0x1d8834=a142_0x5a51;!_0xacaa0d[_0x1d8834(0x167)]&&(_0xacaa0d['description']=''),!_0xacaa0d[_0x1d8834(0xb3)]&&(_0xacaa0d[_0x1d8834(0xb3)]=_0x1d8834(0x162));}export function injectExistingStageIds(_0x2a7484,_0x3873ca){const _0x34f5a9=a142_0x5a51,_0x14a6d2=new Map(_0x3873ca[_0x34f5a9(0xc1)](_0xf2cce8=>[_0xf2cce8[_0x34f5a9(0x8c)],_0xf2cce8['id']]));for(const _0x1f613e of _0x2a7484){if(!_0x1f613e['id']){const _0x217cc6=_0x14a6d2[_0x34f5a9(0x185)](_0x1f613e[_0x34f5a9(0x8c)]);_0x217cc6&&(_0x1f613e['id']=_0x217cc6);}}}export function resolveTDFolderPath(_0x106fba,_0x5cd35a,_0x253cdb){const _0x29695f=a142_0x5a51;if(!_0x5cd35a)return _0x106fba;if(_0x106fba===_0x253cdb||_0x106fba[_0x29695f(0x129)](_0x253cdb+'/'))return _0x106fba;return _0x106fba?_0x253cdb+'/'+_0x106fba:_0x253cdb;}export function addFoldersToCreate(_0x446c09,_0x51664b,_0x956fa2){const _0x415031=a142_0x5a51;if(!_0x446c09)return;if(_0x51664b[_0x415031(0xd3)](_0x446c09))return;const _0x65c4ee=_0x446c09[_0x415031(0x8d)]('/');let _0xc241ac='';for(const _0x24e110 of _0x65c4ee){_0xc241ac=_0xc241ac?_0xc241ac+'/'+_0x24e110:_0x24e110,!_0x51664b[_0x415031(0xd3)](_0xc241ac)&&_0x956fa2['add'](_0xc241ac);}}export function sortFoldersByDepth(_0x10ed1c){return[..._0x10ed1c]['sort']((_0x6cbd6e,_0x28a7eb)=>{const _0x445b88=a142_0x42c6,_0x2697ef=(_0x6cbd6e[_0x445b88(0x16d)](/\//g)||[])['length'],_0x58c146=(_0x28a7eb[_0x445b88(0x16d)](/\//g)||[])['length'];return _0x2697ef-_0x58c146;});}import*as a142_0x5a9249 from'yaml';import{readFileSync}from'fs';import a142_0x5c3462 from'path';import{isJourneyDef,parseYamlString as a142_0x2514e4,toYamlString as a142_0x2aac63,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(_0x4dd403){const _0x1a36b7=a142_0x5a51;if(Array[_0x1a36b7(0x15e)](_0x4dd403))return'['+_0x4dd403[_0x1a36b7(0xc1)](_0x431089=>stableStringify(_0x431089))['join'](',')+']';if(_0x4dd403&&typeof _0x4dd403===_0x1a36b7(0xd0)){const _0x35dba4=_0x4dd403,_0x3ee925=Object[_0x1a36b7(0x10b)](_0x35dba4)[_0x1a36b7(0xfd)](),_0x8280f5=_0x3ee925[_0x1a36b7(0xc1)](_0x3d65b4=>'\x22'+_0x3d65b4+'\x22:'+stableStringify(_0x35dba4[_0x3d65b4]));return'{'+_0x8280f5['join'](',')+'}';}const _0x1032a3=JSON[_0x1a36b7(0x183)](_0x4dd403);return _0x1032a3===undefined?_0x1a36b7(0x111):_0x1032a3;}function a142_0x2daf(){const _0x22b846=['entryCriteria','size','waitStepUnit','logDeleted','delete','Creating\x20segment\x20\x27','folderPath','conditions','__pending_act_','DecisionPoint','keys','updateSegmentById','8708271EXvhWK','\x20error(s)','and\x20the\x20server\x20segment,\x20then\x20retry.','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','null','rootFolderId','Embedded\x20segment\x20\x27','./journey-yaml.js','withProgress','folderPathToId','\x27\x20decision\x20point\x20branch\x20\x27','activation_deleting','__pending_','journeyActivationStepId','activationActions','getLatestJourneyId','logSuccess','localName','logInfo','absolutePath','results','Deleted\x20segment\x20\x27','waitStepType','yamlConfig','stages','all','Entry\x20criteria:\x20','versionNumber','startsWith','./child-segment-yaml.js','includes','digest','list','Created\x20folder\x20\x27','journeyName','user','parentFolder','2231004yWDoOU','Created\x20activation\x20\x27','connection','connectionIdToNameMap','createActivation','toISOString','conditionSegmentId','existingJourney','parentSegmentFolder','Condition','utf-8','entry_criteria','4219999DhvmHz','Created\x20segment\x20\x27','Fetching\x20','schedule','activation_','create','goal\x20criteria','\x20journey\x20from\x20file:\x20','ACTIVATION_UPDATE_ERROR','sha1','WaitStep','data','journeys','journey_creating','2414176vZNzud','SEGMENT_UPDATE_ERROR','fetchJourney','3CWzNbb','Created\x20journey\x20\x27','segmentNameToId','\x27\x20from\x20file:\x20','verbose','add','filter','set','getJourney','connector_config','Journey\x20\x27','entries','stage\x20\x27','Updated\x20activation\x20\x27','parseDocument','isArray','journeyStages',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','getSegment\x20failed\x20for\x20','draft','relationships','journey','getSegment','journeyBundlesByFolderAndName','description','exitCriterias','segmentByFolderAndName','embedded_segment_creating','\x20segment\x20from\x20file:\x20','find','match','toLowerCase','segment_creating','activationParams','conditionTimeoutUnit','\x20(referenced\x20in\x20journey\x20','push','journey_entry_criteria_','with','rule','waitStep','Activation','yamlActivation','idToEmailMap','update','uniqueServerName','activations','diff','existingSegments','Updating\x20activation\x20\x27','86iLMDwO','Updating\x20segment\x20\x27','stringify','decision_point','get','debug','branches','listActivations','relative','createdSegmentId','activation_template_id','folder_creating','../../utils/async.js','activationContext','uniqueSegmentName','effectiveFolderId','isNew','JOURNEY_UPDATE_ERROR','all_columns','name','split','NOT_FOUND','segmentFolderId',').\x20','activation_updating','5HXzHcV','kind','validatedRequest','segmentId','folder','from','Segment\x20not\x20found','embedded_activation_created','Delete\x20the\x20push\x20recovery\x20file\x20(','INTERNAL','goal','columns','382131UEGkeJ','idToName','24xZpFZK','message','type','existingSegment','max','deleteSegment','run_after_journey_refresh','embedded_segment_created','created','Creating\x20activation\x20\x27','journeyId','\x27\x20by\x20rule\x20content','journey_created','onProgress','action','embeddedSegmentNameToId','entry','createSegment','nameToType','state','\x27\x20exit\x20criteria','existingActivation','resolvedRule','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','replace','51008cyzuMV','steps','\x27...','logWarning','170eMwCam','reduce','SEGMENT_SYNTAX_ERROR','\x27\x20to\x20local\x20\x27','map','some','parse','\x0a\x20\x20','createJourneySegment','attributes','trim','Creating\x20folder\x20\x27','\x27\x20entry\x20criteria','hex','folderId','toString','join','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','notification','object','journeyBundleName','\x27\x20for\x20','has','segments','Deleting\x20activation\x20\x27','deleteActivation','updateActivation','createdSegmentIds','\x20activation\x20\x27','JOURNEY_SYNTAX_ERROR','behavior','folder_created','resolveSegment','updated','errors','Matched\x20server\x20segment\x20\x27','\x27\x20not\x20found\x20in\x20journey\x20\x27','segment_deleting','hasChanges','activation_updated','createFolder','SEGMENT_NOT_FOUND','\x27\x20wait\x20condition','unchanged','Deleted\x20activation\x20\x27','journeyById','milestone','length','Failed\x20to\x20','parentId','deleted','conditionTimeoutDuration','progress','segment','index','activationsBySegmentId','Segment\x20not\x20found:\x20','slice','day','activationStepsById','segment_updated','Activation\x20not\x20found:\x20','journeyBundleId','resolveJourneyId','sort','deps','9018ftAwMo','Name\x20has\x20already\x20been\x20taken'];a142_0x2daf=function(){return _0x22b846;};return a142_0x2daf();}function activationSignature(_0x9d2209){const _0x3bdefc=a142_0x5a51,_0xde05c9={'connection':_0x9d2209[_0x3bdefc(0x134)],..._0x9d2209[_0x3bdefc(0x8b)]!==undefined&&{'all_columns':_0x9d2209[_0x3bdefc(0x8b)]},..._0x9d2209[_0x3bdefc(0x9d)]!==undefined&&{'columns':_0x9d2209[_0x3bdefc(0x9d)]},..._0x9d2209[_0x3bdefc(0xdb)]!==undefined&&{'behavior':_0x9d2209[_0x3bdefc(0xdb)]},..._0x9d2209[_0x3bdefc(0x141)]!==undefined&&{'schedule':_0x9d2209[_0x3bdefc(0x141)]},..._0x9d2209[_0x3bdefc(0xcf)]!==undefined&&{'notification':_0x9d2209['notification']},..._0x9d2209[_0x3bdefc(0x158)]!==undefined&&{'connector_config':_0x9d2209['connector_config']},..._0x9d2209['activation_template_id']!==undefined&&{'activation_template_id':_0x9d2209[_0x3bdefc(0x83)]}};return stableStringify(_0xde05c9);}async function fetchSegment(_0x1a7eeb,_0x3098e9,_0x2a4565,_0x116a4b){const _0xb4bc97=a142_0x5a51,_0x84db7b=_0x116a4b?.[_0xb4bc97(0x16c)](_0x36c889=>_0x36c889['id']===_0x2a4565);if(_0x84db7b)return _0x84db7b;try{return await _0x1a7eeb['segment'][_0xb4bc97(0x165)](_0x3098e9,_0x2a4565);}catch(_0x5bc1cd){logger[_0xb4bc97(0x186)](_0xb4bc97(0x161)+_0x2a4565+_0xb4bc97(0x160)+_0x5bc1cd);try{return await _0x1a7eeb['segment']['getSegmentEntity'](_0x2a4565);}catch(_0x59b8c8){return logger['debug']('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x2a4565+':\x20'+_0x59b8c8),null;}}}function recoverSegmentIdsFromPushRecovery(_0x6cf4cb,_0x175c77,_0x538fed){const _0x42d519=a142_0x5a51,_0x136ec0=readPushRecovery(_0x6cf4cb[_0x42d519(0x120)]);if(_0x136ec0?.[_0x42d519(0x12f)]===_0x6cf4cb['yamlConfig']['name'])for(const [_0x485e3c,_0x236717]of Object[_0x42d519(0x15a)](_0x136ec0[_0x42d519(0xd4)])){const _0xaf0685=generateDeterministicJourneySegmentName(_0x6cf4cb['yamlConfig'][_0x42d519(0x8c)],_0x485e3c);_0x236717[_0x42d519(0x17c)]===_0xaf0685&&(_0x175c77[_0x42d519(0x156)](_0x485e3c,_0x236717[_0x42d519(0x95)]),_0x538fed[_0x42d519(0x156)](_0x485e3c,_0x236717[_0x42d519(0x95)]));}}async function createOrRecoverEmbeddedSegment(_0x419d,_0x1accc7,_0x490373,_0x526675){const _0x3127f1=a142_0x5a51;let _0x12cb44;try{_0x12cb44=await _0x419d['segment'][_0x3127f1(0xc5)]({'name':_0x490373[_0x3127f1(0x87)],'description':_0x490373[_0x3127f1(0x167)],'journeyId':_0x490373[_0x3127f1(0xaa)],'rule':_0x526675(_0x490373[_0x3127f1(0xb6)],!![]),'countPopulation':!![],'parentFolderId':_0x490373['folderId'],'audienceId':_0x490373['parentId']});}catch(_0x27d38b){const _0x159602=_0x27d38b instanceof Error&&_0x27d38b[_0x3127f1(0xa1)][_0x3127f1(0x12b)](_0x3127f1(0x100));if(_0x159602){const _0x2ed4d7=readPushRecovery(_0x1accc7[_0x3127f1(0x120)]),_0x400b64=_0x2ed4d7?.['journeyName']===_0x1accc7[_0x3127f1(0x124)]['name']?_0x2ed4d7[_0x3127f1(0xd4)][_0x490373[_0x3127f1(0x11e)]]:undefined;if(_0x400b64?.[_0x3127f1(0x17c)]===_0x490373[_0x3127f1(0x87)])await _0x419d[_0x3127f1(0xf2)]['updateSegmentById'](_0x490373[_0x3127f1(0xee)],_0x400b64['segmentId'],{'description':_0x490373[_0x3127f1(0x167)],'rule':_0x526675(_0x490373[_0x3127f1(0xb6)],!![]),'countPopulation':!![]}),_0x12cb44=_0x400b64['segmentId'];else throw new SDKError(ErrorCode[_0x3127f1(0x14d)],_0x3127f1(0x113)+_0x490373[_0x3127f1(0x11e)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x3127f1(0x9a)+_0x1accc7[_0x3127f1(0x120)][_0x3127f1(0xb8)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x3127f1(0x10f),_0x27d38b);}else throw _0x27d38b;}return saveSegmentToPushRecovery(_0x1accc7[_0x3127f1(0x120)],_0x1accc7[_0x3127f1(0x124)][_0x3127f1(0x8c)],_0x490373['localName'],{'segmentId':_0x12cb44,'uniqueServerName':_0x490373[_0x3127f1(0x87)],'createdAt':new Date()[_0x3127f1(0x137)]()}),_0x12cb44;}export async function prepareSegmentFiles(_0x248ccb,_0x3210ec,_0x8f86db,_0x5aa599,_0xbceed9){const _0x98d691=a142_0x5a51,{activationDefToCreateRequest:_0x2dd52a}=await import('./child-segment-yaml.js'),_0x141c02=[],_0xa367d2=new Set();for(const {yamlConfig:_0x3b76be,folderPath:_0x21c546,sourcePath:_0xbd6f2c}of _0x248ccb){const _0x32c3ba=resolveTDFolderPath(_0x21c546,_0x5aa599,_0xbceed9),_0x58c44e=_0x32c3ba+':'+_0x3b76be['name'],_0x5519db=_0x3210ec[_0x98d691(0x169)]['get'](_0x58c44e),_0x32cbc3=_0x5519db?_0x3210ec[_0x98d691(0xf4)][_0x98d691(0x185)](_0x5519db['id'])||[]:[];addFoldersToCreate(_0x32c3ba,_0x3210ec[_0x98d691(0x116)],_0xa367d2);const _0x582e2b=calculateActivationActions(_0x3b76be['activations']||[],_0x32cbc3,_0x3210ec['idToEmailMap'],_0x3210ec[_0x98d691(0x135)]);for(const _0x49da54 of _0x582e2b){(_0x49da54[_0x98d691(0xa2)]==='create'||_0x49da54[_0x98d691(0xa2)]===_0x98d691(0x17b))&&_0x49da54[_0x98d691(0x179)]&&(_0x49da54[_0x98d691(0x94)]=await _0x2dd52a(_0x49da54[_0x98d691(0x179)],_0x8f86db));}const _0x538900=calculateSegmentDiff(_0x3b76be,_0x5519db,_0x32cbc3,_0x3210ec[_0x98d691(0x17a)],_0x3210ec[_0x98d691(0x135)]);_0x141c02[_0x98d691(0x173)]({'relativePath':_0x3b76be['name'],'absolutePath':_0xbd6f2c,'yamlConfig':_0x3b76be,'folderPath':_0x32c3ba,'existingSegment':_0x5519db,'existingActivations':_0x32cbc3,'isNew':_0x538900['isNew'],'hasChanges':_0x538900[_0x98d691(0xe3)],'diff':_0x538900[_0x98d691(0x17e)],'activationActions':_0x582e2b});}return{'segmentFiles':_0x141c02,'foldersToCreate':_0xa367d2};}export async function prepareJourneyFiles(_0xdcc3ad,_0x24774c,_0x1d0534,_0x36fd06){const _0x49665d=a142_0x5a51,_0x247da6=[],_0x6a6ae0=new Set();for(const {yamlConfig:_0x7ecf54,folderPath:_0xff617a,sourcePath:_0x3f3864}of _0xdcc3ad){const _0x1ebe11=resolveTDFolderPath(_0xff617a,_0x1d0534,_0x36fd06),_0x1fe15c=_0x1ebe11+':'+_0x7ecf54[_0x49665d(0x8c)],_0x132e30=_0x24774c[_0x49665d(0x166)][_0x49665d(0x185)](_0x1fe15c);let _0x1b8802,_0x5ada81;if(_0x132e30&&_0x132e30['length']>0x0){const _0x4c4a9b=buildLocalExpandedRuleMappings(_0x7ecf54),{createYamlContext:_0xd33cfa,prefetchJourneySegments:_0x299850}=createPushYamlContextForBundle(_0x24774c[_0x49665d(0xfe)],_0x24774c[_0x49665d(0xee)],_0x24774c[_0x49665d(0x17f)],_0x4c4a9b,_0x24774c[_0x49665d(0x17a)],_0x24774c[_0x49665d(0x135)],_0x24774c[_0x49665d(0xf8)],_0x24774c[_0x49665d(0xea)]);await _0x299850(_0x132e30[_0x49665d(0xc1)](_0x2422d6=>_0x2422d6['id']));const _0x4fa8d8=await _0x24774c['deps'][_0x49665d(0x164)][_0x49665d(0x11c)](_0x132e30[0x0][_0x49665d(0xfb)]),_0x904231=hasMultipleVersions(_0x7ecf54),_0x10166d=async _0x5b1c6b=>{const _0x5bdad8=_0x49665d,_0x238b39=_0x24774c['journeyById']?.[_0x5bdad8(0x185)](_0x5b1c6b);if(_0x238b39)return _0x238b39;return _0x24774c[_0x5bdad8(0x14e)]({'journeyId':_0x5b1c6b,'journeyName':_0x7ecf54['name'],'isMultiVersion':_0x132e30['length']>0x1});};if(_0x904231&&_0x132e30[_0x49665d(0xec)]>0x1){const _0x38180b=[];for(const _0x54d2cb of _0x132e30){const _0x5b7290=_0x54d2cb[_0x49665d(0x128)]||0x1;_0x24774c[_0x49665d(0xf1)]?.['update'](_0x49665d(0x140)+_0x7ecf54['name']+'\x20v'+_0x5b7290);const _0x3e9c88=await _0x10166d(_0x54d2cb['id']),_0x40b70e=_0xd33cfa(_0x54d2cb['id']),_0x3a2faf=await journeyResponseToDef(_0x3e9c88,_0x40b70e);_0x38180b[_0x49665d(0x173)]({'item':_0x54d2cb,'yaml':_0x3a2faf});}const _0x150bb0=buildLocalRuleToNameMappingFromJourney(_0x7ecf54);_0x5ada81=buildMergedJourneyDef(_0x38180b,_0x150bb0,_0x4fa8d8);const _0x985fdf=Math[_0x49665d(0xa4)](..._0x38180b[_0x49665d(0xc1)](_0x3f2cd6=>_0x3f2cd6['item']['versionNumber']||0x0)),_0x30ce47=_0x132e30[_0x49665d(0x16c)](_0x5ce3fc=>(_0x5ce3fc[_0x49665d(0x128)]||0x0)===_0x985fdf);_0x30ce47&&(_0x24774c[_0x49665d(0xf1)]?.[_0x49665d(0x17b)](_0x49665d(0x140)+_0x7ecf54[_0x49665d(0x8c)]+'\x20v'+_0x985fdf),_0x1b8802=await _0x10166d(_0x30ce47['id']));}else{const _0x4a6e26=_0x132e30[_0x132e30[_0x49665d(0xec)]-0x1];_0x24774c['progress']?.['update'](_0x49665d(0x140)+_0x7ecf54[_0x49665d(0x8c)]),_0x1b8802=await _0x10166d(_0x4a6e26['id']);const _0x297004=_0xd33cfa(_0x4a6e26['id']),_0x2324ec=await journeyResponseToDef(_0x1b8802,_0x297004),_0x2ad8b2=buildLocalRuleToNameMappingFromJourney(_0x7ecf54);_0x5ada81=buildMergedJourneyDef([{'item':_0x4a6e26,'yaml':_0x2324ec}],_0x2ad8b2,_0x4fa8d8);}}addFoldersToCreate(_0x1ebe11,_0x24774c[_0x49665d(0x116)],_0x6a6ae0);const _0x8d7cba=calculateJourneyDiff(_0x7ecf54,_0x5ada81);_0x247da6[_0x49665d(0x173)]({'relativePath':_0x7ecf54[_0x49665d(0x8c)],'absolutePath':_0x3f3864,'yamlConfig':_0x7ecf54,'folderPath':_0x1ebe11,'existingJourney':_0x1b8802,'isNew':_0x8d7cba[_0x49665d(0x89)],'hasChanges':_0x8d7cba[_0x49665d(0xe3)],'diff':_0x8d7cba[_0x49665d(0x17e)]});}return{'journeyFiles':_0x247da6,'foldersToCreate':_0x6a6ae0};}export function calculateActivationActions(_0x58f71e,_0x304efd,_0x5e2ba1,_0xce5716){const _0x5315b4=a142_0x5a51,_0x9ce64e=[],_0xb9684f=new Map();for(const _0x752462 of _0x304efd){_0xb9684f['set'](_0x752462['name'],_0x752462);}const _0x1be4d6=new Map();for(const _0x1f5083 of _0x58f71e){_0x1be4d6[_0x5315b4(0x156)](_0x1f5083[_0x5315b4(0x8c)],_0x1f5083);}for(const _0xb8f9cb of _0x58f71e){const _0x42f0c1=_0xb9684f[_0x5315b4(0x185)](_0xb8f9cb[_0x5315b4(0x8c)]);if(!_0x42f0c1)_0x9ce64e[_0x5315b4(0x173)]({'type':_0x5315b4(0x143),'name':_0xb8f9cb[_0x5315b4(0x8c)],'yamlActivation':_0xb8f9cb});else{const _0x4804c4=activationResponseToDef(_0x42f0c1,_0x5e2ba1,_0xce5716),_0x13b3ef=a142_0x5a9249[_0x5315b4(0x183)](_0x4804c4),_0x3c9cc7=a142_0x5a9249['stringify'](_0xb8f9cb);_0x13b3ef!==_0x3c9cc7&&_0x9ce64e['push']({'type':_0x5315b4(0x17b),'name':_0xb8f9cb['name'],'yamlActivation':_0xb8f9cb,'existingActivation':_0x42f0c1});}}for(const _0x1a33c0 of _0x304efd){!_0x1be4d6[_0x5315b4(0xd3)](_0x1a33c0[_0x5315b4(0x8c)])&&_0x9ce64e[_0x5315b4(0x173)]({'type':_0x5315b4(0x105),'name':_0x1a33c0['name'],'existingActivation':_0x1a33c0});}return _0x9ce64e;}function calculateYamlDiff(_0x990951,_0x32152b){if(_0x32152b){const _0x5390c9=generateDiff(_0x32152b,_0x990951),_0x42f6eb=hasChanges(_0x5390c9);return{'isNew':![],'hasChanges':_0x42f6eb,'diff':_0x42f6eb?formatDiffWithColors(_0x5390c9):undefined};}const _0x11ccf4=generateDiff('',_0x990951);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x11ccf4)};}export function calculateSegmentDiff(_0x82deb1,_0x2cc9d9,_0x14033a,_0x193315,_0x5b9939){const _0x166968=segmentToYamlString(_0x82deb1),_0x3959b8=_0x2cc9d9?segmentToYamlString(segmentWithActivationsToYaml(_0x2cc9d9,_0x14033a,undefined,_0x193315,_0x5b9939)):undefined;return calculateYamlDiff(_0x166968,_0x3959b8);}export function calculateJourneyDiff(_0x3493d3,_0xf77c54){const _0x505d4d=normalizeJourneyDef(_0x3493d3,_0x3493d3),_0x5e2317=a142_0x2aac63(_0x505d4d),_0x339e11=_0xf77c54?a142_0x2aac63(normalizeJourneyDef(_0xf77c54,_0x3493d3)):undefined;return calculateYamlDiff(_0x5e2317,_0x339e11);}export function findSegmentsToDelete(_0xdff48f,_0x394a0c,_0x1ace6f,_0x39cf7c,_0x5afa30){const _0x139aa8=a142_0x5a51,_0x40e83f=new Set();for(const {yamlConfig:_0x4797aa,folderPath:_0x3e8821}of _0x394a0c){_0x40e83f[_0x139aa8(0x154)](_0x3e8821+':'+_0x4797aa[_0x139aa8(0x8c)]);}return _0xdff48f[_0x139aa8(0x155)](_0x58d4ca=>{const _0x525887=_0x139aa8,_0x1a2875=_0x58d4ca['segmentFolderId']?_0x1ace6f['get'](_0x58d4ca[_0x525887(0x8f)][_0x525887(0xcc)]())||'':'',_0x31595a=_0x1a2875+':'+_0x58d4ca[_0x525887(0x8c)];if(_0x40e83f[_0x525887(0xd3)](_0x31595a))return![];if(_0x5afa30)return _0x1a2875===_0x39cf7c||_0x1a2875['startsWith'](_0x39cf7c+'/');return!![];});}export function findJourneysToDelete(_0x5cf46d,_0x2fdc54,_0x391d8f,_0x3cfb42,_0x3ec681){const _0x34aa71=a142_0x5a51,_0x32bd82=new Set();for(const {yamlConfig:_0x6ad753,folderPath:_0x312f17}of _0x2fdc54){_0x32bd82['add'](_0x312f17+':'+_0x6ad753[_0x34aa71(0x8c)]);}return _0x5cf46d[_0x34aa71(0x155)](_0x2842a0=>{const _0x2a6800=_0x34aa71,_0x4b1a91=_0x2842a0[_0x2a6800(0xcb)]?_0x391d8f[_0x2a6800(0x185)](_0x2842a0[_0x2a6800(0xcb)])||'':'',_0xa0abe3=_0x4b1a91+':'+_0x2842a0[_0x2a6800(0xd1)];if(_0x32bd82['has'](_0xa0abe3))return![];if(_0x3ec681)return _0x4b1a91===_0x3cfb42||_0x4b1a91[_0x2a6800(0x129)](_0x3cfb42+'/');return!![];});}export function buildSegmentLookupMap(_0xf46b00,_0x4676a0){const _0x298632=a142_0x5a51,_0x4b4585=new Map();for(const _0x85f7de of _0xf46b00){const _0xdb7018=_0x85f7de[_0x298632(0x8f)]?_0x4676a0[_0x298632(0x185)](_0x85f7de[_0x298632(0x8f)][_0x298632(0xcc)]())||'':'',_0x5c8cd8=_0xdb7018+':'+_0x85f7de[_0x298632(0x8c)];_0x4b4585['set'](_0x5c8cd8,_0x85f7de);}return _0x4b4585;}export function buildSegmentNameToIdMap(_0x9dd6d4){const _0x5e9b44=a142_0x5a51,_0x36f095=new Map();for(const _0x27bfda of _0x9dd6d4){_0x36f095[_0x5e9b44(0x156)](_0x27bfda['name'],_0x27bfda['id']);}return _0x36f095;}export function buildJourneyBundleLookupMap(_0x3d4565,_0x99f2d3){const _0x2499c7=a142_0x5a51,_0x4b2076=new Map();for(const _0x1d7805 of _0x3d4565){const _0x4ad5b8=_0x1d7805[_0x2499c7(0xcb)]?_0x99f2d3[_0x2499c7(0x185)](_0x1d7805[_0x2499c7(0xcb)])||'':'',_0x324052=_0x4ad5b8+':'+_0x1d7805[_0x2499c7(0xd1)];!_0x4b2076['has'](_0x324052)&&_0x4b2076[_0x2499c7(0x156)](_0x324052,[]),_0x4b2076[_0x2499c7(0x185)](_0x324052)[_0x2499c7(0x173)](_0x1d7805);}for(const _0x52d521 of _0x4b2076['values']()){_0x52d521[_0x2499c7(0xfd)]((_0x2d8a81,_0x38a98c)=>(_0x2d8a81[_0x2499c7(0x128)]||0x0)-(_0x38a98c[_0x2499c7(0x128)]||0x0));}return _0x4b2076;}function a142_0x42c6(_0x3718ef,_0x5ef35c){_0x3718ef=_0x3718ef-0x80;const _0x2daf34=a142_0x2daf();let _0x42c6d8=_0x2daf34[_0x3718ef];return _0x42c6d8;}export function collectFoldersToCreate(_0x3dcd06,_0x52fcb5){const _0x1496fd=a142_0x5a51,_0x5959bf=new Set();for(const _0x3d1409 of _0x3dcd06){if(!_0x3d1409)continue;if(_0x52fcb5[_0x1496fd(0xd3)](_0x3d1409))continue;const _0x53a0f3=_0x3d1409[_0x1496fd(0x8d)]('/');let _0x44c4e6='';for(const _0xbcceab of _0x53a0f3){_0x44c4e6=_0x44c4e6?_0x44c4e6+'/'+_0xbcceab:_0xbcceab,!_0x52fcb5[_0x1496fd(0xd3)](_0x44c4e6)&&_0x5959bf[_0x1496fd(0x154)](_0x44c4e6);}}return _0x5959bf;}export function parseAndClassifyYamlFiles(_0x4a0a44,_0xeafc1a,_0x3a8f93){const _0x19affd=a142_0x5a51,_0x160204=[],_0x3b4ac4=[];for(const _0x3199b4 of _0x4a0a44){const _0x532b40=a142_0x5c3462[_0x19affd(0x81)](_0xeafc1a,a142_0x5c3462['dirname'](_0x3199b4)),_0x36b571=_0x532b40==='.'?'':_0x532b40,_0x13d4c9=readFileSync(_0x3199b4,'utf-8'),_0x1f43f8=a142_0x5a9249['parse'](_0x13d4c9);if(isJourneyDef(_0x1f43f8)){const _0x4f2aa8=a142_0x2514e4(_0x13d4c9);_0x3b4ac4['push']({'yamlConfig':_0x4f2aa8,'folderPath':_0x36b571,'sourcePath':_0x3199b4});}else{if(!_0x3a8f93?.['skipSegments']){const _0x4876ee=parseSegmentYamlFile(_0x13d4c9),_0x12eaee=normalizeChildSegmentYaml(_0x4876ee);_0x160204[_0x19affd(0x173)]({'yamlConfig':_0x12eaee,'folderPath':_0x36b571,'sourcePath':_0x3199b4});}}}return{'segments':_0x160204,'journeys':_0x3b4ac4};}export function validateParsedFiles(_0x2dc82b,_0x567b52){const _0x1ec5a8=a142_0x5a51,_0x15250d=[];for(const {yamlConfig:_0x1b0625,sourcePath:_0x45830a}of _0x2dc82b[_0x1ec5a8(0xd4)]){const _0x528174=readFileSync(_0x45830a,'utf-8'),_0x2f9432=a142_0x5a9249['parseDocument'](_0x528174),_0x1be537=validateSegmentDef(_0x1b0625,{'source':_0x528174,'document':_0x2f9432},{'skipSchema':!![]});if(!_0x1be537['valid']){const _0x4a5db4=a142_0x5c3462[_0x1ec5a8(0x81)](_0x567b52,_0x45830a);_0x15250d[_0x1ec5a8(0x173)]({'filePath':_0x4a5db4,'source':_0x528174,'result':_0x1be537,'isJourney':![]});}}for(const {yamlConfig:_0x22e545,sourcePath:_0x3c9e38}of _0x2dc82b[_0x1ec5a8(0x14a)]){const _0x5a3aba=readFileSync(_0x3c9e38,_0x1ec5a8(0x13c)),_0x15de33=a142_0x5a9249[_0x1ec5a8(0x15d)](_0x5a3aba),_0x797505=validateJourneyDef(_0x22e545,{'source':_0x5a3aba,'document':_0x15de33},{'skipSchema':!![]});if(!_0x797505['valid']){const _0xa49e5c=a142_0x5c3462[_0x1ec5a8(0x81)](_0x567b52,_0x3c9e38);_0x15250d[_0x1ec5a8(0x173)]({'filePath':_0xa49e5c,'source':_0x5a3aba,'result':_0x797505,'isJourney':!![]});}}return _0x15250d;}export function formatValidationErrors(_0x49ff49){const _0x533700=a142_0x5a51,_0x46a41c=[];for(const {filePath:_0x56ff60,source:_0x1f778a,result:_0x3022ea,isJourney:_0x377ba0}of _0x49ff49){const _0x254ff5=_0x377ba0?'journey':_0x533700(0xf2);_0x46a41c[_0x533700(0x173)]('\x0a'+_0x56ff60+'\x20('+_0x254ff5+'):\x20'+_0x3022ea[_0x533700(0xdf)][_0x533700(0xec)]+_0x533700(0x10e)),_0x46a41c[_0x533700(0x173)](formatValidationResult(_0x3022ea,_0x1f778a,_0x56ff60));}return _0x46a41c[_0x533700(0xcd)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x55279f){const _0x5ccada=a142_0x5a51,_0x5e2fe5=new Set(),_0x2a8d08=new Map(),_0x14574e=collectSegmentUsageCounts(_0x55279f);if(_0x55279f[_0x5ccada(0xd4)])for(const [_0x5df350,_0x170d22]of Object[_0x5ccada(0x15a)](_0x55279f['segments'])){_0x5e2fe5[_0x5ccada(0x154)](_0x5df350);if(_0x170d22[_0x5ccada(0x176)]){const _0x4790b9=yamlRuleToApi(_0x170d22[_0x5ccada(0x176)]),_0x2417d3=apiRuleToYaml(_0x4790b9);_0x2a8d08[_0x5ccada(0x156)](_0x5df350,_0x2417d3);}}const _0x8832e4=new Map();let _0x32f362=0x0;for(const [_0x43fc6a,_0x6b5071]of _0x2a8d08){const _0x39528c=serializeExpandedRule(_0x6b5071,_0x2a8d08),_0x1571fc=_0x8832e4[_0x5ccada(0x185)](_0x39528c)||[];_0x1571fc['push']({'name':_0x43fc6a,'index':_0x32f362}),_0x8832e4['set'](_0x39528c,_0x1571fc),_0x32f362++;}const _0x32e82c=new Map();for(const [_0x10e110,_0x5198a4]of _0x8832e4){const _0x281aa9=_0x5198a4[_0x5ccada(0xf6)]()[_0x5ccada(0xfd)]((_0x4e8b7e,_0x11deb0)=>{const _0xc88da=_0x5ccada,_0x11ef97=_0x14574e[_0xc88da(0x185)](_0x4e8b7e[_0xc88da(0x8c)])||0x0,_0x11b573=_0x14574e['get'](_0x11deb0[_0xc88da(0x8c)])||0x0;if(_0x11ef97!==_0x11b573)return _0x11b573-_0x11ef97;return _0x4e8b7e[_0xc88da(0xf3)]-_0x11deb0[_0xc88da(0xf3)];})[_0x5ccada(0xc1)](_0x2d1b39=>_0x2d1b39[_0x5ccada(0x8c)]),_0x5d17ba=[];for(const _0x674426 of _0x281aa9){const _0x51870e=_0x14574e['get'](_0x674426)||0x0,_0x46e904=Math[_0x5ccada(0xa4)](_0x51870e,0x1);for(let _0x1dcc3a=0x0;_0x1dcc3a<_0x46e904;_0x1dcc3a++){_0x5d17ba['push'](_0x674426);}}_0x32e82c[_0x5ccada(0x156)](_0x10e110,_0x5d17ba);}return{'existingLocalSegmentNames':_0x5e2fe5,'localSegmentRules':_0x2a8d08,'localExpandedRuleToNames':_0x32e82c};}export function createSegmentIdResolver(_0x2afbe2,_0x3d941b){return async _0x2efdb0=>{const _0x488fa5=a142_0x42c6,_0x2eb103=_0x2afbe2[_0x488fa5(0x185)](_0x2efdb0);if(!_0x2eb103)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x2efdb0+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x3d941b+'\x27)');return _0x2eb103;};}export function extractRootFolderId(_0x2cf952){const _0x577f9d=a142_0x5a51;return _0x2cf952[_0x577f9d(0x163)]?.[_0x577f9d(0x13a)]?.[_0x577f9d(0x149)]?.['id']||_0x2cf952['relationships']?.[_0x577f9d(0x131)]?.['data']?.['id'];}export function buildConnectionMaps(_0x59a6e9){const _0x5e0186=a142_0x5a51,_0x27ad77=new Map(),_0x3496bc=new Map(),_0x43660a=new Map();for(const _0x404ac8 of _0x59a6e9){_0x27ad77[_0x5e0186(0x156)](_0x404ac8[_0x5e0186(0x8c)],parseInt(_0x404ac8['id'],0xa)),_0x3496bc['set'](_0x404ac8['id'],_0x404ac8['name']),_0x43660a['set'](_0x404ac8[_0x5e0186(0x8c)],_0x404ac8[_0x5e0186(0xa2)]);}return{'nameToId':_0x27ad77,'idToName':_0x3496bc,'nameToType':_0x43660a};}export function calculatePushStats(_0x36fa0e,_0x1cf009,_0x3716b6,_0x5f07ff,_0x5aa2ba,_0x57dce2,_0x31ae22){const _0xc734ad=a142_0x5a51,_0x344315=_0x36fa0e[_0xc734ad(0x155)](_0x4d8738=>_0x4d8738[_0xc734ad(0x89)]),_0x21a547=_0x36fa0e['filter'](_0x14d41d=>!_0x14d41d['isNew']&&_0x14d41d[_0xc734ad(0xe3)]),_0x5b9f5d=_0x36fa0e[_0xc734ad(0x155)](_0x2846b5=>!_0x2846b5['isNew']&&!_0x2846b5[_0xc734ad(0xe3)]),_0x1f050d=_0x57dce2?_0x5f07ff:[],_0x1f5d08=_0x1cf009['filter'](_0x507457=>_0x507457['isNew']),_0x5dd6b5=_0x1cf009[_0xc734ad(0x155)](_0x22dce7=>!_0x22dce7[_0xc734ad(0x89)]&&_0x22dce7[_0xc734ad(0xe3)]),_0x129a97=_0x1cf009['filter'](_0x4e09e2=>!_0x4e09e2[_0xc734ad(0x89)]&&!_0x4e09e2[_0xc734ad(0xe3)]),_0x2b7728=_0x57dce2?_0x5aa2ba:[],_0x46db84=_0x36fa0e['flatMap'](_0x4ece71=>_0x4ece71[_0xc734ad(0x11b)]),_0x34ca16=_0x46db84[_0xc734ad(0x155)](_0x74c39f=>_0x74c39f[_0xc734ad(0xa2)]===_0xc734ad(0x143)),_0xb07d8b=_0x46db84[_0xc734ad(0x155)](_0x2c34da=>_0x2c34da[_0xc734ad(0xa2)]===_0xc734ad(0x17b)),_0xded13c=_0x46db84[_0xc734ad(0x155)](_0x46b166=>_0x46b166['type']===_0xc734ad(0x105)),_0x2e1d7a=Array[_0xc734ad(0x97)](_0x3716b6)[_0xc734ad(0xfd)](),_0x4c51a3=_0x31ae22?![]:_0x344315[_0xc734ad(0xec)]>0x0||_0x21a547[_0xc734ad(0xec)]>0x0||_0x1f050d[_0xc734ad(0xec)]>0x0,_0x4142a2=_0x1f5d08['length']>0x0||_0x5dd6b5['length']>0x0||_0x2b7728[_0xc734ad(0xec)]>0x0,_0x3339c2=_0x31ae22?![]:_0x46db84['length']>0x0,_0x3b91a2=_0x2e1d7a[_0xc734ad(0xec)]>0x0;return{'segments':{'new':_0x344315,'changed':_0x21a547,'unchanged':_0x5b9f5d,'toDelete':_0x1f050d},'journeys':{'new':_0x1f5d08,'changed':_0x5dd6b5,'unchanged':_0x129a97,'toDelete':_0x2b7728},'activations':{'all':_0x46db84,'toCreate':_0x34ca16,'toUpdate':_0xb07d8b,'toDelete':_0xded13c},'folders':{'toCreate':_0x2e1d7a},'counts':{'segments':{'new':_0x344315[_0xc734ad(0xec)],'changed':_0x21a547[_0xc734ad(0xec)],'unchanged':_0x5b9f5d[_0xc734ad(0xec)],'toDelete':_0x1f050d[_0xc734ad(0xec)]},'journeys':{'new':_0x1f5d08[_0xc734ad(0xec)],'changed':_0x5dd6b5[_0xc734ad(0xec)],'unchanged':_0x129a97[_0xc734ad(0xec)],'toDelete':_0x2b7728[_0xc734ad(0xec)]},'activations':{'create':_0x34ca16['length'],'update':_0xb07d8b[_0xc734ad(0xec)],'delete':_0xded13c[_0xc734ad(0xec)]},'folders':_0x2e1d7a[_0xc734ad(0xec)]},'hasChanges':_0x4c51a3||_0x4142a2||_0x3339c2||_0x3b91a2};}export async function buildPushExecutionContext(_0x385612,_0x4572b2,_0x1b6a6b,_0x1d9447,_0x53d2c1,_0xfffcf0){const _0x1f1d5a=a142_0x5a51,_0x2e3502=extractRootFolderId(_0x1b6a6b),{pathToId:_0x30fbb8,idToPath:_0x2bd96b}=buildFolderMaps(_0x53d2c1),_0xadb840=buildSegmentNameToIdMap(_0x1d9447),_0x47d13a=new Map(),{batchAsync:_0x13697a}=await import('../../utils/async.js'),[_0x987490,_0x59d42a]=await Promise[_0x1f1d5a(0x126)]([_0x385612[_0x1f1d5a(0x130)]['buildUserMaps'](),_0x385612[_0x1f1d5a(0x134)][_0x1f1d5a(0x12d)](),((async()=>{!_0xfffcf0&&_0x1d9447['length']>0x0&&await _0x13697a(_0x1d9447,async _0x34d55f=>{const _0x2acb87=a142_0x42c6,_0x1c68a2=await _0x385612[_0x2acb87(0xf2)][_0x2acb87(0x80)](_0x4572b2,_0x34d55f['id']);_0x47d13a[_0x2acb87(0x156)](_0x34d55f['id'],_0x1c68a2);});})())]),{emailToId:_0x4875cd,idToEmail:_0x5e2417}=_0x987490,_0x268670=buildConnectionMaps(_0x59d42a);return{'rootFolderId':_0x2e3502,'folderPathToId':_0x30fbb8,'folderIdToPath':_0x2bd96b,'segmentNameToId':_0xadb840,'activationsBySegmentId':_0x47d13a,'emailToIdMap':_0x4875cd,'idToEmailMap':_0x5e2417,'connectionNameToIdMap':_0x268670['nameToId'],'connectionIdToNameMap':_0x268670[_0x1f1d5a(0x9f)],'connectionNameToTypeMap':_0x268670[_0x1f1d5a(0xb2)]};}export function createPushYamlContextForBundle(_0x36588d,_0x3b5738,_0x5162c8,_0x2252d3,_0x381aa9,_0x1a9b32,_0x5e6ca5,_0x3e9e49){const {existingLocalSegmentNames:_0x1eef09,localExpandedRuleToNames:_0x38a6a0}=_0x2252d3,_0x8cddf3=new Set(),_0x46031c=new Map(),_0x4658c5=new Map(),_0x546225=new Map(),_0x1412aa=createJumpTargetCache(),_0x5d6d86=new Map(),_0x392ec7=new Map(),_0x5c828b=new Set();let _0x440a88;const _0x584009=_0x357ac1=>{const _0x5d11f1={'resolveSegment':async _0xf5d455=>{const _0x4c0262=a142_0x42c6,_0x4bcb06=_0x546225[_0x4c0262(0x185)](_0xf5d455);if(_0x4bcb06!==undefined)return{'name':_0x4bcb06,'isJourneyLocal':!![]};try{const _0x2317c0=await fetchSegment(_0x36588d,_0x3b5738,_0xf5d455,_0x5162c8);if(!_0x2317c0)throw new Error(_0x4c0262(0x98));const _0x3b1db4=generateJourneyLocalName(_0x2317c0[_0x4c0262(0x8c)]),_0x4f7d38=_0x2317c0[_0x4c0262(0x93)]===SEGMENT_KIND_JOURNEY&&_0x3b1db4!==undefined;let _0x384e29=_0x2317c0[_0x4c0262(0x8c)],_0x5dd9ce;if(_0x4f7d38&&_0x2317c0[_0x4c0262(0x176)]){const _0x595519=apiRuleToYaml(_0x2317c0['rule']);_0x392ec7[_0x4c0262(0x156)](_0xf5d455,_0x595519);const _0x43c197=async _0x257567=>{const _0x2692e6=_0x4c0262,_0x181091=collectSegmentRefsFromRule(_0x257567);for(const _0x174a3f of _0x181091){if(!_0x392ec7[_0x2692e6(0xd3)](_0x174a3f))try{const _0x47a782=await fetchSegment(_0x36588d,_0x3b5738,_0x174a3f,_0x5162c8);if(_0x47a782?.[_0x2692e6(0x176)]){const _0x2ebc7c=apiRuleToYaml(_0x47a782[_0x2692e6(0x176)]);_0x392ec7[_0x2692e6(0x156)](_0x174a3f,_0x2ebc7c),await _0x43c197(_0x2ebc7c);}}catch(_0x39ebab){logger[_0x2692e6(0x186)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x174a3f+':\x20'+_0x39ebab);}}};await _0x43c197(_0x595519);const _0x236beb=serializeExpandedRule(_0x595519,_0x392ec7),_0x490afb=_0x38a6a0[_0x4c0262(0x185)](_0x236beb);if(_0x490afb&&_0x490afb[_0x4c0262(0xec)]>0x0){const _0x5d47ec=_0x46031c[_0x4c0262(0x185)](_0x236beb)||0x0,_0x55e79e=_0x490afb[_0x5d47ec]||_0x490afb[_0x490afb[_0x4c0262(0xec)]-0x1];_0x46031c[_0x4c0262(0x156)](_0x236beb,_0x5d47ec+0x1),_0x384e29=_0x55e79e,_0x8cddf3[_0x4c0262(0x154)](_0x384e29),_0x546225[_0x4c0262(0x156)](_0xf5d455,_0x384e29);const _0x8b25db=await resolveRuleSegmentRefs(_0x595519,async _0x431a0c=>{const _0x3c543c=_0x4c0262,_0x39183f=_0x546225['get'](_0x431a0c);if(_0x39183f)return _0x39183f;const _0x4c4bc6=await _0x440a88[_0x3c543c(0xdd)](_0x431a0c);return _0x4c4bc6[_0x3c543c(0x8c)];});_0x5dd9ce={'description':_0x2317c0['description'],'rule':_0x8b25db};}else{const _0x394af1=_0x5d6d86[_0x4c0262(0x185)](_0x236beb);if(_0x394af1)_0x384e29=_0x394af1,_0x546225[_0x4c0262(0x156)](_0xf5d455,_0x384e29);else{if(_0x3b1db4){let _0x2a04e3=_0x3b1db4,_0x2c8dcb=0x2;while(_0x8cddf3['has'](_0x2a04e3)||_0x1eef09[_0x4c0262(0xd3)](_0x2a04e3)){_0x2a04e3=_0x3b1db4+'_'+_0x2c8dcb,_0x2c8dcb++;}_0x8cddf3[_0x4c0262(0x154)](_0x2a04e3),_0x384e29=_0x2a04e3;}_0x546225['set'](_0xf5d455,_0x384e29),_0x5d6d86[_0x4c0262(0x156)](_0x236beb,_0x384e29);const _0x263997=await resolveRuleSegmentRefs(_0x595519,async _0x7970c6=>{const _0x16330f=_0x4c0262,_0x2fdfe2=_0x546225[_0x16330f(0x185)](_0x7970c6);if(_0x2fdfe2)return _0x2fdfe2;const _0x3ecc7a=await _0x440a88['resolveSegment'](_0x7970c6);return _0x3ecc7a['name'];});_0x5dd9ce={'description':_0x2317c0[_0x4c0262(0x167)],'rule':_0x263997};}}}return{'name':_0x384e29,'isJourneyLocal':_0x4f7d38,'definition':_0x5dd9ce};}catch(_0x46af5a){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0xf5d455+':\x20'+_0x46af5a),{'name':_0xf5d455,'isJourneyLocal':![]};}},'resolveActivation':async _0x5a98b4=>{const _0x3ea871=a142_0x42c6,_0x9408b7=_0x4658c5['get'](_0x5a98b4);if(_0x9408b7!==undefined)return{'name':_0x9408b7,'isJourneyLocal':!![]};try{let _0x5066de=_0x5e6ca5?.[_0x3ea871(0x185)](_0x5a98b4);!_0x5066de&&(_0x5066de=await _0x36588d[_0x3ea871(0x164)]['getActivation'](_0x357ac1,_0x5a98b4));const _0x1c58cc=_0x5066de[_0x3ea871(0xc6)][_0x3ea871(0x170)][_0x3ea871(0x8c)]||_0x5a98b4,_0x5a51e8=sanitizeYamlKey(_0x1c58cc)||_0x3ea871(0x142)+_0x5a98b4,_0x20f108=_0x5a51e8;_0x4658c5['set'](_0x5a98b4,_0x20f108);const _0x53540b=journeyActivationStepToYaml(_0x5066de,_0x381aa9,_0x1a9b32);return{'name':_0x20f108,'isJourneyLocal':!![],'definition':_0x53540b};}catch(_0x10f54f){return logger[_0x3ea871(0x186)]('Failed\x20to\x20resolve\x20activation\x20'+_0x5a98b4+':\x20'+_0x10f54f),{'name':_0x5a98b4,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1338a3,_0x455314)=>resolveJumpTarget(_0x1338a3,_0x455314,_0x1412aa,async _0x467ff4=>{const _0x668283=a142_0x42c6,_0x1a3be4=_0x3e9e49?.[_0x668283(0x185)](_0x467ff4);if(_0x1a3be4)return _0x1a3be4;return _0x36588d['journey'][_0x668283(0x157)](_0x467ff4);})};return _0x440a88=_0x5d11f1,_0x5d11f1;},_0x75893e=async _0xe932e5=>{const _0x265242=a142_0x42c6,{collectSegmentIdsFromJourneyApi:_0x39dadd}=await import(_0x265242(0x114)),{batchAsync:_0x508690}=await import(_0x265242(0x85)),_0x24ef11=new Set();for(const _0x29bead of _0xe932e5){let _0x509d27=_0x3e9e49?.[_0x265242(0x185)](_0x29bead);!_0x509d27&&(_0x509d27=await _0x36588d['journey'][_0x265242(0x157)](_0x29bead));const _0x8c0c10=_0x39dadd(_0x509d27);for(const _0x2cbd0f of _0x8c0c10){_0x24ef11['add'](_0x2cbd0f);}}let _0x4598d0=Array['from'](_0x24ef11);while(_0x4598d0['length']>0x0){const _0x122a09=_0x4598d0[_0x265242(0x155)](_0x4efba4=>!_0x5c828b[_0x265242(0xd3)](_0x4efba4));if(_0x122a09[_0x265242(0xec)]===0x0)break;const _0x47a4f7=await _0x508690(_0x122a09,async _0x44e8ba=>{const _0x1deb81=_0x265242;_0x5c828b[_0x1deb81(0x154)](_0x44e8ba);const _0x3a50e0=await fetchSegment(_0x36588d,_0x3b5738,_0x44e8ba,_0x5162c8);if(!_0x3a50e0)return null;return{'segmentId':_0x44e8ba,'segment':_0x3a50e0};},0xa),_0x5b47b2=new Set();for(const _0x44f1f0 of _0x47a4f7){if(!_0x44f1f0?.[_0x265242(0xf2)]?.['rule'])continue;const _0x9037cd=apiRuleToYaml(_0x44f1f0[_0x265242(0xf2)][_0x265242(0x176)]);_0x392ec7['set'](_0x44f1f0['segmentId'],_0x9037cd);const _0x5988b8=collectSegmentRefsFromRule(_0x9037cd);for(const _0x2ac34b of _0x5988b8){!_0x5c828b['has'](_0x2ac34b)&&_0x5b47b2[_0x265242(0x154)](_0x2ac34b);}}_0x4598d0=Array[_0x265242(0x97)](_0x5b47b2);}};return{'createYamlContext':_0x584009,'prefetchJourneySegments':_0x75893e};}export async function executePushSegments(_0x588e96,_0x10462c,_0x285050,_0x54f431,_0x2d1614){const _0x40cf85=a142_0x5a51,{segmentDefToCreateRequest:_0x440784,segmentDefToUpdateRequest:_0x46f965}=await import(_0x40cf85(0x12a)),_0x3c93bb=_0x285050[_0x40cf85(0x116)],_0x49e9af=0x5,_0x3795cb=async _0x4e2bf3=>{const _0x236c2e=_0x40cf85,_0x31789e=_0x4e2bf3[_0x236c2e(0x107)]?_0x3c93bb['get'](_0x4e2bf3[_0x236c2e(0x107)]):undefined;let _0x230d8a;const _0x3b22cd={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x2c5e7b=_0x4e2bf3[_0x236c2e(0x124)];if(_0x4e2bf3['yamlConfig'][_0x236c2e(0x176)]){const _0x2d5a03=createSegmentIdResolver(_0x285050[_0x236c2e(0x151)],_0x4e2bf3[_0x236c2e(0x124)]['name']),_0x5d31ff=await resolveRuleSegmentIds(_0x4e2bf3['yamlConfig']['rule'],_0x2d5a03);_0x2c5e7b={..._0x4e2bf3['yamlConfig'],'rule':_0x5d31ff};}try{if(_0x4e2bf3['isNew']){_0x2d1614[_0x236c2e(0xad)]?.({'type':_0x236c2e(0x16f),'name':_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)]});const _0x4d71cf=_0x440784(_0x2c5e7b,_0x31789e),_0x56b9cc=await _0x2d1614[_0x236c2e(0x115)](_0x236c2e(0x106)+_0x4e2bf3[_0x236c2e(0x124)]['name']+'\x27...',()=>_0x588e96['segment'][_0x236c2e(0xb1)](_0x54f431[_0x236c2e(0xee)],_0x4d71cf));_0x230d8a=_0x56b9cc[_0x236c2e(0x149)]['id'],_0x285050[_0x236c2e(0x151)][_0x236c2e(0x156)](_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)],_0x230d8a),_0x3b22cd[_0x236c2e(0x82)]={'name':_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)],'id':_0x230d8a},_0x2d1614[_0x236c2e(0xad)]?.({'type':'segment_created','name':_0x4e2bf3[_0x236c2e(0x124)]['name'],'segmentId':_0x230d8a}),_0x2d1614['logSuccess']?.(_0x236c2e(0x13f)+_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)]+'\x27'),_0x3b22cd[_0x236c2e(0xa8)]=0x1;}else{if(_0x4e2bf3[_0x236c2e(0xe3)]){_0x2d1614['onProgress']?.({'type':'segment_updating','name':_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)]});const _0x431c9c=_0x46f965(_0x2c5e7b);_0x31789e!==_0x4e2bf3['existingSegment']?.['segmentFolderId']&&(_0x431c9c[_0x236c2e(0x8f)]=_0x31789e?parseInt(_0x31789e,0xa):undefined),await _0x2d1614[_0x236c2e(0x115)](_0x236c2e(0x182)+_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)]+'\x27...',()=>_0x588e96[_0x236c2e(0xf2)][_0x236c2e(0x10c)](_0x54f431[_0x236c2e(0xee)],_0x4e2bf3[_0x236c2e(0xa3)]['id'],_0x431c9c)),_0x230d8a=_0x4e2bf3[_0x236c2e(0xa3)]['id'],_0x2d1614['onProgress']?.({'type':_0x236c2e(0xf9),'name':_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)]}),_0x2d1614[_0x236c2e(0x11d)]?.('Updated\x20segment\x20\x27'+_0x4e2bf3[_0x236c2e(0x124)]['name']+'\x27'),_0x3b22cd['updated']=0x1;}else _0x230d8a=_0x4e2bf3[_0x236c2e(0xa3)]['id'];}}catch(_0x261057){const _0x25d892=isHttp400Error(_0x261057),_0xd860a8=_0x25d892?ErrorCode[_0x236c2e(0xbf)]:ErrorCode[_0x236c2e(0x14d)],_0x5d1024=getErrorMessage(_0x261057);throw new SDKError(_0xd860a8,_0x236c2e(0xed)+(_0x4e2bf3['isNew']?_0x236c2e(0x143):_0x236c2e(0x17b))+_0x236c2e(0x16b)+_0x4e2bf3['absolutePath']+_0x236c2e(0xc4)+_0x5d1024,_0x261057);}try{const _0x89f99d=await syncActivationsForSegment(_0x588e96,_0x54f431[_0x236c2e(0xee)],_0x230d8a,_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)],_0x4e2bf3[_0x236c2e(0x11b)],_0x2d1614,_0x4e2bf3['absolutePath']);_0x3b22cd[_0x236c2e(0x17d)]=_0x89f99d;}catch(_0x309042){if(_0x309042 instanceof SDKError)throw _0x309042;throw new SDKError(ErrorCode[_0x236c2e(0x146)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x4e2bf3['yamlConfig']['name']+_0x236c2e(0x152)+_0x4e2bf3['absolutePath']+_0x236c2e(0xc4)+getErrorMessage(_0x309042),_0x309042);}return _0x3b22cd;},_0x2761ca=await batchAsync(_0x10462c,_0x3795cb,_0x49e9af),_0x4b69e6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xeec735 of _0x2761ca){_0x4b69e6[_0x40cf85(0xa8)]+=_0xeec735[_0x40cf85(0xa8)],_0x4b69e6['updated']+=_0xeec735[_0x40cf85(0xde)],_0xeec735['createdSegmentId']&&_0x4b69e6[_0x40cf85(0xd8)][_0x40cf85(0x156)](_0xeec735[_0x40cf85(0x82)][_0x40cf85(0x8c)],_0xeec735[_0x40cf85(0x82)]['id']),_0x4b69e6[_0x40cf85(0x17d)][_0x40cf85(0xa8)]+=_0xeec735[_0x40cf85(0x17d)][_0x40cf85(0xa8)],_0x4b69e6[_0x40cf85(0x17d)][_0x40cf85(0xde)]+=_0xeec735[_0x40cf85(0x17d)][_0x40cf85(0xde)],_0x4b69e6['activations']['deleted']+=_0xeec735['activations'][_0x40cf85(0xef)];}return _0x4b69e6;}async function syncActivationsForSegment(_0x49c204,_0x587189,_0x1bffb5,_0x3e3488,_0x567926,_0x2216e9,_0x3fcda2){const _0x136a46=a142_0x5a51,_0x574bd6={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2175e1 of _0x567926){try{if(_0x2175e1[_0x136a46(0xa2)]==='create'&&_0x2175e1['validatedRequest'])_0x2216e9[_0x136a46(0xad)]?.({'type':'activation_creating','segmentName':_0x3e3488,'activationName':_0x2175e1['name']}),await _0x2216e9[_0x136a46(0x115)](_0x136a46(0xa9)+_0x2175e1[_0x136a46(0x8c)]+'\x27...',()=>_0x49c204[_0x136a46(0xf2)]['createActivation'](_0x587189,_0x1bffb5,_0x2175e1[_0x136a46(0x94)])),_0x2216e9[_0x136a46(0xad)]?.({'type':'activation_created','segmentName':_0x3e3488,'activationName':_0x2175e1[_0x136a46(0x8c)]}),_0x2216e9['logSuccess']?.(_0x136a46(0x133)+_0x2175e1[_0x136a46(0x8c)]+'\x27'),_0x574bd6[_0x136a46(0xa8)]++;else{if(_0x2175e1['type']===_0x136a46(0x17b)&&_0x2175e1[_0x136a46(0x94)]&&_0x2175e1[_0x136a46(0xb5)])_0x2216e9['onProgress']?.({'type':_0x136a46(0x91),'segmentName':_0x3e3488,'activationName':_0x2175e1['name']}),await _0x2216e9[_0x136a46(0x115)](_0x136a46(0x180)+_0x2175e1['name']+'\x27...',()=>_0x49c204['segment'][_0x136a46(0xd7)](_0x587189,_0x1bffb5,_0x2175e1[_0x136a46(0xb5)]['id'],_0x2175e1[_0x136a46(0x94)])),_0x2216e9[_0x136a46(0xad)]?.({'type':_0x136a46(0xe4),'segmentName':_0x3e3488,'activationName':_0x2175e1[_0x136a46(0x8c)]}),_0x2216e9[_0x136a46(0x11d)]?.(_0x136a46(0x15c)+_0x2175e1[_0x136a46(0x8c)]+'\x27'),_0x574bd6[_0x136a46(0xde)]++;else _0x2175e1[_0x136a46(0xa2)]===_0x136a46(0x105)&&_0x2175e1['existingActivation']&&(_0x2216e9[_0x136a46(0xad)]?.({'type':_0x136a46(0x118),'segmentName':_0x3e3488,'activationName':_0x2175e1[_0x136a46(0x8c)]}),await _0x2216e9[_0x136a46(0x115)](_0x136a46(0xd5)+_0x2175e1[_0x136a46(0x8c)]+_0x136a46(0xbb),()=>_0x49c204[_0x136a46(0xf2)][_0x136a46(0xd6)](_0x587189,_0x1bffb5,_0x2175e1[_0x136a46(0xb5)]['id'])),_0x2216e9[_0x136a46(0xad)]?.({'type':'activation_deleted','segmentName':_0x3e3488,'activationName':_0x2175e1[_0x136a46(0x8c)]}),_0x2216e9[_0x136a46(0x104)]?.(_0x136a46(0xe9)+_0x2175e1[_0x136a46(0x8c)]+'\x27'),_0x574bd6[_0x136a46(0xef)]++);}}catch(_0x5a2680){const _0x437538=isHttp400Error(_0x5a2680),_0x1bbc54=_0x437538?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x136a46(0x146)],_0x352847=getErrorMessage(_0x5a2680);throw new SDKError(_0x1bbc54,_0x136a46(0xed)+_0x2175e1['type']+_0x136a46(0xd9)+_0x2175e1[_0x136a46(0x8c)]+_0x136a46(0x152)+_0x3fcda2+_0x136a46(0xc4)+_0x352847,_0x5a2680);}}return _0x574bd6;}export async function executePushFolders(_0x5823ad,_0x5868f2,_0x9b5398,_0xbb0ce8,_0xe30116){const _0x22abca=a142_0x5a51,_0x3a6d6d=new Map(_0x9b5398),_0x29f9f9=sortFoldersByDepth(_0x5868f2);for(const _0x4a78ea of _0x29f9f9){const _0xa3ad2=_0x4a78ea[_0x22abca(0x8d)]('/'),_0x175874=_0xa3ad2[_0xa3ad2[_0x22abca(0xec)]-0x1],_0x498a2f=_0xa3ad2['slice'](0x0,-0x1)['join']('/'),_0x3b1475=_0x3a6d6d[_0x22abca(0x185)](_0x498a2f);_0xe30116[_0x22abca(0xad)]?.({'type':_0x22abca(0x84),'folder':_0x4a78ea});const _0x2379cb={'name':_0x175874,'parentFolderId':_0x3b1475},_0x5a60cc=await _0xe30116['withProgress'](_0x22abca(0xc8)+_0x4a78ea+_0x22abca(0xbb),()=>_0x5823ad[_0x22abca(0xf2)][_0x22abca(0xe5)](_0xbb0ce8[_0x22abca(0xee)],_0x2379cb));_0x3a6d6d[_0x22abca(0x156)](_0x4a78ea,_0x5a60cc[_0x22abca(0x149)]['id']),_0xe30116['onProgress']?.({'type':_0x22abca(0xdc),'folder':_0x4a78ea,'folderId':_0x5a60cc[_0x22abca(0x149)]['id']}),_0xe30116[_0x22abca(0x11f)]?.(_0x22abca(0x12e)+_0x4a78ea+'\x27');}return _0x3a6d6d;}export async function executePushSegmentDeletions(_0x4a58ba,_0x3ddc1f,_0x93602e){const _0x905e62=a142_0x5a51;if(_0x3ddc1f[_0x905e62(0xec)]===0x0)return 0x0;const {batchAsync:_0x50cf31}=await import(_0x905e62(0x85)),_0x2202f6=0x5,_0x222128=await _0x50cf31(_0x3ddc1f,async _0x2b4f76=>{const _0x546eed=_0x905e62;return _0x93602e['onProgress']?.({'type':_0x546eed(0xe2),'name':_0x2b4f76[_0x546eed(0x8c)]}),await _0x4a58ba[_0x546eed(0xf2)][_0x546eed(0xa5)](_0x2b4f76['id']),_0x93602e[_0x546eed(0xad)]?.({'type':'segment_deleted','name':_0x2b4f76[_0x546eed(0x8c)]}),_0x93602e[_0x546eed(0x104)]?.(_0x546eed(0x122)+_0x2b4f76['name']+'\x27'),0x1;},_0x2202f6);return _0x222128[_0x905e62(0xbe)]((_0x1d13bc,_0x23ebfd)=>_0x1d13bc+_0x23ebfd,0x0);}export async function executePushJourneys(_0x374b39,_0x4c99fd,_0xe769aa,_0x3716d5,_0x59369c){const _0x1dcab4=a142_0x5a51,{journeyDefToRequest:_0xacad6d}=await import(_0x1dcab4(0x114)),{activationDefToCreateRequest:_0x226d0c,yamlRuleToApi:_0x4493b3,validateSegmentRule:_0x1db275}=await import('./child-segment-yaml.js'),_0x57c0a6={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4275a0=new Map(_0xe769aa['segmentNameToId']),_0x104a3e=0x5;for(let _0x8c8d38=0x0;_0x8c8d38<_0x4c99fd['length'];_0x8c8d38+=_0x104a3e){const _0x4b85ac=_0x4c99fd[_0x1dcab4(0xf6)](_0x8c8d38,_0x8c8d38+_0x104a3e),_0x3e9efa=await Promise[_0x1dcab4(0x126)](_0x4b85ac[_0x1dcab4(0xc1)](async _0x401e0e=>{const _0x1fc850=_0x1dcab4;if(!_0x401e0e[_0x1fc850(0x89)]&&!_0x401e0e[_0x1fc850(0xe3)])return{'action':_0x1fc850(0xe8),'name':_0x401e0e[_0x1fc850(0x124)]['name'],'journeyId':_0x401e0e[_0x1fc850(0x139)]?.['id']};const _0x209361=_0x401e0e[_0x1fc850(0x107)]?_0xe769aa[_0x1fc850(0x116)]['get'](_0x401e0e[_0x1fc850(0x107)]):undefined;_0x59369c[_0x1fc850(0xad)]?.({'type':_0x401e0e[_0x1fc850(0x89)]?_0x1fc850(0x14b):'journey_updating','name':_0x401e0e['yamlConfig'][_0x1fc850(0x8c)]});try{const _0x77a589=await executeSingleJourneyPush(_0x374b39,_0x401e0e,{..._0xe769aa,'segmentNameToId':_0x4275a0},{'parentId':_0x3716d5[_0x1fc850(0xee)],'rootFolderId':_0x3716d5['rootFolderId'],'folderId':_0x209361,'verbose':_0x3716d5[_0x1fc850(0x153)]},_0x59369c,{'journeyDefToRequest':_0xacad6d,'activationDefToCreateRequest':_0x226d0c,'yamlRuleToApi':_0x4493b3,'validateSegmentRule':_0x1db275});for(const [_0x3c16ba,_0x356448]of _0x77a589['embeddedSegmentNameToId']){_0x4275a0['set'](_0x3c16ba,_0x356448),_0x57c0a6[_0x1fc850(0xaf)][_0x1fc850(0x156)](_0x3c16ba,_0x356448);}if(_0x77a589[_0x1fc850(0xae)]==='created')_0x59369c[_0x1fc850(0xad)]?.({'type':_0x1fc850(0xac),'name':_0x401e0e['yamlConfig'][_0x1fc850(0x8c)],'journeyId':_0x77a589[_0x1fc850(0xaa)]}),_0x59369c['logSuccess']?.(_0x1fc850(0x150)+_0x401e0e['yamlConfig'][_0x1fc850(0x8c)]+'\x27'),_0x57c0a6[_0x1fc850(0xa8)]++;else _0x77a589[_0x1fc850(0xae)]===_0x1fc850(0xde)&&(_0x59369c[_0x1fc850(0xad)]?.({'type':'journey_updated','name':_0x401e0e['yamlConfig'][_0x1fc850(0x8c)]}),_0x59369c[_0x1fc850(0x11d)]?.('Updated\x20journey\x20\x27'+_0x401e0e['yamlConfig'][_0x1fc850(0x8c)]+'\x27'),_0x57c0a6[_0x1fc850(0xde)]++);return{'action':_0x77a589[_0x1fc850(0xae)],'name':_0x401e0e[_0x1fc850(0x124)][_0x1fc850(0x8c)],'journeyId':_0x77a589['journeyId']};}catch(_0x5a0f12){const _0x5233e1=isHttp400Error(_0x5a0f12),_0x20ed45=_0x5233e1?ErrorCode[_0x1fc850(0xda)]:ErrorCode[_0x1fc850(0x8a)],_0x445cd9=getErrorMessage(_0x5a0f12);throw new SDKError(_0x20ed45,_0x1fc850(0xed)+(_0x401e0e['isNew']?_0x1fc850(0x143):_0x1fc850(0x17b))+_0x1fc850(0x145)+_0x401e0e[_0x1fc850(0x120)]+_0x1fc850(0xc4)+_0x445cd9,_0x5a0f12);}}));_0x57c0a6[_0x1dcab4(0x121)][_0x1dcab4(0x173)](..._0x3e9efa);}return _0x57c0a6;}async function matchExistingJourneySegments(_0x74815d,_0x5db306,_0x5b055e,_0x42805d,_0x403a3b){const _0x27df41=a142_0x5a51;if(!_0x5db306['existingJourney']||!_0x5db306[_0x27df41(0x124)][_0x27df41(0xd4)])return;const _0x1a4b8c=new Map(),_0x2d54c1=new Set();for(const _0x3dda6a of Object['keys'](_0x5db306['yamlConfig'][_0x27df41(0xd4)])){const _0x48e40a=generateDeterministicJourneySegmentName(_0x5db306[_0x27df41(0x124)][_0x27df41(0x8c)],_0x3dda6a);_0x1a4b8c['set'](_0x48e40a,_0x3dda6a),_0x2d54c1[_0x27df41(0x154)](_0x3dda6a);}const _0x3675bd=[],_0x228460=collectSegmentIdsFromJourneyApi(_0x5db306[_0x27df41(0x139)]);for(const _0x5922b7 of _0x228460){const _0x218706=await fetchSegment(_0x74815d,_0x5b055e,_0x5922b7,_0x42805d);if(!_0x218706?.['name'])continue;const _0x8fa2a7=_0x1a4b8c[_0x27df41(0x185)](_0x218706[_0x27df41(0x8c)]);_0x8fa2a7?(_0x403a3b[_0x27df41(0x156)](_0x8fa2a7,_0x5922b7),_0x2d54c1[_0x27df41(0x105)](_0x8fa2a7)):_0x3675bd[_0x27df41(0x173)]({'id':_0x5922b7,'seg':_0x218706});}if(_0x2d54c1[_0x27df41(0x102)]>0x0&&_0x3675bd[_0x27df41(0xec)]>0x0){const {localExpandedRuleToNames:_0x4d77bf}=buildLocalExpandedRuleMappings(_0x5db306[_0x27df41(0x124)]),_0x1c9afa=new Map();for(const {id:_0x22b212,seg:_0x2bea31}of _0x3675bd){if(_0x2bea31['rule']){const _0x4be6c4=apiRuleToYaml(_0x2bea31[_0x27df41(0x176)]);_0x1c9afa[_0x27df41(0x156)](_0x22b212,_0x4be6c4);}}for(const {id:_0x3c27e8,seg:_0x30cd7a}of _0x3675bd){if(!_0x30cd7a['rule'])continue;const _0x9d1d0=_0x1c9afa[_0x27df41(0x185)](_0x3c27e8);if(!_0x9d1d0)continue;const _0x1df3dd=serializeExpandedRule(_0x9d1d0,_0x1c9afa),_0x7bcc41=_0x4d77bf[_0x27df41(0x185)](_0x1df3dd);if(_0x7bcc41){const _0x290145=_0x7bcc41[_0x27df41(0x16c)](_0x1c1f0c=>_0x2d54c1['has'](_0x1c1f0c));_0x290145&&(_0x403a3b[_0x27df41(0x156)](_0x290145,_0x3c27e8),_0x2d54c1[_0x27df41(0x105)](_0x290145),logger[_0x27df41(0x186)](_0x27df41(0xe0)+_0x30cd7a[_0x27df41(0x8c)]+_0x27df41(0xc0)+_0x290145+_0x27df41(0xab)));}}}}async function executeSingleJourneyPush(_0x11b996,_0x588fcf,_0x4c0641,_0x4a44b2,_0x36f362,_0x43fd61){const _0x26112f=a142_0x5a51,{journeyDefToRequest:_0x4a88a3,activationDefToCreateRequest:_0x3383bb,yamlRuleToApi:_0x24972a,validateSegmentRule:_0x2249b8}=_0x43fd61,_0x4ba5bb=new Map(),_0x478422=new Map();recoverSegmentIdsFromPushRecovery(_0x588fcf,_0x4ba5bb,_0x4c0641[_0x26112f(0x151)]);const _0x50b447=new Map(),_0xcc2a49=new Map(),_0x49b72c=new Map();let _0x437b68;const _0x5b206b=async()=>{const _0x15eec0=_0x26112f;if(_0x437b68)return;_0x437b68=new Map();if(!_0x588fcf[_0x15eec0(0x139)])return;const _0x466a97=await _0x11b996[_0x15eec0(0x164)]['listActivations'](_0x588fcf[_0x15eec0(0x139)]['id']);for(const _0x2f062f of _0x466a97){const _0x5689a5=journeyActivationStepToYaml(_0x2f062f,_0x4c0641[_0x15eec0(0x17a)],_0x4c0641[_0x15eec0(0x135)]),_0x8e79c3=activationSignature(_0x5689a5);!_0x437b68[_0x15eec0(0xd3)](_0x8e79c3)&&_0x437b68[_0x15eec0(0x156)](_0x8e79c3,_0x2f062f['id']),_0x5689a5[_0x15eec0(0x8c)]&&_0x478422[_0x15eec0(0x156)](_0x5689a5[_0x15eec0(0x8c)],_0x2f062f['id']);}};await matchExistingJourneySegments(_0x11b996,_0x588fcf,_0x4a44b2['parentId'],_0x4c0641[_0x26112f(0x17f)],_0x4c0641[_0x26112f(0x151)]);const _0x47ca1c={'resolveSegmentId':async _0x433f99=>{const _0x5e02ee=_0x26112f,_0x2550ca=_0x4c0641[_0x5e02ee(0x151)][_0x5e02ee(0x185)](_0x433f99);if(!_0x2550ca)throw new SDKError(ErrorCode[_0x5e02ee(0xe6)],_0x5e02ee(0xf5)+_0x433f99+_0x5e02ee(0x172)+_0x588fcf['yamlConfig'][_0x5e02ee(0x8c)]+')');return _0x2550ca;},'resolveEmbeddedSegmentId':async(_0x474dbb,_0x11956b)=>{const _0x580e65=_0x26112f,_0x201941=_0x4c0641['segmentNameToId'][_0x580e65(0x185)](_0x474dbb);if(_0x201941)return _0x201941;const _0x143213=_0x4c0641[_0x580e65(0x17f)][_0x580e65(0x16c)](_0x3215f0=>_0x3215f0[_0x580e65(0x8c)]===_0x474dbb);if(_0x143213)return _0x4c0641['segmentNameToId'][_0x580e65(0x156)](_0x474dbb,_0x143213['id']),_0x143213['id'];if(_0x588fcf[_0x580e65(0x89)]){const {stageName:_0x3174f8,criteriaName:_0x511c89}=findSegmentCriteriaLocation(_0x588fcf[_0x580e65(0x124)],_0x474dbb);return _0x2249b8(_0x474dbb,_0x11956b['rule']),_0xcc2a49['set'](_0x474dbb,{'definition':_0x11956b,'stageName':_0x3174f8,'criteriaName':_0x511c89}),createPendingSegmentId(_0x474dbb);}const _0x5df5bd=_0x588fcf['existingJourney']?.['id'];if(!_0x5df5bd)throw new SDKError(ErrorCode[_0x580e65(0x9b)],_0x580e65(0x110));const _0x2fe73e=_0x50b447[_0x580e65(0x185)](_0x474dbb);if(_0x2fe73e)return _0x2fe73e;const _0xaf086d=((async()=>{const _0x2dcfa6=_0x580e65;_0x2249b8(_0x474dbb,_0x11956b[_0x2dcfa6(0x176)]);const _0x59e090=generateDeterministicJourneySegmentName(_0x588fcf[_0x2dcfa6(0x124)][_0x2dcfa6(0x8c)],_0x474dbb),_0x371c53=_0x4c0641[_0x2dcfa6(0x17f)]['find'](_0x2d7ec0=>_0x2d7ec0[_0x2dcfa6(0x8c)]===_0x59e090),_0x26515b=createSegmentIdResolver(_0x4c0641['segmentNameToId'],_0x474dbb),_0x347543=await resolveRuleSegmentIds(_0x11956b[_0x2dcfa6(0x176)],_0x26515b);let _0x53f471;return _0x371c53?(await _0x11b996[_0x2dcfa6(0xf2)][_0x2dcfa6(0x10c)](_0x4a44b2['parentId'],_0x371c53['id'],{'description':_0x11956b[_0x2dcfa6(0x167)]||_0x2dcfa6(0x127)+_0x474dbb,'rule':_0x24972a(_0x347543,!![]),'countPopulation':!![]}),_0x53f471=_0x371c53['id'],saveSegmentToPushRecovery(_0x588fcf[_0x2dcfa6(0x120)],_0x588fcf['yamlConfig']['name'],_0x474dbb,{'segmentId':_0x53f471,'uniqueServerName':_0x59e090,'createdAt':new Date()[_0x2dcfa6(0x137)]()})):_0x53f471=await createOrRecoverEmbeddedSegment(_0x11b996,_0x588fcf,{'localName':_0x474dbb,'uniqueSegmentName':_0x59e090,'description':_0x11956b[_0x2dcfa6(0x167)]||_0x2dcfa6(0x127)+_0x474dbb,'journeyId':_0x5df5bd,'resolvedRule':_0x347543,'parentId':_0x4a44b2[_0x2dcfa6(0xee)],'folderId':_0x4a44b2[_0x2dcfa6(0x112)]||''},_0x24972a),_0x4c0641[_0x2dcfa6(0x151)][_0x2dcfa6(0x156)](_0x474dbb,_0x53f471),_0x4ba5bb[_0x2dcfa6(0x156)](_0x474dbb,_0x53f471),_0x53f471;})());_0x50b447[_0x580e65(0x156)](_0x474dbb,_0xaf086d);try{return await _0xaf086d;}finally{_0x50b447[_0x580e65(0x105)](_0x474dbb);}},'resolveActivationId':async _0x729138=>{const _0x160275=_0x26112f,_0x32456b=_0x478422[_0x160275(0x185)](_0x729138);if(_0x32456b)return _0x32456b;if(_0x588fcf['existingJourney']){await _0x5b206b();const _0x10301a=_0x478422[_0x160275(0x185)](_0x729138);if(_0x10301a)return _0x10301a;}throw new SDKError(ErrorCode[_0x160275(0x8e)],_0x160275(0xfa)+_0x729138+_0x160275(0x172)+_0x588fcf[_0x160275(0x124)][_0x160275(0x8c)]+_0x160275(0x90)+_0x160275(0xce));},'resolveEmbeddedActivationId':async(_0x268af6,_0x1317d1)=>{const _0x5646b7=_0x26112f,_0x279821=_0x478422[_0x5646b7(0x185)](_0x268af6);if(_0x279821)return _0x279821;if(_0x588fcf[_0x5646b7(0x89)])return _0x49b72c[_0x5646b7(0x156)](_0x268af6,_0x1317d1),createPendingActivationId(_0x268af6);if(_0x588fcf[_0x5646b7(0x139)]){await _0x5b206b();const _0x3c5596=_0x478422[_0x5646b7(0x185)](_0x1317d1[_0x5646b7(0x8c)]);if(_0x3c5596)return _0x478422[_0x5646b7(0x156)](_0x268af6,_0x3c5596),_0x3c5596;const _0x374413=activationSignature(_0x1317d1),_0x308c8d=_0x437b68?.[_0x5646b7(0x185)](_0x374413);if(_0x308c8d)return _0x478422[_0x5646b7(0x156)](_0x268af6,_0x308c8d),_0x308c8d;const _0x1b6cf0=await _0x3383bb(_0x1317d1,_0x4c0641[_0x5646b7(0x86)]),_0x1f1913={..._0x1b6cf0,..._0x1317d1['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x1317d1[_0x5646b7(0xa6)]}},_0x530e28=await _0x11b996[_0x5646b7(0x164)]['createActivation'](_0x588fcf[_0x5646b7(0x139)]['id'],_0x1f1913);return _0x478422['set'](_0x268af6,_0x530e28['id']),_0x530e28['id'];}throw new SDKError(ErrorCode[_0x5646b7(0x9b)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x41dcc5=>{const _0x1c1e5e=_0x26112f;try{return await _0x11b996['journey'][_0x1c1e5e(0xfc)](_0x4a44b2[_0x1c1e5e(0xee)],_0x41dcc5);}catch(_0x5c1648){throw new SDKError(ErrorCode['NOT_FOUND'],_0x1c1e5e(0x159)+_0x41dcc5+_0x1c1e5e(0xb7)+_0x588fcf[_0x1c1e5e(0x124)][_0x1c1e5e(0x8c)]+'\x27)',_0x5c1648);}},'resolveStageId':async(_0xedeb39,_0x27be53)=>{const _0x42ce19=_0x26112f,_0x66d144=await _0x11b996[_0x42ce19(0x164)]['getJourney'](_0xedeb39),_0x2b1fb9=_0x66d144[_0x42ce19(0xc6)]['journeyStages'][_0x42ce19(0x16c)](_0x4af592=>_0x4af592[_0x42ce19(0x8c)][_0x42ce19(0x16e)]()===_0x27be53['toLowerCase']());if(!_0x2b1fb9?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x27be53+_0x42ce19(0xe1)+(_0x66d144[_0x42ce19(0xc6)][_0x42ce19(0xd1)]||_0x66d144[_0x42ce19(0xc6)][_0x42ce19(0x8c)])+'\x27');return _0x2b1fb9['id'];}},_0x56ca37=await _0x4a88a3(_0x588fcf[_0x26112f(0x124)],_0x4a44b2['parentId'],_0x47ca1c),_0xb8a67=_0x4a44b2['folderId']||_0x4a44b2[_0x26112f(0x112)];_0xb8a67&&(_0x56ca37[_0x26112f(0x163)]={'parentFolder':{'data':{'id':_0xb8a67,'type':_0x26112f(0x96)}}});if(_0x588fcf[_0x26112f(0x89)]){if(_0xcc2a49['size']>0x0||_0x49b72c[_0x26112f(0x102)]>0x0)return await executeThreeStepJourneyCreate(_0x11b996,_0x588fcf,_0x56ca37,{'pendingEmbeddedSegments':_0xcc2a49,'pendingEmbeddedActivations':_0x49b72c,'embeddedSegmentNameToId':_0x4ba5bb,'journeyActivationNameToId':_0x478422},{..._0x4a44b2,'effectiveFolderId':_0xb8a67},_0x4c0641,_0x36f362,_0x43fd61);else{ensureJourneyDefaults(_0x56ca37[_0x26112f(0xc6)]);const _0x4a7bec=await _0x11b996['journey'][_0x26112f(0x143)](_0x56ca37);return deletePushRecovery(_0x588fcf['absolutePath']),{'action':_0x26112f(0xa8),'journeyId':_0x4a7bec['id'],'embeddedSegmentNameToId':_0x4ba5bb};}}else{if(_0x588fcf[_0x26112f(0xe3)]&&_0x588fcf[_0x26112f(0x139)]){_0x56ca37['id']=_0x588fcf[_0x26112f(0x139)]['id'];const _0x3ecd98=_0x56ca37[_0x26112f(0xc6)];_0x588fcf[_0x26112f(0x139)]['attributes']?.[_0x26112f(0xd1)]&&(_0x3ecd98['journeyBundleName']=_0x588fcf[_0x26112f(0x139)][_0x26112f(0xc6)]['journeyBundleName']);const _0xf829d3=_0x588fcf[_0x26112f(0x139)][_0x26112f(0xc6)]?.[_0x26112f(0x15f)];return _0xf829d3&&_0x56ca37[_0x26112f(0xc6)][_0x26112f(0x15f)]&&injectExistingStageIds(_0x56ca37[_0x26112f(0xc6)][_0x26112f(0x15f)],_0xf829d3),ensureJourneyDefaults(_0x3ecd98),await _0x11b996[_0x26112f(0x164)]['update'](_0x588fcf[_0x26112f(0x139)]['id'],_0x56ca37),deletePushRecovery(_0x588fcf[_0x26112f(0x120)]),{'action':_0x26112f(0xde),'journeyId':_0x588fcf['existingJourney']['id'],'embeddedSegmentNameToId':_0x4ba5bb};}}return deletePushRecovery(_0x588fcf[_0x26112f(0x120)]),{'action':_0x26112f(0xe8),'journeyId':_0x588fcf[_0x26112f(0x139)]?.['id'],'embeddedSegmentNameToId':_0x4ba5bb};}function findSegmentCriteriaLocation(_0xa05284,_0x4d80b6){const _0x467053=a142_0x5a51,_0x10a0b5=_0xa05284[_0x467053(0x125)]||_0xa05284['journeys']?.[0x0]?.['stages']||[];let _0x278943=_0x467053(0xb0),_0x5f4b66=_0x4d80b6;const _0x2687f0=_0xa05284[_0x467053(0x9c)]||_0xa05284[_0x467053(0x14a)]?.[0x0]?.[_0x467053(0x9c)];if(_0x2687f0?.[_0x467053(0xf2)]===_0x4d80b6)return{'stageName':'goal','criteriaName':_0x2687f0[_0x467053(0x8c)]||_0x4d80b6};_0x3aa711:for(const _0x2906f9 of _0x10a0b5){if(_0x2906f9[_0x467053(0x13d)]?.['segment']===_0x4d80b6){_0x278943=_0x2906f9[_0x467053(0x8c)],_0x5f4b66=_0x2906f9['entry_criteria'][_0x467053(0x8c)]||_0x4d80b6;break;}if(_0x2906f9[_0x467053(0xba)])for(const _0x18cb51 of _0x2906f9[_0x467053(0xba)]){if(_0x18cb51[_0x467053(0xa2)]===_0x467053(0x184)&&_0x18cb51[_0x467053(0x175)]?.[_0x467053(0x187)])for(const _0x475ee1 of _0x18cb51['with'][_0x467053(0x187)]){if(_0x475ee1['segment']===_0x4d80b6){_0x278943=_0x2906f9[_0x467053(0x8c)],_0x5f4b66=_0x475ee1[_0x467053(0x8c)]||_0x4d80b6;break _0x3aa711;}}}}return{'stageName':_0x278943,'criteriaName':_0x5f4b66};}async function executeThreeStepJourneyCreate(_0x45f174,_0x44a949,_0x36f202,_0x21a199,_0x5c2421,_0x339f34,_0x263009,_0x44fffa){const _0x1d3fda=a142_0x5a51,{activationDefToCreateRequest:_0x446727,yamlRuleToApi:_0x47037d}=_0x44fffa,{pendingEmbeddedSegments:_0x4f7dba,pendingEmbeddedActivations:_0xcb41,embeddedSegmentNameToId:_0x3c12c7}=_0x21a199,_0x34f306=JSON[_0x1d3fda(0xc3)](JSON[_0x1d3fda(0x183)](_0x36f202));ensureJourneyDefaults(_0x34f306['attributes']),stripPendingIds(_0x34f306);const _0x2049b9=await _0x45f174[_0x1d3fda(0x164)][_0x1d3fda(0x143)](_0x34f306),_0x5394bd=_0x2049b9['id'],_0x3b179d=new Map();for(const _0x2a3cd7 of _0x2049b9[_0x1d3fda(0xc6)]['journeyStages']){_0x3b179d[_0x1d3fda(0x156)](_0x2a3cd7[_0x1d3fda(0x8c)][_0x1d3fda(0x16e)](),_0x2a3cd7['id']);}recoverSegmentIdsFromPushRecovery(_0x44a949,_0x3c12c7,_0x339f34[_0x1d3fda(0x151)]);for(const [_0x117703,{definition:_0x2ccd49}]of _0x4f7dba){if(_0x3c12c7[_0x1d3fda(0xd3)](_0x117703)){_0x263009[_0x1d3fda(0xad)]?.({'type':_0x1d3fda(0xa7),'journeyName':_0x44a949[_0x1d3fda(0x124)]['name'],'segmentName':_0x117703});continue;}const _0x355150=generateDeterministicJourneySegmentName(_0x44a949['yamlConfig']['name'],_0x117703);_0x263009[_0x1d3fda(0xad)]?.({'type':_0x1d3fda(0x16a),'journeyName':_0x44a949[_0x1d3fda(0x124)][_0x1d3fda(0x8c)],'segmentName':_0x117703});const _0x31089=createSegmentIdResolver(_0x339f34[_0x1d3fda(0x151)],_0x117703),_0x2fd1f1=await resolveRuleSegmentIds(_0x2ccd49['rule'],_0x31089),_0x1cbe96=await createOrRecoverEmbeddedSegment(_0x45f174,_0x44a949,{'localName':_0x117703,'uniqueSegmentName':_0x355150,'description':_0x2ccd49[_0x1d3fda(0x167)]||_0x1d3fda(0x127)+_0x117703,'journeyId':_0x5394bd,'resolvedRule':_0x2fd1f1,'parentId':_0x5c2421[_0x1d3fda(0xee)],'folderId':_0x5c2421[_0x1d3fda(0x88)]||''},_0x47037d);_0x3c12c7[_0x1d3fda(0x156)](_0x117703,_0x1cbe96),_0x339f34[_0x1d3fda(0x151)]['set'](_0x117703,_0x1cbe96),_0x263009[_0x1d3fda(0xad)]?.({'type':_0x1d3fda(0xa7),'journeyName':_0x44a949[_0x1d3fda(0x124)]['name'],'segmentName':_0x117703});}const _0x1a2738=new Map();for(const [_0x12839a,_0x1f9b9e]of _0xcb41){_0x263009['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x44a949[_0x1d3fda(0x124)]['name'],'activationName':_0x12839a});const _0x2afd9e=await _0x446727(_0x1f9b9e,_0x339f34[_0x1d3fda(0x86)]),_0x29481a={..._0x2afd9e,..._0x1f9b9e[_0x1d3fda(0xa6)]!==undefined&&{'runAfterJourneyRefresh':_0x1f9b9e[_0x1d3fda(0xa6)]}},_0x5c26fa=await _0x45f174['journey'][_0x1d3fda(0x136)](_0x5394bd,_0x29481a);_0x1a2738['set'](_0x12839a,_0x5c26fa['id']),_0x21a199['journeyActivationNameToId'][_0x1d3fda(0x156)](_0x12839a,_0x5c26fa['id']),_0x263009[_0x1d3fda(0xad)]?.({'type':_0x1d3fda(0x99),'journeyName':_0x44a949[_0x1d3fda(0x124)][_0x1d3fda(0x8c)],'activationName':_0x12839a});}const _0x52d4d7=JSON[_0x1d3fda(0xc3)](JSON['stringify'](_0x36f202));return _0x52d4d7['id']=_0x5394bd,ensureJourneyDefaults(_0x52d4d7[_0x1d3fda(0xc6)]),resolvePendingIdsInRequest(_0x52d4d7,_0x36f202,_0x3b179d,_0x3c12c7,_0x1a2738,_0x263009),await _0x45f174[_0x1d3fda(0x164)]['update'](_0x5394bd,_0x52d4d7),deletePushRecovery(_0x44a949[_0x1d3fda(0x120)]),{'action':_0x1d3fda(0xa8),'journeyId':_0x5394bd,'embeddedSegmentNameToId':_0x3c12c7};}export function stripWaitStepPendingIds(_0xde265b){const _0x3daa0b=a142_0x5a51,_0x3a4a4d=_0xde265b[_0x3daa0b(0x138)]&&isPendingSegmentId(_0xde265b[_0x3daa0b(0x138)]),_0x5df801=_0xde265b['conditions']?.[_0x3daa0b(0xc2)](_0x2936b0=>_0x2936b0[_0x3daa0b(0x95)]&&isPendingSegmentId(_0x2936b0[_0x3daa0b(0x95)]));(_0x3a4a4d||_0x5df801)&&(_0xde265b[_0x3daa0b(0x123)]='Duration',_0xde265b[_0x3daa0b(0x177)]=0x1,_0xde265b['waitStepUnit']=_0x3daa0b(0xf7),delete _0xde265b[_0x3daa0b(0x138)],delete _0xde265b['conditionTimeoutDuration'],delete _0xde265b['conditionTimeoutUnit'],delete _0xde265b[_0x3daa0b(0x108)]);}export function resolveWaitStepPendingIds(_0x1fcf0a,_0x562c46,_0xd9db44,_0x1056fa){const _0x528945=a142_0x5a51;if(_0x562c46[_0x528945(0x138)]&&isPendingSegmentId(_0x562c46['conditionSegmentId'])){const _0x4c2d90=_0xd9db44(_0x562c46[_0x528945(0x138)],_0x528945(0x15b)+_0x1056fa+_0x528945(0xe7));_0x4c2d90&&(_0x1fcf0a['waitStepType']='Condition',_0x1fcf0a[_0x528945(0x138)]=_0x4c2d90,delete _0x1fcf0a[_0x528945(0x177)],delete _0x1fcf0a[_0x528945(0x103)],_0x562c46[_0x528945(0xf0)]!==undefined&&(_0x1fcf0a[_0x528945(0xf0)]=_0x562c46['conditionTimeoutDuration']),_0x562c46[_0x528945(0x171)]&&(_0x1fcf0a[_0x528945(0x171)]=_0x562c46[_0x528945(0x171)]));}if(_0x562c46[_0x528945(0x108)]){const _0x136e33=_0x562c46[_0x528945(0x108)][_0x528945(0xc2)](_0x1c2b2a=>_0x1c2b2a[_0x528945(0x95)]&&isPendingSegmentId(_0x1c2b2a[_0x528945(0x95)]));if(_0x136e33){const _0x5aaab7=_0x562c46[_0x528945(0x108)]['map'](_0x22bb31=>{const _0x25764d=_0x528945;if(_0x22bb31[_0x25764d(0x95)]&&isPendingSegmentId(_0x22bb31['segmentId'])){const _0x7301b7=_0xd9db44(_0x22bb31[_0x25764d(0x95)],'stage\x20\x27'+_0x1056fa+'\x27\x20wait\x20condition');return{..._0x22bb31,'segmentId':_0x7301b7||_0x22bb31[_0x25764d(0x95)]};}return{..._0x22bb31};});_0x1fcf0a[_0x528945(0x123)]=_0x528945(0x13b),_0x1fcf0a[_0x528945(0x108)]=_0x5aaab7,delete _0x1fcf0a['waitStep'],delete _0x1fcf0a[_0x528945(0x103)],delete _0x1fcf0a['conditionSegmentId'],delete _0x1fcf0a[_0x528945(0xf0)],delete _0x1fcf0a['conditionTimeoutUnit'];}}}function stripPendingIds(_0x1ef132){const _0x2a9a68=a142_0x5a51;_0x1ef132[_0x2a9a68(0xc6)][_0x2a9a68(0x9c)]?.[_0x2a9a68(0x95)]&&isPendingSegmentId(_0x1ef132['attributes']['goal'][_0x2a9a68(0x95)])&&delete _0x1ef132[_0x2a9a68(0xc6)]['goal'];for(const _0x509508 of _0x1ef132['attributes']['journeyStages']||[]){_0x509508[_0x2a9a68(0x101)]?.['segmentId']&&isPendingSegmentId(_0x509508[_0x2a9a68(0x101)][_0x2a9a68(0x95)])&&delete _0x509508[_0x2a9a68(0x101)];_0x509508[_0x2a9a68(0xeb)]?.['segmentId']&&isPendingSegmentId(_0x509508[_0x2a9a68(0xeb)][_0x2a9a68(0x95)])&&delete _0x509508[_0x2a9a68(0xeb)];_0x509508[_0x2a9a68(0x168)]&&(_0x509508[_0x2a9a68(0x168)]=_0x509508[_0x2a9a68(0x168)]['filter'](_0x4bde94=>!_0x4bde94[_0x2a9a68(0x95)]||!isPendingSegmentId(_0x4bde94[_0x2a9a68(0x95)])));if(_0x509508[_0x2a9a68(0xba)])for(const _0x97d2e6 of Object[_0x2a9a68(0x10b)](_0x509508[_0x2a9a68(0xba)])){const _0x38c671=_0x509508[_0x2a9a68(0xba)][_0x97d2e6];_0x38c671[_0x2a9a68(0xa2)]===_0x2a9a68(0x178)&&_0x38c671[_0x2a9a68(0x11a)]&&isPendingActivationId(_0x38c671[_0x2a9a68(0x11a)])&&(_0x38c671['journeyActivationStepId']='');if(_0x38c671['type']===_0x2a9a68(0x10a)&&_0x38c671[_0x2a9a68(0x187)])for(const _0x597c66 of _0x38c671['branches']){_0x597c66[_0x2a9a68(0x95)]&&isPendingSegmentId(_0x597c66[_0x2a9a68(0x95)])&&(_0x597c66[_0x2a9a68(0x95)]='');}_0x38c671[_0x2a9a68(0xa2)]===_0x2a9a68(0x148)&&stripWaitStepPendingIds(_0x38c671);}}}function resolvePendingIdsInRequest(_0x410094,_0x5045bb,_0xc301b,_0xba1dd9,_0x3685a5,_0x30c072){const _0x27f3fb=a142_0x5a51,_0x9f1589=(_0x16815f,_0x5d9b8c)=>{const _0x519601=a142_0x42c6;if(!isPendingSegmentId(_0x16815f))return _0x16815f;const _0x572cb9=extractPendingSegmentName(_0x16815f),_0x52d497=_0xba1dd9[_0x519601(0x185)](_0x572cb9);return!_0x52d497&&_0x30c072[_0x519601(0xbc)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x572cb9+_0x519601(0xd2)+_0x5d9b8c),_0x52d497;};if(_0x410094['attributes']['goal']?.[_0x27f3fb(0x95)]&&isPendingSegmentId(_0x410094[_0x27f3fb(0xc6)]['goal'][_0x27f3fb(0x95)])){const _0x131035=_0x9f1589(_0x410094[_0x27f3fb(0xc6)]['goal'][_0x27f3fb(0x95)],_0x27f3fb(0x144));_0x131035&&(_0x410094[_0x27f3fb(0xc6)]['goal'][_0x27f3fb(0x95)]=_0x131035);}for(const _0x1593f1 of _0x410094[_0x27f3fb(0xc6)][_0x27f3fb(0x15f)]||[]){const _0x3448c0=_0xc301b[_0x27f3fb(0x185)](_0x1593f1[_0x27f3fb(0x8c)][_0x27f3fb(0x16e)]());_0x3448c0&&(_0x1593f1['id']=_0x3448c0);if(_0x1593f1[_0x27f3fb(0x101)]?.[_0x27f3fb(0x95)]&&isPendingSegmentId(_0x1593f1[_0x27f3fb(0x101)]['segmentId'])){const _0x4ffae4=_0x9f1589(_0x1593f1['entryCriteria'][_0x27f3fb(0x95)],_0x27f3fb(0x15b)+_0x1593f1[_0x27f3fb(0x8c)]+_0x27f3fb(0xc9));_0x4ffae4&&(_0x1593f1[_0x27f3fb(0x101)][_0x27f3fb(0x95)]=_0x4ffae4);}if(_0x1593f1[_0x27f3fb(0x168)])for(const _0x424150 of _0x1593f1[_0x27f3fb(0x168)]){if(_0x424150['segmentId']&&isPendingSegmentId(_0x424150['segmentId'])){const _0x569de2=_0x9f1589(_0x424150[_0x27f3fb(0x95)],_0x27f3fb(0x15b)+_0x1593f1['name']+_0x27f3fb(0xb4));_0x569de2&&(_0x424150['segmentId']=_0x569de2);}}if(_0x1593f1['milestone']?.['segmentId']&&isPendingSegmentId(_0x1593f1[_0x27f3fb(0xeb)]['segmentId'])){const _0xe8358b=_0x9f1589(_0x1593f1[_0x27f3fb(0xeb)][_0x27f3fb(0x95)],_0x27f3fb(0x15b)+_0x1593f1[_0x27f3fb(0x8c)]+'\x27\x20milestone');_0xe8358b&&(_0x1593f1[_0x27f3fb(0xeb)]['segmentId']=_0xe8358b);}if(_0x1593f1[_0x27f3fb(0xba)]){const _0x4d78cf=_0x149100=>_0x5045bb['attributes'][_0x27f3fb(0x15f)]?.[_0x27f3fb(0x16c)](_0x47de85=>_0x47de85[_0x27f3fb(0x8c)][_0x27f3fb(0x16e)]()===_0x1593f1[_0x27f3fb(0x8c)][_0x27f3fb(0x16e)]())?.[_0x27f3fb(0xba)]?.[_0x149100];for(const _0x10920b of Object[_0x27f3fb(0x10b)](_0x1593f1[_0x27f3fb(0xba)])){const _0x844122=_0x1593f1[_0x27f3fb(0xba)][_0x10920b],_0x1ae0cb=_0x4d78cf(_0x10920b);if(_0x844122[_0x27f3fb(0xa2)]===_0x27f3fb(0x178)&&_0x844122[_0x27f3fb(0x11a)]&&(isPendingActivationId(_0x844122[_0x27f3fb(0x11a)])||_0x844122[_0x27f3fb(0x11a)]==='')){if(_0x1ae0cb?.['journeyActivationStepId']&&isPendingActivationId(_0x1ae0cb[_0x27f3fb(0x11a)])){const _0x4d9f18=extractPendingActivationName(_0x1ae0cb[_0x27f3fb(0x11a)]),_0x13dfea=_0x3685a5[_0x27f3fb(0x185)](_0x4d9f18);_0x13dfea&&(_0x844122[_0x27f3fb(0x11a)]=_0x13dfea);}}if(_0x844122[_0x27f3fb(0xa2)]===_0x27f3fb(0x10a)&&_0x844122[_0x27f3fb(0x187)]&&_0x1ae0cb?.[_0x27f3fb(0x187)])for(let _0x40986f=0x0;_0x40986f<_0x844122[_0x27f3fb(0x187)][_0x27f3fb(0xec)];_0x40986f++){const _0x52c51d=_0x844122['branches'][_0x40986f],_0x2cf092=_0x1ae0cb[_0x27f3fb(0x187)][_0x40986f];if(_0x2cf092?.[_0x27f3fb(0x95)]&&isPendingSegmentId(_0x2cf092[_0x27f3fb(0x95)])){const _0x1b23b0=_0x9f1589(_0x2cf092[_0x27f3fb(0x95)],_0x27f3fb(0x15b)+_0x1593f1['name']+_0x27f3fb(0x117)+(_0x52c51d[_0x27f3fb(0x8c)]||_0x40986f)+'\x27');_0x1b23b0&&(_0x52c51d['segmentId']=_0x1b23b0);}}_0x844122[_0x27f3fb(0xa2)]==='WaitStep'&&_0x1ae0cb?.[_0x27f3fb(0xa2)]===_0x27f3fb(0x148)&&resolveWaitStepPendingIds(_0x844122,_0x1ae0cb,_0x9f1589,_0x1593f1[_0x27f3fb(0x8c)]);}}}}
|
|
1
|
+
const a142_0x5a306c=a142_0x7272;(function(_0x11be6a,_0x4d1bcd){const _0x9ff299=a142_0x7272,_0x39bdc5=_0x11be6a();while(!![]){try{const _0x36bd22=-parseInt(_0x9ff299(0x20a))/0x1*(parseInt(_0x9ff299(0x1f8))/0x2)+-parseInt(_0x9ff299(0x284))/0x3+parseInt(_0x9ff299(0x214))/0x4*(parseInt(_0x9ff299(0x1bb))/0x5)+parseInt(_0x9ff299(0x2b6))/0x6*(-parseInt(_0x9ff299(0x280))/0x7)+parseInt(_0x9ff299(0x1e6))/0x8*(parseInt(_0x9ff299(0x257))/0x9)+-parseInt(_0x9ff299(0x22a))/0xa+parseInt(_0x9ff299(0x297))/0xb*(parseInt(_0x9ff299(0x1af))/0xc);if(_0x36bd22===_0x4d1bcd)break;else _0x39bdc5['push'](_0x39bdc5['shift']());}catch(_0x112d68){_0x39bdc5['push'](_0x39bdc5['shift']());}}}(a142_0x9770,0x361de));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x5a306c(0x1dd));export const PENDING_SEGMENT_PREFIX=a142_0x5a306c(0x28f);export const PENDING_ACTIVATION_PREFIX=a142_0x5a306c(0x286);export function createPendingSegmentId(_0x5e4778){return''+PENDING_SEGMENT_PREFIX+_0x5e4778+'__';}export function isPendingSegmentId(_0x3c4370){const _0x33efd3=a142_0x5a306c;return _0x3c4370[_0x33efd3(0x220)](PENDING_SEGMENT_PREFIX)&&!_0x3c4370['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x178cb3){const _0x47ed00=a142_0x5a306c;return _0x178cb3[_0x47ed00(0x291)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x44165e){return''+PENDING_ACTIVATION_PREFIX+_0x44165e+'__';}export function isPendingActivationId(_0x1f259d){const _0x4ebffd=a142_0x5a306c;return _0x1f259d[_0x4ebffd(0x220)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4d6349){const _0x2adfec=a142_0x5a306c;return _0x4d6349[_0x2adfec(0x291)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4ea77,_0x18356c){const _0x3f486c=a142_0x5a306c,_0x17a8aa=_0x4ea77+'::'+(_0x18356c[_0x3f486c(0x22e)]()||_0x3f486c(0x293)),_0x43c501=createHash(_0x3f486c(0x227))['update'](_0x17a8aa)[_0x3f486c(0x1b7)](_0x3f486c(0x1bd))[_0x3f486c(0x25f)](0x0,0xc);return'journey_entry_criteria_'+_0x43c501;}export function ensureJourneyDefaults(_0x2f66da){const _0x2921de=a142_0x5a306c;!_0x2f66da[_0x2921de(0x1ba)]&&(_0x2f66da[_0x2921de(0x1ba)]=''),!_0x2f66da['state']&&(_0x2f66da[_0x2921de(0x26c)]=_0x2921de(0x23a));}export function injectExistingStageIds(_0x14c97d,_0x5324ff){const _0x4a080c=a142_0x5a306c,_0x2d7ed4=new Map(_0x5324ff[_0x4a080c(0x26f)](_0x227008=>[_0x227008[_0x4a080c(0x279)],_0x227008['id']]));for(const _0x3911bb of _0x14c97d){if(!_0x3911bb['id']){const _0x148f8a=_0x2d7ed4[_0x4a080c(0x219)](_0x3911bb[_0x4a080c(0x279)]);_0x148f8a&&(_0x3911bb['id']=_0x148f8a);}}}export function resolveTDFolderPath(_0x439de5,_0x2877d6,_0x2c9326){const _0x217f0a=a142_0x5a306c;if(!_0x2877d6)return _0x439de5;if(_0x439de5===_0x2c9326||_0x439de5[_0x217f0a(0x220)](_0x2c9326+'/'))return _0x439de5;return _0x439de5?_0x2c9326+'/'+_0x439de5:_0x2c9326;}export function addFoldersToCreate(_0x12f1cf,_0x121be0,_0x4f841e){const _0xe9dcf3=a142_0x5a306c;if(!_0x12f1cf)return;if(_0x121be0[_0xe9dcf3(0x26b)](_0x12f1cf))return;const _0x164cf5=_0x12f1cf[_0xe9dcf3(0x215)]('/');let _0xe76417='';for(const _0x3dddb8 of _0x164cf5){_0xe76417=_0xe76417?_0xe76417+'/'+_0x3dddb8:_0x3dddb8,!_0x121be0[_0xe9dcf3(0x26b)](_0xe76417)&&_0x4f841e[_0xe9dcf3(0x1c8)](_0xe76417);}}function a142_0x9770(){const _0x21c190=['join','has','state','created','activation_updated','map','deleted','folder_creating','reduce','match','segments','Created\x20segment\x20\x27','Segment\x20not\x20found:\x20','activationStepsById','conditionTimeoutUnit','name','logDeleted','Failed\x20to\x20fetch\x20referenced\x20segment\x20','../../utils/async.js','segmentByFolderAndName','\x20segment\x20from\x20file:\x20','segment_creating','1441370BzjdoY','parse','Creating\x20segment\x20\x27','getJourney','1284984OiPFwf','exitCriterias','__pending_act_','logInfo','idToName','hasChanges','list','updated','decision_point','diff','and\x20the\x20server\x20segment,\x20then\x20retry.','__pending_','Segment\x20not\x20found','replace','isNew','segment','Created\x20journey\x20\x27','SEGMENT_NOT_FOUND','uniqueServerName','81587YEhnpE','data','connector_config','toString','getSegmentEntity\x20also\x20failed\x20for\x20','nameToType','journeyActivationNameToId','folder','toISOString','journeyBundlesByFolderAndName','SEGMENT_SYNTAX_ERROR','nameToId','logWarning','Updated\x20segment\x20\x27','createSegment','yamlActivation','getSegment\x20failed\x20for\x20','Failed\x20to\x20','embedded_activation_creating','rootFolderId','activation_template_id','rule','conditionSegmentId','Activation','branches','getSegment','stages','valid','segment_updated','entryCriteria','parentId','6eUlWeG','journeyById','):\x20','set','\x27...','folderId','from','1464WJwDQv','\x27\x20from\x20file:\x20','Entry\x20criteria:\x20','deleteActivation','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','behavior',').\x20','./child-segment-yaml.js','digest','item','Updated\x20activation\x20\x27','description','1355JlSoJY','type','hex','run_after_journey_refresh','toLowerCase','debug','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','existingSegments','updateActivation','resolveJourneyId','journeys','JOURNEY_SYNTAX_ERROR','skipSegments','add','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','includes','segmentFolderId','activationActions','activationContext','Creating\x20folder\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','entry_criteria','DecisionPoint','columns','Created\x20folder\x20\x27','journeyBundleId','verbose','activationParams','folderPathToId','createJourneySegment','NOT_FOUND','folder_created','conditionTimeoutDuration','waitStep','tdx.sdk.push-workflow','deps','max','journeyName','segment_deleted','\x0a\x20\x20','journey_creating','\x20journey\x20from\x20file:\x20','isArray','123992zNvbeG','journeyId','delete','entry','Matched\x20server\x20segment\x20\x27','index','Fetching\x20','schedule','updateSegmentById','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','waitStepUnit','existingSegment','Journey\x20\x27','folderPath','goal','Stage\x20\x27','createdSegmentId','versionNumber','160978OHNZSq','Deleted\x20activation\x20\x27','connection','Created\x20activation\x20\x27','withProgress','Updating\x20activation\x20\x27','existingActivation','activation_updating','\x27\x20to\x20local\x20\x27','activation_creating','relationships','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','values','journeyActivationStepId','Failed\x20to\x20resolve\x20activation\x20','segment_deleting','size','update','2NPPaTK','Name\x20has\x20already\x20been\x20taken',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','yamlConfig','journeyBundleName','waitStepType','flatMap','absolutePath','activations','.$1.push-recovery.json','1972XaptNN','split','find','ACTIVATION_UPDATE_ERROR','goal\x20criteria','get','keys','segmentId','segmentNameToId','conditions','JOURNEY_UPDATE_ERROR','journeyStages','startsWith','errors','deleteSegment','resolvedRule','utf-8','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','dirname','sha1','createdSegmentIds','all','370980EtCagR','length','buildUserMaps','activation_created','trim','INTERNAL','embedded_segment_created','message','localName','Condition','with','attributes','results','idToEmailMap','\x27\x20wait\x20condition','milestone','draft','onProgress','createActivation','progress','validatedRequest','effectiveFolderId','\x27\x20entry\x20criteria','sort','parentFolder','Embedded\x20segment\x20\x27','create','Creating\x20activation\x20\x27','relative','parseDocument','logSuccess','steps','\x20activation\x20\x27','null','listActivations','filter','connectionIdToNameMap','uniqueSegmentName','entries','SEGMENT_UPDATE_ERROR','embedded_activation_created','Updated\x20journey\x20\x27','stage\x20\x27','notification','existingJourney','9JgSSdq','\x27\x20by\x20rule\x20content','Failed\x20to\x20resolve\x20segment\x20','\x27\x20exit\x20criteria','stringify','embeddedSegmentNameToId','\x27\x20not\x20found\x20in\x20journey\x20\x27','push','slice','WaitStep','action','Updating\x20segment\x20\x27','resolveSegment','unchanged','\x27\x20milestone','./journey-yaml.js','getActivation','journey','some'];a142_0x9770=function(){return _0x21c190;};return a142_0x9770();}export function sortFoldersByDepth(_0x522e2a){const _0x100cf3=a142_0x5a306c;return[..._0x522e2a][_0x100cf3(0x241)]((_0x328ce6,_0x4fc185)=>{const _0x55193a=_0x100cf3,_0x21bd3f=(_0x328ce6[_0x55193a(0x273)](/\//g)||[])[_0x55193a(0x22b)],_0xe43ddf=(_0x4fc185[_0x55193a(0x273)](/\//g)||[])['length'];return _0x21bd3f-_0xe43ddf;});}import*as a142_0x2f4ea7 from'yaml';function a142_0x7272(_0x3ff13e,_0x1ad1c6){_0x3ff13e=_0x3ff13e-0x1aa;const _0x97708f=a142_0x9770();let _0x7272f9=_0x97708f[_0x3ff13e];return _0x7272f9;}import{readFileSync}from'fs';import a142_0x45daf7 from'path';import{isJourneyDef,parseYamlString as a142_0x26fe56,toYamlString as a142_0x564648,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(_0x46f9ed){const _0x22fff8=a142_0x5a306c;if(Array[_0x22fff8(0x1e5)](_0x46f9ed))return'['+_0x46f9ed[_0x22fff8(0x26f)](_0x63d0e2=>stableStringify(_0x63d0e2))[_0x22fff8(0x26a)](',')+']';if(_0x46f9ed&&typeof _0x46f9ed==='object'){const _0x5d7736=_0x46f9ed,_0x582bcf=Object[_0x22fff8(0x21a)](_0x5d7736)[_0x22fff8(0x241)](),_0x4e2928=_0x582bcf[_0x22fff8(0x26f)](_0x7f718=>'\x22'+_0x7f718+'\x22:'+stableStringify(_0x5d7736[_0x7f718]));return'{'+_0x4e2928[_0x22fff8(0x26a)](',')+'}';}const _0x12b837=JSON[_0x22fff8(0x25b)](_0x46f9ed);return _0x12b837===undefined?_0x22fff8(0x24b):_0x12b837;}function activationSignature(_0x5610f6){const _0x24e578=a142_0x5a306c,_0x25a7e2={'connection':_0x5610f6['connection'],..._0x5610f6['all_columns']!==undefined&&{'all_columns':_0x5610f6['all_columns']},..._0x5610f6[_0x24e578(0x1d2)]!==undefined&&{'columns':_0x5610f6[_0x24e578(0x1d2)]},..._0x5610f6[_0x24e578(0x1b4)]!==undefined&&{'behavior':_0x5610f6['behavior']},..._0x5610f6[_0x24e578(0x1ed)]!==undefined&&{'schedule':_0x5610f6[_0x24e578(0x1ed)]},..._0x5610f6[_0x24e578(0x255)]!==undefined&&{'notification':_0x5610f6['notification']},..._0x5610f6[_0x24e578(0x299)]!==undefined&&{'connector_config':_0x5610f6[_0x24e578(0x299)]},..._0x5610f6[_0x24e578(0x2ab)]!==undefined&&{'activation_template_id':_0x5610f6[_0x24e578(0x2ab)]}};return stableStringify(_0x25a7e2);}async function fetchSegment(_0x2457f7,_0x25c947,_0x30c755,_0x36d36b){const _0x2337d0=a142_0x5a306c,_0x4f2af3=_0x36d36b?.[_0x2337d0(0x216)](_0x4569f6=>_0x4569f6['id']===_0x30c755);if(_0x4f2af3)return _0x4f2af3;try{return await _0x2457f7[_0x2337d0(0x293)][_0x2337d0(0x2b0)](_0x25c947,_0x30c755);}catch(_0x36fdd4){logger['debug'](_0x2337d0(0x2a7)+_0x30c755+_0x2337d0(0x20c)+_0x36fdd4);try{return await _0x2457f7[_0x2337d0(0x293)]['getSegmentEntity'](_0x30c755);}catch(_0x2992f0){return logger[_0x2337d0(0x1c0)](_0x2337d0(0x29b)+_0x30c755+':\x20'+_0x2992f0),null;}}}function recoverSegmentIdsFromPushRecovery(_0x190052,_0x5983b3,_0x1d2de2){const _0x5e4fd7=a142_0x5a306c,_0x2a2bf0=readPushRecovery(_0x190052[_0x5e4fd7(0x211)]);if(_0x2a2bf0?.[_0x5e4fd7(0x1e0)]===_0x190052['yamlConfig']['name'])for(const [_0x600770,_0x18224d]of Object[_0x5e4fd7(0x250)](_0x2a2bf0['segments'])){const _0x26e2b1=generateDeterministicJourneySegmentName(_0x190052[_0x5e4fd7(0x20d)][_0x5e4fd7(0x279)],_0x600770);_0x18224d[_0x5e4fd7(0x296)]===_0x26e2b1&&(_0x5983b3[_0x5e4fd7(0x1ab)](_0x600770,_0x18224d[_0x5e4fd7(0x21b)]),_0x1d2de2[_0x5e4fd7(0x1ab)](_0x600770,_0x18224d[_0x5e4fd7(0x21b)]));}}async function createOrRecoverEmbeddedSegment(_0x4543a0,_0x686662,_0x3308b5,_0x5e43f1){const _0x279d9d=a142_0x5a306c;let _0x37a0a1;try{_0x37a0a1=await _0x4543a0[_0x279d9d(0x293)][_0x279d9d(0x1d8)]({'name':_0x3308b5['uniqueSegmentName'],'description':_0x3308b5[_0x279d9d(0x1ba)],'journeyId':_0x3308b5[_0x279d9d(0x1e7)],'rule':_0x5e43f1(_0x3308b5[_0x279d9d(0x223)],!![]),'countPopulation':!![],'parentFolderId':_0x3308b5['folderId'],'audienceId':_0x3308b5[_0x279d9d(0x2b5)]});}catch(_0x578e11){const _0x16dd1e=_0x578e11 instanceof Error&&_0x578e11[_0x279d9d(0x231)][_0x279d9d(0x1ca)](_0x279d9d(0x20b));if(_0x16dd1e){const _0x5a8fe7=readPushRecovery(_0x686662[_0x279d9d(0x211)]),_0x4225c8=_0x5a8fe7?.[_0x279d9d(0x1e0)]===_0x686662[_0x279d9d(0x20d)]['name']?_0x5a8fe7[_0x279d9d(0x274)][_0x3308b5[_0x279d9d(0x232)]]:undefined;if(_0x4225c8?.[_0x279d9d(0x296)]===_0x3308b5[_0x279d9d(0x24f)])await _0x4543a0[_0x279d9d(0x293)][_0x279d9d(0x1ee)](_0x3308b5[_0x279d9d(0x2b5)],_0x4225c8[_0x279d9d(0x21b)],{'description':_0x3308b5['description'],'rule':_0x5e43f1(_0x3308b5[_0x279d9d(0x223)],!![]),'countPopulation':!![]}),_0x37a0a1=_0x4225c8[_0x279d9d(0x21b)];else throw new SDKError(ErrorCode[_0x279d9d(0x251)],_0x279d9d(0x243)+_0x3308b5[_0x279d9d(0x232)]+_0x279d9d(0x1c1)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x686662['absolutePath'][_0x279d9d(0x291)](/([^/]+)$/,_0x279d9d(0x213))+')\x20')+_0x279d9d(0x28e),_0x578e11);}else throw _0x578e11;}return saveSegmentToPushRecovery(_0x686662[_0x279d9d(0x211)],_0x686662[_0x279d9d(0x20d)][_0x279d9d(0x279)],_0x3308b5['localName'],{'segmentId':_0x37a0a1,'uniqueServerName':_0x3308b5['uniqueSegmentName'],'createdAt':new Date()[_0x279d9d(0x29f)]()}),_0x37a0a1;}export async function prepareSegmentFiles(_0x373f01,_0x420385,_0x3b9702,_0x52087d,_0xafcdb3){const _0x54abf2=a142_0x5a306c,{activationDefToCreateRequest:_0x3207a0}=await import(_0x54abf2(0x1b6)),_0x692a3c=[],_0x3b5541=new Set();for(const {yamlConfig:_0x6469da,folderPath:_0x3bc138,sourcePath:_0x2a8fdd}of _0x373f01){const _0x23c85b=resolveTDFolderPath(_0x3bc138,_0x52087d,_0xafcdb3),_0x142ca5=_0x23c85b+':'+_0x6469da[_0x54abf2(0x279)],_0x554be1=_0x420385[_0x54abf2(0x27d)][_0x54abf2(0x219)](_0x142ca5),_0x52edbd=_0x554be1?_0x420385['activationsBySegmentId']['get'](_0x554be1['id'])||[]:[];addFoldersToCreate(_0x23c85b,_0x420385[_0x54abf2(0x1d7)],_0x3b5541);const _0x3db924=calculateActivationActions(_0x6469da[_0x54abf2(0x212)]||[],_0x52edbd,_0x420385[_0x54abf2(0x237)],_0x420385[_0x54abf2(0x24e)]);for(const _0x168a2a of _0x3db924){(_0x168a2a['type']===_0x54abf2(0x244)||_0x168a2a[_0x54abf2(0x1bc)]===_0x54abf2(0x209))&&_0x168a2a[_0x54abf2(0x2a6)]&&(_0x168a2a['validatedRequest']=await _0x3207a0(_0x168a2a['yamlActivation'],_0x3b9702));}const _0x350c00=calculateSegmentDiff(_0x6469da,_0x554be1,_0x52edbd,_0x420385[_0x54abf2(0x237)],_0x420385['connectionIdToNameMap']);_0x692a3c[_0x54abf2(0x25e)]({'relativePath':_0x6469da['name'],'absolutePath':_0x2a8fdd,'yamlConfig':_0x6469da,'folderPath':_0x23c85b,'existingSegment':_0x554be1,'existingActivations':_0x52edbd,'isNew':_0x350c00[_0x54abf2(0x292)],'hasChanges':_0x350c00[_0x54abf2(0x289)],'diff':_0x350c00[_0x54abf2(0x28d)],'activationActions':_0x3db924});}return{'segmentFiles':_0x692a3c,'foldersToCreate':_0x3b5541};}export async function prepareJourneyFiles(_0xf1d2d1,_0x5a21d3,_0x30a786,_0x169fad){const _0x4b2bd8=a142_0x5a306c,_0x4bbc43=[],_0x1d409a=new Set();for(const {yamlConfig:_0x204569,folderPath:_0x3ca2de,sourcePath:_0x46d807}of _0xf1d2d1){const _0xc33c4a=resolveTDFolderPath(_0x3ca2de,_0x30a786,_0x169fad),_0x2554bb=_0xc33c4a+':'+_0x204569[_0x4b2bd8(0x279)],_0x21124e=_0x5a21d3[_0x4b2bd8(0x2a0)][_0x4b2bd8(0x219)](_0x2554bb);let _0x2e1ec2,_0x174b14;if(_0x21124e&&_0x21124e[_0x4b2bd8(0x22b)]>0x0){const _0x367a3d=buildLocalExpandedRuleMappings(_0x204569),{createYamlContext:_0x57d692,prefetchJourneySegments:_0x5c0717}=createPushYamlContextForBundle(_0x5a21d3[_0x4b2bd8(0x1de)],_0x5a21d3[_0x4b2bd8(0x2b5)],_0x5a21d3[_0x4b2bd8(0x1c2)],_0x367a3d,_0x5a21d3['idToEmailMap'],_0x5a21d3[_0x4b2bd8(0x24e)],_0x5a21d3[_0x4b2bd8(0x277)],_0x5a21d3[_0x4b2bd8(0x2b7)]);await _0x5c0717(_0x21124e['map'](_0x3fa293=>_0x3fa293['id']));const _0x16dfb8=await _0x5a21d3[_0x4b2bd8(0x1de)]['journey']['getLatestJourneyId'](_0x21124e[0x0][_0x4b2bd8(0x1d4)]),_0x13dfcc=hasMultipleVersions(_0x204569),_0x2ab7d9=async _0x11b690=>{const _0x20ccc8=_0x4b2bd8,_0x562a6f=_0x5a21d3[_0x20ccc8(0x2b7)]?.[_0x20ccc8(0x219)](_0x11b690);if(_0x562a6f)return _0x562a6f;return _0x5a21d3['fetchJourney']({'journeyId':_0x11b690,'journeyName':_0x204569['name'],'isMultiVersion':_0x21124e[_0x20ccc8(0x22b)]>0x1});};if(_0x13dfcc&&_0x21124e[_0x4b2bd8(0x22b)]>0x1){const _0x5d0f39=[];for(const _0x1842e4 of _0x21124e){const _0x600190=_0x1842e4[_0x4b2bd8(0x1f7)]||0x1;_0x5a21d3[_0x4b2bd8(0x23d)]?.[_0x4b2bd8(0x209)](_0x4b2bd8(0x1ec)+_0x204569['name']+'\x20v'+_0x600190);const _0x5de595=await _0x2ab7d9(_0x1842e4['id']),_0x34a3d0=_0x57d692(_0x1842e4['id']),_0x435fe5=await journeyResponseToDef(_0x5de595,_0x34a3d0);_0x5d0f39['push']({'item':_0x1842e4,'yaml':_0x435fe5});}const _0x3b8751=buildLocalRuleToNameMappingFromJourney(_0x204569);_0x174b14=buildMergedJourneyDef(_0x5d0f39,_0x3b8751,_0x16dfb8);const _0x555d1f=Math[_0x4b2bd8(0x1df)](..._0x5d0f39[_0x4b2bd8(0x26f)](_0x33ddb6=>_0x33ddb6[_0x4b2bd8(0x1b8)][_0x4b2bd8(0x1f7)]||0x0)),_0x499b1f=_0x21124e[_0x4b2bd8(0x216)](_0x727b99=>(_0x727b99[_0x4b2bd8(0x1f7)]||0x0)===_0x555d1f);_0x499b1f&&(_0x5a21d3['progress']?.['update']('Fetching\x20'+_0x204569[_0x4b2bd8(0x279)]+'\x20v'+_0x555d1f),_0x2e1ec2=await _0x2ab7d9(_0x499b1f['id']));}else{const _0x22553d=_0x21124e[_0x21124e['length']-0x1];_0x5a21d3[_0x4b2bd8(0x23d)]?.[_0x4b2bd8(0x209)](_0x4b2bd8(0x1ec)+_0x204569[_0x4b2bd8(0x279)]),_0x2e1ec2=await _0x2ab7d9(_0x22553d['id']);const _0x538181=_0x57d692(_0x22553d['id']),_0x4049be=await journeyResponseToDef(_0x2e1ec2,_0x538181),_0x3ccf33=buildLocalRuleToNameMappingFromJourney(_0x204569);_0x174b14=buildMergedJourneyDef([{'item':_0x22553d,'yaml':_0x4049be}],_0x3ccf33,_0x16dfb8);}}addFoldersToCreate(_0xc33c4a,_0x5a21d3[_0x4b2bd8(0x1d7)],_0x1d409a);const _0x482e66=calculateJourneyDiff(_0x204569,_0x174b14);_0x4bbc43[_0x4b2bd8(0x25e)]({'relativePath':_0x204569[_0x4b2bd8(0x279)],'absolutePath':_0x46d807,'yamlConfig':_0x204569,'folderPath':_0xc33c4a,'existingJourney':_0x2e1ec2,'isNew':_0x482e66['isNew'],'hasChanges':_0x482e66[_0x4b2bd8(0x289)],'diff':_0x482e66[_0x4b2bd8(0x28d)]});}return{'journeyFiles':_0x4bbc43,'foldersToCreate':_0x1d409a};}export function calculateActivationActions(_0x1863c2,_0xa5ca35,_0x3bce3a,_0x152c9e){const _0xf1553a=a142_0x5a306c,_0x36c09e=[],_0x3513bc=new Map();for(const _0x338fa1 of _0xa5ca35){_0x3513bc[_0xf1553a(0x1ab)](_0x338fa1[_0xf1553a(0x279)],_0x338fa1);}const _0xea000b=new Map();for(const _0x307ea2 of _0x1863c2){_0xea000b[_0xf1553a(0x1ab)](_0x307ea2[_0xf1553a(0x279)],_0x307ea2);}for(const _0x5d711f of _0x1863c2){const _0x3ef883=_0x3513bc[_0xf1553a(0x219)](_0x5d711f[_0xf1553a(0x279)]);if(!_0x3ef883)_0x36c09e[_0xf1553a(0x25e)]({'type':_0xf1553a(0x244),'name':_0x5d711f['name'],'yamlActivation':_0x5d711f});else{const _0x524261=activationResponseToDef(_0x3ef883,_0x3bce3a,_0x152c9e),_0x1a0312=a142_0x2f4ea7[_0xf1553a(0x25b)](_0x524261),_0x162493=a142_0x2f4ea7[_0xf1553a(0x25b)](_0x5d711f);_0x1a0312!==_0x162493&&_0x36c09e[_0xf1553a(0x25e)]({'type':_0xf1553a(0x209),'name':_0x5d711f[_0xf1553a(0x279)],'yamlActivation':_0x5d711f,'existingActivation':_0x3ef883});}}for(const _0x3667b5 of _0xa5ca35){!_0xea000b[_0xf1553a(0x26b)](_0x3667b5[_0xf1553a(0x279)])&&_0x36c09e[_0xf1553a(0x25e)]({'type':_0xf1553a(0x1e8),'name':_0x3667b5[_0xf1553a(0x279)],'existingActivation':_0x3667b5});}return _0x36c09e;}function calculateYamlDiff(_0x6f2cb3,_0x3ac187){if(_0x3ac187){const _0x8ccc59=generateDiff(_0x3ac187,_0x6f2cb3),_0x6c4d15=hasChanges(_0x8ccc59);return{'isNew':![],'hasChanges':_0x6c4d15,'diff':_0x6c4d15?formatDiffWithColors(_0x8ccc59):undefined};}const _0x581cb4=generateDiff('',_0x6f2cb3);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x581cb4)};}export function calculateSegmentDiff(_0x3308b8,_0x436cd7,_0x54b692,_0x46685e,_0x781a1c){const _0x56ceda=segmentToYamlString(_0x3308b8),_0x419aae=_0x436cd7?segmentToYamlString(segmentWithActivationsToYaml(_0x436cd7,_0x54b692,undefined,_0x46685e,_0x781a1c)):undefined;return calculateYamlDiff(_0x56ceda,_0x419aae);}export function calculateJourneyDiff(_0x38141c,_0x19ecdd){const _0x726fb9=normalizeJourneyDef(_0x38141c,_0x38141c),_0x5437bb=a142_0x564648(_0x726fb9),_0x2ce9ae=_0x19ecdd?a142_0x564648(normalizeJourneyDef(_0x19ecdd,_0x38141c)):undefined;return calculateYamlDiff(_0x5437bb,_0x2ce9ae);}export function findSegmentsToDelete(_0x4ff70b,_0xaf7751,_0x1ebae1,_0x1bca0e,_0x31e0c5){const _0xb4b4c=a142_0x5a306c,_0x114cbe=new Set();for(const {yamlConfig:_0x4f1ebb,folderPath:_0x366d23}of _0xaf7751){_0x114cbe[_0xb4b4c(0x1c8)](_0x366d23+':'+_0x4f1ebb[_0xb4b4c(0x279)]);}return _0x4ff70b[_0xb4b4c(0x24d)](_0xb912e6=>{const _0x39613d=_0xb4b4c,_0x582aab=_0xb912e6['segmentFolderId']?_0x1ebae1[_0x39613d(0x219)](_0xb912e6[_0x39613d(0x1cb)][_0x39613d(0x29a)]())||'':'',_0x5ad74b=_0x582aab+':'+_0xb912e6[_0x39613d(0x279)];if(_0x114cbe[_0x39613d(0x26b)](_0x5ad74b))return![];if(_0x31e0c5)return _0x582aab===_0x1bca0e||_0x582aab[_0x39613d(0x220)](_0x1bca0e+'/');return!![];});}export function findJourneysToDelete(_0x341b79,_0x2d59be,_0x1fc4f9,_0x7ac910,_0x55484f){const _0x5678d4=a142_0x5a306c,_0x575168=new Set();for(const {yamlConfig:_0x23c9c7,folderPath:_0x237152}of _0x2d59be){_0x575168['add'](_0x237152+':'+_0x23c9c7[_0x5678d4(0x279)]);}return _0x341b79[_0x5678d4(0x24d)](_0x1f5409=>{const _0x29bc3b=_0x5678d4,_0x385672=_0x1f5409[_0x29bc3b(0x1ad)]?_0x1fc4f9[_0x29bc3b(0x219)](_0x1f5409[_0x29bc3b(0x1ad)])||'':'',_0x229a74=_0x385672+':'+_0x1f5409[_0x29bc3b(0x20e)];if(_0x575168[_0x29bc3b(0x26b)](_0x229a74))return![];if(_0x55484f)return _0x385672===_0x7ac910||_0x385672[_0x29bc3b(0x220)](_0x7ac910+'/');return!![];});}export function buildSegmentLookupMap(_0x514864,_0x496a50){const _0x5a5e3e=a142_0x5a306c,_0x2bc6a6=new Map();for(const _0x21cfdc of _0x514864){const _0x2f2fd1=_0x21cfdc[_0x5a5e3e(0x1cb)]?_0x496a50['get'](_0x21cfdc[_0x5a5e3e(0x1cb)][_0x5a5e3e(0x29a)]())||'':'',_0x50a526=_0x2f2fd1+':'+_0x21cfdc[_0x5a5e3e(0x279)];_0x2bc6a6[_0x5a5e3e(0x1ab)](_0x50a526,_0x21cfdc);}return _0x2bc6a6;}export function buildSegmentNameToIdMap(_0x1f0cc1){const _0x48a55d=new Map();for(const _0x257968 of _0x1f0cc1){_0x48a55d['set'](_0x257968['name'],_0x257968['id']);}return _0x48a55d;}export function buildJourneyBundleLookupMap(_0x3442ad,_0x4976c2){const _0x1881b8=a142_0x5a306c,_0x34b47e=new Map();for(const _0x558a12 of _0x3442ad){const _0x47ce37=_0x558a12['folderId']?_0x4976c2[_0x1881b8(0x219)](_0x558a12[_0x1881b8(0x1ad)])||'':'',_0x5a0e4c=_0x47ce37+':'+_0x558a12['journeyBundleName'];!_0x34b47e[_0x1881b8(0x26b)](_0x5a0e4c)&&_0x34b47e['set'](_0x5a0e4c,[]),_0x34b47e[_0x1881b8(0x219)](_0x5a0e4c)['push'](_0x558a12);}for(const _0x563440 of _0x34b47e[_0x1881b8(0x204)]()){_0x563440[_0x1881b8(0x241)]((_0x486fef,_0x5429d7)=>(_0x486fef[_0x1881b8(0x1f7)]||0x0)-(_0x5429d7[_0x1881b8(0x1f7)]||0x0));}return _0x34b47e;}export function collectFoldersToCreate(_0x2d7fa8,_0x39a4f6){const _0x29ed85=a142_0x5a306c,_0x588bfd=new Set();for(const _0x5a6632 of _0x2d7fa8){if(!_0x5a6632)continue;if(_0x39a4f6['has'](_0x5a6632))continue;const _0xd8db6c=_0x5a6632[_0x29ed85(0x215)]('/');let _0x4f7a33='';for(const _0x412651 of _0xd8db6c){_0x4f7a33=_0x4f7a33?_0x4f7a33+'/'+_0x412651:_0x412651,!_0x39a4f6[_0x29ed85(0x26b)](_0x4f7a33)&&_0x588bfd['add'](_0x4f7a33);}}return _0x588bfd;}export function parseAndClassifyYamlFiles(_0x324f21,_0x1705fe,_0x3b3476){const _0x5e7b61=a142_0x5a306c,_0x35f450=[],_0x346899=[];for(const _0x6b0907 of _0x324f21){const _0x3e7054=a142_0x45daf7[_0x5e7b61(0x246)](_0x1705fe,a142_0x45daf7[_0x5e7b61(0x226)](_0x6b0907)),_0x2a622c=_0x3e7054==='.'?'':_0x3e7054,_0x17d768=readFileSync(_0x6b0907,_0x5e7b61(0x224)),_0x5bf7c4=a142_0x2f4ea7[_0x5e7b61(0x281)](_0x17d768);if(isJourneyDef(_0x5bf7c4)){const _0x37b3d4=a142_0x26fe56(_0x17d768);_0x346899['push']({'yamlConfig':_0x37b3d4,'folderPath':_0x2a622c,'sourcePath':_0x6b0907});}else{if(!_0x3b3476?.[_0x5e7b61(0x1c7)]){const _0xd6e78e=parseSegmentYamlFile(_0x17d768),_0x16d112=normalizeChildSegmentYaml(_0xd6e78e);_0x35f450[_0x5e7b61(0x25e)]({'yamlConfig':_0x16d112,'folderPath':_0x2a622c,'sourcePath':_0x6b0907});}}}return{'segments':_0x35f450,'journeys':_0x346899};}export function validateParsedFiles(_0x5cf580,_0x2cd217){const _0x4c30f6=a142_0x5a306c,_0x4ea173=[];for(const {yamlConfig:_0x8bca1c,sourcePath:_0x55fa15}of _0x5cf580['segments']){const _0x2d8c78=readFileSync(_0x55fa15,_0x4c30f6(0x224)),_0x3fec05=a142_0x2f4ea7[_0x4c30f6(0x247)](_0x2d8c78),_0x4de930=validateSegmentDef(_0x8bca1c,{'source':_0x2d8c78,'document':_0x3fec05},{'skipSchema':!![]});if(!_0x4de930[_0x4c30f6(0x2b2)]){const _0x2b4368=a142_0x45daf7[_0x4c30f6(0x246)](_0x2cd217,_0x55fa15);_0x4ea173['push']({'filePath':_0x2b4368,'source':_0x2d8c78,'result':_0x4de930,'isJourney':![]});}}for(const {yamlConfig:_0x1a4c96,sourcePath:_0x2bd0e3}of _0x5cf580[_0x4c30f6(0x1c5)]){const _0x6fa27c=readFileSync(_0x2bd0e3,_0x4c30f6(0x224)),_0x26d728=a142_0x2f4ea7[_0x4c30f6(0x247)](_0x6fa27c),_0x22553c=validateJourneyDef(_0x1a4c96,{'source':_0x6fa27c,'document':_0x26d728},{'skipSchema':!![]});if(!_0x22553c[_0x4c30f6(0x2b2)]){const _0x1a4ea6=a142_0x45daf7[_0x4c30f6(0x246)](_0x2cd217,_0x2bd0e3);_0x4ea173['push']({'filePath':_0x1a4ea6,'source':_0x6fa27c,'result':_0x22553c,'isJourney':!![]});}}return _0x4ea173;}export function formatValidationErrors(_0x4b9066){const _0x466d99=a142_0x5a306c,_0x30c560=[];for(const {filePath:_0x33082f,source:_0x26d3f7,result:_0x5c0e12,isJourney:_0x2edb3c}of _0x4b9066){const _0x2bff42=_0x2edb3c?_0x466d99(0x268):_0x466d99(0x293);_0x30c560[_0x466d99(0x25e)]('\x0a'+_0x33082f+'\x20('+_0x2bff42+_0x466d99(0x1aa)+_0x5c0e12[_0x466d99(0x221)][_0x466d99(0x22b)]+'\x20error(s)'),_0x30c560[_0x466d99(0x25e)](formatValidationResult(_0x5c0e12,_0x26d3f7,_0x33082f));}return _0x30c560[_0x466d99(0x26a)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x18a83e){const _0x53995d=a142_0x5a306c,_0x50c6e8=new Set(),_0x1f83d2=new Map(),_0x2e7ec1=collectSegmentUsageCounts(_0x18a83e);if(_0x18a83e[_0x53995d(0x274)])for(const [_0x5da4a0,_0x2db724]of Object[_0x53995d(0x250)](_0x18a83e[_0x53995d(0x274)])){_0x50c6e8[_0x53995d(0x1c8)](_0x5da4a0);if(_0x2db724[_0x53995d(0x2ac)]){const _0x14d798=yamlRuleToApi(_0x2db724[_0x53995d(0x2ac)]),_0x556fa2=apiRuleToYaml(_0x14d798);_0x1f83d2[_0x53995d(0x1ab)](_0x5da4a0,_0x556fa2);}}const _0x44860c=new Map();let _0xd01709=0x0;for(const [_0x599197,_0x8e4bf]of _0x1f83d2){const _0x383940=serializeExpandedRule(_0x8e4bf,_0x1f83d2),_0x546902=_0x44860c[_0x53995d(0x219)](_0x383940)||[];_0x546902['push']({'name':_0x599197,'index':_0xd01709}),_0x44860c['set'](_0x383940,_0x546902),_0xd01709++;}const _0x1d4508=new Map();for(const [_0xad914d,_0x64614f]of _0x44860c){const _0x20703a=_0x64614f[_0x53995d(0x25f)]()[_0x53995d(0x241)]((_0x3dbed6,_0x12569b)=>{const _0x3f7d75=_0x53995d,_0x16f233=_0x2e7ec1[_0x3f7d75(0x219)](_0x3dbed6[_0x3f7d75(0x279)])||0x0,_0x46d393=_0x2e7ec1['get'](_0x12569b[_0x3f7d75(0x279)])||0x0;if(_0x16f233!==_0x46d393)return _0x46d393-_0x16f233;return _0x3dbed6['index']-_0x12569b[_0x3f7d75(0x1eb)];})['map'](_0x57fffe=>_0x57fffe['name']),_0x1a08c8=[];for(const _0x374b90 of _0x20703a){const _0x5c01f2=_0x2e7ec1[_0x53995d(0x219)](_0x374b90)||0x0,_0x20f860=Math[_0x53995d(0x1df)](_0x5c01f2,0x1);for(let _0x4d1715=0x0;_0x4d1715<_0x20f860;_0x4d1715++){_0x1a08c8[_0x53995d(0x25e)](_0x374b90);}}_0x1d4508['set'](_0xad914d,_0x1a08c8);}return{'existingLocalSegmentNames':_0x50c6e8,'localSegmentRules':_0x1f83d2,'localExpandedRuleToNames':_0x1d4508};}export function createSegmentIdResolver(_0x257afa,_0x521f6d){return async _0x2c84ce=>{const _0x298469=a142_0x7272,_0x10d52a=_0x257afa[_0x298469(0x219)](_0x2c84ce);if(!_0x10d52a)throw new SDKError(ErrorCode[_0x298469(0x295)],'Segment\x20not\x20found:\x20'+_0x2c84ce+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x521f6d+'\x27)');return _0x10d52a;};}export function extractRootFolderId(_0x42a6cc){const _0x3f7c17=a142_0x5a306c;return _0x42a6cc[_0x3f7c17(0x202)]?.['parentSegmentFolder']?.[_0x3f7c17(0x298)]?.['id']||_0x42a6cc[_0x3f7c17(0x202)]?.[_0x3f7c17(0x242)]?.[_0x3f7c17(0x298)]?.['id'];}export function buildConnectionMaps(_0x61f1dc){const _0x43632d=a142_0x5a306c,_0x54daec=new Map(),_0x531876=new Map(),_0x290580=new Map();for(const _0x4a00a7 of _0x61f1dc){_0x54daec[_0x43632d(0x1ab)](_0x4a00a7[_0x43632d(0x279)],parseInt(_0x4a00a7['id'],0xa)),_0x531876['set'](_0x4a00a7['id'],_0x4a00a7[_0x43632d(0x279)]),_0x290580[_0x43632d(0x1ab)](_0x4a00a7['name'],_0x4a00a7['type']);}return{'nameToId':_0x54daec,'idToName':_0x531876,'nameToType':_0x290580};}export function calculatePushStats(_0x21ebae,_0xaa84a2,_0x3e0692,_0x5589d6,_0x502451,_0x4bc4ef,_0x29563e){const _0x4872de=a142_0x5a306c,_0x48fe53=_0x21ebae[_0x4872de(0x24d)](_0x3a5d8a=>_0x3a5d8a[_0x4872de(0x292)]),_0x538800=_0x21ebae[_0x4872de(0x24d)](_0x532dee=>!_0x532dee[_0x4872de(0x292)]&&_0x532dee[_0x4872de(0x289)]),_0x41b663=_0x21ebae['filter'](_0x1f25c3=>!_0x1f25c3[_0x4872de(0x292)]&&!_0x1f25c3['hasChanges']),_0x4d00ee=_0x4bc4ef?_0x5589d6:[],_0x36d25f=_0xaa84a2[_0x4872de(0x24d)](_0x4907dd=>_0x4907dd[_0x4872de(0x292)]),_0x59ad0a=_0xaa84a2[_0x4872de(0x24d)](_0x5823e4=>!_0x5823e4[_0x4872de(0x292)]&&_0x5823e4[_0x4872de(0x289)]),_0x10df1c=_0xaa84a2[_0x4872de(0x24d)](_0x41f6e8=>!_0x41f6e8[_0x4872de(0x292)]&&!_0x41f6e8['hasChanges']),_0x2a8261=_0x4bc4ef?_0x502451:[],_0xe4c381=_0x21ebae[_0x4872de(0x210)](_0x3dbbfd=>_0x3dbbfd['activationActions']),_0x522ff1=_0xe4c381['filter'](_0x5f0c09=>_0x5f0c09[_0x4872de(0x1bc)]==='create'),_0x536e56=_0xe4c381[_0x4872de(0x24d)](_0x3cf32e=>_0x3cf32e[_0x4872de(0x1bc)]===_0x4872de(0x209)),_0x38e6bf=_0xe4c381['filter'](_0x4b4522=>_0x4b4522[_0x4872de(0x1bc)]===_0x4872de(0x1e8)),_0x2016cd=Array[_0x4872de(0x1ae)](_0x3e0692)['sort'](),_0x5f2708=_0x29563e?![]:_0x48fe53[_0x4872de(0x22b)]>0x0||_0x538800[_0x4872de(0x22b)]>0x0||_0x4d00ee[_0x4872de(0x22b)]>0x0,_0x4f9fde=_0x36d25f[_0x4872de(0x22b)]>0x0||_0x59ad0a[_0x4872de(0x22b)]>0x0||_0x2a8261[_0x4872de(0x22b)]>0x0,_0x184720=_0x29563e?![]:_0xe4c381[_0x4872de(0x22b)]>0x0,_0x56c8ba=_0x2016cd[_0x4872de(0x22b)]>0x0;return{'segments':{'new':_0x48fe53,'changed':_0x538800,'unchanged':_0x41b663,'toDelete':_0x4d00ee},'journeys':{'new':_0x36d25f,'changed':_0x59ad0a,'unchanged':_0x10df1c,'toDelete':_0x2a8261},'activations':{'all':_0xe4c381,'toCreate':_0x522ff1,'toUpdate':_0x536e56,'toDelete':_0x38e6bf},'folders':{'toCreate':_0x2016cd},'counts':{'segments':{'new':_0x48fe53['length'],'changed':_0x538800['length'],'unchanged':_0x41b663['length'],'toDelete':_0x4d00ee['length']},'journeys':{'new':_0x36d25f['length'],'changed':_0x59ad0a[_0x4872de(0x22b)],'unchanged':_0x10df1c['length'],'toDelete':_0x2a8261[_0x4872de(0x22b)]},'activations':{'create':_0x522ff1[_0x4872de(0x22b)],'update':_0x536e56[_0x4872de(0x22b)],'delete':_0x38e6bf[_0x4872de(0x22b)]},'folders':_0x2016cd[_0x4872de(0x22b)]},'hasChanges':_0x5f2708||_0x4f9fde||_0x184720||_0x56c8ba};}export async function buildPushExecutionContext(_0x7166f9,_0xbcb80b,_0x43c71f,_0x4a131f,_0x2db60e,_0x535b5a){const _0x55850b=a142_0x5a306c,_0x39a91a=extractRootFolderId(_0x43c71f),{pathToId:_0x2323bf,idToPath:_0x4d22e6}=buildFolderMaps(_0x2db60e),_0x4e0220=buildSegmentNameToIdMap(_0x4a131f),_0x520ee9=new Map(),{batchAsync:_0x535e44}=await import(_0x55850b(0x27c)),[_0x168305,_0x5aa83d]=await Promise[_0x55850b(0x229)]([_0x7166f9['user'][_0x55850b(0x22c)](),_0x7166f9[_0x55850b(0x1fa)][_0x55850b(0x28a)](),((async()=>{!_0x535b5a&&_0x4a131f['length']>0x0&&await _0x535e44(_0x4a131f,async _0x4e7736=>{const _0x70257b=a142_0x7272,_0x2f4280=await _0x7166f9[_0x70257b(0x293)][_0x70257b(0x24c)](_0xbcb80b,_0x4e7736['id']);_0x520ee9[_0x70257b(0x1ab)](_0x4e7736['id'],_0x2f4280);});})())]),{emailToId:_0x5c2345,idToEmail:_0x4265b0}=_0x168305,_0x18c804=buildConnectionMaps(_0x5aa83d);return{'rootFolderId':_0x39a91a,'folderPathToId':_0x2323bf,'folderIdToPath':_0x4d22e6,'segmentNameToId':_0x4e0220,'activationsBySegmentId':_0x520ee9,'emailToIdMap':_0x5c2345,'idToEmailMap':_0x4265b0,'connectionNameToIdMap':_0x18c804[_0x55850b(0x2a2)],'connectionIdToNameMap':_0x18c804[_0x55850b(0x288)],'connectionNameToTypeMap':_0x18c804[_0x55850b(0x29c)]};}export function createPushYamlContextForBundle(_0x168ebf,_0x15d846,_0x249795,_0x5aa28b,_0xd35264,_0x2ab58d,_0x55e8e8,_0x4de4f9){const {existingLocalSegmentNames:_0x50c8db,localExpandedRuleToNames:_0x39a97e}=_0x5aa28b,_0x4c415a=new Set(),_0x1b591c=new Map(),_0x57909a=new Map(),_0x52cade=new Map(),_0x14cc1d=createJumpTargetCache(),_0x5313dc=new Map(),_0xcd687c=new Map(),_0x94a18c=new Set();let _0x18f02c;const _0xa2406=_0x180a5c=>{const _0x25ca33={'resolveSegment':async _0x2eb0ef=>{const _0x40bdbe=a142_0x7272,_0x54c653=_0x52cade[_0x40bdbe(0x219)](_0x2eb0ef);if(_0x54c653!==undefined)return{'name':_0x54c653,'isJourneyLocal':!![]};try{const _0x178d78=await fetchSegment(_0x168ebf,_0x15d846,_0x2eb0ef,_0x249795);if(!_0x178d78)throw new Error(_0x40bdbe(0x290));const _0x5ba408=generateJourneyLocalName(_0x178d78['name']),_0x41e071=_0x178d78['kind']===SEGMENT_KIND_JOURNEY&&_0x5ba408!==undefined;let _0x18d734=_0x178d78[_0x40bdbe(0x279)],_0x44f422;if(_0x41e071&&_0x178d78['rule']){const _0x16cdac=apiRuleToYaml(_0x178d78[_0x40bdbe(0x2ac)]);_0xcd687c['set'](_0x2eb0ef,_0x16cdac);const _0x1dc7a8=async _0x335d79=>{const _0x54ebb5=_0x40bdbe,_0xf929f3=collectSegmentRefsFromRule(_0x335d79);for(const _0x1bffbf of _0xf929f3){if(!_0xcd687c['has'](_0x1bffbf))try{const _0x5ae07d=await fetchSegment(_0x168ebf,_0x15d846,_0x1bffbf,_0x249795);if(_0x5ae07d?.[_0x54ebb5(0x2ac)]){const _0x2cda1f=apiRuleToYaml(_0x5ae07d[_0x54ebb5(0x2ac)]);_0xcd687c['set'](_0x1bffbf,_0x2cda1f),await _0x1dc7a8(_0x2cda1f);}}catch(_0x418d1d){logger[_0x54ebb5(0x1c0)](_0x54ebb5(0x27b)+_0x1bffbf+':\x20'+_0x418d1d);}}};await _0x1dc7a8(_0x16cdac);const _0x4c3e93=serializeExpandedRule(_0x16cdac,_0xcd687c),_0x524d86=_0x39a97e[_0x40bdbe(0x219)](_0x4c3e93);if(_0x524d86&&_0x524d86[_0x40bdbe(0x22b)]>0x0){const _0x57b49f=_0x1b591c[_0x40bdbe(0x219)](_0x4c3e93)||0x0,_0x501b32=_0x524d86[_0x57b49f]||_0x524d86[_0x524d86[_0x40bdbe(0x22b)]-0x1];_0x1b591c[_0x40bdbe(0x1ab)](_0x4c3e93,_0x57b49f+0x1),_0x18d734=_0x501b32,_0x4c415a[_0x40bdbe(0x1c8)](_0x18d734),_0x52cade[_0x40bdbe(0x1ab)](_0x2eb0ef,_0x18d734);const _0x85622b=await resolveRuleSegmentRefs(_0x16cdac,async _0x217e8a=>{const _0xf001fe=_0x40bdbe,_0x577461=_0x52cade[_0xf001fe(0x219)](_0x217e8a);if(_0x577461)return _0x577461;const _0x4467b9=await _0x18f02c[_0xf001fe(0x263)](_0x217e8a);return _0x4467b9[_0xf001fe(0x279)];});_0x44f422={'description':_0x178d78['description'],'rule':_0x85622b};}else{const _0x3149ec=_0x5313dc[_0x40bdbe(0x219)](_0x4c3e93);if(_0x3149ec)_0x18d734=_0x3149ec,_0x52cade[_0x40bdbe(0x1ab)](_0x2eb0ef,_0x18d734);else{if(_0x5ba408){let _0xca47e=_0x5ba408,_0x48f3d2=0x2;while(_0x4c415a['has'](_0xca47e)||_0x50c8db[_0x40bdbe(0x26b)](_0xca47e)){_0xca47e=_0x5ba408+'_'+_0x48f3d2,_0x48f3d2++;}_0x4c415a[_0x40bdbe(0x1c8)](_0xca47e),_0x18d734=_0xca47e;}_0x52cade[_0x40bdbe(0x1ab)](_0x2eb0ef,_0x18d734),_0x5313dc[_0x40bdbe(0x1ab)](_0x4c3e93,_0x18d734);const _0x46bebf=await resolveRuleSegmentRefs(_0x16cdac,async _0x4a7046=>{const _0x47a03d=_0x40bdbe,_0x411b31=_0x52cade['get'](_0x4a7046);if(_0x411b31)return _0x411b31;const _0x4f96d7=await _0x18f02c['resolveSegment'](_0x4a7046);return _0x4f96d7[_0x47a03d(0x279)];});_0x44f422={'description':_0x178d78['description'],'rule':_0x46bebf};}}}return{'name':_0x18d734,'isJourneyLocal':_0x41e071,'definition':_0x44f422};}catch(_0xaca879){return logger[_0x40bdbe(0x1c0)](_0x40bdbe(0x259)+_0x2eb0ef+':\x20'+_0xaca879),{'name':_0x2eb0ef,'isJourneyLocal':![]};}},'resolveActivation':async _0x1b34aa=>{const _0xd1ba67=a142_0x7272,_0x32d11d=_0x57909a['get'](_0x1b34aa);if(_0x32d11d!==undefined)return{'name':_0x32d11d,'isJourneyLocal':!![]};try{let _0x453985=_0x55e8e8?.[_0xd1ba67(0x219)](_0x1b34aa);!_0x453985&&(_0x453985=await _0x168ebf[_0xd1ba67(0x268)][_0xd1ba67(0x267)](_0x180a5c,_0x1b34aa));const _0x1f5272=_0x453985[_0xd1ba67(0x235)][_0xd1ba67(0x1d6)]['name']||_0x1b34aa,_0x1b48ab=sanitizeYamlKey(_0x1f5272)||'activation_'+_0x1b34aa,_0x103fcf=_0x1b48ab;_0x57909a[_0xd1ba67(0x1ab)](_0x1b34aa,_0x103fcf);const _0x26b6eb=journeyActivationStepToYaml(_0x453985,_0xd35264,_0x2ab58d);return{'name':_0x103fcf,'isJourneyLocal':!![],'definition':_0x26b6eb};}catch(_0x3cf270){return logger[_0xd1ba67(0x1c0)](_0xd1ba67(0x206)+_0x1b34aa+':\x20'+_0x3cf270),{'name':_0x1b34aa,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x17de77,_0x4fbb39)=>resolveJumpTarget(_0x17de77,_0x4fbb39,_0x14cc1d,async _0x4314f2=>{const _0x3e6fed=a142_0x7272,_0x3c5d30=_0x4de4f9?.['get'](_0x4314f2);if(_0x3c5d30)return _0x3c5d30;return _0x168ebf[_0x3e6fed(0x268)][_0x3e6fed(0x283)](_0x4314f2);})};return _0x18f02c=_0x25ca33,_0x25ca33;},_0x34d256=async _0xa1a51f=>{const _0x4acd99=a142_0x7272,{collectSegmentIdsFromJourneyApi:_0x4ada1e}=await import(_0x4acd99(0x266)),{batchAsync:_0xd28e7d}=await import('../../utils/async.js'),_0x56a1d6=new Set();for(const _0x1a7564 of _0xa1a51f){let _0x482ec2=_0x4de4f9?.[_0x4acd99(0x219)](_0x1a7564);!_0x482ec2&&(_0x482ec2=await _0x168ebf[_0x4acd99(0x268)][_0x4acd99(0x283)](_0x1a7564));const _0x17ffef=_0x4ada1e(_0x482ec2);for(const _0x17a7a7 of _0x17ffef){_0x56a1d6[_0x4acd99(0x1c8)](_0x17a7a7);}}let _0x346771=Array[_0x4acd99(0x1ae)](_0x56a1d6);while(_0x346771[_0x4acd99(0x22b)]>0x0){const _0x5b885e=_0x346771['filter'](_0x1f0bcf=>!_0x94a18c[_0x4acd99(0x26b)](_0x1f0bcf));if(_0x5b885e['length']===0x0)break;const _0x1fb634=await _0xd28e7d(_0x5b885e,async _0x59b727=>{const _0x31290b=_0x4acd99;_0x94a18c[_0x31290b(0x1c8)](_0x59b727);const _0x4ab05d=await fetchSegment(_0x168ebf,_0x15d846,_0x59b727,_0x249795);if(!_0x4ab05d)return null;return{'segmentId':_0x59b727,'segment':_0x4ab05d};},0xa),_0x163f6c=new Set();for(const _0x25f9c0 of _0x1fb634){if(!_0x25f9c0?.[_0x4acd99(0x293)]?.[_0x4acd99(0x2ac)])continue;const _0x3210de=apiRuleToYaml(_0x25f9c0[_0x4acd99(0x293)][_0x4acd99(0x2ac)]);_0xcd687c[_0x4acd99(0x1ab)](_0x25f9c0[_0x4acd99(0x21b)],_0x3210de);const _0x1e5d53=collectSegmentRefsFromRule(_0x3210de);for(const _0x25a92e of _0x1e5d53){!_0x94a18c['has'](_0x25a92e)&&_0x163f6c['add'](_0x25a92e);}}_0x346771=Array[_0x4acd99(0x1ae)](_0x163f6c);}};return{'createYamlContext':_0xa2406,'prefetchJourneySegments':_0x34d256};}export async function executePushSegments(_0x54f7fd,_0x331ee6,_0x532ab5,_0x1ee0bf,_0x203a75){const _0x524681=a142_0x5a306c,{segmentDefToCreateRequest:_0x5852ab,segmentDefToUpdateRequest:_0x46817b}=await import(_0x524681(0x1b6)),_0x3feaa1=_0x532ab5[_0x524681(0x1d7)],_0x57e9e6=0x5,_0x2a5666=async _0xa2b9df=>{const _0x3cec86=_0x524681,_0x170dbd=_0xa2b9df[_0x3cec86(0x1f3)]?_0x3feaa1['get'](_0xa2b9df['folderPath']):undefined;let _0x23a8df;const _0x4e2240={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x37e4d9=_0xa2b9df[_0x3cec86(0x20d)];if(_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x2ac)]){const _0x305b9c=createSegmentIdResolver(_0x532ab5[_0x3cec86(0x21c)],_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)]),_0x56e2f1=await resolveRuleSegmentIds(_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x2ac)],_0x305b9c);_0x37e4d9={..._0xa2b9df[_0x3cec86(0x20d)],'rule':_0x56e2f1};}try{if(_0xa2b9df['isNew']){_0x203a75[_0x3cec86(0x23b)]?.({'type':_0x3cec86(0x27f),'name':_0xa2b9df['yamlConfig'][_0x3cec86(0x279)]});const _0x22157c=_0x5852ab(_0x37e4d9,_0x170dbd),_0x2b84a1=await _0x203a75[_0x3cec86(0x1fc)](_0x3cec86(0x282)+_0xa2b9df['yamlConfig'][_0x3cec86(0x279)]+'\x27...',()=>_0x54f7fd[_0x3cec86(0x293)][_0x3cec86(0x2a5)](_0x1ee0bf[_0x3cec86(0x2b5)],_0x22157c));_0x23a8df=_0x2b84a1[_0x3cec86(0x298)]['id'],_0x532ab5[_0x3cec86(0x21c)]['set'](_0xa2b9df['yamlConfig'][_0x3cec86(0x279)],_0x23a8df),_0x4e2240[_0x3cec86(0x1f6)]={'name':_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)],'id':_0x23a8df},_0x203a75['onProgress']?.({'type':'segment_created','name':_0xa2b9df['yamlConfig'][_0x3cec86(0x279)],'segmentId':_0x23a8df}),_0x203a75[_0x3cec86(0x248)]?.(_0x3cec86(0x275)+_0xa2b9df['yamlConfig'][_0x3cec86(0x279)]+'\x27'),_0x4e2240[_0x3cec86(0x26d)]=0x1;}else{if(_0xa2b9df[_0x3cec86(0x289)]){_0x203a75[_0x3cec86(0x23b)]?.({'type':'segment_updating','name':_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)]});const _0x50ffb7=_0x46817b(_0x37e4d9);_0x170dbd!==_0xa2b9df[_0x3cec86(0x1f1)]?.[_0x3cec86(0x1cb)]&&(_0x50ffb7['segmentFolderId']=_0x170dbd?parseInt(_0x170dbd,0xa):undefined),await _0x203a75[_0x3cec86(0x1fc)](_0x3cec86(0x262)+_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)]+'\x27...',()=>_0x54f7fd['segment'][_0x3cec86(0x1ee)](_0x1ee0bf['parentId'],_0xa2b9df[_0x3cec86(0x1f1)]['id'],_0x50ffb7)),_0x23a8df=_0xa2b9df['existingSegment']['id'],_0x203a75[_0x3cec86(0x23b)]?.({'type':_0x3cec86(0x2b3),'name':_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)]}),_0x203a75[_0x3cec86(0x248)]?.(_0x3cec86(0x2a4)+_0xa2b9df['yamlConfig'][_0x3cec86(0x279)]+'\x27'),_0x4e2240[_0x3cec86(0x28b)]=0x1;}else _0x23a8df=_0xa2b9df[_0x3cec86(0x1f1)]['id'];}}catch(_0xc51819){const _0x1e37c8=isHttp400Error(_0xc51819),_0x3cf8b3=_0x1e37c8?ErrorCode[_0x3cec86(0x2a1)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x3613e1=getErrorMessage(_0xc51819);throw new SDKError(_0x3cf8b3,_0x3cec86(0x2a8)+(_0xa2b9df['isNew']?_0x3cec86(0x244):_0x3cec86(0x209))+_0x3cec86(0x27e)+_0xa2b9df[_0x3cec86(0x211)]+_0x3cec86(0x1e2)+_0x3613e1,_0xc51819);}try{const _0x1dad4b=await syncActivationsForSegment(_0x54f7fd,_0x1ee0bf[_0x3cec86(0x2b5)],_0x23a8df,_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)],_0xa2b9df[_0x3cec86(0x1cc)],_0x203a75,_0xa2b9df[_0x3cec86(0x211)]);_0x4e2240[_0x3cec86(0x212)]=_0x1dad4b;}catch(_0x44fef0){if(_0x44fef0 instanceof SDKError)throw _0x44fef0;throw new SDKError(ErrorCode[_0x3cec86(0x217)],_0x3cec86(0x1b3)+_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)]+_0x3cec86(0x1b0)+_0xa2b9df[_0x3cec86(0x211)]+'\x0a\x20\x20'+getErrorMessage(_0x44fef0),_0x44fef0);}return _0x4e2240;},_0x178c08=await batchAsync(_0x331ee6,_0x2a5666,_0x57e9e6),_0x19a18e={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x20e46e of _0x178c08){_0x19a18e['created']+=_0x20e46e[_0x524681(0x26d)],_0x19a18e['updated']+=_0x20e46e[_0x524681(0x28b)],_0x20e46e[_0x524681(0x1f6)]&&_0x19a18e[_0x524681(0x228)][_0x524681(0x1ab)](_0x20e46e[_0x524681(0x1f6)][_0x524681(0x279)],_0x20e46e[_0x524681(0x1f6)]['id']),_0x19a18e[_0x524681(0x212)][_0x524681(0x26d)]+=_0x20e46e[_0x524681(0x212)][_0x524681(0x26d)],_0x19a18e['activations'][_0x524681(0x28b)]+=_0x20e46e[_0x524681(0x212)][_0x524681(0x28b)],_0x19a18e[_0x524681(0x212)][_0x524681(0x270)]+=_0x20e46e[_0x524681(0x212)][_0x524681(0x270)];}return _0x19a18e;}async function syncActivationsForSegment(_0x55343f,_0x36f8a5,_0x1f594a,_0x128923,_0x578f88,_0x4efab1,_0x4215fc){const _0x5461c8=a142_0x5a306c,_0x3ec185={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xa89da9 of _0x578f88){try{if(_0xa89da9[_0x5461c8(0x1bc)]===_0x5461c8(0x244)&&_0xa89da9[_0x5461c8(0x23e)])_0x4efab1[_0x5461c8(0x23b)]?.({'type':_0x5461c8(0x201),'segmentName':_0x128923,'activationName':_0xa89da9[_0x5461c8(0x279)]}),await _0x4efab1[_0x5461c8(0x1fc)](_0x5461c8(0x245)+_0xa89da9[_0x5461c8(0x279)]+_0x5461c8(0x1ac),()=>_0x55343f[_0x5461c8(0x293)][_0x5461c8(0x23c)](_0x36f8a5,_0x1f594a,_0xa89da9[_0x5461c8(0x23e)])),_0x4efab1[_0x5461c8(0x23b)]?.({'type':_0x5461c8(0x22d),'segmentName':_0x128923,'activationName':_0xa89da9[_0x5461c8(0x279)]}),_0x4efab1[_0x5461c8(0x248)]?.(_0x5461c8(0x1fb)+_0xa89da9[_0x5461c8(0x279)]+'\x27'),_0x3ec185['created']++;else{if(_0xa89da9[_0x5461c8(0x1bc)]==='update'&&_0xa89da9['validatedRequest']&&_0xa89da9['existingActivation'])_0x4efab1[_0x5461c8(0x23b)]?.({'type':_0x5461c8(0x1ff),'segmentName':_0x128923,'activationName':_0xa89da9[_0x5461c8(0x279)]}),await _0x4efab1[_0x5461c8(0x1fc)](_0x5461c8(0x1fd)+_0xa89da9['name']+_0x5461c8(0x1ac),()=>_0x55343f['segment'][_0x5461c8(0x1c3)](_0x36f8a5,_0x1f594a,_0xa89da9[_0x5461c8(0x1fe)]['id'],_0xa89da9[_0x5461c8(0x23e)])),_0x4efab1[_0x5461c8(0x23b)]?.({'type':_0x5461c8(0x26e),'segmentName':_0x128923,'activationName':_0xa89da9[_0x5461c8(0x279)]}),_0x4efab1['logSuccess']?.(_0x5461c8(0x1b9)+_0xa89da9['name']+'\x27'),_0x3ec185[_0x5461c8(0x28b)]++;else _0xa89da9[_0x5461c8(0x1bc)]==='delete'&&_0xa89da9['existingActivation']&&(_0x4efab1['onProgress']?.({'type':'activation_deleting','segmentName':_0x128923,'activationName':_0xa89da9['name']}),await _0x4efab1[_0x5461c8(0x1fc)]('Deleting\x20activation\x20\x27'+_0xa89da9[_0x5461c8(0x279)]+_0x5461c8(0x1ac),()=>_0x55343f['segment'][_0x5461c8(0x1b2)](_0x36f8a5,_0x1f594a,_0xa89da9[_0x5461c8(0x1fe)]['id'])),_0x4efab1[_0x5461c8(0x23b)]?.({'type':'activation_deleted','segmentName':_0x128923,'activationName':_0xa89da9['name']}),_0x4efab1[_0x5461c8(0x27a)]?.(_0x5461c8(0x1f9)+_0xa89da9[_0x5461c8(0x279)]+'\x27'),_0x3ec185[_0x5461c8(0x270)]++);}}catch(_0x639184){const _0x323c71=isHttp400Error(_0x639184),_0x222562=_0x323c71?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x76dd99=getErrorMessage(_0x639184);throw new SDKError(_0x222562,_0x5461c8(0x2a8)+_0xa89da9['type']+_0x5461c8(0x24a)+_0xa89da9[_0x5461c8(0x279)]+_0x5461c8(0x1b0)+_0x4215fc+'\x0a\x20\x20'+_0x76dd99,_0x639184);}}return _0x3ec185;}export async function executePushFolders(_0x1ee3de,_0x432e67,_0x313f51,_0x2450f2,_0x40f426){const _0x44b6ae=a142_0x5a306c,_0x4cdc30=new Map(_0x313f51),_0x53e781=sortFoldersByDepth(_0x432e67);for(const _0x548b15 of _0x53e781){const _0xdaa378=_0x548b15['split']('/'),_0x2cae8d=_0xdaa378[_0xdaa378[_0x44b6ae(0x22b)]-0x1],_0x98f1fa=_0xdaa378[_0x44b6ae(0x25f)](0x0,-0x1)[_0x44b6ae(0x26a)]('/'),_0x347f8c=_0x4cdc30[_0x44b6ae(0x219)](_0x98f1fa);_0x40f426['onProgress']?.({'type':_0x44b6ae(0x271),'folder':_0x548b15});const _0x2ffd59={'name':_0x2cae8d,'parentFolderId':_0x347f8c},_0x304984=await _0x40f426[_0x44b6ae(0x1fc)](_0x44b6ae(0x1ce)+_0x548b15+'\x27...',()=>_0x1ee3de[_0x44b6ae(0x293)]['createFolder'](_0x2450f2['parentId'],_0x2ffd59));_0x4cdc30['set'](_0x548b15,_0x304984['data']['id']),_0x40f426[_0x44b6ae(0x23b)]?.({'type':_0x44b6ae(0x1da),'folder':_0x548b15,'folderId':_0x304984[_0x44b6ae(0x298)]['id']}),_0x40f426[_0x44b6ae(0x287)]?.(_0x44b6ae(0x1d3)+_0x548b15+'\x27');}return _0x4cdc30;}export async function executePushSegmentDeletions(_0x17b8d1,_0x56494c,_0x534bd1){const _0x2bcb69=a142_0x5a306c;if(_0x56494c[_0x2bcb69(0x22b)]===0x0)return 0x0;const {batchAsync:_0x292003}=await import(_0x2bcb69(0x27c)),_0x23a56f=0x5,_0x4766e7=await _0x292003(_0x56494c,async _0x5e6b1a=>{const _0x171bab=_0x2bcb69;return _0x534bd1[_0x171bab(0x23b)]?.({'type':_0x171bab(0x207),'name':_0x5e6b1a[_0x171bab(0x279)]}),await _0x17b8d1[_0x171bab(0x293)][_0x171bab(0x222)](_0x5e6b1a['id']),_0x534bd1[_0x171bab(0x23b)]?.({'type':_0x171bab(0x1e1),'name':_0x5e6b1a[_0x171bab(0x279)]}),_0x534bd1[_0x171bab(0x27a)]?.('Deleted\x20segment\x20\x27'+_0x5e6b1a[_0x171bab(0x279)]+'\x27'),0x1;},_0x23a56f);return _0x4766e7[_0x2bcb69(0x272)]((_0x4f7c8b,_0x48a71e)=>_0x4f7c8b+_0x48a71e,0x0);}export async function executePushJourneys(_0x5cd9b2,_0x213369,_0x55b26d,_0x2bbe6b,_0x2ffd90){const _0x2bde97=a142_0x5a306c,{journeyDefToRequest:_0x411007}=await import(_0x2bde97(0x266)),{activationDefToCreateRequest:_0x2c3ac9,yamlRuleToApi:_0x283244,validateSegmentRule:_0x5e7b95}=await import(_0x2bde97(0x1b6)),_0x5c57a2={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4d8251=new Map(_0x55b26d[_0x2bde97(0x21c)]),_0x395c30=0x5;for(let _0x46364c=0x0;_0x46364c<_0x213369[_0x2bde97(0x22b)];_0x46364c+=_0x395c30){const _0x50148a=_0x213369['slice'](_0x46364c,_0x46364c+_0x395c30),_0x577faa=await Promise[_0x2bde97(0x229)](_0x50148a[_0x2bde97(0x26f)](async _0x30f2f5=>{const _0x5c477a=_0x2bde97;if(!_0x30f2f5[_0x5c477a(0x292)]&&!_0x30f2f5[_0x5c477a(0x289)])return{'action':_0x5c477a(0x264),'name':_0x30f2f5['yamlConfig']['name'],'journeyId':_0x30f2f5[_0x5c477a(0x256)]?.['id']};const _0x394b66=_0x30f2f5[_0x5c477a(0x1f3)]?_0x55b26d[_0x5c477a(0x1d7)][_0x5c477a(0x219)](_0x30f2f5[_0x5c477a(0x1f3)]):undefined;_0x2ffd90[_0x5c477a(0x23b)]?.({'type':_0x30f2f5[_0x5c477a(0x292)]?_0x5c477a(0x1e3):'journey_updating','name':_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)]});try{const _0x334b22=await executeSingleJourneyPush(_0x5cd9b2,_0x30f2f5,{..._0x55b26d,'segmentNameToId':_0x4d8251},{'parentId':_0x2bbe6b[_0x5c477a(0x2b5)],'rootFolderId':_0x2bbe6b[_0x5c477a(0x2aa)],'folderId':_0x394b66,'verbose':_0x2bbe6b[_0x5c477a(0x1d5)]},_0x2ffd90,{'journeyDefToRequest':_0x411007,'activationDefToCreateRequest':_0x2c3ac9,'yamlRuleToApi':_0x283244,'validateSegmentRule':_0x5e7b95});for(const [_0x3786b5,_0x3815a9]of _0x334b22[_0x5c477a(0x25c)]){_0x4d8251[_0x5c477a(0x1ab)](_0x3786b5,_0x3815a9),_0x5c57a2[_0x5c477a(0x25c)][_0x5c477a(0x1ab)](_0x3786b5,_0x3815a9);}if(_0x334b22[_0x5c477a(0x261)]===_0x5c477a(0x26d))_0x2ffd90[_0x5c477a(0x23b)]?.({'type':'journey_created','name':_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)],'journeyId':_0x334b22['journeyId']}),_0x2ffd90[_0x5c477a(0x248)]?.(_0x5c477a(0x294)+_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)]+'\x27'),_0x5c57a2[_0x5c477a(0x26d)]++;else _0x334b22[_0x5c477a(0x261)]===_0x5c477a(0x28b)&&(_0x2ffd90['onProgress']?.({'type':'journey_updated','name':_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)]}),_0x2ffd90[_0x5c477a(0x248)]?.(_0x5c477a(0x253)+_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)]+'\x27'),_0x5c57a2[_0x5c477a(0x28b)]++);return{'action':_0x334b22[_0x5c477a(0x261)],'name':_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)],'journeyId':_0x334b22['journeyId']};}catch(_0x437415){const _0x2a6ee9=isHttp400Error(_0x437415),_0x57c97d=_0x2a6ee9?ErrorCode[_0x5c477a(0x1c6)]:ErrorCode[_0x5c477a(0x21e)],_0x2e6ee1=getErrorMessage(_0x437415);throw new SDKError(_0x57c97d,_0x5c477a(0x2a8)+(_0x30f2f5[_0x5c477a(0x292)]?_0x5c477a(0x244):_0x5c477a(0x209))+_0x5c477a(0x1e4)+_0x30f2f5[_0x5c477a(0x211)]+_0x5c477a(0x1e2)+_0x2e6ee1,_0x437415);}}));_0x5c57a2[_0x2bde97(0x236)][_0x2bde97(0x25e)](..._0x577faa);}return _0x5c57a2;}async function matchExistingJourneySegments(_0x25b8d6,_0x44173d,_0x342fd5,_0x4c6dd4,_0x46c111){const _0x5e9559=a142_0x5a306c;if(!_0x44173d[_0x5e9559(0x256)]||!_0x44173d[_0x5e9559(0x20d)][_0x5e9559(0x274)])return;const _0x203aa4=new Map(),_0x5b5d87=new Set();for(const _0x3ddd1d of Object[_0x5e9559(0x21a)](_0x44173d[_0x5e9559(0x20d)][_0x5e9559(0x274)])){const _0x3498cb=generateDeterministicJourneySegmentName(_0x44173d[_0x5e9559(0x20d)]['name'],_0x3ddd1d);_0x203aa4[_0x5e9559(0x1ab)](_0x3498cb,_0x3ddd1d),_0x5b5d87['add'](_0x3ddd1d);}const _0x4c44e3=[],_0x315004=collectSegmentIdsFromJourneyApi(_0x44173d[_0x5e9559(0x256)]);for(const _0x33e9d8 of _0x315004){const _0x243bcf=await fetchSegment(_0x25b8d6,_0x342fd5,_0x33e9d8,_0x4c6dd4);if(!_0x243bcf?.[_0x5e9559(0x279)])continue;const _0x89685e=_0x203aa4[_0x5e9559(0x219)](_0x243bcf[_0x5e9559(0x279)]);_0x89685e?(_0x46c111[_0x5e9559(0x1ab)](_0x89685e,_0x33e9d8),_0x5b5d87['delete'](_0x89685e)):_0x4c44e3[_0x5e9559(0x25e)]({'id':_0x33e9d8,'seg':_0x243bcf});}if(_0x5b5d87[_0x5e9559(0x208)]>0x0&&_0x4c44e3[_0x5e9559(0x22b)]>0x0){const {localExpandedRuleToNames:_0x228fd0}=buildLocalExpandedRuleMappings(_0x44173d[_0x5e9559(0x20d)]),_0x25bc2f=new Map();for(const {id:_0x2dcf1b,seg:_0xf13506}of _0x4c44e3){if(_0xf13506[_0x5e9559(0x2ac)]){const _0x30680a=apiRuleToYaml(_0xf13506[_0x5e9559(0x2ac)]);_0x25bc2f[_0x5e9559(0x1ab)](_0x2dcf1b,_0x30680a);}}for(const {id:_0x15b6f5,seg:_0x32e59e}of _0x4c44e3){if(!_0x32e59e[_0x5e9559(0x2ac)])continue;const _0x773cd6=_0x25bc2f[_0x5e9559(0x219)](_0x15b6f5);if(!_0x773cd6)continue;const _0x31f5df=serializeExpandedRule(_0x773cd6,_0x25bc2f),_0x57b7ea=_0x228fd0[_0x5e9559(0x219)](_0x31f5df);if(_0x57b7ea){const _0xf0436f=_0x57b7ea[_0x5e9559(0x216)](_0x37efe4=>_0x5b5d87[_0x5e9559(0x26b)](_0x37efe4));_0xf0436f&&(_0x46c111[_0x5e9559(0x1ab)](_0xf0436f,_0x15b6f5),_0x5b5d87['delete'](_0xf0436f),logger[_0x5e9559(0x1c0)](_0x5e9559(0x1ea)+_0x32e59e[_0x5e9559(0x279)]+_0x5e9559(0x200)+_0xf0436f+_0x5e9559(0x258)));}}}}async function executeSingleJourneyPush(_0x469cd5,_0xed8866,_0xd380cd,_0x59a74c,_0x46f8be,_0xc0b28f){const _0x395fd4=a142_0x5a306c,{journeyDefToRequest:_0x3e4824,activationDefToCreateRequest:_0x492e4b,yamlRuleToApi:_0x173cce,validateSegmentRule:_0x5ed4b4}=_0xc0b28f,_0x4f0fcb=new Map(),_0x150810=new Map();recoverSegmentIdsFromPushRecovery(_0xed8866,_0x4f0fcb,_0xd380cd['segmentNameToId']);const _0x5dddb7=new Map(),_0x22020c=new Map(),_0x525947=new Map();let _0x99b9d1;const _0x5a0519=async()=>{const _0x3aaea0=a142_0x7272;if(_0x99b9d1)return;_0x99b9d1=new Map();if(!_0xed8866[_0x3aaea0(0x256)])return;const _0x5d44b5=await _0x469cd5['journey'][_0x3aaea0(0x24c)](_0xed8866[_0x3aaea0(0x256)]['id']);for(const _0x4b8a09 of _0x5d44b5){const _0x40256d=journeyActivationStepToYaml(_0x4b8a09,_0xd380cd['idToEmailMap'],_0xd380cd[_0x3aaea0(0x24e)]),_0x5f0c27=activationSignature(_0x40256d);!_0x99b9d1[_0x3aaea0(0x26b)](_0x5f0c27)&&_0x99b9d1[_0x3aaea0(0x1ab)](_0x5f0c27,_0x4b8a09['id']),_0x40256d['name']&&_0x150810[_0x3aaea0(0x1ab)](_0x40256d['name'],_0x4b8a09['id']);}};await matchExistingJourneySegments(_0x469cd5,_0xed8866,_0x59a74c[_0x395fd4(0x2b5)],_0xd380cd[_0x395fd4(0x1c2)],_0xd380cd[_0x395fd4(0x21c)]);const _0x473882={'resolveSegmentId':async _0x403950=>{const _0x1617f3=_0x395fd4,_0x187ef0=_0xd380cd[_0x1617f3(0x21c)][_0x1617f3(0x219)](_0x403950);if(!_0x187ef0)throw new SDKError(ErrorCode[_0x1617f3(0x295)],_0x1617f3(0x276)+_0x403950+'\x20(referenced\x20in\x20journey\x20'+_0xed8866[_0x1617f3(0x20d)][_0x1617f3(0x279)]+')');return _0x187ef0;},'resolveEmbeddedSegmentId':async(_0x5de2fe,_0x2b29c9)=>{const _0x29f0a4=_0x395fd4,_0x3df736=_0xd380cd['segmentNameToId']['get'](_0x5de2fe);if(_0x3df736)return _0x3df736;const _0x16c795=_0xd380cd[_0x29f0a4(0x1c2)][_0x29f0a4(0x216)](_0x2fd84f=>_0x2fd84f['name']===_0x5de2fe);if(_0x16c795)return _0xd380cd[_0x29f0a4(0x21c)]['set'](_0x5de2fe,_0x16c795['id']),_0x16c795['id'];if(_0xed8866['isNew']){const {stageName:_0x5c1e0c,criteriaName:_0x11276d}=findSegmentCriteriaLocation(_0xed8866[_0x29f0a4(0x20d)],_0x5de2fe);return _0x5ed4b4(_0x5de2fe,_0x2b29c9[_0x29f0a4(0x2ac)]),_0x22020c[_0x29f0a4(0x1ab)](_0x5de2fe,{'definition':_0x2b29c9,'stageName':_0x5c1e0c,'criteriaName':_0x11276d}),createPendingSegmentId(_0x5de2fe);}const _0x3bb3a5=_0xed8866[_0x29f0a4(0x256)]?.['id'];if(!_0x3bb3a5)throw new SDKError(ErrorCode[_0x29f0a4(0x22f)],_0x29f0a4(0x1cf));const _0x2c87c4=_0x5dddb7['get'](_0x5de2fe);if(_0x2c87c4)return _0x2c87c4;const _0x339150=((async()=>{const _0x5bccdb=_0x29f0a4;_0x5ed4b4(_0x5de2fe,_0x2b29c9['rule']);const _0x4f0f62=generateDeterministicJourneySegmentName(_0xed8866[_0x5bccdb(0x20d)][_0x5bccdb(0x279)],_0x5de2fe),_0x77c0ea=_0xd380cd[_0x5bccdb(0x1c2)][_0x5bccdb(0x216)](_0x27b25a=>_0x27b25a[_0x5bccdb(0x279)]===_0x4f0f62),_0x693feb=createSegmentIdResolver(_0xd380cd[_0x5bccdb(0x21c)],_0x5de2fe),_0x4d8542=await resolveRuleSegmentIds(_0x2b29c9['rule'],_0x693feb);let _0x4809da;return _0x77c0ea?(await _0x469cd5[_0x5bccdb(0x293)][_0x5bccdb(0x1ee)](_0x59a74c[_0x5bccdb(0x2b5)],_0x77c0ea['id'],{'description':_0x2b29c9[_0x5bccdb(0x1ba)]||_0x5bccdb(0x1b1)+_0x5de2fe,'rule':_0x173cce(_0x4d8542,!![]),'countPopulation':!![]}),_0x4809da=_0x77c0ea['id'],saveSegmentToPushRecovery(_0xed8866[_0x5bccdb(0x211)],_0xed8866[_0x5bccdb(0x20d)]['name'],_0x5de2fe,{'segmentId':_0x4809da,'uniqueServerName':_0x4f0f62,'createdAt':new Date()[_0x5bccdb(0x29f)]()})):_0x4809da=await createOrRecoverEmbeddedSegment(_0x469cd5,_0xed8866,{'localName':_0x5de2fe,'uniqueSegmentName':_0x4f0f62,'description':_0x2b29c9['description']||_0x5bccdb(0x1b1)+_0x5de2fe,'journeyId':_0x3bb3a5,'resolvedRule':_0x4d8542,'parentId':_0x59a74c['parentId'],'folderId':_0x59a74c['rootFolderId']||''},_0x173cce),_0xd380cd[_0x5bccdb(0x21c)][_0x5bccdb(0x1ab)](_0x5de2fe,_0x4809da),_0x4f0fcb[_0x5bccdb(0x1ab)](_0x5de2fe,_0x4809da),_0x4809da;})());_0x5dddb7[_0x29f0a4(0x1ab)](_0x5de2fe,_0x339150);try{return await _0x339150;}finally{_0x5dddb7[_0x29f0a4(0x1e8)](_0x5de2fe);}},'resolveActivationId':async _0x1f864c=>{const _0x3c3503=_0x395fd4,_0x444cd4=_0x150810['get'](_0x1f864c);if(_0x444cd4)return _0x444cd4;if(_0xed8866[_0x3c3503(0x256)]){await _0x5a0519();const _0x38a4f3=_0x150810[_0x3c3503(0x219)](_0x1f864c);if(_0x38a4f3)return _0x38a4f3;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x1f864c+'\x20(referenced\x20in\x20journey\x20'+_0xed8866['yamlConfig'][_0x3c3503(0x279)]+_0x3c3503(0x1b5)+_0x3c3503(0x203));},'resolveEmbeddedActivationId':async(_0x2264c1,_0x71819)=>{const _0x5a5ae9=_0x395fd4,_0x2def73=_0x150810['get'](_0x2264c1);if(_0x2def73)return _0x2def73;if(_0xed8866[_0x5a5ae9(0x292)])return _0x525947[_0x5a5ae9(0x1ab)](_0x2264c1,_0x71819),createPendingActivationId(_0x2264c1);if(_0xed8866['existingJourney']){await _0x5a0519();const _0x36e78e=_0x150810[_0x5a5ae9(0x219)](_0x71819['name']);if(_0x36e78e)return _0x150810['set'](_0x2264c1,_0x36e78e),_0x36e78e;const _0x3e745f=activationSignature(_0x71819),_0x49b7de=_0x99b9d1?.[_0x5a5ae9(0x219)](_0x3e745f);if(_0x49b7de)return _0x150810[_0x5a5ae9(0x1ab)](_0x2264c1,_0x49b7de),_0x49b7de;const _0x41ae00=await _0x492e4b(_0x71819,_0xd380cd[_0x5a5ae9(0x1cd)]),_0x4af30a={..._0x41ae00,..._0x71819['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x71819['run_after_journey_refresh']}},_0x2a3765=await _0x469cd5['journey'][_0x5a5ae9(0x23c)](_0xed8866[_0x5a5ae9(0x256)]['id'],_0x4af30a);return _0x150810[_0x5a5ae9(0x1ab)](_0x2264c1,_0x2a3765['id']),_0x2a3765['id'];}throw new SDKError(ErrorCode[_0x5a5ae9(0x22f)],_0x5a5ae9(0x1ef));},'resolveJourneyId':async _0x4d05b5=>{const _0x29a4ea=_0x395fd4;try{return await _0x469cd5[_0x29a4ea(0x268)][_0x29a4ea(0x1c4)](_0x59a74c['parentId'],_0x4d05b5);}catch(_0x3f4e53){throw new SDKError(ErrorCode['NOT_FOUND'],_0x29a4ea(0x1f2)+_0x4d05b5+_0x29a4ea(0x1c9)+_0xed8866[_0x29a4ea(0x20d)][_0x29a4ea(0x279)]+'\x27)',_0x3f4e53);}},'resolveStageId':async(_0x306bd9,_0x3eb23d)=>{const _0xb9af77=_0x395fd4,_0x1df470=await _0x469cd5[_0xb9af77(0x268)]['getJourney'](_0x306bd9),_0x149fa5=_0x1df470[_0xb9af77(0x235)][_0xb9af77(0x21f)][_0xb9af77(0x216)](_0x32b7ed=>_0x32b7ed['name'][_0xb9af77(0x1bf)]()===_0x3eb23d[_0xb9af77(0x1bf)]());if(!_0x149fa5?.['id'])throw new SDKError(ErrorCode[_0xb9af77(0x1d9)],_0xb9af77(0x1f5)+_0x3eb23d+_0xb9af77(0x25d)+(_0x1df470[_0xb9af77(0x235)]['journeyBundleName']||_0x1df470[_0xb9af77(0x235)][_0xb9af77(0x279)])+'\x27');return _0x149fa5['id'];}},_0x42c89c=await _0x3e4824(_0xed8866[_0x395fd4(0x20d)],_0x59a74c['parentId'],_0x473882),_0x4ceb27=_0x59a74c[_0x395fd4(0x1ad)]||_0x59a74c[_0x395fd4(0x2aa)];_0x4ceb27&&(_0x42c89c['relationships']={'parentFolder':{'data':{'id':_0x4ceb27,'type':_0x395fd4(0x29e)}}});if(_0xed8866['isNew']){if(_0x22020c[_0x395fd4(0x208)]>0x0||_0x525947['size']>0x0)return await executeThreeStepJourneyCreate(_0x469cd5,_0xed8866,_0x42c89c,{'pendingEmbeddedSegments':_0x22020c,'pendingEmbeddedActivations':_0x525947,'embeddedSegmentNameToId':_0x4f0fcb,'journeyActivationNameToId':_0x150810},{..._0x59a74c,'effectiveFolderId':_0x4ceb27},_0xd380cd,_0x46f8be,_0xc0b28f);else{ensureJourneyDefaults(_0x42c89c[_0x395fd4(0x235)]);const _0x23dbb7=await _0x469cd5['journey'][_0x395fd4(0x244)](_0x42c89c);return deletePushRecovery(_0xed8866[_0x395fd4(0x211)]),{'action':_0x395fd4(0x26d),'journeyId':_0x23dbb7['id'],'embeddedSegmentNameToId':_0x4f0fcb};}}else{if(_0xed8866['hasChanges']&&_0xed8866[_0x395fd4(0x256)]){_0x42c89c['id']=_0xed8866[_0x395fd4(0x256)]['id'];const _0x51ff19=_0x42c89c[_0x395fd4(0x235)];_0xed8866[_0x395fd4(0x256)][_0x395fd4(0x235)]?.[_0x395fd4(0x20e)]&&(_0x51ff19[_0x395fd4(0x20e)]=_0xed8866[_0x395fd4(0x256)]['attributes'][_0x395fd4(0x20e)]);const _0x243bf0=_0xed8866[_0x395fd4(0x256)][_0x395fd4(0x235)]?.[_0x395fd4(0x21f)];return _0x243bf0&&_0x42c89c['attributes']['journeyStages']&&injectExistingStageIds(_0x42c89c[_0x395fd4(0x235)]['journeyStages'],_0x243bf0),ensureJourneyDefaults(_0x51ff19),await _0x469cd5['journey']['update'](_0xed8866[_0x395fd4(0x256)]['id'],_0x42c89c),deletePushRecovery(_0xed8866[_0x395fd4(0x211)]),{'action':_0x395fd4(0x28b),'journeyId':_0xed8866[_0x395fd4(0x256)]['id'],'embeddedSegmentNameToId':_0x4f0fcb};}}return deletePushRecovery(_0xed8866[_0x395fd4(0x211)]),{'action':_0x395fd4(0x264),'journeyId':_0xed8866[_0x395fd4(0x256)]?.['id'],'embeddedSegmentNameToId':_0x4f0fcb};}function findSegmentCriteriaLocation(_0x2e7807,_0x1ec05a){const _0xc4b345=a142_0x5a306c,_0x36586d=_0x2e7807[_0xc4b345(0x2b1)]||_0x2e7807['journeys']?.[0x0]?.[_0xc4b345(0x2b1)]||[];let _0x5d0c47=_0xc4b345(0x1e9),_0xf583f6=_0x1ec05a;const _0x3573f6=_0x2e7807[_0xc4b345(0x1f4)]||_0x2e7807[_0xc4b345(0x1c5)]?.[0x0]?.[_0xc4b345(0x1f4)];if(_0x3573f6?.[_0xc4b345(0x293)]===_0x1ec05a)return{'stageName':_0xc4b345(0x1f4),'criteriaName':_0x3573f6['name']||_0x1ec05a};_0x33382c:for(const _0x575337 of _0x36586d){if(_0x575337['entry_criteria']?.[_0xc4b345(0x293)]===_0x1ec05a){_0x5d0c47=_0x575337[_0xc4b345(0x279)],_0xf583f6=_0x575337[_0xc4b345(0x1d0)][_0xc4b345(0x279)]||_0x1ec05a;break;}if(_0x575337[_0xc4b345(0x249)])for(const _0x136f5a of _0x575337[_0xc4b345(0x249)]){if(_0x136f5a[_0xc4b345(0x1bc)]===_0xc4b345(0x28c)&&_0x136f5a[_0xc4b345(0x234)]?.['branches'])for(const _0x59dcc5 of _0x136f5a['with'][_0xc4b345(0x2af)]){if(_0x59dcc5[_0xc4b345(0x293)]===_0x1ec05a){_0x5d0c47=_0x575337['name'],_0xf583f6=_0x59dcc5[_0xc4b345(0x279)]||_0x1ec05a;break _0x33382c;}}}}return{'stageName':_0x5d0c47,'criteriaName':_0xf583f6};}async function executeThreeStepJourneyCreate(_0x2891ad,_0x457760,_0x27a347,_0x4ef0c2,_0x7a5f41,_0x3ca15f,_0x5a408c,_0xce49bf){const _0x3422ef=a142_0x5a306c,{activationDefToCreateRequest:_0x2a392a,yamlRuleToApi:_0x222641}=_0xce49bf,{pendingEmbeddedSegments:_0x47ee2b,pendingEmbeddedActivations:_0x226a35,embeddedSegmentNameToId:_0x2ba869}=_0x4ef0c2,_0x2caddd=JSON['parse'](JSON[_0x3422ef(0x25b)](_0x27a347));ensureJourneyDefaults(_0x2caddd[_0x3422ef(0x235)]),stripPendingIds(_0x2caddd);const _0x91e7a=await _0x2891ad[_0x3422ef(0x268)][_0x3422ef(0x244)](_0x2caddd),_0x5239da=_0x91e7a['id'],_0x15c939=new Map();for(const _0x51e899 of _0x91e7a[_0x3422ef(0x235)]['journeyStages']){_0x15c939[_0x3422ef(0x1ab)](_0x51e899[_0x3422ef(0x279)][_0x3422ef(0x1bf)](),_0x51e899['id']);}recoverSegmentIdsFromPushRecovery(_0x457760,_0x2ba869,_0x3ca15f[_0x3422ef(0x21c)]);for(const [_0x37a80c,{definition:_0x31a9cc}]of _0x47ee2b){if(_0x2ba869['has'](_0x37a80c)){_0x5a408c[_0x3422ef(0x23b)]?.({'type':'embedded_segment_created','journeyName':_0x457760[_0x3422ef(0x20d)][_0x3422ef(0x279)],'segmentName':_0x37a80c});continue;}const _0x5baf36=generateDeterministicJourneySegmentName(_0x457760['yamlConfig']['name'],_0x37a80c);_0x5a408c[_0x3422ef(0x23b)]?.({'type':'embedded_segment_creating','journeyName':_0x457760[_0x3422ef(0x20d)]['name'],'segmentName':_0x37a80c});const _0x3a4cf0=createSegmentIdResolver(_0x3ca15f[_0x3422ef(0x21c)],_0x37a80c),_0x44fddf=await resolveRuleSegmentIds(_0x31a9cc[_0x3422ef(0x2ac)],_0x3a4cf0),_0x564b19=await createOrRecoverEmbeddedSegment(_0x2891ad,_0x457760,{'localName':_0x37a80c,'uniqueSegmentName':_0x5baf36,'description':_0x31a9cc[_0x3422ef(0x1ba)]||_0x3422ef(0x1b1)+_0x37a80c,'journeyId':_0x5239da,'resolvedRule':_0x44fddf,'parentId':_0x7a5f41[_0x3422ef(0x2b5)],'folderId':_0x7a5f41[_0x3422ef(0x23f)]||''},_0x222641);_0x2ba869['set'](_0x37a80c,_0x564b19),_0x3ca15f[_0x3422ef(0x21c)][_0x3422ef(0x1ab)](_0x37a80c,_0x564b19),_0x5a408c[_0x3422ef(0x23b)]?.({'type':_0x3422ef(0x230),'journeyName':_0x457760[_0x3422ef(0x20d)][_0x3422ef(0x279)],'segmentName':_0x37a80c});}const _0x4b4f1c=new Map();for(const [_0x5595ae,_0x160930]of _0x226a35){_0x5a408c[_0x3422ef(0x23b)]?.({'type':_0x3422ef(0x2a9),'journeyName':_0x457760['yamlConfig'][_0x3422ef(0x279)],'activationName':_0x5595ae});const _0x3a38d1=await _0x2a392a(_0x160930,_0x3ca15f[_0x3422ef(0x1cd)]),_0x1996a0={..._0x3a38d1,..._0x160930['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x160930[_0x3422ef(0x1be)]}},_0x43ef5d=await _0x2891ad[_0x3422ef(0x268)]['createActivation'](_0x5239da,_0x1996a0);_0x4b4f1c[_0x3422ef(0x1ab)](_0x5595ae,_0x43ef5d['id']),_0x4ef0c2[_0x3422ef(0x29d)]['set'](_0x5595ae,_0x43ef5d['id']),_0x5a408c['onProgress']?.({'type':_0x3422ef(0x252),'journeyName':_0x457760[_0x3422ef(0x20d)]['name'],'activationName':_0x5595ae});}const _0x537a25=JSON[_0x3422ef(0x281)](JSON['stringify'](_0x27a347));return _0x537a25['id']=_0x5239da,ensureJourneyDefaults(_0x537a25[_0x3422ef(0x235)]),resolvePendingIdsInRequest(_0x537a25,_0x27a347,_0x15c939,_0x2ba869,_0x4b4f1c,_0x5a408c),await _0x2891ad[_0x3422ef(0x268)][_0x3422ef(0x209)](_0x5239da,_0x537a25),deletePushRecovery(_0x457760[_0x3422ef(0x211)]),{'action':_0x3422ef(0x26d),'journeyId':_0x5239da,'embeddedSegmentNameToId':_0x2ba869};}export function stripWaitStepPendingIds(_0x5f39ee){const _0x58a702=a142_0x5a306c,_0x19d704=_0x5f39ee['conditionSegmentId']&&isPendingSegmentId(_0x5f39ee[_0x58a702(0x2ad)]),_0x215287=_0x5f39ee[_0x58a702(0x21d)]?.[_0x58a702(0x269)](_0x5b755d=>_0x5b755d[_0x58a702(0x21b)]&&isPendingSegmentId(_0x5b755d['segmentId']));(_0x19d704||_0x215287)&&(_0x5f39ee[_0x58a702(0x20f)]='Duration',_0x5f39ee[_0x58a702(0x1dc)]=0x1,_0x5f39ee[_0x58a702(0x1f0)]='day',delete _0x5f39ee[_0x58a702(0x2ad)],delete _0x5f39ee[_0x58a702(0x1db)],delete _0x5f39ee[_0x58a702(0x278)],delete _0x5f39ee['conditions']);}export function resolveWaitStepPendingIds(_0x4e4be2,_0x1c4d88,_0x229ccf,_0x87fa72){const _0x2a9ad2=a142_0x5a306c;if(_0x1c4d88['conditionSegmentId']&&isPendingSegmentId(_0x1c4d88[_0x2a9ad2(0x2ad)])){const _0x4c1841=_0x229ccf(_0x1c4d88[_0x2a9ad2(0x2ad)],_0x2a9ad2(0x254)+_0x87fa72+_0x2a9ad2(0x238));_0x4c1841&&(_0x4e4be2[_0x2a9ad2(0x20f)]=_0x2a9ad2(0x233),_0x4e4be2[_0x2a9ad2(0x2ad)]=_0x4c1841,delete _0x4e4be2[_0x2a9ad2(0x1dc)],delete _0x4e4be2[_0x2a9ad2(0x1f0)],_0x1c4d88['conditionTimeoutDuration']!==undefined&&(_0x4e4be2[_0x2a9ad2(0x1db)]=_0x1c4d88[_0x2a9ad2(0x1db)]),_0x1c4d88[_0x2a9ad2(0x278)]&&(_0x4e4be2[_0x2a9ad2(0x278)]=_0x1c4d88[_0x2a9ad2(0x278)]));}if(_0x1c4d88[_0x2a9ad2(0x21d)]){const _0x3d9dc1=_0x1c4d88[_0x2a9ad2(0x21d)][_0x2a9ad2(0x269)](_0x2f0cd2=>_0x2f0cd2[_0x2a9ad2(0x21b)]&&isPendingSegmentId(_0x2f0cd2[_0x2a9ad2(0x21b)]));if(_0x3d9dc1){const _0x5aabfa=_0x1c4d88[_0x2a9ad2(0x21d)][_0x2a9ad2(0x26f)](_0x26c61e=>{const _0x535f90=_0x2a9ad2;if(_0x26c61e[_0x535f90(0x21b)]&&isPendingSegmentId(_0x26c61e['segmentId'])){const _0x25c8ce=_0x229ccf(_0x26c61e[_0x535f90(0x21b)],_0x535f90(0x254)+_0x87fa72+_0x535f90(0x238));return{..._0x26c61e,'segmentId':_0x25c8ce||_0x26c61e[_0x535f90(0x21b)]};}return{..._0x26c61e};});_0x4e4be2[_0x2a9ad2(0x20f)]='Condition',_0x4e4be2[_0x2a9ad2(0x21d)]=_0x5aabfa,delete _0x4e4be2['waitStep'],delete _0x4e4be2[_0x2a9ad2(0x1f0)],delete _0x4e4be2[_0x2a9ad2(0x2ad)],delete _0x4e4be2[_0x2a9ad2(0x1db)],delete _0x4e4be2[_0x2a9ad2(0x278)];}}}function stripPendingIds(_0x4bb7db){const _0x557559=a142_0x5a306c;_0x4bb7db[_0x557559(0x235)][_0x557559(0x1f4)]?.[_0x557559(0x21b)]&&isPendingSegmentId(_0x4bb7db['attributes']['goal'][_0x557559(0x21b)])&&delete _0x4bb7db[_0x557559(0x235)][_0x557559(0x1f4)];for(const _0x4bba76 of _0x4bb7db[_0x557559(0x235)][_0x557559(0x21f)]||[]){_0x4bba76[_0x557559(0x2b4)]?.['segmentId']&&isPendingSegmentId(_0x4bba76['entryCriteria'][_0x557559(0x21b)])&&delete _0x4bba76[_0x557559(0x2b4)];_0x4bba76[_0x557559(0x239)]?.[_0x557559(0x21b)]&&isPendingSegmentId(_0x4bba76[_0x557559(0x239)][_0x557559(0x21b)])&&delete _0x4bba76[_0x557559(0x239)];_0x4bba76[_0x557559(0x285)]&&(_0x4bba76[_0x557559(0x285)]=_0x4bba76[_0x557559(0x285)]['filter'](_0x540d63=>!_0x540d63['segmentId']||!isPendingSegmentId(_0x540d63['segmentId'])));if(_0x4bba76[_0x557559(0x249)])for(const _0x24d2e5 of Object['keys'](_0x4bba76[_0x557559(0x249)])){const _0x626179=_0x4bba76[_0x557559(0x249)][_0x24d2e5];_0x626179['type']===_0x557559(0x2ae)&&_0x626179['journeyActivationStepId']&&isPendingActivationId(_0x626179[_0x557559(0x205)])&&(_0x626179['journeyActivationStepId']='');if(_0x626179[_0x557559(0x1bc)]===_0x557559(0x1d1)&&_0x626179[_0x557559(0x2af)])for(const _0x20aa26 of _0x626179['branches']){_0x20aa26[_0x557559(0x21b)]&&isPendingSegmentId(_0x20aa26[_0x557559(0x21b)])&&(_0x20aa26['segmentId']='');}_0x626179[_0x557559(0x1bc)]===_0x557559(0x260)&&stripWaitStepPendingIds(_0x626179);}}}function resolvePendingIdsInRequest(_0x3b7dd0,_0xfbe5bb,_0x3bd5b4,_0x4d99ea,_0x29ba1d,_0x57cffd){const _0x2a6324=a142_0x5a306c,_0x30df2f=(_0x54072f,_0x20a4dd)=>{const _0xa97faa=a142_0x7272;if(!isPendingSegmentId(_0x54072f))return _0x54072f;const _0x251981=extractPendingSegmentName(_0x54072f),_0x3fa3e9=_0x4d99ea['get'](_0x251981);return!_0x3fa3e9&&_0x57cffd[_0xa97faa(0x2a3)]?.(_0xa97faa(0x225)+_0x251981+'\x27\x20for\x20'+_0x20a4dd),_0x3fa3e9;};if(_0x3b7dd0[_0x2a6324(0x235)][_0x2a6324(0x1f4)]?.[_0x2a6324(0x21b)]&&isPendingSegmentId(_0x3b7dd0['attributes']['goal'][_0x2a6324(0x21b)])){const _0x543d8c=_0x30df2f(_0x3b7dd0[_0x2a6324(0x235)][_0x2a6324(0x1f4)][_0x2a6324(0x21b)],_0x2a6324(0x218));_0x543d8c&&(_0x3b7dd0[_0x2a6324(0x235)][_0x2a6324(0x1f4)][_0x2a6324(0x21b)]=_0x543d8c);}for(const _0x2d460e of _0x3b7dd0[_0x2a6324(0x235)]['journeyStages']||[]){const _0x2b7db3=_0x3bd5b4[_0x2a6324(0x219)](_0x2d460e[_0x2a6324(0x279)][_0x2a6324(0x1bf)]());_0x2b7db3&&(_0x2d460e['id']=_0x2b7db3);if(_0x2d460e['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x2d460e[_0x2a6324(0x2b4)][_0x2a6324(0x21b)])){const _0x1ff389=_0x30df2f(_0x2d460e[_0x2a6324(0x2b4)][_0x2a6324(0x21b)],_0x2a6324(0x254)+_0x2d460e['name']+_0x2a6324(0x240));_0x1ff389&&(_0x2d460e[_0x2a6324(0x2b4)][_0x2a6324(0x21b)]=_0x1ff389);}if(_0x2d460e[_0x2a6324(0x285)])for(const _0x1467f7 of _0x2d460e[_0x2a6324(0x285)]){if(_0x1467f7['segmentId']&&isPendingSegmentId(_0x1467f7[_0x2a6324(0x21b)])){const _0x5a8684=_0x30df2f(_0x1467f7['segmentId'],_0x2a6324(0x254)+_0x2d460e['name']+_0x2a6324(0x25a));_0x5a8684&&(_0x1467f7[_0x2a6324(0x21b)]=_0x5a8684);}}if(_0x2d460e[_0x2a6324(0x239)]?.[_0x2a6324(0x21b)]&&isPendingSegmentId(_0x2d460e[_0x2a6324(0x239)][_0x2a6324(0x21b)])){const _0x4e13b6=_0x30df2f(_0x2d460e[_0x2a6324(0x239)][_0x2a6324(0x21b)],_0x2a6324(0x254)+_0x2d460e[_0x2a6324(0x279)]+_0x2a6324(0x265));_0x4e13b6&&(_0x2d460e[_0x2a6324(0x239)][_0x2a6324(0x21b)]=_0x4e13b6);}if(_0x2d460e['steps']){const _0x2bc0f9=_0x2d665b=>_0xfbe5bb[_0x2a6324(0x235)][_0x2a6324(0x21f)]?.[_0x2a6324(0x216)](_0x24e1ea=>_0x24e1ea[_0x2a6324(0x279)][_0x2a6324(0x1bf)]()===_0x2d460e[_0x2a6324(0x279)][_0x2a6324(0x1bf)]())?.[_0x2a6324(0x249)]?.[_0x2d665b];for(const _0x3d7687 of Object[_0x2a6324(0x21a)](_0x2d460e[_0x2a6324(0x249)])){const _0x27ad85=_0x2d460e['steps'][_0x3d7687],_0x7858fa=_0x2bc0f9(_0x3d7687);if(_0x27ad85['type']==='Activation'&&_0x27ad85[_0x2a6324(0x205)]&&(isPendingActivationId(_0x27ad85[_0x2a6324(0x205)])||_0x27ad85[_0x2a6324(0x205)]==='')){if(_0x7858fa?.[_0x2a6324(0x205)]&&isPendingActivationId(_0x7858fa[_0x2a6324(0x205)])){const _0x56e80a=extractPendingActivationName(_0x7858fa['journeyActivationStepId']),_0x358071=_0x29ba1d[_0x2a6324(0x219)](_0x56e80a);_0x358071&&(_0x27ad85['journeyActivationStepId']=_0x358071);}}if(_0x27ad85[_0x2a6324(0x1bc)]===_0x2a6324(0x1d1)&&_0x27ad85['branches']&&_0x7858fa?.[_0x2a6324(0x2af)])for(let _0x15d39c=0x0;_0x15d39c<_0x27ad85['branches'][_0x2a6324(0x22b)];_0x15d39c++){const _0x347790=_0x27ad85['branches'][_0x15d39c],_0x46a819=_0x7858fa['branches'][_0x15d39c];if(_0x46a819?.['segmentId']&&isPendingSegmentId(_0x46a819[_0x2a6324(0x21b)])){const _0x26bdd6=_0x30df2f(_0x46a819[_0x2a6324(0x21b)],_0x2a6324(0x254)+_0x2d460e['name']+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x347790[_0x2a6324(0x279)]||_0x15d39c)+'\x27');_0x26bdd6&&(_0x347790[_0x2a6324(0x21b)]=_0x26bdd6);}}_0x27ad85[_0x2a6324(0x1bc)]===_0x2a6324(0x260)&&_0x7858fa?.[_0x2a6324(0x1bc)]===_0x2a6324(0x260)&&resolveWaitStepPendingIds(_0x27ad85,_0x7858fa,_0x30df2f,_0x2d460e['name']);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a143_0xf25e(){const _0x9ab127=['57328PUomdC','3376640feiQOL','name','741348Tftwgq','add','154ppPzPo','63CriMUr','252hcLwlw','1735610NZGvYW','2NPBAaC','5536996ljfWle','get','has','set','3MjTwXe','1262557VwxeRw','573023xHEEVz','parentFolderId'];a143_0xf25e=function(){return _0x9ab127;};return a143_0xf25e();}(function(_0x5a941f,_0x508e47){const _0x2e7166=a143_0x1f61,_0x5dcb9d=_0x5a941f();while(!![]){try{const _0xd1a66b=-parseInt(_0x2e7166(0xde))/0x1*(-parseInt(_0x2e7166(0xd8))/0x2)+parseInt(_0x2e7166(0xdd))/0x3*(-parseInt(_0x2e7166(0xd9))/0x4)+parseInt(_0x2e7166(0xd0))/0x5+-parseInt(_0x2e7166(0xd2))/0x6+parseInt(_0x2e7166(0xd4))/0x7*(parseInt(_0x2e7166(0xcf))/0x8)+parseInt(_0x2e7166(0xd5))/0x9*(parseInt(_0x2e7166(0xd7))/0xa)+parseInt(_0x2e7166(0xdf))/0xb*(-parseInt(_0x2e7166(0xd6))/0xc);if(_0xd1a66b===_0x508e47)break;else _0x5dcb9d['push'](_0x5dcb9d['shift']());}catch(_0xd6c7f1){_0x5dcb9d['push'](_0x5dcb9d['shift']());}}}(a143_0xf25e,0xad060));export function buildFolderIdToPathMap(_0x2362c7){const _0x1989f0=a143_0x1f61,_0x2bf920=new Map(),_0x1240ac=new Map();for(const _0x44682f of _0x2362c7){_0x1240ac[_0x1989f0(0xdc)](_0x44682f['id'],_0x44682f);}const _0x2fb18d=new Set();for(const _0x46a7ea of _0x2362c7){!_0x46a7ea[_0x1989f0(0xce)]&&_0x2fb18d[_0x1989f0(0xd3)](_0x46a7ea['id']);}function _0x4bae2f(_0x3a119f){const _0x112355=_0x1989f0;if(_0x2bf920[_0x112355(0xdb)](_0x3a119f['id']))return _0x2bf920['get'](_0x3a119f['id']);if(_0x2fb18d[_0x112355(0xdb)](_0x3a119f['id']))return _0x2bf920[_0x112355(0xdc)](_0x3a119f['id'],''),'';if(_0x3a119f['parentFolderId']){const _0x378868=_0x1240ac[_0x112355(0xda)](_0x3a119f[_0x112355(0xce)]);if(_0x378868){const _0x3392d3=_0x4bae2f(_0x378868),_0x161243=_0x3392d3?_0x3392d3+'/'+_0x3a119f[_0x112355(0xd1)]:_0x3a119f['name'];return _0x2bf920[_0x112355(0xdc)](_0x3a119f['id'],_0x161243),_0x161243;}}const _0xcaf201=_0x3a119f['name'];return _0x2bf920['set'](_0x3a119f['id'],_0xcaf201),_0xcaf201;}for(const _0x4ac935 of _0x2362c7){_0x4bae2f(_0x4ac935);}return _0x2bf920;}function a143_0x1f61(_0xe37503,_0x2a3af7){_0xe37503=_0xe37503-0xce;const _0xf25ef9=a143_0xf25e();let _0x1f61ef=_0xf25ef9[_0xe37503];return _0x1f61ef;}export function buildFolderPathToIdMap(_0x18af44){const _0x26f2be=a143_0x1f61,_0x21979a=new Map(),_0x338f76=new Map();for(const _0x36c12f of _0x18af44){_0x338f76[_0x26f2be(0xdc)](_0x36c12f['id'],_0x36c12f);}const _0x4f9960=new Set();for(const _0xac0462 of _0x18af44){!_0xac0462[_0x26f2be(0xce)]&&_0x4f9960['add'](_0xac0462['id']);}function _0x147765(_0x3737f1){const _0x3471a4=_0x26f2be;if(_0x4f9960[_0x3471a4(0xdb)](_0x3737f1['id']))return'';if(_0x3737f1[_0x3471a4(0xce)]){const _0xa7b2b2=_0x338f76[_0x3471a4(0xda)](_0x3737f1[_0x3471a4(0xce)]);if(_0xa7b2b2){const _0x11036f=_0x147765(_0xa7b2b2);return _0x11036f?_0x11036f+'/'+_0x3737f1['name']:_0x3737f1[_0x3471a4(0xd1)];}}return _0x3737f1[_0x3471a4(0xd1)];}for(const _0x267630 of _0x18af44){const _0x25bc73=_0x147765(_0x267630);_0x21979a[_0x26f2be(0xdc)](_0x25bc73,_0x267630['id']);}return _0x21979a;}export function buildFolderMaps(_0x3b3f90){const _0x494f04=a143_0x1f61,_0x36fce0=buildFolderIdToPathMap(_0x3b3f90),_0x18b0f2=new Map();for(const [_0x4efbe0,_0x3692ef]of _0x36fce0){_0x18b0f2[_0x494f04(0xdc)](_0x3692ef,_0x4efbe0);}return{'idToPath':_0x36fce0,'pathToId':_0x18b0f2};}export function getFolderPath(_0x103d47,_0x298623){const _0x3722e3=a143_0x1f61;if(!_0x103d47)return'';return _0x298623[_0x3722e3(0xda)](_0x103d47)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x276431,_0x2aab01){const _0x4c3d58=a144_0x59ed,_0x119a30=_0x276431();while(!![]){try{const _0x4384b8=-parseInt(_0x4c3d58(0x126))/0x1*(parseInt(_0x4c3d58(0x116))/0x2)+-parseInt(_0x4c3d58(0x130))/0x3+-parseInt(_0x4c3d58(0x106))/0x4*(parseInt(_0x4c3d58(0x10f))/0x5)+-parseInt(_0x4c3d58(0x127))/0x6*(-parseInt(_0x4c3d58(0x122))/0x7)+parseInt(_0x4c3d58(0xfe))/0x8+-parseInt(_0x4c3d58(0x10c))/0x9*(parseInt(_0x4c3d58(0x103))/0xa)+-parseInt(_0x4c3d58(0x124))/0xb*(-parseInt(_0x4c3d58(0x108))/0xc);if(_0x4384b8===_0x2aab01)break;else _0x119a30['push'](_0x119a30['shift']());}catch(_0x28c4f7){_0x119a30['push'](_0x119a30['shift']());}}}(a144_0x467f,0x1e12a));import a144_0x2057d8 from'path';import{parse as a144_0x1f43bc}from'yaml';function a144_0x467f(){const _0x22e15b=['Relative\x20path\x20cannot\x20be\x20empty','tdx.json','root','Cannot\x20split\x20empty\x20path','split','readFile','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','isAbsolute','parent_segment','parse','.yml','457863ZOpCys','.yaml','1905981OegSyY','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','974kJuDyw','6EUZNYL','Path\x20attempts\x20to\x20navigate\x20above\x20root','segments','exists','endsWith','Cannot\x20navigate\x20above\x20root','relative','pop','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','237852CPpIxd','No\x20tdx.json\x20found\x20for\x20file:\x20','1916648VFrGoi','raw','File\x20not\x20found:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','replace','1214430GkJkSF','startsWith','resolve','477992bqLJre','slice','24lDbBHF','type','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','trim','18obvxIh','journey','dirname','5sTehqQ','push','length','Path\x20cannot\x20be\x20empty','filter','join','name','178MyHxLO'];a144_0x467f=function(){return _0x22e15b;};return a144_0x467f();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x393664){const _0x229c0f=a144_0x59ed;if(!_0x393664||_0x393664[_0x229c0f(0x10b)]()==='')throw new Error(_0x229c0f(0x112));const _0x4b0a1a=_0x393664[_0x229c0f(0x10b)]();if(_0x4b0a1a==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x393664};const _0x39c952=_0x4b0a1a[_0x229c0f(0x104)]('/')?_0x4b0a1a['substring'](0x1):_0x4b0a1a,_0xad23f3=_0x39c952[_0x229c0f(0x11b)]('/')[_0x229c0f(0x113)](_0x5e8aef=>_0x5e8aef!=='');if(_0xad23f3[_0x229c0f(0x111)]===0x0)throw new Error(_0x229c0f(0x11d));const _0x5977db=_0x4b0a1a[_0x229c0f(0x104)]('/')||!isRelativePathSegment(_0xad23f3[0x0]);for(const _0x78388b of _0xad23f3){validatePathSegment(_0x78388b);}return{'segments':_0xad23f3,'isAbsolute':_0x5977db,'raw':_0x393664};}function isRelativePathSegment(_0x59399c){return _0x59399c==='.'||_0x59399c==='..';}function validatePathSegment(_0x1748b9){const _0x215041=a144_0x59ed;if(_0x1748b9==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x1748b9==='.'||_0x1748b9==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x1748b9))throw new Error(_0x215041(0x101)+_0x1748b9);if(_0x1748b9!==_0x1748b9[_0x215041(0x10b)]()){}}export function validatePath(_0x1a6768){const _0x1ad8a1=a144_0x59ed;if(_0x1a6768[_0x1ad8a1(0x129)][_0x1ad8a1(0x111)]===0x0&&!_0x1a6768[_0x1ad8a1(0x11e)])throw new Error(_0x1ad8a1(0x117));if(_0x1a6768[_0x1ad8a1(0x11e)]){if(_0x1a6768[_0x1ad8a1(0x129)][0x0]==='..')throw new Error(_0x1ad8a1(0x125));let _0x3dd9a5=0x0;for(const _0xcf3596 of _0x1a6768[_0x1ad8a1(0x129)]){if(_0xcf3596==='..'){if(_0x3dd9a5===0x0)throw new Error(_0x1ad8a1(0x128));_0x3dd9a5--;}else _0xcf3596!=='.'&&_0x3dd9a5++;}}}export function joinPaths(_0x485345,_0x14ae14){const _0x5e96ab=a144_0x59ed;if(!_0x485345||_0x485345==='/')return _0x14ae14;if(!_0x14ae14||_0x14ae14==='.')return _0x485345;if(_0x14ae14[_0x5e96ab(0x104)]('/'))return _0x14ae14;const _0x3e4b98=parsePath(_0x485345),_0x30cbfa=parsePath(_0x14ae14),_0x1c5e0e=[..._0x3e4b98[_0x5e96ab(0x129)]];for(const _0x38167d of _0x30cbfa[_0x5e96ab(0x129)]){if(_0x38167d==='.')continue;else{if(_0x38167d==='..'){if(_0x1c5e0e[_0x5e96ab(0x111)]===0x0)throw new Error(_0x5e96ab(0x12c));_0x1c5e0e[_0x5e96ab(0x12e)]();}else _0x1c5e0e[_0x5e96ab(0x110)](_0x38167d);}}const _0xad84f7=_0x1c5e0e[_0x5e96ab(0x114)]('/');return _0x3e4b98[_0x5e96ab(0xff)][_0x5e96ab(0x104)]('/')?'/'+_0xad84f7:_0xad84f7;}export function normalizePath(_0x395972){const _0x35a266=a144_0x59ed,_0x10f5f5=parsePath(_0x395972),_0x554a56=[];for(const _0x3c909e of _0x10f5f5[_0x35a266(0x129)]){if(_0x3c909e==='.')continue;else{if(_0x3c909e==='..'){if(_0x554a56['length']===0x0){if(_0x10f5f5[_0x35a266(0x11e)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x554a56[_0x35a266(0x110)]('..');}else _0x554a56[_0x554a56[_0x35a266(0x111)]-0x1]==='..'?_0x554a56[_0x35a266(0x110)]('..'):_0x554a56[_0x35a266(0x12e)]();}else _0x554a56['push'](_0x3c909e);}}if(_0x554a56[_0x35a266(0x111)]===0x0)return _0x10f5f5[_0x35a266(0x11e)]?'/':'.';const _0x4dbd8b=_0x554a56[_0x35a266(0x114)]('/');return _0x10f5f5[_0x35a266(0xff)]['startsWith']('/')?'/'+_0x4dbd8b:_0x4dbd8b;}export function getParentPath(_0x2d6902){const _0x107a2d=a144_0x59ed,_0x544be7=parsePath(_0x2d6902);if(_0x544be7[_0x107a2d(0x129)]['length']<=0x1)return'/';const _0x84baf0=_0x544be7[_0x107a2d(0x129)]['slice'](0x0,-0x1)[_0x107a2d(0x114)]('/');return _0x544be7[_0x107a2d(0xff)][_0x107a2d(0x104)]('/')?'/'+_0x84baf0:_0x84baf0;}export function getBaseName(_0x34a200){const _0x5ea2f2=a144_0x59ed,_0x8f4665=parsePath(_0x34a200);return _0x8f4665['segments'][_0x8f4665[_0x5ea2f2(0x129)][_0x5ea2f2(0x111)]-0x1]||'';}export function isChildPath(_0x3669f1,_0x2c8c45){const _0x436868=a144_0x59ed,_0x5c2c2d=parsePath(_0x3669f1),_0x139684=parsePath(_0x2c8c45);if(_0x5c2c2d[_0x436868(0x129)][_0x436868(0x111)]<=_0x139684[_0x436868(0x129)]['length'])return![];for(let _0xc7771b=0x0;_0xc7771b<_0x139684[_0x436868(0x129)]['length'];_0xc7771b++){if(_0x5c2c2d[_0x436868(0x129)][_0xc7771b]!==_0x139684[_0x436868(0x129)][_0xc7771b])return![];}return!![];}export function splitPath(_0x4d2131){const _0x2101b6=a144_0x59ed,_0xf931a=parsePath(_0x4d2131);if(_0xf931a[_0x2101b6(0x129)][_0x2101b6(0x111)]===0x0)throw new Error(_0x2101b6(0x11a));if(_0xf931a[_0x2101b6(0x129)][_0x2101b6(0x111)]===0x1)return{'parent':_0xf931a[_0x2101b6(0x129)][0x0]};return{'parent':_0xf931a['segments'][0x0],'child':_0xf931a[_0x2101b6(0x129)][_0x2101b6(0x107)](0x1)[_0x2101b6(0x114)]('/')};}function a144_0x59ed(_0x324562,_0x525450){_0x324562=_0x324562-0xfe;const _0x467f2a=a144_0x467f();let _0x59ed38=_0x467f2a[_0x324562];return _0x59ed38;}export function isYamlFilePath(_0x492c0c){const _0x5c7a57=a144_0x59ed;return _0x492c0c[_0x5c7a57(0x12b)](_0x5c7a57(0x121))||_0x492c0c[_0x5c7a57(0x12b)](_0x5c7a57(0x123));}export async function resolveYamlFilePath(_0x18f609,_0x7728c3=nodeFileSystem){const _0x2db9c5=a144_0x59ed,_0x150f4e=a144_0x2057d8[_0x2db9c5(0x105)](_0x18f609);if(!await _0x7728c3['exists'](_0x150f4e))throw new Error(_0x2db9c5(0x100)+_0x18f609);let _0x5dbf87=a144_0x2057d8[_0x2db9c5(0x10e)](_0x150f4e),_0x337a03=null,_0x270fab=null;const _0x43fed7=a144_0x2057d8[_0x2db9c5(0x120)](_0x5dbf87)[_0x2db9c5(0x119)];while(_0x5dbf87!==_0x43fed7){const _0x5332b1=a144_0x2057d8[_0x2db9c5(0x114)](_0x5dbf87,_0x2db9c5(0x118));if(await _0x7728c3[_0x2db9c5(0x12a)](_0x5332b1)){_0x337a03=_0x5332b1,_0x270fab=_0x5dbf87;break;}_0x5dbf87=a144_0x2057d8[_0x2db9c5(0x10e)](_0x5dbf87);}if(!_0x337a03||!_0x270fab)throw new Error(_0x2db9c5(0x131)+_0x18f609+'\x0a'+_0x2db9c5(0x12f));const _0x40ff51=await _0x7728c3[_0x2db9c5(0x11c)](_0x337a03),_0x21343=JSON[_0x2db9c5(0x120)](_0x40ff51),_0x5a82f1=_0x21343[_0x2db9c5(0x11f)];if(!_0x5a82f1)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x3f15ad=await _0x7728c3[_0x2db9c5(0x11c)](_0x150f4e),_0x3d3587=a144_0x1f43bc(_0x3f15ad),_0x37f7f5=_0x3d3587[_0x2db9c5(0x115)];if(!_0x37f7f5)throw new Error(_0x2db9c5(0x10a)+_0x18f609);const _0x2178c4=_0x3d3587[_0x2db9c5(0x109)]===_0x2db9c5(0x10d)?_0x2db9c5(0x10d):'segment',_0x54d2d3=a144_0x2057d8[_0x2db9c5(0x12d)](_0x270fab,_0x150f4e),_0x4cf0c4=a144_0x2057d8['dirname'](_0x54d2d3),_0x299b08=_0x4cf0c4==='.'?'':_0x4cf0c4[_0x2db9c5(0x102)](/\\/g,'/'),_0x418d8c=_0x299b08?_0x5a82f1+'/'+_0x299b08+'/'+_0x37f7f5:_0x5a82f1+'/'+_0x37f7f5;return{'parentSegment':_0x5a82f1,'segmentName':_0x37f7f5,'folderPath':_0x299b08,'fullPath':_0x418d8c,'resourceType':_0x2178c4,'content':_0x3f15ad};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a145_0x435b(){const _0x5d0245=['802732iUUpJS','substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','13411125DRGyde','1064070FKPSHU','1231521ZvYoar','indexOf','724182kUGWGM','Invalid\x20segment\x20reference\x20format:\x20','8zkRNwS','2490628QuTWMZ','85UbKxEF','.\x20Child\x20name\x20cannot\x20be\x20empty','119764CbUZNy'];a145_0x435b=function(){return _0x5d0245;};return a145_0x435b();}function a145_0x39f3(_0x479c38,_0x4e7eae){_0x479c38=_0x479c38-0x130;const _0x435b8e=a145_0x435b();let _0x39f3e2=_0x435b8e[_0x479c38];return _0x39f3e2;}(function(_0x2d44b9,_0x474356){const _0x43a8a2=a145_0x39f3,_0x25f79e=_0x2d44b9();while(!![]){try{const _0x4f017c=parseInt(_0x43a8a2(0x135))/0x1+parseInt(_0x43a8a2(0x13c))/0x2+parseInt(_0x43a8a2(0x133))/0x3+-parseInt(_0x43a8a2(0x13b))/0x4*(-parseInt(_0x43a8a2(0x139))/0x5)+parseInt(_0x43a8a2(0x132))/0x6+parseInt(_0x43a8a2(0x138))/0x7*(-parseInt(_0x43a8a2(0x137))/0x8)+-parseInt(_0x43a8a2(0x131))/0x9;if(_0x4f017c===_0x474356)break;else _0x25f79e['push'](_0x25f79e['shift']());}catch(_0x4e1fc5){_0x25f79e['push'](_0x25f79e['shift']());}}}(a145_0x435b,0x5be94));export function parseSegmentRef(_0x3befd8){const _0x16e0f7=a145_0x39f3,_0x379ebd=_0x3befd8[_0x16e0f7(0x134)]('/');if(_0x379ebd===-0x1)return{'parentId':_0x3befd8};if(_0x379ebd===0x0)throw new Error(_0x16e0f7(0x136)+_0x3befd8+_0x16e0f7(0x130));const _0x266bc1=_0x3befd8[_0x16e0f7(0x13d)](0x0,_0x379ebd),_0x1a8fd1=_0x3befd8[_0x16e0f7(0x13d)](_0x379ebd+0x1);if(_0x1a8fd1==='')throw new Error(_0x16e0f7(0x136)+_0x3befd8+_0x16e0f7(0x13a));return{'parentId':_0x266bc1,'childId':_0x1a8fd1};}
|