@treasuredata/tdx 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-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/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.d.ts +39 -5
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.d.ts +2 -4
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/auth.js.map +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.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.d.ts +2 -1
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +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.d.ts +45 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +1 -0
- package/dist/core/version.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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.d.ts +8 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +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.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +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.d.ts +80 -0
- package/dist/sdk/workflow/clone-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/clone-workflow.js +1 -0
- package/dist/sdk/workflow/clone-workflow.js.map +1 -0
- package/dist/sdk/workflow/index.d.ts +94 -0
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.d.ts +77 -0
- package/dist/sdk/workflow/pull-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/pull-workflow.js +1 -0
- package/dist/sdk/workflow/pull-workflow.js.map +1 -0
- package/dist/sdk/workflow/push-workflow.d.ts +66 -0
- package/dist/sdk/workflow/push-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/push-workflow.js +1 -0
- package/dist/sdk/workflow/push-workflow.js.map +1 -0
- package/dist/sdk/workflow/tdx-config.d.ts +110 -0
- package/dist/sdk/workflow/tdx-config.d.ts.map +1 -0
- package/dist/sdk/workflow/tdx-config.js +1 -0
- package/dist/sdk/workflow/tdx-config.js.map +1 -0
- package/dist/sdk/workflow/workflow-utils.d.ts +10 -7
- package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js.map +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 a97_0x560ff4=a97_0x1212;(function(_0x4c1880,_0x587964){const _0x6a83ec=a97_0x1212,_0x4e7ca9=_0x4c1880();while(!![]){try{const _0x1d73f3=-parseInt(_0x6a83ec(0x1f3))/0x1+-parseInt(_0x6a83ec(0x18c))/0x2+-parseInt(_0x6a83ec(0x1ac))/0x3*(parseInt(_0x6a83ec(0x1de))/0x4)+parseInt(_0x6a83ec(0x21e))/0x5*(parseInt(_0x6a83ec(0x20f))/0x6)+-parseInt(_0x6a83ec(0x21c))/0x7+-parseInt(_0x6a83ec(0x1c5))/0x8+parseInt(_0x6a83ec(0x212))/0x9;if(_0x1d73f3===_0x587964)break;else _0x4e7ca9['push'](_0x4e7ca9['shift']());}catch(_0x28c9c9){_0x4e7ca9['push'](_0x4e7ca9['shift']());}}}(a97_0x5250,0x9b75e));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a97_0x560ff4(0x1b1);export function createPendingSegmentId(_0x32db08){return''+PENDING_SEGMENT_PREFIX+_0x32db08+'__';}export function isPendingSegmentId(_0x22bda4){const _0x74343a=a97_0x560ff4;return _0x22bda4[_0x74343a(0x152)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x245202){const _0x3619f0=a97_0x560ff4;return _0x245202[_0x3619f0(0x199)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x231542){return''+PENDING_ACTIVATION_PREFIX+_0x231542+'__';}export function isPendingActivationId(_0x251252){const _0xbbf0fe=a97_0x560ff4;return _0x251252[_0xbbf0fe(0x152)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x39f9ab){const _0x4cbc74=a97_0x560ff4;return _0x39f9ab[_0x4cbc74(0x199)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x50ac73,_0x58939f){const _0x423d33=a97_0x560ff4,_0x30610=_0x50ac73+'::'+(_0x58939f[_0x423d33(0x201)]()||_0x423d33(0x22f)),_0x4b40d7=createHash(_0x423d33(0x19a))[_0x423d33(0x1be)](_0x30610)[_0x423d33(0x1c4)](_0x423d33(0x237))['slice'](0x0,0xc);return _0x423d33(0x1ec)+_0x4b40d7;}export function ensureJourneyDefaults(_0x2f1a6b){const _0xc15899=a97_0x560ff4;!_0x2f1a6b[_0xc15899(0x15a)]&&(_0x2f1a6b['description']=''),!_0x2f1a6b[_0xc15899(0x1bd)]&&(_0x2f1a6b['state']=_0xc15899(0x210));}export function resolveTDFolderPath(_0x35a21a,_0x24a45a,_0x6d87f5){const _0x1d9526=a97_0x560ff4;if(!_0x24a45a)return _0x35a21a;if(_0x35a21a===_0x6d87f5||_0x35a21a[_0x1d9526(0x152)](_0x6d87f5+'/'))return _0x35a21a;return _0x35a21a?_0x6d87f5+'/'+_0x35a21a:_0x6d87f5;}export function addFoldersToCreate(_0x2bef1c,_0x2f512d,_0x1a6b52){const _0x4194c2=a97_0x560ff4;if(!_0x2bef1c)return;if(_0x2f512d['has'](_0x2bef1c))return;const _0x1178e4=_0x2bef1c['split']('/');let _0x1b9638='';for(const _0x1429e1 of _0x1178e4){_0x1b9638=_0x1b9638?_0x1b9638+'/'+_0x1429e1:_0x1429e1,!_0x2f512d[_0x4194c2(0x219)](_0x1b9638)&&_0x1a6b52[_0x4194c2(0x188)](_0x1b9638);}}import*as a97_0xb8392 from'yaml';import{readFileSync}from'fs';import a97_0x2db96c from'path';import{isJourneyDef,parseYamlString as a97_0x549390,toYamlString as a97_0x2102e8,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(_0x4aef2e){const _0x7fa3a3=a97_0x560ff4;if(Array['isArray'](_0x4aef2e))return'['+_0x4aef2e[_0x7fa3a3(0x1b2)](_0x475bd8=>stableStringify(_0x475bd8))[_0x7fa3a3(0x239)](',')+']';if(_0x4aef2e&&typeof _0x4aef2e===_0x7fa3a3(0x1a3)){const _0x2d67ba=_0x4aef2e,_0x535a62=Object['keys'](_0x2d67ba)[_0x7fa3a3(0x1ee)](),_0x29f5dd=_0x535a62['map'](_0x50fb6e=>'\x22'+_0x50fb6e+'\x22:'+stableStringify(_0x2d67ba[_0x50fb6e]));return'{'+_0x29f5dd['join'](',')+'}';}const _0x5dce0a=JSON['stringify'](_0x4aef2e);return _0x5dce0a===undefined?_0x7fa3a3(0x1ea):_0x5dce0a;}function activationSignature(_0x29f343){const _0x1ed725=a97_0x560ff4,_0x50214f={'connection':_0x29f343['connection'],..._0x29f343[_0x1ed725(0x174)]!==undefined&&{'all_columns':_0x29f343['all_columns']},..._0x29f343[_0x1ed725(0x168)]!==undefined&&{'columns':_0x29f343[_0x1ed725(0x168)]},..._0x29f343['behavior']!==undefined&&{'behavior':_0x29f343[_0x1ed725(0x181)]},..._0x29f343[_0x1ed725(0x1b3)]!==undefined&&{'schedule':_0x29f343[_0x1ed725(0x1b3)]},..._0x29f343['notification']!==undefined&&{'notification':_0x29f343[_0x1ed725(0x21b)]},..._0x29f343['connector_config']!==undefined&&{'connector_config':_0x29f343[_0x1ed725(0x213)]},..._0x29f343[_0x1ed725(0x222)]!==undefined&&{'activation_template_id':_0x29f343[_0x1ed725(0x222)]}};return stableStringify(_0x50214f);}export async function prepareSegmentFiles(_0x1415ff,_0x1222e6,_0xf4c7b8,_0x29f32f,_0x464b53){const _0x286a39=a97_0x560ff4,{activationDefToCreateRequest:_0x35b708}=await import(_0x286a39(0x205)),_0x42bd9f=[],_0x494962=new Set();for(const {yamlConfig:_0x3ccf5e,folderPath:_0x3c7ea5,sourcePath:_0x5ea5ec}of _0x1415ff){const _0x5661f7=resolveTDFolderPath(_0x3c7ea5,_0x29f32f,_0x464b53),_0x598750=_0x5661f7+':'+_0x3ccf5e[_0x286a39(0x1eb)],_0x3ea006=_0x1222e6['segmentByFolderAndName'][_0x286a39(0x1e0)](_0x598750),_0x5adfb7=_0x3ea006?_0x1222e6['activationsBySegmentId']['get'](_0x3ea006['id'])||[]:[];addFoldersToCreate(_0x5661f7,_0x1222e6[_0x286a39(0x158)],_0x494962);const _0x96c30c=calculateActivationActions(_0x3ccf5e[_0x286a39(0x218)]||[],_0x5adfb7,_0x1222e6[_0x286a39(0x1ef)],_0x1222e6[_0x286a39(0x1fa)]);for(const _0xbfc212 of _0x96c30c){(_0xbfc212['type']===_0x286a39(0x220)||_0xbfc212[_0x286a39(0x1f7)]===_0x286a39(0x1be))&&_0xbfc212['yamlActivation']&&(_0xbfc212[_0x286a39(0x231)]=await _0x35b708(_0xbfc212[_0x286a39(0x1c8)],_0xf4c7b8));}const _0xd59372=calculateSegmentDiff(_0x3ccf5e,_0x3ea006,_0x5adfb7,_0x1222e6[_0x286a39(0x1ef)],_0x1222e6['connectionIdToNameMap']);_0x42bd9f[_0x286a39(0x1e3)]({'relativePath':_0x3ccf5e[_0x286a39(0x1eb)],'absolutePath':_0x5ea5ec,'yamlConfig':_0x3ccf5e,'folderPath':_0x5661f7,'existingSegment':_0x3ea006,'existingActivations':_0x5adfb7,'isNew':_0xd59372[_0x286a39(0x20b)],'hasChanges':_0xd59372[_0x286a39(0x203)],'diff':_0xd59372['diff'],'activationActions':_0x96c30c});}return{'segmentFiles':_0x42bd9f,'foldersToCreate':_0x494962};}export async function prepareJourneyFiles(_0x3e3b7b,_0x22cd29,_0x230110,_0x1e7562){const _0x586e68=a97_0x560ff4,_0xb6929a=[],_0x501664=new Set();for(const {yamlConfig:_0x1bcab1,folderPath:_0x1c0fd2,sourcePath:_0x211261}of _0x3e3b7b){const _0xd351ed=resolveTDFolderPath(_0x1c0fd2,_0x230110,_0x1e7562),_0x2ebadf=_0xd351ed+':'+_0x1bcab1[_0x586e68(0x1eb)],_0x5a55b8=_0x22cd29[_0x586e68(0x1d9)][_0x586e68(0x1e0)](_0x2ebadf);let _0x4d8c8c,_0x458247;if(_0x5a55b8&&_0x5a55b8[_0x586e68(0x1fc)]>0x0){const _0x19afdb=buildLocalExpandedRuleMappings(_0x1bcab1),{createYamlContext:_0xeed26,prefetchJourneySegments:_0x14bafe}=createPushYamlContextForBundle(_0x22cd29[_0x586e68(0x1c3)],_0x22cd29[_0x586e68(0x226)],_0x22cd29[_0x586e68(0x15f)],_0x19afdb,_0x22cd29[_0x586e68(0x1ef)],_0x22cd29['connectionIdToNameMap'],_0x22cd29['activationStepsById'],_0x22cd29[_0x586e68(0x177)]);await _0x14bafe(_0x5a55b8[_0x586e68(0x1b2)](_0x277c88=>_0x277c88['id']));const _0x385a11=hasMultipleVersions(_0x1bcab1),_0xdeb046=async _0x93f3cd=>{const _0x141f44=_0x586e68,_0x1f8a3b=_0x22cd29[_0x141f44(0x177)]?.['get'](_0x93f3cd);if(_0x1f8a3b)return _0x1f8a3b;return _0x22cd29[_0x141f44(0x159)]({'journeyId':_0x93f3cd,'journeyName':_0x1bcab1['name'],'isMultiVersion':_0x5a55b8['length']>0x1});};if(_0x385a11&&_0x5a55b8[_0x586e68(0x1fc)]>0x1){const _0x1f5bfd=[];for(const _0x1c14b2 of _0x5a55b8){const _0x2e6bd0=_0x1c14b2[_0x586e68(0x238)]||0x1;_0x22cd29[_0x586e68(0x21f)]?.['update'](_0x586e68(0x1f4)+_0x1bcab1['name']+'\x20v'+_0x2e6bd0);const _0x2a8b3c=await _0xdeb046(_0x1c14b2['id']),_0x283746=_0xeed26(_0x1c14b2['id']),_0x52c2d5=await journeyResponseToDef(_0x2a8b3c,_0x283746);_0x1f5bfd['push']({'item':_0x1c14b2,'yaml':_0x52c2d5});}const _0x24707f=buildLocalRuleToNameMappingFromJourney(_0x1bcab1);_0x458247=buildMergedJourneyDef(_0x1f5bfd,_0x24707f);const _0x718147=Math[_0x586e68(0x229)](..._0x1f5bfd[_0x586e68(0x1b2)](_0x6bc99f=>_0x6bc99f[_0x586e68(0x228)][_0x586e68(0x238)]||0x0)),_0x34c782=_0x5a55b8['find'](_0x3d6422=>(_0x3d6422['versionNumber']||0x0)===_0x718147);_0x34c782&&(_0x22cd29[_0x586e68(0x21f)]?.[_0x586e68(0x1be)](_0x586e68(0x1f4)+_0x1bcab1[_0x586e68(0x1eb)]+'\x20v'+_0x718147),_0x4d8c8c=await _0xdeb046(_0x34c782['id']));}else{const _0x2da55a=_0x5a55b8[_0x5a55b8[_0x586e68(0x1fc)]-0x1];_0x22cd29[_0x586e68(0x21f)]?.[_0x586e68(0x1be)](_0x586e68(0x1f4)+_0x1bcab1[_0x586e68(0x1eb)]),_0x4d8c8c=await _0xdeb046(_0x2da55a['id']);const _0x1ec109=_0xeed26(_0x2da55a['id']),_0xb5e8d1=await journeyResponseToDef(_0x4d8c8c,_0x1ec109),_0x450ca0=buildLocalRuleToNameMappingFromJourney(_0x1bcab1);_0x458247=buildMergedJourneyDef([{'item':_0x2da55a,'yaml':_0xb5e8d1}],_0x450ca0);}}addFoldersToCreate(_0xd351ed,_0x22cd29['folderPathToId'],_0x501664);const _0x30d291=calculateJourneyDiff(_0x1bcab1,_0x458247);_0xb6929a[_0x586e68(0x1e3)]({'relativePath':_0x1bcab1['name'],'absolutePath':_0x211261,'yamlConfig':_0x1bcab1,'folderPath':_0xd351ed,'existingJourney':_0x4d8c8c,'isNew':_0x30d291[_0x586e68(0x20b)],'hasChanges':_0x30d291[_0x586e68(0x203)],'diff':_0x30d291[_0x586e68(0x17e)]});}return{'journeyFiles':_0xb6929a,'foldersToCreate':_0x501664};}export function calculateActivationActions(_0x264637,_0x30c090,_0x1a26c1,_0x565f3d){const _0x5bbb72=a97_0x560ff4,_0x3d1f07=[],_0x124970=new Map();for(const _0x4539a8 of _0x30c090){_0x124970[_0x5bbb72(0x1dc)](_0x4539a8[_0x5bbb72(0x1eb)],_0x4539a8);}const _0x3a29e1=new Map();for(const _0x1b0e17 of _0x264637){_0x3a29e1[_0x5bbb72(0x1dc)](_0x1b0e17[_0x5bbb72(0x1eb)],_0x1b0e17);}for(const _0x42eb94 of _0x264637){const _0x416219=_0x124970['get'](_0x42eb94['name']);if(!_0x416219)_0x3d1f07[_0x5bbb72(0x1e3)]({'type':_0x5bbb72(0x220),'name':_0x42eb94[_0x5bbb72(0x1eb)],'yamlActivation':_0x42eb94});else{const _0x6d93ce=activationResponseToDef(_0x416219,_0x1a26c1,_0x565f3d),_0x1559af=a97_0xb8392[_0x5bbb72(0x171)](_0x6d93ce),_0x23a266=a97_0xb8392[_0x5bbb72(0x171)](_0x42eb94);_0x1559af!==_0x23a266&&_0x3d1f07['push']({'type':'update','name':_0x42eb94[_0x5bbb72(0x1eb)],'yamlActivation':_0x42eb94,'existingActivation':_0x416219});}}for(const _0x291943 of _0x30c090){!_0x3a29e1['has'](_0x291943[_0x5bbb72(0x1eb)])&&_0x3d1f07[_0x5bbb72(0x1e3)]({'type':_0x5bbb72(0x1ba),'name':_0x291943[_0x5bbb72(0x1eb)],'existingActivation':_0x291943});}return _0x3d1f07;}export function calculateSegmentDiff(_0x3c43e4,_0x1d0e76,_0x52a5fc,_0x392a36,_0x139e00){const _0x1f83e7=segmentToYamlString(_0x3c43e4);if(_0x1d0e76){const _0x2fac99=segmentWithActivationsToYaml(_0x1d0e76,_0x52a5fc,undefined,_0x392a36,_0x139e00),_0x34361e=segmentToYamlString(_0x2fac99),_0x5b579e=generateDiff(_0x34361e,_0x1f83e7),_0x1d2ae5=hasChanges(_0x5b579e);return{'isNew':![],'hasChanges':_0x1d2ae5,'diff':_0x1d2ae5?formatDiffWithColors(_0x5b579e):undefined};}const _0x21a461=generateDiff('',_0x1f83e7);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x21a461)};}export function calculateJourneyDiff(_0x3c908f,_0x4fcdea){const _0x51ee51=normalizeJourneyDef(_0x3c908f,_0x3c908f),_0x30fa21=a97_0x2102e8(_0x51ee51);if(_0x4fcdea){const _0x2aa852=normalizeJourneyDef(_0x4fcdea,_0x3c908f),_0x45ce8f=a97_0x2102e8(_0x2aa852),_0x2887c4=generateDiff(_0x45ce8f,_0x30fa21),_0x479d95=hasChanges(_0x2887c4);return{'isNew':![],'hasChanges':_0x479d95,'diff':_0x479d95?formatDiffWithColors(_0x2887c4):undefined};}const _0x145415=generateDiff('',_0x30fa21);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x145415)};}export function findSegmentsToDelete(_0x3f0117,_0x339c3e,_0x12286f,_0x3719f4,_0x57d561){const _0x5c7e40=a97_0x560ff4,_0x3aa199=new Set();for(const {yamlConfig:_0x3079c8,folderPath:_0x1d9c1d}of _0x339c3e){_0x3aa199[_0x5c7e40(0x188)](_0x1d9c1d+':'+_0x3079c8[_0x5c7e40(0x1eb)]);}return _0x3f0117[_0x5c7e40(0x207)](_0x25009d=>{const _0x9d821e=_0x5c7e40,_0x5ea117=_0x25009d[_0x9d821e(0x185)]?_0x12286f[_0x9d821e(0x1e0)](_0x25009d['segmentFolderId'][_0x9d821e(0x19d)]())||'':'',_0xe9073f=_0x5ea117+':'+_0x25009d['name'];if(_0x3aa199['has'](_0xe9073f))return![];if(_0x57d561)return _0x5ea117===_0x3719f4||_0x5ea117[_0x9d821e(0x152)](_0x3719f4+'/');return!![];});}export function findJourneysToDelete(_0x5196e3,_0x3fc073,_0x3f266a,_0x3e94c9,_0x3e1925){const _0x2dc3ea=a97_0x560ff4,_0x15f486=new Set();for(const {yamlConfig:_0x1f3f61,folderPath:_0x638c8c}of _0x3fc073){_0x15f486['add'](_0x638c8c+':'+_0x1f3f61[_0x2dc3ea(0x1eb)]);}return _0x5196e3[_0x2dc3ea(0x207)](_0x4ee722=>{const _0x18de69=_0x2dc3ea,_0x50d68d=_0x4ee722[_0x18de69(0x1dd)]?_0x3f266a[_0x18de69(0x1e0)](_0x4ee722[_0x18de69(0x1dd)])||'':'',_0x377177=_0x50d68d+':'+_0x4ee722['journeyBundleName'];if(_0x15f486[_0x18de69(0x219)](_0x377177))return![];if(_0x3e1925)return _0x50d68d===_0x3e94c9||_0x50d68d['startsWith'](_0x3e94c9+'/');return!![];});}export function buildSegmentLookupMap(_0x3ac4bc,_0x169ecd){const _0x41b742=a97_0x560ff4,_0x41d48c=new Map();for(const _0x2cb70e of _0x3ac4bc){const _0x548b92=_0x2cb70e[_0x41b742(0x185)]?_0x169ecd[_0x41b742(0x1e0)](_0x2cb70e[_0x41b742(0x185)][_0x41b742(0x19d)]())||'':'',_0x546a67=_0x548b92+':'+_0x2cb70e['name'];_0x41d48c[_0x41b742(0x1dc)](_0x546a67,_0x2cb70e);}return _0x41d48c;}export function buildSegmentNameToIdMap(_0x5e5264){const _0x3bed8f=a97_0x560ff4,_0x17598a=new Map();for(const _0x42e0ff of _0x5e5264){_0x17598a[_0x3bed8f(0x1dc)](_0x42e0ff['name'],_0x42e0ff['id']);}return _0x17598a;}export function buildJourneyBundleLookupMap(_0x4188d1,_0x2f207){const _0x5e1e2e=a97_0x560ff4,_0x3e2807=new Map();for(const _0x5054ff of _0x4188d1){const _0x9b070d=_0x5054ff[_0x5e1e2e(0x1dd)]?_0x2f207['get'](_0x5054ff[_0x5e1e2e(0x1dd)])||'':'',_0x3535bb=_0x9b070d+':'+_0x5054ff[_0x5e1e2e(0x16b)];!_0x3e2807['has'](_0x3535bb)&&_0x3e2807['set'](_0x3535bb,[]),_0x3e2807['get'](_0x3535bb)[_0x5e1e2e(0x1e3)](_0x5054ff);}for(const _0x219fd7 of _0x3e2807['values']()){_0x219fd7[_0x5e1e2e(0x1ee)]((_0x4aa529,_0x285886)=>(_0x4aa529[_0x5e1e2e(0x238)]||0x0)-(_0x285886[_0x5e1e2e(0x238)]||0x0));}return _0x3e2807;}export function collectFoldersToCreate(_0x2ff323,_0x25a833){const _0x19772d=a97_0x560ff4,_0x318df3=new Set();for(const _0x5c4f38 of _0x2ff323){if(!_0x5c4f38)continue;if(_0x25a833[_0x19772d(0x219)](_0x5c4f38))continue;const _0xe148bd=_0x5c4f38[_0x19772d(0x163)]('/');let _0x2eda42='';for(const _0x189bfd of _0xe148bd){_0x2eda42=_0x2eda42?_0x2eda42+'/'+_0x189bfd:_0x189bfd,!_0x25a833['has'](_0x2eda42)&&_0x318df3[_0x19772d(0x188)](_0x2eda42);}}return _0x318df3;}export function parseAndClassifyYamlFiles(_0x45e547,_0x534690,_0x55863b){const _0x431953=a97_0x560ff4,_0x4705eb=[],_0x260653=[];for(const _0x900b9b of _0x45e547){const _0x65e1b0=a97_0x2db96c['relative'](_0x534690,a97_0x2db96c[_0x431953(0x1cc)](_0x900b9b)),_0x481f1a=_0x65e1b0==='.'?'':_0x65e1b0,_0x5f04cf=readFileSync(_0x900b9b,_0x431953(0x236)),_0x433641=a97_0xb8392[_0x431953(0x1a1)](_0x5f04cf);if(isJourneyDef(_0x433641)){const _0x1c1610=a97_0x549390(_0x5f04cf);_0x260653['push']({'yamlConfig':_0x1c1610,'folderPath':_0x481f1a,'sourcePath':_0x900b9b});}else{if(!_0x55863b?.[_0x431953(0x1e7)]){const _0x846256=parseSegmentYamlFile(_0x5f04cf),_0x5a4ebf=normalizeChildSegmentYaml(_0x846256);_0x4705eb[_0x431953(0x1e3)]({'yamlConfig':_0x5a4ebf,'folderPath':_0x481f1a,'sourcePath':_0x900b9b});}}}return{'segments':_0x4705eb,'journeys':_0x260653};}export function validateParsedFiles(_0x1a9cd3,_0x110447){const _0x3cf9f5=a97_0x560ff4,_0x5bf0ec=[];for(const {yamlConfig:_0x42add8,sourcePath:_0x117609}of _0x1a9cd3[_0x3cf9f5(0x1a6)]){const _0x187280=readFileSync(_0x117609,_0x3cf9f5(0x236)),_0xdfa143=a97_0xb8392[_0x3cf9f5(0x1b9)](_0x187280),_0x39f798=validateSegmentDef(_0x42add8,{'source':_0x187280,'document':_0xdfa143});if(!_0x39f798[_0x3cf9f5(0x216)]){const _0x23b515=a97_0x2db96c[_0x3cf9f5(0x1f2)](_0x110447,_0x117609);_0x5bf0ec[_0x3cf9f5(0x1e3)]({'filePath':_0x23b515,'source':_0x187280,'result':_0x39f798,'isJourney':![]});}}for(const {yamlConfig:_0x22b1bf,sourcePath:_0x42451a}of _0x1a9cd3[_0x3cf9f5(0x1d8)]){const _0x542fb6=readFileSync(_0x42451a,_0x3cf9f5(0x236)),_0x403fd5=a97_0xb8392[_0x3cf9f5(0x1b9)](_0x542fb6),_0x325d42=validateJourneyDef(_0x22b1bf,{'source':_0x542fb6,'document':_0x403fd5});if(!_0x325d42[_0x3cf9f5(0x216)]){const _0x23dab1=a97_0x2db96c[_0x3cf9f5(0x1f2)](_0x110447,_0x42451a);_0x5bf0ec[_0x3cf9f5(0x1e3)]({'filePath':_0x23dab1,'source':_0x542fb6,'result':_0x325d42,'isJourney':!![]});}}return _0x5bf0ec;}export function formatValidationErrors(_0x25a323){const _0x7cfdd6=a97_0x560ff4,_0x5b1c9c=[];for(const {filePath:_0x51161b,source:_0x58eca1,result:_0x30d348,isJourney:_0x27b320}of _0x25a323){const _0x30ee21=_0x27b320?_0x7cfdd6(0x22a):_0x7cfdd6(0x22f);_0x5b1c9c[_0x7cfdd6(0x1e3)]('\x0a'+_0x51161b+'\x20('+_0x30ee21+_0x7cfdd6(0x22d)+_0x30d348[_0x7cfdd6(0x18e)][_0x7cfdd6(0x1fc)]+_0x7cfdd6(0x1f8)),_0x5b1c9c[_0x7cfdd6(0x1e3)](formatValidationResult(_0x30d348,_0x58eca1,_0x51161b));}return _0x5b1c9c['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x2bf80d){const _0x510885=a97_0x560ff4,_0x3c784c=new Set(),_0x10f391=new Map(),_0x440ad0=collectSegmentUsageCounts(_0x2bf80d);if(_0x2bf80d[_0x510885(0x1a6)])for(const [_0xc0fab2,_0x3a75c1]of Object[_0x510885(0x1f0)](_0x2bf80d[_0x510885(0x1a6)])){_0x3c784c[_0x510885(0x188)](_0xc0fab2);if(_0x3a75c1[_0x510885(0x1f1)]){const _0x2b5835=yamlRuleToApi(_0x3a75c1[_0x510885(0x1f1)]),_0x23ec00=apiRuleToYaml(_0x2b5835);_0x10f391[_0x510885(0x1dc)](_0xc0fab2,_0x23ec00);}}const _0x168883=new Map();let _0x17794a=0x0;for(const [_0x4e60c5,_0x373d6c]of _0x10f391){const _0x33e381=serializeExpandedRule(_0x373d6c,_0x10f391),_0x5776c4=_0x168883[_0x510885(0x1e0)](_0x33e381)||[];_0x5776c4[_0x510885(0x1e3)]({'name':_0x4e60c5,'index':_0x17794a}),_0x168883[_0x510885(0x1dc)](_0x33e381,_0x5776c4),_0x17794a++;}const _0x34b5de=new Map();for(const [_0x2eec24,_0x1ebd6c]of _0x168883){const _0x585c9=_0x1ebd6c[_0x510885(0x223)]()['sort']((_0x298cf4,_0x11722f)=>{const _0x5d69ac=_0x510885,_0xc0a177=_0x440ad0[_0x5d69ac(0x1e0)](_0x298cf4[_0x5d69ac(0x1eb)])||0x0,_0x3f72c1=_0x440ad0['get'](_0x11722f[_0x5d69ac(0x1eb)])||0x0;if(_0xc0a177!==_0x3f72c1)return _0x3f72c1-_0xc0a177;return _0x298cf4[_0x5d69ac(0x190)]-_0x11722f[_0x5d69ac(0x190)];})[_0x510885(0x1b2)](_0x231f11=>_0x231f11[_0x510885(0x1eb)]),_0x13c58c=[];for(const _0x2f3ef6 of _0x585c9){const _0x3a18ef=_0x440ad0['get'](_0x2f3ef6)||0x0,_0x539906=Math[_0x510885(0x229)](_0x3a18ef,0x1);for(let _0x4060d6=0x0;_0x4060d6<_0x539906;_0x4060d6++){_0x13c58c[_0x510885(0x1e3)](_0x2f3ef6);}}_0x34b5de[_0x510885(0x1dc)](_0x2eec24,_0x13c58c);}return{'existingLocalSegmentNames':_0x3c784c,'localSegmentRules':_0x10f391,'localExpandedRuleToNames':_0x34b5de};}async function buildServerSegmentRuleMap(_0x534005,_0x58ca4c,_0x119e86,_0x1ad652){const _0x1dd72c=new Map(),_0x3a86d3=new Set(),_0x371b5b=async _0x698588=>{const _0x256dcf=a97_0x1212;if(_0x3a86d3[_0x256dcf(0x219)](_0x698588))return;_0x3a86d3[_0x256dcf(0x188)](_0x698588);let _0x224a4a=_0x119e86['find'](_0x17d6b4=>_0x17d6b4['id']===_0x698588);if(!_0x224a4a)try{_0x224a4a=await _0x534005[_0x256dcf(0x22f)][_0x256dcf(0x1d6)](_0x58ca4c,_0x698588);}catch{return;}if(!_0x224a4a?.['rule'])return;const _0x55324c=apiRuleToYaml(_0x224a4a[_0x256dcf(0x1f1)]);_0x1dd72c['set'](_0x698588,_0x55324c);const _0x25955e=collectSegmentRefsFromRule(_0x55324c);for(const _0x3204fe of _0x25955e){await _0x371b5b(_0x3204fe);}};for(const _0x26e9dc of _0x1ad652){await _0x371b5b(_0x26e9dc);}return _0x1dd72c;}export function createSegmentIdResolver(_0x5aeb48,_0x4b0063){return async _0x4d22b8=>{const _0x51790b=a97_0x1212,_0x3db8cc=_0x5aeb48[_0x51790b(0x1e0)](_0x4d22b8);if(!_0x3db8cc)throw new SDKError(ErrorCode[_0x51790b(0x161)],_0x51790b(0x1a4)+_0x4d22b8+_0x51790b(0x1e5)+_0x4b0063+'\x27)');return _0x3db8cc;};}export function extractRootFolderId(_0x42e494){const _0x130d28=a97_0x560ff4;return _0x42e494['relationships']?.[_0x130d28(0x1fe)]?.[_0x130d28(0x154)]?.['id']||_0x42e494[_0x130d28(0x166)]?.[_0x130d28(0x1b8)]?.['data']?.['id'];}export function buildConnectionMaps(_0x120cc0){const _0x153253=a97_0x560ff4,_0x48f753=new Map(),_0x3a3351=new Map(),_0x197abf=new Map();for(const _0x47f254 of _0x120cc0){_0x48f753[_0x153253(0x1dc)](_0x47f254[_0x153253(0x1eb)],parseInt(_0x47f254['id'],0xa)),_0x3a3351[_0x153253(0x1dc)](_0x47f254['id'],_0x47f254[_0x153253(0x1eb)]),_0x197abf[_0x153253(0x1dc)](_0x47f254[_0x153253(0x1eb)],_0x47f254[_0x153253(0x1f7)]);}return{'nameToId':_0x48f753,'idToName':_0x3a3351,'nameToType':_0x197abf};}export function calculatePushStats(_0x5a0750,_0xdd14d7,_0x2337ed,_0x3c2a32,_0x2b12a7,_0x3888d8,_0x359da8){const _0xd896a8=a97_0x560ff4,_0x4fe4ce=_0x5a0750[_0xd896a8(0x207)](_0x20b319=>_0x20b319[_0xd896a8(0x20b)]),_0x1173c6=_0x5a0750[_0xd896a8(0x207)](_0x27ffee=>!_0x27ffee['isNew']&&_0x27ffee['hasChanges']),_0x32b5f2=_0x5a0750['filter'](_0x43205b=>!_0x43205b[_0xd896a8(0x20b)]&&!_0x43205b['hasChanges']),_0xa67c1e=_0x3888d8?_0x3c2a32:[],_0x5e1675=_0xdd14d7[_0xd896a8(0x207)](_0x356d02=>_0x356d02[_0xd896a8(0x20b)]),_0x23b922=_0xdd14d7[_0xd896a8(0x207)](_0x556d55=>!_0x556d55['isNew']&&_0x556d55[_0xd896a8(0x203)]),_0x3d38f1=_0xdd14d7[_0xd896a8(0x207)](_0x43f00b=>!_0x43f00b[_0xd896a8(0x20b)]&&!_0x43f00b[_0xd896a8(0x203)]),_0xf9e8a5=_0x3888d8?_0x2b12a7:[],_0x223f1a=_0x5a0750[_0xd896a8(0x221)](_0x25f0a7=>_0x25f0a7[_0xd896a8(0x235)]),_0x399abe=_0x223f1a['filter'](_0x5a68ba=>_0x5a68ba[_0xd896a8(0x1f7)]===_0xd896a8(0x220)),_0x18d834=_0x223f1a['filter'](_0x49ea52=>_0x49ea52[_0xd896a8(0x1f7)]===_0xd896a8(0x1be)),_0x3f0c16=_0x223f1a[_0xd896a8(0x207)](_0x5abb68=>_0x5abb68[_0xd896a8(0x1f7)]==='delete'),_0x2c2b88=Array[_0xd896a8(0x178)](_0x2337ed)[_0xd896a8(0x1ee)](),_0x1c6372=_0x359da8?![]:_0x4fe4ce['length']>0x0||_0x1173c6[_0xd896a8(0x1fc)]>0x0||_0xa67c1e[_0xd896a8(0x1fc)]>0x0,_0x16e5b3=_0x5e1675[_0xd896a8(0x1fc)]>0x0||_0x23b922['length']>0x0||_0xf9e8a5[_0xd896a8(0x1fc)]>0x0,_0x10d45f=_0x359da8?![]:_0x223f1a[_0xd896a8(0x1fc)]>0x0,_0x4c5644=_0x2c2b88['length']>0x0;return{'segments':{'new':_0x4fe4ce,'changed':_0x1173c6,'unchanged':_0x32b5f2,'toDelete':_0xa67c1e},'journeys':{'new':_0x5e1675,'changed':_0x23b922,'unchanged':_0x3d38f1,'toDelete':_0xf9e8a5},'activations':{'all':_0x223f1a,'toCreate':_0x399abe,'toUpdate':_0x18d834,'toDelete':_0x3f0c16},'folders':{'toCreate':_0x2c2b88},'counts':{'segments':{'new':_0x4fe4ce[_0xd896a8(0x1fc)],'changed':_0x1173c6['length'],'unchanged':_0x32b5f2['length'],'toDelete':_0xa67c1e[_0xd896a8(0x1fc)]},'journeys':{'new':_0x5e1675['length'],'changed':_0x23b922[_0xd896a8(0x1fc)],'unchanged':_0x3d38f1[_0xd896a8(0x1fc)],'toDelete':_0xf9e8a5[_0xd896a8(0x1fc)]},'activations':{'create':_0x399abe[_0xd896a8(0x1fc)],'update':_0x18d834[_0xd896a8(0x1fc)],'delete':_0x3f0c16['length']},'folders':_0x2c2b88[_0xd896a8(0x1fc)]},'hasChanges':_0x1c6372||_0x16e5b3||_0x10d45f||_0x4c5644};}export async function buildPushExecutionContext(_0x356962,_0x842a40,_0x50d738,_0x11f436,_0x335fe2,_0x1dc97d){const _0x49d8f9=a97_0x560ff4,_0x1c1cdb=extractRootFolderId(_0x50d738),{pathToId:_0x4e2735,idToPath:_0x2afb90}=buildFolderMaps(_0x335fe2),_0x8786d5=buildSegmentNameToIdMap(_0x11f436),_0x378df5=new Map(),{batchAsync:_0xf91aea}=await import(_0x49d8f9(0x1d7)),[_0x1922be,_0x23a06a]=await Promise[_0x49d8f9(0x160)]([_0x356962[_0x49d8f9(0x214)][_0x49d8f9(0x179)](),_0x356962[_0x49d8f9(0x1ae)][_0x49d8f9(0x1c7)](),((async()=>{const _0x5eed9b=_0x49d8f9;!_0x1dc97d&&_0x11f436[_0x5eed9b(0x1fc)]>0x0&&await _0xf91aea(_0x11f436,async _0x387f36=>{const _0x545bda=_0x5eed9b,_0x4379df=await _0x356962[_0x545bda(0x22f)]['listActivations'](_0x842a40,_0x387f36['id']);_0x378df5[_0x545bda(0x1dc)](_0x387f36['id'],_0x4379df);});})())]),{emailToId:_0xf506b4,idToEmail:_0x3d51c2}=_0x1922be,_0x264212=buildConnectionMaps(_0x23a06a);return{'rootFolderId':_0x1c1cdb,'folderPathToId':_0x4e2735,'folderIdToPath':_0x2afb90,'segmentNameToId':_0x8786d5,'activationsBySegmentId':_0x378df5,'emailToIdMap':_0xf506b4,'idToEmailMap':_0x3d51c2,'connectionNameToIdMap':_0x264212[_0x49d8f9(0x1ff)],'connectionIdToNameMap':_0x264212['idToName'],'connectionNameToTypeMap':_0x264212[_0x49d8f9(0x17a)]};}export function createPushYamlContextForBundle(_0x391d43,_0x4ce54e,_0xfda393,_0x3f5064,_0x2ebb4d,_0x4cee59,_0x497795,_0xe1ae82){const {existingLocalSegmentNames:_0x1d9a4e,localExpandedRuleToNames:_0x4c91ca}=_0x3f5064,_0x14d525=new Set(),_0x693b33=new Map(),_0x1cdafc=new Set(),_0x4b6a32=new Map(),_0x1925fa=new Map(),_0x456989=createJumpTargetCache(),_0x4f1525=new Map(),_0x443ba1=new Map(),_0x23c676=new Set();let _0x57ac18;const _0x2a6500=_0x5a85b9=>{const _0x343e15={'resolveSegment':async _0x84207f=>{const _0x68f589=a97_0x1212,_0x4e593f=_0x1925fa[_0x68f589(0x1e0)](_0x84207f);if(_0x4e593f!==undefined)return{'name':_0x4e593f,'isJourneyLocal':!![]};try{let _0x51850a=_0xfda393[_0x68f589(0x16e)](_0x4ec7f2=>_0x4ec7f2['id']===_0x84207f);!_0x51850a&&(_0x51850a=await _0x391d43[_0x68f589(0x22f)][_0x68f589(0x1d6)](_0x4ce54e,_0x84207f));const _0x5c6628=generateJourneyLocalName(_0x51850a[_0x68f589(0x1eb)]),_0x42f01d=_0x51850a[_0x68f589(0x19b)]===SEGMENT_KIND_JOURNEY&&_0x5c6628!==undefined;let _0x26a0b8=_0x51850a[_0x68f589(0x1eb)],_0x486460;if(_0x42f01d&&_0x51850a['rule']){const _0x57b71c=apiRuleToYaml(_0x51850a['rule']);_0x443ba1[_0x68f589(0x1dc)](_0x84207f,_0x57b71c);const _0x4a61cc=async _0x31936a=>{const _0x2916d6=_0x68f589,_0x9bed2d=collectSegmentRefsFromRule(_0x31936a);for(const _0x45ab37 of _0x9bed2d){if(!_0x443ba1['has'](_0x45ab37))try{const _0x5adb5d=await _0x391d43[_0x2916d6(0x22f)][_0x2916d6(0x1d6)](_0x4ce54e,_0x45ab37);if(_0x5adb5d?.['rule']){const _0x4dfc34=apiRuleToYaml(_0x5adb5d[_0x2916d6(0x1f1)]);_0x443ba1[_0x2916d6(0x1dc)](_0x45ab37,_0x4dfc34),await _0x4a61cc(_0x4dfc34);}}catch{}}};await _0x4a61cc(_0x57b71c);const _0x1ee747=serializeExpandedRule(_0x57b71c,_0x443ba1),_0x31c223=_0x4c91ca[_0x68f589(0x1e0)](_0x1ee747);if(_0x31c223&&_0x31c223[_0x68f589(0x1fc)]>0x0){const _0x5c6ef3=_0x693b33[_0x68f589(0x1e0)](_0x1ee747)||0x0,_0x26bfe6=_0x31c223[_0x5c6ef3]||_0x31c223[_0x31c223[_0x68f589(0x1fc)]-0x1];_0x693b33['set'](_0x1ee747,_0x5c6ef3+0x1),_0x26a0b8=_0x26bfe6,_0x14d525[_0x68f589(0x188)](_0x26a0b8),_0x1925fa['set'](_0x84207f,_0x26a0b8);const _0x38a7ff=await resolveRuleSegmentRefs(_0x57b71c,async _0x3c9915=>{const _0x5275a9=_0x68f589,_0x56c3ab=_0x1925fa['get'](_0x3c9915);if(_0x56c3ab)return _0x56c3ab;const _0x4e8e19=await _0x57ac18[_0x5275a9(0x1c0)](_0x3c9915);return _0x4e8e19[_0x5275a9(0x1eb)];});_0x486460={'description':_0x51850a[_0x68f589(0x15a)],'rule':_0x38a7ff};}else{const _0x1ebedb=_0x4f1525['get'](_0x1ee747);if(_0x1ebedb)_0x26a0b8=_0x1ebedb,_0x1925fa[_0x68f589(0x1dc)](_0x84207f,_0x26a0b8);else{if(_0x5c6628){let _0x4b504f=_0x5c6628,_0x777c43=0x2;while(_0x14d525[_0x68f589(0x219)](_0x4b504f)||_0x1d9a4e[_0x68f589(0x219)](_0x4b504f)){_0x4b504f=_0x5c6628+'_'+_0x777c43,_0x777c43++;}_0x14d525[_0x68f589(0x188)](_0x4b504f),_0x26a0b8=_0x4b504f;}_0x1925fa[_0x68f589(0x1dc)](_0x84207f,_0x26a0b8),_0x4f1525['set'](_0x1ee747,_0x26a0b8);const _0x113512=await resolveRuleSegmentRefs(_0x57b71c,async _0x3ef2b9=>{const _0x3caaf0=_0x68f589,_0x17bc2b=_0x1925fa[_0x3caaf0(0x1e0)](_0x3ef2b9);if(_0x17bc2b)return _0x17bc2b;const _0xef1e5=await _0x57ac18[_0x3caaf0(0x1c0)](_0x3ef2b9);return _0xef1e5['name'];});_0x486460={'description':_0x51850a[_0x68f589(0x15a)],'rule':_0x113512};}}}return{'name':_0x26a0b8,'isJourneyLocal':_0x42f01d,'definition':_0x486460};}catch{return{'name':_0x84207f,'isJourneyLocal':![]};}},'resolveActivation':async _0x47235c=>{const _0x1bf3ed=a97_0x1212,_0x44281f=_0x4b6a32[_0x1bf3ed(0x1e0)](_0x47235c);if(_0x44281f!==undefined)return{'name':_0x44281f,'isJourneyLocal':!![]};try{let _0x2f0eb6=_0x497795?.[_0x1bf3ed(0x1e0)](_0x47235c);!_0x2f0eb6&&(_0x2f0eb6=await _0x391d43[_0x1bf3ed(0x22a)]['getActivation'](_0x5a85b9,_0x47235c));const _0x2f5604=_0x2f0eb6[_0x1bf3ed(0x1bc)][_0x1bf3ed(0x184)][_0x1bf3ed(0x1eb)]||_0x47235c,_0x5413d1=sanitizeYamlKey(_0x2f5604)||'activation_'+_0x47235c;let _0x48e01f=_0x5413d1,_0x3e1eb2=0x2;while(_0x1cdafc[_0x1bf3ed(0x219)](_0x48e01f)){_0x48e01f=_0x5413d1+'_'+_0x3e1eb2,_0x3e1eb2++;}_0x1cdafc[_0x1bf3ed(0x188)](_0x48e01f),_0x4b6a32[_0x1bf3ed(0x1dc)](_0x47235c,_0x48e01f);const _0x249bcb=journeyActivationStepToYaml(_0x2f0eb6,_0x2ebb4d,_0x4cee59);return{'name':_0x48e01f,'isJourneyLocal':!![],'definition':_0x249bcb};}catch{return{'name':_0x47235c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x14d32c,_0x3816a4)=>resolveJumpTarget(_0x14d32c,_0x3816a4,_0x456989,async _0x49d576=>{const _0x533449=a97_0x1212,_0x221542=_0xe1ae82?.[_0x533449(0x1e0)](_0x49d576);if(_0x221542)return _0x221542;return _0x391d43[_0x533449(0x22a)][_0x533449(0x172)](_0x49d576);})};return _0x57ac18=_0x343e15,_0x343e15;},_0x3b346d=async _0x74ab31=>{const _0x3a0891=a97_0x1212,{collectSegmentIdsFromJourneyApi:_0x17af12}=await import(_0x3a0891(0x155)),{batchAsync:_0xb3278a}=await import(_0x3a0891(0x1d7)),_0x538fa8=new Set();for(const _0xbeca48 of _0x74ab31){let _0x3c6f4a=_0xe1ae82?.['get'](_0xbeca48);!_0x3c6f4a&&(_0x3c6f4a=await _0x391d43[_0x3a0891(0x22a)][_0x3a0891(0x172)](_0xbeca48));const _0x213919=_0x17af12(_0x3c6f4a);for(const _0x559150 of _0x213919){_0x538fa8[_0x3a0891(0x188)](_0x559150);}}let _0x3e3abd=Array[_0x3a0891(0x178)](_0x538fa8);while(_0x3e3abd[_0x3a0891(0x1fc)]>0x0){const _0x268e8a=_0x3e3abd[_0x3a0891(0x207)](_0x5dc85b=>!_0x23c676['has'](_0x5dc85b));if(_0x268e8a[_0x3a0891(0x1fc)]===0x0)break;const _0x154723=await _0xb3278a(_0x268e8a,async _0x268232=>{const _0x305d1f=_0x3a0891;_0x23c676[_0x305d1f(0x188)](_0x268232);let _0x545c7e=_0xfda393[_0x305d1f(0x16e)](_0x7f695f=>_0x7f695f['id']===_0x268232);if(!_0x545c7e)try{_0x545c7e=await _0x391d43['segment'][_0x305d1f(0x1d6)](_0x4ce54e,_0x268232);}catch{return null;}return{'segmentId':_0x268232,'segment':_0x545c7e};},0xa),_0x1b9388=new Set();for(const _0x2f4ad6 of _0x154723){if(!_0x2f4ad6?.[_0x3a0891(0x22f)]?.['rule'])continue;const _0x4601b8=apiRuleToYaml(_0x2f4ad6[_0x3a0891(0x22f)]['rule']);_0x443ba1[_0x3a0891(0x1dc)](_0x2f4ad6[_0x3a0891(0x17b)],_0x4601b8);const _0x25d35a=collectSegmentRefsFromRule(_0x4601b8);for(const _0x4b50d1 of _0x25d35a){!_0x23c676[_0x3a0891(0x219)](_0x4b50d1)&&_0x1b9388[_0x3a0891(0x188)](_0x4b50d1);}}_0x3e3abd=Array['from'](_0x1b9388);}};return{'createYamlContext':_0x2a6500,'prefetchJourneySegments':_0x3b346d};}export async function executePushSegments(_0x237086,_0x3d8685,_0x10e2a4,_0xe68e60,_0x179af4){const _0x3b3b05=a97_0x560ff4,{segmentDefToCreateRequest:_0x2807c7,segmentDefToUpdateRequest:_0xdf6594}=await import(_0x3b3b05(0x205)),_0x46a043=_0x10e2a4[_0x3b3b05(0x158)],_0x551c41=0x5,_0x5e76ad=async _0x40012a=>{const _0x2f8836=_0x3b3b05,_0x45f2f5=_0x40012a[_0x2f8836(0x194)]?_0x46a043['get'](_0x40012a[_0x2f8836(0x194)]):undefined;let _0x545fb1;const _0x2ea72f={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x40012a[_0x2f8836(0x20b)]){_0x179af4[_0x2f8836(0x15c)]?.({'type':'segment_creating','name':_0x40012a['yamlConfig']['name']});const _0x454752=_0x2807c7(_0x40012a[_0x2f8836(0x1a5)],_0x45f2f5),_0x5b3cd4=await _0x179af4[_0x2f8836(0x18f)](_0x2f8836(0x1cf)+_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)]+_0x2f8836(0x224),()=>_0x237086[_0x2f8836(0x22f)][_0x2f8836(0x208)](_0xe68e60[_0x2f8836(0x226)],_0x454752));_0x545fb1=_0x5b3cd4[_0x2f8836(0x154)]['id'],_0x2ea72f[_0x2f8836(0x164)]={'name':_0x40012a['yamlConfig'][_0x2f8836(0x1eb)],'id':_0x545fb1},_0x179af4[_0x2f8836(0x15c)]?.({'type':_0x2f8836(0x234),'name':_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)],'segmentId':_0x545fb1}),_0x179af4['logSuccess']?.(_0x2f8836(0x1fb)+_0x40012a[_0x2f8836(0x1a5)]['name']+'\x27'),_0x2ea72f[_0x2f8836(0x162)]=0x1;}else{if(_0x40012a[_0x2f8836(0x203)]){_0x179af4['onProgress']?.({'type':_0x2f8836(0x195),'name':_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)]});const _0xfeb70d=_0xdf6594(_0x40012a[_0x2f8836(0x1a5)]);_0x45f2f5!==_0x40012a['existingSegment']?.[_0x2f8836(0x185)]&&(_0xfeb70d[_0x2f8836(0x185)]=_0x45f2f5?parseInt(_0x45f2f5,0xa):undefined),await _0x179af4['withProgress']('Updating\x20segment\x20\x27'+_0x40012a['yamlConfig'][_0x2f8836(0x1eb)]+_0x2f8836(0x224),()=>_0x237086[_0x2f8836(0x22f)][_0x2f8836(0x1d2)](_0xe68e60[_0x2f8836(0x226)],_0x40012a[_0x2f8836(0x16c)]['id'],_0xfeb70d)),_0x545fb1=_0x40012a[_0x2f8836(0x16c)]['id'],_0x179af4['onProgress']?.({'type':_0x2f8836(0x1c1),'name':_0x40012a['yamlConfig'][_0x2f8836(0x1eb)]}),_0x179af4[_0x2f8836(0x1c6)]?.('Updated\x20segment\x20\x27'+_0x40012a[_0x2f8836(0x1a5)]['name']+'\x27'),_0x2ea72f[_0x2f8836(0x1e6)]=0x1;}else _0x545fb1=_0x40012a['existingSegment']['id'];}}catch(_0x29445f){const _0x500320=isHttp400Error(_0x29445f),_0x564ad6=_0x500320?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x2f8836(0x1cb)],_0x11d4d6=getErrorMessage(_0x29445f);throw new SDKError(_0x564ad6,_0x2f8836(0x230)+(_0x40012a[_0x2f8836(0x20b)]?_0x2f8836(0x220):_0x2f8836(0x1be))+'\x20segment\x20from\x20file:\x20'+_0x40012a[_0x2f8836(0x156)]+_0x2f8836(0x1ce)+_0x11d4d6,_0x29445f);}try{const _0x36672b=await syncActivationsForSegment(_0x237086,_0xe68e60[_0x2f8836(0x226)],_0x545fb1,_0x40012a['yamlConfig']['name'],_0x40012a[_0x2f8836(0x235)],_0x179af4,_0x40012a['absolutePath']);_0x2ea72f[_0x2f8836(0x218)]=_0x36672b;}catch(_0x4ad1a3){if(_0x4ad1a3 instanceof SDKError)throw _0x4ad1a3;throw new SDKError(ErrorCode[_0x2f8836(0x22b)],_0x2f8836(0x1a8)+_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)]+_0x2f8836(0x16d)+_0x40012a[_0x2f8836(0x156)]+'\x0a\x20\x20'+getErrorMessage(_0x4ad1a3),_0x4ad1a3);}return _0x2ea72f;},_0x288cd0=await batchAsync(_0x3d8685,_0x5e76ad,_0x551c41),_0x10de56={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x21dfdd of _0x288cd0){_0x10de56[_0x3b3b05(0x162)]+=_0x21dfdd[_0x3b3b05(0x162)],_0x10de56[_0x3b3b05(0x1e6)]+=_0x21dfdd['updated'],_0x21dfdd[_0x3b3b05(0x164)]&&_0x10de56[_0x3b3b05(0x20c)][_0x3b3b05(0x1dc)](_0x21dfdd[_0x3b3b05(0x164)][_0x3b3b05(0x1eb)],_0x21dfdd[_0x3b3b05(0x164)]['id']),_0x10de56[_0x3b3b05(0x218)][_0x3b3b05(0x162)]+=_0x21dfdd[_0x3b3b05(0x218)][_0x3b3b05(0x162)],_0x10de56['activations'][_0x3b3b05(0x1e6)]+=_0x21dfdd[_0x3b3b05(0x218)][_0x3b3b05(0x1e6)],_0x10de56[_0x3b3b05(0x218)][_0x3b3b05(0x1a7)]+=_0x21dfdd[_0x3b3b05(0x218)][_0x3b3b05(0x1a7)];}return _0x10de56;}async function syncActivationsForSegment(_0x51e575,_0x3c5fcc,_0x33bc63,_0x5702d3,_0x2110ed,_0x2d77d3,_0x20e595){const _0x4ceb60=a97_0x560ff4,_0x4881e2={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x26f601 of _0x2110ed){try{if(_0x26f601[_0x4ceb60(0x1f7)]===_0x4ceb60(0x220)&&_0x26f601[_0x4ceb60(0x231)])_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':'activation_creating','segmentName':_0x5702d3,'activationName':_0x26f601['name']}),await _0x2d77d3['withProgress']('Creating\x20activation\x20\x27'+_0x26f601[_0x4ceb60(0x1eb)]+_0x4ceb60(0x224),()=>_0x51e575[_0x4ceb60(0x22f)]['createActivation'](_0x3c5fcc,_0x33bc63,_0x26f601['validatedRequest'])),_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':_0x4ceb60(0x19f),'segmentName':_0x5702d3,'activationName':_0x26f601['name']}),_0x2d77d3[_0x4ceb60(0x1c6)]?.('Created\x20activation\x20\x27'+_0x26f601[_0x4ceb60(0x1eb)]+'\x27'),_0x4881e2[_0x4ceb60(0x162)]++;else{if(_0x26f601[_0x4ceb60(0x1f7)]===_0x4ceb60(0x1be)&&_0x26f601[_0x4ceb60(0x231)]&&_0x26f601['existingActivation'])_0x2d77d3['onProgress']?.({'type':_0x4ceb60(0x202),'segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),await _0x2d77d3[_0x4ceb60(0x18f)](_0x4ceb60(0x232)+_0x26f601['name']+_0x4ceb60(0x224),()=>_0x51e575['segment'][_0x4ceb60(0x1c2)](_0x3c5fcc,_0x33bc63,_0x26f601[_0x4ceb60(0x15b)]['id'],_0x26f601[_0x4ceb60(0x231)])),_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':'activation_updated','segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),_0x2d77d3['logSuccess']?.(_0x4ceb60(0x1ca)+_0x26f601['name']+'\x27'),_0x4881e2[_0x4ceb60(0x1e6)]++;else _0x26f601[_0x4ceb60(0x1f7)]===_0x4ceb60(0x1ba)&&_0x26f601[_0x4ceb60(0x15b)]&&(_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':_0x4ceb60(0x21a),'segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),await _0x2d77d3['withProgress'](_0x4ceb60(0x186)+_0x26f601[_0x4ceb60(0x1eb)]+_0x4ceb60(0x224),()=>_0x51e575[_0x4ceb60(0x22f)][_0x4ceb60(0x21d)](_0x3c5fcc,_0x33bc63,_0x26f601[_0x4ceb60(0x15b)]['id'])),_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':_0x4ceb60(0x151),'segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),_0x2d77d3['logDeleted']?.(_0x4ceb60(0x197)+_0x26f601['name']+'\x27'),_0x4881e2['deleted']++);}}catch(_0x3b8caf){const _0x3ec439=isHttp400Error(_0x3b8caf),_0x15819c=_0x3ec439?ErrorCode[_0x4ceb60(0x16f)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x531b41=getErrorMessage(_0x3b8caf);throw new SDKError(_0x15819c,_0x4ceb60(0x230)+_0x26f601['type']+_0x4ceb60(0x20d)+_0x26f601[_0x4ceb60(0x1eb)]+_0x4ceb60(0x16d)+_0x20e595+'\x0a\x20\x20'+_0x531b41,_0x3b8caf);}}return _0x4881e2;}export async function executePushFolders(_0x115a22,_0x19ebd2,_0xa28377,_0x1422c9,_0x5ccafb){const _0x3eb588=a97_0x560ff4,_0x3abd6f=new Map(_0xa28377);for(const _0x403b8f of _0x19ebd2){const _0x581f9a=_0x403b8f['split']('/'),_0x2714e2=_0x581f9a[_0x581f9a[_0x3eb588(0x1fc)]-0x1],_0x38f44b=_0x581f9a['slice'](0x0,-0x1)[_0x3eb588(0x239)]('/'),_0x4ec414=_0x3abd6f['get'](_0x38f44b);_0x5ccafb['onProgress']?.({'type':_0x3eb588(0x153),'folder':_0x403b8f});const _0x393e93={'name':_0x2714e2,'parentFolderId':_0x4ec414},_0x58cd15=await _0x5ccafb[_0x3eb588(0x18f)](_0x3eb588(0x169)+_0x403b8f+_0x3eb588(0x224),()=>_0x115a22[_0x3eb588(0x22f)][_0x3eb588(0x1e2)](_0x1422c9[_0x3eb588(0x226)],_0x393e93));_0x3abd6f[_0x3eb588(0x1dc)](_0x403b8f,_0x58cd15[_0x3eb588(0x154)]['id']),_0x5ccafb[_0x3eb588(0x15c)]?.({'type':'folder_created','folder':_0x403b8f,'folderId':_0x58cd15[_0x3eb588(0x154)]['id']}),_0x5ccafb[_0x3eb588(0x1bf)]?.(_0x3eb588(0x1d4)+_0x403b8f+'\x27');}return _0x3abd6f;}export async function executePushSegmentDeletions(_0x18ca53,_0x510fef,_0x1fe888){const _0x40c683=a97_0x560ff4;if(_0x510fef[_0x40c683(0x1fc)]===0x0)return 0x0;const {batchAsync:_0x4b0483}=await import(_0x40c683(0x1d7)),_0x144e23=0x5,_0x140298=await _0x4b0483(_0x510fef,async _0x56686c=>{const _0x2e0ca5=_0x40c683;return _0x1fe888[_0x2e0ca5(0x15c)]?.({'type':_0x2e0ca5(0x17d),'name':_0x56686c[_0x2e0ca5(0x1eb)]}),await _0x18ca53['segment'][_0x2e0ca5(0x1c9)](_0x56686c['id']),_0x1fe888['onProgress']?.({'type':_0x2e0ca5(0x19c),'name':_0x56686c[_0x2e0ca5(0x1eb)]}),_0x1fe888[_0x2e0ca5(0x191)]?.(_0x2e0ca5(0x165)+_0x56686c[_0x2e0ca5(0x1eb)]+'\x27'),0x1;},_0x144e23);return _0x140298[_0x40c683(0x175)]((_0xd1422b,_0x139f26)=>_0xd1422b+_0x139f26,0x0);}function a97_0x5250(){const _0x11ed1e=['__pending_act_','map','schedule','journeyActivationStepId','JOURNEY_UPDATE_ERROR','INTERNAL','\x27\x20milestone','parentFolder','parseDocument','delete','embedded_segment_creating','attributes','state','update','logInfo','resolveSegment','segment_updated','updateActivation','deps','digest','10128168eeGHIj','logSuccess','list','yamlActivation','deleteSegment','Updated\x20activation\x20\x27','SEGMENT_UPDATE_ERROR','dirname','\x20(referenced\x20in\x20journey\x20','\x0a\x20\x20','Creating\x20segment\x20\x27','stages','listActivations','updateSegmentById','activationContext','Created\x20folder\x20\x27','listSegments','getSegment','../../utils/async.js','journeys','journeyBundlesByFolderAndName','\x27\x20decision\x20point\x20branch\x20\x27','verbose','set','folderId','4yiUkaJ','steps','get',').\x20','createFolder','push','results','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','updated','skipSegments','journey_updated','Activation\x20not\x20found:\x20','null','name','journey_entry_criteria_','entryCriteria','sort','idToEmailMap','entries','rule','relative','274768biWlOp','Fetching\x20','journeyStages','toLowerCase','type','\x20error(s)','embedded_activation_creating','connectionIdToNameMap','Created\x20segment\x20\x27','length','createJourneySegment','parentSegmentFolder','nameToId','journey_created','trim','activation_updating','hasChanges','resolveJourneyId','./child-segment-yaml.js','branches','filter','createSegment','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Created\x20journey\x20\x27','isNew','createdSegmentIds','\x20activation\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','1630272jIsyQV','draft','effectiveFolderId','40577823bFJoxo','connector_config','user','folder','valid','goal\x20criteria','activations','has','activation_deleting','notification','8028230SyKSuP','deleteActivation','20RURVYL','progress','create','flatMap','activation_template_id','slice','\x27...','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','parentId','message','item','max','journey','ACTIVATION_UPDATE_ERROR','NOT_FOUND','):\x20','entry_criteria','segment','Failed\x20to\x20','validatedRequest','Updating\x20activation\x20\x27','createActivation','segment_created','activationActions','utf-8','hex','versionNumber','join','activation_deleted','startsWith','folder_creating','data','./journey-yaml.js','absolutePath','segmentNameToId','folderPathToId','fetchJourney','description','existingActivation','onProgress','\x27\x20entry\x20criteria','journeyId','existingSegments','all','SEGMENT_NOT_FOUND','created','split','createdSegmentId','Deleted\x20segment\x20\x27','relationships','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','columns','Creating\x20folder\x20\x27','with','journeyBundleName','existingSegment','\x27\x20from\x20file:\x20','find','ACTIVATION_SYNTAX_ERROR','\x20journey\x20from\x20file:\x20','stringify','getJourney','embeddedSegmentNameToId','all_columns','reduce','exitCriterias','journeyById','from','buildUserMaps','nameToType','segmentId','action','segment_deleting','diff','Activation','decision_point','behavior','entry','Stage\x20\x27','activationParams','segmentFolderId','Deleting\x20activation\x20\x27','stage\x20\x27','add','existingJourney','goal','unchanged','2108568ozSwgV','embedded_segment_created','errors','withProgress','index','logDeleted','milestone','embedded_activation_created','folderPath','segment_updating','DecisionPoint','Deleted\x20activation\x20\x27','Name\x20has\x20already\x20been\x20taken','replace','sha1','kind','segment_deleted','toString','journeyActivationNameToId','activation_created','logWarning','parse','Entry\x20criteria:\x20','object','Segment\x20not\x20found:\x20','yamlConfig','segments','deleted','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','size','JOURNEY_SYNTAX_ERROR','rootFolderId','3650298XtagTw','journey_updating','connection','includes','Updated\x20journey\x20\x27'];a97_0x5250=function(){return _0x11ed1e;};return a97_0x5250();}export async function executePushJourneys(_0x770291,_0x4b9ab2,_0x1b3e27,_0x2e71ed,_0xb432f7){const _0x31591b=a97_0x560ff4,{journeyDefToRequest:_0x45655c}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0xe58d4a,yamlRuleToApi:_0x4e19c8,validateSegmentRule:_0x20bba6}=await import('./child-segment-yaml.js'),_0x34d8fd={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3618de=new Map(_0x1b3e27[_0x31591b(0x157)]),_0x21ef5a=0x5;for(let _0x3da41a=0x0;_0x3da41a<_0x4b9ab2['length'];_0x3da41a+=_0x21ef5a){const _0x346734=_0x4b9ab2[_0x31591b(0x223)](_0x3da41a,_0x3da41a+_0x21ef5a),_0x10a8e0=await Promise[_0x31591b(0x160)](_0x346734[_0x31591b(0x1b2)](async _0x4bc995=>{const _0x2ffbb9=_0x31591b;if(!_0x4bc995[_0x2ffbb9(0x20b)]&&!_0x4bc995[_0x2ffbb9(0x203)])return{'action':_0x2ffbb9(0x18b),'name':_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)],'journeyId':_0x4bc995[_0x2ffbb9(0x189)]?.['id']};const _0x231a3a=_0x4bc995[_0x2ffbb9(0x194)]?_0x1b3e27[_0x2ffbb9(0x158)][_0x2ffbb9(0x1e0)](_0x4bc995['folderPath']):undefined;_0xb432f7[_0x2ffbb9(0x15c)]?.({'type':_0x4bc995[_0x2ffbb9(0x20b)]?'journey_creating':_0x2ffbb9(0x1ad),'name':_0x4bc995[_0x2ffbb9(0x1a5)]['name']});try{const _0x1851b9=await executeSingleJourneyPush(_0x770291,_0x4bc995,{..._0x1b3e27,'segmentNameToId':_0x3618de},{'parentId':_0x2e71ed[_0x2ffbb9(0x226)],'rootFolderId':_0x2e71ed[_0x2ffbb9(0x1ab)],'folderId':_0x231a3a,'verbose':_0x2e71ed[_0x2ffbb9(0x1db)]},_0xb432f7,{'journeyDefToRequest':_0x45655c,'activationDefToCreateRequest':_0xe58d4a,'yamlRuleToApi':_0x4e19c8,'validateSegmentRule':_0x20bba6});for(const [_0x37b6de,_0xe5bf1b]of _0x1851b9[_0x2ffbb9(0x173)]){_0x3618de[_0x2ffbb9(0x1dc)](_0x37b6de,_0xe5bf1b),_0x34d8fd[_0x2ffbb9(0x173)][_0x2ffbb9(0x1dc)](_0x37b6de,_0xe5bf1b);}if(_0x1851b9['action']===_0x2ffbb9(0x162))_0xb432f7[_0x2ffbb9(0x15c)]?.({'type':_0x2ffbb9(0x200),'name':_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)],'journeyId':_0x1851b9[_0x2ffbb9(0x15e)]}),_0xb432f7[_0x2ffbb9(0x1c6)]?.(_0x2ffbb9(0x20a)+_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)]+'\x27'),_0x34d8fd[_0x2ffbb9(0x162)]++;else _0x1851b9[_0x2ffbb9(0x17c)]===_0x2ffbb9(0x1e6)&&(_0xb432f7[_0x2ffbb9(0x15c)]?.({'type':_0x2ffbb9(0x1e8),'name':_0x4bc995[_0x2ffbb9(0x1a5)]['name']}),_0xb432f7[_0x2ffbb9(0x1c6)]?.(_0x2ffbb9(0x1b0)+_0x4bc995[_0x2ffbb9(0x1a5)]['name']+'\x27'),_0x34d8fd[_0x2ffbb9(0x1e6)]++);return{'action':_0x1851b9[_0x2ffbb9(0x17c)],'name':_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)],'journeyId':_0x1851b9[_0x2ffbb9(0x15e)]};}catch(_0x1d2410){const _0xcdafa=isHttp400Error(_0x1d2410),_0x3d31f7=_0xcdafa?ErrorCode[_0x2ffbb9(0x1aa)]:ErrorCode[_0x2ffbb9(0x1b5)],_0x4826f8=getErrorMessage(_0x1d2410);throw new SDKError(_0x3d31f7,_0x2ffbb9(0x230)+(_0x4bc995[_0x2ffbb9(0x20b)]?'create':_0x2ffbb9(0x1be))+_0x2ffbb9(0x170)+_0x4bc995['absolutePath']+'\x0a\x20\x20'+_0x4826f8,_0x1d2410);}}));_0x34d8fd[_0x31591b(0x1e4)][_0x31591b(0x1e3)](..._0x10a8e0);}return _0x34d8fd;}async function executeSingleJourneyPush(_0x36392d,_0x1e9664,_0x25c162,_0x4aa9d6,_0x395183,_0x303aa3){const _0x1cab7f=a97_0x560ff4,{journeyDefToRequest:_0x1687c2,activationDefToCreateRequest:_0x3d3318,yamlRuleToApi:_0x44cd90,validateSegmentRule:_0x5bd22b}=_0x303aa3,_0x282f74=new Map(),_0x265d28=new Map(),_0x203e3f=new Map(),_0x174888=new Map(),_0x130828=new Map();let _0x28e735;const _0x4a2786=async()=>{const _0x4d56af=a97_0x1212;if(_0x28e735)return;_0x28e735=new Map();if(!_0x1e9664['existingJourney'])return;const _0x2c7b31=await _0x36392d[_0x4d56af(0x22a)][_0x4d56af(0x1d1)](_0x1e9664[_0x4d56af(0x189)]['id']);for(const _0x53a1c7 of _0x2c7b31){const _0x4c1548=journeyActivationStepToYaml(_0x53a1c7,_0x25c162[_0x4d56af(0x1ef)],_0x25c162['connectionIdToNameMap']),_0x3013dd=activationSignature(_0x4c1548);!_0x28e735['has'](_0x3013dd)&&_0x28e735[_0x4d56af(0x1dc)](_0x3013dd,_0x53a1c7['id']),_0x4c1548[_0x4d56af(0x1eb)]&&_0x265d28[_0x4d56af(0x1dc)](_0x4c1548[_0x4d56af(0x1eb)],_0x53a1c7['id']);}};if(_0x1e9664['existingJourney']&&_0x1e9664['yamlConfig']['segments']){const _0x2a49e0=buildLocalExpandedRuleMappings(_0x1e9664['yamlConfig']),_0xe583ce=_0x2a49e0['localSegmentRules'];if(_0xe583ce[_0x1cab7f(0x1a9)]>0x0){const _0x511129=new Map();for(const [_0x26253d,_0x28924d]of _0xe583ce){const _0x125971=serializeExpandedRule(_0x28924d,_0xe583ce);_0x511129[_0x1cab7f(0x1dc)](_0x26253d,_0x125971);}const _0x468e4b=collectSegmentIdsFromJourneyApi(_0x1e9664[_0x1cab7f(0x189)]);if(_0x468e4b[_0x1cab7f(0x1a9)]>0x0){const _0x36482f=await buildServerSegmentRuleMap(_0x36392d,_0x4aa9d6[_0x1cab7f(0x226)],_0x25c162[_0x1cab7f(0x15f)],_0x468e4b);if(_0x36482f[_0x1cab7f(0x1a9)]>0x0){const _0x1a34d1=new Map();for(const [_0x3640b1,_0x3ff790]of _0x36482f){const _0x2cfc09=serializeExpandedRule(_0x3ff790,_0x36482f);!_0x1a34d1[_0x1cab7f(0x219)](_0x2cfc09)&&_0x1a34d1['set'](_0x2cfc09,_0x3640b1);}for(const [_0x24ac7a,_0x825b3f]of _0x511129){const _0x1eb817=_0x1a34d1[_0x1cab7f(0x1e0)](_0x825b3f);_0x1eb817&&(_0x130828[_0x1cab7f(0x1dc)](_0x24ac7a,_0x1eb817),_0x25c162[_0x1cab7f(0x157)][_0x1cab7f(0x1dc)](_0x24ac7a,_0x1eb817));}}}}}const _0x19edf3={'resolveSegmentId':async _0x277cd9=>{const _0x47110a=_0x1cab7f,_0x2a6a87=_0x25c162[_0x47110a(0x157)][_0x47110a(0x1e0)](_0x277cd9);if(!_0x2a6a87)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x277cd9+_0x47110a(0x1cd)+_0x1e9664[_0x47110a(0x1a5)][_0x47110a(0x1eb)]+')');return _0x2a6a87;},'resolveEmbeddedSegmentId':async(_0x5ab852,_0x5ef114)=>{const _0x5497b8=_0x1cab7f,_0x103e8d=_0x25c162[_0x5497b8(0x157)][_0x5497b8(0x1e0)](_0x5ab852);if(_0x103e8d)return _0x103e8d;const _0x2648f0=_0x130828['get'](_0x5ab852);if(_0x2648f0)return _0x25c162[_0x5497b8(0x157)][_0x5497b8(0x1dc)](_0x5ab852,_0x2648f0),_0x2648f0;const _0x31852f=_0x25c162[_0x5497b8(0x15f)][_0x5497b8(0x16e)](_0x1b3056=>_0x1b3056[_0x5497b8(0x1eb)]===_0x5ab852);if(_0x31852f)return _0x25c162['segmentNameToId']['set'](_0x5ab852,_0x31852f['id']),_0x31852f['id'];if(_0x1e9664['isNew']){const {stageName:_0x5ee4a4,criteriaName:_0x12f1ff}=findSegmentCriteriaLocation(_0x1e9664['yamlConfig'],_0x5ab852);return _0x5bd22b(_0x5ab852,_0x5ef114[_0x5497b8(0x1f1)]),_0x203e3f[_0x5497b8(0x1dc)](_0x5ab852,{'definition':_0x5ef114,'stageName':_0x5ee4a4,'criteriaName':_0x12f1ff}),createPendingSegmentId(_0x5ab852);}const _0x45dc07=_0x1e9664[_0x5497b8(0x189)]?.['id'];if(!_0x45dc07)throw new SDKError(ErrorCode[_0x5497b8(0x1b6)],_0x5497b8(0x20e));_0x5bd22b(_0x5ab852,_0x5ef114['rule']);const _0x991e2c=generateDeterministicJourneySegmentName(_0x1e9664['yamlConfig'][_0x5497b8(0x1eb)],_0x5ab852),_0x2de7a8=_0x25c162[_0x5497b8(0x15f)][_0x5497b8(0x16e)](_0x2cb58f=>_0x2cb58f['name']===_0x991e2c),_0x4e1e27=createSegmentIdResolver(_0x25c162['segmentNameToId'],_0x5ab852),_0x1567a5=await resolveRuleSegmentIds(_0x5ef114[_0x5497b8(0x1f1)],_0x4e1e27);let _0x528a08;if(_0x2de7a8)await _0x36392d['segment'][_0x5497b8(0x1d2)](_0x4aa9d6[_0x5497b8(0x226)],_0x2de7a8['id'],{'description':_0x5ef114[_0x5497b8(0x15a)]||_0x5497b8(0x1a2)+_0x5ab852,'rule':_0x44cd90(_0x1567a5,!![]),'countPopulation':!![]}),_0x528a08=_0x2de7a8['id'];else try{_0x528a08=await _0x36392d['segment']['createJourneySegment']({'name':_0x991e2c,'description':_0x5ef114['description']||_0x5497b8(0x1a2)+_0x5ab852,'journeyId':_0x45dc07,'rule':_0x44cd90(_0x1567a5,!![]),'countPopulation':!![],'parentFolderId':_0x4aa9d6['rootFolderId']||'','audienceId':_0x4aa9d6['parentId']});}catch(_0x37f989){const _0x11599a=_0x37f989 instanceof Error&&_0x37f989[_0x5497b8(0x227)][_0x5497b8(0x1af)](_0x5497b8(0x198));if(_0x11599a){const _0x51da76=await _0x36392d[_0x5497b8(0x22f)][_0x5497b8(0x1d5)](_0x4aa9d6[_0x5497b8(0x226)]),_0x41a757=_0x51da76['find'](_0x225713=>_0x225713[_0x5497b8(0x1eb)]===_0x991e2c);if(_0x41a757)await _0x36392d[_0x5497b8(0x22f)][_0x5497b8(0x1d2)](_0x4aa9d6[_0x5497b8(0x226)],_0x41a757['id'],{'description':_0x5ef114[_0x5497b8(0x15a)]||_0x5497b8(0x1a2)+_0x5ab852,'rule':_0x44cd90(_0x1567a5,!![]),'countPopulation':!![]}),_0x528a08=_0x41a757['id'];else throw _0x37f989;}else throw _0x37f989;}return _0x25c162[_0x5497b8(0x157)][_0x5497b8(0x1dc)](_0x5ab852,_0x528a08),_0x282f74[_0x5497b8(0x1dc)](_0x5ab852,_0x528a08),_0x528a08;},'resolveActivationId':async _0x3a13a5=>{const _0x316208=_0x1cab7f,_0x33b65a=_0x265d28[_0x316208(0x1e0)](_0x3a13a5);if(_0x33b65a)return _0x33b65a;if(_0x1e9664[_0x316208(0x189)]){await _0x4a2786();const _0x13c1ea=_0x265d28['get'](_0x3a13a5);if(_0x13c1ea)return _0x13c1ea;}throw new SDKError(ErrorCode[_0x316208(0x22c)],_0x316208(0x1e9)+_0x3a13a5+_0x316208(0x1cd)+_0x1e9664[_0x316208(0x1a5)][_0x316208(0x1eb)]+_0x316208(0x1e1)+_0x316208(0x209));},'resolveEmbeddedActivationId':async(_0x1622e1,_0x25ee78)=>{const _0xf03413=_0x1cab7f,_0x3849a7=_0x265d28['get'](_0x1622e1);if(_0x3849a7)return _0x3849a7;if(_0x1e9664[_0xf03413(0x20b)])return _0x174888['set'](_0x1622e1,_0x25ee78),createPendingActivationId(_0x1622e1);if(_0x1e9664[_0xf03413(0x189)]){await _0x4a2786();const _0x109463=_0x265d28['get'](_0x25ee78[_0xf03413(0x1eb)]);if(_0x109463)return _0x265d28['set'](_0x1622e1,_0x109463),_0x109463;const _0x47c28d=activationSignature(_0x25ee78),_0x3db397=_0x28e735?.[_0xf03413(0x1e0)](_0x47c28d);if(_0x3db397)return _0x265d28[_0xf03413(0x1dc)](_0x1622e1,_0x3db397),_0x3db397;const _0x306e77=await _0x3d3318(_0x25ee78,_0x25c162[_0xf03413(0x1d3)]),_0x5ee6b2=await _0x36392d[_0xf03413(0x22a)][_0xf03413(0x233)](_0x1e9664[_0xf03413(0x189)]['id'],_0x306e77);return _0x265d28[_0xf03413(0x1dc)](_0x1622e1,_0x5ee6b2['id']),_0x5ee6b2['id'];}throw new SDKError(ErrorCode[_0xf03413(0x1b6)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x1e3528=>{const _0x49e997=_0x1cab7f;try{return await _0x36392d[_0x49e997(0x22a)][_0x49e997(0x204)](_0x4aa9d6['parentId'],_0x1e3528);}catch(_0x3a9f44){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x1e3528+_0x49e997(0x167)+_0x1e9664[_0x49e997(0x1a5)][_0x49e997(0x1eb)]+'\x27)',_0x3a9f44);}},'resolveStageId':async(_0x1902e9,_0x332bc6)=>{const _0x2d74bb=_0x1cab7f,_0x15e5d3=await _0x36392d[_0x2d74bb(0x22a)][_0x2d74bb(0x172)](_0x1902e9),_0x52fec0=_0x15e5d3[_0x2d74bb(0x1bc)]['journeyStages'][_0x2d74bb(0x16e)](_0x51f126=>_0x51f126[_0x2d74bb(0x1eb)][_0x2d74bb(0x1f6)]()===_0x332bc6['toLowerCase']());if(!_0x52fec0?.['id'])throw new SDKError(ErrorCode[_0x2d74bb(0x22c)],_0x2d74bb(0x183)+_0x332bc6+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x15e5d3[_0x2d74bb(0x1bc)][_0x2d74bb(0x16b)]||_0x15e5d3['attributes'][_0x2d74bb(0x1eb)])+'\x27');return _0x52fec0['id'];}},_0x220184=await _0x1687c2(_0x1e9664['yamlConfig'],_0x4aa9d6[_0x1cab7f(0x226)],_0x19edf3),_0xdd3374=_0x4aa9d6[_0x1cab7f(0x1dd)]||_0x4aa9d6['rootFolderId'];_0xdd3374&&(_0x220184['relationships']={'parentFolder':{'data':{'id':_0xdd3374,'type':_0x1cab7f(0x215)}}});if(_0x1e9664[_0x1cab7f(0x20b)]){if(_0x203e3f[_0x1cab7f(0x1a9)]>0x0||_0x174888['size']>0x0)return await executeThreeStepJourneyCreate(_0x36392d,_0x1e9664,_0x220184,{'pendingEmbeddedSegments':_0x203e3f,'pendingEmbeddedActivations':_0x174888,'embeddedSegmentNameToId':_0x282f74,'journeyActivationNameToId':_0x265d28},{..._0x4aa9d6,'effectiveFolderId':_0xdd3374},_0x25c162,_0x395183,_0x303aa3);else{ensureJourneyDefaults(_0x220184['attributes']);const _0xf86542=await _0x36392d[_0x1cab7f(0x22a)][_0x1cab7f(0x220)](_0x220184);return{'action':_0x1cab7f(0x162),'journeyId':_0xf86542['id'],'embeddedSegmentNameToId':_0x282f74};}}else{if(_0x1e9664['hasChanges']&&_0x1e9664['existingJourney'])return ensureJourneyDefaults(_0x220184[_0x1cab7f(0x1bc)]),await _0x36392d[_0x1cab7f(0x22a)][_0x1cab7f(0x1be)](_0x1e9664[_0x1cab7f(0x189)]['id'],_0x220184),{'action':_0x1cab7f(0x1e6),'journeyId':_0x1e9664[_0x1cab7f(0x189)]['id'],'embeddedSegmentNameToId':_0x282f74};}return{'action':'unchanged','journeyId':_0x1e9664[_0x1cab7f(0x189)]?.['id'],'embeddedSegmentNameToId':_0x282f74};}function findSegmentCriteriaLocation(_0x56c2d5,_0x14b79c){const _0x3b835e=a97_0x560ff4,_0x19fb97=_0x56c2d5[_0x3b835e(0x1d0)]||_0x56c2d5['journeys']?.[0x0]?.[_0x3b835e(0x1d0)]||[];let _0x3f9f62=_0x3b835e(0x182),_0x48ae3c=_0x14b79c;const _0x689841=_0x56c2d5[_0x3b835e(0x18a)]||_0x56c2d5[_0x3b835e(0x1d8)]?.[0x0]?.[_0x3b835e(0x18a)];if(_0x689841?.[_0x3b835e(0x22f)]===_0x14b79c)return{'stageName':_0x3b835e(0x18a),'criteriaName':_0x689841[_0x3b835e(0x1eb)]||_0x14b79c};_0x5d1069:for(const _0x572c33 of _0x19fb97){if(_0x572c33[_0x3b835e(0x22e)]?.[_0x3b835e(0x22f)]===_0x14b79c){_0x3f9f62=_0x572c33['name'],_0x48ae3c=_0x572c33[_0x3b835e(0x22e)][_0x3b835e(0x1eb)]||_0x14b79c;break;}if(_0x572c33[_0x3b835e(0x1df)])for(const _0x26c129 of _0x572c33[_0x3b835e(0x1df)]){if(_0x26c129['type']===_0x3b835e(0x180)&&_0x26c129[_0x3b835e(0x16a)]?.['branches'])for(const _0x10ce99 of _0x26c129['with'][_0x3b835e(0x206)]){if(_0x10ce99[_0x3b835e(0x22f)]===_0x14b79c){_0x3f9f62=_0x572c33[_0x3b835e(0x1eb)],_0x48ae3c=_0x10ce99[_0x3b835e(0x1eb)]||_0x14b79c;break _0x5d1069;}}}}return{'stageName':_0x3f9f62,'criteriaName':_0x48ae3c};}function a97_0x1212(_0x505e1f,_0x57162b){_0x505e1f=_0x505e1f-0x151;const _0x52501d=a97_0x5250();let _0x1212d3=_0x52501d[_0x505e1f];return _0x1212d3;}async function executeThreeStepJourneyCreate(_0x28708a,_0xba003e,_0x128636,_0x377d97,_0x2168a7,_0x391ca3,_0x204db2,_0x2fc421){const _0x417c11=a97_0x560ff4,{activationDefToCreateRequest:_0x4a4112,yamlRuleToApi:_0x1b7c0c}=_0x2fc421,{pendingEmbeddedSegments:_0x25aed9,pendingEmbeddedActivations:_0x43f4cc,embeddedSegmentNameToId:_0x31c5f7}=_0x377d97,_0x3bd6e2=JSON['parse'](JSON[_0x417c11(0x171)](_0x128636));ensureJourneyDefaults(_0x3bd6e2[_0x417c11(0x1bc)]),stripPendingIds(_0x3bd6e2);const _0x3067a2=await _0x28708a[_0x417c11(0x22a)]['create'](_0x3bd6e2),_0x370e50=_0x3067a2['id'],_0x3e629a=new Map();for(const _0x159442 of _0x3067a2[_0x417c11(0x1bc)][_0x417c11(0x1f5)]){_0x3e629a[_0x417c11(0x1dc)](_0x159442['name']['toLowerCase'](),_0x159442['id']);}for(const [_0x40e58c,{definition:_0x5545f8}]of _0x25aed9){const _0x19cd6f=generateDeterministicJourneySegmentName(_0xba003e[_0x417c11(0x1a5)][_0x417c11(0x1eb)],_0x40e58c);_0x204db2[_0x417c11(0x15c)]?.({'type':_0x417c11(0x1bb),'journeyName':_0xba003e[_0x417c11(0x1a5)]['name'],'segmentName':_0x40e58c});const _0x2cd6d3=createSegmentIdResolver(_0x391ca3[_0x417c11(0x157)],_0x40e58c),_0x3a2c18=await resolveRuleSegmentIds(_0x5545f8[_0x417c11(0x1f1)],_0x2cd6d3),_0x43d8d4=await _0x28708a[_0x417c11(0x22f)][_0x417c11(0x1fd)]({'name':_0x19cd6f,'description':_0x5545f8[_0x417c11(0x15a)]||_0x417c11(0x1a2)+_0x40e58c,'journeyId':_0x370e50,'rule':_0x1b7c0c(_0x3a2c18,!![]),'countPopulation':!![],'parentFolderId':_0x2168a7[_0x417c11(0x211)]||'','audienceId':_0x2168a7[_0x417c11(0x226)]});_0x31c5f7[_0x417c11(0x1dc)](_0x40e58c,_0x43d8d4),_0x391ca3[_0x417c11(0x157)][_0x417c11(0x1dc)](_0x40e58c,_0x43d8d4),_0x204db2['onProgress']?.({'type':_0x417c11(0x18d),'journeyName':_0xba003e[_0x417c11(0x1a5)][_0x417c11(0x1eb)],'segmentName':_0x40e58c});}const _0x516755=new Map();for(const [_0x1dca31,_0x3b965b]of _0x43f4cc){_0x204db2[_0x417c11(0x15c)]?.({'type':_0x417c11(0x1f9),'journeyName':_0xba003e['yamlConfig'][_0x417c11(0x1eb)],'activationName':_0x1dca31});const _0x44a853=await _0x4a4112(_0x3b965b,_0x391ca3[_0x417c11(0x1d3)]),_0x4a0bd1=await _0x28708a['journey'][_0x417c11(0x233)](_0x370e50,_0x44a853);_0x516755[_0x417c11(0x1dc)](_0x1dca31,_0x4a0bd1['id']),_0x377d97[_0x417c11(0x19e)][_0x417c11(0x1dc)](_0x1dca31,_0x4a0bd1['id']),_0x204db2[_0x417c11(0x15c)]?.({'type':_0x417c11(0x193),'journeyName':_0xba003e[_0x417c11(0x1a5)][_0x417c11(0x1eb)],'activationName':_0x1dca31});}const _0xf3c1ec=JSON[_0x417c11(0x1a1)](JSON[_0x417c11(0x171)](_0x128636));return _0xf3c1ec['id']=_0x370e50,ensureJourneyDefaults(_0xf3c1ec['attributes']),resolvePendingIdsInRequest(_0xf3c1ec,_0x128636,_0x3e629a,_0x31c5f7,_0x516755,_0x204db2),await _0x28708a[_0x417c11(0x22a)]['update'](_0x370e50,_0xf3c1ec),{'action':_0x417c11(0x162),'journeyId':_0x370e50,'embeddedSegmentNameToId':_0x31c5f7};}function stripPendingIds(_0x3411b7){const _0x45998e=a97_0x560ff4;for(const _0x2394d0 of _0x3411b7[_0x45998e(0x1bc)][_0x45998e(0x1f5)]||[]){_0x2394d0[_0x45998e(0x1ed)]?.['segmentId']&&isPendingSegmentId(_0x2394d0['entryCriteria'][_0x45998e(0x17b)])&&delete _0x2394d0[_0x45998e(0x1ed)];if(_0x2394d0[_0x45998e(0x1df)])for(const _0x2072ba of Object['keys'](_0x2394d0[_0x45998e(0x1df)])){const _0x32ddf3=_0x2394d0[_0x45998e(0x1df)][_0x2072ba];_0x32ddf3[_0x45998e(0x1f7)]===_0x45998e(0x17f)&&_0x32ddf3['journeyActivationStepId']&&isPendingActivationId(_0x32ddf3[_0x45998e(0x1b4)])&&(_0x32ddf3['journeyActivationStepId']='');if(_0x32ddf3[_0x45998e(0x1f7)]==='DecisionPoint'&&_0x32ddf3[_0x45998e(0x206)])for(const _0x1a9503 of _0x32ddf3[_0x45998e(0x206)]){_0x1a9503[_0x45998e(0x17b)]&&isPendingSegmentId(_0x1a9503[_0x45998e(0x17b)])&&(_0x1a9503[_0x45998e(0x17b)]='');}}}}function resolvePendingIdsInRequest(_0x3c7fea,_0x2c6a3d,_0x2b3144,_0x4a173e,_0xaaee22,_0x3602a1){const _0x294278=a97_0x560ff4,_0x1c2c5d=(_0x393f9a,_0x3e74a4)=>{const _0xb34eb5=a97_0x1212;if(!isPendingSegmentId(_0x393f9a))return _0x393f9a;const _0x67dd59=extractPendingSegmentName(_0x393f9a),_0x27fd37=_0x4a173e['get'](_0x67dd59);return!_0x27fd37&&_0x3602a1[_0xb34eb5(0x1a0)]?.(_0xb34eb5(0x225)+_0x67dd59+'\x27\x20for\x20'+_0x3e74a4),_0x27fd37;};if(_0x3c7fea[_0x294278(0x1bc)][_0x294278(0x18a)]?.[_0x294278(0x17b)]&&isPendingSegmentId(_0x3c7fea[_0x294278(0x1bc)][_0x294278(0x18a)][_0x294278(0x17b)])){const _0x50b436=_0x1c2c5d(_0x3c7fea[_0x294278(0x1bc)][_0x294278(0x18a)][_0x294278(0x17b)],_0x294278(0x217));_0x50b436&&(_0x3c7fea[_0x294278(0x1bc)]['goal'][_0x294278(0x17b)]=_0x50b436);}for(const _0x45a0b8 of _0x3c7fea[_0x294278(0x1bc)][_0x294278(0x1f5)]||[]){const _0x4c7410=_0x2b3144[_0x294278(0x1e0)](_0x45a0b8[_0x294278(0x1eb)][_0x294278(0x1f6)]());_0x4c7410&&(_0x45a0b8['id']=_0x4c7410);if(_0x45a0b8[_0x294278(0x1ed)]?.[_0x294278(0x17b)]&&isPendingSegmentId(_0x45a0b8[_0x294278(0x1ed)][_0x294278(0x17b)])){const _0x2fb77e=_0x1c2c5d(_0x45a0b8[_0x294278(0x1ed)][_0x294278(0x17b)],'stage\x20\x27'+_0x45a0b8[_0x294278(0x1eb)]+_0x294278(0x15d));_0x2fb77e&&(_0x45a0b8['entryCriteria']['segmentId']=_0x2fb77e);}if(_0x45a0b8[_0x294278(0x176)])for(const _0x83a810 of _0x45a0b8[_0x294278(0x176)]){if(_0x83a810[_0x294278(0x17b)]&&isPendingSegmentId(_0x83a810['segmentId'])){const _0x182900=_0x1c2c5d(_0x83a810[_0x294278(0x17b)],_0x294278(0x187)+_0x45a0b8['name']+'\x27\x20exit\x20criteria');_0x182900&&(_0x83a810[_0x294278(0x17b)]=_0x182900);}}if(_0x45a0b8[_0x294278(0x192)]?.[_0x294278(0x17b)]&&isPendingSegmentId(_0x45a0b8[_0x294278(0x192)][_0x294278(0x17b)])){const _0x503fc7=_0x1c2c5d(_0x45a0b8[_0x294278(0x192)]['segmentId'],_0x294278(0x187)+_0x45a0b8['name']+_0x294278(0x1b7));_0x503fc7&&(_0x45a0b8[_0x294278(0x192)][_0x294278(0x17b)]=_0x503fc7);}if(_0x45a0b8[_0x294278(0x1df)]){const _0x76bc31=_0x7796cd=>_0x2c6a3d['attributes'][_0x294278(0x1f5)][_0x294278(0x16e)](_0x1cb030=>_0x1cb030['name'][_0x294278(0x1f6)]()===_0x45a0b8[_0x294278(0x1eb)]['toLowerCase']())?.[_0x294278(0x1df)]?.[_0x7796cd];for(const _0x3c475d of Object['keys'](_0x45a0b8[_0x294278(0x1df)])){const _0x2f8f19=_0x45a0b8['steps'][_0x3c475d],_0x181723=_0x76bc31(_0x3c475d);if(_0x2f8f19['type']==='Activation'&&_0x2f8f19[_0x294278(0x1b4)]&&(isPendingActivationId(_0x2f8f19[_0x294278(0x1b4)])||_0x2f8f19[_0x294278(0x1b4)]==='')){if(_0x181723?.[_0x294278(0x1b4)]&&isPendingActivationId(_0x181723[_0x294278(0x1b4)])){const _0x14b97c=extractPendingActivationName(_0x181723[_0x294278(0x1b4)]),_0x36febe=_0xaaee22[_0x294278(0x1e0)](_0x14b97c);_0x36febe&&(_0x2f8f19['journeyActivationStepId']=_0x36febe);}}if(_0x2f8f19[_0x294278(0x1f7)]===_0x294278(0x196)&&_0x2f8f19['branches']&&_0x181723?.['branches'])for(let _0x58ba60=0x0;_0x58ba60<_0x2f8f19[_0x294278(0x206)]['length'];_0x58ba60++){const _0xed8109=_0x2f8f19[_0x294278(0x206)][_0x58ba60],_0x5019a0=_0x181723['branches'][_0x58ba60];if(_0x5019a0?.['segmentId']&&isPendingSegmentId(_0x5019a0[_0x294278(0x17b)])){const _0x48ffe6=_0x1c2c5d(_0x5019a0['segmentId'],_0x294278(0x187)+_0x45a0b8[_0x294278(0x1eb)]+_0x294278(0x1da)+(_0xed8109[_0x294278(0x1eb)]||_0x58ba60)+'\x27');_0x48ffe6&&(_0xed8109[_0x294278(0x17b)]=_0x48ffe6);}}}}}}
|
|
1
|
+
const a98_0x3362f0=a98_0x35c3;(function(_0x4f2c53,_0x1f03f8){const _0x1cf3e4=a98_0x35c3,_0x121968=_0x4f2c53();while(!![]){try{const _0x3d79e2=-parseInt(_0x1cf3e4(0x141))/0x1+parseInt(_0x1cf3e4(0x11c))/0x2+parseInt(_0x1cf3e4(0x190))/0x3+-parseInt(_0x1cf3e4(0x11b))/0x4*(parseInt(_0x1cf3e4(0x137))/0x5)+parseInt(_0x1cf3e4(0x19b))/0x6*(parseInt(_0x1cf3e4(0x170))/0x7)+parseInt(_0x1cf3e4(0x17c))/0x8+-parseInt(_0x1cf3e4(0x128))/0x9;if(_0x3d79e2===_0x1f03f8)break;else _0x121968['push'](_0x121968['shift']());}catch(_0x4f487a){_0x121968['push'](_0x121968['shift']());}}}(a98_0x110b,0xc3f7b));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a98_0x3362f0(0x101);export const PENDING_ACTIVATION_PREFIX=a98_0x3362f0(0x16d);export function createPendingSegmentId(_0x19c5c5){return''+PENDING_SEGMENT_PREFIX+_0x19c5c5+'__';}function a98_0x110b(){const _0x55d0ac=['activation_','steps','has','slice','set','deleteActivation','updateSegmentById','existingActivation','journeyBundlesByFolderAndName','onProgress','createActivation','Created\x20folder\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Segment\x20not\x20found:\x20','journey','push','isArray','../../utils/async.js','entry','folder_creating','resolveSegment','get','NOT_FOUND','buildUserMaps','Deleting\x20activation\x20\x27','embedded_segment_creating','relative','update','decision_point','folderId','segments','branches','journeyBundleName','activation_template_id','createJourneySegment','null','with','existingSegments','Failed\x20to\x20','journey_created','goal\x20criteria','JOURNEY_UPDATE_ERROR','resolveJourneyId','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','parse','logDeleted','sort','parentFolder','./child-segment-yaml.js','from','versionNumber','Updated\x20journey\x20\x27','verbose','segment_updating','activation_updated','rule','__pending_','activationActions','length','existingJourney','):\x20','toLowerCase','localSegmentRules','data','hasChanges','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','journeyStages','activations','segment_deleting','stages','updateActivation','attributes','schedule','Creating\x20segment\x20\x27','connector_config','journeyId','validatedRequest','segment','\x0a\x20\x20','./journey-yaml.js','getSegment','connection','12NymKHc','365308bultDS','getJourney','max','segment_creating','valid','SEGMENT_SYNTAX_ERROR','segment_created','deps','\x27\x20decision\x20point\x20branch\x20\x27','diff','size','Activation','3667698PxPuPT','deleteSegment','action','\x27\x20not\x20found\x20in\x20journey\x20\x27','effectiveFolderId','INTERNAL','\x20error(s)','activationContext','notification','\x27\x20from\x20file:\x20','index','nameToId','ACTIVATION_UPDATE_ERROR','segmentByFolderAndName','join','892385CTyCGN','segmentNameToId',').\x20','isNew','DecisionPoint','description','Deleted\x20segment\x20\x27','absolutePath','created','stringify','603327NISnaH','parentId','journeyActivationStepId','name','split','entryCriteria','segmentId','keys','\x27\x20exit\x20criteria','Name\x20has\x20already\x20been\x20taken','values','idToEmailMap','activationStepsById','filter','state','relationships','utf-8','embedded_segment_created','logSuccess','exitCriterias','Entry\x20criteria:\x20','JOURNEY_SYNTAX_ERROR','startsWith','progress','idToName','rootFolderId','activationParams','dirname','createdSegmentId','Journey\x20\x27','\x20(referenced\x20in\x20journey\x20','embeddedSegmentNameToId','folderPathToId','segment_deleted','segment_updated','Creating\x20activation\x20\x27','Creating\x20folder\x20\x27','withProgress','milestone','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','entry_criteria','Updating\x20activation\x20\x27','behavior','nameToType','__pending_act_','Fetching\x20','user','133kXTaly','draft','folderPath','logWarning','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','deleted','goal','logInfo','segmentFolderId','create','folder_created','Deleted\x20activation\x20\x27','2354368vBiRVz','trim','SEGMENT_UPDATE_ERROR','journeys','activation_deleted','item','reduce','connectionIdToNameMap','createFolder','hex','updated','Updated\x20segment\x20\x27','map','Updated\x20activation\x20\x27','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','SEGMENT_NOT_FOUND','all_columns','parseDocument','unchanged','find','4229799BejoEW','skipSegments','activation_deleting','Updating\x20segment\x20\x27','message','yamlConfig','add','Activation\x20not\x20found:\x20','listSegments','activation_created','listActivations','145920TaMvXJ','type','activationsBySegmentId','stage\x20\x27','existingSegment','\x27...','all','columns','yamlActivation','Created\x20activation\x20\x27','journeyById','delete','journeyActivationNameToId'];a98_0x110b=function(){return _0x55d0ac;};return a98_0x110b();}export function isPendingSegmentId(_0x3e52d4){const _0x3c1b09=a98_0x3362f0;return _0x3e52d4[_0x3c1b09(0x157)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x2f74dc){return _0x2f74dc['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x44b253){return''+PENDING_ACTIVATION_PREFIX+_0x44b253+'__';}export function isPendingActivationId(_0x50e1aa){return _0x50e1aa['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x110a47){return _0x110a47['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x16c2fc,_0x1fc2ea){const _0x9538df=a98_0x3362f0,_0x18ad97=_0x16c2fc+'::'+(_0x1fc2ea[_0x9538df(0x17d)]()||'segment'),_0x16ee05=createHash('sha1')[_0x9538df(0xe4)](_0x18ad97)['digest'](_0x9538df(0x185))[_0x9538df(0x1ab)](0x0,0xc);return'journey_entry_criteria_'+_0x16ee05;}export function ensureJourneyDefaults(_0x4db55e){const _0x42b469=a98_0x3362f0;!_0x4db55e[_0x42b469(0x13c)]&&(_0x4db55e[_0x42b469(0x13c)]=''),!_0x4db55e[_0x42b469(0x14f)]&&(_0x4db55e[_0x42b469(0x14f)]=_0x42b469(0x171));}export function resolveTDFolderPath(_0x5f9a92,_0x1f6b34,_0x105e63){const _0x4e3071=a98_0x3362f0;if(!_0x1f6b34)return _0x5f9a92;if(_0x5f9a92===_0x105e63||_0x5f9a92[_0x4e3071(0x157)](_0x105e63+'/'))return _0x5f9a92;return _0x5f9a92?_0x105e63+'/'+_0x5f9a92:_0x105e63;}export function addFoldersToCreate(_0x29eb34,_0x4785b,_0x435d55){const _0x11455a=a98_0x3362f0;if(!_0x29eb34)return;if(_0x4785b['has'](_0x29eb34))return;const _0x3ae211=_0x29eb34[_0x11455a(0x145)]('/');let _0x4c7e23='';for(const _0x338f4 of _0x3ae211){_0x4c7e23=_0x4c7e23?_0x4c7e23+'/'+_0x338f4:_0x338f4,!_0x4785b['has'](_0x4c7e23)&&_0x435d55[_0x11455a(0x196)](_0x4c7e23);}}import*as a98_0x4e042d from'yaml';import{readFileSync}from'fs';import a98_0x1d4204 from'path';import{isJourneyDef,parseYamlString as a98_0x561137,toYamlString as a98_0x4372ae,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';function a98_0x35c3(_0x285834,_0x302556){_0x285834=_0x285834-0xd3;const _0x110bf8=a98_0x110b();let _0x35c3e3=_0x110bf8[_0x285834];return _0x35c3e3;}import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x3a94f4){const _0x540ab1=a98_0x3362f0;if(Array[_0x540ab1(0xd9)](_0x3a94f4))return'['+_0x3a94f4['map'](_0x5c5fb8=>stableStringify(_0x5c5fb8))[_0x540ab1(0x136)](',')+']';if(_0x3a94f4&&typeof _0x3a94f4==='object'){const _0x3b0f8e=_0x3a94f4,_0x5348d4=Object[_0x540ab1(0x148)](_0x3b0f8e)[_0x540ab1(0xf7)](),_0x48e895=_0x5348d4['map'](_0x26f561=>'\x22'+_0x26f561+'\x22:'+stableStringify(_0x3b0f8e[_0x26f561]));return'{'+_0x48e895[_0x540ab1(0x136)](',')+'}';}const _0x347336=JSON['stringify'](_0x3a94f4);return _0x347336===undefined?_0x540ab1(0xec):_0x347336;}function activationSignature(_0x1f9c07){const _0x262b30=a98_0x3362f0,_0xc93ec7={'connection':_0x1f9c07['connection'],..._0x1f9c07[_0x262b30(0x18c)]!==undefined&&{'all_columns':_0x1f9c07[_0x262b30(0x18c)]},..._0x1f9c07[_0x262b30(0x1a2)]!==undefined&&{'columns':_0x1f9c07[_0x262b30(0x1a2)]},..._0x1f9c07['behavior']!==undefined&&{'behavior':_0x1f9c07[_0x262b30(0x16b)]},..._0x1f9c07[_0x262b30(0x111)]!==undefined&&{'schedule':_0x1f9c07['schedule']},..._0x1f9c07[_0x262b30(0x130)]!==undefined&&{'notification':_0x1f9c07[_0x262b30(0x130)]},..._0x1f9c07[_0x262b30(0x113)]!==undefined&&{'connector_config':_0x1f9c07[_0x262b30(0x113)]},..._0x1f9c07[_0x262b30(0xea)]!==undefined&&{'activation_template_id':_0x1f9c07[_0x262b30(0xea)]}};return stableStringify(_0xc93ec7);}export async function prepareSegmentFiles(_0x1a26e6,_0x5000a4,_0x326e10,_0x50bd7e,_0x195f89){const _0x5d2f21=a98_0x3362f0,{activationDefToCreateRequest:_0x33ca63}=await import('./child-segment-yaml.js'),_0x50e445=[],_0x30ea0d=new Set();for(const {yamlConfig:_0x11314f,folderPath:_0x5d2bae,sourcePath:_0x387d13}of _0x1a26e6){const _0x3e2f2d=resolveTDFolderPath(_0x5d2bae,_0x50bd7e,_0x195f89),_0x473789=_0x3e2f2d+':'+_0x11314f[_0x5d2f21(0x144)],_0x5b71f9=_0x5000a4[_0x5d2f21(0x135)]['get'](_0x473789),_0x3c04de=_0x5b71f9?_0x5000a4[_0x5d2f21(0x19d)]['get'](_0x5b71f9['id'])||[]:[];addFoldersToCreate(_0x3e2f2d,_0x5000a4[_0x5d2f21(0x161)],_0x30ea0d);const _0x373937=calculateActivationActions(_0x11314f[_0x5d2f21(0x10c)]||[],_0x3c04de,_0x5000a4[_0x5d2f21(0x14c)],_0x5000a4[_0x5d2f21(0x183)]);for(const _0x1b5943 of _0x373937){(_0x1b5943['type']==='create'||_0x1b5943[_0x5d2f21(0x19c)]===_0x5d2f21(0xe4))&&_0x1b5943[_0x5d2f21(0x1a3)]&&(_0x1b5943[_0x5d2f21(0x115)]=await _0x33ca63(_0x1b5943[_0x5d2f21(0x1a3)],_0x326e10));}const _0x1068cd=calculateSegmentDiff(_0x11314f,_0x5b71f9,_0x3c04de,_0x5000a4[_0x5d2f21(0x14c)],_0x5000a4[_0x5d2f21(0x183)]);_0x50e445[_0x5d2f21(0xd8)]({'relativePath':_0x11314f['name'],'absolutePath':_0x387d13,'yamlConfig':_0x11314f,'folderPath':_0x3e2f2d,'existingSegment':_0x5b71f9,'existingActivations':_0x3c04de,'isNew':_0x1068cd[_0x5d2f21(0x13a)],'hasChanges':_0x1068cd[_0x5d2f21(0x109)],'diff':_0x1068cd[_0x5d2f21(0x125)],'activationActions':_0x373937});}return{'segmentFiles':_0x50e445,'foldersToCreate':_0x30ea0d};}export async function prepareJourneyFiles(_0x2e8b52,_0x4546df,_0x14e46f,_0x544072){const _0xbd8c09=a98_0x3362f0,_0x56e548=[],_0x5ee597=new Set();for(const {yamlConfig:_0x1f0553,folderPath:_0x57870d,sourcePath:_0x52341b}of _0x2e8b52){const _0x3283dd=resolveTDFolderPath(_0x57870d,_0x14e46f,_0x544072),_0x466eb2=_0x3283dd+':'+_0x1f0553[_0xbd8c09(0x144)],_0x52cdf6=_0x4546df[_0xbd8c09(0x1b0)][_0xbd8c09(0xde)](_0x466eb2);let _0x1542cd,_0x596e08;if(_0x52cdf6&&_0x52cdf6['length']>0x0){const _0x9c0df5=buildLocalExpandedRuleMappings(_0x1f0553),{createYamlContext:_0x518e7f,prefetchJourneySegments:_0x28f7ab}=createPushYamlContextForBundle(_0x4546df[_0xbd8c09(0x123)],_0x4546df[_0xbd8c09(0x142)],_0x4546df[_0xbd8c09(0xee)],_0x9c0df5,_0x4546df[_0xbd8c09(0x14c)],_0x4546df[_0xbd8c09(0x183)],_0x4546df[_0xbd8c09(0x14d)],_0x4546df[_0xbd8c09(0x1a5)]);await _0x28f7ab(_0x52cdf6[_0xbd8c09(0x188)](_0x23aabe=>_0x23aabe['id']));const _0xbb72b2=hasMultipleVersions(_0x1f0553),_0x8f55d5=async _0x308da8=>{const _0x123596=_0xbd8c09,_0x504746=_0x4546df[_0x123596(0x1a5)]?.[_0x123596(0xde)](_0x308da8);if(_0x504746)return _0x504746;return _0x4546df['fetchJourney']({'journeyId':_0x308da8,'journeyName':_0x1f0553[_0x123596(0x144)],'isMultiVersion':_0x52cdf6['length']>0x1});};if(_0xbb72b2&&_0x52cdf6[_0xbd8c09(0x103)]>0x1){const _0x3b7844=[];for(const _0x5be367 of _0x52cdf6){const _0x3cb9c6=_0x5be367[_0xbd8c09(0xfb)]||0x1;_0x4546df['progress']?.[_0xbd8c09(0xe4)](_0xbd8c09(0x16e)+_0x1f0553[_0xbd8c09(0x144)]+'\x20v'+_0x3cb9c6);const _0x1e0bc7=await _0x8f55d5(_0x5be367['id']),_0x44f7df=_0x518e7f(_0x5be367['id']),_0x4a9fa7=await journeyResponseToDef(_0x1e0bc7,_0x44f7df);_0x3b7844[_0xbd8c09(0xd8)]({'item':_0x5be367,'yaml':_0x4a9fa7});}const _0xe42a3a=buildLocalRuleToNameMappingFromJourney(_0x1f0553);_0x596e08=buildMergedJourneyDef(_0x3b7844,_0xe42a3a);const _0x12641f=Math[_0xbd8c09(0x11e)](..._0x3b7844[_0xbd8c09(0x188)](_0x520192=>_0x520192[_0xbd8c09(0x181)]['versionNumber']||0x0)),_0x5af18f=_0x52cdf6['find'](_0x5d9664=>(_0x5d9664[_0xbd8c09(0xfb)]||0x0)===_0x12641f);_0x5af18f&&(_0x4546df[_0xbd8c09(0x158)]?.[_0xbd8c09(0xe4)](_0xbd8c09(0x16e)+_0x1f0553[_0xbd8c09(0x144)]+'\x20v'+_0x12641f),_0x1542cd=await _0x8f55d5(_0x5af18f['id']));}else{const _0x37b799=_0x52cdf6[_0x52cdf6[_0xbd8c09(0x103)]-0x1];_0x4546df[_0xbd8c09(0x158)]?.[_0xbd8c09(0xe4)]('Fetching\x20'+_0x1f0553[_0xbd8c09(0x144)]),_0x1542cd=await _0x8f55d5(_0x37b799['id']);const _0x5832ef=_0x518e7f(_0x37b799['id']),_0x118613=await journeyResponseToDef(_0x1542cd,_0x5832ef),_0x43a263=buildLocalRuleToNameMappingFromJourney(_0x1f0553);_0x596e08=buildMergedJourneyDef([{'item':_0x37b799,'yaml':_0x118613}],_0x43a263);}}addFoldersToCreate(_0x3283dd,_0x4546df['folderPathToId'],_0x5ee597);const _0x40e5c6=calculateJourneyDiff(_0x1f0553,_0x596e08);_0x56e548[_0xbd8c09(0xd8)]({'relativePath':_0x1f0553['name'],'absolutePath':_0x52341b,'yamlConfig':_0x1f0553,'folderPath':_0x3283dd,'existingJourney':_0x1542cd,'isNew':_0x40e5c6[_0xbd8c09(0x13a)],'hasChanges':_0x40e5c6['hasChanges'],'diff':_0x40e5c6[_0xbd8c09(0x125)]});}return{'journeyFiles':_0x56e548,'foldersToCreate':_0x5ee597};}export function calculateActivationActions(_0x5ea7f2,_0x108a35,_0x1857ec,_0x579aee){const _0x58e142=a98_0x3362f0,_0x132a32=[],_0x4278f3=new Map();for(const _0x22b5c3 of _0x108a35){_0x4278f3[_0x58e142(0x1ac)](_0x22b5c3[_0x58e142(0x144)],_0x22b5c3);}const _0x4c4e12=new Map();for(const _0x3016f3 of _0x5ea7f2){_0x4c4e12['set'](_0x3016f3[_0x58e142(0x144)],_0x3016f3);}for(const _0x173573 of _0x5ea7f2){const _0x40843=_0x4278f3['get'](_0x173573[_0x58e142(0x144)]);if(!_0x40843)_0x132a32[_0x58e142(0xd8)]({'type':_0x58e142(0x179),'name':_0x173573['name'],'yamlActivation':_0x173573});else{const _0x6db5eb=activationResponseToDef(_0x40843,_0x1857ec,_0x579aee),_0x422d25=a98_0x4e042d[_0x58e142(0x140)](_0x6db5eb),_0x14731f=a98_0x4e042d['stringify'](_0x173573);_0x422d25!==_0x14731f&&_0x132a32[_0x58e142(0xd8)]({'type':_0x58e142(0xe4),'name':_0x173573['name'],'yamlActivation':_0x173573,'existingActivation':_0x40843});}}for(const _0x5d8164 of _0x108a35){!_0x4c4e12['has'](_0x5d8164[_0x58e142(0x144)])&&_0x132a32[_0x58e142(0xd8)]({'type':_0x58e142(0x1a6),'name':_0x5d8164[_0x58e142(0x144)],'existingActivation':_0x5d8164});}return _0x132a32;}export function calculateSegmentDiff(_0xcec730,_0x37c965,_0x5073c2,_0x364db7,_0x15a4b9){const _0x5727f2=segmentToYamlString(_0xcec730);if(_0x37c965){const _0x352058=segmentWithActivationsToYaml(_0x37c965,_0x5073c2,undefined,_0x364db7,_0x15a4b9),_0x45456a=segmentToYamlString(_0x352058),_0x9e1eec=generateDiff(_0x45456a,_0x5727f2),_0x5adcec=hasChanges(_0x9e1eec);return{'isNew':![],'hasChanges':_0x5adcec,'diff':_0x5adcec?formatDiffWithColors(_0x9e1eec):undefined};}const _0x48ac05=generateDiff('',_0x5727f2);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x48ac05)};}export function calculateJourneyDiff(_0x497fe6,_0x1663e5){const _0x5de210=normalizeJourneyDef(_0x497fe6,_0x497fe6),_0x3303ed=a98_0x4372ae(_0x5de210);if(_0x1663e5){const _0x514c4f=normalizeJourneyDef(_0x1663e5,_0x497fe6),_0x205b3b=a98_0x4372ae(_0x514c4f),_0x3c2426=generateDiff(_0x205b3b,_0x3303ed),_0xdd0bd6=hasChanges(_0x3c2426);return{'isNew':![],'hasChanges':_0xdd0bd6,'diff':_0xdd0bd6?formatDiffWithColors(_0x3c2426):undefined};}const _0x41b3cd=generateDiff('',_0x3303ed);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x41b3cd)};}export function findSegmentsToDelete(_0x59b059,_0xe0eec1,_0x28ddf3,_0x442e79,_0x39a51b){const _0x3219a7=a98_0x3362f0,_0x2564e3=new Set();for(const {yamlConfig:_0x371833,folderPath:_0x25cc4e}of _0xe0eec1){_0x2564e3[_0x3219a7(0x196)](_0x25cc4e+':'+_0x371833[_0x3219a7(0x144)]);}return _0x59b059['filter'](_0x2119c9=>{const _0xa87ac7=_0x3219a7,_0x20601e=_0x2119c9['segmentFolderId']?_0x28ddf3['get'](_0x2119c9[_0xa87ac7(0x178)]['toString']())||'':'',_0x7b5bc6=_0x20601e+':'+_0x2119c9[_0xa87ac7(0x144)];if(_0x2564e3[_0xa87ac7(0x1aa)](_0x7b5bc6))return![];if(_0x39a51b)return _0x20601e===_0x442e79||_0x20601e[_0xa87ac7(0x157)](_0x442e79+'/');return!![];});}export function findJourneysToDelete(_0xafe497,_0x33c5a6,_0x1a34cd,_0x27c3c0,_0x1493c4){const _0x358417=a98_0x3362f0,_0x139f02=new Set();for(const {yamlConfig:_0xdc916,folderPath:_0x536c61}of _0x33c5a6){_0x139f02[_0x358417(0x196)](_0x536c61+':'+_0xdc916['name']);}return _0xafe497[_0x358417(0x14e)](_0x29e740=>{const _0x54e03b=_0x358417,_0x4cc129=_0x29e740[_0x54e03b(0xe6)]?_0x1a34cd[_0x54e03b(0xde)](_0x29e740[_0x54e03b(0xe6)])||'':'',_0x48596c=_0x4cc129+':'+_0x29e740[_0x54e03b(0xe9)];if(_0x139f02['has'](_0x48596c))return![];if(_0x1493c4)return _0x4cc129===_0x27c3c0||_0x4cc129[_0x54e03b(0x157)](_0x27c3c0+'/');return!![];});}export function buildSegmentLookupMap(_0x52f524,_0x1d2819){const _0x5fc6a8=a98_0x3362f0,_0x5b6295=new Map();for(const _0x1f61c9 of _0x52f524){const _0x3a2d1c=_0x1f61c9[_0x5fc6a8(0x178)]?_0x1d2819[_0x5fc6a8(0xde)](_0x1f61c9[_0x5fc6a8(0x178)]['toString']())||'':'',_0x39f829=_0x3a2d1c+':'+_0x1f61c9['name'];_0x5b6295[_0x5fc6a8(0x1ac)](_0x39f829,_0x1f61c9);}return _0x5b6295;}export function buildSegmentNameToIdMap(_0x2fe7e6){const _0x2e7e16=new Map();for(const _0x1a3898 of _0x2fe7e6){_0x2e7e16['set'](_0x1a3898['name'],_0x1a3898['id']);}return _0x2e7e16;}export function buildJourneyBundleLookupMap(_0x665a54,_0x1fbb0f){const _0x5ead8b=a98_0x3362f0,_0x5768d1=new Map();for(const _0x42039c of _0x665a54){const _0x157510=_0x42039c[_0x5ead8b(0xe6)]?_0x1fbb0f[_0x5ead8b(0xde)](_0x42039c['folderId'])||'':'',_0x3fa8fa=_0x157510+':'+_0x42039c['journeyBundleName'];!_0x5768d1[_0x5ead8b(0x1aa)](_0x3fa8fa)&&_0x5768d1[_0x5ead8b(0x1ac)](_0x3fa8fa,[]),_0x5768d1['get'](_0x3fa8fa)['push'](_0x42039c);}for(const _0x339bef of _0x5768d1[_0x5ead8b(0x14b)]()){_0x339bef[_0x5ead8b(0xf7)]((_0x1a2ac2,_0x22a05e)=>(_0x1a2ac2[_0x5ead8b(0xfb)]||0x0)-(_0x22a05e['versionNumber']||0x0));}return _0x5768d1;}export function collectFoldersToCreate(_0x14becb,_0x477917){const _0x281023=a98_0x3362f0,_0x29d52e=new Set();for(const _0x164df3 of _0x14becb){if(!_0x164df3)continue;if(_0x477917[_0x281023(0x1aa)](_0x164df3))continue;const _0x184b8d=_0x164df3[_0x281023(0x145)]('/');let _0x2cbd12='';for(const _0x181447 of _0x184b8d){_0x2cbd12=_0x2cbd12?_0x2cbd12+'/'+_0x181447:_0x181447,!_0x477917[_0x281023(0x1aa)](_0x2cbd12)&&_0x29d52e[_0x281023(0x196)](_0x2cbd12);}}return _0x29d52e;}export function parseAndClassifyYamlFiles(_0x40de89,_0x2cc13a,_0x220ba5){const _0x185a1b=a98_0x3362f0,_0x3a14e6=[],_0x130f49=[];for(const _0x1b595b of _0x40de89){const _0x36f9e8=a98_0x1d4204[_0x185a1b(0xe3)](_0x2cc13a,a98_0x1d4204[_0x185a1b(0x15c)](_0x1b595b)),_0x35c018=_0x36f9e8==='.'?'':_0x36f9e8,_0x1d904c=readFileSync(_0x1b595b,_0x185a1b(0x151)),_0x9121f3=a98_0x4e042d[_0x185a1b(0xf5)](_0x1d904c);if(isJourneyDef(_0x9121f3)){const _0x2800e7=a98_0x561137(_0x1d904c);_0x130f49[_0x185a1b(0xd8)]({'yamlConfig':_0x2800e7,'folderPath':_0x35c018,'sourcePath':_0x1b595b});}else{if(!_0x220ba5?.[_0x185a1b(0x191)]){const _0x569147=parseSegmentYamlFile(_0x1d904c),_0x3062d5=normalizeChildSegmentYaml(_0x569147);_0x3a14e6['push']({'yamlConfig':_0x3062d5,'folderPath':_0x35c018,'sourcePath':_0x1b595b});}}}return{'segments':_0x3a14e6,'journeys':_0x130f49};}export function validateParsedFiles(_0x1a847e,_0x12679d){const _0x136109=a98_0x3362f0,_0x4c23c7=[];for(const {yamlConfig:_0x2994bd,sourcePath:_0x3422d5}of _0x1a847e['segments']){const _0x595722=readFileSync(_0x3422d5,_0x136109(0x151)),_0x47b8d=a98_0x4e042d[_0x136109(0x18d)](_0x595722),_0x1e32d8=validateSegmentDef(_0x2994bd,{'source':_0x595722,'document':_0x47b8d});if(!_0x1e32d8[_0x136109(0x120)]){const _0x6319b4=a98_0x1d4204[_0x136109(0xe3)](_0x12679d,_0x3422d5);_0x4c23c7[_0x136109(0xd8)]({'filePath':_0x6319b4,'source':_0x595722,'result':_0x1e32d8,'isJourney':![]});}}for(const {yamlConfig:_0x9f637f,sourcePath:_0x56c914}of _0x1a847e[_0x136109(0x17f)]){const _0x4be23c=readFileSync(_0x56c914,_0x136109(0x151)),_0x19c398=a98_0x4e042d[_0x136109(0x18d)](_0x4be23c),_0x494244=validateJourneyDef(_0x9f637f,{'source':_0x4be23c,'document':_0x19c398});if(!_0x494244[_0x136109(0x120)]){const _0x50dc22=a98_0x1d4204['relative'](_0x12679d,_0x56c914);_0x4c23c7['push']({'filePath':_0x50dc22,'source':_0x4be23c,'result':_0x494244,'isJourney':!![]});}}return _0x4c23c7;}export function formatValidationErrors(_0x249f52){const _0x4fd325=a98_0x3362f0,_0x4a756e=[];for(const {filePath:_0x204020,source:_0x2c9204,result:_0x35eeef,isJourney:_0x542396}of _0x249f52){const _0x34a2eb=_0x542396?'journey':_0x4fd325(0x116);_0x4a756e[_0x4fd325(0xd8)]('\x0a'+_0x204020+'\x20('+_0x34a2eb+_0x4fd325(0x105)+_0x35eeef['errors'][_0x4fd325(0x103)]+_0x4fd325(0x12e)),_0x4a756e[_0x4fd325(0xd8)](formatValidationResult(_0x35eeef,_0x2c9204,_0x204020));}return _0x4a756e[_0x4fd325(0x136)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x237d6c){const _0x4310ac=a98_0x3362f0,_0x1d28f3=new Set(),_0x20cb81=new Map(),_0x4a0b04=collectSegmentUsageCounts(_0x237d6c);if(_0x237d6c[_0x4310ac(0xe7)])for(const [_0x52c62b,_0x435295]of Object['entries'](_0x237d6c['segments'])){_0x1d28f3[_0x4310ac(0x196)](_0x52c62b);if(_0x435295['rule']){const _0x934210=yamlRuleToApi(_0x435295['rule']),_0x1934c3=apiRuleToYaml(_0x934210);_0x20cb81[_0x4310ac(0x1ac)](_0x52c62b,_0x1934c3);}}const _0x3210c6=new Map();let _0x28a302=0x0;for(const [_0x3ce1b0,_0x10c385]of _0x20cb81){const _0x563c7f=serializeExpandedRule(_0x10c385,_0x20cb81),_0x3b2fdc=_0x3210c6['get'](_0x563c7f)||[];_0x3b2fdc['push']({'name':_0x3ce1b0,'index':_0x28a302}),_0x3210c6[_0x4310ac(0x1ac)](_0x563c7f,_0x3b2fdc),_0x28a302++;}const _0x506582=new Map();for(const [_0x47b0a9,_0x2214a5]of _0x3210c6){const _0x44d43c=_0x2214a5[_0x4310ac(0x1ab)]()['sort']((_0x4a8f27,_0x88d752)=>{const _0x1d10e8=_0x4310ac,_0x5f5809=_0x4a0b04[_0x1d10e8(0xde)](_0x4a8f27[_0x1d10e8(0x144)])||0x0,_0x544154=_0x4a0b04[_0x1d10e8(0xde)](_0x88d752['name'])||0x0;if(_0x5f5809!==_0x544154)return _0x544154-_0x5f5809;return _0x4a8f27[_0x1d10e8(0x132)]-_0x88d752['index'];})[_0x4310ac(0x188)](_0x417615=>_0x417615[_0x4310ac(0x144)]),_0x3b12b5=[];for(const _0x18e2b5 of _0x44d43c){const _0x4cc13d=_0x4a0b04[_0x4310ac(0xde)](_0x18e2b5)||0x0,_0x23387b=Math[_0x4310ac(0x11e)](_0x4cc13d,0x1);for(let _0x289bcb=0x0;_0x289bcb<_0x23387b;_0x289bcb++){_0x3b12b5[_0x4310ac(0xd8)](_0x18e2b5);}}_0x506582[_0x4310ac(0x1ac)](_0x47b0a9,_0x3b12b5);}return{'existingLocalSegmentNames':_0x1d28f3,'localSegmentRules':_0x20cb81,'localExpandedRuleToNames':_0x506582};}async function buildServerSegmentRuleMap(_0x569f36,_0x525bfb,_0x51fd74,_0x563cae){const _0x35ca81=new Map(),_0x3889bd=new Set(),_0xc8f909=async _0x45dc7a=>{const _0x56db9e=a98_0x35c3;if(_0x3889bd[_0x56db9e(0x1aa)](_0x45dc7a))return;_0x3889bd[_0x56db9e(0x196)](_0x45dc7a);let _0x5cb021=_0x51fd74[_0x56db9e(0x18f)](_0x42fa38=>_0x42fa38['id']===_0x45dc7a);if(!_0x5cb021)try{_0x5cb021=await _0x569f36['segment'][_0x56db9e(0x119)](_0x525bfb,_0x45dc7a);}catch{return;}if(!_0x5cb021?.[_0x56db9e(0x100)])return;const _0x72ed85=apiRuleToYaml(_0x5cb021[_0x56db9e(0x100)]);_0x35ca81[_0x56db9e(0x1ac)](_0x45dc7a,_0x72ed85);const _0x2c8998=collectSegmentRefsFromRule(_0x72ed85);for(const _0xb31d0e of _0x2c8998){await _0xc8f909(_0xb31d0e);}};for(const _0x4473e7 of _0x563cae){await _0xc8f909(_0x4473e7);}return _0x35ca81;}export function createSegmentIdResolver(_0x5418c9,_0x45eb42){return async _0x2e52ed=>{const _0x3b5881=a98_0x35c3,_0x266f4a=_0x5418c9[_0x3b5881(0xde)](_0x2e52ed);if(!_0x266f4a)throw new SDKError(ErrorCode[_0x3b5881(0x18b)],_0x3b5881(0xd6)+_0x2e52ed+_0x3b5881(0x168)+_0x45eb42+'\x27)');return _0x266f4a;};}export function extractRootFolderId(_0x32cb9b){const _0x1e2096=a98_0x3362f0;return _0x32cb9b[_0x1e2096(0x150)]?.['parentSegmentFolder']?.[_0x1e2096(0x108)]?.['id']||_0x32cb9b[_0x1e2096(0x150)]?.[_0x1e2096(0xf8)]?.[_0x1e2096(0x108)]?.['id'];}export function buildConnectionMaps(_0xf22ca){const _0x162472=a98_0x3362f0,_0x18a4a3=new Map(),_0x2dd48e=new Map(),_0x57f188=new Map();for(const _0x267f1a of _0xf22ca){_0x18a4a3['set'](_0x267f1a[_0x162472(0x144)],parseInt(_0x267f1a['id'],0xa)),_0x2dd48e[_0x162472(0x1ac)](_0x267f1a['id'],_0x267f1a[_0x162472(0x144)]),_0x57f188['set'](_0x267f1a[_0x162472(0x144)],_0x267f1a['type']);}return{'nameToId':_0x18a4a3,'idToName':_0x2dd48e,'nameToType':_0x57f188};}export function calculatePushStats(_0x556b1a,_0x3012b0,_0x1db2f0,_0xcdc82f,_0xfb3d32,_0x3954f9,_0x4c4955){const _0x27155d=a98_0x3362f0,_0x5c16b8=_0x556b1a['filter'](_0x2da1b5=>_0x2da1b5[_0x27155d(0x13a)]),_0x3c2fbb=_0x556b1a[_0x27155d(0x14e)](_0x228312=>!_0x228312[_0x27155d(0x13a)]&&_0x228312[_0x27155d(0x109)]),_0x344186=_0x556b1a[_0x27155d(0x14e)](_0x54b92e=>!_0x54b92e[_0x27155d(0x13a)]&&!_0x54b92e['hasChanges']),_0x530139=_0x3954f9?_0xcdc82f:[],_0x3d9dc1=_0x3012b0['filter'](_0xaf0342=>_0xaf0342[_0x27155d(0x13a)]),_0x50fc49=_0x3012b0[_0x27155d(0x14e)](_0x1e9d83=>!_0x1e9d83[_0x27155d(0x13a)]&&_0x1e9d83[_0x27155d(0x109)]),_0x4ee6fb=_0x3012b0[_0x27155d(0x14e)](_0x57e2b0=>!_0x57e2b0[_0x27155d(0x13a)]&&!_0x57e2b0[_0x27155d(0x109)]),_0xabc661=_0x3954f9?_0xfb3d32:[],_0x1c8732=_0x556b1a['flatMap'](_0x2ed1db=>_0x2ed1db['activationActions']),_0x2e06a8=_0x1c8732['filter'](_0x2dc7f0=>_0x2dc7f0[_0x27155d(0x19c)]===_0x27155d(0x179)),_0x4fbf89=_0x1c8732['filter'](_0xa181ed=>_0xa181ed[_0x27155d(0x19c)]===_0x27155d(0xe4)),_0x4ed743=_0x1c8732[_0x27155d(0x14e)](_0xf0efd4=>_0xf0efd4['type']===_0x27155d(0x1a6)),_0x32f8ab=Array[_0x27155d(0xfa)](_0x1db2f0)[_0x27155d(0xf7)](),_0x1bdd19=_0x4c4955?![]:_0x5c16b8[_0x27155d(0x103)]>0x0||_0x3c2fbb[_0x27155d(0x103)]>0x0||_0x530139['length']>0x0,_0x45b3dc=_0x3d9dc1['length']>0x0||_0x50fc49[_0x27155d(0x103)]>0x0||_0xabc661['length']>0x0,_0x4a1c58=_0x4c4955?![]:_0x1c8732[_0x27155d(0x103)]>0x0,_0x4a0db4=_0x32f8ab['length']>0x0;return{'segments':{'new':_0x5c16b8,'changed':_0x3c2fbb,'unchanged':_0x344186,'toDelete':_0x530139},'journeys':{'new':_0x3d9dc1,'changed':_0x50fc49,'unchanged':_0x4ee6fb,'toDelete':_0xabc661},'activations':{'all':_0x1c8732,'toCreate':_0x2e06a8,'toUpdate':_0x4fbf89,'toDelete':_0x4ed743},'folders':{'toCreate':_0x32f8ab},'counts':{'segments':{'new':_0x5c16b8['length'],'changed':_0x3c2fbb[_0x27155d(0x103)],'unchanged':_0x344186[_0x27155d(0x103)],'toDelete':_0x530139['length']},'journeys':{'new':_0x3d9dc1[_0x27155d(0x103)],'changed':_0x50fc49[_0x27155d(0x103)],'unchanged':_0x4ee6fb[_0x27155d(0x103)],'toDelete':_0xabc661['length']},'activations':{'create':_0x2e06a8[_0x27155d(0x103)],'update':_0x4fbf89['length'],'delete':_0x4ed743[_0x27155d(0x103)]},'folders':_0x32f8ab['length']},'hasChanges':_0x1bdd19||_0x45b3dc||_0x4a1c58||_0x4a0db4};}export async function buildPushExecutionContext(_0xaedb3b,_0x53bfe4,_0x5288fb,_0x228de5,_0x219c43,_0x130a0b){const _0x103094=a98_0x3362f0,_0x2a77f1=extractRootFolderId(_0x5288fb),{pathToId:_0x528583,idToPath:_0x57c443}=buildFolderMaps(_0x219c43),_0x2d58ea=buildSegmentNameToIdMap(_0x228de5),_0x1b13b0=new Map(),{batchAsync:_0x3b3351}=await import('../../utils/async.js'),[_0x2c1872,_0x18ac16]=await Promise[_0x103094(0x1a1)]([_0xaedb3b[_0x103094(0x16f)][_0x103094(0xe0)](),_0xaedb3b[_0x103094(0x11a)]['list'](),((async()=>{const _0x5d4fbf=_0x103094;!_0x130a0b&&_0x228de5[_0x5d4fbf(0x103)]>0x0&&await _0x3b3351(_0x228de5,async _0x289f55=>{const _0x2d12d5=_0x5d4fbf,_0x31f09a=await _0xaedb3b[_0x2d12d5(0x116)][_0x2d12d5(0x19a)](_0x53bfe4,_0x289f55['id']);_0x1b13b0[_0x2d12d5(0x1ac)](_0x289f55['id'],_0x31f09a);});})())]),{emailToId:_0x30da36,idToEmail:_0x582f71}=_0x2c1872,_0x36d3a1=buildConnectionMaps(_0x18ac16);return{'rootFolderId':_0x2a77f1,'folderPathToId':_0x528583,'folderIdToPath':_0x57c443,'segmentNameToId':_0x2d58ea,'activationsBySegmentId':_0x1b13b0,'emailToIdMap':_0x30da36,'idToEmailMap':_0x582f71,'connectionNameToIdMap':_0x36d3a1[_0x103094(0x133)],'connectionIdToNameMap':_0x36d3a1[_0x103094(0x159)],'connectionNameToTypeMap':_0x36d3a1[_0x103094(0x16c)]};}export function createPushYamlContextForBundle(_0x34788c,_0x1bb9cb,_0x1c996d,_0x4fc5aa,_0xb5f49f,_0x5acf0c,_0x38f6e3,_0x14fb15){const {existingLocalSegmentNames:_0x10be70,localExpandedRuleToNames:_0x2b6847}=_0x4fc5aa,_0x5a7c4d=new Set(),_0x234ec5=new Map(),_0x3be59d=new Set(),_0x30f32e=new Map(),_0x1c344a=new Map(),_0x788fcd=createJumpTargetCache(),_0x1063e7=new Map(),_0x4b6ada=new Map(),_0x20d62f=new Set();let _0x29948a;const _0xd76c0d=_0x17a782=>{const _0x32732f={'resolveSegment':async _0x1a8d83=>{const _0x510dc2=a98_0x35c3,_0x2f96be=_0x1c344a[_0x510dc2(0xde)](_0x1a8d83);if(_0x2f96be!==undefined)return{'name':_0x2f96be,'isJourneyLocal':!![]};try{let _0xdabb01=_0x1c996d['find'](_0x4a8ab3=>_0x4a8ab3['id']===_0x1a8d83);!_0xdabb01&&(_0xdabb01=await _0x34788c['segment'][_0x510dc2(0x119)](_0x1bb9cb,_0x1a8d83));const _0x44202b=generateJourneyLocalName(_0xdabb01['name']),_0x3a2bfe=_0xdabb01['kind']===SEGMENT_KIND_JOURNEY&&_0x44202b!==undefined;let _0x10aefe=_0xdabb01['name'],_0x5ec5f5;if(_0x3a2bfe&&_0xdabb01[_0x510dc2(0x100)]){const _0xebf123=apiRuleToYaml(_0xdabb01[_0x510dc2(0x100)]);_0x4b6ada[_0x510dc2(0x1ac)](_0x1a8d83,_0xebf123);const _0x35044a=async _0x51da3b=>{const _0x37904e=_0x510dc2,_0x26e446=collectSegmentRefsFromRule(_0x51da3b);for(const _0x5690ce of _0x26e446){if(!_0x4b6ada[_0x37904e(0x1aa)](_0x5690ce))try{const _0x411751=await _0x34788c[_0x37904e(0x116)][_0x37904e(0x119)](_0x1bb9cb,_0x5690ce);if(_0x411751?.[_0x37904e(0x100)]){const _0xbd5018=apiRuleToYaml(_0x411751[_0x37904e(0x100)]);_0x4b6ada['set'](_0x5690ce,_0xbd5018),await _0x35044a(_0xbd5018);}}catch{}}};await _0x35044a(_0xebf123);const _0x14b0e0=serializeExpandedRule(_0xebf123,_0x4b6ada),_0x11e5b1=_0x2b6847['get'](_0x14b0e0);if(_0x11e5b1&&_0x11e5b1[_0x510dc2(0x103)]>0x0){const _0x41d4a3=_0x234ec5[_0x510dc2(0xde)](_0x14b0e0)||0x0,_0x2dc2e1=_0x11e5b1[_0x41d4a3]||_0x11e5b1[_0x11e5b1[_0x510dc2(0x103)]-0x1];_0x234ec5['set'](_0x14b0e0,_0x41d4a3+0x1),_0x10aefe=_0x2dc2e1,_0x5a7c4d[_0x510dc2(0x196)](_0x10aefe),_0x1c344a['set'](_0x1a8d83,_0x10aefe);const _0x562430=await resolveRuleSegmentRefs(_0xebf123,async _0x1d94f3=>{const _0x53bff6=_0x510dc2,_0x34a751=_0x1c344a[_0x53bff6(0xde)](_0x1d94f3);if(_0x34a751)return _0x34a751;const _0xb2df5d=await _0x29948a[_0x53bff6(0xdd)](_0x1d94f3);return _0xb2df5d[_0x53bff6(0x144)];});_0x5ec5f5={'description':_0xdabb01[_0x510dc2(0x13c)],'rule':_0x562430};}else{const _0x396598=_0x1063e7['get'](_0x14b0e0);if(_0x396598)_0x10aefe=_0x396598,_0x1c344a['set'](_0x1a8d83,_0x10aefe);else{if(_0x44202b){let _0x21ea35=_0x44202b,_0x5a1fda=0x2;while(_0x5a7c4d[_0x510dc2(0x1aa)](_0x21ea35)||_0x10be70[_0x510dc2(0x1aa)](_0x21ea35)){_0x21ea35=_0x44202b+'_'+_0x5a1fda,_0x5a1fda++;}_0x5a7c4d[_0x510dc2(0x196)](_0x21ea35),_0x10aefe=_0x21ea35;}_0x1c344a['set'](_0x1a8d83,_0x10aefe),_0x1063e7[_0x510dc2(0x1ac)](_0x14b0e0,_0x10aefe);const _0x504390=await resolveRuleSegmentRefs(_0xebf123,async _0x11ac08=>{const _0x4b7374=_0x510dc2,_0x1ccc46=_0x1c344a[_0x4b7374(0xde)](_0x11ac08);if(_0x1ccc46)return _0x1ccc46;const _0x4408f6=await _0x29948a[_0x4b7374(0xdd)](_0x11ac08);return _0x4408f6[_0x4b7374(0x144)];});_0x5ec5f5={'description':_0xdabb01[_0x510dc2(0x13c)],'rule':_0x504390};}}}return{'name':_0x10aefe,'isJourneyLocal':_0x3a2bfe,'definition':_0x5ec5f5};}catch{return{'name':_0x1a8d83,'isJourneyLocal':![]};}},'resolveActivation':async _0x4d94be=>{const _0x2ac29c=a98_0x35c3,_0x4e0840=_0x30f32e[_0x2ac29c(0xde)](_0x4d94be);if(_0x4e0840!==undefined)return{'name':_0x4e0840,'isJourneyLocal':!![]};try{let _0x3b4346=_0x38f6e3?.['get'](_0x4d94be);!_0x3b4346&&(_0x3b4346=await _0x34788c[_0x2ac29c(0xd7)]['getActivation'](_0x17a782,_0x4d94be));const _0x1ab241=_0x3b4346[_0x2ac29c(0x110)][_0x2ac29c(0x15b)][_0x2ac29c(0x144)]||_0x4d94be,_0x4e8e5a=sanitizeYamlKey(_0x1ab241)||_0x2ac29c(0x1a8)+_0x4d94be;let _0x2ce9d9=_0x4e8e5a,_0x370666=0x2;while(_0x3be59d[_0x2ac29c(0x1aa)](_0x2ce9d9)){_0x2ce9d9=_0x4e8e5a+'_'+_0x370666,_0x370666++;}_0x3be59d[_0x2ac29c(0x196)](_0x2ce9d9),_0x30f32e[_0x2ac29c(0x1ac)](_0x4d94be,_0x2ce9d9);const _0x41ed23=journeyActivationStepToYaml(_0x3b4346,_0xb5f49f,_0x5acf0c);return{'name':_0x2ce9d9,'isJourneyLocal':!![],'definition':_0x41ed23};}catch{return{'name':_0x4d94be,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x31b17b,_0xb69680)=>resolveJumpTarget(_0x31b17b,_0xb69680,_0x788fcd,async _0x1a13d0=>{const _0x32c567=a98_0x35c3,_0x242498=_0x14fb15?.['get'](_0x1a13d0);if(_0x242498)return _0x242498;return _0x34788c[_0x32c567(0xd7)][_0x32c567(0x11d)](_0x1a13d0);})};return _0x29948a=_0x32732f,_0x32732f;},_0x2d0bab=async _0xc30bf4=>{const _0x2b74dd=a98_0x35c3,{collectSegmentIdsFromJourneyApi:_0x295671}=await import(_0x2b74dd(0x118)),{batchAsync:_0x328c70}=await import('../../utils/async.js'),_0x2419e6=new Set();for(const _0x5d6258 of _0xc30bf4){let _0x36338b=_0x14fb15?.[_0x2b74dd(0xde)](_0x5d6258);!_0x36338b&&(_0x36338b=await _0x34788c['journey']['getJourney'](_0x5d6258));const _0x36e0e6=_0x295671(_0x36338b);for(const _0x29e6b7 of _0x36e0e6){_0x2419e6[_0x2b74dd(0x196)](_0x29e6b7);}}let _0xff9172=Array[_0x2b74dd(0xfa)](_0x2419e6);while(_0xff9172[_0x2b74dd(0x103)]>0x0){const _0x2fe81f=_0xff9172[_0x2b74dd(0x14e)](_0x5cba77=>!_0x20d62f[_0x2b74dd(0x1aa)](_0x5cba77));if(_0x2fe81f['length']===0x0)break;const _0xe93ba9=await _0x328c70(_0x2fe81f,async _0x3d66d2=>{const _0x334a64=_0x2b74dd;_0x20d62f[_0x334a64(0x196)](_0x3d66d2);let _0x3a2f90=_0x1c996d[_0x334a64(0x18f)](_0x543590=>_0x543590['id']===_0x3d66d2);if(!_0x3a2f90)try{_0x3a2f90=await _0x34788c[_0x334a64(0x116)][_0x334a64(0x119)](_0x1bb9cb,_0x3d66d2);}catch{return null;}return{'segmentId':_0x3d66d2,'segment':_0x3a2f90};},0xa),_0x1e0c9b=new Set();for(const _0x1cc37d of _0xe93ba9){if(!_0x1cc37d?.[_0x2b74dd(0x116)]?.['rule'])continue;const _0x42cbdd=apiRuleToYaml(_0x1cc37d['segment'][_0x2b74dd(0x100)]);_0x4b6ada['set'](_0x1cc37d[_0x2b74dd(0x147)],_0x42cbdd);const _0x3cd213=collectSegmentRefsFromRule(_0x42cbdd);for(const _0x19f252 of _0x3cd213){!_0x20d62f[_0x2b74dd(0x1aa)](_0x19f252)&&_0x1e0c9b[_0x2b74dd(0x196)](_0x19f252);}}_0xff9172=Array['from'](_0x1e0c9b);}};return{'createYamlContext':_0xd76c0d,'prefetchJourneySegments':_0x2d0bab};}export async function executePushSegments(_0x149777,_0x183938,_0x3db15d,_0x1f207e,_0x3851c3){const _0x185a46=a98_0x3362f0,{segmentDefToCreateRequest:_0x4de020,segmentDefToUpdateRequest:_0xbc0a77}=await import(_0x185a46(0xf9)),_0x4b3a50=_0x3db15d[_0x185a46(0x161)],_0x17e20b=0x5,_0x264a13=async _0x186c12=>{const _0x2566da=_0x185a46,_0xce8081=_0x186c12[_0x2566da(0x172)]?_0x4b3a50[_0x2566da(0xde)](_0x186c12[_0x2566da(0x172)]):undefined;let _0x178aab;const _0x27ea0e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x186c12[_0x2566da(0x13a)]){_0x3851c3[_0x2566da(0x1b1)]?.({'type':_0x2566da(0x11f),'name':_0x186c12[_0x2566da(0x195)]['name']});const _0x3c0c53=_0x4de020(_0x186c12[_0x2566da(0x195)],_0xce8081),_0xa3bcac=await _0x3851c3[_0x2566da(0x166)](_0x2566da(0x112)+_0x186c12[_0x2566da(0x195)][_0x2566da(0x144)]+'\x27...',()=>_0x149777[_0x2566da(0x116)]['createSegment'](_0x1f207e[_0x2566da(0x142)],_0x3c0c53));_0x178aab=_0xa3bcac[_0x2566da(0x108)]['id'],_0x27ea0e[_0x2566da(0x15d)]={'name':_0x186c12[_0x2566da(0x195)]['name'],'id':_0x178aab},_0x3851c3['onProgress']?.({'type':_0x2566da(0x122),'name':_0x186c12['yamlConfig'][_0x2566da(0x144)],'segmentId':_0x178aab}),_0x3851c3['logSuccess']?.('Created\x20segment\x20\x27'+_0x186c12[_0x2566da(0x195)][_0x2566da(0x144)]+'\x27'),_0x27ea0e[_0x2566da(0x13f)]=0x1;}else{if(_0x186c12['hasChanges']){_0x3851c3['onProgress']?.({'type':_0x2566da(0xfe),'name':_0x186c12['yamlConfig'][_0x2566da(0x144)]});const _0x3974a3=_0xbc0a77(_0x186c12[_0x2566da(0x195)]);_0xce8081!==_0x186c12[_0x2566da(0x19f)]?.['segmentFolderId']&&(_0x3974a3['segmentFolderId']=_0xce8081?parseInt(_0xce8081,0xa):undefined),await _0x3851c3[_0x2566da(0x166)](_0x2566da(0x193)+_0x186c12[_0x2566da(0x195)][_0x2566da(0x144)]+_0x2566da(0x1a0),()=>_0x149777['segment'][_0x2566da(0x1ae)](_0x1f207e[_0x2566da(0x142)],_0x186c12['existingSegment']['id'],_0x3974a3)),_0x178aab=_0x186c12[_0x2566da(0x19f)]['id'],_0x3851c3[_0x2566da(0x1b1)]?.({'type':_0x2566da(0x163),'name':_0x186c12[_0x2566da(0x195)][_0x2566da(0x144)]}),_0x3851c3[_0x2566da(0x153)]?.(_0x2566da(0x187)+_0x186c12['yamlConfig'][_0x2566da(0x144)]+'\x27'),_0x27ea0e[_0x2566da(0x186)]=0x1;}else _0x178aab=_0x186c12[_0x2566da(0x19f)]['id'];}}catch(_0x19eb83){const _0x583968=isHttp400Error(_0x19eb83),_0x7b871d=_0x583968?ErrorCode[_0x2566da(0x121)]:ErrorCode[_0x2566da(0x17e)],_0x56cdd2=getErrorMessage(_0x19eb83);throw new SDKError(_0x7b871d,_0x2566da(0xef)+(_0x186c12[_0x2566da(0x13a)]?_0x2566da(0x179):_0x2566da(0xe4))+'\x20segment\x20from\x20file:\x20'+_0x186c12[_0x2566da(0x13e)]+_0x2566da(0x117)+_0x56cdd2,_0x19eb83);}try{const _0x5d16d7=await syncActivationsForSegment(_0x149777,_0x1f207e['parentId'],_0x178aab,_0x186c12[_0x2566da(0x195)]['name'],_0x186c12[_0x2566da(0x102)],_0x3851c3,_0x186c12[_0x2566da(0x13e)]);_0x27ea0e[_0x2566da(0x10c)]=_0x5d16d7;}catch(_0x3f6cc4){if(_0x3f6cc4 instanceof SDKError)throw _0x3f6cc4;throw new SDKError(ErrorCode[_0x2566da(0x134)],_0x2566da(0xf4)+_0x186c12[_0x2566da(0x195)][_0x2566da(0x144)]+_0x2566da(0x131)+_0x186c12[_0x2566da(0x13e)]+_0x2566da(0x117)+getErrorMessage(_0x3f6cc4),_0x3f6cc4);}return _0x27ea0e;},_0x3b9590=await batchAsync(_0x183938,_0x264a13,_0x17e20b),_0x14c12d={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1ba3d3 of _0x3b9590){_0x14c12d['created']+=_0x1ba3d3['created'],_0x14c12d[_0x185a46(0x186)]+=_0x1ba3d3[_0x185a46(0x186)],_0x1ba3d3['createdSegmentId']&&_0x14c12d['createdSegmentIds'][_0x185a46(0x1ac)](_0x1ba3d3[_0x185a46(0x15d)][_0x185a46(0x144)],_0x1ba3d3[_0x185a46(0x15d)]['id']),_0x14c12d[_0x185a46(0x10c)][_0x185a46(0x13f)]+=_0x1ba3d3['activations']['created'],_0x14c12d['activations'][_0x185a46(0x186)]+=_0x1ba3d3[_0x185a46(0x10c)][_0x185a46(0x186)],_0x14c12d['activations'][_0x185a46(0x175)]+=_0x1ba3d3[_0x185a46(0x10c)][_0x185a46(0x175)];}return _0x14c12d;}async function syncActivationsForSegment(_0x130016,_0xe2590b,_0x1677c9,_0x14ed7f,_0x4c3d24,_0x4ccaed,_0x492ceb){const _0x51f0d7=a98_0x3362f0,_0x5321c9={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x56d0a8 of _0x4c3d24){try{if(_0x56d0a8[_0x51f0d7(0x19c)]==='create'&&_0x56d0a8[_0x51f0d7(0x115)])_0x4ccaed[_0x51f0d7(0x1b1)]?.({'type':'activation_creating','segmentName':_0x14ed7f,'activationName':_0x56d0a8['name']}),await _0x4ccaed[_0x51f0d7(0x166)](_0x51f0d7(0x164)+_0x56d0a8[_0x51f0d7(0x144)]+_0x51f0d7(0x1a0),()=>_0x130016['segment'][_0x51f0d7(0xd3)](_0xe2590b,_0x1677c9,_0x56d0a8[_0x51f0d7(0x115)])),_0x4ccaed['onProgress']?.({'type':_0x51f0d7(0x199),'segmentName':_0x14ed7f,'activationName':_0x56d0a8[_0x51f0d7(0x144)]}),_0x4ccaed[_0x51f0d7(0x153)]?.(_0x51f0d7(0x1a4)+_0x56d0a8[_0x51f0d7(0x144)]+'\x27'),_0x5321c9[_0x51f0d7(0x13f)]++;else{if(_0x56d0a8[_0x51f0d7(0x19c)]==='update'&&_0x56d0a8[_0x51f0d7(0x115)]&&_0x56d0a8[_0x51f0d7(0x1af)])_0x4ccaed[_0x51f0d7(0x1b1)]?.({'type':'activation_updating','segmentName':_0x14ed7f,'activationName':_0x56d0a8[_0x51f0d7(0x144)]}),await _0x4ccaed[_0x51f0d7(0x166)](_0x51f0d7(0x16a)+_0x56d0a8[_0x51f0d7(0x144)]+_0x51f0d7(0x1a0),()=>_0x130016[_0x51f0d7(0x116)][_0x51f0d7(0x10f)](_0xe2590b,_0x1677c9,_0x56d0a8[_0x51f0d7(0x1af)]['id'],_0x56d0a8['validatedRequest'])),_0x4ccaed[_0x51f0d7(0x1b1)]?.({'type':_0x51f0d7(0xff),'segmentName':_0x14ed7f,'activationName':_0x56d0a8[_0x51f0d7(0x144)]}),_0x4ccaed[_0x51f0d7(0x153)]?.(_0x51f0d7(0x189)+_0x56d0a8[_0x51f0d7(0x144)]+'\x27'),_0x5321c9[_0x51f0d7(0x186)]++;else _0x56d0a8[_0x51f0d7(0x19c)]==='delete'&&_0x56d0a8[_0x51f0d7(0x1af)]&&(_0x4ccaed[_0x51f0d7(0x1b1)]?.({'type':_0x51f0d7(0x192),'segmentName':_0x14ed7f,'activationName':_0x56d0a8[_0x51f0d7(0x144)]}),await _0x4ccaed['withProgress'](_0x51f0d7(0xe1)+_0x56d0a8['name']+_0x51f0d7(0x1a0),()=>_0x130016['segment'][_0x51f0d7(0x1ad)](_0xe2590b,_0x1677c9,_0x56d0a8[_0x51f0d7(0x1af)]['id'])),_0x4ccaed[_0x51f0d7(0x1b1)]?.({'type':_0x51f0d7(0x180),'segmentName':_0x14ed7f,'activationName':_0x56d0a8[_0x51f0d7(0x144)]}),_0x4ccaed[_0x51f0d7(0xf6)]?.(_0x51f0d7(0x17b)+_0x56d0a8['name']+'\x27'),_0x5321c9[_0x51f0d7(0x175)]++);}}catch(_0x33b1dc){const _0x4685aa=isHttp400Error(_0x33b1dc),_0x5a4383=_0x4685aa?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x51f0d7(0x134)],_0x530fe1=getErrorMessage(_0x33b1dc);throw new SDKError(_0x5a4383,'Failed\x20to\x20'+_0x56d0a8[_0x51f0d7(0x19c)]+'\x20activation\x20\x27'+_0x56d0a8[_0x51f0d7(0x144)]+'\x27\x20from\x20file:\x20'+_0x492ceb+'\x0a\x20\x20'+_0x530fe1,_0x33b1dc);}}return _0x5321c9;}export async function executePushFolders(_0x2f4bc4,_0x18c2b0,_0xb7f149,_0x3ee353,_0x6afc91){const _0x37b581=a98_0x3362f0,_0x4a025d=new Map(_0xb7f149);for(const _0x224c32 of _0x18c2b0){const _0x10a8c7=_0x224c32['split']('/'),_0x1a00ab=_0x10a8c7[_0x10a8c7[_0x37b581(0x103)]-0x1],_0x262a39=_0x10a8c7[_0x37b581(0x1ab)](0x0,-0x1)['join']('/'),_0x246110=_0x4a025d['get'](_0x262a39);_0x6afc91[_0x37b581(0x1b1)]?.({'type':_0x37b581(0xdc),'folder':_0x224c32});const _0x2d69c9={'name':_0x1a00ab,'parentFolderId':_0x246110},_0x432abf=await _0x6afc91[_0x37b581(0x166)](_0x37b581(0x165)+_0x224c32+_0x37b581(0x1a0),()=>_0x2f4bc4[_0x37b581(0x116)][_0x37b581(0x184)](_0x3ee353[_0x37b581(0x142)],_0x2d69c9));_0x4a025d[_0x37b581(0x1ac)](_0x224c32,_0x432abf[_0x37b581(0x108)]['id']),_0x6afc91['onProgress']?.({'type':_0x37b581(0x17a),'folder':_0x224c32,'folderId':_0x432abf[_0x37b581(0x108)]['id']}),_0x6afc91[_0x37b581(0x177)]?.(_0x37b581(0xd4)+_0x224c32+'\x27');}return _0x4a025d;}export async function executePushSegmentDeletions(_0x4e9949,_0x320b6a,_0x1983c8){const _0x42ef3b=a98_0x3362f0;if(_0x320b6a[_0x42ef3b(0x103)]===0x0)return 0x0;const {batchAsync:_0x32f76b}=await import(_0x42ef3b(0xda)),_0x2d1145=0x5,_0x11d39e=await _0x32f76b(_0x320b6a,async _0x716ae6=>{const _0x5cdd00=_0x42ef3b;return _0x1983c8[_0x5cdd00(0x1b1)]?.({'type':_0x5cdd00(0x10d),'name':_0x716ae6[_0x5cdd00(0x144)]}),await _0x4e9949[_0x5cdd00(0x116)][_0x5cdd00(0x129)](_0x716ae6['id']),_0x1983c8[_0x5cdd00(0x1b1)]?.({'type':_0x5cdd00(0x162),'name':_0x716ae6['name']}),_0x1983c8[_0x5cdd00(0xf6)]?.(_0x5cdd00(0x13d)+_0x716ae6['name']+'\x27'),0x1;},_0x2d1145);return _0x11d39e[_0x42ef3b(0x182)]((_0x1bbf3d,_0x3b26a9)=>_0x1bbf3d+_0x3b26a9,0x0);}export async function executePushJourneys(_0x2b2b00,_0x4e0fbc,_0x4b2ba6,_0x5a4f9c,_0x2dac5a){const _0x55315c=a98_0x3362f0,{journeyDefToRequest:_0x25022a}=await import(_0x55315c(0x118)),{activationDefToCreateRequest:_0x29b47d,yamlRuleToApi:_0x195d57,validateSegmentRule:_0x54769b}=await import(_0x55315c(0xf9)),_0x305874={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0xc5f4bb=new Map(_0x4b2ba6['segmentNameToId']),_0x4c60bd=0x5;for(let _0x2540a4=0x0;_0x2540a4<_0x4e0fbc[_0x55315c(0x103)];_0x2540a4+=_0x4c60bd){const _0x18f310=_0x4e0fbc[_0x55315c(0x1ab)](_0x2540a4,_0x2540a4+_0x4c60bd),_0x3725e0=await Promise[_0x55315c(0x1a1)](_0x18f310[_0x55315c(0x188)](async _0x64c100=>{const _0xe7310d=_0x55315c;if(!_0x64c100[_0xe7310d(0x13a)]&&!_0x64c100[_0xe7310d(0x109)])return{'action':_0xe7310d(0x18e),'name':_0x64c100[_0xe7310d(0x195)][_0xe7310d(0x144)],'journeyId':_0x64c100[_0xe7310d(0x104)]?.['id']};const _0x3cc521=_0x64c100[_0xe7310d(0x172)]?_0x4b2ba6[_0xe7310d(0x161)][_0xe7310d(0xde)](_0x64c100[_0xe7310d(0x172)]):undefined;_0x2dac5a[_0xe7310d(0x1b1)]?.({'type':_0x64c100['isNew']?'journey_creating':'journey_updating','name':_0x64c100[_0xe7310d(0x195)][_0xe7310d(0x144)]});try{const _0x328497=await executeSingleJourneyPush(_0x2b2b00,_0x64c100,{..._0x4b2ba6,'segmentNameToId':_0xc5f4bb},{'parentId':_0x5a4f9c[_0xe7310d(0x142)],'rootFolderId':_0x5a4f9c['rootFolderId'],'folderId':_0x3cc521,'verbose':_0x5a4f9c[_0xe7310d(0xfd)]},_0x2dac5a,{'journeyDefToRequest':_0x25022a,'activationDefToCreateRequest':_0x29b47d,'yamlRuleToApi':_0x195d57,'validateSegmentRule':_0x54769b});for(const [_0x4ade08,_0x7ef1e5]of _0x328497[_0xe7310d(0x160)]){_0xc5f4bb[_0xe7310d(0x1ac)](_0x4ade08,_0x7ef1e5),_0x305874['embeddedSegmentNameToId'][_0xe7310d(0x1ac)](_0x4ade08,_0x7ef1e5);}if(_0x328497[_0xe7310d(0x12a)]===_0xe7310d(0x13f))_0x2dac5a['onProgress']?.({'type':_0xe7310d(0xf0),'name':_0x64c100[_0xe7310d(0x195)][_0xe7310d(0x144)],'journeyId':_0x328497[_0xe7310d(0x114)]}),_0x2dac5a[_0xe7310d(0x153)]?.('Created\x20journey\x20\x27'+_0x64c100[_0xe7310d(0x195)][_0xe7310d(0x144)]+'\x27'),_0x305874['created']++;else _0x328497[_0xe7310d(0x12a)]===_0xe7310d(0x186)&&(_0x2dac5a['onProgress']?.({'type':'journey_updated','name':_0x64c100[_0xe7310d(0x195)][_0xe7310d(0x144)]}),_0x2dac5a[_0xe7310d(0x153)]?.(_0xe7310d(0xfc)+_0x64c100['yamlConfig'][_0xe7310d(0x144)]+'\x27'),_0x305874[_0xe7310d(0x186)]++);return{'action':_0x328497[_0xe7310d(0x12a)],'name':_0x64c100[_0xe7310d(0x195)][_0xe7310d(0x144)],'journeyId':_0x328497[_0xe7310d(0x114)]};}catch(_0x49ea1c){const _0x16508b=isHttp400Error(_0x49ea1c),_0x21419e=_0x16508b?ErrorCode[_0xe7310d(0x156)]:ErrorCode[_0xe7310d(0xf2)],_0x28e865=getErrorMessage(_0x49ea1c);throw new SDKError(_0x21419e,'Failed\x20to\x20'+(_0x64c100[_0xe7310d(0x13a)]?_0xe7310d(0x179):_0xe7310d(0xe4))+'\x20journey\x20from\x20file:\x20'+_0x64c100['absolutePath']+_0xe7310d(0x117)+_0x28e865,_0x49ea1c);}}));_0x305874['results'][_0x55315c(0xd8)](..._0x3725e0);}return _0x305874;}async function executeSingleJourneyPush(_0x259b18,_0x2bd043,_0x5bbaa9,_0x5cc946,_0x1e7748,_0x2f62ee){const _0x2ed1e1=a98_0x3362f0,{journeyDefToRequest:_0x1b26a6,activationDefToCreateRequest:_0x33467d,yamlRuleToApi:_0x151cb2,validateSegmentRule:_0x527abc}=_0x2f62ee,_0x5159e3=new Map(),_0x5bf43b=new Map(),_0x41aa5f=new Map(),_0x4b0e59=new Map(),_0x52489f=new Map();let _0x3e3cdf;const _0x295b46=async()=>{const _0x4e8054=a98_0x35c3;if(_0x3e3cdf)return;_0x3e3cdf=new Map();if(!_0x2bd043[_0x4e8054(0x104)])return;const _0x49a3a3=await _0x259b18[_0x4e8054(0xd7)][_0x4e8054(0x19a)](_0x2bd043[_0x4e8054(0x104)]['id']);for(const _0x505cee of _0x49a3a3){const _0x5ea218=journeyActivationStepToYaml(_0x505cee,_0x5bbaa9[_0x4e8054(0x14c)],_0x5bbaa9[_0x4e8054(0x183)]),_0x264ba6=activationSignature(_0x5ea218);!_0x3e3cdf['has'](_0x264ba6)&&_0x3e3cdf['set'](_0x264ba6,_0x505cee['id']),_0x5ea218['name']&&_0x5bf43b[_0x4e8054(0x1ac)](_0x5ea218[_0x4e8054(0x144)],_0x505cee['id']);}};if(_0x2bd043[_0x2ed1e1(0x104)]&&_0x2bd043[_0x2ed1e1(0x195)][_0x2ed1e1(0xe7)]){const _0x7aeb99=buildLocalExpandedRuleMappings(_0x2bd043[_0x2ed1e1(0x195)]),_0x15ed64=_0x7aeb99[_0x2ed1e1(0x107)];if(_0x15ed64[_0x2ed1e1(0x126)]>0x0){const _0x583132=new Map();for(const [_0x3b7332,_0x34cdae]of _0x15ed64){const _0x2625dd=serializeExpandedRule(_0x34cdae,_0x15ed64);_0x583132['set'](_0x3b7332,_0x2625dd);}const _0xb79921=collectSegmentIdsFromJourneyApi(_0x2bd043[_0x2ed1e1(0x104)]);if(_0xb79921[_0x2ed1e1(0x126)]>0x0){const _0x289f4a=await buildServerSegmentRuleMap(_0x259b18,_0x5cc946[_0x2ed1e1(0x142)],_0x5bbaa9['existingSegments'],_0xb79921);if(_0x289f4a[_0x2ed1e1(0x126)]>0x0){const _0x5b920d=new Map();for(const [_0x4a07a0,_0x10af5d]of _0x289f4a){const _0x4d07fc=serializeExpandedRule(_0x10af5d,_0x289f4a);!_0x5b920d[_0x2ed1e1(0x1aa)](_0x4d07fc)&&_0x5b920d['set'](_0x4d07fc,_0x4a07a0);}for(const [_0x500f9b,_0x4c56b0]of _0x583132){const _0x3073a2=_0x5b920d[_0x2ed1e1(0xde)](_0x4c56b0);_0x3073a2&&(_0x52489f[_0x2ed1e1(0x1ac)](_0x500f9b,_0x3073a2),_0x5bbaa9['segmentNameToId']['set'](_0x500f9b,_0x3073a2));}}}}}const _0x56c4d4={'resolveSegmentId':async _0x324035=>{const _0x10d45d=_0x2ed1e1,_0x3d0efb=_0x5bbaa9[_0x10d45d(0x138)][_0x10d45d(0xde)](_0x324035);if(!_0x3d0efb)throw new SDKError(ErrorCode[_0x10d45d(0x18b)],'Segment\x20not\x20found:\x20'+_0x324035+_0x10d45d(0x15f)+_0x2bd043[_0x10d45d(0x195)][_0x10d45d(0x144)]+')');return _0x3d0efb;},'resolveEmbeddedSegmentId':async(_0x2656e9,_0x3d280f)=>{const _0x41ff53=_0x2ed1e1,_0x3775b2=_0x5bbaa9[_0x41ff53(0x138)][_0x41ff53(0xde)](_0x2656e9);if(_0x3775b2)return _0x3775b2;const _0x9b89de=_0x52489f[_0x41ff53(0xde)](_0x2656e9);if(_0x9b89de)return _0x5bbaa9[_0x41ff53(0x138)][_0x41ff53(0x1ac)](_0x2656e9,_0x9b89de),_0x9b89de;const _0x1a74ae=_0x5bbaa9[_0x41ff53(0xee)][_0x41ff53(0x18f)](_0x220da0=>_0x220da0[_0x41ff53(0x144)]===_0x2656e9);if(_0x1a74ae)return _0x5bbaa9[_0x41ff53(0x138)][_0x41ff53(0x1ac)](_0x2656e9,_0x1a74ae['id']),_0x1a74ae['id'];if(_0x2bd043['isNew']){const {stageName:_0x308c5e,criteriaName:_0x126ec5}=findSegmentCriteriaLocation(_0x2bd043[_0x41ff53(0x195)],_0x2656e9);return _0x527abc(_0x2656e9,_0x3d280f[_0x41ff53(0x100)]),_0x41aa5f[_0x41ff53(0x1ac)](_0x2656e9,{'definition':_0x3d280f,'stageName':_0x308c5e,'criteriaName':_0x126ec5}),createPendingSegmentId(_0x2656e9);}const _0xf43a77=_0x2bd043[_0x41ff53(0x104)]?.['id'];if(!_0xf43a77)throw new SDKError(ErrorCode[_0x41ff53(0x12d)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x527abc(_0x2656e9,_0x3d280f['rule']);const _0xf28c0=generateDeterministicJourneySegmentName(_0x2bd043[_0x41ff53(0x195)][_0x41ff53(0x144)],_0x2656e9),_0xbbc7e9=_0x5bbaa9[_0x41ff53(0xee)][_0x41ff53(0x18f)](_0x56d69a=>_0x56d69a[_0x41ff53(0x144)]===_0xf28c0),_0xe1587b=createSegmentIdResolver(_0x5bbaa9['segmentNameToId'],_0x2656e9),_0x25ca9a=await resolveRuleSegmentIds(_0x3d280f['rule'],_0xe1587b);let _0x494382;if(_0xbbc7e9)await _0x259b18[_0x41ff53(0x116)]['updateSegmentById'](_0x5cc946[_0x41ff53(0x142)],_0xbbc7e9['id'],{'description':_0x3d280f['description']||_0x41ff53(0x155)+_0x2656e9,'rule':_0x151cb2(_0x25ca9a,!![]),'countPopulation':!![]}),_0x494382=_0xbbc7e9['id'];else try{_0x494382=await _0x259b18[_0x41ff53(0x116)][_0x41ff53(0xeb)]({'name':_0xf28c0,'description':_0x3d280f[_0x41ff53(0x13c)]||_0x41ff53(0x155)+_0x2656e9,'journeyId':_0xf43a77,'rule':_0x151cb2(_0x25ca9a,!![]),'countPopulation':!![],'parentFolderId':_0x5cc946[_0x41ff53(0x15a)]||'','audienceId':_0x5cc946[_0x41ff53(0x142)]});}catch(_0x598899){const _0x497322=_0x598899 instanceof Error&&_0x598899[_0x41ff53(0x194)]['includes'](_0x41ff53(0x14a));if(_0x497322){const _0x5908ba=await _0x259b18['segment'][_0x41ff53(0x198)](_0x5cc946[_0x41ff53(0x142)]),_0x2aa4c5=_0x5908ba[_0x41ff53(0x18f)](_0x4a91f1=>_0x4a91f1[_0x41ff53(0x144)]===_0xf28c0);if(_0x2aa4c5)await _0x259b18[_0x41ff53(0x116)][_0x41ff53(0x1ae)](_0x5cc946['parentId'],_0x2aa4c5['id'],{'description':_0x3d280f[_0x41ff53(0x13c)]||_0x41ff53(0x155)+_0x2656e9,'rule':_0x151cb2(_0x25ca9a,!![]),'countPopulation':!![]}),_0x494382=_0x2aa4c5['id'];else throw _0x598899;}else throw _0x598899;}return _0x5bbaa9[_0x41ff53(0x138)][_0x41ff53(0x1ac)](_0x2656e9,_0x494382),_0x5159e3[_0x41ff53(0x1ac)](_0x2656e9,_0x494382),_0x494382;},'resolveActivationId':async _0x47dd83=>{const _0x3b68b9=_0x2ed1e1,_0x2c1d13=_0x5bf43b[_0x3b68b9(0xde)](_0x47dd83);if(_0x2c1d13)return _0x2c1d13;if(_0x2bd043[_0x3b68b9(0x104)]){await _0x295b46();const _0x2b8f85=_0x5bf43b[_0x3b68b9(0xde)](_0x47dd83);if(_0x2b8f85)return _0x2b8f85;}throw new SDKError(ErrorCode[_0x3b68b9(0xdf)],_0x3b68b9(0x197)+_0x47dd83+_0x3b68b9(0x15f)+_0x2bd043[_0x3b68b9(0x195)]['name']+_0x3b68b9(0x139)+_0x3b68b9(0x174));},'resolveEmbeddedActivationId':async(_0x80b4b4,_0x434409)=>{const _0x56a11e=_0x2ed1e1,_0x160bad=_0x5bf43b['get'](_0x80b4b4);if(_0x160bad)return _0x160bad;if(_0x2bd043[_0x56a11e(0x13a)])return _0x4b0e59[_0x56a11e(0x1ac)](_0x80b4b4,_0x434409),createPendingActivationId(_0x80b4b4);if(_0x2bd043[_0x56a11e(0x104)]){await _0x295b46();const _0x4ea935=_0x5bf43b[_0x56a11e(0xde)](_0x434409[_0x56a11e(0x144)]);if(_0x4ea935)return _0x5bf43b[_0x56a11e(0x1ac)](_0x80b4b4,_0x4ea935),_0x4ea935;const _0x400744=activationSignature(_0x434409),_0x3af62a=_0x3e3cdf?.[_0x56a11e(0xde)](_0x400744);if(_0x3af62a)return _0x5bf43b['set'](_0x80b4b4,_0x3af62a),_0x3af62a;const _0x32adc6=await _0x33467d(_0x434409,_0x5bbaa9[_0x56a11e(0x12f)]),_0x2bf55e=await _0x259b18['journey'][_0x56a11e(0xd3)](_0x2bd043['existingJourney']['id'],_0x32adc6);return _0x5bf43b[_0x56a11e(0x1ac)](_0x80b4b4,_0x2bf55e['id']),_0x2bf55e['id'];}throw new SDKError(ErrorCode[_0x56a11e(0x12d)],_0x56a11e(0xd5));},'resolveJourneyId':async _0x2af0c0=>{const _0x41de7b=_0x2ed1e1;try{return await _0x259b18[_0x41de7b(0xd7)][_0x41de7b(0xf3)](_0x5cc946['parentId'],_0x2af0c0);}catch(_0x24bd27){throw new SDKError(ErrorCode['NOT_FOUND'],_0x41de7b(0x15e)+_0x2af0c0+_0x41de7b(0x10a)+_0x2bd043[_0x41de7b(0x195)]['name']+'\x27)',_0x24bd27);}},'resolveStageId':async(_0x3971e9,_0x2f7a10)=>{const _0x126ec6=_0x2ed1e1,_0x202bfb=await _0x259b18[_0x126ec6(0xd7)][_0x126ec6(0x11d)](_0x3971e9),_0x47cf3b=_0x202bfb[_0x126ec6(0x110)]['journeyStages'][_0x126ec6(0x18f)](_0x214d68=>_0x214d68[_0x126ec6(0x144)][_0x126ec6(0x106)]()===_0x2f7a10[_0x126ec6(0x106)]());if(!_0x47cf3b?.['id'])throw new SDKError(ErrorCode[_0x126ec6(0xdf)],'Stage\x20\x27'+_0x2f7a10+_0x126ec6(0x12b)+(_0x202bfb[_0x126ec6(0x110)][_0x126ec6(0xe9)]||_0x202bfb[_0x126ec6(0x110)][_0x126ec6(0x144)])+'\x27');return _0x47cf3b['id'];}},_0x55b780=await _0x1b26a6(_0x2bd043['yamlConfig'],_0x5cc946[_0x2ed1e1(0x142)],_0x56c4d4),_0x1887a7=_0x5cc946[_0x2ed1e1(0xe6)]||_0x5cc946[_0x2ed1e1(0x15a)];_0x1887a7&&(_0x55b780['relationships']={'parentFolder':{'data':{'id':_0x1887a7,'type':'folder'}}});if(_0x2bd043[_0x2ed1e1(0x13a)]){if(_0x41aa5f[_0x2ed1e1(0x126)]>0x0||_0x4b0e59[_0x2ed1e1(0x126)]>0x0)return await executeThreeStepJourneyCreate(_0x259b18,_0x2bd043,_0x55b780,{'pendingEmbeddedSegments':_0x41aa5f,'pendingEmbeddedActivations':_0x4b0e59,'embeddedSegmentNameToId':_0x5159e3,'journeyActivationNameToId':_0x5bf43b},{..._0x5cc946,'effectiveFolderId':_0x1887a7},_0x5bbaa9,_0x1e7748,_0x2f62ee);else{ensureJourneyDefaults(_0x55b780[_0x2ed1e1(0x110)]);const _0x22e14f=await _0x259b18['journey'][_0x2ed1e1(0x179)](_0x55b780);return{'action':_0x2ed1e1(0x13f),'journeyId':_0x22e14f['id'],'embeddedSegmentNameToId':_0x5159e3};}}else{if(_0x2bd043['hasChanges']&&_0x2bd043[_0x2ed1e1(0x104)])return ensureJourneyDefaults(_0x55b780[_0x2ed1e1(0x110)]),await _0x259b18[_0x2ed1e1(0xd7)][_0x2ed1e1(0xe4)](_0x2bd043['existingJourney']['id'],_0x55b780),{'action':'updated','journeyId':_0x2bd043[_0x2ed1e1(0x104)]['id'],'embeddedSegmentNameToId':_0x5159e3};}return{'action':_0x2ed1e1(0x18e),'journeyId':_0x2bd043[_0x2ed1e1(0x104)]?.['id'],'embeddedSegmentNameToId':_0x5159e3};}function findSegmentCriteriaLocation(_0x19c141,_0x42f967){const _0x1461f5=a98_0x3362f0,_0x26d542=_0x19c141['stages']||_0x19c141[_0x1461f5(0x17f)]?.[0x0]?.[_0x1461f5(0x10e)]||[];let _0x3963d9=_0x1461f5(0xdb),_0x22c284=_0x42f967;const _0x5d2804=_0x19c141[_0x1461f5(0x176)]||_0x19c141[_0x1461f5(0x17f)]?.[0x0]?.['goal'];if(_0x5d2804?.[_0x1461f5(0x116)]===_0x42f967)return{'stageName':_0x1461f5(0x176),'criteriaName':_0x5d2804[_0x1461f5(0x144)]||_0x42f967};_0x3af6a2:for(const _0x1eaf29 of _0x26d542){if(_0x1eaf29['entry_criteria']?.['segment']===_0x42f967){_0x3963d9=_0x1eaf29[_0x1461f5(0x144)],_0x22c284=_0x1eaf29[_0x1461f5(0x169)][_0x1461f5(0x144)]||_0x42f967;break;}if(_0x1eaf29['steps'])for(const _0x288d9d of _0x1eaf29[_0x1461f5(0x1a9)]){if(_0x288d9d[_0x1461f5(0x19c)]===_0x1461f5(0xe5)&&_0x288d9d[_0x1461f5(0xed)]?.[_0x1461f5(0xe8)])for(const _0x3775db of _0x288d9d[_0x1461f5(0xed)][_0x1461f5(0xe8)]){if(_0x3775db[_0x1461f5(0x116)]===_0x42f967){_0x3963d9=_0x1eaf29[_0x1461f5(0x144)],_0x22c284=_0x3775db[_0x1461f5(0x144)]||_0x42f967;break _0x3af6a2;}}}}return{'stageName':_0x3963d9,'criteriaName':_0x22c284};}async function executeThreeStepJourneyCreate(_0x608c75,_0x5eaa92,_0x3af3a9,_0x123234,_0x15d7b4,_0x508eeb,_0xeac54,_0x294044){const _0x3bf2f2=a98_0x3362f0,{activationDefToCreateRequest:_0x427134,yamlRuleToApi:_0x50fa32}=_0x294044,{pendingEmbeddedSegments:_0x2f22ea,pendingEmbeddedActivations:_0x599d19,embeddedSegmentNameToId:_0x33eeb2}=_0x123234,_0x4083de=JSON[_0x3bf2f2(0xf5)](JSON[_0x3bf2f2(0x140)](_0x3af3a9));ensureJourneyDefaults(_0x4083de['attributes']),stripPendingIds(_0x4083de);const _0x36babd=await _0x608c75[_0x3bf2f2(0xd7)][_0x3bf2f2(0x179)](_0x4083de),_0x2faceb=_0x36babd['id'],_0xc948c5=new Map();for(const _0x593a07 of _0x36babd['attributes'][_0x3bf2f2(0x10b)]){_0xc948c5['set'](_0x593a07[_0x3bf2f2(0x144)][_0x3bf2f2(0x106)](),_0x593a07['id']);}for(const [_0x5532b8,{definition:_0x28d3ed}]of _0x2f22ea){const _0x1a0adf=generateDeterministicJourneySegmentName(_0x5eaa92[_0x3bf2f2(0x195)][_0x3bf2f2(0x144)],_0x5532b8);_0xeac54[_0x3bf2f2(0x1b1)]?.({'type':_0x3bf2f2(0xe2),'journeyName':_0x5eaa92[_0x3bf2f2(0x195)][_0x3bf2f2(0x144)],'segmentName':_0x5532b8});const _0x3303fa=createSegmentIdResolver(_0x508eeb[_0x3bf2f2(0x138)],_0x5532b8),_0x1dc17c=await resolveRuleSegmentIds(_0x28d3ed['rule'],_0x3303fa),_0x3d2dd7=await _0x608c75[_0x3bf2f2(0x116)][_0x3bf2f2(0xeb)]({'name':_0x1a0adf,'description':_0x28d3ed[_0x3bf2f2(0x13c)]||_0x3bf2f2(0x155)+_0x5532b8,'journeyId':_0x2faceb,'rule':_0x50fa32(_0x1dc17c,!![]),'countPopulation':!![],'parentFolderId':_0x15d7b4[_0x3bf2f2(0x12c)]||'','audienceId':_0x15d7b4['parentId']});_0x33eeb2[_0x3bf2f2(0x1ac)](_0x5532b8,_0x3d2dd7),_0x508eeb[_0x3bf2f2(0x138)][_0x3bf2f2(0x1ac)](_0x5532b8,_0x3d2dd7),_0xeac54[_0x3bf2f2(0x1b1)]?.({'type':_0x3bf2f2(0x152),'journeyName':_0x5eaa92[_0x3bf2f2(0x195)][_0x3bf2f2(0x144)],'segmentName':_0x5532b8});}const _0x199523=new Map();for(const [_0x151929,_0x2363fd]of _0x599d19){_0xeac54['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x5eaa92[_0x3bf2f2(0x195)][_0x3bf2f2(0x144)],'activationName':_0x151929});const _0x4b27fd=await _0x427134(_0x2363fd,_0x508eeb[_0x3bf2f2(0x12f)]),_0x7d2244=await _0x608c75[_0x3bf2f2(0xd7)][_0x3bf2f2(0xd3)](_0x2faceb,_0x4b27fd);_0x199523[_0x3bf2f2(0x1ac)](_0x151929,_0x7d2244['id']),_0x123234[_0x3bf2f2(0x1a7)][_0x3bf2f2(0x1ac)](_0x151929,_0x7d2244['id']),_0xeac54[_0x3bf2f2(0x1b1)]?.({'type':'embedded_activation_created','journeyName':_0x5eaa92['yamlConfig'][_0x3bf2f2(0x144)],'activationName':_0x151929});}const _0x370d13=JSON[_0x3bf2f2(0xf5)](JSON[_0x3bf2f2(0x140)](_0x3af3a9));return _0x370d13['id']=_0x2faceb,ensureJourneyDefaults(_0x370d13[_0x3bf2f2(0x110)]),resolvePendingIdsInRequest(_0x370d13,_0x3af3a9,_0xc948c5,_0x33eeb2,_0x199523,_0xeac54),await _0x608c75[_0x3bf2f2(0xd7)]['update'](_0x2faceb,_0x370d13),{'action':_0x3bf2f2(0x13f),'journeyId':_0x2faceb,'embeddedSegmentNameToId':_0x33eeb2};}function stripPendingIds(_0x531b49){const _0x258707=a98_0x3362f0;for(const _0x4654bf of _0x531b49[_0x258707(0x110)][_0x258707(0x10b)]||[]){_0x4654bf[_0x258707(0x146)]?.[_0x258707(0x147)]&&isPendingSegmentId(_0x4654bf[_0x258707(0x146)]['segmentId'])&&delete _0x4654bf['entryCriteria'];if(_0x4654bf[_0x258707(0x1a9)])for(const _0x24982f of Object[_0x258707(0x148)](_0x4654bf['steps'])){const _0x41a426=_0x4654bf[_0x258707(0x1a9)][_0x24982f];_0x41a426[_0x258707(0x19c)]===_0x258707(0x127)&&_0x41a426[_0x258707(0x143)]&&isPendingActivationId(_0x41a426[_0x258707(0x143)])&&(_0x41a426[_0x258707(0x143)]='');if(_0x41a426[_0x258707(0x19c)]===_0x258707(0x13b)&&_0x41a426['branches'])for(const _0x4df508 of _0x41a426[_0x258707(0xe8)]){_0x4df508[_0x258707(0x147)]&&isPendingSegmentId(_0x4df508[_0x258707(0x147)])&&(_0x4df508['segmentId']='');}}}}function resolvePendingIdsInRequest(_0x585b6d,_0x1b9c9e,_0x5aa402,_0x477e57,_0x317fa2,_0x21f701){const _0xd618ff=a98_0x3362f0,_0x6b3f9f=(_0x465acb,_0xa0b49d)=>{const _0x2acd52=a98_0x35c3;if(!isPendingSegmentId(_0x465acb))return _0x465acb;const _0x51744c=extractPendingSegmentName(_0x465acb),_0x4bc058=_0x477e57[_0x2acd52(0xde)](_0x51744c);return!_0x4bc058&&_0x21f701[_0x2acd52(0x173)]?.(_0x2acd52(0x18a)+_0x51744c+'\x27\x20for\x20'+_0xa0b49d),_0x4bc058;};if(_0x585b6d[_0xd618ff(0x110)][_0xd618ff(0x176)]?.[_0xd618ff(0x147)]&&isPendingSegmentId(_0x585b6d['attributes'][_0xd618ff(0x176)]['segmentId'])){const _0x5d533a=_0x6b3f9f(_0x585b6d[_0xd618ff(0x110)]['goal']['segmentId'],_0xd618ff(0xf1));_0x5d533a&&(_0x585b6d[_0xd618ff(0x110)][_0xd618ff(0x176)][_0xd618ff(0x147)]=_0x5d533a);}for(const _0x1bf2bc of _0x585b6d[_0xd618ff(0x110)]['journeyStages']||[]){const _0x4d4937=_0x5aa402[_0xd618ff(0xde)](_0x1bf2bc['name'][_0xd618ff(0x106)]());_0x4d4937&&(_0x1bf2bc['id']=_0x4d4937);if(_0x1bf2bc[_0xd618ff(0x146)]?.[_0xd618ff(0x147)]&&isPendingSegmentId(_0x1bf2bc['entryCriteria']['segmentId'])){const _0x1b52c0=_0x6b3f9f(_0x1bf2bc[_0xd618ff(0x146)]['segmentId'],_0xd618ff(0x19e)+_0x1bf2bc[_0xd618ff(0x144)]+'\x27\x20entry\x20criteria');_0x1b52c0&&(_0x1bf2bc[_0xd618ff(0x146)][_0xd618ff(0x147)]=_0x1b52c0);}if(_0x1bf2bc[_0xd618ff(0x154)])for(const _0x4b4ddb of _0x1bf2bc[_0xd618ff(0x154)]){if(_0x4b4ddb['segmentId']&&isPendingSegmentId(_0x4b4ddb[_0xd618ff(0x147)])){const _0x65aaca=_0x6b3f9f(_0x4b4ddb[_0xd618ff(0x147)],_0xd618ff(0x19e)+_0x1bf2bc[_0xd618ff(0x144)]+_0xd618ff(0x149));_0x65aaca&&(_0x4b4ddb[_0xd618ff(0x147)]=_0x65aaca);}}if(_0x1bf2bc[_0xd618ff(0x167)]?.[_0xd618ff(0x147)]&&isPendingSegmentId(_0x1bf2bc[_0xd618ff(0x167)][_0xd618ff(0x147)])){const _0x4da1b7=_0x6b3f9f(_0x1bf2bc['milestone'][_0xd618ff(0x147)],_0xd618ff(0x19e)+_0x1bf2bc[_0xd618ff(0x144)]+'\x27\x20milestone');_0x4da1b7&&(_0x1bf2bc['milestone'][_0xd618ff(0x147)]=_0x4da1b7);}if(_0x1bf2bc['steps']){const _0x42a28e=_0x5d2249=>_0x1b9c9e[_0xd618ff(0x110)]['journeyStages']['find'](_0x56c5e3=>_0x56c5e3[_0xd618ff(0x144)][_0xd618ff(0x106)]()===_0x1bf2bc[_0xd618ff(0x144)]['toLowerCase']())?.['steps']?.[_0x5d2249];for(const _0xa19cf5 of Object[_0xd618ff(0x148)](_0x1bf2bc[_0xd618ff(0x1a9)])){const _0x2ee68b=_0x1bf2bc[_0xd618ff(0x1a9)][_0xa19cf5],_0x2d980e=_0x42a28e(_0xa19cf5);if(_0x2ee68b[_0xd618ff(0x19c)]===_0xd618ff(0x127)&&_0x2ee68b['journeyActivationStepId']&&(isPendingActivationId(_0x2ee68b[_0xd618ff(0x143)])||_0x2ee68b[_0xd618ff(0x143)]==='')){if(_0x2d980e?.[_0xd618ff(0x143)]&&isPendingActivationId(_0x2d980e['journeyActivationStepId'])){const _0x240322=extractPendingActivationName(_0x2d980e[_0xd618ff(0x143)]),_0x4019e0=_0x317fa2[_0xd618ff(0xde)](_0x240322);_0x4019e0&&(_0x2ee68b[_0xd618ff(0x143)]=_0x4019e0);}}if(_0x2ee68b[_0xd618ff(0x19c)]==='DecisionPoint'&&_0x2ee68b['branches']&&_0x2d980e?.[_0xd618ff(0xe8)])for(let _0x1ae883=0x0;_0x1ae883<_0x2ee68b[_0xd618ff(0xe8)][_0xd618ff(0x103)];_0x1ae883++){const _0x51a9ad=_0x2ee68b['branches'][_0x1ae883],_0x10a75f=_0x2d980e[_0xd618ff(0xe8)][_0x1ae883];if(_0x10a75f?.[_0xd618ff(0x147)]&&isPendingSegmentId(_0x10a75f[_0xd618ff(0x147)])){const _0x3f036e=_0x6b3f9f(_0x10a75f[_0xd618ff(0x147)],_0xd618ff(0x19e)+_0x1bf2bc[_0xd618ff(0x144)]+_0xd618ff(0x124)+(_0x51a9ad[_0xd618ff(0x144)]||_0x1ae883)+'\x27');_0x3f036e&&(_0x51a9ad[_0xd618ff(0x147)]=_0x3f036e);}}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x307912,_0x5f2069){const _0x4aeceb=a99_0x20e5,_0xb7c1be=_0x307912();while(!![]){try{const _0x2abc3c=parseInt(_0x4aeceb(0xc6))/0x1+parseInt(_0x4aeceb(0xc7))/0x2*(parseInt(_0x4aeceb(0xc5))/0x3)+parseInt(_0x4aeceb(0xc1))/0x4+-parseInt(_0x4aeceb(0xbd))/0x5*(-parseInt(_0x4aeceb(0xc8))/0x6)+parseInt(_0x4aeceb(0xc2))/0x7*(-parseInt(_0x4aeceb(0xbe))/0x8)+-parseInt(_0x4aeceb(0xbb))/0x9*(-parseInt(_0x4aeceb(0xc0))/0xa)+-parseInt(_0x4aeceb(0xba))/0xb;if(_0x2abc3c===_0x5f2069)break;else _0xb7c1be['push'](_0xb7c1be['shift']());}catch(_0x5c7728){_0xb7c1be['push'](_0xb7c1be['shift']());}}}(a99_0x36c1,0xe1848));export function buildFolderIdToPathMap(_0x5db7f8){const _0x2fab6e=a99_0x20e5,_0x2cfa1f=new Map(),_0x5535d9=new Map();for(const _0x3ffe4b of _0x5db7f8){_0x5535d9[_0x2fab6e(0xc4)](_0x3ffe4b['id'],_0x3ffe4b);}const _0x32a8f5=new Set();for(const _0x5b8ac9 of _0x5db7f8){!_0x5b8ac9['parentFolderId']&&_0x32a8f5['add'](_0x5b8ac9['id']);}function _0x15f5e5(_0x50ea17){const _0x43bdfd=_0x2fab6e;if(_0x2cfa1f['has'](_0x50ea17['id']))return _0x2cfa1f[_0x43bdfd(0xc9)](_0x50ea17['id']);if(_0x32a8f5[_0x43bdfd(0xbf)](_0x50ea17['id']))return _0x2cfa1f[_0x43bdfd(0xc4)](_0x50ea17['id'],''),'';if(_0x50ea17[_0x43bdfd(0xca)]){const _0x12c7d1=_0x5535d9[_0x43bdfd(0xc9)](_0x50ea17[_0x43bdfd(0xca)]);if(_0x12c7d1){const _0x751c0f=_0x15f5e5(_0x12c7d1),_0x5bb4eb=_0x751c0f?_0x751c0f+'/'+_0x50ea17['name']:_0x50ea17[_0x43bdfd(0xc3)];return _0x2cfa1f[_0x43bdfd(0xc4)](_0x50ea17['id'],_0x5bb4eb),_0x5bb4eb;}}const _0x4ea089=_0x50ea17['name'];return _0x2cfa1f[_0x43bdfd(0xc4)](_0x50ea17['id'],_0x4ea089),_0x4ea089;}for(const _0x1622b3 of _0x5db7f8){_0x15f5e5(_0x1622b3);}return _0x2cfa1f;}function a99_0x36c1(){const _0x1992a1=['380QiJhdf','6361596DzIgbI','6503eebqFx','name','set','9esqpSR','1606302vczWlZ','187986OtoEFv','741726lGRHdG','get','parentFolderId','55956978AeXAAV','221931wSfcoH','add','65BlfvWv','104ZBFdoU','has'];a99_0x36c1=function(){return _0x1992a1;};return a99_0x36c1();}export function buildFolderPathToIdMap(_0x3749d4){const _0x94946d=a99_0x20e5,_0x528e62=new Map(),_0x421582=new Map();for(const _0xb8629b of _0x3749d4){_0x421582['set'](_0xb8629b['id'],_0xb8629b);}const _0x2ac9ca=new Set();for(const _0x12d8cd of _0x3749d4){!_0x12d8cd[_0x94946d(0xca)]&&_0x2ac9ca[_0x94946d(0xbc)](_0x12d8cd['id']);}function _0x5115ca(_0x3a3349){const _0x2f1588=_0x94946d;if(_0x2ac9ca[_0x2f1588(0xbf)](_0x3a3349['id']))return'';if(_0x3a3349[_0x2f1588(0xca)]){const _0x1ce36d=_0x421582[_0x2f1588(0xc9)](_0x3a3349[_0x2f1588(0xca)]);if(_0x1ce36d){const _0x1f1287=_0x5115ca(_0x1ce36d);return _0x1f1287?_0x1f1287+'/'+_0x3a3349[_0x2f1588(0xc3)]:_0x3a3349['name'];}}return _0x3a3349[_0x2f1588(0xc3)];}for(const _0x30e5dd of _0x3749d4){const _0x4cf35e=_0x5115ca(_0x30e5dd);_0x528e62[_0x94946d(0xc4)](_0x4cf35e,_0x30e5dd['id']);}return _0x528e62;}function a99_0x20e5(_0x4098f2,_0x180df6){_0x4098f2=_0x4098f2-0xba;const _0x36c1e0=a99_0x36c1();let _0x20e535=_0x36c1e0[_0x4098f2];return _0x20e535;}export function buildFolderMaps(_0x3c3905){const _0x5ce9d8=a99_0x20e5,_0x192b04=buildFolderIdToPathMap(_0x3c3905),_0x2728cb=new Map();for(const [_0x123455,_0x49c365]of _0x192b04){_0x2728cb[_0x5ce9d8(0xc4)](_0x49c365,_0x123455);}return{'idToPath':_0x192b04,'pathToId':_0x2728cb};}export function getFolderPath(_0x3026ad,_0x16b776){const _0x5c6122=a99_0x20e5;if(!_0x3026ad)return'';return _0x16b776[_0x5c6122(0xc9)](_0x3026ad)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5ad5a1,_0x506940){const _0x4bf25a=a100_0x5e34,_0x56f2fe=_0x5ad5a1();while(!![]){try{const _0x5413a0=parseInt(_0x4bf25a(0x1cb))/0x1+-parseInt(_0x4bf25a(0x1b5))/0x2+parseInt(_0x4bf25a(0x1c8))/0x3+-parseInt(_0x4bf25a(0x1a9))/0x4+parseInt(_0x4bf25a(0x1b6))/0x5*(parseInt(_0x4bf25a(0x1c1))/0x6)+parseInt(_0x4bf25a(0x1ba))/0x7+-parseInt(_0x4bf25a(0x1aa))/0x8;if(_0x5413a0===_0x506940)break;else _0x56f2fe['push'](_0x56f2fe['shift']());}catch(_0xd5c2ae){_0x56f2fe['push'](_0x56f2fe['shift']());}}}(a100_0x1b2d,0xf36a1));import a100_0x354a1f from'path';import{parse as a100_0x2d1794}from'yaml';function a100_0x1b2d(){const _0x48f0cb=['Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','parent_segment','tdx.json','split','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','6jRRhcO','segments','name','File\x20not\x20found:\x20','substring','Path\x20attempts\x20to\x20navigate\x20above\x20root','startsWith','1944171NJJOLI','endsWith','exists','580117lfbUht','raw','segment','resolve','relative','No\x20tdx.json\x20found\x20for\x20file:\x20','length','join','isAbsolute','2262844Brpiho','6722264FdWPJQ','root','readFile','.yaml','Cannot\x20split\x20empty\x20path','Cannot\x20navigate\x20above\x20root','dirname','pop','.yml','type','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','899726AlHzEq','114925JDaHIV','push','parse','Relative\x20path\x20cannot\x20be\x20empty','11212061dotuEe','trim'];a100_0x1b2d=function(){return _0x48f0cb;};return a100_0x1b2d();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0xac7ead){const _0x283213=a100_0x5e34;if(!_0xac7ead||_0xac7ead[_0x283213(0x1bb)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x59094e=_0xac7ead[_0x283213(0x1bb)]();if(_0x59094e==='/')return{'segments':[],'isAbsolute':!![],'raw':_0xac7ead};const _0x57f46f=_0x59094e['startsWith']('/')?_0x59094e[_0x283213(0x1c5)](0x1):_0x59094e,_0xb035fb=_0x57f46f[_0x283213(0x1bf)]('/')['filter'](_0x5af53e=>_0x5af53e!=='');if(_0xb035fb['length']===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x277284=_0x59094e[_0x283213(0x1c7)]('/')||!isRelativePathSegment(_0xb035fb[0x0]);for(const _0x399da1 of _0xb035fb){validatePathSegment(_0x399da1);}return{'segments':_0xb035fb,'isAbsolute':_0x277284,'raw':_0xac7ead};}function isRelativePathSegment(_0x27c951){return _0x27c951==='.'||_0x27c951==='..';}function a100_0x5e34(_0x2e0f23,_0x349051){_0x2e0f23=_0x2e0f23-0x1a4;const _0x1b2d11=a100_0x1b2d();let _0x5e34b5=_0x1b2d11[_0x2e0f23];return _0x5e34b5;}function validatePathSegment(_0x3b3118){const _0x289a5e=a100_0x5e34;if(_0x3b3118==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x3b3118==='.'||_0x3b3118==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x3b3118))throw new Error(_0x289a5e(0x1bc)+_0x3b3118);if(_0x3b3118!==_0x3b3118['trim']()){}}export function validatePath(_0x34f51b){const _0x209211=a100_0x5e34;if(_0x34f51b[_0x209211(0x1c2)][_0x209211(0x1a6)]===0x0&&!_0x34f51b['isAbsolute'])throw new Error(_0x209211(0x1b9));if(_0x34f51b[_0x209211(0x1a8)]){if(_0x34f51b[_0x209211(0x1c2)][0x0]==='..')throw new Error(_0x209211(0x1c0));let _0x2f1304=0x0;for(const _0x269a05 of _0x34f51b['segments']){if(_0x269a05==='..'){if(_0x2f1304===0x0)throw new Error(_0x209211(0x1c6));_0x2f1304--;}else _0x269a05!=='.'&&_0x2f1304++;}}}export function joinPaths(_0xa6921a,_0x2ae2fc){const _0x23afdc=a100_0x5e34;if(!_0xa6921a||_0xa6921a==='/')return _0x2ae2fc;if(!_0x2ae2fc||_0x2ae2fc==='.')return _0xa6921a;if(_0x2ae2fc['startsWith']('/'))return _0x2ae2fc;const _0xe1bbcb=parsePath(_0xa6921a),_0x5e125c=parsePath(_0x2ae2fc),_0xf1440b=[..._0xe1bbcb[_0x23afdc(0x1c2)]];for(const _0x1320a2 of _0x5e125c['segments']){if(_0x1320a2==='.')continue;else{if(_0x1320a2==='..'){if(_0xf1440b[_0x23afdc(0x1a6)]===0x0)throw new Error(_0x23afdc(0x1af));_0xf1440b[_0x23afdc(0x1b1)]();}else _0xf1440b[_0x23afdc(0x1b7)](_0x1320a2);}}const _0x181f5b=_0xf1440b[_0x23afdc(0x1a7)]('/');return _0xe1bbcb[_0x23afdc(0x1cc)][_0x23afdc(0x1c7)]('/')?'/'+_0x181f5b:_0x181f5b;}export function normalizePath(_0x2e5213){const _0x8760b6=a100_0x5e34,_0x274bb5=parsePath(_0x2e5213),_0x4b9b4b=[];for(const _0x578b8f of _0x274bb5['segments']){if(_0x578b8f==='.')continue;else{if(_0x578b8f==='..'){if(_0x4b9b4b[_0x8760b6(0x1a6)]===0x0){if(_0x274bb5['isAbsolute'])throw new Error(_0x8760b6(0x1af));_0x4b9b4b[_0x8760b6(0x1b7)]('..');}else _0x4b9b4b[_0x4b9b4b['length']-0x1]==='..'?_0x4b9b4b[_0x8760b6(0x1b7)]('..'):_0x4b9b4b[_0x8760b6(0x1b1)]();}else _0x4b9b4b[_0x8760b6(0x1b7)](_0x578b8f);}}if(_0x4b9b4b['length']===0x0)return _0x274bb5['isAbsolute']?'/':'.';const _0x120ebc=_0x4b9b4b['join']('/');return _0x274bb5[_0x8760b6(0x1cc)][_0x8760b6(0x1c7)]('/')?'/'+_0x120ebc:_0x120ebc;}export function getParentPath(_0x107d25){const _0x17f42a=a100_0x5e34,_0x1d871e=parsePath(_0x107d25);if(_0x1d871e['segments'][_0x17f42a(0x1a6)]<=0x1)return'/';const _0x37d3f7=_0x1d871e[_0x17f42a(0x1c2)]['slice'](0x0,-0x1)['join']('/');return _0x1d871e[_0x17f42a(0x1cc)]['startsWith']('/')?'/'+_0x37d3f7:_0x37d3f7;}export function getBaseName(_0x3e8f92){const _0x2a1e9a=a100_0x5e34,_0x4a7ad8=parsePath(_0x3e8f92);return _0x4a7ad8[_0x2a1e9a(0x1c2)][_0x4a7ad8[_0x2a1e9a(0x1c2)][_0x2a1e9a(0x1a6)]-0x1]||'';}export function isChildPath(_0x1a402b,_0x4a5294){const _0x168372=a100_0x5e34,_0x58d64c=parsePath(_0x1a402b),_0x1bc971=parsePath(_0x4a5294);if(_0x58d64c[_0x168372(0x1c2)][_0x168372(0x1a6)]<=_0x1bc971[_0x168372(0x1c2)][_0x168372(0x1a6)])return![];for(let _0x35d83d=0x0;_0x35d83d<_0x1bc971[_0x168372(0x1c2)][_0x168372(0x1a6)];_0x35d83d++){if(_0x58d64c[_0x168372(0x1c2)][_0x35d83d]!==_0x1bc971[_0x168372(0x1c2)][_0x35d83d])return![];}return!![];}export function splitPath(_0x46e717){const _0x206c02=a100_0x5e34,_0x48fe64=parsePath(_0x46e717);if(_0x48fe64[_0x206c02(0x1c2)][_0x206c02(0x1a6)]===0x0)throw new Error(_0x206c02(0x1ae));if(_0x48fe64[_0x206c02(0x1c2)][_0x206c02(0x1a6)]===0x1)return{'parent':_0x48fe64[_0x206c02(0x1c2)][0x0]};return{'parent':_0x48fe64[_0x206c02(0x1c2)][0x0],'child':_0x48fe64['segments']['slice'](0x1)[_0x206c02(0x1a7)]('/')};}export function isYamlFilePath(_0x10a471){const _0x435903=a100_0x5e34;return _0x10a471[_0x435903(0x1c9)](_0x435903(0x1b2))||_0x10a471[_0x435903(0x1c9)](_0x435903(0x1ad));}export async function resolveYamlFilePath(_0x373d39,_0x473de0=nodeFileSystem){const _0x38409f=a100_0x5e34,_0x4a732b=a100_0x354a1f[_0x38409f(0x1ce)](_0x373d39);if(!await _0x473de0['exists'](_0x4a732b))throw new Error(_0x38409f(0x1c4)+_0x373d39);let _0x593382=a100_0x354a1f['dirname'](_0x4a732b),_0x36727c=null,_0x4074ec=null;const _0x33af4d=a100_0x354a1f['parse'](_0x593382)[_0x38409f(0x1ab)];while(_0x593382!==_0x33af4d){const _0x2eff50=a100_0x354a1f[_0x38409f(0x1a7)](_0x593382,_0x38409f(0x1be));if(await _0x473de0[_0x38409f(0x1ca)](_0x2eff50)){_0x36727c=_0x2eff50,_0x4074ec=_0x593382;break;}_0x593382=a100_0x354a1f['dirname'](_0x593382);}if(!_0x36727c||!_0x4074ec)throw new Error(_0x38409f(0x1a5)+_0x373d39);const _0x980c42=await _0x473de0[_0x38409f(0x1ac)](_0x36727c),_0x332914=JSON[_0x38409f(0x1b8)](_0x980c42),_0x534ee=_0x332914[_0x38409f(0x1bd)];if(!_0x534ee)throw new Error(_0x38409f(0x1b4));const _0xe8ba8d=await _0x473de0['readFile'](_0x4a732b),_0x429919=a100_0x2d1794(_0xe8ba8d),_0xcbe0b2=_0x429919[_0x38409f(0x1c3)];if(!_0xcbe0b2)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x373d39);const _0x5307df=_0x429919[_0x38409f(0x1b3)]==='journey'?'journey':_0x38409f(0x1cd),_0x49d2a9=a100_0x354a1f[_0x38409f(0x1a4)](_0x4074ec,_0x4a732b),_0x37261=a100_0x354a1f[_0x38409f(0x1b0)](_0x49d2a9),_0xec60a6=_0x37261==='.'?'':_0x37261['replace'](/\\/g,'/'),_0x45e0a6=_0xec60a6?_0x534ee+'/'+_0xec60a6+'/'+_0xcbe0b2:_0x534ee+'/'+_0xcbe0b2;return{'parentSegment':_0x534ee,'segmentName':_0xcbe0b2,'folderPath':_0xec60a6,'fullPath':_0x45e0a6,'resourceType':_0x5307df};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a101_0x4b49(){const _0x4a1051=['Invalid\x20segment\x20reference\x20format:\x20','.\x20Child\x20name\x20cannot\x20be\x20empty','182LUrDrY','12088dfygMb','92214RPEHBI','1878432kLBeXh','substring','2182540PtyTMe','33720RoqRVw','1506070RsDFZq','207VXVJBy','indexOf','423754dleObb','.\x20Parent\x20name\x20cannot\x20be\x20empty','6FySuIj'];a101_0x4b49=function(){return _0x4a1051;};return a101_0x4b49();}(function(_0x28a5e8,_0x1d808a){const _0x220600=a101_0x12b1,_0x22afd5=_0x28a5e8();while(!![]){try{const _0x346f0c=-parseInt(_0x220600(0x12e))/0x1+parseInt(_0x220600(0x127))/0x2*(parseInt(_0x220600(0x129))/0x3)+-parseInt(_0x220600(0x12f))/0x4+parseInt(_0x220600(0x131))/0x5+-parseInt(_0x220600(0x132))/0x6*(-parseInt(_0x220600(0x12c))/0x7)+parseInt(_0x220600(0x12d))/0x8*(-parseInt(_0x220600(0x125))/0x9)+-parseInt(_0x220600(0x133))/0xa;if(_0x346f0c===_0x1d808a)break;else _0x22afd5['push'](_0x22afd5['shift']());}catch(_0x5e883f){_0x22afd5['push'](_0x22afd5['shift']());}}}(a101_0x4b49,0x3f480));function a101_0x12b1(_0x1a20e3,_0x222ea8){_0x1a20e3=_0x1a20e3-0x125;const _0x4b49e3=a101_0x4b49();let _0x12b1ea=_0x4b49e3[_0x1a20e3];return _0x12b1ea;}export function parseSegmentRef(_0x3bed4b){const _0x57eaf7=a101_0x12b1,_0x142180=_0x3bed4b[_0x57eaf7(0x126)]('/');if(_0x142180===-0x1)return{'parentId':_0x3bed4b};if(_0x142180===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x3bed4b+_0x57eaf7(0x128));const _0x823a3d=_0x3bed4b[_0x57eaf7(0x130)](0x0,_0x142180),_0x3f6795=_0x3bed4b[_0x57eaf7(0x130)](_0x142180+0x1);if(_0x3f6795==='')throw new Error(_0x57eaf7(0x12a)+_0x3bed4b+_0x57eaf7(0x12b));return{'parentId':_0x823a3d,'childId':_0x3f6795};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x18a6b5,_0x2ec437){const _0x7d6922=a102_0x2ad3,_0x496177=_0x18a6b5();while(!![]){try{const _0x131b69=parseInt(_0x7d6922(0xb2))/0x1*(parseInt(_0x7d6922(0x95))/0x2)+parseInt(_0x7d6922(0xa8))/0x3*(parseInt(_0x7d6922(0xb0))/0x4)+-parseInt(_0x7d6922(0xa7))/0x5+parseInt(_0x7d6922(0xa0))/0x6*(-parseInt(_0x7d6922(0x86))/0x7)+parseInt(_0x7d6922(0xb3))/0x8*(parseInt(_0x7d6922(0xad))/0x9)+-parseInt(_0x7d6922(0xbc))/0xa*(parseInt(_0x7d6922(0x83))/0xb)+parseInt(_0x7d6922(0x85))/0xc;if(_0x131b69===_0x2ec437)break;else _0x496177['push'](_0x496177['shift']());}catch(_0x5dbbfb){_0x496177['push'](_0x496177['shift']());}}}(a102_0xb587,0xbab14));import a102_0x2935b4 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(_0x3771fb){const _0x3dbc4=a102_0x2ad3;return _0x3771fb[_0x3dbc4(0xbb)]!=='error';}export function isScopedResolution(_0x19b469){const _0x3dab8a=a102_0x2ad3;return _0x19b469[_0x3dab8a(0xbb)]===_0x3dab8a(0x8b)||_0x19b469[_0x3dab8a(0xbb)]===_0x3dab8a(0xa2)||_0x19b469[_0x3dab8a(0xbb)]==='context';}function a102_0x2ad3(_0x19cfcf,_0x190207){_0x19cfcf=_0x19cfcf-0x83;const _0xb5871=a102_0xb587();let _0x2ad386=_0xb5871[_0x19cfcf];return _0x2ad386;}export function getScopedDetails(_0x4afd17){const _0x1f7136=a102_0x2ad3;if(isScopedResolution(_0x4afd17))return{'isScoped':_0x4afd17[_0x1f7136(0xa3)],'scopedFolderPath':_0x4afd17[_0x1f7136(0x98)]};return undefined;}async function findTdxConfigAsync(_0x1c7ed4,_0x534324){const _0x3e6fc3=a102_0x2ad3;let _0x11c469=a102_0x2935b4[_0x3e6fc3(0x8f)](_0x1c7ed4);const _0x3ba65b=a102_0x2935b4[_0x3e6fc3(0xa1)](_0x11c469)[_0x3e6fc3(0xb9)];while(_0x11c469!==_0x3ba65b){const _0x44a9bb=a102_0x2935b4[_0x3e6fc3(0x84)](_0x11c469,_0x3e6fc3(0xb8));if(await _0x534324[_0x3e6fc3(0x8c)](_0x44a9bb))try{const _0x2386ea=await _0x534324['readFile'](_0x44a9bb),_0x290c7f=JSON['parse'](_0x2386ea);if(_0x290c7f[_0x3e6fc3(0xb1)]&&typeof _0x290c7f[_0x3e6fc3(0xb1)]===_0x3e6fc3(0x91))return{'configPath':_0x44a9bb,'configDir':_0x11c469,'parentSegment':_0x290c7f[_0x3e6fc3(0xb1)]};}catch{}_0x11c469=a102_0x2935b4[_0x3e6fc3(0x90)](_0x11c469);}return null;}function calculateScopedPath(_0x48eff1,_0x256ab1){const _0x26f8c5=a102_0x2ad3,_0x649530=a102_0x2935b4[_0x26f8c5(0x87)](_0x256ab1,_0x48eff1),_0x475c7c=_0x649530!==''&&_0x649530!=='.'&&!_0x649530[_0x26f8c5(0xb7)]('..');return{'isScoped':_0x475c7c,'scopedFolderPath':_0x475c7c?_0x649530['replace'](/\\/g,'/'):''};}export async function resolveTarget(_0x2e8540){const _0x2bfef2=a102_0x2ad3,{arg:_0xfc408b,contextParent:_0x3fdf31,cwd:cwd=process[_0x2bfef2(0xae)](),fs:fs=nodeFileSystem}=_0x2e8540;if(_0xfc408b&&isYamlFilePath(_0xfc408b))try{const _0x1685cd=await resolveYamlFilePath(_0xfc408b,fs),_0x332206=a102_0x2935b4[_0x2bfef2(0x8f)](_0xfc408b),_0x92c95b=a102_0x2935b4[_0x2bfef2(0x90)](_0x332206),_0x3cfe04=await findTdxConfigAsync(_0x92c95b,fs);if(!_0x3cfe04){if(_0x3fdf31){const _0x4d0cbf=a102_0x2935b4[_0x2bfef2(0x90)](_0x332206);return{'type':'file','parentName':_0x3fdf31,'targetDir':_0x4d0cbf,'configRoot':_0x4d0cbf,'filePath':_0x332206,'resourceName':_0x1685cd[_0x2bfef2(0xa4)],'folderPath':_0x1685cd[_0x2bfef2(0xa9)],'resourceType':_0x1685cd['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x2bfef2(0x8a),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0xfc408b,'arg':_0xfc408b,'helpText':_0x2bfef2(0x8d)};}const _0x3ba1cc=calculateScopedPath(_0x92c95b,_0x3cfe04[_0x2bfef2(0xa6)]);return{'type':_0x2bfef2(0xa2),'parentName':_0x3cfe04[_0x2bfef2(0x9d)],'targetDir':_0x3cfe04[_0x2bfef2(0xa6)],'configRoot':_0x3cfe04[_0x2bfef2(0xa6)],'filePath':_0x332206,'resourceName':_0x1685cd[_0x2bfef2(0xa4)],'folderPath':_0x1685cd[_0x2bfef2(0xa9)],'resourceType':_0x1685cd['resourceType'],'isScoped':_0x3ba1cc[_0x2bfef2(0xa3)],'scopedFolderPath':_0x3ba1cc[_0x2bfef2(0x98)]};}catch(_0x5322f){const _0x5155a7=_0x5322f instanceof Error?_0x5322f[_0x2bfef2(0xab)]:String(_0x5322f);if(_0x5155a7[_0x2bfef2(0xb5)]('File\x20not\x20found'))return{'type':_0x2bfef2(0x9c),'errorCode':_0x2bfef2(0xb6),'message':_0x2bfef2(0x9e)+_0xfc408b,'arg':_0xfc408b};if(_0x5155a7[_0x2bfef2(0xb5)]('No\x20tdx.json\x20found')){if(_0x3fdf31){const _0x1d9b96=a102_0x2935b4[_0x2bfef2(0x8f)](_0xfc408b);if(await fs[_0x2bfef2(0x8c)](_0x1d9b96)){const _0x1b88e1=a102_0x2935b4[_0x2bfef2(0x90)](_0x1d9b96),_0x1d9ba8=await fs[_0x2bfef2(0x8e)](_0x1d9b96),_0x12abb4=_0x1d9ba8[_0x2bfef2(0xb4)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x34eec7=_0x1d9ba8[_0x2bfef2(0xb4)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x27e69f=_0x12abb4?_0x12abb4[0x1][_0x2bfef2(0x89)]():a102_0x2935b4['basename'](_0xfc408b,a102_0x2935b4[_0x2bfef2(0x9a)](_0xfc408b)),_0x4a326a=_0x34eec7&&_0x34eec7[0x1]['trim']()===_0x2bfef2(0xba)?_0x2bfef2(0xba):_0x2bfef2(0xaa);return{'type':_0x2bfef2(0xa2),'parentName':_0x3fdf31,'targetDir':_0x1b88e1,'configRoot':_0x1b88e1,'filePath':_0x1d9b96,'resourceName':_0x27e69f,'folderPath':'','resourceType':_0x4a326a,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x2bfef2(0x9c),'errorCode':'no_config','message':_0x2bfef2(0x94)+_0xfc408b,'arg':_0xfc408b,'helpText':_0x2bfef2(0x8d)};}return{'type':_0x2bfef2(0x9c),'errorCode':'invalid_yaml','message':_0x5155a7,'arg':_0xfc408b};}if(_0xfc408b){const _0x11353d=a102_0x2935b4[_0x2bfef2(0x8f)](cwd,_0xfc408b);let _0x251831=null;try{_0x251831=await fs[_0x2bfef2(0x96)](_0x11353d);}catch{}if(_0x251831?.[_0x2bfef2(0x88)]()){const _0x466892=await findTdxConfigAsync(_0x11353d,fs);if(_0x466892){const _0x10a548=calculateScopedPath(_0x11353d,_0x466892['configDir']);return{'type':_0x2bfef2(0x8b),'parentName':_0x466892[_0x2bfef2(0x9d)],'targetDir':_0x11353d,'configRoot':_0x466892[_0x2bfef2(0xa6)],'isScoped':_0x10a548[_0x2bfef2(0xa3)],'scopedFolderPath':_0x10a548['scopedFolderPath']};}if(_0x3fdf31)return{'type':_0x2bfef2(0x8b),'parentName':_0x3fdf31,'targetDir':_0x11353d,'configRoot':_0x11353d,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x2bfef2(0x8a),'message':_0x2bfef2(0x99)+_0xfc408b,'arg':_0xfc408b,'helpText':_0x2bfef2(0x8d)};}if(_0x251831?.[_0x2bfef2(0xac)]())return{'type':_0x2bfef2(0x9c),'errorCode':_0x2bfef2(0xa5),'message':'Not\x20a\x20YAML\x20file:\x20'+_0xfc408b,'arg':_0xfc408b,'helpText':_0x2bfef2(0x93)};const _0x49aba9=sanitizeFileName(_0xfc408b),_0x142041=getSegmentRootDir(_0x49aba9,cwd);return{'type':_0x2bfef2(0x97),'parentName':_0xfc408b,'targetDir':_0x142041,'configRoot':_0x142041};}const _0x578c1c=await findTdxConfigAsync(cwd,fs);if(_0x578c1c){const _0x40f978=calculateScopedPath(cwd,_0x578c1c[_0x2bfef2(0xa6)]);return{'type':'context','parentName':_0x578c1c['parentSegment'],'targetDir':cwd,'configRoot':_0x578c1c['configDir'],'isScoped':_0x40f978[_0x2bfef2(0xa3)],'scopedFolderPath':_0x40f978[_0x2bfef2(0x98)]};}if(_0x3fdf31){const _0x18977e=sanitizeFileName(_0x3fdf31),_0x1bf451=getSegmentRootDir(_0x18977e,cwd);return{'type':_0x2bfef2(0x9f),'parentName':_0x3fdf31,'targetDir':_0x1bf451,'configRoot':_0x1bf451,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x2bfef2(0x9c),'errorCode':_0x2bfef2(0x9b),'message':_0x2bfef2(0x92),'helpText':_0x2bfef2(0xaf)};}function a102_0xb587(){const _0xbd13ff=['scopedFolderPath','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','extname','no_parent','error','parentSegment','File\x20not\x20found:\x20','context','1205742eNqxEL','parse','file','isScoped','segmentName','invalid_yaml','configDir','7283960QWFNjS','18867uQJVaZ','folderPath','segment','message','isFile','1647nSdeRx','cwd','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','36tWSDUz','parent_segment','1VAbnjS','62624yVHqUV','match','includes','file_not_found','startsWith','tdx.json','root','journey','type','10pFwAlm','9879947kcjQJq','join','19563636AfFJYk','14ZziOnG','relative','isDirectory','trim','no_config','directory','exists','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','readFile','resolve','dirname','string','Parent\x20segment\x20not\x20specified','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','No\x20tdx.json\x20found\x20for\x20file:\x20','804294MBqfsc','stat','parent_name'];a102_0xb587=function(){return _0xbd13ff;};return a102_0xb587();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a103_0x2e6a64=a103_0x1d59;(function(_0x541980,_0x16e7fe){const _0x361b59=a103_0x1d59,_0x1555e3=_0x541980();while(!![]){try{const _0x54f726=-parseInt(_0x361b59(0xc9))/0x1*(parseInt(_0x361b59(0xc2))/0x2)+-parseInt(_0x361b59(0xce))/0x3*(parseInt(_0x361b59(0xc0))/0x4)+parseInt(_0x361b59(0xc8))/0x5+-parseInt(_0x361b59(0xd0))/0x6+-parseInt(_0x361b59(0xc1))/0x7+-parseInt(_0x361b59(0xcb))/0x8*(-parseInt(_0x361b59(0xcd))/0x9)+parseInt(_0x361b59(0xb8))/0xa;if(_0x54f726===_0x16e7fe)break;else _0x1555e3['push'](_0x1555e3['shift']());}catch(_0x5a444b){_0x1555e3['push'](_0x1555e3['shift']());}}}(a103_0x33eb,0x3dcf5));import{existsSync,readFileSync}from'fs';import a103_0x33c55e from'path';function a103_0x33eb(){const _0x197e88=['Invalid\x20JSON\x20in\x20','56mErcYZ','startsWith','438183IZqqwT','136791gYBhRt','object','2700786IBrNHE','Invalid\x20tdx.json:\x20expected\x20object','10659440iBmYJu','join','dirname','resolve','parent_segment','root','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','relative','36PETZmK','2622795okOIFz','2WdZTZc','string','stringify','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','replace','cwd','1974925legcxp','313376NUedqA'];a103_0x33eb=function(){return _0x197e88;};return a103_0x33eb();}function a103_0x1d59(_0x5deb56,_0x4a3193){_0x5deb56=_0x5deb56-0xb8;const _0x33eb8c=a103_0x33eb();let _0x1d595a=_0x33eb8c[_0x5deb56];return _0x1d595a;}const TDX_CONFIG_FILE='tdx.json',SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x1dd7f1=process[a103_0x2e6a64(0xc7)]()){const _0x484760=a103_0x2e6a64;let _0x176075=a103_0x33c55e[_0x484760(0xbb)](_0x1dd7f1);const _0x1e8244=a103_0x33c55e['parse'](_0x176075)[_0x484760(0xbd)];while(_0x176075!==_0x1e8244){const _0x2f0ad9=a103_0x33c55e['join'](_0x176075,TDX_CONFIG_FILE);if(existsSync(_0x2f0ad9))return _0x2f0ad9;_0x176075=a103_0x33c55e[_0x484760(0xba)](_0x176075);}return null;}export function loadTdxConfig(_0x74310d){const _0x2fcf3e=a103_0x2e6a64,_0x6ee5b8=readFileSync(_0x74310d,'utf-8');let _0x18e03e;try{_0x18e03e=JSON['parse'](_0x6ee5b8);}catch{throw new Error(_0x2fcf3e(0xca)+_0x74310d);}if(!_0x18e03e||typeof _0x18e03e!==_0x2fcf3e(0xcf))throw new Error(_0x2fcf3e(0xd1));const _0x573aae=_0x18e03e;if(!_0x573aae[_0x2fcf3e(0xbc)]||typeof _0x573aae[_0x2fcf3e(0xbc)]!==_0x2fcf3e(0xc3))throw new Error(_0x2fcf3e(0xc5));return{'parent_segment':_0x573aae[_0x2fcf3e(0xbc)]};}export function findTdxConfig(_0x4cfc13=process[a103_0x2e6a64(0xc7)]()){const _0x55ece5=a103_0x2e6a64,_0x12d6fd=findTdxConfigPath(_0x4cfc13);if(!_0x12d6fd)throw new Error(_0x55ece5(0xbe));const _0x3d9f40=loadTdxConfig(_0x12d6fd),_0xb779f7=a103_0x33c55e[_0x55ece5(0xba)](_0x12d6fd);return{'config':_0x3d9f40,'configPath':_0x12d6fd,'configDir':_0xb779f7};}export function tryFindTdxConfig(_0x9e65a0){try{return findTdxConfig(_0x9e65a0);}catch{return null;}}export function getSegmentRootDir(_0x15b366,_0x1fa95e=process[a103_0x2e6a64(0xc7)]()){const _0x25a442=a103_0x2e6a64;return a103_0x33c55e[_0x25a442(0xb9)](_0x1fa95e,SEGMENTS_DIR,_0x15b366);}export function getTdxConfigPath(_0x5b4882,_0x2490d0=process['cwd']()){const _0x3bb2b8=a103_0x2e6a64;return a103_0x33c55e[_0x3bb2b8(0xb9)](getSegmentRootDir(_0x5b4882,_0x2490d0),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x58a4a1,_0x347921){const _0x12dadd=a103_0x2e6a64,_0x553a20=a103_0x33c55e['resolve'](_0x58a4a1),_0xf7f59d=a103_0x33c55e[_0x12dadd(0xbf)](_0x347921,_0x553a20);if(_0xf7f59d[_0x12dadd(0xcc)]('..'))return'';return _0xf7f59d;}export function localPathToTdFolderPath(_0x12f800){const _0x5a6e3b=a103_0x2e6a64,_0x5c33d7=a103_0x33c55e[_0x5a6e3b(0xba)](_0x12f800);if(_0x5c33d7==='.'||_0x5c33d7==='')return'';return _0x5c33d7[_0x5a6e3b(0xc6)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x39bf09,_0x371fd8){const _0x3ded87=a103_0x2e6a64;if(!_0x39bf09)return _0x371fd8;return a103_0x33c55e[_0x3ded87(0xb9)](_0x371fd8,_0x39bf09);}export function createTdxConfigContent(_0xaa130e){const _0x488754=a103_0x2e6a64,_0x4c3bad={'parent_segment':_0xaa130e};return JSON[_0x488754(0xc4)](_0x4c3bad,null,0x2)+'\x0a';}
|