@treasuredata/tdx 0.14.1 → 0.14.3

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.
Files changed (151) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/api-command.js +1 -1
  8. package/dist/commands/auth-command.d.ts.map +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-command.js.map +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-command.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/journey-command.js +1 -1
  22. package/dist/commands/journey-validate-command.js +1 -1
  23. package/dist/commands/llm-command.js +1 -1
  24. package/dist/commands/llm-proxy.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.js +1 -1
  43. package/dist/core/auth.js +1 -1
  44. package/dist/core/command-output.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/connection-cache.js +1 -1
  47. package/dist/core/constants.js +1 -1
  48. package/dist/core/credential-cache.js +1 -1
  49. package/dist/core/global-context.js +1 -1
  50. package/dist/core/keychain.js +1 -1
  51. package/dist/core/profile.d.ts +15 -0
  52. package/dist/core/profile.d.ts.map +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/profile.js.map +1 -1
  55. package/dist/core/project-config.js +1 -1
  56. package/dist/core/session.js +1 -1
  57. package/dist/core/user-cache.js +1 -1
  58. package/dist/core/version.js +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/proxy/anthropic-adapter.js +1 -1
  61. package/dist/proxy/claude-usage-tracker.js +1 -1
  62. package/dist/proxy/context-signature.js +1 -1
  63. package/dist/proxy/conversation-utils.js +1 -1
  64. package/dist/proxy/passthrough-server.d.ts +13 -2
  65. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  66. package/dist/proxy/passthrough-server.js +1 -1
  67. package/dist/proxy/passthrough-server.js.map +1 -1
  68. package/dist/proxy/server.js +1 -1
  69. package/dist/proxy/session-cache.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/api.js +1 -1
  75. package/dist/sdk/client/cdp-api-client.js +1 -1
  76. package/dist/sdk/client/endpoints.js +1 -1
  77. package/dist/sdk/client/endpoints.js.map +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-aliases.js +1 -1
  98. package/dist/sdk/llm/model-factors.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  102. package/dist/sdk/segment/fields-display.js +1 -1
  103. package/dist/sdk/segment/file-discovery.js +1 -1
  104. package/dist/sdk/segment/journey-utils.js +1 -1
  105. package/dist/sdk/segment/journey-yaml.js +1 -1
  106. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  107. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  108. package/dist/sdk/segment/pull-workflow.js +1 -1
  109. package/dist/sdk/segment/push-workflow.js +1 -1
  110. package/dist/sdk/segment/resolution-context.js +1 -1
  111. package/dist/sdk/segment/segment-path-parser.js +1 -1
  112. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  113. package/dist/sdk/segment/target-resolution.js +1 -1
  114. package/dist/sdk/segment/tdx-config.js +1 -1
  115. package/dist/sdk/segment/validate-files.js +1 -1
  116. package/dist/sdk/segment/yaml-validator.js +1 -1
  117. package/dist/sdk/segment.js +1 -1
  118. package/dist/sdk/types/index.js +1 -1
  119. package/dist/sdk/types/progress.js +1 -1
  120. package/dist/sdk/user.js +1 -1
  121. package/dist/sdk/util/format-detector.js +1 -1
  122. package/dist/sdk/util/formatters.js +1 -1
  123. package/dist/sdk/util/index.js +1 -1
  124. package/dist/sdk/util/tree-formatter.js +1 -1
  125. package/dist/sdk/workflow/clone-workflow.js +1 -1
  126. package/dist/sdk/workflow/index.js +1 -1
  127. package/dist/sdk/workflow/pull-workflow.js +1 -1
  128. package/dist/sdk/workflow/push-workflow.d.ts.map +1 -1
  129. package/dist/sdk/workflow/push-workflow.js +1 -1
  130. package/dist/sdk/workflow/push-workflow.js.map +1 -1
  131. package/dist/sdk/workflow/tdx-config.js +1 -1
  132. package/dist/sdk/workflow/workflow-utils.d.ts +60 -0
  133. package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -1
  134. package/dist/sdk/workflow/workflow-utils.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js.map +1 -1
  136. package/dist/utils/async.js +1 -1
  137. package/dist/utils/colors.js +1 -1
  138. package/dist/utils/diff.js +1 -1
  139. package/dist/utils/file-permissions.js +1 -1
  140. package/dist/utils/json-loader.js +1 -1
  141. package/dist/utils/option-validation.js +1 -1
  142. package/dist/utils/port.js +1 -1
  143. package/dist/utils/process.js +1 -1
  144. package/dist/utils/prompt.js +1 -1
  145. package/dist/utils/spinner.js +1 -1
  146. package/dist/utils/sse-parser.js +1 -1
  147. package/dist/utils/string-utils.js +1 -1
  148. package/dist/utils/table-ref-parser.js +1 -1
  149. package/dist/utils/tdx-logger.js +1 -1
  150. package/dist/utils/version-check.js +1 -1
  151. package/package.json +2 -1
