@treasuredata/tdx 0.25.8 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) 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.d.ts +2 -1
  148. package/dist/utils/local-cache.d.ts.map +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/local-cache.js.map +1 -1
  151. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  152. package/dist/utils/logger/formatters/index.js +1 -1
  153. package/dist/utils/logger/handlers/console-handler.js +1 -1
  154. package/dist/utils/logger/handlers/file-handler.js +1 -1
  155. package/dist/utils/logger/handlers/index.js +1 -1
  156. package/dist/utils/logger/handlers/null-handler.js +1 -1
  157. package/dist/utils/logger/index.js +1 -1
  158. package/dist/utils/logger/logger.js +1 -1
  159. package/dist/utils/logger/types.js +1 -1
  160. package/dist/utils/option-validation.js +1 -1
  161. package/dist/utils/port.js +1 -1
  162. package/dist/utils/process.js +1 -1
  163. package/dist/utils/prompt.js +1 -1
  164. package/dist/utils/spinner.js +1 -1
  165. package/dist/utils/sse-parser.js +1 -1
  166. package/dist/utils/string-utils.js +1 -1
  167. package/dist/utils/table-ref-parser.js +1 -1
  168. package/dist/utils/tdx-logger.js +1 -1
  169. package/dist/utils/version-check.js +1 -1
  170. package/package.json +1 -1
