@treasuredata/tdx 0.26.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/personalization.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/realtime.js +1 -1
  102. package/dist/sdk/schedule.js +1 -1
  103. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/fields-display.js +1 -1
  105. package/dist/sdk/segment/file-discovery.js +1 -1
  106. package/dist/sdk/segment/journey-utils.js +1 -1
  107. package/dist/sdk/segment/journey-validator.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-recovery.js +1 -1
  113. package/dist/sdk/segment/push-workflow.js +1 -1
  114. package/dist/sdk/segment/resolution-context.js +1 -1
  115. package/dist/sdk/segment/segment-path-parser.js +1 -1
  116. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  117. package/dist/sdk/segment/target-resolution.js +1 -1
  118. package/dist/sdk/segment/tdx-config.js +1 -1
  119. package/dist/sdk/segment/validate-files.js +1 -1
  120. package/dist/sdk/segment/yaml-validator.js +1 -1
  121. package/dist/sdk/segment.js +1 -1
  122. package/dist/sdk/types/index.js +1 -1
  123. package/dist/sdk/types/progress.js +1 -1
  124. package/dist/sdk/user.js +1 -1
  125. package/dist/sdk/util/format-detector.js +1 -1
  126. package/dist/sdk/util/formatters.js +1 -1
  127. package/dist/sdk/util/index.js +1 -1
  128. package/dist/sdk/util/tree-formatter.js +1 -1
  129. package/dist/sdk/workflow/archive-validation.js +1 -1
  130. package/dist/sdk/workflow/clone-workflow.js +1 -1
  131. package/dist/sdk/workflow/index.js +1 -1
  132. package/dist/sdk/workflow/pull-workflow.js +1 -1
  133. package/dist/sdk/workflow/push-workflow.js +1 -1
  134. package/dist/sdk/workflow/tdx-config.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js +1 -1
  136. package/dist/test-utils/command-runner.js +1 -1
  137. package/dist/test-utils/factories.js +1 -1
  138. package/dist/test-utils/fixtures.js +1 -1
  139. package/dist/test-utils/http-mock.js +1 -1
  140. package/dist/test-utils/index.js +1 -1
  141. package/dist/utils/async.js +1 -1
  142. package/dist/utils/colors.js +1 -1
  143. package/dist/utils/diff.js +1 -1
  144. package/dist/utils/file-permissions.js +1 -1
  145. package/dist/utils/global-cache.js +1 -1
  146. package/dist/utils/json-loader.js +1 -1
  147. package/dist/utils/local-cache.d.ts +2 -1
  148. package/dist/utils/local-cache.d.ts.map +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/local-cache.js.map +1 -1
  151. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  152. package/dist/utils/logger/formatters/index.js +1 -1
  153. package/dist/utils/logger/handlers/console-handler.js +1 -1
  154. package/dist/utils/logger/handlers/file-handler.js +1 -1
  155. package/dist/utils/logger/handlers/index.js +1 -1
  156. package/dist/utils/logger/handlers/null-handler.js +1 -1
  157. package/dist/utils/logger/index.js +1 -1
  158. package/dist/utils/logger/logger.js +1 -1
  159. package/dist/utils/logger/types.js +1 -1
  160. package/dist/utils/option-validation.js +1 -1
  161. package/dist/utils/port.js +1 -1
  162. package/dist/utils/process.js +1 -1
  163. package/dist/utils/prompt.js +1 -1
  164. package/dist/utils/spinner.js +1 -1
  165. package/dist/utils/sse-parser.js +1 -1
  166. package/dist/utils/string-utils.js +1 -1
  167. package/dist/utils/table-ref-parser.js +1 -1
  168. package/dist/utils/tdx-logger.js +1 -1
  169. package/dist/utils/version-check.js +1 -1
  170. package/package.json +1 -1
