@treasuredata/tdx 2026.3.0 → 2026.3.1
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/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/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.d.ts +4 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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/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/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/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
|
+
function a135_0x3a3c(){const _0x584f56=['Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','2149130hakRKA','debug','.push-recovery.json','14260259tbLKpu','12WbtiwZ','version','15303FoKnin','50022PLWWvI','5046440wzKVOQ','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','6467635zWOVTz','58NCckfp','12LTXtSv','journeyName','basename','ENOENT','6iQZwZc','string','segments','16vqUxRK','dirname','9gFklbP','tdx.sdk.push-recovery','7704708sxMtOz','utf-8'];a135_0x3a3c=function(){return _0x584f56;};return a135_0x3a3c();}const a135_0x1b440f=a135_0x21bf;function a135_0x21bf(_0x36ff70,_0x39c882){_0x36ff70=_0x36ff70-0x1da;const _0x3a3c57=a135_0x3a3c();let _0x21bfa0=_0x3a3c57[_0x36ff70];return _0x21bfa0;}(function(_0x5aea8a,_0x4a4a30){const _0x48199b=a135_0x21bf,_0x3c3e4d=_0x5aea8a();while(!![]){try{const _0x25f23d=-parseInt(_0x48199b(0x1de))/0x1*(-parseInt(_0x48199b(0x1da))/0x2)+parseInt(_0x48199b(0x1f3))/0x3*(parseInt(_0x48199b(0x1df))/0x4)+parseInt(_0x48199b(0x1dd))/0x5*(-parseInt(_0x48199b(0x1e3))/0x6)+parseInt(_0x48199b(0x1db))/0x7*(-parseInt(_0x48199b(0x1e6))/0x8)+-parseInt(_0x48199b(0x1e8))/0x9*(-parseInt(_0x48199b(0x1ed))/0xa)+parseInt(_0x48199b(0x1ea))/0xb+-parseInt(_0x48199b(0x1f1))/0xc*(-parseInt(_0x48199b(0x1f0))/0xd);if(_0x25f23d===_0x4a4a30)break;else _0x3c3e4d['push'](_0x3c3e4d['shift']());}catch(_0x20dc9d){_0x3c3e4d['push'](_0x3c3e4d['shift']());}}}(a135_0x3a3c,0xb55ca));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a135_0x13333d from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a135_0x1b440f(0x1e9));export function getPushRecoveryPath(_0x1338f6){const _0x18ac2b=a135_0x1b440f,_0x424e70=a135_0x13333d[_0x18ac2b(0x1e7)](_0x1338f6),_0x37a2d4=a135_0x13333d[_0x18ac2b(0x1e1)](_0x1338f6);return a135_0x13333d['join'](_0x424e70,'.'+_0x37a2d4+_0x18ac2b(0x1ef));}export function readPushRecovery(_0x1ec888){const _0x3ba8eb=a135_0x1b440f,_0x27ad7d=getPushRecoveryPath(_0x1ec888);if(!existsSync(_0x27ad7d))return undefined;try{const _0xf71087=readFileSync(_0x27ad7d,_0x3ba8eb(0x1eb)),_0x91b07a=JSON['parse'](_0xf71087);if(_0x91b07a?.[_0x3ba8eb(0x1f2)]!==0x1||typeof _0x91b07a['journeyName']!==_0x3ba8eb(0x1e4))return undefined;return _0x91b07a;}catch(_0x4631b6){return _0x4631b6 instanceof SyntaxError?logger['debug']('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x4631b6):logger['warn'](_0x3ba8eb(0x1ec)+_0x4631b6),undefined;}}export function writePushRecovery(_0x451c69,_0x525a42){const _0x21c500=getPushRecoveryPath(_0x451c69),_0x80f76f=_0x21c500+'.tmp';writeFileSync(_0x80f76f,JSON['stringify'](_0x525a42,null,0x2)+'\x0a','utf-8'),renameSync(_0x80f76f,_0x21c500);}export function deletePushRecovery(_0x490fb4){const _0x32ddb7=a135_0x1b440f,_0x3c7440=getPushRecoveryPath(_0x490fb4);try{unlinkSync(_0x3c7440);}catch(_0x4dd993){_0x4dd993['code']!==_0x32ddb7(0x1e2)&&logger[_0x32ddb7(0x1ee)](_0x32ddb7(0x1dc)+_0x4dd993);}}export function saveSegmentToPushRecovery(_0x7e57f5,_0x14fa11,_0x98c37c,_0xb67d83){const _0x5b49a6=a135_0x1b440f,_0x16ee01=readPushRecovery(_0x7e57f5),_0x25c00f=_0x16ee01?.[_0x5b49a6(0x1e0)]===_0x14fa11?{..._0x16ee01,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x14fa11,'updatedAt':new Date()['toISOString'](),'segments':{}};_0x25c00f[_0x5b49a6(0x1e5)][_0x98c37c]=_0xb67d83,writePushRecovery(_0x7e57f5,_0x25c00f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a136_0x440cdd=a136_0x9a65;(function(_0x312d71,_0x5c51f9){const _0x253897=a136_0x9a65,_0x2077ef=_0x312d71();while(!![]){try{const _0x531922=parseInt(_0x253897(0x177))/0x1+-parseInt(_0x253897(0x1e8))/0x2+parseInt(_0x253897(0x102))/0x3+parseInt(_0x253897(0x11c))/0x4*(parseInt(_0x253897(0x1b5))/0x5)+-parseInt(_0x253897(0x1a9))/0x6+parseInt(_0x253897(0x12d))/0x7*(-parseInt(_0x253897(0x162))/0x8)+parseInt(_0x253897(0x153))/0x9*(parseInt(_0x253897(0x19e))/0xa);if(_0x531922===_0x5c51f9)break;else _0x2077ef['push'](_0x2077ef['shift']());}catch(_0x4cc0bb){_0x2077ef['push'](_0x2077ef['shift']());}}}(a136_0x3b45,0xead73));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a136_0x440cdd(0x147));export const PENDING_SEGMENT_PREFIX=a136_0x440cdd(0x12c);export const PENDING_ACTIVATION_PREFIX=a136_0x440cdd(0x134);export function createPendingSegmentId(_0x58da19){return''+PENDING_SEGMENT_PREFIX+_0x58da19+'__';}export function isPendingSegmentId(_0xf68f53){const _0xdf4ad7=a136_0x440cdd;return _0xf68f53['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0xf68f53[_0xdf4ad7(0x1e9)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x9a1ec9){const _0x2ab5a9=a136_0x440cdd;return _0x9a1ec9[_0x2ab5a9(0x120)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x17e04d){return''+PENDING_ACTIVATION_PREFIX+_0x17e04d+'__';}export function isPendingActivationId(_0x3971fb){const _0x598ad6=a136_0x440cdd;return _0x3971fb[_0x598ad6(0x1e9)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x25f162){const _0x5b3f2a=a136_0x440cdd;return _0x25f162[_0x5b3f2a(0x120)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x19bd60,_0x1ff816){const _0x557223=a136_0x440cdd,_0x5267b2=_0x19bd60+'::'+(_0x1ff816['trim']()||_0x557223(0x10a)),_0x4d05af=createHash(_0x557223(0xff))[_0x557223(0x1c6)](_0x5267b2)[_0x557223(0x1bc)](_0x557223(0x110))[_0x557223(0x1be)](0x0,0xc);return _0x557223(0x125)+_0x4d05af;}export function ensureJourneyDefaults(_0x5caa54){const _0x13fe62=a136_0x440cdd;!_0x5caa54[_0x13fe62(0x119)]&&(_0x5caa54[_0x13fe62(0x119)]=''),!_0x5caa54[_0x13fe62(0x18b)]&&(_0x5caa54[_0x13fe62(0x18b)]=_0x13fe62(0x10d));}export function injectExistingStageIds(_0x149446,_0x341516){const _0xa9891a=a136_0x440cdd,_0x132e6d=new Map(_0x341516[_0xa9891a(0x151)](_0x56d13a=>[_0x56d13a[_0xa9891a(0x1b3)],_0x56d13a['id']]));for(const _0x57d0ff of _0x149446){if(!_0x57d0ff['id']){const _0x4ec09d=_0x132e6d['get'](_0x57d0ff[_0xa9891a(0x1b3)]);_0x4ec09d&&(_0x57d0ff['id']=_0x4ec09d);}}}export function resolveTDFolderPath(_0x2bcbe7,_0x28553b,_0x408088){const _0x353336=a136_0x440cdd;if(!_0x28553b)return _0x2bcbe7;if(_0x2bcbe7===_0x408088||_0x2bcbe7[_0x353336(0x1e9)](_0x408088+'/'))return _0x2bcbe7;return _0x2bcbe7?_0x408088+'/'+_0x2bcbe7:_0x408088;}export function addFoldersToCreate(_0x3274e5,_0x1b0bd1,_0x519fb1){const _0x39cfcc=a136_0x440cdd;if(!_0x3274e5)return;if(_0x1b0bd1[_0x39cfcc(0x15f)](_0x3274e5))return;const _0x2b3ca9=_0x3274e5[_0x39cfcc(0x14e)]('/');let _0x3e322e='';for(const _0x57c7ba of _0x2b3ca9){_0x3e322e=_0x3e322e?_0x3e322e+'/'+_0x57c7ba:_0x57c7ba,!_0x1b0bd1[_0x39cfcc(0x15f)](_0x3e322e)&&_0x519fb1[_0x39cfcc(0x1ef)](_0x3e322e);}}export function sortFoldersByDepth(_0x53732d){const _0x4a3748=a136_0x440cdd;return[..._0x53732d][_0x4a3748(0x129)]((_0x5bee14,_0x1a4316)=>{const _0x466303=_0x4a3748,_0x59ae45=(_0x5bee14[_0x466303(0x1f1)](/\//g)||[])[_0x466303(0x196)],_0x1ea372=(_0x1a4316[_0x466303(0x1f1)](/\//g)||[])[_0x466303(0x196)];return _0x59ae45-_0x1ea372;});}import*as a136_0x4ee76e from'yaml';import{readFileSync}from'fs';import a136_0x49a6c7 from'path';import{isJourneyDef,parseYamlString as a136_0x19aea3,toYamlString as a136_0x1163a0,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(_0x124592){const _0x434838=a136_0x440cdd;if(Array[_0x434838(0x180)](_0x124592))return'['+_0x124592[_0x434838(0x151)](_0x357c85=>stableStringify(_0x357c85))[_0x434838(0x145)](',')+']';if(_0x124592&&typeof _0x124592==='object'){const _0xd628f6=_0x124592,_0x5236a8=Object[_0x434838(0x15a)](_0xd628f6)[_0x434838(0x129)](),_0x1bdf1c=_0x5236a8['map'](_0x479a70=>'\x22'+_0x479a70+'\x22:'+stableStringify(_0xd628f6[_0x479a70]));return'{'+_0x1bdf1c[_0x434838(0x145)](',')+'}';}const _0x4b7fe8=JSON[_0x434838(0x1dc)](_0x124592);return _0x4b7fe8===undefined?'null':_0x4b7fe8;}function activationSignature(_0x7ec075){const _0x301a2e=a136_0x440cdd,_0xf45cb5={'connection':_0x7ec075[_0x301a2e(0x1e5)],..._0x7ec075[_0x301a2e(0x1ee)]!==undefined&&{'all_columns':_0x7ec075[_0x301a2e(0x1ee)]},..._0x7ec075[_0x301a2e(0x11e)]!==undefined&&{'columns':_0x7ec075['columns']},..._0x7ec075[_0x301a2e(0x1ed)]!==undefined&&{'behavior':_0x7ec075[_0x301a2e(0x1ed)]},..._0x7ec075[_0x301a2e(0x111)]!==undefined&&{'schedule':_0x7ec075['schedule']},..._0x7ec075['notification']!==undefined&&{'notification':_0x7ec075[_0x301a2e(0x112)]},..._0x7ec075[_0x301a2e(0x11f)]!==undefined&&{'connector_config':_0x7ec075[_0x301a2e(0x11f)]},..._0x7ec075[_0x301a2e(0x17b)]!==undefined&&{'activation_template_id':_0x7ec075['activation_template_id']}};return stableStringify(_0xf45cb5);}async function fetchSegment(_0x274851,_0x2310d6,_0x5ebe4e,_0x3fd32c){const _0xb3a1dd=a136_0x440cdd,_0x303c96=_0x3fd32c?.[_0xb3a1dd(0x1e1)](_0x589c2d=>_0x589c2d['id']===_0x5ebe4e);if(_0x303c96)return _0x303c96;try{return await _0x274851[_0xb3a1dd(0x10a)][_0xb3a1dd(0x178)](_0x2310d6,_0x5ebe4e);}catch(_0x2385ab){logger['debug'](_0xb3a1dd(0x150)+_0x5ebe4e+_0xb3a1dd(0x1cc)+_0x2385ab);try{return await _0x274851['segment'][_0xb3a1dd(0x1b4)](_0x5ebe4e);}catch(_0x26b8e7){return logger[_0xb3a1dd(0x130)](_0xb3a1dd(0x1c2)+_0x5ebe4e+':\x20'+_0x26b8e7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x2f507f,_0x3eac54,_0x565edc){const _0x556486=a136_0x440cdd,_0x2422d5=readPushRecovery(_0x2f507f['absolutePath']);if(_0x2422d5?.['journeyName']===_0x2f507f[_0x556486(0x12e)][_0x556486(0x1b3)])for(const [_0x2ad506,_0x12109b]of Object[_0x556486(0x1d9)](_0x2422d5[_0x556486(0x108)])){const _0x3e7acf=generateDeterministicJourneySegmentName(_0x2f507f['yamlConfig'][_0x556486(0x1b3)],_0x2ad506);_0x12109b['uniqueServerName']===_0x3e7acf&&(_0x3eac54['set'](_0x2ad506,_0x12109b[_0x556486(0x1ea)]),_0x565edc[_0x556486(0x1ec)](_0x2ad506,_0x12109b[_0x556486(0x1ea)]));}}async function createOrRecoverEmbeddedSegment(_0x44b10b,_0x107c69,_0x5b804c,_0x11e7e0){const _0x6ea61f=a136_0x440cdd;let _0x116f75;try{_0x116f75=await _0x44b10b[_0x6ea61f(0x10a)]['createJourneySegment']({'name':_0x5b804c[_0x6ea61f(0x193)],'description':_0x5b804c[_0x6ea61f(0x119)],'journeyId':_0x5b804c[_0x6ea61f(0x107)],'rule':_0x11e7e0(_0x5b804c[_0x6ea61f(0x15c)],!![]),'countPopulation':!![],'parentFolderId':_0x5b804c[_0x6ea61f(0x11b)],'audienceId':_0x5b804c[_0x6ea61f(0x1a1)]});}catch(_0x57510e){const _0x20bf7a=_0x57510e instanceof Error&&_0x57510e['message']['includes']('Name\x20has\x20already\x20been\x20taken');if(_0x20bf7a){const _0x582f96=readPushRecovery(_0x107c69[_0x6ea61f(0x1ae)]),_0x304b56=_0x582f96?.[_0x6ea61f(0x19c)]===_0x107c69['yamlConfig'][_0x6ea61f(0x1b3)]?_0x582f96['segments'][_0x5b804c['localName']]:undefined;if(_0x304b56?.['uniqueServerName']===_0x5b804c[_0x6ea61f(0x193)])await _0x44b10b[_0x6ea61f(0x10a)]['updateSegmentById'](_0x5b804c[_0x6ea61f(0x1a1)],_0x304b56[_0x6ea61f(0x1ea)],{'description':_0x5b804c[_0x6ea61f(0x119)],'rule':_0x11e7e0(_0x5b804c[_0x6ea61f(0x15c)],!![]),'countPopulation':!![]}),_0x116f75=_0x304b56[_0x6ea61f(0x1ea)];else throw new SDKError(ErrorCode[_0x6ea61f(0x128)],_0x6ea61f(0x1d7)+_0x5b804c[_0x6ea61f(0x14c)]+_0x6ea61f(0x1d2)+(_0x6ea61f(0x18c)+_0x107c69[_0x6ea61f(0x1ae)][_0x6ea61f(0x120)](/([^/]+)$/,_0x6ea61f(0x10f))+')\x20')+_0x6ea61f(0x16b),_0x57510e);}else throw _0x57510e;}return saveSegmentToPushRecovery(_0x107c69[_0x6ea61f(0x1ae)],_0x107c69[_0x6ea61f(0x12e)][_0x6ea61f(0x1b3)],_0x5b804c[_0x6ea61f(0x14c)],{'segmentId':_0x116f75,'uniqueServerName':_0x5b804c[_0x6ea61f(0x193)],'createdAt':new Date()['toISOString']()}),_0x116f75;}export async function prepareSegmentFiles(_0x4f84e7,_0x4b428c,_0x5349f8,_0x4dffdf,_0x40befa){const _0x17a675=a136_0x440cdd,{activationDefToCreateRequest:_0xbcfe01}=await import('./child-segment-yaml.js'),_0x4c03de=[],_0xcdd105=new Set();for(const {yamlConfig:_0x341ff7,folderPath:_0x38eb63,sourcePath:_0x41ff99}of _0x4f84e7){const _0x101598=resolveTDFolderPath(_0x38eb63,_0x4dffdf,_0x40befa),_0x361742=_0x101598+':'+_0x341ff7[_0x17a675(0x1b3)],_0x27adb6=_0x4b428c['segmentByFolderAndName'][_0x17a675(0x142)](_0x361742),_0x25464b=_0x27adb6?_0x4b428c[_0x17a675(0x158)][_0x17a675(0x142)](_0x27adb6['id'])||[]:[];addFoldersToCreate(_0x101598,_0x4b428c['folderPathToId'],_0xcdd105);const _0x2b3a4c=calculateActivationActions(_0x341ff7['activations']||[],_0x25464b,_0x4b428c[_0x17a675(0x15e)],_0x4b428c[_0x17a675(0x1e0)]);for(const _0x1cd030 of _0x2b3a4c){(_0x1cd030[_0x17a675(0x143)]===_0x17a675(0x19a)||_0x1cd030[_0x17a675(0x143)]===_0x17a675(0x1c6))&&_0x1cd030['yamlActivation']&&(_0x1cd030[_0x17a675(0x1c0)]=await _0xbcfe01(_0x1cd030['yamlActivation'],_0x5349f8));}const _0x5a03f8=calculateSegmentDiff(_0x341ff7,_0x27adb6,_0x25464b,_0x4b428c[_0x17a675(0x15e)],_0x4b428c[_0x17a675(0x1e0)]);_0x4c03de[_0x17a675(0x136)]({'relativePath':_0x341ff7[_0x17a675(0x1b3)],'absolutePath':_0x41ff99,'yamlConfig':_0x341ff7,'folderPath':_0x101598,'existingSegment':_0x27adb6,'existingActivations':_0x25464b,'isNew':_0x5a03f8[_0x17a675(0x1b6)],'hasChanges':_0x5a03f8['hasChanges'],'diff':_0x5a03f8[_0x17a675(0x1a4)],'activationActions':_0x2b3a4c});}return{'segmentFiles':_0x4c03de,'foldersToCreate':_0xcdd105};}export async function prepareJourneyFiles(_0x5084db,_0x104920,_0x29a493,_0x21e6d3){const _0x3a2ba4=a136_0x440cdd,_0x407478=[],_0x34f968=new Set();for(const {yamlConfig:_0x7cc976,folderPath:_0x33b45b,sourcePath:_0x38064e}of _0x5084db){const _0x403687=resolveTDFolderPath(_0x33b45b,_0x29a493,_0x21e6d3),_0x555fd7=_0x403687+':'+_0x7cc976['name'],_0xff54a8=_0x104920[_0x3a2ba4(0x167)][_0x3a2ba4(0x142)](_0x555fd7);let _0x4a2a31,_0x45292e;if(_0xff54a8&&_0xff54a8[_0x3a2ba4(0x196)]>0x0){const _0x67d3a6=buildLocalExpandedRuleMappings(_0x7cc976),{createYamlContext:_0x4d46ce,prefetchJourneySegments:_0x3236b7}=createPushYamlContextForBundle(_0x104920[_0x3a2ba4(0x1c1)],_0x104920[_0x3a2ba4(0x1a1)],_0x104920[_0x3a2ba4(0x173)],_0x67d3a6,_0x104920[_0x3a2ba4(0x15e)],_0x104920['connectionIdToNameMap'],_0x104920['activationStepsById'],_0x104920[_0x3a2ba4(0x113)]);await _0x3236b7(_0xff54a8[_0x3a2ba4(0x151)](_0x419483=>_0x419483['id']));const _0x597e23=await _0x104920[_0x3a2ba4(0x1c1)][_0x3a2ba4(0x192)][_0x3a2ba4(0x1b0)](_0xff54a8[0x0][_0x3a2ba4(0x1ad)]),_0x44e7de=hasMultipleVersions(_0x7cc976),_0x699f25=async _0x43f888=>{const _0x3561b2=_0x3a2ba4,_0x174171=_0x104920[_0x3561b2(0x113)]?.[_0x3561b2(0x142)](_0x43f888);if(_0x174171)return _0x174171;return _0x104920[_0x3561b2(0x13a)]({'journeyId':_0x43f888,'journeyName':_0x7cc976[_0x3561b2(0x1b3)],'isMultiVersion':_0xff54a8[_0x3561b2(0x196)]>0x1});};if(_0x44e7de&&_0xff54a8[_0x3a2ba4(0x196)]>0x1){const _0x19b19f=[];for(const _0x321915 of _0xff54a8){const _0x211a78=_0x321915[_0x3a2ba4(0x10b)]||0x1;_0x104920['progress']?.['update']('Fetching\x20'+_0x7cc976[_0x3a2ba4(0x1b3)]+'\x20v'+_0x211a78);const _0x23f05f=await _0x699f25(_0x321915['id']),_0x155e18=_0x4d46ce(_0x321915['id']),_0x31c416=await journeyResponseToDef(_0x23f05f,_0x155e18);_0x19b19f[_0x3a2ba4(0x136)]({'item':_0x321915,'yaml':_0x31c416});}const _0x4b4cb5=buildLocalRuleToNameMappingFromJourney(_0x7cc976);_0x45292e=buildMergedJourneyDef(_0x19b19f,_0x4b4cb5,_0x597e23);const _0x1ed4a7=Math['max'](..._0x19b19f['map'](_0xca9ce3=>_0xca9ce3['item'][_0x3a2ba4(0x10b)]||0x0)),_0x3da98a=_0xff54a8['find'](_0x1729b3=>(_0x1729b3[_0x3a2ba4(0x10b)]||0x0)===_0x1ed4a7);_0x3da98a&&(_0x104920[_0x3a2ba4(0x1e7)]?.[_0x3a2ba4(0x1c6)](_0x3a2ba4(0x186)+_0x7cc976['name']+'\x20v'+_0x1ed4a7),_0x4a2a31=await _0x699f25(_0x3da98a['id']));}else{const _0x125e81=_0xff54a8[_0xff54a8[_0x3a2ba4(0x196)]-0x1];_0x104920[_0x3a2ba4(0x1e7)]?.[_0x3a2ba4(0x1c6)](_0x3a2ba4(0x186)+_0x7cc976[_0x3a2ba4(0x1b3)]),_0x4a2a31=await _0x699f25(_0x125e81['id']);const _0x48f9cf=_0x4d46ce(_0x125e81['id']),_0x5ae725=await journeyResponseToDef(_0x4a2a31,_0x48f9cf),_0x4e76d9=buildLocalRuleToNameMappingFromJourney(_0x7cc976);_0x45292e=buildMergedJourneyDef([{'item':_0x125e81,'yaml':_0x5ae725}],_0x4e76d9,_0x597e23);}}addFoldersToCreate(_0x403687,_0x104920[_0x3a2ba4(0x1e3)],_0x34f968);const _0x24836a=calculateJourneyDiff(_0x7cc976,_0x45292e);_0x407478['push']({'relativePath':_0x7cc976[_0x3a2ba4(0x1b3)],'absolutePath':_0x38064e,'yamlConfig':_0x7cc976,'folderPath':_0x403687,'existingJourney':_0x4a2a31,'isNew':_0x24836a[_0x3a2ba4(0x1b6)],'hasChanges':_0x24836a[_0x3a2ba4(0x1db)],'diff':_0x24836a[_0x3a2ba4(0x1a4)]});}return{'journeyFiles':_0x407478,'foldersToCreate':_0x34f968};}export function calculateActivationActions(_0x51bcb6,_0x5fb14b,_0x1a6cbe,_0x36fc64){const _0x193285=a136_0x440cdd,_0x19e49a=[],_0x55a7f5=new Map();for(const _0x498387 of _0x5fb14b){_0x55a7f5[_0x193285(0x1ec)](_0x498387[_0x193285(0x1b3)],_0x498387);}const _0x5a99b7=new Map();for(const _0x154b07 of _0x51bcb6){_0x5a99b7['set'](_0x154b07['name'],_0x154b07);}for(const _0x2fafe4 of _0x51bcb6){const _0x1786bf=_0x55a7f5['get'](_0x2fafe4[_0x193285(0x1b3)]);if(!_0x1786bf)_0x19e49a[_0x193285(0x136)]({'type':_0x193285(0x19a),'name':_0x2fafe4[_0x193285(0x1b3)],'yamlActivation':_0x2fafe4});else{const _0x176a59=activationResponseToDef(_0x1786bf,_0x1a6cbe,_0x36fc64),_0x3efa38=a136_0x4ee76e[_0x193285(0x1dc)](_0x176a59),_0x1cc32c=a136_0x4ee76e[_0x193285(0x1dc)](_0x2fafe4);_0x3efa38!==_0x1cc32c&&_0x19e49a['push']({'type':_0x193285(0x1c6),'name':_0x2fafe4[_0x193285(0x1b3)],'yamlActivation':_0x2fafe4,'existingActivation':_0x1786bf});}}for(const _0x591913 of _0x5fb14b){!_0x5a99b7[_0x193285(0x15f)](_0x591913['name'])&&_0x19e49a['push']({'type':_0x193285(0x191),'name':_0x591913[_0x193285(0x1b3)],'existingActivation':_0x591913});}return _0x19e49a;}function a136_0x9a65(_0x108a3b,_0x4d58e2){_0x108a3b=_0x108a3b-0xf8;const _0x3b459c=a136_0x3b45();let _0x9a6545=_0x3b459c[_0x108a3b];return _0x9a6545;}function calculateYamlDiff(_0x503c7b,_0x4ca661){if(_0x4ca661){const _0x15ac6c=generateDiff(_0x4ca661,_0x503c7b),_0x37481d=hasChanges(_0x15ac6c);return{'isNew':![],'hasChanges':_0x37481d,'diff':_0x37481d?formatDiffWithColors(_0x15ac6c):undefined};}const _0xba1231=generateDiff('',_0x503c7b);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xba1231)};}export function calculateSegmentDiff(_0x5c9678,_0x13e753,_0x26f717,_0x4b434c,_0x22e48c){const _0x1f0a52=segmentToYamlString(_0x5c9678),_0x45923e=_0x13e753?segmentToYamlString(segmentWithActivationsToYaml(_0x13e753,_0x26f717,undefined,_0x4b434c,_0x22e48c)):undefined;return calculateYamlDiff(_0x1f0a52,_0x45923e);}export function calculateJourneyDiff(_0x25a8fc,_0x494a6c){const _0x2291af=normalizeJourneyDef(_0x25a8fc,_0x25a8fc),_0x4bfe2a=a136_0x1163a0(_0x2291af),_0x58eac6=_0x494a6c?a136_0x1163a0(normalizeJourneyDef(_0x494a6c,_0x25a8fc)):undefined;return calculateYamlDiff(_0x4bfe2a,_0x58eac6);}export function findSegmentsToDelete(_0x179e2d,_0x150071,_0x1daaa4,_0x5a3c7b,_0x55fe45){const _0x27294e=a136_0x440cdd,_0x41e0d5=new Set();for(const {yamlConfig:_0x4b761e,folderPath:_0x371b13}of _0x150071){_0x41e0d5[_0x27294e(0x1ef)](_0x371b13+':'+_0x4b761e[_0x27294e(0x1b3)]);}return _0x179e2d[_0x27294e(0x10e)](_0xf81941=>{const _0x440bd1=_0x27294e,_0x517a8b=_0xf81941[_0x440bd1(0x1ac)]?_0x1daaa4['get'](_0xf81941[_0x440bd1(0x1ac)][_0x440bd1(0x17c)]())||'':'',_0x572ae5=_0x517a8b+':'+_0xf81941['name'];if(_0x41e0d5[_0x440bd1(0x15f)](_0x572ae5))return![];if(_0x55fe45)return _0x517a8b===_0x5a3c7b||_0x517a8b[_0x440bd1(0x1e9)](_0x5a3c7b+'/');return!![];});}export function findJourneysToDelete(_0x23296d,_0x4c1d5e,_0x499525,_0x468694,_0x18154e){const _0x5a1c43=a136_0x440cdd,_0x3bec27=new Set();for(const {yamlConfig:_0x434d09,folderPath:_0x5a0b8a}of _0x4c1d5e){_0x3bec27[_0x5a1c43(0x1ef)](_0x5a0b8a+':'+_0x434d09[_0x5a1c43(0x1b3)]);}return _0x23296d[_0x5a1c43(0x10e)](_0x346b6e=>{const _0xe12ed0=_0x5a1c43,_0x27e4bf=_0x346b6e[_0xe12ed0(0x11b)]?_0x499525[_0xe12ed0(0x142)](_0x346b6e[_0xe12ed0(0x11b)])||'':'',_0xc622bf=_0x27e4bf+':'+_0x346b6e['journeyBundleName'];if(_0x3bec27[_0xe12ed0(0x15f)](_0xc622bf))return![];if(_0x18154e)return _0x27e4bf===_0x468694||_0x27e4bf[_0xe12ed0(0x1e9)](_0x468694+'/');return!![];});}export function buildSegmentLookupMap(_0x3ae053,_0x158e57){const _0x3b943a=a136_0x440cdd,_0x51621c=new Map();for(const _0x2877b6 of _0x3ae053){const _0x3f01a1=_0x2877b6[_0x3b943a(0x1ac)]?_0x158e57['get'](_0x2877b6[_0x3b943a(0x1ac)]['toString']())||'':'',_0x5a2d96=_0x3f01a1+':'+_0x2877b6[_0x3b943a(0x1b3)];_0x51621c[_0x3b943a(0x1ec)](_0x5a2d96,_0x2877b6);}return _0x51621c;}export function buildSegmentNameToIdMap(_0x359a4b){const _0x1a753c=a136_0x440cdd,_0x3ba2cc=new Map();for(const _0x13a5cd of _0x359a4b){_0x3ba2cc['set'](_0x13a5cd[_0x1a753c(0x1b3)],_0x13a5cd['id']);}return _0x3ba2cc;}export function buildJourneyBundleLookupMap(_0x2d8658,_0x28ba5c){const _0x6e512d=a136_0x440cdd,_0x530e60=new Map();for(const _0x2287ac of _0x2d8658){const _0xf4920c=_0x2287ac[_0x6e512d(0x11b)]?_0x28ba5c[_0x6e512d(0x142)](_0x2287ac[_0x6e512d(0x11b)])||'':'',_0x18ca70=_0xf4920c+':'+_0x2287ac[_0x6e512d(0x168)];!_0x530e60[_0x6e512d(0x15f)](_0x18ca70)&&_0x530e60[_0x6e512d(0x1ec)](_0x18ca70,[]),_0x530e60[_0x6e512d(0x142)](_0x18ca70)[_0x6e512d(0x136)](_0x2287ac);}for(const _0x5460c9 of _0x530e60[_0x6e512d(0x1c5)]()){_0x5460c9[_0x6e512d(0x129)]((_0x49f990,_0x428366)=>(_0x49f990['versionNumber']||0x0)-(_0x428366[_0x6e512d(0x10b)]||0x0));}return _0x530e60;}export function collectFoldersToCreate(_0x400c82,_0x363d50){const _0x47b4d1=a136_0x440cdd,_0x116094=new Set();for(const _0x4b73b5 of _0x400c82){if(!_0x4b73b5)continue;if(_0x363d50['has'](_0x4b73b5))continue;const _0x1c368a=_0x4b73b5[_0x47b4d1(0x14e)]('/');let _0x4a077a='';for(const _0xd83de8 of _0x1c368a){_0x4a077a=_0x4a077a?_0x4a077a+'/'+_0xd83de8:_0xd83de8,!_0x363d50[_0x47b4d1(0x15f)](_0x4a077a)&&_0x116094[_0x47b4d1(0x1ef)](_0x4a077a);}}return _0x116094;}export function parseAndClassifyYamlFiles(_0x3f40c1,_0xc35c70,_0x11fb73){const _0x587f30=a136_0x440cdd,_0x4cf679=[],_0x5c68ea=[];for(const _0x5a812d of _0x3f40c1){const _0x4815c0=a136_0x49a6c7['relative'](_0xc35c70,a136_0x49a6c7[_0x587f30(0x141)](_0x5a812d)),_0x3a686d=_0x4815c0==='.'?'':_0x4815c0,_0x1ace3c=readFileSync(_0x5a812d,_0x587f30(0x104)),_0x56973d=a136_0x4ee76e[_0x587f30(0x1ca)](_0x1ace3c);if(isJourneyDef(_0x56973d)){const _0x5a8f79=a136_0x19aea3(_0x1ace3c);_0x5c68ea[_0x587f30(0x136)]({'yamlConfig':_0x5a8f79,'folderPath':_0x3a686d,'sourcePath':_0x5a812d});}else{if(!_0x11fb73?.[_0x587f30(0x161)]){const _0x2e4523=parseSegmentYamlFile(_0x1ace3c),_0x42594e=normalizeChildSegmentYaml(_0x2e4523);_0x4cf679['push']({'yamlConfig':_0x42594e,'folderPath':_0x3a686d,'sourcePath':_0x5a812d});}}}return{'segments':_0x4cf679,'journeys':_0x5c68ea};}export function validateParsedFiles(_0x3d6d69,_0x3b7c1c){const _0x4b7760=a136_0x440cdd,_0x1d5d9c=[];for(const {yamlConfig:_0x221a92,sourcePath:_0x582e28}of _0x3d6d69[_0x4b7760(0x108)]){const _0x57978a=readFileSync(_0x582e28,_0x4b7760(0x104)),_0x402b57=a136_0x4ee76e[_0x4b7760(0x146)](_0x57978a),_0xa3729=validateSegmentDef(_0x221a92,{'source':_0x57978a,'document':_0x402b57},{'skipSchema':!![]});if(!_0xa3729['valid']){const _0x4c7487=a136_0x49a6c7[_0x4b7760(0x1f4)](_0x3b7c1c,_0x582e28);_0x1d5d9c[_0x4b7760(0x136)]({'filePath':_0x4c7487,'source':_0x57978a,'result':_0xa3729,'isJourney':![]});}}for(const {yamlConfig:_0x1dc891,sourcePath:_0x2159a7}of _0x3d6d69[_0x4b7760(0x1af)]){const _0x32d8b=readFileSync(_0x2159a7,_0x4b7760(0x104)),_0x131b97=a136_0x4ee76e['parseDocument'](_0x32d8b),_0x2f12c6=validateJourneyDef(_0x1dc891,{'source':_0x32d8b,'document':_0x131b97},{'skipSchema':!![]});if(!_0x2f12c6[_0x4b7760(0x118)]){const _0x37d5e1=a136_0x49a6c7[_0x4b7760(0x1f4)](_0x3b7c1c,_0x2159a7);_0x1d5d9c[_0x4b7760(0x136)]({'filePath':_0x37d5e1,'source':_0x32d8b,'result':_0x2f12c6,'isJourney':!![]});}}return _0x1d5d9c;}function a136_0x3b45(){const _0x5a3618=['updated','Updated\x20segment\x20\x27','dirname','get','type','branches','join','parseDocument','tdx.sdk.push-workflow','data','activationActions','idToName','Segment\x20not\x20found:\x20','localName','deleteActivation','split','activationContext','getSegment\x20failed\x20for\x20','map','toLowerCase','9mtcxpq','milestone','ACTIVATION_UPDATE_ERROR','size','waitStepType','activationsBySegmentId','segment_updated','keys','activation_deleted','resolvedRule','rule','idToEmailMap','has','journey_creating','skipSegments','12017552JUMUjV','createActivation','max','resolveJourneyId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','journeyBundlesByFolderAndName','journeyBundleName','createdSegmentId','parentSegmentFolder','and\x20the\x20server\x20segment,\x20then\x20retry.','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','with','folder_created','verbose','SEGMENT_SYNTAX_ERROR','waitStep','buildUserMaps','existingSegments','WaitStep',').\x20','list','17345uTTHOh','getSegment','Created\x20activation\x20\x27','activation_creating','activation_template_id','toString','activationParams','Segment\x20not\x20found','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','isArray','updateSegmentById','Journey\x20\x27','logSuccess','effectiveFolderId','getJourney','Fetching\x20','\x27\x20decision\x20point\x20branch\x20\x27','\x27\x20for\x20','activation_updated','run_after_journey_refresh','state','Delete\x20the\x20push\x20recovery\x20file\x20(','Failed\x20to\x20resolve\x20activation\x20','onProgress','rootFolderId','journeyActivationNameToId','delete','journey','uniqueSegmentName','journeyStages','embedded_activation_creating','length','getActivation','\x27...','createFolder','create','unchanged','journeyName','embedded_segment_created','20730190jggfWi','JOURNEY_SYNTAX_ERROR','\x27\x20from\x20file:\x20','parentId','all','some','diff','Creating\x20folder\x20\x27','Stage\x20\x27','\x20segment\x20from\x20file:\x20','Failed\x20to\x20','3506700CvqGUT','steps','waitStepUnit','segmentFolderId','journeyBundleId','absolutePath','journeys','getLatestJourneyId','embeddedSegmentNameToId','toISOString','name','getSegmentEntity','725lnAvHP','isNew','reduce','exitCriterias','Activation','deleted','folder','digest','listActivations','slice','parentFolder','validatedRequest','deps','getSegmentEntity\x20also\x20failed\x20for\x20','updateActivation','activations','values','update','conditionTimeoutDuration','action','journey_created','parse','Duration',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','existingSegment','\x27\x20wait\x20condition','logDeleted','Entry\x20criteria:\x20','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','segmentNameToId','segment_deleting','INTERNAL','resolveSegment','Embedded\x20segment\x20\x27','nameToType','entries','createSegment','hasChanges','stringify','Created\x20journey\x20\x27','DecisionPoint','\x20(referenced\x20in\x20journey\x20','connectionIdToNameMap','find','conditionTimeoutUnit','folderPathToId','Updated\x20activation\x20\x27','connection','goal','progress','763108XvoceV','startsWith','segmentId','relationships','set','behavior','all_columns','add','stage\x20\x27','match','errors','./child-segment-yaml.js','relative','existingActivation','SEGMENT_NOT_FOUND','NOT_FOUND','activation_deleting','logWarning','activation_','../../utils/async.js','flatMap','sha1','folder_creating','decision_point','216453mNBBQq','existingJourney','utf-8','):\x20','journeyActivationStepId','journeyId','segments','JOURNEY_UPDATE_ERROR','segment','versionNumber','Deleting\x20activation\x20\x27','draft','filter','.$1.push-recovery.json','hex','schedule','notification','journeyById','activation_created','day','journey_updated','Created\x20folder\x20\x27','valid','description','deleteSegment','folderId','34968PJYIEs','logInfo','columns','connector_config','replace','conditions','\x27\x20by\x20rule\x20content','\x0a\x20\x20','Creating\x20activation\x20\x27','journey_entry_criteria_','Condition','\x27\x20entry\x20criteria','SEGMENT_UPDATE_ERROR','sort','conditionSegmentId','Updating\x20activation\x20\x27','__pending_','7zaIyJj','yamlConfig','created','debug','folderPath','./journey-yaml.js','results','__pending_act_','withProgress','push','entryCriteria','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','activation_updating','fetchJourney','nameToId','Failed\x20to\x20resolve\x20segment\x20','attributes','Deleted\x20segment\x20\x27'];a136_0x3b45=function(){return _0x5a3618;};return a136_0x3b45();}export function formatValidationErrors(_0x269702){const _0x3bf057=a136_0x440cdd,_0x51ac71=[];for(const {filePath:_0x47cf52,source:_0x3c8b30,result:_0x575ae2,isJourney:_0x1786d4}of _0x269702){const _0x2ed99d=_0x1786d4?_0x3bf057(0x192):_0x3bf057(0x10a);_0x51ac71[_0x3bf057(0x136)]('\x0a'+_0x47cf52+'\x20('+_0x2ed99d+_0x3bf057(0x105)+_0x575ae2[_0x3bf057(0x1f2)][_0x3bf057(0x196)]+'\x20error(s)'),_0x51ac71[_0x3bf057(0x136)](formatValidationResult(_0x575ae2,_0x3c8b30,_0x47cf52));}return _0x51ac71[_0x3bf057(0x145)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4b46b7){const _0x235763=a136_0x440cdd,_0x12bffb=new Set(),_0x341be9=new Map(),_0x723257=collectSegmentUsageCounts(_0x4b46b7);if(_0x4b46b7[_0x235763(0x108)])for(const [_0x8b7d48,_0x372f27]of Object[_0x235763(0x1d9)](_0x4b46b7['segments'])){_0x12bffb[_0x235763(0x1ef)](_0x8b7d48);if(_0x372f27[_0x235763(0x15d)]){const _0x5f5b84=yamlRuleToApi(_0x372f27['rule']),_0x26e73e=apiRuleToYaml(_0x5f5b84);_0x341be9['set'](_0x8b7d48,_0x26e73e);}}const _0x4145b5=new Map();let _0x301836=0x0;for(const [_0x41e9b3,_0x1fa173]of _0x341be9){const _0x4f69f4=serializeExpandedRule(_0x1fa173,_0x341be9),_0x3da5ad=_0x4145b5[_0x235763(0x142)](_0x4f69f4)||[];_0x3da5ad[_0x235763(0x136)]({'name':_0x41e9b3,'index':_0x301836}),_0x4145b5[_0x235763(0x1ec)](_0x4f69f4,_0x3da5ad),_0x301836++;}const _0xfd198d=new Map();for(const [_0x1daf42,_0x521440]of _0x4145b5){const _0x415102=_0x521440['slice']()['sort']((_0x1225c5,_0x14020a)=>{const _0x3dc26a=_0x235763,_0x312edd=_0x723257[_0x3dc26a(0x142)](_0x1225c5[_0x3dc26a(0x1b3)])||0x0,_0x4208b4=_0x723257[_0x3dc26a(0x142)](_0x14020a[_0x3dc26a(0x1b3)])||0x0;if(_0x312edd!==_0x4208b4)return _0x4208b4-_0x312edd;return _0x1225c5['index']-_0x14020a['index'];})[_0x235763(0x151)](_0x1f36e9=>_0x1f36e9[_0x235763(0x1b3)]),_0x2e08a5=[];for(const _0x3959c2 of _0x415102){const _0x578e0d=_0x723257['get'](_0x3959c2)||0x0,_0x4cad8b=Math[_0x235763(0x164)](_0x578e0d,0x1);for(let _0x2f93f5=0x0;_0x2f93f5<_0x4cad8b;_0x2f93f5++){_0x2e08a5[_0x235763(0x136)](_0x3959c2);}}_0xfd198d[_0x235763(0x1ec)](_0x1daf42,_0x2e08a5);}return{'existingLocalSegmentNames':_0x12bffb,'localSegmentRules':_0x341be9,'localExpandedRuleToNames':_0xfd198d};}export function createSegmentIdResolver(_0x271121,_0x239a80){return async _0x40c2c4=>{const _0x523be4=a136_0x9a65,_0x564c0a=_0x271121[_0x523be4(0x142)](_0x40c2c4);if(!_0x564c0a)throw new SDKError(ErrorCode[_0x523be4(0xf8)],_0x523be4(0x14b)+_0x40c2c4+_0x523be4(0x1cd)+_0x239a80+'\x27)');return _0x564c0a;};}export function extractRootFolderId(_0x524708){const _0x54717c=a136_0x440cdd;return _0x524708[_0x54717c(0x1eb)]?.[_0x54717c(0x16a)]?.[_0x54717c(0x148)]?.['id']||_0x524708[_0x54717c(0x1eb)]?.[_0x54717c(0x1bf)]?.['data']?.['id'];}export function buildConnectionMaps(_0x34253f){const _0x305f76=a136_0x440cdd,_0x3cb206=new Map(),_0x1ac6e9=new Map(),_0x431857=new Map();for(const _0x19e8b8 of _0x34253f){_0x3cb206[_0x305f76(0x1ec)](_0x19e8b8[_0x305f76(0x1b3)],parseInt(_0x19e8b8['id'],0xa)),_0x1ac6e9[_0x305f76(0x1ec)](_0x19e8b8['id'],_0x19e8b8['name']),_0x431857[_0x305f76(0x1ec)](_0x19e8b8[_0x305f76(0x1b3)],_0x19e8b8[_0x305f76(0x143)]);}return{'nameToId':_0x3cb206,'idToName':_0x1ac6e9,'nameToType':_0x431857};}export function calculatePushStats(_0x46131d,_0x1bf2ef,_0x936bdb,_0x28a2ae,_0x3dd00d,_0x24274e,_0x259534){const _0x2e0ff8=a136_0x440cdd,_0x20e8c2=_0x46131d['filter'](_0x4e0ee9=>_0x4e0ee9[_0x2e0ff8(0x1b6)]),_0x2a8897=_0x46131d[_0x2e0ff8(0x10e)](_0x1b9dfa=>!_0x1b9dfa['isNew']&&_0x1b9dfa[_0x2e0ff8(0x1db)]),_0x52b9ef=_0x46131d[_0x2e0ff8(0x10e)](_0x4c2cfa=>!_0x4c2cfa[_0x2e0ff8(0x1b6)]&&!_0x4c2cfa[_0x2e0ff8(0x1db)]),_0xefbac5=_0x24274e?_0x28a2ae:[],_0x107335=_0x1bf2ef[_0x2e0ff8(0x10e)](_0xb8893d=>_0xb8893d[_0x2e0ff8(0x1b6)]),_0x57634e=_0x1bf2ef[_0x2e0ff8(0x10e)](_0x21a84a=>!_0x21a84a[_0x2e0ff8(0x1b6)]&&_0x21a84a[_0x2e0ff8(0x1db)]),_0x1f3c90=_0x1bf2ef[_0x2e0ff8(0x10e)](_0x7c745=>!_0x7c745[_0x2e0ff8(0x1b6)]&&!_0x7c745[_0x2e0ff8(0x1db)]),_0x2e0a1c=_0x24274e?_0x3dd00d:[],_0x31e586=_0x46131d[_0x2e0ff8(0xfe)](_0x27a7f6=>_0x27a7f6[_0x2e0ff8(0x149)]),_0x5e9117=_0x31e586[_0x2e0ff8(0x10e)](_0x6ce98=>_0x6ce98[_0x2e0ff8(0x143)]===_0x2e0ff8(0x19a)),_0x3414a6=_0x31e586[_0x2e0ff8(0x10e)](_0x1ab772=>_0x1ab772['type']===_0x2e0ff8(0x1c6)),_0x574d72=_0x31e586['filter'](_0x34acaa=>_0x34acaa[_0x2e0ff8(0x143)]==='delete'),_0x328b81=Array['from'](_0x936bdb)[_0x2e0ff8(0x129)](),_0x1cb5f2=_0x259534?![]:_0x20e8c2[_0x2e0ff8(0x196)]>0x0||_0x2a8897['length']>0x0||_0xefbac5['length']>0x0,_0x3b6349=_0x107335[_0x2e0ff8(0x196)]>0x0||_0x57634e[_0x2e0ff8(0x196)]>0x0||_0x2e0a1c[_0x2e0ff8(0x196)]>0x0,_0x57835a=_0x259534?![]:_0x31e586[_0x2e0ff8(0x196)]>0x0,_0x535f49=_0x328b81[_0x2e0ff8(0x196)]>0x0;return{'segments':{'new':_0x20e8c2,'changed':_0x2a8897,'unchanged':_0x52b9ef,'toDelete':_0xefbac5},'journeys':{'new':_0x107335,'changed':_0x57634e,'unchanged':_0x1f3c90,'toDelete':_0x2e0a1c},'activations':{'all':_0x31e586,'toCreate':_0x5e9117,'toUpdate':_0x3414a6,'toDelete':_0x574d72},'folders':{'toCreate':_0x328b81},'counts':{'segments':{'new':_0x20e8c2[_0x2e0ff8(0x196)],'changed':_0x2a8897[_0x2e0ff8(0x196)],'unchanged':_0x52b9ef[_0x2e0ff8(0x196)],'toDelete':_0xefbac5[_0x2e0ff8(0x196)]},'journeys':{'new':_0x107335[_0x2e0ff8(0x196)],'changed':_0x57634e['length'],'unchanged':_0x1f3c90[_0x2e0ff8(0x196)],'toDelete':_0x2e0a1c[_0x2e0ff8(0x196)]},'activations':{'create':_0x5e9117['length'],'update':_0x3414a6[_0x2e0ff8(0x196)],'delete':_0x574d72['length']},'folders':_0x328b81[_0x2e0ff8(0x196)]},'hasChanges':_0x1cb5f2||_0x3b6349||_0x57835a||_0x535f49};}export async function buildPushExecutionContext(_0x4a6667,_0x1bc549,_0x581af5,_0x4d29f4,_0x2343f8,_0x5cbc52){const _0x1bf478=a136_0x440cdd,_0x4d6de6=extractRootFolderId(_0x581af5),{pathToId:_0x1d4010,idToPath:_0x17ece6}=buildFolderMaps(_0x2343f8),_0x2a6bed=buildSegmentNameToIdMap(_0x4d29f4),_0x1c973b=new Map(),{batchAsync:_0x5e139f}=await import(_0x1bf478(0xfd)),[_0x1ff181,_0x1c384b]=await Promise[_0x1bf478(0x1a2)]([_0x4a6667['user'][_0x1bf478(0x172)](),_0x4a6667[_0x1bf478(0x1e5)][_0x1bf478(0x176)](),((async()=>{const _0x546f63=_0x1bf478;!_0x5cbc52&&_0x4d29f4[_0x546f63(0x196)]>0x0&&await _0x5e139f(_0x4d29f4,async _0x183252=>{const _0x443e09=_0x546f63,_0x27426f=await _0x4a6667[_0x443e09(0x10a)][_0x443e09(0x1bd)](_0x1bc549,_0x183252['id']);_0x1c973b[_0x443e09(0x1ec)](_0x183252['id'],_0x27426f);});})())]),{emailToId:_0x45f35c,idToEmail:_0x1f7cc0}=_0x1ff181,_0x1cda12=buildConnectionMaps(_0x1c384b);return{'rootFolderId':_0x4d6de6,'folderPathToId':_0x1d4010,'folderIdToPath':_0x17ece6,'segmentNameToId':_0x2a6bed,'activationsBySegmentId':_0x1c973b,'emailToIdMap':_0x45f35c,'idToEmailMap':_0x1f7cc0,'connectionNameToIdMap':_0x1cda12[_0x1bf478(0x13b)],'connectionIdToNameMap':_0x1cda12[_0x1bf478(0x14a)],'connectionNameToTypeMap':_0x1cda12[_0x1bf478(0x1d8)]};}export function createPushYamlContextForBundle(_0x3bbc7c,_0x4c0f5c,_0x4cabee,_0x3c524d,_0x3d8281,_0x346e6f,_0x4b7f8b,_0x56c0b9){const {existingLocalSegmentNames:_0x1e8227,localExpandedRuleToNames:_0x5d0de9}=_0x3c524d,_0x38dc32=new Set(),_0xcb5de6=new Map(),_0x2bf9a5=new Map(),_0x4fadca=new Map(),_0x4d377d=createJumpTargetCache(),_0x559ea1=new Map(),_0x4239ce=new Map(),_0x296880=new Set();let _0x3eb436;const _0x3edc7b=_0x30b411=>{const _0x105f05={'resolveSegment':async _0x56ee22=>{const _0x1e475f=a136_0x9a65,_0x4b1051=_0x4fadca[_0x1e475f(0x142)](_0x56ee22);if(_0x4b1051!==undefined)return{'name':_0x4b1051,'isJourneyLocal':!![]};try{const _0x18e01b=await fetchSegment(_0x3bbc7c,_0x4c0f5c,_0x56ee22,_0x4cabee);if(!_0x18e01b)throw new Error(_0x1e475f(0x17e));const _0x1c74cd=generateJourneyLocalName(_0x18e01b[_0x1e475f(0x1b3)]),_0x1beb95=_0x18e01b['kind']===SEGMENT_KIND_JOURNEY&&_0x1c74cd!==undefined;let _0x3713d4=_0x18e01b[_0x1e475f(0x1b3)],_0x1fe49f;if(_0x1beb95&&_0x18e01b[_0x1e475f(0x15d)]){const _0x27dba6=apiRuleToYaml(_0x18e01b[_0x1e475f(0x15d)]);_0x4239ce['set'](_0x56ee22,_0x27dba6);const _0x5c06b6=async _0x47d0d9=>{const _0x4123b1=_0x1e475f,_0x19b035=collectSegmentRefsFromRule(_0x47d0d9);for(const _0x3c8503 of _0x19b035){if(!_0x4239ce[_0x4123b1(0x15f)](_0x3c8503))try{const _0x3c77f6=await fetchSegment(_0x3bbc7c,_0x4c0f5c,_0x3c8503,_0x4cabee);if(_0x3c77f6?.[_0x4123b1(0x15d)]){const _0x499de7=apiRuleToYaml(_0x3c77f6[_0x4123b1(0x15d)]);_0x4239ce[_0x4123b1(0x1ec)](_0x3c8503,_0x499de7),await _0x5c06b6(_0x499de7);}}catch(_0x5685e1){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x3c8503+':\x20'+_0x5685e1);}}};await _0x5c06b6(_0x27dba6);const _0x52ba3b=serializeExpandedRule(_0x27dba6,_0x4239ce),_0x290a83=_0x5d0de9['get'](_0x52ba3b);if(_0x290a83&&_0x290a83[_0x1e475f(0x196)]>0x0){const _0x333ed0=_0xcb5de6[_0x1e475f(0x142)](_0x52ba3b)||0x0,_0x138be4=_0x290a83[_0x333ed0]||_0x290a83[_0x290a83['length']-0x1];_0xcb5de6[_0x1e475f(0x1ec)](_0x52ba3b,_0x333ed0+0x1),_0x3713d4=_0x138be4,_0x38dc32[_0x1e475f(0x1ef)](_0x3713d4),_0x4fadca[_0x1e475f(0x1ec)](_0x56ee22,_0x3713d4);const _0x100cd5=await resolveRuleSegmentRefs(_0x27dba6,async _0x432233=>{const _0x5b3a24=_0x1e475f,_0x32d8ab=_0x4fadca[_0x5b3a24(0x142)](_0x432233);if(_0x32d8ab)return _0x32d8ab;const _0x29b965=await _0x3eb436[_0x5b3a24(0x1d6)](_0x432233);return _0x29b965['name'];});_0x1fe49f={'description':_0x18e01b['description'],'rule':_0x100cd5};}else{const _0x43880f=_0x559ea1[_0x1e475f(0x142)](_0x52ba3b);if(_0x43880f)_0x3713d4=_0x43880f,_0x4fadca[_0x1e475f(0x1ec)](_0x56ee22,_0x3713d4);else{if(_0x1c74cd){let _0x4ecd03=_0x1c74cd,_0x329059=0x2;while(_0x38dc32[_0x1e475f(0x15f)](_0x4ecd03)||_0x1e8227[_0x1e475f(0x15f)](_0x4ecd03)){_0x4ecd03=_0x1c74cd+'_'+_0x329059,_0x329059++;}_0x38dc32[_0x1e475f(0x1ef)](_0x4ecd03),_0x3713d4=_0x4ecd03;}_0x4fadca[_0x1e475f(0x1ec)](_0x56ee22,_0x3713d4),_0x559ea1['set'](_0x52ba3b,_0x3713d4);const _0x4145c0=await resolveRuleSegmentRefs(_0x27dba6,async _0x1a687f=>{const _0x2af314=_0x1e475f,_0x504788=_0x4fadca[_0x2af314(0x142)](_0x1a687f);if(_0x504788)return _0x504788;const _0x5ad492=await _0x3eb436[_0x2af314(0x1d6)](_0x1a687f);return _0x5ad492[_0x2af314(0x1b3)];});_0x1fe49f={'description':_0x18e01b[_0x1e475f(0x119)],'rule':_0x4145c0};}}}return{'name':_0x3713d4,'isJourneyLocal':_0x1beb95,'definition':_0x1fe49f};}catch(_0x3f900d){return logger[_0x1e475f(0x130)](_0x1e475f(0x13c)+_0x56ee22+':\x20'+_0x3f900d),{'name':_0x56ee22,'isJourneyLocal':![]};}},'resolveActivation':async _0x277ab4=>{const _0x53abfa=a136_0x9a65,_0x21a0f0=_0x2bf9a5[_0x53abfa(0x142)](_0x277ab4);if(_0x21a0f0!==undefined)return{'name':_0x21a0f0,'isJourneyLocal':!![]};try{let _0x11d7da=_0x4b7f8b?.[_0x53abfa(0x142)](_0x277ab4);!_0x11d7da&&(_0x11d7da=await _0x3bbc7c['journey'][_0x53abfa(0x197)](_0x30b411,_0x277ab4));const _0x1711f3=_0x11d7da['attributes'][_0x53abfa(0x17d)][_0x53abfa(0x1b3)]||_0x277ab4,_0x1fa04e=sanitizeYamlKey(_0x1711f3)||_0x53abfa(0xfc)+_0x277ab4,_0x42eb3d=_0x1fa04e;_0x2bf9a5[_0x53abfa(0x1ec)](_0x277ab4,_0x42eb3d);const _0x4a218c=journeyActivationStepToYaml(_0x11d7da,_0x3d8281,_0x346e6f);return{'name':_0x42eb3d,'isJourneyLocal':!![],'definition':_0x4a218c};}catch(_0x22f530){return logger[_0x53abfa(0x130)](_0x53abfa(0x18d)+_0x277ab4+':\x20'+_0x22f530),{'name':_0x277ab4,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x42bb8f,_0x12ddff)=>resolveJumpTarget(_0x42bb8f,_0x12ddff,_0x4d377d,async _0x401b5c=>{const _0x4af32c=a136_0x9a65,_0x1d6435=_0x56c0b9?.[_0x4af32c(0x142)](_0x401b5c);if(_0x1d6435)return _0x1d6435;return _0x3bbc7c[_0x4af32c(0x192)][_0x4af32c(0x185)](_0x401b5c);})};return _0x3eb436=_0x105f05,_0x105f05;},_0x16e550=async _0x3e9362=>{const _0x1b9a33=a136_0x9a65,{collectSegmentIdsFromJourneyApi:_0x5bccfc}=await import('./journey-yaml.js'),{batchAsync:_0x573b2a}=await import(_0x1b9a33(0xfd)),_0x471833=new Set();for(const _0x4a226f of _0x3e9362){let _0x21120e=_0x56c0b9?.['get'](_0x4a226f);!_0x21120e&&(_0x21120e=await _0x3bbc7c['journey'][_0x1b9a33(0x185)](_0x4a226f));const _0x5d595f=_0x5bccfc(_0x21120e);for(const _0x92a879 of _0x5d595f){_0x471833['add'](_0x92a879);}}let _0x4edd62=Array['from'](_0x471833);while(_0x4edd62[_0x1b9a33(0x196)]>0x0){const _0x13a31e=_0x4edd62[_0x1b9a33(0x10e)](_0x25dd9b=>!_0x296880[_0x1b9a33(0x15f)](_0x25dd9b));if(_0x13a31e[_0x1b9a33(0x196)]===0x0)break;const _0x4d6b46=await _0x573b2a(_0x13a31e,async _0x4d91fc=>{const _0x6b3415=_0x1b9a33;_0x296880[_0x6b3415(0x1ef)](_0x4d91fc);const _0x38615a=await fetchSegment(_0x3bbc7c,_0x4c0f5c,_0x4d91fc,_0x4cabee);if(!_0x38615a)return null;return{'segmentId':_0x4d91fc,'segment':_0x38615a};},0xa),_0x289d14=new Set();for(const _0x27c8fa of _0x4d6b46){if(!_0x27c8fa?.['segment']?.[_0x1b9a33(0x15d)])continue;const _0x5b2c30=apiRuleToYaml(_0x27c8fa[_0x1b9a33(0x10a)][_0x1b9a33(0x15d)]);_0x4239ce[_0x1b9a33(0x1ec)](_0x27c8fa['segmentId'],_0x5b2c30);const _0x41f2c6=collectSegmentRefsFromRule(_0x5b2c30);for(const _0x2f485d of _0x41f2c6){!_0x296880[_0x1b9a33(0x15f)](_0x2f485d)&&_0x289d14[_0x1b9a33(0x1ef)](_0x2f485d);}}_0x4edd62=Array['from'](_0x289d14);}};return{'createYamlContext':_0x3edc7b,'prefetchJourneySegments':_0x16e550};}export async function executePushSegments(_0x299201,_0x176658,_0x4a700d,_0x48561c,_0x2e45ba){const _0x285387=a136_0x440cdd,{segmentDefToCreateRequest:_0x55a9cd,segmentDefToUpdateRequest:_0x260773}=await import(_0x285387(0x1f3)),_0x46904c=_0x4a700d['folderPathToId'],_0x1d2297=0x5,_0x13da83=async _0x61d38c=>{const _0xfc1427=_0x285387,_0x19720b=_0x61d38c['folderPath']?_0x46904c['get'](_0x61d38c['folderPath']):undefined;let _0x4fcdb3;const _0x16bedb={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x44048a=_0x61d38c['yamlConfig'];if(_0x61d38c[_0xfc1427(0x12e)][_0xfc1427(0x15d)]){const _0x49972f=createSegmentIdResolver(_0x4a700d['segmentNameToId'],_0x61d38c['yamlConfig']['name']),_0x91b407=await resolveRuleSegmentIds(_0x61d38c[_0xfc1427(0x12e)][_0xfc1427(0x15d)],_0x49972f);_0x44048a={..._0x61d38c[_0xfc1427(0x12e)],'rule':_0x91b407};}try{if(_0x61d38c[_0xfc1427(0x1b6)]){_0x2e45ba[_0xfc1427(0x18e)]?.({'type':'segment_creating','name':_0x61d38c[_0xfc1427(0x12e)][_0xfc1427(0x1b3)]});const _0x5ed1a1=_0x55a9cd(_0x44048a,_0x19720b),_0x97f806=await _0x2e45ba[_0xfc1427(0x135)]('Creating\x20segment\x20\x27'+_0x61d38c[_0xfc1427(0x12e)][_0xfc1427(0x1b3)]+_0xfc1427(0x198),()=>_0x299201['segment'][_0xfc1427(0x1da)](_0x48561c[_0xfc1427(0x1a1)],_0x5ed1a1));_0x4fcdb3=_0x97f806[_0xfc1427(0x148)]['id'],_0x4a700d['segmentNameToId'][_0xfc1427(0x1ec)](_0x61d38c[_0xfc1427(0x12e)]['name'],_0x4fcdb3),_0x16bedb[_0xfc1427(0x169)]={'name':_0x61d38c['yamlConfig'][_0xfc1427(0x1b3)],'id':_0x4fcdb3},_0x2e45ba[_0xfc1427(0x18e)]?.({'type':'segment_created','name':_0x61d38c[_0xfc1427(0x12e)][_0xfc1427(0x1b3)],'segmentId':_0x4fcdb3}),_0x2e45ba[_0xfc1427(0x183)]?.('Created\x20segment\x20\x27'+_0x61d38c[_0xfc1427(0x12e)][_0xfc1427(0x1b3)]+'\x27'),_0x16bedb[_0xfc1427(0x12f)]=0x1;}else{if(_0x61d38c[_0xfc1427(0x1db)]){_0x2e45ba[_0xfc1427(0x18e)]?.({'type':'segment_updating','name':_0x61d38c[_0xfc1427(0x12e)][_0xfc1427(0x1b3)]});const _0x2aa502=_0x260773(_0x44048a);_0x19720b!==_0x61d38c[_0xfc1427(0x1ce)]?.['segmentFolderId']&&(_0x2aa502[_0xfc1427(0x1ac)]=_0x19720b?parseInt(_0x19720b,0xa):undefined),await _0x2e45ba[_0xfc1427(0x135)]('Updating\x20segment\x20\x27'+_0x61d38c[_0xfc1427(0x12e)][_0xfc1427(0x1b3)]+_0xfc1427(0x198),()=>_0x299201[_0xfc1427(0x10a)][_0xfc1427(0x181)](_0x48561c[_0xfc1427(0x1a1)],_0x61d38c[_0xfc1427(0x1ce)]['id'],_0x2aa502)),_0x4fcdb3=_0x61d38c[_0xfc1427(0x1ce)]['id'],_0x2e45ba[_0xfc1427(0x18e)]?.({'type':_0xfc1427(0x159),'name':_0x61d38c[_0xfc1427(0x12e)][_0xfc1427(0x1b3)]}),_0x2e45ba[_0xfc1427(0x183)]?.(_0xfc1427(0x140)+_0x61d38c[_0xfc1427(0x12e)][_0xfc1427(0x1b3)]+'\x27'),_0x16bedb[_0xfc1427(0x13f)]=0x1;}else _0x4fcdb3=_0x61d38c['existingSegment']['id'];}}catch(_0x19565c){const _0x249099=isHttp400Error(_0x19565c),_0x16203e=_0x249099?ErrorCode[_0xfc1427(0x170)]:ErrorCode[_0xfc1427(0x128)],_0x165d51=getErrorMessage(_0x19565c);throw new SDKError(_0x16203e,_0xfc1427(0x1a8)+(_0x61d38c[_0xfc1427(0x1b6)]?_0xfc1427(0x19a):_0xfc1427(0x1c6))+_0xfc1427(0x1a7)+_0x61d38c['absolutePath']+_0xfc1427(0x123)+_0x165d51,_0x19565c);}try{const _0x47bb49=await syncActivationsForSegment(_0x299201,_0x48561c[_0xfc1427(0x1a1)],_0x4fcdb3,_0x61d38c[_0xfc1427(0x12e)][_0xfc1427(0x1b3)],_0x61d38c[_0xfc1427(0x149)],_0x2e45ba,_0x61d38c[_0xfc1427(0x1ae)]);_0x16bedb[_0xfc1427(0x1c4)]=_0x47bb49;}catch(_0x4f6237){if(_0x4f6237 instanceof SDKError)throw _0x4f6237;throw new SDKError(ErrorCode[_0xfc1427(0x155)],_0xfc1427(0x16c)+_0x61d38c['yamlConfig'][_0xfc1427(0x1b3)]+_0xfc1427(0x1a0)+_0x61d38c[_0xfc1427(0x1ae)]+'\x0a\x20\x20'+getErrorMessage(_0x4f6237),_0x4f6237);}return _0x16bedb;},_0x366b7e=await batchAsync(_0x176658,_0x13da83,_0x1d2297),_0x1fd8af={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4bad08 of _0x366b7e){_0x1fd8af['created']+=_0x4bad08[_0x285387(0x12f)],_0x1fd8af[_0x285387(0x13f)]+=_0x4bad08[_0x285387(0x13f)],_0x4bad08[_0x285387(0x169)]&&_0x1fd8af['createdSegmentIds'][_0x285387(0x1ec)](_0x4bad08[_0x285387(0x169)][_0x285387(0x1b3)],_0x4bad08['createdSegmentId']['id']),_0x1fd8af[_0x285387(0x1c4)][_0x285387(0x12f)]+=_0x4bad08[_0x285387(0x1c4)]['created'],_0x1fd8af[_0x285387(0x1c4)][_0x285387(0x13f)]+=_0x4bad08[_0x285387(0x1c4)][_0x285387(0x13f)],_0x1fd8af[_0x285387(0x1c4)][_0x285387(0x1ba)]+=_0x4bad08[_0x285387(0x1c4)][_0x285387(0x1ba)];}return _0x1fd8af;}async function syncActivationsForSegment(_0x310585,_0x10f44d,_0x1b9446,_0x3f5468,_0x2b6efd,_0x4fa62c,_0x3822ae){const _0xb06e25=a136_0x440cdd,_0x26d62f={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4f709c of _0x2b6efd){try{if(_0x4f709c[_0xb06e25(0x143)]===_0xb06e25(0x19a)&&_0x4f709c[_0xb06e25(0x1c0)])_0x4fa62c[_0xb06e25(0x18e)]?.({'type':_0xb06e25(0x17a),'segmentName':_0x3f5468,'activationName':_0x4f709c[_0xb06e25(0x1b3)]}),await _0x4fa62c['withProgress'](_0xb06e25(0x124)+_0x4f709c[_0xb06e25(0x1b3)]+_0xb06e25(0x198),()=>_0x310585[_0xb06e25(0x10a)][_0xb06e25(0x163)](_0x10f44d,_0x1b9446,_0x4f709c[_0xb06e25(0x1c0)])),_0x4fa62c[_0xb06e25(0x18e)]?.({'type':_0xb06e25(0x114),'segmentName':_0x3f5468,'activationName':_0x4f709c['name']}),_0x4fa62c['logSuccess']?.(_0xb06e25(0x179)+_0x4f709c[_0xb06e25(0x1b3)]+'\x27'),_0x26d62f[_0xb06e25(0x12f)]++;else{if(_0x4f709c['type']===_0xb06e25(0x1c6)&&_0x4f709c[_0xb06e25(0x1c0)]&&_0x4f709c['existingActivation'])_0x4fa62c[_0xb06e25(0x18e)]?.({'type':_0xb06e25(0x139),'segmentName':_0x3f5468,'activationName':_0x4f709c[_0xb06e25(0x1b3)]}),await _0x4fa62c['withProgress'](_0xb06e25(0x12b)+_0x4f709c['name']+_0xb06e25(0x198),()=>_0x310585['segment'][_0xb06e25(0x1c3)](_0x10f44d,_0x1b9446,_0x4f709c[_0xb06e25(0x1f5)]['id'],_0x4f709c[_0xb06e25(0x1c0)])),_0x4fa62c['onProgress']?.({'type':_0xb06e25(0x189),'segmentName':_0x3f5468,'activationName':_0x4f709c[_0xb06e25(0x1b3)]}),_0x4fa62c[_0xb06e25(0x183)]?.(_0xb06e25(0x1e4)+_0x4f709c[_0xb06e25(0x1b3)]+'\x27'),_0x26d62f[_0xb06e25(0x13f)]++;else _0x4f709c[_0xb06e25(0x143)]===_0xb06e25(0x191)&&_0x4f709c[_0xb06e25(0x1f5)]&&(_0x4fa62c['onProgress']?.({'type':_0xb06e25(0xfa),'segmentName':_0x3f5468,'activationName':_0x4f709c['name']}),await _0x4fa62c['withProgress'](_0xb06e25(0x10c)+_0x4f709c[_0xb06e25(0x1b3)]+_0xb06e25(0x198),()=>_0x310585[_0xb06e25(0x10a)][_0xb06e25(0x14d)](_0x10f44d,_0x1b9446,_0x4f709c[_0xb06e25(0x1f5)]['id'])),_0x4fa62c[_0xb06e25(0x18e)]?.({'type':_0xb06e25(0x15b),'segmentName':_0x3f5468,'activationName':_0x4f709c['name']}),_0x4fa62c['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x4f709c[_0xb06e25(0x1b3)]+'\x27'),_0x26d62f[_0xb06e25(0x1ba)]++);}}catch(_0x3df822){const _0x58fc18=isHttp400Error(_0x3df822),_0x1fd764=_0x58fc18?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xca668b=getErrorMessage(_0x3df822);throw new SDKError(_0x1fd764,_0xb06e25(0x1a8)+_0x4f709c[_0xb06e25(0x143)]+'\x20activation\x20\x27'+_0x4f709c[_0xb06e25(0x1b3)]+_0xb06e25(0x1a0)+_0x3822ae+_0xb06e25(0x123)+_0xca668b,_0x3df822);}}return _0x26d62f;}export async function executePushFolders(_0x373030,_0x4d2f8c,_0x124ee8,_0xdee731,_0xf6f0d4){const _0x1a38f4=a136_0x440cdd,_0x54d954=new Map(_0x124ee8),_0x5672ab=sortFoldersByDepth(_0x4d2f8c);for(const _0x1620ab of _0x5672ab){const _0x41e1c7=_0x1620ab['split']('/'),_0x19675d=_0x41e1c7[_0x41e1c7[_0x1a38f4(0x196)]-0x1],_0x2d0876=_0x41e1c7[_0x1a38f4(0x1be)](0x0,-0x1)[_0x1a38f4(0x145)]('/'),_0x4a9752=_0x54d954[_0x1a38f4(0x142)](_0x2d0876);_0xf6f0d4[_0x1a38f4(0x18e)]?.({'type':_0x1a38f4(0x100),'folder':_0x1620ab});const _0x39dfdf={'name':_0x19675d,'parentFolderId':_0x4a9752},_0xb67bd8=await _0xf6f0d4[_0x1a38f4(0x135)](_0x1a38f4(0x1a5)+_0x1620ab+'\x27...',()=>_0x373030[_0x1a38f4(0x10a)][_0x1a38f4(0x199)](_0xdee731['parentId'],_0x39dfdf));_0x54d954[_0x1a38f4(0x1ec)](_0x1620ab,_0xb67bd8[_0x1a38f4(0x148)]['id']),_0xf6f0d4[_0x1a38f4(0x18e)]?.({'type':_0x1a38f4(0x16e),'folder':_0x1620ab,'folderId':_0xb67bd8[_0x1a38f4(0x148)]['id']}),_0xf6f0d4[_0x1a38f4(0x11d)]?.(_0x1a38f4(0x117)+_0x1620ab+'\x27');}return _0x54d954;}export async function executePushSegmentDeletions(_0x3eb7a0,_0x3fc07b,_0x2f9473){const _0x47070f=a136_0x440cdd;if(_0x3fc07b[_0x47070f(0x196)]===0x0)return 0x0;const {batchAsync:_0x1f16f4}=await import(_0x47070f(0xfd)),_0x2f2f02=0x5,_0x4e3f61=await _0x1f16f4(_0x3fc07b,async _0x4d6199=>{const _0x3cf323=_0x47070f;return _0x2f9473[_0x3cf323(0x18e)]?.({'type':_0x3cf323(0x1d4),'name':_0x4d6199[_0x3cf323(0x1b3)]}),await _0x3eb7a0[_0x3cf323(0x10a)][_0x3cf323(0x11a)](_0x4d6199['id']),_0x2f9473['onProgress']?.({'type':'segment_deleted','name':_0x4d6199[_0x3cf323(0x1b3)]}),_0x2f9473[_0x3cf323(0x1d0)]?.(_0x3cf323(0x13e)+_0x4d6199[_0x3cf323(0x1b3)]+'\x27'),0x1;},_0x2f2f02);return _0x4e3f61[_0x47070f(0x1b7)]((_0x1a5244,_0x496f78)=>_0x1a5244+_0x496f78,0x0);}export async function executePushJourneys(_0x52a032,_0x5cbdf2,_0x5a48ec,_0xdd60c,_0x338df3){const _0x1d6967=a136_0x440cdd,{journeyDefToRequest:_0x42f007}=await import(_0x1d6967(0x132)),{activationDefToCreateRequest:_0x456fd6,yamlRuleToApi:_0x390087,validateSegmentRule:_0x1cedb7}=await import(_0x1d6967(0x1f3)),_0x21010d={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2f758e=new Map(_0x5a48ec['segmentNameToId']),_0x29c19d=0x5;for(let _0x2e746e=0x0;_0x2e746e<_0x5cbdf2[_0x1d6967(0x196)];_0x2e746e+=_0x29c19d){const _0x14b135=_0x5cbdf2[_0x1d6967(0x1be)](_0x2e746e,_0x2e746e+_0x29c19d),_0x55cfa1=await Promise[_0x1d6967(0x1a2)](_0x14b135[_0x1d6967(0x151)](async _0x3e29e7=>{const _0x3f12a8=_0x1d6967;if(!_0x3e29e7[_0x3f12a8(0x1b6)]&&!_0x3e29e7['hasChanges'])return{'action':_0x3f12a8(0x19b),'name':_0x3e29e7[_0x3f12a8(0x12e)][_0x3f12a8(0x1b3)],'journeyId':_0x3e29e7[_0x3f12a8(0x103)]?.['id']};const _0x2935cf=_0x3e29e7[_0x3f12a8(0x131)]?_0x5a48ec[_0x3f12a8(0x1e3)]['get'](_0x3e29e7[_0x3f12a8(0x131)]):undefined;_0x338df3[_0x3f12a8(0x18e)]?.({'type':_0x3e29e7['isNew']?_0x3f12a8(0x160):'journey_updating','name':_0x3e29e7['yamlConfig'][_0x3f12a8(0x1b3)]});try{const _0x2cec4c=await executeSingleJourneyPush(_0x52a032,_0x3e29e7,{..._0x5a48ec,'segmentNameToId':_0x2f758e},{'parentId':_0xdd60c[_0x3f12a8(0x1a1)],'rootFolderId':_0xdd60c['rootFolderId'],'folderId':_0x2935cf,'verbose':_0xdd60c[_0x3f12a8(0x16f)]},_0x338df3,{'journeyDefToRequest':_0x42f007,'activationDefToCreateRequest':_0x456fd6,'yamlRuleToApi':_0x390087,'validateSegmentRule':_0x1cedb7});for(const [_0x5c1923,_0x14e260]of _0x2cec4c[_0x3f12a8(0x1b1)]){_0x2f758e[_0x3f12a8(0x1ec)](_0x5c1923,_0x14e260),_0x21010d[_0x3f12a8(0x1b1)]['set'](_0x5c1923,_0x14e260);}if(_0x2cec4c[_0x3f12a8(0x1c8)]===_0x3f12a8(0x12f))_0x338df3[_0x3f12a8(0x18e)]?.({'type':_0x3f12a8(0x1c9),'name':_0x3e29e7[_0x3f12a8(0x12e)][_0x3f12a8(0x1b3)],'journeyId':_0x2cec4c[_0x3f12a8(0x107)]}),_0x338df3[_0x3f12a8(0x183)]?.(_0x3f12a8(0x1dd)+_0x3e29e7[_0x3f12a8(0x12e)][_0x3f12a8(0x1b3)]+'\x27'),_0x21010d[_0x3f12a8(0x12f)]++;else _0x2cec4c[_0x3f12a8(0x1c8)]===_0x3f12a8(0x13f)&&(_0x338df3[_0x3f12a8(0x18e)]?.({'type':_0x3f12a8(0x116),'name':_0x3e29e7[_0x3f12a8(0x12e)]['name']}),_0x338df3['logSuccess']?.('Updated\x20journey\x20\x27'+_0x3e29e7[_0x3f12a8(0x12e)][_0x3f12a8(0x1b3)]+'\x27'),_0x21010d[_0x3f12a8(0x13f)]++);return{'action':_0x2cec4c[_0x3f12a8(0x1c8)],'name':_0x3e29e7[_0x3f12a8(0x12e)][_0x3f12a8(0x1b3)],'journeyId':_0x2cec4c[_0x3f12a8(0x107)]};}catch(_0x27eae7){const _0x59c5b8=isHttp400Error(_0x27eae7),_0x520a9c=_0x59c5b8?ErrorCode[_0x3f12a8(0x19f)]:ErrorCode[_0x3f12a8(0x109)],_0x5b6116=getErrorMessage(_0x27eae7);throw new SDKError(_0x520a9c,'Failed\x20to\x20'+(_0x3e29e7[_0x3f12a8(0x1b6)]?'create':_0x3f12a8(0x1c6))+'\x20journey\x20from\x20file:\x20'+_0x3e29e7[_0x3f12a8(0x1ae)]+_0x3f12a8(0x123)+_0x5b6116,_0x27eae7);}}));_0x21010d[_0x1d6967(0x133)]['push'](..._0x55cfa1);}return _0x21010d;}async function matchExistingJourneySegments(_0x2f656e,_0x37fe3a,_0x57ab03,_0x327df9,_0x1cae01){const _0x4dae60=a136_0x440cdd;if(!_0x37fe3a[_0x4dae60(0x103)]||!_0x37fe3a[_0x4dae60(0x12e)][_0x4dae60(0x108)])return;const _0x5158c8=new Map(),_0x14719e=new Set();for(const _0x5d1825 of Object[_0x4dae60(0x15a)](_0x37fe3a[_0x4dae60(0x12e)]['segments'])){const _0x53e80b=generateDeterministicJourneySegmentName(_0x37fe3a[_0x4dae60(0x12e)][_0x4dae60(0x1b3)],_0x5d1825);_0x5158c8[_0x4dae60(0x1ec)](_0x53e80b,_0x5d1825),_0x14719e['add'](_0x5d1825);}const _0x5cd57a=[],_0x2c9873=collectSegmentIdsFromJourneyApi(_0x37fe3a[_0x4dae60(0x103)]);for(const _0x590f61 of _0x2c9873){const _0x278184=await fetchSegment(_0x2f656e,_0x57ab03,_0x590f61,_0x327df9);if(!_0x278184?.[_0x4dae60(0x1b3)])continue;const _0x195bc9=_0x5158c8[_0x4dae60(0x142)](_0x278184[_0x4dae60(0x1b3)]);_0x195bc9?(_0x1cae01[_0x4dae60(0x1ec)](_0x195bc9,_0x590f61),_0x14719e[_0x4dae60(0x191)](_0x195bc9)):_0x5cd57a['push']({'id':_0x590f61,'seg':_0x278184});}if(_0x14719e['size']>0x0&&_0x5cd57a[_0x4dae60(0x196)]>0x0){const {localExpandedRuleToNames:_0x2ff25e}=buildLocalExpandedRuleMappings(_0x37fe3a[_0x4dae60(0x12e)]),_0x1e2187=new Map();for(const {id:_0x493e9e,seg:_0x202ac0}of _0x5cd57a){if(_0x202ac0[_0x4dae60(0x15d)]){const _0x2a52d4=apiRuleToYaml(_0x202ac0[_0x4dae60(0x15d)]);_0x1e2187[_0x4dae60(0x1ec)](_0x493e9e,_0x2a52d4);}}for(const {id:_0x622e6d,seg:_0x115ae9}of _0x5cd57a){if(!_0x115ae9[_0x4dae60(0x15d)])continue;const _0x4eee6d=_0x1e2187[_0x4dae60(0x142)](_0x622e6d);if(!_0x4eee6d)continue;const _0x5775c5=serializeExpandedRule(_0x4eee6d,_0x1e2187),_0x29bc7e=_0x2ff25e[_0x4dae60(0x142)](_0x5775c5);if(_0x29bc7e){const _0x518f4e=_0x29bc7e['find'](_0x335597=>_0x14719e[_0x4dae60(0x15f)](_0x335597));_0x518f4e&&(_0x1cae01[_0x4dae60(0x1ec)](_0x518f4e,_0x622e6d),_0x14719e[_0x4dae60(0x191)](_0x518f4e),logger[_0x4dae60(0x130)]('Matched\x20server\x20segment\x20\x27'+_0x115ae9[_0x4dae60(0x1b3)]+'\x27\x20to\x20local\x20\x27'+_0x518f4e+_0x4dae60(0x122)));}}}}async function executeSingleJourneyPush(_0x285920,_0x1863c3,_0x45103a,_0x443be0,_0x1a0d6e,_0x2df527){const _0x3b34e5=a136_0x440cdd,{journeyDefToRequest:_0x31adc0,activationDefToCreateRequest:_0x3ea89e,yamlRuleToApi:_0x5c19c5,validateSegmentRule:_0x27eac0}=_0x2df527,_0x2fb677=new Map(),_0x2363fa=new Map();recoverSegmentIdsFromPushRecovery(_0x1863c3,_0x2fb677,_0x45103a[_0x3b34e5(0x1d3)]);const _0x404c82=new Map(),_0x28058d=new Map(),_0x492446=new Map();let _0x10d97d;const _0xf8ef84=async()=>{const _0x10b688=_0x3b34e5;if(_0x10d97d)return;_0x10d97d=new Map();if(!_0x1863c3[_0x10b688(0x103)])return;const _0x28ffe2=await _0x285920['journey'][_0x10b688(0x1bd)](_0x1863c3[_0x10b688(0x103)]['id']);for(const _0x35a99f of _0x28ffe2){const _0x5092c0=journeyActivationStepToYaml(_0x35a99f,_0x45103a[_0x10b688(0x15e)],_0x45103a[_0x10b688(0x1e0)]),_0x4e85b1=activationSignature(_0x5092c0);!_0x10d97d[_0x10b688(0x15f)](_0x4e85b1)&&_0x10d97d[_0x10b688(0x1ec)](_0x4e85b1,_0x35a99f['id']),_0x5092c0[_0x10b688(0x1b3)]&&_0x2363fa[_0x10b688(0x1ec)](_0x5092c0['name'],_0x35a99f['id']);}};await matchExistingJourneySegments(_0x285920,_0x1863c3,_0x443be0['parentId'],_0x45103a[_0x3b34e5(0x173)],_0x45103a['segmentNameToId']);const _0x1225f6={'resolveSegmentId':async _0x2b5181=>{const _0x261b45=_0x3b34e5,_0x1a351e=_0x45103a[_0x261b45(0x1d3)][_0x261b45(0x142)](_0x2b5181);if(!_0x1a351e)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x2b5181+_0x261b45(0x1df)+_0x1863c3[_0x261b45(0x12e)][_0x261b45(0x1b3)]+')');return _0x1a351e;},'resolveEmbeddedSegmentId':async(_0x3b3b06,_0x12317f)=>{const _0x4725ee=_0x3b34e5,_0x5e3782=_0x45103a[_0x4725ee(0x1d3)][_0x4725ee(0x142)](_0x3b3b06);if(_0x5e3782)return _0x5e3782;const _0x53c52b=_0x45103a[_0x4725ee(0x173)][_0x4725ee(0x1e1)](_0x4e4f72=>_0x4e4f72[_0x4725ee(0x1b3)]===_0x3b3b06);if(_0x53c52b)return _0x45103a[_0x4725ee(0x1d3)][_0x4725ee(0x1ec)](_0x3b3b06,_0x53c52b['id']),_0x53c52b['id'];if(_0x1863c3[_0x4725ee(0x1b6)]){const {stageName:_0x3c6266,criteriaName:_0xd8f3be}=findSegmentCriteriaLocation(_0x1863c3[_0x4725ee(0x12e)],_0x3b3b06);return _0x27eac0(_0x3b3b06,_0x12317f['rule']),_0x28058d[_0x4725ee(0x1ec)](_0x3b3b06,{'definition':_0x12317f,'stageName':_0x3c6266,'criteriaName':_0xd8f3be}),createPendingSegmentId(_0x3b3b06);}const _0x491699=_0x1863c3['existingJourney']?.['id'];if(!_0x491699)throw new SDKError(ErrorCode['INTERNAL'],_0x4725ee(0x17f));const _0x2b0f3e=_0x404c82[_0x4725ee(0x142)](_0x3b3b06);if(_0x2b0f3e)return _0x2b0f3e;const _0x368ead=((async()=>{const _0x49f0f9=_0x4725ee;_0x27eac0(_0x3b3b06,_0x12317f[_0x49f0f9(0x15d)]);const _0xaef1a6=generateDeterministicJourneySegmentName(_0x1863c3[_0x49f0f9(0x12e)][_0x49f0f9(0x1b3)],_0x3b3b06),_0x107418=_0x45103a[_0x49f0f9(0x173)]['find'](_0x521260=>_0x521260[_0x49f0f9(0x1b3)]===_0xaef1a6),_0x160bff=createSegmentIdResolver(_0x45103a[_0x49f0f9(0x1d3)],_0x3b3b06),_0x104c4b=await resolveRuleSegmentIds(_0x12317f[_0x49f0f9(0x15d)],_0x160bff);let _0x4f5e30;return _0x107418?(await _0x285920[_0x49f0f9(0x10a)][_0x49f0f9(0x181)](_0x443be0[_0x49f0f9(0x1a1)],_0x107418['id'],{'description':_0x12317f[_0x49f0f9(0x119)]||_0x49f0f9(0x1d1)+_0x3b3b06,'rule':_0x5c19c5(_0x104c4b,!![]),'countPopulation':!![]}),_0x4f5e30=_0x107418['id'],saveSegmentToPushRecovery(_0x1863c3['absolutePath'],_0x1863c3[_0x49f0f9(0x12e)]['name'],_0x3b3b06,{'segmentId':_0x4f5e30,'uniqueServerName':_0xaef1a6,'createdAt':new Date()[_0x49f0f9(0x1b2)]()})):_0x4f5e30=await createOrRecoverEmbeddedSegment(_0x285920,_0x1863c3,{'localName':_0x3b3b06,'uniqueSegmentName':_0xaef1a6,'description':_0x12317f[_0x49f0f9(0x119)]||'Entry\x20criteria:\x20'+_0x3b3b06,'journeyId':_0x491699,'resolvedRule':_0x104c4b,'parentId':_0x443be0[_0x49f0f9(0x1a1)],'folderId':_0x443be0[_0x49f0f9(0x18f)]||''},_0x5c19c5),_0x45103a['segmentNameToId'][_0x49f0f9(0x1ec)](_0x3b3b06,_0x4f5e30),_0x2fb677[_0x49f0f9(0x1ec)](_0x3b3b06,_0x4f5e30),_0x4f5e30;})());_0x404c82[_0x4725ee(0x1ec)](_0x3b3b06,_0x368ead);try{return await _0x368ead;}finally{_0x404c82[_0x4725ee(0x191)](_0x3b3b06);}},'resolveActivationId':async _0x48782e=>{const _0x4a677c=_0x3b34e5,_0x47e7e7=_0x2363fa[_0x4a677c(0x142)](_0x48782e);if(_0x47e7e7)return _0x47e7e7;if(_0x1863c3['existingJourney']){await _0xf8ef84();const _0x330881=_0x2363fa[_0x4a677c(0x142)](_0x48782e);if(_0x330881)return _0x330881;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x48782e+_0x4a677c(0x1df)+_0x1863c3[_0x4a677c(0x12e)][_0x4a677c(0x1b3)]+_0x4a677c(0x175)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x2fa733,_0x33bf99)=>{const _0x5c1b82=_0x3b34e5,_0x1f7e6e=_0x2363fa[_0x5c1b82(0x142)](_0x2fa733);if(_0x1f7e6e)return _0x1f7e6e;if(_0x1863c3['isNew'])return _0x492446[_0x5c1b82(0x1ec)](_0x2fa733,_0x33bf99),createPendingActivationId(_0x2fa733);if(_0x1863c3[_0x5c1b82(0x103)]){await _0xf8ef84();const _0x5488c8=_0x2363fa[_0x5c1b82(0x142)](_0x33bf99[_0x5c1b82(0x1b3)]);if(_0x5488c8)return _0x2363fa[_0x5c1b82(0x1ec)](_0x2fa733,_0x5488c8),_0x5488c8;const _0x2ab2ed=activationSignature(_0x33bf99),_0x446f7c=_0x10d97d?.[_0x5c1b82(0x142)](_0x2ab2ed);if(_0x446f7c)return _0x2363fa[_0x5c1b82(0x1ec)](_0x2fa733,_0x446f7c),_0x446f7c;const _0xfe01f6=await _0x3ea89e(_0x33bf99,_0x45103a[_0x5c1b82(0x14f)]),_0x365e34={..._0xfe01f6,..._0x33bf99[_0x5c1b82(0x18a)]!==undefined&&{'runAfterJourneyRefresh':_0x33bf99[_0x5c1b82(0x18a)]}},_0x30491a=await _0x285920['journey']['createActivation'](_0x1863c3[_0x5c1b82(0x103)]['id'],_0x365e34);return _0x2363fa['set'](_0x2fa733,_0x30491a['id']),_0x30491a['id'];}throw new SDKError(ErrorCode[_0x5c1b82(0x1d5)],_0x5c1b82(0x138));},'resolveJourneyId':async _0x10e997=>{const _0x3c30c9=_0x3b34e5;try{return await _0x285920[_0x3c30c9(0x192)][_0x3c30c9(0x165)](_0x443be0[_0x3c30c9(0x1a1)],_0x10e997);}catch(_0x2deb02){throw new SDKError(ErrorCode[_0x3c30c9(0xf9)],_0x3c30c9(0x182)+_0x10e997+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x1863c3['yamlConfig'][_0x3c30c9(0x1b3)]+'\x27)',_0x2deb02);}},'resolveStageId':async(_0x14cda9,_0x248029)=>{const _0x1d8e2d=_0x3b34e5,_0x792bcc=await _0x285920[_0x1d8e2d(0x192)][_0x1d8e2d(0x185)](_0x14cda9),_0x5010ed=_0x792bcc[_0x1d8e2d(0x13d)][_0x1d8e2d(0x194)][_0x1d8e2d(0x1e1)](_0x579501=>_0x579501[_0x1d8e2d(0x1b3)]['toLowerCase']()===_0x248029['toLowerCase']());if(!_0x5010ed?.['id'])throw new SDKError(ErrorCode[_0x1d8e2d(0xf9)],_0x1d8e2d(0x1a6)+_0x248029+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x792bcc[_0x1d8e2d(0x13d)]['journeyBundleName']||_0x792bcc[_0x1d8e2d(0x13d)][_0x1d8e2d(0x1b3)])+'\x27');return _0x5010ed['id'];}},_0x26e7aa=await _0x31adc0(_0x1863c3[_0x3b34e5(0x12e)],_0x443be0[_0x3b34e5(0x1a1)],_0x1225f6),_0x10bd23=_0x443be0[_0x3b34e5(0x11b)]||_0x443be0[_0x3b34e5(0x18f)];_0x10bd23&&(_0x26e7aa[_0x3b34e5(0x1eb)]={'parentFolder':{'data':{'id':_0x10bd23,'type':_0x3b34e5(0x1bb)}}});if(_0x1863c3[_0x3b34e5(0x1b6)]){if(_0x28058d[_0x3b34e5(0x156)]>0x0||_0x492446['size']>0x0)return await executeThreeStepJourneyCreate(_0x285920,_0x1863c3,_0x26e7aa,{'pendingEmbeddedSegments':_0x28058d,'pendingEmbeddedActivations':_0x492446,'embeddedSegmentNameToId':_0x2fb677,'journeyActivationNameToId':_0x2363fa},{..._0x443be0,'effectiveFolderId':_0x10bd23},_0x45103a,_0x1a0d6e,_0x2df527);else{ensureJourneyDefaults(_0x26e7aa[_0x3b34e5(0x13d)]);const _0x4d03e4=await _0x285920['journey'][_0x3b34e5(0x19a)](_0x26e7aa);return deletePushRecovery(_0x1863c3['absolutePath']),{'action':_0x3b34e5(0x12f),'journeyId':_0x4d03e4['id'],'embeddedSegmentNameToId':_0x2fb677};}}else{if(_0x1863c3[_0x3b34e5(0x1db)]&&_0x1863c3['existingJourney']){_0x26e7aa['id']=_0x1863c3[_0x3b34e5(0x103)]['id'];const _0x36154a=_0x26e7aa['attributes'];_0x1863c3[_0x3b34e5(0x103)][_0x3b34e5(0x13d)]?.[_0x3b34e5(0x168)]&&(_0x36154a[_0x3b34e5(0x168)]=_0x1863c3['existingJourney'][_0x3b34e5(0x13d)][_0x3b34e5(0x168)]);const _0x57e42b=_0x1863c3['existingJourney']['attributes']?.[_0x3b34e5(0x194)];return _0x57e42b&&_0x26e7aa['attributes'][_0x3b34e5(0x194)]&&injectExistingStageIds(_0x26e7aa[_0x3b34e5(0x13d)][_0x3b34e5(0x194)],_0x57e42b),ensureJourneyDefaults(_0x36154a),await _0x285920[_0x3b34e5(0x192)][_0x3b34e5(0x1c6)](_0x1863c3[_0x3b34e5(0x103)]['id'],_0x26e7aa),deletePushRecovery(_0x1863c3[_0x3b34e5(0x1ae)]),{'action':'updated','journeyId':_0x1863c3[_0x3b34e5(0x103)]['id'],'embeddedSegmentNameToId':_0x2fb677};}}return deletePushRecovery(_0x1863c3[_0x3b34e5(0x1ae)]),{'action':_0x3b34e5(0x19b),'journeyId':_0x1863c3[_0x3b34e5(0x103)]?.['id'],'embeddedSegmentNameToId':_0x2fb677};}function findSegmentCriteriaLocation(_0x5c9a6f,_0x261143){const _0x25e755=a136_0x440cdd,_0x1d7e69=_0x5c9a6f['stages']||_0x5c9a6f[_0x25e755(0x1af)]?.[0x0]?.['stages']||[];let _0x4851b8='entry',_0x2c5599=_0x261143;const _0x1d2aa4=_0x5c9a6f['goal']||_0x5c9a6f[_0x25e755(0x1af)]?.[0x0]?.['goal'];if(_0x1d2aa4?.[_0x25e755(0x10a)]===_0x261143)return{'stageName':_0x25e755(0x1e6),'criteriaName':_0x1d2aa4[_0x25e755(0x1b3)]||_0x261143};_0x2a5dea:for(const _0x53d904 of _0x1d7e69){if(_0x53d904['entry_criteria']?.[_0x25e755(0x10a)]===_0x261143){_0x4851b8=_0x53d904[_0x25e755(0x1b3)],_0x2c5599=_0x53d904['entry_criteria'][_0x25e755(0x1b3)]||_0x261143;break;}if(_0x53d904['steps'])for(const _0x57857c of _0x53d904[_0x25e755(0x1aa)]){if(_0x57857c[_0x25e755(0x143)]===_0x25e755(0x101)&&_0x57857c[_0x25e755(0x16d)]?.[_0x25e755(0x144)])for(const _0xaeac15 of _0x57857c[_0x25e755(0x16d)]['branches']){if(_0xaeac15[_0x25e755(0x10a)]===_0x261143){_0x4851b8=_0x53d904[_0x25e755(0x1b3)],_0x2c5599=_0xaeac15[_0x25e755(0x1b3)]||_0x261143;break _0x2a5dea;}}}}return{'stageName':_0x4851b8,'criteriaName':_0x2c5599};}async function executeThreeStepJourneyCreate(_0x5edc08,_0x3cdb69,_0x5b9a7e,_0x416276,_0x3d8daf,_0x46e261,_0x29422a,_0x36111d){const _0x1cd174=a136_0x440cdd,{activationDefToCreateRequest:_0x459cca,yamlRuleToApi:_0x43021b}=_0x36111d,{pendingEmbeddedSegments:_0x76c0a5,pendingEmbeddedActivations:_0x3192e0,embeddedSegmentNameToId:_0x3242e8}=_0x416276,_0x25750f=JSON[_0x1cd174(0x1ca)](JSON[_0x1cd174(0x1dc)](_0x5b9a7e));ensureJourneyDefaults(_0x25750f['attributes']),stripPendingIds(_0x25750f);const _0x250d6d=await _0x5edc08[_0x1cd174(0x192)][_0x1cd174(0x19a)](_0x25750f),_0x4f5fa4=_0x250d6d['id'],_0x15756c=new Map();for(const _0x1f7049 of _0x250d6d['attributes'][_0x1cd174(0x194)]){_0x15756c[_0x1cd174(0x1ec)](_0x1f7049['name'][_0x1cd174(0x152)](),_0x1f7049['id']);}recoverSegmentIdsFromPushRecovery(_0x3cdb69,_0x3242e8,_0x46e261[_0x1cd174(0x1d3)]);for(const [_0x548654,{definition:_0x4c507d}]of _0x76c0a5){if(_0x3242e8['has'](_0x548654)){_0x29422a[_0x1cd174(0x18e)]?.({'type':_0x1cd174(0x19d),'journeyName':_0x3cdb69[_0x1cd174(0x12e)][_0x1cd174(0x1b3)],'segmentName':_0x548654});continue;}const _0x283231=generateDeterministicJourneySegmentName(_0x3cdb69[_0x1cd174(0x12e)][_0x1cd174(0x1b3)],_0x548654);_0x29422a[_0x1cd174(0x18e)]?.({'type':'embedded_segment_creating','journeyName':_0x3cdb69[_0x1cd174(0x12e)][_0x1cd174(0x1b3)],'segmentName':_0x548654});const _0x303fc3=createSegmentIdResolver(_0x46e261[_0x1cd174(0x1d3)],_0x548654),_0x505670=await resolveRuleSegmentIds(_0x4c507d['rule'],_0x303fc3),_0x4d1257=await createOrRecoverEmbeddedSegment(_0x5edc08,_0x3cdb69,{'localName':_0x548654,'uniqueSegmentName':_0x283231,'description':_0x4c507d[_0x1cd174(0x119)]||'Entry\x20criteria:\x20'+_0x548654,'journeyId':_0x4f5fa4,'resolvedRule':_0x505670,'parentId':_0x3d8daf[_0x1cd174(0x1a1)],'folderId':_0x3d8daf[_0x1cd174(0x184)]||''},_0x43021b);_0x3242e8['set'](_0x548654,_0x4d1257),_0x46e261[_0x1cd174(0x1d3)][_0x1cd174(0x1ec)](_0x548654,_0x4d1257),_0x29422a['onProgress']?.({'type':_0x1cd174(0x19d),'journeyName':_0x3cdb69[_0x1cd174(0x12e)]['name'],'segmentName':_0x548654});}const _0xdd6122=new Map();for(const [_0x75ce31,_0x5f0ea4]of _0x3192e0){_0x29422a[_0x1cd174(0x18e)]?.({'type':_0x1cd174(0x195),'journeyName':_0x3cdb69['yamlConfig'][_0x1cd174(0x1b3)],'activationName':_0x75ce31});const _0x40cf77=await _0x459cca(_0x5f0ea4,_0x46e261['activationContext']),_0x4d04bf={..._0x40cf77,..._0x5f0ea4['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x5f0ea4[_0x1cd174(0x18a)]}},_0x1817bd=await _0x5edc08[_0x1cd174(0x192)][_0x1cd174(0x163)](_0x4f5fa4,_0x4d04bf);_0xdd6122[_0x1cd174(0x1ec)](_0x75ce31,_0x1817bd['id']),_0x416276[_0x1cd174(0x190)][_0x1cd174(0x1ec)](_0x75ce31,_0x1817bd['id']),_0x29422a[_0x1cd174(0x18e)]?.({'type':'embedded_activation_created','journeyName':_0x3cdb69[_0x1cd174(0x12e)][_0x1cd174(0x1b3)],'activationName':_0x75ce31});}const _0x566eb1=JSON[_0x1cd174(0x1ca)](JSON[_0x1cd174(0x1dc)](_0x5b9a7e));return _0x566eb1['id']=_0x4f5fa4,ensureJourneyDefaults(_0x566eb1[_0x1cd174(0x13d)]),resolvePendingIdsInRequest(_0x566eb1,_0x5b9a7e,_0x15756c,_0x3242e8,_0xdd6122,_0x29422a),await _0x5edc08[_0x1cd174(0x192)][_0x1cd174(0x1c6)](_0x4f5fa4,_0x566eb1),deletePushRecovery(_0x3cdb69['absolutePath']),{'action':_0x1cd174(0x12f),'journeyId':_0x4f5fa4,'embeddedSegmentNameToId':_0x3242e8};}export function stripWaitStepPendingIds(_0x51cfe9){const _0x5cf799=a136_0x440cdd,_0x39e0c7=_0x51cfe9[_0x5cf799(0x12a)]&&isPendingSegmentId(_0x51cfe9[_0x5cf799(0x12a)]),_0x269076=_0x51cfe9['conditions']?.[_0x5cf799(0x1a3)](_0x24b7fe=>_0x24b7fe['segmentId']&&isPendingSegmentId(_0x24b7fe['segmentId']));(_0x39e0c7||_0x269076)&&(_0x51cfe9[_0x5cf799(0x157)]=_0x5cf799(0x1cb),_0x51cfe9['waitStep']=0x1,_0x51cfe9[_0x5cf799(0x1ab)]=_0x5cf799(0x115),delete _0x51cfe9[_0x5cf799(0x12a)],delete _0x51cfe9['conditionTimeoutDuration'],delete _0x51cfe9[_0x5cf799(0x1e2)],delete _0x51cfe9['conditions']);}export function resolveWaitStepPendingIds(_0x2d71c1,_0x37c48e,_0x1af8f2,_0x5eed6d){const _0x3da1f9=a136_0x440cdd;if(_0x37c48e[_0x3da1f9(0x12a)]&&isPendingSegmentId(_0x37c48e[_0x3da1f9(0x12a)])){const _0x506075=_0x1af8f2(_0x37c48e[_0x3da1f9(0x12a)],_0x3da1f9(0x1f0)+_0x5eed6d+_0x3da1f9(0x1cf));_0x506075&&(_0x2d71c1[_0x3da1f9(0x157)]=_0x3da1f9(0x126),_0x2d71c1[_0x3da1f9(0x12a)]=_0x506075,delete _0x2d71c1[_0x3da1f9(0x171)],delete _0x2d71c1[_0x3da1f9(0x1ab)],_0x37c48e[_0x3da1f9(0x1c7)]!==undefined&&(_0x2d71c1[_0x3da1f9(0x1c7)]=_0x37c48e[_0x3da1f9(0x1c7)]),_0x37c48e['conditionTimeoutUnit']&&(_0x2d71c1['conditionTimeoutUnit']=_0x37c48e[_0x3da1f9(0x1e2)]));}if(_0x37c48e['conditions']){const _0x6b2f21=_0x37c48e['conditions'][_0x3da1f9(0x1a3)](_0x1942e1=>_0x1942e1[_0x3da1f9(0x1ea)]&&isPendingSegmentId(_0x1942e1[_0x3da1f9(0x1ea)]));if(_0x6b2f21){const _0x2ec54f=_0x37c48e[_0x3da1f9(0x121)]['map'](_0x12f373=>{const _0x1a58c1=_0x3da1f9;if(_0x12f373[_0x1a58c1(0x1ea)]&&isPendingSegmentId(_0x12f373[_0x1a58c1(0x1ea)])){const _0x305954=_0x1af8f2(_0x12f373[_0x1a58c1(0x1ea)],_0x1a58c1(0x1f0)+_0x5eed6d+_0x1a58c1(0x1cf));return{..._0x12f373,'segmentId':_0x305954||_0x12f373['segmentId']};}return{..._0x12f373};});_0x2d71c1[_0x3da1f9(0x157)]='Condition',_0x2d71c1[_0x3da1f9(0x121)]=_0x2ec54f,delete _0x2d71c1[_0x3da1f9(0x171)],delete _0x2d71c1[_0x3da1f9(0x1ab)],delete _0x2d71c1['conditionSegmentId'],delete _0x2d71c1[_0x3da1f9(0x1c7)],delete _0x2d71c1['conditionTimeoutUnit'];}}}function stripPendingIds(_0x19cd3a){const _0x1a3046=a136_0x440cdd;_0x19cd3a['attributes'][_0x1a3046(0x1e6)]?.['segmentId']&&isPendingSegmentId(_0x19cd3a['attributes'][_0x1a3046(0x1e6)][_0x1a3046(0x1ea)])&&delete _0x19cd3a[_0x1a3046(0x13d)][_0x1a3046(0x1e6)];for(const _0x1bb9b8 of _0x19cd3a['attributes'][_0x1a3046(0x194)]||[]){_0x1bb9b8[_0x1a3046(0x137)]?.[_0x1a3046(0x1ea)]&&isPendingSegmentId(_0x1bb9b8['entryCriteria'][_0x1a3046(0x1ea)])&&delete _0x1bb9b8[_0x1a3046(0x137)];_0x1bb9b8['milestone']?.[_0x1a3046(0x1ea)]&&isPendingSegmentId(_0x1bb9b8[_0x1a3046(0x154)][_0x1a3046(0x1ea)])&&delete _0x1bb9b8['milestone'];_0x1bb9b8[_0x1a3046(0x1b8)]&&(_0x1bb9b8[_0x1a3046(0x1b8)]=_0x1bb9b8[_0x1a3046(0x1b8)][_0x1a3046(0x10e)](_0x3a2f3c=>!_0x3a2f3c[_0x1a3046(0x1ea)]||!isPendingSegmentId(_0x3a2f3c['segmentId'])));if(_0x1bb9b8[_0x1a3046(0x1aa)])for(const _0x33afeb of Object['keys'](_0x1bb9b8[_0x1a3046(0x1aa)])){const _0x5933a5=_0x1bb9b8[_0x1a3046(0x1aa)][_0x33afeb];_0x5933a5[_0x1a3046(0x143)]===_0x1a3046(0x1b9)&&_0x5933a5[_0x1a3046(0x106)]&&isPendingActivationId(_0x5933a5[_0x1a3046(0x106)])&&(_0x5933a5['journeyActivationStepId']='');if(_0x5933a5[_0x1a3046(0x143)]===_0x1a3046(0x1de)&&_0x5933a5[_0x1a3046(0x144)])for(const _0x2152fd of _0x5933a5[_0x1a3046(0x144)]){_0x2152fd['segmentId']&&isPendingSegmentId(_0x2152fd[_0x1a3046(0x1ea)])&&(_0x2152fd[_0x1a3046(0x1ea)]='');}_0x5933a5[_0x1a3046(0x143)]==='WaitStep'&&stripWaitStepPendingIds(_0x5933a5);}}}function resolvePendingIdsInRequest(_0x21aef9,_0x526cb7,_0x1d35ca,_0x1e30f6,_0x2eb495,_0xbfbe9){const _0x22d187=a136_0x440cdd,_0x2fc884=(_0x2fd5b9,_0x4ef378)=>{const _0x43e435=a136_0x9a65;if(!isPendingSegmentId(_0x2fd5b9))return _0x2fd5b9;const _0x199ec8=extractPendingSegmentName(_0x2fd5b9),_0x3cf41c=_0x1e30f6[_0x43e435(0x142)](_0x199ec8);return!_0x3cf41c&&_0xbfbe9[_0x43e435(0xfb)]?.(_0x43e435(0x166)+_0x199ec8+_0x43e435(0x188)+_0x4ef378),_0x3cf41c;};if(_0x21aef9[_0x22d187(0x13d)]['goal']?.['segmentId']&&isPendingSegmentId(_0x21aef9[_0x22d187(0x13d)][_0x22d187(0x1e6)][_0x22d187(0x1ea)])){const _0x50c2dd=_0x2fc884(_0x21aef9[_0x22d187(0x13d)][_0x22d187(0x1e6)][_0x22d187(0x1ea)],'goal\x20criteria');_0x50c2dd&&(_0x21aef9[_0x22d187(0x13d)][_0x22d187(0x1e6)][_0x22d187(0x1ea)]=_0x50c2dd);}for(const _0x4aa1cf of _0x21aef9[_0x22d187(0x13d)][_0x22d187(0x194)]||[]){const _0x13d592=_0x1d35ca[_0x22d187(0x142)](_0x4aa1cf[_0x22d187(0x1b3)][_0x22d187(0x152)]());_0x13d592&&(_0x4aa1cf['id']=_0x13d592);if(_0x4aa1cf[_0x22d187(0x137)]?.[_0x22d187(0x1ea)]&&isPendingSegmentId(_0x4aa1cf[_0x22d187(0x137)]['segmentId'])){const _0x436649=_0x2fc884(_0x4aa1cf[_0x22d187(0x137)][_0x22d187(0x1ea)],'stage\x20\x27'+_0x4aa1cf['name']+_0x22d187(0x127));_0x436649&&(_0x4aa1cf[_0x22d187(0x137)]['segmentId']=_0x436649);}if(_0x4aa1cf[_0x22d187(0x1b8)])for(const _0x1f6489 of _0x4aa1cf[_0x22d187(0x1b8)]){if(_0x1f6489['segmentId']&&isPendingSegmentId(_0x1f6489[_0x22d187(0x1ea)])){const _0x2de956=_0x2fc884(_0x1f6489[_0x22d187(0x1ea)],_0x22d187(0x1f0)+_0x4aa1cf[_0x22d187(0x1b3)]+'\x27\x20exit\x20criteria');_0x2de956&&(_0x1f6489['segmentId']=_0x2de956);}}if(_0x4aa1cf[_0x22d187(0x154)]?.[_0x22d187(0x1ea)]&&isPendingSegmentId(_0x4aa1cf[_0x22d187(0x154)]['segmentId'])){const _0x4b0668=_0x2fc884(_0x4aa1cf['milestone']['segmentId'],_0x22d187(0x1f0)+_0x4aa1cf[_0x22d187(0x1b3)]+'\x27\x20milestone');_0x4b0668&&(_0x4aa1cf[_0x22d187(0x154)][_0x22d187(0x1ea)]=_0x4b0668);}if(_0x4aa1cf[_0x22d187(0x1aa)]){const _0x11cba4=_0x3eaaa0=>_0x526cb7[_0x22d187(0x13d)]['journeyStages']?.[_0x22d187(0x1e1)](_0x4d1df4=>_0x4d1df4[_0x22d187(0x1b3)]['toLowerCase']()===_0x4aa1cf['name'][_0x22d187(0x152)]())?.[_0x22d187(0x1aa)]?.[_0x3eaaa0];for(const _0x39523e of Object[_0x22d187(0x15a)](_0x4aa1cf[_0x22d187(0x1aa)])){const _0x1da0da=_0x4aa1cf['steps'][_0x39523e],_0x3f8b84=_0x11cba4(_0x39523e);if(_0x1da0da['type']===_0x22d187(0x1b9)&&_0x1da0da['journeyActivationStepId']&&(isPendingActivationId(_0x1da0da[_0x22d187(0x106)])||_0x1da0da[_0x22d187(0x106)]==='')){if(_0x3f8b84?.[_0x22d187(0x106)]&&isPendingActivationId(_0x3f8b84[_0x22d187(0x106)])){const _0x3965b3=extractPendingActivationName(_0x3f8b84[_0x22d187(0x106)]),_0x511d7c=_0x2eb495[_0x22d187(0x142)](_0x3965b3);_0x511d7c&&(_0x1da0da[_0x22d187(0x106)]=_0x511d7c);}}if(_0x1da0da[_0x22d187(0x143)]==='DecisionPoint'&&_0x1da0da['branches']&&_0x3f8b84?.[_0x22d187(0x144)])for(let _0x1f2fd7=0x0;_0x1f2fd7<_0x1da0da[_0x22d187(0x144)][_0x22d187(0x196)];_0x1f2fd7++){const _0x2848fa=_0x1da0da['branches'][_0x1f2fd7],_0x30838d=_0x3f8b84[_0x22d187(0x144)][_0x1f2fd7];if(_0x30838d?.[_0x22d187(0x1ea)]&&isPendingSegmentId(_0x30838d[_0x22d187(0x1ea)])){const _0x45480c=_0x2fc884(_0x30838d['segmentId'],_0x22d187(0x1f0)+_0x4aa1cf[_0x22d187(0x1b3)]+_0x22d187(0x187)+(_0x2848fa['name']||_0x1f2fd7)+'\x27');_0x45480c&&(_0x2848fa[_0x22d187(0x1ea)]=_0x45480c);}}_0x1da0da['type']===_0x22d187(0x174)&&_0x3f8b84?.[_0x22d187(0x143)]===_0x22d187(0x174)&&resolveWaitStepPendingIds(_0x1da0da,_0x3f8b84,_0x2fc884,_0x4aa1cf[_0x22d187(0x1b3)]);}}}}
|
|
1
|
+
const a136_0x2ce227=a136_0xc719;(function(_0x2b2407,_0x5e0878){const _0x228943=a136_0xc719,_0x40dbb4=_0x2b2407();while(!![]){try{const _0x3ea824=parseInt(_0x228943(0x14a))/0x1*(parseInt(_0x228943(0x180))/0x2)+parseInt(_0x228943(0x17e))/0x3+-parseInt(_0x228943(0x130))/0x4+-parseInt(_0x228943(0x136))/0x5*(-parseInt(_0x228943(0x1df))/0x6)+parseInt(_0x228943(0xf9))/0x7*(parseInt(_0x228943(0x1c3))/0x8)+parseInt(_0x228943(0x1e9))/0x9+-parseInt(_0x228943(0x182))/0xa;if(_0x3ea824===_0x5e0878)break;else _0x40dbb4['push'](_0x40dbb4['shift']());}catch(_0x2c6f39){_0x40dbb4['push'](_0x40dbb4['shift']());}}}(a136_0x539f,0xcb973));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a136_0x2ce227(0x1ad);export const PENDING_ACTIVATION_PREFIX=a136_0x2ce227(0x198);export function createPendingSegmentId(_0x46518a){return''+PENDING_SEGMENT_PREFIX+_0x46518a+'__';}export function isPendingSegmentId(_0xc79265){const _0x3cf161=a136_0x2ce227;return _0xc79265[_0x3cf161(0x1d9)](PENDING_SEGMENT_PREFIX)&&!_0xc79265[_0x3cf161(0x1d9)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x273c74){const _0x3e2801=a136_0x2ce227;return _0x273c74[_0x3e2801(0x1ab)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1527c1){return''+PENDING_ACTIVATION_PREFIX+_0x1527c1+'__';}export function isPendingActivationId(_0x1d4196){const _0x2e497b=a136_0x2ce227;return _0x1d4196[_0x2e497b(0x1d9)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x28b8b3){return _0x28b8b3['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x34a54a,_0x1fd811){const _0x852dc3=a136_0x2ce227,_0x555397=_0x34a54a+'::'+(_0x1fd811[_0x852dc3(0x176)]()||'segment'),_0x1649af=createHash(_0x852dc3(0x1dc))[_0x852dc3(0x10b)](_0x555397)[_0x852dc3(0xff)](_0x852dc3(0x147))[_0x852dc3(0x114)](0x0,0xc);return _0x852dc3(0x17f)+_0x1649af;}export function ensureJourneyDefaults(_0x59b666){const _0x120294=a136_0x2ce227;!_0x59b666[_0x120294(0x11a)]&&(_0x59b666[_0x120294(0x11a)]=''),!_0x59b666[_0x120294(0x11e)]&&(_0x59b666[_0x120294(0x11e)]=_0x120294(0x150));}export function injectExistingStageIds(_0x5de102,_0x7a4113){const _0x1b7501=a136_0x2ce227,_0x3b681e=new Map(_0x7a4113[_0x1b7501(0x11b)](_0x1a8807=>[_0x1a8807['name'],_0x1a8807['id']]));for(const _0x17ca66 of _0x5de102){if(!_0x17ca66['id']){const _0x483a51=_0x3b681e['get'](_0x17ca66[_0x1b7501(0x1d5)]);_0x483a51&&(_0x17ca66['id']=_0x483a51);}}}export function resolveTDFolderPath(_0x52af81,_0x385339,_0x46850e){const _0x26994b=a136_0x2ce227;if(!_0x385339)return _0x52af81;if(_0x52af81===_0x46850e||_0x52af81[_0x26994b(0x1d9)](_0x46850e+'/'))return _0x52af81;return _0x52af81?_0x46850e+'/'+_0x52af81:_0x46850e;}export function addFoldersToCreate(_0x184081,_0xae41b0,_0x36c12d){const _0x31ef79=a136_0x2ce227;if(!_0x184081)return;if(_0xae41b0[_0x31ef79(0x134)](_0x184081))return;const _0x1ac139=_0x184081[_0x31ef79(0xf7)]('/');let _0x1b82f1='';for(const _0xcaf323 of _0x1ac139){_0x1b82f1=_0x1b82f1?_0x1b82f1+'/'+_0xcaf323:_0xcaf323,!_0xae41b0['has'](_0x1b82f1)&&_0x36c12d[_0x31ef79(0x106)](_0x1b82f1);}}export function sortFoldersByDepth(_0x21849c){return[..._0x21849c]['sort']((_0x53119f,_0x4af002)=>{const _0x3de857=a136_0xc719,_0x1affe0=(_0x53119f[_0x3de857(0x144)](/\//g)||[])[_0x3de857(0x1a5)],_0x391140=(_0x4af002['match'](/\//g)||[])['length'];return _0x1affe0-_0x391140;});}import*as a136_0x5d975b from'yaml';import{readFileSync}from'fs';import a136_0x280e2f from'path';import{isJourneyDef,parseYamlString as a136_0xce43cc,toYamlString as a136_0x119d84,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(_0x4a4fe7){const _0x35775c=a136_0x2ce227;if(Array[_0x35775c(0x162)](_0x4a4fe7))return'['+_0x4a4fe7[_0x35775c(0x11b)](_0x2b43e=>stableStringify(_0x2b43e))[_0x35775c(0x158)](',')+']';if(_0x4a4fe7&&typeof _0x4a4fe7===_0x35775c(0x1a4)){const _0x3f8265=_0x4a4fe7,_0x520426=Object[_0x35775c(0x16a)](_0x3f8265)['sort'](),_0x2e3bb7=_0x520426[_0x35775c(0x11b)](_0x402856=>'\x22'+_0x402856+'\x22:'+stableStringify(_0x3f8265[_0x402856]));return'{'+_0x2e3bb7[_0x35775c(0x158)](',')+'}';}const _0x1c596b=JSON[_0x35775c(0x1d1)](_0x4a4fe7);return _0x1c596b===undefined?_0x35775c(0x177):_0x1c596b;}function activationSignature(_0x572b55){const _0x8ba5a2=a136_0x2ce227,_0x1e42cb={'connection':_0x572b55['connection'],..._0x572b55[_0x8ba5a2(0x154)]!==undefined&&{'all_columns':_0x572b55[_0x8ba5a2(0x154)]},..._0x572b55[_0x8ba5a2(0x1b4)]!==undefined&&{'columns':_0x572b55[_0x8ba5a2(0x1b4)]},..._0x572b55[_0x8ba5a2(0x19b)]!==undefined&&{'behavior':_0x572b55[_0x8ba5a2(0x19b)]},..._0x572b55[_0x8ba5a2(0x1f3)]!==undefined&&{'schedule':_0x572b55[_0x8ba5a2(0x1f3)]},..._0x572b55['notification']!==undefined&&{'notification':_0x572b55[_0x8ba5a2(0x131)]},..._0x572b55[_0x8ba5a2(0x187)]!==undefined&&{'connector_config':_0x572b55[_0x8ba5a2(0x187)]},..._0x572b55['activation_template_id']!==undefined&&{'activation_template_id':_0x572b55[_0x8ba5a2(0x14c)]}};return stableStringify(_0x1e42cb);}async function fetchSegment(_0x267c2c,_0x1bdbc1,_0x17d480,_0x2dd19f){const _0x13df03=a136_0x2ce227,_0x1e6e28=_0x2dd19f?.[_0x13df03(0xf8)](_0x33ca76=>_0x33ca76['id']===_0x17d480);if(_0x1e6e28)return _0x1e6e28;try{return await _0x267c2c['segment'][_0x13df03(0x1a3)](_0x1bdbc1,_0x17d480);}catch(_0x3fd154){logger[_0x13df03(0x1cc)](_0x13df03(0x1ec)+_0x17d480+_0x13df03(0x1b5)+_0x3fd154);try{return await _0x267c2c['segment'][_0x13df03(0x13c)](_0x17d480);}catch(_0x366cfd){return logger[_0x13df03(0x1cc)](_0x13df03(0x10e)+_0x17d480+':\x20'+_0x366cfd),null;}}}function recoverSegmentIdsFromPushRecovery(_0x425786,_0x119576,_0xbd8255){const _0x32ff5d=a136_0x2ce227,_0x10ee9d=readPushRecovery(_0x425786[_0x32ff5d(0x1bb)]);if(_0x10ee9d?.[_0x32ff5d(0x124)]===_0x425786[_0x32ff5d(0x1d3)]['name'])for(const [_0x414f46,_0x5104e6]of Object[_0x32ff5d(0x14d)](_0x10ee9d[_0x32ff5d(0x1f9)])){const _0x50d4e0=generateDeterministicJourneySegmentName(_0x425786[_0x32ff5d(0x1d3)][_0x32ff5d(0x1d5)],_0x414f46);_0x5104e6[_0x32ff5d(0x111)]===_0x50d4e0&&(_0x119576[_0x32ff5d(0x149)](_0x414f46,_0x5104e6[_0x32ff5d(0x17d)]),_0xbd8255[_0x32ff5d(0x149)](_0x414f46,_0x5104e6[_0x32ff5d(0x17d)]));}}async function createOrRecoverEmbeddedSegment(_0x133820,_0x13ade2,_0x580ad7,_0x433a30){const _0x360a43=a136_0x2ce227;let _0x1c3eda;try{_0x1c3eda=await _0x133820[_0x360a43(0x133)][_0x360a43(0x1b1)]({'name':_0x580ad7[_0x360a43(0x188)],'description':_0x580ad7[_0x360a43(0x11a)],'journeyId':_0x580ad7['journeyId'],'rule':_0x433a30(_0x580ad7[_0x360a43(0x17a)],!![]),'countPopulation':!![],'parentFolderId':_0x580ad7[_0x360a43(0x159)],'audienceId':_0x580ad7[_0x360a43(0x199)]});}catch(_0x53f91d){const _0x3b84b3=_0x53f91d instanceof Error&&_0x53f91d['message'][_0x360a43(0x1d2)](_0x360a43(0x113));if(_0x3b84b3){const _0x5c4d5d=readPushRecovery(_0x13ade2[_0x360a43(0x1bb)]),_0x2c6088=_0x5c4d5d?.['journeyName']===_0x13ade2[_0x360a43(0x1d3)][_0x360a43(0x1d5)]?_0x5c4d5d[_0x360a43(0x1f9)][_0x580ad7[_0x360a43(0x1ae)]]:undefined;if(_0x2c6088?.[_0x360a43(0x111)]===_0x580ad7[_0x360a43(0x188)])await _0x133820[_0x360a43(0x133)][_0x360a43(0x140)](_0x580ad7['parentId'],_0x2c6088[_0x360a43(0x17d)],{'description':_0x580ad7[_0x360a43(0x11a)],'rule':_0x433a30(_0x580ad7[_0x360a43(0x17a)],!![]),'countPopulation':!![]}),_0x1c3eda=_0x2c6088[_0x360a43(0x17d)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x360a43(0x151)+_0x580ad7[_0x360a43(0x1ae)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x360a43(0x104)+_0x13ade2[_0x360a43(0x1bb)]['replace'](/([^/]+)$/,_0x360a43(0x1ff))+')\x20')+_0x360a43(0x190),_0x53f91d);}else throw _0x53f91d;}return saveSegmentToPushRecovery(_0x13ade2['absolutePath'],_0x13ade2[_0x360a43(0x1d3)][_0x360a43(0x1d5)],_0x580ad7['localName'],{'segmentId':_0x1c3eda,'uniqueServerName':_0x580ad7[_0x360a43(0x188)],'createdAt':new Date()[_0x360a43(0x117)]()}),_0x1c3eda;}function a136_0xc719(_0x1be709,_0x3b18fc){_0x1be709=_0x1be709-0xf6;const _0x539f8d=a136_0x539f();let _0xc71918=_0x539f8d[_0x1be709];return _0xc71918;}export async function prepareSegmentFiles(_0x2870cc,_0x1c364d,_0x3e6d90,_0x1a0c75,_0x5e9fe8){const _0x34eecf=a136_0x2ce227,{activationDefToCreateRequest:_0x4c8f1e}=await import(_0x34eecf(0x1de)),_0x94dee5=[],_0x4bc269=new Set();for(const {yamlConfig:_0x4492c6,folderPath:_0x31dc46,sourcePath:_0x4c8264}of _0x2870cc){const _0x5934ed=resolveTDFolderPath(_0x31dc46,_0x1a0c75,_0x5e9fe8),_0x59d50c=_0x5934ed+':'+_0x4492c6[_0x34eecf(0x1d5)],_0x998cc9=_0x1c364d[_0x34eecf(0x15e)][_0x34eecf(0x102)](_0x59d50c),_0x46371c=_0x998cc9?_0x1c364d[_0x34eecf(0x185)][_0x34eecf(0x102)](_0x998cc9['id'])||[]:[];addFoldersToCreate(_0x5934ed,_0x1c364d[_0x34eecf(0x18d)],_0x4bc269);const _0x3807cd=calculateActivationActions(_0x4492c6[_0x34eecf(0xf6)]||[],_0x46371c,_0x1c364d['idToEmailMap'],_0x1c364d[_0x34eecf(0x1c2)]);for(const _0x19bae5 of _0x3807cd){(_0x19bae5['type']==='create'||_0x19bae5[_0x34eecf(0x1fe)]==='update')&&_0x19bae5[_0x34eecf(0x109)]&&(_0x19bae5[_0x34eecf(0x1fa)]=await _0x4c8f1e(_0x19bae5[_0x34eecf(0x109)],_0x3e6d90));}const _0xd28ef3=calculateSegmentDiff(_0x4492c6,_0x998cc9,_0x46371c,_0x1c364d['idToEmailMap'],_0x1c364d[_0x34eecf(0x1c2)]);_0x94dee5[_0x34eecf(0x1c9)]({'relativePath':_0x4492c6[_0x34eecf(0x1d5)],'absolutePath':_0x4c8264,'yamlConfig':_0x4492c6,'folderPath':_0x5934ed,'existingSegment':_0x998cc9,'existingActivations':_0x46371c,'isNew':_0xd28ef3[_0x34eecf(0x1b2)],'hasChanges':_0xd28ef3[_0x34eecf(0x1f1)],'diff':_0xd28ef3[_0x34eecf(0x184)],'activationActions':_0x3807cd});}return{'segmentFiles':_0x94dee5,'foldersToCreate':_0x4bc269};}export async function prepareJourneyFiles(_0x94427b,_0xd2db40,_0x418bba,_0x1f29cc){const _0x3ab859=a136_0x2ce227,_0x2499fb=[],_0x4a5dfc=new Set();for(const {yamlConfig:_0x31bea9,folderPath:_0x3677ed,sourcePath:_0x228d74}of _0x94427b){const _0x3310b2=resolveTDFolderPath(_0x3677ed,_0x418bba,_0x1f29cc),_0x357a80=_0x3310b2+':'+_0x31bea9['name'],_0x5c98e8=_0xd2db40[_0x3ab859(0x138)][_0x3ab859(0x102)](_0x357a80);let _0x224af8,_0x4bc7c7;if(_0x5c98e8&&_0x5c98e8[_0x3ab859(0x1a5)]>0x0){const _0x33cfbd=buildLocalExpandedRuleMappings(_0x31bea9),{createYamlContext:_0x35c84c,prefetchJourneySegments:_0x38c860}=createPushYamlContextForBundle(_0xd2db40[_0x3ab859(0x1c5)],_0xd2db40['parentId'],_0xd2db40['existingSegments'],_0x33cfbd,_0xd2db40['idToEmailMap'],_0xd2db40[_0x3ab859(0x1c2)],_0xd2db40[_0x3ab859(0x1a6)],_0xd2db40['journeyById']);await _0x38c860(_0x5c98e8[_0x3ab859(0x11b)](_0x2c70cd=>_0x2c70cd['id']));const _0x2e4340=await _0xd2db40[_0x3ab859(0x1c5)]['journey'][_0x3ab859(0x121)](_0x5c98e8[0x0][_0x3ab859(0x128)]),_0x130792=hasMultipleVersions(_0x31bea9),_0x5d97b2=async _0x56d62e=>{const _0x4ea84e=_0x3ab859,_0x483b35=_0xd2db40[_0x4ea84e(0x1f0)]?.[_0x4ea84e(0x102)](_0x56d62e);if(_0x483b35)return _0x483b35;return _0xd2db40[_0x4ea84e(0x172)]({'journeyId':_0x56d62e,'journeyName':_0x31bea9[_0x4ea84e(0x1d5)],'isMultiVersion':_0x5c98e8[_0x4ea84e(0x1a5)]>0x1});};if(_0x130792&&_0x5c98e8[_0x3ab859(0x1a5)]>0x1){const _0x184194=[];for(const _0x23d21a of _0x5c98e8){const _0x2c930c=_0x23d21a[_0x3ab859(0x16d)]||0x1;_0xd2db40['progress']?.['update'](_0x3ab859(0x1e0)+_0x31bea9['name']+'\x20v'+_0x2c930c);const _0xdf23a6=await _0x5d97b2(_0x23d21a['id']),_0x274035=_0x35c84c(_0x23d21a['id']),_0x5cc05a=await journeyResponseToDef(_0xdf23a6,_0x274035);_0x184194[_0x3ab859(0x1c9)]({'item':_0x23d21a,'yaml':_0x5cc05a});}const _0x4125d1=buildLocalRuleToNameMappingFromJourney(_0x31bea9);_0x4bc7c7=buildMergedJourneyDef(_0x184194,_0x4125d1,_0x2e4340);const _0x45aec2=Math[_0x3ab859(0x12a)](..._0x184194[_0x3ab859(0x11b)](_0x55244a=>_0x55244a['item'][_0x3ab859(0x16d)]||0x0)),_0x83b61b=_0x5c98e8[_0x3ab859(0xf8)](_0x2bac84=>(_0x2bac84[_0x3ab859(0x16d)]||0x0)===_0x45aec2);_0x83b61b&&(_0xd2db40['progress']?.[_0x3ab859(0x10b)](_0x3ab859(0x1e0)+_0x31bea9[_0x3ab859(0x1d5)]+'\x20v'+_0x45aec2),_0x224af8=await _0x5d97b2(_0x83b61b['id']));}else{const _0x2adecb=_0x5c98e8[_0x5c98e8[_0x3ab859(0x1a5)]-0x1];_0xd2db40['progress']?.[_0x3ab859(0x10b)](_0x3ab859(0x1e0)+_0x31bea9[_0x3ab859(0x1d5)]),_0x224af8=await _0x5d97b2(_0x2adecb['id']);const _0x13fa19=_0x35c84c(_0x2adecb['id']),_0x17441c=await journeyResponseToDef(_0x224af8,_0x13fa19),_0x27ed66=buildLocalRuleToNameMappingFromJourney(_0x31bea9);_0x4bc7c7=buildMergedJourneyDef([{'item':_0x2adecb,'yaml':_0x17441c}],_0x27ed66,_0x2e4340);}}addFoldersToCreate(_0x3310b2,_0xd2db40['folderPathToId'],_0x4a5dfc);const _0x1aed94=calculateJourneyDiff(_0x31bea9,_0x4bc7c7);_0x2499fb[_0x3ab859(0x1c9)]({'relativePath':_0x31bea9[_0x3ab859(0x1d5)],'absolutePath':_0x228d74,'yamlConfig':_0x31bea9,'folderPath':_0x3310b2,'existingJourney':_0x224af8,'isNew':_0x1aed94[_0x3ab859(0x1b2)],'hasChanges':_0x1aed94['hasChanges'],'diff':_0x1aed94[_0x3ab859(0x184)]});}return{'journeyFiles':_0x2499fb,'foldersToCreate':_0x4a5dfc};}export function calculateActivationActions(_0x472ef6,_0x588719,_0x393b25,_0x23c170){const _0x154552=a136_0x2ce227,_0x1849c3=[],_0x5eccfe=new Map();for(const _0x49a9d3 of _0x588719){_0x5eccfe[_0x154552(0x149)](_0x49a9d3[_0x154552(0x1d5)],_0x49a9d3);}const _0x49dd69=new Map();for(const _0x2dd34a of _0x472ef6){_0x49dd69[_0x154552(0x149)](_0x2dd34a[_0x154552(0x1d5)],_0x2dd34a);}for(const _0x35f9ef of _0x472ef6){const _0x224947=_0x5eccfe[_0x154552(0x102)](_0x35f9ef[_0x154552(0x1d5)]);if(!_0x224947)_0x1849c3[_0x154552(0x1c9)]({'type':_0x154552(0x1e7),'name':_0x35f9ef[_0x154552(0x1d5)],'yamlActivation':_0x35f9ef});else{const _0xc23a46=activationResponseToDef(_0x224947,_0x393b25,_0x23c170),_0x197c33=a136_0x5d975b[_0x154552(0x1d1)](_0xc23a46),_0x14ffe7=a136_0x5d975b[_0x154552(0x1d1)](_0x35f9ef);_0x197c33!==_0x14ffe7&&_0x1849c3[_0x154552(0x1c9)]({'type':'update','name':_0x35f9ef[_0x154552(0x1d5)],'yamlActivation':_0x35f9ef,'existingActivation':_0x224947});}}for(const _0x15bc23 of _0x588719){!_0x49dd69[_0x154552(0x134)](_0x15bc23[_0x154552(0x1d5)])&&_0x1849c3[_0x154552(0x1c9)]({'type':_0x154552(0xfc),'name':_0x15bc23['name'],'existingActivation':_0x15bc23});}return _0x1849c3;}function calculateYamlDiff(_0x335036,_0x5dd530){if(_0x5dd530){const _0x676a52=generateDiff(_0x5dd530,_0x335036),_0x5cfef9=hasChanges(_0x676a52);return{'isNew':![],'hasChanges':_0x5cfef9,'diff':_0x5cfef9?formatDiffWithColors(_0x676a52):undefined};}const _0x4143c4=generateDiff('',_0x335036);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4143c4)};}export function calculateSegmentDiff(_0x449f03,_0x4060a0,_0x2af4b3,_0x4f65e2,_0x4e22bd){const _0x1b9a18=segmentToYamlString(_0x449f03),_0x2d5efc=_0x4060a0?segmentToYamlString(segmentWithActivationsToYaml(_0x4060a0,_0x2af4b3,undefined,_0x4f65e2,_0x4e22bd)):undefined;return calculateYamlDiff(_0x1b9a18,_0x2d5efc);}export function calculateJourneyDiff(_0x5f5be7,_0x5ce893){const _0x32b118=normalizeJourneyDef(_0x5f5be7,_0x5f5be7),_0x4ce8d5=a136_0x119d84(_0x32b118),_0x3ac191=_0x5ce893?a136_0x119d84(normalizeJourneyDef(_0x5ce893,_0x5f5be7)):undefined;return calculateYamlDiff(_0x4ce8d5,_0x3ac191);}export function findSegmentsToDelete(_0x2f157a,_0x3f8220,_0x1045c7,_0x154135,_0x172737){const _0x15a10c=a136_0x2ce227,_0x5d58ce=new Set();for(const {yamlConfig:_0x11c00e,folderPath:_0x5aa35f}of _0x3f8220){_0x5d58ce[_0x15a10c(0x106)](_0x5aa35f+':'+_0x11c00e[_0x15a10c(0x1d5)]);}return _0x2f157a[_0x15a10c(0x1f8)](_0x164499=>{const _0x12ae7a=_0x15a10c,_0x40e09c=_0x164499[_0x12ae7a(0x105)]?_0x1045c7[_0x12ae7a(0x102)](_0x164499['segmentFolderId'][_0x12ae7a(0x1c0)]())||'':'',_0x4d9338=_0x40e09c+':'+_0x164499['name'];if(_0x5d58ce[_0x12ae7a(0x134)](_0x4d9338))return![];if(_0x172737)return _0x40e09c===_0x154135||_0x40e09c[_0x12ae7a(0x1d9)](_0x154135+'/');return!![];});}export function findJourneysToDelete(_0x4faa49,_0x298bde,_0x407c0b,_0x2304fb,_0x2344be){const _0xcc97d5=a136_0x2ce227,_0x136caa=new Set();for(const {yamlConfig:_0x368149,folderPath:_0x373db8}of _0x298bde){_0x136caa[_0xcc97d5(0x106)](_0x373db8+':'+_0x368149['name']);}return _0x4faa49[_0xcc97d5(0x1f8)](_0x5332ad=>{const _0x1f6390=_0xcc97d5,_0x3c89d8=_0x5332ad[_0x1f6390(0x159)]?_0x407c0b[_0x1f6390(0x102)](_0x5332ad[_0x1f6390(0x159)])||'':'',_0x147bbf=_0x3c89d8+':'+_0x5332ad[_0x1f6390(0x1a9)];if(_0x136caa[_0x1f6390(0x134)](_0x147bbf))return![];if(_0x2344be)return _0x3c89d8===_0x2304fb||_0x3c89d8['startsWith'](_0x2304fb+'/');return!![];});}export function buildSegmentLookupMap(_0x5bf307,_0x298fad){const _0x3292ae=a136_0x2ce227,_0x25c03b=new Map();for(const _0x34706e of _0x5bf307){const _0x5b353a=_0x34706e[_0x3292ae(0x105)]?_0x298fad[_0x3292ae(0x102)](_0x34706e[_0x3292ae(0x105)][_0x3292ae(0x1c0)]())||'':'',_0x53eeed=_0x5b353a+':'+_0x34706e[_0x3292ae(0x1d5)];_0x25c03b[_0x3292ae(0x149)](_0x53eeed,_0x34706e);}return _0x25c03b;}export function buildSegmentNameToIdMap(_0x444ca6){const _0x4fe959=new Map();for(const _0x1138ae of _0x444ca6){_0x4fe959['set'](_0x1138ae['name'],_0x1138ae['id']);}return _0x4fe959;}export function buildJourneyBundleLookupMap(_0x4a5823,_0x461c6d){const _0x2f17f0=a136_0x2ce227,_0xdb8ad8=new Map();for(const _0x13b067 of _0x4a5823){const _0x4bc4b6=_0x13b067[_0x2f17f0(0x159)]?_0x461c6d[_0x2f17f0(0x102)](_0x13b067[_0x2f17f0(0x159)])||'':'',_0x56390f=_0x4bc4b6+':'+_0x13b067[_0x2f17f0(0x1a9)];!_0xdb8ad8[_0x2f17f0(0x134)](_0x56390f)&&_0xdb8ad8[_0x2f17f0(0x149)](_0x56390f,[]),_0xdb8ad8['get'](_0x56390f)[_0x2f17f0(0x1c9)](_0x13b067);}for(const _0xbc5b02 of _0xdb8ad8[_0x2f17f0(0x1fb)]()){_0xbc5b02[_0x2f17f0(0x1b7)]((_0x40e051,_0x1ff750)=>(_0x40e051[_0x2f17f0(0x16d)]||0x0)-(_0x1ff750['versionNumber']||0x0));}return _0xdb8ad8;}export function collectFoldersToCreate(_0x1fc55e,_0x12fa5c){const _0x5cc9c4=a136_0x2ce227,_0x35334c=new Set();for(const _0x2add97 of _0x1fc55e){if(!_0x2add97)continue;if(_0x12fa5c['has'](_0x2add97))continue;const _0xab2ef1=_0x2add97[_0x5cc9c4(0xf7)]('/');let _0xbea43d='';for(const _0x4bf2b8 of _0xab2ef1){_0xbea43d=_0xbea43d?_0xbea43d+'/'+_0x4bf2b8:_0x4bf2b8,!_0x12fa5c[_0x5cc9c4(0x134)](_0xbea43d)&&_0x35334c[_0x5cc9c4(0x106)](_0xbea43d);}}return _0x35334c;}export function parseAndClassifyYamlFiles(_0x1ca242,_0x135ff1,_0x503c54){const _0x1f9235=a136_0x2ce227,_0x283792=[],_0x4cf18d=[];for(const _0x49846c of _0x1ca242){const _0x39555c=a136_0x280e2f['relative'](_0x135ff1,a136_0x280e2f[_0x1f9235(0x1b6)](_0x49846c)),_0x48c20f=_0x39555c==='.'?'':_0x39555c,_0x1f03c9=readFileSync(_0x49846c,_0x1f9235(0x1a0)),_0x343060=a136_0x5d975b['parse'](_0x1f03c9);if(isJourneyDef(_0x343060)){const _0x1f75c9=a136_0xce43cc(_0x1f03c9);_0x4cf18d[_0x1f9235(0x1c9)]({'yamlConfig':_0x1f75c9,'folderPath':_0x48c20f,'sourcePath':_0x49846c});}else{if(!_0x503c54?.[_0x1f9235(0x1ac)]){const _0xd96899=parseSegmentYamlFile(_0x1f03c9),_0x229b7c=normalizeChildSegmentYaml(_0xd96899);_0x283792[_0x1f9235(0x1c9)]({'yamlConfig':_0x229b7c,'folderPath':_0x48c20f,'sourcePath':_0x49846c});}}}return{'segments':_0x283792,'journeys':_0x4cf18d};}export function validateParsedFiles(_0x1a222e,_0x15db44){const _0x5c7725=a136_0x2ce227,_0x29e038=[];for(const {yamlConfig:_0x4b4af4,sourcePath:_0x3fa833}of _0x1a222e['segments']){const _0x12afa4=readFileSync(_0x3fa833,'utf-8'),_0x551f3b=a136_0x5d975b[_0x5c7725(0x19d)](_0x12afa4),_0x26032a=validateSegmentDef(_0x4b4af4,{'source':_0x12afa4,'document':_0x551f3b},{'skipSchema':!![]});if(!_0x26032a[_0x5c7725(0x1a7)]){const _0x5b14eb=a136_0x280e2f['relative'](_0x15db44,_0x3fa833);_0x29e038[_0x5c7725(0x1c9)]({'filePath':_0x5b14eb,'source':_0x12afa4,'result':_0x26032a,'isJourney':![]});}}for(const {yamlConfig:_0x51ff62,sourcePath:_0xfb9b82}of _0x1a222e[_0x5c7725(0x1cb)]){const _0x56a0f5=readFileSync(_0xfb9b82,_0x5c7725(0x1a0)),_0x1b3dba=a136_0x5d975b[_0x5c7725(0x19d)](_0x56a0f5),_0x9fd6cf=validateJourneyDef(_0x51ff62,{'source':_0x56a0f5,'document':_0x1b3dba},{'skipSchema':!![]});if(!_0x9fd6cf[_0x5c7725(0x1a7)]){const _0x5d4644=a136_0x280e2f['relative'](_0x15db44,_0xfb9b82);_0x29e038[_0x5c7725(0x1c9)]({'filePath':_0x5d4644,'source':_0x56a0f5,'result':_0x9fd6cf,'isJourney':!![]});}}return _0x29e038;}export function formatValidationErrors(_0x2431e5){const _0xc3ff50=a136_0x2ce227,_0x1f6fa3=[];for(const {filePath:_0x4521f4,source:_0x177d5e,result:_0xe4886b,isJourney:_0x58002a}of _0x2431e5){const _0x22264a=_0x58002a?_0xc3ff50(0x17c):_0xc3ff50(0x133);_0x1f6fa3[_0xc3ff50(0x1c9)]('\x0a'+_0x4521f4+'\x20('+_0x22264a+'):\x20'+_0xe4886b[_0xc3ff50(0x1d8)]['length']+'\x20error(s)'),_0x1f6fa3[_0xc3ff50(0x1c9)](formatValidationResult(_0xe4886b,_0x177d5e,_0x4521f4));}return _0x1f6fa3[_0xc3ff50(0x158)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x24db8e){const _0x2e3ed6=a136_0x2ce227,_0x4da325=new Set(),_0x38f3ff=new Map(),_0x57939e=collectSegmentUsageCounts(_0x24db8e);if(_0x24db8e['segments'])for(const [_0x4de946,_0xf33741]of Object['entries'](_0x24db8e[_0x2e3ed6(0x1f9)])){_0x4da325['add'](_0x4de946);if(_0xf33741['rule']){const _0x5dec57=yamlRuleToApi(_0xf33741[_0x2e3ed6(0x1b9)]),_0x1e67ff=apiRuleToYaml(_0x5dec57);_0x38f3ff[_0x2e3ed6(0x149)](_0x4de946,_0x1e67ff);}}const _0x2e8d38=new Map();let _0x55a668=0x0;for(const [_0x116917,_0x29a221]of _0x38f3ff){const _0x5b8f28=serializeExpandedRule(_0x29a221,_0x38f3ff),_0x2c58e2=_0x2e8d38[_0x2e3ed6(0x102)](_0x5b8f28)||[];_0x2c58e2[_0x2e3ed6(0x1c9)]({'name':_0x116917,'index':_0x55a668}),_0x2e8d38[_0x2e3ed6(0x149)](_0x5b8f28,_0x2c58e2),_0x55a668++;}const _0x241fc6=new Map();for(const [_0x34fa8b,_0x114512]of _0x2e8d38){const _0x1c7835=_0x114512['slice']()[_0x2e3ed6(0x1b7)]((_0x102e09,_0x1c6190)=>{const _0x5dd9a9=_0x2e3ed6,_0x5d3cfd=_0x57939e[_0x5dd9a9(0x102)](_0x102e09[_0x5dd9a9(0x1d5)])||0x0,_0x33a5bc=_0x57939e[_0x5dd9a9(0x102)](_0x1c6190[_0x5dd9a9(0x1d5)])||0x0;if(_0x5d3cfd!==_0x33a5bc)return _0x33a5bc-_0x5d3cfd;return _0x102e09['index']-_0x1c6190['index'];})[_0x2e3ed6(0x11b)](_0x97ac1b=>_0x97ac1b['name']),_0x2dfdcc=[];for(const _0x126fe0 of _0x1c7835){const _0x261c48=_0x57939e[_0x2e3ed6(0x102)](_0x126fe0)||0x0,_0x2b84f6=Math[_0x2e3ed6(0x12a)](_0x261c48,0x1);for(let _0x6518b9=0x0;_0x6518b9<_0x2b84f6;_0x6518b9++){_0x2dfdcc[_0x2e3ed6(0x1c9)](_0x126fe0);}}_0x241fc6[_0x2e3ed6(0x149)](_0x34fa8b,_0x2dfdcc);}return{'existingLocalSegmentNames':_0x4da325,'localSegmentRules':_0x38f3ff,'localExpandedRuleToNames':_0x241fc6};}export function createSegmentIdResolver(_0x35ee48,_0x1c8cb8){return async _0x22eaf9=>{const _0x25f23b=a136_0xc719,_0x27a293=_0x35ee48[_0x25f23b(0x102)](_0x22eaf9);if(!_0x27a293)throw new SDKError(ErrorCode[_0x25f23b(0x1eb)],_0x25f23b(0x1e6)+_0x22eaf9+_0x25f23b(0x166)+_0x1c8cb8+'\x27)');return _0x27a293;};}export function extractRootFolderId(_0x513ef2){const _0x16ecdf=a136_0x2ce227;return _0x513ef2['relationships']?.[_0x16ecdf(0x16f)]?.[_0x16ecdf(0x1bd)]?.['id']||_0x513ef2[_0x16ecdf(0x16b)]?.[_0x16ecdf(0x1e4)]?.[_0x16ecdf(0x1bd)]?.['id'];}export function buildConnectionMaps(_0x4a483c){const _0xad3ecd=a136_0x2ce227,_0x585d7d=new Map(),_0x2c72a8=new Map(),_0x30796d=new Map();for(const _0x48fb63 of _0x4a483c){_0x585d7d[_0xad3ecd(0x149)](_0x48fb63[_0xad3ecd(0x1d5)],parseInt(_0x48fb63['id'],0xa)),_0x2c72a8['set'](_0x48fb63['id'],_0x48fb63[_0xad3ecd(0x1d5)]),_0x30796d[_0xad3ecd(0x149)](_0x48fb63[_0xad3ecd(0x1d5)],_0x48fb63[_0xad3ecd(0x1fe)]);}return{'nameToId':_0x585d7d,'idToName':_0x2c72a8,'nameToType':_0x30796d};}export function calculatePushStats(_0xcc769b,_0x1f58cf,_0x238724,_0x57a189,_0x544dd3,_0x388585,_0x22c7e6){const _0xc5946c=a136_0x2ce227,_0x4d9596=_0xcc769b[_0xc5946c(0x1f8)](_0xbf847e=>_0xbf847e['isNew']),_0x1a14e3=_0xcc769b[_0xc5946c(0x1f8)](_0x36f431=>!_0x36f431['isNew']&&_0x36f431[_0xc5946c(0x1f1)]),_0x181653=_0xcc769b['filter'](_0x4205f3=>!_0x4205f3['isNew']&&!_0x4205f3['hasChanges']),_0x2e6f58=_0x388585?_0x57a189:[],_0x2223c1=_0x1f58cf[_0xc5946c(0x1f8)](_0x21f1a2=>_0x21f1a2['isNew']),_0x39fdfa=_0x1f58cf[_0xc5946c(0x1f8)](_0x190913=>!_0x190913[_0xc5946c(0x1b2)]&&_0x190913['hasChanges']),_0x1ad6b4=_0x1f58cf[_0xc5946c(0x1f8)](_0x450a6c=>!_0x450a6c[_0xc5946c(0x1b2)]&&!_0x450a6c['hasChanges']),_0x90add0=_0x388585?_0x544dd3:[],_0xf0e955=_0xcc769b[_0xc5946c(0x129)](_0x42a2db=>_0x42a2db['activationActions']),_0xa33a5a=_0xf0e955['filter'](_0x3a028f=>_0x3a028f[_0xc5946c(0x1fe)]===_0xc5946c(0x1e7)),_0x3cd929=_0xf0e955['filter'](_0x3c5d19=>_0x3c5d19[_0xc5946c(0x1fe)]==='update'),_0x5e4be8=_0xf0e955['filter'](_0x37f59d=>_0x37f59d[_0xc5946c(0x1fe)]===_0xc5946c(0xfc)),_0x45254f=Array[_0xc5946c(0x163)](_0x238724)[_0xc5946c(0x1b7)](),_0x9c389c=_0x22c7e6?![]:_0x4d9596[_0xc5946c(0x1a5)]>0x0||_0x1a14e3[_0xc5946c(0x1a5)]>0x0||_0x2e6f58[_0xc5946c(0x1a5)]>0x0,_0x50e3c6=_0x2223c1[_0xc5946c(0x1a5)]>0x0||_0x39fdfa[_0xc5946c(0x1a5)]>0x0||_0x90add0[_0xc5946c(0x1a5)]>0x0,_0x5aa6b2=_0x22c7e6?![]:_0xf0e955[_0xc5946c(0x1a5)]>0x0,_0x2c7ceb=_0x45254f[_0xc5946c(0x1a5)]>0x0;return{'segments':{'new':_0x4d9596,'changed':_0x1a14e3,'unchanged':_0x181653,'toDelete':_0x2e6f58},'journeys':{'new':_0x2223c1,'changed':_0x39fdfa,'unchanged':_0x1ad6b4,'toDelete':_0x90add0},'activations':{'all':_0xf0e955,'toCreate':_0xa33a5a,'toUpdate':_0x3cd929,'toDelete':_0x5e4be8},'folders':{'toCreate':_0x45254f},'counts':{'segments':{'new':_0x4d9596['length'],'changed':_0x1a14e3['length'],'unchanged':_0x181653[_0xc5946c(0x1a5)],'toDelete':_0x2e6f58[_0xc5946c(0x1a5)]},'journeys':{'new':_0x2223c1[_0xc5946c(0x1a5)],'changed':_0x39fdfa[_0xc5946c(0x1a5)],'unchanged':_0x1ad6b4['length'],'toDelete':_0x90add0[_0xc5946c(0x1a5)]},'activations':{'create':_0xa33a5a[_0xc5946c(0x1a5)],'update':_0x3cd929['length'],'delete':_0x5e4be8[_0xc5946c(0x1a5)]},'folders':_0x45254f[_0xc5946c(0x1a5)]},'hasChanges':_0x9c389c||_0x50e3c6||_0x5aa6b2||_0x2c7ceb};}export async function buildPushExecutionContext(_0x517c01,_0x40c9db,_0x409d47,_0x486489,_0x2bab57,_0x810434){const _0x48f472=a136_0x2ce227,_0x11bb45=extractRootFolderId(_0x409d47),{pathToId:_0x55e17c,idToPath:_0x592ddb}=buildFolderMaps(_0x2bab57),_0x1fba1c=buildSegmentNameToIdMap(_0x486489),_0x594193=new Map(),{batchAsync:_0x16e0e7}=await import(_0x48f472(0x132)),[_0x4c4d75,_0x5b8041]=await Promise[_0x48f472(0x1e3)]([_0x517c01['user'][_0x48f472(0x13d)](),_0x517c01[_0x48f472(0x146)][_0x48f472(0x137)](),((async()=>{const _0x4f672a=_0x48f472;!_0x810434&&_0x486489[_0x4f672a(0x1a5)]>0x0&&await _0x16e0e7(_0x486489,async _0x2c3469=>{const _0x56563e=_0x4f672a,_0x4ef73c=await _0x517c01[_0x56563e(0x133)][_0x56563e(0x116)](_0x40c9db,_0x2c3469['id']);_0x594193['set'](_0x2c3469['id'],_0x4ef73c);});})())]),{emailToId:_0x2fc9bc,idToEmail:_0x285a20}=_0x4c4d75,_0x54a45c=buildConnectionMaps(_0x5b8041);return{'rootFolderId':_0x11bb45,'folderPathToId':_0x55e17c,'folderIdToPath':_0x592ddb,'segmentNameToId':_0x1fba1c,'activationsBySegmentId':_0x594193,'emailToIdMap':_0x2fc9bc,'idToEmailMap':_0x285a20,'connectionNameToIdMap':_0x54a45c[_0x48f472(0x13f)],'connectionIdToNameMap':_0x54a45c[_0x48f472(0x15a)],'connectionNameToTypeMap':_0x54a45c[_0x48f472(0x126)]};}export function createPushYamlContextForBundle(_0x1c26eb,_0x3aa3ad,_0x14ad96,_0xef761a,_0x10fa2f,_0x333b1d,_0x579f0e,_0x3f485f){const {existingLocalSegmentNames:_0x2adf8b,localExpandedRuleToNames:_0x182fdd}=_0xef761a,_0x44f2c5=new Set(),_0x18d0c7=new Map(),_0x545930=new Map(),_0x3471db=new Map(),_0x48c2cd=createJumpTargetCache(),_0x56ae20=new Map(),_0x482278=new Map(),_0x5c7b29=new Set();let _0x40c0d8;const _0x1ee2d6=_0x3785fc=>{const _0x56999e={'resolveSegment':async _0xdef0d9=>{const _0x391a13=a136_0xc719,_0x58b4d6=_0x3471db[_0x391a13(0x102)](_0xdef0d9);if(_0x58b4d6!==undefined)return{'name':_0x58b4d6,'isJourneyLocal':!![]};try{const _0x3bef0d=await fetchSegment(_0x1c26eb,_0x3aa3ad,_0xdef0d9,_0x14ad96);if(!_0x3bef0d)throw new Error(_0x391a13(0x120));const _0x1e00d0=generateJourneyLocalName(_0x3bef0d[_0x391a13(0x1d5)]),_0x317f9b=_0x3bef0d['kind']===SEGMENT_KIND_JOURNEY&&_0x1e00d0!==undefined;let _0x48f53c=_0x3bef0d[_0x391a13(0x1d5)],_0x280100;if(_0x317f9b&&_0x3bef0d['rule']){const _0x3dffe9=apiRuleToYaml(_0x3bef0d['rule']);_0x482278[_0x391a13(0x149)](_0xdef0d9,_0x3dffe9);const _0x2b0cb9=async _0x4d58db=>{const _0x3e0ec7=_0x391a13,_0x5f0ea1=collectSegmentRefsFromRule(_0x4d58db);for(const _0x41c4cd of _0x5f0ea1){if(!_0x482278[_0x3e0ec7(0x134)](_0x41c4cd))try{const _0x27d91e=await fetchSegment(_0x1c26eb,_0x3aa3ad,_0x41c4cd,_0x14ad96);if(_0x27d91e?.[_0x3e0ec7(0x1b9)]){const _0x5ed70f=apiRuleToYaml(_0x27d91e[_0x3e0ec7(0x1b9)]);_0x482278['set'](_0x41c4cd,_0x5ed70f),await _0x2b0cb9(_0x5ed70f);}}catch(_0x154ca9){logger[_0x3e0ec7(0x1cc)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x41c4cd+':\x20'+_0x154ca9);}}};await _0x2b0cb9(_0x3dffe9);const _0x28027d=serializeExpandedRule(_0x3dffe9,_0x482278),_0x1e1826=_0x182fdd['get'](_0x28027d);if(_0x1e1826&&_0x1e1826['length']>0x0){const _0x2234ce=_0x18d0c7[_0x391a13(0x102)](_0x28027d)||0x0,_0x4d1d8c=_0x1e1826[_0x2234ce]||_0x1e1826[_0x1e1826[_0x391a13(0x1a5)]-0x1];_0x18d0c7['set'](_0x28027d,_0x2234ce+0x1),_0x48f53c=_0x4d1d8c,_0x44f2c5[_0x391a13(0x106)](_0x48f53c),_0x3471db[_0x391a13(0x149)](_0xdef0d9,_0x48f53c);const _0x44e75a=await resolveRuleSegmentRefs(_0x3dffe9,async _0x16720f=>{const _0x3cb451=_0x391a13,_0x244b1f=_0x3471db[_0x3cb451(0x102)](_0x16720f);if(_0x244b1f)return _0x244b1f;const _0x1868a4=await _0x40c0d8[_0x3cb451(0x13b)](_0x16720f);return _0x1868a4['name'];});_0x280100={'description':_0x3bef0d[_0x391a13(0x11a)],'rule':_0x44e75a};}else{const _0x1e5597=_0x56ae20[_0x391a13(0x102)](_0x28027d);if(_0x1e5597)_0x48f53c=_0x1e5597,_0x3471db[_0x391a13(0x149)](_0xdef0d9,_0x48f53c);else{if(_0x1e00d0){let _0x1f25c2=_0x1e00d0,_0x36e95e=0x2;while(_0x44f2c5[_0x391a13(0x134)](_0x1f25c2)||_0x2adf8b[_0x391a13(0x134)](_0x1f25c2)){_0x1f25c2=_0x1e00d0+'_'+_0x36e95e,_0x36e95e++;}_0x44f2c5[_0x391a13(0x106)](_0x1f25c2),_0x48f53c=_0x1f25c2;}_0x3471db['set'](_0xdef0d9,_0x48f53c),_0x56ae20[_0x391a13(0x149)](_0x28027d,_0x48f53c);const _0x33793c=await resolveRuleSegmentRefs(_0x3dffe9,async _0x399b77=>{const _0x221cd6=_0x3471db['get'](_0x399b77);if(_0x221cd6)return _0x221cd6;const _0x3d19ff=await _0x40c0d8['resolveSegment'](_0x399b77);return _0x3d19ff['name'];});_0x280100={'description':_0x3bef0d[_0x391a13(0x11a)],'rule':_0x33793c};}}}return{'name':_0x48f53c,'isJourneyLocal':_0x317f9b,'definition':_0x280100};}catch(_0x35cb59){return logger[_0x391a13(0x1cc)](_0x391a13(0x14b)+_0xdef0d9+':\x20'+_0x35cb59),{'name':_0xdef0d9,'isJourneyLocal':![]};}},'resolveActivation':async _0x6e5b16=>{const _0x3d9850=a136_0xc719,_0x348bc2=_0x545930['get'](_0x6e5b16);if(_0x348bc2!==undefined)return{'name':_0x348bc2,'isJourneyLocal':!![]};try{let _0xc5d10e=_0x579f0e?.['get'](_0x6e5b16);!_0xc5d10e&&(_0xc5d10e=await _0x1c26eb[_0x3d9850(0x17c)][_0x3d9850(0x108)](_0x3785fc,_0x6e5b16));const _0x3c6ce5=_0xc5d10e[_0x3d9850(0x178)][_0x3d9850(0x145)][_0x3d9850(0x1d5)]||_0x6e5b16,_0x5f4943=sanitizeYamlKey(_0x3c6ce5)||_0x3d9850(0x1a1)+_0x6e5b16,_0x53ccf0=_0x5f4943;_0x545930[_0x3d9850(0x149)](_0x6e5b16,_0x53ccf0);const _0x529873=journeyActivationStepToYaml(_0xc5d10e,_0x10fa2f,_0x333b1d);return{'name':_0x53ccf0,'isJourneyLocal':!![],'definition':_0x529873};}catch(_0x8f1111){return logger[_0x3d9850(0x1cc)](_0x3d9850(0x1aa)+_0x6e5b16+':\x20'+_0x8f1111),{'name':_0x6e5b16,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x339100,_0x5c210c)=>resolveJumpTarget(_0x339100,_0x5c210c,_0x48c2cd,async _0x3e704f=>{const _0x3d5db1=a136_0xc719,_0x2288cd=_0x3f485f?.['get'](_0x3e704f);if(_0x2288cd)return _0x2288cd;return _0x1c26eb[_0x3d5db1(0x17c)][_0x3d5db1(0x1da)](_0x3e704f);})};return _0x40c0d8=_0x56999e,_0x56999e;},_0x199c0f=async _0x620eff=>{const _0x2decec=a136_0xc719,{collectSegmentIdsFromJourneyApi:_0x56a311}=await import(_0x2decec(0x19e)),{batchAsync:_0x3895d4}=await import(_0x2decec(0x132)),_0x2da10f=new Set();for(const _0x288ad7 of _0x620eff){let _0x8a5f0e=_0x3f485f?.[_0x2decec(0x102)](_0x288ad7);!_0x8a5f0e&&(_0x8a5f0e=await _0x1c26eb[_0x2decec(0x17c)]['getJourney'](_0x288ad7));const _0x46b513=_0x56a311(_0x8a5f0e);for(const _0x236e47 of _0x46b513){_0x2da10f[_0x2decec(0x106)](_0x236e47);}}let _0x27c199=Array[_0x2decec(0x163)](_0x2da10f);while(_0x27c199[_0x2decec(0x1a5)]>0x0){const _0x4d2bd9=_0x27c199[_0x2decec(0x1f8)](_0x3dbd92=>!_0x5c7b29[_0x2decec(0x134)](_0x3dbd92));if(_0x4d2bd9['length']===0x0)break;const _0x210eac=await _0x3895d4(_0x4d2bd9,async _0x1fcd8d=>{_0x5c7b29['add'](_0x1fcd8d);const _0xb17f9b=await fetchSegment(_0x1c26eb,_0x3aa3ad,_0x1fcd8d,_0x14ad96);if(!_0xb17f9b)return null;return{'segmentId':_0x1fcd8d,'segment':_0xb17f9b};},0xa),_0x480b9d=new Set();for(const _0x241da9 of _0x210eac){if(!_0x241da9?.[_0x2decec(0x133)]?.['rule'])continue;const _0x42d35b=apiRuleToYaml(_0x241da9[_0x2decec(0x133)][_0x2decec(0x1b9)]);_0x482278[_0x2decec(0x149)](_0x241da9[_0x2decec(0x17d)],_0x42d35b);const _0x2e799e=collectSegmentRefsFromRule(_0x42d35b);for(const _0x7dcec5 of _0x2e799e){!_0x5c7b29[_0x2decec(0x134)](_0x7dcec5)&&_0x480b9d[_0x2decec(0x106)](_0x7dcec5);}}_0x27c199=Array[_0x2decec(0x163)](_0x480b9d);}};return{'createYamlContext':_0x1ee2d6,'prefetchJourneySegments':_0x199c0f};}export async function executePushSegments(_0x420c32,_0x37b9a8,_0x45ec37,_0x26ca2f,_0xce08df){const _0x4f80cc=a136_0x2ce227,{segmentDefToCreateRequest:_0x3d5964,segmentDefToUpdateRequest:_0x3b5294}=await import(_0x4f80cc(0x1de)),_0x41d5dd=_0x45ec37[_0x4f80cc(0x18d)],_0x23b267=0x5,_0x12c7e7=async _0x28b93d=>{const _0x562a2e=_0x4f80cc,_0x1c5b85=_0x28b93d[_0x562a2e(0x194)]?_0x41d5dd['get'](_0x28b93d[_0x562a2e(0x194)]):undefined;let _0x5e7a82;const _0x122023={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x91fede=_0x28b93d['yamlConfig'];if(_0x28b93d[_0x562a2e(0x1d3)][_0x562a2e(0x1b9)]){const _0x5d2908=createSegmentIdResolver(_0x45ec37[_0x562a2e(0x148)],_0x28b93d['yamlConfig'][_0x562a2e(0x1d5)]),_0x5ec740=await resolveRuleSegmentIds(_0x28b93d[_0x562a2e(0x1d3)][_0x562a2e(0x1b9)],_0x5d2908);_0x91fede={..._0x28b93d[_0x562a2e(0x1d3)],'rule':_0x5ec740};}try{if(_0x28b93d[_0x562a2e(0x1b2)]){_0xce08df[_0x562a2e(0x115)]?.({'type':'segment_creating','name':_0x28b93d[_0x562a2e(0x1d3)]['name']});const _0x41f64f=_0x3d5964(_0x91fede,_0x1c5b85),_0x2a5a24=await _0xce08df[_0x562a2e(0x1b0)](_0x562a2e(0x12d)+_0x28b93d['yamlConfig']['name']+_0x562a2e(0x107),()=>_0x420c32[_0x562a2e(0x133)][_0x562a2e(0x1bc)](_0x26ca2f[_0x562a2e(0x199)],_0x41f64f));_0x5e7a82=_0x2a5a24['data']['id'],_0x45ec37[_0x562a2e(0x148)]['set'](_0x28b93d['yamlConfig'][_0x562a2e(0x1d5)],_0x5e7a82),_0x122023[_0x562a2e(0x15d)]={'name':_0x28b93d[_0x562a2e(0x1d3)]['name'],'id':_0x5e7a82},_0xce08df['onProgress']?.({'type':_0x562a2e(0x139),'name':_0x28b93d[_0x562a2e(0x1d3)]['name'],'segmentId':_0x5e7a82}),_0xce08df[_0x562a2e(0x12c)]?.(_0x562a2e(0x103)+_0x28b93d[_0x562a2e(0x1d3)][_0x562a2e(0x1d5)]+'\x27'),_0x122023[_0x562a2e(0x14e)]=0x1;}else{if(_0x28b93d[_0x562a2e(0x1f1)]){_0xce08df['onProgress']?.({'type':_0x562a2e(0x112),'name':_0x28b93d[_0x562a2e(0x1d3)][_0x562a2e(0x1d5)]});const _0xb1ae67=_0x3b5294(_0x91fede);_0x1c5b85!==_0x28b93d['existingSegment']?.[_0x562a2e(0x105)]&&(_0xb1ae67[_0x562a2e(0x105)]=_0x1c5b85?parseInt(_0x1c5b85,0xa):undefined),await _0xce08df[_0x562a2e(0x1b0)](_0x562a2e(0x181)+_0x28b93d[_0x562a2e(0x1d3)][_0x562a2e(0x1d5)]+_0x562a2e(0x107),()=>_0x420c32[_0x562a2e(0x133)][_0x562a2e(0x140)](_0x26ca2f[_0x562a2e(0x199)],_0x28b93d[_0x562a2e(0x189)]['id'],_0xb1ae67)),_0x5e7a82=_0x28b93d[_0x562a2e(0x189)]['id'],_0xce08df[_0x562a2e(0x115)]?.({'type':_0x562a2e(0x164),'name':_0x28b93d[_0x562a2e(0x1d3)][_0x562a2e(0x1d5)]}),_0xce08df[_0x562a2e(0x12c)]?.(_0x562a2e(0x196)+_0x28b93d[_0x562a2e(0x1d3)][_0x562a2e(0x1d5)]+'\x27'),_0x122023[_0x562a2e(0x10a)]=0x1;}else _0x5e7a82=_0x28b93d[_0x562a2e(0x189)]['id'];}}catch(_0x5df3e0){const _0x1f2aaf=isHttp400Error(_0x5df3e0),_0x6a97e0=_0x1f2aaf?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x562a2e(0xfa)],_0x4258d2=getErrorMessage(_0x5df3e0);throw new SDKError(_0x6a97e0,_0x562a2e(0x18b)+(_0x28b93d['isNew']?_0x562a2e(0x1e7):'update')+_0x562a2e(0x18e)+_0x28b93d[_0x562a2e(0x1bb)]+_0x562a2e(0x1d0)+_0x4258d2,_0x5df3e0);}try{const _0x53f928=await syncActivationsForSegment(_0x420c32,_0x26ca2f[_0x562a2e(0x199)],_0x5e7a82,_0x28b93d[_0x562a2e(0x1d3)][_0x562a2e(0x1d5)],_0x28b93d['activationActions'],_0xce08df,_0x28b93d[_0x562a2e(0x1bb)]);_0x122023[_0x562a2e(0xf6)]=_0x53f928;}catch(_0xfd21bc){if(_0xfd21bc instanceof SDKError)throw _0xfd21bc;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x562a2e(0x16c)+_0x28b93d[_0x562a2e(0x1d3)]['name']+_0x562a2e(0x1cd)+_0x28b93d[_0x562a2e(0x1bb)]+'\x0a\x20\x20'+getErrorMessage(_0xfd21bc),_0xfd21bc);}return _0x122023;},_0x65a1c6=await batchAsync(_0x37b9a8,_0x12c7e7,_0x23b267),_0x26837a={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x36a3cf of _0x65a1c6){_0x26837a[_0x4f80cc(0x14e)]+=_0x36a3cf[_0x4f80cc(0x14e)],_0x26837a[_0x4f80cc(0x10a)]+=_0x36a3cf[_0x4f80cc(0x10a)],_0x36a3cf['createdSegmentId']&&_0x26837a[_0x4f80cc(0x155)][_0x4f80cc(0x149)](_0x36a3cf['createdSegmentId'][_0x4f80cc(0x1d5)],_0x36a3cf['createdSegmentId']['id']),_0x26837a[_0x4f80cc(0xf6)][_0x4f80cc(0x14e)]+=_0x36a3cf[_0x4f80cc(0xf6)]['created'],_0x26837a[_0x4f80cc(0xf6)][_0x4f80cc(0x10a)]+=_0x36a3cf[_0x4f80cc(0xf6)]['updated'],_0x26837a[_0x4f80cc(0xf6)][_0x4f80cc(0x1e2)]+=_0x36a3cf[_0x4f80cc(0xf6)][_0x4f80cc(0x1e2)];}return _0x26837a;}async function syncActivationsForSegment(_0x3507ca,_0xe2614d,_0x23142b,_0x43fc4f,_0x560314,_0x47379c,_0x246474){const _0x1d102e=a136_0x2ce227,_0x3fe7f2={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x51ffb0 of _0x560314){try{if(_0x51ffb0[_0x1d102e(0x1fe)]===_0x1d102e(0x1e7)&&_0x51ffb0[_0x1d102e(0x1fa)])_0x47379c[_0x1d102e(0x115)]?.({'type':_0x1d102e(0x119),'segmentName':_0x43fc4f,'activationName':_0x51ffb0[_0x1d102e(0x1d5)]}),await _0x47379c[_0x1d102e(0x1b0)](_0x1d102e(0xfd)+_0x51ffb0[_0x1d102e(0x1d5)]+_0x1d102e(0x107),()=>_0x3507ca[_0x1d102e(0x133)][_0x1d102e(0x1c6)](_0xe2614d,_0x23142b,_0x51ffb0['validatedRequest'])),_0x47379c['onProgress']?.({'type':_0x1d102e(0x10d),'segmentName':_0x43fc4f,'activationName':_0x51ffb0[_0x1d102e(0x1d5)]}),_0x47379c[_0x1d102e(0x12c)]?.('Created\x20activation\x20\x27'+_0x51ffb0[_0x1d102e(0x1d5)]+'\x27'),_0x3fe7f2[_0x1d102e(0x14e)]++;else{if(_0x51ffb0['type']==='update'&&_0x51ffb0[_0x1d102e(0x1fa)]&&_0x51ffb0[_0x1d102e(0x191)])_0x47379c[_0x1d102e(0x115)]?.({'type':_0x1d102e(0x1d4),'segmentName':_0x43fc4f,'activationName':_0x51ffb0['name']}),await _0x47379c[_0x1d102e(0x1b0)](_0x1d102e(0x15c)+_0x51ffb0['name']+_0x1d102e(0x107),()=>_0x3507ca[_0x1d102e(0x133)][_0x1d102e(0x179)](_0xe2614d,_0x23142b,_0x51ffb0[_0x1d102e(0x191)]['id'],_0x51ffb0['validatedRequest'])),_0x47379c['onProgress']?.({'type':'activation_updated','segmentName':_0x43fc4f,'activationName':_0x51ffb0[_0x1d102e(0x1d5)]}),_0x47379c['logSuccess']?.(_0x1d102e(0x125)+_0x51ffb0[_0x1d102e(0x1d5)]+'\x27'),_0x3fe7f2[_0x1d102e(0x10a)]++;else _0x51ffb0[_0x1d102e(0x1fe)]===_0x1d102e(0xfc)&&_0x51ffb0['existingActivation']&&(_0x47379c['onProgress']?.({'type':_0x1d102e(0x10c),'segmentName':_0x43fc4f,'activationName':_0x51ffb0[_0x1d102e(0x1d5)]}),await _0x47379c['withProgress'](_0x1d102e(0x11d)+_0x51ffb0[_0x1d102e(0x1d5)]+_0x1d102e(0x107),()=>_0x3507ca[_0x1d102e(0x133)][_0x1d102e(0x1dd)](_0xe2614d,_0x23142b,_0x51ffb0[_0x1d102e(0x191)]['id'])),_0x47379c[_0x1d102e(0x115)]?.({'type':_0x1d102e(0x157),'segmentName':_0x43fc4f,'activationName':_0x51ffb0[_0x1d102e(0x1d5)]}),_0x47379c[_0x1d102e(0x156)]?.(_0x1d102e(0x171)+_0x51ffb0[_0x1d102e(0x1d5)]+'\x27'),_0x3fe7f2[_0x1d102e(0x1e2)]++);}}catch(_0x4dc55b){const _0x199438=isHttp400Error(_0x4dc55b),_0x4c2c07=_0x199438?ErrorCode[_0x1d102e(0x1c8)]:ErrorCode[_0x1d102e(0x1ef)],_0xe13c6b=getErrorMessage(_0x4dc55b);throw new SDKError(_0x4c2c07,_0x1d102e(0x18b)+_0x51ffb0[_0x1d102e(0x1fe)]+'\x20activation\x20\x27'+_0x51ffb0[_0x1d102e(0x1d5)]+'\x27\x20from\x20file:\x20'+_0x246474+'\x0a\x20\x20'+_0xe13c6b,_0x4dc55b);}}return _0x3fe7f2;}export async function executePushFolders(_0x4f301b,_0x255fdf,_0x43ce76,_0x576825,_0x127d4b){const _0x126ad0=a136_0x2ce227,_0x2633b1=new Map(_0x43ce76),_0x5d211a=sortFoldersByDepth(_0x255fdf);for(const _0x1c64dd of _0x5d211a){const _0x126678=_0x1c64dd[_0x126ad0(0xf7)]('/'),_0x247404=_0x126678[_0x126678[_0x126ad0(0x1a5)]-0x1],_0x4deb5e=_0x126678[_0x126ad0(0x114)](0x0,-0x1)[_0x126ad0(0x158)]('/'),_0x139d6b=_0x2633b1[_0x126ad0(0x102)](_0x4deb5e);_0x127d4b[_0x126ad0(0x115)]?.({'type':'folder_creating','folder':_0x1c64dd});const _0x579dcf={'name':_0x247404,'parentFolderId':_0x139d6b},_0xb3ced6=await _0x127d4b[_0x126ad0(0x1b0)]('Creating\x20folder\x20\x27'+_0x1c64dd+_0x126ad0(0x107),()=>_0x4f301b[_0x126ad0(0x133)]['createFolder'](_0x576825[_0x126ad0(0x199)],_0x579dcf));_0x2633b1[_0x126ad0(0x149)](_0x1c64dd,_0xb3ced6[_0x126ad0(0x1bd)]['id']),_0x127d4b[_0x126ad0(0x115)]?.({'type':_0x126ad0(0x160),'folder':_0x1c64dd,'folderId':_0xb3ced6[_0x126ad0(0x1bd)]['id']}),_0x127d4b[_0x126ad0(0x122)]?.(_0x126ad0(0x1ea)+_0x1c64dd+'\x27');}return _0x2633b1;}export async function executePushSegmentDeletions(_0x2b825c,_0x140a9d,_0x256c7e){const _0x5e450f=a136_0x2ce227;if(_0x140a9d[_0x5e450f(0x1a5)]===0x0)return 0x0;const {batchAsync:_0x3323ab}=await import(_0x5e450f(0x132)),_0xf504f2=0x5,_0x24a45b=await _0x3323ab(_0x140a9d,async _0x37eafc=>{const _0x528682=_0x5e450f;return _0x256c7e[_0x528682(0x115)]?.({'type':_0x528682(0x1f4),'name':_0x37eafc[_0x528682(0x1d5)]}),await _0x2b825c['segment'][_0x528682(0x13a)](_0x37eafc['id']),_0x256c7e[_0x528682(0x115)]?.({'type':_0x528682(0x1a8),'name':_0x37eafc['name']}),_0x256c7e[_0x528682(0x156)]?.('Deleted\x20segment\x20\x27'+_0x37eafc['name']+'\x27'),0x1;},_0xf504f2);return _0x24a45b[_0x5e450f(0x141)]((_0xf7ed50,_0x396418)=>_0xf7ed50+_0x396418,0x0);}export async function executePushJourneys(_0x4f7fcf,_0x2c74dc,_0x119a4f,_0x135ab8,_0x243859){const _0x14bb8f=a136_0x2ce227,{journeyDefToRequest:_0x582a8f}=await import(_0x14bb8f(0x19e)),{activationDefToCreateRequest:_0x180ee0,yamlRuleToApi:_0x3868b9,validateSegmentRule:_0x317ddd}=await import(_0x14bb8f(0x1de)),_0x2cbaef={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x83264a=new Map(_0x119a4f[_0x14bb8f(0x148)]),_0x396987=0x5;for(let _0x92eb74=0x0;_0x92eb74<_0x2c74dc['length'];_0x92eb74+=_0x396987){const _0x1abe17=_0x2c74dc[_0x14bb8f(0x114)](_0x92eb74,_0x92eb74+_0x396987),_0x2fd070=await Promise[_0x14bb8f(0x1e3)](_0x1abe17['map'](async _0x9f8178=>{const _0x1863ee=_0x14bb8f;if(!_0x9f8178['isNew']&&!_0x9f8178[_0x1863ee(0x1f1)])return{'action':_0x1863ee(0x1f2),'name':_0x9f8178[_0x1863ee(0x1d3)][_0x1863ee(0x1d5)],'journeyId':_0x9f8178[_0x1863ee(0x195)]?.['id']};const _0xd9e699=_0x9f8178[_0x1863ee(0x194)]?_0x119a4f['folderPathToId'][_0x1863ee(0x102)](_0x9f8178[_0x1863ee(0x194)]):undefined;_0x243859[_0x1863ee(0x115)]?.({'type':_0x9f8178['isNew']?_0x1863ee(0x152):'journey_updating','name':_0x9f8178[_0x1863ee(0x1d3)][_0x1863ee(0x1d5)]});try{const _0x1729cb=await executeSingleJourneyPush(_0x4f7fcf,_0x9f8178,{..._0x119a4f,'segmentNameToId':_0x83264a},{'parentId':_0x135ab8['parentId'],'rootFolderId':_0x135ab8[_0x1863ee(0x1fc)],'folderId':_0xd9e699,'verbose':_0x135ab8[_0x1863ee(0x12b)]},_0x243859,{'journeyDefToRequest':_0x582a8f,'activationDefToCreateRequest':_0x180ee0,'yamlRuleToApi':_0x3868b9,'validateSegmentRule':_0x317ddd});for(const [_0x498d51,_0x5d1bf8]of _0x1729cb[_0x1863ee(0x19f)]){_0x83264a[_0x1863ee(0x149)](_0x498d51,_0x5d1bf8),_0x2cbaef[_0x1863ee(0x19f)][_0x1863ee(0x149)](_0x498d51,_0x5d1bf8);}if(_0x1729cb[_0x1863ee(0x1e8)]===_0x1863ee(0x14e))_0x243859['onProgress']?.({'type':'journey_created','name':_0x9f8178['yamlConfig'][_0x1863ee(0x1d5)],'journeyId':_0x1729cb[_0x1863ee(0x1ed)]}),_0x243859[_0x1863ee(0x12c)]?.(_0x1863ee(0x173)+_0x9f8178[_0x1863ee(0x1d3)]['name']+'\x27'),_0x2cbaef[_0x1863ee(0x14e)]++;else _0x1729cb[_0x1863ee(0x1e8)]===_0x1863ee(0x10a)&&(_0x243859['onProgress']?.({'type':'journey_updated','name':_0x9f8178['yamlConfig'][_0x1863ee(0x1d5)]}),_0x243859[_0x1863ee(0x12c)]?.(_0x1863ee(0x186)+_0x9f8178[_0x1863ee(0x1d3)][_0x1863ee(0x1d5)]+'\x27'),_0x2cbaef[_0x1863ee(0x10a)]++);return{'action':_0x1729cb[_0x1863ee(0x1e8)],'name':_0x9f8178[_0x1863ee(0x1d3)][_0x1863ee(0x1d5)],'journeyId':_0x1729cb['journeyId']};}catch(_0x9773e4){const _0x160783=isHttp400Error(_0x9773e4),_0x5c31e6=_0x160783?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x1863ee(0x13e)],_0x1cbb36=getErrorMessage(_0x9773e4);throw new SDKError(_0x5c31e6,_0x1863ee(0x18b)+(_0x9f8178['isNew']?_0x1863ee(0x1e7):'update')+_0x1863ee(0xfb)+_0x9f8178[_0x1863ee(0x1bb)]+_0x1863ee(0x1d0)+_0x1cbb36,_0x9773e4);}}));_0x2cbaef[_0x14bb8f(0x193)][_0x14bb8f(0x1c9)](..._0x2fd070);}return _0x2cbaef;}async function matchExistingJourneySegments(_0x5b69b0,_0x13cbcc,_0x5f4d25,_0x2113b5,_0xc084d6){const _0x309f13=a136_0x2ce227;if(!_0x13cbcc['existingJourney']||!_0x13cbcc[_0x309f13(0x1d3)][_0x309f13(0x1f9)])return;const _0x3bf3e0=new Map(),_0xe736f3=new Set();for(const _0x9f755 of Object[_0x309f13(0x16a)](_0x13cbcc[_0x309f13(0x1d3)]['segments'])){const _0x4d58e3=generateDeterministicJourneySegmentName(_0x13cbcc[_0x309f13(0x1d3)][_0x309f13(0x1d5)],_0x9f755);_0x3bf3e0['set'](_0x4d58e3,_0x9f755),_0xe736f3[_0x309f13(0x106)](_0x9f755);}const _0x5bdbc2=[],_0x2d2266=collectSegmentIdsFromJourneyApi(_0x13cbcc[_0x309f13(0x195)]);for(const _0x3cdac4 of _0x2d2266){const _0x496d96=await fetchSegment(_0x5b69b0,_0x5f4d25,_0x3cdac4,_0x2113b5);if(!_0x496d96?.[_0x309f13(0x1d5)])continue;const _0x58061c=_0x3bf3e0[_0x309f13(0x102)](_0x496d96[_0x309f13(0x1d5)]);_0x58061c?(_0xc084d6['set'](_0x58061c,_0x3cdac4),_0xe736f3[_0x309f13(0xfc)](_0x58061c)):_0x5bdbc2[_0x309f13(0x1c9)]({'id':_0x3cdac4,'seg':_0x496d96});}if(_0xe736f3['size']>0x0&&_0x5bdbc2[_0x309f13(0x1a5)]>0x0){const {localExpandedRuleToNames:_0x191023}=buildLocalExpandedRuleMappings(_0x13cbcc[_0x309f13(0x1d3)]),_0x3170e6=new Map();for(const {id:_0x53d743,seg:_0x274c21}of _0x5bdbc2){if(_0x274c21[_0x309f13(0x1b9)]){const _0x85a6ae=apiRuleToYaml(_0x274c21['rule']);_0x3170e6[_0x309f13(0x149)](_0x53d743,_0x85a6ae);}}for(const {id:_0x51e986,seg:_0x129cf4}of _0x5bdbc2){if(!_0x129cf4['rule'])continue;const _0x4d546f=_0x3170e6[_0x309f13(0x102)](_0x51e986);if(!_0x4d546f)continue;const _0x8bc727=serializeExpandedRule(_0x4d546f,_0x3170e6),_0x5e59f0=_0x191023[_0x309f13(0x102)](_0x8bc727);if(_0x5e59f0){const _0xe3450c=_0x5e59f0[_0x309f13(0xf8)](_0x5d9dca=>_0xe736f3[_0x309f13(0x134)](_0x5d9dca));_0xe3450c&&(_0xc084d6[_0x309f13(0x149)](_0xe3450c,_0x51e986),_0xe736f3[_0x309f13(0xfc)](_0xe3450c),logger[_0x309f13(0x1cc)](_0x309f13(0x1d7)+_0x129cf4['name']+_0x309f13(0x153)+_0xe3450c+_0x309f13(0x1af)));}}}}async function executeSingleJourneyPush(_0x3d9e3a,_0x1747f5,_0x189800,_0x20097a,_0x24d329,_0x3315c7){const _0x4ef5f3=a136_0x2ce227,{journeyDefToRequest:_0x560fb5,activationDefToCreateRequest:_0x2ef5c8,yamlRuleToApi:_0x31d623,validateSegmentRule:_0x53c842}=_0x3315c7,_0x119436=new Map(),_0x2e112a=new Map();recoverSegmentIdsFromPushRecovery(_0x1747f5,_0x119436,_0x189800[_0x4ef5f3(0x148)]);const _0x373b1a=new Map(),_0xd2a41=new Map(),_0x26d7c8=new Map();let _0x479ebc;const _0x46dc01=async()=>{const _0x23a389=_0x4ef5f3;if(_0x479ebc)return;_0x479ebc=new Map();if(!_0x1747f5['existingJourney'])return;const _0x2cc911=await _0x3d9e3a[_0x23a389(0x17c)][_0x23a389(0x116)](_0x1747f5[_0x23a389(0x195)]['id']);for(const _0x2a6556 of _0x2cc911){const _0x231330=journeyActivationStepToYaml(_0x2a6556,_0x189800[_0x23a389(0x18a)],_0x189800[_0x23a389(0x1c2)]),_0x5c263c=activationSignature(_0x231330);!_0x479ebc[_0x23a389(0x134)](_0x5c263c)&&_0x479ebc[_0x23a389(0x149)](_0x5c263c,_0x2a6556['id']),_0x231330[_0x23a389(0x1d5)]&&_0x2e112a[_0x23a389(0x149)](_0x231330[_0x23a389(0x1d5)],_0x2a6556['id']);}};await matchExistingJourneySegments(_0x3d9e3a,_0x1747f5,_0x20097a[_0x4ef5f3(0x199)],_0x189800[_0x4ef5f3(0x174)],_0x189800[_0x4ef5f3(0x148)]);const _0x48b187={'resolveSegmentId':async _0x27d90e=>{const _0x17ab0b=_0x4ef5f3,_0x28f1f3=_0x189800[_0x17ab0b(0x148)][_0x17ab0b(0x102)](_0x27d90e);if(!_0x28f1f3)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x17ab0b(0x1e6)+_0x27d90e+'\x20(referenced\x20in\x20journey\x20'+_0x1747f5[_0x17ab0b(0x1d3)][_0x17ab0b(0x1d5)]+')');return _0x28f1f3;},'resolveEmbeddedSegmentId':async(_0x3a7626,_0x3aa7fc)=>{const _0x4c3343=_0x4ef5f3,_0x5d5fb8=_0x189800[_0x4c3343(0x148)][_0x4c3343(0x102)](_0x3a7626);if(_0x5d5fb8)return _0x5d5fb8;const _0x184a13=_0x189800[_0x4c3343(0x174)][_0x4c3343(0xf8)](_0xde769b=>_0xde769b['name']===_0x3a7626);if(_0x184a13)return _0x189800[_0x4c3343(0x148)][_0x4c3343(0x149)](_0x3a7626,_0x184a13['id']),_0x184a13['id'];if(_0x1747f5['isNew']){const {stageName:_0x35f60b,criteriaName:_0x8eb3be}=findSegmentCriteriaLocation(_0x1747f5[_0x4c3343(0x1d3)],_0x3a7626);return _0x53c842(_0x3a7626,_0x3aa7fc[_0x4c3343(0x1b9)]),_0xd2a41['set'](_0x3a7626,{'definition':_0x3aa7fc,'stageName':_0x35f60b,'criteriaName':_0x8eb3be}),createPendingSegmentId(_0x3a7626);}const _0x4697c2=_0x1747f5[_0x4c3343(0x195)]?.['id'];if(!_0x4697c2)throw new SDKError(ErrorCode[_0x4c3343(0x1f5)],_0x4c3343(0x1ce));const _0x274a32=_0x373b1a[_0x4c3343(0x102)](_0x3a7626);if(_0x274a32)return _0x274a32;const _0x5df70b=((async()=>{const _0x28db20=_0x4c3343;_0x53c842(_0x3a7626,_0x3aa7fc[_0x28db20(0x1b9)]);const _0x382d7f=generateDeterministicJourneySegmentName(_0x1747f5[_0x28db20(0x1d3)][_0x28db20(0x1d5)],_0x3a7626),_0x4cac60=_0x189800['existingSegments'][_0x28db20(0xf8)](_0x20a112=>_0x20a112[_0x28db20(0x1d5)]===_0x382d7f),_0x2e264c=createSegmentIdResolver(_0x189800['segmentNameToId'],_0x3a7626),_0xc6b465=await resolveRuleSegmentIds(_0x3aa7fc[_0x28db20(0x1b9)],_0x2e264c);let _0x495e99;return _0x4cac60?(await _0x3d9e3a[_0x28db20(0x133)][_0x28db20(0x140)](_0x20097a[_0x28db20(0x199)],_0x4cac60['id'],{'description':_0x3aa7fc[_0x28db20(0x11a)]||'Entry\x20criteria:\x20'+_0x3a7626,'rule':_0x31d623(_0xc6b465,!![]),'countPopulation':!![]}),_0x495e99=_0x4cac60['id'],saveSegmentToPushRecovery(_0x1747f5['absolutePath'],_0x1747f5[_0x28db20(0x1d3)][_0x28db20(0x1d5)],_0x3a7626,{'segmentId':_0x495e99,'uniqueServerName':_0x382d7f,'createdAt':new Date()[_0x28db20(0x117)]()})):_0x495e99=await createOrRecoverEmbeddedSegment(_0x3d9e3a,_0x1747f5,{'localName':_0x3a7626,'uniqueSegmentName':_0x382d7f,'description':_0x3aa7fc[_0x28db20(0x11a)]||_0x28db20(0x183)+_0x3a7626,'journeyId':_0x4697c2,'resolvedRule':_0xc6b465,'parentId':_0x20097a[_0x28db20(0x199)],'folderId':_0x20097a['rootFolderId']||''},_0x31d623),_0x189800[_0x28db20(0x148)][_0x28db20(0x149)](_0x3a7626,_0x495e99),_0x119436[_0x28db20(0x149)](_0x3a7626,_0x495e99),_0x495e99;})());_0x373b1a['set'](_0x3a7626,_0x5df70b);try{return await _0x5df70b;}finally{_0x373b1a[_0x4c3343(0xfc)](_0x3a7626);}},'resolveActivationId':async _0x6aaebf=>{const _0xcc6ba3=_0x4ef5f3,_0x3c17ec=_0x2e112a[_0xcc6ba3(0x102)](_0x6aaebf);if(_0x3c17ec)return _0x3c17ec;if(_0x1747f5[_0xcc6ba3(0x195)]){await _0x46dc01();const _0x40889e=_0x2e112a[_0xcc6ba3(0x102)](_0x6aaebf);if(_0x40889e)return _0x40889e;}throw new SDKError(ErrorCode[_0xcc6ba3(0x1cf)],_0xcc6ba3(0x17b)+_0x6aaebf+_0xcc6ba3(0x192)+_0x1747f5['yamlConfig']['name']+_0xcc6ba3(0x165)+_0xcc6ba3(0x1db));},'resolveEmbeddedActivationId':async(_0x2dc46e,_0x28ea4a)=>{const _0x49aa83=_0x4ef5f3,_0x2e03fd=_0x2e112a[_0x49aa83(0x102)](_0x2dc46e);if(_0x2e03fd)return _0x2e03fd;if(_0x1747f5[_0x49aa83(0x1b2)])return _0x26d7c8[_0x49aa83(0x149)](_0x2dc46e,_0x28ea4a),createPendingActivationId(_0x2dc46e);if(_0x1747f5[_0x49aa83(0x195)]){await _0x46dc01();const _0x523aad=_0x2e112a['get'](_0x28ea4a[_0x49aa83(0x1d5)]);if(_0x523aad)return _0x2e112a[_0x49aa83(0x149)](_0x2dc46e,_0x523aad),_0x523aad;const _0x41bebd=activationSignature(_0x28ea4a),_0x5eefad=_0x479ebc?.[_0x49aa83(0x102)](_0x41bebd);if(_0x5eefad)return _0x2e112a[_0x49aa83(0x149)](_0x2dc46e,_0x5eefad),_0x5eefad;const _0x55ca98=await _0x2ef5c8(_0x28ea4a,_0x189800[_0x49aa83(0x15f)]),_0x59663b={..._0x55ca98,..._0x28ea4a[_0x49aa83(0x127)]!==undefined&&{'runAfterJourneyRefresh':_0x28ea4a[_0x49aa83(0x127)]}},_0xbed84d=await _0x3d9e3a[_0x49aa83(0x17c)][_0x49aa83(0x1c6)](_0x1747f5[_0x49aa83(0x195)]['id'],_0x59663b);return _0x2e112a['set'](_0x2dc46e,_0xbed84d['id']),_0xbed84d['id'];}throw new SDKError(ErrorCode[_0x49aa83(0x1f5)],_0x49aa83(0x12f));},'resolveJourneyId':async _0x3f47b5=>{const _0x3c2bea=_0x4ef5f3;try{return await _0x3d9e3a[_0x3c2bea(0x17c)][_0x3c2bea(0x118)](_0x20097a[_0x3c2bea(0x199)],_0x3f47b5);}catch(_0x3687d2){throw new SDKError(ErrorCode[_0x3c2bea(0x1cf)],_0x3c2bea(0x1c4)+_0x3f47b5+_0x3c2bea(0x110)+_0x1747f5[_0x3c2bea(0x1d3)][_0x3c2bea(0x1d5)]+'\x27)',_0x3687d2);}},'resolveStageId':async(_0x59e9f7,_0x3fc2fd)=>{const _0xa3123=_0x4ef5f3,_0x3e188b=await _0x3d9e3a['journey'][_0xa3123(0x1da)](_0x59e9f7),_0x9d8cc9=_0x3e188b[_0xa3123(0x178)][_0xa3123(0x161)]['find'](_0x2511be=>_0x2511be[_0xa3123(0x1d5)][_0xa3123(0x100)]()===_0x3fc2fd[_0xa3123(0x100)]());if(!_0x9d8cc9?.['id'])throw new SDKError(ErrorCode[_0xa3123(0x1cf)],_0xa3123(0x1e1)+_0x3fc2fd+_0xa3123(0x1b8)+(_0x3e188b[_0xa3123(0x178)]['journeyBundleName']||_0x3e188b[_0xa3123(0x178)][_0xa3123(0x1d5)])+'\x27');return _0x9d8cc9['id'];}},_0x3d50da=await _0x560fb5(_0x1747f5[_0x4ef5f3(0x1d3)],_0x20097a[_0x4ef5f3(0x199)],_0x48b187),_0x5a4c2d=_0x20097a[_0x4ef5f3(0x159)]||_0x20097a['rootFolderId'];_0x5a4c2d&&(_0x3d50da['relationships']={'parentFolder':{'data':{'id':_0x5a4c2d,'type':_0x4ef5f3(0x170)}}});if(_0x1747f5[_0x4ef5f3(0x1b2)]){if(_0xd2a41[_0x4ef5f3(0x1ba)]>0x0||_0x26d7c8[_0x4ef5f3(0x1ba)]>0x0)return await executeThreeStepJourneyCreate(_0x3d9e3a,_0x1747f5,_0x3d50da,{'pendingEmbeddedSegments':_0xd2a41,'pendingEmbeddedActivations':_0x26d7c8,'embeddedSegmentNameToId':_0x119436,'journeyActivationNameToId':_0x2e112a},{..._0x20097a,'effectiveFolderId':_0x5a4c2d},_0x189800,_0x24d329,_0x3315c7);else{ensureJourneyDefaults(_0x3d50da[_0x4ef5f3(0x178)]);const _0x1a70f2=await _0x3d9e3a[_0x4ef5f3(0x17c)][_0x4ef5f3(0x1e7)](_0x3d50da);return deletePushRecovery(_0x1747f5[_0x4ef5f3(0x1bb)]),{'action':_0x4ef5f3(0x14e),'journeyId':_0x1a70f2['id'],'embeddedSegmentNameToId':_0x119436};}}else{if(_0x1747f5[_0x4ef5f3(0x1f1)]&&_0x1747f5[_0x4ef5f3(0x195)]){_0x3d50da['id']=_0x1747f5[_0x4ef5f3(0x195)]['id'];const _0x4340d8=_0x3d50da['attributes'];_0x1747f5['existingJourney']['attributes']?.['journeyBundleName']&&(_0x4340d8[_0x4ef5f3(0x1a9)]=_0x1747f5['existingJourney']['attributes']['journeyBundleName']);const _0x5bd4e5=_0x1747f5[_0x4ef5f3(0x195)][_0x4ef5f3(0x178)]?.[_0x4ef5f3(0x161)];return _0x5bd4e5&&_0x3d50da['attributes']['journeyStages']&&injectExistingStageIds(_0x3d50da[_0x4ef5f3(0x178)]['journeyStages'],_0x5bd4e5),ensureJourneyDefaults(_0x4340d8),await _0x3d9e3a[_0x4ef5f3(0x17c)][_0x4ef5f3(0x10b)](_0x1747f5[_0x4ef5f3(0x195)]['id'],_0x3d50da),deletePushRecovery(_0x1747f5[_0x4ef5f3(0x1bb)]),{'action':_0x4ef5f3(0x10a),'journeyId':_0x1747f5[_0x4ef5f3(0x195)]['id'],'embeddedSegmentNameToId':_0x119436};}}return deletePushRecovery(_0x1747f5[_0x4ef5f3(0x1bb)]),{'action':_0x4ef5f3(0x1f2),'journeyId':_0x1747f5['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x119436};}function findSegmentCriteriaLocation(_0x2be2a3,_0x387f30){const _0x588efd=a136_0x2ce227,_0x5d1c78=_0x2be2a3[_0x588efd(0x101)]||_0x2be2a3[_0x588efd(0x1cb)]?.[0x0]?.[_0x588efd(0x101)]||[];let _0x33d901='entry',_0x175fa1=_0x387f30;const _0x2ef0b9=_0x2be2a3['goal']||_0x2be2a3[_0x588efd(0x1cb)]?.[0x0]?.['goal'];if(_0x2ef0b9?.[_0x588efd(0x133)]===_0x387f30)return{'stageName':'goal','criteriaName':_0x2ef0b9[_0x588efd(0x1d5)]||_0x387f30};_0x255a16:for(const _0x2c2d23 of _0x5d1c78){if(_0x2c2d23[_0x588efd(0x1f7)]?.['segment']===_0x387f30){_0x33d901=_0x2c2d23['name'],_0x175fa1=_0x2c2d23[_0x588efd(0x1f7)]['name']||_0x387f30;break;}if(_0x2c2d23['steps'])for(const _0x3d05d6 of _0x2c2d23[_0x588efd(0x1e5)]){if(_0x3d05d6[_0x588efd(0x1fe)]===_0x588efd(0x1fd)&&_0x3d05d6[_0x588efd(0x19a)]?.[_0x588efd(0x11c)])for(const _0x284024 of _0x3d05d6[_0x588efd(0x19a)]['branches']){if(_0x284024[_0x588efd(0x133)]===_0x387f30){_0x33d901=_0x2c2d23[_0x588efd(0x1d5)],_0x175fa1=_0x284024[_0x588efd(0x1d5)]||_0x387f30;break _0x255a16;}}}}return{'stageName':_0x33d901,'criteriaName':_0x175fa1};}async function executeThreeStepJourneyCreate(_0x4bc0fc,_0x3ba20f,_0x5cb485,_0x29c829,_0x4260d2,_0x145446,_0xf7dab9,_0x14bd44){const _0x50d6d9=a136_0x2ce227,{activationDefToCreateRequest:_0x2eeeb6,yamlRuleToApi:_0x8ef9bb}=_0x14bd44,{pendingEmbeddedSegments:_0xf6da9e,pendingEmbeddedActivations:_0xc8256f,embeddedSegmentNameToId:_0x41fdb2}=_0x29c829,_0x288939=JSON[_0x50d6d9(0x18f)](JSON['stringify'](_0x5cb485));ensureJourneyDefaults(_0x288939[_0x50d6d9(0x178)]),stripPendingIds(_0x288939);const _0x4aa7cc=await _0x4bc0fc[_0x50d6d9(0x17c)][_0x50d6d9(0x1e7)](_0x288939),_0xe3d4c8=_0x4aa7cc['id'],_0x5e23d0=new Map();for(const _0x5286d9 of _0x4aa7cc[_0x50d6d9(0x178)]['journeyStages']){_0x5e23d0[_0x50d6d9(0x149)](_0x5286d9[_0x50d6d9(0x1d5)]['toLowerCase'](),_0x5286d9['id']);}recoverSegmentIdsFromPushRecovery(_0x3ba20f,_0x41fdb2,_0x145446[_0x50d6d9(0x148)]);for(const [_0xfded8,{definition:_0xa5908}]of _0xf6da9e){if(_0x41fdb2[_0x50d6d9(0x134)](_0xfded8)){_0xf7dab9[_0x50d6d9(0x115)]?.({'type':_0x50d6d9(0x1ca),'journeyName':_0x3ba20f['yamlConfig'][_0x50d6d9(0x1d5)],'segmentName':_0xfded8});continue;}const _0x3c205b=generateDeterministicJourneySegmentName(_0x3ba20f['yamlConfig']['name'],_0xfded8);_0xf7dab9[_0x50d6d9(0x115)]?.({'type':_0x50d6d9(0x1be),'journeyName':_0x3ba20f[_0x50d6d9(0x1d3)][_0x50d6d9(0x1d5)],'segmentName':_0xfded8});const _0x2735ea=createSegmentIdResolver(_0x145446[_0x50d6d9(0x148)],_0xfded8),_0x5e7f37=await resolveRuleSegmentIds(_0xa5908['rule'],_0x2735ea),_0x55236a=await createOrRecoverEmbeddedSegment(_0x4bc0fc,_0x3ba20f,{'localName':_0xfded8,'uniqueSegmentName':_0x3c205b,'description':_0xa5908[_0x50d6d9(0x11a)]||'Entry\x20criteria:\x20'+_0xfded8,'journeyId':_0xe3d4c8,'resolvedRule':_0x5e7f37,'parentId':_0x4260d2[_0x50d6d9(0x199)],'folderId':_0x4260d2['effectiveFolderId']||''},_0x8ef9bb);_0x41fdb2[_0x50d6d9(0x149)](_0xfded8,_0x55236a),_0x145446['segmentNameToId'][_0x50d6d9(0x149)](_0xfded8,_0x55236a),_0xf7dab9[_0x50d6d9(0x115)]?.({'type':_0x50d6d9(0x1ca),'journeyName':_0x3ba20f[_0x50d6d9(0x1d3)]['name'],'segmentName':_0xfded8});}const _0x49af4d=new Map();for(const [_0x3b9942,_0x1db035]of _0xc8256f){_0xf7dab9[_0x50d6d9(0x115)]?.({'type':'embedded_activation_creating','journeyName':_0x3ba20f['yamlConfig'][_0x50d6d9(0x1d5)],'activationName':_0x3b9942});const _0x226041=await _0x2eeeb6(_0x1db035,_0x145446[_0x50d6d9(0x15f)]),_0x5928db={..._0x226041,..._0x1db035[_0x50d6d9(0x127)]!==undefined&&{'runAfterJourneyRefresh':_0x1db035[_0x50d6d9(0x127)]}},_0x3dcb6d=await _0x4bc0fc[_0x50d6d9(0x17c)]['createActivation'](_0xe3d4c8,_0x5928db);_0x49af4d['set'](_0x3b9942,_0x3dcb6d['id']),_0x29c829[_0x50d6d9(0x168)][_0x50d6d9(0x149)](_0x3b9942,_0x3dcb6d['id']),_0xf7dab9[_0x50d6d9(0x115)]?.({'type':_0x50d6d9(0x123),'journeyName':_0x3ba20f['yamlConfig']['name'],'activationName':_0x3b9942});}const _0x29f144=JSON[_0x50d6d9(0x18f)](JSON['stringify'](_0x5cb485));return _0x29f144['id']=_0xe3d4c8,ensureJourneyDefaults(_0x29f144[_0x50d6d9(0x178)]),resolvePendingIdsInRequest(_0x29f144,_0x5cb485,_0x5e23d0,_0x41fdb2,_0x49af4d,_0xf7dab9),await _0x4bc0fc[_0x50d6d9(0x17c)][_0x50d6d9(0x10b)](_0xe3d4c8,_0x29f144),deletePushRecovery(_0x3ba20f[_0x50d6d9(0x1bb)]),{'action':_0x50d6d9(0x14e),'journeyId':_0xe3d4c8,'embeddedSegmentNameToId':_0x41fdb2};}export function stripWaitStepPendingIds(_0x438304){const _0x2f50b3=a136_0x2ce227,_0x412ef8=_0x438304['conditionSegmentId']&&isPendingSegmentId(_0x438304[_0x2f50b3(0xfe)]),_0x5b6922=_0x438304[_0x2f50b3(0x1a2)]?.[_0x2f50b3(0x1ee)](_0x4a195a=>_0x4a195a[_0x2f50b3(0x17d)]&&isPendingSegmentId(_0x4a195a[_0x2f50b3(0x17d)]));(_0x412ef8||_0x5b6922)&&(_0x438304[_0x2f50b3(0x1c7)]=_0x2f50b3(0x135),_0x438304[_0x2f50b3(0x18c)]=0x1,_0x438304[_0x2f50b3(0x11f)]=_0x2f50b3(0x1d6),delete _0x438304['conditionSegmentId'],delete _0x438304['conditionTimeoutDuration'],delete _0x438304[_0x2f50b3(0x142)],delete _0x438304['conditions']);}function a136_0x539f(){const _0x49c0bc=['embedded_activation_created','journeyName','Updated\x20activation\x20\x27','nameToType','run_after_journey_refresh','journeyBundleId','flatMap','max','verbose','logSuccess','Creating\x20segment\x20\x27','milestone','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','652884WryJUF','notification','../../utils/async.js','segment','has','Duration','7793270NknGDF','list','journeyBundlesByFolderAndName','segment_created','deleteSegment','resolveSegment','getSegmentEntity','buildUserMaps','JOURNEY_UPDATE_ERROR','nameToId','updateSegmentById','reduce','conditionTimeoutUnit','exitCriterias','match','activationParams','connection','hex','segmentNameToId','set','24ojAvfT','Failed\x20to\x20resolve\x20segment\x20','activation_template_id','entries','created','Condition','draft','Embedded\x20segment\x20\x27','journey_creating','\x27\x20to\x20local\x20\x27','all_columns','createdSegmentIds','logDeleted','activation_deleted','join','folderId','idToName','stage\x20\x27','Updating\x20activation\x20\x27','createdSegmentId','segmentByFolderAndName','activationContext','folder_created','journeyStages','isArray','from','segment_updated',').\x20','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Activation','journeyActivationNameToId','\x27\x20milestone','keys','relationships','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','versionNumber','journeyActivationStepId','parentSegmentFolder','folder','Deleted\x20activation\x20\x27','fetchJourney','Created\x20journey\x20\x27','existingSegments','goal','trim','null','attributes','updateActivation','resolvedRule','Activation\x20not\x20found:\x20','journey','segmentId','3344421AHhfBS','journey_entry_criteria_','132346kgpsHn','Updating\x20segment\x20\x27','50337250UQkFvU','Entry\x20criteria:\x20','diff','activationsBySegmentId','Updated\x20journey\x20\x27','connector_config','uniqueSegmentName','existingSegment','idToEmailMap','Failed\x20to\x20','waitStep','folderPathToId','\x20segment\x20from\x20file:\x20','parse','and\x20the\x20server\x20segment,\x20then\x20retry.','existingActivation','\x20(referenced\x20in\x20journey\x20','results','folderPath','existingJourney','Updated\x20segment\x20\x27','entryCriteria','__pending_act_','parentId','with','behavior','DecisionPoint','parseDocument','./journey-yaml.js','embeddedSegmentNameToId','utf-8','activation_','conditions','getSegment','object','length','activationStepsById','valid','segment_deleted','journeyBundleName','Failed\x20to\x20resolve\x20activation\x20','replace','skipSegments','__pending_','localName','\x27\x20by\x20rule\x20content','withProgress','createJourneySegment','isNew','WaitStep','columns',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','dirname','sort','\x27\x20not\x20found\x20in\x20journey\x20\x27','rule','size','absolutePath','createSegment','data','embedded_segment_creating','\x27\x20for\x20','toString','\x27\x20decision\x20point\x20branch\x20\x27','connectionIdToNameMap','2450960srbcIw','Journey\x20\x27','deps','createActivation','waitStepType','ACTIVATION_SYNTAX_ERROR','push','embedded_segment_created','journeys','debug','\x27\x20from\x20file:\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','NOT_FOUND','\x0a\x20\x20','stringify','includes','yamlConfig','activation_updating','name','day','Matched\x20server\x20segment\x20\x27','errors','startsWith','getJourney','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','sha1','deleteActivation','./child-segment-yaml.js','6uiQKRk','Fetching\x20','Stage\x20\x27','deleted','all','parentFolder','steps','Segment\x20not\x20found:\x20','create','action','13165830NGuHQX','Created\x20folder\x20\x27','SEGMENT_NOT_FOUND','getSegment\x20failed\x20for\x20','journeyId','some','ACTIVATION_UPDATE_ERROR','journeyById','hasChanges','unchanged','schedule','segment_deleting','INTERNAL','\x27\x20wait\x20condition','entry_criteria','filter','segments','validatedRequest','values','rootFolderId','decision_point','type','.$1.push-recovery.json','activations','split','find','7SROlRm','SEGMENT_UPDATE_ERROR','\x20journey\x20from\x20file:\x20','delete','Creating\x20activation\x20\x27','conditionSegmentId','digest','toLowerCase','stages','get','Created\x20segment\x20\x27','Delete\x20the\x20push\x20recovery\x20file\x20(','segmentFolderId','add','\x27...','getActivation','yamlActivation','updated','update','activation_deleting','activation_created','getSegmentEntity\x20also\x20failed\x20for\x20','conditionTimeoutDuration','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','uniqueServerName','segment_updating','Name\x20has\x20already\x20been\x20taken','slice','onProgress','listActivations','toISOString','resolveJourneyId','activation_creating','description','map','branches','Deleting\x20activation\x20\x27','state','waitStepUnit','Segment\x20not\x20found','getLatestJourneyId','logInfo'];a136_0x539f=function(){return _0x49c0bc;};return a136_0x539f();}export function resolveWaitStepPendingIds(_0x5861af,_0x5b4b16,_0x22ef3d,_0x33a6fe){const _0x1c0fa6=a136_0x2ce227;if(_0x5b4b16[_0x1c0fa6(0xfe)]&&isPendingSegmentId(_0x5b4b16[_0x1c0fa6(0xfe)])){const _0x401272=_0x22ef3d(_0x5b4b16[_0x1c0fa6(0xfe)],_0x1c0fa6(0x15b)+_0x33a6fe+_0x1c0fa6(0x1f6));_0x401272&&(_0x5861af[_0x1c0fa6(0x1c7)]=_0x1c0fa6(0x14f),_0x5861af[_0x1c0fa6(0xfe)]=_0x401272,delete _0x5861af[_0x1c0fa6(0x18c)],delete _0x5861af['waitStepUnit'],_0x5b4b16[_0x1c0fa6(0x10f)]!==undefined&&(_0x5861af[_0x1c0fa6(0x10f)]=_0x5b4b16[_0x1c0fa6(0x10f)]),_0x5b4b16['conditionTimeoutUnit']&&(_0x5861af[_0x1c0fa6(0x142)]=_0x5b4b16['conditionTimeoutUnit']));}if(_0x5b4b16[_0x1c0fa6(0x1a2)]){const _0x5d664a=_0x5b4b16['conditions'][_0x1c0fa6(0x1ee)](_0x34a36a=>_0x34a36a[_0x1c0fa6(0x17d)]&&isPendingSegmentId(_0x34a36a[_0x1c0fa6(0x17d)]));if(_0x5d664a){const _0x10dc83=_0x5b4b16[_0x1c0fa6(0x1a2)][_0x1c0fa6(0x11b)](_0x4cc077=>{const _0x333f71=_0x1c0fa6;if(_0x4cc077[_0x333f71(0x17d)]&&isPendingSegmentId(_0x4cc077[_0x333f71(0x17d)])){const _0x2496ba=_0x22ef3d(_0x4cc077['segmentId'],'stage\x20\x27'+_0x33a6fe+'\x27\x20wait\x20condition');return{..._0x4cc077,'segmentId':_0x2496ba||_0x4cc077[_0x333f71(0x17d)]};}return{..._0x4cc077};});_0x5861af[_0x1c0fa6(0x1c7)]=_0x1c0fa6(0x14f),_0x5861af[_0x1c0fa6(0x1a2)]=_0x10dc83,delete _0x5861af[_0x1c0fa6(0x18c)],delete _0x5861af[_0x1c0fa6(0x11f)],delete _0x5861af[_0x1c0fa6(0xfe)],delete _0x5861af[_0x1c0fa6(0x10f)],delete _0x5861af[_0x1c0fa6(0x142)];}}}function stripPendingIds(_0x5058c5){const _0x264d7b=a136_0x2ce227;_0x5058c5[_0x264d7b(0x178)][_0x264d7b(0x175)]?.['segmentId']&&isPendingSegmentId(_0x5058c5[_0x264d7b(0x178)][_0x264d7b(0x175)][_0x264d7b(0x17d)])&&delete _0x5058c5[_0x264d7b(0x178)][_0x264d7b(0x175)];for(const _0x90e560 of _0x5058c5[_0x264d7b(0x178)][_0x264d7b(0x161)]||[]){_0x90e560[_0x264d7b(0x197)]?.['segmentId']&&isPendingSegmentId(_0x90e560['entryCriteria'][_0x264d7b(0x17d)])&&delete _0x90e560['entryCriteria'];_0x90e560[_0x264d7b(0x12e)]?.[_0x264d7b(0x17d)]&&isPendingSegmentId(_0x90e560[_0x264d7b(0x12e)][_0x264d7b(0x17d)])&&delete _0x90e560[_0x264d7b(0x12e)];_0x90e560[_0x264d7b(0x143)]&&(_0x90e560['exitCriterias']=_0x90e560[_0x264d7b(0x143)][_0x264d7b(0x1f8)](_0x30f53f=>!_0x30f53f[_0x264d7b(0x17d)]||!isPendingSegmentId(_0x30f53f[_0x264d7b(0x17d)])));if(_0x90e560[_0x264d7b(0x1e5)])for(const _0x331918 of Object[_0x264d7b(0x16a)](_0x90e560[_0x264d7b(0x1e5)])){const _0x5f54b0=_0x90e560[_0x264d7b(0x1e5)][_0x331918];_0x5f54b0[_0x264d7b(0x1fe)]===_0x264d7b(0x167)&&_0x5f54b0['journeyActivationStepId']&&isPendingActivationId(_0x5f54b0[_0x264d7b(0x16e)])&&(_0x5f54b0[_0x264d7b(0x16e)]='');if(_0x5f54b0[_0x264d7b(0x1fe)]===_0x264d7b(0x19c)&&_0x5f54b0[_0x264d7b(0x11c)])for(const _0x5743ac of _0x5f54b0[_0x264d7b(0x11c)]){_0x5743ac[_0x264d7b(0x17d)]&&isPendingSegmentId(_0x5743ac[_0x264d7b(0x17d)])&&(_0x5743ac[_0x264d7b(0x17d)]='');}_0x5f54b0[_0x264d7b(0x1fe)]===_0x264d7b(0x1b3)&&stripWaitStepPendingIds(_0x5f54b0);}}}function resolvePendingIdsInRequest(_0x1d2a87,_0x1d3d96,_0x2ea18b,_0x587939,_0x39ac0f,_0x5968c4){const _0x4490bb=a136_0x2ce227,_0x18e5a1=(_0x2b0d76,_0x364723)=>{const _0x3d718a=a136_0xc719;if(!isPendingSegmentId(_0x2b0d76))return _0x2b0d76;const _0x1fd423=extractPendingSegmentName(_0x2b0d76),_0x4e7ace=_0x587939['get'](_0x1fd423);return!_0x4e7ace&&_0x5968c4['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x1fd423+_0x3d718a(0x1bf)+_0x364723),_0x4e7ace;};if(_0x1d2a87['attributes'][_0x4490bb(0x175)]?.['segmentId']&&isPendingSegmentId(_0x1d2a87[_0x4490bb(0x178)][_0x4490bb(0x175)][_0x4490bb(0x17d)])){const _0x47798a=_0x18e5a1(_0x1d2a87[_0x4490bb(0x178)][_0x4490bb(0x175)][_0x4490bb(0x17d)],'goal\x20criteria');_0x47798a&&(_0x1d2a87[_0x4490bb(0x178)][_0x4490bb(0x175)][_0x4490bb(0x17d)]=_0x47798a);}for(const _0x425a30 of _0x1d2a87['attributes'][_0x4490bb(0x161)]||[]){const _0x31cc90=_0x2ea18b['get'](_0x425a30['name'][_0x4490bb(0x100)]());_0x31cc90&&(_0x425a30['id']=_0x31cc90);if(_0x425a30[_0x4490bb(0x197)]?.[_0x4490bb(0x17d)]&&isPendingSegmentId(_0x425a30['entryCriteria'][_0x4490bb(0x17d)])){const _0x3b818f=_0x18e5a1(_0x425a30[_0x4490bb(0x197)][_0x4490bb(0x17d)],_0x4490bb(0x15b)+_0x425a30[_0x4490bb(0x1d5)]+'\x27\x20entry\x20criteria');_0x3b818f&&(_0x425a30[_0x4490bb(0x197)]['segmentId']=_0x3b818f);}if(_0x425a30[_0x4490bb(0x143)])for(const _0x4e6b9b of _0x425a30['exitCriterias']){if(_0x4e6b9b[_0x4490bb(0x17d)]&&isPendingSegmentId(_0x4e6b9b['segmentId'])){const _0x49e8c7=_0x18e5a1(_0x4e6b9b[_0x4490bb(0x17d)],'stage\x20\x27'+_0x425a30[_0x4490bb(0x1d5)]+'\x27\x20exit\x20criteria');_0x49e8c7&&(_0x4e6b9b['segmentId']=_0x49e8c7);}}if(_0x425a30[_0x4490bb(0x12e)]?.['segmentId']&&isPendingSegmentId(_0x425a30['milestone'][_0x4490bb(0x17d)])){const _0x34c6e8=_0x18e5a1(_0x425a30[_0x4490bb(0x12e)][_0x4490bb(0x17d)],_0x4490bb(0x15b)+_0x425a30[_0x4490bb(0x1d5)]+_0x4490bb(0x169));_0x34c6e8&&(_0x425a30[_0x4490bb(0x12e)][_0x4490bb(0x17d)]=_0x34c6e8);}if(_0x425a30[_0x4490bb(0x1e5)]){const _0x3e87a6=_0x47c272=>_0x1d3d96[_0x4490bb(0x178)]['journeyStages']?.[_0x4490bb(0xf8)](_0x36aff0=>_0x36aff0[_0x4490bb(0x1d5)][_0x4490bb(0x100)]()===_0x425a30[_0x4490bb(0x1d5)][_0x4490bb(0x100)]())?.[_0x4490bb(0x1e5)]?.[_0x47c272];for(const _0x3cda71 of Object[_0x4490bb(0x16a)](_0x425a30[_0x4490bb(0x1e5)])){const _0x271191=_0x425a30[_0x4490bb(0x1e5)][_0x3cda71],_0x3b2574=_0x3e87a6(_0x3cda71);if(_0x271191['type']===_0x4490bb(0x167)&&_0x271191['journeyActivationStepId']&&(isPendingActivationId(_0x271191['journeyActivationStepId'])||_0x271191['journeyActivationStepId']==='')){if(_0x3b2574?.['journeyActivationStepId']&&isPendingActivationId(_0x3b2574['journeyActivationStepId'])){const _0x531601=extractPendingActivationName(_0x3b2574[_0x4490bb(0x16e)]),_0x27089e=_0x39ac0f['get'](_0x531601);_0x27089e&&(_0x271191['journeyActivationStepId']=_0x27089e);}}if(_0x271191['type']===_0x4490bb(0x19c)&&_0x271191[_0x4490bb(0x11c)]&&_0x3b2574?.['branches'])for(let _0x28e219=0x0;_0x28e219<_0x271191[_0x4490bb(0x11c)]['length'];_0x28e219++){const _0x492bf2=_0x271191['branches'][_0x28e219],_0x35b6f7=_0x3b2574['branches'][_0x28e219];if(_0x35b6f7?.[_0x4490bb(0x17d)]&&isPendingSegmentId(_0x35b6f7[_0x4490bb(0x17d)])){const _0x97dbcb=_0x18e5a1(_0x35b6f7['segmentId'],_0x4490bb(0x15b)+_0x425a30[_0x4490bb(0x1d5)]+_0x4490bb(0x1c1)+(_0x492bf2[_0x4490bb(0x1d5)]||_0x28e219)+'\x27');_0x97dbcb&&(_0x492bf2[_0x4490bb(0x17d)]=_0x97dbcb);}}_0x271191[_0x4490bb(0x1fe)]===_0x4490bb(0x1b3)&&_0x3b2574?.[_0x4490bb(0x1fe)]==='WaitStep'&&resolveWaitStepPendingIds(_0x271191,_0x3b2574,_0x18e5a1,_0x425a30[_0x4490bb(0x1d5)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x37f998,_0x540cc6){const _0x3eece3=a137_0x3d98,_0x2d0419=_0x37f998();while(!![]){try{const _0x130b03=-parseInt(_0x3eece3(0x146))/0x1+parseInt(_0x3eece3(0x142))/0x2+parseInt(_0x3eece3(0x147))/0x3*(-parseInt(_0x3eece3(0x14a))/0x4)+parseInt(_0x3eece3(0x144))/0x5*(-parseInt(_0x3eece3(0x143))/0x6)+-parseInt(_0x3eece3(0x14b))/0x7*(-parseInt(_0x3eece3(0x140))/0x8)+-parseInt(_0x3eece3(0x148))/0x9*(-parseInt(_0x3eece3(0x13e))/0xa)+parseInt(_0x3eece3(0x14c))/0xb;if(_0x130b03===_0x540cc6)break;else _0x2d0419['push'](_0x2d0419['shift']());}catch(_0x7918e1){_0x2d0419['push'](_0x2d0419['shift']());}}}(a137_0x5696,0x65974));export function buildFolderIdToPathMap(_0x4316ea){const _0x1325d7=a137_0x3d98,_0x5355ae=new Map(),_0xecf487=new Map();for(const _0x2115a of _0x4316ea){_0xecf487[_0x1325d7(0x14d)](_0x2115a['id'],_0x2115a);}const _0x5e18b6=new Set();for(const _0xb97d39 of _0x4316ea){!_0xb97d39[_0x1325d7(0x13f)]&&_0x5e18b6[_0x1325d7(0x145)](_0xb97d39['id']);}function _0x447554(_0x56d946){const _0x3d453a=_0x1325d7;if(_0x5355ae[_0x3d453a(0x141)](_0x56d946['id']))return _0x5355ae[_0x3d453a(0x14e)](_0x56d946['id']);if(_0x5e18b6[_0x3d453a(0x141)](_0x56d946['id']))return _0x5355ae[_0x3d453a(0x14d)](_0x56d946['id'],''),'';if(_0x56d946[_0x3d453a(0x13f)]){const _0x349377=_0xecf487[_0x3d453a(0x14e)](_0x56d946[_0x3d453a(0x13f)]);if(_0x349377){const _0x4e9ad1=_0x447554(_0x349377),_0x1e6597=_0x4e9ad1?_0x4e9ad1+'/'+_0x56d946[_0x3d453a(0x149)]:_0x56d946['name'];return _0x5355ae['set'](_0x56d946['id'],_0x1e6597),_0x1e6597;}}const _0x10af3a=_0x56d946[_0x3d453a(0x149)];return _0x5355ae[_0x3d453a(0x14d)](_0x56d946['id'],_0x10af3a),_0x10af3a;}for(const _0x1ac9f0 of _0x4316ea){_0x447554(_0x1ac9f0);}return _0x5355ae;}function a137_0x5696(){const _0x1610ed=['81632hoceRM','has','1299260rzGjFN','4069932JKNyNB','5OhCGtt','add','238786WymNBb','2392761zupcZT','927vgxVFN','name','4AuEneq','140IybvTQ','8810252ztuMJS','set','get','46230htJxSi','parentFolderId'];a137_0x5696=function(){return _0x1610ed;};return a137_0x5696();}function a137_0x3d98(_0x53f8f0,_0x1d74fc){_0x53f8f0=_0x53f8f0-0x13e;const _0x569640=a137_0x5696();let _0x3d988d=_0x569640[_0x53f8f0];return _0x3d988d;}export function buildFolderPathToIdMap(_0x4466c7){const _0x15e7f6=a137_0x3d98,_0x55c752=new Map(),_0x5f25a1=new Map();for(const _0x5752d4 of _0x4466c7){_0x5f25a1['set'](_0x5752d4['id'],_0x5752d4);}const _0x1f9482=new Set();for(const _0x30cb77 of _0x4466c7){!_0x30cb77[_0x15e7f6(0x13f)]&&_0x1f9482['add'](_0x30cb77['id']);}function _0xdf07d0(_0x410274){const _0x597d09=_0x15e7f6;if(_0x1f9482[_0x597d09(0x141)](_0x410274['id']))return'';if(_0x410274[_0x597d09(0x13f)]){const _0x133442=_0x5f25a1[_0x597d09(0x14e)](_0x410274['parentFolderId']);if(_0x133442){const _0x187d0c=_0xdf07d0(_0x133442);return _0x187d0c?_0x187d0c+'/'+_0x410274[_0x597d09(0x149)]:_0x410274[_0x597d09(0x149)];}}return _0x410274['name'];}for(const _0x4af439 of _0x4466c7){const _0x393605=_0xdf07d0(_0x4af439);_0x55c752[_0x15e7f6(0x14d)](_0x393605,_0x4af439['id']);}return _0x55c752;}export function buildFolderMaps(_0x3bd300){const _0x2c4074=a137_0x3d98,_0xfd4c9a=buildFolderIdToPathMap(_0x3bd300),_0x37ee27=new Map();for(const [_0x26aebb,_0x22ec0c]of _0xfd4c9a){_0x37ee27[_0x2c4074(0x14d)](_0x22ec0c,_0x26aebb);}return{'idToPath':_0xfd4c9a,'pathToId':_0x37ee27};}export function getFolderPath(_0x300fad,_0x21d323){const _0x215138=a137_0x3d98;if(!_0x300fad)return'';return _0x21d323[_0x215138(0x14e)](_0x300fad)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x189b66,_0x2e0850){const _0x460f50=a138_0x5b38,_0x3dc4b5=_0x189b66();while(!![]){try{const _0xddc0de=-parseInt(_0x460f50(0x101))/0x1*(parseInt(_0x460f50(0x10a))/0x2)+-parseInt(_0x460f50(0x102))/0x3+-parseInt(_0x460f50(0x110))/0x4*(parseInt(_0x460f50(0x112))/0x5)+parseInt(_0x460f50(0x114))/0x6*(parseInt(_0x460f50(0xee))/0x7)+parseInt(_0x460f50(0xf8))/0x8+-parseInt(_0x460f50(0x108))/0x9+parseInt(_0x460f50(0x118))/0xa*(parseInt(_0x460f50(0x103))/0xb);if(_0xddc0de===_0x2e0850)break;else _0x3dc4b5['push'](_0x3dc4b5['shift']());}catch(_0x205c10){_0x3dc4b5['push'](_0x3dc4b5['shift']());}}}(a138_0xcf78,0x30d62));import a138_0x2217b7 from'path';import{parse as a138_0x3fb807}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x522c13){const _0x4ead32=a138_0x5b38;if(!_0x522c13||_0x522c13['trim']()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x1a1005=_0x522c13[_0x4ead32(0x113)]();if(_0x1a1005==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x522c13};const _0x438255=_0x1a1005[_0x4ead32(0x106)]('/')?_0x1a1005[_0x4ead32(0x117)](0x1):_0x1a1005,_0x121a5f=_0x438255[_0x4ead32(0x11d)]('/')['filter'](_0x1b84d3=>_0x1b84d3!=='');if(_0x121a5f[_0x4ead32(0x111)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x4b9917=_0x1a1005[_0x4ead32(0x106)]('/')||!isRelativePathSegment(_0x121a5f[0x0]);for(const _0x1212a4 of _0x121a5f){validatePathSegment(_0x1212a4);}return{'segments':_0x121a5f,'isAbsolute':_0x4b9917,'raw':_0x522c13};}function isRelativePathSegment(_0x56947d){return _0x56947d==='.'||_0x56947d==='..';}function validatePathSegment(_0x511f5d){const _0x244d7c=a138_0x5b38;if(_0x511f5d==='')throw new Error(_0x244d7c(0x10d));if(_0x511f5d==='.'||_0x511f5d==='..')return;if(/[\x00-\x1F\x7F]/[_0x244d7c(0xf5)](_0x511f5d))throw new Error(_0x244d7c(0x105)+_0x511f5d);if(_0x511f5d!==_0x511f5d[_0x244d7c(0x113)]()){}}export function validatePath(_0x50f319){const _0x6e3e35=a138_0x5b38;if(_0x50f319[_0x6e3e35(0xf7)][_0x6e3e35(0x111)]===0x0&&!_0x50f319[_0x6e3e35(0x10f)])throw new Error(_0x6e3e35(0xef));if(_0x50f319[_0x6e3e35(0x10f)]){if(_0x50f319[_0x6e3e35(0xf7)][0x0]==='..')throw new Error(_0x6e3e35(0x11a));let _0x5ea2f8=0x0;for(const _0x4d25e3 of _0x50f319[_0x6e3e35(0xf7)]){if(_0x4d25e3==='..'){if(_0x5ea2f8===0x0)throw new Error(_0x6e3e35(0xfe));_0x5ea2f8--;}else _0x4d25e3!=='.'&&_0x5ea2f8++;}}}export function joinPaths(_0x11e9f2,_0x427023){const _0x51b1d0=a138_0x5b38;if(!_0x11e9f2||_0x11e9f2==='/')return _0x427023;if(!_0x427023||_0x427023==='.')return _0x11e9f2;if(_0x427023[_0x51b1d0(0x106)]('/'))return _0x427023;const _0x318d38=parsePath(_0x11e9f2),_0x1707c2=parsePath(_0x427023),_0x5a4266=[..._0x318d38[_0x51b1d0(0xf7)]];for(const _0x1cccb4 of _0x1707c2[_0x51b1d0(0xf7)]){if(_0x1cccb4==='.')continue;else{if(_0x1cccb4==='..'){if(_0x5a4266[_0x51b1d0(0x111)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x5a4266[_0x51b1d0(0x119)]();}else _0x5a4266[_0x51b1d0(0xf6)](_0x1cccb4);}}const _0x16fab3=_0x5a4266[_0x51b1d0(0x116)]('/');return _0x318d38[_0x51b1d0(0xf4)][_0x51b1d0(0x106)]('/')?'/'+_0x16fab3:_0x16fab3;}export function normalizePath(_0x3c7a4b){const _0x23bfac=a138_0x5b38,_0x18539b=parsePath(_0x3c7a4b),_0x26cb8c=[];for(const _0x5cf0f2 of _0x18539b[_0x23bfac(0xf7)]){if(_0x5cf0f2==='.')continue;else{if(_0x5cf0f2==='..'){if(_0x26cb8c[_0x23bfac(0x111)]===0x0){if(_0x18539b[_0x23bfac(0x10f)])throw new Error(_0x23bfac(0xff));_0x26cb8c[_0x23bfac(0xf6)]('..');}else _0x26cb8c[_0x26cb8c[_0x23bfac(0x111)]-0x1]==='..'?_0x26cb8c[_0x23bfac(0xf6)]('..'):_0x26cb8c['pop']();}else _0x26cb8c['push'](_0x5cf0f2);}}if(_0x26cb8c[_0x23bfac(0x111)]===0x0)return _0x18539b['isAbsolute']?'/':'.';const _0x4ec41c=_0x26cb8c[_0x23bfac(0x116)]('/');return _0x18539b[_0x23bfac(0xf4)][_0x23bfac(0x106)]('/')?'/'+_0x4ec41c:_0x4ec41c;}export function getParentPath(_0x404433){const _0x205152=a138_0x5b38,_0x3720c3=parsePath(_0x404433);if(_0x3720c3[_0x205152(0xf7)][_0x205152(0x111)]<=0x1)return'/';const _0x78a6fc=_0x3720c3[_0x205152(0xf7)][_0x205152(0xf0)](0x0,-0x1)['join']('/');return _0x3720c3[_0x205152(0xf4)][_0x205152(0x106)]('/')?'/'+_0x78a6fc:_0x78a6fc;}export function getBaseName(_0x196971){const _0xdf22e0=a138_0x5b38,_0x41ec9f=parsePath(_0x196971);return _0x41ec9f[_0xdf22e0(0xf7)][_0x41ec9f[_0xdf22e0(0xf7)]['length']-0x1]||'';}export function isChildPath(_0x312204,_0x1311c4){const _0x5e6707=a138_0x5b38,_0x40ab2f=parsePath(_0x312204),_0x396d5a=parsePath(_0x1311c4);if(_0x40ab2f[_0x5e6707(0xf7)]['length']<=_0x396d5a['segments'][_0x5e6707(0x111)])return![];for(let _0x1693e9=0x0;_0x1693e9<_0x396d5a[_0x5e6707(0xf7)][_0x5e6707(0x111)];_0x1693e9++){if(_0x40ab2f['segments'][_0x1693e9]!==_0x396d5a[_0x5e6707(0xf7)][_0x1693e9])return![];}return!![];}export function splitPath(_0x2f3c6f){const _0x3c2c12=a138_0x5b38,_0x1d17f4=parsePath(_0x2f3c6f);if(_0x1d17f4[_0x3c2c12(0xf7)][_0x3c2c12(0x111)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x1d17f4[_0x3c2c12(0xf7)][_0x3c2c12(0x111)]===0x1)return{'parent':_0x1d17f4[_0x3c2c12(0xf7)][0x0]};return{'parent':_0x1d17f4[_0x3c2c12(0xf7)][0x0],'child':_0x1d17f4[_0x3c2c12(0xf7)][_0x3c2c12(0xf0)](0x1)[_0x3c2c12(0x116)]('/')};}function a138_0x5b38(_0x12b7ae,_0x547ce5){_0x12b7ae=_0x12b7ae-0xee;const _0xcf78da=a138_0xcf78();let _0x5b3842=_0xcf78da[_0x12b7ae];return _0x5b3842;}export function isYamlFilePath(_0x3b7ff9){const _0x42cabf=a138_0x5b38;return _0x3b7ff9[_0x42cabf(0x10e)](_0x42cabf(0x10c))||_0x3b7ff9[_0x42cabf(0x10e)](_0x42cabf(0x11c));}export async function resolveYamlFilePath(_0x596d45,_0x47b324=nodeFileSystem){const _0x65ae09=a138_0x5b38,_0x3494d0=a138_0x2217b7[_0x65ae09(0x10b)](_0x596d45);if(!await _0x47b324[_0x65ae09(0xfc)](_0x3494d0))throw new Error('File\x20not\x20found:\x20'+_0x596d45);let _0x4055f5=a138_0x2217b7[_0x65ae09(0xf1)](_0x3494d0),_0x4cfc3b=null,_0x44256f=null;const _0x43908e=a138_0x2217b7['parse'](_0x4055f5)[_0x65ae09(0x109)];while(_0x4055f5!==_0x43908e){const _0x781c62=a138_0x2217b7[_0x65ae09(0x116)](_0x4055f5,'tdx.json');if(await _0x47b324[_0x65ae09(0xfc)](_0x781c62)){_0x4cfc3b=_0x781c62,_0x44256f=_0x4055f5;break;}_0x4055f5=a138_0x2217b7[_0x65ae09(0xf1)](_0x4055f5);}if(!_0x4cfc3b||!_0x44256f)throw new Error(_0x65ae09(0xfa)+_0x596d45+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x55056f=await _0x47b324[_0x65ae09(0x11b)](_0x4cfc3b),_0x3899e1=JSON[_0x65ae09(0xfd)](_0x55056f),_0x301ec5=_0x3899e1[_0x65ae09(0xf3)];if(!_0x301ec5)throw new Error(_0x65ae09(0xf2));const _0x59b499=await _0x47b324['readFile'](_0x3494d0),_0x7f27b0=a138_0x3fb807(_0x59b499),_0x21eee4=_0x7f27b0[_0x65ae09(0x100)];if(!_0x21eee4)throw new Error(_0x65ae09(0x115)+_0x596d45);const _0x1044ff=_0x7f27b0[_0x65ae09(0x107)]===_0x65ae09(0x104)?'journey':'segment',_0x2b8468=a138_0x2217b7[_0x65ae09(0xf9)](_0x44256f,_0x3494d0),_0x48c553=a138_0x2217b7['dirname'](_0x2b8468),_0x1da9e9=_0x48c553==='.'?'':_0x48c553[_0x65ae09(0xfb)](/\\/g,'/'),_0x4ff13d=_0x1da9e9?_0x301ec5+'/'+_0x1da9e9+'/'+_0x21eee4:_0x301ec5+'/'+_0x21eee4;return{'parentSegment':_0x301ec5,'segmentName':_0x21eee4,'folderPath':_0x1da9e9,'fullPath':_0x4ff13d,'resourceType':_0x1044ff,'content':_0x59b499};}function a138_0xcf78(){const _0x12dd7b=['3010872oVkryT','relative','No\x20tdx.json\x20found\x20for\x20file:\x20','replace','exists','parse','Path\x20attempts\x20to\x20navigate\x20above\x20root','Cannot\x20navigate\x20above\x20root','name','1sxmhVH','668208kfYSfC','323521xDSeUv','journey','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','startsWith','type','1230984kAYIGJ','root','492406VRnRPP','resolve','.yml','Path\x20segment\x20cannot\x20be\x20empty','endsWith','isAbsolute','4xsVJKe','length','1479545SqfmdY','trim','13956vLCXHo','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','join','substring','230exAMpN','pop','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','readFile','.yaml','split','147gBoVHS','Relative\x20path\x20cannot\x20be\x20empty','slice','dirname','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','parent_segment','raw','test','push','segments'];a138_0xcf78=function(){return _0x12dd7b;};return a138_0xcf78();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a139_0x5610(){const _0x4a126b=['65413jdbJvn','3pjUOqb','.\x20Child\x20name\x20cannot\x20be\x20empty','3438fUYcey','Invalid\x20segment\x20reference\x20format:\x20','substring','1917cQGgCV','21xxUogv','3688208hOcOAW','indexOf','26hyLRHQ','2110ZGTPPe','6825348uKKkkh','30550RmaAiL','48538416HWCBcF','15149277bSBDrW'];a139_0x5610=function(){return _0x4a126b;};return a139_0x5610();}function a139_0x596d(_0x34cd05,_0x4b2f2c){_0x34cd05=_0x34cd05-0x12d;const _0x5610e8=a139_0x5610();let _0x596df2=_0x5610e8[_0x34cd05];return _0x596df2;}(function(_0x2301ca,_0x28ebaf){const _0x2e3732=a139_0x596d,_0x56bb07=_0x2301ca();while(!![]){try{const _0x123930=-parseInt(_0x2e3732(0x134))/0x1*(-parseInt(_0x2e3732(0x12e))/0x2)+parseInt(_0x2e3732(0x135))/0x3*(parseInt(_0x2e3732(0x130))/0x4)+-parseInt(_0x2e3732(0x12f))/0x5*(-parseInt(_0x2e3732(0x137))/0x6)+parseInt(_0x2e3732(0x13b))/0x7*(parseInt(_0x2e3732(0x13c))/0x8)+parseInt(_0x2e3732(0x13a))/0x9*(-parseInt(_0x2e3732(0x131))/0xa)+parseInt(_0x2e3732(0x133))/0xb+-parseInt(_0x2e3732(0x132))/0xc;if(_0x123930===_0x28ebaf)break;else _0x56bb07['push'](_0x56bb07['shift']());}catch(_0x569a66){_0x56bb07['push'](_0x56bb07['shift']());}}}(a139_0x5610,0xd2bee));export function parseSegmentRef(_0x33351d){const _0x447055=a139_0x596d,_0x8d5089=_0x33351d[_0x447055(0x12d)]('/');if(_0x8d5089===-0x1)return{'parentId':_0x33351d};if(_0x8d5089===0x0)throw new Error(_0x447055(0x138)+_0x33351d+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x42d5db=_0x33351d[_0x447055(0x139)](0x0,_0x8d5089),_0x9a3d22=_0x33351d[_0x447055(0x139)](_0x8d5089+0x1);if(_0x9a3d22==='')throw new Error(_0x447055(0x138)+_0x33351d+_0x447055(0x136));return{'parentId':_0x42d5db,'childId':_0x9a3d22};}
|