@@ -1 +1 @@
1
- const a114_0x4e41d5=a114_0x4671;(function(_0xfd549e,_0x317872){const _0x448653=a114_0x4671,_0x5278d4=_0xfd549e();while(!![]){try{const _0x480316=-parseInt(_0x448653(0x19a))/0x1+parseInt(_0x448653(0x182))/0x2+parseInt(_0x448653(0x16d))/0x3+-parseInt(_0x448653(0x130))/0x4*(parseInt(_0x448653(0x1d7))/0x5)+parseInt(_0x448653(0x1ac))/0x6+-parseInt(_0x448653(0x1e0))/0x7*(-parseInt(_0x448653(0x1ef))/0x8)+-parseInt(_0x448653(0x168))/0x9*(parseInt(_0x448653(0x1c2))/0xa);if(_0x480316===_0x317872)break;else _0x5278d4['push'](_0x5278d4['shift']());}catch(_0x140f41){_0x5278d4['push'](_0x5278d4['shift']());}}}(a114_0x45f0,0x51c51));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';function a114_0x4671(_0x418033,_0x469508){_0x418033=_0x418033-0x124;const _0x45f0da=a114_0x45f0();let _0x467188=_0x45f0da[_0x418033];return _0x467188;}const logger=Logger['of'](a114_0x4e41d5(0x217));export const PENDING_SEGMENT_PREFIX=a114_0x4e41d5(0x218);export const PENDING_ACTIVATION_PREFIX=a114_0x4e41d5(0x203);export function createPendingSegmentId(_0x140472){return''+PENDING_SEGMENT_PREFIX+_0x140472+'__';}export function isPendingSegmentId(_0xc15c06){const _0x254a6c=a114_0x4e41d5;return _0xc15c06['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0xc15c06[_0x254a6c(0x202)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x244226){const _0x40af6c=a114_0x4e41d5;return _0x244226[_0x40af6c(0x186)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x366a86){return''+PENDING_ACTIVATION_PREFIX+_0x366a86+'__';}export function isPendingActivationId(_0x2cc52f){const _0x287c8d=a114_0x4e41d5;return _0x2cc52f[_0x287c8d(0x202)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xdeeb6c){const _0x37a8ea=a114_0x4e41d5;return _0xdeeb6c[_0x37a8ea(0x186)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4f8fdd,_0x11ab8f){const _0x207129=a114_0x4e41d5,_0x11d3d4=_0x4f8fdd+'::'+(_0x11ab8f[_0x207129(0x173)]()||_0x207129(0x1a9)),_0x4fd07f=createHash(_0x207129(0x1b3))[_0x207129(0x1b1)](_0x11d3d4)['digest'](_0x207129(0x196))[_0x207129(0x1c8)](0x0,0xc);return _0x207129(0x12d)+_0x4fd07f;}export function ensureJourneyDefaults(_0x1061a2){const _0x2f3a67=a114_0x4e41d5;!_0x1061a2[_0x2f3a67(0x1a6)]&&(_0x1061a2[_0x2f3a67(0x1a6)]=''),!_0x1061a2['state']&&(_0x1061a2[_0x2f3a67(0x1fa)]='draft');}export function resolveTDFolderPath(_0x3ad855,_0x34390e,_0x111a24){const _0x343199=a114_0x4e41d5;if(!_0x34390e)return _0x3ad855;if(_0x3ad855===_0x111a24||_0x3ad855[_0x343199(0x202)](_0x111a24+'/'))return _0x3ad855;return _0x3ad855?_0x111a24+'/'+_0x3ad855:_0x111a24;}export function addFoldersToCreate(_0x539cc8,_0x2f7ca2,_0x3342a4){const _0x1d12fd=a114_0x4e41d5;if(!_0x539cc8)return;if(_0x2f7ca2['has'](_0x539cc8))return;const _0x35824b=_0x539cc8[_0x1d12fd(0x1f3)]('/');let _0x3c120a='';for(const _0x340e14 of _0x35824b){_0x3c120a=_0x3c120a?_0x3c120a+'/'+_0x340e14:_0x340e14,!_0x2f7ca2[_0x1d12fd(0x18a)](_0x3c120a)&&_0x3342a4[_0x1d12fd(0x1ee)](_0x3c120a);}}import*as a114_0x15ee24 from'yaml';import{readFileSync}from'fs';import a114_0x5e5ff3 from'path';import{isJourneyDef,parseYamlString as a114_0x33d79a,toYamlString as a114_0x1ab3c6,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(_0x57d35f){const _0x3818ea=a114_0x4e41d5;if(Array[_0x3818ea(0x14d)](_0x57d35f))return'['+_0x57d35f[_0x3818ea(0x12c)](_0x3a459e=>stableStringify(_0x3a459e))['join'](',')+']';if(_0x57d35f&&typeof _0x57d35f===_0x3818ea(0x1bd)){const _0xe544c2=_0x57d35f,_0x56115e=Object['keys'](_0xe544c2)[_0x3818ea(0x16e)](),_0x560528=_0x56115e[_0x3818ea(0x12c)](_0x4b3d9b=>'\x22'+_0x4b3d9b+'\x22:'+stableStringify(_0xe544c2[_0x4b3d9b]));return'{'+_0x560528[_0x3818ea(0x1e9)](',')+'}';}const _0x3a8f74=JSON[_0x3818ea(0x1e4)](_0x57d35f);return _0x3a8f74===undefined?'null':_0x3a8f74;}function activationSignature(_0x428e6f){const _0x5055b1=a114_0x4e41d5,_0x215d9e={'connection':_0x428e6f[_0x5055b1(0x1b9)],..._0x428e6f['all_columns']!==undefined&&{'all_columns':_0x428e6f[_0x5055b1(0x1c1)]},..._0x428e6f[_0x5055b1(0x1eb)]!==undefined&&{'columns':_0x428e6f['columns']},..._0x428e6f[_0x5055b1(0x20d)]!==undefined&&{'behavior':_0x428e6f[_0x5055b1(0x20d)]},..._0x428e6f[_0x5055b1(0x1dd)]!==undefined&&{'schedule':_0x428e6f['schedule']},..._0x428e6f['notification']!==undefined&&{'notification':_0x428e6f[_0x5055b1(0x222)]},..._0x428e6f[_0x5055b1(0x1fb)]!==undefined&&{'connector_config':_0x428e6f['connector_config']},..._0x428e6f[_0x5055b1(0x17b)]!==undefined&&{'activation_template_id':_0x428e6f[_0x5055b1(0x17b)]}};return stableStringify(_0x215d9e);}async function fetchSegment(_0x5342bc,_0x3bbf37,_0x491569,_0x15e3af){const _0x5b1825=a114_0x4e41d5,_0x2afb3a=_0x15e3af?.['find'](_0x46c7ba=>_0x46c7ba['id']===_0x491569);if(_0x2afb3a)return _0x2afb3a;try{return await _0x5342bc[_0x5b1825(0x1a9)]['getSegment'](_0x3bbf37,_0x491569);}catch(_0x40353c){logger[_0x5b1825(0x192)](_0x5b1825(0x175)+_0x491569+_0x5b1825(0x144)+_0x40353c);try{return await _0x5342bc['segment'][_0x5b1825(0x1d4)](_0x491569);}catch(_0x1490bf){return logger[_0x5b1825(0x192)](_0x5b1825(0x1cf)+_0x491569+':\x20'+_0x1490bf),null;}}}function recoverSegmentIdsFromPushRecovery(_0x119e49,_0x3c2ce3,_0x472f64){const _0x48e346=a114_0x4e41d5,_0x46e70e=readPushRecovery(_0x119e49[_0x48e346(0x124)]);if(_0x46e70e?.[_0x48e346(0x14b)]===_0x119e49[_0x48e346(0x1b8)][_0x48e346(0x127)])for(const [_0x558ccb,_0x27239d]of Object[_0x48e346(0x1ae)](_0x46e70e[_0x48e346(0x193)])){const _0x430af5=generateDeterministicJourneySegmentName(_0x119e49['yamlConfig'][_0x48e346(0x127)],_0x558ccb);_0x27239d[_0x48e346(0x140)]===_0x430af5&&(_0x3c2ce3[_0x48e346(0x15a)](_0x558ccb,_0x27239d['segmentId']),_0x472f64[_0x48e346(0x15a)](_0x558ccb,_0x27239d['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x8898e4,_0x1c7d73,_0x3dcb94,_0x2f179b){const _0x279d88=a114_0x4e41d5;let _0x35f5e8;try{_0x35f5e8=await _0x8898e4[_0x279d88(0x1a9)]['createJourneySegment']({'name':_0x3dcb94[_0x279d88(0x169)],'description':_0x3dcb94[_0x279d88(0x1a6)],'journeyId':_0x3dcb94['journeyId'],'rule':_0x2f179b(_0x3dcb94[_0x279d88(0x160)],!![]),'countPopulation':!![],'parentFolderId':_0x3dcb94[_0x279d88(0x201)],'audienceId':_0x3dcb94[_0x279d88(0x128)]});}catch(_0x223549){const _0x55fad0=_0x223549 instanceof Error&&_0x223549[_0x279d88(0x213)]['includes'](_0x279d88(0x1d1));if(_0x55fad0){const _0x14a446=readPushRecovery(_0x1c7d73['absolutePath']),_0x59d873=_0x14a446?.[_0x279d88(0x14b)]===_0x1c7d73[_0x279d88(0x1b8)]['name']?_0x14a446['segments'][_0x3dcb94['localName']]:undefined;if(_0x59d873?.['uniqueServerName']===_0x3dcb94[_0x279d88(0x169)])await _0x8898e4[_0x279d88(0x1a9)]['updateSegmentById'](_0x3dcb94[_0x279d88(0x128)],_0x59d873[_0x279d88(0x187)],{'description':_0x3dcb94['description'],'rule':_0x2f179b(_0x3dcb94[_0x279d88(0x160)],!![]),'countPopulation':!![]}),_0x35f5e8=_0x59d873[_0x279d88(0x187)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x279d88(0x19f)+_0x3dcb94[_0x279d88(0x1f7)]+_0x279d88(0x181)+(_0x279d88(0x21a)+_0x1c7d73[_0x279d88(0x124)]['replace'](/([^/]+)$/,_0x279d88(0x1d8))+')\x20')+_0x279d88(0x188),_0x223549);}else throw _0x223549;}return saveSegmentToPushRecovery(_0x1c7d73[_0x279d88(0x124)],_0x1c7d73['yamlConfig']['name'],_0x3dcb94['localName'],{'segmentId':_0x35f5e8,'uniqueServerName':_0x3dcb94[_0x279d88(0x169)],'createdAt':new Date()[_0x279d88(0x1c6)]()}),_0x35f5e8;}export async function prepareSegmentFiles(_0x2b8348,_0x2a994d,_0x4b39f4,_0x53184e,_0x1cae6a){const _0x195901=a114_0x4e41d5,{activationDefToCreateRequest:_0x48d074}=await import(_0x195901(0x209)),_0x2042a3=[],_0x3683ea=new Set();for(const {yamlConfig:_0x5a695c,folderPath:_0x4a84d6,sourcePath:_0x1a227b}of _0x2b8348){const _0x3266e1=resolveTDFolderPath(_0x4a84d6,_0x53184e,_0x1cae6a),_0x54c09d=_0x3266e1+':'+_0x5a695c[_0x195901(0x127)],_0x2bd4ff=_0x2a994d[_0x195901(0x149)][_0x195901(0x15d)](_0x54c09d),_0x260480=_0x2bd4ff?_0x2a994d[_0x195901(0x1da)][_0x195901(0x15d)](_0x2bd4ff['id'])||[]:[];addFoldersToCreate(_0x3266e1,_0x2a994d[_0x195901(0x1a5)],_0x3683ea);const _0x1ca8a4=calculateActivationActions(_0x5a695c[_0x195901(0x20b)]||[],_0x260480,_0x2a994d[_0x195901(0x21d)],_0x2a994d[_0x195901(0x159)]);for(const _0x52d40d of _0x1ca8a4){(_0x52d40d[_0x195901(0x18d)]===_0x195901(0x1ca)||_0x52d40d[_0x195901(0x18d)]===_0x195901(0x1b1))&&_0x52d40d[_0x195901(0x21f)]&&(_0x52d40d[_0x195901(0x1c4)]=await _0x48d074(_0x52d40d[_0x195901(0x21f)],_0x4b39f4));}const _0x4a8075=calculateSegmentDiff(_0x5a695c,_0x2bd4ff,_0x260480,_0x2a994d[_0x195901(0x21d)],_0x2a994d[_0x195901(0x159)]);_0x2042a3['push']({'relativePath':_0x5a695c['name'],'absolutePath':_0x1a227b,'yamlConfig':_0x5a695c,'folderPath':_0x3266e1,'existingSegment':_0x2bd4ff,'existingActivations':_0x260480,'isNew':_0x4a8075[_0x195901(0x197)],'hasChanges':_0x4a8075['hasChanges'],'diff':_0x4a8075['diff'],'activationActions':_0x1ca8a4});}return{'segmentFiles':_0x2042a3,'foldersToCreate':_0x3683ea};}export async function prepareJourneyFiles(_0x17869f,_0x6318e0,_0x4d00b0,_0x25db3f){const _0xdc5dbb=a114_0x4e41d5,_0x532b3b=[],_0x2580f3=new Set();for(const {yamlConfig:_0x549c00,folderPath:_0x4a7c5c,sourcePath:_0x3e609f}of _0x17869f){const _0x391b4d=resolveTDFolderPath(_0x4a7c5c,_0x4d00b0,_0x25db3f),_0x2e26ae=_0x391b4d+':'+_0x549c00['name'],_0x1718b3=_0x6318e0[_0xdc5dbb(0x1df)][_0xdc5dbb(0x15d)](_0x2e26ae);let _0x1dba72,_0x20627c;if(_0x1718b3&&_0x1718b3[_0xdc5dbb(0x1f6)]>0x0){const _0x41e3d1=buildLocalExpandedRuleMappings(_0x549c00),{createYamlContext:_0x56908c,prefetchJourneySegments:_0x46fad6}=createPushYamlContextForBundle(_0x6318e0[_0xdc5dbb(0x132)],_0x6318e0[_0xdc5dbb(0x128)],_0x6318e0[_0xdc5dbb(0x1c5)],_0x41e3d1,_0x6318e0[_0xdc5dbb(0x21d)],_0x6318e0['connectionIdToNameMap'],_0x6318e0[_0xdc5dbb(0x1c9)],_0x6318e0[_0xdc5dbb(0x1b7)]);await _0x46fad6(_0x1718b3['map'](_0x5087f7=>_0x5087f7['id']));const _0x4c5307=hasMultipleVersions(_0x549c00),_0x55ca9e=async _0x313a30=>{const _0x48757e=_0xdc5dbb,_0x166e62=_0x6318e0[_0x48757e(0x1b7)]?.['get'](_0x313a30);if(_0x166e62)return _0x166e62;return _0x6318e0['fetchJourney']({'journeyId':_0x313a30,'journeyName':_0x549c00[_0x48757e(0x127)],'isMultiVersion':_0x1718b3['length']>0x1});};if(_0x4c5307&&_0x1718b3[_0xdc5dbb(0x1f6)]>0x1){const _0x2b503f=[];for(const _0x53c56e of _0x1718b3){const _0x5acb55=_0x53c56e[_0xdc5dbb(0x150)]||0x1;_0x6318e0[_0xdc5dbb(0x12f)]?.[_0xdc5dbb(0x1b1)]('Fetching\x20'+_0x549c00['name']+'\x20v'+_0x5acb55);const _0x291584=await _0x55ca9e(_0x53c56e['id']),_0x5470e2=_0x56908c(_0x53c56e['id']),_0x22dd98=await journeyResponseToDef(_0x291584,_0x5470e2);_0x2b503f[_0xdc5dbb(0x164)]({'item':_0x53c56e,'yaml':_0x22dd98});}const _0x1105ea=buildLocalRuleToNameMappingFromJourney(_0x549c00);_0x20627c=buildMergedJourneyDef(_0x2b503f,_0x1105ea);const _0x44cb32=Math[_0xdc5dbb(0x16a)](..._0x2b503f[_0xdc5dbb(0x12c)](_0x2b0434=>_0x2b0434['item'][_0xdc5dbb(0x150)]||0x0)),_0x405926=_0x1718b3[_0xdc5dbb(0x21b)](_0x294ebc=>(_0x294ebc[_0xdc5dbb(0x150)]||0x0)===_0x44cb32);_0x405926&&(_0x6318e0['progress']?.[_0xdc5dbb(0x1b1)](_0xdc5dbb(0x16b)+_0x549c00[_0xdc5dbb(0x127)]+'\x20v'+_0x44cb32),_0x1dba72=await _0x55ca9e(_0x405926['id']));}else{const _0x21491f=_0x1718b3[_0x1718b3[_0xdc5dbb(0x1f6)]-0x1];_0x6318e0[_0xdc5dbb(0x12f)]?.[_0xdc5dbb(0x1b1)](_0xdc5dbb(0x16b)+_0x549c00[_0xdc5dbb(0x127)]),_0x1dba72=await _0x55ca9e(_0x21491f['id']);const _0x4c42c8=_0x56908c(_0x21491f['id']),_0x1bec1d=await journeyResponseToDef(_0x1dba72,_0x4c42c8),_0x1f5042=buildLocalRuleToNameMappingFromJourney(_0x549c00);_0x20627c=buildMergedJourneyDef([{'item':_0x21491f,'yaml':_0x1bec1d}],_0x1f5042);}}addFoldersToCreate(_0x391b4d,_0x6318e0[_0xdc5dbb(0x1a5)],_0x2580f3);const _0x2dc268=calculateJourneyDiff(_0x549c00,_0x20627c);_0x532b3b[_0xdc5dbb(0x164)]({'relativePath':_0x549c00[_0xdc5dbb(0x127)],'absolutePath':_0x3e609f,'yamlConfig':_0x549c00,'folderPath':_0x391b4d,'existingJourney':_0x1dba72,'isNew':_0x2dc268['isNew'],'hasChanges':_0x2dc268[_0xdc5dbb(0x1a3)],'diff':_0x2dc268[_0xdc5dbb(0x1bc)]});}return{'journeyFiles':_0x532b3b,'foldersToCreate':_0x2580f3};}export function calculateActivationActions(_0x25782d,_0xc809d4,_0x4d3278,_0x5e7970){const _0x1a187a=a114_0x4e41d5,_0x563812=[],_0x2cf6bd=new Map();for(const _0x16e69b of _0xc809d4){_0x2cf6bd[_0x1a187a(0x15a)](_0x16e69b[_0x1a187a(0x127)],_0x16e69b);}const _0x4ea785=new Map();for(const _0x44bfd5 of _0x25782d){_0x4ea785[_0x1a187a(0x15a)](_0x44bfd5[_0x1a187a(0x127)],_0x44bfd5);}for(const _0x25799c of _0x25782d){const _0x2d38e6=_0x2cf6bd['get'](_0x25799c['name']);if(!_0x2d38e6)_0x563812[_0x1a187a(0x164)]({'type':_0x1a187a(0x1ca),'name':_0x25799c[_0x1a187a(0x127)],'yamlActivation':_0x25799c});else{const _0x54d56c=activationResponseToDef(_0x2d38e6,_0x4d3278,_0x5e7970),_0x3ec09e=a114_0x15ee24[_0x1a187a(0x1e4)](_0x54d56c),_0x5e6c7c=a114_0x15ee24['stringify'](_0x25799c);_0x3ec09e!==_0x5e6c7c&&_0x563812['push']({'type':_0x1a187a(0x1b1),'name':_0x25799c[_0x1a187a(0x127)],'yamlActivation':_0x25799c,'existingActivation':_0x2d38e6});}}for(const _0xd015e8 of _0xc809d4){!_0x4ea785[_0x1a187a(0x18a)](_0xd015e8[_0x1a187a(0x127)])&&_0x563812['push']({'type':_0x1a187a(0x1a7),'name':_0xd015e8[_0x1a187a(0x127)],'existingActivation':_0xd015e8});}return _0x563812;}function calculateYamlDiff(_0xd23af,_0x38864b){if(_0x38864b){const _0x345bc4=generateDiff(_0x38864b,_0xd23af),_0x4ab228=hasChanges(_0x345bc4);return{'isNew':![],'hasChanges':_0x4ab228,'diff':_0x4ab228?formatDiffWithColors(_0x345bc4):undefined};}const _0x34a473=generateDiff('',_0xd23af);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x34a473)};}export function calculateSegmentDiff(_0x5197cc,_0x285cca,_0xf7729d,_0x56cf4d,_0x57afb6){const _0x592548=segmentToYamlString(_0x5197cc),_0x2e60a9=_0x285cca?segmentToYamlString(segmentWithActivationsToYaml(_0x285cca,_0xf7729d,undefined,_0x56cf4d,_0x57afb6)):undefined;return calculateYamlDiff(_0x592548,_0x2e60a9);}export function calculateJourneyDiff(_0x4ae2e9,_0x83a9b6){const _0x551e3b=normalizeJourneyDef(_0x4ae2e9,_0x4ae2e9),_0xe7482d=a114_0x1ab3c6(_0x551e3b),_0x240ee1=_0x83a9b6?a114_0x1ab3c6(normalizeJourneyDef(_0x83a9b6,_0x4ae2e9)):undefined;return calculateYamlDiff(_0xe7482d,_0x240ee1);}export function findSegmentsToDelete(_0x29f2e2,_0x53065f,_0x365c91,_0xd4ec08,_0x3e37d0){const _0x574c20=a114_0x4e41d5,_0x69ff33=new Set();for(const {yamlConfig:_0x463ade,folderPath:_0x55c8f6}of _0x53065f){_0x69ff33[_0x574c20(0x1ee)](_0x55c8f6+':'+_0x463ade['name']);}return _0x29f2e2[_0x574c20(0x19b)](_0x4f1e6d=>{const _0x508167=_0x574c20,_0x567d2a=_0x4f1e6d['segmentFolderId']?_0x365c91[_0x508167(0x15d)](_0x4f1e6d[_0x508167(0x1ed)][_0x508167(0x155)]())||'':'',_0x4587ca=_0x567d2a+':'+_0x4f1e6d['name'];if(_0x69ff33[_0x508167(0x18a)](_0x4587ca))return![];if(_0x3e37d0)return _0x567d2a===_0xd4ec08||_0x567d2a['startsWith'](_0xd4ec08+'/');return!![];});}export function findJourneysToDelete(_0x127c44,_0xe6299a,_0x3d1006,_0x2506cd,_0x180398){const _0x4d36d5=a114_0x4e41d5,_0x39254c=new Set();for(const {yamlConfig:_0x518224,folderPath:_0x47a435}of _0xe6299a){_0x39254c[_0x4d36d5(0x1ee)](_0x47a435+':'+_0x518224['name']);}return _0x127c44[_0x4d36d5(0x19b)](_0x58d9d7=>{const _0x20a027=_0x4d36d5,_0x22622b=_0x58d9d7['folderId']?_0x3d1006[_0x20a027(0x15d)](_0x58d9d7['folderId'])||'':'',_0x35963d=_0x22622b+':'+_0x58d9d7[_0x20a027(0x1cc)];if(_0x39254c[_0x20a027(0x18a)](_0x35963d))return![];if(_0x180398)return _0x22622b===_0x2506cd||_0x22622b[_0x20a027(0x202)](_0x2506cd+'/');return!![];});}export function buildSegmentLookupMap(_0x2bef16,_0x411362){const _0x52986d=a114_0x4e41d5,_0x43a1b4=new Map();for(const _0x5a3d8a of _0x2bef16){const _0x16ffee=_0x5a3d8a[_0x52986d(0x1ed)]?_0x411362[_0x52986d(0x15d)](_0x5a3d8a[_0x52986d(0x1ed)][_0x52986d(0x155)]())||'':'',_0xdb5592=_0x16ffee+':'+_0x5a3d8a[_0x52986d(0x127)];_0x43a1b4[_0x52986d(0x15a)](_0xdb5592,_0x5a3d8a);}return _0x43a1b4;}export function buildSegmentNameToIdMap(_0x5944bc){const _0x5438a9=a114_0x4e41d5,_0x3404db=new Map();for(const _0x5dbbb6 of _0x5944bc){_0x3404db[_0x5438a9(0x15a)](_0x5dbbb6[_0x5438a9(0x127)],_0x5dbbb6['id']);}return _0x3404db;}export function buildJourneyBundleLookupMap(_0x3f9fdf,_0x495403){const _0x2150d3=a114_0x4e41d5,_0x1da169=new Map();for(const _0x3a6118 of _0x3f9fdf){const _0x5aefbf=_0x3a6118[_0x2150d3(0x201)]?_0x495403['get'](_0x3a6118[_0x2150d3(0x201)])||'':'',_0x994854=_0x5aefbf+':'+_0x3a6118[_0x2150d3(0x1cc)];!_0x1da169['has'](_0x994854)&&_0x1da169[_0x2150d3(0x15a)](_0x994854,[]),_0x1da169[_0x2150d3(0x15d)](_0x994854)[_0x2150d3(0x164)](_0x3a6118);}for(const _0x57e758 of _0x1da169[_0x2150d3(0x195)]()){_0x57e758[_0x2150d3(0x16e)]((_0x466e52,_0x5acd3b)=>(_0x466e52[_0x2150d3(0x150)]||0x0)-(_0x5acd3b[_0x2150d3(0x150)]||0x0));}return _0x1da169;}export function collectFoldersToCreate(_0x5d4a41,_0x360523){const _0x5b055=a114_0x4e41d5,_0x2c9493=new Set();for(const _0x1e3db3 of _0x5d4a41){if(!_0x1e3db3)continue;if(_0x360523['has'](_0x1e3db3))continue;const _0x348d30=_0x1e3db3[_0x5b055(0x1f3)]('/');let _0x42eb89='';for(const _0x3a2525 of _0x348d30){_0x42eb89=_0x42eb89?_0x42eb89+'/'+_0x3a2525:_0x3a2525,!_0x360523[_0x5b055(0x18a)](_0x42eb89)&&_0x2c9493['add'](_0x42eb89);}}return _0x2c9493;}export function parseAndClassifyYamlFiles(_0x303c5d,_0x5e0003,_0x5edbf9){const _0x4be711=a114_0x4e41d5,_0x2a92b0=[],_0x2f9fe6=[];for(const _0x32dad9 of _0x303c5d){const _0x56ab6b=a114_0x5e5ff3[_0x4be711(0x1f9)](_0x5e0003,a114_0x5e5ff3[_0x4be711(0x161)](_0x32dad9)),_0x2bb0b5=_0x56ab6b==='.'?'':_0x56ab6b,_0xf5f9e8=readFileSync(_0x32dad9,_0x4be711(0x141)),_0x3e4421=a114_0x15ee24[_0x4be711(0x152)](_0xf5f9e8);if(isJourneyDef(_0x3e4421)){const _0x11454f=a114_0x33d79a(_0xf5f9e8);_0x2f9fe6['push']({'yamlConfig':_0x11454f,'folderPath':_0x2bb0b5,'sourcePath':_0x32dad9});}else{if(!_0x5edbf9?.[_0x4be711(0x158)]){const _0x40e9f1=parseSegmentYamlFile(_0xf5f9e8),_0x1fd8a7=normalizeChildSegmentYaml(_0x40e9f1);_0x2a92b0[_0x4be711(0x164)]({'yamlConfig':_0x1fd8a7,'folderPath':_0x2bb0b5,'sourcePath':_0x32dad9});}}}return{'segments':_0x2a92b0,'journeys':_0x2f9fe6};}export function validateParsedFiles(_0x43867c,_0x439e25){const _0x1b1a1b=a114_0x4e41d5,_0x26e481=[];for(const {yamlConfig:_0x19bd4b,sourcePath:_0x39ebf7}of _0x43867c[_0x1b1a1b(0x193)]){const _0x52e352=readFileSync(_0x39ebf7,_0x1b1a1b(0x141)),_0x1bcb68=a114_0x15ee24[_0x1b1a1b(0x12b)](_0x52e352),_0x3a3003=validateSegmentDef(_0x19bd4b,{'source':_0x52e352,'document':_0x1bcb68});if(!_0x3a3003[_0x1b1a1b(0x21c)]){const _0x1e3266=a114_0x5e5ff3[_0x1b1a1b(0x1f9)](_0x439e25,_0x39ebf7);_0x26e481[_0x1b1a1b(0x164)]({'filePath':_0x1e3266,'source':_0x52e352,'result':_0x3a3003,'isJourney':![]});}}for(const {yamlConfig:_0x5b95df,sourcePath:_0x34d4c1}of _0x43867c[_0x1b1a1b(0x17a)]){const _0x7b93c1=readFileSync(_0x34d4c1,'utf-8'),_0x2a32bc=a114_0x15ee24[_0x1b1a1b(0x12b)](_0x7b93c1),_0x2716cd=validateJourneyDef(_0x5b95df,{'source':_0x7b93c1,'document':_0x2a32bc});if(!_0x2716cd['valid']){const _0x148087=a114_0x5e5ff3[_0x1b1a1b(0x1f9)](_0x439e25,_0x34d4c1);_0x26e481[_0x1b1a1b(0x164)]({'filePath':_0x148087,'source':_0x7b93c1,'result':_0x2716cd,'isJourney':!![]});}}return _0x26e481;}export function formatValidationErrors(_0x58ac9c){const _0x5a6705=a114_0x4e41d5,_0x581681=[];for(const {filePath:_0x38e2ea,source:_0x3a3725,result:_0x4a37aa,isJourney:_0x71f9c1}of _0x58ac9c){const _0x34565c=_0x71f9c1?'journey':_0x5a6705(0x1a9);_0x581681[_0x5a6705(0x164)]('\x0a'+_0x38e2ea+'\x20('+_0x34565c+'):\x20'+_0x4a37aa[_0x5a6705(0x214)][_0x5a6705(0x1f6)]+_0x5a6705(0x1f0)),_0x581681[_0x5a6705(0x164)](formatValidationResult(_0x4a37aa,_0x3a3725,_0x38e2ea));}return _0x581681[_0x5a6705(0x1e9)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x35fa14){const _0x30cfeb=a114_0x4e41d5,_0x45d2ba=new Set(),_0x412413=new Map(),_0x53db92=collectSegmentUsageCounts(_0x35fa14);if(_0x35fa14['segments'])for(const [_0x47b8e6,_0x37b620]of Object[_0x30cfeb(0x1ae)](_0x35fa14[_0x30cfeb(0x193)])){_0x45d2ba[_0x30cfeb(0x1ee)](_0x47b8e6);if(_0x37b620[_0x30cfeb(0x136)]){const _0x237439=yamlRuleToApi(_0x37b620[_0x30cfeb(0x136)]),_0x523549=apiRuleToYaml(_0x237439);_0x412413[_0x30cfeb(0x15a)](_0x47b8e6,_0x523549);}}const _0x37e873=new Map();let _0x45a9fe=0x0;for(const [_0x324a31,_0x334fd4]of _0x412413){const _0x20fe90=serializeExpandedRule(_0x334fd4,_0x412413),_0x23f0f5=_0x37e873[_0x30cfeb(0x15d)](_0x20fe90)||[];_0x23f0f5[_0x30cfeb(0x164)]({'name':_0x324a31,'index':_0x45a9fe}),_0x37e873[_0x30cfeb(0x15a)](_0x20fe90,_0x23f0f5),_0x45a9fe++;}const _0x1114db=new Map();for(const [_0x43ae78,_0x2fb5fe]of _0x37e873){const _0x47ab4c=_0x2fb5fe['slice']()[_0x30cfeb(0x16e)]((_0x382d62,_0x25cdb2)=>{const _0x154afd=_0x30cfeb,_0x295cb8=_0x53db92['get'](_0x382d62[_0x154afd(0x127)])||0x0,_0x2cbd40=_0x53db92['get'](_0x25cdb2[_0x154afd(0x127)])||0x0;if(_0x295cb8!==_0x2cbd40)return _0x2cbd40-_0x295cb8;return _0x382d62['index']-_0x25cdb2[_0x154afd(0x1f4)];})[_0x30cfeb(0x12c)](_0x415f7d=>_0x415f7d[_0x30cfeb(0x127)]),_0x1f5ed5=[];for(const _0x29295a of _0x47ab4c){const _0x444617=_0x53db92[_0x30cfeb(0x15d)](_0x29295a)||0x0,_0x58515d=Math['max'](_0x444617,0x1);for(let _0x120af7=0x0;_0x120af7<_0x58515d;_0x120af7++){_0x1f5ed5['push'](_0x29295a);}}_0x1114db['set'](_0x43ae78,_0x1f5ed5);}return{'existingLocalSegmentNames':_0x45d2ba,'localSegmentRules':_0x412413,'localExpandedRuleToNames':_0x1114db};}export function createSegmentIdResolver(_0x41e9f4,_0x53c37b){return async _0x1736af=>{const _0x1777b0=a114_0x4671,_0x462e38=_0x41e9f4['get'](_0x1736af);if(!_0x462e38)throw new SDKError(ErrorCode[_0x1777b0(0x220)],'Segment\x20not\x20found:\x20'+_0x1736af+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x53c37b+'\x27)');return _0x462e38;};}export function extractRootFolderId(_0xe5a881){const _0x5d0ac9=a114_0x4e41d5;return _0xe5a881['relationships']?.[_0x5d0ac9(0x147)]?.[_0x5d0ac9(0x207)]?.['id']||_0xe5a881[_0x5d0ac9(0x174)]?.[_0x5d0ac9(0x1de)]?.[_0x5d0ac9(0x207)]?.['id'];}export function buildConnectionMaps(_0x39aa7e){const _0x10f912=a114_0x4e41d5,_0x354350=new Map(),_0x6e9eac=new Map(),_0x2cac61=new Map();for(const _0x390e9d of _0x39aa7e){_0x354350[_0x10f912(0x15a)](_0x390e9d[_0x10f912(0x127)],parseInt(_0x390e9d['id'],0xa)),_0x6e9eac[_0x10f912(0x15a)](_0x390e9d['id'],_0x390e9d[_0x10f912(0x127)]),_0x2cac61[_0x10f912(0x15a)](_0x390e9d[_0x10f912(0x127)],_0x390e9d[_0x10f912(0x18d)]);}return{'nameToId':_0x354350,'idToName':_0x6e9eac,'nameToType':_0x2cac61};}export function calculatePushStats(_0x5f54b3,_0xeaf3a3,_0x5351a5,_0x18f6a3,_0x107287,_0x13c67d,_0x3a797b){const _0x3f7ae2=a114_0x4e41d5,_0x2972bb=_0x5f54b3['filter'](_0x40ee29=>_0x40ee29['isNew']),_0x382394=_0x5f54b3['filter'](_0x4f1273=>!_0x4f1273[_0x3f7ae2(0x197)]&&_0x4f1273['hasChanges']),_0x3a8f00=_0x5f54b3[_0x3f7ae2(0x19b)](_0x29ef73=>!_0x29ef73[_0x3f7ae2(0x197)]&&!_0x29ef73[_0x3f7ae2(0x1a3)]),_0x513f94=_0x13c67d?_0x18f6a3:[],_0x2fd614=_0xeaf3a3[_0x3f7ae2(0x19b)](_0x99e1e9=>_0x99e1e9[_0x3f7ae2(0x197)]),_0x285073=_0xeaf3a3[_0x3f7ae2(0x19b)](_0x4b4940=>!_0x4b4940[_0x3f7ae2(0x197)]&&_0x4b4940[_0x3f7ae2(0x1a3)]),_0x1e193e=_0xeaf3a3['filter'](_0x368a5a=>!_0x368a5a[_0x3f7ae2(0x197)]&&!_0x368a5a[_0x3f7ae2(0x1a3)]),_0xbe071=_0x13c67d?_0x107287:[],_0x5953f4=_0x5f54b3[_0x3f7ae2(0x1bf)](_0x3192e4=>_0x3192e4[_0x3f7ae2(0x162)]),_0x371d63=_0x5953f4[_0x3f7ae2(0x19b)](_0x1a3580=>_0x1a3580['type']===_0x3f7ae2(0x1ca)),_0xf09d7f=_0x5953f4['filter'](_0x58dd43=>_0x58dd43[_0x3f7ae2(0x18d)]===_0x3f7ae2(0x1b1)),_0x5cccf5=_0x5953f4[_0x3f7ae2(0x19b)](_0x423669=>_0x423669['type']===_0x3f7ae2(0x1a7)),_0x5828e4=Array[_0x3f7ae2(0x15b)](_0x5351a5)[_0x3f7ae2(0x16e)](),_0x3993e5=_0x3a797b?![]:_0x2972bb[_0x3f7ae2(0x1f6)]>0x0||_0x382394['length']>0x0||_0x513f94['length']>0x0,_0x5cc2fd=_0x2fd614[_0x3f7ae2(0x1f6)]>0x0||_0x285073[_0x3f7ae2(0x1f6)]>0x0||_0xbe071[_0x3f7ae2(0x1f6)]>0x0,_0x5a92a4=_0x3a797b?![]:_0x5953f4[_0x3f7ae2(0x1f6)]>0x0,_0x10b429=_0x5828e4[_0x3f7ae2(0x1f6)]>0x0;return{'segments':{'new':_0x2972bb,'changed':_0x382394,'unchanged':_0x3a8f00,'toDelete':_0x513f94},'journeys':{'new':_0x2fd614,'changed':_0x285073,'unchanged':_0x1e193e,'toDelete':_0xbe071},'activations':{'all':_0x5953f4,'toCreate':_0x371d63,'toUpdate':_0xf09d7f,'toDelete':_0x5cccf5},'folders':{'toCreate':_0x5828e4},'counts':{'segments':{'new':_0x2972bb[_0x3f7ae2(0x1f6)],'changed':_0x382394['length'],'unchanged':_0x3a8f00[_0x3f7ae2(0x1f6)],'toDelete':_0x513f94[_0x3f7ae2(0x1f6)]},'journeys':{'new':_0x2fd614['length'],'changed':_0x285073[_0x3f7ae2(0x1f6)],'unchanged':_0x1e193e[_0x3f7ae2(0x1f6)],'toDelete':_0xbe071[_0x3f7ae2(0x1f6)]},'activations':{'create':_0x371d63[_0x3f7ae2(0x1f6)],'update':_0xf09d7f[_0x3f7ae2(0x1f6)],'delete':_0x5cccf5[_0x3f7ae2(0x1f6)]},'folders':_0x5828e4['length']},'hasChanges':_0x3993e5||_0x5cc2fd||_0x5a92a4||_0x10b429};}function a114_0x45f0(){const _0x3b3832=['logInfo','Created\x20segment\x20\x27','Embedded\x20segment\x20\x27','waitStepUnit','resolveJourneyId','existingActivation','hasChanges','some','folderPathToId','description','delete','effectiveFolderId','segment','activation_updated','entryCriteria','16194GcSGGL','Deleting\x20activation\x20\x27','entries','attributes','with','update','segment_created','sha1','createFolder','activation_deleting','conditions','journeyById','yamlConfig','connection','deleteSegment','updated','diff','object','entry_criteria','flatMap','created','all_columns','7350gXOWHV','createdSegmentId','validatedRequest','existingSegments','toISOString','./journey-yaml.js','slice','activationStepsById','create','journey','journeyBundleName','\x27\x20for\x20','activation_created','getSegmentEntity\x20also\x20failed\x20for\x20','waitStepType','Name\x20has\x20already\x20been\x20taken','segment_deleting','decision_point','getSegmentEntity','\x0a\x20\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','1490Rkounz','.$1.push-recovery.json','conditionSegmentId','activationsBySegmentId','deleted','Activation','schedule','parentFolder','journeyBundlesByFolderAndName','7vSLtSp','Created\x20folder\x20\x27','segment_updated','JOURNEY_SYNTAX_ERROR','stringify','journeyActivationNameToId','Updated\x20journey\x20\x27','listActivations','segmentNameToId','join','stages','columns','\x20journey\x20from\x20file:\x20','segmentFolderId','add','2431384EjaEMD','\x20error(s)','\x27\x20milestone','segment_updating','split','index','embedded_segment_creating','length','localName','waitStep','relative','state','connector_config','toLowerCase','Deleted\x20segment\x20\x27','goal','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','existingSegment','folderId','startsWith','__pending_act_','folder_created','Segment\x20not\x20found','activation_updating','data','action','./child-segment-yaml.js','embeddedSegmentNameToId','activations','journeyActivationStepId','behavior','WaitStep','journeyId','steps','logDeleted','logWarning','message','errors','kind','getJourney','tdx.sdk.push-workflow','__pending_','embedded_activation_creating','Delete\x20the\x20push\x20recovery\x20file\x20(','find','valid','idToEmailMap','Updated\x20segment\x20\x27','yamlActivation','SEGMENT_NOT_FOUND','updateActivation','notification','absolutePath','createActivation','resolveSegment','name','parentId','embedded_activation_created','conditionTimeoutUnit','parseDocument','map','journey_entry_criteria_','Condition','progress','3284dVOIdk','existingJourney','deps',').\x20','verbose','../../utils/async.js','rule','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','deleteActivation','\x27\x20wait\x20condition','results','embedded_segment_created','withProgress','INTERNAL','all','Segment\x20not\x20found:\x20','uniqueServerName','utf-8','activation_','SEGMENT_SYNTAX_ERROR',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','getActivation','\x20segment\x20from\x20file:\x20','parentSegmentFolder','activation_creating','segmentByFolderAndName','list','journeyName','unchanged','isArray','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','stage\x20\x27','versionNumber','run_after_journey_refresh','parse','NOT_FOUND','\x27\x20not\x20found\x20in\x20journey\x20\x27','toString','Created\x20activation\x20\x27','goal\x20criteria','skipSegments','connectionIdToNameMap','set','from','size','get','Creating\x20activation\x20\x27','onProgress','resolvedRule','dirname','activationActions','Entry\x20criteria:\x20','push','conditionTimeoutDuration','\x20activation\x20\x27','ACTIVATION_UPDATE_ERROR','747owdPUc','uniqueSegmentName','max','Fetching\x20','Creating\x20segment\x20\x27','364113SSczqf','sort','journey_created','createdSegmentIds','activation_deleted','segment_creating','trim','relationships','getSegment\x20failed\x20for\x20','branches','Failed\x20to\x20resolve\x20activation\x20','\x27\x20exit\x20criteria','logSuccess','journeys','activation_template_id','activationContext','exitCriterias','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','activationParams','Failed\x20to\x20','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','618992JGnuVv','segment_deleted','milestone','\x27\x20decision\x20point\x20branch\x20\x27','replace','segmentId','and\x20the\x20server\x20segment,\x20then\x20retry.','\x27\x20from\x20file:\x20','has','journeyStages','Deleted\x20activation\x20\x27','type','DecisionPoint','updateSegmentById','\x27...','rootFolderId','debug','segments','\x27\x20entry\x20criteria','values','hex','isNew','keys','folderPath','96897tjPQcc','filter','Activation\x20not\x20found:\x20'];a114_0x45f0=function(){return _0x3b3832;};return a114_0x45f0();}export async function buildPushExecutionContext(_0xa0eab6,_0x48db73,_0x49e7d9,_0x3c2a59,_0x3af293,_0x544ec9){const _0xda40a4=a114_0x4e41d5,_0x18dc02=extractRootFolderId(_0x49e7d9),{pathToId:_0x5d561f,idToPath:_0x3201d5}=buildFolderMaps(_0x3af293),_0x14b4e6=buildSegmentNameToIdMap(_0x3c2a59),_0x27c9d8=new Map(),{batchAsync:_0x4154ea}=await import(_0xda40a4(0x135)),[_0x170201,_0x40cd1b]=await Promise['all']([_0xa0eab6['user']['buildUserMaps'](),_0xa0eab6[_0xda40a4(0x1b9)][_0xda40a4(0x14a)](),((async()=>{const _0x431ea4=_0xda40a4;!_0x544ec9&&_0x3c2a59[_0x431ea4(0x1f6)]>0x0&&await _0x4154ea(_0x3c2a59,async _0xbd898=>{const _0x4030bf=_0x431ea4,_0x3d9150=await _0xa0eab6[_0x4030bf(0x1a9)][_0x4030bf(0x1e7)](_0x48db73,_0xbd898['id']);_0x27c9d8[_0x4030bf(0x15a)](_0xbd898['id'],_0x3d9150);});})())]),{emailToId:_0x1cb559,idToEmail:_0x2487ca}=_0x170201,_0x4dab15=buildConnectionMaps(_0x40cd1b);return{'rootFolderId':_0x18dc02,'folderPathToId':_0x5d561f,'folderIdToPath':_0x3201d5,'segmentNameToId':_0x14b4e6,'activationsBySegmentId':_0x27c9d8,'emailToIdMap':_0x1cb559,'idToEmailMap':_0x2487ca,'connectionNameToIdMap':_0x4dab15['nameToId'],'connectionIdToNameMap':_0x4dab15['idToName'],'connectionNameToTypeMap':_0x4dab15['nameToType']};}export function createPushYamlContextForBundle(_0x2fe28a,_0x32fe65,_0x16c6f3,_0x14a41d,_0x4bc674,_0x3dd40e,_0x4ed7cd,_0x546549){const {existingLocalSegmentNames:_0x577c70,localExpandedRuleToNames:_0x61c033}=_0x14a41d,_0x1f7231=new Set(),_0x14449d=new Map(),_0x456887=new Map(),_0x2e21d4=new Map(),_0x47192e=createJumpTargetCache(),_0x3f6319=new Map(),_0x13e765=new Map(),_0x3b69dd=new Set();let _0x26b801;const _0x5cefff=_0x5163b7=>{const _0x4553c9={'resolveSegment':async _0x2068e9=>{const _0xb8a5ef=a114_0x4671,_0x733b0d=_0x2e21d4['get'](_0x2068e9);if(_0x733b0d!==undefined)return{'name':_0x733b0d,'isJourneyLocal':!![]};try{const _0x19b28f=await fetchSegment(_0x2fe28a,_0x32fe65,_0x2068e9,_0x16c6f3);if(!_0x19b28f)throw new Error(_0xb8a5ef(0x205));const _0x39356b=generateJourneyLocalName(_0x19b28f['name']),_0x3ec7c0=_0x19b28f[_0xb8a5ef(0x215)]===SEGMENT_KIND_JOURNEY&&_0x39356b!==undefined;let _0x4418ca=_0x19b28f[_0xb8a5ef(0x127)],_0x4fafed;if(_0x3ec7c0&&_0x19b28f['rule']){const _0x11259a=apiRuleToYaml(_0x19b28f[_0xb8a5ef(0x136)]);_0x13e765[_0xb8a5ef(0x15a)](_0x2068e9,_0x11259a);const _0x2ea729=async _0xed9767=>{const _0x80b4ec=_0xb8a5ef,_0x35cf56=collectSegmentRefsFromRule(_0xed9767);for(const _0x175d18 of _0x35cf56){if(!_0x13e765[_0x80b4ec(0x18a)](_0x175d18))try{const _0x59b51c=await fetchSegment(_0x2fe28a,_0x32fe65,_0x175d18,_0x16c6f3);if(_0x59b51c?.['rule']){const _0x5cd881=apiRuleToYaml(_0x59b51c[_0x80b4ec(0x136)]);_0x13e765[_0x80b4ec(0x15a)](_0x175d18,_0x5cd881),await _0x2ea729(_0x5cd881);}}catch(_0x34f01e){logger[_0x80b4ec(0x192)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x175d18+':\x20'+_0x34f01e);}}};await _0x2ea729(_0x11259a);const _0x154923=serializeExpandedRule(_0x11259a,_0x13e765),_0x336eb0=_0x61c033[_0xb8a5ef(0x15d)](_0x154923);if(_0x336eb0&&_0x336eb0[_0xb8a5ef(0x1f6)]>0x0){const _0x1f2f15=_0x14449d[_0xb8a5ef(0x15d)](_0x154923)||0x0,_0x2b90c6=_0x336eb0[_0x1f2f15]||_0x336eb0[_0x336eb0[_0xb8a5ef(0x1f6)]-0x1];_0x14449d['set'](_0x154923,_0x1f2f15+0x1),_0x4418ca=_0x2b90c6,_0x1f7231['add'](_0x4418ca),_0x2e21d4[_0xb8a5ef(0x15a)](_0x2068e9,_0x4418ca);const _0x168213=await resolveRuleSegmentRefs(_0x11259a,async _0x4a2b4a=>{const _0x239081=_0xb8a5ef,_0x3ad5bb=_0x2e21d4[_0x239081(0x15d)](_0x4a2b4a);if(_0x3ad5bb)return _0x3ad5bb;const _0x54222f=await _0x26b801[_0x239081(0x126)](_0x4a2b4a);return _0x54222f[_0x239081(0x127)];});_0x4fafed={'description':_0x19b28f[_0xb8a5ef(0x1a6)],'rule':_0x168213};}else{const _0x48a045=_0x3f6319[_0xb8a5ef(0x15d)](_0x154923);if(_0x48a045)_0x4418ca=_0x48a045,_0x2e21d4['set'](_0x2068e9,_0x4418ca);else{if(_0x39356b){let _0x265169=_0x39356b,_0x39f86c=0x2;while(_0x1f7231[_0xb8a5ef(0x18a)](_0x265169)||_0x577c70['has'](_0x265169)){_0x265169=_0x39356b+'_'+_0x39f86c,_0x39f86c++;}_0x1f7231['add'](_0x265169),_0x4418ca=_0x265169;}_0x2e21d4[_0xb8a5ef(0x15a)](_0x2068e9,_0x4418ca),_0x3f6319[_0xb8a5ef(0x15a)](_0x154923,_0x4418ca);const _0x35c6c7=await resolveRuleSegmentRefs(_0x11259a,async _0x1a273b=>{const _0x26733f=_0xb8a5ef,_0x3a47a0=_0x2e21d4[_0x26733f(0x15d)](_0x1a273b);if(_0x3a47a0)return _0x3a47a0;const _0x7fe01c=await _0x26b801['resolveSegment'](_0x1a273b);return _0x7fe01c[_0x26733f(0x127)];});_0x4fafed={'description':_0x19b28f[_0xb8a5ef(0x1a6)],'rule':_0x35c6c7};}}}return{'name':_0x4418ca,'isJourneyLocal':_0x3ec7c0,'definition':_0x4fafed};}catch(_0x41590b){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x2068e9+':\x20'+_0x41590b),{'name':_0x2068e9,'isJourneyLocal':![]};}},'resolveActivation':async _0x19ab91=>{const _0xf9ce57=a114_0x4671,_0x11b304=_0x456887[_0xf9ce57(0x15d)](_0x19ab91);if(_0x11b304!==undefined)return{'name':_0x11b304,'isJourneyLocal':!![]};try{let _0x2420b1=_0x4ed7cd?.[_0xf9ce57(0x15d)](_0x19ab91);!_0x2420b1&&(_0x2420b1=await _0x2fe28a[_0xf9ce57(0x1cb)][_0xf9ce57(0x145)](_0x5163b7,_0x19ab91));const _0x359ec3=_0x2420b1[_0xf9ce57(0x1af)][_0xf9ce57(0x17f)][_0xf9ce57(0x127)]||_0x19ab91,_0x5658ea=sanitizeYamlKey(_0x359ec3)||_0xf9ce57(0x142)+_0x19ab91,_0x3d8f1a=_0x5658ea;_0x456887[_0xf9ce57(0x15a)](_0x19ab91,_0x3d8f1a);const _0x10b578=journeyActivationStepToYaml(_0x2420b1,_0x4bc674,_0x3dd40e);return{'name':_0x3d8f1a,'isJourneyLocal':!![],'definition':_0x10b578};}catch(_0x230280){return logger[_0xf9ce57(0x192)](_0xf9ce57(0x177)+_0x19ab91+':\x20'+_0x230280),{'name':_0x19ab91,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x45a43c,_0x31ee29)=>resolveJumpTarget(_0x45a43c,_0x31ee29,_0x47192e,async _0x57fe69=>{const _0x146249=a114_0x4671,_0x3118b5=_0x546549?.['get'](_0x57fe69);if(_0x3118b5)return _0x3118b5;return _0x2fe28a[_0x146249(0x1cb)]['getJourney'](_0x57fe69);})};return _0x26b801=_0x4553c9,_0x4553c9;},_0x851bdd=async _0xbdf9de=>{const _0x4bee58=a114_0x4671,{collectSegmentIdsFromJourneyApi:_0x3e0ff7}=await import(_0x4bee58(0x1c7)),{batchAsync:_0xdf0c01}=await import(_0x4bee58(0x135)),_0x4eb174=new Set();for(const _0x28dfbf of _0xbdf9de){let _0x3870f7=_0x546549?.[_0x4bee58(0x15d)](_0x28dfbf);!_0x3870f7&&(_0x3870f7=await _0x2fe28a[_0x4bee58(0x1cb)][_0x4bee58(0x216)](_0x28dfbf));const _0x42c567=_0x3e0ff7(_0x3870f7);for(const _0x26d963 of _0x42c567){_0x4eb174[_0x4bee58(0x1ee)](_0x26d963);}}let _0x58ca64=Array[_0x4bee58(0x15b)](_0x4eb174);while(_0x58ca64[_0x4bee58(0x1f6)]>0x0){const _0x45675a=_0x58ca64[_0x4bee58(0x19b)](_0x1e2275=>!_0x3b69dd[_0x4bee58(0x18a)](_0x1e2275));if(_0x45675a[_0x4bee58(0x1f6)]===0x0)break;const _0x301ac1=await _0xdf0c01(_0x45675a,async _0x4a262e=>{const _0x39bf4e=_0x4bee58;_0x3b69dd[_0x39bf4e(0x1ee)](_0x4a262e);const _0x47ec86=await fetchSegment(_0x2fe28a,_0x32fe65,_0x4a262e,_0x16c6f3);if(!_0x47ec86)return null;return{'segmentId':_0x4a262e,'segment':_0x47ec86};},0xa),_0x17dc44=new Set();for(const _0x2e02ba of _0x301ac1){if(!_0x2e02ba?.[_0x4bee58(0x1a9)]?.[_0x4bee58(0x136)])continue;const _0x4e0606=apiRuleToYaml(_0x2e02ba[_0x4bee58(0x1a9)]['rule']);_0x13e765['set'](_0x2e02ba[_0x4bee58(0x187)],_0x4e0606);const _0x51e19a=collectSegmentRefsFromRule(_0x4e0606);for(const _0x2030cc of _0x51e19a){!_0x3b69dd['has'](_0x2030cc)&&_0x17dc44['add'](_0x2030cc);}}_0x58ca64=Array[_0x4bee58(0x15b)](_0x17dc44);}};return{'createYamlContext':_0x5cefff,'prefetchJourneySegments':_0x851bdd};}export async function executePushSegments(_0x30c1c8,_0x79408e,_0x4360cd,_0x2f6a4f,_0x1b26b0){const _0xb0ca56=a114_0x4e41d5,{segmentDefToCreateRequest:_0x5e0807,segmentDefToUpdateRequest:_0x2f1946}=await import(_0xb0ca56(0x209)),_0x400dcd=_0x4360cd[_0xb0ca56(0x1a5)],_0x18d1ab=0x5,_0x3d81aa=async _0x567f52=>{const _0x2e579c=_0xb0ca56,_0x3ceb2e=_0x567f52['folderPath']?_0x400dcd['get'](_0x567f52[_0x2e579c(0x199)]):undefined;let _0xce4a97;const _0xb2ef50={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x567f52[_0x2e579c(0x197)]){_0x1b26b0[_0x2e579c(0x15f)]?.({'type':_0x2e579c(0x172),'name':_0x567f52[_0x2e579c(0x1b8)]['name']});const _0x2a3599=_0x5e0807(_0x567f52[_0x2e579c(0x1b8)],_0x3ceb2e),_0x6b8159=await _0x1b26b0[_0x2e579c(0x13c)](_0x2e579c(0x16c)+_0x567f52[_0x2e579c(0x1b8)][_0x2e579c(0x127)]+_0x2e579c(0x190),()=>_0x30c1c8[_0x2e579c(0x1a9)]['createSegment'](_0x2f6a4f[_0x2e579c(0x128)],_0x2a3599));_0xce4a97=_0x6b8159[_0x2e579c(0x207)]['id'],_0xb2ef50[_0x2e579c(0x1c3)]={'name':_0x567f52[_0x2e579c(0x1b8)][_0x2e579c(0x127)],'id':_0xce4a97},_0x1b26b0['onProgress']?.({'type':_0x2e579c(0x1b2),'name':_0x567f52['yamlConfig'][_0x2e579c(0x127)],'segmentId':_0xce4a97}),_0x1b26b0[_0x2e579c(0x179)]?.(_0x2e579c(0x19e)+_0x567f52[_0x2e579c(0x1b8)]['name']+'\x27'),_0xb2ef50['created']=0x1;}else{if(_0x567f52[_0x2e579c(0x1a3)]){_0x1b26b0[_0x2e579c(0x15f)]?.({'type':_0x2e579c(0x1f2),'name':_0x567f52[_0x2e579c(0x1b8)][_0x2e579c(0x127)]});const _0x57b973=_0x2f1946(_0x567f52[_0x2e579c(0x1b8)]);_0x3ceb2e!==_0x567f52[_0x2e579c(0x200)]?.['segmentFolderId']&&(_0x57b973[_0x2e579c(0x1ed)]=_0x3ceb2e?parseInt(_0x3ceb2e,0xa):undefined),await _0x1b26b0[_0x2e579c(0x13c)]('Updating\x20segment\x20\x27'+_0x567f52[_0x2e579c(0x1b8)][_0x2e579c(0x127)]+_0x2e579c(0x190),()=>_0x30c1c8[_0x2e579c(0x1a9)]['updateSegmentById'](_0x2f6a4f[_0x2e579c(0x128)],_0x567f52[_0x2e579c(0x200)]['id'],_0x57b973)),_0xce4a97=_0x567f52['existingSegment']['id'],_0x1b26b0[_0x2e579c(0x15f)]?.({'type':_0x2e579c(0x1e2),'name':_0x567f52['yamlConfig'][_0x2e579c(0x127)]}),_0x1b26b0[_0x2e579c(0x179)]?.(_0x2e579c(0x21e)+_0x567f52[_0x2e579c(0x1b8)][_0x2e579c(0x127)]+'\x27'),_0xb2ef50[_0x2e579c(0x1bb)]=0x1;}else _0xce4a97=_0x567f52['existingSegment']['id'];}}catch(_0x58b039){const _0x40f90f=isHttp400Error(_0x58b039),_0x500ac9=_0x40f90f?ErrorCode[_0x2e579c(0x143)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x2ffcbc=getErrorMessage(_0x58b039);throw new SDKError(_0x500ac9,_0x2e579c(0x180)+(_0x567f52[_0x2e579c(0x197)]?_0x2e579c(0x1ca):_0x2e579c(0x1b1))+_0x2e579c(0x146)+_0x567f52[_0x2e579c(0x124)]+_0x2e579c(0x1d5)+_0x2ffcbc,_0x58b039);}try{const _0x24bbc5=await syncActivationsForSegment(_0x30c1c8,_0x2f6a4f[_0x2e579c(0x128)],_0xce4a97,_0x567f52['yamlConfig']['name'],_0x567f52[_0x2e579c(0x162)],_0x1b26b0,_0x567f52[_0x2e579c(0x124)]);_0xb2ef50[_0x2e579c(0x20b)]=_0x24bbc5;}catch(_0xae94f0){if(_0xae94f0 instanceof SDKError)throw _0xae94f0;throw new SDKError(ErrorCode[_0x2e579c(0x167)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x567f52['yamlConfig'][_0x2e579c(0x127)]+_0x2e579c(0x189)+_0x567f52[_0x2e579c(0x124)]+_0x2e579c(0x1d5)+getErrorMessage(_0xae94f0),_0xae94f0);}return _0xb2ef50;},_0xa6300b=await batchAsync(_0x79408e,_0x3d81aa,_0x18d1ab),_0x2d9e46={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2241d2 of _0xa6300b){_0x2d9e46[_0xb0ca56(0x1c0)]+=_0x2241d2[_0xb0ca56(0x1c0)],_0x2d9e46['updated']+=_0x2241d2[_0xb0ca56(0x1bb)],_0x2241d2['createdSegmentId']&&_0x2d9e46[_0xb0ca56(0x170)][_0xb0ca56(0x15a)](_0x2241d2['createdSegmentId'][_0xb0ca56(0x127)],_0x2241d2[_0xb0ca56(0x1c3)]['id']),_0x2d9e46[_0xb0ca56(0x20b)][_0xb0ca56(0x1c0)]+=_0x2241d2['activations'][_0xb0ca56(0x1c0)],_0x2d9e46['activations'][_0xb0ca56(0x1bb)]+=_0x2241d2[_0xb0ca56(0x20b)]['updated'],_0x2d9e46[_0xb0ca56(0x20b)][_0xb0ca56(0x1db)]+=_0x2241d2[_0xb0ca56(0x20b)][_0xb0ca56(0x1db)];}return _0x2d9e46;}async function syncActivationsForSegment(_0x507909,_0x3ffc76,_0x4ae81a,_0x467c9a,_0x1ef0c9,_0x1437b5,_0x108636){const _0x3f4613=a114_0x4e41d5,_0x35c99b={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x299e92 of _0x1ef0c9){try{if(_0x299e92['type']===_0x3f4613(0x1ca)&&_0x299e92[_0x3f4613(0x1c4)])_0x1437b5[_0x3f4613(0x15f)]?.({'type':_0x3f4613(0x148),'segmentName':_0x467c9a,'activationName':_0x299e92[_0x3f4613(0x127)]}),await _0x1437b5[_0x3f4613(0x13c)](_0x3f4613(0x15e)+_0x299e92[_0x3f4613(0x127)]+_0x3f4613(0x190),()=>_0x507909['segment'][_0x3f4613(0x125)](_0x3ffc76,_0x4ae81a,_0x299e92[_0x3f4613(0x1c4)])),_0x1437b5[_0x3f4613(0x15f)]?.({'type':_0x3f4613(0x1ce),'segmentName':_0x467c9a,'activationName':_0x299e92['name']}),_0x1437b5[_0x3f4613(0x179)]?.(_0x3f4613(0x156)+_0x299e92[_0x3f4613(0x127)]+'\x27'),_0x35c99b[_0x3f4613(0x1c0)]++;else{if(_0x299e92[_0x3f4613(0x18d)]===_0x3f4613(0x1b1)&&_0x299e92[_0x3f4613(0x1c4)]&&_0x299e92[_0x3f4613(0x1a2)])_0x1437b5[_0x3f4613(0x15f)]?.({'type':_0x3f4613(0x206),'segmentName':_0x467c9a,'activationName':_0x299e92[_0x3f4613(0x127)]}),await _0x1437b5[_0x3f4613(0x13c)]('Updating\x20activation\x20\x27'+_0x299e92['name']+_0x3f4613(0x190),()=>_0x507909[_0x3f4613(0x1a9)][_0x3f4613(0x221)](_0x3ffc76,_0x4ae81a,_0x299e92[_0x3f4613(0x1a2)]['id'],_0x299e92[_0x3f4613(0x1c4)])),_0x1437b5['onProgress']?.({'type':_0x3f4613(0x1aa),'segmentName':_0x467c9a,'activationName':_0x299e92['name']}),_0x1437b5['logSuccess']?.('Updated\x20activation\x20\x27'+_0x299e92[_0x3f4613(0x127)]+'\x27'),_0x35c99b[_0x3f4613(0x1bb)]++;else _0x299e92['type']===_0x3f4613(0x1a7)&&_0x299e92[_0x3f4613(0x1a2)]&&(_0x1437b5[_0x3f4613(0x15f)]?.({'type':_0x3f4613(0x1b5),'segmentName':_0x467c9a,'activationName':_0x299e92[_0x3f4613(0x127)]}),await _0x1437b5[_0x3f4613(0x13c)](_0x3f4613(0x1ad)+_0x299e92['name']+_0x3f4613(0x190),()=>_0x507909['segment'][_0x3f4613(0x138)](_0x3ffc76,_0x4ae81a,_0x299e92['existingActivation']['id'])),_0x1437b5['onProgress']?.({'type':_0x3f4613(0x171),'segmentName':_0x467c9a,'activationName':_0x299e92[_0x3f4613(0x127)]}),_0x1437b5[_0x3f4613(0x211)]?.(_0x3f4613(0x18c)+_0x299e92[_0x3f4613(0x127)]+'\x27'),_0x35c99b['deleted']++);}}catch(_0x486465){const _0x435e02=isHttp400Error(_0x486465),_0x3ab4a7=_0x435e02?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x3f4613(0x167)],_0x6f4861=getErrorMessage(_0x486465);throw new SDKError(_0x3ab4a7,_0x3f4613(0x180)+_0x299e92[_0x3f4613(0x18d)]+_0x3f4613(0x166)+_0x299e92['name']+_0x3f4613(0x189)+_0x108636+_0x3f4613(0x1d5)+_0x6f4861,_0x486465);}}return _0x35c99b;}export async function executePushFolders(_0x4cdc92,_0x7e4418,_0x2cc0df,_0xe8931f,_0x13574d){const _0xf90c17=a114_0x4e41d5,_0x3a9b20=new Map(_0x2cc0df);for(const _0x441998 of _0x7e4418){const _0x4d95a0=_0x441998[_0xf90c17(0x1f3)]('/'),_0x685a19=_0x4d95a0[_0x4d95a0[_0xf90c17(0x1f6)]-0x1],_0x20a23b=_0x4d95a0['slice'](0x0,-0x1)['join']('/'),_0x4549f8=_0x3a9b20['get'](_0x20a23b);_0x13574d[_0xf90c17(0x15f)]?.({'type':'folder_creating','folder':_0x441998});const _0x196ce6={'name':_0x685a19,'parentFolderId':_0x4549f8},_0x53dc9a=await _0x13574d['withProgress']('Creating\x20folder\x20\x27'+_0x441998+_0xf90c17(0x190),()=>_0x4cdc92[_0xf90c17(0x1a9)][_0xf90c17(0x1b4)](_0xe8931f['parentId'],_0x196ce6));_0x3a9b20['set'](_0x441998,_0x53dc9a[_0xf90c17(0x207)]['id']),_0x13574d[_0xf90c17(0x15f)]?.({'type':_0xf90c17(0x204),'folder':_0x441998,'folderId':_0x53dc9a[_0xf90c17(0x207)]['id']}),_0x13574d[_0xf90c17(0x19d)]?.(_0xf90c17(0x1e1)+_0x441998+'\x27');}return _0x3a9b20;}export async function executePushSegmentDeletions(_0x152f04,_0x423c52,_0x49d433){const _0x4f16be=a114_0x4e41d5;if(_0x423c52['length']===0x0)return 0x0;const {batchAsync:_0x15615b}=await import(_0x4f16be(0x135)),_0x35944a=0x5,_0x3c4cd7=await _0x15615b(_0x423c52,async _0x26f5c6=>{const _0x40b304=_0x4f16be;return _0x49d433[_0x40b304(0x15f)]?.({'type':_0x40b304(0x1d2),'name':_0x26f5c6[_0x40b304(0x127)]}),await _0x152f04[_0x40b304(0x1a9)][_0x40b304(0x1ba)](_0x26f5c6['id']),_0x49d433['onProgress']?.({'type':_0x40b304(0x183),'name':_0x26f5c6[_0x40b304(0x127)]}),_0x49d433[_0x40b304(0x211)]?.(_0x40b304(0x1fd)+_0x26f5c6['name']+'\x27'),0x1;},_0x35944a);return _0x3c4cd7['reduce']((_0x12440b,_0x1c067f)=>_0x12440b+_0x1c067f,0x0);}export async function executePushJourneys(_0x3e1081,_0x389e76,_0x517860,_0x902a0,_0x308288){const _0x1d77b8=a114_0x4e41d5,{journeyDefToRequest:_0x1ff9ec}=await import(_0x1d77b8(0x1c7)),{activationDefToCreateRequest:_0x3a120e,yamlRuleToApi:_0x571db9,validateSegmentRule:_0x4cbf93}=await import(_0x1d77b8(0x209)),_0x30730e={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5bd61f=new Map(_0x517860[_0x1d77b8(0x1e8)]),_0x3a5d39=0x5;for(let _0x50e9da=0x0;_0x50e9da<_0x389e76[_0x1d77b8(0x1f6)];_0x50e9da+=_0x3a5d39){const _0x16f56c=_0x389e76['slice'](_0x50e9da,_0x50e9da+_0x3a5d39),_0x4d78f7=await Promise[_0x1d77b8(0x13e)](_0x16f56c[_0x1d77b8(0x12c)](async _0x5df99f=>{const _0x73cf86=_0x1d77b8;if(!_0x5df99f[_0x73cf86(0x197)]&&!_0x5df99f[_0x73cf86(0x1a3)])return{'action':_0x73cf86(0x14c),'name':_0x5df99f[_0x73cf86(0x1b8)][_0x73cf86(0x127)],'journeyId':_0x5df99f[_0x73cf86(0x131)]?.['id']};const _0x411e4a=_0x5df99f[_0x73cf86(0x199)]?_0x517860[_0x73cf86(0x1a5)][_0x73cf86(0x15d)](_0x5df99f[_0x73cf86(0x199)]):undefined;_0x308288['onProgress']?.({'type':_0x5df99f[_0x73cf86(0x197)]?'journey_creating':'journey_updating','name':_0x5df99f['yamlConfig']['name']});try{const _0x462fb3=await executeSingleJourneyPush(_0x3e1081,_0x5df99f,{..._0x517860,'segmentNameToId':_0x5bd61f},{'parentId':_0x902a0[_0x73cf86(0x128)],'rootFolderId':_0x902a0[_0x73cf86(0x191)],'folderId':_0x411e4a,'verbose':_0x902a0[_0x73cf86(0x134)]},_0x308288,{'journeyDefToRequest':_0x1ff9ec,'activationDefToCreateRequest':_0x3a120e,'yamlRuleToApi':_0x571db9,'validateSegmentRule':_0x4cbf93});for(const [_0x687a16,_0x214dcf]of _0x462fb3[_0x73cf86(0x20a)]){_0x5bd61f[_0x73cf86(0x15a)](_0x687a16,_0x214dcf),_0x30730e[_0x73cf86(0x20a)]['set'](_0x687a16,_0x214dcf);}if(_0x462fb3[_0x73cf86(0x208)]===_0x73cf86(0x1c0))_0x308288[_0x73cf86(0x15f)]?.({'type':_0x73cf86(0x16f),'name':_0x5df99f[_0x73cf86(0x1b8)][_0x73cf86(0x127)],'journeyId':_0x462fb3[_0x73cf86(0x20f)]}),_0x308288[_0x73cf86(0x179)]?.('Created\x20journey\x20\x27'+_0x5df99f['yamlConfig'][_0x73cf86(0x127)]+'\x27'),_0x30730e['created']++;else _0x462fb3[_0x73cf86(0x208)]===_0x73cf86(0x1bb)&&(_0x308288[_0x73cf86(0x15f)]?.({'type':'journey_updated','name':_0x5df99f[_0x73cf86(0x1b8)][_0x73cf86(0x127)]}),_0x308288[_0x73cf86(0x179)]?.(_0x73cf86(0x1e6)+_0x5df99f[_0x73cf86(0x1b8)][_0x73cf86(0x127)]+'\x27'),_0x30730e[_0x73cf86(0x1bb)]++);return{'action':_0x462fb3[_0x73cf86(0x208)],'name':_0x5df99f['yamlConfig'][_0x73cf86(0x127)],'journeyId':_0x462fb3[_0x73cf86(0x20f)]};}catch(_0x3f0b7b){const _0x37924c=isHttp400Error(_0x3f0b7b),_0xfeafdd=_0x37924c?ErrorCode[_0x73cf86(0x1e3)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x2caedb=getErrorMessage(_0x3f0b7b);throw new SDKError(_0xfeafdd,'Failed\x20to\x20'+(_0x5df99f[_0x73cf86(0x197)]?'create':_0x73cf86(0x1b1))+_0x73cf86(0x1ec)+_0x5df99f[_0x73cf86(0x124)]+_0x73cf86(0x1d5)+_0x2caedb,_0x3f0b7b);}}));_0x30730e[_0x1d77b8(0x13a)][_0x1d77b8(0x164)](..._0x4d78f7);}return _0x30730e;}async function matchExistingJourneySegments(_0x5c1c40,_0x262c0d,_0x29e25d,_0x18d6fd,_0xbbf618){const _0x1fdf4f=a114_0x4e41d5;if(!_0x262c0d[_0x1fdf4f(0x131)]||!_0x262c0d['yamlConfig'][_0x1fdf4f(0x193)])return;const _0x54007d=new Map();for(const _0x1752d0 of Object['keys'](_0x262c0d[_0x1fdf4f(0x1b8)][_0x1fdf4f(0x193)])){const _0x2af611=generateDeterministicJourneySegmentName(_0x262c0d['yamlConfig'][_0x1fdf4f(0x127)],_0x1752d0);_0x54007d[_0x1fdf4f(0x15a)](_0x2af611,_0x1752d0);}const _0x5c2b66=collectSegmentIdsFromJourneyApi(_0x262c0d[_0x1fdf4f(0x131)]);for(const _0xd6aca5 of _0x5c2b66){const _0x360474=await fetchSegment(_0x5c1c40,_0x29e25d,_0xd6aca5,_0x18d6fd);if(!_0x360474?.[_0x1fdf4f(0x127)])continue;const _0x34462d=_0x54007d[_0x1fdf4f(0x15d)](_0x360474[_0x1fdf4f(0x127)]);_0x34462d&&_0xbbf618[_0x1fdf4f(0x15a)](_0x34462d,_0xd6aca5);}}async function executeSingleJourneyPush(_0x18f625,_0x1edd47,_0x210b9d,_0x24243c,_0x151895,_0x464bcb){const _0xc04307=a114_0x4e41d5,{journeyDefToRequest:_0xe47297,activationDefToCreateRequest:_0x57e41,yamlRuleToApi:_0x3ce78b,validateSegmentRule:_0x215ccc}=_0x464bcb,_0x222ad0=new Map(),_0xd8b8ef=new Map();recoverSegmentIdsFromPushRecovery(_0x1edd47,_0x222ad0,_0x210b9d[_0xc04307(0x1e8)]);const _0x4bcf88=new Map(),_0x58494e=new Map(),_0x4ab885=new Map();let _0x96485d;const _0xa958e7=async()=>{const _0x4b8347=_0xc04307;if(_0x96485d)return;_0x96485d=new Map();if(!_0x1edd47[_0x4b8347(0x131)])return;const _0x2e50d6=await _0x18f625[_0x4b8347(0x1cb)][_0x4b8347(0x1e7)](_0x1edd47[_0x4b8347(0x131)]['id']);for(const _0x190be3 of _0x2e50d6){const _0x3a9af2=journeyActivationStepToYaml(_0x190be3,_0x210b9d[_0x4b8347(0x21d)],_0x210b9d[_0x4b8347(0x159)]),_0x20c0ea=activationSignature(_0x3a9af2);!_0x96485d['has'](_0x20c0ea)&&_0x96485d[_0x4b8347(0x15a)](_0x20c0ea,_0x190be3['id']),_0x3a9af2[_0x4b8347(0x127)]&&_0xd8b8ef[_0x4b8347(0x15a)](_0x3a9af2[_0x4b8347(0x127)],_0x190be3['id']);}};await matchExistingJourneySegments(_0x18f625,_0x1edd47,_0x24243c[_0xc04307(0x128)],_0x210b9d['existingSegments'],_0x210b9d[_0xc04307(0x1e8)]);const _0x998306={'resolveSegmentId':async _0x2b9268=>{const _0x30d37e=_0xc04307,_0x4e1678=_0x210b9d['segmentNameToId'][_0x30d37e(0x15d)](_0x2b9268);if(!_0x4e1678)throw new SDKError(ErrorCode[_0x30d37e(0x220)],_0x30d37e(0x13f)+_0x2b9268+'\x20(referenced\x20in\x20journey\x20'+_0x1edd47[_0x30d37e(0x1b8)][_0x30d37e(0x127)]+')');return _0x4e1678;},'resolveEmbeddedSegmentId':async(_0x588555,_0x16b8dd)=>{const _0x4dab42=_0xc04307,_0xc1b860=_0x210b9d['segmentNameToId'][_0x4dab42(0x15d)](_0x588555);if(_0xc1b860)return _0xc1b860;const _0x324a57=_0x210b9d[_0x4dab42(0x1c5)][_0x4dab42(0x21b)](_0x3db0b6=>_0x3db0b6[_0x4dab42(0x127)]===_0x588555);if(_0x324a57)return _0x210b9d[_0x4dab42(0x1e8)]['set'](_0x588555,_0x324a57['id']),_0x324a57['id'];if(_0x1edd47[_0x4dab42(0x197)]){const {stageName:_0x511fc7,criteriaName:_0x358a10}=findSegmentCriteriaLocation(_0x1edd47[_0x4dab42(0x1b8)],_0x588555);return _0x215ccc(_0x588555,_0x16b8dd['rule']),_0x58494e[_0x4dab42(0x15a)](_0x588555,{'definition':_0x16b8dd,'stageName':_0x511fc7,'criteriaName':_0x358a10}),createPendingSegmentId(_0x588555);}const _0x299300=_0x1edd47[_0x4dab42(0x131)]?.['id'];if(!_0x299300)throw new SDKError(ErrorCode[_0x4dab42(0x13d)],_0x4dab42(0x17e));const _0x161fdf=_0x4bcf88[_0x4dab42(0x15d)](_0x588555);if(_0x161fdf)return _0x161fdf;const _0x5f0d5d=((async()=>{const _0x4da2f8=_0x4dab42;_0x215ccc(_0x588555,_0x16b8dd[_0x4da2f8(0x136)]);const _0x179d0e=generateDeterministicJourneySegmentName(_0x1edd47['yamlConfig'][_0x4da2f8(0x127)],_0x588555),_0x7b71f4=_0x210b9d[_0x4da2f8(0x1c5)][_0x4da2f8(0x21b)](_0x17dbc8=>_0x17dbc8[_0x4da2f8(0x127)]===_0x179d0e),_0x5d12a7=createSegmentIdResolver(_0x210b9d[_0x4da2f8(0x1e8)],_0x588555),_0x20f314=await resolveRuleSegmentIds(_0x16b8dd['rule'],_0x5d12a7);let _0x422708;return _0x7b71f4?(await _0x18f625['segment'][_0x4da2f8(0x18f)](_0x24243c['parentId'],_0x7b71f4['id'],{'description':_0x16b8dd[_0x4da2f8(0x1a6)]||_0x4da2f8(0x163)+_0x588555,'rule':_0x3ce78b(_0x20f314,!![]),'countPopulation':!![]}),_0x422708=_0x7b71f4['id'],saveSegmentToPushRecovery(_0x1edd47['absolutePath'],_0x1edd47[_0x4da2f8(0x1b8)][_0x4da2f8(0x127)],_0x588555,{'segmentId':_0x422708,'uniqueServerName':_0x179d0e,'createdAt':new Date()[_0x4da2f8(0x1c6)]()})):_0x422708=await createOrRecoverEmbeddedSegment(_0x18f625,_0x1edd47,{'localName':_0x588555,'uniqueSegmentName':_0x179d0e,'description':_0x16b8dd[_0x4da2f8(0x1a6)]||'Entry\x20criteria:\x20'+_0x588555,'journeyId':_0x299300,'resolvedRule':_0x20f314,'parentId':_0x24243c[_0x4da2f8(0x128)],'folderId':_0x24243c['rootFolderId']||''},_0x3ce78b),_0x210b9d[_0x4da2f8(0x1e8)][_0x4da2f8(0x15a)](_0x588555,_0x422708),_0x222ad0[_0x4da2f8(0x15a)](_0x588555,_0x422708),_0x422708;})());_0x4bcf88['set'](_0x588555,_0x5f0d5d);try{return await _0x5f0d5d;}finally{_0x4bcf88[_0x4dab42(0x1a7)](_0x588555);}},'resolveActivationId':async _0xe0eb65=>{const _0x110508=_0xc04307,_0xb8fa02=_0xd8b8ef[_0x110508(0x15d)](_0xe0eb65);if(_0xb8fa02)return _0xb8fa02;if(_0x1edd47['existingJourney']){await _0xa958e7();const _0x64087a=_0xd8b8ef[_0x110508(0x15d)](_0xe0eb65);if(_0x64087a)return _0x64087a;}throw new SDKError(ErrorCode[_0x110508(0x153)],_0x110508(0x19c)+_0xe0eb65+'\x20(referenced\x20in\x20journey\x20'+_0x1edd47[_0x110508(0x1b8)][_0x110508(0x127)]+_0x110508(0x133)+_0x110508(0x1d6));},'resolveEmbeddedActivationId':async(_0x509659,_0x304c93)=>{const _0x29fd5f=_0xc04307,_0x4fdebb=_0xd8b8ef[_0x29fd5f(0x15d)](_0x509659);if(_0x4fdebb)return _0x4fdebb;if(_0x1edd47[_0x29fd5f(0x197)])return _0x4ab885['set'](_0x509659,_0x304c93),createPendingActivationId(_0x509659);if(_0x1edd47[_0x29fd5f(0x131)]){await _0xa958e7();const _0x3fa73d=_0xd8b8ef[_0x29fd5f(0x15d)](_0x304c93[_0x29fd5f(0x127)]);if(_0x3fa73d)return _0xd8b8ef[_0x29fd5f(0x15a)](_0x509659,_0x3fa73d),_0x3fa73d;const _0x7ad549=activationSignature(_0x304c93),_0x21afd8=_0x96485d?.[_0x29fd5f(0x15d)](_0x7ad549);if(_0x21afd8)return _0xd8b8ef[_0x29fd5f(0x15a)](_0x509659,_0x21afd8),_0x21afd8;const _0x4424f0=await _0x57e41(_0x304c93,_0x210b9d[_0x29fd5f(0x17c)]),_0x986bb3={..._0x4424f0,..._0x304c93[_0x29fd5f(0x151)]!==undefined&&{'runAfterJourneyRefresh':_0x304c93[_0x29fd5f(0x151)]}},_0x2dda7a=await _0x18f625[_0x29fd5f(0x1cb)][_0x29fd5f(0x125)](_0x1edd47[_0x29fd5f(0x131)]['id'],_0x986bb3);return _0xd8b8ef[_0x29fd5f(0x15a)](_0x509659,_0x2dda7a['id']),_0x2dda7a['id'];}throw new SDKError(ErrorCode[_0x29fd5f(0x13d)],_0x29fd5f(0x1ff));},'resolveJourneyId':async _0x978824=>{const _0x22d47e=_0xc04307;try{return await _0x18f625['journey'][_0x22d47e(0x1a1)](_0x24243c[_0x22d47e(0x128)],_0x978824);}catch(_0x355105){throw new SDKError(ErrorCode[_0x22d47e(0x153)],'Journey\x20\x27'+_0x978824+_0x22d47e(0x137)+_0x1edd47[_0x22d47e(0x1b8)][_0x22d47e(0x127)]+'\x27)',_0x355105);}},'resolveStageId':async(_0x116a95,_0x3f619e)=>{const _0x2a80ad=_0xc04307,_0x4cf7d3=await _0x18f625[_0x2a80ad(0x1cb)]['getJourney'](_0x116a95),_0x35c869=_0x4cf7d3[_0x2a80ad(0x1af)]['journeyStages'][_0x2a80ad(0x21b)](_0x41c9c8=>_0x41c9c8[_0x2a80ad(0x127)][_0x2a80ad(0x1fc)]()===_0x3f619e[_0x2a80ad(0x1fc)]());if(!_0x35c869?.['id'])throw new SDKError(ErrorCode[_0x2a80ad(0x153)],'Stage\x20\x27'+_0x3f619e+_0x2a80ad(0x154)+(_0x4cf7d3[_0x2a80ad(0x1af)][_0x2a80ad(0x1cc)]||_0x4cf7d3[_0x2a80ad(0x1af)][_0x2a80ad(0x127)])+'\x27');return _0x35c869['id'];}},_0x6c0eff=await _0xe47297(_0x1edd47['yamlConfig'],_0x24243c[_0xc04307(0x128)],_0x998306),_0x47095f=_0x24243c[_0xc04307(0x201)]||_0x24243c[_0xc04307(0x191)];_0x47095f&&(_0x6c0eff[_0xc04307(0x174)]={'parentFolder':{'data':{'id':_0x47095f,'type':'folder'}}});if(_0x1edd47[_0xc04307(0x197)]){if(_0x58494e[_0xc04307(0x15c)]>0x0||_0x4ab885[_0xc04307(0x15c)]>0x0)return await executeThreeStepJourneyCreate(_0x18f625,_0x1edd47,_0x6c0eff,{'pendingEmbeddedSegments':_0x58494e,'pendingEmbeddedActivations':_0x4ab885,'embeddedSegmentNameToId':_0x222ad0,'journeyActivationNameToId':_0xd8b8ef},{..._0x24243c,'effectiveFolderId':_0x47095f},_0x210b9d,_0x151895,_0x464bcb);else{ensureJourneyDefaults(_0x6c0eff[_0xc04307(0x1af)]);const _0x51e2ff=await _0x18f625[_0xc04307(0x1cb)][_0xc04307(0x1ca)](_0x6c0eff);return deletePushRecovery(_0x1edd47[_0xc04307(0x124)]),{'action':_0xc04307(0x1c0),'journeyId':_0x51e2ff['id'],'embeddedSegmentNameToId':_0x222ad0};}}else{if(_0x1edd47[_0xc04307(0x1a3)]&&_0x1edd47['existingJourney'])return ensureJourneyDefaults(_0x6c0eff[_0xc04307(0x1af)]),await _0x18f625[_0xc04307(0x1cb)]['update'](_0x1edd47[_0xc04307(0x131)]['id'],_0x6c0eff),deletePushRecovery(_0x1edd47['absolutePath']),{'action':'updated','journeyId':_0x1edd47[_0xc04307(0x131)]['id'],'embeddedSegmentNameToId':_0x222ad0};}return deletePushRecovery(_0x1edd47['absolutePath']),{'action':_0xc04307(0x14c),'journeyId':_0x1edd47[_0xc04307(0x131)]?.['id'],'embeddedSegmentNameToId':_0x222ad0};}function findSegmentCriteriaLocation(_0x31a566,_0x3ebe81){const _0x507e5b=a114_0x4e41d5,_0x3491de=_0x31a566[_0x507e5b(0x1ea)]||_0x31a566[_0x507e5b(0x17a)]?.[0x0]?.['stages']||[];let _0x494eec='entry',_0x1b81fd=_0x3ebe81;const _0x1bc584=_0x31a566[_0x507e5b(0x1fe)]||_0x31a566[_0x507e5b(0x17a)]?.[0x0]?.[_0x507e5b(0x1fe)];if(_0x1bc584?.[_0x507e5b(0x1a9)]===_0x3ebe81)return{'stageName':'goal','criteriaName':_0x1bc584['name']||_0x3ebe81};_0x353a1b:for(const _0x118f63 of _0x3491de){if(_0x118f63['entry_criteria']?.[_0x507e5b(0x1a9)]===_0x3ebe81){_0x494eec=_0x118f63[_0x507e5b(0x127)],_0x1b81fd=_0x118f63[_0x507e5b(0x1be)][_0x507e5b(0x127)]||_0x3ebe81;break;}if(_0x118f63[_0x507e5b(0x210)])for(const _0x37314c of _0x118f63[_0x507e5b(0x210)]){if(_0x37314c[_0x507e5b(0x18d)]===_0x507e5b(0x1d3)&&_0x37314c[_0x507e5b(0x1b0)]?.[_0x507e5b(0x176)])for(const _0x203d09 of _0x37314c[_0x507e5b(0x1b0)][_0x507e5b(0x176)]){if(_0x203d09[_0x507e5b(0x1a9)]===_0x3ebe81){_0x494eec=_0x118f63[_0x507e5b(0x127)],_0x1b81fd=_0x203d09[_0x507e5b(0x127)]||_0x3ebe81;break _0x353a1b;}}}}return{'stageName':_0x494eec,'criteriaName':_0x1b81fd};}async function executeThreeStepJourneyCreate(_0x43c968,_0x2b71cd,_0x44bacc,_0x169be4,_0x58d298,_0x3f3b65,_0xf62382,_0xe7fae6){const _0x4df0f0=a114_0x4e41d5,{activationDefToCreateRequest:_0xcf92ae,yamlRuleToApi:_0x70b98f}=_0xe7fae6,{pendingEmbeddedSegments:_0x37316e,pendingEmbeddedActivations:_0x2a7584,embeddedSegmentNameToId:_0x56faf8}=_0x169be4,_0x272583=JSON[_0x4df0f0(0x152)](JSON[_0x4df0f0(0x1e4)](_0x44bacc));ensureJourneyDefaults(_0x272583['attributes']),stripPendingIds(_0x272583);const _0x406f9a=await _0x43c968['journey'][_0x4df0f0(0x1ca)](_0x272583),_0x2f7150=_0x406f9a['id'],_0x14a0b1=new Map();for(const _0x20d8c8 of _0x406f9a[_0x4df0f0(0x1af)][_0x4df0f0(0x18b)]){_0x14a0b1['set'](_0x20d8c8[_0x4df0f0(0x127)][_0x4df0f0(0x1fc)](),_0x20d8c8['id']);}recoverSegmentIdsFromPushRecovery(_0x2b71cd,_0x56faf8,_0x3f3b65['segmentNameToId']);for(const [_0x201b45,{definition:_0x2ab100}]of _0x37316e){if(_0x56faf8['has'](_0x201b45)){_0xf62382[_0x4df0f0(0x15f)]?.({'type':_0x4df0f0(0x13b),'journeyName':_0x2b71cd[_0x4df0f0(0x1b8)][_0x4df0f0(0x127)],'segmentName':_0x201b45});continue;}const _0x23a6ce=generateDeterministicJourneySegmentName(_0x2b71cd[_0x4df0f0(0x1b8)][_0x4df0f0(0x127)],_0x201b45);_0xf62382[_0x4df0f0(0x15f)]?.({'type':_0x4df0f0(0x1f5),'journeyName':_0x2b71cd['yamlConfig'][_0x4df0f0(0x127)],'segmentName':_0x201b45});const _0x3f7363=createSegmentIdResolver(_0x3f3b65['segmentNameToId'],_0x201b45),_0x13a4d2=await resolveRuleSegmentIds(_0x2ab100[_0x4df0f0(0x136)],_0x3f7363),_0x11cfa2=await createOrRecoverEmbeddedSegment(_0x43c968,_0x2b71cd,{'localName':_0x201b45,'uniqueSegmentName':_0x23a6ce,'description':_0x2ab100['description']||_0x4df0f0(0x163)+_0x201b45,'journeyId':_0x2f7150,'resolvedRule':_0x13a4d2,'parentId':_0x58d298['parentId'],'folderId':_0x58d298[_0x4df0f0(0x1a8)]||''},_0x70b98f);_0x56faf8[_0x4df0f0(0x15a)](_0x201b45,_0x11cfa2),_0x3f3b65[_0x4df0f0(0x1e8)][_0x4df0f0(0x15a)](_0x201b45,_0x11cfa2),_0xf62382[_0x4df0f0(0x15f)]?.({'type':'embedded_segment_created','journeyName':_0x2b71cd[_0x4df0f0(0x1b8)][_0x4df0f0(0x127)],'segmentName':_0x201b45});}const _0x563ab4=new Map();for(const [_0x155086,_0x2b1bd6]of _0x2a7584){_0xf62382['onProgress']?.({'type':_0x4df0f0(0x219),'journeyName':_0x2b71cd[_0x4df0f0(0x1b8)][_0x4df0f0(0x127)],'activationName':_0x155086});const _0x4bbb6b=await _0xcf92ae(_0x2b1bd6,_0x3f3b65[_0x4df0f0(0x17c)]),_0x32f2f0={..._0x4bbb6b,..._0x2b1bd6[_0x4df0f0(0x151)]!==undefined&&{'runAfterJourneyRefresh':_0x2b1bd6[_0x4df0f0(0x151)]}},_0x4ae53a=await _0x43c968[_0x4df0f0(0x1cb)][_0x4df0f0(0x125)](_0x2f7150,_0x32f2f0);_0x563ab4[_0x4df0f0(0x15a)](_0x155086,_0x4ae53a['id']),_0x169be4[_0x4df0f0(0x1e5)][_0x4df0f0(0x15a)](_0x155086,_0x4ae53a['id']),_0xf62382['onProgress']?.({'type':_0x4df0f0(0x129),'journeyName':_0x2b71cd['yamlConfig'][_0x4df0f0(0x127)],'activationName':_0x155086});}const _0x2e3df7=JSON['parse'](JSON['stringify'](_0x44bacc));return _0x2e3df7['id']=_0x2f7150,ensureJourneyDefaults(_0x2e3df7[_0x4df0f0(0x1af)]),resolvePendingIdsInRequest(_0x2e3df7,_0x44bacc,_0x14a0b1,_0x56faf8,_0x563ab4,_0xf62382),await _0x43c968[_0x4df0f0(0x1cb)][_0x4df0f0(0x1b1)](_0x2f7150,_0x2e3df7),deletePushRecovery(_0x2b71cd[_0x4df0f0(0x124)]),{'action':_0x4df0f0(0x1c0),'journeyId':_0x2f7150,'embeddedSegmentNameToId':_0x56faf8};}export function stripWaitStepPendingIds(_0x18c36a){const _0x2a024c=a114_0x4e41d5,_0x3876a1=_0x18c36a[_0x2a024c(0x1d9)]&&isPendingSegmentId(_0x18c36a[_0x2a024c(0x1d9)]),_0x21ab5e=_0x18c36a[_0x2a024c(0x1b6)]?.[_0x2a024c(0x1a4)](_0x1684e6=>_0x1684e6['segmentId']&&isPendingSegmentId(_0x1684e6[_0x2a024c(0x187)]));(_0x3876a1||_0x21ab5e)&&(_0x18c36a[_0x2a024c(0x1d0)]='Duration',_0x18c36a[_0x2a024c(0x1f8)]=0x1,_0x18c36a[_0x2a024c(0x1a0)]='day',delete _0x18c36a[_0x2a024c(0x1d9)],delete _0x18c36a[_0x2a024c(0x165)],delete _0x18c36a[_0x2a024c(0x12a)],delete _0x18c36a[_0x2a024c(0x1b6)]);}export function resolveWaitStepPendingIds(_0x3d8e8d,_0x45c983,_0x4d7084,_0x50a18e){const _0x34633e=a114_0x4e41d5;if(_0x45c983[_0x34633e(0x1d9)]&&isPendingSegmentId(_0x45c983['conditionSegmentId'])){const _0x5e23a3=_0x4d7084(_0x45c983[_0x34633e(0x1d9)],_0x34633e(0x14f)+_0x50a18e+_0x34633e(0x139));_0x5e23a3&&(_0x3d8e8d['waitStepType']=_0x34633e(0x12e),_0x3d8e8d[_0x34633e(0x1d9)]=_0x5e23a3,delete _0x3d8e8d['waitStep'],delete _0x3d8e8d[_0x34633e(0x1a0)],_0x45c983[_0x34633e(0x165)]!==undefined&&(_0x3d8e8d['conditionTimeoutDuration']=_0x45c983[_0x34633e(0x165)]),_0x45c983[_0x34633e(0x12a)]&&(_0x3d8e8d[_0x34633e(0x12a)]=_0x45c983[_0x34633e(0x12a)]));}if(_0x45c983['conditions']){const _0x5a9cd7=_0x45c983[_0x34633e(0x1b6)][_0x34633e(0x1a4)](_0x4a2bfb=>_0x4a2bfb['segmentId']&&isPendingSegmentId(_0x4a2bfb[_0x34633e(0x187)]));if(_0x5a9cd7){const _0x53e60f=_0x45c983[_0x34633e(0x1b6)][_0x34633e(0x12c)](_0x4b4683=>{const _0x4c9a01=_0x34633e;if(_0x4b4683[_0x4c9a01(0x187)]&&isPendingSegmentId(_0x4b4683[_0x4c9a01(0x187)])){const _0x3cbf21=_0x4d7084(_0x4b4683['segmentId'],_0x4c9a01(0x14f)+_0x50a18e+_0x4c9a01(0x139));return{..._0x4b4683,'segmentId':_0x3cbf21||_0x4b4683[_0x4c9a01(0x187)]};}return{..._0x4b4683};});_0x3d8e8d[_0x34633e(0x1d0)]='Condition',_0x3d8e8d[_0x34633e(0x1b6)]=_0x53e60f,delete _0x3d8e8d[_0x34633e(0x1f8)],delete _0x3d8e8d[_0x34633e(0x1a0)],delete _0x3d8e8d[_0x34633e(0x1d9)],delete _0x3d8e8d[_0x34633e(0x165)],delete _0x3d8e8d[_0x34633e(0x12a)];}}}function stripPendingIds(_0x585152){const _0xa3c722=a114_0x4e41d5;_0x585152[_0xa3c722(0x1af)]['goal']?.[_0xa3c722(0x187)]&&isPendingSegmentId(_0x585152['attributes']['goal'][_0xa3c722(0x187)])&&delete _0x585152['attributes']['goal'];for(const _0x58d9bc of _0x585152['attributes'][_0xa3c722(0x18b)]||[]){_0x58d9bc['entryCriteria']?.[_0xa3c722(0x187)]&&isPendingSegmentId(_0x58d9bc[_0xa3c722(0x1ab)][_0xa3c722(0x187)])&&delete _0x58d9bc[_0xa3c722(0x1ab)];_0x58d9bc[_0xa3c722(0x184)]?.['segmentId']&&isPendingSegmentId(_0x58d9bc[_0xa3c722(0x184)]['segmentId'])&&delete _0x58d9bc[_0xa3c722(0x184)];_0x58d9bc[_0xa3c722(0x17d)]&&(_0x58d9bc['exitCriterias']=_0x58d9bc[_0xa3c722(0x17d)][_0xa3c722(0x19b)](_0x709786=>!_0x709786[_0xa3c722(0x187)]||!isPendingSegmentId(_0x709786['segmentId'])));if(_0x58d9bc[_0xa3c722(0x210)])for(const _0x53335a of Object[_0xa3c722(0x198)](_0x58d9bc[_0xa3c722(0x210)])){const _0x1a913b=_0x58d9bc['steps'][_0x53335a];_0x1a913b[_0xa3c722(0x18d)]===_0xa3c722(0x1dc)&&_0x1a913b['journeyActivationStepId']&&isPendingActivationId(_0x1a913b['journeyActivationStepId'])&&(_0x1a913b[_0xa3c722(0x20c)]='');if(_0x1a913b[_0xa3c722(0x18d)]==='DecisionPoint'&&_0x1a913b['branches'])for(const _0x218573 of _0x1a913b[_0xa3c722(0x176)]){_0x218573[_0xa3c722(0x187)]&&isPendingSegmentId(_0x218573[_0xa3c722(0x187)])&&(_0x218573[_0xa3c722(0x187)]='');}_0x1a913b['type']===_0xa3c722(0x20e)&&stripWaitStepPendingIds(_0x1a913b);}}}function resolvePendingIdsInRequest(_0x2ce0db,_0x241e3d,_0x59815c,_0x4b119e,_0x4190f5,_0x1c5966){const _0x3ab180=a114_0x4e41d5,_0x3fc398=(_0x498d30,_0x35f428)=>{const _0x2d8da1=a114_0x4671;if(!isPendingSegmentId(_0x498d30))return _0x498d30;const _0x218fb5=extractPendingSegmentName(_0x498d30),_0x5adb4f=_0x4b119e[_0x2d8da1(0x15d)](_0x218fb5);return!_0x5adb4f&&_0x1c5966[_0x2d8da1(0x212)]?.(_0x2d8da1(0x14e)+_0x218fb5+_0x2d8da1(0x1cd)+_0x35f428),_0x5adb4f;};if(_0x2ce0db[_0x3ab180(0x1af)]['goal']?.[_0x3ab180(0x187)]&&isPendingSegmentId(_0x2ce0db[_0x3ab180(0x1af)][_0x3ab180(0x1fe)]['segmentId'])){const _0x21970d=_0x3fc398(_0x2ce0db['attributes'][_0x3ab180(0x1fe)][_0x3ab180(0x187)],_0x3ab180(0x157));_0x21970d&&(_0x2ce0db[_0x3ab180(0x1af)][_0x3ab180(0x1fe)]['segmentId']=_0x21970d);}for(const _0x40bdbe of _0x2ce0db['attributes'][_0x3ab180(0x18b)]||[]){const _0x128567=_0x59815c[_0x3ab180(0x15d)](_0x40bdbe['name']['toLowerCase']());_0x128567&&(_0x40bdbe['id']=_0x128567);if(_0x40bdbe[_0x3ab180(0x1ab)]?.[_0x3ab180(0x187)]&&isPendingSegmentId(_0x40bdbe[_0x3ab180(0x1ab)]['segmentId'])){const _0x12a61d=_0x3fc398(_0x40bdbe[_0x3ab180(0x1ab)][_0x3ab180(0x187)],_0x3ab180(0x14f)+_0x40bdbe[_0x3ab180(0x127)]+_0x3ab180(0x194));_0x12a61d&&(_0x40bdbe['entryCriteria']['segmentId']=_0x12a61d);}if(_0x40bdbe[_0x3ab180(0x17d)])for(const _0x12730f of _0x40bdbe[_0x3ab180(0x17d)]){if(_0x12730f['segmentId']&&isPendingSegmentId(_0x12730f['segmentId'])){const _0x43f0cb=_0x3fc398(_0x12730f[_0x3ab180(0x187)],'stage\x20\x27'+_0x40bdbe[_0x3ab180(0x127)]+_0x3ab180(0x178));_0x43f0cb&&(_0x12730f['segmentId']=_0x43f0cb);}}if(_0x40bdbe['milestone']?.[_0x3ab180(0x187)]&&isPendingSegmentId(_0x40bdbe[_0x3ab180(0x184)]['segmentId'])){const _0x4123f4=_0x3fc398(_0x40bdbe['milestone'][_0x3ab180(0x187)],_0x3ab180(0x14f)+_0x40bdbe[_0x3ab180(0x127)]+_0x3ab180(0x1f1));_0x4123f4&&(_0x40bdbe['milestone']['segmentId']=_0x4123f4);}if(_0x40bdbe[_0x3ab180(0x210)]){const _0x1e95cc=_0x1d67ef=>_0x241e3d[_0x3ab180(0x1af)][_0x3ab180(0x18b)]?.[_0x3ab180(0x21b)](_0x44ca1e=>_0x44ca1e[_0x3ab180(0x127)][_0x3ab180(0x1fc)]()===_0x40bdbe[_0x3ab180(0x127)][_0x3ab180(0x1fc)]())?.['steps']?.[_0x1d67ef];for(const _0x38944b of Object[_0x3ab180(0x198)](_0x40bdbe['steps'])){const _0x3ff946=_0x40bdbe[_0x3ab180(0x210)][_0x38944b],_0x201ad6=_0x1e95cc(_0x38944b);if(_0x3ff946[_0x3ab180(0x18d)]===_0x3ab180(0x1dc)&&_0x3ff946[_0x3ab180(0x20c)]&&(isPendingActivationId(_0x3ff946[_0x3ab180(0x20c)])||_0x3ff946[_0x3ab180(0x20c)]==='')){if(_0x201ad6?.[_0x3ab180(0x20c)]&&isPendingActivationId(_0x201ad6[_0x3ab180(0x20c)])){const _0x186843=extractPendingActivationName(_0x201ad6[_0x3ab180(0x20c)]),_0x1c4751=_0x4190f5[_0x3ab180(0x15d)](_0x186843);_0x1c4751&&(_0x3ff946[_0x3ab180(0x20c)]=_0x1c4751);}}if(_0x3ff946[_0x3ab180(0x18d)]===_0x3ab180(0x18e)&&_0x3ff946['branches']&&_0x201ad6?.[_0x3ab180(0x176)])for(let _0x105a37=0x0;_0x105a37<_0x3ff946[_0x3ab180(0x176)][_0x3ab180(0x1f6)];_0x105a37++){const _0x3a5e3c=_0x3ff946['branches'][_0x105a37],_0x419831=_0x201ad6[_0x3ab180(0x176)][_0x105a37];if(_0x419831?.[_0x3ab180(0x187)]&&isPendingSegmentId(_0x419831[_0x3ab180(0x187)])){const _0x4ce5a6=_0x3fc398(_0x419831[_0x3ab180(0x187)],'stage\x20\x27'+_0x40bdbe['name']+_0x3ab180(0x185)+(_0x3a5e3c[_0x3ab180(0x127)]||_0x105a37)+'\x27');_0x4ce5a6&&(_0x3a5e3c[_0x3ab180(0x187)]=_0x4ce5a6);}}_0x3ff946[_0x3ab180(0x18d)]===_0x3ab180(0x20e)&&_0x201ad6?.[_0x3ab180(0x18d)]===_0x3ab180(0x20e)&&resolveWaitStepPendingIds(_0x3ff946,_0x201ad6,_0x3fc398,_0x40bdbe[_0x3ab180(0x127)]);}}}}
1
+ const a114_0x3e8f2e=a114_0x3785;(function(_0x88f904,_0x25ea2a){const _0x5132f8=a114_0x3785,_0x2dac09=_0x88f904();while(!![]){try{const _0x4ef868=-parseInt(_0x5132f8(0x211))/0x1+parseInt(_0x5132f8(0x241))/0x2+-parseInt(_0x5132f8(0x22d))/0x3+-parseInt(_0x5132f8(0x1c0))/0x4+-parseInt(_0x5132f8(0x258))/0x5*(-parseInt(_0x5132f8(0x1c4))/0x6)+parseInt(_0x5132f8(0x215))/0x7+-parseInt(_0x5132f8(0x1b1))/0x8*(-parseInt(_0x5132f8(0x252))/0x9);if(_0x4ef868===_0x25ea2a)break;else _0x2dac09['push'](_0x2dac09['shift']());}catch(_0x1a7fd4){_0x2dac09['push'](_0x2dac09['shift']());}}}(a114_0x980c,0x52b3b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a114_0x3e8f2e(0x266));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a114_0x3e8f2e(0x1db);export function createPendingSegmentId(_0x46b8a6){return''+PENDING_SEGMENT_PREFIX+_0x46b8a6+'__';}export function isPendingSegmentId(_0x649ff4){const _0x503a29=a114_0x3e8f2e;return _0x649ff4[_0x503a29(0x28c)](PENDING_SEGMENT_PREFIX)&&!_0x649ff4[_0x503a29(0x28c)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x124df4){const _0x390bdf=a114_0x3e8f2e;return _0x124df4[_0x390bdf(0x28b)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x40eca8){return''+PENDING_ACTIVATION_PREFIX+_0x40eca8+'__';}export function isPendingActivationId(_0x2eb840){const _0x43c6bf=a114_0x3e8f2e;return _0x2eb840[_0x43c6bf(0x28c)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x580884){return _0x580884['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x41c33a,_0x1627f5){const _0x517daa=a114_0x3e8f2e,_0xf2fa21=_0x41c33a+'::'+(_0x1627f5['trim']()||'segment'),_0x308926=createHash('sha1')[_0x517daa(0x1ed)](_0xf2fa21)['digest']('hex')[_0x517daa(0x1cb)](0x0,0xc);return _0x517daa(0x1dc)+_0x308926;}export function ensureJourneyDefaults(_0x472226){const _0xa945b8=a114_0x3e8f2e;!_0x472226[_0xa945b8(0x285)]&&(_0x472226[_0xa945b8(0x285)]=''),!_0x472226['state']&&(_0x472226[_0xa945b8(0x1e9)]=_0xa945b8(0x1d2));}export function resolveTDFolderPath(_0x29ebdb,_0x5f43d0,_0x1cf8db){if(!_0x5f43d0)return _0x29ebdb;if(_0x29ebdb===_0x1cf8db||_0x29ebdb['startsWith'](_0x1cf8db+'/'))return _0x29ebdb;return _0x29ebdb?_0x1cf8db+'/'+_0x29ebdb:_0x1cf8db;}export function addFoldersToCreate(_0x32ad85,_0x3a7aea,_0x209e8b){const _0x5298de=a114_0x3e8f2e;if(!_0x32ad85)return;if(_0x3a7aea[_0x5298de(0x27e)](_0x32ad85))return;const _0x16ccf2=_0x32ad85[_0x5298de(0x1b2)]('/');let _0x3dc8d7='';for(const _0x1695ad of _0x16ccf2){_0x3dc8d7=_0x3dc8d7?_0x3dc8d7+'/'+_0x1695ad:_0x1695ad,!_0x3a7aea[_0x5298de(0x27e)](_0x3dc8d7)&&_0x209e8b[_0x5298de(0x234)](_0x3dc8d7);}}import*as a114_0x36eefc from'yaml';import{readFileSync}from'fs';import a114_0xfecf44 from'path';import{isJourneyDef,parseYamlString as a114_0x461563,toYamlString as a114_0x823185,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(_0x2da7c3){const _0x1ded2a=a114_0x3e8f2e;if(Array['isArray'](_0x2da7c3))return'['+_0x2da7c3[_0x1ded2a(0x1fe)](_0x3e569f=>stableStringify(_0x3e569f))[_0x1ded2a(0x1bb)](',')+']';if(_0x2da7c3&&typeof _0x2da7c3===_0x1ded2a(0x209)){const _0x2a6bd1=_0x2da7c3,_0x29d7c7=Object[_0x1ded2a(0x217)](_0x2a6bd1)[_0x1ded2a(0x1d1)](),_0x3ac971=_0x29d7c7[_0x1ded2a(0x1fe)](_0x1e177b=>'\x22'+_0x1e177b+'\x22:'+stableStringify(_0x2a6bd1[_0x1e177b]));return'{'+_0x3ac971[_0x1ded2a(0x1bb)](',')+'}';}const _0x702e5f=JSON[_0x1ded2a(0x235)](_0x2da7c3);return _0x702e5f===undefined?_0x1ded2a(0x1d3):_0x702e5f;}function activationSignature(_0x22458e){const _0x2ab5ae=a114_0x3e8f2e,_0x23fd0b={'connection':_0x22458e['connection'],..._0x22458e[_0x2ab5ae(0x272)]!==undefined&&{'all_columns':_0x22458e[_0x2ab5ae(0x272)]},..._0x22458e['columns']!==undefined&&{'columns':_0x22458e['columns']},..._0x22458e[_0x2ab5ae(0x239)]!==undefined&&{'behavior':_0x22458e['behavior']},..._0x22458e[_0x2ab5ae(0x282)]!==undefined&&{'schedule':_0x22458e[_0x2ab5ae(0x282)]},..._0x22458e[_0x2ab5ae(0x1fa)]!==undefined&&{'notification':_0x22458e[_0x2ab5ae(0x1fa)]},..._0x22458e['connector_config']!==undefined&&{'connector_config':_0x22458e[_0x2ab5ae(0x255)]},..._0x22458e['activation_template_id']!==undefined&&{'activation_template_id':_0x22458e['activation_template_id']}};return stableStringify(_0x23fd0b);}async function fetchSegment(_0x204b6a,_0x2e3736,_0x37c0a6,_0x313ce6){const _0x1326f5=a114_0x3e8f2e,_0x2de42d=_0x313ce6?.[_0x1326f5(0x1f4)](_0x578d75=>_0x578d75['id']===_0x37c0a6);if(_0x2de42d)return _0x2de42d;try{return await _0x204b6a[_0x1326f5(0x1e7)][_0x1326f5(0x265)](_0x2e3736,_0x37c0a6);}catch(_0x54e322){logger['debug'](_0x1326f5(0x271)+_0x37c0a6+_0x1326f5(0x23c)+_0x54e322);try{return await _0x204b6a['segment'][_0x1326f5(0x29a)](_0x37c0a6);}catch(_0x5d20be){return logger[_0x1326f5(0x1c7)](_0x1326f5(0x244)+_0x37c0a6+':\x20'+_0x5d20be),null;}}}function recoverSegmentIdsFromPushRecovery(_0x566588,_0x8ea16e,_0x3ccdf6){const _0x3b9daf=a114_0x3e8f2e,_0x2e9cd1=readPushRecovery(_0x566588['absolutePath']);if(_0x2e9cd1?.[_0x3b9daf(0x286)]===_0x566588[_0x3b9daf(0x28f)]['name'])for(const [_0x480f0c,_0x4baedc]of Object[_0x3b9daf(0x259)](_0x2e9cd1['segments'])){const _0x1d0f07=generateDeterministicJourneySegmentName(_0x566588['yamlConfig'][_0x3b9daf(0x1f6)],_0x480f0c);_0x4baedc[_0x3b9daf(0x218)]===_0x1d0f07&&(_0x8ea16e[_0x3b9daf(0x22a)](_0x480f0c,_0x4baedc[_0x3b9daf(0x294)]),_0x3ccdf6[_0x3b9daf(0x22a)](_0x480f0c,_0x4baedc['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x4adae0,_0x40ddbe,_0x108b0a,_0x9bef1d){const _0x48603f=a114_0x3e8f2e;let _0x54eebe;try{_0x54eebe=await _0x4adae0[_0x48603f(0x1e7)][_0x48603f(0x232)]({'name':_0x108b0a[_0x48603f(0x251)],'description':_0x108b0a[_0x48603f(0x285)],'journeyId':_0x108b0a[_0x48603f(0x205)],'rule':_0x9bef1d(_0x108b0a[_0x48603f(0x219)],!![]),'countPopulation':!![],'parentFolderId':_0x108b0a[_0x48603f(0x27d)],'audienceId':_0x108b0a[_0x48603f(0x297)]});}catch(_0x2be293){const _0x49f43a=_0x2be293 instanceof Error&&_0x2be293[_0x48603f(0x1f3)][_0x48603f(0x28e)](_0x48603f(0x28d));if(_0x49f43a){const _0x8a6597=readPushRecovery(_0x40ddbe['absolutePath']),_0x483bb2=_0x8a6597?.[_0x48603f(0x286)]===_0x40ddbe[_0x48603f(0x28f)]['name']?_0x8a6597[_0x48603f(0x210)][_0x108b0a['localName']]:undefined;if(_0x483bb2?.[_0x48603f(0x218)]===_0x108b0a['uniqueSegmentName'])await _0x4adae0[_0x48603f(0x1e7)][_0x48603f(0x227)](_0x108b0a[_0x48603f(0x297)],_0x483bb2[_0x48603f(0x294)],{'description':_0x108b0a[_0x48603f(0x285)],'rule':_0x9bef1d(_0x108b0a[_0x48603f(0x219)],!![]),'countPopulation':!![]}),_0x54eebe=_0x483bb2['segmentId'];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x48603f(0x1ea)+_0x108b0a[_0x48603f(0x220)]+_0x48603f(0x246)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x40ddbe['absolutePath'][_0x48603f(0x28b)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x48603f(0x283),_0x2be293);}else throw _0x2be293;}return saveSegmentToPushRecovery(_0x40ddbe[_0x48603f(0x2a0)],_0x40ddbe[_0x48603f(0x28f)][_0x48603f(0x1f6)],_0x108b0a[_0x48603f(0x220)],{'segmentId':_0x54eebe,'uniqueServerName':_0x108b0a['uniqueSegmentName'],'createdAt':new Date()[_0x48603f(0x237)]()}),_0x54eebe;}export async function prepareSegmentFiles(_0x241a33,_0x30699c,_0x4b76a9,_0x25620c,_0x5b9a2e){const _0x5de560=a114_0x3e8f2e,{activationDefToCreateRequest:_0x476492}=await import(_0x5de560(0x1b0)),_0xce7fbb=[],_0x1cb20b=new Set();for(const {yamlConfig:_0x484b8c,folderPath:_0x3ec9f2,sourcePath:_0x3b4c06}of _0x241a33){const _0x2c7488=resolveTDFolderPath(_0x3ec9f2,_0x25620c,_0x5b9a2e),_0x5c71eb=_0x2c7488+':'+_0x484b8c[_0x5de560(0x1f6)],_0x566b36=_0x30699c[_0x5de560(0x1ce)][_0x5de560(0x1f1)](_0x5c71eb),_0x349a22=_0x566b36?_0x30699c['activationsBySegmentId'][_0x5de560(0x1f1)](_0x566b36['id'])||[]:[];addFoldersToCreate(_0x2c7488,_0x30699c[_0x5de560(0x1c1)],_0x1cb20b);const _0x613332=calculateActivationActions(_0x484b8c[_0x5de560(0x1df)]||[],_0x349a22,_0x30699c[_0x5de560(0x268)],_0x30699c[_0x5de560(0x295)]);for(const _0x309127 of _0x613332){(_0x309127[_0x5de560(0x202)]===_0x5de560(0x1c2)||_0x309127[_0x5de560(0x202)]===_0x5de560(0x1ed))&&_0x309127[_0x5de560(0x26e)]&&(_0x309127[_0x5de560(0x1b5)]=await _0x476492(_0x309127[_0x5de560(0x26e)],_0x4b76a9));}const _0x28d27e=calculateSegmentDiff(_0x484b8c,_0x566b36,_0x349a22,_0x30699c[_0x5de560(0x268)],_0x30699c[_0x5de560(0x295)]);_0xce7fbb[_0x5de560(0x1c8)]({'relativePath':_0x484b8c[_0x5de560(0x1f6)],'absolutePath':_0x3b4c06,'yamlConfig':_0x484b8c,'folderPath':_0x2c7488,'existingSegment':_0x566b36,'existingActivations':_0x349a22,'isNew':_0x28d27e[_0x5de560(0x1e5)],'hasChanges':_0x28d27e[_0x5de560(0x1e8)],'diff':_0x28d27e[_0x5de560(0x280)],'activationActions':_0x613332});}return{'segmentFiles':_0xce7fbb,'foldersToCreate':_0x1cb20b};}export async function prepareJourneyFiles(_0x262f6d,_0x1af38b,_0xbf6b80,_0x4ead4e){const _0x47be40=a114_0x3e8f2e,_0x339d50=[],_0x2603a3=new Set();for(const {yamlConfig:_0x5767d0,folderPath:_0x1ee65b,sourcePath:_0x326db2}of _0x262f6d){const _0xfd2d93=resolveTDFolderPath(_0x1ee65b,_0xbf6b80,_0x4ead4e),_0x5b12c9=_0xfd2d93+':'+_0x5767d0['name'],_0x5a3eb4=_0x1af38b[_0x47be40(0x260)][_0x47be40(0x1f1)](_0x5b12c9);let _0x3483af,_0x566264;if(_0x5a3eb4&&_0x5a3eb4[_0x47be40(0x1b7)]>0x0){const _0x2fd6ab=buildLocalExpandedRuleMappings(_0x5767d0),{createYamlContext:_0x253528,prefetchJourneySegments:_0xae143d}=createPushYamlContextForBundle(_0x1af38b[_0x47be40(0x216)],_0x1af38b['parentId'],_0x1af38b[_0x47be40(0x284)],_0x2fd6ab,_0x1af38b[_0x47be40(0x268)],_0x1af38b[_0x47be40(0x295)],_0x1af38b[_0x47be40(0x1ba)],_0x1af38b[_0x47be40(0x21f)]);await _0xae143d(_0x5a3eb4[_0x47be40(0x1fe)](_0x3f3a91=>_0x3f3a91['id']));const _0x1ae017=hasMultipleVersions(_0x5767d0),_0x6b528a=async _0x2ab6c6=>{const _0x493179=_0x47be40,_0x283133=_0x1af38b[_0x493179(0x21f)]?.[_0x493179(0x1f1)](_0x2ab6c6);if(_0x283133)return _0x283133;return _0x1af38b[_0x493179(0x1ee)]({'journeyId':_0x2ab6c6,'journeyName':_0x5767d0['name'],'isMultiVersion':_0x5a3eb4['length']>0x1});};if(_0x1ae017&&_0x5a3eb4['length']>0x1){const _0x106230=[];for(const _0x1c3850 of _0x5a3eb4){const _0xa3daa6=_0x1c3850['versionNumber']||0x1;_0x1af38b[_0x47be40(0x214)]?.[_0x47be40(0x1ed)](_0x47be40(0x1b9)+_0x5767d0[_0x47be40(0x1f6)]+'\x20v'+_0xa3daa6);const _0x5c5e79=await _0x6b528a(_0x1c3850['id']),_0x46d7f5=_0x253528(_0x1c3850['id']),_0x337887=await journeyResponseToDef(_0x5c5e79,_0x46d7f5);_0x106230[_0x47be40(0x1c8)]({'item':_0x1c3850,'yaml':_0x337887});}const _0x3bfe07=buildLocalRuleToNameMappingFromJourney(_0x5767d0);_0x566264=buildMergedJourneyDef(_0x106230,_0x3bfe07);const _0x2d2006=Math[_0x47be40(0x212)](..._0x106230[_0x47be40(0x1fe)](_0x549910=>_0x549910[_0x47be40(0x224)][_0x47be40(0x25e)]||0x0)),_0xa25a2a=_0x5a3eb4['find'](_0x2709a5=>(_0x2709a5[_0x47be40(0x25e)]||0x0)===_0x2d2006);_0xa25a2a&&(_0x1af38b['progress']?.[_0x47be40(0x1ed)](_0x47be40(0x1b9)+_0x5767d0[_0x47be40(0x1f6)]+'\x20v'+_0x2d2006),_0x3483af=await _0x6b528a(_0xa25a2a['id']));}else{const _0x971f97=_0x5a3eb4[_0x5a3eb4[_0x47be40(0x1b7)]-0x1];_0x1af38b[_0x47be40(0x214)]?.[_0x47be40(0x1ed)](_0x47be40(0x1b9)+_0x5767d0[_0x47be40(0x1f6)]),_0x3483af=await _0x6b528a(_0x971f97['id']);const _0x3f3c48=_0x253528(_0x971f97['id']),_0x4240ca=await journeyResponseToDef(_0x3483af,_0x3f3c48),_0x570cd2=buildLocalRuleToNameMappingFromJourney(_0x5767d0);_0x566264=buildMergedJourneyDef([{'item':_0x971f97,'yaml':_0x4240ca}],_0x570cd2);}}addFoldersToCreate(_0xfd2d93,_0x1af38b[_0x47be40(0x1c1)],_0x2603a3);const _0x4ac323=calculateJourneyDiff(_0x5767d0,_0x566264);_0x339d50['push']({'relativePath':_0x5767d0[_0x47be40(0x1f6)],'absolutePath':_0x326db2,'yamlConfig':_0x5767d0,'folderPath':_0xfd2d93,'existingJourney':_0x3483af,'isNew':_0x4ac323['isNew'],'hasChanges':_0x4ac323[_0x47be40(0x1e8)],'diff':_0x4ac323[_0x47be40(0x280)]});}return{'journeyFiles':_0x339d50,'foldersToCreate':_0x2603a3};}export function calculateActivationActions(_0x22b288,_0x2056ce,_0xbf8913,_0x4e984b){const _0x2fa79e=a114_0x3e8f2e,_0x264b5e=[],_0x10c542=new Map();for(const _0x3238d1 of _0x2056ce){_0x10c542[_0x2fa79e(0x22a)](_0x3238d1['name'],_0x3238d1);}const _0x384eaa=new Map();for(const _0x278992 of _0x22b288){_0x384eaa[_0x2fa79e(0x22a)](_0x278992[_0x2fa79e(0x1f6)],_0x278992);}for(const _0x1c7a4a of _0x22b288){const _0x514374=_0x10c542[_0x2fa79e(0x1f1)](_0x1c7a4a[_0x2fa79e(0x1f6)]);if(!_0x514374)_0x264b5e[_0x2fa79e(0x1c8)]({'type':_0x2fa79e(0x1c2),'name':_0x1c7a4a[_0x2fa79e(0x1f6)],'yamlActivation':_0x1c7a4a});else{const _0xd970bd=activationResponseToDef(_0x514374,_0xbf8913,_0x4e984b),_0x4b30bd=a114_0x36eefc[_0x2fa79e(0x235)](_0xd970bd),_0x400cf=a114_0x36eefc[_0x2fa79e(0x235)](_0x1c7a4a);_0x4b30bd!==_0x400cf&&_0x264b5e['push']({'type':_0x2fa79e(0x1ed),'name':_0x1c7a4a[_0x2fa79e(0x1f6)],'yamlActivation':_0x1c7a4a,'existingActivation':_0x514374});}}for(const _0x14a6f1 of _0x2056ce){!_0x384eaa[_0x2fa79e(0x27e)](_0x14a6f1[_0x2fa79e(0x1f6)])&&_0x264b5e[_0x2fa79e(0x1c8)]({'type':_0x2fa79e(0x277),'name':_0x14a6f1[_0x2fa79e(0x1f6)],'existingActivation':_0x14a6f1});}return _0x264b5e;}function calculateYamlDiff(_0x2b14a7,_0x46c7ab){if(_0x46c7ab){const _0x53b8d0=generateDiff(_0x46c7ab,_0x2b14a7),_0x24db97=hasChanges(_0x53b8d0);return{'isNew':![],'hasChanges':_0x24db97,'diff':_0x24db97?formatDiffWithColors(_0x53b8d0):undefined};}const _0x56955f=generateDiff('',_0x2b14a7);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x56955f)};}export function calculateSegmentDiff(_0x31464d,_0x486455,_0x501b94,_0xd1eac,_0x565270){const _0x28a23c=segmentToYamlString(_0x31464d),_0x1310bf=_0x486455?segmentToYamlString(segmentWithActivationsToYaml(_0x486455,_0x501b94,undefined,_0xd1eac,_0x565270)):undefined;return calculateYamlDiff(_0x28a23c,_0x1310bf);}export function calculateJourneyDiff(_0x21d8e9,_0x17fdf0){const _0x501dd5=normalizeJourneyDef(_0x21d8e9,_0x21d8e9),_0x364275=a114_0x823185(_0x501dd5),_0x40da7d=_0x17fdf0?a114_0x823185(normalizeJourneyDef(_0x17fdf0,_0x21d8e9)):undefined;return calculateYamlDiff(_0x364275,_0x40da7d);}export function findSegmentsToDelete(_0x1a4e8a,_0x532dd0,_0x4fe3cc,_0x71deae,_0xfce898){const _0x31607c=a114_0x3e8f2e,_0x207c97=new Set();for(const {yamlConfig:_0x27152b,folderPath:_0x25c315}of _0x532dd0){_0x207c97['add'](_0x25c315+':'+_0x27152b[_0x31607c(0x1f6)]);}return _0x1a4e8a['filter'](_0x4e2012=>{const _0x106cb0=_0x31607c,_0x73a269=_0x4e2012[_0x106cb0(0x21e)]?_0x4fe3cc['get'](_0x4e2012[_0x106cb0(0x21e)][_0x106cb0(0x1bf)]())||'':'',_0x351b3a=_0x73a269+':'+_0x4e2012['name'];if(_0x207c97[_0x106cb0(0x27e)](_0x351b3a))return![];if(_0xfce898)return _0x73a269===_0x71deae||_0x73a269['startsWith'](_0x71deae+'/');return!![];});}export function findJourneysToDelete(_0x53a36e,_0x12decb,_0x2b161f,_0x4f6be9,_0x1e6232){const _0x5a9ba5=a114_0x3e8f2e,_0x10507b=new Set();for(const {yamlConfig:_0x5d62b1,folderPath:_0x2cdc9e}of _0x12decb){_0x10507b[_0x5a9ba5(0x234)](_0x2cdc9e+':'+_0x5d62b1[_0x5a9ba5(0x1f6)]);}return _0x53a36e[_0x5a9ba5(0x29e)](_0x555a0c=>{const _0x1546d0=_0x5a9ba5,_0x3c4244=_0x555a0c[_0x1546d0(0x27d)]?_0x2b161f['get'](_0x555a0c[_0x1546d0(0x27d)])||'':'',_0x33e5f5=_0x3c4244+':'+_0x555a0c[_0x1546d0(0x25b)];if(_0x10507b['has'](_0x33e5f5))return![];if(_0x1e6232)return _0x3c4244===_0x4f6be9||_0x3c4244[_0x1546d0(0x28c)](_0x4f6be9+'/');return!![];});}export function buildSegmentLookupMap(_0x4d38fd,_0x1e5159){const _0x16ab27=a114_0x3e8f2e,_0x3285d9=new Map();for(const _0x2e7150 of _0x4d38fd){const _0x1dc0ab=_0x2e7150[_0x16ab27(0x21e)]?_0x1e5159['get'](_0x2e7150[_0x16ab27(0x21e)][_0x16ab27(0x1bf)]())||'':'',_0x544ad0=_0x1dc0ab+':'+_0x2e7150[_0x16ab27(0x1f6)];_0x3285d9['set'](_0x544ad0,_0x2e7150);}return _0x3285d9;}export function buildSegmentNameToIdMap(_0x2f1951){const _0x256a61=a114_0x3e8f2e,_0x7e70f8=new Map();for(const _0x15704c of _0x2f1951){_0x7e70f8[_0x256a61(0x22a)](_0x15704c['name'],_0x15704c['id']);}return _0x7e70f8;}export function buildJourneyBundleLookupMap(_0x4f1eb9,_0xd06fc6){const _0x29d43b=a114_0x3e8f2e,_0x440e59=new Map();for(const _0x475827 of _0x4f1eb9){const _0x684217=_0x475827[_0x29d43b(0x27d)]?_0xd06fc6[_0x29d43b(0x1f1)](_0x475827['folderId'])||'':'',_0x4f30f3=_0x684217+':'+_0x475827[_0x29d43b(0x25b)];!_0x440e59[_0x29d43b(0x27e)](_0x4f30f3)&&_0x440e59['set'](_0x4f30f3,[]),_0x440e59[_0x29d43b(0x1f1)](_0x4f30f3)[_0x29d43b(0x1c8)](_0x475827);}for(const _0xca1416 of _0x440e59[_0x29d43b(0x201)]()){_0xca1416[_0x29d43b(0x1d1)]((_0x3d3351,_0x46c174)=>(_0x3d3351['versionNumber']||0x0)-(_0x46c174[_0x29d43b(0x25e)]||0x0));}return _0x440e59;}export function collectFoldersToCreate(_0x208546,_0x10d53b){const _0x2366da=a114_0x3e8f2e,_0x4c0d83=new Set();for(const _0x35fc85 of _0x208546){if(!_0x35fc85)continue;if(_0x10d53b[_0x2366da(0x27e)](_0x35fc85))continue;const _0x5d3dc9=_0x35fc85[_0x2366da(0x1b2)]('/');let _0x53f94a='';for(const _0x514215 of _0x5d3dc9){_0x53f94a=_0x53f94a?_0x53f94a+'/'+_0x514215:_0x514215,!_0x10d53b['has'](_0x53f94a)&&_0x4c0d83[_0x2366da(0x234)](_0x53f94a);}}return _0x4c0d83;}export function parseAndClassifyYamlFiles(_0x1c7085,_0x583c8b,_0x23dd1d){const _0x3bf659=a114_0x3e8f2e,_0x11d0e8=[],_0x1a5152=[];for(const _0x494376 of _0x1c7085){const _0x23fda6=a114_0xfecf44[_0x3bf659(0x287)](_0x583c8b,a114_0xfecf44[_0x3bf659(0x230)](_0x494376)),_0x2e1821=_0x23fda6==='.'?'':_0x23fda6,_0x2a255b=readFileSync(_0x494376,_0x3bf659(0x200)),_0x2a9dfc=a114_0x36eefc[_0x3bf659(0x226)](_0x2a255b);if(isJourneyDef(_0x2a9dfc)){const _0x1dc484=a114_0x461563(_0x2a255b);_0x1a5152[_0x3bf659(0x1c8)]({'yamlConfig':_0x1dc484,'folderPath':_0x2e1821,'sourcePath':_0x494376});}else{if(!_0x23dd1d?.['skipSegments']){const _0x3b1ebb=parseSegmentYamlFile(_0x2a255b),_0x47c075=normalizeChildSegmentYaml(_0x3b1ebb);_0x11d0e8[_0x3bf659(0x1c8)]({'yamlConfig':_0x47c075,'folderPath':_0x2e1821,'sourcePath':_0x494376});}}}return{'segments':_0x11d0e8,'journeys':_0x1a5152};}export function validateParsedFiles(_0x5c2662,_0x31713f){const _0x5c230d=a114_0x3e8f2e,_0xc1401d=[];for(const {yamlConfig:_0xc80025,sourcePath:_0x5401c1}of _0x5c2662[_0x5c230d(0x210)]){const _0x346c0f=readFileSync(_0x5401c1,'utf-8'),_0x500f2e=a114_0x36eefc[_0x5c230d(0x1cc)](_0x346c0f),_0x40a21a=validateSegmentDef(_0xc80025,{'source':_0x346c0f,'document':_0x500f2e});if(!_0x40a21a[_0x5c230d(0x298)]){const _0x58d85e=a114_0xfecf44[_0x5c230d(0x287)](_0x31713f,_0x5401c1);_0xc1401d[_0x5c230d(0x1c8)]({'filePath':_0x58d85e,'source':_0x346c0f,'result':_0x40a21a,'isJourney':![]});}}for(const {yamlConfig:_0x3a76db,sourcePath:_0x303a6a}of _0x5c2662[_0x5c230d(0x1ec)]){const _0x2f0679=readFileSync(_0x303a6a,_0x5c230d(0x200)),_0x22675e=a114_0x36eefc[_0x5c230d(0x1cc)](_0x2f0679),_0x5866c5=validateJourneyDef(_0x3a76db,{'source':_0x2f0679,'document':_0x22675e});if(!_0x5866c5[_0x5c230d(0x298)]){const _0x15114c=a114_0xfecf44[_0x5c230d(0x287)](_0x31713f,_0x303a6a);_0xc1401d[_0x5c230d(0x1c8)]({'filePath':_0x15114c,'source':_0x2f0679,'result':_0x5866c5,'isJourney':!![]});}}return _0xc1401d;}export function formatValidationErrors(_0x58aab1){const _0x553d60=a114_0x3e8f2e,_0x2d3176=[];for(const {filePath:_0x2ddd37,source:_0x179cf0,result:_0x31f936,isJourney:_0x1229aa}of _0x58aab1){const _0x15cb4a=_0x1229aa?'journey':_0x553d60(0x1e7);_0x2d3176['push']('\x0a'+_0x2ddd37+'\x20('+_0x15cb4a+_0x553d60(0x1a8)+_0x31f936[_0x553d60(0x273)][_0x553d60(0x1b7)]+_0x553d60(0x1a7)),_0x2d3176[_0x553d60(0x1c8)](formatValidationResult(_0x31f936,_0x179cf0,_0x2ddd37));}return _0x2d3176[_0x553d60(0x1bb)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x102da5){const _0x35f09b=a114_0x3e8f2e,_0x526cf6=new Set(),_0x952e0=new Map(),_0x2a8417=collectSegmentUsageCounts(_0x102da5);if(_0x102da5['segments'])for(const [_0x51f678,_0x3cc5ba]of Object[_0x35f09b(0x259)](_0x102da5['segments'])){_0x526cf6[_0x35f09b(0x234)](_0x51f678);if(_0x3cc5ba[_0x35f09b(0x1a4)]){const _0x479776=yamlRuleToApi(_0x3cc5ba[_0x35f09b(0x1a4)]),_0x464286=apiRuleToYaml(_0x479776);_0x952e0['set'](_0x51f678,_0x464286);}}const _0x27f7a0=new Map();let _0x4b8a3c=0x0;for(const [_0x28ee4c,_0x454e70]of _0x952e0){const _0x59fe4a=serializeExpandedRule(_0x454e70,_0x952e0),_0x152927=_0x27f7a0[_0x35f09b(0x1f1)](_0x59fe4a)||[];_0x152927[_0x35f09b(0x1c8)]({'name':_0x28ee4c,'index':_0x4b8a3c}),_0x27f7a0[_0x35f09b(0x22a)](_0x59fe4a,_0x152927),_0x4b8a3c++;}const _0x3fdc9a=new Map();for(const [_0x267958,_0x23132f]of _0x27f7a0){const _0x4a401f=_0x23132f[_0x35f09b(0x1cb)]()[_0x35f09b(0x1d1)]((_0x1c78cb,_0x4f7d2c)=>{const _0x3f2023=_0x35f09b,_0xa07e58=_0x2a8417[_0x3f2023(0x1f1)](_0x1c78cb['name'])||0x0,_0x42a489=_0x2a8417['get'](_0x4f7d2c['name'])||0x0;if(_0xa07e58!==_0x42a489)return _0x42a489-_0xa07e58;return _0x1c78cb['index']-_0x4f7d2c['index'];})[_0x35f09b(0x1fe)](_0x518e30=>_0x518e30['name']),_0x1e9f57=[];for(const _0x19759a of _0x4a401f){const _0x1a8299=_0x2a8417[_0x35f09b(0x1f1)](_0x19759a)||0x0,_0x76e7d3=Math[_0x35f09b(0x212)](_0x1a8299,0x1);for(let _0x41374e=0x0;_0x41374e<_0x76e7d3;_0x41374e++){_0x1e9f57['push'](_0x19759a);}}_0x3fdc9a[_0x35f09b(0x22a)](_0x267958,_0x1e9f57);}return{'existingLocalSegmentNames':_0x526cf6,'localSegmentRules':_0x952e0,'localExpandedRuleToNames':_0x3fdc9a};}export function createSegmentIdResolver(_0xb1a7fa,_0x4d3f38){return async _0x27328f=>{const _0x4f61a5=a114_0x3785,_0x37ee1c=_0xb1a7fa[_0x4f61a5(0x1f1)](_0x27328f);if(!_0x37ee1c)throw new SDKError(ErrorCode[_0x4f61a5(0x1da)],_0x4f61a5(0x206)+_0x27328f+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x4d3f38+'\x27)');return _0x37ee1c;};}export function extractRootFolderId(_0x539f52){const _0x55f334=a114_0x3e8f2e;return _0x539f52['relationships']?.[_0x55f334(0x1d6)]?.[_0x55f334(0x257)]?.['id']||_0x539f52[_0x55f334(0x1f5)]?.[_0x55f334(0x1f7)]?.[_0x55f334(0x257)]?.['id'];}function a114_0x980c(){const _0x391c7d=['connectionIdToNameMap','createdSegmentIds','parentId','valid','createFolder','getSegmentEntity','Segment\x20not\x20found','SEGMENT_UPDATE_ERROR','folder_created','filter','logDeleted','absolutePath','waitStepUnit','flatMap','rule','logSuccess','embedded_segment_created','\x20error(s)','):\x20','steps','user','withProgress','journey','Created\x20activation\x20\x27','journey_created','journeyActivationNameToId','./child-segment-yaml.js','16ZPxjRg','split','onProgress','embedded_segment_creating','validatedRequest','Entry\x20criteria:\x20','length','list','Fetching\x20','activationStepsById','join','waitStep','goal','entry_criteria','toString','604256wKkEtE','folderPathToId','create','\x27\x20wait\x20condition','6QpuyYq','\x27\x20not\x20found\x20in\x20journey\x20\x27','conditionTimeoutUnit','debug','push','Updating\x20segment\x20\x27','Created\x20folder\x20\x27','slice','parseDocument','Failed\x20to\x20resolve\x20activation\x20','segmentByFolderAndName','connection','Condition','sort','draft','null','ACTIVATION_UPDATE_ERROR','Creating\x20segment\x20\x27','parentSegmentFolder','folder','Deleted\x20segment\x20\x27','\x27...','SEGMENT_NOT_FOUND','__pending_act_','journey_entry_criteria_','JOURNEY_SYNTAX_ERROR','../../utils/async.js','activations','existingActivation',').\x20','buildUserMaps','activation_creating','createdSegmentId','isNew','Deleting\x20activation\x20\x27','segment','hasChanges','state','Embedded\x20segment\x20\x27','conditionTimeoutDuration','journeys','update','fetchJourney','activation_created','JOURNEY_UPDATE_ERROR','get','branches','message','find','relationships','name','parentFolder','Created\x20segment\x20\x27','existingJourney','notification','stage\x20\x27','activationActions','resolveSegment','map','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','utf-8','values','type','exitCriterias','conditions','journeyId','Segment\x20not\x20found:\x20','activation_','run_after_journey_refresh','object','Creating\x20folder\x20\x27','segment_deleting','NOT_FOUND','segmentNameToId','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','milestone','segments','219774fgBjhe','max','\x27\x20from\x20file:\x20','progress','3939040GnZjTL','deps','keys','uniqueServerName','resolvedRule','deleted','logWarning','./journey-yaml.js','createActivation','segmentFolderId','journeyById','localName','getActivation','size','Activation','item','action','parse','updateSegmentById','entryCriteria','rootFolderId','set','logInfo','journeyStages','1649460OLvrJz','attributes','listActivations','dirname','conditionSegmentId','createJourneySegment','journeyActivationStepId','add','stringify','segment_deleted','toISOString','journey_creating','behavior','journey_updated','segment_updated',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','segment_created','segment_updating','WaitStep','resolveJourneyId','497932GpOUBp','from','\x20(referenced\x20in\x20journey\x20','getSegmentEntity\x20also\x20failed\x20for\x20','decision_point','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','embedded_activation_created','activation_updating','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','created','Failed\x20to\x20fetch\x20referenced\x20segment\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','\x20segment\x20from\x20file:\x20','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','createSegment','\x27\x20milestone','uniqueSegmentName','1618317pZzSKI','\x27\x20exit\x20criteria','nameToType','connector_config','folder_creating','data','440465bUFzIC','entries','Duration','journeyBundleName','some','Updated\x20segment\x20\x27','versionNumber','segment_creating','journeyBundlesByFolderAndName','unchanged','INTERNAL','\x20journey\x20from\x20file:\x20','Failed\x20to\x20','getSegment','tdx.sdk.push-workflow','results','idToEmailMap','updated','Journey\x20\x27','DecisionPoint','deleteActivation','embeddedSegmentNameToId','yamlActivation','embedded_activation_creating','existingSegment','getSegment\x20failed\x20for\x20','all_columns','errors','updateActivation','Updated\x20activation\x20\x27','getJourney','delete','\x0a\x20\x20','activationContext','deleteSegment','goal\x20criteria','toLowerCase','folderId','has','waitStepType','diff','Created\x20journey\x20\x27','schedule','and\x20the\x20server\x20segment,\x20then\x20retry.','existingSegments','description','journeyName','relative','activationParams','all','Updated\x20journey\x20\x27','replace','startsWith','Name\x20has\x20already\x20been\x20taken','includes','yamlConfig','Updating\x20activation\x20\x27','with','folderPath','entry','segmentId'];a114_0x980c=function(){return _0x391c7d;};return a114_0x980c();}function a114_0x3785(_0x39d026,_0x227904){_0x39d026=_0x39d026-0x1a3;const _0x980c4a=a114_0x980c();let _0x3785ef=_0x980c4a[_0x39d026];return _0x3785ef;}export function buildConnectionMaps(_0x2b43a5){const _0x174ac6=a114_0x3e8f2e,_0x39c22e=new Map(),_0x55ac0b=new Map(),_0x498d9b=new Map();for(const _0x649eb7 of _0x2b43a5){_0x39c22e[_0x174ac6(0x22a)](_0x649eb7[_0x174ac6(0x1f6)],parseInt(_0x649eb7['id'],0xa)),_0x55ac0b[_0x174ac6(0x22a)](_0x649eb7['id'],_0x649eb7[_0x174ac6(0x1f6)]),_0x498d9b[_0x174ac6(0x22a)](_0x649eb7[_0x174ac6(0x1f6)],_0x649eb7['type']);}return{'nameToId':_0x39c22e,'idToName':_0x55ac0b,'nameToType':_0x498d9b};}export function calculatePushStats(_0xde2083,_0x4d54ef,_0x4a665b,_0x5a26b3,_0xc0a563,_0x3e3106,_0x1e6e94){const _0x3efec7=a114_0x3e8f2e,_0x6efff0=_0xde2083[_0x3efec7(0x29e)](_0x422c0b=>_0x422c0b['isNew']),_0x37ea06=_0xde2083['filter'](_0x45c4f5=>!_0x45c4f5[_0x3efec7(0x1e5)]&&_0x45c4f5[_0x3efec7(0x1e8)]),_0x541f51=_0xde2083[_0x3efec7(0x29e)](_0x53fce7=>!_0x53fce7['isNew']&&!_0x53fce7[_0x3efec7(0x1e8)]),_0x1cf4fd=_0x3e3106?_0x5a26b3:[],_0x1f34e9=_0x4d54ef[_0x3efec7(0x29e)](_0x40f3ce=>_0x40f3ce[_0x3efec7(0x1e5)]),_0x14d3d0=_0x4d54ef['filter'](_0x2096e5=>!_0x2096e5[_0x3efec7(0x1e5)]&&_0x2096e5['hasChanges']),_0x57ef5b=_0x4d54ef[_0x3efec7(0x29e)](_0x3f3174=>!_0x3f3174[_0x3efec7(0x1e5)]&&!_0x3f3174[_0x3efec7(0x1e8)]),_0x429850=_0x3e3106?_0xc0a563:[],_0x2a9edd=_0xde2083[_0x3efec7(0x1a3)](_0x326dc3=>_0x326dc3['activationActions']),_0x4c089f=_0x2a9edd[_0x3efec7(0x29e)](_0x380b42=>_0x380b42[_0x3efec7(0x202)]===_0x3efec7(0x1c2)),_0x5b9735=_0x2a9edd['filter'](_0x4d2f8d=>_0x4d2f8d['type']===_0x3efec7(0x1ed)),_0x30f0fd=_0x2a9edd[_0x3efec7(0x29e)](_0x3e1cbe=>_0x3e1cbe[_0x3efec7(0x202)]===_0x3efec7(0x277)),_0x5a325a=Array['from'](_0x4a665b)['sort'](),_0x1eaf88=_0x1e6e94?![]:_0x6efff0[_0x3efec7(0x1b7)]>0x0||_0x37ea06[_0x3efec7(0x1b7)]>0x0||_0x1cf4fd[_0x3efec7(0x1b7)]>0x0,_0x52ea7d=_0x1f34e9[_0x3efec7(0x1b7)]>0x0||_0x14d3d0[_0x3efec7(0x1b7)]>0x0||_0x429850[_0x3efec7(0x1b7)]>0x0,_0x31f253=_0x1e6e94?![]:_0x2a9edd['length']>0x0,_0x16db37=_0x5a325a[_0x3efec7(0x1b7)]>0x0;return{'segments':{'new':_0x6efff0,'changed':_0x37ea06,'unchanged':_0x541f51,'toDelete':_0x1cf4fd},'journeys':{'new':_0x1f34e9,'changed':_0x14d3d0,'unchanged':_0x57ef5b,'toDelete':_0x429850},'activations':{'all':_0x2a9edd,'toCreate':_0x4c089f,'toUpdate':_0x5b9735,'toDelete':_0x30f0fd},'folders':{'toCreate':_0x5a325a},'counts':{'segments':{'new':_0x6efff0['length'],'changed':_0x37ea06[_0x3efec7(0x1b7)],'unchanged':_0x541f51['length'],'toDelete':_0x1cf4fd[_0x3efec7(0x1b7)]},'journeys':{'new':_0x1f34e9[_0x3efec7(0x1b7)],'changed':_0x14d3d0[_0x3efec7(0x1b7)],'unchanged':_0x57ef5b[_0x3efec7(0x1b7)],'toDelete':_0x429850[_0x3efec7(0x1b7)]},'activations':{'create':_0x4c089f[_0x3efec7(0x1b7)],'update':_0x5b9735['length'],'delete':_0x30f0fd[_0x3efec7(0x1b7)]},'folders':_0x5a325a[_0x3efec7(0x1b7)]},'hasChanges':_0x1eaf88||_0x52ea7d||_0x31f253||_0x16db37};}export async function buildPushExecutionContext(_0x19315b,_0x172f3c,_0xc3942c,_0x5dc705,_0x258bed,_0x43066c){const _0x5c9c08=a114_0x3e8f2e,_0x30c637=extractRootFolderId(_0xc3942c),{pathToId:_0x12e92a,idToPath:_0x3394b6}=buildFolderMaps(_0x258bed),_0x1effd8=buildSegmentNameToIdMap(_0x5dc705),_0x462b33=new Map(),{batchAsync:_0x32003f}=await import(_0x5c9c08(0x1de)),[_0x41d0f7,_0x499ae0]=await Promise['all']([_0x19315b[_0x5c9c08(0x1aa)][_0x5c9c08(0x1e2)](),_0x19315b[_0x5c9c08(0x1cf)][_0x5c9c08(0x1b8)](),((async()=>{const _0x6132a6=_0x5c9c08;!_0x43066c&&_0x5dc705[_0x6132a6(0x1b7)]>0x0&&await _0x32003f(_0x5dc705,async _0x2a0ea3=>{const _0x72751a=_0x6132a6,_0x185fe5=await _0x19315b[_0x72751a(0x1e7)][_0x72751a(0x22f)](_0x172f3c,_0x2a0ea3['id']);_0x462b33[_0x72751a(0x22a)](_0x2a0ea3['id'],_0x185fe5);});})())]),{emailToId:_0x33fc83,idToEmail:_0x28c249}=_0x41d0f7,_0x41f27a=buildConnectionMaps(_0x499ae0);return{'rootFolderId':_0x30c637,'folderPathToId':_0x12e92a,'folderIdToPath':_0x3394b6,'segmentNameToId':_0x1effd8,'activationsBySegmentId':_0x462b33,'emailToIdMap':_0x33fc83,'idToEmailMap':_0x28c249,'connectionNameToIdMap':_0x41f27a['nameToId'],'connectionIdToNameMap':_0x41f27a['idToName'],'connectionNameToTypeMap':_0x41f27a[_0x5c9c08(0x254)]};}export function createPushYamlContextForBundle(_0x16ea0a,_0x131fed,_0x118f87,_0xee91ec,_0x41c282,_0x5aa663,_0x4d8a6a,_0x26727a){const {existingLocalSegmentNames:_0x3ce56a,localExpandedRuleToNames:_0x59f402}=_0xee91ec,_0x11083b=new Set(),_0x52d8bc=new Map(),_0x1b6c4f=new Map(),_0x489b7c=new Map(),_0x42ffb7=createJumpTargetCache(),_0x3d0bd8=new Map(),_0x28176d=new Map(),_0x451c99=new Set();let _0x534785;const _0x30c36a=_0x1726a1=>{const _0x183bc9={'resolveSegment':async _0x33d136=>{const _0x56552e=a114_0x3785,_0x5ea13d=_0x489b7c['get'](_0x33d136);if(_0x5ea13d!==undefined)return{'name':_0x5ea13d,'isJourneyLocal':!![]};try{const _0x265d57=await fetchSegment(_0x16ea0a,_0x131fed,_0x33d136,_0x118f87);if(!_0x265d57)throw new Error(_0x56552e(0x29b));const _0x2c81bd=generateJourneyLocalName(_0x265d57[_0x56552e(0x1f6)]),_0xed8a12=_0x265d57['kind']===SEGMENT_KIND_JOURNEY&&_0x2c81bd!==undefined;let _0x18682f=_0x265d57[_0x56552e(0x1f6)],_0x2db3ac;if(_0xed8a12&&_0x265d57[_0x56552e(0x1a4)]){const _0x354086=apiRuleToYaml(_0x265d57['rule']);_0x28176d[_0x56552e(0x22a)](_0x33d136,_0x354086);const _0x12a9df=async _0x4a74bd=>{const _0x5eab69=_0x56552e,_0x303f26=collectSegmentRefsFromRule(_0x4a74bd);for(const _0x41d856 of _0x303f26){if(!_0x28176d[_0x5eab69(0x27e)](_0x41d856))try{const _0x24f9e2=await fetchSegment(_0x16ea0a,_0x131fed,_0x41d856,_0x118f87);if(_0x24f9e2?.['rule']){const _0x458062=apiRuleToYaml(_0x24f9e2[_0x5eab69(0x1a4)]);_0x28176d[_0x5eab69(0x22a)](_0x41d856,_0x458062),await _0x12a9df(_0x458062);}}catch(_0x52e156){logger[_0x5eab69(0x1c7)](_0x5eab69(0x24b)+_0x41d856+':\x20'+_0x52e156);}}};await _0x12a9df(_0x354086);const _0x4a3d08=serializeExpandedRule(_0x354086,_0x28176d),_0x5c1ac9=_0x59f402[_0x56552e(0x1f1)](_0x4a3d08);if(_0x5c1ac9&&_0x5c1ac9[_0x56552e(0x1b7)]>0x0){const _0x389124=_0x52d8bc[_0x56552e(0x1f1)](_0x4a3d08)||0x0,_0x51e476=_0x5c1ac9[_0x389124]||_0x5c1ac9[_0x5c1ac9[_0x56552e(0x1b7)]-0x1];_0x52d8bc[_0x56552e(0x22a)](_0x4a3d08,_0x389124+0x1),_0x18682f=_0x51e476,_0x11083b['add'](_0x18682f),_0x489b7c[_0x56552e(0x22a)](_0x33d136,_0x18682f);const _0x3febf2=await resolveRuleSegmentRefs(_0x354086,async _0x1e0949=>{const _0xa09d01=_0x56552e,_0x2dce73=_0x489b7c['get'](_0x1e0949);if(_0x2dce73)return _0x2dce73;const _0x3cb279=await _0x534785[_0xa09d01(0x1fd)](_0x1e0949);return _0x3cb279[_0xa09d01(0x1f6)];});_0x2db3ac={'description':_0x265d57[_0x56552e(0x285)],'rule':_0x3febf2};}else{const _0x1192ff=_0x3d0bd8[_0x56552e(0x1f1)](_0x4a3d08);if(_0x1192ff)_0x18682f=_0x1192ff,_0x489b7c[_0x56552e(0x22a)](_0x33d136,_0x18682f);else{if(_0x2c81bd){let _0x500ee8=_0x2c81bd,_0x269a38=0x2;while(_0x11083b[_0x56552e(0x27e)](_0x500ee8)||_0x3ce56a[_0x56552e(0x27e)](_0x500ee8)){_0x500ee8=_0x2c81bd+'_'+_0x269a38,_0x269a38++;}_0x11083b['add'](_0x500ee8),_0x18682f=_0x500ee8;}_0x489b7c[_0x56552e(0x22a)](_0x33d136,_0x18682f),_0x3d0bd8['set'](_0x4a3d08,_0x18682f);const _0x201f48=await resolveRuleSegmentRefs(_0x354086,async _0x30f80f=>{const _0x5381f8=_0x56552e,_0x26662c=_0x489b7c['get'](_0x30f80f);if(_0x26662c)return _0x26662c;const _0x57aead=await _0x534785[_0x5381f8(0x1fd)](_0x30f80f);return _0x57aead[_0x5381f8(0x1f6)];});_0x2db3ac={'description':_0x265d57[_0x56552e(0x285)],'rule':_0x201f48};}}}return{'name':_0x18682f,'isJourneyLocal':_0xed8a12,'definition':_0x2db3ac};}catch(_0x500c59){return logger[_0x56552e(0x1c7)]('Failed\x20to\x20resolve\x20segment\x20'+_0x33d136+':\x20'+_0x500c59),{'name':_0x33d136,'isJourneyLocal':![]};}},'resolveActivation':async _0x3f6891=>{const _0x1c0fd5=a114_0x3785,_0x36688c=_0x1b6c4f[_0x1c0fd5(0x1f1)](_0x3f6891);if(_0x36688c!==undefined)return{'name':_0x36688c,'isJourneyLocal':!![]};try{let _0x9df16e=_0x4d8a6a?.[_0x1c0fd5(0x1f1)](_0x3f6891);!_0x9df16e&&(_0x9df16e=await _0x16ea0a[_0x1c0fd5(0x1ac)][_0x1c0fd5(0x221)](_0x1726a1,_0x3f6891));const _0x3fea65=_0x9df16e['attributes'][_0x1c0fd5(0x288)][_0x1c0fd5(0x1f6)]||_0x3f6891,_0x273278=sanitizeYamlKey(_0x3fea65)||_0x1c0fd5(0x207)+_0x3f6891,_0x56049e=_0x273278;_0x1b6c4f[_0x1c0fd5(0x22a)](_0x3f6891,_0x56049e);const _0x34a714=journeyActivationStepToYaml(_0x9df16e,_0x41c282,_0x5aa663);return{'name':_0x56049e,'isJourneyLocal':!![],'definition':_0x34a714};}catch(_0x356204){return logger[_0x1c0fd5(0x1c7)](_0x1c0fd5(0x1cd)+_0x3f6891+':\x20'+_0x356204),{'name':_0x3f6891,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2d0b20,_0x39c32b)=>resolveJumpTarget(_0x2d0b20,_0x39c32b,_0x42ffb7,async _0x1a80fb=>{const _0x1a9997=a114_0x3785,_0x474492=_0x26727a?.[_0x1a9997(0x1f1)](_0x1a80fb);if(_0x474492)return _0x474492;return _0x16ea0a[_0x1a9997(0x1ac)][_0x1a9997(0x276)](_0x1a80fb);})};return _0x534785=_0x183bc9,_0x183bc9;},_0x5266b5=async _0x53af22=>{const _0x8063d0=a114_0x3785,{collectSegmentIdsFromJourneyApi:_0x2b8f48}=await import('./journey-yaml.js'),{batchAsync:_0x3ec9f6}=await import(_0x8063d0(0x1de)),_0x1c809b=new Set();for(const _0x46b337 of _0x53af22){let _0x57de8e=_0x26727a?.[_0x8063d0(0x1f1)](_0x46b337);!_0x57de8e&&(_0x57de8e=await _0x16ea0a['journey'][_0x8063d0(0x276)](_0x46b337));const _0x5ae21d=_0x2b8f48(_0x57de8e);for(const _0x5386b7 of _0x5ae21d){_0x1c809b[_0x8063d0(0x234)](_0x5386b7);}}let _0x30388b=Array[_0x8063d0(0x242)](_0x1c809b);while(_0x30388b[_0x8063d0(0x1b7)]>0x0){const _0x2e9491=_0x30388b[_0x8063d0(0x29e)](_0x24d9e3=>!_0x451c99[_0x8063d0(0x27e)](_0x24d9e3));if(_0x2e9491['length']===0x0)break;const _0x4dbc8b=await _0x3ec9f6(_0x2e9491,async _0x439a3c=>{_0x451c99['add'](_0x439a3c);const _0x36f5b0=await fetchSegment(_0x16ea0a,_0x131fed,_0x439a3c,_0x118f87);if(!_0x36f5b0)return null;return{'segmentId':_0x439a3c,'segment':_0x36f5b0};},0xa),_0x4d36a4=new Set();for(const _0x95378b of _0x4dbc8b){if(!_0x95378b?.[_0x8063d0(0x1e7)]?.[_0x8063d0(0x1a4)])continue;const _0x62bf7a=apiRuleToYaml(_0x95378b['segment'][_0x8063d0(0x1a4)]);_0x28176d['set'](_0x95378b[_0x8063d0(0x294)],_0x62bf7a);const _0x1636dc=collectSegmentRefsFromRule(_0x62bf7a);for(const _0x268867 of _0x1636dc){!_0x451c99[_0x8063d0(0x27e)](_0x268867)&&_0x4d36a4[_0x8063d0(0x234)](_0x268867);}}_0x30388b=Array['from'](_0x4d36a4);}};return{'createYamlContext':_0x30c36a,'prefetchJourneySegments':_0x5266b5};}export async function executePushSegments(_0x222a85,_0x596489,_0x15f344,_0x2e541b,_0x5e35dd){const _0x1a3ebb=a114_0x3e8f2e,{segmentDefToCreateRequest:_0x55b81e,segmentDefToUpdateRequest:_0x2e1eb1}=await import(_0x1a3ebb(0x1b0)),_0x3d2ace=_0x15f344[_0x1a3ebb(0x1c1)],_0x1cbf09=0x5,_0x49f646=async _0x5d8480=>{const _0x1f3211=_0x1a3ebb,_0x34d005=_0x5d8480[_0x1f3211(0x292)]?_0x3d2ace['get'](_0x5d8480['folderPath']):undefined;let _0x5e1283;const _0x55bf01={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5d8480[_0x1f3211(0x1e5)]){_0x5e35dd[_0x1f3211(0x1b3)]?.({'type':_0x1f3211(0x25f),'name':_0x5d8480[_0x1f3211(0x28f)]['name']});const _0x100e09=_0x55b81e(_0x5d8480[_0x1f3211(0x28f)],_0x34d005),_0x42dba3=await _0x5e35dd[_0x1f3211(0x1ab)](_0x1f3211(0x1d5)+_0x5d8480['yamlConfig'][_0x1f3211(0x1f6)]+_0x1f3211(0x1d9),()=>_0x222a85[_0x1f3211(0x1e7)][_0x1f3211(0x24f)](_0x2e541b[_0x1f3211(0x297)],_0x100e09));_0x5e1283=_0x42dba3['data']['id'],_0x55bf01[_0x1f3211(0x1e4)]={'name':_0x5d8480[_0x1f3211(0x28f)][_0x1f3211(0x1f6)],'id':_0x5e1283},_0x5e35dd[_0x1f3211(0x1b3)]?.({'type':_0x1f3211(0x23d),'name':_0x5d8480[_0x1f3211(0x28f)]['name'],'segmentId':_0x5e1283}),_0x5e35dd[_0x1f3211(0x1a5)]?.(_0x1f3211(0x1f8)+_0x5d8480[_0x1f3211(0x28f)]['name']+'\x27'),_0x55bf01[_0x1f3211(0x24a)]=0x1;}else{if(_0x5d8480['hasChanges']){_0x5e35dd['onProgress']?.({'type':_0x1f3211(0x23e),'name':_0x5d8480['yamlConfig']['name']});const _0x345742=_0x2e1eb1(_0x5d8480[_0x1f3211(0x28f)]);_0x34d005!==_0x5d8480[_0x1f3211(0x270)]?.[_0x1f3211(0x21e)]&&(_0x345742[_0x1f3211(0x21e)]=_0x34d005?parseInt(_0x34d005,0xa):undefined),await _0x5e35dd['withProgress'](_0x1f3211(0x1c9)+_0x5d8480[_0x1f3211(0x28f)][_0x1f3211(0x1f6)]+'\x27...',()=>_0x222a85[_0x1f3211(0x1e7)][_0x1f3211(0x227)](_0x2e541b[_0x1f3211(0x297)],_0x5d8480[_0x1f3211(0x270)]['id'],_0x345742)),_0x5e1283=_0x5d8480[_0x1f3211(0x270)]['id'],_0x5e35dd[_0x1f3211(0x1b3)]?.({'type':_0x1f3211(0x23b),'name':_0x5d8480[_0x1f3211(0x28f)][_0x1f3211(0x1f6)]}),_0x5e35dd[_0x1f3211(0x1a5)]?.(_0x1f3211(0x25d)+_0x5d8480[_0x1f3211(0x28f)][_0x1f3211(0x1f6)]+'\x27'),_0x55bf01[_0x1f3211(0x269)]=0x1;}else _0x5e1283=_0x5d8480[_0x1f3211(0x270)]['id'];}}catch(_0x3e3a4b){const _0x47c679=isHttp400Error(_0x3e3a4b),_0x4f4157=_0x47c679?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1f3211(0x29c)],_0x3071ef=getErrorMessage(_0x3e3a4b);throw new SDKError(_0x4f4157,_0x1f3211(0x264)+(_0x5d8480['isNew']?_0x1f3211(0x1c2):_0x1f3211(0x1ed))+_0x1f3211(0x24d)+_0x5d8480[_0x1f3211(0x2a0)]+_0x1f3211(0x278)+_0x3071ef,_0x3e3a4b);}try{const _0x55cb28=await syncActivationsForSegment(_0x222a85,_0x2e541b[_0x1f3211(0x297)],_0x5e1283,_0x5d8480['yamlConfig'][_0x1f3211(0x1f6)],_0x5d8480[_0x1f3211(0x1fc)],_0x5e35dd,_0x5d8480['absolutePath']);_0x55bf01[_0x1f3211(0x1df)]=_0x55cb28;}catch(_0x158fe6){if(_0x158fe6 instanceof SDKError)throw _0x158fe6;throw new SDKError(ErrorCode[_0x1f3211(0x1d4)],_0x1f3211(0x20e)+_0x5d8480[_0x1f3211(0x28f)][_0x1f3211(0x1f6)]+_0x1f3211(0x213)+_0x5d8480[_0x1f3211(0x2a0)]+_0x1f3211(0x278)+getErrorMessage(_0x158fe6),_0x158fe6);}return _0x55bf01;},_0x3491af=await batchAsync(_0x596489,_0x49f646,_0x1cbf09),_0x20c291={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x41545f of _0x3491af){_0x20c291['created']+=_0x41545f[_0x1a3ebb(0x24a)],_0x20c291[_0x1a3ebb(0x269)]+=_0x41545f[_0x1a3ebb(0x269)],_0x41545f[_0x1a3ebb(0x1e4)]&&_0x20c291[_0x1a3ebb(0x296)][_0x1a3ebb(0x22a)](_0x41545f[_0x1a3ebb(0x1e4)][_0x1a3ebb(0x1f6)],_0x41545f['createdSegmentId']['id']),_0x20c291[_0x1a3ebb(0x1df)][_0x1a3ebb(0x24a)]+=_0x41545f[_0x1a3ebb(0x1df)][_0x1a3ebb(0x24a)],_0x20c291[_0x1a3ebb(0x1df)][_0x1a3ebb(0x269)]+=_0x41545f[_0x1a3ebb(0x1df)][_0x1a3ebb(0x269)],_0x20c291[_0x1a3ebb(0x1df)]['deleted']+=_0x41545f[_0x1a3ebb(0x1df)][_0x1a3ebb(0x21a)];}return _0x20c291;}async function syncActivationsForSegment(_0x51652c,_0x57d316,_0x2e30e0,_0x35855d,_0x32d612,_0x483a49,_0xd89e05){const _0x316569=a114_0x3e8f2e,_0x414149={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4ea5ab of _0x32d612){try{if(_0x4ea5ab['type']===_0x316569(0x1c2)&&_0x4ea5ab[_0x316569(0x1b5)])_0x483a49[_0x316569(0x1b3)]?.({'type':_0x316569(0x1e3),'segmentName':_0x35855d,'activationName':_0x4ea5ab[_0x316569(0x1f6)]}),await _0x483a49['withProgress']('Creating\x20activation\x20\x27'+_0x4ea5ab[_0x316569(0x1f6)]+'\x27...',()=>_0x51652c['segment'][_0x316569(0x21d)](_0x57d316,_0x2e30e0,_0x4ea5ab[_0x316569(0x1b5)])),_0x483a49[_0x316569(0x1b3)]?.({'type':_0x316569(0x1ef),'segmentName':_0x35855d,'activationName':_0x4ea5ab['name']}),_0x483a49[_0x316569(0x1a5)]?.(_0x316569(0x1ad)+_0x4ea5ab[_0x316569(0x1f6)]+'\x27'),_0x414149[_0x316569(0x24a)]++;else{if(_0x4ea5ab[_0x316569(0x202)]==='update'&&_0x4ea5ab['validatedRequest']&&_0x4ea5ab[_0x316569(0x1e0)])_0x483a49['onProgress']?.({'type':_0x316569(0x248),'segmentName':_0x35855d,'activationName':_0x4ea5ab[_0x316569(0x1f6)]}),await _0x483a49[_0x316569(0x1ab)](_0x316569(0x290)+_0x4ea5ab[_0x316569(0x1f6)]+_0x316569(0x1d9),()=>_0x51652c['segment'][_0x316569(0x274)](_0x57d316,_0x2e30e0,_0x4ea5ab[_0x316569(0x1e0)]['id'],_0x4ea5ab['validatedRequest'])),_0x483a49[_0x316569(0x1b3)]?.({'type':'activation_updated','segmentName':_0x35855d,'activationName':_0x4ea5ab[_0x316569(0x1f6)]}),_0x483a49[_0x316569(0x1a5)]?.(_0x316569(0x275)+_0x4ea5ab[_0x316569(0x1f6)]+'\x27'),_0x414149['updated']++;else _0x4ea5ab[_0x316569(0x202)]==='delete'&&_0x4ea5ab[_0x316569(0x1e0)]&&(_0x483a49[_0x316569(0x1b3)]?.({'type':'activation_deleting','segmentName':_0x35855d,'activationName':_0x4ea5ab[_0x316569(0x1f6)]}),await _0x483a49[_0x316569(0x1ab)](_0x316569(0x1e6)+_0x4ea5ab[_0x316569(0x1f6)]+_0x316569(0x1d9),()=>_0x51652c['segment'][_0x316569(0x26c)](_0x57d316,_0x2e30e0,_0x4ea5ab[_0x316569(0x1e0)]['id'])),_0x483a49['onProgress']?.({'type':'activation_deleted','segmentName':_0x35855d,'activationName':_0x4ea5ab[_0x316569(0x1f6)]}),_0x483a49['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x4ea5ab[_0x316569(0x1f6)]+'\x27'),_0x414149[_0x316569(0x21a)]++);}}catch(_0x3931d8){const _0x3de501=isHttp400Error(_0x3931d8),_0x3789c0=_0x3de501?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x316569(0x1d4)],_0x351eff=getErrorMessage(_0x3931d8);throw new SDKError(_0x3789c0,'Failed\x20to\x20'+_0x4ea5ab['type']+'\x20activation\x20\x27'+_0x4ea5ab[_0x316569(0x1f6)]+'\x27\x20from\x20file:\x20'+_0xd89e05+_0x316569(0x278)+_0x351eff,_0x3931d8);}}return _0x414149;}export async function executePushFolders(_0x12c381,_0x5ab4cb,_0x3549eb,_0x236355,_0x1fd9b0){const _0x3883bc=a114_0x3e8f2e,_0x50e7eb=new Map(_0x3549eb);for(const _0x3774be of _0x5ab4cb){const _0x236cca=_0x3774be[_0x3883bc(0x1b2)]('/'),_0x5b1651=_0x236cca[_0x236cca[_0x3883bc(0x1b7)]-0x1],_0x569424=_0x236cca['slice'](0x0,-0x1)[_0x3883bc(0x1bb)]('/'),_0x2e65f4=_0x50e7eb[_0x3883bc(0x1f1)](_0x569424);_0x1fd9b0[_0x3883bc(0x1b3)]?.({'type':_0x3883bc(0x256),'folder':_0x3774be});const _0x2af11f={'name':_0x5b1651,'parentFolderId':_0x2e65f4},_0x2ed39f=await _0x1fd9b0[_0x3883bc(0x1ab)](_0x3883bc(0x20a)+_0x3774be+_0x3883bc(0x1d9),()=>_0x12c381['segment'][_0x3883bc(0x299)](_0x236355[_0x3883bc(0x297)],_0x2af11f));_0x50e7eb[_0x3883bc(0x22a)](_0x3774be,_0x2ed39f[_0x3883bc(0x257)]['id']),_0x1fd9b0[_0x3883bc(0x1b3)]?.({'type':_0x3883bc(0x29d),'folder':_0x3774be,'folderId':_0x2ed39f[_0x3883bc(0x257)]['id']}),_0x1fd9b0[_0x3883bc(0x22b)]?.(_0x3883bc(0x1ca)+_0x3774be+'\x27');}return _0x50e7eb;}export async function executePushSegmentDeletions(_0xe8ddbd,_0x4c8641,_0x9eef82){const _0x226d31=a114_0x3e8f2e;if(_0x4c8641[_0x226d31(0x1b7)]===0x0)return 0x0;const {batchAsync:_0x4e73aa}=await import(_0x226d31(0x1de)),_0x2e7b2=0x5,_0x480956=await _0x4e73aa(_0x4c8641,async _0x4d84f8=>{const _0x4de6c8=_0x226d31;return _0x9eef82['onProgress']?.({'type':_0x4de6c8(0x20b),'name':_0x4d84f8['name']}),await _0xe8ddbd[_0x4de6c8(0x1e7)][_0x4de6c8(0x27a)](_0x4d84f8['id']),_0x9eef82[_0x4de6c8(0x1b3)]?.({'type':_0x4de6c8(0x236),'name':_0x4d84f8[_0x4de6c8(0x1f6)]}),_0x9eef82[_0x4de6c8(0x29f)]?.(_0x4de6c8(0x1d8)+_0x4d84f8[_0x4de6c8(0x1f6)]+'\x27'),0x1;},_0x2e7b2);return _0x480956['reduce']((_0x593165,_0x559fae)=>_0x593165+_0x559fae,0x0);}export async function executePushJourneys(_0x35ef31,_0x38504c,_0x4a1528,_0x25c098,_0x463de3){const _0x2bdb80=a114_0x3e8f2e,{journeyDefToRequest:_0x6ea955}=await import(_0x2bdb80(0x21c)),{activationDefToCreateRequest:_0x1c06dd,yamlRuleToApi:_0x2e6d04,validateSegmentRule:_0x290e07}=await import(_0x2bdb80(0x1b0)),_0x2a8083={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3e7949=new Map(_0x4a1528[_0x2bdb80(0x20d)]),_0x5cde65=0x5;for(let _0x259a99=0x0;_0x259a99<_0x38504c['length'];_0x259a99+=_0x5cde65){const _0x1c16a8=_0x38504c[_0x2bdb80(0x1cb)](_0x259a99,_0x259a99+_0x5cde65),_0x77757=await Promise[_0x2bdb80(0x289)](_0x1c16a8[_0x2bdb80(0x1fe)](async _0xe7e1da=>{const _0x470c3a=_0x2bdb80;if(!_0xe7e1da['isNew']&&!_0xe7e1da['hasChanges'])return{'action':_0x470c3a(0x261),'name':_0xe7e1da[_0x470c3a(0x28f)][_0x470c3a(0x1f6)],'journeyId':_0xe7e1da['existingJourney']?.['id']};const _0x8b2c2=_0xe7e1da['folderPath']?_0x4a1528['folderPathToId'][_0x470c3a(0x1f1)](_0xe7e1da[_0x470c3a(0x292)]):undefined;_0x463de3[_0x470c3a(0x1b3)]?.({'type':_0xe7e1da[_0x470c3a(0x1e5)]?_0x470c3a(0x238):'journey_updating','name':_0xe7e1da[_0x470c3a(0x28f)]['name']});try{const _0x4f9b62=await executeSingleJourneyPush(_0x35ef31,_0xe7e1da,{..._0x4a1528,'segmentNameToId':_0x3e7949},{'parentId':_0x25c098[_0x470c3a(0x297)],'rootFolderId':_0x25c098[_0x470c3a(0x229)],'folderId':_0x8b2c2,'verbose':_0x25c098['verbose']},_0x463de3,{'journeyDefToRequest':_0x6ea955,'activationDefToCreateRequest':_0x1c06dd,'yamlRuleToApi':_0x2e6d04,'validateSegmentRule':_0x290e07});for(const [_0x246783,_0x4e06a4]of _0x4f9b62[_0x470c3a(0x26d)]){_0x3e7949[_0x470c3a(0x22a)](_0x246783,_0x4e06a4),_0x2a8083[_0x470c3a(0x26d)][_0x470c3a(0x22a)](_0x246783,_0x4e06a4);}if(_0x4f9b62['action']===_0x470c3a(0x24a))_0x463de3[_0x470c3a(0x1b3)]?.({'type':_0x470c3a(0x1ae),'name':_0xe7e1da[_0x470c3a(0x28f)]['name'],'journeyId':_0x4f9b62[_0x470c3a(0x205)]}),_0x463de3[_0x470c3a(0x1a5)]?.(_0x470c3a(0x281)+_0xe7e1da[_0x470c3a(0x28f)][_0x470c3a(0x1f6)]+'\x27'),_0x2a8083[_0x470c3a(0x24a)]++;else _0x4f9b62[_0x470c3a(0x225)]===_0x470c3a(0x269)&&(_0x463de3[_0x470c3a(0x1b3)]?.({'type':_0x470c3a(0x23a),'name':_0xe7e1da['yamlConfig']['name']}),_0x463de3[_0x470c3a(0x1a5)]?.(_0x470c3a(0x28a)+_0xe7e1da['yamlConfig'][_0x470c3a(0x1f6)]+'\x27'),_0x2a8083['updated']++);return{'action':_0x4f9b62[_0x470c3a(0x225)],'name':_0xe7e1da[_0x470c3a(0x28f)][_0x470c3a(0x1f6)],'journeyId':_0x4f9b62[_0x470c3a(0x205)]};}catch(_0x2217cf){const _0x19efb7=isHttp400Error(_0x2217cf),_0x1ceae8=_0x19efb7?ErrorCode[_0x470c3a(0x1dd)]:ErrorCode[_0x470c3a(0x1f0)],_0x2c59d7=getErrorMessage(_0x2217cf);throw new SDKError(_0x1ceae8,_0x470c3a(0x264)+(_0xe7e1da[_0x470c3a(0x1e5)]?_0x470c3a(0x1c2):_0x470c3a(0x1ed))+_0x470c3a(0x263)+_0xe7e1da[_0x470c3a(0x2a0)]+'\x0a\x20\x20'+_0x2c59d7,_0x2217cf);}}));_0x2a8083[_0x2bdb80(0x267)][_0x2bdb80(0x1c8)](..._0x77757);}return _0x2a8083;}async function matchExistingJourneySegments(_0x47b97f,_0x13a109,_0x24f18a,_0x33dc4c,_0x4388d3){const _0x1c7d13=a114_0x3e8f2e;if(!_0x13a109[_0x1c7d13(0x1f9)]||!_0x13a109[_0x1c7d13(0x28f)][_0x1c7d13(0x210)])return;const _0x413fdc=new Map();for(const _0x293522 of Object[_0x1c7d13(0x217)](_0x13a109[_0x1c7d13(0x28f)][_0x1c7d13(0x210)])){const _0x2d1397=generateDeterministicJourneySegmentName(_0x13a109[_0x1c7d13(0x28f)]['name'],_0x293522);_0x413fdc[_0x1c7d13(0x22a)](_0x2d1397,_0x293522);}const _0x1407a4=collectSegmentIdsFromJourneyApi(_0x13a109[_0x1c7d13(0x1f9)]);for(const _0x43fb29 of _0x1407a4){const _0x225fa0=await fetchSegment(_0x47b97f,_0x24f18a,_0x43fb29,_0x33dc4c);if(!_0x225fa0?.[_0x1c7d13(0x1f6)])continue;const _0x350612=_0x413fdc['get'](_0x225fa0[_0x1c7d13(0x1f6)]);_0x350612&&_0x4388d3[_0x1c7d13(0x22a)](_0x350612,_0x43fb29);}}async function executeSingleJourneyPush(_0x826b1,_0x4a4823,_0x593202,_0x15eaff,_0x47e04b,_0x4c442c){const _0x163973=a114_0x3e8f2e,{journeyDefToRequest:_0x217147,activationDefToCreateRequest:_0x15991f,yamlRuleToApi:_0x5e382e,validateSegmentRule:_0x2a74f5}=_0x4c442c,_0xfa05ec=new Map(),_0x258117=new Map();recoverSegmentIdsFromPushRecovery(_0x4a4823,_0xfa05ec,_0x593202[_0x163973(0x20d)]);const _0x5e47e3=new Map(),_0x160b58=new Map(),_0x2f417d=new Map();let _0x1e7f0a;const _0x31d97b=async()=>{const _0x1f40d3=_0x163973;if(_0x1e7f0a)return;_0x1e7f0a=new Map();if(!_0x4a4823[_0x1f40d3(0x1f9)])return;const _0x4d0fd6=await _0x826b1['journey'][_0x1f40d3(0x22f)](_0x4a4823[_0x1f40d3(0x1f9)]['id']);for(const _0x18f387 of _0x4d0fd6){const _0x277c06=journeyActivationStepToYaml(_0x18f387,_0x593202[_0x1f40d3(0x268)],_0x593202[_0x1f40d3(0x295)]),_0x533747=activationSignature(_0x277c06);!_0x1e7f0a['has'](_0x533747)&&_0x1e7f0a[_0x1f40d3(0x22a)](_0x533747,_0x18f387['id']),_0x277c06[_0x1f40d3(0x1f6)]&&_0x258117[_0x1f40d3(0x22a)](_0x277c06[_0x1f40d3(0x1f6)],_0x18f387['id']);}};await matchExistingJourneySegments(_0x826b1,_0x4a4823,_0x15eaff[_0x163973(0x297)],_0x593202[_0x163973(0x284)],_0x593202[_0x163973(0x20d)]);const _0x390b06={'resolveSegmentId':async _0x3cd239=>{const _0x4ab433=_0x163973,_0x1da4cb=_0x593202[_0x4ab433(0x20d)][_0x4ab433(0x1f1)](_0x3cd239);if(!_0x1da4cb)throw new SDKError(ErrorCode[_0x4ab433(0x1da)],_0x4ab433(0x206)+_0x3cd239+_0x4ab433(0x243)+_0x4a4823[_0x4ab433(0x28f)][_0x4ab433(0x1f6)]+')');return _0x1da4cb;},'resolveEmbeddedSegmentId':async(_0x43181c,_0x57bf96)=>{const _0x5c6631=_0x163973,_0x26cf6c=_0x593202[_0x5c6631(0x20d)][_0x5c6631(0x1f1)](_0x43181c);if(_0x26cf6c)return _0x26cf6c;const _0x2c2518=_0x593202[_0x5c6631(0x284)][_0x5c6631(0x1f4)](_0x488f85=>_0x488f85[_0x5c6631(0x1f6)]===_0x43181c);if(_0x2c2518)return _0x593202[_0x5c6631(0x20d)]['set'](_0x43181c,_0x2c2518['id']),_0x2c2518['id'];if(_0x4a4823['isNew']){const {stageName:_0x44db16,criteriaName:_0x34c0a7}=findSegmentCriteriaLocation(_0x4a4823[_0x5c6631(0x28f)],_0x43181c);return _0x2a74f5(_0x43181c,_0x57bf96[_0x5c6631(0x1a4)]),_0x160b58[_0x5c6631(0x22a)](_0x43181c,{'definition':_0x57bf96,'stageName':_0x44db16,'criteriaName':_0x34c0a7}),createPendingSegmentId(_0x43181c);}const _0x25991a=_0x4a4823[_0x5c6631(0x1f9)]?.['id'];if(!_0x25991a)throw new SDKError(ErrorCode['INTERNAL'],_0x5c6631(0x1ff));const _0x52f9e9=_0x5e47e3[_0x5c6631(0x1f1)](_0x43181c);if(_0x52f9e9)return _0x52f9e9;const _0x3410e5=((async()=>{const _0x297c4a=_0x5c6631;_0x2a74f5(_0x43181c,_0x57bf96[_0x297c4a(0x1a4)]);const _0xf20dea=generateDeterministicJourneySegmentName(_0x4a4823['yamlConfig'][_0x297c4a(0x1f6)],_0x43181c),_0xb5610c=_0x593202[_0x297c4a(0x284)][_0x297c4a(0x1f4)](_0x1a289f=>_0x1a289f[_0x297c4a(0x1f6)]===_0xf20dea),_0x1ca560=createSegmentIdResolver(_0x593202[_0x297c4a(0x20d)],_0x43181c),_0x35d35b=await resolveRuleSegmentIds(_0x57bf96[_0x297c4a(0x1a4)],_0x1ca560);let _0x36e144;return _0xb5610c?(await _0x826b1['segment'][_0x297c4a(0x227)](_0x15eaff[_0x297c4a(0x297)],_0xb5610c['id'],{'description':_0x57bf96['description']||_0x297c4a(0x1b6)+_0x43181c,'rule':_0x5e382e(_0x35d35b,!![]),'countPopulation':!![]}),_0x36e144=_0xb5610c['id'],saveSegmentToPushRecovery(_0x4a4823[_0x297c4a(0x2a0)],_0x4a4823['yamlConfig'][_0x297c4a(0x1f6)],_0x43181c,{'segmentId':_0x36e144,'uniqueServerName':_0xf20dea,'createdAt':new Date()[_0x297c4a(0x237)]()})):_0x36e144=await createOrRecoverEmbeddedSegment(_0x826b1,_0x4a4823,{'localName':_0x43181c,'uniqueSegmentName':_0xf20dea,'description':_0x57bf96['description']||_0x297c4a(0x1b6)+_0x43181c,'journeyId':_0x25991a,'resolvedRule':_0x35d35b,'parentId':_0x15eaff[_0x297c4a(0x297)],'folderId':_0x15eaff['rootFolderId']||''},_0x5e382e),_0x593202[_0x297c4a(0x20d)]['set'](_0x43181c,_0x36e144),_0xfa05ec[_0x297c4a(0x22a)](_0x43181c,_0x36e144),_0x36e144;})());_0x5e47e3['set'](_0x43181c,_0x3410e5);try{return await _0x3410e5;}finally{_0x5e47e3[_0x5c6631(0x277)](_0x43181c);}},'resolveActivationId':async _0xb30f13=>{const _0x26eca2=_0x163973,_0x5ed542=_0x258117['get'](_0xb30f13);if(_0x5ed542)return _0x5ed542;if(_0x4a4823[_0x26eca2(0x1f9)]){await _0x31d97b();const _0x149cf9=_0x258117[_0x26eca2(0x1f1)](_0xb30f13);if(_0x149cf9)return _0x149cf9;}throw new SDKError(ErrorCode[_0x26eca2(0x20c)],'Activation\x20not\x20found:\x20'+_0xb30f13+_0x26eca2(0x243)+_0x4a4823[_0x26eca2(0x28f)][_0x26eca2(0x1f6)]+_0x26eca2(0x1e1)+_0x26eca2(0x24c));},'resolveEmbeddedActivationId':async(_0x2d9856,_0x3a8595)=>{const _0x243bc9=_0x163973,_0x41ba79=_0x258117['get'](_0x2d9856);if(_0x41ba79)return _0x41ba79;if(_0x4a4823[_0x243bc9(0x1e5)])return _0x2f417d[_0x243bc9(0x22a)](_0x2d9856,_0x3a8595),createPendingActivationId(_0x2d9856);if(_0x4a4823[_0x243bc9(0x1f9)]){await _0x31d97b();const _0x54cb4f=_0x258117[_0x243bc9(0x1f1)](_0x3a8595[_0x243bc9(0x1f6)]);if(_0x54cb4f)return _0x258117[_0x243bc9(0x22a)](_0x2d9856,_0x54cb4f),_0x54cb4f;const _0x55fddf=activationSignature(_0x3a8595),_0x1ed125=_0x1e7f0a?.[_0x243bc9(0x1f1)](_0x55fddf);if(_0x1ed125)return _0x258117[_0x243bc9(0x22a)](_0x2d9856,_0x1ed125),_0x1ed125;const _0x387431=await _0x15991f(_0x3a8595,_0x593202[_0x243bc9(0x279)]),_0x56b1b8={..._0x387431,..._0x3a8595['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x3a8595[_0x243bc9(0x208)]}},_0x29ccb7=await _0x826b1[_0x243bc9(0x1ac)]['createActivation'](_0x4a4823[_0x243bc9(0x1f9)]['id'],_0x56b1b8);return _0x258117['set'](_0x2d9856,_0x29ccb7['id']),_0x29ccb7['id'];}throw new SDKError(ErrorCode[_0x243bc9(0x262)],_0x243bc9(0x24e));},'resolveJourneyId':async _0x9326f4=>{const _0x1d04e9=_0x163973;try{return await _0x826b1[_0x1d04e9(0x1ac)][_0x1d04e9(0x240)](_0x15eaff[_0x1d04e9(0x297)],_0x9326f4);}catch(_0x516eb8){throw new SDKError(ErrorCode['NOT_FOUND'],_0x1d04e9(0x26a)+_0x9326f4+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x4a4823[_0x1d04e9(0x28f)][_0x1d04e9(0x1f6)]+'\x27)',_0x516eb8);}},'resolveStageId':async(_0xf17861,_0x27f7f6)=>{const _0x19319d=_0x163973,_0x293582=await _0x826b1['journey'][_0x19319d(0x276)](_0xf17861),_0x36b928=_0x293582['attributes']['journeyStages']['find'](_0x29463f=>_0x29463f[_0x19319d(0x1f6)][_0x19319d(0x27c)]()===_0x27f7f6[_0x19319d(0x27c)]());if(!_0x36b928?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x27f7f6+_0x19319d(0x1c5)+(_0x293582[_0x19319d(0x22e)]['journeyBundleName']||_0x293582[_0x19319d(0x22e)][_0x19319d(0x1f6)])+'\x27');return _0x36b928['id'];}},_0xb5843f=await _0x217147(_0x4a4823[_0x163973(0x28f)],_0x15eaff[_0x163973(0x297)],_0x390b06),_0x2a9a98=_0x15eaff[_0x163973(0x27d)]||_0x15eaff[_0x163973(0x229)];_0x2a9a98&&(_0xb5843f[_0x163973(0x1f5)]={'parentFolder':{'data':{'id':_0x2a9a98,'type':_0x163973(0x1d7)}}});if(_0x4a4823['isNew']){if(_0x160b58['size']>0x0||_0x2f417d[_0x163973(0x222)]>0x0)return await executeThreeStepJourneyCreate(_0x826b1,_0x4a4823,_0xb5843f,{'pendingEmbeddedSegments':_0x160b58,'pendingEmbeddedActivations':_0x2f417d,'embeddedSegmentNameToId':_0xfa05ec,'journeyActivationNameToId':_0x258117},{..._0x15eaff,'effectiveFolderId':_0x2a9a98},_0x593202,_0x47e04b,_0x4c442c);else{ensureJourneyDefaults(_0xb5843f[_0x163973(0x22e)]);const _0x4ccaad=await _0x826b1[_0x163973(0x1ac)][_0x163973(0x1c2)](_0xb5843f);return deletePushRecovery(_0x4a4823['absolutePath']),{'action':'created','journeyId':_0x4ccaad['id'],'embeddedSegmentNameToId':_0xfa05ec};}}else{if(_0x4a4823[_0x163973(0x1e8)]&&_0x4a4823['existingJourney'])return ensureJourneyDefaults(_0xb5843f['attributes']),await _0x826b1[_0x163973(0x1ac)]['update'](_0x4a4823['existingJourney']['id'],_0xb5843f),deletePushRecovery(_0x4a4823[_0x163973(0x2a0)]),{'action':_0x163973(0x269),'journeyId':_0x4a4823[_0x163973(0x1f9)]['id'],'embeddedSegmentNameToId':_0xfa05ec};}return deletePushRecovery(_0x4a4823['absolutePath']),{'action':'unchanged','journeyId':_0x4a4823[_0x163973(0x1f9)]?.['id'],'embeddedSegmentNameToId':_0xfa05ec};}function findSegmentCriteriaLocation(_0x3d61ae,_0x18521a){const _0x3de3f1=a114_0x3e8f2e,_0x2cf218=_0x3d61ae['stages']||_0x3d61ae['journeys']?.[0x0]?.['stages']||[];let _0x232631=_0x3de3f1(0x293),_0x8d3209=_0x18521a;const _0x5bfdc9=_0x3d61ae[_0x3de3f1(0x1bd)]||_0x3d61ae[_0x3de3f1(0x1ec)]?.[0x0]?.[_0x3de3f1(0x1bd)];if(_0x5bfdc9?.[_0x3de3f1(0x1e7)]===_0x18521a)return{'stageName':_0x3de3f1(0x1bd),'criteriaName':_0x5bfdc9[_0x3de3f1(0x1f6)]||_0x18521a};_0x370932:for(const _0x3fb831 of _0x2cf218){if(_0x3fb831[_0x3de3f1(0x1be)]?.[_0x3de3f1(0x1e7)]===_0x18521a){_0x232631=_0x3fb831[_0x3de3f1(0x1f6)],_0x8d3209=_0x3fb831[_0x3de3f1(0x1be)][_0x3de3f1(0x1f6)]||_0x18521a;break;}if(_0x3fb831[_0x3de3f1(0x1a9)])for(const _0x1095f8 of _0x3fb831[_0x3de3f1(0x1a9)]){if(_0x1095f8[_0x3de3f1(0x202)]===_0x3de3f1(0x245)&&_0x1095f8[_0x3de3f1(0x291)]?.[_0x3de3f1(0x1f2)])for(const _0x18b341 of _0x1095f8[_0x3de3f1(0x291)]['branches']){if(_0x18b341[_0x3de3f1(0x1e7)]===_0x18521a){_0x232631=_0x3fb831['name'],_0x8d3209=_0x18b341[_0x3de3f1(0x1f6)]||_0x18521a;break _0x370932;}}}}return{'stageName':_0x232631,'criteriaName':_0x8d3209};}async function executeThreeStepJourneyCreate(_0x244505,_0x20b0cf,_0x21ba19,_0x1576db,_0x5bdc57,_0x22f819,_0x579118,_0x48a6d1){const _0x5008ee=a114_0x3e8f2e,{activationDefToCreateRequest:_0x403486,yamlRuleToApi:_0x32d540}=_0x48a6d1,{pendingEmbeddedSegments:_0x4f6756,pendingEmbeddedActivations:_0x267a6a,embeddedSegmentNameToId:_0x1db376}=_0x1576db,_0x1263e6=JSON[_0x5008ee(0x226)](JSON['stringify'](_0x21ba19));ensureJourneyDefaults(_0x1263e6[_0x5008ee(0x22e)]),stripPendingIds(_0x1263e6);const _0x1184bd=await _0x244505[_0x5008ee(0x1ac)][_0x5008ee(0x1c2)](_0x1263e6),_0xc67470=_0x1184bd['id'],_0x144938=new Map();for(const _0x30b7af of _0x1184bd['attributes'][_0x5008ee(0x22c)]){_0x144938[_0x5008ee(0x22a)](_0x30b7af[_0x5008ee(0x1f6)]['toLowerCase'](),_0x30b7af['id']);}recoverSegmentIdsFromPushRecovery(_0x20b0cf,_0x1db376,_0x22f819[_0x5008ee(0x20d)]);for(const [_0x41708f,{definition:_0x1d907c}]of _0x4f6756){if(_0x1db376[_0x5008ee(0x27e)](_0x41708f)){_0x579118[_0x5008ee(0x1b3)]?.({'type':_0x5008ee(0x1a6),'journeyName':_0x20b0cf[_0x5008ee(0x28f)][_0x5008ee(0x1f6)],'segmentName':_0x41708f});continue;}const _0x17bfca=generateDeterministicJourneySegmentName(_0x20b0cf['yamlConfig'][_0x5008ee(0x1f6)],_0x41708f);_0x579118[_0x5008ee(0x1b3)]?.({'type':_0x5008ee(0x1b4),'journeyName':_0x20b0cf[_0x5008ee(0x28f)][_0x5008ee(0x1f6)],'segmentName':_0x41708f});const _0x2721ba=createSegmentIdResolver(_0x22f819[_0x5008ee(0x20d)],_0x41708f),_0x33fe76=await resolveRuleSegmentIds(_0x1d907c[_0x5008ee(0x1a4)],_0x2721ba),_0x37497d=await createOrRecoverEmbeddedSegment(_0x244505,_0x20b0cf,{'localName':_0x41708f,'uniqueSegmentName':_0x17bfca,'description':_0x1d907c['description']||'Entry\x20criteria:\x20'+_0x41708f,'journeyId':_0xc67470,'resolvedRule':_0x33fe76,'parentId':_0x5bdc57[_0x5008ee(0x297)],'folderId':_0x5bdc57['effectiveFolderId']||''},_0x32d540);_0x1db376[_0x5008ee(0x22a)](_0x41708f,_0x37497d),_0x22f819[_0x5008ee(0x20d)][_0x5008ee(0x22a)](_0x41708f,_0x37497d),_0x579118[_0x5008ee(0x1b3)]?.({'type':'embedded_segment_created','journeyName':_0x20b0cf[_0x5008ee(0x28f)][_0x5008ee(0x1f6)],'segmentName':_0x41708f});}const _0x156820=new Map();for(const [_0x57515d,_0x57b155]of _0x267a6a){_0x579118['onProgress']?.({'type':_0x5008ee(0x26f),'journeyName':_0x20b0cf[_0x5008ee(0x28f)][_0x5008ee(0x1f6)],'activationName':_0x57515d});const _0x4212f2=await _0x403486(_0x57b155,_0x22f819[_0x5008ee(0x279)]),_0x5373a7={..._0x4212f2,..._0x57b155[_0x5008ee(0x208)]!==undefined&&{'runAfterJourneyRefresh':_0x57b155['run_after_journey_refresh']}},_0x1e8ad9=await _0x244505[_0x5008ee(0x1ac)][_0x5008ee(0x21d)](_0xc67470,_0x5373a7);_0x156820[_0x5008ee(0x22a)](_0x57515d,_0x1e8ad9['id']),_0x1576db[_0x5008ee(0x1af)][_0x5008ee(0x22a)](_0x57515d,_0x1e8ad9['id']),_0x579118[_0x5008ee(0x1b3)]?.({'type':_0x5008ee(0x247),'journeyName':_0x20b0cf[_0x5008ee(0x28f)][_0x5008ee(0x1f6)],'activationName':_0x57515d});}const _0x427989=JSON[_0x5008ee(0x226)](JSON['stringify'](_0x21ba19));return _0x427989['id']=_0xc67470,ensureJourneyDefaults(_0x427989[_0x5008ee(0x22e)]),resolvePendingIdsInRequest(_0x427989,_0x21ba19,_0x144938,_0x1db376,_0x156820,_0x579118),await _0x244505[_0x5008ee(0x1ac)][_0x5008ee(0x1ed)](_0xc67470,_0x427989),deletePushRecovery(_0x20b0cf[_0x5008ee(0x2a0)]),{'action':_0x5008ee(0x24a),'journeyId':_0xc67470,'embeddedSegmentNameToId':_0x1db376};}export function stripWaitStepPendingIds(_0x329dce){const _0xf935f=a114_0x3e8f2e,_0x30d9e2=_0x329dce[_0xf935f(0x231)]&&isPendingSegmentId(_0x329dce[_0xf935f(0x231)]),_0x4f6faf=_0x329dce[_0xf935f(0x204)]?.[_0xf935f(0x25c)](_0x2c7f49=>_0x2c7f49[_0xf935f(0x294)]&&isPendingSegmentId(_0x2c7f49[_0xf935f(0x294)]));(_0x30d9e2||_0x4f6faf)&&(_0x329dce[_0xf935f(0x27f)]=_0xf935f(0x25a),_0x329dce[_0xf935f(0x1bc)]=0x1,_0x329dce[_0xf935f(0x2a1)]='day',delete _0x329dce[_0xf935f(0x231)],delete _0x329dce['conditionTimeoutDuration'],delete _0x329dce['conditionTimeoutUnit'],delete _0x329dce['conditions']);}export function resolveWaitStepPendingIds(_0x670d89,_0x33b22b,_0x1b9655,_0x44e559){const _0x5de4b6=a114_0x3e8f2e;if(_0x33b22b[_0x5de4b6(0x231)]&&isPendingSegmentId(_0x33b22b[_0x5de4b6(0x231)])){const _0x56b47f=_0x1b9655(_0x33b22b['conditionSegmentId'],_0x5de4b6(0x1fb)+_0x44e559+_0x5de4b6(0x1c3));_0x56b47f&&(_0x670d89['waitStepType']=_0x5de4b6(0x1d0),_0x670d89['conditionSegmentId']=_0x56b47f,delete _0x670d89[_0x5de4b6(0x1bc)],delete _0x670d89['waitStepUnit'],_0x33b22b['conditionTimeoutDuration']!==undefined&&(_0x670d89[_0x5de4b6(0x1eb)]=_0x33b22b['conditionTimeoutDuration']),_0x33b22b[_0x5de4b6(0x1c6)]&&(_0x670d89[_0x5de4b6(0x1c6)]=_0x33b22b[_0x5de4b6(0x1c6)]));}if(_0x33b22b[_0x5de4b6(0x204)]){const _0x1eb0b2=_0x33b22b['conditions']['some'](_0x33ba4b=>_0x33ba4b[_0x5de4b6(0x294)]&&isPendingSegmentId(_0x33ba4b[_0x5de4b6(0x294)]));if(_0x1eb0b2){const _0x2856ea=_0x33b22b[_0x5de4b6(0x204)][_0x5de4b6(0x1fe)](_0x37f517=>{const _0x3430bb=_0x5de4b6;if(_0x37f517[_0x3430bb(0x294)]&&isPendingSegmentId(_0x37f517[_0x3430bb(0x294)])){const _0x1b64a3=_0x1b9655(_0x37f517[_0x3430bb(0x294)],'stage\x20\x27'+_0x44e559+_0x3430bb(0x1c3));return{..._0x37f517,'segmentId':_0x1b64a3||_0x37f517[_0x3430bb(0x294)]};}return{..._0x37f517};});_0x670d89['waitStepType']=_0x5de4b6(0x1d0),_0x670d89[_0x5de4b6(0x204)]=_0x2856ea,delete _0x670d89[_0x5de4b6(0x1bc)],delete _0x670d89[_0x5de4b6(0x2a1)],delete _0x670d89[_0x5de4b6(0x231)],delete _0x670d89[_0x5de4b6(0x1eb)],delete _0x670d89[_0x5de4b6(0x1c6)];}}}function stripPendingIds(_0x4111a9){const _0x53b14f=a114_0x3e8f2e;_0x4111a9[_0x53b14f(0x22e)]['goal']?.[_0x53b14f(0x294)]&&isPendingSegmentId(_0x4111a9[_0x53b14f(0x22e)][_0x53b14f(0x1bd)][_0x53b14f(0x294)])&&delete _0x4111a9['attributes'][_0x53b14f(0x1bd)];for(const _0x2f8212 of _0x4111a9[_0x53b14f(0x22e)][_0x53b14f(0x22c)]||[]){_0x2f8212['entryCriteria']?.[_0x53b14f(0x294)]&&isPendingSegmentId(_0x2f8212[_0x53b14f(0x228)][_0x53b14f(0x294)])&&delete _0x2f8212[_0x53b14f(0x228)];_0x2f8212[_0x53b14f(0x20f)]?.['segmentId']&&isPendingSegmentId(_0x2f8212[_0x53b14f(0x20f)]['segmentId'])&&delete _0x2f8212[_0x53b14f(0x20f)];_0x2f8212[_0x53b14f(0x203)]&&(_0x2f8212[_0x53b14f(0x203)]=_0x2f8212['exitCriterias'][_0x53b14f(0x29e)](_0x4e6192=>!_0x4e6192[_0x53b14f(0x294)]||!isPendingSegmentId(_0x4e6192[_0x53b14f(0x294)])));if(_0x2f8212[_0x53b14f(0x1a9)])for(const _0x5a57de of Object[_0x53b14f(0x217)](_0x2f8212[_0x53b14f(0x1a9)])){const _0x59a389=_0x2f8212[_0x53b14f(0x1a9)][_0x5a57de];_0x59a389[_0x53b14f(0x202)]===_0x53b14f(0x223)&&_0x59a389[_0x53b14f(0x233)]&&isPendingActivationId(_0x59a389[_0x53b14f(0x233)])&&(_0x59a389[_0x53b14f(0x233)]='');if(_0x59a389[_0x53b14f(0x202)]===_0x53b14f(0x26b)&&_0x59a389[_0x53b14f(0x1f2)])for(const _0x3da636 of _0x59a389[_0x53b14f(0x1f2)]){_0x3da636[_0x53b14f(0x294)]&&isPendingSegmentId(_0x3da636['segmentId'])&&(_0x3da636[_0x53b14f(0x294)]='');}_0x59a389[_0x53b14f(0x202)]===_0x53b14f(0x23f)&&stripWaitStepPendingIds(_0x59a389);}}}function resolvePendingIdsInRequest(_0x2840ff,_0x4cae86,_0x4d532b,_0x23ec24,_0x700b16,_0x1b4a3e){const _0x5e56e0=a114_0x3e8f2e,_0x514cf0=(_0x24a568,_0x52ba8c)=>{const _0x3b9a43=a114_0x3785;if(!isPendingSegmentId(_0x24a568))return _0x24a568;const _0x20be58=extractPendingSegmentName(_0x24a568),_0x47c566=_0x23ec24['get'](_0x20be58);return!_0x47c566&&_0x1b4a3e[_0x3b9a43(0x21b)]?.(_0x3b9a43(0x249)+_0x20be58+'\x27\x20for\x20'+_0x52ba8c),_0x47c566;};if(_0x2840ff[_0x5e56e0(0x22e)][_0x5e56e0(0x1bd)]?.[_0x5e56e0(0x294)]&&isPendingSegmentId(_0x2840ff['attributes'][_0x5e56e0(0x1bd)][_0x5e56e0(0x294)])){const _0x41edd2=_0x514cf0(_0x2840ff[_0x5e56e0(0x22e)][_0x5e56e0(0x1bd)][_0x5e56e0(0x294)],_0x5e56e0(0x27b));_0x41edd2&&(_0x2840ff[_0x5e56e0(0x22e)][_0x5e56e0(0x1bd)][_0x5e56e0(0x294)]=_0x41edd2);}for(const _0x314ec0 of _0x2840ff[_0x5e56e0(0x22e)]['journeyStages']||[]){const _0x4de1bf=_0x4d532b[_0x5e56e0(0x1f1)](_0x314ec0[_0x5e56e0(0x1f6)]['toLowerCase']());_0x4de1bf&&(_0x314ec0['id']=_0x4de1bf);if(_0x314ec0[_0x5e56e0(0x228)]?.['segmentId']&&isPendingSegmentId(_0x314ec0[_0x5e56e0(0x228)][_0x5e56e0(0x294)])){const _0x39f8aa=_0x514cf0(_0x314ec0[_0x5e56e0(0x228)][_0x5e56e0(0x294)],'stage\x20\x27'+_0x314ec0[_0x5e56e0(0x1f6)]+'\x27\x20entry\x20criteria');_0x39f8aa&&(_0x314ec0[_0x5e56e0(0x228)]['segmentId']=_0x39f8aa);}if(_0x314ec0[_0x5e56e0(0x203)])for(const _0x27e90a of _0x314ec0[_0x5e56e0(0x203)]){if(_0x27e90a[_0x5e56e0(0x294)]&&isPendingSegmentId(_0x27e90a[_0x5e56e0(0x294)])){const _0x177ecd=_0x514cf0(_0x27e90a['segmentId'],_0x5e56e0(0x1fb)+_0x314ec0[_0x5e56e0(0x1f6)]+_0x5e56e0(0x253));_0x177ecd&&(_0x27e90a[_0x5e56e0(0x294)]=_0x177ecd);}}if(_0x314ec0['milestone']?.[_0x5e56e0(0x294)]&&isPendingSegmentId(_0x314ec0[_0x5e56e0(0x20f)][_0x5e56e0(0x294)])){const _0x27fef5=_0x514cf0(_0x314ec0[_0x5e56e0(0x20f)][_0x5e56e0(0x294)],_0x5e56e0(0x1fb)+_0x314ec0[_0x5e56e0(0x1f6)]+_0x5e56e0(0x250));_0x27fef5&&(_0x314ec0['milestone']['segmentId']=_0x27fef5);}if(_0x314ec0[_0x5e56e0(0x1a9)]){const _0x194264=_0xff5afc=>_0x4cae86['attributes']['journeyStages']?.[_0x5e56e0(0x1f4)](_0x392427=>_0x392427[_0x5e56e0(0x1f6)]['toLowerCase']()===_0x314ec0[_0x5e56e0(0x1f6)][_0x5e56e0(0x27c)]())?.[_0x5e56e0(0x1a9)]?.[_0xff5afc];for(const _0x580735 of Object['keys'](_0x314ec0[_0x5e56e0(0x1a9)])){const _0x14d194=_0x314ec0[_0x5e56e0(0x1a9)][_0x580735],_0xf59cb1=_0x194264(_0x580735);if(_0x14d194[_0x5e56e0(0x202)]===_0x5e56e0(0x223)&&_0x14d194[_0x5e56e0(0x233)]&&(isPendingActivationId(_0x14d194['journeyActivationStepId'])||_0x14d194[_0x5e56e0(0x233)]==='')){if(_0xf59cb1?.[_0x5e56e0(0x233)]&&isPendingActivationId(_0xf59cb1[_0x5e56e0(0x233)])){const _0x4759a0=extractPendingActivationName(_0xf59cb1[_0x5e56e0(0x233)]),_0x4e4523=_0x700b16[_0x5e56e0(0x1f1)](_0x4759a0);_0x4e4523&&(_0x14d194[_0x5e56e0(0x233)]=_0x4e4523);}}if(_0x14d194[_0x5e56e0(0x202)]==='DecisionPoint'&&_0x14d194[_0x5e56e0(0x1f2)]&&_0xf59cb1?.['branches'])for(let _0x1a77f6=0x0;_0x1a77f6<_0x14d194['branches']['length'];_0x1a77f6++){const _0x2cd4a5=_0x14d194[_0x5e56e0(0x1f2)][_0x1a77f6],_0x4cf68b=_0xf59cb1[_0x5e56e0(0x1f2)][_0x1a77f6];if(_0x4cf68b?.[_0x5e56e0(0x294)]&&isPendingSegmentId(_0x4cf68b['segmentId'])){const _0xa1201=_0x514cf0(_0x4cf68b[_0x5e56e0(0x294)],_0x5e56e0(0x1fb)+_0x314ec0[_0x5e56e0(0x1f6)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x2cd4a5[_0x5e56e0(0x1f6)]||_0x1a77f6)+'\x27');_0xa1201&&(_0x2cd4a5[_0x5e56e0(0x294)]=_0xa1201);}}_0x14d194['type']===_0x5e56e0(0x23f)&&_0xf59cb1?.[_0x5e56e0(0x202)]===_0x5e56e0(0x23f)&&resolveWaitStepPendingIds(_0x14d194,_0xf59cb1,_0x514cf0,_0x314ec0[_0x5e56e0(0x1f6)]);}}}}
@@ -1 +1 @@
1
- function a115_0x189e(){const _0x494e93=['2300435hIJsKs','1827720LRDAMg','has','294tBgvhE','set','610722cEczbC','158ftUxVv','737PyoVvz','10533srZTjz','parentFolderId','69669TxHtDE','name','141990xgiiiV','4CyKhkM','add','16332veqSmy','get'];a115_0x189e=function(){return _0x494e93;};return a115_0x189e();}(function(_0x4efe9f,_0x3e80c2){const _0x52aca8=a115_0xaa8f,_0x57cda5=_0x4efe9f();while(!![]){try{const _0x29cdd8=parseInt(_0x52aca8(0xe8))/0x1+-parseInt(_0x52aca8(0xe4))/0x2*(-parseInt(_0x52aca8(0xe6))/0x3)+parseInt(_0x52aca8(0xeb))/0x4*(parseInt(_0x52aca8(0xef))/0x5)+-parseInt(_0x52aca8(0xed))/0x6*(-parseInt(_0x52aca8(0xf2))/0x7)+parseInt(_0x52aca8(0xf0))/0x8+parseInt(_0x52aca8(0xe3))/0x9+parseInt(_0x52aca8(0xea))/0xa*(-parseInt(_0x52aca8(0xe5))/0xb);if(_0x29cdd8===_0x3e80c2)break;else _0x57cda5['push'](_0x57cda5['shift']());}catch(_0x14a0ed){_0x57cda5['push'](_0x57cda5['shift']());}}}(a115_0x189e,0x410c7));export function buildFolderIdToPathMap(_0x17a8a1){const _0x22b342=a115_0xaa8f,_0x464a80=new Map(),_0x55167f=new Map();for(const _0x55f017 of _0x17a8a1){_0x55167f['set'](_0x55f017['id'],_0x55f017);}const _0x1e3614=new Set();for(const _0x1b1d2a of _0x17a8a1){!_0x1b1d2a[_0x22b342(0xe7)]&&_0x1e3614['add'](_0x1b1d2a['id']);}function _0x1de087(_0x46b3b4){const _0x8ccfd4=_0x22b342;if(_0x464a80['has'](_0x46b3b4['id']))return _0x464a80[_0x8ccfd4(0xee)](_0x46b3b4['id']);if(_0x1e3614['has'](_0x46b3b4['id']))return _0x464a80[_0x8ccfd4(0xe2)](_0x46b3b4['id'],''),'';if(_0x46b3b4['parentFolderId']){const _0x2b1ed6=_0x55167f['get'](_0x46b3b4[_0x8ccfd4(0xe7)]);if(_0x2b1ed6){const _0x13ed57=_0x1de087(_0x2b1ed6),_0xbd9445=_0x13ed57?_0x13ed57+'/'+_0x46b3b4['name']:_0x46b3b4[_0x8ccfd4(0xe9)];return _0x464a80['set'](_0x46b3b4['id'],_0xbd9445),_0xbd9445;}}const _0x1069ce=_0x46b3b4['name'];return _0x464a80[_0x8ccfd4(0xe2)](_0x46b3b4['id'],_0x1069ce),_0x1069ce;}for(const _0xf405e2 of _0x17a8a1){_0x1de087(_0xf405e2);}return _0x464a80;}export function buildFolderPathToIdMap(_0x5ae033){const _0x53408f=a115_0xaa8f,_0x4a8f98=new Map(),_0x3be258=new Map();for(const _0x1ee29f of _0x5ae033){_0x3be258[_0x53408f(0xe2)](_0x1ee29f['id'],_0x1ee29f);}const _0x12148a=new Set();for(const _0x546a35 of _0x5ae033){!_0x546a35['parentFolderId']&&_0x12148a[_0x53408f(0xec)](_0x546a35['id']);}function _0x3bf407(_0x2bb766){const _0x460e78=_0x53408f;if(_0x12148a[_0x460e78(0xf1)](_0x2bb766['id']))return'';if(_0x2bb766[_0x460e78(0xe7)]){const _0xfce965=_0x3be258[_0x460e78(0xee)](_0x2bb766[_0x460e78(0xe7)]);if(_0xfce965){const _0x5f1100=_0x3bf407(_0xfce965);return _0x5f1100?_0x5f1100+'/'+_0x2bb766[_0x460e78(0xe9)]:_0x2bb766[_0x460e78(0xe9)];}}return _0x2bb766[_0x460e78(0xe9)];}for(const _0x5f5663 of _0x5ae033){const _0x7ea57f=_0x3bf407(_0x5f5663);_0x4a8f98[_0x53408f(0xe2)](_0x7ea57f,_0x5f5663['id']);}return _0x4a8f98;}function a115_0xaa8f(_0x25d17d,_0x5f204e){_0x25d17d=_0x25d17d-0xe2;const _0x189efb=a115_0x189e();let _0xaa8f15=_0x189efb[_0x25d17d];return _0xaa8f15;}export function buildFolderMaps(_0x4aea84){const _0x5def92=a115_0xaa8f,_0x2b3b6b=buildFolderIdToPathMap(_0x4aea84),_0x26a1f3=new Map();for(const [_0x5d0cbb,_0x353ace]of _0x2b3b6b){_0x26a1f3[_0x5def92(0xe2)](_0x353ace,_0x5d0cbb);}return{'idToPath':_0x2b3b6b,'pathToId':_0x26a1f3};}export function getFolderPath(_0x1508bb,_0x43347a){const _0x1d65e5=a115_0xaa8f;if(!_0x1508bb)return'';return _0x43347a[_0x1d65e5(0xee)](_0x1508bb)??'';}
1
+ (function(_0x511c05,_0x29dd9d){const _0x599844=a115_0x1215,_0x902d0=_0x511c05();while(!![]){try{const _0x3ac24f=-parseInt(_0x599844(0x7f))/0x1*(parseInt(_0x599844(0x7e))/0x2)+-parseInt(_0x599844(0x77))/0x3+-parseInt(_0x599844(0x7c))/0x4*(parseInt(_0x599844(0x7d))/0x5)+-parseInt(_0x599844(0x78))/0x6+-parseInt(_0x599844(0x73))/0x7*(-parseInt(_0x599844(0x80))/0x8)+-parseInt(_0x599844(0x82))/0x9+parseInt(_0x599844(0x81))/0xa*(parseInt(_0x599844(0x74))/0xb);if(_0x3ac24f===_0x29dd9d)break;else _0x902d0['push'](_0x902d0['shift']());}catch(_0x4fa887){_0x902d0['push'](_0x902d0['shift']());}}}(a115_0x5531,0x3d8f8));export function buildFolderIdToPathMap(_0x235a2c){const _0x440ee6=a115_0x1215,_0x36ea63=new Map(),_0x5259cd=new Map();for(const _0x58795a of _0x235a2c){_0x5259cd[_0x440ee6(0x7a)](_0x58795a['id'],_0x58795a);}const _0x2b4ec9=new Set();for(const _0x238c36 of _0x235a2c){!_0x238c36[_0x440ee6(0x83)]&&_0x2b4ec9[_0x440ee6(0x76)](_0x238c36['id']);}function _0x5d83ef(_0x1eda53){const _0x42b959=_0x440ee6;if(_0x36ea63[_0x42b959(0x75)](_0x1eda53['id']))return _0x36ea63[_0x42b959(0x7b)](_0x1eda53['id']);if(_0x2b4ec9[_0x42b959(0x75)](_0x1eda53['id']))return _0x36ea63[_0x42b959(0x7a)](_0x1eda53['id'],''),'';if(_0x1eda53[_0x42b959(0x83)]){const _0x30d199=_0x5259cd[_0x42b959(0x7b)](_0x1eda53[_0x42b959(0x83)]);if(_0x30d199){const _0xeea89=_0x5d83ef(_0x30d199),_0x492398=_0xeea89?_0xeea89+'/'+_0x1eda53[_0x42b959(0x79)]:_0x1eda53['name'];return _0x36ea63[_0x42b959(0x7a)](_0x1eda53['id'],_0x492398),_0x492398;}}const _0x2a61c7=_0x1eda53['name'];return _0x36ea63['set'](_0x1eda53['id'],_0x2a61c7),_0x2a61c7;}for(const _0x3130ae of _0x235a2c){_0x5d83ef(_0x3130ae);}return _0x36ea63;}function a115_0x1215(_0x310c94,_0x1e289c){_0x310c94=_0x310c94-0x73;const _0x5531b2=a115_0x5531();let _0x121533=_0x5531b2[_0x310c94];return _0x121533;}export function buildFolderPathToIdMap(_0x2691c3){const _0x148964=a115_0x1215,_0xbfad3b=new Map(),_0x3f0dd8=new Map();for(const _0x8a8510 of _0x2691c3){_0x3f0dd8['set'](_0x8a8510['id'],_0x8a8510);}const _0x449695=new Set();for(const _0x54b382 of _0x2691c3){!_0x54b382[_0x148964(0x83)]&&_0x449695[_0x148964(0x76)](_0x54b382['id']);}function _0x56b09d(_0x22e949){const _0x4145fa=_0x148964;if(_0x449695['has'](_0x22e949['id']))return'';if(_0x22e949[_0x4145fa(0x83)]){const _0x468d6a=_0x3f0dd8[_0x4145fa(0x7b)](_0x22e949[_0x4145fa(0x83)]);if(_0x468d6a){const _0xf4502d=_0x56b09d(_0x468d6a);return _0xf4502d?_0xf4502d+'/'+_0x22e949[_0x4145fa(0x79)]:_0x22e949[_0x4145fa(0x79)];}}return _0x22e949[_0x4145fa(0x79)];}for(const _0x3b5f40 of _0x2691c3){const _0x3c716d=_0x56b09d(_0x3b5f40);_0xbfad3b['set'](_0x3c716d,_0x3b5f40['id']);}return _0xbfad3b;}function a115_0x5531(){const _0x3a36fe=['2aPbfsc','60981FbnGsn','1856gkwNyQ','5723130NCExBJ','757044yGuTgz','parentFolderId','9884htafWQ','11iTueaG','has','add','868254IdTeUa','830454RpZSSp','name','set','get','4kDbvbr','374105jxRSdl'];a115_0x5531=function(){return _0x3a36fe;};return a115_0x5531();}export function buildFolderMaps(_0x491f47){const _0x200dd9=buildFolderIdToPathMap(_0x491f47),_0x18945c=new Map();for(const [_0x12a15a,_0x52a57d]of _0x200dd9){_0x18945c['set'](_0x52a57d,_0x12a15a);}return{'idToPath':_0x200dd9,'pathToId':_0x18945c};}export function getFolderPath(_0x93c491,_0x32ef90){const _0x3a81b7=a115_0x1215;if(!_0x93c491)return'';return _0x32ef90[_0x3a81b7(0x7b)](_0x93c491)??'';}
@@ -1 +1 @@
1
- (function(_0x32bf59,_0x105842){const _0x1a6745=a116_0x1f97,_0x3d9633=_0x32bf59();while(!![]){try{const _0x2f6923=parseInt(_0x1a6745(0x14b))/0x1*(-parseInt(_0x1a6745(0x14e))/0x2)+parseInt(_0x1a6745(0x164))/0x3+-parseInt(_0x1a6745(0x162))/0x4*(parseInt(_0x1a6745(0x174))/0x5)+parseInt(_0x1a6745(0x167))/0x6+-parseInt(_0x1a6745(0x16c))/0x7*(-parseInt(_0x1a6745(0x171))/0x8)+parseInt(_0x1a6745(0x16b))/0x9*(-parseInt(_0x1a6745(0x148))/0xa)+parseInt(_0x1a6745(0x175))/0xb;if(_0x2f6923===_0x105842)break;else _0x3d9633['push'](_0x3d9633['shift']());}catch(_0x16b1b1){_0x3d9633['push'](_0x3d9633['shift']());}}}(a116_0x57c6,0x65f2c));import a116_0x4c0fcb from'path';import{parse as a116_0x390d8e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5a71ed){const _0x255e5c=a116_0x1f97;if(!_0x5a71ed||_0x5a71ed[_0x255e5c(0x155)]()==='')throw new Error(_0x255e5c(0x15e));const _0x3b67fb=_0x5a71ed[_0x255e5c(0x155)]();if(_0x3b67fb==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5a71ed};const _0x287629=_0x3b67fb[_0x255e5c(0x173)]('/')?_0x3b67fb[_0x255e5c(0x156)](0x1):_0x3b67fb,_0x2ae995=_0x287629[_0x255e5c(0x151)]('/')[_0x255e5c(0x14f)](_0x36819d=>_0x36819d!=='');if(_0x2ae995[_0x255e5c(0x15d)]===0x0)throw new Error(_0x255e5c(0x149));const _0x3a0833=_0x3b67fb[_0x255e5c(0x173)]('/')||!isRelativePathSegment(_0x2ae995[0x0]);for(const _0x51c584 of _0x2ae995){validatePathSegment(_0x51c584);}return{'segments':_0x2ae995,'isAbsolute':_0x3a0833,'raw':_0x5a71ed};}function a116_0x57c6(){const _0x479c2c=['36mzyHmF','14WWcEec','relative','root','Cannot\x20navigate\x20above\x20root','type','1190064jBqmbK','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','startsWith','5VzEhaG','4224209gbJmQO','raw','Cannot\x20split\x20empty\x20path','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','slice','1655480wlpEZB','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','endsWith','250919trRGSb','test','join','2wgFYdo','filter','Path\x20segment\x20cannot\x20be\x20empty','split','push','exists','segments','trim','substring','Path\x20attempts\x20to\x20navigate\x20above\x20root','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','dirname','readFile','parent_segment','pop','length','Path\x20cannot\x20be\x20empty','File\x20not\x20found:\x20','journey','resolve','2180080ymRbFO','replace','2346243LwuXPk','tdx.json','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','2472570cJlIIs','segment','parse','isAbsolute'];a116_0x57c6=function(){return _0x479c2c;};return a116_0x57c6();}function isRelativePathSegment(_0x48b6aa){return _0x48b6aa==='.'||_0x48b6aa==='..';}function validatePathSegment(_0x35aaf9){const _0x49cbe8=a116_0x1f97;if(_0x35aaf9==='')throw new Error(_0x49cbe8(0x150));if(_0x35aaf9==='.'||_0x35aaf9==='..')return;if(/[\x00-\x1F\x7F]/[_0x49cbe8(0x14c)](_0x35aaf9))throw new Error(_0x49cbe8(0x146)+_0x35aaf9);if(_0x35aaf9!==_0x35aaf9[_0x49cbe8(0x155)]()){}}export function validatePath(_0x5d2afd){const _0x284c3d=a116_0x1f97;if(_0x5d2afd[_0x284c3d(0x154)][_0x284c3d(0x15d)]===0x0&&!_0x5d2afd[_0x284c3d(0x16a)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x5d2afd[_0x284c3d(0x16a)]){if(_0x5d2afd[_0x284c3d(0x154)][0x0]==='..')throw new Error(_0x284c3d(0x158));let _0x170b23=0x0;for(const _0x599e95 of _0x5d2afd[_0x284c3d(0x154)]){if(_0x599e95==='..'){if(_0x170b23===0x0)throw new Error(_0x284c3d(0x157));_0x170b23--;}else _0x599e95!=='.'&&_0x170b23++;}}}function a116_0x1f97(_0x4b166b,_0x3d82e5){_0x4b166b=_0x4b166b-0x146;const _0x57c60a=a116_0x57c6();let _0x1f973a=_0x57c60a[_0x4b166b];return _0x1f973a;}export function joinPaths(_0x41b5ea,_0x3d8f2f){const _0x1f2be1=a116_0x1f97;if(!_0x41b5ea||_0x41b5ea==='/')return _0x3d8f2f;if(!_0x3d8f2f||_0x3d8f2f==='.')return _0x41b5ea;if(_0x3d8f2f[_0x1f2be1(0x173)]('/'))return _0x3d8f2f;const _0x112cbf=parsePath(_0x41b5ea),_0x4f4b2d=parsePath(_0x3d8f2f),_0x3f8646=[..._0x112cbf[_0x1f2be1(0x154)]];for(const _0x6746c6 of _0x4f4b2d[_0x1f2be1(0x154)]){if(_0x6746c6==='.')continue;else{if(_0x6746c6==='..'){if(_0x3f8646[_0x1f2be1(0x15d)]===0x0)throw new Error(_0x1f2be1(0x16f));_0x3f8646['pop']();}else _0x3f8646[_0x1f2be1(0x152)](_0x6746c6);}}const _0x370a21=_0x3f8646[_0x1f2be1(0x14d)]('/');return _0x112cbf[_0x1f2be1(0x176)][_0x1f2be1(0x173)]('/')?'/'+_0x370a21:_0x370a21;}export function normalizePath(_0x208f75){const _0x505126=a116_0x1f97,_0x230994=parsePath(_0x208f75),_0x5e3f26=[];for(const _0x14c96f of _0x230994[_0x505126(0x154)]){if(_0x14c96f==='.')continue;else{if(_0x14c96f==='..'){if(_0x5e3f26[_0x505126(0x15d)]===0x0){if(_0x230994[_0x505126(0x16a)])throw new Error(_0x505126(0x16f));_0x5e3f26[_0x505126(0x152)]('..');}else _0x5e3f26[_0x5e3f26[_0x505126(0x15d)]-0x1]==='..'?_0x5e3f26[_0x505126(0x152)]('..'):_0x5e3f26[_0x505126(0x15c)]();}else _0x5e3f26[_0x505126(0x152)](_0x14c96f);}}if(_0x5e3f26[_0x505126(0x15d)]===0x0)return _0x230994['isAbsolute']?'/':'.';const _0x552133=_0x5e3f26[_0x505126(0x14d)]('/');return _0x230994[_0x505126(0x176)]['startsWith']('/')?'/'+_0x552133:_0x552133;}export function getParentPath(_0x28442c){const _0x47e9e4=a116_0x1f97,_0x6eb49e=parsePath(_0x28442c);if(_0x6eb49e['segments'][_0x47e9e4(0x15d)]<=0x1)return'/';const _0x453aa7=_0x6eb49e['segments'][_0x47e9e4(0x147)](0x0,-0x1)[_0x47e9e4(0x14d)]('/');return _0x6eb49e[_0x47e9e4(0x176)][_0x47e9e4(0x173)]('/')?'/'+_0x453aa7:_0x453aa7;}export function getBaseName(_0x2164b1){const _0xbac92d=a116_0x1f97,_0x2395eb=parsePath(_0x2164b1);return _0x2395eb[_0xbac92d(0x154)][_0x2395eb['segments'][_0xbac92d(0x15d)]-0x1]||'';}export function isChildPath(_0x4ccedd,_0x5a9963){const _0x3fb8f6=a116_0x1f97,_0x268a29=parsePath(_0x4ccedd),_0x454086=parsePath(_0x5a9963);if(_0x268a29[_0x3fb8f6(0x154)][_0x3fb8f6(0x15d)]<=_0x454086[_0x3fb8f6(0x154)][_0x3fb8f6(0x15d)])return![];for(let _0x583cbc=0x0;_0x583cbc<_0x454086[_0x3fb8f6(0x154)][_0x3fb8f6(0x15d)];_0x583cbc++){if(_0x268a29[_0x3fb8f6(0x154)][_0x583cbc]!==_0x454086[_0x3fb8f6(0x154)][_0x583cbc])return![];}return!![];}export function splitPath(_0x1f17e7){const _0x1ffd82=a116_0x1f97,_0x4bbc16=parsePath(_0x1f17e7);if(_0x4bbc16['segments'][_0x1ffd82(0x15d)]===0x0)throw new Error(_0x1ffd82(0x177));if(_0x4bbc16[_0x1ffd82(0x154)][_0x1ffd82(0x15d)]===0x1)return{'parent':_0x4bbc16[_0x1ffd82(0x154)][0x0]};return{'parent':_0x4bbc16[_0x1ffd82(0x154)][0x0],'child':_0x4bbc16[_0x1ffd82(0x154)][_0x1ffd82(0x147)](0x1)['join']('/')};}export function isYamlFilePath(_0x4f0ea7){const _0x4798cd=a116_0x1f97;return _0x4f0ea7[_0x4798cd(0x14a)]('.yml')||_0x4f0ea7[_0x4798cd(0x14a)]('.yaml');}export async function resolveYamlFilePath(_0x2944d3,_0xb4dac3=nodeFileSystem){const _0x1a2d9e=a116_0x1f97,_0x3e44fd=a116_0x4c0fcb[_0x1a2d9e(0x161)](_0x2944d3);if(!await _0xb4dac3[_0x1a2d9e(0x153)](_0x3e44fd))throw new Error(_0x1a2d9e(0x15f)+_0x2944d3);let _0x19ac91=a116_0x4c0fcb[_0x1a2d9e(0x159)](_0x3e44fd),_0x19932f=null,_0x4f3e84=null;const _0x4e6184=a116_0x4c0fcb['parse'](_0x19ac91)[_0x1a2d9e(0x16e)];while(_0x19ac91!==_0x4e6184){const _0x190de6=a116_0x4c0fcb[_0x1a2d9e(0x14d)](_0x19ac91,_0x1a2d9e(0x165));if(await _0xb4dac3[_0x1a2d9e(0x153)](_0x190de6)){_0x19932f=_0x190de6,_0x4f3e84=_0x19ac91;break;}_0x19ac91=a116_0x4c0fcb[_0x1a2d9e(0x159)](_0x19ac91);}if(!_0x19932f||!_0x4f3e84)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x2944d3);const _0x542bc3=await _0xb4dac3['readFile'](_0x19932f),_0x4ec4c9=JSON[_0x1a2d9e(0x169)](_0x542bc3),_0x1d44b6=_0x4ec4c9[_0x1a2d9e(0x15b)];if(!_0x1d44b6)throw new Error(_0x1a2d9e(0x172));const _0xb3765d=await _0xb4dac3[_0x1a2d9e(0x15a)](_0x3e44fd),_0x5a33fd=a116_0x390d8e(_0xb3765d),_0x57fbe2=_0x5a33fd['name'];if(!_0x57fbe2)throw new Error(_0x1a2d9e(0x166)+_0x2944d3);const _0x21ca5f=_0x5a33fd[_0x1a2d9e(0x170)]===_0x1a2d9e(0x160)?_0x1a2d9e(0x160):_0x1a2d9e(0x168),_0x23ed02=a116_0x4c0fcb[_0x1a2d9e(0x16d)](_0x4f3e84,_0x3e44fd),_0x40adc3=a116_0x4c0fcb[_0x1a2d9e(0x159)](_0x23ed02),_0x579f12=_0x40adc3==='.'?'':_0x40adc3[_0x1a2d9e(0x163)](/\\/g,'/'),_0xfce33b=_0x579f12?_0x1d44b6+'/'+_0x579f12+'/'+_0x57fbe2:_0x1d44b6+'/'+_0x57fbe2;return{'parentSegment':_0x1d44b6,'segmentName':_0x57fbe2,'folderPath':_0x579f12,'fullPath':_0xfce33b,'resourceType':_0x21ca5f};}
1
+ (function(_0x263ed1,_0x5f49df){const _0x36a3d6=a116_0x71ea,_0x3d5db0=_0x263ed1();while(!![]){try{const _0x44ca46=-parseInt(_0x36a3d6(0x105))/0x1*(parseInt(_0x36a3d6(0xe7))/0x2)+-parseInt(_0x36a3d6(0xf3))/0x3*(-parseInt(_0x36a3d6(0xef))/0x4)+-parseInt(_0x36a3d6(0x103))/0x5*(-parseInt(_0x36a3d6(0x10c))/0x6)+-parseInt(_0x36a3d6(0xe9))/0x7+-parseInt(_0x36a3d6(0xf5))/0x8+-parseInt(_0x36a3d6(0x104))/0x9+parseInt(_0x36a3d6(0xf6))/0xa;if(_0x44ca46===_0x5f49df)break;else _0x3d5db0['push'](_0x3d5db0['shift']());}catch(_0x147cb3){_0x3d5db0['push'](_0x3d5db0['shift']());}}}(a116_0x4c42,0x24f35));import a116_0x52b5d9 from'path';import{parse as a116_0x3f597b}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x463986){const _0x377d2f=a116_0x71ea;if(!_0x463986||_0x463986[_0x377d2f(0x102)]()==='')throw new Error(_0x377d2f(0x108));const _0x50128a=_0x463986['trim']();if(_0x50128a==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x463986};const _0x45c663=_0x50128a[_0x377d2f(0xfc)]('/')?_0x50128a[_0x377d2f(0xf2)](0x1):_0x50128a,_0x1d8d87=_0x45c663[_0x377d2f(0x109)]('/')[_0x377d2f(0xe8)](_0x395420=>_0x395420!=='');if(_0x1d8d87[_0x377d2f(0xe6)]===0x0)throw new Error(_0x377d2f(0x106));const _0x4102f6=_0x50128a[_0x377d2f(0xfc)]('/')||!isRelativePathSegment(_0x1d8d87[0x0]);for(const _0x1338a0 of _0x1d8d87){validatePathSegment(_0x1338a0);}return{'segments':_0x1d8d87,'isAbsolute':_0x4102f6,'raw':_0x463986};}function a116_0x71ea(_0x26076a,_0x5234f7){_0x26076a=_0x26076a-0xe2;const _0x4c4231=a116_0x4c42();let _0x71ea22=_0x4c4231[_0x26076a];return _0x71ea22;}function isRelativePathSegment(_0x50d71c){return _0x50d71c==='.'||_0x50d71c==='..';}function validatePathSegment(_0x54a0be){const _0x485c9f=a116_0x71ea;if(_0x54a0be==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x54a0be==='.'||_0x54a0be==='..')return;if(/[\x00-\x1F\x7F]/[_0x485c9f(0x101)](_0x54a0be))throw new Error(_0x485c9f(0xf9)+_0x54a0be);if(_0x54a0be!==_0x54a0be['trim']()){}}export function validatePath(_0x4058d5){const _0x333b13=a116_0x71ea;if(_0x4058d5[_0x333b13(0x10a)]['length']===0x0&&!_0x4058d5[_0x333b13(0xf7)])throw new Error(_0x333b13(0xe3));if(_0x4058d5[_0x333b13(0xf7)]){if(_0x4058d5[_0x333b13(0x10a)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x42ef2a=0x0;for(const _0x2dffe1 of _0x4058d5[_0x333b13(0x10a)]){if(_0x2dffe1==='..'){if(_0x42ef2a===0x0)throw new Error(_0x333b13(0xee));_0x42ef2a--;}else _0x2dffe1!=='.'&&_0x42ef2a++;}}}export function joinPaths(_0x21c78a,_0x40ad65){const _0x7b3570=a116_0x71ea;if(!_0x21c78a||_0x21c78a==='/')return _0x40ad65;if(!_0x40ad65||_0x40ad65==='.')return _0x21c78a;if(_0x40ad65[_0x7b3570(0xfc)]('/'))return _0x40ad65;const _0x478976=parsePath(_0x21c78a),_0x34d8d5=parsePath(_0x40ad65),_0x2a768a=[..._0x478976['segments']];for(const _0x3c49ac of _0x34d8d5[_0x7b3570(0x10a)]){if(_0x3c49ac==='.')continue;else{if(_0x3c49ac==='..'){if(_0x2a768a[_0x7b3570(0xe6)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x2a768a['pop']();}else _0x2a768a[_0x7b3570(0xec)](_0x3c49ac);}}const _0x2e3d7c=_0x2a768a[_0x7b3570(0xfe)]('/');return _0x478976[_0x7b3570(0xf0)][_0x7b3570(0xfc)]('/')?'/'+_0x2e3d7c:_0x2e3d7c;}export function normalizePath(_0x3895d6){const _0x343589=a116_0x71ea,_0x4b9219=parsePath(_0x3895d6),_0x5c4f7a=[];for(const _0x3d4aa0 of _0x4b9219[_0x343589(0x10a)]){if(_0x3d4aa0==='.')continue;else{if(_0x3d4aa0==='..'){if(_0x5c4f7a[_0x343589(0xe6)]===0x0){if(_0x4b9219[_0x343589(0xf7)])throw new Error(_0x343589(0xeb));_0x5c4f7a[_0x343589(0xec)]('..');}else _0x5c4f7a[_0x5c4f7a[_0x343589(0xe6)]-0x1]==='..'?_0x5c4f7a[_0x343589(0xec)]('..'):_0x5c4f7a[_0x343589(0xff)]();}else _0x5c4f7a[_0x343589(0xec)](_0x3d4aa0);}}if(_0x5c4f7a[_0x343589(0xe6)]===0x0)return _0x4b9219[_0x343589(0xf7)]?'/':'.';const _0x533110=_0x5c4f7a[_0x343589(0xfe)]('/');return _0x4b9219[_0x343589(0xf0)]['startsWith']('/')?'/'+_0x533110:_0x533110;}export function getParentPath(_0x189dc0){const _0x21ea04=a116_0x71ea,_0x470c4e=parsePath(_0x189dc0);if(_0x470c4e[_0x21ea04(0x10a)][_0x21ea04(0xe6)]<=0x1)return'/';const _0x2f3556=_0x470c4e[_0x21ea04(0x10a)][_0x21ea04(0x10b)](0x0,-0x1)[_0x21ea04(0xfe)]('/');return _0x470c4e[_0x21ea04(0xf0)][_0x21ea04(0xfc)]('/')?'/'+_0x2f3556:_0x2f3556;}export function getBaseName(_0x1f436f){const _0x3a0310=a116_0x71ea,_0x2f456d=parsePath(_0x1f436f);return _0x2f456d['segments'][_0x2f456d[_0x3a0310(0x10a)]['length']-0x1]||'';}export function isChildPath(_0x5a4dc1,_0x4a3f9b){const _0x496023=a116_0x71ea,_0x3e0a32=parsePath(_0x5a4dc1),_0x1794c4=parsePath(_0x4a3f9b);if(_0x3e0a32[_0x496023(0x10a)]['length']<=_0x1794c4['segments'][_0x496023(0xe6)])return![];for(let _0x2ebce8=0x0;_0x2ebce8<_0x1794c4[_0x496023(0x10a)][_0x496023(0xe6)];_0x2ebce8++){if(_0x3e0a32['segments'][_0x2ebce8]!==_0x1794c4['segments'][_0x2ebce8])return![];}return!![];}export function splitPath(_0x48c44a){const _0x3563ac=a116_0x71ea,_0x2590da=parsePath(_0x48c44a);if(_0x2590da[_0x3563ac(0x10a)][_0x3563ac(0xe6)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x2590da['segments']['length']===0x1)return{'parent':_0x2590da[_0x3563ac(0x10a)][0x0]};return{'parent':_0x2590da[_0x3563ac(0x10a)][0x0],'child':_0x2590da['segments'][_0x3563ac(0x10b)](0x1)[_0x3563ac(0xfe)]('/')};}export function isYamlFilePath(_0x15e551){const _0x3e7c45=a116_0x71ea;return _0x15e551[_0x3e7c45(0x100)]('.yml')||_0x15e551[_0x3e7c45(0x100)](_0x3e7c45(0x107));}export async function resolveYamlFilePath(_0x36fb04,_0x3ceddc=nodeFileSystem){const _0xb4360f=a116_0x71ea,_0x139ade=a116_0x52b5d9[_0xb4360f(0xe4)](_0x36fb04);if(!await _0x3ceddc[_0xb4360f(0xf8)](_0x139ade))throw new Error(_0xb4360f(0xf4)+_0x36fb04);let _0x2553c7=a116_0x52b5d9[_0xb4360f(0xe5)](_0x139ade),_0x23d576=null,_0x4f355b=null;const _0x3cc19e=a116_0x52b5d9[_0xb4360f(0xea)](_0x2553c7)[_0xb4360f(0x10f)];while(_0x2553c7!==_0x3cc19e){const _0x1d25cd=a116_0x52b5d9[_0xb4360f(0xfe)](_0x2553c7,_0xb4360f(0x10d));if(await _0x3ceddc['exists'](_0x1d25cd)){_0x23d576=_0x1d25cd,_0x4f355b=_0x2553c7;break;}_0x2553c7=a116_0x52b5d9[_0xb4360f(0xe5)](_0x2553c7);}if(!_0x23d576||!_0x4f355b)throw new Error(_0xb4360f(0xe2)+_0x36fb04);const _0x1ccb24=await _0x3ceddc[_0xb4360f(0xed)](_0x23d576),_0x1c0d03=JSON[_0xb4360f(0xea)](_0x1ccb24),_0x30838d=_0x1c0d03[_0xb4360f(0x10e)];if(!_0x30838d)throw new Error(_0xb4360f(0xf1));const _0x37c0a6=await _0x3ceddc[_0xb4360f(0xed)](_0x139ade),_0x5c0db2=a116_0x3f597b(_0x37c0a6),_0x41a475=_0x5c0db2['name'];if(!_0x41a475)throw new Error(_0xb4360f(0xfa)+_0x36fb04);const _0x144a47=_0x5c0db2['type']===_0xb4360f(0xfd)?'journey':'segment',_0xe9eb03=a116_0x52b5d9['relative'](_0x4f355b,_0x139ade),_0x1192d5=a116_0x52b5d9['dirname'](_0xe9eb03),_0x5e8fcc=_0x1192d5==='.'?'':_0x1192d5[_0xb4360f(0xfb)](/\\/g,'/'),_0xbeb587=_0x5e8fcc?_0x30838d+'/'+_0x5e8fcc+'/'+_0x41a475:_0x30838d+'/'+_0x41a475;return{'parentSegment':_0x30838d,'segmentName':_0x41a475,'folderPath':_0x5e8fcc,'fullPath':_0xbeb587,'resourceType':_0x144a47};}function a116_0x4c42(){const _0x537f47=['isAbsolute','exists','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','replace','startsWith','journey','join','pop','endsWith','test','trim','66965zuJSVt','1513116acZXOC','6nyudVs','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','.yaml','Path\x20cannot\x20be\x20empty','split','segments','slice','48AydbCB','tdx.json','parent_segment','root','No\x20tdx.json\x20found\x20for\x20file:\x20','Relative\x20path\x20cannot\x20be\x20empty','resolve','dirname','length','65944zAiqRq','filter','1068319oBlpZN','parse','Cannot\x20navigate\x20above\x20root','push','readFile','Path\x20attempts\x20to\x20navigate\x20above\x20root','865376ZZweWV','raw','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','substring','3OgqjOJ','File\x20not\x20found:\x20','1934880ecfZKp','5882940HtXFSb'];a116_0x4c42=function(){return _0x537f47;};return a116_0x4c42();}
@@ -1 +1 @@
1
- function a117_0x3f2e(_0x1b7283,_0x55ab4b){_0x1b7283=_0x1b7283-0x9f;const _0xde4a50=a117_0xde4a();let _0x3f2e51=_0xde4a50[_0x1b7283];return _0x3f2e51;}(function(_0x5b733b,_0x517d93){const _0x402cc9=a117_0x3f2e,_0x22a684=_0x5b733b();while(!![]){try{const _0x826605=-parseInt(_0x402cc9(0xa6))/0x1+parseInt(_0x402cc9(0xa7))/0x2+-parseInt(_0x402cc9(0xa5))/0x3+-parseInt(_0x402cc9(0xa1))/0x4*(-parseInt(_0x402cc9(0x9f))/0x5)+parseInt(_0x402cc9(0xa4))/0x6*(parseInt(_0x402cc9(0xa3))/0x7)+parseInt(_0x402cc9(0xa0))/0x8*(parseInt(_0x402cc9(0xaa))/0x9)+-parseInt(_0x402cc9(0xab))/0xa;if(_0x826605===_0x517d93)break;else _0x22a684['push'](_0x22a684['shift']());}catch(_0x28a74f){_0x22a684['push'](_0x22a684['shift']());}}}(a117_0xde4a,0xbeebc));export function parseSegmentRef(_0x565745){const _0x5557e3=a117_0x3f2e,_0x508d81=_0x565745[_0x5557e3(0xa8)]('/');if(_0x508d81===-0x1)return{'parentId':_0x565745};if(_0x508d81===0x0)throw new Error(_0x5557e3(0xa9)+_0x565745+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x5c173e=_0x565745[_0x5557e3(0xa2)](0x0,_0x508d81),_0x12132d=_0x565745[_0x5557e3(0xa2)](_0x508d81+0x1);if(_0x12132d==='')throw new Error(_0x5557e3(0xa9)+_0x565745+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x5c173e,'childId':_0x12132d};}function a117_0xde4a(){const _0x46d00b=['substring','14JYiSzR','142920meHPrl','4416213AioCFd','853437pisBPi','2945476yAddTt','indexOf','Invalid\x20segment\x20reference\x20format:\x20','6613425CXeQzv','2536010aOGkZO','85DZKqRl','8uplOaS','260216fuOoIQ'];a117_0xde4a=function(){return _0x46d00b;};return a117_0xde4a();}
1
+ function a117_0x28d1(){const _0x4bfe3f=['25358380vTRLVP','substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','190707vzrRkr','2521798nTJqXY','180IEQWmb','.\x20Child\x20name\x20cannot\x20be\x20empty','2797613uDyflU','83472AXwyKW','Invalid\x20segment\x20reference\x20format:\x20','237200pPLrWu','655485pNFaek','indexOf','90lKRGih','36amtDrk'];a117_0x28d1=function(){return _0x4bfe3f;};return a117_0x28d1();}function a117_0x5b29(_0x2aa6e3,_0x328f03){_0x2aa6e3=_0x2aa6e3-0xe9;const _0x28d178=a117_0x28d1();let _0x5b296b=_0x28d178[_0x2aa6e3];return _0x5b296b;}(function(_0x1cdbb3,_0x13a58c){const _0x3fa86f=a117_0x5b29,_0x4f8277=_0x1cdbb3();while(!![]){try{const _0x46c936=-parseInt(_0x3fa86f(0xf0))/0x1+-parseInt(_0x3fa86f(0xe9))/0x2+-parseInt(_0x3fa86f(0xf7))/0x3*(parseInt(_0x3fa86f(0xf3))/0x4)+parseInt(_0x3fa86f(0xea))/0x5*(parseInt(_0x3fa86f(0xed))/0x6)+parseInt(_0x3fa86f(0xec))/0x7+parseInt(_0x3fa86f(0xef))/0x8*(-parseInt(_0x3fa86f(0xf2))/0x9)+parseInt(_0x3fa86f(0xf4))/0xa;if(_0x46c936===_0x13a58c)break;else _0x4f8277['push'](_0x4f8277['shift']());}catch(_0x44ae95){_0x4f8277['push'](_0x4f8277['shift']());}}}(a117_0x28d1,0x9f03c));export function parseSegmentRef(_0x5d67ce){const _0xd40435=a117_0x5b29,_0x43e10a=_0x5d67ce[_0xd40435(0xf1)]('/');if(_0x43e10a===-0x1)return{'parentId':_0x5d67ce};if(_0x43e10a===0x0)throw new Error(_0xd40435(0xee)+_0x5d67ce+_0xd40435(0xf6));const _0x4ba9e4=_0x5d67ce[_0xd40435(0xf5)](0x0,_0x43e10a),_0x56848b=_0x5d67ce['substring'](_0x43e10a+0x1);if(_0x56848b==='')throw new Error(_0xd40435(0xee)+_0x5d67ce+_0xd40435(0xeb));return{'parentId':_0x4ba9e4,'childId':_0x56848b};}
@@ -1 +1 @@
1
- function a118_0x2ce6(_0x5ca706,_0x18af2c){_0x5ca706=_0x5ca706-0x159;const _0x546350=a118_0x5463();let _0x2ce632=_0x546350[_0x5ca706];return _0x2ce632;}(function(_0x2be6ec,_0x5d4450){const _0x830f5a=a118_0x2ce6,_0x3818d8=_0x2be6ec();while(!![]){try{const _0xb356a0=parseInt(_0x830f5a(0x162))/0x1+parseInt(_0x830f5a(0x18f))/0x2*(parseInt(_0x830f5a(0x177))/0x3)+parseInt(_0x830f5a(0x181))/0x4+-parseInt(_0x830f5a(0x163))/0x5*(parseInt(_0x830f5a(0x170))/0x6)+parseInt(_0x830f5a(0x167))/0x7*(-parseInt(_0x830f5a(0x182))/0x8)+parseInt(_0x830f5a(0x15b))/0x9+-parseInt(_0x830f5a(0x16f))/0xa;if(_0xb356a0===_0x5d4450)break;else _0x3818d8['push'](_0x3818d8['shift']());}catch(_0x1a050f){_0x3818d8['push'](_0x3818d8['shift']());}}}(a118_0x5463,0x5fbbe));import a118_0x353775 from'path';function a118_0x5463(){const _0x2ae2d4=['2752704GpUFGg','error','isFile','File\x20not\x20found:\x20','segment','journey','stat','642947NITKbm','10bejrGb','segmentName','message','resolve','70IkLkEZ','isScoped','no_parent','exists','parentSegment','No\x20tdx.json\x20found\x20for\x20file:\x20','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','file','12244810xdBnAF','104028lBfEFR','startsWith','parent_segment','invalid_yaml','basename','resourceType','cwd','3yvqTqx','type','directory','string','replace','Not\x20a\x20YAML\x20file:\x20','extname','match','parent_name','isDirectory','2650984TzGuUD','213296rjOzaL','trim','No\x20tdx.json\x20found','tdx.json','root','parse','folderPath','scopedFolderPath','readFile','Parent\x20segment\x20not\x20specified','no_config','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','dirname','612708orvBuN','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','context','join','configDir'];a118_0x5463=function(){return _0x2ae2d4;};return a118_0x5463();}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(_0x5694fb){const _0x15c8b0=a118_0x2ce6;return _0x5694fb[_0x15c8b0(0x178)]!==_0x15c8b0(0x15c);}export function isScopedResolution(_0x3eb9ef){const _0x44eaed=a118_0x2ce6;return _0x3eb9ef['type']===_0x44eaed(0x179)||_0x3eb9ef[_0x44eaed(0x178)]===_0x44eaed(0x16e)||_0x3eb9ef[_0x44eaed(0x178)]===_0x44eaed(0x191);}export function getScopedDetails(_0x354b8c){if(isScopedResolution(_0x354b8c))return{'isScoped':_0x354b8c['isScoped'],'scopedFolderPath':_0x354b8c['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x2f5f76,_0x2a4343){const _0x2cc7a1=a118_0x2ce6;let _0x6670ba=a118_0x353775[_0x2cc7a1(0x166)](_0x2f5f76);const _0xdc8936=a118_0x353775[_0x2cc7a1(0x187)](_0x6670ba)[_0x2cc7a1(0x186)];while(_0x6670ba!==_0xdc8936){const _0xf2ecf1=a118_0x353775[_0x2cc7a1(0x159)](_0x6670ba,_0x2cc7a1(0x185));if(await _0x2a4343[_0x2cc7a1(0x16a)](_0xf2ecf1))try{const _0x3326b1=await _0x2a4343[_0x2cc7a1(0x18a)](_0xf2ecf1),_0x5f451e=JSON['parse'](_0x3326b1);if(_0x5f451e[_0x2cc7a1(0x172)]&&typeof _0x5f451e[_0x2cc7a1(0x172)]===_0x2cc7a1(0x17a))return{'configPath':_0xf2ecf1,'configDir':_0x6670ba,'parentSegment':_0x5f451e['parent_segment']};}catch{}_0x6670ba=a118_0x353775[_0x2cc7a1(0x18e)](_0x6670ba);}return null;}function calculateScopedPath(_0x585fe2,_0x3eaa4e){const _0x5232f4=a118_0x2ce6,_0x38f107=a118_0x353775['relative'](_0x3eaa4e,_0x585fe2),_0x224bfc=_0x38f107!==''&&_0x38f107!=='.'&&!_0x38f107[_0x5232f4(0x171)]('..');return{'isScoped':_0x224bfc,'scopedFolderPath':_0x224bfc?_0x38f107[_0x5232f4(0x17b)](/\\/g,'/'):''};}export async function resolveTarget(_0x1f6eb0){const _0x38be60=a118_0x2ce6,{arg:_0x469946,contextParent:_0x33aff9,cwd:cwd=process[_0x38be60(0x176)](),fs:fs=nodeFileSystem}=_0x1f6eb0;if(_0x469946&&isYamlFilePath(_0x469946))try{const _0x36ad1c=await resolveYamlFilePath(_0x469946,fs),_0x10b9ac=a118_0x353775[_0x38be60(0x166)](_0x469946),_0x4c4737=a118_0x353775['dirname'](_0x10b9ac),_0x3bdab0=await findTdxConfigAsync(_0x4c4737,fs);if(!_0x3bdab0){if(_0x33aff9){const _0x22a97f=a118_0x353775[_0x38be60(0x18e)](_0x10b9ac);return{'type':_0x38be60(0x16e),'parentName':_0x33aff9,'targetDir':_0x22a97f,'configRoot':_0x22a97f,'filePath':_0x10b9ac,'resourceName':_0x36ad1c[_0x38be60(0x164)],'folderPath':_0x36ad1c[_0x38be60(0x188)],'resourceType':_0x36ad1c[_0x38be60(0x175)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x38be60(0x15c),'errorCode':_0x38be60(0x18c),'message':_0x38be60(0x16c)+_0x469946,'arg':_0x469946,'helpText':_0x38be60(0x190)};}const _0x25ac3d=calculateScopedPath(_0x4c4737,_0x3bdab0['configDir']);return{'type':_0x38be60(0x16e),'parentName':_0x3bdab0[_0x38be60(0x16b)],'targetDir':_0x3bdab0[_0x38be60(0x15a)],'configRoot':_0x3bdab0[_0x38be60(0x15a)],'filePath':_0x10b9ac,'resourceName':_0x36ad1c[_0x38be60(0x164)],'folderPath':_0x36ad1c[_0x38be60(0x188)],'resourceType':_0x36ad1c['resourceType'],'isScoped':_0x25ac3d[_0x38be60(0x168)],'scopedFolderPath':_0x25ac3d[_0x38be60(0x189)]};}catch(_0x5b3a09){const _0x53e0d0=_0x5b3a09 instanceof Error?_0x5b3a09[_0x38be60(0x165)]:String(_0x5b3a09);if(_0x53e0d0['includes']('File\x20not\x20found'))return{'type':_0x38be60(0x15c),'errorCode':'file_not_found','message':_0x38be60(0x15e)+_0x469946,'arg':_0x469946};if(_0x53e0d0['includes'](_0x38be60(0x184))){if(_0x33aff9){const _0x470c4e=a118_0x353775[_0x38be60(0x166)](_0x469946);if(await fs[_0x38be60(0x16a)](_0x470c4e)){const _0x5adf83=a118_0x353775[_0x38be60(0x18e)](_0x470c4e),_0x20f86a=await fs[_0x38be60(0x18a)](_0x470c4e),_0x353e49=_0x20f86a[_0x38be60(0x17e)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x2cfad5=_0x20f86a['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x1e5044=_0x353e49?_0x353e49[0x1][_0x38be60(0x183)]():a118_0x353775[_0x38be60(0x174)](_0x469946,a118_0x353775[_0x38be60(0x17d)](_0x469946)),_0x2ef483=_0x2cfad5&&_0x2cfad5[0x1][_0x38be60(0x183)]()===_0x38be60(0x160)?_0x38be60(0x160):_0x38be60(0x15f);return{'type':'file','parentName':_0x33aff9,'targetDir':_0x5adf83,'configRoot':_0x5adf83,'filePath':_0x470c4e,'resourceName':_0x1e5044,'folderPath':'','resourceType':_0x2ef483,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0x38be60(0x18c),'message':_0x38be60(0x16c)+_0x469946,'arg':_0x469946,'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':_0x38be60(0x15c),'errorCode':'invalid_yaml','message':_0x53e0d0,'arg':_0x469946};}if(_0x469946){const _0x18c282=a118_0x353775[_0x38be60(0x166)](cwd,_0x469946);let _0x4477cd=null;try{_0x4477cd=await fs[_0x38be60(0x161)](_0x18c282);}catch{}if(_0x4477cd?.[_0x38be60(0x180)]()){const _0x2bdb6c=await findTdxConfigAsync(_0x18c282,fs);if(_0x2bdb6c){const _0x364144=calculateScopedPath(_0x18c282,_0x2bdb6c[_0x38be60(0x15a)]);return{'type':_0x38be60(0x179),'parentName':_0x2bdb6c['parentSegment'],'targetDir':_0x18c282,'configRoot':_0x2bdb6c[_0x38be60(0x15a)],'isScoped':_0x364144['isScoped'],'scopedFolderPath':_0x364144[_0x38be60(0x189)]};}if(_0x33aff9)return{'type':_0x38be60(0x179),'parentName':_0x33aff9,'targetDir':_0x18c282,'configRoot':_0x18c282,'isScoped':![],'scopedFolderPath':''};return{'type':_0x38be60(0x15c),'errorCode':_0x38be60(0x18c),'message':_0x38be60(0x18d)+_0x469946,'arg':_0x469946,'helpText':_0x38be60(0x190)};}if(_0x4477cd?.[_0x38be60(0x15d)]())return{'type':_0x38be60(0x15c),'errorCode':_0x38be60(0x173),'message':_0x38be60(0x17c)+_0x469946,'arg':_0x469946,'helpText':_0x38be60(0x16d)};const _0x3e935e=sanitizeFileName(_0x469946),_0x48e647=getSegmentRootDir(_0x3e935e,cwd);return{'type':_0x38be60(0x17f),'parentName':_0x469946,'targetDir':_0x48e647,'configRoot':_0x48e647};}const _0x3d6f23=await findTdxConfigAsync(cwd,fs);if(_0x3d6f23){const _0xe49543=calculateScopedPath(cwd,_0x3d6f23[_0x38be60(0x15a)]);return{'type':_0x38be60(0x191),'parentName':_0x3d6f23['parentSegment'],'targetDir':cwd,'configRoot':_0x3d6f23[_0x38be60(0x15a)],'isScoped':_0xe49543['isScoped'],'scopedFolderPath':_0xe49543['scopedFolderPath']};}if(_0x33aff9){const _0x1c8b2d=sanitizeFileName(_0x33aff9),_0x47c50d=getSegmentRootDir(_0x1c8b2d,cwd);return{'type':'context','parentName':_0x33aff9,'targetDir':_0x47c50d,'configRoot':_0x47c50d,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x38be60(0x15c),'errorCode':_0x38be60(0x169),'message':_0x38be60(0x18b),'helpText':'Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure'};}
1
+ (function(_0x16a1f4,_0xb44aa4){const _0x1477df=a118_0x54f3,_0x436d52=_0x16a1f4();while(!![]){try{const _0x4c2960=-parseInt(_0x1477df(0x199))/0x1+-parseInt(_0x1477df(0x16c))/0x2*(-parseInt(_0x1477df(0x186))/0x3)+parseInt(_0x1477df(0x1a4))/0x4*(-parseInt(_0x1477df(0x184))/0x5)+-parseInt(_0x1477df(0x18f))/0x6*(parseInt(_0x1477df(0x17c))/0x7)+parseInt(_0x1477df(0x18c))/0x8+parseInt(_0x1477df(0x172))/0x9+-parseInt(_0x1477df(0x183))/0xa*(-parseInt(_0x1477df(0x194))/0xb);if(_0x4c2960===_0xb44aa4)break;else _0x436d52['push'](_0x436d52['shift']());}catch(_0x2ffda2){_0x436d52['push'](_0x436d52['shift']());}}}(a118_0x2f16,0x9ad7c));import a118_0x4bd61d from'path';import{sanitizeFileName}from'../../utils/string-utils.js';function a118_0x2f16(){const _0x47d8d2=['No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','resolve','File\x20not\x20found:\x20','824648LHcrrh','match','error','invalid_yaml','No\x20tdx.json\x20found\x20for\x20file:\x20','370617dlDJiK','segment','cwd','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','configDir','Not\x20a\x20YAML\x20file:\x20','parentSegment','context','segmentName','startsWith','directory','58648NecGMK','includes','6aVFiWo','replace','readFile','root','exists','File\x20not\x20found','10609695CxJkmN','type','trim','no_config','extname','parent_segment','basename','file','parent_name','Parent\x20segment\x20not\x20specified','21KnuzsJ','relative','scopedFolderPath','No\x20tdx.json\x20found','file_not_found','isScoped','string','10WGxxsc','80EYLugz','tdx.json','171363WXGDRA','journey','dirname','folderPath','isDirectory','message','7809152YYWDCj','isFile','resourceType','2323770fIKqWw','parse'];a118_0x2f16=function(){return _0x47d8d2;};return a118_0x2f16();}import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';function a118_0x54f3(_0x1b8adb,_0x1d7d07){_0x1b8adb=_0x1b8adb-0x16b;const _0x2f1620=a118_0x2f16();let _0x54f306=_0x2f1620[_0x1b8adb];return _0x54f306;}import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x49efcb){const _0x455cb2=a118_0x54f3;return _0x49efcb[_0x455cb2(0x173)]!==_0x455cb2(0x196);}export function isScopedResolution(_0x221ca1){const _0x2a0bd6=a118_0x54f3;return _0x221ca1[_0x2a0bd6(0x173)]===_0x2a0bd6(0x1a3)||_0x221ca1[_0x2a0bd6(0x173)]===_0x2a0bd6(0x179)||_0x221ca1[_0x2a0bd6(0x173)]===_0x2a0bd6(0x1a0);}export function getScopedDetails(_0x3325a1){const _0x46421b=a118_0x54f3;if(isScopedResolution(_0x3325a1))return{'isScoped':_0x3325a1['isScoped'],'scopedFolderPath':_0x3325a1[_0x46421b(0x17e)]};return undefined;}async function findTdxConfigAsync(_0xb8622b,_0x2fb0ab){const _0x2de3c0=a118_0x54f3;let _0x56c153=a118_0x4bd61d['resolve'](_0xb8622b);const _0x2e78d5=a118_0x4bd61d[_0x2de3c0(0x190)](_0x56c153)[_0x2de3c0(0x16f)];while(_0x56c153!==_0x2e78d5){const _0x588d94=a118_0x4bd61d['join'](_0x56c153,_0x2de3c0(0x185));if(await _0x2fb0ab[_0x2de3c0(0x170)](_0x588d94))try{const _0x47897d=await _0x2fb0ab[_0x2de3c0(0x16e)](_0x588d94),_0x314e0a=JSON[_0x2de3c0(0x190)](_0x47897d);if(_0x314e0a[_0x2de3c0(0x177)]&&typeof _0x314e0a[_0x2de3c0(0x177)]===_0x2de3c0(0x182))return{'configPath':_0x588d94,'configDir':_0x56c153,'parentSegment':_0x314e0a[_0x2de3c0(0x177)]};}catch{}_0x56c153=a118_0x4bd61d[_0x2de3c0(0x188)](_0x56c153);}return null;}function calculateScopedPath(_0x31d706,_0x2802b3){const _0x2342ea=a118_0x54f3,_0x5d4296=a118_0x4bd61d[_0x2342ea(0x17d)](_0x2802b3,_0x31d706),_0x4b2b34=_0x5d4296!==''&&_0x5d4296!=='.'&&!_0x5d4296[_0x2342ea(0x1a2)]('..');return{'isScoped':_0x4b2b34,'scopedFolderPath':_0x4b2b34?_0x5d4296[_0x2342ea(0x16d)](/\\/g,'/'):''};}export async function resolveTarget(_0x47400c){const _0x5cda6a=a118_0x54f3,{arg:_0x2946fe,contextParent:_0xd8079a,cwd:cwd=process[_0x5cda6a(0x19b)](),fs:fs=nodeFileSystem}=_0x47400c;if(_0x2946fe&&isYamlFilePath(_0x2946fe))try{const _0x5dca3a=await resolveYamlFilePath(_0x2946fe,fs),_0x49c7e9=a118_0x4bd61d['resolve'](_0x2946fe),_0x314f54=a118_0x4bd61d['dirname'](_0x49c7e9),_0x3c380f=await findTdxConfigAsync(_0x314f54,fs);if(!_0x3c380f){if(_0xd8079a){const _0x212e26=a118_0x4bd61d['dirname'](_0x49c7e9);return{'type':_0x5cda6a(0x179),'parentName':_0xd8079a,'targetDir':_0x212e26,'configRoot':_0x212e26,'filePath':_0x49c7e9,'resourceName':_0x5dca3a['segmentName'],'folderPath':_0x5dca3a['folderPath'],'resourceType':_0x5dca3a[_0x5cda6a(0x18e)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5cda6a(0x196),'errorCode':_0x5cda6a(0x175),'message':_0x5cda6a(0x198)+_0x2946fe,'arg':_0x2946fe,'helpText':_0x5cda6a(0x19c)};}const _0xbcaeb9=calculateScopedPath(_0x314f54,_0x3c380f[_0x5cda6a(0x19d)]);return{'type':_0x5cda6a(0x179),'parentName':_0x3c380f[_0x5cda6a(0x19f)],'targetDir':_0x3c380f[_0x5cda6a(0x19d)],'configRoot':_0x3c380f['configDir'],'filePath':_0x49c7e9,'resourceName':_0x5dca3a[_0x5cda6a(0x1a1)],'folderPath':_0x5dca3a[_0x5cda6a(0x189)],'resourceType':_0x5dca3a['resourceType'],'isScoped':_0xbcaeb9[_0x5cda6a(0x181)],'scopedFolderPath':_0xbcaeb9[_0x5cda6a(0x17e)]};}catch(_0x71c549){const _0x223199=_0x71c549 instanceof Error?_0x71c549[_0x5cda6a(0x18b)]:String(_0x71c549);if(_0x223199[_0x5cda6a(0x16b)](_0x5cda6a(0x171)))return{'type':'error','errorCode':_0x5cda6a(0x180),'message':_0x5cda6a(0x193)+_0x2946fe,'arg':_0x2946fe};if(_0x223199[_0x5cda6a(0x16b)](_0x5cda6a(0x17f))){if(_0xd8079a){const _0x503e82=a118_0x4bd61d[_0x5cda6a(0x192)](_0x2946fe);if(await fs[_0x5cda6a(0x170)](_0x503e82)){const _0x30e4bf=a118_0x4bd61d[_0x5cda6a(0x188)](_0x503e82),_0x36c813=await fs[_0x5cda6a(0x16e)](_0x503e82),_0x351efe=_0x36c813['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x25655f=_0x36c813[_0x5cda6a(0x195)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4ce6e2=_0x351efe?_0x351efe[0x1][_0x5cda6a(0x174)]():a118_0x4bd61d[_0x5cda6a(0x178)](_0x2946fe,a118_0x4bd61d[_0x5cda6a(0x176)](_0x2946fe)),_0x55ce70=_0x25655f&&_0x25655f[0x1][_0x5cda6a(0x174)]()==='journey'?_0x5cda6a(0x187):_0x5cda6a(0x19a);return{'type':_0x5cda6a(0x179),'parentName':_0xd8079a,'targetDir':_0x30e4bf,'configRoot':_0x30e4bf,'filePath':_0x503e82,'resourceName':_0x4ce6e2,'folderPath':'','resourceType':_0x55ce70,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0x5cda6a(0x175),'message':_0x5cda6a(0x198)+_0x2946fe,'arg':_0x2946fe,'helpText':_0x5cda6a(0x19c)};}return{'type':_0x5cda6a(0x196),'errorCode':_0x5cda6a(0x197),'message':_0x223199,'arg':_0x2946fe};}if(_0x2946fe){const _0x334b3b=a118_0x4bd61d[_0x5cda6a(0x192)](cwd,_0x2946fe);let _0x58863b=null;try{_0x58863b=await fs['stat'](_0x334b3b);}catch{}if(_0x58863b?.[_0x5cda6a(0x18a)]()){const _0x49298=await findTdxConfigAsync(_0x334b3b,fs);if(_0x49298){const _0x193bb8=calculateScopedPath(_0x334b3b,_0x49298[_0x5cda6a(0x19d)]);return{'type':'directory','parentName':_0x49298[_0x5cda6a(0x19f)],'targetDir':_0x334b3b,'configRoot':_0x49298['configDir'],'isScoped':_0x193bb8['isScoped'],'scopedFolderPath':_0x193bb8['scopedFolderPath']};}if(_0xd8079a)return{'type':_0x5cda6a(0x1a3),'parentName':_0xd8079a,'targetDir':_0x334b3b,'configRoot':_0x334b3b,'isScoped':![],'scopedFolderPath':''};return{'type':_0x5cda6a(0x196),'errorCode':'no_config','message':_0x5cda6a(0x191)+_0x2946fe,'arg':_0x2946fe,'helpText':_0x5cda6a(0x19c)};}if(_0x58863b?.[_0x5cda6a(0x18d)]())return{'type':_0x5cda6a(0x196),'errorCode':_0x5cda6a(0x197),'message':_0x5cda6a(0x19e)+_0x2946fe,'arg':_0x2946fe,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0xeb6612=sanitizeFileName(_0x2946fe),_0x14a681=getSegmentRootDir(_0xeb6612,cwd);return{'type':_0x5cda6a(0x17a),'parentName':_0x2946fe,'targetDir':_0x14a681,'configRoot':_0x14a681};}const _0x27bbf0=await findTdxConfigAsync(cwd,fs);if(_0x27bbf0){const _0x3b9bac=calculateScopedPath(cwd,_0x27bbf0[_0x5cda6a(0x19d)]);return{'type':_0x5cda6a(0x1a0),'parentName':_0x27bbf0['parentSegment'],'targetDir':cwd,'configRoot':_0x27bbf0[_0x5cda6a(0x19d)],'isScoped':_0x3b9bac[_0x5cda6a(0x181)],'scopedFolderPath':_0x3b9bac[_0x5cda6a(0x17e)]};}if(_0xd8079a){const _0x3dcd2b=sanitizeFileName(_0xd8079a),_0x404827=getSegmentRootDir(_0x3dcd2b,cwd);return{'type':_0x5cda6a(0x1a0),'parentName':_0xd8079a,'targetDir':_0x404827,'configRoot':_0x404827,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5cda6a(0x196),'errorCode':'no_parent','message':_0x5cda6a(0x17b),'helpText':'Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure'};}