@@ -1 +1 @@
1
- const a114_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_0x3e8f2e=a114_0x3785;(function(_0x88f904,_0x25ea2a){const _0x5132f8=a114_0x3785,_0x2dac09=_0x88f904();while(!![]){try{const _0x4ef868=-parseInt(_0x5132f8(0x211))/0x1+parseInt(_0x5132f8(0x241))/0x2+-parseInt(_0x5132f8(0x22d))/0x3+-parseInt(_0x5132f8(0x1c0))/0x4+-parseInt(_0x5132f8(0x258))/0x5*(-parseInt(_0x5132f8(0x1c4))/0x6)+parseInt(_0x5132f8(0x215))/0x7+-parseInt(_0x5132f8(0x1b1))/0x8*(-parseInt(_0x5132f8(0x252))/0x9);if(_0x4ef868===_0x25ea2a)break;else _0x2dac09['push'](_0x2dac09['shift']());}catch(_0x1a7fd4){_0x2dac09['push'](_0x2dac09['shift']());}}}(a114_0x980c,0x52b3b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a114_0x3e8f2e(0x266));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a114_0x3e8f2e(0x1db);export function createPendingSegmentId(_0x46b8a6){return''+PENDING_SEGMENT_PREFIX+_0x46b8a6+'__';}export function isPendingSegmentId(_0x649ff4){const _0x503a29=a114_0x3e8f2e;return _0x649ff4[_0x503a29(0x28c)](PENDING_SEGMENT_PREFIX)&&!_0x649ff4[_0x503a29(0x28c)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x124df4){const _0x390bdf=a114_0x3e8f2e;return _0x124df4[_0x390bdf(0x28b)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x40eca8){return''+PENDING_ACTIVATION_PREFIX+_0x40eca8+'__';}export function isPendingActivationId(_0x2eb840){const _0x43c6bf=a114_0x3e8f2e;return _0x2eb840[_0x43c6bf(0x28c)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x580884){return _0x580884['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x41c33a,_0x1627f5){const _0x517daa=a114_0x3e8f2e,_0xf2fa21=_0x41c33a+'::'+(_0x1627f5['trim']()||'segment'),_0x308926=createHash('sha1')[_0x517daa(0x1ed)](_0xf2fa21)['digest']('hex')[_0x517daa(0x1cb)](0x0,0xc);return _0x517daa(0x1dc)+_0x308926;}export function ensureJourneyDefaults(_0x472226){const _0xa945b8=a114_0x3e8f2e;!_0x472226[_0xa945b8(0x285)]&&(_0x472226[_0xa945b8(0x285)]=''),!_0x472226['state']&&(_0x472226[_0xa945b8(0x1e9)]=_0xa945b8(0x1d2));}export function resolveTDFolderPath(_0x29ebdb,_0x5f43d0,_0x1cf8db){if(!_0x5f43d0)return _0x29ebdb;if(_0x29ebdb===_0x1cf8db||_0x29ebdb['startsWith'](_0x1cf8db+'/'))return _0x29ebdb;return _0x29ebdb?_0x1cf8db+'/'+_0x29ebdb:_0x1cf8db;}export function addFoldersToCreate(_0x32ad85,_0x3a7aea,_0x209e8b){const _0x5298de=a114_0x3e8f2e;if(!_0x32ad85)return;if(_0x3a7aea[_0x5298de(0x27e)](_0x32ad85))return;const _0x16ccf2=_0x32ad85[_0x5298de(0x1b2)]('/');let _0x3dc8d7='';for(const _0x1695ad of _0x16ccf2){_0x3dc8d7=_0x3dc8d7?_0x3dc8d7+'/'+_0x1695ad:_0x1695ad,!_0x3a7aea[_0x5298de(0x27e)](_0x3dc8d7)&&_0x209e8b[_0x5298de(0x234)](_0x3dc8d7);}}import*as a114_0x36eefc from'yaml';import{readFileSync}from'fs';import a114_0xfecf44 from'path';import{isJourneyDef,parseYamlString as a114_0x461563,toYamlString as a114_0x823185,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x2da7c3){const _0x1ded2a=a114_0x3e8f2e;if(Array['isArray'](_0x2da7c3))return'['+_0x2da7c3[_0x1ded2a(0x1fe)](_0x3e569f=>stableStringify(_0x3e569f))[_0x1ded2a(0x1bb)](',')+']';if(_0x2da7c3&&typeof _0x2da7c3===_0x1ded2a(0x209)){const _0x2a6bd1=_0x2da7c3,_0x29d7c7=Object[_0x1ded2a(0x217)](_0x2a6bd1)[_0x1ded2a(0x1d1)](),_0x3ac971=_0x29d7c7[_0x1ded2a(0x1fe)](_0x1e177b=>'\x22'+_0x1e177b+'\x22:'+stableStringify(_0x2a6bd1[_0x1e177b]));return'{'+_0x3ac971[_0x1ded2a(0x1bb)](',')+'}';}const _0x702e5f=JSON[_0x1ded2a(0x235)](_0x2da7c3);return _0x702e5f===undefined?_0x1ded2a(0x1d3):_0x702e5f;}function activationSignature(_0x22458e){const _0x2ab5ae=a114_0x3e8f2e,_0x23fd0b={'connection':_0x22458e['connection'],..._0x22458e[_0x2ab5ae(0x272)]!==undefined&&{'all_columns':_0x22458e[_0x2ab5ae(0x272)]},..._0x22458e['columns']!==undefined&&{'columns':_0x22458e['columns']},..._0x22458e[_0x2ab5ae(0x239)]!==undefined&&{'behavior':_0x22458e['behavior']},..._0x22458e[_0x2ab5ae(0x282)]!==undefined&&{'schedule':_0x22458e[_0x2ab5ae(0x282)]},..._0x22458e[_0x2ab5ae(0x1fa)]!==undefined&&{'notification':_0x22458e[_0x2ab5ae(0x1fa)]},..._0x22458e['connector_config']!==undefined&&{'connector_config':_0x22458e[_0x2ab5ae(0x255)]},..._0x22458e['activation_template_id']!==undefined&&{'activation_template_id':_0x22458e['activation_template_id']}};return stableStringify(_0x23fd0b);}async function fetchSegment(_0x204b6a,_0x2e3736,_0x37c0a6,_0x313ce6){const _0x1326f5=a114_0x3e8f2e,_0x2de42d=_0x313ce6?.[_0x1326f5(0x1f4)](_0x578d75=>_0x578d75['id']===_0x37c0a6);if(_0x2de42d)return _0x2de42d;try{return await _0x204b6a[_0x1326f5(0x1e7)][_0x1326f5(0x265)](_0x2e3736,_0x37c0a6);}catch(_0x54e322){logger['debug'](_0x1326f5(0x271)+_0x37c0a6+_0x1326f5(0x23c)+_0x54e322);try{return await _0x204b6a['segment'][_0x1326f5(0x29a)](_0x37c0a6);}catch(_0x5d20be){return logger[_0x1326f5(0x1c7)](_0x1326f5(0x244)+_0x37c0a6+':\x20'+_0x5d20be),null;}}}function recoverSegmentIdsFromPushRecovery(_0x566588,_0x8ea16e,_0x3ccdf6){const _0x3b9daf=a114_0x3e8f2e,_0x2e9cd1=readPushRecovery(_0x566588['absolutePath']);if(_0x2e9cd1?.[_0x3b9daf(0x286)]===_0x566588[_0x3b9daf(0x28f)]['name'])for(const [_0x480f0c,_0x4baedc]of Object[_0x3b9daf(0x259)](_0x2e9cd1['segments'])){const _0x1d0f07=generateDeterministicJourneySegmentName(_0x566588['yamlConfig'][_0x3b9daf(0x1f6)],_0x480f0c);_0x4baedc[_0x3b9daf(0x218)]===_0x1d0f07&&(_0x8ea16e[_0x3b9daf(0x22a)](_0x480f0c,_0x4baedc[_0x3b9daf(0x294)]),_0x3ccdf6[_0x3b9daf(0x22a)](_0x480f0c,_0x4baedc['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x4adae0,_0x40ddbe,_0x108b0a,_0x9bef1d){const _0x48603f=a114_0x3e8f2e;let _0x54eebe;try{_0x54eebe=await _0x4adae0[_0x48603f(0x1e7)][_0x48603f(0x232)]({'name':_0x108b0a[_0x48603f(0x251)],'description':_0x108b0a[_0x48603f(0x285)],'journeyId':_0x108b0a[_0x48603f(0x205)],'rule':_0x9bef1d(_0x108b0a[_0x48603f(0x219)],!![]),'countPopulation':!![],'parentFolderId':_0x108b0a[_0x48603f(0x27d)],'audienceId':_0x108b0a[_0x48603f(0x297)]});}catch(_0x2be293){const _0x49f43a=_0x2be293 instanceof Error&&_0x2be293[_0x48603f(0x1f3)][_0x48603f(0x28e)](_0x48603f(0x28d));if(_0x49f43a){const _0x8a6597=readPushRecovery(_0x40ddbe['absolutePath']),_0x483bb2=_0x8a6597?.[_0x48603f(0x286)]===_0x40ddbe[_0x48603f(0x28f)]['name']?_0x8a6597[_0x48603f(0x210)][_0x108b0a['localName']]:undefined;if(_0x483bb2?.[_0x48603f(0x218)]===_0x108b0a['uniqueSegmentName'])await _0x4adae0[_0x48603f(0x1e7)][_0x48603f(0x227)](_0x108b0a[_0x48603f(0x297)],_0x483bb2[_0x48603f(0x294)],{'description':_0x108b0a[_0x48603f(0x285)],'rule':_0x9bef1d(_0x108b0a[_0x48603f(0x219)],!![]),'countPopulation':!![]}),_0x54eebe=_0x483bb2['segmentId'];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x48603f(0x1ea)+_0x108b0a[_0x48603f(0x220)]+_0x48603f(0x246)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x40ddbe['absolutePath'][_0x48603f(0x28b)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x48603f(0x283),_0x2be293);}else throw _0x2be293;}return saveSegmentToPushRecovery(_0x40ddbe[_0x48603f(0x2a0)],_0x40ddbe[_0x48603f(0x28f)][_0x48603f(0x1f6)],_0x108b0a[_0x48603f(0x220)],{'segmentId':_0x54eebe,'uniqueServerName':_0x108b0a['uniqueSegmentName'],'createdAt':new Date()[_0x48603f(0x237)]()}),_0x54eebe;}export async function prepareSegmentFiles(_0x241a33,_0x30699c,_0x4b76a9,_0x25620c,_0x5b9a2e){const _0x5de560=a114_0x3e8f2e,{activationDefToCreateRequest:_0x476492}=await import(_0x5de560(0x1b0)),_0xce7fbb=[],_0x1cb20b=new Set();for(const {yamlConfig:_0x484b8c,folderPath:_0x3ec9f2,sourcePath:_0x3b4c06}of _0x241a33){const _0x2c7488=resolveTDFolderPath(_0x3ec9f2,_0x25620c,_0x5b9a2e),_0x5c71eb=_0x2c7488+':'+_0x484b8c[_0x5de560(0x1f6)],_0x566b36=_0x30699c[_0x5de560(0x1ce)][_0x5de560(0x1f1)](_0x5c71eb),_0x349a22=_0x566b36?_0x30699c['activationsBySegmentId'][_0x5de560(0x1f1)](_0x566b36['id'])||[]:[];addFoldersToCreate(_0x2c7488,_0x30699c[_0x5de560(0x1c1)],_0x1cb20b);const _0x613332=calculateActivationActions(_0x484b8c[_0x5de560(0x1df)]||[],_0x349a22,_0x30699c[_0x5de560(0x268)],_0x30699c[_0x5de560(0x295)]);for(const _0x309127 of _0x613332){(_0x309127[_0x5de560(0x202)]===_0x5de560(0x1c2)||_0x309127[_0x5de560(0x202)]===_0x5de560(0x1ed))&&_0x309127[_0x5de560(0x26e)]&&(_0x309127[_0x5de560(0x1b5)]=await _0x476492(_0x309127[_0x5de560(0x26e)],_0x4b76a9));}const _0x28d27e=calculateSegmentDiff(_0x484b8c,_0x566b36,_0x349a22,_0x30699c[_0x5de560(0x268)],_0x30699c[_0x5de560(0x295)]);_0xce7fbb[_0x5de560(0x1c8)]({'relativePath':_0x484b8c[_0x5de560(0x1f6)],'absolutePath':_0x3b4c06,'yamlConfig':_0x484b8c,'folderPath':_0x2c7488,'existingSegment':_0x566b36,'existingActivations':_0x349a22,'isNew':_0x28d27e[_0x5de560(0x1e5)],'hasChanges':_0x28d27e[_0x5de560(0x1e8)],'diff':_0x28d27e[_0x5de560(0x280)],'activationActions':_0x613332});}return{'segmentFiles':_0xce7fbb,'foldersToCreate':_0x1cb20b};}export async function prepareJourneyFiles(_0x262f6d,_0x1af38b,_0xbf6b80,_0x4ead4e){const _0x47be40=a114_0x3e8f2e,_0x339d50=[],_0x2603a3=new Set();for(const {yamlConfig:_0x5767d0,folderPath:_0x1ee65b,sourcePath:_0x326db2}of _0x262f6d){const _0xfd2d93=resolveTDFolderPath(_0x1ee65b,_0xbf6b80,_0x4ead4e),_0x5b12c9=_0xfd2d93+':'+_0x5767d0['name'],_0x5a3eb4=_0x1af38b[_0x47be40(0x260)][_0x47be40(0x1f1)](_0x5b12c9);let _0x3483af,_0x566264;if(_0x5a3eb4&&_0x5a3eb4[_0x47be40(0x1b7)]>0x0){const _0x2fd6ab=buildLocalExpandedRuleMappings(_0x5767d0),{createYamlContext:_0x253528,prefetchJourneySegments:_0xae143d}=createPushYamlContextForBundle(_0x1af38b[_0x47be40(0x216)],_0x1af38b['parentId'],_0x1af38b[_0x47be40(0x284)],_0x2fd6ab,_0x1af38b[_0x47be40(0x268)],_0x1af38b[_0x47be40(0x295)],_0x1af38b[_0x47be40(0x1ba)],_0x1af38b[_0x47be40(0x21f)]);await _0xae143d(_0x5a3eb4[_0x47be40(0x1fe)](_0x3f3a91=>_0x3f3a91['id']));const _0x1ae017=hasMultipleVersions(_0x5767d0),_0x6b528a=async _0x2ab6c6=>{const _0x493179=_0x47be40,_0x283133=_0x1af38b[_0x493179(0x21f)]?.[_0x493179(0x1f1)](_0x2ab6c6);if(_0x283133)return _0x283133;return _0x1af38b[_0x493179(0x1ee)]({'journeyId':_0x2ab6c6,'journeyName':_0x5767d0['name'],'isMultiVersion':_0x5a3eb4['length']>0x1});};if(_0x1ae017&&_0x5a3eb4['length']>0x1){const _0x106230=[];for(const _0x1c3850 of _0x5a3eb4){const _0xa3daa6=_0x1c3850['versionNumber']||0x1;_0x1af38b[_0x47be40(0x214)]?.[_0x47be40(0x1ed)](_0x47be40(0x1b9)+_0x5767d0[_0x47be40(0x1f6)]+'\x20v'+_0xa3daa6);const _0x5c5e79=await _0x6b528a(_0x1c3850['id']),_0x46d7f5=_0x253528(_0x1c3850['id']),_0x337887=await journeyResponseToDef(_0x5c5e79,_0x46d7f5);_0x106230[_0x47be40(0x1c8)]({'item':_0x1c3850,'yaml':_0x337887});}const _0x3bfe07=buildLocalRuleToNameMappingFromJourney(_0x5767d0);_0x566264=buildMergedJourneyDef(_0x106230,_0x3bfe07);const _0x2d2006=Math[_0x47be40(0x212)](..._0x106230[_0x47be40(0x1fe)](_0x549910=>_0x549910[_0x47be40(0x224)][_0x47be40(0x25e)]||0x0)),_0xa25a2a=_0x5a3eb4['find'](_0x2709a5=>(_0x2709a5[_0x47be40(0x25e)]||0x0)===_0x2d2006);_0xa25a2a&&(_0x1af38b['progress']?.[_0x47be40(0x1ed)](_0x47be40(0x1b9)+_0x5767d0[_0x47be40(0x1f6)]+'\x20v'+_0x2d2006),_0x3483af=await _0x6b528a(_0xa25a2a['id']));}else{const _0x971f97=_0x5a3eb4[_0x5a3eb4[_0x47be40(0x1b7)]-0x1];_0x1af38b[_0x47be40(0x214)]?.[_0x47be40(0x1ed)](_0x47be40(0x1b9)+_0x5767d0[_0x47be40(0x1f6)]),_0x3483af=await _0x6b528a(_0x971f97['id']);const _0x3f3c48=_0x253528(_0x971f97['id']),_0x4240ca=await journeyResponseToDef(_0x3483af,_0x3f3c48),_0x570cd2=buildLocalRuleToNameMappingFromJourney(_0x5767d0);_0x566264=buildMergedJourneyDef([{'item':_0x971f97,'yaml':_0x4240ca}],_0x570cd2);}}addFoldersToCreate(_0xfd2d93,_0x1af38b[_0x47be40(0x1c1)],_0x2603a3);const _0x4ac323=calculateJourneyDiff(_0x5767d0,_0x566264);_0x339d50['push']({'relativePath':_0x5767d0[_0x47be40(0x1f6)],'absolutePath':_0x326db2,'yamlConfig':_0x5767d0,'folderPath':_0xfd2d93,'existingJourney':_0x3483af,'isNew':_0x4ac323['isNew'],'hasChanges':_0x4ac323[_0x47be40(0x1e8)],'diff':_0x4ac323[_0x47be40(0x280)]});}return{'journeyFiles':_0x339d50,'foldersToCreate':_0x2603a3};}export function calculateActivationActions(_0x22b288,_0x2056ce,_0xbf8913,_0x4e984b){const _0x2fa79e=a114_0x3e8f2e,_0x264b5e=[],_0x10c542=new Map();for(const _0x3238d1 of _0x2056ce){_0x10c542[_0x2fa79e(0x22a)](_0x3238d1['name'],_0x3238d1);}const _0x384eaa=new Map();for(const _0x278992 of _0x22b288){_0x384eaa[_0x2fa79e(0x22a)](_0x278992[_0x2fa79e(0x1f6)],_0x278992);}for(const _0x1c7a4a of _0x22b288){const _0x514374=_0x10c542[_0x2fa79e(0x1f1)](_0x1c7a4a[_0x2fa79e(0x1f6)]);if(!_0x514374)_0x264b5e[_0x2fa79e(0x1c8)]({'type':_0x2fa79e(0x1c2),'name':_0x1c7a4a[_0x2fa79e(0x1f6)],'yamlActivation':_0x1c7a4a});else{const _0xd970bd=activationResponseToDef(_0x514374,_0xbf8913,_0x4e984b),_0x4b30bd=a114_0x36eefc[_0x2fa79e(0x235)](_0xd970bd),_0x400cf=a114_0x36eefc[_0x2fa79e(0x235)](_0x1c7a4a);_0x4b30bd!==_0x400cf&&_0x264b5e['push']({'type':_0x2fa79e(0x1ed),'name':_0x1c7a4a[_0x2fa79e(0x1f6)],'yamlActivation':_0x1c7a4a,'existingActivation':_0x514374});}}for(const _0x14a6f1 of _0x2056ce){!_0x384eaa[_0x2fa79e(0x27e)](_0x14a6f1[_0x2fa79e(0x1f6)])&&_0x264b5e[_0x2fa79e(0x1c8)]({'type':_0x2fa79e(0x277),'name':_0x14a6f1[_0x2fa79e(0x1f6)],'existingActivation':_0x14a6f1});}return _0x264b5e;}function calculateYamlDiff(_0x2b14a7,_0x46c7ab){if(_0x46c7ab){const _0x53b8d0=generateDiff(_0x46c7ab,_0x2b14a7),_0x24db97=hasChanges(_0x53b8d0);return{'isNew':![],'hasChanges':_0x24db97,'diff':_0x24db97?formatDiffWithColors(_0x53b8d0):undefined};}const _0x56955f=generateDiff('',_0x2b14a7);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x56955f)};}export function calculateSegmentDiff(_0x31464d,_0x486455,_0x501b94,_0xd1eac,_0x565270){const _0x28a23c=segmentToYamlString(_0x31464d),_0x1310bf=_0x486455?segmentToYamlString(segmentWithActivationsToYaml(_0x486455,_0x501b94,undefined,_0xd1eac,_0x565270)):undefined;return calculateYamlDiff(_0x28a23c,_0x1310bf);}export function calculateJourneyDiff(_0x21d8e9,_0x17fdf0){const _0x501dd5=normalizeJourneyDef(_0x21d8e9,_0x21d8e9),_0x364275=a114_0x823185(_0x501dd5),_0x40da7d=_0x17fdf0?a114_0x823185(normalizeJourneyDef(_0x17fdf0,_0x21d8e9)):undefined;return calculateYamlDiff(_0x364275,_0x40da7d);}export function findSegmentsToDelete(_0x1a4e8a,_0x532dd0,_0x4fe3cc,_0x71deae,_0xfce898){const _0x31607c=a114_0x3e8f2e,_0x207c97=new Set();for(const {yamlConfig:_0x27152b,folderPath:_0x25c315}of _0x532dd0){_0x207c97['add'](_0x25c315+':'+_0x27152b[_0x31607c(0x1f6)]);}return _0x1a4e8a['filter'](_0x4e2012=>{const _0x106cb0=_0x31607c,_0x73a269=_0x4e2012[_0x106cb0(0x21e)]?_0x4fe3cc['get'](_0x4e2012[_0x106cb0(0x21e)][_0x106cb0(0x1bf)]())||'':'',_0x351b3a=_0x73a269+':'+_0x4e2012['name'];if(_0x207c97[_0x106cb0(0x27e)](_0x351b3a))return![];if(_0xfce898)return _0x73a269===_0x71deae||_0x73a269['startsWith'](_0x71deae+'/');return!![];});}export function findJourneysToDelete(_0x53a36e,_0x12decb,_0x2b161f,_0x4f6be9,_0x1e6232){const _0x5a9ba5=a114_0x3e8f2e,_0x10507b=new Set();for(const {yamlConfig:_0x5d62b1,folderPath:_0x2cdc9e}of _0x12decb){_0x10507b[_0x5a9ba5(0x234)](_0x2cdc9e+':'+_0x5d62b1[_0x5a9ba5(0x1f6)]);}return _0x53a36e[_0x5a9ba5(0x29e)](_0x555a0c=>{const _0x1546d0=_0x5a9ba5,_0x3c4244=_0x555a0c[_0x1546d0(0x27d)]?_0x2b161f['get'](_0x555a0c[_0x1546d0(0x27d)])||'':'',_0x33e5f5=_0x3c4244+':'+_0x555a0c[_0x1546d0(0x25b)];if(_0x10507b['has'](_0x33e5f5))return![];if(_0x1e6232)return _0x3c4244===_0x4f6be9||_0x3c4244[_0x1546d0(0x28c)](_0x4f6be9+'/');return!![];});}export function buildSegmentLookupMap(_0x4d38fd,_0x1e5159){const _0x16ab27=a114_0x3e8f2e,_0x3285d9=new Map();for(const _0x2e7150 of _0x4d38fd){const _0x1dc0ab=_0x2e7150[_0x16ab27(0x21e)]?_0x1e5159['get'](_0x2e7150[_0x16ab27(0x21e)][_0x16ab27(0x1bf)]())||'':'',_0x544ad0=_0x1dc0ab+':'+_0x2e7150[_0x16ab27(0x1f6)];_0x3285d9['set'](_0x544ad0,_0x2e7150);}return _0x3285d9;}export function buildSegmentNameToIdMap(_0x2f1951){const _0x256a61=a114_0x3e8f2e,_0x7e70f8=new Map();for(const _0x15704c of _0x2f1951){_0x7e70f8[_0x256a61(0x22a)](_0x15704c['name'],_0x15704c['id']);}return _0x7e70f8;}export function buildJourneyBundleLookupMap(_0x4f1eb9,_0xd06fc6){const _0x29d43b=a114_0x3e8f2e,_0x440e59=new Map();for(const _0x475827 of _0x4f1eb9){const _0x684217=_0x475827[_0x29d43b(0x27d)]?_0xd06fc6[_0x29d43b(0x1f1)](_0x475827['folderId'])||'':'',_0x4f30f3=_0x684217+':'+_0x475827[_0x29d43b(0x25b)];!_0x440e59[_0x29d43b(0x27e)](_0x4f30f3)&&_0x440e59['set'](_0x4f30f3,[]),_0x440e59[_0x29d43b(0x1f1)](_0x4f30f3)[_0x29d43b(0x1c8)](_0x475827);}for(const _0xca1416 of _0x440e59[_0x29d43b(0x201)]()){_0xca1416[_0x29d43b(0x1d1)]((_0x3d3351,_0x46c174)=>(_0x3d3351['versionNumber']||0x0)-(_0x46c174[_0x29d43b(0x25e)]||0x0));}return _0x440e59;}export function collectFoldersToCreate(_0x208546,_0x10d53b){const _0x2366da=a114_0x3e8f2e,_0x4c0d83=new Set();for(const _0x35fc85 of _0x208546){if(!_0x35fc85)continue;if(_0x10d53b[_0x2366da(0x27e)](_0x35fc85))continue;const _0x5d3dc9=_0x35fc85[_0x2366da(0x1b2)]('/');let _0x53f94a='';for(const _0x514215 of _0x5d3dc9){_0x53f94a=_0x53f94a?_0x53f94a+'/'+_0x514215:_0x514215,!_0x10d53b['has'](_0x53f94a)&&_0x4c0d83[_0x2366da(0x234)](_0x53f94a);}}return _0x4c0d83;}export function parseAndClassifyYamlFiles(_0x1c7085,_0x583c8b,_0x23dd1d){const _0x3bf659=a114_0x3e8f2e,_0x11d0e8=[],_0x1a5152=[];for(const _0x494376 of _0x1c7085){const _0x23fda6=a114_0xfecf44[_0x3bf659(0x287)](_0x583c8b,a114_0xfecf44[_0x3bf659(0x230)](_0x494376)),_0x2e1821=_0x23fda6==='.'?'':_0x23fda6,_0x2a255b=readFileSync(_0x494376,_0x3bf659(0x200)),_0x2a9dfc=a114_0x36eefc[_0x3bf659(0x226)](_0x2a255b);if(isJourneyDef(_0x2a9dfc)){const _0x1dc484=a114_0x461563(_0x2a255b);_0x1a5152[_0x3bf659(0x1c8)]({'yamlConfig':_0x1dc484,'folderPath':_0x2e1821,'sourcePath':_0x494376});}else{if(!_0x23dd1d?.['skipSegments']){const _0x3b1ebb=parseSegmentYamlFile(_0x2a255b),_0x47c075=normalizeChildSegmentYaml(_0x3b1ebb);_0x11d0e8[_0x3bf659(0x1c8)]({'yamlConfig':_0x47c075,'folderPath':_0x2e1821,'sourcePath':_0x494376});}}}return{'segments':_0x11d0e8,'journeys':_0x1a5152};}export function validateParsedFiles(_0x5c2662,_0x31713f){const _0x5c230d=a114_0x3e8f2e,_0xc1401d=[];for(const {yamlConfig:_0xc80025,sourcePath:_0x5401c1}of _0x5c2662[_0x5c230d(0x210)]){const _0x346c0f=readFileSync(_0x5401c1,'utf-8'),_0x500f2e=a114_0x36eefc[_0x5c230d(0x1cc)](_0x346c0f),_0x40a21a=validateSegmentDef(_0xc80025,{'source':_0x346c0f,'document':_0x500f2e});if(!_0x40a21a[_0x5c230d(0x298)]){const _0x58d85e=a114_0xfecf44[_0x5c230d(0x287)](_0x31713f,_0x5401c1);_0xc1401d[_0x5c230d(0x1c8)]({'filePath':_0x58d85e,'source':_0x346c0f,'result':_0x40a21a,'isJourney':![]});}}for(const {yamlConfig:_0x3a76db,sourcePath:_0x303a6a}of _0x5c2662[_0x5c230d(0x1ec)]){const _0x2f0679=readFileSync(_0x303a6a,_0x5c230d(0x200)),_0x22675e=a114_0x36eefc[_0x5c230d(0x1cc)](_0x2f0679),_0x5866c5=validateJourneyDef(_0x3a76db,{'source':_0x2f0679,'document':_0x22675e});if(!_0x5866c5[_0x5c230d(0x298)]){const _0x15114c=a114_0xfecf44[_0x5c230d(0x287)](_0x31713f,_0x303a6a);_0xc1401d[_0x5c230d(0x1c8)]({'filePath':_0x15114c,'source':_0x2f0679,'result':_0x5866c5,'isJourney':!![]});}}return _0xc1401d;}export function formatValidationErrors(_0x58aab1){const _0x553d60=a114_0x3e8f2e,_0x2d3176=[];for(const {filePath:_0x2ddd37,source:_0x179cf0,result:_0x31f936,isJourney:_0x1229aa}of _0x58aab1){const _0x15cb4a=_0x1229aa?'journey':_0x553d60(0x1e7);_0x2d3176['push']('\x0a'+_0x2ddd37+'\x20('+_0x15cb4a+_0x553d60(0x1a8)+_0x31f936[_0x553d60(0x273)][_0x553d60(0x1b7)]+_0x553d60(0x1a7)),_0x2d3176[_0x553d60(0x1c8)](formatValidationResult(_0x31f936,_0x179cf0,_0x2ddd37));}return _0x2d3176[_0x553d60(0x1bb)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x102da5){const _0x35f09b=a114_0x3e8f2e,_0x526cf6=new Set(),_0x952e0=new Map(),_0x2a8417=collectSegmentUsageCounts(_0x102da5);if(_0x102da5['segments'])for(const [_0x51f678,_0x3cc5ba]of Object[_0x35f09b(0x259)](_0x102da5['segments'])){_0x526cf6[_0x35f09b(0x234)](_0x51f678);if(_0x3cc5ba[_0x35f09b(0x1a4)]){const _0x479776=yamlRuleToApi(_0x3cc5ba[_0x35f09b(0x1a4)]),_0x464286=apiRuleToYaml(_0x479776);_0x952e0['set'](_0x51f678,_0x464286);}}const _0x27f7a0=new Map();let _0x4b8a3c=0x0;for(const [_0x28ee4c,_0x454e70]of _0x952e0){const _0x59fe4a=serializeExpandedRule(_0x454e70,_0x952e0),_0x152927=_0x27f7a0[_0x35f09b(0x1f1)](_0x59fe4a)||[];_0x152927[_0x35f09b(0x1c8)]({'name':_0x28ee4c,'index':_0x4b8a3c}),_0x27f7a0[_0x35f09b(0x22a)](_0x59fe4a,_0x152927),_0x4b8a3c++;}const _0x3fdc9a=new Map();for(const [_0x267958,_0x23132f]of _0x27f7a0){const _0x4a401f=_0x23132f[_0x35f09b(0x1cb)]()[_0x35f09b(0x1d1)]((_0x1c78cb,_0x4f7d2c)=>{const _0x3f2023=_0x35f09b,_0xa07e58=_0x2a8417[_0x3f2023(0x1f1)](_0x1c78cb['name'])||0x0,_0x42a489=_0x2a8417['get'](_0x4f7d2c['name'])||0x0;if(_0xa07e58!==_0x42a489)return _0x42a489-_0xa07e58;return _0x1c78cb['index']-_0x4f7d2c['index'];})[_0x35f09b(0x1fe)](_0x518e30=>_0x518e30['name']),_0x1e9f57=[];for(const _0x19759a of _0x4a401f){const _0x1a8299=_0x2a8417[_0x35f09b(0x1f1)](_0x19759a)||0x0,_0x76e7d3=Math[_0x35f09b(0x212)](_0x1a8299,0x1);for(let _0x41374e=0x0;_0x41374e<_0x76e7d3;_0x41374e++){_0x1e9f57['push'](_0x19759a);}}_0x3fdc9a[_0x35f09b(0x22a)](_0x267958,_0x1e9f57);}return{'existingLocalSegmentNames':_0x526cf6,'localSegmentRules':_0x952e0,'localExpandedRuleToNames':_0x3fdc9a};}export function createSegmentIdResolver(_0xb1a7fa,_0x4d3f38){return async _0x27328f=>{const _0x4f61a5=a114_0x3785,_0x37ee1c=_0xb1a7fa[_0x4f61a5(0x1f1)](_0x27328f);if(!_0x37ee1c)throw new SDKError(ErrorCode[_0x4f61a5(0x1da)],_0x4f61a5(0x206)+_0x27328f+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x4d3f38+'\x27)');return _0x37ee1c;};}export function extractRootFolderId(_0x539f52){const _0x55f334=a114_0x3e8f2e;return _0x539f52['relationships']?.[_0x55f334(0x1d6)]?.[_0x55f334(0x257)]?.['id']||_0x539f52[_0x55f334(0x1f5)]?.[_0x55f334(0x1f7)]?.[_0x55f334(0x257)]?.['id'];}function a114_0x980c(){const _0x391c7d=['connectionIdToNameMap','createdSegmentIds','parentId','valid','createFolder','getSegmentEntity','Segment\x20not\x20found','SEGMENT_UPDATE_ERROR','folder_created','filter','logDeleted','absolutePath','waitStepUnit','flatMap','rule','logSuccess','embedded_segment_created','\x20error(s)','):\x20','steps','user','withProgress','journey','Created\x20activation\x20\x27','journey_created','journeyActivationNameToId','./child-segment-yaml.js','16ZPxjRg','split','onProgress','embedded_segment_creating','validatedRequest','Entry\x20criteria:\x20','length','list','Fetching\x20','activationStepsById','join','waitStep','goal','entry_criteria','toString','604256wKkEtE','folderPathToId','create','\x27\x20wait\x20condition','6QpuyYq','\x27\x20not\x20found\x20in\x20journey\x20\x27','conditionTimeoutUnit','debug','push','Updating\x20segment\x20\x27','Created\x20folder\x20\x27','slice','parseDocument','Failed\x20to\x20resolve\x20activation\x20','segmentByFolderAndName','connection','Condition','sort','draft','null','ACTIVATION_UPDATE_ERROR','Creating\x20segment\x20\x27','parentSegmentFolder','folder','Deleted\x20segment\x20\x27','\x27...','SEGMENT_NOT_FOUND','__pending_act_','journey_entry_criteria_','JOURNEY_SYNTAX_ERROR','../../utils/async.js','activations','existingActivation',').\x20','buildUserMaps','activation_creating','createdSegmentId','isNew','Deleting\x20activation\x20\x27','segment','hasChanges','state','Embedded\x20segment\x20\x27','conditionTimeoutDuration','journeys','update','fetchJourney','activation_created','JOURNEY_UPDATE_ERROR','get','branches','message','find','relationships','name','parentFolder','Created\x20segment\x20\x27','existingJourney','notification','stage\x20\x27','activationActions','resolveSegment','map','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','utf-8','values','type','exitCriterias','conditions','journeyId','Segment\x20not\x20found:\x20','activation_','run_after_journey_refresh','object','Creating\x20folder\x20\x27','segment_deleting','NOT_FOUND','segmentNameToId','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','milestone','segments','219774fgBjhe','max','\x27\x20from\x20file:\x20','progress','3939040GnZjTL','deps','keys','uniqueServerName','resolvedRule','deleted','logWarning','./journey-yaml.js','createActivation','segmentFolderId','journeyById','localName','getActivation','size','Activation','item','action','parse','updateSegmentById','entryCriteria','rootFolderId','set','logInfo','journeyStages','1649460OLvrJz','attributes','listActivations','dirname','conditionSegmentId','createJourneySegment','journeyActivationStepId','add','stringify','segment_deleted','toISOString','journey_creating','behavior','journey_updated','segment_updated',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','segment_created','segment_updating','WaitStep','resolveJourneyId','497932GpOUBp','from','\x20(referenced\x20in\x20journey\x20','getSegmentEntity\x20also\x20failed\x20for\x20','decision_point','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','embedded_activation_created','activation_updating','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','created','Failed\x20to\x20fetch\x20referenced\x20segment\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','\x20segment\x20from\x20file:\x20','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','createSegment','\x27\x20milestone','uniqueSegmentName','1618317pZzSKI','\x27\x20exit\x20criteria','nameToType','connector_config','folder_creating','data','440465bUFzIC','entries','Duration','journeyBundleName','some','Updated\x20segment\x20\x27','versionNumber','segment_creating','journeyBundlesByFolderAndName','unchanged','INTERNAL','\x20journey\x20from\x20file:\x20','Failed\x20to\x20','getSegment','tdx.sdk.push-workflow','results','idToEmailMap','updated','Journey\x20\x27','DecisionPoint','deleteActivation','embeddedSegmentNameToId','yamlActivation','embedded_activation_creating','existingSegment','getSegment\x20failed\x20for\x20','all_columns','errors','updateActivation','Updated\x20activation\x20\x27','getJourney','delete','\x0a\x20\x20','activationContext','deleteSegment','goal\x20criteria','toLowerCase','folderId','has','waitStepType','diff','Created\x20journey\x20\x27','schedule','and\x20the\x20server\x20segment,\x20then\x20retry.','existingSegments','description','journeyName','relative','activationParams','all','Updated\x20journey\x20\x27','replace','startsWith','Name\x20has\x20already\x20been\x20taken','includes','yamlConfig','Updating\x20activation\x20\x27','with','folderPath','entry','segmentId'];a114_0x980c=function(){return _0x391c7d;};return a114_0x980c();}function a114_0x3785(_0x39d026,_0x227904){_0x39d026=_0x39d026-0x1a3;const _0x980c4a=a114_0x980c();let _0x3785ef=_0x980c4a[_0x39d026];return _0x3785ef;}export function buildConnectionMaps(_0x2b43a5){const _0x174ac6=a114_0x3e8f2e,_0x39c22e=new Map(),_0x55ac0b=new Map(),_0x498d9b=new Map();for(const _0x649eb7 of _0x2b43a5){_0x39c22e[_0x174ac6(0x22a)](_0x649eb7[_0x174ac6(0x1f6)],parseInt(_0x649eb7['id'],0xa)),_0x55ac0b[_0x174ac6(0x22a)](_0x649eb7['id'],_0x649eb7[_0x174ac6(0x1f6)]),_0x498d9b[_0x174ac6(0x22a)](_0x649eb7[_0x174ac6(0x1f6)],_0x649eb7['type']);}return{'nameToId':_0x39c22e,'idToName':_0x55ac0b,'nameToType':_0x498d9b};}export function calculatePushStats(_0xde2083,_0x4d54ef,_0x4a665b,_0x5a26b3,_0xc0a563,_0x3e3106,_0x1e6e94){const _0x3efec7=a114_0x3e8f2e,_0x6efff0=_0xde2083[_0x3efec7(0x29e)](_0x422c0b=>_0x422c0b['isNew']),_0x37ea06=_0xde2083['filter'](_0x45c4f5=>!_0x45c4f5[_0x3efec7(0x1e5)]&&_0x45c4f5[_0x3efec7(0x1e8)]),_0x541f51=_0xde2083[_0x3efec7(0x29e)](_0x53fce7=>!_0x53fce7['isNew']&&!_0x53fce7[_0x3efec7(0x1e8)]),_0x1cf4fd=_0x3e3106?_0x5a26b3:[],_0x1f34e9=_0x4d54ef[_0x3efec7(0x29e)](_0x40f3ce=>_0x40f3ce[_0x3efec7(0x1e5)]),_0x14d3d0=_0x4d54ef['filter'](_0x2096e5=>!_0x2096e5[_0x3efec7(0x1e5)]&&_0x2096e5['hasChanges']),_0x57ef5b=_0x4d54ef[_0x3efec7(0x29e)](_0x3f3174=>!_0x3f3174[_0x3efec7(0x1e5)]&&!_0x3f3174[_0x3efec7(0x1e8)]),_0x429850=_0x3e3106?_0xc0a563:[],_0x2a9edd=_0xde2083[_0x3efec7(0x1a3)](_0x326dc3=>_0x326dc3['activationActions']),_0x4c089f=_0x2a9edd[_0x3efec7(0x29e)](_0x380b42=>_0x380b42[_0x3efec7(0x202)]===_0x3efec7(0x1c2)),_0x5b9735=_0x2a9edd['filter'](_0x4d2f8d=>_0x4d2f8d['type']===_0x3efec7(0x1ed)),_0x30f0fd=_0x2a9edd[_0x3efec7(0x29e)](_0x3e1cbe=>_0x3e1cbe[_0x3efec7(0x202)]===_0x3efec7(0x277)),_0x5a325a=Array['from'](_0x4a665b)['sort'](),_0x1eaf88=_0x1e6e94?![]:_0x6efff0[_0x3efec7(0x1b7)]>0x0||_0x37ea06[_0x3efec7(0x1b7)]>0x0||_0x1cf4fd[_0x3efec7(0x1b7)]>0x0,_0x52ea7d=_0x1f34e9[_0x3efec7(0x1b7)]>0x0||_0x14d3d0[_0x3efec7(0x1b7)]>0x0||_0x429850[_0x3efec7(0x1b7)]>0x0,_0x31f253=_0x1e6e94?![]:_0x2a9edd['length']>0x0,_0x16db37=_0x5a325a[_0x3efec7(0x1b7)]>0x0;return{'segments':{'new':_0x6efff0,'changed':_0x37ea06,'unchanged':_0x541f51,'toDelete':_0x1cf4fd},'journeys':{'new':_0x1f34e9,'changed':_0x14d3d0,'unchanged':_0x57ef5b,'toDelete':_0x429850},'activations':{'all':_0x2a9edd,'toCreate':_0x4c089f,'toUpdate':_0x5b9735,'toDelete':_0x30f0fd},'folders':{'toCreate':_0x5a325a},'counts':{'segments':{'new':_0x6efff0['length'],'changed':_0x37ea06[_0x3efec7(0x1b7)],'unchanged':_0x541f51['length'],'toDelete':_0x1cf4fd[_0x3efec7(0x1b7)]},'journeys':{'new':_0x1f34e9[_0x3efec7(0x1b7)],'changed':_0x14d3d0[_0x3efec7(0x1b7)],'unchanged':_0x57ef5b[_0x3efec7(0x1b7)],'toDelete':_0x429850[_0x3efec7(0x1b7)]},'activations':{'create':_0x4c089f[_0x3efec7(0x1b7)],'update':_0x5b9735['length'],'delete':_0x30f0fd[_0x3efec7(0x1b7)]},'folders':_0x5a325a[_0x3efec7(0x1b7)]},'hasChanges':_0x1eaf88||_0x52ea7d||_0x31f253||_0x16db37};}export async function buildPushExecutionContext(_0x19315b,_0x172f3c,_0xc3942c,_0x5dc705,_0x258bed,_0x43066c){const _0x5c9c08=a114_0x3e8f2e,_0x30c637=extractRootFolderId(_0xc3942c),{pathToId:_0x12e92a,idToPath:_0x3394b6}=buildFolderMaps(_0x258bed),_0x1effd8=buildSegmentNameToIdMap(_0x5dc705),_0x462b33=new Map(),{batchAsync:_0x32003f}=await import(_0x5c9c08(0x1de)),[_0x41d0f7,_0x499ae0]=await Promise['all']([_0x19315b[_0x5c9c08(0x1aa)][_0x5c9c08(0x1e2)](),_0x19315b[_0x5c9c08(0x1cf)][_0x5c9c08(0x1b8)](),((async()=>{const _0x6132a6=_0x5c9c08;!_0x43066c&&_0x5dc705[_0x6132a6(0x1b7)]>0x0&&await _0x32003f(_0x5dc705,async _0x2a0ea3=>{const _0x72751a=_0x6132a6,_0x185fe5=await _0x19315b[_0x72751a(0x1e7)][_0x72751a(0x22f)](_0x172f3c,_0x2a0ea3['id']);_0x462b33[_0x72751a(0x22a)](_0x2a0ea3['id'],_0x185fe5);});})())]),{emailToId:_0x33fc83,idToEmail:_0x28c249}=_0x41d0f7,_0x41f27a=buildConnectionMaps(_0x499ae0);return{'rootFolderId':_0x30c637,'folderPathToId':_0x12e92a,'folderIdToPath':_0x3394b6,'segmentNameToId':_0x1effd8,'activationsBySegmentId':_0x462b33,'emailToIdMap':_0x33fc83,'idToEmailMap':_0x28c249,'connectionNameToIdMap':_0x41f27a['nameToId'],'connectionIdToNameMap':_0x41f27a['idToName'],'connectionNameToTypeMap':_0x41f27a[_0x5c9c08(0x254)]};}export function createPushYamlContextForBundle(_0x16ea0a,_0x131fed,_0x118f87,_0xee91ec,_0x41c282,_0x5aa663,_0x4d8a6a,_0x26727a){const {existingLocalSegmentNames:_0x3ce56a,localExpandedRuleToNames:_0x59f402}=_0xee91ec,_0x11083b=new Set(),_0x52d8bc=new Map(),_0x1b6c4f=new Map(),_0x489b7c=new Map(),_0x42ffb7=createJumpTargetCache(),_0x3d0bd8=new Map(),_0x28176d=new Map(),_0x451c99=new Set();let _0x534785;const _0x30c36a=_0x1726a1=>{const _0x183bc9={'resolveSegment':async _0x33d136=>{const _0x56552e=a114_0x3785,_0x5ea13d=_0x489b7c['get'](_0x33d136);if(_0x5ea13d!==undefined)return{'name':_0x5ea13d,'isJourneyLocal':!![]};try{const _0x265d57=await fetchSegment(_0x16ea0a,_0x131fed,_0x33d136,_0x118f87);if(!_0x265d57)throw new Error(_0x56552e(0x29b));const _0x2c81bd=generateJourneyLocalName(_0x265d57[_0x56552e(0x1f6)]),_0xed8a12=_0x265d57['kind']===SEGMENT_KIND_JOURNEY&&_0x2c81bd!==undefined;let _0x18682f=_0x265d57[_0x56552e(0x1f6)],_0x2db3ac;if(_0xed8a12&&_0x265d57[_0x56552e(0x1a4)]){const _0x354086=apiRuleToYaml(_0x265d57['rule']);_0x28176d[_0x56552e(0x22a)](_0x33d136,_0x354086);const _0x12a9df=async _0x4a74bd=>{const _0x5eab69=_0x56552e,_0x303f26=collectSegmentRefsFromRule(_0x4a74bd);for(const _0x41d856 of _0x303f26){if(!_0x28176d[_0x5eab69(0x27e)](_0x41d856))try{const _0x24f9e2=await fetchSegment(_0x16ea0a,_0x131fed,_0x41d856,_0x118f87);if(_0x24f9e2?.['rule']){const _0x458062=apiRuleToYaml(_0x24f9e2[_0x5eab69(0x1a4)]);_0x28176d[_0x5eab69(0x22a)](_0x41d856,_0x458062),await _0x12a9df(_0x458062);}}catch(_0x52e156){logger[_0x5eab69(0x1c7)](_0x5eab69(0x24b)+_0x41d856+':\x20'+_0x52e156);}}};await _0x12a9df(_0x354086);const _0x4a3d08=serializeExpandedRule(_0x354086,_0x28176d),_0x5c1ac9=_0x59f402[_0x56552e(0x1f1)](_0x4a3d08);if(_0x5c1ac9&&_0x5c1ac9[_0x56552e(0x1b7)]>0x0){const _0x389124=_0x52d8bc[_0x56552e(0x1f1)](_0x4a3d08)||0x0,_0x51e476=_0x5c1ac9[_0x389124]||_0x5c1ac9[_0x5c1ac9[_0x56552e(0x1b7)]-0x1];_0x52d8bc[_0x56552e(0x22a)](_0x4a3d08,_0x389124+0x1),_0x18682f=_0x51e476,_0x11083b['add'](_0x18682f),_0x489b7c[_0x56552e(0x22a)](_0x33d136,_0x18682f);const _0x3febf2=await resolveRuleSegmentRefs(_0x354086,async _0x1e0949=>{const _0xa09d01=_0x56552e,_0x2dce73=_0x489b7c['get'](_0x1e0949);if(_0x2dce73)return _0x2dce73;const _0x3cb279=await _0x534785[_0xa09d01(0x1fd)](_0x1e0949);return _0x3cb279[_0xa09d01(0x1f6)];});_0x2db3ac={'description':_0x265d57[_0x56552e(0x285)],'rule':_0x3febf2};}else{const _0x1192ff=_0x3d0bd8[_0x56552e(0x1f1)](_0x4a3d08);if(_0x1192ff)_0x18682f=_0x1192ff,_0x489b7c[_0x56552e(0x22a)](_0x33d136,_0x18682f);else{if(_0x2c81bd){let _0x500ee8=_0x2c81bd,_0x269a38=0x2;while(_0x11083b[_0x56552e(0x27e)](_0x500ee8)||_0x3ce56a[_0x56552e(0x27e)](_0x500ee8)){_0x500ee8=_0x2c81bd+'_'+_0x269a38,_0x269a38++;}_0x11083b['add'](_0x500ee8),_0x18682f=_0x500ee8;}_0x489b7c[_0x56552e(0x22a)](_0x33d136,_0x18682f),_0x3d0bd8['set'](_0x4a3d08,_0x18682f);const _0x201f48=await resolveRuleSegmentRefs(_0x354086,async _0x30f80f=>{const _0x5381f8=_0x56552e,_0x26662c=_0x489b7c['get'](_0x30f80f);if(_0x26662c)return _0x26662c;const _0x57aead=await _0x534785[_0x5381f8(0x1fd)](_0x30f80f);return _0x57aead[_0x5381f8(0x1f6)];});_0x2db3ac={'description':_0x265d57[_0x56552e(0x285)],'rule':_0x201f48};}}}return{'name':_0x18682f,'isJourneyLocal':_0xed8a12,'definition':_0x2db3ac};}catch(_0x500c59){return logger[_0x56552e(0x1c7)]('Failed\x20to\x20resolve\x20segment\x20'+_0x33d136+':\x20'+_0x500c59),{'name':_0x33d136,'isJourneyLocal':![]};}},'resolveActivation':async _0x3f6891=>{const _0x1c0fd5=a114_0x3785,_0x36688c=_0x1b6c4f[_0x1c0fd5(0x1f1)](_0x3f6891);if(_0x36688c!==undefined)return{'name':_0x36688c,'isJourneyLocal':!![]};try{let _0x9df16e=_0x4d8a6a?.[_0x1c0fd5(0x1f1)](_0x3f6891);!_0x9df16e&&(_0x9df16e=await _0x16ea0a[_0x1c0fd5(0x1ac)][_0x1c0fd5(0x221)](_0x1726a1,_0x3f6891));const _0x3fea65=_0x9df16e['attributes'][_0x1c0fd5(0x288)][_0x1c0fd5(0x1f6)]||_0x3f6891,_0x273278=sanitizeYamlKey(_0x3fea65)||_0x1c0fd5(0x207)+_0x3f6891,_0x56049e=_0x273278;_0x1b6c4f[_0x1c0fd5(0x22a)](_0x3f6891,_0x56049e);const _0x34a714=journeyActivationStepToYaml(_0x9df16e,_0x41c282,_0x5aa663);return{'name':_0x56049e,'isJourneyLocal':!![],'definition':_0x34a714};}catch(_0x356204){return logger[_0x1c0fd5(0x1c7)](_0x1c0fd5(0x1cd)+_0x3f6891+':\x20'+_0x356204),{'name':_0x3f6891,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2d0b20,_0x39c32b)=>resolveJumpTarget(_0x2d0b20,_0x39c32b,_0x42ffb7,async _0x1a80fb=>{const _0x1a9997=a114_0x3785,_0x474492=_0x26727a?.[_0x1a9997(0x1f1)](_0x1a80fb);if(_0x474492)return _0x474492;return _0x16ea0a[_0x1a9997(0x1ac)][_0x1a9997(0x276)](_0x1a80fb);})};return _0x534785=_0x183bc9,_0x183bc9;},_0x5266b5=async _0x53af22=>{const _0x8063d0=a114_0x3785,{collectSegmentIdsFromJourneyApi:_0x2b8f48}=await import('./journey-yaml.js'),{batchAsync:_0x3ec9f6}=await import(_0x8063d0(0x1de)),_0x1c809b=new Set();for(const _0x46b337 of _0x53af22){let _0x57de8e=_0x26727a?.[_0x8063d0(0x1f1)](_0x46b337);!_0x57de8e&&(_0x57de8e=await _0x16ea0a['journey'][_0x8063d0(0x276)](_0x46b337));const _0x5ae21d=_0x2b8f48(_0x57de8e);for(const _0x5386b7 of _0x5ae21d){_0x1c809b[_0x8063d0(0x234)](_0x5386b7);}}let _0x30388b=Array[_0x8063d0(0x242)](_0x1c809b);while(_0x30388b[_0x8063d0(0x1b7)]>0x0){const _0x2e9491=_0x30388b[_0x8063d0(0x29e)](_0x24d9e3=>!_0x451c99[_0x8063d0(0x27e)](_0x24d9e3));if(_0x2e9491['length']===0x0)break;const _0x4dbc8b=await _0x3ec9f6(_0x2e9491,async _0x439a3c=>{_0x451c99['add'](_0x439a3c);const _0x36f5b0=await fetchSegment(_0x16ea0a,_0x131fed,_0x439a3c,_0x118f87);if(!_0x36f5b0)return null;return{'segmentId':_0x439a3c,'segment':_0x36f5b0};},0xa),_0x4d36a4=new Set();for(const _0x95378b of _0x4dbc8b){if(!_0x95378b?.[_0x8063d0(0x1e7)]?.[_0x8063d0(0x1a4)])continue;const _0x62bf7a=apiRuleToYaml(_0x95378b['segment'][_0x8063d0(0x1a4)]);_0x28176d['set'](_0x95378b[_0x8063d0(0x294)],_0x62bf7a);const _0x1636dc=collectSegmentRefsFromRule(_0x62bf7a);for(const _0x268867 of _0x1636dc){!_0x451c99[_0x8063d0(0x27e)](_0x268867)&&_0x4d36a4[_0x8063d0(0x234)](_0x268867);}}_0x30388b=Array['from'](_0x4d36a4);}};return{'createYamlContext':_0x30c36a,'prefetchJourneySegments':_0x5266b5};}export async function executePushSegments(_0x222a85,_0x596489,_0x15f344,_0x2e541b,_0x5e35dd){const _0x1a3ebb=a114_0x3e8f2e,{segmentDefToCreateRequest:_0x55b81e,segmentDefToUpdateRequest:_0x2e1eb1}=await import(_0x1a3ebb(0x1b0)),_0x3d2ace=_0x15f344[_0x1a3ebb(0x1c1)],_0x1cbf09=0x5,_0x49f646=async _0x5d8480=>{const _0x1f3211=_0x1a3ebb,_0x34d005=_0x5d8480[_0x1f3211(0x292)]?_0x3d2ace['get'](_0x5d8480['folderPath']):undefined;let _0x5e1283;const _0x55bf01={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5d8480[_0x1f3211(0x1e5)]){_0x5e35dd[_0x1f3211(0x1b3)]?.({'type':_0x1f3211(0x25f),'name':_0x5d8480[_0x1f3211(0x28f)]['name']});const _0x100e09=_0x55b81e(_0x5d8480[_0x1f3211(0x28f)],_0x34d005),_0x42dba3=await _0x5e35dd[_0x1f3211(0x1ab)](_0x1f3211(0x1d5)+_0x5d8480['yamlConfig'][_0x1f3211(0x1f6)]+_0x1f3211(0x1d9),()=>_0x222a85[_0x1f3211(0x1e7)][_0x1f3211(0x24f)](_0x2e541b[_0x1f3211(0x297)],_0x100e09));_0x5e1283=_0x42dba3['data']['id'],_0x55bf01[_0x1f3211(0x1e4)]={'name':_0x5d8480[_0x1f3211(0x28f)][_0x1f3211(0x1f6)],'id':_0x5e1283},_0x5e35dd[_0x1f3211(0x1b3)]?.({'type':_0x1f3211(0x23d),'name':_0x5d8480[_0x1f3211(0x28f)]['name'],'segmentId':_0x5e1283}),_0x5e35dd[_0x1f3211(0x1a5)]?.(_0x1f3211(0x1f8)+_0x5d8480[_0x1f3211(0x28f)]['name']+'\x27'),_0x55bf01[_0x1f3211(0x24a)]=0x1;}else{if(_0x5d8480['hasChanges']){_0x5e35dd['onProgress']?.({'type':_0x1f3211(0x23e),'name':_0x5d8480['yamlConfig']['name']});const _0x345742=_0x2e1eb1(_0x5d8480[_0x1f3211(0x28f)]);_0x34d005!==_0x5d8480[_0x1f3211(0x270)]?.[_0x1f3211(0x21e)]&&(_0x345742[_0x1f3211(0x21e)]=_0x34d005?parseInt(_0x34d005,0xa):undefined),await _0x5e35dd['withProgress'](_0x1f3211(0x1c9)+_0x5d8480[_0x1f3211(0x28f)][_0x1f3211(0x1f6)]+'\x27...',()=>_0x222a85[_0x1f3211(0x1e7)][_0x1f3211(0x227)](_0x2e541b[_0x1f3211(0x297)],_0x5d8480[_0x1f3211(0x270)]['id'],_0x345742)),_0x5e1283=_0x5d8480[_0x1f3211(0x270)]['id'],_0x5e35dd[_0x1f3211(0x1b3)]?.({'type':_0x1f3211(0x23b),'name':_0x5d8480[_0x1f3211(0x28f)][_0x1f3211(0x1f6)]}),_0x5e35dd[_0x1f3211(0x1a5)]?.(_0x1f3211(0x25d)+_0x5d8480[_0x1f3211(0x28f)][_0x1f3211(0x1f6)]+'\x27'),_0x55bf01[_0x1f3211(0x269)]=0x1;}else _0x5e1283=_0x5d8480[_0x1f3211(0x270)]['id'];}}catch(_0x3e3a4b){const _0x47c679=isHttp400Error(_0x3e3a4b),_0x4f4157=_0x47c679?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1f3211(0x29c)],_0x3071ef=getErrorMessage(_0x3e3a4b);throw new SDKError(_0x4f4157,_0x1f3211(0x264)+(_0x5d8480['isNew']?_0x1f3211(0x1c2):_0x1f3211(0x1ed))+_0x1f3211(0x24d)+_0x5d8480[_0x1f3211(0x2a0)]+_0x1f3211(0x278)+_0x3071ef,_0x3e3a4b);}try{const _0x55cb28=await syncActivationsForSegment(_0x222a85,_0x2e541b[_0x1f3211(0x297)],_0x5e1283,_0x5d8480['yamlConfig'][_0x1f3211(0x1f6)],_0x5d8480[_0x1f3211(0x1fc)],_0x5e35dd,_0x5d8480['absolutePath']);_0x55bf01[_0x1f3211(0x1df)]=_0x55cb28;}catch(_0x158fe6){if(_0x158fe6 instanceof SDKError)throw _0x158fe6;throw new SDKError(ErrorCode[_0x1f3211(0x1d4)],_0x1f3211(0x20e)+_0x5d8480[_0x1f3211(0x28f)][_0x1f3211(0x1f6)]+_0x1f3211(0x213)+_0x5d8480[_0x1f3211(0x2a0)]+_0x1f3211(0x278)+getErrorMessage(_0x158fe6),_0x158fe6);}return _0x55bf01;},_0x3491af=await batchAsync(_0x596489,_0x49f646,_0x1cbf09),_0x20c291={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x41545f of _0x3491af){_0x20c291['created']+=_0x41545f[_0x1a3ebb(0x24a)],_0x20c291[_0x1a3ebb(0x269)]+=_0x41545f[_0x1a3ebb(0x269)],_0x41545f[_0x1a3ebb(0x1e4)]&&_0x20c291[_0x1a3ebb(0x296)][_0x1a3ebb(0x22a)](_0x41545f[_0x1a3ebb(0x1e4)][_0x1a3ebb(0x1f6)],_0x41545f['createdSegmentId']['id']),_0x20c291[_0x1a3ebb(0x1df)][_0x1a3ebb(0x24a)]+=_0x41545f[_0x1a3ebb(0x1df)][_0x1a3ebb(0x24a)],_0x20c291[_0x1a3ebb(0x1df)][_0x1a3ebb(0x269)]+=_0x41545f[_0x1a3ebb(0x1df)][_0x1a3ebb(0x269)],_0x20c291[_0x1a3ebb(0x1df)]['deleted']+=_0x41545f[_0x1a3ebb(0x1df)][_0x1a3ebb(0x21a)];}return _0x20c291;}async function syncActivationsForSegment(_0x51652c,_0x57d316,_0x2e30e0,_0x35855d,_0x32d612,_0x483a49,_0xd89e05){const _0x316569=a114_0x3e8f2e,_0x414149={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4ea5ab of _0x32d612){try{if(_0x4ea5ab['type']===_0x316569(0x1c2)&&_0x4ea5ab[_0x316569(0x1b5)])_0x483a49[_0x316569(0x1b3)]?.({'type':_0x316569(0x1e3),'segmentName':_0x35855d,'activationName':_0x4ea5ab[_0x316569(0x1f6)]}),await _0x483a49['withProgress']('Creating\x20activation\x20\x27'+_0x4ea5ab[_0x316569(0x1f6)]+'\x27...',()=>_0x51652c['segment'][_0x316569(0x21d)](_0x57d316,_0x2e30e0,_0x4ea5ab[_0x316569(0x1b5)])),_0x483a49[_0x316569(0x1b3)]?.({'type':_0x316569(0x1ef),'segmentName':_0x35855d,'activationName':_0x4ea5ab['name']}),_0x483a49[_0x316569(0x1a5)]?.(_0x316569(0x1ad)+_0x4ea5ab[_0x316569(0x1f6)]+'\x27'),_0x414149[_0x316569(0x24a)]++;else{if(_0x4ea5ab[_0x316569(0x202)]==='update'&&_0x4ea5ab['validatedRequest']&&_0x4ea5ab[_0x316569(0x1e0)])_0x483a49['onProgress']?.({'type':_0x316569(0x248),'segmentName':_0x35855d,'activationName':_0x4ea5ab[_0x316569(0x1f6)]}),await _0x483a49[_0x316569(0x1ab)](_0x316569(0x290)+_0x4ea5ab[_0x316569(0x1f6)]+_0x316569(0x1d9),()=>_0x51652c['segment'][_0x316569(0x274)](_0x57d316,_0x2e30e0,_0x4ea5ab[_0x316569(0x1e0)]['id'],_0x4ea5ab['validatedRequest'])),_0x483a49[_0x316569(0x1b3)]?.({'type':'activation_updated','segmentName':_0x35855d,'activationName':_0x4ea5ab[_0x316569(0x1f6)]}),_0x483a49[_0x316569(0x1a5)]?.(_0x316569(0x275)+_0x4ea5ab[_0x316569(0x1f6)]+'\x27'),_0x414149['updated']++;else _0x4ea5ab[_0x316569(0x202)]==='delete'&&_0x4ea5ab[_0x316569(0x1e0)]&&(_0x483a49[_0x316569(0x1b3)]?.({'type':'activation_deleting','segmentName':_0x35855d,'activationName':_0x4ea5ab[_0x316569(0x1f6)]}),await _0x483a49[_0x316569(0x1ab)](_0x316569(0x1e6)+_0x4ea5ab[_0x316569(0x1f6)]+_0x316569(0x1d9),()=>_0x51652c['segment'][_0x316569(0x26c)](_0x57d316,_0x2e30e0,_0x4ea5ab[_0x316569(0x1e0)]['id'])),_0x483a49['onProgress']?.({'type':'activation_deleted','segmentName':_0x35855d,'activationName':_0x4ea5ab[_0x316569(0x1f6)]}),_0x483a49['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x4ea5ab[_0x316569(0x1f6)]+'\x27'),_0x414149[_0x316569(0x21a)]++);}}catch(_0x3931d8){const _0x3de501=isHttp400Error(_0x3931d8),_0x3789c0=_0x3de501?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x316569(0x1d4)],_0x351eff=getErrorMessage(_0x3931d8);throw new SDKError(_0x3789c0,'Failed\x20to\x20'+_0x4ea5ab['type']+'\x20activation\x20\x27'+_0x4ea5ab[_0x316569(0x1f6)]+'\x27\x20from\x20file:\x20'+_0xd89e05+_0x316569(0x278)+_0x351eff,_0x3931d8);}}return _0x414149;}export async function executePushFolders(_0x12c381,_0x5ab4cb,_0x3549eb,_0x236355,_0x1fd9b0){const _0x3883bc=a114_0x3e8f2e,_0x50e7eb=new Map(_0x3549eb);for(const _0x3774be of _0x5ab4cb){const _0x236cca=_0x3774be[_0x3883bc(0x1b2)]('/'),_0x5b1651=_0x236cca[_0x236cca[_0x3883bc(0x1b7)]-0x1],_0x569424=_0x236cca['slice'](0x0,-0x1)[_0x3883bc(0x1bb)]('/'),_0x2e65f4=_0x50e7eb[_0x3883bc(0x1f1)](_0x569424);_0x1fd9b0[_0x3883bc(0x1b3)]?.({'type':_0x3883bc(0x256),'folder':_0x3774be});const _0x2af11f={'name':_0x5b1651,'parentFolderId':_0x2e65f4},_0x2ed39f=await _0x1fd9b0[_0x3883bc(0x1ab)](_0x3883bc(0x20a)+_0x3774be+_0x3883bc(0x1d9),()=>_0x12c381['segment'][_0x3883bc(0x299)](_0x236355[_0x3883bc(0x297)],_0x2af11f));_0x50e7eb[_0x3883bc(0x22a)](_0x3774be,_0x2ed39f[_0x3883bc(0x257)]['id']),_0x1fd9b0[_0x3883bc(0x1b3)]?.({'type':_0x3883bc(0x29d),'folder':_0x3774be,'folderId':_0x2ed39f[_0x3883bc(0x257)]['id']}),_0x1fd9b0[_0x3883bc(0x22b)]?.(_0x3883bc(0x1ca)+_0x3774be+'\x27');}return _0x50e7eb;}export async function executePushSegmentDeletions(_0xe8ddbd,_0x4c8641,_0x9eef82){const _0x226d31=a114_0x3e8f2e;if(_0x4c8641[_0x226d31(0x1b7)]===0x0)return 0x0;const {batchAsync:_0x4e73aa}=await import(_0x226d31(0x1de)),_0x2e7b2=0x5,_0x480956=await _0x4e73aa(_0x4c8641,async _0x4d84f8=>{const _0x4de6c8=_0x226d31;return _0x9eef82['onProgress']?.({'type':_0x4de6c8(0x20b),'name':_0x4d84f8['name']}),await _0xe8ddbd[_0x4de6c8(0x1e7)][_0x4de6c8(0x27a)](_0x4d84f8['id']),_0x9eef82[_0x4de6c8(0x1b3)]?.({'type':_0x4de6c8(0x236),'name':_0x4d84f8[_0x4de6c8(0x1f6)]}),_0x9eef82[_0x4de6c8(0x29f)]?.(_0x4de6c8(0x1d8)+_0x4d84f8[_0x4de6c8(0x1f6)]+'\x27'),0x1;},_0x2e7b2);return _0x480956['reduce']((_0x593165,_0x559fae)=>_0x593165+_0x559fae,0x0);}export async function executePushJourneys(_0x35ef31,_0x38504c,_0x4a1528,_0x25c098,_0x463de3){const _0x2bdb80=a114_0x3e8f2e,{journeyDefToRequest:_0x6ea955}=await import(_0x2bdb80(0x21c)),{activationDefToCreateRequest:_0x1c06dd,yamlRuleToApi:_0x2e6d04,validateSegmentRule:_0x290e07}=await import(_0x2bdb80(0x1b0)),_0x2a8083={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3e7949=new Map(_0x4a1528[_0x2bdb80(0x20d)]),_0x5cde65=0x5;for(let _0x259a99=0x0;_0x259a99<_0x38504c['length'];_0x259a99+=_0x5cde65){const _0x1c16a8=_0x38504c[_0x2bdb80(0x1cb)](_0x259a99,_0x259a99+_0x5cde65),_0x77757=await Promise[_0x2bdb80(0x289)](_0x1c16a8[_0x2bdb80(0x1fe)](async _0xe7e1da=>{const _0x470c3a=_0x2bdb80;if(!_0xe7e1da['isNew']&&!_0xe7e1da['hasChanges'])return{'action':_0x470c3a(0x261),'name':_0xe7e1da[_0x470c3a(0x28f)][_0x470c3a(0x1f6)],'journeyId':_0xe7e1da['existingJourney']?.['id']};const _0x8b2c2=_0xe7e1da['folderPath']?_0x4a1528['folderPathToId'][_0x470c3a(0x1f1)](_0xe7e1da[_0x470c3a(0x292)]):undefined;_0x463de3[_0x470c3a(0x1b3)]?.({'type':_0xe7e1da[_0x470c3a(0x1e5)]?_0x470c3a(0x238):'journey_updating','name':_0xe7e1da[_0x470c3a(0x28f)]['name']});try{const _0x4f9b62=await executeSingleJourneyPush(_0x35ef31,_0xe7e1da,{..._0x4a1528,'segmentNameToId':_0x3e7949},{'parentId':_0x25c098[_0x470c3a(0x297)],'rootFolderId':_0x25c098[_0x470c3a(0x229)],'folderId':_0x8b2c2,'verbose':_0x25c098['verbose']},_0x463de3,{'journeyDefToRequest':_0x6ea955,'activationDefToCreateRequest':_0x1c06dd,'yamlRuleToApi':_0x2e6d04,'validateSegmentRule':_0x290e07});for(const [_0x246783,_0x4e06a4]of _0x4f9b62[_0x470c3a(0x26d)]){_0x3e7949[_0x470c3a(0x22a)](_0x246783,_0x4e06a4),_0x2a8083[_0x470c3a(0x26d)][_0x470c3a(0x22a)](_0x246783,_0x4e06a4);}if(_0x4f9b62['action']===_0x470c3a(0x24a))_0x463de3[_0x470c3a(0x1b3)]?.({'type':_0x470c3a(0x1ae),'name':_0xe7e1da[_0x470c3a(0x28f)]['name'],'journeyId':_0x4f9b62[_0x470c3a(0x205)]}),_0x463de3[_0x470c3a(0x1a5)]?.(_0x470c3a(0x281)+_0xe7e1da[_0x470c3a(0x28f)][_0x470c3a(0x1f6)]+'\x27'),_0x2a8083[_0x470c3a(0x24a)]++;else _0x4f9b62[_0x470c3a(0x225)]===_0x470c3a(0x269)&&(_0x463de3[_0x470c3a(0x1b3)]?.({'type':_0x470c3a(0x23a),'name':_0xe7e1da['yamlConfig']['name']}),_0x463de3[_0x470c3a(0x1a5)]?.(_0x470c3a(0x28a)+_0xe7e1da['yamlConfig'][_0x470c3a(0x1f6)]+'\x27'),_0x2a8083['updated']++);return{'action':_0x4f9b62[_0x470c3a(0x225)],'name':_0xe7e1da[_0x470c3a(0x28f)][_0x470c3a(0x1f6)],'journeyId':_0x4f9b62[_0x470c3a(0x205)]};}catch(_0x2217cf){const _0x19efb7=isHttp400Error(_0x2217cf),_0x1ceae8=_0x19efb7?ErrorCode[_0x470c3a(0x1dd)]:ErrorCode[_0x470c3a(0x1f0)],_0x2c59d7=getErrorMessage(_0x2217cf);throw new SDKError(_0x1ceae8,_0x470c3a(0x264)+(_0xe7e1da[_0x470c3a(0x1e5)]?_0x470c3a(0x1c2):_0x470c3a(0x1ed))+_0x470c3a(0x263)+_0xe7e1da[_0x470c3a(0x2a0)]+'\x0a\x20\x20'+_0x2c59d7,_0x2217cf);}}));_0x2a8083[_0x2bdb80(0x267)][_0x2bdb80(0x1c8)](..._0x77757);}return _0x2a8083;}async function matchExistingJourneySegments(_0x47b97f,_0x13a109,_0x24f18a,_0x33dc4c,_0x4388d3){const _0x1c7d13=a114_0x3e8f2e;if(!_0x13a109[_0x1c7d13(0x1f9)]||!_0x13a109[_0x1c7d13(0x28f)][_0x1c7d13(0x210)])return;const _0x413fdc=new Map();for(const _0x293522 of Object[_0x1c7d13(0x217)](_0x13a109[_0x1c7d13(0x28f)][_0x1c7d13(0x210)])){const _0x2d1397=generateDeterministicJourneySegmentName(_0x13a109[_0x1c7d13(0x28f)]['name'],_0x293522);_0x413fdc[_0x1c7d13(0x22a)](_0x2d1397,_0x293522);}const _0x1407a4=collectSegmentIdsFromJourneyApi(_0x13a109[_0x1c7d13(0x1f9)]);for(const _0x43fb29 of _0x1407a4){const _0x225fa0=await fetchSegment(_0x47b97f,_0x24f18a,_0x43fb29,_0x33dc4c);if(!_0x225fa0?.[_0x1c7d13(0x1f6)])continue;const _0x350612=_0x413fdc['get'](_0x225fa0[_0x1c7d13(0x1f6)]);_0x350612&&_0x4388d3[_0x1c7d13(0x22a)](_0x350612,_0x43fb29);}}async function executeSingleJourneyPush(_0x826b1,_0x4a4823,_0x593202,_0x15eaff,_0x47e04b,_0x4c442c){const _0x163973=a114_0x3e8f2e,{journeyDefToRequest:_0x217147,activationDefToCreateRequest:_0x15991f,yamlRuleToApi:_0x5e382e,validateSegmentRule:_0x2a74f5}=_0x4c442c,_0xfa05ec=new Map(),_0x258117=new Map();recoverSegmentIdsFromPushRecovery(_0x4a4823,_0xfa05ec,_0x593202[_0x163973(0x20d)]);const _0x5e47e3=new Map(),_0x160b58=new Map(),_0x2f417d=new Map();let _0x1e7f0a;const _0x31d97b=async()=>{const _0x1f40d3=_0x163973;if(_0x1e7f0a)return;_0x1e7f0a=new Map();if(!_0x4a4823[_0x1f40d3(0x1f9)])return;const _0x4d0fd6=await _0x826b1['journey'][_0x1f40d3(0x22f)](_0x4a4823[_0x1f40d3(0x1f9)]['id']);for(const _0x18f387 of _0x4d0fd6){const _0x277c06=journeyActivationStepToYaml(_0x18f387,_0x593202[_0x1f40d3(0x268)],_0x593202[_0x1f40d3(0x295)]),_0x533747=activationSignature(_0x277c06);!_0x1e7f0a['has'](_0x533747)&&_0x1e7f0a[_0x1f40d3(0x22a)](_0x533747,_0x18f387['id']),_0x277c06[_0x1f40d3(0x1f6)]&&_0x258117[_0x1f40d3(0x22a)](_0x277c06[_0x1f40d3(0x1f6)],_0x18f387['id']);}};await matchExistingJourneySegments(_0x826b1,_0x4a4823,_0x15eaff[_0x163973(0x297)],_0x593202[_0x163973(0x284)],_0x593202[_0x163973(0x20d)]);const _0x390b06={'resolveSegmentId':async _0x3cd239=>{const _0x4ab433=_0x163973,_0x1da4cb=_0x593202[_0x4ab433(0x20d)][_0x4ab433(0x1f1)](_0x3cd239);if(!_0x1da4cb)throw new SDKError(ErrorCode[_0x4ab433(0x1da)],_0x4ab433(0x206)+_0x3cd239+_0x4ab433(0x243)+_0x4a4823[_0x4ab433(0x28f)][_0x4ab433(0x1f6)]+')');return _0x1da4cb;},'resolveEmbeddedSegmentId':async(_0x43181c,_0x57bf96)=>{const _0x5c6631=_0x163973,_0x26cf6c=_0x593202[_0x5c6631(0x20d)][_0x5c6631(0x1f1)](_0x43181c);if(_0x26cf6c)return _0x26cf6c;const _0x2c2518=_0x593202[_0x5c6631(0x284)][_0x5c6631(0x1f4)](_0x488f85=>_0x488f85[_0x5c6631(0x1f6)]===_0x43181c);if(_0x2c2518)return _0x593202[_0x5c6631(0x20d)]['set'](_0x43181c,_0x2c2518['id']),_0x2c2518['id'];if(_0x4a4823['isNew']){const {stageName:_0x44db16,criteriaName:_0x34c0a7}=findSegmentCriteriaLocation(_0x4a4823[_0x5c6631(0x28f)],_0x43181c);return _0x2a74f5(_0x43181c,_0x57bf96[_0x5c6631(0x1a4)]),_0x160b58[_0x5c6631(0x22a)](_0x43181c,{'definition':_0x57bf96,'stageName':_0x44db16,'criteriaName':_0x34c0a7}),createPendingSegmentId(_0x43181c);}const _0x25991a=_0x4a4823[_0x5c6631(0x1f9)]?.['id'];if(!_0x25991a)throw new SDKError(ErrorCode['INTERNAL'],_0x5c6631(0x1ff));const _0x52f9e9=_0x5e47e3[_0x5c6631(0x1f1)](_0x43181c);if(_0x52f9e9)return _0x52f9e9;const _0x3410e5=((async()=>{const _0x297c4a=_0x5c6631;_0x2a74f5(_0x43181c,_0x57bf96[_0x297c4a(0x1a4)]);const _0xf20dea=generateDeterministicJourneySegmentName(_0x4a4823['yamlConfig'][_0x297c4a(0x1f6)],_0x43181c),_0xb5610c=_0x593202[_0x297c4a(0x284)][_0x297c4a(0x1f4)](_0x1a289f=>_0x1a289f[_0x297c4a(0x1f6)]===_0xf20dea),_0x1ca560=createSegmentIdResolver(_0x593202[_0x297c4a(0x20d)],_0x43181c),_0x35d35b=await resolveRuleSegmentIds(_0x57bf96[_0x297c4a(0x1a4)],_0x1ca560);let _0x36e144;return _0xb5610c?(await _0x826b1['segment'][_0x297c4a(0x227)](_0x15eaff[_0x297c4a(0x297)],_0xb5610c['id'],{'description':_0x57bf96['description']||_0x297c4a(0x1b6)+_0x43181c,'rule':_0x5e382e(_0x35d35b,!![]),'countPopulation':!![]}),_0x36e144=_0xb5610c['id'],saveSegmentToPushRecovery(_0x4a4823[_0x297c4a(0x2a0)],_0x4a4823['yamlConfig'][_0x297c4a(0x1f6)],_0x43181c,{'segmentId':_0x36e144,'uniqueServerName':_0xf20dea,'createdAt':new Date()[_0x297c4a(0x237)]()})):_0x36e144=await createOrRecoverEmbeddedSegment(_0x826b1,_0x4a4823,{'localName':_0x43181c,'uniqueSegmentName':_0xf20dea,'description':_0x57bf96['description']||_0x297c4a(0x1b6)+_0x43181c,'journeyId':_0x25991a,'resolvedRule':_0x35d35b,'parentId':_0x15eaff[_0x297c4a(0x297)],'folderId':_0x15eaff['rootFolderId']||''},_0x5e382e),_0x593202[_0x297c4a(0x20d)]['set'](_0x43181c,_0x36e144),_0xfa05ec[_0x297c4a(0x22a)](_0x43181c,_0x36e144),_0x36e144;})());_0x5e47e3['set'](_0x43181c,_0x3410e5);try{return await _0x3410e5;}finally{_0x5e47e3[_0x5c6631(0x277)](_0x43181c);}},'resolveActivationId':async _0xb30f13=>{const _0x26eca2=_0x163973,_0x5ed542=_0x258117['get'](_0xb30f13);if(_0x5ed542)return _0x5ed542;if(_0x4a4823[_0x26eca2(0x1f9)]){await _0x31d97b();const _0x149cf9=_0x258117[_0x26eca2(0x1f1)](_0xb30f13);if(_0x149cf9)return _0x149cf9;}throw new SDKError(ErrorCode[_0x26eca2(0x20c)],'Activation\x20not\x20found:\x20'+_0xb30f13+_0x26eca2(0x243)+_0x4a4823[_0x26eca2(0x28f)][_0x26eca2(0x1f6)]+_0x26eca2(0x1e1)+_0x26eca2(0x24c));},'resolveEmbeddedActivationId':async(_0x2d9856,_0x3a8595)=>{const _0x243bc9=_0x163973,_0x41ba79=_0x258117['get'](_0x2d9856);if(_0x41ba79)return _0x41ba79;if(_0x4a4823[_0x243bc9(0x1e5)])return _0x2f417d[_0x243bc9(0x22a)](_0x2d9856,_0x3a8595),createPendingActivationId(_0x2d9856);if(_0x4a4823[_0x243bc9(0x1f9)]){await _0x31d97b();const _0x54cb4f=_0x258117[_0x243bc9(0x1f1)](_0x3a8595[_0x243bc9(0x1f6)]);if(_0x54cb4f)return _0x258117[_0x243bc9(0x22a)](_0x2d9856,_0x54cb4f),_0x54cb4f;const _0x55fddf=activationSignature(_0x3a8595),_0x1ed125=_0x1e7f0a?.[_0x243bc9(0x1f1)](_0x55fddf);if(_0x1ed125)return _0x258117[_0x243bc9(0x22a)](_0x2d9856,_0x1ed125),_0x1ed125;const _0x387431=await _0x15991f(_0x3a8595,_0x593202[_0x243bc9(0x279)]),_0x56b1b8={..._0x387431,..._0x3a8595['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x3a8595[_0x243bc9(0x208)]}},_0x29ccb7=await _0x826b1[_0x243bc9(0x1ac)]['createActivation'](_0x4a4823[_0x243bc9(0x1f9)]['id'],_0x56b1b8);return _0x258117['set'](_0x2d9856,_0x29ccb7['id']),_0x29ccb7['id'];}throw new SDKError(ErrorCode[_0x243bc9(0x262)],_0x243bc9(0x24e));},'resolveJourneyId':async _0x9326f4=>{const _0x1d04e9=_0x163973;try{return await _0x826b1[_0x1d04e9(0x1ac)][_0x1d04e9(0x240)](_0x15eaff[_0x1d04e9(0x297)],_0x9326f4);}catch(_0x516eb8){throw new SDKError(ErrorCode['NOT_FOUND'],_0x1d04e9(0x26a)+_0x9326f4+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x4a4823[_0x1d04e9(0x28f)][_0x1d04e9(0x1f6)]+'\x27)',_0x516eb8);}},'resolveStageId':async(_0xf17861,_0x27f7f6)=>{const _0x19319d=_0x163973,_0x293582=await _0x826b1['journey'][_0x19319d(0x276)](_0xf17861),_0x36b928=_0x293582['attributes']['journeyStages']['find'](_0x29463f=>_0x29463f[_0x19319d(0x1f6)][_0x19319d(0x27c)]()===_0x27f7f6[_0x19319d(0x27c)]());if(!_0x36b928?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x27f7f6+_0x19319d(0x1c5)+(_0x293582[_0x19319d(0x22e)]['journeyBundleName']||_0x293582[_0x19319d(0x22e)][_0x19319d(0x1f6)])+'\x27');return _0x36b928['id'];}},_0xb5843f=await _0x217147(_0x4a4823[_0x163973(0x28f)],_0x15eaff[_0x163973(0x297)],_0x390b06),_0x2a9a98=_0x15eaff[_0x163973(0x27d)]||_0x15eaff[_0x163973(0x229)];_0x2a9a98&&(_0xb5843f[_0x163973(0x1f5)]={'parentFolder':{'data':{'id':_0x2a9a98,'type':_0x163973(0x1d7)}}});if(_0x4a4823['isNew']){if(_0x160b58['size']>0x0||_0x2f417d[_0x163973(0x222)]>0x0)return await executeThreeStepJourneyCreate(_0x826b1,_0x4a4823,_0xb5843f,{'pendingEmbeddedSegments':_0x160b58,'pendingEmbeddedActivations':_0x2f417d,'embeddedSegmentNameToId':_0xfa05ec,'journeyActivationNameToId':_0x258117},{..._0x15eaff,'effectiveFolderId':_0x2a9a98},_0x593202,_0x47e04b,_0x4c442c);else{ensureJourneyDefaults(_0xb5843f[_0x163973(0x22e)]);const _0x4ccaad=await _0x826b1[_0x163973(0x1ac)][_0x163973(0x1c2)](_0xb5843f);return deletePushRecovery(_0x4a4823['absolutePath']),{'action':'created','journeyId':_0x4ccaad['id'],'embeddedSegmentNameToId':_0xfa05ec};}}else{if(_0x4a4823[_0x163973(0x1e8)]&&_0x4a4823['existingJourney'])return ensureJourneyDefaults(_0xb5843f['attributes']),await _0x826b1[_0x163973(0x1ac)]['update'](_0x4a4823['existingJourney']['id'],_0xb5843f),deletePushRecovery(_0x4a4823[_0x163973(0x2a0)]),{'action':_0x163973(0x269),'journeyId':_0x4a4823[_0x163973(0x1f9)]['id'],'embeddedSegmentNameToId':_0xfa05ec};}return deletePushRecovery(_0x4a4823['absolutePath']),{'action':'unchanged','journeyId':_0x4a4823[_0x163973(0x1f9)]?.['id'],'embeddedSegmentNameToId':_0xfa05ec};}function findSegmentCriteriaLocation(_0x3d61ae,_0x18521a){const _0x3de3f1=a114_0x3e8f2e,_0x2cf218=_0x3d61ae['stages']||_0x3d61ae['journeys']?.[0x0]?.['stages']||[];let _0x232631=_0x3de3f1(0x293),_0x8d3209=_0x18521a;const _0x5bfdc9=_0x3d61ae[_0x3de3f1(0x1bd)]||_0x3d61ae[_0x3de3f1(0x1ec)]?.[0x0]?.[_0x3de3f1(0x1bd)];if(_0x5bfdc9?.[_0x3de3f1(0x1e7)]===_0x18521a)return{'stageName':_0x3de3f1(0x1bd),'criteriaName':_0x5bfdc9[_0x3de3f1(0x1f6)]||_0x18521a};_0x370932:for(const _0x3fb831 of _0x2cf218){if(_0x3fb831[_0x3de3f1(0x1be)]?.[_0x3de3f1(0x1e7)]===_0x18521a){_0x232631=_0x3fb831[_0x3de3f1(0x1f6)],_0x8d3209=_0x3fb831[_0x3de3f1(0x1be)][_0x3de3f1(0x1f6)]||_0x18521a;break;}if(_0x3fb831[_0x3de3f1(0x1a9)])for(const _0x1095f8 of _0x3fb831[_0x3de3f1(0x1a9)]){if(_0x1095f8[_0x3de3f1(0x202)]===_0x3de3f1(0x245)&&_0x1095f8[_0x3de3f1(0x291)]?.[_0x3de3f1(0x1f2)])for(const _0x18b341 of _0x1095f8[_0x3de3f1(0x291)]['branches']){if(_0x18b341[_0x3de3f1(0x1e7)]===_0x18521a){_0x232631=_0x3fb831['name'],_0x8d3209=_0x18b341[_0x3de3f1(0x1f6)]||_0x18521a;break _0x370932;}}}}return{'stageName':_0x232631,'criteriaName':_0x8d3209};}async function executeThreeStepJourneyCreate(_0x244505,_0x20b0cf,_0x21ba19,_0x1576db,_0x5bdc57,_0x22f819,_0x579118,_0x48a6d1){const _0x5008ee=a114_0x3e8f2e,{activationDefToCreateRequest:_0x403486,yamlRuleToApi:_0x32d540}=_0x48a6d1,{pendingEmbeddedSegments:_0x4f6756,pendingEmbeddedActivations:_0x267a6a,embeddedSegmentNameToId:_0x1db376}=_0x1576db,_0x1263e6=JSON[_0x5008ee(0x226)](JSON['stringify'](_0x21ba19));ensureJourneyDefaults(_0x1263e6[_0x5008ee(0x22e)]),stripPendingIds(_0x1263e6);const _0x1184bd=await _0x244505[_0x5008ee(0x1ac)][_0x5008ee(0x1c2)](_0x1263e6),_0xc67470=_0x1184bd['id'],_0x144938=new Map();for(const _0x30b7af of _0x1184bd['attributes'][_0x5008ee(0x22c)]){_0x144938[_0x5008ee(0x22a)](_0x30b7af[_0x5008ee(0x1f6)]['toLowerCase'](),_0x30b7af['id']);}recoverSegmentIdsFromPushRecovery(_0x20b0cf,_0x1db376,_0x22f819[_0x5008ee(0x20d)]);for(const [_0x41708f,{definition:_0x1d907c}]of _0x4f6756){if(_0x1db376[_0x5008ee(0x27e)](_0x41708f)){_0x579118[_0x5008ee(0x1b3)]?.({'type':_0x5008ee(0x1a6),'journeyName':_0x20b0cf[_0x5008ee(0x28f)][_0x5008ee(0x1f6)],'segmentName':_0x41708f});continue;}const _0x17bfca=generateDeterministicJourneySegmentName(_0x20b0cf['yamlConfig'][_0x5008ee(0x1f6)],_0x41708f);_0x579118[_0x5008ee(0x1b3)]?.({'type':_0x5008ee(0x1b4),'journeyName':_0x20b0cf[_0x5008ee(0x28f)][_0x5008ee(0x1f6)],'segmentName':_0x41708f});const _0x2721ba=createSegmentIdResolver(_0x22f819[_0x5008ee(0x20d)],_0x41708f),_0x33fe76=await resolveRuleSegmentIds(_0x1d907c[_0x5008ee(0x1a4)],_0x2721ba),_0x37497d=await createOrRecoverEmbeddedSegment(_0x244505,_0x20b0cf,{'localName':_0x41708f,'uniqueSegmentName':_0x17bfca,'description':_0x1d907c['description']||'Entry\x20criteria:\x20'+_0x41708f,'journeyId':_0xc67470,'resolvedRule':_0x33fe76,'parentId':_0x5bdc57[_0x5008ee(0x297)],'folderId':_0x5bdc57['effectiveFolderId']||''},_0x32d540);_0x1db376[_0x5008ee(0x22a)](_0x41708f,_0x37497d),_0x22f819[_0x5008ee(0x20d)][_0x5008ee(0x22a)](_0x41708f,_0x37497d),_0x579118[_0x5008ee(0x1b3)]?.({'type':'embedded_segment_created','journeyName':_0x20b0cf[_0x5008ee(0x28f)][_0x5008ee(0x1f6)],'segmentName':_0x41708f});}const _0x156820=new Map();for(const [_0x57515d,_0x57b155]of _0x267a6a){_0x579118['onProgress']?.({'type':_0x5008ee(0x26f),'journeyName':_0x20b0cf[_0x5008ee(0x28f)][_0x5008ee(0x1f6)],'activationName':_0x57515d});const _0x4212f2=await _0x403486(_0x57b155,_0x22f819[_0x5008ee(0x279)]),_0x5373a7={..._0x4212f2,..._0x57b155[_0x5008ee(0x208)]!==undefined&&{'runAfterJourneyRefresh':_0x57b155['run_after_journey_refresh']}},_0x1e8ad9=await _0x244505[_0x5008ee(0x1ac)][_0x5008ee(0x21d)](_0xc67470,_0x5373a7);_0x156820[_0x5008ee(0x22a)](_0x57515d,_0x1e8ad9['id']),_0x1576db[_0x5008ee(0x1af)][_0x5008ee(0x22a)](_0x57515d,_0x1e8ad9['id']),_0x579118[_0x5008ee(0x1b3)]?.({'type':_0x5008ee(0x247),'journeyName':_0x20b0cf[_0x5008ee(0x28f)][_0x5008ee(0x1f6)],'activationName':_0x57515d});}const _0x427989=JSON[_0x5008ee(0x226)](JSON['stringify'](_0x21ba19));return _0x427989['id']=_0xc67470,ensureJourneyDefaults(_0x427989[_0x5008ee(0x22e)]),resolvePendingIdsInRequest(_0x427989,_0x21ba19,_0x144938,_0x1db376,_0x156820,_0x579118),await _0x244505[_0x5008ee(0x1ac)][_0x5008ee(0x1ed)](_0xc67470,_0x427989),deletePushRecovery(_0x20b0cf[_0x5008ee(0x2a0)]),{'action':_0x5008ee(0x24a),'journeyId':_0xc67470,'embeddedSegmentNameToId':_0x1db376};}export function stripWaitStepPendingIds(_0x329dce){const _0xf935f=a114_0x3e8f2e,_0x30d9e2=_0x329dce[_0xf935f(0x231)]&&isPendingSegmentId(_0x329dce[_0xf935f(0x231)]),_0x4f6faf=_0x329dce[_0xf935f(0x204)]?.[_0xf935f(0x25c)](_0x2c7f49=>_0x2c7f49[_0xf935f(0x294)]&&isPendingSegmentId(_0x2c7f49[_0xf935f(0x294)]));(_0x30d9e2||_0x4f6faf)&&(_0x329dce[_0xf935f(0x27f)]=_0xf935f(0x25a),_0x329dce[_0xf935f(0x1bc)]=0x1,_0x329dce[_0xf935f(0x2a1)]='day',delete _0x329dce[_0xf935f(0x231)],delete _0x329dce['conditionTimeoutDuration'],delete _0x329dce['conditionTimeoutUnit'],delete _0x329dce['conditions']);}export function resolveWaitStepPendingIds(_0x670d89,_0x33b22b,_0x1b9655,_0x44e559){const _0x5de4b6=a114_0x3e8f2e;if(_0x33b22b[_0x5de4b6(0x231)]&&isPendingSegmentId(_0x33b22b[_0x5de4b6(0x231)])){const _0x56b47f=_0x1b9655(_0x33b22b['conditionSegmentId'],_0x5de4b6(0x1fb)+_0x44e559+_0x5de4b6(0x1c3));_0x56b47f&&(_0x670d89['waitStepType']=_0x5de4b6(0x1d0),_0x670d89['conditionSegmentId']=_0x56b47f,delete _0x670d89[_0x5de4b6(0x1bc)],delete _0x670d89['waitStepUnit'],_0x33b22b['conditionTimeoutDuration']!==undefined&&(_0x670d89[_0x5de4b6(0x1eb)]=_0x33b22b['conditionTimeoutDuration']),_0x33b22b[_0x5de4b6(0x1c6)]&&(_0x670d89[_0x5de4b6(0x1c6)]=_0x33b22b[_0x5de4b6(0x1c6)]));}if(_0x33b22b[_0x5de4b6(0x204)]){const _0x1eb0b2=_0x33b22b['conditions']['some'](_0x33ba4b=>_0x33ba4b[_0x5de4b6(0x294)]&&isPendingSegmentId(_0x33ba4b[_0x5de4b6(0x294)]));if(_0x1eb0b2){const _0x2856ea=_0x33b22b[_0x5de4b6(0x204)][_0x5de4b6(0x1fe)](_0x37f517=>{const _0x3430bb=_0x5de4b6;if(_0x37f517[_0x3430bb(0x294)]&&isPendingSegmentId(_0x37f517[_0x3430bb(0x294)])){const _0x1b64a3=_0x1b9655(_0x37f517[_0x3430bb(0x294)],'stage\x20\x27'+_0x44e559+_0x3430bb(0x1c3));return{..._0x37f517,'segmentId':_0x1b64a3||_0x37f517[_0x3430bb(0x294)]};}return{..._0x37f517};});_0x670d89['waitStepType']=_0x5de4b6(0x1d0),_0x670d89[_0x5de4b6(0x204)]=_0x2856ea,delete _0x670d89[_0x5de4b6(0x1bc)],delete _0x670d89[_0x5de4b6(0x2a1)],delete _0x670d89[_0x5de4b6(0x231)],delete _0x670d89[_0x5de4b6(0x1eb)],delete _0x670d89[_0x5de4b6(0x1c6)];}}}function stripPendingIds(_0x4111a9){const _0x53b14f=a114_0x3e8f2e;_0x4111a9[_0x53b14f(0x22e)]['goal']?.[_0x53b14f(0x294)]&&isPendingSegmentId(_0x4111a9[_0x53b14f(0x22e)][_0x53b14f(0x1bd)][_0x53b14f(0x294)])&&delete _0x4111a9['attributes'][_0x53b14f(0x1bd)];for(const _0x2f8212 of _0x4111a9[_0x53b14f(0x22e)][_0x53b14f(0x22c)]||[]){_0x2f8212['entryCriteria']?.[_0x53b14f(0x294)]&&isPendingSegmentId(_0x2f8212[_0x53b14f(0x228)][_0x53b14f(0x294)])&&delete _0x2f8212[_0x53b14f(0x228)];_0x2f8212[_0x53b14f(0x20f)]?.['segmentId']&&isPendingSegmentId(_0x2f8212[_0x53b14f(0x20f)]['segmentId'])&&delete _0x2f8212[_0x53b14f(0x20f)];_0x2f8212[_0x53b14f(0x203)]&&(_0x2f8212[_0x53b14f(0x203)]=_0x2f8212['exitCriterias'][_0x53b14f(0x29e)](_0x4e6192=>!_0x4e6192[_0x53b14f(0x294)]||!isPendingSegmentId(_0x4e6192[_0x53b14f(0x294)])));if(_0x2f8212[_0x53b14f(0x1a9)])for(const _0x5a57de of Object[_0x53b14f(0x217)](_0x2f8212[_0x53b14f(0x1a9)])){const _0x59a389=_0x2f8212[_0x53b14f(0x1a9)][_0x5a57de];_0x59a389[_0x53b14f(0x202)]===_0x53b14f(0x223)&&_0x59a389[_0x53b14f(0x233)]&&isPendingActivationId(_0x59a389[_0x53b14f(0x233)])&&(_0x59a389[_0x53b14f(0x233)]='');if(_0x59a389[_0x53b14f(0x202)]===_0x53b14f(0x26b)&&_0x59a389[_0x53b14f(0x1f2)])for(const _0x3da636 of _0x59a389[_0x53b14f(0x1f2)]){_0x3da636[_0x53b14f(0x294)]&&isPendingSegmentId(_0x3da636['segmentId'])&&(_0x3da636[_0x53b14f(0x294)]='');}_0x59a389[_0x53b14f(0x202)]===_0x53b14f(0x23f)&&stripWaitStepPendingIds(_0x59a389);}}}function resolvePendingIdsInRequest(_0x2840ff,_0x4cae86,_0x4d532b,_0x23ec24,_0x700b16,_0x1b4a3e){const _0x5e56e0=a114_0x3e8f2e,_0x514cf0=(_0x24a568,_0x52ba8c)=>{const _0x3b9a43=a114_0x3785;if(!isPendingSegmentId(_0x24a568))return _0x24a568;const _0x20be58=extractPendingSegmentName(_0x24a568),_0x47c566=_0x23ec24['get'](_0x20be58);return!_0x47c566&&_0x1b4a3e[_0x3b9a43(0x21b)]?.(_0x3b9a43(0x249)+_0x20be58+'\x27\x20for\x20'+_0x52ba8c),_0x47c566;};if(_0x2840ff[_0x5e56e0(0x22e)][_0x5e56e0(0x1bd)]?.[_0x5e56e0(0x294)]&&isPendingSegmentId(_0x2840ff['attributes'][_0x5e56e0(0x1bd)][_0x5e56e0(0x294)])){const _0x41edd2=_0x514cf0(_0x2840ff[_0x5e56e0(0x22e)][_0x5e56e0(0x1bd)][_0x5e56e0(0x294)],_0x5e56e0(0x27b));_0x41edd2&&(_0x2840ff[_0x5e56e0(0x22e)][_0x5e56e0(0x1bd)][_0x5e56e0(0x294)]=_0x41edd2);}for(const _0x314ec0 of _0x2840ff[_0x5e56e0(0x22e)]['journeyStages']||[]){const _0x4de1bf=_0x4d532b[_0x5e56e0(0x1f1)](_0x314ec0[_0x5e56e0(0x1f6)]['toLowerCase']());_0x4de1bf&&(_0x314ec0['id']=_0x4de1bf);if(_0x314ec0[_0x5e56e0(0x228)]?.['segmentId']&&isPendingSegmentId(_0x314ec0[_0x5e56e0(0x228)][_0x5e56e0(0x294)])){const _0x39f8aa=_0x514cf0(_0x314ec0[_0x5e56e0(0x228)][_0x5e56e0(0x294)],'stage\x20\x27'+_0x314ec0[_0x5e56e0(0x1f6)]+'\x27\x20entry\x20criteria');_0x39f8aa&&(_0x314ec0[_0x5e56e0(0x228)]['segmentId']=_0x39f8aa);}if(_0x314ec0[_0x5e56e0(0x203)])for(const _0x27e90a of _0x314ec0[_0x5e56e0(0x203)]){if(_0x27e90a[_0x5e56e0(0x294)]&&isPendingSegmentId(_0x27e90a[_0x5e56e0(0x294)])){const _0x177ecd=_0x514cf0(_0x27e90a['segmentId'],_0x5e56e0(0x1fb)+_0x314ec0[_0x5e56e0(0x1f6)]+_0x5e56e0(0x253));_0x177ecd&&(_0x27e90a[_0x5e56e0(0x294)]=_0x177ecd);}}if(_0x314ec0['milestone']?.[_0x5e56e0(0x294)]&&isPendingSegmentId(_0x314ec0[_0x5e56e0(0x20f)][_0x5e56e0(0x294)])){const _0x27fef5=_0x514cf0(_0x314ec0[_0x5e56e0(0x20f)][_0x5e56e0(0x294)],_0x5e56e0(0x1fb)+_0x314ec0[_0x5e56e0(0x1f6)]+_0x5e56e0(0x250));_0x27fef5&&(_0x314ec0['milestone']['segmentId']=_0x27fef5);}if(_0x314ec0[_0x5e56e0(0x1a9)]){const _0x194264=_0xff5afc=>_0x4cae86['attributes']['journeyStages']?.[_0x5e56e0(0x1f4)](_0x392427=>_0x392427[_0x5e56e0(0x1f6)]['toLowerCase']()===_0x314ec0[_0x5e56e0(0x1f6)][_0x5e56e0(0x27c)]())?.[_0x5e56e0(0x1a9)]?.[_0xff5afc];for(const _0x580735 of Object['keys'](_0x314ec0[_0x5e56e0(0x1a9)])){const _0x14d194=_0x314ec0[_0x5e56e0(0x1a9)][_0x580735],_0xf59cb1=_0x194264(_0x580735);if(_0x14d194[_0x5e56e0(0x202)]===_0x5e56e0(0x223)&&_0x14d194[_0x5e56e0(0x233)]&&(isPendingActivationId(_0x14d194['journeyActivationStepId'])||_0x14d194[_0x5e56e0(0x233)]==='')){if(_0xf59cb1?.[_0x5e56e0(0x233)]&&isPendingActivationId(_0xf59cb1[_0x5e56e0(0x233)])){const _0x4759a0=extractPendingActivationName(_0xf59cb1[_0x5e56e0(0x233)]),_0x4e4523=_0x700b16[_0x5e56e0(0x1f1)](_0x4759a0);_0x4e4523&&(_0x14d194[_0x5e56e0(0x233)]=_0x4e4523);}}if(_0x14d194[_0x5e56e0(0x202)]==='DecisionPoint'&&_0x14d194[_0x5e56e0(0x1f2)]&&_0xf59cb1?.['branches'])for(let _0x1a77f6=0x0;_0x1a77f6<_0x14d194['branches']['length'];_0x1a77f6++){const _0x2cd4a5=_0x14d194[_0x5e56e0(0x1f2)][_0x1a77f6],_0x4cf68b=_0xf59cb1[_0x5e56e0(0x1f2)][_0x1a77f6];if(_0x4cf68b?.[_0x5e56e0(0x294)]&&isPendingSegmentId(_0x4cf68b['segmentId'])){const _0xa1201=_0x514cf0(_0x4cf68b[_0x5e56e0(0x294)],_0x5e56e0(0x1fb)+_0x314ec0[_0x5e56e0(0x1f6)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x2cd4a5[_0x5e56e0(0x1f6)]||_0x1a77f6)+'\x27');_0xa1201&&(_0x2cd4a5[_0x5e56e0(0x294)]=_0xa1201);}}_0x14d194['type']===_0x5e56e0(0x23f)&&_0xf59cb1?.[_0x5e56e0(0x202)]===_0x5e56e0(0x23f)&&resolveWaitStepPendingIds(_0x14d194,_0xf59cb1,_0x514cf0,_0x314ec0[_0x5e56e0(0x1f6)]);}}}}
@@ -1 +1 @@
1
- function a115_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(_0x511c05,_0x29dd9d){const _0x599844=a115_0x1215,_0x902d0=_0x511c05();while(!![]){try{const _0x3ac24f=-parseInt(_0x599844(0x7f))/0x1*(parseInt(_0x599844(0x7e))/0x2)+-parseInt(_0x599844(0x77))/0x3+-parseInt(_0x599844(0x7c))/0x4*(parseInt(_0x599844(0x7d))/0x5)+-parseInt(_0x599844(0x78))/0x6+-parseInt(_0x599844(0x73))/0x7*(-parseInt(_0x599844(0x80))/0x8)+-parseInt(_0x599844(0x82))/0x9+parseInt(_0x599844(0x81))/0xa*(parseInt(_0x599844(0x74))/0xb);if(_0x3ac24f===_0x29dd9d)break;else _0x902d0['push'](_0x902d0['shift']());}catch(_0x4fa887){_0x902d0['push'](_0x902d0['shift']());}}}(a115_0x5531,0x3d8f8));export function buildFolderIdToPathMap(_0x235a2c){const _0x440ee6=a115_0x1215,_0x36ea63=new Map(),_0x5259cd=new Map();for(const _0x58795a of _0x235a2c){_0x5259cd[_0x440ee6(0x7a)](_0x58795a['id'],_0x58795a);}const _0x2b4ec9=new Set();for(const _0x238c36 of _0x235a2c){!_0x238c36[_0x440ee6(0x83)]&&_0x2b4ec9[_0x440ee6(0x76)](_0x238c36['id']);}function _0x5d83ef(_0x1eda53){const _0x42b959=_0x440ee6;if(_0x36ea63[_0x42b959(0x75)](_0x1eda53['id']))return _0x36ea63[_0x42b959(0x7b)](_0x1eda53['id']);if(_0x2b4ec9[_0x42b959(0x75)](_0x1eda53['id']))return _0x36ea63[_0x42b959(0x7a)](_0x1eda53['id'],''),'';if(_0x1eda53[_0x42b959(0x83)]){const _0x30d199=_0x5259cd[_0x42b959(0x7b)](_0x1eda53[_0x42b959(0x83)]);if(_0x30d199){const _0xeea89=_0x5d83ef(_0x30d199),_0x492398=_0xeea89?_0xeea89+'/'+_0x1eda53[_0x42b959(0x79)]:_0x1eda53['name'];return _0x36ea63[_0x42b959(0x7a)](_0x1eda53['id'],_0x492398),_0x492398;}}const _0x2a61c7=_0x1eda53['name'];return _0x36ea63['set'](_0x1eda53['id'],_0x2a61c7),_0x2a61c7;}for(const _0x3130ae of _0x235a2c){_0x5d83ef(_0x3130ae);}return _0x36ea63;}function a115_0x1215(_0x310c94,_0x1e289c){_0x310c94=_0x310c94-0x73;const _0x5531b2=a115_0x5531();let _0x121533=_0x5531b2[_0x310c94];return _0x121533;}export function buildFolderPathToIdMap(_0x2691c3){const _0x148964=a115_0x1215,_0xbfad3b=new Map(),_0x3f0dd8=new Map();for(const _0x8a8510 of _0x2691c3){_0x3f0dd8['set'](_0x8a8510['id'],_0x8a8510);}const _0x449695=new Set();for(const _0x54b382 of _0x2691c3){!_0x54b382[_0x148964(0x83)]&&_0x449695[_0x148964(0x76)](_0x54b382['id']);}function _0x56b09d(_0x22e949){const _0x4145fa=_0x148964;if(_0x449695['has'](_0x22e949['id']))return'';if(_0x22e949[_0x4145fa(0x83)]){const _0x468d6a=_0x3f0dd8[_0x4145fa(0x7b)](_0x22e949[_0x4145fa(0x83)]);if(_0x468d6a){const _0xf4502d=_0x56b09d(_0x468d6a);return _0xf4502d?_0xf4502d+'/'+_0x22e949[_0x4145fa(0x79)]:_0x22e949[_0x4145fa(0x79)];}}return _0x22e949[_0x4145fa(0x79)];}for(const _0x3b5f40 of _0x2691c3){const _0x3c716d=_0x56b09d(_0x3b5f40);_0xbfad3b['set'](_0x3c716d,_0x3b5f40['id']);}return _0xbfad3b;}function a115_0x5531(){const _0x3a36fe=['2aPbfsc','60981FbnGsn','1856gkwNyQ','5723130NCExBJ','757044yGuTgz','parentFolderId','9884htafWQ','11iTueaG','has','add','868254IdTeUa','830454RpZSSp','name','set','get','4kDbvbr','374105jxRSdl'];a115_0x5531=function(){return _0x3a36fe;};return a115_0x5531();}export function buildFolderMaps(_0x491f47){const _0x200dd9=buildFolderIdToPathMap(_0x491f47),_0x18945c=new Map();for(const [_0x12a15a,_0x52a57d]of _0x200dd9){_0x18945c['set'](_0x52a57d,_0x12a15a);}return{'idToPath':_0x200dd9,'pathToId':_0x18945c};}export function getFolderPath(_0x93c491,_0x32ef90){const _0x3a81b7=a115_0x1215;if(!_0x93c491)return'';return _0x32ef90[_0x3a81b7(0x7b)](_0x93c491)??'';}
@@ -1 +1 @@
1
- (function(_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(_0x263ed1,_0x5f49df){const _0x36a3d6=a116_0x71ea,_0x3d5db0=_0x263ed1();while(!![]){try{const _0x44ca46=-parseInt(_0x36a3d6(0x105))/0x1*(parseInt(_0x36a3d6(0xe7))/0x2)+-parseInt(_0x36a3d6(0xf3))/0x3*(-parseInt(_0x36a3d6(0xef))/0x4)+-parseInt(_0x36a3d6(0x103))/0x5*(-parseInt(_0x36a3d6(0x10c))/0x6)+-parseInt(_0x36a3d6(0xe9))/0x7+-parseInt(_0x36a3d6(0xf5))/0x8+-parseInt(_0x36a3d6(0x104))/0x9+parseInt(_0x36a3d6(0xf6))/0xa;if(_0x44ca46===_0x5f49df)break;else _0x3d5db0['push'](_0x3d5db0['shift']());}catch(_0x147cb3){_0x3d5db0['push'](_0x3d5db0['shift']());}}}(a116_0x4c42,0x24f35));import a116_0x52b5d9 from'path';import{parse as a116_0x3f597b}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x463986){const _0x377d2f=a116_0x71ea;if(!_0x463986||_0x463986[_0x377d2f(0x102)]()==='')throw new Error(_0x377d2f(0x108));const _0x50128a=_0x463986['trim']();if(_0x50128a==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x463986};const _0x45c663=_0x50128a[_0x377d2f(0xfc)]('/')?_0x50128a[_0x377d2f(0xf2)](0x1):_0x50128a,_0x1d8d87=_0x45c663[_0x377d2f(0x109)]('/')[_0x377d2f(0xe8)](_0x395420=>_0x395420!=='');if(_0x1d8d87[_0x377d2f(0xe6)]===0x0)throw new Error(_0x377d2f(0x106));const _0x4102f6=_0x50128a[_0x377d2f(0xfc)]('/')||!isRelativePathSegment(_0x1d8d87[0x0]);for(const _0x1338a0 of _0x1d8d87){validatePathSegment(_0x1338a0);}return{'segments':_0x1d8d87,'isAbsolute':_0x4102f6,'raw':_0x463986};}function a116_0x71ea(_0x26076a,_0x5234f7){_0x26076a=_0x26076a-0xe2;const _0x4c4231=a116_0x4c42();let _0x71ea22=_0x4c4231[_0x26076a];return _0x71ea22;}function isRelativePathSegment(_0x50d71c){return _0x50d71c==='.'||_0x50d71c==='..';}function validatePathSegment(_0x54a0be){const _0x485c9f=a116_0x71ea;if(_0x54a0be==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x54a0be==='.'||_0x54a0be==='..')return;if(/[\x00-\x1F\x7F]/[_0x485c9f(0x101)](_0x54a0be))throw new Error(_0x485c9f(0xf9)+_0x54a0be);if(_0x54a0be!==_0x54a0be['trim']()){}}export function validatePath(_0x4058d5){const _0x333b13=a116_0x71ea;if(_0x4058d5[_0x333b13(0x10a)]['length']===0x0&&!_0x4058d5[_0x333b13(0xf7)])throw new Error(_0x333b13(0xe3));if(_0x4058d5[_0x333b13(0xf7)]){if(_0x4058d5[_0x333b13(0x10a)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x42ef2a=0x0;for(const _0x2dffe1 of _0x4058d5[_0x333b13(0x10a)]){if(_0x2dffe1==='..'){if(_0x42ef2a===0x0)throw new Error(_0x333b13(0xee));_0x42ef2a--;}else _0x2dffe1!=='.'&&_0x42ef2a++;}}}export function joinPaths(_0x21c78a,_0x40ad65){const _0x7b3570=a116_0x71ea;if(!_0x21c78a||_0x21c78a==='/')return _0x40ad65;if(!_0x40ad65||_0x40ad65==='.')return _0x21c78a;if(_0x40ad65[_0x7b3570(0xfc)]('/'))return _0x40ad65;const _0x478976=parsePath(_0x21c78a),_0x34d8d5=parsePath(_0x40ad65),_0x2a768a=[..._0x478976['segments']];for(const _0x3c49ac of _0x34d8d5[_0x7b3570(0x10a)]){if(_0x3c49ac==='.')continue;else{if(_0x3c49ac==='..'){if(_0x2a768a[_0x7b3570(0xe6)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x2a768a['pop']();}else _0x2a768a[_0x7b3570(0xec)](_0x3c49ac);}}const _0x2e3d7c=_0x2a768a[_0x7b3570(0xfe)]('/');return _0x478976[_0x7b3570(0xf0)][_0x7b3570(0xfc)]('/')?'/'+_0x2e3d7c:_0x2e3d7c;}export function normalizePath(_0x3895d6){const _0x343589=a116_0x71ea,_0x4b9219=parsePath(_0x3895d6),_0x5c4f7a=[];for(const _0x3d4aa0 of _0x4b9219[_0x343589(0x10a)]){if(_0x3d4aa0==='.')continue;else{if(_0x3d4aa0==='..'){if(_0x5c4f7a[_0x343589(0xe6)]===0x0){if(_0x4b9219[_0x343589(0xf7)])throw new Error(_0x343589(0xeb));_0x5c4f7a[_0x343589(0xec)]('..');}else _0x5c4f7a[_0x5c4f7a[_0x343589(0xe6)]-0x1]==='..'?_0x5c4f7a[_0x343589(0xec)]('..'):_0x5c4f7a[_0x343589(0xff)]();}else _0x5c4f7a[_0x343589(0xec)](_0x3d4aa0);}}if(_0x5c4f7a[_0x343589(0xe6)]===0x0)return _0x4b9219[_0x343589(0xf7)]?'/':'.';const _0x533110=_0x5c4f7a[_0x343589(0xfe)]('/');return _0x4b9219[_0x343589(0xf0)]['startsWith']('/')?'/'+_0x533110:_0x533110;}export function getParentPath(_0x189dc0){const _0x21ea04=a116_0x71ea,_0x470c4e=parsePath(_0x189dc0);if(_0x470c4e[_0x21ea04(0x10a)][_0x21ea04(0xe6)]<=0x1)return'/';const _0x2f3556=_0x470c4e[_0x21ea04(0x10a)][_0x21ea04(0x10b)](0x0,-0x1)[_0x21ea04(0xfe)]('/');return _0x470c4e[_0x21ea04(0xf0)][_0x21ea04(0xfc)]('/')?'/'+_0x2f3556:_0x2f3556;}export function getBaseName(_0x1f436f){const _0x3a0310=a116_0x71ea,_0x2f456d=parsePath(_0x1f436f);return _0x2f456d['segments'][_0x2f456d[_0x3a0310(0x10a)]['length']-0x1]||'';}export function isChildPath(_0x5a4dc1,_0x4a3f9b){const _0x496023=a116_0x71ea,_0x3e0a32=parsePath(_0x5a4dc1),_0x1794c4=parsePath(_0x4a3f9b);if(_0x3e0a32[_0x496023(0x10a)]['length']<=_0x1794c4['segments'][_0x496023(0xe6)])return![];for(let _0x2ebce8=0x0;_0x2ebce8<_0x1794c4[_0x496023(0x10a)][_0x496023(0xe6)];_0x2ebce8++){if(_0x3e0a32['segments'][_0x2ebce8]!==_0x1794c4['segments'][_0x2ebce8])return![];}return!![];}export function splitPath(_0x48c44a){const _0x3563ac=a116_0x71ea,_0x2590da=parsePath(_0x48c44a);if(_0x2590da[_0x3563ac(0x10a)][_0x3563ac(0xe6)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x2590da['segments']['length']===0x1)return{'parent':_0x2590da[_0x3563ac(0x10a)][0x0]};return{'parent':_0x2590da[_0x3563ac(0x10a)][0x0],'child':_0x2590da['segments'][_0x3563ac(0x10b)](0x1)[_0x3563ac(0xfe)]('/')};}export function isYamlFilePath(_0x15e551){const _0x3e7c45=a116_0x71ea;return _0x15e551[_0x3e7c45(0x100)]('.yml')||_0x15e551[_0x3e7c45(0x100)](_0x3e7c45(0x107));}export async function resolveYamlFilePath(_0x36fb04,_0x3ceddc=nodeFileSystem){const _0xb4360f=a116_0x71ea,_0x139ade=a116_0x52b5d9[_0xb4360f(0xe4)](_0x36fb04);if(!await _0x3ceddc[_0xb4360f(0xf8)](_0x139ade))throw new Error(_0xb4360f(0xf4)+_0x36fb04);let _0x2553c7=a116_0x52b5d9[_0xb4360f(0xe5)](_0x139ade),_0x23d576=null,_0x4f355b=null;const _0x3cc19e=a116_0x52b5d9[_0xb4360f(0xea)](_0x2553c7)[_0xb4360f(0x10f)];while(_0x2553c7!==_0x3cc19e){const _0x1d25cd=a116_0x52b5d9[_0xb4360f(0xfe)](_0x2553c7,_0xb4360f(0x10d));if(await _0x3ceddc['exists'](_0x1d25cd)){_0x23d576=_0x1d25cd,_0x4f355b=_0x2553c7;break;}_0x2553c7=a116_0x52b5d9[_0xb4360f(0xe5)](_0x2553c7);}if(!_0x23d576||!_0x4f355b)throw new Error(_0xb4360f(0xe2)+_0x36fb04);const _0x1ccb24=await _0x3ceddc[_0xb4360f(0xed)](_0x23d576),_0x1c0d03=JSON[_0xb4360f(0xea)](_0x1ccb24),_0x30838d=_0x1c0d03[_0xb4360f(0x10e)];if(!_0x30838d)throw new Error(_0xb4360f(0xf1));const _0x37c0a6=await _0x3ceddc[_0xb4360f(0xed)](_0x139ade),_0x5c0db2=a116_0x3f597b(_0x37c0a6),_0x41a475=_0x5c0db2['name'];if(!_0x41a475)throw new Error(_0xb4360f(0xfa)+_0x36fb04);const _0x144a47=_0x5c0db2['type']===_0xb4360f(0xfd)?'journey':'segment',_0xe9eb03=a116_0x52b5d9['relative'](_0x4f355b,_0x139ade),_0x1192d5=a116_0x52b5d9['dirname'](_0xe9eb03),_0x5e8fcc=_0x1192d5==='.'?'':_0x1192d5[_0xb4360f(0xfb)](/\\/g,'/'),_0xbeb587=_0x5e8fcc?_0x30838d+'/'+_0x5e8fcc+'/'+_0x41a475:_0x30838d+'/'+_0x41a475;return{'parentSegment':_0x30838d,'segmentName':_0x41a475,'folderPath':_0x5e8fcc,'fullPath':_0xbeb587,'resourceType':_0x144a47};}function a116_0x4c42(){const _0x537f47=['isAbsolute','exists','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','replace','startsWith','journey','join','pop','endsWith','test','trim','66965zuJSVt','1513116acZXOC','6nyudVs','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','.yaml','Path\x20cannot\x20be\x20empty','split','segments','slice','48AydbCB','tdx.json','parent_segment','root','No\x20tdx.json\x20found\x20for\x20file:\x20','Relative\x20path\x20cannot\x20be\x20empty','resolve','dirname','length','65944zAiqRq','filter','1068319oBlpZN','parse','Cannot\x20navigate\x20above\x20root','push','readFile','Path\x20attempts\x20to\x20navigate\x20above\x20root','865376ZZweWV','raw','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','substring','3OgqjOJ','File\x20not\x20found:\x20','1934880ecfZKp','5882940HtXFSb'];a116_0x4c42=function(){return _0x537f47;};return a116_0x4c42();}
@@ -1 +1 @@
1
- (function(_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_0x28d1(){const _0x4bfe3f=['25358380vTRLVP','substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','190707vzrRkr','2521798nTJqXY','180IEQWmb','.\x20Child\x20name\x20cannot\x20be\x20empty','2797613uDyflU','83472AXwyKW','Invalid\x20segment\x20reference\x20format:\x20','237200pPLrWu','655485pNFaek','indexOf','90lKRGih','36amtDrk'];a117_0x28d1=function(){return _0x4bfe3f;};return a117_0x28d1();}function a117_0x5b29(_0x2aa6e3,_0x328f03){_0x2aa6e3=_0x2aa6e3-0xe9;const _0x28d178=a117_0x28d1();let _0x5b296b=_0x28d178[_0x2aa6e3];return _0x5b296b;}(function(_0x1cdbb3,_0x13a58c){const _0x3fa86f=a117_0x5b29,_0x4f8277=_0x1cdbb3();while(!![]){try{const _0x46c936=-parseInt(_0x3fa86f(0xf0))/0x1+-parseInt(_0x3fa86f(0xe9))/0x2+-parseInt(_0x3fa86f(0xf7))/0x3*(parseInt(_0x3fa86f(0xf3))/0x4)+parseInt(_0x3fa86f(0xea))/0x5*(parseInt(_0x3fa86f(0xed))/0x6)+parseInt(_0x3fa86f(0xec))/0x7+parseInt(_0x3fa86f(0xef))/0x8*(-parseInt(_0x3fa86f(0xf2))/0x9)+parseInt(_0x3fa86f(0xf4))/0xa;if(_0x46c936===_0x13a58c)break;else _0x4f8277['push'](_0x4f8277['shift']());}catch(_0x44ae95){_0x4f8277['push'](_0x4f8277['shift']());}}}(a117_0x28d1,0x9f03c));export function parseSegmentRef(_0x5d67ce){const _0xd40435=a117_0x5b29,_0x43e10a=_0x5d67ce[_0xd40435(0xf1)]('/');if(_0x43e10a===-0x1)return{'parentId':_0x5d67ce};if(_0x43e10a===0x0)throw new Error(_0xd40435(0xee)+_0x5d67ce+_0xd40435(0xf6));const _0x4ba9e4=_0x5d67ce[_0xd40435(0xf5)](0x0,_0x43e10a),_0x56848b=_0x5d67ce['substring'](_0x43e10a+0x1);if(_0x56848b==='')throw new Error(_0xd40435(0xee)+_0x5d67ce+_0xd40435(0xeb));return{'parentId':_0x4ba9e4,'childId':_0x56848b};}
@@ -1 +1 @@
1
- (function(_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(_0x16a1f4,_0xb44aa4){const _0x1477df=a118_0x54f3,_0x436d52=_0x16a1f4();while(!![]){try{const _0x4c2960=-parseInt(_0x1477df(0x199))/0x1+-parseInt(_0x1477df(0x16c))/0x2*(-parseInt(_0x1477df(0x186))/0x3)+parseInt(_0x1477df(0x1a4))/0x4*(-parseInt(_0x1477df(0x184))/0x5)+-parseInt(_0x1477df(0x18f))/0x6*(parseInt(_0x1477df(0x17c))/0x7)+parseInt(_0x1477df(0x18c))/0x8+parseInt(_0x1477df(0x172))/0x9+-parseInt(_0x1477df(0x183))/0xa*(-parseInt(_0x1477df(0x194))/0xb);if(_0x4c2960===_0xb44aa4)break;else _0x436d52['push'](_0x436d52['shift']());}catch(_0x2ffda2){_0x436d52['push'](_0x436d52['shift']());}}}(a118_0x2f16,0x9ad7c));import a118_0x4bd61d from'path';import{sanitizeFileName}from'../../utils/string-utils.js';function a118_0x2f16(){const _0x47d8d2=['No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','resolve','File\x20not\x20found:\x20','824648LHcrrh','match','error','invalid_yaml','No\x20tdx.json\x20found\x20for\x20file:\x20','370617dlDJiK','segment','cwd','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','configDir','Not\x20a\x20YAML\x20file:\x20','parentSegment','context','segmentName','startsWith','directory','58648NecGMK','includes','6aVFiWo','replace','readFile','root','exists','File\x20not\x20found','10609695CxJkmN','type','trim','no_config','extname','parent_segment','basename','file','parent_name','Parent\x20segment\x20not\x20specified','21KnuzsJ','relative','scopedFolderPath','No\x20tdx.json\x20found','file_not_found','isScoped','string','10WGxxsc','80EYLugz','tdx.json','171363WXGDRA','journey','dirname','folderPath','isDirectory','message','7809152YYWDCj','isFile','resourceType','2323770fIKqWw','parse'];a118_0x2f16=function(){return _0x47d8d2;};return a118_0x2f16();}import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';function a118_0x54f3(_0x1b8adb,_0x1d7d07){_0x1b8adb=_0x1b8adb-0x16b;const _0x2f1620=a118_0x2f16();let _0x54f306=_0x2f1620[_0x1b8adb];return _0x54f306;}import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x49efcb){const _0x455cb2=a118_0x54f3;return _0x49efcb[_0x455cb2(0x173)]!==_0x455cb2(0x196);}export function isScopedResolution(_0x221ca1){const _0x2a0bd6=a118_0x54f3;return _0x221ca1[_0x2a0bd6(0x173)]===_0x2a0bd6(0x1a3)||_0x221ca1[_0x2a0bd6(0x173)]===_0x2a0bd6(0x179)||_0x221ca1[_0x2a0bd6(0x173)]===_0x2a0bd6(0x1a0);}export function getScopedDetails(_0x3325a1){const _0x46421b=a118_0x54f3;if(isScopedResolution(_0x3325a1))return{'isScoped':_0x3325a1['isScoped'],'scopedFolderPath':_0x3325a1[_0x46421b(0x17e)]};return undefined;}async function findTdxConfigAsync(_0xb8622b,_0x2fb0ab){const _0x2de3c0=a118_0x54f3;let _0x56c153=a118_0x4bd61d['resolve'](_0xb8622b);const _0x2e78d5=a118_0x4bd61d[_0x2de3c0(0x190)](_0x56c153)[_0x2de3c0(0x16f)];while(_0x56c153!==_0x2e78d5){const _0x588d94=a118_0x4bd61d['join'](_0x56c153,_0x2de3c0(0x185));if(await _0x2fb0ab[_0x2de3c0(0x170)](_0x588d94))try{const _0x47897d=await _0x2fb0ab[_0x2de3c0(0x16e)](_0x588d94),_0x314e0a=JSON[_0x2de3c0(0x190)](_0x47897d);if(_0x314e0a[_0x2de3c0(0x177)]&&typeof _0x314e0a[_0x2de3c0(0x177)]===_0x2de3c0(0x182))return{'configPath':_0x588d94,'configDir':_0x56c153,'parentSegment':_0x314e0a[_0x2de3c0(0x177)]};}catch{}_0x56c153=a118_0x4bd61d[_0x2de3c0(0x188)](_0x56c153);}return null;}function calculateScopedPath(_0x31d706,_0x2802b3){const _0x2342ea=a118_0x54f3,_0x5d4296=a118_0x4bd61d[_0x2342ea(0x17d)](_0x2802b3,_0x31d706),_0x4b2b34=_0x5d4296!==''&&_0x5d4296!=='.'&&!_0x5d4296[_0x2342ea(0x1a2)]('..');return{'isScoped':_0x4b2b34,'scopedFolderPath':_0x4b2b34?_0x5d4296[_0x2342ea(0x16d)](/\\/g,'/'):''};}export async function resolveTarget(_0x47400c){const _0x5cda6a=a118_0x54f3,{arg:_0x2946fe,contextParent:_0xd8079a,cwd:cwd=process[_0x5cda6a(0x19b)](),fs:fs=nodeFileSystem}=_0x47400c;if(_0x2946fe&&isYamlFilePath(_0x2946fe))try{const _0x5dca3a=await resolveYamlFilePath(_0x2946fe,fs),_0x49c7e9=a118_0x4bd61d['resolve'](_0x2946fe),_0x314f54=a118_0x4bd61d['dirname'](_0x49c7e9),_0x3c380f=await findTdxConfigAsync(_0x314f54,fs);if(!_0x3c380f){if(_0xd8079a){const _0x212e26=a118_0x4bd61d['dirname'](_0x49c7e9);return{'type':_0x5cda6a(0x179),'parentName':_0xd8079a,'targetDir':_0x212e26,'configRoot':_0x212e26,'filePath':_0x49c7e9,'resourceName':_0x5dca3a['segmentName'],'folderPath':_0x5dca3a['folderPath'],'resourceType':_0x5dca3a[_0x5cda6a(0x18e)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5cda6a(0x196),'errorCode':_0x5cda6a(0x175),'message':_0x5cda6a(0x198)+_0x2946fe,'arg':_0x2946fe,'helpText':_0x5cda6a(0x19c)};}const _0xbcaeb9=calculateScopedPath(_0x314f54,_0x3c380f[_0x5cda6a(0x19d)]);return{'type':_0x5cda6a(0x179),'parentName':_0x3c380f[_0x5cda6a(0x19f)],'targetDir':_0x3c380f[_0x5cda6a(0x19d)],'configRoot':_0x3c380f['configDir'],'filePath':_0x49c7e9,'resourceName':_0x5dca3a[_0x5cda6a(0x1a1)],'folderPath':_0x5dca3a[_0x5cda6a(0x189)],'resourceType':_0x5dca3a['resourceType'],'isScoped':_0xbcaeb9[_0x5cda6a(0x181)],'scopedFolderPath':_0xbcaeb9[_0x5cda6a(0x17e)]};}catch(_0x71c549){const _0x223199=_0x71c549 instanceof Error?_0x71c549[_0x5cda6a(0x18b)]:String(_0x71c549);if(_0x223199[_0x5cda6a(0x16b)](_0x5cda6a(0x171)))return{'type':'error','errorCode':_0x5cda6a(0x180),'message':_0x5cda6a(0x193)+_0x2946fe,'arg':_0x2946fe};if(_0x223199[_0x5cda6a(0x16b)](_0x5cda6a(0x17f))){if(_0xd8079a){const _0x503e82=a118_0x4bd61d[_0x5cda6a(0x192)](_0x2946fe);if(await fs[_0x5cda6a(0x170)](_0x503e82)){const _0x30e4bf=a118_0x4bd61d[_0x5cda6a(0x188)](_0x503e82),_0x36c813=await fs[_0x5cda6a(0x16e)](_0x503e82),_0x351efe=_0x36c813['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x25655f=_0x36c813[_0x5cda6a(0x195)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4ce6e2=_0x351efe?_0x351efe[0x1][_0x5cda6a(0x174)]():a118_0x4bd61d[_0x5cda6a(0x178)](_0x2946fe,a118_0x4bd61d[_0x5cda6a(0x176)](_0x2946fe)),_0x55ce70=_0x25655f&&_0x25655f[0x1][_0x5cda6a(0x174)]()==='journey'?_0x5cda6a(0x187):_0x5cda6a(0x19a);return{'type':_0x5cda6a(0x179),'parentName':_0xd8079a,'targetDir':_0x30e4bf,'configRoot':_0x30e4bf,'filePath':_0x503e82,'resourceName':_0x4ce6e2,'folderPath':'','resourceType':_0x55ce70,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0x5cda6a(0x175),'message':_0x5cda6a(0x198)+_0x2946fe,'arg':_0x2946fe,'helpText':_0x5cda6a(0x19c)};}return{'type':_0x5cda6a(0x196),'errorCode':_0x5cda6a(0x197),'message':_0x223199,'arg':_0x2946fe};}if(_0x2946fe){const _0x334b3b=a118_0x4bd61d[_0x5cda6a(0x192)](cwd,_0x2946fe);let _0x58863b=null;try{_0x58863b=await fs['stat'](_0x334b3b);}catch{}if(_0x58863b?.[_0x5cda6a(0x18a)]()){const _0x49298=await findTdxConfigAsync(_0x334b3b,fs);if(_0x49298){const _0x193bb8=calculateScopedPath(_0x334b3b,_0x49298[_0x5cda6a(0x19d)]);return{'type':'directory','parentName':_0x49298[_0x5cda6a(0x19f)],'targetDir':_0x334b3b,'configRoot':_0x49298['configDir'],'isScoped':_0x193bb8['isScoped'],'scopedFolderPath':_0x193bb8['scopedFolderPath']};}if(_0xd8079a)return{'type':_0x5cda6a(0x1a3),'parentName':_0xd8079a,'targetDir':_0x334b3b,'configRoot':_0x334b3b,'isScoped':![],'scopedFolderPath':''};return{'type':_0x5cda6a(0x196),'errorCode':'no_config','message':_0x5cda6a(0x191)+_0x2946fe,'arg':_0x2946fe,'helpText':_0x5cda6a(0x19c)};}if(_0x58863b?.[_0x5cda6a(0x18d)]())return{'type':_0x5cda6a(0x196),'errorCode':_0x5cda6a(0x197),'message':_0x5cda6a(0x19e)+_0x2946fe,'arg':_0x2946fe,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0xeb6612=sanitizeFileName(_0x2946fe),_0x14a681=getSegmentRootDir(_0xeb6612,cwd);return{'type':_0x5cda6a(0x17a),'parentName':_0x2946fe,'targetDir':_0x14a681,'configRoot':_0x14a681};}const _0x27bbf0=await findTdxConfigAsync(cwd,fs);if(_0x27bbf0){const _0x3b9bac=calculateScopedPath(cwd,_0x27bbf0[_0x5cda6a(0x19d)]);return{'type':_0x5cda6a(0x1a0),'parentName':_0x27bbf0['parentSegment'],'targetDir':cwd,'configRoot':_0x27bbf0[_0x5cda6a(0x19d)],'isScoped':_0x3b9bac[_0x5cda6a(0x181)],'scopedFolderPath':_0x3b9bac[_0x5cda6a(0x17e)]};}if(_0xd8079a){const _0x3dcd2b=sanitizeFileName(_0xd8079a),_0x404827=getSegmentRootDir(_0x3dcd2b,cwd);return{'type':_0x5cda6a(0x1a0),'parentName':_0xd8079a,'targetDir':_0x404827,'configRoot':_0x404827,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5cda6a(0x196),'errorCode':'no_parent','message':_0x5cda6a(0x17b),'helpText':'Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure'};}