@treasuredata/tdx 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +1 -1
- package/dist/commands/agent-test-command.d.ts.map +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/agent-test-command.js.map +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/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/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/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/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/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/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.d.ts.map +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-config.js.map +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +44 -0
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.d.ts +2 -1
- package/dist/sdk/claude-agent/index.d.ts.map +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/index.js.map +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/claude-agent/types.d.ts +4 -1
- package/dist/sdk/claude-agent/types.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a119_0x5aaea3=a119_0x5cd8;(function(_0x500c20,_0x59a808){const _0x24b052=a119_0x5cd8,_0x137400=_0x500c20();while(!![]){try{const _0x289b3a=parseInt(_0x24b052(0x203))/0x1+-parseInt(_0x24b052(0x28e))/0x2*(-parseInt(_0x24b052(0x276))/0x3)+parseInt(_0x24b052(0x246))/0x4+-parseInt(_0x24b052(0x1c7))/0x5+parseInt(_0x24b052(0x1b6))/0x6*(-parseInt(_0x24b052(0x24d))/0x7)+parseInt(_0x24b052(0x24c))/0x8*(-parseInt(_0x24b052(0x206))/0x9)+parseInt(_0x24b052(0x256))/0xa*(parseInt(_0x24b052(0x1eb))/0xb);if(_0x289b3a===_0x59a808)break;else _0x137400['push'](_0x137400['shift']());}catch(_0x4b9351){_0x137400['push'](_0x137400['shift']());}}}(a119_0x2bac,0x3bc10));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a119_0x5aaea3(0x1c8);export function createPendingSegmentId(_0x5d2a3c){return''+PENDING_SEGMENT_PREFIX+_0x5d2a3c+'__';}export function isPendingSegmentId(_0x4fd0c8){const _0x21cdca=a119_0x5aaea3;return _0x4fd0c8[_0x21cdca(0x1e8)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x188a03){const _0x2b30c1=a119_0x5aaea3;return _0x188a03[_0x2b30c1(0x1bb)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3f5563){return''+PENDING_ACTIVATION_PREFIX+_0x3f5563+'__';}export function isPendingActivationId(_0x92d4e5){return _0x92d4e5['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xfa0bd7){const _0x591d6c=a119_0x5aaea3;return _0xfa0bd7[_0x591d6c(0x1bb)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x5ac174,_0x133762){const _0x33b7cb=a119_0x5aaea3,_0x2315e0=_0x5ac174+'::'+(_0x133762[_0x33b7cb(0x20a)]()||'segment'),_0x46d92b=createHash(_0x33b7cb(0x237))[_0x33b7cb(0x25b)](_0x2315e0)[_0x33b7cb(0x1f4)]('hex')[_0x33b7cb(0x211)](0x0,0xc);return'journey_entry_criteria_'+_0x46d92b;}export function ensureJourneyDefaults(_0x25218a){const _0x32cd7c=a119_0x5aaea3;!_0x25218a[_0x32cd7c(0x21d)]&&(_0x25218a[_0x32cd7c(0x21d)]=''),!_0x25218a[_0x32cd7c(0x1c9)]&&(_0x25218a[_0x32cd7c(0x1c9)]=_0x32cd7c(0x294));}export function resolveTDFolderPath(_0x47dff2,_0x143af7,_0x26cc80){const _0x647f0e=a119_0x5aaea3;if(!_0x143af7)return _0x47dff2;if(_0x47dff2===_0x26cc80||_0x47dff2[_0x647f0e(0x1e8)](_0x26cc80+'/'))return _0x47dff2;return _0x47dff2?_0x26cc80+'/'+_0x47dff2:_0x26cc80;}export function addFoldersToCreate(_0x26d935,_0xb90e47,_0xdb7856){const _0x5bd090=a119_0x5aaea3;if(!_0x26d935)return;if(_0xb90e47[_0x5bd090(0x213)](_0x26d935))return;const _0x4c020c=_0x26d935[_0x5bd090(0x27c)]('/');let _0x46f5e5='';for(const _0x2ba8f1 of _0x4c020c){_0x46f5e5=_0x46f5e5?_0x46f5e5+'/'+_0x2ba8f1:_0x2ba8f1,!_0xb90e47[_0x5bd090(0x213)](_0x46f5e5)&&_0xdb7856[_0x5bd090(0x20b)](_0x46f5e5);}}import*as a119_0x118109 from'yaml';import{readFileSync}from'fs';import a119_0x494925 from'path';import{isJourneyDef,parseYamlString as a119_0x5f2407,toYamlString as a119_0xdbc581,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 a119_0x2bac(){const _0x37de42=['createFolder','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','type','segmentFolderId','goal\x20criteria','folderId','utf-8','activation_created','description','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','idToName','embedded_segment_creating','rootFolderId','filter','../../utils/async.js','WaitStep','journey_updated','max','buildUserMaps','logDeleted','parentId','journey','steps','withProgress','NOT_FOUND','segment_updating','message','toLowerCase','sort','Failed\x20to\x20','activation_','absolutePath','\x20(referenced\x20in\x20journey\x20','keys','sha1','Updated\x20activation\x20\x27','existingJourney','journey_updating','data','stage\x20\x27','entry','activation_updating','updateActivation',').\x20','deleted','deps','Updating\x20segment\x20\x27','activation_creating','parse','1415764udxspV','createdSegmentId','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','entries','attributes','activation_updated','8lVojeI','7ZDuisB','\x27\x20milestone','goal','rule','list','listActivations','Creating\x20activation\x20\x27','segment_updated','getActivation','178430bUcgJH','results','segment_deleted','unchanged','entry_criteria','update','segmentNameToId','journeyById','includes','values','JOURNEY_UPDATE_ERROR','activationParams','\x0a\x20\x20','parseDocument','stages','activations','set','Created\x20activation\x20\x27','Creating\x20segment\x20\x27','ACTIVATION_UPDATE_ERROR','existingActivation','index','parentSegmentFolder','onProgress','waitCondition','all_columns','skipSegments','parentFolder','flatMap','map','JOURNEY_SYNTAX_ERROR','delete','7974VuhVyl','activation_deleting','kind','journey_creating','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','from','split','milestone','updated','\x27\x20for\x20','folderPath','getJourney','DecisionPoint','segmentId','nameToType','yamlConfig','find','Entry\x20criteria:\x20','nameToId','diff','./journey-yaml.js','connector_config','relationships','null','182Sayvmh','Deleting\x20activation\x20\x27','schedule','\x27\x20entry\x20criteria','embedded_segment_created','\x27...','draft','folderPathToId','\x27\x20wait\x20condition','createActivation','Created\x20journey\x20\x27','Creating\x20folder\x20\x27','getSegment','segment_created','./child-segment-yaml.js','object','isNew','\x27\x20not\x20found\x20in\x20journey\x20\x27','create','length','exitCriterias','journeyActivationNameToId','ACTIVATION_SYNTAX_ERROR','SEGMENT_NOT_FOUND','resolveJourneyId','2258058MfwtOd','\x20segment\x20from\x20file:\x20','embedded_activation_created','Segment\x20not\x20found:\x20','\x27\x20decision\x20point\x20branch\x20\x27','replace','push','activationActions','idToEmailMap','Fetching\x20','embeddedSegmentNameToId','Deleted\x20segment\x20\x27','name','segment_deleting','toString','connectionIdToNameMap','connection','454325vrkLoK','__pending_act_','state','segment','existingSegment','SEGMENT_SYNTAX_ERROR','Updated\x20segment\x20\x27','journeyBundleName','SEGMENT_UPDATE_ERROR','all','get','logInfo','):\x20','createJourneySegment','progress','updateSegmentById','versionNumber','journeyStages','created','branches','item','\x27\x20from\x20file:\x20','yamlActivation','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','activationStepsById','dirname','\x20error(s)','hasChanges','INTERNAL','logSuccess','behavior','reduce','embedded_activation_creating','startsWith','Deleted\x20activation\x20\x27','stringify','66vhokfb','effectiveFolderId','createdSegmentIds','Name\x20has\x20already\x20been\x20taken','columns','journeyBundlesByFolderAndName','journeys','activationContext','segments','digest','valid','join','notification','journeyActivationStepId','size','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','journeyId','user','activation_deleted','deleteActivation','activation_template_id','createSegment','\x27\x20exit\x20criteria','entryCriteria','458677GyFbBb','decision_point','relative','4046346tgBxtw','resolveSegment','isArray','validatedRequest','trim','add','Stage\x20\x27','existingSegments','Updating\x20activation\x20\x27','action','fetchJourney','slice','folder_creating','has','activationsBySegmentId'];a119_0x2bac=function(){return _0x37de42;};return a119_0x2bac();}function stableStringify(_0x26c58c){const _0x3cea11=a119_0x5aaea3;if(Array[_0x3cea11(0x208)](_0x26c58c))return'['+_0x26c58c[_0x3cea11(0x273)](_0x59829c=>stableStringify(_0x59829c))[_0x3cea11(0x1f6)](',')+']';if(_0x26c58c&&typeof _0x26c58c===_0x3cea11(0x1ac)){const _0x3f93c1=_0x26c58c,_0x12445c=Object['keys'](_0x3f93c1)['sort'](),_0x336413=_0x12445c[_0x3cea11(0x273)](_0x2f25b4=>'\x22'+_0x2f25b4+'\x22:'+stableStringify(_0x3f93c1[_0x2f25b4]));return'{'+_0x336413[_0x3cea11(0x1f6)](',')+'}';}const _0x334e24=JSON[_0x3cea11(0x1ea)](_0x26c58c);return _0x334e24===undefined?_0x3cea11(0x28d):_0x334e24;}function activationSignature(_0x3ac008){const _0x351cb1=a119_0x5aaea3,_0x750aeb={'connection':_0x3ac008[_0x351cb1(0x1c6)],..._0x3ac008[_0x351cb1(0x26f)]!==undefined&&{'all_columns':_0x3ac008[_0x351cb1(0x26f)]},..._0x3ac008[_0x351cb1(0x1ef)]!==undefined&&{'columns':_0x3ac008[_0x351cb1(0x1ef)]},..._0x3ac008['behavior']!==undefined&&{'behavior':_0x3ac008[_0x351cb1(0x1e5)]},..._0x3ac008['schedule']!==undefined&&{'schedule':_0x3ac008[_0x351cb1(0x290)]},..._0x3ac008[_0x351cb1(0x1f7)]!==undefined&&{'notification':_0x3ac008[_0x351cb1(0x1f7)]},..._0x3ac008[_0x351cb1(0x28b)]!==undefined&&{'connector_config':_0x3ac008[_0x351cb1(0x28b)]},..._0x3ac008[_0x351cb1(0x1ff)]!==undefined&&{'activation_template_id':_0x3ac008[_0x351cb1(0x1ff)]}};return stableStringify(_0x750aeb);}export async function prepareSegmentFiles(_0x339991,_0x20f943,_0x44fddf,_0x1fb93a,_0x1e27e8){const _0x83487e=a119_0x5aaea3,{activationDefToCreateRequest:_0x4e9f47}=await import(_0x83487e(0x29c)),_0x185493=[],_0x5a7164=new Set();for(const {yamlConfig:_0x57c80f,folderPath:_0x3542a5,sourcePath:_0x3509a2}of _0x339991){const _0x834854=resolveTDFolderPath(_0x3542a5,_0x1fb93a,_0x1e27e8),_0x446376=_0x834854+':'+_0x57c80f[_0x83487e(0x1c2)],_0x369d75=_0x20f943['segmentByFolderAndName'][_0x83487e(0x1d1)](_0x446376),_0x390282=_0x369d75?_0x20f943[_0x83487e(0x214)][_0x83487e(0x1d1)](_0x369d75['id'])||[]:[];addFoldersToCreate(_0x834854,_0x20f943[_0x83487e(0x295)],_0x5a7164);const _0x19d6f7=calculateActivationActions(_0x57c80f[_0x83487e(0x265)]||[],_0x390282,_0x20f943[_0x83487e(0x1be)],_0x20f943[_0x83487e(0x1c5)]);for(const _0x3d6cc1 of _0x19d6f7){(_0x3d6cc1[_0x83487e(0x217)]===_0x83487e(0x1af)||_0x3d6cc1[_0x83487e(0x217)]==='update')&&_0x3d6cc1[_0x83487e(0x1dd)]&&(_0x3d6cc1[_0x83487e(0x209)]=await _0x4e9f47(_0x3d6cc1['yamlActivation'],_0x44fddf));}const _0x143c32=calculateSegmentDiff(_0x57c80f,_0x369d75,_0x390282,_0x20f943[_0x83487e(0x1be)],_0x20f943['connectionIdToNameMap']);_0x185493['push']({'relativePath':_0x57c80f['name'],'absolutePath':_0x3509a2,'yamlConfig':_0x57c80f,'folderPath':_0x834854,'existingSegment':_0x369d75,'existingActivations':_0x390282,'isNew':_0x143c32['isNew'],'hasChanges':_0x143c32[_0x83487e(0x1e2)],'diff':_0x143c32[_0x83487e(0x289)],'activationActions':_0x19d6f7});}return{'segmentFiles':_0x185493,'foldersToCreate':_0x5a7164};}export async function prepareJourneyFiles(_0x4bdae2,_0x236e14,_0x40f3b3,_0x351f14){const _0x547606=a119_0x5aaea3,_0x4a7a28=[],_0x312f3f=new Set();for(const {yamlConfig:_0x4ef37f,folderPath:_0x82ca5c,sourcePath:_0xcdc779}of _0x4bdae2){const _0x45a049=resolveTDFolderPath(_0x82ca5c,_0x40f3b3,_0x351f14),_0xddff86=_0x45a049+':'+_0x4ef37f['name'],_0x30950f=_0x236e14[_0x547606(0x1f0)][_0x547606(0x1d1)](_0xddff86);let _0x1b87f3,_0x3e76c7;if(_0x30950f&&_0x30950f[_0x547606(0x1b0)]>0x0){const _0x5d9b5f=buildLocalExpandedRuleMappings(_0x4ef37f),{createYamlContext:_0x39853b,prefetchJourneySegments:_0x4a054b}=createPushYamlContextForBundle(_0x236e14[_0x547606(0x242)],_0x236e14[_0x547606(0x229)],_0x236e14[_0x547606(0x20d)],_0x5d9b5f,_0x236e14['idToEmailMap'],_0x236e14['connectionIdToNameMap'],_0x236e14[_0x547606(0x1df)],_0x236e14[_0x547606(0x25d)]);await _0x4a054b(_0x30950f[_0x547606(0x273)](_0x41ae6c=>_0x41ae6c['id']));const _0x3069f1=hasMultipleVersions(_0x4ef37f),_0x5630a5=async _0x3b6cc5=>{const _0x19155c=_0x547606,_0x50f2ac=_0x236e14[_0x19155c(0x25d)]?.[_0x19155c(0x1d1)](_0x3b6cc5);if(_0x50f2ac)return _0x50f2ac;return _0x236e14[_0x19155c(0x210)]({'journeyId':_0x3b6cc5,'journeyName':_0x4ef37f[_0x19155c(0x1c2)],'isMultiVersion':_0x30950f['length']>0x1});};if(_0x3069f1&&_0x30950f[_0x547606(0x1b0)]>0x1){const _0x51faa9=[];for(const _0x2c133d of _0x30950f){const _0x1e0a50=_0x2c133d['versionNumber']||0x1;_0x236e14['progress']?.['update'](_0x547606(0x1bf)+_0x4ef37f[_0x547606(0x1c2)]+'\x20v'+_0x1e0a50);const _0x5cce50=await _0x5630a5(_0x2c133d['id']),_0x47af40=_0x39853b(_0x2c133d['id']),_0x4bafa1=await journeyResponseToDef(_0x5cce50,_0x47af40);_0x51faa9['push']({'item':_0x2c133d,'yaml':_0x4bafa1});}const _0x445023=buildLocalRuleToNameMappingFromJourney(_0x4ef37f);_0x3e76c7=buildMergedJourneyDef(_0x51faa9,_0x445023);const _0x48c9ad=Math['max'](..._0x51faa9[_0x547606(0x273)](_0x59acd7=>_0x59acd7[_0x547606(0x1db)]['versionNumber']||0x0)),_0x2f8137=_0x30950f[_0x547606(0x286)](_0x9d3a22=>(_0x9d3a22[_0x547606(0x1d7)]||0x0)===_0x48c9ad);_0x2f8137&&(_0x236e14[_0x547606(0x1d5)]?.[_0x547606(0x25b)](_0x547606(0x1bf)+_0x4ef37f[_0x547606(0x1c2)]+'\x20v'+_0x48c9ad),_0x1b87f3=await _0x5630a5(_0x2f8137['id']));}else{const _0x18e6eb=_0x30950f[_0x30950f[_0x547606(0x1b0)]-0x1];_0x236e14[_0x547606(0x1d5)]?.[_0x547606(0x25b)]('Fetching\x20'+_0x4ef37f[_0x547606(0x1c2)]),_0x1b87f3=await _0x5630a5(_0x18e6eb['id']);const _0x48e012=_0x39853b(_0x18e6eb['id']),_0x224940=await journeyResponseToDef(_0x1b87f3,_0x48e012),_0xbefdd5=buildLocalRuleToNameMappingFromJourney(_0x4ef37f);_0x3e76c7=buildMergedJourneyDef([{'item':_0x18e6eb,'yaml':_0x224940}],_0xbefdd5);}}addFoldersToCreate(_0x45a049,_0x236e14[_0x547606(0x295)],_0x312f3f);const _0x57e68e=calculateJourneyDiff(_0x4ef37f,_0x3e76c7);_0x4a7a28[_0x547606(0x1bc)]({'relativePath':_0x4ef37f[_0x547606(0x1c2)],'absolutePath':_0xcdc779,'yamlConfig':_0x4ef37f,'folderPath':_0x45a049,'existingJourney':_0x1b87f3,'isNew':_0x57e68e[_0x547606(0x1ad)],'hasChanges':_0x57e68e[_0x547606(0x1e2)],'diff':_0x57e68e['diff']});}return{'journeyFiles':_0x4a7a28,'foldersToCreate':_0x312f3f};}export function calculateActivationActions(_0x48abde,_0x414a05,_0x214f19,_0x408b34){const _0x5b8b06=a119_0x5aaea3,_0x5d53d6=[],_0x1f6a16=new Map();for(const _0x23213d of _0x414a05){_0x1f6a16[_0x5b8b06(0x266)](_0x23213d['name'],_0x23213d);}const _0x558d4f=new Map();for(const _0x3b9431 of _0x48abde){_0x558d4f[_0x5b8b06(0x266)](_0x3b9431['name'],_0x3b9431);}for(const _0x21e925 of _0x48abde){const _0x380cb2=_0x1f6a16[_0x5b8b06(0x1d1)](_0x21e925['name']);if(!_0x380cb2)_0x5d53d6[_0x5b8b06(0x1bc)]({'type':_0x5b8b06(0x1af),'name':_0x21e925[_0x5b8b06(0x1c2)],'yamlActivation':_0x21e925});else{const _0x1bb64f=activationResponseToDef(_0x380cb2,_0x214f19,_0x408b34),_0x56bf5e=a119_0x118109[_0x5b8b06(0x1ea)](_0x1bb64f),_0x14da83=a119_0x118109[_0x5b8b06(0x1ea)](_0x21e925);_0x56bf5e!==_0x14da83&&_0x5d53d6[_0x5b8b06(0x1bc)]({'type':_0x5b8b06(0x25b),'name':_0x21e925['name'],'yamlActivation':_0x21e925,'existingActivation':_0x380cb2});}}for(const _0x252364 of _0x414a05){!_0x558d4f[_0x5b8b06(0x213)](_0x252364[_0x5b8b06(0x1c2)])&&_0x5d53d6[_0x5b8b06(0x1bc)]({'type':_0x5b8b06(0x275),'name':_0x252364[_0x5b8b06(0x1c2)],'existingActivation':_0x252364});}return _0x5d53d6;}export function calculateSegmentDiff(_0x492081,_0x179b7c,_0x1db689,_0x3e7bfc,_0x3a3321){const _0x10db52=segmentToYamlString(_0x492081);if(_0x179b7c){const _0x18937e=segmentWithActivationsToYaml(_0x179b7c,_0x1db689,undefined,_0x3e7bfc,_0x3a3321),_0x758507=segmentToYamlString(_0x18937e),_0x31d58a=generateDiff(_0x758507,_0x10db52),_0x631456=hasChanges(_0x31d58a);return{'isNew':![],'hasChanges':_0x631456,'diff':_0x631456?formatDiffWithColors(_0x31d58a):undefined};}const _0x1ab541=generateDiff('',_0x10db52);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1ab541)};}export function calculateJourneyDiff(_0x30a1ef,_0x2b1d65){const _0x27540c=normalizeJourneyDef(_0x30a1ef,_0x30a1ef),_0x228939=a119_0xdbc581(_0x27540c);if(_0x2b1d65){const _0x2d5fe0=normalizeJourneyDef(_0x2b1d65,_0x30a1ef),_0x3dde86=a119_0xdbc581(_0x2d5fe0),_0x3dde62=generateDiff(_0x3dde86,_0x228939),_0x59ada7=hasChanges(_0x3dde62);return{'isNew':![],'hasChanges':_0x59ada7,'diff':_0x59ada7?formatDiffWithColors(_0x3dde62):undefined};}const _0x2fefe6=generateDiff('',_0x228939);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2fefe6)};}export function findSegmentsToDelete(_0x3ac820,_0x2fcdcc,_0x38f8fc,_0x3adb12,_0x1fed54){const _0x161273=a119_0x5aaea3,_0x54dca9=new Set();for(const {yamlConfig:_0x4a0655,folderPath:_0x3312eb}of _0x2fcdcc){_0x54dca9[_0x161273(0x20b)](_0x3312eb+':'+_0x4a0655[_0x161273(0x1c2)]);}return _0x3ac820[_0x161273(0x222)](_0x54c85b=>{const _0x2d3abe=_0x161273,_0x117c4d=_0x54c85b[_0x2d3abe(0x218)]?_0x38f8fc['get'](_0x54c85b[_0x2d3abe(0x218)][_0x2d3abe(0x1c4)]())||'':'',_0xbe4c=_0x117c4d+':'+_0x54c85b[_0x2d3abe(0x1c2)];if(_0x54dca9[_0x2d3abe(0x213)](_0xbe4c))return![];if(_0x1fed54)return _0x117c4d===_0x3adb12||_0x117c4d[_0x2d3abe(0x1e8)](_0x3adb12+'/');return!![];});}export function findJourneysToDelete(_0x13440a,_0x201d64,_0x5473fe,_0x34b2cb,_0x144cda){const _0x34dac7=a119_0x5aaea3,_0x3037c7=new Set();for(const {yamlConfig:_0x41afc4,folderPath:_0x3992a6}of _0x201d64){_0x3037c7['add'](_0x3992a6+':'+_0x41afc4[_0x34dac7(0x1c2)]);}return _0x13440a[_0x34dac7(0x222)](_0x1c4850=>{const _0x4c24b8=_0x34dac7,_0x4901fd=_0x1c4850['folderId']?_0x5473fe[_0x4c24b8(0x1d1)](_0x1c4850[_0x4c24b8(0x21a)])||'':'',_0x1c53a=_0x4901fd+':'+_0x1c4850[_0x4c24b8(0x1ce)];if(_0x3037c7[_0x4c24b8(0x213)](_0x1c53a))return![];if(_0x144cda)return _0x4901fd===_0x34b2cb||_0x4901fd[_0x4c24b8(0x1e8)](_0x34b2cb+'/');return!![];});}export function buildSegmentLookupMap(_0x5d7440,_0x4d6b8c){const _0x5678a1=a119_0x5aaea3,_0x1932d8=new Map();for(const _0x565d80 of _0x5d7440){const _0x47ed52=_0x565d80[_0x5678a1(0x218)]?_0x4d6b8c[_0x5678a1(0x1d1)](_0x565d80['segmentFolderId'][_0x5678a1(0x1c4)]())||'':'',_0x3ee24d=_0x47ed52+':'+_0x565d80[_0x5678a1(0x1c2)];_0x1932d8['set'](_0x3ee24d,_0x565d80);}return _0x1932d8;}export function buildSegmentNameToIdMap(_0x46f28d){const _0x7ecda7=a119_0x5aaea3,_0x1693d8=new Map();for(const _0xda0ed0 of _0x46f28d){_0x1693d8[_0x7ecda7(0x266)](_0xda0ed0[_0x7ecda7(0x1c2)],_0xda0ed0['id']);}return _0x1693d8;}export function buildJourneyBundleLookupMap(_0x5b2184,_0x180a72){const _0x2cb208=a119_0x5aaea3,_0x8d35e9=new Map();for(const _0x288a99 of _0x5b2184){const _0x30c743=_0x288a99[_0x2cb208(0x21a)]?_0x180a72[_0x2cb208(0x1d1)](_0x288a99[_0x2cb208(0x21a)])||'':'',_0x2a5c22=_0x30c743+':'+_0x288a99[_0x2cb208(0x1ce)];!_0x8d35e9['has'](_0x2a5c22)&&_0x8d35e9['set'](_0x2a5c22,[]),_0x8d35e9[_0x2cb208(0x1d1)](_0x2a5c22)[_0x2cb208(0x1bc)](_0x288a99);}for(const _0x533a62 of _0x8d35e9[_0x2cb208(0x25f)]()){_0x533a62[_0x2cb208(0x231)]((_0x2dd7b7,_0x4983aa)=>(_0x2dd7b7['versionNumber']||0x0)-(_0x4983aa[_0x2cb208(0x1d7)]||0x0));}return _0x8d35e9;}export function collectFoldersToCreate(_0x4d9462,_0xae2c8e){const _0x42f26c=a119_0x5aaea3,_0x23eaf2=new Set();for(const _0x1d3aed of _0x4d9462){if(!_0x1d3aed)continue;if(_0xae2c8e[_0x42f26c(0x213)](_0x1d3aed))continue;const _0x14f881=_0x1d3aed['split']('/');let _0x53d9f0='';for(const _0x28336b of _0x14f881){_0x53d9f0=_0x53d9f0?_0x53d9f0+'/'+_0x28336b:_0x28336b,!_0xae2c8e[_0x42f26c(0x213)](_0x53d9f0)&&_0x23eaf2[_0x42f26c(0x20b)](_0x53d9f0);}}return _0x23eaf2;}export function parseAndClassifyYamlFiles(_0x2aad26,_0x44dfcb,_0x4f4275){const _0x1449d1=a119_0x5aaea3,_0x98b514=[],_0x15ea9b=[];for(const _0x4464ec of _0x2aad26){const _0x2f5ec5=a119_0x494925[_0x1449d1(0x205)](_0x44dfcb,a119_0x494925[_0x1449d1(0x1e0)](_0x4464ec)),_0x4bc81d=_0x2f5ec5==='.'?'':_0x2f5ec5,_0x355d0b=readFileSync(_0x4464ec,_0x1449d1(0x21b)),_0x2b5369=a119_0x118109['parse'](_0x355d0b);if(isJourneyDef(_0x2b5369)){const _0x24ae69=a119_0x5f2407(_0x355d0b);_0x15ea9b[_0x1449d1(0x1bc)]({'yamlConfig':_0x24ae69,'folderPath':_0x4bc81d,'sourcePath':_0x4464ec});}else{if(!_0x4f4275?.[_0x1449d1(0x270)]){const _0x4a79fb=parseSegmentYamlFile(_0x355d0b),_0x1ad985=normalizeChildSegmentYaml(_0x4a79fb);_0x98b514['push']({'yamlConfig':_0x1ad985,'folderPath':_0x4bc81d,'sourcePath':_0x4464ec});}}}return{'segments':_0x98b514,'journeys':_0x15ea9b};}export function validateParsedFiles(_0x297932,_0x56e747){const _0x5a63d8=a119_0x5aaea3,_0xe0928=[];for(const {yamlConfig:_0x4397f3,sourcePath:_0x366fb2}of _0x297932[_0x5a63d8(0x1f3)]){const _0x42949c=readFileSync(_0x366fb2,_0x5a63d8(0x21b)),_0x2249e6=a119_0x118109[_0x5a63d8(0x263)](_0x42949c),_0xa70ff6=validateSegmentDef(_0x4397f3,{'source':_0x42949c,'document':_0x2249e6});if(!_0xa70ff6[_0x5a63d8(0x1f5)]){const _0x3eac68=a119_0x494925[_0x5a63d8(0x205)](_0x56e747,_0x366fb2);_0xe0928['push']({'filePath':_0x3eac68,'source':_0x42949c,'result':_0xa70ff6,'isJourney':![]});}}for(const {yamlConfig:_0x1c2613,sourcePath:_0x55106d}of _0x297932[_0x5a63d8(0x1f1)]){const _0x346479=readFileSync(_0x55106d,_0x5a63d8(0x21b)),_0x265f05=a119_0x118109[_0x5a63d8(0x263)](_0x346479),_0x59467d=validateJourneyDef(_0x1c2613,{'source':_0x346479,'document':_0x265f05});if(!_0x59467d['valid']){const _0x58e13a=a119_0x494925[_0x5a63d8(0x205)](_0x56e747,_0x55106d);_0xe0928[_0x5a63d8(0x1bc)]({'filePath':_0x58e13a,'source':_0x346479,'result':_0x59467d,'isJourney':!![]});}}return _0xe0928;}export function formatValidationErrors(_0x49d82a){const _0x2b2282=a119_0x5aaea3,_0x280881=[];for(const {filePath:_0x31d946,source:_0x50c7fd,result:_0x468f1e,isJourney:_0xc0f69c}of _0x49d82a){const _0x307166=_0xc0f69c?_0x2b2282(0x22a):'segment';_0x280881[_0x2b2282(0x1bc)]('\x0a'+_0x31d946+'\x20('+_0x307166+_0x2b2282(0x1d3)+_0x468f1e['errors'][_0x2b2282(0x1b0)]+_0x2b2282(0x1e1)),_0x280881[_0x2b2282(0x1bc)](formatValidationResult(_0x468f1e,_0x50c7fd,_0x31d946));}return _0x280881[_0x2b2282(0x1f6)]('\x0a');}function a119_0x5cd8(_0x61092d,_0x215eed){_0x61092d=_0x61092d-0x1ac;const _0x2bac4e=a119_0x2bac();let _0x5cd844=_0x2bac4e[_0x61092d];return _0x5cd844;}export function buildLocalExpandedRuleMappings(_0x367580){const _0x2d2c97=a119_0x5aaea3,_0x1b46e6=new Set(),_0x65a904=new Map(),_0x285752=collectSegmentUsageCounts(_0x367580);if(_0x367580[_0x2d2c97(0x1f3)])for(const [_0xf5f8ff,_0x3104d4]of Object[_0x2d2c97(0x249)](_0x367580[_0x2d2c97(0x1f3)])){_0x1b46e6['add'](_0xf5f8ff);if(_0x3104d4[_0x2d2c97(0x250)]){const _0xe983b4=yamlRuleToApi(_0x3104d4[_0x2d2c97(0x250)]),_0x4ebfb8=apiRuleToYaml(_0xe983b4);_0x65a904[_0x2d2c97(0x266)](_0xf5f8ff,_0x4ebfb8);}}const _0x432958=new Map();let _0x3eafca=0x0;for(const [_0xb2dc60,_0x46fb6f]of _0x65a904){const _0x570d50=serializeExpandedRule(_0x46fb6f,_0x65a904),_0x2e193c=_0x432958[_0x2d2c97(0x1d1)](_0x570d50)||[];_0x2e193c[_0x2d2c97(0x1bc)]({'name':_0xb2dc60,'index':_0x3eafca}),_0x432958[_0x2d2c97(0x266)](_0x570d50,_0x2e193c),_0x3eafca++;}const _0x38bda0=new Map();for(const [_0x1d24a0,_0x2635bf]of _0x432958){const _0x2c839e=_0x2635bf[_0x2d2c97(0x211)]()[_0x2d2c97(0x231)]((_0x41956c,_0x4da91d)=>{const _0x37cf9a=_0x2d2c97,_0x53e63e=_0x285752[_0x37cf9a(0x1d1)](_0x41956c[_0x37cf9a(0x1c2)])||0x0,_0x492038=_0x285752['get'](_0x4da91d['name'])||0x0;if(_0x53e63e!==_0x492038)return _0x492038-_0x53e63e;return _0x41956c[_0x37cf9a(0x26b)]-_0x4da91d[_0x37cf9a(0x26b)];})['map'](_0x14b13d=>_0x14b13d[_0x2d2c97(0x1c2)]),_0xa57957=[];for(const _0x443ff6 of _0x2c839e){const _0x9792bd=_0x285752[_0x2d2c97(0x1d1)](_0x443ff6)||0x0,_0x404c73=Math[_0x2d2c97(0x226)](_0x9792bd,0x1);for(let _0x4faa85=0x0;_0x4faa85<_0x404c73;_0x4faa85++){_0xa57957[_0x2d2c97(0x1bc)](_0x443ff6);}}_0x38bda0[_0x2d2c97(0x266)](_0x1d24a0,_0xa57957);}return{'existingLocalSegmentNames':_0x1b46e6,'localSegmentRules':_0x65a904,'localExpandedRuleToNames':_0x38bda0};}async function buildServerSegmentRuleMap(_0x1aa099,_0x13bbd1,_0x5bb5ec,_0x415b03){const _0x5043c7=new Map(),_0x53ef47=new Set(),_0x51f735=async _0x382ae9=>{const _0x28dc0e=a119_0x5cd8;if(_0x53ef47[_0x28dc0e(0x213)](_0x382ae9))return;_0x53ef47['add'](_0x382ae9);let _0x54e4a6=_0x5bb5ec['find'](_0x53dd94=>_0x53dd94['id']===_0x382ae9);if(!_0x54e4a6)try{_0x54e4a6=await _0x1aa099[_0x28dc0e(0x1ca)][_0x28dc0e(0x29a)](_0x13bbd1,_0x382ae9);}catch{return;}if(!_0x54e4a6?.[_0x28dc0e(0x250)])return;const _0x423a3f=apiRuleToYaml(_0x54e4a6[_0x28dc0e(0x250)]);_0x5043c7[_0x28dc0e(0x266)](_0x382ae9,_0x423a3f);const _0x2fa8b3=collectSegmentRefsFromRule(_0x423a3f);for(const _0x4e7797 of _0x2fa8b3){await _0x51f735(_0x4e7797);}};for(const _0x1b4783 of _0x415b03){await _0x51f735(_0x1b4783);}return _0x5043c7;}export function createSegmentIdResolver(_0xa68959,_0x1567c4){return async _0x399dc7=>{const _0x1e8d5d=a119_0x5cd8,_0x4e4a75=_0xa68959[_0x1e8d5d(0x1d1)](_0x399dc7);if(!_0x4e4a75)throw new SDKError(ErrorCode[_0x1e8d5d(0x1b4)],_0x1e8d5d(0x1b9)+_0x399dc7+_0x1e8d5d(0x1fa)+_0x1567c4+'\x27)');return _0x4e4a75;};}export function extractRootFolderId(_0x413e3c){const _0x56a126=a119_0x5aaea3;return _0x413e3c['relationships']?.[_0x56a126(0x26c)]?.[_0x56a126(0x23b)]?.['id']||_0x413e3c[_0x56a126(0x28c)]?.[_0x56a126(0x271)]?.['data']?.['id'];}export function buildConnectionMaps(_0x1ef53c){const _0x1adf4c=a119_0x5aaea3,_0x368954=new Map(),_0x3e4b3b=new Map(),_0x2db596=new Map();for(const _0x374d5f of _0x1ef53c){_0x368954[_0x1adf4c(0x266)](_0x374d5f[_0x1adf4c(0x1c2)],parseInt(_0x374d5f['id'],0xa)),_0x3e4b3b['set'](_0x374d5f['id'],_0x374d5f['name']),_0x2db596[_0x1adf4c(0x266)](_0x374d5f[_0x1adf4c(0x1c2)],_0x374d5f[_0x1adf4c(0x217)]);}return{'nameToId':_0x368954,'idToName':_0x3e4b3b,'nameToType':_0x2db596};}export function calculatePushStats(_0x17b642,_0x11294b,_0x4f769c,_0x5ea87b,_0x3d4647,_0x279ea8,_0x695312){const _0x4eaa2e=a119_0x5aaea3,_0x593a5b=_0x17b642[_0x4eaa2e(0x222)](_0x3b3533=>_0x3b3533[_0x4eaa2e(0x1ad)]),_0x512349=_0x17b642[_0x4eaa2e(0x222)](_0x26eeec=>!_0x26eeec[_0x4eaa2e(0x1ad)]&&_0x26eeec['hasChanges']),_0x50ebd1=_0x17b642[_0x4eaa2e(0x222)](_0x4137b8=>!_0x4137b8[_0x4eaa2e(0x1ad)]&&!_0x4137b8['hasChanges']),_0x5243e5=_0x279ea8?_0x5ea87b:[],_0x527d0a=_0x11294b[_0x4eaa2e(0x222)](_0x5b7249=>_0x5b7249[_0x4eaa2e(0x1ad)]),_0x3bc95d=_0x11294b['filter'](_0x569f39=>!_0x569f39[_0x4eaa2e(0x1ad)]&&_0x569f39[_0x4eaa2e(0x1e2)]),_0x1187eb=_0x11294b[_0x4eaa2e(0x222)](_0x3f2566=>!_0x3f2566['isNew']&&!_0x3f2566['hasChanges']),_0x26c6d3=_0x279ea8?_0x3d4647:[],_0x540441=_0x17b642[_0x4eaa2e(0x272)](_0x5d5444=>_0x5d5444[_0x4eaa2e(0x1bd)]),_0x47c82d=_0x540441[_0x4eaa2e(0x222)](_0x466f1e=>_0x466f1e[_0x4eaa2e(0x217)]===_0x4eaa2e(0x1af)),_0xc6b8c7=_0x540441['filter'](_0x33ef42=>_0x33ef42['type']===_0x4eaa2e(0x25b)),_0x231eaf=_0x540441[_0x4eaa2e(0x222)](_0x3c1842=>_0x3c1842[_0x4eaa2e(0x217)]===_0x4eaa2e(0x275)),_0x448115=Array[_0x4eaa2e(0x27b)](_0x4f769c)['sort'](),_0x1952b6=_0x695312?![]:_0x593a5b[_0x4eaa2e(0x1b0)]>0x0||_0x512349['length']>0x0||_0x5243e5[_0x4eaa2e(0x1b0)]>0x0,_0x43299d=_0x527d0a[_0x4eaa2e(0x1b0)]>0x0||_0x3bc95d['length']>0x0||_0x26c6d3['length']>0x0,_0x4dba67=_0x695312?![]:_0x540441[_0x4eaa2e(0x1b0)]>0x0,_0x12737b=_0x448115[_0x4eaa2e(0x1b0)]>0x0;return{'segments':{'new':_0x593a5b,'changed':_0x512349,'unchanged':_0x50ebd1,'toDelete':_0x5243e5},'journeys':{'new':_0x527d0a,'changed':_0x3bc95d,'unchanged':_0x1187eb,'toDelete':_0x26c6d3},'activations':{'all':_0x540441,'toCreate':_0x47c82d,'toUpdate':_0xc6b8c7,'toDelete':_0x231eaf},'folders':{'toCreate':_0x448115},'counts':{'segments':{'new':_0x593a5b[_0x4eaa2e(0x1b0)],'changed':_0x512349['length'],'unchanged':_0x50ebd1[_0x4eaa2e(0x1b0)],'toDelete':_0x5243e5[_0x4eaa2e(0x1b0)]},'journeys':{'new':_0x527d0a[_0x4eaa2e(0x1b0)],'changed':_0x3bc95d['length'],'unchanged':_0x1187eb[_0x4eaa2e(0x1b0)],'toDelete':_0x26c6d3[_0x4eaa2e(0x1b0)]},'activations':{'create':_0x47c82d[_0x4eaa2e(0x1b0)],'update':_0xc6b8c7[_0x4eaa2e(0x1b0)],'delete':_0x231eaf[_0x4eaa2e(0x1b0)]},'folders':_0x448115[_0x4eaa2e(0x1b0)]},'hasChanges':_0x1952b6||_0x43299d||_0x4dba67||_0x12737b};}export async function buildPushExecutionContext(_0x2f7a61,_0x3c75c7,_0x9e55f6,_0x27b468,_0x506517,_0x1fa34c){const _0x4ffba3=a119_0x5aaea3,_0x162291=extractRootFolderId(_0x9e55f6),{pathToId:_0x5471af,idToPath:_0x3809b5}=buildFolderMaps(_0x506517),_0x47797b=buildSegmentNameToIdMap(_0x27b468),_0x424e25=new Map(),{batchAsync:_0x48827b}=await import(_0x4ffba3(0x223)),[_0x29b781,_0x5f41e7]=await Promise['all']([_0x2f7a61[_0x4ffba3(0x1fc)][_0x4ffba3(0x227)](),_0x2f7a61[_0x4ffba3(0x1c6)][_0x4ffba3(0x251)](),((async()=>{!_0x1fa34c&&_0x27b468['length']>0x0&&await _0x48827b(_0x27b468,async _0x3f4302=>{const _0x43db51=a119_0x5cd8,_0x13319e=await _0x2f7a61[_0x43db51(0x1ca)]['listActivations'](_0x3c75c7,_0x3f4302['id']);_0x424e25[_0x43db51(0x266)](_0x3f4302['id'],_0x13319e);});})())]),{emailToId:_0x5d1f9a,idToEmail:_0x51cd73}=_0x29b781,_0x7b26b4=buildConnectionMaps(_0x5f41e7);return{'rootFolderId':_0x162291,'folderPathToId':_0x5471af,'folderIdToPath':_0x3809b5,'segmentNameToId':_0x47797b,'activationsBySegmentId':_0x424e25,'emailToIdMap':_0x5d1f9a,'idToEmailMap':_0x51cd73,'connectionNameToIdMap':_0x7b26b4[_0x4ffba3(0x288)],'connectionIdToNameMap':_0x7b26b4[_0x4ffba3(0x21f)],'connectionNameToTypeMap':_0x7b26b4[_0x4ffba3(0x284)]};}export function createPushYamlContextForBundle(_0x234b90,_0x37d6a2,_0xc1d3d9,_0x456e8d,_0x19b088,_0x2dad62,_0x16fd42,_0x10eb8f){const {existingLocalSegmentNames:_0x5d3541,localExpandedRuleToNames:_0x1f6dbb}=_0x456e8d,_0x57b7d4=new Set(),_0x2040a0=new Map(),_0x3662c9=new Map(),_0x288bbc=new Map(),_0xe6fd10=createJumpTargetCache(),_0x388945=new Map(),_0x35d8c0=new Map(),_0x14bc65=new Set();let _0x51afb1;const _0x3c6d11=_0x1a5242=>{const _0x348143={'resolveSegment':async _0x122a54=>{const _0x199ec8=a119_0x5cd8,_0x99192a=_0x288bbc['get'](_0x122a54);if(_0x99192a!==undefined)return{'name':_0x99192a,'isJourneyLocal':!![]};try{let _0xb43a01=_0xc1d3d9[_0x199ec8(0x286)](_0x259ce2=>_0x259ce2['id']===_0x122a54);!_0xb43a01&&(_0xb43a01=await _0x234b90[_0x199ec8(0x1ca)][_0x199ec8(0x29a)](_0x37d6a2,_0x122a54));const _0x5339ef=generateJourneyLocalName(_0xb43a01[_0x199ec8(0x1c2)]),_0x58057b=_0xb43a01[_0x199ec8(0x278)]===SEGMENT_KIND_JOURNEY&&_0x5339ef!==undefined;let _0x2ffc60=_0xb43a01[_0x199ec8(0x1c2)],_0x1eb9f3;if(_0x58057b&&_0xb43a01[_0x199ec8(0x250)]){const _0x4622c4=apiRuleToYaml(_0xb43a01[_0x199ec8(0x250)]);_0x35d8c0[_0x199ec8(0x266)](_0x122a54,_0x4622c4);const _0x57d4a0=async _0x9f3461=>{const _0x479b22=_0x199ec8,_0x33ed44=collectSegmentRefsFromRule(_0x9f3461);for(const _0x441278 of _0x33ed44){if(!_0x35d8c0[_0x479b22(0x213)](_0x441278))try{const _0x37c7cb=await _0x234b90[_0x479b22(0x1ca)]['getSegment'](_0x37d6a2,_0x441278);if(_0x37c7cb?.[_0x479b22(0x250)]){const _0x8ef071=apiRuleToYaml(_0x37c7cb[_0x479b22(0x250)]);_0x35d8c0[_0x479b22(0x266)](_0x441278,_0x8ef071),await _0x57d4a0(_0x8ef071);}}catch{}}};await _0x57d4a0(_0x4622c4);const _0x269b16=serializeExpandedRule(_0x4622c4,_0x35d8c0),_0x3c52b6=_0x1f6dbb[_0x199ec8(0x1d1)](_0x269b16);if(_0x3c52b6&&_0x3c52b6['length']>0x0){const _0x187106=_0x2040a0[_0x199ec8(0x1d1)](_0x269b16)||0x0,_0xe108b4=_0x3c52b6[_0x187106]||_0x3c52b6[_0x3c52b6[_0x199ec8(0x1b0)]-0x1];_0x2040a0[_0x199ec8(0x266)](_0x269b16,_0x187106+0x1),_0x2ffc60=_0xe108b4,_0x57b7d4[_0x199ec8(0x20b)](_0x2ffc60),_0x288bbc[_0x199ec8(0x266)](_0x122a54,_0x2ffc60);const _0x5d7839=await resolveRuleSegmentRefs(_0x4622c4,async _0x3d45f5=>{const _0x14d5f1=_0x199ec8,_0x41fb6d=_0x288bbc[_0x14d5f1(0x1d1)](_0x3d45f5);if(_0x41fb6d)return _0x41fb6d;const _0x2aff25=await _0x51afb1[_0x14d5f1(0x207)](_0x3d45f5);return _0x2aff25['name'];});_0x1eb9f3={'description':_0xb43a01[_0x199ec8(0x21d)],'rule':_0x5d7839};}else{const _0x142253=_0x388945[_0x199ec8(0x1d1)](_0x269b16);if(_0x142253)_0x2ffc60=_0x142253,_0x288bbc[_0x199ec8(0x266)](_0x122a54,_0x2ffc60);else{if(_0x5339ef){let _0x8488e0=_0x5339ef,_0x480765=0x2;while(_0x57b7d4[_0x199ec8(0x213)](_0x8488e0)||_0x5d3541[_0x199ec8(0x213)](_0x8488e0)){_0x8488e0=_0x5339ef+'_'+_0x480765,_0x480765++;}_0x57b7d4[_0x199ec8(0x20b)](_0x8488e0),_0x2ffc60=_0x8488e0;}_0x288bbc[_0x199ec8(0x266)](_0x122a54,_0x2ffc60),_0x388945[_0x199ec8(0x266)](_0x269b16,_0x2ffc60);const _0x42d7ca=await resolveRuleSegmentRefs(_0x4622c4,async _0x4cf44f=>{const _0x406dee=_0x199ec8,_0x1dc510=_0x288bbc[_0x406dee(0x1d1)](_0x4cf44f);if(_0x1dc510)return _0x1dc510;const _0x34691=await _0x51afb1[_0x406dee(0x207)](_0x4cf44f);return _0x34691[_0x406dee(0x1c2)];});_0x1eb9f3={'description':_0xb43a01[_0x199ec8(0x21d)],'rule':_0x42d7ca};}}}return{'name':_0x2ffc60,'isJourneyLocal':_0x58057b,'definition':_0x1eb9f3};}catch{return{'name':_0x122a54,'isJourneyLocal':![]};}},'resolveActivation':async _0x599063=>{const _0x46f7e6=a119_0x5cd8,_0x2c4c38=_0x3662c9[_0x46f7e6(0x1d1)](_0x599063);if(_0x2c4c38!==undefined)return{'name':_0x2c4c38,'isJourneyLocal':!![]};try{let _0xe931cc=_0x16fd42?.[_0x46f7e6(0x1d1)](_0x599063);!_0xe931cc&&(_0xe931cc=await _0x234b90[_0x46f7e6(0x22a)][_0x46f7e6(0x255)](_0x1a5242,_0x599063));const _0x23b92c=_0xe931cc[_0x46f7e6(0x24a)][_0x46f7e6(0x261)]['name']||_0x599063,_0x31646d=sanitizeYamlKey(_0x23b92c)||_0x46f7e6(0x233)+_0x599063,_0x3b40b4=_0x31646d;_0x3662c9['set'](_0x599063,_0x3b40b4);const _0x2e3ef5=journeyActivationStepToYaml(_0xe931cc,_0x19b088,_0x2dad62);return{'name':_0x3b40b4,'isJourneyLocal':!![],'definition':_0x2e3ef5};}catch{return{'name':_0x599063,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x461ecb,_0x5aeb41)=>resolveJumpTarget(_0x461ecb,_0x5aeb41,_0xe6fd10,async _0x4727d8=>{const _0x5274eb=a119_0x5cd8,_0x36af7e=_0x10eb8f?.['get'](_0x4727d8);if(_0x36af7e)return _0x36af7e;return _0x234b90[_0x5274eb(0x22a)][_0x5274eb(0x281)](_0x4727d8);})};return _0x51afb1=_0x348143,_0x348143;},_0x53c51f=async _0xc64557=>{const _0x36b500=a119_0x5cd8,{collectSegmentIdsFromJourneyApi:_0x153eed}=await import('./journey-yaml.js'),{batchAsync:_0x35ee8d}=await import(_0x36b500(0x223)),_0x15854c=new Set();for(const _0x15c5f7 of _0xc64557){let _0x36e7de=_0x10eb8f?.[_0x36b500(0x1d1)](_0x15c5f7);!_0x36e7de&&(_0x36e7de=await _0x234b90[_0x36b500(0x22a)][_0x36b500(0x281)](_0x15c5f7));const _0x50aad6=_0x153eed(_0x36e7de);for(const _0x378ae4 of _0x50aad6){_0x15854c['add'](_0x378ae4);}}let _0x44c540=Array[_0x36b500(0x27b)](_0x15854c);while(_0x44c540[_0x36b500(0x1b0)]>0x0){const _0x5dac6b=_0x44c540[_0x36b500(0x222)](_0x146db5=>!_0x14bc65[_0x36b500(0x213)](_0x146db5));if(_0x5dac6b[_0x36b500(0x1b0)]===0x0)break;const _0x4037aa=await _0x35ee8d(_0x5dac6b,async _0x5ddc45=>{const _0x2e4a86=_0x36b500;_0x14bc65['add'](_0x5ddc45);let _0x5af3e7=_0xc1d3d9[_0x2e4a86(0x286)](_0xb4c7a6=>_0xb4c7a6['id']===_0x5ddc45);if(!_0x5af3e7)try{_0x5af3e7=await _0x234b90[_0x2e4a86(0x1ca)][_0x2e4a86(0x29a)](_0x37d6a2,_0x5ddc45);}catch{return null;}return{'segmentId':_0x5ddc45,'segment':_0x5af3e7};},0xa),_0x35601d=new Set();for(const _0x1707a6 of _0x4037aa){if(!_0x1707a6?.[_0x36b500(0x1ca)]?.['rule'])continue;const _0x2bf15b=apiRuleToYaml(_0x1707a6[_0x36b500(0x1ca)][_0x36b500(0x250)]);_0x35d8c0[_0x36b500(0x266)](_0x1707a6[_0x36b500(0x283)],_0x2bf15b);const _0x3909c8=collectSegmentRefsFromRule(_0x2bf15b);for(const _0x50cbe9 of _0x3909c8){!_0x14bc65[_0x36b500(0x213)](_0x50cbe9)&&_0x35601d[_0x36b500(0x20b)](_0x50cbe9);}}_0x44c540=Array[_0x36b500(0x27b)](_0x35601d);}};return{'createYamlContext':_0x3c6d11,'prefetchJourneySegments':_0x53c51f};}export async function executePushSegments(_0x38ccc3,_0xa4348,_0x38668d,_0x51d6c7,_0x57bddc){const _0x544386=a119_0x5aaea3,{segmentDefToCreateRequest:_0xd4008a,segmentDefToUpdateRequest:_0xc2a599}=await import(_0x544386(0x29c)),_0x3f755b=_0x38668d[_0x544386(0x295)],_0x3a6c8d=0x5,_0x7b469d=async _0x15dc70=>{const _0x2beaba=_0x544386,_0x59bc30=_0x15dc70[_0x2beaba(0x280)]?_0x3f755b[_0x2beaba(0x1d1)](_0x15dc70['folderPath']):undefined;let _0x569011;const _0x5be887={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x15dc70[_0x2beaba(0x1ad)]){_0x57bddc[_0x2beaba(0x26d)]?.({'type':'segment_creating','name':_0x15dc70[_0x2beaba(0x285)]['name']});const _0x47a954=_0xd4008a(_0x15dc70[_0x2beaba(0x285)],_0x59bc30),_0x216ad7=await _0x57bddc[_0x2beaba(0x22c)](_0x2beaba(0x268)+_0x15dc70['yamlConfig']['name']+_0x2beaba(0x293),()=>_0x38ccc3[_0x2beaba(0x1ca)][_0x2beaba(0x200)](_0x51d6c7[_0x2beaba(0x229)],_0x47a954));_0x569011=_0x216ad7[_0x2beaba(0x23b)]['id'],_0x5be887[_0x2beaba(0x247)]={'name':_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)],'id':_0x569011},_0x57bddc[_0x2beaba(0x26d)]?.({'type':_0x2beaba(0x29b),'name':_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)],'segmentId':_0x569011}),_0x57bddc[_0x2beaba(0x1e4)]?.('Created\x20segment\x20\x27'+_0x15dc70['yamlConfig'][_0x2beaba(0x1c2)]+'\x27'),_0x5be887['created']=0x1;}else{if(_0x15dc70[_0x2beaba(0x1e2)]){_0x57bddc[_0x2beaba(0x26d)]?.({'type':_0x2beaba(0x22e),'name':_0x15dc70['yamlConfig'][_0x2beaba(0x1c2)]});const _0x3f99e6=_0xc2a599(_0x15dc70[_0x2beaba(0x285)]);_0x59bc30!==_0x15dc70['existingSegment']?.[_0x2beaba(0x218)]&&(_0x3f99e6[_0x2beaba(0x218)]=_0x59bc30?parseInt(_0x59bc30,0xa):undefined),await _0x57bddc[_0x2beaba(0x22c)](_0x2beaba(0x243)+_0x15dc70[_0x2beaba(0x285)]['name']+_0x2beaba(0x293),()=>_0x38ccc3[_0x2beaba(0x1ca)][_0x2beaba(0x1d6)](_0x51d6c7[_0x2beaba(0x229)],_0x15dc70[_0x2beaba(0x1cb)]['id'],_0x3f99e6)),_0x569011=_0x15dc70[_0x2beaba(0x1cb)]['id'],_0x57bddc[_0x2beaba(0x26d)]?.({'type':_0x2beaba(0x254),'name':_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)]}),_0x57bddc[_0x2beaba(0x1e4)]?.(_0x2beaba(0x1cd)+_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)]+'\x27'),_0x5be887[_0x2beaba(0x27e)]=0x1;}else _0x569011=_0x15dc70[_0x2beaba(0x1cb)]['id'];}}catch(_0x2d2b67){const _0x4701ef=isHttp400Error(_0x2d2b67),_0x33da72=_0x4701ef?ErrorCode[_0x2beaba(0x1cc)]:ErrorCode[_0x2beaba(0x1cf)],_0x48ad97=getErrorMessage(_0x2d2b67);throw new SDKError(_0x33da72,_0x2beaba(0x232)+(_0x15dc70[_0x2beaba(0x1ad)]?_0x2beaba(0x1af):'update')+_0x2beaba(0x1b7)+_0x15dc70[_0x2beaba(0x234)]+_0x2beaba(0x262)+_0x48ad97,_0x2d2b67);}try{const _0x2bab2a=await syncActivationsForSegment(_0x38ccc3,_0x51d6c7[_0x2beaba(0x229)],_0x569011,_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)],_0x15dc70[_0x2beaba(0x1bd)],_0x57bddc,_0x15dc70[_0x2beaba(0x234)]);_0x5be887[_0x2beaba(0x265)]=_0x2bab2a;}catch(_0x44e195){if(_0x44e195 instanceof SDKError)throw _0x44e195;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2beaba(0x248)+_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)]+_0x2beaba(0x1dc)+_0x15dc70[_0x2beaba(0x234)]+'\x0a\x20\x20'+getErrorMessage(_0x44e195),_0x44e195);}return _0x5be887;},_0x5b3b58=await batchAsync(_0xa4348,_0x7b469d,_0x3a6c8d),_0x24e5f6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x12fbe0 of _0x5b3b58){_0x24e5f6['created']+=_0x12fbe0[_0x544386(0x1d9)],_0x24e5f6[_0x544386(0x27e)]+=_0x12fbe0['updated'],_0x12fbe0[_0x544386(0x247)]&&_0x24e5f6[_0x544386(0x1ed)]['set'](_0x12fbe0[_0x544386(0x247)][_0x544386(0x1c2)],_0x12fbe0['createdSegmentId']['id']),_0x24e5f6['activations']['created']+=_0x12fbe0[_0x544386(0x265)]['created'],_0x24e5f6['activations'][_0x544386(0x27e)]+=_0x12fbe0[_0x544386(0x265)][_0x544386(0x27e)],_0x24e5f6['activations']['deleted']+=_0x12fbe0['activations'][_0x544386(0x241)];}return _0x24e5f6;}async function syncActivationsForSegment(_0x639dd6,_0x416e04,_0x537102,_0x35ff2d,_0x2c2f85,_0x31f47c,_0xc0cc74){const _0x4005c1=a119_0x5aaea3,_0x31de3e={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5e65c8 of _0x2c2f85){try{if(_0x5e65c8[_0x4005c1(0x217)]===_0x4005c1(0x1af)&&_0x5e65c8[_0x4005c1(0x209)])_0x31f47c[_0x4005c1(0x26d)]?.({'type':_0x4005c1(0x244),'segmentName':_0x35ff2d,'activationName':_0x5e65c8[_0x4005c1(0x1c2)]}),await _0x31f47c[_0x4005c1(0x22c)](_0x4005c1(0x253)+_0x5e65c8['name']+_0x4005c1(0x293),()=>_0x639dd6[_0x4005c1(0x1ca)][_0x4005c1(0x297)](_0x416e04,_0x537102,_0x5e65c8[_0x4005c1(0x209)])),_0x31f47c['onProgress']?.({'type':_0x4005c1(0x21c),'segmentName':_0x35ff2d,'activationName':_0x5e65c8[_0x4005c1(0x1c2)]}),_0x31f47c[_0x4005c1(0x1e4)]?.(_0x4005c1(0x267)+_0x5e65c8['name']+'\x27'),_0x31de3e[_0x4005c1(0x1d9)]++;else{if(_0x5e65c8[_0x4005c1(0x217)]==='update'&&_0x5e65c8['validatedRequest']&&_0x5e65c8[_0x4005c1(0x26a)])_0x31f47c[_0x4005c1(0x26d)]?.({'type':_0x4005c1(0x23e),'segmentName':_0x35ff2d,'activationName':_0x5e65c8[_0x4005c1(0x1c2)]}),await _0x31f47c[_0x4005c1(0x22c)](_0x4005c1(0x20e)+_0x5e65c8['name']+_0x4005c1(0x293),()=>_0x639dd6['segment'][_0x4005c1(0x23f)](_0x416e04,_0x537102,_0x5e65c8['existingActivation']['id'],_0x5e65c8[_0x4005c1(0x209)])),_0x31f47c[_0x4005c1(0x26d)]?.({'type':_0x4005c1(0x24b),'segmentName':_0x35ff2d,'activationName':_0x5e65c8['name']}),_0x31f47c[_0x4005c1(0x1e4)]?.(_0x4005c1(0x238)+_0x5e65c8[_0x4005c1(0x1c2)]+'\x27'),_0x31de3e[_0x4005c1(0x27e)]++;else _0x5e65c8['type']===_0x4005c1(0x275)&&_0x5e65c8[_0x4005c1(0x26a)]&&(_0x31f47c[_0x4005c1(0x26d)]?.({'type':_0x4005c1(0x277),'segmentName':_0x35ff2d,'activationName':_0x5e65c8['name']}),await _0x31f47c['withProgress'](_0x4005c1(0x28f)+_0x5e65c8['name']+_0x4005c1(0x293),()=>_0x639dd6[_0x4005c1(0x1ca)][_0x4005c1(0x1fe)](_0x416e04,_0x537102,_0x5e65c8[_0x4005c1(0x26a)]['id'])),_0x31f47c[_0x4005c1(0x26d)]?.({'type':_0x4005c1(0x1fd),'segmentName':_0x35ff2d,'activationName':_0x5e65c8[_0x4005c1(0x1c2)]}),_0x31f47c[_0x4005c1(0x228)]?.(_0x4005c1(0x1e9)+_0x5e65c8[_0x4005c1(0x1c2)]+'\x27'),_0x31de3e[_0x4005c1(0x241)]++);}}catch(_0x1c2393){const _0x9d867d=isHttp400Error(_0x1c2393),_0x2d6664=_0x9d867d?ErrorCode[_0x4005c1(0x1b3)]:ErrorCode[_0x4005c1(0x269)],_0x44eb48=getErrorMessage(_0x1c2393);throw new SDKError(_0x2d6664,_0x4005c1(0x232)+_0x5e65c8[_0x4005c1(0x217)]+'\x20activation\x20\x27'+_0x5e65c8['name']+_0x4005c1(0x1dc)+_0xc0cc74+_0x4005c1(0x262)+_0x44eb48,_0x1c2393);}}return _0x31de3e;}export async function executePushFolders(_0x2a463f,_0x3e0991,_0x1306e7,_0x1fcdc2,_0x21c8e0){const _0x221527=a119_0x5aaea3,_0x60c4=new Map(_0x1306e7);for(const _0x49b813 of _0x3e0991){const _0x27b407=_0x49b813[_0x221527(0x27c)]('/'),_0x43b819=_0x27b407[_0x27b407['length']-0x1],_0x4da8e1=_0x27b407['slice'](0x0,-0x1)[_0x221527(0x1f6)]('/'),_0x505ebe=_0x60c4[_0x221527(0x1d1)](_0x4da8e1);_0x21c8e0[_0x221527(0x26d)]?.({'type':_0x221527(0x212),'folder':_0x49b813});const _0x1b019d={'name':_0x43b819,'parentFolderId':_0x505ebe},_0x282d8b=await _0x21c8e0[_0x221527(0x22c)](_0x221527(0x299)+_0x49b813+'\x27...',()=>_0x2a463f[_0x221527(0x1ca)][_0x221527(0x215)](_0x1fcdc2[_0x221527(0x229)],_0x1b019d));_0x60c4['set'](_0x49b813,_0x282d8b[_0x221527(0x23b)]['id']),_0x21c8e0['onProgress']?.({'type':'folder_created','folder':_0x49b813,'folderId':_0x282d8b[_0x221527(0x23b)]['id']}),_0x21c8e0[_0x221527(0x1d2)]?.('Created\x20folder\x20\x27'+_0x49b813+'\x27');}return _0x60c4;}export async function executePushSegmentDeletions(_0x36ee81,_0x5124bd,_0x5dc090){const _0x51a552=a119_0x5aaea3;if(_0x5124bd['length']===0x0)return 0x0;const {batchAsync:_0x3c9838}=await import('../../utils/async.js'),_0xcd140c=0x5,_0x15c330=await _0x3c9838(_0x5124bd,async _0x2799a0=>{const _0x2d5414=a119_0x5cd8;return _0x5dc090[_0x2d5414(0x26d)]?.({'type':_0x2d5414(0x1c3),'name':_0x2799a0[_0x2d5414(0x1c2)]}),await _0x36ee81[_0x2d5414(0x1ca)]['deleteSegment'](_0x2799a0['id']),_0x5dc090[_0x2d5414(0x26d)]?.({'type':_0x2d5414(0x258),'name':_0x2799a0[_0x2d5414(0x1c2)]}),_0x5dc090['logDeleted']?.(_0x2d5414(0x1c1)+_0x2799a0['name']+'\x27'),0x1;},_0xcd140c);return _0x15c330[_0x51a552(0x1e6)]((_0x3b730e,_0x1a1904)=>_0x3b730e+_0x1a1904,0x0);}export async function executePushJourneys(_0x49805d,_0x1a8de2,_0x3affe,_0x4603d8,_0xa45f6a){const _0x5b53b3=a119_0x5aaea3,{journeyDefToRequest:_0x3b1e2c}=await import(_0x5b53b3(0x28a)),{activationDefToCreateRequest:_0x4430e2,yamlRuleToApi:_0x579810,validateSegmentRule:_0x18da5b}=await import(_0x5b53b3(0x29c)),_0x31cbe0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x959272=new Map(_0x3affe[_0x5b53b3(0x25c)]),_0xcf4215=0x5;for(let _0x14b251=0x0;_0x14b251<_0x1a8de2[_0x5b53b3(0x1b0)];_0x14b251+=_0xcf4215){const _0xdc6ec=_0x1a8de2[_0x5b53b3(0x211)](_0x14b251,_0x14b251+_0xcf4215),_0x1376b2=await Promise[_0x5b53b3(0x1d0)](_0xdc6ec['map'](async _0x40ed0e=>{const _0x2805a8=_0x5b53b3;if(!_0x40ed0e[_0x2805a8(0x1ad)]&&!_0x40ed0e[_0x2805a8(0x1e2)])return{'action':_0x2805a8(0x259),'name':_0x40ed0e[_0x2805a8(0x285)][_0x2805a8(0x1c2)],'journeyId':_0x40ed0e['existingJourney']?.['id']};const _0x1c0622=_0x40ed0e[_0x2805a8(0x280)]?_0x3affe[_0x2805a8(0x295)]['get'](_0x40ed0e['folderPath']):undefined;_0xa45f6a[_0x2805a8(0x26d)]?.({'type':_0x40ed0e[_0x2805a8(0x1ad)]?_0x2805a8(0x279):_0x2805a8(0x23a),'name':_0x40ed0e[_0x2805a8(0x285)]['name']});try{const _0x5e39e0=await executeSingleJourneyPush(_0x49805d,_0x40ed0e,{..._0x3affe,'segmentNameToId':_0x959272},{'parentId':_0x4603d8['parentId'],'rootFolderId':_0x4603d8[_0x2805a8(0x221)],'folderId':_0x1c0622,'verbose':_0x4603d8['verbose']},_0xa45f6a,{'journeyDefToRequest':_0x3b1e2c,'activationDefToCreateRequest':_0x4430e2,'yamlRuleToApi':_0x579810,'validateSegmentRule':_0x18da5b});for(const [_0x1a3426,_0x4d392d]of _0x5e39e0[_0x2805a8(0x1c0)]){_0x959272[_0x2805a8(0x266)](_0x1a3426,_0x4d392d),_0x31cbe0['embeddedSegmentNameToId'][_0x2805a8(0x266)](_0x1a3426,_0x4d392d);}if(_0x5e39e0[_0x2805a8(0x20f)]===_0x2805a8(0x1d9))_0xa45f6a[_0x2805a8(0x26d)]?.({'type':'journey_created','name':_0x40ed0e[_0x2805a8(0x285)]['name'],'journeyId':_0x5e39e0['journeyId']}),_0xa45f6a[_0x2805a8(0x1e4)]?.(_0x2805a8(0x298)+_0x40ed0e[_0x2805a8(0x285)][_0x2805a8(0x1c2)]+'\x27'),_0x31cbe0[_0x2805a8(0x1d9)]++;else _0x5e39e0[_0x2805a8(0x20f)]==='updated'&&(_0xa45f6a['onProgress']?.({'type':_0x2805a8(0x225),'name':_0x40ed0e[_0x2805a8(0x285)][_0x2805a8(0x1c2)]}),_0xa45f6a[_0x2805a8(0x1e4)]?.('Updated\x20journey\x20\x27'+_0x40ed0e[_0x2805a8(0x285)][_0x2805a8(0x1c2)]+'\x27'),_0x31cbe0[_0x2805a8(0x27e)]++);return{'action':_0x5e39e0['action'],'name':_0x40ed0e[_0x2805a8(0x285)][_0x2805a8(0x1c2)],'journeyId':_0x5e39e0[_0x2805a8(0x1fb)]};}catch(_0x395a0f){const _0x1b97f0=isHttp400Error(_0x395a0f),_0xe76edb=_0x1b97f0?ErrorCode[_0x2805a8(0x274)]:ErrorCode[_0x2805a8(0x260)],_0x20975d=getErrorMessage(_0x395a0f);throw new SDKError(_0xe76edb,_0x2805a8(0x232)+(_0x40ed0e[_0x2805a8(0x1ad)]?_0x2805a8(0x1af):'update')+'\x20journey\x20from\x20file:\x20'+_0x40ed0e[_0x2805a8(0x234)]+_0x2805a8(0x262)+_0x20975d,_0x395a0f);}}));_0x31cbe0[_0x5b53b3(0x257)][_0x5b53b3(0x1bc)](..._0x1376b2);}return _0x31cbe0;}async function executeSingleJourneyPush(_0xc05beb,_0x564c28,_0x42e0c1,_0x1ae742,_0x11037c,_0x52fe72){const _0x4a9599=a119_0x5aaea3,{journeyDefToRequest:_0x4c7e6a,activationDefToCreateRequest:_0x2b70b9,yamlRuleToApi:_0xd2d063,validateSegmentRule:_0x395bc7}=_0x52fe72,_0xdbbbe1=new Map(),_0x499106=new Map(),_0x35e713=new Map(),_0x2f2dcc=new Map(),_0x51054a=new Map();let _0x3677bd;const _0x3e18eb=async()=>{const _0x46cded=a119_0x5cd8;if(_0x3677bd)return;_0x3677bd=new Map();if(!_0x564c28[_0x46cded(0x239)])return;const _0xa1ec09=await _0xc05beb[_0x46cded(0x22a)][_0x46cded(0x252)](_0x564c28[_0x46cded(0x239)]['id']);for(const _0x1cad4a of _0xa1ec09){const _0x584923=journeyActivationStepToYaml(_0x1cad4a,_0x42e0c1[_0x46cded(0x1be)],_0x42e0c1[_0x46cded(0x1c5)]),_0x40144f=activationSignature(_0x584923);!_0x3677bd['has'](_0x40144f)&&_0x3677bd['set'](_0x40144f,_0x1cad4a['id']),_0x584923[_0x46cded(0x1c2)]&&_0x499106['set'](_0x584923['name'],_0x1cad4a['id']);}};if(_0x564c28['existingJourney']&&_0x564c28[_0x4a9599(0x285)][_0x4a9599(0x1f3)]){const _0x5aa588=buildLocalExpandedRuleMappings(_0x564c28[_0x4a9599(0x285)]),_0x52be07=_0x5aa588['localSegmentRules'];if(_0x52be07['size']>0x0){const _0xa91bdc=new Map();for(const [_0x1bb938,_0x20f3e5]of _0x52be07){const _0x27f9a9=serializeExpandedRule(_0x20f3e5,_0x52be07);_0xa91bdc[_0x4a9599(0x266)](_0x1bb938,_0x27f9a9);}const _0x48d6df=collectSegmentIdsFromJourneyApi(_0x564c28['existingJourney']);if(_0x48d6df[_0x4a9599(0x1f9)]>0x0){const _0x559d07=await buildServerSegmentRuleMap(_0xc05beb,_0x1ae742[_0x4a9599(0x229)],_0x42e0c1['existingSegments'],_0x48d6df);if(_0x559d07['size']>0x0){const _0x46c526=new Map();for(const [_0x1ea61a,_0x12adf8]of _0x559d07){const _0x388c06=serializeExpandedRule(_0x12adf8,_0x559d07);!_0x46c526['has'](_0x388c06)&&_0x46c526['set'](_0x388c06,_0x1ea61a);}for(const [_0xd79119,_0x2d30d5]of _0xa91bdc){const _0x5d5907=_0x46c526['get'](_0x2d30d5);_0x5d5907&&(_0x51054a[_0x4a9599(0x266)](_0xd79119,_0x5d5907),_0x42e0c1['segmentNameToId']['set'](_0xd79119,_0x5d5907));}}}}}const _0x588156={'resolveSegmentId':async _0x4295a9=>{const _0x1ffd00=_0x4a9599,_0x1e42f3=_0x42e0c1[_0x1ffd00(0x25c)][_0x1ffd00(0x1d1)](_0x4295a9);if(!_0x1e42f3)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1ffd00(0x1b9)+_0x4295a9+_0x1ffd00(0x235)+_0x564c28[_0x1ffd00(0x285)][_0x1ffd00(0x1c2)]+')');return _0x1e42f3;},'resolveEmbeddedSegmentId':async(_0x3582fa,_0x3dc942)=>{const _0x5ee239=_0x4a9599,_0x4316b6=_0x42e0c1['segmentNameToId'][_0x5ee239(0x1d1)](_0x3582fa);if(_0x4316b6)return _0x4316b6;const _0xc7ec48=_0x51054a[_0x5ee239(0x1d1)](_0x3582fa);if(_0xc7ec48)return _0x42e0c1[_0x5ee239(0x25c)][_0x5ee239(0x266)](_0x3582fa,_0xc7ec48),_0xc7ec48;const _0x353ad6=_0x42e0c1[_0x5ee239(0x20d)]['find'](_0x21a397=>_0x21a397['name']===_0x3582fa);if(_0x353ad6)return _0x42e0c1['segmentNameToId'][_0x5ee239(0x266)](_0x3582fa,_0x353ad6['id']),_0x353ad6['id'];if(_0x564c28[_0x5ee239(0x1ad)]){const {stageName:_0x4ad734,criteriaName:_0x34b934}=findSegmentCriteriaLocation(_0x564c28[_0x5ee239(0x285)],_0x3582fa);return _0x395bc7(_0x3582fa,_0x3dc942[_0x5ee239(0x250)]),_0x35e713['set'](_0x3582fa,{'definition':_0x3dc942,'stageName':_0x4ad734,'criteriaName':_0x34b934}),createPendingSegmentId(_0x3582fa);}const _0x369d56=_0x564c28[_0x5ee239(0x239)]?.['id'];if(!_0x369d56)throw new SDKError(ErrorCode['INTERNAL'],_0x5ee239(0x27a));_0x395bc7(_0x3582fa,_0x3dc942[_0x5ee239(0x250)]);const _0x325049=generateDeterministicJourneySegmentName(_0x564c28[_0x5ee239(0x285)]['name'],_0x3582fa),_0x455f71=_0x42e0c1['existingSegments'][_0x5ee239(0x286)](_0x13a743=>_0x13a743[_0x5ee239(0x1c2)]===_0x325049),_0x11c339=createSegmentIdResolver(_0x42e0c1['segmentNameToId'],_0x3582fa),_0x1794cd=await resolveRuleSegmentIds(_0x3dc942[_0x5ee239(0x250)],_0x11c339);let _0x3a1589;if(_0x455f71)await _0xc05beb[_0x5ee239(0x1ca)][_0x5ee239(0x1d6)](_0x1ae742['parentId'],_0x455f71['id'],{'description':_0x3dc942[_0x5ee239(0x21d)]||_0x5ee239(0x287)+_0x3582fa,'rule':_0xd2d063(_0x1794cd,!![]),'countPopulation':!![]}),_0x3a1589=_0x455f71['id'];else try{_0x3a1589=await _0xc05beb['segment'][_0x5ee239(0x1d4)]({'name':_0x325049,'description':_0x3dc942[_0x5ee239(0x21d)]||_0x5ee239(0x287)+_0x3582fa,'journeyId':_0x369d56,'rule':_0xd2d063(_0x1794cd,!![]),'countPopulation':!![],'parentFolderId':_0x1ae742[_0x5ee239(0x221)]||'','audienceId':_0x1ae742[_0x5ee239(0x229)]});}catch(_0x11cd09){const _0x45f770=_0x11cd09 instanceof Error&&_0x11cd09[_0x5ee239(0x22f)][_0x5ee239(0x25e)](_0x5ee239(0x1ee));if(_0x45f770){const _0x46a3e7=await _0xc05beb['segment']['listSegments'](_0x1ae742[_0x5ee239(0x229)]),_0x2713ea=_0x46a3e7[_0x5ee239(0x286)](_0x4028d9=>_0x4028d9[_0x5ee239(0x1c2)]===_0x325049);if(_0x2713ea)await _0xc05beb[_0x5ee239(0x1ca)]['updateSegmentById'](_0x1ae742[_0x5ee239(0x229)],_0x2713ea['id'],{'description':_0x3dc942[_0x5ee239(0x21d)]||_0x5ee239(0x287)+_0x3582fa,'rule':_0xd2d063(_0x1794cd,!![]),'countPopulation':!![]}),_0x3a1589=_0x2713ea['id'];else throw _0x11cd09;}else throw _0x11cd09;}return _0x42e0c1['segmentNameToId'][_0x5ee239(0x266)](_0x3582fa,_0x3a1589),_0xdbbbe1[_0x5ee239(0x266)](_0x3582fa,_0x3a1589),_0x3a1589;},'resolveActivationId':async _0x1e97ff=>{const _0x552b16=_0x4a9599,_0x31419a=_0x499106[_0x552b16(0x1d1)](_0x1e97ff);if(_0x31419a)return _0x31419a;if(_0x564c28['existingJourney']){await _0x3e18eb();const _0x5bba19=_0x499106[_0x552b16(0x1d1)](_0x1e97ff);if(_0x5bba19)return _0x5bba19;}throw new SDKError(ErrorCode[_0x552b16(0x22d)],'Activation\x20not\x20found:\x20'+_0x1e97ff+_0x552b16(0x235)+_0x564c28[_0x552b16(0x285)][_0x552b16(0x1c2)]+_0x552b16(0x240)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x56a61b,_0x3255cf)=>{const _0x26d113=_0x4a9599,_0x561a7f=_0x499106[_0x26d113(0x1d1)](_0x56a61b);if(_0x561a7f)return _0x561a7f;if(_0x564c28['isNew'])return _0x2f2dcc[_0x26d113(0x266)](_0x56a61b,_0x3255cf),createPendingActivationId(_0x56a61b);if(_0x564c28[_0x26d113(0x239)]){await _0x3e18eb();const _0x23cecd=_0x499106[_0x26d113(0x1d1)](_0x3255cf[_0x26d113(0x1c2)]);if(_0x23cecd)return _0x499106[_0x26d113(0x266)](_0x56a61b,_0x23cecd),_0x23cecd;const _0x2e2978=activationSignature(_0x3255cf),_0x2c0473=_0x3677bd?.[_0x26d113(0x1d1)](_0x2e2978);if(_0x2c0473)return _0x499106[_0x26d113(0x266)](_0x56a61b,_0x2c0473),_0x2c0473;const _0x3f6543=await _0x2b70b9(_0x3255cf,_0x42e0c1['activationContext']),_0x25ce23=await _0xc05beb[_0x26d113(0x22a)][_0x26d113(0x297)](_0x564c28[_0x26d113(0x239)]['id'],_0x3f6543);return _0x499106[_0x26d113(0x266)](_0x56a61b,_0x25ce23['id']),_0x25ce23['id'];}throw new SDKError(ErrorCode[_0x26d113(0x1e3)],_0x26d113(0x21e));},'resolveJourneyId':async _0x578ee9=>{const _0x319e2b=_0x4a9599;try{return await _0xc05beb[_0x319e2b(0x22a)][_0x319e2b(0x1b5)](_0x1ae742[_0x319e2b(0x229)],_0x578ee9);}catch(_0x3f0851){throw new SDKError(ErrorCode[_0x319e2b(0x22d)],'Journey\x20\x27'+_0x578ee9+_0x319e2b(0x216)+_0x564c28[_0x319e2b(0x285)]['name']+'\x27)',_0x3f0851);}},'resolveStageId':async(_0x8566a2,_0x2608dd)=>{const _0x400335=_0x4a9599,_0x382f1a=await _0xc05beb[_0x400335(0x22a)]['getJourney'](_0x8566a2),_0x745d93=_0x382f1a[_0x400335(0x24a)][_0x400335(0x1d8)][_0x400335(0x286)](_0x14f952=>_0x14f952[_0x400335(0x1c2)][_0x400335(0x230)]()===_0x2608dd[_0x400335(0x230)]());if(!_0x745d93?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x400335(0x20c)+_0x2608dd+_0x400335(0x1ae)+(_0x382f1a[_0x400335(0x24a)][_0x400335(0x1ce)]||_0x382f1a[_0x400335(0x24a)][_0x400335(0x1c2)])+'\x27');return _0x745d93['id'];}},_0x164213=await _0x4c7e6a(_0x564c28[_0x4a9599(0x285)],_0x1ae742['parentId'],_0x588156),_0x5e8d82=_0x1ae742[_0x4a9599(0x21a)]||_0x1ae742['rootFolderId'];_0x5e8d82&&(_0x164213[_0x4a9599(0x28c)]={'parentFolder':{'data':{'id':_0x5e8d82,'type':'folder'}}});if(_0x564c28[_0x4a9599(0x1ad)]){if(_0x35e713[_0x4a9599(0x1f9)]>0x0||_0x2f2dcc[_0x4a9599(0x1f9)]>0x0)return await executeThreeStepJourneyCreate(_0xc05beb,_0x564c28,_0x164213,{'pendingEmbeddedSegments':_0x35e713,'pendingEmbeddedActivations':_0x2f2dcc,'embeddedSegmentNameToId':_0xdbbbe1,'journeyActivationNameToId':_0x499106},{..._0x1ae742,'effectiveFolderId':_0x5e8d82},_0x42e0c1,_0x11037c,_0x52fe72);else{ensureJourneyDefaults(_0x164213[_0x4a9599(0x24a)]);const _0x3e693f=await _0xc05beb[_0x4a9599(0x22a)][_0x4a9599(0x1af)](_0x164213);return{'action':'created','journeyId':_0x3e693f['id'],'embeddedSegmentNameToId':_0xdbbbe1};}}else{if(_0x564c28[_0x4a9599(0x1e2)]&&_0x564c28[_0x4a9599(0x239)])return ensureJourneyDefaults(_0x164213['attributes']),await _0xc05beb['journey'][_0x4a9599(0x25b)](_0x564c28[_0x4a9599(0x239)]['id'],_0x164213),{'action':_0x4a9599(0x27e),'journeyId':_0x564c28[_0x4a9599(0x239)]['id'],'embeddedSegmentNameToId':_0xdbbbe1};}return{'action':_0x4a9599(0x259),'journeyId':_0x564c28['existingJourney']?.['id'],'embeddedSegmentNameToId':_0xdbbbe1};}function findSegmentCriteriaLocation(_0x1c5eeb,_0x463b91){const _0x3a474f=a119_0x5aaea3,_0x4e55f9=_0x1c5eeb[_0x3a474f(0x264)]||_0x1c5eeb[_0x3a474f(0x1f1)]?.[0x0]?.[_0x3a474f(0x264)]||[];let _0x5519ba=_0x3a474f(0x23d),_0x195d9f=_0x463b91;const _0x31a3d9=_0x1c5eeb[_0x3a474f(0x24f)]||_0x1c5eeb[_0x3a474f(0x1f1)]?.[0x0]?.['goal'];if(_0x31a3d9?.['segment']===_0x463b91)return{'stageName':_0x3a474f(0x24f),'criteriaName':_0x31a3d9[_0x3a474f(0x1c2)]||_0x463b91};_0x5a996b:for(const _0x108c18 of _0x4e55f9){if(_0x108c18[_0x3a474f(0x25a)]?.[_0x3a474f(0x1ca)]===_0x463b91){_0x5519ba=_0x108c18['name'],_0x195d9f=_0x108c18['entry_criteria'][_0x3a474f(0x1c2)]||_0x463b91;break;}if(_0x108c18[_0x3a474f(0x22b)])for(const _0x22d0ed of _0x108c18[_0x3a474f(0x22b)]){if(_0x22d0ed[_0x3a474f(0x217)]===_0x3a474f(0x204)&&_0x22d0ed['with']?.[_0x3a474f(0x1da)])for(const _0x28cf69 of _0x22d0ed['with'][_0x3a474f(0x1da)]){if(_0x28cf69['segment']===_0x463b91){_0x5519ba=_0x108c18['name'],_0x195d9f=_0x28cf69[_0x3a474f(0x1c2)]||_0x463b91;break _0x5a996b;}}}}return{'stageName':_0x5519ba,'criteriaName':_0x195d9f};}async function executeThreeStepJourneyCreate(_0x4c1a9e,_0x209a50,_0x291897,_0x268037,_0x50d685,_0x3d862b,_0x252251,_0x59149d){const _0x3ec179=a119_0x5aaea3,{activationDefToCreateRequest:_0x42b3aa,yamlRuleToApi:_0xebc55e}=_0x59149d,{pendingEmbeddedSegments:_0x5d4044,pendingEmbeddedActivations:_0x4c890d,embeddedSegmentNameToId:_0x2f4551}=_0x268037,_0x3c4243=JSON[_0x3ec179(0x245)](JSON[_0x3ec179(0x1ea)](_0x291897));ensureJourneyDefaults(_0x3c4243[_0x3ec179(0x24a)]),stripPendingIds(_0x3c4243);const _0xa833a3=await _0x4c1a9e[_0x3ec179(0x22a)]['create'](_0x3c4243),_0x19b5c0=_0xa833a3['id'],_0x3ae094=new Map();for(const _0x4db034 of _0xa833a3['attributes'][_0x3ec179(0x1d8)]){_0x3ae094[_0x3ec179(0x266)](_0x4db034[_0x3ec179(0x1c2)][_0x3ec179(0x230)](),_0x4db034['id']);}for(const [_0x572141,{definition:_0x5859db}]of _0x5d4044){const _0x18b94b=generateDeterministicJourneySegmentName(_0x209a50[_0x3ec179(0x285)]['name'],_0x572141);_0x252251['onProgress']?.({'type':_0x3ec179(0x220),'journeyName':_0x209a50['yamlConfig'][_0x3ec179(0x1c2)],'segmentName':_0x572141});const _0x295b81=createSegmentIdResolver(_0x3d862b[_0x3ec179(0x25c)],_0x572141),_0x12a840=await resolveRuleSegmentIds(_0x5859db[_0x3ec179(0x250)],_0x295b81),_0x8528d8=await _0x4c1a9e['segment'][_0x3ec179(0x1d4)]({'name':_0x18b94b,'description':_0x5859db[_0x3ec179(0x21d)]||_0x3ec179(0x287)+_0x572141,'journeyId':_0x19b5c0,'rule':_0xebc55e(_0x12a840,!![]),'countPopulation':!![],'parentFolderId':_0x50d685[_0x3ec179(0x1ec)]||'','audienceId':_0x50d685[_0x3ec179(0x229)]});_0x2f4551[_0x3ec179(0x266)](_0x572141,_0x8528d8),_0x3d862b[_0x3ec179(0x25c)][_0x3ec179(0x266)](_0x572141,_0x8528d8),_0x252251[_0x3ec179(0x26d)]?.({'type':_0x3ec179(0x292),'journeyName':_0x209a50['yamlConfig'][_0x3ec179(0x1c2)],'segmentName':_0x572141});}const _0x4f3b0b=new Map();for(const [_0x203fad,_0x53e456]of _0x4c890d){_0x252251['onProgress']?.({'type':_0x3ec179(0x1e7),'journeyName':_0x209a50[_0x3ec179(0x285)]['name'],'activationName':_0x203fad});const _0x359418=await _0x42b3aa(_0x53e456,_0x3d862b[_0x3ec179(0x1f2)]),_0x77c67b=await _0x4c1a9e['journey'][_0x3ec179(0x297)](_0x19b5c0,_0x359418);_0x4f3b0b['set'](_0x203fad,_0x77c67b['id']),_0x268037[_0x3ec179(0x1b2)][_0x3ec179(0x266)](_0x203fad,_0x77c67b['id']),_0x252251[_0x3ec179(0x26d)]?.({'type':_0x3ec179(0x1b8),'journeyName':_0x209a50[_0x3ec179(0x285)][_0x3ec179(0x1c2)],'activationName':_0x203fad});}const _0x3f848a=JSON[_0x3ec179(0x245)](JSON['stringify'](_0x291897));return _0x3f848a['id']=_0x19b5c0,ensureJourneyDefaults(_0x3f848a[_0x3ec179(0x24a)]),resolvePendingIdsInRequest(_0x3f848a,_0x291897,_0x3ae094,_0x2f4551,_0x4f3b0b,_0x252251),await _0x4c1a9e['journey'][_0x3ec179(0x25b)](_0x19b5c0,_0x3f848a),{'action':'created','journeyId':_0x19b5c0,'embeddedSegmentNameToId':_0x2f4551};}function stripPendingIds(_0x11e904){const _0x56a257=a119_0x5aaea3;for(const _0x1126a0 of _0x11e904[_0x56a257(0x24a)]['journeyStages']||[]){_0x1126a0['entryCriteria']?.[_0x56a257(0x283)]&&isPendingSegmentId(_0x1126a0[_0x56a257(0x202)][_0x56a257(0x283)])&&delete _0x1126a0[_0x56a257(0x202)];if(_0x1126a0[_0x56a257(0x22b)])for(const _0x478969 of Object[_0x56a257(0x236)](_0x1126a0[_0x56a257(0x22b)])){const _0x173ab4=_0x1126a0['steps'][_0x478969];_0x173ab4[_0x56a257(0x217)]==='Activation'&&_0x173ab4[_0x56a257(0x1f8)]&&isPendingActivationId(_0x173ab4[_0x56a257(0x1f8)])&&(_0x173ab4['journeyActivationStepId']='');if(_0x173ab4[_0x56a257(0x217)]===_0x56a257(0x282)&&_0x173ab4[_0x56a257(0x1da)])for(const _0x3726c6 of _0x173ab4[_0x56a257(0x1da)]){_0x3726c6['segmentId']&&isPendingSegmentId(_0x3726c6[_0x56a257(0x283)])&&(_0x3726c6[_0x56a257(0x283)]='');}_0x173ab4[_0x56a257(0x217)]===_0x56a257(0x224)&&_0x173ab4[_0x56a257(0x26e)]?.[_0x56a257(0x283)]&&isPendingSegmentId(_0x173ab4[_0x56a257(0x26e)][_0x56a257(0x283)])&&(_0x173ab4[_0x56a257(0x26e)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x557cfb,_0x1ee3d3,_0x1961fc,_0x450c48,_0x219e7d,_0x373350){const _0x4aab0f=a119_0x5aaea3,_0x495fee=(_0x697ff0,_0x49357b)=>{const _0x10753e=a119_0x5cd8;if(!isPendingSegmentId(_0x697ff0))return _0x697ff0;const _0x2a2209=extractPendingSegmentName(_0x697ff0),_0x109a8b=_0x450c48[_0x10753e(0x1d1)](_0x2a2209);return!_0x109a8b&&_0x373350['logWarning']?.(_0x10753e(0x1de)+_0x2a2209+_0x10753e(0x27f)+_0x49357b),_0x109a8b;};if(_0x557cfb[_0x4aab0f(0x24a)][_0x4aab0f(0x24f)]?.['segmentId']&&isPendingSegmentId(_0x557cfb[_0x4aab0f(0x24a)][_0x4aab0f(0x24f)][_0x4aab0f(0x283)])){const _0x2fdbf5=_0x495fee(_0x557cfb[_0x4aab0f(0x24a)]['goal']['segmentId'],_0x4aab0f(0x219));_0x2fdbf5&&(_0x557cfb[_0x4aab0f(0x24a)]['goal']['segmentId']=_0x2fdbf5);}for(const _0x285ed7 of _0x557cfb[_0x4aab0f(0x24a)][_0x4aab0f(0x1d8)]||[]){const _0x47c973=_0x1961fc[_0x4aab0f(0x1d1)](_0x285ed7[_0x4aab0f(0x1c2)]['toLowerCase']());_0x47c973&&(_0x285ed7['id']=_0x47c973);if(_0x285ed7[_0x4aab0f(0x202)]?.['segmentId']&&isPendingSegmentId(_0x285ed7[_0x4aab0f(0x202)][_0x4aab0f(0x283)])){const _0x34e135=_0x495fee(_0x285ed7[_0x4aab0f(0x202)]['segmentId'],'stage\x20\x27'+_0x285ed7[_0x4aab0f(0x1c2)]+_0x4aab0f(0x291));_0x34e135&&(_0x285ed7[_0x4aab0f(0x202)]['segmentId']=_0x34e135);}if(_0x285ed7['exitCriterias'])for(const _0x2d9823 of _0x285ed7[_0x4aab0f(0x1b1)]){if(_0x2d9823['segmentId']&&isPendingSegmentId(_0x2d9823['segmentId'])){const _0x360e96=_0x495fee(_0x2d9823[_0x4aab0f(0x283)],_0x4aab0f(0x23c)+_0x285ed7[_0x4aab0f(0x1c2)]+_0x4aab0f(0x201));_0x360e96&&(_0x2d9823[_0x4aab0f(0x283)]=_0x360e96);}}if(_0x285ed7[_0x4aab0f(0x27d)]?.['segmentId']&&isPendingSegmentId(_0x285ed7[_0x4aab0f(0x27d)][_0x4aab0f(0x283)])){const _0x59cff7=_0x495fee(_0x285ed7[_0x4aab0f(0x27d)][_0x4aab0f(0x283)],_0x4aab0f(0x23c)+_0x285ed7[_0x4aab0f(0x1c2)]+_0x4aab0f(0x24e));_0x59cff7&&(_0x285ed7[_0x4aab0f(0x27d)][_0x4aab0f(0x283)]=_0x59cff7);}if(_0x285ed7[_0x4aab0f(0x22b)]){const _0x3d6ad8=_0x48985f=>_0x1ee3d3['attributes'][_0x4aab0f(0x1d8)][_0x4aab0f(0x286)](_0x17f1de=>_0x17f1de['name']['toLowerCase']()===_0x285ed7['name'][_0x4aab0f(0x230)]())?.['steps']?.[_0x48985f];for(const _0x2931cf of Object[_0x4aab0f(0x236)](_0x285ed7[_0x4aab0f(0x22b)])){const _0x4e5913=_0x285ed7['steps'][_0x2931cf],_0x319265=_0x3d6ad8(_0x2931cf);if(_0x4e5913[_0x4aab0f(0x217)]==='Activation'&&_0x4e5913['journeyActivationStepId']&&(isPendingActivationId(_0x4e5913[_0x4aab0f(0x1f8)])||_0x4e5913[_0x4aab0f(0x1f8)]==='')){if(_0x319265?.[_0x4aab0f(0x1f8)]&&isPendingActivationId(_0x319265[_0x4aab0f(0x1f8)])){const _0x1deb9e=extractPendingActivationName(_0x319265[_0x4aab0f(0x1f8)]),_0x2c0f00=_0x219e7d['get'](_0x1deb9e);_0x2c0f00&&(_0x4e5913[_0x4aab0f(0x1f8)]=_0x2c0f00);}}if(_0x4e5913[_0x4aab0f(0x217)]==='DecisionPoint'&&_0x4e5913[_0x4aab0f(0x1da)]&&_0x319265?.[_0x4aab0f(0x1da)])for(let _0x35d84d=0x0;_0x35d84d<_0x4e5913['branches'][_0x4aab0f(0x1b0)];_0x35d84d++){const _0x42c5fc=_0x4e5913[_0x4aab0f(0x1da)][_0x35d84d],_0x3000e8=_0x319265[_0x4aab0f(0x1da)][_0x35d84d];if(_0x3000e8?.[_0x4aab0f(0x283)]&&isPendingSegmentId(_0x3000e8[_0x4aab0f(0x283)])){const _0x5771cf=_0x495fee(_0x3000e8['segmentId'],_0x4aab0f(0x23c)+_0x285ed7[_0x4aab0f(0x1c2)]+_0x4aab0f(0x1ba)+(_0x42c5fc[_0x4aab0f(0x1c2)]||_0x35d84d)+'\x27');_0x5771cf&&(_0x42c5fc[_0x4aab0f(0x283)]=_0x5771cf);}}if(_0x4e5913[_0x4aab0f(0x217)]===_0x4aab0f(0x224)&&_0x4e5913[_0x4aab0f(0x26e)]?.[_0x4aab0f(0x283)]&&_0x319265?.[_0x4aab0f(0x26e)]?.[_0x4aab0f(0x283)]&&isPendingSegmentId(_0x319265[_0x4aab0f(0x26e)][_0x4aab0f(0x283)])){const _0x7bc052=_0x495fee(_0x319265['waitCondition'][_0x4aab0f(0x283)],_0x4aab0f(0x23c)+_0x285ed7[_0x4aab0f(0x1c2)]+_0x4aab0f(0x296));_0x7bc052&&(_0x4e5913[_0x4aab0f(0x26e)][_0x4aab0f(0x283)]=_0x7bc052);}}}}}
|
|
1
|
+
function a119_0x54fc(_0x581a75,_0x320b6e){_0x581a75=_0x581a75-0xe9;const _0x75ee99=a119_0x75ee();let _0x54fc6e=_0x75ee99[_0x581a75];return _0x54fc6e;}const a119_0x2de80c=a119_0x54fc;(function(_0x24aa1f,_0x10eba9){const _0x428014=a119_0x54fc,_0x2bdc67=_0x24aa1f();while(!![]){try{const _0x4205ad=parseInt(_0x428014(0x16e))/0x1*(parseInt(_0x428014(0x1b4))/0x2)+parseInt(_0x428014(0x15c))/0x3+-parseInt(_0x428014(0xfe))/0x4*(parseInt(_0x428014(0x14c))/0x5)+-parseInt(_0x428014(0x14d))/0x6*(parseInt(_0x428014(0x15e))/0x7)+parseInt(_0x428014(0x1b3))/0x8*(parseInt(_0x428014(0x1c8))/0x9)+parseInt(_0x428014(0x19f))/0xa+-parseInt(_0x428014(0xfd))/0xb;if(_0x4205ad===_0x10eba9)break;else _0x2bdc67['push'](_0x2bdc67['shift']());}catch(_0x4b9c1c){_0x2bdc67['push'](_0x2bdc67['shift']());}}}(a119_0x75ee,0x33b36));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a119_0x2de80c(0x13f);export function createPendingSegmentId(_0x391e4d){return''+PENDING_SEGMENT_PREFIX+_0x391e4d+'__';}export function isPendingSegmentId(_0x4b02ff){const _0x17c104=a119_0x2de80c;return _0x4b02ff[_0x17c104(0x141)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5d625c){const _0x4f34c7=a119_0x2de80c;return _0x5d625c[_0x4f34c7(0x195)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x338c3d){return''+PENDING_ACTIVATION_PREFIX+_0x338c3d+'__';}export function isPendingActivationId(_0x1c76b9){const _0x44a0af=a119_0x2de80c;return _0x1c76b9[_0x44a0af(0x141)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x176463){const _0x26fac9=a119_0x2de80c;return _0x176463[_0x26fac9(0x195)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x987ad8,_0x421c13){const _0x137b0f=a119_0x2de80c,_0x4136f5=_0x987ad8+'::'+(_0x421c13[_0x137b0f(0x196)]()||'segment'),_0x1ff9a8=createHash(_0x137b0f(0x11e))[_0x137b0f(0x1c9)](_0x4136f5)[_0x137b0f(0x13b)]('hex')[_0x137b0f(0x18f)](0x0,0xc);return'journey_entry_criteria_'+_0x1ff9a8;}export function ensureJourneyDefaults(_0x857378){const _0x359d84=a119_0x2de80c;!_0x857378[_0x359d84(0x16d)]&&(_0x857378[_0x359d84(0x16d)]=''),!_0x857378[_0x359d84(0x117)]&&(_0x857378['state']='draft');}export function resolveTDFolderPath(_0x39616e,_0x20279d,_0x552529){const _0x33f2df=a119_0x2de80c;if(!_0x20279d)return _0x39616e;if(_0x39616e===_0x552529||_0x39616e[_0x33f2df(0x141)](_0x552529+'/'))return _0x39616e;return _0x39616e?_0x552529+'/'+_0x39616e:_0x552529;}export function addFoldersToCreate(_0x10a0aa,_0x13beb3,_0x4c3b63){const _0x3e8909=a119_0x2de80c;if(!_0x10a0aa)return;if(_0x13beb3[_0x3e8909(0x1be)](_0x10a0aa))return;const _0x52b819=_0x10a0aa['split']('/');let _0x218fda='';for(const _0x5672dd of _0x52b819){_0x218fda=_0x218fda?_0x218fda+'/'+_0x5672dd:_0x5672dd,!_0x13beb3[_0x3e8909(0x1be)](_0x218fda)&&_0x4c3b63['add'](_0x218fda);}}import*as a119_0x355cd7 from'yaml';import{readFileSync}from'fs';import a119_0x41fba8 from'path';import{isJourneyDef,parseYamlString as a119_0x56b82d,toYamlString as a119_0x2488fd,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(_0x2b4ddc){const _0x5437b2=a119_0x2de80c;if(Array[_0x5437b2(0x162)](_0x2b4ddc))return'['+_0x2b4ddc[_0x5437b2(0x15f)](_0x43bd2f=>stableStringify(_0x43bd2f))[_0x5437b2(0x168)](',')+']';if(_0x2b4ddc&&typeof _0x2b4ddc===_0x5437b2(0x177)){const _0x108115=_0x2b4ddc,_0x28ec13=Object[_0x5437b2(0x15b)](_0x108115)[_0x5437b2(0x172)](),_0x5854de=_0x28ec13[_0x5437b2(0x15f)](_0x475b0f=>'\x22'+_0x475b0f+'\x22:'+stableStringify(_0x108115[_0x475b0f]));return'{'+_0x5854de[_0x5437b2(0x168)](',')+'}';}const _0x230336=JSON['stringify'](_0x2b4ddc);return _0x230336===undefined?'null':_0x230336;}function activationSignature(_0x5914a2){const _0x5b61c0=a119_0x2de80c,_0x4b601f={'connection':_0x5914a2[_0x5b61c0(0x143)],..._0x5914a2[_0x5b61c0(0x1ad)]!==undefined&&{'all_columns':_0x5914a2[_0x5b61c0(0x1ad)]},..._0x5914a2['columns']!==undefined&&{'columns':_0x5914a2[_0x5b61c0(0x192)]},..._0x5914a2[_0x5b61c0(0x101)]!==undefined&&{'behavior':_0x5914a2[_0x5b61c0(0x101)]},..._0x5914a2[_0x5b61c0(0x1c1)]!==undefined&&{'schedule':_0x5914a2[_0x5b61c0(0x1c1)]},..._0x5914a2[_0x5b61c0(0x149)]!==undefined&&{'notification':_0x5914a2['notification']},..._0x5914a2[_0x5b61c0(0x194)]!==undefined&&{'connector_config':_0x5914a2['connector_config']},..._0x5914a2[_0x5b61c0(0xef)]!==undefined&&{'activation_template_id':_0x5914a2['activation_template_id']}};return stableStringify(_0x4b601f);}export async function prepareSegmentFiles(_0x18e4da,_0x38fb0f,_0x491cdf,_0xa84989,_0x1b5143){const _0x4bdfb2=a119_0x2de80c,{activationDefToCreateRequest:_0x2f0605}=await import('./child-segment-yaml.js'),_0xf7fcce=[],_0x38e37f=new Set();for(const {yamlConfig:_0xe05e81,folderPath:_0x52edd3,sourcePath:_0x4236a4}of _0x18e4da){const _0x450954=resolveTDFolderPath(_0x52edd3,_0xa84989,_0x1b5143),_0x197591=_0x450954+':'+_0xe05e81['name'],_0x2fe2d6=_0x38fb0f[_0x4bdfb2(0x19e)][_0x4bdfb2(0x151)](_0x197591),_0x3c9d94=_0x2fe2d6?_0x38fb0f[_0x4bdfb2(0x170)][_0x4bdfb2(0x151)](_0x2fe2d6['id'])||[]:[];addFoldersToCreate(_0x450954,_0x38fb0f[_0x4bdfb2(0x1a1)],_0x38e37f);const _0x87253c=calculateActivationActions(_0xe05e81[_0x4bdfb2(0x126)]||[],_0x3c9d94,_0x38fb0f[_0x4bdfb2(0x1c3)],_0x38fb0f['connectionIdToNameMap']);for(const _0x452d34 of _0x87253c){(_0x452d34[_0x4bdfb2(0xff)]===_0x4bdfb2(0xfc)||_0x452d34[_0x4bdfb2(0xff)]===_0x4bdfb2(0x1c9))&&_0x452d34[_0x4bdfb2(0x193)]&&(_0x452d34[_0x4bdfb2(0x1ba)]=await _0x2f0605(_0x452d34['yamlActivation'],_0x491cdf));}const _0xd3349d=calculateSegmentDiff(_0xe05e81,_0x2fe2d6,_0x3c9d94,_0x38fb0f[_0x4bdfb2(0x1c3)],_0x38fb0f[_0x4bdfb2(0x110)]);_0xf7fcce[_0x4bdfb2(0x12d)]({'relativePath':_0xe05e81[_0x4bdfb2(0xf2)],'absolutePath':_0x4236a4,'yamlConfig':_0xe05e81,'folderPath':_0x450954,'existingSegment':_0x2fe2d6,'existingActivations':_0x3c9d94,'isNew':_0xd3349d[_0x4bdfb2(0x1b2)],'hasChanges':_0xd3349d[_0x4bdfb2(0x12a)],'diff':_0xd3349d['diff'],'activationActions':_0x87253c});}return{'segmentFiles':_0xf7fcce,'foldersToCreate':_0x38e37f};}export async function prepareJourneyFiles(_0xe7bffa,_0x2bf6b9,_0x3493d8,_0x4de677){const _0x33066c=a119_0x2de80c,_0x54f302=[],_0xc4aa02=new Set();for(const {yamlConfig:_0x58087e,folderPath:_0x7df99a,sourcePath:_0x2ece1f}of _0xe7bffa){const _0x38195d=resolveTDFolderPath(_0x7df99a,_0x3493d8,_0x4de677),_0x120576=_0x38195d+':'+_0x58087e['name'],_0x375611=_0x2bf6b9[_0x33066c(0x17b)][_0x33066c(0x151)](_0x120576);let _0x5efd72,_0xc0ae83;if(_0x375611&&_0x375611[_0x33066c(0x175)]>0x0){const _0x165122=buildLocalExpandedRuleMappings(_0x58087e),{createYamlContext:_0xe7e392,prefetchJourneySegments:_0x35bf3e}=createPushYamlContextForBundle(_0x2bf6b9[_0x33066c(0xe9)],_0x2bf6b9[_0x33066c(0x108)],_0x2bf6b9[_0x33066c(0x123)],_0x165122,_0x2bf6b9[_0x33066c(0x1c3)],_0x2bf6b9['connectionIdToNameMap'],_0x2bf6b9[_0x33066c(0x140)],_0x2bf6b9[_0x33066c(0x132)]);await _0x35bf3e(_0x375611['map'](_0x2aa867=>_0x2aa867['id']));const _0x10e707=hasMultipleVersions(_0x58087e),_0x39162c=async _0x458e9a=>{const _0x22b07b=_0x33066c,_0x16cebb=_0x2bf6b9[_0x22b07b(0x132)]?.['get'](_0x458e9a);if(_0x16cebb)return _0x16cebb;return _0x2bf6b9[_0x22b07b(0x1d0)]({'journeyId':_0x458e9a,'journeyName':_0x58087e[_0x22b07b(0xf2)],'isMultiVersion':_0x375611[_0x22b07b(0x175)]>0x1});};if(_0x10e707&&_0x375611[_0x33066c(0x175)]>0x1){const _0x18f332=[];for(const _0x4313f1 of _0x375611){const _0x432140=_0x4313f1[_0x33066c(0x112)]||0x1;_0x2bf6b9[_0x33066c(0x1cb)]?.[_0x33066c(0x1c9)](_0x33066c(0x12b)+_0x58087e['name']+'\x20v'+_0x432140);const _0x25d027=await _0x39162c(_0x4313f1['id']),_0x5cfe04=_0xe7e392(_0x4313f1['id']),_0x5e5589=await journeyResponseToDef(_0x25d027,_0x5cfe04);_0x18f332[_0x33066c(0x12d)]({'item':_0x4313f1,'yaml':_0x5e5589});}const _0x5a8140=buildLocalRuleToNameMappingFromJourney(_0x58087e);_0xc0ae83=buildMergedJourneyDef(_0x18f332,_0x5a8140);const _0x584599=Math['max'](..._0x18f332[_0x33066c(0x15f)](_0x5e12b8=>_0x5e12b8[_0x33066c(0x1a8)][_0x33066c(0x112)]||0x0)),_0x4a185e=_0x375611[_0x33066c(0x1aa)](_0x164587=>(_0x164587['versionNumber']||0x0)===_0x584599);_0x4a185e&&(_0x2bf6b9[_0x33066c(0x1cb)]?.[_0x33066c(0x1c9)](_0x33066c(0x12b)+_0x58087e[_0x33066c(0xf2)]+'\x20v'+_0x584599),_0x5efd72=await _0x39162c(_0x4a185e['id']));}else{const _0x57b24f=_0x375611[_0x375611['length']-0x1];_0x2bf6b9[_0x33066c(0x1cb)]?.[_0x33066c(0x1c9)](_0x33066c(0x12b)+_0x58087e[_0x33066c(0xf2)]),_0x5efd72=await _0x39162c(_0x57b24f['id']);const _0x569503=_0xe7e392(_0x57b24f['id']),_0x1fe02e=await journeyResponseToDef(_0x5efd72,_0x569503),_0x3a98d7=buildLocalRuleToNameMappingFromJourney(_0x58087e);_0xc0ae83=buildMergedJourneyDef([{'item':_0x57b24f,'yaml':_0x1fe02e}],_0x3a98d7);}}addFoldersToCreate(_0x38195d,_0x2bf6b9[_0x33066c(0x1a1)],_0xc4aa02);const _0x78634d=calculateJourneyDiff(_0x58087e,_0xc0ae83);_0x54f302[_0x33066c(0x12d)]({'relativePath':_0x58087e['name'],'absolutePath':_0x2ece1f,'yamlConfig':_0x58087e,'folderPath':_0x38195d,'existingJourney':_0x5efd72,'isNew':_0x78634d[_0x33066c(0x1b2)],'hasChanges':_0x78634d[_0x33066c(0x12a)],'diff':_0x78634d[_0x33066c(0xf9)]});}return{'journeyFiles':_0x54f302,'foldersToCreate':_0xc4aa02};}export function calculateActivationActions(_0x45b5f4,_0x1e097d,_0x4e26f7,_0x2b61b0){const _0x41f6f6=a119_0x2de80c,_0x2830a6=[],_0x349af3=new Map();for(const _0x89e840 of _0x1e097d){_0x349af3[_0x41f6f6(0x17d)](_0x89e840[_0x41f6f6(0xf2)],_0x89e840);}const _0x5f3319=new Map();for(const _0x6a337c of _0x45b5f4){_0x5f3319[_0x41f6f6(0x17d)](_0x6a337c[_0x41f6f6(0xf2)],_0x6a337c);}for(const _0x20c5e4 of _0x45b5f4){const _0x3eb232=_0x349af3[_0x41f6f6(0x151)](_0x20c5e4[_0x41f6f6(0xf2)]);if(!_0x3eb232)_0x2830a6[_0x41f6f6(0x12d)]({'type':_0x41f6f6(0xfc),'name':_0x20c5e4[_0x41f6f6(0xf2)],'yamlActivation':_0x20c5e4});else{const _0x33cdbb=activationResponseToDef(_0x3eb232,_0x4e26f7,_0x2b61b0),_0x3d6c9f=a119_0x355cd7[_0x41f6f6(0x13e)](_0x33cdbb),_0x46aeda=a119_0x355cd7[_0x41f6f6(0x13e)](_0x20c5e4);_0x3d6c9f!==_0x46aeda&&_0x2830a6['push']({'type':_0x41f6f6(0x1c9),'name':_0x20c5e4[_0x41f6f6(0xf2)],'yamlActivation':_0x20c5e4,'existingActivation':_0x3eb232});}}for(const _0x7f7164 of _0x1e097d){!_0x5f3319[_0x41f6f6(0x1be)](_0x7f7164[_0x41f6f6(0xf2)])&&_0x2830a6[_0x41f6f6(0x12d)]({'type':_0x41f6f6(0x1cc),'name':_0x7f7164[_0x41f6f6(0xf2)],'existingActivation':_0x7f7164});}return _0x2830a6;}export function calculateSegmentDiff(_0x497d0c,_0xdb7deb,_0x470980,_0x18baca,_0x1ad834){const _0x560ca3=segmentToYamlString(_0x497d0c);if(_0xdb7deb){const _0x37bc96=segmentWithActivationsToYaml(_0xdb7deb,_0x470980,undefined,_0x18baca,_0x1ad834),_0x3b5b1d=segmentToYamlString(_0x37bc96),_0xd2d6e1=generateDiff(_0x3b5b1d,_0x560ca3),_0x5954cc=hasChanges(_0xd2d6e1);return{'isNew':![],'hasChanges':_0x5954cc,'diff':_0x5954cc?formatDiffWithColors(_0xd2d6e1):undefined};}const _0x5152b1=generateDiff('',_0x560ca3);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5152b1)};}export function calculateJourneyDiff(_0x5128ad,_0x3d5b46){const _0x4a8273=normalizeJourneyDef(_0x5128ad,_0x5128ad),_0x107868=a119_0x2488fd(_0x4a8273);if(_0x3d5b46){const _0x777907=normalizeJourneyDef(_0x3d5b46,_0x5128ad),_0x40e3ab=a119_0x2488fd(_0x777907),_0x2123dd=generateDiff(_0x40e3ab,_0x107868),_0xb1c51b=hasChanges(_0x2123dd);return{'isNew':![],'hasChanges':_0xb1c51b,'diff':_0xb1c51b?formatDiffWithColors(_0x2123dd):undefined};}const _0x1f4839=generateDiff('',_0x107868);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1f4839)};}export function findSegmentsToDelete(_0x32255d,_0x1f6672,_0x55c876,_0x565393,_0x3a4160){const _0x4f579e=a119_0x2de80c,_0x27cd85=new Set();for(const {yamlConfig:_0x4e7b54,folderPath:_0x47ecfa}of _0x1f6672){_0x27cd85[_0x4f579e(0x147)](_0x47ecfa+':'+_0x4e7b54[_0x4f579e(0xf2)]);}return _0x32255d['filter'](_0x154f62=>{const _0x389d41=_0x4f579e,_0x1da677=_0x154f62[_0x389d41(0xee)]?_0x55c876[_0x389d41(0x151)](_0x154f62[_0x389d41(0xee)][_0x389d41(0x122)]())||'':'',_0x31f733=_0x1da677+':'+_0x154f62[_0x389d41(0xf2)];if(_0x27cd85[_0x389d41(0x1be)](_0x31f733))return![];if(_0x3a4160)return _0x1da677===_0x565393||_0x1da677[_0x389d41(0x141)](_0x565393+'/');return!![];});}export function findJourneysToDelete(_0x49f919,_0x415fa2,_0x5dc290,_0x4da325,_0x360409){const _0x5601ad=a119_0x2de80c,_0x4b3a69=new Set();for(const {yamlConfig:_0x2d8eb0,folderPath:_0x2a3256}of _0x415fa2){_0x4b3a69[_0x5601ad(0x147)](_0x2a3256+':'+_0x2d8eb0[_0x5601ad(0xf2)]);}return _0x49f919[_0x5601ad(0x1b7)](_0x1a192f=>{const _0x4dd26e=_0x5601ad,_0x4aa193=_0x1a192f[_0x4dd26e(0xf6)]?_0x5dc290[_0x4dd26e(0x151)](_0x1a192f[_0x4dd26e(0xf6)])||'':'',_0x473276=_0x4aa193+':'+_0x1a192f['journeyBundleName'];if(_0x4b3a69[_0x4dd26e(0x1be)](_0x473276))return![];if(_0x360409)return _0x4aa193===_0x4da325||_0x4aa193[_0x4dd26e(0x141)](_0x4da325+'/');return!![];});}export function buildSegmentLookupMap(_0x12ee8b,_0x59356b){const _0x4901f9=a119_0x2de80c,_0x5de123=new Map();for(const _0x50a1b0 of _0x12ee8b){const _0x4ae52e=_0x50a1b0['segmentFolderId']?_0x59356b[_0x4901f9(0x151)](_0x50a1b0[_0x4901f9(0xee)][_0x4901f9(0x122)]())||'':'',_0x406268=_0x4ae52e+':'+_0x50a1b0['name'];_0x5de123[_0x4901f9(0x17d)](_0x406268,_0x50a1b0);}return _0x5de123;}export function buildSegmentNameToIdMap(_0x39e0d5){const _0x25ad84=a119_0x2de80c,_0x27b1d0=new Map();for(const _0xcad19 of _0x39e0d5){_0x27b1d0[_0x25ad84(0x17d)](_0xcad19[_0x25ad84(0xf2)],_0xcad19['id']);}return _0x27b1d0;}export function buildJourneyBundleLookupMap(_0x544f25,_0x23b6de){const _0x411fa4=a119_0x2de80c,_0x4f747d=new Map();for(const _0x3ed5c9 of _0x544f25){const _0x53120e=_0x3ed5c9['folderId']?_0x23b6de[_0x411fa4(0x151)](_0x3ed5c9[_0x411fa4(0xf6)])||'':'',_0x4634cb=_0x53120e+':'+_0x3ed5c9[_0x411fa4(0x164)];!_0x4f747d[_0x411fa4(0x1be)](_0x4634cb)&&_0x4f747d[_0x411fa4(0x17d)](_0x4634cb,[]),_0x4f747d[_0x411fa4(0x151)](_0x4634cb)['push'](_0x3ed5c9);}for(const _0x575005 of _0x4f747d[_0x411fa4(0x125)]()){_0x575005[_0x411fa4(0x172)]((_0x430993,_0x5c046a)=>(_0x430993[_0x411fa4(0x112)]||0x0)-(_0x5c046a[_0x411fa4(0x112)]||0x0));}return _0x4f747d;}export function collectFoldersToCreate(_0x16823d,_0x2883f4){const _0x288767=a119_0x2de80c,_0x4b4090=new Set();for(const _0x7bfc2e of _0x16823d){if(!_0x7bfc2e)continue;if(_0x2883f4[_0x288767(0x1be)](_0x7bfc2e))continue;const _0x20eb15=_0x7bfc2e['split']('/');let _0x45cae1='';for(const _0x457a68 of _0x20eb15){_0x45cae1=_0x45cae1?_0x45cae1+'/'+_0x457a68:_0x457a68,!_0x2883f4[_0x288767(0x1be)](_0x45cae1)&&_0x4b4090[_0x288767(0x147)](_0x45cae1);}}return _0x4b4090;}export function parseAndClassifyYamlFiles(_0x50327c,_0x1e3c5a,_0x3dc37c){const _0x215324=a119_0x2de80c,_0x3c11dd=[],_0x48d85a=[];for(const _0x10e049 of _0x50327c){const _0x43008a=a119_0x41fba8[_0x215324(0x163)](_0x1e3c5a,a119_0x41fba8[_0x215324(0x1c6)](_0x10e049)),_0x308d5d=_0x43008a==='.'?'':_0x43008a,_0x4b7cc1=readFileSync(_0x10e049,_0x215324(0x11d)),_0x4bc756=a119_0x355cd7[_0x215324(0x102)](_0x4b7cc1);if(isJourneyDef(_0x4bc756)){const _0x2e1a30=a119_0x56b82d(_0x4b7cc1);_0x48d85a['push']({'yamlConfig':_0x2e1a30,'folderPath':_0x308d5d,'sourcePath':_0x10e049});}else{if(!_0x3dc37c?.[_0x215324(0x15d)]){const _0x3f10e1=parseSegmentYamlFile(_0x4b7cc1),_0x4f70c2=normalizeChildSegmentYaml(_0x3f10e1);_0x3c11dd[_0x215324(0x12d)]({'yamlConfig':_0x4f70c2,'folderPath':_0x308d5d,'sourcePath':_0x10e049});}}}return{'segments':_0x3c11dd,'journeys':_0x48d85a};}export function validateParsedFiles(_0x2f9a45,_0x386e62){const _0x11f94c=a119_0x2de80c,_0x5adf9e=[];for(const {yamlConfig:_0x2794af,sourcePath:_0x5da85e}of _0x2f9a45[_0x11f94c(0x14f)]){const _0xcca8a8=readFileSync(_0x5da85e,_0x11f94c(0x11d)),_0x36ec1e=a119_0x355cd7[_0x11f94c(0x107)](_0xcca8a8),_0x299acb=validateSegmentDef(_0x2794af,{'source':_0xcca8a8,'document':_0x36ec1e});if(!_0x299acb[_0x11f94c(0x137)]){const _0x4aeb7d=a119_0x41fba8[_0x11f94c(0x163)](_0x386e62,_0x5da85e);_0x5adf9e[_0x11f94c(0x12d)]({'filePath':_0x4aeb7d,'source':_0xcca8a8,'result':_0x299acb,'isJourney':![]});}}for(const {yamlConfig:_0x560723,sourcePath:_0x1795f5}of _0x2f9a45['journeys']){const _0x268f59=readFileSync(_0x1795f5,_0x11f94c(0x11d)),_0x5ac45f=a119_0x355cd7[_0x11f94c(0x107)](_0x268f59),_0x106eaf=validateJourneyDef(_0x560723,{'source':_0x268f59,'document':_0x5ac45f});if(!_0x106eaf['valid']){const _0x2952ef=a119_0x41fba8[_0x11f94c(0x163)](_0x386e62,_0x1795f5);_0x5adf9e[_0x11f94c(0x12d)]({'filePath':_0x2952ef,'source':_0x268f59,'result':_0x106eaf,'isJourney':!![]});}}return _0x5adf9e;}export function formatValidationErrors(_0x1be55f){const _0x234cfa=a119_0x2de80c,_0x27f719=[];for(const {filePath:_0x346bcb,source:_0x28ee70,result:_0x195379,isJourney:_0x18bcf0}of _0x1be55f){const _0x250756=_0x18bcf0?_0x234cfa(0x109):'segment';_0x27f719[_0x234cfa(0x12d)]('\x0a'+_0x346bcb+'\x20('+_0x250756+_0x234cfa(0x124)+_0x195379['errors'][_0x234cfa(0x175)]+_0x234cfa(0x199)),_0x27f719[_0x234cfa(0x12d)](formatValidationResult(_0x195379,_0x28ee70,_0x346bcb));}return _0x27f719[_0x234cfa(0x168)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x45dfcd){const _0x4bebc5=a119_0x2de80c,_0x44dedc=new Set(),_0x5a66d0=new Map(),_0x48acd3=collectSegmentUsageCounts(_0x45dfcd);if(_0x45dfcd['segments'])for(const [_0x24e6c9,_0x29efc7]of Object[_0x4bebc5(0x14b)](_0x45dfcd[_0x4bebc5(0x14f)])){_0x44dedc[_0x4bebc5(0x147)](_0x24e6c9);if(_0x29efc7[_0x4bebc5(0x148)]){const _0x53bce7=yamlRuleToApi(_0x29efc7['rule']),_0xc8196c=apiRuleToYaml(_0x53bce7);_0x5a66d0[_0x4bebc5(0x17d)](_0x24e6c9,_0xc8196c);}}const _0x447aa2=new Map();let _0x22b536=0x0;for(const [_0x35217d,_0x1b9690]of _0x5a66d0){const _0x279d1d=serializeExpandedRule(_0x1b9690,_0x5a66d0),_0x5a8382=_0x447aa2[_0x4bebc5(0x151)](_0x279d1d)||[];_0x5a8382['push']({'name':_0x35217d,'index':_0x22b536}),_0x447aa2['set'](_0x279d1d,_0x5a8382),_0x22b536++;}const _0x2f6d4f=new Map();for(const [_0x5c7035,_0x3b0f7c]of _0x447aa2){const _0x5661ca=_0x3b0f7c[_0x4bebc5(0x18f)]()[_0x4bebc5(0x172)]((_0x26d404,_0x5928be)=>{const _0x4078d4=_0x4bebc5,_0x3c5d96=_0x48acd3[_0x4078d4(0x151)](_0x26d404[_0x4078d4(0xf2)])||0x0,_0x3ea8e2=_0x48acd3[_0x4078d4(0x151)](_0x5928be[_0x4078d4(0xf2)])||0x0;if(_0x3c5d96!==_0x3ea8e2)return _0x3ea8e2-_0x3c5d96;return _0x26d404[_0x4078d4(0x1cf)]-_0x5928be[_0x4078d4(0x1cf)];})[_0x4bebc5(0x15f)](_0x8d3963=>_0x8d3963['name']),_0x1dbc77=[];for(const _0x3211bc of _0x5661ca){const _0x4e2a63=_0x48acd3[_0x4bebc5(0x151)](_0x3211bc)||0x0,_0x457fc9=Math[_0x4bebc5(0x16f)](_0x4e2a63,0x1);for(let _0x38fd68=0x0;_0x38fd68<_0x457fc9;_0x38fd68++){_0x1dbc77[_0x4bebc5(0x12d)](_0x3211bc);}}_0x2f6d4f['set'](_0x5c7035,_0x1dbc77);}return{'existingLocalSegmentNames':_0x44dedc,'localSegmentRules':_0x5a66d0,'localExpandedRuleToNames':_0x2f6d4f};}async function buildServerSegmentRuleMap(_0x304fca,_0x2655f6,_0x4b5f4e,_0x75b01e){const _0x47bb61=new Map(),_0x519392=new Set(),_0x130b9b=async _0x3b9871=>{const _0x29de29=a119_0x54fc;if(_0x519392[_0x29de29(0x1be)](_0x3b9871))return;_0x519392[_0x29de29(0x147)](_0x3b9871);let _0x3faf0b=_0x4b5f4e[_0x29de29(0x1aa)](_0x3b428e=>_0x3b428e['id']===_0x3b9871);if(!_0x3faf0b)try{_0x3faf0b=await _0x304fca[_0x29de29(0x17f)]['getSegment'](_0x2655f6,_0x3b9871);}catch{return;}if(!_0x3faf0b?.[_0x29de29(0x148)])return;const _0x1881d1=apiRuleToYaml(_0x3faf0b[_0x29de29(0x148)]);_0x47bb61['set'](_0x3b9871,_0x1881d1);const _0x31ff68=collectSegmentRefsFromRule(_0x1881d1);for(const _0x3389b3 of _0x31ff68){await _0x130b9b(_0x3389b3);}};for(const _0x42a77a of _0x75b01e){await _0x130b9b(_0x42a77a);}return _0x47bb61;}export function createSegmentIdResolver(_0x305651,_0x520eae){return async _0x4a4622=>{const _0x4fda21=a119_0x54fc,_0x277ad7=_0x305651[_0x4fda21(0x151)](_0x4a4622);if(!_0x277ad7)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x4a4622+_0x4fda21(0x174)+_0x520eae+'\x27)');return _0x277ad7;};}export function extractRootFolderId(_0x307a26){const _0x4086a2=a119_0x2de80c;return _0x307a26[_0x4086a2(0x18e)]?.[_0x4086a2(0x1ac)]?.[_0x4086a2(0x1b0)]?.['id']||_0x307a26[_0x4086a2(0x18e)]?.[_0x4086a2(0x166)]?.[_0x4086a2(0x1b0)]?.['id'];}export function buildConnectionMaps(_0x5a52be){const _0x2f530b=a119_0x2de80c,_0x32d864=new Map(),_0x16c1bc=new Map(),_0x23cc9d=new Map();for(const _0x1c7e0f of _0x5a52be){_0x32d864[_0x2f530b(0x17d)](_0x1c7e0f['name'],parseInt(_0x1c7e0f['id'],0xa)),_0x16c1bc['set'](_0x1c7e0f['id'],_0x1c7e0f[_0x2f530b(0xf2)]),_0x23cc9d[_0x2f530b(0x17d)](_0x1c7e0f[_0x2f530b(0xf2)],_0x1c7e0f[_0x2f530b(0xff)]);}return{'nameToId':_0x32d864,'idToName':_0x16c1bc,'nameToType':_0x23cc9d};}export function calculatePushStats(_0x4b394f,_0x3f78dd,_0x238686,_0x43e96b,_0x120515,_0x568dc7,_0x4b906b){const _0x2d90f9=a119_0x2de80c,_0x41a821=_0x4b394f[_0x2d90f9(0x1b7)](_0x6ce3c3=>_0x6ce3c3['isNew']),_0x4945b1=_0x4b394f['filter'](_0x1c05c3=>!_0x1c05c3[_0x2d90f9(0x1b2)]&&_0x1c05c3[_0x2d90f9(0x12a)]),_0x9ba15a=_0x4b394f[_0x2d90f9(0x1b7)](_0x49702e=>!_0x49702e[_0x2d90f9(0x1b2)]&&!_0x49702e['hasChanges']),_0x5824f0=_0x568dc7?_0x43e96b:[],_0x5ceb82=_0x3f78dd[_0x2d90f9(0x1b7)](_0x2ec34e=>_0x2ec34e[_0x2d90f9(0x1b2)]),_0x5ef063=_0x3f78dd[_0x2d90f9(0x1b7)](_0x27331a=>!_0x27331a[_0x2d90f9(0x1b2)]&&_0x27331a[_0x2d90f9(0x12a)]),_0x42808a=_0x3f78dd['filter'](_0x7f47c8=>!_0x7f47c8[_0x2d90f9(0x1b2)]&&!_0x7f47c8[_0x2d90f9(0x12a)]),_0x2a98fe=_0x568dc7?_0x120515:[],_0x21d0f1=_0x4b394f[_0x2d90f9(0x189)](_0x118f97=>_0x118f97[_0x2d90f9(0x17e)]),_0xc89922=_0x21d0f1[_0x2d90f9(0x1b7)](_0x32e48a=>_0x32e48a[_0x2d90f9(0xff)]==='create'),_0x21c13a=_0x21d0f1[_0x2d90f9(0x1b7)](_0x3b0a25=>_0x3b0a25[_0x2d90f9(0xff)]==='update'),_0x21f2c4=_0x21d0f1['filter'](_0x2cd5ba=>_0x2cd5ba[_0x2d90f9(0xff)]===_0x2d90f9(0x1cc)),_0x27a4fc=Array[_0x2d90f9(0x150)](_0x238686)[_0x2d90f9(0x172)](),_0x3aab41=_0x4b906b?![]:_0x41a821[_0x2d90f9(0x175)]>0x0||_0x4945b1[_0x2d90f9(0x175)]>0x0||_0x5824f0[_0x2d90f9(0x175)]>0x0,_0x3def70=_0x5ceb82[_0x2d90f9(0x175)]>0x0||_0x5ef063[_0x2d90f9(0x175)]>0x0||_0x2a98fe[_0x2d90f9(0x175)]>0x0,_0x452e42=_0x4b906b?![]:_0x21d0f1[_0x2d90f9(0x175)]>0x0,_0x43d6b8=_0x27a4fc[_0x2d90f9(0x175)]>0x0;return{'segments':{'new':_0x41a821,'changed':_0x4945b1,'unchanged':_0x9ba15a,'toDelete':_0x5824f0},'journeys':{'new':_0x5ceb82,'changed':_0x5ef063,'unchanged':_0x42808a,'toDelete':_0x2a98fe},'activations':{'all':_0x21d0f1,'toCreate':_0xc89922,'toUpdate':_0x21c13a,'toDelete':_0x21f2c4},'folders':{'toCreate':_0x27a4fc},'counts':{'segments':{'new':_0x41a821[_0x2d90f9(0x175)],'changed':_0x4945b1[_0x2d90f9(0x175)],'unchanged':_0x9ba15a[_0x2d90f9(0x175)],'toDelete':_0x5824f0[_0x2d90f9(0x175)]},'journeys':{'new':_0x5ceb82[_0x2d90f9(0x175)],'changed':_0x5ef063['length'],'unchanged':_0x42808a['length'],'toDelete':_0x2a98fe[_0x2d90f9(0x175)]},'activations':{'create':_0xc89922[_0x2d90f9(0x175)],'update':_0x21c13a[_0x2d90f9(0x175)],'delete':_0x21f2c4[_0x2d90f9(0x175)]},'folders':_0x27a4fc[_0x2d90f9(0x175)]},'hasChanges':_0x3aab41||_0x3def70||_0x452e42||_0x43d6b8};}export async function buildPushExecutionContext(_0x36fd80,_0x15231d,_0x33550c,_0x4fe223,_0x716085,_0x3a58cd){const _0x2098b0=a119_0x2de80c,_0x127468=extractRootFolderId(_0x33550c),{pathToId:_0x572686,idToPath:_0x1af974}=buildFolderMaps(_0x716085),_0x20806a=buildSegmentNameToIdMap(_0x4fe223),_0x3fd6c6=new Map(),{batchAsync:_0x7a1500}=await import('../../utils/async.js'),[_0x37d4e6,_0x34b195]=await Promise[_0x2098b0(0x10f)]([_0x36fd80['user'][_0x2098b0(0x15a)](),_0x36fd80[_0x2098b0(0x143)][_0x2098b0(0x1af)](),((async()=>{!_0x3a58cd&&_0x4fe223['length']>0x0&&await _0x7a1500(_0x4fe223,async _0x1b9f4d=>{const _0x306bc0=a119_0x54fc,_0x4b0dbf=await _0x36fd80['segment'][_0x306bc0(0x1a0)](_0x15231d,_0x1b9f4d['id']);_0x3fd6c6[_0x306bc0(0x17d)](_0x1b9f4d['id'],_0x4b0dbf);});})())]),{emailToId:_0x48701d,idToEmail:_0x4b839d}=_0x37d4e6,_0x5ea3b9=buildConnectionMaps(_0x34b195);return{'rootFolderId':_0x127468,'folderPathToId':_0x572686,'folderIdToPath':_0x1af974,'segmentNameToId':_0x20806a,'activationsBySegmentId':_0x3fd6c6,'emailToIdMap':_0x48701d,'idToEmailMap':_0x4b839d,'connectionNameToIdMap':_0x5ea3b9[_0x2098b0(0x12f)],'connectionIdToNameMap':_0x5ea3b9[_0x2098b0(0x10c)],'connectionNameToTypeMap':_0x5ea3b9[_0x2098b0(0x197)]};}function a119_0x75ee(){const _0x21a7b9=['journeyActivationNameToId','schedule','Stage\x20\x27','idToEmailMap','updateSegmentById','getSegment','dirname','Journey\x20\x27','879057gvJfRz','update','createActivation','progress','delete','goal','includes','index','fetchJourney','deps','Failed\x20to\x20','onProgress','absolutePath','createFolder','segmentFolderId','activation_template_id','attributes','Segment\x20not\x20found:\x20','name','ACTIVATION_SYNTAX_ERROR','embedded_segment_created','toLowerCase','folderId','DecisionPoint','\x20activation\x20\x27','diff','deleted','Deleted\x20activation\x20\x27','create','396737Obuehc','39988aorqpl','type','logWarning','behavior','parse','action','existingActivation','Deleted\x20segment\x20\x27','\x27\x20from\x20file:\x20','parseDocument','parentId','journey','Activation\x20not\x20found:\x20','embedded_activation_created','idToName','Updated\x20segment\x20\x27','segment_updating','all','connectionIdToNameMap','localSegmentRules','versionNumber','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','../../utils/async.js','NOT_FOUND','Updated\x20journey\x20\x27','state','journeyActivationStepId','stages','journeyId','journey_created','Creating\x20segment\x20\x27','utf-8','sha1','withProgress','milestone','segmentId','toString','existingSegments','):\x20','values','activations','activationContext','\x20segment\x20from\x20file:\x20','Deleting\x20activation\x20\x27','hasChanges','Fetching\x20','updated','push','activation_created','nameToId','Activation','Creating\x20folder\x20\x27','journeyById','results','\x27\x20milestone','createdSegmentId','JOURNEY_SYNTAX_ERROR','valid','\x27\x20for\x20','journeys','resolveSegment','digest','folderPath','steps','stringify','__pending_act_','activationStepsById','startsWith','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','connection','rootFolderId','WaitStep','activationParams','add','rule','notification','segment_deleted','entries','195MbkGUv','6qYoFhA','goal\x20criteria','segments','from','get','unchanged','logDeleted','updateActivation','decision_point','split','embeddedSegmentNameToId','Created\x20folder\x20\x27','waitCondition','buildUserMaps','keys','848364PcjXqu','skipSegments','2521099GMZegE','map','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','kind','isArray','relative','journeyBundleName','segment_created','parentFolder','Creating\x20activation\x20\x27','join','getActivation','stage\x20\x27','createJourneySegment','./child-segment-yaml.js','description','4783UnKcqT','max','activationsBySegmentId','\x27\x20wait\x20condition','sort','existingSegment','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','length','Created\x20journey\x20\x27','object','journey_updated','journey_updating','Updating\x20activation\x20\x27','journeyBundlesByFolderAndName','INTERNAL','set','activationActions','segment','entry_criteria','getJourney','folder_created','createdSegmentIds','\x20(referenced\x20in\x20journey\x20','logInfo','activation_deleted','JOURNEY_UPDATE_ERROR','size','flatMap','Updated\x20activation\x20\x27','segmentNameToId','verbose','Entry\x20criteria:\x20','relationships','slice','message','activation_updated','columns','yamlActivation','connector_config','replace','trim','nameToType','exitCriterias','\x20error(s)','created','segment_updated','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','branches','segmentByFolderAndName','3332020FVcvYa','listActivations','folderPathToId','embedded_activation_creating','yamlConfig','logSuccess','activation_','createSegment','Updating\x20segment\x20\x27','item','\x0a\x20\x20','find','effectiveFolderId','parentSegmentFolder','all_columns','entryCriteria','list','data','journeyStages','isNew','16znUKpL','78jxLdmS','activation_deleting','./journey-yaml.js','filter','SEGMENT_UPDATE_ERROR','segment_deleting','validatedRequest','folder','existingJourney','\x27...','has','ACTIVATION_UPDATE_ERROR'];a119_0x75ee=function(){return _0x21a7b9;};return a119_0x75ee();}export function createPushYamlContextForBundle(_0x1137d9,_0x2a37e1,_0x54b16d,_0x31971d,_0x13a1a8,_0xed43d6,_0x2304f1,_0x2b57eb){const {existingLocalSegmentNames:_0x47cdd0,localExpandedRuleToNames:_0x91e719}=_0x31971d,_0x5d4a06=new Set(),_0x4d51ec=new Map(),_0x38cd3b=new Map(),_0x42d8e1=new Map(),_0xe3ebdd=createJumpTargetCache(),_0x21d51a=new Map(),_0x5a7ea8=new Map(),_0x206f7a=new Set();let _0x484840;const _0x10f4ce=_0x5098a4=>{const _0x45bd93={'resolveSegment':async _0x2f6960=>{const _0x33f26a=a119_0x54fc,_0x3f10c0=_0x42d8e1[_0x33f26a(0x151)](_0x2f6960);if(_0x3f10c0!==undefined)return{'name':_0x3f10c0,'isJourneyLocal':!![]};try{let _0x5156c0=_0x54b16d[_0x33f26a(0x1aa)](_0x347030=>_0x347030['id']===_0x2f6960);!_0x5156c0&&(_0x5156c0=await _0x1137d9[_0x33f26a(0x17f)]['getSegment'](_0x2a37e1,_0x2f6960));const _0x2cea1c=generateJourneyLocalName(_0x5156c0[_0x33f26a(0xf2)]),_0x1555d0=_0x5156c0[_0x33f26a(0x161)]===SEGMENT_KIND_JOURNEY&&_0x2cea1c!==undefined;let _0x20edb1=_0x5156c0['name'],_0x2e5319;if(_0x1555d0&&_0x5156c0[_0x33f26a(0x148)]){const _0x31bca5=apiRuleToYaml(_0x5156c0[_0x33f26a(0x148)]);_0x5a7ea8[_0x33f26a(0x17d)](_0x2f6960,_0x31bca5);const _0x175e8c=async _0x344756=>{const _0x14c433=_0x33f26a,_0x201e56=collectSegmentRefsFromRule(_0x344756);for(const _0x1036df of _0x201e56){if(!_0x5a7ea8[_0x14c433(0x1be)](_0x1036df))try{const _0x19a4a5=await _0x1137d9[_0x14c433(0x17f)]['getSegment'](_0x2a37e1,_0x1036df);if(_0x19a4a5?.[_0x14c433(0x148)]){const _0x3db61d=apiRuleToYaml(_0x19a4a5[_0x14c433(0x148)]);_0x5a7ea8[_0x14c433(0x17d)](_0x1036df,_0x3db61d),await _0x175e8c(_0x3db61d);}}catch{}}};await _0x175e8c(_0x31bca5);const _0x9b4af2=serializeExpandedRule(_0x31bca5,_0x5a7ea8),_0x236b13=_0x91e719[_0x33f26a(0x151)](_0x9b4af2);if(_0x236b13&&_0x236b13['length']>0x0){const _0x36be78=_0x4d51ec[_0x33f26a(0x151)](_0x9b4af2)||0x0,_0x8b145d=_0x236b13[_0x36be78]||_0x236b13[_0x236b13[_0x33f26a(0x175)]-0x1];_0x4d51ec['set'](_0x9b4af2,_0x36be78+0x1),_0x20edb1=_0x8b145d,_0x5d4a06[_0x33f26a(0x147)](_0x20edb1),_0x42d8e1['set'](_0x2f6960,_0x20edb1);const _0x546dbd=await resolveRuleSegmentRefs(_0x31bca5,async _0x43e87a=>{const _0x9d5c54=_0x33f26a,_0x5d1273=_0x42d8e1[_0x9d5c54(0x151)](_0x43e87a);if(_0x5d1273)return _0x5d1273;const _0x355457=await _0x484840[_0x9d5c54(0x13a)](_0x43e87a);return _0x355457[_0x9d5c54(0xf2)];});_0x2e5319={'description':_0x5156c0[_0x33f26a(0x16d)],'rule':_0x546dbd};}else{const _0x3a86a7=_0x21d51a[_0x33f26a(0x151)](_0x9b4af2);if(_0x3a86a7)_0x20edb1=_0x3a86a7,_0x42d8e1['set'](_0x2f6960,_0x20edb1);else{if(_0x2cea1c){let _0x1586eb=_0x2cea1c,_0x3f934a=0x2;while(_0x5d4a06['has'](_0x1586eb)||_0x47cdd0[_0x33f26a(0x1be)](_0x1586eb)){_0x1586eb=_0x2cea1c+'_'+_0x3f934a,_0x3f934a++;}_0x5d4a06[_0x33f26a(0x147)](_0x1586eb),_0x20edb1=_0x1586eb;}_0x42d8e1[_0x33f26a(0x17d)](_0x2f6960,_0x20edb1),_0x21d51a[_0x33f26a(0x17d)](_0x9b4af2,_0x20edb1);const _0x180ae3=await resolveRuleSegmentRefs(_0x31bca5,async _0x359371=>{const _0x21f0e1=_0x33f26a,_0x280a2d=_0x42d8e1[_0x21f0e1(0x151)](_0x359371);if(_0x280a2d)return _0x280a2d;const _0x3ee1b6=await _0x484840['resolveSegment'](_0x359371);return _0x3ee1b6[_0x21f0e1(0xf2)];});_0x2e5319={'description':_0x5156c0[_0x33f26a(0x16d)],'rule':_0x180ae3};}}}return{'name':_0x20edb1,'isJourneyLocal':_0x1555d0,'definition':_0x2e5319};}catch{return{'name':_0x2f6960,'isJourneyLocal':![]};}},'resolveActivation':async _0x367e0c=>{const _0x228f25=a119_0x54fc,_0x3690d9=_0x38cd3b[_0x228f25(0x151)](_0x367e0c);if(_0x3690d9!==undefined)return{'name':_0x3690d9,'isJourneyLocal':!![]};try{let _0x16be70=_0x2304f1?.[_0x228f25(0x151)](_0x367e0c);!_0x16be70&&(_0x16be70=await _0x1137d9[_0x228f25(0x109)][_0x228f25(0x169)](_0x5098a4,_0x367e0c));const _0x53d813=_0x16be70['attributes'][_0x228f25(0x146)][_0x228f25(0xf2)]||_0x367e0c,_0x59a9ba=sanitizeYamlKey(_0x53d813)||_0x228f25(0x1a5)+_0x367e0c,_0x843da5=_0x59a9ba;_0x38cd3b[_0x228f25(0x17d)](_0x367e0c,_0x843da5);const _0x4d9dcc=journeyActivationStepToYaml(_0x16be70,_0x13a1a8,_0xed43d6);return{'name':_0x843da5,'isJourneyLocal':!![],'definition':_0x4d9dcc};}catch{return{'name':_0x367e0c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x9051f6,_0x29addc)=>resolveJumpTarget(_0x9051f6,_0x29addc,_0xe3ebdd,async _0x5b2ca3=>{const _0x45fdf4=a119_0x54fc,_0x14c0b3=_0x2b57eb?.[_0x45fdf4(0x151)](_0x5b2ca3);if(_0x14c0b3)return _0x14c0b3;return _0x1137d9[_0x45fdf4(0x109)][_0x45fdf4(0x181)](_0x5b2ca3);})};return _0x484840=_0x45bd93,_0x45bd93;},_0x25b10e=async _0x503250=>{const _0x26305d=a119_0x54fc,{collectSegmentIdsFromJourneyApi:_0x5b7eb0}=await import(_0x26305d(0x1b6)),{batchAsync:_0x378db8}=await import('../../utils/async.js'),_0x507464=new Set();for(const _0x4c8041 of _0x503250){let _0x39b1ea=_0x2b57eb?.[_0x26305d(0x151)](_0x4c8041);!_0x39b1ea&&(_0x39b1ea=await _0x1137d9[_0x26305d(0x109)][_0x26305d(0x181)](_0x4c8041));const _0x31e9a0=_0x5b7eb0(_0x39b1ea);for(const _0x36ac94 of _0x31e9a0){_0x507464[_0x26305d(0x147)](_0x36ac94);}}let _0x4fcea0=Array[_0x26305d(0x150)](_0x507464);while(_0x4fcea0[_0x26305d(0x175)]>0x0){const _0x1d4236=_0x4fcea0['filter'](_0x5615a6=>!_0x206f7a[_0x26305d(0x1be)](_0x5615a6));if(_0x1d4236[_0x26305d(0x175)]===0x0)break;const _0x4140bf=await _0x378db8(_0x1d4236,async _0x10397d=>{const _0x3c4818=_0x26305d;_0x206f7a[_0x3c4818(0x147)](_0x10397d);let _0x4ac4a5=_0x54b16d[_0x3c4818(0x1aa)](_0x127a25=>_0x127a25['id']===_0x10397d);if(!_0x4ac4a5)try{_0x4ac4a5=await _0x1137d9[_0x3c4818(0x17f)][_0x3c4818(0x1c5)](_0x2a37e1,_0x10397d);}catch{return null;}return{'segmentId':_0x10397d,'segment':_0x4ac4a5};},0xa),_0x4b4ce0=new Set();for(const _0x4e52bc of _0x4140bf){if(!_0x4e52bc?.['segment']?.[_0x26305d(0x148)])continue;const _0x20cfd2=apiRuleToYaml(_0x4e52bc[_0x26305d(0x17f)][_0x26305d(0x148)]);_0x5a7ea8[_0x26305d(0x17d)](_0x4e52bc[_0x26305d(0x121)],_0x20cfd2);const _0x34a50c=collectSegmentRefsFromRule(_0x20cfd2);for(const _0x1535df of _0x34a50c){!_0x206f7a['has'](_0x1535df)&&_0x4b4ce0[_0x26305d(0x147)](_0x1535df);}}_0x4fcea0=Array[_0x26305d(0x150)](_0x4b4ce0);}};return{'createYamlContext':_0x10f4ce,'prefetchJourneySegments':_0x25b10e};}export async function executePushSegments(_0x17a58c,_0x395537,_0x7bc392,_0x82465f,_0x557c68){const _0x381b15=a119_0x2de80c,{segmentDefToCreateRequest:_0x3493bf,segmentDefToUpdateRequest:_0x3d4798}=await import(_0x381b15(0x16c)),_0x5c9b0c=_0x7bc392[_0x381b15(0x1a1)],_0x160735=0x5,_0x2c5c9f=async _0x5ca8de=>{const _0x1558d9=_0x381b15,_0x68fdca=_0x5ca8de['folderPath']?_0x5c9b0c[_0x1558d9(0x151)](_0x5ca8de[_0x1558d9(0x13c)]):undefined;let _0x161f8c;const _0x15a65={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5ca8de[_0x1558d9(0x1b2)]){_0x557c68['onProgress']?.({'type':'segment_creating','name':_0x5ca8de['yamlConfig']['name']});const _0x5d968a=_0x3493bf(_0x5ca8de[_0x1558d9(0x1a3)],_0x68fdca),_0x271d08=await _0x557c68['withProgress'](_0x1558d9(0x11c)+_0x5ca8de['yamlConfig'][_0x1558d9(0xf2)]+_0x1558d9(0x1bd),()=>_0x17a58c[_0x1558d9(0x17f)][_0x1558d9(0x1a6)](_0x82465f[_0x1558d9(0x108)],_0x5d968a));_0x161f8c=_0x271d08[_0x1558d9(0x1b0)]['id'],_0x15a65[_0x1558d9(0x135)]={'name':_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)],'id':_0x161f8c},_0x557c68[_0x1558d9(0xeb)]?.({'type':_0x1558d9(0x165),'name':_0x5ca8de['yamlConfig']['name'],'segmentId':_0x161f8c}),_0x557c68[_0x1558d9(0x1a4)]?.('Created\x20segment\x20\x27'+_0x5ca8de[_0x1558d9(0x1a3)]['name']+'\x27'),_0x15a65[_0x1558d9(0x19a)]=0x1;}else{if(_0x5ca8de[_0x1558d9(0x12a)]){_0x557c68[_0x1558d9(0xeb)]?.({'type':_0x1558d9(0x10e),'name':_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)]});const _0x323470=_0x3d4798(_0x5ca8de[_0x1558d9(0x1a3)]);_0x68fdca!==_0x5ca8de[_0x1558d9(0x173)]?.['segmentFolderId']&&(_0x323470[_0x1558d9(0xee)]=_0x68fdca?parseInt(_0x68fdca,0xa):undefined),await _0x557c68[_0x1558d9(0x11f)](_0x1558d9(0x1a7)+_0x5ca8de['yamlConfig'][_0x1558d9(0xf2)]+_0x1558d9(0x1bd),()=>_0x17a58c[_0x1558d9(0x17f)][_0x1558d9(0x1c4)](_0x82465f[_0x1558d9(0x108)],_0x5ca8de['existingSegment']['id'],_0x323470)),_0x161f8c=_0x5ca8de[_0x1558d9(0x173)]['id'],_0x557c68['onProgress']?.({'type':_0x1558d9(0x19b),'name':_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)]}),_0x557c68[_0x1558d9(0x1a4)]?.(_0x1558d9(0x10d)+_0x5ca8de[_0x1558d9(0x1a3)]['name']+'\x27'),_0x15a65[_0x1558d9(0x12c)]=0x1;}else _0x161f8c=_0x5ca8de['existingSegment']['id'];}}catch(_0x2f07e2){const _0x6ae7f8=isHttp400Error(_0x2f07e2),_0x4f52d3=_0x6ae7f8?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1558d9(0x1b8)],_0x2e340d=getErrorMessage(_0x2f07e2);throw new SDKError(_0x4f52d3,_0x1558d9(0xea)+(_0x5ca8de[_0x1558d9(0x1b2)]?_0x1558d9(0xfc):_0x1558d9(0x1c9))+_0x1558d9(0x128)+_0x5ca8de['absolutePath']+_0x1558d9(0x1a9)+_0x2e340d,_0x2f07e2);}try{const _0x1d6c13=await syncActivationsForSegment(_0x17a58c,_0x82465f['parentId'],_0x161f8c,_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)],_0x5ca8de['activationActions'],_0x557c68,_0x5ca8de[_0x1558d9(0xec)]);_0x15a65['activations']=_0x1d6c13;}catch(_0xa5d926){if(_0xa5d926 instanceof SDKError)throw _0xa5d926;throw new SDKError(ErrorCode[_0x1558d9(0x1bf)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)]+_0x1558d9(0x106)+_0x5ca8de['absolutePath']+_0x1558d9(0x1a9)+getErrorMessage(_0xa5d926),_0xa5d926);}return _0x15a65;},_0x2b91b8=await batchAsync(_0x395537,_0x2c5c9f,_0x160735),_0x42e800={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5daf42 of _0x2b91b8){_0x42e800[_0x381b15(0x19a)]+=_0x5daf42['created'],_0x42e800[_0x381b15(0x12c)]+=_0x5daf42[_0x381b15(0x12c)],_0x5daf42[_0x381b15(0x135)]&&_0x42e800[_0x381b15(0x183)][_0x381b15(0x17d)](_0x5daf42[_0x381b15(0x135)]['name'],_0x5daf42['createdSegmentId']['id']),_0x42e800['activations'][_0x381b15(0x19a)]+=_0x5daf42[_0x381b15(0x126)][_0x381b15(0x19a)],_0x42e800['activations'][_0x381b15(0x12c)]+=_0x5daf42[_0x381b15(0x126)]['updated'],_0x42e800[_0x381b15(0x126)][_0x381b15(0xfa)]+=_0x5daf42[_0x381b15(0x126)][_0x381b15(0xfa)];}return _0x42e800;}async function syncActivationsForSegment(_0x542446,_0x115886,_0x1232dc,_0x1c10db,_0x3c15a0,_0x13fb8b,_0x45ea78){const _0x449833=a119_0x2de80c,_0x18d114={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xbf6041 of _0x3c15a0){try{if(_0xbf6041[_0x449833(0xff)]===_0x449833(0xfc)&&_0xbf6041[_0x449833(0x1ba)])_0x13fb8b[_0x449833(0xeb)]?.({'type':'activation_creating','segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),await _0x13fb8b[_0x449833(0x11f)](_0x449833(0x167)+_0xbf6041[_0x449833(0xf2)]+'\x27...',()=>_0x542446[_0x449833(0x17f)][_0x449833(0x1ca)](_0x115886,_0x1232dc,_0xbf6041[_0x449833(0x1ba)])),_0x13fb8b['onProgress']?.({'type':_0x449833(0x12e),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),_0x13fb8b[_0x449833(0x1a4)]?.('Created\x20activation\x20\x27'+_0xbf6041['name']+'\x27'),_0x18d114[_0x449833(0x19a)]++;else{if(_0xbf6041[_0x449833(0xff)]===_0x449833(0x1c9)&&_0xbf6041[_0x449833(0x1ba)]&&_0xbf6041['existingActivation'])_0x13fb8b[_0x449833(0xeb)]?.({'type':'activation_updating','segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),await _0x13fb8b[_0x449833(0x11f)](_0x449833(0x17a)+_0xbf6041[_0x449833(0xf2)]+_0x449833(0x1bd),()=>_0x542446[_0x449833(0x17f)][_0x449833(0x154)](_0x115886,_0x1232dc,_0xbf6041[_0x449833(0x104)]['id'],_0xbf6041['validatedRequest'])),_0x13fb8b[_0x449833(0xeb)]?.({'type':_0x449833(0x191),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),_0x13fb8b[_0x449833(0x1a4)]?.(_0x449833(0x18a)+_0xbf6041[_0x449833(0xf2)]+'\x27'),_0x18d114['updated']++;else _0xbf6041[_0x449833(0xff)]===_0x449833(0x1cc)&&_0xbf6041[_0x449833(0x104)]&&(_0x13fb8b[_0x449833(0xeb)]?.({'type':_0x449833(0x1b5),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),await _0x13fb8b['withProgress'](_0x449833(0x129)+_0xbf6041[_0x449833(0xf2)]+_0x449833(0x1bd),()=>_0x542446['segment']['deleteActivation'](_0x115886,_0x1232dc,_0xbf6041[_0x449833(0x104)]['id'])),_0x13fb8b[_0x449833(0xeb)]?.({'type':_0x449833(0x186),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),_0x13fb8b[_0x449833(0x153)]?.(_0x449833(0xfb)+_0xbf6041['name']+'\x27'),_0x18d114['deleted']++);}}catch(_0x21ffb7){const _0x184acc=isHttp400Error(_0x21ffb7),_0x209499=_0x184acc?ErrorCode[_0x449833(0xf3)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x4082c4=getErrorMessage(_0x21ffb7);throw new SDKError(_0x209499,_0x449833(0xea)+_0xbf6041[_0x449833(0xff)]+_0x449833(0xf8)+_0xbf6041[_0x449833(0xf2)]+_0x449833(0x106)+_0x45ea78+'\x0a\x20\x20'+_0x4082c4,_0x21ffb7);}}return _0x18d114;}export async function executePushFolders(_0x20eb8f,_0x44402e,_0x13b952,_0x391483,_0x260eec){const _0x291379=a119_0x2de80c,_0x27b508=new Map(_0x13b952);for(const _0x21fe58 of _0x44402e){const _0x1ade53=_0x21fe58[_0x291379(0x156)]('/'),_0x2cfb14=_0x1ade53[_0x1ade53['length']-0x1],_0x49cef8=_0x1ade53['slice'](0x0,-0x1)[_0x291379(0x168)]('/'),_0x56a726=_0x27b508[_0x291379(0x151)](_0x49cef8);_0x260eec['onProgress']?.({'type':'folder_creating','folder':_0x21fe58});const _0x10d671={'name':_0x2cfb14,'parentFolderId':_0x56a726},_0x13b7a7=await _0x260eec[_0x291379(0x11f)](_0x291379(0x131)+_0x21fe58+_0x291379(0x1bd),()=>_0x20eb8f[_0x291379(0x17f)][_0x291379(0xed)](_0x391483[_0x291379(0x108)],_0x10d671));_0x27b508[_0x291379(0x17d)](_0x21fe58,_0x13b7a7['data']['id']),_0x260eec[_0x291379(0xeb)]?.({'type':_0x291379(0x182),'folder':_0x21fe58,'folderId':_0x13b7a7[_0x291379(0x1b0)]['id']}),_0x260eec[_0x291379(0x185)]?.(_0x291379(0x158)+_0x21fe58+'\x27');}return _0x27b508;}export async function executePushSegmentDeletions(_0x515bcc,_0x1bf1e6,_0x2a9f6d){const _0xacdff7=a119_0x2de80c;if(_0x1bf1e6[_0xacdff7(0x175)]===0x0)return 0x0;const {batchAsync:_0x914f60}=await import(_0xacdff7(0x114)),_0x5b9a9f=0x5,_0x4547d2=await _0x914f60(_0x1bf1e6,async _0x4244dc=>{const _0x2d1c67=_0xacdff7;return _0x2a9f6d[_0x2d1c67(0xeb)]?.({'type':_0x2d1c67(0x1b9),'name':_0x4244dc[_0x2d1c67(0xf2)]}),await _0x515bcc[_0x2d1c67(0x17f)]['deleteSegment'](_0x4244dc['id']),_0x2a9f6d[_0x2d1c67(0xeb)]?.({'type':_0x2d1c67(0x14a),'name':_0x4244dc[_0x2d1c67(0xf2)]}),_0x2a9f6d[_0x2d1c67(0x153)]?.(_0x2d1c67(0x105)+_0x4244dc[_0x2d1c67(0xf2)]+'\x27'),0x1;},_0x5b9a9f);return _0x4547d2['reduce']((_0x29463b,_0x570271)=>_0x29463b+_0x570271,0x0);}export async function executePushJourneys(_0x81a46f,_0x56de91,_0x9fb815,_0x4924da,_0x571f5a){const _0x6301=a119_0x2de80c,{journeyDefToRequest:_0x487688}=await import(_0x6301(0x1b6)),{activationDefToCreateRequest:_0x1bdfc9,yamlRuleToApi:_0x3f44c6,validateSegmentRule:_0x39a799}=await import('./child-segment-yaml.js'),_0x4b08f1={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4e3a6f=new Map(_0x9fb815[_0x6301(0x18b)]),_0x5c33e9=0x5;for(let _0x1ccc0c=0x0;_0x1ccc0c<_0x56de91['length'];_0x1ccc0c+=_0x5c33e9){const _0x3702be=_0x56de91[_0x6301(0x18f)](_0x1ccc0c,_0x1ccc0c+_0x5c33e9),_0x50659e=await Promise[_0x6301(0x10f)](_0x3702be['map'](async _0x2f8968=>{const _0x5a0dcf=_0x6301;if(!_0x2f8968[_0x5a0dcf(0x1b2)]&&!_0x2f8968[_0x5a0dcf(0x12a)])return{'action':_0x5a0dcf(0x152),'name':_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)],'journeyId':_0x2f8968[_0x5a0dcf(0x1bc)]?.['id']};const _0x293d36=_0x2f8968[_0x5a0dcf(0x13c)]?_0x9fb815[_0x5a0dcf(0x1a1)][_0x5a0dcf(0x151)](_0x2f8968[_0x5a0dcf(0x13c)]):undefined;_0x571f5a[_0x5a0dcf(0xeb)]?.({'type':_0x2f8968[_0x5a0dcf(0x1b2)]?'journey_creating':_0x5a0dcf(0x179),'name':_0x2f8968['yamlConfig'][_0x5a0dcf(0xf2)]});try{const _0xf8ca9c=await executeSingleJourneyPush(_0x81a46f,_0x2f8968,{..._0x9fb815,'segmentNameToId':_0x4e3a6f},{'parentId':_0x4924da[_0x5a0dcf(0x108)],'rootFolderId':_0x4924da[_0x5a0dcf(0x144)],'folderId':_0x293d36,'verbose':_0x4924da[_0x5a0dcf(0x18c)]},_0x571f5a,{'journeyDefToRequest':_0x487688,'activationDefToCreateRequest':_0x1bdfc9,'yamlRuleToApi':_0x3f44c6,'validateSegmentRule':_0x39a799});for(const [_0xa129d5,_0x1693eb]of _0xf8ca9c[_0x5a0dcf(0x157)]){_0x4e3a6f[_0x5a0dcf(0x17d)](_0xa129d5,_0x1693eb),_0x4b08f1['embeddedSegmentNameToId'][_0x5a0dcf(0x17d)](_0xa129d5,_0x1693eb);}if(_0xf8ca9c[_0x5a0dcf(0x103)]==='created')_0x571f5a[_0x5a0dcf(0xeb)]?.({'type':_0x5a0dcf(0x11b),'name':_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)],'journeyId':_0xf8ca9c[_0x5a0dcf(0x11a)]}),_0x571f5a[_0x5a0dcf(0x1a4)]?.(_0x5a0dcf(0x176)+_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)]+'\x27'),_0x4b08f1[_0x5a0dcf(0x19a)]++;else _0xf8ca9c[_0x5a0dcf(0x103)]===_0x5a0dcf(0x12c)&&(_0x571f5a[_0x5a0dcf(0xeb)]?.({'type':_0x5a0dcf(0x178),'name':_0x2f8968['yamlConfig']['name']}),_0x571f5a[_0x5a0dcf(0x1a4)]?.(_0x5a0dcf(0x116)+_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)]+'\x27'),_0x4b08f1[_0x5a0dcf(0x12c)]++);return{'action':_0xf8ca9c[_0x5a0dcf(0x103)],'name':_0x2f8968[_0x5a0dcf(0x1a3)]['name'],'journeyId':_0xf8ca9c[_0x5a0dcf(0x11a)]};}catch(_0x3a7729){const _0xb3458e=isHttp400Error(_0x3a7729),_0x550805=_0xb3458e?ErrorCode[_0x5a0dcf(0x136)]:ErrorCode[_0x5a0dcf(0x187)],_0x5bf7a5=getErrorMessage(_0x3a7729);throw new SDKError(_0x550805,_0x5a0dcf(0xea)+(_0x2f8968['isNew']?'create':_0x5a0dcf(0x1c9))+'\x20journey\x20from\x20file:\x20'+_0x2f8968[_0x5a0dcf(0xec)]+_0x5a0dcf(0x1a9)+_0x5bf7a5,_0x3a7729);}}));_0x4b08f1[_0x6301(0x133)][_0x6301(0x12d)](..._0x50659e);}return _0x4b08f1;}async function executeSingleJourneyPush(_0x207369,_0x28a179,_0x32bf96,_0x3f1c2f,_0x46db3a,_0xf15e72){const _0x364caf=a119_0x2de80c,{journeyDefToRequest:_0x43f9f3,activationDefToCreateRequest:_0x369369,yamlRuleToApi:_0x18efa2,validateSegmentRule:_0x507651}=_0xf15e72,_0x4d5116=new Map(),_0xae56d4=new Map(),_0x2e333c=new Map(),_0x27f239=new Map(),_0x5606da=new Map();let _0x67a2ff;const _0x22a625=async()=>{const _0x11f621=a119_0x54fc;if(_0x67a2ff)return;_0x67a2ff=new Map();if(!_0x28a179[_0x11f621(0x1bc)])return;const _0x44d533=await _0x207369['journey'][_0x11f621(0x1a0)](_0x28a179[_0x11f621(0x1bc)]['id']);for(const _0x1d2e90 of _0x44d533){const _0x5d1d42=journeyActivationStepToYaml(_0x1d2e90,_0x32bf96[_0x11f621(0x1c3)],_0x32bf96['connectionIdToNameMap']),_0x4cf7f9=activationSignature(_0x5d1d42);!_0x67a2ff[_0x11f621(0x1be)](_0x4cf7f9)&&_0x67a2ff[_0x11f621(0x17d)](_0x4cf7f9,_0x1d2e90['id']),_0x5d1d42['name']&&_0xae56d4[_0x11f621(0x17d)](_0x5d1d42[_0x11f621(0xf2)],_0x1d2e90['id']);}};if(_0x28a179[_0x364caf(0x1bc)]&&_0x28a179['yamlConfig'][_0x364caf(0x14f)]){const _0x49e1f5=buildLocalExpandedRuleMappings(_0x28a179[_0x364caf(0x1a3)]),_0x186889=_0x49e1f5[_0x364caf(0x111)];if(_0x186889[_0x364caf(0x188)]>0x0){const _0xe2dbc4=new Map();for(const [_0x487550,_0x34d2fb]of _0x186889){const _0x40f5a3=serializeExpandedRule(_0x34d2fb,_0x186889);_0xe2dbc4['set'](_0x487550,_0x40f5a3);}const _0x1dbb43=collectSegmentIdsFromJourneyApi(_0x28a179['existingJourney']);if(_0x1dbb43[_0x364caf(0x188)]>0x0){const _0x5e10f5=await buildServerSegmentRuleMap(_0x207369,_0x3f1c2f[_0x364caf(0x108)],_0x32bf96['existingSegments'],_0x1dbb43);if(_0x5e10f5['size']>0x0){const _0x1e0c66=new Map();for(const [_0x215f1c,_0x555584]of _0x5e10f5){const _0xec16ae=serializeExpandedRule(_0x555584,_0x5e10f5);!_0x1e0c66[_0x364caf(0x1be)](_0xec16ae)&&_0x1e0c66[_0x364caf(0x17d)](_0xec16ae,_0x215f1c);}for(const [_0x31d63e,_0x1aac73]of _0xe2dbc4){const _0x1e3866=_0x1e0c66[_0x364caf(0x151)](_0x1aac73);_0x1e3866&&(_0x5606da[_0x364caf(0x17d)](_0x31d63e,_0x1e3866),_0x32bf96[_0x364caf(0x18b)][_0x364caf(0x17d)](_0x31d63e,_0x1e3866));}}}}}const _0x3e6982={'resolveSegmentId':async _0x208bf8=>{const _0x484a74=_0x364caf,_0x18111a=_0x32bf96[_0x484a74(0x18b)]['get'](_0x208bf8);if(!_0x18111a)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x484a74(0xf1)+_0x208bf8+_0x484a74(0x184)+_0x28a179[_0x484a74(0x1a3)][_0x484a74(0xf2)]+')');return _0x18111a;},'resolveEmbeddedSegmentId':async(_0x2cbf92,_0x409e00)=>{const _0x5a0a2c=_0x364caf,_0x309443=_0x32bf96[_0x5a0a2c(0x18b)][_0x5a0a2c(0x151)](_0x2cbf92);if(_0x309443)return _0x309443;const _0x1e5445=_0x5606da['get'](_0x2cbf92);if(_0x1e5445)return _0x32bf96[_0x5a0a2c(0x18b)][_0x5a0a2c(0x17d)](_0x2cbf92,_0x1e5445),_0x1e5445;const _0x4e7dfc=_0x32bf96['existingSegments'][_0x5a0a2c(0x1aa)](_0xd96c0b=>_0xd96c0b[_0x5a0a2c(0xf2)]===_0x2cbf92);if(_0x4e7dfc)return _0x32bf96[_0x5a0a2c(0x18b)]['set'](_0x2cbf92,_0x4e7dfc['id']),_0x4e7dfc['id'];if(_0x28a179[_0x5a0a2c(0x1b2)]){const {stageName:_0x88cc89,criteriaName:_0x5643a2}=findSegmentCriteriaLocation(_0x28a179['yamlConfig'],_0x2cbf92);return _0x507651(_0x2cbf92,_0x409e00[_0x5a0a2c(0x148)]),_0x2e333c[_0x5a0a2c(0x17d)](_0x2cbf92,{'definition':_0x409e00,'stageName':_0x88cc89,'criteriaName':_0x5643a2}),createPendingSegmentId(_0x2cbf92);}const _0x261989=_0x28a179[_0x5a0a2c(0x1bc)]?.['id'];if(!_0x261989)throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x507651(_0x2cbf92,_0x409e00[_0x5a0a2c(0x148)]);const _0x10bbcf=generateDeterministicJourneySegmentName(_0x28a179[_0x5a0a2c(0x1a3)]['name'],_0x2cbf92),_0x551785=_0x32bf96[_0x5a0a2c(0x123)]['find'](_0x185c01=>_0x185c01[_0x5a0a2c(0xf2)]===_0x10bbcf),_0x26986b=createSegmentIdResolver(_0x32bf96[_0x5a0a2c(0x18b)],_0x2cbf92),_0x32954c=await resolveRuleSegmentIds(_0x409e00[_0x5a0a2c(0x148)],_0x26986b);let _0x323809;if(_0x551785)await _0x207369[_0x5a0a2c(0x17f)][_0x5a0a2c(0x1c4)](_0x3f1c2f['parentId'],_0x551785['id'],{'description':_0x409e00['description']||'Entry\x20criteria:\x20'+_0x2cbf92,'rule':_0x18efa2(_0x32954c,!![]),'countPopulation':!![]}),_0x323809=_0x551785['id'];else try{_0x323809=await _0x207369['segment'][_0x5a0a2c(0x16b)]({'name':_0x10bbcf,'description':_0x409e00[_0x5a0a2c(0x16d)]||_0x5a0a2c(0x18d)+_0x2cbf92,'journeyId':_0x261989,'rule':_0x18efa2(_0x32954c,!![]),'countPopulation':!![],'parentFolderId':_0x3f1c2f[_0x5a0a2c(0x144)]||'','audienceId':_0x3f1c2f['parentId']});}catch(_0x542e2e){const _0x6cec91=_0x542e2e instanceof Error&&_0x542e2e[_0x5a0a2c(0x190)][_0x5a0a2c(0x1ce)]('Name\x20has\x20already\x20been\x20taken');if(_0x6cec91){const _0xc1d6be=await _0x207369[_0x5a0a2c(0x17f)]['listSegments'](_0x3f1c2f[_0x5a0a2c(0x108)]),_0x36885c=_0xc1d6be[_0x5a0a2c(0x1aa)](_0x6e70f2=>_0x6e70f2[_0x5a0a2c(0xf2)]===_0x10bbcf);if(_0x36885c)await _0x207369[_0x5a0a2c(0x17f)][_0x5a0a2c(0x1c4)](_0x3f1c2f[_0x5a0a2c(0x108)],_0x36885c['id'],{'description':_0x409e00[_0x5a0a2c(0x16d)]||_0x5a0a2c(0x18d)+_0x2cbf92,'rule':_0x18efa2(_0x32954c,!![]),'countPopulation':!![]}),_0x323809=_0x36885c['id'];else throw _0x542e2e;}else throw _0x542e2e;}return _0x32bf96[_0x5a0a2c(0x18b)][_0x5a0a2c(0x17d)](_0x2cbf92,_0x323809),_0x4d5116[_0x5a0a2c(0x17d)](_0x2cbf92,_0x323809),_0x323809;},'resolveActivationId':async _0x37283e=>{const _0x1bc1f2=_0x364caf,_0x1277b9=_0xae56d4[_0x1bc1f2(0x151)](_0x37283e);if(_0x1277b9)return _0x1277b9;if(_0x28a179[_0x1bc1f2(0x1bc)]){await _0x22a625();const _0x418e6c=_0xae56d4['get'](_0x37283e);if(_0x418e6c)return _0x418e6c;}throw new SDKError(ErrorCode[_0x1bc1f2(0x115)],_0x1bc1f2(0x10a)+_0x37283e+_0x1bc1f2(0x184)+_0x28a179['yamlConfig'][_0x1bc1f2(0xf2)]+').\x20'+_0x1bc1f2(0x160));},'resolveEmbeddedActivationId':async(_0x4c6c47,_0x2800e8)=>{const _0x4986f9=_0x364caf,_0x22bff4=_0xae56d4[_0x4986f9(0x151)](_0x4c6c47);if(_0x22bff4)return _0x22bff4;if(_0x28a179[_0x4986f9(0x1b2)])return _0x27f239[_0x4986f9(0x17d)](_0x4c6c47,_0x2800e8),createPendingActivationId(_0x4c6c47);if(_0x28a179[_0x4986f9(0x1bc)]){await _0x22a625();const _0x27fac8=_0xae56d4[_0x4986f9(0x151)](_0x2800e8[_0x4986f9(0xf2)]);if(_0x27fac8)return _0xae56d4[_0x4986f9(0x17d)](_0x4c6c47,_0x27fac8),_0x27fac8;const _0x56bb24=activationSignature(_0x2800e8),_0x4b9102=_0x67a2ff?.[_0x4986f9(0x151)](_0x56bb24);if(_0x4b9102)return _0xae56d4[_0x4986f9(0x17d)](_0x4c6c47,_0x4b9102),_0x4b9102;const _0x288fb4=await _0x369369(_0x2800e8,_0x32bf96['activationContext']),_0x4cb7bc=await _0x207369[_0x4986f9(0x109)][_0x4986f9(0x1ca)](_0x28a179[_0x4986f9(0x1bc)]['id'],_0x288fb4);return _0xae56d4[_0x4986f9(0x17d)](_0x4c6c47,_0x4cb7bc['id']),_0x4cb7bc['id'];}throw new SDKError(ErrorCode[_0x4986f9(0x17c)],_0x4986f9(0x142));},'resolveJourneyId':async _0x4c0ba6=>{const _0x582b94=_0x364caf;try{return await _0x207369['journey']['resolveJourneyId'](_0x3f1c2f[_0x582b94(0x108)],_0x4c0ba6);}catch(_0x49d434){throw new SDKError(ErrorCode[_0x582b94(0x115)],_0x582b94(0x1c7)+_0x4c0ba6+_0x582b94(0x113)+_0x28a179[_0x582b94(0x1a3)][_0x582b94(0xf2)]+'\x27)',_0x49d434);}},'resolveStageId':async(_0x4655b8,_0x16e8c7)=>{const _0x28f50c=_0x364caf,_0xb22157=await _0x207369[_0x28f50c(0x109)][_0x28f50c(0x181)](_0x4655b8),_0x3954c3=_0xb22157[_0x28f50c(0xf0)][_0x28f50c(0x1b1)][_0x28f50c(0x1aa)](_0x3a4c81=>_0x3a4c81[_0x28f50c(0xf2)]['toLowerCase']()===_0x16e8c7[_0x28f50c(0xf5)]());if(!_0x3954c3?.['id'])throw new SDKError(ErrorCode[_0x28f50c(0x115)],_0x28f50c(0x1c2)+_0x16e8c7+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0xb22157[_0x28f50c(0xf0)]['journeyBundleName']||_0xb22157[_0x28f50c(0xf0)][_0x28f50c(0xf2)])+'\x27');return _0x3954c3['id'];}},_0x16b280=await _0x43f9f3(_0x28a179[_0x364caf(0x1a3)],_0x3f1c2f[_0x364caf(0x108)],_0x3e6982),_0x1f2c60=_0x3f1c2f[_0x364caf(0xf6)]||_0x3f1c2f['rootFolderId'];_0x1f2c60&&(_0x16b280[_0x364caf(0x18e)]={'parentFolder':{'data':{'id':_0x1f2c60,'type':_0x364caf(0x1bb)}}});if(_0x28a179['isNew']){if(_0x2e333c['size']>0x0||_0x27f239[_0x364caf(0x188)]>0x0)return await executeThreeStepJourneyCreate(_0x207369,_0x28a179,_0x16b280,{'pendingEmbeddedSegments':_0x2e333c,'pendingEmbeddedActivations':_0x27f239,'embeddedSegmentNameToId':_0x4d5116,'journeyActivationNameToId':_0xae56d4},{..._0x3f1c2f,'effectiveFolderId':_0x1f2c60},_0x32bf96,_0x46db3a,_0xf15e72);else{ensureJourneyDefaults(_0x16b280[_0x364caf(0xf0)]);const _0x362508=await _0x207369[_0x364caf(0x109)]['create'](_0x16b280);return{'action':_0x364caf(0x19a),'journeyId':_0x362508['id'],'embeddedSegmentNameToId':_0x4d5116};}}else{if(_0x28a179[_0x364caf(0x12a)]&&_0x28a179[_0x364caf(0x1bc)])return ensureJourneyDefaults(_0x16b280[_0x364caf(0xf0)]),await _0x207369[_0x364caf(0x109)]['update'](_0x28a179[_0x364caf(0x1bc)]['id'],_0x16b280),{'action':_0x364caf(0x12c),'journeyId':_0x28a179['existingJourney']['id'],'embeddedSegmentNameToId':_0x4d5116};}return{'action':_0x364caf(0x152),'journeyId':_0x28a179[_0x364caf(0x1bc)]?.['id'],'embeddedSegmentNameToId':_0x4d5116};}function findSegmentCriteriaLocation(_0x126f15,_0x110f0b){const _0x22eca6=a119_0x2de80c,_0x16e233=_0x126f15['stages']||_0x126f15[_0x22eca6(0x139)]?.[0x0]?.[_0x22eca6(0x119)]||[];let _0x30c61c='entry',_0x3a63e1=_0x110f0b;const _0x18cb4f=_0x126f15['goal']||_0x126f15[_0x22eca6(0x139)]?.[0x0]?.[_0x22eca6(0x1cd)];if(_0x18cb4f?.['segment']===_0x110f0b)return{'stageName':_0x22eca6(0x1cd),'criteriaName':_0x18cb4f[_0x22eca6(0xf2)]||_0x110f0b};_0x532854:for(const _0xe049d8 of _0x16e233){if(_0xe049d8[_0x22eca6(0x180)]?.['segment']===_0x110f0b){_0x30c61c=_0xe049d8[_0x22eca6(0xf2)],_0x3a63e1=_0xe049d8['entry_criteria'][_0x22eca6(0xf2)]||_0x110f0b;break;}if(_0xe049d8[_0x22eca6(0x13d)])for(const _0x4440b5 of _0xe049d8[_0x22eca6(0x13d)]){if(_0x4440b5[_0x22eca6(0xff)]===_0x22eca6(0x155)&&_0x4440b5['with']?.['branches'])for(const _0x2872be of _0x4440b5['with']['branches']){if(_0x2872be[_0x22eca6(0x17f)]===_0x110f0b){_0x30c61c=_0xe049d8[_0x22eca6(0xf2)],_0x3a63e1=_0x2872be[_0x22eca6(0xf2)]||_0x110f0b;break _0x532854;}}}}return{'stageName':_0x30c61c,'criteriaName':_0x3a63e1};}async function executeThreeStepJourneyCreate(_0x586f20,_0x562f48,_0xa2c906,_0x4d2413,_0x6fe0bf,_0x301158,_0xb8662d,_0x304eb7){const _0x1d2175=a119_0x2de80c,{activationDefToCreateRequest:_0x16f2f2,yamlRuleToApi:_0x3bdd1b}=_0x304eb7,{pendingEmbeddedSegments:_0x18795d,pendingEmbeddedActivations:_0x4f31d2,embeddedSegmentNameToId:_0x570067}=_0x4d2413,_0x797362=JSON[_0x1d2175(0x102)](JSON[_0x1d2175(0x13e)](_0xa2c906));ensureJourneyDefaults(_0x797362['attributes']),stripPendingIds(_0x797362);const _0x314c97=await _0x586f20['journey'][_0x1d2175(0xfc)](_0x797362),_0x139873=_0x314c97['id'],_0x41f398=new Map();for(const _0x15ee47 of _0x314c97[_0x1d2175(0xf0)][_0x1d2175(0x1b1)]){_0x41f398[_0x1d2175(0x17d)](_0x15ee47[_0x1d2175(0xf2)][_0x1d2175(0xf5)](),_0x15ee47['id']);}for(const [_0x4e9ce6,{definition:_0x1cf93e}]of _0x18795d){const _0x27a344=generateDeterministicJourneySegmentName(_0x562f48['yamlConfig']['name'],_0x4e9ce6);_0xb8662d['onProgress']?.({'type':'embedded_segment_creating','journeyName':_0x562f48['yamlConfig'][_0x1d2175(0xf2)],'segmentName':_0x4e9ce6});const _0x17df46=createSegmentIdResolver(_0x301158[_0x1d2175(0x18b)],_0x4e9ce6),_0x344591=await resolveRuleSegmentIds(_0x1cf93e[_0x1d2175(0x148)],_0x17df46),_0x442767=await _0x586f20[_0x1d2175(0x17f)][_0x1d2175(0x16b)]({'name':_0x27a344,'description':_0x1cf93e[_0x1d2175(0x16d)]||_0x1d2175(0x18d)+_0x4e9ce6,'journeyId':_0x139873,'rule':_0x3bdd1b(_0x344591,!![]),'countPopulation':!![],'parentFolderId':_0x6fe0bf[_0x1d2175(0x1ab)]||'','audienceId':_0x6fe0bf[_0x1d2175(0x108)]});_0x570067[_0x1d2175(0x17d)](_0x4e9ce6,_0x442767),_0x301158[_0x1d2175(0x18b)][_0x1d2175(0x17d)](_0x4e9ce6,_0x442767),_0xb8662d[_0x1d2175(0xeb)]?.({'type':_0x1d2175(0xf4),'journeyName':_0x562f48['yamlConfig'][_0x1d2175(0xf2)],'segmentName':_0x4e9ce6});}const _0x4d919e=new Map();for(const [_0xfe184a,_0x27120e]of _0x4f31d2){_0xb8662d['onProgress']?.({'type':_0x1d2175(0x1a2),'journeyName':_0x562f48[_0x1d2175(0x1a3)][_0x1d2175(0xf2)],'activationName':_0xfe184a});const _0x4e4166=await _0x16f2f2(_0x27120e,_0x301158[_0x1d2175(0x127)]),_0x50a1d8=await _0x586f20[_0x1d2175(0x109)][_0x1d2175(0x1ca)](_0x139873,_0x4e4166);_0x4d919e['set'](_0xfe184a,_0x50a1d8['id']),_0x4d2413[_0x1d2175(0x1c0)][_0x1d2175(0x17d)](_0xfe184a,_0x50a1d8['id']),_0xb8662d[_0x1d2175(0xeb)]?.({'type':_0x1d2175(0x10b),'journeyName':_0x562f48['yamlConfig'][_0x1d2175(0xf2)],'activationName':_0xfe184a});}const _0x397d85=JSON[_0x1d2175(0x102)](JSON[_0x1d2175(0x13e)](_0xa2c906));return _0x397d85['id']=_0x139873,ensureJourneyDefaults(_0x397d85['attributes']),resolvePendingIdsInRequest(_0x397d85,_0xa2c906,_0x41f398,_0x570067,_0x4d919e,_0xb8662d),await _0x586f20[_0x1d2175(0x109)][_0x1d2175(0x1c9)](_0x139873,_0x397d85),{'action':_0x1d2175(0x19a),'journeyId':_0x139873,'embeddedSegmentNameToId':_0x570067};}function stripPendingIds(_0x3d8834){const _0x55f2d7=a119_0x2de80c;for(const _0x507218 of _0x3d8834[_0x55f2d7(0xf0)][_0x55f2d7(0x1b1)]||[]){_0x507218[_0x55f2d7(0x1ae)]?.[_0x55f2d7(0x121)]&&isPendingSegmentId(_0x507218[_0x55f2d7(0x1ae)][_0x55f2d7(0x121)])&&delete _0x507218['entryCriteria'];if(_0x507218['steps'])for(const _0x411543 of Object[_0x55f2d7(0x15b)](_0x507218[_0x55f2d7(0x13d)])){const _0x146442=_0x507218[_0x55f2d7(0x13d)][_0x411543];_0x146442[_0x55f2d7(0xff)]===_0x55f2d7(0x130)&&_0x146442['journeyActivationStepId']&&isPendingActivationId(_0x146442[_0x55f2d7(0x118)])&&(_0x146442[_0x55f2d7(0x118)]='');if(_0x146442[_0x55f2d7(0xff)]===_0x55f2d7(0xf7)&&_0x146442[_0x55f2d7(0x19d)])for(const _0x10914e of _0x146442['branches']){_0x10914e['segmentId']&&isPendingSegmentId(_0x10914e['segmentId'])&&(_0x10914e[_0x55f2d7(0x121)]='');}_0x146442[_0x55f2d7(0xff)]===_0x55f2d7(0x145)&&_0x146442[_0x55f2d7(0x159)]?.['segmentId']&&isPendingSegmentId(_0x146442[_0x55f2d7(0x159)][_0x55f2d7(0x121)])&&(_0x146442[_0x55f2d7(0x159)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x3bd4e0,_0x2c0ebf,_0x36cef1,_0x3e11af,_0x1d3307,_0x4d6634){const _0x1c6a63=a119_0x2de80c,_0x1f6e8e=(_0x45ead4,_0x29bed0)=>{const _0x1458a4=a119_0x54fc;if(!isPendingSegmentId(_0x45ead4))return _0x45ead4;const _0x14bf0c=extractPendingSegmentName(_0x45ead4),_0x1bafb8=_0x3e11af[_0x1458a4(0x151)](_0x14bf0c);return!_0x1bafb8&&_0x4d6634[_0x1458a4(0x100)]?.(_0x1458a4(0x19c)+_0x14bf0c+_0x1458a4(0x138)+_0x29bed0),_0x1bafb8;};if(_0x3bd4e0[_0x1c6a63(0xf0)]['goal']?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x3bd4e0['attributes'][_0x1c6a63(0x1cd)][_0x1c6a63(0x121)])){const _0x10aeae=_0x1f6e8e(_0x3bd4e0[_0x1c6a63(0xf0)][_0x1c6a63(0x1cd)][_0x1c6a63(0x121)],_0x1c6a63(0x14e));_0x10aeae&&(_0x3bd4e0[_0x1c6a63(0xf0)][_0x1c6a63(0x1cd)][_0x1c6a63(0x121)]=_0x10aeae);}for(const _0x2ea0a3 of _0x3bd4e0[_0x1c6a63(0xf0)][_0x1c6a63(0x1b1)]||[]){const _0x339d32=_0x36cef1[_0x1c6a63(0x151)](_0x2ea0a3[_0x1c6a63(0xf2)][_0x1c6a63(0xf5)]());_0x339d32&&(_0x2ea0a3['id']=_0x339d32);if(_0x2ea0a3[_0x1c6a63(0x1ae)]?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x2ea0a3[_0x1c6a63(0x1ae)][_0x1c6a63(0x121)])){const _0x3bceef=_0x1f6e8e(_0x2ea0a3['entryCriteria']['segmentId'],'stage\x20\x27'+_0x2ea0a3[_0x1c6a63(0xf2)]+'\x27\x20entry\x20criteria');_0x3bceef&&(_0x2ea0a3[_0x1c6a63(0x1ae)][_0x1c6a63(0x121)]=_0x3bceef);}if(_0x2ea0a3[_0x1c6a63(0x198)])for(const _0x498f49 of _0x2ea0a3[_0x1c6a63(0x198)]){if(_0x498f49[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x498f49[_0x1c6a63(0x121)])){const _0x57cada=_0x1f6e8e(_0x498f49[_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+'\x27\x20exit\x20criteria');_0x57cada&&(_0x498f49[_0x1c6a63(0x121)]=_0x57cada);}}if(_0x2ea0a3['milestone']?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x2ea0a3[_0x1c6a63(0x120)][_0x1c6a63(0x121)])){const _0x254d60=_0x1f6e8e(_0x2ea0a3[_0x1c6a63(0x120)][_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+_0x1c6a63(0x134));_0x254d60&&(_0x2ea0a3['milestone']['segmentId']=_0x254d60);}if(_0x2ea0a3[_0x1c6a63(0x13d)]){const _0x402450=_0x4a7787=>_0x2c0ebf[_0x1c6a63(0xf0)][_0x1c6a63(0x1b1)][_0x1c6a63(0x1aa)](_0x493a71=>_0x493a71[_0x1c6a63(0xf2)]['toLowerCase']()===_0x2ea0a3[_0x1c6a63(0xf2)][_0x1c6a63(0xf5)]())?.[_0x1c6a63(0x13d)]?.[_0x4a7787];for(const _0x120851 of Object[_0x1c6a63(0x15b)](_0x2ea0a3['steps'])){const _0x3ddd88=_0x2ea0a3[_0x1c6a63(0x13d)][_0x120851],_0x5cbf1d=_0x402450(_0x120851);if(_0x3ddd88[_0x1c6a63(0xff)]===_0x1c6a63(0x130)&&_0x3ddd88[_0x1c6a63(0x118)]&&(isPendingActivationId(_0x3ddd88['journeyActivationStepId'])||_0x3ddd88[_0x1c6a63(0x118)]==='')){if(_0x5cbf1d?.[_0x1c6a63(0x118)]&&isPendingActivationId(_0x5cbf1d[_0x1c6a63(0x118)])){const _0x59fe2d=extractPendingActivationName(_0x5cbf1d[_0x1c6a63(0x118)]),_0x2592c5=_0x1d3307['get'](_0x59fe2d);_0x2592c5&&(_0x3ddd88[_0x1c6a63(0x118)]=_0x2592c5);}}if(_0x3ddd88[_0x1c6a63(0xff)]===_0x1c6a63(0xf7)&&_0x3ddd88[_0x1c6a63(0x19d)]&&_0x5cbf1d?.['branches'])for(let _0x3ed7d6=0x0;_0x3ed7d6<_0x3ddd88[_0x1c6a63(0x19d)]['length'];_0x3ed7d6++){const _0x5ef6e7=_0x3ddd88['branches'][_0x3ed7d6],_0x4e4699=_0x5cbf1d['branches'][_0x3ed7d6];if(_0x4e4699?.['segmentId']&&isPendingSegmentId(_0x4e4699[_0x1c6a63(0x121)])){const _0x31ce5b=_0x1f6e8e(_0x4e4699[_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x5ef6e7[_0x1c6a63(0xf2)]||_0x3ed7d6)+'\x27');_0x31ce5b&&(_0x5ef6e7['segmentId']=_0x31ce5b);}}if(_0x3ddd88[_0x1c6a63(0xff)]===_0x1c6a63(0x145)&&_0x3ddd88[_0x1c6a63(0x159)]?.[_0x1c6a63(0x121)]&&_0x5cbf1d?.[_0x1c6a63(0x159)]?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x5cbf1d[_0x1c6a63(0x159)][_0x1c6a63(0x121)])){const _0x249039=_0x1f6e8e(_0x5cbf1d[_0x1c6a63(0x159)][_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+_0x1c6a63(0x171));_0x249039&&(_0x3ddd88[_0x1c6a63(0x159)]['segmentId']=_0x249039);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x156df5,_0x128000){const _0x5d182b=a120_0x2bfa,_0x1bbc85=_0x156df5();while(!![]){try{const _0x423005=-parseInt(_0x5d182b(0x1e4))/0x1+parseInt(_0x5d182b(0x1de))/0x2+parseInt(_0x5d182b(0x1df))/0x3+parseInt(_0x5d182b(0x1e1))/0x4*(parseInt(_0x5d182b(0x1ea))/0x5)+-parseInt(_0x5d182b(0x1e3))/0x6*(parseInt(_0x5d182b(0x1e5))/0x7)+parseInt(_0x5d182b(0x1ed))/0x8+parseInt(_0x5d182b(0x1e2))/0x9*(parseInt(_0x5d182b(0x1e9))/0xa);if(_0x423005===_0x128000)break;else _0x1bbc85['push'](_0x1bbc85['shift']());}catch(_0x1e7fad){_0x1bbc85['push'](_0x1bbc85['shift']());}}}(a120_0x4ac8,0xb94fe));export function buildFolderIdToPathMap(_0x15c94a){const _0x42052e=a120_0x2bfa,_0x2afb9b=new Map(),_0x1bd4a0=new Map();for(const _0x2007cd of _0x15c94a){_0x1bd4a0[_0x42052e(0x1eb)](_0x2007cd['id'],_0x2007cd);}const _0x2acaab=new Set();for(const _0x3ee145 of _0x15c94a){!_0x3ee145[_0x42052e(0x1e7)]&&_0x2acaab[_0x42052e(0x1ec)](_0x3ee145['id']);}function _0x3a50ea(_0x4d5d0d){const _0x596e4e=_0x42052e;if(_0x2afb9b[_0x596e4e(0x1e6)](_0x4d5d0d['id']))return _0x2afb9b['get'](_0x4d5d0d['id']);if(_0x2acaab[_0x596e4e(0x1e6)](_0x4d5d0d['id']))return _0x2afb9b['set'](_0x4d5d0d['id'],''),'';if(_0x4d5d0d[_0x596e4e(0x1e7)]){const _0x56e6d7=_0x1bd4a0['get'](_0x4d5d0d[_0x596e4e(0x1e7)]);if(_0x56e6d7){const _0x1588f6=_0x3a50ea(_0x56e6d7),_0x8978a6=_0x1588f6?_0x1588f6+'/'+_0x4d5d0d[_0x596e4e(0x1e0)]:_0x4d5d0d[_0x596e4e(0x1e0)];return _0x2afb9b['set'](_0x4d5d0d['id'],_0x8978a6),_0x8978a6;}}const _0x51a079=_0x4d5d0d[_0x596e4e(0x1e0)];return _0x2afb9b[_0x596e4e(0x1eb)](_0x4d5d0d['id'],_0x51a079),_0x51a079;}for(const _0x429c8b of _0x15c94a){_0x3a50ea(_0x429c8b);}return _0x2afb9b;}function a120_0x4ac8(){const _0x490397=['name','8PLezwe','18110376fTWOrk','6AVOwxS','1426549nmbsFZ','10238459YldAuM','has','parentFolderId','get','10QCjTVf','666560FfFkLB','set','add','3793832idvYOh','533890HQpIqm','1884486EvpRfy'];a120_0x4ac8=function(){return _0x490397;};return a120_0x4ac8();}export function buildFolderPathToIdMap(_0x574ea1){const _0x51fd63=a120_0x2bfa,_0x51e795=new Map(),_0x27a6a1=new Map();for(const _0x1e4fba of _0x574ea1){_0x27a6a1[_0x51fd63(0x1eb)](_0x1e4fba['id'],_0x1e4fba);}const _0x48dfc3=new Set();for(const _0x5a4171 of _0x574ea1){!_0x5a4171[_0x51fd63(0x1e7)]&&_0x48dfc3[_0x51fd63(0x1ec)](_0x5a4171['id']);}function _0x118658(_0x152ff0){const _0xd1611=_0x51fd63;if(_0x48dfc3[_0xd1611(0x1e6)](_0x152ff0['id']))return'';if(_0x152ff0[_0xd1611(0x1e7)]){const _0x12b632=_0x27a6a1[_0xd1611(0x1e8)](_0x152ff0['parentFolderId']);if(_0x12b632){const _0x3e6273=_0x118658(_0x12b632);return _0x3e6273?_0x3e6273+'/'+_0x152ff0[_0xd1611(0x1e0)]:_0x152ff0[_0xd1611(0x1e0)];}}return _0x152ff0[_0xd1611(0x1e0)];}for(const _0x5e0de3 of _0x574ea1){const _0x26f083=_0x118658(_0x5e0de3);_0x51e795[_0x51fd63(0x1eb)](_0x26f083,_0x5e0de3['id']);}return _0x51e795;}function a120_0x2bfa(_0x327a76,_0x4ac72d){_0x327a76=_0x327a76-0x1de;const _0x4ac8c1=a120_0x4ac8();let _0x2bfaac=_0x4ac8c1[_0x327a76];return _0x2bfaac;}export function buildFolderMaps(_0x31bfb8){const _0x5089dd=a120_0x2bfa,_0x5d0b5b=buildFolderIdToPathMap(_0x31bfb8),_0x1c5ed5=new Map();for(const [_0x1acf2,_0xb1cef7]of _0x5d0b5b){_0x1c5ed5[_0x5089dd(0x1eb)](_0xb1cef7,_0x1acf2);}return{'idToPath':_0x5d0b5b,'pathToId':_0x1c5ed5};}export function getFolderPath(_0x386923,_0x4e4d36){const _0x4adc98=a120_0x2bfa;if(!_0x386923)return'';return _0x4e4d36[_0x4adc98(0x1e8)](_0x386923)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x511166,_0x5bf493){const _0x233055=a121_0x50ce,_0x1e7fd8=_0x511166();while(!![]){try{const _0x106675=parseInt(_0x233055(0xaa))/0x1+parseInt(_0x233055(0xc4))/0x2+parseInt(_0x233055(0xc7))/0x3+parseInt(_0x233055(0xbc))/0x4+-parseInt(_0x233055(0xc2))/0x5+parseInt(_0x233055(0xba))/0x6*(-parseInt(_0x233055(0xbb))/0x7)+-parseInt(_0x233055(0xce))/0x8*(parseInt(_0x233055(0xc3))/0x9);if(_0x106675===_0x5bf493)break;else _0x1e7fd8['push'](_0x1e7fd8['shift']());}catch(_0x4a1537){_0x1e7fd8['push'](_0x1e7fd8['shift']());}}}(a121_0x3377,0xd1710));import a121_0x2ad30c from'path';import{parse as a121_0x87ca5e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x25a784){const _0x252207=a121_0x50ce;if(!_0x25a784||_0x25a784[_0x252207(0xb3)]()==='')throw new Error(_0x252207(0xb0));const _0x2af440=_0x25a784['trim']();if(_0x2af440==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x25a784};const _0x10ef4f=_0x2af440[_0x252207(0xa1)]('/')?_0x2af440[_0x252207(0xcf)](0x1):_0x2af440,_0x444820=_0x10ef4f[_0x252207(0xad)]('/')[_0x252207(0xbf)](_0x20b6eb=>_0x20b6eb!=='');if(_0x444820[_0x252207(0xb7)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0xb83f00=_0x2af440[_0x252207(0xa1)]('/')||!isRelativePathSegment(_0x444820[0x0]);for(const _0x5e4ad2 of _0x444820){validatePathSegment(_0x5e4ad2);}return{'segments':_0x444820,'isAbsolute':_0xb83f00,'raw':_0x25a784};}function isRelativePathSegment(_0x5cac60){return _0x5cac60==='.'||_0x5cac60==='..';}function a121_0x3377(){const _0x2ece88=['2186634Eamcyf','relative','No\x20tdx.json\x20found\x20for\x20file:\x20','isAbsolute','Path\x20attempts\x20to\x20navigate\x20above\x20root','push','.yaml','134096rIUnNp','substring','startsWith','exists','segments','segment','name','.yml','pop','replace','Cannot\x20split\x20empty\x20path','835002WeoeSQ','journey','endsWith','split','join','parse','Path\x20cannot\x20be\x20empty','Path\x20segment\x20cannot\x20be\x20empty','parent_segment','trim','readFile','root','dirname','length','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','14694dSLkEd','1638cbwVUl','3998520PZaBih','raw','type','filter','File\x20not\x20found:\x20','Cannot\x20navigate\x20above\x20root','4820980prjwfR','387RMVgRr','1104780SfwfKG','resolve','tdx.json'];a121_0x3377=function(){return _0x2ece88;};return a121_0x3377();}function validatePathSegment(_0x4cfd58){const _0x13ca7b=a121_0x50ce;if(_0x4cfd58==='')throw new Error(_0x13ca7b(0xb1));if(_0x4cfd58==='.'||_0x4cfd58==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x4cfd58))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x4cfd58);if(_0x4cfd58!==_0x4cfd58[_0x13ca7b(0xb3)]()){}}export function validatePath(_0x313894){const _0x406edf=a121_0x50ce;if(_0x313894[_0x406edf(0xa3)][_0x406edf(0xb7)]===0x0&&!_0x313894[_0x406edf(0xca)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x313894['isAbsolute']){if(_0x313894[_0x406edf(0xa3)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x4e7753=0x0;for(const _0x542afb of _0x313894[_0x406edf(0xa3)]){if(_0x542afb==='..'){if(_0x4e7753===0x0)throw new Error(_0x406edf(0xcb));_0x4e7753--;}else _0x542afb!=='.'&&_0x4e7753++;}}}export function joinPaths(_0x48b296,_0x4272fe){const _0x174c7b=a121_0x50ce;if(!_0x48b296||_0x48b296==='/')return _0x4272fe;if(!_0x4272fe||_0x4272fe==='.')return _0x48b296;if(_0x4272fe[_0x174c7b(0xa1)]('/'))return _0x4272fe;const _0x1e3223=parsePath(_0x48b296),_0x12e198=parsePath(_0x4272fe),_0x5871bf=[..._0x1e3223[_0x174c7b(0xa3)]];for(const _0xfc9a74 of _0x12e198['segments']){if(_0xfc9a74==='.')continue;else{if(_0xfc9a74==='..'){if(_0x5871bf[_0x174c7b(0xb7)]===0x0)throw new Error(_0x174c7b(0xc1));_0x5871bf[_0x174c7b(0xa7)]();}else _0x5871bf['push'](_0xfc9a74);}}const _0x3130b3=_0x5871bf[_0x174c7b(0xae)]('/');return _0x1e3223[_0x174c7b(0xbd)][_0x174c7b(0xa1)]('/')?'/'+_0x3130b3:_0x3130b3;}function a121_0x50ce(_0x423eeb,_0x54db2e){_0x423eeb=_0x423eeb-0xa1;const _0x337716=a121_0x3377();let _0x50ce6a=_0x337716[_0x423eeb];return _0x50ce6a;}export function normalizePath(_0x43725b){const _0x52be99=a121_0x50ce,_0x1debab=parsePath(_0x43725b),_0xb5aa2c=[];for(const _0x50c55a of _0x1debab['segments']){if(_0x50c55a==='.')continue;else{if(_0x50c55a==='..'){if(_0xb5aa2c['length']===0x0){if(_0x1debab[_0x52be99(0xca)])throw new Error(_0x52be99(0xc1));_0xb5aa2c[_0x52be99(0xcc)]('..');}else _0xb5aa2c[_0xb5aa2c[_0x52be99(0xb7)]-0x1]==='..'?_0xb5aa2c[_0x52be99(0xcc)]('..'):_0xb5aa2c[_0x52be99(0xa7)]();}else _0xb5aa2c['push'](_0x50c55a);}}if(_0xb5aa2c[_0x52be99(0xb7)]===0x0)return _0x1debab[_0x52be99(0xca)]?'/':'.';const _0x5acd98=_0xb5aa2c[_0x52be99(0xae)]('/');return _0x1debab['raw'][_0x52be99(0xa1)]('/')?'/'+_0x5acd98:_0x5acd98;}export function getParentPath(_0x390453){const _0x605125=a121_0x50ce,_0x12d7b7=parsePath(_0x390453);if(_0x12d7b7[_0x605125(0xa3)][_0x605125(0xb7)]<=0x1)return'/';const _0x101a63=_0x12d7b7[_0x605125(0xa3)]['slice'](0x0,-0x1)[_0x605125(0xae)]('/');return _0x12d7b7[_0x605125(0xbd)][_0x605125(0xa1)]('/')?'/'+_0x101a63:_0x101a63;}export function getBaseName(_0x958ebe){const _0x594543=a121_0x50ce,_0x19ed7a=parsePath(_0x958ebe);return _0x19ed7a['segments'][_0x19ed7a[_0x594543(0xa3)][_0x594543(0xb7)]-0x1]||'';}export function isChildPath(_0xaa8622,_0x46d182){const _0x5618c8=a121_0x50ce,_0x8694fe=parsePath(_0xaa8622),_0x52cd58=parsePath(_0x46d182);if(_0x8694fe['segments'][_0x5618c8(0xb7)]<=_0x52cd58[_0x5618c8(0xa3)][_0x5618c8(0xb7)])return![];for(let _0xa69cd2=0x0;_0xa69cd2<_0x52cd58[_0x5618c8(0xa3)][_0x5618c8(0xb7)];_0xa69cd2++){if(_0x8694fe[_0x5618c8(0xa3)][_0xa69cd2]!==_0x52cd58[_0x5618c8(0xa3)][_0xa69cd2])return![];}return!![];}export function splitPath(_0x26ddd7){const _0x2c424f=a121_0x50ce,_0x15f7c9=parsePath(_0x26ddd7);if(_0x15f7c9[_0x2c424f(0xa3)]['length']===0x0)throw new Error(_0x2c424f(0xa9));if(_0x15f7c9['segments'][_0x2c424f(0xb7)]===0x1)return{'parent':_0x15f7c9[_0x2c424f(0xa3)][0x0]};return{'parent':_0x15f7c9[_0x2c424f(0xa3)][0x0],'child':_0x15f7c9[_0x2c424f(0xa3)]['slice'](0x1)[_0x2c424f(0xae)]('/')};}export function isYamlFilePath(_0xf12d){const _0x2aa8cd=a121_0x50ce;return _0xf12d[_0x2aa8cd(0xac)](_0x2aa8cd(0xa6))||_0xf12d[_0x2aa8cd(0xac)](_0x2aa8cd(0xcd));}export async function resolveYamlFilePath(_0x25d454,_0x3423b4=nodeFileSystem){const _0x44e61f=a121_0x50ce,_0xeed52=a121_0x2ad30c[_0x44e61f(0xc5)](_0x25d454);if(!await _0x3423b4[_0x44e61f(0xa2)](_0xeed52))throw new Error(_0x44e61f(0xc0)+_0x25d454);let _0x5633a6=a121_0x2ad30c['dirname'](_0xeed52),_0xb8aa53=null,_0x3f3068=null;const _0x536c2a=a121_0x2ad30c[_0x44e61f(0xaf)](_0x5633a6)[_0x44e61f(0xb5)];while(_0x5633a6!==_0x536c2a){const _0x27447c=a121_0x2ad30c['join'](_0x5633a6,_0x44e61f(0xc6));if(await _0x3423b4[_0x44e61f(0xa2)](_0x27447c)){_0xb8aa53=_0x27447c,_0x3f3068=_0x5633a6;break;}_0x5633a6=a121_0x2ad30c['dirname'](_0x5633a6);}if(!_0xb8aa53||!_0x3f3068)throw new Error(_0x44e61f(0xc9)+_0x25d454);const _0x2b93b9=await _0x3423b4['readFile'](_0xb8aa53),_0x55abb9=JSON[_0x44e61f(0xaf)](_0x2b93b9),_0x10c97f=_0x55abb9[_0x44e61f(0xb2)];if(!_0x10c97f)throw new Error(_0x44e61f(0xb9));const _0x6b279d=await _0x3423b4[_0x44e61f(0xb4)](_0xeed52),_0x53532b=a121_0x87ca5e(_0x6b279d),_0x511a40=_0x53532b[_0x44e61f(0xa5)];if(!_0x511a40)throw new Error(_0x44e61f(0xb8)+_0x25d454);const _0x4719cc=_0x53532b[_0x44e61f(0xbe)]===_0x44e61f(0xab)?'journey':_0x44e61f(0xa4),_0x5b974e=a121_0x2ad30c[_0x44e61f(0xc8)](_0x3f3068,_0xeed52),_0x2bf839=a121_0x2ad30c[_0x44e61f(0xb6)](_0x5b974e),_0x155321=_0x2bf839==='.'?'':_0x2bf839[_0x44e61f(0xa8)](/\\/g,'/'),_0x381e0a=_0x155321?_0x10c97f+'/'+_0x155321+'/'+_0x511a40:_0x10c97f+'/'+_0x511a40;return{'parentSegment':_0x10c97f,'segmentName':_0x511a40,'folderPath':_0x155321,'fullPath':_0x381e0a,'resourceType':_0x4719cc};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a122_0x3e36(_0x16915f,_0x4951d5){_0x16915f=_0x16915f-0x123;const _0x450ef0=a122_0x450e();let _0x3e3645=_0x450ef0[_0x16915f];return _0x3e3645;}function a122_0x450e(){const _0x1d110e=['4274928ZOFFVg','893704obiONl','22LcHgpL','24pybQfi','358404rKqKYh','377199MQlcEA','70hyJruj','214012QIpKHK','199367VzhSLQ','371370cAPTmX','Invalid\x20segment\x20reference\x20format:\x20','substring','3Qxbqgz','8ncHFEC','.\x20Parent\x20name\x20cannot\x20be\x20empty'];a122_0x450e=function(){return _0x1d110e;};return a122_0x450e();}(function(_0x12215a,_0x180b35){const _0x3c140c=a122_0x3e36,_0x45edca=_0x12215a();while(!![]){try{const _0x96da80=-parseInt(_0x3c140c(0x12d))/0x1+-parseInt(_0x3c140c(0x130))/0x2*(-parseInt(_0x3c140c(0x126))/0x3)+-parseInt(_0x3c140c(0x12a))/0x4+-parseInt(_0x3c140c(0x123))/0x5*(parseInt(_0x3c140c(0x12c))/0x6)+-parseInt(_0x3c140c(0x131))/0x7*(parseInt(_0x3c140c(0x127))/0x8)+-parseInt(_0x3c140c(0x12e))/0x9*(-parseInt(_0x3c140c(0x12f))/0xa)+parseInt(_0x3c140c(0x12b))/0xb*(parseInt(_0x3c140c(0x129))/0xc);if(_0x96da80===_0x180b35)break;else _0x45edca['push'](_0x45edca['shift']());}catch(_0x106a38){_0x45edca['push'](_0x45edca['shift']());}}}(a122_0x450e,0x32298));export function parseSegmentRef(_0xc699d9){const _0x2489e5=a122_0x3e36,_0x2c3269=_0xc699d9['indexOf']('/');if(_0x2c3269===-0x1)return{'parentId':_0xc699d9};if(_0x2c3269===0x0)throw new Error(_0x2489e5(0x124)+_0xc699d9+_0x2489e5(0x128));const _0x100d9a=_0xc699d9[_0x2489e5(0x125)](0x0,_0x2c3269),_0x3a6684=_0xc699d9['substring'](_0x2c3269+0x1);if(_0x3a6684==='')throw new Error(_0x2489e5(0x124)+_0xc699d9+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x100d9a,'childId':_0x3a6684};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ddeb6,_0x38272a){const _0x35ca75=a123_0x3407,_0x4ecbd4=_0x3ddeb6();while(!![]){try{const _0x10d82c=parseInt(_0x35ca75(0x1d5))/0x1+-parseInt(_0x35ca75(0x1b4))/0x2*(parseInt(_0x35ca75(0x1ac))/0x3)+parseInt(_0x35ca75(0x1aa))/0x4*(-parseInt(_0x35ca75(0x1c5))/0x5)+parseInt(_0x35ca75(0x1c9))/0x6+-parseInt(_0x35ca75(0x1b1))/0x7+-parseInt(_0x35ca75(0x1b7))/0x8*(parseInt(_0x35ca75(0x1be))/0x9)+parseInt(_0x35ca75(0x1cd))/0xa;if(_0x10d82c===_0x38272a)break;else _0x4ecbd4['push'](_0x4ecbd4['shift']());}catch(_0x413652){_0x4ecbd4['push'](_0x4ecbd4['shift']());}}}(a123_0x1e29,0xcc927));import a123_0x5a6beb from'path';function a123_0x1e29(){const _0x18184c=['folderPath','directory','parse','18KrYlvn','parent_name','exists','Parent\x20segment\x20not\x20specified','stat','File\x20not\x20found:\x20','type','8980TZnBIH','isDirectory','no_parent','segment','3934020WbeDZf','extname','tdx.json','error','52836210OTVCxQ','isScoped','trim','parent_segment','replace','basename','resourceType','segmentName','481276wRcPBg','startsWith','invalid_yaml','includes','match','parentSegment','scopedFolderPath','File\x20not\x20found','file','resolve','journey','isFile','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','3156nHrdVw','file_not_found','60594vMmYRD','dirname','readFile','no_config','relative','11381930StpQeK','No\x20tdx.json\x20found\x20for\x20file:\x20','configDir','140vywbuZ','context','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','4502984yHpqEN','cwd','message','string'];a123_0x1e29=function(){return _0x18184c;};return a123_0x1e29();}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(_0x27a4d8){const _0x4a0146=a123_0x3407;return _0x27a4d8[_0x4a0146(0x1c4)]!==_0x4a0146(0x1cc);}export function isScopedResolution(_0x48e998){const _0xea4401=a123_0x3407;return _0x48e998[_0xea4401(0x1c4)]===_0xea4401(0x1bc)||_0x48e998[_0xea4401(0x1c4)]===_0xea4401(0x1a5)||_0x48e998['type']===_0xea4401(0x1b5);}export function getScopedDetails(_0x169c68){if(isScopedResolution(_0x169c68))return{'isScoped':_0x169c68['isScoped'],'scopedFolderPath':_0x169c68['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x3521f4,_0x2de1de){const _0x55136b=a123_0x3407;let _0x2b5892=a123_0x5a6beb['resolve'](_0x3521f4);const _0x1397e0=a123_0x5a6beb['parse'](_0x2b5892)['root'];while(_0x2b5892!==_0x1397e0){const _0x5f2b52=a123_0x5a6beb['join'](_0x2b5892,_0x55136b(0x1cb));if(await _0x2de1de['exists'](_0x5f2b52))try{const _0x30baa5=await _0x2de1de[_0x55136b(0x1ae)](_0x5f2b52),_0x44984e=JSON[_0x55136b(0x1bd)](_0x30baa5);if(_0x44984e[_0x55136b(0x1d0)]&&typeof _0x44984e[_0x55136b(0x1d0)]===_0x55136b(0x1ba))return{'configPath':_0x5f2b52,'configDir':_0x2b5892,'parentSegment':_0x44984e[_0x55136b(0x1d0)]};}catch{}_0x2b5892=a123_0x5a6beb['dirname'](_0x2b5892);}return null;}function a123_0x3407(_0x2d80e4,_0x17c576){_0x2d80e4=_0x2d80e4-0x1a1;const _0x1e29e9=a123_0x1e29();let _0x340781=_0x1e29e9[_0x2d80e4];return _0x340781;}function calculateScopedPath(_0x1f7d7a,_0x4a0b30){const _0x4a7639=a123_0x3407,_0x9f5f8c=a123_0x5a6beb[_0x4a7639(0x1b0)](_0x4a0b30,_0x1f7d7a),_0x16b7cc=_0x9f5f8c!==''&&_0x9f5f8c!=='.'&&!_0x9f5f8c[_0x4a7639(0x1d6)]('..');return{'isScoped':_0x16b7cc,'scopedFolderPath':_0x16b7cc?_0x9f5f8c[_0x4a7639(0x1d1)](/\\/g,'/'):''};}export async function resolveTarget(_0x3d9371){const _0x4a3b36=a123_0x3407,{arg:_0x573496,contextParent:_0x4e1475,cwd:cwd=process[_0x4a3b36(0x1b8)](),fs:fs=nodeFileSystem}=_0x3d9371;if(_0x573496&&isYamlFilePath(_0x573496))try{const _0x2a512f=await resolveYamlFilePath(_0x573496,fs),_0x3d2497=a123_0x5a6beb[_0x4a3b36(0x1a6)](_0x573496),_0xe06eba=a123_0x5a6beb[_0x4a3b36(0x1ad)](_0x3d2497),_0xd9a180=await findTdxConfigAsync(_0xe06eba,fs);if(!_0xd9a180){if(_0x4e1475){const _0x5d330f=a123_0x5a6beb['dirname'](_0x3d2497);return{'type':'file','parentName':_0x4e1475,'targetDir':_0x5d330f,'configRoot':_0x5d330f,'filePath':_0x3d2497,'resourceName':_0x2a512f[_0x4a3b36(0x1d4)],'folderPath':_0x2a512f[_0x4a3b36(0x1bb)],'resourceType':_0x2a512f[_0x4a3b36(0x1d3)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1af),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x573496,'arg':_0x573496,'helpText':'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'};}const _0x4a271a=calculateScopedPath(_0xe06eba,_0xd9a180[_0x4a3b36(0x1b3)]);return{'type':_0x4a3b36(0x1a5),'parentName':_0xd9a180[_0x4a3b36(0x1a2)],'targetDir':_0xd9a180[_0x4a3b36(0x1b3)],'configRoot':_0xd9a180[_0x4a3b36(0x1b3)],'filePath':_0x3d2497,'resourceName':_0x2a512f[_0x4a3b36(0x1d4)],'folderPath':_0x2a512f[_0x4a3b36(0x1bb)],'resourceType':_0x2a512f['resourceType'],'isScoped':_0x4a271a['isScoped'],'scopedFolderPath':_0x4a271a['scopedFolderPath']};}catch(_0x10c589){const _0x41f602=_0x10c589 instanceof Error?_0x10c589[_0x4a3b36(0x1b9)]:String(_0x10c589);if(_0x41f602['includes'](_0x4a3b36(0x1a4)))return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1ab),'message':_0x4a3b36(0x1c3)+_0x573496,'arg':_0x573496};if(_0x41f602[_0x4a3b36(0x1d8)]('No\x20tdx.json\x20found')){if(_0x4e1475){const _0xd45816=a123_0x5a6beb[_0x4a3b36(0x1a6)](_0x573496);if(await fs[_0x4a3b36(0x1c0)](_0xd45816)){const _0x5a6163=a123_0x5a6beb[_0x4a3b36(0x1ad)](_0xd45816),_0x3825ef=await fs[_0x4a3b36(0x1ae)](_0xd45816),_0x1b2691=_0x3825ef['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0xeaddda=_0x3825ef[_0x4a3b36(0x1a1)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x1a0ff0=_0x1b2691?_0x1b2691[0x1][_0x4a3b36(0x1cf)]():a123_0x5a6beb[_0x4a3b36(0x1d2)](_0x573496,a123_0x5a6beb[_0x4a3b36(0x1ca)](_0x573496)),_0x141e6a=_0xeaddda&&_0xeaddda[0x1][_0x4a3b36(0x1cf)]()===_0x4a3b36(0x1a7)?_0x4a3b36(0x1a7):_0x4a3b36(0x1c8);return{'type':'file','parentName':_0x4e1475,'targetDir':_0x5a6163,'configRoot':_0x5a6163,'filePath':_0xd45816,'resourceName':_0x1a0ff0,'folderPath':'','resourceType':_0x141e6a,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x4a3b36(0x1cc),'errorCode':'no_config','message':_0x4a3b36(0x1b2)+_0x573496,'arg':_0x573496,'helpText':_0x4a3b36(0x1b6)};}return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1d7),'message':_0x41f602,'arg':_0x573496};}if(_0x573496){const _0xa9ad71=a123_0x5a6beb[_0x4a3b36(0x1a6)](cwd,_0x573496);let _0x1fc3aa=null;try{_0x1fc3aa=await fs[_0x4a3b36(0x1c2)](_0xa9ad71);}catch{}if(_0x1fc3aa?.[_0x4a3b36(0x1c6)]()){const _0x169b4e=await findTdxConfigAsync(_0xa9ad71,fs);if(_0x169b4e){const _0x388d16=calculateScopedPath(_0xa9ad71,_0x169b4e['configDir']);return{'type':_0x4a3b36(0x1bc),'parentName':_0x169b4e[_0x4a3b36(0x1a2)],'targetDir':_0xa9ad71,'configRoot':_0x169b4e['configDir'],'isScoped':_0x388d16[_0x4a3b36(0x1ce)],'scopedFolderPath':_0x388d16[_0x4a3b36(0x1a3)]};}if(_0x4e1475)return{'type':'directory','parentName':_0x4e1475,'targetDir':_0xa9ad71,'configRoot':_0xa9ad71,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x4a3b36(0x1af),'message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x573496,'arg':_0x573496,'helpText':_0x4a3b36(0x1b6)};}if(_0x1fc3aa?.[_0x4a3b36(0x1a8)]())return{'type':_0x4a3b36(0x1cc),'errorCode':'invalid_yaml','message':'Not\x20a\x20YAML\x20file:\x20'+_0x573496,'arg':_0x573496,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x502a09=sanitizeFileName(_0x573496),_0x4dd464=getSegmentRootDir(_0x502a09,cwd);return{'type':_0x4a3b36(0x1bf),'parentName':_0x573496,'targetDir':_0x4dd464,'configRoot':_0x4dd464};}const _0x21d39f=await findTdxConfigAsync(cwd,fs);if(_0x21d39f){const _0x2de4b5=calculateScopedPath(cwd,_0x21d39f[_0x4a3b36(0x1b3)]);return{'type':_0x4a3b36(0x1b5),'parentName':_0x21d39f[_0x4a3b36(0x1a2)],'targetDir':cwd,'configRoot':_0x21d39f[_0x4a3b36(0x1b3)],'isScoped':_0x2de4b5[_0x4a3b36(0x1ce)],'scopedFolderPath':_0x2de4b5['scopedFolderPath']};}if(_0x4e1475){const _0x53586c=sanitizeFileName(_0x4e1475),_0x3ac17d=getSegmentRootDir(_0x53586c,cwd);return{'type':_0x4a3b36(0x1b5),'parentName':_0x4e1475,'targetDir':_0x3ac17d,'configRoot':_0x3ac17d,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1c7),'message':_0x4a3b36(0x1c1),'helpText':_0x4a3b36(0x1a9)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a124_0x2d21(){const _0x2d2d81=['370HjBVSd','object','startsWith','154656HFbHkr','root','stringify','191640xaCkUf','dirname','2847713NVvyhi','8eIeIwp','77777LSGicV','utf-8','cwd','parse','resolve','segments','tdx.json','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','2970276jDyKJR','315miAkMf','parent_segment','replace','Invalid\x20JSON\x20in\x20','70932ADCXFh','11188ujMKoQ','join','relative','string','296QHZVjb','Invalid\x20tdx.json:\x20expected\x20object','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field'];a124_0x2d21=function(){return _0x2d2d81;};return a124_0x2d21();}const a124_0x24683d=a124_0x4a2c;(function(_0x5b5ecc,_0x6c6590){const _0x2eb3a2=a124_0x4a2c,_0x4a8da6=_0x5b5ecc();while(!![]){try{const _0x458384=-parseInt(_0x2eb3a2(0x1a1))/0x1+-parseInt(_0x2eb3a2(0x185))/0x2*(parseInt(_0x2eb3a2(0x193))/0x3)+-parseInt(_0x2eb3a2(0x194))/0x4*(-parseInt(_0x2eb3a2(0x18f))/0x5)+parseInt(_0x2eb3a2(0x18e))/0x6+parseInt(_0x2eb3a2(0x186))/0x7*(-parseInt(_0x2eb3a2(0x198))/0x8)+parseInt(_0x2eb3a2(0x19e))/0x9*(parseInt(_0x2eb3a2(0x19b))/0xa)+-parseInt(_0x2eb3a2(0x184))/0xb;if(_0x458384===_0x6c6590)break;else _0x4a8da6['push'](_0x4a8da6['shift']());}catch(_0x538a06){_0x4a8da6['push'](_0x4a8da6['shift']());}}}(a124_0x2d21,0x55a8b));import{existsSync,readFileSync}from'fs';import a124_0xecb9fc from'path';const TDX_CONFIG_FILE=a124_0x24683d(0x18c),SEGMENTS_DIR=a124_0x24683d(0x18b);export function findTdxConfigPath(_0x1824d0=process[a124_0x24683d(0x188)]()){const _0x1af8cd=a124_0x24683d;let _0x5d2dec=a124_0xecb9fc[_0x1af8cd(0x18a)](_0x1824d0);const _0x37e29e=a124_0xecb9fc[_0x1af8cd(0x189)](_0x5d2dec)[_0x1af8cd(0x19f)];while(_0x5d2dec!==_0x37e29e){const _0xb1f1c2=a124_0xecb9fc[_0x1af8cd(0x195)](_0x5d2dec,TDX_CONFIG_FILE);if(existsSync(_0xb1f1c2))return _0xb1f1c2;_0x5d2dec=a124_0xecb9fc[_0x1af8cd(0x183)](_0x5d2dec);}return null;}function a124_0x4a2c(_0x26911d,_0x86b07f){_0x26911d=_0x26911d-0x183;const _0x2d211b=a124_0x2d21();let _0x4a2cf8=_0x2d211b[_0x26911d];return _0x4a2cf8;}export function loadTdxConfig(_0x4ec2f4){const _0x258a92=a124_0x24683d,_0x4b35d5=readFileSync(_0x4ec2f4,_0x258a92(0x187));let _0x55acfc;try{_0x55acfc=JSON['parse'](_0x4b35d5);}catch{throw new Error(_0x258a92(0x192)+_0x4ec2f4);}if(!_0x55acfc||typeof _0x55acfc!==_0x258a92(0x19c))throw new Error(_0x258a92(0x199));const _0x693c69=_0x55acfc;if(!_0x693c69[_0x258a92(0x190)]||typeof _0x693c69['parent_segment']!==_0x258a92(0x197))throw new Error(_0x258a92(0x19a));return{'parent_segment':_0x693c69[_0x258a92(0x190)]};}export function findTdxConfig(_0x3b0ec6=process[a124_0x24683d(0x188)]()){const _0x25405a=a124_0x24683d,_0xf762a7=findTdxConfigPath(_0x3b0ec6);if(!_0xf762a7)throw new Error(_0x25405a(0x18d));const _0x273957=loadTdxConfig(_0xf762a7),_0x410c94=a124_0xecb9fc[_0x25405a(0x183)](_0xf762a7);return{'config':_0x273957,'configPath':_0xf762a7,'configDir':_0x410c94};}export function tryFindTdxConfig(_0x2c9769){try{return findTdxConfig(_0x2c9769);}catch{return null;}}export function getSegmentRootDir(_0x3db9b1,_0x114635=process[a124_0x24683d(0x188)]()){return a124_0xecb9fc['join'](_0x114635,SEGMENTS_DIR,_0x3db9b1);}export function getTdxConfigPath(_0x18e9a9,_0x44898f=process[a124_0x24683d(0x188)]()){const _0x5c8e2e=a124_0x24683d;return a124_0xecb9fc[_0x5c8e2e(0x195)](getSegmentRootDir(_0x18e9a9,_0x44898f),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x41b21b,_0x1b5600){const _0x3cf2d1=a124_0x24683d,_0x5166c7=a124_0xecb9fc[_0x3cf2d1(0x18a)](_0x41b21b),_0x196481=a124_0xecb9fc[_0x3cf2d1(0x196)](_0x1b5600,_0x5166c7);if(_0x196481[_0x3cf2d1(0x19d)]('..'))return'';return _0x196481;}export function localPathToTdFolderPath(_0x45aa46){const _0x37c74d=a124_0x24683d,_0x440555=a124_0xecb9fc[_0x37c74d(0x183)](_0x45aa46);if(_0x440555==='.'||_0x440555==='')return'';return _0x440555[_0x37c74d(0x191)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x577f69,_0x317936){if(!_0x577f69)return _0x317936;return a124_0xecb9fc['join'](_0x317936,_0x577f69);}export function createTdxConfigContent(_0x249034){const _0x282f89=a124_0x24683d,_0x471336={'parent_segment':_0x249034};return JSON[_0x282f89(0x1a0)](_0x471336,null,0x2)+'\x0a';}
|