@treasuredata/tdx 0.26.2 → 0.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-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/mcp-command.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/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/personalization.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/realtime.js +1 -1
  102. package/dist/sdk/schedule.js +1 -1
  103. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/fields-display.js +1 -1
  105. package/dist/sdk/segment/file-discovery.js +1 -1
  106. package/dist/sdk/segment/journey-utils.js +1 -1
  107. package/dist/sdk/segment/journey-validator.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-recovery.js +1 -1
  113. package/dist/sdk/segment/push-workflow.js +1 -1
  114. package/dist/sdk/segment/resolution-context.js +1 -1
  115. package/dist/sdk/segment/segment-path-parser.js +1 -1
  116. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  117. package/dist/sdk/segment/target-resolution.js +1 -1
  118. package/dist/sdk/segment/tdx-config.js +1 -1
  119. package/dist/sdk/segment/validate-files.js +1 -1
  120. package/dist/sdk/segment/yaml-validator.js +1 -1
  121. package/dist/sdk/segment.js +1 -1
  122. package/dist/sdk/types/index.js +1 -1
  123. package/dist/sdk/types/progress.js +1 -1
  124. package/dist/sdk/user.js +1 -1
  125. package/dist/sdk/util/format-detector.js +1 -1
  126. package/dist/sdk/util/formatters.js +1 -1
  127. package/dist/sdk/util/index.js +1 -1
  128. package/dist/sdk/util/tree-formatter.js +1 -1
  129. package/dist/sdk/workflow/archive-validation.js +1 -1
  130. package/dist/sdk/workflow/clone-workflow.js +1 -1
  131. package/dist/sdk/workflow/index.js +1 -1
  132. package/dist/sdk/workflow/pull-workflow.js +1 -1
  133. package/dist/sdk/workflow/push-workflow.js +1 -1
  134. package/dist/sdk/workflow/tdx-config.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js +1 -1
  136. package/dist/test-utils/command-runner.js +1 -1
  137. package/dist/test-utils/factories.js +1 -1
  138. package/dist/test-utils/fixtures.js +1 -1
  139. package/dist/test-utils/http-mock.js +1 -1
  140. package/dist/test-utils/index.js +1 -1
  141. package/dist/utils/async.js +1 -1
  142. package/dist/utils/colors.js +1 -1
  143. package/dist/utils/diff.js +1 -1
  144. package/dist/utils/file-permissions.js +1 -1
  145. package/dist/utils/global-cache.js +1 -1
  146. package/dist/utils/json-loader.js +1 -1
  147. package/dist/utils/local-cache.js +1 -1
  148. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  149. package/dist/utils/logger/formatters/index.js +1 -1
  150. package/dist/utils/logger/handlers/console-handler.js +1 -1
  151. package/dist/utils/logger/handlers/file-handler.js +1 -1
  152. package/dist/utils/logger/handlers/index.js +1 -1
  153. package/dist/utils/logger/handlers/null-handler.js +1 -1
  154. package/dist/utils/logger/index.js +1 -1
  155. package/dist/utils/logger/logger.js +1 -1
  156. package/dist/utils/logger/types.js +1 -1
  157. package/dist/utils/option-validation.js +1 -1
  158. package/dist/utils/port.js +1 -1
  159. package/dist/utils/process.js +1 -1
  160. package/dist/utils/prompt.js +1 -1
  161. package/dist/utils/spinner.js +1 -1
  162. package/dist/utils/sse-parser.js +1 -1
  163. package/dist/utils/string-utils.js +1 -1
  164. package/dist/utils/table-ref-parser.js +1 -1
  165. package/dist/utils/tdx-logger.js +1 -1
  166. package/dist/utils/version-check.js +1 -1
  167. package/package.json +1 -1
