@treasuredata/tdx 0.26.0 → 0.26.2

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_0x33ddfe=a114_0x1937;(function(_0xbf680,_0x113e97){const _0x5d52d4=a114_0x1937,_0x7d5d00=_0xbf680();while(!![]){try{const _0x58ceae=-parseInt(_0x5d52d4(0x112))/0x1*(-parseInt(_0x5d52d4(0x1dd))/0x2)+parseInt(_0x5d52d4(0x19e))/0x3*(parseInt(_0x5d52d4(0x1c9))/0x4)+parseInt(_0x5d52d4(0x15b))/0x5*(-parseInt(_0x5d52d4(0x1d2))/0x6)+parseInt(_0x5d52d4(0x195))/0x7+-parseInt(_0x5d52d4(0x104))/0x8+parseInt(_0x5d52d4(0x161))/0x9*(parseInt(_0x5d52d4(0x152))/0xa)+parseInt(_0x5d52d4(0x14f))/0xb*(-parseInt(_0x5d52d4(0x19a))/0xc);if(_0x58ceae===_0x113e97)break;else _0x7d5d00['push'](_0x7d5d00['shift']());}catch(_0x478343){_0x7d5d00['push'](_0x7d5d00['shift']());}}}(a114_0x40f3,0x75497));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a114_0x33ddfe(0x1cd));export const PENDING_SEGMENT_PREFIX=a114_0x33ddfe(0x119);export const PENDING_ACTIVATION_PREFIX=a114_0x33ddfe(0x178);export function createPendingSegmentId(_0x34e7f5){return''+PENDING_SEGMENT_PREFIX+_0x34e7f5+'__';}export function isPendingSegmentId(_0x3c5df4){const _0x193448=a114_0x33ddfe;return _0x3c5df4[_0x193448(0x1a1)](PENDING_SEGMENT_PREFIX)&&!_0x3c5df4[_0x193448(0x1a1)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x5af05f){return _0x5af05f['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x26c316){return''+PENDING_ACTIVATION_PREFIX+_0x26c316+'__';}export function isPendingActivationId(_0x1de9c0){return _0x1de9c0['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xb4e08d){const _0x465da9=a114_0x33ddfe;return _0xb4e08d[_0x465da9(0x15e)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x501abe,_0x23f05e){const _0x4eb591=a114_0x33ddfe,_0x584aa6=_0x501abe+'::'+(_0x23f05e['trim']()||_0x4eb591(0x10c)),_0x1b8ad5=createHash(_0x4eb591(0x13c))[_0x4eb591(0x190)](_0x584aa6)[_0x4eb591(0x118)](_0x4eb591(0x1ba))[_0x4eb591(0x1af)](0x0,0xc);return _0x4eb591(0x11e)+_0x1b8ad5;}export function ensureJourneyDefaults(_0xed45b1){const _0x1fe5bd=a114_0x33ddfe;!_0xed45b1[_0x1fe5bd(0x1a8)]&&(_0xed45b1[_0x1fe5bd(0x1a8)]=''),!_0xed45b1[_0x1fe5bd(0x18b)]&&(_0xed45b1[_0x1fe5bd(0x18b)]='draft');}export function resolveTDFolderPath(_0x3a8e4f,_0x3482a2,_0x444125){const _0x340347=a114_0x33ddfe;if(!_0x3482a2)return _0x3a8e4f;if(_0x3a8e4f===_0x444125||_0x3a8e4f[_0x340347(0x1a1)](_0x444125+'/'))return _0x3a8e4f;return _0x3a8e4f?_0x444125+'/'+_0x3a8e4f:_0x444125;}export function addFoldersToCreate(_0x1278cf,_0x5eb3eb,_0x52dbe3){const _0x4add4e=a114_0x33ddfe;if(!_0x1278cf)return;if(_0x5eb3eb['has'](_0x1278cf))return;const _0x2b9059=_0x1278cf[_0x4add4e(0x17d)]('/');let _0x48d776='';for(const _0x4d8fa7 of _0x2b9059){_0x48d776=_0x48d776?_0x48d776+'/'+_0x4d8fa7:_0x4d8fa7,!_0x5eb3eb[_0x4add4e(0x121)](_0x48d776)&&_0x52dbe3[_0x4add4e(0x1c4)](_0x48d776);}}import*as a114_0x98dcd3 from'yaml';import{readFileSync}from'fs';function a114_0x1937(_0x3b7927,_0x1267f5){_0x3b7927=_0x3b7927-0xfb;const _0x40f398=a114_0x40f3();let _0x19378e=_0x40f398[_0x3b7927];return _0x19378e;}import a114_0x5e6eb0 from'path';import{isJourneyDef,parseYamlString as a114_0x4963c4,toYamlString as a114_0x372d40,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(_0x2765bb){const _0x3e9f79=a114_0x33ddfe;if(Array[_0x3e9f79(0x10b)](_0x2765bb))return'['+_0x2765bb[_0x3e9f79(0x1db)](_0x4440a0=>stableStringify(_0x4440a0))[_0x3e9f79(0x106)](',')+']';if(_0x2765bb&&typeof _0x2765bb===_0x3e9f79(0x13e)){const _0x2d105d=_0x2765bb,_0x4751be=Object[_0x3e9f79(0x171)](_0x2d105d)[_0x3e9f79(0x199)](),_0x3e3a98=_0x4751be['map'](_0x211dfc=>'\x22'+_0x211dfc+'\x22:'+stableStringify(_0x2d105d[_0x211dfc]));return'{'+_0x3e3a98[_0x3e9f79(0x106)](',')+'}';}const _0x4c264f=JSON[_0x3e9f79(0x12a)](_0x2765bb);return _0x4c264f===undefined?_0x3e9f79(0x146):_0x4c264f;}function activationSignature(_0x278e6f){const _0x3f9486=a114_0x33ddfe,_0x211a80={'connection':_0x278e6f[_0x3f9486(0x1c5)],..._0x278e6f[_0x3f9486(0x184)]!==undefined&&{'all_columns':_0x278e6f['all_columns']},..._0x278e6f[_0x3f9486(0x136)]!==undefined&&{'columns':_0x278e6f['columns']},..._0x278e6f[_0x3f9486(0x151)]!==undefined&&{'behavior':_0x278e6f[_0x3f9486(0x151)]},..._0x278e6f[_0x3f9486(0x1aa)]!==undefined&&{'schedule':_0x278e6f[_0x3f9486(0x1aa)]},..._0x278e6f[_0x3f9486(0x191)]!==undefined&&{'notification':_0x278e6f[_0x3f9486(0x191)]},..._0x278e6f[_0x3f9486(0x1f4)]!==undefined&&{'connector_config':_0x278e6f[_0x3f9486(0x1f4)]},..._0x278e6f[_0x3f9486(0x107)]!==undefined&&{'activation_template_id':_0x278e6f['activation_template_id']}};return stableStringify(_0x211a80);}async function fetchSegment(_0x164ccb,_0x5c578c,_0xa2581f,_0x4cfc90){const _0x2a0a66=a114_0x33ddfe,_0x1afe2e=_0x4cfc90?.[_0x2a0a66(0xfd)](_0x501a68=>_0x501a68['id']===_0xa2581f);if(_0x1afe2e)return _0x1afe2e;try{return await _0x164ccb[_0x2a0a66(0x10c)][_0x2a0a66(0x12d)](_0x5c578c,_0xa2581f);}catch(_0x2f0288){logger[_0x2a0a66(0x1c0)](_0x2a0a66(0x138)+_0xa2581f+_0x2a0a66(0x1a2)+_0x2f0288);try{return await _0x164ccb[_0x2a0a66(0x10c)][_0x2a0a66(0x143)](_0xa2581f);}catch(_0x31af46){return logger['debug'](_0x2a0a66(0x153)+_0xa2581f+':\x20'+_0x31af46),null;}}}function recoverSegmentIdsFromPushRecovery(_0x12d427,_0x25f4a5,_0x3186d2){const _0x706baa=a114_0x33ddfe,_0x3c8b90=readPushRecovery(_0x12d427[_0x706baa(0x1e0)]);if(_0x3c8b90?.[_0x706baa(0x141)]===_0x12d427[_0x706baa(0x1f1)][_0x706baa(0x127)])for(const [_0x12e3d7,_0x274a27]of Object['entries'](_0x3c8b90[_0x706baa(0x1d6)])){const _0x5e1eda=generateDeterministicJourneySegmentName(_0x12d427[_0x706baa(0x1f1)][_0x706baa(0x127)],_0x12e3d7);_0x274a27[_0x706baa(0x1ce)]===_0x5e1eda&&(_0x25f4a5['set'](_0x12e3d7,_0x274a27['segmentId']),_0x3186d2['set'](_0x12e3d7,_0x274a27['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x38c09c,_0x49b9ab,_0x452e17,_0x10c770){const _0x22caeb=a114_0x33ddfe;let _0x4e8b9f;try{_0x4e8b9f=await _0x38c09c[_0x22caeb(0x10c)][_0x22caeb(0x1c8)]({'name':_0x452e17[_0x22caeb(0x158)],'description':_0x452e17[_0x22caeb(0x1a8)],'journeyId':_0x452e17[_0x22caeb(0x1a7)],'rule':_0x10c770(_0x452e17[_0x22caeb(0x162)],!![]),'countPopulation':!![],'parentFolderId':_0x452e17[_0x22caeb(0x163)],'audienceId':_0x452e17[_0x22caeb(0x1f2)]});}catch(_0x36178e){const _0x52cb74=_0x36178e instanceof Error&&_0x36178e[_0x22caeb(0x1a3)][_0x22caeb(0x15c)]('Name\x20has\x20already\x20been\x20taken');if(_0x52cb74){const _0x69685b=readPushRecovery(_0x49b9ab['absolutePath']),_0x2a1f0c=_0x69685b?.[_0x22caeb(0x141)]===_0x49b9ab[_0x22caeb(0x1f1)][_0x22caeb(0x127)]?_0x69685b[_0x22caeb(0x1d6)][_0x452e17[_0x22caeb(0x18f)]]:undefined;if(_0x2a1f0c?.['uniqueServerName']===_0x452e17[_0x22caeb(0x158)])await _0x38c09c[_0x22caeb(0x10c)][_0x22caeb(0x113)](_0x452e17['parentId'],_0x2a1f0c['segmentId'],{'description':_0x452e17[_0x22caeb(0x1a8)],'rule':_0x10c770(_0x452e17[_0x22caeb(0x162)],!![]),'countPopulation':!![]}),_0x4e8b9f=_0x2a1f0c[_0x22caeb(0x19b)];else throw new SDKError(ErrorCode[_0x22caeb(0x117)],'Embedded\x20segment\x20\x27'+_0x452e17['localName']+_0x22caeb(0x18c)+(_0x22caeb(0x194)+_0x49b9ab[_0x22caeb(0x1e0)][_0x22caeb(0x15e)](/([^/]+)$/,_0x22caeb(0x1c3))+')\x20')+_0x22caeb(0x168),_0x36178e);}else throw _0x36178e;}return saveSegmentToPushRecovery(_0x49b9ab[_0x22caeb(0x1e0)],_0x49b9ab['yamlConfig'][_0x22caeb(0x127)],_0x452e17['localName'],{'segmentId':_0x4e8b9f,'uniqueServerName':_0x452e17['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x4e8b9f;}export async function prepareSegmentFiles(_0x5a9a6b,_0x38142a,_0x30bdce,_0x13060c,_0x22181c){const _0x1701fe=a114_0x33ddfe,{activationDefToCreateRequest:_0x280a41}=await import(_0x1701fe(0xfc)),_0x49458e=[],_0x71f908=new Set();for(const {yamlConfig:_0xef31aa,folderPath:_0x2ee385,sourcePath:_0x1556a9}of _0x5a9a6b){const _0x10f5b9=resolveTDFolderPath(_0x2ee385,_0x13060c,_0x22181c),_0x187702=_0x10f5b9+':'+_0xef31aa[_0x1701fe(0x127)],_0x3b07a0=_0x38142a[_0x1701fe(0xfb)][_0x1701fe(0x1fc)](_0x187702),_0x5a417a=_0x3b07a0?_0x38142a[_0x1701fe(0x1bd)][_0x1701fe(0x1fc)](_0x3b07a0['id'])||[]:[];addFoldersToCreate(_0x10f5b9,_0x38142a[_0x1701fe(0x169)],_0x71f908);const _0x314458=calculateActivationActions(_0xef31aa['activations']||[],_0x5a417a,_0x38142a[_0x1701fe(0x159)],_0x38142a['connectionIdToNameMap']);for(const _0x554954 of _0x314458){(_0x554954[_0x1701fe(0x1b6)]==='create'||_0x554954[_0x1701fe(0x1b6)]===_0x1701fe(0x190))&&_0x554954[_0x1701fe(0x139)]&&(_0x554954[_0x1701fe(0x1e5)]=await _0x280a41(_0x554954[_0x1701fe(0x139)],_0x30bdce));}const _0x862a85=calculateSegmentDiff(_0xef31aa,_0x3b07a0,_0x5a417a,_0x38142a[_0x1701fe(0x159)],_0x38142a[_0x1701fe(0x1ea)]);_0x49458e[_0x1701fe(0x150)]({'relativePath':_0xef31aa[_0x1701fe(0x127)],'absolutePath':_0x1556a9,'yamlConfig':_0xef31aa,'folderPath':_0x10f5b9,'existingSegment':_0x3b07a0,'existingActivations':_0x5a417a,'isNew':_0x862a85['isNew'],'hasChanges':_0x862a85['hasChanges'],'diff':_0x862a85[_0x1701fe(0x165)],'activationActions':_0x314458});}return{'segmentFiles':_0x49458e,'foldersToCreate':_0x71f908};}export async function prepareJourneyFiles(_0x593eac,_0x28229a,_0x18c378,_0x5945e9){const _0x449405=a114_0x33ddfe,_0x5c16db=[],_0x57944c=new Set();for(const {yamlConfig:_0x262f1d,folderPath:_0x4d8fb8,sourcePath:_0x51869b}of _0x593eac){const _0x1268b1=resolveTDFolderPath(_0x4d8fb8,_0x18c378,_0x5945e9),_0x436fa6=_0x1268b1+':'+_0x262f1d['name'],_0x3156d1=_0x28229a[_0x449405(0x1c7)][_0x449405(0x1fc)](_0x436fa6);let _0x419039,_0x56a1ce;if(_0x3156d1&&_0x3156d1[_0x449405(0x18e)]>0x0){const _0xfafcb7=buildLocalExpandedRuleMappings(_0x262f1d),{createYamlContext:_0x157e21,prefetchJourneySegments:_0x5900dd}=createPushYamlContextForBundle(_0x28229a[_0x449405(0x1e2)],_0x28229a['parentId'],_0x28229a[_0x449405(0x1f7)],_0xfafcb7,_0x28229a[_0x449405(0x159)],_0x28229a[_0x449405(0x1ea)],_0x28229a[_0x449405(0x1c6)],_0x28229a['journeyById']);await _0x5900dd(_0x3156d1[_0x449405(0x1db)](_0xff0df3=>_0xff0df3['id']));const _0x2cb8a9=hasMultipleVersions(_0x262f1d),_0x342ff5=async _0x10a55b=>{const _0x2c5cf1=_0x449405,_0x3809c8=_0x28229a[_0x2c5cf1(0x18d)]?.[_0x2c5cf1(0x1fc)](_0x10a55b);if(_0x3809c8)return _0x3809c8;return _0x28229a[_0x2c5cf1(0x1b5)]({'journeyId':_0x10a55b,'journeyName':_0x262f1d[_0x2c5cf1(0x127)],'isMultiVersion':_0x3156d1[_0x2c5cf1(0x18e)]>0x1});};if(_0x2cb8a9&&_0x3156d1['length']>0x1){const _0x5adecf=[];for(const _0x34bce2 of _0x3156d1){const _0x4db545=_0x34bce2['versionNumber']||0x1;_0x28229a['progress']?.[_0x449405(0x190)](_0x449405(0x1f0)+_0x262f1d['name']+'\x20v'+_0x4db545);const _0x253bb0=await _0x342ff5(_0x34bce2['id']),_0x23a110=_0x157e21(_0x34bce2['id']),_0x564204=await journeyResponseToDef(_0x253bb0,_0x23a110);_0x5adecf[_0x449405(0x150)]({'item':_0x34bce2,'yaml':_0x564204});}const _0x52c502=buildLocalRuleToNameMappingFromJourney(_0x262f1d);_0x56a1ce=buildMergedJourneyDef(_0x5adecf,_0x52c502);const _0x125824=Math['max'](..._0x5adecf[_0x449405(0x1db)](_0x292f60=>_0x292f60['item'][_0x449405(0x1ec)]||0x0)),_0x34155b=_0x3156d1[_0x449405(0xfd)](_0x54233b=>(_0x54233b[_0x449405(0x1ec)]||0x0)===_0x125824);_0x34155b&&(_0x28229a[_0x449405(0x196)]?.[_0x449405(0x190)]('Fetching\x20'+_0x262f1d[_0x449405(0x127)]+'\x20v'+_0x125824),_0x419039=await _0x342ff5(_0x34155b['id']));}else{const _0x295046=_0x3156d1[_0x3156d1[_0x449405(0x18e)]-0x1];_0x28229a[_0x449405(0x196)]?.[_0x449405(0x190)](_0x449405(0x1f0)+_0x262f1d[_0x449405(0x127)]),_0x419039=await _0x342ff5(_0x295046['id']);const _0x2594a5=_0x157e21(_0x295046['id']),_0x5a09b1=await journeyResponseToDef(_0x419039,_0x2594a5),_0x120278=buildLocalRuleToNameMappingFromJourney(_0x262f1d);_0x56a1ce=buildMergedJourneyDef([{'item':_0x295046,'yaml':_0x5a09b1}],_0x120278);}}addFoldersToCreate(_0x1268b1,_0x28229a[_0x449405(0x169)],_0x57944c);const _0xe7bd63=calculateJourneyDiff(_0x262f1d,_0x56a1ce);_0x5c16db[_0x449405(0x150)]({'relativePath':_0x262f1d[_0x449405(0x127)],'absolutePath':_0x51869b,'yamlConfig':_0x262f1d,'folderPath':_0x1268b1,'existingJourney':_0x419039,'isNew':_0xe7bd63[_0x449405(0x14c)],'hasChanges':_0xe7bd63[_0x449405(0x170)],'diff':_0xe7bd63[_0x449405(0x165)]});}return{'journeyFiles':_0x5c16db,'foldersToCreate':_0x57944c};}export function calculateActivationActions(_0x32f128,_0x32c1cc,_0x5cb60c,_0x54e157){const _0x34c8a0=a114_0x33ddfe,_0x46e7fc=[],_0x2f1192=new Map();for(const _0x3d5361 of _0x32c1cc){_0x2f1192['set'](_0x3d5361[_0x34c8a0(0x127)],_0x3d5361);}const _0x41cb05=new Map();for(const _0x2f6fc6 of _0x32f128){_0x41cb05[_0x34c8a0(0x160)](_0x2f6fc6['name'],_0x2f6fc6);}for(const _0x3920df of _0x32f128){const _0x1ff30b=_0x2f1192[_0x34c8a0(0x1fc)](_0x3920df[_0x34c8a0(0x127)]);if(!_0x1ff30b)_0x46e7fc[_0x34c8a0(0x150)]({'type':_0x34c8a0(0x192),'name':_0x3920df[_0x34c8a0(0x127)],'yamlActivation':_0x3920df});else{const _0x5ba315=activationResponseToDef(_0x1ff30b,_0x5cb60c,_0x54e157),_0x5263f4=a114_0x98dcd3[_0x34c8a0(0x12a)](_0x5ba315),_0x2b23ca=a114_0x98dcd3[_0x34c8a0(0x12a)](_0x3920df);_0x5263f4!==_0x2b23ca&&_0x46e7fc[_0x34c8a0(0x150)]({'type':_0x34c8a0(0x190),'name':_0x3920df[_0x34c8a0(0x127)],'yamlActivation':_0x3920df,'existingActivation':_0x1ff30b});}}for(const _0x4b0d1b of _0x32c1cc){!_0x41cb05[_0x34c8a0(0x121)](_0x4b0d1b[_0x34c8a0(0x127)])&&_0x46e7fc[_0x34c8a0(0x150)]({'type':_0x34c8a0(0x1bb),'name':_0x4b0d1b['name'],'existingActivation':_0x4b0d1b});}return _0x46e7fc;}function calculateYamlDiff(_0x172842,_0x1fb44b){if(_0x1fb44b){const _0x3933f7=generateDiff(_0x1fb44b,_0x172842),_0xed74f9=hasChanges(_0x3933f7);return{'isNew':![],'hasChanges':_0xed74f9,'diff':_0xed74f9?formatDiffWithColors(_0x3933f7):undefined};}const _0x98cb85=generateDiff('',_0x172842);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x98cb85)};}export function calculateSegmentDiff(_0x4149b3,_0x47521b,_0x4586dd,_0x4de904,_0x5c667c){const _0x353fe2=segmentToYamlString(_0x4149b3),_0x4772db=_0x47521b?segmentToYamlString(segmentWithActivationsToYaml(_0x47521b,_0x4586dd,undefined,_0x4de904,_0x5c667c)):undefined;return calculateYamlDiff(_0x353fe2,_0x4772db);}export function calculateJourneyDiff(_0x3261c8,_0x250501){const _0x1f9b47=normalizeJourneyDef(_0x3261c8,_0x3261c8),_0x40aa13=a114_0x372d40(_0x1f9b47),_0x18b8fd=_0x250501?a114_0x372d40(normalizeJourneyDef(_0x250501,_0x3261c8)):undefined;return calculateYamlDiff(_0x40aa13,_0x18b8fd);}export function findSegmentsToDelete(_0x11bc27,_0x5534b9,_0x305fa0,_0x38e0c8,_0x12b54e){const _0x39ff34=a114_0x33ddfe,_0x495134=new Set();for(const {yamlConfig:_0x1b9508,folderPath:_0x2a1635}of _0x5534b9){_0x495134[_0x39ff34(0x1c4)](_0x2a1635+':'+_0x1b9508['name']);}return _0x11bc27[_0x39ff34(0x17a)](_0x2ac59d=>{const _0x2800f6=_0x39ff34,_0x17716a=_0x2ac59d[_0x2800f6(0x1ef)]?_0x305fa0['get'](_0x2ac59d['segmentFolderId'][_0x2800f6(0x1c2)]())||'':'',_0x3556a4=_0x17716a+':'+_0x2ac59d[_0x2800f6(0x127)];if(_0x495134[_0x2800f6(0x121)](_0x3556a4))return![];if(_0x12b54e)return _0x17716a===_0x38e0c8||_0x17716a[_0x2800f6(0x1a1)](_0x38e0c8+'/');return!![];});}export function findJourneysToDelete(_0x1a6657,_0x5d27bf,_0x4218bb,_0x260147,_0x19a828){const _0x1383ec=a114_0x33ddfe,_0x1fb483=new Set();for(const {yamlConfig:_0x4d4fdc,folderPath:_0x554be6}of _0x5d27bf){_0x1fb483[_0x1383ec(0x1c4)](_0x554be6+':'+_0x4d4fdc['name']);}return _0x1a6657[_0x1383ec(0x17a)](_0x218f8a=>{const _0x205a2f=_0x1383ec,_0x239e2d=_0x218f8a[_0x205a2f(0x163)]?_0x4218bb[_0x205a2f(0x1fc)](_0x218f8a['folderId'])||'':'',_0x36dc62=_0x239e2d+':'+_0x218f8a[_0x205a2f(0x15f)];if(_0x1fb483[_0x205a2f(0x121)](_0x36dc62))return![];if(_0x19a828)return _0x239e2d===_0x260147||_0x239e2d[_0x205a2f(0x1a1)](_0x260147+'/');return!![];});}function a114_0x40f3(){const _0x2448a0=['JOURNEY_UPDATE_ERROR','Deleted\x20activation\x20\x27','updated','uniqueSegmentName','idToEmailMap','activation_creating','590CIfuHD','includes','INTERNAL','replace','journeyBundleName','set','1019727WqJQVo','resolvedRule','folderId','ACTIVATION_SYNTAX_ERROR','diff','activation_','Created\x20segment\x20\x27','and\x20the\x20server\x20segment,\x20then\x20retry.','folderPathToId','buildUserMaps','resolveSegment','activation_updated','activation_updating','Updating\x20segment\x20\x27','\x27\x20from\x20file:\x20','hasChanges','keys','Failed\x20to\x20fetch\x20referenced\x20segment\x20','Created\x20journey\x20\x27','created','):\x20','all','relationships','__pending_act_','Creating\x20activation\x20\x27','filter','segment_deleted','segment_deleting','split','folderPath','SEGMENT_NOT_FOUND','Journey\x20\x27','existingSegment','entryCriteria','waitStepUnit','all_columns','JOURNEY_SYNTAX_ERROR','embedded_activation_created','conditionSegmentId','WaitStep','onProgress','toLowerCase','state','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','journeyById','length','localName','update','notification','create','logWarning','Delete\x20the\x20push\x20recovery\x20file\x20(','4673942fgOqBr','progress','journeyActivationStepId','conditionTimeoutUnit','sort','132EfEkSk','segmentId','waitStepType','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','105fSFiGu','from','logDeleted','startsWith',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','message','index','stages','activationContext','journeyId','description','Failed\x20to\x20resolve\x20activation\x20','schedule','\x20error(s)','relative','journeyStages','run_after_journey_refresh','slice','rootFolderId','conditionTimeoutDuration','\x27\x20entry\x20criteria','kind','dirname','fetchJourney','type','createActivation','conditions','Creating\x20folder\x20\x27','hex','delete','entries','activationsBySegmentId','parse','\x20segment\x20from\x20file:\x20','debug','existingJourney','toString','.$1.push-recovery.json','add','connection','activationStepsById','journeyBundlesByFolderAndName','createJourneySegment','8344KxYNQA','deleted','Condition','entry_criteria','tdx.sdk.push-workflow','uniqueServerName','deleteSegment','parseDocument','listActivations','25434iglgPT','Created\x20activation\x20\x27','Segment\x20not\x20found','../../utils/async.js','segments','rule','\x20activation\x20\x27','activationActions','decision_point','map','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','64606AqYUab','deleteActivation','steps','absolutePath','toISOString','deps','max','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','validatedRequest','updateActivation','size','withProgress','logSuccess','connectionIdToNameMap','Stage\x20\x27','versionNumber','idToName','Activation','segmentFolderId','Fetching\x20','yamlConfig','parentId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','connector_config','segment_updating','attributes','existingSegments','segment_creating','createdSegmentId','journey_updating','goal\x20criteria','get','segment_created','segmentByFolderAndName','./child-segment-yaml.js','find','flatMap','exitCriterias','parentFolder','effectiveFolderId','data','unchanged','1178120zgNjwb','DecisionPoint','join','activation_template_id',').\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','\x0a\x20\x20','isArray','segment','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journey_updated','createFolder','goal','milestone','25BJabwu','updateSegmentById','activations','resolveJourneyId','embedded_segment_created','SEGMENT_UPDATE_ERROR','digest','__pending_','folder_created','getJourney','branches','SEGMENT_SYNTAX_ERROR','journey_entry_criteria_','\x20(referenced\x20in\x20journey\x20','Duration','has','existingActivation','journey','Creating\x20segment\x20\x27','segmentNameToId','waitStep','name','valid','Entry\x20criteria:\x20','stringify','journey_created','Failed\x20to\x20resolve\x20segment\x20','getSegment','user','embeddedSegmentNameToId','verbose','action','stage\x20\x27','NOT_FOUND','results','Created\x20folder\x20\x27','columns','segment_updated','getSegment\x20failed\x20for\x20','yamlActivation','errors','\x27\x20for\x20','sha1','\x27\x20wait\x20condition','object','ACTIVATION_UPDATE_ERROR','Failed\x20to\x20','journeyName','Deleted\x20segment\x20\x27','getSegmentEntity','Updating\x20activation\x20\x27','journeys','null','values','entry','Activation\x20not\x20found:\x20','utf-8','Segment\x20not\x20found:\x20','isNew','\x27...','createdSegmentIds','533720PSGwxM','push','behavior','10QphNCv','getSegmentEntity\x20also\x20failed\x20for\x20','some'];a114_0x40f3=function(){return _0x2448a0;};return a114_0x40f3();}export function buildSegmentLookupMap(_0x3d4e26,_0xd4c0d2){const _0x4088e9=a114_0x33ddfe,_0x2485c1=new Map();for(const _0x52fe92 of _0x3d4e26){const _0x3ad67b=_0x52fe92[_0x4088e9(0x1ef)]?_0xd4c0d2[_0x4088e9(0x1fc)](_0x52fe92[_0x4088e9(0x1ef)][_0x4088e9(0x1c2)]())||'':'',_0x3d8ba6=_0x3ad67b+':'+_0x52fe92[_0x4088e9(0x127)];_0x2485c1[_0x4088e9(0x160)](_0x3d8ba6,_0x52fe92);}return _0x2485c1;}export function buildSegmentNameToIdMap(_0x2f19ef){const _0x43fc59=a114_0x33ddfe,_0x2d5c1e=new Map();for(const _0x3cd722 of _0x2f19ef){_0x2d5c1e[_0x43fc59(0x160)](_0x3cd722['name'],_0x3cd722['id']);}return _0x2d5c1e;}export function buildJourneyBundleLookupMap(_0x2e4c5c,_0x3a7678){const _0x399b3e=a114_0x33ddfe,_0xd7265=new Map();for(const _0x405d7d of _0x2e4c5c){const _0x2271ea=_0x405d7d['folderId']?_0x3a7678[_0x399b3e(0x1fc)](_0x405d7d['folderId'])||'':'',_0x29fa40=_0x2271ea+':'+_0x405d7d[_0x399b3e(0x15f)];!_0xd7265[_0x399b3e(0x121)](_0x29fa40)&&_0xd7265[_0x399b3e(0x160)](_0x29fa40,[]),_0xd7265[_0x399b3e(0x1fc)](_0x29fa40)[_0x399b3e(0x150)](_0x405d7d);}for(const _0x5cb143 of _0xd7265[_0x399b3e(0x147)]()){_0x5cb143[_0x399b3e(0x199)]((_0x296952,_0x315c3b)=>(_0x296952[_0x399b3e(0x1ec)]||0x0)-(_0x315c3b[_0x399b3e(0x1ec)]||0x0));}return _0xd7265;}export function collectFoldersToCreate(_0x41767e,_0x1079df){const _0x10c714=a114_0x33ddfe,_0x3e5583=new Set();for(const _0xc9300d of _0x41767e){if(!_0xc9300d)continue;if(_0x1079df[_0x10c714(0x121)](_0xc9300d))continue;const _0x5553cc=_0xc9300d[_0x10c714(0x17d)]('/');let _0x4ff933='';for(const _0x26b7a0 of _0x5553cc){_0x4ff933=_0x4ff933?_0x4ff933+'/'+_0x26b7a0:_0x26b7a0,!_0x1079df['has'](_0x4ff933)&&_0x3e5583[_0x10c714(0x1c4)](_0x4ff933);}}return _0x3e5583;}export function parseAndClassifyYamlFiles(_0x1499f0,_0x1a6137,_0x41e17e){const _0x5818ee=a114_0x33ddfe,_0x53aa34=[],_0x2dbed4=[];for(const _0x4a4e8f of _0x1499f0){const _0x51bbd1=a114_0x5e6eb0[_0x5818ee(0x1ac)](_0x1a6137,a114_0x5e6eb0[_0x5818ee(0x1b4)](_0x4a4e8f)),_0x82e9cc=_0x51bbd1==='.'?'':_0x51bbd1,_0x18d17f=readFileSync(_0x4a4e8f,'utf-8'),_0x44c321=a114_0x98dcd3[_0x5818ee(0x1be)](_0x18d17f);if(isJourneyDef(_0x44c321)){const _0x3ad49a=a114_0x4963c4(_0x18d17f);_0x2dbed4[_0x5818ee(0x150)]({'yamlConfig':_0x3ad49a,'folderPath':_0x82e9cc,'sourcePath':_0x4a4e8f});}else{if(!_0x41e17e?.['skipSegments']){const _0x2e4131=parseSegmentYamlFile(_0x18d17f),_0x9ee996=normalizeChildSegmentYaml(_0x2e4131);_0x53aa34[_0x5818ee(0x150)]({'yamlConfig':_0x9ee996,'folderPath':_0x82e9cc,'sourcePath':_0x4a4e8f});}}}return{'segments':_0x53aa34,'journeys':_0x2dbed4};}export function validateParsedFiles(_0x2280f1,_0x4a3d8a){const _0x1e8e65=a114_0x33ddfe,_0x3691db=[];for(const {yamlConfig:_0x5884a7,sourcePath:_0x469b58}of _0x2280f1[_0x1e8e65(0x1d6)]){const _0xfbb14e=readFileSync(_0x469b58,_0x1e8e65(0x14a)),_0x1bdacc=a114_0x98dcd3[_0x1e8e65(0x1d0)](_0xfbb14e),_0x451ecf=validateSegmentDef(_0x5884a7,{'source':_0xfbb14e,'document':_0x1bdacc});if(!_0x451ecf['valid']){const _0x52e432=a114_0x5e6eb0[_0x1e8e65(0x1ac)](_0x4a3d8a,_0x469b58);_0x3691db[_0x1e8e65(0x150)]({'filePath':_0x52e432,'source':_0xfbb14e,'result':_0x451ecf,'isJourney':![]});}}for(const {yamlConfig:_0x3c02ac,sourcePath:_0xbe9a96}of _0x2280f1[_0x1e8e65(0x145)]){const _0x9803c2=readFileSync(_0xbe9a96,_0x1e8e65(0x14a)),_0x2298c2=a114_0x98dcd3['parseDocument'](_0x9803c2),_0x34b84c=validateJourneyDef(_0x3c02ac,{'source':_0x9803c2,'document':_0x2298c2});if(!_0x34b84c[_0x1e8e65(0x128)]){const _0x93f356=a114_0x5e6eb0[_0x1e8e65(0x1ac)](_0x4a3d8a,_0xbe9a96);_0x3691db[_0x1e8e65(0x150)]({'filePath':_0x93f356,'source':_0x9803c2,'result':_0x34b84c,'isJourney':!![]});}}return _0x3691db;}export function formatValidationErrors(_0x267997){const _0x346e9b=a114_0x33ddfe,_0x18a4af=[];for(const {filePath:_0x3c1d78,source:_0x39c5c4,result:_0x22e481,isJourney:_0x567af9}of _0x267997){const _0x5e616b=_0x567af9?'journey':_0x346e9b(0x10c);_0x18a4af[_0x346e9b(0x150)]('\x0a'+_0x3c1d78+'\x20('+_0x5e616b+_0x346e9b(0x175)+_0x22e481[_0x346e9b(0x13a)][_0x346e9b(0x18e)]+_0x346e9b(0x1ab)),_0x18a4af['push'](formatValidationResult(_0x22e481,_0x39c5c4,_0x3c1d78));}return _0x18a4af['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x172a75){const _0x10c7fa=a114_0x33ddfe,_0x50f63b=new Set(),_0x45c3fc=new Map(),_0x31770b=collectSegmentUsageCounts(_0x172a75);if(_0x172a75['segments'])for(const [_0x44c531,_0x581d93]of Object[_0x10c7fa(0x1bc)](_0x172a75[_0x10c7fa(0x1d6)])){_0x50f63b[_0x10c7fa(0x1c4)](_0x44c531);if(_0x581d93['rule']){const _0x2126f3=yamlRuleToApi(_0x581d93[_0x10c7fa(0x1d7)]),_0x405055=apiRuleToYaml(_0x2126f3);_0x45c3fc[_0x10c7fa(0x160)](_0x44c531,_0x405055);}}const _0x549e1a=new Map();let _0x559605=0x0;for(const [_0x76fb5c,_0x379a35]of _0x45c3fc){const _0x159c7c=serializeExpandedRule(_0x379a35,_0x45c3fc),_0x186f4c=_0x549e1a[_0x10c7fa(0x1fc)](_0x159c7c)||[];_0x186f4c[_0x10c7fa(0x150)]({'name':_0x76fb5c,'index':_0x559605}),_0x549e1a[_0x10c7fa(0x160)](_0x159c7c,_0x186f4c),_0x559605++;}const _0x4dc6e2=new Map();for(const [_0x1f1e5,_0x58c072]of _0x549e1a){const _0x1efb85=_0x58c072['slice']()[_0x10c7fa(0x199)]((_0x39e922,_0x234e82)=>{const _0x560b7d=_0x10c7fa,_0x404e70=_0x31770b[_0x560b7d(0x1fc)](_0x39e922['name'])||0x0,_0x1d5722=_0x31770b[_0x560b7d(0x1fc)](_0x234e82['name'])||0x0;if(_0x404e70!==_0x1d5722)return _0x1d5722-_0x404e70;return _0x39e922[_0x560b7d(0x1a4)]-_0x234e82['index'];})[_0x10c7fa(0x1db)](_0x3b7880=>_0x3b7880[_0x10c7fa(0x127)]),_0x2adae8=[];for(const _0x48c990 of _0x1efb85){const _0x75c6de=_0x31770b[_0x10c7fa(0x1fc)](_0x48c990)||0x0,_0x14bf1f=Math[_0x10c7fa(0x1e3)](_0x75c6de,0x1);for(let _0x14c2c8=0x0;_0x14c2c8<_0x14bf1f;_0x14c2c8++){_0x2adae8['push'](_0x48c990);}}_0x4dc6e2['set'](_0x1f1e5,_0x2adae8);}return{'existingLocalSegmentNames':_0x50f63b,'localSegmentRules':_0x45c3fc,'localExpandedRuleToNames':_0x4dc6e2};}export function createSegmentIdResolver(_0x243e2d,_0x40ef24){return async _0x422e58=>{const _0x200ef9=a114_0x1937,_0x5c325f=_0x243e2d[_0x200ef9(0x1fc)](_0x422e58);if(!_0x5c325f)throw new SDKError(ErrorCode[_0x200ef9(0x17f)],_0x200ef9(0x14b)+_0x422e58+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x40ef24+'\x27)');return _0x5c325f;};}export function extractRootFolderId(_0x5c14f6){const _0x14d4d7=a114_0x33ddfe;return _0x5c14f6[_0x14d4d7(0x177)]?.['parentSegmentFolder']?.['data']?.['id']||_0x5c14f6['relationships']?.[_0x14d4d7(0x100)]?.[_0x14d4d7(0x102)]?.['id'];}export function buildConnectionMaps(_0x591a23){const _0x427462=a114_0x33ddfe,_0x2f78d1=new Map(),_0x5d7c05=new Map(),_0x8a6dcf=new Map();for(const _0x2149c7 of _0x591a23){_0x2f78d1[_0x427462(0x160)](_0x2149c7[_0x427462(0x127)],parseInt(_0x2149c7['id'],0xa)),_0x5d7c05['set'](_0x2149c7['id'],_0x2149c7[_0x427462(0x127)]),_0x8a6dcf['set'](_0x2149c7['name'],_0x2149c7[_0x427462(0x1b6)]);}return{'nameToId':_0x2f78d1,'idToName':_0x5d7c05,'nameToType':_0x8a6dcf};}export function calculatePushStats(_0x162a76,_0x20b0ce,_0x1b3dd5,_0x256334,_0xbfaa0d,_0x2835ae,_0x4c8d32){const _0x43b48c=a114_0x33ddfe,_0x4b4497=_0x162a76[_0x43b48c(0x17a)](_0x2d1b37=>_0x2d1b37['isNew']),_0x166df1=_0x162a76[_0x43b48c(0x17a)](_0x314c15=>!_0x314c15[_0x43b48c(0x14c)]&&_0x314c15[_0x43b48c(0x170)]),_0x24ec77=_0x162a76[_0x43b48c(0x17a)](_0x5741f8=>!_0x5741f8[_0x43b48c(0x14c)]&&!_0x5741f8[_0x43b48c(0x170)]),_0x2aeea4=_0x2835ae?_0x256334:[],_0x18a930=_0x20b0ce[_0x43b48c(0x17a)](_0x354e7d=>_0x354e7d[_0x43b48c(0x14c)]),_0x3915d0=_0x20b0ce[_0x43b48c(0x17a)](_0x2f6795=>!_0x2f6795['isNew']&&_0x2f6795[_0x43b48c(0x170)]),_0x302b60=_0x20b0ce[_0x43b48c(0x17a)](_0x17f8ba=>!_0x17f8ba[_0x43b48c(0x14c)]&&!_0x17f8ba[_0x43b48c(0x170)]),_0x35d408=_0x2835ae?_0xbfaa0d:[],_0x3d6c95=_0x162a76[_0x43b48c(0xfe)](_0x95563d=>_0x95563d[_0x43b48c(0x1d9)]),_0x85fcb9=_0x3d6c95[_0x43b48c(0x17a)](_0x3b6ccb=>_0x3b6ccb[_0x43b48c(0x1b6)]===_0x43b48c(0x192)),_0x546d2f=_0x3d6c95[_0x43b48c(0x17a)](_0x301645=>_0x301645[_0x43b48c(0x1b6)]===_0x43b48c(0x190)),_0x423c5f=_0x3d6c95[_0x43b48c(0x17a)](_0xa1bd3e=>_0xa1bd3e[_0x43b48c(0x1b6)]===_0x43b48c(0x1bb)),_0x337b88=Array[_0x43b48c(0x19f)](_0x1b3dd5)['sort'](),_0x30583a=_0x4c8d32?![]:_0x4b4497[_0x43b48c(0x18e)]>0x0||_0x166df1['length']>0x0||_0x2aeea4[_0x43b48c(0x18e)]>0x0,_0x2a4b02=_0x18a930[_0x43b48c(0x18e)]>0x0||_0x3915d0[_0x43b48c(0x18e)]>0x0||_0x35d408[_0x43b48c(0x18e)]>0x0,_0x628bbf=_0x4c8d32?![]:_0x3d6c95[_0x43b48c(0x18e)]>0x0,_0x4ead38=_0x337b88[_0x43b48c(0x18e)]>0x0;return{'segments':{'new':_0x4b4497,'changed':_0x166df1,'unchanged':_0x24ec77,'toDelete':_0x2aeea4},'journeys':{'new':_0x18a930,'changed':_0x3915d0,'unchanged':_0x302b60,'toDelete':_0x35d408},'activations':{'all':_0x3d6c95,'toCreate':_0x85fcb9,'toUpdate':_0x546d2f,'toDelete':_0x423c5f},'folders':{'toCreate':_0x337b88},'counts':{'segments':{'new':_0x4b4497['length'],'changed':_0x166df1['length'],'unchanged':_0x24ec77[_0x43b48c(0x18e)],'toDelete':_0x2aeea4[_0x43b48c(0x18e)]},'journeys':{'new':_0x18a930[_0x43b48c(0x18e)],'changed':_0x3915d0['length'],'unchanged':_0x302b60[_0x43b48c(0x18e)],'toDelete':_0x35d408[_0x43b48c(0x18e)]},'activations':{'create':_0x85fcb9[_0x43b48c(0x18e)],'update':_0x546d2f[_0x43b48c(0x18e)],'delete':_0x423c5f[_0x43b48c(0x18e)]},'folders':_0x337b88['length']},'hasChanges':_0x30583a||_0x2a4b02||_0x628bbf||_0x4ead38};}export async function buildPushExecutionContext(_0x347867,_0x274bd6,_0x5a740f,_0x31538f,_0x12b453,_0x5b1623){const _0x400477=a114_0x33ddfe,_0x449aa0=extractRootFolderId(_0x5a740f),{pathToId:_0x1ab82b,idToPath:_0x617b51}=buildFolderMaps(_0x12b453),_0x4241a6=buildSegmentNameToIdMap(_0x31538f),_0x46cc63=new Map(),{batchAsync:_0xd91f8c}=await import(_0x400477(0x1d5)),[_0x1f264f,_0x5416e5]=await Promise[_0x400477(0x176)]([_0x347867[_0x400477(0x12e)][_0x400477(0x16a)](),_0x347867[_0x400477(0x1c5)]['list'](),((async()=>{!_0x5b1623&&_0x31538f['length']>0x0&&await _0xd91f8c(_0x31538f,async _0x1e8778=>{const _0x38a986=a114_0x1937,_0x24a69a=await _0x347867[_0x38a986(0x10c)][_0x38a986(0x1d1)](_0x274bd6,_0x1e8778['id']);_0x46cc63[_0x38a986(0x160)](_0x1e8778['id'],_0x24a69a);});})())]),{emailToId:_0x178a61,idToEmail:_0x567574}=_0x1f264f,_0x13902f=buildConnectionMaps(_0x5416e5);return{'rootFolderId':_0x449aa0,'folderPathToId':_0x1ab82b,'folderIdToPath':_0x617b51,'segmentNameToId':_0x4241a6,'activationsBySegmentId':_0x46cc63,'emailToIdMap':_0x178a61,'idToEmailMap':_0x567574,'connectionNameToIdMap':_0x13902f['nameToId'],'connectionIdToNameMap':_0x13902f[_0x400477(0x1ed)],'connectionNameToTypeMap':_0x13902f['nameToType']};}export function createPushYamlContextForBundle(_0x412241,_0x57aa9f,_0x4013f9,_0x532284,_0x264d4f,_0x2d08dc,_0x237088,_0x5d4979){const {existingLocalSegmentNames:_0x1223a6,localExpandedRuleToNames:_0x54b973}=_0x532284,_0x2b1d15=new Set(),_0x272233=new Map(),_0x41ba1e=new Map(),_0x4e9b72=new Map(),_0x5ee40d=createJumpTargetCache(),_0x3d198b=new Map(),_0x73381f=new Map(),_0x8086ed=new Set();let _0x295360;const _0x10e6d7=_0x414620=>{const _0x4ef662={'resolveSegment':async _0x2a83cf=>{const _0x2be6ae=a114_0x1937,_0x273d49=_0x4e9b72[_0x2be6ae(0x1fc)](_0x2a83cf);if(_0x273d49!==undefined)return{'name':_0x273d49,'isJourneyLocal':!![]};try{const _0x317bd1=await fetchSegment(_0x412241,_0x57aa9f,_0x2a83cf,_0x4013f9);if(!_0x317bd1)throw new Error(_0x2be6ae(0x1d4));const _0x1c1033=generateJourneyLocalName(_0x317bd1[_0x2be6ae(0x127)]),_0x161cbc=_0x317bd1[_0x2be6ae(0x1b3)]===SEGMENT_KIND_JOURNEY&&_0x1c1033!==undefined;let _0xb4f3a5=_0x317bd1[_0x2be6ae(0x127)],_0x5adf8c;if(_0x161cbc&&_0x317bd1[_0x2be6ae(0x1d7)]){const _0x3bac26=apiRuleToYaml(_0x317bd1[_0x2be6ae(0x1d7)]);_0x73381f[_0x2be6ae(0x160)](_0x2a83cf,_0x3bac26);const _0x2f8310=async _0x5c6955=>{const _0xc4e4cc=_0x2be6ae,_0x2b7344=collectSegmentRefsFromRule(_0x5c6955);for(const _0x4965e8 of _0x2b7344){if(!_0x73381f[_0xc4e4cc(0x121)](_0x4965e8))try{const _0x5ad403=await fetchSegment(_0x412241,_0x57aa9f,_0x4965e8,_0x4013f9);if(_0x5ad403?.[_0xc4e4cc(0x1d7)]){const _0x53a58e=apiRuleToYaml(_0x5ad403[_0xc4e4cc(0x1d7)]);_0x73381f['set'](_0x4965e8,_0x53a58e),await _0x2f8310(_0x53a58e);}}catch(_0x228273){logger[_0xc4e4cc(0x1c0)](_0xc4e4cc(0x172)+_0x4965e8+':\x20'+_0x228273);}}};await _0x2f8310(_0x3bac26);const _0x4b8e24=serializeExpandedRule(_0x3bac26,_0x73381f),_0x4ed342=_0x54b973[_0x2be6ae(0x1fc)](_0x4b8e24);if(_0x4ed342&&_0x4ed342[_0x2be6ae(0x18e)]>0x0){const _0xf8fca6=_0x272233[_0x2be6ae(0x1fc)](_0x4b8e24)||0x0,_0x2e2fe8=_0x4ed342[_0xf8fca6]||_0x4ed342[_0x4ed342[_0x2be6ae(0x18e)]-0x1];_0x272233['set'](_0x4b8e24,_0xf8fca6+0x1),_0xb4f3a5=_0x2e2fe8,_0x2b1d15[_0x2be6ae(0x1c4)](_0xb4f3a5),_0x4e9b72[_0x2be6ae(0x160)](_0x2a83cf,_0xb4f3a5);const _0x202315=await resolveRuleSegmentRefs(_0x3bac26,async _0xd886e0=>{const _0x4af5be=_0x2be6ae,_0x131395=_0x4e9b72[_0x4af5be(0x1fc)](_0xd886e0);if(_0x131395)return _0x131395;const _0x321327=await _0x295360[_0x4af5be(0x16b)](_0xd886e0);return _0x321327[_0x4af5be(0x127)];});_0x5adf8c={'description':_0x317bd1[_0x2be6ae(0x1a8)],'rule':_0x202315};}else{const _0x983c38=_0x3d198b[_0x2be6ae(0x1fc)](_0x4b8e24);if(_0x983c38)_0xb4f3a5=_0x983c38,_0x4e9b72[_0x2be6ae(0x160)](_0x2a83cf,_0xb4f3a5);else{if(_0x1c1033){let _0x35bbd6=_0x1c1033,_0x92127f=0x2;while(_0x2b1d15['has'](_0x35bbd6)||_0x1223a6[_0x2be6ae(0x121)](_0x35bbd6)){_0x35bbd6=_0x1c1033+'_'+_0x92127f,_0x92127f++;}_0x2b1d15[_0x2be6ae(0x1c4)](_0x35bbd6),_0xb4f3a5=_0x35bbd6;}_0x4e9b72['set'](_0x2a83cf,_0xb4f3a5),_0x3d198b['set'](_0x4b8e24,_0xb4f3a5);const _0x4e80c5=await resolveRuleSegmentRefs(_0x3bac26,async _0x328ec2=>{const _0x81490c=_0x2be6ae,_0x41e1a0=_0x4e9b72[_0x81490c(0x1fc)](_0x328ec2);if(_0x41e1a0)return _0x41e1a0;const _0x285ae7=await _0x295360[_0x81490c(0x16b)](_0x328ec2);return _0x285ae7[_0x81490c(0x127)];});_0x5adf8c={'description':_0x317bd1[_0x2be6ae(0x1a8)],'rule':_0x4e80c5};}}}return{'name':_0xb4f3a5,'isJourneyLocal':_0x161cbc,'definition':_0x5adf8c};}catch(_0x2db025){return logger[_0x2be6ae(0x1c0)](_0x2be6ae(0x12c)+_0x2a83cf+':\x20'+_0x2db025),{'name':_0x2a83cf,'isJourneyLocal':![]};}},'resolveActivation':async _0x3fff96=>{const _0x18b510=a114_0x1937,_0x1ad807=_0x41ba1e['get'](_0x3fff96);if(_0x1ad807!==undefined)return{'name':_0x1ad807,'isJourneyLocal':!![]};try{let _0x3b1668=_0x237088?.[_0x18b510(0x1fc)](_0x3fff96);!_0x3b1668&&(_0x3b1668=await _0x412241[_0x18b510(0x123)]['getActivation'](_0x414620,_0x3fff96));const _0x91d04a=_0x3b1668[_0x18b510(0x1f6)]['activationParams'][_0x18b510(0x127)]||_0x3fff96,_0x83c751=sanitizeYamlKey(_0x91d04a)||_0x18b510(0x166)+_0x3fff96,_0x1024b8=_0x83c751;_0x41ba1e['set'](_0x3fff96,_0x1024b8);const _0x3cf551=journeyActivationStepToYaml(_0x3b1668,_0x264d4f,_0x2d08dc);return{'name':_0x1024b8,'isJourneyLocal':!![],'definition':_0x3cf551};}catch(_0x57aede){return logger[_0x18b510(0x1c0)](_0x18b510(0x1a9)+_0x3fff96+':\x20'+_0x57aede),{'name':_0x3fff96,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x22c510,_0xbf1c79)=>resolveJumpTarget(_0x22c510,_0xbf1c79,_0x5ee40d,async _0x28629f=>{const _0x40be33=a114_0x1937,_0x495d63=_0x5d4979?.[_0x40be33(0x1fc)](_0x28629f);if(_0x495d63)return _0x495d63;return _0x412241[_0x40be33(0x123)][_0x40be33(0x11b)](_0x28629f);})};return _0x295360=_0x4ef662,_0x4ef662;},_0x4057ac=async _0x3c7905=>{const _0x173cea=a114_0x1937,{collectSegmentIdsFromJourneyApi:_0x2da99d}=await import('./journey-yaml.js'),{batchAsync:_0x37dafb}=await import(_0x173cea(0x1d5)),_0x240255=new Set();for(const _0xa3344f of _0x3c7905){let _0x4f7b2d=_0x5d4979?.[_0x173cea(0x1fc)](_0xa3344f);!_0x4f7b2d&&(_0x4f7b2d=await _0x412241[_0x173cea(0x123)][_0x173cea(0x11b)](_0xa3344f));const _0xe7c7c2=_0x2da99d(_0x4f7b2d);for(const _0x43c85e of _0xe7c7c2){_0x240255['add'](_0x43c85e);}}let _0x5d4b99=Array['from'](_0x240255);while(_0x5d4b99[_0x173cea(0x18e)]>0x0){const _0x1b4009=_0x5d4b99[_0x173cea(0x17a)](_0x23f5d0=>!_0x8086ed[_0x173cea(0x121)](_0x23f5d0));if(_0x1b4009[_0x173cea(0x18e)]===0x0)break;const _0x2a94b4=await _0x37dafb(_0x1b4009,async _0x2658ba=>{_0x8086ed['add'](_0x2658ba);const _0x3c8d52=await fetchSegment(_0x412241,_0x57aa9f,_0x2658ba,_0x4013f9);if(!_0x3c8d52)return null;return{'segmentId':_0x2658ba,'segment':_0x3c8d52};},0xa),_0x4ca382=new Set();for(const _0x5d940a of _0x2a94b4){if(!_0x5d940a?.[_0x173cea(0x10c)]?.[_0x173cea(0x1d7)])continue;const _0x1d5b6d=apiRuleToYaml(_0x5d940a[_0x173cea(0x10c)]['rule']);_0x73381f['set'](_0x5d940a[_0x173cea(0x19b)],_0x1d5b6d);const _0x6709d=collectSegmentRefsFromRule(_0x1d5b6d);for(const _0x331c86 of _0x6709d){!_0x8086ed['has'](_0x331c86)&&_0x4ca382[_0x173cea(0x1c4)](_0x331c86);}}_0x5d4b99=Array[_0x173cea(0x19f)](_0x4ca382);}};return{'createYamlContext':_0x10e6d7,'prefetchJourneySegments':_0x4057ac};}export async function executePushSegments(_0x4623b7,_0x2ed7d6,_0x46bcc8,_0x2f804d,_0x1ab23a){const _0x563de5=a114_0x33ddfe,{segmentDefToCreateRequest:_0x5b0a04,segmentDefToUpdateRequest:_0x131c60}=await import(_0x563de5(0xfc)),_0x3ebb7e=_0x46bcc8[_0x563de5(0x169)],_0x3a1623=0x5,_0x11c403=async _0x53490a=>{const _0x42dedc=_0x563de5,_0x18ab5c=_0x53490a[_0x42dedc(0x17e)]?_0x3ebb7e[_0x42dedc(0x1fc)](_0x53490a[_0x42dedc(0x17e)]):undefined;let _0x49e2f8;const _0xcc5df2={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x53490a[_0x42dedc(0x14c)]){_0x1ab23a[_0x42dedc(0x189)]?.({'type':_0x42dedc(0x1f8),'name':_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]});const _0x72f723=_0x5b0a04(_0x53490a[_0x42dedc(0x1f1)],_0x18ab5c),_0x4b3cfe=await _0x1ab23a['withProgress'](_0x42dedc(0x124)+_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]+'\x27...',()=>_0x4623b7['segment']['createSegment'](_0x2f804d['parentId'],_0x72f723));_0x49e2f8=_0x4b3cfe[_0x42dedc(0x102)]['id'],_0xcc5df2[_0x42dedc(0x1f9)]={'name':_0x53490a[_0x42dedc(0x1f1)]['name'],'id':_0x49e2f8},_0x1ab23a['onProgress']?.({'type':_0x42dedc(0x1fd),'name':_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)],'segmentId':_0x49e2f8}),_0x1ab23a['logSuccess']?.(_0x42dedc(0x167)+_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]+'\x27'),_0xcc5df2[_0x42dedc(0x174)]=0x1;}else{if(_0x53490a['hasChanges']){_0x1ab23a[_0x42dedc(0x189)]?.({'type':_0x42dedc(0x1f5),'name':_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]});const _0x3a9bb7=_0x131c60(_0x53490a[_0x42dedc(0x1f1)]);_0x18ab5c!==_0x53490a[_0x42dedc(0x181)]?.['segmentFolderId']&&(_0x3a9bb7['segmentFolderId']=_0x18ab5c?parseInt(_0x18ab5c,0xa):undefined),await _0x1ab23a['withProgress'](_0x42dedc(0x16e)+_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]+_0x42dedc(0x14d),()=>_0x4623b7[_0x42dedc(0x10c)][_0x42dedc(0x113)](_0x2f804d[_0x42dedc(0x1f2)],_0x53490a[_0x42dedc(0x181)]['id'],_0x3a9bb7)),_0x49e2f8=_0x53490a[_0x42dedc(0x181)]['id'],_0x1ab23a[_0x42dedc(0x189)]?.({'type':_0x42dedc(0x137),'name':_0x53490a['yamlConfig'][_0x42dedc(0x127)]}),_0x1ab23a['logSuccess']?.('Updated\x20segment\x20\x27'+_0x53490a[_0x42dedc(0x1f1)]['name']+'\x27'),_0xcc5df2[_0x42dedc(0x157)]=0x1;}else _0x49e2f8=_0x53490a[_0x42dedc(0x181)]['id'];}}catch(_0x45dba8){const _0xaa36e4=isHttp400Error(_0x45dba8),_0x31acf7=_0xaa36e4?ErrorCode[_0x42dedc(0x11d)]:ErrorCode[_0x42dedc(0x117)],_0x5d04b9=getErrorMessage(_0x45dba8);throw new SDKError(_0x31acf7,'Failed\x20to\x20'+(_0x53490a[_0x42dedc(0x14c)]?_0x42dedc(0x192):_0x42dedc(0x190))+_0x42dedc(0x1bf)+_0x53490a['absolutePath']+_0x42dedc(0x10a)+_0x5d04b9,_0x45dba8);}try{const _0x4d271d=await syncActivationsForSegment(_0x4623b7,_0x2f804d[_0x42dedc(0x1f2)],_0x49e2f8,_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)],_0x53490a[_0x42dedc(0x1d9)],_0x1ab23a,_0x53490a[_0x42dedc(0x1e0)]);_0xcc5df2['activations']=_0x4d271d;}catch(_0x3954b6){if(_0x3954b6 instanceof SDKError)throw _0x3954b6;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x42dedc(0x10d)+_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]+_0x42dedc(0x16f)+_0x53490a[_0x42dedc(0x1e0)]+'\x0a\x20\x20'+getErrorMessage(_0x3954b6),_0x3954b6);}return _0xcc5df2;},_0x429a72=await batchAsync(_0x2ed7d6,_0x11c403,_0x3a1623),_0x1130f2={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xe51480 of _0x429a72){_0x1130f2[_0x563de5(0x174)]+=_0xe51480[_0x563de5(0x174)],_0x1130f2[_0x563de5(0x157)]+=_0xe51480[_0x563de5(0x157)],_0xe51480[_0x563de5(0x1f9)]&&_0x1130f2[_0x563de5(0x14e)][_0x563de5(0x160)](_0xe51480[_0x563de5(0x1f9)]['name'],_0xe51480[_0x563de5(0x1f9)]['id']),_0x1130f2[_0x563de5(0x114)][_0x563de5(0x174)]+=_0xe51480[_0x563de5(0x114)]['created'],_0x1130f2[_0x563de5(0x114)][_0x563de5(0x157)]+=_0xe51480[_0x563de5(0x114)][_0x563de5(0x157)],_0x1130f2['activations']['deleted']+=_0xe51480[_0x563de5(0x114)][_0x563de5(0x1ca)];}return _0x1130f2;}async function syncActivationsForSegment(_0x49f2a5,_0x49d39b,_0xeafb52,_0x23500c,_0xe598b2,_0x27e19d,_0x17caa8){const _0x1e073e=a114_0x33ddfe,_0x3cfddb={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x202dbe of _0xe598b2){try{if(_0x202dbe[_0x1e073e(0x1b6)]===_0x1e073e(0x192)&&_0x202dbe[_0x1e073e(0x1e5)])_0x27e19d[_0x1e073e(0x189)]?.({'type':_0x1e073e(0x15a),'segmentName':_0x23500c,'activationName':_0x202dbe[_0x1e073e(0x127)]}),await _0x27e19d[_0x1e073e(0x1e8)](_0x1e073e(0x179)+_0x202dbe[_0x1e073e(0x127)]+_0x1e073e(0x14d),()=>_0x49f2a5[_0x1e073e(0x10c)][_0x1e073e(0x1b7)](_0x49d39b,_0xeafb52,_0x202dbe[_0x1e073e(0x1e5)])),_0x27e19d[_0x1e073e(0x189)]?.({'type':'activation_created','segmentName':_0x23500c,'activationName':_0x202dbe['name']}),_0x27e19d[_0x1e073e(0x1e9)]?.(_0x1e073e(0x1d3)+_0x202dbe['name']+'\x27'),_0x3cfddb[_0x1e073e(0x174)]++;else{if(_0x202dbe[_0x1e073e(0x1b6)]===_0x1e073e(0x190)&&_0x202dbe['validatedRequest']&&_0x202dbe['existingActivation'])_0x27e19d[_0x1e073e(0x189)]?.({'type':_0x1e073e(0x16d),'segmentName':_0x23500c,'activationName':_0x202dbe[_0x1e073e(0x127)]}),await _0x27e19d[_0x1e073e(0x1e8)](_0x1e073e(0x144)+_0x202dbe[_0x1e073e(0x127)]+_0x1e073e(0x14d),()=>_0x49f2a5[_0x1e073e(0x10c)][_0x1e073e(0x1e6)](_0x49d39b,_0xeafb52,_0x202dbe['existingActivation']['id'],_0x202dbe[_0x1e073e(0x1e5)])),_0x27e19d[_0x1e073e(0x189)]?.({'type':_0x1e073e(0x16c),'segmentName':_0x23500c,'activationName':_0x202dbe[_0x1e073e(0x127)]}),_0x27e19d[_0x1e073e(0x1e9)]?.('Updated\x20activation\x20\x27'+_0x202dbe[_0x1e073e(0x127)]+'\x27'),_0x3cfddb[_0x1e073e(0x157)]++;else _0x202dbe[_0x1e073e(0x1b6)]===_0x1e073e(0x1bb)&&_0x202dbe['existingActivation']&&(_0x27e19d[_0x1e073e(0x189)]?.({'type':'activation_deleting','segmentName':_0x23500c,'activationName':_0x202dbe[_0x1e073e(0x127)]}),await _0x27e19d[_0x1e073e(0x1e8)]('Deleting\x20activation\x20\x27'+_0x202dbe[_0x1e073e(0x127)]+_0x1e073e(0x14d),()=>_0x49f2a5['segment'][_0x1e073e(0x1de)](_0x49d39b,_0xeafb52,_0x202dbe[_0x1e073e(0x122)]['id'])),_0x27e19d['onProgress']?.({'type':'activation_deleted','segmentName':_0x23500c,'activationName':_0x202dbe['name']}),_0x27e19d[_0x1e073e(0x1a0)]?.(_0x1e073e(0x156)+_0x202dbe[_0x1e073e(0x127)]+'\x27'),_0x3cfddb['deleted']++);}}catch(_0x54416a){const _0x20c2cd=isHttp400Error(_0x54416a),_0x3a198e=_0x20c2cd?ErrorCode[_0x1e073e(0x164)]:ErrorCode[_0x1e073e(0x13f)],_0x27fded=getErrorMessage(_0x54416a);throw new SDKError(_0x3a198e,_0x1e073e(0x140)+_0x202dbe['type']+_0x1e073e(0x1d8)+_0x202dbe[_0x1e073e(0x127)]+'\x27\x20from\x20file:\x20'+_0x17caa8+_0x1e073e(0x10a)+_0x27fded,_0x54416a);}}return _0x3cfddb;}export async function executePushFolders(_0x5de3cf,_0x4af0e4,_0x56401f,_0x25bcf3,_0x392561){const _0x2b1282=a114_0x33ddfe,_0x1d1258=new Map(_0x56401f);for(const _0x240bf6 of _0x4af0e4){const _0x44f9fc=_0x240bf6[_0x2b1282(0x17d)]('/'),_0x4697c2=_0x44f9fc[_0x44f9fc['length']-0x1],_0x4f03f4=_0x44f9fc[_0x2b1282(0x1af)](0x0,-0x1)[_0x2b1282(0x106)]('/'),_0x4d23a7=_0x1d1258[_0x2b1282(0x1fc)](_0x4f03f4);_0x392561[_0x2b1282(0x189)]?.({'type':'folder_creating','folder':_0x240bf6});const _0x3f354e={'name':_0x4697c2,'parentFolderId':_0x4d23a7},_0x4b8d8a=await _0x392561[_0x2b1282(0x1e8)](_0x2b1282(0x1b9)+_0x240bf6+_0x2b1282(0x14d),()=>_0x5de3cf[_0x2b1282(0x10c)][_0x2b1282(0x10f)](_0x25bcf3[_0x2b1282(0x1f2)],_0x3f354e));_0x1d1258[_0x2b1282(0x160)](_0x240bf6,_0x4b8d8a[_0x2b1282(0x102)]['id']),_0x392561[_0x2b1282(0x189)]?.({'type':_0x2b1282(0x11a),'folder':_0x240bf6,'folderId':_0x4b8d8a[_0x2b1282(0x102)]['id']}),_0x392561['logInfo']?.(_0x2b1282(0x135)+_0x240bf6+'\x27');}return _0x1d1258;}export async function executePushSegmentDeletions(_0x161523,_0x1b66cf,_0x26d43c){const _0x236764=a114_0x33ddfe;if(_0x1b66cf[_0x236764(0x18e)]===0x0)return 0x0;const {batchAsync:_0x2b8d28}=await import(_0x236764(0x1d5)),_0x111908=0x5,_0x4e4032=await _0x2b8d28(_0x1b66cf,async _0x2fd9bb=>{const _0x3a3782=_0x236764;return _0x26d43c[_0x3a3782(0x189)]?.({'type':_0x3a3782(0x17c),'name':_0x2fd9bb[_0x3a3782(0x127)]}),await _0x161523[_0x3a3782(0x10c)][_0x3a3782(0x1cf)](_0x2fd9bb['id']),_0x26d43c[_0x3a3782(0x189)]?.({'type':_0x3a3782(0x17b),'name':_0x2fd9bb[_0x3a3782(0x127)]}),_0x26d43c[_0x3a3782(0x1a0)]?.(_0x3a3782(0x142)+_0x2fd9bb[_0x3a3782(0x127)]+'\x27'),0x1;},_0x111908);return _0x4e4032['reduce']((_0x3d78c1,_0x537075)=>_0x3d78c1+_0x537075,0x0);}export async function executePushJourneys(_0x3e8514,_0x1094e3,_0x404447,_0xa1110b,_0x2eaa9a){const _0x3d8b88=a114_0x33ddfe,{journeyDefToRequest:_0x37ae32}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x5867d8,yamlRuleToApi:_0x1f47ab,validateSegmentRule:_0xfd3621}=await import(_0x3d8b88(0xfc)),_0x33115b={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x16c834=new Map(_0x404447[_0x3d8b88(0x125)]),_0x38d59b=0x5;for(let _0x510966=0x0;_0x510966<_0x1094e3[_0x3d8b88(0x18e)];_0x510966+=_0x38d59b){const _0xd50833=_0x1094e3[_0x3d8b88(0x1af)](_0x510966,_0x510966+_0x38d59b),_0x4eed43=await Promise['all'](_0xd50833['map'](async _0x4f6172=>{const _0x39273c=_0x3d8b88;if(!_0x4f6172[_0x39273c(0x14c)]&&!_0x4f6172[_0x39273c(0x170)])return{'action':_0x39273c(0x103),'name':_0x4f6172[_0x39273c(0x1f1)][_0x39273c(0x127)],'journeyId':_0x4f6172[_0x39273c(0x1c1)]?.['id']};const _0x56e618=_0x4f6172[_0x39273c(0x17e)]?_0x404447['folderPathToId'][_0x39273c(0x1fc)](_0x4f6172[_0x39273c(0x17e)]):undefined;_0x2eaa9a[_0x39273c(0x189)]?.({'type':_0x4f6172[_0x39273c(0x14c)]?'journey_creating':_0x39273c(0x1fa),'name':_0x4f6172[_0x39273c(0x1f1)][_0x39273c(0x127)]});try{const _0x1e3511=await executeSingleJourneyPush(_0x3e8514,_0x4f6172,{..._0x404447,'segmentNameToId':_0x16c834},{'parentId':_0xa1110b[_0x39273c(0x1f2)],'rootFolderId':_0xa1110b[_0x39273c(0x1b0)],'folderId':_0x56e618,'verbose':_0xa1110b[_0x39273c(0x130)]},_0x2eaa9a,{'journeyDefToRequest':_0x37ae32,'activationDefToCreateRequest':_0x5867d8,'yamlRuleToApi':_0x1f47ab,'validateSegmentRule':_0xfd3621});for(const [_0x22d05b,_0x3e8bdc]of _0x1e3511['embeddedSegmentNameToId']){_0x16c834[_0x39273c(0x160)](_0x22d05b,_0x3e8bdc),_0x33115b[_0x39273c(0x12f)][_0x39273c(0x160)](_0x22d05b,_0x3e8bdc);}if(_0x1e3511['action']===_0x39273c(0x174))_0x2eaa9a[_0x39273c(0x189)]?.({'type':_0x39273c(0x12b),'name':_0x4f6172[_0x39273c(0x1f1)][_0x39273c(0x127)],'journeyId':_0x1e3511[_0x39273c(0x1a7)]}),_0x2eaa9a[_0x39273c(0x1e9)]?.(_0x39273c(0x173)+_0x4f6172[_0x39273c(0x1f1)][_0x39273c(0x127)]+'\x27'),_0x33115b[_0x39273c(0x174)]++;else _0x1e3511[_0x39273c(0x131)]===_0x39273c(0x157)&&(_0x2eaa9a[_0x39273c(0x189)]?.({'type':_0x39273c(0x10e),'name':_0x4f6172[_0x39273c(0x1f1)]['name']}),_0x2eaa9a['logSuccess']?.('Updated\x20journey\x20\x27'+_0x4f6172['yamlConfig'][_0x39273c(0x127)]+'\x27'),_0x33115b['updated']++);return{'action':_0x1e3511['action'],'name':_0x4f6172[_0x39273c(0x1f1)]['name'],'journeyId':_0x1e3511[_0x39273c(0x1a7)]};}catch(_0x115fba){const _0x38deed=isHttp400Error(_0x115fba),_0xc60d64=_0x38deed?ErrorCode[_0x39273c(0x185)]:ErrorCode[_0x39273c(0x155)],_0x44f07b=getErrorMessage(_0x115fba);throw new SDKError(_0xc60d64,_0x39273c(0x140)+(_0x4f6172[_0x39273c(0x14c)]?_0x39273c(0x192):_0x39273c(0x190))+'\x20journey\x20from\x20file:\x20'+_0x4f6172['absolutePath']+_0x39273c(0x10a)+_0x44f07b,_0x115fba);}}));_0x33115b[_0x3d8b88(0x134)]['push'](..._0x4eed43);}return _0x33115b;}async function matchExistingJourneySegments(_0x15d854,_0x265de9,_0x27319d,_0x1b1c2e,_0x1c99f7){const _0x1a1196=a114_0x33ddfe;if(!_0x265de9[_0x1a1196(0x1c1)]||!_0x265de9[_0x1a1196(0x1f1)][_0x1a1196(0x1d6)])return;const _0x3d2b8a=new Map();for(const _0x56151b of Object[_0x1a1196(0x171)](_0x265de9[_0x1a1196(0x1f1)][_0x1a1196(0x1d6)])){const _0x33f6c2=generateDeterministicJourneySegmentName(_0x265de9[_0x1a1196(0x1f1)]['name'],_0x56151b);_0x3d2b8a[_0x1a1196(0x160)](_0x33f6c2,_0x56151b);}const _0x2ac9bc=collectSegmentIdsFromJourneyApi(_0x265de9[_0x1a1196(0x1c1)]);for(const _0x1b9483 of _0x2ac9bc){const _0x35124e=await fetchSegment(_0x15d854,_0x27319d,_0x1b9483,_0x1b1c2e);if(!_0x35124e?.[_0x1a1196(0x127)])continue;const _0xd51f9a=_0x3d2b8a['get'](_0x35124e['name']);_0xd51f9a&&_0x1c99f7[_0x1a1196(0x160)](_0xd51f9a,_0x1b9483);}}async function executeSingleJourneyPush(_0x50025e,_0x148a2e,_0xa4dcaa,_0x3f0744,_0x5808d3,_0x5aa891){const _0x4d6d6f=a114_0x33ddfe,{journeyDefToRequest:_0x29953d,activationDefToCreateRequest:_0x571653,yamlRuleToApi:_0x2446f4,validateSegmentRule:_0x590fc0}=_0x5aa891,_0x3bed37=new Map(),_0x41ed0a=new Map();recoverSegmentIdsFromPushRecovery(_0x148a2e,_0x3bed37,_0xa4dcaa[_0x4d6d6f(0x125)]);const _0xd66310=new Map(),_0x3bfd07=new Map(),_0x242f27=new Map();let _0x4fd8eb;const _0x1c7def=async()=>{const _0x564232=_0x4d6d6f;if(_0x4fd8eb)return;_0x4fd8eb=new Map();if(!_0x148a2e[_0x564232(0x1c1)])return;const _0x2108ed=await _0x50025e[_0x564232(0x123)][_0x564232(0x1d1)](_0x148a2e[_0x564232(0x1c1)]['id']);for(const _0x527440 of _0x2108ed){const _0x41586e=journeyActivationStepToYaml(_0x527440,_0xa4dcaa[_0x564232(0x159)],_0xa4dcaa[_0x564232(0x1ea)]),_0x1a98c2=activationSignature(_0x41586e);!_0x4fd8eb['has'](_0x1a98c2)&&_0x4fd8eb['set'](_0x1a98c2,_0x527440['id']),_0x41586e[_0x564232(0x127)]&&_0x41ed0a[_0x564232(0x160)](_0x41586e['name'],_0x527440['id']);}};await matchExistingJourneySegments(_0x50025e,_0x148a2e,_0x3f0744[_0x4d6d6f(0x1f2)],_0xa4dcaa[_0x4d6d6f(0x1f7)],_0xa4dcaa[_0x4d6d6f(0x125)]);const _0x153595={'resolveSegmentId':async _0x3812c2=>{const _0x5a8a8c=_0x4d6d6f,_0x41f5c5=_0xa4dcaa[_0x5a8a8c(0x125)][_0x5a8a8c(0x1fc)](_0x3812c2);if(!_0x41f5c5)throw new SDKError(ErrorCode[_0x5a8a8c(0x17f)],_0x5a8a8c(0x14b)+_0x3812c2+_0x5a8a8c(0x11f)+_0x148a2e['yamlConfig']['name']+')');return _0x41f5c5;},'resolveEmbeddedSegmentId':async(_0x375f42,_0x565c09)=>{const _0x4e6bb9=_0x4d6d6f,_0x1df69d=_0xa4dcaa[_0x4e6bb9(0x125)][_0x4e6bb9(0x1fc)](_0x375f42);if(_0x1df69d)return _0x1df69d;const _0xe7f94c=_0xa4dcaa['existingSegments'][_0x4e6bb9(0xfd)](_0x485f8a=>_0x485f8a['name']===_0x375f42);if(_0xe7f94c)return _0xa4dcaa[_0x4e6bb9(0x125)][_0x4e6bb9(0x160)](_0x375f42,_0xe7f94c['id']),_0xe7f94c['id'];if(_0x148a2e[_0x4e6bb9(0x14c)]){const {stageName:_0x4de63e,criteriaName:_0x2f5b63}=findSegmentCriteriaLocation(_0x148a2e[_0x4e6bb9(0x1f1)],_0x375f42);return _0x590fc0(_0x375f42,_0x565c09['rule']),_0x3bfd07[_0x4e6bb9(0x160)](_0x375f42,{'definition':_0x565c09,'stageName':_0x4de63e,'criteriaName':_0x2f5b63}),createPendingSegmentId(_0x375f42);}const _0x500ee6=_0x148a2e['existingJourney']?.['id'];if(!_0x500ee6)throw new SDKError(ErrorCode[_0x4e6bb9(0x15d)],_0x4e6bb9(0x1dc));const _0x4cfe3e=_0xd66310[_0x4e6bb9(0x1fc)](_0x375f42);if(_0x4cfe3e)return _0x4cfe3e;const _0x1771cc=((async()=>{const _0x5b1244=_0x4e6bb9;_0x590fc0(_0x375f42,_0x565c09['rule']);const _0x4b225b=generateDeterministicJourneySegmentName(_0x148a2e[_0x5b1244(0x1f1)][_0x5b1244(0x127)],_0x375f42),_0x99cc0f=_0xa4dcaa['existingSegments']['find'](_0x22dfe5=>_0x22dfe5[_0x5b1244(0x127)]===_0x4b225b),_0x474bb1=createSegmentIdResolver(_0xa4dcaa[_0x5b1244(0x125)],_0x375f42),_0x24fd3e=await resolveRuleSegmentIds(_0x565c09[_0x5b1244(0x1d7)],_0x474bb1);let _0x24cab9;return _0x99cc0f?(await _0x50025e['segment'][_0x5b1244(0x113)](_0x3f0744[_0x5b1244(0x1f2)],_0x99cc0f['id'],{'description':_0x565c09[_0x5b1244(0x1a8)]||_0x5b1244(0x129)+_0x375f42,'rule':_0x2446f4(_0x24fd3e,!![]),'countPopulation':!![]}),_0x24cab9=_0x99cc0f['id'],saveSegmentToPushRecovery(_0x148a2e['absolutePath'],_0x148a2e[_0x5b1244(0x1f1)]['name'],_0x375f42,{'segmentId':_0x24cab9,'uniqueServerName':_0x4b225b,'createdAt':new Date()[_0x5b1244(0x1e1)]()})):_0x24cab9=await createOrRecoverEmbeddedSegment(_0x50025e,_0x148a2e,{'localName':_0x375f42,'uniqueSegmentName':_0x4b225b,'description':_0x565c09['description']||_0x5b1244(0x129)+_0x375f42,'journeyId':_0x500ee6,'resolvedRule':_0x24fd3e,'parentId':_0x3f0744[_0x5b1244(0x1f2)],'folderId':_0x3f0744[_0x5b1244(0x1b0)]||''},_0x2446f4),_0xa4dcaa['segmentNameToId'][_0x5b1244(0x160)](_0x375f42,_0x24cab9),_0x3bed37[_0x5b1244(0x160)](_0x375f42,_0x24cab9),_0x24cab9;})());_0xd66310[_0x4e6bb9(0x160)](_0x375f42,_0x1771cc);try{return await _0x1771cc;}finally{_0xd66310['delete'](_0x375f42);}},'resolveActivationId':async _0x3db995=>{const _0x4dd861=_0x4d6d6f,_0x35c1cc=_0x41ed0a[_0x4dd861(0x1fc)](_0x3db995);if(_0x35c1cc)return _0x35c1cc;if(_0x148a2e[_0x4dd861(0x1c1)]){await _0x1c7def();const _0x5759aa=_0x41ed0a['get'](_0x3db995);if(_0x5759aa)return _0x5759aa;}throw new SDKError(ErrorCode[_0x4dd861(0x133)],_0x4dd861(0x149)+_0x3db995+'\x20(referenced\x20in\x20journey\x20'+_0x148a2e[_0x4dd861(0x1f1)][_0x4dd861(0x127)]+_0x4dd861(0x108)+_0x4dd861(0x1e4));},'resolveEmbeddedActivationId':async(_0x18bdca,_0x25215f)=>{const _0x371733=_0x4d6d6f,_0x285d4d=_0x41ed0a[_0x371733(0x1fc)](_0x18bdca);if(_0x285d4d)return _0x285d4d;if(_0x148a2e[_0x371733(0x14c)])return _0x242f27[_0x371733(0x160)](_0x18bdca,_0x25215f),createPendingActivationId(_0x18bdca);if(_0x148a2e[_0x371733(0x1c1)]){await _0x1c7def();const _0x31569f=_0x41ed0a[_0x371733(0x1fc)](_0x25215f[_0x371733(0x127)]);if(_0x31569f)return _0x41ed0a[_0x371733(0x160)](_0x18bdca,_0x31569f),_0x31569f;const _0x19aeed=activationSignature(_0x25215f),_0x3a0205=_0x4fd8eb?.[_0x371733(0x1fc)](_0x19aeed);if(_0x3a0205)return _0x41ed0a['set'](_0x18bdca,_0x3a0205),_0x3a0205;const _0x135cd6=await _0x571653(_0x25215f,_0xa4dcaa[_0x371733(0x1a6)]),_0x1fab1e={..._0x135cd6,..._0x25215f[_0x371733(0x1ae)]!==undefined&&{'runAfterJourneyRefresh':_0x25215f['run_after_journey_refresh']}},_0xdc9ac3=await _0x50025e[_0x371733(0x123)][_0x371733(0x1b7)](_0x148a2e['existingJourney']['id'],_0x1fab1e);return _0x41ed0a[_0x371733(0x160)](_0x18bdca,_0xdc9ac3['id']),_0xdc9ac3['id'];}throw new SDKError(ErrorCode[_0x371733(0x15d)],_0x371733(0x19d));},'resolveJourneyId':async _0x2728a7=>{const _0x47ee76=_0x4d6d6f;try{return await _0x50025e[_0x47ee76(0x123)][_0x47ee76(0x115)](_0x3f0744['parentId'],_0x2728a7);}catch(_0x2c708b){throw new SDKError(ErrorCode[_0x47ee76(0x133)],_0x47ee76(0x180)+_0x2728a7+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x148a2e[_0x47ee76(0x1f1)]['name']+'\x27)',_0x2c708b);}},'resolveStageId':async(_0x58dd5d,_0xa6683a)=>{const _0x533234=_0x4d6d6f,_0x4cfe97=await _0x50025e[_0x533234(0x123)]['getJourney'](_0x58dd5d),_0x5c259c=_0x4cfe97['attributes'][_0x533234(0x1ad)][_0x533234(0xfd)](_0x2d16b5=>_0x2d16b5[_0x533234(0x127)][_0x533234(0x18a)]()===_0xa6683a['toLowerCase']());if(!_0x5c259c?.['id'])throw new SDKError(ErrorCode[_0x533234(0x133)],_0x533234(0x1eb)+_0xa6683a+_0x533234(0x109)+(_0x4cfe97[_0x533234(0x1f6)][_0x533234(0x15f)]||_0x4cfe97[_0x533234(0x1f6)][_0x533234(0x127)])+'\x27');return _0x5c259c['id'];}},_0x441136=await _0x29953d(_0x148a2e[_0x4d6d6f(0x1f1)],_0x3f0744[_0x4d6d6f(0x1f2)],_0x153595),_0x56b9a1=_0x3f0744[_0x4d6d6f(0x163)]||_0x3f0744[_0x4d6d6f(0x1b0)];_0x56b9a1&&(_0x441136[_0x4d6d6f(0x177)]={'parentFolder':{'data':{'id':_0x56b9a1,'type':'folder'}}});if(_0x148a2e['isNew']){if(_0x3bfd07['size']>0x0||_0x242f27[_0x4d6d6f(0x1e7)]>0x0)return await executeThreeStepJourneyCreate(_0x50025e,_0x148a2e,_0x441136,{'pendingEmbeddedSegments':_0x3bfd07,'pendingEmbeddedActivations':_0x242f27,'embeddedSegmentNameToId':_0x3bed37,'journeyActivationNameToId':_0x41ed0a},{..._0x3f0744,'effectiveFolderId':_0x56b9a1},_0xa4dcaa,_0x5808d3,_0x5aa891);else{ensureJourneyDefaults(_0x441136[_0x4d6d6f(0x1f6)]);const _0x15a8db=await _0x50025e[_0x4d6d6f(0x123)][_0x4d6d6f(0x192)](_0x441136);return deletePushRecovery(_0x148a2e[_0x4d6d6f(0x1e0)]),{'action':_0x4d6d6f(0x174),'journeyId':_0x15a8db['id'],'embeddedSegmentNameToId':_0x3bed37};}}else{if(_0x148a2e[_0x4d6d6f(0x170)]&&_0x148a2e[_0x4d6d6f(0x1c1)])return ensureJourneyDefaults(_0x441136[_0x4d6d6f(0x1f6)]),await _0x50025e[_0x4d6d6f(0x123)][_0x4d6d6f(0x190)](_0x148a2e[_0x4d6d6f(0x1c1)]['id'],_0x441136),deletePushRecovery(_0x148a2e[_0x4d6d6f(0x1e0)]),{'action':_0x4d6d6f(0x157),'journeyId':_0x148a2e[_0x4d6d6f(0x1c1)]['id'],'embeddedSegmentNameToId':_0x3bed37};}return deletePushRecovery(_0x148a2e[_0x4d6d6f(0x1e0)]),{'action':_0x4d6d6f(0x103),'journeyId':_0x148a2e['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x3bed37};}function findSegmentCriteriaLocation(_0x1ec0a6,_0x328dc8){const _0x2e6153=a114_0x33ddfe,_0x233159=_0x1ec0a6[_0x2e6153(0x1a5)]||_0x1ec0a6[_0x2e6153(0x145)]?.[0x0]?.[_0x2e6153(0x1a5)]||[];let _0x6c7bbc=_0x2e6153(0x148),_0x4d2fb8=_0x328dc8;const _0x2c3d33=_0x1ec0a6[_0x2e6153(0x110)]||_0x1ec0a6[_0x2e6153(0x145)]?.[0x0]?.[_0x2e6153(0x110)];if(_0x2c3d33?.[_0x2e6153(0x10c)]===_0x328dc8)return{'stageName':_0x2e6153(0x110),'criteriaName':_0x2c3d33[_0x2e6153(0x127)]||_0x328dc8};_0x1a9c84:for(const _0x38ac55 of _0x233159){if(_0x38ac55['entry_criteria']?.[_0x2e6153(0x10c)]===_0x328dc8){_0x6c7bbc=_0x38ac55[_0x2e6153(0x127)],_0x4d2fb8=_0x38ac55[_0x2e6153(0x1cc)][_0x2e6153(0x127)]||_0x328dc8;break;}if(_0x38ac55[_0x2e6153(0x1df)])for(const _0x22083c of _0x38ac55['steps']){if(_0x22083c[_0x2e6153(0x1b6)]===_0x2e6153(0x1da)&&_0x22083c['with']?.['branches'])for(const _0x508d29 of _0x22083c['with'][_0x2e6153(0x11c)]){if(_0x508d29[_0x2e6153(0x10c)]===_0x328dc8){_0x6c7bbc=_0x38ac55[_0x2e6153(0x127)],_0x4d2fb8=_0x508d29['name']||_0x328dc8;break _0x1a9c84;}}}}return{'stageName':_0x6c7bbc,'criteriaName':_0x4d2fb8};}async function executeThreeStepJourneyCreate(_0xb47415,_0x12ebe2,_0xa74cb6,_0xf4f0eb,_0x4c3524,_0x1a2e3b,_0x2a3393,_0x213c9c){const _0x5aa119=a114_0x33ddfe,{activationDefToCreateRequest:_0x36f004,yamlRuleToApi:_0x26160e}=_0x213c9c,{pendingEmbeddedSegments:_0x33e23e,pendingEmbeddedActivations:_0x5a864b,embeddedSegmentNameToId:_0x2f4755}=_0xf4f0eb,_0x5c6fee=JSON[_0x5aa119(0x1be)](JSON[_0x5aa119(0x12a)](_0xa74cb6));ensureJourneyDefaults(_0x5c6fee[_0x5aa119(0x1f6)]),stripPendingIds(_0x5c6fee);const _0x1ec4c1=await _0xb47415[_0x5aa119(0x123)][_0x5aa119(0x192)](_0x5c6fee),_0x5d154d=_0x1ec4c1['id'],_0x1fe0a5=new Map();for(const _0x217902 of _0x1ec4c1[_0x5aa119(0x1f6)][_0x5aa119(0x1ad)]){_0x1fe0a5['set'](_0x217902[_0x5aa119(0x127)][_0x5aa119(0x18a)](),_0x217902['id']);}recoverSegmentIdsFromPushRecovery(_0x12ebe2,_0x2f4755,_0x1a2e3b['segmentNameToId']);for(const [_0x2e43b8,{definition:_0xbcef43}]of _0x33e23e){if(_0x2f4755['has'](_0x2e43b8)){_0x2a3393[_0x5aa119(0x189)]?.({'type':_0x5aa119(0x116),'journeyName':_0x12ebe2[_0x5aa119(0x1f1)][_0x5aa119(0x127)],'segmentName':_0x2e43b8});continue;}const _0x35272c=generateDeterministicJourneySegmentName(_0x12ebe2[_0x5aa119(0x1f1)][_0x5aa119(0x127)],_0x2e43b8);_0x2a3393['onProgress']?.({'type':'embedded_segment_creating','journeyName':_0x12ebe2[_0x5aa119(0x1f1)][_0x5aa119(0x127)],'segmentName':_0x2e43b8});const _0x1cbbd2=createSegmentIdResolver(_0x1a2e3b[_0x5aa119(0x125)],_0x2e43b8),_0x476cd5=await resolveRuleSegmentIds(_0xbcef43[_0x5aa119(0x1d7)],_0x1cbbd2),_0x486736=await createOrRecoverEmbeddedSegment(_0xb47415,_0x12ebe2,{'localName':_0x2e43b8,'uniqueSegmentName':_0x35272c,'description':_0xbcef43[_0x5aa119(0x1a8)]||_0x5aa119(0x129)+_0x2e43b8,'journeyId':_0x5d154d,'resolvedRule':_0x476cd5,'parentId':_0x4c3524['parentId'],'folderId':_0x4c3524[_0x5aa119(0x101)]||''},_0x26160e);_0x2f4755[_0x5aa119(0x160)](_0x2e43b8,_0x486736),_0x1a2e3b['segmentNameToId']['set'](_0x2e43b8,_0x486736),_0x2a3393[_0x5aa119(0x189)]?.({'type':_0x5aa119(0x116),'journeyName':_0x12ebe2[_0x5aa119(0x1f1)][_0x5aa119(0x127)],'segmentName':_0x2e43b8});}const _0x490f55=new Map();for(const [_0x2e8ffa,_0x1dd9d0]of _0x5a864b){_0x2a3393['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x12ebe2['yamlConfig']['name'],'activationName':_0x2e8ffa});const _0x107c84=await _0x36f004(_0x1dd9d0,_0x1a2e3b[_0x5aa119(0x1a6)]),_0x11e36a={..._0x107c84,..._0x1dd9d0[_0x5aa119(0x1ae)]!==undefined&&{'runAfterJourneyRefresh':_0x1dd9d0[_0x5aa119(0x1ae)]}},_0x532fda=await _0xb47415['journey'][_0x5aa119(0x1b7)](_0x5d154d,_0x11e36a);_0x490f55[_0x5aa119(0x160)](_0x2e8ffa,_0x532fda['id']),_0xf4f0eb['journeyActivationNameToId'][_0x5aa119(0x160)](_0x2e8ffa,_0x532fda['id']),_0x2a3393[_0x5aa119(0x189)]?.({'type':_0x5aa119(0x186),'journeyName':_0x12ebe2[_0x5aa119(0x1f1)][_0x5aa119(0x127)],'activationName':_0x2e8ffa});}const _0x12c5df=JSON[_0x5aa119(0x1be)](JSON[_0x5aa119(0x12a)](_0xa74cb6));return _0x12c5df['id']=_0x5d154d,ensureJourneyDefaults(_0x12c5df[_0x5aa119(0x1f6)]),resolvePendingIdsInRequest(_0x12c5df,_0xa74cb6,_0x1fe0a5,_0x2f4755,_0x490f55,_0x2a3393),await _0xb47415[_0x5aa119(0x123)]['update'](_0x5d154d,_0x12c5df),deletePushRecovery(_0x12ebe2[_0x5aa119(0x1e0)]),{'action':'created','journeyId':_0x5d154d,'embeddedSegmentNameToId':_0x2f4755};}export function stripWaitStepPendingIds(_0x3b4d6c){const _0x1a7e1a=a114_0x33ddfe,_0x3e37b7=_0x3b4d6c[_0x1a7e1a(0x187)]&&isPendingSegmentId(_0x3b4d6c['conditionSegmentId']),_0x5c4384=_0x3b4d6c[_0x1a7e1a(0x1b8)]?.[_0x1a7e1a(0x154)](_0x326b94=>_0x326b94[_0x1a7e1a(0x19b)]&&isPendingSegmentId(_0x326b94['segmentId']));(_0x3e37b7||_0x5c4384)&&(_0x3b4d6c[_0x1a7e1a(0x19c)]=_0x1a7e1a(0x120),_0x3b4d6c[_0x1a7e1a(0x126)]=0x1,_0x3b4d6c['waitStepUnit']='day',delete _0x3b4d6c[_0x1a7e1a(0x187)],delete _0x3b4d6c['conditionTimeoutDuration'],delete _0x3b4d6c[_0x1a7e1a(0x198)],delete _0x3b4d6c[_0x1a7e1a(0x1b8)]);}export function resolveWaitStepPendingIds(_0x4aacb2,_0x17508f,_0x5c84c0,_0xabb33){const _0x144249=a114_0x33ddfe;if(_0x17508f[_0x144249(0x187)]&&isPendingSegmentId(_0x17508f[_0x144249(0x187)])){const _0x390fb1=_0x5c84c0(_0x17508f[_0x144249(0x187)],_0x144249(0x132)+_0xabb33+'\x27\x20wait\x20condition');_0x390fb1&&(_0x4aacb2['waitStepType']=_0x144249(0x1cb),_0x4aacb2[_0x144249(0x187)]=_0x390fb1,delete _0x4aacb2[_0x144249(0x126)],delete _0x4aacb2[_0x144249(0x183)],_0x17508f[_0x144249(0x1b1)]!==undefined&&(_0x4aacb2[_0x144249(0x1b1)]=_0x17508f[_0x144249(0x1b1)]),_0x17508f[_0x144249(0x198)]&&(_0x4aacb2[_0x144249(0x198)]=_0x17508f[_0x144249(0x198)]));}if(_0x17508f[_0x144249(0x1b8)]){const _0x5a7825=_0x17508f[_0x144249(0x1b8)][_0x144249(0x154)](_0x2615f1=>_0x2615f1[_0x144249(0x19b)]&&isPendingSegmentId(_0x2615f1[_0x144249(0x19b)]));if(_0x5a7825){const _0x10177d=_0x17508f[_0x144249(0x1b8)]['map'](_0x1d1732=>{const _0x36bf32=_0x144249;if(_0x1d1732[_0x36bf32(0x19b)]&&isPendingSegmentId(_0x1d1732[_0x36bf32(0x19b)])){const _0x3818f1=_0x5c84c0(_0x1d1732[_0x36bf32(0x19b)],_0x36bf32(0x132)+_0xabb33+_0x36bf32(0x13d));return{..._0x1d1732,'segmentId':_0x3818f1||_0x1d1732['segmentId']};}return{..._0x1d1732};});_0x4aacb2[_0x144249(0x19c)]='Condition',_0x4aacb2[_0x144249(0x1b8)]=_0x10177d,delete _0x4aacb2[_0x144249(0x126)],delete _0x4aacb2[_0x144249(0x183)],delete _0x4aacb2[_0x144249(0x187)],delete _0x4aacb2['conditionTimeoutDuration'],delete _0x4aacb2[_0x144249(0x198)];}}}function stripPendingIds(_0x57cf96){const _0x4a1d79=a114_0x33ddfe;_0x57cf96[_0x4a1d79(0x1f6)][_0x4a1d79(0x110)]?.[_0x4a1d79(0x19b)]&&isPendingSegmentId(_0x57cf96[_0x4a1d79(0x1f6)][_0x4a1d79(0x110)][_0x4a1d79(0x19b)])&&delete _0x57cf96[_0x4a1d79(0x1f6)][_0x4a1d79(0x110)];for(const _0x29ae09 of _0x57cf96['attributes'][_0x4a1d79(0x1ad)]||[]){_0x29ae09[_0x4a1d79(0x182)]?.[_0x4a1d79(0x19b)]&&isPendingSegmentId(_0x29ae09['entryCriteria'][_0x4a1d79(0x19b)])&&delete _0x29ae09[_0x4a1d79(0x182)];_0x29ae09[_0x4a1d79(0x111)]?.['segmentId']&&isPendingSegmentId(_0x29ae09[_0x4a1d79(0x111)][_0x4a1d79(0x19b)])&&delete _0x29ae09['milestone'];_0x29ae09['exitCriterias']&&(_0x29ae09[_0x4a1d79(0xff)]=_0x29ae09['exitCriterias'][_0x4a1d79(0x17a)](_0x55d043=>!_0x55d043[_0x4a1d79(0x19b)]||!isPendingSegmentId(_0x55d043[_0x4a1d79(0x19b)])));if(_0x29ae09[_0x4a1d79(0x1df)])for(const _0x5e99eb of Object[_0x4a1d79(0x171)](_0x29ae09[_0x4a1d79(0x1df)])){const _0x4a529c=_0x29ae09[_0x4a1d79(0x1df)][_0x5e99eb];_0x4a529c[_0x4a1d79(0x1b6)]===_0x4a1d79(0x1ee)&&_0x4a529c[_0x4a1d79(0x197)]&&isPendingActivationId(_0x4a529c[_0x4a1d79(0x197)])&&(_0x4a529c[_0x4a1d79(0x197)]='');if(_0x4a529c[_0x4a1d79(0x1b6)]===_0x4a1d79(0x105)&&_0x4a529c[_0x4a1d79(0x11c)])for(const _0x1888b3 of _0x4a529c[_0x4a1d79(0x11c)]){_0x1888b3[_0x4a1d79(0x19b)]&&isPendingSegmentId(_0x1888b3['segmentId'])&&(_0x1888b3[_0x4a1d79(0x19b)]='');}_0x4a529c[_0x4a1d79(0x1b6)]===_0x4a1d79(0x188)&&stripWaitStepPendingIds(_0x4a529c);}}}function resolvePendingIdsInRequest(_0x77a1b1,_0x245fd9,_0x2b7dee,_0x51b05f,_0xeccf04,_0x5a4098){const _0xbb95bc=a114_0x33ddfe,_0x6ee0d2=(_0x2cd82b,_0x1f3af6)=>{const _0x543ef8=a114_0x1937;if(!isPendingSegmentId(_0x2cd82b))return _0x2cd82b;const _0x43ec65=extractPendingSegmentName(_0x2cd82b),_0x4a85a3=_0x51b05f[_0x543ef8(0x1fc)](_0x43ec65);return!_0x4a85a3&&_0x5a4098[_0x543ef8(0x193)]?.(_0x543ef8(0x1f3)+_0x43ec65+_0x543ef8(0x13b)+_0x1f3af6),_0x4a85a3;};if(_0x77a1b1[_0xbb95bc(0x1f6)]['goal']?.[_0xbb95bc(0x19b)]&&isPendingSegmentId(_0x77a1b1['attributes'][_0xbb95bc(0x110)][_0xbb95bc(0x19b)])){const _0x2e8c10=_0x6ee0d2(_0x77a1b1[_0xbb95bc(0x1f6)][_0xbb95bc(0x110)][_0xbb95bc(0x19b)],_0xbb95bc(0x1fb));_0x2e8c10&&(_0x77a1b1[_0xbb95bc(0x1f6)][_0xbb95bc(0x110)]['segmentId']=_0x2e8c10);}for(const _0x38a1ba of _0x77a1b1[_0xbb95bc(0x1f6)][_0xbb95bc(0x1ad)]||[]){const _0x2424f1=_0x2b7dee[_0xbb95bc(0x1fc)](_0x38a1ba[_0xbb95bc(0x127)][_0xbb95bc(0x18a)]());_0x2424f1&&(_0x38a1ba['id']=_0x2424f1);if(_0x38a1ba['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x38a1ba[_0xbb95bc(0x182)][_0xbb95bc(0x19b)])){const _0x1e5da0=_0x6ee0d2(_0x38a1ba[_0xbb95bc(0x182)]['segmentId'],'stage\x20\x27'+_0x38a1ba[_0xbb95bc(0x127)]+_0xbb95bc(0x1b2));_0x1e5da0&&(_0x38a1ba[_0xbb95bc(0x182)][_0xbb95bc(0x19b)]=_0x1e5da0);}if(_0x38a1ba['exitCriterias'])for(const _0x1aad6d of _0x38a1ba[_0xbb95bc(0xff)]){if(_0x1aad6d[_0xbb95bc(0x19b)]&&isPendingSegmentId(_0x1aad6d[_0xbb95bc(0x19b)])){const _0x33ad91=_0x6ee0d2(_0x1aad6d[_0xbb95bc(0x19b)],_0xbb95bc(0x132)+_0x38a1ba[_0xbb95bc(0x127)]+'\x27\x20exit\x20criteria');_0x33ad91&&(_0x1aad6d[_0xbb95bc(0x19b)]=_0x33ad91);}}if(_0x38a1ba[_0xbb95bc(0x111)]?.['segmentId']&&isPendingSegmentId(_0x38a1ba[_0xbb95bc(0x111)][_0xbb95bc(0x19b)])){const _0xfa0b1d=_0x6ee0d2(_0x38a1ba[_0xbb95bc(0x111)][_0xbb95bc(0x19b)],'stage\x20\x27'+_0x38a1ba[_0xbb95bc(0x127)]+'\x27\x20milestone');_0xfa0b1d&&(_0x38a1ba['milestone'][_0xbb95bc(0x19b)]=_0xfa0b1d);}if(_0x38a1ba[_0xbb95bc(0x1df)]){const _0x1f280b=_0x1a9769=>_0x245fd9[_0xbb95bc(0x1f6)]['journeyStages']?.[_0xbb95bc(0xfd)](_0xd60719=>_0xd60719['name'][_0xbb95bc(0x18a)]()===_0x38a1ba[_0xbb95bc(0x127)]['toLowerCase']())?.[_0xbb95bc(0x1df)]?.[_0x1a9769];for(const _0x321a75 of Object[_0xbb95bc(0x171)](_0x38a1ba[_0xbb95bc(0x1df)])){const _0x2ae9fe=_0x38a1ba[_0xbb95bc(0x1df)][_0x321a75],_0x40f07c=_0x1f280b(_0x321a75);if(_0x2ae9fe[_0xbb95bc(0x1b6)]==='Activation'&&_0x2ae9fe[_0xbb95bc(0x197)]&&(isPendingActivationId(_0x2ae9fe['journeyActivationStepId'])||_0x2ae9fe[_0xbb95bc(0x197)]==='')){if(_0x40f07c?.[_0xbb95bc(0x197)]&&isPendingActivationId(_0x40f07c['journeyActivationStepId'])){const _0x159414=extractPendingActivationName(_0x40f07c[_0xbb95bc(0x197)]),_0x28b4b1=_0xeccf04['get'](_0x159414);_0x28b4b1&&(_0x2ae9fe[_0xbb95bc(0x197)]=_0x28b4b1);}}if(_0x2ae9fe[_0xbb95bc(0x1b6)]===_0xbb95bc(0x105)&&_0x2ae9fe[_0xbb95bc(0x11c)]&&_0x40f07c?.[_0xbb95bc(0x11c)])for(let _0x29b155=0x0;_0x29b155<_0x2ae9fe[_0xbb95bc(0x11c)][_0xbb95bc(0x18e)];_0x29b155++){const _0x4afa80=_0x2ae9fe['branches'][_0x29b155],_0x530a26=_0x40f07c[_0xbb95bc(0x11c)][_0x29b155];if(_0x530a26?.[_0xbb95bc(0x19b)]&&isPendingSegmentId(_0x530a26[_0xbb95bc(0x19b)])){const _0x515884=_0x6ee0d2(_0x530a26[_0xbb95bc(0x19b)],_0xbb95bc(0x132)+_0x38a1ba[_0xbb95bc(0x127)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x4afa80[_0xbb95bc(0x127)]||_0x29b155)+'\x27');_0x515884&&(_0x4afa80['segmentId']=_0x515884);}}_0x2ae9fe[_0xbb95bc(0x1b6)]===_0xbb95bc(0x188)&&_0x40f07c?.[_0xbb95bc(0x1b6)]===_0xbb95bc(0x188)&&resolveWaitStepPendingIds(_0x2ae9fe,_0x40f07c,_0x6ee0d2,_0x38a1ba[_0xbb95bc(0x127)]);}}}}
1
+ const a114_0x3308e7=a114_0x3638;(function(_0x3a41b8,_0x1134a5){const _0x44da4d=a114_0x3638,_0x6655a=_0x3a41b8();while(!![]){try{const _0xe2d53c=-parseInt(_0x44da4d(0x1a3))/0x1*(parseInt(_0x44da4d(0x1a9))/0x2)+parseInt(_0x44da4d(0x1fa))/0x3+-parseInt(_0x44da4d(0x1de))/0x4+-parseInt(_0x44da4d(0x212))/0x5*(parseInt(_0x44da4d(0x136))/0x6)+-parseInt(_0x44da4d(0x1af))/0x7+parseInt(_0x44da4d(0x142))/0x8+-parseInt(_0x44da4d(0x219))/0x9*(-parseInt(_0x44da4d(0x181))/0xa);if(_0xe2d53c===_0x1134a5)break;else _0x6655a['push'](_0x6655a['shift']());}catch(_0x3ef0a6){_0x6655a['push'](_0x6655a['shift']());}}}(a114_0x59fa,0xeb325));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a114_0x3308e7(0x17a);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x4a6eb8){return''+PENDING_SEGMENT_PREFIX+_0x4a6eb8+'__';}export function isPendingSegmentId(_0x231525){const _0x2f5c4a=a114_0x3308e7;return _0x231525[_0x2f5c4a(0x1e6)](PENDING_SEGMENT_PREFIX)&&!_0x231525[_0x2f5c4a(0x1e6)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x31673a){const _0x15bfdf=a114_0x3308e7;return _0x31673a[_0x15bfdf(0x163)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x286407){return''+PENDING_ACTIVATION_PREFIX+_0x286407+'__';}export function isPendingActivationId(_0x3eeef1){const _0xbf3a2c=a114_0x3308e7;return _0x3eeef1[_0xbf3a2c(0x1e6)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xccf473){const _0x3b0448=a114_0x3308e7;return _0xccf473[_0x3b0448(0x163)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x280cb4,_0x3ec167){const _0x67faca=a114_0x3308e7,_0x22f91c=_0x280cb4+'::'+(_0x3ec167[_0x67faca(0x140)]()||_0x67faca(0x189)),_0x167087=createHash(_0x67faca(0x209))[_0x67faca(0x1b2)](_0x22f91c)['digest'](_0x67faca(0x1d1))[_0x67faca(0x1eb)](0x0,0xc);return'journey_entry_criteria_'+_0x167087;}export function ensureJourneyDefaults(_0x4b12b9){const _0x28ed05=a114_0x3308e7;!_0x4b12b9['description']&&(_0x4b12b9[_0x28ed05(0x1e1)]=''),!_0x4b12b9[_0x28ed05(0x21b)]&&(_0x4b12b9['state']=_0x28ed05(0x1d0));}export function resolveTDFolderPath(_0x353d40,_0x34448a,_0x173416){const _0x1b9149=a114_0x3308e7;if(!_0x34448a)return _0x353d40;if(_0x353d40===_0x173416||_0x353d40[_0x1b9149(0x1e6)](_0x173416+'/'))return _0x353d40;return _0x353d40?_0x173416+'/'+_0x353d40:_0x173416;}export function addFoldersToCreate(_0x94ea4a,_0x11d165,_0x2ffa5f){const _0x585562=a114_0x3308e7;if(!_0x94ea4a)return;if(_0x11d165[_0x585562(0x16c)](_0x94ea4a))return;const _0x3bdcf1=_0x94ea4a[_0x585562(0x154)]('/');let _0x51e610='';for(const _0x298d9c of _0x3bdcf1){_0x51e610=_0x51e610?_0x51e610+'/'+_0x298d9c:_0x298d9c,!_0x11d165[_0x585562(0x16c)](_0x51e610)&&_0x2ffa5f[_0x585562(0x21e)](_0x51e610);}}import*as a114_0x4e4e82 from'yaml';import{readFileSync}from'fs';import a114_0x3befe2 from'path';import{isJourneyDef,parseYamlString as a114_0x393e31,toYamlString as a114_0x4663c6,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x393ac4){const _0x3bc687=a114_0x3308e7;if(Array[_0x3bc687(0x19c)](_0x393ac4))return'['+_0x393ac4[_0x3bc687(0x224)](_0x2e8bca=>stableStringify(_0x2e8bca))['join'](',')+']';if(_0x393ac4&&typeof _0x393ac4==='object'){const _0x4e04f5=_0x393ac4,_0x3a57e5=Object[_0x3bc687(0x150)](_0x4e04f5)[_0x3bc687(0x14a)](),_0x1534ee=_0x3a57e5[_0x3bc687(0x224)](_0x87fc03=>'\x22'+_0x87fc03+'\x22:'+stableStringify(_0x4e04f5[_0x87fc03]));return'{'+_0x1534ee[_0x3bc687(0x1ad)](',')+'}';}const _0x611f7a=JSON[_0x3bc687(0x1d8)](_0x393ac4);return _0x611f7a===undefined?'null':_0x611f7a;}function activationSignature(_0x29a543){const _0x4fb5b2=a114_0x3308e7,_0x13cd71={'connection':_0x29a543[_0x4fb5b2(0x1f5)],..._0x29a543['all_columns']!==undefined&&{'all_columns':_0x29a543[_0x4fb5b2(0x1cd)]},..._0x29a543[_0x4fb5b2(0x174)]!==undefined&&{'columns':_0x29a543[_0x4fb5b2(0x174)]},..._0x29a543['behavior']!==undefined&&{'behavior':_0x29a543[_0x4fb5b2(0x18d)]},..._0x29a543[_0x4fb5b2(0x1a7)]!==undefined&&{'schedule':_0x29a543['schedule']},..._0x29a543[_0x4fb5b2(0x227)]!==undefined&&{'notification':_0x29a543[_0x4fb5b2(0x227)]},..._0x29a543[_0x4fb5b2(0x217)]!==undefined&&{'connector_config':_0x29a543[_0x4fb5b2(0x217)]},..._0x29a543[_0x4fb5b2(0x1bf)]!==undefined&&{'activation_template_id':_0x29a543[_0x4fb5b2(0x1bf)]}};return stableStringify(_0x13cd71);}async function fetchSegment(_0x1cf38a,_0x1f4fae,_0x45741d,_0x170cd9){const _0x34d995=a114_0x3308e7,_0x585b6f=_0x170cd9?.[_0x34d995(0x17f)](_0x2f4cca=>_0x2f4cca['id']===_0x45741d);if(_0x585b6f)return _0x585b6f;try{return await _0x1cf38a[_0x34d995(0x189)][_0x34d995(0x13f)](_0x1f4fae,_0x45741d);}catch(_0x18aa0d){logger['debug'](_0x34d995(0x183)+_0x45741d+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x18aa0d);try{return await _0x1cf38a[_0x34d995(0x189)][_0x34d995(0x1a0)](_0x45741d);}catch(_0x413495){return logger[_0x34d995(0x1ac)](_0x34d995(0x20d)+_0x45741d+':\x20'+_0x413495),null;}}}function recoverSegmentIdsFromPushRecovery(_0x5cf7a3,_0x5594b9,_0x4ddc95){const _0x1a5250=a114_0x3308e7,_0x13602e=readPushRecovery(_0x5cf7a3[_0x1a5250(0x149)]);if(_0x13602e?.[_0x1a5250(0x19a)]===_0x5cf7a3[_0x1a5250(0x225)][_0x1a5250(0x158)])for(const [_0x36bac9,_0x1c5223]of Object[_0x1a5250(0x173)](_0x13602e['segments'])){const _0x38ae48=generateDeterministicJourneySegmentName(_0x5cf7a3[_0x1a5250(0x225)][_0x1a5250(0x158)],_0x36bac9);_0x1c5223[_0x1a5250(0x197)]===_0x38ae48&&(_0x5594b9[_0x1a5250(0x17d)](_0x36bac9,_0x1c5223['segmentId']),_0x4ddc95[_0x1a5250(0x17d)](_0x36bac9,_0x1c5223[_0x1a5250(0x138)]));}}async function createOrRecoverEmbeddedSegment(_0x3b2407,_0x4ebc9f,_0x5168e2,_0x1fa0ac){const _0xb62d3d=a114_0x3308e7;let _0x52ef44;try{_0x52ef44=await _0x3b2407[_0xb62d3d(0x189)]['createJourneySegment']({'name':_0x5168e2[_0xb62d3d(0x148)],'description':_0x5168e2['description'],'journeyId':_0x5168e2[_0xb62d3d(0x1b0)],'rule':_0x1fa0ac(_0x5168e2[_0xb62d3d(0x16e)],!![]),'countPopulation':!![],'parentFolderId':_0x5168e2[_0xb62d3d(0x1e7)],'audienceId':_0x5168e2[_0xb62d3d(0x143)]});}catch(_0x5d6fe2){const _0x424d24=_0x5d6fe2 instanceof Error&&_0x5d6fe2[_0xb62d3d(0x159)][_0xb62d3d(0x206)](_0xb62d3d(0x16f));if(_0x424d24){const _0xb1dd46=readPushRecovery(_0x4ebc9f[_0xb62d3d(0x149)]),_0x515a58=_0xb1dd46?.[_0xb62d3d(0x19a)]===_0x4ebc9f[_0xb62d3d(0x225)][_0xb62d3d(0x158)]?_0xb1dd46[_0xb62d3d(0x1c6)][_0x5168e2[_0xb62d3d(0x166)]]:undefined;if(_0x515a58?.[_0xb62d3d(0x197)]===_0x5168e2['uniqueSegmentName'])await _0x3b2407[_0xb62d3d(0x189)]['updateSegmentById'](_0x5168e2[_0xb62d3d(0x143)],_0x515a58['segmentId'],{'description':_0x5168e2[_0xb62d3d(0x1e1)],'rule':_0x1fa0ac(_0x5168e2[_0xb62d3d(0x16e)],!![]),'countPopulation':!![]}),_0x52ef44=_0x515a58[_0xb62d3d(0x138)];else throw new SDKError(ErrorCode[_0xb62d3d(0x1a2)],_0xb62d3d(0x164)+_0x5168e2['localName']+_0xb62d3d(0x156)+(_0xb62d3d(0x20c)+_0x4ebc9f[_0xb62d3d(0x149)]['replace'](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x5d6fe2);}else throw _0x5d6fe2;}return saveSegmentToPushRecovery(_0x4ebc9f['absolutePath'],_0x4ebc9f[_0xb62d3d(0x225)]['name'],_0x5168e2['localName'],{'segmentId':_0x52ef44,'uniqueServerName':_0x5168e2[_0xb62d3d(0x148)],'createdAt':new Date()[_0xb62d3d(0x1b5)]()}),_0x52ef44;}export async function prepareSegmentFiles(_0x5f21ca,_0x3966c7,_0x9f8819,_0x26dc1f,_0x417f72){const _0x1a1f62=a114_0x3308e7,{activationDefToCreateRequest:_0x5e00bd}=await import(_0x1a1f62(0x1d4)),_0x2196c0=[],_0x300d36=new Set();for(const {yamlConfig:_0xb8833d,folderPath:_0x42cfcd,sourcePath:_0x3f7db9}of _0x5f21ca){const _0x55f1b6=resolveTDFolderPath(_0x42cfcd,_0x26dc1f,_0x417f72),_0x8ead01=_0x55f1b6+':'+_0xb8833d['name'],_0x1e1864=_0x3966c7['segmentByFolderAndName']['get'](_0x8ead01),_0x320a9d=_0x1e1864?_0x3966c7[_0x1a1f62(0x20b)][_0x1a1f62(0x175)](_0x1e1864['id'])||[]:[];addFoldersToCreate(_0x55f1b6,_0x3966c7[_0x1a1f62(0x13e)],_0x300d36);const _0x284673=calculateActivationActions(_0xb8833d[_0x1a1f62(0x12e)]||[],_0x320a9d,_0x3966c7['idToEmailMap'],_0x3966c7[_0x1a1f62(0x178)]);for(const _0x3efd75 of _0x284673){(_0x3efd75[_0x1a1f62(0x177)]===_0x1a1f62(0x1c3)||_0x3efd75[_0x1a1f62(0x177)]==='update')&&_0x3efd75[_0x1a1f62(0x179)]&&(_0x3efd75['validatedRequest']=await _0x5e00bd(_0x3efd75[_0x1a1f62(0x179)],_0x9f8819));}const _0x154f54=calculateSegmentDiff(_0xb8833d,_0x1e1864,_0x320a9d,_0x3966c7['idToEmailMap'],_0x3966c7[_0x1a1f62(0x178)]);_0x2196c0['push']({'relativePath':_0xb8833d[_0x1a1f62(0x158)],'absolutePath':_0x3f7db9,'yamlConfig':_0xb8833d,'folderPath':_0x55f1b6,'existingSegment':_0x1e1864,'existingActivations':_0x320a9d,'isNew':_0x154f54[_0x1a1f62(0x207)],'hasChanges':_0x154f54['hasChanges'],'diff':_0x154f54[_0x1a1f62(0x226)],'activationActions':_0x284673});}return{'segmentFiles':_0x2196c0,'foldersToCreate':_0x300d36};}export async function prepareJourneyFiles(_0x6a7d96,_0x2d1f45,_0x3961ec,_0x4cec2e){const _0x2dd29e=a114_0x3308e7,_0xf87917=[],_0x54c106=new Set();for(const {yamlConfig:_0x35704a,folderPath:_0x21466c,sourcePath:_0x6bdd89}of _0x6a7d96){const _0x3d8ceb=resolveTDFolderPath(_0x21466c,_0x3961ec,_0x4cec2e),_0x186f02=_0x3d8ceb+':'+_0x35704a[_0x2dd29e(0x158)],_0x25dc85=_0x2d1f45[_0x2dd29e(0x19b)][_0x2dd29e(0x175)](_0x186f02);let _0x48887d,_0x37ce75;if(_0x25dc85&&_0x25dc85['length']>0x0){const _0x142517=buildLocalExpandedRuleMappings(_0x35704a),{createYamlContext:_0x3a0ad7,prefetchJourneySegments:_0x572547}=createPushYamlContextForBundle(_0x2d1f45[_0x2dd29e(0x204)],_0x2d1f45[_0x2dd29e(0x143)],_0x2d1f45[_0x2dd29e(0x1ba)],_0x142517,_0x2d1f45[_0x2dd29e(0x1a4)],_0x2d1f45['connectionIdToNameMap'],_0x2d1f45[_0x2dd29e(0x155)],_0x2d1f45[_0x2dd29e(0x199)]);await _0x572547(_0x25dc85[_0x2dd29e(0x224)](_0x5d568c=>_0x5d568c['id']));const _0x3b37b6=hasMultipleVersions(_0x35704a),_0x2d6471=async _0x1e61f4=>{const _0x46b899=_0x2dd29e,_0x200c1e=_0x2d1f45[_0x46b899(0x199)]?.[_0x46b899(0x175)](_0x1e61f4);if(_0x200c1e)return _0x200c1e;return _0x2d1f45[_0x46b899(0x13a)]({'journeyId':_0x1e61f4,'journeyName':_0x35704a[_0x46b899(0x158)],'isMultiVersion':_0x25dc85[_0x46b899(0x1c9)]>0x1});};if(_0x3b37b6&&_0x25dc85['length']>0x1){const _0x1c9495=[];for(const _0x2b7aaf of _0x25dc85){const _0x479ffd=_0x2b7aaf['versionNumber']||0x1;_0x2d1f45[_0x2dd29e(0x1ed)]?.[_0x2dd29e(0x1b2)](_0x2dd29e(0x1bc)+_0x35704a['name']+'\x20v'+_0x479ffd);const _0x855d43=await _0x2d6471(_0x2b7aaf['id']),_0x24a533=_0x3a0ad7(_0x2b7aaf['id']),_0x5a87c6=await journeyResponseToDef(_0x855d43,_0x24a533);_0x1c9495[_0x2dd29e(0x21a)]({'item':_0x2b7aaf,'yaml':_0x5a87c6});}const _0x35a62e=buildLocalRuleToNameMappingFromJourney(_0x35704a);_0x37ce75=buildMergedJourneyDef(_0x1c9495,_0x35a62e);const _0x3f6142=Math['max'](..._0x1c9495[_0x2dd29e(0x224)](_0x447093=>_0x447093['item'][_0x2dd29e(0x196)]||0x0)),_0x2bc940=_0x25dc85[_0x2dd29e(0x17f)](_0x4ef002=>(_0x4ef002[_0x2dd29e(0x196)]||0x0)===_0x3f6142);_0x2bc940&&(_0x2d1f45[_0x2dd29e(0x1ed)]?.[_0x2dd29e(0x1b2)](_0x2dd29e(0x1bc)+_0x35704a[_0x2dd29e(0x158)]+'\x20v'+_0x3f6142),_0x48887d=await _0x2d6471(_0x2bc940['id']));}else{const _0x635c27=_0x25dc85[_0x25dc85[_0x2dd29e(0x1c9)]-0x1];_0x2d1f45[_0x2dd29e(0x1ed)]?.['update'](_0x2dd29e(0x1bc)+_0x35704a[_0x2dd29e(0x158)]),_0x48887d=await _0x2d6471(_0x635c27['id']);const _0x4118b2=_0x3a0ad7(_0x635c27['id']),_0x314cad=await journeyResponseToDef(_0x48887d,_0x4118b2),_0x42154d=buildLocalRuleToNameMappingFromJourney(_0x35704a);_0x37ce75=buildMergedJourneyDef([{'item':_0x635c27,'yaml':_0x314cad}],_0x42154d);}}addFoldersToCreate(_0x3d8ceb,_0x2d1f45[_0x2dd29e(0x13e)],_0x54c106);const _0x584830=calculateJourneyDiff(_0x35704a,_0x37ce75);_0xf87917['push']({'relativePath':_0x35704a[_0x2dd29e(0x158)],'absolutePath':_0x6bdd89,'yamlConfig':_0x35704a,'folderPath':_0x3d8ceb,'existingJourney':_0x48887d,'isNew':_0x584830[_0x2dd29e(0x207)],'hasChanges':_0x584830[_0x2dd29e(0x1b7)],'diff':_0x584830[_0x2dd29e(0x226)]});}return{'journeyFiles':_0xf87917,'foldersToCreate':_0x54c106};}export function calculateActivationActions(_0x333558,_0x4c3283,_0x343169,_0x20a31f){const _0x2300c9=a114_0x3308e7,_0x771131=[],_0x31fe26=new Map();for(const _0x210dd7 of _0x4c3283){_0x31fe26['set'](_0x210dd7[_0x2300c9(0x158)],_0x210dd7);}const _0x88819e=new Map();for(const _0x321138 of _0x333558){_0x88819e[_0x2300c9(0x17d)](_0x321138[_0x2300c9(0x158)],_0x321138);}for(const _0x2e3754 of _0x333558){const _0x4cb543=_0x31fe26[_0x2300c9(0x175)](_0x2e3754[_0x2300c9(0x158)]);if(!_0x4cb543)_0x771131[_0x2300c9(0x21a)]({'type':_0x2300c9(0x1c3),'name':_0x2e3754[_0x2300c9(0x158)],'yamlActivation':_0x2e3754});else{const _0x35e1c1=activationResponseToDef(_0x4cb543,_0x343169,_0x20a31f),_0x5b9cc3=a114_0x4e4e82[_0x2300c9(0x1d8)](_0x35e1c1),_0x4d7911=a114_0x4e4e82['stringify'](_0x2e3754);_0x5b9cc3!==_0x4d7911&&_0x771131['push']({'type':_0x2300c9(0x1b2),'name':_0x2e3754[_0x2300c9(0x158)],'yamlActivation':_0x2e3754,'existingActivation':_0x4cb543});}}for(const _0x542ac0 of _0x4c3283){!_0x88819e['has'](_0x542ac0['name'])&&_0x771131['push']({'type':_0x2300c9(0x223),'name':_0x542ac0[_0x2300c9(0x158)],'existingActivation':_0x542ac0});}return _0x771131;}function calculateYamlDiff(_0x5f501a,_0x490344){if(_0x490344){const _0x1941ad=generateDiff(_0x490344,_0x5f501a),_0xbc1b84=hasChanges(_0x1941ad);return{'isNew':![],'hasChanges':_0xbc1b84,'diff':_0xbc1b84?formatDiffWithColors(_0x1941ad):undefined};}const _0x22e144=generateDiff('',_0x5f501a);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x22e144)};}export function calculateSegmentDiff(_0xee0cb2,_0x2b2908,_0x301703,_0x50ab78,_0x196cb4){const _0x1e552f=segmentToYamlString(_0xee0cb2),_0x41aef6=_0x2b2908?segmentToYamlString(segmentWithActivationsToYaml(_0x2b2908,_0x301703,undefined,_0x50ab78,_0x196cb4)):undefined;return calculateYamlDiff(_0x1e552f,_0x41aef6);}export function calculateJourneyDiff(_0x422618,_0x219a3a){const _0x48ea1a=normalizeJourneyDef(_0x422618,_0x422618),_0x1c7ac5=a114_0x4663c6(_0x48ea1a),_0x300835=_0x219a3a?a114_0x4663c6(normalizeJourneyDef(_0x219a3a,_0x422618)):undefined;return calculateYamlDiff(_0x1c7ac5,_0x300835);}export function findSegmentsToDelete(_0x21169d,_0x21d4e6,_0x299129,_0x35128c,_0x220f93){const _0x1f215a=a114_0x3308e7,_0x52c9b1=new Set();for(const {yamlConfig:_0x328762,folderPath:_0xeade3b}of _0x21d4e6){_0x52c9b1[_0x1f215a(0x21e)](_0xeade3b+':'+_0x328762[_0x1f215a(0x158)]);}return _0x21169d[_0x1f215a(0x1bd)](_0x57cd34=>{const _0x3b467e=_0x1f215a,_0x5c091e=_0x57cd34['segmentFolderId']?_0x299129[_0x3b467e(0x175)](_0x57cd34['segmentFolderId'][_0x3b467e(0x17c)]())||'':'',_0x1ae460=_0x5c091e+':'+_0x57cd34[_0x3b467e(0x158)];if(_0x52c9b1[_0x3b467e(0x16c)](_0x1ae460))return![];if(_0x220f93)return _0x5c091e===_0x35128c||_0x5c091e['startsWith'](_0x35128c+'/');return!![];});}export function findJourneysToDelete(_0x55d72f,_0x5a8840,_0x17e86d,_0x5b58c9,_0x2f57f7){const _0x2d3a5e=a114_0x3308e7,_0x3ec8e5=new Set();for(const {yamlConfig:_0x48a46d,folderPath:_0x1c5e8a}of _0x5a8840){_0x3ec8e5[_0x2d3a5e(0x21e)](_0x1c5e8a+':'+_0x48a46d[_0x2d3a5e(0x158)]);}return _0x55d72f['filter'](_0x1cb8d9=>{const _0x5a65da=_0x2d3a5e,_0x581dcc=_0x1cb8d9[_0x5a65da(0x1e7)]?_0x17e86d[_0x5a65da(0x175)](_0x1cb8d9[_0x5a65da(0x1e7)])||'':'',_0x281917=_0x581dcc+':'+_0x1cb8d9[_0x5a65da(0x200)];if(_0x3ec8e5[_0x5a65da(0x16c)](_0x281917))return![];if(_0x2f57f7)return _0x581dcc===_0x5b58c9||_0x581dcc[_0x5a65da(0x1e6)](_0x5b58c9+'/');return!![];});}export function buildSegmentLookupMap(_0xab3c66,_0x566940){const _0x5868f4=a114_0x3308e7,_0x55f6ef=new Map();for(const _0x2998d8 of _0xab3c66){const _0x41e26f=_0x2998d8[_0x5868f4(0x1c4)]?_0x566940['get'](_0x2998d8[_0x5868f4(0x1c4)]['toString']())||'':'',_0x36470a=_0x41e26f+':'+_0x2998d8['name'];_0x55f6ef[_0x5868f4(0x17d)](_0x36470a,_0x2998d8);}return _0x55f6ef;}export function buildSegmentNameToIdMap(_0x432f29){const _0x155d72=a114_0x3308e7,_0x2bd57b=new Map();for(const _0x1db75d of _0x432f29){_0x2bd57b['set'](_0x1db75d[_0x155d72(0x158)],_0x1db75d['id']);}return _0x2bd57b;}export function buildJourneyBundleLookupMap(_0x131a53,_0x1fd072){const _0x7a911a=a114_0x3308e7,_0x1d07f0=new Map();for(const _0x338c46 of _0x131a53){const _0x250b1c=_0x338c46[_0x7a911a(0x1e7)]?_0x1fd072[_0x7a911a(0x175)](_0x338c46[_0x7a911a(0x1e7)])||'':'',_0x352ad3=_0x250b1c+':'+_0x338c46[_0x7a911a(0x200)];!_0x1d07f0[_0x7a911a(0x16c)](_0x352ad3)&&_0x1d07f0[_0x7a911a(0x17d)](_0x352ad3,[]),_0x1d07f0[_0x7a911a(0x175)](_0x352ad3)[_0x7a911a(0x21a)](_0x338c46);}for(const _0x290d65 of _0x1d07f0[_0x7a911a(0x1d2)]()){_0x290d65[_0x7a911a(0x14a)]((_0x28ac60,_0x367988)=>(_0x28ac60[_0x7a911a(0x196)]||0x0)-(_0x367988[_0x7a911a(0x196)]||0x0));}return _0x1d07f0;}function a114_0x3638(_0x40afbb,_0x21efc4){_0x40afbb=_0x40afbb-0x12c;const _0x59faa2=a114_0x59fa();let _0x36385d=_0x59faa2[_0x40afbb];return _0x36385d;}export function collectFoldersToCreate(_0x561b6a,_0x4118cb){const _0x4fd919=a114_0x3308e7,_0xfc4392=new Set();for(const _0x56b9e3 of _0x561b6a){if(!_0x56b9e3)continue;if(_0x4118cb[_0x4fd919(0x16c)](_0x56b9e3))continue;const _0x2acd0f=_0x56b9e3['split']('/');let _0x3f40f7='';for(const _0x42f4ec of _0x2acd0f){_0x3f40f7=_0x3f40f7?_0x3f40f7+'/'+_0x42f4ec:_0x42f4ec,!_0x4118cb[_0x4fd919(0x16c)](_0x3f40f7)&&_0xfc4392[_0x4fd919(0x21e)](_0x3f40f7);}}return _0xfc4392;}export function parseAndClassifyYamlFiles(_0x42c66b,_0x34b85e,_0x48ef97){const _0x4fda3d=a114_0x3308e7,_0x3668a0=[],_0x582e70=[];for(const _0x348003 of _0x42c66b){const _0x2b8620=a114_0x3befe2['relative'](_0x34b85e,a114_0x3befe2[_0x4fda3d(0x182)](_0x348003)),_0x252415=_0x2b8620==='.'?'':_0x2b8620,_0x115c0f=readFileSync(_0x348003,'utf-8'),_0x4c9398=a114_0x4e4e82['parse'](_0x115c0f);if(isJourneyDef(_0x4c9398)){const _0x1c85a9=a114_0x393e31(_0x115c0f);_0x582e70['push']({'yamlConfig':_0x1c85a9,'folderPath':_0x252415,'sourcePath':_0x348003});}else{if(!_0x48ef97?.[_0x4fda3d(0x1f9)]){const _0x1249de=parseSegmentYamlFile(_0x115c0f),_0xce8205=normalizeChildSegmentYaml(_0x1249de);_0x3668a0['push']({'yamlConfig':_0xce8205,'folderPath':_0x252415,'sourcePath':_0x348003});}}}return{'segments':_0x3668a0,'journeys':_0x582e70};}export function validateParsedFiles(_0x2e0d44,_0x5375b4){const _0x4f4bb5=a114_0x3308e7,_0x31bfae=[];for(const {yamlConfig:_0x2e0ff9,sourcePath:_0x22b479}of _0x2e0d44[_0x4f4bb5(0x1c6)]){const _0x38c398=readFileSync(_0x22b479,_0x4f4bb5(0x12c)),_0x2a2bc7=a114_0x4e4e82[_0x4f4bb5(0x14e)](_0x38c398),_0x3490d6=validateSegmentDef(_0x2e0ff9,{'source':_0x38c398,'document':_0x2a2bc7});if(!_0x3490d6['valid']){const _0x424854=a114_0x3befe2[_0x4f4bb5(0x186)](_0x5375b4,_0x22b479);_0x31bfae[_0x4f4bb5(0x21a)]({'filePath':_0x424854,'source':_0x38c398,'result':_0x3490d6,'isJourney':![]});}}for(const {yamlConfig:_0x20932c,sourcePath:_0x2bb3eb}of _0x2e0d44[_0x4f4bb5(0x134)]){const _0x239c9c=readFileSync(_0x2bb3eb,_0x4f4bb5(0x12c)),_0x229887=a114_0x4e4e82[_0x4f4bb5(0x14e)](_0x239c9c),_0xe72ae2=validateJourneyDef(_0x20932c,{'source':_0x239c9c,'document':_0x229887});if(!_0xe72ae2[_0x4f4bb5(0x172)]){const _0x3f7a3f=a114_0x3befe2[_0x4f4bb5(0x186)](_0x5375b4,_0x2bb3eb);_0x31bfae['push']({'filePath':_0x3f7a3f,'source':_0x239c9c,'result':_0xe72ae2,'isJourney':!![]});}}return _0x31bfae;}export function formatValidationErrors(_0x37f0d6){const _0x3d0101=a114_0x3308e7,_0x1d3912=[];for(const {filePath:_0x46faed,source:_0x343618,result:_0x1c064c,isJourney:_0x182dcf}of _0x37f0d6){const _0x45faf3=_0x182dcf?'journey':_0x3d0101(0x189);_0x1d3912[_0x3d0101(0x21a)]('\x0a'+_0x46faed+'\x20('+_0x45faf3+_0x3d0101(0x17e)+_0x1c064c[_0x3d0101(0x20a)][_0x3d0101(0x1c9)]+_0x3d0101(0x139)),_0x1d3912[_0x3d0101(0x21a)](formatValidationResult(_0x1c064c,_0x343618,_0x46faed));}return _0x1d3912['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x3b061b){const _0x427e20=a114_0x3308e7,_0x95dc8b=new Set(),_0x27045d=new Map(),_0x43b7fc=collectSegmentUsageCounts(_0x3b061b);if(_0x3b061b[_0x427e20(0x1c6)])for(const [_0x152709,_0x3ed063]of Object[_0x427e20(0x173)](_0x3b061b[_0x427e20(0x1c6)])){_0x95dc8b[_0x427e20(0x21e)](_0x152709);if(_0x3ed063['rule']){const _0x4f6b81=yamlRuleToApi(_0x3ed063[_0x427e20(0x1f2)]),_0xc3b456=apiRuleToYaml(_0x4f6b81);_0x27045d[_0x427e20(0x17d)](_0x152709,_0xc3b456);}}const _0x53f139=new Map();let _0x349775=0x0;for(const [_0xb0873d,_0xd0fdd3]of _0x27045d){const _0x1c07d6=serializeExpandedRule(_0xd0fdd3,_0x27045d),_0x398d40=_0x53f139['get'](_0x1c07d6)||[];_0x398d40['push']({'name':_0xb0873d,'index':_0x349775}),_0x53f139[_0x427e20(0x17d)](_0x1c07d6,_0x398d40),_0x349775++;}const _0x21bf95=new Map();for(const [_0x283fc5,_0x15c1d9]of _0x53f139){const _0x385665=_0x15c1d9['slice']()['sort']((_0x3209f8,_0x2c6a9f)=>{const _0x3292d7=_0x427e20,_0x592eb3=_0x43b7fc[_0x3292d7(0x175)](_0x3209f8[_0x3292d7(0x158)])||0x0,_0x27fc5d=_0x43b7fc[_0x3292d7(0x175)](_0x2c6a9f[_0x3292d7(0x158)])||0x0;if(_0x592eb3!==_0x27fc5d)return _0x27fc5d-_0x592eb3;return _0x3209f8['index']-_0x2c6a9f[_0x3292d7(0x16b)];})['map'](_0x420610=>_0x420610[_0x427e20(0x158)]),_0x3d57aa=[];for(const _0x22e1a9 of _0x385665){const _0x500500=_0x43b7fc[_0x427e20(0x175)](_0x22e1a9)||0x0,_0x7b7943=Math[_0x427e20(0x187)](_0x500500,0x1);for(let _0x49572f=0x0;_0x49572f<_0x7b7943;_0x49572f++){_0x3d57aa['push'](_0x22e1a9);}}_0x21bf95['set'](_0x283fc5,_0x3d57aa);}return{'existingLocalSegmentNames':_0x95dc8b,'localSegmentRules':_0x27045d,'localExpandedRuleToNames':_0x21bf95};}export function createSegmentIdResolver(_0x400dbb,_0x1dc074){return async _0x12a516=>{const _0x1d3111=a114_0x3638,_0x13df0c=_0x400dbb['get'](_0x12a516);if(!_0x13df0c)throw new SDKError(ErrorCode[_0x1d3111(0x1b8)],_0x1d3111(0x1cb)+_0x12a516+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x1dc074+'\x27)');return _0x13df0c;};}export function extractRootFolderId(_0x482c5c){const _0x5ce790=a114_0x3308e7;return _0x482c5c['relationships']?.['parentSegmentFolder']?.[_0x5ce790(0x1ca)]?.['id']||_0x482c5c['relationships']?.[_0x5ce790(0x171)]?.['data']?.['id'];}export function buildConnectionMaps(_0x2a0e51){const _0xa2d493=a114_0x3308e7,_0x3ec1d8=new Map(),_0x468c04=new Map(),_0x26ad12=new Map();for(const _0x56708a of _0x2a0e51){_0x3ec1d8[_0xa2d493(0x17d)](_0x56708a[_0xa2d493(0x158)],parseInt(_0x56708a['id'],0xa)),_0x468c04[_0xa2d493(0x17d)](_0x56708a['id'],_0x56708a[_0xa2d493(0x158)]),_0x26ad12['set'](_0x56708a[_0xa2d493(0x158)],_0x56708a['type']);}return{'nameToId':_0x3ec1d8,'idToName':_0x468c04,'nameToType':_0x26ad12};}export function calculatePushStats(_0x524054,_0x2f2db2,_0x3c1981,_0x511e87,_0x4c6938,_0x1bf792,_0xeed3ae){const _0x3923d3=a114_0x3308e7,_0x40e2d2=_0x524054[_0x3923d3(0x1bd)](_0x1e89f5=>_0x1e89f5[_0x3923d3(0x207)]),_0x3c6632=_0x524054[_0x3923d3(0x1bd)](_0x4dae87=>!_0x4dae87['isNew']&&_0x4dae87[_0x3923d3(0x1b7)]),_0x408efe=_0x524054[_0x3923d3(0x1bd)](_0x5e0e50=>!_0x5e0e50[_0x3923d3(0x207)]&&!_0x5e0e50['hasChanges']),_0x246eb5=_0x1bf792?_0x511e87:[],_0x238596=_0x2f2db2[_0x3923d3(0x1bd)](_0x5ef2eb=>_0x5ef2eb['isNew']),_0x76867b=_0x2f2db2[_0x3923d3(0x1bd)](_0x44ad80=>!_0x44ad80[_0x3923d3(0x207)]&&_0x44ad80[_0x3923d3(0x1b7)]),_0x3f78c9=_0x2f2db2['filter'](_0x4c0828=>!_0x4c0828[_0x3923d3(0x207)]&&!_0x4c0828[_0x3923d3(0x1b7)]),_0x236ece=_0x1bf792?_0x4c6938:[],_0x25b453=_0x524054[_0x3923d3(0x1e5)](_0x3d06ab=>_0x3d06ab[_0x3923d3(0x132)]),_0x378e4d=_0x25b453[_0x3923d3(0x1bd)](_0x3c16db=>_0x3c16db[_0x3923d3(0x177)]===_0x3923d3(0x1c3)),_0x327828=_0x25b453[_0x3923d3(0x1bd)](_0x1b36e0=>_0x1b36e0['type']==='update'),_0x2dfbbc=_0x25b453[_0x3923d3(0x1bd)](_0x3ccf9=>_0x3ccf9[_0x3923d3(0x177)]==='delete'),_0xfb3222=Array[_0x3923d3(0x1e0)](_0x3c1981)[_0x3923d3(0x14a)](),_0x2f993a=_0xeed3ae?![]:_0x40e2d2[_0x3923d3(0x1c9)]>0x0||_0x3c6632[_0x3923d3(0x1c9)]>0x0||_0x246eb5[_0x3923d3(0x1c9)]>0x0,_0x182a15=_0x238596[_0x3923d3(0x1c9)]>0x0||_0x76867b[_0x3923d3(0x1c9)]>0x0||_0x236ece[_0x3923d3(0x1c9)]>0x0,_0x255985=_0xeed3ae?![]:_0x25b453[_0x3923d3(0x1c9)]>0x0,_0x1b72e1=_0xfb3222[_0x3923d3(0x1c9)]>0x0;return{'segments':{'new':_0x40e2d2,'changed':_0x3c6632,'unchanged':_0x408efe,'toDelete':_0x246eb5},'journeys':{'new':_0x238596,'changed':_0x76867b,'unchanged':_0x3f78c9,'toDelete':_0x236ece},'activations':{'all':_0x25b453,'toCreate':_0x378e4d,'toUpdate':_0x327828,'toDelete':_0x2dfbbc},'folders':{'toCreate':_0xfb3222},'counts':{'segments':{'new':_0x40e2d2['length'],'changed':_0x3c6632[_0x3923d3(0x1c9)],'unchanged':_0x408efe[_0x3923d3(0x1c9)],'toDelete':_0x246eb5['length']},'journeys':{'new':_0x238596['length'],'changed':_0x76867b[_0x3923d3(0x1c9)],'unchanged':_0x3f78c9['length'],'toDelete':_0x236ece[_0x3923d3(0x1c9)]},'activations':{'create':_0x378e4d['length'],'update':_0x327828[_0x3923d3(0x1c9)],'delete':_0x2dfbbc[_0x3923d3(0x1c9)]},'folders':_0xfb3222[_0x3923d3(0x1c9)]},'hasChanges':_0x2f993a||_0x182a15||_0x255985||_0x1b72e1};}export async function buildPushExecutionContext(_0x18ea79,_0x5ef354,_0x3e7bf2,_0x4e637b,_0x274b89,_0x18f480){const _0x595f3f=a114_0x3308e7,_0xd01d70=extractRootFolderId(_0x3e7bf2),{pathToId:_0x514fc6,idToPath:_0x10eb7f}=buildFolderMaps(_0x274b89),_0x4aed25=buildSegmentNameToIdMap(_0x4e637b),_0x5a7c9c=new Map(),{batchAsync:_0x29c1ba}=await import(_0x595f3f(0x18f)),[_0x2c5f09,_0x43d08d]=await Promise[_0x595f3f(0x18b)]([_0x18ea79[_0x595f3f(0x1fd)][_0x595f3f(0x13b)](),_0x18ea79[_0x595f3f(0x1f5)][_0x595f3f(0x161)](),((async()=>{const _0x3bd540=_0x595f3f;!_0x18f480&&_0x4e637b[_0x3bd540(0x1c9)]>0x0&&await _0x29c1ba(_0x4e637b,async _0x11c6a6=>{const _0x9fed3d=_0x3bd540,_0x35987d=await _0x18ea79[_0x9fed3d(0x189)][_0x9fed3d(0x1e4)](_0x5ef354,_0x11c6a6['id']);_0x5a7c9c[_0x9fed3d(0x17d)](_0x11c6a6['id'],_0x35987d);});})())]),{emailToId:_0x2c746d,idToEmail:_0x4574c8}=_0x2c5f09,_0x33e816=buildConnectionMaps(_0x43d08d);return{'rootFolderId':_0xd01d70,'folderPathToId':_0x514fc6,'folderIdToPath':_0x10eb7f,'segmentNameToId':_0x4aed25,'activationsBySegmentId':_0x5a7c9c,'emailToIdMap':_0x2c746d,'idToEmailMap':_0x4574c8,'connectionNameToIdMap':_0x33e816[_0x595f3f(0x1be)],'connectionIdToNameMap':_0x33e816[_0x595f3f(0x15b)],'connectionNameToTypeMap':_0x33e816['nameToType']};}export function createPushYamlContextForBundle(_0x3a0ce8,_0x4e0b7a,_0x24f2a9,_0x20963f,_0x40a91a,_0xe9d29c,_0x3ca230,_0xf5de41){const {existingLocalSegmentNames:_0x489788,localExpandedRuleToNames:_0x66d47e}=_0x20963f,_0x173946=new Set(),_0x539691=new Map(),_0x28193a=new Map(),_0x10c7fc=new Map(),_0x41ad19=createJumpTargetCache(),_0x41ce51=new Map(),_0x51e85=new Map(),_0x377cc2=new Set();let _0x26398e;const _0x2782c1=_0x4969f3=>{const _0x3a5b89={'resolveSegment':async _0x24e806=>{const _0x6a5bb2=a114_0x3638,_0x2c7bbc=_0x10c7fc['get'](_0x24e806);if(_0x2c7bbc!==undefined)return{'name':_0x2c7bbc,'isJourneyLocal':!![]};try{const _0x1bcbde=await fetchSegment(_0x3a0ce8,_0x4e0b7a,_0x24e806,_0x24f2a9);if(!_0x1bcbde)throw new Error('Segment\x20not\x20found');const _0x1931ad=generateJourneyLocalName(_0x1bcbde[_0x6a5bb2(0x158)]),_0x22d5b6=_0x1bcbde[_0x6a5bb2(0x1fc)]===SEGMENT_KIND_JOURNEY&&_0x1931ad!==undefined;let _0x2a3a52=_0x1bcbde[_0x6a5bb2(0x158)],_0x1182d5;if(_0x22d5b6&&_0x1bcbde[_0x6a5bb2(0x1f2)]){const _0x3cca6c=apiRuleToYaml(_0x1bcbde[_0x6a5bb2(0x1f2)]);_0x51e85[_0x6a5bb2(0x17d)](_0x24e806,_0x3cca6c);const _0x2c5d5e=async _0x7f598d=>{const _0x58e9ff=_0x6a5bb2,_0x513992=collectSegmentRefsFromRule(_0x7f598d);for(const _0x3afe8c of _0x513992){if(!_0x51e85[_0x58e9ff(0x16c)](_0x3afe8c))try{const _0x436c05=await fetchSegment(_0x3a0ce8,_0x4e0b7a,_0x3afe8c,_0x24f2a9);if(_0x436c05?.[_0x58e9ff(0x1f2)]){const _0x17b556=apiRuleToYaml(_0x436c05[_0x58e9ff(0x1f2)]);_0x51e85[_0x58e9ff(0x17d)](_0x3afe8c,_0x17b556),await _0x2c5d5e(_0x17b556);}}catch(_0x383bbc){logger['debug'](_0x58e9ff(0x1ec)+_0x3afe8c+':\x20'+_0x383bbc);}}};await _0x2c5d5e(_0x3cca6c);const _0x316ab0=serializeExpandedRule(_0x3cca6c,_0x51e85),_0x3df320=_0x66d47e[_0x6a5bb2(0x175)](_0x316ab0);if(_0x3df320&&_0x3df320[_0x6a5bb2(0x1c9)]>0x0){const _0x24e239=_0x539691[_0x6a5bb2(0x175)](_0x316ab0)||0x0,_0x334efb=_0x3df320[_0x24e239]||_0x3df320[_0x3df320['length']-0x1];_0x539691[_0x6a5bb2(0x17d)](_0x316ab0,_0x24e239+0x1),_0x2a3a52=_0x334efb,_0x173946[_0x6a5bb2(0x21e)](_0x2a3a52),_0x10c7fc[_0x6a5bb2(0x17d)](_0x24e806,_0x2a3a52);const _0x5cb058=await resolveRuleSegmentRefs(_0x3cca6c,async _0x33fc89=>{const _0x54086e=_0x6a5bb2,_0x574d55=_0x10c7fc[_0x54086e(0x175)](_0x33fc89);if(_0x574d55)return _0x574d55;const _0x1f068f=await _0x26398e['resolveSegment'](_0x33fc89);return _0x1f068f['name'];});_0x1182d5={'description':_0x1bcbde[_0x6a5bb2(0x1e1)],'rule':_0x5cb058};}else{const _0x3aebc2=_0x41ce51['get'](_0x316ab0);if(_0x3aebc2)_0x2a3a52=_0x3aebc2,_0x10c7fc[_0x6a5bb2(0x17d)](_0x24e806,_0x2a3a52);else{if(_0x1931ad){let _0x5c819f=_0x1931ad,_0x5e387c=0x2;while(_0x173946[_0x6a5bb2(0x16c)](_0x5c819f)||_0x489788[_0x6a5bb2(0x16c)](_0x5c819f)){_0x5c819f=_0x1931ad+'_'+_0x5e387c,_0x5e387c++;}_0x173946[_0x6a5bb2(0x21e)](_0x5c819f),_0x2a3a52=_0x5c819f;}_0x10c7fc['set'](_0x24e806,_0x2a3a52),_0x41ce51['set'](_0x316ab0,_0x2a3a52);const _0x14ff1d=await resolveRuleSegmentRefs(_0x3cca6c,async _0xf754b0=>{const _0x47d707=_0x6a5bb2,_0x79b621=_0x10c7fc[_0x47d707(0x175)](_0xf754b0);if(_0x79b621)return _0x79b621;const _0xed806f=await _0x26398e[_0x47d707(0x220)](_0xf754b0);return _0xed806f[_0x47d707(0x158)];});_0x1182d5={'description':_0x1bcbde[_0x6a5bb2(0x1e1)],'rule':_0x14ff1d};}}}return{'name':_0x2a3a52,'isJourneyLocal':_0x22d5b6,'definition':_0x1182d5};}catch(_0x14c1ed){return logger[_0x6a5bb2(0x1ac)](_0x6a5bb2(0x1e2)+_0x24e806+':\x20'+_0x14c1ed),{'name':_0x24e806,'isJourneyLocal':![]};}},'resolveActivation':async _0xd9276e=>{const _0x419fd0=a114_0x3638,_0x53451a=_0x28193a[_0x419fd0(0x175)](_0xd9276e);if(_0x53451a!==undefined)return{'name':_0x53451a,'isJourneyLocal':!![]};try{let _0x2606dc=_0x3ca230?.[_0x419fd0(0x175)](_0xd9276e);!_0x2606dc&&(_0x2606dc=await _0x3a0ce8[_0x419fd0(0x190)]['getActivation'](_0x4969f3,_0xd9276e));const _0x1299ff=_0x2606dc[_0x419fd0(0x13c)]['activationParams']['name']||_0xd9276e,_0x34ec63=sanitizeYamlKey(_0x1299ff)||_0x419fd0(0x1fe)+_0xd9276e,_0x5eddcc=_0x34ec63;_0x28193a[_0x419fd0(0x17d)](_0xd9276e,_0x5eddcc);const _0xa939f2=journeyActivationStepToYaml(_0x2606dc,_0x40a91a,_0xe9d29c);return{'name':_0x5eddcc,'isJourneyLocal':!![],'definition':_0xa939f2};}catch(_0x230e82){return logger['debug'](_0x419fd0(0x222)+_0xd9276e+':\x20'+_0x230e82),{'name':_0xd9276e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5ea45a,_0x5d4355)=>resolveJumpTarget(_0x5ea45a,_0x5d4355,_0x41ad19,async _0x239a7b=>{const _0x30caa7=a114_0x3638,_0x13532d=_0xf5de41?.[_0x30caa7(0x175)](_0x239a7b);if(_0x13532d)return _0x13532d;return _0x3a0ce8[_0x30caa7(0x190)][_0x30caa7(0x1d6)](_0x239a7b);})};return _0x26398e=_0x3a5b89,_0x3a5b89;},_0x1df952=async _0x498b38=>{const _0x1259c7=a114_0x3638,{collectSegmentIdsFromJourneyApi:_0x77da1b}=await import(_0x1259c7(0x12f)),{batchAsync:_0x5611d3}=await import(_0x1259c7(0x18f)),_0x575f5c=new Set();for(const _0x364f82 of _0x498b38){let _0x5af40b=_0xf5de41?.[_0x1259c7(0x175)](_0x364f82);!_0x5af40b&&(_0x5af40b=await _0x3a0ce8[_0x1259c7(0x190)][_0x1259c7(0x1d6)](_0x364f82));const _0x5a271f=_0x77da1b(_0x5af40b);for(const _0x26f776 of _0x5a271f){_0x575f5c[_0x1259c7(0x21e)](_0x26f776);}}let _0x5bceab=Array[_0x1259c7(0x1e0)](_0x575f5c);while(_0x5bceab[_0x1259c7(0x1c9)]>0x0){const _0x111317=_0x5bceab[_0x1259c7(0x1bd)](_0xaec1a7=>!_0x377cc2[_0x1259c7(0x16c)](_0xaec1a7));if(_0x111317['length']===0x0)break;const _0x1cd13f=await _0x5611d3(_0x111317,async _0x2c15aa=>{const _0x44aab2=_0x1259c7;_0x377cc2[_0x44aab2(0x21e)](_0x2c15aa);const _0x5cb81a=await fetchSegment(_0x3a0ce8,_0x4e0b7a,_0x2c15aa,_0x24f2a9);if(!_0x5cb81a)return null;return{'segmentId':_0x2c15aa,'segment':_0x5cb81a};},0xa),_0x1cb88b=new Set();for(const _0x5b0fbc of _0x1cd13f){if(!_0x5b0fbc?.[_0x1259c7(0x189)]?.['rule'])continue;const _0x45e7e4=apiRuleToYaml(_0x5b0fbc[_0x1259c7(0x189)][_0x1259c7(0x1f2)]);_0x51e85[_0x1259c7(0x17d)](_0x5b0fbc[_0x1259c7(0x138)],_0x45e7e4);const _0x55bf65=collectSegmentRefsFromRule(_0x45e7e4);for(const _0x577201 of _0x55bf65){!_0x377cc2[_0x1259c7(0x16c)](_0x577201)&&_0x1cb88b[_0x1259c7(0x21e)](_0x577201);}}_0x5bceab=Array[_0x1259c7(0x1e0)](_0x1cb88b);}};return{'createYamlContext':_0x2782c1,'prefetchJourneySegments':_0x1df952};}export async function executePushSegments(_0x44064f,_0x10be76,_0xed2899,_0xc46c2f,_0x93b685){const _0x37f33f=a114_0x3308e7,{segmentDefToCreateRequest:_0x35eec0,segmentDefToUpdateRequest:_0x339175}=await import(_0x37f33f(0x1d4)),_0x54a9ac=_0xed2899[_0x37f33f(0x13e)],_0x19d748=0x5,_0x44c67d=async _0x180dab=>{const _0x448cc5=_0x37f33f,_0x56e950=_0x180dab[_0x448cc5(0x13d)]?_0x54a9ac[_0x448cc5(0x175)](_0x180dab[_0x448cc5(0x13d)]):undefined;let _0xff0d2b;const _0x1c5302={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x180dab[_0x448cc5(0x207)]){_0x93b685[_0x448cc5(0x1fb)]?.({'type':_0x448cc5(0x1a5),'name':_0x180dab['yamlConfig'][_0x448cc5(0x158)]});const _0xbf8417=_0x35eec0(_0x180dab[_0x448cc5(0x225)],_0x56e950),_0x49310c=await _0x93b685[_0x448cc5(0x167)](_0x448cc5(0x1f4)+_0x180dab[_0x448cc5(0x225)][_0x448cc5(0x158)]+_0x448cc5(0x14f),()=>_0x44064f[_0x448cc5(0x189)][_0x448cc5(0x1d3)](_0xc46c2f['parentId'],_0xbf8417));_0xff0d2b=_0x49310c[_0x448cc5(0x1ca)]['id'],_0x1c5302[_0x448cc5(0x205)]={'name':_0x180dab[_0x448cc5(0x225)]['name'],'id':_0xff0d2b},_0x93b685[_0x448cc5(0x1fb)]?.({'type':_0x448cc5(0x1db),'name':_0x180dab['yamlConfig'][_0x448cc5(0x158)],'segmentId':_0xff0d2b}),_0x93b685['logSuccess']?.(_0x448cc5(0x1bb)+_0x180dab['yamlConfig'][_0x448cc5(0x158)]+'\x27'),_0x1c5302[_0x448cc5(0x1aa)]=0x1;}else{if(_0x180dab[_0x448cc5(0x1b7)]){_0x93b685['onProgress']?.({'type':_0x448cc5(0x1cf),'name':_0x180dab[_0x448cc5(0x225)][_0x448cc5(0x158)]});const _0x212276=_0x339175(_0x180dab[_0x448cc5(0x225)]);_0x56e950!==_0x180dab['existingSegment']?.[_0x448cc5(0x1c4)]&&(_0x212276[_0x448cc5(0x1c4)]=_0x56e950?parseInt(_0x56e950,0xa):undefined),await _0x93b685[_0x448cc5(0x167)](_0x448cc5(0x15a)+_0x180dab[_0x448cc5(0x225)][_0x448cc5(0x158)]+_0x448cc5(0x14f),()=>_0x44064f[_0x448cc5(0x189)]['updateSegmentById'](_0xc46c2f['parentId'],_0x180dab['existingSegment']['id'],_0x212276)),_0xff0d2b=_0x180dab[_0x448cc5(0x216)]['id'],_0x93b685[_0x448cc5(0x1fb)]?.({'type':_0x448cc5(0x18a),'name':_0x180dab['yamlConfig'][_0x448cc5(0x158)]}),_0x93b685['logSuccess']?.(_0x448cc5(0x1ab)+_0x180dab[_0x448cc5(0x225)][_0x448cc5(0x158)]+'\x27'),_0x1c5302['updated']=0x1;}else _0xff0d2b=_0x180dab['existingSegment']['id'];}}catch(_0x31f637){const _0x4ca49a=isHttp400Error(_0x31f637),_0x64efed=_0x4ca49a?ErrorCode[_0x448cc5(0x1e9)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x5f1a3d=getErrorMessage(_0x31f637);throw new SDKError(_0x64efed,'Failed\x20to\x20'+(_0x180dab[_0x448cc5(0x207)]?'create':_0x448cc5(0x1b2))+_0x448cc5(0x1b9)+_0x180dab[_0x448cc5(0x149)]+_0x448cc5(0x144)+_0x5f1a3d,_0x31f637);}try{const _0x22ca98=await syncActivationsForSegment(_0x44064f,_0xc46c2f[_0x448cc5(0x143)],_0xff0d2b,_0x180dab[_0x448cc5(0x225)]['name'],_0x180dab[_0x448cc5(0x132)],_0x93b685,_0x180dab[_0x448cc5(0x149)]);_0x1c5302[_0x448cc5(0x12e)]=_0x22ca98;}catch(_0x4901a8){if(_0x4901a8 instanceof SDKError)throw _0x4901a8;throw new SDKError(ErrorCode[_0x448cc5(0x1b3)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x180dab['yamlConfig'][_0x448cc5(0x158)]+_0x448cc5(0x135)+_0x180dab[_0x448cc5(0x149)]+_0x448cc5(0x144)+getErrorMessage(_0x4901a8),_0x4901a8);}return _0x1c5302;},_0x5e5cde=await batchAsync(_0x10be76,_0x44c67d,_0x19d748),_0x123652={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4b7be5 of _0x5e5cde){_0x123652['created']+=_0x4b7be5['created'],_0x123652[_0x37f33f(0x162)]+=_0x4b7be5[_0x37f33f(0x162)],_0x4b7be5[_0x37f33f(0x205)]&&_0x123652[_0x37f33f(0x21d)][_0x37f33f(0x17d)](_0x4b7be5[_0x37f33f(0x205)][_0x37f33f(0x158)],_0x4b7be5[_0x37f33f(0x205)]['id']),_0x123652[_0x37f33f(0x12e)]['created']+=_0x4b7be5[_0x37f33f(0x12e)][_0x37f33f(0x1aa)],_0x123652[_0x37f33f(0x12e)][_0x37f33f(0x162)]+=_0x4b7be5[_0x37f33f(0x12e)][_0x37f33f(0x162)],_0x123652[_0x37f33f(0x12e)][_0x37f33f(0x192)]+=_0x4b7be5[_0x37f33f(0x12e)][_0x37f33f(0x192)];}return _0x123652;}function a114_0x59fa(){const _0x45bf8f=['folder_created','Created\x20activation\x20\x27','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','versionNumber','uniqueServerName','stage\x20\x27','journeyById','journeyName','journeyBundlesByFolderAndName','isArray','day','createFolder','embedded_segment_creating','getSegmentEntity','branches','SEGMENT_UPDATE_ERROR','49699Quupda','idToEmailMap','segment_creating','entry','schedule','activationContext','34QWULBc','created','Updated\x20segment\x20\x27','debug','join','activation_creating','4535538PdtAWj','journeyId','\x20activation\x20\x27','update','ACTIVATION_UPDATE_ERROR','run_after_journey_refresh','toISOString','activation_created','hasChanges','SEGMENT_NOT_FOUND','\x20segment\x20from\x20file:\x20','existingSegments','Created\x20segment\x20\x27','Fetching\x20','filter','nameToId','activation_template_id','deleteActivation','conditionTimeoutUnit','Journey\x20\x27','create','segmentFolderId','\x27\x20wait\x20condition','segments','journey_created','JOURNEY_UPDATE_ERROR','length','data','Segment\x20not\x20found:\x20','embeddedSegmentNameToId','all_columns','logDeleted','segment_updating','draft','hex','values','createSegment','./child-segment-yaml.js','steps','getJourney','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','stringify','relationships','existingJourney','segment_created','parse','size','7634960WKcsVY','conditions','from','description','Failed\x20to\x20resolve\x20segment\x20','\x27\x20milestone','listActivations','flatMap','startsWith','folderId','embedded_segment_created','SEGMENT_SYNTAX_ERROR','journeyActivationNameToId','slice','Failed\x20to\x20fetch\x20referenced\x20segment\x20','progress','logInfo','stages','waitStepUnit','Condition','rule','results','Creating\x20segment\x20\x27','connection','waitStep','\x27\x20decision\x20point\x20branch\x20\x27','DecisionPoint','skipSegments','224139IZniio','onProgress','kind','user','activation_','rootFolderId','journeyBundleName','embedded_activation_creating','activation_updating','waitStepType','deps','createdSegmentId','includes','isNew','Updated\x20journey\x20\x27','sha1','errors','activationsBySegmentId','Delete\x20the\x20push\x20recovery\x20file\x20(','getSegmentEntity\x20also\x20failed\x20for\x20','segment_deleting','\x20(referenced\x20in\x20journey\x20','effectiveFolderId','\x27\x20exit\x20criteria','5OVnClX','entryCriteria','conditionTimeoutDuration','unchanged','existingSegment','connector_config','journeyActivationStepId','1071otmFgN','push','state','Stage\x20\x27','createdSegmentIds','add','WaitStep','resolveSegment','milestone','Failed\x20to\x20resolve\x20activation\x20','delete','map','yamlConfig','diff','notification','utf-8','segmentNameToId','activations','./journey-yaml.js','Deleted\x20segment\x20\x27','some','activationActions','Created\x20journey\x20\x27','journeys','\x27\x20from\x20file:\x20','11127954NPbwmp','Activation\x20not\x20found:\x20','segmentId','\x20error(s)','fetchJourney','buildUserMaps','attributes','folderPath','folderPathToId','getSegment','trim','embedded_activation_created','11831976czYeWG','parentId','\x0a\x20\x20','logSuccess','activation_updated','Deleting\x20activation\x20\x27','uniqueSegmentName','absolutePath','sort','Duration','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','exitCriterias','parseDocument','\x27...','keys','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','segment_deleted','conditionSegmentId','split','activationStepsById','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','createActivation','name','message','Updating\x20segment\x20\x27','idToName','journey_updating','resolveJourneyId','Created\x20folder\x20\x27','decision_point','existingActivation','list','updated','replace','Embedded\x20segment\x20\x27','Updating\x20activation\x20\x27','localName','withProgress','NOT_FOUND','Activation','folder','index','has','validatedRequest','resolvedRule','Name\x20has\x20already\x20been\x20taken','Failed\x20to\x20','parentFolder','valid','entries','columns','get','INTERNAL','type','connectionIdToNameMap','yamlActivation','__pending_','Creating\x20activation\x20\x27','toString','set','):\x20','find','Entry\x20criteria:\x20','392090duZuOC','dirname','getSegment\x20failed\x20for\x20','toLowerCase','with','relative','max','entry_criteria','segment','segment_updated','all','\x27\x20entry\x20criteria','behavior','action','../../utils/async.js','journey','goal','deleted'];a114_0x59fa=function(){return _0x45bf8f;};return a114_0x59fa();}async function syncActivationsForSegment(_0x4cd9ac,_0x133391,_0x1b27b3,_0x454f05,_0x49aa5b,_0x1c2591,_0x146c25){const _0xa209a5=a114_0x3308e7,_0x555592={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3247d5 of _0x49aa5b){try{if(_0x3247d5['type']===_0xa209a5(0x1c3)&&_0x3247d5[_0xa209a5(0x16d)])_0x1c2591[_0xa209a5(0x1fb)]?.({'type':_0xa209a5(0x1ae),'segmentName':_0x454f05,'activationName':_0x3247d5[_0xa209a5(0x158)]}),await _0x1c2591['withProgress'](_0xa209a5(0x17b)+_0x3247d5[_0xa209a5(0x158)]+_0xa209a5(0x14f),()=>_0x4cd9ac['segment']['createActivation'](_0x133391,_0x1b27b3,_0x3247d5[_0xa209a5(0x16d)])),_0x1c2591[_0xa209a5(0x1fb)]?.({'type':_0xa209a5(0x1b6),'segmentName':_0x454f05,'activationName':_0x3247d5[_0xa209a5(0x158)]}),_0x1c2591[_0xa209a5(0x145)]?.(_0xa209a5(0x194)+_0x3247d5[_0xa209a5(0x158)]+'\x27'),_0x555592[_0xa209a5(0x1aa)]++;else{if(_0x3247d5['type']===_0xa209a5(0x1b2)&&_0x3247d5[_0xa209a5(0x16d)]&&_0x3247d5[_0xa209a5(0x160)])_0x1c2591[_0xa209a5(0x1fb)]?.({'type':_0xa209a5(0x202),'segmentName':_0x454f05,'activationName':_0x3247d5['name']}),await _0x1c2591['withProgress'](_0xa209a5(0x165)+_0x3247d5['name']+_0xa209a5(0x14f),()=>_0x4cd9ac['segment']['updateActivation'](_0x133391,_0x1b27b3,_0x3247d5[_0xa209a5(0x160)]['id'],_0x3247d5['validatedRequest'])),_0x1c2591[_0xa209a5(0x1fb)]?.({'type':_0xa209a5(0x146),'segmentName':_0x454f05,'activationName':_0x3247d5[_0xa209a5(0x158)]}),_0x1c2591[_0xa209a5(0x145)]?.('Updated\x20activation\x20\x27'+_0x3247d5[_0xa209a5(0x158)]+'\x27'),_0x555592[_0xa209a5(0x162)]++;else _0x3247d5[_0xa209a5(0x177)]===_0xa209a5(0x223)&&_0x3247d5[_0xa209a5(0x160)]&&(_0x1c2591[_0xa209a5(0x1fb)]?.({'type':'activation_deleting','segmentName':_0x454f05,'activationName':_0x3247d5[_0xa209a5(0x158)]}),await _0x1c2591[_0xa209a5(0x167)](_0xa209a5(0x147)+_0x3247d5['name']+_0xa209a5(0x14f),()=>_0x4cd9ac[_0xa209a5(0x189)][_0xa209a5(0x1c0)](_0x133391,_0x1b27b3,_0x3247d5[_0xa209a5(0x160)]['id'])),_0x1c2591[_0xa209a5(0x1fb)]?.({'type':'activation_deleted','segmentName':_0x454f05,'activationName':_0x3247d5['name']}),_0x1c2591[_0xa209a5(0x1ce)]?.('Deleted\x20activation\x20\x27'+_0x3247d5[_0xa209a5(0x158)]+'\x27'),_0x555592[_0xa209a5(0x192)]++);}}catch(_0x35dd59){const _0x1fafec=isHttp400Error(_0x35dd59),_0x1c11bf=_0x1fafec?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0xa209a5(0x1b3)],_0x59984c=getErrorMessage(_0x35dd59);throw new SDKError(_0x1c11bf,_0xa209a5(0x170)+_0x3247d5['type']+_0xa209a5(0x1b1)+_0x3247d5['name']+_0xa209a5(0x135)+_0x146c25+_0xa209a5(0x144)+_0x59984c,_0x35dd59);}}return _0x555592;}export async function executePushFolders(_0x4d06fb,_0x4954f6,_0x26d587,_0x405165,_0x5010e9){const _0x30a4dc=a114_0x3308e7,_0x3c0cd1=new Map(_0x26d587);for(const _0x4d4f87 of _0x4954f6){const _0x1f4e81=_0x4d4f87[_0x30a4dc(0x154)]('/'),_0x1f8468=_0x1f4e81[_0x1f4e81['length']-0x1],_0x593b2f=_0x1f4e81[_0x30a4dc(0x1eb)](0x0,-0x1)['join']('/'),_0x4fefd4=_0x3c0cd1['get'](_0x593b2f);_0x5010e9['onProgress']?.({'type':'folder_creating','folder':_0x4d4f87});const _0x38fe64={'name':_0x1f8468,'parentFolderId':_0x4fefd4},_0x295ac8=await _0x5010e9['withProgress']('Creating\x20folder\x20\x27'+_0x4d4f87+_0x30a4dc(0x14f),()=>_0x4d06fb[_0x30a4dc(0x189)][_0x30a4dc(0x19e)](_0x405165[_0x30a4dc(0x143)],_0x38fe64));_0x3c0cd1[_0x30a4dc(0x17d)](_0x4d4f87,_0x295ac8[_0x30a4dc(0x1ca)]['id']),_0x5010e9[_0x30a4dc(0x1fb)]?.({'type':_0x30a4dc(0x193),'folder':_0x4d4f87,'folderId':_0x295ac8[_0x30a4dc(0x1ca)]['id']}),_0x5010e9[_0x30a4dc(0x1ee)]?.(_0x30a4dc(0x15e)+_0x4d4f87+'\x27');}return _0x3c0cd1;}export async function executePushSegmentDeletions(_0x2eada5,_0x2be90a,_0x493a88){const _0x3a05c0=a114_0x3308e7;if(_0x2be90a[_0x3a05c0(0x1c9)]===0x0)return 0x0;const {batchAsync:_0x45df7e}=await import(_0x3a05c0(0x18f)),_0xbe4675=0x5,_0x3ba078=await _0x45df7e(_0x2be90a,async _0x553ee4=>{const _0x3744dd=_0x3a05c0;return _0x493a88[_0x3744dd(0x1fb)]?.({'type':_0x3744dd(0x20e),'name':_0x553ee4[_0x3744dd(0x158)]}),await _0x2eada5['segment']['deleteSegment'](_0x553ee4['id']),_0x493a88[_0x3744dd(0x1fb)]?.({'type':_0x3744dd(0x152),'name':_0x553ee4['name']}),_0x493a88[_0x3744dd(0x1ce)]?.(_0x3744dd(0x130)+_0x553ee4['name']+'\x27'),0x1;},_0xbe4675);return _0x3ba078['reduce']((_0x11c4e8,_0xa17cb)=>_0x11c4e8+_0xa17cb,0x0);}export async function executePushJourneys(_0x3d4f53,_0x385691,_0x46537b,_0x47a19c,_0x290f6d){const _0x389b0c=a114_0x3308e7,{journeyDefToRequest:_0x49f632}=await import(_0x389b0c(0x12f)),{activationDefToCreateRequest:_0x46ae6c,yamlRuleToApi:_0x435d89,validateSegmentRule:_0x26b15d}=await import(_0x389b0c(0x1d4)),_0x88d3c7={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5949c5=new Map(_0x46537b[_0x389b0c(0x12d)]),_0x723a05=0x5;for(let _0x5588b5=0x0;_0x5588b5<_0x385691[_0x389b0c(0x1c9)];_0x5588b5+=_0x723a05){const _0x2a882b=_0x385691[_0x389b0c(0x1eb)](_0x5588b5,_0x5588b5+_0x723a05),_0x3253a9=await Promise[_0x389b0c(0x18b)](_0x2a882b['map'](async _0x17b914=>{const _0x569c22=_0x389b0c;if(!_0x17b914[_0x569c22(0x207)]&&!_0x17b914['hasChanges'])return{'action':_0x569c22(0x215),'name':_0x17b914[_0x569c22(0x225)][_0x569c22(0x158)],'journeyId':_0x17b914[_0x569c22(0x1da)]?.['id']};const _0x1b85a9=_0x17b914['folderPath']?_0x46537b['folderPathToId'][_0x569c22(0x175)](_0x17b914[_0x569c22(0x13d)]):undefined;_0x290f6d['onProgress']?.({'type':_0x17b914[_0x569c22(0x207)]?'journey_creating':_0x569c22(0x15c),'name':_0x17b914[_0x569c22(0x225)]['name']});try{const _0x14a7f3=await executeSingleJourneyPush(_0x3d4f53,_0x17b914,{..._0x46537b,'segmentNameToId':_0x5949c5},{'parentId':_0x47a19c[_0x569c22(0x143)],'rootFolderId':_0x47a19c[_0x569c22(0x1ff)],'folderId':_0x1b85a9,'verbose':_0x47a19c['verbose']},_0x290f6d,{'journeyDefToRequest':_0x49f632,'activationDefToCreateRequest':_0x46ae6c,'yamlRuleToApi':_0x435d89,'validateSegmentRule':_0x26b15d});for(const [_0x5a7c7a,_0x178a25]of _0x14a7f3[_0x569c22(0x1cc)]){_0x5949c5[_0x569c22(0x17d)](_0x5a7c7a,_0x178a25),_0x88d3c7[_0x569c22(0x1cc)][_0x569c22(0x17d)](_0x5a7c7a,_0x178a25);}if(_0x14a7f3[_0x569c22(0x18e)]==='created')_0x290f6d['onProgress']?.({'type':_0x569c22(0x1c7),'name':_0x17b914['yamlConfig']['name'],'journeyId':_0x14a7f3['journeyId']}),_0x290f6d[_0x569c22(0x145)]?.(_0x569c22(0x133)+_0x17b914[_0x569c22(0x225)][_0x569c22(0x158)]+'\x27'),_0x88d3c7[_0x569c22(0x1aa)]++;else _0x14a7f3['action']===_0x569c22(0x162)&&(_0x290f6d[_0x569c22(0x1fb)]?.({'type':'journey_updated','name':_0x17b914[_0x569c22(0x225)][_0x569c22(0x158)]}),_0x290f6d[_0x569c22(0x145)]?.(_0x569c22(0x208)+_0x17b914[_0x569c22(0x225)][_0x569c22(0x158)]+'\x27'),_0x88d3c7[_0x569c22(0x162)]++);return{'action':_0x14a7f3[_0x569c22(0x18e)],'name':_0x17b914['yamlConfig'][_0x569c22(0x158)],'journeyId':_0x14a7f3[_0x569c22(0x1b0)]};}catch(_0x1fc99a){const _0x964667=isHttp400Error(_0x1fc99a),_0x4a4002=_0x964667?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x569c22(0x1c8)],_0x5de26a=getErrorMessage(_0x1fc99a);throw new SDKError(_0x4a4002,_0x569c22(0x170)+(_0x17b914[_0x569c22(0x207)]?_0x569c22(0x1c3):_0x569c22(0x1b2))+'\x20journey\x20from\x20file:\x20'+_0x17b914['absolutePath']+'\x0a\x20\x20'+_0x5de26a,_0x1fc99a);}}));_0x88d3c7[_0x389b0c(0x1f3)]['push'](..._0x3253a9);}return _0x88d3c7;}async function matchExistingJourneySegments(_0x3648e8,_0x565cd4,_0x54258c,_0x1304c6,_0x5802b8){const _0x1e8116=a114_0x3308e7;if(!_0x565cd4[_0x1e8116(0x1da)]||!_0x565cd4['yamlConfig'][_0x1e8116(0x1c6)])return;const _0x59aff9=new Map();for(const _0x32c65d of Object[_0x1e8116(0x150)](_0x565cd4[_0x1e8116(0x225)][_0x1e8116(0x1c6)])){const _0x67e1ea=generateDeterministicJourneySegmentName(_0x565cd4[_0x1e8116(0x225)]['name'],_0x32c65d);_0x59aff9[_0x1e8116(0x17d)](_0x67e1ea,_0x32c65d);}const _0x36cdbd=collectSegmentIdsFromJourneyApi(_0x565cd4[_0x1e8116(0x1da)]);for(const _0x257f57 of _0x36cdbd){const _0x458613=await fetchSegment(_0x3648e8,_0x54258c,_0x257f57,_0x1304c6);if(!_0x458613?.[_0x1e8116(0x158)])continue;const _0x334b42=_0x59aff9['get'](_0x458613[_0x1e8116(0x158)]);_0x334b42&&_0x5802b8[_0x1e8116(0x17d)](_0x334b42,_0x257f57);}}async function executeSingleJourneyPush(_0x29e0b3,_0x5c6275,_0x2dff10,_0x4c7e3d,_0x364b85,_0x21707b){const _0xe6b2a6=a114_0x3308e7,{journeyDefToRequest:_0x4e02f1,activationDefToCreateRequest:_0x40a594,yamlRuleToApi:_0xb48b9b,validateSegmentRule:_0x264c22}=_0x21707b,_0x19d3cd=new Map(),_0x2633bc=new Map();recoverSegmentIdsFromPushRecovery(_0x5c6275,_0x19d3cd,_0x2dff10[_0xe6b2a6(0x12d)]);const _0x2581bb=new Map(),_0x56b054=new Map(),_0x52552c=new Map();let _0x1b715a;const _0xf5e21f=async()=>{const _0x2750ae=_0xe6b2a6;if(_0x1b715a)return;_0x1b715a=new Map();if(!_0x5c6275['existingJourney'])return;const _0x2af9b3=await _0x29e0b3[_0x2750ae(0x190)][_0x2750ae(0x1e4)](_0x5c6275[_0x2750ae(0x1da)]['id']);for(const _0x485e43 of _0x2af9b3){const _0x26094a=journeyActivationStepToYaml(_0x485e43,_0x2dff10[_0x2750ae(0x1a4)],_0x2dff10[_0x2750ae(0x178)]),_0x46a645=activationSignature(_0x26094a);!_0x1b715a[_0x2750ae(0x16c)](_0x46a645)&&_0x1b715a[_0x2750ae(0x17d)](_0x46a645,_0x485e43['id']),_0x26094a['name']&&_0x2633bc[_0x2750ae(0x17d)](_0x26094a[_0x2750ae(0x158)],_0x485e43['id']);}};await matchExistingJourneySegments(_0x29e0b3,_0x5c6275,_0x4c7e3d[_0xe6b2a6(0x143)],_0x2dff10['existingSegments'],_0x2dff10['segmentNameToId']);const _0xe3fe8a={'resolveSegmentId':async _0x11e421=>{const _0x4932c7=_0xe6b2a6,_0x5c6562=_0x2dff10[_0x4932c7(0x12d)][_0x4932c7(0x175)](_0x11e421);if(!_0x5c6562)throw new SDKError(ErrorCode[_0x4932c7(0x1b8)],_0x4932c7(0x1cb)+_0x11e421+_0x4932c7(0x20f)+_0x5c6275['yamlConfig'][_0x4932c7(0x158)]+')');return _0x5c6562;},'resolveEmbeddedSegmentId':async(_0xb728f1,_0x360386)=>{const _0x3cb88c=_0xe6b2a6,_0x269189=_0x2dff10[_0x3cb88c(0x12d)][_0x3cb88c(0x175)](_0xb728f1);if(_0x269189)return _0x269189;const _0x426e03=_0x2dff10[_0x3cb88c(0x1ba)][_0x3cb88c(0x17f)](_0x6778b1=>_0x6778b1['name']===_0xb728f1);if(_0x426e03)return _0x2dff10[_0x3cb88c(0x12d)][_0x3cb88c(0x17d)](_0xb728f1,_0x426e03['id']),_0x426e03['id'];if(_0x5c6275[_0x3cb88c(0x207)]){const {stageName:_0x110c5a,criteriaName:_0x39e9d9}=findSegmentCriteriaLocation(_0x5c6275['yamlConfig'],_0xb728f1);return _0x264c22(_0xb728f1,_0x360386[_0x3cb88c(0x1f2)]),_0x56b054['set'](_0xb728f1,{'definition':_0x360386,'stageName':_0x110c5a,'criteriaName':_0x39e9d9}),createPendingSegmentId(_0xb728f1);}const _0x31b922=_0x5c6275[_0x3cb88c(0x1da)]?.['id'];if(!_0x31b922)throw new SDKError(ErrorCode[_0x3cb88c(0x176)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x38ef5c=_0x2581bb['get'](_0xb728f1);if(_0x38ef5c)return _0x38ef5c;const _0x46d136=((async()=>{const _0x568c56=_0x3cb88c;_0x264c22(_0xb728f1,_0x360386['rule']);const _0x4923e0=generateDeterministicJourneySegmentName(_0x5c6275[_0x568c56(0x225)]['name'],_0xb728f1),_0x24bdbd=_0x2dff10[_0x568c56(0x1ba)][_0x568c56(0x17f)](_0xdb09ab=>_0xdb09ab[_0x568c56(0x158)]===_0x4923e0),_0x4e97b4=createSegmentIdResolver(_0x2dff10[_0x568c56(0x12d)],_0xb728f1),_0xfb32f6=await resolveRuleSegmentIds(_0x360386[_0x568c56(0x1f2)],_0x4e97b4);let _0x28288e;return _0x24bdbd?(await _0x29e0b3[_0x568c56(0x189)]['updateSegmentById'](_0x4c7e3d['parentId'],_0x24bdbd['id'],{'description':_0x360386[_0x568c56(0x1e1)]||_0x568c56(0x180)+_0xb728f1,'rule':_0xb48b9b(_0xfb32f6,!![]),'countPopulation':!![]}),_0x28288e=_0x24bdbd['id'],saveSegmentToPushRecovery(_0x5c6275[_0x568c56(0x149)],_0x5c6275['yamlConfig']['name'],_0xb728f1,{'segmentId':_0x28288e,'uniqueServerName':_0x4923e0,'createdAt':new Date()[_0x568c56(0x1b5)]()})):_0x28288e=await createOrRecoverEmbeddedSegment(_0x29e0b3,_0x5c6275,{'localName':_0xb728f1,'uniqueSegmentName':_0x4923e0,'description':_0x360386[_0x568c56(0x1e1)]||'Entry\x20criteria:\x20'+_0xb728f1,'journeyId':_0x31b922,'resolvedRule':_0xfb32f6,'parentId':_0x4c7e3d[_0x568c56(0x143)],'folderId':_0x4c7e3d[_0x568c56(0x1ff)]||''},_0xb48b9b),_0x2dff10[_0x568c56(0x12d)][_0x568c56(0x17d)](_0xb728f1,_0x28288e),_0x19d3cd[_0x568c56(0x17d)](_0xb728f1,_0x28288e),_0x28288e;})());_0x2581bb[_0x3cb88c(0x17d)](_0xb728f1,_0x46d136);try{return await _0x46d136;}finally{_0x2581bb[_0x3cb88c(0x223)](_0xb728f1);}},'resolveActivationId':async _0x5e75ad=>{const _0x434693=_0xe6b2a6,_0x2562b8=_0x2633bc[_0x434693(0x175)](_0x5e75ad);if(_0x2562b8)return _0x2562b8;if(_0x5c6275['existingJourney']){await _0xf5e21f();const _0xbec94=_0x2633bc[_0x434693(0x175)](_0x5e75ad);if(_0xbec94)return _0xbec94;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x434693(0x137)+_0x5e75ad+_0x434693(0x20f)+_0x5c6275[_0x434693(0x225)]['name']+').\x20'+_0x434693(0x195));},'resolveEmbeddedActivationId':async(_0x399d8f,_0x1485e8)=>{const _0x4723d4=_0xe6b2a6,_0x5db4ab=_0x2633bc[_0x4723d4(0x175)](_0x399d8f);if(_0x5db4ab)return _0x5db4ab;if(_0x5c6275[_0x4723d4(0x207)])return _0x52552c['set'](_0x399d8f,_0x1485e8),createPendingActivationId(_0x399d8f);if(_0x5c6275[_0x4723d4(0x1da)]){await _0xf5e21f();const _0x1b70d6=_0x2633bc[_0x4723d4(0x175)](_0x1485e8['name']);if(_0x1b70d6)return _0x2633bc[_0x4723d4(0x17d)](_0x399d8f,_0x1b70d6),_0x1b70d6;const _0xb2dd7f=activationSignature(_0x1485e8),_0x342abb=_0x1b715a?.['get'](_0xb2dd7f);if(_0x342abb)return _0x2633bc['set'](_0x399d8f,_0x342abb),_0x342abb;const _0x3621b5=await _0x40a594(_0x1485e8,_0x2dff10[_0x4723d4(0x1a8)]),_0x3d4b41={..._0x3621b5,..._0x1485e8[_0x4723d4(0x1b4)]!==undefined&&{'runAfterJourneyRefresh':_0x1485e8['run_after_journey_refresh']}},_0x32b020=await _0x29e0b3[_0x4723d4(0x190)]['createActivation'](_0x5c6275[_0x4723d4(0x1da)]['id'],_0x3d4b41);return _0x2633bc[_0x4723d4(0x17d)](_0x399d8f,_0x32b020['id']),_0x32b020['id'];}throw new SDKError(ErrorCode[_0x4723d4(0x176)],_0x4723d4(0x14c));},'resolveJourneyId':async _0x1abdd7=>{const _0x3b93ba=_0xe6b2a6;try{return await _0x29e0b3['journey'][_0x3b93ba(0x15d)](_0x4c7e3d[_0x3b93ba(0x143)],_0x1abdd7);}catch(_0x46d9c6){throw new SDKError(ErrorCode[_0x3b93ba(0x168)],_0x3b93ba(0x1c2)+_0x1abdd7+_0x3b93ba(0x1d7)+_0x5c6275[_0x3b93ba(0x225)][_0x3b93ba(0x158)]+'\x27)',_0x46d9c6);}},'resolveStageId':async(_0x206afa,_0x433f6f)=>{const _0x5237b6=_0xe6b2a6,_0x3b2014=await _0x29e0b3[_0x5237b6(0x190)][_0x5237b6(0x1d6)](_0x206afa),_0x90fcec=_0x3b2014[_0x5237b6(0x13c)]['journeyStages'][_0x5237b6(0x17f)](_0x3dd141=>_0x3dd141['name'][_0x5237b6(0x184)]()===_0x433f6f[_0x5237b6(0x184)]());if(!_0x90fcec?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x5237b6(0x21c)+_0x433f6f+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x3b2014[_0x5237b6(0x13c)][_0x5237b6(0x200)]||_0x3b2014['attributes'][_0x5237b6(0x158)])+'\x27');return _0x90fcec['id'];}},_0x32a6ae=await _0x4e02f1(_0x5c6275['yamlConfig'],_0x4c7e3d[_0xe6b2a6(0x143)],_0xe3fe8a),_0x208384=_0x4c7e3d[_0xe6b2a6(0x1e7)]||_0x4c7e3d['rootFolderId'];_0x208384&&(_0x32a6ae[_0xe6b2a6(0x1d9)]={'parentFolder':{'data':{'id':_0x208384,'type':_0xe6b2a6(0x16a)}}});if(_0x5c6275[_0xe6b2a6(0x207)]){if(_0x56b054[_0xe6b2a6(0x1dd)]>0x0||_0x52552c[_0xe6b2a6(0x1dd)]>0x0)return await executeThreeStepJourneyCreate(_0x29e0b3,_0x5c6275,_0x32a6ae,{'pendingEmbeddedSegments':_0x56b054,'pendingEmbeddedActivations':_0x52552c,'embeddedSegmentNameToId':_0x19d3cd,'journeyActivationNameToId':_0x2633bc},{..._0x4c7e3d,'effectiveFolderId':_0x208384},_0x2dff10,_0x364b85,_0x21707b);else{ensureJourneyDefaults(_0x32a6ae[_0xe6b2a6(0x13c)]);const _0x1a5919=await _0x29e0b3['journey'][_0xe6b2a6(0x1c3)](_0x32a6ae);return deletePushRecovery(_0x5c6275[_0xe6b2a6(0x149)]),{'action':_0xe6b2a6(0x1aa),'journeyId':_0x1a5919['id'],'embeddedSegmentNameToId':_0x19d3cd};}}else{if(_0x5c6275[_0xe6b2a6(0x1b7)]&&_0x5c6275['existingJourney'])return ensureJourneyDefaults(_0x32a6ae['attributes']),await _0x29e0b3[_0xe6b2a6(0x190)][_0xe6b2a6(0x1b2)](_0x5c6275[_0xe6b2a6(0x1da)]['id'],_0x32a6ae),deletePushRecovery(_0x5c6275[_0xe6b2a6(0x149)]),{'action':_0xe6b2a6(0x162),'journeyId':_0x5c6275[_0xe6b2a6(0x1da)]['id'],'embeddedSegmentNameToId':_0x19d3cd};}return deletePushRecovery(_0x5c6275['absolutePath']),{'action':_0xe6b2a6(0x215),'journeyId':_0x5c6275[_0xe6b2a6(0x1da)]?.['id'],'embeddedSegmentNameToId':_0x19d3cd};}function findSegmentCriteriaLocation(_0x30e540,_0x5a59e5){const _0x29423c=a114_0x3308e7,_0x3fa38b=_0x30e540[_0x29423c(0x1ef)]||_0x30e540[_0x29423c(0x134)]?.[0x0]?.['stages']||[];let _0x509c97=_0x29423c(0x1a6),_0x10545b=_0x5a59e5;const _0x18661d=_0x30e540[_0x29423c(0x191)]||_0x30e540['journeys']?.[0x0]?.[_0x29423c(0x191)];if(_0x18661d?.['segment']===_0x5a59e5)return{'stageName':_0x29423c(0x191),'criteriaName':_0x18661d['name']||_0x5a59e5};_0x510d28:for(const _0x352838 of _0x3fa38b){if(_0x352838[_0x29423c(0x188)]?.[_0x29423c(0x189)]===_0x5a59e5){_0x509c97=_0x352838[_0x29423c(0x158)],_0x10545b=_0x352838[_0x29423c(0x188)][_0x29423c(0x158)]||_0x5a59e5;break;}if(_0x352838[_0x29423c(0x1d5)])for(const _0x152abe of _0x352838[_0x29423c(0x1d5)]){if(_0x152abe[_0x29423c(0x177)]===_0x29423c(0x15f)&&_0x152abe[_0x29423c(0x185)]?.[_0x29423c(0x1a1)])for(const _0x57118d of _0x152abe[_0x29423c(0x185)][_0x29423c(0x1a1)]){if(_0x57118d[_0x29423c(0x189)]===_0x5a59e5){_0x509c97=_0x352838[_0x29423c(0x158)],_0x10545b=_0x57118d[_0x29423c(0x158)]||_0x5a59e5;break _0x510d28;}}}}return{'stageName':_0x509c97,'criteriaName':_0x10545b};}async function executeThreeStepJourneyCreate(_0x23b85f,_0x605912,_0x34422c,_0x45d735,_0x39aab3,_0xe74f35,_0x4546a2,_0x589abc){const _0x57b50c=a114_0x3308e7,{activationDefToCreateRequest:_0x13ec4f,yamlRuleToApi:_0x3d020f}=_0x589abc,{pendingEmbeddedSegments:_0x18cfa0,pendingEmbeddedActivations:_0x3c6175,embeddedSegmentNameToId:_0x50901f}=_0x45d735,_0x3e6e7f=JSON[_0x57b50c(0x1dc)](JSON[_0x57b50c(0x1d8)](_0x34422c));ensureJourneyDefaults(_0x3e6e7f['attributes']),stripPendingIds(_0x3e6e7f);const _0x2a7ad1=await _0x23b85f[_0x57b50c(0x190)]['create'](_0x3e6e7f),_0x5d60f1=_0x2a7ad1['id'],_0x15a867=new Map();for(const _0x28ed8d of _0x2a7ad1[_0x57b50c(0x13c)]['journeyStages']){_0x15a867[_0x57b50c(0x17d)](_0x28ed8d[_0x57b50c(0x158)][_0x57b50c(0x184)](),_0x28ed8d['id']);}recoverSegmentIdsFromPushRecovery(_0x605912,_0x50901f,_0xe74f35[_0x57b50c(0x12d)]);for(const [_0x62c6c8,{definition:_0x219de0}]of _0x18cfa0){if(_0x50901f[_0x57b50c(0x16c)](_0x62c6c8)){_0x4546a2[_0x57b50c(0x1fb)]?.({'type':_0x57b50c(0x1e8),'journeyName':_0x605912[_0x57b50c(0x225)][_0x57b50c(0x158)],'segmentName':_0x62c6c8});continue;}const _0x3cd601=generateDeterministicJourneySegmentName(_0x605912['yamlConfig'][_0x57b50c(0x158)],_0x62c6c8);_0x4546a2[_0x57b50c(0x1fb)]?.({'type':_0x57b50c(0x19f),'journeyName':_0x605912[_0x57b50c(0x225)]['name'],'segmentName':_0x62c6c8});const _0x2bf679=createSegmentIdResolver(_0xe74f35['segmentNameToId'],_0x62c6c8),_0x58e67e=await resolveRuleSegmentIds(_0x219de0[_0x57b50c(0x1f2)],_0x2bf679),_0x5f32a6=await createOrRecoverEmbeddedSegment(_0x23b85f,_0x605912,{'localName':_0x62c6c8,'uniqueSegmentName':_0x3cd601,'description':_0x219de0['description']||'Entry\x20criteria:\x20'+_0x62c6c8,'journeyId':_0x5d60f1,'resolvedRule':_0x58e67e,'parentId':_0x39aab3[_0x57b50c(0x143)],'folderId':_0x39aab3[_0x57b50c(0x210)]||''},_0x3d020f);_0x50901f['set'](_0x62c6c8,_0x5f32a6),_0xe74f35[_0x57b50c(0x12d)][_0x57b50c(0x17d)](_0x62c6c8,_0x5f32a6),_0x4546a2[_0x57b50c(0x1fb)]?.({'type':_0x57b50c(0x1e8),'journeyName':_0x605912[_0x57b50c(0x225)][_0x57b50c(0x158)],'segmentName':_0x62c6c8});}const _0x11d66f=new Map();for(const [_0x5a0cc0,_0x2b6c6b]of _0x3c6175){_0x4546a2[_0x57b50c(0x1fb)]?.({'type':_0x57b50c(0x201),'journeyName':_0x605912[_0x57b50c(0x225)]['name'],'activationName':_0x5a0cc0});const _0x32ceb3=await _0x13ec4f(_0x2b6c6b,_0xe74f35[_0x57b50c(0x1a8)]),_0x3ba3ca={..._0x32ceb3,..._0x2b6c6b[_0x57b50c(0x1b4)]!==undefined&&{'runAfterJourneyRefresh':_0x2b6c6b[_0x57b50c(0x1b4)]}},_0x20d5e3=await _0x23b85f[_0x57b50c(0x190)][_0x57b50c(0x157)](_0x5d60f1,_0x3ba3ca);_0x11d66f['set'](_0x5a0cc0,_0x20d5e3['id']),_0x45d735[_0x57b50c(0x1ea)][_0x57b50c(0x17d)](_0x5a0cc0,_0x20d5e3['id']),_0x4546a2[_0x57b50c(0x1fb)]?.({'type':_0x57b50c(0x141),'journeyName':_0x605912['yamlConfig'][_0x57b50c(0x158)],'activationName':_0x5a0cc0});}const _0x39bd07=JSON[_0x57b50c(0x1dc)](JSON['stringify'](_0x34422c));return _0x39bd07['id']=_0x5d60f1,ensureJourneyDefaults(_0x39bd07[_0x57b50c(0x13c)]),resolvePendingIdsInRequest(_0x39bd07,_0x34422c,_0x15a867,_0x50901f,_0x11d66f,_0x4546a2),await _0x23b85f['journey'][_0x57b50c(0x1b2)](_0x5d60f1,_0x39bd07),deletePushRecovery(_0x605912[_0x57b50c(0x149)]),{'action':_0x57b50c(0x1aa),'journeyId':_0x5d60f1,'embeddedSegmentNameToId':_0x50901f};}export function stripWaitStepPendingIds(_0x1be0bb){const _0x4cbe20=a114_0x3308e7,_0x240a52=_0x1be0bb[_0x4cbe20(0x153)]&&isPendingSegmentId(_0x1be0bb[_0x4cbe20(0x153)]),_0x25be0a=_0x1be0bb['conditions']?.[_0x4cbe20(0x131)](_0x527aa9=>_0x527aa9['segmentId']&&isPendingSegmentId(_0x527aa9[_0x4cbe20(0x138)]));(_0x240a52||_0x25be0a)&&(_0x1be0bb[_0x4cbe20(0x203)]=_0x4cbe20(0x14b),_0x1be0bb[_0x4cbe20(0x1f6)]=0x1,_0x1be0bb[_0x4cbe20(0x1f0)]=_0x4cbe20(0x19d),delete _0x1be0bb[_0x4cbe20(0x153)],delete _0x1be0bb['conditionTimeoutDuration'],delete _0x1be0bb[_0x4cbe20(0x1c1)],delete _0x1be0bb['conditions']);}export function resolveWaitStepPendingIds(_0x1e2a61,_0x1e6ecb,_0x50b9e4,_0x3cacdf){const _0x2c1e45=a114_0x3308e7;if(_0x1e6ecb[_0x2c1e45(0x153)]&&isPendingSegmentId(_0x1e6ecb[_0x2c1e45(0x153)])){const _0x2e54f1=_0x50b9e4(_0x1e6ecb[_0x2c1e45(0x153)],_0x2c1e45(0x198)+_0x3cacdf+_0x2c1e45(0x1c5));_0x2e54f1&&(_0x1e2a61[_0x2c1e45(0x203)]='Condition',_0x1e2a61[_0x2c1e45(0x153)]=_0x2e54f1,delete _0x1e2a61['waitStep'],delete _0x1e2a61['waitStepUnit'],_0x1e6ecb[_0x2c1e45(0x214)]!==undefined&&(_0x1e2a61['conditionTimeoutDuration']=_0x1e6ecb[_0x2c1e45(0x214)]),_0x1e6ecb[_0x2c1e45(0x1c1)]&&(_0x1e2a61[_0x2c1e45(0x1c1)]=_0x1e6ecb[_0x2c1e45(0x1c1)]));}if(_0x1e6ecb[_0x2c1e45(0x1df)]){const _0x1ff2d0=_0x1e6ecb[_0x2c1e45(0x1df)]['some'](_0x1bf708=>_0x1bf708[_0x2c1e45(0x138)]&&isPendingSegmentId(_0x1bf708[_0x2c1e45(0x138)]));if(_0x1ff2d0){const _0x2d6d23=_0x1e6ecb[_0x2c1e45(0x1df)][_0x2c1e45(0x224)](_0x38f06e=>{const _0x1cf009=_0x2c1e45;if(_0x38f06e[_0x1cf009(0x138)]&&isPendingSegmentId(_0x38f06e[_0x1cf009(0x138)])){const _0x14932b=_0x50b9e4(_0x38f06e[_0x1cf009(0x138)],_0x1cf009(0x198)+_0x3cacdf+_0x1cf009(0x1c5));return{..._0x38f06e,'segmentId':_0x14932b||_0x38f06e['segmentId']};}return{..._0x38f06e};});_0x1e2a61[_0x2c1e45(0x203)]=_0x2c1e45(0x1f1),_0x1e2a61['conditions']=_0x2d6d23,delete _0x1e2a61[_0x2c1e45(0x1f6)],delete _0x1e2a61[_0x2c1e45(0x1f0)],delete _0x1e2a61[_0x2c1e45(0x153)],delete _0x1e2a61['conditionTimeoutDuration'],delete _0x1e2a61[_0x2c1e45(0x1c1)];}}}function stripPendingIds(_0x383881){const _0x21eea2=a114_0x3308e7;_0x383881[_0x21eea2(0x13c)][_0x21eea2(0x191)]?.['segmentId']&&isPendingSegmentId(_0x383881[_0x21eea2(0x13c)][_0x21eea2(0x191)]['segmentId'])&&delete _0x383881['attributes'][_0x21eea2(0x191)];for(const _0x2c7425 of _0x383881[_0x21eea2(0x13c)]['journeyStages']||[]){_0x2c7425['entryCriteria']?.[_0x21eea2(0x138)]&&isPendingSegmentId(_0x2c7425[_0x21eea2(0x213)]['segmentId'])&&delete _0x2c7425[_0x21eea2(0x213)];_0x2c7425[_0x21eea2(0x221)]?.[_0x21eea2(0x138)]&&isPendingSegmentId(_0x2c7425[_0x21eea2(0x221)][_0x21eea2(0x138)])&&delete _0x2c7425[_0x21eea2(0x221)];_0x2c7425[_0x21eea2(0x14d)]&&(_0x2c7425[_0x21eea2(0x14d)]=_0x2c7425['exitCriterias'][_0x21eea2(0x1bd)](_0x5a7887=>!_0x5a7887[_0x21eea2(0x138)]||!isPendingSegmentId(_0x5a7887['segmentId'])));if(_0x2c7425[_0x21eea2(0x1d5)])for(const _0x309b19 of Object[_0x21eea2(0x150)](_0x2c7425[_0x21eea2(0x1d5)])){const _0x3daa84=_0x2c7425['steps'][_0x309b19];_0x3daa84[_0x21eea2(0x177)]==='Activation'&&_0x3daa84[_0x21eea2(0x218)]&&isPendingActivationId(_0x3daa84[_0x21eea2(0x218)])&&(_0x3daa84[_0x21eea2(0x218)]='');if(_0x3daa84['type']===_0x21eea2(0x1f8)&&_0x3daa84[_0x21eea2(0x1a1)])for(const _0x5ab954 of _0x3daa84[_0x21eea2(0x1a1)]){_0x5ab954[_0x21eea2(0x138)]&&isPendingSegmentId(_0x5ab954[_0x21eea2(0x138)])&&(_0x5ab954[_0x21eea2(0x138)]='');}_0x3daa84[_0x21eea2(0x177)]===_0x21eea2(0x21f)&&stripWaitStepPendingIds(_0x3daa84);}}}function resolvePendingIdsInRequest(_0x3bb719,_0x5def8a,_0x1a5121,_0x800411,_0x59b6e9,_0x1f04ae){const _0x39b7a8=a114_0x3308e7,_0x1d1279=(_0xcf11d5,_0x484afa)=>{const _0x482b29=a114_0x3638;if(!isPendingSegmentId(_0xcf11d5))return _0xcf11d5;const _0x558b89=extractPendingSegmentName(_0xcf11d5),_0x326461=_0x800411[_0x482b29(0x175)](_0x558b89);return!_0x326461&&_0x1f04ae['logWarning']?.(_0x482b29(0x151)+_0x558b89+'\x27\x20for\x20'+_0x484afa),_0x326461;};if(_0x3bb719[_0x39b7a8(0x13c)][_0x39b7a8(0x191)]?.[_0x39b7a8(0x138)]&&isPendingSegmentId(_0x3bb719['attributes'][_0x39b7a8(0x191)]['segmentId'])){const _0x4f3916=_0x1d1279(_0x3bb719['attributes']['goal'][_0x39b7a8(0x138)],'goal\x20criteria');_0x4f3916&&(_0x3bb719[_0x39b7a8(0x13c)]['goal']['segmentId']=_0x4f3916);}for(const _0x4a2ad3 of _0x3bb719[_0x39b7a8(0x13c)]['journeyStages']||[]){const _0x351707=_0x1a5121['get'](_0x4a2ad3[_0x39b7a8(0x158)]['toLowerCase']());_0x351707&&(_0x4a2ad3['id']=_0x351707);if(_0x4a2ad3['entryCriteria']?.[_0x39b7a8(0x138)]&&isPendingSegmentId(_0x4a2ad3[_0x39b7a8(0x213)][_0x39b7a8(0x138)])){const _0x5e799a=_0x1d1279(_0x4a2ad3[_0x39b7a8(0x213)][_0x39b7a8(0x138)],'stage\x20\x27'+_0x4a2ad3['name']+_0x39b7a8(0x18c));_0x5e799a&&(_0x4a2ad3[_0x39b7a8(0x213)][_0x39b7a8(0x138)]=_0x5e799a);}if(_0x4a2ad3[_0x39b7a8(0x14d)])for(const _0x44bd39 of _0x4a2ad3[_0x39b7a8(0x14d)]){if(_0x44bd39[_0x39b7a8(0x138)]&&isPendingSegmentId(_0x44bd39[_0x39b7a8(0x138)])){const _0x7d1112=_0x1d1279(_0x44bd39['segmentId'],'stage\x20\x27'+_0x4a2ad3[_0x39b7a8(0x158)]+_0x39b7a8(0x211));_0x7d1112&&(_0x44bd39['segmentId']=_0x7d1112);}}if(_0x4a2ad3['milestone']?.[_0x39b7a8(0x138)]&&isPendingSegmentId(_0x4a2ad3['milestone']['segmentId'])){const _0x494d65=_0x1d1279(_0x4a2ad3[_0x39b7a8(0x221)][_0x39b7a8(0x138)],_0x39b7a8(0x198)+_0x4a2ad3[_0x39b7a8(0x158)]+_0x39b7a8(0x1e3));_0x494d65&&(_0x4a2ad3[_0x39b7a8(0x221)][_0x39b7a8(0x138)]=_0x494d65);}if(_0x4a2ad3[_0x39b7a8(0x1d5)]){const _0x58165e=_0x5c2b6b=>_0x5def8a[_0x39b7a8(0x13c)]['journeyStages']?.[_0x39b7a8(0x17f)](_0x6644cd=>_0x6644cd[_0x39b7a8(0x158)][_0x39b7a8(0x184)]()===_0x4a2ad3[_0x39b7a8(0x158)]['toLowerCase']())?.[_0x39b7a8(0x1d5)]?.[_0x5c2b6b];for(const _0x212561 of Object[_0x39b7a8(0x150)](_0x4a2ad3[_0x39b7a8(0x1d5)])){const _0x24b91f=_0x4a2ad3['steps'][_0x212561],_0x2b0b0f=_0x58165e(_0x212561);if(_0x24b91f[_0x39b7a8(0x177)]===_0x39b7a8(0x169)&&_0x24b91f[_0x39b7a8(0x218)]&&(isPendingActivationId(_0x24b91f[_0x39b7a8(0x218)])||_0x24b91f['journeyActivationStepId']==='')){if(_0x2b0b0f?.[_0x39b7a8(0x218)]&&isPendingActivationId(_0x2b0b0f[_0x39b7a8(0x218)])){const _0x52fc86=extractPendingActivationName(_0x2b0b0f[_0x39b7a8(0x218)]),_0x113d2c=_0x59b6e9[_0x39b7a8(0x175)](_0x52fc86);_0x113d2c&&(_0x24b91f[_0x39b7a8(0x218)]=_0x113d2c);}}if(_0x24b91f[_0x39b7a8(0x177)]===_0x39b7a8(0x1f8)&&_0x24b91f[_0x39b7a8(0x1a1)]&&_0x2b0b0f?.[_0x39b7a8(0x1a1)])for(let _0x1333c8=0x0;_0x1333c8<_0x24b91f['branches'][_0x39b7a8(0x1c9)];_0x1333c8++){const _0x4016e0=_0x24b91f[_0x39b7a8(0x1a1)][_0x1333c8],_0x40ae74=_0x2b0b0f[_0x39b7a8(0x1a1)][_0x1333c8];if(_0x40ae74?.[_0x39b7a8(0x138)]&&isPendingSegmentId(_0x40ae74[_0x39b7a8(0x138)])){const _0x397c67=_0x1d1279(_0x40ae74[_0x39b7a8(0x138)],_0x39b7a8(0x198)+_0x4a2ad3[_0x39b7a8(0x158)]+_0x39b7a8(0x1f7)+(_0x4016e0[_0x39b7a8(0x158)]||_0x1333c8)+'\x27');_0x397c67&&(_0x4016e0[_0x39b7a8(0x138)]=_0x397c67);}}_0x24b91f[_0x39b7a8(0x177)]===_0x39b7a8(0x21f)&&_0x2b0b0f?.[_0x39b7a8(0x177)]===_0x39b7a8(0x21f)&&resolveWaitStepPendingIds(_0x24b91f,_0x2b0b0f,_0x1d1279,_0x4a2ad3['name']);}}}}
@@ -1 +1 @@
1
- function a115_0x2696(){const _0x509b5b=['147229SUgyiv','209250IfvIkS','3gDUvlY','206084cHVxYC','35AoOTiI','976462kLznaa','name','1624959wnyRgr','104WkcayF','set','get','8092220RNoBMf','1012896BJLwxU','has','parentFolderId'];a115_0x2696=function(){return _0x509b5b;};return a115_0x2696();}(function(_0x5864a2,_0x29199d){const _0x2e62a2=a115_0x23e6,_0x1a26bf=_0x5864a2();while(!![]){try{const _0x10242d=-parseInt(_0x2e62a2(0x170))/0x1+parseInt(_0x2e62a2(0x175))/0x2*(-parseInt(_0x2e62a2(0x172))/0x3)+parseInt(_0x2e62a2(0x173))/0x4*(parseInt(_0x2e62a2(0x174))/0x5)+-parseInt(_0x2e62a2(0x16d))/0x6+parseInt(_0x2e62a2(0x177))/0x7+-parseInt(_0x2e62a2(0x169))/0x8*(parseInt(_0x2e62a2(0x171))/0x9)+parseInt(_0x2e62a2(0x16c))/0xa;if(_0x10242d===_0x29199d)break;else _0x1a26bf['push'](_0x1a26bf['shift']());}catch(_0x2407de){_0x1a26bf['push'](_0x1a26bf['shift']());}}}(a115_0x2696,0x48238));export function buildFolderIdToPathMap(_0xb87f7e){const _0x4e77c2=new Map(),_0x2a829c=new Map();for(const _0x376dd2 of _0xb87f7e){_0x2a829c['set'](_0x376dd2['id'],_0x376dd2);}const _0x59658f=new Set();for(const _0x2c7525 of _0xb87f7e){!_0x2c7525['parentFolderId']&&_0x59658f['add'](_0x2c7525['id']);}function _0x464e68(_0x32fe2e){const _0xc24b2e=a115_0x23e6;if(_0x4e77c2[_0xc24b2e(0x16e)](_0x32fe2e['id']))return _0x4e77c2['get'](_0x32fe2e['id']);if(_0x59658f['has'](_0x32fe2e['id']))return _0x4e77c2[_0xc24b2e(0x16a)](_0x32fe2e['id'],''),'';if(_0x32fe2e[_0xc24b2e(0x16f)]){const _0x42ad9d=_0x2a829c[_0xc24b2e(0x16b)](_0x32fe2e[_0xc24b2e(0x16f)]);if(_0x42ad9d){const _0x570a25=_0x464e68(_0x42ad9d),_0x15ab5f=_0x570a25?_0x570a25+'/'+_0x32fe2e[_0xc24b2e(0x176)]:_0x32fe2e['name'];return _0x4e77c2['set'](_0x32fe2e['id'],_0x15ab5f),_0x15ab5f;}}const _0x21f5b2=_0x32fe2e['name'];return _0x4e77c2[_0xc24b2e(0x16a)](_0x32fe2e['id'],_0x21f5b2),_0x21f5b2;}for(const _0x570949 of _0xb87f7e){_0x464e68(_0x570949);}return _0x4e77c2;}export function buildFolderPathToIdMap(_0x4e347b){const _0x4eb678=a115_0x23e6,_0x2a4c03=new Map(),_0x24fe5c=new Map();for(const _0x21d0cd of _0x4e347b){_0x24fe5c[_0x4eb678(0x16a)](_0x21d0cd['id'],_0x21d0cd);}const _0x4e1805=new Set();for(const _0x4a79df of _0x4e347b){!_0x4a79df['parentFolderId']&&_0x4e1805['add'](_0x4a79df['id']);}function _0x4ba1e0(_0x26d129){const _0x5ec796=_0x4eb678;if(_0x4e1805[_0x5ec796(0x16e)](_0x26d129['id']))return'';if(_0x26d129[_0x5ec796(0x16f)]){const _0x2ae236=_0x24fe5c[_0x5ec796(0x16b)](_0x26d129[_0x5ec796(0x16f)]);if(_0x2ae236){const _0x3080ab=_0x4ba1e0(_0x2ae236);return _0x3080ab?_0x3080ab+'/'+_0x26d129[_0x5ec796(0x176)]:_0x26d129[_0x5ec796(0x176)];}}return _0x26d129[_0x5ec796(0x176)];}for(const _0x99bd36 of _0x4e347b){const _0x1e5b4d=_0x4ba1e0(_0x99bd36);_0x2a4c03[_0x4eb678(0x16a)](_0x1e5b4d,_0x99bd36['id']);}return _0x2a4c03;}export function buildFolderMaps(_0x13fa9f){const _0x55bd02=a115_0x23e6,_0x58c6e0=buildFolderIdToPathMap(_0x13fa9f),_0x58fccd=new Map();for(const [_0xbdcc20,_0x1e6013]of _0x58c6e0){_0x58fccd[_0x55bd02(0x16a)](_0x1e6013,_0xbdcc20);}return{'idToPath':_0x58c6e0,'pathToId':_0x58fccd};}function a115_0x23e6(_0x52b913,_0x425d5b){_0x52b913=_0x52b913-0x169;const _0x2696f4=a115_0x2696();let _0x23e60b=_0x2696f4[_0x52b913];return _0x23e60b;}export function getFolderPath(_0x313324,_0xac7703){const _0x5f16ba=a115_0x23e6;if(!_0x313324)return'';return _0xac7703[_0x5f16ba(0x16b)](_0x313324)??'';}
1
+ function a115_0x13b2(_0x259028,_0x4329b4){_0x259028=_0x259028-0x19e;const _0x48200a=a115_0x4820();let _0x13b209=_0x48200a[_0x259028];return _0x13b209;}(function(_0x165d7e,_0x172839){const _0x19cbc9=a115_0x13b2,_0x1a1e7a=_0x165d7e();while(!![]){try{const _0x2f0e75=parseInt(_0x19cbc9(0x1a4))/0x1*(parseInt(_0x19cbc9(0x1a3))/0x2)+-parseInt(_0x19cbc9(0x19f))/0x3+parseInt(_0x19cbc9(0x1a1))/0x4*(-parseInt(_0x19cbc9(0x1a0))/0x5)+parseInt(_0x19cbc9(0x1a5))/0x6+-parseInt(_0x19cbc9(0x1ae))/0x7*(-parseInt(_0x19cbc9(0x19e))/0x8)+-parseInt(_0x19cbc9(0x1ad))/0x9*(parseInt(_0x19cbc9(0x1a9))/0xa)+-parseInt(_0x19cbc9(0x1a8))/0xb;if(_0x2f0e75===_0x172839)break;else _0x1a1e7a['push'](_0x1a1e7a['shift']());}catch(_0x134187){_0x1a1e7a['push'](_0x1a1e7a['shift']());}}}(a115_0x4820,0xdea9c));export function buildFolderIdToPathMap(_0x7d4eef){const _0x58360f=a115_0x13b2,_0x16ac8d=new Map(),_0x1195b5=new Map();for(const _0x1af984 of _0x7d4eef){_0x1195b5[_0x58360f(0x1a6)](_0x1af984['id'],_0x1af984);}const _0x7e5864=new Set();for(const _0x1feb9a of _0x7d4eef){!_0x1feb9a['parentFolderId']&&_0x7e5864[_0x58360f(0x1ac)](_0x1feb9a['id']);}function _0x3c49ad(_0x1f55f8){const _0x19d50e=_0x58360f;if(_0x16ac8d[_0x19d50e(0x1aa)](_0x1f55f8['id']))return _0x16ac8d[_0x19d50e(0x1ab)](_0x1f55f8['id']);if(_0x7e5864['has'](_0x1f55f8['id']))return _0x16ac8d['set'](_0x1f55f8['id'],''),'';if(_0x1f55f8[_0x19d50e(0x1a7)]){const _0x37dc3b=_0x1195b5[_0x19d50e(0x1ab)](_0x1f55f8['parentFolderId']);if(_0x37dc3b){const _0x1e7903=_0x3c49ad(_0x37dc3b),_0xc10f44=_0x1e7903?_0x1e7903+'/'+_0x1f55f8[_0x19d50e(0x1a2)]:_0x1f55f8[_0x19d50e(0x1a2)];return _0x16ac8d[_0x19d50e(0x1a6)](_0x1f55f8['id'],_0xc10f44),_0xc10f44;}}const _0xed710a=_0x1f55f8[_0x19d50e(0x1a2)];return _0x16ac8d[_0x19d50e(0x1a6)](_0x1f55f8['id'],_0xed710a),_0xed710a;}for(const _0x38da49 of _0x7d4eef){_0x3c49ad(_0x38da49);}return _0x16ac8d;}export function buildFolderPathToIdMap(_0x5d3df0){const _0x2ff449=a115_0x13b2,_0x1c3e5b=new Map(),_0x15afbe=new Map();for(const _0x224cd5 of _0x5d3df0){_0x15afbe[_0x2ff449(0x1a6)](_0x224cd5['id'],_0x224cd5);}const _0x38fa9f=new Set();for(const _0x73b48b of _0x5d3df0){!_0x73b48b[_0x2ff449(0x1a7)]&&_0x38fa9f[_0x2ff449(0x1ac)](_0x73b48b['id']);}function _0x359e20(_0x1b785b){const _0x14832e=_0x2ff449;if(_0x38fa9f[_0x14832e(0x1aa)](_0x1b785b['id']))return'';if(_0x1b785b['parentFolderId']){const _0x272a6e=_0x15afbe[_0x14832e(0x1ab)](_0x1b785b[_0x14832e(0x1a7)]);if(_0x272a6e){const _0x4312f4=_0x359e20(_0x272a6e);return _0x4312f4?_0x4312f4+'/'+_0x1b785b[_0x14832e(0x1a2)]:_0x1b785b['name'];}}return _0x1b785b[_0x14832e(0x1a2)];}for(const _0x491b48 of _0x5d3df0){const _0x4ec778=_0x359e20(_0x491b48);_0x1c3e5b[_0x2ff449(0x1a6)](_0x4ec778,_0x491b48['id']);}return _0x1c3e5b;}function a115_0x4820(){const _0x2f5b41=['63zkUJYH','343QmuBzl','274048NrcpsT','2528820ybWzHW','4035QMoyCD','5052RSkeCG','name','286690cQhmNk','9zYdxfF','10662606mNxGsL','set','parentFolderId','21174285DWChqg','66580raacMM','has','get','add'];a115_0x4820=function(){return _0x2f5b41;};return a115_0x4820();}export function buildFolderMaps(_0x489d86){const _0x41a532=a115_0x13b2,_0x289ab5=buildFolderIdToPathMap(_0x489d86),_0x53aa06=new Map();for(const [_0x1f7129,_0x5a9339]of _0x289ab5){_0x53aa06[_0x41a532(0x1a6)](_0x5a9339,_0x1f7129);}return{'idToPath':_0x289ab5,'pathToId':_0x53aa06};}export function getFolderPath(_0x46b8a4,_0x3eec6d){if(!_0x46b8a4)return'';return _0x3eec6d['get'](_0x46b8a4)??'';}
@@ -1 +1 @@
1
- (function(_0x2f8ea7,_0x63f180){const _0x5895ad=a116_0x32da,_0x12b381=_0x2f8ea7();while(!![]){try{const _0x45f95b=parseInt(_0x5895ad(0x110))/0x1+-parseInt(_0x5895ad(0x102))/0x2*(-parseInt(_0x5895ad(0x10e))/0x3)+parseInt(_0x5895ad(0xf6))/0x4*(-parseInt(_0x5895ad(0xed))/0x5)+parseInt(_0x5895ad(0x117))/0x6+-parseInt(_0x5895ad(0x10c))/0x7+-parseInt(_0x5895ad(0x118))/0x8+parseInt(_0x5895ad(0x108))/0x9;if(_0x45f95b===_0x63f180)break;else _0x12b381['push'](_0x12b381['shift']());}catch(_0x20f897){_0x12b381['push'](_0x12b381['shift']());}}}(a116_0x2fdb,0x5c08c));import a116_0x5f5abb from'path';import{parse as a116_0x45a917}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a116_0x32da(_0x2a75a2,_0x200711){_0x2a75a2=_0x2a75a2-0xea;const _0x2fdbcc=a116_0x2fdb();let _0x32dab3=_0x2fdbcc[_0x2a75a2];return _0x32dab3;}export function parsePath(_0x4d27f3){const _0x467098=a116_0x32da;if(!_0x4d27f3||_0x4d27f3[_0x467098(0x111)]()==='')throw new Error(_0x467098(0x112));const _0x5ccfb1=_0x4d27f3[_0x467098(0x111)]();if(_0x5ccfb1==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x4d27f3};const _0x2ef351=_0x5ccfb1['startsWith']('/')?_0x5ccfb1[_0x467098(0x114)](0x1):_0x5ccfb1,_0x57d49f=_0x2ef351['split']('/')[_0x467098(0xfd)](_0x5c5199=>_0x5c5199!=='');if(_0x57d49f['length']===0x0)throw new Error(_0x467098(0xff));const _0x593904=_0x5ccfb1[_0x467098(0x107)]('/')||!isRelativePathSegment(_0x57d49f[0x0]);for(const _0x108aac of _0x57d49f){validatePathSegment(_0x108aac);}return{'segments':_0x57d49f,'isAbsolute':_0x593904,'raw':_0x4d27f3};}function isRelativePathSegment(_0xefc31f){return _0xefc31f==='.'||_0xefc31f==='..';}function validatePathSegment(_0x4c6ba7){const _0x24e23c=a116_0x32da;if(_0x4c6ba7==='')throw new Error(_0x24e23c(0x10f));if(_0x4c6ba7==='.'||_0x4c6ba7==='..')return;if(/[\x00-\x1F\x7F]/[_0x24e23c(0xf8)](_0x4c6ba7))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x4c6ba7);if(_0x4c6ba7!==_0x4c6ba7['trim']()){}}export function validatePath(_0xf8bfc1){const _0x5ef2be=a116_0x32da;if(_0xf8bfc1[_0x5ef2be(0xf4)]['length']===0x0&&!_0xf8bfc1[_0x5ef2be(0x106)])throw new Error(_0x5ef2be(0x104));if(_0xf8bfc1[_0x5ef2be(0x106)]){if(_0xf8bfc1['segments'][0x0]==='..')throw new Error(_0x5ef2be(0x103));let _0x36b71f=0x0;for(const _0x49a672 of _0xf8bfc1[_0x5ef2be(0xf4)]){if(_0x49a672==='..'){if(_0x36b71f===0x0)throw new Error(_0x5ef2be(0xfe));_0x36b71f--;}else _0x49a672!=='.'&&_0x36b71f++;}}}export function joinPaths(_0x383900,_0x136a33){const _0xd5d6be=a116_0x32da;if(!_0x383900||_0x383900==='/')return _0x136a33;if(!_0x136a33||_0x136a33==='.')return _0x383900;if(_0x136a33['startsWith']('/'))return _0x136a33;const _0x2aa1cc=parsePath(_0x383900),_0x1f2f31=parsePath(_0x136a33),_0x59bed2=[..._0x2aa1cc[_0xd5d6be(0xf4)]];for(const _0x2ccf7c of _0x1f2f31[_0xd5d6be(0xf4)]){if(_0x2ccf7c==='.')continue;else{if(_0x2ccf7c==='..'){if(_0x59bed2[_0xd5d6be(0x116)]===0x0)throw new Error(_0xd5d6be(0xf3));_0x59bed2[_0xd5d6be(0xfa)]();}else _0x59bed2[_0xd5d6be(0x101)](_0x2ccf7c);}}const _0x21e6da=_0x59bed2['join']('/');return _0x2aa1cc[_0xd5d6be(0xf9)]['startsWith']('/')?'/'+_0x21e6da:_0x21e6da;}export function normalizePath(_0x3cf319){const _0x62b6c7=a116_0x32da,_0x33d4c3=parsePath(_0x3cf319),_0x37f145=[];for(const _0x2cee52 of _0x33d4c3[_0x62b6c7(0xf4)]){if(_0x2cee52==='.')continue;else{if(_0x2cee52==='..'){if(_0x37f145[_0x62b6c7(0x116)]===0x0){if(_0x33d4c3[_0x62b6c7(0x106)])throw new Error(_0x62b6c7(0xf3));_0x37f145['push']('..');}else _0x37f145[_0x37f145['length']-0x1]==='..'?_0x37f145[_0x62b6c7(0x101)]('..'):_0x37f145[_0x62b6c7(0xfa)]();}else _0x37f145[_0x62b6c7(0x101)](_0x2cee52);}}if(_0x37f145[_0x62b6c7(0x116)]===0x0)return _0x33d4c3[_0x62b6c7(0x106)]?'/':'.';const _0x537f04=_0x37f145['join']('/');return _0x33d4c3[_0x62b6c7(0xf9)][_0x62b6c7(0x107)]('/')?'/'+_0x537f04:_0x537f04;}export function getParentPath(_0x50745b){const _0x92c851=a116_0x32da,_0x3eccfa=parsePath(_0x50745b);if(_0x3eccfa['segments'][_0x92c851(0x116)]<=0x1)return'/';const _0x13d2bd=_0x3eccfa[_0x92c851(0xf4)][_0x92c851(0x10d)](0x0,-0x1)[_0x92c851(0xeb)]('/');return _0x3eccfa[_0x92c851(0xf9)][_0x92c851(0x107)]('/')?'/'+_0x13d2bd:_0x13d2bd;}export function getBaseName(_0x213042){const _0x5bc51c=a116_0x32da,_0x5411c4=parsePath(_0x213042);return _0x5411c4[_0x5bc51c(0xf4)][_0x5411c4[_0x5bc51c(0xf4)][_0x5bc51c(0x116)]-0x1]||'';}export function isChildPath(_0x5136ce,_0x2e4812){const _0x54e058=a116_0x32da,_0x1b0b35=parsePath(_0x5136ce),_0x1ad73e=parsePath(_0x2e4812);if(_0x1b0b35[_0x54e058(0xf4)]['length']<=_0x1ad73e[_0x54e058(0xf4)][_0x54e058(0x116)])return![];for(let _0x532773=0x0;_0x532773<_0x1ad73e[_0x54e058(0xf4)][_0x54e058(0x116)];_0x532773++){if(_0x1b0b35[_0x54e058(0xf4)][_0x532773]!==_0x1ad73e['segments'][_0x532773])return![];}return!![];}export function splitPath(_0x5df25d){const _0x1015d9=a116_0x32da,_0x2b9697=parsePath(_0x5df25d);if(_0x2b9697['segments']['length']===0x0)throw new Error(_0x1015d9(0x10a));if(_0x2b9697[_0x1015d9(0xf4)][_0x1015d9(0x116)]===0x1)return{'parent':_0x2b9697[_0x1015d9(0xf4)][0x0]};return{'parent':_0x2b9697[_0x1015d9(0xf4)][0x0],'child':_0x2b9697[_0x1015d9(0xf4)][_0x1015d9(0x10d)](0x1)[_0x1015d9(0xeb)]('/')};}function a116_0x2fdb(){const _0x4e6f71=['Path\x20must\x20contain\x20at\x20least\x20one\x20segment','exists','push','17330nfSIQW','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Relative\x20path\x20cannot\x20be\x20empty','relative','isAbsolute','startsWith','2145438GDQPAj','type','Cannot\x20split\x20empty\x20path','parent_segment','3829924KLuAfV','slice','57ZDbbvb','Path\x20segment\x20cannot\x20be\x20empty','431623GBtyXw','trim','Path\x20cannot\x20be\x20empty','root','substring','No\x20tdx.json\x20found\x20for\x20file:\x20','length','3086724NBYwaW','2629488kFYRZU','name','join','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','20gJqBXv','.yml','.yaml','endsWith','File\x20not\x20found:\x20','dirname','Cannot\x20navigate\x20above\x20root','segments','readFile','96304hoqPPE','parse','test','raw','pop','journey','segment','filter','Path\x20attempts\x20to\x20navigate\x20above\x20root'];a116_0x2fdb=function(){return _0x4e6f71;};return a116_0x2fdb();}export function isYamlFilePath(_0x2612cd){const _0x44f5d0=a116_0x32da;return _0x2612cd['endsWith'](_0x44f5d0(0xee))||_0x2612cd[_0x44f5d0(0xf0)](_0x44f5d0(0xef));}export async function resolveYamlFilePath(_0xca3539,_0x48c9df=nodeFileSystem){const _0x32018d=a116_0x32da,_0x3c2984=a116_0x5f5abb['resolve'](_0xca3539);if(!await _0x48c9df[_0x32018d(0x100)](_0x3c2984))throw new Error(_0x32018d(0xf1)+_0xca3539);let _0x5f0d1f=a116_0x5f5abb[_0x32018d(0xf2)](_0x3c2984),_0x40c88b=null,_0x25e689=null;const _0x2f073c=a116_0x5f5abb['parse'](_0x5f0d1f)[_0x32018d(0x113)];while(_0x5f0d1f!==_0x2f073c){const _0x3979ca=a116_0x5f5abb[_0x32018d(0xeb)](_0x5f0d1f,'tdx.json');if(await _0x48c9df[_0x32018d(0x100)](_0x3979ca)){_0x40c88b=_0x3979ca,_0x25e689=_0x5f0d1f;break;}_0x5f0d1f=a116_0x5f5abb['dirname'](_0x5f0d1f);}if(!_0x40c88b||!_0x25e689)throw new Error(_0x32018d(0x115)+_0xca3539);const _0x4b4a18=await _0x48c9df['readFile'](_0x40c88b),_0x161359=JSON[_0x32018d(0xf7)](_0x4b4a18),_0x545172=_0x161359[_0x32018d(0x10b)];if(!_0x545172)throw new Error(_0x32018d(0xec));const _0xe80002=await _0x48c9df[_0x32018d(0xf5)](_0x3c2984),_0x18b389=a116_0x45a917(_0xe80002),_0x2cba28=_0x18b389[_0x32018d(0xea)];if(!_0x2cba28)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0xca3539);const _0x3ea79a=_0x18b389[_0x32018d(0x109)]===_0x32018d(0xfb)?_0x32018d(0xfb):_0x32018d(0xfc),_0xc6179e=a116_0x5f5abb[_0x32018d(0x105)](_0x25e689,_0x3c2984),_0x18551d=a116_0x5f5abb[_0x32018d(0xf2)](_0xc6179e),_0x16dd8b=_0x18551d==='.'?'':_0x18551d['replace'](/\\/g,'/'),_0x1af4ae=_0x16dd8b?_0x545172+'/'+_0x16dd8b+'/'+_0x2cba28:_0x545172+'/'+_0x2cba28;return{'parentSegment':_0x545172,'segmentName':_0x2cba28,'folderPath':_0x16dd8b,'fullPath':_0x1af4ae,'resourceType':_0x3ea79a};}
1
+ (function(_0x2a19b5,_0x546ee5){const _0x818ed6=a116_0x21c6,_0x125a41=_0x2a19b5();while(!![]){try{const _0x162f01=parseInt(_0x818ed6(0x204))/0x1*(-parseInt(_0x818ed6(0x1ff))/0x2)+parseInt(_0x818ed6(0x1ea))/0x3+parseInt(_0x818ed6(0x1f2))/0x4+-parseInt(_0x818ed6(0x1e5))/0x5*(-parseInt(_0x818ed6(0x1e4))/0x6)+parseInt(_0x818ed6(0x1ed))/0x7*(-parseInt(_0x818ed6(0x1de))/0x8)+-parseInt(_0x818ed6(0x1ee))/0x9*(parseInt(_0x818ed6(0x1dc))/0xa)+parseInt(_0x818ed6(0x203))/0xb*(parseInt(_0x818ed6(0x1f5))/0xc);if(_0x162f01===_0x546ee5)break;else _0x125a41['push'](_0x125a41['shift']());}catch(_0x512262){_0x125a41['push'](_0x125a41['shift']());}}}(a116_0x31e8,0xb8edb));import a116_0x383329 from'path';function a116_0x21c6(_0x25cd9d,_0x55367f){_0x25cd9d=_0x25cd9d-0x1d6;const _0x31e82c=a116_0x31e8();let _0x21c615=_0x31e82c[_0x25cd9d];return _0x21c615;}import{parse as a116_0x4ce121}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a116_0x31e8(){const _0x35f875=['resolve','9759505DeODgf','45mpJzjc','.yml','name','No\x20tdx.json\x20found\x20for\x20file:\x20','425944BdJURw','readFile','startsWith','3936552XlwQsQ','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Cannot\x20split\x20empty\x20path','File\x20not\x20found:\x20','parse','test','segments','exists','join','endsWith','49718BqqkUx','Path\x20segment\x20cannot\x20be\x20empty','.yaml','Cannot\x20navigate\x20above\x20root','77ZIOsNH','41CFktyC','length','parent_segment','replace','isAbsolute','journey','slice','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','1419990tfUuWq','Relative\x20path\x20cannot\x20be\x20empty','8RaBVfo','push','trim','dirname','pop','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','883332ENNbev','5CDqQzw','filter','Path\x20cannot\x20be\x20empty','raw','split','3992598UPveZq','relative'];a116_0x31e8=function(){return _0x35f875;};return a116_0x31e8();}export function parsePath(_0x25adc8){const _0xb7a358=a116_0x21c6;if(!_0x25adc8||_0x25adc8['trim']()==='')throw new Error(_0xb7a358(0x1e7));const _0x39718d=_0x25adc8['trim']();if(_0x39718d==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x25adc8};const _0x726618=_0x39718d[_0xb7a358(0x1f4)]('/')?_0x39718d['substring'](0x1):_0x39718d,_0x19772e=_0x726618[_0xb7a358(0x1e9)]('/')[_0xb7a358(0x1e6)](_0x26b962=>_0x26b962!=='');if(_0x19772e[_0xb7a358(0x205)]===0x0)throw new Error(_0xb7a358(0x1db));const _0x1f6bcb=_0x39718d[_0xb7a358(0x1f4)]('/')||!isRelativePathSegment(_0x19772e[0x0]);for(const _0x5d42b5 of _0x19772e){validatePathSegment(_0x5d42b5);}return{'segments':_0x19772e,'isAbsolute':_0x1f6bcb,'raw':_0x25adc8};}function isRelativePathSegment(_0x2b8fb6){return _0x2b8fb6==='.'||_0x2b8fb6==='..';}function validatePathSegment(_0x23c082){const _0x39597b=a116_0x21c6;if(_0x23c082==='')throw new Error(_0x39597b(0x200));if(_0x23c082==='.'||_0x23c082==='..')return;if(/[\x00-\x1F\x7F]/[_0x39597b(0x1fa)](_0x23c082))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x23c082);if(_0x23c082!==_0x23c082[_0x39597b(0x1e0)]()){}}export function validatePath(_0x5ba4cb){const _0x1b3fed=a116_0x21c6;if(_0x5ba4cb['segments']['length']===0x0&&!_0x5ba4cb[_0x1b3fed(0x1d8)])throw new Error(_0x1b3fed(0x1dd));if(_0x5ba4cb[_0x1b3fed(0x1d8)]){if(_0x5ba4cb[_0x1b3fed(0x1fb)][0x0]==='..')throw new Error(_0x1b3fed(0x1f6));let _0x4baaa8=0x0;for(const _0x41dba4 of _0x5ba4cb[_0x1b3fed(0x1fb)]){if(_0x41dba4==='..'){if(_0x4baaa8===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x4baaa8--;}else _0x41dba4!=='.'&&_0x4baaa8++;}}}export function joinPaths(_0x2137b1,_0x4fc8e7){const _0x505424=a116_0x21c6;if(!_0x2137b1||_0x2137b1==='/')return _0x4fc8e7;if(!_0x4fc8e7||_0x4fc8e7==='.')return _0x2137b1;if(_0x4fc8e7['startsWith']('/'))return _0x4fc8e7;const _0x5f3860=parsePath(_0x2137b1),_0x48f52b=parsePath(_0x4fc8e7),_0x249478=[..._0x5f3860['segments']];for(const _0x10edb7 of _0x48f52b[_0x505424(0x1fb)]){if(_0x10edb7==='.')continue;else{if(_0x10edb7==='..'){if(_0x249478['length']===0x0)throw new Error(_0x505424(0x202));_0x249478[_0x505424(0x1e2)]();}else _0x249478[_0x505424(0x1df)](_0x10edb7);}}const _0x5afc27=_0x249478[_0x505424(0x1fd)]('/');return _0x5f3860[_0x505424(0x1e8)][_0x505424(0x1f4)]('/')?'/'+_0x5afc27:_0x5afc27;}export function normalizePath(_0x1ed6dd){const _0x3d137c=a116_0x21c6,_0x5d9add=parsePath(_0x1ed6dd),_0x54e7c8=[];for(const _0x2a1201 of _0x5d9add['segments']){if(_0x2a1201==='.')continue;else{if(_0x2a1201==='..'){if(_0x54e7c8[_0x3d137c(0x205)]===0x0){if(_0x5d9add['isAbsolute'])throw new Error(_0x3d137c(0x202));_0x54e7c8[_0x3d137c(0x1df)]('..');}else _0x54e7c8[_0x54e7c8[_0x3d137c(0x205)]-0x1]==='..'?_0x54e7c8[_0x3d137c(0x1df)]('..'):_0x54e7c8[_0x3d137c(0x1e2)]();}else _0x54e7c8[_0x3d137c(0x1df)](_0x2a1201);}}if(_0x54e7c8['length']===0x0)return _0x5d9add['isAbsolute']?'/':'.';const _0x560126=_0x54e7c8[_0x3d137c(0x1fd)]('/');return _0x5d9add['raw']['startsWith']('/')?'/'+_0x560126:_0x560126;}export function getParentPath(_0x3d3785){const _0x5a25a1=a116_0x21c6,_0x1938ff=parsePath(_0x3d3785);if(_0x1938ff['segments'][_0x5a25a1(0x205)]<=0x1)return'/';const _0xbb83da=_0x1938ff[_0x5a25a1(0x1fb)][_0x5a25a1(0x1da)](0x0,-0x1)[_0x5a25a1(0x1fd)]('/');return _0x1938ff[_0x5a25a1(0x1e8)][_0x5a25a1(0x1f4)]('/')?'/'+_0xbb83da:_0xbb83da;}export function getBaseName(_0x2f8508){const _0x161a11=a116_0x21c6,_0x32fc6d=parsePath(_0x2f8508);return _0x32fc6d['segments'][_0x32fc6d[_0x161a11(0x1fb)][_0x161a11(0x205)]-0x1]||'';}export function isChildPath(_0x17769e,_0xee6448){const _0x3e7693=a116_0x21c6,_0x292919=parsePath(_0x17769e),_0x4bbc52=parsePath(_0xee6448);if(_0x292919['segments'][_0x3e7693(0x205)]<=_0x4bbc52['segments']['length'])return![];for(let _0x591694=0x0;_0x591694<_0x4bbc52[_0x3e7693(0x1fb)]['length'];_0x591694++){if(_0x292919[_0x3e7693(0x1fb)][_0x591694]!==_0x4bbc52['segments'][_0x591694])return![];}return!![];}export function splitPath(_0x288d24){const _0x3a698d=a116_0x21c6,_0x790f5c=parsePath(_0x288d24);if(_0x790f5c['segments'][_0x3a698d(0x205)]===0x0)throw new Error(_0x3a698d(0x1f7));if(_0x790f5c[_0x3a698d(0x1fb)]['length']===0x1)return{'parent':_0x790f5c[_0x3a698d(0x1fb)][0x0]};return{'parent':_0x790f5c[_0x3a698d(0x1fb)][0x0],'child':_0x790f5c[_0x3a698d(0x1fb)][_0x3a698d(0x1da)](0x1)['join']('/')};}export function isYamlFilePath(_0x5173bb){const _0x55cc62=a116_0x21c6;return _0x5173bb[_0x55cc62(0x1fe)](_0x55cc62(0x1ef))||_0x5173bb[_0x55cc62(0x1fe)](_0x55cc62(0x201));}export async function resolveYamlFilePath(_0x3f2b94,_0x382c8c=nodeFileSystem){const _0x5888c3=a116_0x21c6,_0x35e6bd=a116_0x383329[_0x5888c3(0x1ec)](_0x3f2b94);if(!await _0x382c8c[_0x5888c3(0x1fc)](_0x35e6bd))throw new Error(_0x5888c3(0x1f8)+_0x3f2b94);let _0x5540db=a116_0x383329[_0x5888c3(0x1e1)](_0x35e6bd),_0x58e0f9=null,_0x2cd1e7=null;const _0x3725f7=a116_0x383329[_0x5888c3(0x1f9)](_0x5540db)['root'];while(_0x5540db!==_0x3725f7){const _0x3018bd=a116_0x383329[_0x5888c3(0x1fd)](_0x5540db,'tdx.json');if(await _0x382c8c['exists'](_0x3018bd)){_0x58e0f9=_0x3018bd,_0x2cd1e7=_0x5540db;break;}_0x5540db=a116_0x383329['dirname'](_0x5540db);}if(!_0x58e0f9||!_0x2cd1e7)throw new Error(_0x5888c3(0x1f1)+_0x3f2b94);const _0x11ecc1=await _0x382c8c[_0x5888c3(0x1f3)](_0x58e0f9),_0x5a49ae=JSON[_0x5888c3(0x1f9)](_0x11ecc1),_0x34745d=_0x5a49ae[_0x5888c3(0x1d6)];if(!_0x34745d)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x2dc936=await _0x382c8c[_0x5888c3(0x1f3)](_0x35e6bd),_0x25ce72=a116_0x4ce121(_0x2dc936),_0x326252=_0x25ce72[_0x5888c3(0x1f0)];if(!_0x326252)throw new Error(_0x5888c3(0x1e3)+_0x3f2b94);const _0x1eaf6b=_0x25ce72['type']===_0x5888c3(0x1d9)?_0x5888c3(0x1d9):'segment',_0x3cf092=a116_0x383329[_0x5888c3(0x1eb)](_0x2cd1e7,_0x35e6bd),_0x15b403=a116_0x383329[_0x5888c3(0x1e1)](_0x3cf092),_0x33b5e6=_0x15b403==='.'?'':_0x15b403[_0x5888c3(0x1d7)](/\\/g,'/'),_0x488766=_0x33b5e6?_0x34745d+'/'+_0x33b5e6+'/'+_0x326252:_0x34745d+'/'+_0x326252;return{'parentSegment':_0x34745d,'segmentName':_0x326252,'folderPath':_0x33b5e6,'fullPath':_0x488766,'resourceType':_0x1eaf6b};}
@@ -1 +1 @@
1
- (function(_0xa23d4b,_0x3f42da){const _0x3934de=a117_0x2dd8,_0x2d8215=_0xa23d4b();while(!![]){try{const _0x450bf0=parseInt(_0x3934de(0x1df))/0x1+-parseInt(_0x3934de(0x1dc))/0x2*(parseInt(_0x3934de(0x1e1))/0x3)+-parseInt(_0x3934de(0x1de))/0x4+parseInt(_0x3934de(0x1e9))/0x5*(parseInt(_0x3934de(0x1e5))/0x6)+parseInt(_0x3934de(0x1e8))/0x7*(parseInt(_0x3934de(0x1e3))/0x8)+-parseInt(_0x3934de(0x1e4))/0x9+parseInt(_0x3934de(0x1db))/0xa*(parseInt(_0x3934de(0x1dd))/0xb);if(_0x450bf0===_0x3f42da)break;else _0x2d8215['push'](_0x2d8215['shift']());}catch(_0x4213b9){_0x2d8215['push'](_0x2d8215['shift']());}}}(a117_0x16eb,0x54f77));function a117_0x2dd8(_0x47be9f,_0x25b759){_0x47be9f=_0x47be9f-0x1db;const _0x16eb08=a117_0x16eb();let _0x2dd8f2=_0x16eb08[_0x47be9f];return _0x2dd8f2;}function a117_0x16eb(){const _0xb32800=['40430zECCms','3958FqaVAq','1397lYnJxz','641524RifIBH','379613QwRSXX','Invalid\x20segment\x20reference\x20format:\x20','831Izbnww','indexOf','8agfiID','1275822ZKSpQG','457746uLPgyS','.\x20Parent\x20name\x20cannot\x20be\x20empty','.\x20Child\x20name\x20cannot\x20be\x20empty','749OxjJeY','20TtIIXA','substring'];a117_0x16eb=function(){return _0xb32800;};return a117_0x16eb();}export function parseSegmentRef(_0x40e367){const _0x2ccdc4=a117_0x2dd8,_0xa93f31=_0x40e367[_0x2ccdc4(0x1e2)]('/');if(_0xa93f31===-0x1)return{'parentId':_0x40e367};if(_0xa93f31===0x0)throw new Error(_0x2ccdc4(0x1e0)+_0x40e367+_0x2ccdc4(0x1e6));const _0xd021d8=_0x40e367[_0x2ccdc4(0x1ea)](0x0,_0xa93f31),_0x1c705f=_0x40e367[_0x2ccdc4(0x1ea)](_0xa93f31+0x1);if(_0x1c705f==='')throw new Error(_0x2ccdc4(0x1e0)+_0x40e367+_0x2ccdc4(0x1e7));return{'parentId':_0xd021d8,'childId':_0x1c705f};}
1
+ function a117_0x3b99(){const _0xbfbbb5=['substring','3531699VoaWZH','11ZyHrwl','12768CBsnNH','indexOf','522319LgLpBV','17360orDjUn','598610snlAYq','407301aXYOyZ','.\x20Child\x20name\x20cannot\x20be\x20empty','96WzWNgs','50PyKXFx','4706qdNkkX','Invalid\x20segment\x20reference\x20format:\x20','.\x20Parent\x20name\x20cannot\x20be\x20empty','4UTnJQC'];a117_0x3b99=function(){return _0xbfbbb5;};return a117_0x3b99();}(function(_0x1e80d9,_0x1a3f66){const _0x5f1b73=a117_0x503c,_0x1a81ff=_0x1e80d9();while(!![]){try{const _0x4e8a7c=parseInt(_0x5f1b73(0x1f4))/0x1*(-parseInt(_0x5f1b73(0x1f3))/0x2)+parseInt(_0x5f1b73(0x1f0))/0x3*(-parseInt(_0x5f1b73(0x1e7))/0x4)+-parseInt(_0x5f1b73(0x1ee))/0x5*(-parseInt(_0x5f1b73(0x1f2))/0x6)+parseInt(_0x5f1b73(0x1ed))/0x7+parseInt(_0x5f1b73(0x1eb))/0x8+parseInt(_0x5f1b73(0x1e9))/0x9+-parseInt(_0x5f1b73(0x1ef))/0xa*(-parseInt(_0x5f1b73(0x1ea))/0xb);if(_0x4e8a7c===_0x1a3f66)break;else _0x1a81ff['push'](_0x1a81ff['shift']());}catch(_0x29660f){_0x1a81ff['push'](_0x1a81ff['shift']());}}}(a117_0x3b99,0x50b7c));function a117_0x503c(_0x3a7151,_0x38034d){_0x3a7151=_0x3a7151-0x1e6;const _0x3b99ec=a117_0x3b99();let _0x503cca=_0x3b99ec[_0x3a7151];return _0x503cca;}export function parseSegmentRef(_0x1fe59e){const _0x39d243=a117_0x503c,_0x3d43e2=_0x1fe59e[_0x39d243(0x1ec)]('/');if(_0x3d43e2===-0x1)return{'parentId':_0x1fe59e};if(_0x3d43e2===0x0)throw new Error(_0x39d243(0x1f5)+_0x1fe59e+_0x39d243(0x1e6));const _0x469e32=_0x1fe59e['substring'](0x0,_0x3d43e2),_0x2b48f9=_0x1fe59e[_0x39d243(0x1e8)](_0x3d43e2+0x1);if(_0x2b48f9==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1fe59e+_0x39d243(0x1f1));return{'parentId':_0x469e32,'childId':_0x2b48f9};}
@@ -1 +1 @@
1
- (function(_0xcc1203,_0x2477f8){const _0x30c974=a118_0x34ba,_0x21d36a=_0xcc1203();while(!![]){try{const _0x3dcd62=-parseInt(_0x30c974(0x188))/0x1+-parseInt(_0x30c974(0x1a0))/0x2+parseInt(_0x30c974(0x17d))/0x3*(parseInt(_0x30c974(0x18f))/0x4)+-parseInt(_0x30c974(0x194))/0x5+-parseInt(_0x30c974(0x19b))/0x6+-parseInt(_0x30c974(0x191))/0x7+parseInt(_0x30c974(0x19e))/0x8;if(_0x3dcd62===_0x2477f8)break;else _0x21d36a['push'](_0x21d36a['shift']());}catch(_0x360a46){_0x21d36a['push'](_0x21d36a['shift']());}}}(a118_0x5565,0x5da70));import a118_0x1771a1 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x48fb5f){const _0xdfc28c=a118_0x34ba;return _0x48fb5f[_0xdfc28c(0x17f)]!==_0xdfc28c(0x196);}export function isScopedResolution(_0x1ef4f0){const _0x145457=a118_0x34ba;return _0x1ef4f0[_0x145457(0x17f)]==='directory'||_0x1ef4f0[_0x145457(0x17f)]===_0x145457(0x177)||_0x1ef4f0[_0x145457(0x17f)]==='context';}function a118_0x5565(){const _0x11f8af=['file_not_found','parent_segment','journey','directory','join','parent_name','startsWith','resourceType','segment','file','tdx.json','isDirectory','folderPath','stat','segmentName','6BtXVWS','readFile','type','Parent\x20segment\x20not\x20specified','No\x20tdx.json\x20found','isScoped','isFile','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','no_parent','Not\x20a\x20YAML\x20file:\x20','match','545264ezmGLS','extname','resolve','message','trim','string','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','711940aEUahQ','parse','5330563HNHoMp','parentSegment','scopedFolderPath','476070LibXog','File\x20not\x20found:\x20','error','No\x20tdx.json\x20found\x20for\x20file:\x20','basename','invalid_yaml','context','783720QiVBfG','cwd','File\x20not\x20found','17064912tDLWDW','dirname','1145754gWoBDb','no_config','replace','exists','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','relative','configDir'];a118_0x5565=function(){return _0x11f8af;};return a118_0x5565();}export function getScopedDetails(_0x489cad){const _0x6a2f11=a118_0x34ba;if(isScopedResolution(_0x489cad))return{'isScoped':_0x489cad[_0x6a2f11(0x182)],'scopedFolderPath':_0x489cad[_0x6a2f11(0x193)]};return undefined;}function a118_0x34ba(_0x2aa514,_0x4d358c){_0x2aa514=_0x2aa514-0x16e;const _0x55652f=a118_0x5565();let _0x34ba94=_0x55652f[_0x2aa514];return _0x34ba94;}async function findTdxConfigAsync(_0x3d45ff,_0x32d6c7){const _0x2e69cd=a118_0x34ba;let _0x381b62=a118_0x1771a1[_0x2e69cd(0x18a)](_0x3d45ff);const _0x329faf=a118_0x1771a1['parse'](_0x381b62)['root'];while(_0x381b62!==_0x329faf){const _0xbf08dc=a118_0x1771a1[_0x2e69cd(0x172)](_0x381b62,_0x2e69cd(0x178));if(await _0x32d6c7[_0x2e69cd(0x1a3)](_0xbf08dc))try{const _0x1f8a7e=await _0x32d6c7[_0x2e69cd(0x17e)](_0xbf08dc),_0x15f97e=JSON[_0x2e69cd(0x190)](_0x1f8a7e);if(_0x15f97e[_0x2e69cd(0x16f)]&&typeof _0x15f97e[_0x2e69cd(0x16f)]===_0x2e69cd(0x18d))return{'configPath':_0xbf08dc,'configDir':_0x381b62,'parentSegment':_0x15f97e['parent_segment']};}catch{}_0x381b62=a118_0x1771a1[_0x2e69cd(0x19f)](_0x381b62);}return null;}function calculateScopedPath(_0x20a59e,_0x45cfb4){const _0x3390ca=a118_0x34ba,_0x1cf018=a118_0x1771a1[_0x3390ca(0x1a5)](_0x45cfb4,_0x20a59e),_0xf3a7f7=_0x1cf018!==''&&_0x1cf018!=='.'&&!_0x1cf018[_0x3390ca(0x174)]('..');return{'isScoped':_0xf3a7f7,'scopedFolderPath':_0xf3a7f7?_0x1cf018[_0x3390ca(0x1a2)](/\\/g,'/'):''};}export async function resolveTarget(_0x1eedf0){const _0x5bbd70=a118_0x34ba,{arg:_0x4584bb,contextParent:_0x15050a,cwd:cwd=process[_0x5bbd70(0x19c)](),fs:fs=nodeFileSystem}=_0x1eedf0;if(_0x4584bb&&isYamlFilePath(_0x4584bb))try{const _0x1dd3c0=await resolveYamlFilePath(_0x4584bb,fs),_0xd77a89=a118_0x1771a1[_0x5bbd70(0x18a)](_0x4584bb),_0x17eaa8=a118_0x1771a1[_0x5bbd70(0x19f)](_0xd77a89),_0x2302ce=await findTdxConfigAsync(_0x17eaa8,fs);if(!_0x2302ce){if(_0x15050a){const _0x527224=a118_0x1771a1[_0x5bbd70(0x19f)](_0xd77a89);return{'type':'file','parentName':_0x15050a,'targetDir':_0x527224,'configRoot':_0x527224,'filePath':_0xd77a89,'resourceName':_0x1dd3c0[_0x5bbd70(0x17c)],'folderPath':_0x1dd3c0['folderPath'],'resourceType':_0x1dd3c0[_0x5bbd70(0x175)],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x5bbd70(0x1a1),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x4584bb,'arg':_0x4584bb,'helpText':_0x5bbd70(0x1a4)};}const _0x232ae3=calculateScopedPath(_0x17eaa8,_0x2302ce['configDir']);return{'type':_0x5bbd70(0x177),'parentName':_0x2302ce[_0x5bbd70(0x192)],'targetDir':_0x2302ce['configDir'],'configRoot':_0x2302ce[_0x5bbd70(0x1a6)],'filePath':_0xd77a89,'resourceName':_0x1dd3c0['segmentName'],'folderPath':_0x1dd3c0[_0x5bbd70(0x17a)],'resourceType':_0x1dd3c0[_0x5bbd70(0x175)],'isScoped':_0x232ae3[_0x5bbd70(0x182)],'scopedFolderPath':_0x232ae3[_0x5bbd70(0x193)]};}catch(_0x524c4d){const _0x324a61=_0x524c4d instanceof Error?_0x524c4d[_0x5bbd70(0x18b)]:String(_0x524c4d);if(_0x324a61['includes'](_0x5bbd70(0x19d)))return{'type':_0x5bbd70(0x196),'errorCode':_0x5bbd70(0x16e),'message':_0x5bbd70(0x195)+_0x4584bb,'arg':_0x4584bb};if(_0x324a61['includes'](_0x5bbd70(0x181))){if(_0x15050a){const _0x2a3198=a118_0x1771a1[_0x5bbd70(0x18a)](_0x4584bb);if(await fs[_0x5bbd70(0x1a3)](_0x2a3198)){const _0x2cf7a0=a118_0x1771a1[_0x5bbd70(0x19f)](_0x2a3198),_0x390c94=await fs[_0x5bbd70(0x17e)](_0x2a3198),_0x635139=_0x390c94[_0x5bbd70(0x187)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x25469a=_0x390c94['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x26a5db=_0x635139?_0x635139[0x1]['trim']():a118_0x1771a1[_0x5bbd70(0x198)](_0x4584bb,a118_0x1771a1[_0x5bbd70(0x189)](_0x4584bb)),_0x2ba42d=_0x25469a&&_0x25469a[0x1][_0x5bbd70(0x18c)]()===_0x5bbd70(0x170)?_0x5bbd70(0x170):_0x5bbd70(0x176);return{'type':_0x5bbd70(0x177),'parentName':_0x15050a,'targetDir':_0x2cf7a0,'configRoot':_0x2cf7a0,'filePath':_0x2a3198,'resourceName':_0x26a5db,'folderPath':'','resourceType':_0x2ba42d,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0x5bbd70(0x1a1),'message':_0x5bbd70(0x197)+_0x4584bb,'arg':_0x4584bb,'helpText':_0x5bbd70(0x1a4)};}return{'type':_0x5bbd70(0x196),'errorCode':_0x5bbd70(0x199),'message':_0x324a61,'arg':_0x4584bb};}if(_0x4584bb){const _0x160695=a118_0x1771a1[_0x5bbd70(0x18a)](cwd,_0x4584bb);let _0x4cbf01=null;try{_0x4cbf01=await fs[_0x5bbd70(0x17b)](_0x160695);}catch{}if(_0x4cbf01?.[_0x5bbd70(0x179)]()){const _0x1ae682=await findTdxConfigAsync(_0x160695,fs);if(_0x1ae682){const _0x4f96c8=calculateScopedPath(_0x160695,_0x1ae682['configDir']);return{'type':_0x5bbd70(0x171),'parentName':_0x1ae682[_0x5bbd70(0x192)],'targetDir':_0x160695,'configRoot':_0x1ae682[_0x5bbd70(0x1a6)],'isScoped':_0x4f96c8[_0x5bbd70(0x182)],'scopedFolderPath':_0x4f96c8[_0x5bbd70(0x193)]};}if(_0x15050a)return{'type':'directory','parentName':_0x15050a,'targetDir':_0x160695,'configRoot':_0x160695,'isScoped':![],'scopedFolderPath':''};return{'type':_0x5bbd70(0x196),'errorCode':_0x5bbd70(0x1a1),'message':_0x5bbd70(0x18e)+_0x4584bb,'arg':_0x4584bb,'helpText':_0x5bbd70(0x1a4)};}if(_0x4cbf01?.[_0x5bbd70(0x183)]())return{'type':_0x5bbd70(0x196),'errorCode':_0x5bbd70(0x199),'message':_0x5bbd70(0x186)+_0x4584bb,'arg':_0x4584bb,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x29ee1c=sanitizeFileName(_0x4584bb),_0x30896c=getSegmentRootDir(_0x29ee1c,cwd);return{'type':_0x5bbd70(0x173),'parentName':_0x4584bb,'targetDir':_0x30896c,'configRoot':_0x30896c};}const _0x1135b1=await findTdxConfigAsync(cwd,fs);if(_0x1135b1){const _0x2675be=calculateScopedPath(cwd,_0x1135b1['configDir']);return{'type':_0x5bbd70(0x19a),'parentName':_0x1135b1[_0x5bbd70(0x192)],'targetDir':cwd,'configRoot':_0x1135b1[_0x5bbd70(0x1a6)],'isScoped':_0x2675be[_0x5bbd70(0x182)],'scopedFolderPath':_0x2675be[_0x5bbd70(0x193)]};}if(_0x15050a){const _0x48d42a=sanitizeFileName(_0x15050a),_0x51439c=getSegmentRootDir(_0x48d42a,cwd);return{'type':_0x5bbd70(0x19a),'parentName':_0x15050a,'targetDir':_0x51439c,'configRoot':_0x51439c,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x5bbd70(0x185),'message':_0x5bbd70(0x180),'helpText':_0x5bbd70(0x184)};}
1
+ (function(_0x1392bc,_0x41da6f){const _0x53091d=a118_0x2c51,_0x51d8d0=_0x1392bc();while(!![]){try{const _0x37013f=-parseInt(_0x53091d(0xd5))/0x1+parseInt(_0x53091d(0xe0))/0x2*(-parseInt(_0x53091d(0xd2))/0x3)+-parseInt(_0x53091d(0xff))/0x4+parseInt(_0x53091d(0xf1))/0x5+-parseInt(_0x53091d(0xf5))/0x6+parseInt(_0x53091d(0xf3))/0x7*(-parseInt(_0x53091d(0x103))/0x8)+parseInt(_0x53091d(0xda))/0x9;if(_0x37013f===_0x41da6f)break;else _0x51d8d0['push'](_0x51d8d0['shift']());}catch(_0x272951){_0x51d8d0['push'](_0x51d8d0['shift']());}}}(a118_0xc860,0x810e0));import a118_0x177a7f from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x4a54c0){const _0x3c531b=a118_0x2c51;return _0x4a54c0[_0x3c531b(0xd8)]!==_0x3c531b(0xef);}export function isScopedResolution(_0x1b6fa1){const _0x1e6a97=a118_0x2c51;return _0x1b6fa1[_0x1e6a97(0xd8)]===_0x1e6a97(0x102)||_0x1b6fa1[_0x1e6a97(0xd8)]==='file'||_0x1b6fa1[_0x1e6a97(0xd8)]===_0x1e6a97(0xee);}export function getScopedDetails(_0x11e69b){if(isScopedResolution(_0x11e69b))return{'isScoped':_0x11e69b['isScoped'],'scopedFolderPath':_0x11e69b['scopedFolderPath']};return undefined;}function a118_0x2c51(_0x387b88,_0x22f7ad){_0x387b88=_0x387b88-0xcf;const _0xc8603c=a118_0xc860();let _0x2c51b5=_0xc8603c[_0x387b88];return _0x2c51b5;}async function findTdxConfigAsync(_0x18f66f,_0x113896){const _0x4b8d74=a118_0x2c51;let _0x3f2c9f=a118_0x177a7f[_0x4b8d74(0xdb)](_0x18f66f);const _0x2e9a39=a118_0x177a7f[_0x4b8d74(0xfe)](_0x3f2c9f)['root'];while(_0x3f2c9f!==_0x2e9a39){const _0x3b45b6=a118_0x177a7f[_0x4b8d74(0xd3)](_0x3f2c9f,_0x4b8d74(0xf2));if(await _0x113896[_0x4b8d74(0xf4)](_0x3b45b6))try{const _0x28151b=await _0x113896[_0x4b8d74(0xd0)](_0x3b45b6),_0x41bf66=JSON['parse'](_0x28151b);if(_0x41bf66[_0x4b8d74(0xe2)]&&typeof _0x41bf66[_0x4b8d74(0xe2)]===_0x4b8d74(0xdf))return{'configPath':_0x3b45b6,'configDir':_0x3f2c9f,'parentSegment':_0x41bf66[_0x4b8d74(0xe2)]};}catch{}_0x3f2c9f=a118_0x177a7f['dirname'](_0x3f2c9f);}return null;}function calculateScopedPath(_0x1a7d92,_0x146481){const _0x425474=a118_0x2c51,_0x49c40a=a118_0x177a7f['relative'](_0x146481,_0x1a7d92),_0x3235a3=_0x49c40a!==''&&_0x49c40a!=='.'&&!_0x49c40a[_0x425474(0xfc)]('..');return{'isScoped':_0x3235a3,'scopedFolderPath':_0x3235a3?_0x49c40a['replace'](/\\/g,'/'):''};}function a118_0xc860(){const _0x941ffe=['2261540WJSllo','isDirectory','isFile','directory','144296xZliKq','parent_name','No\x20tdx.json\x20found\x20for\x20file:\x20','readFile','no_parent','21PUHjlm','join','segmentName','758827mQNndd','invalid_yaml','folderPath','type','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','22917681aCZySm','resolve','includes','File\x20not\x20found','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','string','183046UeKuUU','cwd','parent_segment','no_config','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','journey','stat','basename','segment','file_not_found','file','parentSegment','trim','isScoped','context','error','match','4515010LylFFc','tdx.json','336AEpeAM','exists','540924cgZWpf','Parent\x20segment\x20not\x20specified','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','scopedFolderPath','configDir','dirname','File\x20not\x20found:\x20','startsWith','message','parse'];a118_0xc860=function(){return _0x941ffe;};return a118_0xc860();}export async function resolveTarget(_0x3466c9){const _0x5cbbde=a118_0x2c51,{arg:_0x134d9d,contextParent:_0x54a2c9,cwd:cwd=process[_0x5cbbde(0xe1)](),fs:fs=nodeFileSystem}=_0x3466c9;if(_0x134d9d&&isYamlFilePath(_0x134d9d))try{const _0x558b3f=await resolveYamlFilePath(_0x134d9d,fs),_0x217a87=a118_0x177a7f[_0x5cbbde(0xdb)](_0x134d9d),_0x24413e=a118_0x177a7f[_0x5cbbde(0xfa)](_0x217a87),_0x335582=await findTdxConfigAsync(_0x24413e,fs);if(!_0x335582){if(_0x54a2c9){const _0x2185eb=a118_0x177a7f['dirname'](_0x217a87);return{'type':_0x5cbbde(0xea),'parentName':_0x54a2c9,'targetDir':_0x2185eb,'configRoot':_0x2185eb,'filePath':_0x217a87,'resourceName':_0x558b3f[_0x5cbbde(0xd4)],'folderPath':_0x558b3f['folderPath'],'resourceType':_0x558b3f['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xe3),'message':_0x5cbbde(0xcf)+_0x134d9d,'arg':_0x134d9d,'helpText':_0x5cbbde(0xe4)};}const _0x2f22b6=calculateScopedPath(_0x24413e,_0x335582[_0x5cbbde(0xf9)]);return{'type':_0x5cbbde(0xea),'parentName':_0x335582[_0x5cbbde(0xeb)],'targetDir':_0x335582['configDir'],'configRoot':_0x335582[_0x5cbbde(0xf9)],'filePath':_0x217a87,'resourceName':_0x558b3f['segmentName'],'folderPath':_0x558b3f[_0x5cbbde(0xd7)],'resourceType':_0x558b3f['resourceType'],'isScoped':_0x2f22b6[_0x5cbbde(0xed)],'scopedFolderPath':_0x2f22b6[_0x5cbbde(0xf8)]};}catch(_0x15faab){const _0x363b73=_0x15faab instanceof Error?_0x15faab[_0x5cbbde(0xfd)]:String(_0x15faab);if(_0x363b73[_0x5cbbde(0xdc)](_0x5cbbde(0xdd)))return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xe9),'message':_0x5cbbde(0xfb)+_0x134d9d,'arg':_0x134d9d};if(_0x363b73[_0x5cbbde(0xdc)]('No\x20tdx.json\x20found')){if(_0x54a2c9){const _0x112139=a118_0x177a7f[_0x5cbbde(0xdb)](_0x134d9d);if(await fs[_0x5cbbde(0xf4)](_0x112139)){const _0x2b56b3=a118_0x177a7f[_0x5cbbde(0xfa)](_0x112139),_0x253d09=await fs['readFile'](_0x112139),_0x23a2d6=_0x253d09[_0x5cbbde(0xf0)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x24a633=_0x253d09[_0x5cbbde(0xf0)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x23a75c=_0x23a2d6?_0x23a2d6[0x1][_0x5cbbde(0xec)]():a118_0x177a7f[_0x5cbbde(0xe7)](_0x134d9d,a118_0x177a7f['extname'](_0x134d9d)),_0x16e0ba=_0x24a633&&_0x24a633[0x1][_0x5cbbde(0xec)]()===_0x5cbbde(0xe5)?_0x5cbbde(0xe5):_0x5cbbde(0xe8);return{'type':_0x5cbbde(0xea),'parentName':_0x54a2c9,'targetDir':_0x2b56b3,'configRoot':_0x2b56b3,'filePath':_0x112139,'resourceName':_0x23a75c,'folderPath':'','resourceType':_0x16e0ba,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xe3),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x134d9d,'arg':_0x134d9d,'helpText':_0x5cbbde(0xe4)};}return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xd6),'message':_0x363b73,'arg':_0x134d9d};}if(_0x134d9d){const _0x2bb496=a118_0x177a7f[_0x5cbbde(0xdb)](cwd,_0x134d9d);let _0x1474bb=null;try{_0x1474bb=await fs[_0x5cbbde(0xe6)](_0x2bb496);}catch{}if(_0x1474bb?.[_0x5cbbde(0x100)]()){const _0x5eeb26=await findTdxConfigAsync(_0x2bb496,fs);if(_0x5eeb26){const _0x2ea2ed=calculateScopedPath(_0x2bb496,_0x5eeb26[_0x5cbbde(0xf9)]);return{'type':_0x5cbbde(0x102),'parentName':_0x5eeb26[_0x5cbbde(0xeb)],'targetDir':_0x2bb496,'configRoot':_0x5eeb26[_0x5cbbde(0xf9)],'isScoped':_0x2ea2ed[_0x5cbbde(0xed)],'scopedFolderPath':_0x2ea2ed[_0x5cbbde(0xf8)]};}if(_0x54a2c9)return{'type':'directory','parentName':_0x54a2c9,'targetDir':_0x2bb496,'configRoot':_0x2bb496,'isScoped':![],'scopedFolderPath':''};return{'type':_0x5cbbde(0xef),'errorCode':'no_config','message':_0x5cbbde(0xde)+_0x134d9d,'arg':_0x134d9d,'helpText':_0x5cbbde(0xe4)};}if(_0x1474bb?.[_0x5cbbde(0x101)]())return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xd6),'message':'Not\x20a\x20YAML\x20file:\x20'+_0x134d9d,'arg':_0x134d9d,'helpText':_0x5cbbde(0xd9)};const _0x3a6fc2=sanitizeFileName(_0x134d9d),_0x858bc3=getSegmentRootDir(_0x3a6fc2,cwd);return{'type':_0x5cbbde(0x104),'parentName':_0x134d9d,'targetDir':_0x858bc3,'configRoot':_0x858bc3};}const _0x10ad5b=await findTdxConfigAsync(cwd,fs);if(_0x10ad5b){const _0x34f056=calculateScopedPath(cwd,_0x10ad5b['configDir']);return{'type':_0x5cbbde(0xee),'parentName':_0x10ad5b[_0x5cbbde(0xeb)],'targetDir':cwd,'configRoot':_0x10ad5b[_0x5cbbde(0xf9)],'isScoped':_0x34f056['isScoped'],'scopedFolderPath':_0x34f056[_0x5cbbde(0xf8)]};}if(_0x54a2c9){const _0x551792=sanitizeFileName(_0x54a2c9),_0x48a4a5=getSegmentRootDir(_0x551792,cwd);return{'type':'context','parentName':_0x54a2c9,'targetDir':_0x48a4a5,'configRoot':_0x48a4a5,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5cbbde(0xef),'errorCode':_0x5cbbde(0xd1),'message':_0x5cbbde(0xf6),'helpText':_0x5cbbde(0xf7)};}