@treasuredata/tdx 0.14.2 → 0.14.4

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 (149) 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/api-command.js +1 -1
  8. package/dist/commands/auth-command.d.ts.map +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-command.js.map +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.d.ts.map +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-command.js.map +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-command.js +1 -1
  22. package/dist/commands/job-command.js +1 -1
  23. package/dist/commands/journey-command.js +1 -1
  24. package/dist/commands/journey-validate-command.js +1 -1
  25. package/dist/commands/llm-command.js +1 -1
  26. package/dist/commands/llm-proxy.js +1 -1
  27. package/dist/commands/parent-segment-command.js +1 -1
  28. package/dist/commands/profile-command.js +1 -1
  29. package/dist/commands/profiles-command.js +1 -1
  30. package/dist/commands/query-command.js +1 -1
  31. package/dist/commands/segment-command.js +1 -1
  32. package/dist/commands/segment-create-command.js +1 -1
  33. package/dist/commands/segment-fields-command.js +1 -1
  34. package/dist/commands/segment-pull-command.js +1 -1
  35. package/dist/commands/segment-push-command.js +1 -1
  36. package/dist/commands/segment-update-command.js +1 -1
  37. package/dist/commands/segment-use-command.js +1 -1
  38. package/dist/commands/segment-validate-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/tables.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.d.ts +15 -0
  54. package/dist/core/profile.d.ts.map +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/profile.js.map +1 -1
  57. package/dist/core/project-config.js +1 -1
  58. package/dist/core/session.js +1 -1
  59. package/dist/core/user-cache.js +1 -1
  60. package/dist/core/version.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/proxy/anthropic-adapter.js +1 -1
  63. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  66. package/dist/proxy/context-signature.js +1 -1
  67. package/dist/proxy/conversation-utils.js +1 -1
  68. package/dist/proxy/passthrough-server.d.ts +13 -2
  69. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/passthrough-server.js.map +1 -1
  72. package/dist/proxy/server.js +1 -1
  73. package/dist/proxy/session-cache.js +1 -1
  74. package/dist/proxy/sse-usage-parser.js +1 -1
  75. package/dist/sdk/agent/agent-config.js +1 -1
  76. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  77. package/dist/sdk/agent/agent-yaml.js +1 -1
  78. package/dist/sdk/api.js +1 -1
  79. package/dist/sdk/client/cdp-api-client.js +1 -1
  80. package/dist/sdk/client/endpoints.js +1 -1
  81. package/dist/sdk/client/engage-api-client.js +1 -1
  82. package/dist/sdk/client/http-client.js +1 -1
  83. package/dist/sdk/client/llm-api-client.js +1 -1
  84. package/dist/sdk/client/rate-limiter.js +1 -1
  85. package/dist/sdk/client/td-api-client.js +1 -1
  86. package/dist/sdk/client/trino-api-client.js +1 -1
  87. package/dist/sdk/client/workflow-client.js +1 -1
  88. package/dist/sdk/connection-validator.js +1 -1
  89. package/dist/sdk/connection.js +1 -1
  90. package/dist/sdk/engage.js +1 -1
  91. package/dist/sdk/errors.js +1 -1
  92. package/dist/sdk/index.js +1 -1
  93. package/dist/sdk/io/index.js +1 -1
  94. package/dist/sdk/io/node-filesystem.js +1 -1
  95. package/dist/sdk/job.js +1 -1
  96. package/dist/sdk/journey.js +1 -1
  97. package/dist/sdk/llm/chat-cache.js +1 -1
  98. package/dist/sdk/llm/index.js +1 -1
  99. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  100. package/dist/sdk/llm/model-aliases.js +1 -1
  101. package/dist/sdk/llm/model-factors.js +1 -1
  102. package/dist/sdk/query/index.js +1 -1
  103. package/dist/sdk/query/sql-parser.js +1 -1
  104. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  105. package/dist/sdk/segment/fields-display.js +1 -1
  106. package/dist/sdk/segment/file-discovery.js +1 -1
  107. package/dist/sdk/segment/journey-utils.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-workflow.js +1 -1
  113. package/dist/sdk/segment/resolution-context.js +1 -1
  114. package/dist/sdk/segment/segment-path-parser.js +1 -1
  115. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  116. package/dist/sdk/segment/target-resolution.js +1 -1
  117. package/dist/sdk/segment/tdx-config.js +1 -1
  118. package/dist/sdk/segment/validate-files.js +1 -1
  119. package/dist/sdk/segment/yaml-validator.js +1 -1
  120. package/dist/sdk/segment.js +1 -1
  121. package/dist/sdk/types/index.js +1 -1
  122. package/dist/sdk/types/progress.js +1 -1
  123. package/dist/sdk/user.js +1 -1
  124. package/dist/sdk/util/format-detector.js +1 -1
  125. package/dist/sdk/util/formatters.js +1 -1
  126. package/dist/sdk/util/index.js +1 -1
  127. package/dist/sdk/util/tree-formatter.js +1 -1
  128. package/dist/sdk/workflow/clone-workflow.js +1 -1
  129. package/dist/sdk/workflow/index.js +1 -1
  130. package/dist/sdk/workflow/pull-workflow.js +1 -1
  131. package/dist/sdk/workflow/push-workflow.js +1 -1
  132. package/dist/sdk/workflow/tdx-config.js +1 -1
  133. package/dist/sdk/workflow/workflow-utils.js +1 -1
  134. package/dist/utils/async.js +1 -1
  135. package/dist/utils/colors.js +1 -1
  136. package/dist/utils/diff.js +1 -1
  137. package/dist/utils/file-permissions.js +1 -1
  138. package/dist/utils/json-loader.js +1 -1
  139. package/dist/utils/option-validation.js +1 -1
  140. package/dist/utils/port.js +1 -1
  141. package/dist/utils/process.js +1 -1
  142. package/dist/utils/prompt.js +1 -1
  143. package/dist/utils/spinner.js +1 -1
  144. package/dist/utils/sse-parser.js +1 -1
  145. package/dist/utils/string-utils.js +1 -1
  146. package/dist/utils/table-ref-parser.js +1 -1
  147. package/dist/utils/tdx-logger.js +1 -1
  148. package/dist/utils/version-check.js +1 -1
  149. package/package.json +1 -1
