@treasuredata/tdx 0.14.8 → 0.14.9

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 (144) hide show
  1. package/README.md +21 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/segment-command.js +1 -1
  29. package/dist/commands/segment-create-command.js +1 -1
  30. package/dist/commands/segment-fields-command.js +1 -1
  31. package/dist/commands/segment-pull-command.js +1 -1
  32. package/dist/commands/segment-push-command.js +1 -1
  33. package/dist/commands/segment-update-command.js +1 -1
  34. package/dist/commands/segment-use-command.js +1 -1
  35. package/dist/commands/segment-validate-command.js +1 -1
  36. package/dist/commands/segments.js +1 -1
  37. package/dist/commands/show.js +1 -1
  38. package/dist/commands/tables.js +1 -1
  39. package/dist/commands/unset-command.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.js +1 -1
  52. package/dist/core/project-config.js +1 -1
  53. package/dist/core/session.js +1 -1
  54. package/dist/core/user-cache.js +1 -1
  55. package/dist/core/version.js +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/proxy/anthropic-adapter.js +1 -1
  58. package/dist/proxy/claude-usage-tracker.js +1 -1
  59. package/dist/proxy/context-signature.js +1 -1
  60. package/dist/proxy/conversation-utils.js +1 -1
  61. package/dist/proxy/passthrough-server.js +1 -1
  62. package/dist/proxy/server.js +1 -1
  63. package/dist/proxy/session-cache.js +1 -1
  64. package/dist/proxy/sse-usage-parser.js +1 -1
  65. package/dist/sdk/agent/agent-config.js +1 -1
  66. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  67. package/dist/sdk/agent/agent-yaml.js +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/client/cdp-api-client.js +1 -1
  70. package/dist/sdk/client/endpoints.js +1 -1
  71. package/dist/sdk/client/engage-api-client.js +1 -1
  72. package/dist/sdk/client/http-client.js +1 -1
  73. package/dist/sdk/client/llm-api-client.js +1 -1
  74. package/dist/sdk/client/rate-limiter.js +1 -1
  75. package/dist/sdk/client/td-api-client.js +1 -1
  76. package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
  77. package/dist/sdk/client/trino-api-client.js +1 -1
  78. package/dist/sdk/client/trino-api-client.js.map +1 -1
  79. package/dist/sdk/client/workflow-client.js +1 -1
  80. package/dist/sdk/connection-validator.js +1 -1
  81. package/dist/sdk/connection.js +1 -1
  82. package/dist/sdk/engage.js +1 -1
  83. package/dist/sdk/errors.js +1 -1
  84. package/dist/sdk/index.js +1 -1
  85. package/dist/sdk/io/index.js +1 -1
  86. package/dist/sdk/io/node-filesystem.js +1 -1
  87. package/dist/sdk/job.js +1 -1
  88. package/dist/sdk/journey.js +1 -1
  89. package/dist/sdk/llm/chat-cache.js +1 -1
  90. package/dist/sdk/llm/index.js +1 -1
  91. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  92. package/dist/sdk/llm/model-aliases.js +1 -1
  93. package/dist/sdk/llm/model-factors.js +1 -1
  94. package/dist/sdk/query/index.js +1 -1
  95. package/dist/sdk/query/sql-parser.js +1 -1
  96. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  97. package/dist/sdk/segment/fields-display.js +1 -1
  98. package/dist/sdk/segment/file-discovery.js +1 -1
  99. package/dist/sdk/segment/journey-utils.js +1 -1
  100. package/dist/sdk/segment/journey-yaml.js +1 -1
  101. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  102. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  103. package/dist/sdk/segment/pull-workflow.js +1 -1
  104. package/dist/sdk/segment/push-workflow.js +1 -1
  105. package/dist/sdk/segment/resolution-context.js +1 -1
  106. package/dist/sdk/segment/segment-path-parser.js +1 -1
  107. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  108. package/dist/sdk/segment/target-resolution.js +1 -1
  109. package/dist/sdk/segment/tdx-config.js +1 -1
  110. package/dist/sdk/segment/validate-files.js +1 -1
  111. package/dist/sdk/segment/yaml-validator.js +1 -1
  112. package/dist/sdk/segment.js +1 -1
  113. package/dist/sdk/types/index.js +1 -1
  114. package/dist/sdk/types/progress.js +1 -1
  115. package/dist/sdk/user.js +1 -1
  116. package/dist/sdk/util/format-detector.js +1 -1
  117. package/dist/sdk/util/formatters.js +1 -1
  118. package/dist/sdk/util/index.js +1 -1
  119. package/dist/sdk/util/tree-formatter.js +1 -1
  120. package/dist/sdk/workflow/clone-workflow.js +1 -1
  121. package/dist/sdk/workflow/index.js +1 -1
  122. package/dist/sdk/workflow/pull-workflow.js +1 -1
  123. package/dist/sdk/workflow/push-workflow.js +1 -1
  124. package/dist/sdk/workflow/tdx-config.js +1 -1
  125. package/dist/sdk/workflow/workflow-utils.js +1 -1
  126. package/dist/utils/async.js +1 -1
  127. package/dist/utils/colors.d.ts +2 -1
  128. package/dist/utils/colors.d.ts.map +1 -1
  129. package/dist/utils/colors.js +1 -1
  130. package/dist/utils/colors.js.map +1 -1
  131. package/dist/utils/diff.js +1 -1
  132. package/dist/utils/file-permissions.js +1 -1
  133. package/dist/utils/json-loader.js +1 -1
  134. package/dist/utils/option-validation.js +1 -1
  135. package/dist/utils/port.js +1 -1
  136. package/dist/utils/process.js +1 -1
  137. package/dist/utils/prompt.js +1 -1
  138. package/dist/utils/spinner.js +1 -1
  139. package/dist/utils/sse-parser.js +1 -1
  140. package/dist/utils/string-utils.js +1 -1
  141. package/dist/utils/table-ref-parser.js +1 -1
  142. package/dist/utils/tdx-logger.js +1 -1
  143. package/dist/utils/version-check.js +1 -1
  144. package/package.json +1 -1
