@treasuredata/tdx 0.14.3 → 0.14.4
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/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.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-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/llm-proxy.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/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/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/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/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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/api.js +1 -1
- package/dist/sdk/client/cdp-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/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-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-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-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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.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/tree-formatter.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/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/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.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 a100_0x2c6966=a100_0x1a9a;(function(_0x3a961a,_0x572702){const _0x29c3dc=a100_0x1a9a,_0x177069=_0x3a961a();while(!![]){try{const _0x561e0b=parseInt(_0x29c3dc(0x151))/0x1+parseInt(_0x29c3dc(0x168))/0x2*(-parseInt(_0x29c3dc(0x18f))/0x3)+-parseInt(_0x29c3dc(0x1c4))/0x4*(parseInt(_0x29c3dc(0x18a))/0x5)+parseInt(_0x29c3dc(0x1ff))/0x6+parseInt(_0x29c3dc(0x136))/0x7+-parseInt(_0x29c3dc(0x1bd))/0x8+parseInt(_0x29c3dc(0x183))/0x9;if(_0x561e0b===_0x572702)break;else _0x177069['push'](_0x177069['shift']());}catch(_0x2ee8c1){_0x177069['push'](_0x177069['shift']());}}}(a100_0xc29c,0xd67d3));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a100_0x2c6966(0x12a);export const PENDING_ACTIVATION_PREFIX=a100_0x2c6966(0x14f);export function createPendingSegmentId(_0x2a4199){return''+PENDING_SEGMENT_PREFIX+_0x2a4199+'__';}export function isPendingSegmentId(_0x570305){const _0x4c6cd8=a100_0x2c6966;return _0x570305[_0x4c6cd8(0x1bb)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x4d8cb8){const _0x3c04e3=a100_0x2c6966;return _0x4d8cb8[_0x3c04e3(0x1f6)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3ee1bb){return''+PENDING_ACTIVATION_PREFIX+_0x3ee1bb+'__';}export function isPendingActivationId(_0x547c4c){const _0x449578=a100_0x2c6966;return _0x547c4c[_0x449578(0x1bb)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x419ea8){const _0x375cd1=a100_0x2c6966;return _0x419ea8[_0x375cd1(0x1f6)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x2c3f33,_0x5c92e5){const _0xf01964=a100_0x2c6966,_0xd6acb9=_0x2c3f33+'::'+(_0x5c92e5[_0xf01964(0x1bf)]()||'segment'),_0x1a4623=createHash(_0xf01964(0x1b7))[_0xf01964(0x1a7)](_0xd6acb9)['digest']('hex')[_0xf01964(0x1e9)](0x0,0xc);return _0xf01964(0x155)+_0x1a4623;}export function ensureJourneyDefaults(_0x30dab2){const _0x5c48a9=a100_0x2c6966;!_0x30dab2[_0x5c48a9(0x132)]&&(_0x30dab2[_0x5c48a9(0x132)]=''),!_0x30dab2['state']&&(_0x30dab2['state']='draft');}export function resolveTDFolderPath(_0x37a827,_0x2115c2,_0x415fbb){const _0x4e8087=a100_0x2c6966;if(!_0x2115c2)return _0x37a827;if(_0x37a827===_0x415fbb||_0x37a827[_0x4e8087(0x1bb)](_0x415fbb+'/'))return _0x37a827;return _0x37a827?_0x415fbb+'/'+_0x37a827:_0x415fbb;}export function addFoldersToCreate(_0x168337,_0x10305f,_0x342364){const _0x1954ac=a100_0x2c6966;if(!_0x168337)return;if(_0x10305f[_0x1954ac(0x1c3)](_0x168337))return;const _0x3de62e=_0x168337[_0x1954ac(0x13a)]('/');let _0x32da81='';for(const _0x53183d of _0x3de62e){_0x32da81=_0x32da81?_0x32da81+'/'+_0x53183d:_0x53183d,!_0x10305f[_0x1954ac(0x1c3)](_0x32da81)&&_0x342364[_0x1954ac(0x18c)](_0x32da81);}}import*as a100_0x4d5033 from'yaml';import{readFileSync}from'fs';function a100_0x1a9a(_0x2c8a54,_0x3a7dd6){_0x2c8a54=_0x2c8a54-0x11e;const _0xc29c8a=a100_0xc29c();let _0x1a9af6=_0xc29c8a[_0x2c8a54];return _0x1a9af6;}import a100_0x2afdb9 from'path';import{isJourneyDef,parseYamlString as a100_0x31baf0,toYamlString as a100_0x5d57b2,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x53d02c){const _0x5dde57=a100_0x2c6966;if(Array['isArray'](_0x53d02c))return'['+_0x53d02c[_0x5dde57(0x1b5)](_0xd89f45=>stableStringify(_0xd89f45))[_0x5dde57(0x120)](',')+']';if(_0x53d02c&&typeof _0x53d02c===_0x5dde57(0x1e5)){const _0x3d15dc=_0x53d02c,_0x56a4cd=Object[_0x5dde57(0x1d3)](_0x3d15dc)['sort'](),_0x353c3d=_0x56a4cd[_0x5dde57(0x1b5)](_0x59d5b2=>'\x22'+_0x59d5b2+'\x22:'+stableStringify(_0x3d15dc[_0x59d5b2]));return'{'+_0x353c3d[_0x5dde57(0x120)](',')+'}';}const _0x4de6ee=JSON[_0x5dde57(0x158)](_0x53d02c);return _0x4de6ee===undefined?_0x5dde57(0x14e):_0x4de6ee;}function activationSignature(_0x2c8f28){const _0x554f99=a100_0x2c6966,_0x4e5ccd={'connection':_0x2c8f28['connection'],..._0x2c8f28[_0x554f99(0x19b)]!==undefined&&{'all_columns':_0x2c8f28['all_columns']},..._0x2c8f28[_0x554f99(0x16d)]!==undefined&&{'columns':_0x2c8f28[_0x554f99(0x16d)]},..._0x2c8f28[_0x554f99(0x1a9)]!==undefined&&{'behavior':_0x2c8f28[_0x554f99(0x1a9)]},..._0x2c8f28[_0x554f99(0x1cb)]!==undefined&&{'schedule':_0x2c8f28[_0x554f99(0x1cb)]},..._0x2c8f28[_0x554f99(0x178)]!==undefined&&{'notification':_0x2c8f28[_0x554f99(0x178)]},..._0x2c8f28[_0x554f99(0x169)]!==undefined&&{'connector_config':_0x2c8f28[_0x554f99(0x169)]},..._0x2c8f28['activation_template_id']!==undefined&&{'activation_template_id':_0x2c8f28[_0x554f99(0x12b)]}};return stableStringify(_0x4e5ccd);}export async function prepareSegmentFiles(_0x9f9869,_0x541422,_0x5c5aab,_0x117fe8,_0x4e7b5c){const _0x1b370e=a100_0x2c6966,{activationDefToCreateRequest:_0x2dfd51}=await import('./child-segment-yaml.js'),_0x2cd76c=[],_0x5b78db=new Set();for(const {yamlConfig:_0x51d93b,folderPath:_0x354d76,sourcePath:_0xb6d58f}of _0x9f9869){const _0x57f339=resolveTDFolderPath(_0x354d76,_0x117fe8,_0x4e7b5c),_0x22797b=_0x57f339+':'+_0x51d93b[_0x1b370e(0x141)],_0x248d07=_0x541422[_0x1b370e(0x148)][_0x1b370e(0x15b)](_0x22797b),_0x36db52=_0x248d07?_0x541422['activationsBySegmentId'][_0x1b370e(0x15b)](_0x248d07['id'])||[]:[];addFoldersToCreate(_0x57f339,_0x541422[_0x1b370e(0x135)],_0x5b78db);const _0x3a9e18=calculateActivationActions(_0x51d93b[_0x1b370e(0x13d)]||[],_0x36db52,_0x541422[_0x1b370e(0x124)],_0x541422[_0x1b370e(0x1a0)]);for(const _0x1dc16e of _0x3a9e18){(_0x1dc16e[_0x1b370e(0x134)]===_0x1b370e(0x17f)||_0x1dc16e['type']===_0x1b370e(0x1a7))&&_0x1dc16e[_0x1b370e(0x1c6)]&&(_0x1dc16e[_0x1b370e(0x157)]=await _0x2dfd51(_0x1dc16e[_0x1b370e(0x1c6)],_0x5c5aab));}const _0x321633=calculateSegmentDiff(_0x51d93b,_0x248d07,_0x36db52,_0x541422['idToEmailMap'],_0x541422[_0x1b370e(0x1a0)]);_0x2cd76c[_0x1b370e(0x1e2)]({'relativePath':_0x51d93b[_0x1b370e(0x141)],'absolutePath':_0xb6d58f,'yamlConfig':_0x51d93b,'folderPath':_0x57f339,'existingSegment':_0x248d07,'existingActivations':_0x36db52,'isNew':_0x321633[_0x1b370e(0x1fe)],'hasChanges':_0x321633[_0x1b370e(0x162)],'diff':_0x321633['diff'],'activationActions':_0x3a9e18});}return{'segmentFiles':_0x2cd76c,'foldersToCreate':_0x5b78db};}export async function prepareJourneyFiles(_0x4fe46a,_0x52d7a5,_0x32b2c4,_0x1c2816){const _0x2d7eef=a100_0x2c6966,_0x511f5f=[],_0x42e692=new Set();for(const {yamlConfig:_0x2c45e6,folderPath:_0x4d34dc,sourcePath:_0x546235}of _0x4fe46a){const _0x2456e6=resolveTDFolderPath(_0x4d34dc,_0x32b2c4,_0x1c2816),_0x2b009c=_0x2456e6+':'+_0x2c45e6[_0x2d7eef(0x141)],_0x365bd3=_0x52d7a5[_0x2d7eef(0x122)][_0x2d7eef(0x15b)](_0x2b009c);let _0x5fc2a,_0xa624f1;if(_0x365bd3&&_0x365bd3[_0x2d7eef(0x1d8)]>0x0){const _0x597d89=buildLocalExpandedRuleMappings(_0x2c45e6),{createYamlContext:_0x3a8f33,prefetchJourneySegments:_0x3c5a2c}=createPushYamlContextForBundle(_0x52d7a5['deps'],_0x52d7a5['parentId'],_0x52d7a5['existingSegments'],_0x597d89,_0x52d7a5['idToEmailMap'],_0x52d7a5[_0x2d7eef(0x1a0)],_0x52d7a5[_0x2d7eef(0x1c2)],_0x52d7a5[_0x2d7eef(0x1fa)]);await _0x3c5a2c(_0x365bd3[_0x2d7eef(0x1b5)](_0x4765fb=>_0x4765fb['id']));const _0x338a28=hasMultipleVersions(_0x2c45e6),_0x142efa=async _0x221e7e=>{const _0x4b4399=_0x2d7eef,_0x504ca7=_0x52d7a5['journeyById']?.[_0x4b4399(0x15b)](_0x221e7e);if(_0x504ca7)return _0x504ca7;return _0x52d7a5[_0x4b4399(0x172)]({'journeyId':_0x221e7e,'journeyName':_0x2c45e6[_0x4b4399(0x141)],'isMultiVersion':_0x365bd3['length']>0x1});};if(_0x338a28&&_0x365bd3[_0x2d7eef(0x1d8)]>0x1){const _0x27ad1e=[];for(const _0x568071 of _0x365bd3){const _0x19eb95=_0x568071[_0x2d7eef(0x1eb)]||0x1;_0x52d7a5[_0x2d7eef(0x1b3)]?.[_0x2d7eef(0x1a7)]('Fetching\x20'+_0x2c45e6[_0x2d7eef(0x141)]+'\x20v'+_0x19eb95);const _0x4b736e=await _0x142efa(_0x568071['id']),_0x420cf8=_0x3a8f33(_0x568071['id']),_0x56f54c=await journeyResponseToDef(_0x4b736e,_0x420cf8);_0x27ad1e['push']({'item':_0x568071,'yaml':_0x56f54c});}const _0x164fe3=buildLocalRuleToNameMappingFromJourney(_0x2c45e6);_0xa624f1=buildMergedJourneyDef(_0x27ad1e,_0x164fe3);const _0x598207=Math['max'](..._0x27ad1e[_0x2d7eef(0x1b5)](_0x28f687=>_0x28f687[_0x2d7eef(0x1ce)][_0x2d7eef(0x1eb)]||0x0)),_0x122f92=_0x365bd3[_0x2d7eef(0x133)](_0x18aba3=>(_0x18aba3[_0x2d7eef(0x1eb)]||0x0)===_0x598207);_0x122f92&&(_0x52d7a5['progress']?.[_0x2d7eef(0x1a7)]('Fetching\x20'+_0x2c45e6[_0x2d7eef(0x141)]+'\x20v'+_0x598207),_0x5fc2a=await _0x142efa(_0x122f92['id']));}else{const _0x335122=_0x365bd3[_0x365bd3[_0x2d7eef(0x1d8)]-0x1];_0x52d7a5['progress']?.['update'](_0x2d7eef(0x164)+_0x2c45e6[_0x2d7eef(0x141)]),_0x5fc2a=await _0x142efa(_0x335122['id']);const _0x3dd5d4=_0x3a8f33(_0x335122['id']),_0x3b583f=await journeyResponseToDef(_0x5fc2a,_0x3dd5d4),_0x13b8df=buildLocalRuleToNameMappingFromJourney(_0x2c45e6);_0xa624f1=buildMergedJourneyDef([{'item':_0x335122,'yaml':_0x3b583f}],_0x13b8df);}}addFoldersToCreate(_0x2456e6,_0x52d7a5[_0x2d7eef(0x135)],_0x42e692);const _0x1c86c9=calculateJourneyDiff(_0x2c45e6,_0xa624f1);_0x511f5f[_0x2d7eef(0x1e2)]({'relativePath':_0x2c45e6['name'],'absolutePath':_0x546235,'yamlConfig':_0x2c45e6,'folderPath':_0x2456e6,'existingJourney':_0x5fc2a,'isNew':_0x1c86c9[_0x2d7eef(0x1fe)],'hasChanges':_0x1c86c9[_0x2d7eef(0x162)],'diff':_0x1c86c9[_0x2d7eef(0x204)]});}return{'journeyFiles':_0x511f5f,'foldersToCreate':_0x42e692};}export function calculateActivationActions(_0x10ce7d,_0x30e9d4,_0x126e7e,_0x5014ae){const _0x1fd88d=a100_0x2c6966,_0x25d527=[],_0x2b02a2=new Map();for(const _0x1cef90 of _0x30e9d4){_0x2b02a2[_0x1fd88d(0x1f0)](_0x1cef90[_0x1fd88d(0x141)],_0x1cef90);}const _0x501323=new Map();for(const _0x53699c of _0x10ce7d){_0x501323[_0x1fd88d(0x1f0)](_0x53699c[_0x1fd88d(0x141)],_0x53699c);}for(const _0x1f7b99 of _0x10ce7d){const _0x391d98=_0x2b02a2[_0x1fd88d(0x15b)](_0x1f7b99[_0x1fd88d(0x141)]);if(!_0x391d98)_0x25d527['push']({'type':_0x1fd88d(0x17f),'name':_0x1f7b99[_0x1fd88d(0x141)],'yamlActivation':_0x1f7b99});else{const _0x700ef0=activationResponseToDef(_0x391d98,_0x126e7e,_0x5014ae),_0x3e328c=a100_0x4d5033[_0x1fd88d(0x158)](_0x700ef0),_0x2f7a01=a100_0x4d5033[_0x1fd88d(0x158)](_0x1f7b99);_0x3e328c!==_0x2f7a01&&_0x25d527['push']({'type':'update','name':_0x1f7b99[_0x1fd88d(0x141)],'yamlActivation':_0x1f7b99,'existingActivation':_0x391d98});}}for(const _0x1680ac of _0x30e9d4){!_0x501323[_0x1fd88d(0x1c3)](_0x1680ac[_0x1fd88d(0x141)])&&_0x25d527[_0x1fd88d(0x1e2)]({'type':_0x1fd88d(0x1e8),'name':_0x1680ac[_0x1fd88d(0x141)],'existingActivation':_0x1680ac});}return _0x25d527;}export function calculateSegmentDiff(_0x41b2b2,_0x4572ef,_0x397fcf,_0x67cfe5,_0x51e633){const _0xfbbb91=segmentToYamlString(_0x41b2b2);if(_0x4572ef){const _0x588b10=segmentWithActivationsToYaml(_0x4572ef,_0x397fcf,undefined,_0x67cfe5,_0x51e633),_0x5eb22=segmentToYamlString(_0x588b10),_0x4b3271=generateDiff(_0x5eb22,_0xfbbb91),_0x37727a=hasChanges(_0x4b3271);return{'isNew':![],'hasChanges':_0x37727a,'diff':_0x37727a?formatDiffWithColors(_0x4b3271):undefined};}const _0x550a0a=generateDiff('',_0xfbbb91);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x550a0a)};}export function calculateJourneyDiff(_0x1bd5c2,_0x5564ea){const _0x37fc5b=normalizeJourneyDef(_0x1bd5c2,_0x1bd5c2),_0x112a57=a100_0x5d57b2(_0x37fc5b);if(_0x5564ea){const _0x211a4e=normalizeJourneyDef(_0x5564ea,_0x1bd5c2),_0x544fe7=a100_0x5d57b2(_0x211a4e),_0x3bea3b=generateDiff(_0x544fe7,_0x112a57),_0x4dd332=hasChanges(_0x3bea3b);return{'isNew':![],'hasChanges':_0x4dd332,'diff':_0x4dd332?formatDiffWithColors(_0x3bea3b):undefined};}const _0x30ffc8=generateDiff('',_0x112a57);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x30ffc8)};}export function findSegmentsToDelete(_0x24bad7,_0x5cf907,_0x449c7a,_0x32983e,_0x49518d){const _0x4cd0ac=a100_0x2c6966,_0x4f6968=new Set();for(const {yamlConfig:_0x54faf2,folderPath:_0x5c4090}of _0x5cf907){_0x4f6968[_0x4cd0ac(0x18c)](_0x5c4090+':'+_0x54faf2['name']);}return _0x24bad7[_0x4cd0ac(0x1e3)](_0x421ba0=>{const _0x555897=_0x4cd0ac,_0x475c28=_0x421ba0[_0x555897(0x126)]?_0x449c7a[_0x555897(0x15b)](_0x421ba0[_0x555897(0x126)][_0x555897(0x1a8)]())||'':'',_0x7327f1=_0x475c28+':'+_0x421ba0[_0x555897(0x141)];if(_0x4f6968[_0x555897(0x1c3)](_0x7327f1))return![];if(_0x49518d)return _0x475c28===_0x32983e||_0x475c28['startsWith'](_0x32983e+'/');return!![];});}function a100_0xc29c(){const _0x3dd3a3=['folderPathToId','643727GzppJe','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','NOT_FOUND','split','user','segments','activations','journey_updating','Activation\x20not\x20found:\x20','journeyStages','name','Updating\x20activation\x20\x27','size','folderPath','Stage\x20\x27','\x27\x20for\x20','journeys','segmentByFolderAndName','parentSegmentFolder','createdSegmentId','activation_','parse','Creating\x20activation\x20\x27','null','__pending_act_','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','129467OTiljD','getActivation','journey_creating','Deleting\x20activation\x20\x27','journey_entry_criteria_','nameToType','validatedRequest','stringify','existingSegment','parentId','get','DecisionPoint','folder_created','yamlConfig','Activation','existingActivation','connection','hasChanges','existingSegments','Fetching\x20','journey','WaitStep','activation_deleting','104462nZOFhS','connector_config','localSegmentRules','created','unchanged','columns','from','relative','):\x20','./journey-yaml.js','fetchJourney','getJourney','entryCriteria','resolveSegment','Updated\x20activation\x20\x27','reduce','notification','logSuccess','updateSegmentById','deleteActivation','segmentId','journeyBundleName','Created\x20journey\x20\x27','create','segmentNameToId','entry_criteria','Updating\x20segment\x20\x27','13997070BejPZo','entries','Failed\x20to\x20','max','rootFolderId','list','logWarning','901800dEcGrC','segment_updated','add','errors','attributes','42zrMELG','parentFolder','updateActivation','embedded_segment_creating','activation_created','activationContext','valid','deleted','createdSegmentIds','\x27\x20from\x20file:\x20','journeyId','onProgress','all_columns','JOURNEY_UPDATE_ERROR','ACTIVATION_UPDATE_ERROR','activation_updated','nameToId','connectionIdToNameMap','\x20journey\x20from\x20file:\x20','activation_deleted','createFolder','createSegment','activationActions','existingJourney','update','toString','behavior','Created\x20activation\x20\x27','deleteSegment','folderId','journeyActivationNameToId','stage\x20\x27','Entry\x20criteria:\x20','flatMap','Deleted\x20segment\x20\x27','kind','progress','exitCriterias','map','embeddedSegmentNameToId','sha1','\x0a\x20\x20','action','Updated\x20segment\x20\x27','startsWith','goal','2560272EPoOIv','listActivations','trim','updated','withProgress','activationStepsById','has','20eLjBKj','Updated\x20journey\x20\x27','yamlActivation','JOURNEY_SYNTAX_ERROR','Deleted\x20activation\x20\x27','results','logDeleted','schedule','parseDocument','Creating\x20folder\x20\x27','item','rule','INTERNAL','verbose','segment_deleted','keys','\x27\x20not\x20found\x20in\x20journey\x20\x27','milestone','idToName','embedded_activation_creating','length','segment_deleting','Created\x20folder\x20\x27','createActivation','message','\x20(referenced\x20in\x20journey\x20','logInfo','journeyActivationStepId','stages','journey_updated','push','filter',').\x20','object','sort','branches','delete','slice','folder_creating','versionNumber','\x27\x20entry\x20criteria','segment','decision_point','waitCondition','set','dirname','SEGMENT_UPDATE_ERROR','relationships','SEGMENT_NOT_FOUND','segment_updating','replace','resolveJourneyId','steps','index','journeyById','skipSegments','includes','\x20activation\x20\x27','isNew','6329742JdbQss','data','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','absolutePath','getSegment','diff','\x27\x20wait\x20condition','Name\x20has\x20already\x20been\x20taken','Journey\x20\x27','join','SEGMENT_SYNTAX_ERROR','journeyBundlesByFolderAndName','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','idToEmailMap','\x27...','segmentFolderId','effectiveFolderId','../../utils/async.js','journey_created','__pending_','activation_template_id','activation_updating','Segment\x20not\x20found:\x20','toLowerCase','createJourneySegment','\x20segment\x20from\x20file:\x20','utf-8','description','find','type'];a100_0xc29c=function(){return _0x3dd3a3;};return a100_0xc29c();}export function findJourneysToDelete(_0x405051,_0x49aed2,_0x3d10bc,_0x340576,_0x40a849){const _0x581156=a100_0x2c6966,_0x26958d=new Set();for(const {yamlConfig:_0x179b64,folderPath:_0x347a1d}of _0x49aed2){_0x26958d[_0x581156(0x18c)](_0x347a1d+':'+_0x179b64[_0x581156(0x141)]);}return _0x405051['filter'](_0x59ecc4=>{const _0x2fc9c0=_0x581156,_0x29920f=_0x59ecc4[_0x2fc9c0(0x1ac)]?_0x3d10bc[_0x2fc9c0(0x15b)](_0x59ecc4[_0x2fc9c0(0x1ac)])||'':'',_0x4234b7=_0x29920f+':'+_0x59ecc4[_0x2fc9c0(0x17d)];if(_0x26958d[_0x2fc9c0(0x1c3)](_0x4234b7))return![];if(_0x40a849)return _0x29920f===_0x340576||_0x29920f[_0x2fc9c0(0x1bb)](_0x340576+'/');return!![];});}export function buildSegmentLookupMap(_0x2fc0e8,_0x4f50ca){const _0x30352c=a100_0x2c6966,_0x40f4a3=new Map();for(const _0x1eb5b8 of _0x2fc0e8){const _0xc9af2e=_0x1eb5b8[_0x30352c(0x126)]?_0x4f50ca[_0x30352c(0x15b)](_0x1eb5b8[_0x30352c(0x126)][_0x30352c(0x1a8)]())||'':'',_0x594c86=_0xc9af2e+':'+_0x1eb5b8[_0x30352c(0x141)];_0x40f4a3[_0x30352c(0x1f0)](_0x594c86,_0x1eb5b8);}return _0x40f4a3;}export function buildSegmentNameToIdMap(_0x4f3a92){const _0x58a033=new Map();for(const _0x460379 of _0x4f3a92){_0x58a033['set'](_0x460379['name'],_0x460379['id']);}return _0x58a033;}export function buildJourneyBundleLookupMap(_0x3fc685,_0x2b4758){const _0x183acb=a100_0x2c6966,_0x2bfe73=new Map();for(const _0x2baf28 of _0x3fc685){const _0x2f9469=_0x2baf28[_0x183acb(0x1ac)]?_0x2b4758['get'](_0x2baf28[_0x183acb(0x1ac)])||'':'',_0x4a9d85=_0x2f9469+':'+_0x2baf28[_0x183acb(0x17d)];!_0x2bfe73[_0x183acb(0x1c3)](_0x4a9d85)&&_0x2bfe73[_0x183acb(0x1f0)](_0x4a9d85,[]),_0x2bfe73[_0x183acb(0x15b)](_0x4a9d85)[_0x183acb(0x1e2)](_0x2baf28);}for(const _0x23d609 of _0x2bfe73['values']()){_0x23d609[_0x183acb(0x1e6)]((_0x410ed6,_0x461477)=>(_0x410ed6['versionNumber']||0x0)-(_0x461477[_0x183acb(0x1eb)]||0x0));}return _0x2bfe73;}export function collectFoldersToCreate(_0x5769b3,_0x142782){const _0x4e296f=a100_0x2c6966,_0x566e5f=new Set();for(const _0xc6b7fb of _0x5769b3){if(!_0xc6b7fb)continue;if(_0x142782['has'](_0xc6b7fb))continue;const _0x1a47f1=_0xc6b7fb[_0x4e296f(0x13a)]('/');let _0x3ca88e='';for(const _0x4dcb45 of _0x1a47f1){_0x3ca88e=_0x3ca88e?_0x3ca88e+'/'+_0x4dcb45:_0x4dcb45,!_0x142782['has'](_0x3ca88e)&&_0x566e5f['add'](_0x3ca88e);}}return _0x566e5f;}export function parseAndClassifyYamlFiles(_0x48bb48,_0x4f4d85,_0x5992ff){const _0x48c3cf=a100_0x2c6966,_0x73cd73=[],_0x5004fc=[];for(const _0x2b6451 of _0x48bb48){const _0x58ede7=a100_0x2afdb9[_0x48c3cf(0x16f)](_0x4f4d85,a100_0x2afdb9[_0x48c3cf(0x1f1)](_0x2b6451)),_0x49ac6f=_0x58ede7==='.'?'':_0x58ede7,_0xf812d7=readFileSync(_0x2b6451,_0x48c3cf(0x131)),_0x17e0d3=a100_0x4d5033[_0x48c3cf(0x14c)](_0xf812d7);if(isJourneyDef(_0x17e0d3)){const _0x309801=a100_0x31baf0(_0xf812d7);_0x5004fc['push']({'yamlConfig':_0x309801,'folderPath':_0x49ac6f,'sourcePath':_0x2b6451});}else{if(!_0x5992ff?.[_0x48c3cf(0x1fb)]){const _0x266bf9=parseSegmentYamlFile(_0xf812d7),_0x501599=normalizeChildSegmentYaml(_0x266bf9);_0x73cd73[_0x48c3cf(0x1e2)]({'yamlConfig':_0x501599,'folderPath':_0x49ac6f,'sourcePath':_0x2b6451});}}}return{'segments':_0x73cd73,'journeys':_0x5004fc};}export function validateParsedFiles(_0x59ce4e,_0x455acd){const _0x54db29=a100_0x2c6966,_0x175b89=[];for(const {yamlConfig:_0x2cd831,sourcePath:_0x5f050d}of _0x59ce4e[_0x54db29(0x13c)]){const _0x3738e3=readFileSync(_0x5f050d,_0x54db29(0x131)),_0x34ffe7=a100_0x4d5033[_0x54db29(0x1cc)](_0x3738e3),_0x204151=validateSegmentDef(_0x2cd831,{'source':_0x3738e3,'document':_0x34ffe7});if(!_0x204151[_0x54db29(0x195)]){const _0x119c9a=a100_0x2afdb9[_0x54db29(0x16f)](_0x455acd,_0x5f050d);_0x175b89['push']({'filePath':_0x119c9a,'source':_0x3738e3,'result':_0x204151,'isJourney':![]});}}for(const {yamlConfig:_0x16e817,sourcePath:_0x35c427}of _0x59ce4e['journeys']){const _0x490a1a=readFileSync(_0x35c427,_0x54db29(0x131)),_0x3a80c0=a100_0x4d5033[_0x54db29(0x1cc)](_0x490a1a),_0x535e4d=validateJourneyDef(_0x16e817,{'source':_0x490a1a,'document':_0x3a80c0});if(!_0x535e4d['valid']){const _0x2575ee=a100_0x2afdb9[_0x54db29(0x16f)](_0x455acd,_0x35c427);_0x175b89[_0x54db29(0x1e2)]({'filePath':_0x2575ee,'source':_0x490a1a,'result':_0x535e4d,'isJourney':!![]});}}return _0x175b89;}export function formatValidationErrors(_0x33674b){const _0x665e61=a100_0x2c6966,_0x277816=[];for(const {filePath:_0xb14679,source:_0x3efd3b,result:_0x5a1f2e,isJourney:_0x43c5f5}of _0x33674b){const _0x340e8b=_0x43c5f5?_0x665e61(0x165):_0x665e61(0x1ed);_0x277816[_0x665e61(0x1e2)]('\x0a'+_0xb14679+'\x20('+_0x340e8b+_0x665e61(0x170)+_0x5a1f2e[_0x665e61(0x18d)]['length']+'\x20error(s)'),_0x277816[_0x665e61(0x1e2)](formatValidationResult(_0x5a1f2e,_0x3efd3b,_0xb14679));}return _0x277816['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x181688){const _0x76bba3=a100_0x2c6966,_0x17dda3=new Set(),_0x176165=new Map(),_0x4f4328=collectSegmentUsageCounts(_0x181688);if(_0x181688[_0x76bba3(0x13c)])for(const [_0x597bc9,_0x344055]of Object[_0x76bba3(0x184)](_0x181688['segments'])){_0x17dda3[_0x76bba3(0x18c)](_0x597bc9);if(_0x344055[_0x76bba3(0x1cf)]){const _0x441870=yamlRuleToApi(_0x344055['rule']),_0x40e8ff=apiRuleToYaml(_0x441870);_0x176165[_0x76bba3(0x1f0)](_0x597bc9,_0x40e8ff);}}const _0x48753b=new Map();let _0x47e397=0x0;for(const [_0x249246,_0x98e36f]of _0x176165){const _0x9fbda2=serializeExpandedRule(_0x98e36f,_0x176165),_0x5354be=_0x48753b[_0x76bba3(0x15b)](_0x9fbda2)||[];_0x5354be[_0x76bba3(0x1e2)]({'name':_0x249246,'index':_0x47e397}),_0x48753b[_0x76bba3(0x1f0)](_0x9fbda2,_0x5354be),_0x47e397++;}const _0x14dcac=new Map();for(const [_0x308968,_0x1acc55]of _0x48753b){const _0x1d3c5b=_0x1acc55[_0x76bba3(0x1e9)]()[_0x76bba3(0x1e6)]((_0xc91148,_0x54baf6)=>{const _0x237838=_0x76bba3,_0x267218=_0x4f4328[_0x237838(0x15b)](_0xc91148[_0x237838(0x141)])||0x0,_0xa88ab0=_0x4f4328[_0x237838(0x15b)](_0x54baf6[_0x237838(0x141)])||0x0;if(_0x267218!==_0xa88ab0)return _0xa88ab0-_0x267218;return _0xc91148[_0x237838(0x1f9)]-_0x54baf6['index'];})[_0x76bba3(0x1b5)](_0x35e4df=>_0x35e4df['name']),_0x5c3e93=[];for(const _0x1bc31f of _0x1d3c5b){const _0x5b1aa8=_0x4f4328[_0x76bba3(0x15b)](_0x1bc31f)||0x0,_0x16d6e3=Math[_0x76bba3(0x186)](_0x5b1aa8,0x1);for(let _0x4a629e=0x0;_0x4a629e<_0x16d6e3;_0x4a629e++){_0x5c3e93[_0x76bba3(0x1e2)](_0x1bc31f);}}_0x14dcac[_0x76bba3(0x1f0)](_0x308968,_0x5c3e93);}return{'existingLocalSegmentNames':_0x17dda3,'localSegmentRules':_0x176165,'localExpandedRuleToNames':_0x14dcac};}async function buildServerSegmentRuleMap(_0xe923f6,_0x3b92f2,_0x217f43,_0x31baba){const _0x16d1aa=new Map(),_0x4e8b4d=new Set(),_0x57e489=async _0x170d96=>{const _0x49dc0d=a100_0x1a9a;if(_0x4e8b4d[_0x49dc0d(0x1c3)](_0x170d96))return;_0x4e8b4d['add'](_0x170d96);let _0x37a11a=_0x217f43[_0x49dc0d(0x133)](_0x13d12f=>_0x13d12f['id']===_0x170d96);if(!_0x37a11a)try{_0x37a11a=await _0xe923f6[_0x49dc0d(0x1ed)][_0x49dc0d(0x203)](_0x3b92f2,_0x170d96);}catch{return;}if(!_0x37a11a?.[_0x49dc0d(0x1cf)])return;const _0x38766a=apiRuleToYaml(_0x37a11a[_0x49dc0d(0x1cf)]);_0x16d1aa[_0x49dc0d(0x1f0)](_0x170d96,_0x38766a);const _0x10b227=collectSegmentRefsFromRule(_0x38766a);for(const _0x2bc660 of _0x10b227){await _0x57e489(_0x2bc660);}};for(const _0x4550f5 of _0x31baba){await _0x57e489(_0x4550f5);}return _0x16d1aa;}export function createSegmentIdResolver(_0x542a50,_0x535e19){return async _0x34d329=>{const _0x2fe15d=a100_0x1a9a,_0x4a3631=_0x542a50[_0x2fe15d(0x15b)](_0x34d329);if(!_0x4a3631)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2fe15d(0x12d)+_0x34d329+_0x2fe15d(0x123)+_0x535e19+'\x27)');return _0x4a3631;};}export function extractRootFolderId(_0x47a155){const _0x33c9fd=a100_0x2c6966;return _0x47a155['relationships']?.[_0x33c9fd(0x149)]?.['data']?.['id']||_0x47a155[_0x33c9fd(0x1f3)]?.[_0x33c9fd(0x190)]?.[_0x33c9fd(0x200)]?.['id'];}export function buildConnectionMaps(_0x4189ff){const _0x5b3019=a100_0x2c6966,_0x55c0a4=new Map(),_0x2196de=new Map(),_0x5b2288=new Map();for(const _0x2c65c3 of _0x4189ff){_0x55c0a4[_0x5b3019(0x1f0)](_0x2c65c3[_0x5b3019(0x141)],parseInt(_0x2c65c3['id'],0xa)),_0x2196de[_0x5b3019(0x1f0)](_0x2c65c3['id'],_0x2c65c3[_0x5b3019(0x141)]),_0x5b2288['set'](_0x2c65c3['name'],_0x2c65c3['type']);}return{'nameToId':_0x55c0a4,'idToName':_0x2196de,'nameToType':_0x5b2288};}export function calculatePushStats(_0x5db953,_0x4c17b4,_0x99d5dd,_0x4976e8,_0x36d7fd,_0x32e070,_0x1c038f){const _0x59151=a100_0x2c6966,_0x109394=_0x5db953[_0x59151(0x1e3)](_0x420223=>_0x420223[_0x59151(0x1fe)]),_0x45d844=_0x5db953[_0x59151(0x1e3)](_0x42ccc9=>!_0x42ccc9['isNew']&&_0x42ccc9[_0x59151(0x162)]),_0x12b18f=_0x5db953[_0x59151(0x1e3)](_0xe66fbc=>!_0xe66fbc[_0x59151(0x1fe)]&&!_0xe66fbc['hasChanges']),_0x29f608=_0x32e070?_0x4976e8:[],_0x56a827=_0x4c17b4[_0x59151(0x1e3)](_0x59238d=>_0x59238d[_0x59151(0x1fe)]),_0xe2b0c=_0x4c17b4[_0x59151(0x1e3)](_0x6735a3=>!_0x6735a3[_0x59151(0x1fe)]&&_0x6735a3[_0x59151(0x162)]),_0xd17fa2=_0x4c17b4[_0x59151(0x1e3)](_0x528389=>!_0x528389[_0x59151(0x1fe)]&&!_0x528389[_0x59151(0x162)]),_0x23b378=_0x32e070?_0x36d7fd:[],_0x4a3e74=_0x5db953[_0x59151(0x1b0)](_0x5736d8=>_0x5736d8[_0x59151(0x1a5)]),_0x499e28=_0x4a3e74[_0x59151(0x1e3)](_0x1cf1d9=>_0x1cf1d9[_0x59151(0x134)]===_0x59151(0x17f)),_0x14213b=_0x4a3e74[_0x59151(0x1e3)](_0x54570c=>_0x54570c[_0x59151(0x134)]===_0x59151(0x1a7)),_0xaebe83=_0x4a3e74['filter'](_0x15b2e1=>_0x15b2e1[_0x59151(0x134)]==='delete'),_0x8130cd=Array[_0x59151(0x16e)](_0x99d5dd)['sort'](),_0x35fc6b=_0x1c038f?![]:_0x109394[_0x59151(0x1d8)]>0x0||_0x45d844[_0x59151(0x1d8)]>0x0||_0x29f608[_0x59151(0x1d8)]>0x0,_0x301fb4=_0x56a827[_0x59151(0x1d8)]>0x0||_0xe2b0c['length']>0x0||_0x23b378[_0x59151(0x1d8)]>0x0,_0xaf62ee=_0x1c038f?![]:_0x4a3e74[_0x59151(0x1d8)]>0x0,_0x55bf72=_0x8130cd[_0x59151(0x1d8)]>0x0;return{'segments':{'new':_0x109394,'changed':_0x45d844,'unchanged':_0x12b18f,'toDelete':_0x29f608},'journeys':{'new':_0x56a827,'changed':_0xe2b0c,'unchanged':_0xd17fa2,'toDelete':_0x23b378},'activations':{'all':_0x4a3e74,'toCreate':_0x499e28,'toUpdate':_0x14213b,'toDelete':_0xaebe83},'folders':{'toCreate':_0x8130cd},'counts':{'segments':{'new':_0x109394[_0x59151(0x1d8)],'changed':_0x45d844['length'],'unchanged':_0x12b18f[_0x59151(0x1d8)],'toDelete':_0x29f608[_0x59151(0x1d8)]},'journeys':{'new':_0x56a827[_0x59151(0x1d8)],'changed':_0xe2b0c[_0x59151(0x1d8)],'unchanged':_0xd17fa2['length'],'toDelete':_0x23b378[_0x59151(0x1d8)]},'activations':{'create':_0x499e28[_0x59151(0x1d8)],'update':_0x14213b[_0x59151(0x1d8)],'delete':_0xaebe83[_0x59151(0x1d8)]},'folders':_0x8130cd['length']},'hasChanges':_0x35fc6b||_0x301fb4||_0xaf62ee||_0x55bf72};}export async function buildPushExecutionContext(_0x550c3a,_0x3750fd,_0x34cdce,_0x36cd8e,_0x542c84,_0x4d35d3){const _0x10404a=a100_0x2c6966,_0x38c27a=extractRootFolderId(_0x34cdce),{pathToId:_0x540db,idToPath:_0x2f4ae1}=buildFolderMaps(_0x542c84),_0x557db4=buildSegmentNameToIdMap(_0x36cd8e),_0x43e659=new Map(),{batchAsync:_0x18790d}=await import(_0x10404a(0x128)),[_0x486eb6,_0x43da40]=await Promise['all']([_0x550c3a[_0x10404a(0x13b)]['buildUserMaps'](),_0x550c3a[_0x10404a(0x161)][_0x10404a(0x188)](),((async()=>{!_0x4d35d3&&_0x36cd8e['length']>0x0&&await _0x18790d(_0x36cd8e,async _0x19008f=>{const _0x2819e0=a100_0x1a9a,_0x27c654=await _0x550c3a['segment'][_0x2819e0(0x1be)](_0x3750fd,_0x19008f['id']);_0x43e659[_0x2819e0(0x1f0)](_0x19008f['id'],_0x27c654);});})())]),{emailToId:_0x20dec5,idToEmail:_0x586d8d}=_0x486eb6,_0x3de31b=buildConnectionMaps(_0x43da40);return{'rootFolderId':_0x38c27a,'folderPathToId':_0x540db,'folderIdToPath':_0x2f4ae1,'segmentNameToId':_0x557db4,'activationsBySegmentId':_0x43e659,'emailToIdMap':_0x20dec5,'idToEmailMap':_0x586d8d,'connectionNameToIdMap':_0x3de31b[_0x10404a(0x19f)],'connectionIdToNameMap':_0x3de31b[_0x10404a(0x1d6)],'connectionNameToTypeMap':_0x3de31b[_0x10404a(0x156)]};}export function createPushYamlContextForBundle(_0x2839fb,_0x726bdf,_0x413e7d,_0x35f02e,_0x102c17,_0x40ef97,_0x3e0075,_0x1721c2){const {existingLocalSegmentNames:_0x1c7463,localExpandedRuleToNames:_0x284dba}=_0x35f02e,_0x285720=new Set(),_0x20e751=new Map(),_0x17a420=new Map(),_0x26b65d=new Map(),_0x12b90b=createJumpTargetCache(),_0x52c99f=new Map(),_0x568233=new Map(),_0x2a0089=new Set();let _0x54ec88;const _0x5b85ff=_0x214cc9=>{const _0x4e33a4={'resolveSegment':async _0x24ffe5=>{const _0x5e9db4=a100_0x1a9a,_0x44e583=_0x26b65d[_0x5e9db4(0x15b)](_0x24ffe5);if(_0x44e583!==undefined)return{'name':_0x44e583,'isJourneyLocal':!![]};try{let _0x307394=_0x413e7d[_0x5e9db4(0x133)](_0x25dc34=>_0x25dc34['id']===_0x24ffe5);!_0x307394&&(_0x307394=await _0x2839fb[_0x5e9db4(0x1ed)][_0x5e9db4(0x203)](_0x726bdf,_0x24ffe5));const _0x22d281=generateJourneyLocalName(_0x307394[_0x5e9db4(0x141)]),_0x5e31bf=_0x307394[_0x5e9db4(0x1b2)]===SEGMENT_KIND_JOURNEY&&_0x22d281!==undefined;let _0x166f4d=_0x307394[_0x5e9db4(0x141)],_0x2b1875;if(_0x5e31bf&&_0x307394[_0x5e9db4(0x1cf)]){const _0x13c08f=apiRuleToYaml(_0x307394[_0x5e9db4(0x1cf)]);_0x568233[_0x5e9db4(0x1f0)](_0x24ffe5,_0x13c08f);const _0x7f8d46=async _0x2a1607=>{const _0x4336be=_0x5e9db4,_0xf8922=collectSegmentRefsFromRule(_0x2a1607);for(const _0x411d07 of _0xf8922){if(!_0x568233[_0x4336be(0x1c3)](_0x411d07))try{const _0x5beaeb=await _0x2839fb[_0x4336be(0x1ed)]['getSegment'](_0x726bdf,_0x411d07);if(_0x5beaeb?.[_0x4336be(0x1cf)]){const _0x4870e6=apiRuleToYaml(_0x5beaeb[_0x4336be(0x1cf)]);_0x568233['set'](_0x411d07,_0x4870e6),await _0x7f8d46(_0x4870e6);}}catch{}}};await _0x7f8d46(_0x13c08f);const _0x45e68d=serializeExpandedRule(_0x13c08f,_0x568233),_0x4f88fd=_0x284dba[_0x5e9db4(0x15b)](_0x45e68d);if(_0x4f88fd&&_0x4f88fd[_0x5e9db4(0x1d8)]>0x0){const _0x2af351=_0x20e751['get'](_0x45e68d)||0x0,_0x1c4664=_0x4f88fd[_0x2af351]||_0x4f88fd[_0x4f88fd[_0x5e9db4(0x1d8)]-0x1];_0x20e751['set'](_0x45e68d,_0x2af351+0x1),_0x166f4d=_0x1c4664,_0x285720[_0x5e9db4(0x18c)](_0x166f4d),_0x26b65d[_0x5e9db4(0x1f0)](_0x24ffe5,_0x166f4d);const _0x1feec6=await resolveRuleSegmentRefs(_0x13c08f,async _0x3adde8=>{const _0x5272dc=_0x5e9db4,_0x193cae=_0x26b65d[_0x5272dc(0x15b)](_0x3adde8);if(_0x193cae)return _0x193cae;const _0x5be809=await _0x54ec88[_0x5272dc(0x175)](_0x3adde8);return _0x5be809[_0x5272dc(0x141)];});_0x2b1875={'description':_0x307394['description'],'rule':_0x1feec6};}else{const _0x2fbbf1=_0x52c99f[_0x5e9db4(0x15b)](_0x45e68d);if(_0x2fbbf1)_0x166f4d=_0x2fbbf1,_0x26b65d['set'](_0x24ffe5,_0x166f4d);else{if(_0x22d281){let _0x2f06d2=_0x22d281,_0x136b8f=0x2;while(_0x285720[_0x5e9db4(0x1c3)](_0x2f06d2)||_0x1c7463['has'](_0x2f06d2)){_0x2f06d2=_0x22d281+'_'+_0x136b8f,_0x136b8f++;}_0x285720[_0x5e9db4(0x18c)](_0x2f06d2),_0x166f4d=_0x2f06d2;}_0x26b65d['set'](_0x24ffe5,_0x166f4d),_0x52c99f[_0x5e9db4(0x1f0)](_0x45e68d,_0x166f4d);const _0x37a15f=await resolveRuleSegmentRefs(_0x13c08f,async _0x5a48c0=>{const _0x22daff=_0x5e9db4,_0x35a6c3=_0x26b65d[_0x22daff(0x15b)](_0x5a48c0);if(_0x35a6c3)return _0x35a6c3;const _0x5bce13=await _0x54ec88[_0x22daff(0x175)](_0x5a48c0);return _0x5bce13[_0x22daff(0x141)];});_0x2b1875={'description':_0x307394['description'],'rule':_0x37a15f};}}}return{'name':_0x166f4d,'isJourneyLocal':_0x5e31bf,'definition':_0x2b1875};}catch{return{'name':_0x24ffe5,'isJourneyLocal':![]};}},'resolveActivation':async _0x474ba3=>{const _0x3f91b1=a100_0x1a9a,_0x162f00=_0x17a420[_0x3f91b1(0x15b)](_0x474ba3);if(_0x162f00!==undefined)return{'name':_0x162f00,'isJourneyLocal':!![]};try{let _0x480f05=_0x3e0075?.['get'](_0x474ba3);!_0x480f05&&(_0x480f05=await _0x2839fb[_0x3f91b1(0x165)][_0x3f91b1(0x152)](_0x214cc9,_0x474ba3));const _0x528feb=_0x480f05[_0x3f91b1(0x18e)]['activationParams'][_0x3f91b1(0x141)]||_0x474ba3,_0x52389f=sanitizeYamlKey(_0x528feb)||_0x3f91b1(0x14b)+_0x474ba3,_0x47ea7e=_0x52389f;_0x17a420[_0x3f91b1(0x1f0)](_0x474ba3,_0x47ea7e);const _0x34d30e=journeyActivationStepToYaml(_0x480f05,_0x102c17,_0x40ef97);return{'name':_0x47ea7e,'isJourneyLocal':!![],'definition':_0x34d30e};}catch{return{'name':_0x474ba3,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x508292,_0x2c401a)=>resolveJumpTarget(_0x508292,_0x2c401a,_0x12b90b,async _0x361f4f=>{const _0x128fbe=a100_0x1a9a,_0x3e1936=_0x1721c2?.[_0x128fbe(0x15b)](_0x361f4f);if(_0x3e1936)return _0x3e1936;return _0x2839fb[_0x128fbe(0x165)][_0x128fbe(0x173)](_0x361f4f);})};return _0x54ec88=_0x4e33a4,_0x4e33a4;},_0x5bffe9=async _0x107f01=>{const _0x2ff62b=a100_0x1a9a,{collectSegmentIdsFromJourneyApi:_0x30ac08}=await import(_0x2ff62b(0x171)),{batchAsync:_0x3f041b}=await import(_0x2ff62b(0x128)),_0x22ca48=new Set();for(const _0xdc2f2b of _0x107f01){let _0x36b2f6=_0x1721c2?.[_0x2ff62b(0x15b)](_0xdc2f2b);!_0x36b2f6&&(_0x36b2f6=await _0x2839fb[_0x2ff62b(0x165)][_0x2ff62b(0x173)](_0xdc2f2b));const _0x125afa=_0x30ac08(_0x36b2f6);for(const _0x43d959 of _0x125afa){_0x22ca48[_0x2ff62b(0x18c)](_0x43d959);}}let _0x976323=Array[_0x2ff62b(0x16e)](_0x22ca48);while(_0x976323[_0x2ff62b(0x1d8)]>0x0){const _0x642fdb=_0x976323[_0x2ff62b(0x1e3)](_0xdcf912=>!_0x2a0089[_0x2ff62b(0x1c3)](_0xdcf912));if(_0x642fdb[_0x2ff62b(0x1d8)]===0x0)break;const _0xb0bef9=await _0x3f041b(_0x642fdb,async _0xfd2ed6=>{const _0x41fd1d=_0x2ff62b;_0x2a0089[_0x41fd1d(0x18c)](_0xfd2ed6);let _0x3ae1ce=_0x413e7d[_0x41fd1d(0x133)](_0x1ea704=>_0x1ea704['id']===_0xfd2ed6);if(!_0x3ae1ce)try{_0x3ae1ce=await _0x2839fb['segment'][_0x41fd1d(0x203)](_0x726bdf,_0xfd2ed6);}catch{return null;}return{'segmentId':_0xfd2ed6,'segment':_0x3ae1ce};},0xa),_0xee5e1c=new Set();for(const _0x175825 of _0xb0bef9){if(!_0x175825?.[_0x2ff62b(0x1ed)]?.[_0x2ff62b(0x1cf)])continue;const _0x53f6e4=apiRuleToYaml(_0x175825[_0x2ff62b(0x1ed)][_0x2ff62b(0x1cf)]);_0x568233[_0x2ff62b(0x1f0)](_0x175825['segmentId'],_0x53f6e4);const _0x128cc1=collectSegmentRefsFromRule(_0x53f6e4);for(const _0x55e877 of _0x128cc1){!_0x2a0089[_0x2ff62b(0x1c3)](_0x55e877)&&_0xee5e1c[_0x2ff62b(0x18c)](_0x55e877);}}_0x976323=Array[_0x2ff62b(0x16e)](_0xee5e1c);}};return{'createYamlContext':_0x5b85ff,'prefetchJourneySegments':_0x5bffe9};}export async function executePushSegments(_0x3050cf,_0x35f422,_0x290fc8,_0x46be33,_0x21a96b){const _0x4bec79=a100_0x2c6966,{segmentDefToCreateRequest:_0x5bf96c,segmentDefToUpdateRequest:_0xceb7ed}=await import('./child-segment-yaml.js'),_0x33ff1e=_0x290fc8[_0x4bec79(0x135)],_0x285d2c=0x5,_0x52a029=async _0x4a5271=>{const _0xf355ff=_0x4bec79,_0x2701c4=_0x4a5271['folderPath']?_0x33ff1e['get'](_0x4a5271['folderPath']):undefined;let _0x219d53;const _0x39964a={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x4a5271['isNew']){_0x21a96b['onProgress']?.({'type':'segment_creating','name':_0x4a5271['yamlConfig']['name']});const _0x423e8e=_0x5bf96c(_0x4a5271['yamlConfig'],_0x2701c4),_0x7f2188=await _0x21a96b[_0xf355ff(0x1c1)]('Creating\x20segment\x20\x27'+_0x4a5271['yamlConfig'][_0xf355ff(0x141)]+'\x27...',()=>_0x3050cf[_0xf355ff(0x1ed)][_0xf355ff(0x1a4)](_0x46be33[_0xf355ff(0x15a)],_0x423e8e));_0x219d53=_0x7f2188[_0xf355ff(0x200)]['id'],_0x39964a[_0xf355ff(0x14a)]={'name':_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)],'id':_0x219d53},_0x21a96b[_0xf355ff(0x19a)]?.({'type':'segment_created','name':_0x4a5271['yamlConfig']['name'],'segmentId':_0x219d53}),_0x21a96b[_0xf355ff(0x179)]?.('Created\x20segment\x20\x27'+_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]+'\x27'),_0x39964a[_0xf355ff(0x16b)]=0x1;}else{if(_0x4a5271['hasChanges']){_0x21a96b['onProgress']?.({'type':_0xf355ff(0x1f5),'name':_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]});const _0x5c4258=_0xceb7ed(_0x4a5271[_0xf355ff(0x15e)]);_0x2701c4!==_0x4a5271['existingSegment']?.[_0xf355ff(0x126)]&&(_0x5c4258['segmentFolderId']=_0x2701c4?parseInt(_0x2701c4,0xa):undefined),await _0x21a96b[_0xf355ff(0x1c1)](_0xf355ff(0x182)+_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]+_0xf355ff(0x125),()=>_0x3050cf[_0xf355ff(0x1ed)][_0xf355ff(0x17a)](_0x46be33[_0xf355ff(0x15a)],_0x4a5271[_0xf355ff(0x159)]['id'],_0x5c4258)),_0x219d53=_0x4a5271[_0xf355ff(0x159)]['id'],_0x21a96b[_0xf355ff(0x19a)]?.({'type':_0xf355ff(0x18b),'name':_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]}),_0x21a96b[_0xf355ff(0x179)]?.(_0xf355ff(0x1ba)+_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]+'\x27'),_0x39964a['updated']=0x1;}else _0x219d53=_0x4a5271[_0xf355ff(0x159)]['id'];}}catch(_0x3c9986){const _0x520a4e=isHttp400Error(_0x3c9986),_0x41ae7a=_0x520a4e?ErrorCode[_0xf355ff(0x121)]:ErrorCode[_0xf355ff(0x1f2)],_0x2afff5=getErrorMessage(_0x3c9986);throw new SDKError(_0x41ae7a,_0xf355ff(0x185)+(_0x4a5271['isNew']?_0xf355ff(0x17f):_0xf355ff(0x1a7))+_0xf355ff(0x130)+_0x4a5271[_0xf355ff(0x202)]+_0xf355ff(0x1b8)+_0x2afff5,_0x3c9986);}try{const _0x5ca10f=await syncActivationsForSegment(_0x3050cf,_0x46be33[_0xf355ff(0x15a)],_0x219d53,_0x4a5271['yamlConfig'][_0xf355ff(0x141)],_0x4a5271[_0xf355ff(0x1a5)],_0x21a96b,_0x4a5271['absolutePath']);_0x39964a[_0xf355ff(0x13d)]=_0x5ca10f;}catch(_0x1fd7cc){if(_0x1fd7cc instanceof SDKError)throw _0x1fd7cc;throw new SDKError(ErrorCode[_0xf355ff(0x19d)],_0xf355ff(0x201)+_0x4a5271['yamlConfig'][_0xf355ff(0x141)]+_0xf355ff(0x198)+_0x4a5271[_0xf355ff(0x202)]+_0xf355ff(0x1b8)+getErrorMessage(_0x1fd7cc),_0x1fd7cc);}return _0x39964a;},_0x4c7465=await batchAsync(_0x35f422,_0x52a029,_0x285d2c),_0x562fa6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x19e8f4 of _0x4c7465){_0x562fa6[_0x4bec79(0x16b)]+=_0x19e8f4[_0x4bec79(0x16b)],_0x562fa6[_0x4bec79(0x1c0)]+=_0x19e8f4['updated'],_0x19e8f4[_0x4bec79(0x14a)]&&_0x562fa6[_0x4bec79(0x197)][_0x4bec79(0x1f0)](_0x19e8f4[_0x4bec79(0x14a)][_0x4bec79(0x141)],_0x19e8f4[_0x4bec79(0x14a)]['id']),_0x562fa6['activations'][_0x4bec79(0x16b)]+=_0x19e8f4[_0x4bec79(0x13d)][_0x4bec79(0x16b)],_0x562fa6[_0x4bec79(0x13d)][_0x4bec79(0x1c0)]+=_0x19e8f4[_0x4bec79(0x13d)][_0x4bec79(0x1c0)],_0x562fa6[_0x4bec79(0x13d)][_0x4bec79(0x196)]+=_0x19e8f4[_0x4bec79(0x13d)][_0x4bec79(0x196)];}return _0x562fa6;}async function syncActivationsForSegment(_0x31c8d1,_0x26b714,_0x643687,_0x1dc78e,_0x45ec5d,_0x3ffa3b,_0x4d61a4){const _0x189d60=a100_0x2c6966,_0x12a559={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1c9abc of _0x45ec5d){try{if(_0x1c9abc[_0x189d60(0x134)]===_0x189d60(0x17f)&&_0x1c9abc[_0x189d60(0x157)])_0x3ffa3b['onProgress']?.({'type':'activation_creating','segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),await _0x3ffa3b[_0x189d60(0x1c1)](_0x189d60(0x14d)+_0x1c9abc['name']+'\x27...',()=>_0x31c8d1[_0x189d60(0x1ed)][_0x189d60(0x1db)](_0x26b714,_0x643687,_0x1c9abc[_0x189d60(0x157)])),_0x3ffa3b[_0x189d60(0x19a)]?.({'type':_0x189d60(0x193),'segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),_0x3ffa3b['logSuccess']?.(_0x189d60(0x1aa)+_0x1c9abc[_0x189d60(0x141)]+'\x27'),_0x12a559[_0x189d60(0x16b)]++;else{if(_0x1c9abc[_0x189d60(0x134)]==='update'&&_0x1c9abc[_0x189d60(0x157)]&&_0x1c9abc[_0x189d60(0x160)])_0x3ffa3b['onProgress']?.({'type':_0x189d60(0x12c),'segmentName':_0x1dc78e,'activationName':_0x1c9abc['name']}),await _0x3ffa3b['withProgress'](_0x189d60(0x142)+_0x1c9abc[_0x189d60(0x141)]+'\x27...',()=>_0x31c8d1[_0x189d60(0x1ed)][_0x189d60(0x191)](_0x26b714,_0x643687,_0x1c9abc[_0x189d60(0x160)]['id'],_0x1c9abc[_0x189d60(0x157)])),_0x3ffa3b['onProgress']?.({'type':_0x189d60(0x19e),'segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),_0x3ffa3b[_0x189d60(0x179)]?.(_0x189d60(0x176)+_0x1c9abc[_0x189d60(0x141)]+'\x27'),_0x12a559[_0x189d60(0x1c0)]++;else _0x1c9abc['type']===_0x189d60(0x1e8)&&_0x1c9abc[_0x189d60(0x160)]&&(_0x3ffa3b[_0x189d60(0x19a)]?.({'type':_0x189d60(0x167),'segmentName':_0x1dc78e,'activationName':_0x1c9abc['name']}),await _0x3ffa3b[_0x189d60(0x1c1)](_0x189d60(0x154)+_0x1c9abc[_0x189d60(0x141)]+_0x189d60(0x125),()=>_0x31c8d1[_0x189d60(0x1ed)][_0x189d60(0x17b)](_0x26b714,_0x643687,_0x1c9abc[_0x189d60(0x160)]['id'])),_0x3ffa3b['onProgress']?.({'type':_0x189d60(0x1a2),'segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),_0x3ffa3b[_0x189d60(0x1ca)]?.(_0x189d60(0x1c8)+_0x1c9abc[_0x189d60(0x141)]+'\x27'),_0x12a559[_0x189d60(0x196)]++);}}catch(_0x59a2e1){const _0x4bd094=isHttp400Error(_0x59a2e1),_0x2e9072=_0x4bd094?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x189d60(0x19d)],_0x36ce53=getErrorMessage(_0x59a2e1);throw new SDKError(_0x2e9072,_0x189d60(0x185)+_0x1c9abc[_0x189d60(0x134)]+_0x189d60(0x1fd)+_0x1c9abc[_0x189d60(0x141)]+_0x189d60(0x198)+_0x4d61a4+_0x189d60(0x1b8)+_0x36ce53,_0x59a2e1);}}return _0x12a559;}export async function executePushFolders(_0x5706c1,_0x566a17,_0x1396cd,_0x5e29a5,_0x388914){const _0x176c03=a100_0x2c6966,_0x42a2b1=new Map(_0x1396cd);for(const _0x371d8c of _0x566a17){const _0x4cc009=_0x371d8c[_0x176c03(0x13a)]('/'),_0xb75d00=_0x4cc009[_0x4cc009[_0x176c03(0x1d8)]-0x1],_0x36be52=_0x4cc009[_0x176c03(0x1e9)](0x0,-0x1)[_0x176c03(0x120)]('/'),_0x3c635c=_0x42a2b1[_0x176c03(0x15b)](_0x36be52);_0x388914[_0x176c03(0x19a)]?.({'type':_0x176c03(0x1ea),'folder':_0x371d8c});const _0x3c68d9={'name':_0xb75d00,'parentFolderId':_0x3c635c},_0x45881d=await _0x388914['withProgress'](_0x176c03(0x1cd)+_0x371d8c+'\x27...',()=>_0x5706c1[_0x176c03(0x1ed)][_0x176c03(0x1a3)](_0x5e29a5[_0x176c03(0x15a)],_0x3c68d9));_0x42a2b1[_0x176c03(0x1f0)](_0x371d8c,_0x45881d[_0x176c03(0x200)]['id']),_0x388914[_0x176c03(0x19a)]?.({'type':_0x176c03(0x15d),'folder':_0x371d8c,'folderId':_0x45881d[_0x176c03(0x200)]['id']}),_0x388914[_0x176c03(0x1de)]?.(_0x176c03(0x1da)+_0x371d8c+'\x27');}return _0x42a2b1;}export async function executePushSegmentDeletions(_0x431a16,_0x57e6fb,_0x58a16c){const _0x1f34b2=a100_0x2c6966;if(_0x57e6fb[_0x1f34b2(0x1d8)]===0x0)return 0x0;const {batchAsync:_0x27f931}=await import('../../utils/async.js'),_0x3425dd=0x5,_0xb7bd25=await _0x27f931(_0x57e6fb,async _0x495efd=>{const _0x457349=_0x1f34b2;return _0x58a16c[_0x457349(0x19a)]?.({'type':_0x457349(0x1d9),'name':_0x495efd['name']}),await _0x431a16['segment'][_0x457349(0x1ab)](_0x495efd['id']),_0x58a16c[_0x457349(0x19a)]?.({'type':_0x457349(0x1d2),'name':_0x495efd[_0x457349(0x141)]}),_0x58a16c[_0x457349(0x1ca)]?.(_0x457349(0x1b1)+_0x495efd[_0x457349(0x141)]+'\x27'),0x1;},_0x3425dd);return _0xb7bd25[_0x1f34b2(0x177)]((_0x2289bb,_0x516b5a)=>_0x2289bb+_0x516b5a,0x0);}export async function executePushJourneys(_0x3a8195,_0x2b0179,_0x6166f0,_0x23cf29,_0x30ff57){const _0x126740=a100_0x2c6966,{journeyDefToRequest:_0x119da5}=await import(_0x126740(0x171)),{activationDefToCreateRequest:_0x48adbe,yamlRuleToApi:_0x2a8b31,validateSegmentRule:_0x1bd02c}=await import('./child-segment-yaml.js'),_0x271ddb={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2ac277=new Map(_0x6166f0[_0x126740(0x180)]),_0x2e2139=0x5;for(let _0x593dfb=0x0;_0x593dfb<_0x2b0179['length'];_0x593dfb+=_0x2e2139){const _0x293f82=_0x2b0179[_0x126740(0x1e9)](_0x593dfb,_0x593dfb+_0x2e2139),_0xa9c5a8=await Promise['all'](_0x293f82[_0x126740(0x1b5)](async _0x975dfa=>{const _0x590bbe=_0x126740;if(!_0x975dfa['isNew']&&!_0x975dfa['hasChanges'])return{'action':_0x590bbe(0x16c),'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)],'journeyId':_0x975dfa[_0x590bbe(0x1a6)]?.['id']};const _0x56ed6c=_0x975dfa[_0x590bbe(0x144)]?_0x6166f0[_0x590bbe(0x135)][_0x590bbe(0x15b)](_0x975dfa[_0x590bbe(0x144)]):undefined;_0x30ff57['onProgress']?.({'type':_0x975dfa[_0x590bbe(0x1fe)]?_0x590bbe(0x153):_0x590bbe(0x13e),'name':_0x975dfa[_0x590bbe(0x15e)]['name']});try{const _0x3fd08b=await executeSingleJourneyPush(_0x3a8195,_0x975dfa,{..._0x6166f0,'segmentNameToId':_0x2ac277},{'parentId':_0x23cf29['parentId'],'rootFolderId':_0x23cf29[_0x590bbe(0x187)],'folderId':_0x56ed6c,'verbose':_0x23cf29[_0x590bbe(0x1d1)]},_0x30ff57,{'journeyDefToRequest':_0x119da5,'activationDefToCreateRequest':_0x48adbe,'yamlRuleToApi':_0x2a8b31,'validateSegmentRule':_0x1bd02c});for(const [_0x47fd03,_0x50d13e]of _0x3fd08b[_0x590bbe(0x1b6)]){_0x2ac277[_0x590bbe(0x1f0)](_0x47fd03,_0x50d13e),_0x271ddb['embeddedSegmentNameToId']['set'](_0x47fd03,_0x50d13e);}if(_0x3fd08b[_0x590bbe(0x1b9)]==='created')_0x30ff57[_0x590bbe(0x19a)]?.({'type':_0x590bbe(0x129),'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)],'journeyId':_0x3fd08b[_0x590bbe(0x199)]}),_0x30ff57[_0x590bbe(0x179)]?.(_0x590bbe(0x17e)+_0x975dfa[_0x590bbe(0x15e)]['name']+'\x27'),_0x271ddb['created']++;else _0x3fd08b[_0x590bbe(0x1b9)]===_0x590bbe(0x1c0)&&(_0x30ff57['onProgress']?.({'type':_0x590bbe(0x1e1),'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)]}),_0x30ff57[_0x590bbe(0x179)]?.(_0x590bbe(0x1c5)+_0x975dfa['yamlConfig']['name']+'\x27'),_0x271ddb[_0x590bbe(0x1c0)]++);return{'action':_0x3fd08b[_0x590bbe(0x1b9)],'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)],'journeyId':_0x3fd08b['journeyId']};}catch(_0x1ac44a){const _0x575c5c=isHttp400Error(_0x1ac44a),_0xbc6596=_0x575c5c?ErrorCode[_0x590bbe(0x1c7)]:ErrorCode[_0x590bbe(0x19c)],_0x20478d=getErrorMessage(_0x1ac44a);throw new SDKError(_0xbc6596,_0x590bbe(0x185)+(_0x975dfa['isNew']?'create':'update')+_0x590bbe(0x1a1)+_0x975dfa[_0x590bbe(0x202)]+_0x590bbe(0x1b8)+_0x20478d,_0x1ac44a);}}));_0x271ddb[_0x126740(0x1c9)][_0x126740(0x1e2)](..._0xa9c5a8);}return _0x271ddb;}async function executeSingleJourneyPush(_0x1dd739,_0x24363e,_0x12ad65,_0xebdff0,_0x59d71f,_0x43d818){const _0x836d45=a100_0x2c6966,{journeyDefToRequest:_0x233812,activationDefToCreateRequest:_0x4b7627,yamlRuleToApi:_0x4f09e3,validateSegmentRule:_0x58be5f}=_0x43d818,_0xb29fc1=new Map(),_0x1b899b=new Map(),_0x4c71cc=new Map(),_0x52ad30=new Map(),_0x448c55=new Map();let _0x1c82b5;const _0xdf1dd5=async()=>{const _0x2f19e0=a100_0x1a9a;if(_0x1c82b5)return;_0x1c82b5=new Map();if(!_0x24363e['existingJourney'])return;const _0x374860=await _0x1dd739[_0x2f19e0(0x165)][_0x2f19e0(0x1be)](_0x24363e[_0x2f19e0(0x1a6)]['id']);for(const _0x2d87e5 of _0x374860){const _0x59bd23=journeyActivationStepToYaml(_0x2d87e5,_0x12ad65['idToEmailMap'],_0x12ad65[_0x2f19e0(0x1a0)]),_0xd9fc4d=activationSignature(_0x59bd23);!_0x1c82b5['has'](_0xd9fc4d)&&_0x1c82b5[_0x2f19e0(0x1f0)](_0xd9fc4d,_0x2d87e5['id']),_0x59bd23['name']&&_0x1b899b[_0x2f19e0(0x1f0)](_0x59bd23[_0x2f19e0(0x141)],_0x2d87e5['id']);}};if(_0x24363e['existingJourney']&&_0x24363e[_0x836d45(0x15e)]['segments']){const _0x500de4=buildLocalExpandedRuleMappings(_0x24363e['yamlConfig']),_0x4ce74c=_0x500de4[_0x836d45(0x16a)];if(_0x4ce74c[_0x836d45(0x143)]>0x0){const _0x2cfe2e=new Map();for(const [_0x5a1025,_0xc6597a]of _0x4ce74c){const _0x2c2aba=serializeExpandedRule(_0xc6597a,_0x4ce74c);_0x2cfe2e[_0x836d45(0x1f0)](_0x5a1025,_0x2c2aba);}const _0x44e005=collectSegmentIdsFromJourneyApi(_0x24363e[_0x836d45(0x1a6)]);if(_0x44e005['size']>0x0){const _0xa251f8=await buildServerSegmentRuleMap(_0x1dd739,_0xebdff0[_0x836d45(0x15a)],_0x12ad65[_0x836d45(0x163)],_0x44e005);if(_0xa251f8['size']>0x0){const _0x19f5c3=new Map();for(const [_0x110359,_0x11c998]of _0xa251f8){const _0x2f2385=serializeExpandedRule(_0x11c998,_0xa251f8);!_0x19f5c3[_0x836d45(0x1c3)](_0x2f2385)&&_0x19f5c3[_0x836d45(0x1f0)](_0x2f2385,_0x110359);}for(const [_0x1701e2,_0x2176ed]of _0x2cfe2e){const _0x3e2bdc=_0x19f5c3[_0x836d45(0x15b)](_0x2176ed);_0x3e2bdc&&(_0x448c55[_0x836d45(0x1f0)](_0x1701e2,_0x3e2bdc),_0x12ad65[_0x836d45(0x180)][_0x836d45(0x1f0)](_0x1701e2,_0x3e2bdc));}}}}}const _0x107dfe={'resolveSegmentId':async _0x58dcde=>{const _0x4996ce=_0x836d45,_0x3e2e17=_0x12ad65[_0x4996ce(0x180)]['get'](_0x58dcde);if(!_0x3e2e17)throw new SDKError(ErrorCode[_0x4996ce(0x1f4)],'Segment\x20not\x20found:\x20'+_0x58dcde+_0x4996ce(0x1dd)+_0x24363e[_0x4996ce(0x15e)][_0x4996ce(0x141)]+')');return _0x3e2e17;},'resolveEmbeddedSegmentId':async(_0x2113ac,_0x21b19e)=>{const _0x1eed3b=_0x836d45,_0x1def99=_0x12ad65['segmentNameToId'][_0x1eed3b(0x15b)](_0x2113ac);if(_0x1def99)return _0x1def99;const _0x3a4cc8=_0x448c55[_0x1eed3b(0x15b)](_0x2113ac);if(_0x3a4cc8)return _0x12ad65[_0x1eed3b(0x180)][_0x1eed3b(0x1f0)](_0x2113ac,_0x3a4cc8),_0x3a4cc8;const _0x5cce52=_0x12ad65['existingSegments'][_0x1eed3b(0x133)](_0x8e34bd=>_0x8e34bd[_0x1eed3b(0x141)]===_0x2113ac);if(_0x5cce52)return _0x12ad65[_0x1eed3b(0x180)][_0x1eed3b(0x1f0)](_0x2113ac,_0x5cce52['id']),_0x5cce52['id'];if(_0x24363e[_0x1eed3b(0x1fe)]){const {stageName:_0x227c01,criteriaName:_0x334eef}=findSegmentCriteriaLocation(_0x24363e['yamlConfig'],_0x2113ac);return _0x58be5f(_0x2113ac,_0x21b19e[_0x1eed3b(0x1cf)]),_0x4c71cc['set'](_0x2113ac,{'definition':_0x21b19e,'stageName':_0x227c01,'criteriaName':_0x334eef}),createPendingSegmentId(_0x2113ac);}const _0x524087=_0x24363e[_0x1eed3b(0x1a6)]?.['id'];if(!_0x524087)throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x58be5f(_0x2113ac,_0x21b19e[_0x1eed3b(0x1cf)]);const _0x29dd1d=generateDeterministicJourneySegmentName(_0x24363e[_0x1eed3b(0x15e)][_0x1eed3b(0x141)],_0x2113ac),_0xd06867=_0x12ad65[_0x1eed3b(0x163)]['find'](_0x45caca=>_0x45caca[_0x1eed3b(0x141)]===_0x29dd1d),_0x500859=createSegmentIdResolver(_0x12ad65[_0x1eed3b(0x180)],_0x2113ac),_0x1350ac=await resolveRuleSegmentIds(_0x21b19e[_0x1eed3b(0x1cf)],_0x500859);let _0x535272;if(_0xd06867)await _0x1dd739[_0x1eed3b(0x1ed)][_0x1eed3b(0x17a)](_0xebdff0[_0x1eed3b(0x15a)],_0xd06867['id'],{'description':_0x21b19e[_0x1eed3b(0x132)]||_0x1eed3b(0x1af)+_0x2113ac,'rule':_0x4f09e3(_0x1350ac,!![]),'countPopulation':!![]}),_0x535272=_0xd06867['id'];else try{_0x535272=await _0x1dd739[_0x1eed3b(0x1ed)][_0x1eed3b(0x12f)]({'name':_0x29dd1d,'description':_0x21b19e[_0x1eed3b(0x132)]||_0x1eed3b(0x1af)+_0x2113ac,'journeyId':_0x524087,'rule':_0x4f09e3(_0x1350ac,!![]),'countPopulation':!![],'parentFolderId':_0xebdff0[_0x1eed3b(0x187)]||'','audienceId':_0xebdff0[_0x1eed3b(0x15a)]});}catch(_0x6d485d){const _0x1e1d1a=_0x6d485d instanceof Error&&_0x6d485d[_0x1eed3b(0x1dc)][_0x1eed3b(0x1fc)](_0x1eed3b(0x11e));if(_0x1e1d1a){const _0x41a950=await _0x1dd739[_0x1eed3b(0x1ed)]['listSegments'](_0xebdff0[_0x1eed3b(0x15a)]),_0x580725=_0x41a950[_0x1eed3b(0x133)](_0x50de4f=>_0x50de4f[_0x1eed3b(0x141)]===_0x29dd1d);if(_0x580725)await _0x1dd739[_0x1eed3b(0x1ed)][_0x1eed3b(0x17a)](_0xebdff0[_0x1eed3b(0x15a)],_0x580725['id'],{'description':_0x21b19e[_0x1eed3b(0x132)]||_0x1eed3b(0x1af)+_0x2113ac,'rule':_0x4f09e3(_0x1350ac,!![]),'countPopulation':!![]}),_0x535272=_0x580725['id'];else throw _0x6d485d;}else throw _0x6d485d;}return _0x12ad65[_0x1eed3b(0x180)]['set'](_0x2113ac,_0x535272),_0xb29fc1[_0x1eed3b(0x1f0)](_0x2113ac,_0x535272),_0x535272;},'resolveActivationId':async _0x5b83b3=>{const _0x58456=_0x836d45,_0x5636e9=_0x1b899b[_0x58456(0x15b)](_0x5b83b3);if(_0x5636e9)return _0x5636e9;if(_0x24363e[_0x58456(0x1a6)]){await _0xdf1dd5();const _0x5c4c1b=_0x1b899b[_0x58456(0x15b)](_0x5b83b3);if(_0x5c4c1b)return _0x5c4c1b;}throw new SDKError(ErrorCode[_0x58456(0x139)],_0x58456(0x13f)+_0x5b83b3+_0x58456(0x1dd)+_0x24363e[_0x58456(0x15e)][_0x58456(0x141)]+_0x58456(0x1e4)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x4eeab7,_0x1197ec)=>{const _0x334aa9=_0x836d45,_0x4fd6a0=_0x1b899b[_0x334aa9(0x15b)](_0x4eeab7);if(_0x4fd6a0)return _0x4fd6a0;if(_0x24363e[_0x334aa9(0x1fe)])return _0x52ad30['set'](_0x4eeab7,_0x1197ec),createPendingActivationId(_0x4eeab7);if(_0x24363e[_0x334aa9(0x1a6)]){await _0xdf1dd5();const _0x2dbf16=_0x1b899b['get'](_0x1197ec[_0x334aa9(0x141)]);if(_0x2dbf16)return _0x1b899b[_0x334aa9(0x1f0)](_0x4eeab7,_0x2dbf16),_0x2dbf16;const _0x9a9214=activationSignature(_0x1197ec),_0x25b982=_0x1c82b5?.['get'](_0x9a9214);if(_0x25b982)return _0x1b899b['set'](_0x4eeab7,_0x25b982),_0x25b982;const _0x1535d4=await _0x4b7627(_0x1197ec,_0x12ad65[_0x334aa9(0x194)]),_0x215e37=await _0x1dd739['journey'][_0x334aa9(0x1db)](_0x24363e[_0x334aa9(0x1a6)]['id'],_0x1535d4);return _0x1b899b[_0x334aa9(0x1f0)](_0x4eeab7,_0x215e37['id']),_0x215e37['id'];}throw new SDKError(ErrorCode[_0x334aa9(0x1d0)],_0x334aa9(0x138));},'resolveJourneyId':async _0x3d1d64=>{const _0xf6df62=_0x836d45;try{return await _0x1dd739['journey'][_0xf6df62(0x1f7)](_0xebdff0['parentId'],_0x3d1d64);}catch(_0x2284fd){throw new SDKError(ErrorCode['NOT_FOUND'],_0xf6df62(0x11f)+_0x3d1d64+_0xf6df62(0x137)+_0x24363e[_0xf6df62(0x15e)][_0xf6df62(0x141)]+'\x27)',_0x2284fd);}},'resolveStageId':async(_0x548589,_0x366548)=>{const _0x350c3f=_0x836d45,_0x39a6c4=await _0x1dd739[_0x350c3f(0x165)][_0x350c3f(0x173)](_0x548589),_0x67e00b=_0x39a6c4[_0x350c3f(0x18e)][_0x350c3f(0x140)][_0x350c3f(0x133)](_0x5e83b8=>_0x5e83b8['name'][_0x350c3f(0x12e)]()===_0x366548[_0x350c3f(0x12e)]());if(!_0x67e00b?.['id'])throw new SDKError(ErrorCode[_0x350c3f(0x139)],_0x350c3f(0x145)+_0x366548+_0x350c3f(0x1d4)+(_0x39a6c4['attributes']['journeyBundleName']||_0x39a6c4[_0x350c3f(0x18e)][_0x350c3f(0x141)])+'\x27');return _0x67e00b['id'];}},_0x5d41b4=await _0x233812(_0x24363e[_0x836d45(0x15e)],_0xebdff0[_0x836d45(0x15a)],_0x107dfe),_0x3bfe5e=_0xebdff0['folderId']||_0xebdff0[_0x836d45(0x187)];_0x3bfe5e&&(_0x5d41b4[_0x836d45(0x1f3)]={'parentFolder':{'data':{'id':_0x3bfe5e,'type':'folder'}}});if(_0x24363e['isNew']){if(_0x4c71cc[_0x836d45(0x143)]>0x0||_0x52ad30['size']>0x0)return await executeThreeStepJourneyCreate(_0x1dd739,_0x24363e,_0x5d41b4,{'pendingEmbeddedSegments':_0x4c71cc,'pendingEmbeddedActivations':_0x52ad30,'embeddedSegmentNameToId':_0xb29fc1,'journeyActivationNameToId':_0x1b899b},{..._0xebdff0,'effectiveFolderId':_0x3bfe5e},_0x12ad65,_0x59d71f,_0x43d818);else{ensureJourneyDefaults(_0x5d41b4[_0x836d45(0x18e)]);const _0x1cb309=await _0x1dd739[_0x836d45(0x165)][_0x836d45(0x17f)](_0x5d41b4);return{'action':'created','journeyId':_0x1cb309['id'],'embeddedSegmentNameToId':_0xb29fc1};}}else{if(_0x24363e[_0x836d45(0x162)]&&_0x24363e['existingJourney'])return ensureJourneyDefaults(_0x5d41b4[_0x836d45(0x18e)]),await _0x1dd739['journey'][_0x836d45(0x1a7)](_0x24363e[_0x836d45(0x1a6)]['id'],_0x5d41b4),{'action':_0x836d45(0x1c0),'journeyId':_0x24363e['existingJourney']['id'],'embeddedSegmentNameToId':_0xb29fc1};}return{'action':'unchanged','journeyId':_0x24363e[_0x836d45(0x1a6)]?.['id'],'embeddedSegmentNameToId':_0xb29fc1};}function findSegmentCriteriaLocation(_0x40380d,_0x2680ae){const _0x2f6b0a=a100_0x2c6966,_0x2899f2=_0x40380d[_0x2f6b0a(0x1e0)]||_0x40380d['journeys']?.[0x0]?.[_0x2f6b0a(0x1e0)]||[];let _0x5c473e='entry',_0x5953b3=_0x2680ae;const _0x3ab3cc=_0x40380d['goal']||_0x40380d[_0x2f6b0a(0x147)]?.[0x0]?.[_0x2f6b0a(0x1bc)];if(_0x3ab3cc?.[_0x2f6b0a(0x1ed)]===_0x2680ae)return{'stageName':_0x2f6b0a(0x1bc),'criteriaName':_0x3ab3cc[_0x2f6b0a(0x141)]||_0x2680ae};_0x3c73a2:for(const _0x28c213 of _0x2899f2){if(_0x28c213[_0x2f6b0a(0x181)]?.[_0x2f6b0a(0x1ed)]===_0x2680ae){_0x5c473e=_0x28c213[_0x2f6b0a(0x141)],_0x5953b3=_0x28c213[_0x2f6b0a(0x181)][_0x2f6b0a(0x141)]||_0x2680ae;break;}if(_0x28c213[_0x2f6b0a(0x1f8)])for(const _0x3ba48f of _0x28c213[_0x2f6b0a(0x1f8)]){if(_0x3ba48f[_0x2f6b0a(0x134)]===_0x2f6b0a(0x1ee)&&_0x3ba48f['with']?.[_0x2f6b0a(0x1e7)])for(const _0x15a84c of _0x3ba48f['with'][_0x2f6b0a(0x1e7)]){if(_0x15a84c[_0x2f6b0a(0x1ed)]===_0x2680ae){_0x5c473e=_0x28c213['name'],_0x5953b3=_0x15a84c[_0x2f6b0a(0x141)]||_0x2680ae;break _0x3c73a2;}}}}return{'stageName':_0x5c473e,'criteriaName':_0x5953b3};}async function executeThreeStepJourneyCreate(_0x6f0bc9,_0x5221ea,_0x4f6f91,_0x11367b,_0x21b289,_0x48d84d,_0x35e990,_0x10ab39){const _0xeb0cc8=a100_0x2c6966,{activationDefToCreateRequest:_0xcb1695,yamlRuleToApi:_0x5b0365}=_0x10ab39,{pendingEmbeddedSegments:_0x9422a,pendingEmbeddedActivations:_0x148a78,embeddedSegmentNameToId:_0x25e227}=_0x11367b,_0x49f164=JSON[_0xeb0cc8(0x14c)](JSON[_0xeb0cc8(0x158)](_0x4f6f91));ensureJourneyDefaults(_0x49f164['attributes']),stripPendingIds(_0x49f164);const _0x4fb092=await _0x6f0bc9['journey'][_0xeb0cc8(0x17f)](_0x49f164),_0x111e13=_0x4fb092['id'],_0x3c59eb=new Map();for(const _0x33de5c of _0x4fb092[_0xeb0cc8(0x18e)]['journeyStages']){_0x3c59eb[_0xeb0cc8(0x1f0)](_0x33de5c[_0xeb0cc8(0x141)][_0xeb0cc8(0x12e)](),_0x33de5c['id']);}for(const [_0x55f29c,{definition:_0x5addda}]of _0x9422a){const _0x4dd65b=generateDeterministicJourneySegmentName(_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],_0x55f29c);_0x35e990[_0xeb0cc8(0x19a)]?.({'type':_0xeb0cc8(0x192),'journeyName':_0x5221ea['yamlConfig'][_0xeb0cc8(0x141)],'segmentName':_0x55f29c});const _0x1d93fa=createSegmentIdResolver(_0x48d84d['segmentNameToId'],_0x55f29c),_0x3f093c=await resolveRuleSegmentIds(_0x5addda[_0xeb0cc8(0x1cf)],_0x1d93fa),_0x50b82c=await _0x6f0bc9['segment']['createJourneySegment']({'name':_0x4dd65b,'description':_0x5addda['description']||_0xeb0cc8(0x1af)+_0x55f29c,'journeyId':_0x111e13,'rule':_0x5b0365(_0x3f093c,!![]),'countPopulation':!![],'parentFolderId':_0x21b289[_0xeb0cc8(0x127)]||'','audienceId':_0x21b289[_0xeb0cc8(0x15a)]});_0x25e227[_0xeb0cc8(0x1f0)](_0x55f29c,_0x50b82c),_0x48d84d['segmentNameToId'][_0xeb0cc8(0x1f0)](_0x55f29c,_0x50b82c),_0x35e990[_0xeb0cc8(0x19a)]?.({'type':'embedded_segment_created','journeyName':_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],'segmentName':_0x55f29c});}const _0x423fe0=new Map();for(const [_0x59c2b2,_0x13cabf]of _0x148a78){_0x35e990['onProgress']?.({'type':_0xeb0cc8(0x1d7),'journeyName':_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],'activationName':_0x59c2b2});const _0x409241=await _0xcb1695(_0x13cabf,_0x48d84d['activationContext']),_0x4fdeb4=await _0x6f0bc9[_0xeb0cc8(0x165)][_0xeb0cc8(0x1db)](_0x111e13,_0x409241);_0x423fe0[_0xeb0cc8(0x1f0)](_0x59c2b2,_0x4fdeb4['id']),_0x11367b[_0xeb0cc8(0x1ad)][_0xeb0cc8(0x1f0)](_0x59c2b2,_0x4fdeb4['id']),_0x35e990['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],'activationName':_0x59c2b2});}const _0x2a5eb5=JSON[_0xeb0cc8(0x14c)](JSON[_0xeb0cc8(0x158)](_0x4f6f91));return _0x2a5eb5['id']=_0x111e13,ensureJourneyDefaults(_0x2a5eb5[_0xeb0cc8(0x18e)]),resolvePendingIdsInRequest(_0x2a5eb5,_0x4f6f91,_0x3c59eb,_0x25e227,_0x423fe0,_0x35e990),await _0x6f0bc9[_0xeb0cc8(0x165)][_0xeb0cc8(0x1a7)](_0x111e13,_0x2a5eb5),{'action':_0xeb0cc8(0x16b),'journeyId':_0x111e13,'embeddedSegmentNameToId':_0x25e227};}function stripPendingIds(_0x3e01da){const _0x7eb1c6=a100_0x2c6966;for(const _0x56890a of _0x3e01da[_0x7eb1c6(0x18e)][_0x7eb1c6(0x140)]||[]){_0x56890a['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x56890a[_0x7eb1c6(0x174)][_0x7eb1c6(0x17c)])&&delete _0x56890a[_0x7eb1c6(0x174)];if(_0x56890a[_0x7eb1c6(0x1f8)])for(const _0x4afc5e of Object['keys'](_0x56890a[_0x7eb1c6(0x1f8)])){const _0x50983a=_0x56890a['steps'][_0x4afc5e];_0x50983a[_0x7eb1c6(0x134)]==='Activation'&&_0x50983a[_0x7eb1c6(0x1df)]&&isPendingActivationId(_0x50983a['journeyActivationStepId'])&&(_0x50983a['journeyActivationStepId']='');if(_0x50983a[_0x7eb1c6(0x134)]===_0x7eb1c6(0x15c)&&_0x50983a[_0x7eb1c6(0x1e7)])for(const _0x2c857a of _0x50983a[_0x7eb1c6(0x1e7)]){_0x2c857a[_0x7eb1c6(0x17c)]&&isPendingSegmentId(_0x2c857a['segmentId'])&&(_0x2c857a[_0x7eb1c6(0x17c)]='');}_0x50983a[_0x7eb1c6(0x134)]==='WaitStep'&&_0x50983a[_0x7eb1c6(0x1ef)]?.['segmentId']&&isPendingSegmentId(_0x50983a['waitCondition'][_0x7eb1c6(0x17c)])&&(_0x50983a[_0x7eb1c6(0x1ef)][_0x7eb1c6(0x17c)]='');}}}function resolvePendingIdsInRequest(_0x1c9932,_0xdad995,_0xa9c69b,_0x5cf8d4,_0x5c5429,_0xddf14b){const _0x1e8877=a100_0x2c6966,_0x335053=(_0x54b476,_0x2b100b)=>{const _0x561e08=a100_0x1a9a;if(!isPendingSegmentId(_0x54b476))return _0x54b476;const _0x79946a=extractPendingSegmentName(_0x54b476),_0x3df8f7=_0x5cf8d4[_0x561e08(0x15b)](_0x79946a);return!_0x3df8f7&&_0xddf14b[_0x561e08(0x189)]?.(_0x561e08(0x150)+_0x79946a+_0x561e08(0x146)+_0x2b100b),_0x3df8f7;};if(_0x1c9932[_0x1e8877(0x18e)][_0x1e8877(0x1bc)]?.['segmentId']&&isPendingSegmentId(_0x1c9932[_0x1e8877(0x18e)][_0x1e8877(0x1bc)][_0x1e8877(0x17c)])){const _0x1f9f44=_0x335053(_0x1c9932['attributes'][_0x1e8877(0x1bc)][_0x1e8877(0x17c)],'goal\x20criteria');_0x1f9f44&&(_0x1c9932[_0x1e8877(0x18e)]['goal'][_0x1e8877(0x17c)]=_0x1f9f44);}for(const _0x476265 of _0x1c9932[_0x1e8877(0x18e)][_0x1e8877(0x140)]||[]){const _0x3aa6cb=_0xa9c69b['get'](_0x476265[_0x1e8877(0x141)][_0x1e8877(0x12e)]());_0x3aa6cb&&(_0x476265['id']=_0x3aa6cb);if(_0x476265['entryCriteria']?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x476265['entryCriteria'][_0x1e8877(0x17c)])){const _0x2e63ff=_0x335053(_0x476265[_0x1e8877(0x174)][_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265[_0x1e8877(0x141)]+_0x1e8877(0x1ec));_0x2e63ff&&(_0x476265[_0x1e8877(0x174)][_0x1e8877(0x17c)]=_0x2e63ff);}if(_0x476265[_0x1e8877(0x1b4)])for(const _0x1a923f of _0x476265['exitCriterias']){if(_0x1a923f[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x1a923f[_0x1e8877(0x17c)])){const _0x2345f8=_0x335053(_0x1a923f[_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265[_0x1e8877(0x141)]+'\x27\x20exit\x20criteria');_0x2345f8&&(_0x1a923f[_0x1e8877(0x17c)]=_0x2345f8);}}if(_0x476265[_0x1e8877(0x1d5)]?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x476265[_0x1e8877(0x1d5)][_0x1e8877(0x17c)])){const _0x131977=_0x335053(_0x476265[_0x1e8877(0x1d5)][_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265['name']+'\x27\x20milestone');_0x131977&&(_0x476265['milestone'][_0x1e8877(0x17c)]=_0x131977);}if(_0x476265[_0x1e8877(0x1f8)]){const _0x325829=_0x11ade4=>_0xdad995['attributes'][_0x1e8877(0x140)]['find'](_0x570376=>_0x570376[_0x1e8877(0x141)][_0x1e8877(0x12e)]()===_0x476265[_0x1e8877(0x141)][_0x1e8877(0x12e)]())?.[_0x1e8877(0x1f8)]?.[_0x11ade4];for(const _0x56203e of Object[_0x1e8877(0x1d3)](_0x476265[_0x1e8877(0x1f8)])){const _0x5ec06c=_0x476265[_0x1e8877(0x1f8)][_0x56203e],_0x2c32b1=_0x325829(_0x56203e);if(_0x5ec06c[_0x1e8877(0x134)]===_0x1e8877(0x15f)&&_0x5ec06c['journeyActivationStepId']&&(isPendingActivationId(_0x5ec06c['journeyActivationStepId'])||_0x5ec06c['journeyActivationStepId']==='')){if(_0x2c32b1?.['journeyActivationStepId']&&isPendingActivationId(_0x2c32b1[_0x1e8877(0x1df)])){const _0x1e50db=extractPendingActivationName(_0x2c32b1[_0x1e8877(0x1df)]),_0x23d2db=_0x5c5429['get'](_0x1e50db);_0x23d2db&&(_0x5ec06c[_0x1e8877(0x1df)]=_0x23d2db);}}if(_0x5ec06c['type']===_0x1e8877(0x15c)&&_0x5ec06c[_0x1e8877(0x1e7)]&&_0x2c32b1?.[_0x1e8877(0x1e7)])for(let _0x107c14=0x0;_0x107c14<_0x5ec06c['branches'][_0x1e8877(0x1d8)];_0x107c14++){const _0x1061f2=_0x5ec06c['branches'][_0x107c14],_0x3766a3=_0x2c32b1[_0x1e8877(0x1e7)][_0x107c14];if(_0x3766a3?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x3766a3[_0x1e8877(0x17c)])){const _0x4e99f6=_0x335053(_0x3766a3[_0x1e8877(0x17c)],'stage\x20\x27'+_0x476265[_0x1e8877(0x141)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x1061f2[_0x1e8877(0x141)]||_0x107c14)+'\x27');_0x4e99f6&&(_0x1061f2[_0x1e8877(0x17c)]=_0x4e99f6);}}if(_0x5ec06c['type']===_0x1e8877(0x166)&&_0x5ec06c[_0x1e8877(0x1ef)]?.[_0x1e8877(0x17c)]&&_0x2c32b1?.[_0x1e8877(0x1ef)]?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x2c32b1[_0x1e8877(0x1ef)][_0x1e8877(0x17c)])){const _0x2bbda1=_0x335053(_0x2c32b1[_0x1e8877(0x1ef)][_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265[_0x1e8877(0x141)]+_0x1e8877(0x205));_0x2bbda1&&(_0x5ec06c[_0x1e8877(0x1ef)][_0x1e8877(0x17c)]=_0x2bbda1);}}}}}
|
|
1
|
+
const a100_0xbb0e10=a100_0x5743;(function(_0x3aebb5,_0x2edf02){const _0x38aea7=a100_0x5743,_0xe88b6=_0x3aebb5();while(!![]){try{const _0x413581=-parseInt(_0x38aea7(0x1c3))/0x1*(-parseInt(_0x38aea7(0x249))/0x2)+parseInt(_0x38aea7(0x246))/0x3+parseInt(_0x38aea7(0x23c))/0x4+-parseInt(_0x38aea7(0x1f9))/0x5+-parseInt(_0x38aea7(0x1cd))/0x6*(-parseInt(_0x38aea7(0x1dd))/0x7)+-parseInt(_0x38aea7(0x1fe))/0x8+-parseInt(_0x38aea7(0x1ec))/0x9;if(_0x413581===_0x2edf02)break;else _0xe88b6['push'](_0xe88b6['shift']());}catch(_0x27fe3f){_0xe88b6['push'](_0xe88b6['shift']());}}}(a100_0x4634,0x94c08));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a100_0xbb0e10(0x250);export const PENDING_ACTIVATION_PREFIX=a100_0xbb0e10(0x1a4);export function createPendingSegmentId(_0x1d42f6){return''+PENDING_SEGMENT_PREFIX+_0x1d42f6+'__';}export function isPendingSegmentId(_0x337b83){const _0x1d09e8=a100_0xbb0e10;return _0x337b83[_0x1d09e8(0x21d)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x4b1c15){const _0xe9d374=a100_0xbb0e10;return _0x4b1c15[_0xe9d374(0x1a7)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4d2e76){return''+PENDING_ACTIVATION_PREFIX+_0x4d2e76+'__';}export function isPendingActivationId(_0x236c4f){const _0x3affa9=a100_0xbb0e10;return _0x236c4f[_0x3affa9(0x21d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3423c5){const _0x45d9f0=a100_0xbb0e10;return _0x3423c5[_0x45d9f0(0x1a7)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x56730c,_0x5150c8){const _0x3fd26d=a100_0xbb0e10,_0x1af21d=_0x56730c+'::'+(_0x5150c8['trim']()||_0x3fd26d(0x216)),_0x1e32e8=createHash(_0x3fd26d(0x1c6))['update'](_0x1af21d)['digest'](_0x3fd26d(0x1c5))['slice'](0x0,0xc);return _0x3fd26d(0x1e3)+_0x1e32e8;}export function ensureJourneyDefaults(_0x58b8ca){const _0x5f2dae=a100_0xbb0e10;!_0x58b8ca['description']&&(_0x58b8ca[_0x5f2dae(0x20d)]=''),!_0x58b8ca[_0x5f2dae(0x1aa)]&&(_0x58b8ca[_0x5f2dae(0x1aa)]=_0x5f2dae(0x1e6));}export function resolveTDFolderPath(_0x11ce46,_0x59fd8a,_0x22ebe6){const _0x138efd=a100_0xbb0e10;if(!_0x59fd8a)return _0x11ce46;if(_0x11ce46===_0x22ebe6||_0x11ce46[_0x138efd(0x21d)](_0x22ebe6+'/'))return _0x11ce46;return _0x11ce46?_0x22ebe6+'/'+_0x11ce46:_0x22ebe6;}export function addFoldersToCreate(_0x439e65,_0x1613de,_0xdcaec3){const _0x52ce81=a100_0xbb0e10;if(!_0x439e65)return;if(_0x1613de[_0x52ce81(0x1f0)](_0x439e65))return;const _0x1ff32b=_0x439e65[_0x52ce81(0x1d6)]('/');let _0x47b7f1='';for(const _0x3b5a9e of _0x1ff32b){_0x47b7f1=_0x47b7f1?_0x47b7f1+'/'+_0x3b5a9e:_0x3b5a9e,!_0x1613de[_0x52ce81(0x1f0)](_0x47b7f1)&&_0xdcaec3[_0x52ce81(0x187)](_0x47b7f1);}}function a100_0x5743(_0x580b3e,_0x428a0b){_0x580b3e=_0x580b3e-0x167;const _0x463450=a100_0x4634();let _0x5743e4=_0x463450[_0x580b3e];return _0x5743e4;}import*as a100_0x1d2a91 from'yaml';import{readFileSync}from'fs';import a100_0x4231b1 from'path';import{isJourneyDef,parseYamlString as a100_0x348012,toYamlString as a100_0x13016c,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x227684){const _0x316a34=a100_0xbb0e10;if(Array[_0x316a34(0x18b)](_0x227684))return'['+_0x227684[_0x316a34(0x206)](_0x351e1a=>stableStringify(_0x351e1a))[_0x316a34(0x1c8)](',')+']';if(_0x227684&&typeof _0x227684===_0x316a34(0x1f7)){const _0x18032d=_0x227684,_0x56a981=Object[_0x316a34(0x1b0)](_0x18032d)[_0x316a34(0x18f)](),_0x1e6317=_0x56a981['map'](_0xf24fd4=>'\x22'+_0xf24fd4+'\x22:'+stableStringify(_0x18032d[_0xf24fd4]));return'{'+_0x1e6317[_0x316a34(0x1c8)](',')+'}';}const _0x1e11a0=JSON['stringify'](_0x227684);return _0x1e11a0===undefined?_0x316a34(0x198):_0x1e11a0;}function activationSignature(_0x47c51b){const _0x3ed83a=a100_0xbb0e10,_0x30f8c1={'connection':_0x47c51b[_0x3ed83a(0x1ce)],..._0x47c51b[_0x3ed83a(0x24a)]!==undefined&&{'all_columns':_0x47c51b['all_columns']},..._0x47c51b[_0x3ed83a(0x1ee)]!==undefined&&{'columns':_0x47c51b[_0x3ed83a(0x1ee)]},..._0x47c51b['behavior']!==undefined&&{'behavior':_0x47c51b[_0x3ed83a(0x241)]},..._0x47c51b['schedule']!==undefined&&{'schedule':_0x47c51b[_0x3ed83a(0x23f)]},..._0x47c51b[_0x3ed83a(0x1fc)]!==undefined&&{'notification':_0x47c51b[_0x3ed83a(0x1fc)]},..._0x47c51b['connector_config']!==undefined&&{'connector_config':_0x47c51b[_0x3ed83a(0x170)]},..._0x47c51b[_0x3ed83a(0x174)]!==undefined&&{'activation_template_id':_0x47c51b[_0x3ed83a(0x174)]}};return stableStringify(_0x30f8c1);}export async function prepareSegmentFiles(_0xc59652,_0x58ef52,_0x5d2861,_0x3450ec,_0x2e4318){const _0x49ab67=a100_0xbb0e10,{activationDefToCreateRequest:_0x5c12b4}=await import(_0x49ab67(0x213)),_0x44817a=[],_0x5521f1=new Set();for(const {yamlConfig:_0x126e7b,folderPath:_0x2851cd,sourcePath:_0x1735b0}of _0xc59652){const _0x4fedbb=resolveTDFolderPath(_0x2851cd,_0x3450ec,_0x2e4318),_0x3bf4ff=_0x4fedbb+':'+_0x126e7b['name'],_0x5ba965=_0x58ef52[_0x49ab67(0x227)][_0x49ab67(0x200)](_0x3bf4ff),_0x50db01=_0x5ba965?_0x58ef52[_0x49ab67(0x219)]['get'](_0x5ba965['id'])||[]:[];addFoldersToCreate(_0x4fedbb,_0x58ef52[_0x49ab67(0x1df)],_0x5521f1);const _0x424c83=calculateActivationActions(_0x126e7b['activations']||[],_0x50db01,_0x58ef52[_0x49ab67(0x22b)],_0x58ef52[_0x49ab67(0x179)]);for(const _0x58e4cf of _0x424c83){(_0x58e4cf[_0x49ab67(0x1f1)]===_0x49ab67(0x238)||_0x58e4cf['type']===_0x49ab67(0x232))&&_0x58e4cf[_0x49ab67(0x1d8)]&&(_0x58e4cf[_0x49ab67(0x21c)]=await _0x5c12b4(_0x58e4cf[_0x49ab67(0x1d8)],_0x5d2861));}const _0x29b929=calculateSegmentDiff(_0x126e7b,_0x5ba965,_0x50db01,_0x58ef52[_0x49ab67(0x22b)],_0x58ef52[_0x49ab67(0x179)]);_0x44817a['push']({'relativePath':_0x126e7b[_0x49ab67(0x19d)],'absolutePath':_0x1735b0,'yamlConfig':_0x126e7b,'folderPath':_0x4fedbb,'existingSegment':_0x5ba965,'existingActivations':_0x50db01,'isNew':_0x29b929[_0x49ab67(0x230)],'hasChanges':_0x29b929[_0x49ab67(0x21f)],'diff':_0x29b929[_0x49ab67(0x20c)],'activationActions':_0x424c83});}return{'segmentFiles':_0x44817a,'foldersToCreate':_0x5521f1};}export async function prepareJourneyFiles(_0x1a9437,_0x3e5b1c,_0x559cda,_0x454654){const _0x29e0d0=a100_0xbb0e10,_0x9332d4=[],_0x54161a=new Set();for(const {yamlConfig:_0x212ee8,folderPath:_0x122f00,sourcePath:_0x423ce7}of _0x1a9437){const _0x4c28ed=resolveTDFolderPath(_0x122f00,_0x559cda,_0x454654),_0x4dce9e=_0x4c28ed+':'+_0x212ee8[_0x29e0d0(0x19d)],_0x2d715c=_0x3e5b1c[_0x29e0d0(0x234)][_0x29e0d0(0x200)](_0x4dce9e);let _0x1a09a0,_0x436615;if(_0x2d715c&&_0x2d715c[_0x29e0d0(0x1c2)]>0x0){const _0x2e4d3b=buildLocalExpandedRuleMappings(_0x212ee8),{createYamlContext:_0x54bbf9,prefetchJourneySegments:_0x28fc8a}=createPushYamlContextForBundle(_0x3e5b1c[_0x29e0d0(0x1ff)],_0x3e5b1c[_0x29e0d0(0x224)],_0x3e5b1c['existingSegments'],_0x2e4d3b,_0x3e5b1c[_0x29e0d0(0x22b)],_0x3e5b1c[_0x29e0d0(0x179)],_0x3e5b1c[_0x29e0d0(0x1a6)],_0x3e5b1c[_0x29e0d0(0x19b)]);await _0x28fc8a(_0x2d715c[_0x29e0d0(0x206)](_0x49c244=>_0x49c244['id']));const _0x46adb1=hasMultipleVersions(_0x212ee8),_0x54b69e=async _0x3e7546=>{const _0x19bb73=_0x29e0d0,_0x302b46=_0x3e5b1c[_0x19bb73(0x19b)]?.[_0x19bb73(0x200)](_0x3e7546);if(_0x302b46)return _0x302b46;return _0x3e5b1c[_0x19bb73(0x254)]({'journeyId':_0x3e7546,'journeyName':_0x212ee8['name'],'isMultiVersion':_0x2d715c[_0x19bb73(0x1c2)]>0x1});};if(_0x46adb1&&_0x2d715c[_0x29e0d0(0x1c2)]>0x1){const _0x23f53c=[];for(const _0xef7f59 of _0x2d715c){const _0x5689df=_0xef7f59['versionNumber']||0x1;_0x3e5b1c[_0x29e0d0(0x228)]?.[_0x29e0d0(0x232)]('Fetching\x20'+_0x212ee8['name']+'\x20v'+_0x5689df);const _0x1e29b5=await _0x54b69e(_0xef7f59['id']),_0x244f23=_0x54bbf9(_0xef7f59['id']),_0x4cddb2=await journeyResponseToDef(_0x1e29b5,_0x244f23);_0x23f53c[_0x29e0d0(0x1b9)]({'item':_0xef7f59,'yaml':_0x4cddb2});}const _0x569534=buildLocalRuleToNameMappingFromJourney(_0x212ee8);_0x436615=buildMergedJourneyDef(_0x23f53c,_0x569534);const _0x47c058=Math['max'](..._0x23f53c[_0x29e0d0(0x206)](_0x18d097=>_0x18d097[_0x29e0d0(0x21a)][_0x29e0d0(0x1e1)]||0x0)),_0x479c17=_0x2d715c['find'](_0x540619=>(_0x540619[_0x29e0d0(0x1e1)]||0x0)===_0x47c058);_0x479c17&&(_0x3e5b1c[_0x29e0d0(0x228)]?.['update'](_0x29e0d0(0x1b5)+_0x212ee8[_0x29e0d0(0x19d)]+'\x20v'+_0x47c058),_0x1a09a0=await _0x54b69e(_0x479c17['id']));}else{const _0x4810ae=_0x2d715c[_0x2d715c[_0x29e0d0(0x1c2)]-0x1];_0x3e5b1c[_0x29e0d0(0x228)]?.['update'](_0x29e0d0(0x1b5)+_0x212ee8[_0x29e0d0(0x19d)]),_0x1a09a0=await _0x54b69e(_0x4810ae['id']);const _0x561215=_0x54bbf9(_0x4810ae['id']),_0xf31ef5=await journeyResponseToDef(_0x1a09a0,_0x561215),_0x4c5a52=buildLocalRuleToNameMappingFromJourney(_0x212ee8);_0x436615=buildMergedJourneyDef([{'item':_0x4810ae,'yaml':_0xf31ef5}],_0x4c5a52);}}addFoldersToCreate(_0x4c28ed,_0x3e5b1c[_0x29e0d0(0x1df)],_0x54161a);const _0x1e53fb=calculateJourneyDiff(_0x212ee8,_0x436615);_0x9332d4[_0x29e0d0(0x1b9)]({'relativePath':_0x212ee8['name'],'absolutePath':_0x423ce7,'yamlConfig':_0x212ee8,'folderPath':_0x4c28ed,'existingJourney':_0x1a09a0,'isNew':_0x1e53fb[_0x29e0d0(0x230)],'hasChanges':_0x1e53fb[_0x29e0d0(0x21f)],'diff':_0x1e53fb[_0x29e0d0(0x20c)]});}return{'journeyFiles':_0x9332d4,'foldersToCreate':_0x54161a};}export function calculateActivationActions(_0x532c3b,_0x5cbca2,_0x576557,_0x1f1438){const _0x20195e=a100_0xbb0e10,_0x41d65b=[],_0x3179a7=new Map();for(const _0x159666 of _0x5cbca2){_0x3179a7[_0x20195e(0x1b2)](_0x159666[_0x20195e(0x19d)],_0x159666);}const _0x1b69c3=new Map();for(const _0x49b941 of _0x532c3b){_0x1b69c3[_0x20195e(0x1b2)](_0x49b941[_0x20195e(0x19d)],_0x49b941);}for(const _0x542ba6 of _0x532c3b){const _0x3ccb8a=_0x3179a7[_0x20195e(0x200)](_0x542ba6[_0x20195e(0x19d)]);if(!_0x3ccb8a)_0x41d65b[_0x20195e(0x1b9)]({'type':_0x20195e(0x238),'name':_0x542ba6[_0x20195e(0x19d)],'yamlActivation':_0x542ba6});else{const _0x552d1c=activationResponseToDef(_0x3ccb8a,_0x576557,_0x1f1438),_0x4fd946=a100_0x1d2a91[_0x20195e(0x189)](_0x552d1c),_0x1aa186=a100_0x1d2a91[_0x20195e(0x189)](_0x542ba6);_0x4fd946!==_0x1aa186&&_0x41d65b[_0x20195e(0x1b9)]({'type':_0x20195e(0x232),'name':_0x542ba6['name'],'yamlActivation':_0x542ba6,'existingActivation':_0x3ccb8a});}}for(const _0x5a71cf of _0x5cbca2){!_0x1b69c3[_0x20195e(0x1f0)](_0x5a71cf['name'])&&_0x41d65b[_0x20195e(0x1b9)]({'type':_0x20195e(0x217),'name':_0x5a71cf[_0x20195e(0x19d)],'existingActivation':_0x5a71cf});}return _0x41d65b;}export function calculateSegmentDiff(_0x13d3a0,_0x435e17,_0x231eb0,_0x4a0a02,_0x48e55f){const _0x32d915=segmentToYamlString(_0x13d3a0);if(_0x435e17){const _0x27e536=segmentWithActivationsToYaml(_0x435e17,_0x231eb0,undefined,_0x4a0a02,_0x48e55f),_0x464ade=segmentToYamlString(_0x27e536),_0x1936d0=generateDiff(_0x464ade,_0x32d915),_0x4bab50=hasChanges(_0x1936d0);return{'isNew':![],'hasChanges':_0x4bab50,'diff':_0x4bab50?formatDiffWithColors(_0x1936d0):undefined};}const _0x11c345=generateDiff('',_0x32d915);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x11c345)};}export function calculateJourneyDiff(_0x5babb5,_0x4c459b){const _0xd14a5f=normalizeJourneyDef(_0x5babb5,_0x5babb5),_0x54ddc7=a100_0x13016c(_0xd14a5f);if(_0x4c459b){const _0x100c55=normalizeJourneyDef(_0x4c459b,_0x5babb5),_0xa3beec=a100_0x13016c(_0x100c55),_0x4a8329=generateDiff(_0xa3beec,_0x54ddc7),_0x28ce35=hasChanges(_0x4a8329);return{'isNew':![],'hasChanges':_0x28ce35,'diff':_0x28ce35?formatDiffWithColors(_0x4a8329):undefined};}const _0x52a9bd=generateDiff('',_0x54ddc7);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x52a9bd)};}export function findSegmentsToDelete(_0x36d612,_0xb18cba,_0x182879,_0x5a124f,_0x97c684){const _0x302dc1=a100_0xbb0e10,_0x2cb012=new Set();for(const {yamlConfig:_0x4e8f63,folderPath:_0x427e35}of _0xb18cba){_0x2cb012[_0x302dc1(0x187)](_0x427e35+':'+_0x4e8f63[_0x302dc1(0x19d)]);}return _0x36d612['filter'](_0x137482=>{const _0x1c6309=_0x302dc1,_0x5c0d01=_0x137482[_0x1c6309(0x1d5)]?_0x182879['get'](_0x137482[_0x1c6309(0x1d5)]['toString']())||'':'',_0x58eeff=_0x5c0d01+':'+_0x137482[_0x1c6309(0x19d)];if(_0x2cb012['has'](_0x58eeff))return![];if(_0x97c684)return _0x5c0d01===_0x5a124f||_0x5c0d01['startsWith'](_0x5a124f+'/');return!![];});}export function findJourneysToDelete(_0x3694e2,_0x2bb30d,_0x242fe1,_0x2e236e,_0x112e99){const _0x4b1883=a100_0xbb0e10,_0xb30fc2=new Set();for(const {yamlConfig:_0x4a10b9,folderPath:_0x471934}of _0x2bb30d){_0xb30fc2[_0x4b1883(0x187)](_0x471934+':'+_0x4a10b9[_0x4b1883(0x19d)]);}return _0x3694e2[_0x4b1883(0x180)](_0x5211a9=>{const _0x509193=_0x4b1883,_0x2f8200=_0x5211a9[_0x509193(0x255)]?_0x242fe1[_0x509193(0x200)](_0x5211a9['folderId'])||'':'',_0x4e2a9c=_0x2f8200+':'+_0x5211a9[_0x509193(0x186)];if(_0xb30fc2[_0x509193(0x1f0)](_0x4e2a9c))return![];if(_0x112e99)return _0x2f8200===_0x2e236e||_0x2f8200[_0x509193(0x21d)](_0x2e236e+'/');return!![];});}export function buildSegmentLookupMap(_0x215fd7,_0x42e393){const _0x45eba2=a100_0xbb0e10,_0x4de2b5=new Map();for(const _0xf15178 of _0x215fd7){const _0x53f1da=_0xf15178['segmentFolderId']?_0x42e393[_0x45eba2(0x200)](_0xf15178['segmentFolderId'][_0x45eba2(0x1dc)]())||'':'',_0x4afd27=_0x53f1da+':'+_0xf15178['name'];_0x4de2b5['set'](_0x4afd27,_0xf15178);}return _0x4de2b5;}export function buildSegmentNameToIdMap(_0x5c5d95){const _0x1a0050=a100_0xbb0e10,_0x3a478f=new Map();for(const _0x3a7bc9 of _0x5c5d95){_0x3a478f['set'](_0x3a7bc9[_0x1a0050(0x19d)],_0x3a7bc9['id']);}return _0x3a478f;}export function buildJourneyBundleLookupMap(_0x3360e8,_0x25d99d){const _0x3ae85e=a100_0xbb0e10,_0x19d23b=new Map();for(const _0x377d4b of _0x3360e8){const _0x4c6869=_0x377d4b['folderId']?_0x25d99d[_0x3ae85e(0x200)](_0x377d4b[_0x3ae85e(0x255)])||'':'',_0xef6970=_0x4c6869+':'+_0x377d4b['journeyBundleName'];!_0x19d23b['has'](_0xef6970)&&_0x19d23b['set'](_0xef6970,[]),_0x19d23b[_0x3ae85e(0x200)](_0xef6970)['push'](_0x377d4b);}for(const _0xcf9b7b of _0x19d23b[_0x3ae85e(0x1de)]()){_0xcf9b7b[_0x3ae85e(0x18f)]((_0x2fca25,_0x59a5ad)=>(_0x2fca25[_0x3ae85e(0x1e1)]||0x0)-(_0x59a5ad[_0x3ae85e(0x1e1)]||0x0));}return _0x19d23b;}export function collectFoldersToCreate(_0x2766f6,_0x9dab48){const _0x1d3135=a100_0xbb0e10,_0x102e56=new Set();for(const _0x2a99a0 of _0x2766f6){if(!_0x2a99a0)continue;if(_0x9dab48[_0x1d3135(0x1f0)](_0x2a99a0))continue;const _0x3c488b=_0x2a99a0[_0x1d3135(0x1d6)]('/');let _0x5ae4b4='';for(const _0x3b9132 of _0x3c488b){_0x5ae4b4=_0x5ae4b4?_0x5ae4b4+'/'+_0x3b9132:_0x3b9132,!_0x9dab48[_0x1d3135(0x1f0)](_0x5ae4b4)&&_0x102e56[_0x1d3135(0x187)](_0x5ae4b4);}}return _0x102e56;}export function parseAndClassifyYamlFiles(_0x2d4cef,_0x5e6532,_0xb2c001){const _0x54f706=a100_0xbb0e10,_0x537d82=[],_0x3b698c=[];for(const _0x3a2a68 of _0x2d4cef){const _0x27a6c1=a100_0x4231b1['relative'](_0x5e6532,a100_0x4231b1['dirname'](_0x3a2a68)),_0x206c36=_0x27a6c1==='.'?'':_0x27a6c1,_0x152245=readFileSync(_0x3a2a68,_0x54f706(0x235)),_0x53eca9=a100_0x1d2a91[_0x54f706(0x1a9)](_0x152245);if(isJourneyDef(_0x53eca9)){const _0x2f5c10=a100_0x348012(_0x152245);_0x3b698c[_0x54f706(0x1b9)]({'yamlConfig':_0x2f5c10,'folderPath':_0x206c36,'sourcePath':_0x3a2a68});}else{if(!_0xb2c001?.[_0x54f706(0x19e)]){const _0x2c671a=parseSegmentYamlFile(_0x152245),_0x5833e9=normalizeChildSegmentYaml(_0x2c671a);_0x537d82[_0x54f706(0x1b9)]({'yamlConfig':_0x5833e9,'folderPath':_0x206c36,'sourcePath':_0x3a2a68});}}}return{'segments':_0x537d82,'journeys':_0x3b698c};}export function validateParsedFiles(_0x1adca0,_0x3324d1){const _0x4fa902=a100_0xbb0e10,_0x2a538d=[];for(const {yamlConfig:_0x321591,sourcePath:_0x185572}of _0x1adca0[_0x4fa902(0x183)]){const _0x41b344=readFileSync(_0x185572,_0x4fa902(0x235)),_0x3b3064=a100_0x1d2a91[_0x4fa902(0x19f)](_0x41b344),_0x31bb7d=validateSegmentDef(_0x321591,{'source':_0x41b344,'document':_0x3b3064});if(!_0x31bb7d[_0x4fa902(0x210)]){const _0x4bdcdf=a100_0x4231b1[_0x4fa902(0x225)](_0x3324d1,_0x185572);_0x2a538d['push']({'filePath':_0x4bdcdf,'source':_0x41b344,'result':_0x31bb7d,'isJourney':![]});}}for(const {yamlConfig:_0xf3eef8,sourcePath:_0x10d7d5}of _0x1adca0[_0x4fa902(0x1b8)]){const _0x494052=readFileSync(_0x10d7d5,_0x4fa902(0x235)),_0x4fd205=a100_0x1d2a91[_0x4fa902(0x19f)](_0x494052),_0x28d909=validateJourneyDef(_0xf3eef8,{'source':_0x494052,'document':_0x4fd205});if(!_0x28d909['valid']){const _0x2fc4a2=a100_0x4231b1[_0x4fa902(0x225)](_0x3324d1,_0x10d7d5);_0x2a538d[_0x4fa902(0x1b9)]({'filePath':_0x2fc4a2,'source':_0x494052,'result':_0x28d909,'isJourney':!![]});}}return _0x2a538d;}export function formatValidationErrors(_0x188bf6){const _0x28a7de=a100_0xbb0e10,_0x33ab14=[];for(const {filePath:_0x108856,source:_0x17f26b,result:_0x2fc57d,isJourney:_0xd38922}of _0x188bf6){const _0x1dff1d=_0xd38922?_0x28a7de(0x16e):'segment';_0x33ab14[_0x28a7de(0x1b9)]('\x0a'+_0x108856+'\x20('+_0x1dff1d+_0x28a7de(0x1ac)+_0x2fc57d[_0x28a7de(0x1bd)][_0x28a7de(0x1c2)]+_0x28a7de(0x256)),_0x33ab14[_0x28a7de(0x1b9)](formatValidationResult(_0x2fc57d,_0x17f26b,_0x108856));}return _0x33ab14[_0x28a7de(0x1c8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x58b97d){const _0x139147=a100_0xbb0e10,_0x378b8b=new Set(),_0x3e09b4=new Map(),_0x3d92d1=collectSegmentUsageCounts(_0x58b97d);if(_0x58b97d['segments'])for(const [_0x3020b2,_0x590ca3]of Object[_0x139147(0x214)](_0x58b97d[_0x139147(0x183)])){_0x378b8b['add'](_0x3020b2);if(_0x590ca3[_0x139147(0x188)]){const _0x1546d7=yamlRuleToApi(_0x590ca3['rule']),_0x12c5f1=apiRuleToYaml(_0x1546d7);_0x3e09b4[_0x139147(0x1b2)](_0x3020b2,_0x12c5f1);}}const _0x26fad2=new Map();let _0x5573af=0x0;for(const [_0x250411,_0x439ae8]of _0x3e09b4){const _0x360cd9=serializeExpandedRule(_0x439ae8,_0x3e09b4),_0x5d581c=_0x26fad2[_0x139147(0x200)](_0x360cd9)||[];_0x5d581c[_0x139147(0x1b9)]({'name':_0x250411,'index':_0x5573af}),_0x26fad2[_0x139147(0x1b2)](_0x360cd9,_0x5d581c),_0x5573af++;}const _0x368dc9=new Map();for(const [_0x3ea8cd,_0x289bf6]of _0x26fad2){const _0x3f6a76=_0x289bf6['slice']()[_0x139147(0x18f)]((_0x2b9f74,_0x6c9cf8)=>{const _0x34e81b=_0x139147,_0x4304fc=_0x3d92d1['get'](_0x2b9f74[_0x34e81b(0x19d)])||0x0,_0x330c58=_0x3d92d1[_0x34e81b(0x200)](_0x6c9cf8[_0x34e81b(0x19d)])||0x0;if(_0x4304fc!==_0x330c58)return _0x330c58-_0x4304fc;return _0x2b9f74[_0x34e81b(0x1a0)]-_0x6c9cf8[_0x34e81b(0x1a0)];})['map'](_0x17259f=>_0x17259f['name']),_0x20b129=[];for(const _0x21707b of _0x3f6a76){const _0x3625a5=_0x3d92d1['get'](_0x21707b)||0x0,_0x39f01f=Math[_0x139147(0x168)](_0x3625a5,0x1);for(let _0xedcd8d=0x0;_0xedcd8d<_0x39f01f;_0xedcd8d++){_0x20b129[_0x139147(0x1b9)](_0x21707b);}}_0x368dc9['set'](_0x3ea8cd,_0x20b129);}return{'existingLocalSegmentNames':_0x378b8b,'localSegmentRules':_0x3e09b4,'localExpandedRuleToNames':_0x368dc9};}async function buildServerSegmentRuleMap(_0x23dab1,_0x12a760,_0x4b1df5,_0x2bd7fa){const _0x574572=new Map(),_0x20a971=new Set(),_0x2c715b=async _0x5ced64=>{const _0x362ed4=a100_0x5743;if(_0x20a971[_0x362ed4(0x1f0)](_0x5ced64))return;_0x20a971[_0x362ed4(0x187)](_0x5ced64);let _0x6f3c39=_0x4b1df5[_0x362ed4(0x247)](_0x4469e4=>_0x4469e4['id']===_0x5ced64);if(!_0x6f3c39)try{_0x6f3c39=await _0x23dab1[_0x362ed4(0x216)][_0x362ed4(0x21b)](_0x12a760,_0x5ced64);}catch{return;}if(!_0x6f3c39?.[_0x362ed4(0x188)])return;const _0x5334b0=apiRuleToYaml(_0x6f3c39[_0x362ed4(0x188)]);_0x574572[_0x362ed4(0x1b2)](_0x5ced64,_0x5334b0);const _0x51cc04=collectSegmentRefsFromRule(_0x5334b0);for(const _0x470369 of _0x51cc04){await _0x2c715b(_0x470369);}};for(const _0x2638d of _0x2bd7fa){await _0x2c715b(_0x2638d);}return _0x574572;}export function createSegmentIdResolver(_0xcf9d7,_0x53bc12){return async _0x28c612=>{const _0x3cd8eb=a100_0x5743,_0x3c0363=_0xcf9d7[_0x3cd8eb(0x200)](_0x28c612);if(!_0x3c0363)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3cd8eb(0x237)+_0x28c612+_0x3cd8eb(0x1b4)+_0x53bc12+'\x27)');return _0x3c0363;};}export function extractRootFolderId(_0x419bea){const _0x5284e7=a100_0xbb0e10;return _0x419bea[_0x5284e7(0x1a8)]?.['parentSegmentFolder']?.[_0x5284e7(0x207)]?.['id']||_0x419bea[_0x5284e7(0x1a8)]?.[_0x5284e7(0x1a3)]?.[_0x5284e7(0x207)]?.['id'];}export function buildConnectionMaps(_0x451dc5){const _0x351b20=a100_0xbb0e10,_0x141765=new Map(),_0x3e8b66=new Map(),_0x1278f6=new Map();for(const _0x4d0bfe of _0x451dc5){_0x141765[_0x351b20(0x1b2)](_0x4d0bfe[_0x351b20(0x19d)],parseInt(_0x4d0bfe['id'],0xa)),_0x3e8b66[_0x351b20(0x1b2)](_0x4d0bfe['id'],_0x4d0bfe[_0x351b20(0x19d)]),_0x1278f6['set'](_0x4d0bfe[_0x351b20(0x19d)],_0x4d0bfe['type']);}return{'nameToId':_0x141765,'idToName':_0x3e8b66,'nameToType':_0x1278f6};}export function calculatePushStats(_0x48b4f3,_0x5cb54e,_0x3e6edc,_0x78ded1,_0x8c23ec,_0x596a91,_0x352f3d){const _0x398c1f=a100_0xbb0e10,_0x44caf6=_0x48b4f3[_0x398c1f(0x180)](_0x1d9163=>_0x1d9163[_0x398c1f(0x230)]),_0x16e9d4=_0x48b4f3['filter'](_0x5b6ae4=>!_0x5b6ae4[_0x398c1f(0x230)]&&_0x5b6ae4[_0x398c1f(0x21f)]),_0x1b1225=_0x48b4f3[_0x398c1f(0x180)](_0x381c80=>!_0x381c80[_0x398c1f(0x230)]&&!_0x381c80[_0x398c1f(0x21f)]),_0x289707=_0x596a91?_0x78ded1:[],_0x4495e1=_0x5cb54e[_0x398c1f(0x180)](_0x8e0745=>_0x8e0745[_0x398c1f(0x230)]),_0x4ef911=_0x5cb54e[_0x398c1f(0x180)](_0x3ad10b=>!_0x3ad10b['isNew']&&_0x3ad10b['hasChanges']),_0x536259=_0x5cb54e['filter'](_0x53c060=>!_0x53c060[_0x398c1f(0x230)]&&!_0x53c060[_0x398c1f(0x21f)]),_0x2455c6=_0x596a91?_0x8c23ec:[],_0x8056f3=_0x48b4f3[_0x398c1f(0x1fb)](_0x4104c1=>_0x4104c1['activationActions']),_0x397694=_0x8056f3[_0x398c1f(0x180)](_0x3de2fd=>_0x3de2fd[_0x398c1f(0x1f1)]===_0x398c1f(0x238)),_0x1f6574=_0x8056f3['filter'](_0x169ba4=>_0x169ba4['type']===_0x398c1f(0x232)),_0x235364=_0x8056f3[_0x398c1f(0x180)](_0x1e784c=>_0x1e784c[_0x398c1f(0x1f1)]===_0x398c1f(0x217)),_0x3db363=Array[_0x398c1f(0x1be)](_0x3e6edc)['sort'](),_0x112afe=_0x352f3d?![]:_0x44caf6['length']>0x0||_0x16e9d4[_0x398c1f(0x1c2)]>0x0||_0x289707[_0x398c1f(0x1c2)]>0x0,_0x1d3a7a=_0x4495e1['length']>0x0||_0x4ef911['length']>0x0||_0x2455c6[_0x398c1f(0x1c2)]>0x0,_0x2809bb=_0x352f3d?![]:_0x8056f3[_0x398c1f(0x1c2)]>0x0,_0x394f1c=_0x3db363[_0x398c1f(0x1c2)]>0x0;return{'segments':{'new':_0x44caf6,'changed':_0x16e9d4,'unchanged':_0x1b1225,'toDelete':_0x289707},'journeys':{'new':_0x4495e1,'changed':_0x4ef911,'unchanged':_0x536259,'toDelete':_0x2455c6},'activations':{'all':_0x8056f3,'toCreate':_0x397694,'toUpdate':_0x1f6574,'toDelete':_0x235364},'folders':{'toCreate':_0x3db363},'counts':{'segments':{'new':_0x44caf6[_0x398c1f(0x1c2)],'changed':_0x16e9d4['length'],'unchanged':_0x1b1225['length'],'toDelete':_0x289707[_0x398c1f(0x1c2)]},'journeys':{'new':_0x4495e1[_0x398c1f(0x1c2)],'changed':_0x4ef911[_0x398c1f(0x1c2)],'unchanged':_0x536259[_0x398c1f(0x1c2)],'toDelete':_0x2455c6[_0x398c1f(0x1c2)]},'activations':{'create':_0x397694[_0x398c1f(0x1c2)],'update':_0x1f6574[_0x398c1f(0x1c2)],'delete':_0x235364[_0x398c1f(0x1c2)]},'folders':_0x3db363['length']},'hasChanges':_0x112afe||_0x1d3a7a||_0x2809bb||_0x394f1c};}export async function buildPushExecutionContext(_0x5a11b1,_0x13b098,_0x4f0077,_0x317f12,_0x58f903,_0x36c386){const _0x132ccd=a100_0xbb0e10,_0x2209b6=extractRootFolderId(_0x4f0077),{pathToId:_0x336290,idToPath:_0x261f85}=buildFolderMaps(_0x58f903),_0x189f63=buildSegmentNameToIdMap(_0x317f12),_0x5288e=new Map(),{batchAsync:_0x457653}=await import(_0x132ccd(0x19a)),[_0x4c2067,_0x84da0c]=await Promise[_0x132ccd(0x192)]([_0x5a11b1[_0x132ccd(0x197)][_0x132ccd(0x16c)](),_0x5a11b1[_0x132ccd(0x1ce)][_0x132ccd(0x1bc)](),((async()=>{const _0x1d90da=_0x132ccd;!_0x36c386&&_0x317f12[_0x1d90da(0x1c2)]>0x0&&await _0x457653(_0x317f12,async _0x4cbda5=>{const _0x32f9b8=_0x1d90da,_0x201de1=await _0x5a11b1[_0x32f9b8(0x216)][_0x32f9b8(0x1eb)](_0x13b098,_0x4cbda5['id']);_0x5288e[_0x32f9b8(0x1b2)](_0x4cbda5['id'],_0x201de1);});})())]),{emailToId:_0x1bafc3,idToEmail:_0x552b13}=_0x4c2067,_0x1e5a93=buildConnectionMaps(_0x84da0c);return{'rootFolderId':_0x2209b6,'folderPathToId':_0x336290,'folderIdToPath':_0x261f85,'segmentNameToId':_0x189f63,'activationsBySegmentId':_0x5288e,'emailToIdMap':_0x1bafc3,'idToEmailMap':_0x552b13,'connectionNameToIdMap':_0x1e5a93[_0x132ccd(0x218)],'connectionIdToNameMap':_0x1e5a93[_0x132ccd(0x22c)],'connectionNameToTypeMap':_0x1e5a93[_0x132ccd(0x1c4)]};}export function createPushYamlContextForBundle(_0x2f6ec0,_0x11c7d7,_0x267df1,_0x6f7c4b,_0x30473b,_0x435fcf,_0x3f7da4,_0x439e0a){const {existingLocalSegmentNames:_0x4f73be,localExpandedRuleToNames:_0xd7bd6a}=_0x6f7c4b,_0x20e540=new Set(),_0x7ac440=new Map(),_0xdb4cd5=new Map(),_0x59eefa=new Map(),_0x27cee6=createJumpTargetCache(),_0x2015c0=new Map(),_0x4e1f0c=new Map(),_0x2252b0=new Set();let _0x466bbc;const _0x1bf1b0=_0x49eaef=>{const _0x42bfcc={'resolveSegment':async _0x47309b=>{const _0x5d8090=a100_0x5743,_0x470412=_0x59eefa[_0x5d8090(0x200)](_0x47309b);if(_0x470412!==undefined)return{'name':_0x470412,'isJourneyLocal':!![]};try{let _0x4a083c=_0x267df1[_0x5d8090(0x247)](_0x15a95e=>_0x15a95e['id']===_0x47309b);!_0x4a083c&&(_0x4a083c=await _0x2f6ec0[_0x5d8090(0x216)][_0x5d8090(0x21b)](_0x11c7d7,_0x47309b));const _0x9bd3c2=generateJourneyLocalName(_0x4a083c[_0x5d8090(0x19d)]),_0x5f5626=_0x4a083c[_0x5d8090(0x1ae)]===SEGMENT_KIND_JOURNEY&&_0x9bd3c2!==undefined;let _0x59d88a=_0x4a083c[_0x5d8090(0x19d)],_0x37b3f4;if(_0x5f5626&&_0x4a083c[_0x5d8090(0x188)]){const _0x378b34=apiRuleToYaml(_0x4a083c[_0x5d8090(0x188)]);_0x4e1f0c['set'](_0x47309b,_0x378b34);const _0x55c544=async _0x37bf80=>{const _0x3dcfbc=_0x5d8090,_0x2d5477=collectSegmentRefsFromRule(_0x37bf80);for(const _0x51642f of _0x2d5477){if(!_0x4e1f0c[_0x3dcfbc(0x1f0)](_0x51642f))try{const _0x1219fe=await _0x2f6ec0['segment'][_0x3dcfbc(0x21b)](_0x11c7d7,_0x51642f);if(_0x1219fe?.['rule']){const _0x18efe8=apiRuleToYaml(_0x1219fe[_0x3dcfbc(0x188)]);_0x4e1f0c['set'](_0x51642f,_0x18efe8),await _0x55c544(_0x18efe8);}}catch{}}};await _0x55c544(_0x378b34);const _0x2406c5=serializeExpandedRule(_0x378b34,_0x4e1f0c),_0x586ec9=_0xd7bd6a[_0x5d8090(0x200)](_0x2406c5);if(_0x586ec9&&_0x586ec9[_0x5d8090(0x1c2)]>0x0){const _0x4cd535=_0x7ac440['get'](_0x2406c5)||0x0,_0x371783=_0x586ec9[_0x4cd535]||_0x586ec9[_0x586ec9[_0x5d8090(0x1c2)]-0x1];_0x7ac440[_0x5d8090(0x1b2)](_0x2406c5,_0x4cd535+0x1),_0x59d88a=_0x371783,_0x20e540[_0x5d8090(0x187)](_0x59d88a),_0x59eefa[_0x5d8090(0x1b2)](_0x47309b,_0x59d88a);const _0x1b2bbf=await resolveRuleSegmentRefs(_0x378b34,async _0x507d75=>{const _0x3c3237=_0x5d8090,_0x1cd0cd=_0x59eefa[_0x3c3237(0x200)](_0x507d75);if(_0x1cd0cd)return _0x1cd0cd;const _0x244ff3=await _0x466bbc[_0x3c3237(0x220)](_0x507d75);return _0x244ff3['name'];});_0x37b3f4={'description':_0x4a083c[_0x5d8090(0x20d)],'rule':_0x1b2bbf};}else{const _0x2edf5a=_0x2015c0[_0x5d8090(0x200)](_0x2406c5);if(_0x2edf5a)_0x59d88a=_0x2edf5a,_0x59eefa['set'](_0x47309b,_0x59d88a);else{if(_0x9bd3c2){let _0x4027a5=_0x9bd3c2,_0x5d0ed1=0x2;while(_0x20e540[_0x5d8090(0x1f0)](_0x4027a5)||_0x4f73be[_0x5d8090(0x1f0)](_0x4027a5)){_0x4027a5=_0x9bd3c2+'_'+_0x5d0ed1,_0x5d0ed1++;}_0x20e540[_0x5d8090(0x187)](_0x4027a5),_0x59d88a=_0x4027a5;}_0x59eefa[_0x5d8090(0x1b2)](_0x47309b,_0x59d88a),_0x2015c0['set'](_0x2406c5,_0x59d88a);const _0x4c844c=await resolveRuleSegmentRefs(_0x378b34,async _0x12d346=>{const _0x43636c=_0x5d8090,_0x576aa4=_0x59eefa[_0x43636c(0x200)](_0x12d346);if(_0x576aa4)return _0x576aa4;const _0x5a57ae=await _0x466bbc[_0x43636c(0x220)](_0x12d346);return _0x5a57ae[_0x43636c(0x19d)];});_0x37b3f4={'description':_0x4a083c[_0x5d8090(0x20d)],'rule':_0x4c844c};}}}return{'name':_0x59d88a,'isJourneyLocal':_0x5f5626,'definition':_0x37b3f4};}catch{return{'name':_0x47309b,'isJourneyLocal':![]};}},'resolveActivation':async _0x28ae88=>{const _0x21b860=a100_0x5743,_0x431931=_0xdb4cd5['get'](_0x28ae88);if(_0x431931!==undefined)return{'name':_0x431931,'isJourneyLocal':!![]};try{let _0x3fd568=_0x3f7da4?.['get'](_0x28ae88);!_0x3fd568&&(_0x3fd568=await _0x2f6ec0[_0x21b860(0x16e)][_0x21b860(0x195)](_0x49eaef,_0x28ae88));const _0x52b3e7=_0x3fd568[_0x21b860(0x20e)][_0x21b860(0x1da)][_0x21b860(0x19d)]||_0x28ae88,_0x14303a=sanitizeYamlKey(_0x52b3e7)||_0x21b860(0x1ea)+_0x28ae88,_0x4d9668=_0x14303a;_0xdb4cd5[_0x21b860(0x1b2)](_0x28ae88,_0x4d9668);const _0x3ffae5=journeyActivationStepToYaml(_0x3fd568,_0x30473b,_0x435fcf);return{'name':_0x4d9668,'isJourneyLocal':!![],'definition':_0x3ffae5};}catch{return{'name':_0x28ae88,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2fe4ee,_0x2a8eca)=>resolveJumpTarget(_0x2fe4ee,_0x2a8eca,_0x27cee6,async _0x53ceed=>{const _0x14afca=a100_0x5743,_0x1b5da0=_0x439e0a?.['get'](_0x53ceed);if(_0x1b5da0)return _0x1b5da0;return _0x2f6ec0[_0x14afca(0x16e)]['getJourney'](_0x53ceed);})};return _0x466bbc=_0x42bfcc,_0x42bfcc;},_0x466fb7=async _0x2c28c3=>{const _0x482231=a100_0x5743,{collectSegmentIdsFromJourneyApi:_0x5a8934}=await import(_0x482231(0x1c7)),{batchAsync:_0x3a33d6}=await import(_0x482231(0x19a)),_0x56c1b4=new Set();for(const _0x4a6a41 of _0x2c28c3){let _0x4e2ff3=_0x439e0a?.[_0x482231(0x200)](_0x4a6a41);!_0x4e2ff3&&(_0x4e2ff3=await _0x2f6ec0[_0x482231(0x16e)][_0x482231(0x185)](_0x4a6a41));const _0x39d1f3=_0x5a8934(_0x4e2ff3);for(const _0x2ff244 of _0x39d1f3){_0x56c1b4[_0x482231(0x187)](_0x2ff244);}}let _0x3a663a=Array['from'](_0x56c1b4);while(_0x3a663a[_0x482231(0x1c2)]>0x0){const _0x4320da=_0x3a663a[_0x482231(0x180)](_0x2526c5=>!_0x2252b0[_0x482231(0x1f0)](_0x2526c5));if(_0x4320da[_0x482231(0x1c2)]===0x0)break;const _0x693414=await _0x3a33d6(_0x4320da,async _0x871feb=>{const _0x555c5c=_0x482231;_0x2252b0['add'](_0x871feb);let _0x337390=_0x267df1[_0x555c5c(0x247)](_0x44973f=>_0x44973f['id']===_0x871feb);if(!_0x337390)try{_0x337390=await _0x2f6ec0['segment'][_0x555c5c(0x21b)](_0x11c7d7,_0x871feb);}catch{return null;}return{'segmentId':_0x871feb,'segment':_0x337390};},0xa),_0x4edd7a=new Set();for(const _0x3616b8 of _0x693414){if(!_0x3616b8?.[_0x482231(0x216)]?.[_0x482231(0x188)])continue;const _0x5ec4b5=apiRuleToYaml(_0x3616b8['segment'][_0x482231(0x188)]);_0x4e1f0c[_0x482231(0x1b2)](_0x3616b8['segmentId'],_0x5ec4b5);const _0x2de6bf=collectSegmentRefsFromRule(_0x5ec4b5);for(const _0x65abb6 of _0x2de6bf){!_0x2252b0[_0x482231(0x1f0)](_0x65abb6)&&_0x4edd7a[_0x482231(0x187)](_0x65abb6);}}_0x3a663a=Array[_0x482231(0x1be)](_0x4edd7a);}};return{'createYamlContext':_0x1bf1b0,'prefetchJourneySegments':_0x466fb7};}export async function executePushSegments(_0x301ac6,_0x1f0ba8,_0x2d761e,_0x1ad984,_0x4f851c){const _0x1e36c4=a100_0xbb0e10,{segmentDefToCreateRequest:_0x59453e,segmentDefToUpdateRequest:_0x3025b6}=await import('./child-segment-yaml.js'),_0x2b6b6f=_0x2d761e[_0x1e36c4(0x1df)],_0x4813cf=0x5,_0x10d045=async _0x23fe8a=>{const _0x11e2fc=_0x1e36c4,_0x522781=_0x23fe8a[_0x11e2fc(0x1b3)]?_0x2b6b6f['get'](_0x23fe8a[_0x11e2fc(0x1b3)]):undefined;let _0xe7c3bd;const _0x44b5e4={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x23fe8a[_0x11e2fc(0x230)]){_0x4f851c[_0x11e2fc(0x233)]?.({'type':'segment_creating','name':_0x23fe8a[_0x11e2fc(0x1c9)][_0x11e2fc(0x19d)]});const _0x5ea2ec=_0x59453e(_0x23fe8a[_0x11e2fc(0x1c9)],_0x522781),_0x12a8db=await _0x4f851c[_0x11e2fc(0x172)](_0x11e2fc(0x244)+_0x23fe8a['yamlConfig']['name']+_0x11e2fc(0x1d4),()=>_0x301ac6[_0x11e2fc(0x216)][_0x11e2fc(0x17f)](_0x1ad984[_0x11e2fc(0x224)],_0x5ea2ec));_0xe7c3bd=_0x12a8db[_0x11e2fc(0x207)]['id'],_0x44b5e4[_0x11e2fc(0x182)]={'name':_0x23fe8a['yamlConfig']['name'],'id':_0xe7c3bd},_0x4f851c[_0x11e2fc(0x233)]?.({'type':_0x11e2fc(0x17a),'name':_0x23fe8a[_0x11e2fc(0x1c9)][_0x11e2fc(0x19d)],'segmentId':_0xe7c3bd}),_0x4f851c[_0x11e2fc(0x171)]?.(_0x11e2fc(0x212)+_0x23fe8a['yamlConfig'][_0x11e2fc(0x19d)]+'\x27'),_0x44b5e4[_0x11e2fc(0x1bf)]=0x1;}else{if(_0x23fe8a['hasChanges']){_0x4f851c[_0x11e2fc(0x233)]?.({'type':_0x11e2fc(0x1d7),'name':_0x23fe8a[_0x11e2fc(0x1c9)]['name']});const _0x2bc571=_0x3025b6(_0x23fe8a['yamlConfig']);_0x522781!==_0x23fe8a['existingSegment']?.[_0x11e2fc(0x1d5)]&&(_0x2bc571[_0x11e2fc(0x1d5)]=_0x522781?parseInt(_0x522781,0xa):undefined),await _0x4f851c['withProgress']('Updating\x20segment\x20\x27'+_0x23fe8a[_0x11e2fc(0x1c9)][_0x11e2fc(0x19d)]+_0x11e2fc(0x1d4),()=>_0x301ac6[_0x11e2fc(0x216)][_0x11e2fc(0x243)](_0x1ad984[_0x11e2fc(0x224)],_0x23fe8a[_0x11e2fc(0x20b)]['id'],_0x2bc571)),_0xe7c3bd=_0x23fe8a[_0x11e2fc(0x20b)]['id'],_0x4f851c['onProgress']?.({'type':_0x11e2fc(0x16d),'name':_0x23fe8a[_0x11e2fc(0x1c9)][_0x11e2fc(0x19d)]}),_0x4f851c[_0x11e2fc(0x171)]?.(_0x11e2fc(0x176)+_0x23fe8a[_0x11e2fc(0x1c9)][_0x11e2fc(0x19d)]+'\x27'),_0x44b5e4[_0x11e2fc(0x242)]=0x1;}else _0xe7c3bd=_0x23fe8a['existingSegment']['id'];}}catch(_0x1332ab){const _0xe498dc=isHttp400Error(_0x1332ab),_0x34f2b4=_0xe498dc?ErrorCode[_0x11e2fc(0x1b7)]:ErrorCode[_0x11e2fc(0x1f4)],_0x367d1a=getErrorMessage(_0x1332ab);throw new SDKError(_0x34f2b4,'Failed\x20to\x20'+(_0x23fe8a[_0x11e2fc(0x230)]?_0x11e2fc(0x238):_0x11e2fc(0x232))+_0x11e2fc(0x1e9)+_0x23fe8a[_0x11e2fc(0x1b6)]+_0x11e2fc(0x175)+_0x367d1a,_0x1332ab);}try{const _0x27d5cd=await syncActivationsForSegment(_0x301ac6,_0x1ad984[_0x11e2fc(0x224)],_0xe7c3bd,_0x23fe8a['yamlConfig'][_0x11e2fc(0x19d)],_0x23fe8a['activationActions'],_0x4f851c,_0x23fe8a['absolutePath']);_0x44b5e4[_0x11e2fc(0x1a2)]=_0x27d5cd;}catch(_0x2602ff){if(_0x2602ff instanceof SDKError)throw _0x2602ff;throw new SDKError(ErrorCode[_0x11e2fc(0x23d)],_0x11e2fc(0x202)+_0x23fe8a['yamlConfig'][_0x11e2fc(0x19d)]+_0x11e2fc(0x22f)+_0x23fe8a[_0x11e2fc(0x1b6)]+_0x11e2fc(0x175)+getErrorMessage(_0x2602ff),_0x2602ff);}return _0x44b5e4;},_0x577de8=await batchAsync(_0x1f0ba8,_0x10d045,_0x4813cf),_0x51826b={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1a744b of _0x577de8){_0x51826b[_0x1e36c4(0x1bf)]+=_0x1a744b[_0x1e36c4(0x1bf)],_0x51826b[_0x1e36c4(0x242)]+=_0x1a744b[_0x1e36c4(0x242)],_0x1a744b[_0x1e36c4(0x182)]&&_0x51826b[_0x1e36c4(0x184)]['set'](_0x1a744b[_0x1e36c4(0x182)][_0x1e36c4(0x19d)],_0x1a744b[_0x1e36c4(0x182)]['id']),_0x51826b['activations']['created']+=_0x1a744b[_0x1e36c4(0x1a2)][_0x1e36c4(0x1bf)],_0x51826b[_0x1e36c4(0x1a2)][_0x1e36c4(0x242)]+=_0x1a744b[_0x1e36c4(0x1a2)][_0x1e36c4(0x242)],_0x51826b[_0x1e36c4(0x1a2)]['deleted']+=_0x1a744b[_0x1e36c4(0x1a2)]['deleted'];}return _0x51826b;}async function syncActivationsForSegment(_0x5bbc2e,_0x562def,_0x20ea0f,_0x2f2140,_0x757bd8,_0x3b750b,_0x223318){const _0x540677=a100_0xbb0e10,_0x574526={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x57aea6 of _0x757bd8){try{if(_0x57aea6[_0x540677(0x1f1)]===_0x540677(0x238)&&_0x57aea6[_0x540677(0x21c)])_0x3b750b[_0x540677(0x233)]?.({'type':_0x540677(0x252),'segmentName':_0x2f2140,'activationName':_0x57aea6[_0x540677(0x19d)]}),await _0x3b750b['withProgress'](_0x540677(0x1c0)+_0x57aea6['name']+_0x540677(0x1d4),()=>_0x5bbc2e[_0x540677(0x216)]['createActivation'](_0x562def,_0x20ea0f,_0x57aea6[_0x540677(0x21c)])),_0x3b750b['onProgress']?.({'type':_0x540677(0x240),'segmentName':_0x2f2140,'activationName':_0x57aea6['name']}),_0x3b750b[_0x540677(0x171)]?.(_0x540677(0x1fd)+_0x57aea6[_0x540677(0x19d)]+'\x27'),_0x574526[_0x540677(0x1bf)]++;else{if(_0x57aea6['type']===_0x540677(0x232)&&_0x57aea6[_0x540677(0x21c)]&&_0x57aea6['existingActivation'])_0x3b750b['onProgress']?.({'type':_0x540677(0x1ed),'segmentName':_0x2f2140,'activationName':_0x57aea6['name']}),await _0x3b750b[_0x540677(0x172)](_0x540677(0x226)+_0x57aea6[_0x540677(0x19d)]+_0x540677(0x1d4),()=>_0x5bbc2e[_0x540677(0x216)][_0x540677(0x190)](_0x562def,_0x20ea0f,_0x57aea6[_0x540677(0x253)]['id'],_0x57aea6[_0x540677(0x21c)])),_0x3b750b[_0x540677(0x233)]?.({'type':_0x540677(0x239),'segmentName':_0x2f2140,'activationName':_0x57aea6[_0x540677(0x19d)]}),_0x3b750b[_0x540677(0x171)]?.(_0x540677(0x18a)+_0x57aea6[_0x540677(0x19d)]+'\x27'),_0x574526[_0x540677(0x242)]++;else _0x57aea6[_0x540677(0x1f1)]==='delete'&&_0x57aea6['existingActivation']&&(_0x3b750b[_0x540677(0x233)]?.({'type':_0x540677(0x17c),'segmentName':_0x2f2140,'activationName':_0x57aea6[_0x540677(0x19d)]}),await _0x3b750b['withProgress'](_0x540677(0x1f8)+_0x57aea6[_0x540677(0x19d)]+_0x540677(0x1d4),()=>_0x5bbc2e[_0x540677(0x216)][_0x540677(0x251)](_0x562def,_0x20ea0f,_0x57aea6[_0x540677(0x253)]['id'])),_0x3b750b['onProgress']?.({'type':_0x540677(0x24b),'segmentName':_0x2f2140,'activationName':_0x57aea6[_0x540677(0x19d)]}),_0x3b750b['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x57aea6['name']+'\x27'),_0x574526[_0x540677(0x24f)]++);}}catch(_0x15b896){const _0x403709=isHttp400Error(_0x15b896),_0x279f21=_0x403709?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x540677(0x23d)],_0x42ae21=getErrorMessage(_0x15b896);throw new SDKError(_0x279f21,_0x540677(0x236)+_0x57aea6['type']+_0x540677(0x22d)+_0x57aea6[_0x540677(0x19d)]+_0x540677(0x22f)+_0x223318+'\x0a\x20\x20'+_0x42ae21,_0x15b896);}}return _0x574526;}export async function executePushFolders(_0x3aac63,_0x27bfb1,_0x9fdd5a,_0x489cdc,_0x1f8f98){const _0x4b099b=a100_0xbb0e10,_0x506e85=new Map(_0x9fdd5a);for(const _0x1d38d7 of _0x27bfb1){const _0x13e542=_0x1d38d7['split']('/'),_0x48f7a3=_0x13e542[_0x13e542[_0x4b099b(0x1c2)]-0x1],_0x4eaa42=_0x13e542[_0x4b099b(0x1a1)](0x0,-0x1)[_0x4b099b(0x1c8)]('/'),_0xbb6d50=_0x506e85['get'](_0x4eaa42);_0x1f8f98[_0x4b099b(0x233)]?.({'type':_0x4b099b(0x223),'folder':_0x1d38d7});const _0x20af2f={'name':_0x48f7a3,'parentFolderId':_0xbb6d50},_0x14aef3=await _0x1f8f98[_0x4b099b(0x172)](_0x4b099b(0x1b1)+_0x1d38d7+'\x27...',()=>_0x3aac63['segment'][_0x4b099b(0x231)](_0x489cdc[_0x4b099b(0x224)],_0x20af2f));_0x506e85[_0x4b099b(0x1b2)](_0x1d38d7,_0x14aef3[_0x4b099b(0x207)]['id']),_0x1f8f98['onProgress']?.({'type':_0x4b099b(0x18e),'folder':_0x1d38d7,'folderId':_0x14aef3[_0x4b099b(0x207)]['id']}),_0x1f8f98['logInfo']?.('Created\x20folder\x20\x27'+_0x1d38d7+'\x27');}return _0x506e85;}export async function executePushSegmentDeletions(_0x259c99,_0x47e4cc,_0x39d02a){if(_0x47e4cc['length']===0x0)return 0x0;const {batchAsync:_0x523121}=await import('../../utils/async.js'),_0x34bd15=0x5,_0xa44664=await _0x523121(_0x47e4cc,async _0x62db64=>{const _0x517c16=a100_0x5743;return _0x39d02a[_0x517c16(0x233)]?.({'type':'segment_deleting','name':_0x62db64[_0x517c16(0x19d)]}),await _0x259c99[_0x517c16(0x216)]['deleteSegment'](_0x62db64['id']),_0x39d02a[_0x517c16(0x233)]?.({'type':_0x517c16(0x167),'name':_0x62db64[_0x517c16(0x19d)]}),_0x39d02a[_0x517c16(0x1ab)]?.(_0x517c16(0x1cb)+_0x62db64[_0x517c16(0x19d)]+'\x27'),0x1;},_0x34bd15);return _0xa44664['reduce']((_0x4552bd,_0xe9f1ae)=>_0x4552bd+_0xe9f1ae,0x0);}export async function executePushJourneys(_0x234d71,_0x384e47,_0x32d52c,_0x8459ec,_0x3e9ce7){const _0x11a42e=a100_0xbb0e10,{journeyDefToRequest:_0x349bd0}=await import(_0x11a42e(0x1c7)),{activationDefToCreateRequest:_0xa4a4a0,yamlRuleToApi:_0x178158,validateSegmentRule:_0x4b0b7f}=await import(_0x11a42e(0x213)),_0x189cc1={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x287ce8=new Map(_0x32d52c['segmentNameToId']),_0x50322e=0x5;for(let _0x4a2119=0x0;_0x4a2119<_0x384e47[_0x11a42e(0x1c2)];_0x4a2119+=_0x50322e){const _0x2056b6=_0x384e47[_0x11a42e(0x1a1)](_0x4a2119,_0x4a2119+_0x50322e),_0x50d843=await Promise[_0x11a42e(0x192)](_0x2056b6[_0x11a42e(0x206)](async _0x5df781=>{const _0x1daaa3=_0x11a42e;if(!_0x5df781[_0x1daaa3(0x230)]&&!_0x5df781[_0x1daaa3(0x21f)])return{'action':'unchanged','name':_0x5df781['yamlConfig'][_0x1daaa3(0x19d)],'journeyId':_0x5df781['existingJourney']?.['id']};const _0x16d4c8=_0x5df781[_0x1daaa3(0x1b3)]?_0x32d52c[_0x1daaa3(0x1df)][_0x1daaa3(0x200)](_0x5df781[_0x1daaa3(0x1b3)]):undefined;_0x3e9ce7[_0x1daaa3(0x233)]?.({'type':_0x5df781[_0x1daaa3(0x230)]?_0x1daaa3(0x204):_0x1daaa3(0x22a),'name':_0x5df781[_0x1daaa3(0x1c9)][_0x1daaa3(0x19d)]});try{const _0x102fb2=await executeSingleJourneyPush(_0x234d71,_0x5df781,{..._0x32d52c,'segmentNameToId':_0x287ce8},{'parentId':_0x8459ec[_0x1daaa3(0x224)],'rootFolderId':_0x8459ec['rootFolderId'],'folderId':_0x16d4c8,'verbose':_0x8459ec[_0x1daaa3(0x23b)]},_0x3e9ce7,{'journeyDefToRequest':_0x349bd0,'activationDefToCreateRequest':_0xa4a4a0,'yamlRuleToApi':_0x178158,'validateSegmentRule':_0x4b0b7f});for(const [_0x5afb95,_0xa1f872]of _0x102fb2['embeddedSegmentNameToId']){_0x287ce8['set'](_0x5afb95,_0xa1f872),_0x189cc1[_0x1daaa3(0x1e5)][_0x1daaa3(0x1b2)](_0x5afb95,_0xa1f872);}if(_0x102fb2['action']==='created')_0x3e9ce7[_0x1daaa3(0x233)]?.({'type':_0x1daaa3(0x17e),'name':_0x5df781['yamlConfig']['name'],'journeyId':_0x102fb2[_0x1daaa3(0x222)]}),_0x3e9ce7[_0x1daaa3(0x171)]?.(_0x1daaa3(0x248)+_0x5df781['yamlConfig'][_0x1daaa3(0x19d)]+'\x27'),_0x189cc1['created']++;else _0x102fb2[_0x1daaa3(0x1ba)]===_0x1daaa3(0x242)&&(_0x3e9ce7[_0x1daaa3(0x233)]?.({'type':_0x1daaa3(0x17d),'name':_0x5df781[_0x1daaa3(0x1c9)]['name']}),_0x3e9ce7[_0x1daaa3(0x171)]?.(_0x1daaa3(0x208)+_0x5df781['yamlConfig'][_0x1daaa3(0x19d)]+'\x27'),_0x189cc1[_0x1daaa3(0x242)]++);return{'action':_0x102fb2[_0x1daaa3(0x1ba)],'name':_0x5df781[_0x1daaa3(0x1c9)][_0x1daaa3(0x19d)],'journeyId':_0x102fb2['journeyId']};}catch(_0x13c29a){const _0x1cde83=isHttp400Error(_0x13c29a),_0x210da3=_0x1cde83?ErrorCode[_0x1daaa3(0x1f6)]:ErrorCode[_0x1daaa3(0x1e4)],_0x3c2a4d=getErrorMessage(_0x13c29a);throw new SDKError(_0x210da3,_0x1daaa3(0x236)+(_0x5df781['isNew']?_0x1daaa3(0x238):_0x1daaa3(0x232))+'\x20journey\x20from\x20file:\x20'+_0x5df781['absolutePath']+'\x0a\x20\x20'+_0x3c2a4d,_0x13c29a);}}));_0x189cc1['results'][_0x11a42e(0x1b9)](..._0x50d843);}return _0x189cc1;}async function executeSingleJourneyPush(_0x159495,_0x26fd26,_0x4c9e6d,_0x2f7887,_0x1b94c0,_0x3c97b0){const _0x1bbb93=a100_0xbb0e10,{journeyDefToRequest:_0x3ca21,activationDefToCreateRequest:_0x375aac,yamlRuleToApi:_0x43b29f,validateSegmentRule:_0x50e58a}=_0x3c97b0,_0x5b5165=new Map(),_0x2c48f7=new Map(),_0x5c9ee9=new Map(),_0x4ddecb=new Map(),_0x43d199=new Map();let _0x4f3892;const _0x3a8194=async()=>{const _0x114af8=a100_0x5743;if(_0x4f3892)return;_0x4f3892=new Map();if(!_0x26fd26['existingJourney'])return;const _0x4b2a20=await _0x159495[_0x114af8(0x16e)][_0x114af8(0x1eb)](_0x26fd26[_0x114af8(0x1e0)]['id']);for(const _0x414e79 of _0x4b2a20){const _0x3723e6=journeyActivationStepToYaml(_0x414e79,_0x4c9e6d[_0x114af8(0x22b)],_0x4c9e6d[_0x114af8(0x179)]),_0x210b5a=activationSignature(_0x3723e6);!_0x4f3892['has'](_0x210b5a)&&_0x4f3892[_0x114af8(0x1b2)](_0x210b5a,_0x414e79['id']),_0x3723e6['name']&&_0x2c48f7[_0x114af8(0x1b2)](_0x3723e6[_0x114af8(0x19d)],_0x414e79['id']);}};if(_0x26fd26[_0x1bbb93(0x1e0)]&&_0x26fd26[_0x1bbb93(0x1c9)][_0x1bbb93(0x183)]){const _0x5270df=buildLocalExpandedRuleMappings(_0x26fd26['yamlConfig']),_0x3ae4cb=_0x5270df[_0x1bbb93(0x18d)];if(_0x3ae4cb['size']>0x0){const _0x314989=new Map();for(const [_0x55ad1c,_0x4216b8]of _0x3ae4cb){const _0x50f30d=serializeExpandedRule(_0x4216b8,_0x3ae4cb);_0x314989['set'](_0x55ad1c,_0x50f30d);}const _0x45c7ec=collectSegmentIdsFromJourneyApi(_0x26fd26[_0x1bbb93(0x1e0)]);if(_0x45c7ec[_0x1bbb93(0x196)]>0x0){const _0x1d070a=await buildServerSegmentRuleMap(_0x159495,_0x2f7887[_0x1bbb93(0x224)],_0x4c9e6d[_0x1bbb93(0x1db)],_0x45c7ec);if(_0x1d070a[_0x1bbb93(0x196)]>0x0){const _0x2b4cd5=new Map();for(const [_0x5cf20d,_0x23695e]of _0x1d070a){const _0x5eee8d=serializeExpandedRule(_0x23695e,_0x1d070a);!_0x2b4cd5[_0x1bbb93(0x1f0)](_0x5eee8d)&&_0x2b4cd5[_0x1bbb93(0x1b2)](_0x5eee8d,_0x5cf20d);}for(const [_0x4e1c14,_0x268561]of _0x314989){const _0x27cabb=_0x2b4cd5[_0x1bbb93(0x200)](_0x268561);_0x27cabb&&(_0x43d199[_0x1bbb93(0x1b2)](_0x4e1c14,_0x27cabb),_0x4c9e6d[_0x1bbb93(0x1af)][_0x1bbb93(0x1b2)](_0x4e1c14,_0x27cabb));}}}}}const _0xcc1019={'resolveSegmentId':async _0x36091b=>{const _0x328d6f=_0x1bbb93,_0x384f88=_0x4c9e6d[_0x328d6f(0x1af)]['get'](_0x36091b);if(!_0x384f88)throw new SDKError(ErrorCode[_0x328d6f(0x24d)],_0x328d6f(0x237)+_0x36091b+_0x328d6f(0x203)+_0x26fd26[_0x328d6f(0x1c9)][_0x328d6f(0x19d)]+')');return _0x384f88;},'resolveEmbeddedSegmentId':async(_0x46fd75,_0x4066f5)=>{const _0x4c0643=_0x1bbb93,_0x49cb6a=_0x4c9e6d[_0x4c0643(0x1af)]['get'](_0x46fd75);if(_0x49cb6a)return _0x49cb6a;const _0x1dbe7f=_0x43d199[_0x4c0643(0x200)](_0x46fd75);if(_0x1dbe7f)return _0x4c9e6d[_0x4c0643(0x1af)][_0x4c0643(0x1b2)](_0x46fd75,_0x1dbe7f),_0x1dbe7f;const _0x5e6d25=_0x4c9e6d[_0x4c0643(0x1db)][_0x4c0643(0x247)](_0x3bc3b8=>_0x3bc3b8[_0x4c0643(0x19d)]===_0x46fd75);if(_0x5e6d25)return _0x4c9e6d[_0x4c0643(0x1af)][_0x4c0643(0x1b2)](_0x46fd75,_0x5e6d25['id']),_0x5e6d25['id'];if(_0x26fd26[_0x4c0643(0x230)]){const {stageName:_0x4c80ba,criteriaName:_0xe90512}=findSegmentCriteriaLocation(_0x26fd26[_0x4c0643(0x1c9)],_0x46fd75);return _0x50e58a(_0x46fd75,_0x4066f5['rule']),_0x5c9ee9[_0x4c0643(0x1b2)](_0x46fd75,{'definition':_0x4066f5,'stageName':_0x4c80ba,'criteriaName':_0xe90512}),createPendingSegmentId(_0x46fd75);}const _0x3d4a24=_0x26fd26[_0x4c0643(0x1e0)]?.['id'];if(!_0x3d4a24)throw new SDKError(ErrorCode[_0x4c0643(0x1bb)],_0x4c0643(0x1f3));_0x50e58a(_0x46fd75,_0x4066f5[_0x4c0643(0x188)]);const _0x417304=generateDeterministicJourneySegmentName(_0x26fd26['yamlConfig'][_0x4c0643(0x19d)],_0x46fd75),_0x5a8dab=_0x4c9e6d[_0x4c0643(0x1db)][_0x4c0643(0x247)](_0x10ba00=>_0x10ba00[_0x4c0643(0x19d)]===_0x417304),_0x31a54d=createSegmentIdResolver(_0x4c9e6d['segmentNameToId'],_0x46fd75),_0x52ef16=await resolveRuleSegmentIds(_0x4066f5['rule'],_0x31a54d);let _0x2148d1;if(_0x5a8dab)await _0x159495[_0x4c0643(0x216)]['updateSegmentById'](_0x2f7887['parentId'],_0x5a8dab['id'],{'description':_0x4066f5[_0x4c0643(0x20d)]||_0x4c0643(0x215)+_0x46fd75,'rule':_0x43b29f(_0x52ef16,!![]),'countPopulation':!![]}),_0x2148d1=_0x5a8dab['id'];else try{_0x2148d1=await _0x159495[_0x4c0643(0x216)][_0x4c0643(0x1a5)]({'name':_0x417304,'description':_0x4066f5[_0x4c0643(0x20d)]||'Entry\x20criteria:\x20'+_0x46fd75,'journeyId':_0x3d4a24,'rule':_0x43b29f(_0x52ef16,!![]),'countPopulation':!![],'parentFolderId':_0x2f7887[_0x4c0643(0x19c)]||'','audienceId':_0x2f7887['parentId']});}catch(_0x33bf83){const _0x39dbdc=_0x33bf83 instanceof Error&&_0x33bf83[_0x4c0643(0x209)][_0x4c0643(0x1cc)](_0x4c0643(0x177));if(_0x39dbdc){const _0xdacda5=await _0x159495[_0x4c0643(0x216)][_0x4c0643(0x1ad)](_0x2f7887[_0x4c0643(0x224)]),_0x312fd4=_0xdacda5['find'](_0x17929d=>_0x17929d[_0x4c0643(0x19d)]===_0x417304);if(_0x312fd4)await _0x159495[_0x4c0643(0x216)][_0x4c0643(0x243)](_0x2f7887[_0x4c0643(0x224)],_0x312fd4['id'],{'description':_0x4066f5[_0x4c0643(0x20d)]||_0x4c0643(0x215)+_0x46fd75,'rule':_0x43b29f(_0x52ef16,!![]),'countPopulation':!![]}),_0x2148d1=_0x312fd4['id'];else throw _0x33bf83;}else throw _0x33bf83;}return _0x4c9e6d[_0x4c0643(0x1af)][_0x4c0643(0x1b2)](_0x46fd75,_0x2148d1),_0x5b5165[_0x4c0643(0x1b2)](_0x46fd75,_0x2148d1),_0x2148d1;},'resolveActivationId':async _0x10fc0d=>{const _0x311c73=_0x1bbb93,_0x435a3a=_0x2c48f7['get'](_0x10fc0d);if(_0x435a3a)return _0x435a3a;if(_0x26fd26[_0x311c73(0x1e0)]){await _0x3a8194();const _0x55987f=_0x2c48f7[_0x311c73(0x200)](_0x10fc0d);if(_0x55987f)return _0x55987f;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x311c73(0x1d0)+_0x10fc0d+_0x311c73(0x203)+_0x26fd26[_0x311c73(0x1c9)]['name']+_0x311c73(0x169)+_0x311c73(0x191));},'resolveEmbeddedActivationId':async(_0x51c5e5,_0x1b7ce4)=>{const _0x183218=_0x1bbb93,_0x4d4154=_0x2c48f7['get'](_0x51c5e5);if(_0x4d4154)return _0x4d4154;if(_0x26fd26[_0x183218(0x230)])return _0x4ddecb[_0x183218(0x1b2)](_0x51c5e5,_0x1b7ce4),createPendingActivationId(_0x51c5e5);if(_0x26fd26[_0x183218(0x1e0)]){await _0x3a8194();const _0xe9d3fc=_0x2c48f7['get'](_0x1b7ce4[_0x183218(0x19d)]);if(_0xe9d3fc)return _0x2c48f7[_0x183218(0x1b2)](_0x51c5e5,_0xe9d3fc),_0xe9d3fc;const _0x47f5ce=activationSignature(_0x1b7ce4),_0x55e211=_0x4f3892?.[_0x183218(0x200)](_0x47f5ce);if(_0x55e211)return _0x2c48f7[_0x183218(0x1b2)](_0x51c5e5,_0x55e211),_0x55e211;const _0xafe7be=await _0x375aac(_0x1b7ce4,_0x4c9e6d[_0x183218(0x229)]),_0x2314b3=await _0x159495[_0x183218(0x16e)][_0x183218(0x173)](_0x26fd26[_0x183218(0x1e0)]['id'],_0xafe7be);return _0x2c48f7['set'](_0x51c5e5,_0x2314b3['id']),_0x2314b3['id'];}throw new SDKError(ErrorCode[_0x183218(0x1bb)],_0x183218(0x1f5));},'resolveJourneyId':async _0x20e3b2=>{const _0x1e20cd=_0x1bbb93;try{return await _0x159495[_0x1e20cd(0x16e)]['resolveJourneyId'](_0x2f7887[_0x1e20cd(0x224)],_0x20e3b2);}catch(_0x5869e7){throw new SDKError(ErrorCode[_0x1e20cd(0x1d1)],_0x1e20cd(0x21e)+_0x20e3b2+_0x1e20cd(0x211)+_0x26fd26[_0x1e20cd(0x1c9)]['name']+'\x27)',_0x5869e7);}},'resolveStageId':async(_0x557f78,_0x7a7b)=>{const _0x49c6e9=_0x1bbb93,_0x1ee7db=await _0x159495['journey'][_0x49c6e9(0x185)](_0x557f78),_0x182407=_0x1ee7db[_0x49c6e9(0x20e)][_0x49c6e9(0x23e)][_0x49c6e9(0x247)](_0x297b89=>_0x297b89[_0x49c6e9(0x19d)][_0x49c6e9(0x1ca)]()===_0x7a7b[_0x49c6e9(0x1ca)]());if(!_0x182407?.['id'])throw new SDKError(ErrorCode[_0x49c6e9(0x1d1)],_0x49c6e9(0x194)+_0x7a7b+_0x49c6e9(0x23a)+(_0x1ee7db[_0x49c6e9(0x20e)][_0x49c6e9(0x186)]||_0x1ee7db['attributes'][_0x49c6e9(0x19d)])+'\x27');return _0x182407['id'];}},_0x5d569f=await _0x3ca21(_0x26fd26[_0x1bbb93(0x1c9)],_0x2f7887[_0x1bbb93(0x224)],_0xcc1019),_0x34a5bf=_0x2f7887[_0x1bbb93(0x255)]||_0x2f7887['rootFolderId'];_0x34a5bf&&(_0x5d569f[_0x1bbb93(0x1a8)]={'parentFolder':{'data':{'id':_0x34a5bf,'type':_0x1bbb93(0x20f)}}});if(_0x26fd26[_0x1bbb93(0x230)]){if(_0x5c9ee9['size']>0x0||_0x4ddecb[_0x1bbb93(0x196)]>0x0)return await executeThreeStepJourneyCreate(_0x159495,_0x26fd26,_0x5d569f,{'pendingEmbeddedSegments':_0x5c9ee9,'pendingEmbeddedActivations':_0x4ddecb,'embeddedSegmentNameToId':_0x5b5165,'journeyActivationNameToId':_0x2c48f7},{..._0x2f7887,'effectiveFolderId':_0x34a5bf},_0x4c9e6d,_0x1b94c0,_0x3c97b0);else{ensureJourneyDefaults(_0x5d569f['attributes']);const _0x4cfbc4=await _0x159495[_0x1bbb93(0x16e)][_0x1bbb93(0x238)](_0x5d569f);return{'action':_0x1bbb93(0x1bf),'journeyId':_0x4cfbc4['id'],'embeddedSegmentNameToId':_0x5b5165};}}else{if(_0x26fd26['hasChanges']&&_0x26fd26[_0x1bbb93(0x1e0)])return ensureJourneyDefaults(_0x5d569f[_0x1bbb93(0x20e)]),await _0x159495['journey'][_0x1bbb93(0x232)](_0x26fd26[_0x1bbb93(0x1e0)]['id'],_0x5d569f),{'action':_0x1bbb93(0x242),'journeyId':_0x26fd26[_0x1bbb93(0x1e0)]['id'],'embeddedSegmentNameToId':_0x5b5165};}return{'action':'unchanged','journeyId':_0x26fd26['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x5b5165};}function findSegmentCriteriaLocation(_0x58f1f6,_0x39c3f6){const _0x4d5e38=a100_0xbb0e10,_0x341130=_0x58f1f6[_0x4d5e38(0x1e8)]||_0x58f1f6[_0x4d5e38(0x1b8)]?.[0x0]?.[_0x4d5e38(0x1e8)]||[];let _0x39744f=_0x4d5e38(0x1d3),_0xffb879=_0x39c3f6;const _0x471a16=_0x58f1f6['goal']||_0x58f1f6[_0x4d5e38(0x1b8)]?.[0x0]?.['goal'];if(_0x471a16?.[_0x4d5e38(0x216)]===_0x39c3f6)return{'stageName':'goal','criteriaName':_0x471a16[_0x4d5e38(0x19d)]||_0x39c3f6};_0x159f42:for(const _0x33c3c3 of _0x341130){if(_0x33c3c3[_0x4d5e38(0x16f)]?.[_0x4d5e38(0x216)]===_0x39c3f6){_0x39744f=_0x33c3c3[_0x4d5e38(0x19d)],_0xffb879=_0x33c3c3[_0x4d5e38(0x16f)][_0x4d5e38(0x19d)]||_0x39c3f6;break;}if(_0x33c3c3['steps'])for(const _0x3ee189 of _0x33c3c3[_0x4d5e38(0x205)]){if(_0x3ee189[_0x4d5e38(0x1f1)]==='decision_point'&&_0x3ee189['with']?.[_0x4d5e38(0x24c)])for(const _0x2b202e of _0x3ee189[_0x4d5e38(0x1f2)][_0x4d5e38(0x24c)]){if(_0x2b202e['segment']===_0x39c3f6){_0x39744f=_0x33c3c3[_0x4d5e38(0x19d)],_0xffb879=_0x2b202e[_0x4d5e38(0x19d)]||_0x39c3f6;break _0x159f42;}}}}return{'stageName':_0x39744f,'criteriaName':_0xffb879};}async function executeThreeStepJourneyCreate(_0xeaaf93,_0xe71062,_0x30ff94,_0x1246e2,_0x22ac16,_0x1a5564,_0x5445f0,_0xadd817){const _0x148c99=a100_0xbb0e10,{activationDefToCreateRequest:_0x54a5eb,yamlRuleToApi:_0x45bc5f}=_0xadd817,{pendingEmbeddedSegments:_0x1e1f4b,pendingEmbeddedActivations:_0x45b23b,embeddedSegmentNameToId:_0x2d7b73}=_0x1246e2,_0x17ae7e=JSON[_0x148c99(0x1a9)](JSON[_0x148c99(0x189)](_0x30ff94));ensureJourneyDefaults(_0x17ae7e['attributes']),stripPendingIds(_0x17ae7e);const _0x1fb74c=await _0xeaaf93[_0x148c99(0x16e)]['create'](_0x17ae7e),_0x1f9abc=_0x1fb74c['id'],_0x43484e=new Map();for(const _0x214e4b of _0x1fb74c[_0x148c99(0x20e)][_0x148c99(0x23e)]){_0x43484e['set'](_0x214e4b[_0x148c99(0x19d)]['toLowerCase'](),_0x214e4b['id']);}for(const [_0x37ce75,{definition:_0x1f4217}]of _0x1e1f4b){const _0x17bcca=generateDeterministicJourneySegmentName(_0xe71062[_0x148c99(0x1c9)][_0x148c99(0x19d)],_0x37ce75);_0x5445f0[_0x148c99(0x233)]?.({'type':_0x148c99(0x20a),'journeyName':_0xe71062[_0x148c99(0x1c9)][_0x148c99(0x19d)],'segmentName':_0x37ce75});const _0xcfc7b3=createSegmentIdResolver(_0x1a5564[_0x148c99(0x1af)],_0x37ce75),_0x27cfb5=await resolveRuleSegmentIds(_0x1f4217[_0x148c99(0x188)],_0xcfc7b3),_0x17e798=await _0xeaaf93['segment'][_0x148c99(0x1a5)]({'name':_0x17bcca,'description':_0x1f4217[_0x148c99(0x20d)]||_0x148c99(0x215)+_0x37ce75,'journeyId':_0x1f9abc,'rule':_0x45bc5f(_0x27cfb5,!![]),'countPopulation':!![],'parentFolderId':_0x22ac16[_0x148c99(0x245)]||'','audienceId':_0x22ac16[_0x148c99(0x224)]});_0x2d7b73[_0x148c99(0x1b2)](_0x37ce75,_0x17e798),_0x1a5564[_0x148c99(0x1af)][_0x148c99(0x1b2)](_0x37ce75,_0x17e798),_0x5445f0['onProgress']?.({'type':_0x148c99(0x221),'journeyName':_0xe71062[_0x148c99(0x1c9)][_0x148c99(0x19d)],'segmentName':_0x37ce75});}const _0x2cea2a=new Map();for(const [_0x1dd813,_0x5e1de0]of _0x45b23b){_0x5445f0[_0x148c99(0x233)]?.({'type':'embedded_activation_creating','journeyName':_0xe71062['yamlConfig'][_0x148c99(0x19d)],'activationName':_0x1dd813});const _0x33fbcc=await _0x54a5eb(_0x5e1de0,_0x1a5564[_0x148c99(0x229)]),_0xbe8693=await _0xeaaf93[_0x148c99(0x16e)][_0x148c99(0x173)](_0x1f9abc,_0x33fbcc);_0x2cea2a['set'](_0x1dd813,_0xbe8693['id']),_0x1246e2[_0x148c99(0x16b)][_0x148c99(0x1b2)](_0x1dd813,_0xbe8693['id']),_0x5445f0['onProgress']?.({'type':'embedded_activation_created','journeyName':_0xe71062[_0x148c99(0x1c9)][_0x148c99(0x19d)],'activationName':_0x1dd813});}const _0x3e6def=JSON[_0x148c99(0x1a9)](JSON['stringify'](_0x30ff94));return _0x3e6def['id']=_0x1f9abc,ensureJourneyDefaults(_0x3e6def[_0x148c99(0x20e)]),resolvePendingIdsInRequest(_0x3e6def,_0x30ff94,_0x43484e,_0x2d7b73,_0x2cea2a,_0x5445f0),await _0xeaaf93[_0x148c99(0x16e)][_0x148c99(0x232)](_0x1f9abc,_0x3e6def),{'action':_0x148c99(0x1bf),'journeyId':_0x1f9abc,'embeddedSegmentNameToId':_0x2d7b73};}function stripPendingIds(_0x29b4ba){const _0x1180b5=a100_0xbb0e10;for(const _0x302545 of _0x29b4ba[_0x1180b5(0x20e)]['journeyStages']||[]){_0x302545[_0x1180b5(0x1ef)]?.[_0x1180b5(0x1cf)]&&isPendingSegmentId(_0x302545[_0x1180b5(0x1ef)][_0x1180b5(0x1cf)])&&delete _0x302545[_0x1180b5(0x1ef)];if(_0x302545[_0x1180b5(0x205)])for(const _0x529bde of Object['keys'](_0x302545[_0x1180b5(0x205)])){const _0x5a61cd=_0x302545[_0x1180b5(0x205)][_0x529bde];_0x5a61cd[_0x1180b5(0x1f1)]===_0x1180b5(0x1fa)&&_0x5a61cd[_0x1180b5(0x16a)]&&isPendingActivationId(_0x5a61cd[_0x1180b5(0x16a)])&&(_0x5a61cd['journeyActivationStepId']='');if(_0x5a61cd[_0x1180b5(0x1f1)]===_0x1180b5(0x1d9)&&_0x5a61cd['branches'])for(const _0x2f0a0c of _0x5a61cd['branches']){_0x2f0a0c[_0x1180b5(0x1cf)]&&isPendingSegmentId(_0x2f0a0c['segmentId'])&&(_0x2f0a0c['segmentId']='');}_0x5a61cd[_0x1180b5(0x1f1)]===_0x1180b5(0x22e)&&_0x5a61cd[_0x1180b5(0x1e2)]?.[_0x1180b5(0x1cf)]&&isPendingSegmentId(_0x5a61cd[_0x1180b5(0x1e2)][_0x1180b5(0x1cf)])&&(_0x5a61cd[_0x1180b5(0x1e2)][_0x1180b5(0x1cf)]='');}}}function resolvePendingIdsInRequest(_0x49020d,_0x3fee90,_0x48eb1c,_0x3cbe3e,_0x7b3973,_0x215b9c){const _0x2828a1=a100_0xbb0e10,_0x38510b=(_0x5ea9da,_0x312d5e)=>{const _0xa5e01e=a100_0x5743;if(!isPendingSegmentId(_0x5ea9da))return _0x5ea9da;const _0x371a7c=extractPendingSegmentName(_0x5ea9da),_0x3658d3=_0x3cbe3e[_0xa5e01e(0x200)](_0x371a7c);return!_0x3658d3&&_0x215b9c[_0xa5e01e(0x24e)]?.(_0xa5e01e(0x17b)+_0x371a7c+'\x27\x20for\x20'+_0x312d5e),_0x3658d3;};if(_0x49020d[_0x2828a1(0x20e)][_0x2828a1(0x178)]?.[_0x2828a1(0x1cf)]&&isPendingSegmentId(_0x49020d[_0x2828a1(0x20e)]['goal'][_0x2828a1(0x1cf)])){const _0x1b88e0=_0x38510b(_0x49020d[_0x2828a1(0x20e)]['goal'][_0x2828a1(0x1cf)],_0x2828a1(0x1c1));_0x1b88e0&&(_0x49020d[_0x2828a1(0x20e)][_0x2828a1(0x178)][_0x2828a1(0x1cf)]=_0x1b88e0);}for(const _0x3e49a3 of _0x49020d[_0x2828a1(0x20e)][_0x2828a1(0x23e)]||[]){const _0x4084a2=_0x48eb1c[_0x2828a1(0x200)](_0x3e49a3[_0x2828a1(0x19d)][_0x2828a1(0x1ca)]());_0x4084a2&&(_0x3e49a3['id']=_0x4084a2);if(_0x3e49a3[_0x2828a1(0x1ef)]?.[_0x2828a1(0x1cf)]&&isPendingSegmentId(_0x3e49a3[_0x2828a1(0x1ef)]['segmentId'])){const _0x432001=_0x38510b(_0x3e49a3['entryCriteria']['segmentId'],'stage\x20\x27'+_0x3e49a3[_0x2828a1(0x19d)]+_0x2828a1(0x18c));_0x432001&&(_0x3e49a3[_0x2828a1(0x1ef)][_0x2828a1(0x1cf)]=_0x432001);}if(_0x3e49a3[_0x2828a1(0x181)])for(const _0x4fca5b of _0x3e49a3[_0x2828a1(0x181)]){if(_0x4fca5b['segmentId']&&isPendingSegmentId(_0x4fca5b[_0x2828a1(0x1cf)])){const _0x4ffb56=_0x38510b(_0x4fca5b[_0x2828a1(0x1cf)],'stage\x20\x27'+_0x3e49a3[_0x2828a1(0x19d)]+'\x27\x20exit\x20criteria');_0x4ffb56&&(_0x4fca5b['segmentId']=_0x4ffb56);}}if(_0x3e49a3['milestone']?.[_0x2828a1(0x1cf)]&&isPendingSegmentId(_0x3e49a3[_0x2828a1(0x201)][_0x2828a1(0x1cf)])){const _0x561003=_0x38510b(_0x3e49a3[_0x2828a1(0x201)][_0x2828a1(0x1cf)],_0x2828a1(0x1d2)+_0x3e49a3[_0x2828a1(0x19d)]+_0x2828a1(0x193));_0x561003&&(_0x3e49a3[_0x2828a1(0x201)]['segmentId']=_0x561003);}if(_0x3e49a3['steps']){const _0x132ba7=_0x212ef4=>_0x3fee90[_0x2828a1(0x20e)][_0x2828a1(0x23e)]['find'](_0x521faa=>_0x521faa[_0x2828a1(0x19d)][_0x2828a1(0x1ca)]()===_0x3e49a3[_0x2828a1(0x19d)][_0x2828a1(0x1ca)]())?.[_0x2828a1(0x205)]?.[_0x212ef4];for(const _0x2e2b87 of Object[_0x2828a1(0x1b0)](_0x3e49a3[_0x2828a1(0x205)])){const _0x8d83f5=_0x3e49a3['steps'][_0x2e2b87],_0x40df21=_0x132ba7(_0x2e2b87);if(_0x8d83f5[_0x2828a1(0x1f1)]==='Activation'&&_0x8d83f5['journeyActivationStepId']&&(isPendingActivationId(_0x8d83f5[_0x2828a1(0x16a)])||_0x8d83f5['journeyActivationStepId']==='')){if(_0x40df21?.[_0x2828a1(0x16a)]&&isPendingActivationId(_0x40df21[_0x2828a1(0x16a)])){const _0x5116bb=extractPendingActivationName(_0x40df21[_0x2828a1(0x16a)]),_0x307adb=_0x7b3973['get'](_0x5116bb);_0x307adb&&(_0x8d83f5['journeyActivationStepId']=_0x307adb);}}if(_0x8d83f5['type']===_0x2828a1(0x1d9)&&_0x8d83f5[_0x2828a1(0x24c)]&&_0x40df21?.[_0x2828a1(0x24c)])for(let _0x35f869=0x0;_0x35f869<_0x8d83f5['branches'][_0x2828a1(0x1c2)];_0x35f869++){const _0x544250=_0x8d83f5[_0x2828a1(0x24c)][_0x35f869],_0x6cf871=_0x40df21[_0x2828a1(0x24c)][_0x35f869];if(_0x6cf871?.[_0x2828a1(0x1cf)]&&isPendingSegmentId(_0x6cf871['segmentId'])){const _0x3a8aa5=_0x38510b(_0x6cf871[_0x2828a1(0x1cf)],'stage\x20\x27'+_0x3e49a3[_0x2828a1(0x19d)]+_0x2828a1(0x1e7)+(_0x544250[_0x2828a1(0x19d)]||_0x35f869)+'\x27');_0x3a8aa5&&(_0x544250['segmentId']=_0x3a8aa5);}}if(_0x8d83f5['type']==='WaitStep'&&_0x8d83f5[_0x2828a1(0x1e2)]?.[_0x2828a1(0x1cf)]&&_0x40df21?.[_0x2828a1(0x1e2)]?.[_0x2828a1(0x1cf)]&&isPendingSegmentId(_0x40df21[_0x2828a1(0x1e2)]['segmentId'])){const _0x18074b=_0x38510b(_0x40df21['waitCondition'][_0x2828a1(0x1cf)],_0x2828a1(0x1d2)+_0x3e49a3[_0x2828a1(0x19d)]+_0x2828a1(0x199));_0x18074b&&(_0x8d83f5[_0x2828a1(0x1e2)][_0x2828a1(0x1cf)]=_0x18074b);}}}}}function a100_0x4634(){const _0x2179ba=['JOURNEY_SYNTAX_ERROR','object','Deleting\x20activation\x20\x27','4991055DfiVIf','Activation','flatMap','notification','Created\x20activation\x20\x27','6325120nAFhOp','deps','get','milestone','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','\x20(referenced\x20in\x20journey\x20','journey_creating','steps','map','data','Updated\x20journey\x20\x27','message','embedded_segment_creating','existingSegment','diff','description','attributes','folder','valid','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Created\x20segment\x20\x27','./child-segment-yaml.js','entries','Entry\x20criteria:\x20','segment','delete','nameToId','activationsBySegmentId','item','getSegment','validatedRequest','startsWith','Journey\x20\x27','hasChanges','resolveSegment','embedded_segment_created','journeyId','folder_creating','parentId','relative','Updating\x20activation\x20\x27','segmentByFolderAndName','progress','activationContext','journey_updating','idToEmailMap','idToName','\x20activation\x20\x27','WaitStep','\x27\x20from\x20file:\x20','isNew','createFolder','update','onProgress','journeyBundlesByFolderAndName','utf-8','Failed\x20to\x20','Segment\x20not\x20found:\x20','create','activation_updated','\x27\x20not\x20found\x20in\x20journey\x20\x27','verbose','4578304ULJdiH','ACTIVATION_UPDATE_ERROR','journeyStages','schedule','activation_created','behavior','updated','updateSegmentById','Creating\x20segment\x20\x27','effectiveFolderId','739239zRftLi','find','Created\x20journey\x20\x27','4mnbvwY','all_columns','activation_deleted','branches','SEGMENT_NOT_FOUND','logWarning','deleted','__pending_','deleteActivation','activation_creating','existingActivation','fetchJourney','folderId','\x20error(s)','segment_deleted','max',').\x20','journeyActivationStepId','journeyActivationNameToId','buildUserMaps','segment_updated','journey','entry_criteria','connector_config','logSuccess','withProgress','createActivation','activation_template_id','\x0a\x20\x20','Updated\x20segment\x20\x27','Name\x20has\x20already\x20been\x20taken','goal','connectionIdToNameMap','segment_created','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','activation_deleting','journey_updated','journey_created','createSegment','filter','exitCriterias','createdSegmentId','segments','createdSegmentIds','getJourney','journeyBundleName','add','rule','stringify','Updated\x20activation\x20\x27','isArray','\x27\x20entry\x20criteria','localSegmentRules','folder_created','sort','updateActivation','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','all','\x27\x20milestone','Stage\x20\x27','getActivation','size','user','null','\x27\x20wait\x20condition','../../utils/async.js','journeyById','rootFolderId','name','skipSegments','parseDocument','index','slice','activations','parentFolder','__pending_act_','createJourneySegment','activationStepsById','replace','relationships','parse','state','logDeleted','):\x20','listSegments','kind','segmentNameToId','keys','Creating\x20folder\x20\x27','set','folderPath','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Fetching\x20','absolutePath','SEGMENT_SYNTAX_ERROR','journeys','push','action','INTERNAL','list','errors','from','created','Creating\x20activation\x20\x27','goal\x20criteria','length','171066NIHxMy','nameToType','hex','sha1','./journey-yaml.js','join','yamlConfig','toLowerCase','Deleted\x20segment\x20\x27','includes','670002nzwjAd','connection','segmentId','Activation\x20not\x20found:\x20','NOT_FOUND','stage\x20\x27','entry','\x27...','segmentFolderId','split','segment_updating','yamlActivation','DecisionPoint','activationParams','existingSegments','toString','42trAZVQ','values','folderPathToId','existingJourney','versionNumber','waitCondition','journey_entry_criteria_','JOURNEY_UPDATE_ERROR','embeddedSegmentNameToId','draft','\x27\x20decision\x20point\x20branch\x20\x27','stages','\x20segment\x20from\x20file:\x20','activation_','listActivations','44856iCAieN','activation_updating','columns','entryCriteria','has','type','with','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','SEGMENT_UPDATE_ERROR','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context'];a100_0x4634=function(){return _0x2179ba;};return a100_0x4634();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x122e41,_0x331c77){const _0x514b0e=a101_0x5274,_0xdb78bf=_0x122e41();while(!![]){try{const _0x254276=-parseInt(_0x514b0e(0x1cd))/0x1*(parseInt(_0x514b0e(0x1c8))/0x2)+-parseInt(_0x514b0e(0x1d6))/0x3*(parseInt(_0x514b0e(0x1d4))/0x4)+parseInt(_0x514b0e(0x1ca))/0x5*(parseInt(_0x514b0e(0x1d3))/0x6)+parseInt(_0x514b0e(0x1d0))/0x7*(parseInt(_0x514b0e(0x1cb))/0x8)+-parseInt(_0x514b0e(0x1d1))/0x9+parseInt(_0x514b0e(0x1c5))/0xa+-parseInt(_0x514b0e(0x1d5))/0xb*(-parseInt(_0x514b0e(0x1c7))/0xc);if(_0x254276===_0x331c77)break;else _0xdb78bf['push'](_0xdb78bf['shift']());}catch(_0x36659c){_0xdb78bf['push'](_0xdb78bf['shift']());}}}(a101_0x3abf,0x6d2b1));export function buildFolderIdToPathMap(_0x3e250f){const _0x46ddd2=a101_0x5274,_0x44b492=new Map(),_0xdc1931=new Map();for(const _0x421785 of _0x3e250f){_0xdc1931[_0x46ddd2(0x1d2)](_0x421785['id'],_0x421785);}const _0x16933f=new Set();for(const _0x5045f3 of _0x3e250f){!_0x5045f3['parentFolderId']&&_0x16933f[_0x46ddd2(0x1cc)](_0x5045f3['id']);}function _0x506022(_0x5e65b6){const _0x511474=_0x46ddd2;if(_0x44b492[_0x511474(0x1cf)](_0x5e65b6['id']))return _0x44b492[_0x511474(0x1c6)](_0x5e65b6['id']);if(_0x16933f[_0x511474(0x1cf)](_0x5e65b6['id']))return _0x44b492[_0x511474(0x1d2)](_0x5e65b6['id'],''),'';if(_0x5e65b6[_0x511474(0x1ce)]){const _0x27389f=_0xdc1931[_0x511474(0x1c6)](_0x5e65b6['parentFolderId']);if(_0x27389f){const _0x28aaba=_0x506022(_0x27389f),_0x25db5e=_0x28aaba?_0x28aaba+'/'+_0x5e65b6[_0x511474(0x1c9)]:_0x5e65b6[_0x511474(0x1c9)];return _0x44b492[_0x511474(0x1d2)](_0x5e65b6['id'],_0x25db5e),_0x25db5e;}}const _0xb6a8f=_0x5e65b6['name'];return _0x44b492['set'](_0x5e65b6['id'],_0xb6a8f),_0xb6a8f;}for(const _0x43b117 of _0x3e250f){_0x506022(_0x43b117);}return _0x44b492;}export function buildFolderPathToIdMap(_0xd50ae5){const _0x27ae82=a101_0x5274,_0x2e764d=new Map(),_0x564d00=new Map();for(const _0x1c6263 of _0xd50ae5){_0x564d00[_0x27ae82(0x1d2)](_0x1c6263['id'],_0x1c6263);}const _0x193004=new Set();for(const _0x5c167d of _0xd50ae5){!_0x5c167d['parentFolderId']&&_0x193004['add'](_0x5c167d['id']);}function _0x57013c(_0x3ce4d4){const _0x5a14a4=_0x27ae82;if(_0x193004[_0x5a14a4(0x1cf)](_0x3ce4d4['id']))return'';if(_0x3ce4d4['parentFolderId']){const _0x4e56dd=_0x564d00[_0x5a14a4(0x1c6)](_0x3ce4d4[_0x5a14a4(0x1ce)]);if(_0x4e56dd){const _0x23c2d6=_0x57013c(_0x4e56dd);return _0x23c2d6?_0x23c2d6+'/'+_0x3ce4d4[_0x5a14a4(0x1c9)]:_0x3ce4d4[_0x5a14a4(0x1c9)];}}return _0x3ce4d4['name'];}for(const _0x421070 of _0xd50ae5){const _0x4b2daf=_0x57013c(_0x421070);_0x2e764d['set'](_0x4b2daf,_0x421070['id']);}return _0x2e764d;}export function buildFolderMaps(_0x4caee7){const _0x1074b3=a101_0x5274,_0x14b796=buildFolderIdToPathMap(_0x4caee7),_0x5e9aae=new Map();for(const [_0x195ff8,_0x781ed5]of _0x14b796){_0x5e9aae[_0x1074b3(0x1d2)](_0x781ed5,_0x195ff8);}return{'idToPath':_0x14b796,'pathToId':_0x5e9aae};}function a101_0x5274(_0x4a1f28,_0xe29bf8){_0x4a1f28=_0x4a1f28-0x1c5;const _0x3abf24=a101_0x3abf();let _0x527495=_0x3abf24[_0x4a1f28];return _0x527495;}function a101_0x3abf(){const _0x1d16fa=['set','1815666gIUnHh','4IPUTEV','33220ygFYxe','737643ZIVHsn','2623440UZIWuW','get','2820MAyTRV','1366urFRnq','name','5GjWBvm','2504pgLFLh','add','229ChSQVD','parentFolderId','has','7616XZjmAR','6891822VhyGir'];a101_0x3abf=function(){return _0x1d16fa;};return a101_0x3abf();}export function getFolderPath(_0xbcad14,_0xbf74){const _0x4d9718=a101_0x5274;if(!_0xbcad14)return'';return _0xbf74[_0x4d9718(0x1c6)](_0xbcad14)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a102_0x2069(){const _0x21eb1e=['trim','18696IFqMpW','segments','32aFRnei','length','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Relative\x20path\x20cannot\x20be\x20empty','readFile','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','root','filter','Path\x20cannot\x20be\x20empty','substring','dirname','4euJLdt','segment','exists','2210doWpyH','1037414SyhydI','pop','name','parent_segment','2415VBJomZ','isAbsolute','test','Cannot\x20split\x20empty\x20path','push','854678PXRRXp','910248EQRKHQ','Path\x20segment\x20cannot\x20be\x20empty','Path\x20attempts\x20to\x20navigate\x20above\x20root','File\x20not\x20found:\x20','Cannot\x20navigate\x20above\x20root','tdx.json','endsWith','join','55989iGbmQH','resolve','slice','startsWith','relative','type','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','raw','journey','parse','1574538czGRmN','4597413coBKwf'];a102_0x2069=function(){return _0x21eb1e;};return a102_0x2069();}(function(_0x10cbff,_0x3a2030){const _0x2374d9=a102_0x28d9,_0x3e035c=_0x10cbff();while(!![]){try{const _0x54265e=parseInt(_0x2374d9(0x106))/0x1+parseInt(_0x2374d9(0xf4))/0x2+parseInt(_0x2374d9(0x107))/0x3*(-parseInt(_0x2374d9(0xe6))/0x4)+-parseInt(_0x2374d9(0xee))/0x5*(parseInt(_0x2374d9(0x109))/0x6)+parseInt(_0x2374d9(0xea))/0x7*(parseInt(_0x2374d9(0x10b))/0x8)+-parseInt(_0x2374d9(0xfc))/0x9*(-parseInt(_0x2374d9(0xe9))/0xa)+-parseInt(_0x2374d9(0xf3))/0xb;if(_0x54265e===_0x3a2030)break;else _0x3e035c['push'](_0x3e035c['shift']());}catch(_0x31912d){_0x3e035c['push'](_0x3e035c['shift']());}}}(a102_0x2069,0xd75c2));import a102_0x30027b from'path';import{parse as a102_0x39552c}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x10ca42){const _0x152263=a102_0x28d9;if(!_0x10ca42||_0x10ca42[_0x152263(0x108)]()==='')throw new Error(_0x152263(0x113));const _0x120dcd=_0x10ca42[_0x152263(0x108)]();if(_0x120dcd==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x10ca42};const _0x2f9fc0=_0x120dcd['startsWith']('/')?_0x120dcd[_0x152263(0xe4)](0x1):_0x120dcd,_0x1c36e3=_0x2f9fc0['split']('/')[_0x152263(0x112)](_0x4cdcdb=>_0x4cdcdb!=='');if(_0x1c36e3[_0x152263(0x10c)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x187403=_0x120dcd[_0x152263(0xff)]('/')||!isRelativePathSegment(_0x1c36e3[0x0]);for(const _0x177f6 of _0x1c36e3){validatePathSegment(_0x177f6);}return{'segments':_0x1c36e3,'isAbsolute':_0x187403,'raw':_0x10ca42};}function isRelativePathSegment(_0x27f005){return _0x27f005==='.'||_0x27f005==='..';}function validatePathSegment(_0x5e73b9){const _0x48642a=a102_0x28d9;if(_0x5e73b9==='')throw new Error(_0x48642a(0xf5));if(_0x5e73b9==='.'||_0x5e73b9==='..')return;if(/[\x00-\x1F\x7F]/[_0x48642a(0xf0)](_0x5e73b9))throw new Error(_0x48642a(0x110)+_0x5e73b9);if(_0x5e73b9!==_0x5e73b9[_0x48642a(0x108)]()){}}export function validatePath(_0x89cc6e){const _0x55abb4=a102_0x28d9;if(_0x89cc6e['segments'][_0x55abb4(0x10c)]===0x0&&!_0x89cc6e[_0x55abb4(0xef)])throw new Error(_0x55abb4(0x10e));if(_0x89cc6e['isAbsolute']){if(_0x89cc6e[_0x55abb4(0x10a)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x363d82=0x0;for(const _0x301517 of _0x89cc6e[_0x55abb4(0x10a)]){if(_0x301517==='..'){if(_0x363d82===0x0)throw new Error(_0x55abb4(0xf6));_0x363d82--;}else _0x301517!=='.'&&_0x363d82++;}}}export function joinPaths(_0x1394b3,_0x5296d6){const _0x4d2b9b=a102_0x28d9;if(!_0x1394b3||_0x1394b3==='/')return _0x5296d6;if(!_0x5296d6||_0x5296d6==='.')return _0x1394b3;if(_0x5296d6[_0x4d2b9b(0xff)]('/'))return _0x5296d6;const _0x472195=parsePath(_0x1394b3),_0x4ad1b9=parsePath(_0x5296d6),_0x5536d0=[..._0x472195[_0x4d2b9b(0x10a)]];for(const _0x2c6b0d of _0x4ad1b9['segments']){if(_0x2c6b0d==='.')continue;else{if(_0x2c6b0d==='..'){if(_0x5536d0['length']===0x0)throw new Error(_0x4d2b9b(0xf8));_0x5536d0[_0x4d2b9b(0xeb)]();}else _0x5536d0[_0x4d2b9b(0xf2)](_0x2c6b0d);}}const _0x21d90b=_0x5536d0[_0x4d2b9b(0xfb)]('/');return _0x472195['raw']['startsWith']('/')?'/'+_0x21d90b:_0x21d90b;}export function normalizePath(_0xf82331){const _0x3913f5=a102_0x28d9,_0x490149=parsePath(_0xf82331),_0x38e3d0=[];for(const _0x5d7966 of _0x490149['segments']){if(_0x5d7966==='.')continue;else{if(_0x5d7966==='..'){if(_0x38e3d0['length']===0x0){if(_0x490149['isAbsolute'])throw new Error(_0x3913f5(0xf8));_0x38e3d0[_0x3913f5(0xf2)]('..');}else _0x38e3d0[_0x38e3d0[_0x3913f5(0x10c)]-0x1]==='..'?_0x38e3d0[_0x3913f5(0xf2)]('..'):_0x38e3d0[_0x3913f5(0xeb)]();}else _0x38e3d0['push'](_0x5d7966);}}if(_0x38e3d0[_0x3913f5(0x10c)]===0x0)return _0x490149[_0x3913f5(0xef)]?'/':'.';const _0x3438e7=_0x38e3d0[_0x3913f5(0xfb)]('/');return _0x490149[_0x3913f5(0x103)][_0x3913f5(0xff)]('/')?'/'+_0x3438e7:_0x3438e7;}export function getParentPath(_0x4e95e1){const _0x346706=a102_0x28d9,_0x3f2ee6=parsePath(_0x4e95e1);if(_0x3f2ee6['segments'][_0x346706(0x10c)]<=0x1)return'/';const _0x155fc9=_0x3f2ee6[_0x346706(0x10a)][_0x346706(0xfe)](0x0,-0x1)[_0x346706(0xfb)]('/');return _0x3f2ee6[_0x346706(0x103)][_0x346706(0xff)]('/')?'/'+_0x155fc9:_0x155fc9;}export function getBaseName(_0x34712f){const _0x3479c0=a102_0x28d9,_0x1b3ee5=parsePath(_0x34712f);return _0x1b3ee5['segments'][_0x1b3ee5[_0x3479c0(0x10a)][_0x3479c0(0x10c)]-0x1]||'';}export function isChildPath(_0x309021,_0x341d48){const _0x1826b3=a102_0x28d9,_0x5aa74e=parsePath(_0x309021),_0x216456=parsePath(_0x341d48);if(_0x5aa74e['segments'][_0x1826b3(0x10c)]<=_0x216456['segments'][_0x1826b3(0x10c)])return![];for(let _0x888b7f=0x0;_0x888b7f<_0x216456['segments']['length'];_0x888b7f++){if(_0x5aa74e[_0x1826b3(0x10a)][_0x888b7f]!==_0x216456[_0x1826b3(0x10a)][_0x888b7f])return![];}return!![];}export function splitPath(_0x39ae8f){const _0x48aa6b=a102_0x28d9,_0x567b93=parsePath(_0x39ae8f);if(_0x567b93['segments'][_0x48aa6b(0x10c)]===0x0)throw new Error(_0x48aa6b(0xf1));if(_0x567b93[_0x48aa6b(0x10a)][_0x48aa6b(0x10c)]===0x1)return{'parent':_0x567b93['segments'][0x0]};return{'parent':_0x567b93['segments'][0x0],'child':_0x567b93[_0x48aa6b(0x10a)][_0x48aa6b(0xfe)](0x1)[_0x48aa6b(0xfb)]('/')};}export function isYamlFilePath(_0x27cbde){const _0x43a4ce=a102_0x28d9;return _0x27cbde['endsWith']('.yml')||_0x27cbde[_0x43a4ce(0xfa)]('.yaml');}function a102_0x28d9(_0x4069c5,_0x1a612f){_0x4069c5=_0x4069c5-0xe4;const _0x206912=a102_0x2069();let _0x28d9ee=_0x206912[_0x4069c5];return _0x28d9ee;}export async function resolveYamlFilePath(_0x3cbcc3,_0x28005f=nodeFileSystem){const _0x504992=a102_0x28d9,_0x329ab7=a102_0x30027b[_0x504992(0xfd)](_0x3cbcc3);if(!await _0x28005f[_0x504992(0xe8)](_0x329ab7))throw new Error(_0x504992(0xf7)+_0x3cbcc3);let _0x8c3e65=a102_0x30027b['dirname'](_0x329ab7),_0x4a7eef=null,_0x253319=null;const _0x87d3dd=a102_0x30027b[_0x504992(0x105)](_0x8c3e65)[_0x504992(0x111)];while(_0x8c3e65!==_0x87d3dd){const _0x407b6e=a102_0x30027b['join'](_0x8c3e65,_0x504992(0xf9));if(await _0x28005f[_0x504992(0xe8)](_0x407b6e)){_0x4a7eef=_0x407b6e,_0x253319=_0x8c3e65;break;}_0x8c3e65=a102_0x30027b['dirname'](_0x8c3e65);}if(!_0x4a7eef||!_0x253319)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x3cbcc3);const _0x5d7804=await _0x28005f[_0x504992(0x10f)](_0x4a7eef),_0x120a4c=JSON[_0x504992(0x105)](_0x5d7804),_0x3ec8ff=_0x120a4c[_0x504992(0xed)];if(!_0x3ec8ff)throw new Error(_0x504992(0x102));const _0x2b95ef=await _0x28005f[_0x504992(0x10f)](_0x329ab7),_0x1b1b15=a102_0x39552c(_0x2b95ef),_0x3dd9d0=_0x1b1b15[_0x504992(0xec)];if(!_0x3dd9d0)throw new Error(_0x504992(0x10d)+_0x3cbcc3);const _0x590dd7=_0x1b1b15[_0x504992(0x101)]===_0x504992(0x104)?'journey':_0x504992(0xe7),_0xe6a0de=a102_0x30027b[_0x504992(0x100)](_0x253319,_0x329ab7),_0x201842=a102_0x30027b[_0x504992(0xe5)](_0xe6a0de),_0x76d767=_0x201842==='.'?'':_0x201842['replace'](/\\/g,'/'),_0x81be62=_0x76d767?_0x3ec8ff+'/'+_0x76d767+'/'+_0x3dd9d0:_0x3ec8ff+'/'+_0x3dd9d0;return{'parentSegment':_0x3ec8ff,'segmentName':_0x3dd9d0,'folderPath':_0x76d767,'fullPath':_0x81be62,'resourceType':_0x590dd7};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x26e694,_0x3ff8e3){const _0x2f998f=a103_0x1a1e,_0x4a0e8f=_0x26e694();while(!![]){try{const _0x39d67f=parseInt(_0x2f998f(0x96))/0x1+parseInt(_0x2f998f(0x8f))/0x2+-parseInt(_0x2f998f(0x98))/0x3+-parseInt(_0x2f998f(0x93))/0x4*(-parseInt(_0x2f998f(0x95))/0x5)+parseInt(_0x2f998f(0x92))/0x6+parseInt(_0x2f998f(0x97))/0x7+-parseInt(_0x2f998f(0x8e))/0x8;if(_0x39d67f===_0x3ff8e3)break;else _0x4a0e8f['push'](_0x4a0e8f['shift']());}catch(_0x5a2545){_0x4a0e8f['push'](_0x4a0e8f['shift']());}}}(a103_0x16c7,0x19019));function a103_0x16c7(){const _0x3884f1=['129262yFLMXu','336204XLMpyG','.\x20Child\x20name\x20cannot\x20be\x20empty','2123808tejWNO','161910RKfFGl','substring','Invalid\x20segment\x20reference\x20format:\x20','979638fwDeHV','5508CsBAXB','.\x20Parent\x20name\x20cannot\x20be\x20empty','95iLcNtP','191112DLrolR'];a103_0x16c7=function(){return _0x3884f1;};return a103_0x16c7();}function a103_0x1a1e(_0x3f71ec,_0x2ac100){_0x3f71ec=_0x3f71ec-0x8d;const _0x16c728=a103_0x16c7();let _0x1a1e57=_0x16c728[_0x3f71ec];return _0x1a1e57;}export function parseSegmentRef(_0x40e33e){const _0x514a40=a103_0x1a1e,_0x42ea62=_0x40e33e['indexOf']('/');if(_0x42ea62===-0x1)return{'parentId':_0x40e33e};if(_0x42ea62===0x0)throw new Error(_0x514a40(0x91)+_0x40e33e+_0x514a40(0x94));const _0x2bc306=_0x40e33e[_0x514a40(0x90)](0x0,_0x42ea62),_0xc63250=_0x40e33e[_0x514a40(0x90)](_0x42ea62+0x1);if(_0xc63250==='')throw new Error(_0x514a40(0x91)+_0x40e33e+_0x514a40(0x8d));return{'parentId':_0x2bc306,'childId':_0xc63250};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x169cb2,_0x13d185){const _0x35456f=a104_0x413a,_0x485a53=_0x169cb2();while(!![]){try{const _0x260e2c=-parseInt(_0x35456f(0x124))/0x1*(-parseInt(_0x35456f(0x10d))/0x2)+parseInt(_0x35456f(0x12d))/0x3*(-parseInt(_0x35456f(0x108))/0x4)+parseInt(_0x35456f(0x117))/0x5*(parseInt(_0x35456f(0x11a))/0x6)+parseInt(_0x35456f(0x129))/0x7+parseInt(_0x35456f(0x10f))/0x8*(-parseInt(_0x35456f(0x10c))/0x9)+parseInt(_0x35456f(0x125))/0xa+-parseInt(_0x35456f(0x113))/0xb*(parseInt(_0x35456f(0x100))/0xc);if(_0x260e2c===_0x13d185)break;else _0x485a53['push'](_0x485a53['shift']());}catch(_0x4b2461){_0x485a53['push'](_0x485a53['shift']());}}}(a104_0x16d0,0xec660));function a104_0x16d0(){const _0x5d02fb=['58779TYAdHg','2360kZIpFH','journey','1568fwlifl','parentSegment','scopedFolderPath','readFile','33udxbJy','No\x20tdx.json\x20found','cwd','directory','5aflLdm','invalid_yaml','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','1076532OfvkIw','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','join','exists','parent_segment','extname','dirname','tdx.json','trim','type','1269QaQfZG','15722880heWMhx','match','segmentName','Not\x20a\x20YAML\x20file:\x20','5662328qkRFsW','Parent\x20segment\x20not\x20specified','resourceType','folderPath','21AZXjtx','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','file','resolve','no_config','isDirectory','includes','stat','3068892bKtzkb','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','context','configDir','parent_name','parse','replace','File\x20not\x20found','595684SVQnZr','message','error','isScoped'];a104_0x16d0=function(){return _0x5d02fb;};return a104_0x16d0();}import a104_0x177951 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x22acf8){const _0xa83f7c=a104_0x413a;return _0x22acf8[_0xa83f7c(0x123)]!==_0xa83f7c(0x10a);}export function isScopedResolution(_0x50a4ed){const _0x33cd49=a104_0x413a;return _0x50a4ed[_0x33cd49(0x123)]===_0x33cd49(0x116)||_0x50a4ed[_0x33cd49(0x123)]===_0x33cd49(0xfa)||_0x50a4ed[_0x33cd49(0x123)]===_0x33cd49(0x102);}export function getScopedDetails(_0x3e70de){const _0x40eba4=a104_0x413a;if(isScopedResolution(_0x3e70de))return{'isScoped':_0x3e70de[_0x40eba4(0x10b)],'scopedFolderPath':_0x3e70de[_0x40eba4(0x111)]};return undefined;}async function findTdxConfigAsync(_0x270af6,_0x472192){const _0x5a0f75=a104_0x413a;let _0x4eb2e1=a104_0x177951[_0x5a0f75(0xfb)](_0x270af6);const _0x10c06a=a104_0x177951[_0x5a0f75(0x105)](_0x4eb2e1)['root'];while(_0x4eb2e1!==_0x10c06a){const _0x5549e7=a104_0x177951[_0x5a0f75(0x11c)](_0x4eb2e1,_0x5a0f75(0x121));if(await _0x472192[_0x5a0f75(0x11d)](_0x5549e7))try{const _0x34d273=await _0x472192['readFile'](_0x5549e7),_0x2234d0=JSON[_0x5a0f75(0x105)](_0x34d273);if(_0x2234d0[_0x5a0f75(0x11e)]&&typeof _0x2234d0['parent_segment']==='string')return{'configPath':_0x5549e7,'configDir':_0x4eb2e1,'parentSegment':_0x2234d0[_0x5a0f75(0x11e)]};}catch{}_0x4eb2e1=a104_0x177951[_0x5a0f75(0x120)](_0x4eb2e1);}return null;}function calculateScopedPath(_0x295bc7,_0x52c8bb){const _0x2b006b=a104_0x413a,_0x3027dc=a104_0x177951['relative'](_0x52c8bb,_0x295bc7),_0xc47a59=_0x3027dc!==''&&_0x3027dc!=='.'&&!_0x3027dc['startsWith']('..');return{'isScoped':_0xc47a59,'scopedFolderPath':_0xc47a59?_0x3027dc[_0x2b006b(0x106)](/\\/g,'/'):''};}function a104_0x413a(_0x1a8efd,_0x576728){_0x1a8efd=_0x1a8efd-0xf9;const _0x16d0b2=a104_0x16d0();let _0x413ad9=_0x16d0b2[_0x1a8efd];return _0x413ad9;}export async function resolveTarget(_0x133356){const _0x1b2796=a104_0x413a,{arg:_0x1d7c6b,contextParent:_0x504d66,cwd:cwd=process[_0x1b2796(0x115)](),fs:fs=nodeFileSystem}=_0x133356;if(_0x1d7c6b&&isYamlFilePath(_0x1d7c6b))try{const _0x27fca3=await resolveYamlFilePath(_0x1d7c6b,fs),_0x3bd81a=a104_0x177951['resolve'](_0x1d7c6b),_0x40cfd6=a104_0x177951[_0x1b2796(0x120)](_0x3bd81a),_0x56d878=await findTdxConfigAsync(_0x40cfd6,fs);if(!_0x56d878){if(_0x504d66){const _0x3ffd03=a104_0x177951[_0x1b2796(0x120)](_0x3bd81a);return{'type':_0x1b2796(0xfa),'parentName':_0x504d66,'targetDir':_0x3ffd03,'configRoot':_0x3ffd03,'filePath':_0x3bd81a,'resourceName':_0x27fca3[_0x1b2796(0x127)],'folderPath':_0x27fca3[_0x1b2796(0x12c)],'resourceType':_0x27fca3[_0x1b2796(0x12b)],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x1b2796(0xfc),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x1d7c6b,'arg':_0x1d7c6b,'helpText':_0x1b2796(0xf9)};}const _0x347013=calculateScopedPath(_0x40cfd6,_0x56d878[_0x1b2796(0x103)]);return{'type':_0x1b2796(0xfa),'parentName':_0x56d878[_0x1b2796(0x110)],'targetDir':_0x56d878[_0x1b2796(0x103)],'configRoot':_0x56d878[_0x1b2796(0x103)],'filePath':_0x3bd81a,'resourceName':_0x27fca3['segmentName'],'folderPath':_0x27fca3['folderPath'],'resourceType':_0x27fca3['resourceType'],'isScoped':_0x347013[_0x1b2796(0x10b)],'scopedFolderPath':_0x347013[_0x1b2796(0x111)]};}catch(_0x1cdc18){const _0x10ecdb=_0x1cdc18 instanceof Error?_0x1cdc18[_0x1b2796(0x109)]:String(_0x1cdc18);if(_0x10ecdb[_0x1b2796(0xfe)](_0x1b2796(0x107)))return{'type':_0x1b2796(0x10a),'errorCode':'file_not_found','message':'File\x20not\x20found:\x20'+_0x1d7c6b,'arg':_0x1d7c6b};if(_0x10ecdb[_0x1b2796(0xfe)](_0x1b2796(0x114))){if(_0x504d66){const _0x5b897d=a104_0x177951[_0x1b2796(0xfb)](_0x1d7c6b);if(await fs[_0x1b2796(0x11d)](_0x5b897d)){const _0x5c8e77=a104_0x177951['dirname'](_0x5b897d),_0x13d3e9=await fs[_0x1b2796(0x112)](_0x5b897d),_0x5bd412=_0x13d3e9[_0x1b2796(0x126)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x5c5862=_0x13d3e9[_0x1b2796(0x126)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x351cb1=_0x5bd412?_0x5bd412[0x1][_0x1b2796(0x122)]():a104_0x177951['basename'](_0x1d7c6b,a104_0x177951[_0x1b2796(0x11f)](_0x1d7c6b)),_0x264bca=_0x5c5862&&_0x5c5862[0x1][_0x1b2796(0x122)]()===_0x1b2796(0x10e)?_0x1b2796(0x10e):'segment';return{'type':_0x1b2796(0xfa),'parentName':_0x504d66,'targetDir':_0x5c8e77,'configRoot':_0x5c8e77,'filePath':_0x5b897d,'resourceName':_0x351cb1,'folderPath':'','resourceType':_0x264bca,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0x1b2796(0xfc),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x1d7c6b,'arg':_0x1d7c6b,'helpText':_0x1b2796(0xf9)};}return{'type':'error','errorCode':_0x1b2796(0x118),'message':_0x10ecdb,'arg':_0x1d7c6b};}if(_0x1d7c6b){const _0x21906d=a104_0x177951['resolve'](cwd,_0x1d7c6b);let _0x237760=null;try{_0x237760=await fs[_0x1b2796(0xff)](_0x21906d);}catch{}if(_0x237760?.[_0x1b2796(0xfd)]()){const _0x9861c6=await findTdxConfigAsync(_0x21906d,fs);if(_0x9861c6){const _0x508561=calculateScopedPath(_0x21906d,_0x9861c6[_0x1b2796(0x103)]);return{'type':_0x1b2796(0x116),'parentName':_0x9861c6['parentSegment'],'targetDir':_0x21906d,'configRoot':_0x9861c6['configDir'],'isScoped':_0x508561[_0x1b2796(0x10b)],'scopedFolderPath':_0x508561[_0x1b2796(0x111)]};}if(_0x504d66)return{'type':_0x1b2796(0x116),'parentName':_0x504d66,'targetDir':_0x21906d,'configRoot':_0x21906d,'isScoped':![],'scopedFolderPath':''};return{'type':_0x1b2796(0x10a),'errorCode':_0x1b2796(0xfc),'message':_0x1b2796(0x119)+_0x1d7c6b,'arg':_0x1d7c6b,'helpText':_0x1b2796(0xf9)};}if(_0x237760?.['isFile']())return{'type':_0x1b2796(0x10a),'errorCode':'invalid_yaml','message':_0x1b2796(0x128)+_0x1d7c6b,'arg':_0x1d7c6b,'helpText':_0x1b2796(0x11b)};const _0x502947=sanitizeFileName(_0x1d7c6b),_0x4789bb=getSegmentRootDir(_0x502947,cwd);return{'type':_0x1b2796(0x104),'parentName':_0x1d7c6b,'targetDir':_0x4789bb,'configRoot':_0x4789bb};}const _0x2b26ee=await findTdxConfigAsync(cwd,fs);if(_0x2b26ee){const _0x2ab301=calculateScopedPath(cwd,_0x2b26ee['configDir']);return{'type':_0x1b2796(0x102),'parentName':_0x2b26ee['parentSegment'],'targetDir':cwd,'configRoot':_0x2b26ee['configDir'],'isScoped':_0x2ab301[_0x1b2796(0x10b)],'scopedFolderPath':_0x2ab301['scopedFolderPath']};}if(_0x504d66){const _0x2c4c6b=sanitizeFileName(_0x504d66),_0x120cb3=getSegmentRootDir(_0x2c4c6b,cwd);return{'type':_0x1b2796(0x102),'parentName':_0x504d66,'targetDir':_0x120cb3,'configRoot':_0x120cb3,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1b2796(0x10a),'errorCode':'no_parent','message':_0x1b2796(0x12a),'helpText':_0x1b2796(0x101)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a105_0x1e3c45=a105_0x2d98;(function(_0x38a1d5,_0xfdc05d){const _0x4a86a8=a105_0x2d98,_0x61facd=_0x38a1d5();while(!![]){try{const _0x4ed095=-parseInt(_0x4a86a8(0x80))/0x1*(parseInt(_0x4a86a8(0x8c))/0x2)+-parseInt(_0x4a86a8(0x75))/0x3*(parseInt(_0x4a86a8(0x7b))/0x4)+parseInt(_0x4a86a8(0x87))/0x5*(parseInt(_0x4a86a8(0x79))/0x6)+-parseInt(_0x4a86a8(0x7f))/0x7+parseInt(_0x4a86a8(0x83))/0x8+-parseInt(_0x4a86a8(0x8d))/0x9*(parseInt(_0x4a86a8(0x7c))/0xa)+parseInt(_0x4a86a8(0x7a))/0xb*(parseInt(_0x4a86a8(0x7e))/0xc);if(_0x4ed095===_0xfdc05d)break;else _0x61facd['push'](_0x61facd['shift']());}catch(_0x347b5d){_0x61facd['push'](_0x61facd['shift']());}}}(a105_0xd886,0x59fa9));import{existsSync,readFileSync}from'fs';import a105_0x30796c from'path';const TDX_CONFIG_FILE=a105_0x1e3c45(0x88),SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x1a67a2=process[a105_0x1e3c45(0x82)]()){const _0x8f900b=a105_0x1e3c45;let _0x5c1d3d=a105_0x30796c[_0x8f900b(0x72)](_0x1a67a2);const _0xe9412a=a105_0x30796c[_0x8f900b(0x86)](_0x5c1d3d)[_0x8f900b(0x84)];while(_0x5c1d3d!==_0xe9412a){const _0x80e179=a105_0x30796c[_0x8f900b(0x78)](_0x5c1d3d,TDX_CONFIG_FILE);if(existsSync(_0x80e179))return _0x80e179;_0x5c1d3d=a105_0x30796c[_0x8f900b(0x8a)](_0x5c1d3d);}return null;}export function loadTdxConfig(_0x310645){const _0x35d6dd=a105_0x1e3c45,_0x490b94=readFileSync(_0x310645,_0x35d6dd(0x8b));let _0x4a864e;try{_0x4a864e=JSON[_0x35d6dd(0x86)](_0x490b94);}catch{throw new Error(_0x35d6dd(0x74)+_0x310645);}if(!_0x4a864e||typeof _0x4a864e!==_0x35d6dd(0x73))throw new Error('Invalid\x20tdx.json:\x20expected\x20object');const _0x5665aa=_0x4a864e;if(!_0x5665aa[_0x35d6dd(0x7d)]||typeof _0x5665aa[_0x35d6dd(0x7d)]!==_0x35d6dd(0x76))throw new Error(_0x35d6dd(0x89));return{'parent_segment':_0x5665aa[_0x35d6dd(0x7d)]};}export function findTdxConfig(_0x1e3bbb=process['cwd']()){const _0x59fc05=a105_0x1e3c45,_0x25c711=findTdxConfigPath(_0x1e3bbb);if(!_0x25c711)throw new Error('No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x255a5f=loadTdxConfig(_0x25c711),_0x151b00=a105_0x30796c[_0x59fc05(0x8a)](_0x25c711);return{'config':_0x255a5f,'configPath':_0x25c711,'configDir':_0x151b00};}export function tryFindTdxConfig(_0x54676f){try{return findTdxConfig(_0x54676f);}catch{return null;}}export function getSegmentRootDir(_0x4317b2,_0x38b62e=process[a105_0x1e3c45(0x82)]()){const _0x41fbfe=a105_0x1e3c45;return a105_0x30796c[_0x41fbfe(0x78)](_0x38b62e,SEGMENTS_DIR,_0x4317b2);}export function getTdxConfigPath(_0x3c55f3,_0x1db647=process[a105_0x1e3c45(0x82)]()){const _0x24bdeb=a105_0x1e3c45;return a105_0x30796c[_0x24bdeb(0x78)](getSegmentRootDir(_0x3c55f3,_0x1db647),TDX_CONFIG_FILE);}function a105_0xd886(){const _0x28a9df=['relative','join','12gHjtAc','207955smssMR','4hutSVX','40PoUrAg','parent_segment','852fMzTlh','3321696xNQVcD','1MlojJb','replace','cwd','3530256XjUbuE','root','stringify','parse','38965FKYWoC','tdx.json','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','dirname','utf-8','1232350ZyZjWQ','595377poeTFh','resolve','object','Invalid\x20JSON\x20in\x20','225765ceLgYj','string'];a105_0xd886=function(){return _0x28a9df;};return a105_0xd886();}export function getRelativePathFromConfig(_0x1ecc09,_0x36bc72){const _0x4e090d=a105_0x1e3c45,_0x44c01b=a105_0x30796c[_0x4e090d(0x72)](_0x1ecc09),_0x355f84=a105_0x30796c[_0x4e090d(0x77)](_0x36bc72,_0x44c01b);if(_0x355f84['startsWith']('..'))return'';return _0x355f84;}function a105_0x2d98(_0x25e51e,_0x2de6ec){_0x25e51e=_0x25e51e-0x72;const _0xd886f1=a105_0xd886();let _0x2d98ec=_0xd886f1[_0x25e51e];return _0x2d98ec;}export function localPathToTdFolderPath(_0x173193){const _0x29939a=a105_0x1e3c45,_0x3b4f84=a105_0x30796c[_0x29939a(0x8a)](_0x173193);if(_0x3b4f84==='.'||_0x3b4f84==='')return'';return _0x3b4f84[_0x29939a(0x81)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x373856,_0x57add3){const _0x195adf=a105_0x1e3c45;if(!_0x373856)return _0x57add3;return a105_0x30796c[_0x195adf(0x78)](_0x57add3,_0x373856);}export function createTdxConfigContent(_0x410dd2){const _0x588daa=a105_0x1e3c45,_0x2cf10e={'parent_segment':_0x410dd2};return JSON[_0x588daa(0x85)](_0x2cf10e,null,0x2)+'\x0a';}
|