@@ -1 +1 @@
1
- const a114_0x3308e7=a114_0x3638;(function(_0x3a41b8,_0x1134a5){const _0x44da4d=a114_0x3638,_0x6655a=_0x3a41b8();while(!![]){try{const _0xe2d53c=-parseInt(_0x44da4d(0x1a3))/0x1*(parseInt(_0x44da4d(0x1a9))/0x2)+parseInt(_0x44da4d(0x1fa))/0x3+-parseInt(_0x44da4d(0x1de))/0x4+-parseInt(_0x44da4d(0x212))/0x5*(parseInt(_0x44da4d(0x136))/0x6)+-parseInt(_0x44da4d(0x1af))/0x7+parseInt(_0x44da4d(0x142))/0x8+-parseInt(_0x44da4d(0x219))/0x9*(-parseInt(_0x44da4d(0x181))/0xa);if(_0xe2d53c===_0x1134a5)break;else _0x6655a['push'](_0x6655a['shift']());}catch(_0x3ef0a6){_0x6655a['push'](_0x6655a['shift']());}}}(a114_0x59fa,0xeb325));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a114_0x3308e7(0x17a);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x4a6eb8){return''+PENDING_SEGMENT_PREFIX+_0x4a6eb8+'__';}export function isPendingSegmentId(_0x231525){const _0x2f5c4a=a114_0x3308e7;return _0x231525[_0x2f5c4a(0x1e6)](PENDING_SEGMENT_PREFIX)&&!_0x231525[_0x2f5c4a(0x1e6)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x31673a){const _0x15bfdf=a114_0x3308e7;return _0x31673a[_0x15bfdf(0x163)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x286407){return''+PENDING_ACTIVATION_PREFIX+_0x286407+'__';}export function isPendingActivationId(_0x3eeef1){const _0xbf3a2c=a114_0x3308e7;return _0x3eeef1[_0xbf3a2c(0x1e6)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xccf473){const _0x3b0448=a114_0x3308e7;return _0xccf473[_0x3b0448(0x163)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x280cb4,_0x3ec167){const _0x67faca=a114_0x3308e7,_0x22f91c=_0x280cb4+'::'+(_0x3ec167[_0x67faca(0x140)]()||_0x67faca(0x189)),_0x167087=createHash(_0x67faca(0x209))[_0x67faca(0x1b2)](_0x22f91c)['digest'](_0x67faca(0x1d1))[_0x67faca(0x1eb)](0x0,0xc);return'journey_entry_criteria_'+_0x167087;}export function ensureJourneyDefaults(_0x4b12b9){const _0x28ed05=a114_0x3308e7;!_0x4b12b9['description']&&(_0x4b12b9[_0x28ed05(0x1e1)]=''),!_0x4b12b9[_0x28ed05(0x21b)]&&(_0x4b12b9['state']=_0x28ed05(0x1d0));}export function resolveTDFolderPath(_0x353d40,_0x34448a,_0x173416){const _0x1b9149=a114_0x3308e7;if(!_0x34448a)return _0x353d40;if(_0x353d40===_0x173416||_0x353d40[_0x1b9149(0x1e6)](_0x173416+'/'))return _0x353d40;return _0x353d40?_0x173416+'/'+_0x353d40:_0x173416;}export function addFoldersToCreate(_0x94ea4a,_0x11d165,_0x2ffa5f){const _0x585562=a114_0x3308e7;if(!_0x94ea4a)return;if(_0x11d165[_0x585562(0x16c)](_0x94ea4a))return;const _0x3bdcf1=_0x94ea4a[_0x585562(0x154)]('/');let _0x51e610='';for(const _0x298d9c of _0x3bdcf1){_0x51e610=_0x51e610?_0x51e610+'/'+_0x298d9c:_0x298d9c,!_0x11d165[_0x585562(0x16c)](_0x51e610)&&_0x2ffa5f[_0x585562(0x21e)](_0x51e610);}}import*as a114_0x4e4e82 from'yaml';import{readFileSync}from'fs';import a114_0x3befe2 from'path';import{isJourneyDef,parseYamlString as a114_0x393e31,toYamlString as a114_0x4663c6,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{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x393ac4){const _0x3bc687=a114_0x3308e7;if(Array[_0x3bc687(0x19c)](_0x393ac4))return'['+_0x393ac4[_0x3bc687(0x224)](_0x2e8bca=>stableStringify(_0x2e8bca))['join'](',')+']';if(_0x393ac4&&typeof _0x393ac4==='object'){const _0x4e04f5=_0x393ac4,_0x3a57e5=Object[_0x3bc687(0x150)](_0x4e04f5)[_0x3bc687(0x14a)](),_0x1534ee=_0x3a57e5[_0x3bc687(0x224)](_0x87fc03=>'\x22'+_0x87fc03+'\x22:'+stableStringify(_0x4e04f5[_0x87fc03]));return'{'+_0x1534ee[_0x3bc687(0x1ad)](',')+'}';}const _0x611f7a=JSON[_0x3bc687(0x1d8)](_0x393ac4);return _0x611f7a===undefined?'null':_0x611f7a;}function activationSignature(_0x29a543){const _0x4fb5b2=a114_0x3308e7,_0x13cd71={'connection':_0x29a543[_0x4fb5b2(0x1f5)],..._0x29a543['all_columns']!==undefined&&{'all_columns':_0x29a543[_0x4fb5b2(0x1cd)]},..._0x29a543[_0x4fb5b2(0x174)]!==undefined&&{'columns':_0x29a543[_0x4fb5b2(0x174)]},..._0x29a543['behavior']!==undefined&&{'behavior':_0x29a543[_0x4fb5b2(0x18d)]},..._0x29a543[_0x4fb5b2(0x1a7)]!==undefined&&{'schedule':_0x29a543['schedule']},..._0x29a543[_0x4fb5b2(0x227)]!==undefined&&{'notification':_0x29a543[_0x4fb5b2(0x227)]},..._0x29a543[_0x4fb5b2(0x217)]!==undefined&&{'connector_config':_0x29a543[_0x4fb5b2(0x217)]},..._0x29a543[_0x4fb5b2(0x1bf)]!==undefined&&{'activation_template_id':_0x29a543[_0x4fb5b2(0x1bf)]}};return stableStringify(_0x13cd71);}async function fetchSegment(_0x1cf38a,_0x1f4fae,_0x45741d,_0x170cd9){const _0x34d995=a114_0x3308e7,_0x585b6f=_0x170cd9?.[_0x34d995(0x17f)](_0x2f4cca=>_0x2f4cca['id']===_0x45741d);if(_0x585b6f)return _0x585b6f;try{return await _0x1cf38a[_0x34d995(0x189)][_0x34d995(0x13f)](_0x1f4fae,_0x45741d);}catch(_0x18aa0d){logger['debug'](_0x34d995(0x183)+_0x45741d+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x18aa0d);try{return await _0x1cf38a[_0x34d995(0x189)][_0x34d995(0x1a0)](_0x45741d);}catch(_0x413495){return logger[_0x34d995(0x1ac)](_0x34d995(0x20d)+_0x45741d+':\x20'+_0x413495),null;}}}function recoverSegmentIdsFromPushRecovery(_0x5cf7a3,_0x5594b9,_0x4ddc95){const _0x1a5250=a114_0x3308e7,_0x13602e=readPushRecovery(_0x5cf7a3[_0x1a5250(0x149)]);if(_0x13602e?.[_0x1a5250(0x19a)]===_0x5cf7a3[_0x1a5250(0x225)][_0x1a5250(0x158)])for(const [_0x36bac9,_0x1c5223]of Object[_0x1a5250(0x173)](_0x13602e['segments'])){const _0x38ae48=generateDeterministicJourneySegmentName(_0x5cf7a3[_0x1a5250(0x225)][_0x1a5250(0x158)],_0x36bac9);_0x1c5223[_0x1a5250(0x197)]===_0x38ae48&&(_0x5594b9[_0x1a5250(0x17d)](_0x36bac9,_0x1c5223['segmentId']),_0x4ddc95[_0x1a5250(0x17d)](_0x36bac9,_0x1c5223[_0x1a5250(0x138)]));}}async function createOrRecoverEmbeddedSegment(_0x3b2407,_0x4ebc9f,_0x5168e2,_0x1fa0ac){const _0xb62d3d=a114_0x3308e7;let _0x52ef44;try{_0x52ef44=await _0x3b2407[_0xb62d3d(0x189)]['createJourneySegment']({'name':_0x5168e2[_0xb62d3d(0x148)],'description':_0x5168e2['description'],'journeyId':_0x5168e2[_0xb62d3d(0x1b0)],'rule':_0x1fa0ac(_0x5168e2[_0xb62d3d(0x16e)],!![]),'countPopulation':!![],'parentFolderId':_0x5168e2[_0xb62d3d(0x1e7)],'audienceId':_0x5168e2[_0xb62d3d(0x143)]});}catch(_0x5d6fe2){const _0x424d24=_0x5d6fe2 instanceof Error&&_0x5d6fe2[_0xb62d3d(0x159)][_0xb62d3d(0x206)](_0xb62d3d(0x16f));if(_0x424d24){const _0xb1dd46=readPushRecovery(_0x4ebc9f[_0xb62d3d(0x149)]),_0x515a58=_0xb1dd46?.[_0xb62d3d(0x19a)]===_0x4ebc9f[_0xb62d3d(0x225)][_0xb62d3d(0x158)]?_0xb1dd46[_0xb62d3d(0x1c6)][_0x5168e2[_0xb62d3d(0x166)]]:undefined;if(_0x515a58?.[_0xb62d3d(0x197)]===_0x5168e2['uniqueSegmentName'])await _0x3b2407[_0xb62d3d(0x189)]['updateSegmentById'](_0x5168e2[_0xb62d3d(0x143)],_0x515a58['segmentId'],{'description':_0x5168e2[_0xb62d3d(0x1e1)],'rule':_0x1fa0ac(_0x5168e2[_0xb62d3d(0x16e)],!![]),'countPopulation':!![]}),_0x52ef44=_0x515a58[_0xb62d3d(0x138)];else throw new SDKError(ErrorCode[_0xb62d3d(0x1a2)],_0xb62d3d(0x164)+_0x5168e2['localName']+_0xb62d3d(0x156)+(_0xb62d3d(0x20c)+_0x4ebc9f[_0xb62d3d(0x149)]['replace'](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x5d6fe2);}else throw _0x5d6fe2;}return saveSegmentToPushRecovery(_0x4ebc9f['absolutePath'],_0x4ebc9f[_0xb62d3d(0x225)]['name'],_0x5168e2['localName'],{'segmentId':_0x52ef44,'uniqueServerName':_0x5168e2[_0xb62d3d(0x148)],'createdAt':new Date()[_0xb62d3d(0x1b5)]()}),_0x52ef44;}export async function prepareSegmentFiles(_0x5f21ca,_0x3966c7,_0x9f8819,_0x26dc1f,_0x417f72){const _0x1a1f62=a114_0x3308e7,{activationDefToCreateRequest:_0x5e00bd}=await import(_0x1a1f62(0x1d4)),_0x2196c0=[],_0x300d36=new Set();for(const {yamlConfig:_0xb8833d,folderPath:_0x42cfcd,sourcePath:_0x3f7db9}of _0x5f21ca){const _0x55f1b6=resolveTDFolderPath(_0x42cfcd,_0x26dc1f,_0x417f72),_0x8ead01=_0x55f1b6+':'+_0xb8833d['name'],_0x1e1864=_0x3966c7['segmentByFolderAndName']['get'](_0x8ead01),_0x320a9d=_0x1e1864?_0x3966c7[_0x1a1f62(0x20b)][_0x1a1f62(0x175)](_0x1e1864['id'])||[]:[];addFoldersToCreate(_0x55f1b6,_0x3966c7[_0x1a1f62(0x13e)],_0x300d36);const _0x284673=calculateActivationActions(_0xb8833d[_0x1a1f62(0x12e)]||[],_0x320a9d,_0x3966c7['idToEmailMap'],_0x3966c7[_0x1a1f62(0x178)]);for(const _0x3efd75 of _0x284673){(_0x3efd75[_0x1a1f62(0x177)]===_0x1a1f62(0x1c3)||_0x3efd75[_0x1a1f62(0x177)]==='update')&&_0x3efd75[_0x1a1f62(0x179)]&&(_0x3efd75['validatedRequest']=await _0x5e00bd(_0x3efd75[_0x1a1f62(0x179)],_0x9f8819));}const _0x154f54=calculateSegmentDiff(_0xb8833d,_0x1e1864,_0x320a9d,_0x3966c7['idToEmailMap'],_0x3966c7[_0x1a1f62(0x178)]);_0x2196c0['push']({'relativePath':_0xb8833d[_0x1a1f62(0x158)],'absolutePath':_0x3f7db9,'yamlConfig':_0xb8833d,'folderPath':_0x55f1b6,'existingSegment':_0x1e1864,'existingActivations':_0x320a9d,'isNew':_0x154f54[_0x1a1f62(0x207)],'hasChanges':_0x154f54['hasChanges'],'diff':_0x154f54[_0x1a1f62(0x226)],'activationActions':_0x284673});}return{'segmentFiles':_0x2196c0,'foldersToCreate':_0x300d36};}export async function prepareJourneyFiles(_0x6a7d96,_0x2d1f45,_0x3961ec,_0x4cec2e){const _0x2dd29e=a114_0x3308e7,_0xf87917=[],_0x54c106=new Set();for(const {yamlConfig:_0x35704a,folderPath:_0x21466c,sourcePath:_0x6bdd89}of _0x6a7d96){const _0x3d8ceb=resolveTDFolderPath(_0x21466c,_0x3961ec,_0x4cec2e),_0x186f02=_0x3d8ceb+':'+_0x35704a[_0x2dd29e(0x158)],_0x25dc85=_0x2d1f45[_0x2dd29e(0x19b)][_0x2dd29e(0x175)](_0x186f02);let _0x48887d,_0x37ce75;if(_0x25dc85&&_0x25dc85['length']>0x0){const _0x142517=buildLocalExpandedRuleMappings(_0x35704a),{createYamlContext:_0x3a0ad7,prefetchJourneySegments:_0x572547}=createPushYamlContextForBundle(_0x2d1f45[_0x2dd29e(0x204)],_0x2d1f45[_0x2dd29e(0x143)],_0x2d1f45[_0x2dd29e(0x1ba)],_0x142517,_0x2d1f45[_0x2dd29e(0x1a4)],_0x2d1f45['connectionIdToNameMap'],_0x2d1f45[_0x2dd29e(0x155)],_0x2d1f45[_0x2dd29e(0x199)]);await _0x572547(_0x25dc85[_0x2dd29e(0x224)](_0x5d568c=>_0x5d568c['id']));const _0x3b37b6=hasMultipleVersions(_0x35704a),_0x2d6471=async _0x1e61f4=>{const _0x46b899=_0x2dd29e,_0x200c1e=_0x2d1f45[_0x46b899(0x199)]?.[_0x46b899(0x175)](_0x1e61f4);if(_0x200c1e)return _0x200c1e;return _0x2d1f45[_0x46b899(0x13a)]({'journeyId':_0x1e61f4,'journeyName':_0x35704a[_0x46b899(0x158)],'isMultiVersion':_0x25dc85[_0x46b899(0x1c9)]>0x1});};if(_0x3b37b6&&_0x25dc85['length']>0x1){const _0x1c9495=[];for(const _0x2b7aaf of _0x25dc85){const _0x479ffd=_0x2b7aaf['versionNumber']||0x1;_0x2d1f45[_0x2dd29e(0x1ed)]?.[_0x2dd29e(0x1b2)](_0x2dd29e(0x1bc)+_0x35704a['name']+'\x20v'+_0x479ffd);const _0x855d43=await _0x2d6471(_0x2b7aaf['id']),_0x24a533=_0x3a0ad7(_0x2b7aaf['id']),_0x5a87c6=await journeyResponseToDef(_0x855d43,_0x24a533);_0x1c9495[_0x2dd29e(0x21a)]({'item':_0x2b7aaf,'yaml':_0x5a87c6});}const _0x35a62e=buildLocalRuleToNameMappingFromJourney(_0x35704a);_0x37ce75=buildMergedJourneyDef(_0x1c9495,_0x35a62e);const _0x3f6142=Math['max'](..._0x1c9495[_0x2dd29e(0x224)](_0x447093=>_0x447093['item'][_0x2dd29e(0x196)]||0x0)),_0x2bc940=_0x25dc85[_0x2dd29e(0x17f)](_0x4ef002=>(_0x4ef002[_0x2dd29e(0x196)]||0x0)===_0x3f6142);_0x2bc940&&(_0x2d1f45[_0x2dd29e(0x1ed)]?.[_0x2dd29e(0x1b2)](_0x2dd29e(0x1bc)+_0x35704a[_0x2dd29e(0x158)]+'\x20v'+_0x3f6142),_0x48887d=await _0x2d6471(_0x2bc940['id']));}else{const _0x635c27=_0x25dc85[_0x25dc85[_0x2dd29e(0x1c9)]-0x1];_0x2d1f45[_0x2dd29e(0x1ed)]?.['update'](_0x2dd29e(0x1bc)+_0x35704a[_0x2dd29e(0x158)]),_0x48887d=await _0x2d6471(_0x635c27['id']);const _0x4118b2=_0x3a0ad7(_0x635c27['id']),_0x314cad=await journeyResponseToDef(_0x48887d,_0x4118b2),_0x42154d=buildLocalRuleToNameMappingFromJourney(_0x35704a);_0x37ce75=buildMergedJourneyDef([{'item':_0x635c27,'yaml':_0x314cad}],_0x42154d);}}addFoldersToCreate(_0x3d8ceb,_0x2d1f45[_0x2dd29e(0x13e)],_0x54c106);const _0x584830=calculateJourneyDiff(_0x35704a,_0x37ce75);_0xf87917['push']({'relativePath':_0x35704a[_0x2dd29e(0x158)],'absolutePath':_0x6bdd89,'yamlConfig':_0x35704a,'folderPath':_0x3d8ceb,'existingJourney':_0x48887d,'isNew':_0x584830[_0x2dd29e(0x207)],'hasChanges':_0x584830[_0x2dd29e(0x1b7)],'diff':_0x584830[_0x2dd29e(0x226)]});}return{'journeyFiles':_0xf87917,'foldersToCreate':_0x54c106};}export function calculateActivationActions(_0x333558,_0x4c3283,_0x343169,_0x20a31f){const _0x2300c9=a114_0x3308e7,_0x771131=[],_0x31fe26=new Map();for(const _0x210dd7 of _0x4c3283){_0x31fe26['set'](_0x210dd7[_0x2300c9(0x158)],_0x210dd7);}const _0x88819e=new Map();for(const _0x321138 of _0x333558){_0x88819e[_0x2300c9(0x17d)](_0x321138[_0x2300c9(0x158)],_0x321138);}for(const _0x2e3754 of _0x333558){const _0x4cb543=_0x31fe26[_0x2300c9(0x175)](_0x2e3754[_0x2300c9(0x158)]);if(!_0x4cb543)_0x771131[_0x2300c9(0x21a)]({'type':_0x2300c9(0x1c3),'name':_0x2e3754[_0x2300c9(0x158)],'yamlActivation':_0x2e3754});else{const _0x35e1c1=activationResponseToDef(_0x4cb543,_0x343169,_0x20a31f),_0x5b9cc3=a114_0x4e4e82[_0x2300c9(0x1d8)](_0x35e1c1),_0x4d7911=a114_0x4e4e82['stringify'](_0x2e3754);_0x5b9cc3!==_0x4d7911&&_0x771131['push']({'type':_0x2300c9(0x1b2),'name':_0x2e3754[_0x2300c9(0x158)],'yamlActivation':_0x2e3754,'existingActivation':_0x4cb543});}}for(const _0x542ac0 of _0x4c3283){!_0x88819e['has'](_0x542ac0['name'])&&_0x771131['push']({'type':_0x2300c9(0x223),'name':_0x542ac0[_0x2300c9(0x158)],'existingActivation':_0x542ac0});}return _0x771131;}function calculateYamlDiff(_0x5f501a,_0x490344){if(_0x490344){const _0x1941ad=generateDiff(_0x490344,_0x5f501a),_0xbc1b84=hasChanges(_0x1941ad);return{'isNew':![],'hasChanges':_0xbc1b84,'diff':_0xbc1b84?formatDiffWithColors(_0x1941ad):undefined};}const _0x22e144=generateDiff('',_0x5f501a);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x22e144)};}export function calculateSegmentDiff(_0xee0cb2,_0x2b2908,_0x301703,_0x50ab78,_0x196cb4){const _0x1e552f=segmentToYamlString(_0xee0cb2),_0x41aef6=_0x2b2908?segmentToYamlString(segmentWithActivationsToYaml(_0x2b2908,_0x301703,undefined,_0x50ab78,_0x196cb4)):undefined;return calculateYamlDiff(_0x1e552f,_0x41aef6);}export function calculateJourneyDiff(_0x422618,_0x219a3a){const _0x48ea1a=normalizeJourneyDef(_0x422618,_0x422618),_0x1c7ac5=a114_0x4663c6(_0x48ea1a),_0x300835=_0x219a3a?a114_0x4663c6(normalizeJourneyDef(_0x219a3a,_0x422618)):undefined;return calculateYamlDiff(_0x1c7ac5,_0x300835);}export function findSegmentsToDelete(_0x21169d,_0x21d4e6,_0x299129,_0x35128c,_0x220f93){const _0x1f215a=a114_0x3308e7,_0x52c9b1=new Set();for(const {yamlConfig:_0x328762,folderPath:_0xeade3b}of _0x21d4e6){_0x52c9b1[_0x1f215a(0x21e)](_0xeade3b+':'+_0x328762[_0x1f215a(0x158)]);}return _0x21169d[_0x1f215a(0x1bd)](_0x57cd34=>{const _0x3b467e=_0x1f215a,_0x5c091e=_0x57cd34['segmentFolderId']?_0x299129[_0x3b467e(0x175)](_0x57cd34['segmentFolderId'][_0x3b467e(0x17c)]())||'':'',_0x1ae460=_0x5c091e+':'+_0x57cd34[_0x3b467e(0x158)];if(_0x52c9b1[_0x3b467e(0x16c)](_0x1ae460))return![];if(_0x220f93)return _0x5c091e===_0x35128c||_0x5c091e['startsWith'](_0x35128c+'/');return!![];});}export function findJourneysToDelete(_0x55d72f,_0x5a8840,_0x17e86d,_0x5b58c9,_0x2f57f7){const _0x2d3a5e=a114_0x3308e7,_0x3ec8e5=new Set();for(const {yamlConfig:_0x48a46d,folderPath:_0x1c5e8a}of _0x5a8840){_0x3ec8e5[_0x2d3a5e(0x21e)](_0x1c5e8a+':'+_0x48a46d[_0x2d3a5e(0x158)]);}return _0x55d72f['filter'](_0x1cb8d9=>{const _0x5a65da=_0x2d3a5e,_0x581dcc=_0x1cb8d9[_0x5a65da(0x1e7)]?_0x17e86d[_0x5a65da(0x175)](_0x1cb8d9[_0x5a65da(0x1e7)])||'':'',_0x281917=_0x581dcc+':'+_0x1cb8d9[_0x5a65da(0x200)];if(_0x3ec8e5[_0x5a65da(0x16c)](_0x281917))return![];if(_0x2f57f7)return _0x581dcc===_0x5b58c9||_0x581dcc[_0x5a65da(0x1e6)](_0x5b58c9+'/');return!![];});}export function buildSegmentLookupMap(_0xab3c66,_0x566940){const _0x5868f4=a114_0x3308e7,_0x55f6ef=new Map();for(const _0x2998d8 of _0xab3c66){const _0x41e26f=_0x2998d8[_0x5868f4(0x1c4)]?_0x566940['get'](_0x2998d8[_0x5868f4(0x1c4)]['toString']())||'':'',_0x36470a=_0x41e26f+':'+_0x2998d8['name'];_0x55f6ef[_0x5868f4(0x17d)](_0x36470a,_0x2998d8);}return _0x55f6ef;}export function buildSegmentNameToIdMap(_0x432f29){const _0x155d72=a114_0x3308e7,_0x2bd57b=new Map();for(const _0x1db75d of _0x432f29){_0x2bd57b['set'](_0x1db75d[_0x155d72(0x158)],_0x1db75d['id']);}return _0x2bd57b;}export function buildJourneyBundleLookupMap(_0x131a53,_0x1fd072){const _0x7a911a=a114_0x3308e7,_0x1d07f0=new Map();for(const _0x338c46 of _0x131a53){const _0x250b1c=_0x338c46[_0x7a911a(0x1e7)]?_0x1fd072[_0x7a911a(0x175)](_0x338c46[_0x7a911a(0x1e7)])||'':'',_0x352ad3=_0x250b1c+':'+_0x338c46[_0x7a911a(0x200)];!_0x1d07f0[_0x7a911a(0x16c)](_0x352ad3)&&_0x1d07f0[_0x7a911a(0x17d)](_0x352ad3,[]),_0x1d07f0[_0x7a911a(0x175)](_0x352ad3)[_0x7a911a(0x21a)](_0x338c46);}for(const _0x290d65 of _0x1d07f0[_0x7a911a(0x1d2)]()){_0x290d65[_0x7a911a(0x14a)]((_0x28ac60,_0x367988)=>(_0x28ac60[_0x7a911a(0x196)]||0x0)-(_0x367988[_0x7a911a(0x196)]||0x0));}return _0x1d07f0;}function a114_0x3638(_0x40afbb,_0x21efc4){_0x40afbb=_0x40afbb-0x12c;const _0x59faa2=a114_0x59fa();let _0x36385d=_0x59faa2[_0x40afbb];return _0x36385d;}export function collectFoldersToCreate(_0x561b6a,_0x4118cb){const _0x4fd919=a114_0x3308e7,_0xfc4392=new Set();for(const _0x56b9e3 of _0x561b6a){if(!_0x56b9e3)continue;if(_0x4118cb[_0x4fd919(0x16c)](_0x56b9e3))continue;const _0x2acd0f=_0x56b9e3['split']('/');let _0x3f40f7='';for(const _0x42f4ec of _0x2acd0f){_0x3f40f7=_0x3f40f7?_0x3f40f7+'/'+_0x42f4ec:_0x42f4ec,!_0x4118cb[_0x4fd919(0x16c)](_0x3f40f7)&&_0xfc4392[_0x4fd919(0x21e)](_0x3f40f7);}}return _0xfc4392;}export function parseAndClassifyYamlFiles(_0x42c66b,_0x34b85e,_0x48ef97){const _0x4fda3d=a114_0x3308e7,_0x3668a0=[],_0x582e70=[];for(const _0x348003 of _0x42c66b){const _0x2b8620=a114_0x3befe2['relative'](_0x34b85e,a114_0x3befe2[_0x4fda3d(0x182)](_0x348003)),_0x252415=_0x2b8620==='.'?'':_0x2b8620,_0x115c0f=readFileSync(_0x348003,'utf-8'),_0x4c9398=a114_0x4e4e82['parse'](_0x115c0f);if(isJourneyDef(_0x4c9398)){const _0x1c85a9=a114_0x393e31(_0x115c0f);_0x582e70['push']({'yamlConfig':_0x1c85a9,'folderPath':_0x252415,'sourcePath':_0x348003});}else{if(!_0x48ef97?.[_0x4fda3d(0x1f9)]){const _0x1249de=parseSegmentYamlFile(_0x115c0f),_0xce8205=normalizeChildSegmentYaml(_0x1249de);_0x3668a0['push']({'yamlConfig':_0xce8205,'folderPath':_0x252415,'sourcePath':_0x348003});}}}return{'segments':_0x3668a0,'journeys':_0x582e70};}export function validateParsedFiles(_0x2e0d44,_0x5375b4){const _0x4f4bb5=a114_0x3308e7,_0x31bfae=[];for(const {yamlConfig:_0x2e0ff9,sourcePath:_0x22b479}of _0x2e0d44[_0x4f4bb5(0x1c6)]){const _0x38c398=readFileSync(_0x22b479,_0x4f4bb5(0x12c)),_0x2a2bc7=a114_0x4e4e82[_0x4f4bb5(0x14e)](_0x38c398),_0x3490d6=validateSegmentDef(_0x2e0ff9,{'source':_0x38c398,'document':_0x2a2bc7});if(!_0x3490d6['valid']){const _0x424854=a114_0x3befe2[_0x4f4bb5(0x186)](_0x5375b4,_0x22b479);_0x31bfae[_0x4f4bb5(0x21a)]({'filePath':_0x424854,'source':_0x38c398,'result':_0x3490d6,'isJourney':![]});}}for(const {yamlConfig:_0x20932c,sourcePath:_0x2bb3eb}of _0x2e0d44[_0x4f4bb5(0x134)]){const _0x239c9c=readFileSync(_0x2bb3eb,_0x4f4bb5(0x12c)),_0x229887=a114_0x4e4e82[_0x4f4bb5(0x14e)](_0x239c9c),_0xe72ae2=validateJourneyDef(_0x20932c,{'source':_0x239c9c,'document':_0x229887});if(!_0xe72ae2[_0x4f4bb5(0x172)]){const _0x3f7a3f=a114_0x3befe2[_0x4f4bb5(0x186)](_0x5375b4,_0x2bb3eb);_0x31bfae['push']({'filePath':_0x3f7a3f,'source':_0x239c9c,'result':_0xe72ae2,'isJourney':!![]});}}return _0x31bfae;}export function formatValidationErrors(_0x37f0d6){const _0x3d0101=a114_0x3308e7,_0x1d3912=[];for(const {filePath:_0x46faed,source:_0x343618,result:_0x1c064c,isJourney:_0x182dcf}of _0x37f0d6){const _0x45faf3=_0x182dcf?'journey':_0x3d0101(0x189);_0x1d3912[_0x3d0101(0x21a)]('\x0a'+_0x46faed+'\x20('+_0x45faf3+_0x3d0101(0x17e)+_0x1c064c[_0x3d0101(0x20a)][_0x3d0101(0x1c9)]+_0x3d0101(0x139)),_0x1d3912[_0x3d0101(0x21a)](formatValidationResult(_0x1c064c,_0x343618,_0x46faed));}return _0x1d3912['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x3b061b){const _0x427e20=a114_0x3308e7,_0x95dc8b=new Set(),_0x27045d=new Map(),_0x43b7fc=collectSegmentUsageCounts(_0x3b061b);if(_0x3b061b[_0x427e20(0x1c6)])for(const [_0x152709,_0x3ed063]of Object[_0x427e20(0x173)](_0x3b061b[_0x427e20(0x1c6)])){_0x95dc8b[_0x427e20(0x21e)](_0x152709);if(_0x3ed063['rule']){const _0x4f6b81=yamlRuleToApi(_0x3ed063[_0x427e20(0x1f2)]),_0xc3b456=apiRuleToYaml(_0x4f6b81);_0x27045d[_0x427e20(0x17d)](_0x152709,_0xc3b456);}}const _0x53f139=new Map();let _0x349775=0x0;for(const [_0xb0873d,_0xd0fdd3]of _0x27045d){const _0x1c07d6=serializeExpandedRule(_0xd0fdd3,_0x27045d),_0x398d40=_0x53f139['get'](_0x1c07d6)||[];_0x398d40['push']({'name':_0xb0873d,'index':_0x349775}),_0x53f139[_0x427e20(0x17d)](_0x1c07d6,_0x398d40),_0x349775++;}const _0x21bf95=new Map();for(const [_0x283fc5,_0x15c1d9]of _0x53f139){const _0x385665=_0x15c1d9['slice']()['sort']((_0x3209f8,_0x2c6a9f)=>{const _0x3292d7=_0x427e20,_0x592eb3=_0x43b7fc[_0x3292d7(0x175)](_0x3209f8[_0x3292d7(0x158)])||0x0,_0x27fc5d=_0x43b7fc[_0x3292d7(0x175)](_0x2c6a9f[_0x3292d7(0x158)])||0x0;if(_0x592eb3!==_0x27fc5d)return _0x27fc5d-_0x592eb3;return _0x3209f8['index']-_0x2c6a9f[_0x3292d7(0x16b)];})['map'](_0x420610=>_0x420610[_0x427e20(0x158)]),_0x3d57aa=[];for(const _0x22e1a9 of _0x385665){const _0x500500=_0x43b7fc[_0x427e20(0x175)](_0x22e1a9)||0x0,_0x7b7943=Math[_0x427e20(0x187)](_0x500500,0x1);for(let _0x49572f=0x0;_0x49572f<_0x7b7943;_0x49572f++){_0x3d57aa['push'](_0x22e1a9);}}_0x21bf95['set'](_0x283fc5,_0x3d57aa);}return{'existingLocalSegmentNames':_0x95dc8b,'localSegmentRules':_0x27045d,'localExpandedRuleToNames':_0x21bf95};}export function createSegmentIdResolver(_0x400dbb,_0x1dc074){return async _0x12a516=>{const _0x1d3111=a114_0x3638,_0x13df0c=_0x400dbb['get'](_0x12a516);if(!_0x13df0c)throw new SDKError(ErrorCode[_0x1d3111(0x1b8)],_0x1d3111(0x1cb)+_0x12a516+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x1dc074+'\x27)');return _0x13df0c;};}export function extractRootFolderId(_0x482c5c){const _0x5ce790=a114_0x3308e7;return _0x482c5c['relationships']?.['parentSegmentFolder']?.[_0x5ce790(0x1ca)]?.['id']||_0x482c5c['relationships']?.[_0x5ce790(0x171)]?.['data']?.['id'];}export function buildConnectionMaps(_0x2a0e51){const _0xa2d493=a114_0x3308e7,_0x3ec1d8=new Map(),_0x468c04=new Map(),_0x26ad12=new Map();for(const _0x56708a of _0x2a0e51){_0x3ec1d8[_0xa2d493(0x17d)](_0x56708a[_0xa2d493(0x158)],parseInt(_0x56708a['id'],0xa)),_0x468c04[_0xa2d493(0x17d)](_0x56708a['id'],_0x56708a[_0xa2d493(0x158)]),_0x26ad12['set'](_0x56708a[_0xa2d493(0x158)],_0x56708a['type']);}return{'nameToId':_0x3ec1d8,'idToName':_0x468c04,'nameToType':_0x26ad12};}export function calculatePushStats(_0x524054,_0x2f2db2,_0x3c1981,_0x511e87,_0x4c6938,_0x1bf792,_0xeed3ae){const _0x3923d3=a114_0x3308e7,_0x40e2d2=_0x524054[_0x3923d3(0x1bd)](_0x1e89f5=>_0x1e89f5[_0x3923d3(0x207)]),_0x3c6632=_0x524054[_0x3923d3(0x1bd)](_0x4dae87=>!_0x4dae87['isNew']&&_0x4dae87[_0x3923d3(0x1b7)]),_0x408efe=_0x524054[_0x3923d3(0x1bd)](_0x5e0e50=>!_0x5e0e50[_0x3923d3(0x207)]&&!_0x5e0e50['hasChanges']),_0x246eb5=_0x1bf792?_0x511e87:[],_0x238596=_0x2f2db2[_0x3923d3(0x1bd)](_0x5ef2eb=>_0x5ef2eb['isNew']),_0x76867b=_0x2f2db2[_0x3923d3(0x1bd)](_0x44ad80=>!_0x44ad80[_0x3923d3(0x207)]&&_0x44ad80[_0x3923d3(0x1b7)]),_0x3f78c9=_0x2f2db2['filter'](_0x4c0828=>!_0x4c0828[_0x3923d3(0x207)]&&!_0x4c0828[_0x3923d3(0x1b7)]),_0x236ece=_0x1bf792?_0x4c6938:[],_0x25b453=_0x524054[_0x3923d3(0x1e5)](_0x3d06ab=>_0x3d06ab[_0x3923d3(0x132)]),_0x378e4d=_0x25b453[_0x3923d3(0x1bd)](_0x3c16db=>_0x3c16db[_0x3923d3(0x177)]===_0x3923d3(0x1c3)),_0x327828=_0x25b453[_0x3923d3(0x1bd)](_0x1b36e0=>_0x1b36e0['type']==='update'),_0x2dfbbc=_0x25b453[_0x3923d3(0x1bd)](_0x3ccf9=>_0x3ccf9[_0x3923d3(0x177)]==='delete'),_0xfb3222=Array[_0x3923d3(0x1e0)](_0x3c1981)[_0x3923d3(0x14a)](),_0x2f993a=_0xeed3ae?![]:_0x40e2d2[_0x3923d3(0x1c9)]>0x0||_0x3c6632[_0x3923d3(0x1c9)]>0x0||_0x246eb5[_0x3923d3(0x1c9)]>0x0,_0x182a15=_0x238596[_0x3923d3(0x1c9)]>0x0||_0x76867b[_0x3923d3(0x1c9)]>0x0||_0x236ece[_0x3923d3(0x1c9)]>0x0,_0x255985=_0xeed3ae?![]:_0x25b453[_0x3923d3(0x1c9)]>0x0,_0x1b72e1=_0xfb3222[_0x3923d3(0x1c9)]>0x0;return{'segments':{'new':_0x40e2d2,'changed':_0x3c6632,'unchanged':_0x408efe,'toDelete':_0x246eb5},'journeys':{'new':_0x238596,'changed':_0x76867b,'unchanged':_0x3f78c9,'toDelete':_0x236ece},'activations':{'all':_0x25b453,'toCreate':_0x378e4d,'toUpdate':_0x327828,'toDelete':_0x2dfbbc},'folders':{'toCreate':_0xfb3222},'counts':{'segments':{'new':_0x40e2d2['length'],'changed':_0x3c6632[_0x3923d3(0x1c9)],'unchanged':_0x408efe[_0x3923d3(0x1c9)],'toDelete':_0x246eb5['length']},'journeys':{'new':_0x238596['length'],'changed':_0x76867b[_0x3923d3(0x1c9)],'unchanged':_0x3f78c9['length'],'toDelete':_0x236ece[_0x3923d3(0x1c9)]},'activations':{'create':_0x378e4d['length'],'update':_0x327828[_0x3923d3(0x1c9)],'delete':_0x2dfbbc[_0x3923d3(0x1c9)]},'folders':_0xfb3222[_0x3923d3(0x1c9)]},'hasChanges':_0x2f993a||_0x182a15||_0x255985||_0x1b72e1};}export async function buildPushExecutionContext(_0x18ea79,_0x5ef354,_0x3e7bf2,_0x4e637b,_0x274b89,_0x18f480){const _0x595f3f=a114_0x3308e7,_0xd01d70=extractRootFolderId(_0x3e7bf2),{pathToId:_0x514fc6,idToPath:_0x10eb7f}=buildFolderMaps(_0x274b89),_0x4aed25=buildSegmentNameToIdMap(_0x4e637b),_0x5a7c9c=new Map(),{batchAsync:_0x29c1ba}=await import(_0x595f3f(0x18f)),[_0x2c5f09,_0x43d08d]=await Promise[_0x595f3f(0x18b)]([_0x18ea79[_0x595f3f(0x1fd)][_0x595f3f(0x13b)](),_0x18ea79[_0x595f3f(0x1f5)][_0x595f3f(0x161)](),((async()=>{const _0x3bd540=_0x595f3f;!_0x18f480&&_0x4e637b[_0x3bd540(0x1c9)]>0x0&&await _0x29c1ba(_0x4e637b,async _0x11c6a6=>{const _0x9fed3d=_0x3bd540,_0x35987d=await _0x18ea79[_0x9fed3d(0x189)][_0x9fed3d(0x1e4)](_0x5ef354,_0x11c6a6['id']);_0x5a7c9c[_0x9fed3d(0x17d)](_0x11c6a6['id'],_0x35987d);});})())]),{emailToId:_0x2c746d,idToEmail:_0x4574c8}=_0x2c5f09,_0x33e816=buildConnectionMaps(_0x43d08d);return{'rootFolderId':_0xd01d70,'folderPathToId':_0x514fc6,'folderIdToPath':_0x10eb7f,'segmentNameToId':_0x4aed25,'activationsBySegmentId':_0x5a7c9c,'emailToIdMap':_0x2c746d,'idToEmailMap':_0x4574c8,'connectionNameToIdMap':_0x33e816[_0x595f3f(0x1be)],'connectionIdToNameMap':_0x33e816[_0x595f3f(0x15b)],'connectionNameToTypeMap':_0x33e816['nameToType']};}export function createPushYamlContextForBundle(_0x3a0ce8,_0x4e0b7a,_0x24f2a9,_0x20963f,_0x40a91a,_0xe9d29c,_0x3ca230,_0xf5de41){const {existingLocalSegmentNames:_0x489788,localExpandedRuleToNames:_0x66d47e}=_0x20963f,_0x173946=new Set(),_0x539691=new Map(),_0x28193a=new Map(),_0x10c7fc=new Map(),_0x41ad19=createJumpTargetCache(),_0x41ce51=new Map(),_0x51e85=new Map(),_0x377cc2=new Set();let _0x26398e;const _0x2782c1=_0x4969f3=>{const _0x3a5b89={'resolveSegment':async _0x24e806=>{const _0x6a5bb2=a114_0x3638,_0x2c7bbc=_0x10c7fc['get'](_0x24e806);if(_0x2c7bbc!==undefined)return{'name':_0x2c7bbc,'isJourneyLocal':!![]};try{const _0x1bcbde=await fetchSegment(_0x3a0ce8,_0x4e0b7a,_0x24e806,_0x24f2a9);if(!_0x1bcbde)throw new Error('Segment\x20not\x20found');const _0x1931ad=generateJourneyLocalName(_0x1bcbde[_0x6a5bb2(0x158)]),_0x22d5b6=_0x1bcbde[_0x6a5bb2(0x1fc)]===SEGMENT_KIND_JOURNEY&&_0x1931ad!==undefined;let _0x2a3a52=_0x1bcbde[_0x6a5bb2(0x158)],_0x1182d5;if(_0x22d5b6&&_0x1bcbde[_0x6a5bb2(0x1f2)]){const _0x3cca6c=apiRuleToYaml(_0x1bcbde[_0x6a5bb2(0x1f2)]);_0x51e85[_0x6a5bb2(0x17d)](_0x24e806,_0x3cca6c);const _0x2c5d5e=async _0x7f598d=>{const _0x58e9ff=_0x6a5bb2,_0x513992=collectSegmentRefsFromRule(_0x7f598d);for(const _0x3afe8c of _0x513992){if(!_0x51e85[_0x58e9ff(0x16c)](_0x3afe8c))try{const _0x436c05=await fetchSegment(_0x3a0ce8,_0x4e0b7a,_0x3afe8c,_0x24f2a9);if(_0x436c05?.[_0x58e9ff(0x1f2)]){const _0x17b556=apiRuleToYaml(_0x436c05[_0x58e9ff(0x1f2)]);_0x51e85[_0x58e9ff(0x17d)](_0x3afe8c,_0x17b556),await _0x2c5d5e(_0x17b556);}}catch(_0x383bbc){logger['debug'](_0x58e9ff(0x1ec)+_0x3afe8c+':\x20'+_0x383bbc);}}};await _0x2c5d5e(_0x3cca6c);const _0x316ab0=serializeExpandedRule(_0x3cca6c,_0x51e85),_0x3df320=_0x66d47e[_0x6a5bb2(0x175)](_0x316ab0);if(_0x3df320&&_0x3df320[_0x6a5bb2(0x1c9)]>0x0){const _0x24e239=_0x539691[_0x6a5bb2(0x175)](_0x316ab0)||0x0,_0x334efb=_0x3df320[_0x24e239]||_0x3df320[_0x3df320['length']-0x1];_0x539691[_0x6a5bb2(0x17d)](_0x316ab0,_0x24e239+0x1),_0x2a3a52=_0x334efb,_0x173946[_0x6a5bb2(0x21e)](_0x2a3a52),_0x10c7fc[_0x6a5bb2(0x17d)](_0x24e806,_0x2a3a52);const _0x5cb058=await resolveRuleSegmentRefs(_0x3cca6c,async _0x33fc89=>{const _0x54086e=_0x6a5bb2,_0x574d55=_0x10c7fc[_0x54086e(0x175)](_0x33fc89);if(_0x574d55)return _0x574d55;const _0x1f068f=await _0x26398e['resolveSegment'](_0x33fc89);return _0x1f068f['name'];});_0x1182d5={'description':_0x1bcbde[_0x6a5bb2(0x1e1)],'rule':_0x5cb058};}else{const _0x3aebc2=_0x41ce51['get'](_0x316ab0);if(_0x3aebc2)_0x2a3a52=_0x3aebc2,_0x10c7fc[_0x6a5bb2(0x17d)](_0x24e806,_0x2a3a52);else{if(_0x1931ad){let _0x5c819f=_0x1931ad,_0x5e387c=0x2;while(_0x173946[_0x6a5bb2(0x16c)](_0x5c819f)||_0x489788[_0x6a5bb2(0x16c)](_0x5c819f)){_0x5c819f=_0x1931ad+'_'+_0x5e387c,_0x5e387c++;}_0x173946[_0x6a5bb2(0x21e)](_0x5c819f),_0x2a3a52=_0x5c819f;}_0x10c7fc['set'](_0x24e806,_0x2a3a52),_0x41ce51['set'](_0x316ab0,_0x2a3a52);const _0x14ff1d=await resolveRuleSegmentRefs(_0x3cca6c,async _0xf754b0=>{const _0x47d707=_0x6a5bb2,_0x79b621=_0x10c7fc[_0x47d707(0x175)](_0xf754b0);if(_0x79b621)return _0x79b621;const _0xed806f=await _0x26398e[_0x47d707(0x220)](_0xf754b0);return _0xed806f[_0x47d707(0x158)];});_0x1182d5={'description':_0x1bcbde[_0x6a5bb2(0x1e1)],'rule':_0x14ff1d};}}}return{'name':_0x2a3a52,'isJourneyLocal':_0x22d5b6,'definition':_0x1182d5};}catch(_0x14c1ed){return logger[_0x6a5bb2(0x1ac)](_0x6a5bb2(0x1e2)+_0x24e806+':\x20'+_0x14c1ed),{'name':_0x24e806,'isJourneyLocal':![]};}},'resolveActivation':async _0xd9276e=>{const _0x419fd0=a114_0x3638,_0x53451a=_0x28193a[_0x419fd0(0x175)](_0xd9276e);if(_0x53451a!==undefined)return{'name':_0x53451a,'isJourneyLocal':!![]};try{let _0x2606dc=_0x3ca230?.[_0x419fd0(0x175)](_0xd9276e);!_0x2606dc&&(_0x2606dc=await _0x3a0ce8[_0x419fd0(0x190)]['getActivation'](_0x4969f3,_0xd9276e));const _0x1299ff=_0x2606dc[_0x419fd0(0x13c)]['activationParams']['name']||_0xd9276e,_0x34ec63=sanitizeYamlKey(_0x1299ff)||_0x419fd0(0x1fe)+_0xd9276e,_0x5eddcc=_0x34ec63;_0x28193a[_0x419fd0(0x17d)](_0xd9276e,_0x5eddcc);const _0xa939f2=journeyActivationStepToYaml(_0x2606dc,_0x40a91a,_0xe9d29c);return{'name':_0x5eddcc,'isJourneyLocal':!![],'definition':_0xa939f2};}catch(_0x230e82){return logger['debug'](_0x419fd0(0x222)+_0xd9276e+':\x20'+_0x230e82),{'name':_0xd9276e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5ea45a,_0x5d4355)=>resolveJumpTarget(_0x5ea45a,_0x5d4355,_0x41ad19,async _0x239a7b=>{const _0x30caa7=a114_0x3638,_0x13532d=_0xf5de41?.[_0x30caa7(0x175)](_0x239a7b);if(_0x13532d)return _0x13532d;return _0x3a0ce8[_0x30caa7(0x190)][_0x30caa7(0x1d6)](_0x239a7b);})};return _0x26398e=_0x3a5b89,_0x3a5b89;},_0x1df952=async _0x498b38=>{const _0x1259c7=a114_0x3638,{collectSegmentIdsFromJourneyApi:_0x77da1b}=await import(_0x1259c7(0x12f)),{batchAsync:_0x5611d3}=await import(_0x1259c7(0x18f)),_0x575f5c=new Set();for(const _0x364f82 of _0x498b38){let _0x5af40b=_0xf5de41?.[_0x1259c7(0x175)](_0x364f82);!_0x5af40b&&(_0x5af40b=await _0x3a0ce8[_0x1259c7(0x190)][_0x1259c7(0x1d6)](_0x364f82));const _0x5a271f=_0x77da1b(_0x5af40b);for(const _0x26f776 of _0x5a271f){_0x575f5c[_0x1259c7(0x21e)](_0x26f776);}}let _0x5bceab=Array[_0x1259c7(0x1e0)](_0x575f5c);while(_0x5bceab[_0x1259c7(0x1c9)]>0x0){const _0x111317=_0x5bceab[_0x1259c7(0x1bd)](_0xaec1a7=>!_0x377cc2[_0x1259c7(0x16c)](_0xaec1a7));if(_0x111317['length']===0x0)break;const _0x1cd13f=await _0x5611d3(_0x111317,async _0x2c15aa=>{const _0x44aab2=_0x1259c7;_0x377cc2[_0x44aab2(0x21e)](_0x2c15aa);const _0x5cb81a=await fetchSegment(_0x3a0ce8,_0x4e0b7a,_0x2c15aa,_0x24f2a9);if(!_0x5cb81a)return null;return{'segmentId':_0x2c15aa,'segment':_0x5cb81a};},0xa),_0x1cb88b=new Set();for(const _0x5b0fbc of _0x1cd13f){if(!_0x5b0fbc?.[_0x1259c7(0x189)]?.['rule'])continue;const _0x45e7e4=apiRuleToYaml(_0x5b0fbc[_0x1259c7(0x189)][_0x1259c7(0x1f2)]);_0x51e85[_0x1259c7(0x17d)](_0x5b0fbc[_0x1259c7(0x138)],_0x45e7e4);const _0x55bf65=collectSegmentRefsFromRule(_0x45e7e4);for(const _0x577201 of _0x55bf65){!_0x377cc2[_0x1259c7(0x16c)](_0x577201)&&_0x1cb88b[_0x1259c7(0x21e)](_0x577201);}}_0x5bceab=Array[_0x1259c7(0x1e0)](_0x1cb88b);}};return{'createYamlContext':_0x2782c1,'prefetchJourneySegments':_0x1df952};}export async function executePushSegments(_0x44064f,_0x10be76,_0xed2899,_0xc46c2f,_0x93b685){const _0x37f33f=a114_0x3308e7,{segmentDefToCreateRequest:_0x35eec0,segmentDefToUpdateRequest:_0x339175}=await import(_0x37f33f(0x1d4)),_0x54a9ac=_0xed2899[_0x37f33f(0x13e)],_0x19d748=0x5,_0x44c67d=async _0x180dab=>{const _0x448cc5=_0x37f33f,_0x56e950=_0x180dab[_0x448cc5(0x13d)]?_0x54a9ac[_0x448cc5(0x175)](_0x180dab[_0x448cc5(0x13d)]):undefined;let _0xff0d2b;const _0x1c5302={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x180dab[_0x448cc5(0x207)]){_0x93b685[_0x448cc5(0x1fb)]?.({'type':_0x448cc5(0x1a5),'name':_0x180dab['yamlConfig'][_0x448cc5(0x158)]});const _0xbf8417=_0x35eec0(_0x180dab[_0x448cc5(0x225)],_0x56e950),_0x49310c=await _0x93b685[_0x448cc5(0x167)](_0x448cc5(0x1f4)+_0x180dab[_0x448cc5(0x225)][_0x448cc5(0x158)]+_0x448cc5(0x14f),()=>_0x44064f[_0x448cc5(0x189)][_0x448cc5(0x1d3)](_0xc46c2f['parentId'],_0xbf8417));_0xff0d2b=_0x49310c[_0x448cc5(0x1ca)]['id'],_0x1c5302[_0x448cc5(0x205)]={'name':_0x180dab[_0x448cc5(0x225)]['name'],'id':_0xff0d2b},_0x93b685[_0x448cc5(0x1fb)]?.({'type':_0x448cc5(0x1db),'name':_0x180dab['yamlConfig'][_0x448cc5(0x158)],'segmentId':_0xff0d2b}),_0x93b685['logSuccess']?.(_0x448cc5(0x1bb)+_0x180dab['yamlConfig'][_0x448cc5(0x158)]+'\x27'),_0x1c5302[_0x448cc5(0x1aa)]=0x1;}else{if(_0x180dab[_0x448cc5(0x1b7)]){_0x93b685['onProgress']?.({'type':_0x448cc5(0x1cf),'name':_0x180dab[_0x448cc5(0x225)][_0x448cc5(0x158)]});const _0x212276=_0x339175(_0x180dab[_0x448cc5(0x225)]);_0x56e950!==_0x180dab['existingSegment']?.[_0x448cc5(0x1c4)]&&(_0x212276[_0x448cc5(0x1c4)]=_0x56e950?parseInt(_0x56e950,0xa):undefined),await _0x93b685[_0x448cc5(0x167)](_0x448cc5(0x15a)+_0x180dab[_0x448cc5(0x225)][_0x448cc5(0x158)]+_0x448cc5(0x14f),()=>_0x44064f[_0x448cc5(0x189)]['updateSegmentById'](_0xc46c2f['parentId'],_0x180dab['existingSegment']['id'],_0x212276)),_0xff0d2b=_0x180dab[_0x448cc5(0x216)]['id'],_0x93b685[_0x448cc5(0x1fb)]?.({'type':_0x448cc5(0x18a),'name':_0x180dab['yamlConfig'][_0x448cc5(0x158)]}),_0x93b685['logSuccess']?.(_0x448cc5(0x1ab)+_0x180dab[_0x448cc5(0x225)][_0x448cc5(0x158)]+'\x27'),_0x1c5302['updated']=0x1;}else _0xff0d2b=_0x180dab['existingSegment']['id'];}}catch(_0x31f637){const _0x4ca49a=isHttp400Error(_0x31f637),_0x64efed=_0x4ca49a?ErrorCode[_0x448cc5(0x1e9)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x5f1a3d=getErrorMessage(_0x31f637);throw new SDKError(_0x64efed,'Failed\x20to\x20'+(_0x180dab[_0x448cc5(0x207)]?'create':_0x448cc5(0x1b2))+_0x448cc5(0x1b9)+_0x180dab[_0x448cc5(0x149)]+_0x448cc5(0x144)+_0x5f1a3d,_0x31f637);}try{const _0x22ca98=await syncActivationsForSegment(_0x44064f,_0xc46c2f[_0x448cc5(0x143)],_0xff0d2b,_0x180dab[_0x448cc5(0x225)]['name'],_0x180dab[_0x448cc5(0x132)],_0x93b685,_0x180dab[_0x448cc5(0x149)]);_0x1c5302[_0x448cc5(0x12e)]=_0x22ca98;}catch(_0x4901a8){if(_0x4901a8 instanceof SDKError)throw _0x4901a8;throw new SDKError(ErrorCode[_0x448cc5(0x1b3)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x180dab['yamlConfig'][_0x448cc5(0x158)]+_0x448cc5(0x135)+_0x180dab[_0x448cc5(0x149)]+_0x448cc5(0x144)+getErrorMessage(_0x4901a8),_0x4901a8);}return _0x1c5302;},_0x5e5cde=await batchAsync(_0x10be76,_0x44c67d,_0x19d748),_0x123652={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4b7be5 of _0x5e5cde){_0x123652['created']+=_0x4b7be5['created'],_0x123652[_0x37f33f(0x162)]+=_0x4b7be5[_0x37f33f(0x162)],_0x4b7be5[_0x37f33f(0x205)]&&_0x123652[_0x37f33f(0x21d)][_0x37f33f(0x17d)](_0x4b7be5[_0x37f33f(0x205)][_0x37f33f(0x158)],_0x4b7be5[_0x37f33f(0x205)]['id']),_0x123652[_0x37f33f(0x12e)]['created']+=_0x4b7be5[_0x37f33f(0x12e)][_0x37f33f(0x1aa)],_0x123652[_0x37f33f(0x12e)][_0x37f33f(0x162)]+=_0x4b7be5[_0x37f33f(0x12e)][_0x37f33f(0x162)],_0x123652[_0x37f33f(0x12e)][_0x37f33f(0x192)]+=_0x4b7be5[_0x37f33f(0x12e)][_0x37f33f(0x192)];}return _0x123652;}function a114_0x59fa(){const _0x45bf8f=['folder_created','Created\x20activation\x20\x27','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','versionNumber','uniqueServerName','stage\x20\x27','journeyById','journeyName','journeyBundlesByFolderAndName','isArray','day','createFolder','embedded_segment_creating','getSegmentEntity','branches','SEGMENT_UPDATE_ERROR','49699Quupda','idToEmailMap','segment_creating','entry','schedule','activationContext','34QWULBc','created','Updated\x20segment\x20\x27','debug','join','activation_creating','4535538PdtAWj','journeyId','\x20activation\x20\x27','update','ACTIVATION_UPDATE_ERROR','run_after_journey_refresh','toISOString','activation_created','hasChanges','SEGMENT_NOT_FOUND','\x20segment\x20from\x20file:\x20','existingSegments','Created\x20segment\x20\x27','Fetching\x20','filter','nameToId','activation_template_id','deleteActivation','conditionTimeoutUnit','Journey\x20\x27','create','segmentFolderId','\x27\x20wait\x20condition','segments','journey_created','JOURNEY_UPDATE_ERROR','length','data','Segment\x20not\x20found:\x20','embeddedSegmentNameToId','all_columns','logDeleted','segment_updating','draft','hex','values','createSegment','./child-segment-yaml.js','steps','getJourney','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','stringify','relationships','existingJourney','segment_created','parse','size','7634960WKcsVY','conditions','from','description','Failed\x20to\x20resolve\x20segment\x20','\x27\x20milestone','listActivations','flatMap','startsWith','folderId','embedded_segment_created','SEGMENT_SYNTAX_ERROR','journeyActivationNameToId','slice','Failed\x20to\x20fetch\x20referenced\x20segment\x20','progress','logInfo','stages','waitStepUnit','Condition','rule','results','Creating\x20segment\x20\x27','connection','waitStep','\x27\x20decision\x20point\x20branch\x20\x27','DecisionPoint','skipSegments','224139IZniio','onProgress','kind','user','activation_','rootFolderId','journeyBundleName','embedded_activation_creating','activation_updating','waitStepType','deps','createdSegmentId','includes','isNew','Updated\x20journey\x20\x27','sha1','errors','activationsBySegmentId','Delete\x20the\x20push\x20recovery\x20file\x20(','getSegmentEntity\x20also\x20failed\x20for\x20','segment_deleting','\x20(referenced\x20in\x20journey\x20','effectiveFolderId','\x27\x20exit\x20criteria','5OVnClX','entryCriteria','conditionTimeoutDuration','unchanged','existingSegment','connector_config','journeyActivationStepId','1071otmFgN','push','state','Stage\x20\x27','createdSegmentIds','add','WaitStep','resolveSegment','milestone','Failed\x20to\x20resolve\x20activation\x20','delete','map','yamlConfig','diff','notification','utf-8','segmentNameToId','activations','./journey-yaml.js','Deleted\x20segment\x20\x27','some','activationActions','Created\x20journey\x20\x27','journeys','\x27\x20from\x20file:\x20','11127954NPbwmp','Activation\x20not\x20found:\x20','segmentId','\x20error(s)','fetchJourney','buildUserMaps','attributes','folderPath','folderPathToId','getSegment','trim','embedded_activation_created','11831976czYeWG','parentId','\x0a\x20\x20','logSuccess','activation_updated','Deleting\x20activation\x20\x27','uniqueSegmentName','absolutePath','sort','Duration','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','exitCriterias','parseDocument','\x27...','keys','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','segment_deleted','conditionSegmentId','split','activationStepsById','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','createActivation','name','message','Updating\x20segment\x20\x27','idToName','journey_updating','resolveJourneyId','Created\x20folder\x20\x27','decision_point','existingActivation','list','updated','replace','Embedded\x20segment\x20\x27','Updating\x20activation\x20\x27','localName','withProgress','NOT_FOUND','Activation','folder','index','has','validatedRequest','resolvedRule','Name\x20has\x20already\x20been\x20taken','Failed\x20to\x20','parentFolder','valid','entries','columns','get','INTERNAL','type','connectionIdToNameMap','yamlActivation','__pending_','Creating\x20activation\x20\x27','toString','set','):\x20','find','Entry\x20criteria:\x20','392090duZuOC','dirname','getSegment\x20failed\x20for\x20','toLowerCase','with','relative','max','entry_criteria','segment','segment_updated','all','\x27\x20entry\x20criteria','behavior','action','../../utils/async.js','journey','goal','deleted'];a114_0x59fa=function(){return _0x45bf8f;};return a114_0x59fa();}async function syncActivationsForSegment(_0x4cd9ac,_0x133391,_0x1b27b3,_0x454f05,_0x49aa5b,_0x1c2591,_0x146c25){const _0xa209a5=a114_0x3308e7,_0x555592={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3247d5 of _0x49aa5b){try{if(_0x3247d5['type']===_0xa209a5(0x1c3)&&_0x3247d5[_0xa209a5(0x16d)])_0x1c2591[_0xa209a5(0x1fb)]?.({'type':_0xa209a5(0x1ae),'segmentName':_0x454f05,'activationName':_0x3247d5[_0xa209a5(0x158)]}),await _0x1c2591['withProgress'](_0xa209a5(0x17b)+_0x3247d5[_0xa209a5(0x158)]+_0xa209a5(0x14f),()=>_0x4cd9ac['segment']['createActivation'](_0x133391,_0x1b27b3,_0x3247d5[_0xa209a5(0x16d)])),_0x1c2591[_0xa209a5(0x1fb)]?.({'type':_0xa209a5(0x1b6),'segmentName':_0x454f05,'activationName':_0x3247d5[_0xa209a5(0x158)]}),_0x1c2591[_0xa209a5(0x145)]?.(_0xa209a5(0x194)+_0x3247d5[_0xa209a5(0x158)]+'\x27'),_0x555592[_0xa209a5(0x1aa)]++;else{if(_0x3247d5['type']===_0xa209a5(0x1b2)&&_0x3247d5[_0xa209a5(0x16d)]&&_0x3247d5[_0xa209a5(0x160)])_0x1c2591[_0xa209a5(0x1fb)]?.({'type':_0xa209a5(0x202),'segmentName':_0x454f05,'activationName':_0x3247d5['name']}),await _0x1c2591['withProgress'](_0xa209a5(0x165)+_0x3247d5['name']+_0xa209a5(0x14f),()=>_0x4cd9ac['segment']['updateActivation'](_0x133391,_0x1b27b3,_0x3247d5[_0xa209a5(0x160)]['id'],_0x3247d5['validatedRequest'])),_0x1c2591[_0xa209a5(0x1fb)]?.({'type':_0xa209a5(0x146),'segmentName':_0x454f05,'activationName':_0x3247d5[_0xa209a5(0x158)]}),_0x1c2591[_0xa209a5(0x145)]?.('Updated\x20activation\x20\x27'+_0x3247d5[_0xa209a5(0x158)]+'\x27'),_0x555592[_0xa209a5(0x162)]++;else _0x3247d5[_0xa209a5(0x177)]===_0xa209a5(0x223)&&_0x3247d5[_0xa209a5(0x160)]&&(_0x1c2591[_0xa209a5(0x1fb)]?.({'type':'activation_deleting','segmentName':_0x454f05,'activationName':_0x3247d5[_0xa209a5(0x158)]}),await _0x1c2591[_0xa209a5(0x167)](_0xa209a5(0x147)+_0x3247d5['name']+_0xa209a5(0x14f),()=>_0x4cd9ac[_0xa209a5(0x189)][_0xa209a5(0x1c0)](_0x133391,_0x1b27b3,_0x3247d5[_0xa209a5(0x160)]['id'])),_0x1c2591[_0xa209a5(0x1fb)]?.({'type':'activation_deleted','segmentName':_0x454f05,'activationName':_0x3247d5['name']}),_0x1c2591[_0xa209a5(0x1ce)]?.('Deleted\x20activation\x20\x27'+_0x3247d5[_0xa209a5(0x158)]+'\x27'),_0x555592[_0xa209a5(0x192)]++);}}catch(_0x35dd59){const _0x1fafec=isHttp400Error(_0x35dd59),_0x1c11bf=_0x1fafec?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0xa209a5(0x1b3)],_0x59984c=getErrorMessage(_0x35dd59);throw new SDKError(_0x1c11bf,_0xa209a5(0x170)+_0x3247d5['type']+_0xa209a5(0x1b1)+_0x3247d5['name']+_0xa209a5(0x135)+_0x146c25+_0xa209a5(0x144)+_0x59984c,_0x35dd59);}}return _0x555592;}export async function executePushFolders(_0x4d06fb,_0x4954f6,_0x26d587,_0x405165,_0x5010e9){const _0x30a4dc=a114_0x3308e7,_0x3c0cd1=new Map(_0x26d587);for(const _0x4d4f87 of _0x4954f6){const _0x1f4e81=_0x4d4f87[_0x30a4dc(0x154)]('/'),_0x1f8468=_0x1f4e81[_0x1f4e81['length']-0x1],_0x593b2f=_0x1f4e81[_0x30a4dc(0x1eb)](0x0,-0x1)['join']('/'),_0x4fefd4=_0x3c0cd1['get'](_0x593b2f);_0x5010e9['onProgress']?.({'type':'folder_creating','folder':_0x4d4f87});const _0x38fe64={'name':_0x1f8468,'parentFolderId':_0x4fefd4},_0x295ac8=await _0x5010e9['withProgress']('Creating\x20folder\x20\x27'+_0x4d4f87+_0x30a4dc(0x14f),()=>_0x4d06fb[_0x30a4dc(0x189)][_0x30a4dc(0x19e)](_0x405165[_0x30a4dc(0x143)],_0x38fe64));_0x3c0cd1[_0x30a4dc(0x17d)](_0x4d4f87,_0x295ac8[_0x30a4dc(0x1ca)]['id']),_0x5010e9[_0x30a4dc(0x1fb)]?.({'type':_0x30a4dc(0x193),'folder':_0x4d4f87,'folderId':_0x295ac8[_0x30a4dc(0x1ca)]['id']}),_0x5010e9[_0x30a4dc(0x1ee)]?.(_0x30a4dc(0x15e)+_0x4d4f87+'\x27');}return _0x3c0cd1;}export async function executePushSegmentDeletions(_0x2eada5,_0x2be90a,_0x493a88){const _0x3a05c0=a114_0x3308e7;if(_0x2be90a[_0x3a05c0(0x1c9)]===0x0)return 0x0;const {batchAsync:_0x45df7e}=await import(_0x3a05c0(0x18f)),_0xbe4675=0x5,_0x3ba078=await _0x45df7e(_0x2be90a,async _0x553ee4=>{const _0x3744dd=_0x3a05c0;return _0x493a88[_0x3744dd(0x1fb)]?.({'type':_0x3744dd(0x20e),'name':_0x553ee4[_0x3744dd(0x158)]}),await _0x2eada5['segment']['deleteSegment'](_0x553ee4['id']),_0x493a88[_0x3744dd(0x1fb)]?.({'type':_0x3744dd(0x152),'name':_0x553ee4['name']}),_0x493a88[_0x3744dd(0x1ce)]?.(_0x3744dd(0x130)+_0x553ee4['name']+'\x27'),0x1;},_0xbe4675);return _0x3ba078['reduce']((_0x11c4e8,_0xa17cb)=>_0x11c4e8+_0xa17cb,0x0);}export async function executePushJourneys(_0x3d4f53,_0x385691,_0x46537b,_0x47a19c,_0x290f6d){const _0x389b0c=a114_0x3308e7,{journeyDefToRequest:_0x49f632}=await import(_0x389b0c(0x12f)),{activationDefToCreateRequest:_0x46ae6c,yamlRuleToApi:_0x435d89,validateSegmentRule:_0x26b15d}=await import(_0x389b0c(0x1d4)),_0x88d3c7={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5949c5=new Map(_0x46537b[_0x389b0c(0x12d)]),_0x723a05=0x5;for(let _0x5588b5=0x0;_0x5588b5<_0x385691[_0x389b0c(0x1c9)];_0x5588b5+=_0x723a05){const _0x2a882b=_0x385691[_0x389b0c(0x1eb)](_0x5588b5,_0x5588b5+_0x723a05),_0x3253a9=await Promise[_0x389b0c(0x18b)](_0x2a882b['map'](async _0x17b914=>{const _0x569c22=_0x389b0c;if(!_0x17b914[_0x569c22(0x207)]&&!_0x17b914['hasChanges'])return{'action':_0x569c22(0x215),'name':_0x17b914[_0x569c22(0x225)][_0x569c22(0x158)],'journeyId':_0x17b914[_0x569c22(0x1da)]?.['id']};const _0x1b85a9=_0x17b914['folderPath']?_0x46537b['folderPathToId'][_0x569c22(0x175)](_0x17b914[_0x569c22(0x13d)]):undefined;_0x290f6d['onProgress']?.({'type':_0x17b914[_0x569c22(0x207)]?'journey_creating':_0x569c22(0x15c),'name':_0x17b914[_0x569c22(0x225)]['name']});try{const _0x14a7f3=await executeSingleJourneyPush(_0x3d4f53,_0x17b914,{..._0x46537b,'segmentNameToId':_0x5949c5},{'parentId':_0x47a19c[_0x569c22(0x143)],'rootFolderId':_0x47a19c[_0x569c22(0x1ff)],'folderId':_0x1b85a9,'verbose':_0x47a19c['verbose']},_0x290f6d,{'journeyDefToRequest':_0x49f632,'activationDefToCreateRequest':_0x46ae6c,'yamlRuleToApi':_0x435d89,'validateSegmentRule':_0x26b15d});for(const [_0x5a7c7a,_0x178a25]of _0x14a7f3[_0x569c22(0x1cc)]){_0x5949c5[_0x569c22(0x17d)](_0x5a7c7a,_0x178a25),_0x88d3c7[_0x569c22(0x1cc)][_0x569c22(0x17d)](_0x5a7c7a,_0x178a25);}if(_0x14a7f3[_0x569c22(0x18e)]==='created')_0x290f6d['onProgress']?.({'type':_0x569c22(0x1c7),'name':_0x17b914['yamlConfig']['name'],'journeyId':_0x14a7f3['journeyId']}),_0x290f6d[_0x569c22(0x145)]?.(_0x569c22(0x133)+_0x17b914[_0x569c22(0x225)][_0x569c22(0x158)]+'\x27'),_0x88d3c7[_0x569c22(0x1aa)]++;else _0x14a7f3['action']===_0x569c22(0x162)&&(_0x290f6d[_0x569c22(0x1fb)]?.({'type':'journey_updated','name':_0x17b914[_0x569c22(0x225)][_0x569c22(0x158)]}),_0x290f6d[_0x569c22(0x145)]?.(_0x569c22(0x208)+_0x17b914[_0x569c22(0x225)][_0x569c22(0x158)]+'\x27'),_0x88d3c7[_0x569c22(0x162)]++);return{'action':_0x14a7f3[_0x569c22(0x18e)],'name':_0x17b914['yamlConfig'][_0x569c22(0x158)],'journeyId':_0x14a7f3[_0x569c22(0x1b0)]};}catch(_0x1fc99a){const _0x964667=isHttp400Error(_0x1fc99a),_0x4a4002=_0x964667?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x569c22(0x1c8)],_0x5de26a=getErrorMessage(_0x1fc99a);throw new SDKError(_0x4a4002,_0x569c22(0x170)+(_0x17b914[_0x569c22(0x207)]?_0x569c22(0x1c3):_0x569c22(0x1b2))+'\x20journey\x20from\x20file:\x20'+_0x17b914['absolutePath']+'\x0a\x20\x20'+_0x5de26a,_0x1fc99a);}}));_0x88d3c7[_0x389b0c(0x1f3)]['push'](..._0x3253a9);}return _0x88d3c7;}async function matchExistingJourneySegments(_0x3648e8,_0x565cd4,_0x54258c,_0x1304c6,_0x5802b8){const _0x1e8116=a114_0x3308e7;if(!_0x565cd4[_0x1e8116(0x1da)]||!_0x565cd4['yamlConfig'][_0x1e8116(0x1c6)])return;const _0x59aff9=new Map();for(const _0x32c65d of Object[_0x1e8116(0x150)](_0x565cd4[_0x1e8116(0x225)][_0x1e8116(0x1c6)])){const _0x67e1ea=generateDeterministicJourneySegmentName(_0x565cd4[_0x1e8116(0x225)]['name'],_0x32c65d);_0x59aff9[_0x1e8116(0x17d)](_0x67e1ea,_0x32c65d);}const _0x36cdbd=collectSegmentIdsFromJourneyApi(_0x565cd4[_0x1e8116(0x1da)]);for(const _0x257f57 of _0x36cdbd){const _0x458613=await fetchSegment(_0x3648e8,_0x54258c,_0x257f57,_0x1304c6);if(!_0x458613?.[_0x1e8116(0x158)])continue;const _0x334b42=_0x59aff9['get'](_0x458613[_0x1e8116(0x158)]);_0x334b42&&_0x5802b8[_0x1e8116(0x17d)](_0x334b42,_0x257f57);}}async function executeSingleJourneyPush(_0x29e0b3,_0x5c6275,_0x2dff10,_0x4c7e3d,_0x364b85,_0x21707b){const _0xe6b2a6=a114_0x3308e7,{journeyDefToRequest:_0x4e02f1,activationDefToCreateRequest:_0x40a594,yamlRuleToApi:_0xb48b9b,validateSegmentRule:_0x264c22}=_0x21707b,_0x19d3cd=new Map(),_0x2633bc=new Map();recoverSegmentIdsFromPushRecovery(_0x5c6275,_0x19d3cd,_0x2dff10[_0xe6b2a6(0x12d)]);const _0x2581bb=new Map(),_0x56b054=new Map(),_0x52552c=new Map();let _0x1b715a;const _0xf5e21f=async()=>{const _0x2750ae=_0xe6b2a6;if(_0x1b715a)return;_0x1b715a=new Map();if(!_0x5c6275['existingJourney'])return;const _0x2af9b3=await _0x29e0b3[_0x2750ae(0x190)][_0x2750ae(0x1e4)](_0x5c6275[_0x2750ae(0x1da)]['id']);for(const _0x485e43 of _0x2af9b3){const _0x26094a=journeyActivationStepToYaml(_0x485e43,_0x2dff10[_0x2750ae(0x1a4)],_0x2dff10[_0x2750ae(0x178)]),_0x46a645=activationSignature(_0x26094a);!_0x1b715a[_0x2750ae(0x16c)](_0x46a645)&&_0x1b715a[_0x2750ae(0x17d)](_0x46a645,_0x485e43['id']),_0x26094a['name']&&_0x2633bc[_0x2750ae(0x17d)](_0x26094a[_0x2750ae(0x158)],_0x485e43['id']);}};await matchExistingJourneySegments(_0x29e0b3,_0x5c6275,_0x4c7e3d[_0xe6b2a6(0x143)],_0x2dff10['existingSegments'],_0x2dff10['segmentNameToId']);const _0xe3fe8a={'resolveSegmentId':async _0x11e421=>{const _0x4932c7=_0xe6b2a6,_0x5c6562=_0x2dff10[_0x4932c7(0x12d)][_0x4932c7(0x175)](_0x11e421);if(!_0x5c6562)throw new SDKError(ErrorCode[_0x4932c7(0x1b8)],_0x4932c7(0x1cb)+_0x11e421+_0x4932c7(0x20f)+_0x5c6275['yamlConfig'][_0x4932c7(0x158)]+')');return _0x5c6562;},'resolveEmbeddedSegmentId':async(_0xb728f1,_0x360386)=>{const _0x3cb88c=_0xe6b2a6,_0x269189=_0x2dff10[_0x3cb88c(0x12d)][_0x3cb88c(0x175)](_0xb728f1);if(_0x269189)return _0x269189;const _0x426e03=_0x2dff10[_0x3cb88c(0x1ba)][_0x3cb88c(0x17f)](_0x6778b1=>_0x6778b1['name']===_0xb728f1);if(_0x426e03)return _0x2dff10[_0x3cb88c(0x12d)][_0x3cb88c(0x17d)](_0xb728f1,_0x426e03['id']),_0x426e03['id'];if(_0x5c6275[_0x3cb88c(0x207)]){const {stageName:_0x110c5a,criteriaName:_0x39e9d9}=findSegmentCriteriaLocation(_0x5c6275['yamlConfig'],_0xb728f1);return _0x264c22(_0xb728f1,_0x360386[_0x3cb88c(0x1f2)]),_0x56b054['set'](_0xb728f1,{'definition':_0x360386,'stageName':_0x110c5a,'criteriaName':_0x39e9d9}),createPendingSegmentId(_0xb728f1);}const _0x31b922=_0x5c6275[_0x3cb88c(0x1da)]?.['id'];if(!_0x31b922)throw new SDKError(ErrorCode[_0x3cb88c(0x176)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x38ef5c=_0x2581bb['get'](_0xb728f1);if(_0x38ef5c)return _0x38ef5c;const _0x46d136=((async()=>{const _0x568c56=_0x3cb88c;_0x264c22(_0xb728f1,_0x360386['rule']);const _0x4923e0=generateDeterministicJourneySegmentName(_0x5c6275[_0x568c56(0x225)]['name'],_0xb728f1),_0x24bdbd=_0x2dff10[_0x568c56(0x1ba)][_0x568c56(0x17f)](_0xdb09ab=>_0xdb09ab[_0x568c56(0x158)]===_0x4923e0),_0x4e97b4=createSegmentIdResolver(_0x2dff10[_0x568c56(0x12d)],_0xb728f1),_0xfb32f6=await resolveRuleSegmentIds(_0x360386[_0x568c56(0x1f2)],_0x4e97b4);let _0x28288e;return _0x24bdbd?(await _0x29e0b3[_0x568c56(0x189)]['updateSegmentById'](_0x4c7e3d['parentId'],_0x24bdbd['id'],{'description':_0x360386[_0x568c56(0x1e1)]||_0x568c56(0x180)+_0xb728f1,'rule':_0xb48b9b(_0xfb32f6,!![]),'countPopulation':!![]}),_0x28288e=_0x24bdbd['id'],saveSegmentToPushRecovery(_0x5c6275[_0x568c56(0x149)],_0x5c6275['yamlConfig']['name'],_0xb728f1,{'segmentId':_0x28288e,'uniqueServerName':_0x4923e0,'createdAt':new Date()[_0x568c56(0x1b5)]()})):_0x28288e=await createOrRecoverEmbeddedSegment(_0x29e0b3,_0x5c6275,{'localName':_0xb728f1,'uniqueSegmentName':_0x4923e0,'description':_0x360386[_0x568c56(0x1e1)]||'Entry\x20criteria:\x20'+_0xb728f1,'journeyId':_0x31b922,'resolvedRule':_0xfb32f6,'parentId':_0x4c7e3d[_0x568c56(0x143)],'folderId':_0x4c7e3d[_0x568c56(0x1ff)]||''},_0xb48b9b),_0x2dff10[_0x568c56(0x12d)][_0x568c56(0x17d)](_0xb728f1,_0x28288e),_0x19d3cd[_0x568c56(0x17d)](_0xb728f1,_0x28288e),_0x28288e;})());_0x2581bb[_0x3cb88c(0x17d)](_0xb728f1,_0x46d136);try{return await _0x46d136;}finally{_0x2581bb[_0x3cb88c(0x223)](_0xb728f1);}},'resolveActivationId':async _0x5e75ad=>{const _0x434693=_0xe6b2a6,_0x2562b8=_0x2633bc[_0x434693(0x175)](_0x5e75ad);if(_0x2562b8)return _0x2562b8;if(_0x5c6275['existingJourney']){await _0xf5e21f();const _0xbec94=_0x2633bc[_0x434693(0x175)](_0x5e75ad);if(_0xbec94)return _0xbec94;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x434693(0x137)+_0x5e75ad+_0x434693(0x20f)+_0x5c6275[_0x434693(0x225)]['name']+').\x20'+_0x434693(0x195));},'resolveEmbeddedActivationId':async(_0x399d8f,_0x1485e8)=>{const _0x4723d4=_0xe6b2a6,_0x5db4ab=_0x2633bc[_0x4723d4(0x175)](_0x399d8f);if(_0x5db4ab)return _0x5db4ab;if(_0x5c6275[_0x4723d4(0x207)])return _0x52552c['set'](_0x399d8f,_0x1485e8),createPendingActivationId(_0x399d8f);if(_0x5c6275[_0x4723d4(0x1da)]){await _0xf5e21f();const _0x1b70d6=_0x2633bc[_0x4723d4(0x175)](_0x1485e8['name']);if(_0x1b70d6)return _0x2633bc[_0x4723d4(0x17d)](_0x399d8f,_0x1b70d6),_0x1b70d6;const _0xb2dd7f=activationSignature(_0x1485e8),_0x342abb=_0x1b715a?.['get'](_0xb2dd7f);if(_0x342abb)return _0x2633bc['set'](_0x399d8f,_0x342abb),_0x342abb;const _0x3621b5=await _0x40a594(_0x1485e8,_0x2dff10[_0x4723d4(0x1a8)]),_0x3d4b41={..._0x3621b5,..._0x1485e8[_0x4723d4(0x1b4)]!==undefined&&{'runAfterJourneyRefresh':_0x1485e8['run_after_journey_refresh']}},_0x32b020=await _0x29e0b3[_0x4723d4(0x190)]['createActivation'](_0x5c6275[_0x4723d4(0x1da)]['id'],_0x3d4b41);return _0x2633bc[_0x4723d4(0x17d)](_0x399d8f,_0x32b020['id']),_0x32b020['id'];}throw new SDKError(ErrorCode[_0x4723d4(0x176)],_0x4723d4(0x14c));},'resolveJourneyId':async _0x1abdd7=>{const _0x3b93ba=_0xe6b2a6;try{return await _0x29e0b3['journey'][_0x3b93ba(0x15d)](_0x4c7e3d[_0x3b93ba(0x143)],_0x1abdd7);}catch(_0x46d9c6){throw new SDKError(ErrorCode[_0x3b93ba(0x168)],_0x3b93ba(0x1c2)+_0x1abdd7+_0x3b93ba(0x1d7)+_0x5c6275[_0x3b93ba(0x225)][_0x3b93ba(0x158)]+'\x27)',_0x46d9c6);}},'resolveStageId':async(_0x206afa,_0x433f6f)=>{const _0x5237b6=_0xe6b2a6,_0x3b2014=await _0x29e0b3[_0x5237b6(0x190)][_0x5237b6(0x1d6)](_0x206afa),_0x90fcec=_0x3b2014[_0x5237b6(0x13c)]['journeyStages'][_0x5237b6(0x17f)](_0x3dd141=>_0x3dd141['name'][_0x5237b6(0x184)]()===_0x433f6f[_0x5237b6(0x184)]());if(!_0x90fcec?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x5237b6(0x21c)+_0x433f6f+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x3b2014[_0x5237b6(0x13c)][_0x5237b6(0x200)]||_0x3b2014['attributes'][_0x5237b6(0x158)])+'\x27');return _0x90fcec['id'];}},_0x32a6ae=await _0x4e02f1(_0x5c6275['yamlConfig'],_0x4c7e3d[_0xe6b2a6(0x143)],_0xe3fe8a),_0x208384=_0x4c7e3d[_0xe6b2a6(0x1e7)]||_0x4c7e3d['rootFolderId'];_0x208384&&(_0x32a6ae[_0xe6b2a6(0x1d9)]={'parentFolder':{'data':{'id':_0x208384,'type':_0xe6b2a6(0x16a)}}});if(_0x5c6275[_0xe6b2a6(0x207)]){if(_0x56b054[_0xe6b2a6(0x1dd)]>0x0||_0x52552c[_0xe6b2a6(0x1dd)]>0x0)return await executeThreeStepJourneyCreate(_0x29e0b3,_0x5c6275,_0x32a6ae,{'pendingEmbeddedSegments':_0x56b054,'pendingEmbeddedActivations':_0x52552c,'embeddedSegmentNameToId':_0x19d3cd,'journeyActivationNameToId':_0x2633bc},{..._0x4c7e3d,'effectiveFolderId':_0x208384},_0x2dff10,_0x364b85,_0x21707b);else{ensureJourneyDefaults(_0x32a6ae[_0xe6b2a6(0x13c)]);const _0x1a5919=await _0x29e0b3['journey'][_0xe6b2a6(0x1c3)](_0x32a6ae);return deletePushRecovery(_0x5c6275[_0xe6b2a6(0x149)]),{'action':_0xe6b2a6(0x1aa),'journeyId':_0x1a5919['id'],'embeddedSegmentNameToId':_0x19d3cd};}}else{if(_0x5c6275[_0xe6b2a6(0x1b7)]&&_0x5c6275['existingJourney'])return ensureJourneyDefaults(_0x32a6ae['attributes']),await _0x29e0b3[_0xe6b2a6(0x190)][_0xe6b2a6(0x1b2)](_0x5c6275[_0xe6b2a6(0x1da)]['id'],_0x32a6ae),deletePushRecovery(_0x5c6275[_0xe6b2a6(0x149)]),{'action':_0xe6b2a6(0x162),'journeyId':_0x5c6275[_0xe6b2a6(0x1da)]['id'],'embeddedSegmentNameToId':_0x19d3cd};}return deletePushRecovery(_0x5c6275['absolutePath']),{'action':_0xe6b2a6(0x215),'journeyId':_0x5c6275[_0xe6b2a6(0x1da)]?.['id'],'embeddedSegmentNameToId':_0x19d3cd};}function findSegmentCriteriaLocation(_0x30e540,_0x5a59e5){const _0x29423c=a114_0x3308e7,_0x3fa38b=_0x30e540[_0x29423c(0x1ef)]||_0x30e540[_0x29423c(0x134)]?.[0x0]?.['stages']||[];let _0x509c97=_0x29423c(0x1a6),_0x10545b=_0x5a59e5;const _0x18661d=_0x30e540[_0x29423c(0x191)]||_0x30e540['journeys']?.[0x0]?.[_0x29423c(0x191)];if(_0x18661d?.['segment']===_0x5a59e5)return{'stageName':_0x29423c(0x191),'criteriaName':_0x18661d['name']||_0x5a59e5};_0x510d28:for(const _0x352838 of _0x3fa38b){if(_0x352838[_0x29423c(0x188)]?.[_0x29423c(0x189)]===_0x5a59e5){_0x509c97=_0x352838[_0x29423c(0x158)],_0x10545b=_0x352838[_0x29423c(0x188)][_0x29423c(0x158)]||_0x5a59e5;break;}if(_0x352838[_0x29423c(0x1d5)])for(const _0x152abe of _0x352838[_0x29423c(0x1d5)]){if(_0x152abe[_0x29423c(0x177)]===_0x29423c(0x15f)&&_0x152abe[_0x29423c(0x185)]?.[_0x29423c(0x1a1)])for(const _0x57118d of _0x152abe[_0x29423c(0x185)][_0x29423c(0x1a1)]){if(_0x57118d[_0x29423c(0x189)]===_0x5a59e5){_0x509c97=_0x352838[_0x29423c(0x158)],_0x10545b=_0x57118d[_0x29423c(0x158)]||_0x5a59e5;break _0x510d28;}}}}return{'stageName':_0x509c97,'criteriaName':_0x10545b};}async function executeThreeStepJourneyCreate(_0x23b85f,_0x605912,_0x34422c,_0x45d735,_0x39aab3,_0xe74f35,_0x4546a2,_0x589abc){const _0x57b50c=a114_0x3308e7,{activationDefToCreateRequest:_0x13ec4f,yamlRuleToApi:_0x3d020f}=_0x589abc,{pendingEmbeddedSegments:_0x18cfa0,pendingEmbeddedActivations:_0x3c6175,embeddedSegmentNameToId:_0x50901f}=_0x45d735,_0x3e6e7f=JSON[_0x57b50c(0x1dc)](JSON[_0x57b50c(0x1d8)](_0x34422c));ensureJourneyDefaults(_0x3e6e7f['attributes']),stripPendingIds(_0x3e6e7f);const _0x2a7ad1=await _0x23b85f[_0x57b50c(0x190)]['create'](_0x3e6e7f),_0x5d60f1=_0x2a7ad1['id'],_0x15a867=new Map();for(const _0x28ed8d of _0x2a7ad1[_0x57b50c(0x13c)]['journeyStages']){_0x15a867[_0x57b50c(0x17d)](_0x28ed8d[_0x57b50c(0x158)][_0x57b50c(0x184)](),_0x28ed8d['id']);}recoverSegmentIdsFromPushRecovery(_0x605912,_0x50901f,_0xe74f35[_0x57b50c(0x12d)]);for(const [_0x62c6c8,{definition:_0x219de0}]of _0x18cfa0){if(_0x50901f[_0x57b50c(0x16c)](_0x62c6c8)){_0x4546a2[_0x57b50c(0x1fb)]?.({'type':_0x57b50c(0x1e8),'journeyName':_0x605912[_0x57b50c(0x225)][_0x57b50c(0x158)],'segmentName':_0x62c6c8});continue;}const _0x3cd601=generateDeterministicJourneySegmentName(_0x605912['yamlConfig'][_0x57b50c(0x158)],_0x62c6c8);_0x4546a2[_0x57b50c(0x1fb)]?.({'type':_0x57b50c(0x19f),'journeyName':_0x605912[_0x57b50c(0x225)]['name'],'segmentName':_0x62c6c8});const _0x2bf679=createSegmentIdResolver(_0xe74f35['segmentNameToId'],_0x62c6c8),_0x58e67e=await resolveRuleSegmentIds(_0x219de0[_0x57b50c(0x1f2)],_0x2bf679),_0x5f32a6=await createOrRecoverEmbeddedSegment(_0x23b85f,_0x605912,{'localName':_0x62c6c8,'uniqueSegmentName':_0x3cd601,'description':_0x219de0['description']||'Entry\x20criteria:\x20'+_0x62c6c8,'journeyId':_0x5d60f1,'resolvedRule':_0x58e67e,'parentId':_0x39aab3[_0x57b50c(0x143)],'folderId':_0x39aab3[_0x57b50c(0x210)]||''},_0x3d020f);_0x50901f['set'](_0x62c6c8,_0x5f32a6),_0xe74f35[_0x57b50c(0x12d)][_0x57b50c(0x17d)](_0x62c6c8,_0x5f32a6),_0x4546a2[_0x57b50c(0x1fb)]?.({'type':_0x57b50c(0x1e8),'journeyName':_0x605912[_0x57b50c(0x225)][_0x57b50c(0x158)],'segmentName':_0x62c6c8});}const _0x11d66f=new Map();for(const [_0x5a0cc0,_0x2b6c6b]of _0x3c6175){_0x4546a2[_0x57b50c(0x1fb)]?.({'type':_0x57b50c(0x201),'journeyName':_0x605912[_0x57b50c(0x225)]['name'],'activationName':_0x5a0cc0});const _0x32ceb3=await _0x13ec4f(_0x2b6c6b,_0xe74f35[_0x57b50c(0x1a8)]),_0x3ba3ca={..._0x32ceb3,..._0x2b6c6b[_0x57b50c(0x1b4)]!==undefined&&{'runAfterJourneyRefresh':_0x2b6c6b[_0x57b50c(0x1b4)]}},_0x20d5e3=await _0x23b85f[_0x57b50c(0x190)][_0x57b50c(0x157)](_0x5d60f1,_0x3ba3ca);_0x11d66f['set'](_0x5a0cc0,_0x20d5e3['id']),_0x45d735[_0x57b50c(0x1ea)][_0x57b50c(0x17d)](_0x5a0cc0,_0x20d5e3['id']),_0x4546a2[_0x57b50c(0x1fb)]?.({'type':_0x57b50c(0x141),'journeyName':_0x605912['yamlConfig'][_0x57b50c(0x158)],'activationName':_0x5a0cc0});}const _0x39bd07=JSON[_0x57b50c(0x1dc)](JSON['stringify'](_0x34422c));return _0x39bd07['id']=_0x5d60f1,ensureJourneyDefaults(_0x39bd07[_0x57b50c(0x13c)]),resolvePendingIdsInRequest(_0x39bd07,_0x34422c,_0x15a867,_0x50901f,_0x11d66f,_0x4546a2),await _0x23b85f['journey'][_0x57b50c(0x1b2)](_0x5d60f1,_0x39bd07),deletePushRecovery(_0x605912[_0x57b50c(0x149)]),{'action':_0x57b50c(0x1aa),'journeyId':_0x5d60f1,'embeddedSegmentNameToId':_0x50901f};}export function stripWaitStepPendingIds(_0x1be0bb){const _0x4cbe20=a114_0x3308e7,_0x240a52=_0x1be0bb[_0x4cbe20(0x153)]&&isPendingSegmentId(_0x1be0bb[_0x4cbe20(0x153)]),_0x25be0a=_0x1be0bb['conditions']?.[_0x4cbe20(0x131)](_0x527aa9=>_0x527aa9['segmentId']&&isPendingSegmentId(_0x527aa9[_0x4cbe20(0x138)]));(_0x240a52||_0x25be0a)&&(_0x1be0bb[_0x4cbe20(0x203)]=_0x4cbe20(0x14b),_0x1be0bb[_0x4cbe20(0x1f6)]=0x1,_0x1be0bb[_0x4cbe20(0x1f0)]=_0x4cbe20(0x19d),delete _0x1be0bb[_0x4cbe20(0x153)],delete _0x1be0bb['conditionTimeoutDuration'],delete _0x1be0bb[_0x4cbe20(0x1c1)],delete _0x1be0bb['conditions']);}export function resolveWaitStepPendingIds(_0x1e2a61,_0x1e6ecb,_0x50b9e4,_0x3cacdf){const _0x2c1e45=a114_0x3308e7;if(_0x1e6ecb[_0x2c1e45(0x153)]&&isPendingSegmentId(_0x1e6ecb[_0x2c1e45(0x153)])){const _0x2e54f1=_0x50b9e4(_0x1e6ecb[_0x2c1e45(0x153)],_0x2c1e45(0x198)+_0x3cacdf+_0x2c1e45(0x1c5));_0x2e54f1&&(_0x1e2a61[_0x2c1e45(0x203)]='Condition',_0x1e2a61[_0x2c1e45(0x153)]=_0x2e54f1,delete _0x1e2a61['waitStep'],delete _0x1e2a61['waitStepUnit'],_0x1e6ecb[_0x2c1e45(0x214)]!==undefined&&(_0x1e2a61['conditionTimeoutDuration']=_0x1e6ecb[_0x2c1e45(0x214)]),_0x1e6ecb[_0x2c1e45(0x1c1)]&&(_0x1e2a61[_0x2c1e45(0x1c1)]=_0x1e6ecb[_0x2c1e45(0x1c1)]));}if(_0x1e6ecb[_0x2c1e45(0x1df)]){const _0x1ff2d0=_0x1e6ecb[_0x2c1e45(0x1df)]['some'](_0x1bf708=>_0x1bf708[_0x2c1e45(0x138)]&&isPendingSegmentId(_0x1bf708[_0x2c1e45(0x138)]));if(_0x1ff2d0){const _0x2d6d23=_0x1e6ecb[_0x2c1e45(0x1df)][_0x2c1e45(0x224)](_0x38f06e=>{const _0x1cf009=_0x2c1e45;if(_0x38f06e[_0x1cf009(0x138)]&&isPendingSegmentId(_0x38f06e[_0x1cf009(0x138)])){const _0x14932b=_0x50b9e4(_0x38f06e[_0x1cf009(0x138)],_0x1cf009(0x198)+_0x3cacdf+_0x1cf009(0x1c5));return{..._0x38f06e,'segmentId':_0x14932b||_0x38f06e['segmentId']};}return{..._0x38f06e};});_0x1e2a61[_0x2c1e45(0x203)]=_0x2c1e45(0x1f1),_0x1e2a61['conditions']=_0x2d6d23,delete _0x1e2a61[_0x2c1e45(0x1f6)],delete _0x1e2a61[_0x2c1e45(0x1f0)],delete _0x1e2a61[_0x2c1e45(0x153)],delete _0x1e2a61['conditionTimeoutDuration'],delete _0x1e2a61[_0x2c1e45(0x1c1)];}}}function stripPendingIds(_0x383881){const _0x21eea2=a114_0x3308e7;_0x383881[_0x21eea2(0x13c)][_0x21eea2(0x191)]?.['segmentId']&&isPendingSegmentId(_0x383881[_0x21eea2(0x13c)][_0x21eea2(0x191)]['segmentId'])&&delete _0x383881['attributes'][_0x21eea2(0x191)];for(const _0x2c7425 of _0x383881[_0x21eea2(0x13c)]['journeyStages']||[]){_0x2c7425['entryCriteria']?.[_0x21eea2(0x138)]&&isPendingSegmentId(_0x2c7425[_0x21eea2(0x213)]['segmentId'])&&delete _0x2c7425[_0x21eea2(0x213)];_0x2c7425[_0x21eea2(0x221)]?.[_0x21eea2(0x138)]&&isPendingSegmentId(_0x2c7425[_0x21eea2(0x221)][_0x21eea2(0x138)])&&delete _0x2c7425[_0x21eea2(0x221)];_0x2c7425[_0x21eea2(0x14d)]&&(_0x2c7425[_0x21eea2(0x14d)]=_0x2c7425['exitCriterias'][_0x21eea2(0x1bd)](_0x5a7887=>!_0x5a7887[_0x21eea2(0x138)]||!isPendingSegmentId(_0x5a7887['segmentId'])));if(_0x2c7425[_0x21eea2(0x1d5)])for(const _0x309b19 of Object[_0x21eea2(0x150)](_0x2c7425[_0x21eea2(0x1d5)])){const _0x3daa84=_0x2c7425['steps'][_0x309b19];_0x3daa84[_0x21eea2(0x177)]==='Activation'&&_0x3daa84[_0x21eea2(0x218)]&&isPendingActivationId(_0x3daa84[_0x21eea2(0x218)])&&(_0x3daa84[_0x21eea2(0x218)]='');if(_0x3daa84['type']===_0x21eea2(0x1f8)&&_0x3daa84[_0x21eea2(0x1a1)])for(const _0x5ab954 of _0x3daa84[_0x21eea2(0x1a1)]){_0x5ab954[_0x21eea2(0x138)]&&isPendingSegmentId(_0x5ab954[_0x21eea2(0x138)])&&(_0x5ab954[_0x21eea2(0x138)]='');}_0x3daa84[_0x21eea2(0x177)]===_0x21eea2(0x21f)&&stripWaitStepPendingIds(_0x3daa84);}}}function resolvePendingIdsInRequest(_0x3bb719,_0x5def8a,_0x1a5121,_0x800411,_0x59b6e9,_0x1f04ae){const _0x39b7a8=a114_0x3308e7,_0x1d1279=(_0xcf11d5,_0x484afa)=>{const _0x482b29=a114_0x3638;if(!isPendingSegmentId(_0xcf11d5))return _0xcf11d5;const _0x558b89=extractPendingSegmentName(_0xcf11d5),_0x326461=_0x800411[_0x482b29(0x175)](_0x558b89);return!_0x326461&&_0x1f04ae['logWarning']?.(_0x482b29(0x151)+_0x558b89+'\x27\x20for\x20'+_0x484afa),_0x326461;};if(_0x3bb719[_0x39b7a8(0x13c)][_0x39b7a8(0x191)]?.[_0x39b7a8(0x138)]&&isPendingSegmentId(_0x3bb719['attributes'][_0x39b7a8(0x191)]['segmentId'])){const _0x4f3916=_0x1d1279(_0x3bb719['attributes']['goal'][_0x39b7a8(0x138)],'goal\x20criteria');_0x4f3916&&(_0x3bb719[_0x39b7a8(0x13c)]['goal']['segmentId']=_0x4f3916);}for(const _0x4a2ad3 of _0x3bb719[_0x39b7a8(0x13c)]['journeyStages']||[]){const _0x351707=_0x1a5121['get'](_0x4a2ad3[_0x39b7a8(0x158)]['toLowerCase']());_0x351707&&(_0x4a2ad3['id']=_0x351707);if(_0x4a2ad3['entryCriteria']?.[_0x39b7a8(0x138)]&&isPendingSegmentId(_0x4a2ad3[_0x39b7a8(0x213)][_0x39b7a8(0x138)])){const _0x5e799a=_0x1d1279(_0x4a2ad3[_0x39b7a8(0x213)][_0x39b7a8(0x138)],'stage\x20\x27'+_0x4a2ad3['name']+_0x39b7a8(0x18c));_0x5e799a&&(_0x4a2ad3[_0x39b7a8(0x213)][_0x39b7a8(0x138)]=_0x5e799a);}if(_0x4a2ad3[_0x39b7a8(0x14d)])for(const _0x44bd39 of _0x4a2ad3[_0x39b7a8(0x14d)]){if(_0x44bd39[_0x39b7a8(0x138)]&&isPendingSegmentId(_0x44bd39[_0x39b7a8(0x138)])){const _0x7d1112=_0x1d1279(_0x44bd39['segmentId'],'stage\x20\x27'+_0x4a2ad3[_0x39b7a8(0x158)]+_0x39b7a8(0x211));_0x7d1112&&(_0x44bd39['segmentId']=_0x7d1112);}}if(_0x4a2ad3['milestone']?.[_0x39b7a8(0x138)]&&isPendingSegmentId(_0x4a2ad3['milestone']['segmentId'])){const _0x494d65=_0x1d1279(_0x4a2ad3[_0x39b7a8(0x221)][_0x39b7a8(0x138)],_0x39b7a8(0x198)+_0x4a2ad3[_0x39b7a8(0x158)]+_0x39b7a8(0x1e3));_0x494d65&&(_0x4a2ad3[_0x39b7a8(0x221)][_0x39b7a8(0x138)]=_0x494d65);}if(_0x4a2ad3[_0x39b7a8(0x1d5)]){const _0x58165e=_0x5c2b6b=>_0x5def8a[_0x39b7a8(0x13c)]['journeyStages']?.[_0x39b7a8(0x17f)](_0x6644cd=>_0x6644cd[_0x39b7a8(0x158)][_0x39b7a8(0x184)]()===_0x4a2ad3[_0x39b7a8(0x158)]['toLowerCase']())?.[_0x39b7a8(0x1d5)]?.[_0x5c2b6b];for(const _0x212561 of Object[_0x39b7a8(0x150)](_0x4a2ad3[_0x39b7a8(0x1d5)])){const _0x24b91f=_0x4a2ad3['steps'][_0x212561],_0x2b0b0f=_0x58165e(_0x212561);if(_0x24b91f[_0x39b7a8(0x177)]===_0x39b7a8(0x169)&&_0x24b91f[_0x39b7a8(0x218)]&&(isPendingActivationId(_0x24b91f[_0x39b7a8(0x218)])||_0x24b91f['journeyActivationStepId']==='')){if(_0x2b0b0f?.[_0x39b7a8(0x218)]&&isPendingActivationId(_0x2b0b0f[_0x39b7a8(0x218)])){const _0x52fc86=extractPendingActivationName(_0x2b0b0f[_0x39b7a8(0x218)]),_0x113d2c=_0x59b6e9[_0x39b7a8(0x175)](_0x52fc86);_0x113d2c&&(_0x24b91f[_0x39b7a8(0x218)]=_0x113d2c);}}if(_0x24b91f[_0x39b7a8(0x177)]===_0x39b7a8(0x1f8)&&_0x24b91f[_0x39b7a8(0x1a1)]&&_0x2b0b0f?.[_0x39b7a8(0x1a1)])for(let _0x1333c8=0x0;_0x1333c8<_0x24b91f['branches'][_0x39b7a8(0x1c9)];_0x1333c8++){const _0x4016e0=_0x24b91f[_0x39b7a8(0x1a1)][_0x1333c8],_0x40ae74=_0x2b0b0f[_0x39b7a8(0x1a1)][_0x1333c8];if(_0x40ae74?.[_0x39b7a8(0x138)]&&isPendingSegmentId(_0x40ae74[_0x39b7a8(0x138)])){const _0x397c67=_0x1d1279(_0x40ae74[_0x39b7a8(0x138)],_0x39b7a8(0x198)+_0x4a2ad3[_0x39b7a8(0x158)]+_0x39b7a8(0x1f7)+(_0x4016e0[_0x39b7a8(0x158)]||_0x1333c8)+'\x27');_0x397c67&&(_0x4016e0[_0x39b7a8(0x138)]=_0x397c67);}}_0x24b91f[_0x39b7a8(0x177)]===_0x39b7a8(0x21f)&&_0x2b0b0f?.[_0x39b7a8(0x177)]===_0x39b7a8(0x21f)&&resolveWaitStepPendingIds(_0x24b91f,_0x2b0b0f,_0x1d1279,_0x4a2ad3['name']);}}}}
1
+ const a114_0x2d62e8=a114_0x2264;(function(_0x4080a2,_0x1c44b7){const _0x335da7=a114_0x2264,_0x446edb=_0x4080a2();while(!![]){try{const _0x273cf7=parseInt(_0x335da7(0x170))/0x1*(parseInt(_0x335da7(0x18e))/0x2)+-parseInt(_0x335da7(0x22b))/0x3*(-parseInt(_0x335da7(0x147))/0x4)+parseInt(_0x335da7(0x193))/0x5*(parseInt(_0x335da7(0x1d3))/0x6)+-parseInt(_0x335da7(0x226))/0x7*(-parseInt(_0x335da7(0x22c))/0x8)+parseInt(_0x335da7(0x19d))/0x9*(-parseInt(_0x335da7(0x16b))/0xa)+parseInt(_0x335da7(0x20a))/0xb*(parseInt(_0x335da7(0x1a5))/0xc)+-parseInt(_0x335da7(0x139))/0xd*(parseInt(_0x335da7(0x167))/0xe);if(_0x273cf7===_0x1c44b7)break;else _0x446edb['push'](_0x446edb['shift']());}catch(_0x56ac95){_0x446edb['push'](_0x446edb['shift']());}}}(a114_0x12ff,0x9b84e));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a114_0x2d62e8(0x151));function a114_0x2264(_0x15c8ea,_0x454a7f){_0x15c8ea=_0x15c8ea-0x127;const _0x12ffc3=a114_0x12ff();let _0x2264a8=_0x12ffc3[_0x15c8ea];return _0x2264a8;}export const PENDING_SEGMENT_PREFIX=a114_0x2d62e8(0x13f);export const PENDING_ACTIVATION_PREFIX=a114_0x2d62e8(0x222);export function createPendingSegmentId(_0x2e2b5f){return''+PENDING_SEGMENT_PREFIX+_0x2e2b5f+'__';}export function isPendingSegmentId(_0x2fdc3d){return _0x2fdc3d['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x2fdc3d['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x2681c6){const _0x15c87f=a114_0x2d62e8;return _0x2681c6[_0x15c87f(0x16e)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x31a14d){return''+PENDING_ACTIVATION_PREFIX+_0x31a14d+'__';}export function isPendingActivationId(_0x925b05){const _0x4fadb6=a114_0x2d62e8;return _0x925b05[_0x4fadb6(0x1e3)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x585546){return _0x585546['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x48a3ba,_0x464525){const _0x448841=a114_0x2d62e8,_0x4c30c2=_0x48a3ba+'::'+(_0x464525[_0x448841(0x143)]()||_0x448841(0x219)),_0x2be93e=createHash(_0x448841(0x130))[_0x448841(0x201)](_0x4c30c2)[_0x448841(0x1aa)](_0x448841(0x1c8))['slice'](0x0,0xc);return _0x448841(0x210)+_0x2be93e;}export function ensureJourneyDefaults(_0x2c3c69){const _0x58df9e=a114_0x2d62e8;!_0x2c3c69['description']&&(_0x2c3c69[_0x58df9e(0x1e1)]=''),!_0x2c3c69[_0x58df9e(0x1a7)]&&(_0x2c3c69[_0x58df9e(0x1a7)]=_0x58df9e(0x233));}export function resolveTDFolderPath(_0x3043f5,_0x43c71f,_0x38505c){const _0x14e7af=a114_0x2d62e8;if(!_0x43c71f)return _0x3043f5;if(_0x3043f5===_0x38505c||_0x3043f5[_0x14e7af(0x1e3)](_0x38505c+'/'))return _0x3043f5;return _0x3043f5?_0x38505c+'/'+_0x3043f5:_0x38505c;}export function addFoldersToCreate(_0x16f3cb,_0x1621b2,_0x1480e7){const _0x3b44d5=a114_0x2d62e8;if(!_0x16f3cb)return;if(_0x1621b2[_0x3b44d5(0x1b2)](_0x16f3cb))return;const _0x22dba9=_0x16f3cb['split']('/');let _0x2d038b='';for(const _0x24ec6e of _0x22dba9){_0x2d038b=_0x2d038b?_0x2d038b+'/'+_0x24ec6e:_0x24ec6e,!_0x1621b2[_0x3b44d5(0x1b2)](_0x2d038b)&&_0x1480e7[_0x3b44d5(0x1d9)](_0x2d038b);}}import*as a114_0x41aa40 from'yaml';import{readFileSync}from'fs';import a114_0x306e1b from'path';import{isJourneyDef,parseYamlString as a114_0x12465b,toYamlString as a114_0x42da57,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{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x2bce9e){const _0x5d83eb=a114_0x2d62e8;if(Array[_0x5d83eb(0x1ea)](_0x2bce9e))return'['+_0x2bce9e[_0x5d83eb(0x1ac)](_0x1cc8f9=>stableStringify(_0x1cc8f9))[_0x5d83eb(0x212)](',')+']';if(_0x2bce9e&&typeof _0x2bce9e===_0x5d83eb(0x21d)){const _0x4c6a02=_0x2bce9e,_0x48e99f=Object[_0x5d83eb(0x1e8)](_0x4c6a02)[_0x5d83eb(0x22f)](),_0x416b66=_0x48e99f[_0x5d83eb(0x1ac)](_0x493cb1=>'\x22'+_0x493cb1+'\x22:'+stableStringify(_0x4c6a02[_0x493cb1]));return'{'+_0x416b66[_0x5d83eb(0x212)](',')+'}';}const _0x495603=JSON[_0x5d83eb(0x1ba)](_0x2bce9e);return _0x495603===undefined?_0x5d83eb(0x230):_0x495603;}function activationSignature(_0x232e2d){const _0x501bbd=a114_0x2d62e8,_0x13ce96={'connection':_0x232e2d[_0x501bbd(0x190)],..._0x232e2d[_0x501bbd(0x15b)]!==undefined&&{'all_columns':_0x232e2d['all_columns']},..._0x232e2d[_0x501bbd(0x1ce)]!==undefined&&{'columns':_0x232e2d[_0x501bbd(0x1ce)]},..._0x232e2d['behavior']!==undefined&&{'behavior':_0x232e2d[_0x501bbd(0x155)]},..._0x232e2d[_0x501bbd(0x21e)]!==undefined&&{'schedule':_0x232e2d[_0x501bbd(0x21e)]},..._0x232e2d[_0x501bbd(0x175)]!==undefined&&{'notification':_0x232e2d[_0x501bbd(0x175)]},..._0x232e2d[_0x501bbd(0x134)]!==undefined&&{'connector_config':_0x232e2d[_0x501bbd(0x134)]},..._0x232e2d[_0x501bbd(0x132)]!==undefined&&{'activation_template_id':_0x232e2d[_0x501bbd(0x132)]}};return stableStringify(_0x13ce96);}async function fetchSegment(_0x5b48a5,_0x252b2b,_0x48579c,_0x3c5344){const _0x1983e5=a114_0x2d62e8,_0x26d839=_0x3c5344?.['find'](_0x19dc2e=>_0x19dc2e['id']===_0x48579c);if(_0x26d839)return _0x26d839;try{return await _0x5b48a5[_0x1983e5(0x219)][_0x1983e5(0x144)](_0x252b2b,_0x48579c);}catch(_0x29f37c){logger[_0x1983e5(0x1f9)](_0x1983e5(0x1d5)+_0x48579c+_0x1983e5(0x189)+_0x29f37c);try{return await _0x5b48a5[_0x1983e5(0x219)][_0x1983e5(0x1cc)](_0x48579c);}catch(_0xa92d21){return logger[_0x1983e5(0x1f9)](_0x1983e5(0x1c5)+_0x48579c+':\x20'+_0xa92d21),null;}}}function recoverSegmentIdsFromPushRecovery(_0x59abbb,_0x200e2b,_0x473ad2){const _0x23c946=a114_0x2d62e8,_0xfaf246=readPushRecovery(_0x59abbb['absolutePath']);if(_0xfaf246?.[_0x23c946(0x196)]===_0x59abbb[_0x23c946(0x12a)][_0x23c946(0x14d)])for(const [_0x5b9518,_0x426a99]of Object[_0x23c946(0x1c7)](_0xfaf246[_0x23c946(0x1ab)])){const _0x4c2ef5=generateDeterministicJourneySegmentName(_0x59abbb[_0x23c946(0x12a)]['name'],_0x5b9518);_0x426a99[_0x23c946(0x152)]===_0x4c2ef5&&(_0x200e2b['set'](_0x5b9518,_0x426a99[_0x23c946(0x184)]),_0x473ad2['set'](_0x5b9518,_0x426a99['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x5ea5ca,_0x24bb66,_0x333d3c,_0xd7b0ee){const _0x278ab2=a114_0x2d62e8;let _0x2e7299;try{_0x2e7299=await _0x5ea5ca[_0x278ab2(0x219)][_0x278ab2(0x1bf)]({'name':_0x333d3c['uniqueSegmentName'],'description':_0x333d3c[_0x278ab2(0x1e1)],'journeyId':_0x333d3c[_0x278ab2(0x153)],'rule':_0xd7b0ee(_0x333d3c[_0x278ab2(0x14c)],!![]),'countPopulation':!![],'parentFolderId':_0x333d3c['folderId'],'audienceId':_0x333d3c['parentId']});}catch(_0x39d2e9){const _0x1bdc97=_0x39d2e9 instanceof Error&&_0x39d2e9[_0x278ab2(0x16a)][_0x278ab2(0x161)]('Name\x20has\x20already\x20been\x20taken');if(_0x1bdc97){const _0x339fe2=readPushRecovery(_0x24bb66[_0x278ab2(0x1b4)]),_0x10a596=_0x339fe2?.[_0x278ab2(0x196)]===_0x24bb66['yamlConfig'][_0x278ab2(0x14d)]?_0x339fe2['segments'][_0x333d3c[_0x278ab2(0x1da)]]:undefined;if(_0x10a596?.[_0x278ab2(0x152)]===_0x333d3c[_0x278ab2(0x176)])await _0x5ea5ca[_0x278ab2(0x219)][_0x278ab2(0x192)](_0x333d3c[_0x278ab2(0x15a)],_0x10a596[_0x278ab2(0x184)],{'description':_0x333d3c[_0x278ab2(0x1e1)],'rule':_0xd7b0ee(_0x333d3c[_0x278ab2(0x14c)],!![]),'countPopulation':!![]}),_0x2e7299=_0x10a596[_0x278ab2(0x184)];else throw new SDKError(ErrorCode[_0x278ab2(0x225)],_0x278ab2(0x1f2)+_0x333d3c[_0x278ab2(0x1da)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x278ab2(0x1ae)+_0x24bb66[_0x278ab2(0x1b4)][_0x278ab2(0x16e)](/([^/]+)$/,_0x278ab2(0x21c))+')\x20')+_0x278ab2(0x16c),_0x39d2e9);}else throw _0x39d2e9;}return saveSegmentToPushRecovery(_0x24bb66['absolutePath'],_0x24bb66['yamlConfig']['name'],_0x333d3c[_0x278ab2(0x1da)],{'segmentId':_0x2e7299,'uniqueServerName':_0x333d3c[_0x278ab2(0x176)],'createdAt':new Date()[_0x278ab2(0x191)]()}),_0x2e7299;}export async function prepareSegmentFiles(_0x4de9c9,_0x2bfa71,_0x15c496,_0x5c3b77,_0x353ddd){const _0x60b325=a114_0x2d62e8,{activationDefToCreateRequest:_0x359a80}=await import(_0x60b325(0x1fb)),_0x428841=[],_0x57ef01=new Set();for(const {yamlConfig:_0x283624,folderPath:_0x1d80cf,sourcePath:_0x41a2bc}of _0x4de9c9){const _0x298f9c=resolveTDFolderPath(_0x1d80cf,_0x5c3b77,_0x353ddd),_0x4f466d=_0x298f9c+':'+_0x283624[_0x60b325(0x14d)],_0x340959=_0x2bfa71[_0x60b325(0x181)][_0x60b325(0x1ad)](_0x4f466d),_0x53660d=_0x340959?_0x2bfa71[_0x60b325(0x203)][_0x60b325(0x1ad)](_0x340959['id'])||[]:[];addFoldersToCreate(_0x298f9c,_0x2bfa71[_0x60b325(0x20c)],_0x57ef01);const _0x536eb4=calculateActivationActions(_0x283624['activations']||[],_0x53660d,_0x2bfa71['idToEmailMap'],_0x2bfa71[_0x60b325(0x146)]);for(const _0x3e868d of _0x536eb4){(_0x3e868d[_0x60b325(0x1bd)]===_0x60b325(0x150)||_0x3e868d[_0x60b325(0x1bd)]===_0x60b325(0x201))&&_0x3e868d['yamlActivation']&&(_0x3e868d[_0x60b325(0x159)]=await _0x359a80(_0x3e868d[_0x60b325(0x197)],_0x15c496));}const _0x252f78=calculateSegmentDiff(_0x283624,_0x340959,_0x53660d,_0x2bfa71['idToEmailMap'],_0x2bfa71[_0x60b325(0x146)]);_0x428841[_0x60b325(0x1dd)]({'relativePath':_0x283624[_0x60b325(0x14d)],'absolutePath':_0x41a2bc,'yamlConfig':_0x283624,'folderPath':_0x298f9c,'existingSegment':_0x340959,'existingActivations':_0x53660d,'isNew':_0x252f78['isNew'],'hasChanges':_0x252f78[_0x60b325(0x12d)],'diff':_0x252f78['diff'],'activationActions':_0x536eb4});}return{'segmentFiles':_0x428841,'foldersToCreate':_0x57ef01};}export async function prepareJourneyFiles(_0x3429e9,_0x3e23ed,_0x35985d,_0x3cb98b){const _0x16948d=a114_0x2d62e8,_0x1434e8=[],_0x3c295f=new Set();for(const {yamlConfig:_0x5f3c9b,folderPath:_0x5acebb,sourcePath:_0x205244}of _0x3429e9){const _0x4f7060=resolveTDFolderPath(_0x5acebb,_0x35985d,_0x3cb98b),_0x18585e=_0x4f7060+':'+_0x5f3c9b[_0x16948d(0x14d)],_0x2c7926=_0x3e23ed[_0x16948d(0x1a1)][_0x16948d(0x1ad)](_0x18585e);let _0x24760b,_0x13832;if(_0x2c7926&&_0x2c7926[_0x16948d(0x19b)]>0x0){const _0x2517a0=buildLocalExpandedRuleMappings(_0x5f3c9b),{createYamlContext:_0x18b488,prefetchJourneySegments:_0x1a5ce7}=createPushYamlContextForBundle(_0x3e23ed[_0x16948d(0x140)],_0x3e23ed[_0x16948d(0x15a)],_0x3e23ed[_0x16948d(0x1c1)],_0x2517a0,_0x3e23ed['idToEmailMap'],_0x3e23ed[_0x16948d(0x146)],_0x3e23ed[_0x16948d(0x19f)],_0x3e23ed['journeyById']);await _0x1a5ce7(_0x2c7926['map'](_0x194701=>_0x194701['id']));const _0x2c5a30=hasMultipleVersions(_0x5f3c9b),_0x44c316=async _0x3a4253=>{const _0x2b2021=_0x16948d,_0x47f3f3=_0x3e23ed[_0x2b2021(0x13e)]?.[_0x2b2021(0x1ad)](_0x3a4253);if(_0x47f3f3)return _0x47f3f3;return _0x3e23ed[_0x2b2021(0x228)]({'journeyId':_0x3a4253,'journeyName':_0x5f3c9b[_0x2b2021(0x14d)],'isMultiVersion':_0x2c7926[_0x2b2021(0x19b)]>0x1});};if(_0x2c5a30&&_0x2c7926['length']>0x1){const _0x50c7d6=[];for(const _0x3ecd5d of _0x2c7926){const _0x31f331=_0x3ecd5d['versionNumber']||0x1;_0x3e23ed[_0x16948d(0x1a0)]?.[_0x16948d(0x201)]('Fetching\x20'+_0x5f3c9b[_0x16948d(0x14d)]+'\x20v'+_0x31f331);const _0x336637=await _0x44c316(_0x3ecd5d['id']),_0xd5ea67=_0x18b488(_0x3ecd5d['id']),_0x1f0e7e=await journeyResponseToDef(_0x336637,_0xd5ea67);_0x50c7d6[_0x16948d(0x1dd)]({'item':_0x3ecd5d,'yaml':_0x1f0e7e});}const _0x4f46b9=buildLocalRuleToNameMappingFromJourney(_0x5f3c9b);_0x13832=buildMergedJourneyDef(_0x50c7d6,_0x4f46b9);const _0x46a67e=Math['max'](..._0x50c7d6[_0x16948d(0x1ac)](_0x51844d=>_0x51844d[_0x16948d(0x183)][_0x16948d(0x19c)]||0x0)),_0x470609=_0x2c7926['find'](_0x15d782=>(_0x15d782[_0x16948d(0x19c)]||0x0)===_0x46a67e);_0x470609&&(_0x3e23ed[_0x16948d(0x1a0)]?.[_0x16948d(0x201)](_0x16948d(0x17b)+_0x5f3c9b['name']+'\x20v'+_0x46a67e),_0x24760b=await _0x44c316(_0x470609['id']));}else{const _0x2a7f0c=_0x2c7926[_0x2c7926[_0x16948d(0x19b)]-0x1];_0x3e23ed[_0x16948d(0x1a0)]?.[_0x16948d(0x201)](_0x16948d(0x17b)+_0x5f3c9b[_0x16948d(0x14d)]),_0x24760b=await _0x44c316(_0x2a7f0c['id']);const _0xa0e68b=_0x18b488(_0x2a7f0c['id']),_0x4cb2d5=await journeyResponseToDef(_0x24760b,_0xa0e68b),_0x5839dd=buildLocalRuleToNameMappingFromJourney(_0x5f3c9b);_0x13832=buildMergedJourneyDef([{'item':_0x2a7f0c,'yaml':_0x4cb2d5}],_0x5839dd);}}addFoldersToCreate(_0x4f7060,_0x3e23ed[_0x16948d(0x20c)],_0x3c295f);const _0x53d9a8=calculateJourneyDiff(_0x5f3c9b,_0x13832);_0x1434e8[_0x16948d(0x1dd)]({'relativePath':_0x5f3c9b[_0x16948d(0x14d)],'absolutePath':_0x205244,'yamlConfig':_0x5f3c9b,'folderPath':_0x4f7060,'existingJourney':_0x24760b,'isNew':_0x53d9a8['isNew'],'hasChanges':_0x53d9a8[_0x16948d(0x12d)],'diff':_0x53d9a8[_0x16948d(0x17a)]});}return{'journeyFiles':_0x1434e8,'foldersToCreate':_0x3c295f};}export function calculateActivationActions(_0x5eaf2c,_0x1d1fa8,_0x2b26e2,_0x2aab46){const _0x5c396d=a114_0x2d62e8,_0x4ca1a9=[],_0x2d2bc3=new Map();for(const _0x281524 of _0x1d1fa8){_0x2d2bc3[_0x5c396d(0x14a)](_0x281524[_0x5c396d(0x14d)],_0x281524);}const _0x537b64=new Map();for(const _0x3823d4 of _0x5eaf2c){_0x537b64[_0x5c396d(0x14a)](_0x3823d4[_0x5c396d(0x14d)],_0x3823d4);}for(const _0x282bae of _0x5eaf2c){const _0x4e1ee7=_0x2d2bc3[_0x5c396d(0x1ad)](_0x282bae['name']);if(!_0x4e1ee7)_0x4ca1a9[_0x5c396d(0x1dd)]({'type':_0x5c396d(0x150),'name':_0x282bae[_0x5c396d(0x14d)],'yamlActivation':_0x282bae});else{const _0x91e0e3=activationResponseToDef(_0x4e1ee7,_0x2b26e2,_0x2aab46),_0x10414f=a114_0x41aa40[_0x5c396d(0x1ba)](_0x91e0e3),_0x2b7a32=a114_0x41aa40[_0x5c396d(0x1ba)](_0x282bae);_0x10414f!==_0x2b7a32&&_0x4ca1a9['push']({'type':_0x5c396d(0x201),'name':_0x282bae[_0x5c396d(0x14d)],'yamlActivation':_0x282bae,'existingActivation':_0x4e1ee7});}}for(const _0x229427 of _0x1d1fa8){!_0x537b64[_0x5c396d(0x1b2)](_0x229427['name'])&&_0x4ca1a9['push']({'type':_0x5c396d(0x1c4),'name':_0x229427[_0x5c396d(0x14d)],'existingActivation':_0x229427});}return _0x4ca1a9;}function calculateYamlDiff(_0x5ca34a,_0x4a14d3){if(_0x4a14d3){const _0x405070=generateDiff(_0x4a14d3,_0x5ca34a),_0x422aff=hasChanges(_0x405070);return{'isNew':![],'hasChanges':_0x422aff,'diff':_0x422aff?formatDiffWithColors(_0x405070):undefined};}const _0x2b8fbd=generateDiff('',_0x5ca34a);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2b8fbd)};}export function calculateSegmentDiff(_0x50fd59,_0x4b389a,_0x326676,_0x394e0b,_0x23d8bf){const _0x38e5d8=segmentToYamlString(_0x50fd59),_0x5e236f=_0x4b389a?segmentToYamlString(segmentWithActivationsToYaml(_0x4b389a,_0x326676,undefined,_0x394e0b,_0x23d8bf)):undefined;return calculateYamlDiff(_0x38e5d8,_0x5e236f);}export function calculateJourneyDiff(_0x338aa8,_0x4adc0d){const _0x1a5cee=normalizeJourneyDef(_0x338aa8,_0x338aa8),_0x433182=a114_0x42da57(_0x1a5cee),_0x5332cb=_0x4adc0d?a114_0x42da57(normalizeJourneyDef(_0x4adc0d,_0x338aa8)):undefined;return calculateYamlDiff(_0x433182,_0x5332cb);}export function findSegmentsToDelete(_0x419b09,_0x5ba481,_0x43b44b,_0x37d7a4,_0x213444){const _0x3bd11e=a114_0x2d62e8,_0x124d3d=new Set();for(const {yamlConfig:_0x29ecfb,folderPath:_0x3dcb22}of _0x5ba481){_0x124d3d[_0x3bd11e(0x1d9)](_0x3dcb22+':'+_0x29ecfb[_0x3bd11e(0x14d)]);}return _0x419b09[_0x3bd11e(0x141)](_0x398dcd=>{const _0x370e00=_0x3bd11e,_0x10bd71=_0x398dcd[_0x370e00(0x1f4)]?_0x43b44b[_0x370e00(0x1ad)](_0x398dcd[_0x370e00(0x1f4)][_0x370e00(0x169)]())||'':'',_0x46cdd9=_0x10bd71+':'+_0x398dcd[_0x370e00(0x14d)];if(_0x124d3d[_0x370e00(0x1b2)](_0x46cdd9))return![];if(_0x213444)return _0x10bd71===_0x37d7a4||_0x10bd71['startsWith'](_0x37d7a4+'/');return!![];});}export function findJourneysToDelete(_0x35feff,_0x16f476,_0x33c84c,_0x9e1891,_0x10b8a4){const _0x5ab94d=a114_0x2d62e8,_0x3f1ebb=new Set();for(const {yamlConfig:_0x5cd609,folderPath:_0x1c96b}of _0x16f476){_0x3f1ebb[_0x5ab94d(0x1d9)](_0x1c96b+':'+_0x5cd609[_0x5ab94d(0x14d)]);}return _0x35feff[_0x5ab94d(0x141)](_0x20504f=>{const _0x2d8f7a=_0x5ab94d,_0x145735=_0x20504f['folderId']?_0x33c84c['get'](_0x20504f[_0x2d8f7a(0x224)])||'':'',_0x1dc25f=_0x145735+':'+_0x20504f[_0x2d8f7a(0x21a)];if(_0x3f1ebb[_0x2d8f7a(0x1b2)](_0x1dc25f))return![];if(_0x10b8a4)return _0x145735===_0x9e1891||_0x145735['startsWith'](_0x9e1891+'/');return!![];});}export function buildSegmentLookupMap(_0x28b57f,_0x44c85b){const _0x6df21e=a114_0x2d62e8,_0x47b9d1=new Map();for(const _0x2beecb of _0x28b57f){const _0x107463=_0x2beecb[_0x6df21e(0x1f4)]?_0x44c85b[_0x6df21e(0x1ad)](_0x2beecb[_0x6df21e(0x1f4)][_0x6df21e(0x169)]())||'':'',_0x261512=_0x107463+':'+_0x2beecb[_0x6df21e(0x14d)];_0x47b9d1[_0x6df21e(0x14a)](_0x261512,_0x2beecb);}return _0x47b9d1;}export function buildSegmentNameToIdMap(_0x1e0b30){const _0x1968e7=a114_0x2d62e8,_0x2fc258=new Map();for(const _0x41f9c8 of _0x1e0b30){_0x2fc258['set'](_0x41f9c8[_0x1968e7(0x14d)],_0x41f9c8['id']);}return _0x2fc258;}export function buildJourneyBundleLookupMap(_0x5e7681,_0x367d5a){const _0x54fe3a=a114_0x2d62e8,_0x16dd6a=new Map();for(const _0xeff505 of _0x5e7681){const _0x3f98db=_0xeff505[_0x54fe3a(0x224)]?_0x367d5a['get'](_0xeff505[_0x54fe3a(0x224)])||'':'',_0x5c0407=_0x3f98db+':'+_0xeff505['journeyBundleName'];!_0x16dd6a['has'](_0x5c0407)&&_0x16dd6a[_0x54fe3a(0x14a)](_0x5c0407,[]),_0x16dd6a[_0x54fe3a(0x1ad)](_0x5c0407)['push'](_0xeff505);}for(const _0x3e642f of _0x16dd6a[_0x54fe3a(0x1d2)]()){_0x3e642f[_0x54fe3a(0x22f)]((_0x87825d,_0x5b43f0)=>(_0x87825d[_0x54fe3a(0x19c)]||0x0)-(_0x5b43f0[_0x54fe3a(0x19c)]||0x0));}return _0x16dd6a;}export function collectFoldersToCreate(_0x5c42da,_0x37a499){const _0x75d2ef=a114_0x2d62e8,_0x1b2c0d=new Set();for(const _0x9fb63a of _0x5c42da){if(!_0x9fb63a)continue;if(_0x37a499[_0x75d2ef(0x1b2)](_0x9fb63a))continue;const _0x4193b7=_0x9fb63a[_0x75d2ef(0x205)]('/');let _0x1c8350='';for(const _0x148e68 of _0x4193b7){_0x1c8350=_0x1c8350?_0x1c8350+'/'+_0x148e68:_0x148e68,!_0x37a499[_0x75d2ef(0x1b2)](_0x1c8350)&&_0x1b2c0d[_0x75d2ef(0x1d9)](_0x1c8350);}}return _0x1b2c0d;}export function parseAndClassifyYamlFiles(_0x4c943a,_0x1113a9,_0x1e2df5){const _0x355262=a114_0x2d62e8,_0x40dcf2=[],_0xf502c5=[];for(const _0x1b297c of _0x4c943a){const _0x4896ff=a114_0x306e1b[_0x355262(0x220)](_0x1113a9,a114_0x306e1b[_0x355262(0x204)](_0x1b297c)),_0x4a0dab=_0x4896ff==='.'?'':_0x4896ff,_0x392c8c=readFileSync(_0x1b297c,'utf-8'),_0xa0f333=a114_0x41aa40[_0x355262(0x1c2)](_0x392c8c);if(isJourneyDef(_0xa0f333)){const _0x31a473=a114_0x12465b(_0x392c8c);_0xf502c5['push']({'yamlConfig':_0x31a473,'folderPath':_0x4a0dab,'sourcePath':_0x1b297c});}else{if(!_0x1e2df5?.[_0x355262(0x17d)]){const _0x1e187f=parseSegmentYamlFile(_0x392c8c),_0x1949fa=normalizeChildSegmentYaml(_0x1e187f);_0x40dcf2['push']({'yamlConfig':_0x1949fa,'folderPath':_0x4a0dab,'sourcePath':_0x1b297c});}}}return{'segments':_0x40dcf2,'journeys':_0xf502c5};}export function validateParsedFiles(_0x15621a,_0x3c3068){const _0x36eb8b=a114_0x2d62e8,_0x2ea03f=[];for(const {yamlConfig:_0x2b5f69,sourcePath:_0x462b2c}of _0x15621a[_0x36eb8b(0x1ab)]){const _0x2a7280=readFileSync(_0x462b2c,'utf-8'),_0x575a0b=a114_0x41aa40[_0x36eb8b(0x163)](_0x2a7280),_0x4f12fe=validateSegmentDef(_0x2b5f69,{'source':_0x2a7280,'document':_0x575a0b});if(!_0x4f12fe['valid']){const _0x1d25ee=a114_0x306e1b[_0x36eb8b(0x220)](_0x3c3068,_0x462b2c);_0x2ea03f[_0x36eb8b(0x1dd)]({'filePath':_0x1d25ee,'source':_0x2a7280,'result':_0x4f12fe,'isJourney':![]});}}for(const {yamlConfig:_0x2d2b8f,sourcePath:_0x12ea2f}of _0x15621a[_0x36eb8b(0x13b)]){const _0x6b6d73=readFileSync(_0x12ea2f,_0x36eb8b(0x1b6)),_0x11fe63=a114_0x41aa40[_0x36eb8b(0x163)](_0x6b6d73),_0x13f39f=validateJourneyDef(_0x2d2b8f,{'source':_0x6b6d73,'document':_0x11fe63});if(!_0x13f39f[_0x36eb8b(0x1b1)]){const _0x387d4a=a114_0x306e1b['relative'](_0x3c3068,_0x12ea2f);_0x2ea03f[_0x36eb8b(0x1dd)]({'filePath':_0x387d4a,'source':_0x6b6d73,'result':_0x13f39f,'isJourney':!![]});}}return _0x2ea03f;}export function formatValidationErrors(_0x15c298){const _0x2a0c4d=a114_0x2d62e8,_0x22d532=[];for(const {filePath:_0x493550,source:_0x48a737,result:_0x195e54,isJourney:_0x30843b}of _0x15c298){const _0x345ad3=_0x30843b?_0x2a0c4d(0x231):'segment';_0x22d532[_0x2a0c4d(0x1dd)]('\x0a'+_0x493550+'\x20('+_0x345ad3+_0x2a0c4d(0x14e)+_0x195e54[_0x2a0c4d(0x12f)][_0x2a0c4d(0x19b)]+_0x2a0c4d(0x145)),_0x22d532['push'](formatValidationResult(_0x195e54,_0x48a737,_0x493550));}return _0x22d532[_0x2a0c4d(0x212)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x153e7a){const _0x1ee06c=a114_0x2d62e8,_0x39fdba=new Set(),_0x1103d6=new Map(),_0xac1896=collectSegmentUsageCounts(_0x153e7a);if(_0x153e7a[_0x1ee06c(0x1ab)])for(const [_0x1e5cc5,_0x4b7688]of Object[_0x1ee06c(0x1c7)](_0x153e7a[_0x1ee06c(0x1ab)])){_0x39fdba['add'](_0x1e5cc5);if(_0x4b7688['rule']){const _0x2c7ef4=yamlRuleToApi(_0x4b7688[_0x1ee06c(0x215)]),_0x445966=apiRuleToYaml(_0x2c7ef4);_0x1103d6[_0x1ee06c(0x14a)](_0x1e5cc5,_0x445966);}}const _0x487e6a=new Map();let _0x1f5bb7=0x0;for(const [_0x20014c,_0x2b11a8]of _0x1103d6){const _0x48e5fb=serializeExpandedRule(_0x2b11a8,_0x1103d6),_0x38dfe2=_0x487e6a['get'](_0x48e5fb)||[];_0x38dfe2[_0x1ee06c(0x1dd)]({'name':_0x20014c,'index':_0x1f5bb7}),_0x487e6a[_0x1ee06c(0x14a)](_0x48e5fb,_0x38dfe2),_0x1f5bb7++;}const _0x3ce6dd=new Map();for(const [_0x21cbd2,_0x531819]of _0x487e6a){const _0x257ccc=_0x531819[_0x1ee06c(0x1ef)]()[_0x1ee06c(0x22f)]((_0x17278e,_0x2efbe0)=>{const _0x4853d3=_0x1ee06c,_0x1b579f=_0xac1896[_0x4853d3(0x1ad)](_0x17278e[_0x4853d3(0x14d)])||0x0,_0x199dc3=_0xac1896['get'](_0x2efbe0[_0x4853d3(0x14d)])||0x0;if(_0x1b579f!==_0x199dc3)return _0x199dc3-_0x1b579f;return _0x17278e[_0x4853d3(0x20b)]-_0x2efbe0[_0x4853d3(0x20b)];})[_0x1ee06c(0x1ac)](_0x1f4661=>_0x1f4661['name']),_0xc98af7=[];for(const _0x188a3a of _0x257ccc){const _0x1201e6=_0xac1896[_0x1ee06c(0x1ad)](_0x188a3a)||0x0,_0x5400b4=Math[_0x1ee06c(0x221)](_0x1201e6,0x1);for(let _0x3020ae=0x0;_0x3020ae<_0x5400b4;_0x3020ae++){_0xc98af7[_0x1ee06c(0x1dd)](_0x188a3a);}}_0x3ce6dd[_0x1ee06c(0x14a)](_0x21cbd2,_0xc98af7);}return{'existingLocalSegmentNames':_0x39fdba,'localSegmentRules':_0x1103d6,'localExpandedRuleToNames':_0x3ce6dd};}export function createSegmentIdResolver(_0x4900b0,_0x4e9af1){return async _0x3de369=>{const _0x406f62=a114_0x2264,_0x18591b=_0x4900b0['get'](_0x3de369);if(!_0x18591b)throw new SDKError(ErrorCode[_0x406f62(0x173)],_0x406f62(0x1ec)+_0x3de369+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x4e9af1+'\x27)');return _0x18591b;};}export function extractRootFolderId(_0xa58067){const _0x134a08=a114_0x2d62e8;return _0xa58067[_0x134a08(0x1c3)]?.[_0x134a08(0x1f3)]?.[_0x134a08(0x179)]?.['id']||_0xa58067['relationships']?.['parentFolder']?.[_0x134a08(0x179)]?.['id'];}export function buildConnectionMaps(_0x289a9c){const _0x100d43=a114_0x2d62e8,_0xea4845=new Map(),_0x5b2de6=new Map(),_0x9c055a=new Map();for(const _0x1a35c5 of _0x289a9c){_0xea4845[_0x100d43(0x14a)](_0x1a35c5[_0x100d43(0x14d)],parseInt(_0x1a35c5['id'],0xa)),_0x5b2de6[_0x100d43(0x14a)](_0x1a35c5['id'],_0x1a35c5[_0x100d43(0x14d)]),_0x9c055a[_0x100d43(0x14a)](_0x1a35c5[_0x100d43(0x14d)],_0x1a35c5[_0x100d43(0x1bd)]);}return{'nameToId':_0xea4845,'idToName':_0x5b2de6,'nameToType':_0x9c055a};}export function calculatePushStats(_0x148849,_0x3244d5,_0x110702,_0x3a24c6,_0x34dc11,_0x5cd816,_0x5104ef){const _0x5bbee7=a114_0x2d62e8,_0x28a4d3=_0x148849[_0x5bbee7(0x141)](_0x336b85=>_0x336b85[_0x5bbee7(0x136)]),_0x440045=_0x148849[_0x5bbee7(0x141)](_0x19df2b=>!_0x19df2b[_0x5bbee7(0x136)]&&_0x19df2b['hasChanges']),_0x390279=_0x148849[_0x5bbee7(0x141)](_0xca41f=>!_0xca41f[_0x5bbee7(0x136)]&&!_0xca41f['hasChanges']),_0x40a3e1=_0x5cd816?_0x3a24c6:[],_0x2271cc=_0x3244d5[_0x5bbee7(0x141)](_0x536908=>_0x536908[_0x5bbee7(0x136)]),_0x8b452c=_0x3244d5[_0x5bbee7(0x141)](_0x2c5f9b=>!_0x2c5f9b['isNew']&&_0x2c5f9b[_0x5bbee7(0x12d)]),_0x45bd5c=_0x3244d5[_0x5bbee7(0x141)](_0x55ec89=>!_0x55ec89[_0x5bbee7(0x136)]&&!_0x55ec89[_0x5bbee7(0x12d)]),_0x11c11d=_0x5cd816?_0x34dc11:[],_0x546a0a=_0x148849[_0x5bbee7(0x1a3)](_0x3c52d6=>_0x3c52d6[_0x5bbee7(0x213)]),_0x38354e=_0x546a0a['filter'](_0x1e4663=>_0x1e4663[_0x5bbee7(0x1bd)]==='create'),_0x149770=_0x546a0a[_0x5bbee7(0x141)](_0x4789de=>_0x4789de[_0x5bbee7(0x1bd)]===_0x5bbee7(0x201)),_0x77a8a3=_0x546a0a[_0x5bbee7(0x141)](_0x4d4918=>_0x4d4918['type']==='delete'),_0x530f87=Array['from'](_0x110702)[_0x5bbee7(0x22f)](),_0x286868=_0x5104ef?![]:_0x28a4d3[_0x5bbee7(0x19b)]>0x0||_0x440045[_0x5bbee7(0x19b)]>0x0||_0x40a3e1[_0x5bbee7(0x19b)]>0x0,_0x3d7d01=_0x2271cc['length']>0x0||_0x8b452c['length']>0x0||_0x11c11d[_0x5bbee7(0x19b)]>0x0,_0x32b3ca=_0x5104ef?![]:_0x546a0a[_0x5bbee7(0x19b)]>0x0,_0x539d8e=_0x530f87['length']>0x0;return{'segments':{'new':_0x28a4d3,'changed':_0x440045,'unchanged':_0x390279,'toDelete':_0x40a3e1},'journeys':{'new':_0x2271cc,'changed':_0x8b452c,'unchanged':_0x45bd5c,'toDelete':_0x11c11d},'activations':{'all':_0x546a0a,'toCreate':_0x38354e,'toUpdate':_0x149770,'toDelete':_0x77a8a3},'folders':{'toCreate':_0x530f87},'counts':{'segments':{'new':_0x28a4d3[_0x5bbee7(0x19b)],'changed':_0x440045[_0x5bbee7(0x19b)],'unchanged':_0x390279[_0x5bbee7(0x19b)],'toDelete':_0x40a3e1[_0x5bbee7(0x19b)]},'journeys':{'new':_0x2271cc[_0x5bbee7(0x19b)],'changed':_0x8b452c['length'],'unchanged':_0x45bd5c['length'],'toDelete':_0x11c11d[_0x5bbee7(0x19b)]},'activations':{'create':_0x38354e[_0x5bbee7(0x19b)],'update':_0x149770[_0x5bbee7(0x19b)],'delete':_0x77a8a3[_0x5bbee7(0x19b)]},'folders':_0x530f87['length']},'hasChanges':_0x286868||_0x3d7d01||_0x32b3ca||_0x539d8e};}export async function buildPushExecutionContext(_0x30a6fd,_0x46ab71,_0x14fafe,_0x149194,_0x26e04a,_0x48079b){const _0x7abc3d=a114_0x2d62e8,_0x17d230=extractRootFolderId(_0x14fafe),{pathToId:_0x2d9e83,idToPath:_0x159377}=buildFolderMaps(_0x26e04a),_0x3eb1e4=buildSegmentNameToIdMap(_0x149194),_0x36de5a=new Map(),{batchAsync:_0x423552}=await import(_0x7abc3d(0x133)),[_0x4e7fbf,_0x36c266]=await Promise[_0x7abc3d(0x1db)]([_0x30a6fd['user']['buildUserMaps'](),_0x30a6fd[_0x7abc3d(0x190)][_0x7abc3d(0x15c)](),((async()=>{const _0x425537=_0x7abc3d;!_0x48079b&&_0x149194[_0x425537(0x19b)]>0x0&&await _0x423552(_0x149194,async _0x1f3d59=>{const _0x1604c8=_0x425537,_0x1422a2=await _0x30a6fd[_0x1604c8(0x219)][_0x1604c8(0x148)](_0x46ab71,_0x1f3d59['id']);_0x36de5a[_0x1604c8(0x14a)](_0x1f3d59['id'],_0x1422a2);});})())]),{emailToId:_0x5420cd,idToEmail:_0x2d02cc}=_0x4e7fbf,_0x6e9b04=buildConnectionMaps(_0x36c266);return{'rootFolderId':_0x17d230,'folderPathToId':_0x2d9e83,'folderIdToPath':_0x159377,'segmentNameToId':_0x3eb1e4,'activationsBySegmentId':_0x36de5a,'emailToIdMap':_0x5420cd,'idToEmailMap':_0x2d02cc,'connectionNameToIdMap':_0x6e9b04[_0x7abc3d(0x13c)],'connectionIdToNameMap':_0x6e9b04[_0x7abc3d(0x18f)],'connectionNameToTypeMap':_0x6e9b04[_0x7abc3d(0x14f)]};}export function createPushYamlContextForBundle(_0x20378e,_0x5e87c3,_0x39196b,_0x228245,_0x1d6a4a,_0x325b21,_0x4b3a8f,_0x2d5098){const {existingLocalSegmentNames:_0x1a8ce1,localExpandedRuleToNames:_0x263794}=_0x228245,_0xa560ca=new Set(),_0x2fe0d4=new Map(),_0x255d1b=new Map(),_0x13bf24=new Map(),_0x1fbb5e=createJumpTargetCache(),_0x4c4779=new Map(),_0x30cf64=new Map(),_0x2cf886=new Set();let _0x59c210;const _0x51fb6c=_0x4ada81=>{const _0x307bb2={'resolveSegment':async _0x4f186b=>{const _0x2c1db7=a114_0x2264,_0x4f88e9=_0x13bf24[_0x2c1db7(0x1ad)](_0x4f186b);if(_0x4f88e9!==undefined)return{'name':_0x4f88e9,'isJourneyLocal':!![]};try{const _0x721108=await fetchSegment(_0x20378e,_0x5e87c3,_0x4f186b,_0x39196b);if(!_0x721108)throw new Error(_0x2c1db7(0x1e4));const _0x48fbb6=generateJourneyLocalName(_0x721108[_0x2c1db7(0x14d)]),_0x1390c3=_0x721108[_0x2c1db7(0x182)]===SEGMENT_KIND_JOURNEY&&_0x48fbb6!==undefined;let _0x335ab3=_0x721108['name'],_0x39395c;if(_0x1390c3&&_0x721108['rule']){const _0x234d88=apiRuleToYaml(_0x721108[_0x2c1db7(0x215)]);_0x30cf64[_0x2c1db7(0x14a)](_0x4f186b,_0x234d88);const _0x395338=async _0x568092=>{const _0x420771=_0x2c1db7,_0x3f1895=collectSegmentRefsFromRule(_0x568092);for(const _0x43dfc2 of _0x3f1895){if(!_0x30cf64[_0x420771(0x1b2)](_0x43dfc2))try{const _0x2d619b=await fetchSegment(_0x20378e,_0x5e87c3,_0x43dfc2,_0x39196b);if(_0x2d619b?.[_0x420771(0x215)]){const _0x98166a=apiRuleToYaml(_0x2d619b[_0x420771(0x215)]);_0x30cf64['set'](_0x43dfc2,_0x98166a),await _0x395338(_0x98166a);}}catch(_0x31e3a1){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x43dfc2+':\x20'+_0x31e3a1);}}};await _0x395338(_0x234d88);const _0x155ee0=serializeExpandedRule(_0x234d88,_0x30cf64),_0x17f57b=_0x263794[_0x2c1db7(0x1ad)](_0x155ee0);if(_0x17f57b&&_0x17f57b['length']>0x0){const _0x5862c4=_0x2fe0d4['get'](_0x155ee0)||0x0,_0x491102=_0x17f57b[_0x5862c4]||_0x17f57b[_0x17f57b[_0x2c1db7(0x19b)]-0x1];_0x2fe0d4[_0x2c1db7(0x14a)](_0x155ee0,_0x5862c4+0x1),_0x335ab3=_0x491102,_0xa560ca[_0x2c1db7(0x1d9)](_0x335ab3),_0x13bf24[_0x2c1db7(0x14a)](_0x4f186b,_0x335ab3);const _0x411e26=await resolveRuleSegmentRefs(_0x234d88,async _0x35db5a=>{const _0x329585=_0x2c1db7,_0x446858=_0x13bf24['get'](_0x35db5a);if(_0x446858)return _0x446858;const _0x1c5d0c=await _0x59c210[_0x329585(0x20d)](_0x35db5a);return _0x1c5d0c[_0x329585(0x14d)];});_0x39395c={'description':_0x721108[_0x2c1db7(0x1e1)],'rule':_0x411e26};}else{const _0xfd50dd=_0x4c4779['get'](_0x155ee0);if(_0xfd50dd)_0x335ab3=_0xfd50dd,_0x13bf24[_0x2c1db7(0x14a)](_0x4f186b,_0x335ab3);else{if(_0x48fbb6){let _0x26bb1e=_0x48fbb6,_0x349f74=0x2;while(_0xa560ca['has'](_0x26bb1e)||_0x1a8ce1[_0x2c1db7(0x1b2)](_0x26bb1e)){_0x26bb1e=_0x48fbb6+'_'+_0x349f74,_0x349f74++;}_0xa560ca['add'](_0x26bb1e),_0x335ab3=_0x26bb1e;}_0x13bf24[_0x2c1db7(0x14a)](_0x4f186b,_0x335ab3),_0x4c4779[_0x2c1db7(0x14a)](_0x155ee0,_0x335ab3);const _0x47641f=await resolveRuleSegmentRefs(_0x234d88,async _0x108eed=>{const _0x5084f9=_0x2c1db7,_0x183a89=_0x13bf24['get'](_0x108eed);if(_0x183a89)return _0x183a89;const _0xf81d29=await _0x59c210['resolveSegment'](_0x108eed);return _0xf81d29[_0x5084f9(0x14d)];});_0x39395c={'description':_0x721108[_0x2c1db7(0x1e1)],'rule':_0x47641f};}}}return{'name':_0x335ab3,'isJourneyLocal':_0x1390c3,'definition':_0x39395c};}catch(_0x51d2de){return logger[_0x2c1db7(0x1f9)]('Failed\x20to\x20resolve\x20segment\x20'+_0x4f186b+':\x20'+_0x51d2de),{'name':_0x4f186b,'isJourneyLocal':![]};}},'resolveActivation':async _0x1894ec=>{const _0x197ea0=a114_0x2264,_0x2cd574=_0x255d1b[_0x197ea0(0x1ad)](_0x1894ec);if(_0x2cd574!==undefined)return{'name':_0x2cd574,'isJourneyLocal':!![]};try{let _0x16ea0f=_0x4b3a8f?.['get'](_0x1894ec);!_0x16ea0f&&(_0x16ea0f=await _0x20378e[_0x197ea0(0x231)][_0x197ea0(0x20e)](_0x4ada81,_0x1894ec));const _0x575655=_0x16ea0f[_0x197ea0(0x12b)]['activationParams'][_0x197ea0(0x14d)]||_0x1894ec,_0x569a4f=sanitizeYamlKey(_0x575655)||_0x197ea0(0x1e6)+_0x1894ec,_0x3e695e=_0x569a4f;_0x255d1b[_0x197ea0(0x14a)](_0x1894ec,_0x3e695e);const _0x1e0a88=journeyActivationStepToYaml(_0x16ea0f,_0x1d6a4a,_0x325b21);return{'name':_0x3e695e,'isJourneyLocal':!![],'definition':_0x1e0a88};}catch(_0x3090cc){return logger['debug']('Failed\x20to\x20resolve\x20activation\x20'+_0x1894ec+':\x20'+_0x3090cc),{'name':_0x1894ec,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x38bd69,_0x1a4c1c)=>resolveJumpTarget(_0x38bd69,_0x1a4c1c,_0x1fbb5e,async _0x13809f=>{const _0x56a175=a114_0x2264,_0x386c65=_0x2d5098?.[_0x56a175(0x1ad)](_0x13809f);if(_0x386c65)return _0x386c65;return _0x20378e['journey'][_0x56a175(0x178)](_0x13809f);})};return _0x59c210=_0x307bb2,_0x307bb2;},_0x52fde1=async _0x3429a7=>{const _0x13c3d4=a114_0x2264,{collectSegmentIdsFromJourneyApi:_0x96ce41}=await import('./journey-yaml.js'),{batchAsync:_0x20ce0f}=await import(_0x13c3d4(0x133)),_0x53de88=new Set();for(const _0x263617 of _0x3429a7){let _0x319a0e=_0x2d5098?.[_0x13c3d4(0x1ad)](_0x263617);!_0x319a0e&&(_0x319a0e=await _0x20378e[_0x13c3d4(0x231)]['getJourney'](_0x263617));const _0x56dfc1=_0x96ce41(_0x319a0e);for(const _0xd7c0b4 of _0x56dfc1){_0x53de88[_0x13c3d4(0x1d9)](_0xd7c0b4);}}let _0x24df72=Array[_0x13c3d4(0x17c)](_0x53de88);while(_0x24df72[_0x13c3d4(0x19b)]>0x0){const _0x6cf50d=_0x24df72[_0x13c3d4(0x141)](_0x1a8cca=>!_0x2cf886[_0x13c3d4(0x1b2)](_0x1a8cca));if(_0x6cf50d[_0x13c3d4(0x19b)]===0x0)break;const _0x4eb10b=await _0x20ce0f(_0x6cf50d,async _0x93567a=>{_0x2cf886['add'](_0x93567a);const _0x3913c6=await fetchSegment(_0x20378e,_0x5e87c3,_0x93567a,_0x39196b);if(!_0x3913c6)return null;return{'segmentId':_0x93567a,'segment':_0x3913c6};},0xa),_0x4149f9=new Set();for(const _0x3a2598 of _0x4eb10b){if(!_0x3a2598?.[_0x13c3d4(0x219)]?.[_0x13c3d4(0x215)])continue;const _0x5c5baa=apiRuleToYaml(_0x3a2598[_0x13c3d4(0x219)][_0x13c3d4(0x215)]);_0x30cf64[_0x13c3d4(0x14a)](_0x3a2598[_0x13c3d4(0x184)],_0x5c5baa);const _0xfac2e4=collectSegmentRefsFromRule(_0x5c5baa);for(const _0x26757e of _0xfac2e4){!_0x2cf886[_0x13c3d4(0x1b2)](_0x26757e)&&_0x4149f9[_0x13c3d4(0x1d9)](_0x26757e);}}_0x24df72=Array[_0x13c3d4(0x17c)](_0x4149f9);}};return{'createYamlContext':_0x51fb6c,'prefetchJourneySegments':_0x52fde1};}export async function executePushSegments(_0x4a1f25,_0x18a6b7,_0x10b572,_0x41ad24,_0x45a8f8){const _0x415c5d=a114_0x2d62e8,{segmentDefToCreateRequest:_0x339fe1,segmentDefToUpdateRequest:_0x1780cf}=await import(_0x415c5d(0x1fb)),_0x123118=_0x10b572['folderPathToId'],_0x59bef9=0x5,_0x36dc2c=async _0x463734=>{const _0x4af209=_0x415c5d,_0x13b702=_0x463734['folderPath']?_0x123118[_0x4af209(0x1ad)](_0x463734[_0x4af209(0x1b9)]):undefined;let _0x582e31;const _0x48d4d7={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x463734[_0x4af209(0x136)]){_0x45a8f8[_0x4af209(0x208)]?.({'type':'segment_creating','name':_0x463734['yamlConfig']['name']});const _0x30b25f=_0x339fe1(_0x463734[_0x4af209(0x12a)],_0x13b702),_0x392419=await _0x45a8f8[_0x4af209(0x1f6)](_0x4af209(0x1e9)+_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)]+'\x27...',()=>_0x4a1f25[_0x4af209(0x219)][_0x4af209(0x156)](_0x41ad24[_0x4af209(0x15a)],_0x30b25f));_0x582e31=_0x392419[_0x4af209(0x179)]['id'],_0x48d4d7['createdSegmentId']={'name':_0x463734['yamlConfig']['name'],'id':_0x582e31},_0x45a8f8[_0x4af209(0x208)]?.({'type':_0x4af209(0x1b8),'name':_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)],'segmentId':_0x582e31}),_0x45a8f8['logSuccess']?.(_0x4af209(0x1f0)+_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)]+'\x27'),_0x48d4d7['created']=0x1;}else{if(_0x463734[_0x4af209(0x12d)]){_0x45a8f8[_0x4af209(0x208)]?.({'type':_0x4af209(0x22e),'name':_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)]});const _0x1182e6=_0x1780cf(_0x463734[_0x4af209(0x12a)]);_0x13b702!==_0x463734['existingSegment']?.[_0x4af209(0x1f4)]&&(_0x1182e6[_0x4af209(0x1f4)]=_0x13b702?parseInt(_0x13b702,0xa):undefined),await _0x45a8f8[_0x4af209(0x1f6)](_0x4af209(0x1e7)+_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)]+_0x4af209(0x199),()=>_0x4a1f25[_0x4af209(0x219)][_0x4af209(0x192)](_0x41ad24['parentId'],_0x463734[_0x4af209(0x128)]['id'],_0x1182e6)),_0x582e31=_0x463734[_0x4af209(0x128)]['id'],_0x45a8f8[_0x4af209(0x208)]?.({'type':'segment_updated','name':_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)]}),_0x45a8f8[_0x4af209(0x127)]?.('Updated\x20segment\x20\x27'+_0x463734[_0x4af209(0x12a)]['name']+'\x27'),_0x48d4d7[_0x4af209(0x1f1)]=0x1;}else _0x582e31=_0x463734[_0x4af209(0x128)]['id'];}}catch(_0x15e934){const _0x295f4d=isHttp400Error(_0x15e934),_0x5a8cff=_0x295f4d?ErrorCode[_0x4af209(0x15e)]:ErrorCode[_0x4af209(0x225)],_0x2478b1=getErrorMessage(_0x15e934);throw new SDKError(_0x5a8cff,'Failed\x20to\x20'+(_0x463734[_0x4af209(0x136)]?_0x4af209(0x150):_0x4af209(0x201))+_0x4af209(0x202)+_0x463734[_0x4af209(0x1b4)]+'\x0a\x20\x20'+_0x2478b1,_0x15e934);}try{const _0x2ada02=await syncActivationsForSegment(_0x4a1f25,_0x41ad24[_0x4af209(0x15a)],_0x582e31,_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)],_0x463734['activationActions'],_0x45a8f8,_0x463734[_0x4af209(0x1b4)]);_0x48d4d7[_0x4af209(0x1ee)]=_0x2ada02;}catch(_0x4a0f4d){if(_0x4a0f4d instanceof SDKError)throw _0x4a0f4d;throw new SDKError(ErrorCode[_0x4af209(0x1e0)],_0x4af209(0x129)+_0x463734['yamlConfig'][_0x4af209(0x14d)]+'\x27\x20from\x20file:\x20'+_0x463734[_0x4af209(0x1b4)]+_0x4af209(0x1fd)+getErrorMessage(_0x4a0f4d),_0x4a0f4d);}return _0x48d4d7;},_0x520c3f=await batchAsync(_0x18a6b7,_0x36dc2c,_0x59bef9),_0x3fa9e1={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2e20eb of _0x520c3f){_0x3fa9e1[_0x415c5d(0x177)]+=_0x2e20eb['created'],_0x3fa9e1[_0x415c5d(0x1f1)]+=_0x2e20eb[_0x415c5d(0x1f1)],_0x2e20eb[_0x415c5d(0x1d6)]&&_0x3fa9e1[_0x415c5d(0x1a2)][_0x415c5d(0x14a)](_0x2e20eb['createdSegmentId']['name'],_0x2e20eb[_0x415c5d(0x1d6)]['id']),_0x3fa9e1[_0x415c5d(0x1ee)][_0x415c5d(0x177)]+=_0x2e20eb[_0x415c5d(0x1ee)][_0x415c5d(0x177)],_0x3fa9e1[_0x415c5d(0x1ee)][_0x415c5d(0x1f1)]+=_0x2e20eb[_0x415c5d(0x1ee)][_0x415c5d(0x1f1)],_0x3fa9e1[_0x415c5d(0x1ee)][_0x415c5d(0x18a)]+=_0x2e20eb[_0x415c5d(0x1ee)][_0x415c5d(0x18a)];}return _0x3fa9e1;}async function syncActivationsForSegment(_0x1d1552,_0x58222e,_0x341061,_0x49d603,_0x3c9dc7,_0x4e0daf,_0xcd1357){const _0x2651c7=a114_0x2d62e8,_0x19d5a7={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2b1e11 of _0x3c9dc7){try{if(_0x2b1e11[_0x2651c7(0x1bd)]===_0x2651c7(0x150)&&_0x2b1e11[_0x2651c7(0x159)])_0x4e0daf[_0x2651c7(0x208)]?.({'type':'activation_creating','segmentName':_0x49d603,'activationName':_0x2b1e11[_0x2651c7(0x14d)]}),await _0x4e0daf['withProgress'](_0x2651c7(0x1f5)+_0x2b1e11[_0x2651c7(0x14d)]+_0x2651c7(0x199),()=>_0x1d1552['segment']['createActivation'](_0x58222e,_0x341061,_0x2b1e11[_0x2651c7(0x159)])),_0x4e0daf[_0x2651c7(0x208)]?.({'type':'activation_created','segmentName':_0x49d603,'activationName':_0x2b1e11[_0x2651c7(0x14d)]}),_0x4e0daf['logSuccess']?.(_0x2651c7(0x218)+_0x2b1e11['name']+'\x27'),_0x19d5a7[_0x2651c7(0x177)]++;else{if(_0x2b1e11[_0x2651c7(0x1bd)]===_0x2651c7(0x201)&&_0x2b1e11[_0x2651c7(0x159)]&&_0x2b1e11[_0x2651c7(0x166)])_0x4e0daf[_0x2651c7(0x208)]?.({'type':'activation_updating','segmentName':_0x49d603,'activationName':_0x2b1e11['name']}),await _0x4e0daf['withProgress'](_0x2651c7(0x209)+_0x2b1e11['name']+_0x2651c7(0x199),()=>_0x1d1552[_0x2651c7(0x219)]['updateActivation'](_0x58222e,_0x341061,_0x2b1e11[_0x2651c7(0x166)]['id'],_0x2b1e11[_0x2651c7(0x159)])),_0x4e0daf['onProgress']?.({'type':_0x2651c7(0x22a),'segmentName':_0x49d603,'activationName':_0x2b1e11[_0x2651c7(0x14d)]}),_0x4e0daf[_0x2651c7(0x127)]?.(_0x2651c7(0x158)+_0x2b1e11['name']+'\x27'),_0x19d5a7[_0x2651c7(0x1f1)]++;else _0x2b1e11[_0x2651c7(0x1bd)]==='delete'&&_0x2b1e11[_0x2651c7(0x166)]&&(_0x4e0daf[_0x2651c7(0x208)]?.({'type':_0x2651c7(0x186),'segmentName':_0x49d603,'activationName':_0x2b1e11[_0x2651c7(0x14d)]}),await _0x4e0daf[_0x2651c7(0x1f6)](_0x2651c7(0x217)+_0x2b1e11[_0x2651c7(0x14d)]+_0x2651c7(0x199),()=>_0x1d1552[_0x2651c7(0x219)][_0x2651c7(0x1af)](_0x58222e,_0x341061,_0x2b1e11[_0x2651c7(0x166)]['id'])),_0x4e0daf[_0x2651c7(0x208)]?.({'type':_0x2651c7(0x142),'segmentName':_0x49d603,'activationName':_0x2b1e11[_0x2651c7(0x14d)]}),_0x4e0daf[_0x2651c7(0x131)]?.(_0x2651c7(0x160)+_0x2b1e11[_0x2651c7(0x14d)]+'\x27'),_0x19d5a7['deleted']++);}}catch(_0x1a28ed){const _0x1a0f1f=isHttp400Error(_0x1a28ed),_0x2f51dc=_0x1a0f1f?ErrorCode[_0x2651c7(0x135)]:ErrorCode[_0x2651c7(0x1e0)],_0xe41282=getErrorMessage(_0x1a28ed);throw new SDKError(_0x2f51dc,'Failed\x20to\x20'+_0x2b1e11[_0x2651c7(0x1bd)]+_0x2651c7(0x13a)+_0x2b1e11[_0x2651c7(0x14d)]+_0x2651c7(0x1be)+_0xcd1357+'\x0a\x20\x20'+_0xe41282,_0x1a28ed);}}return _0x19d5a7;}export async function executePushFolders(_0x2aec08,_0x1c3956,_0x1e73ca,_0x43735e,_0xbbd393){const _0x458e31=a114_0x2d62e8,_0x701214=new Map(_0x1e73ca);for(const _0x5ceec3 of _0x1c3956){const _0x7110d6=_0x5ceec3[_0x458e31(0x205)]('/'),_0x3f3117=_0x7110d6[_0x7110d6[_0x458e31(0x19b)]-0x1],_0x535440=_0x7110d6[_0x458e31(0x1ef)](0x0,-0x1)[_0x458e31(0x212)]('/'),_0x49a900=_0x701214['get'](_0x535440);_0xbbd393[_0x458e31(0x208)]?.({'type':_0x458e31(0x15d),'folder':_0x5ceec3});const _0x575342={'name':_0x3f3117,'parentFolderId':_0x49a900},_0x2d98c7=await _0xbbd393['withProgress'](_0x458e31(0x1d1)+_0x5ceec3+_0x458e31(0x199),()=>_0x2aec08[_0x458e31(0x219)][_0x458e31(0x137)](_0x43735e[_0x458e31(0x15a)],_0x575342));_0x701214[_0x458e31(0x14a)](_0x5ceec3,_0x2d98c7['data']['id']),_0xbbd393[_0x458e31(0x208)]?.({'type':_0x458e31(0x138),'folder':_0x5ceec3,'folderId':_0x2d98c7[_0x458e31(0x179)]['id']}),_0xbbd393[_0x458e31(0x17f)]?.(_0x458e31(0x1f7)+_0x5ceec3+'\x27');}return _0x701214;}function a114_0x12ff(){const _0x14bdd9=['journeys','nameToId','Activation\x20not\x20found:\x20','journeyById','__pending_','deps','filter','activation_deleted','trim','getSegment','\x20error(s)','connectionIdToNameMap','24ehBxpM','listActivations','find','set','Updated\x20journey\x20\x27','resolvedRule','name','):\x20','nameToType','create','tdx.sdk.push-workflow','uniqueServerName','journeyId','journeyActivationNameToId','behavior','createSegment','steps','Updated\x20activation\x20\x27','validatedRequest','parentId','all_columns','list','folder_creating','SEGMENT_SYNTAX_ERROR','journey_updated','Deleted\x20activation\x20\x27','includes','existingJourney','parseDocument','goal\x20criteria','Entry\x20criteria:\x20','existingActivation','8902586ZyinFr','Failed\x20to\x20','toString','message','10EXQkKT','and\x20the\x20server\x20segment,\x20then\x20retry.','segment_deleted','replace','Activation','94gpEErJ','milestone','resolveJourneyId','SEGMENT_NOT_FOUND','embeddedSegmentNameToId','notification','uniqueSegmentName','created','getJourney','data','diff','Fetching\x20','from','skipSegments','with','logInfo','conditionTimeoutUnit','segmentByFolderAndName','kind','item','segmentId','JOURNEY_UPDATE_ERROR','activation_deleting','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','idToEmailMap',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','deleted','exitCriterias','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','journeyStages','458UdubQl','idToName','connection','toISOString','updateSegmentById','185TCUbJt','waitStepUnit','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','journeyName','yamlActivation','journey_creating','\x27...','embedded_segment_created','length','versionNumber','7458678SSSkRz','WaitStep','activationStepsById','progress','journeyBundlesByFolderAndName','createdSegmentIds','flatMap','stages','12sBjKnr','deleteSegment','state','\x27\x20exit\x20criteria','\x20journey\x20from\x20file:\x20','digest','segments','map','get','Delete\x20the\x20push\x20recovery\x20file\x20(','deleteActivation','decision_point','valid','has','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','absolutePath','entryCriteria','utf-8','stage\x20\x27','segment_created','folderPath','stringify','conditionTimeoutDuration','effectiveFolderId','type','\x27\x20from\x20file:\x20','createJourneySegment','segment_deleting','existingSegments','parse','relationships','delete','getSegmentEntity\x20also\x20failed\x20for\x20','Journey\x20\x27','entries','hex','\x27\x20for\x20','branches','logWarning','getSegmentEntity',').\x20','columns','journeyActivationStepId','waitStep','Creating\x20folder\x20\x27','values','43470bbcEsQ','INTERNAL','getSegment\x20failed\x20for\x20','createdSegmentId','conditionSegmentId','run_after_journey_refresh','add','localName','all','folder','push','waitStepType','day','ACTIVATION_UPDATE_ERROR','description','\x20(referenced\x20in\x20journey\x20','startsWith','Segment\x20not\x20found','goal','activation_','Updating\x20segment\x20\x27','keys','Creating\x20segment\x20\x27','isArray','segmentNameToId','Segment\x20not\x20found:\x20','\x27\x20decision\x20point\x20branch\x20\x27','activations','slice','Created\x20segment\x20\x27','updated','Embedded\x20segment\x20\x27','parentSegmentFolder','segmentFolderId','Creating\x20activation\x20\x27','withProgress','Created\x20folder\x20\x27','entry','debug','action','./child-segment-yaml.js','Condition','\x0a\x20\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','toLowerCase','some','update','\x20segment\x20from\x20file:\x20','activationsBySegmentId','dirname','split','entry_criteria','embedded_activation_creating','onProgress','Updating\x20activation\x20\x27','10773884FtiRXd','index','folderPathToId','resolveSegment','getActivation','NOT_FOUND','journey_entry_criteria_','conditions','join','activationActions','size','rule','\x27\x20entry\x20criteria','Deleting\x20activation\x20\x27','Created\x20activation\x20\x27','segment','journeyBundleName','journey_created','.$1.push-recovery.json','object','schedule','reduce','relative','max','__pending_act_','embedded_segment_creating','folderId','SEGMENT_UPDATE_ERROR','41783IbfYBL','rootFolderId','fetchJourney','\x27\x20milestone','activation_updated','320802wJHPFY','256aoNCrt','Duration','segment_updating','sort','null','journey','DecisionPoint','draft','unchanged','logSuccess','existingSegment','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','yamlConfig','attributes','journey_updating','hasChanges','activationContext','errors','sha1','logDeleted','activation_template_id','../../utils/async.js','connector_config','ACTIVATION_SYNTAX_ERROR','isNew','createFolder','folder_created','13UGiLrE','\x20activation\x20\x27'];a114_0x12ff=function(){return _0x14bdd9;};return a114_0x12ff();}export async function executePushSegmentDeletions(_0x2ea1b9,_0x463f3f,_0xa3764b){const _0x105fb0=a114_0x2d62e8;if(_0x463f3f[_0x105fb0(0x19b)]===0x0)return 0x0;const {batchAsync:_0x4408cf}=await import(_0x105fb0(0x133)),_0x4a6a92=0x5,_0x1ab8a0=await _0x4408cf(_0x463f3f,async _0x1ee32c=>{const _0x362633=_0x105fb0;return _0xa3764b[_0x362633(0x208)]?.({'type':_0x362633(0x1c0),'name':_0x1ee32c[_0x362633(0x14d)]}),await _0x2ea1b9[_0x362633(0x219)][_0x362633(0x1a6)](_0x1ee32c['id']),_0xa3764b[_0x362633(0x208)]?.({'type':_0x362633(0x16d),'name':_0x1ee32c[_0x362633(0x14d)]}),_0xa3764b[_0x362633(0x131)]?.('Deleted\x20segment\x20\x27'+_0x1ee32c['name']+'\x27'),0x1;},_0x4a6a92);return _0x1ab8a0[_0x105fb0(0x21f)]((_0x152970,_0x287225)=>_0x152970+_0x287225,0x0);}export async function executePushJourneys(_0x5476a7,_0x417b13,_0x2981fc,_0x4484b8,_0x46d8ce){const _0x392d74=a114_0x2d62e8,{journeyDefToRequest:_0x257e9f}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x4f6b15,yamlRuleToApi:_0x353612,validateSegmentRule:_0x216cb4}=await import(_0x392d74(0x1fb)),_0x1d53bf={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x529f6f=new Map(_0x2981fc[_0x392d74(0x1eb)]),_0x42e8ca=0x5;for(let _0x1965bf=0x0;_0x1965bf<_0x417b13[_0x392d74(0x19b)];_0x1965bf+=_0x42e8ca){const _0x2e5185=_0x417b13[_0x392d74(0x1ef)](_0x1965bf,_0x1965bf+_0x42e8ca),_0x59e3ed=await Promise['all'](_0x2e5185[_0x392d74(0x1ac)](async _0x2a4b9c=>{const _0x1c79ef=_0x392d74;if(!_0x2a4b9c['isNew']&&!_0x2a4b9c['hasChanges'])return{'action':_0x1c79ef(0x234),'name':_0x2a4b9c[_0x1c79ef(0x12a)][_0x1c79ef(0x14d)],'journeyId':_0x2a4b9c[_0x1c79ef(0x162)]?.['id']};const _0x44293d=_0x2a4b9c[_0x1c79ef(0x1b9)]?_0x2981fc[_0x1c79ef(0x20c)][_0x1c79ef(0x1ad)](_0x2a4b9c[_0x1c79ef(0x1b9)]):undefined;_0x46d8ce[_0x1c79ef(0x208)]?.({'type':_0x2a4b9c[_0x1c79ef(0x136)]?_0x1c79ef(0x198):_0x1c79ef(0x12c),'name':_0x2a4b9c['yamlConfig'][_0x1c79ef(0x14d)]});try{const _0x152140=await executeSingleJourneyPush(_0x5476a7,_0x2a4b9c,{..._0x2981fc,'segmentNameToId':_0x529f6f},{'parentId':_0x4484b8[_0x1c79ef(0x15a)],'rootFolderId':_0x4484b8['rootFolderId'],'folderId':_0x44293d,'verbose':_0x4484b8['verbose']},_0x46d8ce,{'journeyDefToRequest':_0x257e9f,'activationDefToCreateRequest':_0x4f6b15,'yamlRuleToApi':_0x353612,'validateSegmentRule':_0x216cb4});for(const [_0x3e9d50,_0x35ba27]of _0x152140[_0x1c79ef(0x174)]){_0x529f6f[_0x1c79ef(0x14a)](_0x3e9d50,_0x35ba27),_0x1d53bf[_0x1c79ef(0x174)][_0x1c79ef(0x14a)](_0x3e9d50,_0x35ba27);}if(_0x152140[_0x1c79ef(0x1fa)]===_0x1c79ef(0x177))_0x46d8ce['onProgress']?.({'type':_0x1c79ef(0x21b),'name':_0x2a4b9c[_0x1c79ef(0x12a)][_0x1c79ef(0x14d)],'journeyId':_0x152140[_0x1c79ef(0x153)]}),_0x46d8ce[_0x1c79ef(0x127)]?.('Created\x20journey\x20\x27'+_0x2a4b9c['yamlConfig']['name']+'\x27'),_0x1d53bf['created']++;else _0x152140[_0x1c79ef(0x1fa)]==='updated'&&(_0x46d8ce[_0x1c79ef(0x208)]?.({'type':_0x1c79ef(0x15f),'name':_0x2a4b9c[_0x1c79ef(0x12a)]['name']}),_0x46d8ce[_0x1c79ef(0x127)]?.(_0x1c79ef(0x14b)+_0x2a4b9c[_0x1c79ef(0x12a)][_0x1c79ef(0x14d)]+'\x27'),_0x1d53bf['updated']++);return{'action':_0x152140[_0x1c79ef(0x1fa)],'name':_0x2a4b9c[_0x1c79ef(0x12a)][_0x1c79ef(0x14d)],'journeyId':_0x152140[_0x1c79ef(0x153)]};}catch(_0xed7132){const _0x46495e=isHttp400Error(_0xed7132),_0x5a3520=_0x46495e?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x1c79ef(0x185)],_0x3f7b04=getErrorMessage(_0xed7132);throw new SDKError(_0x5a3520,_0x1c79ef(0x168)+(_0x2a4b9c[_0x1c79ef(0x136)]?_0x1c79ef(0x150):_0x1c79ef(0x201))+_0x1c79ef(0x1a9)+_0x2a4b9c[_0x1c79ef(0x1b4)]+_0x1c79ef(0x1fd)+_0x3f7b04,_0xed7132);}}));_0x1d53bf['results'][_0x392d74(0x1dd)](..._0x59e3ed);}return _0x1d53bf;}async function matchExistingJourneySegments(_0x2ccc48,_0x52c9ed,_0x4bc967,_0x11788a,_0x1f5915){const _0x755322=a114_0x2d62e8;if(!_0x52c9ed[_0x755322(0x162)]||!_0x52c9ed[_0x755322(0x12a)]['segments'])return;const _0x4f26b1=new Map();for(const _0x3d17ed of Object[_0x755322(0x1e8)](_0x52c9ed[_0x755322(0x12a)][_0x755322(0x1ab)])){const _0x4b4572=generateDeterministicJourneySegmentName(_0x52c9ed[_0x755322(0x12a)][_0x755322(0x14d)],_0x3d17ed);_0x4f26b1[_0x755322(0x14a)](_0x4b4572,_0x3d17ed);}const _0x1f6281=collectSegmentIdsFromJourneyApi(_0x52c9ed[_0x755322(0x162)]);for(const _0x1c9470 of _0x1f6281){const _0x2f7cf2=await fetchSegment(_0x2ccc48,_0x4bc967,_0x1c9470,_0x11788a);if(!_0x2f7cf2?.['name'])continue;const _0x13f571=_0x4f26b1[_0x755322(0x1ad)](_0x2f7cf2['name']);_0x13f571&&_0x1f5915['set'](_0x13f571,_0x1c9470);}}async function executeSingleJourneyPush(_0x253930,_0x2c724e,_0x1f6293,_0x49e155,_0x19f5db,_0xc79544){const _0x308e72=a114_0x2d62e8,{journeyDefToRequest:_0x1e87cf,activationDefToCreateRequest:_0x950bcb,yamlRuleToApi:_0x1993c0,validateSegmentRule:_0x225df9}=_0xc79544,_0x2ef7b5=new Map(),_0x18539e=new Map();recoverSegmentIdsFromPushRecovery(_0x2c724e,_0x2ef7b5,_0x1f6293[_0x308e72(0x1eb)]);const _0x39398a=new Map(),_0x1c53b8=new Map(),_0x534a17=new Map();let _0x30db4a;const _0x466348=async()=>{const _0x141df4=_0x308e72;if(_0x30db4a)return;_0x30db4a=new Map();if(!_0x2c724e[_0x141df4(0x162)])return;const _0x3a19a7=await _0x253930[_0x141df4(0x231)][_0x141df4(0x148)](_0x2c724e[_0x141df4(0x162)]['id']);for(const _0x2f7e68 of _0x3a19a7){const _0x3a1d43=journeyActivationStepToYaml(_0x2f7e68,_0x1f6293[_0x141df4(0x188)],_0x1f6293[_0x141df4(0x146)]),_0x32da5f=activationSignature(_0x3a1d43);!_0x30db4a[_0x141df4(0x1b2)](_0x32da5f)&&_0x30db4a[_0x141df4(0x14a)](_0x32da5f,_0x2f7e68['id']),_0x3a1d43['name']&&_0x18539e[_0x141df4(0x14a)](_0x3a1d43[_0x141df4(0x14d)],_0x2f7e68['id']);}};await matchExistingJourneySegments(_0x253930,_0x2c724e,_0x49e155[_0x308e72(0x15a)],_0x1f6293[_0x308e72(0x1c1)],_0x1f6293[_0x308e72(0x1eb)]);const _0x5107d1={'resolveSegmentId':async _0x2be65d=>{const _0x872710=_0x308e72,_0x59bd7a=_0x1f6293['segmentNameToId']['get'](_0x2be65d);if(!_0x59bd7a)throw new SDKError(ErrorCode[_0x872710(0x173)],_0x872710(0x1ec)+_0x2be65d+_0x872710(0x1e2)+_0x2c724e[_0x872710(0x12a)][_0x872710(0x14d)]+')');return _0x59bd7a;},'resolveEmbeddedSegmentId':async(_0x3c4e34,_0x2fb219)=>{const _0x4a6acc=_0x308e72,_0x1095bc=_0x1f6293[_0x4a6acc(0x1eb)][_0x4a6acc(0x1ad)](_0x3c4e34);if(_0x1095bc)return _0x1095bc;const _0xd014ca=_0x1f6293['existingSegments'][_0x4a6acc(0x149)](_0x337651=>_0x337651[_0x4a6acc(0x14d)]===_0x3c4e34);if(_0xd014ca)return _0x1f6293['segmentNameToId']['set'](_0x3c4e34,_0xd014ca['id']),_0xd014ca['id'];if(_0x2c724e[_0x4a6acc(0x136)]){const {stageName:_0x31e853,criteriaName:_0x1bdeab}=findSegmentCriteriaLocation(_0x2c724e[_0x4a6acc(0x12a)],_0x3c4e34);return _0x225df9(_0x3c4e34,_0x2fb219[_0x4a6acc(0x215)]),_0x1c53b8[_0x4a6acc(0x14a)](_0x3c4e34,{'definition':_0x2fb219,'stageName':_0x31e853,'criteriaName':_0x1bdeab}),createPendingSegmentId(_0x3c4e34);}const _0x3b256b=_0x2c724e[_0x4a6acc(0x162)]?.['id'];if(!_0x3b256b)throw new SDKError(ErrorCode['INTERNAL'],_0x4a6acc(0x195));const _0x40dbc1=_0x39398a[_0x4a6acc(0x1ad)](_0x3c4e34);if(_0x40dbc1)return _0x40dbc1;const _0x4d102c=((async()=>{const _0x57049d=_0x4a6acc;_0x225df9(_0x3c4e34,_0x2fb219[_0x57049d(0x215)]);const _0x23b1af=generateDeterministicJourneySegmentName(_0x2c724e['yamlConfig'][_0x57049d(0x14d)],_0x3c4e34),_0x1d1e83=_0x1f6293[_0x57049d(0x1c1)][_0x57049d(0x149)](_0x50564a=>_0x50564a[_0x57049d(0x14d)]===_0x23b1af),_0x44701a=createSegmentIdResolver(_0x1f6293[_0x57049d(0x1eb)],_0x3c4e34),_0x4eb6c1=await resolveRuleSegmentIds(_0x2fb219[_0x57049d(0x215)],_0x44701a);let _0x1610de;return _0x1d1e83?(await _0x253930[_0x57049d(0x219)][_0x57049d(0x192)](_0x49e155['parentId'],_0x1d1e83['id'],{'description':_0x2fb219['description']||_0x57049d(0x165)+_0x3c4e34,'rule':_0x1993c0(_0x4eb6c1,!![]),'countPopulation':!![]}),_0x1610de=_0x1d1e83['id'],saveSegmentToPushRecovery(_0x2c724e[_0x57049d(0x1b4)],_0x2c724e[_0x57049d(0x12a)][_0x57049d(0x14d)],_0x3c4e34,{'segmentId':_0x1610de,'uniqueServerName':_0x23b1af,'createdAt':new Date()[_0x57049d(0x191)]()})):_0x1610de=await createOrRecoverEmbeddedSegment(_0x253930,_0x2c724e,{'localName':_0x3c4e34,'uniqueSegmentName':_0x23b1af,'description':_0x2fb219[_0x57049d(0x1e1)]||_0x57049d(0x165)+_0x3c4e34,'journeyId':_0x3b256b,'resolvedRule':_0x4eb6c1,'parentId':_0x49e155[_0x57049d(0x15a)],'folderId':_0x49e155[_0x57049d(0x227)]||''},_0x1993c0),_0x1f6293['segmentNameToId']['set'](_0x3c4e34,_0x1610de),_0x2ef7b5[_0x57049d(0x14a)](_0x3c4e34,_0x1610de),_0x1610de;})());_0x39398a['set'](_0x3c4e34,_0x4d102c);try{return await _0x4d102c;}finally{_0x39398a[_0x4a6acc(0x1c4)](_0x3c4e34);}},'resolveActivationId':async _0x42b315=>{const _0x2dc71a=_0x308e72,_0x1a6fef=_0x18539e[_0x2dc71a(0x1ad)](_0x42b315);if(_0x1a6fef)return _0x1a6fef;if(_0x2c724e[_0x2dc71a(0x162)]){await _0x466348();const _0x4bd76b=_0x18539e[_0x2dc71a(0x1ad)](_0x42b315);if(_0x4bd76b)return _0x4bd76b;}throw new SDKError(ErrorCode[_0x2dc71a(0x20f)],_0x2dc71a(0x13d)+_0x42b315+'\x20(referenced\x20in\x20journey\x20'+_0x2c724e['yamlConfig'][_0x2dc71a(0x14d)]+_0x2dc71a(0x1cd)+_0x2dc71a(0x1fe));},'resolveEmbeddedActivationId':async(_0x3444f6,_0x1f672a)=>{const _0x57d925=_0x308e72,_0x1961f5=_0x18539e[_0x57d925(0x1ad)](_0x3444f6);if(_0x1961f5)return _0x1961f5;if(_0x2c724e[_0x57d925(0x136)])return _0x534a17[_0x57d925(0x14a)](_0x3444f6,_0x1f672a),createPendingActivationId(_0x3444f6);if(_0x2c724e[_0x57d925(0x162)]){await _0x466348();const _0x492667=_0x18539e[_0x57d925(0x1ad)](_0x1f672a['name']);if(_0x492667)return _0x18539e['set'](_0x3444f6,_0x492667),_0x492667;const _0x4873f1=activationSignature(_0x1f672a),_0x4ff9be=_0x30db4a?.[_0x57d925(0x1ad)](_0x4873f1);if(_0x4ff9be)return _0x18539e[_0x57d925(0x14a)](_0x3444f6,_0x4ff9be),_0x4ff9be;const _0x30c7b0=await _0x950bcb(_0x1f672a,_0x1f6293[_0x57d925(0x12e)]),_0x113ea2={..._0x30c7b0,..._0x1f672a[_0x57d925(0x1d8)]!==undefined&&{'runAfterJourneyRefresh':_0x1f672a[_0x57d925(0x1d8)]}},_0x2fb542=await _0x253930['journey']['createActivation'](_0x2c724e[_0x57d925(0x162)]['id'],_0x113ea2);return _0x18539e[_0x57d925(0x14a)](_0x3444f6,_0x2fb542['id']),_0x2fb542['id'];}throw new SDKError(ErrorCode[_0x57d925(0x1d4)],_0x57d925(0x1b3));},'resolveJourneyId':async _0xac0a8=>{const _0x3b2197=_0x308e72;try{return await _0x253930[_0x3b2197(0x231)][_0x3b2197(0x172)](_0x49e155[_0x3b2197(0x15a)],_0xac0a8);}catch(_0x5891eb){throw new SDKError(ErrorCode[_0x3b2197(0x20f)],_0x3b2197(0x1c6)+_0xac0a8+_0x3b2197(0x18c)+_0x2c724e[_0x3b2197(0x12a)][_0x3b2197(0x14d)]+'\x27)',_0x5891eb);}},'resolveStageId':async(_0x1cb02c,_0x11d39b)=>{const _0x121aab=_0x308e72,_0x4048b1=await _0x253930['journey']['getJourney'](_0x1cb02c),_0x265c96=_0x4048b1[_0x121aab(0x12b)][_0x121aab(0x18d)][_0x121aab(0x149)](_0x373ff7=>_0x373ff7[_0x121aab(0x14d)]['toLowerCase']()===_0x11d39b[_0x121aab(0x1ff)]());if(!_0x265c96?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x11d39b+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x4048b1[_0x121aab(0x12b)][_0x121aab(0x21a)]||_0x4048b1['attributes']['name'])+'\x27');return _0x265c96['id'];}},_0x19d9fb=await _0x1e87cf(_0x2c724e[_0x308e72(0x12a)],_0x49e155[_0x308e72(0x15a)],_0x5107d1),_0x281a87=_0x49e155[_0x308e72(0x224)]||_0x49e155[_0x308e72(0x227)];_0x281a87&&(_0x19d9fb[_0x308e72(0x1c3)]={'parentFolder':{'data':{'id':_0x281a87,'type':_0x308e72(0x1dc)}}});if(_0x2c724e[_0x308e72(0x136)]){if(_0x1c53b8[_0x308e72(0x214)]>0x0||_0x534a17[_0x308e72(0x214)]>0x0)return await executeThreeStepJourneyCreate(_0x253930,_0x2c724e,_0x19d9fb,{'pendingEmbeddedSegments':_0x1c53b8,'pendingEmbeddedActivations':_0x534a17,'embeddedSegmentNameToId':_0x2ef7b5,'journeyActivationNameToId':_0x18539e},{..._0x49e155,'effectiveFolderId':_0x281a87},_0x1f6293,_0x19f5db,_0xc79544);else{ensureJourneyDefaults(_0x19d9fb[_0x308e72(0x12b)]);const _0x77e1c=await _0x253930[_0x308e72(0x231)][_0x308e72(0x150)](_0x19d9fb);return deletePushRecovery(_0x2c724e[_0x308e72(0x1b4)]),{'action':_0x308e72(0x177),'journeyId':_0x77e1c['id'],'embeddedSegmentNameToId':_0x2ef7b5};}}else{if(_0x2c724e['hasChanges']&&_0x2c724e['existingJourney'])return ensureJourneyDefaults(_0x19d9fb[_0x308e72(0x12b)]),await _0x253930[_0x308e72(0x231)][_0x308e72(0x201)](_0x2c724e[_0x308e72(0x162)]['id'],_0x19d9fb),deletePushRecovery(_0x2c724e['absolutePath']),{'action':'updated','journeyId':_0x2c724e[_0x308e72(0x162)]['id'],'embeddedSegmentNameToId':_0x2ef7b5};}return deletePushRecovery(_0x2c724e[_0x308e72(0x1b4)]),{'action':_0x308e72(0x234),'journeyId':_0x2c724e[_0x308e72(0x162)]?.['id'],'embeddedSegmentNameToId':_0x2ef7b5};}function findSegmentCriteriaLocation(_0x2158fa,_0x1816a8){const _0x2c081d=a114_0x2d62e8,_0x2c7b56=_0x2158fa[_0x2c081d(0x1a4)]||_0x2158fa[_0x2c081d(0x13b)]?.[0x0]?.[_0x2c081d(0x1a4)]||[];let _0x547460=_0x2c081d(0x1f8),_0x3a3188=_0x1816a8;const _0x526b5c=_0x2158fa['goal']||_0x2158fa['journeys']?.[0x0]?.[_0x2c081d(0x1e5)];if(_0x526b5c?.[_0x2c081d(0x219)]===_0x1816a8)return{'stageName':_0x2c081d(0x1e5),'criteriaName':_0x526b5c[_0x2c081d(0x14d)]||_0x1816a8};_0x28fed7:for(const _0x74bb63 of _0x2c7b56){if(_0x74bb63[_0x2c081d(0x206)]?.[_0x2c081d(0x219)]===_0x1816a8){_0x547460=_0x74bb63[_0x2c081d(0x14d)],_0x3a3188=_0x74bb63[_0x2c081d(0x206)]['name']||_0x1816a8;break;}if(_0x74bb63[_0x2c081d(0x157)])for(const _0x3e55e5 of _0x74bb63[_0x2c081d(0x157)]){if(_0x3e55e5[_0x2c081d(0x1bd)]===_0x2c081d(0x1b0)&&_0x3e55e5[_0x2c081d(0x17e)]?.[_0x2c081d(0x1ca)])for(const _0x4d1f83 of _0x3e55e5[_0x2c081d(0x17e)][_0x2c081d(0x1ca)]){if(_0x4d1f83[_0x2c081d(0x219)]===_0x1816a8){_0x547460=_0x74bb63['name'],_0x3a3188=_0x4d1f83[_0x2c081d(0x14d)]||_0x1816a8;break _0x28fed7;}}}}return{'stageName':_0x547460,'criteriaName':_0x3a3188};}async function executeThreeStepJourneyCreate(_0x3947e7,_0x3cc0fb,_0xbe93ee,_0x1f20e5,_0x23a794,_0x1c59b0,_0x22c4da,_0x563063){const _0x5152d6=a114_0x2d62e8,{activationDefToCreateRequest:_0x133e3d,yamlRuleToApi:_0x7c14a6}=_0x563063,{pendingEmbeddedSegments:_0x359834,pendingEmbeddedActivations:_0xda5ade,embeddedSegmentNameToId:_0x2f1a6a}=_0x1f20e5,_0x192765=JSON[_0x5152d6(0x1c2)](JSON['stringify'](_0xbe93ee));ensureJourneyDefaults(_0x192765[_0x5152d6(0x12b)]),stripPendingIds(_0x192765);const _0x132c62=await _0x3947e7[_0x5152d6(0x231)]['create'](_0x192765),_0x3a2013=_0x132c62['id'],_0x4cbc34=new Map();for(const _0x555e3f of _0x132c62[_0x5152d6(0x12b)][_0x5152d6(0x18d)]){_0x4cbc34[_0x5152d6(0x14a)](_0x555e3f[_0x5152d6(0x14d)][_0x5152d6(0x1ff)](),_0x555e3f['id']);}recoverSegmentIdsFromPushRecovery(_0x3cc0fb,_0x2f1a6a,_0x1c59b0[_0x5152d6(0x1eb)]);for(const [_0x3f4746,{definition:_0x218b47}]of _0x359834){if(_0x2f1a6a[_0x5152d6(0x1b2)](_0x3f4746)){_0x22c4da[_0x5152d6(0x208)]?.({'type':_0x5152d6(0x19a),'journeyName':_0x3cc0fb[_0x5152d6(0x12a)][_0x5152d6(0x14d)],'segmentName':_0x3f4746});continue;}const _0x8d30a8=generateDeterministicJourneySegmentName(_0x3cc0fb[_0x5152d6(0x12a)][_0x5152d6(0x14d)],_0x3f4746);_0x22c4da[_0x5152d6(0x208)]?.({'type':_0x5152d6(0x223),'journeyName':_0x3cc0fb['yamlConfig']['name'],'segmentName':_0x3f4746});const _0x46a832=createSegmentIdResolver(_0x1c59b0[_0x5152d6(0x1eb)],_0x3f4746),_0x1f0d44=await resolveRuleSegmentIds(_0x218b47[_0x5152d6(0x215)],_0x46a832),_0x106d1a=await createOrRecoverEmbeddedSegment(_0x3947e7,_0x3cc0fb,{'localName':_0x3f4746,'uniqueSegmentName':_0x8d30a8,'description':_0x218b47[_0x5152d6(0x1e1)]||_0x5152d6(0x165)+_0x3f4746,'journeyId':_0x3a2013,'resolvedRule':_0x1f0d44,'parentId':_0x23a794[_0x5152d6(0x15a)],'folderId':_0x23a794[_0x5152d6(0x1bc)]||''},_0x7c14a6);_0x2f1a6a[_0x5152d6(0x14a)](_0x3f4746,_0x106d1a),_0x1c59b0['segmentNameToId']['set'](_0x3f4746,_0x106d1a),_0x22c4da[_0x5152d6(0x208)]?.({'type':_0x5152d6(0x19a),'journeyName':_0x3cc0fb['yamlConfig'][_0x5152d6(0x14d)],'segmentName':_0x3f4746});}const _0x225381=new Map();for(const [_0x3a8c93,_0x1c48f2]of _0xda5ade){_0x22c4da['onProgress']?.({'type':_0x5152d6(0x207),'journeyName':_0x3cc0fb['yamlConfig'][_0x5152d6(0x14d)],'activationName':_0x3a8c93});const _0x6e458a=await _0x133e3d(_0x1c48f2,_0x1c59b0['activationContext']),_0x11408b={..._0x6e458a,..._0x1c48f2['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x1c48f2[_0x5152d6(0x1d8)]}},_0x248889=await _0x3947e7[_0x5152d6(0x231)]['createActivation'](_0x3a2013,_0x11408b);_0x225381[_0x5152d6(0x14a)](_0x3a8c93,_0x248889['id']),_0x1f20e5[_0x5152d6(0x154)][_0x5152d6(0x14a)](_0x3a8c93,_0x248889['id']),_0x22c4da['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x3cc0fb[_0x5152d6(0x12a)]['name'],'activationName':_0x3a8c93});}const _0x732483=JSON[_0x5152d6(0x1c2)](JSON[_0x5152d6(0x1ba)](_0xbe93ee));return _0x732483['id']=_0x3a2013,ensureJourneyDefaults(_0x732483['attributes']),resolvePendingIdsInRequest(_0x732483,_0xbe93ee,_0x4cbc34,_0x2f1a6a,_0x225381,_0x22c4da),await _0x3947e7[_0x5152d6(0x231)][_0x5152d6(0x201)](_0x3a2013,_0x732483),deletePushRecovery(_0x3cc0fb['absolutePath']),{'action':'created','journeyId':_0x3a2013,'embeddedSegmentNameToId':_0x2f1a6a};}export function stripWaitStepPendingIds(_0x534a79){const _0x2811a0=a114_0x2d62e8,_0x4a3159=_0x534a79['conditionSegmentId']&&isPendingSegmentId(_0x534a79[_0x2811a0(0x1d7)]),_0x3953cb=_0x534a79[_0x2811a0(0x211)]?.[_0x2811a0(0x200)](_0x30c34a=>_0x30c34a['segmentId']&&isPendingSegmentId(_0x30c34a['segmentId']));(_0x4a3159||_0x3953cb)&&(_0x534a79[_0x2811a0(0x1de)]=_0x2811a0(0x22d),_0x534a79[_0x2811a0(0x1d0)]=0x1,_0x534a79[_0x2811a0(0x194)]=_0x2811a0(0x1df),delete _0x534a79[_0x2811a0(0x1d7)],delete _0x534a79['conditionTimeoutDuration'],delete _0x534a79['conditionTimeoutUnit'],delete _0x534a79[_0x2811a0(0x211)]);}export function resolveWaitStepPendingIds(_0x490022,_0x4ea1e0,_0x2af8f4,_0x591fdd){const _0x83d2c2=a114_0x2d62e8;if(_0x4ea1e0[_0x83d2c2(0x1d7)]&&isPendingSegmentId(_0x4ea1e0[_0x83d2c2(0x1d7)])){const _0x2c6437=_0x2af8f4(_0x4ea1e0[_0x83d2c2(0x1d7)],_0x83d2c2(0x1b7)+_0x591fdd+'\x27\x20wait\x20condition');_0x2c6437&&(_0x490022[_0x83d2c2(0x1de)]=_0x83d2c2(0x1fc),_0x490022[_0x83d2c2(0x1d7)]=_0x2c6437,delete _0x490022[_0x83d2c2(0x1d0)],delete _0x490022[_0x83d2c2(0x194)],_0x4ea1e0[_0x83d2c2(0x1bb)]!==undefined&&(_0x490022[_0x83d2c2(0x1bb)]=_0x4ea1e0[_0x83d2c2(0x1bb)]),_0x4ea1e0[_0x83d2c2(0x180)]&&(_0x490022['conditionTimeoutUnit']=_0x4ea1e0[_0x83d2c2(0x180)]));}if(_0x4ea1e0[_0x83d2c2(0x211)]){const _0x4699d6=_0x4ea1e0[_0x83d2c2(0x211)][_0x83d2c2(0x200)](_0x5e4d17=>_0x5e4d17[_0x83d2c2(0x184)]&&isPendingSegmentId(_0x5e4d17[_0x83d2c2(0x184)]));if(_0x4699d6){const _0x1f0e26=_0x4ea1e0[_0x83d2c2(0x211)][_0x83d2c2(0x1ac)](_0x18c3d6=>{const _0x5f55dd=_0x83d2c2;if(_0x18c3d6[_0x5f55dd(0x184)]&&isPendingSegmentId(_0x18c3d6[_0x5f55dd(0x184)])){const _0x490463=_0x2af8f4(_0x18c3d6['segmentId'],'stage\x20\x27'+_0x591fdd+'\x27\x20wait\x20condition');return{..._0x18c3d6,'segmentId':_0x490463||_0x18c3d6['segmentId']};}return{..._0x18c3d6};});_0x490022[_0x83d2c2(0x1de)]='Condition',_0x490022[_0x83d2c2(0x211)]=_0x1f0e26,delete _0x490022['waitStep'],delete _0x490022['waitStepUnit'],delete _0x490022[_0x83d2c2(0x1d7)],delete _0x490022['conditionTimeoutDuration'],delete _0x490022['conditionTimeoutUnit'];}}}function stripPendingIds(_0x58f956){const _0x5e8ef8=a114_0x2d62e8;_0x58f956[_0x5e8ef8(0x12b)][_0x5e8ef8(0x1e5)]?.[_0x5e8ef8(0x184)]&&isPendingSegmentId(_0x58f956[_0x5e8ef8(0x12b)][_0x5e8ef8(0x1e5)][_0x5e8ef8(0x184)])&&delete _0x58f956[_0x5e8ef8(0x12b)][_0x5e8ef8(0x1e5)];for(const _0x31dec9 of _0x58f956[_0x5e8ef8(0x12b)][_0x5e8ef8(0x18d)]||[]){_0x31dec9[_0x5e8ef8(0x1b5)]?.[_0x5e8ef8(0x184)]&&isPendingSegmentId(_0x31dec9['entryCriteria'][_0x5e8ef8(0x184)])&&delete _0x31dec9[_0x5e8ef8(0x1b5)];_0x31dec9[_0x5e8ef8(0x171)]?.[_0x5e8ef8(0x184)]&&isPendingSegmentId(_0x31dec9['milestone'][_0x5e8ef8(0x184)])&&delete _0x31dec9[_0x5e8ef8(0x171)];_0x31dec9['exitCriterias']&&(_0x31dec9[_0x5e8ef8(0x18b)]=_0x31dec9[_0x5e8ef8(0x18b)]['filter'](_0x81cd15=>!_0x81cd15['segmentId']||!isPendingSegmentId(_0x81cd15[_0x5e8ef8(0x184)])));if(_0x31dec9[_0x5e8ef8(0x157)])for(const _0x2d2ed4 of Object['keys'](_0x31dec9[_0x5e8ef8(0x157)])){const _0x586dd5=_0x31dec9[_0x5e8ef8(0x157)][_0x2d2ed4];_0x586dd5[_0x5e8ef8(0x1bd)]===_0x5e8ef8(0x16f)&&_0x586dd5[_0x5e8ef8(0x1cf)]&&isPendingActivationId(_0x586dd5['journeyActivationStepId'])&&(_0x586dd5[_0x5e8ef8(0x1cf)]='');if(_0x586dd5['type']==='DecisionPoint'&&_0x586dd5[_0x5e8ef8(0x1ca)])for(const _0x2b57b2 of _0x586dd5[_0x5e8ef8(0x1ca)]){_0x2b57b2['segmentId']&&isPendingSegmentId(_0x2b57b2[_0x5e8ef8(0x184)])&&(_0x2b57b2[_0x5e8ef8(0x184)]='');}_0x586dd5[_0x5e8ef8(0x1bd)]===_0x5e8ef8(0x19e)&&stripWaitStepPendingIds(_0x586dd5);}}}function resolvePendingIdsInRequest(_0x421f6f,_0x2f831c,_0x5f1a75,_0x390e36,_0x1f7fb7,_0x430c4f){const _0x116679=a114_0x2d62e8,_0x1284cc=(_0x28eef2,_0x161cc2)=>{const _0x1acaba=a114_0x2264;if(!isPendingSegmentId(_0x28eef2))return _0x28eef2;const _0x5e116a=extractPendingSegmentName(_0x28eef2),_0x574783=_0x390e36['get'](_0x5e116a);return!_0x574783&&_0x430c4f[_0x1acaba(0x1cb)]?.(_0x1acaba(0x187)+_0x5e116a+_0x1acaba(0x1c9)+_0x161cc2),_0x574783;};if(_0x421f6f[_0x116679(0x12b)][_0x116679(0x1e5)]?.[_0x116679(0x184)]&&isPendingSegmentId(_0x421f6f[_0x116679(0x12b)][_0x116679(0x1e5)][_0x116679(0x184)])){const _0x3406e1=_0x1284cc(_0x421f6f[_0x116679(0x12b)]['goal'][_0x116679(0x184)],_0x116679(0x164));_0x3406e1&&(_0x421f6f[_0x116679(0x12b)][_0x116679(0x1e5)][_0x116679(0x184)]=_0x3406e1);}for(const _0x49ae of _0x421f6f[_0x116679(0x12b)]['journeyStages']||[]){const _0x5a51c9=_0x5f1a75[_0x116679(0x1ad)](_0x49ae[_0x116679(0x14d)][_0x116679(0x1ff)]());_0x5a51c9&&(_0x49ae['id']=_0x5a51c9);if(_0x49ae[_0x116679(0x1b5)]?.[_0x116679(0x184)]&&isPendingSegmentId(_0x49ae['entryCriteria'][_0x116679(0x184)])){const _0x483f37=_0x1284cc(_0x49ae[_0x116679(0x1b5)][_0x116679(0x184)],'stage\x20\x27'+_0x49ae[_0x116679(0x14d)]+_0x116679(0x216));_0x483f37&&(_0x49ae['entryCriteria'][_0x116679(0x184)]=_0x483f37);}if(_0x49ae[_0x116679(0x18b)])for(const _0x19bd60 of _0x49ae[_0x116679(0x18b)]){if(_0x19bd60[_0x116679(0x184)]&&isPendingSegmentId(_0x19bd60['segmentId'])){const _0xf13270=_0x1284cc(_0x19bd60[_0x116679(0x184)],_0x116679(0x1b7)+_0x49ae[_0x116679(0x14d)]+_0x116679(0x1a8));_0xf13270&&(_0x19bd60['segmentId']=_0xf13270);}}if(_0x49ae[_0x116679(0x171)]?.[_0x116679(0x184)]&&isPendingSegmentId(_0x49ae['milestone'][_0x116679(0x184)])){const _0x5d855b=_0x1284cc(_0x49ae['milestone']['segmentId'],_0x116679(0x1b7)+_0x49ae['name']+_0x116679(0x229));_0x5d855b&&(_0x49ae[_0x116679(0x171)][_0x116679(0x184)]=_0x5d855b);}if(_0x49ae[_0x116679(0x157)]){const _0x3bbc3e=_0x2cdb81=>_0x2f831c[_0x116679(0x12b)][_0x116679(0x18d)]?.[_0x116679(0x149)](_0x25f8dc=>_0x25f8dc[_0x116679(0x14d)][_0x116679(0x1ff)]()===_0x49ae[_0x116679(0x14d)][_0x116679(0x1ff)]())?.[_0x116679(0x157)]?.[_0x2cdb81];for(const _0x403d37 of Object[_0x116679(0x1e8)](_0x49ae[_0x116679(0x157)])){const _0x21ad8e=_0x49ae[_0x116679(0x157)][_0x403d37],_0x5e5073=_0x3bbc3e(_0x403d37);if(_0x21ad8e[_0x116679(0x1bd)]===_0x116679(0x16f)&&_0x21ad8e[_0x116679(0x1cf)]&&(isPendingActivationId(_0x21ad8e[_0x116679(0x1cf)])||_0x21ad8e[_0x116679(0x1cf)]==='')){if(_0x5e5073?.[_0x116679(0x1cf)]&&isPendingActivationId(_0x5e5073[_0x116679(0x1cf)])){const _0x3664a4=extractPendingActivationName(_0x5e5073[_0x116679(0x1cf)]),_0x3979df=_0x1f7fb7['get'](_0x3664a4);_0x3979df&&(_0x21ad8e['journeyActivationStepId']=_0x3979df);}}if(_0x21ad8e[_0x116679(0x1bd)]===_0x116679(0x232)&&_0x21ad8e[_0x116679(0x1ca)]&&_0x5e5073?.[_0x116679(0x1ca)])for(let _0x15d4b1=0x0;_0x15d4b1<_0x21ad8e[_0x116679(0x1ca)][_0x116679(0x19b)];_0x15d4b1++){const _0x283acd=_0x21ad8e[_0x116679(0x1ca)][_0x15d4b1],_0x15d14e=_0x5e5073[_0x116679(0x1ca)][_0x15d4b1];if(_0x15d14e?.[_0x116679(0x184)]&&isPendingSegmentId(_0x15d14e[_0x116679(0x184)])){const _0x25fd13=_0x1284cc(_0x15d14e[_0x116679(0x184)],'stage\x20\x27'+_0x49ae[_0x116679(0x14d)]+_0x116679(0x1ed)+(_0x283acd[_0x116679(0x14d)]||_0x15d4b1)+'\x27');_0x25fd13&&(_0x283acd[_0x116679(0x184)]=_0x25fd13);}}_0x21ad8e['type']===_0x116679(0x19e)&&_0x5e5073?.['type']===_0x116679(0x19e)&&resolveWaitStepPendingIds(_0x21ad8e,_0x5e5073,_0x1284cc,_0x49ae[_0x116679(0x14d)]);}}}}
@@ -1 +1 @@
1
- function a115_0x13b2(_0x259028,_0x4329b4){_0x259028=_0x259028-0x19e;const _0x48200a=a115_0x4820();let _0x13b209=_0x48200a[_0x259028];return _0x13b209;}(function(_0x165d7e,_0x172839){const _0x19cbc9=a115_0x13b2,_0x1a1e7a=_0x165d7e();while(!![]){try{const _0x2f0e75=parseInt(_0x19cbc9(0x1a4))/0x1*(parseInt(_0x19cbc9(0x1a3))/0x2)+-parseInt(_0x19cbc9(0x19f))/0x3+parseInt(_0x19cbc9(0x1a1))/0x4*(-parseInt(_0x19cbc9(0x1a0))/0x5)+parseInt(_0x19cbc9(0x1a5))/0x6+-parseInt(_0x19cbc9(0x1ae))/0x7*(-parseInt(_0x19cbc9(0x19e))/0x8)+-parseInt(_0x19cbc9(0x1ad))/0x9*(parseInt(_0x19cbc9(0x1a9))/0xa)+-parseInt(_0x19cbc9(0x1a8))/0xb;if(_0x2f0e75===_0x172839)break;else _0x1a1e7a['push'](_0x1a1e7a['shift']());}catch(_0x134187){_0x1a1e7a['push'](_0x1a1e7a['shift']());}}}(a115_0x4820,0xdea9c));export function buildFolderIdToPathMap(_0x7d4eef){const _0x58360f=a115_0x13b2,_0x16ac8d=new Map(),_0x1195b5=new Map();for(const _0x1af984 of _0x7d4eef){_0x1195b5[_0x58360f(0x1a6)](_0x1af984['id'],_0x1af984);}const _0x7e5864=new Set();for(const _0x1feb9a of _0x7d4eef){!_0x1feb9a['parentFolderId']&&_0x7e5864[_0x58360f(0x1ac)](_0x1feb9a['id']);}function _0x3c49ad(_0x1f55f8){const _0x19d50e=_0x58360f;if(_0x16ac8d[_0x19d50e(0x1aa)](_0x1f55f8['id']))return _0x16ac8d[_0x19d50e(0x1ab)](_0x1f55f8['id']);if(_0x7e5864['has'](_0x1f55f8['id']))return _0x16ac8d['set'](_0x1f55f8['id'],''),'';if(_0x1f55f8[_0x19d50e(0x1a7)]){const _0x37dc3b=_0x1195b5[_0x19d50e(0x1ab)](_0x1f55f8['parentFolderId']);if(_0x37dc3b){const _0x1e7903=_0x3c49ad(_0x37dc3b),_0xc10f44=_0x1e7903?_0x1e7903+'/'+_0x1f55f8[_0x19d50e(0x1a2)]:_0x1f55f8[_0x19d50e(0x1a2)];return _0x16ac8d[_0x19d50e(0x1a6)](_0x1f55f8['id'],_0xc10f44),_0xc10f44;}}const _0xed710a=_0x1f55f8[_0x19d50e(0x1a2)];return _0x16ac8d[_0x19d50e(0x1a6)](_0x1f55f8['id'],_0xed710a),_0xed710a;}for(const _0x38da49 of _0x7d4eef){_0x3c49ad(_0x38da49);}return _0x16ac8d;}export function buildFolderPathToIdMap(_0x5d3df0){const _0x2ff449=a115_0x13b2,_0x1c3e5b=new Map(),_0x15afbe=new Map();for(const _0x224cd5 of _0x5d3df0){_0x15afbe[_0x2ff449(0x1a6)](_0x224cd5['id'],_0x224cd5);}const _0x38fa9f=new Set();for(const _0x73b48b of _0x5d3df0){!_0x73b48b[_0x2ff449(0x1a7)]&&_0x38fa9f[_0x2ff449(0x1ac)](_0x73b48b['id']);}function _0x359e20(_0x1b785b){const _0x14832e=_0x2ff449;if(_0x38fa9f[_0x14832e(0x1aa)](_0x1b785b['id']))return'';if(_0x1b785b['parentFolderId']){const _0x272a6e=_0x15afbe[_0x14832e(0x1ab)](_0x1b785b[_0x14832e(0x1a7)]);if(_0x272a6e){const _0x4312f4=_0x359e20(_0x272a6e);return _0x4312f4?_0x4312f4+'/'+_0x1b785b[_0x14832e(0x1a2)]:_0x1b785b['name'];}}return _0x1b785b[_0x14832e(0x1a2)];}for(const _0x491b48 of _0x5d3df0){const _0x4ec778=_0x359e20(_0x491b48);_0x1c3e5b[_0x2ff449(0x1a6)](_0x4ec778,_0x491b48['id']);}return _0x1c3e5b;}function a115_0x4820(){const _0x2f5b41=['63zkUJYH','343QmuBzl','274048NrcpsT','2528820ybWzHW','4035QMoyCD','5052RSkeCG','name','286690cQhmNk','9zYdxfF','10662606mNxGsL','set','parentFolderId','21174285DWChqg','66580raacMM','has','get','add'];a115_0x4820=function(){return _0x2f5b41;};return a115_0x4820();}export function buildFolderMaps(_0x489d86){const _0x41a532=a115_0x13b2,_0x289ab5=buildFolderIdToPathMap(_0x489d86),_0x53aa06=new Map();for(const [_0x1f7129,_0x5a9339]of _0x289ab5){_0x53aa06[_0x41a532(0x1a6)](_0x5a9339,_0x1f7129);}return{'idToPath':_0x289ab5,'pathToId':_0x53aa06};}export function getFolderPath(_0x46b8a4,_0x3eec6d){if(!_0x46b8a4)return'';return _0x3eec6d['get'](_0x46b8a4)??'';}
1
+ function a115_0x44e3(){const _0x181edb=['parentFolderId','1067494fyyfSC','1636376impwQg','get','30OfkbiJ','2260531ApVVFz','add','name','2588355PajErR','177054cLdrZI','138296nIjmRb','set','has','145278AYidAh','3tfrIxb'];a115_0x44e3=function(){return _0x181edb;};return a115_0x44e3();}(function(_0x52125a,_0x448e64){const _0xb0a4b7=a115_0xb8f8,_0x1694bb=_0x52125a();while(!![]){try{const _0x337fea=parseInt(_0xb0a4b7(0x143))/0x1+-parseInt(_0xb0a4b7(0x13b))/0x2*(parseInt(_0xb0a4b7(0x139))/0x3)+parseInt(_0xb0a4b7(0x144))/0x4+-parseInt(_0xb0a4b7(0x13e))/0x5*(parseInt(_0xb0a4b7(0x138))/0x6)+parseInt(_0xb0a4b7(0x13f))/0x7+parseInt(_0xb0a4b7(0x13c))/0x8+parseInt(_0xb0a4b7(0x142))/0x9;if(_0x337fea===_0x448e64)break;else _0x1694bb['push'](_0x1694bb['shift']());}catch(_0xf2a5a2){_0x1694bb['push'](_0x1694bb['shift']());}}}(a115_0x44e3,0x54e1e));export function buildFolderIdToPathMap(_0x521271){const _0x5dd42b=a115_0xb8f8,_0x64b6cf=new Map(),_0x3a6310=new Map();for(const _0x55f218 of _0x521271){_0x3a6310[_0x5dd42b(0x145)](_0x55f218['id'],_0x55f218);}const _0x279f00=new Set();for(const _0x357d4e of _0x521271){!_0x357d4e[_0x5dd42b(0x13a)]&&_0x279f00[_0x5dd42b(0x140)](_0x357d4e['id']);}function _0x17e0e8(_0x2eb6de){const _0x44587f=_0x5dd42b;if(_0x64b6cf[_0x44587f(0x146)](_0x2eb6de['id']))return _0x64b6cf[_0x44587f(0x13d)](_0x2eb6de['id']);if(_0x279f00[_0x44587f(0x146)](_0x2eb6de['id']))return _0x64b6cf[_0x44587f(0x145)](_0x2eb6de['id'],''),'';if(_0x2eb6de[_0x44587f(0x13a)]){const _0x573446=_0x3a6310[_0x44587f(0x13d)](_0x2eb6de['parentFolderId']);if(_0x573446){const _0x658bc3=_0x17e0e8(_0x573446),_0x2a7453=_0x658bc3?_0x658bc3+'/'+_0x2eb6de['name']:_0x2eb6de[_0x44587f(0x141)];return _0x64b6cf[_0x44587f(0x145)](_0x2eb6de['id'],_0x2a7453),_0x2a7453;}}const _0x1f0622=_0x2eb6de['name'];return _0x64b6cf['set'](_0x2eb6de['id'],_0x1f0622),_0x1f0622;}for(const _0x1b60a0 of _0x521271){_0x17e0e8(_0x1b60a0);}return _0x64b6cf;}export function buildFolderPathToIdMap(_0x4ff6b1){const _0x1269e0=a115_0xb8f8,_0x54935f=new Map(),_0x73b089=new Map();for(const _0x4643bb of _0x4ff6b1){_0x73b089[_0x1269e0(0x145)](_0x4643bb['id'],_0x4643bb);}const _0xcc96c8=new Set();for(const _0x4bef26 of _0x4ff6b1){!_0x4bef26['parentFolderId']&&_0xcc96c8[_0x1269e0(0x140)](_0x4bef26['id']);}function _0x573f77(_0x4fbeb4){const _0x40fd7c=_0x1269e0;if(_0xcc96c8[_0x40fd7c(0x146)](_0x4fbeb4['id']))return'';if(_0x4fbeb4['parentFolderId']){const _0x5f5360=_0x73b089['get'](_0x4fbeb4[_0x40fd7c(0x13a)]);if(_0x5f5360){const _0x40b591=_0x573f77(_0x5f5360);return _0x40b591?_0x40b591+'/'+_0x4fbeb4['name']:_0x4fbeb4[_0x40fd7c(0x141)];}}return _0x4fbeb4[_0x40fd7c(0x141)];}for(const _0xf46698 of _0x4ff6b1){const _0x2ffefa=_0x573f77(_0xf46698);_0x54935f[_0x1269e0(0x145)](_0x2ffefa,_0xf46698['id']);}return _0x54935f;}export function buildFolderMaps(_0x578bf9){const _0x4de7a9=a115_0xb8f8,_0x2524d9=buildFolderIdToPathMap(_0x578bf9),_0x313f85=new Map();for(const [_0x3449b4,_0x5331fc]of _0x2524d9){_0x313f85[_0x4de7a9(0x145)](_0x5331fc,_0x3449b4);}return{'idToPath':_0x2524d9,'pathToId':_0x313f85};}function a115_0xb8f8(_0xd10b4b,_0x1f46f9){_0xd10b4b=_0xd10b4b-0x138;const _0x44e3fc=a115_0x44e3();let _0xb8f813=_0x44e3fc[_0xd10b4b];return _0xb8f813;}export function getFolderPath(_0x5e42b3,_0x47a141){if(!_0x5e42b3)return'';return _0x47a141['get'](_0x5e42b3)??'';}
@@ -1 +1 @@
1
- (function(_0x2a19b5,_0x546ee5){const _0x818ed6=a116_0x21c6,_0x125a41=_0x2a19b5();while(!![]){try{const _0x162f01=parseInt(_0x818ed6(0x204))/0x1*(-parseInt(_0x818ed6(0x1ff))/0x2)+parseInt(_0x818ed6(0x1ea))/0x3+parseInt(_0x818ed6(0x1f2))/0x4+-parseInt(_0x818ed6(0x1e5))/0x5*(-parseInt(_0x818ed6(0x1e4))/0x6)+parseInt(_0x818ed6(0x1ed))/0x7*(-parseInt(_0x818ed6(0x1de))/0x8)+-parseInt(_0x818ed6(0x1ee))/0x9*(parseInt(_0x818ed6(0x1dc))/0xa)+parseInt(_0x818ed6(0x203))/0xb*(parseInt(_0x818ed6(0x1f5))/0xc);if(_0x162f01===_0x546ee5)break;else _0x125a41['push'](_0x125a41['shift']());}catch(_0x512262){_0x125a41['push'](_0x125a41['shift']());}}}(a116_0x31e8,0xb8edb));import a116_0x383329 from'path';function a116_0x21c6(_0x25cd9d,_0x55367f){_0x25cd9d=_0x25cd9d-0x1d6;const _0x31e82c=a116_0x31e8();let _0x21c615=_0x31e82c[_0x25cd9d];return _0x21c615;}import{parse as a116_0x4ce121}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a116_0x31e8(){const _0x35f875=['resolve','9759505DeODgf','45mpJzjc','.yml','name','No\x20tdx.json\x20found\x20for\x20file:\x20','425944BdJURw','readFile','startsWith','3936552XlwQsQ','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Cannot\x20split\x20empty\x20path','File\x20not\x20found:\x20','parse','test','segments','exists','join','endsWith','49718BqqkUx','Path\x20segment\x20cannot\x20be\x20empty','.yaml','Cannot\x20navigate\x20above\x20root','77ZIOsNH','41CFktyC','length','parent_segment','replace','isAbsolute','journey','slice','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','1419990tfUuWq','Relative\x20path\x20cannot\x20be\x20empty','8RaBVfo','push','trim','dirname','pop','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','883332ENNbev','5CDqQzw','filter','Path\x20cannot\x20be\x20empty','raw','split','3992598UPveZq','relative'];a116_0x31e8=function(){return _0x35f875;};return a116_0x31e8();}export function parsePath(_0x25adc8){const _0xb7a358=a116_0x21c6;if(!_0x25adc8||_0x25adc8['trim']()==='')throw new Error(_0xb7a358(0x1e7));const _0x39718d=_0x25adc8['trim']();if(_0x39718d==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x25adc8};const _0x726618=_0x39718d[_0xb7a358(0x1f4)]('/')?_0x39718d['substring'](0x1):_0x39718d,_0x19772e=_0x726618[_0xb7a358(0x1e9)]('/')[_0xb7a358(0x1e6)](_0x26b962=>_0x26b962!=='');if(_0x19772e[_0xb7a358(0x205)]===0x0)throw new Error(_0xb7a358(0x1db));const _0x1f6bcb=_0x39718d[_0xb7a358(0x1f4)]('/')||!isRelativePathSegment(_0x19772e[0x0]);for(const _0x5d42b5 of _0x19772e){validatePathSegment(_0x5d42b5);}return{'segments':_0x19772e,'isAbsolute':_0x1f6bcb,'raw':_0x25adc8};}function isRelativePathSegment(_0x2b8fb6){return _0x2b8fb6==='.'||_0x2b8fb6==='..';}function validatePathSegment(_0x23c082){const _0x39597b=a116_0x21c6;if(_0x23c082==='')throw new Error(_0x39597b(0x200));if(_0x23c082==='.'||_0x23c082==='..')return;if(/[\x00-\x1F\x7F]/[_0x39597b(0x1fa)](_0x23c082))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x23c082);if(_0x23c082!==_0x23c082[_0x39597b(0x1e0)]()){}}export function validatePath(_0x5ba4cb){const _0x1b3fed=a116_0x21c6;if(_0x5ba4cb['segments']['length']===0x0&&!_0x5ba4cb[_0x1b3fed(0x1d8)])throw new Error(_0x1b3fed(0x1dd));if(_0x5ba4cb[_0x1b3fed(0x1d8)]){if(_0x5ba4cb[_0x1b3fed(0x1fb)][0x0]==='..')throw new Error(_0x1b3fed(0x1f6));let _0x4baaa8=0x0;for(const _0x41dba4 of _0x5ba4cb[_0x1b3fed(0x1fb)]){if(_0x41dba4==='..'){if(_0x4baaa8===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x4baaa8--;}else _0x41dba4!=='.'&&_0x4baaa8++;}}}export function joinPaths(_0x2137b1,_0x4fc8e7){const _0x505424=a116_0x21c6;if(!_0x2137b1||_0x2137b1==='/')return _0x4fc8e7;if(!_0x4fc8e7||_0x4fc8e7==='.')return _0x2137b1;if(_0x4fc8e7['startsWith']('/'))return _0x4fc8e7;const _0x5f3860=parsePath(_0x2137b1),_0x48f52b=parsePath(_0x4fc8e7),_0x249478=[..._0x5f3860['segments']];for(const _0x10edb7 of _0x48f52b[_0x505424(0x1fb)]){if(_0x10edb7==='.')continue;else{if(_0x10edb7==='..'){if(_0x249478['length']===0x0)throw new Error(_0x505424(0x202));_0x249478[_0x505424(0x1e2)]();}else _0x249478[_0x505424(0x1df)](_0x10edb7);}}const _0x5afc27=_0x249478[_0x505424(0x1fd)]('/');return _0x5f3860[_0x505424(0x1e8)][_0x505424(0x1f4)]('/')?'/'+_0x5afc27:_0x5afc27;}export function normalizePath(_0x1ed6dd){const _0x3d137c=a116_0x21c6,_0x5d9add=parsePath(_0x1ed6dd),_0x54e7c8=[];for(const _0x2a1201 of _0x5d9add['segments']){if(_0x2a1201==='.')continue;else{if(_0x2a1201==='..'){if(_0x54e7c8[_0x3d137c(0x205)]===0x0){if(_0x5d9add['isAbsolute'])throw new Error(_0x3d137c(0x202));_0x54e7c8[_0x3d137c(0x1df)]('..');}else _0x54e7c8[_0x54e7c8[_0x3d137c(0x205)]-0x1]==='..'?_0x54e7c8[_0x3d137c(0x1df)]('..'):_0x54e7c8[_0x3d137c(0x1e2)]();}else _0x54e7c8[_0x3d137c(0x1df)](_0x2a1201);}}if(_0x54e7c8['length']===0x0)return _0x5d9add['isAbsolute']?'/':'.';const _0x560126=_0x54e7c8[_0x3d137c(0x1fd)]('/');return _0x5d9add['raw']['startsWith']('/')?'/'+_0x560126:_0x560126;}export function getParentPath(_0x3d3785){const _0x5a25a1=a116_0x21c6,_0x1938ff=parsePath(_0x3d3785);if(_0x1938ff['segments'][_0x5a25a1(0x205)]<=0x1)return'/';const _0xbb83da=_0x1938ff[_0x5a25a1(0x1fb)][_0x5a25a1(0x1da)](0x0,-0x1)[_0x5a25a1(0x1fd)]('/');return _0x1938ff[_0x5a25a1(0x1e8)][_0x5a25a1(0x1f4)]('/')?'/'+_0xbb83da:_0xbb83da;}export function getBaseName(_0x2f8508){const _0x161a11=a116_0x21c6,_0x32fc6d=parsePath(_0x2f8508);return _0x32fc6d['segments'][_0x32fc6d[_0x161a11(0x1fb)][_0x161a11(0x205)]-0x1]||'';}export function isChildPath(_0x17769e,_0xee6448){const _0x3e7693=a116_0x21c6,_0x292919=parsePath(_0x17769e),_0x4bbc52=parsePath(_0xee6448);if(_0x292919['segments'][_0x3e7693(0x205)]<=_0x4bbc52['segments']['length'])return![];for(let _0x591694=0x0;_0x591694<_0x4bbc52[_0x3e7693(0x1fb)]['length'];_0x591694++){if(_0x292919[_0x3e7693(0x1fb)][_0x591694]!==_0x4bbc52['segments'][_0x591694])return![];}return!![];}export function splitPath(_0x288d24){const _0x3a698d=a116_0x21c6,_0x790f5c=parsePath(_0x288d24);if(_0x790f5c['segments'][_0x3a698d(0x205)]===0x0)throw new Error(_0x3a698d(0x1f7));if(_0x790f5c[_0x3a698d(0x1fb)]['length']===0x1)return{'parent':_0x790f5c[_0x3a698d(0x1fb)][0x0]};return{'parent':_0x790f5c[_0x3a698d(0x1fb)][0x0],'child':_0x790f5c[_0x3a698d(0x1fb)][_0x3a698d(0x1da)](0x1)['join']('/')};}export function isYamlFilePath(_0x5173bb){const _0x55cc62=a116_0x21c6;return _0x5173bb[_0x55cc62(0x1fe)](_0x55cc62(0x1ef))||_0x5173bb[_0x55cc62(0x1fe)](_0x55cc62(0x201));}export async function resolveYamlFilePath(_0x3f2b94,_0x382c8c=nodeFileSystem){const _0x5888c3=a116_0x21c6,_0x35e6bd=a116_0x383329[_0x5888c3(0x1ec)](_0x3f2b94);if(!await _0x382c8c[_0x5888c3(0x1fc)](_0x35e6bd))throw new Error(_0x5888c3(0x1f8)+_0x3f2b94);let _0x5540db=a116_0x383329[_0x5888c3(0x1e1)](_0x35e6bd),_0x58e0f9=null,_0x2cd1e7=null;const _0x3725f7=a116_0x383329[_0x5888c3(0x1f9)](_0x5540db)['root'];while(_0x5540db!==_0x3725f7){const _0x3018bd=a116_0x383329[_0x5888c3(0x1fd)](_0x5540db,'tdx.json');if(await _0x382c8c['exists'](_0x3018bd)){_0x58e0f9=_0x3018bd,_0x2cd1e7=_0x5540db;break;}_0x5540db=a116_0x383329['dirname'](_0x5540db);}if(!_0x58e0f9||!_0x2cd1e7)throw new Error(_0x5888c3(0x1f1)+_0x3f2b94);const _0x11ecc1=await _0x382c8c[_0x5888c3(0x1f3)](_0x58e0f9),_0x5a49ae=JSON[_0x5888c3(0x1f9)](_0x11ecc1),_0x34745d=_0x5a49ae[_0x5888c3(0x1d6)];if(!_0x34745d)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x2dc936=await _0x382c8c[_0x5888c3(0x1f3)](_0x35e6bd),_0x25ce72=a116_0x4ce121(_0x2dc936),_0x326252=_0x25ce72[_0x5888c3(0x1f0)];if(!_0x326252)throw new Error(_0x5888c3(0x1e3)+_0x3f2b94);const _0x1eaf6b=_0x25ce72['type']===_0x5888c3(0x1d9)?_0x5888c3(0x1d9):'segment',_0x3cf092=a116_0x383329[_0x5888c3(0x1eb)](_0x2cd1e7,_0x35e6bd),_0x15b403=a116_0x383329[_0x5888c3(0x1e1)](_0x3cf092),_0x33b5e6=_0x15b403==='.'?'':_0x15b403[_0x5888c3(0x1d7)](/\\/g,'/'),_0x488766=_0x33b5e6?_0x34745d+'/'+_0x33b5e6+'/'+_0x326252:_0x34745d+'/'+_0x326252;return{'parentSegment':_0x34745d,'segmentName':_0x326252,'folderPath':_0x33b5e6,'fullPath':_0x488766,'resourceType':_0x1eaf6b};}
1
+ (function(_0x38e3a0,_0xf799e0){const _0x482efb=a116_0xb997,_0x395ed4=_0x38e3a0();while(!![]){try{const _0x4539e7=-parseInt(_0x482efb(0x1d7))/0x1*(-parseInt(_0x482efb(0x1f5))/0x2)+parseInt(_0x482efb(0x1f1))/0x3*(parseInt(_0x482efb(0x1d5))/0x4)+-parseInt(_0x482efb(0x1fb))/0x5*(-parseInt(_0x482efb(0x1e1))/0x6)+-parseInt(_0x482efb(0x1f4))/0x7+-parseInt(_0x482efb(0x1e6))/0x8+parseInt(_0x482efb(0x1e4))/0x9+-parseInt(_0x482efb(0x1f0))/0xa;if(_0x4539e7===_0xf799e0)break;else _0x395ed4['push'](_0x395ed4['shift']());}catch(_0xf82e82){_0x395ed4['push'](_0x395ed4['shift']());}}}(a116_0x4600,0x21813));import a116_0x117f48 from'path';function a116_0x4600(){const _0xda457c=['filter','36mPoyTg','name','No\x20tdx.json\x20found\x20for\x20file:\x20','1106343dYFqvW','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','1443896zSAlYi','File\x20not\x20found:\x20','readFile','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','join','parse','Path\x20attempts\x20to\x20navigate\x20above\x20root','Path\x20cannot\x20be\x20empty','test','split','841020lwGlrJ','6qjBugY','Relative\x20path\x20cannot\x20be\x20empty','segments','1564024feonbG','536638RzzrRR','endsWith','Path\x20segment\x20cannot\x20be\x20empty','trim','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','pop','36130ixiVxT','root','slice','segment','tdx.json','Cannot\x20split\x20empty\x20path','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','isAbsolute','dirname','381308DPAgKB','exists','1CedVYQ','Cannot\x20navigate\x20above\x20root','push','.yaml','.yml','length','type','startsWith','raw'];a116_0x4600=function(){return _0xda457c;};return a116_0x4600();}import{parse as a116_0x572462}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x7b4121){const _0x5808f2=a116_0xb997;if(!_0x7b4121||_0x7b4121[_0x5808f2(0x1f8)]()==='')throw new Error(_0x5808f2(0x1ed));const _0x2b9ee4=_0x7b4121[_0x5808f2(0x1f8)]();if(_0x2b9ee4==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x7b4121};const _0x3f5a21=_0x2b9ee4['startsWith']('/')?_0x2b9ee4['substring'](0x1):_0x2b9ee4,_0x49c1ef=_0x3f5a21[_0x5808f2(0x1ef)]('/')[_0x5808f2(0x1e0)](_0x3fc1e8=>_0x3fc1e8!=='');if(_0x49c1ef[_0x5808f2(0x1dc)]===0x0)throw new Error(_0x5808f2(0x1e5));const _0x429b86=_0x2b9ee4[_0x5808f2(0x1de)]('/')||!isRelativePathSegment(_0x49c1ef[0x0]);for(const _0x574a93 of _0x49c1ef){validatePathSegment(_0x574a93);}return{'segments':_0x49c1ef,'isAbsolute':_0x429b86,'raw':_0x7b4121};}function isRelativePathSegment(_0x51af15){return _0x51af15==='.'||_0x51af15==='..';}function validatePathSegment(_0x2ae510){const _0x23677b=a116_0xb997;if(_0x2ae510==='')throw new Error(_0x23677b(0x1f7));if(_0x2ae510==='.'||_0x2ae510==='..')return;if(/[\x00-\x1F\x7F]/[_0x23677b(0x1ee)](_0x2ae510))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x2ae510);if(_0x2ae510!==_0x2ae510[_0x23677b(0x1f8)]()){}}export function validatePath(_0x36ddec){const _0x101895=a116_0xb997;if(_0x36ddec[_0x101895(0x1f3)][_0x101895(0x1dc)]===0x0&&!_0x36ddec[_0x101895(0x1d3)])throw new Error(_0x101895(0x1f2));if(_0x36ddec[_0x101895(0x1d3)]){if(_0x36ddec[_0x101895(0x1f3)][0x0]==='..')throw new Error(_0x101895(0x1d2));let _0x34564d=0x0;for(const _0x39497d of _0x36ddec[_0x101895(0x1f3)]){if(_0x39497d==='..'){if(_0x34564d===0x0)throw new Error(_0x101895(0x1ec));_0x34564d--;}else _0x39497d!=='.'&&_0x34564d++;}}}export function joinPaths(_0x5d053f,_0x2c9f2e){const _0x40bf5e=a116_0xb997;if(!_0x5d053f||_0x5d053f==='/')return _0x2c9f2e;if(!_0x2c9f2e||_0x2c9f2e==='.')return _0x5d053f;if(_0x2c9f2e[_0x40bf5e(0x1de)]('/'))return _0x2c9f2e;const _0x20c771=parsePath(_0x5d053f),_0x114987=parsePath(_0x2c9f2e),_0x5e3950=[..._0x20c771[_0x40bf5e(0x1f3)]];for(const _0x21803a of _0x114987[_0x40bf5e(0x1f3)]){if(_0x21803a==='.')continue;else{if(_0x21803a==='..'){if(_0x5e3950[_0x40bf5e(0x1dc)]===0x0)throw new Error(_0x40bf5e(0x1d8));_0x5e3950[_0x40bf5e(0x1fa)]();}else _0x5e3950[_0x40bf5e(0x1d9)](_0x21803a);}}const _0x1a6d69=_0x5e3950[_0x40bf5e(0x1ea)]('/');return _0x20c771['raw'][_0x40bf5e(0x1de)]('/')?'/'+_0x1a6d69:_0x1a6d69;}function a116_0xb997(_0xdd5b1f,_0x49d84f){_0xdd5b1f=_0xdd5b1f-0x1d1;const _0x4600a5=a116_0x4600();let _0xb997dd=_0x4600a5[_0xdd5b1f];return _0xb997dd;}export function normalizePath(_0x7b9638){const _0x115057=a116_0xb997,_0x2f2073=parsePath(_0x7b9638),_0x20195d=[];for(const _0xdca41a of _0x2f2073[_0x115057(0x1f3)]){if(_0xdca41a==='.')continue;else{if(_0xdca41a==='..'){if(_0x20195d[_0x115057(0x1dc)]===0x0){if(_0x2f2073['isAbsolute'])throw new Error(_0x115057(0x1d8));_0x20195d[_0x115057(0x1d9)]('..');}else _0x20195d[_0x20195d[_0x115057(0x1dc)]-0x1]==='..'?_0x20195d[_0x115057(0x1d9)]('..'):_0x20195d['pop']();}else _0x20195d[_0x115057(0x1d9)](_0xdca41a);}}if(_0x20195d['length']===0x0)return _0x2f2073[_0x115057(0x1d3)]?'/':'.';const _0x42541f=_0x20195d[_0x115057(0x1ea)]('/');return _0x2f2073[_0x115057(0x1df)][_0x115057(0x1de)]('/')?'/'+_0x42541f:_0x42541f;}export function getParentPath(_0x152f2d){const _0x353ad4=a116_0xb997,_0x287adf=parsePath(_0x152f2d);if(_0x287adf['segments'][_0x353ad4(0x1dc)]<=0x1)return'/';const _0x32768d=_0x287adf['segments'][_0x353ad4(0x1fd)](0x0,-0x1)[_0x353ad4(0x1ea)]('/');return _0x287adf[_0x353ad4(0x1df)][_0x353ad4(0x1de)]('/')?'/'+_0x32768d:_0x32768d;}export function getBaseName(_0x15a839){const _0x531064=a116_0xb997,_0x61283b=parsePath(_0x15a839);return _0x61283b[_0x531064(0x1f3)][_0x61283b['segments'][_0x531064(0x1dc)]-0x1]||'';}export function isChildPath(_0xcaf1ff,_0xf70883){const _0x4318f8=a116_0xb997,_0x47801a=parsePath(_0xcaf1ff),_0x57f16e=parsePath(_0xf70883);if(_0x47801a['segments'][_0x4318f8(0x1dc)]<=_0x57f16e['segments'][_0x4318f8(0x1dc)])return![];for(let _0x1fb39a=0x0;_0x1fb39a<_0x57f16e[_0x4318f8(0x1f3)][_0x4318f8(0x1dc)];_0x1fb39a++){if(_0x47801a[_0x4318f8(0x1f3)][_0x1fb39a]!==_0x57f16e[_0x4318f8(0x1f3)][_0x1fb39a])return![];}return!![];}export function splitPath(_0x213f17){const _0x493e03=a116_0xb997,_0x1c944d=parsePath(_0x213f17);if(_0x1c944d[_0x493e03(0x1f3)][_0x493e03(0x1dc)]===0x0)throw new Error(_0x493e03(0x1d1));if(_0x1c944d[_0x493e03(0x1f3)][_0x493e03(0x1dc)]===0x1)return{'parent':_0x1c944d[_0x493e03(0x1f3)][0x0]};return{'parent':_0x1c944d[_0x493e03(0x1f3)][0x0],'child':_0x1c944d[_0x493e03(0x1f3)]['slice'](0x1)[_0x493e03(0x1ea)]('/')};}export function isYamlFilePath(_0x329433){const _0x12d2b3=a116_0xb997;return _0x329433[_0x12d2b3(0x1f6)](_0x12d2b3(0x1db))||_0x329433['endsWith'](_0x12d2b3(0x1da));}export async function resolveYamlFilePath(_0x2a2018,_0x328828=nodeFileSystem){const _0xe0e0f7=a116_0xb997,_0x3d10be=a116_0x117f48['resolve'](_0x2a2018);if(!await _0x328828[_0xe0e0f7(0x1d6)](_0x3d10be))throw new Error(_0xe0e0f7(0x1e7)+_0x2a2018);let _0x40aa16=a116_0x117f48[_0xe0e0f7(0x1d4)](_0x3d10be),_0x4b949a=null,_0x5f3094=null;const _0x3638c9=a116_0x117f48[_0xe0e0f7(0x1eb)](_0x40aa16)[_0xe0e0f7(0x1fc)];while(_0x40aa16!==_0x3638c9){const _0x3468e4=a116_0x117f48['join'](_0x40aa16,_0xe0e0f7(0x1ff));if(await _0x328828[_0xe0e0f7(0x1d6)](_0x3468e4)){_0x4b949a=_0x3468e4,_0x5f3094=_0x40aa16;break;}_0x40aa16=a116_0x117f48['dirname'](_0x40aa16);}if(!_0x4b949a||!_0x5f3094)throw new Error(_0xe0e0f7(0x1e3)+_0x2a2018);const _0x1506f8=await _0x328828[_0xe0e0f7(0x1e8)](_0x4b949a),_0x56a341=JSON[_0xe0e0f7(0x1eb)](_0x1506f8),_0x376f31=_0x56a341['parent_segment'];if(!_0x376f31)throw new Error(_0xe0e0f7(0x1e9));const _0x5ca883=await _0x328828[_0xe0e0f7(0x1e8)](_0x3d10be),_0x263020=a116_0x572462(_0x5ca883),_0x3bf17d=_0x263020[_0xe0e0f7(0x1e2)];if(!_0x3bf17d)throw new Error(_0xe0e0f7(0x1f9)+_0x2a2018);const _0x4835f2=_0x263020[_0xe0e0f7(0x1dd)]==='journey'?'journey':_0xe0e0f7(0x1fe),_0x19099f=a116_0x117f48['relative'](_0x5f3094,_0x3d10be),_0x1cae74=a116_0x117f48['dirname'](_0x19099f),_0x3a58f9=_0x1cae74==='.'?'':_0x1cae74['replace'](/\\/g,'/'),_0x159b5b=_0x3a58f9?_0x376f31+'/'+_0x3a58f9+'/'+_0x3bf17d:_0x376f31+'/'+_0x3bf17d;return{'parentSegment':_0x376f31,'segmentName':_0x3bf17d,'folderPath':_0x3a58f9,'fullPath':_0x159b5b,'resourceType':_0x4835f2};}
@@ -1 +1 @@
1
- function a117_0x3b99(){const _0xbfbbb5=['substring','3531699VoaWZH','11ZyHrwl','12768CBsnNH','indexOf','522319LgLpBV','17360orDjUn','598610snlAYq','407301aXYOyZ','.\x20Child\x20name\x20cannot\x20be\x20empty','96WzWNgs','50PyKXFx','4706qdNkkX','Invalid\x20segment\x20reference\x20format:\x20','.\x20Parent\x20name\x20cannot\x20be\x20empty','4UTnJQC'];a117_0x3b99=function(){return _0xbfbbb5;};return a117_0x3b99();}(function(_0x1e80d9,_0x1a3f66){const _0x5f1b73=a117_0x503c,_0x1a81ff=_0x1e80d9();while(!![]){try{const _0x4e8a7c=parseInt(_0x5f1b73(0x1f4))/0x1*(-parseInt(_0x5f1b73(0x1f3))/0x2)+parseInt(_0x5f1b73(0x1f0))/0x3*(-parseInt(_0x5f1b73(0x1e7))/0x4)+-parseInt(_0x5f1b73(0x1ee))/0x5*(-parseInt(_0x5f1b73(0x1f2))/0x6)+parseInt(_0x5f1b73(0x1ed))/0x7+parseInt(_0x5f1b73(0x1eb))/0x8+parseInt(_0x5f1b73(0x1e9))/0x9+-parseInt(_0x5f1b73(0x1ef))/0xa*(-parseInt(_0x5f1b73(0x1ea))/0xb);if(_0x4e8a7c===_0x1a3f66)break;else _0x1a81ff['push'](_0x1a81ff['shift']());}catch(_0x29660f){_0x1a81ff['push'](_0x1a81ff['shift']());}}}(a117_0x3b99,0x50b7c));function a117_0x503c(_0x3a7151,_0x38034d){_0x3a7151=_0x3a7151-0x1e6;const _0x3b99ec=a117_0x3b99();let _0x503cca=_0x3b99ec[_0x3a7151];return _0x503cca;}export function parseSegmentRef(_0x1fe59e){const _0x39d243=a117_0x503c,_0x3d43e2=_0x1fe59e[_0x39d243(0x1ec)]('/');if(_0x3d43e2===-0x1)return{'parentId':_0x1fe59e};if(_0x3d43e2===0x0)throw new Error(_0x39d243(0x1f5)+_0x1fe59e+_0x39d243(0x1e6));const _0x469e32=_0x1fe59e['substring'](0x0,_0x3d43e2),_0x2b48f9=_0x1fe59e[_0x39d243(0x1e8)](_0x3d43e2+0x1);if(_0x2b48f9==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1fe59e+_0x39d243(0x1f1));return{'parentId':_0x469e32,'childId':_0x2b48f9};}
1
+ function a117_0x4ab6(_0x4cd1f4,_0x42720a){_0x4cd1f4=_0x4cd1f4-0xef;const _0x4e126a=a117_0x4e12();let _0x4ab66f=_0x4e126a[_0x4cd1f4];return _0x4ab66f;}function a117_0x4e12(){const _0x2cec61=['145HwksQf','504804OIVmtK','5700TeTpEH','319503HmUlHd','17083cymGOg','1123409JESUcw','14YjLmQK','837738bAeYUq','Invalid\x20segment\x20reference\x20format:\x20','8XQKvzd','100UIzYfo','4768872gAtrKS','substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','.\x20Child\x20name\x20cannot\x20be\x20empty','7752YoivXz'];a117_0x4e12=function(){return _0x2cec61;};return a117_0x4e12();}(function(_0x41af1e,_0x37b1ab){const _0x280184=a117_0x4ab6,_0x33798e=_0x41af1e();while(!![]){try{const _0x50bf29=parseInt(_0x280184(0xfb))/0x1+-parseInt(_0x280184(0xf0))/0x2*(-parseInt(_0x280184(0xfd))/0x3)+parseInt(_0x280184(0xf9))/0x4*(parseInt(_0x280184(0xfa))/0x5)+-parseInt(_0x280184(0xf5))/0x6+parseInt(_0x280184(0xef))/0x7*(-parseInt(_0x280184(0xf3))/0x8)+parseInt(_0x280184(0xf1))/0x9*(parseInt(_0x280184(0xf4))/0xa)+-parseInt(_0x280184(0xfe))/0xb*(parseInt(_0x280184(0xfc))/0xc);if(_0x50bf29===_0x37b1ab)break;else _0x33798e['push'](_0x33798e['shift']());}catch(_0x3aed07){_0x33798e['push'](_0x33798e['shift']());}}}(a117_0x4e12,0x84e67));export function parseSegmentRef(_0x2bed76){const _0x3c545d=a117_0x4ab6,_0x55f899=_0x2bed76['indexOf']('/');if(_0x55f899===-0x1)return{'parentId':_0x2bed76};if(_0x55f899===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2bed76+_0x3c545d(0xf7));const _0x163d05=_0x2bed76[_0x3c545d(0xf6)](0x0,_0x55f899),_0x55eddb=_0x2bed76[_0x3c545d(0xf6)](_0x55f899+0x1);if(_0x55eddb==='')throw new Error(_0x3c545d(0xf2)+_0x2bed76+_0x3c545d(0xf8));return{'parentId':_0x163d05,'childId':_0x55eddb};}
@@ -1 +1 @@
1
- (function(_0x1392bc,_0x41da6f){const _0x53091d=a118_0x2c51,_0x51d8d0=_0x1392bc();while(!![]){try{const _0x37013f=-parseInt(_0x53091d(0xd5))/0x1+parseInt(_0x53091d(0xe0))/0x2*(-parseInt(_0x53091d(0xd2))/0x3)+-parseInt(_0x53091d(0xff))/0x4+parseInt(_0x53091d(0xf1))/0x5+-parseInt(_0x53091d(0xf5))/0x6+parseInt(_0x53091d(0xf3))/0x7*(-parseInt(_0x53091d(0x103))/0x8)+parseInt(_0x53091d(0xda))/0x9;if(_0x37013f===_0x41da6f)break;else _0x51d8d0['push'](_0x51d8d0['shift']());}catch(_0x272951){_0x51d8d0['push'](_0x51d8d0['shift']());}}}(a118_0xc860,0x810e0));import a118_0x177a7f 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(_0x4a54c0){const _0x3c531b=a118_0x2c51;return _0x4a54c0[_0x3c531b(0xd8)]!==_0x3c531b(0xef);}export function isScopedResolution(_0x1b6fa1){const _0x1e6a97=a118_0x2c51;return _0x1b6fa1[_0x1e6a97(0xd8)]===_0x1e6a97(0x102)||_0x1b6fa1[_0x1e6a97(0xd8)]==='file'||_0x1b6fa1[_0x1e6a97(0xd8)]===_0x1e6a97(0xee);}export function getScopedDetails(_0x11e69b){if(isScopedResolution(_0x11e69b))return{'isScoped':_0x11e69b['isScoped'],'scopedFolderPath':_0x11e69b['scopedFolderPath']};return undefined;}function a118_0x2c51(_0x387b88,_0x22f7ad){_0x387b88=_0x387b88-0xcf;const _0xc8603c=a118_0xc860();let _0x2c51b5=_0xc8603c[_0x387b88];return _0x2c51b5;}async function findTdxConfigAsync(_0x18f66f,_0x113896){const _0x4b8d74=a118_0x2c51;let _0x3f2c9f=a118_0x177a7f[_0x4b8d74(0xdb)](_0x18f66f);const _0x2e9a39=a118_0x177a7f[_0x4b8d74(0xfe)](_0x3f2c9f)['root'];while(_0x3f2c9f!==_0x2e9a39){const _0x3b45b6=a118_0x177a7f[_0x4b8d74(0xd3)](_0x3f2c9f,_0x4b8d74(0xf2));if(await _0x113896[_0x4b8d74(0xf4)](_0x3b45b6))try{const _0x28151b=await _0x113896[_0x4b8d74(0xd0)](_0x3b45b6),_0x41bf66=JSON['parse'](_0x28151b);if(_0x41bf66[_0x4b8d74(0xe2)]&&typeof _0x41bf66[_0x4b8d74(0xe2)]===_0x4b8d74(0xdf))return{'configPath':_0x3b45b6,'configDir':_0x3f2c9f,'parentSegment':_0x41bf66[_0x4b8d74(0xe2)]};}catch{}_0x3f2c9f=a118_0x177a7f['dirname'](_0x3f2c9f);}return null;}function calculateScopedPath(_0x1a7d92,_0x146481){const _0x425474=a118_0x2c51,_0x49c40a=a118_0x177a7f['relative'](_0x146481,_0x1a7d92),_0x3235a3=_0x49c40a!==''&&_0x49c40a!=='.'&&!_0x49c40a[_0x425474(0xfc)]('..');return{'isScoped':_0x3235a3,'scopedFolderPath':_0x3235a3?_0x49c40a['replace'](/\\/g,'/'):''};}function a118_0xc860(){const _0x941ffe=['2261540WJSllo','isDirectory','isFile','directory','144296xZliKq','parent_name','No\x20tdx.json\x20found\x20for\x20file:\x20','readFile','no_parent','21PUHjlm','join','segmentName','758827mQNndd','invalid_yaml','folderPath','type','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','22917681aCZySm','resolve','includes','File\x20not\x20found','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','string','183046UeKuUU','cwd','parent_segment','no_config','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','journey','stat','basename','segment','file_not_found','file','parentSegment','trim','isScoped','context','error','match','4515010LylFFc','tdx.json','336AEpeAM','exists','540924cgZWpf','Parent\x20segment\x20not\x20specified','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','scopedFolderPath','configDir','dirname','File\x20not\x20found:\x20','startsWith','message','parse'];a118_0xc860=function(){return _0x941ffe;};return a118_0xc860();}export async function resolveTarget(_0x3466c9){const _0x5cbbde=a118_0x2c51,{arg:_0x134d9d,contextParent:_0x54a2c9,cwd:cwd=process[_0x5cbbde(0xe1)](),fs:fs=nodeFileSystem}=_0x3466c9;if(_0x134d9d&&isYamlFilePath(_0x134d9d))try{const _0x558b3f=await resolveYamlFilePath(_0x134d9d,fs),_0x217a87=a118_0x177a7f[_0x5cbbde(0xdb)](_0x134d9d),_0x24413e=a118_0x177a7f[_0x5cbbde(0xfa)](_0x217a87),_0x335582=await findTdxConfigAsync(_0x24413e,fs);if(!_0x335582){if(_0x54a2c9){const _0x2185eb=a118_0x177a7f['dirname'](_0x217a87);return{'type':_0x5cbbde(0xea),'parentName':_0x54a2c9,'targetDir':_0x2185eb,'configRoot':_0x2185eb,'filePath':_0x217a87,'resourceName':_0x558b3f[_0x5cbbde(0xd4)],'folderPath':_0x558b3f['folderPath'],'resourceType':_0x558b3f['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xe3),'message':_0x5cbbde(0xcf)+_0x134d9d,'arg':_0x134d9d,'helpText':_0x5cbbde(0xe4)};}const _0x2f22b6=calculateScopedPath(_0x24413e,_0x335582[_0x5cbbde(0xf9)]);return{'type':_0x5cbbde(0xea),'parentName':_0x335582[_0x5cbbde(0xeb)],'targetDir':_0x335582['configDir'],'configRoot':_0x335582[_0x5cbbde(0xf9)],'filePath':_0x217a87,'resourceName':_0x558b3f['segmentName'],'folderPath':_0x558b3f[_0x5cbbde(0xd7)],'resourceType':_0x558b3f['resourceType'],'isScoped':_0x2f22b6[_0x5cbbde(0xed)],'scopedFolderPath':_0x2f22b6[_0x5cbbde(0xf8)]};}catch(_0x15faab){const _0x363b73=_0x15faab instanceof Error?_0x15faab[_0x5cbbde(0xfd)]:String(_0x15faab);if(_0x363b73[_0x5cbbde(0xdc)](_0x5cbbde(0xdd)))return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xe9),'message':_0x5cbbde(0xfb)+_0x134d9d,'arg':_0x134d9d};if(_0x363b73[_0x5cbbde(0xdc)]('No\x20tdx.json\x20found')){if(_0x54a2c9){const _0x112139=a118_0x177a7f[_0x5cbbde(0xdb)](_0x134d9d);if(await fs[_0x5cbbde(0xf4)](_0x112139)){const _0x2b56b3=a118_0x177a7f[_0x5cbbde(0xfa)](_0x112139),_0x253d09=await fs['readFile'](_0x112139),_0x23a2d6=_0x253d09[_0x5cbbde(0xf0)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x24a633=_0x253d09[_0x5cbbde(0xf0)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x23a75c=_0x23a2d6?_0x23a2d6[0x1][_0x5cbbde(0xec)]():a118_0x177a7f[_0x5cbbde(0xe7)](_0x134d9d,a118_0x177a7f['extname'](_0x134d9d)),_0x16e0ba=_0x24a633&&_0x24a633[0x1][_0x5cbbde(0xec)]()===_0x5cbbde(0xe5)?_0x5cbbde(0xe5):_0x5cbbde(0xe8);return{'type':_0x5cbbde(0xea),'parentName':_0x54a2c9,'targetDir':_0x2b56b3,'configRoot':_0x2b56b3,'filePath':_0x112139,'resourceName':_0x23a75c,'folderPath':'','resourceType':_0x16e0ba,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xe3),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x134d9d,'arg':_0x134d9d,'helpText':_0x5cbbde(0xe4)};}return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xd6),'message':_0x363b73,'arg':_0x134d9d};}if(_0x134d9d){const _0x2bb496=a118_0x177a7f[_0x5cbbde(0xdb)](cwd,_0x134d9d);let _0x1474bb=null;try{_0x1474bb=await fs[_0x5cbbde(0xe6)](_0x2bb496);}catch{}if(_0x1474bb?.[_0x5cbbde(0x100)]()){const _0x5eeb26=await findTdxConfigAsync(_0x2bb496,fs);if(_0x5eeb26){const _0x2ea2ed=calculateScopedPath(_0x2bb496,_0x5eeb26[_0x5cbbde(0xf9)]);return{'type':_0x5cbbde(0x102),'parentName':_0x5eeb26[_0x5cbbde(0xeb)],'targetDir':_0x2bb496,'configRoot':_0x5eeb26[_0x5cbbde(0xf9)],'isScoped':_0x2ea2ed[_0x5cbbde(0xed)],'scopedFolderPath':_0x2ea2ed[_0x5cbbde(0xf8)]};}if(_0x54a2c9)return{'type':'directory','parentName':_0x54a2c9,'targetDir':_0x2bb496,'configRoot':_0x2bb496,'isScoped':![],'scopedFolderPath':''};return{'type':_0x5cbbde(0xef),'errorCode':'no_config','message':_0x5cbbde(0xde)+_0x134d9d,'arg':_0x134d9d,'helpText':_0x5cbbde(0xe4)};}if(_0x1474bb?.[_0x5cbbde(0x101)]())return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xd6),'message':'Not\x20a\x20YAML\x20file:\x20'+_0x134d9d,'arg':_0x134d9d,'helpText':_0x5cbbde(0xd9)};const _0x3a6fc2=sanitizeFileName(_0x134d9d),_0x858bc3=getSegmentRootDir(_0x3a6fc2,cwd);return{'type':_0x5cbbde(0x104),'parentName':_0x134d9d,'targetDir':_0x858bc3,'configRoot':_0x858bc3};}const _0x10ad5b=await findTdxConfigAsync(cwd,fs);if(_0x10ad5b){const _0x34f056=calculateScopedPath(cwd,_0x10ad5b['configDir']);return{'type':_0x5cbbde(0xee),'parentName':_0x10ad5b[_0x5cbbde(0xeb)],'targetDir':cwd,'configRoot':_0x10ad5b[_0x5cbbde(0xf9)],'isScoped':_0x34f056['isScoped'],'scopedFolderPath':_0x34f056[_0x5cbbde(0xf8)]};}if(_0x54a2c9){const _0x551792=sanitizeFileName(_0x54a2c9),_0x48a4a5=getSegmentRootDir(_0x551792,cwd);return{'type':'context','parentName':_0x54a2c9,'targetDir':_0x48a4a5,'configRoot':_0x48a4a5,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xd1),'message':_0x5cbbde(0xf6),'helpText':_0x5cbbde(0xf7)};}
1
+ (function(_0x2d645d,_0x2d6c03){const _0x32e77c=a118_0x11da,_0x1db1d8=_0x2d645d();while(!![]){try{const _0x2cf2d4=parseInt(_0x32e77c(0x1ce))/0x1+-parseInt(_0x32e77c(0x1c0))/0x2*(parseInt(_0x32e77c(0x1bf))/0x3)+parseInt(_0x32e77c(0x1ca))/0x4+-parseInt(_0x32e77c(0x1bd))/0x5+-parseInt(_0x32e77c(0x1a9))/0x6+parseInt(_0x32e77c(0x1c4))/0x7*(parseInt(_0x32e77c(0x1af))/0x8)+parseInt(_0x32e77c(0x1a0))/0x9*(parseInt(_0x32e77c(0x1c5))/0xa);if(_0x2cf2d4===_0x2d6c03)break;else _0x1db1d8['push'](_0x1db1d8['shift']());}catch(_0x2d79ed){_0x1db1d8['push'](_0x1db1d8['shift']());}}}(a118_0x24e8,0x1dca3));import a118_0x567f53 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';function a118_0x24e8(){const _0x4a9f99=['148948BoRrSj','parse','directory','trim','1047564xeCKRs','10JGGGgK','isScoped','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','stat','dirname','503424CAbMEi','cwd','resolve','basename','210805MgIoRC','context','no_parent','scopedFolderPath','1490940qKNvGs','parent_segment','no_config','type','match','No\x20tdx.json\x20found\x20for\x20file:\x20','string','exists','file','1351374GcKrli','No\x20tdx.json\x20found','error','isDirectory','journey','startsWith','8ZuTHoU','folderPath','message','segmentName','join','Parent\x20segment\x20not\x20specified','readFile','file_not_found','isFile','parentSegment','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','File\x20not\x20found','configDir','invalid_yaml','1151255vUMqww','root','3HDSLKd'];a118_0x24e8=function(){return _0x4a9f99;};return a118_0x24e8();}import{nodeFileSystem}from'../io/node-filesystem.js';function a118_0x11da(_0x3e4a3b,_0x4327f9){_0x3e4a3b=_0x3e4a3b-0x1a0;const _0x24e8c6=a118_0x24e8();let _0x11da7f=_0x24e8c6[_0x3e4a3b];return _0x11da7f;}import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0xa7adbd){const _0x3540eb=a118_0x11da;return _0xa7adbd['type']!==_0x3540eb(0x1ab);}export function isScopedResolution(_0x36c11c){const _0x56db5d=a118_0x11da;return _0x36c11c[_0x56db5d(0x1a3)]===_0x56db5d(0x1c2)||_0x36c11c[_0x56db5d(0x1a3)]===_0x56db5d(0x1a8)||_0x36c11c[_0x56db5d(0x1a3)]===_0x56db5d(0x1cf);}export function getScopedDetails(_0x50ff35){const _0x4e1a0c=a118_0x11da;if(isScopedResolution(_0x50ff35))return{'isScoped':_0x50ff35[_0x4e1a0c(0x1c6)],'scopedFolderPath':_0x50ff35[_0x4e1a0c(0x1d1)]};return undefined;}async function findTdxConfigAsync(_0x308d4c,_0x5c0087){const _0x4a7448=a118_0x11da;let _0x44a171=a118_0x567f53[_0x4a7448(0x1cc)](_0x308d4c);const _0x2839ce=a118_0x567f53[_0x4a7448(0x1c1)](_0x44a171)[_0x4a7448(0x1be)];while(_0x44a171!==_0x2839ce){const _0x2a313c=a118_0x567f53[_0x4a7448(0x1b3)](_0x44a171,'tdx.json');if(await _0x5c0087[_0x4a7448(0x1a7)](_0x2a313c))try{const _0x4b6e5c=await _0x5c0087[_0x4a7448(0x1b5)](_0x2a313c),_0x403718=JSON[_0x4a7448(0x1c1)](_0x4b6e5c);if(_0x403718[_0x4a7448(0x1a1)]&&typeof _0x403718[_0x4a7448(0x1a1)]===_0x4a7448(0x1a6))return{'configPath':_0x2a313c,'configDir':_0x44a171,'parentSegment':_0x403718[_0x4a7448(0x1a1)]};}catch{}_0x44a171=a118_0x567f53[_0x4a7448(0x1c9)](_0x44a171);}return null;}function calculateScopedPath(_0xa9b504,_0x39495d){const _0x1310e3=a118_0x11da,_0x4215b9=a118_0x567f53['relative'](_0x39495d,_0xa9b504),_0x4090f0=_0x4215b9!==''&&_0x4215b9!=='.'&&!_0x4215b9[_0x1310e3(0x1ae)]('..');return{'isScoped':_0x4090f0,'scopedFolderPath':_0x4090f0?_0x4215b9['replace'](/\\/g,'/'):''};}export async function resolveTarget(_0x506e43){const _0x312ad1=a118_0x11da,{arg:_0x567caa,contextParent:_0xd29084,cwd:cwd=process[_0x312ad1(0x1cb)](),fs:fs=nodeFileSystem}=_0x506e43;if(_0x567caa&&isYamlFilePath(_0x567caa))try{const _0x32f055=await resolveYamlFilePath(_0x567caa,fs),_0x5e787f=a118_0x567f53[_0x312ad1(0x1cc)](_0x567caa),_0x3b605a=a118_0x567f53[_0x312ad1(0x1c9)](_0x5e787f),_0xaafb4a=await findTdxConfigAsync(_0x3b605a,fs);if(!_0xaafb4a){if(_0xd29084){const _0x3b3876=a118_0x567f53[_0x312ad1(0x1c9)](_0x5e787f);return{'type':_0x312ad1(0x1a8),'parentName':_0xd29084,'targetDir':_0x3b3876,'configRoot':_0x3b3876,'filePath':_0x5e787f,'resourceName':_0x32f055['segmentName'],'folderPath':_0x32f055[_0x312ad1(0x1b0)],'resourceType':_0x32f055['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x312ad1(0x1ab),'errorCode':_0x312ad1(0x1a2),'message':_0x312ad1(0x1a5)+_0x567caa,'arg':_0x567caa,'helpText':_0x312ad1(0x1b9)};}const _0x290b2b=calculateScopedPath(_0x3b605a,_0xaafb4a[_0x312ad1(0x1bb)]);return{'type':'file','parentName':_0xaafb4a[_0x312ad1(0x1b8)],'targetDir':_0xaafb4a[_0x312ad1(0x1bb)],'configRoot':_0xaafb4a['configDir'],'filePath':_0x5e787f,'resourceName':_0x32f055[_0x312ad1(0x1b2)],'folderPath':_0x32f055['folderPath'],'resourceType':_0x32f055['resourceType'],'isScoped':_0x290b2b[_0x312ad1(0x1c6)],'scopedFolderPath':_0x290b2b[_0x312ad1(0x1d1)]};}catch(_0x40c31b){const _0x2e0514=_0x40c31b instanceof Error?_0x40c31b[_0x312ad1(0x1b1)]:String(_0x40c31b);if(_0x2e0514['includes'](_0x312ad1(0x1ba)))return{'type':_0x312ad1(0x1ab),'errorCode':_0x312ad1(0x1b6),'message':'File\x20not\x20found:\x20'+_0x567caa,'arg':_0x567caa};if(_0x2e0514['includes'](_0x312ad1(0x1aa))){if(_0xd29084){const _0x37f2da=a118_0x567f53[_0x312ad1(0x1cc)](_0x567caa);if(await fs[_0x312ad1(0x1a7)](_0x37f2da)){const _0x41f0e9=a118_0x567f53['dirname'](_0x37f2da),_0x7c3f67=await fs['readFile'](_0x37f2da),_0x3bf6cf=_0x7c3f67['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0xf0acac=_0x7c3f67[_0x312ad1(0x1a4)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4a5275=_0x3bf6cf?_0x3bf6cf[0x1][_0x312ad1(0x1c3)]():a118_0x567f53[_0x312ad1(0x1cd)](_0x567caa,a118_0x567f53['extname'](_0x567caa)),_0x57652f=_0xf0acac&&_0xf0acac[0x1]['trim']()===_0x312ad1(0x1ad)?'journey':'segment';return{'type':_0x312ad1(0x1a8),'parentName':_0xd29084,'targetDir':_0x41f0e9,'configRoot':_0x41f0e9,'filePath':_0x37f2da,'resourceName':_0x4a5275,'folderPath':'','resourceType':_0x57652f,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x312ad1(0x1ab),'errorCode':_0x312ad1(0x1a2),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x567caa,'arg':_0x567caa,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}return{'type':'error','errorCode':'invalid_yaml','message':_0x2e0514,'arg':_0x567caa};}if(_0x567caa){const _0x242b6b=a118_0x567f53[_0x312ad1(0x1cc)](cwd,_0x567caa);let _0x5de83e=null;try{_0x5de83e=await fs[_0x312ad1(0x1c8)](_0x242b6b);}catch{}if(_0x5de83e?.[_0x312ad1(0x1ac)]()){const _0x31df29=await findTdxConfigAsync(_0x242b6b,fs);if(_0x31df29){const _0x1aabe2=calculateScopedPath(_0x242b6b,_0x31df29[_0x312ad1(0x1bb)]);return{'type':_0x312ad1(0x1c2),'parentName':_0x31df29[_0x312ad1(0x1b8)],'targetDir':_0x242b6b,'configRoot':_0x31df29['configDir'],'isScoped':_0x1aabe2['isScoped'],'scopedFolderPath':_0x1aabe2[_0x312ad1(0x1d1)]};}if(_0xd29084)return{'type':'directory','parentName':_0xd29084,'targetDir':_0x242b6b,'configRoot':_0x242b6b,'isScoped':![],'scopedFolderPath':''};return{'type':_0x312ad1(0x1ab),'errorCode':'no_config','message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x567caa,'arg':_0x567caa,'helpText':_0x312ad1(0x1b9)};}if(_0x5de83e?.[_0x312ad1(0x1b7)]())return{'type':_0x312ad1(0x1ab),'errorCode':_0x312ad1(0x1bc),'message':'Not\x20a\x20YAML\x20file:\x20'+_0x567caa,'arg':_0x567caa,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x13661c=sanitizeFileName(_0x567caa),_0x330028=getSegmentRootDir(_0x13661c,cwd);return{'type':'parent_name','parentName':_0x567caa,'targetDir':_0x330028,'configRoot':_0x330028};}const _0x23c5bf=await findTdxConfigAsync(cwd,fs);if(_0x23c5bf){const _0x4482e1=calculateScopedPath(cwd,_0x23c5bf[_0x312ad1(0x1bb)]);return{'type':_0x312ad1(0x1cf),'parentName':_0x23c5bf[_0x312ad1(0x1b8)],'targetDir':cwd,'configRoot':_0x23c5bf[_0x312ad1(0x1bb)],'isScoped':_0x4482e1[_0x312ad1(0x1c6)],'scopedFolderPath':_0x4482e1[_0x312ad1(0x1d1)]};}if(_0xd29084){const _0x43d73e=sanitizeFileName(_0xd29084),_0x5231aa=getSegmentRootDir(_0x43d73e,cwd);return{'type':_0x312ad1(0x1cf),'parentName':_0xd29084,'targetDir':_0x5231aa,'configRoot':_0x5231aa,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x312ad1(0x1ab),'errorCode':_0x312ad1(0x1d0),'message':_0x312ad1(0x1b4),'helpText':_0x312ad1(0x1c7)};}