@@ -1 +1 @@
1
- function a100_0x5482(_0x2b5ddd,_0x2e8470){_0x2b5ddd=_0x2b5ddd-0xd2;const _0x303639=a100_0x3036();let _0x54823e=_0x303639[_0x2b5ddd];return _0x54823e;}const a100_0x525e79=a100_0x5482;(function(_0x16ffb5,_0x599daa){const _0x57d061=a100_0x5482,_0x18fd95=_0x16ffb5();while(!![]){try{const _0x2a2121=parseInt(_0x57d061(0x158))/0x1*(parseInt(_0x57d061(0x111))/0x2)+-parseInt(_0x57d061(0xe7))/0x3*(parseInt(_0x57d061(0x133))/0x4)+parseInt(_0x57d061(0x132))/0x5+-parseInt(_0x57d061(0x173))/0x6+-parseInt(_0x57d061(0x121))/0x7*(parseInt(_0x57d061(0xee))/0x8)+parseInt(_0x57d061(0x194))/0x9*(parseInt(_0x57d061(0xfc))/0xa)+parseInt(_0x57d061(0x191))/0xb*(parseInt(_0x57d061(0x190))/0xc);if(_0x2a2121===_0x599daa)break;else _0x18fd95['push'](_0x18fd95['shift']());}catch(_0xe22a48){_0x18fd95['push'](_0x18fd95['shift']());}}}(a100_0x3036,0xcd4f4));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a100_0x525e79(0x119);export const PENDING_ACTIVATION_PREFIX=a100_0x525e79(0xe5);export function createPendingSegmentId(_0x18d795){return''+PENDING_SEGMENT_PREFIX+_0x18d795+'__';}export function isPendingSegmentId(_0x3d087d){const _0x2f1faa=a100_0x525e79;return _0x3d087d[_0x2f1faa(0x16b)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5483ec){const _0x5c20f5=a100_0x525e79;return _0x5483ec[_0x5c20f5(0x105)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x32f828){return''+PENDING_ACTIVATION_PREFIX+_0x32f828+'__';}export function isPendingActivationId(_0x48fd25){const _0x5dca6a=a100_0x525e79;return _0x48fd25[_0x5dca6a(0x16b)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x522beb){return _0x522beb['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x2a8d2e,_0x119216){const _0x3aa9e2=a100_0x525e79,_0x3e69c8=_0x2a8d2e+'::'+(_0x119216[_0x3aa9e2(0x126)]()||_0x3aa9e2(0x157)),_0x89a486=createHash(_0x3aa9e2(0xde))[_0x3aa9e2(0x168)](_0x3e69c8)[_0x3aa9e2(0x169)]('hex')['slice'](0x0,0xc);return _0x3aa9e2(0xf0)+_0x89a486;}export function ensureJourneyDefaults(_0x2f1642){const _0xa09752=a100_0x525e79;!_0x2f1642[_0xa09752(0x124)]&&(_0x2f1642[_0xa09752(0x124)]=''),!_0x2f1642[_0xa09752(0x128)]&&(_0x2f1642[_0xa09752(0x128)]=_0xa09752(0x184));}export function resolveTDFolderPath(_0x2dff36,_0x3f8d72,_0x5cc9fa){const _0x1cfd7a=a100_0x525e79;if(!_0x3f8d72)return _0x2dff36;if(_0x2dff36===_0x5cc9fa||_0x2dff36[_0x1cfd7a(0x16b)](_0x5cc9fa+'/'))return _0x2dff36;return _0x2dff36?_0x5cc9fa+'/'+_0x2dff36:_0x5cc9fa;}export function addFoldersToCreate(_0x44c058,_0x37e8df,_0x17e130){const _0xcc2941=a100_0x525e79;if(!_0x44c058)return;if(_0x37e8df[_0xcc2941(0x18b)](_0x44c058))return;const _0x32f5f0=_0x44c058['split']('/');let _0x34b49a='';for(const _0x13e957 of _0x32f5f0){_0x34b49a=_0x34b49a?_0x34b49a+'/'+_0x13e957:_0x13e957,!_0x37e8df[_0xcc2941(0x18b)](_0x34b49a)&&_0x17e130[_0xcc2941(0x125)](_0x34b49a);}}import*as a100_0x931458 from'yaml';import{readFileSync}from'fs';import a100_0x2084fa from'path';import{isJourneyDef,parseYamlString as a100_0x327f5d,toYamlString as a100_0x1a6bed,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x28d5b6){const _0x45158d=a100_0x525e79;if(Array[_0x45158d(0xda)](_0x28d5b6))return'['+_0x28d5b6[_0x45158d(0x199)](_0x1aee53=>stableStringify(_0x1aee53))[_0x45158d(0x149)](',')+']';if(_0x28d5b6&&typeof _0x28d5b6===_0x45158d(0x103)){const _0x36c571=_0x28d5b6,_0x4c4d74=Object[_0x45158d(0x12e)](_0x36c571)[_0x45158d(0xe4)](),_0x16d5ea=_0x4c4d74[_0x45158d(0x199)](_0x4139a9=>'\x22'+_0x4139a9+'\x22:'+stableStringify(_0x36c571[_0x4139a9]));return'{'+_0x16d5ea[_0x45158d(0x149)](',')+'}';}const _0x464166=JSON[_0x45158d(0x11e)](_0x28d5b6);return _0x464166===undefined?'null':_0x464166;}function activationSignature(_0x35cc8d){const _0x41d854=a100_0x525e79,_0x2c1fd7={'connection':_0x35cc8d['connection'],..._0x35cc8d['all_columns']!==undefined&&{'all_columns':_0x35cc8d[_0x41d854(0xef)]},..._0x35cc8d[_0x41d854(0x186)]!==undefined&&{'columns':_0x35cc8d['columns']},..._0x35cc8d[_0x41d854(0xec)]!==undefined&&{'behavior':_0x35cc8d['behavior']},..._0x35cc8d[_0x41d854(0x198)]!==undefined&&{'schedule':_0x35cc8d[_0x41d854(0x198)]},..._0x35cc8d[_0x41d854(0x11d)]!==undefined&&{'notification':_0x35cc8d[_0x41d854(0x11d)]},..._0x35cc8d[_0x41d854(0x139)]!==undefined&&{'connector_config':_0x35cc8d['connector_config']},..._0x35cc8d['activation_template_id']!==undefined&&{'activation_template_id':_0x35cc8d[_0x41d854(0x13c)]}};return stableStringify(_0x2c1fd7);}export async function prepareSegmentFiles(_0x5754ec,_0x546c1d,_0x2e171a,_0x944466,_0x3ec9e3){const _0x3a08d6=a100_0x525e79,{activationDefToCreateRequest:_0x42e80a}=await import('./child-segment-yaml.js'),_0x4ad9af=[],_0x2f95b5=new Set();for(const {yamlConfig:_0x1031db,folderPath:_0x2ed790,sourcePath:_0x3b34e9}of _0x5754ec){const _0xe67444=resolveTDFolderPath(_0x2ed790,_0x944466,_0x3ec9e3),_0x35a61a=_0xe67444+':'+_0x1031db[_0x3a08d6(0x16d)],_0x4e4531=_0x546c1d[_0x3a08d6(0x14e)][_0x3a08d6(0x1ae)](_0x35a61a),_0x14f5fb=_0x4e4531?_0x546c1d[_0x3a08d6(0x17f)][_0x3a08d6(0x1ae)](_0x4e4531['id'])||[]:[];addFoldersToCreate(_0xe67444,_0x546c1d[_0x3a08d6(0x175)],_0x2f95b5);const _0x299249=calculateActivationActions(_0x1031db[_0x3a08d6(0x177)]||[],_0x14f5fb,_0x546c1d['idToEmailMap'],_0x546c1d['connectionIdToNameMap']);for(const _0x1e861f of _0x299249){(_0x1e861f[_0x3a08d6(0x183)]===_0x3a08d6(0x17a)||_0x1e861f[_0x3a08d6(0x183)]===_0x3a08d6(0x168))&&_0x1e861f[_0x3a08d6(0x109)]&&(_0x1e861f['validatedRequest']=await _0x42e80a(_0x1e861f[_0x3a08d6(0x109)],_0x2e171a));}const _0x45fa84=calculateSegmentDiff(_0x1031db,_0x4e4531,_0x14f5fb,_0x546c1d[_0x3a08d6(0x112)],_0x546c1d['connectionIdToNameMap']);_0x4ad9af[_0x3a08d6(0xdf)]({'relativePath':_0x1031db['name'],'absolutePath':_0x3b34e9,'yamlConfig':_0x1031db,'folderPath':_0xe67444,'existingSegment':_0x4e4531,'existingActivations':_0x14f5fb,'isNew':_0x45fa84[_0x3a08d6(0x185)],'hasChanges':_0x45fa84[_0x3a08d6(0x15d)],'diff':_0x45fa84[_0x3a08d6(0xfd)],'activationActions':_0x299249});}return{'segmentFiles':_0x4ad9af,'foldersToCreate':_0x2f95b5};}export async function prepareJourneyFiles(_0x128d22,_0x37eaa8,_0x4e9b41,_0x37b092){const _0x3ab91a=a100_0x525e79,_0x593e73=[],_0x1267cb=new Set();for(const {yamlConfig:_0x5409a2,folderPath:_0x10c385,sourcePath:_0x303bb6}of _0x128d22){const _0x16a0b8=resolveTDFolderPath(_0x10c385,_0x4e9b41,_0x37b092),_0x1fb673=_0x16a0b8+':'+_0x5409a2[_0x3ab91a(0x16d)],_0x411147=_0x37eaa8['journeyBundlesByFolderAndName'][_0x3ab91a(0x1ae)](_0x1fb673);let _0x7994b4,_0x2aac0c;if(_0x411147&&_0x411147[_0x3ab91a(0x104)]>0x0){const _0x4b258b=buildLocalExpandedRuleMappings(_0x5409a2),{createYamlContext:_0x10cc0,prefetchJourneySegments:_0x39fa8b}=createPushYamlContextForBundle(_0x37eaa8[_0x3ab91a(0x156)],_0x37eaa8['parentId'],_0x37eaa8[_0x3ab91a(0x1a8)],_0x4b258b,_0x37eaa8[_0x3ab91a(0x112)],_0x37eaa8[_0x3ab91a(0x166)],_0x37eaa8[_0x3ab91a(0x1a4)],_0x37eaa8[_0x3ab91a(0xe3)]);await _0x39fa8b(_0x411147['map'](_0x44a59b=>_0x44a59b['id']));const _0x1eee00=hasMultipleVersions(_0x5409a2),_0x266d35=async _0x3bbef3=>{const _0x3a1bc7=_0x3ab91a,_0x4dd789=_0x37eaa8[_0x3a1bc7(0xe3)]?.[_0x3a1bc7(0x1ae)](_0x3bbef3);if(_0x4dd789)return _0x4dd789;return _0x37eaa8[_0x3a1bc7(0x13b)]({'journeyId':_0x3bbef3,'journeyName':_0x5409a2[_0x3a1bc7(0x16d)],'isMultiVersion':_0x411147[_0x3a1bc7(0x104)]>0x1});};if(_0x1eee00&&_0x411147[_0x3ab91a(0x104)]>0x1){const _0x2e2375=[];for(const _0xe33e81 of _0x411147){const _0x3b0bc1=_0xe33e81[_0x3ab91a(0x182)]||0x1;_0x37eaa8['progress']?.[_0x3ab91a(0x168)](_0x3ab91a(0x10a)+_0x5409a2[_0x3ab91a(0x16d)]+'\x20v'+_0x3b0bc1);const _0x23d069=await _0x266d35(_0xe33e81['id']),_0x46d73a=_0x10cc0(_0xe33e81['id']),_0x203955=await journeyResponseToDef(_0x23d069,_0x46d73a);_0x2e2375[_0x3ab91a(0xdf)]({'item':_0xe33e81,'yaml':_0x203955});}const _0x145c16=buildLocalRuleToNameMappingFromJourney(_0x5409a2);_0x2aac0c=buildMergedJourneyDef(_0x2e2375,_0x145c16);const _0x549b48=Math[_0x3ab91a(0x159)](..._0x2e2375['map'](_0x1e6021=>_0x1e6021[_0x3ab91a(0x12f)][_0x3ab91a(0x182)]||0x0)),_0x30fc21=_0x411147[_0x3ab91a(0x14d)](_0x16ed85=>(_0x16ed85[_0x3ab91a(0x182)]||0x0)===_0x549b48);_0x30fc21&&(_0x37eaa8['progress']?.[_0x3ab91a(0x168)](_0x3ab91a(0x10a)+_0x5409a2[_0x3ab91a(0x16d)]+'\x20v'+_0x549b48),_0x7994b4=await _0x266d35(_0x30fc21['id']));}else{const _0x206ad8=_0x411147[_0x411147[_0x3ab91a(0x104)]-0x1];_0x37eaa8[_0x3ab91a(0xd8)]?.[_0x3ab91a(0x168)](_0x3ab91a(0x10a)+_0x5409a2['name']),_0x7994b4=await _0x266d35(_0x206ad8['id']);const _0x46cca5=_0x10cc0(_0x206ad8['id']),_0x1cad5d=await journeyResponseToDef(_0x7994b4,_0x46cca5),_0x5ed5e7=buildLocalRuleToNameMappingFromJourney(_0x5409a2);_0x2aac0c=buildMergedJourneyDef([{'item':_0x206ad8,'yaml':_0x1cad5d}],_0x5ed5e7);}}addFoldersToCreate(_0x16a0b8,_0x37eaa8[_0x3ab91a(0x175)],_0x1267cb);const _0x5d6cca=calculateJourneyDiff(_0x5409a2,_0x2aac0c);_0x593e73[_0x3ab91a(0xdf)]({'relativePath':_0x5409a2[_0x3ab91a(0x16d)],'absolutePath':_0x303bb6,'yamlConfig':_0x5409a2,'folderPath':_0x16a0b8,'existingJourney':_0x7994b4,'isNew':_0x5d6cca[_0x3ab91a(0x185)],'hasChanges':_0x5d6cca[_0x3ab91a(0x15d)],'diff':_0x5d6cca[_0x3ab91a(0xfd)]});}return{'journeyFiles':_0x593e73,'foldersToCreate':_0x1267cb};}export function calculateActivationActions(_0x5d8861,_0x503c43,_0x23117b,_0x41c063){const _0x437156=a100_0x525e79,_0x5915d9=[],_0x4838a9=new Map();for(const _0x34ed37 of _0x503c43){_0x4838a9[_0x437156(0x189)](_0x34ed37[_0x437156(0x16d)],_0x34ed37);}const _0x4fc992=new Map();for(const _0xb8d755 of _0x5d8861){_0x4fc992[_0x437156(0x189)](_0xb8d755[_0x437156(0x16d)],_0xb8d755);}for(const _0x5cced1 of _0x5d8861){const _0x17cffd=_0x4838a9[_0x437156(0x1ae)](_0x5cced1['name']);if(!_0x17cffd)_0x5915d9[_0x437156(0xdf)]({'type':'create','name':_0x5cced1[_0x437156(0x16d)],'yamlActivation':_0x5cced1});else{const _0x4c2ba0=activationResponseToDef(_0x17cffd,_0x23117b,_0x41c063),_0x56d836=a100_0x931458[_0x437156(0x11e)](_0x4c2ba0),_0x5f476c=a100_0x931458['stringify'](_0x5cced1);_0x56d836!==_0x5f476c&&_0x5915d9[_0x437156(0xdf)]({'type':_0x437156(0x168),'name':_0x5cced1[_0x437156(0x16d)],'yamlActivation':_0x5cced1,'existingActivation':_0x17cffd});}}for(const _0x4284bd of _0x503c43){!_0x4fc992['has'](_0x4284bd[_0x437156(0x16d)])&&_0x5915d9['push']({'type':_0x437156(0x19b),'name':_0x4284bd[_0x437156(0x16d)],'existingActivation':_0x4284bd});}return _0x5915d9;}export function calculateSegmentDiff(_0x1c08e2,_0x4bd2e0,_0x360760,_0xaf1777,_0x1df965){const _0x4f85b8=segmentToYamlString(_0x1c08e2);if(_0x4bd2e0){const _0x1507d2=segmentWithActivationsToYaml(_0x4bd2e0,_0x360760,undefined,_0xaf1777,_0x1df965),_0x532bcb=segmentToYamlString(_0x1507d2),_0x542b78=generateDiff(_0x532bcb,_0x4f85b8),_0x4f3c6c=hasChanges(_0x542b78);return{'isNew':![],'hasChanges':_0x4f3c6c,'diff':_0x4f3c6c?formatDiffWithColors(_0x542b78):undefined};}const _0x5cc04f=generateDiff('',_0x4f85b8);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5cc04f)};}export function calculateJourneyDiff(_0x1a3b41,_0x4e6dd6){const _0x11cd57=normalizeJourneyDef(_0x1a3b41,_0x1a3b41),_0x2dbd26=a100_0x1a6bed(_0x11cd57);if(_0x4e6dd6){const _0x261b26=normalizeJourneyDef(_0x4e6dd6,_0x1a3b41),_0xdb2e9d=a100_0x1a6bed(_0x261b26),_0xed77c7=generateDiff(_0xdb2e9d,_0x2dbd26),_0x4bdd52=hasChanges(_0xed77c7);return{'isNew':![],'hasChanges':_0x4bdd52,'diff':_0x4bdd52?formatDiffWithColors(_0xed77c7):undefined};}const _0x1903b4=generateDiff('',_0x2dbd26);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1903b4)};}export function findSegmentsToDelete(_0x4b4bd5,_0x274d4f,_0x558c6e,_0xcdbf8e,_0x3f10e4){const _0x183c2b=a100_0x525e79,_0x95dfc5=new Set();for(const {yamlConfig:_0x494b4e,folderPath:_0x3846c5}of _0x274d4f){_0x95dfc5[_0x183c2b(0x125)](_0x3846c5+':'+_0x494b4e[_0x183c2b(0x16d)]);}return _0x4b4bd5[_0x183c2b(0x1a0)](_0x402c17=>{const _0x5dc0e0=_0x183c2b,_0x1d6c77=_0x402c17[_0x5dc0e0(0xd2)]?_0x558c6e['get'](_0x402c17[_0x5dc0e0(0xd2)]['toString']())||'':'',_0xa15a8c=_0x1d6c77+':'+_0x402c17[_0x5dc0e0(0x16d)];if(_0x95dfc5['has'](_0xa15a8c))return![];if(_0x3f10e4)return _0x1d6c77===_0xcdbf8e||_0x1d6c77[_0x5dc0e0(0x16b)](_0xcdbf8e+'/');return!![];});}export function findJourneysToDelete(_0x4c2fb4,_0x21a99e,_0x29a3d9,_0x5da7c6,_0x171fc9){const _0x5d139d=a100_0x525e79,_0x11aa89=new Set();for(const {yamlConfig:_0x25f686,folderPath:_0x14fa38}of _0x21a99e){_0x11aa89[_0x5d139d(0x125)](_0x14fa38+':'+_0x25f686[_0x5d139d(0x16d)]);}return _0x4c2fb4[_0x5d139d(0x1a0)](_0x2109e8=>{const _0x3d4207=_0x5d139d,_0xae1dfd=_0x2109e8[_0x3d4207(0x12d)]?_0x29a3d9[_0x3d4207(0x1ae)](_0x2109e8[_0x3d4207(0x12d)])||'':'',_0x517dc6=_0xae1dfd+':'+_0x2109e8[_0x3d4207(0x1a7)];if(_0x11aa89['has'](_0x517dc6))return![];if(_0x171fc9)return _0xae1dfd===_0x5da7c6||_0xae1dfd[_0x3d4207(0x16b)](_0x5da7c6+'/');return!![];});}export function buildSegmentLookupMap(_0xa4a6fc,_0x18b863){const _0xcdbfe9=a100_0x525e79,_0x54d575=new Map();for(const _0x21645b of _0xa4a6fc){const _0x247821=_0x21645b[_0xcdbfe9(0xd2)]?_0x18b863[_0xcdbfe9(0x1ae)](_0x21645b[_0xcdbfe9(0xd2)][_0xcdbfe9(0x138)]())||'':'',_0x53e8de=_0x247821+':'+_0x21645b[_0xcdbfe9(0x16d)];_0x54d575[_0xcdbfe9(0x189)](_0x53e8de,_0x21645b);}return _0x54d575;}export function buildSegmentNameToIdMap(_0x1e88d3){const _0x384a20=a100_0x525e79,_0x2a2388=new Map();for(const _0x195a76 of _0x1e88d3){_0x2a2388['set'](_0x195a76[_0x384a20(0x16d)],_0x195a76['id']);}return _0x2a2388;}export function buildJourneyBundleLookupMap(_0x36a567,_0x10e86a){const _0x4036c7=a100_0x525e79,_0x29ecb8=new Map();for(const _0x3652a8 of _0x36a567){const _0x310fe3=_0x3652a8['folderId']?_0x10e86a[_0x4036c7(0x1ae)](_0x3652a8['folderId'])||'':'',_0x41f32e=_0x310fe3+':'+_0x3652a8[_0x4036c7(0x1a7)];!_0x29ecb8['has'](_0x41f32e)&&_0x29ecb8[_0x4036c7(0x189)](_0x41f32e,[]),_0x29ecb8[_0x4036c7(0x1ae)](_0x41f32e)[_0x4036c7(0xdf)](_0x3652a8);}for(const _0x4b2df3 of _0x29ecb8['values']()){_0x4b2df3['sort']((_0x1ff893,_0x3d161c)=>(_0x1ff893[_0x4036c7(0x182)]||0x0)-(_0x3d161c[_0x4036c7(0x182)]||0x0));}return _0x29ecb8;}export function collectFoldersToCreate(_0x18a59b,_0x30c2be){const _0x1a2cf2=a100_0x525e79,_0x56c818=new Set();for(const _0x1275c3 of _0x18a59b){if(!_0x1275c3)continue;if(_0x30c2be[_0x1a2cf2(0x18b)](_0x1275c3))continue;const _0x100560=_0x1275c3[_0x1a2cf2(0x1a9)]('/');let _0xaaa542='';for(const _0x7552ec of _0x100560){_0xaaa542=_0xaaa542?_0xaaa542+'/'+_0x7552ec:_0x7552ec,!_0x30c2be[_0x1a2cf2(0x18b)](_0xaaa542)&&_0x56c818['add'](_0xaaa542);}}return _0x56c818;}export function parseAndClassifyYamlFiles(_0x1c048e,_0x13b4dc,_0x382e42){const _0x2a93f8=a100_0x525e79,_0x5ada6a=[],_0x1e035d=[];for(const _0x1cfdb3 of _0x1c048e){const _0xdad03c=a100_0x2084fa[_0x2a93f8(0x14f)](_0x13b4dc,a100_0x2084fa[_0x2a93f8(0x16f)](_0x1cfdb3)),_0x14d5a8=_0xdad03c==='.'?'':_0xdad03c,_0xc545ac=readFileSync(_0x1cfdb3,'utf-8'),_0x352fbd=a100_0x931458[_0x2a93f8(0xed)](_0xc545ac);if(isJourneyDef(_0x352fbd)){const _0x1f1745=a100_0x327f5d(_0xc545ac);_0x1e035d[_0x2a93f8(0xdf)]({'yamlConfig':_0x1f1745,'folderPath':_0x14d5a8,'sourcePath':_0x1cfdb3});}else{if(!_0x382e42?.[_0x2a93f8(0xf6)]){const _0x2835f4=parseSegmentYamlFile(_0xc545ac),_0x3cdee3=normalizeChildSegmentYaml(_0x2835f4);_0x5ada6a[_0x2a93f8(0xdf)]({'yamlConfig':_0x3cdee3,'folderPath':_0x14d5a8,'sourcePath':_0x1cfdb3});}}}return{'segments':_0x5ada6a,'journeys':_0x1e035d};}function a100_0x3036(){const _0x35373b=['Updated\x20journey\x20\x27','create','\x27\x20exit\x20criteria','yamlConfig','JOURNEY_SYNTAX_ERROR','Updated\x20activation\x20\x27','activationsBySegmentId','existingActivation','JOURNEY_UPDATE_ERROR','versionNumber','type','draft','isNew','columns','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','attributes','set','embeddedSegmentNameToId','has','milestone','updated','createdSegmentId','valid','9536856TuGRiG','22chfOek','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','createSegment','198zReAln','segment_updated','activation_updated','localSegmentRules','schedule','map','onProgress','delete','Activation\x20not\x20found:\x20','logInfo','\x27\x20from\x20file:\x20','journeyActivationStepId','filter','activation_deleting','Entry\x20criteria:\x20','activation_created','activationStepsById','activationContext','rule','journeyBundleName','existingSegments','split','existingJourney','Created\x20folder\x20\x27','Activation','NOT_FOUND','get','segmentFolderId','journey_created','with','activation_deleted','\x27...','withProgress','progress','stage\x20\x27','isArray','idToName','./child-segment-yaml.js','slice','sha1','push','unchanged','journeyId','createJourneySegment','journeyById','sort','__pending_act_','listActivations','9RFUSOY','\x20error(s)','reduce','Name\x20has\x20already\x20been\x20taken','ACTIVATION_UPDATE_ERROR','behavior','parse','48VtGsFg','all_columns','journey_entry_criteria_','\x0a\x20\x20','folder_created','absolutePath','parseDocument','deleteSegment','skipSegments','updateSegmentById','SEGMENT_SYNTAX_ERROR','segment_created','entryCriteria','action','625460UchlrO','diff','resolveSegment','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','created','flatMap','../../utils/async.js','object','length','replace','Deleting\x20activation\x20\x27','entry_criteria','stages','yamlActivation','Fetching\x20','Stage\x20\x27','all','listSegments','journeys','journey_creating','createActivation','387062idDULY','idToEmailMap','./journey-yaml.js','activationParams','segments','segment_deleted','\x27\x20decision\x20point\x20branch\x20\x27','verbose','__pending_','SEGMENT_NOT_FOUND','activation_','activation_updating','notification','stringify','logSuccess','parentId','1692131lOcMfo','validatedRequest','journeyStages','description','add','trim','toLowerCase','state','segmentId','index','segment_updating','relationships','folderId','keys','item','from','createdSegmentIds','5580320OzljGY','1789884diIJQx','utf-8','getJourney','createFolder','goal','toString','connector_config','journey','fetchJourney','activation_template_id','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','kind','\x27\x20wait\x20condition','user','Creating\x20activation\x20\x27','Failed\x20to\x20','Deleted\x20activation\x20\x27','\x20activation\x20\x27','steps','folderPath','WaitStep','DecisionPoint','join','\x20(referenced\x20in\x20journey\x20','Updated\x20segment\x20\x27','errors','find','segmentByFolderAndName','relative','segmentNameToId','deleted','folder_creating','Created\x20segment\x20\x27','existingSegment','ACTIVATION_SYNTAX_ERROR','deps','segment','5MPjMHd','max','activationActions','size','goal\x20criteria','hasChanges','decision_point','segment_deleting','includes','embedded_activation_creating','rootFolderId','SEGMENT_UPDATE_ERROR','getSegment','\x27\x20not\x20found\x20in\x20journey\x20\x27','connectionIdToNameMap','waitCondition','update','digest','Created\x20activation\x20\x27','startsWith','exitCriterias','name','branches','dirname','Segment\x20not\x20found:\x20','data','embedded_segment_created','8492688CPGinD','embedded_segment_creating','folderPathToId','folder','activations','embedded_activation_created'];a100_0x3036=function(){return _0x35373b;};return a100_0x3036();}export function validateParsedFiles(_0x34859a,_0x4eed29){const _0x5c15e1=a100_0x525e79,_0x326c49=[];for(const {yamlConfig:_0x2c6600,sourcePath:_0x3b7cae}of _0x34859a[_0x5c15e1(0x115)]){const _0x43dd52=readFileSync(_0x3b7cae,_0x5c15e1(0x134)),_0x2934b3=a100_0x931458[_0x5c15e1(0xf4)](_0x43dd52),_0x4d269c=validateSegmentDef(_0x2c6600,{'source':_0x43dd52,'document':_0x2934b3});if(!_0x4d269c['valid']){const _0x234267=a100_0x2084fa[_0x5c15e1(0x14f)](_0x4eed29,_0x3b7cae);_0x326c49[_0x5c15e1(0xdf)]({'filePath':_0x234267,'source':_0x43dd52,'result':_0x4d269c,'isJourney':![]});}}for(const {yamlConfig:_0x577c84,sourcePath:_0x252ade}of _0x34859a[_0x5c15e1(0x10e)]){const _0x1e3cc8=readFileSync(_0x252ade,_0x5c15e1(0x134)),_0x3d56d0=a100_0x931458[_0x5c15e1(0xf4)](_0x1e3cc8),_0x472909=validateJourneyDef(_0x577c84,{'source':_0x1e3cc8,'document':_0x3d56d0});if(!_0x472909[_0x5c15e1(0x18f)]){const _0x2b83fa=a100_0x2084fa[_0x5c15e1(0x14f)](_0x4eed29,_0x252ade);_0x326c49[_0x5c15e1(0xdf)]({'filePath':_0x2b83fa,'source':_0x1e3cc8,'result':_0x472909,'isJourney':!![]});}}return _0x326c49;}export function formatValidationErrors(_0x20d56e){const _0x1b660e=a100_0x525e79,_0x44cb10=[];for(const {filePath:_0x2244e0,source:_0x5a82d3,result:_0x5bc00f,isJourney:_0x4bde6e}of _0x20d56e){const _0x5cbea6=_0x4bde6e?_0x1b660e(0x13a):_0x1b660e(0x157);_0x44cb10[_0x1b660e(0xdf)]('\x0a'+_0x2244e0+'\x20('+_0x5cbea6+'):\x20'+_0x5bc00f[_0x1b660e(0x14c)]['length']+_0x1b660e(0xe8)),_0x44cb10[_0x1b660e(0xdf)](formatValidationResult(_0x5bc00f,_0x5a82d3,_0x2244e0));}return _0x44cb10[_0x1b660e(0x149)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x896a93){const _0x261736=a100_0x525e79,_0x2ee704=new Set(),_0x4b140b=new Map(),_0x4552f1=collectSegmentUsageCounts(_0x896a93);if(_0x896a93['segments'])for(const [_0x453843,_0x3e4f41]of Object['entries'](_0x896a93[_0x261736(0x115)])){_0x2ee704[_0x261736(0x125)](_0x453843);if(_0x3e4f41[_0x261736(0x1a6)]){const _0x274596=yamlRuleToApi(_0x3e4f41[_0x261736(0x1a6)]),_0xf672f6=apiRuleToYaml(_0x274596);_0x4b140b['set'](_0x453843,_0xf672f6);}}const _0xa320a5=new Map();let _0x5ae64a=0x0;for(const [_0x1405e0,_0x2e74d7]of _0x4b140b){const _0x29e473=serializeExpandedRule(_0x2e74d7,_0x4b140b),_0x513775=_0xa320a5[_0x261736(0x1ae)](_0x29e473)||[];_0x513775[_0x261736(0xdf)]({'name':_0x1405e0,'index':_0x5ae64a}),_0xa320a5[_0x261736(0x189)](_0x29e473,_0x513775),_0x5ae64a++;}const _0x475378=new Map();for(const [_0x2bd85b,_0x470eab]of _0xa320a5){const _0x3dc562=_0x470eab[_0x261736(0xdd)]()[_0x261736(0xe4)]((_0x225ba9,_0x2b22a1)=>{const _0x49915a=_0x261736,_0x29bf57=_0x4552f1[_0x49915a(0x1ae)](_0x225ba9[_0x49915a(0x16d)])||0x0,_0x450793=_0x4552f1['get'](_0x2b22a1[_0x49915a(0x16d)])||0x0;if(_0x29bf57!==_0x450793)return _0x450793-_0x29bf57;return _0x225ba9[_0x49915a(0x12a)]-_0x2b22a1[_0x49915a(0x12a)];})[_0x261736(0x199)](_0x28e9fa=>_0x28e9fa['name']),_0x325124=[];for(const _0x3c75cd of _0x3dc562){const _0x3d191e=_0x4552f1['get'](_0x3c75cd)||0x0,_0x2221b4=Math[_0x261736(0x159)](_0x3d191e,0x1);for(let _0x14f857=0x0;_0x14f857<_0x2221b4;_0x14f857++){_0x325124[_0x261736(0xdf)](_0x3c75cd);}}_0x475378[_0x261736(0x189)](_0x2bd85b,_0x325124);}return{'existingLocalSegmentNames':_0x2ee704,'localSegmentRules':_0x4b140b,'localExpandedRuleToNames':_0x475378};}async function buildServerSegmentRuleMap(_0x444b34,_0x226033,_0x83d741,_0x3a333e){const _0x547284=new Map(),_0x282dd1=new Set(),_0x380802=async _0x53ebba=>{const _0x571640=a100_0x5482;if(_0x282dd1[_0x571640(0x18b)](_0x53ebba))return;_0x282dd1[_0x571640(0x125)](_0x53ebba);let _0x30d03d=_0x83d741[_0x571640(0x14d)](_0x527f14=>_0x527f14['id']===_0x53ebba);if(!_0x30d03d)try{_0x30d03d=await _0x444b34[_0x571640(0x157)][_0x571640(0x164)](_0x226033,_0x53ebba);}catch{return;}if(!_0x30d03d?.[_0x571640(0x1a6)])return;const _0x1b39fa=apiRuleToYaml(_0x30d03d['rule']);_0x547284[_0x571640(0x189)](_0x53ebba,_0x1b39fa);const _0x16d739=collectSegmentRefsFromRule(_0x1b39fa);for(const _0x5c8f34 of _0x16d739){await _0x380802(_0x5c8f34);}};for(const _0x57bda8 of _0x3a333e){await _0x380802(_0x57bda8);}return _0x547284;}export function createSegmentIdResolver(_0x55447b,_0x16b080){return async _0x507166=>{const _0x4aec09=a100_0x5482,_0x42e78f=_0x55447b[_0x4aec09(0x1ae)](_0x507166);if(!_0x42e78f)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4aec09(0x170)+_0x507166+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x16b080+'\x27)');return _0x42e78f;};}export function extractRootFolderId(_0x33758b){const _0x549b88=a100_0x525e79;return _0x33758b[_0x549b88(0x12c)]?.['parentSegmentFolder']?.[_0x549b88(0x171)]?.['id']||_0x33758b[_0x549b88(0x12c)]?.['parentFolder']?.[_0x549b88(0x171)]?.['id'];}export function buildConnectionMaps(_0x540ed1){const _0x21d67d=a100_0x525e79,_0x2b1dc2=new Map(),_0x232c6b=new Map(),_0x6e6906=new Map();for(const _0x5bfcb6 of _0x540ed1){_0x2b1dc2[_0x21d67d(0x189)](_0x5bfcb6[_0x21d67d(0x16d)],parseInt(_0x5bfcb6['id'],0xa)),_0x232c6b[_0x21d67d(0x189)](_0x5bfcb6['id'],_0x5bfcb6[_0x21d67d(0x16d)]),_0x6e6906['set'](_0x5bfcb6['name'],_0x5bfcb6['type']);}return{'nameToId':_0x2b1dc2,'idToName':_0x232c6b,'nameToType':_0x6e6906};}export function calculatePushStats(_0x5e1278,_0x69da60,_0x3aad73,_0x4f5ca4,_0x455bc5,_0x2e122b,_0x56a64e){const _0x62a650=a100_0x525e79,_0x50ba74=_0x5e1278[_0x62a650(0x1a0)](_0x2f72f7=>_0x2f72f7[_0x62a650(0x185)]),_0x54a8e6=_0x5e1278[_0x62a650(0x1a0)](_0x513b74=>!_0x513b74[_0x62a650(0x185)]&&_0x513b74[_0x62a650(0x15d)]),_0x4044fa=_0x5e1278[_0x62a650(0x1a0)](_0x492bda=>!_0x492bda['isNew']&&!_0x492bda[_0x62a650(0x15d)]),_0x56cff1=_0x2e122b?_0x4f5ca4:[],_0x360727=_0x69da60['filter'](_0x4bf905=>_0x4bf905['isNew']),_0x464992=_0x69da60[_0x62a650(0x1a0)](_0x5cfb1e=>!_0x5cfb1e[_0x62a650(0x185)]&&_0x5cfb1e[_0x62a650(0x15d)]),_0x127b9f=_0x69da60[_0x62a650(0x1a0)](_0xd19c70=>!_0xd19c70[_0x62a650(0x185)]&&!_0xd19c70['hasChanges']),_0x17b469=_0x2e122b?_0x455bc5:[],_0xdbcaf5=_0x5e1278[_0x62a650(0x101)](_0x19262d=>_0x19262d[_0x62a650(0x15a)]),_0x2947ef=_0xdbcaf5[_0x62a650(0x1a0)](_0x1a1e25=>_0x1a1e25[_0x62a650(0x183)]===_0x62a650(0x17a)),_0x4a324e=_0xdbcaf5['filter'](_0x3e0c0b=>_0x3e0c0b[_0x62a650(0x183)]===_0x62a650(0x168)),_0x1094d9=_0xdbcaf5[_0x62a650(0x1a0)](_0x17976a=>_0x17976a[_0x62a650(0x183)]===_0x62a650(0x19b)),_0x329f4f=Array[_0x62a650(0x130)](_0x3aad73)[_0x62a650(0xe4)](),_0x5055c9=_0x56a64e?![]:_0x50ba74[_0x62a650(0x104)]>0x0||_0x54a8e6[_0x62a650(0x104)]>0x0||_0x56cff1['length']>0x0,_0x4c8093=_0x360727[_0x62a650(0x104)]>0x0||_0x464992[_0x62a650(0x104)]>0x0||_0x17b469[_0x62a650(0x104)]>0x0,_0x3df273=_0x56a64e?![]:_0xdbcaf5[_0x62a650(0x104)]>0x0,_0x20a4f6=_0x329f4f[_0x62a650(0x104)]>0x0;return{'segments':{'new':_0x50ba74,'changed':_0x54a8e6,'unchanged':_0x4044fa,'toDelete':_0x56cff1},'journeys':{'new':_0x360727,'changed':_0x464992,'unchanged':_0x127b9f,'toDelete':_0x17b469},'activations':{'all':_0xdbcaf5,'toCreate':_0x2947ef,'toUpdate':_0x4a324e,'toDelete':_0x1094d9},'folders':{'toCreate':_0x329f4f},'counts':{'segments':{'new':_0x50ba74[_0x62a650(0x104)],'changed':_0x54a8e6[_0x62a650(0x104)],'unchanged':_0x4044fa['length'],'toDelete':_0x56cff1['length']},'journeys':{'new':_0x360727[_0x62a650(0x104)],'changed':_0x464992[_0x62a650(0x104)],'unchanged':_0x127b9f[_0x62a650(0x104)],'toDelete':_0x17b469[_0x62a650(0x104)]},'activations':{'create':_0x2947ef['length'],'update':_0x4a324e[_0x62a650(0x104)],'delete':_0x1094d9[_0x62a650(0x104)]},'folders':_0x329f4f[_0x62a650(0x104)]},'hasChanges':_0x5055c9||_0x4c8093||_0x3df273||_0x20a4f6};}export async function buildPushExecutionContext(_0x2785d9,_0x456852,_0x5cc423,_0x17352b,_0x383f0f,_0x2938f1){const _0x5b5eb8=a100_0x525e79,_0x39c77a=extractRootFolderId(_0x5cc423),{pathToId:_0x11c7dd,idToPath:_0x3fa7bc}=buildFolderMaps(_0x383f0f),_0x102357=buildSegmentNameToIdMap(_0x17352b),_0x35a61d=new Map(),{batchAsync:_0x4a31a7}=await import(_0x5b5eb8(0x102)),[_0x9d51e7,_0x4e0983]=await Promise['all']([_0x2785d9[_0x5b5eb8(0x140)]['buildUserMaps'](),_0x2785d9['connection']['list'](),((async()=>{const _0x579d4e=_0x5b5eb8;!_0x2938f1&&_0x17352b[_0x579d4e(0x104)]>0x0&&await _0x4a31a7(_0x17352b,async _0x18f59a=>{const _0x148d07=_0x579d4e,_0x9b28aa=await _0x2785d9['segment'][_0x148d07(0xe6)](_0x456852,_0x18f59a['id']);_0x35a61d[_0x148d07(0x189)](_0x18f59a['id'],_0x9b28aa);});})())]),{emailToId:_0xc8d2c9,idToEmail:_0x585bb7}=_0x9d51e7,_0x48dd6d=buildConnectionMaps(_0x4e0983);return{'rootFolderId':_0x39c77a,'folderPathToId':_0x11c7dd,'folderIdToPath':_0x3fa7bc,'segmentNameToId':_0x102357,'activationsBySegmentId':_0x35a61d,'emailToIdMap':_0xc8d2c9,'idToEmailMap':_0x585bb7,'connectionNameToIdMap':_0x48dd6d['nameToId'],'connectionIdToNameMap':_0x48dd6d[_0x5b5eb8(0xdb)],'connectionNameToTypeMap':_0x48dd6d['nameToType']};}export function createPushYamlContextForBundle(_0xf9d3c1,_0x53503b,_0x219d99,_0xf64c5a,_0x5e80f8,_0x24bf33,_0xc02559,_0x30892c){const {existingLocalSegmentNames:_0xab8ea2,localExpandedRuleToNames:_0x460b6f}=_0xf64c5a,_0x3fcc29=new Set(),_0x1912df=new Map(),_0x3d9fa1=new Map(),_0x5506ac=new Map(),_0x5f339d=createJumpTargetCache(),_0x5ce158=new Map(),_0x4c962a=new Map(),_0x20285c=new Set();let _0x253a32;const _0xf38a44=_0x146b22=>{const _0x466c72={'resolveSegment':async _0x4c7abe=>{const _0x246f53=a100_0x5482,_0x1cebbb=_0x5506ac[_0x246f53(0x1ae)](_0x4c7abe);if(_0x1cebbb!==undefined)return{'name':_0x1cebbb,'isJourneyLocal':!![]};try{let _0x385133=_0x219d99[_0x246f53(0x14d)](_0x58917b=>_0x58917b['id']===_0x4c7abe);!_0x385133&&(_0x385133=await _0xf9d3c1[_0x246f53(0x157)][_0x246f53(0x164)](_0x53503b,_0x4c7abe));const _0x42f5ae=generateJourneyLocalName(_0x385133[_0x246f53(0x16d)]),_0x472802=_0x385133[_0x246f53(0x13e)]===SEGMENT_KIND_JOURNEY&&_0x42f5ae!==undefined;let _0x4972bb=_0x385133[_0x246f53(0x16d)],_0x3ec765;if(_0x472802&&_0x385133['rule']){const _0x1a924e=apiRuleToYaml(_0x385133[_0x246f53(0x1a6)]);_0x4c962a[_0x246f53(0x189)](_0x4c7abe,_0x1a924e);const _0x10c194=async _0x1b327c=>{const _0x492017=_0x246f53,_0x57747c=collectSegmentRefsFromRule(_0x1b327c);for(const _0x12e8ca of _0x57747c){if(!_0x4c962a[_0x492017(0x18b)](_0x12e8ca))try{const _0x11a3c9=await _0xf9d3c1[_0x492017(0x157)][_0x492017(0x164)](_0x53503b,_0x12e8ca);if(_0x11a3c9?.[_0x492017(0x1a6)]){const _0x184aaa=apiRuleToYaml(_0x11a3c9[_0x492017(0x1a6)]);_0x4c962a[_0x492017(0x189)](_0x12e8ca,_0x184aaa),await _0x10c194(_0x184aaa);}}catch{}}};await _0x10c194(_0x1a924e);const _0x228fb4=serializeExpandedRule(_0x1a924e,_0x4c962a),_0x259378=_0x460b6f[_0x246f53(0x1ae)](_0x228fb4);if(_0x259378&&_0x259378['length']>0x0){const _0x4f4a93=_0x1912df[_0x246f53(0x1ae)](_0x228fb4)||0x0,_0x277bbd=_0x259378[_0x4f4a93]||_0x259378[_0x259378[_0x246f53(0x104)]-0x1];_0x1912df['set'](_0x228fb4,_0x4f4a93+0x1),_0x4972bb=_0x277bbd,_0x3fcc29[_0x246f53(0x125)](_0x4972bb),_0x5506ac['set'](_0x4c7abe,_0x4972bb);const _0x115fa6=await resolveRuleSegmentRefs(_0x1a924e,async _0x506c5e=>{const _0x3ca9d5=_0x246f53,_0x523139=_0x5506ac[_0x3ca9d5(0x1ae)](_0x506c5e);if(_0x523139)return _0x523139;const _0x324081=await _0x253a32[_0x3ca9d5(0xfe)](_0x506c5e);return _0x324081['name'];});_0x3ec765={'description':_0x385133['description'],'rule':_0x115fa6};}else{const _0xd23d96=_0x5ce158[_0x246f53(0x1ae)](_0x228fb4);if(_0xd23d96)_0x4972bb=_0xd23d96,_0x5506ac[_0x246f53(0x189)](_0x4c7abe,_0x4972bb);else{if(_0x42f5ae){let _0x3ad1ea=_0x42f5ae,_0x26908a=0x2;while(_0x3fcc29[_0x246f53(0x18b)](_0x3ad1ea)||_0xab8ea2[_0x246f53(0x18b)](_0x3ad1ea)){_0x3ad1ea=_0x42f5ae+'_'+_0x26908a,_0x26908a++;}_0x3fcc29[_0x246f53(0x125)](_0x3ad1ea),_0x4972bb=_0x3ad1ea;}_0x5506ac[_0x246f53(0x189)](_0x4c7abe,_0x4972bb),_0x5ce158['set'](_0x228fb4,_0x4972bb);const _0x2e38d=await resolveRuleSegmentRefs(_0x1a924e,async _0x321f94=>{const _0xd34ef7=_0x246f53,_0x43bf7e=_0x5506ac[_0xd34ef7(0x1ae)](_0x321f94);if(_0x43bf7e)return _0x43bf7e;const _0x89e588=await _0x253a32[_0xd34ef7(0xfe)](_0x321f94);return _0x89e588[_0xd34ef7(0x16d)];});_0x3ec765={'description':_0x385133['description'],'rule':_0x2e38d};}}}return{'name':_0x4972bb,'isJourneyLocal':_0x472802,'definition':_0x3ec765};}catch{return{'name':_0x4c7abe,'isJourneyLocal':![]};}},'resolveActivation':async _0xa3390c=>{const _0x3d4a19=a100_0x5482,_0x5d62f7=_0x3d9fa1[_0x3d4a19(0x1ae)](_0xa3390c);if(_0x5d62f7!==undefined)return{'name':_0x5d62f7,'isJourneyLocal':!![]};try{let _0x5e860b=_0xc02559?.[_0x3d4a19(0x1ae)](_0xa3390c);!_0x5e860b&&(_0x5e860b=await _0xf9d3c1[_0x3d4a19(0x13a)]['getActivation'](_0x146b22,_0xa3390c));const _0x32cc06=_0x5e860b['attributes'][_0x3d4a19(0x114)][_0x3d4a19(0x16d)]||_0xa3390c,_0x885914=sanitizeYamlKey(_0x32cc06)||_0x3d4a19(0x11b)+_0xa3390c,_0x4d53b4=_0x885914;_0x3d9fa1['set'](_0xa3390c,_0x4d53b4);const _0xbc4ed5=journeyActivationStepToYaml(_0x5e860b,_0x5e80f8,_0x24bf33);return{'name':_0x4d53b4,'isJourneyLocal':!![],'definition':_0xbc4ed5};}catch{return{'name':_0xa3390c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1f4ff5,_0x28717f)=>resolveJumpTarget(_0x1f4ff5,_0x28717f,_0x5f339d,async _0x13b8b1=>{const _0x257076=a100_0x5482,_0x41c847=_0x30892c?.['get'](_0x13b8b1);if(_0x41c847)return _0x41c847;return _0xf9d3c1[_0x257076(0x13a)][_0x257076(0x135)](_0x13b8b1);})};return _0x253a32=_0x466c72,_0x466c72;},_0x201824=async _0x53f578=>{const _0x41978f=a100_0x5482,{collectSegmentIdsFromJourneyApi:_0x272b33}=await import(_0x41978f(0x113)),{batchAsync:_0x1b82b7}=await import(_0x41978f(0x102)),_0x5dddee=new Set();for(const _0x2f70f7 of _0x53f578){let _0x35c2af=_0x30892c?.[_0x41978f(0x1ae)](_0x2f70f7);!_0x35c2af&&(_0x35c2af=await _0xf9d3c1[_0x41978f(0x13a)]['getJourney'](_0x2f70f7));const _0xea52e6=_0x272b33(_0x35c2af);for(const _0x8f235b of _0xea52e6){_0x5dddee[_0x41978f(0x125)](_0x8f235b);}}let _0x411fe0=Array[_0x41978f(0x130)](_0x5dddee);while(_0x411fe0['length']>0x0){const _0x548d04=_0x411fe0[_0x41978f(0x1a0)](_0x549511=>!_0x20285c[_0x41978f(0x18b)](_0x549511));if(_0x548d04['length']===0x0)break;const _0x2008ea=await _0x1b82b7(_0x548d04,async _0x2b6a19=>{const _0x43e72d=_0x41978f;_0x20285c['add'](_0x2b6a19);let _0x3cad5c=_0x219d99[_0x43e72d(0x14d)](_0x346b11=>_0x346b11['id']===_0x2b6a19);if(!_0x3cad5c)try{_0x3cad5c=await _0xf9d3c1['segment'][_0x43e72d(0x164)](_0x53503b,_0x2b6a19);}catch{return null;}return{'segmentId':_0x2b6a19,'segment':_0x3cad5c};},0xa),_0x12c7b7=new Set();for(const _0xaae5aa of _0x2008ea){if(!_0xaae5aa?.['segment']?.[_0x41978f(0x1a6)])continue;const _0x3ef3c7=apiRuleToYaml(_0xaae5aa[_0x41978f(0x157)][_0x41978f(0x1a6)]);_0x4c962a[_0x41978f(0x189)](_0xaae5aa[_0x41978f(0x129)],_0x3ef3c7);const _0x594be1=collectSegmentRefsFromRule(_0x3ef3c7);for(const _0x1d5cc3 of _0x594be1){!_0x20285c[_0x41978f(0x18b)](_0x1d5cc3)&&_0x12c7b7[_0x41978f(0x125)](_0x1d5cc3);}}_0x411fe0=Array[_0x41978f(0x130)](_0x12c7b7);}};return{'createYamlContext':_0xf38a44,'prefetchJourneySegments':_0x201824};}export async function executePushSegments(_0x33a856,_0x4f4689,_0x15619d,_0x4a33e8,_0x46bcf2){const _0x39d023=a100_0x525e79,{segmentDefToCreateRequest:_0x582056,segmentDefToUpdateRequest:_0x6c6d51}=await import(_0x39d023(0xdc)),_0x1b280b=_0x15619d[_0x39d023(0x175)],_0x3fe5fd=0x5,_0x5520a8=async _0x41a07b=>{const _0x44848c=_0x39d023,_0x2107e8=_0x41a07b[_0x44848c(0x146)]?_0x1b280b[_0x44848c(0x1ae)](_0x41a07b[_0x44848c(0x146)]):undefined;let _0x42d9ca;const _0x22adaf={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x41a07b[_0x44848c(0x185)]){_0x46bcf2[_0x44848c(0x19a)]?.({'type':'segment_creating','name':_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]});const _0x111782=_0x582056(_0x41a07b['yamlConfig'],_0x2107e8),_0x2eb3a7=await _0x46bcf2[_0x44848c(0xd7)]('Creating\x20segment\x20\x27'+_0x41a07b['yamlConfig']['name']+_0x44848c(0xd6),()=>_0x33a856[_0x44848c(0x157)][_0x44848c(0x193)](_0x4a33e8[_0x44848c(0x120)],_0x111782));_0x42d9ca=_0x2eb3a7[_0x44848c(0x171)]['id'],_0x22adaf[_0x44848c(0x18e)]={'name':_0x41a07b['yamlConfig'][_0x44848c(0x16d)],'id':_0x42d9ca},_0x46bcf2['onProgress']?.({'type':_0x44848c(0xf9),'name':_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)],'segmentId':_0x42d9ca}),_0x46bcf2['logSuccess']?.(_0x44848c(0x153)+_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]+'\x27'),_0x22adaf['created']=0x1;}else{if(_0x41a07b[_0x44848c(0x15d)]){_0x46bcf2[_0x44848c(0x19a)]?.({'type':_0x44848c(0x12b),'name':_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]});const _0x1bb628=_0x6c6d51(_0x41a07b[_0x44848c(0x17c)]);_0x2107e8!==_0x41a07b['existingSegment']?.[_0x44848c(0xd2)]&&(_0x1bb628[_0x44848c(0xd2)]=_0x2107e8?parseInt(_0x2107e8,0xa):undefined),await _0x46bcf2[_0x44848c(0xd7)]('Updating\x20segment\x20\x27'+_0x41a07b['yamlConfig'][_0x44848c(0x16d)]+_0x44848c(0xd6),()=>_0x33a856[_0x44848c(0x157)][_0x44848c(0xf7)](_0x4a33e8[_0x44848c(0x120)],_0x41a07b[_0x44848c(0x154)]['id'],_0x1bb628)),_0x42d9ca=_0x41a07b[_0x44848c(0x154)]['id'],_0x46bcf2[_0x44848c(0x19a)]?.({'type':_0x44848c(0x195),'name':_0x41a07b['yamlConfig']['name']}),_0x46bcf2[_0x44848c(0x11f)]?.(_0x44848c(0x14b)+_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]+'\x27'),_0x22adaf[_0x44848c(0x18d)]=0x1;}else _0x42d9ca=_0x41a07b[_0x44848c(0x154)]['id'];}}catch(_0x49f2ec){const _0x755011=isHttp400Error(_0x49f2ec),_0x4b4767=_0x755011?ErrorCode[_0x44848c(0xf8)]:ErrorCode[_0x44848c(0x163)],_0x38d38=getErrorMessage(_0x49f2ec);throw new SDKError(_0x4b4767,_0x44848c(0x142)+(_0x41a07b[_0x44848c(0x185)]?_0x44848c(0x17a):'update')+'\x20segment\x20from\x20file:\x20'+_0x41a07b[_0x44848c(0xf3)]+_0x44848c(0xf1)+_0x38d38,_0x49f2ec);}try{const _0x13e9f5=await syncActivationsForSegment(_0x33a856,_0x4a33e8[_0x44848c(0x120)],_0x42d9ca,_0x41a07b['yamlConfig'][_0x44848c(0x16d)],_0x41a07b['activationActions'],_0x46bcf2,_0x41a07b['absolutePath']);_0x22adaf[_0x44848c(0x177)]=_0x13e9f5;}catch(_0x30c533){if(_0x30c533 instanceof SDKError)throw _0x30c533;throw new SDKError(ErrorCode[_0x44848c(0xeb)],_0x44848c(0x192)+_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]+_0x44848c(0x19e)+_0x41a07b[_0x44848c(0xf3)]+'\x0a\x20\x20'+getErrorMessage(_0x30c533),_0x30c533);}return _0x22adaf;},_0x404c5e=await batchAsync(_0x4f4689,_0x5520a8,_0x3fe5fd),_0x14c97f={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x47e7c0 of _0x404c5e){_0x14c97f[_0x39d023(0x100)]+=_0x47e7c0['created'],_0x14c97f[_0x39d023(0x18d)]+=_0x47e7c0[_0x39d023(0x18d)],_0x47e7c0['createdSegmentId']&&_0x14c97f[_0x39d023(0x131)]['set'](_0x47e7c0[_0x39d023(0x18e)][_0x39d023(0x16d)],_0x47e7c0[_0x39d023(0x18e)]['id']),_0x14c97f[_0x39d023(0x177)][_0x39d023(0x100)]+=_0x47e7c0[_0x39d023(0x177)][_0x39d023(0x100)],_0x14c97f[_0x39d023(0x177)][_0x39d023(0x18d)]+=_0x47e7c0[_0x39d023(0x177)][_0x39d023(0x18d)],_0x14c97f['activations'][_0x39d023(0x151)]+=_0x47e7c0['activations'][_0x39d023(0x151)];}return _0x14c97f;}async function syncActivationsForSegment(_0x425eb2,_0x25f04f,_0x5c9770,_0x42f779,_0x5b6548,_0x3a9ea5,_0x12a678){const _0x3e2c4b=a100_0x525e79,_0x1f6f3d={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4f7b88 of _0x5b6548){try{if(_0x4f7b88[_0x3e2c4b(0x183)]==='create'&&_0x4f7b88['validatedRequest'])_0x3a9ea5['onProgress']?.({'type':'activation_creating','segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),await _0x3a9ea5['withProgress'](_0x3e2c4b(0x141)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27...',()=>_0x425eb2[_0x3e2c4b(0x157)][_0x3e2c4b(0x110)](_0x25f04f,_0x5c9770,_0x4f7b88[_0x3e2c4b(0x122)])),_0x3a9ea5['onProgress']?.({'type':_0x3e2c4b(0x1a3),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),_0x3a9ea5[_0x3e2c4b(0x11f)]?.(_0x3e2c4b(0x16a)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27'),_0x1f6f3d[_0x3e2c4b(0x100)]++;else{if(_0x4f7b88[_0x3e2c4b(0x183)]==='update'&&_0x4f7b88[_0x3e2c4b(0x122)]&&_0x4f7b88[_0x3e2c4b(0x180)])_0x3a9ea5[_0x3e2c4b(0x19a)]?.({'type':_0x3e2c4b(0x11c),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),await _0x3a9ea5[_0x3e2c4b(0xd7)]('Updating\x20activation\x20\x27'+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27...',()=>_0x425eb2[_0x3e2c4b(0x157)]['updateActivation'](_0x25f04f,_0x5c9770,_0x4f7b88[_0x3e2c4b(0x180)]['id'],_0x4f7b88[_0x3e2c4b(0x122)])),_0x3a9ea5['onProgress']?.({'type':_0x3e2c4b(0x196),'segmentName':_0x42f779,'activationName':_0x4f7b88['name']}),_0x3a9ea5[_0x3e2c4b(0x11f)]?.(_0x3e2c4b(0x17e)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27'),_0x1f6f3d[_0x3e2c4b(0x18d)]++;else _0x4f7b88['type']===_0x3e2c4b(0x19b)&&_0x4f7b88[_0x3e2c4b(0x180)]&&(_0x3a9ea5['onProgress']?.({'type':_0x3e2c4b(0x1a1),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),await _0x3a9ea5[_0x3e2c4b(0xd7)](_0x3e2c4b(0x106)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27...',()=>_0x425eb2['segment']['deleteActivation'](_0x25f04f,_0x5c9770,_0x4f7b88[_0x3e2c4b(0x180)]['id'])),_0x3a9ea5[_0x3e2c4b(0x19a)]?.({'type':_0x3e2c4b(0xd5),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),_0x3a9ea5['logDeleted']?.(_0x3e2c4b(0x143)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27'),_0x1f6f3d[_0x3e2c4b(0x151)]++);}}catch(_0xd366f8){const _0x228ca2=isHttp400Error(_0xd366f8),_0x1f664=_0x228ca2?ErrorCode[_0x3e2c4b(0x155)]:ErrorCode[_0x3e2c4b(0xeb)],_0x5ca2c3=getErrorMessage(_0xd366f8);throw new SDKError(_0x1f664,_0x3e2c4b(0x142)+_0x4f7b88[_0x3e2c4b(0x183)]+_0x3e2c4b(0x144)+_0x4f7b88['name']+_0x3e2c4b(0x19e)+_0x12a678+_0x3e2c4b(0xf1)+_0x5ca2c3,_0xd366f8);}}return _0x1f6f3d;}export async function executePushFolders(_0x41c210,_0x5166f4,_0x29cf6,_0x565200,_0x1e000f){const _0x11e0bd=a100_0x525e79,_0x3e1cb7=new Map(_0x29cf6);for(const _0x524721 of _0x5166f4){const _0x3e2d13=_0x524721[_0x11e0bd(0x1a9)]('/'),_0x1688f8=_0x3e2d13[_0x3e2d13[_0x11e0bd(0x104)]-0x1],_0xeb1aa1=_0x3e2d13['slice'](0x0,-0x1)['join']('/'),_0x2a8e94=_0x3e1cb7['get'](_0xeb1aa1);_0x1e000f[_0x11e0bd(0x19a)]?.({'type':_0x11e0bd(0x152),'folder':_0x524721});const _0x14cd1b={'name':_0x1688f8,'parentFolderId':_0x2a8e94},_0xd23d06=await _0x1e000f['withProgress']('Creating\x20folder\x20\x27'+_0x524721+_0x11e0bd(0xd6),()=>_0x41c210[_0x11e0bd(0x157)][_0x11e0bd(0x136)](_0x565200['parentId'],_0x14cd1b));_0x3e1cb7[_0x11e0bd(0x189)](_0x524721,_0xd23d06[_0x11e0bd(0x171)]['id']),_0x1e000f[_0x11e0bd(0x19a)]?.({'type':_0x11e0bd(0xf2),'folder':_0x524721,'folderId':_0xd23d06[_0x11e0bd(0x171)]['id']}),_0x1e000f[_0x11e0bd(0x19d)]?.(_0x11e0bd(0x1ab)+_0x524721+'\x27');}return _0x3e1cb7;}export async function executePushSegmentDeletions(_0x4a8e2b,_0x75a350,_0xcd8135){const _0x1aadf6=a100_0x525e79;if(_0x75a350[_0x1aadf6(0x104)]===0x0)return 0x0;const {batchAsync:_0x4bac86}=await import(_0x1aadf6(0x102)),_0x2d1220=0x5,_0x4ccc2a=await _0x4bac86(_0x75a350,async _0x5f30de=>{const _0x2c6f95=_0x1aadf6;return _0xcd8135['onProgress']?.({'type':_0x2c6f95(0x15f),'name':_0x5f30de['name']}),await _0x4a8e2b[_0x2c6f95(0x157)][_0x2c6f95(0xf5)](_0x5f30de['id']),_0xcd8135[_0x2c6f95(0x19a)]?.({'type':_0x2c6f95(0x116),'name':_0x5f30de[_0x2c6f95(0x16d)]}),_0xcd8135['logDeleted']?.('Deleted\x20segment\x20\x27'+_0x5f30de['name']+'\x27'),0x1;},_0x2d1220);return _0x4ccc2a[_0x1aadf6(0xe9)]((_0x468268,_0x2533bb)=>_0x468268+_0x2533bb,0x0);}export async function executePushJourneys(_0x261a14,_0x354e3f,_0x589f09,_0x1faede,_0x173b93){const _0x29455d=a100_0x525e79,{journeyDefToRequest:_0x363fd7}=await import(_0x29455d(0x113)),{activationDefToCreateRequest:_0x240a49,yamlRuleToApi:_0x37de6c,validateSegmentRule:_0x3537b9}=await import(_0x29455d(0xdc)),_0x301a05={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x232db8=new Map(_0x589f09[_0x29455d(0x150)]),_0x456248=0x5;for(let _0x1d52ff=0x0;_0x1d52ff<_0x354e3f['length'];_0x1d52ff+=_0x456248){const _0x5912f5=_0x354e3f[_0x29455d(0xdd)](_0x1d52ff,_0x1d52ff+_0x456248),_0x35afd1=await Promise[_0x29455d(0x10c)](_0x5912f5['map'](async _0x2adb3c=>{const _0xc0b6c3=_0x29455d;if(!_0x2adb3c[_0xc0b6c3(0x185)]&&!_0x2adb3c['hasChanges'])return{'action':_0xc0b6c3(0xe0),'name':_0x2adb3c[_0xc0b6c3(0x17c)][_0xc0b6c3(0x16d)],'journeyId':_0x2adb3c['existingJourney']?.['id']};const _0x3c3f5b=_0x2adb3c[_0xc0b6c3(0x146)]?_0x589f09[_0xc0b6c3(0x175)][_0xc0b6c3(0x1ae)](_0x2adb3c[_0xc0b6c3(0x146)]):undefined;_0x173b93['onProgress']?.({'type':_0x2adb3c[_0xc0b6c3(0x185)]?_0xc0b6c3(0x10f):'journey_updating','name':_0x2adb3c['yamlConfig'][_0xc0b6c3(0x16d)]});try{const _0x380ed4=await executeSingleJourneyPush(_0x261a14,_0x2adb3c,{..._0x589f09,'segmentNameToId':_0x232db8},{'parentId':_0x1faede[_0xc0b6c3(0x120)],'rootFolderId':_0x1faede[_0xc0b6c3(0x162)],'folderId':_0x3c3f5b,'verbose':_0x1faede[_0xc0b6c3(0x118)]},_0x173b93,{'journeyDefToRequest':_0x363fd7,'activationDefToCreateRequest':_0x240a49,'yamlRuleToApi':_0x37de6c,'validateSegmentRule':_0x3537b9});for(const [_0x51892a,_0x2a2644]of _0x380ed4[_0xc0b6c3(0x18a)]){_0x232db8[_0xc0b6c3(0x189)](_0x51892a,_0x2a2644),_0x301a05[_0xc0b6c3(0x18a)][_0xc0b6c3(0x189)](_0x51892a,_0x2a2644);}if(_0x380ed4[_0xc0b6c3(0xfb)]===_0xc0b6c3(0x100))_0x173b93[_0xc0b6c3(0x19a)]?.({'type':_0xc0b6c3(0xd3),'name':_0x2adb3c[_0xc0b6c3(0x17c)]['name'],'journeyId':_0x380ed4[_0xc0b6c3(0xe1)]}),_0x173b93[_0xc0b6c3(0x11f)]?.('Created\x20journey\x20\x27'+_0x2adb3c[_0xc0b6c3(0x17c)]['name']+'\x27'),_0x301a05[_0xc0b6c3(0x100)]++;else _0x380ed4[_0xc0b6c3(0xfb)]===_0xc0b6c3(0x18d)&&(_0x173b93[_0xc0b6c3(0x19a)]?.({'type':'journey_updated','name':_0x2adb3c[_0xc0b6c3(0x17c)]['name']}),_0x173b93[_0xc0b6c3(0x11f)]?.(_0xc0b6c3(0x179)+_0x2adb3c[_0xc0b6c3(0x17c)][_0xc0b6c3(0x16d)]+'\x27'),_0x301a05[_0xc0b6c3(0x18d)]++);return{'action':_0x380ed4[_0xc0b6c3(0xfb)],'name':_0x2adb3c[_0xc0b6c3(0x17c)]['name'],'journeyId':_0x380ed4[_0xc0b6c3(0xe1)]};}catch(_0x427744){const _0x2b1492=isHttp400Error(_0x427744),_0x36ea7f=_0x2b1492?ErrorCode[_0xc0b6c3(0x17d)]:ErrorCode[_0xc0b6c3(0x181)],_0x4c884b=getErrorMessage(_0x427744);throw new SDKError(_0x36ea7f,_0xc0b6c3(0x142)+(_0x2adb3c[_0xc0b6c3(0x185)]?_0xc0b6c3(0x17a):_0xc0b6c3(0x168))+'\x20journey\x20from\x20file:\x20'+_0x2adb3c['absolutePath']+'\x0a\x20\x20'+_0x4c884b,_0x427744);}}));_0x301a05['results']['push'](..._0x35afd1);}return _0x301a05;}async function executeSingleJourneyPush(_0x5a54ca,_0x5de177,_0x478e01,_0x26cc52,_0x3e9efb,_0x514bb5){const _0x333814=a100_0x525e79,{journeyDefToRequest:_0x197285,activationDefToCreateRequest:_0x26908c,yamlRuleToApi:_0x3de5bc,validateSegmentRule:_0x341873}=_0x514bb5,_0xb3e0e3=new Map(),_0x13ef7a=new Map(),_0x50db20=new Map(),_0x5c6300=new Map(),_0x564f4b=new Map();let _0x30e351;const _0x222af5=async()=>{const _0x1be8d3=a100_0x5482;if(_0x30e351)return;_0x30e351=new Map();if(!_0x5de177[_0x1be8d3(0x1aa)])return;const _0x43afc9=await _0x5a54ca[_0x1be8d3(0x13a)][_0x1be8d3(0xe6)](_0x5de177['existingJourney']['id']);for(const _0x78b496 of _0x43afc9){const _0x417848=journeyActivationStepToYaml(_0x78b496,_0x478e01[_0x1be8d3(0x112)],_0x478e01['connectionIdToNameMap']),_0x4dcc7a=activationSignature(_0x417848);!_0x30e351[_0x1be8d3(0x18b)](_0x4dcc7a)&&_0x30e351['set'](_0x4dcc7a,_0x78b496['id']),_0x417848[_0x1be8d3(0x16d)]&&_0x13ef7a[_0x1be8d3(0x189)](_0x417848[_0x1be8d3(0x16d)],_0x78b496['id']);}};if(_0x5de177['existingJourney']&&_0x5de177[_0x333814(0x17c)][_0x333814(0x115)]){const _0x50bf35=buildLocalExpandedRuleMappings(_0x5de177[_0x333814(0x17c)]),_0x57cafc=_0x50bf35[_0x333814(0x197)];if(_0x57cafc[_0x333814(0x15b)]>0x0){const _0x5bbae0=new Map();for(const [_0x27c57d,_0x38a7ab]of _0x57cafc){const _0x5e4d0d=serializeExpandedRule(_0x38a7ab,_0x57cafc);_0x5bbae0[_0x333814(0x189)](_0x27c57d,_0x5e4d0d);}const _0x25b252=collectSegmentIdsFromJourneyApi(_0x5de177[_0x333814(0x1aa)]);if(_0x25b252[_0x333814(0x15b)]>0x0){const _0x1c6317=await buildServerSegmentRuleMap(_0x5a54ca,_0x26cc52[_0x333814(0x120)],_0x478e01[_0x333814(0x1a8)],_0x25b252);if(_0x1c6317[_0x333814(0x15b)]>0x0){const _0x5b5604=new Map();for(const [_0x415ed0,_0x4a4eee]of _0x1c6317){const _0x420bf9=serializeExpandedRule(_0x4a4eee,_0x1c6317);!_0x5b5604[_0x333814(0x18b)](_0x420bf9)&&_0x5b5604[_0x333814(0x189)](_0x420bf9,_0x415ed0);}for(const [_0x25dcb1,_0x28e14c]of _0x5bbae0){const _0x24188e=_0x5b5604[_0x333814(0x1ae)](_0x28e14c);_0x24188e&&(_0x564f4b[_0x333814(0x189)](_0x25dcb1,_0x24188e),_0x478e01[_0x333814(0x150)][_0x333814(0x189)](_0x25dcb1,_0x24188e));}}}}}const _0x2ebb38={'resolveSegmentId':async _0x5bfd24=>{const _0x27ade3=_0x333814,_0x2a4d4c=_0x478e01[_0x27ade3(0x150)][_0x27ade3(0x1ae)](_0x5bfd24);if(!_0x2a4d4c)throw new SDKError(ErrorCode[_0x27ade3(0x11a)],_0x27ade3(0x170)+_0x5bfd24+'\x20(referenced\x20in\x20journey\x20'+_0x5de177[_0x27ade3(0x17c)]['name']+')');return _0x2a4d4c;},'resolveEmbeddedSegmentId':async(_0x29e9db,_0x509f48)=>{const _0x399fe9=_0x333814,_0x3be3b8=_0x478e01[_0x399fe9(0x150)]['get'](_0x29e9db);if(_0x3be3b8)return _0x3be3b8;const _0x2dbc44=_0x564f4b[_0x399fe9(0x1ae)](_0x29e9db);if(_0x2dbc44)return _0x478e01[_0x399fe9(0x150)]['set'](_0x29e9db,_0x2dbc44),_0x2dbc44;const _0x4c6b5c=_0x478e01[_0x399fe9(0x1a8)][_0x399fe9(0x14d)](_0x3b8f55=>_0x3b8f55[_0x399fe9(0x16d)]===_0x29e9db);if(_0x4c6b5c)return _0x478e01[_0x399fe9(0x150)][_0x399fe9(0x189)](_0x29e9db,_0x4c6b5c['id']),_0x4c6b5c['id'];if(_0x5de177[_0x399fe9(0x185)]){const {stageName:_0x341367,criteriaName:_0x1690ef}=findSegmentCriteriaLocation(_0x5de177[_0x399fe9(0x17c)],_0x29e9db);return _0x341873(_0x29e9db,_0x509f48[_0x399fe9(0x1a6)]),_0x50db20[_0x399fe9(0x189)](_0x29e9db,{'definition':_0x509f48,'stageName':_0x341367,'criteriaName':_0x1690ef}),createPendingSegmentId(_0x29e9db);}const _0x1bd2d2=_0x5de177[_0x399fe9(0x1aa)]?.['id'];if(!_0x1bd2d2)throw new SDKError(ErrorCode['INTERNAL'],_0x399fe9(0x13d));_0x341873(_0x29e9db,_0x509f48[_0x399fe9(0x1a6)]);const _0xca50d1=generateDeterministicJourneySegmentName(_0x5de177[_0x399fe9(0x17c)][_0x399fe9(0x16d)],_0x29e9db),_0x413741=_0x478e01['existingSegments'][_0x399fe9(0x14d)](_0x3e539a=>_0x3e539a['name']===_0xca50d1),_0x53bd81=createSegmentIdResolver(_0x478e01['segmentNameToId'],_0x29e9db),_0x1d4564=await resolveRuleSegmentIds(_0x509f48[_0x399fe9(0x1a6)],_0x53bd81);let _0x112a05;if(_0x413741)await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0xf7)](_0x26cc52[_0x399fe9(0x120)],_0x413741['id'],{'description':_0x509f48[_0x399fe9(0x124)]||'Entry\x20criteria:\x20'+_0x29e9db,'rule':_0x3de5bc(_0x1d4564,!![]),'countPopulation':!![]}),_0x112a05=_0x413741['id'];else try{_0x112a05=await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0xe2)]({'name':_0xca50d1,'description':_0x509f48[_0x399fe9(0x124)]||_0x399fe9(0x1a2)+_0x29e9db,'journeyId':_0x1bd2d2,'rule':_0x3de5bc(_0x1d4564,!![]),'countPopulation':!![],'parentFolderId':_0x26cc52[_0x399fe9(0x162)]||'','audienceId':_0x26cc52[_0x399fe9(0x120)]});}catch(_0x1b21d4){const _0x2fc96b=_0x1b21d4 instanceof Error&&_0x1b21d4['message'][_0x399fe9(0x160)](_0x399fe9(0xea));if(_0x2fc96b){const _0xaf6ef9=await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0x10d)](_0x26cc52[_0x399fe9(0x120)]),_0x3541ac=_0xaf6ef9[_0x399fe9(0x14d)](_0x363f98=>_0x363f98[_0x399fe9(0x16d)]===_0xca50d1);if(_0x3541ac)await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0xf7)](_0x26cc52['parentId'],_0x3541ac['id'],{'description':_0x509f48[_0x399fe9(0x124)]||_0x399fe9(0x1a2)+_0x29e9db,'rule':_0x3de5bc(_0x1d4564,!![]),'countPopulation':!![]}),_0x112a05=_0x3541ac['id'];else throw _0x1b21d4;}else throw _0x1b21d4;}return _0x478e01[_0x399fe9(0x150)]['set'](_0x29e9db,_0x112a05),_0xb3e0e3[_0x399fe9(0x189)](_0x29e9db,_0x112a05),_0x112a05;},'resolveActivationId':async _0x4e588c=>{const _0x3d3406=_0x333814,_0x2c5bce=_0x13ef7a[_0x3d3406(0x1ae)](_0x4e588c);if(_0x2c5bce)return _0x2c5bce;if(_0x5de177[_0x3d3406(0x1aa)]){await _0x222af5();const _0x45426f=_0x13ef7a[_0x3d3406(0x1ae)](_0x4e588c);if(_0x45426f)return _0x45426f;}throw new SDKError(ErrorCode[_0x3d3406(0x1ad)],_0x3d3406(0x19c)+_0x4e588c+_0x3d3406(0x14a)+_0x5de177[_0x3d3406(0x17c)][_0x3d3406(0x16d)]+').\x20'+_0x3d3406(0x187));},'resolveEmbeddedActivationId':async(_0x944b24,_0x1c274e)=>{const _0x47f86d=_0x333814,_0x5e0c5d=_0x13ef7a[_0x47f86d(0x1ae)](_0x944b24);if(_0x5e0c5d)return _0x5e0c5d;if(_0x5de177[_0x47f86d(0x185)])return _0x5c6300['set'](_0x944b24,_0x1c274e),createPendingActivationId(_0x944b24);if(_0x5de177['existingJourney']){await _0x222af5();const _0x5f4c70=_0x13ef7a[_0x47f86d(0x1ae)](_0x1c274e[_0x47f86d(0x16d)]);if(_0x5f4c70)return _0x13ef7a[_0x47f86d(0x189)](_0x944b24,_0x5f4c70),_0x5f4c70;const _0x4dcbab=activationSignature(_0x1c274e),_0x8fbc=_0x30e351?.[_0x47f86d(0x1ae)](_0x4dcbab);if(_0x8fbc)return _0x13ef7a['set'](_0x944b24,_0x8fbc),_0x8fbc;const _0x2b455e=await _0x26908c(_0x1c274e,_0x478e01[_0x47f86d(0x1a5)]),_0x4feeee=await _0x5a54ca[_0x47f86d(0x13a)][_0x47f86d(0x110)](_0x5de177['existingJourney']['id'],_0x2b455e);return _0x13ef7a[_0x47f86d(0x189)](_0x944b24,_0x4feeee['id']),_0x4feeee['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x47f86d(0xff));},'resolveJourneyId':async _0x26d048=>{const _0x539416=_0x333814;try{return await _0x5a54ca[_0x539416(0x13a)]['resolveJourneyId'](_0x26cc52[_0x539416(0x120)],_0x26d048);}catch(_0x24bfa4){throw new SDKError(ErrorCode[_0x539416(0x1ad)],'Journey\x20\x27'+_0x26d048+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x5de177[_0x539416(0x17c)][_0x539416(0x16d)]+'\x27)',_0x24bfa4);}},'resolveStageId':async(_0x31711d,_0x1255ea)=>{const _0x509040=_0x333814,_0x588e0b=await _0x5a54ca['journey'][_0x509040(0x135)](_0x31711d),_0x1806f8=_0x588e0b['attributes']['journeyStages']['find'](_0x137f31=>_0x137f31[_0x509040(0x16d)]['toLowerCase']()===_0x1255ea[_0x509040(0x127)]());if(!_0x1806f8?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x509040(0x10b)+_0x1255ea+_0x509040(0x165)+(_0x588e0b['attributes'][_0x509040(0x1a7)]||_0x588e0b[_0x509040(0x188)][_0x509040(0x16d)])+'\x27');return _0x1806f8['id'];}},_0x732590=await _0x197285(_0x5de177[_0x333814(0x17c)],_0x26cc52[_0x333814(0x120)],_0x2ebb38),_0x3cdb36=_0x26cc52[_0x333814(0x12d)]||_0x26cc52['rootFolderId'];_0x3cdb36&&(_0x732590[_0x333814(0x12c)]={'parentFolder':{'data':{'id':_0x3cdb36,'type':_0x333814(0x176)}}});if(_0x5de177[_0x333814(0x185)]){if(_0x50db20[_0x333814(0x15b)]>0x0||_0x5c6300['size']>0x0)return await executeThreeStepJourneyCreate(_0x5a54ca,_0x5de177,_0x732590,{'pendingEmbeddedSegments':_0x50db20,'pendingEmbeddedActivations':_0x5c6300,'embeddedSegmentNameToId':_0xb3e0e3,'journeyActivationNameToId':_0x13ef7a},{..._0x26cc52,'effectiveFolderId':_0x3cdb36},_0x478e01,_0x3e9efb,_0x514bb5);else{ensureJourneyDefaults(_0x732590['attributes']);const _0x4c231a=await _0x5a54ca['journey'][_0x333814(0x17a)](_0x732590);return{'action':_0x333814(0x100),'journeyId':_0x4c231a['id'],'embeddedSegmentNameToId':_0xb3e0e3};}}else{if(_0x5de177[_0x333814(0x15d)]&&_0x5de177['existingJourney'])return ensureJourneyDefaults(_0x732590[_0x333814(0x188)]),await _0x5a54ca[_0x333814(0x13a)][_0x333814(0x168)](_0x5de177[_0x333814(0x1aa)]['id'],_0x732590),{'action':_0x333814(0x18d),'journeyId':_0x5de177[_0x333814(0x1aa)]['id'],'embeddedSegmentNameToId':_0xb3e0e3};}return{'action':_0x333814(0xe0),'journeyId':_0x5de177[_0x333814(0x1aa)]?.['id'],'embeddedSegmentNameToId':_0xb3e0e3};}function findSegmentCriteriaLocation(_0x2db317,_0x101330){const _0x1e9a0e=a100_0x525e79,_0x48cae7=_0x2db317[_0x1e9a0e(0x108)]||_0x2db317[_0x1e9a0e(0x10e)]?.[0x0]?.[_0x1e9a0e(0x108)]||[];let _0x41842f='entry',_0x2570f7=_0x101330;const _0x510cb1=_0x2db317[_0x1e9a0e(0x137)]||_0x2db317[_0x1e9a0e(0x10e)]?.[0x0]?.['goal'];if(_0x510cb1?.[_0x1e9a0e(0x157)]===_0x101330)return{'stageName':_0x1e9a0e(0x137),'criteriaName':_0x510cb1[_0x1e9a0e(0x16d)]||_0x101330};_0x598dad:for(const _0x323739 of _0x48cae7){if(_0x323739[_0x1e9a0e(0x107)]?.[_0x1e9a0e(0x157)]===_0x101330){_0x41842f=_0x323739['name'],_0x2570f7=_0x323739[_0x1e9a0e(0x107)][_0x1e9a0e(0x16d)]||_0x101330;break;}if(_0x323739[_0x1e9a0e(0x145)])for(const _0xb45c2d of _0x323739[_0x1e9a0e(0x145)]){if(_0xb45c2d[_0x1e9a0e(0x183)]===_0x1e9a0e(0x15e)&&_0xb45c2d[_0x1e9a0e(0xd4)]?.['branches'])for(const _0x11d510 of _0xb45c2d[_0x1e9a0e(0xd4)][_0x1e9a0e(0x16e)]){if(_0x11d510[_0x1e9a0e(0x157)]===_0x101330){_0x41842f=_0x323739[_0x1e9a0e(0x16d)],_0x2570f7=_0x11d510[_0x1e9a0e(0x16d)]||_0x101330;break _0x598dad;}}}}return{'stageName':_0x41842f,'criteriaName':_0x2570f7};}async function executeThreeStepJourneyCreate(_0x59a3d2,_0x3d8161,_0x420794,_0x5ba96a,_0x2a1e72,_0x5c327b,_0x52c9bf,_0x31d19){const _0x11e3fa=a100_0x525e79,{activationDefToCreateRequest:_0x5961a6,yamlRuleToApi:_0x3cdce0}=_0x31d19,{pendingEmbeddedSegments:_0x57d281,pendingEmbeddedActivations:_0x437ee1,embeddedSegmentNameToId:_0x5b8d6b}=_0x5ba96a,_0x34cc2d=JSON[_0x11e3fa(0xed)](JSON['stringify'](_0x420794));ensureJourneyDefaults(_0x34cc2d[_0x11e3fa(0x188)]),stripPendingIds(_0x34cc2d);const _0x52fb6a=await _0x59a3d2[_0x11e3fa(0x13a)][_0x11e3fa(0x17a)](_0x34cc2d),_0x92734b=_0x52fb6a['id'],_0xcc5d62=new Map();for(const _0x343cc6 of _0x52fb6a[_0x11e3fa(0x188)][_0x11e3fa(0x123)]){_0xcc5d62[_0x11e3fa(0x189)](_0x343cc6[_0x11e3fa(0x16d)]['toLowerCase'](),_0x343cc6['id']);}for(const [_0x576a65,{definition:_0x2b4fa3}]of _0x57d281){const _0x331947=generateDeterministicJourneySegmentName(_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],_0x576a65);_0x52c9bf['onProgress']?.({'type':_0x11e3fa(0x174),'journeyName':_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],'segmentName':_0x576a65});const _0x2aeaf8=createSegmentIdResolver(_0x5c327b[_0x11e3fa(0x150)],_0x576a65),_0xdbebcc=await resolveRuleSegmentIds(_0x2b4fa3[_0x11e3fa(0x1a6)],_0x2aeaf8),_0x59be01=await _0x59a3d2[_0x11e3fa(0x157)][_0x11e3fa(0xe2)]({'name':_0x331947,'description':_0x2b4fa3[_0x11e3fa(0x124)]||_0x11e3fa(0x1a2)+_0x576a65,'journeyId':_0x92734b,'rule':_0x3cdce0(_0xdbebcc,!![]),'countPopulation':!![],'parentFolderId':_0x2a1e72['effectiveFolderId']||'','audienceId':_0x2a1e72[_0x11e3fa(0x120)]});_0x5b8d6b[_0x11e3fa(0x189)](_0x576a65,_0x59be01),_0x5c327b[_0x11e3fa(0x150)][_0x11e3fa(0x189)](_0x576a65,_0x59be01),_0x52c9bf[_0x11e3fa(0x19a)]?.({'type':_0x11e3fa(0x172),'journeyName':_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],'segmentName':_0x576a65});}const _0x362ad5=new Map();for(const [_0x3cfb33,_0x479d64]of _0x437ee1){_0x52c9bf[_0x11e3fa(0x19a)]?.({'type':_0x11e3fa(0x161),'journeyName':_0x3d8161['yamlConfig'][_0x11e3fa(0x16d)],'activationName':_0x3cfb33});const _0x3e5f58=await _0x5961a6(_0x479d64,_0x5c327b['activationContext']),_0x43c4c0=await _0x59a3d2[_0x11e3fa(0x13a)][_0x11e3fa(0x110)](_0x92734b,_0x3e5f58);_0x362ad5['set'](_0x3cfb33,_0x43c4c0['id']),_0x5ba96a['journeyActivationNameToId'][_0x11e3fa(0x189)](_0x3cfb33,_0x43c4c0['id']),_0x52c9bf['onProgress']?.({'type':_0x11e3fa(0x178),'journeyName':_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],'activationName':_0x3cfb33});}const _0x123f31=JSON[_0x11e3fa(0xed)](JSON[_0x11e3fa(0x11e)](_0x420794));return _0x123f31['id']=_0x92734b,ensureJourneyDefaults(_0x123f31[_0x11e3fa(0x188)]),resolvePendingIdsInRequest(_0x123f31,_0x420794,_0xcc5d62,_0x5b8d6b,_0x362ad5,_0x52c9bf),await _0x59a3d2[_0x11e3fa(0x13a)][_0x11e3fa(0x168)](_0x92734b,_0x123f31),{'action':_0x11e3fa(0x100),'journeyId':_0x92734b,'embeddedSegmentNameToId':_0x5b8d6b};}function stripPendingIds(_0x3fcf7c){const _0x574771=a100_0x525e79;for(const _0x54deed of _0x3fcf7c[_0x574771(0x188)][_0x574771(0x123)]||[]){_0x54deed[_0x574771(0xfa)]?.[_0x574771(0x129)]&&isPendingSegmentId(_0x54deed[_0x574771(0xfa)]['segmentId'])&&delete _0x54deed[_0x574771(0xfa)];if(_0x54deed['steps'])for(const _0xed99c of Object[_0x574771(0x12e)](_0x54deed[_0x574771(0x145)])){const _0x3fd71d=_0x54deed[_0x574771(0x145)][_0xed99c];_0x3fd71d['type']==='Activation'&&_0x3fd71d[_0x574771(0x19f)]&&isPendingActivationId(_0x3fd71d['journeyActivationStepId'])&&(_0x3fd71d[_0x574771(0x19f)]='');if(_0x3fd71d[_0x574771(0x183)]===_0x574771(0x148)&&_0x3fd71d[_0x574771(0x16e)])for(const _0x2c68fc of _0x3fd71d[_0x574771(0x16e)]){_0x2c68fc[_0x574771(0x129)]&&isPendingSegmentId(_0x2c68fc[_0x574771(0x129)])&&(_0x2c68fc['segmentId']='');}_0x3fd71d['type']===_0x574771(0x147)&&_0x3fd71d[_0x574771(0x167)]?.[_0x574771(0x129)]&&isPendingSegmentId(_0x3fd71d[_0x574771(0x167)][_0x574771(0x129)])&&(_0x3fd71d[_0x574771(0x167)][_0x574771(0x129)]='');}}}function resolvePendingIdsInRequest(_0x2c80e3,_0x49067a,_0x13ec4a,_0x1f013c,_0x2de1ec,_0x465285){const _0x207ddf=a100_0x525e79,_0x444d5b=(_0x456ab0,_0x417e69)=>{const _0x481913=a100_0x5482;if(!isPendingSegmentId(_0x456ab0))return _0x456ab0;const _0x5018f9=extractPendingSegmentName(_0x456ab0),_0xe85ae2=_0x1f013c[_0x481913(0x1ae)](_0x5018f9);return!_0xe85ae2&&_0x465285['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x5018f9+'\x27\x20for\x20'+_0x417e69),_0xe85ae2;};if(_0x2c80e3[_0x207ddf(0x188)][_0x207ddf(0x137)]?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0x2c80e3[_0x207ddf(0x188)][_0x207ddf(0x137)][_0x207ddf(0x129)])){const _0x389c0d=_0x444d5b(_0x2c80e3['attributes'][_0x207ddf(0x137)][_0x207ddf(0x129)],_0x207ddf(0x15c));_0x389c0d&&(_0x2c80e3['attributes']['goal'][_0x207ddf(0x129)]=_0x389c0d);}for(const _0xadc552 of _0x2c80e3[_0x207ddf(0x188)][_0x207ddf(0x123)]||[]){const _0x2b31c2=_0x13ec4a['get'](_0xadc552[_0x207ddf(0x16d)][_0x207ddf(0x127)]());_0x2b31c2&&(_0xadc552['id']=_0x2b31c2);if(_0xadc552['entryCriteria']?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0xadc552[_0x207ddf(0xfa)]['segmentId'])){const _0x16647e=_0x444d5b(_0xadc552['entryCriteria'][_0x207ddf(0x129)],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+'\x27\x20entry\x20criteria');_0x16647e&&(_0xadc552[_0x207ddf(0xfa)]['segmentId']=_0x16647e);}if(_0xadc552['exitCriterias'])for(const _0xbe1c07 of _0xadc552[_0x207ddf(0x16c)]){if(_0xbe1c07[_0x207ddf(0x129)]&&isPendingSegmentId(_0xbe1c07[_0x207ddf(0x129)])){const _0x2f9c1c=_0x444d5b(_0xbe1c07['segmentId'],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+_0x207ddf(0x17b));_0x2f9c1c&&(_0xbe1c07[_0x207ddf(0x129)]=_0x2f9c1c);}}if(_0xadc552[_0x207ddf(0x18c)]?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0xadc552[_0x207ddf(0x18c)][_0x207ddf(0x129)])){const _0x242561=_0x444d5b(_0xadc552['milestone'][_0x207ddf(0x129)],'stage\x20\x27'+_0xadc552[_0x207ddf(0x16d)]+'\x27\x20milestone');_0x242561&&(_0xadc552[_0x207ddf(0x18c)][_0x207ddf(0x129)]=_0x242561);}if(_0xadc552[_0x207ddf(0x145)]){const _0x1954cd=_0x24f5ff=>_0x49067a[_0x207ddf(0x188)][_0x207ddf(0x123)][_0x207ddf(0x14d)](_0x4e6d76=>_0x4e6d76[_0x207ddf(0x16d)][_0x207ddf(0x127)]()===_0xadc552[_0x207ddf(0x16d)][_0x207ddf(0x127)]())?.[_0x207ddf(0x145)]?.[_0x24f5ff];for(const _0x2941d1 of Object[_0x207ddf(0x12e)](_0xadc552['steps'])){const _0x938b15=_0xadc552[_0x207ddf(0x145)][_0x2941d1],_0x188965=_0x1954cd(_0x2941d1);if(_0x938b15['type']===_0x207ddf(0x1ac)&&_0x938b15['journeyActivationStepId']&&(isPendingActivationId(_0x938b15['journeyActivationStepId'])||_0x938b15[_0x207ddf(0x19f)]==='')){if(_0x188965?.[_0x207ddf(0x19f)]&&isPendingActivationId(_0x188965[_0x207ddf(0x19f)])){const _0x2d47a9=extractPendingActivationName(_0x188965[_0x207ddf(0x19f)]),_0x34318a=_0x2de1ec[_0x207ddf(0x1ae)](_0x2d47a9);_0x34318a&&(_0x938b15[_0x207ddf(0x19f)]=_0x34318a);}}if(_0x938b15[_0x207ddf(0x183)]===_0x207ddf(0x148)&&_0x938b15['branches']&&_0x188965?.[_0x207ddf(0x16e)])for(let _0x400a2b=0x0;_0x400a2b<_0x938b15[_0x207ddf(0x16e)][_0x207ddf(0x104)];_0x400a2b++){const _0x4415fb=_0x938b15[_0x207ddf(0x16e)][_0x400a2b],_0x2a9ddb=_0x188965[_0x207ddf(0x16e)][_0x400a2b];if(_0x2a9ddb?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0x2a9ddb[_0x207ddf(0x129)])){const _0x349071=_0x444d5b(_0x2a9ddb[_0x207ddf(0x129)],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+_0x207ddf(0x117)+(_0x4415fb[_0x207ddf(0x16d)]||_0x400a2b)+'\x27');_0x349071&&(_0x4415fb[_0x207ddf(0x129)]=_0x349071);}}if(_0x938b15[_0x207ddf(0x183)]===_0x207ddf(0x147)&&_0x938b15['waitCondition']?.[_0x207ddf(0x129)]&&_0x188965?.['waitCondition']?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0x188965[_0x207ddf(0x167)][_0x207ddf(0x129)])){const _0x191a25=_0x444d5b(_0x188965[_0x207ddf(0x167)][_0x207ddf(0x129)],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+_0x207ddf(0x13f));_0x191a25&&(_0x938b15[_0x207ddf(0x167)]['segmentId']=_0x191a25);}}}}}
1
+ const a100_0xbb0e10=a100_0x5743;(function(_0x3aebb5,_0x2edf02){const _0x38aea7=a100_0x5743,_0xe88b6=_0x3aebb5();while(!![]){try{const _0x413581=-parseInt(_0x38aea7(0x1c3))/0x1*(-parseInt(_0x38aea7(0x249))/0x2)+parseInt(_0x38aea7(0x246))/0x3+parseInt(_0x38aea7(0x23c))/0x4+-parseInt(_0x38aea7(0x1f9))/0x5+-parseInt(_0x38aea7(0x1cd))/0x6*(-parseInt(_0x38aea7(0x1dd))/0x7)+-parseInt(_0x38aea7(0x1fe))/0x8+-parseInt(_0x38aea7(0x1ec))/0x9;if(_0x413581===_0x2edf02)break;else _0xe88b6['push'](_0xe88b6['shift']());}catch(_0x27fe3f){_0xe88b6['push'](_0xe88b6['shift']());}}}(a100_0x4634,0x94c08));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a100_0xbb0e10(0x250);export const PENDING_ACTIVATION_PREFIX=a100_0xbb0e10(0x1a4);export function createPendingSegmentId(_0x1d42f6){return''+PENDING_SEGMENT_PREFIX+_0x1d42f6+'__';}export function isPendingSegmentId(_0x337b83){const _0x1d09e8=a100_0xbb0e10;return _0x337b83[_0x1d09e8(0x21d)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x4b1c15){const _0xe9d374=a100_0xbb0e10;return _0x4b1c15[_0xe9d374(0x1a7)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4d2e76){return''+PENDING_ACTIVATION_PREFIX+_0x4d2e76+'__';}export function isPendingActivationId(_0x236c4f){const _0x3affa9=a100_0xbb0e10;return _0x236c4f[_0x3affa9(0x21d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3423c5){const _0x45d9f0=a100_0xbb0e10;return _0x3423c5[_0x45d9f0(0x1a7)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x56730c,_0x5150c8){const _0x3fd26d=a100_0xbb0e10,_0x1af21d=_0x56730c+'::'+(_0x5150c8['trim']()||_0x3fd26d(0x216)),_0x1e32e8=createHash(_0x3fd26d(0x1c6))['update'](_0x1af21d)['digest'](_0x3fd26d(0x1c5))['slice'](0x0,0xc);return _0x3fd26d(0x1e3)+_0x1e32e8;}export function ensureJourneyDefaults(_0x58b8ca){const _0x5f2dae=a100_0xbb0e10;!_0x58b8ca['description']&&(_0x58b8ca[_0x5f2dae(0x20d)]=''),!_0x58b8ca[_0x5f2dae(0x1aa)]&&(_0x58b8ca[_0x5f2dae(0x1aa)]=_0x5f2dae(0x1e6));}export function resolveTDFolderPath(_0x11ce46,_0x59fd8a,_0x22ebe6){const _0x138efd=a100_0xbb0e10;if(!_0x59fd8a)return _0x11ce46;if(_0x11ce46===_0x22ebe6||_0x11ce46[_0x138efd(0x21d)](_0x22ebe6+'/'))return _0x11ce46;return _0x11ce46?_0x22ebe6+'/'+_0x11ce46:_0x22ebe6;}export function addFoldersToCreate(_0x439e65,_0x1613de,_0xdcaec3){const _0x52ce81=a100_0xbb0e10;if(!_0x439e65)return;if(_0x1613de[_0x52ce81(0x1f0)](_0x439e65))return;const _0x1ff32b=_0x439e65[_0x52ce81(0x1d6)]('/');let _0x47b7f1='';for(const _0x3b5a9e of _0x1ff32b){_0x47b7f1=_0x47b7f1?_0x47b7f1+'/'+_0x3b5a9e:_0x3b5a9e,!_0x1613de[_0x52ce81(0x1f0)](_0x47b7f1)&&_0xdcaec3[_0x52ce81(0x187)](_0x47b7f1);}}function a100_0x5743(_0x580b3e,_0x428a0b){_0x580b3e=_0x580b3e-0x167;const _0x463450=a100_0x4634();let _0x5743e4=_0x463450[_0x580b3e];return _0x5743e4;}import*as a100_0x1d2a91 from'yaml';import{readFileSync}from'fs';import a100_0x4231b1 from'path';import{isJourneyDef,parseYamlString as a100_0x348012,toYamlString as a100_0x13016c,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x227684){const _0x316a34=a100_0xbb0e10;if(Array[_0x316a34(0x18b)](_0x227684))return'['+_0x227684[_0x316a34(0x206)](_0x351e1a=>stableStringify(_0x351e1a))[_0x316a34(0x1c8)](',')+']';if(_0x227684&&typeof _0x227684===_0x316a34(0x1f7)){const _0x18032d=_0x227684,_0x56a981=Object[_0x316a34(0x1b0)](_0x18032d)[_0x316a34(0x18f)](),_0x1e6317=_0x56a981['map'](_0xf24fd4=>'\x22'+_0xf24fd4+'\x22:'+stableStringify(_0x18032d[_0xf24fd4]));return'{'+_0x1e6317[_0x316a34(0x1c8)](',')+'}';}const _0x1e11a0=JSON['stringify'](_0x227684);return _0x1e11a0===undefined?_0x316a34(0x198):_0x1e11a0;}function activationSignature(_0x47c51b){const _0x3ed83a=a100_0xbb0e10,_0x30f8c1={'connection':_0x47c51b[_0x3ed83a(0x1ce)],..._0x47c51b[_0x3ed83a(0x24a)]!==undefined&&{'all_columns':_0x47c51b['all_columns']},..._0x47c51b[_0x3ed83a(0x1ee)]!==undefined&&{'columns':_0x47c51b[_0x3ed83a(0x1ee)]},..._0x47c51b['behavior']!==undefined&&{'behavior':_0x47c51b[_0x3ed83a(0x241)]},..._0x47c51b['schedule']!==undefined&&{'schedule':_0x47c51b[_0x3ed83a(0x23f)]},..._0x47c51b[_0x3ed83a(0x1fc)]!==undefined&&{'notification':_0x47c51b[_0x3ed83a(0x1fc)]},..._0x47c51b['connector_config']!==undefined&&{'connector_config':_0x47c51b[_0x3ed83a(0x170)]},..._0x47c51b[_0x3ed83a(0x174)]!==undefined&&{'activation_template_id':_0x47c51b[_0x3ed83a(0x174)]}};return stableStringify(_0x30f8c1);}export async function prepareSegmentFiles(_0xc59652,_0x58ef52,_0x5d2861,_0x3450ec,_0x2e4318){const _0x49ab67=a100_0xbb0e10,{activationDefToCreateRequest:_0x5c12b4}=await import(_0x49ab67(0x213)),_0x44817a=[],_0x5521f1=new Set();for(const {yamlConfig:_0x126e7b,folderPath:_0x2851cd,sourcePath:_0x1735b0}of _0xc59652){const _0x4fedbb=resolveTDFolderPath(_0x2851cd,_0x3450ec,_0x2e4318),_0x3bf4ff=_0x4fedbb+':'+_0x126e7b['name'],_0x5ba965=_0x58ef52[_0x49ab67(0x227)][_0x49ab67(0x200)](_0x3bf4ff),_0x50db01=_0x5ba965?_0x58ef52[_0x49ab67(0x219)]['get'](_0x5ba965['id'])||[]:[];addFoldersToCreate(_0x4fedbb,_0x58ef52[_0x49ab67(0x1df)],_0x5521f1);const _0x424c83=calculateActivationActions(_0x126e7b['activations']||[],_0x50db01,_0x58ef52[_0x49ab67(0x22b)],_0x58ef52[_0x49ab67(0x179)]);for(const _0x58e4cf of _0x424c83){(_0x58e4cf[_0x49ab67(0x1f1)]===_0x49ab67(0x238)||_0x58e4cf['type']===_0x49ab67(0x232))&&_0x58e4cf[_0x49ab67(0x1d8)]&&(_0x58e4cf[_0x49ab67(0x21c)]=await _0x5c12b4(_0x58e4cf[_0x49ab67(0x1d8)],_0x5d2861));}const _0x29b929=calculateSegmentDiff(_0x126e7b,_0x5ba965,_0x50db01,_0x58ef52[_0x49ab67(0x22b)],_0x58ef52[_0x49ab67(0x179)]);_0x44817a['push']({'relativePath':_0x126e7b[_0x49ab67(0x19d)],'absolutePath':_0x1735b0,'yamlConfig':_0x126e7b,'folderPath':_0x4fedbb,'existingSegment':_0x5ba965,'existingActivations':_0x50db01,'isNew':_0x29b929[_0x49ab67(0x230)],'hasChanges':_0x29b929[_0x49ab67(0x21f)],'diff':_0x29b929[_0x49ab67(0x20c)],'activationActions':_0x424c83});}return{'segmentFiles':_0x44817a,'foldersToCreate':_0x5521f1};}export async function prepareJourneyFiles(_0x1a9437,_0x3e5b1c,_0x559cda,_0x454654){const _0x29e0d0=a100_0xbb0e10,_0x9332d4=[],_0x54161a=new Set();for(const {yamlConfig:_0x212ee8,folderPath:_0x122f00,sourcePath:_0x423ce7}of _0x1a9437){const _0x4c28ed=resolveTDFolderPath(_0x122f00,_0x559cda,_0x454654),_0x4dce9e=_0x4c28ed+':'+_0x212ee8[_0x29e0d0(0x19d)],_0x2d715c=_0x3e5b1c[_0x29e0d0(0x234)][_0x29e0d0(0x200)](_0x4dce9e);let _0x1a09a0,_0x436615;if(_0x2d715c&&_0x2d715c[_0x29e0d0(0x1c2)]>0x0){const _0x2e4d3b=buildLocalExpandedRuleMappings(_0x212ee8),{createYamlContext:_0x54bbf9,prefetchJourneySegments:_0x28fc8a}=createPushYamlContextForBundle(_0x3e5b1c[_0x29e0d0(0x1ff)],_0x3e5b1c[_0x29e0d0(0x224)],_0x3e5b1c['existingSegments'],_0x2e4d3b,_0x3e5b1c[_0x29e0d0(0x22b)],_0x3e5b1c[_0x29e0d0(0x179)],_0x3e5b1c[_0x29e0d0(0x1a6)],_0x3e5b1c[_0x29e0d0(0x19b)]);await _0x28fc8a(_0x2d715c[_0x29e0d0(0x206)](_0x49c244=>_0x49c244['id']));const _0x46adb1=hasMultipleVersions(_0x212ee8),_0x54b69e=async _0x3e7546=>{const _0x19bb73=_0x29e0d0,_0x302b46=_0x3e5b1c[_0x19bb73(0x19b)]?.[_0x19bb73(0x200)](_0x3e7546);if(_0x302b46)return _0x302b46;return _0x3e5b1c[_0x19bb73(0x254)]({'journeyId':_0x3e7546,'journeyName':_0x212ee8['name'],'isMultiVersion':_0x2d715c[_0x19bb73(0x1c2)]>0x1});};if(_0x46adb1&&_0x2d715c[_0x29e0d0(0x1c2)]>0x1){const _0x23f53c=[];for(const _0xef7f59 of _0x2d715c){const _0x5689df=_0xef7f59['versionNumber']||0x1;_0x3e5b1c[_0x29e0d0(0x228)]?.[_0x29e0d0(0x232)]('Fetching\x20'+_0x212ee8['name']+'\x20v'+_0x5689df);const _0x1e29b5=await _0x54b69e(_0xef7f59['id']),_0x244f23=_0x54bbf9(_0xef7f59['id']),_0x4cddb2=await journeyResponseToDef(_0x1e29b5,_0x244f23);_0x23f53c[_0x29e0d0(0x1b9)]({'item':_0xef7f59,'yaml':_0x4cddb2});}const _0x569534=buildLocalRuleToNameMappingFromJourney(_0x212ee8);_0x436615=buildMergedJourneyDef(_0x23f53c,_0x569534);const _0x47c058=Math['max'](..._0x23f53c[_0x29e0d0(0x206)](_0x18d097=>_0x18d097[_0x29e0d0(0x21a)][_0x29e0d0(0x1e1)]||0x0)),_0x479c17=_0x2d715c['find'](_0x540619=>(_0x540619[_0x29e0d0(0x1e1)]||0x0)===_0x47c058);_0x479c17&&(_0x3e5b1c[_0x29e0d0(0x228)]?.['update'](_0x29e0d0(0x1b5)+_0x212ee8[_0x29e0d0(0x19d)]+'\x20v'+_0x47c058),_0x1a09a0=await _0x54b69e(_0x479c17['id']));}else{const _0x4810ae=_0x2d715c[_0x2d715c[_0x29e0d0(0x1c2)]-0x1];_0x3e5b1c[_0x29e0d0(0x228)]?.['update'](_0x29e0d0(0x1b5)+_0x212ee8[_0x29e0d0(0x19d)]),_0x1a09a0=await _0x54b69e(_0x4810ae['id']);const _0x561215=_0x54bbf9(_0x4810ae['id']),_0xf31ef5=await journeyResponseToDef(_0x1a09a0,_0x561215),_0x4c5a52=buildLocalRuleToNameMappingFromJourney(_0x212ee8);_0x436615=buildMergedJourneyDef([{'item':_0x4810ae,'yaml':_0xf31ef5}],_0x4c5a52);}}addFoldersToCreate(_0x4c28ed,_0x3e5b1c[_0x29e0d0(0x1df)],_0x54161a);const _0x1e53fb=calculateJourneyDiff(_0x212ee8,_0x436615);_0x9332d4[_0x29e0d0(0x1b9)]({'relativePath':_0x212ee8['name'],'absolutePath':_0x423ce7,'yamlConfig':_0x212ee8,'folderPath':_0x4c28ed,'existingJourney':_0x1a09a0,'isNew':_0x1e53fb[_0x29e0d0(0x230)],'hasChanges':_0x1e53fb[_0x29e0d0(0x21f)],'diff':_0x1e53fb[_0x29e0d0(0x20c)]});}return{'journeyFiles':_0x9332d4,'foldersToCreate':_0x54161a};}export function calculateActivationActions(_0x532c3b,_0x5cbca2,_0x576557,_0x1f1438){const _0x20195e=a100_0xbb0e10,_0x41d65b=[],_0x3179a7=new Map();for(const _0x159666 of _0x5cbca2){_0x3179a7[_0x20195e(0x1b2)](_0x159666[_0x20195e(0x19d)],_0x159666);}const _0x1b69c3=new Map();for(const _0x49b941 of _0x532c3b){_0x1b69c3[_0x20195e(0x1b2)](_0x49b941[_0x20195e(0x19d)],_0x49b941);}for(const _0x542ba6 of _0x532c3b){const _0x3ccb8a=_0x3179a7[_0x20195e(0x200)](_0x542ba6[_0x20195e(0x19d)]);if(!_0x3ccb8a)_0x41d65b[_0x20195e(0x1b9)]({'type':_0x20195e(0x238),'name':_0x542ba6[_0x20195e(0x19d)],'yamlActivation':_0x542ba6});else{const _0x552d1c=activationResponseToDef(_0x3ccb8a,_0x576557,_0x1f1438),_0x4fd946=a100_0x1d2a91[_0x20195e(0x189)](_0x552d1c),_0x1aa186=a100_0x1d2a91[_0x20195e(0x189)](_0x542ba6);_0x4fd946!==_0x1aa186&&_0x41d65b[_0x20195e(0x1b9)]({'type':_0x20195e(0x232),'name':_0x542ba6['name'],'yamlActivation':_0x542ba6,'existingActivation':_0x3ccb8a});}}for(const _0x5a71cf of _0x5cbca2){!_0x1b69c3[_0x20195e(0x1f0)](_0x5a71cf['name'])&&_0x41d65b[_0x20195e(0x1b9)]({'type':_0x20195e(0x217),'name':_0x5a71cf[_0x20195e(0x19d)],'existingActivation':_0x5a71cf});}return _0x41d65b;}export function calculateSegmentDiff(_0x13d3a0,_0x435e17,_0x231eb0,_0x4a0a02,_0x48e55f){const _0x32d915=segmentToYamlString(_0x13d3a0);if(_0x435e17){const _0x27e536=segmentWithActivationsToYaml(_0x435e17,_0x231eb0,undefined,_0x4a0a02,_0x48e55f),_0x464ade=segmentToYamlString(_0x27e536),_0x1936d0=generateDiff(_0x464ade,_0x32d915),_0x4bab50=hasChanges(_0x1936d0);return{'isNew':![],'hasChanges':_0x4bab50,'diff':_0x4bab50?formatDiffWithColors(_0x1936d0):undefined};}const _0x11c345=generateDiff('',_0x32d915);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x11c345)};}export function calculateJourneyDiff(_0x5babb5,_0x4c459b){const _0xd14a5f=normalizeJourneyDef(_0x5babb5,_0x5babb5),_0x54ddc7=a100_0x13016c(_0xd14a5f);if(_0x4c459b){const _0x100c55=normalizeJourneyDef(_0x4c459b,_0x5babb5),_0xa3beec=a100_0x13016c(_0x100c55),_0x4a8329=generateDiff(_0xa3beec,_0x54ddc7),_0x28ce35=hasChanges(_0x4a8329);return{'isNew':![],'hasChanges':_0x28ce35,'diff':_0x28ce35?formatDiffWithColors(_0x4a8329):undefined};}const _0x52a9bd=generateDiff('',_0x54ddc7);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x52a9bd)};}export function findSegmentsToDelete(_0x36d612,_0xb18cba,_0x182879,_0x5a124f,_0x97c684){const _0x302dc1=a100_0xbb0e10,_0x2cb012=new Set();for(const {yamlConfig:_0x4e8f63,folderPath:_0x427e35}of _0xb18cba){_0x2cb012[_0x302dc1(0x187)](_0x427e35+':'+_0x4e8f63[_0x302dc1(0x19d)]);}return _0x36d612['filter'](_0x137482=>{const _0x1c6309=_0x302dc1,_0x5c0d01=_0x137482[_0x1c6309(0x1d5)]?_0x182879['get'](_0x137482[_0x1c6309(0x1d5)]['toString']())||'':'',_0x58eeff=_0x5c0d01+':'+_0x137482[_0x1c6309(0x19d)];if(_0x2cb012['has'](_0x58eeff))return![];if(_0x97c684)return _0x5c0d01===_0x5a124f||_0x5c0d01['startsWith'](_0x5a124f+'/');return!![];});}export function findJourneysToDelete(_0x3694e2,_0x2bb30d,_0x242fe1,_0x2e236e,_0x112e99){const _0x4b1883=a100_0xbb0e10,_0xb30fc2=new Set();for(const {yamlConfig:_0x4a10b9,folderPath:_0x471934}of _0x2bb30d){_0xb30fc2[_0x4b1883(0x187)](_0x471934+':'+_0x4a10b9[_0x4b1883(0x19d)]);}return _0x3694e2[_0x4b1883(0x180)](_0x5211a9=>{const _0x509193=_0x4b1883,_0x2f8200=_0x5211a9[_0x509193(0x255)]?_0x242fe1[_0x509193(0x200)](_0x5211a9['folderId'])||'':'',_0x4e2a9c=_0x2f8200+':'+_0x5211a9[_0x509193(0x186)];if(_0xb30fc2[_0x509193(0x1f0)](_0x4e2a9c))return![];if(_0x112e99)return _0x2f8200===_0x2e236e||_0x2f8200[_0x509193(0x21d)](_0x2e236e+'/');return!![];});}export function buildSegmentLookupMap(_0x215fd7,_0x42e393){const _0x45eba2=a100_0xbb0e10,_0x4de2b5=new Map();for(const _0xf15178 of _0x215fd7){const _0x53f1da=_0xf15178['segmentFolderId']?_0x42e393[_0x45eba2(0x200)](_0xf15178['segmentFolderId'][_0x45eba2(0x1dc)]())||'':'',_0x4afd27=_0x53f1da+':'+_0xf15178['name'];_0x4de2b5['set'](_0x4afd27,_0xf15178);}return _0x4de2b5;}export function buildSegmentNameToIdMap(_0x5c5d95){const _0x1a0050=a100_0xbb0e10,_0x3a478f=new Map();for(const _0x3a7bc9 of _0x5c5d95){_0x3a478f['set'](_0x3a7bc9[_0x1a0050(0x19d)],_0x3a7bc9['id']);}return _0x3a478f;}export function buildJourneyBundleLookupMap(_0x3360e8,_0x25d99d){const _0x3ae85e=a100_0xbb0e10,_0x19d23b=new Map();for(const _0x377d4b of _0x3360e8){const _0x4c6869=_0x377d4b['folderId']?_0x25d99d[_0x3ae85e(0x200)](_0x377d4b[_0x3ae85e(0x255)])||'':'',_0xef6970=_0x4c6869+':'+_0x377d4b['journeyBundleName'];!_0x19d23b['has'](_0xef6970)&&_0x19d23b['set'](_0xef6970,[]),_0x19d23b[_0x3ae85e(0x200)](_0xef6970)['push'](_0x377d4b);}for(const _0xcf9b7b of _0x19d23b[_0x3ae85e(0x1de)]()){_0xcf9b7b[_0x3ae85e(0x18f)]((_0x2fca25,_0x59a5ad)=>(_0x2fca25[_0x3ae85e(0x1e1)]||0x0)-(_0x59a5ad[_0x3ae85e(0x1e1)]||0x0));}return _0x19d23b;}export function collectFoldersToCreate(_0x2766f6,_0x9dab48){const _0x1d3135=a100_0xbb0e10,_0x102e56=new Set();for(const _0x2a99a0 of _0x2766f6){if(!_0x2a99a0)continue;if(_0x9dab48[_0x1d3135(0x1f0)](_0x2a99a0))continue;const _0x3c488b=_0x2a99a0[_0x1d3135(0x1d6)]('/');let _0x5ae4b4='';for(const _0x3b9132 of _0x3c488b){_0x5ae4b4=_0x5ae4b4?_0x5ae4b4+'/'+_0x3b9132:_0x3b9132,!_0x9dab48[_0x1d3135(0x1f0)](_0x5ae4b4)&&_0x102e56[_0x1d3135(0x187)](_0x5ae4b4);}}return _0x102e56;}export function parseAndClassifyYamlFiles(_0x2d4cef,_0x5e6532,_0xb2c001){const _0x54f706=a100_0xbb0e10,_0x537d82=[],_0x3b698c=[];for(const _0x3a2a68 of _0x2d4cef){const _0x27a6c1=a100_0x4231b1['relative'](_0x5e6532,a100_0x4231b1['dirname'](_0x3a2a68)),_0x206c36=_0x27a6c1==='.'?'':_0x27a6c1,_0x152245=readFileSync(_0x3a2a68,_0x54f706(0x235)),_0x53eca9=a100_0x1d2a91[_0x54f706(0x1a9)](_0x152245);if(isJourneyDef(_0x53eca9)){const _0x2f5c10=a100_0x348012(_0x152245);_0x3b698c[_0x54f706(0x1b9)]({'yamlConfig':_0x2f5c10,'folderPath':_0x206c36,'sourcePath':_0x3a2a68});}else{if(!_0xb2c001?.[_0x54f706(0x19e)]){const _0x2c671a=parseSegmentYamlFile(_0x152245),_0x5833e9=normalizeChildSegmentYaml(_0x2c671a);_0x537d82[_0x54f706(0x1b9)]({'yamlConfig':_0x5833e9,'folderPath':_0x206c36,'sourcePath':_0x3a2a68});}}}return{'segments':_0x537d82,'journeys':_0x3b698c};}export function validateParsedFiles(_0x1adca0,_0x3324d1){const _0x4fa902=a100_0xbb0e10,_0x2a538d=[];for(const {yamlConfig:_0x321591,sourcePath:_0x185572}of _0x1adca0[_0x4fa902(0x183)]){const _0x41b344=readFileSync(_0x185572,_0x4fa902(0x235)),_0x3b3064=a100_0x1d2a91[_0x4fa902(0x19f)](_0x41b344),_0x31bb7d=validateSegmentDef(_0x321591,{'source':_0x41b344,'document':_0x3b3064});if(!_0x31bb7d[_0x4fa902(0x210)]){const _0x4bdcdf=a100_0x4231b1[_0x4fa902(0x225)](_0x3324d1,_0x185572);_0x2a538d['push']({'filePath':_0x4bdcdf,'source':_0x41b344,'result':_0x31bb7d,'isJourney':![]});}}for(const {yamlConfig:_0xf3eef8,sourcePath:_0x10d7d5}of _0x1adca0[_0x4fa902(0x1b8)]){const _0x494052=readFileSync(_0x10d7d5,_0x4fa902(0x235)),_0x4fd205=a100_0x1d2a91[_0x4fa902(0x19f)](_0x494052),_0x28d909=validateJourneyDef(_0xf3eef8,{'source':_0x494052,'document':_0x4fd205});if(!_0x28d909['valid']){const _0x2fc4a2=a100_0x4231b1[_0x4fa902(0x225)](_0x3324d1,_0x10d7d5);_0x2a538d[_0x4fa902(0x1b9)]({'filePath':_0x2fc4a2,'source':_0x494052,'result':_0x28d909,'isJourney':!![]});}}return _0x2a538d;}export function formatValidationErrors(_0x188bf6){const _0x28a7de=a100_0xbb0e10,_0x33ab14=[];for(const {filePath:_0x108856,source:_0x17f26b,result:_0x2fc57d,isJourney:_0xd38922}of _0x188bf6){const _0x1dff1d=_0xd38922?_0x28a7de(0x16e):'segment';_0x33ab14[_0x28a7de(0x1b9)]('\x0a'+_0x108856+'\x20('+_0x1dff1d+_0x28a7de(0x1ac)+_0x2fc57d[_0x28a7de(0x1bd)][_0x28a7de(0x1c2)]+_0x28a7de(0x256)),_0x33ab14[_0x28a7de(0x1b9)](formatValidationResult(_0x2fc57d,_0x17f26b,_0x108856));}return _0x33ab14[_0x28a7de(0x1c8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x58b97d){const _0x139147=a100_0xbb0e10,_0x378b8b=new Set(),_0x3e09b4=new Map(),_0x3d92d1=collectSegmentUsageCounts(_0x58b97d);if(_0x58b97d['segments'])for(const [_0x3020b2,_0x590ca3]of Object[_0x139147(0x214)](_0x58b97d[_0x139147(0x183)])){_0x378b8b['add'](_0x3020b2);if(_0x590ca3[_0x139147(0x188)]){const _0x1546d7=yamlRuleToApi(_0x590ca3['rule']),_0x12c5f1=apiRuleToYaml(_0x1546d7);_0x3e09b4[_0x139147(0x1b2)](_0x3020b2,_0x12c5f1);}}const _0x26fad2=new Map();let _0x5573af=0x0;for(const [_0x250411,_0x439ae8]of _0x3e09b4){const _0x360cd9=serializeExpandedRule(_0x439ae8,_0x3e09b4),_0x5d581c=_0x26fad2[_0x139147(0x200)](_0x360cd9)||[];_0x5d581c[_0x139147(0x1b9)]({'name':_0x250411,'index':_0x5573af}),_0x26fad2[_0x139147(0x1b2)](_0x360cd9,_0x5d581c),_0x5573af++;}const _0x368dc9=new Map();for(const [_0x3ea8cd,_0x289bf6]of _0x26fad2){const _0x3f6a76=_0x289bf6['slice']()[_0x139147(0x18f)]((_0x2b9f74,_0x6c9cf8)=>{const _0x34e81b=_0x139147,_0x4304fc=_0x3d92d1['get'](_0x2b9f74[_0x34e81b(0x19d)])||0x0,_0x330c58=_0x3d92d1[_0x34e81b(0x200)](_0x6c9cf8[_0x34e81b(0x19d)])||0x0;if(_0x4304fc!==_0x330c58)return _0x330c58-_0x4304fc;return _0x2b9f74[_0x34e81b(0x1a0)]-_0x6c9cf8[_0x34e81b(0x1a0)];})['map'](_0x17259f=>_0x17259f['name']),_0x20b129=[];for(const _0x21707b of _0x3f6a76){const _0x3625a5=_0x3d92d1['get'](_0x21707b)||0x0,_0x39f01f=Math[_0x139147(0x168)](_0x3625a5,0x1);for(let _0xedcd8d=0x0;_0xedcd8d<_0x39f01f;_0xedcd8d++){_0x20b129[_0x139147(0x1b9)](_0x21707b);}}_0x368dc9['set'](_0x3ea8cd,_0x20b129);}return{'existingLocalSegmentNames':_0x378b8b,'localSegmentRules':_0x3e09b4,'localExpandedRuleToNames':_0x368dc9};}async function buildServerSegmentRuleMap(_0x23dab1,_0x12a760,_0x4b1df5,_0x2bd7fa){const _0x574572=new Map(),_0x20a971=new Set(),_0x2c715b=async _0x5ced64=>{const _0x362ed4=a100_0x5743;if(_0x20a971[_0x362ed4(0x1f0)](_0x5ced64))return;_0x20a971[_0x362ed4(0x187)](_0x5ced64);let _0x6f3c39=_0x4b1df5[_0x362ed4(0x247)](_0x4469e4=>_0x4469e4['id']===_0x5ced64);if(!_0x6f3c39)try{_0x6f3c39=await _0x23dab1[_0x362ed4(0x216)][_0x362ed4(0x21b)](_0x12a760,_0x5ced64);}catch{return;}if(!_0x6f3c39?.[_0x362ed4(0x188)])return;const _0x5334b0=apiRuleToYaml(_0x6f3c39[_0x362ed4(0x188)]);_0x574572[_0x362ed4(0x1b2)](_0x5ced64,_0x5334b0);const _0x51cc04=collectSegmentRefsFromRule(_0x5334b0);for(const _0x470369 of _0x51cc04){await _0x2c715b(_0x470369);}};for(const _0x2638d of _0x2bd7fa){await _0x2c715b(_0x2638d);}return _0x574572;}export function createSegmentIdResolver(_0xcf9d7,_0x53bc12){return async _0x28c612=>{const _0x3cd8eb=a100_0x5743,_0x3c0363=_0xcf9d7[_0x3cd8eb(0x200)](_0x28c612);if(!_0x3c0363)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3cd8eb(0x237)+_0x28c612+_0x3cd8eb(0x1b4)+_0x53bc12+'\x27)');return _0x3c0363;};}export function extractRootFolderId(_0x419bea){const _0x5284e7=a100_0xbb0e10;return _0x419bea[_0x5284e7(0x1a8)]?.['parentSegmentFolder']?.[_0x5284e7(0x207)]?.['id']||_0x419bea[_0x5284e7(0x1a8)]?.[_0x5284e7(0x1a3)]?.[_0x5284e7(0x207)]?.['id'];}export function buildConnectionMaps(_0x451dc5){const _0x351b20=a100_0xbb0e10,_0x141765=new Map(),_0x3e8b66=new Map(),_0x1278f6=new Map();for(const _0x4d0bfe of _0x451dc5){_0x141765[_0x351b20(0x1b2)](_0x4d0bfe[_0x351b20(0x19d)],parseInt(_0x4d0bfe['id'],0xa)),_0x3e8b66[_0x351b20(0x1b2)](_0x4d0bfe['id'],_0x4d0bfe[_0x351b20(0x19d)]),_0x1278f6['set'](_0x4d0bfe[_0x351b20(0x19d)],_0x4d0bfe['type']);}return{'nameToId':_0x141765,'idToName':_0x3e8b66,'nameToType':_0x1278f6};}export function calculatePushStats(_0x48b4f3,_0x5cb54e,_0x3e6edc,_0x78ded1,_0x8c23ec,_0x596a91,_0x352f3d){const _0x398c1f=a100_0xbb0e10,_0x44caf6=_0x48b4f3[_0x398c1f(0x180)](_0x1d9163=>_0x1d9163[_0x398c1f(0x230)]),_0x16e9d4=_0x48b4f3['filter'](_0x5b6ae4=>!_0x5b6ae4[_0x398c1f(0x230)]&&_0x5b6ae4[_0x398c1f(0x21f)]),_0x1b1225=_0x48b4f3[_0x398c1f(0x180)](_0x381c80=>!_0x381c80[_0x398c1f(0x230)]&&!_0x381c80[_0x398c1f(0x21f)]),_0x289707=_0x596a91?_0x78ded1:[],_0x4495e1=_0x5cb54e[_0x398c1f(0x180)](_0x8e0745=>_0x8e0745[_0x398c1f(0x230)]),_0x4ef911=_0x5cb54e[_0x398c1f(0x180)](_0x3ad10b=>!_0x3ad10b['isNew']&&_0x3ad10b['hasChanges']),_0x536259=_0x5cb54e['filter'](_0x53c060=>!_0x53c060[_0x398c1f(0x230)]&&!_0x53c060[_0x398c1f(0x21f)]),_0x2455c6=_0x596a91?_0x8c23ec:[],_0x8056f3=_0x48b4f3[_0x398c1f(0x1fb)](_0x4104c1=>_0x4104c1['activationActions']),_0x397694=_0x8056f3[_0x398c1f(0x180)](_0x3de2fd=>_0x3de2fd[_0x398c1f(0x1f1)]===_0x398c1f(0x238)),_0x1f6574=_0x8056f3['filter'](_0x169ba4=>_0x169ba4['type']===_0x398c1f(0x232)),_0x235364=_0x8056f3[_0x398c1f(0x180)](_0x1e784c=>_0x1e784c[_0x398c1f(0x1f1)]===_0x398c1f(0x217)),_0x3db363=Array[_0x398c1f(0x1be)](_0x3e6edc)['sort'](),_0x112afe=_0x352f3d?![]:_0x44caf6['length']>0x0||_0x16e9d4[_0x398c1f(0x1c2)]>0x0||_0x289707[_0x398c1f(0x1c2)]>0x0,_0x1d3a7a=_0x4495e1['length']>0x0||_0x4ef911['length']>0x0||_0x2455c6[_0x398c1f(0x1c2)]>0x0,_0x2809bb=_0x352f3d?![]:_0x8056f3[_0x398c1f(0x1c2)]>0x0,_0x394f1c=_0x3db363[_0x398c1f(0x1c2)]>0x0;return{'segments':{'new':_0x44caf6,'changed':_0x16e9d4,'unchanged':_0x1b1225,'toDelete':_0x289707},'journeys':{'new':_0x4495e1,'changed':_0x4ef911,'unchanged':_0x536259,'toDelete':_0x2455c6},'activations':{'all':_0x8056f3,'toCreate':_0x397694,'toUpdate':_0x1f6574,'toDelete':_0x235364},'folders':{'toCreate':_0x3db363},'counts':{'segments':{'new':_0x44caf6[_0x398c1f(0x1c2)],'changed':_0x16e9d4['length'],'unchanged':_0x1b1225['length'],'toDelete':_0x289707[_0x398c1f(0x1c2)]},'journeys':{'new':_0x4495e1[_0x398c1f(0x1c2)],'changed':_0x4ef911[_0x398c1f(0x1c2)],'unchanged':_0x536259[_0x398c1f(0x1c2)],'toDelete':_0x2455c6[_0x398c1f(0x1c2)]},'activations':{'create':_0x397694[_0x398c1f(0x1c2)],'update':_0x1f6574[_0x398c1f(0x1c2)],'delete':_0x235364[_0x398c1f(0x1c2)]},'folders':_0x3db363['length']},'hasChanges':_0x112afe||_0x1d3a7a||_0x2809bb||_0x394f1c};}export async function buildPushExecutionContext(_0x5a11b1,_0x13b098,_0x4f0077,_0x317f12,_0x58f903,_0x36c386){const _0x132ccd=a100_0xbb0e10,_0x2209b6=extractRootFolderId(_0x4f0077),{pathToId:_0x336290,idToPath:_0x261f85}=buildFolderMaps(_0x58f903),_0x189f63=buildSegmentNameToIdMap(_0x317f12),_0x5288e=new Map(),{batchAsync:_0x457653}=await import(_0x132ccd(0x19a)),[_0x4c2067,_0x84da0c]=await Promise[_0x132ccd(0x192)]([_0x5a11b1[_0x132ccd(0x197)][_0x132ccd(0x16c)](),_0x5a11b1[_0x132ccd(0x1ce)][_0x132ccd(0x1bc)](),((async()=>{const _0x1d90da=_0x132ccd;!_0x36c386&&_0x317f12[_0x1d90da(0x1c2)]>0x0&&await _0x457653(_0x317f12,async _0x4cbda5=>{const _0x32f9b8=_0x1d90da,_0x201de1=await _0x5a11b1[_0x32f9b8(0x216)][_0x32f9b8(0x1eb)](_0x13b098,_0x4cbda5['id']);_0x5288e[_0x32f9b8(0x1b2)](_0x4cbda5['id'],_0x201de1);});})())]),{emailToId:_0x1bafc3,idToEmail:_0x552b13}=_0x4c2067,_0x1e5a93=buildConnectionMaps(_0x84da0c);return{'rootFolderId':_0x2209b6,'folderPathToId':_0x336290,'folderIdToPath':_0x261f85,'segmentNameToId':_0x189f63,'activationsBySegmentId':_0x5288e,'emailToIdMap':_0x1bafc3,'idToEmailMap':_0x552b13,'connectionNameToIdMap':_0x1e5a93[_0x132ccd(0x218)],'connectionIdToNameMap':_0x1e5a93[_0x132ccd(0x22c)],'connectionNameToTypeMap':_0x1e5a93[_0x132ccd(0x1c4)]};}export function createPushYamlContextForBundle(_0x2f6ec0,_0x11c7d7,_0x267df1,_0x6f7c4b,_0x30473b,_0x435fcf,_0x3f7da4,_0x439e0a){const {existingLocalSegmentNames:_0x4f73be,localExpandedRuleToNames:_0xd7bd6a}=_0x6f7c4b,_0x20e540=new Set(),_0x7ac440=new Map(),_0xdb4cd5=new Map(),_0x59eefa=new Map(),_0x27cee6=createJumpTargetCache(),_0x2015c0=new Map(),_0x4e1f0c=new Map(),_0x2252b0=new Set();let _0x466bbc;const _0x1bf1b0=_0x49eaef=>{const _0x42bfcc={'resolveSegment':async _0x47309b=>{const _0x5d8090=a100_0x5743,_0x470412=_0x59eefa[_0x5d8090(0x200)](_0x47309b);if(_0x470412!==undefined)return{'name':_0x470412,'isJourneyLocal':!![]};try{let _0x4a083c=_0x267df1[_0x5d8090(0x247)](_0x15a95e=>_0x15a95e['id']===_0x47309b);!_0x4a083c&&(_0x4a083c=await _0x2f6ec0[_0x5d8090(0x216)][_0x5d8090(0x21b)](_0x11c7d7,_0x47309b));const _0x9bd3c2=generateJourneyLocalName(_0x4a083c[_0x5d8090(0x19d)]),_0x5f5626=_0x4a083c[_0x5d8090(0x1ae)]===SEGMENT_KIND_JOURNEY&&_0x9bd3c2!==undefined;let _0x59d88a=_0x4a083c[_0x5d8090(0x19d)],_0x37b3f4;if(_0x5f5626&&_0x4a083c[_0x5d8090(0x188)]){const _0x378b34=apiRuleToYaml(_0x4a083c[_0x5d8090(0x188)]);_0x4e1f0c['set'](_0x47309b,_0x378b34);const _0x55c544=async _0x37bf80=>{const _0x3dcfbc=_0x5d8090,_0x2d5477=collectSegmentRefsFromRule(_0x37bf80);for(const _0x51642f of _0x2d5477){if(!_0x4e1f0c[_0x3dcfbc(0x1f0)](_0x51642f))try{const _0x1219fe=await _0x2f6ec0['segment'][_0x3dcfbc(0x21b)](_0x11c7d7,_0x51642f);if(_0x1219fe?.['rule']){const _0x18efe8=apiRuleToYaml(_0x1219fe[_0x3dcfbc(0x188)]);_0x4e1f0c['set'](_0x51642f,_0x18efe8),await _0x55c544(_0x18efe8);}}catch{}}};await _0x55c544(_0x378b34);const _0x2406c5=serializeExpandedRule(_0x378b34,_0x4e1f0c),_0x586ec9=_0xd7bd6a[_0x5d8090(0x200)](_0x2406c5);if(_0x586ec9&&_0x586ec9[_0x5d8090(0x1c2)]>0x0){const _0x4cd535=_0x7ac440['get'](_0x2406c5)||0x0,_0x371783=_0x586ec9[_0x4cd535]||_0x586ec9[_0x586ec9[_0x5d8090(0x1c2)]-0x1];_0x7ac440[_0x5d8090(0x1b2)](_0x2406c5,_0x4cd535+0x1),_0x59d88a=_0x371783,_0x20e540[_0x5d8090(0x187)](_0x59d88a),_0x59eefa[_0x5d8090(0x1b2)](_0x47309b,_0x59d88a);const _0x1b2bbf=await resolveRuleSegmentRefs(_0x378b34,async _0x507d75=>{const _0x3c3237=_0x5d8090,_0x1cd0cd=_0x59eefa[_0x3c3237(0x200)](_0x507d75);if(_0x1cd0cd)return _0x1cd0cd;const _0x244ff3=await _0x466bbc[_0x3c3237(0x220)](_0x507d75);return _0x244ff3['name'];});_0x37b3f4={'description':_0x4a083c[_0x5d8090(0x20d)],'rule':_0x1b2bbf};}else{const _0x2edf5a=_0x2015c0[_0x5d8090(0x200)](_0x2406c5);if(_0x2edf5a)_0x59d88a=_0x2edf5a,_0x59eefa['set'](_0x47309b,_0x59d88a);else{if(_0x9bd3c2){let _0x4027a5=_0x9bd3c2,_0x5d0ed1=0x2;while(_0x20e540[_0x5d8090(0x1f0)](_0x4027a5)||_0x4f73be[_0x5d8090(0x1f0)](_0x4027a5)){_0x4027a5=_0x9bd3c2+'_'+_0x5d0ed1,_0x5d0ed1++;}_0x20e540[_0x5d8090(0x187)](_0x4027a5),_0x59d88a=_0x4027a5;}_0x59eefa[_0x5d8090(0x1b2)](_0x47309b,_0x59d88a),_0x2015c0['set'](_0x2406c5,_0x59d88a);const _0x4c844c=await resolveRuleSegmentRefs(_0x378b34,async _0x12d346=>{const _0x43636c=_0x5d8090,_0x576aa4=_0x59eefa[_0x43636c(0x200)](_0x12d346);if(_0x576aa4)return _0x576aa4;const _0x5a57ae=await _0x466bbc[_0x43636c(0x220)](_0x12d346);return _0x5a57ae[_0x43636c(0x19d)];});_0x37b3f4={'description':_0x4a083c[_0x5d8090(0x20d)],'rule':_0x4c844c};}}}return{'name':_0x59d88a,'isJourneyLocal':_0x5f5626,'definition':_0x37b3f4};}catch{return{'name':_0x47309b,'isJourneyLocal':![]};}},'resolveActivation':async _0x28ae88=>{const _0x21b860=a100_0x5743,_0x431931=_0xdb4cd5['get'](_0x28ae88);if(_0x431931!==undefined)return{'name':_0x431931,'isJourneyLocal':!![]};try{let _0x3fd568=_0x3f7da4?.['get'](_0x28ae88);!_0x3fd568&&(_0x3fd568=await _0x2f6ec0[_0x21b860(0x16e)][_0x21b860(0x195)](_0x49eaef,_0x28ae88));const _0x52b3e7=_0x3fd568[_0x21b860(0x20e)][_0x21b860(0x1da)][_0x21b860(0x19d)]||_0x28ae88,_0x14303a=sanitizeYamlKey(_0x52b3e7)||_0x21b860(0x1ea)+_0x28ae88,_0x4d9668=_0x14303a;_0xdb4cd5[_0x21b860(0x1b2)](_0x28ae88,_0x4d9668);const _0x3ffae5=journeyActivationStepToYaml(_0x3fd568,_0x30473b,_0x435fcf);return{'name':_0x4d9668,'isJourneyLocal':!![],'definition':_0x3ffae5};}catch{return{'name':_0x28ae88,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2fe4ee,_0x2a8eca)=>resolveJumpTarget(_0x2fe4ee,_0x2a8eca,_0x27cee6,async _0x53ceed=>{const _0x14afca=a100_0x5743,_0x1b5da0=_0x439e0a?.['get'](_0x53ceed);if(_0x1b5da0)return _0x1b5da0;return _0x2f6ec0[_0x14afca(0x16e)]['getJourney'](_0x53ceed);})};return _0x466bbc=_0x42bfcc,_0x42bfcc;},_0x466fb7=async _0x2c28c3=>{const _0x482231=a100_0x5743,{collectSegmentIdsFromJourneyApi:_0x5a8934}=await import(_0x482231(0x1c7)),{batchAsync:_0x3a33d6}=await import(_0x482231(0x19a)),_0x56c1b4=new Set();for(const _0x4a6a41 of _0x2c28c3){let _0x4e2ff3=_0x439e0a?.[_0x482231(0x200)](_0x4a6a41);!_0x4e2ff3&&(_0x4e2ff3=await _0x2f6ec0[_0x482231(0x16e)][_0x482231(0x185)](_0x4a6a41));const _0x39d1f3=_0x5a8934(_0x4e2ff3);for(const _0x2ff244 of _0x39d1f3){_0x56c1b4[_0x482231(0x187)](_0x2ff244);}}let _0x3a663a=Array['from'](_0x56c1b4);while(_0x3a663a[_0x482231(0x1c2)]>0x0){const _0x4320da=_0x3a663a[_0x482231(0x180)](_0x2526c5=>!_0x2252b0[_0x482231(0x1f0)](_0x2526c5));if(_0x4320da[_0x482231(0x1c2)]===0x0)break;const _0x693414=await _0x3a33d6(_0x4320da,async _0x871feb=>{const _0x555c5c=_0x482231;_0x2252b0['add'](_0x871feb);let _0x337390=_0x267df1[_0x555c5c(0x247)](_0x44973f=>_0x44973f['id']===_0x871feb);if(!_0x337390)try{_0x337390=await _0x2f6ec0['segment'][_0x555c5c(0x21b)](_0x11c7d7,_0x871feb);}catch{return null;}return{'segmentId':_0x871feb,'segment':_0x337390};},0xa),_0x4edd7a=new Set();for(const _0x3616b8 of _0x693414){if(!_0x3616b8?.[_0x482231(0x216)]?.[_0x482231(0x188)])continue;const _0x5ec4b5=apiRuleToYaml(_0x3616b8['segment'][_0x482231(0x188)]);_0x4e1f0c[_0x482231(0x1b2)](_0x3616b8['segmentId'],_0x5ec4b5);const _0x2de6bf=collectSegmentRefsFromRule(_0x5ec4b5);for(const _0x65abb6 of _0x2de6bf){!_0x2252b0[_0x482231(0x1f0)](_0x65abb6)&&_0x4edd7a[_0x482231(0x187)](_0x65abb6);}}_0x3a663a=Array[_0x482231(0x1be)](_0x4edd7a);}};return{'createYamlContext':_0x1bf1b0,'prefetchJourneySegments':_0x466fb7};}export async function executePushSegments(_0x301ac6,_0x1f0ba8,_0x2d761e,_0x1ad984,_0x4f851c){const _0x1e36c4=a100_0xbb0e10,{segmentDefToCreateRequest:_0x59453e,segmentDefToUpdateRequest:_0x3025b6}=await import('./child-segment-yaml.js'),_0x2b6b6f=_0x2d761e[_0x1e36c4(0x1df)],_0x4813cf=0x5,_0x10d045=async _0x23fe8a=>{const _0x11e2fc=_0x1e36c4,_0x522781=_0x23fe8a[_0x11e2fc(0x1b3)]?_0x2b6b6f['get'](_0x23fe8a[_0x11e2fc(0x1b3)]):undefined;let _0xe7c3bd;const _0x44b5e4={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x23fe8a[_0x11e2fc(0x230)]){_0x4f851c[_0x11e2fc(0x233)]?.({'type':'segment_creating','name':_0x23fe8a[_0x11e2fc(0x1c9)][_0x11e2fc(0x19d)]});const _0x5ea2ec=_0x59453e(_0x23fe8a[_0x11e2fc(0x1c9)],_0x522781),_0x12a8db=await _0x4f851c[_0x11e2fc(0x172)](_0x11e2fc(0x244)+_0x23fe8a['yamlConfig']['name']+_0x11e2fc(0x1d4),()=>_0x301ac6[_0x11e2fc(0x216)][_0x11e2fc(0x17f)](_0x1ad984[_0x11e2fc(0x224)],_0x5ea2ec));_0xe7c3bd=_0x12a8db[_0x11e2fc(0x207)]['id'],_0x44b5e4[_0x11e2fc(0x182)]={'name':_0x23fe8a['yamlConfig']['name'],'id':_0xe7c3bd},_0x4f851c[_0x11e2fc(0x233)]?.({'type':_0x11e2fc(0x17a),'name':_0x23fe8a[_0x11e2fc(0x1c9)][_0x11e2fc(0x19d)],'segmentId':_0xe7c3bd}),_0x4f851c[_0x11e2fc(0x171)]?.(_0x11e2fc(0x212)+_0x23fe8a['yamlConfig'][_0x11e2fc(0x19d)]+'\x27'),_0x44b5e4[_0x11e2fc(0x1bf)]=0x1;}else{if(_0x23fe8a['hasChanges']){_0x4f851c[_0x11e2fc(0x233)]?.({'type':_0x11e2fc(0x1d7),'name':_0x23fe8a[_0x11e2fc(0x1c9)]['name']});const _0x2bc571=_0x3025b6(_0x23fe8a['yamlConfig']);_0x522781!==_0x23fe8a['existingSegment']?.[_0x11e2fc(0x1d5)]&&(_0x2bc571[_0x11e2fc(0x1d5)]=_0x522781?parseInt(_0x522781,0xa):undefined),await _0x4f851c['withProgress']('Updating\x20segment\x20\x27'+_0x23fe8a[_0x11e2fc(0x1c9)][_0x11e2fc(0x19d)]+_0x11e2fc(0x1d4),()=>_0x301ac6[_0x11e2fc(0x216)][_0x11e2fc(0x243)](_0x1ad984[_0x11e2fc(0x224)],_0x23fe8a[_0x11e2fc(0x20b)]['id'],_0x2bc571)),_0xe7c3bd=_0x23fe8a[_0x11e2fc(0x20b)]['id'],_0x4f851c['onProgress']?.({'type':_0x11e2fc(0x16d),'name':_0x23fe8a[_0x11e2fc(0x1c9)][_0x11e2fc(0x19d)]}),_0x4f851c[_0x11e2fc(0x171)]?.(_0x11e2fc(0x176)+_0x23fe8a[_0x11e2fc(0x1c9)][_0x11e2fc(0x19d)]+'\x27'),_0x44b5e4[_0x11e2fc(0x242)]=0x1;}else _0xe7c3bd=_0x23fe8a['existingSegment']['id'];}}catch(_0x1332ab){const _0xe498dc=isHttp400Error(_0x1332ab),_0x34f2b4=_0xe498dc?ErrorCode[_0x11e2fc(0x1b7)]:ErrorCode[_0x11e2fc(0x1f4)],_0x367d1a=getErrorMessage(_0x1332ab);throw new SDKError(_0x34f2b4,'Failed\x20to\x20'+(_0x23fe8a[_0x11e2fc(0x230)]?_0x11e2fc(0x238):_0x11e2fc(0x232))+_0x11e2fc(0x1e9)+_0x23fe8a[_0x11e2fc(0x1b6)]+_0x11e2fc(0x175)+_0x367d1a,_0x1332ab);}try{const _0x27d5cd=await syncActivationsForSegment(_0x301ac6,_0x1ad984[_0x11e2fc(0x224)],_0xe7c3bd,_0x23fe8a['yamlConfig'][_0x11e2fc(0x19d)],_0x23fe8a['activationActions'],_0x4f851c,_0x23fe8a['absolutePath']);_0x44b5e4[_0x11e2fc(0x1a2)]=_0x27d5cd;}catch(_0x2602ff){if(_0x2602ff instanceof SDKError)throw _0x2602ff;throw new SDKError(ErrorCode[_0x11e2fc(0x23d)],_0x11e2fc(0x202)+_0x23fe8a['yamlConfig'][_0x11e2fc(0x19d)]+_0x11e2fc(0x22f)+_0x23fe8a[_0x11e2fc(0x1b6)]+_0x11e2fc(0x175)+getErrorMessage(_0x2602ff),_0x2602ff);}return _0x44b5e4;},_0x577de8=await batchAsync(_0x1f0ba8,_0x10d045,_0x4813cf),_0x51826b={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1a744b of _0x577de8){_0x51826b[_0x1e36c4(0x1bf)]+=_0x1a744b[_0x1e36c4(0x1bf)],_0x51826b[_0x1e36c4(0x242)]+=_0x1a744b[_0x1e36c4(0x242)],_0x1a744b[_0x1e36c4(0x182)]&&_0x51826b[_0x1e36c4(0x184)]['set'](_0x1a744b[_0x1e36c4(0x182)][_0x1e36c4(0x19d)],_0x1a744b[_0x1e36c4(0x182)]['id']),_0x51826b['activations']['created']+=_0x1a744b[_0x1e36c4(0x1a2)][_0x1e36c4(0x1bf)],_0x51826b[_0x1e36c4(0x1a2)][_0x1e36c4(0x242)]+=_0x1a744b[_0x1e36c4(0x1a2)][_0x1e36c4(0x242)],_0x51826b[_0x1e36c4(0x1a2)]['deleted']+=_0x1a744b[_0x1e36c4(0x1a2)]['deleted'];}return _0x51826b;}async function syncActivationsForSegment(_0x5bbc2e,_0x562def,_0x20ea0f,_0x2f2140,_0x757bd8,_0x3b750b,_0x223318){const _0x540677=a100_0xbb0e10,_0x574526={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x57aea6 of _0x757bd8){try{if(_0x57aea6[_0x540677(0x1f1)]===_0x540677(0x238)&&_0x57aea6[_0x540677(0x21c)])_0x3b750b[_0x540677(0x233)]?.({'type':_0x540677(0x252),'segmentName':_0x2f2140,'activationName':_0x57aea6[_0x540677(0x19d)]}),await _0x3b750b['withProgress'](_0x540677(0x1c0)+_0x57aea6['name']+_0x540677(0x1d4),()=>_0x5bbc2e[_0x540677(0x216)]['createActivation'](_0x562def,_0x20ea0f,_0x57aea6[_0x540677(0x21c)])),_0x3b750b['onProgress']?.({'type':_0x540677(0x240),'segmentName':_0x2f2140,'activationName':_0x57aea6['name']}),_0x3b750b[_0x540677(0x171)]?.(_0x540677(0x1fd)+_0x57aea6[_0x540677(0x19d)]+'\x27'),_0x574526[_0x540677(0x1bf)]++;else{if(_0x57aea6['type']===_0x540677(0x232)&&_0x57aea6[_0x540677(0x21c)]&&_0x57aea6['existingActivation'])_0x3b750b['onProgress']?.({'type':_0x540677(0x1ed),'segmentName':_0x2f2140,'activationName':_0x57aea6['name']}),await _0x3b750b[_0x540677(0x172)](_0x540677(0x226)+_0x57aea6[_0x540677(0x19d)]+_0x540677(0x1d4),()=>_0x5bbc2e[_0x540677(0x216)][_0x540677(0x190)](_0x562def,_0x20ea0f,_0x57aea6[_0x540677(0x253)]['id'],_0x57aea6[_0x540677(0x21c)])),_0x3b750b[_0x540677(0x233)]?.({'type':_0x540677(0x239),'segmentName':_0x2f2140,'activationName':_0x57aea6[_0x540677(0x19d)]}),_0x3b750b[_0x540677(0x171)]?.(_0x540677(0x18a)+_0x57aea6[_0x540677(0x19d)]+'\x27'),_0x574526[_0x540677(0x242)]++;else _0x57aea6[_0x540677(0x1f1)]==='delete'&&_0x57aea6['existingActivation']&&(_0x3b750b[_0x540677(0x233)]?.({'type':_0x540677(0x17c),'segmentName':_0x2f2140,'activationName':_0x57aea6[_0x540677(0x19d)]}),await _0x3b750b['withProgress'](_0x540677(0x1f8)+_0x57aea6[_0x540677(0x19d)]+_0x540677(0x1d4),()=>_0x5bbc2e[_0x540677(0x216)][_0x540677(0x251)](_0x562def,_0x20ea0f,_0x57aea6[_0x540677(0x253)]['id'])),_0x3b750b['onProgress']?.({'type':_0x540677(0x24b),'segmentName':_0x2f2140,'activationName':_0x57aea6[_0x540677(0x19d)]}),_0x3b750b['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x57aea6['name']+'\x27'),_0x574526[_0x540677(0x24f)]++);}}catch(_0x15b896){const _0x403709=isHttp400Error(_0x15b896),_0x279f21=_0x403709?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x540677(0x23d)],_0x42ae21=getErrorMessage(_0x15b896);throw new SDKError(_0x279f21,_0x540677(0x236)+_0x57aea6['type']+_0x540677(0x22d)+_0x57aea6[_0x540677(0x19d)]+_0x540677(0x22f)+_0x223318+'\x0a\x20\x20'+_0x42ae21,_0x15b896);}}return _0x574526;}export async function executePushFolders(_0x3aac63,_0x27bfb1,_0x9fdd5a,_0x489cdc,_0x1f8f98){const _0x4b099b=a100_0xbb0e10,_0x506e85=new Map(_0x9fdd5a);for(const _0x1d38d7 of _0x27bfb1){const _0x13e542=_0x1d38d7['split']('/'),_0x48f7a3=_0x13e542[_0x13e542[_0x4b099b(0x1c2)]-0x1],_0x4eaa42=_0x13e542[_0x4b099b(0x1a1)](0x0,-0x1)[_0x4b099b(0x1c8)]('/'),_0xbb6d50=_0x506e85['get'](_0x4eaa42);_0x1f8f98[_0x4b099b(0x233)]?.({'type':_0x4b099b(0x223),'folder':_0x1d38d7});const _0x20af2f={'name':_0x48f7a3,'parentFolderId':_0xbb6d50},_0x14aef3=await _0x1f8f98[_0x4b099b(0x172)](_0x4b099b(0x1b1)+_0x1d38d7+'\x27...',()=>_0x3aac63['segment'][_0x4b099b(0x231)](_0x489cdc[_0x4b099b(0x224)],_0x20af2f));_0x506e85[_0x4b099b(0x1b2)](_0x1d38d7,_0x14aef3[_0x4b099b(0x207)]['id']),_0x1f8f98['onProgress']?.({'type':_0x4b099b(0x18e),'folder':_0x1d38d7,'folderId':_0x14aef3[_0x4b099b(0x207)]['id']}),_0x1f8f98['logInfo']?.('Created\x20folder\x20\x27'+_0x1d38d7+'\x27');}return _0x506e85;}export async function executePushSegmentDeletions(_0x259c99,_0x47e4cc,_0x39d02a){if(_0x47e4cc['length']===0x0)return 0x0;const {batchAsync:_0x523121}=await import('../../utils/async.js'),_0x34bd15=0x5,_0xa44664=await _0x523121(_0x47e4cc,async _0x62db64=>{const _0x517c16=a100_0x5743;return _0x39d02a[_0x517c16(0x233)]?.({'type':'segment_deleting','name':_0x62db64[_0x517c16(0x19d)]}),await _0x259c99[_0x517c16(0x216)]['deleteSegment'](_0x62db64['id']),_0x39d02a[_0x517c16(0x233)]?.({'type':_0x517c16(0x167),'name':_0x62db64[_0x517c16(0x19d)]}),_0x39d02a[_0x517c16(0x1ab)]?.(_0x517c16(0x1cb)+_0x62db64[_0x517c16(0x19d)]+'\x27'),0x1;},_0x34bd15);return _0xa44664['reduce']((_0x4552bd,_0xe9f1ae)=>_0x4552bd+_0xe9f1ae,0x0);}export async function executePushJourneys(_0x234d71,_0x384e47,_0x32d52c,_0x8459ec,_0x3e9ce7){const _0x11a42e=a100_0xbb0e10,{journeyDefToRequest:_0x349bd0}=await import(_0x11a42e(0x1c7)),{activationDefToCreateRequest:_0xa4a4a0,yamlRuleToApi:_0x178158,validateSegmentRule:_0x4b0b7f}=await import(_0x11a42e(0x213)),_0x189cc1={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x287ce8=new Map(_0x32d52c['segmentNameToId']),_0x50322e=0x5;for(let _0x4a2119=0x0;_0x4a2119<_0x384e47[_0x11a42e(0x1c2)];_0x4a2119+=_0x50322e){const _0x2056b6=_0x384e47[_0x11a42e(0x1a1)](_0x4a2119,_0x4a2119+_0x50322e),_0x50d843=await Promise[_0x11a42e(0x192)](_0x2056b6[_0x11a42e(0x206)](async _0x5df781=>{const _0x1daaa3=_0x11a42e;if(!_0x5df781[_0x1daaa3(0x230)]&&!_0x5df781[_0x1daaa3(0x21f)])return{'action':'unchanged','name':_0x5df781['yamlConfig'][_0x1daaa3(0x19d)],'journeyId':_0x5df781['existingJourney']?.['id']};const _0x16d4c8=_0x5df781[_0x1daaa3(0x1b3)]?_0x32d52c[_0x1daaa3(0x1df)][_0x1daaa3(0x200)](_0x5df781[_0x1daaa3(0x1b3)]):undefined;_0x3e9ce7[_0x1daaa3(0x233)]?.({'type':_0x5df781[_0x1daaa3(0x230)]?_0x1daaa3(0x204):_0x1daaa3(0x22a),'name':_0x5df781[_0x1daaa3(0x1c9)][_0x1daaa3(0x19d)]});try{const _0x102fb2=await executeSingleJourneyPush(_0x234d71,_0x5df781,{..._0x32d52c,'segmentNameToId':_0x287ce8},{'parentId':_0x8459ec[_0x1daaa3(0x224)],'rootFolderId':_0x8459ec['rootFolderId'],'folderId':_0x16d4c8,'verbose':_0x8459ec[_0x1daaa3(0x23b)]},_0x3e9ce7,{'journeyDefToRequest':_0x349bd0,'activationDefToCreateRequest':_0xa4a4a0,'yamlRuleToApi':_0x178158,'validateSegmentRule':_0x4b0b7f});for(const [_0x5afb95,_0xa1f872]of _0x102fb2['embeddedSegmentNameToId']){_0x287ce8['set'](_0x5afb95,_0xa1f872),_0x189cc1[_0x1daaa3(0x1e5)][_0x1daaa3(0x1b2)](_0x5afb95,_0xa1f872);}if(_0x102fb2['action']==='created')_0x3e9ce7[_0x1daaa3(0x233)]?.({'type':_0x1daaa3(0x17e),'name':_0x5df781['yamlConfig']['name'],'journeyId':_0x102fb2[_0x1daaa3(0x222)]}),_0x3e9ce7[_0x1daaa3(0x171)]?.(_0x1daaa3(0x248)+_0x5df781['yamlConfig'][_0x1daaa3(0x19d)]+'\x27'),_0x189cc1['created']++;else _0x102fb2[_0x1daaa3(0x1ba)]===_0x1daaa3(0x242)&&(_0x3e9ce7[_0x1daaa3(0x233)]?.({'type':_0x1daaa3(0x17d),'name':_0x5df781[_0x1daaa3(0x1c9)]['name']}),_0x3e9ce7[_0x1daaa3(0x171)]?.(_0x1daaa3(0x208)+_0x5df781['yamlConfig'][_0x1daaa3(0x19d)]+'\x27'),_0x189cc1[_0x1daaa3(0x242)]++);return{'action':_0x102fb2[_0x1daaa3(0x1ba)],'name':_0x5df781[_0x1daaa3(0x1c9)][_0x1daaa3(0x19d)],'journeyId':_0x102fb2['journeyId']};}catch(_0x13c29a){const _0x1cde83=isHttp400Error(_0x13c29a),_0x210da3=_0x1cde83?ErrorCode[_0x1daaa3(0x1f6)]:ErrorCode[_0x1daaa3(0x1e4)],_0x3c2a4d=getErrorMessage(_0x13c29a);throw new SDKError(_0x210da3,_0x1daaa3(0x236)+(_0x5df781['isNew']?_0x1daaa3(0x238):_0x1daaa3(0x232))+'\x20journey\x20from\x20file:\x20'+_0x5df781['absolutePath']+'\x0a\x20\x20'+_0x3c2a4d,_0x13c29a);}}));_0x189cc1['results'][_0x11a42e(0x1b9)](..._0x50d843);}return _0x189cc1;}async function executeSingleJourneyPush(_0x159495,_0x26fd26,_0x4c9e6d,_0x2f7887,_0x1b94c0,_0x3c97b0){const _0x1bbb93=a100_0xbb0e10,{journeyDefToRequest:_0x3ca21,activationDefToCreateRequest:_0x375aac,yamlRuleToApi:_0x43b29f,validateSegmentRule:_0x50e58a}=_0x3c97b0,_0x5b5165=new Map(),_0x2c48f7=new Map(),_0x5c9ee9=new Map(),_0x4ddecb=new Map(),_0x43d199=new Map();let _0x4f3892;const _0x3a8194=async()=>{const _0x114af8=a100_0x5743;if(_0x4f3892)return;_0x4f3892=new Map();if(!_0x26fd26['existingJourney'])return;const _0x4b2a20=await _0x159495[_0x114af8(0x16e)][_0x114af8(0x1eb)](_0x26fd26[_0x114af8(0x1e0)]['id']);for(const _0x414e79 of _0x4b2a20){const _0x3723e6=journeyActivationStepToYaml(_0x414e79,_0x4c9e6d[_0x114af8(0x22b)],_0x4c9e6d[_0x114af8(0x179)]),_0x210b5a=activationSignature(_0x3723e6);!_0x4f3892['has'](_0x210b5a)&&_0x4f3892[_0x114af8(0x1b2)](_0x210b5a,_0x414e79['id']),_0x3723e6['name']&&_0x2c48f7[_0x114af8(0x1b2)](_0x3723e6[_0x114af8(0x19d)],_0x414e79['id']);}};if(_0x26fd26[_0x1bbb93(0x1e0)]&&_0x26fd26[_0x1bbb93(0x1c9)][_0x1bbb93(0x183)]){const _0x5270df=buildLocalExpandedRuleMappings(_0x26fd26['yamlConfig']),_0x3ae4cb=_0x5270df[_0x1bbb93(0x18d)];if(_0x3ae4cb['size']>0x0){const _0x314989=new Map();for(const [_0x55ad1c,_0x4216b8]of _0x3ae4cb){const _0x50f30d=serializeExpandedRule(_0x4216b8,_0x3ae4cb);_0x314989['set'](_0x55ad1c,_0x50f30d);}const _0x45c7ec=collectSegmentIdsFromJourneyApi(_0x26fd26[_0x1bbb93(0x1e0)]);if(_0x45c7ec[_0x1bbb93(0x196)]>0x0){const _0x1d070a=await buildServerSegmentRuleMap(_0x159495,_0x2f7887[_0x1bbb93(0x224)],_0x4c9e6d[_0x1bbb93(0x1db)],_0x45c7ec);if(_0x1d070a[_0x1bbb93(0x196)]>0x0){const _0x2b4cd5=new Map();for(const [_0x5cf20d,_0x23695e]of _0x1d070a){const _0x5eee8d=serializeExpandedRule(_0x23695e,_0x1d070a);!_0x2b4cd5[_0x1bbb93(0x1f0)](_0x5eee8d)&&_0x2b4cd5[_0x1bbb93(0x1b2)](_0x5eee8d,_0x5cf20d);}for(const [_0x4e1c14,_0x268561]of _0x314989){const _0x27cabb=_0x2b4cd5[_0x1bbb93(0x200)](_0x268561);_0x27cabb&&(_0x43d199[_0x1bbb93(0x1b2)](_0x4e1c14,_0x27cabb),_0x4c9e6d[_0x1bbb93(0x1af)][_0x1bbb93(0x1b2)](_0x4e1c14,_0x27cabb));}}}}}const _0xcc1019={'resolveSegmentId':async _0x36091b=>{const _0x328d6f=_0x1bbb93,_0x384f88=_0x4c9e6d[_0x328d6f(0x1af)]['get'](_0x36091b);if(!_0x384f88)throw new SDKError(ErrorCode[_0x328d6f(0x24d)],_0x328d6f(0x237)+_0x36091b+_0x328d6f(0x203)+_0x26fd26[_0x328d6f(0x1c9)][_0x328d6f(0x19d)]+')');return _0x384f88;},'resolveEmbeddedSegmentId':async(_0x46fd75,_0x4066f5)=>{const _0x4c0643=_0x1bbb93,_0x49cb6a=_0x4c9e6d[_0x4c0643(0x1af)]['get'](_0x46fd75);if(_0x49cb6a)return _0x49cb6a;const _0x1dbe7f=_0x43d199[_0x4c0643(0x200)](_0x46fd75);if(_0x1dbe7f)return _0x4c9e6d[_0x4c0643(0x1af)][_0x4c0643(0x1b2)](_0x46fd75,_0x1dbe7f),_0x1dbe7f;const _0x5e6d25=_0x4c9e6d[_0x4c0643(0x1db)][_0x4c0643(0x247)](_0x3bc3b8=>_0x3bc3b8[_0x4c0643(0x19d)]===_0x46fd75);if(_0x5e6d25)return _0x4c9e6d[_0x4c0643(0x1af)][_0x4c0643(0x1b2)](_0x46fd75,_0x5e6d25['id']),_0x5e6d25['id'];if(_0x26fd26[_0x4c0643(0x230)]){const {stageName:_0x4c80ba,criteriaName:_0xe90512}=findSegmentCriteriaLocation(_0x26fd26[_0x4c0643(0x1c9)],_0x46fd75);return _0x50e58a(_0x46fd75,_0x4066f5['rule']),_0x5c9ee9[_0x4c0643(0x1b2)](_0x46fd75,{'definition':_0x4066f5,'stageName':_0x4c80ba,'criteriaName':_0xe90512}),createPendingSegmentId(_0x46fd75);}const _0x3d4a24=_0x26fd26[_0x4c0643(0x1e0)]?.['id'];if(!_0x3d4a24)throw new SDKError(ErrorCode[_0x4c0643(0x1bb)],_0x4c0643(0x1f3));_0x50e58a(_0x46fd75,_0x4066f5[_0x4c0643(0x188)]);const _0x417304=generateDeterministicJourneySegmentName(_0x26fd26['yamlConfig'][_0x4c0643(0x19d)],_0x46fd75),_0x5a8dab=_0x4c9e6d[_0x4c0643(0x1db)][_0x4c0643(0x247)](_0x10ba00=>_0x10ba00[_0x4c0643(0x19d)]===_0x417304),_0x31a54d=createSegmentIdResolver(_0x4c9e6d['segmentNameToId'],_0x46fd75),_0x52ef16=await resolveRuleSegmentIds(_0x4066f5['rule'],_0x31a54d);let _0x2148d1;if(_0x5a8dab)await _0x159495[_0x4c0643(0x216)]['updateSegmentById'](_0x2f7887['parentId'],_0x5a8dab['id'],{'description':_0x4066f5[_0x4c0643(0x20d)]||_0x4c0643(0x215)+_0x46fd75,'rule':_0x43b29f(_0x52ef16,!![]),'countPopulation':!![]}),_0x2148d1=_0x5a8dab['id'];else try{_0x2148d1=await _0x159495[_0x4c0643(0x216)][_0x4c0643(0x1a5)]({'name':_0x417304,'description':_0x4066f5[_0x4c0643(0x20d)]||'Entry\x20criteria:\x20'+_0x46fd75,'journeyId':_0x3d4a24,'rule':_0x43b29f(_0x52ef16,!![]),'countPopulation':!![],'parentFolderId':_0x2f7887[_0x4c0643(0x19c)]||'','audienceId':_0x2f7887['parentId']});}catch(_0x33bf83){const _0x39dbdc=_0x33bf83 instanceof Error&&_0x33bf83[_0x4c0643(0x209)][_0x4c0643(0x1cc)](_0x4c0643(0x177));if(_0x39dbdc){const _0xdacda5=await _0x159495[_0x4c0643(0x216)][_0x4c0643(0x1ad)](_0x2f7887[_0x4c0643(0x224)]),_0x312fd4=_0xdacda5['find'](_0x17929d=>_0x17929d[_0x4c0643(0x19d)]===_0x417304);if(_0x312fd4)await _0x159495[_0x4c0643(0x216)][_0x4c0643(0x243)](_0x2f7887[_0x4c0643(0x224)],_0x312fd4['id'],{'description':_0x4066f5[_0x4c0643(0x20d)]||_0x4c0643(0x215)+_0x46fd75,'rule':_0x43b29f(_0x52ef16,!![]),'countPopulation':!![]}),_0x2148d1=_0x312fd4['id'];else throw _0x33bf83;}else throw _0x33bf83;}return _0x4c9e6d[_0x4c0643(0x1af)][_0x4c0643(0x1b2)](_0x46fd75,_0x2148d1),_0x5b5165[_0x4c0643(0x1b2)](_0x46fd75,_0x2148d1),_0x2148d1;},'resolveActivationId':async _0x10fc0d=>{const _0x311c73=_0x1bbb93,_0x435a3a=_0x2c48f7['get'](_0x10fc0d);if(_0x435a3a)return _0x435a3a;if(_0x26fd26[_0x311c73(0x1e0)]){await _0x3a8194();const _0x55987f=_0x2c48f7[_0x311c73(0x200)](_0x10fc0d);if(_0x55987f)return _0x55987f;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x311c73(0x1d0)+_0x10fc0d+_0x311c73(0x203)+_0x26fd26[_0x311c73(0x1c9)]['name']+_0x311c73(0x169)+_0x311c73(0x191));},'resolveEmbeddedActivationId':async(_0x51c5e5,_0x1b7ce4)=>{const _0x183218=_0x1bbb93,_0x4d4154=_0x2c48f7['get'](_0x51c5e5);if(_0x4d4154)return _0x4d4154;if(_0x26fd26[_0x183218(0x230)])return _0x4ddecb[_0x183218(0x1b2)](_0x51c5e5,_0x1b7ce4),createPendingActivationId(_0x51c5e5);if(_0x26fd26[_0x183218(0x1e0)]){await _0x3a8194();const _0xe9d3fc=_0x2c48f7['get'](_0x1b7ce4[_0x183218(0x19d)]);if(_0xe9d3fc)return _0x2c48f7[_0x183218(0x1b2)](_0x51c5e5,_0xe9d3fc),_0xe9d3fc;const _0x47f5ce=activationSignature(_0x1b7ce4),_0x55e211=_0x4f3892?.[_0x183218(0x200)](_0x47f5ce);if(_0x55e211)return _0x2c48f7[_0x183218(0x1b2)](_0x51c5e5,_0x55e211),_0x55e211;const _0xafe7be=await _0x375aac(_0x1b7ce4,_0x4c9e6d[_0x183218(0x229)]),_0x2314b3=await _0x159495[_0x183218(0x16e)][_0x183218(0x173)](_0x26fd26[_0x183218(0x1e0)]['id'],_0xafe7be);return _0x2c48f7['set'](_0x51c5e5,_0x2314b3['id']),_0x2314b3['id'];}throw new SDKError(ErrorCode[_0x183218(0x1bb)],_0x183218(0x1f5));},'resolveJourneyId':async _0x20e3b2=>{const _0x1e20cd=_0x1bbb93;try{return await _0x159495[_0x1e20cd(0x16e)]['resolveJourneyId'](_0x2f7887[_0x1e20cd(0x224)],_0x20e3b2);}catch(_0x5869e7){throw new SDKError(ErrorCode[_0x1e20cd(0x1d1)],_0x1e20cd(0x21e)+_0x20e3b2+_0x1e20cd(0x211)+_0x26fd26[_0x1e20cd(0x1c9)]['name']+'\x27)',_0x5869e7);}},'resolveStageId':async(_0x557f78,_0x7a7b)=>{const _0x49c6e9=_0x1bbb93,_0x1ee7db=await _0x159495['journey'][_0x49c6e9(0x185)](_0x557f78),_0x182407=_0x1ee7db[_0x49c6e9(0x20e)][_0x49c6e9(0x23e)][_0x49c6e9(0x247)](_0x297b89=>_0x297b89[_0x49c6e9(0x19d)][_0x49c6e9(0x1ca)]()===_0x7a7b[_0x49c6e9(0x1ca)]());if(!_0x182407?.['id'])throw new SDKError(ErrorCode[_0x49c6e9(0x1d1)],_0x49c6e9(0x194)+_0x7a7b+_0x49c6e9(0x23a)+(_0x1ee7db[_0x49c6e9(0x20e)][_0x49c6e9(0x186)]||_0x1ee7db['attributes'][_0x49c6e9(0x19d)])+'\x27');return _0x182407['id'];}},_0x5d569f=await _0x3ca21(_0x26fd26[_0x1bbb93(0x1c9)],_0x2f7887[_0x1bbb93(0x224)],_0xcc1019),_0x34a5bf=_0x2f7887[_0x1bbb93(0x255)]||_0x2f7887['rootFolderId'];_0x34a5bf&&(_0x5d569f[_0x1bbb93(0x1a8)]={'parentFolder':{'data':{'id':_0x34a5bf,'type':_0x1bbb93(0x20f)}}});if(_0x26fd26[_0x1bbb93(0x230)]){if(_0x5c9ee9['size']>0x0||_0x4ddecb[_0x1bbb93(0x196)]>0x0)return await executeThreeStepJourneyCreate(_0x159495,_0x26fd26,_0x5d569f,{'pendingEmbeddedSegments':_0x5c9ee9,'pendingEmbeddedActivations':_0x4ddecb,'embeddedSegmentNameToId':_0x5b5165,'journeyActivationNameToId':_0x2c48f7},{..._0x2f7887,'effectiveFolderId':_0x34a5bf},_0x4c9e6d,_0x1b94c0,_0x3c97b0);else{ensureJourneyDefaults(_0x5d569f['attributes']);const _0x4cfbc4=await _0x159495[_0x1bbb93(0x16e)][_0x1bbb93(0x238)](_0x5d569f);return{'action':_0x1bbb93(0x1bf),'journeyId':_0x4cfbc4['id'],'embeddedSegmentNameToId':_0x5b5165};}}else{if(_0x26fd26['hasChanges']&&_0x26fd26[_0x1bbb93(0x1e0)])return ensureJourneyDefaults(_0x5d569f[_0x1bbb93(0x20e)]),await _0x159495['journey'][_0x1bbb93(0x232)](_0x26fd26[_0x1bbb93(0x1e0)]['id'],_0x5d569f),{'action':_0x1bbb93(0x242),'journeyId':_0x26fd26[_0x1bbb93(0x1e0)]['id'],'embeddedSegmentNameToId':_0x5b5165};}return{'action':'unchanged','journeyId':_0x26fd26['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x5b5165};}function findSegmentCriteriaLocation(_0x58f1f6,_0x39c3f6){const _0x4d5e38=a100_0xbb0e10,_0x341130=_0x58f1f6[_0x4d5e38(0x1e8)]||_0x58f1f6[_0x4d5e38(0x1b8)]?.[0x0]?.[_0x4d5e38(0x1e8)]||[];let _0x39744f=_0x4d5e38(0x1d3),_0xffb879=_0x39c3f6;const _0x471a16=_0x58f1f6['goal']||_0x58f1f6[_0x4d5e38(0x1b8)]?.[0x0]?.['goal'];if(_0x471a16?.[_0x4d5e38(0x216)]===_0x39c3f6)return{'stageName':'goal','criteriaName':_0x471a16[_0x4d5e38(0x19d)]||_0x39c3f6};_0x159f42:for(const _0x33c3c3 of _0x341130){if(_0x33c3c3[_0x4d5e38(0x16f)]?.[_0x4d5e38(0x216)]===_0x39c3f6){_0x39744f=_0x33c3c3[_0x4d5e38(0x19d)],_0xffb879=_0x33c3c3[_0x4d5e38(0x16f)][_0x4d5e38(0x19d)]||_0x39c3f6;break;}if(_0x33c3c3['steps'])for(const _0x3ee189 of _0x33c3c3[_0x4d5e38(0x205)]){if(_0x3ee189[_0x4d5e38(0x1f1)]==='decision_point'&&_0x3ee189['with']?.[_0x4d5e38(0x24c)])for(const _0x2b202e of _0x3ee189[_0x4d5e38(0x1f2)][_0x4d5e38(0x24c)]){if(_0x2b202e['segment']===_0x39c3f6){_0x39744f=_0x33c3c3[_0x4d5e38(0x19d)],_0xffb879=_0x2b202e[_0x4d5e38(0x19d)]||_0x39c3f6;break _0x159f42;}}}}return{'stageName':_0x39744f,'criteriaName':_0xffb879};}async function executeThreeStepJourneyCreate(_0xeaaf93,_0xe71062,_0x30ff94,_0x1246e2,_0x22ac16,_0x1a5564,_0x5445f0,_0xadd817){const _0x148c99=a100_0xbb0e10,{activationDefToCreateRequest:_0x54a5eb,yamlRuleToApi:_0x45bc5f}=_0xadd817,{pendingEmbeddedSegments:_0x1e1f4b,pendingEmbeddedActivations:_0x45b23b,embeddedSegmentNameToId:_0x2d7b73}=_0x1246e2,_0x17ae7e=JSON[_0x148c99(0x1a9)](JSON[_0x148c99(0x189)](_0x30ff94));ensureJourneyDefaults(_0x17ae7e['attributes']),stripPendingIds(_0x17ae7e);const _0x1fb74c=await _0xeaaf93[_0x148c99(0x16e)]['create'](_0x17ae7e),_0x1f9abc=_0x1fb74c['id'],_0x43484e=new Map();for(const _0x214e4b of _0x1fb74c[_0x148c99(0x20e)][_0x148c99(0x23e)]){_0x43484e['set'](_0x214e4b[_0x148c99(0x19d)]['toLowerCase'](),_0x214e4b['id']);}for(const [_0x37ce75,{definition:_0x1f4217}]of _0x1e1f4b){const _0x17bcca=generateDeterministicJourneySegmentName(_0xe71062[_0x148c99(0x1c9)][_0x148c99(0x19d)],_0x37ce75);_0x5445f0[_0x148c99(0x233)]?.({'type':_0x148c99(0x20a),'journeyName':_0xe71062[_0x148c99(0x1c9)][_0x148c99(0x19d)],'segmentName':_0x37ce75});const _0xcfc7b3=createSegmentIdResolver(_0x1a5564[_0x148c99(0x1af)],_0x37ce75),_0x27cfb5=await resolveRuleSegmentIds(_0x1f4217[_0x148c99(0x188)],_0xcfc7b3),_0x17e798=await _0xeaaf93['segment'][_0x148c99(0x1a5)]({'name':_0x17bcca,'description':_0x1f4217[_0x148c99(0x20d)]||_0x148c99(0x215)+_0x37ce75,'journeyId':_0x1f9abc,'rule':_0x45bc5f(_0x27cfb5,!![]),'countPopulation':!![],'parentFolderId':_0x22ac16[_0x148c99(0x245)]||'','audienceId':_0x22ac16[_0x148c99(0x224)]});_0x2d7b73[_0x148c99(0x1b2)](_0x37ce75,_0x17e798),_0x1a5564[_0x148c99(0x1af)][_0x148c99(0x1b2)](_0x37ce75,_0x17e798),_0x5445f0['onProgress']?.({'type':_0x148c99(0x221),'journeyName':_0xe71062[_0x148c99(0x1c9)][_0x148c99(0x19d)],'segmentName':_0x37ce75});}const _0x2cea2a=new Map();for(const [_0x1dd813,_0x5e1de0]of _0x45b23b){_0x5445f0[_0x148c99(0x233)]?.({'type':'embedded_activation_creating','journeyName':_0xe71062['yamlConfig'][_0x148c99(0x19d)],'activationName':_0x1dd813});const _0x33fbcc=await _0x54a5eb(_0x5e1de0,_0x1a5564[_0x148c99(0x229)]),_0xbe8693=await _0xeaaf93[_0x148c99(0x16e)][_0x148c99(0x173)](_0x1f9abc,_0x33fbcc);_0x2cea2a['set'](_0x1dd813,_0xbe8693['id']),_0x1246e2[_0x148c99(0x16b)][_0x148c99(0x1b2)](_0x1dd813,_0xbe8693['id']),_0x5445f0['onProgress']?.({'type':'embedded_activation_created','journeyName':_0xe71062[_0x148c99(0x1c9)][_0x148c99(0x19d)],'activationName':_0x1dd813});}const _0x3e6def=JSON[_0x148c99(0x1a9)](JSON['stringify'](_0x30ff94));return _0x3e6def['id']=_0x1f9abc,ensureJourneyDefaults(_0x3e6def[_0x148c99(0x20e)]),resolvePendingIdsInRequest(_0x3e6def,_0x30ff94,_0x43484e,_0x2d7b73,_0x2cea2a,_0x5445f0),await _0xeaaf93[_0x148c99(0x16e)][_0x148c99(0x232)](_0x1f9abc,_0x3e6def),{'action':_0x148c99(0x1bf),'journeyId':_0x1f9abc,'embeddedSegmentNameToId':_0x2d7b73};}function stripPendingIds(_0x29b4ba){const _0x1180b5=a100_0xbb0e10;for(const _0x302545 of _0x29b4ba[_0x1180b5(0x20e)]['journeyStages']||[]){_0x302545[_0x1180b5(0x1ef)]?.[_0x1180b5(0x1cf)]&&isPendingSegmentId(_0x302545[_0x1180b5(0x1ef)][_0x1180b5(0x1cf)])&&delete _0x302545[_0x1180b5(0x1ef)];if(_0x302545[_0x1180b5(0x205)])for(const _0x529bde of Object['keys'](_0x302545[_0x1180b5(0x205)])){const _0x5a61cd=_0x302545[_0x1180b5(0x205)][_0x529bde];_0x5a61cd[_0x1180b5(0x1f1)]===_0x1180b5(0x1fa)&&_0x5a61cd[_0x1180b5(0x16a)]&&isPendingActivationId(_0x5a61cd[_0x1180b5(0x16a)])&&(_0x5a61cd['journeyActivationStepId']='');if(_0x5a61cd[_0x1180b5(0x1f1)]===_0x1180b5(0x1d9)&&_0x5a61cd['branches'])for(const _0x2f0a0c of _0x5a61cd['branches']){_0x2f0a0c[_0x1180b5(0x1cf)]&&isPendingSegmentId(_0x2f0a0c['segmentId'])&&(_0x2f0a0c['segmentId']='');}_0x5a61cd[_0x1180b5(0x1f1)]===_0x1180b5(0x22e)&&_0x5a61cd[_0x1180b5(0x1e2)]?.[_0x1180b5(0x1cf)]&&isPendingSegmentId(_0x5a61cd[_0x1180b5(0x1e2)][_0x1180b5(0x1cf)])&&(_0x5a61cd[_0x1180b5(0x1e2)][_0x1180b5(0x1cf)]='');}}}function resolvePendingIdsInRequest(_0x49020d,_0x3fee90,_0x48eb1c,_0x3cbe3e,_0x7b3973,_0x215b9c){const _0x2828a1=a100_0xbb0e10,_0x38510b=(_0x5ea9da,_0x312d5e)=>{const _0xa5e01e=a100_0x5743;if(!isPendingSegmentId(_0x5ea9da))return _0x5ea9da;const _0x371a7c=extractPendingSegmentName(_0x5ea9da),_0x3658d3=_0x3cbe3e[_0xa5e01e(0x200)](_0x371a7c);return!_0x3658d3&&_0x215b9c[_0xa5e01e(0x24e)]?.(_0xa5e01e(0x17b)+_0x371a7c+'\x27\x20for\x20'+_0x312d5e),_0x3658d3;};if(_0x49020d[_0x2828a1(0x20e)][_0x2828a1(0x178)]?.[_0x2828a1(0x1cf)]&&isPendingSegmentId(_0x49020d[_0x2828a1(0x20e)]['goal'][_0x2828a1(0x1cf)])){const _0x1b88e0=_0x38510b(_0x49020d[_0x2828a1(0x20e)]['goal'][_0x2828a1(0x1cf)],_0x2828a1(0x1c1));_0x1b88e0&&(_0x49020d[_0x2828a1(0x20e)][_0x2828a1(0x178)][_0x2828a1(0x1cf)]=_0x1b88e0);}for(const _0x3e49a3 of _0x49020d[_0x2828a1(0x20e)][_0x2828a1(0x23e)]||[]){const _0x4084a2=_0x48eb1c[_0x2828a1(0x200)](_0x3e49a3[_0x2828a1(0x19d)][_0x2828a1(0x1ca)]());_0x4084a2&&(_0x3e49a3['id']=_0x4084a2);if(_0x3e49a3[_0x2828a1(0x1ef)]?.[_0x2828a1(0x1cf)]&&isPendingSegmentId(_0x3e49a3[_0x2828a1(0x1ef)]['segmentId'])){const _0x432001=_0x38510b(_0x3e49a3['entryCriteria']['segmentId'],'stage\x20\x27'+_0x3e49a3[_0x2828a1(0x19d)]+_0x2828a1(0x18c));_0x432001&&(_0x3e49a3[_0x2828a1(0x1ef)][_0x2828a1(0x1cf)]=_0x432001);}if(_0x3e49a3[_0x2828a1(0x181)])for(const _0x4fca5b of _0x3e49a3[_0x2828a1(0x181)]){if(_0x4fca5b['segmentId']&&isPendingSegmentId(_0x4fca5b[_0x2828a1(0x1cf)])){const _0x4ffb56=_0x38510b(_0x4fca5b[_0x2828a1(0x1cf)],'stage\x20\x27'+_0x3e49a3[_0x2828a1(0x19d)]+'\x27\x20exit\x20criteria');_0x4ffb56&&(_0x4fca5b['segmentId']=_0x4ffb56);}}if(_0x3e49a3['milestone']?.[_0x2828a1(0x1cf)]&&isPendingSegmentId(_0x3e49a3[_0x2828a1(0x201)][_0x2828a1(0x1cf)])){const _0x561003=_0x38510b(_0x3e49a3[_0x2828a1(0x201)][_0x2828a1(0x1cf)],_0x2828a1(0x1d2)+_0x3e49a3[_0x2828a1(0x19d)]+_0x2828a1(0x193));_0x561003&&(_0x3e49a3[_0x2828a1(0x201)]['segmentId']=_0x561003);}if(_0x3e49a3['steps']){const _0x132ba7=_0x212ef4=>_0x3fee90[_0x2828a1(0x20e)][_0x2828a1(0x23e)]['find'](_0x521faa=>_0x521faa[_0x2828a1(0x19d)][_0x2828a1(0x1ca)]()===_0x3e49a3[_0x2828a1(0x19d)][_0x2828a1(0x1ca)]())?.[_0x2828a1(0x205)]?.[_0x212ef4];for(const _0x2e2b87 of Object[_0x2828a1(0x1b0)](_0x3e49a3[_0x2828a1(0x205)])){const _0x8d83f5=_0x3e49a3['steps'][_0x2e2b87],_0x40df21=_0x132ba7(_0x2e2b87);if(_0x8d83f5[_0x2828a1(0x1f1)]==='Activation'&&_0x8d83f5['journeyActivationStepId']&&(isPendingActivationId(_0x8d83f5[_0x2828a1(0x16a)])||_0x8d83f5['journeyActivationStepId']==='')){if(_0x40df21?.[_0x2828a1(0x16a)]&&isPendingActivationId(_0x40df21[_0x2828a1(0x16a)])){const _0x5116bb=extractPendingActivationName(_0x40df21[_0x2828a1(0x16a)]),_0x307adb=_0x7b3973['get'](_0x5116bb);_0x307adb&&(_0x8d83f5['journeyActivationStepId']=_0x307adb);}}if(_0x8d83f5['type']===_0x2828a1(0x1d9)&&_0x8d83f5[_0x2828a1(0x24c)]&&_0x40df21?.[_0x2828a1(0x24c)])for(let _0x35f869=0x0;_0x35f869<_0x8d83f5['branches'][_0x2828a1(0x1c2)];_0x35f869++){const _0x544250=_0x8d83f5[_0x2828a1(0x24c)][_0x35f869],_0x6cf871=_0x40df21[_0x2828a1(0x24c)][_0x35f869];if(_0x6cf871?.[_0x2828a1(0x1cf)]&&isPendingSegmentId(_0x6cf871['segmentId'])){const _0x3a8aa5=_0x38510b(_0x6cf871[_0x2828a1(0x1cf)],'stage\x20\x27'+_0x3e49a3[_0x2828a1(0x19d)]+_0x2828a1(0x1e7)+(_0x544250[_0x2828a1(0x19d)]||_0x35f869)+'\x27');_0x3a8aa5&&(_0x544250['segmentId']=_0x3a8aa5);}}if(_0x8d83f5['type']==='WaitStep'&&_0x8d83f5[_0x2828a1(0x1e2)]?.[_0x2828a1(0x1cf)]&&_0x40df21?.[_0x2828a1(0x1e2)]?.[_0x2828a1(0x1cf)]&&isPendingSegmentId(_0x40df21[_0x2828a1(0x1e2)]['segmentId'])){const _0x18074b=_0x38510b(_0x40df21['waitCondition'][_0x2828a1(0x1cf)],_0x2828a1(0x1d2)+_0x3e49a3[_0x2828a1(0x19d)]+_0x2828a1(0x199));_0x18074b&&(_0x8d83f5[_0x2828a1(0x1e2)][_0x2828a1(0x1cf)]=_0x18074b);}}}}}function a100_0x4634(){const _0x2179ba=['JOURNEY_SYNTAX_ERROR','object','Deleting\x20activation\x20\x27','4991055DfiVIf','Activation','flatMap','notification','Created\x20activation\x20\x27','6325120nAFhOp','deps','get','milestone','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','\x20(referenced\x20in\x20journey\x20','journey_creating','steps','map','data','Updated\x20journey\x20\x27','message','embedded_segment_creating','existingSegment','diff','description','attributes','folder','valid','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Created\x20segment\x20\x27','./child-segment-yaml.js','entries','Entry\x20criteria:\x20','segment','delete','nameToId','activationsBySegmentId','item','getSegment','validatedRequest','startsWith','Journey\x20\x27','hasChanges','resolveSegment','embedded_segment_created','journeyId','folder_creating','parentId','relative','Updating\x20activation\x20\x27','segmentByFolderAndName','progress','activationContext','journey_updating','idToEmailMap','idToName','\x20activation\x20\x27','WaitStep','\x27\x20from\x20file:\x20','isNew','createFolder','update','onProgress','journeyBundlesByFolderAndName','utf-8','Failed\x20to\x20','Segment\x20not\x20found:\x20','create','activation_updated','\x27\x20not\x20found\x20in\x20journey\x20\x27','verbose','4578304ULJdiH','ACTIVATION_UPDATE_ERROR','journeyStages','schedule','activation_created','behavior','updated','updateSegmentById','Creating\x20segment\x20\x27','effectiveFolderId','739239zRftLi','find','Created\x20journey\x20\x27','4mnbvwY','all_columns','activation_deleted','branches','SEGMENT_NOT_FOUND','logWarning','deleted','__pending_','deleteActivation','activation_creating','existingActivation','fetchJourney','folderId','\x20error(s)','segment_deleted','max',').\x20','journeyActivationStepId','journeyActivationNameToId','buildUserMaps','segment_updated','journey','entry_criteria','connector_config','logSuccess','withProgress','createActivation','activation_template_id','\x0a\x20\x20','Updated\x20segment\x20\x27','Name\x20has\x20already\x20been\x20taken','goal','connectionIdToNameMap','segment_created','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','activation_deleting','journey_updated','journey_created','createSegment','filter','exitCriterias','createdSegmentId','segments','createdSegmentIds','getJourney','journeyBundleName','add','rule','stringify','Updated\x20activation\x20\x27','isArray','\x27\x20entry\x20criteria','localSegmentRules','folder_created','sort','updateActivation','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','all','\x27\x20milestone','Stage\x20\x27','getActivation','size','user','null','\x27\x20wait\x20condition','../../utils/async.js','journeyById','rootFolderId','name','skipSegments','parseDocument','index','slice','activations','parentFolder','__pending_act_','createJourneySegment','activationStepsById','replace','relationships','parse','state','logDeleted','):\x20','listSegments','kind','segmentNameToId','keys','Creating\x20folder\x20\x27','set','folderPath','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Fetching\x20','absolutePath','SEGMENT_SYNTAX_ERROR','journeys','push','action','INTERNAL','list','errors','from','created','Creating\x20activation\x20\x27','goal\x20criteria','length','171066NIHxMy','nameToType','hex','sha1','./journey-yaml.js','join','yamlConfig','toLowerCase','Deleted\x20segment\x20\x27','includes','670002nzwjAd','connection','segmentId','Activation\x20not\x20found:\x20','NOT_FOUND','stage\x20\x27','entry','\x27...','segmentFolderId','split','segment_updating','yamlActivation','DecisionPoint','activationParams','existingSegments','toString','42trAZVQ','values','folderPathToId','existingJourney','versionNumber','waitCondition','journey_entry_criteria_','JOURNEY_UPDATE_ERROR','embeddedSegmentNameToId','draft','\x27\x20decision\x20point\x20branch\x20\x27','stages','\x20segment\x20from\x20file:\x20','activation_','listActivations','44856iCAieN','activation_updating','columns','entryCriteria','has','type','with','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','SEGMENT_UPDATE_ERROR','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context'];a100_0x4634=function(){return _0x2179ba;};return a100_0x4634();}
@@ -1 +1 @@
1
- (function(_0x17fdfd,_0x55b7eb){const _0x6104a5=a101_0x4a4d,_0x31c32f=_0x17fdfd();while(!![]){try{const _0xa8ce8=parseInt(_0x6104a5(0xa5))/0x1+-parseInt(_0x6104a5(0x99))/0x2*(-parseInt(_0x6104a5(0xa3))/0x3)+parseInt(_0x6104a5(0xa6))/0x4+-parseInt(_0x6104a5(0x9e))/0x5+-parseInt(_0x6104a5(0x9d))/0x6+-parseInt(_0x6104a5(0x9a))/0x7+-parseInt(_0x6104a5(0xa1))/0x8*(-parseInt(_0x6104a5(0xa4))/0x9);if(_0xa8ce8===_0x55b7eb)break;else _0x31c32f['push'](_0x31c32f['shift']());}catch(_0x267a9e){_0x31c32f['push'](_0x31c32f['shift']());}}}(a101_0x307b,0xca6a4));function a101_0x307b(){const _0x2ea3b2=['910556vfuaZR','4865496UnEXlI','parentFolderId','24974jpImgY','4955027unHVww','set','has','7917588ftoZoM','2033850kxrZXO','get','add','3996432fjcUMe','name','153xucXoc','9LviQfZ'];a101_0x307b=function(){return _0x2ea3b2;};return a101_0x307b();}export function buildFolderIdToPathMap(_0x256850){const _0x5c18c9=a101_0x4a4d,_0x4a37c4=new Map(),_0x1033c4=new Map();for(const _0xde9d76 of _0x256850){_0x1033c4[_0x5c18c9(0x9b)](_0xde9d76['id'],_0xde9d76);}const _0x2e66b7=new Set();for(const _0x14d583 of _0x256850){!_0x14d583[_0x5c18c9(0x98)]&&_0x2e66b7[_0x5c18c9(0xa0)](_0x14d583['id']);}function _0x45e08f(_0x18a03f){const _0x2c5655=_0x5c18c9;if(_0x4a37c4['has'](_0x18a03f['id']))return _0x4a37c4['get'](_0x18a03f['id']);if(_0x2e66b7[_0x2c5655(0x9c)](_0x18a03f['id']))return _0x4a37c4[_0x2c5655(0x9b)](_0x18a03f['id'],''),'';if(_0x18a03f[_0x2c5655(0x98)]){const _0x42c98b=_0x1033c4[_0x2c5655(0x9f)](_0x18a03f['parentFolderId']);if(_0x42c98b){const _0x55b72a=_0x45e08f(_0x42c98b),_0xd075a1=_0x55b72a?_0x55b72a+'/'+_0x18a03f[_0x2c5655(0xa2)]:_0x18a03f[_0x2c5655(0xa2)];return _0x4a37c4[_0x2c5655(0x9b)](_0x18a03f['id'],_0xd075a1),_0xd075a1;}}const _0x5823f8=_0x18a03f[_0x2c5655(0xa2)];return _0x4a37c4[_0x2c5655(0x9b)](_0x18a03f['id'],_0x5823f8),_0x5823f8;}for(const _0x443830 of _0x256850){_0x45e08f(_0x443830);}return _0x4a37c4;}function a101_0x4a4d(_0xd32013,_0x28bab4){_0xd32013=_0xd32013-0x98;const _0x307bb9=a101_0x307b();let _0x4a4d0e=_0x307bb9[_0xd32013];return _0x4a4d0e;}export function buildFolderPathToIdMap(_0x95f2be){const _0x24afdc=a101_0x4a4d,_0x3c0a51=new Map(),_0x183a0d=new Map();for(const _0x581d0d of _0x95f2be){_0x183a0d['set'](_0x581d0d['id'],_0x581d0d);}const _0x2a3ff8=new Set();for(const _0x80d749 of _0x95f2be){!_0x80d749[_0x24afdc(0x98)]&&_0x2a3ff8[_0x24afdc(0xa0)](_0x80d749['id']);}function _0x5ed6c6(_0xa7cf44){const _0x35c96f=_0x24afdc;if(_0x2a3ff8['has'](_0xa7cf44['id']))return'';if(_0xa7cf44[_0x35c96f(0x98)]){const _0x18f88e=_0x183a0d[_0x35c96f(0x9f)](_0xa7cf44[_0x35c96f(0x98)]);if(_0x18f88e){const _0x3dec75=_0x5ed6c6(_0x18f88e);return _0x3dec75?_0x3dec75+'/'+_0xa7cf44[_0x35c96f(0xa2)]:_0xa7cf44[_0x35c96f(0xa2)];}}return _0xa7cf44[_0x35c96f(0xa2)];}for(const _0x2bd5e3 of _0x95f2be){const _0x30f6b6=_0x5ed6c6(_0x2bd5e3);_0x3c0a51[_0x24afdc(0x9b)](_0x30f6b6,_0x2bd5e3['id']);}return _0x3c0a51;}export function buildFolderMaps(_0x1de4be){const _0x12cacd=a101_0x4a4d,_0x224e45=buildFolderIdToPathMap(_0x1de4be),_0x2b3c67=new Map();for(const [_0x12d4c5,_0x4d6f04]of _0x224e45){_0x2b3c67[_0x12cacd(0x9b)](_0x4d6f04,_0x12d4c5);}return{'idToPath':_0x224e45,'pathToId':_0x2b3c67};}export function getFolderPath(_0x10ec00,_0x453bd1){if(!_0x10ec00)return'';return _0x453bd1['get'](_0x10ec00)??'';}
1
+ (function(_0x122e41,_0x331c77){const _0x514b0e=a101_0x5274,_0xdb78bf=_0x122e41();while(!![]){try{const _0x254276=-parseInt(_0x514b0e(0x1cd))/0x1*(parseInt(_0x514b0e(0x1c8))/0x2)+-parseInt(_0x514b0e(0x1d6))/0x3*(parseInt(_0x514b0e(0x1d4))/0x4)+parseInt(_0x514b0e(0x1ca))/0x5*(parseInt(_0x514b0e(0x1d3))/0x6)+parseInt(_0x514b0e(0x1d0))/0x7*(parseInt(_0x514b0e(0x1cb))/0x8)+-parseInt(_0x514b0e(0x1d1))/0x9+parseInt(_0x514b0e(0x1c5))/0xa+-parseInt(_0x514b0e(0x1d5))/0xb*(-parseInt(_0x514b0e(0x1c7))/0xc);if(_0x254276===_0x331c77)break;else _0xdb78bf['push'](_0xdb78bf['shift']());}catch(_0x36659c){_0xdb78bf['push'](_0xdb78bf['shift']());}}}(a101_0x3abf,0x6d2b1));export function buildFolderIdToPathMap(_0x3e250f){const _0x46ddd2=a101_0x5274,_0x44b492=new Map(),_0xdc1931=new Map();for(const _0x421785 of _0x3e250f){_0xdc1931[_0x46ddd2(0x1d2)](_0x421785['id'],_0x421785);}const _0x16933f=new Set();for(const _0x5045f3 of _0x3e250f){!_0x5045f3['parentFolderId']&&_0x16933f[_0x46ddd2(0x1cc)](_0x5045f3['id']);}function _0x506022(_0x5e65b6){const _0x511474=_0x46ddd2;if(_0x44b492[_0x511474(0x1cf)](_0x5e65b6['id']))return _0x44b492[_0x511474(0x1c6)](_0x5e65b6['id']);if(_0x16933f[_0x511474(0x1cf)](_0x5e65b6['id']))return _0x44b492[_0x511474(0x1d2)](_0x5e65b6['id'],''),'';if(_0x5e65b6[_0x511474(0x1ce)]){const _0x27389f=_0xdc1931[_0x511474(0x1c6)](_0x5e65b6['parentFolderId']);if(_0x27389f){const _0x28aaba=_0x506022(_0x27389f),_0x25db5e=_0x28aaba?_0x28aaba+'/'+_0x5e65b6[_0x511474(0x1c9)]:_0x5e65b6[_0x511474(0x1c9)];return _0x44b492[_0x511474(0x1d2)](_0x5e65b6['id'],_0x25db5e),_0x25db5e;}}const _0xb6a8f=_0x5e65b6['name'];return _0x44b492['set'](_0x5e65b6['id'],_0xb6a8f),_0xb6a8f;}for(const _0x43b117 of _0x3e250f){_0x506022(_0x43b117);}return _0x44b492;}export function buildFolderPathToIdMap(_0xd50ae5){const _0x27ae82=a101_0x5274,_0x2e764d=new Map(),_0x564d00=new Map();for(const _0x1c6263 of _0xd50ae5){_0x564d00[_0x27ae82(0x1d2)](_0x1c6263['id'],_0x1c6263);}const _0x193004=new Set();for(const _0x5c167d of _0xd50ae5){!_0x5c167d['parentFolderId']&&_0x193004['add'](_0x5c167d['id']);}function _0x57013c(_0x3ce4d4){const _0x5a14a4=_0x27ae82;if(_0x193004[_0x5a14a4(0x1cf)](_0x3ce4d4['id']))return'';if(_0x3ce4d4['parentFolderId']){const _0x4e56dd=_0x564d00[_0x5a14a4(0x1c6)](_0x3ce4d4[_0x5a14a4(0x1ce)]);if(_0x4e56dd){const _0x23c2d6=_0x57013c(_0x4e56dd);return _0x23c2d6?_0x23c2d6+'/'+_0x3ce4d4[_0x5a14a4(0x1c9)]:_0x3ce4d4[_0x5a14a4(0x1c9)];}}return _0x3ce4d4['name'];}for(const _0x421070 of _0xd50ae5){const _0x4b2daf=_0x57013c(_0x421070);_0x2e764d['set'](_0x4b2daf,_0x421070['id']);}return _0x2e764d;}export function buildFolderMaps(_0x4caee7){const _0x1074b3=a101_0x5274,_0x14b796=buildFolderIdToPathMap(_0x4caee7),_0x5e9aae=new Map();for(const [_0x195ff8,_0x781ed5]of _0x14b796){_0x5e9aae[_0x1074b3(0x1d2)](_0x781ed5,_0x195ff8);}return{'idToPath':_0x14b796,'pathToId':_0x5e9aae};}function a101_0x5274(_0x4a1f28,_0xe29bf8){_0x4a1f28=_0x4a1f28-0x1c5;const _0x3abf24=a101_0x3abf();let _0x527495=_0x3abf24[_0x4a1f28];return _0x527495;}function a101_0x3abf(){const _0x1d16fa=['set','1815666gIUnHh','4IPUTEV','33220ygFYxe','737643ZIVHsn','2623440UZIWuW','get','2820MAyTRV','1366urFRnq','name','5GjWBvm','2504pgLFLh','add','229ChSQVD','parentFolderId','has','7616XZjmAR','6891822VhyGir'];a101_0x3abf=function(){return _0x1d16fa;};return a101_0x3abf();}export function getFolderPath(_0xbcad14,_0xbf74){const _0x4d9718=a101_0x5274;if(!_0xbcad14)return'';return _0xbf74[_0x4d9718(0x1c6)](_0xbcad14)??'';}
@@ -1 +1 @@
1
- (function(_0x8ea438,_0x415762){const _0x1b35d6=a102_0x16b8,_0x1dcd9c=_0x8ea438();while(!![]){try{const _0x2aef0e=parseInt(_0x1b35d6(0x196))/0x1*(parseInt(_0x1b35d6(0x1ac))/0x2)+-parseInt(_0x1b35d6(0x1b0))/0x3+-parseInt(_0x1b35d6(0x19d))/0x4+-parseInt(_0x1b35d6(0x1a9))/0x5*(parseInt(_0x1b35d6(0x197))/0x6)+parseInt(_0x1b35d6(0x1aa))/0x7*(-parseInt(_0x1b35d6(0x1a7))/0x8)+parseInt(_0x1b35d6(0x1b4))/0x9+parseInt(_0x1b35d6(0x193))/0xa*(parseInt(_0x1b35d6(0x1bf))/0xb);if(_0x2aef0e===_0x415762)break;else _0x1dcd9c['push'](_0x1dcd9c['shift']());}catch(_0x3ccf1d){_0x1dcd9c['push'](_0x1dcd9c['shift']());}}}(a102_0x569f,0x71f8e));import a102_0x2cf6d2 from'path';import{parse as a102_0x33ad7e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x706630){const _0x49c209=a102_0x16b8;if(!_0x706630||_0x706630[_0x49c209(0x1b1)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x539ff4=_0x706630['trim']();if(_0x539ff4==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x706630};const _0x41bdfe=_0x539ff4['startsWith']('/')?_0x539ff4[_0x49c209(0x194)](0x1):_0x539ff4,_0x4deb63=_0x41bdfe[_0x49c209(0x1b3)]('/')[_0x49c209(0x1b2)](_0x3aacde=>_0x3aacde!=='');if(_0x4deb63[_0x49c209(0x1b7)]===0x0)throw new Error(_0x49c209(0x199));const _0x326f6d=_0x539ff4['startsWith']('/')||!isRelativePathSegment(_0x4deb63[0x0]);for(const _0x4bbf36 of _0x4deb63){validatePathSegment(_0x4bbf36);}return{'segments':_0x4deb63,'isAbsolute':_0x326f6d,'raw':_0x706630};}function isRelativePathSegment(_0x152926){return _0x152926==='.'||_0x152926==='..';}function validatePathSegment(_0x4831e9){const _0xfa6ec2=a102_0x16b8;if(_0x4831e9==='')throw new Error(_0xfa6ec2(0x1ba));if(_0x4831e9==='.'||_0x4831e9==='..')return;if(/[\x00-\x1F\x7F]/[_0xfa6ec2(0x19f)](_0x4831e9))throw new Error(_0xfa6ec2(0x195)+_0x4831e9);if(_0x4831e9!==_0x4831e9[_0xfa6ec2(0x1b1)]()){}}export function validatePath(_0x56d513){const _0x5ecc92=a102_0x16b8;if(_0x56d513[_0x5ecc92(0x1b6)]['length']===0x0&&!_0x56d513['isAbsolute'])throw new Error(_0x5ecc92(0x19c));if(_0x56d513['isAbsolute']){if(_0x56d513['segments'][0x0]==='..')throw new Error(_0x5ecc92(0x1a5));let _0x4474cb=0x0;for(const _0x4af7f8 of _0x56d513[_0x5ecc92(0x1b6)]){if(_0x4af7f8==='..'){if(_0x4474cb===0x0)throw new Error(_0x5ecc92(0x1ab));_0x4474cb--;}else _0x4af7f8!=='.'&&_0x4474cb++;}}}export function joinPaths(_0xc386eb,_0x3787a2){const _0x2f2b27=a102_0x16b8;if(!_0xc386eb||_0xc386eb==='/')return _0x3787a2;if(!_0x3787a2||_0x3787a2==='.')return _0xc386eb;if(_0x3787a2[_0x2f2b27(0x1bb)]('/'))return _0x3787a2;const _0x478b15=parsePath(_0xc386eb),_0x5afc61=parsePath(_0x3787a2),_0x544e12=[..._0x478b15[_0x2f2b27(0x1b6)]];for(const _0x1de7cb of _0x5afc61[_0x2f2b27(0x1b6)]){if(_0x1de7cb==='.')continue;else{if(_0x1de7cb==='..'){if(_0x544e12[_0x2f2b27(0x1b7)]===0x0)throw new Error(_0x2f2b27(0x1ae));_0x544e12[_0x2f2b27(0x1bc)]();}else _0x544e12['push'](_0x1de7cb);}}const _0x45fbfd=_0x544e12[_0x2f2b27(0x1b8)]('/');return _0x478b15[_0x2f2b27(0x1c2)]['startsWith']('/')?'/'+_0x45fbfd:_0x45fbfd;}export function normalizePath(_0x16c4ea){const _0x1aa507=a102_0x16b8,_0x313cd1=parsePath(_0x16c4ea),_0x4c1086=[];for(const _0x53db95 of _0x313cd1[_0x1aa507(0x1b6)]){if(_0x53db95==='.')continue;else{if(_0x53db95==='..'){if(_0x4c1086[_0x1aa507(0x1b7)]===0x0){if(_0x313cd1[_0x1aa507(0x1a6)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x4c1086[_0x1aa507(0x1a1)]('..');}else _0x4c1086[_0x4c1086['length']-0x1]==='..'?_0x4c1086['push']('..'):_0x4c1086['pop']();}else _0x4c1086[_0x1aa507(0x1a1)](_0x53db95);}}if(_0x4c1086[_0x1aa507(0x1b7)]===0x0)return _0x313cd1[_0x1aa507(0x1a6)]?'/':'.';const _0x48b7a1=_0x4c1086[_0x1aa507(0x1b8)]('/');return _0x313cd1[_0x1aa507(0x1c2)][_0x1aa507(0x1bb)]('/')?'/'+_0x48b7a1:_0x48b7a1;}export function getParentPath(_0x341466){const _0x237808=a102_0x16b8,_0x244808=parsePath(_0x341466);if(_0x244808[_0x237808(0x1b6)][_0x237808(0x1b7)]<=0x1)return'/';const _0x1d2232=_0x244808[_0x237808(0x1b6)][_0x237808(0x1af)](0x0,-0x1)['join']('/');return _0x244808[_0x237808(0x1c2)][_0x237808(0x1bb)]('/')?'/'+_0x1d2232:_0x1d2232;}export function getBaseName(_0x2e9740){const _0x240a7a=a102_0x16b8,_0x23c7bb=parsePath(_0x2e9740);return _0x23c7bb[_0x240a7a(0x1b6)][_0x23c7bb['segments'][_0x240a7a(0x1b7)]-0x1]||'';}function a102_0x569f(){const _0x38ac78=['endsWith','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','raw','.yml','20auHvOl','substring','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','603854ZpqgiS','36XZLEGh','segment','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','resolve','relative','Relative\x20path\x20cannot\x20be\x20empty','1542368lkfwex','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','test','root','push','Cannot\x20split\x20empty\x20path','exists','parent_segment','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','isAbsolute','66024DVlnaE','parse','499265UrWMUv','203MFausi','Path\x20attempts\x20to\x20navigate\x20above\x20root','2JiBWmf','name','Cannot\x20navigate\x20above\x20root','slice','151227yXoIEE','trim','filter','split','1335834RSlEWl','dirname','segments','length','join','readFile','Path\x20segment\x20cannot\x20be\x20empty','startsWith','pop','tdx.json','replace','5439533VCKwHx'];a102_0x569f=function(){return _0x38ac78;};return a102_0x569f();}function a102_0x16b8(_0x1428ce,_0x162930){_0x1428ce=_0x1428ce-0x192;const _0x569f6f=a102_0x569f();let _0x16b865=_0x569f6f[_0x1428ce];return _0x16b865;}export function isChildPath(_0x13521d,_0x52a73f){const _0x47ad6a=a102_0x16b8,_0x2eeb26=parsePath(_0x13521d),_0x31510c=parsePath(_0x52a73f);if(_0x2eeb26['segments'][_0x47ad6a(0x1b7)]<=_0x31510c[_0x47ad6a(0x1b6)][_0x47ad6a(0x1b7)])return![];for(let _0x44833e=0x0;_0x44833e<_0x31510c['segments'][_0x47ad6a(0x1b7)];_0x44833e++){if(_0x2eeb26[_0x47ad6a(0x1b6)][_0x44833e]!==_0x31510c[_0x47ad6a(0x1b6)][_0x44833e])return![];}return!![];}export function splitPath(_0x3091ae){const _0x422caa=a102_0x16b8,_0x4cd71b=parsePath(_0x3091ae);if(_0x4cd71b[_0x422caa(0x1b6)][_0x422caa(0x1b7)]===0x0)throw new Error(_0x422caa(0x1a2));if(_0x4cd71b[_0x422caa(0x1b6)]['length']===0x1)return{'parent':_0x4cd71b[_0x422caa(0x1b6)][0x0]};return{'parent':_0x4cd71b[_0x422caa(0x1b6)][0x0],'child':_0x4cd71b['segments'][_0x422caa(0x1af)](0x1)['join']('/')};}export function isYamlFilePath(_0x2692c4){const _0x118ba6=a102_0x16b8;return _0x2692c4[_0x118ba6(0x1c0)](_0x118ba6(0x192))||_0x2692c4[_0x118ba6(0x1c0)]('.yaml');}export async function resolveYamlFilePath(_0x11ea28,_0x49f4e8=nodeFileSystem){const _0x2794ed=a102_0x16b8,_0x3d5a9d=a102_0x2cf6d2[_0x2794ed(0x19a)](_0x11ea28);if(!await _0x49f4e8[_0x2794ed(0x1a3)](_0x3d5a9d))throw new Error('File\x20not\x20found:\x20'+_0x11ea28);let _0x5479c9=a102_0x2cf6d2[_0x2794ed(0x1b5)](_0x3d5a9d),_0xd2a5ae=null,_0x1dd5d3=null;const _0x43038e=a102_0x2cf6d2[_0x2794ed(0x1a8)](_0x5479c9)[_0x2794ed(0x1a0)];while(_0x5479c9!==_0x43038e){const _0x45bd13=a102_0x2cf6d2['join'](_0x5479c9,_0x2794ed(0x1bd));if(await _0x49f4e8[_0x2794ed(0x1a3)](_0x45bd13)){_0xd2a5ae=_0x45bd13,_0x1dd5d3=_0x5479c9;break;}_0x5479c9=a102_0x2cf6d2[_0x2794ed(0x1b5)](_0x5479c9);}if(!_0xd2a5ae||!_0x1dd5d3)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x11ea28);const _0x3bf96e=await _0x49f4e8['readFile'](_0xd2a5ae),_0x4f19db=JSON[_0x2794ed(0x1a8)](_0x3bf96e),_0xe899cb=_0x4f19db[_0x2794ed(0x1a4)];if(!_0xe899cb)throw new Error(_0x2794ed(0x1c1));const _0x487af4=await _0x49f4e8[_0x2794ed(0x1b9)](_0x3d5a9d),_0x38769c=a102_0x33ad7e(_0x487af4),_0x153f38=_0x38769c[_0x2794ed(0x1ad)];if(!_0x153f38)throw new Error(_0x2794ed(0x19e)+_0x11ea28);const _0x38696e=_0x38769c['type']==='journey'?'journey':_0x2794ed(0x198),_0x173d9e=a102_0x2cf6d2[_0x2794ed(0x19b)](_0x1dd5d3,_0x3d5a9d),_0x295ca3=a102_0x2cf6d2[_0x2794ed(0x1b5)](_0x173d9e),_0x1bc695=_0x295ca3==='.'?'':_0x295ca3[_0x2794ed(0x1be)](/\\/g,'/'),_0x41506a=_0x1bc695?_0xe899cb+'/'+_0x1bc695+'/'+_0x153f38:_0xe899cb+'/'+_0x153f38;return{'parentSegment':_0xe899cb,'segmentName':_0x153f38,'folderPath':_0x1bc695,'fullPath':_0x41506a,'resourceType':_0x38696e};}
1
+ function a102_0x2069(){const _0x21eb1e=['trim','18696IFqMpW','segments','32aFRnei','length','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Relative\x20path\x20cannot\x20be\x20empty','readFile','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','root','filter','Path\x20cannot\x20be\x20empty','substring','dirname','4euJLdt','segment','exists','2210doWpyH','1037414SyhydI','pop','name','parent_segment','2415VBJomZ','isAbsolute','test','Cannot\x20split\x20empty\x20path','push','854678PXRRXp','910248EQRKHQ','Path\x20segment\x20cannot\x20be\x20empty','Path\x20attempts\x20to\x20navigate\x20above\x20root','File\x20not\x20found:\x20','Cannot\x20navigate\x20above\x20root','tdx.json','endsWith','join','55989iGbmQH','resolve','slice','startsWith','relative','type','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','raw','journey','parse','1574538czGRmN','4597413coBKwf'];a102_0x2069=function(){return _0x21eb1e;};return a102_0x2069();}(function(_0x10cbff,_0x3a2030){const _0x2374d9=a102_0x28d9,_0x3e035c=_0x10cbff();while(!![]){try{const _0x54265e=parseInt(_0x2374d9(0x106))/0x1+parseInt(_0x2374d9(0xf4))/0x2+parseInt(_0x2374d9(0x107))/0x3*(-parseInt(_0x2374d9(0xe6))/0x4)+-parseInt(_0x2374d9(0xee))/0x5*(parseInt(_0x2374d9(0x109))/0x6)+parseInt(_0x2374d9(0xea))/0x7*(parseInt(_0x2374d9(0x10b))/0x8)+-parseInt(_0x2374d9(0xfc))/0x9*(-parseInt(_0x2374d9(0xe9))/0xa)+-parseInt(_0x2374d9(0xf3))/0xb;if(_0x54265e===_0x3a2030)break;else _0x3e035c['push'](_0x3e035c['shift']());}catch(_0x31912d){_0x3e035c['push'](_0x3e035c['shift']());}}}(a102_0x2069,0xd75c2));import a102_0x30027b from'path';import{parse as a102_0x39552c}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x10ca42){const _0x152263=a102_0x28d9;if(!_0x10ca42||_0x10ca42[_0x152263(0x108)]()==='')throw new Error(_0x152263(0x113));const _0x120dcd=_0x10ca42[_0x152263(0x108)]();if(_0x120dcd==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x10ca42};const _0x2f9fc0=_0x120dcd['startsWith']('/')?_0x120dcd[_0x152263(0xe4)](0x1):_0x120dcd,_0x1c36e3=_0x2f9fc0['split']('/')[_0x152263(0x112)](_0x4cdcdb=>_0x4cdcdb!=='');if(_0x1c36e3[_0x152263(0x10c)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x187403=_0x120dcd[_0x152263(0xff)]('/')||!isRelativePathSegment(_0x1c36e3[0x0]);for(const _0x177f6 of _0x1c36e3){validatePathSegment(_0x177f6);}return{'segments':_0x1c36e3,'isAbsolute':_0x187403,'raw':_0x10ca42};}function isRelativePathSegment(_0x27f005){return _0x27f005==='.'||_0x27f005==='..';}function validatePathSegment(_0x5e73b9){const _0x48642a=a102_0x28d9;if(_0x5e73b9==='')throw new Error(_0x48642a(0xf5));if(_0x5e73b9==='.'||_0x5e73b9==='..')return;if(/[\x00-\x1F\x7F]/[_0x48642a(0xf0)](_0x5e73b9))throw new Error(_0x48642a(0x110)+_0x5e73b9);if(_0x5e73b9!==_0x5e73b9[_0x48642a(0x108)]()){}}export function validatePath(_0x89cc6e){const _0x55abb4=a102_0x28d9;if(_0x89cc6e['segments'][_0x55abb4(0x10c)]===0x0&&!_0x89cc6e[_0x55abb4(0xef)])throw new Error(_0x55abb4(0x10e));if(_0x89cc6e['isAbsolute']){if(_0x89cc6e[_0x55abb4(0x10a)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x363d82=0x0;for(const _0x301517 of _0x89cc6e[_0x55abb4(0x10a)]){if(_0x301517==='..'){if(_0x363d82===0x0)throw new Error(_0x55abb4(0xf6));_0x363d82--;}else _0x301517!=='.'&&_0x363d82++;}}}export function joinPaths(_0x1394b3,_0x5296d6){const _0x4d2b9b=a102_0x28d9;if(!_0x1394b3||_0x1394b3==='/')return _0x5296d6;if(!_0x5296d6||_0x5296d6==='.')return _0x1394b3;if(_0x5296d6[_0x4d2b9b(0xff)]('/'))return _0x5296d6;const _0x472195=parsePath(_0x1394b3),_0x4ad1b9=parsePath(_0x5296d6),_0x5536d0=[..._0x472195[_0x4d2b9b(0x10a)]];for(const _0x2c6b0d of _0x4ad1b9['segments']){if(_0x2c6b0d==='.')continue;else{if(_0x2c6b0d==='..'){if(_0x5536d0['length']===0x0)throw new Error(_0x4d2b9b(0xf8));_0x5536d0[_0x4d2b9b(0xeb)]();}else _0x5536d0[_0x4d2b9b(0xf2)](_0x2c6b0d);}}const _0x21d90b=_0x5536d0[_0x4d2b9b(0xfb)]('/');return _0x472195['raw']['startsWith']('/')?'/'+_0x21d90b:_0x21d90b;}export function normalizePath(_0xf82331){const _0x3913f5=a102_0x28d9,_0x490149=parsePath(_0xf82331),_0x38e3d0=[];for(const _0x5d7966 of _0x490149['segments']){if(_0x5d7966==='.')continue;else{if(_0x5d7966==='..'){if(_0x38e3d0['length']===0x0){if(_0x490149['isAbsolute'])throw new Error(_0x3913f5(0xf8));_0x38e3d0[_0x3913f5(0xf2)]('..');}else _0x38e3d0[_0x38e3d0[_0x3913f5(0x10c)]-0x1]==='..'?_0x38e3d0[_0x3913f5(0xf2)]('..'):_0x38e3d0[_0x3913f5(0xeb)]();}else _0x38e3d0['push'](_0x5d7966);}}if(_0x38e3d0[_0x3913f5(0x10c)]===0x0)return _0x490149[_0x3913f5(0xef)]?'/':'.';const _0x3438e7=_0x38e3d0[_0x3913f5(0xfb)]('/');return _0x490149[_0x3913f5(0x103)][_0x3913f5(0xff)]('/')?'/'+_0x3438e7:_0x3438e7;}export function getParentPath(_0x4e95e1){const _0x346706=a102_0x28d9,_0x3f2ee6=parsePath(_0x4e95e1);if(_0x3f2ee6['segments'][_0x346706(0x10c)]<=0x1)return'/';const _0x155fc9=_0x3f2ee6[_0x346706(0x10a)][_0x346706(0xfe)](0x0,-0x1)[_0x346706(0xfb)]('/');return _0x3f2ee6[_0x346706(0x103)][_0x346706(0xff)]('/')?'/'+_0x155fc9:_0x155fc9;}export function getBaseName(_0x34712f){const _0x3479c0=a102_0x28d9,_0x1b3ee5=parsePath(_0x34712f);return _0x1b3ee5['segments'][_0x1b3ee5[_0x3479c0(0x10a)][_0x3479c0(0x10c)]-0x1]||'';}export function isChildPath(_0x309021,_0x341d48){const _0x1826b3=a102_0x28d9,_0x5aa74e=parsePath(_0x309021),_0x216456=parsePath(_0x341d48);if(_0x5aa74e['segments'][_0x1826b3(0x10c)]<=_0x216456['segments'][_0x1826b3(0x10c)])return![];for(let _0x888b7f=0x0;_0x888b7f<_0x216456['segments']['length'];_0x888b7f++){if(_0x5aa74e[_0x1826b3(0x10a)][_0x888b7f]!==_0x216456[_0x1826b3(0x10a)][_0x888b7f])return![];}return!![];}export function splitPath(_0x39ae8f){const _0x48aa6b=a102_0x28d9,_0x567b93=parsePath(_0x39ae8f);if(_0x567b93['segments'][_0x48aa6b(0x10c)]===0x0)throw new Error(_0x48aa6b(0xf1));if(_0x567b93[_0x48aa6b(0x10a)][_0x48aa6b(0x10c)]===0x1)return{'parent':_0x567b93['segments'][0x0]};return{'parent':_0x567b93['segments'][0x0],'child':_0x567b93[_0x48aa6b(0x10a)][_0x48aa6b(0xfe)](0x1)[_0x48aa6b(0xfb)]('/')};}export function isYamlFilePath(_0x27cbde){const _0x43a4ce=a102_0x28d9;return _0x27cbde['endsWith']('.yml')||_0x27cbde[_0x43a4ce(0xfa)]('.yaml');}function a102_0x28d9(_0x4069c5,_0x1a612f){_0x4069c5=_0x4069c5-0xe4;const _0x206912=a102_0x2069();let _0x28d9ee=_0x206912[_0x4069c5];return _0x28d9ee;}export async function resolveYamlFilePath(_0x3cbcc3,_0x28005f=nodeFileSystem){const _0x504992=a102_0x28d9,_0x329ab7=a102_0x30027b[_0x504992(0xfd)](_0x3cbcc3);if(!await _0x28005f[_0x504992(0xe8)](_0x329ab7))throw new Error(_0x504992(0xf7)+_0x3cbcc3);let _0x8c3e65=a102_0x30027b['dirname'](_0x329ab7),_0x4a7eef=null,_0x253319=null;const _0x87d3dd=a102_0x30027b[_0x504992(0x105)](_0x8c3e65)[_0x504992(0x111)];while(_0x8c3e65!==_0x87d3dd){const _0x407b6e=a102_0x30027b['join'](_0x8c3e65,_0x504992(0xf9));if(await _0x28005f[_0x504992(0xe8)](_0x407b6e)){_0x4a7eef=_0x407b6e,_0x253319=_0x8c3e65;break;}_0x8c3e65=a102_0x30027b['dirname'](_0x8c3e65);}if(!_0x4a7eef||!_0x253319)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x3cbcc3);const _0x5d7804=await _0x28005f[_0x504992(0x10f)](_0x4a7eef),_0x120a4c=JSON[_0x504992(0x105)](_0x5d7804),_0x3ec8ff=_0x120a4c[_0x504992(0xed)];if(!_0x3ec8ff)throw new Error(_0x504992(0x102));const _0x2b95ef=await _0x28005f[_0x504992(0x10f)](_0x329ab7),_0x1b1b15=a102_0x39552c(_0x2b95ef),_0x3dd9d0=_0x1b1b15[_0x504992(0xec)];if(!_0x3dd9d0)throw new Error(_0x504992(0x10d)+_0x3cbcc3);const _0x590dd7=_0x1b1b15[_0x504992(0x101)]===_0x504992(0x104)?'journey':_0x504992(0xe7),_0xe6a0de=a102_0x30027b[_0x504992(0x100)](_0x253319,_0x329ab7),_0x201842=a102_0x30027b[_0x504992(0xe5)](_0xe6a0de),_0x76d767=_0x201842==='.'?'':_0x201842['replace'](/\\/g,'/'),_0x81be62=_0x76d767?_0x3ec8ff+'/'+_0x76d767+'/'+_0x3dd9d0:_0x3ec8ff+'/'+_0x3dd9d0;return{'parentSegment':_0x3ec8ff,'segmentName':_0x3dd9d0,'folderPath':_0x76d767,'fullPath':_0x81be62,'resourceType':_0x590dd7};}
@@ -1 +1 @@
1
- (function(_0x179ebe,_0x2f29ed){const _0x2110f0=a103_0x8119,_0x4f9352=_0x179ebe();while(!![]){try{const _0x21d37a=parseInt(_0x2110f0(0x103))/0x1*(parseInt(_0x2110f0(0xfa))/0x2)+-parseInt(_0x2110f0(0xf7))/0x3+-parseInt(_0x2110f0(0x102))/0x4+parseInt(_0x2110f0(0xf9))/0x5*(-parseInt(_0x2110f0(0xfe))/0x6)+parseInt(_0x2110f0(0xfd))/0x7*(-parseInt(_0x2110f0(0xf5))/0x8)+parseInt(_0x2110f0(0xf3))/0x9*(-parseInt(_0x2110f0(0x100))/0xa)+-parseInt(_0x2110f0(0xfc))/0xb*(-parseInt(_0x2110f0(0xff))/0xc);if(_0x21d37a===_0x2f29ed)break;else _0x4f9352['push'](_0x4f9352['shift']());}catch(_0x1f9813){_0x4f9352['push'](_0x4f9352['shift']());}}}(a103_0x133f,0x6438b));function a103_0x8119(_0xdd00e9,_0x36f573){_0xdd00e9=_0xdd00e9-0xf3;const _0x133f97=a103_0x133f();let _0x811919=_0x133f97[_0xdd00e9];return _0x811919;}function a103_0x133f(){const _0x1c6a05=['substring','3734320URkMlN','.\x20Parent\x20name\x20cannot\x20be\x20empty','1243452XXvQqF','indexOf','37275mjUXNK','2EVkZZY','Invalid\x20segment\x20reference\x20format:\x20','22329901lPAXgX','7DeuFee','468EAMUrt','12nfGeqI','10WErRLD','.\x20Child\x20name\x20cannot\x20be\x20empty','2913912VDObzi','633409ERZolR','554859LbzAsi'];a103_0x133f=function(){return _0x1c6a05;};return a103_0x133f();}export function parseSegmentRef(_0xf98a9d){const _0xb46775=a103_0x8119,_0x1b6098=_0xf98a9d[_0xb46775(0xf8)]('/');if(_0x1b6098===-0x1)return{'parentId':_0xf98a9d};if(_0x1b6098===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0xf98a9d+_0xb46775(0xf6));const _0x1a769f=_0xf98a9d[_0xb46775(0xf4)](0x0,_0x1b6098),_0xe09ccd=_0xf98a9d[_0xb46775(0xf4)](_0x1b6098+0x1);if(_0xe09ccd==='')throw new Error(_0xb46775(0xfb)+_0xf98a9d+_0xb46775(0x101));return{'parentId':_0x1a769f,'childId':_0xe09ccd};}
1
+ (function(_0x26e694,_0x3ff8e3){const _0x2f998f=a103_0x1a1e,_0x4a0e8f=_0x26e694();while(!![]){try{const _0x39d67f=parseInt(_0x2f998f(0x96))/0x1+parseInt(_0x2f998f(0x8f))/0x2+-parseInt(_0x2f998f(0x98))/0x3+-parseInt(_0x2f998f(0x93))/0x4*(-parseInt(_0x2f998f(0x95))/0x5)+parseInt(_0x2f998f(0x92))/0x6+parseInt(_0x2f998f(0x97))/0x7+-parseInt(_0x2f998f(0x8e))/0x8;if(_0x39d67f===_0x3ff8e3)break;else _0x4a0e8f['push'](_0x4a0e8f['shift']());}catch(_0x5a2545){_0x4a0e8f['push'](_0x4a0e8f['shift']());}}}(a103_0x16c7,0x19019));function a103_0x16c7(){const _0x3884f1=['129262yFLMXu','336204XLMpyG','.\x20Child\x20name\x20cannot\x20be\x20empty','2123808tejWNO','161910RKfFGl','substring','Invalid\x20segment\x20reference\x20format:\x20','979638fwDeHV','5508CsBAXB','.\x20Parent\x20name\x20cannot\x20be\x20empty','95iLcNtP','191112DLrolR'];a103_0x16c7=function(){return _0x3884f1;};return a103_0x16c7();}function a103_0x1a1e(_0x3f71ec,_0x2ac100){_0x3f71ec=_0x3f71ec-0x8d;const _0x16c728=a103_0x16c7();let _0x1a1e57=_0x16c728[_0x3f71ec];return _0x1a1e57;}export function parseSegmentRef(_0x40e33e){const _0x514a40=a103_0x1a1e,_0x42ea62=_0x40e33e['indexOf']('/');if(_0x42ea62===-0x1)return{'parentId':_0x40e33e};if(_0x42ea62===0x0)throw new Error(_0x514a40(0x91)+_0x40e33e+_0x514a40(0x94));const _0x2bc306=_0x40e33e[_0x514a40(0x90)](0x0,_0x42ea62),_0xc63250=_0x40e33e[_0x514a40(0x90)](_0x42ea62+0x1);if(_0xc63250==='')throw new Error(_0x514a40(0x91)+_0x40e33e+_0x514a40(0x8d));return{'parentId':_0x2bc306,'childId':_0xc63250};}
@@ -1 +1 @@
1
- (function(_0x2d816a,_0x3d6542){const _0x44c5db=a104_0x578b,_0x2bebb9=_0x2d816a();while(!![]){try{const _0x38001b=parseInt(_0x44c5db(0xe5))/0x1*(-parseInt(_0x44c5db(0xc3))/0x2)+-parseInt(_0x44c5db(0xbc))/0x3*(-parseInt(_0x44c5db(0xb9))/0x4)+parseInt(_0x44c5db(0xb8))/0x5*(-parseInt(_0x44c5db(0xe0))/0x6)+parseInt(_0x44c5db(0xd7))/0x7+parseInt(_0x44c5db(0xdb))/0x8+parseInt(_0x44c5db(0xdc))/0x9+-parseInt(_0x44c5db(0xbf))/0xa;if(_0x38001b===_0x3d6542)break;else _0x2bebb9['push'](_0x2bebb9['shift']());}catch(_0x1cc33d){_0x2bebb9['push'](_0x2bebb9['shift']());}}}(a104_0x179f,0xce02d));import a104_0xf064be 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(_0x3f8b79){return _0x3f8b79['type']!=='error';}function a104_0x578b(_0x5adac1,_0xbb9f6e){_0x5adac1=_0x5adac1-0xb4;const _0x179fda=a104_0x179f();let _0x578b48=_0x179fda[_0x5adac1];return _0x578b48;}export function isScopedResolution(_0x3547ca){const _0x463c9d=a104_0x578b;return _0x3547ca[_0x463c9d(0xcf)]===_0x463c9d(0xe8)||_0x3547ca[_0x463c9d(0xcf)]===_0x463c9d(0xbb)||_0x3547ca[_0x463c9d(0xcf)]==='context';}export function getScopedDetails(_0x3e4a9f){const _0x15e90f=a104_0x578b;if(isScopedResolution(_0x3e4a9f))return{'isScoped':_0x3e4a9f['isScoped'],'scopedFolderPath':_0x3e4a9f[_0x15e90f(0xc1)]};return undefined;}async function findTdxConfigAsync(_0x230bb1,_0x1a76e4){const _0x534b06=a104_0x578b;let _0xab1683=a104_0xf064be[_0x534b06(0xb6)](_0x230bb1);const _0x43e87c=a104_0xf064be['parse'](_0xab1683)['root'];while(_0xab1683!==_0x43e87c){const _0x3a613d=a104_0xf064be[_0x534b06(0xc4)](_0xab1683,'tdx.json');if(await _0x1a76e4[_0x534b06(0xd5)](_0x3a613d))try{const _0x2c4a02=await _0x1a76e4['readFile'](_0x3a613d),_0x129335=JSON[_0x534b06(0xc5)](_0x2c4a02);if(_0x129335['parent_segment']&&typeof _0x129335['parent_segment']==='string')return{'configPath':_0x3a613d,'configDir':_0xab1683,'parentSegment':_0x129335['parent_segment']};}catch{}_0xab1683=a104_0xf064be['dirname'](_0xab1683);}return null;}function calculateScopedPath(_0x398e21,_0x3dade8){const _0x4deb16=a104_0x578b,_0x18bb49=a104_0xf064be['relative'](_0x3dade8,_0x398e21),_0x2f092f=_0x18bb49!==''&&_0x18bb49!=='.'&&!_0x18bb49[_0x4deb16(0xea)]('..');return{'isScoped':_0x2f092f,'scopedFolderPath':_0x2f092f?_0x18bb49[_0x4deb16(0xca)](/\\/g,'/'):''};}function a104_0x179f(){const _0x2e9b8e=['exists','error','11090380SWDPiX','No\x20tdx.json\x20found\x20for\x20file:\x20','parent_name','File\x20not\x20found:\x20','9506928BiOppk','13858542oKSFtJ','context','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','No\x20tdx.json\x20found','6mIxINN','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','resourceType','basename','journey','9137vIbXXi','isFile','match','directory','includes','startsWith','invalid_yaml','dirname','segment','resolve','File\x20not\x20found','8108140jQdEIJ','6113732jIJkmp','extname','file','3atWSwX','cwd','Not\x20a\x20YAML\x20file:\x20','18496490MxzuEu','trim','scopedFolderPath','folderPath','334LLnAMu','join','parse','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parentSegment','isDirectory','replace','configDir','readFile','segmentName','file_not_found','type','no_config','Parent\x20segment\x20not\x20specified','stat','isScoped','message'];a104_0x179f=function(){return _0x2e9b8e;};return a104_0x179f();}export async function resolveTarget(_0x2038af){const _0x217dc2=a104_0x578b,{arg:_0x5e89fc,contextParent:_0xcfcfae,cwd:cwd=process[_0x217dc2(0xbd)](),fs:fs=nodeFileSystem}=_0x2038af;if(_0x5e89fc&&isYamlFilePath(_0x5e89fc))try{const _0x472ea6=await resolveYamlFilePath(_0x5e89fc,fs),_0x3cc29c=a104_0xf064be['resolve'](_0x5e89fc),_0x57b46f=a104_0xf064be[_0x217dc2(0xb4)](_0x3cc29c),_0x3a472e=await findTdxConfigAsync(_0x57b46f,fs);if(!_0x3a472e){if(_0xcfcfae){const _0x4b5bd0=a104_0xf064be['dirname'](_0x3cc29c);return{'type':_0x217dc2(0xbb),'parentName':_0xcfcfae,'targetDir':_0x4b5bd0,'configRoot':_0x4b5bd0,'filePath':_0x3cc29c,'resourceName':_0x472ea6[_0x217dc2(0xcd)],'folderPath':_0x472ea6[_0x217dc2(0xc2)],'resourceType':_0x472ea6[_0x217dc2(0xe2)],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x217dc2(0xd0),'message':_0x217dc2(0xd8)+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xde)};}const _0x5d8dde=calculateScopedPath(_0x57b46f,_0x3a472e[_0x217dc2(0xcb)]);return{'type':'file','parentName':_0x3a472e[_0x217dc2(0xc8)],'targetDir':_0x3a472e[_0x217dc2(0xcb)],'configRoot':_0x3a472e['configDir'],'filePath':_0x3cc29c,'resourceName':_0x472ea6[_0x217dc2(0xcd)],'folderPath':_0x472ea6['folderPath'],'resourceType':_0x472ea6[_0x217dc2(0xe2)],'isScoped':_0x5d8dde[_0x217dc2(0xd3)],'scopedFolderPath':_0x5d8dde[_0x217dc2(0xc1)]};}catch(_0x410cbb){const _0x28aa7b=_0x410cbb instanceof Error?_0x410cbb[_0x217dc2(0xd4)]:String(_0x410cbb);if(_0x28aa7b[_0x217dc2(0xe9)](_0x217dc2(0xb7)))return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xce),'message':_0x217dc2(0xda)+_0x5e89fc,'arg':_0x5e89fc};if(_0x28aa7b[_0x217dc2(0xe9)](_0x217dc2(0xdf))){if(_0xcfcfae){const _0x351ea8=a104_0xf064be[_0x217dc2(0xb6)](_0x5e89fc);if(await fs['exists'](_0x351ea8)){const _0x1e20ba=a104_0xf064be[_0x217dc2(0xb4)](_0x351ea8),_0x5ef000=await fs[_0x217dc2(0xcc)](_0x351ea8),_0x3bb633=_0x5ef000['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x19eba4=_0x5ef000[_0x217dc2(0xe7)](/^type:\s*["']?([^"'\n]+)["']?/m),_0xb51e44=_0x3bb633?_0x3bb633[0x1]['trim']():a104_0xf064be[_0x217dc2(0xe3)](_0x5e89fc,a104_0xf064be[_0x217dc2(0xba)](_0x5e89fc)),_0x51cf49=_0x19eba4&&_0x19eba4[0x1][_0x217dc2(0xc0)]()===_0x217dc2(0xe4)?'journey':_0x217dc2(0xb5);return{'type':_0x217dc2(0xbb),'parentName':_0xcfcfae,'targetDir':_0x1e20ba,'configRoot':_0x1e20ba,'filePath':_0x351ea8,'resourceName':_0xb51e44,'folderPath':'','resourceType':_0x51cf49,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xd0),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xde)};}return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xeb),'message':_0x28aa7b,'arg':_0x5e89fc};}if(_0x5e89fc){const _0x1a6326=a104_0xf064be[_0x217dc2(0xb6)](cwd,_0x5e89fc);let _0x2640d0=null;try{_0x2640d0=await fs[_0x217dc2(0xd2)](_0x1a6326);}catch{}if(_0x2640d0?.[_0x217dc2(0xc9)]()){const _0x381b8e=await findTdxConfigAsync(_0x1a6326,fs);if(_0x381b8e){const _0x4a0e74=calculateScopedPath(_0x1a6326,_0x381b8e[_0x217dc2(0xcb)]);return{'type':'directory','parentName':_0x381b8e['parentSegment'],'targetDir':_0x1a6326,'configRoot':_0x381b8e[_0x217dc2(0xcb)],'isScoped':_0x4a0e74[_0x217dc2(0xd3)],'scopedFolderPath':_0x4a0e74[_0x217dc2(0xc1)]};}if(_0xcfcfae)return{'type':_0x217dc2(0xe8),'parentName':_0xcfcfae,'targetDir':_0x1a6326,'configRoot':_0x1a6326,'isScoped':![],'scopedFolderPath':''};return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xd0),'message':_0x217dc2(0xc7)+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xde)};}if(_0x2640d0?.[_0x217dc2(0xe6)]())return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xeb),'message':_0x217dc2(0xbe)+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xc6)};const _0x19c8a5=sanitizeFileName(_0x5e89fc),_0x18a0f5=getSegmentRootDir(_0x19c8a5,cwd);return{'type':_0x217dc2(0xd9),'parentName':_0x5e89fc,'targetDir':_0x18a0f5,'configRoot':_0x18a0f5};}const _0x477ca3=await findTdxConfigAsync(cwd,fs);if(_0x477ca3){const _0x4e0404=calculateScopedPath(cwd,_0x477ca3['configDir']);return{'type':_0x217dc2(0xdd),'parentName':_0x477ca3[_0x217dc2(0xc8)],'targetDir':cwd,'configRoot':_0x477ca3[_0x217dc2(0xcb)],'isScoped':_0x4e0404[_0x217dc2(0xd3)],'scopedFolderPath':_0x4e0404[_0x217dc2(0xc1)]};}if(_0xcfcfae){const _0x532f91=sanitizeFileName(_0xcfcfae),_0x21c6da=getSegmentRootDir(_0x532f91,cwd);return{'type':_0x217dc2(0xdd),'parentName':_0xcfcfae,'targetDir':_0x21c6da,'configRoot':_0x21c6da,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':'no_parent','message':_0x217dc2(0xd1),'helpText':_0x217dc2(0xe1)};}
1
+ (function(_0x169cb2,_0x13d185){const _0x35456f=a104_0x413a,_0x485a53=_0x169cb2();while(!![]){try{const _0x260e2c=-parseInt(_0x35456f(0x124))/0x1*(-parseInt(_0x35456f(0x10d))/0x2)+parseInt(_0x35456f(0x12d))/0x3*(-parseInt(_0x35456f(0x108))/0x4)+parseInt(_0x35456f(0x117))/0x5*(parseInt(_0x35456f(0x11a))/0x6)+parseInt(_0x35456f(0x129))/0x7+parseInt(_0x35456f(0x10f))/0x8*(-parseInt(_0x35456f(0x10c))/0x9)+parseInt(_0x35456f(0x125))/0xa+-parseInt(_0x35456f(0x113))/0xb*(parseInt(_0x35456f(0x100))/0xc);if(_0x260e2c===_0x13d185)break;else _0x485a53['push'](_0x485a53['shift']());}catch(_0x4b2461){_0x485a53['push'](_0x485a53['shift']());}}}(a104_0x16d0,0xec660));function a104_0x16d0(){const _0x5d02fb=['58779TYAdHg','2360kZIpFH','journey','1568fwlifl','parentSegment','scopedFolderPath','readFile','33udxbJy','No\x20tdx.json\x20found','cwd','directory','5aflLdm','invalid_yaml','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','1076532OfvkIw','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','join','exists','parent_segment','extname','dirname','tdx.json','trim','type','1269QaQfZG','15722880heWMhx','match','segmentName','Not\x20a\x20YAML\x20file:\x20','5662328qkRFsW','Parent\x20segment\x20not\x20specified','resourceType','folderPath','21AZXjtx','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','file','resolve','no_config','isDirectory','includes','stat','3068892bKtzkb','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','context','configDir','parent_name','parse','replace','File\x20not\x20found','595684SVQnZr','message','error','isScoped'];a104_0x16d0=function(){return _0x5d02fb;};return a104_0x16d0();}import a104_0x177951 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(_0x22acf8){const _0xa83f7c=a104_0x413a;return _0x22acf8[_0xa83f7c(0x123)]!==_0xa83f7c(0x10a);}export function isScopedResolution(_0x50a4ed){const _0x33cd49=a104_0x413a;return _0x50a4ed[_0x33cd49(0x123)]===_0x33cd49(0x116)||_0x50a4ed[_0x33cd49(0x123)]===_0x33cd49(0xfa)||_0x50a4ed[_0x33cd49(0x123)]===_0x33cd49(0x102);}export function getScopedDetails(_0x3e70de){const _0x40eba4=a104_0x413a;if(isScopedResolution(_0x3e70de))return{'isScoped':_0x3e70de[_0x40eba4(0x10b)],'scopedFolderPath':_0x3e70de[_0x40eba4(0x111)]};return undefined;}async function findTdxConfigAsync(_0x270af6,_0x472192){const _0x5a0f75=a104_0x413a;let _0x4eb2e1=a104_0x177951[_0x5a0f75(0xfb)](_0x270af6);const _0x10c06a=a104_0x177951[_0x5a0f75(0x105)](_0x4eb2e1)['root'];while(_0x4eb2e1!==_0x10c06a){const _0x5549e7=a104_0x177951[_0x5a0f75(0x11c)](_0x4eb2e1,_0x5a0f75(0x121));if(await _0x472192[_0x5a0f75(0x11d)](_0x5549e7))try{const _0x34d273=await _0x472192['readFile'](_0x5549e7),_0x2234d0=JSON[_0x5a0f75(0x105)](_0x34d273);if(_0x2234d0[_0x5a0f75(0x11e)]&&typeof _0x2234d0['parent_segment']==='string')return{'configPath':_0x5549e7,'configDir':_0x4eb2e1,'parentSegment':_0x2234d0[_0x5a0f75(0x11e)]};}catch{}_0x4eb2e1=a104_0x177951[_0x5a0f75(0x120)](_0x4eb2e1);}return null;}function calculateScopedPath(_0x295bc7,_0x52c8bb){const _0x2b006b=a104_0x413a,_0x3027dc=a104_0x177951['relative'](_0x52c8bb,_0x295bc7),_0xc47a59=_0x3027dc!==''&&_0x3027dc!=='.'&&!_0x3027dc['startsWith']('..');return{'isScoped':_0xc47a59,'scopedFolderPath':_0xc47a59?_0x3027dc[_0x2b006b(0x106)](/\\/g,'/'):''};}function a104_0x413a(_0x1a8efd,_0x576728){_0x1a8efd=_0x1a8efd-0xf9;const _0x16d0b2=a104_0x16d0();let _0x413ad9=_0x16d0b2[_0x1a8efd];return _0x413ad9;}export async function resolveTarget(_0x133356){const _0x1b2796=a104_0x413a,{arg:_0x1d7c6b,contextParent:_0x504d66,cwd:cwd=process[_0x1b2796(0x115)](),fs:fs=nodeFileSystem}=_0x133356;if(_0x1d7c6b&&isYamlFilePath(_0x1d7c6b))try{const _0x27fca3=await resolveYamlFilePath(_0x1d7c6b,fs),_0x3bd81a=a104_0x177951['resolve'](_0x1d7c6b),_0x40cfd6=a104_0x177951[_0x1b2796(0x120)](_0x3bd81a),_0x56d878=await findTdxConfigAsync(_0x40cfd6,fs);if(!_0x56d878){if(_0x504d66){const _0x3ffd03=a104_0x177951[_0x1b2796(0x120)](_0x3bd81a);return{'type':_0x1b2796(0xfa),'parentName':_0x504d66,'targetDir':_0x3ffd03,'configRoot':_0x3ffd03,'filePath':_0x3bd81a,'resourceName':_0x27fca3[_0x1b2796(0x127)],'folderPath':_0x27fca3[_0x1b2796(0x12c)],'resourceType':_0x27fca3[_0x1b2796(0x12b)],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x1b2796(0xfc),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x1d7c6b,'arg':_0x1d7c6b,'helpText':_0x1b2796(0xf9)};}const _0x347013=calculateScopedPath(_0x40cfd6,_0x56d878[_0x1b2796(0x103)]);return{'type':_0x1b2796(0xfa),'parentName':_0x56d878[_0x1b2796(0x110)],'targetDir':_0x56d878[_0x1b2796(0x103)],'configRoot':_0x56d878[_0x1b2796(0x103)],'filePath':_0x3bd81a,'resourceName':_0x27fca3['segmentName'],'folderPath':_0x27fca3['folderPath'],'resourceType':_0x27fca3['resourceType'],'isScoped':_0x347013[_0x1b2796(0x10b)],'scopedFolderPath':_0x347013[_0x1b2796(0x111)]};}catch(_0x1cdc18){const _0x10ecdb=_0x1cdc18 instanceof Error?_0x1cdc18[_0x1b2796(0x109)]:String(_0x1cdc18);if(_0x10ecdb[_0x1b2796(0xfe)](_0x1b2796(0x107)))return{'type':_0x1b2796(0x10a),'errorCode':'file_not_found','message':'File\x20not\x20found:\x20'+_0x1d7c6b,'arg':_0x1d7c6b};if(_0x10ecdb[_0x1b2796(0xfe)](_0x1b2796(0x114))){if(_0x504d66){const _0x5b897d=a104_0x177951[_0x1b2796(0xfb)](_0x1d7c6b);if(await fs[_0x1b2796(0x11d)](_0x5b897d)){const _0x5c8e77=a104_0x177951['dirname'](_0x5b897d),_0x13d3e9=await fs[_0x1b2796(0x112)](_0x5b897d),_0x5bd412=_0x13d3e9[_0x1b2796(0x126)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x5c5862=_0x13d3e9[_0x1b2796(0x126)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x351cb1=_0x5bd412?_0x5bd412[0x1][_0x1b2796(0x122)]():a104_0x177951['basename'](_0x1d7c6b,a104_0x177951[_0x1b2796(0x11f)](_0x1d7c6b)),_0x264bca=_0x5c5862&&_0x5c5862[0x1][_0x1b2796(0x122)]()===_0x1b2796(0x10e)?_0x1b2796(0x10e):'segment';return{'type':_0x1b2796(0xfa),'parentName':_0x504d66,'targetDir':_0x5c8e77,'configRoot':_0x5c8e77,'filePath':_0x5b897d,'resourceName':_0x351cb1,'folderPath':'','resourceType':_0x264bca,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0x1b2796(0xfc),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x1d7c6b,'arg':_0x1d7c6b,'helpText':_0x1b2796(0xf9)};}return{'type':'error','errorCode':_0x1b2796(0x118),'message':_0x10ecdb,'arg':_0x1d7c6b};}if(_0x1d7c6b){const _0x21906d=a104_0x177951['resolve'](cwd,_0x1d7c6b);let _0x237760=null;try{_0x237760=await fs[_0x1b2796(0xff)](_0x21906d);}catch{}if(_0x237760?.[_0x1b2796(0xfd)]()){const _0x9861c6=await findTdxConfigAsync(_0x21906d,fs);if(_0x9861c6){const _0x508561=calculateScopedPath(_0x21906d,_0x9861c6[_0x1b2796(0x103)]);return{'type':_0x1b2796(0x116),'parentName':_0x9861c6['parentSegment'],'targetDir':_0x21906d,'configRoot':_0x9861c6['configDir'],'isScoped':_0x508561[_0x1b2796(0x10b)],'scopedFolderPath':_0x508561[_0x1b2796(0x111)]};}if(_0x504d66)return{'type':_0x1b2796(0x116),'parentName':_0x504d66,'targetDir':_0x21906d,'configRoot':_0x21906d,'isScoped':![],'scopedFolderPath':''};return{'type':_0x1b2796(0x10a),'errorCode':_0x1b2796(0xfc),'message':_0x1b2796(0x119)+_0x1d7c6b,'arg':_0x1d7c6b,'helpText':_0x1b2796(0xf9)};}if(_0x237760?.['isFile']())return{'type':_0x1b2796(0x10a),'errorCode':'invalid_yaml','message':_0x1b2796(0x128)+_0x1d7c6b,'arg':_0x1d7c6b,'helpText':_0x1b2796(0x11b)};const _0x502947=sanitizeFileName(_0x1d7c6b),_0x4789bb=getSegmentRootDir(_0x502947,cwd);return{'type':_0x1b2796(0x104),'parentName':_0x1d7c6b,'targetDir':_0x4789bb,'configRoot':_0x4789bb};}const _0x2b26ee=await findTdxConfigAsync(cwd,fs);if(_0x2b26ee){const _0x2ab301=calculateScopedPath(cwd,_0x2b26ee['configDir']);return{'type':_0x1b2796(0x102),'parentName':_0x2b26ee['parentSegment'],'targetDir':cwd,'configRoot':_0x2b26ee['configDir'],'isScoped':_0x2ab301[_0x1b2796(0x10b)],'scopedFolderPath':_0x2ab301['scopedFolderPath']};}if(_0x504d66){const _0x2c4c6b=sanitizeFileName(_0x504d66),_0x120cb3=getSegmentRootDir(_0x2c4c6b,cwd);return{'type':_0x1b2796(0x102),'parentName':_0x504d66,'targetDir':_0x120cb3,'configRoot':_0x120cb3,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1b2796(0x10a),'errorCode':'no_parent','message':_0x1b2796(0x12a),'helpText':_0x1b2796(0x101)};}
@@ -1 +1 @@
1
- const a105_0x250f50=a105_0xf7ea;function a105_0x4f72(){const _0x394fe5=['186FNizGl','join','resolve','parse','cwd','root','parent_segment','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','752159FSBLDE','tdx.json','91085uNoAjQ','12343200UDVUqI','156062dsWWri','Invalid\x20tdx.json:\x20expected\x20object','10842671DWabGy','string','relative','3787636MhrmiK','14509080IuDtlJ','startsWith','replace','Invalid\x20JSON\x20in\x20','segments','dirname','object','9JUuBqQ'];a105_0x4f72=function(){return _0x394fe5;};return a105_0x4f72();}(function(_0x363740,_0x5aad0a){const _0xbaa576=a105_0xf7ea,_0x1c2eb9=_0x363740();while(!![]){try{const _0x5c2449=parseInt(_0xbaa576(0x7d))/0x1+-parseInt(_0xbaa576(0x81))/0x2*(-parseInt(_0xbaa576(0x74))/0x3)+parseInt(_0xbaa576(0x86))/0x4+parseInt(_0xbaa576(0x7f))/0x5*(parseInt(_0xbaa576(0x75))/0x6)+-parseInt(_0xbaa576(0x83))/0x7+parseInt(_0xbaa576(0x80))/0x8+-parseInt(_0xbaa576(0x87))/0x9;if(_0x5c2449===_0x5aad0a)break;else _0x1c2eb9['push'](_0x1c2eb9['shift']());}catch(_0x933e7e){_0x1c2eb9['push'](_0x1c2eb9['shift']());}}}(a105_0x4f72,0xd6c63));import{existsSync,readFileSync}from'fs';import a105_0x15b02b from'path';const TDX_CONFIG_FILE=a105_0x250f50(0x7e),SEGMENTS_DIR=a105_0x250f50(0x71);export function findTdxConfigPath(_0x12b74d=process[a105_0x250f50(0x79)]()){const _0x5d9fac=a105_0x250f50;let _0x3ecac3=a105_0x15b02b[_0x5d9fac(0x77)](_0x12b74d);const _0x27f128=a105_0x15b02b[_0x5d9fac(0x78)](_0x3ecac3)[_0x5d9fac(0x7a)];while(_0x3ecac3!==_0x27f128){const _0x51fd60=a105_0x15b02b['join'](_0x3ecac3,TDX_CONFIG_FILE);if(existsSync(_0x51fd60))return _0x51fd60;_0x3ecac3=a105_0x15b02b[_0x5d9fac(0x72)](_0x3ecac3);}return null;}export function loadTdxConfig(_0x3df654){const _0x33f4ea=a105_0x250f50,_0x24330a=readFileSync(_0x3df654,'utf-8');let _0x13f5d4;try{_0x13f5d4=JSON[_0x33f4ea(0x78)](_0x24330a);}catch{throw new Error(_0x33f4ea(0x70)+_0x3df654);}if(!_0x13f5d4||typeof _0x13f5d4!==_0x33f4ea(0x73))throw new Error(_0x33f4ea(0x82));const _0x1f5015=_0x13f5d4;if(!_0x1f5015[_0x33f4ea(0x7b)]||typeof _0x1f5015[_0x33f4ea(0x7b)]!==_0x33f4ea(0x84))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field');return{'parent_segment':_0x1f5015['parent_segment']};}export function findTdxConfig(_0x145364=process['cwd']()){const _0x351787=a105_0x250f50,_0x58e593=findTdxConfigPath(_0x145364);if(!_0x58e593)throw new Error(_0x351787(0x7c));const _0x2841e6=loadTdxConfig(_0x58e593),_0x1db334=a105_0x15b02b[_0x351787(0x72)](_0x58e593);return{'config':_0x2841e6,'configPath':_0x58e593,'configDir':_0x1db334};}export function tryFindTdxConfig(_0x4ae7d5){try{return findTdxConfig(_0x4ae7d5);}catch{return null;}}export function getSegmentRootDir(_0x54dcb6,_0x2e5f56=process[a105_0x250f50(0x79)]()){const _0x2109a9=a105_0x250f50;return a105_0x15b02b[_0x2109a9(0x76)](_0x2e5f56,SEGMENTS_DIR,_0x54dcb6);}export function getTdxConfigPath(_0x20d090,_0x230166=process[a105_0x250f50(0x79)]()){const _0xc8300c=a105_0x250f50;return a105_0x15b02b[_0xc8300c(0x76)](getSegmentRootDir(_0x20d090,_0x230166),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x2765f0,_0x11ebad){const _0x58555e=a105_0x250f50,_0x40fd3a=a105_0x15b02b[_0x58555e(0x77)](_0x2765f0),_0x455786=a105_0x15b02b[_0x58555e(0x85)](_0x11ebad,_0x40fd3a);if(_0x455786[_0x58555e(0x6e)]('..'))return'';return _0x455786;}export function localPathToTdFolderPath(_0x1dafbf){const _0x425abc=a105_0x250f50,_0x13583e=a105_0x15b02b[_0x425abc(0x72)](_0x1dafbf);if(_0x13583e==='.'||_0x13583e==='')return'';return _0x13583e[_0x425abc(0x6f)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x3d93db,_0x2fe3a1){const _0x468cae=a105_0x250f50;if(!_0x3d93db)return _0x2fe3a1;return a105_0x15b02b[_0x468cae(0x76)](_0x2fe3a1,_0x3d93db);}function a105_0xf7ea(_0x228c83,_0x923f75){_0x228c83=_0x228c83-0x6e;const _0x4f72c9=a105_0x4f72();let _0xf7ea05=_0x4f72c9[_0x228c83];return _0xf7ea05;}export function createTdxConfigContent(_0x489862){const _0x50cb8a={'parent_segment':_0x489862};return JSON['stringify'](_0x50cb8a,null,0x2)+'\x0a';}
1
+ const a105_0x1e3c45=a105_0x2d98;(function(_0x38a1d5,_0xfdc05d){const _0x4a86a8=a105_0x2d98,_0x61facd=_0x38a1d5();while(!![]){try{const _0x4ed095=-parseInt(_0x4a86a8(0x80))/0x1*(parseInt(_0x4a86a8(0x8c))/0x2)+-parseInt(_0x4a86a8(0x75))/0x3*(parseInt(_0x4a86a8(0x7b))/0x4)+parseInt(_0x4a86a8(0x87))/0x5*(parseInt(_0x4a86a8(0x79))/0x6)+-parseInt(_0x4a86a8(0x7f))/0x7+parseInt(_0x4a86a8(0x83))/0x8+-parseInt(_0x4a86a8(0x8d))/0x9*(parseInt(_0x4a86a8(0x7c))/0xa)+parseInt(_0x4a86a8(0x7a))/0xb*(parseInt(_0x4a86a8(0x7e))/0xc);if(_0x4ed095===_0xfdc05d)break;else _0x61facd['push'](_0x61facd['shift']());}catch(_0x347b5d){_0x61facd['push'](_0x61facd['shift']());}}}(a105_0xd886,0x59fa9));import{existsSync,readFileSync}from'fs';import a105_0x30796c from'path';const TDX_CONFIG_FILE=a105_0x1e3c45(0x88),SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x1a67a2=process[a105_0x1e3c45(0x82)]()){const _0x8f900b=a105_0x1e3c45;let _0x5c1d3d=a105_0x30796c[_0x8f900b(0x72)](_0x1a67a2);const _0xe9412a=a105_0x30796c[_0x8f900b(0x86)](_0x5c1d3d)[_0x8f900b(0x84)];while(_0x5c1d3d!==_0xe9412a){const _0x80e179=a105_0x30796c[_0x8f900b(0x78)](_0x5c1d3d,TDX_CONFIG_FILE);if(existsSync(_0x80e179))return _0x80e179;_0x5c1d3d=a105_0x30796c[_0x8f900b(0x8a)](_0x5c1d3d);}return null;}export function loadTdxConfig(_0x310645){const _0x35d6dd=a105_0x1e3c45,_0x490b94=readFileSync(_0x310645,_0x35d6dd(0x8b));let _0x4a864e;try{_0x4a864e=JSON[_0x35d6dd(0x86)](_0x490b94);}catch{throw new Error(_0x35d6dd(0x74)+_0x310645);}if(!_0x4a864e||typeof _0x4a864e!==_0x35d6dd(0x73))throw new Error('Invalid\x20tdx.json:\x20expected\x20object');const _0x5665aa=_0x4a864e;if(!_0x5665aa[_0x35d6dd(0x7d)]||typeof _0x5665aa[_0x35d6dd(0x7d)]!==_0x35d6dd(0x76))throw new Error(_0x35d6dd(0x89));return{'parent_segment':_0x5665aa[_0x35d6dd(0x7d)]};}export function findTdxConfig(_0x1e3bbb=process['cwd']()){const _0x59fc05=a105_0x1e3c45,_0x25c711=findTdxConfigPath(_0x1e3bbb);if(!_0x25c711)throw new Error('No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x255a5f=loadTdxConfig(_0x25c711),_0x151b00=a105_0x30796c[_0x59fc05(0x8a)](_0x25c711);return{'config':_0x255a5f,'configPath':_0x25c711,'configDir':_0x151b00};}export function tryFindTdxConfig(_0x54676f){try{return findTdxConfig(_0x54676f);}catch{return null;}}export function getSegmentRootDir(_0x4317b2,_0x38b62e=process[a105_0x1e3c45(0x82)]()){const _0x41fbfe=a105_0x1e3c45;return a105_0x30796c[_0x41fbfe(0x78)](_0x38b62e,SEGMENTS_DIR,_0x4317b2);}export function getTdxConfigPath(_0x3c55f3,_0x1db647=process[a105_0x1e3c45(0x82)]()){const _0x24bdeb=a105_0x1e3c45;return a105_0x30796c[_0x24bdeb(0x78)](getSegmentRootDir(_0x3c55f3,_0x1db647),TDX_CONFIG_FILE);}function a105_0xd886(){const _0x28a9df=['relative','join','12gHjtAc','207955smssMR','4hutSVX','40PoUrAg','parent_segment','852fMzTlh','3321696xNQVcD','1MlojJb','replace','cwd','3530256XjUbuE','root','stringify','parse','38965FKYWoC','tdx.json','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','dirname','utf-8','1232350ZyZjWQ','595377poeTFh','resolve','object','Invalid\x20JSON\x20in\x20','225765ceLgYj','string'];a105_0xd886=function(){return _0x28a9df;};return a105_0xd886();}export function getRelativePathFromConfig(_0x1ecc09,_0x36bc72){const _0x4e090d=a105_0x1e3c45,_0x44c01b=a105_0x30796c[_0x4e090d(0x72)](_0x1ecc09),_0x355f84=a105_0x30796c[_0x4e090d(0x77)](_0x36bc72,_0x44c01b);if(_0x355f84['startsWith']('..'))return'';return _0x355f84;}function a105_0x2d98(_0x25e51e,_0x2de6ec){_0x25e51e=_0x25e51e-0x72;const _0xd886f1=a105_0xd886();let _0x2d98ec=_0xd886f1[_0x25e51e];return _0x2d98ec;}export function localPathToTdFolderPath(_0x173193){const _0x29939a=a105_0x1e3c45,_0x3b4f84=a105_0x30796c[_0x29939a(0x8a)](_0x173193);if(_0x3b4f84==='.'||_0x3b4f84==='')return'';return _0x3b4f84[_0x29939a(0x81)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x373856,_0x57add3){const _0x195adf=a105_0x1e3c45;if(!_0x373856)return _0x57add3;return a105_0x30796c[_0x195adf(0x78)](_0x57add3,_0x373856);}export function createTdxConfigContent(_0x410dd2){const _0x588daa=a105_0x1e3c45,_0x2cf10e={'parent_segment':_0x410dd2};return JSON[_0x588daa(0x85)](_0x2cf10e,null,0x2)+'\x0a';}