@@ -1 +1 @@
1
- const a101_0x152b06=a101_0x1e36;(function(_0x58327e,_0x54ddfb){const _0x311a2d=a101_0x1e36,_0x578c8c=_0x58327e();while(!![]){try{const _0x1547ba=-parseInt(_0x311a2d(0x1a9))/0x1+parseInt(_0x311a2d(0xfc))/0x2*(parseInt(_0x311a2d(0x132))/0x3)+-parseInt(_0x311a2d(0x146))/0x4*(-parseInt(_0x311a2d(0x199))/0x5)+-parseInt(_0x311a2d(0x1a5))/0x6*(-parseInt(_0x311a2d(0x18c))/0x7)+parseInt(_0x311a2d(0x14c))/0x8*(-parseInt(_0x311a2d(0xe8))/0x9)+-parseInt(_0x311a2d(0x186))/0xa*(-parseInt(_0x311a2d(0x156))/0xb)+parseInt(_0x311a2d(0x163))/0xc;if(_0x1547ba===_0x54ddfb)break;else _0x578c8c['push'](_0x578c8c['shift']());}catch(_0x21be8f){_0x578c8c['push'](_0x578c8c['shift']());}}}(a101_0x4b5d,0xb3759));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a101_0x152b06(0xf9);export const PENDING_ACTIVATION_PREFIX=a101_0x152b06(0x18d);export function createPendingSegmentId(_0x4bec63){return''+PENDING_SEGMENT_PREFIX+_0x4bec63+'__';}export function isPendingSegmentId(_0x452fe8){const _0x4fd772=a101_0x152b06;return _0x452fe8[_0x4fd772(0x1c7)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5987be){return _0x5987be['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xe05f2){return''+PENDING_ACTIVATION_PREFIX+_0xe05f2+'__';}export function isPendingActivationId(_0xe2796a){const _0x7a0bbe=a101_0x152b06;return _0xe2796a[_0x7a0bbe(0x1c7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xedd61f){const _0x45d4bb=a101_0x152b06;return _0xedd61f[_0x45d4bb(0x187)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x462748,_0x3d4516){const _0x3b681e=a101_0x152b06,_0x2f41fc=_0x462748+'::'+(_0x3d4516['trim']()||'segment'),_0x489931=createHash(_0x3b681e(0x1c2))[_0x3b681e(0x188)](_0x2f41fc)[_0x3b681e(0x12f)](_0x3b681e(0x130))['slice'](0x0,0xc);return _0x3b681e(0x14e)+_0x489931;}export function ensureJourneyDefaults(_0x13cb40){const _0x256cc9=a101_0x152b06;!_0x13cb40[_0x256cc9(0xf2)]&&(_0x13cb40['description']=''),!_0x13cb40[_0x256cc9(0x148)]&&(_0x13cb40[_0x256cc9(0x148)]=_0x256cc9(0x15f));}export function resolveTDFolderPath(_0x45bb38,_0x180ada,_0x1b5df8){if(!_0x180ada)return _0x45bb38;if(_0x45bb38===_0x1b5df8||_0x45bb38['startsWith'](_0x1b5df8+'/'))return _0x45bb38;return _0x45bb38?_0x1b5df8+'/'+_0x45bb38:_0x1b5df8;}export function addFoldersToCreate(_0x481e25,_0x346799,_0x1a57a7){const _0xf01ebf=a101_0x152b06;if(!_0x481e25)return;if(_0x346799['has'](_0x481e25))return;const _0x54b1a4=_0x481e25[_0xf01ebf(0x13f)]('/');let _0x2938da='';for(const _0x1157cc of _0x54b1a4){_0x2938da=_0x2938da?_0x2938da+'/'+_0x1157cc:_0x1157cc,!_0x346799[_0xf01ebf(0x193)](_0x2938da)&&_0x1a57a7[_0xf01ebf(0x139)](_0x2938da);}}import*as a101_0x2a924c from'yaml';import{readFileSync}from'fs';import a101_0x5b2ffe from'path';import{isJourneyDef,parseYamlString as a101_0x490132,toYamlString as a101_0x2315d0,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(_0x27e317){const _0x45e778=a101_0x152b06;if(Array[_0x45e778(0x12b)](_0x27e317))return'['+_0x27e317[_0x45e778(0x179)](_0x17ec55=>stableStringify(_0x17ec55))[_0x45e778(0x12d)](',')+']';if(_0x27e317&&typeof _0x27e317==='object'){const _0x20a74d=_0x27e317,_0xdfc49f=Object[_0x45e778(0x11b)](_0x20a74d)[_0x45e778(0x142)](),_0x4e539e=_0xdfc49f[_0x45e778(0x179)](_0x3c301e=>'\x22'+_0x3c301e+'\x22:'+stableStringify(_0x20a74d[_0x3c301e]));return'{'+_0x4e539e[_0x45e778(0x12d)](',')+'}';}const _0x21303d=JSON['stringify'](_0x27e317);return _0x21303d===undefined?_0x45e778(0x154):_0x21303d;}function activationSignature(_0x2cd52e){const _0x5a9872=a101_0x152b06,_0x52c777={'connection':_0x2cd52e[_0x5a9872(0x164)],..._0x2cd52e['all_columns']!==undefined&&{'all_columns':_0x2cd52e[_0x5a9872(0x14f)]},..._0x2cd52e[_0x5a9872(0x160)]!==undefined&&{'columns':_0x2cd52e[_0x5a9872(0x160)]},..._0x2cd52e['behavior']!==undefined&&{'behavior':_0x2cd52e['behavior']},..._0x2cd52e[_0x5a9872(0x134)]!==undefined&&{'schedule':_0x2cd52e[_0x5a9872(0x134)]},..._0x2cd52e['notification']!==undefined&&{'notification':_0x2cd52e[_0x5a9872(0x14a)]},..._0x2cd52e[_0x5a9872(0x1b0)]!==undefined&&{'connector_config':_0x2cd52e[_0x5a9872(0x1b0)]},..._0x2cd52e['activation_template_id']!==undefined&&{'activation_template_id':_0x2cd52e[_0x5a9872(0x198)]}};return stableStringify(_0x52c777);}export async function prepareSegmentFiles(_0x2486fe,_0x11597d,_0x103cb,_0x467f00,_0x3ccf70){const _0x36ed45=a101_0x152b06,{activationDefToCreateRequest:_0x63fbe6}=await import('./child-segment-yaml.js'),_0xca6c9f=[],_0x20a86c=new Set();for(const {yamlConfig:_0xba6a2e,folderPath:_0x2d2239,sourcePath:_0x420e39}of _0x2486fe){const _0x5f4c73=resolveTDFolderPath(_0x2d2239,_0x467f00,_0x3ccf70),_0xb97dee=_0x5f4c73+':'+_0xba6a2e[_0x36ed45(0x143)],_0x374cb8=_0x11597d['segmentByFolderAndName']['get'](_0xb97dee),_0xb6c52b=_0x374cb8?_0x11597d[_0x36ed45(0xea)][_0x36ed45(0x174)](_0x374cb8['id'])||[]:[];addFoldersToCreate(_0x5f4c73,_0x11597d[_0x36ed45(0x14d)],_0x20a86c);const _0x212dde=calculateActivationActions(_0xba6a2e[_0x36ed45(0x147)]||[],_0xb6c52b,_0x11597d[_0x36ed45(0xff)],_0x11597d[_0x36ed45(0x19f)]);for(const _0x254211 of _0x212dde){(_0x254211[_0x36ed45(0xe7)]==='create'||_0x254211[_0x36ed45(0xe7)]===_0x36ed45(0x188))&&_0x254211['yamlActivation']&&(_0x254211['validatedRequest']=await _0x63fbe6(_0x254211[_0x36ed45(0xec)],_0x103cb));}const _0x438d52=calculateSegmentDiff(_0xba6a2e,_0x374cb8,_0xb6c52b,_0x11597d[_0x36ed45(0xff)],_0x11597d[_0x36ed45(0x19f)]);_0xca6c9f[_0x36ed45(0x116)]({'relativePath':_0xba6a2e[_0x36ed45(0x143)],'absolutePath':_0x420e39,'yamlConfig':_0xba6a2e,'folderPath':_0x5f4c73,'existingSegment':_0x374cb8,'existingActivations':_0xb6c52b,'isNew':_0x438d52['isNew'],'hasChanges':_0x438d52[_0x36ed45(0xde)],'diff':_0x438d52[_0x36ed45(0x189)],'activationActions':_0x212dde});}return{'segmentFiles':_0xca6c9f,'foldersToCreate':_0x20a86c};}export async function prepareJourneyFiles(_0x41907f,_0x2b9e1d,_0x454b9c,_0x5163b1){const _0x328f2b=a101_0x152b06,_0xd6a86c=[],_0x21de3d=new Set();for(const {yamlConfig:_0x588cba,folderPath:_0x504072,sourcePath:_0x1db779}of _0x41907f){const _0x57ff8f=resolveTDFolderPath(_0x504072,_0x454b9c,_0x5163b1),_0x4ac0f5=_0x57ff8f+':'+_0x588cba[_0x328f2b(0x143)],_0x43a436=_0x2b9e1d[_0x328f2b(0x185)]['get'](_0x4ac0f5);let _0xeda00f,_0x44b2f5;if(_0x43a436&&_0x43a436[_0x328f2b(0x127)]>0x0){const _0x3ac226=buildLocalExpandedRuleMappings(_0x588cba),{createYamlContext:_0x43ff0c,prefetchJourneySegments:_0x10160f}=createPushYamlContextForBundle(_0x2b9e1d['deps'],_0x2b9e1d[_0x328f2b(0x1c5)],_0x2b9e1d[_0x328f2b(0x192)],_0x3ac226,_0x2b9e1d[_0x328f2b(0xff)],_0x2b9e1d[_0x328f2b(0x19f)],_0x2b9e1d['activationStepsById'],_0x2b9e1d[_0x328f2b(0x13c)]);await _0x10160f(_0x43a436[_0x328f2b(0x179)](_0x1f34ca=>_0x1f34ca['id']));const _0x398463=hasMultipleVersions(_0x588cba),_0x4b385a=async _0x4a1f9a=>{const _0x23bbc9=_0x328f2b,_0x15a55d=_0x2b9e1d[_0x23bbc9(0x13c)]?.[_0x23bbc9(0x174)](_0x4a1f9a);if(_0x15a55d)return _0x15a55d;return _0x2b9e1d[_0x23bbc9(0x1a1)]({'journeyId':_0x4a1f9a,'journeyName':_0x588cba[_0x23bbc9(0x143)],'isMultiVersion':_0x43a436['length']>0x1});};if(_0x398463&&_0x43a436['length']>0x1){const _0x2d02b9=[];for(const _0x370340 of _0x43a436){const _0x14dec2=_0x370340[_0x328f2b(0x1b4)]||0x1;_0x2b9e1d[_0x328f2b(0x12e)]?.[_0x328f2b(0x188)]('Fetching\x20'+_0x588cba[_0x328f2b(0x143)]+'\x20v'+_0x14dec2);const _0x31ed32=await _0x4b385a(_0x370340['id']),_0x14638b=_0x43ff0c(_0x370340['id']),_0x12e6d0=await journeyResponseToDef(_0x31ed32,_0x14638b);_0x2d02b9[_0x328f2b(0x116)]({'item':_0x370340,'yaml':_0x12e6d0});}const _0x254e18=buildLocalRuleToNameMappingFromJourney(_0x588cba);_0x44b2f5=buildMergedJourneyDef(_0x2d02b9,_0x254e18);const _0x37d535=Math[_0x328f2b(0xf6)](..._0x2d02b9[_0x328f2b(0x179)](_0x3a866c=>_0x3a866c[_0x328f2b(0xeb)][_0x328f2b(0x1b4)]||0x0)),_0x3c37ba=_0x43a436[_0x328f2b(0x151)](_0x1a3ee4=>(_0x1a3ee4[_0x328f2b(0x1b4)]||0x0)===_0x37d535);_0x3c37ba&&(_0x2b9e1d['progress']?.[_0x328f2b(0x188)](_0x328f2b(0x120)+_0x588cba[_0x328f2b(0x143)]+'\x20v'+_0x37d535),_0xeda00f=await _0x4b385a(_0x3c37ba['id']));}else{const _0x224e9a=_0x43a436[_0x43a436['length']-0x1];_0x2b9e1d['progress']?.[_0x328f2b(0x188)](_0x328f2b(0x120)+_0x588cba[_0x328f2b(0x143)]),_0xeda00f=await _0x4b385a(_0x224e9a['id']);const _0x307096=_0x43ff0c(_0x224e9a['id']),_0x57e0dd=await journeyResponseToDef(_0xeda00f,_0x307096),_0x22cdfd=buildLocalRuleToNameMappingFromJourney(_0x588cba);_0x44b2f5=buildMergedJourneyDef([{'item':_0x224e9a,'yaml':_0x57e0dd}],_0x22cdfd);}}addFoldersToCreate(_0x57ff8f,_0x2b9e1d['folderPathToId'],_0x21de3d);const _0x6f62f4=calculateJourneyDiff(_0x588cba,_0x44b2f5);_0xd6a86c['push']({'relativePath':_0x588cba['name'],'absolutePath':_0x1db779,'yamlConfig':_0x588cba,'folderPath':_0x57ff8f,'existingJourney':_0xeda00f,'isNew':_0x6f62f4[_0x328f2b(0x19b)],'hasChanges':_0x6f62f4[_0x328f2b(0xde)],'diff':_0x6f62f4[_0x328f2b(0x189)]});}return{'journeyFiles':_0xd6a86c,'foldersToCreate':_0x21de3d};}export function calculateActivationActions(_0x3f8fc3,_0x5c9b3a,_0x5de8ce,_0x2d9292){const _0x3eadeb=a101_0x152b06,_0x126281=[],_0x47b2c8=new Map();for(const _0x516d89 of _0x5c9b3a){_0x47b2c8[_0x3eadeb(0x1c4)](_0x516d89[_0x3eadeb(0x143)],_0x516d89);}const _0x1605a5=new Map();for(const _0x25559f of _0x3f8fc3){_0x1605a5['set'](_0x25559f[_0x3eadeb(0x143)],_0x25559f);}for(const _0x429ed4 of _0x3f8fc3){const _0x2f4513=_0x47b2c8['get'](_0x429ed4['name']);if(!_0x2f4513)_0x126281[_0x3eadeb(0x116)]({'type':_0x3eadeb(0x1c1),'name':_0x429ed4[_0x3eadeb(0x143)],'yamlActivation':_0x429ed4});else{const _0x8a8acb=activationResponseToDef(_0x2f4513,_0x5de8ce,_0x2d9292),_0x51927d=a101_0x2a924c[_0x3eadeb(0x129)](_0x8a8acb),_0x45b406=a101_0x2a924c['stringify'](_0x429ed4);_0x51927d!==_0x45b406&&_0x126281[_0x3eadeb(0x116)]({'type':_0x3eadeb(0x188),'name':_0x429ed4[_0x3eadeb(0x143)],'yamlActivation':_0x429ed4,'existingActivation':_0x2f4513});}}for(const _0x58a11e of _0x5c9b3a){!_0x1605a5['has'](_0x58a11e['name'])&&_0x126281[_0x3eadeb(0x116)]({'type':_0x3eadeb(0x15c),'name':_0x58a11e['name'],'existingActivation':_0x58a11e});}return _0x126281;}export function calculateSegmentDiff(_0x2f890d,_0x167eeb,_0xcfde07,_0x1b0088,_0x522d94){const _0x1e68f5=segmentToYamlString(_0x2f890d);if(_0x167eeb){const _0x56d894=segmentWithActivationsToYaml(_0x167eeb,_0xcfde07,undefined,_0x1b0088,_0x522d94),_0x23393d=segmentToYamlString(_0x56d894),_0x4effe7=generateDiff(_0x23393d,_0x1e68f5),_0x2b98e6=hasChanges(_0x4effe7);return{'isNew':![],'hasChanges':_0x2b98e6,'diff':_0x2b98e6?formatDiffWithColors(_0x4effe7):undefined};}const _0x140620=generateDiff('',_0x1e68f5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x140620)};}export function calculateJourneyDiff(_0x391dc9,_0x513c13){const _0x45fc99=normalizeJourneyDef(_0x391dc9,_0x391dc9),_0x5cae89=a101_0x2315d0(_0x45fc99);if(_0x513c13){const _0x550ffc=normalizeJourneyDef(_0x513c13,_0x391dc9),_0x430714=a101_0x2315d0(_0x550ffc),_0xa381a7=generateDiff(_0x430714,_0x5cae89),_0x8ea8fd=hasChanges(_0xa381a7);return{'isNew':![],'hasChanges':_0x8ea8fd,'diff':_0x8ea8fd?formatDiffWithColors(_0xa381a7):undefined};}const _0x1ba76d=generateDiff('',_0x5cae89);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1ba76d)};}export function findSegmentsToDelete(_0x55dce1,_0x5e61d5,_0x49c5c0,_0x47fa2d,_0x3a295b){const _0x2ac365=a101_0x152b06,_0x355e4e=new Set();for(const {yamlConfig:_0x362cd2,folderPath:_0xdba951}of _0x5e61d5){_0x355e4e[_0x2ac365(0x139)](_0xdba951+':'+_0x362cd2[_0x2ac365(0x143)]);}return _0x55dce1['filter'](_0x27769c=>{const _0x5051f1=_0x2ac365,_0x25a83e=_0x27769c[_0x5051f1(0x190)]?_0x49c5c0[_0x5051f1(0x174)](_0x27769c['segmentFolderId']['toString']())||'':'',_0x2c5a04=_0x25a83e+':'+_0x27769c[_0x5051f1(0x143)];if(_0x355e4e[_0x5051f1(0x193)](_0x2c5a04))return![];if(_0x3a295b)return _0x25a83e===_0x47fa2d||_0x25a83e[_0x5051f1(0x1c7)](_0x47fa2d+'/');return!![];});}export function findJourneysToDelete(_0x360893,_0xdef735,_0x229c28,_0x4542be,_0x5c030){const _0x269f29=a101_0x152b06,_0x3e529b=new Set();for(const {yamlConfig:_0x355369,folderPath:_0x319b95}of _0xdef735){_0x3e529b[_0x269f29(0x139)](_0x319b95+':'+_0x355369['name']);}return _0x360893[_0x269f29(0x150)](_0x3999ac=>{const _0x43fcd5=_0x269f29,_0xdff9c=_0x3999ac['folderId']?_0x229c28[_0x43fcd5(0x174)](_0x3999ac[_0x43fcd5(0xf7)])||'':'',_0x1b54c4=_0xdff9c+':'+_0x3999ac['journeyBundleName'];if(_0x3e529b[_0x43fcd5(0x193)](_0x1b54c4))return![];if(_0x5c030)return _0xdff9c===_0x4542be||_0xdff9c[_0x43fcd5(0x1c7)](_0x4542be+'/');return!![];});}export function buildSegmentLookupMap(_0x96f0ed,_0x572cba){const _0x294faf=a101_0x152b06,_0x412a75=new Map();for(const _0x51fde2 of _0x96f0ed){const _0x4b53ef=_0x51fde2['segmentFolderId']?_0x572cba[_0x294faf(0x174)](_0x51fde2[_0x294faf(0x190)][_0x294faf(0x167)]())||'':'',_0x8535a0=_0x4b53ef+':'+_0x51fde2[_0x294faf(0x143)];_0x412a75[_0x294faf(0x1c4)](_0x8535a0,_0x51fde2);}return _0x412a75;}export function buildSegmentNameToIdMap(_0x2567b2){const _0x3852ea=a101_0x152b06,_0x5c62da=new Map();for(const _0x53a3a3 of _0x2567b2){_0x5c62da[_0x3852ea(0x1c4)](_0x53a3a3[_0x3852ea(0x143)],_0x53a3a3['id']);}return _0x5c62da;}export function buildJourneyBundleLookupMap(_0x45713b,_0x497190){const _0x3b0ca5=a101_0x152b06,_0x91c8b4=new Map();for(const _0x229019 of _0x45713b){const _0x101004=_0x229019[_0x3b0ca5(0xf7)]?_0x497190['get'](_0x229019['folderId'])||'':'',_0x4c8045=_0x101004+':'+_0x229019[_0x3b0ca5(0x1b3)];!_0x91c8b4[_0x3b0ca5(0x193)](_0x4c8045)&&_0x91c8b4[_0x3b0ca5(0x1c4)](_0x4c8045,[]),_0x91c8b4[_0x3b0ca5(0x174)](_0x4c8045)['push'](_0x229019);}for(const _0xf69a08 of _0x91c8b4['values']()){_0xf69a08[_0x3b0ca5(0x142)]((_0x52e597,_0x5111ce)=>(_0x52e597[_0x3b0ca5(0x1b4)]||0x0)-(_0x5111ce[_0x3b0ca5(0x1b4)]||0x0));}return _0x91c8b4;}export function collectFoldersToCreate(_0x3ad54c,_0x8839c4){const _0x122c5c=a101_0x152b06,_0x4b3ce5=new Set();for(const _0x2f8ffa of _0x3ad54c){if(!_0x2f8ffa)continue;if(_0x8839c4[_0x122c5c(0x193)](_0x2f8ffa))continue;const _0x1369de=_0x2f8ffa[_0x122c5c(0x13f)]('/');let _0x3cb590='';for(const _0xe10700 of _0x1369de){_0x3cb590=_0x3cb590?_0x3cb590+'/'+_0xe10700:_0xe10700,!_0x8839c4[_0x122c5c(0x193)](_0x3cb590)&&_0x4b3ce5[_0x122c5c(0x139)](_0x3cb590);}}return _0x4b3ce5;}export function parseAndClassifyYamlFiles(_0x241a22,_0x589091,_0x228a19){const _0xe9a433=a101_0x152b06,_0x5bf58e=[],_0x5d1c9c=[];for(const _0x13eb33 of _0x241a22){const _0x28cfe2=a101_0x5b2ffe[_0xe9a433(0x15a)](_0x589091,a101_0x5b2ffe[_0xe9a433(0xf8)](_0x13eb33)),_0x4cbc3c=_0x28cfe2==='.'?'':_0x28cfe2,_0x46a611=readFileSync(_0x13eb33,_0xe9a433(0xe1)),_0xd72f52=a101_0x2a924c['parse'](_0x46a611);if(isJourneyDef(_0xd72f52)){const _0x3f2e75=a101_0x490132(_0x46a611);_0x5d1c9c['push']({'yamlConfig':_0x3f2e75,'folderPath':_0x4cbc3c,'sourcePath':_0x13eb33});}else{if(!_0x228a19?.[_0xe9a433(0x131)]){const _0x496b10=parseSegmentYamlFile(_0x46a611),_0x4b722f=normalizeChildSegmentYaml(_0x496b10);_0x5bf58e[_0xe9a433(0x116)]({'yamlConfig':_0x4b722f,'folderPath':_0x4cbc3c,'sourcePath':_0x13eb33});}}}return{'segments':_0x5bf58e,'journeys':_0x5d1c9c};}export function validateParsedFiles(_0x281f4f,_0x19096e){const _0x16b139=a101_0x152b06,_0x4c46ff=[];for(const {yamlConfig:_0x2a5473,sourcePath:_0x1232cf}of _0x281f4f['segments']){const _0x4e4e6e=readFileSync(_0x1232cf,_0x16b139(0xe1)),_0x11552f=a101_0x2a924c[_0x16b139(0x162)](_0x4e4e6e),_0x1eaf13=validateSegmentDef(_0x2a5473,{'source':_0x4e4e6e,'document':_0x11552f});if(!_0x1eaf13[_0x16b139(0x112)]){const _0x45062e=a101_0x5b2ffe[_0x16b139(0x15a)](_0x19096e,_0x1232cf);_0x4c46ff[_0x16b139(0x116)]({'filePath':_0x45062e,'source':_0x4e4e6e,'result':_0x1eaf13,'isJourney':![]});}}for(const {yamlConfig:_0x5929f5,sourcePath:_0x462d46}of _0x281f4f[_0x16b139(0x18f)]){const _0x39b666=readFileSync(_0x462d46,'utf-8'),_0x399d39=a101_0x2a924c[_0x16b139(0x162)](_0x39b666),_0x2f26f3=validateJourneyDef(_0x5929f5,{'source':_0x39b666,'document':_0x399d39});if(!_0x2f26f3['valid']){const _0x2d8d09=a101_0x5b2ffe[_0x16b139(0x15a)](_0x19096e,_0x462d46);_0x4c46ff[_0x16b139(0x116)]({'filePath':_0x2d8d09,'source':_0x39b666,'result':_0x2f26f3,'isJourney':!![]});}}return _0x4c46ff;}function a101_0x1e36(_0x6acb05,_0x3ecde1){_0x6acb05=_0x6acb05-0xde;const _0x4b5d73=a101_0x4b5d();let _0x1e3680=_0x4b5d73[_0x6acb05];return _0x1e3680;}export function formatValidationErrors(_0x554db0){const _0x4e70fc=a101_0x152b06,_0x8720bf=[];for(const {filePath:_0x3eff3b,source:_0x280845,result:_0x155302,isJourney:_0x10d701}of _0x554db0){const _0x150ba9=_0x10d701?'journey':'segment';_0x8720bf['push']('\x0a'+_0x3eff3b+'\x20('+_0x150ba9+_0x4e70fc(0x149)+_0x155302[_0x4e70fc(0x166)][_0x4e70fc(0x127)]+_0x4e70fc(0x177)),_0x8720bf[_0x4e70fc(0x116)](formatValidationResult(_0x155302,_0x280845,_0x3eff3b));}return _0x8720bf['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x42a367){const _0x24699b=a101_0x152b06,_0x4b3673=new Set(),_0x2a6c3a=new Map(),_0x23642f=collectSegmentUsageCounts(_0x42a367);if(_0x42a367['segments'])for(const [_0x56dd3c,_0x3a5bc2]of Object['entries'](_0x42a367[_0x24699b(0x191)])){_0x4b3673['add'](_0x56dd3c);if(_0x3a5bc2[_0x24699b(0x1a4)]){const _0x4fff65=yamlRuleToApi(_0x3a5bc2[_0x24699b(0x1a4)]),_0x30db09=apiRuleToYaml(_0x4fff65);_0x2a6c3a[_0x24699b(0x1c4)](_0x56dd3c,_0x30db09);}}const _0x4784b0=new Map();let _0x3f66f4=0x0;for(const [_0x2145f1,_0x43ea20]of _0x2a6c3a){const _0x96ff20=serializeExpandedRule(_0x43ea20,_0x2a6c3a),_0x1142be=_0x4784b0[_0x24699b(0x174)](_0x96ff20)||[];_0x1142be['push']({'name':_0x2145f1,'index':_0x3f66f4}),_0x4784b0[_0x24699b(0x1c4)](_0x96ff20,_0x1142be),_0x3f66f4++;}const _0x57b283=new Map();for(const [_0x2a1f80,_0x4b30de]of _0x4784b0){const _0x102c1a=_0x4b30de[_0x24699b(0xee)]()[_0x24699b(0x142)]((_0x2f7228,_0x4af3c8)=>{const _0x46b011=_0x24699b,_0x40431c=_0x23642f[_0x46b011(0x174)](_0x2f7228[_0x46b011(0x143)])||0x0,_0x213a70=_0x23642f[_0x46b011(0x174)](_0x4af3c8[_0x46b011(0x143)])||0x0;if(_0x40431c!==_0x213a70)return _0x213a70-_0x40431c;return _0x2f7228[_0x46b011(0x1b2)]-_0x4af3c8[_0x46b011(0x1b2)];})[_0x24699b(0x179)](_0x4d2f1e=>_0x4d2f1e['name']),_0x9dfc8f=[];for(const _0x8f987a of _0x102c1a){const _0x3b69b8=_0x23642f[_0x24699b(0x174)](_0x8f987a)||0x0,_0x5cc5ae=Math[_0x24699b(0xf6)](_0x3b69b8,0x1);for(let _0x25ae03=0x0;_0x25ae03<_0x5cc5ae;_0x25ae03++){_0x9dfc8f[_0x24699b(0x116)](_0x8f987a);}}_0x57b283[_0x24699b(0x1c4)](_0x2a1f80,_0x9dfc8f);}return{'existingLocalSegmentNames':_0x4b3673,'localSegmentRules':_0x2a6c3a,'localExpandedRuleToNames':_0x57b283};}function a101_0x4b5d(){const _0x5f2d22=['resolveSegment','activationsBySegmentId','item','yamlActivation','folderPath','slice',').\x20','segment_updated','Creating\x20activation\x20\x27','description','milestone','Segment\x20not\x20found:\x20','SEGMENT_NOT_FOUND','max','folderId','dirname','__pending_','activation_deleted','\x0a\x20\x20','98XdeOHi','./child-segment-yaml.js','message','idToEmailMap','attributes','activation_deleting','Created\x20journey\x20\x27','from','getSegment','with','Created\x20folder\x20\x27','Activation\x20not\x20found:\x20','existingJourney','createdSegmentIds','../../utils/async.js','journey_updating','createFolder','\x27\x20exit\x20criteria','waitCondition','Updating\x20activation\x20\x27','Entry\x20criteria:\x20','Activation','valid','WaitStep','existingActivation','action','push','verbose','createActivation','embedded_activation_created','logSuccess','keys','embedded_activation_creating','rootFolderId','yamlConfig','Failed\x20to\x20','Fetching\x20','Updated\x20activation\x20\x27','getActivation','created','embedded_segment_created','Updating\x20segment\x20\x27','entry_criteria','length','activation_updating','stringify','deleteSegment','isArray','folder_creating','join','progress','digest','hex','skipSegments','21777cPFJGy','entryCriteria','schedule','DecisionPoint','Created\x20segment\x20\x27','logWarning','journey_updated','add','\x27\x20decision\x20point\x20branch\x20\x27','Name\x20has\x20already\x20been\x20taken','journeyById','JOURNEY_SYNTAX_ERROR','\x20activation\x20\x27','split','\x27...','\x20journey\x20from\x20file:\x20','sort','name','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','activationActions','7916kxdmcN','activations','state','):\x20','notification','includes','266920hIXXMx','folderPathToId','journey_entry_criteria_','all_columns','filter','find','folder_created','\x27\x20milestone','null','\x27\x20from\x20file:\x20','99tiQNJb','onProgress','toLowerCase','journeyId','relative','\x27\x20entry\x20criteria','delete','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','absolutePath','draft','columns','parse','parseDocument','17559528OHrNUa','connection','goal','errors','toString','Created\x20activation\x20\x27','segment_creating','nameToType','listSegments','Journey\x20\x27','JOURNEY_UPDATE_ERROR','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','activation_creating','Creating\x20segment\x20\x27','exitCriterias','createdSegmentId','\x20(referenced\x20in\x20journey\x20','get','flatMap','Stage\x20\x27','\x20error(s)','parentFolder','map','journeyActivationStepId','activation_updated','embeddedSegmentNameToId','segment_deleting','idToName','resolveJourneyId','activation_created','Deleted\x20segment\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','branches','SEGMENT_UPDATE_ERROR','journeyBundlesByFolderAndName','333750uGfuND','replace','update','diff','./journey-yaml.js','journey','502817NngiOb','__pending_act_','segmentNameToId','journeys','segmentFolderId','segments','existingSegments','has','reduce','createJourneySegment','segmentId','stages','activation_template_id','2335FulAEo','Updated\x20segment\x20\x27','isNew','localSegmentRules','listActivations','unchanged','connectionIdToNameMap','activationContext','fetchJourney','validatedRequest','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','rule','6VfCsmY','ACTIVATION_UPDATE_ERROR','steps','INTERNAL','1145814IRgSxx','getJourney','NOT_FOUND','stage\x20\x27','updated','\x27\x20for\x20','deleteActivation','connector_config','goal\x20criteria','index','journeyBundleName','versionNumber','list','updateSegmentById','deleted','all','size','embedded_segment_creating','\x27\x20wait\x20condition','activation_','withProgress','existingSegment','relationships','updateActivation','create','sha1','logInfo','set','parentId','segment','startsWith','hasChanges','Creating\x20folder\x20\x27','data','utf-8','journeyStages','user','parentSegmentFolder','buildUserMaps','SEGMENT_SYNTAX_ERROR','type','333tlbBFk'];a101_0x4b5d=function(){return _0x5f2d22;};return a101_0x4b5d();}async function buildServerSegmentRuleMap(_0x3d02d9,_0x1dc603,_0x56746d,_0xa77636){const _0x34ce25=new Map(),_0x1e5f5e=new Set(),_0x1c5a2a=async _0x505e9=>{const _0x3c1377=a101_0x1e36;if(_0x1e5f5e[_0x3c1377(0x193)](_0x505e9))return;_0x1e5f5e[_0x3c1377(0x139)](_0x505e9);let _0x417b97=_0x56746d[_0x3c1377(0x151)](_0x448e02=>_0x448e02['id']===_0x505e9);if(!_0x417b97)try{_0x417b97=await _0x3d02d9[_0x3c1377(0x1c6)]['getSegment'](_0x1dc603,_0x505e9);}catch{return;}if(!_0x417b97?.['rule'])return;const _0x346110=apiRuleToYaml(_0x417b97[_0x3c1377(0x1a4)]);_0x34ce25[_0x3c1377(0x1c4)](_0x505e9,_0x346110);const _0x2294eb=collectSegmentRefsFromRule(_0x346110);for(const _0x134c44 of _0x2294eb){await _0x1c5a2a(_0x134c44);}};for(const _0x3a82c9 of _0xa77636){await _0x1c5a2a(_0x3a82c9);}return _0x34ce25;}export function createSegmentIdResolver(_0x30da33,_0x53cea8){return async _0x415334=>{const _0x2e419d=a101_0x1e36,_0x3698b6=_0x30da33[_0x2e419d(0x174)](_0x415334);if(!_0x3698b6)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2e419d(0xf4)+_0x415334+_0x2e419d(0x16e)+_0x53cea8+'\x27)');return _0x3698b6;};}export function extractRootFolderId(_0x165aa5){const _0x59cde7=a101_0x152b06;return _0x165aa5['relationships']?.[_0x59cde7(0xe4)]?.[_0x59cde7(0xe0)]?.['id']||_0x165aa5[_0x59cde7(0x1bf)]?.[_0x59cde7(0x178)]?.['data']?.['id'];}export function buildConnectionMaps(_0x42ec4e){const _0x4b6e42=a101_0x152b06,_0x4f86b0=new Map(),_0x4b8273=new Map(),_0x907952=new Map();for(const _0x4e8654 of _0x42ec4e){_0x4f86b0[_0x4b6e42(0x1c4)](_0x4e8654[_0x4b6e42(0x143)],parseInt(_0x4e8654['id'],0xa)),_0x4b8273[_0x4b6e42(0x1c4)](_0x4e8654['id'],_0x4e8654['name']),_0x907952['set'](_0x4e8654[_0x4b6e42(0x143)],_0x4e8654[_0x4b6e42(0xe7)]);}return{'nameToId':_0x4f86b0,'idToName':_0x4b8273,'nameToType':_0x907952};}export function calculatePushStats(_0x960215,_0x3a1ff8,_0x3429d9,_0x3bad6f,_0x49e8d4,_0x19d1d7,_0x13cd42){const _0x2a0030=a101_0x152b06,_0x413eec=_0x960215[_0x2a0030(0x150)](_0x9e8854=>_0x9e8854[_0x2a0030(0x19b)]),_0xc2bcf7=_0x960215[_0x2a0030(0x150)](_0x24fa69=>!_0x24fa69[_0x2a0030(0x19b)]&&_0x24fa69[_0x2a0030(0xde)]),_0x2fe5a6=_0x960215[_0x2a0030(0x150)](_0x31f320=>!_0x31f320[_0x2a0030(0x19b)]&&!_0x31f320[_0x2a0030(0xde)]),_0x3cc09e=_0x19d1d7?_0x3bad6f:[],_0x382569=_0x3a1ff8['filter'](_0x4b85b6=>_0x4b85b6[_0x2a0030(0x19b)]),_0x4d28d8=_0x3a1ff8[_0x2a0030(0x150)](_0x303f40=>!_0x303f40[_0x2a0030(0x19b)]&&_0x303f40[_0x2a0030(0xde)]),_0x2c413f=_0x3a1ff8['filter'](_0x4df595=>!_0x4df595['isNew']&&!_0x4df595[_0x2a0030(0xde)]),_0x2040d7=_0x19d1d7?_0x49e8d4:[],_0x1855e4=_0x960215[_0x2a0030(0x175)](_0x37e16e=>_0x37e16e[_0x2a0030(0x145)]),_0x1a7f43=_0x1855e4[_0x2a0030(0x150)](_0x1d8714=>_0x1d8714[_0x2a0030(0xe7)]===_0x2a0030(0x1c1)),_0x21385b=_0x1855e4['filter'](_0xe91503=>_0xe91503[_0x2a0030(0xe7)]===_0x2a0030(0x188)),_0x46900a=_0x1855e4['filter'](_0x3e4281=>_0x3e4281[_0x2a0030(0xe7)]===_0x2a0030(0x15c)),_0x147d03=Array[_0x2a0030(0x103)](_0x3429d9)[_0x2a0030(0x142)](),_0x5ffdd1=_0x13cd42?![]:_0x413eec['length']>0x0||_0xc2bcf7[_0x2a0030(0x127)]>0x0||_0x3cc09e[_0x2a0030(0x127)]>0x0,_0xe0fb7b=_0x382569[_0x2a0030(0x127)]>0x0||_0x4d28d8[_0x2a0030(0x127)]>0x0||_0x2040d7[_0x2a0030(0x127)]>0x0,_0x447710=_0x13cd42?![]:_0x1855e4[_0x2a0030(0x127)]>0x0,_0x163b7e=_0x147d03[_0x2a0030(0x127)]>0x0;return{'segments':{'new':_0x413eec,'changed':_0xc2bcf7,'unchanged':_0x2fe5a6,'toDelete':_0x3cc09e},'journeys':{'new':_0x382569,'changed':_0x4d28d8,'unchanged':_0x2c413f,'toDelete':_0x2040d7},'activations':{'all':_0x1855e4,'toCreate':_0x1a7f43,'toUpdate':_0x21385b,'toDelete':_0x46900a},'folders':{'toCreate':_0x147d03},'counts':{'segments':{'new':_0x413eec[_0x2a0030(0x127)],'changed':_0xc2bcf7[_0x2a0030(0x127)],'unchanged':_0x2fe5a6[_0x2a0030(0x127)],'toDelete':_0x3cc09e[_0x2a0030(0x127)]},'journeys':{'new':_0x382569[_0x2a0030(0x127)],'changed':_0x4d28d8[_0x2a0030(0x127)],'unchanged':_0x2c413f['length'],'toDelete':_0x2040d7[_0x2a0030(0x127)]},'activations':{'create':_0x1a7f43[_0x2a0030(0x127)],'update':_0x21385b['length'],'delete':_0x46900a[_0x2a0030(0x127)]},'folders':_0x147d03['length']},'hasChanges':_0x5ffdd1||_0xe0fb7b||_0x447710||_0x163b7e};}export async function buildPushExecutionContext(_0x39a059,_0x3c7884,_0x118be2,_0x236238,_0x37675e,_0xccd355){const _0x50af83=a101_0x152b06,_0x1644fe=extractRootFolderId(_0x118be2),{pathToId:_0x3e07c7,idToPath:_0x876f8d}=buildFolderMaps(_0x37675e),_0x1d8b9a=buildSegmentNameToIdMap(_0x236238),_0x4d51bc=new Map(),{batchAsync:_0x56d79e}=await import(_0x50af83(0x10a)),[_0x20f726,_0x3814c9]=await Promise[_0x50af83(0x1b8)]([_0x39a059[_0x50af83(0xe3)][_0x50af83(0xe5)](),_0x39a059['connection'][_0x50af83(0x1b5)](),((async()=>{const _0x2b925e=_0x50af83;!_0xccd355&&_0x236238[_0x2b925e(0x127)]>0x0&&await _0x56d79e(_0x236238,async _0x570dfa=>{const _0x4d38a5=_0x2b925e,_0x42c91a=await _0x39a059[_0x4d38a5(0x1c6)][_0x4d38a5(0x19d)](_0x3c7884,_0x570dfa['id']);_0x4d51bc[_0x4d38a5(0x1c4)](_0x570dfa['id'],_0x42c91a);});})())]),{emailToId:_0x2b1cfb,idToEmail:_0x38d8e1}=_0x20f726,_0x13715b=buildConnectionMaps(_0x3814c9);return{'rootFolderId':_0x1644fe,'folderPathToId':_0x3e07c7,'folderIdToPath':_0x876f8d,'segmentNameToId':_0x1d8b9a,'activationsBySegmentId':_0x4d51bc,'emailToIdMap':_0x2b1cfb,'idToEmailMap':_0x38d8e1,'connectionNameToIdMap':_0x13715b['nameToId'],'connectionIdToNameMap':_0x13715b[_0x50af83(0x17e)],'connectionNameToTypeMap':_0x13715b[_0x50af83(0x16a)]};}export function createPushYamlContextForBundle(_0xbcbcff,_0xbff683,_0x5bb4e6,_0x55deb7,_0x1ec924,_0x123e57,_0x3b847e,_0x1ef24d){const {existingLocalSegmentNames:_0x47fea7,localExpandedRuleToNames:_0x303ac8}=_0x55deb7,_0x47edab=new Set(),_0x68fb88=new Map(),_0x142418=new Map(),_0x8713e3=new Map(),_0x2f1eae=createJumpTargetCache(),_0x154f8a=new Map(),_0x4a0f52=new Map(),_0xba34f2=new Set();let _0x1d7db9;const _0xe90eaf=_0x5d2450=>{const _0x4bbae8={'resolveSegment':async _0x27656c=>{const _0x263f21=a101_0x1e36,_0x1c6618=_0x8713e3[_0x263f21(0x174)](_0x27656c);if(_0x1c6618!==undefined)return{'name':_0x1c6618,'isJourneyLocal':!![]};try{let _0x3a0d73=_0x5bb4e6[_0x263f21(0x151)](_0x263830=>_0x263830['id']===_0x27656c);!_0x3a0d73&&(_0x3a0d73=await _0xbcbcff[_0x263f21(0x1c6)][_0x263f21(0x104)](_0xbff683,_0x27656c));const _0x2033f2=generateJourneyLocalName(_0x3a0d73[_0x263f21(0x143)]),_0x42c696=_0x3a0d73['kind']===SEGMENT_KIND_JOURNEY&&_0x2033f2!==undefined;let _0x48eb33=_0x3a0d73[_0x263f21(0x143)],_0x3e6770;if(_0x42c696&&_0x3a0d73[_0x263f21(0x1a4)]){const _0xf1cb8=apiRuleToYaml(_0x3a0d73[_0x263f21(0x1a4)]);_0x4a0f52['set'](_0x27656c,_0xf1cb8);const _0x321ef2=async _0x3666e4=>{const _0x4c60e4=_0x263f21,_0x57626f=collectSegmentRefsFromRule(_0x3666e4);for(const _0x5589a0 of _0x57626f){if(!_0x4a0f52[_0x4c60e4(0x193)](_0x5589a0))try{const _0x3a3bf5=await _0xbcbcff['segment'][_0x4c60e4(0x104)](_0xbff683,_0x5589a0);if(_0x3a3bf5?.[_0x4c60e4(0x1a4)]){const _0x18d10c=apiRuleToYaml(_0x3a3bf5[_0x4c60e4(0x1a4)]);_0x4a0f52[_0x4c60e4(0x1c4)](_0x5589a0,_0x18d10c),await _0x321ef2(_0x18d10c);}}catch{}}};await _0x321ef2(_0xf1cb8);const _0x5717df=serializeExpandedRule(_0xf1cb8,_0x4a0f52),_0x5a64c5=_0x303ac8[_0x263f21(0x174)](_0x5717df);if(_0x5a64c5&&_0x5a64c5[_0x263f21(0x127)]>0x0){const _0x408112=_0x68fb88[_0x263f21(0x174)](_0x5717df)||0x0,_0x11d874=_0x5a64c5[_0x408112]||_0x5a64c5[_0x5a64c5[_0x263f21(0x127)]-0x1];_0x68fb88[_0x263f21(0x1c4)](_0x5717df,_0x408112+0x1),_0x48eb33=_0x11d874,_0x47edab[_0x263f21(0x139)](_0x48eb33),_0x8713e3[_0x263f21(0x1c4)](_0x27656c,_0x48eb33);const _0x20020d=await resolveRuleSegmentRefs(_0xf1cb8,async _0x44939c=>{const _0x598ab5=_0x263f21,_0x11cf41=_0x8713e3[_0x598ab5(0x174)](_0x44939c);if(_0x11cf41)return _0x11cf41;const _0x3d2f92=await _0x1d7db9['resolveSegment'](_0x44939c);return _0x3d2f92[_0x598ab5(0x143)];});_0x3e6770={'description':_0x3a0d73['description'],'rule':_0x20020d};}else{const _0x40cf4c=_0x154f8a['get'](_0x5717df);if(_0x40cf4c)_0x48eb33=_0x40cf4c,_0x8713e3['set'](_0x27656c,_0x48eb33);else{if(_0x2033f2){let _0x2e647e=_0x2033f2,_0x3c51aa=0x2;while(_0x47edab[_0x263f21(0x193)](_0x2e647e)||_0x47fea7[_0x263f21(0x193)](_0x2e647e)){_0x2e647e=_0x2033f2+'_'+_0x3c51aa,_0x3c51aa++;}_0x47edab[_0x263f21(0x139)](_0x2e647e),_0x48eb33=_0x2e647e;}_0x8713e3[_0x263f21(0x1c4)](_0x27656c,_0x48eb33),_0x154f8a['set'](_0x5717df,_0x48eb33);const _0x237b68=await resolveRuleSegmentRefs(_0xf1cb8,async _0x37ef13=>{const _0x42f90f=_0x263f21,_0x4b64b7=_0x8713e3[_0x42f90f(0x174)](_0x37ef13);if(_0x4b64b7)return _0x4b64b7;const _0x42a997=await _0x1d7db9[_0x42f90f(0xe9)](_0x37ef13);return _0x42a997['name'];});_0x3e6770={'description':_0x3a0d73[_0x263f21(0xf2)],'rule':_0x237b68};}}}return{'name':_0x48eb33,'isJourneyLocal':_0x42c696,'definition':_0x3e6770};}catch{return{'name':_0x27656c,'isJourneyLocal':![]};}},'resolveActivation':async _0x510afd=>{const _0x5d17e3=a101_0x1e36,_0x11ad75=_0x142418['get'](_0x510afd);if(_0x11ad75!==undefined)return{'name':_0x11ad75,'isJourneyLocal':!![]};try{let _0x36ca27=_0x3b847e?.[_0x5d17e3(0x174)](_0x510afd);!_0x36ca27&&(_0x36ca27=await _0xbcbcff[_0x5d17e3(0x18b)][_0x5d17e3(0x122)](_0x5d2450,_0x510afd));const _0x27a349=_0x36ca27[_0x5d17e3(0x100)]['activationParams'][_0x5d17e3(0x143)]||_0x510afd,_0x10fe3b=sanitizeYamlKey(_0x27a349)||_0x5d17e3(0x1bc)+_0x510afd,_0x409169=_0x10fe3b;_0x142418[_0x5d17e3(0x1c4)](_0x510afd,_0x409169);const _0x4537df=journeyActivationStepToYaml(_0x36ca27,_0x1ec924,_0x123e57);return{'name':_0x409169,'isJourneyLocal':!![],'definition':_0x4537df};}catch{return{'name':_0x510afd,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4b745a,_0x2332f1)=>resolveJumpTarget(_0x4b745a,_0x2332f1,_0x2f1eae,async _0x18dca4=>{const _0x312b5d=a101_0x1e36,_0x273a4c=_0x1ef24d?.[_0x312b5d(0x174)](_0x18dca4);if(_0x273a4c)return _0x273a4c;return _0xbcbcff[_0x312b5d(0x18b)]['getJourney'](_0x18dca4);})};return _0x1d7db9=_0x4bbae8,_0x4bbae8;},_0x3b0eaf=async _0x317ecb=>{const _0x37d398=a101_0x1e36,{collectSegmentIdsFromJourneyApi:_0x4114e3}=await import(_0x37d398(0x18a)),{batchAsync:_0x31ed9c}=await import('../../utils/async.js'),_0x392916=new Set();for(const _0x4ff463 of _0x317ecb){let _0x3c3feb=_0x1ef24d?.[_0x37d398(0x174)](_0x4ff463);!_0x3c3feb&&(_0x3c3feb=await _0xbcbcff[_0x37d398(0x18b)]['getJourney'](_0x4ff463));const _0x41b151=_0x4114e3(_0x3c3feb);for(const _0x44e88f of _0x41b151){_0x392916[_0x37d398(0x139)](_0x44e88f);}}let _0x5e4e45=Array['from'](_0x392916);while(_0x5e4e45[_0x37d398(0x127)]>0x0){const _0x306eb6=_0x5e4e45[_0x37d398(0x150)](_0x1ece79=>!_0xba34f2[_0x37d398(0x193)](_0x1ece79));if(_0x306eb6['length']===0x0)break;const _0x16e12c=await _0x31ed9c(_0x306eb6,async _0xc4c30e=>{const _0x440c6d=_0x37d398;_0xba34f2[_0x440c6d(0x139)](_0xc4c30e);let _0x1f3ec8=_0x5bb4e6[_0x440c6d(0x151)](_0x51dae9=>_0x51dae9['id']===_0xc4c30e);if(!_0x1f3ec8)try{_0x1f3ec8=await _0xbcbcff['segment'][_0x440c6d(0x104)](_0xbff683,_0xc4c30e);}catch{return null;}return{'segmentId':_0xc4c30e,'segment':_0x1f3ec8};},0xa),_0xf6818=new Set();for(const _0x4a93cd of _0x16e12c){if(!_0x4a93cd?.[_0x37d398(0x1c6)]?.[_0x37d398(0x1a4)])continue;const _0x161acf=apiRuleToYaml(_0x4a93cd['segment'][_0x37d398(0x1a4)]);_0x4a0f52[_0x37d398(0x1c4)](_0x4a93cd[_0x37d398(0x196)],_0x161acf);const _0x551b9c=collectSegmentRefsFromRule(_0x161acf);for(const _0xacf868 of _0x551b9c){!_0xba34f2[_0x37d398(0x193)](_0xacf868)&&_0xf6818[_0x37d398(0x139)](_0xacf868);}}_0x5e4e45=Array[_0x37d398(0x103)](_0xf6818);}};return{'createYamlContext':_0xe90eaf,'prefetchJourneySegments':_0x3b0eaf};}export async function executePushSegments(_0x238e2c,_0x814f22,_0x34da3d,_0x46dc9a,_0x23dae4){const _0xee8b44=a101_0x152b06,{segmentDefToCreateRequest:_0x1ee6b2,segmentDefToUpdateRequest:_0x442a34}=await import(_0xee8b44(0xfd)),_0x598af8=_0x34da3d[_0xee8b44(0x14d)],_0xf21bcb=0x5,_0x4ff36e=async _0x4d3089=>{const _0x38d881=_0xee8b44,_0x1facfd=_0x4d3089['folderPath']?_0x598af8[_0x38d881(0x174)](_0x4d3089[_0x38d881(0xed)]):undefined;let _0x540a2d;const _0x2d4b4d={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x4d3089[_0x38d881(0x19b)]){_0x23dae4['onProgress']?.({'type':_0x38d881(0x169),'name':_0x4d3089[_0x38d881(0x11e)][_0x38d881(0x143)]});const _0x1a3bbf=_0x1ee6b2(_0x4d3089['yamlConfig'],_0x1facfd),_0x4cbba6=await _0x23dae4['withProgress'](_0x38d881(0x170)+_0x4d3089['yamlConfig'][_0x38d881(0x143)]+_0x38d881(0x140),()=>_0x238e2c['segment']['createSegment'](_0x46dc9a[_0x38d881(0x1c5)],_0x1a3bbf));_0x540a2d=_0x4cbba6[_0x38d881(0xe0)]['id'],_0x2d4b4d[_0x38d881(0x172)]={'name':_0x4d3089[_0x38d881(0x11e)]['name'],'id':_0x540a2d},_0x23dae4[_0x38d881(0x157)]?.({'type':'segment_created','name':_0x4d3089[_0x38d881(0x11e)]['name'],'segmentId':_0x540a2d}),_0x23dae4[_0x38d881(0x11a)]?.(_0x38d881(0x136)+_0x4d3089[_0x38d881(0x11e)][_0x38d881(0x143)]+'\x27'),_0x2d4b4d['created']=0x1;}else{if(_0x4d3089[_0x38d881(0xde)]){_0x23dae4[_0x38d881(0x157)]?.({'type':'segment_updating','name':_0x4d3089[_0x38d881(0x11e)][_0x38d881(0x143)]});const _0x4cd256=_0x442a34(_0x4d3089['yamlConfig']);_0x1facfd!==_0x4d3089[_0x38d881(0x1be)]?.[_0x38d881(0x190)]&&(_0x4cd256['segmentFolderId']=_0x1facfd?parseInt(_0x1facfd,0xa):undefined),await _0x23dae4['withProgress'](_0x38d881(0x125)+_0x4d3089[_0x38d881(0x11e)][_0x38d881(0x143)]+'\x27...',()=>_0x238e2c[_0x38d881(0x1c6)][_0x38d881(0x1b6)](_0x46dc9a[_0x38d881(0x1c5)],_0x4d3089['existingSegment']['id'],_0x4cd256)),_0x540a2d=_0x4d3089[_0x38d881(0x1be)]['id'],_0x23dae4[_0x38d881(0x157)]?.({'type':_0x38d881(0xf0),'name':_0x4d3089[_0x38d881(0x11e)][_0x38d881(0x143)]}),_0x23dae4['logSuccess']?.(_0x38d881(0x19a)+_0x4d3089['yamlConfig'][_0x38d881(0x143)]+'\x27'),_0x2d4b4d[_0x38d881(0x1ad)]=0x1;}else _0x540a2d=_0x4d3089['existingSegment']['id'];}}catch(_0x28fe92){const _0x49fc24=isHttp400Error(_0x28fe92),_0x42579c=_0x49fc24?ErrorCode[_0x38d881(0xe6)]:ErrorCode[_0x38d881(0x184)],_0xc17d63=getErrorMessage(_0x28fe92);throw new SDKError(_0x42579c,_0x38d881(0x11f)+(_0x4d3089[_0x38d881(0x19b)]?_0x38d881(0x1c1):'update')+'\x20segment\x20from\x20file:\x20'+_0x4d3089[_0x38d881(0x15e)]+_0x38d881(0xfb)+_0xc17d63,_0x28fe92);}try{const _0x166909=await syncActivationsForSegment(_0x238e2c,_0x46dc9a['parentId'],_0x540a2d,_0x4d3089[_0x38d881(0x11e)]['name'],_0x4d3089[_0x38d881(0x145)],_0x23dae4,_0x4d3089[_0x38d881(0x15e)]);_0x2d4b4d[_0x38d881(0x147)]=_0x166909;}catch(_0x303453){if(_0x303453 instanceof SDKError)throw _0x303453;throw new SDKError(ErrorCode[_0x38d881(0x1a6)],_0x38d881(0x144)+_0x4d3089['yamlConfig'][_0x38d881(0x143)]+_0x38d881(0x155)+_0x4d3089[_0x38d881(0x15e)]+_0x38d881(0xfb)+getErrorMessage(_0x303453),_0x303453);}return _0x2d4b4d;},_0x363108=await batchAsync(_0x814f22,_0x4ff36e,_0xf21bcb),_0x1d6ebc={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1cffad of _0x363108){_0x1d6ebc[_0xee8b44(0x123)]+=_0x1cffad['created'],_0x1d6ebc[_0xee8b44(0x1ad)]+=_0x1cffad[_0xee8b44(0x1ad)],_0x1cffad[_0xee8b44(0x172)]&&_0x1d6ebc[_0xee8b44(0x109)]['set'](_0x1cffad[_0xee8b44(0x172)][_0xee8b44(0x143)],_0x1cffad[_0xee8b44(0x172)]['id']),_0x1d6ebc[_0xee8b44(0x147)][_0xee8b44(0x123)]+=_0x1cffad[_0xee8b44(0x147)][_0xee8b44(0x123)],_0x1d6ebc[_0xee8b44(0x147)][_0xee8b44(0x1ad)]+=_0x1cffad[_0xee8b44(0x147)][_0xee8b44(0x1ad)],_0x1d6ebc['activations'][_0xee8b44(0x1b7)]+=_0x1cffad[_0xee8b44(0x147)][_0xee8b44(0x1b7)];}return _0x1d6ebc;}async function syncActivationsForSegment(_0x1a9ffe,_0x270c83,_0x11aa6e,_0x1f1ad7,_0x458efe,_0xae09a7,_0xaa5901){const _0x18a919=a101_0x152b06,_0x2ba7df={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1b7519 of _0x458efe){try{if(_0x1b7519['type']===_0x18a919(0x1c1)&&_0x1b7519['validatedRequest'])_0xae09a7['onProgress']?.({'type':_0x18a919(0x16f),'segmentName':_0x1f1ad7,'activationName':_0x1b7519[_0x18a919(0x143)]}),await _0xae09a7[_0x18a919(0x1bd)](_0x18a919(0xf1)+_0x1b7519[_0x18a919(0x143)]+_0x18a919(0x140),()=>_0x1a9ffe[_0x18a919(0x1c6)][_0x18a919(0x118)](_0x270c83,_0x11aa6e,_0x1b7519[_0x18a919(0x1a2)])),_0xae09a7[_0x18a919(0x157)]?.({'type':_0x18a919(0x180),'segmentName':_0x1f1ad7,'activationName':_0x1b7519[_0x18a919(0x143)]}),_0xae09a7[_0x18a919(0x11a)]?.(_0x18a919(0x168)+_0x1b7519[_0x18a919(0x143)]+'\x27'),_0x2ba7df[_0x18a919(0x123)]++;else{if(_0x1b7519[_0x18a919(0xe7)]===_0x18a919(0x188)&&_0x1b7519[_0x18a919(0x1a2)]&&_0x1b7519['existingActivation'])_0xae09a7['onProgress']?.({'type':_0x18a919(0x128),'segmentName':_0x1f1ad7,'activationName':_0x1b7519[_0x18a919(0x143)]}),await _0xae09a7['withProgress'](_0x18a919(0x10f)+_0x1b7519['name']+'\x27...',()=>_0x1a9ffe[_0x18a919(0x1c6)][_0x18a919(0x1c0)](_0x270c83,_0x11aa6e,_0x1b7519[_0x18a919(0x114)]['id'],_0x1b7519['validatedRequest'])),_0xae09a7['onProgress']?.({'type':_0x18a919(0x17b),'segmentName':_0x1f1ad7,'activationName':_0x1b7519[_0x18a919(0x143)]}),_0xae09a7[_0x18a919(0x11a)]?.(_0x18a919(0x121)+_0x1b7519[_0x18a919(0x143)]+'\x27'),_0x2ba7df['updated']++;else _0x1b7519[_0x18a919(0xe7)]==='delete'&&_0x1b7519['existingActivation']&&(_0xae09a7[_0x18a919(0x157)]?.({'type':_0x18a919(0x101),'segmentName':_0x1f1ad7,'activationName':_0x1b7519['name']}),await _0xae09a7[_0x18a919(0x1bd)]('Deleting\x20activation\x20\x27'+_0x1b7519['name']+_0x18a919(0x140),()=>_0x1a9ffe[_0x18a919(0x1c6)][_0x18a919(0x1af)](_0x270c83,_0x11aa6e,_0x1b7519[_0x18a919(0x114)]['id'])),_0xae09a7[_0x18a919(0x157)]?.({'type':_0x18a919(0xfa),'segmentName':_0x1f1ad7,'activationName':_0x1b7519[_0x18a919(0x143)]}),_0xae09a7['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x1b7519[_0x18a919(0x143)]+'\x27'),_0x2ba7df[_0x18a919(0x1b7)]++);}}catch(_0x3ec43a){const _0x33d869=isHttp400Error(_0x3ec43a),_0x45386e=_0x33d869?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x395e23=getErrorMessage(_0x3ec43a);throw new SDKError(_0x45386e,_0x18a919(0x11f)+_0x1b7519[_0x18a919(0xe7)]+_0x18a919(0x13e)+_0x1b7519[_0x18a919(0x143)]+'\x27\x20from\x20file:\x20'+_0xaa5901+_0x18a919(0xfb)+_0x395e23,_0x3ec43a);}}return _0x2ba7df;}export async function executePushFolders(_0x58f4ee,_0x1897df,_0x485358,_0x5bcfe2,_0x43ff3e){const _0x21dbf2=a101_0x152b06,_0x475710=new Map(_0x485358);for(const _0x41073a of _0x1897df){const _0x104d34=_0x41073a[_0x21dbf2(0x13f)]('/'),_0x37425b=_0x104d34[_0x104d34[_0x21dbf2(0x127)]-0x1],_0x42de6d=_0x104d34[_0x21dbf2(0xee)](0x0,-0x1)[_0x21dbf2(0x12d)]('/'),_0x276a8d=_0x475710[_0x21dbf2(0x174)](_0x42de6d);_0x43ff3e[_0x21dbf2(0x157)]?.({'type':_0x21dbf2(0x12c),'folder':_0x41073a});const _0x4109fc={'name':_0x37425b,'parentFolderId':_0x276a8d},_0x5b23bf=await _0x43ff3e[_0x21dbf2(0x1bd)](_0x21dbf2(0xdf)+_0x41073a+'\x27...',()=>_0x58f4ee[_0x21dbf2(0x1c6)][_0x21dbf2(0x10c)](_0x5bcfe2[_0x21dbf2(0x1c5)],_0x4109fc));_0x475710['set'](_0x41073a,_0x5b23bf[_0x21dbf2(0xe0)]['id']),_0x43ff3e[_0x21dbf2(0x157)]?.({'type':_0x21dbf2(0x152),'folder':_0x41073a,'folderId':_0x5b23bf[_0x21dbf2(0xe0)]['id']}),_0x43ff3e[_0x21dbf2(0x1c3)]?.(_0x21dbf2(0x106)+_0x41073a+'\x27');}return _0x475710;}export async function executePushSegmentDeletions(_0xcd366f,_0x421634,_0x3c2885){const _0xddb515=a101_0x152b06;if(_0x421634[_0xddb515(0x127)]===0x0)return 0x0;const {batchAsync:_0x3d58a3}=await import(_0xddb515(0x10a)),_0x593103=0x5,_0x3f07fb=await _0x3d58a3(_0x421634,async _0x4eae6f=>{const _0x59a2ed=_0xddb515;return _0x3c2885[_0x59a2ed(0x157)]?.({'type':_0x59a2ed(0x17d),'name':_0x4eae6f['name']}),await _0xcd366f[_0x59a2ed(0x1c6)][_0x59a2ed(0x12a)](_0x4eae6f['id']),_0x3c2885[_0x59a2ed(0x157)]?.({'type':'segment_deleted','name':_0x4eae6f[_0x59a2ed(0x143)]}),_0x3c2885['logDeleted']?.(_0x59a2ed(0x181)+_0x4eae6f['name']+'\x27'),0x1;},_0x593103);return _0x3f07fb[_0xddb515(0x194)]((_0x55f4b0,_0x23a1b9)=>_0x55f4b0+_0x23a1b9,0x0);}export async function executePushJourneys(_0x43452e,_0x289133,_0x1529b4,_0x1f6ce1,_0x109c78){const _0x23d6d1=a101_0x152b06,{journeyDefToRequest:_0x4bce03}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x34831e,yamlRuleToApi:_0xd18a07,validateSegmentRule:_0x6fc3a9}=await import(_0x23d6d1(0xfd)),_0x2f659b={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1f9012=new Map(_0x1529b4[_0x23d6d1(0x18e)]),_0x5e211d=0x5;for(let _0x228d3b=0x0;_0x228d3b<_0x289133['length'];_0x228d3b+=_0x5e211d){const _0x5957fd=_0x289133['slice'](_0x228d3b,_0x228d3b+_0x5e211d),_0x46d84d=await Promise[_0x23d6d1(0x1b8)](_0x5957fd['map'](async _0x5b334f=>{const _0x3c719b=_0x23d6d1;if(!_0x5b334f['isNew']&&!_0x5b334f[_0x3c719b(0xde)])return{'action':_0x3c719b(0x19e),'name':_0x5b334f[_0x3c719b(0x11e)]['name'],'journeyId':_0x5b334f[_0x3c719b(0x108)]?.['id']};const _0x296d77=_0x5b334f[_0x3c719b(0xed)]?_0x1529b4[_0x3c719b(0x14d)][_0x3c719b(0x174)](_0x5b334f[_0x3c719b(0xed)]):undefined;_0x109c78[_0x3c719b(0x157)]?.({'type':_0x5b334f['isNew']?'journey_creating':_0x3c719b(0x10b),'name':_0x5b334f['yamlConfig'][_0x3c719b(0x143)]});try{const _0x43a495=await executeSingleJourneyPush(_0x43452e,_0x5b334f,{..._0x1529b4,'segmentNameToId':_0x1f9012},{'parentId':_0x1f6ce1[_0x3c719b(0x1c5)],'rootFolderId':_0x1f6ce1[_0x3c719b(0x11d)],'folderId':_0x296d77,'verbose':_0x1f6ce1[_0x3c719b(0x117)]},_0x109c78,{'journeyDefToRequest':_0x4bce03,'activationDefToCreateRequest':_0x34831e,'yamlRuleToApi':_0xd18a07,'validateSegmentRule':_0x6fc3a9});for(const [_0x279fec,_0x1ef9af]of _0x43a495[_0x3c719b(0x17c)]){_0x1f9012[_0x3c719b(0x1c4)](_0x279fec,_0x1ef9af),_0x2f659b['embeddedSegmentNameToId'][_0x3c719b(0x1c4)](_0x279fec,_0x1ef9af);}if(_0x43a495[_0x3c719b(0x115)]===_0x3c719b(0x123))_0x109c78[_0x3c719b(0x157)]?.({'type':'journey_created','name':_0x5b334f[_0x3c719b(0x11e)][_0x3c719b(0x143)],'journeyId':_0x43a495['journeyId']}),_0x109c78[_0x3c719b(0x11a)]?.(_0x3c719b(0x102)+_0x5b334f[_0x3c719b(0x11e)][_0x3c719b(0x143)]+'\x27'),_0x2f659b[_0x3c719b(0x123)]++;else _0x43a495[_0x3c719b(0x115)]===_0x3c719b(0x1ad)&&(_0x109c78[_0x3c719b(0x157)]?.({'type':_0x3c719b(0x138),'name':_0x5b334f['yamlConfig'][_0x3c719b(0x143)]}),_0x109c78['logSuccess']?.('Updated\x20journey\x20\x27'+_0x5b334f['yamlConfig']['name']+'\x27'),_0x2f659b[_0x3c719b(0x1ad)]++);return{'action':_0x43a495[_0x3c719b(0x115)],'name':_0x5b334f[_0x3c719b(0x11e)][_0x3c719b(0x143)],'journeyId':_0x43a495[_0x3c719b(0x159)]};}catch(_0x41328b){const _0x14aad0=isHttp400Error(_0x41328b),_0x8918bd=_0x14aad0?ErrorCode[_0x3c719b(0x13d)]:ErrorCode[_0x3c719b(0x16d)],_0x242e21=getErrorMessage(_0x41328b);throw new SDKError(_0x8918bd,'Failed\x20to\x20'+(_0x5b334f[_0x3c719b(0x19b)]?_0x3c719b(0x1c1):_0x3c719b(0x188))+_0x3c719b(0x141)+_0x5b334f['absolutePath']+_0x3c719b(0xfb)+_0x242e21,_0x41328b);}}));_0x2f659b['results'][_0x23d6d1(0x116)](..._0x46d84d);}return _0x2f659b;}async function executeSingleJourneyPush(_0x4835d7,_0x231838,_0x168f50,_0x38ad06,_0x546557,_0x19cc2e){const _0x537e2c=a101_0x152b06,{journeyDefToRequest:_0x5c36d8,activationDefToCreateRequest:_0x4f90b9,yamlRuleToApi:_0x2ea263,validateSegmentRule:_0xdb1fe0}=_0x19cc2e,_0x1fb3a8=new Map(),_0xa8afbe=new Map(),_0x250ab1=new Map(),_0x4548a=new Map(),_0x311c31=new Map();let _0x42096d;const _0x4aa9b3=async()=>{const _0x44e83b=a101_0x1e36;if(_0x42096d)return;_0x42096d=new Map();if(!_0x231838[_0x44e83b(0x108)])return;const _0x3a0b13=await _0x4835d7[_0x44e83b(0x18b)][_0x44e83b(0x19d)](_0x231838['existingJourney']['id']);for(const _0x4b34d2 of _0x3a0b13){const _0x1b7931=journeyActivationStepToYaml(_0x4b34d2,_0x168f50[_0x44e83b(0xff)],_0x168f50[_0x44e83b(0x19f)]),_0x57113a=activationSignature(_0x1b7931);!_0x42096d['has'](_0x57113a)&&_0x42096d['set'](_0x57113a,_0x4b34d2['id']),_0x1b7931['name']&&_0xa8afbe[_0x44e83b(0x1c4)](_0x1b7931[_0x44e83b(0x143)],_0x4b34d2['id']);}};if(_0x231838[_0x537e2c(0x108)]&&_0x231838[_0x537e2c(0x11e)]['segments']){const _0x5e191f=buildLocalExpandedRuleMappings(_0x231838[_0x537e2c(0x11e)]),_0x596326=_0x5e191f[_0x537e2c(0x19c)];if(_0x596326['size']>0x0){const _0x2c386f=new Map();for(const [_0x26d5e7,_0x5bb226]of _0x596326){const _0x8ad7fd=serializeExpandedRule(_0x5bb226,_0x596326);_0x2c386f['set'](_0x26d5e7,_0x8ad7fd);}const _0x322531=collectSegmentIdsFromJourneyApi(_0x231838[_0x537e2c(0x108)]);if(_0x322531[_0x537e2c(0x1b9)]>0x0){const _0x49d462=await buildServerSegmentRuleMap(_0x4835d7,_0x38ad06[_0x537e2c(0x1c5)],_0x168f50[_0x537e2c(0x192)],_0x322531);if(_0x49d462[_0x537e2c(0x1b9)]>0x0){const _0x5aee9f=new Map();for(const [_0x20eee0,_0x5c731c]of _0x49d462){const _0x549268=serializeExpandedRule(_0x5c731c,_0x49d462);!_0x5aee9f[_0x537e2c(0x193)](_0x549268)&&_0x5aee9f[_0x537e2c(0x1c4)](_0x549268,_0x20eee0);}for(const [_0xc95e3d,_0x3dff07]of _0x2c386f){const _0x2ffd17=_0x5aee9f[_0x537e2c(0x174)](_0x3dff07);_0x2ffd17&&(_0x311c31[_0x537e2c(0x1c4)](_0xc95e3d,_0x2ffd17),_0x168f50[_0x537e2c(0x18e)]['set'](_0xc95e3d,_0x2ffd17));}}}}}const _0xa7921f={'resolveSegmentId':async _0x1b61d0=>{const _0x490d27=_0x537e2c,_0x7c67a1=_0x168f50[_0x490d27(0x18e)]['get'](_0x1b61d0);if(!_0x7c67a1)throw new SDKError(ErrorCode[_0x490d27(0xf5)],_0x490d27(0xf4)+_0x1b61d0+_0x490d27(0x173)+_0x231838[_0x490d27(0x11e)][_0x490d27(0x143)]+')');return _0x7c67a1;},'resolveEmbeddedSegmentId':async(_0xb9874,_0x16467e)=>{const _0x26f927=_0x537e2c,_0x175558=_0x168f50['segmentNameToId'][_0x26f927(0x174)](_0xb9874);if(_0x175558)return _0x175558;const _0xb17f5f=_0x311c31['get'](_0xb9874);if(_0xb17f5f)return _0x168f50[_0x26f927(0x18e)][_0x26f927(0x1c4)](_0xb9874,_0xb17f5f),_0xb17f5f;const _0x180e3d=_0x168f50['existingSegments'][_0x26f927(0x151)](_0x3cbb7c=>_0x3cbb7c[_0x26f927(0x143)]===_0xb9874);if(_0x180e3d)return _0x168f50[_0x26f927(0x18e)][_0x26f927(0x1c4)](_0xb9874,_0x180e3d['id']),_0x180e3d['id'];if(_0x231838[_0x26f927(0x19b)]){const {stageName:_0x5b9676,criteriaName:_0x14a165}=findSegmentCriteriaLocation(_0x231838[_0x26f927(0x11e)],_0xb9874);return _0xdb1fe0(_0xb9874,_0x16467e['rule']),_0x250ab1['set'](_0xb9874,{'definition':_0x16467e,'stageName':_0x5b9676,'criteriaName':_0x14a165}),createPendingSegmentId(_0xb9874);}const _0x26f9d3=_0x231838[_0x26f927(0x108)]?.['id'];if(!_0x26f9d3)throw new SDKError(ErrorCode[_0x26f927(0x1a8)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0xdb1fe0(_0xb9874,_0x16467e[_0x26f927(0x1a4)]);const _0xcbea2f=generateDeterministicJourneySegmentName(_0x231838[_0x26f927(0x11e)][_0x26f927(0x143)],_0xb9874),_0x5bd7da=_0x168f50[_0x26f927(0x192)][_0x26f927(0x151)](_0x4bf126=>_0x4bf126[_0x26f927(0x143)]===_0xcbea2f),_0x5061da=createSegmentIdResolver(_0x168f50[_0x26f927(0x18e)],_0xb9874),_0x50ed57=await resolveRuleSegmentIds(_0x16467e[_0x26f927(0x1a4)],_0x5061da);let _0xf69460;if(_0x5bd7da)await _0x4835d7[_0x26f927(0x1c6)][_0x26f927(0x1b6)](_0x38ad06['parentId'],_0x5bd7da['id'],{'description':_0x16467e[_0x26f927(0xf2)]||_0x26f927(0x110)+_0xb9874,'rule':_0x2ea263(_0x50ed57,!![]),'countPopulation':!![]}),_0xf69460=_0x5bd7da['id'];else try{_0xf69460=await _0x4835d7[_0x26f927(0x1c6)][_0x26f927(0x195)]({'name':_0xcbea2f,'description':_0x16467e[_0x26f927(0xf2)]||'Entry\x20criteria:\x20'+_0xb9874,'journeyId':_0x26f9d3,'rule':_0x2ea263(_0x50ed57,!![]),'countPopulation':!![],'parentFolderId':_0x38ad06[_0x26f927(0x11d)]||'','audienceId':_0x38ad06[_0x26f927(0x1c5)]});}catch(_0x18e107){const _0x254da6=_0x18e107 instanceof Error&&_0x18e107[_0x26f927(0xfe)][_0x26f927(0x14b)](_0x26f927(0x13b));if(_0x254da6){const _0x347960=await _0x4835d7[_0x26f927(0x1c6)][_0x26f927(0x16b)](_0x38ad06['parentId']),_0x915d0e=_0x347960[_0x26f927(0x151)](_0x81bea1=>_0x81bea1[_0x26f927(0x143)]===_0xcbea2f);if(_0x915d0e)await _0x4835d7[_0x26f927(0x1c6)][_0x26f927(0x1b6)](_0x38ad06[_0x26f927(0x1c5)],_0x915d0e['id'],{'description':_0x16467e['description']||_0x26f927(0x110)+_0xb9874,'rule':_0x2ea263(_0x50ed57,!![]),'countPopulation':!![]}),_0xf69460=_0x915d0e['id'];else throw _0x18e107;}else throw _0x18e107;}return _0x168f50[_0x26f927(0x18e)][_0x26f927(0x1c4)](_0xb9874,_0xf69460),_0x1fb3a8['set'](_0xb9874,_0xf69460),_0xf69460;},'resolveActivationId':async _0x4bb1a9=>{const _0x4db2ac=_0x537e2c,_0x5551f5=_0xa8afbe[_0x4db2ac(0x174)](_0x4bb1a9);if(_0x5551f5)return _0x5551f5;if(_0x231838[_0x4db2ac(0x108)]){await _0x4aa9b3();const _0x47f19=_0xa8afbe[_0x4db2ac(0x174)](_0x4bb1a9);if(_0x47f19)return _0x47f19;}throw new SDKError(ErrorCode[_0x4db2ac(0x1ab)],_0x4db2ac(0x107)+_0x4bb1a9+_0x4db2ac(0x173)+_0x231838[_0x4db2ac(0x11e)][_0x4db2ac(0x143)]+_0x4db2ac(0xef)+_0x4db2ac(0x15d));},'resolveEmbeddedActivationId':async(_0x3f9708,_0x502e2b)=>{const _0x9f9ec5=_0x537e2c,_0x2a57af=_0xa8afbe[_0x9f9ec5(0x174)](_0x3f9708);if(_0x2a57af)return _0x2a57af;if(_0x231838['isNew'])return _0x4548a[_0x9f9ec5(0x1c4)](_0x3f9708,_0x502e2b),createPendingActivationId(_0x3f9708);if(_0x231838[_0x9f9ec5(0x108)]){await _0x4aa9b3();const _0x4049ca=_0xa8afbe[_0x9f9ec5(0x174)](_0x502e2b[_0x9f9ec5(0x143)]);if(_0x4049ca)return _0xa8afbe[_0x9f9ec5(0x1c4)](_0x3f9708,_0x4049ca),_0x4049ca;const _0x27f5a8=activationSignature(_0x502e2b),_0x78883d=_0x42096d?.[_0x9f9ec5(0x174)](_0x27f5a8);if(_0x78883d)return _0xa8afbe[_0x9f9ec5(0x1c4)](_0x3f9708,_0x78883d),_0x78883d;const _0xe39be6=await _0x4f90b9(_0x502e2b,_0x168f50[_0x9f9ec5(0x1a0)]),_0x1a15ac=await _0x4835d7[_0x9f9ec5(0x18b)][_0x9f9ec5(0x118)](_0x231838[_0x9f9ec5(0x108)]['id'],_0xe39be6);return _0xa8afbe['set'](_0x3f9708,_0x1a15ac['id']),_0x1a15ac['id'];}throw new SDKError(ErrorCode[_0x9f9ec5(0x1a8)],_0x9f9ec5(0x182));},'resolveJourneyId':async _0x140f1a=>{const _0x1ca298=_0x537e2c;try{return await _0x4835d7[_0x1ca298(0x18b)][_0x1ca298(0x17f)](_0x38ad06[_0x1ca298(0x1c5)],_0x140f1a);}catch(_0xe7a05e){throw new SDKError(ErrorCode[_0x1ca298(0x1ab)],_0x1ca298(0x16c)+_0x140f1a+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x231838[_0x1ca298(0x11e)]['name']+'\x27)',_0xe7a05e);}},'resolveStageId':async(_0x295236,_0x4ee2a2)=>{const _0x1535f8=_0x537e2c,_0x14530a=await _0x4835d7[_0x1535f8(0x18b)][_0x1535f8(0x1aa)](_0x295236),_0x294a24=_0x14530a['attributes'][_0x1535f8(0xe2)][_0x1535f8(0x151)](_0x1406ea=>_0x1406ea['name'][_0x1535f8(0x158)]()===_0x4ee2a2[_0x1535f8(0x158)]());if(!_0x294a24?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x1535f8(0x176)+_0x4ee2a2+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x14530a[_0x1535f8(0x100)][_0x1535f8(0x1b3)]||_0x14530a[_0x1535f8(0x100)][_0x1535f8(0x143)])+'\x27');return _0x294a24['id'];}},_0x193cae=await _0x5c36d8(_0x231838[_0x537e2c(0x11e)],_0x38ad06[_0x537e2c(0x1c5)],_0xa7921f),_0x145192=_0x38ad06[_0x537e2c(0xf7)]||_0x38ad06[_0x537e2c(0x11d)];_0x145192&&(_0x193cae['relationships']={'parentFolder':{'data':{'id':_0x145192,'type':'folder'}}});if(_0x231838['isNew']){if(_0x250ab1[_0x537e2c(0x1b9)]>0x0||_0x4548a[_0x537e2c(0x1b9)]>0x0)return await executeThreeStepJourneyCreate(_0x4835d7,_0x231838,_0x193cae,{'pendingEmbeddedSegments':_0x250ab1,'pendingEmbeddedActivations':_0x4548a,'embeddedSegmentNameToId':_0x1fb3a8,'journeyActivationNameToId':_0xa8afbe},{..._0x38ad06,'effectiveFolderId':_0x145192},_0x168f50,_0x546557,_0x19cc2e);else{ensureJourneyDefaults(_0x193cae['attributes']);const _0x56358a=await _0x4835d7[_0x537e2c(0x18b)][_0x537e2c(0x1c1)](_0x193cae);return{'action':_0x537e2c(0x123),'journeyId':_0x56358a['id'],'embeddedSegmentNameToId':_0x1fb3a8};}}else{if(_0x231838[_0x537e2c(0xde)]&&_0x231838[_0x537e2c(0x108)])return ensureJourneyDefaults(_0x193cae['attributes']),await _0x4835d7[_0x537e2c(0x18b)]['update'](_0x231838['existingJourney']['id'],_0x193cae),{'action':_0x537e2c(0x1ad),'journeyId':_0x231838['existingJourney']['id'],'embeddedSegmentNameToId':_0x1fb3a8};}return{'action':_0x537e2c(0x19e),'journeyId':_0x231838[_0x537e2c(0x108)]?.['id'],'embeddedSegmentNameToId':_0x1fb3a8};}function findSegmentCriteriaLocation(_0x331ba3,_0x401cc4){const _0x4b05a5=a101_0x152b06,_0x2d57f3=_0x331ba3[_0x4b05a5(0x197)]||_0x331ba3[_0x4b05a5(0x18f)]?.[0x0]?.['stages']||[];let _0x49c747='entry',_0x2ba714=_0x401cc4;const _0x300852=_0x331ba3[_0x4b05a5(0x165)]||_0x331ba3[_0x4b05a5(0x18f)]?.[0x0]?.[_0x4b05a5(0x165)];if(_0x300852?.[_0x4b05a5(0x1c6)]===_0x401cc4)return{'stageName':_0x4b05a5(0x165),'criteriaName':_0x300852[_0x4b05a5(0x143)]||_0x401cc4};_0x1e55f7:for(const _0x557c04 of _0x2d57f3){if(_0x557c04[_0x4b05a5(0x126)]?.[_0x4b05a5(0x1c6)]===_0x401cc4){_0x49c747=_0x557c04[_0x4b05a5(0x143)],_0x2ba714=_0x557c04['entry_criteria'][_0x4b05a5(0x143)]||_0x401cc4;break;}if(_0x557c04[_0x4b05a5(0x1a7)])for(const _0x451aa9 of _0x557c04['steps']){if(_0x451aa9['type']==='decision_point'&&_0x451aa9[_0x4b05a5(0x105)]?.[_0x4b05a5(0x183)])for(const _0x3fd219 of _0x451aa9[_0x4b05a5(0x105)][_0x4b05a5(0x183)]){if(_0x3fd219[_0x4b05a5(0x1c6)]===_0x401cc4){_0x49c747=_0x557c04[_0x4b05a5(0x143)],_0x2ba714=_0x3fd219[_0x4b05a5(0x143)]||_0x401cc4;break _0x1e55f7;}}}}return{'stageName':_0x49c747,'criteriaName':_0x2ba714};}async function executeThreeStepJourneyCreate(_0x5b4052,_0x50c7ce,_0x143b5e,_0x3c4065,_0x28b267,_0x515eb6,_0x59d721,_0x42b9f9){const _0xd750a4=a101_0x152b06,{activationDefToCreateRequest:_0x4be99d,yamlRuleToApi:_0x321235}=_0x42b9f9,{pendingEmbeddedSegments:_0x1c544b,pendingEmbeddedActivations:_0x977ef1,embeddedSegmentNameToId:_0x1c0b8c}=_0x3c4065,_0x1e619e=JSON[_0xd750a4(0x161)](JSON[_0xd750a4(0x129)](_0x143b5e));ensureJourneyDefaults(_0x1e619e[_0xd750a4(0x100)]),stripPendingIds(_0x1e619e);const _0x269fdf=await _0x5b4052[_0xd750a4(0x18b)][_0xd750a4(0x1c1)](_0x1e619e),_0x3aa30d=_0x269fdf['id'],_0x5383d3=new Map();for(const _0x25d58b of _0x269fdf[_0xd750a4(0x100)]['journeyStages']){_0x5383d3[_0xd750a4(0x1c4)](_0x25d58b[_0xd750a4(0x143)][_0xd750a4(0x158)](),_0x25d58b['id']);}for(const [_0x1ab11a,{definition:_0x3a3884}]of _0x1c544b){const _0x4b5aba=generateDeterministicJourneySegmentName(_0x50c7ce[_0xd750a4(0x11e)]['name'],_0x1ab11a);_0x59d721[_0xd750a4(0x157)]?.({'type':_0xd750a4(0x1ba),'journeyName':_0x50c7ce[_0xd750a4(0x11e)][_0xd750a4(0x143)],'segmentName':_0x1ab11a});const _0x11a21a=createSegmentIdResolver(_0x515eb6[_0xd750a4(0x18e)],_0x1ab11a),_0x3fdbc7=await resolveRuleSegmentIds(_0x3a3884[_0xd750a4(0x1a4)],_0x11a21a),_0x5f18ed=await _0x5b4052[_0xd750a4(0x1c6)]['createJourneySegment']({'name':_0x4b5aba,'description':_0x3a3884[_0xd750a4(0xf2)]||'Entry\x20criteria:\x20'+_0x1ab11a,'journeyId':_0x3aa30d,'rule':_0x321235(_0x3fdbc7,!![]),'countPopulation':!![],'parentFolderId':_0x28b267['effectiveFolderId']||'','audienceId':_0x28b267[_0xd750a4(0x1c5)]});_0x1c0b8c['set'](_0x1ab11a,_0x5f18ed),_0x515eb6[_0xd750a4(0x18e)][_0xd750a4(0x1c4)](_0x1ab11a,_0x5f18ed),_0x59d721[_0xd750a4(0x157)]?.({'type':_0xd750a4(0x124),'journeyName':_0x50c7ce[_0xd750a4(0x11e)][_0xd750a4(0x143)],'segmentName':_0x1ab11a});}const _0x473a2c=new Map();for(const [_0x4a21eb,_0x45757c]of _0x977ef1){_0x59d721['onProgress']?.({'type':_0xd750a4(0x11c),'journeyName':_0x50c7ce[_0xd750a4(0x11e)][_0xd750a4(0x143)],'activationName':_0x4a21eb});const _0x4df868=await _0x4be99d(_0x45757c,_0x515eb6[_0xd750a4(0x1a0)]),_0x45a610=await _0x5b4052[_0xd750a4(0x18b)][_0xd750a4(0x118)](_0x3aa30d,_0x4df868);_0x473a2c[_0xd750a4(0x1c4)](_0x4a21eb,_0x45a610['id']),_0x3c4065['journeyActivationNameToId']['set'](_0x4a21eb,_0x45a610['id']),_0x59d721[_0xd750a4(0x157)]?.({'type':_0xd750a4(0x119),'journeyName':_0x50c7ce[_0xd750a4(0x11e)]['name'],'activationName':_0x4a21eb});}const _0xca1e19=JSON[_0xd750a4(0x161)](JSON[_0xd750a4(0x129)](_0x143b5e));return _0xca1e19['id']=_0x3aa30d,ensureJourneyDefaults(_0xca1e19['attributes']),resolvePendingIdsInRequest(_0xca1e19,_0x143b5e,_0x5383d3,_0x1c0b8c,_0x473a2c,_0x59d721),await _0x5b4052[_0xd750a4(0x18b)][_0xd750a4(0x188)](_0x3aa30d,_0xca1e19),{'action':_0xd750a4(0x123),'journeyId':_0x3aa30d,'embeddedSegmentNameToId':_0x1c0b8c};}function stripPendingIds(_0x40df0e){const _0x261279=a101_0x152b06;for(const _0xc82a22 of _0x40df0e[_0x261279(0x100)][_0x261279(0xe2)]||[]){_0xc82a22['entryCriteria']?.[_0x261279(0x196)]&&isPendingSegmentId(_0xc82a22[_0x261279(0x133)][_0x261279(0x196)])&&delete _0xc82a22[_0x261279(0x133)];if(_0xc82a22['steps'])for(const _0x56cd72 of Object[_0x261279(0x11b)](_0xc82a22[_0x261279(0x1a7)])){const _0x56f74a=_0xc82a22[_0x261279(0x1a7)][_0x56cd72];_0x56f74a[_0x261279(0xe7)]===_0x261279(0x111)&&_0x56f74a[_0x261279(0x17a)]&&isPendingActivationId(_0x56f74a[_0x261279(0x17a)])&&(_0x56f74a[_0x261279(0x17a)]='');if(_0x56f74a[_0x261279(0xe7)]==='DecisionPoint'&&_0x56f74a[_0x261279(0x183)])for(const _0x3011c7 of _0x56f74a[_0x261279(0x183)]){_0x3011c7['segmentId']&&isPendingSegmentId(_0x3011c7[_0x261279(0x196)])&&(_0x3011c7[_0x261279(0x196)]='');}_0x56f74a[_0x261279(0xe7)]===_0x261279(0x113)&&_0x56f74a[_0x261279(0x10e)]?.[_0x261279(0x196)]&&isPendingSegmentId(_0x56f74a[_0x261279(0x10e)][_0x261279(0x196)])&&(_0x56f74a[_0x261279(0x10e)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x1b5e1a,_0x370499,_0x2097d9,_0x4afb33,_0x11cad2,_0x25307b){const _0x315fe1=a101_0x152b06,_0x2b7b59=(_0x3e0303,_0x246590)=>{const _0x4f1aad=a101_0x1e36;if(!isPendingSegmentId(_0x3e0303))return _0x3e0303;const _0x88a55b=extractPendingSegmentName(_0x3e0303),_0x15e2c8=_0x4afb33[_0x4f1aad(0x174)](_0x88a55b);return!_0x15e2c8&&_0x25307b[_0x4f1aad(0x137)]?.(_0x4f1aad(0x1a3)+_0x88a55b+_0x4f1aad(0x1ae)+_0x246590),_0x15e2c8;};if(_0x1b5e1a['attributes'][_0x315fe1(0x165)]?.[_0x315fe1(0x196)]&&isPendingSegmentId(_0x1b5e1a[_0x315fe1(0x100)]['goal']['segmentId'])){const _0x456ee3=_0x2b7b59(_0x1b5e1a[_0x315fe1(0x100)][_0x315fe1(0x165)][_0x315fe1(0x196)],_0x315fe1(0x1b1));_0x456ee3&&(_0x1b5e1a[_0x315fe1(0x100)][_0x315fe1(0x165)][_0x315fe1(0x196)]=_0x456ee3);}for(const _0x1a0b86 of _0x1b5e1a[_0x315fe1(0x100)][_0x315fe1(0xe2)]||[]){const _0x5828f5=_0x2097d9[_0x315fe1(0x174)](_0x1a0b86[_0x315fe1(0x143)]['toLowerCase']());_0x5828f5&&(_0x1a0b86['id']=_0x5828f5);if(_0x1a0b86[_0x315fe1(0x133)]?.[_0x315fe1(0x196)]&&isPendingSegmentId(_0x1a0b86[_0x315fe1(0x133)][_0x315fe1(0x196)])){const _0x4ecebb=_0x2b7b59(_0x1a0b86[_0x315fe1(0x133)][_0x315fe1(0x196)],'stage\x20\x27'+_0x1a0b86[_0x315fe1(0x143)]+_0x315fe1(0x15b));_0x4ecebb&&(_0x1a0b86[_0x315fe1(0x133)][_0x315fe1(0x196)]=_0x4ecebb);}if(_0x1a0b86[_0x315fe1(0x171)])for(const _0x51d6db of _0x1a0b86[_0x315fe1(0x171)]){if(_0x51d6db[_0x315fe1(0x196)]&&isPendingSegmentId(_0x51d6db[_0x315fe1(0x196)])){const _0x40f201=_0x2b7b59(_0x51d6db[_0x315fe1(0x196)],_0x315fe1(0x1ac)+_0x1a0b86[_0x315fe1(0x143)]+_0x315fe1(0x10d));_0x40f201&&(_0x51d6db['segmentId']=_0x40f201);}}if(_0x1a0b86[_0x315fe1(0xf3)]?.[_0x315fe1(0x196)]&&isPendingSegmentId(_0x1a0b86[_0x315fe1(0xf3)][_0x315fe1(0x196)])){const _0x219e75=_0x2b7b59(_0x1a0b86[_0x315fe1(0xf3)][_0x315fe1(0x196)],_0x315fe1(0x1ac)+_0x1a0b86['name']+_0x315fe1(0x153));_0x219e75&&(_0x1a0b86[_0x315fe1(0xf3)][_0x315fe1(0x196)]=_0x219e75);}if(_0x1a0b86[_0x315fe1(0x1a7)]){const _0x8014a7=_0x13731a=>_0x370499[_0x315fe1(0x100)][_0x315fe1(0xe2)]['find'](_0x1efae0=>_0x1efae0['name'][_0x315fe1(0x158)]()===_0x1a0b86[_0x315fe1(0x143)][_0x315fe1(0x158)]())?.[_0x315fe1(0x1a7)]?.[_0x13731a];for(const _0x549fd0 of Object[_0x315fe1(0x11b)](_0x1a0b86['steps'])){const _0x455de8=_0x1a0b86[_0x315fe1(0x1a7)][_0x549fd0],_0x399643=_0x8014a7(_0x549fd0);if(_0x455de8['type']===_0x315fe1(0x111)&&_0x455de8['journeyActivationStepId']&&(isPendingActivationId(_0x455de8[_0x315fe1(0x17a)])||_0x455de8[_0x315fe1(0x17a)]==='')){if(_0x399643?.['journeyActivationStepId']&&isPendingActivationId(_0x399643[_0x315fe1(0x17a)])){const _0x239395=extractPendingActivationName(_0x399643[_0x315fe1(0x17a)]),_0x4e1c17=_0x11cad2['get'](_0x239395);_0x4e1c17&&(_0x455de8[_0x315fe1(0x17a)]=_0x4e1c17);}}if(_0x455de8['type']===_0x315fe1(0x135)&&_0x455de8[_0x315fe1(0x183)]&&_0x399643?.[_0x315fe1(0x183)])for(let _0x414f96=0x0;_0x414f96<_0x455de8['branches'][_0x315fe1(0x127)];_0x414f96++){const _0x1e8349=_0x455de8[_0x315fe1(0x183)][_0x414f96],_0x1f0f90=_0x399643[_0x315fe1(0x183)][_0x414f96];if(_0x1f0f90?.['segmentId']&&isPendingSegmentId(_0x1f0f90[_0x315fe1(0x196)])){const _0x4f629c=_0x2b7b59(_0x1f0f90[_0x315fe1(0x196)],'stage\x20\x27'+_0x1a0b86[_0x315fe1(0x143)]+_0x315fe1(0x13a)+(_0x1e8349[_0x315fe1(0x143)]||_0x414f96)+'\x27');_0x4f629c&&(_0x1e8349[_0x315fe1(0x196)]=_0x4f629c);}}if(_0x455de8['type']===_0x315fe1(0x113)&&_0x455de8[_0x315fe1(0x10e)]?.['segmentId']&&_0x399643?.[_0x315fe1(0x10e)]?.['segmentId']&&isPendingSegmentId(_0x399643[_0x315fe1(0x10e)][_0x315fe1(0x196)])){const _0x46b625=_0x2b7b59(_0x399643[_0x315fe1(0x10e)][_0x315fe1(0x196)],_0x315fe1(0x1ac)+_0x1a0b86[_0x315fe1(0x143)]+_0x315fe1(0x1bb));_0x46b625&&(_0x455de8[_0x315fe1(0x10e)][_0x315fe1(0x196)]=_0x46b625);}}}}}
1
+ const a101_0x47621a=a101_0x10f7;(function(_0x307b15,_0x4fd061){const _0x18f3dc=a101_0x10f7,_0x56084c=_0x307b15();while(!![]){try{const _0x49862e=-parseInt(_0x18f3dc(0x24a))/0x1+-parseInt(_0x18f3dc(0x1f0))/0x2+parseInt(_0x18f3dc(0x1c6))/0x3*(-parseInt(_0x18f3dc(0x239))/0x4)+-parseInt(_0x18f3dc(0x291))/0x5+-parseInt(_0x18f3dc(0x1d7))/0x6+parseInt(_0x18f3dc(0x22a))/0x7*(parseInt(_0x18f3dc(0x218))/0x8)+parseInt(_0x18f3dc(0x212))/0x9;if(_0x49862e===_0x4fd061)break;else _0x56084c['push'](_0x56084c['shift']());}catch(_0x9ecd8a){_0x56084c['push'](_0x56084c['shift']());}}}(a101_0x2c95,0x6fd2a));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a101_0x47621a(0x276);export const PENDING_ACTIVATION_PREFIX=a101_0x47621a(0x23d);export function createPendingSegmentId(_0x4dd703){return''+PENDING_SEGMENT_PREFIX+_0x4dd703+'__';}export function isPendingSegmentId(_0x524192){const _0x9a705b=a101_0x47621a;return _0x524192[_0x9a705b(0x283)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x34c174){return _0x34c174['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x46d003){return''+PENDING_ACTIVATION_PREFIX+_0x46d003+'__';}export function isPendingActivationId(_0x75a8d1){const _0x4732be=a101_0x47621a;return _0x75a8d1[_0x4732be(0x283)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x30787c){const _0x24b3d5=a101_0x47621a;return _0x30787c[_0x24b3d5(0x1f3)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x482382,_0x211a8c){const _0x31fe3d=a101_0x47621a,_0x369002=_0x482382+'::'+(_0x211a8c['trim']()||_0x31fe3d(0x236)),_0x2e35cf=createHash(_0x31fe3d(0x1c5))[_0x31fe3d(0x1fb)](_0x369002)[_0x31fe3d(0x1db)](_0x31fe3d(0x22b))[_0x31fe3d(0x27a)](0x0,0xc);return _0x31fe3d(0x222)+_0x2e35cf;}export function ensureJourneyDefaults(_0x3b05df){const _0x12b080=a101_0x47621a;!_0x3b05df[_0x12b080(0x233)]&&(_0x3b05df[_0x12b080(0x233)]=''),!_0x3b05df[_0x12b080(0x1d0)]&&(_0x3b05df[_0x12b080(0x1d0)]='draft');}export function resolveTDFolderPath(_0x1efbfa,_0x45f14f,_0xbb7d){if(!_0x45f14f)return _0x1efbfa;if(_0x1efbfa===_0xbb7d||_0x1efbfa['startsWith'](_0xbb7d+'/'))return _0x1efbfa;return _0x1efbfa?_0xbb7d+'/'+_0x1efbfa:_0xbb7d;}export function addFoldersToCreate(_0x56a208,_0x59844d,_0x3f1d9c){const _0x30dc10=a101_0x47621a;if(!_0x56a208)return;if(_0x59844d['has'](_0x56a208))return;const _0x2d37cf=_0x56a208[_0x30dc10(0x22c)]('/');let _0x3e7a3e='';for(const _0x2d2e70 of _0x2d37cf){_0x3e7a3e=_0x3e7a3e?_0x3e7a3e+'/'+_0x2d2e70:_0x2d2e70,!_0x59844d[_0x30dc10(0x259)](_0x3e7a3e)&&_0x3f1d9c['add'](_0x3e7a3e);}}import*as a101_0x1a5e52 from'yaml';import{readFileSync}from'fs';import a101_0x53dcee from'path';import{isJourneyDef,parseYamlString as a101_0x1e68d0,toYamlString as a101_0x1fd0fa,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';function a101_0x10f7(_0x1e9acb,_0x4cf374){_0x1e9acb=_0x1e9acb-0x1c1;const _0x2c9535=a101_0x2c95();let _0x10f717=_0x2c9535[_0x1e9acb];return _0x10f717;}import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';function a101_0x2c95(){const _0x275f46=['fetchJourney','existingSegment','kind','existingSegments','listActivations','all','entry_criteria','embedded_activation_creating','Activation','branches','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','name','activation_creating','goal','has','list','folderPath','activationContext','columns','Created\x20segment\x20\x27','null','./journey-yaml.js','folderPathToId','resolveSegment','set','behavior','journey_creating','deleteSegment','Creating\x20segment\x20\x27','entry','Updating\x20activation\x20\x27','activation_created','embedded_activation_created','journey_updating','attributes','keys','segmentByFolderAndName','Activation\x20not\x20found:\x20','journeyActivationNameToId','toString','Creating\x20folder\x20\x27','versionNumber','idToEmailMap','__pending_','onProgress','withProgress','steps','slice','segments','Failed\x20to\x20','existingJourney','type','sort','embedded_segment_created','journeyBundleName','data','startsWith','with','yamlActivation','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27',').\x20','message','\x20activation\x20\x27','journeyBundlesByFolderAndName','rootFolderId','valid','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Name\x20has\x20already\x20been\x20taken','push','./child-segment-yaml.js','1216015EnAhRl','max','find','relationships','journey','diff','SEGMENT_NOT_FOUND','DecisionPoint','activations','\x20(referenced\x20in\x20journey\x20','\x27\x20from\x20file:\x20','\x0a\x20\x20','hasChanges','Entry\x20criteria:\x20','waitCondition','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','JOURNEY_SYNTAX_ERROR','ACTIVATION_UPDATE_ERROR','logSuccess','\x27\x20milestone','notification','action','resolveJourneyId','activation_deleting','getSegment','createFolder','get','sha1','9NTsjim','journeyById','createdSegmentId','\x27...','Stage\x20\x27','activationActions','rule','localSegmentRules','yamlConfig','deleteActivation','state','connectionIdToNameMap','join','journeyStages','activation_updated','milestone','decision_point','528216bkjSXx','isNew','INTERNAL','journeyActivationStepId','digest','existingActivation','deps','exitCriterias','folder_creating','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','\x20error(s)','verbose','getJourney','Updated\x20journey\x20\x27','updateSegmentById','segment_created','idToName','map','createdSegmentIds','createSegment','journey_created','SEGMENT_UPDATE_ERROR','Updating\x20segment\x20\x27','reduce','filter','629788UDkWRQ','JOURNEY_UPDATE_ERROR','create','replace','parseDocument','created','logInfo','WaitStep','errors','Created\x20activation\x20\x27','NOT_FOUND','update','activation_template_id','Journey\x20\x27','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','length','Created\x20journey\x20\x27','from','segmentId','activation_updating','journeyId','isArray','nameToType','connection','stage\x20\x27','segment_creating','Fetching\x20','entryCriteria','segment_deleting','SEGMENT_SYNTAX_ERROR','Segment\x20not\x20found:\x20','folder_created','activation_','../../utils/async.js','11178234bMtTCE','values','createJourneySegment','logDeleted','segmentFolderId','object','2640248cgxaTZ','size','utf-8','\x20segment\x20from\x20file:\x20','parse','buildUserMaps','listSegments','parentId','createActivation','Creating\x20activation\x20\x27','journey_entry_criteria_','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','folderId','schedule','journey_updated','progress','updated','updateActivation','14IKeixR','hex','split','embedded_segment_creating','\x27\x20for\x20','parentSegmentFolder','validatedRequest','journeys','deleted','description','stringify','segment_updating','segment','toLowerCase','index','146884wxShPf','activation_deleted','effectiveFolderId','embeddedSegmentNameToId','__pending_act_','add','delete','Deleted\x20segment\x20\x27','Updated\x20segment\x20\x27','goal\x20criteria','relative','segmentNameToId','item','logWarning','unchanged','absolutePath','\x20journey\x20from\x20file:\x20','687766iHVHVf'];a101_0x2c95=function(){return _0x275f46;};return a101_0x2c95();}import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x35b126){const _0x2e66a6=a101_0x47621a;if(Array[_0x2e66a6(0x205)](_0x35b126))return'['+_0x35b126[_0x2e66a6(0x1e8)](_0x3e700b=>stableStringify(_0x3e700b))['join'](',')+']';if(_0x35b126&&typeof _0x35b126===_0x2e66a6(0x217)){const _0x272919=_0x35b126,_0x4a518f=Object['keys'](_0x272919)[_0x2e66a6(0x27f)](),_0x3c109d=_0x4a518f['map'](_0x5dbc9a=>'\x22'+_0x5dbc9a+'\x22:'+stableStringify(_0x272919[_0x5dbc9a]));return'{'+_0x3c109d[_0x2e66a6(0x1d2)](',')+'}';}const _0xa8bbcc=JSON['stringify'](_0x35b126);return _0xa8bbcc===undefined?_0x2e66a6(0x25f):_0xa8bbcc;}function activationSignature(_0x20c467){const _0x4d5279=a101_0x47621a,_0x59e2db={'connection':_0x20c467[_0x4d5279(0x207)],..._0x20c467['all_columns']!==undefined&&{'all_columns':_0x20c467['all_columns']},..._0x20c467[_0x4d5279(0x25d)]!==undefined&&{'columns':_0x20c467[_0x4d5279(0x25d)]},..._0x20c467[_0x4d5279(0x264)]!==undefined&&{'behavior':_0x20c467[_0x4d5279(0x264)]},..._0x20c467[_0x4d5279(0x225)]!==undefined&&{'schedule':_0x20c467[_0x4d5279(0x225)]},..._0x20c467[_0x4d5279(0x2a5)]!==undefined&&{'notification':_0x20c467[_0x4d5279(0x2a5)]},..._0x20c467['connector_config']!==undefined&&{'connector_config':_0x20c467['connector_config']},..._0x20c467[_0x4d5279(0x1fc)]!==undefined&&{'activation_template_id':_0x20c467[_0x4d5279(0x1fc)]}};return stableStringify(_0x59e2db);}export async function prepareSegmentFiles(_0x403aa6,_0x54d903,_0x42f7c1,_0x33624e,_0x11c0d9){const _0x9e4475=a101_0x47621a,{activationDefToCreateRequest:_0x5023c6}=await import(_0x9e4475(0x290)),_0x3ce2aa=[],_0x422aa1=new Set();for(const {yamlConfig:_0x29abd9,folderPath:_0x435b45,sourcePath:_0x2b14f3}of _0x403aa6){const _0x47e187=resolveTDFolderPath(_0x435b45,_0x33624e,_0x11c0d9),_0x2f6bd2=_0x47e187+':'+_0x29abd9['name'],_0x3096d8=_0x54d903[_0x9e4475(0x26f)][_0x9e4475(0x1c4)](_0x2f6bd2),_0x13963e=_0x3096d8?_0x54d903['activationsBySegmentId'][_0x9e4475(0x1c4)](_0x3096d8['id'])||[]:[];addFoldersToCreate(_0x47e187,_0x54d903[_0x9e4475(0x261)],_0x422aa1);const _0x15d0ba=calculateActivationActions(_0x29abd9[_0x9e4475(0x299)]||[],_0x13963e,_0x54d903[_0x9e4475(0x275)],_0x54d903[_0x9e4475(0x1d1)]);for(const _0x5bf50b of _0x15d0ba){(_0x5bf50b['type']===_0x9e4475(0x1f2)||_0x5bf50b['type']===_0x9e4475(0x1fb))&&_0x5bf50b['yamlActivation']&&(_0x5bf50b[_0x9e4475(0x230)]=await _0x5023c6(_0x5bf50b[_0x9e4475(0x285)],_0x42f7c1));}const _0x2687fa=calculateSegmentDiff(_0x29abd9,_0x3096d8,_0x13963e,_0x54d903[_0x9e4475(0x275)],_0x54d903['connectionIdToNameMap']);_0x3ce2aa[_0x9e4475(0x28f)]({'relativePath':_0x29abd9[_0x9e4475(0x256)],'absolutePath':_0x2b14f3,'yamlConfig':_0x29abd9,'folderPath':_0x47e187,'existingSegment':_0x3096d8,'existingActivations':_0x13963e,'isNew':_0x2687fa[_0x9e4475(0x1d8)],'hasChanges':_0x2687fa['hasChanges'],'diff':_0x2687fa['diff'],'activationActions':_0x15d0ba});}return{'segmentFiles':_0x3ce2aa,'foldersToCreate':_0x422aa1};}export async function prepareJourneyFiles(_0x546870,_0x323931,_0x3cea0c,_0x4205da){const _0x4ed670=a101_0x47621a,_0x38151e=[],_0xc88495=new Set();for(const {yamlConfig:_0x476d13,folderPath:_0x2e9d14,sourcePath:_0x1324a1}of _0x546870){const _0x5eb5ea=resolveTDFolderPath(_0x2e9d14,_0x3cea0c,_0x4205da),_0x3d5a57=_0x5eb5ea+':'+_0x476d13[_0x4ed670(0x256)],_0x277374=_0x323931[_0x4ed670(0x28a)]['get'](_0x3d5a57);let _0x23652e,_0x56f5ff;if(_0x277374&&_0x277374[_0x4ed670(0x1ff)]>0x0){const _0x3b75e2=buildLocalExpandedRuleMappings(_0x476d13),{createYamlContext:_0x233fa8,prefetchJourneySegments:_0x2fcdd6}=createPushYamlContextForBundle(_0x323931[_0x4ed670(0x1dd)],_0x323931[_0x4ed670(0x21f)],_0x323931[_0x4ed670(0x24e)],_0x3b75e2,_0x323931[_0x4ed670(0x275)],_0x323931[_0x4ed670(0x1d1)],_0x323931['activationStepsById'],_0x323931['journeyById']);await _0x2fcdd6(_0x277374[_0x4ed670(0x1e8)](_0x424a52=>_0x424a52['id']));const _0x468977=hasMultipleVersions(_0x476d13),_0xe12809=async _0x4bfbf9=>{const _0x4c6336=_0x4ed670,_0x4e09b6=_0x323931[_0x4c6336(0x1c7)]?.[_0x4c6336(0x1c4)](_0x4bfbf9);if(_0x4e09b6)return _0x4e09b6;return _0x323931[_0x4c6336(0x24b)]({'journeyId':_0x4bfbf9,'journeyName':_0x476d13['name'],'isMultiVersion':_0x277374[_0x4c6336(0x1ff)]>0x1});};if(_0x468977&&_0x277374[_0x4ed670(0x1ff)]>0x1){const _0xf1de19=[];for(const _0x3f4d1d of _0x277374){const _0x5392ee=_0x3f4d1d['versionNumber']||0x1;_0x323931[_0x4ed670(0x227)]?.[_0x4ed670(0x1fb)]('Fetching\x20'+_0x476d13[_0x4ed670(0x256)]+'\x20v'+_0x5392ee);const _0x3a94ae=await _0xe12809(_0x3f4d1d['id']),_0x21807c=_0x233fa8(_0x3f4d1d['id']),_0x2bf343=await journeyResponseToDef(_0x3a94ae,_0x21807c);_0xf1de19['push']({'item':_0x3f4d1d,'yaml':_0x2bf343});}const _0x3598cf=buildLocalRuleToNameMappingFromJourney(_0x476d13);_0x56f5ff=buildMergedJourneyDef(_0xf1de19,_0x3598cf);const _0x222f9c=Math['max'](..._0xf1de19['map'](_0x3f5b5e=>_0x3f5b5e[_0x4ed670(0x245)][_0x4ed670(0x274)]||0x0)),_0x42caec=_0x277374[_0x4ed670(0x293)](_0xe31ff8=>(_0xe31ff8[_0x4ed670(0x274)]||0x0)===_0x222f9c);_0x42caec&&(_0x323931[_0x4ed670(0x227)]?.['update']('Fetching\x20'+_0x476d13[_0x4ed670(0x256)]+'\x20v'+_0x222f9c),_0x23652e=await _0xe12809(_0x42caec['id']));}else{const _0x3438b1=_0x277374[_0x277374['length']-0x1];_0x323931[_0x4ed670(0x227)]?.['update'](_0x4ed670(0x20a)+_0x476d13[_0x4ed670(0x256)]),_0x23652e=await _0xe12809(_0x3438b1['id']);const _0x34f92f=_0x233fa8(_0x3438b1['id']),_0x5e99d1=await journeyResponseToDef(_0x23652e,_0x34f92f),_0x23dfa0=buildLocalRuleToNameMappingFromJourney(_0x476d13);_0x56f5ff=buildMergedJourneyDef([{'item':_0x3438b1,'yaml':_0x5e99d1}],_0x23dfa0);}}addFoldersToCreate(_0x5eb5ea,_0x323931[_0x4ed670(0x261)],_0xc88495);const _0x316df8=calculateJourneyDiff(_0x476d13,_0x56f5ff);_0x38151e[_0x4ed670(0x28f)]({'relativePath':_0x476d13[_0x4ed670(0x256)],'absolutePath':_0x1324a1,'yamlConfig':_0x476d13,'folderPath':_0x5eb5ea,'existingJourney':_0x23652e,'isNew':_0x316df8['isNew'],'hasChanges':_0x316df8[_0x4ed670(0x29d)],'diff':_0x316df8[_0x4ed670(0x296)]});}return{'journeyFiles':_0x38151e,'foldersToCreate':_0xc88495};}export function calculateActivationActions(_0x11e3da,_0x28fb9b,_0x2d8452,_0x585cbf){const _0x1e3867=a101_0x47621a,_0x286e69=[],_0x284930=new Map();for(const _0x371a6d of _0x28fb9b){_0x284930[_0x1e3867(0x263)](_0x371a6d['name'],_0x371a6d);}const _0x23db45=new Map();for(const _0x2ad4cf of _0x11e3da){_0x23db45[_0x1e3867(0x263)](_0x2ad4cf[_0x1e3867(0x256)],_0x2ad4cf);}for(const _0x514990 of _0x11e3da){const _0x472c80=_0x284930['get'](_0x514990[_0x1e3867(0x256)]);if(!_0x472c80)_0x286e69[_0x1e3867(0x28f)]({'type':_0x1e3867(0x1f2),'name':_0x514990[_0x1e3867(0x256)],'yamlActivation':_0x514990});else{const _0x36e397=activationResponseToDef(_0x472c80,_0x2d8452,_0x585cbf),_0x14b21d=a101_0x1a5e52[_0x1e3867(0x234)](_0x36e397),_0x9ff307=a101_0x1a5e52[_0x1e3867(0x234)](_0x514990);_0x14b21d!==_0x9ff307&&_0x286e69[_0x1e3867(0x28f)]({'type':'update','name':_0x514990[_0x1e3867(0x256)],'yamlActivation':_0x514990,'existingActivation':_0x472c80});}}for(const _0x5d2d12 of _0x28fb9b){!_0x23db45[_0x1e3867(0x259)](_0x5d2d12[_0x1e3867(0x256)])&&_0x286e69['push']({'type':'delete','name':_0x5d2d12[_0x1e3867(0x256)],'existingActivation':_0x5d2d12});}return _0x286e69;}export function calculateSegmentDiff(_0x307f3e,_0x5556af,_0x4d2a9a,_0x45a720,_0x1da025){const _0x548c4a=segmentToYamlString(_0x307f3e);if(_0x5556af){const _0x1ac725=segmentWithActivationsToYaml(_0x5556af,_0x4d2a9a,undefined,_0x45a720,_0x1da025),_0x4abd49=segmentToYamlString(_0x1ac725),_0x4edfb7=generateDiff(_0x4abd49,_0x548c4a),_0x58ab2e=hasChanges(_0x4edfb7);return{'isNew':![],'hasChanges':_0x58ab2e,'diff':_0x58ab2e?formatDiffWithColors(_0x4edfb7):undefined};}const _0x198cf6=generateDiff('',_0x548c4a);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x198cf6)};}export function calculateJourneyDiff(_0x37e0cf,_0x437ebb){const _0x22c34b=normalizeJourneyDef(_0x37e0cf,_0x37e0cf),_0xdd9608=a101_0x1fd0fa(_0x22c34b);if(_0x437ebb){const _0x2e7a5f=normalizeJourneyDef(_0x437ebb,_0x37e0cf),_0xdd46f5=a101_0x1fd0fa(_0x2e7a5f),_0x3e2b9b=generateDiff(_0xdd46f5,_0xdd9608),_0x237327=hasChanges(_0x3e2b9b);return{'isNew':![],'hasChanges':_0x237327,'diff':_0x237327?formatDiffWithColors(_0x3e2b9b):undefined};}const _0x59e7de=generateDiff('',_0xdd9608);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x59e7de)};}export function findSegmentsToDelete(_0x36d34d,_0x8cd833,_0x1d7e81,_0x284611,_0x4a2c5f){const _0x5beeda=a101_0x47621a,_0x59b796=new Set();for(const {yamlConfig:_0x16d3fd,folderPath:_0x2818b7}of _0x8cd833){_0x59b796[_0x5beeda(0x23e)](_0x2818b7+':'+_0x16d3fd[_0x5beeda(0x256)]);}return _0x36d34d['filter'](_0x41c0af=>{const _0x48a279=_0x5beeda,_0x304ee7=_0x41c0af[_0x48a279(0x216)]?_0x1d7e81['get'](_0x41c0af[_0x48a279(0x216)][_0x48a279(0x272)]())||'':'',_0x19f43f=_0x304ee7+':'+_0x41c0af['name'];if(_0x59b796[_0x48a279(0x259)](_0x19f43f))return![];if(_0x4a2c5f)return _0x304ee7===_0x284611||_0x304ee7['startsWith'](_0x284611+'/');return!![];});}export function findJourneysToDelete(_0x2d18f6,_0x541d4b,_0x3ac2a2,_0x26603d,_0x31834e){const _0x3caecd=a101_0x47621a,_0x575d49=new Set();for(const {yamlConfig:_0x49c85b,folderPath:_0x129507}of _0x541d4b){_0x575d49[_0x3caecd(0x23e)](_0x129507+':'+_0x49c85b[_0x3caecd(0x256)]);}return _0x2d18f6[_0x3caecd(0x1ef)](_0x26ecde=>{const _0x120496=_0x3caecd,_0x2aee5d=_0x26ecde['folderId']?_0x3ac2a2[_0x120496(0x1c4)](_0x26ecde[_0x120496(0x224)])||'':'',_0x217cdd=_0x2aee5d+':'+_0x26ecde[_0x120496(0x281)];if(_0x575d49['has'](_0x217cdd))return![];if(_0x31834e)return _0x2aee5d===_0x26603d||_0x2aee5d[_0x120496(0x283)](_0x26603d+'/');return!![];});}export function buildSegmentLookupMap(_0x1c8c0c,_0x5a0599){const _0x5abce4=a101_0x47621a,_0x4b8534=new Map();for(const _0x4ce91e of _0x1c8c0c){const _0x5c4764=_0x4ce91e[_0x5abce4(0x216)]?_0x5a0599[_0x5abce4(0x1c4)](_0x4ce91e['segmentFolderId']['toString']())||'':'',_0x4c45a3=_0x5c4764+':'+_0x4ce91e[_0x5abce4(0x256)];_0x4b8534[_0x5abce4(0x263)](_0x4c45a3,_0x4ce91e);}return _0x4b8534;}export function buildSegmentNameToIdMap(_0x156e7d){const _0x562e9a=a101_0x47621a,_0x59bcbb=new Map();for(const _0x35d785 of _0x156e7d){_0x59bcbb[_0x562e9a(0x263)](_0x35d785[_0x562e9a(0x256)],_0x35d785['id']);}return _0x59bcbb;}export function buildJourneyBundleLookupMap(_0x4536d3,_0x1047f8){const _0x25c869=a101_0x47621a,_0x5124cc=new Map();for(const _0x4e202f of _0x4536d3){const _0x16d756=_0x4e202f['folderId']?_0x1047f8[_0x25c869(0x1c4)](_0x4e202f[_0x25c869(0x224)])||'':'',_0x5b80dd=_0x16d756+':'+_0x4e202f[_0x25c869(0x281)];!_0x5124cc[_0x25c869(0x259)](_0x5b80dd)&&_0x5124cc[_0x25c869(0x263)](_0x5b80dd,[]),_0x5124cc[_0x25c869(0x1c4)](_0x5b80dd)[_0x25c869(0x28f)](_0x4e202f);}for(const _0x518116 of _0x5124cc[_0x25c869(0x213)]()){_0x518116['sort']((_0x298d47,_0x3c034c)=>(_0x298d47[_0x25c869(0x274)]||0x0)-(_0x3c034c[_0x25c869(0x274)]||0x0));}return _0x5124cc;}export function collectFoldersToCreate(_0x5d2d09,_0x561199){const _0xc7b405=a101_0x47621a,_0x550e50=new Set();for(const _0x97a9ee of _0x5d2d09){if(!_0x97a9ee)continue;if(_0x561199[_0xc7b405(0x259)](_0x97a9ee))continue;const _0x566871=_0x97a9ee[_0xc7b405(0x22c)]('/');let _0x281e66='';for(const _0xdbe21d of _0x566871){_0x281e66=_0x281e66?_0x281e66+'/'+_0xdbe21d:_0xdbe21d,!_0x561199[_0xc7b405(0x259)](_0x281e66)&&_0x550e50[_0xc7b405(0x23e)](_0x281e66);}}return _0x550e50;}export function parseAndClassifyYamlFiles(_0x495fc0,_0x498d4e,_0xb42931){const _0x286c72=a101_0x47621a,_0x4c2f43=[],_0x3c5d7f=[];for(const _0x11c1cf of _0x495fc0){const _0x19156d=a101_0x53dcee['relative'](_0x498d4e,a101_0x53dcee['dirname'](_0x11c1cf)),_0x438b74=_0x19156d==='.'?'':_0x19156d,_0x347220=readFileSync(_0x11c1cf,_0x286c72(0x21a)),_0x4797fe=a101_0x1a5e52[_0x286c72(0x21c)](_0x347220);if(isJourneyDef(_0x4797fe)){const _0x4dc1ba=a101_0x1e68d0(_0x347220);_0x3c5d7f[_0x286c72(0x28f)]({'yamlConfig':_0x4dc1ba,'folderPath':_0x438b74,'sourcePath':_0x11c1cf});}else{if(!_0xb42931?.['skipSegments']){const _0xc12d79=parseSegmentYamlFile(_0x347220),_0x238e02=normalizeChildSegmentYaml(_0xc12d79);_0x4c2f43[_0x286c72(0x28f)]({'yamlConfig':_0x238e02,'folderPath':_0x438b74,'sourcePath':_0x11c1cf});}}}return{'segments':_0x4c2f43,'journeys':_0x3c5d7f};}export function validateParsedFiles(_0x20cc17,_0x5bab0e){const _0x1c2320=a101_0x47621a,_0x3cca2c=[];for(const {yamlConfig:_0x15ec73,sourcePath:_0x4ff3cb}of _0x20cc17[_0x1c2320(0x27b)]){const _0x41cfec=readFileSync(_0x4ff3cb,_0x1c2320(0x21a)),_0x53c7ef=a101_0x1a5e52[_0x1c2320(0x1f4)](_0x41cfec),_0x1ab7d4=validateSegmentDef(_0x15ec73,{'source':_0x41cfec,'document':_0x53c7ef});if(!_0x1ab7d4[_0x1c2320(0x28c)]){const _0x2826b0=a101_0x53dcee[_0x1c2320(0x243)](_0x5bab0e,_0x4ff3cb);_0x3cca2c['push']({'filePath':_0x2826b0,'source':_0x41cfec,'result':_0x1ab7d4,'isJourney':![]});}}for(const {yamlConfig:_0x6e80a3,sourcePath:_0x4330fc}of _0x20cc17[_0x1c2320(0x231)]){const _0x378509=readFileSync(_0x4330fc,_0x1c2320(0x21a)),_0x3881eb=a101_0x1a5e52[_0x1c2320(0x1f4)](_0x378509),_0x595a6b=validateJourneyDef(_0x6e80a3,{'source':_0x378509,'document':_0x3881eb});if(!_0x595a6b[_0x1c2320(0x28c)]){const _0x24ff90=a101_0x53dcee[_0x1c2320(0x243)](_0x5bab0e,_0x4330fc);_0x3cca2c[_0x1c2320(0x28f)]({'filePath':_0x24ff90,'source':_0x378509,'result':_0x595a6b,'isJourney':!![]});}}return _0x3cca2c;}export function formatValidationErrors(_0x3e3afb){const _0x550e67=a101_0x47621a,_0x187c12=[];for(const {filePath:_0x2d608e,source:_0x37091b,result:_0x37dc46,isJourney:_0x5d4765}of _0x3e3afb){const _0x520d74=_0x5d4765?_0x550e67(0x295):_0x550e67(0x236);_0x187c12[_0x550e67(0x28f)]('\x0a'+_0x2d608e+'\x20('+_0x520d74+'):\x20'+_0x37dc46[_0x550e67(0x1f8)][_0x550e67(0x1ff)]+_0x550e67(0x1e1)),_0x187c12[_0x550e67(0x28f)](formatValidationResult(_0x37dc46,_0x37091b,_0x2d608e));}return _0x187c12[_0x550e67(0x1d2)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x5a6244){const _0x469fef=a101_0x47621a,_0x2b285f=new Set(),_0x5cb2e5=new Map(),_0x2753bc=collectSegmentUsageCounts(_0x5a6244);if(_0x5a6244[_0x469fef(0x27b)])for(const [_0x242385,_0xa0aac]of Object['entries'](_0x5a6244['segments'])){_0x2b285f['add'](_0x242385);if(_0xa0aac['rule']){const _0x3f703f=yamlRuleToApi(_0xa0aac[_0x469fef(0x1cc)]),_0x2060b3=apiRuleToYaml(_0x3f703f);_0x5cb2e5['set'](_0x242385,_0x2060b3);}}const _0x19df2b=new Map();let _0x49d878=0x0;for(const [_0x3a799f,_0x23b6f6]of _0x5cb2e5){const _0xfe3b42=serializeExpandedRule(_0x23b6f6,_0x5cb2e5),_0x219108=_0x19df2b['get'](_0xfe3b42)||[];_0x219108[_0x469fef(0x28f)]({'name':_0x3a799f,'index':_0x49d878}),_0x19df2b[_0x469fef(0x263)](_0xfe3b42,_0x219108),_0x49d878++;}const _0xc49a9a=new Map();for(const [_0x525bd5,_0x4ae815]of _0x19df2b){const _0x254776=_0x4ae815['slice']()[_0x469fef(0x27f)]((_0x4863d3,_0x3050c8)=>{const _0x4de006=_0x469fef,_0x1752e0=_0x2753bc[_0x4de006(0x1c4)](_0x4863d3[_0x4de006(0x256)])||0x0,_0x409e6c=_0x2753bc['get'](_0x3050c8[_0x4de006(0x256)])||0x0;if(_0x1752e0!==_0x409e6c)return _0x409e6c-_0x1752e0;return _0x4863d3[_0x4de006(0x238)]-_0x3050c8[_0x4de006(0x238)];})['map'](_0x471093=>_0x471093[_0x469fef(0x256)]),_0x35d912=[];for(const _0x42b172 of _0x254776){const _0x349195=_0x2753bc[_0x469fef(0x1c4)](_0x42b172)||0x0,_0x35d321=Math[_0x469fef(0x292)](_0x349195,0x1);for(let _0x1e2af2=0x0;_0x1e2af2<_0x35d321;_0x1e2af2++){_0x35d912[_0x469fef(0x28f)](_0x42b172);}}_0xc49a9a[_0x469fef(0x263)](_0x525bd5,_0x35d912);}return{'existingLocalSegmentNames':_0x2b285f,'localSegmentRules':_0x5cb2e5,'localExpandedRuleToNames':_0xc49a9a};}async function buildServerSegmentRuleMap(_0x5bb563,_0x50c19f,_0x165846,_0x54afeb){const _0x24c41c=new Map(),_0x2044ad=new Set(),_0x2e131c=async _0x3ad62b=>{const _0x11414b=a101_0x10f7;if(_0x2044ad[_0x11414b(0x259)](_0x3ad62b))return;_0x2044ad[_0x11414b(0x23e)](_0x3ad62b);let _0x91a390=_0x165846[_0x11414b(0x293)](_0x3163b0=>_0x3163b0['id']===_0x3ad62b);if(!_0x91a390)try{_0x91a390=await _0x5bb563[_0x11414b(0x236)]['getSegment'](_0x50c19f,_0x3ad62b);}catch{return;}if(!_0x91a390?.[_0x11414b(0x1cc)])return;const _0x24a14e=apiRuleToYaml(_0x91a390[_0x11414b(0x1cc)]);_0x24c41c['set'](_0x3ad62b,_0x24a14e);const _0x540c97=collectSegmentRefsFromRule(_0x24a14e);for(const _0x4dc242 of _0x540c97){await _0x2e131c(_0x4dc242);}};for(const _0x3553cf of _0x54afeb){await _0x2e131c(_0x3553cf);}return _0x24c41c;}export function createSegmentIdResolver(_0x3e273c,_0x1c3380){return async _0x159cf8=>{const _0x239baa=a101_0x10f7,_0x44084b=_0x3e273c[_0x239baa(0x1c4)](_0x159cf8);if(!_0x44084b)throw new SDKError(ErrorCode[_0x239baa(0x297)],'Segment\x20not\x20found:\x20'+_0x159cf8+_0x239baa(0x28d)+_0x1c3380+'\x27)');return _0x44084b;};}export function extractRootFolderId(_0x49b460){const _0x54281c=a101_0x47621a;return _0x49b460['relationships']?.[_0x54281c(0x22f)]?.[_0x54281c(0x282)]?.['id']||_0x49b460[_0x54281c(0x294)]?.['parentFolder']?.['data']?.['id'];}export function buildConnectionMaps(_0x43638e){const _0x401da4=a101_0x47621a,_0xe34f7b=new Map(),_0x565060=new Map(),_0x4027af=new Map();for(const _0x5b3b32 of _0x43638e){_0xe34f7b[_0x401da4(0x263)](_0x5b3b32[_0x401da4(0x256)],parseInt(_0x5b3b32['id'],0xa)),_0x565060[_0x401da4(0x263)](_0x5b3b32['id'],_0x5b3b32[_0x401da4(0x256)]),_0x4027af[_0x401da4(0x263)](_0x5b3b32[_0x401da4(0x256)],_0x5b3b32[_0x401da4(0x27e)]);}return{'nameToId':_0xe34f7b,'idToName':_0x565060,'nameToType':_0x4027af};}export function calculatePushStats(_0x5e4787,_0x553a50,_0x5a5410,_0x4fcd37,_0x301bdf,_0x34ea0b,_0x145288){const _0x5ff32d=a101_0x47621a,_0x141315=_0x5e4787['filter'](_0x453f8a=>_0x453f8a[_0x5ff32d(0x1d8)]),_0x4ec159=_0x5e4787['filter'](_0x308e70=>!_0x308e70[_0x5ff32d(0x1d8)]&&_0x308e70['hasChanges']),_0x3f7914=_0x5e4787[_0x5ff32d(0x1ef)](_0x1fc48b=>!_0x1fc48b[_0x5ff32d(0x1d8)]&&!_0x1fc48b['hasChanges']),_0x87d00d=_0x34ea0b?_0x4fcd37:[],_0x5c733c=_0x553a50[_0x5ff32d(0x1ef)](_0x419b77=>_0x419b77[_0x5ff32d(0x1d8)]),_0x36ea35=_0x553a50[_0x5ff32d(0x1ef)](_0x4a2f34=>!_0x4a2f34['isNew']&&_0x4a2f34['hasChanges']),_0x84d803=_0x553a50[_0x5ff32d(0x1ef)](_0x543c1e=>!_0x543c1e['isNew']&&!_0x543c1e[_0x5ff32d(0x29d)]),_0x44f009=_0x34ea0b?_0x301bdf:[],_0x369cf2=_0x5e4787['flatMap'](_0x4fb200=>_0x4fb200[_0x5ff32d(0x1cb)]),_0x1d01e4=_0x369cf2[_0x5ff32d(0x1ef)](_0x1b60f9=>_0x1b60f9[_0x5ff32d(0x27e)]===_0x5ff32d(0x1f2)),_0x5495ba=_0x369cf2[_0x5ff32d(0x1ef)](_0x171ea8=>_0x171ea8[_0x5ff32d(0x27e)]===_0x5ff32d(0x1fb)),_0x40d55a=_0x369cf2[_0x5ff32d(0x1ef)](_0x200bae=>_0x200bae[_0x5ff32d(0x27e)]===_0x5ff32d(0x23f)),_0x2bb557=Array[_0x5ff32d(0x201)](_0x5a5410)['sort'](),_0xa72f06=_0x145288?![]:_0x141315['length']>0x0||_0x4ec159[_0x5ff32d(0x1ff)]>0x0||_0x87d00d[_0x5ff32d(0x1ff)]>0x0,_0x51404e=_0x5c733c['length']>0x0||_0x36ea35[_0x5ff32d(0x1ff)]>0x0||_0x44f009['length']>0x0,_0x1bdfa3=_0x145288?![]:_0x369cf2[_0x5ff32d(0x1ff)]>0x0,_0x4519ed=_0x2bb557[_0x5ff32d(0x1ff)]>0x0;return{'segments':{'new':_0x141315,'changed':_0x4ec159,'unchanged':_0x3f7914,'toDelete':_0x87d00d},'journeys':{'new':_0x5c733c,'changed':_0x36ea35,'unchanged':_0x84d803,'toDelete':_0x44f009},'activations':{'all':_0x369cf2,'toCreate':_0x1d01e4,'toUpdate':_0x5495ba,'toDelete':_0x40d55a},'folders':{'toCreate':_0x2bb557},'counts':{'segments':{'new':_0x141315[_0x5ff32d(0x1ff)],'changed':_0x4ec159[_0x5ff32d(0x1ff)],'unchanged':_0x3f7914['length'],'toDelete':_0x87d00d[_0x5ff32d(0x1ff)]},'journeys':{'new':_0x5c733c['length'],'changed':_0x36ea35[_0x5ff32d(0x1ff)],'unchanged':_0x84d803['length'],'toDelete':_0x44f009[_0x5ff32d(0x1ff)]},'activations':{'create':_0x1d01e4[_0x5ff32d(0x1ff)],'update':_0x5495ba['length'],'delete':_0x40d55a[_0x5ff32d(0x1ff)]},'folders':_0x2bb557['length']},'hasChanges':_0xa72f06||_0x51404e||_0x1bdfa3||_0x4519ed};}export async function buildPushExecutionContext(_0x4b5f9f,_0x3dfb0c,_0x4fc20c,_0x383b2a,_0x11035c,_0x240b9e){const _0x374b4f=a101_0x47621a,_0x1422f2=extractRootFolderId(_0x4fc20c),{pathToId:_0x3742f8,idToPath:_0x369b8b}=buildFolderMaps(_0x11035c),_0x416c91=buildSegmentNameToIdMap(_0x383b2a),_0x55a28d=new Map(),{batchAsync:_0x931b66}=await import(_0x374b4f(0x211)),[_0x4f2cf2,_0x4f0dfb]=await Promise[_0x374b4f(0x250)]([_0x4b5f9f['user'][_0x374b4f(0x21d)](),_0x4b5f9f[_0x374b4f(0x207)][_0x374b4f(0x25a)](),((async()=>{const _0x1eb54e=_0x374b4f;!_0x240b9e&&_0x383b2a[_0x1eb54e(0x1ff)]>0x0&&await _0x931b66(_0x383b2a,async _0x22bd5b=>{const _0x43e063=_0x1eb54e,_0x29952b=await _0x4b5f9f[_0x43e063(0x236)][_0x43e063(0x24f)](_0x3dfb0c,_0x22bd5b['id']);_0x55a28d[_0x43e063(0x263)](_0x22bd5b['id'],_0x29952b);});})())]),{emailToId:_0x2befe5,idToEmail:_0x2d7666}=_0x4f2cf2,_0x2f6565=buildConnectionMaps(_0x4f0dfb);return{'rootFolderId':_0x1422f2,'folderPathToId':_0x3742f8,'folderIdToPath':_0x369b8b,'segmentNameToId':_0x416c91,'activationsBySegmentId':_0x55a28d,'emailToIdMap':_0x2befe5,'idToEmailMap':_0x2d7666,'connectionNameToIdMap':_0x2f6565['nameToId'],'connectionIdToNameMap':_0x2f6565[_0x374b4f(0x1e7)],'connectionNameToTypeMap':_0x2f6565[_0x374b4f(0x206)]};}export function createPushYamlContextForBundle(_0x508963,_0xdb382c,_0x1656ec,_0x13c3b4,_0x48abe5,_0x1220c3,_0x2402ae,_0x2e4acf){const {existingLocalSegmentNames:_0x54b568,localExpandedRuleToNames:_0x7fdf99}=_0x13c3b4,_0x2028fe=new Set(),_0x6c249d=new Map(),_0x96082c=new Map(),_0x655d8c=new Map(),_0x1e0e99=createJumpTargetCache(),_0x2e2140=new Map(),_0x28ec4a=new Map(),_0x4ec0a7=new Set();let _0xc13e39;const _0x54aab7=_0xb50dce=>{const _0x1c737f={'resolveSegment':async _0x47d703=>{const _0x29da24=a101_0x10f7,_0x4c473a=_0x655d8c[_0x29da24(0x1c4)](_0x47d703);if(_0x4c473a!==undefined)return{'name':_0x4c473a,'isJourneyLocal':!![]};try{let _0x4082a9=_0x1656ec[_0x29da24(0x293)](_0x2570b6=>_0x2570b6['id']===_0x47d703);!_0x4082a9&&(_0x4082a9=await _0x508963[_0x29da24(0x236)]['getSegment'](_0xdb382c,_0x47d703));const _0x5b2ce4=generateJourneyLocalName(_0x4082a9[_0x29da24(0x256)]),_0x29ff9e=_0x4082a9[_0x29da24(0x24d)]===SEGMENT_KIND_JOURNEY&&_0x5b2ce4!==undefined;let _0x2d47d8=_0x4082a9[_0x29da24(0x256)],_0x259865;if(_0x29ff9e&&_0x4082a9[_0x29da24(0x1cc)]){const _0x5bfcdb=apiRuleToYaml(_0x4082a9['rule']);_0x28ec4a[_0x29da24(0x263)](_0x47d703,_0x5bfcdb);const _0x14b40b=async _0x134c13=>{const _0x933793=_0x29da24,_0x43fe87=collectSegmentRefsFromRule(_0x134c13);for(const _0x33d444 of _0x43fe87){if(!_0x28ec4a[_0x933793(0x259)](_0x33d444))try{const _0x373486=await _0x508963[_0x933793(0x236)][_0x933793(0x1c2)](_0xdb382c,_0x33d444);if(_0x373486?.[_0x933793(0x1cc)]){const _0x286694=apiRuleToYaml(_0x373486[_0x933793(0x1cc)]);_0x28ec4a['set'](_0x33d444,_0x286694),await _0x14b40b(_0x286694);}}catch{}}};await _0x14b40b(_0x5bfcdb);const _0xfadc2f=serializeExpandedRule(_0x5bfcdb,_0x28ec4a),_0x4af75c=_0x7fdf99[_0x29da24(0x1c4)](_0xfadc2f);if(_0x4af75c&&_0x4af75c[_0x29da24(0x1ff)]>0x0){const _0x7d7c39=_0x6c249d[_0x29da24(0x1c4)](_0xfadc2f)||0x0,_0x56e6cd=_0x4af75c[_0x7d7c39]||_0x4af75c[_0x4af75c['length']-0x1];_0x6c249d[_0x29da24(0x263)](_0xfadc2f,_0x7d7c39+0x1),_0x2d47d8=_0x56e6cd,_0x2028fe[_0x29da24(0x23e)](_0x2d47d8),_0x655d8c[_0x29da24(0x263)](_0x47d703,_0x2d47d8);const _0x574896=await resolveRuleSegmentRefs(_0x5bfcdb,async _0xbd0229=>{const _0x66876=_0x29da24,_0x662940=_0x655d8c[_0x66876(0x1c4)](_0xbd0229);if(_0x662940)return _0x662940;const _0xd14451=await _0xc13e39[_0x66876(0x262)](_0xbd0229);return _0xd14451[_0x66876(0x256)];});_0x259865={'description':_0x4082a9[_0x29da24(0x233)],'rule':_0x574896};}else{const _0x48a3ca=_0x2e2140[_0x29da24(0x1c4)](_0xfadc2f);if(_0x48a3ca)_0x2d47d8=_0x48a3ca,_0x655d8c['set'](_0x47d703,_0x2d47d8);else{if(_0x5b2ce4){let _0x4f9e14=_0x5b2ce4,_0x1d96b6=0x2;while(_0x2028fe[_0x29da24(0x259)](_0x4f9e14)||_0x54b568[_0x29da24(0x259)](_0x4f9e14)){_0x4f9e14=_0x5b2ce4+'_'+_0x1d96b6,_0x1d96b6++;}_0x2028fe[_0x29da24(0x23e)](_0x4f9e14),_0x2d47d8=_0x4f9e14;}_0x655d8c[_0x29da24(0x263)](_0x47d703,_0x2d47d8),_0x2e2140[_0x29da24(0x263)](_0xfadc2f,_0x2d47d8);const _0x7508cf=await resolveRuleSegmentRefs(_0x5bfcdb,async _0x453288=>{const _0x47e23a=_0x29da24,_0x5195ea=_0x655d8c[_0x47e23a(0x1c4)](_0x453288);if(_0x5195ea)return _0x5195ea;const _0x4802b0=await _0xc13e39[_0x47e23a(0x262)](_0x453288);return _0x4802b0['name'];});_0x259865={'description':_0x4082a9[_0x29da24(0x233)],'rule':_0x7508cf};}}}return{'name':_0x2d47d8,'isJourneyLocal':_0x29ff9e,'definition':_0x259865};}catch{return{'name':_0x47d703,'isJourneyLocal':![]};}},'resolveActivation':async _0x2e985d=>{const _0x19ab44=a101_0x10f7,_0x376517=_0x96082c['get'](_0x2e985d);if(_0x376517!==undefined)return{'name':_0x376517,'isJourneyLocal':!![]};try{let _0x217513=_0x2402ae?.[_0x19ab44(0x1c4)](_0x2e985d);!_0x217513&&(_0x217513=await _0x508963['journey']['getActivation'](_0xb50dce,_0x2e985d));const _0x1b5f24=_0x217513[_0x19ab44(0x26d)]['activationParams']['name']||_0x2e985d,_0x27bf6f=sanitizeYamlKey(_0x1b5f24)||_0x19ab44(0x210)+_0x2e985d,_0x5e45c0=_0x27bf6f;_0x96082c[_0x19ab44(0x263)](_0x2e985d,_0x5e45c0);const _0x407037=journeyActivationStepToYaml(_0x217513,_0x48abe5,_0x1220c3);return{'name':_0x5e45c0,'isJourneyLocal':!![],'definition':_0x407037};}catch{return{'name':_0x2e985d,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3886b8,_0x55d1e6)=>resolveJumpTarget(_0x3886b8,_0x55d1e6,_0x1e0e99,async _0x43ecbd=>{const _0xafcd85=a101_0x10f7,_0x2405df=_0x2e4acf?.[_0xafcd85(0x1c4)](_0x43ecbd);if(_0x2405df)return _0x2405df;return _0x508963[_0xafcd85(0x295)][_0xafcd85(0x1e3)](_0x43ecbd);})};return _0xc13e39=_0x1c737f,_0x1c737f;},_0x5c063e=async _0x39ed74=>{const _0x17fb73=a101_0x10f7,{collectSegmentIdsFromJourneyApi:_0x39c565}=await import('./journey-yaml.js'),{batchAsync:_0x236943}=await import(_0x17fb73(0x211)),_0xc8c4a1=new Set();for(const _0x4dddb1 of _0x39ed74){let _0x13bcc7=_0x2e4acf?.[_0x17fb73(0x1c4)](_0x4dddb1);!_0x13bcc7&&(_0x13bcc7=await _0x508963[_0x17fb73(0x295)][_0x17fb73(0x1e3)](_0x4dddb1));const _0x1cdcee=_0x39c565(_0x13bcc7);for(const _0x1a3162 of _0x1cdcee){_0xc8c4a1[_0x17fb73(0x23e)](_0x1a3162);}}let _0x1faef5=Array[_0x17fb73(0x201)](_0xc8c4a1);while(_0x1faef5[_0x17fb73(0x1ff)]>0x0){const _0x30e6ac=_0x1faef5['filter'](_0x4c0567=>!_0x4ec0a7[_0x17fb73(0x259)](_0x4c0567));if(_0x30e6ac[_0x17fb73(0x1ff)]===0x0)break;const _0x1f740a=await _0x236943(_0x30e6ac,async _0x9d109b=>{const _0x2f0a37=_0x17fb73;_0x4ec0a7['add'](_0x9d109b);let _0x35b093=_0x1656ec[_0x2f0a37(0x293)](_0x294fff=>_0x294fff['id']===_0x9d109b);if(!_0x35b093)try{_0x35b093=await _0x508963[_0x2f0a37(0x236)]['getSegment'](_0xdb382c,_0x9d109b);}catch{return null;}return{'segmentId':_0x9d109b,'segment':_0x35b093};},0xa),_0xfd4f19=new Set();for(const _0x409485 of _0x1f740a){if(!_0x409485?.[_0x17fb73(0x236)]?.[_0x17fb73(0x1cc)])continue;const _0x3a43b2=apiRuleToYaml(_0x409485[_0x17fb73(0x236)]['rule']);_0x28ec4a[_0x17fb73(0x263)](_0x409485[_0x17fb73(0x202)],_0x3a43b2);const _0x1f1736=collectSegmentRefsFromRule(_0x3a43b2);for(const _0x569ec3 of _0x1f1736){!_0x4ec0a7[_0x17fb73(0x259)](_0x569ec3)&&_0xfd4f19[_0x17fb73(0x23e)](_0x569ec3);}}_0x1faef5=Array[_0x17fb73(0x201)](_0xfd4f19);}};return{'createYamlContext':_0x54aab7,'prefetchJourneySegments':_0x5c063e};}export async function executePushSegments(_0x5032f9,_0x5f4aac,_0x2013d1,_0x553d39,_0xa2d832){const _0x6c2bb7=a101_0x47621a,{segmentDefToCreateRequest:_0x259a10,segmentDefToUpdateRequest:_0x24aaae}=await import('./child-segment-yaml.js'),_0x532470=_0x2013d1[_0x6c2bb7(0x261)],_0x409dd9=0x5,_0x1924dd=async _0x21cf44=>{const _0x5ed9d7=_0x6c2bb7,_0x313b4e=_0x21cf44[_0x5ed9d7(0x25b)]?_0x532470[_0x5ed9d7(0x1c4)](_0x21cf44[_0x5ed9d7(0x25b)]):undefined;let _0x162435;const _0x262e7b={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x21cf44['isNew']){_0xa2d832['onProgress']?.({'type':_0x5ed9d7(0x209),'name':_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)]});const _0x55ff43=_0x259a10(_0x21cf44['yamlConfig'],_0x313b4e),_0x50fe77=await _0xa2d832[_0x5ed9d7(0x278)](_0x5ed9d7(0x267)+_0x21cf44[_0x5ed9d7(0x1ce)]['name']+'\x27...',()=>_0x5032f9['segment'][_0x5ed9d7(0x1ea)](_0x553d39['parentId'],_0x55ff43));_0x162435=_0x50fe77[_0x5ed9d7(0x282)]['id'],_0x262e7b['createdSegmentId']={'name':_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)],'id':_0x162435},_0xa2d832['onProgress']?.({'type':_0x5ed9d7(0x1e6),'name':_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)],'segmentId':_0x162435}),_0xa2d832[_0x5ed9d7(0x2a3)]?.(_0x5ed9d7(0x25e)+_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)]+'\x27'),_0x262e7b[_0x5ed9d7(0x1f5)]=0x1;}else{if(_0x21cf44[_0x5ed9d7(0x29d)]){_0xa2d832[_0x5ed9d7(0x277)]?.({'type':_0x5ed9d7(0x235),'name':_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)]});const _0x32f990=_0x24aaae(_0x21cf44[_0x5ed9d7(0x1ce)]);_0x313b4e!==_0x21cf44[_0x5ed9d7(0x24c)]?.['segmentFolderId']&&(_0x32f990[_0x5ed9d7(0x216)]=_0x313b4e?parseInt(_0x313b4e,0xa):undefined),await _0xa2d832[_0x5ed9d7(0x278)](_0x5ed9d7(0x1ed)+_0x21cf44[_0x5ed9d7(0x1ce)]['name']+'\x27...',()=>_0x5032f9[_0x5ed9d7(0x236)][_0x5ed9d7(0x1e5)](_0x553d39['parentId'],_0x21cf44[_0x5ed9d7(0x24c)]['id'],_0x32f990)),_0x162435=_0x21cf44[_0x5ed9d7(0x24c)]['id'],_0xa2d832['onProgress']?.({'type':'segment_updated','name':_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)]}),_0xa2d832[_0x5ed9d7(0x2a3)]?.(_0x5ed9d7(0x241)+_0x21cf44['yamlConfig']['name']+'\x27'),_0x262e7b[_0x5ed9d7(0x228)]=0x1;}else _0x162435=_0x21cf44[_0x5ed9d7(0x24c)]['id'];}}catch(_0x2da04c){const _0xf0c21f=isHttp400Error(_0x2da04c),_0x51bd80=_0xf0c21f?ErrorCode[_0x5ed9d7(0x20d)]:ErrorCode[_0x5ed9d7(0x1ec)],_0x1abfab=getErrorMessage(_0x2da04c);throw new SDKError(_0x51bd80,'Failed\x20to\x20'+(_0x21cf44[_0x5ed9d7(0x1d8)]?_0x5ed9d7(0x1f2):_0x5ed9d7(0x1fb))+_0x5ed9d7(0x21b)+_0x21cf44[_0x5ed9d7(0x248)]+_0x5ed9d7(0x29c)+_0x1abfab,_0x2da04c);}try{const _0x2a035c=await syncActivationsForSegment(_0x5032f9,_0x553d39[_0x5ed9d7(0x21f)],_0x162435,_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)],_0x21cf44[_0x5ed9d7(0x1cb)],_0xa2d832,_0x21cf44[_0x5ed9d7(0x248)]);_0x262e7b[_0x5ed9d7(0x299)]=_0x2a035c;}catch(_0x1ecb1b){if(_0x1ecb1b instanceof SDKError)throw _0x1ecb1b;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x5ed9d7(0x255)+_0x21cf44[_0x5ed9d7(0x1ce)]['name']+_0x5ed9d7(0x29b)+_0x21cf44[_0x5ed9d7(0x248)]+_0x5ed9d7(0x29c)+getErrorMessage(_0x1ecb1b),_0x1ecb1b);}return _0x262e7b;},_0x4d1d5d=await batchAsync(_0x5f4aac,_0x1924dd,_0x409dd9),_0x1de5f4={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x177a2e of _0x4d1d5d){_0x1de5f4[_0x6c2bb7(0x1f5)]+=_0x177a2e['created'],_0x1de5f4[_0x6c2bb7(0x228)]+=_0x177a2e[_0x6c2bb7(0x228)],_0x177a2e[_0x6c2bb7(0x1c8)]&&_0x1de5f4[_0x6c2bb7(0x1e9)][_0x6c2bb7(0x263)](_0x177a2e['createdSegmentId']['name'],_0x177a2e[_0x6c2bb7(0x1c8)]['id']),_0x1de5f4[_0x6c2bb7(0x299)][_0x6c2bb7(0x1f5)]+=_0x177a2e[_0x6c2bb7(0x299)][_0x6c2bb7(0x1f5)],_0x1de5f4[_0x6c2bb7(0x299)][_0x6c2bb7(0x228)]+=_0x177a2e[_0x6c2bb7(0x299)][_0x6c2bb7(0x228)],_0x1de5f4[_0x6c2bb7(0x299)]['deleted']+=_0x177a2e[_0x6c2bb7(0x299)][_0x6c2bb7(0x232)];}return _0x1de5f4;}async function syncActivationsForSegment(_0x5a36ea,_0x40a97f,_0x1f009f,_0x2f0b33,_0x137195,_0x410092,_0x36a98){const _0x246fcd=a101_0x47621a,_0x2101f9={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x47162a of _0x137195){try{if(_0x47162a[_0x246fcd(0x27e)]===_0x246fcd(0x1f2)&&_0x47162a[_0x246fcd(0x230)])_0x410092[_0x246fcd(0x277)]?.({'type':_0x246fcd(0x257),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),await _0x410092['withProgress'](_0x246fcd(0x221)+_0x47162a[_0x246fcd(0x256)]+'\x27...',()=>_0x5a36ea['segment']['createActivation'](_0x40a97f,_0x1f009f,_0x47162a[_0x246fcd(0x230)])),_0x410092[_0x246fcd(0x277)]?.({'type':_0x246fcd(0x26a),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),_0x410092[_0x246fcd(0x2a3)]?.(_0x246fcd(0x1f9)+_0x47162a[_0x246fcd(0x256)]+'\x27'),_0x2101f9['created']++;else{if(_0x47162a['type']===_0x246fcd(0x1fb)&&_0x47162a[_0x246fcd(0x230)]&&_0x47162a['existingActivation'])_0x410092['onProgress']?.({'type':_0x246fcd(0x203),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),await _0x410092['withProgress'](_0x246fcd(0x269)+_0x47162a[_0x246fcd(0x256)]+'\x27...',()=>_0x5a36ea[_0x246fcd(0x236)][_0x246fcd(0x229)](_0x40a97f,_0x1f009f,_0x47162a['existingActivation']['id'],_0x47162a[_0x246fcd(0x230)])),_0x410092[_0x246fcd(0x277)]?.({'type':_0x246fcd(0x1d4),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),_0x410092[_0x246fcd(0x2a3)]?.('Updated\x20activation\x20\x27'+_0x47162a['name']+'\x27'),_0x2101f9[_0x246fcd(0x228)]++;else _0x47162a[_0x246fcd(0x27e)]===_0x246fcd(0x23f)&&_0x47162a['existingActivation']&&(_0x410092[_0x246fcd(0x277)]?.({'type':_0x246fcd(0x1c1),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),await _0x410092['withProgress']('Deleting\x20activation\x20\x27'+_0x47162a[_0x246fcd(0x256)]+'\x27...',()=>_0x5a36ea[_0x246fcd(0x236)][_0x246fcd(0x1cf)](_0x40a97f,_0x1f009f,_0x47162a[_0x246fcd(0x1dc)]['id'])),_0x410092[_0x246fcd(0x277)]?.({'type':_0x246fcd(0x23a),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),_0x410092[_0x246fcd(0x215)]?.('Deleted\x20activation\x20\x27'+_0x47162a[_0x246fcd(0x256)]+'\x27'),_0x2101f9['deleted']++);}}catch(_0x269e8c){const _0x271739=isHttp400Error(_0x269e8c),_0x1ea77a=_0x271739?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x246fcd(0x2a2)],_0x406508=getErrorMessage(_0x269e8c);throw new SDKError(_0x1ea77a,_0x246fcd(0x27c)+_0x47162a[_0x246fcd(0x27e)]+_0x246fcd(0x289)+_0x47162a['name']+_0x246fcd(0x29b)+_0x36a98+_0x246fcd(0x29c)+_0x406508,_0x269e8c);}}return _0x2101f9;}export async function executePushFolders(_0xd725ed,_0x103eef,_0x4391eb,_0x3b4d6d,_0x47c696){const _0x44de69=a101_0x47621a,_0x5c6212=new Map(_0x4391eb);for(const _0x38c607 of _0x103eef){const _0x26b048=_0x38c607[_0x44de69(0x22c)]('/'),_0x276156=_0x26b048[_0x26b048['length']-0x1],_0x24c1fd=_0x26b048['slice'](0x0,-0x1)['join']('/'),_0x16985d=_0x5c6212[_0x44de69(0x1c4)](_0x24c1fd);_0x47c696['onProgress']?.({'type':_0x44de69(0x1df),'folder':_0x38c607});const _0xc9c6b8={'name':_0x276156,'parentFolderId':_0x16985d},_0x510cd0=await _0x47c696[_0x44de69(0x278)](_0x44de69(0x273)+_0x38c607+_0x44de69(0x1c9),()=>_0xd725ed['segment'][_0x44de69(0x1c3)](_0x3b4d6d['parentId'],_0xc9c6b8));_0x5c6212[_0x44de69(0x263)](_0x38c607,_0x510cd0[_0x44de69(0x282)]['id']),_0x47c696[_0x44de69(0x277)]?.({'type':_0x44de69(0x20f),'folder':_0x38c607,'folderId':_0x510cd0[_0x44de69(0x282)]['id']}),_0x47c696[_0x44de69(0x1f6)]?.('Created\x20folder\x20\x27'+_0x38c607+'\x27');}return _0x5c6212;}export async function executePushSegmentDeletions(_0x6f8dfd,_0x472e48,_0x3032b8){const _0x2e2f95=a101_0x47621a;if(_0x472e48[_0x2e2f95(0x1ff)]===0x0)return 0x0;const {batchAsync:_0x1bd67c}=await import(_0x2e2f95(0x211)),_0x14da8d=0x5,_0x7d0caa=await _0x1bd67c(_0x472e48,async _0x1596e9=>{const _0x26c9d4=_0x2e2f95;return _0x3032b8[_0x26c9d4(0x277)]?.({'type':_0x26c9d4(0x20c),'name':_0x1596e9[_0x26c9d4(0x256)]}),await _0x6f8dfd[_0x26c9d4(0x236)][_0x26c9d4(0x266)](_0x1596e9['id']),_0x3032b8[_0x26c9d4(0x277)]?.({'type':'segment_deleted','name':_0x1596e9[_0x26c9d4(0x256)]}),_0x3032b8[_0x26c9d4(0x215)]?.(_0x26c9d4(0x240)+_0x1596e9[_0x26c9d4(0x256)]+'\x27'),0x1;},_0x14da8d);return _0x7d0caa[_0x2e2f95(0x1ee)]((_0x1fc201,_0x13e451)=>_0x1fc201+_0x13e451,0x0);}export async function executePushJourneys(_0x628ea,_0x477cdc,_0x10dffd,_0x4c8de3,_0x24c878){const _0x109286=a101_0x47621a,{journeyDefToRequest:_0x3be001}=await import(_0x109286(0x260)),{activationDefToCreateRequest:_0x46c4d7,yamlRuleToApi:_0x458835,validateSegmentRule:_0x39043e}=await import(_0x109286(0x290)),_0xf5f41e={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3db535=new Map(_0x10dffd[_0x109286(0x244)]),_0x37e127=0x5;for(let _0x4f9a96=0x0;_0x4f9a96<_0x477cdc[_0x109286(0x1ff)];_0x4f9a96+=_0x37e127){const _0x140684=_0x477cdc[_0x109286(0x27a)](_0x4f9a96,_0x4f9a96+_0x37e127),_0x111a3d=await Promise['all'](_0x140684['map'](async _0x287da6=>{const _0x3e7dd3=_0x109286;if(!_0x287da6[_0x3e7dd3(0x1d8)]&&!_0x287da6[_0x3e7dd3(0x29d)])return{'action':_0x3e7dd3(0x247),'name':_0x287da6['yamlConfig'][_0x3e7dd3(0x256)],'journeyId':_0x287da6['existingJourney']?.['id']};const _0x38b32a=_0x287da6[_0x3e7dd3(0x25b)]?_0x10dffd[_0x3e7dd3(0x261)][_0x3e7dd3(0x1c4)](_0x287da6[_0x3e7dd3(0x25b)]):undefined;_0x24c878[_0x3e7dd3(0x277)]?.({'type':_0x287da6['isNew']?_0x3e7dd3(0x265):_0x3e7dd3(0x26c),'name':_0x287da6['yamlConfig'][_0x3e7dd3(0x256)]});try{const _0x3921df=await executeSingleJourneyPush(_0x628ea,_0x287da6,{..._0x10dffd,'segmentNameToId':_0x3db535},{'parentId':_0x4c8de3['parentId'],'rootFolderId':_0x4c8de3['rootFolderId'],'folderId':_0x38b32a,'verbose':_0x4c8de3[_0x3e7dd3(0x1e2)]},_0x24c878,{'journeyDefToRequest':_0x3be001,'activationDefToCreateRequest':_0x46c4d7,'yamlRuleToApi':_0x458835,'validateSegmentRule':_0x39043e});for(const [_0x4e96ec,_0x1ccc5a]of _0x3921df[_0x3e7dd3(0x23c)]){_0x3db535[_0x3e7dd3(0x263)](_0x4e96ec,_0x1ccc5a),_0xf5f41e['embeddedSegmentNameToId'][_0x3e7dd3(0x263)](_0x4e96ec,_0x1ccc5a);}if(_0x3921df['action']===_0x3e7dd3(0x1f5))_0x24c878[_0x3e7dd3(0x277)]?.({'type':_0x3e7dd3(0x1eb),'name':_0x287da6[_0x3e7dd3(0x1ce)][_0x3e7dd3(0x256)],'journeyId':_0x3921df[_0x3e7dd3(0x204)]}),_0x24c878[_0x3e7dd3(0x2a3)]?.(_0x3e7dd3(0x200)+_0x287da6[_0x3e7dd3(0x1ce)][_0x3e7dd3(0x256)]+'\x27'),_0xf5f41e[_0x3e7dd3(0x1f5)]++;else _0x3921df[_0x3e7dd3(0x2a6)]===_0x3e7dd3(0x228)&&(_0x24c878[_0x3e7dd3(0x277)]?.({'type':_0x3e7dd3(0x226),'name':_0x287da6['yamlConfig'][_0x3e7dd3(0x256)]}),_0x24c878['logSuccess']?.(_0x3e7dd3(0x1e4)+_0x287da6[_0x3e7dd3(0x1ce)]['name']+'\x27'),_0xf5f41e[_0x3e7dd3(0x228)]++);return{'action':_0x3921df[_0x3e7dd3(0x2a6)],'name':_0x287da6[_0x3e7dd3(0x1ce)][_0x3e7dd3(0x256)],'journeyId':_0x3921df[_0x3e7dd3(0x204)]};}catch(_0x46c655){const _0x55fec3=isHttp400Error(_0x46c655),_0x2868cc=_0x55fec3?ErrorCode[_0x3e7dd3(0x2a1)]:ErrorCode[_0x3e7dd3(0x1f1)],_0x4ce45e=getErrorMessage(_0x46c655);throw new SDKError(_0x2868cc,_0x3e7dd3(0x27c)+(_0x287da6[_0x3e7dd3(0x1d8)]?_0x3e7dd3(0x1f2):_0x3e7dd3(0x1fb))+_0x3e7dd3(0x249)+_0x287da6[_0x3e7dd3(0x248)]+_0x3e7dd3(0x29c)+_0x4ce45e,_0x46c655);}}));_0xf5f41e['results']['push'](..._0x111a3d);}return _0xf5f41e;}async function executeSingleJourneyPush(_0x7a8138,_0xbc19f8,_0x1b32f3,_0x217bf5,_0x52768f,_0x25f60e){const _0x337306=a101_0x47621a,{journeyDefToRequest:_0x143962,activationDefToCreateRequest:_0x1acfe0,yamlRuleToApi:_0xbca547,validateSegmentRule:_0xad73c1}=_0x25f60e,_0x5a5e4c=new Map(),_0xc63018=new Map(),_0x460188=new Map(),_0x954ca6=new Map(),_0x1718c0=new Map();let _0x42e773;const _0x59bc73=async()=>{const _0x33f59b=a101_0x10f7;if(_0x42e773)return;_0x42e773=new Map();if(!_0xbc19f8[_0x33f59b(0x27d)])return;const _0x22d609=await _0x7a8138[_0x33f59b(0x295)][_0x33f59b(0x24f)](_0xbc19f8[_0x33f59b(0x27d)]['id']);for(const _0x38f9e3 of _0x22d609){const _0x19a491=journeyActivationStepToYaml(_0x38f9e3,_0x1b32f3[_0x33f59b(0x275)],_0x1b32f3[_0x33f59b(0x1d1)]),_0x5d3571=activationSignature(_0x19a491);!_0x42e773[_0x33f59b(0x259)](_0x5d3571)&&_0x42e773[_0x33f59b(0x263)](_0x5d3571,_0x38f9e3['id']),_0x19a491['name']&&_0xc63018['set'](_0x19a491['name'],_0x38f9e3['id']);}};if(_0xbc19f8['existingJourney']&&_0xbc19f8[_0x337306(0x1ce)][_0x337306(0x27b)]){const _0x510763=buildLocalExpandedRuleMappings(_0xbc19f8[_0x337306(0x1ce)]),_0x1b1ba2=_0x510763[_0x337306(0x1cd)];if(_0x1b1ba2['size']>0x0){const _0x3aa34f=new Map();for(const [_0x4f0d94,_0x11da59]of _0x1b1ba2){const _0x223ed6=serializeExpandedRule(_0x11da59,_0x1b1ba2);_0x3aa34f['set'](_0x4f0d94,_0x223ed6);}const _0x285d1d=collectSegmentIdsFromJourneyApi(_0xbc19f8['existingJourney']);if(_0x285d1d[_0x337306(0x219)]>0x0){const _0x2b6bca=await buildServerSegmentRuleMap(_0x7a8138,_0x217bf5[_0x337306(0x21f)],_0x1b32f3['existingSegments'],_0x285d1d);if(_0x2b6bca[_0x337306(0x219)]>0x0){const _0x8e77dc=new Map();for(const [_0x2d6f56,_0x2200bd]of _0x2b6bca){const _0x5f3107=serializeExpandedRule(_0x2200bd,_0x2b6bca);!_0x8e77dc[_0x337306(0x259)](_0x5f3107)&&_0x8e77dc[_0x337306(0x263)](_0x5f3107,_0x2d6f56);}for(const [_0x5b2929,_0x594da6]of _0x3aa34f){const _0x45d8a4=_0x8e77dc[_0x337306(0x1c4)](_0x594da6);_0x45d8a4&&(_0x1718c0[_0x337306(0x263)](_0x5b2929,_0x45d8a4),_0x1b32f3[_0x337306(0x244)][_0x337306(0x263)](_0x5b2929,_0x45d8a4));}}}}}const _0x3e3294={'resolveSegmentId':async _0x1ec835=>{const _0x381f63=_0x337306,_0x2d9921=_0x1b32f3[_0x381f63(0x244)]['get'](_0x1ec835);if(!_0x2d9921)throw new SDKError(ErrorCode[_0x381f63(0x297)],_0x381f63(0x20e)+_0x1ec835+'\x20(referenced\x20in\x20journey\x20'+_0xbc19f8['yamlConfig']['name']+')');return _0x2d9921;},'resolveEmbeddedSegmentId':async(_0x5b0b48,_0x5d56a8)=>{const _0x3e88e6=_0x337306,_0x350058=_0x1b32f3['segmentNameToId']['get'](_0x5b0b48);if(_0x350058)return _0x350058;const _0x10b07b=_0x1718c0[_0x3e88e6(0x1c4)](_0x5b0b48);if(_0x10b07b)return _0x1b32f3['segmentNameToId'][_0x3e88e6(0x263)](_0x5b0b48,_0x10b07b),_0x10b07b;const _0x586454=_0x1b32f3[_0x3e88e6(0x24e)][_0x3e88e6(0x293)](_0x942024=>_0x942024[_0x3e88e6(0x256)]===_0x5b0b48);if(_0x586454)return _0x1b32f3[_0x3e88e6(0x244)][_0x3e88e6(0x263)](_0x5b0b48,_0x586454['id']),_0x586454['id'];if(_0xbc19f8[_0x3e88e6(0x1d8)]){const {stageName:_0x3755a9,criteriaName:_0x637fcd}=findSegmentCriteriaLocation(_0xbc19f8[_0x3e88e6(0x1ce)],_0x5b0b48);return _0xad73c1(_0x5b0b48,_0x5d56a8[_0x3e88e6(0x1cc)]),_0x460188[_0x3e88e6(0x263)](_0x5b0b48,{'definition':_0x5d56a8,'stageName':_0x3755a9,'criteriaName':_0x637fcd}),createPendingSegmentId(_0x5b0b48);}const _0x4526d4=_0xbc19f8[_0x3e88e6(0x27d)]?.['id'];if(!_0x4526d4)throw new SDKError(ErrorCode[_0x3e88e6(0x1d9)],_0x3e88e6(0x223));_0xad73c1(_0x5b0b48,_0x5d56a8[_0x3e88e6(0x1cc)]);const _0x1bded3=generateDeterministicJourneySegmentName(_0xbc19f8[_0x3e88e6(0x1ce)][_0x3e88e6(0x256)],_0x5b0b48),_0x473893=_0x1b32f3[_0x3e88e6(0x24e)][_0x3e88e6(0x293)](_0x5d9435=>_0x5d9435[_0x3e88e6(0x256)]===_0x1bded3),_0x25d76e=createSegmentIdResolver(_0x1b32f3[_0x3e88e6(0x244)],_0x5b0b48),_0x41d697=await resolveRuleSegmentIds(_0x5d56a8['rule'],_0x25d76e);let _0x12c5e9;if(_0x473893)await _0x7a8138['segment'][_0x3e88e6(0x1e5)](_0x217bf5[_0x3e88e6(0x21f)],_0x473893['id'],{'description':_0x5d56a8[_0x3e88e6(0x233)]||_0x3e88e6(0x29e)+_0x5b0b48,'rule':_0xbca547(_0x41d697,!![]),'countPopulation':!![]}),_0x12c5e9=_0x473893['id'];else try{_0x12c5e9=await _0x7a8138[_0x3e88e6(0x236)][_0x3e88e6(0x214)]({'name':_0x1bded3,'description':_0x5d56a8['description']||_0x3e88e6(0x29e)+_0x5b0b48,'journeyId':_0x4526d4,'rule':_0xbca547(_0x41d697,!![]),'countPopulation':!![],'parentFolderId':_0x217bf5[_0x3e88e6(0x28b)]||'','audienceId':_0x217bf5[_0x3e88e6(0x21f)]});}catch(_0x13530a){const _0x2f8104=_0x13530a instanceof Error&&_0x13530a[_0x3e88e6(0x288)]['includes'](_0x3e88e6(0x28e));if(_0x2f8104){const _0x2232a5=await _0x7a8138['segment'][_0x3e88e6(0x21e)](_0x217bf5[_0x3e88e6(0x21f)]),_0x58d84d=_0x2232a5[_0x3e88e6(0x293)](_0x3d7849=>_0x3d7849['name']===_0x1bded3);if(_0x58d84d)await _0x7a8138[_0x3e88e6(0x236)][_0x3e88e6(0x1e5)](_0x217bf5[_0x3e88e6(0x21f)],_0x58d84d['id'],{'description':_0x5d56a8[_0x3e88e6(0x233)]||_0x3e88e6(0x29e)+_0x5b0b48,'rule':_0xbca547(_0x41d697,!![]),'countPopulation':!![]}),_0x12c5e9=_0x58d84d['id'];else throw _0x13530a;}else throw _0x13530a;}return _0x1b32f3[_0x3e88e6(0x244)][_0x3e88e6(0x263)](_0x5b0b48,_0x12c5e9),_0x5a5e4c['set'](_0x5b0b48,_0x12c5e9),_0x12c5e9;},'resolveActivationId':async _0x36ae3c=>{const _0x12bada=_0x337306,_0x3e5acb=_0xc63018[_0x12bada(0x1c4)](_0x36ae3c);if(_0x3e5acb)return _0x3e5acb;if(_0xbc19f8[_0x12bada(0x27d)]){await _0x59bc73();const _0x5f2bc9=_0xc63018[_0x12bada(0x1c4)](_0x36ae3c);if(_0x5f2bc9)return _0x5f2bc9;}throw new SDKError(ErrorCode[_0x12bada(0x1fa)],_0x12bada(0x270)+_0x36ae3c+_0x12bada(0x29a)+_0xbc19f8[_0x12bada(0x1ce)][_0x12bada(0x256)]+_0x12bada(0x287)+_0x12bada(0x1fe));},'resolveEmbeddedActivationId':async(_0x11eeb6,_0x3ae96d)=>{const _0x386b2f=_0x337306,_0x5b383c=_0xc63018['get'](_0x11eeb6);if(_0x5b383c)return _0x5b383c;if(_0xbc19f8[_0x386b2f(0x1d8)])return _0x954ca6['set'](_0x11eeb6,_0x3ae96d),createPendingActivationId(_0x11eeb6);if(_0xbc19f8[_0x386b2f(0x27d)]){await _0x59bc73();const _0x3cf0b2=_0xc63018[_0x386b2f(0x1c4)](_0x3ae96d[_0x386b2f(0x256)]);if(_0x3cf0b2)return _0xc63018[_0x386b2f(0x263)](_0x11eeb6,_0x3cf0b2),_0x3cf0b2;const _0x5c517b=activationSignature(_0x3ae96d),_0x589251=_0x42e773?.[_0x386b2f(0x1c4)](_0x5c517b);if(_0x589251)return _0xc63018[_0x386b2f(0x263)](_0x11eeb6,_0x589251),_0x589251;const _0x2a08c4=await _0x1acfe0(_0x3ae96d,_0x1b32f3[_0x386b2f(0x25c)]),_0x227f7f=await _0x7a8138[_0x386b2f(0x295)][_0x386b2f(0x220)](_0xbc19f8[_0x386b2f(0x27d)]['id'],_0x2a08c4);return _0xc63018[_0x386b2f(0x263)](_0x11eeb6,_0x227f7f['id']),_0x227f7f['id'];}throw new SDKError(ErrorCode[_0x386b2f(0x1d9)],_0x386b2f(0x1e0));},'resolveJourneyId':async _0x469ce9=>{const _0x37dfc9=_0x337306;try{return await _0x7a8138[_0x37dfc9(0x295)][_0x37dfc9(0x2a7)](_0x217bf5[_0x37dfc9(0x21f)],_0x469ce9);}catch(_0x500d19){throw new SDKError(ErrorCode[_0x37dfc9(0x1fa)],_0x37dfc9(0x1fd)+_0x469ce9+_0x37dfc9(0x2a0)+_0xbc19f8[_0x37dfc9(0x1ce)][_0x37dfc9(0x256)]+'\x27)',_0x500d19);}},'resolveStageId':async(_0x3a509c,_0x317956)=>{const _0x431ff9=_0x337306,_0x4a478f=await _0x7a8138[_0x431ff9(0x295)][_0x431ff9(0x1e3)](_0x3a509c),_0x483d39=_0x4a478f[_0x431ff9(0x26d)][_0x431ff9(0x1d3)]['find'](_0x423f6c=>_0x423f6c[_0x431ff9(0x256)][_0x431ff9(0x237)]()===_0x317956['toLowerCase']());if(!_0x483d39?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x431ff9(0x1ca)+_0x317956+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x4a478f[_0x431ff9(0x26d)][_0x431ff9(0x281)]||_0x4a478f[_0x431ff9(0x26d)][_0x431ff9(0x256)])+'\x27');return _0x483d39['id'];}},_0xc76dc5=await _0x143962(_0xbc19f8['yamlConfig'],_0x217bf5[_0x337306(0x21f)],_0x3e3294),_0xb127d1=_0x217bf5[_0x337306(0x224)]||_0x217bf5['rootFolderId'];_0xb127d1&&(_0xc76dc5[_0x337306(0x294)]={'parentFolder':{'data':{'id':_0xb127d1,'type':'folder'}}});if(_0xbc19f8[_0x337306(0x1d8)]){if(_0x460188[_0x337306(0x219)]>0x0||_0x954ca6['size']>0x0)return await executeThreeStepJourneyCreate(_0x7a8138,_0xbc19f8,_0xc76dc5,{'pendingEmbeddedSegments':_0x460188,'pendingEmbeddedActivations':_0x954ca6,'embeddedSegmentNameToId':_0x5a5e4c,'journeyActivationNameToId':_0xc63018},{..._0x217bf5,'effectiveFolderId':_0xb127d1},_0x1b32f3,_0x52768f,_0x25f60e);else{ensureJourneyDefaults(_0xc76dc5[_0x337306(0x26d)]);const _0xef61c8=await _0x7a8138['journey']['create'](_0xc76dc5);return{'action':_0x337306(0x1f5),'journeyId':_0xef61c8['id'],'embeddedSegmentNameToId':_0x5a5e4c};}}else{if(_0xbc19f8[_0x337306(0x29d)]&&_0xbc19f8[_0x337306(0x27d)])return ensureJourneyDefaults(_0xc76dc5[_0x337306(0x26d)]),await _0x7a8138['journey'][_0x337306(0x1fb)](_0xbc19f8[_0x337306(0x27d)]['id'],_0xc76dc5),{'action':_0x337306(0x228),'journeyId':_0xbc19f8[_0x337306(0x27d)]['id'],'embeddedSegmentNameToId':_0x5a5e4c};}return{'action':_0x337306(0x247),'journeyId':_0xbc19f8['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x5a5e4c};}function findSegmentCriteriaLocation(_0x33f2ff,_0x2fb577){const _0x3c5de4=a101_0x47621a,_0x9f499c=_0x33f2ff['stages']||_0x33f2ff[_0x3c5de4(0x231)]?.[0x0]?.['stages']||[];let _0x1a48d5=_0x3c5de4(0x268),_0x548146=_0x2fb577;const _0x4a428f=_0x33f2ff['goal']||_0x33f2ff[_0x3c5de4(0x231)]?.[0x0]?.['goal'];if(_0x4a428f?.[_0x3c5de4(0x236)]===_0x2fb577)return{'stageName':_0x3c5de4(0x258),'criteriaName':_0x4a428f[_0x3c5de4(0x256)]||_0x2fb577};_0x2f23f7:for(const _0x159401 of _0x9f499c){if(_0x159401[_0x3c5de4(0x251)]?.[_0x3c5de4(0x236)]===_0x2fb577){_0x1a48d5=_0x159401[_0x3c5de4(0x256)],_0x548146=_0x159401[_0x3c5de4(0x251)]['name']||_0x2fb577;break;}if(_0x159401[_0x3c5de4(0x279)])for(const _0x2a1003 of _0x159401[_0x3c5de4(0x279)]){if(_0x2a1003[_0x3c5de4(0x27e)]===_0x3c5de4(0x1d6)&&_0x2a1003[_0x3c5de4(0x284)]?.[_0x3c5de4(0x254)])for(const _0x189be2 of _0x2a1003['with'][_0x3c5de4(0x254)]){if(_0x189be2[_0x3c5de4(0x236)]===_0x2fb577){_0x1a48d5=_0x159401[_0x3c5de4(0x256)],_0x548146=_0x189be2['name']||_0x2fb577;break _0x2f23f7;}}}}return{'stageName':_0x1a48d5,'criteriaName':_0x548146};}async function executeThreeStepJourneyCreate(_0x36370b,_0x142514,_0x2adedb,_0xc45364,_0x3cc9ff,_0x1328ed,_0x1217aa,_0x492922){const _0x39ff61=a101_0x47621a,{activationDefToCreateRequest:_0x51fdce,yamlRuleToApi:_0x382f76}=_0x492922,{pendingEmbeddedSegments:_0x13169f,pendingEmbeddedActivations:_0x28cf8a,embeddedSegmentNameToId:_0x302d73}=_0xc45364,_0x22d21e=JSON['parse'](JSON[_0x39ff61(0x234)](_0x2adedb));ensureJourneyDefaults(_0x22d21e[_0x39ff61(0x26d)]),stripPendingIds(_0x22d21e);const _0x5a2eed=await _0x36370b[_0x39ff61(0x295)][_0x39ff61(0x1f2)](_0x22d21e),_0x28f270=_0x5a2eed['id'],_0x53392a=new Map();for(const _0x2f5ec6 of _0x5a2eed[_0x39ff61(0x26d)][_0x39ff61(0x1d3)]){_0x53392a[_0x39ff61(0x263)](_0x2f5ec6[_0x39ff61(0x256)][_0x39ff61(0x237)](),_0x2f5ec6['id']);}for(const [_0x51d1f4,{definition:_0x3ec957}]of _0x13169f){const _0x5d7284=generateDeterministicJourneySegmentName(_0x142514['yamlConfig']['name'],_0x51d1f4);_0x1217aa['onProgress']?.({'type':_0x39ff61(0x22d),'journeyName':_0x142514['yamlConfig']['name'],'segmentName':_0x51d1f4});const _0x5d3c91=createSegmentIdResolver(_0x1328ed[_0x39ff61(0x244)],_0x51d1f4),_0x1cc824=await resolveRuleSegmentIds(_0x3ec957['rule'],_0x5d3c91),_0x498d85=await _0x36370b[_0x39ff61(0x236)][_0x39ff61(0x214)]({'name':_0x5d7284,'description':_0x3ec957[_0x39ff61(0x233)]||_0x39ff61(0x29e)+_0x51d1f4,'journeyId':_0x28f270,'rule':_0x382f76(_0x1cc824,!![]),'countPopulation':!![],'parentFolderId':_0x3cc9ff[_0x39ff61(0x23b)]||'','audienceId':_0x3cc9ff[_0x39ff61(0x21f)]});_0x302d73[_0x39ff61(0x263)](_0x51d1f4,_0x498d85),_0x1328ed[_0x39ff61(0x244)][_0x39ff61(0x263)](_0x51d1f4,_0x498d85),_0x1217aa[_0x39ff61(0x277)]?.({'type':_0x39ff61(0x280),'journeyName':_0x142514[_0x39ff61(0x1ce)][_0x39ff61(0x256)],'segmentName':_0x51d1f4});}const _0x4c046b=new Map();for(const [_0x41cc9e,_0x4b1813]of _0x28cf8a){_0x1217aa[_0x39ff61(0x277)]?.({'type':_0x39ff61(0x252),'journeyName':_0x142514[_0x39ff61(0x1ce)][_0x39ff61(0x256)],'activationName':_0x41cc9e});const _0x2c1cfa=await _0x51fdce(_0x4b1813,_0x1328ed[_0x39ff61(0x25c)]),_0x5eb224=await _0x36370b[_0x39ff61(0x295)][_0x39ff61(0x220)](_0x28f270,_0x2c1cfa);_0x4c046b['set'](_0x41cc9e,_0x5eb224['id']),_0xc45364[_0x39ff61(0x271)][_0x39ff61(0x263)](_0x41cc9e,_0x5eb224['id']),_0x1217aa['onProgress']?.({'type':_0x39ff61(0x26b),'journeyName':_0x142514[_0x39ff61(0x1ce)][_0x39ff61(0x256)],'activationName':_0x41cc9e});}const _0x45888f=JSON['parse'](JSON[_0x39ff61(0x234)](_0x2adedb));return _0x45888f['id']=_0x28f270,ensureJourneyDefaults(_0x45888f[_0x39ff61(0x26d)]),resolvePendingIdsInRequest(_0x45888f,_0x2adedb,_0x53392a,_0x302d73,_0x4c046b,_0x1217aa),await _0x36370b[_0x39ff61(0x295)][_0x39ff61(0x1fb)](_0x28f270,_0x45888f),{'action':_0x39ff61(0x1f5),'journeyId':_0x28f270,'embeddedSegmentNameToId':_0x302d73};}function stripPendingIds(_0x3ed4a6){const _0xa0434a=a101_0x47621a;for(const _0x4cb712 of _0x3ed4a6[_0xa0434a(0x26d)][_0xa0434a(0x1d3)]||[]){_0x4cb712[_0xa0434a(0x20b)]?.[_0xa0434a(0x202)]&&isPendingSegmentId(_0x4cb712[_0xa0434a(0x20b)][_0xa0434a(0x202)])&&delete _0x4cb712['entryCriteria'];if(_0x4cb712[_0xa0434a(0x279)])for(const _0x3b3345 of Object[_0xa0434a(0x26e)](_0x4cb712['steps'])){const _0x52e631=_0x4cb712[_0xa0434a(0x279)][_0x3b3345];_0x52e631[_0xa0434a(0x27e)]===_0xa0434a(0x253)&&_0x52e631['journeyActivationStepId']&&isPendingActivationId(_0x52e631[_0xa0434a(0x1da)])&&(_0x52e631[_0xa0434a(0x1da)]='');if(_0x52e631['type']==='DecisionPoint'&&_0x52e631[_0xa0434a(0x254)])for(const _0x2d7af8 of _0x52e631['branches']){_0x2d7af8[_0xa0434a(0x202)]&&isPendingSegmentId(_0x2d7af8[_0xa0434a(0x202)])&&(_0x2d7af8[_0xa0434a(0x202)]='');}_0x52e631['type']===_0xa0434a(0x1f7)&&_0x52e631[_0xa0434a(0x29f)]?.[_0xa0434a(0x202)]&&isPendingSegmentId(_0x52e631[_0xa0434a(0x29f)][_0xa0434a(0x202)])&&(_0x52e631[_0xa0434a(0x29f)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x4fdc6b,_0x5bb552,_0x1916bb,_0x595671,_0x4a4afe,_0x179a7a){const _0x2294b8=a101_0x47621a,_0x5cffbb=(_0x595233,_0x54f77c)=>{const _0xa49377=a101_0x10f7;if(!isPendingSegmentId(_0x595233))return _0x595233;const _0x2137d1=extractPendingSegmentName(_0x595233),_0x515666=_0x595671['get'](_0x2137d1);return!_0x515666&&_0x179a7a[_0xa49377(0x246)]?.(_0xa49377(0x286)+_0x2137d1+_0xa49377(0x22e)+_0x54f77c),_0x515666;};if(_0x4fdc6b[_0x2294b8(0x26d)]['goal']?.[_0x2294b8(0x202)]&&isPendingSegmentId(_0x4fdc6b[_0x2294b8(0x26d)][_0x2294b8(0x258)]['segmentId'])){const _0x4958ac=_0x5cffbb(_0x4fdc6b[_0x2294b8(0x26d)][_0x2294b8(0x258)][_0x2294b8(0x202)],_0x2294b8(0x242));_0x4958ac&&(_0x4fdc6b[_0x2294b8(0x26d)][_0x2294b8(0x258)]['segmentId']=_0x4958ac);}for(const _0x17b064 of _0x4fdc6b['attributes']['journeyStages']||[]){const _0x54da57=_0x1916bb[_0x2294b8(0x1c4)](_0x17b064[_0x2294b8(0x256)][_0x2294b8(0x237)]());_0x54da57&&(_0x17b064['id']=_0x54da57);if(_0x17b064['entryCriteria']?.[_0x2294b8(0x202)]&&isPendingSegmentId(_0x17b064[_0x2294b8(0x20b)][_0x2294b8(0x202)])){const _0x4b50c8=_0x5cffbb(_0x17b064[_0x2294b8(0x20b)][_0x2294b8(0x202)],_0x2294b8(0x208)+_0x17b064[_0x2294b8(0x256)]+'\x27\x20entry\x20criteria');_0x4b50c8&&(_0x17b064[_0x2294b8(0x20b)][_0x2294b8(0x202)]=_0x4b50c8);}if(_0x17b064['exitCriterias'])for(const _0x27cff9 of _0x17b064[_0x2294b8(0x1de)]){if(_0x27cff9[_0x2294b8(0x202)]&&isPendingSegmentId(_0x27cff9[_0x2294b8(0x202)])){const _0x321bd1=_0x5cffbb(_0x27cff9['segmentId'],_0x2294b8(0x208)+_0x17b064[_0x2294b8(0x256)]+'\x27\x20exit\x20criteria');_0x321bd1&&(_0x27cff9[_0x2294b8(0x202)]=_0x321bd1);}}if(_0x17b064[_0x2294b8(0x1d5)]?.['segmentId']&&isPendingSegmentId(_0x17b064[_0x2294b8(0x1d5)][_0x2294b8(0x202)])){const _0x43b07d=_0x5cffbb(_0x17b064[_0x2294b8(0x1d5)][_0x2294b8(0x202)],'stage\x20\x27'+_0x17b064[_0x2294b8(0x256)]+_0x2294b8(0x2a4));_0x43b07d&&(_0x17b064['milestone'][_0x2294b8(0x202)]=_0x43b07d);}if(_0x17b064['steps']){const _0x39222d=_0x318934=>_0x5bb552[_0x2294b8(0x26d)][_0x2294b8(0x1d3)]['find'](_0x2cde5d=>_0x2cde5d['name'][_0x2294b8(0x237)]()===_0x17b064[_0x2294b8(0x256)][_0x2294b8(0x237)]())?.[_0x2294b8(0x279)]?.[_0x318934];for(const _0x57fdf0 of Object[_0x2294b8(0x26e)](_0x17b064[_0x2294b8(0x279)])){const _0xdcde62=_0x17b064['steps'][_0x57fdf0],_0x4aa47d=_0x39222d(_0x57fdf0);if(_0xdcde62['type']==='Activation'&&_0xdcde62['journeyActivationStepId']&&(isPendingActivationId(_0xdcde62[_0x2294b8(0x1da)])||_0xdcde62[_0x2294b8(0x1da)]==='')){if(_0x4aa47d?.['journeyActivationStepId']&&isPendingActivationId(_0x4aa47d[_0x2294b8(0x1da)])){const _0x5ae672=extractPendingActivationName(_0x4aa47d[_0x2294b8(0x1da)]),_0x35c32d=_0x4a4afe['get'](_0x5ae672);_0x35c32d&&(_0xdcde62[_0x2294b8(0x1da)]=_0x35c32d);}}if(_0xdcde62[_0x2294b8(0x27e)]===_0x2294b8(0x298)&&_0xdcde62[_0x2294b8(0x254)]&&_0x4aa47d?.[_0x2294b8(0x254)])for(let _0x352039=0x0;_0x352039<_0xdcde62[_0x2294b8(0x254)]['length'];_0x352039++){const _0x392ef9=_0xdcde62[_0x2294b8(0x254)][_0x352039],_0x56dd14=_0x4aa47d[_0x2294b8(0x254)][_0x352039];if(_0x56dd14?.['segmentId']&&isPendingSegmentId(_0x56dd14[_0x2294b8(0x202)])){const _0x10282d=_0x5cffbb(_0x56dd14[_0x2294b8(0x202)],'stage\x20\x27'+_0x17b064[_0x2294b8(0x256)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x392ef9['name']||_0x352039)+'\x27');_0x10282d&&(_0x392ef9['segmentId']=_0x10282d);}}if(_0xdcde62['type']===_0x2294b8(0x1f7)&&_0xdcde62['waitCondition']?.[_0x2294b8(0x202)]&&_0x4aa47d?.[_0x2294b8(0x29f)]?.[_0x2294b8(0x202)]&&isPendingSegmentId(_0x4aa47d[_0x2294b8(0x29f)][_0x2294b8(0x202)])){const _0x8ddc1c=_0x5cffbb(_0x4aa47d[_0x2294b8(0x29f)][_0x2294b8(0x202)],'stage\x20\x27'+_0x17b064['name']+'\x27\x20wait\x20condition');_0x8ddc1c&&(_0xdcde62[_0x2294b8(0x29f)][_0x2294b8(0x202)]=_0x8ddc1c);}}}}}
@@ -1 +1 @@
1
- function a102_0x30ed(){const _0x33bd74=['set','2493528ApxzPX','add','297891fZIfvD','name','1955840CHGScf','35323OZcoiB','parentFolderId','has','392rWWjsO','get','46GwZWhN','8040TznjtD','8704206IAAriV','1046305cfnMBw'];a102_0x30ed=function(){return _0x33bd74;};return a102_0x30ed();}function a102_0x4b18(_0x4aaff1,_0x475802){_0x4aaff1=_0x4aaff1-0x69;const _0x30ed27=a102_0x30ed();let _0x4b1861=_0x30ed27[_0x4aaff1];return _0x4b1861;}(function(_0xcfd786,_0x35b750){const _0x198c30=a102_0x4b18,_0x406e00=_0xcfd786();while(!![]){try{const _0x1f2db2=-parseInt(_0x198c30(0x71))/0x1*(parseInt(_0x198c30(0x76))/0x2)+parseInt(_0x198c30(0x6e))/0x3+-parseInt(_0x198c30(0x70))/0x4+parseInt(_0x198c30(0x6a))/0x5+parseInt(_0x198c30(0x6c))/0x6+parseInt(_0x198c30(0x74))/0x7*(parseInt(_0x198c30(0x77))/0x8)+parseInt(_0x198c30(0x69))/0x9;if(_0x1f2db2===_0x35b750)break;else _0x406e00['push'](_0x406e00['shift']());}catch(_0x48d474){_0x406e00['push'](_0x406e00['shift']());}}}(a102_0x30ed,0x6cedb));export function buildFolderIdToPathMap(_0x274656){const _0x4e96cd=a102_0x4b18,_0x59564d=new Map(),_0x2c0cdb=new Map();for(const _0x169bea of _0x274656){_0x2c0cdb[_0x4e96cd(0x6b)](_0x169bea['id'],_0x169bea);}const _0x425c8c=new Set();for(const _0x13c343 of _0x274656){!_0x13c343[_0x4e96cd(0x72)]&&_0x425c8c[_0x4e96cd(0x6d)](_0x13c343['id']);}function _0x13631d(_0x3019cf){const _0x2e7217=_0x4e96cd;if(_0x59564d['has'](_0x3019cf['id']))return _0x59564d[_0x2e7217(0x75)](_0x3019cf['id']);if(_0x425c8c[_0x2e7217(0x73)](_0x3019cf['id']))return _0x59564d[_0x2e7217(0x6b)](_0x3019cf['id'],''),'';if(_0x3019cf[_0x2e7217(0x72)]){const _0x4b8958=_0x2c0cdb[_0x2e7217(0x75)](_0x3019cf[_0x2e7217(0x72)]);if(_0x4b8958){const _0x46cffc=_0x13631d(_0x4b8958),_0x50fbd9=_0x46cffc?_0x46cffc+'/'+_0x3019cf[_0x2e7217(0x6f)]:_0x3019cf[_0x2e7217(0x6f)];return _0x59564d['set'](_0x3019cf['id'],_0x50fbd9),_0x50fbd9;}}const _0x67ef42=_0x3019cf['name'];return _0x59564d[_0x2e7217(0x6b)](_0x3019cf['id'],_0x67ef42),_0x67ef42;}for(const _0x13a6b3 of _0x274656){_0x13631d(_0x13a6b3);}return _0x59564d;}export function buildFolderPathToIdMap(_0x21a8c2){const _0x4ab3f1=a102_0x4b18,_0x3d1d41=new Map(),_0x268017=new Map();for(const _0x1d56e9 of _0x21a8c2){_0x268017['set'](_0x1d56e9['id'],_0x1d56e9);}const _0x3b6b77=new Set();for(const _0x299140 of _0x21a8c2){!_0x299140['parentFolderId']&&_0x3b6b77[_0x4ab3f1(0x6d)](_0x299140['id']);}function _0x5c09ca(_0x4e59d5){const _0x30ca47=_0x4ab3f1;if(_0x3b6b77[_0x30ca47(0x73)](_0x4e59d5['id']))return'';if(_0x4e59d5[_0x30ca47(0x72)]){const _0x3b9ee8=_0x268017[_0x30ca47(0x75)](_0x4e59d5[_0x30ca47(0x72)]);if(_0x3b9ee8){const _0x5d5c49=_0x5c09ca(_0x3b9ee8);return _0x5d5c49?_0x5d5c49+'/'+_0x4e59d5[_0x30ca47(0x6f)]:_0x4e59d5[_0x30ca47(0x6f)];}}return _0x4e59d5[_0x30ca47(0x6f)];}for(const _0x4b159d of _0x21a8c2){const _0x9f3cc4=_0x5c09ca(_0x4b159d);_0x3d1d41[_0x4ab3f1(0x6b)](_0x9f3cc4,_0x4b159d['id']);}return _0x3d1d41;}export function buildFolderMaps(_0x3adef9){const _0x2c00ac=a102_0x4b18,_0x4b799f=buildFolderIdToPathMap(_0x3adef9),_0x43fa95=new Map();for(const [_0x1703df,_0x2d5a6c]of _0x4b799f){_0x43fa95[_0x2c00ac(0x6b)](_0x2d5a6c,_0x1703df);}return{'idToPath':_0x4b799f,'pathToId':_0x43fa95};}export function getFolderPath(_0x4ed811,_0x156e7c){if(!_0x4ed811)return'';return _0x156e7c['get'](_0x4ed811)??'';}
1
+ (function(_0x592f4b,_0x49c1d2){const _0x2fa4de=a102_0x3152,_0xaccc2c=_0x592f4b();while(!![]){try{const _0x4fcb5b=parseInt(_0x2fa4de(0x1c8))/0x1+-parseInt(_0x2fa4de(0x1d4))/0x2*(parseInt(_0x2fa4de(0x1d5))/0x3)+parseInt(_0x2fa4de(0x1cb))/0x4+parseInt(_0x2fa4de(0x1ca))/0x5+-parseInt(_0x2fa4de(0x1d3))/0x6+-parseInt(_0x2fa4de(0x1cd))/0x7+parseInt(_0x2fa4de(0x1d1))/0x8;if(_0x4fcb5b===_0x49c1d2)break;else _0xaccc2c['push'](_0xaccc2c['shift']());}catch(_0x434bc4){_0xaccc2c['push'](_0xaccc2c['shift']());}}}(a102_0x5ba8,0x69125));export function buildFolderIdToPathMap(_0x3b21fd){const _0x50e054=a102_0x3152,_0x27380c=new Map(),_0xaf63df=new Map();for(const _0xe0559d of _0x3b21fd){_0xaf63df[_0x50e054(0x1cc)](_0xe0559d['id'],_0xe0559d);}const _0x53a917=new Set();for(const _0x7bc68 of _0x3b21fd){!_0x7bc68[_0x50e054(0x1ce)]&&_0x53a917[_0x50e054(0x1cf)](_0x7bc68['id']);}function _0x2e99df(_0x1421bd){const _0x1d4886=_0x50e054;if(_0x27380c[_0x1d4886(0x1c9)](_0x1421bd['id']))return _0x27380c['get'](_0x1421bd['id']);if(_0x53a917['has'](_0x1421bd['id']))return _0x27380c[_0x1d4886(0x1cc)](_0x1421bd['id'],''),'';if(_0x1421bd[_0x1d4886(0x1ce)]){const _0x279740=_0xaf63df['get'](_0x1421bd[_0x1d4886(0x1ce)]);if(_0x279740){const _0x492572=_0x2e99df(_0x279740),_0x26e57d=_0x492572?_0x492572+'/'+_0x1421bd[_0x1d4886(0x1d0)]:_0x1421bd[_0x1d4886(0x1d0)];return _0x27380c[_0x1d4886(0x1cc)](_0x1421bd['id'],_0x26e57d),_0x26e57d;}}const _0x2ae99c=_0x1421bd[_0x1d4886(0x1d0)];return _0x27380c[_0x1d4886(0x1cc)](_0x1421bd['id'],_0x2ae99c),_0x2ae99c;}for(const _0x24c421 of _0x3b21fd){_0x2e99df(_0x24c421);}return _0x27380c;}export function buildFolderPathToIdMap(_0x32acc9){const _0x483df6=a102_0x3152,_0x375851=new Map(),_0x54dbfe=new Map();for(const _0x95f9fd of _0x32acc9){_0x54dbfe['set'](_0x95f9fd['id'],_0x95f9fd);}const _0x1097de=new Set();for(const _0x500ad9 of _0x32acc9){!_0x500ad9[_0x483df6(0x1ce)]&&_0x1097de['add'](_0x500ad9['id']);}function _0x3ac45d(_0x8b3410){const _0x77f509=_0x483df6;if(_0x1097de['has'](_0x8b3410['id']))return'';if(_0x8b3410[_0x77f509(0x1ce)]){const _0x1a2b4b=_0x54dbfe[_0x77f509(0x1d2)](_0x8b3410[_0x77f509(0x1ce)]);if(_0x1a2b4b){const _0x33977a=_0x3ac45d(_0x1a2b4b);return _0x33977a?_0x33977a+'/'+_0x8b3410[_0x77f509(0x1d0)]:_0x8b3410['name'];}}return _0x8b3410[_0x77f509(0x1d0)];}for(const _0x2e2f27 of _0x32acc9){const _0x1bbedc=_0x3ac45d(_0x2e2f27);_0x375851[_0x483df6(0x1cc)](_0x1bbedc,_0x2e2f27['id']);}return _0x375851;}function a102_0x3152(_0x2d3aba,_0x51f0ba){_0x2d3aba=_0x2d3aba-0x1c8;const _0x5ba8ab=a102_0x5ba8();let _0x3152b9=_0x5ba8ab[_0x2d3aba];return _0x3152b9;}export function buildFolderMaps(_0x4a9bbe){const _0x34a0ab=a102_0x3152,_0x895a47=buildFolderIdToPathMap(_0x4a9bbe),_0x3adecb=new Map();for(const [_0xf770c0,_0x5a4b04]of _0x895a47){_0x3adecb[_0x34a0ab(0x1cc)](_0x5a4b04,_0xf770c0);}return{'idToPath':_0x895a47,'pathToId':_0x3adecb};}function a102_0x5ba8(){const _0x1fb875=['name','7515824OSruGz','get','2637900MGRDZt','93670oHwrIt','6tXRscd','494948jzjbAm','has','1369380teQZEM','393188icJFHM','set','5900342BtrYsC','parentFolderId','add'];a102_0x5ba8=function(){return _0x1fb875;};return a102_0x5ba8();}export function getFolderPath(_0xd61e9d,_0x351e92){if(!_0xd61e9d)return'';return _0x351e92['get'](_0xd61e9d)??'';}
@@ -1 +1 @@
1
- (function(_0x3ba574,_0x39cf39){const _0x3f094d=a103_0x39c2,_0x881a01=_0x3ba574();while(!![]){try{const _0x37607=parseInt(_0x3f094d(0x113))/0x1+parseInt(_0x3f094d(0x12c))/0x2+-parseInt(_0x3f094d(0x11e))/0x3*(-parseInt(_0x3f094d(0x10f))/0x4)+parseInt(_0x3f094d(0x11a))/0x5+parseInt(_0x3f094d(0x125))/0x6+parseInt(_0x3f094d(0x11d))/0x7+-parseInt(_0x3f094d(0x115))/0x8*(parseInt(_0x3f094d(0x10b))/0x9);if(_0x37607===_0x39cf39)break;else _0x881a01['push'](_0x881a01['shift']());}catch(_0x2759fd){_0x881a01['push'](_0x881a01['shift']());}}}(a103_0xc43c,0xc858d));import a103_0x3b342b from'path';import{parse as a103_0x27c729}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x194131){const _0x8d2583=a103_0x39c2;if(!_0x194131||_0x194131[_0x8d2583(0x128)]()==='')throw new Error(_0x8d2583(0x11b));const _0x2465d3=_0x194131[_0x8d2583(0x128)]();if(_0x2465d3==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x194131};const _0x2c5b2a=_0x2465d3[_0x8d2583(0x11f)]('/')?_0x2465d3[_0x8d2583(0x11c)](0x1):_0x2465d3,_0x1e2d5f=_0x2c5b2a[_0x8d2583(0x119)]('/')[_0x8d2583(0x111)](_0x557261=>_0x557261!=='');if(_0x1e2d5f[_0x8d2583(0x126)]===0x0)throw new Error(_0x8d2583(0x121));const _0x12ece4=_0x2465d3[_0x8d2583(0x11f)]('/')||!isRelativePathSegment(_0x1e2d5f[0x0]);for(const _0x2a0f8d of _0x1e2d5f){validatePathSegment(_0x2a0f8d);}return{'segments':_0x1e2d5f,'isAbsolute':_0x12ece4,'raw':_0x194131};}function isRelativePathSegment(_0x40d50a){return _0x40d50a==='.'||_0x40d50a==='..';}function validatePathSegment(_0x1d3e38){const _0x6d845f=a103_0x39c2;if(_0x1d3e38==='')throw new Error(_0x6d845f(0x106));if(_0x1d3e38==='.'||_0x1d3e38==='..')return;if(/[\x00-\x1F\x7F]/[_0x6d845f(0x10d)](_0x1d3e38))throw new Error(_0x6d845f(0x105)+_0x1d3e38);if(_0x1d3e38!==_0x1d3e38[_0x6d845f(0x128)]()){}}function a103_0x39c2(_0x2bab78,_0x202b83){_0x2bab78=_0x2bab78-0xfd;const _0xc43c8a=a103_0xc43c();let _0x39c236=_0xc43c8a[_0x2bab78];return _0x39c236;}export function validatePath(_0x37b4a9){const _0xdbd5f3=a103_0x39c2;if(_0x37b4a9[_0xdbd5f3(0x102)][_0xdbd5f3(0x126)]===0x0&&!_0x37b4a9[_0xdbd5f3(0x120)])throw new Error(_0xdbd5f3(0x108));if(_0x37b4a9[_0xdbd5f3(0x120)]){if(_0x37b4a9[_0xdbd5f3(0x102)][0x0]==='..')throw new Error(_0xdbd5f3(0x112));let _0x3fda95=0x0;for(const _0x1096ac of _0x37b4a9[_0xdbd5f3(0x102)]){if(_0x1096ac==='..'){if(_0x3fda95===0x0)throw new Error(_0xdbd5f3(0x107));_0x3fda95--;}else _0x1096ac!=='.'&&_0x3fda95++;}}}export function joinPaths(_0x40b4aa,_0x4d5b53){const _0x4f0285=a103_0x39c2;if(!_0x40b4aa||_0x40b4aa==='/')return _0x4d5b53;if(!_0x4d5b53||_0x4d5b53==='.')return _0x40b4aa;if(_0x4d5b53[_0x4f0285(0x11f)]('/'))return _0x4d5b53;const _0x201ed2=parsePath(_0x40b4aa),_0x67a16=parsePath(_0x4d5b53),_0xc50619=[..._0x201ed2[_0x4f0285(0x102)]];for(const _0x3a6fdd of _0x67a16['segments']){if(_0x3a6fdd==='.')continue;else{if(_0x3a6fdd==='..'){if(_0xc50619[_0x4f0285(0x126)]===0x0)throw new Error(_0x4f0285(0x10a));_0xc50619['pop']();}else _0xc50619[_0x4f0285(0x122)](_0x3a6fdd);}}const _0x3cffff=_0xc50619[_0x4f0285(0x110)]('/');return _0x201ed2[_0x4f0285(0x129)]['startsWith']('/')?'/'+_0x3cffff:_0x3cffff;}export function normalizePath(_0x2cdcb2){const _0x588f1e=a103_0x39c2,_0x5f0480=parsePath(_0x2cdcb2),_0x2bcbf0=[];for(const _0x315064 of _0x5f0480['segments']){if(_0x315064==='.')continue;else{if(_0x315064==='..'){if(_0x2bcbf0['length']===0x0){if(_0x5f0480['isAbsolute'])throw new Error(_0x588f1e(0x10a));_0x2bcbf0[_0x588f1e(0x122)]('..');}else _0x2bcbf0[_0x2bcbf0[_0x588f1e(0x126)]-0x1]==='..'?_0x2bcbf0[_0x588f1e(0x122)]('..'):_0x2bcbf0[_0x588f1e(0xfd)]();}else _0x2bcbf0[_0x588f1e(0x122)](_0x315064);}}if(_0x2bcbf0[_0x588f1e(0x126)]===0x0)return _0x5f0480[_0x588f1e(0x120)]?'/':'.';const _0x1c1868=_0x2bcbf0['join']('/');return _0x5f0480[_0x588f1e(0x129)][_0x588f1e(0x11f)]('/')?'/'+_0x1c1868:_0x1c1868;}export function getParentPath(_0x41ee03){const _0x5cd409=a103_0x39c2,_0x41c3fc=parsePath(_0x41ee03);if(_0x41c3fc[_0x5cd409(0x102)][_0x5cd409(0x126)]<=0x1)return'/';const _0x55874d=_0x41c3fc[_0x5cd409(0x102)]['slice'](0x0,-0x1)['join']('/');return _0x41c3fc[_0x5cd409(0x129)][_0x5cd409(0x11f)]('/')?'/'+_0x55874d:_0x55874d;}export function getBaseName(_0x2664db){const _0x2c5cc9=a103_0x39c2,_0x2d491e=parsePath(_0x2664db);return _0x2d491e[_0x2c5cc9(0x102)][_0x2d491e[_0x2c5cc9(0x102)][_0x2c5cc9(0x126)]-0x1]||'';}export function isChildPath(_0x81bc1a,_0x2ea903){const _0x52b61d=a103_0x39c2,_0x44c254=parsePath(_0x81bc1a),_0x3fb297=parsePath(_0x2ea903);if(_0x44c254[_0x52b61d(0x102)][_0x52b61d(0x126)]<=_0x3fb297[_0x52b61d(0x102)][_0x52b61d(0x126)])return![];for(let _0xbf38bc=0x0;_0xbf38bc<_0x3fb297['segments'][_0x52b61d(0x126)];_0xbf38bc++){if(_0x44c254['segments'][_0xbf38bc]!==_0x3fb297['segments'][_0xbf38bc])return![];}return!![];}export function splitPath(_0x1286f2){const _0x3e394c=a103_0x39c2,_0x131040=parsePath(_0x1286f2);if(_0x131040[_0x3e394c(0x102)][_0x3e394c(0x126)]===0x0)throw new Error(_0x3e394c(0x100));if(_0x131040['segments']['length']===0x1)return{'parent':_0x131040[_0x3e394c(0x102)][0x0]};return{'parent':_0x131040[_0x3e394c(0x102)][0x0],'child':_0x131040['segments'][_0x3e394c(0x116)](0x1)[_0x3e394c(0x110)]('/')};}function a103_0xc43c(){const _0x2f0a9a=['readFile','journey','5117172PXsEUj','length','tdx.json','trim','raw','dirname','resolve','1060892hNVtnx','pop','name','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Cannot\x20split\x20empty\x20path','parent_segment','segments','type','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Path\x20segment\x20cannot\x20be\x20empty','Path\x20attempts\x20to\x20navigate\x20above\x20root','Relative\x20path\x20cannot\x20be\x20empty','endsWith','Cannot\x20navigate\x20above\x20root','29299356JDEflC','.yml','test','parse','60XysJPq','join','filter','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','1095098eSONZx','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','8AjqFmu','slice','exists','relative','split','2021370eZVPnw','Path\x20cannot\x20be\x20empty','substring','7901845SbpUbP','12918qoWmxK','startsWith','isAbsolute','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','push'];a103_0xc43c=function(){return _0x2f0a9a;};return a103_0xc43c();}export function isYamlFilePath(_0x225514){const _0x2f7697=a103_0x39c2;return _0x225514[_0x2f7697(0x109)](_0x2f7697(0x10c))||_0x225514[_0x2f7697(0x109)]('.yaml');}export async function resolveYamlFilePath(_0x49ce0f,_0x69f6c0=nodeFileSystem){const _0x34c238=a103_0x39c2,_0x5b9ebd=a103_0x3b342b[_0x34c238(0x12b)](_0x49ce0f);if(!await _0x69f6c0[_0x34c238(0x117)](_0x5b9ebd))throw new Error('File\x20not\x20found:\x20'+_0x49ce0f);let _0x8f613c=a103_0x3b342b[_0x34c238(0x12a)](_0x5b9ebd),_0x4784a3=null,_0x4046e3=null;const _0x1cdc09=a103_0x3b342b[_0x34c238(0x10e)](_0x8f613c)['root'];while(_0x8f613c!==_0x1cdc09){const _0x2be62b=a103_0x3b342b[_0x34c238(0x110)](_0x8f613c,_0x34c238(0x127));if(await _0x69f6c0[_0x34c238(0x117)](_0x2be62b)){_0x4784a3=_0x2be62b,_0x4046e3=_0x8f613c;break;}_0x8f613c=a103_0x3b342b[_0x34c238(0x12a)](_0x8f613c);}if(!_0x4784a3||!_0x4046e3)throw new Error(_0x34c238(0x104)+_0x49ce0f);const _0x152a30=await _0x69f6c0[_0x34c238(0x123)](_0x4784a3),_0x3254a3=JSON[_0x34c238(0x10e)](_0x152a30),_0x10877f=_0x3254a3[_0x34c238(0x101)];if(!_0x10877f)throw new Error(_0x34c238(0x114));const _0x4fa5be=await _0x69f6c0[_0x34c238(0x123)](_0x5b9ebd),_0x4681bb=a103_0x27c729(_0x4fa5be),_0x2c39d2=_0x4681bb[_0x34c238(0xfe)];if(!_0x2c39d2)throw new Error(_0x34c238(0xff)+_0x49ce0f);const _0x3ba1fe=_0x4681bb[_0x34c238(0x103)]===_0x34c238(0x124)?_0x34c238(0x124):'segment',_0x15037a=a103_0x3b342b[_0x34c238(0x118)](_0x4046e3,_0x5b9ebd),_0x5bc054=a103_0x3b342b['dirname'](_0x15037a),_0xef6738=_0x5bc054==='.'?'':_0x5bc054['replace'](/\\/g,'/'),_0x41a6df=_0xef6738?_0x10877f+'/'+_0xef6738+'/'+_0x2c39d2:_0x10877f+'/'+_0x2c39d2;return{'parentSegment':_0x10877f,'segmentName':_0x2c39d2,'folderPath':_0xef6738,'fullPath':_0x41a6df,'resourceType':_0x3ba1fe};}
1
+ (function(_0x4090fd,_0x30901d){const _0x18dbba=a103_0x1fa1,_0x438f8f=_0x4090fd();while(!![]){try{const _0x143e85=parseInt(_0x18dbba(0x197))/0x1+-parseInt(_0x18dbba(0x1a8))/0x2+parseInt(_0x18dbba(0x194))/0x3+-parseInt(_0x18dbba(0x1aa))/0x4*(parseInt(_0x18dbba(0x198))/0x5)+-parseInt(_0x18dbba(0x193))/0x6*(parseInt(_0x18dbba(0x19e))/0x7)+-parseInt(_0x18dbba(0x189))/0x8+parseInt(_0x18dbba(0x192))/0x9*(parseInt(_0x18dbba(0x190))/0xa);if(_0x143e85===_0x30901d)break;else _0x438f8f['push'](_0x438f8f['shift']());}catch(_0xab40d2){_0x438f8f['push'](_0x438f8f['shift']());}}}(a103_0x1f67,0xa2ce1));import a103_0x46810a from'path';import{parse as a103_0x4189de}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5823e2){const _0x4d84b0=a103_0x1fa1;if(!_0x5823e2||_0x5823e2['trim']()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0xae815e=_0x5823e2[_0x4d84b0(0x1ac)]();if(_0xae815e==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5823e2};const _0x512d51=_0xae815e[_0x4d84b0(0x18a)]('/')?_0xae815e[_0x4d84b0(0x184)](0x1):_0xae815e,_0x42159d=_0x512d51['split']('/')[_0x4d84b0(0x1a6)](_0x1ed431=>_0x1ed431!=='');if(_0x42159d[_0x4d84b0(0x18b)]===0x0)throw new Error(_0x4d84b0(0x196));const _0x326ec6=_0xae815e[_0x4d84b0(0x18a)]('/')||!isRelativePathSegment(_0x42159d[0x0]);for(const _0x570d9b of _0x42159d){validatePathSegment(_0x570d9b);}return{'segments':_0x42159d,'isAbsolute':_0x326ec6,'raw':_0x5823e2};}function isRelativePathSegment(_0x3d7faa){return _0x3d7faa==='.'||_0x3d7faa==='..';}function validatePathSegment(_0x1c769e){const _0x2d75d5=a103_0x1fa1;if(_0x1c769e==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x1c769e==='.'||_0x1c769e==='..')return;if(/[\x00-\x1F\x7F]/[_0x2d75d5(0x191)](_0x1c769e))throw new Error(_0x2d75d5(0x1ab)+_0x1c769e);if(_0x1c769e!==_0x1c769e[_0x2d75d5(0x1ac)]()){}}export function validatePath(_0xd683aa){const _0x277ccf=a103_0x1fa1;if(_0xd683aa[_0x277ccf(0x1af)][_0x277ccf(0x18b)]===0x0&&!_0xd683aa['isAbsolute'])throw new Error(_0x277ccf(0x1a1));if(_0xd683aa['isAbsolute']){if(_0xd683aa[_0x277ccf(0x1af)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x1fb44f=0x0;for(const _0x5d9eed of _0xd683aa[_0x277ccf(0x1af)]){if(_0x5d9eed==='..'){if(_0x1fb44f===0x0)throw new Error(_0x277ccf(0x19f));_0x1fb44f--;}else _0x5d9eed!=='.'&&_0x1fb44f++;}}}export function joinPaths(_0x38fc8d,_0x3f74a0){const _0x4bb810=a103_0x1fa1;if(!_0x38fc8d||_0x38fc8d==='/')return _0x3f74a0;if(!_0x3f74a0||_0x3f74a0==='.')return _0x38fc8d;if(_0x3f74a0[_0x4bb810(0x18a)]('/'))return _0x3f74a0;const _0x503e0b=parsePath(_0x38fc8d),_0x504d11=parsePath(_0x3f74a0),_0x26d414=[..._0x503e0b[_0x4bb810(0x1af)]];for(const _0x3edf55 of _0x504d11[_0x4bb810(0x1af)]){if(_0x3edf55==='.')continue;else{if(_0x3edf55==='..'){if(_0x26d414[_0x4bb810(0x18b)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x26d414['pop']();}else _0x26d414[_0x4bb810(0x1ad)](_0x3edf55);}}const _0x462c61=_0x26d414[_0x4bb810(0x1a7)]('/');return _0x503e0b[_0x4bb810(0x19b)][_0x4bb810(0x18a)]('/')?'/'+_0x462c61:_0x462c61;}export function normalizePath(_0x3b8437){const _0x30ed44=a103_0x1fa1,_0x2aeb8d=parsePath(_0x3b8437),_0x3974f6=[];for(const _0x203276 of _0x2aeb8d[_0x30ed44(0x1af)]){if(_0x203276==='.')continue;else{if(_0x203276==='..'){if(_0x3974f6[_0x30ed44(0x18b)]===0x0){if(_0x2aeb8d[_0x30ed44(0x1a4)])throw new Error(_0x30ed44(0x1a3));_0x3974f6['push']('..');}else _0x3974f6[_0x3974f6[_0x30ed44(0x18b)]-0x1]==='..'?_0x3974f6['push']('..'):_0x3974f6[_0x30ed44(0x199)]();}else _0x3974f6['push'](_0x203276);}}if(_0x3974f6[_0x30ed44(0x18b)]===0x0)return _0x2aeb8d[_0x30ed44(0x1a4)]?'/':'.';const _0x2fd6b3=_0x3974f6[_0x30ed44(0x1a7)]('/');return _0x2aeb8d[_0x30ed44(0x19b)]['startsWith']('/')?'/'+_0x2fd6b3:_0x2fd6b3;}export function getParentPath(_0x5eebfc){const _0x2134de=a103_0x1fa1,_0x5c1909=parsePath(_0x5eebfc);if(_0x5c1909[_0x2134de(0x1af)][_0x2134de(0x18b)]<=0x1)return'/';const _0x3998b8=_0x5c1909['segments'][_0x2134de(0x18f)](0x0,-0x1)[_0x2134de(0x1a7)]('/');return _0x5c1909[_0x2134de(0x19b)][_0x2134de(0x18a)]('/')?'/'+_0x3998b8:_0x3998b8;}function a103_0x1f67(){const _0x32f09d=['Path\x20attempts\x20to\x20navigate\x20above\x20root','tdx.json','Relative\x20path\x20cannot\x20be\x20empty','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Cannot\x20navigate\x20above\x20root','isAbsolute','exists','filter','join','1437370XjXrcn','root','208kySwdE','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','trim','push','journey','segments','endsWith','dirname','substring','segment','File\x20not\x20found:\x20','No\x20tdx.json\x20found\x20for\x20file:\x20','parent_segment','2026488kvEptA','startsWith','length','name','replace','resolve','slice','5649700PTwrmy','test','27NSJMON','72AmFgOO','665937pcbjjX','type','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','932208uYIhCP','14000fmFgaY','pop','readFile','raw','Cannot\x20split\x20empty\x20path','relative','621047xqWkpQ'];a103_0x1f67=function(){return _0x32f09d;};return a103_0x1f67();}export function getBaseName(_0x36e809){const _0x4cffd5=a103_0x1fa1,_0x14e95a=parsePath(_0x36e809);return _0x14e95a[_0x4cffd5(0x1af)][_0x14e95a[_0x4cffd5(0x1af)][_0x4cffd5(0x18b)]-0x1]||'';}export function isChildPath(_0x15ca7f,_0x470500){const _0x252336=a103_0x1fa1,_0x3c1aac=parsePath(_0x15ca7f),_0x5e7232=parsePath(_0x470500);if(_0x3c1aac[_0x252336(0x1af)][_0x252336(0x18b)]<=_0x5e7232[_0x252336(0x1af)][_0x252336(0x18b)])return![];for(let _0x1da6ee=0x0;_0x1da6ee<_0x5e7232['segments']['length'];_0x1da6ee++){if(_0x3c1aac[_0x252336(0x1af)][_0x1da6ee]!==_0x5e7232[_0x252336(0x1af)][_0x1da6ee])return![];}return!![];}export function splitPath(_0x4ae825){const _0x3fc8c4=a103_0x1fa1,_0xa6eac5=parsePath(_0x4ae825);if(_0xa6eac5[_0x3fc8c4(0x1af)][_0x3fc8c4(0x18b)]===0x0)throw new Error(_0x3fc8c4(0x19c));if(_0xa6eac5[_0x3fc8c4(0x1af)][_0x3fc8c4(0x18b)]===0x1)return{'parent':_0xa6eac5[_0x3fc8c4(0x1af)][0x0]};return{'parent':_0xa6eac5[_0x3fc8c4(0x1af)][0x0],'child':_0xa6eac5['segments']['slice'](0x1)['join']('/')};}function a103_0x1fa1(_0x28a48d,_0x373c84){_0x28a48d=_0x28a48d-0x182;const _0x1f672f=a103_0x1f67();let _0x1fa185=_0x1f672f[_0x28a48d];return _0x1fa185;}export function isYamlFilePath(_0x2df26f){const _0x5743e1=a103_0x1fa1;return _0x2df26f[_0x5743e1(0x182)]('.yml')||_0x2df26f[_0x5743e1(0x182)]('.yaml');}export async function resolveYamlFilePath(_0x20adcb,_0x12cf71=nodeFileSystem){const _0x5c0d05=a103_0x1fa1,_0x1edc53=a103_0x46810a[_0x5c0d05(0x18e)](_0x20adcb);if(!await _0x12cf71[_0x5c0d05(0x1a5)](_0x1edc53))throw new Error(_0x5c0d05(0x186)+_0x20adcb);let _0x5dbaa7=a103_0x46810a[_0x5c0d05(0x183)](_0x1edc53),_0x5ab71d=null,_0x20ac23=null;const _0x1a5efc=a103_0x46810a['parse'](_0x5dbaa7)[_0x5c0d05(0x1a9)];while(_0x5dbaa7!==_0x1a5efc){const _0xf1f08=a103_0x46810a[_0x5c0d05(0x1a7)](_0x5dbaa7,_0x5c0d05(0x1a0));if(await _0x12cf71['exists'](_0xf1f08)){_0x5ab71d=_0xf1f08,_0x20ac23=_0x5dbaa7;break;}_0x5dbaa7=a103_0x46810a['dirname'](_0x5dbaa7);}if(!_0x5ab71d||!_0x20ac23)throw new Error(_0x5c0d05(0x187)+_0x20adcb);const _0x40cd42=await _0x12cf71[_0x5c0d05(0x19a)](_0x5ab71d),_0x1a3ef2=JSON['parse'](_0x40cd42),_0x11521f=_0x1a3ef2[_0x5c0d05(0x188)];if(!_0x11521f)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x188349=await _0x12cf71['readFile'](_0x1edc53),_0x273ce5=a103_0x4189de(_0x188349),_0x2e3cc7=_0x273ce5[_0x5c0d05(0x18c)];if(!_0x2e3cc7)throw new Error(_0x5c0d05(0x1a2)+_0x20adcb);const _0x55b6ee=_0x273ce5[_0x5c0d05(0x195)]===_0x5c0d05(0x1ae)?_0x5c0d05(0x1ae):_0x5c0d05(0x185),_0x23186c=a103_0x46810a[_0x5c0d05(0x19d)](_0x20ac23,_0x1edc53),_0x46f2e1=a103_0x46810a[_0x5c0d05(0x183)](_0x23186c),_0x4f6f27=_0x46f2e1==='.'?'':_0x46f2e1[_0x5c0d05(0x18d)](/\\/g,'/'),_0x5327ae=_0x4f6f27?_0x11521f+'/'+_0x4f6f27+'/'+_0x2e3cc7:_0x11521f+'/'+_0x2e3cc7;return{'parentSegment':_0x11521f,'segmentName':_0x2e3cc7,'folderPath':_0x4f6f27,'fullPath':_0x5327ae,'resourceType':_0x55b6ee};}
@@ -1 +1 @@
1
- (function(_0x2811f2,_0x4367ec){const _0x35af60=a104_0x2628,_0x34f4f9=_0x2811f2();while(!![]){try{const _0x3fb8c1=parseInt(_0x35af60(0xc1))/0x1*(parseInt(_0x35af60(0xc0))/0x2)+-parseInt(_0x35af60(0xbb))/0x3*(-parseInt(_0x35af60(0xba))/0x4)+parseInt(_0x35af60(0xc5))/0x5*(-parseInt(_0x35af60(0xbf))/0x6)+parseInt(_0x35af60(0xc3))/0x7*(-parseInt(_0x35af60(0xc7))/0x8)+parseInt(_0x35af60(0xc8))/0x9*(-parseInt(_0x35af60(0xbe))/0xa)+parseInt(_0x35af60(0xc2))/0xb+parseInt(_0x35af60(0xc4))/0xc;if(_0x3fb8c1===_0x4367ec)break;else _0x34f4f9['push'](_0x34f4f9['shift']());}catch(_0x14b64f){_0x34f4f9['push'](_0x34f4f9['shift']());}}}(a104_0x3ba9,0x9c00f));export function parseSegmentRef(_0x505b29){const _0x4d06fd=a104_0x2628,_0xaf87bc=_0x505b29[_0x4d06fd(0xbc)]('/');if(_0xaf87bc===-0x1)return{'parentId':_0x505b29};if(_0xaf87bc===0x0)throw new Error(_0x4d06fd(0xc6)+_0x505b29+_0x4d06fd(0xbd));const _0x37ec7a=_0x505b29[_0x4d06fd(0xc9)](0x0,_0xaf87bc),_0x53711e=_0x505b29['substring'](_0xaf87bc+0x1);if(_0x53711e==='')throw new Error(_0x4d06fd(0xc6)+_0x505b29+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x37ec7a,'childId':_0x53711e};}function a104_0x2628(_0x4fad5e,_0x21d943){_0x4fad5e=_0x4fad5e-0xba;const _0x3ba992=a104_0x3ba9();let _0x262804=_0x3ba992[_0x4fad5e];return _0x262804;}function a104_0x3ba9(){const _0x3a7875=['Invalid\x20segment\x20reference\x20format:\x20','1047016ODitXo','354519weLXic','substring','32EWKiHC','125340AKHJcN','indexOf','.\x20Parent\x20name\x20cannot\x20be\x20empty','110KgNcSF','258eaQzpI','10vfdWKw','140583zYsvnm','5194871TPhqqU','21lMHDgs','11727276zonHdT','118810owqBWa'];a104_0x3ba9=function(){return _0x3a7875;};return a104_0x3ba9();}
1
+ function a104_0x50a6(_0x2d0b70,_0x530b21){_0x2d0b70=_0x2d0b70-0x128;const _0x49c828=a104_0x49c8();let _0x50a61f=_0x49c828[_0x2d0b70];return _0x50a61f;}(function(_0x309069,_0x4b9875){const _0x595aea=a104_0x50a6,_0x375d80=_0x309069();while(!![]){try{const _0x136482=-parseInt(_0x595aea(0x135))/0x1*(-parseInt(_0x595aea(0x12a))/0x2)+-parseInt(_0x595aea(0x136))/0x3*(parseInt(_0x595aea(0x133))/0x4)+parseInt(_0x595aea(0x132))/0x5*(parseInt(_0x595aea(0x134))/0x6)+-parseInt(_0x595aea(0x12f))/0x7*(parseInt(_0x595aea(0x12c))/0x8)+-parseInt(_0x595aea(0x129))/0x9*(-parseInt(_0x595aea(0x128))/0xa)+-parseInt(_0x595aea(0x130))/0xb+parseInt(_0x595aea(0x12b))/0xc;if(_0x136482===_0x4b9875)break;else _0x375d80['push'](_0x375d80['shift']());}catch(_0x2995b3){_0x375d80['push'](_0x375d80['shift']());}}}(a104_0x49c8,0x1d772));export function parseSegmentRef(_0x4322e7){const _0x4cdcfa=a104_0x50a6,_0x2446e9=_0x4322e7['indexOf']('/');if(_0x2446e9===-0x1)return{'parentId':_0x4322e7};if(_0x2446e9===0x0)throw new Error(_0x4cdcfa(0x12d)+_0x4322e7+_0x4cdcfa(0x12e));const _0x5de006=_0x4322e7['substring'](0x0,_0x2446e9),_0x47464a=_0x4322e7['substring'](_0x2446e9+0x1);if(_0x47464a==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x4322e7+_0x4cdcfa(0x131));return{'parentId':_0x5de006,'childId':_0x47464a};}function a104_0x49c8(){const _0x4c4e6e=['280685DFbCCw','628bWgaOg','18pOGvRm','1ZhIaqi','879qrCesr','18200lHqewE','18xNsibi','149320WsuuNt','1722036syZgCy','1208IdRpzg','Invalid\x20segment\x20reference\x20format:\x20','.\x20Parent\x20name\x20cannot\x20be\x20empty','840KcLYpA','2259433zCTOqi','.\x20Child\x20name\x20cannot\x20be\x20empty'];a104_0x49c8=function(){return _0x4c4e6e;};return a104_0x49c8();}
@@ -1 +1 @@
1
- (function(_0xe71436,_0x1cc007){const _0x3787b8=a105_0x4c89,_0xaeaf04=_0xe71436();while(!![]){try{const _0x344fac=parseInt(_0x3787b8(0x1a4))/0x1+parseInt(_0x3787b8(0x1b5))/0x2*(-parseInt(_0x3787b8(0x1ac))/0x3)+-parseInt(_0x3787b8(0x194))/0x4+-parseInt(_0x3787b8(0x1a3))/0x5*(-parseInt(_0x3787b8(0x199))/0x6)+parseInt(_0x3787b8(0x182))/0x7+-parseInt(_0x3787b8(0x188))/0x8+parseInt(_0x3787b8(0x195))/0x9;if(_0x344fac===_0x1cc007)break;else _0xaeaf04['push'](_0xaeaf04['shift']());}catch(_0x194cf0){_0xaeaf04['push'](_0xaeaf04['shift']());}}}(a105_0x51af,0x8ed79));import a105_0x568c19 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';function a105_0x4c89(_0x12cb89,_0x4bac1a){_0x12cb89=_0x12cb89-0x181;const _0x51af70=a105_0x51af();let _0x4c8950=_0x51af70[_0x12cb89];return _0x4c8950;}import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x2751b6){const _0x5e01bb=a105_0x4c89;return _0x2751b6['type']!==_0x5e01bb(0x19c);}export function isScopedResolution(_0xcbc6c5){const _0x470053=a105_0x4c89;return _0xcbc6c5[_0x470053(0x18a)]===_0x470053(0x186)||_0xcbc6c5[_0x470053(0x18a)]===_0x470053(0x19d)||_0xcbc6c5['type']==='context';}export function getScopedDetails(_0x418953){const _0x6f4a8b=a105_0x4c89;if(isScopedResolution(_0x418953))return{'isScoped':_0x418953['isScoped'],'scopedFolderPath':_0x418953[_0x6f4a8b(0x1a0)]};return undefined;}function a105_0x51af(){const _0x38091d=['parse','join','readFile','journey','9738gJBsig','No\x20tdx.json\x20found\x20for\x20file:\x20','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','dirname','invalid_yaml','isFile','parent_name','string','parent_segment','388FgDPbZ','folderPath','6874777stuVXx','isDirectory','resourceType','replace','directory','segmentName','5657624ZfVfjQ','File\x20not\x20found','type','startsWith','segment','trim','configDir','no_parent','stat','no_config','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','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','1088972aljmLY','1799388qpfYIh','context','Not\x20a\x20YAML\x20file:\x20','basename','6VvgEmc','root','parentSegment','error','file','cwd','Parent\x20segment\x20not\x20specified','scopedFolderPath','message','resolve','1066705sMVzSF','798867iVQPKz','includes','No\x20tdx.json\x20found','isScoped'];a105_0x51af=function(){return _0x38091d;};return a105_0x51af();}async function findTdxConfigAsync(_0x5d8366,_0x3d7bf5){const _0x3ad864=a105_0x4c89;let _0x547f48=a105_0x568c19[_0x3ad864(0x1a2)](_0x5d8366);const _0x329706=a105_0x568c19['parse'](_0x547f48)[_0x3ad864(0x19a)];while(_0x547f48!==_0x329706){const _0x23caf9=a105_0x568c19[_0x3ad864(0x1a9)](_0x547f48,'tdx.json');if(await _0x3d7bf5['exists'](_0x23caf9))try{const _0x3c37fc=await _0x3d7bf5[_0x3ad864(0x1aa)](_0x23caf9),_0x88b9d9=JSON[_0x3ad864(0x1a8)](_0x3c37fc);if(_0x88b9d9[_0x3ad864(0x1b4)]&&typeof _0x88b9d9[_0x3ad864(0x1b4)]===_0x3ad864(0x1b3))return{'configPath':_0x23caf9,'configDir':_0x547f48,'parentSegment':_0x88b9d9['parent_segment']};}catch{}_0x547f48=a105_0x568c19['dirname'](_0x547f48);}return null;}function calculateScopedPath(_0x302d37,_0x4fdbbc){const _0x440c01=a105_0x4c89,_0x19cb88=a105_0x568c19['relative'](_0x4fdbbc,_0x302d37),_0x467bc9=_0x19cb88!==''&&_0x19cb88!=='.'&&!_0x19cb88[_0x440c01(0x18b)]('..');return{'isScoped':_0x467bc9,'scopedFolderPath':_0x467bc9?_0x19cb88[_0x440c01(0x185)](/\\/g,'/'):''};}export async function resolveTarget(_0x2866ac){const _0x27933f=a105_0x4c89,{arg:_0x18c120,contextParent:_0x4a6ee2,cwd:cwd=process[_0x27933f(0x19e)](),fs:fs=nodeFileSystem}=_0x2866ac;if(_0x18c120&&isYamlFilePath(_0x18c120))try{const _0x28f688=await resolveYamlFilePath(_0x18c120,fs),_0x3575a5=a105_0x568c19[_0x27933f(0x1a2)](_0x18c120),_0x26c182=a105_0x568c19[_0x27933f(0x1af)](_0x3575a5),_0x14994a=await findTdxConfigAsync(_0x26c182,fs);if(!_0x14994a){if(_0x4a6ee2){const _0x548df6=a105_0x568c19[_0x27933f(0x1af)](_0x3575a5);return{'type':_0x27933f(0x19d),'parentName':_0x4a6ee2,'targetDir':_0x548df6,'configRoot':_0x548df6,'filePath':_0x3575a5,'resourceName':_0x28f688[_0x27933f(0x187)],'folderPath':_0x28f688[_0x27933f(0x181)],'resourceType':_0x28f688[_0x27933f(0x184)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x27933f(0x19c),'errorCode':'no_config','message':_0x27933f(0x1ad)+_0x18c120,'arg':_0x18c120,'helpText':_0x27933f(0x1ae)};}const _0x273224=calculateScopedPath(_0x26c182,_0x14994a[_0x27933f(0x18e)]);return{'type':_0x27933f(0x19d),'parentName':_0x14994a[_0x27933f(0x19b)],'targetDir':_0x14994a[_0x27933f(0x18e)],'configRoot':_0x14994a['configDir'],'filePath':_0x3575a5,'resourceName':_0x28f688['segmentName'],'folderPath':_0x28f688[_0x27933f(0x181)],'resourceType':_0x28f688[_0x27933f(0x184)],'isScoped':_0x273224['isScoped'],'scopedFolderPath':_0x273224[_0x27933f(0x1a0)]};}catch(_0x20d6bf){const _0xf9937e=_0x20d6bf instanceof Error?_0x20d6bf[_0x27933f(0x1a1)]:String(_0x20d6bf);if(_0xf9937e[_0x27933f(0x1a5)](_0x27933f(0x189)))return{'type':_0x27933f(0x19c),'errorCode':'file_not_found','message':'File\x20not\x20found:\x20'+_0x18c120,'arg':_0x18c120};if(_0xf9937e[_0x27933f(0x1a5)](_0x27933f(0x1a6))){if(_0x4a6ee2){const _0xfb6672=a105_0x568c19[_0x27933f(0x1a2)](_0x18c120);if(await fs['exists'](_0xfb6672)){const _0x305f90=a105_0x568c19[_0x27933f(0x1af)](_0xfb6672),_0x34b9ac=await fs['readFile'](_0xfb6672),_0x1777ab=_0x34b9ac['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x70a304=_0x34b9ac['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x24c4ff=_0x1777ab?_0x1777ab[0x1][_0x27933f(0x18d)]():a105_0x568c19[_0x27933f(0x198)](_0x18c120,a105_0x568c19['extname'](_0x18c120)),_0x590529=_0x70a304&&_0x70a304[0x1][_0x27933f(0x18d)]()===_0x27933f(0x1ab)?'journey':_0x27933f(0x18c);return{'type':_0x27933f(0x19d),'parentName':_0x4a6ee2,'targetDir':_0x305f90,'configRoot':_0x305f90,'filePath':_0xfb6672,'resourceName':_0x24c4ff,'folderPath':'','resourceType':_0x590529,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x27933f(0x19c),'errorCode':'no_config','message':_0x27933f(0x1ad)+_0x18c120,'arg':_0x18c120,'helpText':_0x27933f(0x1ae)};}return{'type':_0x27933f(0x19c),'errorCode':_0x27933f(0x1b0),'message':_0xf9937e,'arg':_0x18c120};}if(_0x18c120){const _0x5355a3=a105_0x568c19['resolve'](cwd,_0x18c120);let _0x8d58c8=null;try{_0x8d58c8=await fs[_0x27933f(0x190)](_0x5355a3);}catch{}if(_0x8d58c8?.[_0x27933f(0x183)]()){const _0x10033c=await findTdxConfigAsync(_0x5355a3,fs);if(_0x10033c){const _0x3c4371=calculateScopedPath(_0x5355a3,_0x10033c[_0x27933f(0x18e)]);return{'type':_0x27933f(0x186),'parentName':_0x10033c[_0x27933f(0x19b)],'targetDir':_0x5355a3,'configRoot':_0x10033c[_0x27933f(0x18e)],'isScoped':_0x3c4371[_0x27933f(0x1a7)],'scopedFolderPath':_0x3c4371['scopedFolderPath']};}if(_0x4a6ee2)return{'type':'directory','parentName':_0x4a6ee2,'targetDir':_0x5355a3,'configRoot':_0x5355a3,'isScoped':![],'scopedFolderPath':''};return{'type':_0x27933f(0x19c),'errorCode':_0x27933f(0x191),'message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x18c120,'arg':_0x18c120,'helpText':_0x27933f(0x1ae)};}if(_0x8d58c8?.[_0x27933f(0x1b1)]())return{'type':_0x27933f(0x19c),'errorCode':'invalid_yaml','message':_0x27933f(0x197)+_0x18c120,'arg':_0x18c120,'helpText':_0x27933f(0x192)};const _0x4e7bb0=sanitizeFileName(_0x18c120),_0x3072c9=getSegmentRootDir(_0x4e7bb0,cwd);return{'type':_0x27933f(0x1b2),'parentName':_0x18c120,'targetDir':_0x3072c9,'configRoot':_0x3072c9};}const _0x2f49ad=await findTdxConfigAsync(cwd,fs);if(_0x2f49ad){const _0x44ceee=calculateScopedPath(cwd,_0x2f49ad[_0x27933f(0x18e)]);return{'type':_0x27933f(0x196),'parentName':_0x2f49ad[_0x27933f(0x19b)],'targetDir':cwd,'configRoot':_0x2f49ad[_0x27933f(0x18e)],'isScoped':_0x44ceee[_0x27933f(0x1a7)],'scopedFolderPath':_0x44ceee[_0x27933f(0x1a0)]};}if(_0x4a6ee2){const _0xbad9bc=sanitizeFileName(_0x4a6ee2),_0x570561=getSegmentRootDir(_0xbad9bc,cwd);return{'type':_0x27933f(0x196),'parentName':_0x4a6ee2,'targetDir':_0x570561,'configRoot':_0x570561,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x27933f(0x19c),'errorCode':_0x27933f(0x18f),'message':_0x27933f(0x19f),'helpText':_0x27933f(0x193)};}
1
+ (function(_0x334729,_0x39e0e6){const _0x5db974=a105_0x253d,_0x168913=_0x334729();while(!![]){try{const _0x12c35e=-parseInt(_0x5db974(0x144))/0x1*(-parseInt(_0x5db974(0x154))/0x2)+parseInt(_0x5db974(0x146))/0x3+-parseInt(_0x5db974(0x15c))/0x4+-parseInt(_0x5db974(0x12f))/0x5+-parseInt(_0x5db974(0x147))/0x6*(-parseInt(_0x5db974(0x14b))/0x7)+parseInt(_0x5db974(0x12b))/0x8*(parseInt(_0x5db974(0x13b))/0x9)+parseInt(_0x5db974(0x136))/0xa*(-parseInt(_0x5db974(0x151))/0xb);if(_0x12c35e===_0x39e0e6)break;else _0x168913['push'](_0x168913['shift']());}catch(_0x3a95bb){_0x168913['push'](_0x168913['shift']());}}}(a105_0x1219,0x462dc));import a105_0x292b54 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(_0xfd3738){const _0x202546=a105_0x253d;return _0xfd3738[_0x202546(0x138)]!=='error';}export function isScopedResolution(_0x24ab8c){const _0x526241=a105_0x253d;return _0x24ab8c[_0x526241(0x138)]===_0x526241(0x13a)||_0x24ab8c[_0x526241(0x138)]==='file'||_0x24ab8c[_0x526241(0x138)]===_0x526241(0x13d);}export function getScopedDetails(_0x3b89cd){const _0x3fa8fa=a105_0x253d;if(isScopedResolution(_0x3b89cd))return{'isScoped':_0x3b89cd[_0x3fa8fa(0x12d)],'scopedFolderPath':_0x3b89cd[_0x3fa8fa(0x153)]};return undefined;}async function findTdxConfigAsync(_0x84ec10,_0xf9f8bb){const _0x1fc442=a105_0x253d;let _0x480b3e=a105_0x292b54[_0x1fc442(0x14c)](_0x84ec10);const _0x49c758=a105_0x292b54[_0x1fc442(0x132)](_0x480b3e)['root'];while(_0x480b3e!==_0x49c758){const _0x454bc2=a105_0x292b54[_0x1fc442(0x14d)](_0x480b3e,'tdx.json');if(await _0xf9f8bb[_0x1fc442(0x131)](_0x454bc2))try{const _0x5f0bff=await _0xf9f8bb['readFile'](_0x454bc2),_0x3eb86a=JSON[_0x1fc442(0x132)](_0x5f0bff);if(_0x3eb86a[_0x1fc442(0x15b)]&&typeof _0x3eb86a[_0x1fc442(0x15b)]===_0x1fc442(0x150))return{'configPath':_0x454bc2,'configDir':_0x480b3e,'parentSegment':_0x3eb86a[_0x1fc442(0x15b)]};}catch{}_0x480b3e=a105_0x292b54[_0x1fc442(0x13e)](_0x480b3e);}return null;}function a105_0x253d(_0xcf7f0c,_0x5aa37f){_0xcf7f0c=_0xcf7f0c-0x129;const _0x121914=a105_0x1219();let _0x253dad=_0x121914[_0xcf7f0c];return _0x253dad;}function calculateScopedPath(_0xb325d3,_0x18fac3){const _0x517bff=a105_0x253d,_0x56d8d7=a105_0x292b54[_0x517bff(0x152)](_0x18fac3,_0xb325d3),_0x52e2df=_0x56d8d7!==''&&_0x56d8d7!=='.'&&!_0x56d8d7[_0x517bff(0x13c)]('..');return{'isScoped':_0x52e2df,'scopedFolderPath':_0x52e2df?_0x56d8d7['replace'](/\\/g,'/'):''};}export async function resolveTarget(_0x2be774){const _0xbedfbe=a105_0x253d,{arg:_0x3eb97b,contextParent:_0x32ff80,cwd:cwd=process[_0xbedfbe(0x15a)](),fs:fs=nodeFileSystem}=_0x2be774;if(_0x3eb97b&&isYamlFilePath(_0x3eb97b))try{const _0x429c45=await resolveYamlFilePath(_0x3eb97b,fs),_0x50caed=a105_0x292b54[_0xbedfbe(0x14c)](_0x3eb97b),_0x41e64a=a105_0x292b54[_0xbedfbe(0x13e)](_0x50caed),_0x5156a6=await findTdxConfigAsync(_0x41e64a,fs);if(!_0x5156a6){if(_0x32ff80){const _0x631d0e=a105_0x292b54[_0xbedfbe(0x13e)](_0x50caed);return{'type':_0xbedfbe(0x135),'parentName':_0x32ff80,'targetDir':_0x631d0e,'configRoot':_0x631d0e,'filePath':_0x50caed,'resourceName':_0x429c45['segmentName'],'folderPath':_0x429c45[_0xbedfbe(0x141)],'resourceType':_0x429c45[_0xbedfbe(0x149)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0xbedfbe(0x142),'errorCode':_0xbedfbe(0x13f),'message':_0xbedfbe(0x15d)+_0x3eb97b,'arg':_0x3eb97b,'helpText':_0xbedfbe(0x145)};}const _0x123f8d=calculateScopedPath(_0x41e64a,_0x5156a6['configDir']);return{'type':_0xbedfbe(0x135),'parentName':_0x5156a6[_0xbedfbe(0x134)],'targetDir':_0x5156a6[_0xbedfbe(0x12a)],'configRoot':_0x5156a6[_0xbedfbe(0x12a)],'filePath':_0x50caed,'resourceName':_0x429c45[_0xbedfbe(0x137)],'folderPath':_0x429c45[_0xbedfbe(0x141)],'resourceType':_0x429c45['resourceType'],'isScoped':_0x123f8d[_0xbedfbe(0x12d)],'scopedFolderPath':_0x123f8d['scopedFolderPath']};}catch(_0x42acd4){const _0x35954d=_0x42acd4 instanceof Error?_0x42acd4[_0xbedfbe(0x129)]:String(_0x42acd4);if(_0x35954d['includes']('File\x20not\x20found'))return{'type':'error','errorCode':_0xbedfbe(0x157),'message':_0xbedfbe(0x155)+_0x3eb97b,'arg':_0x3eb97b};if(_0x35954d[_0xbedfbe(0x15e)](_0xbedfbe(0x158))){if(_0x32ff80){const _0x4e9507=a105_0x292b54[_0xbedfbe(0x14c)](_0x3eb97b);if(await fs[_0xbedfbe(0x131)](_0x4e9507)){const _0x5e3a87=a105_0x292b54[_0xbedfbe(0x13e)](_0x4e9507),_0x18f730=await fs['readFile'](_0x4e9507),_0x29bf93=_0x18f730[_0xbedfbe(0x143)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x370b88=_0x18f730[_0xbedfbe(0x143)](/^type:\s*["']?([^"'\n]+)["']?/m),_0xbd3590=_0x29bf93?_0x29bf93[0x1][_0xbedfbe(0x140)]():a105_0x292b54[_0xbedfbe(0x156)](_0x3eb97b,a105_0x292b54[_0xbedfbe(0x12e)](_0x3eb97b)),_0x553514=_0x370b88&&_0x370b88[0x1]['trim']()==='journey'?'journey':_0xbedfbe(0x14e);return{'type':_0xbedfbe(0x135),'parentName':_0x32ff80,'targetDir':_0x5e3a87,'configRoot':_0x5e3a87,'filePath':_0x4e9507,'resourceName':_0xbd3590,'folderPath':'','resourceType':_0x553514,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0xbedfbe(0x13f),'message':_0xbedfbe(0x15d)+_0x3eb97b,'arg':_0x3eb97b,'helpText':_0xbedfbe(0x145)};}return{'type':_0xbedfbe(0x142),'errorCode':'invalid_yaml','message':_0x35954d,'arg':_0x3eb97b};}if(_0x3eb97b){const _0x2eb649=a105_0x292b54[_0xbedfbe(0x14c)](cwd,_0x3eb97b);let _0x47d649=null;try{_0x47d649=await fs[_0xbedfbe(0x133)](_0x2eb649);}catch{}if(_0x47d649?.[_0xbedfbe(0x12c)]()){const _0x1653f3=await findTdxConfigAsync(_0x2eb649,fs);if(_0x1653f3){const _0x271019=calculateScopedPath(_0x2eb649,_0x1653f3[_0xbedfbe(0x12a)]);return{'type':'directory','parentName':_0x1653f3[_0xbedfbe(0x134)],'targetDir':_0x2eb649,'configRoot':_0x1653f3['configDir'],'isScoped':_0x271019[_0xbedfbe(0x12d)],'scopedFolderPath':_0x271019[_0xbedfbe(0x153)]};}if(_0x32ff80)return{'type':_0xbedfbe(0x13a),'parentName':_0x32ff80,'targetDir':_0x2eb649,'configRoot':_0x2eb649,'isScoped':![],'scopedFolderPath':''};return{'type':_0xbedfbe(0x142),'errorCode':_0xbedfbe(0x13f),'message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x3eb97b,'arg':_0x3eb97b,'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'};}if(_0x47d649?.[_0xbedfbe(0x130)]())return{'type':_0xbedfbe(0x142),'errorCode':_0xbedfbe(0x14a),'message':_0xbedfbe(0x159)+_0x3eb97b,'arg':_0x3eb97b,'helpText':_0xbedfbe(0x148)};const _0x297fad=sanitizeFileName(_0x3eb97b),_0x49a4f8=getSegmentRootDir(_0x297fad,cwd);return{'type':_0xbedfbe(0x139),'parentName':_0x3eb97b,'targetDir':_0x49a4f8,'configRoot':_0x49a4f8};}const _0x18d845=await findTdxConfigAsync(cwd,fs);if(_0x18d845){const _0x425a4e=calculateScopedPath(cwd,_0x18d845[_0xbedfbe(0x12a)]);return{'type':'context','parentName':_0x18d845['parentSegment'],'targetDir':cwd,'configRoot':_0x18d845['configDir'],'isScoped':_0x425a4e[_0xbedfbe(0x12d)],'scopedFolderPath':_0x425a4e[_0xbedfbe(0x153)]};}if(_0x32ff80){const _0x143ab6=sanitizeFileName(_0x32ff80),_0x46ab15=getSegmentRootDir(_0x143ab6,cwd);return{'type':'context','parentName':_0x32ff80,'targetDir':_0x46ab15,'configRoot':_0x46ab15,'isScoped':![],'scopedFolderPath':''};}return{'type':_0xbedfbe(0x142),'errorCode':_0xbedfbe(0x14f),'message':'Parent\x20segment\x20not\x20specified','helpText':'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'};}function a105_0x1219(){const _0x29cbe7=['match','2lniohI','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','1641486vVNOAV','6bEbZay','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','resourceType','invalid_yaml','2340583GByLzc','resolve','join','segment','no_parent','string','156376ppsDsx','relative','scopedFolderPath','129440ScnroU','File\x20not\x20found:\x20','basename','file_not_found','No\x20tdx.json\x20found','Not\x20a\x20YAML\x20file:\x20','cwd','parent_segment','1694720WPxcAL','No\x20tdx.json\x20found\x20for\x20file:\x20','includes','message','configDir','160808SVwicn','isDirectory','isScoped','extname','638970iLSVGY','isFile','exists','parse','stat','parentSegment','file','220nkeIAe','segmentName','type','parent_name','directory','63DKaxeu','startsWith','context','dirname','no_config','trim','folderPath','error'];a105_0x1219=function(){return _0x29cbe7;};return a105_0x1219();}
@@ -1 +1 @@
1
- const a106_0x5c2305=a106_0x4f50;function a106_0x4f50(_0x41e292,_0x2c9625){_0x41e292=_0x41e292-0x6e;const _0xb27506=a106_0xb275();let _0x4f5073=_0xb27506[_0x41e292];return _0x4f5073;}(function(_0x33d400,_0x4960f2){const _0x5b7859=a106_0x4f50,_0x126719=_0x33d400();while(!![]){try{const _0x4323c5=-parseInt(_0x5b7859(0x7f))/0x1*(parseInt(_0x5b7859(0x89))/0x2)+parseInt(_0x5b7859(0x7a))/0x3+-parseInt(_0x5b7859(0x87))/0x4+parseInt(_0x5b7859(0x71))/0x5*(parseInt(_0x5b7859(0x82))/0x6)+parseInt(_0x5b7859(0x84))/0x7+-parseInt(_0x5b7859(0x7e))/0x8*(-parseInt(_0x5b7859(0x72))/0x9)+-parseInt(_0x5b7859(0x76))/0xa*(parseInt(_0x5b7859(0x7c))/0xb);if(_0x4323c5===_0x4960f2)break;else _0x126719['push'](_0x126719['shift']());}catch(_0x31f7de){_0x126719['push'](_0x126719['shift']());}}}(a106_0xb275,0x8c643));import{existsSync,readFileSync}from'fs';function a106_0xb275(){const _0x4904df=['tdx.json','resolve','cwd','7745530wHSQeu','stringify','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','utf-8','1576467OakOlE','join','11hgoNyD','object','5750224FfBGTF','1IxulSi','dirname','Invalid\x20JSON\x20in\x20','12IyZShS','replace','6272581TAdTUO','segments','relative','4063368VsAwjG','parent_segment','1803948DNJmIx','string','root','Invalid\x20tdx.json:\x20expected\x20object','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','parse','2817655tSgWNr','9uFFKgU'];a106_0xb275=function(){return _0x4904df;};return a106_0xb275();}import a106_0x4bc916 from'path';const TDX_CONFIG_FILE=a106_0x5c2305(0x73),SEGMENTS_DIR=a106_0x5c2305(0x85);export function findTdxConfigPath(_0x2348b9=process[a106_0x5c2305(0x75)]()){const _0x42ec4e=a106_0x5c2305;let _0x42bac9=a106_0x4bc916[_0x42ec4e(0x74)](_0x2348b9);const _0x2b434e=a106_0x4bc916[_0x42ec4e(0x70)](_0x42bac9)[_0x42ec4e(0x8b)];while(_0x42bac9!==_0x2b434e){const _0x50f96e=a106_0x4bc916[_0x42ec4e(0x7b)](_0x42bac9,TDX_CONFIG_FILE);if(existsSync(_0x50f96e))return _0x50f96e;_0x42bac9=a106_0x4bc916['dirname'](_0x42bac9);}return null;}export function loadTdxConfig(_0x1e8adb){const _0x37b6de=a106_0x5c2305,_0x256f6f=readFileSync(_0x1e8adb,_0x37b6de(0x79));let _0x2f0768;try{_0x2f0768=JSON['parse'](_0x256f6f);}catch{throw new Error(_0x37b6de(0x81)+_0x1e8adb);}if(!_0x2f0768||typeof _0x2f0768!==_0x37b6de(0x7d))throw new Error(_0x37b6de(0x6e));const _0x4556a7=_0x2f0768;if(!_0x4556a7[_0x37b6de(0x88)]||typeof _0x4556a7['parent_segment']!==_0x37b6de(0x8a))throw new Error(_0x37b6de(0x6f));return{'parent_segment':_0x4556a7[_0x37b6de(0x88)]};}export function findTdxConfig(_0x5971a8=process[a106_0x5c2305(0x75)]()){const _0x23bd66=a106_0x5c2305,_0x3a52b9=findTdxConfigPath(_0x5971a8);if(!_0x3a52b9)throw new Error(_0x23bd66(0x78));const _0x1f0c3b=loadTdxConfig(_0x3a52b9),_0x507981=a106_0x4bc916[_0x23bd66(0x80)](_0x3a52b9);return{'config':_0x1f0c3b,'configPath':_0x3a52b9,'configDir':_0x507981};}export function tryFindTdxConfig(_0x44a647){try{return findTdxConfig(_0x44a647);}catch{return null;}}export function getSegmentRootDir(_0x34b1e5,_0x11a13a=process[a106_0x5c2305(0x75)]()){const _0x2432c7=a106_0x5c2305;return a106_0x4bc916[_0x2432c7(0x7b)](_0x11a13a,SEGMENTS_DIR,_0x34b1e5);}export function getTdxConfigPath(_0x31786a,_0x194e04=process[a106_0x5c2305(0x75)]()){const _0x4fdeb8=a106_0x5c2305;return a106_0x4bc916[_0x4fdeb8(0x7b)](getSegmentRootDir(_0x31786a,_0x194e04),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x33f95b,_0x4ff544){const _0x51c6b8=a106_0x5c2305,_0x104f1c=a106_0x4bc916[_0x51c6b8(0x74)](_0x33f95b),_0x584a2b=a106_0x4bc916[_0x51c6b8(0x86)](_0x4ff544,_0x104f1c);if(_0x584a2b['startsWith']('..'))return'';return _0x584a2b;}export function localPathToTdFolderPath(_0x4b22cd){const _0x35188c=a106_0x5c2305,_0x1c4a18=a106_0x4bc916[_0x35188c(0x80)](_0x4b22cd);if(_0x1c4a18==='.'||_0x1c4a18==='')return'';return _0x1c4a18[_0x35188c(0x83)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x24c0f8,_0x33859d){const _0x466108=a106_0x5c2305;if(!_0x24c0f8)return _0x33859d;return a106_0x4bc916[_0x466108(0x7b)](_0x33859d,_0x24c0f8);}export function createTdxConfigContent(_0x55aa9b){const _0xd8d23d=a106_0x5c2305,_0x72ac26={'parent_segment':_0x55aa9b};return JSON[_0xd8d23d(0x77)](_0x72ac26,null,0x2)+'\x0a';}
1
+ function a106_0x282b(_0x97c6c4,_0x40a8a5){_0x97c6c4=_0x97c6c4-0x7f;const _0x3ab07b=a106_0x3ab0();let _0x282bd3=_0x3ab07b[_0x97c6c4];return _0x282bd3;}const a106_0x118396=a106_0x282b;function a106_0x3ab0(){const _0x38a809=['Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','resolve','join','tdx.json','1323gCyLxw','Invalid\x20JSON\x20in\x20','2727880oTsTef','stringify','Invalid\x20tdx.json:\x20expected\x20object','cwd','63AXBxdJ','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','330408ctkLOq','827800xQVXZh','1730hUGUKl','utf-8','630PsrpiK','dirname','startsWith','parent_segment','43029zzgzac','segments','1093530wPgHyL','2988170GyRYWC','parse','relative'];a106_0x3ab0=function(){return _0x38a809;};return a106_0x3ab0();}(function(_0x410efa,_0x4ad472){const _0x564436=a106_0x282b,_0xf323b5=_0x410efa();while(!![]){try{const _0x3b4fc1=parseInt(_0x564436(0x8e))/0x1+-parseInt(_0x564436(0x90))/0x2*(parseInt(_0x564436(0x86))/0x3)+parseInt(_0x564436(0x88))/0x4+-parseInt(_0x564436(0x7f))/0x5+-parseInt(_0x564436(0x98))/0x6+parseInt(_0x564436(0x8c))/0x7*(parseInt(_0x564436(0x8f))/0x8)+parseInt(_0x564436(0x96))/0x9*(-parseInt(_0x564436(0x92))/0xa);if(_0x3b4fc1===_0x4ad472)break;else _0xf323b5['push'](_0xf323b5['shift']());}catch(_0x116a1b){_0xf323b5['push'](_0xf323b5['shift']());}}}(a106_0x3ab0,0x75748));import{existsSync,readFileSync}from'fs';import a106_0x3dba07 from'path';const TDX_CONFIG_FILE=a106_0x118396(0x85),SEGMENTS_DIR=a106_0x118396(0x97);export function findTdxConfigPath(_0x511a11=process[a106_0x118396(0x8b)]()){const _0x25d100=a106_0x118396;let _0x4983ac=a106_0x3dba07[_0x25d100(0x83)](_0x511a11);const _0x52d327=a106_0x3dba07['parse'](_0x4983ac)['root'];while(_0x4983ac!==_0x52d327){const _0x1169b6=a106_0x3dba07[_0x25d100(0x84)](_0x4983ac,TDX_CONFIG_FILE);if(existsSync(_0x1169b6))return _0x1169b6;_0x4983ac=a106_0x3dba07['dirname'](_0x4983ac);}return null;}export function loadTdxConfig(_0x6398f9){const _0x2867de=a106_0x118396,_0x4c00b3=readFileSync(_0x6398f9,_0x2867de(0x91));let _0x31b959;try{_0x31b959=JSON[_0x2867de(0x80)](_0x4c00b3);}catch{throw new Error(_0x2867de(0x87)+_0x6398f9);}if(!_0x31b959||typeof _0x31b959!=='object')throw new Error(_0x2867de(0x8a));const _0x2dfecb=_0x31b959;if(!_0x2dfecb[_0x2867de(0x95)]||typeof _0x2dfecb[_0x2867de(0x95)]!=='string')throw new Error(_0x2867de(0x82));return{'parent_segment':_0x2dfecb['parent_segment']};}export function findTdxConfig(_0xef54d5=process[a106_0x118396(0x8b)]()){const _0x4d1d4c=a106_0x118396,_0x1ff61e=findTdxConfigPath(_0xef54d5);if(!_0x1ff61e)throw new Error(_0x4d1d4c(0x8d));const _0x211c9a=loadTdxConfig(_0x1ff61e),_0x45ef3e=a106_0x3dba07[_0x4d1d4c(0x93)](_0x1ff61e);return{'config':_0x211c9a,'configPath':_0x1ff61e,'configDir':_0x45ef3e};}export function tryFindTdxConfig(_0x575e20){try{return findTdxConfig(_0x575e20);}catch{return null;}}export function getSegmentRootDir(_0x221a80,_0x3609a6=process[a106_0x118396(0x8b)]()){const _0x24c360=a106_0x118396;return a106_0x3dba07[_0x24c360(0x84)](_0x3609a6,SEGMENTS_DIR,_0x221a80);}export function getTdxConfigPath(_0x3836f3,_0x4cda3a=process[a106_0x118396(0x8b)]()){const _0x5f908d=a106_0x118396;return a106_0x3dba07[_0x5f908d(0x84)](getSegmentRootDir(_0x3836f3,_0x4cda3a),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x181547,_0x36f5ad){const _0x25fc81=a106_0x118396,_0x249633=a106_0x3dba07[_0x25fc81(0x83)](_0x181547),_0x34682d=a106_0x3dba07[_0x25fc81(0x81)](_0x36f5ad,_0x249633);if(_0x34682d[_0x25fc81(0x94)]('..'))return'';return _0x34682d;}export function localPathToTdFolderPath(_0x1a94a0){const _0x40baab=a106_0x118396,_0x32316e=a106_0x3dba07[_0x40baab(0x93)](_0x1a94a0);if(_0x32316e==='.'||_0x32316e==='')return'';return _0x32316e['replace'](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x5b3373,_0x21faed){const _0x105b45=a106_0x118396;if(!_0x5b3373)return _0x21faed;return a106_0x3dba07[_0x105b45(0x84)](_0x21faed,_0x5b3373);}export function createTdxConfigContent(_0x453519){const _0x53c841=a106_0x118396,_0x267149={'parent_segment':_0x453519};return JSON[_0x53c841(0x89)](_0x267149,null,0x2)+'\x0a';}