@@ -1 +1 @@
1
- const a100_0x25feef=a100_0x386c;(function(_0x22a4b7,_0x46a1e5){const _0x19cce8=a100_0x386c,_0x497656=_0x22a4b7();while(!![]){try{const _0x7ee3e3=-parseInt(_0x19cce8(0x1c6))/0x1+-parseInt(_0x19cce8(0x18f))/0x2+parseInt(_0x19cce8(0x1b4))/0x3*(parseInt(_0x19cce8(0x199))/0x4)+parseInt(_0x19cce8(0xfb))/0x5+parseInt(_0x19cce8(0x17a))/0x6*(-parseInt(_0x19cce8(0x192))/0x7)+parseInt(_0x19cce8(0x130))/0x8+parseInt(_0x19cce8(0x13d))/0x9*(parseInt(_0x19cce8(0x164))/0xa);if(_0x7ee3e3===_0x46a1e5)break;else _0x497656['push'](_0x497656['shift']());}catch(_0x2426e3){_0x497656['push'](_0x497656['shift']());}}}(a100_0x4dc7,0x92e5d));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a100_0x25feef(0x189);export const PENDING_ACTIVATION_PREFIX=a100_0x25feef(0x1c5);export function createPendingSegmentId(_0x463766){return''+PENDING_SEGMENT_PREFIX+_0x463766+'__';}export function isPendingSegmentId(_0x2fc4e7){return _0x2fc4e7['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x276644){return _0x276644['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x195359){return''+PENDING_ACTIVATION_PREFIX+_0x195359+'__';}export function isPendingActivationId(_0x595b58){const _0x555455=a100_0x25feef;return _0x595b58[_0x555455(0x1bb)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x2e6133){const _0x46f2cc=a100_0x25feef;return _0x2e6133[_0x46f2cc(0x1ac)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x1daae3,_0x5f08a9){const _0x2cdee3=a100_0x25feef,_0x53491e=_0x1daae3+'::'+(_0x5f08a9[_0x2cdee3(0x14a)]()||_0x2cdee3(0x15d)),_0x4481aa=createHash(_0x2cdee3(0x1c3))[_0x2cdee3(0x10a)](_0x53491e)['digest'](_0x2cdee3(0x142))['slice'](0x0,0xc);return _0x2cdee3(0x1c0)+_0x4481aa;}export function ensureJourneyDefaults(_0x5e910e){const _0x5162ef=a100_0x25feef;!_0x5e910e['description']&&(_0x5e910e[_0x5162ef(0x114)]=''),!_0x5e910e[_0x5162ef(0x158)]&&(_0x5e910e['state']=_0x5162ef(0x1d1));}export function resolveTDFolderPath(_0x17e495,_0x458e8d,_0x38a48e){const _0x13d878=a100_0x25feef;if(!_0x458e8d)return _0x17e495;if(_0x17e495===_0x38a48e||_0x17e495[_0x13d878(0x1bb)](_0x38a48e+'/'))return _0x17e495;return _0x17e495?_0x38a48e+'/'+_0x17e495:_0x38a48e;}export function addFoldersToCreate(_0x1adbff,_0x56995e,_0x4d0562){const _0x11c41b=a100_0x25feef;if(!_0x1adbff)return;if(_0x56995e[_0x11c41b(0x16a)](_0x1adbff))return;const _0x53a48c=_0x1adbff[_0x11c41b(0x162)]('/');let _0x13ff3a='';for(const _0x3beb49 of _0x53a48c){_0x13ff3a=_0x13ff3a?_0x13ff3a+'/'+_0x3beb49:_0x3beb49,!_0x56995e[_0x11c41b(0x16a)](_0x13ff3a)&&_0x4d0562[_0x11c41b(0x132)](_0x13ff3a);}}function a100_0x4dc7(){const _0x3093fa=['getJourney','171940QvBpDU','waitCondition','\x27\x20for\x20','getActivation','idToEmailMap','Updating\x20segment\x20\x27','has','null','activation_updated','folder','existingSegment','activation_updating','flatMap','valid','SEGMENT_UPDATE_ERROR','NOT_FOUND','Activation','folder_created','type','slice','\x27...','versionNumber','12UYSKoM','entry_criteria','DecisionPoint','hasChanges','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','updateSegmentById','Entry\x20criteria:\x20','existingJourney','journey','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','toLowerCase','activation_deleting','Deleted\x20activation\x20\x27','relationships','yamlConfig','__pending_','listSegments','columns','getSegment','embedded_activation_creating','connection','775658MLbCAq','Created\x20folder\x20\x27','nameToType','2611966RTmKkj','journeyStages','logInfo','segment_deleted','entries','segments','decision_point','100396UDhpzz','activation_','behavior','goal','push','localSegmentRules','progress','createSegment','withProgress','fetchJourney','exitCriterias','activationContext','idToName','branches','effectiveFolderId','diff','Activation\x20not\x20found:\x20','activation_template_id','all_columns','replace','existingActivation','\x20activation\x20\x27','createFolder','buildUserMaps','all','activation_deleted','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','21JFBjyH','createdSegmentIds','validatedRequest','rule','deps','folderPathToId','Name\x20has\x20already\x20been\x20taken','startsWith','entryCriteria','journeyId','created','connectionIdToNameMap','journey_entry_criteria_','milestone','activationStepsById','sha1','segmentByFolderAndName','__pending_act_','408934pEoUta','with','Created\x20journey\x20\x27','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','isNew','\x0a\x20\x20','stages','journeys','filter','segmentNameToId','find','draft','JOURNEY_UPDATE_ERROR','keys','journey_updating','kind','data','JOURNEY_SYNTAX_ERROR','activation_creating','journey_updated','segment_created','1058785XxPhCH','values','Fetching\x20','Creating\x20activation\x20\x27','dirname','reduce','folderPath','segment_updated','delete','deleteSegment','Journey\x20\x27','notification','relative','steps','list','update','index','get','folder_creating','journeyActivationNameToId','segment_creating','unchanged','ACTIVATION_UPDATE_ERROR','createdSegmentId','schedule','description','sort','\x27\x20decision\x20point\x20branch\x20\x27','object','segment_updating','utf-8','Updated\x20activation\x20\x27','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','INTERNAL','WaitStep','length','activations','action','errors','):\x20','segment_deleting','activation_created','createActivation','skipSegments','\x27\x20exit\x20criteria','updated','logSuccess','includes','\x20error(s)','updateActivation','existingSegments','join','6768000fYkJAd','Creating\x20segment\x20\x27','add','../../utils/async.js','createJourneySegment','./journey-yaml.js','create','Failed\x20to\x20','item','size','max','absolutePath','\x27\x20wait\x20condition','477fyzDuO','parse','journeyById','parentFolder','logDeleted','hex','stage\x20\x27','attributes','segmentId','journeyActivationStepId','segmentFolderId','resolveJourneyId','\x20(referenced\x20in\x20journey\x20','trim','ACTIVATION_SYNTAX_ERROR','deleted','map','journeyBundleName','name','from','\x27\x20not\x20found\x20in\x20journey\x20\x27','onProgress','deleteActivation','Deleted\x20segment\x20\x27','parentId','folderId','\x20segment\x20from\x20file:\x20','state','set','yamlActivation','Updated\x20journey\x20\x27','SEGMENT_NOT_FOUND','segment','Created\x20segment\x20\x27','embeddedSegmentNameToId','stringify','./child-segment-yaml.js','split'];a100_0x4dc7=function(){return _0x3093fa;};return a100_0x4dc7();}import*as a100_0x226117 from'yaml';import{readFileSync}from'fs';import a100_0x4cc6a1 from'path';import{isJourneyDef,parseYamlString as a100_0x54e692,toYamlString as a100_0x3a64c3,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 a100_0x386c(_0x3a574f,_0x5d35d2){_0x3a574f=_0x3a574f-0xf2;const _0x4dc740=a100_0x4dc7();let _0x386c82=_0x4dc740[_0x3a574f];return _0x386c82;}function stableStringify(_0x53ea2d){const _0x607793=a100_0x25feef;if(Array['isArray'](_0x53ea2d))return'['+_0x53ea2d[_0x607793(0x14d)](_0x427ceb=>stableStringify(_0x427ceb))[_0x607793(0x12f)](',')+']';if(_0x53ea2d&&typeof _0x53ea2d===_0x607793(0x117)){const _0x49ad58=_0x53ea2d,_0x84f5b3=Object[_0x607793(0xf3)](_0x49ad58)['sort'](),_0x454b33=_0x84f5b3[_0x607793(0x14d)](_0xc09907=>'\x22'+_0xc09907+'\x22:'+stableStringify(_0x49ad58[_0xc09907]));return'{'+_0x454b33['join'](',')+'}';}const _0x4b06aa=JSON[_0x607793(0x160)](_0x53ea2d);return _0x4b06aa===undefined?_0x607793(0x16b):_0x4b06aa;}function activationSignature(_0xc68326){const _0x7db68e=a100_0x25feef,_0x15b19c={'connection':_0xc68326[_0x7db68e(0x18e)],..._0xc68326[_0x7db68e(0x1ab)]!==undefined&&{'all_columns':_0xc68326[_0x7db68e(0x1ab)]},..._0xc68326[_0x7db68e(0x18b)]!==undefined&&{'columns':_0xc68326[_0x7db68e(0x18b)]},..._0xc68326[_0x7db68e(0x19b)]!==undefined&&{'behavior':_0xc68326[_0x7db68e(0x19b)]},..._0xc68326[_0x7db68e(0x113)]!==undefined&&{'schedule':_0xc68326['schedule']},..._0xc68326['notification']!==undefined&&{'notification':_0xc68326[_0x7db68e(0x106)]},..._0xc68326['connector_config']!==undefined&&{'connector_config':_0xc68326['connector_config']},..._0xc68326[_0x7db68e(0x1aa)]!==undefined&&{'activation_template_id':_0xc68326[_0x7db68e(0x1aa)]}};return stableStringify(_0x15b19c);}export async function prepareSegmentFiles(_0x565e7d,_0x243453,_0x958042,_0x35c742,_0x37195f){const _0x360f04=a100_0x25feef,{activationDefToCreateRequest:_0x590795}=await import(_0x360f04(0x161)),_0x119450=[],_0x4eed78=new Set();for(const {yamlConfig:_0x1c9fcf,folderPath:_0xab9427,sourcePath:_0x1124dc}of _0x565e7d){const _0x4c0072=resolveTDFolderPath(_0xab9427,_0x35c742,_0x37195f),_0x3cf690=_0x4c0072+':'+_0x1c9fcf[_0x360f04(0x14f)],_0x3af6f2=_0x243453[_0x360f04(0x1c4)]['get'](_0x3cf690),_0xd874e0=_0x3af6f2?_0x243453['activationsBySegmentId']['get'](_0x3af6f2['id'])||[]:[];addFoldersToCreate(_0x4c0072,_0x243453[_0x360f04(0x1b9)],_0x4eed78);const _0x4f4361=calculateActivationActions(_0x1c9fcf[_0x360f04(0x120)]||[],_0xd874e0,_0x243453[_0x360f04(0x168)],_0x243453[_0x360f04(0x1bf)]);for(const _0x2f81b9 of _0x4f4361){(_0x2f81b9[_0x360f04(0x176)]===_0x360f04(0x136)||_0x2f81b9['type']==='update')&&_0x2f81b9[_0x360f04(0x15a)]&&(_0x2f81b9[_0x360f04(0x1b6)]=await _0x590795(_0x2f81b9[_0x360f04(0x15a)],_0x958042));}const _0x2be191=calculateSegmentDiff(_0x1c9fcf,_0x3af6f2,_0xd874e0,_0x243453[_0x360f04(0x168)],_0x243453[_0x360f04(0x1bf)]);_0x119450[_0x360f04(0x19d)]({'relativePath':_0x1c9fcf[_0x360f04(0x14f)],'absolutePath':_0x1124dc,'yamlConfig':_0x1c9fcf,'folderPath':_0x4c0072,'existingSegment':_0x3af6f2,'existingActivations':_0xd874e0,'isNew':_0x2be191[_0x360f04(0x1ca)],'hasChanges':_0x2be191[_0x360f04(0x17d)],'diff':_0x2be191['diff'],'activationActions':_0x4f4361});}return{'segmentFiles':_0x119450,'foldersToCreate':_0x4eed78};}export async function prepareJourneyFiles(_0x570d78,_0x1052fd,_0x310958,_0x4d0321){const _0x8bc3e8=a100_0x25feef,_0x40b4b1=[],_0x590deb=new Set();for(const {yamlConfig:_0x5834ff,folderPath:_0x530eeb,sourcePath:_0x3e52ed}of _0x570d78){const _0x3bb115=resolveTDFolderPath(_0x530eeb,_0x310958,_0x4d0321),_0x35a1d4=_0x3bb115+':'+_0x5834ff[_0x8bc3e8(0x14f)],_0x3969f1=_0x1052fd['journeyBundlesByFolderAndName'][_0x8bc3e8(0x10c)](_0x35a1d4);let _0x2a4591,_0x406b94;if(_0x3969f1&&_0x3969f1[_0x8bc3e8(0x11f)]>0x0){const _0x1e76b9=buildLocalExpandedRuleMappings(_0x5834ff),{createYamlContext:_0x29ce12,prefetchJourneySegments:_0x197019}=createPushYamlContextForBundle(_0x1052fd[_0x8bc3e8(0x1b8)],_0x1052fd[_0x8bc3e8(0x155)],_0x1052fd['existingSegments'],_0x1e76b9,_0x1052fd[_0x8bc3e8(0x168)],_0x1052fd[_0x8bc3e8(0x1bf)],_0x1052fd[_0x8bc3e8(0x1c2)],_0x1052fd[_0x8bc3e8(0x13f)]);await _0x197019(_0x3969f1[_0x8bc3e8(0x14d)](_0x446ef8=>_0x446ef8['id']));const _0x2895ab=hasMultipleVersions(_0x5834ff),_0xff17a7=async _0x321016=>{const _0x534b41=_0x8bc3e8,_0x5ef366=_0x1052fd[_0x534b41(0x13f)]?.[_0x534b41(0x10c)](_0x321016);if(_0x5ef366)return _0x5ef366;return _0x1052fd[_0x534b41(0x1a2)]({'journeyId':_0x321016,'journeyName':_0x5834ff[_0x534b41(0x14f)],'isMultiVersion':_0x3969f1['length']>0x1});};if(_0x2895ab&&_0x3969f1['length']>0x1){const _0x52651c=[];for(const _0x2c3010 of _0x3969f1){const _0x5e841d=_0x2c3010[_0x8bc3e8(0x179)]||0x1;_0x1052fd['progress']?.[_0x8bc3e8(0x10a)](_0x8bc3e8(0xfd)+_0x5834ff[_0x8bc3e8(0x14f)]+'\x20v'+_0x5e841d);const _0x375ff2=await _0xff17a7(_0x2c3010['id']),_0x5b263f=_0x29ce12(_0x2c3010['id']),_0x48d507=await journeyResponseToDef(_0x375ff2,_0x5b263f);_0x52651c[_0x8bc3e8(0x19d)]({'item':_0x2c3010,'yaml':_0x48d507});}const _0x58f8df=buildLocalRuleToNameMappingFromJourney(_0x5834ff);_0x406b94=buildMergedJourneyDef(_0x52651c,_0x58f8df);const _0x38fb58=Math['max'](..._0x52651c[_0x8bc3e8(0x14d)](_0x3afdb7=>_0x3afdb7[_0x8bc3e8(0x138)]['versionNumber']||0x0)),_0x45ce53=_0x3969f1[_0x8bc3e8(0x1d0)](_0x531a8d=>(_0x531a8d[_0x8bc3e8(0x179)]||0x0)===_0x38fb58);_0x45ce53&&(_0x1052fd[_0x8bc3e8(0x19f)]?.[_0x8bc3e8(0x10a)]('Fetching\x20'+_0x5834ff['name']+'\x20v'+_0x38fb58),_0x2a4591=await _0xff17a7(_0x45ce53['id']));}else{const _0x28b4ce=_0x3969f1[_0x3969f1[_0x8bc3e8(0x11f)]-0x1];_0x1052fd[_0x8bc3e8(0x19f)]?.[_0x8bc3e8(0x10a)]('Fetching\x20'+_0x5834ff[_0x8bc3e8(0x14f)]),_0x2a4591=await _0xff17a7(_0x28b4ce['id']);const _0x3f99cf=_0x29ce12(_0x28b4ce['id']),_0x2f0d01=await journeyResponseToDef(_0x2a4591,_0x3f99cf),_0x2f98f8=buildLocalRuleToNameMappingFromJourney(_0x5834ff);_0x406b94=buildMergedJourneyDef([{'item':_0x28b4ce,'yaml':_0x2f0d01}],_0x2f98f8);}}addFoldersToCreate(_0x3bb115,_0x1052fd[_0x8bc3e8(0x1b9)],_0x590deb);const _0x518b35=calculateJourneyDiff(_0x5834ff,_0x406b94);_0x40b4b1[_0x8bc3e8(0x19d)]({'relativePath':_0x5834ff[_0x8bc3e8(0x14f)],'absolutePath':_0x3e52ed,'yamlConfig':_0x5834ff,'folderPath':_0x3bb115,'existingJourney':_0x2a4591,'isNew':_0x518b35[_0x8bc3e8(0x1ca)],'hasChanges':_0x518b35[_0x8bc3e8(0x17d)],'diff':_0x518b35[_0x8bc3e8(0x1a8)]});}return{'journeyFiles':_0x40b4b1,'foldersToCreate':_0x590deb};}export function calculateActivationActions(_0x111326,_0x50ec3f,_0x2b4628,_0x3f943e){const _0x3072bd=a100_0x25feef,_0x221470=[],_0x219336=new Map();for(const _0xeb4d89 of _0x50ec3f){_0x219336[_0x3072bd(0x159)](_0xeb4d89[_0x3072bd(0x14f)],_0xeb4d89);}const _0x501a42=new Map();for(const _0x2753f3 of _0x111326){_0x501a42[_0x3072bd(0x159)](_0x2753f3[_0x3072bd(0x14f)],_0x2753f3);}for(const _0xb08ec of _0x111326){const _0x4d37e8=_0x219336[_0x3072bd(0x10c)](_0xb08ec['name']);if(!_0x4d37e8)_0x221470[_0x3072bd(0x19d)]({'type':_0x3072bd(0x136),'name':_0xb08ec[_0x3072bd(0x14f)],'yamlActivation':_0xb08ec});else{const _0x262c6a=activationResponseToDef(_0x4d37e8,_0x2b4628,_0x3f943e),_0x23e3e3=a100_0x226117[_0x3072bd(0x160)](_0x262c6a),_0xa41d18=a100_0x226117[_0x3072bd(0x160)](_0xb08ec);_0x23e3e3!==_0xa41d18&&_0x221470[_0x3072bd(0x19d)]({'type':'update','name':_0xb08ec[_0x3072bd(0x14f)],'yamlActivation':_0xb08ec,'existingActivation':_0x4d37e8});}}for(const _0x42a5d7 of _0x50ec3f){!_0x501a42[_0x3072bd(0x16a)](_0x42a5d7[_0x3072bd(0x14f)])&&_0x221470[_0x3072bd(0x19d)]({'type':'delete','name':_0x42a5d7[_0x3072bd(0x14f)],'existingActivation':_0x42a5d7});}return _0x221470;}export function calculateSegmentDiff(_0x48b2bc,_0x85908b,_0x1043d6,_0x3160bd,_0x3bbbc2){const _0x34d2b0=segmentToYamlString(_0x48b2bc);if(_0x85908b){const _0x209c04=segmentWithActivationsToYaml(_0x85908b,_0x1043d6,undefined,_0x3160bd,_0x3bbbc2),_0x21295d=segmentToYamlString(_0x209c04),_0x30e86f=generateDiff(_0x21295d,_0x34d2b0),_0x1aad55=hasChanges(_0x30e86f);return{'isNew':![],'hasChanges':_0x1aad55,'diff':_0x1aad55?formatDiffWithColors(_0x30e86f):undefined};}const _0x1884e9=generateDiff('',_0x34d2b0);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1884e9)};}export function calculateJourneyDiff(_0x217d49,_0xe74366){const _0x408cc1=normalizeJourneyDef(_0x217d49,_0x217d49),_0x4075b6=a100_0x3a64c3(_0x408cc1);if(_0xe74366){const _0x1c8b14=normalizeJourneyDef(_0xe74366,_0x217d49),_0x58baaa=a100_0x3a64c3(_0x1c8b14),_0x1b9e7d=generateDiff(_0x58baaa,_0x4075b6),_0x527ebd=hasChanges(_0x1b9e7d);return{'isNew':![],'hasChanges':_0x527ebd,'diff':_0x527ebd?formatDiffWithColors(_0x1b9e7d):undefined};}const _0x3a827a=generateDiff('',_0x4075b6);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3a827a)};}export function findSegmentsToDelete(_0x9a3183,_0x13e86d,_0x3cf85d,_0x386633,_0x21f14d){const _0x282703=a100_0x25feef,_0x40e5f4=new Set();for(const {yamlConfig:_0x1fa284,folderPath:_0xf6cb32}of _0x13e86d){_0x40e5f4[_0x282703(0x132)](_0xf6cb32+':'+_0x1fa284[_0x282703(0x14f)]);}return _0x9a3183[_0x282703(0x1ce)](_0x2f1af2=>{const _0x300dbc=_0x282703,_0x2fcfaa=_0x2f1af2['segmentFolderId']?_0x3cf85d[_0x300dbc(0x10c)](_0x2f1af2[_0x300dbc(0x147)]['toString']())||'':'',_0x4c6d05=_0x2fcfaa+':'+_0x2f1af2[_0x300dbc(0x14f)];if(_0x40e5f4['has'](_0x4c6d05))return![];if(_0x21f14d)return _0x2fcfaa===_0x386633||_0x2fcfaa[_0x300dbc(0x1bb)](_0x386633+'/');return!![];});}export function findJourneysToDelete(_0x213412,_0x44023b,_0x5065c1,_0x47f03e,_0x336ca9){const _0x36e731=a100_0x25feef,_0x5a8505=new Set();for(const {yamlConfig:_0x573c0b,folderPath:_0x58990f}of _0x44023b){_0x5a8505[_0x36e731(0x132)](_0x58990f+':'+_0x573c0b['name']);}return _0x213412['filter'](_0x2f70ee=>{const _0x583494=_0x36e731,_0x3c59bf=_0x2f70ee[_0x583494(0x156)]?_0x5065c1['get'](_0x2f70ee[_0x583494(0x156)])||'':'',_0x2f2f64=_0x3c59bf+':'+_0x2f70ee[_0x583494(0x14e)];if(_0x5a8505[_0x583494(0x16a)](_0x2f2f64))return![];if(_0x336ca9)return _0x3c59bf===_0x47f03e||_0x3c59bf['startsWith'](_0x47f03e+'/');return!![];});}export function buildSegmentLookupMap(_0x1e8f68,_0x4d8179){const _0x514713=a100_0x25feef,_0x2f7b18=new Map();for(const _0x25c1f4 of _0x1e8f68){const _0x343f65=_0x25c1f4[_0x514713(0x147)]?_0x4d8179['get'](_0x25c1f4[_0x514713(0x147)]['toString']())||'':'',_0x1c4c7a=_0x343f65+':'+_0x25c1f4['name'];_0x2f7b18[_0x514713(0x159)](_0x1c4c7a,_0x25c1f4);}return _0x2f7b18;}export function buildSegmentNameToIdMap(_0x18cda8){const _0x185073=a100_0x25feef,_0x3f25af=new Map();for(const _0x282b93 of _0x18cda8){_0x3f25af[_0x185073(0x159)](_0x282b93[_0x185073(0x14f)],_0x282b93['id']);}return _0x3f25af;}export function buildJourneyBundleLookupMap(_0x5d2e21,_0x22fb90){const _0x13a754=a100_0x25feef,_0x4e1d29=new Map();for(const _0x5aee1f of _0x5d2e21){const _0x30fe9b=_0x5aee1f[_0x13a754(0x156)]?_0x22fb90[_0x13a754(0x10c)](_0x5aee1f['folderId'])||'':'',_0x533376=_0x30fe9b+':'+_0x5aee1f['journeyBundleName'];!_0x4e1d29['has'](_0x533376)&&_0x4e1d29[_0x13a754(0x159)](_0x533376,[]),_0x4e1d29[_0x13a754(0x10c)](_0x533376)[_0x13a754(0x19d)](_0x5aee1f);}for(const _0x238463 of _0x4e1d29[_0x13a754(0xfc)]()){_0x238463[_0x13a754(0x115)]((_0x5dd7b6,_0x1bb8a8)=>(_0x5dd7b6[_0x13a754(0x179)]||0x0)-(_0x1bb8a8[_0x13a754(0x179)]||0x0));}return _0x4e1d29;}export function collectFoldersToCreate(_0x41c4de,_0xb17952){const _0x23cb9d=a100_0x25feef,_0x43a951=new Set();for(const _0x55cd2f of _0x41c4de){if(!_0x55cd2f)continue;if(_0xb17952['has'](_0x55cd2f))continue;const _0x26f997=_0x55cd2f[_0x23cb9d(0x162)]('/');let _0xd6b761='';for(const _0x11664d of _0x26f997){_0xd6b761=_0xd6b761?_0xd6b761+'/'+_0x11664d:_0x11664d,!_0xb17952['has'](_0xd6b761)&&_0x43a951[_0x23cb9d(0x132)](_0xd6b761);}}return _0x43a951;}export function parseAndClassifyYamlFiles(_0x4cdd3f,_0x4b2718,_0x2028bc){const _0x156247=a100_0x25feef,_0x46a8cc=[],_0x4cd260=[];for(const _0x17152f of _0x4cdd3f){const _0x55d3db=a100_0x4cc6a1[_0x156247(0x107)](_0x4b2718,a100_0x4cc6a1[_0x156247(0xff)](_0x17152f)),_0x108238=_0x55d3db==='.'?'':_0x55d3db,_0x8b8c2=readFileSync(_0x17152f,'utf-8'),_0x2785fe=a100_0x226117['parse'](_0x8b8c2);if(isJourneyDef(_0x2785fe)){const _0x33e42e=a100_0x54e692(_0x8b8c2);_0x4cd260['push']({'yamlConfig':_0x33e42e,'folderPath':_0x108238,'sourcePath':_0x17152f});}else{if(!_0x2028bc?.[_0x156247(0x127)]){const _0x443ec9=parseSegmentYamlFile(_0x8b8c2),_0x3ed6bb=normalizeChildSegmentYaml(_0x443ec9);_0x46a8cc[_0x156247(0x19d)]({'yamlConfig':_0x3ed6bb,'folderPath':_0x108238,'sourcePath':_0x17152f});}}}return{'segments':_0x46a8cc,'journeys':_0x4cd260};}export function validateParsedFiles(_0x12490a,_0x29bcd0){const _0x544a07=a100_0x25feef,_0x2d7449=[];for(const {yamlConfig:_0x327a00,sourcePath:_0x4dbfb7}of _0x12490a[_0x544a07(0x197)]){const _0x126224=readFileSync(_0x4dbfb7,_0x544a07(0x119)),_0xf564cd=a100_0x226117['parseDocument'](_0x126224),_0x338e01=validateSegmentDef(_0x327a00,{'source':_0x126224,'document':_0xf564cd});if(!_0x338e01[_0x544a07(0x171)]){const _0x297c5b=a100_0x4cc6a1['relative'](_0x29bcd0,_0x4dbfb7);_0x2d7449[_0x544a07(0x19d)]({'filePath':_0x297c5b,'source':_0x126224,'result':_0x338e01,'isJourney':![]});}}for(const {yamlConfig:_0x401cfa,sourcePath:_0x2bd86a}of _0x12490a['journeys']){const _0x97bd36=readFileSync(_0x2bd86a,_0x544a07(0x119)),_0x57be96=a100_0x226117['parseDocument'](_0x97bd36),_0x5c7b45=validateJourneyDef(_0x401cfa,{'source':_0x97bd36,'document':_0x57be96});if(!_0x5c7b45[_0x544a07(0x171)]){const _0x4a4220=a100_0x4cc6a1['relative'](_0x29bcd0,_0x2bd86a);_0x2d7449[_0x544a07(0x19d)]({'filePath':_0x4a4220,'source':_0x97bd36,'result':_0x5c7b45,'isJourney':!![]});}}return _0x2d7449;}export function formatValidationErrors(_0x4e2b7e){const _0x4f45de=a100_0x25feef,_0x17b13b=[];for(const {filePath:_0x335588,source:_0x1fe930,result:_0x3f3344,isJourney:_0xa2cf56}of _0x4e2b7e){const _0x264fb0=_0xa2cf56?_0x4f45de(0x182):_0x4f45de(0x15d);_0x17b13b[_0x4f45de(0x19d)]('\x0a'+_0x335588+'\x20('+_0x264fb0+_0x4f45de(0x123)+_0x3f3344[_0x4f45de(0x122)][_0x4f45de(0x11f)]+_0x4f45de(0x12c)),_0x17b13b[_0x4f45de(0x19d)](formatValidationResult(_0x3f3344,_0x1fe930,_0x335588));}return _0x17b13b[_0x4f45de(0x12f)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4da6de){const _0x4eb50e=a100_0x25feef,_0x48f2da=new Set(),_0x2e1ec3=new Map(),_0x52e150=collectSegmentUsageCounts(_0x4da6de);if(_0x4da6de['segments'])for(const [_0x3cac72,_0x24db47]of Object[_0x4eb50e(0x196)](_0x4da6de['segments'])){_0x48f2da[_0x4eb50e(0x132)](_0x3cac72);if(_0x24db47[_0x4eb50e(0x1b7)]){const _0x5a9f5f=yamlRuleToApi(_0x24db47['rule']),_0x5da0aa=apiRuleToYaml(_0x5a9f5f);_0x2e1ec3['set'](_0x3cac72,_0x5da0aa);}}const _0x3681c3=new Map();let _0x3ca06c=0x0;for(const [_0x3ec044,_0x1ad216]of _0x2e1ec3){const _0x5611f1=serializeExpandedRule(_0x1ad216,_0x2e1ec3),_0x153df1=_0x3681c3[_0x4eb50e(0x10c)](_0x5611f1)||[];_0x153df1[_0x4eb50e(0x19d)]({'name':_0x3ec044,'index':_0x3ca06c}),_0x3681c3[_0x4eb50e(0x159)](_0x5611f1,_0x153df1),_0x3ca06c++;}const _0x178347=new Map();for(const [_0x1f33e9,_0x62e387]of _0x3681c3){const _0x5d0665=_0x62e387[_0x4eb50e(0x177)]()[_0x4eb50e(0x115)]((_0xf1c9cb,_0x14b34a)=>{const _0x42f6c3=_0x4eb50e,_0x26ac09=_0x52e150[_0x42f6c3(0x10c)](_0xf1c9cb[_0x42f6c3(0x14f)])||0x0,_0x4eceb3=_0x52e150[_0x42f6c3(0x10c)](_0x14b34a['name'])||0x0;if(_0x26ac09!==_0x4eceb3)return _0x4eceb3-_0x26ac09;return _0xf1c9cb[_0x42f6c3(0x10b)]-_0x14b34a['index'];})[_0x4eb50e(0x14d)](_0x3bc743=>_0x3bc743[_0x4eb50e(0x14f)]),_0x59ced5=[];for(const _0x17dcc1 of _0x5d0665){const _0x2cbeba=_0x52e150[_0x4eb50e(0x10c)](_0x17dcc1)||0x0,_0x53fb6f=Math[_0x4eb50e(0x13a)](_0x2cbeba,0x1);for(let _0x424032=0x0;_0x424032<_0x53fb6f;_0x424032++){_0x59ced5[_0x4eb50e(0x19d)](_0x17dcc1);}}_0x178347[_0x4eb50e(0x159)](_0x1f33e9,_0x59ced5);}return{'existingLocalSegmentNames':_0x48f2da,'localSegmentRules':_0x2e1ec3,'localExpandedRuleToNames':_0x178347};}async function buildServerSegmentRuleMap(_0x3cdeb0,_0x37cd1b,_0x59d1be,_0x44fa05){const _0x51ed15=new Map(),_0x51d913=new Set(),_0x5cbe15=async _0x4ab291=>{const _0x1a914d=a100_0x386c;if(_0x51d913[_0x1a914d(0x16a)](_0x4ab291))return;_0x51d913['add'](_0x4ab291);let _0x638bed=_0x59d1be[_0x1a914d(0x1d0)](_0x1fbec8=>_0x1fbec8['id']===_0x4ab291);if(!_0x638bed)try{_0x638bed=await _0x3cdeb0[_0x1a914d(0x15d)][_0x1a914d(0x18c)](_0x37cd1b,_0x4ab291);}catch{return;}if(!_0x638bed?.[_0x1a914d(0x1b7)])return;const _0x10c604=apiRuleToYaml(_0x638bed[_0x1a914d(0x1b7)]);_0x51ed15['set'](_0x4ab291,_0x10c604);const _0x2b763c=collectSegmentRefsFromRule(_0x10c604);for(const _0x2bc21e of _0x2b763c){await _0x5cbe15(_0x2bc21e);}};for(const _0x1f58ab of _0x44fa05){await _0x5cbe15(_0x1f58ab);}return _0x51ed15;}export function createSegmentIdResolver(_0x43a493,_0xb2d04e){return async _0x37a7e2=>{const _0x48f5c5=a100_0x386c,_0xb8effa=_0x43a493[_0x48f5c5(0x10c)](_0x37a7e2);if(!_0xb8effa)throw new SDKError(ErrorCode[_0x48f5c5(0x15c)],'Segment\x20not\x20found:\x20'+_0x37a7e2+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0xb2d04e+'\x27)');return _0xb8effa;};}export function extractRootFolderId(_0x2fd8a7){const _0x5b555b=a100_0x25feef;return _0x2fd8a7['relationships']?.['parentSegmentFolder']?.[_0x5b555b(0xf6)]?.['id']||_0x2fd8a7[_0x5b555b(0x187)]?.[_0x5b555b(0x140)]?.[_0x5b555b(0xf6)]?.['id'];}export function buildConnectionMaps(_0x48b5e8){const _0x2a7258=a100_0x25feef,_0x284d48=new Map(),_0x583706=new Map(),_0x26ebcd=new Map();for(const _0x24b0c6 of _0x48b5e8){_0x284d48['set'](_0x24b0c6[_0x2a7258(0x14f)],parseInt(_0x24b0c6['id'],0xa)),_0x583706[_0x2a7258(0x159)](_0x24b0c6['id'],_0x24b0c6[_0x2a7258(0x14f)]),_0x26ebcd[_0x2a7258(0x159)](_0x24b0c6[_0x2a7258(0x14f)],_0x24b0c6[_0x2a7258(0x176)]);}return{'nameToId':_0x284d48,'idToName':_0x583706,'nameToType':_0x26ebcd};}export function calculatePushStats(_0x200ca7,_0x553e96,_0x35ca59,_0x20d880,_0x5dc3f9,_0x82c12c,_0x217e5c){const _0x1320c3=a100_0x25feef,_0x41d2d0=_0x200ca7[_0x1320c3(0x1ce)](_0x143a09=>_0x143a09[_0x1320c3(0x1ca)]),_0x4bc284=_0x200ca7[_0x1320c3(0x1ce)](_0x45f0db=>!_0x45f0db['isNew']&&_0x45f0db[_0x1320c3(0x17d)]),_0x35e4dc=_0x200ca7[_0x1320c3(0x1ce)](_0x49973f=>!_0x49973f[_0x1320c3(0x1ca)]&&!_0x49973f[_0x1320c3(0x17d)]),_0x587697=_0x82c12c?_0x20d880:[],_0x340f65=_0x553e96[_0x1320c3(0x1ce)](_0x20d5ea=>_0x20d5ea['isNew']),_0x1df204=_0x553e96[_0x1320c3(0x1ce)](_0x2cf066=>!_0x2cf066[_0x1320c3(0x1ca)]&&_0x2cf066[_0x1320c3(0x17d)]),_0x4da5ab=_0x553e96['filter'](_0x3a9266=>!_0x3a9266['isNew']&&!_0x3a9266[_0x1320c3(0x17d)]),_0x482a70=_0x82c12c?_0x5dc3f9:[],_0x584d79=_0x200ca7[_0x1320c3(0x170)](_0x1d3d99=>_0x1d3d99['activationActions']),_0x1163bb=_0x584d79[_0x1320c3(0x1ce)](_0x371cc1=>_0x371cc1['type']===_0x1320c3(0x136)),_0xd20dfc=_0x584d79['filter'](_0x527703=>_0x527703['type']===_0x1320c3(0x10a)),_0x2fbc98=_0x584d79[_0x1320c3(0x1ce)](_0x4dfe48=>_0x4dfe48['type']===_0x1320c3(0x103)),_0x28ec1a=Array[_0x1320c3(0x150)](_0x35ca59)[_0x1320c3(0x115)](),_0x1623c3=_0x217e5c?![]:_0x41d2d0['length']>0x0||_0x4bc284[_0x1320c3(0x11f)]>0x0||_0x587697[_0x1320c3(0x11f)]>0x0,_0x50537b=_0x340f65[_0x1320c3(0x11f)]>0x0||_0x1df204[_0x1320c3(0x11f)]>0x0||_0x482a70[_0x1320c3(0x11f)]>0x0,_0x3fb01f=_0x217e5c?![]:_0x584d79[_0x1320c3(0x11f)]>0x0,_0x5b08df=_0x28ec1a[_0x1320c3(0x11f)]>0x0;return{'segments':{'new':_0x41d2d0,'changed':_0x4bc284,'unchanged':_0x35e4dc,'toDelete':_0x587697},'journeys':{'new':_0x340f65,'changed':_0x1df204,'unchanged':_0x4da5ab,'toDelete':_0x482a70},'activations':{'all':_0x584d79,'toCreate':_0x1163bb,'toUpdate':_0xd20dfc,'toDelete':_0x2fbc98},'folders':{'toCreate':_0x28ec1a},'counts':{'segments':{'new':_0x41d2d0[_0x1320c3(0x11f)],'changed':_0x4bc284[_0x1320c3(0x11f)],'unchanged':_0x35e4dc[_0x1320c3(0x11f)],'toDelete':_0x587697[_0x1320c3(0x11f)]},'journeys':{'new':_0x340f65[_0x1320c3(0x11f)],'changed':_0x1df204['length'],'unchanged':_0x4da5ab[_0x1320c3(0x11f)],'toDelete':_0x482a70['length']},'activations':{'create':_0x1163bb[_0x1320c3(0x11f)],'update':_0xd20dfc[_0x1320c3(0x11f)],'delete':_0x2fbc98[_0x1320c3(0x11f)]},'folders':_0x28ec1a[_0x1320c3(0x11f)]},'hasChanges':_0x1623c3||_0x50537b||_0x3fb01f||_0x5b08df};}export async function buildPushExecutionContext(_0x1ebaaa,_0x4655d8,_0x41d378,_0x28eea3,_0x15d7bb,_0x4774fc){const _0x434fe2=a100_0x25feef,_0x6fe49d=extractRootFolderId(_0x41d378),{pathToId:_0x5c6fd9,idToPath:_0x168058}=buildFolderMaps(_0x15d7bb),_0x54f1f3=buildSegmentNameToIdMap(_0x28eea3),_0x1bec3b=new Map(),{batchAsync:_0x490ca2}=await import(_0x434fe2(0x133)),[_0x167c1b,_0x127032]=await Promise['all']([_0x1ebaaa['user'][_0x434fe2(0x1b0)](),_0x1ebaaa[_0x434fe2(0x18e)][_0x434fe2(0x109)](),((async()=>{const _0x279e51=_0x434fe2;!_0x4774fc&&_0x28eea3[_0x279e51(0x11f)]>0x0&&await _0x490ca2(_0x28eea3,async _0x44bc30=>{const _0x2a964e=_0x279e51,_0x88ecd2=await _0x1ebaaa['segment']['listActivations'](_0x4655d8,_0x44bc30['id']);_0x1bec3b[_0x2a964e(0x159)](_0x44bc30['id'],_0x88ecd2);});})())]),{emailToId:_0xe7a3eb,idToEmail:_0x287290}=_0x167c1b,_0x32330e=buildConnectionMaps(_0x127032);return{'rootFolderId':_0x6fe49d,'folderPathToId':_0x5c6fd9,'folderIdToPath':_0x168058,'segmentNameToId':_0x54f1f3,'activationsBySegmentId':_0x1bec3b,'emailToIdMap':_0xe7a3eb,'idToEmailMap':_0x287290,'connectionNameToIdMap':_0x32330e['nameToId'],'connectionIdToNameMap':_0x32330e[_0x434fe2(0x1a5)],'connectionNameToTypeMap':_0x32330e[_0x434fe2(0x191)]};}export function createPushYamlContextForBundle(_0x386929,_0x227b0e,_0xa252b7,_0x4a44eb,_0x175c77,_0x20aaa9,_0x57db2f,_0x394025){const {existingLocalSegmentNames:_0x27e0ee,localExpandedRuleToNames:_0x2ffd04}=_0x4a44eb,_0x4166cf=new Set(),_0x593cac=new Map(),_0x11d8e8=new Map(),_0x183b24=new Map(),_0x2f8992=createJumpTargetCache(),_0x2e7852=new Map(),_0x208fcb=new Map(),_0x1ece52=new Set();let _0x19119e;const _0x365397=_0x31ff70=>{const _0xc544c1={'resolveSegment':async _0x3f5091=>{const _0x4c80c7=a100_0x386c,_0x257f5e=_0x183b24[_0x4c80c7(0x10c)](_0x3f5091);if(_0x257f5e!==undefined)return{'name':_0x257f5e,'isJourneyLocal':!![]};try{let _0x15eba3=_0xa252b7[_0x4c80c7(0x1d0)](_0x5c988f=>_0x5c988f['id']===_0x3f5091);!_0x15eba3&&(_0x15eba3=await _0x386929[_0x4c80c7(0x15d)][_0x4c80c7(0x18c)](_0x227b0e,_0x3f5091));const _0x440889=generateJourneyLocalName(_0x15eba3['name']),_0x322d53=_0x15eba3[_0x4c80c7(0xf5)]===SEGMENT_KIND_JOURNEY&&_0x440889!==undefined;let _0x12e89b=_0x15eba3[_0x4c80c7(0x14f)],_0x4c5df3;if(_0x322d53&&_0x15eba3[_0x4c80c7(0x1b7)]){const _0x40073d=apiRuleToYaml(_0x15eba3['rule']);_0x208fcb[_0x4c80c7(0x159)](_0x3f5091,_0x40073d);const _0x1b16fc=async _0x291f93=>{const _0x185afa=_0x4c80c7,_0x5f2c0b=collectSegmentRefsFromRule(_0x291f93);for(const _0x29d7b4 of _0x5f2c0b){if(!_0x208fcb['has'](_0x29d7b4))try{const _0x244e03=await _0x386929['segment'][_0x185afa(0x18c)](_0x227b0e,_0x29d7b4);if(_0x244e03?.['rule']){const _0x54a74c=apiRuleToYaml(_0x244e03[_0x185afa(0x1b7)]);_0x208fcb[_0x185afa(0x159)](_0x29d7b4,_0x54a74c),await _0x1b16fc(_0x54a74c);}}catch{}}};await _0x1b16fc(_0x40073d);const _0x3a2abc=serializeExpandedRule(_0x40073d,_0x208fcb),_0x378c1a=_0x2ffd04[_0x4c80c7(0x10c)](_0x3a2abc);if(_0x378c1a&&_0x378c1a[_0x4c80c7(0x11f)]>0x0){const _0x197fee=_0x593cac[_0x4c80c7(0x10c)](_0x3a2abc)||0x0,_0x36450f=_0x378c1a[_0x197fee]||_0x378c1a[_0x378c1a['length']-0x1];_0x593cac[_0x4c80c7(0x159)](_0x3a2abc,_0x197fee+0x1),_0x12e89b=_0x36450f,_0x4166cf[_0x4c80c7(0x132)](_0x12e89b),_0x183b24[_0x4c80c7(0x159)](_0x3f5091,_0x12e89b);const _0x2f896a=await resolveRuleSegmentRefs(_0x40073d,async _0x4cdc20=>{const _0x5427fc=_0x4c80c7,_0x1bcda7=_0x183b24[_0x5427fc(0x10c)](_0x4cdc20);if(_0x1bcda7)return _0x1bcda7;const _0x16aaa1=await _0x19119e['resolveSegment'](_0x4cdc20);return _0x16aaa1[_0x5427fc(0x14f)];});_0x4c5df3={'description':_0x15eba3[_0x4c80c7(0x114)],'rule':_0x2f896a};}else{const _0x14db26=_0x2e7852[_0x4c80c7(0x10c)](_0x3a2abc);if(_0x14db26)_0x12e89b=_0x14db26,_0x183b24[_0x4c80c7(0x159)](_0x3f5091,_0x12e89b);else{if(_0x440889){let _0x1c05c2=_0x440889,_0x530f49=0x2;while(_0x4166cf['has'](_0x1c05c2)||_0x27e0ee[_0x4c80c7(0x16a)](_0x1c05c2)){_0x1c05c2=_0x440889+'_'+_0x530f49,_0x530f49++;}_0x4166cf[_0x4c80c7(0x132)](_0x1c05c2),_0x12e89b=_0x1c05c2;}_0x183b24[_0x4c80c7(0x159)](_0x3f5091,_0x12e89b),_0x2e7852[_0x4c80c7(0x159)](_0x3a2abc,_0x12e89b);const _0x55cbeb=await resolveRuleSegmentRefs(_0x40073d,async _0x40f9b4=>{const _0x50df96=_0x4c80c7,_0x2a0da1=_0x183b24[_0x50df96(0x10c)](_0x40f9b4);if(_0x2a0da1)return _0x2a0da1;const _0x17478f=await _0x19119e['resolveSegment'](_0x40f9b4);return _0x17478f['name'];});_0x4c5df3={'description':_0x15eba3[_0x4c80c7(0x114)],'rule':_0x55cbeb};}}}return{'name':_0x12e89b,'isJourneyLocal':_0x322d53,'definition':_0x4c5df3};}catch{return{'name':_0x3f5091,'isJourneyLocal':![]};}},'resolveActivation':async _0x38124f=>{const _0x369996=a100_0x386c,_0x282bca=_0x11d8e8[_0x369996(0x10c)](_0x38124f);if(_0x282bca!==undefined)return{'name':_0x282bca,'isJourneyLocal':!![]};try{let _0x163e8c=_0x57db2f?.[_0x369996(0x10c)](_0x38124f);!_0x163e8c&&(_0x163e8c=await _0x386929[_0x369996(0x182)][_0x369996(0x167)](_0x31ff70,_0x38124f));const _0x46bc30=_0x163e8c[_0x369996(0x144)]['activationParams'][_0x369996(0x14f)]||_0x38124f,_0x35ebf7=sanitizeYamlKey(_0x46bc30)||_0x369996(0x19a)+_0x38124f,_0x5b94ff=_0x35ebf7;_0x11d8e8[_0x369996(0x159)](_0x38124f,_0x5b94ff);const _0x345f82=journeyActivationStepToYaml(_0x163e8c,_0x175c77,_0x20aaa9);return{'name':_0x5b94ff,'isJourneyLocal':!![],'definition':_0x345f82};}catch{return{'name':_0x38124f,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4e1e1b,_0x2a2117)=>resolveJumpTarget(_0x4e1e1b,_0x2a2117,_0x2f8992,async _0x4b0271=>{const _0x502267=a100_0x386c,_0x3204a9=_0x394025?.[_0x502267(0x10c)](_0x4b0271);if(_0x3204a9)return _0x3204a9;return _0x386929[_0x502267(0x182)]['getJourney'](_0x4b0271);})};return _0x19119e=_0xc544c1,_0xc544c1;},_0x3b0fd3=async _0x4fbac0=>{const _0x4df796=a100_0x386c,{collectSegmentIdsFromJourneyApi:_0x548159}=await import('./journey-yaml.js'),{batchAsync:_0x30c8f6}=await import('../../utils/async.js'),_0x4d1fb1=new Set();for(const _0x48de19 of _0x4fbac0){let _0x44bc1a=_0x394025?.[_0x4df796(0x10c)](_0x48de19);!_0x44bc1a&&(_0x44bc1a=await _0x386929[_0x4df796(0x182)]['getJourney'](_0x48de19));const _0x2f606a=_0x548159(_0x44bc1a);for(const _0x19ede5 of _0x2f606a){_0x4d1fb1['add'](_0x19ede5);}}let _0x2bc497=Array['from'](_0x4d1fb1);while(_0x2bc497[_0x4df796(0x11f)]>0x0){const _0x30f1c1=_0x2bc497['filter'](_0x9d235d=>!_0x1ece52[_0x4df796(0x16a)](_0x9d235d));if(_0x30f1c1['length']===0x0)break;const _0x4d3fc9=await _0x30c8f6(_0x30f1c1,async _0x11dc8c=>{const _0x55c81f=_0x4df796;_0x1ece52['add'](_0x11dc8c);let _0x3b48e1=_0xa252b7[_0x55c81f(0x1d0)](_0x45a78a=>_0x45a78a['id']===_0x11dc8c);if(!_0x3b48e1)try{_0x3b48e1=await _0x386929[_0x55c81f(0x15d)][_0x55c81f(0x18c)](_0x227b0e,_0x11dc8c);}catch{return null;}return{'segmentId':_0x11dc8c,'segment':_0x3b48e1};},0xa),_0xa8c982=new Set();for(const _0x17de7d of _0x4d3fc9){if(!_0x17de7d?.[_0x4df796(0x15d)]?.[_0x4df796(0x1b7)])continue;const _0x23b405=apiRuleToYaml(_0x17de7d[_0x4df796(0x15d)][_0x4df796(0x1b7)]);_0x208fcb[_0x4df796(0x159)](_0x17de7d[_0x4df796(0x145)],_0x23b405);const _0x50a3f8=collectSegmentRefsFromRule(_0x23b405);for(const _0x4eec5a of _0x50a3f8){!_0x1ece52[_0x4df796(0x16a)](_0x4eec5a)&&_0xa8c982[_0x4df796(0x132)](_0x4eec5a);}}_0x2bc497=Array['from'](_0xa8c982);}};return{'createYamlContext':_0x365397,'prefetchJourneySegments':_0x3b0fd3};}export async function executePushSegments(_0x374883,_0x3f4f2f,_0x1ecc57,_0x5c74eb,_0x47c2cb){const _0x58968c=a100_0x25feef,{segmentDefToCreateRequest:_0x18e430,segmentDefToUpdateRequest:_0x3705e1}=await import('./child-segment-yaml.js'),_0x55d4b3=_0x1ecc57[_0x58968c(0x1b9)],_0x2fdcf3=0x5,_0x4ae8c8=async _0x1ebc3f=>{const _0x1335ae=_0x58968c,_0x2597d3=_0x1ebc3f[_0x1335ae(0x101)]?_0x55d4b3[_0x1335ae(0x10c)](_0x1ebc3f[_0x1335ae(0x101)]):undefined;let _0x36fafe;const _0x44095f={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x1ebc3f[_0x1335ae(0x1ca)]){_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0x10f),'name':_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]});const _0x3d0d82=_0x18e430(_0x1ebc3f['yamlConfig'],_0x2597d3),_0x2b3bcd=await _0x47c2cb[_0x1335ae(0x1a1)](_0x1335ae(0x131)+_0x1ebc3f[_0x1335ae(0x188)]['name']+_0x1335ae(0x178),()=>_0x374883[_0x1335ae(0x15d)][_0x1335ae(0x1a0)](_0x5c74eb[_0x1335ae(0x155)],_0x3d0d82));_0x36fafe=_0x2b3bcd['data']['id'],_0x44095f[_0x1335ae(0x112)]={'name':_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)],'id':_0x36fafe},_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0xfa),'name':_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)],'segmentId':_0x36fafe}),_0x47c2cb[_0x1335ae(0x12a)]?.(_0x1335ae(0x15e)+_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]+'\x27'),_0x44095f[_0x1335ae(0x1be)]=0x1;}else{if(_0x1ebc3f[_0x1335ae(0x17d)]){_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0x118),'name':_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]});const _0xf60ba4=_0x3705e1(_0x1ebc3f['yamlConfig']);_0x2597d3!==_0x1ebc3f[_0x1335ae(0x16e)]?.[_0x1335ae(0x147)]&&(_0xf60ba4[_0x1335ae(0x147)]=_0x2597d3?parseInt(_0x2597d3,0xa):undefined),await _0x47c2cb['withProgress'](_0x1335ae(0x169)+_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]+'\x27...',()=>_0x374883[_0x1335ae(0x15d)][_0x1335ae(0x17f)](_0x5c74eb[_0x1335ae(0x155)],_0x1ebc3f['existingSegment']['id'],_0xf60ba4)),_0x36fafe=_0x1ebc3f[_0x1335ae(0x16e)]['id'],_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0x102),'name':_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)]}),_0x47c2cb[_0x1335ae(0x12a)]?.('Updated\x20segment\x20\x27'+_0x1ebc3f['yamlConfig']['name']+'\x27'),_0x44095f[_0x1335ae(0x129)]=0x1;}else _0x36fafe=_0x1ebc3f[_0x1335ae(0x16e)]['id'];}}catch(_0x30b8d2){const _0xdc807=isHttp400Error(_0x30b8d2),_0x2e1f92=_0xdc807?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1335ae(0x172)],_0x367992=getErrorMessage(_0x30b8d2);throw new SDKError(_0x2e1f92,'Failed\x20to\x20'+(_0x1ebc3f[_0x1335ae(0x1ca)]?_0x1335ae(0x136):_0x1335ae(0x10a))+_0x1335ae(0x157)+_0x1ebc3f[_0x1335ae(0x13b)]+'\x0a\x20\x20'+_0x367992,_0x30b8d2);}try{const _0x229ca8=await syncActivationsForSegment(_0x374883,_0x5c74eb[_0x1335ae(0x155)],_0x36fafe,_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)],_0x1ebc3f['activationActions'],_0x47c2cb,_0x1ebc3f['absolutePath']);_0x44095f['activations']=_0x229ca8;}catch(_0x4cfbb8){if(_0x4cfbb8 instanceof SDKError)throw _0x4cfbb8;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x1335ae(0x183)+_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)]+'\x27\x20from\x20file:\x20'+_0x1ebc3f[_0x1335ae(0x13b)]+_0x1335ae(0x1cb)+getErrorMessage(_0x4cfbb8),_0x4cfbb8);}return _0x44095f;},_0x5db3bc=await batchAsync(_0x3f4f2f,_0x4ae8c8,_0x2fdcf3),_0x1433a4={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x336581 of _0x5db3bc){_0x1433a4[_0x58968c(0x1be)]+=_0x336581['created'],_0x1433a4[_0x58968c(0x129)]+=_0x336581['updated'],_0x336581[_0x58968c(0x112)]&&_0x1433a4[_0x58968c(0x1b5)][_0x58968c(0x159)](_0x336581['createdSegmentId']['name'],_0x336581['createdSegmentId']['id']),_0x1433a4[_0x58968c(0x120)][_0x58968c(0x1be)]+=_0x336581[_0x58968c(0x120)]['created'],_0x1433a4[_0x58968c(0x120)]['updated']+=_0x336581[_0x58968c(0x120)][_0x58968c(0x129)],_0x1433a4['activations'][_0x58968c(0x14c)]+=_0x336581[_0x58968c(0x120)][_0x58968c(0x14c)];}return _0x1433a4;}async function syncActivationsForSegment(_0x4ab81d,_0x79536c,_0x55adc2,_0x36bc7d,_0x4f3b86,_0x166a80,_0x1d6c87){const _0x50867e=a100_0x25feef,_0x21edfc={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5a4b84 of _0x4f3b86){try{if(_0x5a4b84[_0x50867e(0x176)]===_0x50867e(0x136)&&_0x5a4b84['validatedRequest'])_0x166a80['onProgress']?.({'type':_0x50867e(0xf8),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),await _0x166a80[_0x50867e(0x1a1)](_0x50867e(0xfe)+_0x5a4b84[_0x50867e(0x14f)]+_0x50867e(0x178),()=>_0x4ab81d[_0x50867e(0x15d)]['createActivation'](_0x79536c,_0x55adc2,_0x5a4b84[_0x50867e(0x1b6)])),_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x125),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),_0x166a80[_0x50867e(0x12a)]?.('Created\x20activation\x20\x27'+_0x5a4b84[_0x50867e(0x14f)]+'\x27'),_0x21edfc['created']++;else{if(_0x5a4b84[_0x50867e(0x176)]===_0x50867e(0x10a)&&_0x5a4b84[_0x50867e(0x1b6)]&&_0x5a4b84['existingActivation'])_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x16f),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),await _0x166a80[_0x50867e(0x1a1)]('Updating\x20activation\x20\x27'+_0x5a4b84[_0x50867e(0x14f)]+'\x27...',()=>_0x4ab81d[_0x50867e(0x15d)][_0x50867e(0x12d)](_0x79536c,_0x55adc2,_0x5a4b84[_0x50867e(0x1ad)]['id'],_0x5a4b84[_0x50867e(0x1b6)])),_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x16c),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),_0x166a80[_0x50867e(0x12a)]?.(_0x50867e(0x11a)+_0x5a4b84[_0x50867e(0x14f)]+'\x27'),_0x21edfc['updated']++;else _0x5a4b84['type']===_0x50867e(0x103)&&_0x5a4b84['existingActivation']&&(_0x166a80['onProgress']?.({'type':_0x50867e(0x185),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),await _0x166a80[_0x50867e(0x1a1)]('Deleting\x20activation\x20\x27'+_0x5a4b84['name']+_0x50867e(0x178),()=>_0x4ab81d[_0x50867e(0x15d)][_0x50867e(0x153)](_0x79536c,_0x55adc2,_0x5a4b84[_0x50867e(0x1ad)]['id'])),_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x1b2),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),_0x166a80[_0x50867e(0x141)]?.(_0x50867e(0x186)+_0x5a4b84[_0x50867e(0x14f)]+'\x27'),_0x21edfc[_0x50867e(0x14c)]++);}}catch(_0x1d6d4c){const _0x3f3834=isHttp400Error(_0x1d6d4c),_0x2ca210=_0x3f3834?ErrorCode[_0x50867e(0x14b)]:ErrorCode[_0x50867e(0x111)],_0x29d32b=getErrorMessage(_0x1d6d4c);throw new SDKError(_0x2ca210,_0x50867e(0x137)+_0x5a4b84['type']+_0x50867e(0x1ae)+_0x5a4b84[_0x50867e(0x14f)]+'\x27\x20from\x20file:\x20'+_0x1d6c87+'\x0a\x20\x20'+_0x29d32b,_0x1d6d4c);}}return _0x21edfc;}export async function executePushFolders(_0x46951e,_0x35d080,_0x3a81be,_0x58580d,_0x1e3cc7){const _0xe162e0=a100_0x25feef,_0x32e730=new Map(_0x3a81be);for(const _0x573677 of _0x35d080){const _0x14acc0=_0x573677[_0xe162e0(0x162)]('/'),_0xd5e29b=_0x14acc0[_0x14acc0[_0xe162e0(0x11f)]-0x1],_0xec2a01=_0x14acc0['slice'](0x0,-0x1)['join']('/'),_0x3755c2=_0x32e730[_0xe162e0(0x10c)](_0xec2a01);_0x1e3cc7['onProgress']?.({'type':_0xe162e0(0x10d),'folder':_0x573677});const _0x1b5709={'name':_0xd5e29b,'parentFolderId':_0x3755c2},_0x2389cf=await _0x1e3cc7[_0xe162e0(0x1a1)]('Creating\x20folder\x20\x27'+_0x573677+_0xe162e0(0x178),()=>_0x46951e[_0xe162e0(0x15d)][_0xe162e0(0x1af)](_0x58580d[_0xe162e0(0x155)],_0x1b5709));_0x32e730[_0xe162e0(0x159)](_0x573677,_0x2389cf[_0xe162e0(0xf6)]['id']),_0x1e3cc7[_0xe162e0(0x152)]?.({'type':_0xe162e0(0x175),'folder':_0x573677,'folderId':_0x2389cf[_0xe162e0(0xf6)]['id']}),_0x1e3cc7[_0xe162e0(0x194)]?.(_0xe162e0(0x190)+_0x573677+'\x27');}return _0x32e730;}export async function executePushSegmentDeletions(_0x565b8e,_0x4bb3fb,_0x3e3402){const _0x46b454=a100_0x25feef;if(_0x4bb3fb[_0x46b454(0x11f)]===0x0)return 0x0;const {batchAsync:_0x33a112}=await import(_0x46b454(0x133)),_0x217b3d=0x5,_0x4e8876=await _0x33a112(_0x4bb3fb,async _0x154c6b=>{const _0x449f13=_0x46b454;return _0x3e3402[_0x449f13(0x152)]?.({'type':_0x449f13(0x124),'name':_0x154c6b[_0x449f13(0x14f)]}),await _0x565b8e[_0x449f13(0x15d)][_0x449f13(0x104)](_0x154c6b['id']),_0x3e3402[_0x449f13(0x152)]?.({'type':_0x449f13(0x195),'name':_0x154c6b[_0x449f13(0x14f)]}),_0x3e3402[_0x449f13(0x141)]?.(_0x449f13(0x154)+_0x154c6b[_0x449f13(0x14f)]+'\x27'),0x1;},_0x217b3d);return _0x4e8876[_0x46b454(0x100)]((_0x2335cf,_0x41ffb5)=>_0x2335cf+_0x41ffb5,0x0);}export async function executePushJourneys(_0x2097e7,_0x48d7a1,_0x4bad9a,_0x4174cb,_0x137d00){const _0x3188dd=a100_0x25feef,{journeyDefToRequest:_0x118189}=await import(_0x3188dd(0x135)),{activationDefToCreateRequest:_0x4c3086,yamlRuleToApi:_0x4c3041,validateSegmentRule:_0x4ae32f}=await import('./child-segment-yaml.js'),_0x3c9bba={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x437e0c=new Map(_0x4bad9a[_0x3188dd(0x1cf)]),_0x120463=0x5;for(let _0x1c30c1=0x0;_0x1c30c1<_0x48d7a1[_0x3188dd(0x11f)];_0x1c30c1+=_0x120463){const _0x2649c2=_0x48d7a1[_0x3188dd(0x177)](_0x1c30c1,_0x1c30c1+_0x120463),_0x48e35d=await Promise[_0x3188dd(0x1b1)](_0x2649c2['map'](async _0x5a0998=>{const _0x550a8e=_0x3188dd;if(!_0x5a0998[_0x550a8e(0x1ca)]&&!_0x5a0998[_0x550a8e(0x17d)])return{'action':_0x550a8e(0x110),'name':_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)],'journeyId':_0x5a0998[_0x550a8e(0x181)]?.['id']};const _0x5ba12a=_0x5a0998['folderPath']?_0x4bad9a[_0x550a8e(0x1b9)][_0x550a8e(0x10c)](_0x5a0998['folderPath']):undefined;_0x137d00[_0x550a8e(0x152)]?.({'type':_0x5a0998['isNew']?'journey_creating':_0x550a8e(0xf4),'name':_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)]});try{const _0x29b3aa=await executeSingleJourneyPush(_0x2097e7,_0x5a0998,{..._0x4bad9a,'segmentNameToId':_0x437e0c},{'parentId':_0x4174cb[_0x550a8e(0x155)],'rootFolderId':_0x4174cb['rootFolderId'],'folderId':_0x5ba12a,'verbose':_0x4174cb['verbose']},_0x137d00,{'journeyDefToRequest':_0x118189,'activationDefToCreateRequest':_0x4c3086,'yamlRuleToApi':_0x4c3041,'validateSegmentRule':_0x4ae32f});for(const [_0x370cff,_0x48b4ab]of _0x29b3aa[_0x550a8e(0x15f)]){_0x437e0c[_0x550a8e(0x159)](_0x370cff,_0x48b4ab),_0x3c9bba[_0x550a8e(0x15f)]['set'](_0x370cff,_0x48b4ab);}if(_0x29b3aa[_0x550a8e(0x121)]===_0x550a8e(0x1be))_0x137d00[_0x550a8e(0x152)]?.({'type':'journey_created','name':_0x5a0998['yamlConfig']['name'],'journeyId':_0x29b3aa['journeyId']}),_0x137d00[_0x550a8e(0x12a)]?.(_0x550a8e(0x1c8)+_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)]+'\x27'),_0x3c9bba[_0x550a8e(0x1be)]++;else _0x29b3aa['action']===_0x550a8e(0x129)&&(_0x137d00['onProgress']?.({'type':_0x550a8e(0xf9),'name':_0x5a0998[_0x550a8e(0x188)]['name']}),_0x137d00[_0x550a8e(0x12a)]?.(_0x550a8e(0x15b)+_0x5a0998['yamlConfig'][_0x550a8e(0x14f)]+'\x27'),_0x3c9bba[_0x550a8e(0x129)]++);return{'action':_0x29b3aa[_0x550a8e(0x121)],'name':_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)],'journeyId':_0x29b3aa[_0x550a8e(0x1bd)]};}catch(_0x395372){const _0x1def86=isHttp400Error(_0x395372),_0xa74bfe=_0x1def86?ErrorCode[_0x550a8e(0xf7)]:ErrorCode[_0x550a8e(0xf2)],_0x2ac4a2=getErrorMessage(_0x395372);throw new SDKError(_0xa74bfe,_0x550a8e(0x137)+(_0x5a0998['isNew']?'create':_0x550a8e(0x10a))+'\x20journey\x20from\x20file:\x20'+_0x5a0998['absolutePath']+_0x550a8e(0x1cb)+_0x2ac4a2,_0x395372);}}));_0x3c9bba['results'][_0x3188dd(0x19d)](..._0x48e35d);}return _0x3c9bba;}async function executeSingleJourneyPush(_0x18ed20,_0x52292c,_0x137ad8,_0x5ab9a4,_0x254e9a,_0x200578){const _0x4e5ac6=a100_0x25feef,{journeyDefToRequest:_0x2409d4,activationDefToCreateRequest:_0x12da5e,yamlRuleToApi:_0x489c4,validateSegmentRule:_0x5b2153}=_0x200578,_0x23426c=new Map(),_0x4e723f=new Map(),_0x287088=new Map(),_0x589f1e=new Map(),_0x4c564=new Map();let _0x26ed48;const _0x15ddd4=async()=>{const _0x4706fe=a100_0x386c;if(_0x26ed48)return;_0x26ed48=new Map();if(!_0x52292c[_0x4706fe(0x181)])return;const _0x4a0f82=await _0x18ed20[_0x4706fe(0x182)]['listActivations'](_0x52292c[_0x4706fe(0x181)]['id']);for(const _0x3bbe7e of _0x4a0f82){const _0x4311e5=journeyActivationStepToYaml(_0x3bbe7e,_0x137ad8[_0x4706fe(0x168)],_0x137ad8[_0x4706fe(0x1bf)]),_0x5b550e=activationSignature(_0x4311e5);!_0x26ed48[_0x4706fe(0x16a)](_0x5b550e)&&_0x26ed48[_0x4706fe(0x159)](_0x5b550e,_0x3bbe7e['id']),_0x4311e5[_0x4706fe(0x14f)]&&_0x4e723f[_0x4706fe(0x159)](_0x4311e5[_0x4706fe(0x14f)],_0x3bbe7e['id']);}};if(_0x52292c[_0x4e5ac6(0x181)]&&_0x52292c[_0x4e5ac6(0x188)]['segments']){const _0x3d7bd3=buildLocalExpandedRuleMappings(_0x52292c[_0x4e5ac6(0x188)]),_0x73e929=_0x3d7bd3[_0x4e5ac6(0x19e)];if(_0x73e929['size']>0x0){const _0x2b36d8=new Map();for(const [_0x3028a8,_0x2fc1e7]of _0x73e929){const _0x1adf8f=serializeExpandedRule(_0x2fc1e7,_0x73e929);_0x2b36d8[_0x4e5ac6(0x159)](_0x3028a8,_0x1adf8f);}const _0x154ffd=collectSegmentIdsFromJourneyApi(_0x52292c[_0x4e5ac6(0x181)]);if(_0x154ffd['size']>0x0){const _0xef50c9=await buildServerSegmentRuleMap(_0x18ed20,_0x5ab9a4[_0x4e5ac6(0x155)],_0x137ad8[_0x4e5ac6(0x12e)],_0x154ffd);if(_0xef50c9[_0x4e5ac6(0x139)]>0x0){const _0x4a199c=new Map();for(const [_0x5323a9,_0x2d8a02]of _0xef50c9){const _0x406a5c=serializeExpandedRule(_0x2d8a02,_0xef50c9);!_0x4a199c['has'](_0x406a5c)&&_0x4a199c[_0x4e5ac6(0x159)](_0x406a5c,_0x5323a9);}for(const [_0x59903d,_0x8c1098]of _0x2b36d8){const _0x30a153=_0x4a199c[_0x4e5ac6(0x10c)](_0x8c1098);_0x30a153&&(_0x4c564[_0x4e5ac6(0x159)](_0x59903d,_0x30a153),_0x137ad8['segmentNameToId'][_0x4e5ac6(0x159)](_0x59903d,_0x30a153));}}}}}const _0x2988a8={'resolveSegmentId':async _0xeb666e=>{const _0x33da77=_0x4e5ac6,_0x236887=_0x137ad8[_0x33da77(0x1cf)]['get'](_0xeb666e);if(!_0x236887)throw new SDKError(ErrorCode[_0x33da77(0x15c)],'Segment\x20not\x20found:\x20'+_0xeb666e+_0x33da77(0x149)+_0x52292c[_0x33da77(0x188)][_0x33da77(0x14f)]+')');return _0x236887;},'resolveEmbeddedSegmentId':async(_0x8c315d,_0x2a2ebe)=>{const _0x5e5886=_0x4e5ac6,_0x419382=_0x137ad8[_0x5e5886(0x1cf)][_0x5e5886(0x10c)](_0x8c315d);if(_0x419382)return _0x419382;const _0x17b02a=_0x4c564['get'](_0x8c315d);if(_0x17b02a)return _0x137ad8['segmentNameToId']['set'](_0x8c315d,_0x17b02a),_0x17b02a;const _0x458a89=_0x137ad8[_0x5e5886(0x12e)]['find'](_0x21c4e9=>_0x21c4e9[_0x5e5886(0x14f)]===_0x8c315d);if(_0x458a89)return _0x137ad8['segmentNameToId'][_0x5e5886(0x159)](_0x8c315d,_0x458a89['id']),_0x458a89['id'];if(_0x52292c[_0x5e5886(0x1ca)]){const {stageName:_0x42c396,criteriaName:_0x2f4644}=findSegmentCriteriaLocation(_0x52292c['yamlConfig'],_0x8c315d);return _0x5b2153(_0x8c315d,_0x2a2ebe[_0x5e5886(0x1b7)]),_0x287088['set'](_0x8c315d,{'definition':_0x2a2ebe,'stageName':_0x42c396,'criteriaName':_0x2f4644}),createPendingSegmentId(_0x8c315d);}const _0x508ba1=_0x52292c[_0x5e5886(0x181)]?.['id'];if(!_0x508ba1)throw new SDKError(ErrorCode[_0x5e5886(0x11d)],_0x5e5886(0x11c));_0x5b2153(_0x8c315d,_0x2a2ebe[_0x5e5886(0x1b7)]);const _0x2afd7c=generateDeterministicJourneySegmentName(_0x52292c[_0x5e5886(0x188)]['name'],_0x8c315d),_0xd99351=_0x137ad8[_0x5e5886(0x12e)][_0x5e5886(0x1d0)](_0x2c90b5=>_0x2c90b5[_0x5e5886(0x14f)]===_0x2afd7c),_0x425388=createSegmentIdResolver(_0x137ad8[_0x5e5886(0x1cf)],_0x8c315d),_0x446045=await resolveRuleSegmentIds(_0x2a2ebe[_0x5e5886(0x1b7)],_0x425388);let _0xc9191e;if(_0xd99351)await _0x18ed20[_0x5e5886(0x15d)][_0x5e5886(0x17f)](_0x5ab9a4[_0x5e5886(0x155)],_0xd99351['id'],{'description':_0x2a2ebe[_0x5e5886(0x114)]||'Entry\x20criteria:\x20'+_0x8c315d,'rule':_0x489c4(_0x446045,!![]),'countPopulation':!![]}),_0xc9191e=_0xd99351['id'];else try{_0xc9191e=await _0x18ed20[_0x5e5886(0x15d)][_0x5e5886(0x134)]({'name':_0x2afd7c,'description':_0x2a2ebe[_0x5e5886(0x114)]||_0x5e5886(0x180)+_0x8c315d,'journeyId':_0x508ba1,'rule':_0x489c4(_0x446045,!![]),'countPopulation':!![],'parentFolderId':_0x5ab9a4['rootFolderId']||'','audienceId':_0x5ab9a4[_0x5e5886(0x155)]});}catch(_0x20347c){const _0x13cf2a=_0x20347c instanceof Error&&_0x20347c['message'][_0x5e5886(0x12b)](_0x5e5886(0x1ba));if(_0x13cf2a){const _0x4315e=await _0x18ed20['segment'][_0x5e5886(0x18a)](_0x5ab9a4[_0x5e5886(0x155)]),_0x401c7e=_0x4315e[_0x5e5886(0x1d0)](_0xe0774d=>_0xe0774d[_0x5e5886(0x14f)]===_0x2afd7c);if(_0x401c7e)await _0x18ed20[_0x5e5886(0x15d)][_0x5e5886(0x17f)](_0x5ab9a4[_0x5e5886(0x155)],_0x401c7e['id'],{'description':_0x2a2ebe[_0x5e5886(0x114)]||_0x5e5886(0x180)+_0x8c315d,'rule':_0x489c4(_0x446045,!![]),'countPopulation':!![]}),_0xc9191e=_0x401c7e['id'];else throw _0x20347c;}else throw _0x20347c;}return _0x137ad8['segmentNameToId'][_0x5e5886(0x159)](_0x8c315d,_0xc9191e),_0x23426c[_0x5e5886(0x159)](_0x8c315d,_0xc9191e),_0xc9191e;},'resolveActivationId':async _0x4dd80e=>{const _0x20f5b9=_0x4e5ac6,_0x46f6aa=_0x4e723f[_0x20f5b9(0x10c)](_0x4dd80e);if(_0x46f6aa)return _0x46f6aa;if(_0x52292c['existingJourney']){await _0x15ddd4();const _0x22acdb=_0x4e723f[_0x20f5b9(0x10c)](_0x4dd80e);if(_0x22acdb)return _0x22acdb;}throw new SDKError(ErrorCode[_0x20f5b9(0x173)],_0x20f5b9(0x1a9)+_0x4dd80e+_0x20f5b9(0x149)+_0x52292c['yamlConfig'][_0x20f5b9(0x14f)]+').\x20'+_0x20f5b9(0x11b));},'resolveEmbeddedActivationId':async(_0x8a0731,_0x538947)=>{const _0x20e8ee=_0x4e5ac6,_0x670ef1=_0x4e723f['get'](_0x8a0731);if(_0x670ef1)return _0x670ef1;if(_0x52292c[_0x20e8ee(0x1ca)])return _0x589f1e[_0x20e8ee(0x159)](_0x8a0731,_0x538947),createPendingActivationId(_0x8a0731);if(_0x52292c[_0x20e8ee(0x181)]){await _0x15ddd4();const _0x3f6132=_0x4e723f[_0x20e8ee(0x10c)](_0x538947[_0x20e8ee(0x14f)]);if(_0x3f6132)return _0x4e723f[_0x20e8ee(0x159)](_0x8a0731,_0x3f6132),_0x3f6132;const _0x4d7823=activationSignature(_0x538947),_0x2b7434=_0x26ed48?.[_0x20e8ee(0x10c)](_0x4d7823);if(_0x2b7434)return _0x4e723f[_0x20e8ee(0x159)](_0x8a0731,_0x2b7434),_0x2b7434;const _0x5f432c=await _0x12da5e(_0x538947,_0x137ad8['activationContext']),_0x1f744a=await _0x18ed20[_0x20e8ee(0x182)][_0x20e8ee(0x126)](_0x52292c[_0x20e8ee(0x181)]['id'],_0x5f432c);return _0x4e723f['set'](_0x8a0731,_0x1f744a['id']),_0x1f744a['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x20e8ee(0x1b3));},'resolveJourneyId':async _0x584705=>{const _0xf67636=_0x4e5ac6;try{return await _0x18ed20[_0xf67636(0x182)][_0xf67636(0x148)](_0x5ab9a4[_0xf67636(0x155)],_0x584705);}catch(_0x21bb58){throw new SDKError(ErrorCode[_0xf67636(0x173)],_0xf67636(0x105)+_0x584705+_0xf67636(0x1c9)+_0x52292c['yamlConfig']['name']+'\x27)',_0x21bb58);}},'resolveStageId':async(_0x57edaa,_0x2bc85a)=>{const _0x3e161b=_0x4e5ac6,_0xd028e0=await _0x18ed20[_0x3e161b(0x182)][_0x3e161b(0x163)](_0x57edaa),_0x5ce3d4=_0xd028e0[_0x3e161b(0x144)]['journeyStages'][_0x3e161b(0x1d0)](_0x23ab6d=>_0x23ab6d[_0x3e161b(0x14f)][_0x3e161b(0x184)]()===_0x2bc85a[_0x3e161b(0x184)]());if(!_0x5ce3d4?.['id'])throw new SDKError(ErrorCode[_0x3e161b(0x173)],'Stage\x20\x27'+_0x2bc85a+_0x3e161b(0x151)+(_0xd028e0['attributes'][_0x3e161b(0x14e)]||_0xd028e0[_0x3e161b(0x144)][_0x3e161b(0x14f)])+'\x27');return _0x5ce3d4['id'];}},_0x1934ae=await _0x2409d4(_0x52292c[_0x4e5ac6(0x188)],_0x5ab9a4[_0x4e5ac6(0x155)],_0x2988a8),_0x216707=_0x5ab9a4[_0x4e5ac6(0x156)]||_0x5ab9a4['rootFolderId'];_0x216707&&(_0x1934ae[_0x4e5ac6(0x187)]={'parentFolder':{'data':{'id':_0x216707,'type':_0x4e5ac6(0x16d)}}});if(_0x52292c['isNew']){if(_0x287088[_0x4e5ac6(0x139)]>0x0||_0x589f1e[_0x4e5ac6(0x139)]>0x0)return await executeThreeStepJourneyCreate(_0x18ed20,_0x52292c,_0x1934ae,{'pendingEmbeddedSegments':_0x287088,'pendingEmbeddedActivations':_0x589f1e,'embeddedSegmentNameToId':_0x23426c,'journeyActivationNameToId':_0x4e723f},{..._0x5ab9a4,'effectiveFolderId':_0x216707},_0x137ad8,_0x254e9a,_0x200578);else{ensureJourneyDefaults(_0x1934ae[_0x4e5ac6(0x144)]);const _0x1c9b89=await _0x18ed20[_0x4e5ac6(0x182)]['create'](_0x1934ae);return{'action':'created','journeyId':_0x1c9b89['id'],'embeddedSegmentNameToId':_0x23426c};}}else{if(_0x52292c[_0x4e5ac6(0x17d)]&&_0x52292c['existingJourney'])return ensureJourneyDefaults(_0x1934ae['attributes']),await _0x18ed20['journey'][_0x4e5ac6(0x10a)](_0x52292c[_0x4e5ac6(0x181)]['id'],_0x1934ae),{'action':_0x4e5ac6(0x129),'journeyId':_0x52292c[_0x4e5ac6(0x181)]['id'],'embeddedSegmentNameToId':_0x23426c};}return{'action':_0x4e5ac6(0x110),'journeyId':_0x52292c[_0x4e5ac6(0x181)]?.['id'],'embeddedSegmentNameToId':_0x23426c};}function findSegmentCriteriaLocation(_0x31ec65,_0xdb759c){const _0x5d9756=a100_0x25feef,_0x2f9bd0=_0x31ec65[_0x5d9756(0x1cc)]||_0x31ec65[_0x5d9756(0x1cd)]?.[0x0]?.['stages']||[];let _0x44575d='entry',_0x83824a=_0xdb759c;const _0x2e6313=_0x31ec65[_0x5d9756(0x19c)]||_0x31ec65[_0x5d9756(0x1cd)]?.[0x0]?.[_0x5d9756(0x19c)];if(_0x2e6313?.['segment']===_0xdb759c)return{'stageName':_0x5d9756(0x19c),'criteriaName':_0x2e6313[_0x5d9756(0x14f)]||_0xdb759c};_0x4c0952:for(const _0x59073d of _0x2f9bd0){if(_0x59073d[_0x5d9756(0x17b)]?.[_0x5d9756(0x15d)]===_0xdb759c){_0x44575d=_0x59073d['name'],_0x83824a=_0x59073d[_0x5d9756(0x17b)][_0x5d9756(0x14f)]||_0xdb759c;break;}if(_0x59073d[_0x5d9756(0x108)])for(const _0x10e7ac of _0x59073d[_0x5d9756(0x108)]){if(_0x10e7ac[_0x5d9756(0x176)]===_0x5d9756(0x198)&&_0x10e7ac['with']?.['branches'])for(const _0x23f6e3 of _0x10e7ac[_0x5d9756(0x1c7)][_0x5d9756(0x1a6)]){if(_0x23f6e3['segment']===_0xdb759c){_0x44575d=_0x59073d['name'],_0x83824a=_0x23f6e3['name']||_0xdb759c;break _0x4c0952;}}}}return{'stageName':_0x44575d,'criteriaName':_0x83824a};}async function executeThreeStepJourneyCreate(_0x26384b,_0x8d4915,_0xf2fbed,_0x66dfb0,_0x15a7d1,_0x4e6a6d,_0x1d183d,_0x240f1a){const _0x251d45=a100_0x25feef,{activationDefToCreateRequest:_0x16d222,yamlRuleToApi:_0x49eeba}=_0x240f1a,{pendingEmbeddedSegments:_0x112402,pendingEmbeddedActivations:_0x359671,embeddedSegmentNameToId:_0x54193b}=_0x66dfb0,_0x56bf57=JSON[_0x251d45(0x13e)](JSON[_0x251d45(0x160)](_0xf2fbed));ensureJourneyDefaults(_0x56bf57[_0x251d45(0x144)]),stripPendingIds(_0x56bf57);const _0x17f446=await _0x26384b[_0x251d45(0x182)][_0x251d45(0x136)](_0x56bf57),_0x2d6be5=_0x17f446['id'],_0x4aa9dd=new Map();for(const _0x242090 of _0x17f446[_0x251d45(0x144)]['journeyStages']){_0x4aa9dd[_0x251d45(0x159)](_0x242090['name'][_0x251d45(0x184)](),_0x242090['id']);}for(const [_0x469c65,{definition:_0x5432c6}]of _0x112402){const _0x245cf4=generateDeterministicJourneySegmentName(_0x8d4915[_0x251d45(0x188)]['name'],_0x469c65);_0x1d183d[_0x251d45(0x152)]?.({'type':'embedded_segment_creating','journeyName':_0x8d4915[_0x251d45(0x188)]['name'],'segmentName':_0x469c65});const _0x5a6f72=createSegmentIdResolver(_0x4e6a6d[_0x251d45(0x1cf)],_0x469c65),_0x3ce80e=await resolveRuleSegmentIds(_0x5432c6['rule'],_0x5a6f72),_0x20fe56=await _0x26384b['segment']['createJourneySegment']({'name':_0x245cf4,'description':_0x5432c6[_0x251d45(0x114)]||_0x251d45(0x180)+_0x469c65,'journeyId':_0x2d6be5,'rule':_0x49eeba(_0x3ce80e,!![]),'countPopulation':!![],'parentFolderId':_0x15a7d1[_0x251d45(0x1a7)]||'','audienceId':_0x15a7d1[_0x251d45(0x155)]});_0x54193b[_0x251d45(0x159)](_0x469c65,_0x20fe56),_0x4e6a6d[_0x251d45(0x1cf)]['set'](_0x469c65,_0x20fe56),_0x1d183d[_0x251d45(0x152)]?.({'type':'embedded_segment_created','journeyName':_0x8d4915[_0x251d45(0x188)][_0x251d45(0x14f)],'segmentName':_0x469c65});}const _0x4424a4=new Map();for(const [_0x55fc1f,_0x44f3ac]of _0x359671){_0x1d183d['onProgress']?.({'type':_0x251d45(0x18d),'journeyName':_0x8d4915[_0x251d45(0x188)][_0x251d45(0x14f)],'activationName':_0x55fc1f});const _0x4224bb=await _0x16d222(_0x44f3ac,_0x4e6a6d[_0x251d45(0x1a4)]),_0x24d34a=await _0x26384b[_0x251d45(0x182)][_0x251d45(0x126)](_0x2d6be5,_0x4224bb);_0x4424a4[_0x251d45(0x159)](_0x55fc1f,_0x24d34a['id']),_0x66dfb0[_0x251d45(0x10e)]['set'](_0x55fc1f,_0x24d34a['id']),_0x1d183d[_0x251d45(0x152)]?.({'type':'embedded_activation_created','journeyName':_0x8d4915[_0x251d45(0x188)][_0x251d45(0x14f)],'activationName':_0x55fc1f});}const _0x5489be=JSON[_0x251d45(0x13e)](JSON[_0x251d45(0x160)](_0xf2fbed));return _0x5489be['id']=_0x2d6be5,ensureJourneyDefaults(_0x5489be['attributes']),resolvePendingIdsInRequest(_0x5489be,_0xf2fbed,_0x4aa9dd,_0x54193b,_0x4424a4,_0x1d183d),await _0x26384b[_0x251d45(0x182)]['update'](_0x2d6be5,_0x5489be),{'action':_0x251d45(0x1be),'journeyId':_0x2d6be5,'embeddedSegmentNameToId':_0x54193b};}function stripPendingIds(_0x46ed52){const _0x48e07c=a100_0x25feef;for(const _0x1e1cef of _0x46ed52['attributes'][_0x48e07c(0x193)]||[]){_0x1e1cef[_0x48e07c(0x1bc)]?.[_0x48e07c(0x145)]&&isPendingSegmentId(_0x1e1cef[_0x48e07c(0x1bc)][_0x48e07c(0x145)])&&delete _0x1e1cef[_0x48e07c(0x1bc)];if(_0x1e1cef['steps'])for(const _0x238c68 of Object[_0x48e07c(0xf3)](_0x1e1cef[_0x48e07c(0x108)])){const _0x1be8a3=_0x1e1cef[_0x48e07c(0x108)][_0x238c68];_0x1be8a3[_0x48e07c(0x176)]===_0x48e07c(0x174)&&_0x1be8a3[_0x48e07c(0x146)]&&isPendingActivationId(_0x1be8a3[_0x48e07c(0x146)])&&(_0x1be8a3['journeyActivationStepId']='');if(_0x1be8a3['type']===_0x48e07c(0x17c)&&_0x1be8a3[_0x48e07c(0x1a6)])for(const _0x3a68e5 of _0x1be8a3['branches']){_0x3a68e5[_0x48e07c(0x145)]&&isPendingSegmentId(_0x3a68e5[_0x48e07c(0x145)])&&(_0x3a68e5[_0x48e07c(0x145)]='');}_0x1be8a3[_0x48e07c(0x176)]==='WaitStep'&&_0x1be8a3[_0x48e07c(0x165)]?.[_0x48e07c(0x145)]&&isPendingSegmentId(_0x1be8a3[_0x48e07c(0x165)]['segmentId'])&&(_0x1be8a3[_0x48e07c(0x165)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x205a87,_0x50adad,_0x48f9df,_0x2d8df1,_0x225cf0,_0x44685f){const _0x247f80=a100_0x25feef,_0xdc9029=(_0x3eee4a,_0x3425cd)=>{const _0x33b1d1=a100_0x386c;if(!isPendingSegmentId(_0x3eee4a))return _0x3eee4a;const _0x364c57=extractPendingSegmentName(_0x3eee4a),_0x846f89=_0x2d8df1[_0x33b1d1(0x10c)](_0x364c57);return!_0x846f89&&_0x44685f['logWarning']?.(_0x33b1d1(0x17e)+_0x364c57+_0x33b1d1(0x166)+_0x3425cd),_0x846f89;};if(_0x205a87[_0x247f80(0x144)]['goal']?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x205a87['attributes']['goal'][_0x247f80(0x145)])){const _0x43bd40=_0xdc9029(_0x205a87[_0x247f80(0x144)]['goal'][_0x247f80(0x145)],'goal\x20criteria');_0x43bd40&&(_0x205a87[_0x247f80(0x144)][_0x247f80(0x19c)][_0x247f80(0x145)]=_0x43bd40);}for(const _0x24b721 of _0x205a87[_0x247f80(0x144)][_0x247f80(0x193)]||[]){const _0x17352c=_0x48f9df[_0x247f80(0x10c)](_0x24b721[_0x247f80(0x14f)][_0x247f80(0x184)]());_0x17352c&&(_0x24b721['id']=_0x17352c);if(_0x24b721[_0x247f80(0x1bc)]?.['segmentId']&&isPendingSegmentId(_0x24b721[_0x247f80(0x1bc)][_0x247f80(0x145)])){const _0x15aa1d=_0xdc9029(_0x24b721[_0x247f80(0x1bc)][_0x247f80(0x145)],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+'\x27\x20entry\x20criteria');_0x15aa1d&&(_0x24b721[_0x247f80(0x1bc)][_0x247f80(0x145)]=_0x15aa1d);}if(_0x24b721[_0x247f80(0x1a3)])for(const _0x1a8afa of _0x24b721[_0x247f80(0x1a3)]){if(_0x1a8afa['segmentId']&&isPendingSegmentId(_0x1a8afa['segmentId'])){const _0x1a74ce=_0xdc9029(_0x1a8afa['segmentId'],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+_0x247f80(0x128));_0x1a74ce&&(_0x1a8afa[_0x247f80(0x145)]=_0x1a74ce);}}if(_0x24b721[_0x247f80(0x1c1)]?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x24b721['milestone'][_0x247f80(0x145)])){const _0x299ac4=_0xdc9029(_0x24b721[_0x247f80(0x1c1)]['segmentId'],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+'\x27\x20milestone');_0x299ac4&&(_0x24b721[_0x247f80(0x1c1)][_0x247f80(0x145)]=_0x299ac4);}if(_0x24b721[_0x247f80(0x108)]){const _0x55941a=_0x13a993=>_0x50adad[_0x247f80(0x144)][_0x247f80(0x193)][_0x247f80(0x1d0)](_0x372ad7=>_0x372ad7[_0x247f80(0x14f)][_0x247f80(0x184)]()===_0x24b721[_0x247f80(0x14f)][_0x247f80(0x184)]())?.[_0x247f80(0x108)]?.[_0x13a993];for(const _0x8824b6 of Object[_0x247f80(0xf3)](_0x24b721['steps'])){const _0x322845=_0x24b721[_0x247f80(0x108)][_0x8824b6],_0x4dc8bc=_0x55941a(_0x8824b6);if(_0x322845['type']===_0x247f80(0x174)&&_0x322845['journeyActivationStepId']&&(isPendingActivationId(_0x322845[_0x247f80(0x146)])||_0x322845[_0x247f80(0x146)]==='')){if(_0x4dc8bc?.[_0x247f80(0x146)]&&isPendingActivationId(_0x4dc8bc['journeyActivationStepId'])){const _0x47301b=extractPendingActivationName(_0x4dc8bc[_0x247f80(0x146)]),_0x391e1f=_0x225cf0[_0x247f80(0x10c)](_0x47301b);_0x391e1f&&(_0x322845[_0x247f80(0x146)]=_0x391e1f);}}if(_0x322845[_0x247f80(0x176)]==='DecisionPoint'&&_0x322845['branches']&&_0x4dc8bc?.[_0x247f80(0x1a6)])for(let _0xe03e7=0x0;_0xe03e7<_0x322845['branches'][_0x247f80(0x11f)];_0xe03e7++){const _0x44d8cc=_0x322845[_0x247f80(0x1a6)][_0xe03e7],_0x1dbe39=_0x4dc8bc['branches'][_0xe03e7];if(_0x1dbe39?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x1dbe39[_0x247f80(0x145)])){const _0x193a56=_0xdc9029(_0x1dbe39[_0x247f80(0x145)],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+_0x247f80(0x116)+(_0x44d8cc['name']||_0xe03e7)+'\x27');_0x193a56&&(_0x44d8cc['segmentId']=_0x193a56);}}if(_0x322845[_0x247f80(0x176)]===_0x247f80(0x11e)&&_0x322845[_0x247f80(0x165)]?.[_0x247f80(0x145)]&&_0x4dc8bc?.[_0x247f80(0x165)]?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x4dc8bc[_0x247f80(0x165)][_0x247f80(0x145)])){const _0x56cb26=_0xdc9029(_0x4dc8bc['waitCondition']['segmentId'],'stage\x20\x27'+_0x24b721[_0x247f80(0x14f)]+_0x247f80(0x13c));_0x56cb26&&(_0x322845[_0x247f80(0x165)]['segmentId']=_0x56cb26);}}}}}
1
+ const a100_0x2c6966=a100_0x1a9a;(function(_0x3a961a,_0x572702){const _0x29c3dc=a100_0x1a9a,_0x177069=_0x3a961a();while(!![]){try{const _0x561e0b=parseInt(_0x29c3dc(0x151))/0x1+parseInt(_0x29c3dc(0x168))/0x2*(-parseInt(_0x29c3dc(0x18f))/0x3)+-parseInt(_0x29c3dc(0x1c4))/0x4*(parseInt(_0x29c3dc(0x18a))/0x5)+parseInt(_0x29c3dc(0x1ff))/0x6+parseInt(_0x29c3dc(0x136))/0x7+-parseInt(_0x29c3dc(0x1bd))/0x8+parseInt(_0x29c3dc(0x183))/0x9;if(_0x561e0b===_0x572702)break;else _0x177069['push'](_0x177069['shift']());}catch(_0x2ee8c1){_0x177069['push'](_0x177069['shift']());}}}(a100_0xc29c,0xd67d3));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a100_0x2c6966(0x12a);export const PENDING_ACTIVATION_PREFIX=a100_0x2c6966(0x14f);export function createPendingSegmentId(_0x2a4199){return''+PENDING_SEGMENT_PREFIX+_0x2a4199+'__';}export function isPendingSegmentId(_0x570305){const _0x4c6cd8=a100_0x2c6966;return _0x570305[_0x4c6cd8(0x1bb)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x4d8cb8){const _0x3c04e3=a100_0x2c6966;return _0x4d8cb8[_0x3c04e3(0x1f6)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3ee1bb){return''+PENDING_ACTIVATION_PREFIX+_0x3ee1bb+'__';}export function isPendingActivationId(_0x547c4c){const _0x449578=a100_0x2c6966;return _0x547c4c[_0x449578(0x1bb)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x419ea8){const _0x375cd1=a100_0x2c6966;return _0x419ea8[_0x375cd1(0x1f6)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x2c3f33,_0x5c92e5){const _0xf01964=a100_0x2c6966,_0xd6acb9=_0x2c3f33+'::'+(_0x5c92e5[_0xf01964(0x1bf)]()||'segment'),_0x1a4623=createHash(_0xf01964(0x1b7))[_0xf01964(0x1a7)](_0xd6acb9)['digest']('hex')[_0xf01964(0x1e9)](0x0,0xc);return _0xf01964(0x155)+_0x1a4623;}export function ensureJourneyDefaults(_0x30dab2){const _0x5c48a9=a100_0x2c6966;!_0x30dab2[_0x5c48a9(0x132)]&&(_0x30dab2[_0x5c48a9(0x132)]=''),!_0x30dab2['state']&&(_0x30dab2['state']='draft');}export function resolveTDFolderPath(_0x37a827,_0x2115c2,_0x415fbb){const _0x4e8087=a100_0x2c6966;if(!_0x2115c2)return _0x37a827;if(_0x37a827===_0x415fbb||_0x37a827[_0x4e8087(0x1bb)](_0x415fbb+'/'))return _0x37a827;return _0x37a827?_0x415fbb+'/'+_0x37a827:_0x415fbb;}export function addFoldersToCreate(_0x168337,_0x10305f,_0x342364){const _0x1954ac=a100_0x2c6966;if(!_0x168337)return;if(_0x10305f[_0x1954ac(0x1c3)](_0x168337))return;const _0x3de62e=_0x168337[_0x1954ac(0x13a)]('/');let _0x32da81='';for(const _0x53183d of _0x3de62e){_0x32da81=_0x32da81?_0x32da81+'/'+_0x53183d:_0x53183d,!_0x10305f[_0x1954ac(0x1c3)](_0x32da81)&&_0x342364[_0x1954ac(0x18c)](_0x32da81);}}import*as a100_0x4d5033 from'yaml';import{readFileSync}from'fs';function a100_0x1a9a(_0x2c8a54,_0x3a7dd6){_0x2c8a54=_0x2c8a54-0x11e;const _0xc29c8a=a100_0xc29c();let _0x1a9af6=_0xc29c8a[_0x2c8a54];return _0x1a9af6;}import a100_0x2afdb9 from'path';import{isJourneyDef,parseYamlString as a100_0x31baf0,toYamlString as a100_0x5d57b2,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x53d02c){const _0x5dde57=a100_0x2c6966;if(Array['isArray'](_0x53d02c))return'['+_0x53d02c[_0x5dde57(0x1b5)](_0xd89f45=>stableStringify(_0xd89f45))[_0x5dde57(0x120)](',')+']';if(_0x53d02c&&typeof _0x53d02c===_0x5dde57(0x1e5)){const _0x3d15dc=_0x53d02c,_0x56a4cd=Object[_0x5dde57(0x1d3)](_0x3d15dc)['sort'](),_0x353c3d=_0x56a4cd[_0x5dde57(0x1b5)](_0x59d5b2=>'\x22'+_0x59d5b2+'\x22:'+stableStringify(_0x3d15dc[_0x59d5b2]));return'{'+_0x353c3d[_0x5dde57(0x120)](',')+'}';}const _0x4de6ee=JSON[_0x5dde57(0x158)](_0x53d02c);return _0x4de6ee===undefined?_0x5dde57(0x14e):_0x4de6ee;}function activationSignature(_0x2c8f28){const _0x554f99=a100_0x2c6966,_0x4e5ccd={'connection':_0x2c8f28['connection'],..._0x2c8f28[_0x554f99(0x19b)]!==undefined&&{'all_columns':_0x2c8f28['all_columns']},..._0x2c8f28[_0x554f99(0x16d)]!==undefined&&{'columns':_0x2c8f28[_0x554f99(0x16d)]},..._0x2c8f28[_0x554f99(0x1a9)]!==undefined&&{'behavior':_0x2c8f28[_0x554f99(0x1a9)]},..._0x2c8f28[_0x554f99(0x1cb)]!==undefined&&{'schedule':_0x2c8f28[_0x554f99(0x1cb)]},..._0x2c8f28[_0x554f99(0x178)]!==undefined&&{'notification':_0x2c8f28[_0x554f99(0x178)]},..._0x2c8f28[_0x554f99(0x169)]!==undefined&&{'connector_config':_0x2c8f28[_0x554f99(0x169)]},..._0x2c8f28['activation_template_id']!==undefined&&{'activation_template_id':_0x2c8f28[_0x554f99(0x12b)]}};return stableStringify(_0x4e5ccd);}export async function prepareSegmentFiles(_0x9f9869,_0x541422,_0x5c5aab,_0x117fe8,_0x4e7b5c){const _0x1b370e=a100_0x2c6966,{activationDefToCreateRequest:_0x2dfd51}=await import('./child-segment-yaml.js'),_0x2cd76c=[],_0x5b78db=new Set();for(const {yamlConfig:_0x51d93b,folderPath:_0x354d76,sourcePath:_0xb6d58f}of _0x9f9869){const _0x57f339=resolveTDFolderPath(_0x354d76,_0x117fe8,_0x4e7b5c),_0x22797b=_0x57f339+':'+_0x51d93b[_0x1b370e(0x141)],_0x248d07=_0x541422[_0x1b370e(0x148)][_0x1b370e(0x15b)](_0x22797b),_0x36db52=_0x248d07?_0x541422['activationsBySegmentId'][_0x1b370e(0x15b)](_0x248d07['id'])||[]:[];addFoldersToCreate(_0x57f339,_0x541422[_0x1b370e(0x135)],_0x5b78db);const _0x3a9e18=calculateActivationActions(_0x51d93b[_0x1b370e(0x13d)]||[],_0x36db52,_0x541422[_0x1b370e(0x124)],_0x541422[_0x1b370e(0x1a0)]);for(const _0x1dc16e of _0x3a9e18){(_0x1dc16e[_0x1b370e(0x134)]===_0x1b370e(0x17f)||_0x1dc16e['type']===_0x1b370e(0x1a7))&&_0x1dc16e[_0x1b370e(0x1c6)]&&(_0x1dc16e[_0x1b370e(0x157)]=await _0x2dfd51(_0x1dc16e[_0x1b370e(0x1c6)],_0x5c5aab));}const _0x321633=calculateSegmentDiff(_0x51d93b,_0x248d07,_0x36db52,_0x541422['idToEmailMap'],_0x541422[_0x1b370e(0x1a0)]);_0x2cd76c[_0x1b370e(0x1e2)]({'relativePath':_0x51d93b[_0x1b370e(0x141)],'absolutePath':_0xb6d58f,'yamlConfig':_0x51d93b,'folderPath':_0x57f339,'existingSegment':_0x248d07,'existingActivations':_0x36db52,'isNew':_0x321633[_0x1b370e(0x1fe)],'hasChanges':_0x321633[_0x1b370e(0x162)],'diff':_0x321633['diff'],'activationActions':_0x3a9e18});}return{'segmentFiles':_0x2cd76c,'foldersToCreate':_0x5b78db};}export async function prepareJourneyFiles(_0x4fe46a,_0x52d7a5,_0x32b2c4,_0x1c2816){const _0x2d7eef=a100_0x2c6966,_0x511f5f=[],_0x42e692=new Set();for(const {yamlConfig:_0x2c45e6,folderPath:_0x4d34dc,sourcePath:_0x546235}of _0x4fe46a){const _0x2456e6=resolveTDFolderPath(_0x4d34dc,_0x32b2c4,_0x1c2816),_0x2b009c=_0x2456e6+':'+_0x2c45e6[_0x2d7eef(0x141)],_0x365bd3=_0x52d7a5[_0x2d7eef(0x122)][_0x2d7eef(0x15b)](_0x2b009c);let _0x5fc2a,_0xa624f1;if(_0x365bd3&&_0x365bd3[_0x2d7eef(0x1d8)]>0x0){const _0x597d89=buildLocalExpandedRuleMappings(_0x2c45e6),{createYamlContext:_0x3a8f33,prefetchJourneySegments:_0x3c5a2c}=createPushYamlContextForBundle(_0x52d7a5['deps'],_0x52d7a5['parentId'],_0x52d7a5['existingSegments'],_0x597d89,_0x52d7a5['idToEmailMap'],_0x52d7a5[_0x2d7eef(0x1a0)],_0x52d7a5[_0x2d7eef(0x1c2)],_0x52d7a5[_0x2d7eef(0x1fa)]);await _0x3c5a2c(_0x365bd3[_0x2d7eef(0x1b5)](_0x4765fb=>_0x4765fb['id']));const _0x338a28=hasMultipleVersions(_0x2c45e6),_0x142efa=async _0x221e7e=>{const _0x4b4399=_0x2d7eef,_0x504ca7=_0x52d7a5['journeyById']?.[_0x4b4399(0x15b)](_0x221e7e);if(_0x504ca7)return _0x504ca7;return _0x52d7a5[_0x4b4399(0x172)]({'journeyId':_0x221e7e,'journeyName':_0x2c45e6[_0x4b4399(0x141)],'isMultiVersion':_0x365bd3['length']>0x1});};if(_0x338a28&&_0x365bd3[_0x2d7eef(0x1d8)]>0x1){const _0x27ad1e=[];for(const _0x568071 of _0x365bd3){const _0x19eb95=_0x568071[_0x2d7eef(0x1eb)]||0x1;_0x52d7a5[_0x2d7eef(0x1b3)]?.[_0x2d7eef(0x1a7)]('Fetching\x20'+_0x2c45e6[_0x2d7eef(0x141)]+'\x20v'+_0x19eb95);const _0x4b736e=await _0x142efa(_0x568071['id']),_0x420cf8=_0x3a8f33(_0x568071['id']),_0x56f54c=await journeyResponseToDef(_0x4b736e,_0x420cf8);_0x27ad1e['push']({'item':_0x568071,'yaml':_0x56f54c});}const _0x164fe3=buildLocalRuleToNameMappingFromJourney(_0x2c45e6);_0xa624f1=buildMergedJourneyDef(_0x27ad1e,_0x164fe3);const _0x598207=Math['max'](..._0x27ad1e[_0x2d7eef(0x1b5)](_0x28f687=>_0x28f687[_0x2d7eef(0x1ce)][_0x2d7eef(0x1eb)]||0x0)),_0x122f92=_0x365bd3[_0x2d7eef(0x133)](_0x18aba3=>(_0x18aba3[_0x2d7eef(0x1eb)]||0x0)===_0x598207);_0x122f92&&(_0x52d7a5['progress']?.[_0x2d7eef(0x1a7)]('Fetching\x20'+_0x2c45e6[_0x2d7eef(0x141)]+'\x20v'+_0x598207),_0x5fc2a=await _0x142efa(_0x122f92['id']));}else{const _0x335122=_0x365bd3[_0x365bd3[_0x2d7eef(0x1d8)]-0x1];_0x52d7a5['progress']?.['update'](_0x2d7eef(0x164)+_0x2c45e6[_0x2d7eef(0x141)]),_0x5fc2a=await _0x142efa(_0x335122['id']);const _0x3dd5d4=_0x3a8f33(_0x335122['id']),_0x3b583f=await journeyResponseToDef(_0x5fc2a,_0x3dd5d4),_0x13b8df=buildLocalRuleToNameMappingFromJourney(_0x2c45e6);_0xa624f1=buildMergedJourneyDef([{'item':_0x335122,'yaml':_0x3b583f}],_0x13b8df);}}addFoldersToCreate(_0x2456e6,_0x52d7a5[_0x2d7eef(0x135)],_0x42e692);const _0x1c86c9=calculateJourneyDiff(_0x2c45e6,_0xa624f1);_0x511f5f[_0x2d7eef(0x1e2)]({'relativePath':_0x2c45e6['name'],'absolutePath':_0x546235,'yamlConfig':_0x2c45e6,'folderPath':_0x2456e6,'existingJourney':_0x5fc2a,'isNew':_0x1c86c9[_0x2d7eef(0x1fe)],'hasChanges':_0x1c86c9[_0x2d7eef(0x162)],'diff':_0x1c86c9[_0x2d7eef(0x204)]});}return{'journeyFiles':_0x511f5f,'foldersToCreate':_0x42e692};}export function calculateActivationActions(_0x10ce7d,_0x30e9d4,_0x126e7e,_0x5014ae){const _0x1fd88d=a100_0x2c6966,_0x25d527=[],_0x2b02a2=new Map();for(const _0x1cef90 of _0x30e9d4){_0x2b02a2[_0x1fd88d(0x1f0)](_0x1cef90[_0x1fd88d(0x141)],_0x1cef90);}const _0x501323=new Map();for(const _0x53699c of _0x10ce7d){_0x501323[_0x1fd88d(0x1f0)](_0x53699c[_0x1fd88d(0x141)],_0x53699c);}for(const _0x1f7b99 of _0x10ce7d){const _0x391d98=_0x2b02a2[_0x1fd88d(0x15b)](_0x1f7b99[_0x1fd88d(0x141)]);if(!_0x391d98)_0x25d527['push']({'type':_0x1fd88d(0x17f),'name':_0x1f7b99[_0x1fd88d(0x141)],'yamlActivation':_0x1f7b99});else{const _0x700ef0=activationResponseToDef(_0x391d98,_0x126e7e,_0x5014ae),_0x3e328c=a100_0x4d5033[_0x1fd88d(0x158)](_0x700ef0),_0x2f7a01=a100_0x4d5033[_0x1fd88d(0x158)](_0x1f7b99);_0x3e328c!==_0x2f7a01&&_0x25d527['push']({'type':'update','name':_0x1f7b99[_0x1fd88d(0x141)],'yamlActivation':_0x1f7b99,'existingActivation':_0x391d98});}}for(const _0x1680ac of _0x30e9d4){!_0x501323[_0x1fd88d(0x1c3)](_0x1680ac[_0x1fd88d(0x141)])&&_0x25d527[_0x1fd88d(0x1e2)]({'type':_0x1fd88d(0x1e8),'name':_0x1680ac[_0x1fd88d(0x141)],'existingActivation':_0x1680ac});}return _0x25d527;}export function calculateSegmentDiff(_0x41b2b2,_0x4572ef,_0x397fcf,_0x67cfe5,_0x51e633){const _0xfbbb91=segmentToYamlString(_0x41b2b2);if(_0x4572ef){const _0x588b10=segmentWithActivationsToYaml(_0x4572ef,_0x397fcf,undefined,_0x67cfe5,_0x51e633),_0x5eb22=segmentToYamlString(_0x588b10),_0x4b3271=generateDiff(_0x5eb22,_0xfbbb91),_0x37727a=hasChanges(_0x4b3271);return{'isNew':![],'hasChanges':_0x37727a,'diff':_0x37727a?formatDiffWithColors(_0x4b3271):undefined};}const _0x550a0a=generateDiff('',_0xfbbb91);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x550a0a)};}export function calculateJourneyDiff(_0x1bd5c2,_0x5564ea){const _0x37fc5b=normalizeJourneyDef(_0x1bd5c2,_0x1bd5c2),_0x112a57=a100_0x5d57b2(_0x37fc5b);if(_0x5564ea){const _0x211a4e=normalizeJourneyDef(_0x5564ea,_0x1bd5c2),_0x544fe7=a100_0x5d57b2(_0x211a4e),_0x3bea3b=generateDiff(_0x544fe7,_0x112a57),_0x4dd332=hasChanges(_0x3bea3b);return{'isNew':![],'hasChanges':_0x4dd332,'diff':_0x4dd332?formatDiffWithColors(_0x3bea3b):undefined};}const _0x30ffc8=generateDiff('',_0x112a57);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x30ffc8)};}export function findSegmentsToDelete(_0x24bad7,_0x5cf907,_0x449c7a,_0x32983e,_0x49518d){const _0x4cd0ac=a100_0x2c6966,_0x4f6968=new Set();for(const {yamlConfig:_0x54faf2,folderPath:_0x5c4090}of _0x5cf907){_0x4f6968[_0x4cd0ac(0x18c)](_0x5c4090+':'+_0x54faf2['name']);}return _0x24bad7[_0x4cd0ac(0x1e3)](_0x421ba0=>{const _0x555897=_0x4cd0ac,_0x475c28=_0x421ba0[_0x555897(0x126)]?_0x449c7a[_0x555897(0x15b)](_0x421ba0[_0x555897(0x126)][_0x555897(0x1a8)]())||'':'',_0x7327f1=_0x475c28+':'+_0x421ba0[_0x555897(0x141)];if(_0x4f6968[_0x555897(0x1c3)](_0x7327f1))return![];if(_0x49518d)return _0x475c28===_0x32983e||_0x475c28['startsWith'](_0x32983e+'/');return!![];});}function a100_0xc29c(){const _0x3dd3a3=['folderPathToId','643727GzppJe','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','NOT_FOUND','split','user','segments','activations','journey_updating','Activation\x20not\x20found:\x20','journeyStages','name','Updating\x20activation\x20\x27','size','folderPath','Stage\x20\x27','\x27\x20for\x20','journeys','segmentByFolderAndName','parentSegmentFolder','createdSegmentId','activation_','parse','Creating\x20activation\x20\x27','null','__pending_act_','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','129467OTiljD','getActivation','journey_creating','Deleting\x20activation\x20\x27','journey_entry_criteria_','nameToType','validatedRequest','stringify','existingSegment','parentId','get','DecisionPoint','folder_created','yamlConfig','Activation','existingActivation','connection','hasChanges','existingSegments','Fetching\x20','journey','WaitStep','activation_deleting','104462nZOFhS','connector_config','localSegmentRules','created','unchanged','columns','from','relative','):\x20','./journey-yaml.js','fetchJourney','getJourney','entryCriteria','resolveSegment','Updated\x20activation\x20\x27','reduce','notification','logSuccess','updateSegmentById','deleteActivation','segmentId','journeyBundleName','Created\x20journey\x20\x27','create','segmentNameToId','entry_criteria','Updating\x20segment\x20\x27','13997070BejPZo','entries','Failed\x20to\x20','max','rootFolderId','list','logWarning','901800dEcGrC','segment_updated','add','errors','attributes','42zrMELG','parentFolder','updateActivation','embedded_segment_creating','activation_created','activationContext','valid','deleted','createdSegmentIds','\x27\x20from\x20file:\x20','journeyId','onProgress','all_columns','JOURNEY_UPDATE_ERROR','ACTIVATION_UPDATE_ERROR','activation_updated','nameToId','connectionIdToNameMap','\x20journey\x20from\x20file:\x20','activation_deleted','createFolder','createSegment','activationActions','existingJourney','update','toString','behavior','Created\x20activation\x20\x27','deleteSegment','folderId','journeyActivationNameToId','stage\x20\x27','Entry\x20criteria:\x20','flatMap','Deleted\x20segment\x20\x27','kind','progress','exitCriterias','map','embeddedSegmentNameToId','sha1','\x0a\x20\x20','action','Updated\x20segment\x20\x27','startsWith','goal','2560272EPoOIv','listActivations','trim','updated','withProgress','activationStepsById','has','20eLjBKj','Updated\x20journey\x20\x27','yamlActivation','JOURNEY_SYNTAX_ERROR','Deleted\x20activation\x20\x27','results','logDeleted','schedule','parseDocument','Creating\x20folder\x20\x27','item','rule','INTERNAL','verbose','segment_deleted','keys','\x27\x20not\x20found\x20in\x20journey\x20\x27','milestone','idToName','embedded_activation_creating','length','segment_deleting','Created\x20folder\x20\x27','createActivation','message','\x20(referenced\x20in\x20journey\x20','logInfo','journeyActivationStepId','stages','journey_updated','push','filter',').\x20','object','sort','branches','delete','slice','folder_creating','versionNumber','\x27\x20entry\x20criteria','segment','decision_point','waitCondition','set','dirname','SEGMENT_UPDATE_ERROR','relationships','SEGMENT_NOT_FOUND','segment_updating','replace','resolveJourneyId','steps','index','journeyById','skipSegments','includes','\x20activation\x20\x27','isNew','6329742JdbQss','data','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','absolutePath','getSegment','diff','\x27\x20wait\x20condition','Name\x20has\x20already\x20been\x20taken','Journey\x20\x27','join','SEGMENT_SYNTAX_ERROR','journeyBundlesByFolderAndName','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','idToEmailMap','\x27...','segmentFolderId','effectiveFolderId','../../utils/async.js','journey_created','__pending_','activation_template_id','activation_updating','Segment\x20not\x20found:\x20','toLowerCase','createJourneySegment','\x20segment\x20from\x20file:\x20','utf-8','description','find','type'];a100_0xc29c=function(){return _0x3dd3a3;};return a100_0xc29c();}export function findJourneysToDelete(_0x405051,_0x49aed2,_0x3d10bc,_0x340576,_0x40a849){const _0x581156=a100_0x2c6966,_0x26958d=new Set();for(const {yamlConfig:_0x179b64,folderPath:_0x347a1d}of _0x49aed2){_0x26958d[_0x581156(0x18c)](_0x347a1d+':'+_0x179b64[_0x581156(0x141)]);}return _0x405051['filter'](_0x59ecc4=>{const _0x2fc9c0=_0x581156,_0x29920f=_0x59ecc4[_0x2fc9c0(0x1ac)]?_0x3d10bc[_0x2fc9c0(0x15b)](_0x59ecc4[_0x2fc9c0(0x1ac)])||'':'',_0x4234b7=_0x29920f+':'+_0x59ecc4[_0x2fc9c0(0x17d)];if(_0x26958d[_0x2fc9c0(0x1c3)](_0x4234b7))return![];if(_0x40a849)return _0x29920f===_0x340576||_0x29920f[_0x2fc9c0(0x1bb)](_0x340576+'/');return!![];});}export function buildSegmentLookupMap(_0x2fc0e8,_0x4f50ca){const _0x30352c=a100_0x2c6966,_0x40f4a3=new Map();for(const _0x1eb5b8 of _0x2fc0e8){const _0xc9af2e=_0x1eb5b8[_0x30352c(0x126)]?_0x4f50ca[_0x30352c(0x15b)](_0x1eb5b8[_0x30352c(0x126)][_0x30352c(0x1a8)]())||'':'',_0x594c86=_0xc9af2e+':'+_0x1eb5b8[_0x30352c(0x141)];_0x40f4a3[_0x30352c(0x1f0)](_0x594c86,_0x1eb5b8);}return _0x40f4a3;}export function buildSegmentNameToIdMap(_0x4f3a92){const _0x58a033=new Map();for(const _0x460379 of _0x4f3a92){_0x58a033['set'](_0x460379['name'],_0x460379['id']);}return _0x58a033;}export function buildJourneyBundleLookupMap(_0x3fc685,_0x2b4758){const _0x183acb=a100_0x2c6966,_0x2bfe73=new Map();for(const _0x2baf28 of _0x3fc685){const _0x2f9469=_0x2baf28[_0x183acb(0x1ac)]?_0x2b4758['get'](_0x2baf28[_0x183acb(0x1ac)])||'':'',_0x4a9d85=_0x2f9469+':'+_0x2baf28[_0x183acb(0x17d)];!_0x2bfe73[_0x183acb(0x1c3)](_0x4a9d85)&&_0x2bfe73[_0x183acb(0x1f0)](_0x4a9d85,[]),_0x2bfe73[_0x183acb(0x15b)](_0x4a9d85)[_0x183acb(0x1e2)](_0x2baf28);}for(const _0x23d609 of _0x2bfe73['values']()){_0x23d609[_0x183acb(0x1e6)]((_0x410ed6,_0x461477)=>(_0x410ed6['versionNumber']||0x0)-(_0x461477[_0x183acb(0x1eb)]||0x0));}return _0x2bfe73;}export function collectFoldersToCreate(_0x5769b3,_0x142782){const _0x4e296f=a100_0x2c6966,_0x566e5f=new Set();for(const _0xc6b7fb of _0x5769b3){if(!_0xc6b7fb)continue;if(_0x142782['has'](_0xc6b7fb))continue;const _0x1a47f1=_0xc6b7fb[_0x4e296f(0x13a)]('/');let _0x3ca88e='';for(const _0x4dcb45 of _0x1a47f1){_0x3ca88e=_0x3ca88e?_0x3ca88e+'/'+_0x4dcb45:_0x4dcb45,!_0x142782['has'](_0x3ca88e)&&_0x566e5f['add'](_0x3ca88e);}}return _0x566e5f;}export function parseAndClassifyYamlFiles(_0x48bb48,_0x4f4d85,_0x5992ff){const _0x48c3cf=a100_0x2c6966,_0x73cd73=[],_0x5004fc=[];for(const _0x2b6451 of _0x48bb48){const _0x58ede7=a100_0x2afdb9[_0x48c3cf(0x16f)](_0x4f4d85,a100_0x2afdb9[_0x48c3cf(0x1f1)](_0x2b6451)),_0x49ac6f=_0x58ede7==='.'?'':_0x58ede7,_0xf812d7=readFileSync(_0x2b6451,_0x48c3cf(0x131)),_0x17e0d3=a100_0x4d5033[_0x48c3cf(0x14c)](_0xf812d7);if(isJourneyDef(_0x17e0d3)){const _0x309801=a100_0x31baf0(_0xf812d7);_0x5004fc['push']({'yamlConfig':_0x309801,'folderPath':_0x49ac6f,'sourcePath':_0x2b6451});}else{if(!_0x5992ff?.[_0x48c3cf(0x1fb)]){const _0x266bf9=parseSegmentYamlFile(_0xf812d7),_0x501599=normalizeChildSegmentYaml(_0x266bf9);_0x73cd73[_0x48c3cf(0x1e2)]({'yamlConfig':_0x501599,'folderPath':_0x49ac6f,'sourcePath':_0x2b6451});}}}return{'segments':_0x73cd73,'journeys':_0x5004fc};}export function validateParsedFiles(_0x59ce4e,_0x455acd){const _0x54db29=a100_0x2c6966,_0x175b89=[];for(const {yamlConfig:_0x2cd831,sourcePath:_0x5f050d}of _0x59ce4e[_0x54db29(0x13c)]){const _0x3738e3=readFileSync(_0x5f050d,_0x54db29(0x131)),_0x34ffe7=a100_0x4d5033[_0x54db29(0x1cc)](_0x3738e3),_0x204151=validateSegmentDef(_0x2cd831,{'source':_0x3738e3,'document':_0x34ffe7});if(!_0x204151[_0x54db29(0x195)]){const _0x119c9a=a100_0x2afdb9[_0x54db29(0x16f)](_0x455acd,_0x5f050d);_0x175b89['push']({'filePath':_0x119c9a,'source':_0x3738e3,'result':_0x204151,'isJourney':![]});}}for(const {yamlConfig:_0x16e817,sourcePath:_0x35c427}of _0x59ce4e['journeys']){const _0x490a1a=readFileSync(_0x35c427,_0x54db29(0x131)),_0x3a80c0=a100_0x4d5033[_0x54db29(0x1cc)](_0x490a1a),_0x535e4d=validateJourneyDef(_0x16e817,{'source':_0x490a1a,'document':_0x3a80c0});if(!_0x535e4d['valid']){const _0x2575ee=a100_0x2afdb9[_0x54db29(0x16f)](_0x455acd,_0x35c427);_0x175b89[_0x54db29(0x1e2)]({'filePath':_0x2575ee,'source':_0x490a1a,'result':_0x535e4d,'isJourney':!![]});}}return _0x175b89;}export function formatValidationErrors(_0x33674b){const _0x665e61=a100_0x2c6966,_0x277816=[];for(const {filePath:_0xb14679,source:_0x3efd3b,result:_0x5a1f2e,isJourney:_0x43c5f5}of _0x33674b){const _0x340e8b=_0x43c5f5?_0x665e61(0x165):_0x665e61(0x1ed);_0x277816[_0x665e61(0x1e2)]('\x0a'+_0xb14679+'\x20('+_0x340e8b+_0x665e61(0x170)+_0x5a1f2e[_0x665e61(0x18d)]['length']+'\x20error(s)'),_0x277816[_0x665e61(0x1e2)](formatValidationResult(_0x5a1f2e,_0x3efd3b,_0xb14679));}return _0x277816['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x181688){const _0x76bba3=a100_0x2c6966,_0x17dda3=new Set(),_0x176165=new Map(),_0x4f4328=collectSegmentUsageCounts(_0x181688);if(_0x181688[_0x76bba3(0x13c)])for(const [_0x597bc9,_0x344055]of Object[_0x76bba3(0x184)](_0x181688['segments'])){_0x17dda3[_0x76bba3(0x18c)](_0x597bc9);if(_0x344055[_0x76bba3(0x1cf)]){const _0x441870=yamlRuleToApi(_0x344055['rule']),_0x40e8ff=apiRuleToYaml(_0x441870);_0x176165[_0x76bba3(0x1f0)](_0x597bc9,_0x40e8ff);}}const _0x48753b=new Map();let _0x47e397=0x0;for(const [_0x249246,_0x98e36f]of _0x176165){const _0x9fbda2=serializeExpandedRule(_0x98e36f,_0x176165),_0x5354be=_0x48753b[_0x76bba3(0x15b)](_0x9fbda2)||[];_0x5354be[_0x76bba3(0x1e2)]({'name':_0x249246,'index':_0x47e397}),_0x48753b[_0x76bba3(0x1f0)](_0x9fbda2,_0x5354be),_0x47e397++;}const _0x14dcac=new Map();for(const [_0x308968,_0x1acc55]of _0x48753b){const _0x1d3c5b=_0x1acc55[_0x76bba3(0x1e9)]()[_0x76bba3(0x1e6)]((_0xc91148,_0x54baf6)=>{const _0x237838=_0x76bba3,_0x267218=_0x4f4328[_0x237838(0x15b)](_0xc91148[_0x237838(0x141)])||0x0,_0xa88ab0=_0x4f4328[_0x237838(0x15b)](_0x54baf6[_0x237838(0x141)])||0x0;if(_0x267218!==_0xa88ab0)return _0xa88ab0-_0x267218;return _0xc91148[_0x237838(0x1f9)]-_0x54baf6['index'];})[_0x76bba3(0x1b5)](_0x35e4df=>_0x35e4df['name']),_0x5c3e93=[];for(const _0x1bc31f of _0x1d3c5b){const _0x5b1aa8=_0x4f4328[_0x76bba3(0x15b)](_0x1bc31f)||0x0,_0x16d6e3=Math[_0x76bba3(0x186)](_0x5b1aa8,0x1);for(let _0x4a629e=0x0;_0x4a629e<_0x16d6e3;_0x4a629e++){_0x5c3e93[_0x76bba3(0x1e2)](_0x1bc31f);}}_0x14dcac[_0x76bba3(0x1f0)](_0x308968,_0x5c3e93);}return{'existingLocalSegmentNames':_0x17dda3,'localSegmentRules':_0x176165,'localExpandedRuleToNames':_0x14dcac};}async function buildServerSegmentRuleMap(_0xe923f6,_0x3b92f2,_0x217f43,_0x31baba){const _0x16d1aa=new Map(),_0x4e8b4d=new Set(),_0x57e489=async _0x170d96=>{const _0x49dc0d=a100_0x1a9a;if(_0x4e8b4d[_0x49dc0d(0x1c3)](_0x170d96))return;_0x4e8b4d['add'](_0x170d96);let _0x37a11a=_0x217f43[_0x49dc0d(0x133)](_0x13d12f=>_0x13d12f['id']===_0x170d96);if(!_0x37a11a)try{_0x37a11a=await _0xe923f6[_0x49dc0d(0x1ed)][_0x49dc0d(0x203)](_0x3b92f2,_0x170d96);}catch{return;}if(!_0x37a11a?.[_0x49dc0d(0x1cf)])return;const _0x38766a=apiRuleToYaml(_0x37a11a[_0x49dc0d(0x1cf)]);_0x16d1aa[_0x49dc0d(0x1f0)](_0x170d96,_0x38766a);const _0x10b227=collectSegmentRefsFromRule(_0x38766a);for(const _0x2bc660 of _0x10b227){await _0x57e489(_0x2bc660);}};for(const _0x4550f5 of _0x31baba){await _0x57e489(_0x4550f5);}return _0x16d1aa;}export function createSegmentIdResolver(_0x542a50,_0x535e19){return async _0x34d329=>{const _0x2fe15d=a100_0x1a9a,_0x4a3631=_0x542a50[_0x2fe15d(0x15b)](_0x34d329);if(!_0x4a3631)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2fe15d(0x12d)+_0x34d329+_0x2fe15d(0x123)+_0x535e19+'\x27)');return _0x4a3631;};}export function extractRootFolderId(_0x47a155){const _0x33c9fd=a100_0x2c6966;return _0x47a155['relationships']?.[_0x33c9fd(0x149)]?.['data']?.['id']||_0x47a155[_0x33c9fd(0x1f3)]?.[_0x33c9fd(0x190)]?.[_0x33c9fd(0x200)]?.['id'];}export function buildConnectionMaps(_0x4189ff){const _0x5b3019=a100_0x2c6966,_0x55c0a4=new Map(),_0x2196de=new Map(),_0x5b2288=new Map();for(const _0x2c65c3 of _0x4189ff){_0x55c0a4[_0x5b3019(0x1f0)](_0x2c65c3[_0x5b3019(0x141)],parseInt(_0x2c65c3['id'],0xa)),_0x2196de[_0x5b3019(0x1f0)](_0x2c65c3['id'],_0x2c65c3[_0x5b3019(0x141)]),_0x5b2288['set'](_0x2c65c3['name'],_0x2c65c3['type']);}return{'nameToId':_0x55c0a4,'idToName':_0x2196de,'nameToType':_0x5b2288};}export function calculatePushStats(_0x5db953,_0x4c17b4,_0x99d5dd,_0x4976e8,_0x36d7fd,_0x32e070,_0x1c038f){const _0x59151=a100_0x2c6966,_0x109394=_0x5db953[_0x59151(0x1e3)](_0x420223=>_0x420223[_0x59151(0x1fe)]),_0x45d844=_0x5db953[_0x59151(0x1e3)](_0x42ccc9=>!_0x42ccc9['isNew']&&_0x42ccc9[_0x59151(0x162)]),_0x12b18f=_0x5db953[_0x59151(0x1e3)](_0xe66fbc=>!_0xe66fbc[_0x59151(0x1fe)]&&!_0xe66fbc['hasChanges']),_0x29f608=_0x32e070?_0x4976e8:[],_0x56a827=_0x4c17b4[_0x59151(0x1e3)](_0x59238d=>_0x59238d[_0x59151(0x1fe)]),_0xe2b0c=_0x4c17b4[_0x59151(0x1e3)](_0x6735a3=>!_0x6735a3[_0x59151(0x1fe)]&&_0x6735a3[_0x59151(0x162)]),_0xd17fa2=_0x4c17b4[_0x59151(0x1e3)](_0x528389=>!_0x528389[_0x59151(0x1fe)]&&!_0x528389[_0x59151(0x162)]),_0x23b378=_0x32e070?_0x36d7fd:[],_0x4a3e74=_0x5db953[_0x59151(0x1b0)](_0x5736d8=>_0x5736d8[_0x59151(0x1a5)]),_0x499e28=_0x4a3e74[_0x59151(0x1e3)](_0x1cf1d9=>_0x1cf1d9[_0x59151(0x134)]===_0x59151(0x17f)),_0x14213b=_0x4a3e74[_0x59151(0x1e3)](_0x54570c=>_0x54570c[_0x59151(0x134)]===_0x59151(0x1a7)),_0xaebe83=_0x4a3e74['filter'](_0x15b2e1=>_0x15b2e1[_0x59151(0x134)]==='delete'),_0x8130cd=Array[_0x59151(0x16e)](_0x99d5dd)['sort'](),_0x35fc6b=_0x1c038f?![]:_0x109394[_0x59151(0x1d8)]>0x0||_0x45d844[_0x59151(0x1d8)]>0x0||_0x29f608[_0x59151(0x1d8)]>0x0,_0x301fb4=_0x56a827[_0x59151(0x1d8)]>0x0||_0xe2b0c['length']>0x0||_0x23b378[_0x59151(0x1d8)]>0x0,_0xaf62ee=_0x1c038f?![]:_0x4a3e74[_0x59151(0x1d8)]>0x0,_0x55bf72=_0x8130cd[_0x59151(0x1d8)]>0x0;return{'segments':{'new':_0x109394,'changed':_0x45d844,'unchanged':_0x12b18f,'toDelete':_0x29f608},'journeys':{'new':_0x56a827,'changed':_0xe2b0c,'unchanged':_0xd17fa2,'toDelete':_0x23b378},'activations':{'all':_0x4a3e74,'toCreate':_0x499e28,'toUpdate':_0x14213b,'toDelete':_0xaebe83},'folders':{'toCreate':_0x8130cd},'counts':{'segments':{'new':_0x109394[_0x59151(0x1d8)],'changed':_0x45d844['length'],'unchanged':_0x12b18f[_0x59151(0x1d8)],'toDelete':_0x29f608[_0x59151(0x1d8)]},'journeys':{'new':_0x56a827[_0x59151(0x1d8)],'changed':_0xe2b0c[_0x59151(0x1d8)],'unchanged':_0xd17fa2['length'],'toDelete':_0x23b378[_0x59151(0x1d8)]},'activations':{'create':_0x499e28[_0x59151(0x1d8)],'update':_0x14213b[_0x59151(0x1d8)],'delete':_0xaebe83[_0x59151(0x1d8)]},'folders':_0x8130cd['length']},'hasChanges':_0x35fc6b||_0x301fb4||_0xaf62ee||_0x55bf72};}export async function buildPushExecutionContext(_0x550c3a,_0x3750fd,_0x34cdce,_0x36cd8e,_0x542c84,_0x4d35d3){const _0x10404a=a100_0x2c6966,_0x38c27a=extractRootFolderId(_0x34cdce),{pathToId:_0x540db,idToPath:_0x2f4ae1}=buildFolderMaps(_0x542c84),_0x557db4=buildSegmentNameToIdMap(_0x36cd8e),_0x43e659=new Map(),{batchAsync:_0x18790d}=await import(_0x10404a(0x128)),[_0x486eb6,_0x43da40]=await Promise['all']([_0x550c3a[_0x10404a(0x13b)]['buildUserMaps'](),_0x550c3a[_0x10404a(0x161)][_0x10404a(0x188)](),((async()=>{!_0x4d35d3&&_0x36cd8e['length']>0x0&&await _0x18790d(_0x36cd8e,async _0x19008f=>{const _0x2819e0=a100_0x1a9a,_0x27c654=await _0x550c3a['segment'][_0x2819e0(0x1be)](_0x3750fd,_0x19008f['id']);_0x43e659[_0x2819e0(0x1f0)](_0x19008f['id'],_0x27c654);});})())]),{emailToId:_0x20dec5,idToEmail:_0x586d8d}=_0x486eb6,_0x3de31b=buildConnectionMaps(_0x43da40);return{'rootFolderId':_0x38c27a,'folderPathToId':_0x540db,'folderIdToPath':_0x2f4ae1,'segmentNameToId':_0x557db4,'activationsBySegmentId':_0x43e659,'emailToIdMap':_0x20dec5,'idToEmailMap':_0x586d8d,'connectionNameToIdMap':_0x3de31b[_0x10404a(0x19f)],'connectionIdToNameMap':_0x3de31b[_0x10404a(0x1d6)],'connectionNameToTypeMap':_0x3de31b[_0x10404a(0x156)]};}export function createPushYamlContextForBundle(_0x2839fb,_0x726bdf,_0x413e7d,_0x35f02e,_0x102c17,_0x40ef97,_0x3e0075,_0x1721c2){const {existingLocalSegmentNames:_0x1c7463,localExpandedRuleToNames:_0x284dba}=_0x35f02e,_0x285720=new Set(),_0x20e751=new Map(),_0x17a420=new Map(),_0x26b65d=new Map(),_0x12b90b=createJumpTargetCache(),_0x52c99f=new Map(),_0x568233=new Map(),_0x2a0089=new Set();let _0x54ec88;const _0x5b85ff=_0x214cc9=>{const _0x4e33a4={'resolveSegment':async _0x24ffe5=>{const _0x5e9db4=a100_0x1a9a,_0x44e583=_0x26b65d[_0x5e9db4(0x15b)](_0x24ffe5);if(_0x44e583!==undefined)return{'name':_0x44e583,'isJourneyLocal':!![]};try{let _0x307394=_0x413e7d[_0x5e9db4(0x133)](_0x25dc34=>_0x25dc34['id']===_0x24ffe5);!_0x307394&&(_0x307394=await _0x2839fb[_0x5e9db4(0x1ed)][_0x5e9db4(0x203)](_0x726bdf,_0x24ffe5));const _0x22d281=generateJourneyLocalName(_0x307394[_0x5e9db4(0x141)]),_0x5e31bf=_0x307394[_0x5e9db4(0x1b2)]===SEGMENT_KIND_JOURNEY&&_0x22d281!==undefined;let _0x166f4d=_0x307394[_0x5e9db4(0x141)],_0x2b1875;if(_0x5e31bf&&_0x307394[_0x5e9db4(0x1cf)]){const _0x13c08f=apiRuleToYaml(_0x307394[_0x5e9db4(0x1cf)]);_0x568233[_0x5e9db4(0x1f0)](_0x24ffe5,_0x13c08f);const _0x7f8d46=async _0x2a1607=>{const _0x4336be=_0x5e9db4,_0xf8922=collectSegmentRefsFromRule(_0x2a1607);for(const _0x411d07 of _0xf8922){if(!_0x568233[_0x4336be(0x1c3)](_0x411d07))try{const _0x5beaeb=await _0x2839fb[_0x4336be(0x1ed)]['getSegment'](_0x726bdf,_0x411d07);if(_0x5beaeb?.[_0x4336be(0x1cf)]){const _0x4870e6=apiRuleToYaml(_0x5beaeb[_0x4336be(0x1cf)]);_0x568233['set'](_0x411d07,_0x4870e6),await _0x7f8d46(_0x4870e6);}}catch{}}};await _0x7f8d46(_0x13c08f);const _0x45e68d=serializeExpandedRule(_0x13c08f,_0x568233),_0x4f88fd=_0x284dba[_0x5e9db4(0x15b)](_0x45e68d);if(_0x4f88fd&&_0x4f88fd[_0x5e9db4(0x1d8)]>0x0){const _0x2af351=_0x20e751['get'](_0x45e68d)||0x0,_0x1c4664=_0x4f88fd[_0x2af351]||_0x4f88fd[_0x4f88fd[_0x5e9db4(0x1d8)]-0x1];_0x20e751['set'](_0x45e68d,_0x2af351+0x1),_0x166f4d=_0x1c4664,_0x285720[_0x5e9db4(0x18c)](_0x166f4d),_0x26b65d[_0x5e9db4(0x1f0)](_0x24ffe5,_0x166f4d);const _0x1feec6=await resolveRuleSegmentRefs(_0x13c08f,async _0x3adde8=>{const _0x5272dc=_0x5e9db4,_0x193cae=_0x26b65d[_0x5272dc(0x15b)](_0x3adde8);if(_0x193cae)return _0x193cae;const _0x5be809=await _0x54ec88[_0x5272dc(0x175)](_0x3adde8);return _0x5be809[_0x5272dc(0x141)];});_0x2b1875={'description':_0x307394['description'],'rule':_0x1feec6};}else{const _0x2fbbf1=_0x52c99f[_0x5e9db4(0x15b)](_0x45e68d);if(_0x2fbbf1)_0x166f4d=_0x2fbbf1,_0x26b65d['set'](_0x24ffe5,_0x166f4d);else{if(_0x22d281){let _0x2f06d2=_0x22d281,_0x136b8f=0x2;while(_0x285720[_0x5e9db4(0x1c3)](_0x2f06d2)||_0x1c7463['has'](_0x2f06d2)){_0x2f06d2=_0x22d281+'_'+_0x136b8f,_0x136b8f++;}_0x285720[_0x5e9db4(0x18c)](_0x2f06d2),_0x166f4d=_0x2f06d2;}_0x26b65d['set'](_0x24ffe5,_0x166f4d),_0x52c99f[_0x5e9db4(0x1f0)](_0x45e68d,_0x166f4d);const _0x37a15f=await resolveRuleSegmentRefs(_0x13c08f,async _0x5a48c0=>{const _0x22daff=_0x5e9db4,_0x35a6c3=_0x26b65d[_0x22daff(0x15b)](_0x5a48c0);if(_0x35a6c3)return _0x35a6c3;const _0x5bce13=await _0x54ec88[_0x22daff(0x175)](_0x5a48c0);return _0x5bce13[_0x22daff(0x141)];});_0x2b1875={'description':_0x307394['description'],'rule':_0x37a15f};}}}return{'name':_0x166f4d,'isJourneyLocal':_0x5e31bf,'definition':_0x2b1875};}catch{return{'name':_0x24ffe5,'isJourneyLocal':![]};}},'resolveActivation':async _0x474ba3=>{const _0x3f91b1=a100_0x1a9a,_0x162f00=_0x17a420[_0x3f91b1(0x15b)](_0x474ba3);if(_0x162f00!==undefined)return{'name':_0x162f00,'isJourneyLocal':!![]};try{let _0x480f05=_0x3e0075?.['get'](_0x474ba3);!_0x480f05&&(_0x480f05=await _0x2839fb[_0x3f91b1(0x165)][_0x3f91b1(0x152)](_0x214cc9,_0x474ba3));const _0x528feb=_0x480f05[_0x3f91b1(0x18e)]['activationParams'][_0x3f91b1(0x141)]||_0x474ba3,_0x52389f=sanitizeYamlKey(_0x528feb)||_0x3f91b1(0x14b)+_0x474ba3,_0x47ea7e=_0x52389f;_0x17a420[_0x3f91b1(0x1f0)](_0x474ba3,_0x47ea7e);const _0x34d30e=journeyActivationStepToYaml(_0x480f05,_0x102c17,_0x40ef97);return{'name':_0x47ea7e,'isJourneyLocal':!![],'definition':_0x34d30e};}catch{return{'name':_0x474ba3,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x508292,_0x2c401a)=>resolveJumpTarget(_0x508292,_0x2c401a,_0x12b90b,async _0x361f4f=>{const _0x128fbe=a100_0x1a9a,_0x3e1936=_0x1721c2?.[_0x128fbe(0x15b)](_0x361f4f);if(_0x3e1936)return _0x3e1936;return _0x2839fb[_0x128fbe(0x165)][_0x128fbe(0x173)](_0x361f4f);})};return _0x54ec88=_0x4e33a4,_0x4e33a4;},_0x5bffe9=async _0x107f01=>{const _0x2ff62b=a100_0x1a9a,{collectSegmentIdsFromJourneyApi:_0x30ac08}=await import(_0x2ff62b(0x171)),{batchAsync:_0x3f041b}=await import(_0x2ff62b(0x128)),_0x22ca48=new Set();for(const _0xdc2f2b of _0x107f01){let _0x36b2f6=_0x1721c2?.[_0x2ff62b(0x15b)](_0xdc2f2b);!_0x36b2f6&&(_0x36b2f6=await _0x2839fb[_0x2ff62b(0x165)][_0x2ff62b(0x173)](_0xdc2f2b));const _0x125afa=_0x30ac08(_0x36b2f6);for(const _0x43d959 of _0x125afa){_0x22ca48[_0x2ff62b(0x18c)](_0x43d959);}}let _0x976323=Array[_0x2ff62b(0x16e)](_0x22ca48);while(_0x976323[_0x2ff62b(0x1d8)]>0x0){const _0x642fdb=_0x976323[_0x2ff62b(0x1e3)](_0xdcf912=>!_0x2a0089[_0x2ff62b(0x1c3)](_0xdcf912));if(_0x642fdb[_0x2ff62b(0x1d8)]===0x0)break;const _0xb0bef9=await _0x3f041b(_0x642fdb,async _0xfd2ed6=>{const _0x41fd1d=_0x2ff62b;_0x2a0089[_0x41fd1d(0x18c)](_0xfd2ed6);let _0x3ae1ce=_0x413e7d[_0x41fd1d(0x133)](_0x1ea704=>_0x1ea704['id']===_0xfd2ed6);if(!_0x3ae1ce)try{_0x3ae1ce=await _0x2839fb['segment'][_0x41fd1d(0x203)](_0x726bdf,_0xfd2ed6);}catch{return null;}return{'segmentId':_0xfd2ed6,'segment':_0x3ae1ce};},0xa),_0xee5e1c=new Set();for(const _0x175825 of _0xb0bef9){if(!_0x175825?.[_0x2ff62b(0x1ed)]?.[_0x2ff62b(0x1cf)])continue;const _0x53f6e4=apiRuleToYaml(_0x175825[_0x2ff62b(0x1ed)][_0x2ff62b(0x1cf)]);_0x568233[_0x2ff62b(0x1f0)](_0x175825['segmentId'],_0x53f6e4);const _0x128cc1=collectSegmentRefsFromRule(_0x53f6e4);for(const _0x55e877 of _0x128cc1){!_0x2a0089[_0x2ff62b(0x1c3)](_0x55e877)&&_0xee5e1c[_0x2ff62b(0x18c)](_0x55e877);}}_0x976323=Array[_0x2ff62b(0x16e)](_0xee5e1c);}};return{'createYamlContext':_0x5b85ff,'prefetchJourneySegments':_0x5bffe9};}export async function executePushSegments(_0x3050cf,_0x35f422,_0x290fc8,_0x46be33,_0x21a96b){const _0x4bec79=a100_0x2c6966,{segmentDefToCreateRequest:_0x5bf96c,segmentDefToUpdateRequest:_0xceb7ed}=await import('./child-segment-yaml.js'),_0x33ff1e=_0x290fc8[_0x4bec79(0x135)],_0x285d2c=0x5,_0x52a029=async _0x4a5271=>{const _0xf355ff=_0x4bec79,_0x2701c4=_0x4a5271['folderPath']?_0x33ff1e['get'](_0x4a5271['folderPath']):undefined;let _0x219d53;const _0x39964a={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x4a5271['isNew']){_0x21a96b['onProgress']?.({'type':'segment_creating','name':_0x4a5271['yamlConfig']['name']});const _0x423e8e=_0x5bf96c(_0x4a5271['yamlConfig'],_0x2701c4),_0x7f2188=await _0x21a96b[_0xf355ff(0x1c1)]('Creating\x20segment\x20\x27'+_0x4a5271['yamlConfig'][_0xf355ff(0x141)]+'\x27...',()=>_0x3050cf[_0xf355ff(0x1ed)][_0xf355ff(0x1a4)](_0x46be33[_0xf355ff(0x15a)],_0x423e8e));_0x219d53=_0x7f2188[_0xf355ff(0x200)]['id'],_0x39964a[_0xf355ff(0x14a)]={'name':_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)],'id':_0x219d53},_0x21a96b[_0xf355ff(0x19a)]?.({'type':'segment_created','name':_0x4a5271['yamlConfig']['name'],'segmentId':_0x219d53}),_0x21a96b[_0xf355ff(0x179)]?.('Created\x20segment\x20\x27'+_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]+'\x27'),_0x39964a[_0xf355ff(0x16b)]=0x1;}else{if(_0x4a5271['hasChanges']){_0x21a96b['onProgress']?.({'type':_0xf355ff(0x1f5),'name':_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]});const _0x5c4258=_0xceb7ed(_0x4a5271[_0xf355ff(0x15e)]);_0x2701c4!==_0x4a5271['existingSegment']?.[_0xf355ff(0x126)]&&(_0x5c4258['segmentFolderId']=_0x2701c4?parseInt(_0x2701c4,0xa):undefined),await _0x21a96b[_0xf355ff(0x1c1)](_0xf355ff(0x182)+_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]+_0xf355ff(0x125),()=>_0x3050cf[_0xf355ff(0x1ed)][_0xf355ff(0x17a)](_0x46be33[_0xf355ff(0x15a)],_0x4a5271[_0xf355ff(0x159)]['id'],_0x5c4258)),_0x219d53=_0x4a5271[_0xf355ff(0x159)]['id'],_0x21a96b[_0xf355ff(0x19a)]?.({'type':_0xf355ff(0x18b),'name':_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]}),_0x21a96b[_0xf355ff(0x179)]?.(_0xf355ff(0x1ba)+_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]+'\x27'),_0x39964a['updated']=0x1;}else _0x219d53=_0x4a5271[_0xf355ff(0x159)]['id'];}}catch(_0x3c9986){const _0x520a4e=isHttp400Error(_0x3c9986),_0x41ae7a=_0x520a4e?ErrorCode[_0xf355ff(0x121)]:ErrorCode[_0xf355ff(0x1f2)],_0x2afff5=getErrorMessage(_0x3c9986);throw new SDKError(_0x41ae7a,_0xf355ff(0x185)+(_0x4a5271['isNew']?_0xf355ff(0x17f):_0xf355ff(0x1a7))+_0xf355ff(0x130)+_0x4a5271[_0xf355ff(0x202)]+_0xf355ff(0x1b8)+_0x2afff5,_0x3c9986);}try{const _0x5ca10f=await syncActivationsForSegment(_0x3050cf,_0x46be33[_0xf355ff(0x15a)],_0x219d53,_0x4a5271['yamlConfig'][_0xf355ff(0x141)],_0x4a5271[_0xf355ff(0x1a5)],_0x21a96b,_0x4a5271['absolutePath']);_0x39964a[_0xf355ff(0x13d)]=_0x5ca10f;}catch(_0x1fd7cc){if(_0x1fd7cc instanceof SDKError)throw _0x1fd7cc;throw new SDKError(ErrorCode[_0xf355ff(0x19d)],_0xf355ff(0x201)+_0x4a5271['yamlConfig'][_0xf355ff(0x141)]+_0xf355ff(0x198)+_0x4a5271[_0xf355ff(0x202)]+_0xf355ff(0x1b8)+getErrorMessage(_0x1fd7cc),_0x1fd7cc);}return _0x39964a;},_0x4c7465=await batchAsync(_0x35f422,_0x52a029,_0x285d2c),_0x562fa6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x19e8f4 of _0x4c7465){_0x562fa6[_0x4bec79(0x16b)]+=_0x19e8f4[_0x4bec79(0x16b)],_0x562fa6[_0x4bec79(0x1c0)]+=_0x19e8f4['updated'],_0x19e8f4[_0x4bec79(0x14a)]&&_0x562fa6[_0x4bec79(0x197)][_0x4bec79(0x1f0)](_0x19e8f4[_0x4bec79(0x14a)][_0x4bec79(0x141)],_0x19e8f4[_0x4bec79(0x14a)]['id']),_0x562fa6['activations'][_0x4bec79(0x16b)]+=_0x19e8f4[_0x4bec79(0x13d)][_0x4bec79(0x16b)],_0x562fa6[_0x4bec79(0x13d)][_0x4bec79(0x1c0)]+=_0x19e8f4[_0x4bec79(0x13d)][_0x4bec79(0x1c0)],_0x562fa6[_0x4bec79(0x13d)][_0x4bec79(0x196)]+=_0x19e8f4[_0x4bec79(0x13d)][_0x4bec79(0x196)];}return _0x562fa6;}async function syncActivationsForSegment(_0x31c8d1,_0x26b714,_0x643687,_0x1dc78e,_0x45ec5d,_0x3ffa3b,_0x4d61a4){const _0x189d60=a100_0x2c6966,_0x12a559={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1c9abc of _0x45ec5d){try{if(_0x1c9abc[_0x189d60(0x134)]===_0x189d60(0x17f)&&_0x1c9abc[_0x189d60(0x157)])_0x3ffa3b['onProgress']?.({'type':'activation_creating','segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),await _0x3ffa3b[_0x189d60(0x1c1)](_0x189d60(0x14d)+_0x1c9abc['name']+'\x27...',()=>_0x31c8d1[_0x189d60(0x1ed)][_0x189d60(0x1db)](_0x26b714,_0x643687,_0x1c9abc[_0x189d60(0x157)])),_0x3ffa3b[_0x189d60(0x19a)]?.({'type':_0x189d60(0x193),'segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),_0x3ffa3b['logSuccess']?.(_0x189d60(0x1aa)+_0x1c9abc[_0x189d60(0x141)]+'\x27'),_0x12a559[_0x189d60(0x16b)]++;else{if(_0x1c9abc[_0x189d60(0x134)]==='update'&&_0x1c9abc[_0x189d60(0x157)]&&_0x1c9abc[_0x189d60(0x160)])_0x3ffa3b['onProgress']?.({'type':_0x189d60(0x12c),'segmentName':_0x1dc78e,'activationName':_0x1c9abc['name']}),await _0x3ffa3b['withProgress'](_0x189d60(0x142)+_0x1c9abc[_0x189d60(0x141)]+'\x27...',()=>_0x31c8d1[_0x189d60(0x1ed)][_0x189d60(0x191)](_0x26b714,_0x643687,_0x1c9abc[_0x189d60(0x160)]['id'],_0x1c9abc[_0x189d60(0x157)])),_0x3ffa3b['onProgress']?.({'type':_0x189d60(0x19e),'segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),_0x3ffa3b[_0x189d60(0x179)]?.(_0x189d60(0x176)+_0x1c9abc[_0x189d60(0x141)]+'\x27'),_0x12a559[_0x189d60(0x1c0)]++;else _0x1c9abc['type']===_0x189d60(0x1e8)&&_0x1c9abc[_0x189d60(0x160)]&&(_0x3ffa3b[_0x189d60(0x19a)]?.({'type':_0x189d60(0x167),'segmentName':_0x1dc78e,'activationName':_0x1c9abc['name']}),await _0x3ffa3b[_0x189d60(0x1c1)](_0x189d60(0x154)+_0x1c9abc[_0x189d60(0x141)]+_0x189d60(0x125),()=>_0x31c8d1[_0x189d60(0x1ed)][_0x189d60(0x17b)](_0x26b714,_0x643687,_0x1c9abc[_0x189d60(0x160)]['id'])),_0x3ffa3b['onProgress']?.({'type':_0x189d60(0x1a2),'segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),_0x3ffa3b[_0x189d60(0x1ca)]?.(_0x189d60(0x1c8)+_0x1c9abc[_0x189d60(0x141)]+'\x27'),_0x12a559[_0x189d60(0x196)]++);}}catch(_0x59a2e1){const _0x4bd094=isHttp400Error(_0x59a2e1),_0x2e9072=_0x4bd094?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x189d60(0x19d)],_0x36ce53=getErrorMessage(_0x59a2e1);throw new SDKError(_0x2e9072,_0x189d60(0x185)+_0x1c9abc[_0x189d60(0x134)]+_0x189d60(0x1fd)+_0x1c9abc[_0x189d60(0x141)]+_0x189d60(0x198)+_0x4d61a4+_0x189d60(0x1b8)+_0x36ce53,_0x59a2e1);}}return _0x12a559;}export async function executePushFolders(_0x5706c1,_0x566a17,_0x1396cd,_0x5e29a5,_0x388914){const _0x176c03=a100_0x2c6966,_0x42a2b1=new Map(_0x1396cd);for(const _0x371d8c of _0x566a17){const _0x4cc009=_0x371d8c[_0x176c03(0x13a)]('/'),_0xb75d00=_0x4cc009[_0x4cc009[_0x176c03(0x1d8)]-0x1],_0x36be52=_0x4cc009[_0x176c03(0x1e9)](0x0,-0x1)[_0x176c03(0x120)]('/'),_0x3c635c=_0x42a2b1[_0x176c03(0x15b)](_0x36be52);_0x388914[_0x176c03(0x19a)]?.({'type':_0x176c03(0x1ea),'folder':_0x371d8c});const _0x3c68d9={'name':_0xb75d00,'parentFolderId':_0x3c635c},_0x45881d=await _0x388914['withProgress'](_0x176c03(0x1cd)+_0x371d8c+'\x27...',()=>_0x5706c1[_0x176c03(0x1ed)][_0x176c03(0x1a3)](_0x5e29a5[_0x176c03(0x15a)],_0x3c68d9));_0x42a2b1[_0x176c03(0x1f0)](_0x371d8c,_0x45881d[_0x176c03(0x200)]['id']),_0x388914[_0x176c03(0x19a)]?.({'type':_0x176c03(0x15d),'folder':_0x371d8c,'folderId':_0x45881d[_0x176c03(0x200)]['id']}),_0x388914[_0x176c03(0x1de)]?.(_0x176c03(0x1da)+_0x371d8c+'\x27');}return _0x42a2b1;}export async function executePushSegmentDeletions(_0x431a16,_0x57e6fb,_0x58a16c){const _0x1f34b2=a100_0x2c6966;if(_0x57e6fb[_0x1f34b2(0x1d8)]===0x0)return 0x0;const {batchAsync:_0x27f931}=await import('../../utils/async.js'),_0x3425dd=0x5,_0xb7bd25=await _0x27f931(_0x57e6fb,async _0x495efd=>{const _0x457349=_0x1f34b2;return _0x58a16c[_0x457349(0x19a)]?.({'type':_0x457349(0x1d9),'name':_0x495efd['name']}),await _0x431a16['segment'][_0x457349(0x1ab)](_0x495efd['id']),_0x58a16c[_0x457349(0x19a)]?.({'type':_0x457349(0x1d2),'name':_0x495efd[_0x457349(0x141)]}),_0x58a16c[_0x457349(0x1ca)]?.(_0x457349(0x1b1)+_0x495efd[_0x457349(0x141)]+'\x27'),0x1;},_0x3425dd);return _0xb7bd25[_0x1f34b2(0x177)]((_0x2289bb,_0x516b5a)=>_0x2289bb+_0x516b5a,0x0);}export async function executePushJourneys(_0x3a8195,_0x2b0179,_0x6166f0,_0x23cf29,_0x30ff57){const _0x126740=a100_0x2c6966,{journeyDefToRequest:_0x119da5}=await import(_0x126740(0x171)),{activationDefToCreateRequest:_0x48adbe,yamlRuleToApi:_0x2a8b31,validateSegmentRule:_0x1bd02c}=await import('./child-segment-yaml.js'),_0x271ddb={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2ac277=new Map(_0x6166f0[_0x126740(0x180)]),_0x2e2139=0x5;for(let _0x593dfb=0x0;_0x593dfb<_0x2b0179['length'];_0x593dfb+=_0x2e2139){const _0x293f82=_0x2b0179[_0x126740(0x1e9)](_0x593dfb,_0x593dfb+_0x2e2139),_0xa9c5a8=await Promise['all'](_0x293f82[_0x126740(0x1b5)](async _0x975dfa=>{const _0x590bbe=_0x126740;if(!_0x975dfa['isNew']&&!_0x975dfa['hasChanges'])return{'action':_0x590bbe(0x16c),'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)],'journeyId':_0x975dfa[_0x590bbe(0x1a6)]?.['id']};const _0x56ed6c=_0x975dfa[_0x590bbe(0x144)]?_0x6166f0[_0x590bbe(0x135)][_0x590bbe(0x15b)](_0x975dfa[_0x590bbe(0x144)]):undefined;_0x30ff57['onProgress']?.({'type':_0x975dfa[_0x590bbe(0x1fe)]?_0x590bbe(0x153):_0x590bbe(0x13e),'name':_0x975dfa[_0x590bbe(0x15e)]['name']});try{const _0x3fd08b=await executeSingleJourneyPush(_0x3a8195,_0x975dfa,{..._0x6166f0,'segmentNameToId':_0x2ac277},{'parentId':_0x23cf29['parentId'],'rootFolderId':_0x23cf29[_0x590bbe(0x187)],'folderId':_0x56ed6c,'verbose':_0x23cf29[_0x590bbe(0x1d1)]},_0x30ff57,{'journeyDefToRequest':_0x119da5,'activationDefToCreateRequest':_0x48adbe,'yamlRuleToApi':_0x2a8b31,'validateSegmentRule':_0x1bd02c});for(const [_0x47fd03,_0x50d13e]of _0x3fd08b[_0x590bbe(0x1b6)]){_0x2ac277[_0x590bbe(0x1f0)](_0x47fd03,_0x50d13e),_0x271ddb['embeddedSegmentNameToId']['set'](_0x47fd03,_0x50d13e);}if(_0x3fd08b[_0x590bbe(0x1b9)]==='created')_0x30ff57[_0x590bbe(0x19a)]?.({'type':_0x590bbe(0x129),'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)],'journeyId':_0x3fd08b[_0x590bbe(0x199)]}),_0x30ff57[_0x590bbe(0x179)]?.(_0x590bbe(0x17e)+_0x975dfa[_0x590bbe(0x15e)]['name']+'\x27'),_0x271ddb['created']++;else _0x3fd08b[_0x590bbe(0x1b9)]===_0x590bbe(0x1c0)&&(_0x30ff57['onProgress']?.({'type':_0x590bbe(0x1e1),'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)]}),_0x30ff57[_0x590bbe(0x179)]?.(_0x590bbe(0x1c5)+_0x975dfa['yamlConfig']['name']+'\x27'),_0x271ddb[_0x590bbe(0x1c0)]++);return{'action':_0x3fd08b[_0x590bbe(0x1b9)],'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)],'journeyId':_0x3fd08b['journeyId']};}catch(_0x1ac44a){const _0x575c5c=isHttp400Error(_0x1ac44a),_0xbc6596=_0x575c5c?ErrorCode[_0x590bbe(0x1c7)]:ErrorCode[_0x590bbe(0x19c)],_0x20478d=getErrorMessage(_0x1ac44a);throw new SDKError(_0xbc6596,_0x590bbe(0x185)+(_0x975dfa['isNew']?'create':'update')+_0x590bbe(0x1a1)+_0x975dfa[_0x590bbe(0x202)]+_0x590bbe(0x1b8)+_0x20478d,_0x1ac44a);}}));_0x271ddb[_0x126740(0x1c9)][_0x126740(0x1e2)](..._0xa9c5a8);}return _0x271ddb;}async function executeSingleJourneyPush(_0x1dd739,_0x24363e,_0x12ad65,_0xebdff0,_0x59d71f,_0x43d818){const _0x836d45=a100_0x2c6966,{journeyDefToRequest:_0x233812,activationDefToCreateRequest:_0x4b7627,yamlRuleToApi:_0x4f09e3,validateSegmentRule:_0x58be5f}=_0x43d818,_0xb29fc1=new Map(),_0x1b899b=new Map(),_0x4c71cc=new Map(),_0x52ad30=new Map(),_0x448c55=new Map();let _0x1c82b5;const _0xdf1dd5=async()=>{const _0x2f19e0=a100_0x1a9a;if(_0x1c82b5)return;_0x1c82b5=new Map();if(!_0x24363e['existingJourney'])return;const _0x374860=await _0x1dd739[_0x2f19e0(0x165)][_0x2f19e0(0x1be)](_0x24363e[_0x2f19e0(0x1a6)]['id']);for(const _0x2d87e5 of _0x374860){const _0x59bd23=journeyActivationStepToYaml(_0x2d87e5,_0x12ad65['idToEmailMap'],_0x12ad65[_0x2f19e0(0x1a0)]),_0xd9fc4d=activationSignature(_0x59bd23);!_0x1c82b5['has'](_0xd9fc4d)&&_0x1c82b5[_0x2f19e0(0x1f0)](_0xd9fc4d,_0x2d87e5['id']),_0x59bd23['name']&&_0x1b899b[_0x2f19e0(0x1f0)](_0x59bd23[_0x2f19e0(0x141)],_0x2d87e5['id']);}};if(_0x24363e['existingJourney']&&_0x24363e[_0x836d45(0x15e)]['segments']){const _0x500de4=buildLocalExpandedRuleMappings(_0x24363e['yamlConfig']),_0x4ce74c=_0x500de4[_0x836d45(0x16a)];if(_0x4ce74c[_0x836d45(0x143)]>0x0){const _0x2cfe2e=new Map();for(const [_0x5a1025,_0xc6597a]of _0x4ce74c){const _0x2c2aba=serializeExpandedRule(_0xc6597a,_0x4ce74c);_0x2cfe2e[_0x836d45(0x1f0)](_0x5a1025,_0x2c2aba);}const _0x44e005=collectSegmentIdsFromJourneyApi(_0x24363e[_0x836d45(0x1a6)]);if(_0x44e005['size']>0x0){const _0xa251f8=await buildServerSegmentRuleMap(_0x1dd739,_0xebdff0[_0x836d45(0x15a)],_0x12ad65[_0x836d45(0x163)],_0x44e005);if(_0xa251f8['size']>0x0){const _0x19f5c3=new Map();for(const [_0x110359,_0x11c998]of _0xa251f8){const _0x2f2385=serializeExpandedRule(_0x11c998,_0xa251f8);!_0x19f5c3[_0x836d45(0x1c3)](_0x2f2385)&&_0x19f5c3[_0x836d45(0x1f0)](_0x2f2385,_0x110359);}for(const [_0x1701e2,_0x2176ed]of _0x2cfe2e){const _0x3e2bdc=_0x19f5c3[_0x836d45(0x15b)](_0x2176ed);_0x3e2bdc&&(_0x448c55[_0x836d45(0x1f0)](_0x1701e2,_0x3e2bdc),_0x12ad65[_0x836d45(0x180)][_0x836d45(0x1f0)](_0x1701e2,_0x3e2bdc));}}}}}const _0x107dfe={'resolveSegmentId':async _0x58dcde=>{const _0x4996ce=_0x836d45,_0x3e2e17=_0x12ad65[_0x4996ce(0x180)]['get'](_0x58dcde);if(!_0x3e2e17)throw new SDKError(ErrorCode[_0x4996ce(0x1f4)],'Segment\x20not\x20found:\x20'+_0x58dcde+_0x4996ce(0x1dd)+_0x24363e[_0x4996ce(0x15e)][_0x4996ce(0x141)]+')');return _0x3e2e17;},'resolveEmbeddedSegmentId':async(_0x2113ac,_0x21b19e)=>{const _0x1eed3b=_0x836d45,_0x1def99=_0x12ad65['segmentNameToId'][_0x1eed3b(0x15b)](_0x2113ac);if(_0x1def99)return _0x1def99;const _0x3a4cc8=_0x448c55[_0x1eed3b(0x15b)](_0x2113ac);if(_0x3a4cc8)return _0x12ad65[_0x1eed3b(0x180)][_0x1eed3b(0x1f0)](_0x2113ac,_0x3a4cc8),_0x3a4cc8;const _0x5cce52=_0x12ad65['existingSegments'][_0x1eed3b(0x133)](_0x8e34bd=>_0x8e34bd[_0x1eed3b(0x141)]===_0x2113ac);if(_0x5cce52)return _0x12ad65[_0x1eed3b(0x180)][_0x1eed3b(0x1f0)](_0x2113ac,_0x5cce52['id']),_0x5cce52['id'];if(_0x24363e[_0x1eed3b(0x1fe)]){const {stageName:_0x227c01,criteriaName:_0x334eef}=findSegmentCriteriaLocation(_0x24363e['yamlConfig'],_0x2113ac);return _0x58be5f(_0x2113ac,_0x21b19e[_0x1eed3b(0x1cf)]),_0x4c71cc['set'](_0x2113ac,{'definition':_0x21b19e,'stageName':_0x227c01,'criteriaName':_0x334eef}),createPendingSegmentId(_0x2113ac);}const _0x524087=_0x24363e[_0x1eed3b(0x1a6)]?.['id'];if(!_0x524087)throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x58be5f(_0x2113ac,_0x21b19e[_0x1eed3b(0x1cf)]);const _0x29dd1d=generateDeterministicJourneySegmentName(_0x24363e[_0x1eed3b(0x15e)][_0x1eed3b(0x141)],_0x2113ac),_0xd06867=_0x12ad65[_0x1eed3b(0x163)]['find'](_0x45caca=>_0x45caca[_0x1eed3b(0x141)]===_0x29dd1d),_0x500859=createSegmentIdResolver(_0x12ad65[_0x1eed3b(0x180)],_0x2113ac),_0x1350ac=await resolveRuleSegmentIds(_0x21b19e[_0x1eed3b(0x1cf)],_0x500859);let _0x535272;if(_0xd06867)await _0x1dd739[_0x1eed3b(0x1ed)][_0x1eed3b(0x17a)](_0xebdff0[_0x1eed3b(0x15a)],_0xd06867['id'],{'description':_0x21b19e[_0x1eed3b(0x132)]||_0x1eed3b(0x1af)+_0x2113ac,'rule':_0x4f09e3(_0x1350ac,!![]),'countPopulation':!![]}),_0x535272=_0xd06867['id'];else try{_0x535272=await _0x1dd739[_0x1eed3b(0x1ed)][_0x1eed3b(0x12f)]({'name':_0x29dd1d,'description':_0x21b19e[_0x1eed3b(0x132)]||_0x1eed3b(0x1af)+_0x2113ac,'journeyId':_0x524087,'rule':_0x4f09e3(_0x1350ac,!![]),'countPopulation':!![],'parentFolderId':_0xebdff0[_0x1eed3b(0x187)]||'','audienceId':_0xebdff0[_0x1eed3b(0x15a)]});}catch(_0x6d485d){const _0x1e1d1a=_0x6d485d instanceof Error&&_0x6d485d[_0x1eed3b(0x1dc)][_0x1eed3b(0x1fc)](_0x1eed3b(0x11e));if(_0x1e1d1a){const _0x41a950=await _0x1dd739[_0x1eed3b(0x1ed)]['listSegments'](_0xebdff0[_0x1eed3b(0x15a)]),_0x580725=_0x41a950[_0x1eed3b(0x133)](_0x50de4f=>_0x50de4f[_0x1eed3b(0x141)]===_0x29dd1d);if(_0x580725)await _0x1dd739[_0x1eed3b(0x1ed)][_0x1eed3b(0x17a)](_0xebdff0[_0x1eed3b(0x15a)],_0x580725['id'],{'description':_0x21b19e[_0x1eed3b(0x132)]||_0x1eed3b(0x1af)+_0x2113ac,'rule':_0x4f09e3(_0x1350ac,!![]),'countPopulation':!![]}),_0x535272=_0x580725['id'];else throw _0x6d485d;}else throw _0x6d485d;}return _0x12ad65[_0x1eed3b(0x180)]['set'](_0x2113ac,_0x535272),_0xb29fc1[_0x1eed3b(0x1f0)](_0x2113ac,_0x535272),_0x535272;},'resolveActivationId':async _0x5b83b3=>{const _0x58456=_0x836d45,_0x5636e9=_0x1b899b[_0x58456(0x15b)](_0x5b83b3);if(_0x5636e9)return _0x5636e9;if(_0x24363e[_0x58456(0x1a6)]){await _0xdf1dd5();const _0x5c4c1b=_0x1b899b[_0x58456(0x15b)](_0x5b83b3);if(_0x5c4c1b)return _0x5c4c1b;}throw new SDKError(ErrorCode[_0x58456(0x139)],_0x58456(0x13f)+_0x5b83b3+_0x58456(0x1dd)+_0x24363e[_0x58456(0x15e)][_0x58456(0x141)]+_0x58456(0x1e4)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x4eeab7,_0x1197ec)=>{const _0x334aa9=_0x836d45,_0x4fd6a0=_0x1b899b[_0x334aa9(0x15b)](_0x4eeab7);if(_0x4fd6a0)return _0x4fd6a0;if(_0x24363e[_0x334aa9(0x1fe)])return _0x52ad30['set'](_0x4eeab7,_0x1197ec),createPendingActivationId(_0x4eeab7);if(_0x24363e[_0x334aa9(0x1a6)]){await _0xdf1dd5();const _0x2dbf16=_0x1b899b['get'](_0x1197ec[_0x334aa9(0x141)]);if(_0x2dbf16)return _0x1b899b[_0x334aa9(0x1f0)](_0x4eeab7,_0x2dbf16),_0x2dbf16;const _0x9a9214=activationSignature(_0x1197ec),_0x25b982=_0x1c82b5?.['get'](_0x9a9214);if(_0x25b982)return _0x1b899b['set'](_0x4eeab7,_0x25b982),_0x25b982;const _0x1535d4=await _0x4b7627(_0x1197ec,_0x12ad65[_0x334aa9(0x194)]),_0x215e37=await _0x1dd739['journey'][_0x334aa9(0x1db)](_0x24363e[_0x334aa9(0x1a6)]['id'],_0x1535d4);return _0x1b899b[_0x334aa9(0x1f0)](_0x4eeab7,_0x215e37['id']),_0x215e37['id'];}throw new SDKError(ErrorCode[_0x334aa9(0x1d0)],_0x334aa9(0x138));},'resolveJourneyId':async _0x3d1d64=>{const _0xf6df62=_0x836d45;try{return await _0x1dd739['journey'][_0xf6df62(0x1f7)](_0xebdff0['parentId'],_0x3d1d64);}catch(_0x2284fd){throw new SDKError(ErrorCode['NOT_FOUND'],_0xf6df62(0x11f)+_0x3d1d64+_0xf6df62(0x137)+_0x24363e[_0xf6df62(0x15e)][_0xf6df62(0x141)]+'\x27)',_0x2284fd);}},'resolveStageId':async(_0x548589,_0x366548)=>{const _0x350c3f=_0x836d45,_0x39a6c4=await _0x1dd739[_0x350c3f(0x165)][_0x350c3f(0x173)](_0x548589),_0x67e00b=_0x39a6c4[_0x350c3f(0x18e)][_0x350c3f(0x140)][_0x350c3f(0x133)](_0x5e83b8=>_0x5e83b8['name'][_0x350c3f(0x12e)]()===_0x366548[_0x350c3f(0x12e)]());if(!_0x67e00b?.['id'])throw new SDKError(ErrorCode[_0x350c3f(0x139)],_0x350c3f(0x145)+_0x366548+_0x350c3f(0x1d4)+(_0x39a6c4['attributes']['journeyBundleName']||_0x39a6c4[_0x350c3f(0x18e)][_0x350c3f(0x141)])+'\x27');return _0x67e00b['id'];}},_0x5d41b4=await _0x233812(_0x24363e[_0x836d45(0x15e)],_0xebdff0[_0x836d45(0x15a)],_0x107dfe),_0x3bfe5e=_0xebdff0['folderId']||_0xebdff0[_0x836d45(0x187)];_0x3bfe5e&&(_0x5d41b4[_0x836d45(0x1f3)]={'parentFolder':{'data':{'id':_0x3bfe5e,'type':'folder'}}});if(_0x24363e['isNew']){if(_0x4c71cc[_0x836d45(0x143)]>0x0||_0x52ad30['size']>0x0)return await executeThreeStepJourneyCreate(_0x1dd739,_0x24363e,_0x5d41b4,{'pendingEmbeddedSegments':_0x4c71cc,'pendingEmbeddedActivations':_0x52ad30,'embeddedSegmentNameToId':_0xb29fc1,'journeyActivationNameToId':_0x1b899b},{..._0xebdff0,'effectiveFolderId':_0x3bfe5e},_0x12ad65,_0x59d71f,_0x43d818);else{ensureJourneyDefaults(_0x5d41b4[_0x836d45(0x18e)]);const _0x1cb309=await _0x1dd739[_0x836d45(0x165)][_0x836d45(0x17f)](_0x5d41b4);return{'action':'created','journeyId':_0x1cb309['id'],'embeddedSegmentNameToId':_0xb29fc1};}}else{if(_0x24363e[_0x836d45(0x162)]&&_0x24363e['existingJourney'])return ensureJourneyDefaults(_0x5d41b4[_0x836d45(0x18e)]),await _0x1dd739['journey'][_0x836d45(0x1a7)](_0x24363e[_0x836d45(0x1a6)]['id'],_0x5d41b4),{'action':_0x836d45(0x1c0),'journeyId':_0x24363e['existingJourney']['id'],'embeddedSegmentNameToId':_0xb29fc1};}return{'action':'unchanged','journeyId':_0x24363e[_0x836d45(0x1a6)]?.['id'],'embeddedSegmentNameToId':_0xb29fc1};}function findSegmentCriteriaLocation(_0x40380d,_0x2680ae){const _0x2f6b0a=a100_0x2c6966,_0x2899f2=_0x40380d[_0x2f6b0a(0x1e0)]||_0x40380d['journeys']?.[0x0]?.[_0x2f6b0a(0x1e0)]||[];let _0x5c473e='entry',_0x5953b3=_0x2680ae;const _0x3ab3cc=_0x40380d['goal']||_0x40380d[_0x2f6b0a(0x147)]?.[0x0]?.[_0x2f6b0a(0x1bc)];if(_0x3ab3cc?.[_0x2f6b0a(0x1ed)]===_0x2680ae)return{'stageName':_0x2f6b0a(0x1bc),'criteriaName':_0x3ab3cc[_0x2f6b0a(0x141)]||_0x2680ae};_0x3c73a2:for(const _0x28c213 of _0x2899f2){if(_0x28c213[_0x2f6b0a(0x181)]?.[_0x2f6b0a(0x1ed)]===_0x2680ae){_0x5c473e=_0x28c213[_0x2f6b0a(0x141)],_0x5953b3=_0x28c213[_0x2f6b0a(0x181)][_0x2f6b0a(0x141)]||_0x2680ae;break;}if(_0x28c213[_0x2f6b0a(0x1f8)])for(const _0x3ba48f of _0x28c213[_0x2f6b0a(0x1f8)]){if(_0x3ba48f[_0x2f6b0a(0x134)]===_0x2f6b0a(0x1ee)&&_0x3ba48f['with']?.[_0x2f6b0a(0x1e7)])for(const _0x15a84c of _0x3ba48f['with'][_0x2f6b0a(0x1e7)]){if(_0x15a84c[_0x2f6b0a(0x1ed)]===_0x2680ae){_0x5c473e=_0x28c213['name'],_0x5953b3=_0x15a84c[_0x2f6b0a(0x141)]||_0x2680ae;break _0x3c73a2;}}}}return{'stageName':_0x5c473e,'criteriaName':_0x5953b3};}async function executeThreeStepJourneyCreate(_0x6f0bc9,_0x5221ea,_0x4f6f91,_0x11367b,_0x21b289,_0x48d84d,_0x35e990,_0x10ab39){const _0xeb0cc8=a100_0x2c6966,{activationDefToCreateRequest:_0xcb1695,yamlRuleToApi:_0x5b0365}=_0x10ab39,{pendingEmbeddedSegments:_0x9422a,pendingEmbeddedActivations:_0x148a78,embeddedSegmentNameToId:_0x25e227}=_0x11367b,_0x49f164=JSON[_0xeb0cc8(0x14c)](JSON[_0xeb0cc8(0x158)](_0x4f6f91));ensureJourneyDefaults(_0x49f164['attributes']),stripPendingIds(_0x49f164);const _0x4fb092=await _0x6f0bc9['journey'][_0xeb0cc8(0x17f)](_0x49f164),_0x111e13=_0x4fb092['id'],_0x3c59eb=new Map();for(const _0x33de5c of _0x4fb092[_0xeb0cc8(0x18e)]['journeyStages']){_0x3c59eb[_0xeb0cc8(0x1f0)](_0x33de5c[_0xeb0cc8(0x141)][_0xeb0cc8(0x12e)](),_0x33de5c['id']);}for(const [_0x55f29c,{definition:_0x5addda}]of _0x9422a){const _0x4dd65b=generateDeterministicJourneySegmentName(_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],_0x55f29c);_0x35e990[_0xeb0cc8(0x19a)]?.({'type':_0xeb0cc8(0x192),'journeyName':_0x5221ea['yamlConfig'][_0xeb0cc8(0x141)],'segmentName':_0x55f29c});const _0x1d93fa=createSegmentIdResolver(_0x48d84d['segmentNameToId'],_0x55f29c),_0x3f093c=await resolveRuleSegmentIds(_0x5addda[_0xeb0cc8(0x1cf)],_0x1d93fa),_0x50b82c=await _0x6f0bc9['segment']['createJourneySegment']({'name':_0x4dd65b,'description':_0x5addda['description']||_0xeb0cc8(0x1af)+_0x55f29c,'journeyId':_0x111e13,'rule':_0x5b0365(_0x3f093c,!![]),'countPopulation':!![],'parentFolderId':_0x21b289[_0xeb0cc8(0x127)]||'','audienceId':_0x21b289[_0xeb0cc8(0x15a)]});_0x25e227[_0xeb0cc8(0x1f0)](_0x55f29c,_0x50b82c),_0x48d84d['segmentNameToId'][_0xeb0cc8(0x1f0)](_0x55f29c,_0x50b82c),_0x35e990[_0xeb0cc8(0x19a)]?.({'type':'embedded_segment_created','journeyName':_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],'segmentName':_0x55f29c});}const _0x423fe0=new Map();for(const [_0x59c2b2,_0x13cabf]of _0x148a78){_0x35e990['onProgress']?.({'type':_0xeb0cc8(0x1d7),'journeyName':_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],'activationName':_0x59c2b2});const _0x409241=await _0xcb1695(_0x13cabf,_0x48d84d['activationContext']),_0x4fdeb4=await _0x6f0bc9[_0xeb0cc8(0x165)][_0xeb0cc8(0x1db)](_0x111e13,_0x409241);_0x423fe0[_0xeb0cc8(0x1f0)](_0x59c2b2,_0x4fdeb4['id']),_0x11367b[_0xeb0cc8(0x1ad)][_0xeb0cc8(0x1f0)](_0x59c2b2,_0x4fdeb4['id']),_0x35e990['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],'activationName':_0x59c2b2});}const _0x2a5eb5=JSON[_0xeb0cc8(0x14c)](JSON[_0xeb0cc8(0x158)](_0x4f6f91));return _0x2a5eb5['id']=_0x111e13,ensureJourneyDefaults(_0x2a5eb5[_0xeb0cc8(0x18e)]),resolvePendingIdsInRequest(_0x2a5eb5,_0x4f6f91,_0x3c59eb,_0x25e227,_0x423fe0,_0x35e990),await _0x6f0bc9[_0xeb0cc8(0x165)][_0xeb0cc8(0x1a7)](_0x111e13,_0x2a5eb5),{'action':_0xeb0cc8(0x16b),'journeyId':_0x111e13,'embeddedSegmentNameToId':_0x25e227};}function stripPendingIds(_0x3e01da){const _0x7eb1c6=a100_0x2c6966;for(const _0x56890a of _0x3e01da[_0x7eb1c6(0x18e)][_0x7eb1c6(0x140)]||[]){_0x56890a['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x56890a[_0x7eb1c6(0x174)][_0x7eb1c6(0x17c)])&&delete _0x56890a[_0x7eb1c6(0x174)];if(_0x56890a[_0x7eb1c6(0x1f8)])for(const _0x4afc5e of Object['keys'](_0x56890a[_0x7eb1c6(0x1f8)])){const _0x50983a=_0x56890a['steps'][_0x4afc5e];_0x50983a[_0x7eb1c6(0x134)]==='Activation'&&_0x50983a[_0x7eb1c6(0x1df)]&&isPendingActivationId(_0x50983a['journeyActivationStepId'])&&(_0x50983a['journeyActivationStepId']='');if(_0x50983a[_0x7eb1c6(0x134)]===_0x7eb1c6(0x15c)&&_0x50983a[_0x7eb1c6(0x1e7)])for(const _0x2c857a of _0x50983a[_0x7eb1c6(0x1e7)]){_0x2c857a[_0x7eb1c6(0x17c)]&&isPendingSegmentId(_0x2c857a['segmentId'])&&(_0x2c857a[_0x7eb1c6(0x17c)]='');}_0x50983a[_0x7eb1c6(0x134)]==='WaitStep'&&_0x50983a[_0x7eb1c6(0x1ef)]?.['segmentId']&&isPendingSegmentId(_0x50983a['waitCondition'][_0x7eb1c6(0x17c)])&&(_0x50983a[_0x7eb1c6(0x1ef)][_0x7eb1c6(0x17c)]='');}}}function resolvePendingIdsInRequest(_0x1c9932,_0xdad995,_0xa9c69b,_0x5cf8d4,_0x5c5429,_0xddf14b){const _0x1e8877=a100_0x2c6966,_0x335053=(_0x54b476,_0x2b100b)=>{const _0x561e08=a100_0x1a9a;if(!isPendingSegmentId(_0x54b476))return _0x54b476;const _0x79946a=extractPendingSegmentName(_0x54b476),_0x3df8f7=_0x5cf8d4[_0x561e08(0x15b)](_0x79946a);return!_0x3df8f7&&_0xddf14b[_0x561e08(0x189)]?.(_0x561e08(0x150)+_0x79946a+_0x561e08(0x146)+_0x2b100b),_0x3df8f7;};if(_0x1c9932[_0x1e8877(0x18e)][_0x1e8877(0x1bc)]?.['segmentId']&&isPendingSegmentId(_0x1c9932[_0x1e8877(0x18e)][_0x1e8877(0x1bc)][_0x1e8877(0x17c)])){const _0x1f9f44=_0x335053(_0x1c9932['attributes'][_0x1e8877(0x1bc)][_0x1e8877(0x17c)],'goal\x20criteria');_0x1f9f44&&(_0x1c9932[_0x1e8877(0x18e)]['goal'][_0x1e8877(0x17c)]=_0x1f9f44);}for(const _0x476265 of _0x1c9932[_0x1e8877(0x18e)][_0x1e8877(0x140)]||[]){const _0x3aa6cb=_0xa9c69b['get'](_0x476265[_0x1e8877(0x141)][_0x1e8877(0x12e)]());_0x3aa6cb&&(_0x476265['id']=_0x3aa6cb);if(_0x476265['entryCriteria']?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x476265['entryCriteria'][_0x1e8877(0x17c)])){const _0x2e63ff=_0x335053(_0x476265[_0x1e8877(0x174)][_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265[_0x1e8877(0x141)]+_0x1e8877(0x1ec));_0x2e63ff&&(_0x476265[_0x1e8877(0x174)][_0x1e8877(0x17c)]=_0x2e63ff);}if(_0x476265[_0x1e8877(0x1b4)])for(const _0x1a923f of _0x476265['exitCriterias']){if(_0x1a923f[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x1a923f[_0x1e8877(0x17c)])){const _0x2345f8=_0x335053(_0x1a923f[_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265[_0x1e8877(0x141)]+'\x27\x20exit\x20criteria');_0x2345f8&&(_0x1a923f[_0x1e8877(0x17c)]=_0x2345f8);}}if(_0x476265[_0x1e8877(0x1d5)]?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x476265[_0x1e8877(0x1d5)][_0x1e8877(0x17c)])){const _0x131977=_0x335053(_0x476265[_0x1e8877(0x1d5)][_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265['name']+'\x27\x20milestone');_0x131977&&(_0x476265['milestone'][_0x1e8877(0x17c)]=_0x131977);}if(_0x476265[_0x1e8877(0x1f8)]){const _0x325829=_0x11ade4=>_0xdad995['attributes'][_0x1e8877(0x140)]['find'](_0x570376=>_0x570376[_0x1e8877(0x141)][_0x1e8877(0x12e)]()===_0x476265[_0x1e8877(0x141)][_0x1e8877(0x12e)]())?.[_0x1e8877(0x1f8)]?.[_0x11ade4];for(const _0x56203e of Object[_0x1e8877(0x1d3)](_0x476265[_0x1e8877(0x1f8)])){const _0x5ec06c=_0x476265[_0x1e8877(0x1f8)][_0x56203e],_0x2c32b1=_0x325829(_0x56203e);if(_0x5ec06c[_0x1e8877(0x134)]===_0x1e8877(0x15f)&&_0x5ec06c['journeyActivationStepId']&&(isPendingActivationId(_0x5ec06c['journeyActivationStepId'])||_0x5ec06c['journeyActivationStepId']==='')){if(_0x2c32b1?.['journeyActivationStepId']&&isPendingActivationId(_0x2c32b1[_0x1e8877(0x1df)])){const _0x1e50db=extractPendingActivationName(_0x2c32b1[_0x1e8877(0x1df)]),_0x23d2db=_0x5c5429['get'](_0x1e50db);_0x23d2db&&(_0x5ec06c[_0x1e8877(0x1df)]=_0x23d2db);}}if(_0x5ec06c['type']===_0x1e8877(0x15c)&&_0x5ec06c[_0x1e8877(0x1e7)]&&_0x2c32b1?.[_0x1e8877(0x1e7)])for(let _0x107c14=0x0;_0x107c14<_0x5ec06c['branches'][_0x1e8877(0x1d8)];_0x107c14++){const _0x1061f2=_0x5ec06c['branches'][_0x107c14],_0x3766a3=_0x2c32b1[_0x1e8877(0x1e7)][_0x107c14];if(_0x3766a3?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x3766a3[_0x1e8877(0x17c)])){const _0x4e99f6=_0x335053(_0x3766a3[_0x1e8877(0x17c)],'stage\x20\x27'+_0x476265[_0x1e8877(0x141)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x1061f2[_0x1e8877(0x141)]||_0x107c14)+'\x27');_0x4e99f6&&(_0x1061f2[_0x1e8877(0x17c)]=_0x4e99f6);}}if(_0x5ec06c['type']===_0x1e8877(0x166)&&_0x5ec06c[_0x1e8877(0x1ef)]?.[_0x1e8877(0x17c)]&&_0x2c32b1?.[_0x1e8877(0x1ef)]?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x2c32b1[_0x1e8877(0x1ef)][_0x1e8877(0x17c)])){const _0x2bbda1=_0x335053(_0x2c32b1[_0x1e8877(0x1ef)][_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265[_0x1e8877(0x141)]+_0x1e8877(0x205));_0x2bbda1&&(_0x5ec06c[_0x1e8877(0x1ef)][_0x1e8877(0x17c)]=_0x2bbda1);}}}}}
@@ -1 +1 @@
1
- (function(_0x372593,_0x2e3106){const _0x4c76a8=a101_0x3e27,_0x294a1f=_0x372593();while(!![]){try{const _0x32d02b=parseInt(_0x4c76a8(0x118))/0x1+-parseInt(_0x4c76a8(0x126))/0x2+-parseInt(_0x4c76a8(0x122))/0x3+parseInt(_0x4c76a8(0x11b))/0x4*(parseInt(_0x4c76a8(0x11e))/0x5)+-parseInt(_0x4c76a8(0x123))/0x6*(-parseInt(_0x4c76a8(0x124))/0x7)+parseInt(_0x4c76a8(0x119))/0x8+-parseInt(_0x4c76a8(0x121))/0x9*(parseInt(_0x4c76a8(0x11d))/0xa);if(_0x32d02b===_0x2e3106)break;else _0x294a1f['push'](_0x294a1f['shift']());}catch(_0x225d9c){_0x294a1f['push'](_0x294a1f['shift']());}}}(a101_0x472b,0x8baf9));function a101_0x472b(){const _0x90c4a4=['1574470NcAfAB','parentFolderId','1117012aIrozM','2509936eDhFhq','get','1468cxyppN','set','809260mHHGBr','4475LgoUKv','name','has','45cVZFUE','3009393WGWavy','12342kDQKgA','3430cpoBtc','add'];a101_0x472b=function(){return _0x90c4a4;};return a101_0x472b();}export function buildFolderIdToPathMap(_0x3f7cd5){const _0x145e2f=a101_0x3e27,_0x9da250=new Map(),_0x4cc3a3=new Map();for(const _0xd68099 of _0x3f7cd5){_0x4cc3a3[_0x145e2f(0x11c)](_0xd68099['id'],_0xd68099);}const _0x5e0c9e=new Set();for(const _0x37ddda of _0x3f7cd5){!_0x37ddda['parentFolderId']&&_0x5e0c9e[_0x145e2f(0x125)](_0x37ddda['id']);}function _0x863281(_0x191cc9){const _0x8c1c11=_0x145e2f;if(_0x9da250[_0x8c1c11(0x120)](_0x191cc9['id']))return _0x9da250[_0x8c1c11(0x11a)](_0x191cc9['id']);if(_0x5e0c9e[_0x8c1c11(0x120)](_0x191cc9['id']))return _0x9da250[_0x8c1c11(0x11c)](_0x191cc9['id'],''),'';if(_0x191cc9['parentFolderId']){const _0x2fea4b=_0x4cc3a3['get'](_0x191cc9['parentFolderId']);if(_0x2fea4b){const _0x4a799f=_0x863281(_0x2fea4b),_0x1ed406=_0x4a799f?_0x4a799f+'/'+_0x191cc9['name']:_0x191cc9[_0x8c1c11(0x11f)];return _0x9da250[_0x8c1c11(0x11c)](_0x191cc9['id'],_0x1ed406),_0x1ed406;}}const _0x493600=_0x191cc9[_0x8c1c11(0x11f)];return _0x9da250[_0x8c1c11(0x11c)](_0x191cc9['id'],_0x493600),_0x493600;}for(const _0x206157 of _0x3f7cd5){_0x863281(_0x206157);}return _0x9da250;}export function buildFolderPathToIdMap(_0x1f509d){const _0x2b5085=a101_0x3e27,_0x3b20d7=new Map(),_0x3bdce0=new Map();for(const _0x456e99 of _0x1f509d){_0x3bdce0[_0x2b5085(0x11c)](_0x456e99['id'],_0x456e99);}const _0x1b1049=new Set();for(const _0x58d9d3 of _0x1f509d){!_0x58d9d3['parentFolderId']&&_0x1b1049['add'](_0x58d9d3['id']);}function _0x167a29(_0x24a830){const _0xcba426=_0x2b5085;if(_0x1b1049[_0xcba426(0x120)](_0x24a830['id']))return'';if(_0x24a830['parentFolderId']){const _0x85971=_0x3bdce0[_0xcba426(0x11a)](_0x24a830[_0xcba426(0x117)]);if(_0x85971){const _0x533a31=_0x167a29(_0x85971);return _0x533a31?_0x533a31+'/'+_0x24a830[_0xcba426(0x11f)]:_0x24a830[_0xcba426(0x11f)];}}return _0x24a830[_0xcba426(0x11f)];}for(const _0x2b2356 of _0x1f509d){const _0x37ca2b=_0x167a29(_0x2b2356);_0x3b20d7[_0x2b5085(0x11c)](_0x37ca2b,_0x2b2356['id']);}return _0x3b20d7;}function a101_0x3e27(_0x238694,_0x508a04){_0x238694=_0x238694-0x117;const _0x472bc3=a101_0x472b();let _0x3e27ff=_0x472bc3[_0x238694];return _0x3e27ff;}export function buildFolderMaps(_0x3323cf){const _0x13de85=a101_0x3e27,_0x576777=buildFolderIdToPathMap(_0x3323cf),_0x71fda4=new Map();for(const [_0x37e79e,_0x1ab03f]of _0x576777){_0x71fda4[_0x13de85(0x11c)](_0x1ab03f,_0x37e79e);}return{'idToPath':_0x576777,'pathToId':_0x71fda4};}export function getFolderPath(_0x23f595,_0xf05700){const _0x5685bf=a101_0x3e27;if(!_0x23f595)return'';return _0xf05700[_0x5685bf(0x11a)](_0x23f595)??'';}
1
+ (function(_0xe4646,_0x439e5b){const _0x5ae4c6=a101_0x5629,_0x5cb5f6=_0xe4646();while(!![]){try{const _0x5ada03=-parseInt(_0x5ae4c6(0x198))/0x1+-parseInt(_0x5ae4c6(0x190))/0x2*(-parseInt(_0x5ae4c6(0x192))/0x3)+-parseInt(_0x5ae4c6(0x199))/0x4+parseInt(_0x5ae4c6(0x18c))/0x5+parseInt(_0x5ae4c6(0x196))/0x6+-parseInt(_0x5ae4c6(0x194))/0x7+parseInt(_0x5ae4c6(0x193))/0x8;if(_0x5ada03===_0x439e5b)break;else _0x5cb5f6['push'](_0x5cb5f6['shift']());}catch(_0x3b9da0){_0x5cb5f6['push'](_0x5cb5f6['shift']());}}}(a101_0x3101,0x3c9df));export function buildFolderIdToPathMap(_0xed2ac0){const _0x54bb7c=a101_0x5629,_0x3ca991=new Map(),_0x1c06e4=new Map();for(const _0x50b138 of _0xed2ac0){_0x1c06e4['set'](_0x50b138['id'],_0x50b138);}const _0x489ccc=new Set();for(const _0x42eadd of _0xed2ac0){!_0x42eadd[_0x54bb7c(0x197)]&&_0x489ccc[_0x54bb7c(0x18d)](_0x42eadd['id']);}function _0x446e18(_0x151067){const _0x3b5f48=_0x54bb7c;if(_0x3ca991[_0x3b5f48(0x191)](_0x151067['id']))return _0x3ca991[_0x3b5f48(0x18f)](_0x151067['id']);if(_0x489ccc['has'](_0x151067['id']))return _0x3ca991[_0x3b5f48(0x195)](_0x151067['id'],''),'';if(_0x151067[_0x3b5f48(0x197)]){const _0xe8b445=_0x1c06e4[_0x3b5f48(0x18f)](_0x151067[_0x3b5f48(0x197)]);if(_0xe8b445){const _0x33682e=_0x446e18(_0xe8b445),_0x474dd7=_0x33682e?_0x33682e+'/'+_0x151067[_0x3b5f48(0x18e)]:_0x151067['name'];return _0x3ca991[_0x3b5f48(0x195)](_0x151067['id'],_0x474dd7),_0x474dd7;}}const _0x5992ce=_0x151067[_0x3b5f48(0x18e)];return _0x3ca991[_0x3b5f48(0x195)](_0x151067['id'],_0x5992ce),_0x5992ce;}for(const _0xcecefc of _0xed2ac0){_0x446e18(_0xcecefc);}return _0x3ca991;}export function buildFolderPathToIdMap(_0x2e35e2){const _0x2dd215=a101_0x5629,_0x55fe25=new Map(),_0x406835=new Map();for(const _0xabb325 of _0x2e35e2){_0x406835['set'](_0xabb325['id'],_0xabb325);}const _0x1aa482=new Set();for(const _0x5c66b0 of _0x2e35e2){!_0x5c66b0['parentFolderId']&&_0x1aa482[_0x2dd215(0x18d)](_0x5c66b0['id']);}function _0x5e216e(_0x42bfe5){const _0x3136d7=_0x2dd215;if(_0x1aa482[_0x3136d7(0x191)](_0x42bfe5['id']))return'';if(_0x42bfe5[_0x3136d7(0x197)]){const _0x262aae=_0x406835[_0x3136d7(0x18f)](_0x42bfe5['parentFolderId']);if(_0x262aae){const _0x411d87=_0x5e216e(_0x262aae);return _0x411d87?_0x411d87+'/'+_0x42bfe5[_0x3136d7(0x18e)]:_0x42bfe5['name'];}}return _0x42bfe5[_0x3136d7(0x18e)];}for(const _0x2b3149 of _0x2e35e2){const _0x13f16a=_0x5e216e(_0x2b3149);_0x55fe25['set'](_0x13f16a,_0x2b3149['id']);}return _0x55fe25;}function a101_0x5629(_0xcec7af,_0x35b2ce){_0xcec7af=_0xcec7af-0x18c;const _0x3101e7=a101_0x3101();let _0x562921=_0x3101e7[_0xcec7af];return _0x562921;}function a101_0x3101(){const _0x3b92f6=['set','565710kLFuXN','parentFolderId','214885hJRxQg','46748WRbmhq','1660435nqdZMt','add','name','get','4hwGAxE','has','464469FXIXIP','1813968Ytxekm','3415335KVMhaS'];a101_0x3101=function(){return _0x3b92f6;};return a101_0x3101();}export function buildFolderMaps(_0x1db7ce){const _0x30a84c=buildFolderIdToPathMap(_0x1db7ce),_0x509989=new Map();for(const [_0x4431ea,_0x531b4e]of _0x30a84c){_0x509989['set'](_0x531b4e,_0x4431ea);}return{'idToPath':_0x30a84c,'pathToId':_0x509989};}export function getFolderPath(_0x5f1a83,_0x3ee848){const _0x20d792=a101_0x5629;if(!_0x5f1a83)return'';return _0x3ee848[_0x20d792(0x18f)](_0x5f1a83)??'';}
@@ -1 +1 @@
1
- function a102_0x2862(_0x2e8be9,_0x5845ea){_0x2e8be9=_0x2e8be9-0x1e2;const _0x14de2d=a102_0x14de();let _0x28620f=_0x14de2d[_0x2e8be9];return _0x28620f;}function a102_0x14de(){const _0x49b8d0=['.yml','split','segments','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','1821515ouekcc','test','trim','File\x20not\x20found:\x20','startsWith','exists','raw','122454CsJfHJ','endsWith','name','3326jzNDox','journey','Relative\x20path\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','parent_segment','130ZnwNTo','dirname','type','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','pop','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','readFile','1033602TVIMre','4029040FANioy','push','join','977123sqyIAt','parse','No\x20tdx.json\x20found\x20for\x20file:\x20','length','18vgjkym','isAbsolute','4MPQSTD','substring','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','slice','relative','6295124sbfMhW','144UGYqsV','resolve','Cannot\x20split\x20empty\x20path','tdx.json','segment'];a102_0x14de=function(){return _0x49b8d0;};return a102_0x14de();}(function(_0x38a6a1,_0x556e00){const _0x22940a=a102_0x2862,_0x1ddc5d=_0x38a6a1();while(!![]){try{const _0x403a87=-parseInt(_0x22940a(0x1e3))/0x1*(parseInt(_0x22940a(0x20d))/0x2)+parseInt(_0x22940a(0x1ea))/0x3+parseInt(_0x22940a(0x1f4))/0x4*(-parseInt(_0x22940a(0x203))/0x5)+-parseInt(_0x22940a(0x1f2))/0x6*(-parseInt(_0x22940a(0x1ee))/0x7)+parseInt(_0x22940a(0x1fa))/0x8*(parseInt(_0x22940a(0x20a))/0x9)+parseInt(_0x22940a(0x1eb))/0xa+-parseInt(_0x22940a(0x1f9))/0xb;if(_0x403a87===_0x556e00)break;else _0x1ddc5d['push'](_0x1ddc5d['shift']());}catch(_0x22caaa){_0x1ddc5d['push'](_0x1ddc5d['shift']());}}}(a102_0x14de,0x3f120));import a102_0x4bf119 from'path';import{parse as a102_0x159e68}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0xfeac8e){const _0x1d642b=a102_0x2862;if(!_0xfeac8e||_0xfeac8e[_0x1d642b(0x205)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x4932f1=_0xfeac8e[_0x1d642b(0x205)]();if(_0x4932f1==='/')return{'segments':[],'isAbsolute':!![],'raw':_0xfeac8e};const _0x2591c8=_0x4932f1[_0x1d642b(0x207)]('/')?_0x4932f1[_0x1d642b(0x1f5)](0x1):_0x4932f1,_0x2a8fbe=_0x2591c8[_0x1d642b(0x200)]('/')['filter'](_0x5e8a15=>_0x5e8a15!=='');if(_0x2a8fbe[_0x1d642b(0x1f1)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x18ccf5=_0x4932f1[_0x1d642b(0x207)]('/')||!isRelativePathSegment(_0x2a8fbe[0x0]);for(const _0x5a9b67 of _0x2a8fbe){validatePathSegment(_0x5a9b67);}return{'segments':_0x2a8fbe,'isAbsolute':_0x18ccf5,'raw':_0xfeac8e};}function isRelativePathSegment(_0x211d24){return _0x211d24==='.'||_0x211d24==='..';}function validatePathSegment(_0x9aaeeb){const _0x298c3b=a102_0x2862;if(_0x9aaeeb==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x9aaeeb==='.'||_0x9aaeeb==='..')return;if(/[\x00-\x1F\x7F]/[_0x298c3b(0x204)](_0x9aaeeb))throw new Error(_0x298c3b(0x1f6)+_0x9aaeeb);if(_0x9aaeeb!==_0x9aaeeb[_0x298c3b(0x205)]()){}}export function validatePath(_0x156a18){const _0x1e42d2=a102_0x2862;if(_0x156a18[_0x1e42d2(0x201)][_0x1e42d2(0x1f1)]===0x0&&!_0x156a18[_0x1e42d2(0x1f3)])throw new Error(_0x1e42d2(0x20f));if(_0x156a18['isAbsolute']){if(_0x156a18[_0x1e42d2(0x201)][0x0]==='..')throw new Error(_0x1e42d2(0x202));let _0xa1f8c4=0x0;for(const _0x5821f0 of _0x156a18[_0x1e42d2(0x201)]){if(_0x5821f0==='..'){if(_0xa1f8c4===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0xa1f8c4--;}else _0x5821f0!=='.'&&_0xa1f8c4++;}}}export function joinPaths(_0x371a8b,_0x5d387e){const _0x36fa3f=a102_0x2862;if(!_0x371a8b||_0x371a8b==='/')return _0x5d387e;if(!_0x5d387e||_0x5d387e==='.')return _0x371a8b;if(_0x5d387e[_0x36fa3f(0x207)]('/'))return _0x5d387e;const _0xcb4f99=parsePath(_0x371a8b),_0x53fdf9=parsePath(_0x5d387e),_0x27c780=[..._0xcb4f99[_0x36fa3f(0x201)]];for(const _0x15e73b of _0x53fdf9[_0x36fa3f(0x201)]){if(_0x15e73b==='.')continue;else{if(_0x15e73b==='..'){if(_0x27c780[_0x36fa3f(0x1f1)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x27c780[_0x36fa3f(0x1e7)]();}else _0x27c780[_0x36fa3f(0x1ec)](_0x15e73b);}}const _0x5a6c20=_0x27c780[_0x36fa3f(0x1ed)]('/');return _0xcb4f99[_0x36fa3f(0x209)]['startsWith']('/')?'/'+_0x5a6c20:_0x5a6c20;}export function normalizePath(_0xffabdf){const _0x2a25a5=a102_0x2862,_0x5ccd65=parsePath(_0xffabdf),_0x21d310=[];for(const _0x476144 of _0x5ccd65[_0x2a25a5(0x201)]){if(_0x476144==='.')continue;else{if(_0x476144==='..'){if(_0x21d310['length']===0x0){if(_0x5ccd65[_0x2a25a5(0x1f3)])throw new Error(_0x2a25a5(0x210));_0x21d310[_0x2a25a5(0x1ec)]('..');}else _0x21d310[_0x21d310[_0x2a25a5(0x1f1)]-0x1]==='..'?_0x21d310['push']('..'):_0x21d310[_0x2a25a5(0x1e7)]();}else _0x21d310[_0x2a25a5(0x1ec)](_0x476144);}}if(_0x21d310[_0x2a25a5(0x1f1)]===0x0)return _0x5ccd65[_0x2a25a5(0x1f3)]?'/':'.';const _0x4c9368=_0x21d310[_0x2a25a5(0x1ed)]('/');return _0x5ccd65[_0x2a25a5(0x209)]['startsWith']('/')?'/'+_0x4c9368:_0x4c9368;}export function getParentPath(_0x49a57a){const _0x505b99=a102_0x2862,_0x5ba633=parsePath(_0x49a57a);if(_0x5ba633['segments']['length']<=0x1)return'/';const _0x9f1b2a=_0x5ba633['segments'][_0x505b99(0x1f7)](0x0,-0x1)[_0x505b99(0x1ed)]('/');return _0x5ba633[_0x505b99(0x209)]['startsWith']('/')?'/'+_0x9f1b2a:_0x9f1b2a;}export function getBaseName(_0x5bdd9c){const _0x1ca84d=a102_0x2862,_0xabf7cf=parsePath(_0x5bdd9c);return _0xabf7cf[_0x1ca84d(0x201)][_0xabf7cf['segments'][_0x1ca84d(0x1f1)]-0x1]||'';}export function isChildPath(_0x3199ef,_0x3906e5){const _0x135be9=a102_0x2862,_0x20cf7d=parsePath(_0x3199ef),_0x57b5ad=parsePath(_0x3906e5);if(_0x20cf7d['segments'][_0x135be9(0x1f1)]<=_0x57b5ad[_0x135be9(0x201)][_0x135be9(0x1f1)])return![];for(let _0x1da0a6=0x0;_0x1da0a6<_0x57b5ad[_0x135be9(0x201)][_0x135be9(0x1f1)];_0x1da0a6++){if(_0x20cf7d['segments'][_0x1da0a6]!==_0x57b5ad['segments'][_0x1da0a6])return![];}return!![];}export function splitPath(_0x711321){const _0xefc985=a102_0x2862,_0x2ad63d=parsePath(_0x711321);if(_0x2ad63d['segments'][_0xefc985(0x1f1)]===0x0)throw new Error(_0xefc985(0x1fc));if(_0x2ad63d[_0xefc985(0x201)][_0xefc985(0x1f1)]===0x1)return{'parent':_0x2ad63d[_0xefc985(0x201)][0x0]};return{'parent':_0x2ad63d['segments'][0x0],'child':_0x2ad63d['segments']['slice'](0x1)['join']('/')};}export function isYamlFilePath(_0x51bda9){const _0x5dd84f=a102_0x2862;return _0x51bda9[_0x5dd84f(0x20b)](_0x5dd84f(0x1ff))||_0x51bda9['endsWith']('.yaml');}export async function resolveYamlFilePath(_0x2aac25,_0x474100=nodeFileSystem){const _0x592c07=a102_0x2862,_0x3e5f4a=a102_0x4bf119[_0x592c07(0x1fb)](_0x2aac25);if(!await _0x474100['exists'](_0x3e5f4a))throw new Error(_0x592c07(0x206)+_0x2aac25);let _0x2f406d=a102_0x4bf119[_0x592c07(0x1e4)](_0x3e5f4a),_0x43032a=null,_0x263d8b=null;const _0x10f771=a102_0x4bf119[_0x592c07(0x1ef)](_0x2f406d)['root'];while(_0x2f406d!==_0x10f771){const _0x5f49c2=a102_0x4bf119[_0x592c07(0x1ed)](_0x2f406d,_0x592c07(0x1fd));if(await _0x474100[_0x592c07(0x208)](_0x5f49c2)){_0x43032a=_0x5f49c2,_0x263d8b=_0x2f406d;break;}_0x2f406d=a102_0x4bf119['dirname'](_0x2f406d);}if(!_0x43032a||!_0x263d8b)throw new Error(_0x592c07(0x1f0)+_0x2aac25);const _0x2fdb69=await _0x474100[_0x592c07(0x1e9)](_0x43032a),_0x2a4796=JSON[_0x592c07(0x1ef)](_0x2fdb69),_0x3ba69b=_0x2a4796[_0x592c07(0x1e2)];if(!_0x3ba69b)throw new Error(_0x592c07(0x1e8));const _0x3adae8=await _0x474100['readFile'](_0x3e5f4a),_0x1fd307=a102_0x159e68(_0x3adae8),_0x5a953e=_0x1fd307[_0x592c07(0x20c)];if(!_0x5a953e)throw new Error(_0x592c07(0x1e6)+_0x2aac25);const _0x2e578e=_0x1fd307[_0x592c07(0x1e5)]==='journey'?_0x592c07(0x20e):_0x592c07(0x1fe),_0x546e40=a102_0x4bf119[_0x592c07(0x1f8)](_0x263d8b,_0x3e5f4a),_0x556a48=a102_0x4bf119[_0x592c07(0x1e4)](_0x546e40),_0x574ed1=_0x556a48==='.'?'':_0x556a48['replace'](/\\/g,'/'),_0xe866d5=_0x574ed1?_0x3ba69b+'/'+_0x574ed1+'/'+_0x5a953e:_0x3ba69b+'/'+_0x5a953e;return{'parentSegment':_0x3ba69b,'segmentName':_0x5a953e,'folderPath':_0x574ed1,'fullPath':_0xe866d5,'resourceType':_0x2e578e};}
1
+ (function(_0x44b29c,_0x1f33e5){const _0x3241bc=a102_0x567e,_0x3b712a=_0x44b29c();while(!![]){try{const _0x4bc0b2=parseInt(_0x3241bc(0xd9))/0x1+-parseInt(_0x3241bc(0xd7))/0x2+parseInt(_0x3241bc(0xc5))/0x3+parseInt(_0x3241bc(0xc2))/0x4*(-parseInt(_0x3241bc(0xeb))/0x5)+parseInt(_0x3241bc(0xc1))/0x6*(-parseInt(_0x3241bc(0xd2))/0x7)+-parseInt(_0x3241bc(0xda))/0x8+parseInt(_0x3241bc(0xbf))/0x9*(parseInt(_0x3241bc(0xcd))/0xa);if(_0x4bc0b2===_0x1f33e5)break;else _0x3b712a['push'](_0x3b712a['shift']());}catch(_0x5f0dcd){_0x3b712a['push'](_0x3b712a['shift']());}}}(a102_0x94e8,0x25bbf));import a102_0xa1b348 from'path';import{parse as a102_0x28c8ef}from'yaml';function a102_0x567e(_0x4e697f,_0x4dee39){_0x4e697f=_0x4e697f-0xbf;const _0x94e89d=a102_0x94e8();let _0x567e9d=_0x94e89d[_0x4e697f];return _0x567e9d;}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x3b1b14){const _0x4f8abd=a102_0x567e;if(!_0x3b1b14||_0x3b1b14[_0x4f8abd(0xe0)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x33883c=_0x3b1b14[_0x4f8abd(0xe0)]();if(_0x33883c==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x3b1b14};const _0x16a757=_0x33883c[_0x4f8abd(0xe4)]('/')?_0x33883c[_0x4f8abd(0xdf)](0x1):_0x33883c,_0x3c59d2=_0x16a757[_0x4f8abd(0xc3)]('/')[_0x4f8abd(0xe8)](_0x49c07f=>_0x49c07f!=='');if(_0x3c59d2[_0x4f8abd(0xc9)]===0x0)throw new Error(_0x4f8abd(0xc8));const _0x541db1=_0x33883c['startsWith']('/')||!isRelativePathSegment(_0x3c59d2[0x0]);for(const _0x169989 of _0x3c59d2){validatePathSegment(_0x169989);}return{'segments':_0x3c59d2,'isAbsolute':_0x541db1,'raw':_0x3b1b14};}function isRelativePathSegment(_0x1e3b65){return _0x1e3b65==='.'||_0x1e3b65==='..';}function validatePathSegment(_0x279e6a){const _0x352998=a102_0x567e;if(_0x279e6a==='')throw new Error(_0x352998(0xcb));if(_0x279e6a==='.'||_0x279e6a==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x279e6a))throw new Error(_0x352998(0xed)+_0x279e6a);if(_0x279e6a!==_0x279e6a[_0x352998(0xe0)]()){}}export function validatePath(_0x498682){const _0x41645b=a102_0x567e;if(_0x498682[_0x41645b(0xe1)][_0x41645b(0xc9)]===0x0&&!_0x498682['isAbsolute'])throw new Error(_0x41645b(0xe5));if(_0x498682[_0x41645b(0xc6)]){if(_0x498682[_0x41645b(0xe1)][0x0]==='..')throw new Error(_0x41645b(0xe9));let _0x55948c=0x0;for(const _0x30866f of _0x498682[_0x41645b(0xe1)]){if(_0x30866f==='..'){if(_0x55948c===0x0)throw new Error(_0x41645b(0xca));_0x55948c--;}else _0x30866f!=='.'&&_0x55948c++;}}}export function joinPaths(_0x140708,_0x21ce32){const _0x14d575=a102_0x567e;if(!_0x140708||_0x140708==='/')return _0x21ce32;if(!_0x21ce32||_0x21ce32==='.')return _0x140708;if(_0x21ce32['startsWith']('/'))return _0x21ce32;const _0xebb467=parsePath(_0x140708),_0x197762=parsePath(_0x21ce32),_0x467336=[..._0xebb467[_0x14d575(0xe1)]];for(const _0xdeb1d of _0x197762[_0x14d575(0xe1)]){if(_0xdeb1d==='.')continue;else{if(_0xdeb1d==='..'){if(_0x467336['length']===0x0)throw new Error(_0x14d575(0xdb));_0x467336[_0x14d575(0xd8)]();}else _0x467336[_0x14d575(0xe2)](_0xdeb1d);}}const _0x23a8ea=_0x467336[_0x14d575(0xd5)]('/');return _0xebb467[_0x14d575(0xec)][_0x14d575(0xe4)]('/')?'/'+_0x23a8ea:_0x23a8ea;}export function normalizePath(_0x23335b){const _0x354627=a102_0x567e,_0x2e9c40=parsePath(_0x23335b),_0x2e7a92=[];for(const _0x464d0d of _0x2e9c40[_0x354627(0xe1)]){if(_0x464d0d==='.')continue;else{if(_0x464d0d==='..'){if(_0x2e7a92[_0x354627(0xc9)]===0x0){if(_0x2e9c40[_0x354627(0xc6)])throw new Error(_0x354627(0xdb));_0x2e7a92[_0x354627(0xe2)]('..');}else _0x2e7a92[_0x2e7a92[_0x354627(0xc9)]-0x1]==='..'?_0x2e7a92[_0x354627(0xe2)]('..'):_0x2e7a92[_0x354627(0xd8)]();}else _0x2e7a92[_0x354627(0xe2)](_0x464d0d);}}if(_0x2e7a92[_0x354627(0xc9)]===0x0)return _0x2e9c40['isAbsolute']?'/':'.';const _0x4ed61e=_0x2e7a92[_0x354627(0xd5)]('/');return _0x2e9c40['raw'][_0x354627(0xe4)]('/')?'/'+_0x4ed61e:_0x4ed61e;}export function getParentPath(_0x5c265f){const _0x213e4d=a102_0x567e,_0x15238a=parsePath(_0x5c265f);if(_0x15238a['segments']['length']<=0x1)return'/';const _0x3690b6=_0x15238a[_0x213e4d(0xe1)]['slice'](0x0,-0x1)[_0x213e4d(0xd5)]('/');return _0x15238a[_0x213e4d(0xec)][_0x213e4d(0xe4)]('/')?'/'+_0x3690b6:_0x3690b6;}export function getBaseName(_0xcf862f){const _0x1587f1=a102_0x567e,_0x8021f6=parsePath(_0xcf862f);return _0x8021f6['segments'][_0x8021f6[_0x1587f1(0xe1)][_0x1587f1(0xc9)]-0x1]||'';}function a102_0x94e8(){const _0x3a9cce=['1349930PXfLAh','raw','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','18lrEmpU','readFile','11208DpnnOO','4jiFrPJ','split','parse','148446rtRxhG','isAbsolute','File\x20not\x20found:\x20','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','length','Path\x20attempts\x20to\x20navigate\x20above\x20root','Path\x20segment\x20cannot\x20be\x20empty','type','3341570MprnCk','segment','tdx.json','journey','endsWith','497rALVZk','.yaml','dirname','join','.yml','336794nkrxbU','pop','103624YHeXoQ','766800jBeghN','Cannot\x20navigate\x20above\x20root','root','replace','Cannot\x20split\x20empty\x20path','substring','trim','segments','push','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','startsWith','Relative\x20path\x20cannot\x20be\x20empty','resolve','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','filter','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','exists'];a102_0x94e8=function(){return _0x3a9cce;};return a102_0x94e8();}export function isChildPath(_0x47ad51,_0x51b41b){const _0x5b8a0e=a102_0x567e,_0xd27eb7=parsePath(_0x47ad51),_0x364e1d=parsePath(_0x51b41b);if(_0xd27eb7[_0x5b8a0e(0xe1)][_0x5b8a0e(0xc9)]<=_0x364e1d[_0x5b8a0e(0xe1)][_0x5b8a0e(0xc9)])return![];for(let _0x6ca322=0x0;_0x6ca322<_0x364e1d[_0x5b8a0e(0xe1)][_0x5b8a0e(0xc9)];_0x6ca322++){if(_0xd27eb7['segments'][_0x6ca322]!==_0x364e1d[_0x5b8a0e(0xe1)][_0x6ca322])return![];}return!![];}export function splitPath(_0x13326e){const _0x160193=a102_0x567e,_0x106e0c=parsePath(_0x13326e);if(_0x106e0c['segments'][_0x160193(0xc9)]===0x0)throw new Error(_0x160193(0xde));if(_0x106e0c['segments']['length']===0x1)return{'parent':_0x106e0c['segments'][0x0]};return{'parent':_0x106e0c[_0x160193(0xe1)][0x0],'child':_0x106e0c[_0x160193(0xe1)]['slice'](0x1)[_0x160193(0xd5)]('/')};}export function isYamlFilePath(_0x60662c){const _0x2b8f45=a102_0x567e;return _0x60662c[_0x2b8f45(0xd1)](_0x2b8f45(0xd6))||_0x60662c['endsWith'](_0x2b8f45(0xd3));}export async function resolveYamlFilePath(_0x25e5d6,_0x1f09eb=nodeFileSystem){const _0x225368=a102_0x567e,_0x3cff1a=a102_0xa1b348[_0x225368(0xe6)](_0x25e5d6);if(!await _0x1f09eb['exists'](_0x3cff1a))throw new Error(_0x225368(0xc7)+_0x25e5d6);let _0x195575=a102_0xa1b348[_0x225368(0xd4)](_0x3cff1a),_0x5ca6e1=null,_0x36db10=null;const _0x2a2fc2=a102_0xa1b348[_0x225368(0xc4)](_0x195575)[_0x225368(0xdc)];while(_0x195575!==_0x2a2fc2){const _0x1552d9=a102_0xa1b348[_0x225368(0xd5)](_0x195575,_0x225368(0xcf));if(await _0x1f09eb[_0x225368(0xea)](_0x1552d9)){_0x5ca6e1=_0x1552d9,_0x36db10=_0x195575;break;}_0x195575=a102_0xa1b348[_0x225368(0xd4)](_0x195575);}if(!_0x5ca6e1||!_0x36db10)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x25e5d6);const _0x3c3eaf=await _0x1f09eb[_0x225368(0xc0)](_0x5ca6e1),_0x2a1efd=JSON[_0x225368(0xc4)](_0x3c3eaf),_0x32c3da=_0x2a1efd['parent_segment'];if(!_0x32c3da)throw new Error(_0x225368(0xe7));const _0x562ab9=await _0x1f09eb[_0x225368(0xc0)](_0x3cff1a),_0x5cb609=a102_0x28c8ef(_0x562ab9),_0x21cf6f=_0x5cb609['name'];if(!_0x21cf6f)throw new Error(_0x225368(0xe3)+_0x25e5d6);const _0x4bda6a=_0x5cb609[_0x225368(0xcc)]===_0x225368(0xd0)?_0x225368(0xd0):_0x225368(0xce),_0x5de5ce=a102_0xa1b348['relative'](_0x36db10,_0x3cff1a),_0x156bd3=a102_0xa1b348['dirname'](_0x5de5ce),_0x449805=_0x156bd3==='.'?'':_0x156bd3[_0x225368(0xdd)](/\\/g,'/'),_0x8a46e3=_0x449805?_0x32c3da+'/'+_0x449805+'/'+_0x21cf6f:_0x32c3da+'/'+_0x21cf6f;return{'parentSegment':_0x32c3da,'segmentName':_0x21cf6f,'folderPath':_0x449805,'fullPath':_0x8a46e3,'resourceType':_0x4bda6a};}
@@ -1 +1 @@
1
- function a103_0x19f9(){const _0x28a501=['2146220QuoTyi','3006342YKkBvM','Invalid\x20segment\x20reference\x20format:\x20','433812ZxLXCu','415872LAiOyr','10vQCfHh','indexOf','3poCdzw','15810399Hjsaze','495650yHWpVD','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring','7hNmPEu','.\x20Child\x20name\x20cannot\x20be\x20empty','286952BegbPu'];a103_0x19f9=function(){return _0x28a501;};return a103_0x19f9();}function a103_0x2d9d(_0x419ba5,_0x20c401){_0x419ba5=_0x419ba5-0x12c;const _0x19f970=a103_0x19f9();let _0x2d9d39=_0x19f970[_0x419ba5];return _0x2d9d39;}(function(_0x1ef557,_0x672136){const _0x1696a1=a103_0x2d9d,_0x10828f=_0x1ef557();while(!![]){try{const _0x2b0a3e=-parseInt(_0x1696a1(0x132))/0x1+-parseInt(_0x1696a1(0x12d))/0x2+parseInt(_0x1696a1(0x130))/0x3*(parseInt(_0x1696a1(0x12c))/0x4)+-parseInt(_0x1696a1(0x138))/0x5+-parseInt(_0x1696a1(0x139))/0x6*(parseInt(_0x1696a1(0x135))/0x7)+parseInt(_0x1696a1(0x137))/0x8+parseInt(_0x1696a1(0x131))/0x9*(parseInt(_0x1696a1(0x12e))/0xa);if(_0x2b0a3e===_0x672136)break;else _0x10828f['push'](_0x10828f['shift']());}catch(_0x448931){_0x10828f['push'](_0x10828f['shift']());}}}(a103_0x19f9,0x4138a));export function parseSegmentRef(_0x2ed90c){const _0x72f7e9=a103_0x2d9d,_0x2e5811=_0x2ed90c[_0x72f7e9(0x12f)]('/');if(_0x2e5811===-0x1)return{'parentId':_0x2ed90c};if(_0x2e5811===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2ed90c+_0x72f7e9(0x133));const _0x56f7f8=_0x2ed90c[_0x72f7e9(0x134)](0x0,_0x2e5811),_0x4246a3=_0x2ed90c['substring'](_0x2e5811+0x1);if(_0x4246a3==='')throw new Error(_0x72f7e9(0x13a)+_0x2ed90c+_0x72f7e9(0x136));return{'parentId':_0x56f7f8,'childId':_0x4246a3};}
1
+ function a103_0x2933(_0x456204,_0x465d58){_0x456204=_0x456204-0x113;const _0x333640=a103_0x3336();let _0x2933a7=_0x333640[_0x456204];return _0x2933a7;}(function(_0x196070,_0x13648c){const _0x394c57=a103_0x2933,_0x2bf1f3=_0x196070();while(!![]){try{const _0x4ae25e=-parseInt(_0x394c57(0x118))/0x1+-parseInt(_0x394c57(0x115))/0x2+parseInt(_0x394c57(0x11b))/0x3+-parseInt(_0x394c57(0x113))/0x4+parseInt(_0x394c57(0x114))/0x5+-parseInt(_0x394c57(0x11e))/0x6*(-parseInt(_0x394c57(0x117))/0x7)+parseInt(_0x394c57(0x11f))/0x8;if(_0x4ae25e===_0x13648c)break;else _0x2bf1f3['push'](_0x2bf1f3['shift']());}catch(_0x131e6a){_0x2bf1f3['push'](_0x2bf1f3['shift']());}}}(a103_0x3336,0x83893));export function parseSegmentRef(_0x101c37){const _0x2b9446=a103_0x2933,_0x33e301=_0x101c37[_0x2b9446(0x119)]('/');if(_0x33e301===-0x1)return{'parentId':_0x101c37};if(_0x33e301===0x0)throw new Error(_0x2b9446(0x116)+_0x101c37+_0x2b9446(0x11c));const _0x3ded61=_0x101c37[_0x2b9446(0x11d)](0x0,_0x33e301),_0x5ced79=_0x101c37['substring'](_0x33e301+0x1);if(_0x5ced79==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x101c37+_0x2b9446(0x11a));return{'parentId':_0x3ded61,'childId':_0x5ced79};}function a103_0x3336(){const _0x2e3568=['48nxKaaD','5388608tizmcQ','4157908oeaSNg','2963030LyLRBn','371360VgXIJQ','Invalid\x20segment\x20reference\x20format:\x20','603652vEEMZo','390317vnldss','indexOf','.\x20Child\x20name\x20cannot\x20be\x20empty','594525zUsklz','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring'];a103_0x3336=function(){return _0x2e3568;};return a103_0x3336();}
@@ -1 +1 @@
1
- (function(_0x15e651,_0x58a0b7){const _0x57a3ba=a104_0x3ba5,_0x3e18e1=_0x15e651();while(!![]){try{const _0x272681=parseInt(_0x57a3ba(0x1d6))/0x1+parseInt(_0x57a3ba(0x1de))/0x2*(parseInt(_0x57a3ba(0x1df))/0x3)+-parseInt(_0x57a3ba(0x202))/0x4*(parseInt(_0x57a3ba(0x20d))/0x5)+-parseInt(_0x57a3ba(0x1db))/0x6*(-parseInt(_0x57a3ba(0x1f1))/0x7)+-parseInt(_0x57a3ba(0x200))/0x8+-parseInt(_0x57a3ba(0x20c))/0x9*(-parseInt(_0x57a3ba(0x209))/0xa)+-parseInt(_0x57a3ba(0x205))/0xb;if(_0x272681===_0x58a0b7)break;else _0x3e18e1['push'](_0x3e18e1['shift']());}catch(_0x1869cc){_0x3e18e1['push'](_0x3e18e1['shift']());}}}(a104_0x351d,0x65f59));import a104_0x2c2053 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x287136){const _0x3742da=a104_0x3ba5;return _0x287136[_0x3742da(0x1e8)]!=='error';}export function isScopedResolution(_0x22cf69){const _0x42dedb=a104_0x3ba5;return _0x22cf69[_0x42dedb(0x1e8)]==='directory'||_0x22cf69['type']===_0x42dedb(0x1f5)||_0x22cf69[_0x42dedb(0x1e8)]===_0x42dedb(0x20f);}function a104_0x351d(){const _0x4f045f=['join','extname','4095144dtlJhZ','File\x20not\x20found','76KcjJRA','segment','resourceType','2314862RqVdQj','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','Parent\x20segment\x20not\x20specified','string','10990sNUyMK','no_parent','parentSegment','279cFuMAW','2410kjKxjx','parent_name','context','scopedFolderPath','497708TIBSIV','readFile','folderPath','message','error','3102276OppZBJ','File\x20not\x20found:\x20','root','130LnEAmW','4629KNlghc','stat','No\x20tdx.json\x20found','match','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Not\x20a\x20YAML\x20file:\x20','journey','includes','No\x20tdx.json\x20found\x20for\x20file:\x20','type','resolve','cwd','invalid_yaml','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','replace','directory','configDir','isScoped','7nAYbnj','trim','file_not_found','dirname','file','tdx.json','no_config','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','exists','parent_segment','basename','parse','segmentName'];a104_0x351d=function(){return _0x4f045f;};return a104_0x351d();}export function getScopedDetails(_0xd96558){const _0x29b98f=a104_0x3ba5;if(isScopedResolution(_0xd96558))return{'isScoped':_0xd96558[_0x29b98f(0x1f0)],'scopedFolderPath':_0xd96558['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x111db1,_0x3dbb10){const _0x1dc57c=a104_0x3ba5;let _0x2492f4=a104_0x2c2053[_0x1dc57c(0x1e9)](_0x111db1);const _0x55242b=a104_0x2c2053['parse'](_0x2492f4)[_0x1dc57c(0x1dd)];while(_0x2492f4!==_0x55242b){const _0x24b9e0=a104_0x2c2053[_0x1dc57c(0x1fe)](_0x2492f4,_0x1dc57c(0x1f6));if(await _0x3dbb10[_0x1dc57c(0x1f9)](_0x24b9e0))try{const _0x336e4b=await _0x3dbb10[_0x1dc57c(0x1d7)](_0x24b9e0),_0x1c4932=JSON[_0x1dc57c(0x1fc)](_0x336e4b);if(_0x1c4932[_0x1dc57c(0x1fa)]&&typeof _0x1c4932[_0x1dc57c(0x1fa)]===_0x1dc57c(0x208))return{'configPath':_0x24b9e0,'configDir':_0x2492f4,'parentSegment':_0x1c4932['parent_segment']};}catch{}_0x2492f4=a104_0x2c2053['dirname'](_0x2492f4);}return null;}function a104_0x3ba5(_0x4e692e,_0x590d79){_0x4e692e=_0x4e692e-0x1d6;const _0x351d9a=a104_0x351d();let _0x3ba5e9=_0x351d9a[_0x4e692e];return _0x3ba5e9;}function calculateScopedPath(_0x120e6b,_0x146969){const _0x237259=a104_0x3ba5,_0x131989=a104_0x2c2053['relative'](_0x146969,_0x120e6b),_0x29db6d=_0x131989!==''&&_0x131989!=='.'&&!_0x131989['startsWith']('..');return{'isScoped':_0x29db6d,'scopedFolderPath':_0x29db6d?_0x131989[_0x237259(0x1ed)](/\\/g,'/'):''};}export async function resolveTarget(_0x1c9060){const _0x2ae4a3=a104_0x3ba5,{arg:_0x41f349,contextParent:_0x484a66,cwd:cwd=process[_0x2ae4a3(0x1ea)](),fs:fs=nodeFileSystem}=_0x1c9060;if(_0x41f349&&isYamlFilePath(_0x41f349))try{const _0x5375f2=await resolveYamlFilePath(_0x41f349,fs),_0x5e7813=a104_0x2c2053['resolve'](_0x41f349),_0x4cb4f5=a104_0x2c2053[_0x2ae4a3(0x1f4)](_0x5e7813),_0x35db88=await findTdxConfigAsync(_0x4cb4f5,fs);if(!_0x35db88){if(_0x484a66){const _0x54ca07=a104_0x2c2053[_0x2ae4a3(0x1f4)](_0x5e7813);return{'type':_0x2ae4a3(0x1f5),'parentName':_0x484a66,'targetDir':_0x54ca07,'configRoot':_0x54ca07,'filePath':_0x5e7813,'resourceName':_0x5375f2[_0x2ae4a3(0x1fd)],'folderPath':_0x5375f2[_0x2ae4a3(0x1d8)],'resourceType':_0x5375f2[_0x2ae4a3(0x204)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1f7),'message':_0x2ae4a3(0x1e7)+_0x41f349,'arg':_0x41f349,'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 _0x394f64=calculateScopedPath(_0x4cb4f5,_0x35db88[_0x2ae4a3(0x1ef)]);return{'type':_0x2ae4a3(0x1f5),'parentName':_0x35db88[_0x2ae4a3(0x20b)],'targetDir':_0x35db88[_0x2ae4a3(0x1ef)],'configRoot':_0x35db88[_0x2ae4a3(0x1ef)],'filePath':_0x5e7813,'resourceName':_0x5375f2[_0x2ae4a3(0x1fd)],'folderPath':_0x5375f2[_0x2ae4a3(0x1d8)],'resourceType':_0x5375f2[_0x2ae4a3(0x204)],'isScoped':_0x394f64[_0x2ae4a3(0x1f0)],'scopedFolderPath':_0x394f64[_0x2ae4a3(0x210)]};}catch(_0x51f007){const _0x1aaa4c=_0x51f007 instanceof Error?_0x51f007[_0x2ae4a3(0x1d9)]:String(_0x51f007);if(_0x1aaa4c['includes'](_0x2ae4a3(0x201)))return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1f3),'message':_0x2ae4a3(0x1dc)+_0x41f349,'arg':_0x41f349};if(_0x1aaa4c[_0x2ae4a3(0x1e6)](_0x2ae4a3(0x1e1))){if(_0x484a66){const _0x4114c7=a104_0x2c2053[_0x2ae4a3(0x1e9)](_0x41f349);if(await fs[_0x2ae4a3(0x1f9)](_0x4114c7)){const _0x15628a=a104_0x2c2053[_0x2ae4a3(0x1f4)](_0x4114c7),_0xa04114=await fs[_0x2ae4a3(0x1d7)](_0x4114c7),_0x1d8f0c=_0xa04114['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x4ee644=_0xa04114[_0x2ae4a3(0x1e2)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x101a6c=_0x1d8f0c?_0x1d8f0c[0x1]['trim']():a104_0x2c2053[_0x2ae4a3(0x1fb)](_0x41f349,a104_0x2c2053[_0x2ae4a3(0x1ff)](_0x41f349)),_0x35f45a=_0x4ee644&&_0x4ee644[0x1][_0x2ae4a3(0x1f2)]()===_0x2ae4a3(0x1e5)?_0x2ae4a3(0x1e5):_0x2ae4a3(0x203);return{'type':_0x2ae4a3(0x1f5),'parentName':_0x484a66,'targetDir':_0x15628a,'configRoot':_0x15628a,'filePath':_0x4114c7,'resourceName':_0x101a6c,'folderPath':'','resourceType':_0x35f45a,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1f7),'message':_0x2ae4a3(0x1e7)+_0x41f349,'arg':_0x41f349,'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'};}return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1eb),'message':_0x1aaa4c,'arg':_0x41f349};}if(_0x41f349){const _0x537405=a104_0x2c2053[_0x2ae4a3(0x1e9)](cwd,_0x41f349);let _0x1a90f5=null;try{_0x1a90f5=await fs[_0x2ae4a3(0x1e0)](_0x537405);}catch{}if(_0x1a90f5?.['isDirectory']()){const _0x48f447=await findTdxConfigAsync(_0x537405,fs);if(_0x48f447){const _0x414025=calculateScopedPath(_0x537405,_0x48f447['configDir']);return{'type':'directory','parentName':_0x48f447[_0x2ae4a3(0x20b)],'targetDir':_0x537405,'configRoot':_0x48f447['configDir'],'isScoped':_0x414025[_0x2ae4a3(0x1f0)],'scopedFolderPath':_0x414025[_0x2ae4a3(0x210)]};}if(_0x484a66)return{'type':_0x2ae4a3(0x1ee),'parentName':_0x484a66,'targetDir':_0x537405,'configRoot':_0x537405,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x2ae4a3(0x1f7),'message':_0x2ae4a3(0x1e3)+_0x41f349,'arg':_0x41f349,'helpText':_0x2ae4a3(0x206)};}if(_0x1a90f5?.['isFile']())return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1eb),'message':_0x2ae4a3(0x1e4)+_0x41f349,'arg':_0x41f349,'helpText':_0x2ae4a3(0x1f8)};const _0x3f1d72=sanitizeFileName(_0x41f349),_0x18859b=getSegmentRootDir(_0x3f1d72,cwd);return{'type':_0x2ae4a3(0x20e),'parentName':_0x41f349,'targetDir':_0x18859b,'configRoot':_0x18859b};}const _0x486ac4=await findTdxConfigAsync(cwd,fs);if(_0x486ac4){const _0x12ae28=calculateScopedPath(cwd,_0x486ac4[_0x2ae4a3(0x1ef)]);return{'type':_0x2ae4a3(0x20f),'parentName':_0x486ac4[_0x2ae4a3(0x20b)],'targetDir':cwd,'configRoot':_0x486ac4[_0x2ae4a3(0x1ef)],'isScoped':_0x12ae28[_0x2ae4a3(0x1f0)],'scopedFolderPath':_0x12ae28[_0x2ae4a3(0x210)]};}if(_0x484a66){const _0x17f81c=sanitizeFileName(_0x484a66),_0x3539cd=getSegmentRootDir(_0x17f81c,cwd);return{'type':_0x2ae4a3(0x20f),'parentName':_0x484a66,'targetDir':_0x3539cd,'configRoot':_0x3539cd,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x2ae4a3(0x20a),'message':_0x2ae4a3(0x207),'helpText':_0x2ae4a3(0x1ec)};}
1
+ (function(_0x20e867,_0x55e60b){const _0x4dcd7a=a104_0x1ed7,_0x117659=_0x20e867();while(!![]){try{const _0x57faac=parseInt(_0x4dcd7a(0x141))/0x1*(parseInt(_0x4dcd7a(0x14e))/0x2)+-parseInt(_0x4dcd7a(0x13b))/0x3*(parseInt(_0x4dcd7a(0x118))/0x4)+-parseInt(_0x4dcd7a(0x128))/0x5+parseInt(_0x4dcd7a(0x13a))/0x6*(-parseInt(_0x4dcd7a(0x12c))/0x7)+parseInt(_0x4dcd7a(0x135))/0x8*(-parseInt(_0x4dcd7a(0x13c))/0x9)+parseInt(_0x4dcd7a(0x124))/0xa+-parseInt(_0x4dcd7a(0x133))/0xb*(-parseInt(_0x4dcd7a(0x126))/0xc);if(_0x57faac===_0x55e60b)break;else _0x117659['push'](_0x117659['shift']());}catch(_0x3b831d){_0x117659['push'](_0x117659['shift']());}}}(a104_0x1a36,0xa2ce5));import a104_0x195a8e from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x3f926b){const _0xb375d5=a104_0x1ed7;return _0x3f926b[_0xb375d5(0x14a)]!=='error';}export function isScopedResolution(_0x18cd5d){const _0x239f5c=a104_0x1ed7;return _0x18cd5d[_0x239f5c(0x14a)]==='directory'||_0x18cd5d[_0x239f5c(0x14a)]===_0x239f5c(0x12e)||_0x18cd5d[_0x239f5c(0x14a)]===_0x239f5c(0x13d);}function a104_0x1a36(){const _0xd04229=['directory','Parent\x20segment\x20not\x20specified','parentSegment','Not\x20a\x20YAML\x20file:\x20','isDirectory','no_config','1933940bfqHRB','exists','1668GqlLSg','no_parent','6035000fFWqFG','isScoped','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','resolve','7yfNnle','extname','file','dirname','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','relative','journey','309397TRLWSj','folderPath','529248VGVLCr','resourceType','trim','segmentName','root','5937528NIZcUb','12goYVJh','180AEAEKN','context','readFile','segment','error','30hXlNJM','basename','cwd','parse','File\x20not\x20found','parent_segment','replace','invalid_yaml','scopedFolderPath','type','configDir','file_not_found','match','33574uFDBRu','No\x20tdx.json\x20found','string','includes','420096jFOsWv','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','join','isFile','No\x20tdx.json\x20found\x20for\x20file:\x20','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'];a104_0x1a36=function(){return _0xd04229;};return a104_0x1a36();}export function getScopedDetails(_0x279df9){const _0x320711=a104_0x1ed7;if(isScopedResolution(_0x279df9))return{'isScoped':_0x279df9[_0x320711(0x129)],'scopedFolderPath':_0x279df9[_0x320711(0x149)]};return undefined;}function a104_0x1ed7(_0x21bf13,_0x2db8c0){_0x21bf13=_0x21bf13-0x118;const _0x1a36f5=a104_0x1a36();let _0x1ed7fa=_0x1a36f5[_0x21bf13];return _0x1ed7fa;}async function findTdxConfigAsync(_0x210385,_0x2de6df){const _0x5bc83a=a104_0x1ed7;let _0x1f11c8=a104_0x195a8e[_0x5bc83a(0x12b)](_0x210385);const _0xb3f346=a104_0x195a8e[_0x5bc83a(0x144)](_0x1f11c8)[_0x5bc83a(0x139)];while(_0x1f11c8!==_0xb3f346){const _0x41f2ae=a104_0x195a8e[_0x5bc83a(0x11a)](_0x1f11c8,'tdx.json');if(await _0x2de6df[_0x5bc83a(0x125)](_0x41f2ae))try{const _0x180b98=await _0x2de6df[_0x5bc83a(0x13e)](_0x41f2ae),_0x2c7600=JSON[_0x5bc83a(0x144)](_0x180b98);if(_0x2c7600[_0x5bc83a(0x146)]&&typeof _0x2c7600[_0x5bc83a(0x146)]===_0x5bc83a(0x150))return{'configPath':_0x41f2ae,'configDir':_0x1f11c8,'parentSegment':_0x2c7600[_0x5bc83a(0x146)]};}catch{}_0x1f11c8=a104_0x195a8e[_0x5bc83a(0x12f)](_0x1f11c8);}return null;}function calculateScopedPath(_0x4b6fa4,_0x54d663){const _0x2d548d=a104_0x1ed7,_0x105065=a104_0x195a8e[_0x2d548d(0x131)](_0x54d663,_0x4b6fa4),_0x37125f=_0x105065!==''&&_0x105065!=='.'&&!_0x105065['startsWith']('..');return{'isScoped':_0x37125f,'scopedFolderPath':_0x37125f?_0x105065[_0x2d548d(0x147)](/\\/g,'/'):''};}export async function resolveTarget(_0x3fb3e2){const _0x5916eb=a104_0x1ed7,{arg:_0x470489,contextParent:_0x4115bf,cwd:cwd=process[_0x5916eb(0x143)](),fs:fs=nodeFileSystem}=_0x3fb3e2;if(_0x470489&&isYamlFilePath(_0x470489))try{const _0x5531d2=await resolveYamlFilePath(_0x470489,fs),_0x4dae50=a104_0x195a8e[_0x5916eb(0x12b)](_0x470489),_0x25b5d3=a104_0x195a8e['dirname'](_0x4dae50),_0x4bc086=await findTdxConfigAsync(_0x25b5d3,fs);if(!_0x4bc086){if(_0x4115bf){const _0x2d9892=a104_0x195a8e[_0x5916eb(0x12f)](_0x4dae50);return{'type':_0x5916eb(0x12e),'parentName':_0x4115bf,'targetDir':_0x2d9892,'configRoot':_0x2d9892,'filePath':_0x4dae50,'resourceName':_0x5531d2[_0x5916eb(0x138)],'folderPath':_0x5531d2[_0x5916eb(0x134)],'resourceType':_0x5531d2[_0x5916eb(0x136)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5916eb(0x140),'errorCode':_0x5916eb(0x123),'message':_0x5916eb(0x11c)+_0x470489,'arg':_0x470489,'helpText':_0x5916eb(0x119)};}const _0x131f11=calculateScopedPath(_0x25b5d3,_0x4bc086['configDir']);return{'type':_0x5916eb(0x12e),'parentName':_0x4bc086[_0x5916eb(0x120)],'targetDir':_0x4bc086[_0x5916eb(0x14b)],'configRoot':_0x4bc086[_0x5916eb(0x14b)],'filePath':_0x4dae50,'resourceName':_0x5531d2['segmentName'],'folderPath':_0x5531d2[_0x5916eb(0x134)],'resourceType':_0x5531d2[_0x5916eb(0x136)],'isScoped':_0x131f11['isScoped'],'scopedFolderPath':_0x131f11[_0x5916eb(0x149)]};}catch(_0x2d1c17){const _0x3955df=_0x2d1c17 instanceof Error?_0x2d1c17['message']:String(_0x2d1c17);if(_0x3955df[_0x5916eb(0x151)](_0x5916eb(0x145)))return{'type':_0x5916eb(0x140),'errorCode':_0x5916eb(0x14c),'message':'File\x20not\x20found:\x20'+_0x470489,'arg':_0x470489};if(_0x3955df[_0x5916eb(0x151)](_0x5916eb(0x14f))){if(_0x4115bf){const _0x3016c8=a104_0x195a8e[_0x5916eb(0x12b)](_0x470489);if(await fs[_0x5916eb(0x125)](_0x3016c8)){const _0x37290b=a104_0x195a8e[_0x5916eb(0x12f)](_0x3016c8),_0x5e54d9=await fs['readFile'](_0x3016c8),_0x5bcfb7=_0x5e54d9[_0x5916eb(0x14d)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x1dea7f=_0x5e54d9['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4df7e7=_0x5bcfb7?_0x5bcfb7[0x1][_0x5916eb(0x137)]():a104_0x195a8e[_0x5916eb(0x142)](_0x470489,a104_0x195a8e[_0x5916eb(0x12d)](_0x470489)),_0x2d9fc8=_0x1dea7f&&_0x1dea7f[0x1][_0x5916eb(0x137)]()===_0x5916eb(0x132)?'journey':_0x5916eb(0x13f);return{'type':_0x5916eb(0x12e),'parentName':_0x4115bf,'targetDir':_0x37290b,'configRoot':_0x37290b,'filePath':_0x3016c8,'resourceName':_0x4df7e7,'folderPath':'','resourceType':_0x2d9fc8,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':'no_config','message':_0x5916eb(0x11c)+_0x470489,'arg':_0x470489,'helpText':_0x5916eb(0x119)};}return{'type':'error','errorCode':'invalid_yaml','message':_0x3955df,'arg':_0x470489};}if(_0x470489){const _0x8ba626=a104_0x195a8e[_0x5916eb(0x12b)](cwd,_0x470489);let _0x1e655a=null;try{_0x1e655a=await fs['stat'](_0x8ba626);}catch{}if(_0x1e655a?.[_0x5916eb(0x122)]()){const _0x16a443=await findTdxConfigAsync(_0x8ba626,fs);if(_0x16a443){const _0x5911b1=calculateScopedPath(_0x8ba626,_0x16a443[_0x5916eb(0x14b)]);return{'type':'directory','parentName':_0x16a443[_0x5916eb(0x120)],'targetDir':_0x8ba626,'configRoot':_0x16a443[_0x5916eb(0x14b)],'isScoped':_0x5911b1[_0x5916eb(0x129)],'scopedFolderPath':_0x5911b1[_0x5916eb(0x149)]};}if(_0x4115bf)return{'type':_0x5916eb(0x11e),'parentName':_0x4115bf,'targetDir':_0x8ba626,'configRoot':_0x8ba626,'isScoped':![],'scopedFolderPath':''};return{'type':_0x5916eb(0x140),'errorCode':_0x5916eb(0x123),'message':_0x5916eb(0x130)+_0x470489,'arg':_0x470489,'helpText':_0x5916eb(0x119)};}if(_0x1e655a?.[_0x5916eb(0x11b)]())return{'type':'error','errorCode':_0x5916eb(0x148),'message':_0x5916eb(0x121)+_0x470489,'arg':_0x470489,'helpText':_0x5916eb(0x11d)};const _0x27c5e5=sanitizeFileName(_0x470489),_0x369919=getSegmentRootDir(_0x27c5e5,cwd);return{'type':'parent_name','parentName':_0x470489,'targetDir':_0x369919,'configRoot':_0x369919};}const _0x4d7ae5=await findTdxConfigAsync(cwd,fs);if(_0x4d7ae5){const _0x12efd1=calculateScopedPath(cwd,_0x4d7ae5['configDir']);return{'type':_0x5916eb(0x13d),'parentName':_0x4d7ae5['parentSegment'],'targetDir':cwd,'configRoot':_0x4d7ae5[_0x5916eb(0x14b)],'isScoped':_0x12efd1['isScoped'],'scopedFolderPath':_0x12efd1[_0x5916eb(0x149)]};}if(_0x4115bf){const _0x1677b5=sanitizeFileName(_0x4115bf),_0x592533=getSegmentRootDir(_0x1677b5,cwd);return{'type':'context','parentName':_0x4115bf,'targetDir':_0x592533,'configRoot':_0x592533,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x5916eb(0x127),'message':_0x5916eb(0x11f),'helpText':_0x5916eb(0x12a)};}
@@ -1 +1 @@
1
- const a105_0x316567=a105_0x16ef;(function(_0x583e17,_0x4a3cdc){const _0x3ce386=a105_0x16ef,_0x26ab3d=_0x583e17();while(!![]){try{const _0x257dd6=parseInt(_0x3ce386(0x105))/0x1*(-parseInt(_0x3ce386(0x117))/0x2)+-parseInt(_0x3ce386(0x103))/0x3*(-parseInt(_0x3ce386(0x10a))/0x4)+parseInt(_0x3ce386(0x116))/0x5*(-parseInt(_0x3ce386(0x107))/0x6)+-parseInt(_0x3ce386(0xfe))/0x7*(-parseInt(_0x3ce386(0x109))/0x8)+-parseInt(_0x3ce386(0x111))/0x9+parseInt(_0x3ce386(0xfc))/0xa+parseInt(_0x3ce386(0x10b))/0xb;if(_0x257dd6===_0x4a3cdc)break;else _0x26ab3d['push'](_0x26ab3d['shift']());}catch(_0x3c51be){_0x26ab3d['push'](_0x26ab3d['shift']());}}}(a105_0x48e5,0x753c5));function a105_0x48e5(){const _0x5c3f4c=['524iXiNwb','22978131kXCYbp','parent_segment','string','root','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','5576337BIFJEo','startsWith','tdx.json','replace','join','3018325aBHWZr','2SbpUQO','1398250unRsZe','object','91385HetQJZ','resolve','cwd','Invalid\x20tdx.json:\x20expected\x20object','dirname','3855CvcYoP','parse','745846pfRZLa','relative','6cSOMGK','Invalid\x20JSON\x20in\x20','32wBVuIf'];a105_0x48e5=function(){return _0x5c3f4c;};return a105_0x48e5();}import{existsSync,readFileSync}from'fs';import a105_0x14be35 from'path';const TDX_CONFIG_FILE=a105_0x316567(0x113),SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x5d973a=process['cwd']()){const _0x2f1bb0=a105_0x316567;let _0x5ee1a5=a105_0x14be35[_0x2f1bb0(0xff)](_0x5d973a);const _0xcf30cf=a105_0x14be35[_0x2f1bb0(0x104)](_0x5ee1a5)[_0x2f1bb0(0x10e)];while(_0x5ee1a5!==_0xcf30cf){const _0x3813df=a105_0x14be35['join'](_0x5ee1a5,TDX_CONFIG_FILE);if(existsSync(_0x3813df))return _0x3813df;_0x5ee1a5=a105_0x14be35[_0x2f1bb0(0x102)](_0x5ee1a5);}return null;}export function loadTdxConfig(_0x5b3108){const _0x2c1f00=a105_0x316567,_0x2eebae=readFileSync(_0x5b3108,'utf-8');let _0x169183;try{_0x169183=JSON[_0x2c1f00(0x104)](_0x2eebae);}catch{throw new Error(_0x2c1f00(0x108)+_0x5b3108);}if(!_0x169183||typeof _0x169183!==_0x2c1f00(0xfd))throw new Error(_0x2c1f00(0x101));const _0xd6d9fb=_0x169183;if(!_0xd6d9fb['parent_segment']||typeof _0xd6d9fb[_0x2c1f00(0x10c)]!==_0x2c1f00(0x10d))throw new Error(_0x2c1f00(0x110));return{'parent_segment':_0xd6d9fb[_0x2c1f00(0x10c)]};}function a105_0x16ef(_0x4dacef,_0xd00f17){_0x4dacef=_0x4dacef-0xfc;const _0x48e50d=a105_0x48e5();let _0x16effe=_0x48e50d[_0x4dacef];return _0x16effe;}export function findTdxConfig(_0x32c200=process['cwd']()){const _0x3393e2=a105_0x316567,_0xab2e07=findTdxConfigPath(_0x32c200);if(!_0xab2e07)throw new Error(_0x3393e2(0x10f));const _0x138e0b=loadTdxConfig(_0xab2e07),_0x25596a=a105_0x14be35[_0x3393e2(0x102)](_0xab2e07);return{'config':_0x138e0b,'configPath':_0xab2e07,'configDir':_0x25596a};}export function tryFindTdxConfig(_0x4f4397){try{return findTdxConfig(_0x4f4397);}catch{return null;}}export function getSegmentRootDir(_0x2a678a,_0x292e85=process[a105_0x316567(0x100)]()){const _0x19f384=a105_0x316567;return a105_0x14be35[_0x19f384(0x115)](_0x292e85,SEGMENTS_DIR,_0x2a678a);}export function getTdxConfigPath(_0x218cb8,_0x28415c=process['cwd']()){const _0x49761a=a105_0x316567;return a105_0x14be35[_0x49761a(0x115)](getSegmentRootDir(_0x218cb8,_0x28415c),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x3fc48d,_0x982fa4){const _0x19b0e8=a105_0x316567,_0x4b61b8=a105_0x14be35[_0x19b0e8(0xff)](_0x3fc48d),_0x4a5cbe=a105_0x14be35[_0x19b0e8(0x106)](_0x982fa4,_0x4b61b8);if(_0x4a5cbe[_0x19b0e8(0x112)]('..'))return'';return _0x4a5cbe;}export function localPathToTdFolderPath(_0x40149a){const _0x2b4c45=a105_0x316567,_0x19a4e4=a105_0x14be35[_0x2b4c45(0x102)](_0x40149a);if(_0x19a4e4==='.'||_0x19a4e4==='')return'';return _0x19a4e4[_0x2b4c45(0x114)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x4cd92d,_0x104318){const _0x26f577=a105_0x316567;if(!_0x4cd92d)return _0x104318;return a105_0x14be35[_0x26f577(0x115)](_0x104318,_0x4cd92d);}export function createTdxConfigContent(_0x1892d9){const _0x5e183a={'parent_segment':_0x1892d9};return JSON['stringify'](_0x5e183a,null,0x2)+'\x0a';}
1
+ const a105_0x368c97=a105_0x109d;(function(_0x2508d4,_0x146864){const _0x5619dd=a105_0x109d,_0x358933=_0x2508d4();while(!![]){try{const _0x1a4e0c=-parseInt(_0x5619dd(0x149))/0x1+parseInt(_0x5619dd(0x141))/0x2+parseInt(_0x5619dd(0x12c))/0x3*(parseInt(_0x5619dd(0x12e))/0x4)+-parseInt(_0x5619dd(0x144))/0x5*(parseInt(_0x5619dd(0x143))/0x6)+-parseInt(_0x5619dd(0x13b))/0x7+-parseInt(_0x5619dd(0x137))/0x8*(-parseInt(_0x5619dd(0x136))/0x9)+-parseInt(_0x5619dd(0x13f))/0xa*(-parseInt(_0x5619dd(0x140))/0xb);if(_0x1a4e0c===_0x146864)break;else _0x358933['push'](_0x358933['shift']());}catch(_0x5802de){_0x358933['push'](_0x358933['shift']());}}}(a105_0x5e31,0xe6dd6));import{existsSync,readFileSync}from'fs';import a105_0x115afc from'path';const TDX_CONFIG_FILE=a105_0x368c97(0x130),SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x26bef7=process[a105_0x368c97(0x13a)]()){const _0x4691ac=a105_0x368c97;let _0x33b1dc=a105_0x115afc[_0x4691ac(0x131)](_0x26bef7);const _0x54bcdc=a105_0x115afc[_0x4691ac(0x147)](_0x33b1dc)[_0x4691ac(0x132)];while(_0x33b1dc!==_0x54bcdc){const _0x350c56=a105_0x115afc['join'](_0x33b1dc,TDX_CONFIG_FILE);if(existsSync(_0x350c56))return _0x350c56;_0x33b1dc=a105_0x115afc[_0x4691ac(0x146)](_0x33b1dc);}return null;}export function loadTdxConfig(_0x59674f){const _0xd11369=a105_0x368c97,_0x5758bf=readFileSync(_0x59674f,_0xd11369(0x13c));let _0x4591b0;try{_0x4591b0=JSON[_0xd11369(0x147)](_0x5758bf);}catch{throw new Error(_0xd11369(0x135)+_0x59674f);}if(!_0x4591b0||typeof _0x4591b0!==_0xd11369(0x139))throw new Error(_0xd11369(0x138));const _0x49e495=_0x4591b0;if(!_0x49e495['parent_segment']||typeof _0x49e495[_0xd11369(0x134)]!==_0xd11369(0x142))throw new Error(_0xd11369(0x12d));return{'parent_segment':_0x49e495['parent_segment']};}export function findTdxConfig(_0x13f56d=process[a105_0x368c97(0x13a)]()){const _0x96ec1f=a105_0x368c97,_0x48bca5=findTdxConfigPath(_0x13f56d);if(!_0x48bca5)throw new Error(_0x96ec1f(0x145));const _0x295cc1=loadTdxConfig(_0x48bca5),_0x23f234=a105_0x115afc[_0x96ec1f(0x146)](_0x48bca5);return{'config':_0x295cc1,'configPath':_0x48bca5,'configDir':_0x23f234};}export function tryFindTdxConfig(_0x4f39e3){try{return findTdxConfig(_0x4f39e3);}catch{return null;}}export function getSegmentRootDir(_0x52fc9e,_0x517545=process['cwd']()){const _0x9474b=a105_0x368c97;return a105_0x115afc[_0x9474b(0x12f)](_0x517545,SEGMENTS_DIR,_0x52fc9e);}export function getTdxConfigPath(_0x287504,_0x333954=process['cwd']()){const _0x38f2a1=a105_0x368c97;return a105_0x115afc[_0x38f2a1(0x12f)](getSegmentRootDir(_0x287504,_0x333954),TDX_CONFIG_FILE);}function a105_0x109d(_0x7e08cd,_0x5ee89f){_0x7e08cd=_0x7e08cd-0x12c;const _0x5e31de=a105_0x5e31();let _0x109d00=_0x5e31de[_0x7e08cd];return _0x109d00;}function a105_0x5e31(){const _0xd2ed74=['dirname','parse','stringify','239791oDXdfj','108KCwRQe','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','94496pQPTWl','join','tdx.json','resolve','root','replace','parent_segment','Invalid\x20JSON\x20in\x20','921231ilqkOS','32wzcQQu','Invalid\x20tdx.json:\x20expected\x20object','object','cwd','3900316FTMiMi','utf-8','startsWith','relative','11339310ublXPF','11XydTag','1783618IwiBfD','string','9258234rNgAQR','5zBZpyV','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.'];a105_0x5e31=function(){return _0xd2ed74;};return a105_0x5e31();}export function getRelativePathFromConfig(_0x517f06,_0x44a99d){const _0x2fa3a7=a105_0x368c97,_0x31b3d7=a105_0x115afc[_0x2fa3a7(0x131)](_0x517f06),_0x473e52=a105_0x115afc[_0x2fa3a7(0x13e)](_0x44a99d,_0x31b3d7);if(_0x473e52[_0x2fa3a7(0x13d)]('..'))return'';return _0x473e52;}export function localPathToTdFolderPath(_0x29d514){const _0x223939=a105_0x368c97,_0x1efa06=a105_0x115afc[_0x223939(0x146)](_0x29d514);if(_0x1efa06==='.'||_0x1efa06==='')return'';return _0x1efa06[_0x223939(0x133)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x4118f0,_0x225237){const _0x4a266b=a105_0x368c97;if(!_0x4118f0)return _0x225237;return a105_0x115afc[_0x4a266b(0x12f)](_0x225237,_0x4118f0);}export function createTdxConfigContent(_0x395236){const _0x9c1f8a=a105_0x368c97,_0x138ec5={'parent_segment':_0x395236};return JSON[_0x9c1f8a(0x148)](_0x138ec5,null,0x2)+'\x0a';}