@treasuredata/tdx 0.16.0 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/unset-command.js +1 -1
  41. package/dist/commands/use-command.js +1 -1
  42. package/dist/commands/user-command.js +1 -1
  43. package/dist/commands/workflow-command.js +1 -1
  44. package/dist/core/auth.js +1 -1
  45. package/dist/core/command-output.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/connection-cache.js +1 -1
  48. package/dist/core/constants.js +1 -1
  49. package/dist/core/credential-cache.js +1 -1
  50. package/dist/core/global-context.js +1 -1
  51. package/dist/core/keychain.js +1 -1
  52. package/dist/core/profile.js +1 -1
  53. package/dist/core/project-config.js +1 -1
  54. package/dist/core/session.js +1 -1
  55. package/dist/core/user-cache.js +1 -1
  56. package/dist/core/version.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/mcp/server.js +1 -1
  59. package/dist/mcp/tools/index.js +1 -1
  60. package/dist/mcp/tools/tdx-run.js +1 -1
  61. package/dist/mcp/tools/tdx-search.js +1 -1
  62. package/dist/mcp/utils.js +1 -1
  63. package/dist/proxy/anthropic-adapter.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/context-signature.js +1 -1
  66. package/dist/proxy/conversation-utils.js +1 -1
  67. package/dist/proxy/passthrough-server.js +1 -1
  68. package/dist/proxy/server.js +1 -1
  69. package/dist/proxy/session-cache.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/api.js +1 -1
  80. package/dist/sdk/claude-agent/claude-agent-client.d.ts +19 -1
  81. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
  82. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  83. package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
  84. package/dist/sdk/claude-agent/environment.js +1 -1
  85. package/dist/sdk/claude-agent/index.js +1 -1
  86. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  87. package/dist/sdk/claude-agent/types.d.ts +26 -0
  88. package/dist/sdk/claude-agent/types.d.ts.map +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/rate-limiter.js +1 -1
  95. package/dist/sdk/client/td-api-client.js +1 -1
  96. package/dist/sdk/client/trino-api-client.js +1 -1
  97. package/dist/sdk/client/workflow-client.js +1 -1
  98. package/dist/sdk/connection-validator.js +1 -1
  99. package/dist/sdk/connection.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-aliases.js +1 -1
  111. package/dist/sdk/llm/model-factors.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  115. package/dist/sdk/segment/fields-display.js +1 -1
  116. package/dist/sdk/segment/file-discovery.js +1 -1
  117. package/dist/sdk/segment/journey-utils.js +1 -1
  118. package/dist/sdk/segment/journey-yaml.js +1 -1
  119. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  120. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  121. package/dist/sdk/segment/pull-workflow.js +1 -1
  122. package/dist/sdk/segment/push-workflow.js +1 -1
  123. package/dist/sdk/segment/resolution-context.js +1 -1
  124. package/dist/sdk/segment/segment-path-parser.js +1 -1
  125. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  126. package/dist/sdk/segment/target-resolution.js +1 -1
  127. package/dist/sdk/segment/tdx-config.js +1 -1
  128. package/dist/sdk/segment/validate-files.js +1 -1
  129. package/dist/sdk/segment/yaml-validator.js +1 -1
  130. package/dist/sdk/segment.js +1 -1
  131. package/dist/sdk/types/index.js +1 -1
  132. package/dist/sdk/types/progress.js +1 -1
  133. package/dist/sdk/user.js +1 -1
  134. package/dist/sdk/util/format-detector.js +1 -1
  135. package/dist/sdk/util/formatters.js +1 -1
  136. package/dist/sdk/util/index.js +1 -1
  137. package/dist/sdk/util/tree-formatter.js +1 -1
  138. package/dist/sdk/workflow/clone-workflow.js +1 -1
  139. package/dist/sdk/workflow/index.js +1 -1
  140. package/dist/sdk/workflow/pull-workflow.js +1 -1
  141. package/dist/sdk/workflow/push-workflow.js +1 -1
  142. package/dist/sdk/workflow/tdx-config.js +1 -1
  143. package/dist/sdk/workflow/workflow-utils.js +1 -1
  144. package/dist/utils/async.js +1 -1
  145. package/dist/utils/colors.js +1 -1
  146. package/dist/utils/diff.js +1 -1
  147. package/dist/utils/file-permissions.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/option-validation.js +1 -1
  150. package/dist/utils/port.js +1 -1
  151. package/dist/utils/process.js +1 -1
  152. package/dist/utils/prompt.js +1 -1
  153. package/dist/utils/spinner.js +1 -1
  154. package/dist/utils/sse-parser.js +1 -1
  155. package/dist/utils/string-utils.js +1 -1
  156. package/dist/utils/table-ref-parser.js +1 -1
  157. package/dist/utils/tdx-logger.js +1 -1
  158. package/dist/utils/version-check.js +1 -1
  159. package/package.json +1 -1
@@ -1 +1 @@
1
- function a119_0x54fc(_0x581a75,_0x320b6e){_0x581a75=_0x581a75-0xe9;const _0x75ee99=a119_0x75ee();let _0x54fc6e=_0x75ee99[_0x581a75];return _0x54fc6e;}const a119_0x2de80c=a119_0x54fc;(function(_0x24aa1f,_0x10eba9){const _0x428014=a119_0x54fc,_0x2bdc67=_0x24aa1f();while(!![]){try{const _0x4205ad=parseInt(_0x428014(0x16e))/0x1*(parseInt(_0x428014(0x1b4))/0x2)+parseInt(_0x428014(0x15c))/0x3+-parseInt(_0x428014(0xfe))/0x4*(parseInt(_0x428014(0x14c))/0x5)+-parseInt(_0x428014(0x14d))/0x6*(parseInt(_0x428014(0x15e))/0x7)+parseInt(_0x428014(0x1b3))/0x8*(parseInt(_0x428014(0x1c8))/0x9)+parseInt(_0x428014(0x19f))/0xa+-parseInt(_0x428014(0xfd))/0xb;if(_0x4205ad===_0x10eba9)break;else _0x2bdc67['push'](_0x2bdc67['shift']());}catch(_0x4b9c1c){_0x2bdc67['push'](_0x2bdc67['shift']());}}}(a119_0x75ee,0x33b36));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a119_0x2de80c(0x13f);export function createPendingSegmentId(_0x391e4d){return''+PENDING_SEGMENT_PREFIX+_0x391e4d+'__';}export function isPendingSegmentId(_0x4b02ff){const _0x17c104=a119_0x2de80c;return _0x4b02ff[_0x17c104(0x141)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5d625c){const _0x4f34c7=a119_0x2de80c;return _0x5d625c[_0x4f34c7(0x195)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x338c3d){return''+PENDING_ACTIVATION_PREFIX+_0x338c3d+'__';}export function isPendingActivationId(_0x1c76b9){const _0x44a0af=a119_0x2de80c;return _0x1c76b9[_0x44a0af(0x141)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x176463){const _0x26fac9=a119_0x2de80c;return _0x176463[_0x26fac9(0x195)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x987ad8,_0x421c13){const _0x137b0f=a119_0x2de80c,_0x4136f5=_0x987ad8+'::'+(_0x421c13[_0x137b0f(0x196)]()||'segment'),_0x1ff9a8=createHash(_0x137b0f(0x11e))[_0x137b0f(0x1c9)](_0x4136f5)[_0x137b0f(0x13b)]('hex')[_0x137b0f(0x18f)](0x0,0xc);return'journey_entry_criteria_'+_0x1ff9a8;}export function ensureJourneyDefaults(_0x857378){const _0x359d84=a119_0x2de80c;!_0x857378[_0x359d84(0x16d)]&&(_0x857378[_0x359d84(0x16d)]=''),!_0x857378[_0x359d84(0x117)]&&(_0x857378['state']='draft');}export function resolveTDFolderPath(_0x39616e,_0x20279d,_0x552529){const _0x33f2df=a119_0x2de80c;if(!_0x20279d)return _0x39616e;if(_0x39616e===_0x552529||_0x39616e[_0x33f2df(0x141)](_0x552529+'/'))return _0x39616e;return _0x39616e?_0x552529+'/'+_0x39616e:_0x552529;}export function addFoldersToCreate(_0x10a0aa,_0x13beb3,_0x4c3b63){const _0x3e8909=a119_0x2de80c;if(!_0x10a0aa)return;if(_0x13beb3[_0x3e8909(0x1be)](_0x10a0aa))return;const _0x52b819=_0x10a0aa['split']('/');let _0x218fda='';for(const _0x5672dd of _0x52b819){_0x218fda=_0x218fda?_0x218fda+'/'+_0x5672dd:_0x5672dd,!_0x13beb3[_0x3e8909(0x1be)](_0x218fda)&&_0x4c3b63['add'](_0x218fda);}}import*as a119_0x355cd7 from'yaml';import{readFileSync}from'fs';import a119_0x41fba8 from'path';import{isJourneyDef,parseYamlString as a119_0x56b82d,toYamlString as a119_0x2488fd,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(_0x2b4ddc){const _0x5437b2=a119_0x2de80c;if(Array[_0x5437b2(0x162)](_0x2b4ddc))return'['+_0x2b4ddc[_0x5437b2(0x15f)](_0x43bd2f=>stableStringify(_0x43bd2f))[_0x5437b2(0x168)](',')+']';if(_0x2b4ddc&&typeof _0x2b4ddc===_0x5437b2(0x177)){const _0x108115=_0x2b4ddc,_0x28ec13=Object[_0x5437b2(0x15b)](_0x108115)[_0x5437b2(0x172)](),_0x5854de=_0x28ec13[_0x5437b2(0x15f)](_0x475b0f=>'\x22'+_0x475b0f+'\x22:'+stableStringify(_0x108115[_0x475b0f]));return'{'+_0x5854de[_0x5437b2(0x168)](',')+'}';}const _0x230336=JSON['stringify'](_0x2b4ddc);return _0x230336===undefined?'null':_0x230336;}function activationSignature(_0x5914a2){const _0x5b61c0=a119_0x2de80c,_0x4b601f={'connection':_0x5914a2[_0x5b61c0(0x143)],..._0x5914a2[_0x5b61c0(0x1ad)]!==undefined&&{'all_columns':_0x5914a2[_0x5b61c0(0x1ad)]},..._0x5914a2['columns']!==undefined&&{'columns':_0x5914a2[_0x5b61c0(0x192)]},..._0x5914a2[_0x5b61c0(0x101)]!==undefined&&{'behavior':_0x5914a2[_0x5b61c0(0x101)]},..._0x5914a2[_0x5b61c0(0x1c1)]!==undefined&&{'schedule':_0x5914a2[_0x5b61c0(0x1c1)]},..._0x5914a2[_0x5b61c0(0x149)]!==undefined&&{'notification':_0x5914a2['notification']},..._0x5914a2[_0x5b61c0(0x194)]!==undefined&&{'connector_config':_0x5914a2['connector_config']},..._0x5914a2[_0x5b61c0(0xef)]!==undefined&&{'activation_template_id':_0x5914a2['activation_template_id']}};return stableStringify(_0x4b601f);}export async function prepareSegmentFiles(_0x18e4da,_0x38fb0f,_0x491cdf,_0xa84989,_0x1b5143){const _0x4bdfb2=a119_0x2de80c,{activationDefToCreateRequest:_0x2f0605}=await import('./child-segment-yaml.js'),_0xf7fcce=[],_0x38e37f=new Set();for(const {yamlConfig:_0xe05e81,folderPath:_0x52edd3,sourcePath:_0x4236a4}of _0x18e4da){const _0x450954=resolveTDFolderPath(_0x52edd3,_0xa84989,_0x1b5143),_0x197591=_0x450954+':'+_0xe05e81['name'],_0x2fe2d6=_0x38fb0f[_0x4bdfb2(0x19e)][_0x4bdfb2(0x151)](_0x197591),_0x3c9d94=_0x2fe2d6?_0x38fb0f[_0x4bdfb2(0x170)][_0x4bdfb2(0x151)](_0x2fe2d6['id'])||[]:[];addFoldersToCreate(_0x450954,_0x38fb0f[_0x4bdfb2(0x1a1)],_0x38e37f);const _0x87253c=calculateActivationActions(_0xe05e81[_0x4bdfb2(0x126)]||[],_0x3c9d94,_0x38fb0f[_0x4bdfb2(0x1c3)],_0x38fb0f['connectionIdToNameMap']);for(const _0x452d34 of _0x87253c){(_0x452d34[_0x4bdfb2(0xff)]===_0x4bdfb2(0xfc)||_0x452d34[_0x4bdfb2(0xff)]===_0x4bdfb2(0x1c9))&&_0x452d34[_0x4bdfb2(0x193)]&&(_0x452d34[_0x4bdfb2(0x1ba)]=await _0x2f0605(_0x452d34['yamlActivation'],_0x491cdf));}const _0xd3349d=calculateSegmentDiff(_0xe05e81,_0x2fe2d6,_0x3c9d94,_0x38fb0f[_0x4bdfb2(0x1c3)],_0x38fb0f[_0x4bdfb2(0x110)]);_0xf7fcce[_0x4bdfb2(0x12d)]({'relativePath':_0xe05e81[_0x4bdfb2(0xf2)],'absolutePath':_0x4236a4,'yamlConfig':_0xe05e81,'folderPath':_0x450954,'existingSegment':_0x2fe2d6,'existingActivations':_0x3c9d94,'isNew':_0xd3349d[_0x4bdfb2(0x1b2)],'hasChanges':_0xd3349d[_0x4bdfb2(0x12a)],'diff':_0xd3349d['diff'],'activationActions':_0x87253c});}return{'segmentFiles':_0xf7fcce,'foldersToCreate':_0x38e37f};}export async function prepareJourneyFiles(_0xe7bffa,_0x2bf6b9,_0x3493d8,_0x4de677){const _0x33066c=a119_0x2de80c,_0x54f302=[],_0xc4aa02=new Set();for(const {yamlConfig:_0x58087e,folderPath:_0x7df99a,sourcePath:_0x2ece1f}of _0xe7bffa){const _0x38195d=resolveTDFolderPath(_0x7df99a,_0x3493d8,_0x4de677),_0x120576=_0x38195d+':'+_0x58087e['name'],_0x375611=_0x2bf6b9[_0x33066c(0x17b)][_0x33066c(0x151)](_0x120576);let _0x5efd72,_0xc0ae83;if(_0x375611&&_0x375611[_0x33066c(0x175)]>0x0){const _0x165122=buildLocalExpandedRuleMappings(_0x58087e),{createYamlContext:_0xe7e392,prefetchJourneySegments:_0x35bf3e}=createPushYamlContextForBundle(_0x2bf6b9[_0x33066c(0xe9)],_0x2bf6b9[_0x33066c(0x108)],_0x2bf6b9[_0x33066c(0x123)],_0x165122,_0x2bf6b9[_0x33066c(0x1c3)],_0x2bf6b9['connectionIdToNameMap'],_0x2bf6b9[_0x33066c(0x140)],_0x2bf6b9[_0x33066c(0x132)]);await _0x35bf3e(_0x375611['map'](_0x2aa867=>_0x2aa867['id']));const _0x10e707=hasMultipleVersions(_0x58087e),_0x39162c=async _0x458e9a=>{const _0x22b07b=_0x33066c,_0x16cebb=_0x2bf6b9[_0x22b07b(0x132)]?.['get'](_0x458e9a);if(_0x16cebb)return _0x16cebb;return _0x2bf6b9[_0x22b07b(0x1d0)]({'journeyId':_0x458e9a,'journeyName':_0x58087e[_0x22b07b(0xf2)],'isMultiVersion':_0x375611[_0x22b07b(0x175)]>0x1});};if(_0x10e707&&_0x375611[_0x33066c(0x175)]>0x1){const _0x18f332=[];for(const _0x4313f1 of _0x375611){const _0x432140=_0x4313f1[_0x33066c(0x112)]||0x1;_0x2bf6b9[_0x33066c(0x1cb)]?.[_0x33066c(0x1c9)](_0x33066c(0x12b)+_0x58087e['name']+'\x20v'+_0x432140);const _0x25d027=await _0x39162c(_0x4313f1['id']),_0x5cfe04=_0xe7e392(_0x4313f1['id']),_0x5e5589=await journeyResponseToDef(_0x25d027,_0x5cfe04);_0x18f332[_0x33066c(0x12d)]({'item':_0x4313f1,'yaml':_0x5e5589});}const _0x5a8140=buildLocalRuleToNameMappingFromJourney(_0x58087e);_0xc0ae83=buildMergedJourneyDef(_0x18f332,_0x5a8140);const _0x584599=Math['max'](..._0x18f332[_0x33066c(0x15f)](_0x5e12b8=>_0x5e12b8[_0x33066c(0x1a8)][_0x33066c(0x112)]||0x0)),_0x4a185e=_0x375611[_0x33066c(0x1aa)](_0x164587=>(_0x164587['versionNumber']||0x0)===_0x584599);_0x4a185e&&(_0x2bf6b9[_0x33066c(0x1cb)]?.[_0x33066c(0x1c9)](_0x33066c(0x12b)+_0x58087e[_0x33066c(0xf2)]+'\x20v'+_0x584599),_0x5efd72=await _0x39162c(_0x4a185e['id']));}else{const _0x57b24f=_0x375611[_0x375611['length']-0x1];_0x2bf6b9[_0x33066c(0x1cb)]?.[_0x33066c(0x1c9)](_0x33066c(0x12b)+_0x58087e[_0x33066c(0xf2)]),_0x5efd72=await _0x39162c(_0x57b24f['id']);const _0x569503=_0xe7e392(_0x57b24f['id']),_0x1fe02e=await journeyResponseToDef(_0x5efd72,_0x569503),_0x3a98d7=buildLocalRuleToNameMappingFromJourney(_0x58087e);_0xc0ae83=buildMergedJourneyDef([{'item':_0x57b24f,'yaml':_0x1fe02e}],_0x3a98d7);}}addFoldersToCreate(_0x38195d,_0x2bf6b9[_0x33066c(0x1a1)],_0xc4aa02);const _0x78634d=calculateJourneyDiff(_0x58087e,_0xc0ae83);_0x54f302[_0x33066c(0x12d)]({'relativePath':_0x58087e['name'],'absolutePath':_0x2ece1f,'yamlConfig':_0x58087e,'folderPath':_0x38195d,'existingJourney':_0x5efd72,'isNew':_0x78634d[_0x33066c(0x1b2)],'hasChanges':_0x78634d[_0x33066c(0x12a)],'diff':_0x78634d[_0x33066c(0xf9)]});}return{'journeyFiles':_0x54f302,'foldersToCreate':_0xc4aa02};}export function calculateActivationActions(_0x45b5f4,_0x1e097d,_0x4e26f7,_0x2b61b0){const _0x41f6f6=a119_0x2de80c,_0x2830a6=[],_0x349af3=new Map();for(const _0x89e840 of _0x1e097d){_0x349af3[_0x41f6f6(0x17d)](_0x89e840[_0x41f6f6(0xf2)],_0x89e840);}const _0x5f3319=new Map();for(const _0x6a337c of _0x45b5f4){_0x5f3319[_0x41f6f6(0x17d)](_0x6a337c[_0x41f6f6(0xf2)],_0x6a337c);}for(const _0x20c5e4 of _0x45b5f4){const _0x3eb232=_0x349af3[_0x41f6f6(0x151)](_0x20c5e4[_0x41f6f6(0xf2)]);if(!_0x3eb232)_0x2830a6[_0x41f6f6(0x12d)]({'type':_0x41f6f6(0xfc),'name':_0x20c5e4[_0x41f6f6(0xf2)],'yamlActivation':_0x20c5e4});else{const _0x33cdbb=activationResponseToDef(_0x3eb232,_0x4e26f7,_0x2b61b0),_0x3d6c9f=a119_0x355cd7[_0x41f6f6(0x13e)](_0x33cdbb),_0x46aeda=a119_0x355cd7[_0x41f6f6(0x13e)](_0x20c5e4);_0x3d6c9f!==_0x46aeda&&_0x2830a6['push']({'type':_0x41f6f6(0x1c9),'name':_0x20c5e4[_0x41f6f6(0xf2)],'yamlActivation':_0x20c5e4,'existingActivation':_0x3eb232});}}for(const _0x7f7164 of _0x1e097d){!_0x5f3319[_0x41f6f6(0x1be)](_0x7f7164[_0x41f6f6(0xf2)])&&_0x2830a6[_0x41f6f6(0x12d)]({'type':_0x41f6f6(0x1cc),'name':_0x7f7164[_0x41f6f6(0xf2)],'existingActivation':_0x7f7164});}return _0x2830a6;}export function calculateSegmentDiff(_0x497d0c,_0xdb7deb,_0x470980,_0x18baca,_0x1ad834){const _0x560ca3=segmentToYamlString(_0x497d0c);if(_0xdb7deb){const _0x37bc96=segmentWithActivationsToYaml(_0xdb7deb,_0x470980,undefined,_0x18baca,_0x1ad834),_0x3b5b1d=segmentToYamlString(_0x37bc96),_0xd2d6e1=generateDiff(_0x3b5b1d,_0x560ca3),_0x5954cc=hasChanges(_0xd2d6e1);return{'isNew':![],'hasChanges':_0x5954cc,'diff':_0x5954cc?formatDiffWithColors(_0xd2d6e1):undefined};}const _0x5152b1=generateDiff('',_0x560ca3);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5152b1)};}export function calculateJourneyDiff(_0x5128ad,_0x3d5b46){const _0x4a8273=normalizeJourneyDef(_0x5128ad,_0x5128ad),_0x107868=a119_0x2488fd(_0x4a8273);if(_0x3d5b46){const _0x777907=normalizeJourneyDef(_0x3d5b46,_0x5128ad),_0x40e3ab=a119_0x2488fd(_0x777907),_0x2123dd=generateDiff(_0x40e3ab,_0x107868),_0xb1c51b=hasChanges(_0x2123dd);return{'isNew':![],'hasChanges':_0xb1c51b,'diff':_0xb1c51b?formatDiffWithColors(_0x2123dd):undefined};}const _0x1f4839=generateDiff('',_0x107868);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1f4839)};}export function findSegmentsToDelete(_0x32255d,_0x1f6672,_0x55c876,_0x565393,_0x3a4160){const _0x4f579e=a119_0x2de80c,_0x27cd85=new Set();for(const {yamlConfig:_0x4e7b54,folderPath:_0x47ecfa}of _0x1f6672){_0x27cd85[_0x4f579e(0x147)](_0x47ecfa+':'+_0x4e7b54[_0x4f579e(0xf2)]);}return _0x32255d['filter'](_0x154f62=>{const _0x389d41=_0x4f579e,_0x1da677=_0x154f62[_0x389d41(0xee)]?_0x55c876[_0x389d41(0x151)](_0x154f62[_0x389d41(0xee)][_0x389d41(0x122)]())||'':'',_0x31f733=_0x1da677+':'+_0x154f62[_0x389d41(0xf2)];if(_0x27cd85[_0x389d41(0x1be)](_0x31f733))return![];if(_0x3a4160)return _0x1da677===_0x565393||_0x1da677[_0x389d41(0x141)](_0x565393+'/');return!![];});}export function findJourneysToDelete(_0x49f919,_0x415fa2,_0x5dc290,_0x4da325,_0x360409){const _0x5601ad=a119_0x2de80c,_0x4b3a69=new Set();for(const {yamlConfig:_0x2d8eb0,folderPath:_0x2a3256}of _0x415fa2){_0x4b3a69[_0x5601ad(0x147)](_0x2a3256+':'+_0x2d8eb0[_0x5601ad(0xf2)]);}return _0x49f919[_0x5601ad(0x1b7)](_0x1a192f=>{const _0x4dd26e=_0x5601ad,_0x4aa193=_0x1a192f[_0x4dd26e(0xf6)]?_0x5dc290[_0x4dd26e(0x151)](_0x1a192f[_0x4dd26e(0xf6)])||'':'',_0x473276=_0x4aa193+':'+_0x1a192f['journeyBundleName'];if(_0x4b3a69[_0x4dd26e(0x1be)](_0x473276))return![];if(_0x360409)return _0x4aa193===_0x4da325||_0x4aa193[_0x4dd26e(0x141)](_0x4da325+'/');return!![];});}export function buildSegmentLookupMap(_0x12ee8b,_0x59356b){const _0x4901f9=a119_0x2de80c,_0x5de123=new Map();for(const _0x50a1b0 of _0x12ee8b){const _0x4ae52e=_0x50a1b0['segmentFolderId']?_0x59356b[_0x4901f9(0x151)](_0x50a1b0[_0x4901f9(0xee)][_0x4901f9(0x122)]())||'':'',_0x406268=_0x4ae52e+':'+_0x50a1b0['name'];_0x5de123[_0x4901f9(0x17d)](_0x406268,_0x50a1b0);}return _0x5de123;}export function buildSegmentNameToIdMap(_0x39e0d5){const _0x25ad84=a119_0x2de80c,_0x27b1d0=new Map();for(const _0xcad19 of _0x39e0d5){_0x27b1d0[_0x25ad84(0x17d)](_0xcad19[_0x25ad84(0xf2)],_0xcad19['id']);}return _0x27b1d0;}export function buildJourneyBundleLookupMap(_0x544f25,_0x23b6de){const _0x411fa4=a119_0x2de80c,_0x4f747d=new Map();for(const _0x3ed5c9 of _0x544f25){const _0x53120e=_0x3ed5c9['folderId']?_0x23b6de[_0x411fa4(0x151)](_0x3ed5c9[_0x411fa4(0xf6)])||'':'',_0x4634cb=_0x53120e+':'+_0x3ed5c9[_0x411fa4(0x164)];!_0x4f747d[_0x411fa4(0x1be)](_0x4634cb)&&_0x4f747d[_0x411fa4(0x17d)](_0x4634cb,[]),_0x4f747d[_0x411fa4(0x151)](_0x4634cb)['push'](_0x3ed5c9);}for(const _0x575005 of _0x4f747d[_0x411fa4(0x125)]()){_0x575005[_0x411fa4(0x172)]((_0x430993,_0x5c046a)=>(_0x430993[_0x411fa4(0x112)]||0x0)-(_0x5c046a[_0x411fa4(0x112)]||0x0));}return _0x4f747d;}export function collectFoldersToCreate(_0x16823d,_0x2883f4){const _0x288767=a119_0x2de80c,_0x4b4090=new Set();for(const _0x7bfc2e of _0x16823d){if(!_0x7bfc2e)continue;if(_0x2883f4[_0x288767(0x1be)](_0x7bfc2e))continue;const _0x20eb15=_0x7bfc2e['split']('/');let _0x45cae1='';for(const _0x457a68 of _0x20eb15){_0x45cae1=_0x45cae1?_0x45cae1+'/'+_0x457a68:_0x457a68,!_0x2883f4[_0x288767(0x1be)](_0x45cae1)&&_0x4b4090[_0x288767(0x147)](_0x45cae1);}}return _0x4b4090;}export function parseAndClassifyYamlFiles(_0x50327c,_0x1e3c5a,_0x3dc37c){const _0x215324=a119_0x2de80c,_0x3c11dd=[],_0x48d85a=[];for(const _0x10e049 of _0x50327c){const _0x43008a=a119_0x41fba8[_0x215324(0x163)](_0x1e3c5a,a119_0x41fba8[_0x215324(0x1c6)](_0x10e049)),_0x308d5d=_0x43008a==='.'?'':_0x43008a,_0x4b7cc1=readFileSync(_0x10e049,_0x215324(0x11d)),_0x4bc756=a119_0x355cd7[_0x215324(0x102)](_0x4b7cc1);if(isJourneyDef(_0x4bc756)){const _0x2e1a30=a119_0x56b82d(_0x4b7cc1);_0x48d85a['push']({'yamlConfig':_0x2e1a30,'folderPath':_0x308d5d,'sourcePath':_0x10e049});}else{if(!_0x3dc37c?.[_0x215324(0x15d)]){const _0x3f10e1=parseSegmentYamlFile(_0x4b7cc1),_0x4f70c2=normalizeChildSegmentYaml(_0x3f10e1);_0x3c11dd[_0x215324(0x12d)]({'yamlConfig':_0x4f70c2,'folderPath':_0x308d5d,'sourcePath':_0x10e049});}}}return{'segments':_0x3c11dd,'journeys':_0x48d85a};}export function validateParsedFiles(_0x2f9a45,_0x386e62){const _0x11f94c=a119_0x2de80c,_0x5adf9e=[];for(const {yamlConfig:_0x2794af,sourcePath:_0x5da85e}of _0x2f9a45[_0x11f94c(0x14f)]){const _0xcca8a8=readFileSync(_0x5da85e,_0x11f94c(0x11d)),_0x36ec1e=a119_0x355cd7[_0x11f94c(0x107)](_0xcca8a8),_0x299acb=validateSegmentDef(_0x2794af,{'source':_0xcca8a8,'document':_0x36ec1e});if(!_0x299acb[_0x11f94c(0x137)]){const _0x4aeb7d=a119_0x41fba8[_0x11f94c(0x163)](_0x386e62,_0x5da85e);_0x5adf9e[_0x11f94c(0x12d)]({'filePath':_0x4aeb7d,'source':_0xcca8a8,'result':_0x299acb,'isJourney':![]});}}for(const {yamlConfig:_0x560723,sourcePath:_0x1795f5}of _0x2f9a45['journeys']){const _0x268f59=readFileSync(_0x1795f5,_0x11f94c(0x11d)),_0x5ac45f=a119_0x355cd7[_0x11f94c(0x107)](_0x268f59),_0x106eaf=validateJourneyDef(_0x560723,{'source':_0x268f59,'document':_0x5ac45f});if(!_0x106eaf['valid']){const _0x2952ef=a119_0x41fba8[_0x11f94c(0x163)](_0x386e62,_0x1795f5);_0x5adf9e[_0x11f94c(0x12d)]({'filePath':_0x2952ef,'source':_0x268f59,'result':_0x106eaf,'isJourney':!![]});}}return _0x5adf9e;}export function formatValidationErrors(_0x1be55f){const _0x234cfa=a119_0x2de80c,_0x27f719=[];for(const {filePath:_0x346bcb,source:_0x28ee70,result:_0x195379,isJourney:_0x18bcf0}of _0x1be55f){const _0x250756=_0x18bcf0?_0x234cfa(0x109):'segment';_0x27f719[_0x234cfa(0x12d)]('\x0a'+_0x346bcb+'\x20('+_0x250756+_0x234cfa(0x124)+_0x195379['errors'][_0x234cfa(0x175)]+_0x234cfa(0x199)),_0x27f719[_0x234cfa(0x12d)](formatValidationResult(_0x195379,_0x28ee70,_0x346bcb));}return _0x27f719[_0x234cfa(0x168)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x45dfcd){const _0x4bebc5=a119_0x2de80c,_0x44dedc=new Set(),_0x5a66d0=new Map(),_0x48acd3=collectSegmentUsageCounts(_0x45dfcd);if(_0x45dfcd['segments'])for(const [_0x24e6c9,_0x29efc7]of Object[_0x4bebc5(0x14b)](_0x45dfcd[_0x4bebc5(0x14f)])){_0x44dedc[_0x4bebc5(0x147)](_0x24e6c9);if(_0x29efc7[_0x4bebc5(0x148)]){const _0x53bce7=yamlRuleToApi(_0x29efc7['rule']),_0xc8196c=apiRuleToYaml(_0x53bce7);_0x5a66d0[_0x4bebc5(0x17d)](_0x24e6c9,_0xc8196c);}}const _0x447aa2=new Map();let _0x22b536=0x0;for(const [_0x35217d,_0x1b9690]of _0x5a66d0){const _0x279d1d=serializeExpandedRule(_0x1b9690,_0x5a66d0),_0x5a8382=_0x447aa2[_0x4bebc5(0x151)](_0x279d1d)||[];_0x5a8382['push']({'name':_0x35217d,'index':_0x22b536}),_0x447aa2['set'](_0x279d1d,_0x5a8382),_0x22b536++;}const _0x2f6d4f=new Map();for(const [_0x5c7035,_0x3b0f7c]of _0x447aa2){const _0x5661ca=_0x3b0f7c[_0x4bebc5(0x18f)]()[_0x4bebc5(0x172)]((_0x26d404,_0x5928be)=>{const _0x4078d4=_0x4bebc5,_0x3c5d96=_0x48acd3[_0x4078d4(0x151)](_0x26d404[_0x4078d4(0xf2)])||0x0,_0x3ea8e2=_0x48acd3[_0x4078d4(0x151)](_0x5928be[_0x4078d4(0xf2)])||0x0;if(_0x3c5d96!==_0x3ea8e2)return _0x3ea8e2-_0x3c5d96;return _0x26d404[_0x4078d4(0x1cf)]-_0x5928be[_0x4078d4(0x1cf)];})[_0x4bebc5(0x15f)](_0x8d3963=>_0x8d3963['name']),_0x1dbc77=[];for(const _0x3211bc of _0x5661ca){const _0x4e2a63=_0x48acd3[_0x4bebc5(0x151)](_0x3211bc)||0x0,_0x457fc9=Math[_0x4bebc5(0x16f)](_0x4e2a63,0x1);for(let _0x38fd68=0x0;_0x38fd68<_0x457fc9;_0x38fd68++){_0x1dbc77[_0x4bebc5(0x12d)](_0x3211bc);}}_0x2f6d4f['set'](_0x5c7035,_0x1dbc77);}return{'existingLocalSegmentNames':_0x44dedc,'localSegmentRules':_0x5a66d0,'localExpandedRuleToNames':_0x2f6d4f};}async function buildServerSegmentRuleMap(_0x304fca,_0x2655f6,_0x4b5f4e,_0x75b01e){const _0x47bb61=new Map(),_0x519392=new Set(),_0x130b9b=async _0x3b9871=>{const _0x29de29=a119_0x54fc;if(_0x519392[_0x29de29(0x1be)](_0x3b9871))return;_0x519392[_0x29de29(0x147)](_0x3b9871);let _0x3faf0b=_0x4b5f4e[_0x29de29(0x1aa)](_0x3b428e=>_0x3b428e['id']===_0x3b9871);if(!_0x3faf0b)try{_0x3faf0b=await _0x304fca[_0x29de29(0x17f)]['getSegment'](_0x2655f6,_0x3b9871);}catch{return;}if(!_0x3faf0b?.[_0x29de29(0x148)])return;const _0x1881d1=apiRuleToYaml(_0x3faf0b[_0x29de29(0x148)]);_0x47bb61['set'](_0x3b9871,_0x1881d1);const _0x31ff68=collectSegmentRefsFromRule(_0x1881d1);for(const _0x3389b3 of _0x31ff68){await _0x130b9b(_0x3389b3);}};for(const _0x42a77a of _0x75b01e){await _0x130b9b(_0x42a77a);}return _0x47bb61;}export function createSegmentIdResolver(_0x305651,_0x520eae){return async _0x4a4622=>{const _0x4fda21=a119_0x54fc,_0x277ad7=_0x305651[_0x4fda21(0x151)](_0x4a4622);if(!_0x277ad7)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x4a4622+_0x4fda21(0x174)+_0x520eae+'\x27)');return _0x277ad7;};}export function extractRootFolderId(_0x307a26){const _0x4086a2=a119_0x2de80c;return _0x307a26[_0x4086a2(0x18e)]?.[_0x4086a2(0x1ac)]?.[_0x4086a2(0x1b0)]?.['id']||_0x307a26[_0x4086a2(0x18e)]?.[_0x4086a2(0x166)]?.[_0x4086a2(0x1b0)]?.['id'];}export function buildConnectionMaps(_0x5a52be){const _0x2f530b=a119_0x2de80c,_0x32d864=new Map(),_0x16c1bc=new Map(),_0x23cc9d=new Map();for(const _0x1c7e0f of _0x5a52be){_0x32d864[_0x2f530b(0x17d)](_0x1c7e0f['name'],parseInt(_0x1c7e0f['id'],0xa)),_0x16c1bc['set'](_0x1c7e0f['id'],_0x1c7e0f[_0x2f530b(0xf2)]),_0x23cc9d[_0x2f530b(0x17d)](_0x1c7e0f[_0x2f530b(0xf2)],_0x1c7e0f[_0x2f530b(0xff)]);}return{'nameToId':_0x32d864,'idToName':_0x16c1bc,'nameToType':_0x23cc9d};}export function calculatePushStats(_0x4b394f,_0x3f78dd,_0x238686,_0x43e96b,_0x120515,_0x568dc7,_0x4b906b){const _0x2d90f9=a119_0x2de80c,_0x41a821=_0x4b394f[_0x2d90f9(0x1b7)](_0x6ce3c3=>_0x6ce3c3['isNew']),_0x4945b1=_0x4b394f['filter'](_0x1c05c3=>!_0x1c05c3[_0x2d90f9(0x1b2)]&&_0x1c05c3[_0x2d90f9(0x12a)]),_0x9ba15a=_0x4b394f[_0x2d90f9(0x1b7)](_0x49702e=>!_0x49702e[_0x2d90f9(0x1b2)]&&!_0x49702e['hasChanges']),_0x5824f0=_0x568dc7?_0x43e96b:[],_0x5ceb82=_0x3f78dd[_0x2d90f9(0x1b7)](_0x2ec34e=>_0x2ec34e[_0x2d90f9(0x1b2)]),_0x5ef063=_0x3f78dd[_0x2d90f9(0x1b7)](_0x27331a=>!_0x27331a[_0x2d90f9(0x1b2)]&&_0x27331a[_0x2d90f9(0x12a)]),_0x42808a=_0x3f78dd['filter'](_0x7f47c8=>!_0x7f47c8[_0x2d90f9(0x1b2)]&&!_0x7f47c8[_0x2d90f9(0x12a)]),_0x2a98fe=_0x568dc7?_0x120515:[],_0x21d0f1=_0x4b394f[_0x2d90f9(0x189)](_0x118f97=>_0x118f97[_0x2d90f9(0x17e)]),_0xc89922=_0x21d0f1[_0x2d90f9(0x1b7)](_0x32e48a=>_0x32e48a[_0x2d90f9(0xff)]==='create'),_0x21c13a=_0x21d0f1[_0x2d90f9(0x1b7)](_0x3b0a25=>_0x3b0a25[_0x2d90f9(0xff)]==='update'),_0x21f2c4=_0x21d0f1['filter'](_0x2cd5ba=>_0x2cd5ba[_0x2d90f9(0xff)]===_0x2d90f9(0x1cc)),_0x27a4fc=Array[_0x2d90f9(0x150)](_0x238686)[_0x2d90f9(0x172)](),_0x3aab41=_0x4b906b?![]:_0x41a821[_0x2d90f9(0x175)]>0x0||_0x4945b1[_0x2d90f9(0x175)]>0x0||_0x5824f0[_0x2d90f9(0x175)]>0x0,_0x3def70=_0x5ceb82[_0x2d90f9(0x175)]>0x0||_0x5ef063[_0x2d90f9(0x175)]>0x0||_0x2a98fe[_0x2d90f9(0x175)]>0x0,_0x452e42=_0x4b906b?![]:_0x21d0f1[_0x2d90f9(0x175)]>0x0,_0x43d6b8=_0x27a4fc[_0x2d90f9(0x175)]>0x0;return{'segments':{'new':_0x41a821,'changed':_0x4945b1,'unchanged':_0x9ba15a,'toDelete':_0x5824f0},'journeys':{'new':_0x5ceb82,'changed':_0x5ef063,'unchanged':_0x42808a,'toDelete':_0x2a98fe},'activations':{'all':_0x21d0f1,'toCreate':_0xc89922,'toUpdate':_0x21c13a,'toDelete':_0x21f2c4},'folders':{'toCreate':_0x27a4fc},'counts':{'segments':{'new':_0x41a821[_0x2d90f9(0x175)],'changed':_0x4945b1[_0x2d90f9(0x175)],'unchanged':_0x9ba15a[_0x2d90f9(0x175)],'toDelete':_0x5824f0[_0x2d90f9(0x175)]},'journeys':{'new':_0x5ceb82[_0x2d90f9(0x175)],'changed':_0x5ef063['length'],'unchanged':_0x42808a['length'],'toDelete':_0x2a98fe[_0x2d90f9(0x175)]},'activations':{'create':_0xc89922[_0x2d90f9(0x175)],'update':_0x21c13a[_0x2d90f9(0x175)],'delete':_0x21f2c4[_0x2d90f9(0x175)]},'folders':_0x27a4fc[_0x2d90f9(0x175)]},'hasChanges':_0x3aab41||_0x3def70||_0x452e42||_0x43d6b8};}export async function buildPushExecutionContext(_0x36fd80,_0x15231d,_0x33550c,_0x4fe223,_0x716085,_0x3a58cd){const _0x2098b0=a119_0x2de80c,_0x127468=extractRootFolderId(_0x33550c),{pathToId:_0x572686,idToPath:_0x1af974}=buildFolderMaps(_0x716085),_0x20806a=buildSegmentNameToIdMap(_0x4fe223),_0x3fd6c6=new Map(),{batchAsync:_0x7a1500}=await import('../../utils/async.js'),[_0x37d4e6,_0x34b195]=await Promise[_0x2098b0(0x10f)]([_0x36fd80['user'][_0x2098b0(0x15a)](),_0x36fd80[_0x2098b0(0x143)][_0x2098b0(0x1af)](),((async()=>{!_0x3a58cd&&_0x4fe223['length']>0x0&&await _0x7a1500(_0x4fe223,async _0x1b9f4d=>{const _0x306bc0=a119_0x54fc,_0x4b0dbf=await _0x36fd80['segment'][_0x306bc0(0x1a0)](_0x15231d,_0x1b9f4d['id']);_0x3fd6c6[_0x306bc0(0x17d)](_0x1b9f4d['id'],_0x4b0dbf);});})())]),{emailToId:_0x48701d,idToEmail:_0x4b839d}=_0x37d4e6,_0x5ea3b9=buildConnectionMaps(_0x34b195);return{'rootFolderId':_0x127468,'folderPathToId':_0x572686,'folderIdToPath':_0x1af974,'segmentNameToId':_0x20806a,'activationsBySegmentId':_0x3fd6c6,'emailToIdMap':_0x48701d,'idToEmailMap':_0x4b839d,'connectionNameToIdMap':_0x5ea3b9[_0x2098b0(0x12f)],'connectionIdToNameMap':_0x5ea3b9[_0x2098b0(0x10c)],'connectionNameToTypeMap':_0x5ea3b9[_0x2098b0(0x197)]};}function a119_0x75ee(){const _0x21a7b9=['journeyActivationNameToId','schedule','Stage\x20\x27','idToEmailMap','updateSegmentById','getSegment','dirname','Journey\x20\x27','879057gvJfRz','update','createActivation','progress','delete','goal','includes','index','fetchJourney','deps','Failed\x20to\x20','onProgress','absolutePath','createFolder','segmentFolderId','activation_template_id','attributes','Segment\x20not\x20found:\x20','name','ACTIVATION_SYNTAX_ERROR','embedded_segment_created','toLowerCase','folderId','DecisionPoint','\x20activation\x20\x27','diff','deleted','Deleted\x20activation\x20\x27','create','396737Obuehc','39988aorqpl','type','logWarning','behavior','parse','action','existingActivation','Deleted\x20segment\x20\x27','\x27\x20from\x20file:\x20','parseDocument','parentId','journey','Activation\x20not\x20found:\x20','embedded_activation_created','idToName','Updated\x20segment\x20\x27','segment_updating','all','connectionIdToNameMap','localSegmentRules','versionNumber','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','../../utils/async.js','NOT_FOUND','Updated\x20journey\x20\x27','state','journeyActivationStepId','stages','journeyId','journey_created','Creating\x20segment\x20\x27','utf-8','sha1','withProgress','milestone','segmentId','toString','existingSegments','):\x20','values','activations','activationContext','\x20segment\x20from\x20file:\x20','Deleting\x20activation\x20\x27','hasChanges','Fetching\x20','updated','push','activation_created','nameToId','Activation','Creating\x20folder\x20\x27','journeyById','results','\x27\x20milestone','createdSegmentId','JOURNEY_SYNTAX_ERROR','valid','\x27\x20for\x20','journeys','resolveSegment','digest','folderPath','steps','stringify','__pending_act_','activationStepsById','startsWith','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','connection','rootFolderId','WaitStep','activationParams','add','rule','notification','segment_deleted','entries','195MbkGUv','6qYoFhA','goal\x20criteria','segments','from','get','unchanged','logDeleted','updateActivation','decision_point','split','embeddedSegmentNameToId','Created\x20folder\x20\x27','waitCondition','buildUserMaps','keys','848364PcjXqu','skipSegments','2521099GMZegE','map','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','kind','isArray','relative','journeyBundleName','segment_created','parentFolder','Creating\x20activation\x20\x27','join','getActivation','stage\x20\x27','createJourneySegment','./child-segment-yaml.js','description','4783UnKcqT','max','activationsBySegmentId','\x27\x20wait\x20condition','sort','existingSegment','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','length','Created\x20journey\x20\x27','object','journey_updated','journey_updating','Updating\x20activation\x20\x27','journeyBundlesByFolderAndName','INTERNAL','set','activationActions','segment','entry_criteria','getJourney','folder_created','createdSegmentIds','\x20(referenced\x20in\x20journey\x20','logInfo','activation_deleted','JOURNEY_UPDATE_ERROR','size','flatMap','Updated\x20activation\x20\x27','segmentNameToId','verbose','Entry\x20criteria:\x20','relationships','slice','message','activation_updated','columns','yamlActivation','connector_config','replace','trim','nameToType','exitCriterias','\x20error(s)','created','segment_updated','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','branches','segmentByFolderAndName','3332020FVcvYa','listActivations','folderPathToId','embedded_activation_creating','yamlConfig','logSuccess','activation_','createSegment','Updating\x20segment\x20\x27','item','\x0a\x20\x20','find','effectiveFolderId','parentSegmentFolder','all_columns','entryCriteria','list','data','journeyStages','isNew','16znUKpL','78jxLdmS','activation_deleting','./journey-yaml.js','filter','SEGMENT_UPDATE_ERROR','segment_deleting','validatedRequest','folder','existingJourney','\x27...','has','ACTIVATION_UPDATE_ERROR'];a119_0x75ee=function(){return _0x21a7b9;};return a119_0x75ee();}export function createPushYamlContextForBundle(_0x1137d9,_0x2a37e1,_0x54b16d,_0x31971d,_0x13a1a8,_0xed43d6,_0x2304f1,_0x2b57eb){const {existingLocalSegmentNames:_0x47cdd0,localExpandedRuleToNames:_0x91e719}=_0x31971d,_0x5d4a06=new Set(),_0x4d51ec=new Map(),_0x38cd3b=new Map(),_0x42d8e1=new Map(),_0xe3ebdd=createJumpTargetCache(),_0x21d51a=new Map(),_0x5a7ea8=new Map(),_0x206f7a=new Set();let _0x484840;const _0x10f4ce=_0x5098a4=>{const _0x45bd93={'resolveSegment':async _0x2f6960=>{const _0x33f26a=a119_0x54fc,_0x3f10c0=_0x42d8e1[_0x33f26a(0x151)](_0x2f6960);if(_0x3f10c0!==undefined)return{'name':_0x3f10c0,'isJourneyLocal':!![]};try{let _0x5156c0=_0x54b16d[_0x33f26a(0x1aa)](_0x347030=>_0x347030['id']===_0x2f6960);!_0x5156c0&&(_0x5156c0=await _0x1137d9[_0x33f26a(0x17f)]['getSegment'](_0x2a37e1,_0x2f6960));const _0x2cea1c=generateJourneyLocalName(_0x5156c0[_0x33f26a(0xf2)]),_0x1555d0=_0x5156c0[_0x33f26a(0x161)]===SEGMENT_KIND_JOURNEY&&_0x2cea1c!==undefined;let _0x20edb1=_0x5156c0['name'],_0x2e5319;if(_0x1555d0&&_0x5156c0[_0x33f26a(0x148)]){const _0x31bca5=apiRuleToYaml(_0x5156c0[_0x33f26a(0x148)]);_0x5a7ea8[_0x33f26a(0x17d)](_0x2f6960,_0x31bca5);const _0x175e8c=async _0x344756=>{const _0x14c433=_0x33f26a,_0x201e56=collectSegmentRefsFromRule(_0x344756);for(const _0x1036df of _0x201e56){if(!_0x5a7ea8[_0x14c433(0x1be)](_0x1036df))try{const _0x19a4a5=await _0x1137d9[_0x14c433(0x17f)]['getSegment'](_0x2a37e1,_0x1036df);if(_0x19a4a5?.[_0x14c433(0x148)]){const _0x3db61d=apiRuleToYaml(_0x19a4a5[_0x14c433(0x148)]);_0x5a7ea8[_0x14c433(0x17d)](_0x1036df,_0x3db61d),await _0x175e8c(_0x3db61d);}}catch{}}};await _0x175e8c(_0x31bca5);const _0x9b4af2=serializeExpandedRule(_0x31bca5,_0x5a7ea8),_0x236b13=_0x91e719[_0x33f26a(0x151)](_0x9b4af2);if(_0x236b13&&_0x236b13['length']>0x0){const _0x36be78=_0x4d51ec[_0x33f26a(0x151)](_0x9b4af2)||0x0,_0x8b145d=_0x236b13[_0x36be78]||_0x236b13[_0x236b13[_0x33f26a(0x175)]-0x1];_0x4d51ec['set'](_0x9b4af2,_0x36be78+0x1),_0x20edb1=_0x8b145d,_0x5d4a06[_0x33f26a(0x147)](_0x20edb1),_0x42d8e1['set'](_0x2f6960,_0x20edb1);const _0x546dbd=await resolveRuleSegmentRefs(_0x31bca5,async _0x43e87a=>{const _0x9d5c54=_0x33f26a,_0x5d1273=_0x42d8e1[_0x9d5c54(0x151)](_0x43e87a);if(_0x5d1273)return _0x5d1273;const _0x355457=await _0x484840[_0x9d5c54(0x13a)](_0x43e87a);return _0x355457[_0x9d5c54(0xf2)];});_0x2e5319={'description':_0x5156c0[_0x33f26a(0x16d)],'rule':_0x546dbd};}else{const _0x3a86a7=_0x21d51a[_0x33f26a(0x151)](_0x9b4af2);if(_0x3a86a7)_0x20edb1=_0x3a86a7,_0x42d8e1['set'](_0x2f6960,_0x20edb1);else{if(_0x2cea1c){let _0x1586eb=_0x2cea1c,_0x3f934a=0x2;while(_0x5d4a06['has'](_0x1586eb)||_0x47cdd0[_0x33f26a(0x1be)](_0x1586eb)){_0x1586eb=_0x2cea1c+'_'+_0x3f934a,_0x3f934a++;}_0x5d4a06[_0x33f26a(0x147)](_0x1586eb),_0x20edb1=_0x1586eb;}_0x42d8e1[_0x33f26a(0x17d)](_0x2f6960,_0x20edb1),_0x21d51a[_0x33f26a(0x17d)](_0x9b4af2,_0x20edb1);const _0x180ae3=await resolveRuleSegmentRefs(_0x31bca5,async _0x359371=>{const _0x21f0e1=_0x33f26a,_0x280a2d=_0x42d8e1[_0x21f0e1(0x151)](_0x359371);if(_0x280a2d)return _0x280a2d;const _0x3ee1b6=await _0x484840['resolveSegment'](_0x359371);return _0x3ee1b6[_0x21f0e1(0xf2)];});_0x2e5319={'description':_0x5156c0[_0x33f26a(0x16d)],'rule':_0x180ae3};}}}return{'name':_0x20edb1,'isJourneyLocal':_0x1555d0,'definition':_0x2e5319};}catch{return{'name':_0x2f6960,'isJourneyLocal':![]};}},'resolveActivation':async _0x367e0c=>{const _0x228f25=a119_0x54fc,_0x3690d9=_0x38cd3b[_0x228f25(0x151)](_0x367e0c);if(_0x3690d9!==undefined)return{'name':_0x3690d9,'isJourneyLocal':!![]};try{let _0x16be70=_0x2304f1?.[_0x228f25(0x151)](_0x367e0c);!_0x16be70&&(_0x16be70=await _0x1137d9[_0x228f25(0x109)][_0x228f25(0x169)](_0x5098a4,_0x367e0c));const _0x53d813=_0x16be70['attributes'][_0x228f25(0x146)][_0x228f25(0xf2)]||_0x367e0c,_0x59a9ba=sanitizeYamlKey(_0x53d813)||_0x228f25(0x1a5)+_0x367e0c,_0x843da5=_0x59a9ba;_0x38cd3b[_0x228f25(0x17d)](_0x367e0c,_0x843da5);const _0x4d9dcc=journeyActivationStepToYaml(_0x16be70,_0x13a1a8,_0xed43d6);return{'name':_0x843da5,'isJourneyLocal':!![],'definition':_0x4d9dcc};}catch{return{'name':_0x367e0c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x9051f6,_0x29addc)=>resolveJumpTarget(_0x9051f6,_0x29addc,_0xe3ebdd,async _0x5b2ca3=>{const _0x45fdf4=a119_0x54fc,_0x14c0b3=_0x2b57eb?.[_0x45fdf4(0x151)](_0x5b2ca3);if(_0x14c0b3)return _0x14c0b3;return _0x1137d9[_0x45fdf4(0x109)][_0x45fdf4(0x181)](_0x5b2ca3);})};return _0x484840=_0x45bd93,_0x45bd93;},_0x25b10e=async _0x503250=>{const _0x26305d=a119_0x54fc,{collectSegmentIdsFromJourneyApi:_0x5b7eb0}=await import(_0x26305d(0x1b6)),{batchAsync:_0x378db8}=await import('../../utils/async.js'),_0x507464=new Set();for(const _0x4c8041 of _0x503250){let _0x39b1ea=_0x2b57eb?.[_0x26305d(0x151)](_0x4c8041);!_0x39b1ea&&(_0x39b1ea=await _0x1137d9[_0x26305d(0x109)][_0x26305d(0x181)](_0x4c8041));const _0x31e9a0=_0x5b7eb0(_0x39b1ea);for(const _0x36ac94 of _0x31e9a0){_0x507464[_0x26305d(0x147)](_0x36ac94);}}let _0x4fcea0=Array[_0x26305d(0x150)](_0x507464);while(_0x4fcea0[_0x26305d(0x175)]>0x0){const _0x1d4236=_0x4fcea0['filter'](_0x5615a6=>!_0x206f7a[_0x26305d(0x1be)](_0x5615a6));if(_0x1d4236[_0x26305d(0x175)]===0x0)break;const _0x4140bf=await _0x378db8(_0x1d4236,async _0x10397d=>{const _0x3c4818=_0x26305d;_0x206f7a[_0x3c4818(0x147)](_0x10397d);let _0x4ac4a5=_0x54b16d[_0x3c4818(0x1aa)](_0x127a25=>_0x127a25['id']===_0x10397d);if(!_0x4ac4a5)try{_0x4ac4a5=await _0x1137d9[_0x3c4818(0x17f)][_0x3c4818(0x1c5)](_0x2a37e1,_0x10397d);}catch{return null;}return{'segmentId':_0x10397d,'segment':_0x4ac4a5};},0xa),_0x4b4ce0=new Set();for(const _0x4e52bc of _0x4140bf){if(!_0x4e52bc?.['segment']?.[_0x26305d(0x148)])continue;const _0x20cfd2=apiRuleToYaml(_0x4e52bc[_0x26305d(0x17f)][_0x26305d(0x148)]);_0x5a7ea8[_0x26305d(0x17d)](_0x4e52bc[_0x26305d(0x121)],_0x20cfd2);const _0x34a50c=collectSegmentRefsFromRule(_0x20cfd2);for(const _0x1535df of _0x34a50c){!_0x206f7a['has'](_0x1535df)&&_0x4b4ce0[_0x26305d(0x147)](_0x1535df);}}_0x4fcea0=Array[_0x26305d(0x150)](_0x4b4ce0);}};return{'createYamlContext':_0x10f4ce,'prefetchJourneySegments':_0x25b10e};}export async function executePushSegments(_0x17a58c,_0x395537,_0x7bc392,_0x82465f,_0x557c68){const _0x381b15=a119_0x2de80c,{segmentDefToCreateRequest:_0x3493bf,segmentDefToUpdateRequest:_0x3d4798}=await import(_0x381b15(0x16c)),_0x5c9b0c=_0x7bc392[_0x381b15(0x1a1)],_0x160735=0x5,_0x2c5c9f=async _0x5ca8de=>{const _0x1558d9=_0x381b15,_0x68fdca=_0x5ca8de['folderPath']?_0x5c9b0c[_0x1558d9(0x151)](_0x5ca8de[_0x1558d9(0x13c)]):undefined;let _0x161f8c;const _0x15a65={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5ca8de[_0x1558d9(0x1b2)]){_0x557c68['onProgress']?.({'type':'segment_creating','name':_0x5ca8de['yamlConfig']['name']});const _0x5d968a=_0x3493bf(_0x5ca8de[_0x1558d9(0x1a3)],_0x68fdca),_0x271d08=await _0x557c68['withProgress'](_0x1558d9(0x11c)+_0x5ca8de['yamlConfig'][_0x1558d9(0xf2)]+_0x1558d9(0x1bd),()=>_0x17a58c[_0x1558d9(0x17f)][_0x1558d9(0x1a6)](_0x82465f[_0x1558d9(0x108)],_0x5d968a));_0x161f8c=_0x271d08[_0x1558d9(0x1b0)]['id'],_0x15a65[_0x1558d9(0x135)]={'name':_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)],'id':_0x161f8c},_0x557c68[_0x1558d9(0xeb)]?.({'type':_0x1558d9(0x165),'name':_0x5ca8de['yamlConfig']['name'],'segmentId':_0x161f8c}),_0x557c68[_0x1558d9(0x1a4)]?.('Created\x20segment\x20\x27'+_0x5ca8de[_0x1558d9(0x1a3)]['name']+'\x27'),_0x15a65[_0x1558d9(0x19a)]=0x1;}else{if(_0x5ca8de[_0x1558d9(0x12a)]){_0x557c68[_0x1558d9(0xeb)]?.({'type':_0x1558d9(0x10e),'name':_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)]});const _0x323470=_0x3d4798(_0x5ca8de[_0x1558d9(0x1a3)]);_0x68fdca!==_0x5ca8de[_0x1558d9(0x173)]?.['segmentFolderId']&&(_0x323470[_0x1558d9(0xee)]=_0x68fdca?parseInt(_0x68fdca,0xa):undefined),await _0x557c68[_0x1558d9(0x11f)](_0x1558d9(0x1a7)+_0x5ca8de['yamlConfig'][_0x1558d9(0xf2)]+_0x1558d9(0x1bd),()=>_0x17a58c[_0x1558d9(0x17f)][_0x1558d9(0x1c4)](_0x82465f[_0x1558d9(0x108)],_0x5ca8de['existingSegment']['id'],_0x323470)),_0x161f8c=_0x5ca8de[_0x1558d9(0x173)]['id'],_0x557c68['onProgress']?.({'type':_0x1558d9(0x19b),'name':_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)]}),_0x557c68[_0x1558d9(0x1a4)]?.(_0x1558d9(0x10d)+_0x5ca8de[_0x1558d9(0x1a3)]['name']+'\x27'),_0x15a65[_0x1558d9(0x12c)]=0x1;}else _0x161f8c=_0x5ca8de['existingSegment']['id'];}}catch(_0x2f07e2){const _0x6ae7f8=isHttp400Error(_0x2f07e2),_0x4f52d3=_0x6ae7f8?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1558d9(0x1b8)],_0x2e340d=getErrorMessage(_0x2f07e2);throw new SDKError(_0x4f52d3,_0x1558d9(0xea)+(_0x5ca8de[_0x1558d9(0x1b2)]?_0x1558d9(0xfc):_0x1558d9(0x1c9))+_0x1558d9(0x128)+_0x5ca8de['absolutePath']+_0x1558d9(0x1a9)+_0x2e340d,_0x2f07e2);}try{const _0x1d6c13=await syncActivationsForSegment(_0x17a58c,_0x82465f['parentId'],_0x161f8c,_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)],_0x5ca8de['activationActions'],_0x557c68,_0x5ca8de[_0x1558d9(0xec)]);_0x15a65['activations']=_0x1d6c13;}catch(_0xa5d926){if(_0xa5d926 instanceof SDKError)throw _0xa5d926;throw new SDKError(ErrorCode[_0x1558d9(0x1bf)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)]+_0x1558d9(0x106)+_0x5ca8de['absolutePath']+_0x1558d9(0x1a9)+getErrorMessage(_0xa5d926),_0xa5d926);}return _0x15a65;},_0x2b91b8=await batchAsync(_0x395537,_0x2c5c9f,_0x160735),_0x42e800={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5daf42 of _0x2b91b8){_0x42e800[_0x381b15(0x19a)]+=_0x5daf42['created'],_0x42e800[_0x381b15(0x12c)]+=_0x5daf42[_0x381b15(0x12c)],_0x5daf42[_0x381b15(0x135)]&&_0x42e800[_0x381b15(0x183)][_0x381b15(0x17d)](_0x5daf42[_0x381b15(0x135)]['name'],_0x5daf42['createdSegmentId']['id']),_0x42e800['activations'][_0x381b15(0x19a)]+=_0x5daf42[_0x381b15(0x126)][_0x381b15(0x19a)],_0x42e800['activations'][_0x381b15(0x12c)]+=_0x5daf42[_0x381b15(0x126)]['updated'],_0x42e800[_0x381b15(0x126)][_0x381b15(0xfa)]+=_0x5daf42[_0x381b15(0x126)][_0x381b15(0xfa)];}return _0x42e800;}async function syncActivationsForSegment(_0x542446,_0x115886,_0x1232dc,_0x1c10db,_0x3c15a0,_0x13fb8b,_0x45ea78){const _0x449833=a119_0x2de80c,_0x18d114={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xbf6041 of _0x3c15a0){try{if(_0xbf6041[_0x449833(0xff)]===_0x449833(0xfc)&&_0xbf6041[_0x449833(0x1ba)])_0x13fb8b[_0x449833(0xeb)]?.({'type':'activation_creating','segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),await _0x13fb8b[_0x449833(0x11f)](_0x449833(0x167)+_0xbf6041[_0x449833(0xf2)]+'\x27...',()=>_0x542446[_0x449833(0x17f)][_0x449833(0x1ca)](_0x115886,_0x1232dc,_0xbf6041[_0x449833(0x1ba)])),_0x13fb8b['onProgress']?.({'type':_0x449833(0x12e),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),_0x13fb8b[_0x449833(0x1a4)]?.('Created\x20activation\x20\x27'+_0xbf6041['name']+'\x27'),_0x18d114[_0x449833(0x19a)]++;else{if(_0xbf6041[_0x449833(0xff)]===_0x449833(0x1c9)&&_0xbf6041[_0x449833(0x1ba)]&&_0xbf6041['existingActivation'])_0x13fb8b[_0x449833(0xeb)]?.({'type':'activation_updating','segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),await _0x13fb8b[_0x449833(0x11f)](_0x449833(0x17a)+_0xbf6041[_0x449833(0xf2)]+_0x449833(0x1bd),()=>_0x542446[_0x449833(0x17f)][_0x449833(0x154)](_0x115886,_0x1232dc,_0xbf6041[_0x449833(0x104)]['id'],_0xbf6041['validatedRequest'])),_0x13fb8b[_0x449833(0xeb)]?.({'type':_0x449833(0x191),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),_0x13fb8b[_0x449833(0x1a4)]?.(_0x449833(0x18a)+_0xbf6041[_0x449833(0xf2)]+'\x27'),_0x18d114['updated']++;else _0xbf6041[_0x449833(0xff)]===_0x449833(0x1cc)&&_0xbf6041[_0x449833(0x104)]&&(_0x13fb8b[_0x449833(0xeb)]?.({'type':_0x449833(0x1b5),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),await _0x13fb8b['withProgress'](_0x449833(0x129)+_0xbf6041[_0x449833(0xf2)]+_0x449833(0x1bd),()=>_0x542446['segment']['deleteActivation'](_0x115886,_0x1232dc,_0xbf6041[_0x449833(0x104)]['id'])),_0x13fb8b[_0x449833(0xeb)]?.({'type':_0x449833(0x186),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),_0x13fb8b[_0x449833(0x153)]?.(_0x449833(0xfb)+_0xbf6041['name']+'\x27'),_0x18d114['deleted']++);}}catch(_0x21ffb7){const _0x184acc=isHttp400Error(_0x21ffb7),_0x209499=_0x184acc?ErrorCode[_0x449833(0xf3)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x4082c4=getErrorMessage(_0x21ffb7);throw new SDKError(_0x209499,_0x449833(0xea)+_0xbf6041[_0x449833(0xff)]+_0x449833(0xf8)+_0xbf6041[_0x449833(0xf2)]+_0x449833(0x106)+_0x45ea78+'\x0a\x20\x20'+_0x4082c4,_0x21ffb7);}}return _0x18d114;}export async function executePushFolders(_0x20eb8f,_0x44402e,_0x13b952,_0x391483,_0x260eec){const _0x291379=a119_0x2de80c,_0x27b508=new Map(_0x13b952);for(const _0x21fe58 of _0x44402e){const _0x1ade53=_0x21fe58[_0x291379(0x156)]('/'),_0x2cfb14=_0x1ade53[_0x1ade53['length']-0x1],_0x49cef8=_0x1ade53['slice'](0x0,-0x1)[_0x291379(0x168)]('/'),_0x56a726=_0x27b508[_0x291379(0x151)](_0x49cef8);_0x260eec['onProgress']?.({'type':'folder_creating','folder':_0x21fe58});const _0x10d671={'name':_0x2cfb14,'parentFolderId':_0x56a726},_0x13b7a7=await _0x260eec[_0x291379(0x11f)](_0x291379(0x131)+_0x21fe58+_0x291379(0x1bd),()=>_0x20eb8f[_0x291379(0x17f)][_0x291379(0xed)](_0x391483[_0x291379(0x108)],_0x10d671));_0x27b508[_0x291379(0x17d)](_0x21fe58,_0x13b7a7['data']['id']),_0x260eec[_0x291379(0xeb)]?.({'type':_0x291379(0x182),'folder':_0x21fe58,'folderId':_0x13b7a7[_0x291379(0x1b0)]['id']}),_0x260eec[_0x291379(0x185)]?.(_0x291379(0x158)+_0x21fe58+'\x27');}return _0x27b508;}export async function executePushSegmentDeletions(_0x515bcc,_0x1bf1e6,_0x2a9f6d){const _0xacdff7=a119_0x2de80c;if(_0x1bf1e6[_0xacdff7(0x175)]===0x0)return 0x0;const {batchAsync:_0x914f60}=await import(_0xacdff7(0x114)),_0x5b9a9f=0x5,_0x4547d2=await _0x914f60(_0x1bf1e6,async _0x4244dc=>{const _0x2d1c67=_0xacdff7;return _0x2a9f6d[_0x2d1c67(0xeb)]?.({'type':_0x2d1c67(0x1b9),'name':_0x4244dc[_0x2d1c67(0xf2)]}),await _0x515bcc[_0x2d1c67(0x17f)]['deleteSegment'](_0x4244dc['id']),_0x2a9f6d[_0x2d1c67(0xeb)]?.({'type':_0x2d1c67(0x14a),'name':_0x4244dc[_0x2d1c67(0xf2)]}),_0x2a9f6d[_0x2d1c67(0x153)]?.(_0x2d1c67(0x105)+_0x4244dc[_0x2d1c67(0xf2)]+'\x27'),0x1;},_0x5b9a9f);return _0x4547d2['reduce']((_0x29463b,_0x570271)=>_0x29463b+_0x570271,0x0);}export async function executePushJourneys(_0x81a46f,_0x56de91,_0x9fb815,_0x4924da,_0x571f5a){const _0x6301=a119_0x2de80c,{journeyDefToRequest:_0x487688}=await import(_0x6301(0x1b6)),{activationDefToCreateRequest:_0x1bdfc9,yamlRuleToApi:_0x3f44c6,validateSegmentRule:_0x39a799}=await import('./child-segment-yaml.js'),_0x4b08f1={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4e3a6f=new Map(_0x9fb815[_0x6301(0x18b)]),_0x5c33e9=0x5;for(let _0x1ccc0c=0x0;_0x1ccc0c<_0x56de91['length'];_0x1ccc0c+=_0x5c33e9){const _0x3702be=_0x56de91[_0x6301(0x18f)](_0x1ccc0c,_0x1ccc0c+_0x5c33e9),_0x50659e=await Promise[_0x6301(0x10f)](_0x3702be['map'](async _0x2f8968=>{const _0x5a0dcf=_0x6301;if(!_0x2f8968[_0x5a0dcf(0x1b2)]&&!_0x2f8968[_0x5a0dcf(0x12a)])return{'action':_0x5a0dcf(0x152),'name':_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)],'journeyId':_0x2f8968[_0x5a0dcf(0x1bc)]?.['id']};const _0x293d36=_0x2f8968[_0x5a0dcf(0x13c)]?_0x9fb815[_0x5a0dcf(0x1a1)][_0x5a0dcf(0x151)](_0x2f8968[_0x5a0dcf(0x13c)]):undefined;_0x571f5a[_0x5a0dcf(0xeb)]?.({'type':_0x2f8968[_0x5a0dcf(0x1b2)]?'journey_creating':_0x5a0dcf(0x179),'name':_0x2f8968['yamlConfig'][_0x5a0dcf(0xf2)]});try{const _0xf8ca9c=await executeSingleJourneyPush(_0x81a46f,_0x2f8968,{..._0x9fb815,'segmentNameToId':_0x4e3a6f},{'parentId':_0x4924da[_0x5a0dcf(0x108)],'rootFolderId':_0x4924da[_0x5a0dcf(0x144)],'folderId':_0x293d36,'verbose':_0x4924da[_0x5a0dcf(0x18c)]},_0x571f5a,{'journeyDefToRequest':_0x487688,'activationDefToCreateRequest':_0x1bdfc9,'yamlRuleToApi':_0x3f44c6,'validateSegmentRule':_0x39a799});for(const [_0xa129d5,_0x1693eb]of _0xf8ca9c[_0x5a0dcf(0x157)]){_0x4e3a6f[_0x5a0dcf(0x17d)](_0xa129d5,_0x1693eb),_0x4b08f1['embeddedSegmentNameToId'][_0x5a0dcf(0x17d)](_0xa129d5,_0x1693eb);}if(_0xf8ca9c[_0x5a0dcf(0x103)]==='created')_0x571f5a[_0x5a0dcf(0xeb)]?.({'type':_0x5a0dcf(0x11b),'name':_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)],'journeyId':_0xf8ca9c[_0x5a0dcf(0x11a)]}),_0x571f5a[_0x5a0dcf(0x1a4)]?.(_0x5a0dcf(0x176)+_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)]+'\x27'),_0x4b08f1[_0x5a0dcf(0x19a)]++;else _0xf8ca9c[_0x5a0dcf(0x103)]===_0x5a0dcf(0x12c)&&(_0x571f5a[_0x5a0dcf(0xeb)]?.({'type':_0x5a0dcf(0x178),'name':_0x2f8968['yamlConfig']['name']}),_0x571f5a[_0x5a0dcf(0x1a4)]?.(_0x5a0dcf(0x116)+_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)]+'\x27'),_0x4b08f1[_0x5a0dcf(0x12c)]++);return{'action':_0xf8ca9c[_0x5a0dcf(0x103)],'name':_0x2f8968[_0x5a0dcf(0x1a3)]['name'],'journeyId':_0xf8ca9c[_0x5a0dcf(0x11a)]};}catch(_0x3a7729){const _0xb3458e=isHttp400Error(_0x3a7729),_0x550805=_0xb3458e?ErrorCode[_0x5a0dcf(0x136)]:ErrorCode[_0x5a0dcf(0x187)],_0x5bf7a5=getErrorMessage(_0x3a7729);throw new SDKError(_0x550805,_0x5a0dcf(0xea)+(_0x2f8968['isNew']?'create':_0x5a0dcf(0x1c9))+'\x20journey\x20from\x20file:\x20'+_0x2f8968[_0x5a0dcf(0xec)]+_0x5a0dcf(0x1a9)+_0x5bf7a5,_0x3a7729);}}));_0x4b08f1[_0x6301(0x133)][_0x6301(0x12d)](..._0x50659e);}return _0x4b08f1;}async function executeSingleJourneyPush(_0x207369,_0x28a179,_0x32bf96,_0x3f1c2f,_0x46db3a,_0xf15e72){const _0x364caf=a119_0x2de80c,{journeyDefToRequest:_0x43f9f3,activationDefToCreateRequest:_0x369369,yamlRuleToApi:_0x18efa2,validateSegmentRule:_0x507651}=_0xf15e72,_0x4d5116=new Map(),_0xae56d4=new Map(),_0x2e333c=new Map(),_0x27f239=new Map(),_0x5606da=new Map();let _0x67a2ff;const _0x22a625=async()=>{const _0x11f621=a119_0x54fc;if(_0x67a2ff)return;_0x67a2ff=new Map();if(!_0x28a179[_0x11f621(0x1bc)])return;const _0x44d533=await _0x207369['journey'][_0x11f621(0x1a0)](_0x28a179[_0x11f621(0x1bc)]['id']);for(const _0x1d2e90 of _0x44d533){const _0x5d1d42=journeyActivationStepToYaml(_0x1d2e90,_0x32bf96[_0x11f621(0x1c3)],_0x32bf96['connectionIdToNameMap']),_0x4cf7f9=activationSignature(_0x5d1d42);!_0x67a2ff[_0x11f621(0x1be)](_0x4cf7f9)&&_0x67a2ff[_0x11f621(0x17d)](_0x4cf7f9,_0x1d2e90['id']),_0x5d1d42['name']&&_0xae56d4[_0x11f621(0x17d)](_0x5d1d42[_0x11f621(0xf2)],_0x1d2e90['id']);}};if(_0x28a179[_0x364caf(0x1bc)]&&_0x28a179['yamlConfig'][_0x364caf(0x14f)]){const _0x49e1f5=buildLocalExpandedRuleMappings(_0x28a179[_0x364caf(0x1a3)]),_0x186889=_0x49e1f5[_0x364caf(0x111)];if(_0x186889[_0x364caf(0x188)]>0x0){const _0xe2dbc4=new Map();for(const [_0x487550,_0x34d2fb]of _0x186889){const _0x40f5a3=serializeExpandedRule(_0x34d2fb,_0x186889);_0xe2dbc4['set'](_0x487550,_0x40f5a3);}const _0x1dbb43=collectSegmentIdsFromJourneyApi(_0x28a179['existingJourney']);if(_0x1dbb43[_0x364caf(0x188)]>0x0){const _0x5e10f5=await buildServerSegmentRuleMap(_0x207369,_0x3f1c2f[_0x364caf(0x108)],_0x32bf96['existingSegments'],_0x1dbb43);if(_0x5e10f5['size']>0x0){const _0x1e0c66=new Map();for(const [_0x215f1c,_0x555584]of _0x5e10f5){const _0xec16ae=serializeExpandedRule(_0x555584,_0x5e10f5);!_0x1e0c66[_0x364caf(0x1be)](_0xec16ae)&&_0x1e0c66[_0x364caf(0x17d)](_0xec16ae,_0x215f1c);}for(const [_0x31d63e,_0x1aac73]of _0xe2dbc4){const _0x1e3866=_0x1e0c66[_0x364caf(0x151)](_0x1aac73);_0x1e3866&&(_0x5606da[_0x364caf(0x17d)](_0x31d63e,_0x1e3866),_0x32bf96[_0x364caf(0x18b)][_0x364caf(0x17d)](_0x31d63e,_0x1e3866));}}}}}const _0x3e6982={'resolveSegmentId':async _0x208bf8=>{const _0x484a74=_0x364caf,_0x18111a=_0x32bf96[_0x484a74(0x18b)]['get'](_0x208bf8);if(!_0x18111a)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x484a74(0xf1)+_0x208bf8+_0x484a74(0x184)+_0x28a179[_0x484a74(0x1a3)][_0x484a74(0xf2)]+')');return _0x18111a;},'resolveEmbeddedSegmentId':async(_0x2cbf92,_0x409e00)=>{const _0x5a0a2c=_0x364caf,_0x309443=_0x32bf96[_0x5a0a2c(0x18b)][_0x5a0a2c(0x151)](_0x2cbf92);if(_0x309443)return _0x309443;const _0x1e5445=_0x5606da['get'](_0x2cbf92);if(_0x1e5445)return _0x32bf96[_0x5a0a2c(0x18b)][_0x5a0a2c(0x17d)](_0x2cbf92,_0x1e5445),_0x1e5445;const _0x4e7dfc=_0x32bf96['existingSegments'][_0x5a0a2c(0x1aa)](_0xd96c0b=>_0xd96c0b[_0x5a0a2c(0xf2)]===_0x2cbf92);if(_0x4e7dfc)return _0x32bf96[_0x5a0a2c(0x18b)]['set'](_0x2cbf92,_0x4e7dfc['id']),_0x4e7dfc['id'];if(_0x28a179[_0x5a0a2c(0x1b2)]){const {stageName:_0x88cc89,criteriaName:_0x5643a2}=findSegmentCriteriaLocation(_0x28a179['yamlConfig'],_0x2cbf92);return _0x507651(_0x2cbf92,_0x409e00[_0x5a0a2c(0x148)]),_0x2e333c[_0x5a0a2c(0x17d)](_0x2cbf92,{'definition':_0x409e00,'stageName':_0x88cc89,'criteriaName':_0x5643a2}),createPendingSegmentId(_0x2cbf92);}const _0x261989=_0x28a179[_0x5a0a2c(0x1bc)]?.['id'];if(!_0x261989)throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x507651(_0x2cbf92,_0x409e00[_0x5a0a2c(0x148)]);const _0x10bbcf=generateDeterministicJourneySegmentName(_0x28a179[_0x5a0a2c(0x1a3)]['name'],_0x2cbf92),_0x551785=_0x32bf96[_0x5a0a2c(0x123)]['find'](_0x185c01=>_0x185c01[_0x5a0a2c(0xf2)]===_0x10bbcf),_0x26986b=createSegmentIdResolver(_0x32bf96[_0x5a0a2c(0x18b)],_0x2cbf92),_0x32954c=await resolveRuleSegmentIds(_0x409e00[_0x5a0a2c(0x148)],_0x26986b);let _0x323809;if(_0x551785)await _0x207369[_0x5a0a2c(0x17f)][_0x5a0a2c(0x1c4)](_0x3f1c2f['parentId'],_0x551785['id'],{'description':_0x409e00['description']||'Entry\x20criteria:\x20'+_0x2cbf92,'rule':_0x18efa2(_0x32954c,!![]),'countPopulation':!![]}),_0x323809=_0x551785['id'];else try{_0x323809=await _0x207369['segment'][_0x5a0a2c(0x16b)]({'name':_0x10bbcf,'description':_0x409e00[_0x5a0a2c(0x16d)]||_0x5a0a2c(0x18d)+_0x2cbf92,'journeyId':_0x261989,'rule':_0x18efa2(_0x32954c,!![]),'countPopulation':!![],'parentFolderId':_0x3f1c2f[_0x5a0a2c(0x144)]||'','audienceId':_0x3f1c2f['parentId']});}catch(_0x542e2e){const _0x6cec91=_0x542e2e instanceof Error&&_0x542e2e[_0x5a0a2c(0x190)][_0x5a0a2c(0x1ce)]('Name\x20has\x20already\x20been\x20taken');if(_0x6cec91){const _0xc1d6be=await _0x207369[_0x5a0a2c(0x17f)]['listSegments'](_0x3f1c2f[_0x5a0a2c(0x108)]),_0x36885c=_0xc1d6be[_0x5a0a2c(0x1aa)](_0x6e70f2=>_0x6e70f2[_0x5a0a2c(0xf2)]===_0x10bbcf);if(_0x36885c)await _0x207369[_0x5a0a2c(0x17f)][_0x5a0a2c(0x1c4)](_0x3f1c2f[_0x5a0a2c(0x108)],_0x36885c['id'],{'description':_0x409e00[_0x5a0a2c(0x16d)]||_0x5a0a2c(0x18d)+_0x2cbf92,'rule':_0x18efa2(_0x32954c,!![]),'countPopulation':!![]}),_0x323809=_0x36885c['id'];else throw _0x542e2e;}else throw _0x542e2e;}return _0x32bf96[_0x5a0a2c(0x18b)][_0x5a0a2c(0x17d)](_0x2cbf92,_0x323809),_0x4d5116[_0x5a0a2c(0x17d)](_0x2cbf92,_0x323809),_0x323809;},'resolveActivationId':async _0x37283e=>{const _0x1bc1f2=_0x364caf,_0x1277b9=_0xae56d4[_0x1bc1f2(0x151)](_0x37283e);if(_0x1277b9)return _0x1277b9;if(_0x28a179[_0x1bc1f2(0x1bc)]){await _0x22a625();const _0x418e6c=_0xae56d4['get'](_0x37283e);if(_0x418e6c)return _0x418e6c;}throw new SDKError(ErrorCode[_0x1bc1f2(0x115)],_0x1bc1f2(0x10a)+_0x37283e+_0x1bc1f2(0x184)+_0x28a179['yamlConfig'][_0x1bc1f2(0xf2)]+').\x20'+_0x1bc1f2(0x160));},'resolveEmbeddedActivationId':async(_0x4c6c47,_0x2800e8)=>{const _0x4986f9=_0x364caf,_0x22bff4=_0xae56d4[_0x4986f9(0x151)](_0x4c6c47);if(_0x22bff4)return _0x22bff4;if(_0x28a179[_0x4986f9(0x1b2)])return _0x27f239[_0x4986f9(0x17d)](_0x4c6c47,_0x2800e8),createPendingActivationId(_0x4c6c47);if(_0x28a179[_0x4986f9(0x1bc)]){await _0x22a625();const _0x27fac8=_0xae56d4[_0x4986f9(0x151)](_0x2800e8[_0x4986f9(0xf2)]);if(_0x27fac8)return _0xae56d4[_0x4986f9(0x17d)](_0x4c6c47,_0x27fac8),_0x27fac8;const _0x56bb24=activationSignature(_0x2800e8),_0x4b9102=_0x67a2ff?.[_0x4986f9(0x151)](_0x56bb24);if(_0x4b9102)return _0xae56d4[_0x4986f9(0x17d)](_0x4c6c47,_0x4b9102),_0x4b9102;const _0x288fb4=await _0x369369(_0x2800e8,_0x32bf96['activationContext']),_0x4cb7bc=await _0x207369[_0x4986f9(0x109)][_0x4986f9(0x1ca)](_0x28a179[_0x4986f9(0x1bc)]['id'],_0x288fb4);return _0xae56d4[_0x4986f9(0x17d)](_0x4c6c47,_0x4cb7bc['id']),_0x4cb7bc['id'];}throw new SDKError(ErrorCode[_0x4986f9(0x17c)],_0x4986f9(0x142));},'resolveJourneyId':async _0x4c0ba6=>{const _0x582b94=_0x364caf;try{return await _0x207369['journey']['resolveJourneyId'](_0x3f1c2f[_0x582b94(0x108)],_0x4c0ba6);}catch(_0x49d434){throw new SDKError(ErrorCode[_0x582b94(0x115)],_0x582b94(0x1c7)+_0x4c0ba6+_0x582b94(0x113)+_0x28a179[_0x582b94(0x1a3)][_0x582b94(0xf2)]+'\x27)',_0x49d434);}},'resolveStageId':async(_0x4655b8,_0x16e8c7)=>{const _0x28f50c=_0x364caf,_0xb22157=await _0x207369[_0x28f50c(0x109)][_0x28f50c(0x181)](_0x4655b8),_0x3954c3=_0xb22157[_0x28f50c(0xf0)][_0x28f50c(0x1b1)][_0x28f50c(0x1aa)](_0x3a4c81=>_0x3a4c81[_0x28f50c(0xf2)]['toLowerCase']()===_0x16e8c7[_0x28f50c(0xf5)]());if(!_0x3954c3?.['id'])throw new SDKError(ErrorCode[_0x28f50c(0x115)],_0x28f50c(0x1c2)+_0x16e8c7+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0xb22157[_0x28f50c(0xf0)]['journeyBundleName']||_0xb22157[_0x28f50c(0xf0)][_0x28f50c(0xf2)])+'\x27');return _0x3954c3['id'];}},_0x16b280=await _0x43f9f3(_0x28a179[_0x364caf(0x1a3)],_0x3f1c2f[_0x364caf(0x108)],_0x3e6982),_0x1f2c60=_0x3f1c2f[_0x364caf(0xf6)]||_0x3f1c2f['rootFolderId'];_0x1f2c60&&(_0x16b280[_0x364caf(0x18e)]={'parentFolder':{'data':{'id':_0x1f2c60,'type':_0x364caf(0x1bb)}}});if(_0x28a179['isNew']){if(_0x2e333c['size']>0x0||_0x27f239[_0x364caf(0x188)]>0x0)return await executeThreeStepJourneyCreate(_0x207369,_0x28a179,_0x16b280,{'pendingEmbeddedSegments':_0x2e333c,'pendingEmbeddedActivations':_0x27f239,'embeddedSegmentNameToId':_0x4d5116,'journeyActivationNameToId':_0xae56d4},{..._0x3f1c2f,'effectiveFolderId':_0x1f2c60},_0x32bf96,_0x46db3a,_0xf15e72);else{ensureJourneyDefaults(_0x16b280[_0x364caf(0xf0)]);const _0x362508=await _0x207369[_0x364caf(0x109)]['create'](_0x16b280);return{'action':_0x364caf(0x19a),'journeyId':_0x362508['id'],'embeddedSegmentNameToId':_0x4d5116};}}else{if(_0x28a179[_0x364caf(0x12a)]&&_0x28a179[_0x364caf(0x1bc)])return ensureJourneyDefaults(_0x16b280[_0x364caf(0xf0)]),await _0x207369[_0x364caf(0x109)]['update'](_0x28a179[_0x364caf(0x1bc)]['id'],_0x16b280),{'action':_0x364caf(0x12c),'journeyId':_0x28a179['existingJourney']['id'],'embeddedSegmentNameToId':_0x4d5116};}return{'action':_0x364caf(0x152),'journeyId':_0x28a179[_0x364caf(0x1bc)]?.['id'],'embeddedSegmentNameToId':_0x4d5116};}function findSegmentCriteriaLocation(_0x126f15,_0x110f0b){const _0x22eca6=a119_0x2de80c,_0x16e233=_0x126f15['stages']||_0x126f15[_0x22eca6(0x139)]?.[0x0]?.[_0x22eca6(0x119)]||[];let _0x30c61c='entry',_0x3a63e1=_0x110f0b;const _0x18cb4f=_0x126f15['goal']||_0x126f15[_0x22eca6(0x139)]?.[0x0]?.[_0x22eca6(0x1cd)];if(_0x18cb4f?.['segment']===_0x110f0b)return{'stageName':_0x22eca6(0x1cd),'criteriaName':_0x18cb4f[_0x22eca6(0xf2)]||_0x110f0b};_0x532854:for(const _0xe049d8 of _0x16e233){if(_0xe049d8[_0x22eca6(0x180)]?.['segment']===_0x110f0b){_0x30c61c=_0xe049d8[_0x22eca6(0xf2)],_0x3a63e1=_0xe049d8['entry_criteria'][_0x22eca6(0xf2)]||_0x110f0b;break;}if(_0xe049d8[_0x22eca6(0x13d)])for(const _0x4440b5 of _0xe049d8[_0x22eca6(0x13d)]){if(_0x4440b5[_0x22eca6(0xff)]===_0x22eca6(0x155)&&_0x4440b5['with']?.['branches'])for(const _0x2872be of _0x4440b5['with']['branches']){if(_0x2872be[_0x22eca6(0x17f)]===_0x110f0b){_0x30c61c=_0xe049d8[_0x22eca6(0xf2)],_0x3a63e1=_0x2872be[_0x22eca6(0xf2)]||_0x110f0b;break _0x532854;}}}}return{'stageName':_0x30c61c,'criteriaName':_0x3a63e1};}async function executeThreeStepJourneyCreate(_0x586f20,_0x562f48,_0xa2c906,_0x4d2413,_0x6fe0bf,_0x301158,_0xb8662d,_0x304eb7){const _0x1d2175=a119_0x2de80c,{activationDefToCreateRequest:_0x16f2f2,yamlRuleToApi:_0x3bdd1b}=_0x304eb7,{pendingEmbeddedSegments:_0x18795d,pendingEmbeddedActivations:_0x4f31d2,embeddedSegmentNameToId:_0x570067}=_0x4d2413,_0x797362=JSON[_0x1d2175(0x102)](JSON[_0x1d2175(0x13e)](_0xa2c906));ensureJourneyDefaults(_0x797362['attributes']),stripPendingIds(_0x797362);const _0x314c97=await _0x586f20['journey'][_0x1d2175(0xfc)](_0x797362),_0x139873=_0x314c97['id'],_0x41f398=new Map();for(const _0x15ee47 of _0x314c97[_0x1d2175(0xf0)][_0x1d2175(0x1b1)]){_0x41f398[_0x1d2175(0x17d)](_0x15ee47[_0x1d2175(0xf2)][_0x1d2175(0xf5)](),_0x15ee47['id']);}for(const [_0x4e9ce6,{definition:_0x1cf93e}]of _0x18795d){const _0x27a344=generateDeterministicJourneySegmentName(_0x562f48['yamlConfig']['name'],_0x4e9ce6);_0xb8662d['onProgress']?.({'type':'embedded_segment_creating','journeyName':_0x562f48['yamlConfig'][_0x1d2175(0xf2)],'segmentName':_0x4e9ce6});const _0x17df46=createSegmentIdResolver(_0x301158[_0x1d2175(0x18b)],_0x4e9ce6),_0x344591=await resolveRuleSegmentIds(_0x1cf93e[_0x1d2175(0x148)],_0x17df46),_0x442767=await _0x586f20[_0x1d2175(0x17f)][_0x1d2175(0x16b)]({'name':_0x27a344,'description':_0x1cf93e[_0x1d2175(0x16d)]||_0x1d2175(0x18d)+_0x4e9ce6,'journeyId':_0x139873,'rule':_0x3bdd1b(_0x344591,!![]),'countPopulation':!![],'parentFolderId':_0x6fe0bf[_0x1d2175(0x1ab)]||'','audienceId':_0x6fe0bf[_0x1d2175(0x108)]});_0x570067[_0x1d2175(0x17d)](_0x4e9ce6,_0x442767),_0x301158[_0x1d2175(0x18b)][_0x1d2175(0x17d)](_0x4e9ce6,_0x442767),_0xb8662d[_0x1d2175(0xeb)]?.({'type':_0x1d2175(0xf4),'journeyName':_0x562f48['yamlConfig'][_0x1d2175(0xf2)],'segmentName':_0x4e9ce6});}const _0x4d919e=new Map();for(const [_0xfe184a,_0x27120e]of _0x4f31d2){_0xb8662d['onProgress']?.({'type':_0x1d2175(0x1a2),'journeyName':_0x562f48[_0x1d2175(0x1a3)][_0x1d2175(0xf2)],'activationName':_0xfe184a});const _0x4e4166=await _0x16f2f2(_0x27120e,_0x301158[_0x1d2175(0x127)]),_0x50a1d8=await _0x586f20[_0x1d2175(0x109)][_0x1d2175(0x1ca)](_0x139873,_0x4e4166);_0x4d919e['set'](_0xfe184a,_0x50a1d8['id']),_0x4d2413[_0x1d2175(0x1c0)][_0x1d2175(0x17d)](_0xfe184a,_0x50a1d8['id']),_0xb8662d[_0x1d2175(0xeb)]?.({'type':_0x1d2175(0x10b),'journeyName':_0x562f48['yamlConfig'][_0x1d2175(0xf2)],'activationName':_0xfe184a});}const _0x397d85=JSON[_0x1d2175(0x102)](JSON[_0x1d2175(0x13e)](_0xa2c906));return _0x397d85['id']=_0x139873,ensureJourneyDefaults(_0x397d85['attributes']),resolvePendingIdsInRequest(_0x397d85,_0xa2c906,_0x41f398,_0x570067,_0x4d919e,_0xb8662d),await _0x586f20[_0x1d2175(0x109)][_0x1d2175(0x1c9)](_0x139873,_0x397d85),{'action':_0x1d2175(0x19a),'journeyId':_0x139873,'embeddedSegmentNameToId':_0x570067};}function stripPendingIds(_0x3d8834){const _0x55f2d7=a119_0x2de80c;for(const _0x507218 of _0x3d8834[_0x55f2d7(0xf0)][_0x55f2d7(0x1b1)]||[]){_0x507218[_0x55f2d7(0x1ae)]?.[_0x55f2d7(0x121)]&&isPendingSegmentId(_0x507218[_0x55f2d7(0x1ae)][_0x55f2d7(0x121)])&&delete _0x507218['entryCriteria'];if(_0x507218['steps'])for(const _0x411543 of Object[_0x55f2d7(0x15b)](_0x507218[_0x55f2d7(0x13d)])){const _0x146442=_0x507218[_0x55f2d7(0x13d)][_0x411543];_0x146442[_0x55f2d7(0xff)]===_0x55f2d7(0x130)&&_0x146442['journeyActivationStepId']&&isPendingActivationId(_0x146442[_0x55f2d7(0x118)])&&(_0x146442[_0x55f2d7(0x118)]='');if(_0x146442[_0x55f2d7(0xff)]===_0x55f2d7(0xf7)&&_0x146442[_0x55f2d7(0x19d)])for(const _0x10914e of _0x146442['branches']){_0x10914e['segmentId']&&isPendingSegmentId(_0x10914e['segmentId'])&&(_0x10914e[_0x55f2d7(0x121)]='');}_0x146442[_0x55f2d7(0xff)]===_0x55f2d7(0x145)&&_0x146442[_0x55f2d7(0x159)]?.['segmentId']&&isPendingSegmentId(_0x146442[_0x55f2d7(0x159)][_0x55f2d7(0x121)])&&(_0x146442[_0x55f2d7(0x159)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x3bd4e0,_0x2c0ebf,_0x36cef1,_0x3e11af,_0x1d3307,_0x4d6634){const _0x1c6a63=a119_0x2de80c,_0x1f6e8e=(_0x45ead4,_0x29bed0)=>{const _0x1458a4=a119_0x54fc;if(!isPendingSegmentId(_0x45ead4))return _0x45ead4;const _0x14bf0c=extractPendingSegmentName(_0x45ead4),_0x1bafb8=_0x3e11af[_0x1458a4(0x151)](_0x14bf0c);return!_0x1bafb8&&_0x4d6634[_0x1458a4(0x100)]?.(_0x1458a4(0x19c)+_0x14bf0c+_0x1458a4(0x138)+_0x29bed0),_0x1bafb8;};if(_0x3bd4e0[_0x1c6a63(0xf0)]['goal']?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x3bd4e0['attributes'][_0x1c6a63(0x1cd)][_0x1c6a63(0x121)])){const _0x10aeae=_0x1f6e8e(_0x3bd4e0[_0x1c6a63(0xf0)][_0x1c6a63(0x1cd)][_0x1c6a63(0x121)],_0x1c6a63(0x14e));_0x10aeae&&(_0x3bd4e0[_0x1c6a63(0xf0)][_0x1c6a63(0x1cd)][_0x1c6a63(0x121)]=_0x10aeae);}for(const _0x2ea0a3 of _0x3bd4e0[_0x1c6a63(0xf0)][_0x1c6a63(0x1b1)]||[]){const _0x339d32=_0x36cef1[_0x1c6a63(0x151)](_0x2ea0a3[_0x1c6a63(0xf2)][_0x1c6a63(0xf5)]());_0x339d32&&(_0x2ea0a3['id']=_0x339d32);if(_0x2ea0a3[_0x1c6a63(0x1ae)]?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x2ea0a3[_0x1c6a63(0x1ae)][_0x1c6a63(0x121)])){const _0x3bceef=_0x1f6e8e(_0x2ea0a3['entryCriteria']['segmentId'],'stage\x20\x27'+_0x2ea0a3[_0x1c6a63(0xf2)]+'\x27\x20entry\x20criteria');_0x3bceef&&(_0x2ea0a3[_0x1c6a63(0x1ae)][_0x1c6a63(0x121)]=_0x3bceef);}if(_0x2ea0a3[_0x1c6a63(0x198)])for(const _0x498f49 of _0x2ea0a3[_0x1c6a63(0x198)]){if(_0x498f49[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x498f49[_0x1c6a63(0x121)])){const _0x57cada=_0x1f6e8e(_0x498f49[_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+'\x27\x20exit\x20criteria');_0x57cada&&(_0x498f49[_0x1c6a63(0x121)]=_0x57cada);}}if(_0x2ea0a3['milestone']?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x2ea0a3[_0x1c6a63(0x120)][_0x1c6a63(0x121)])){const _0x254d60=_0x1f6e8e(_0x2ea0a3[_0x1c6a63(0x120)][_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+_0x1c6a63(0x134));_0x254d60&&(_0x2ea0a3['milestone']['segmentId']=_0x254d60);}if(_0x2ea0a3[_0x1c6a63(0x13d)]){const _0x402450=_0x4a7787=>_0x2c0ebf[_0x1c6a63(0xf0)][_0x1c6a63(0x1b1)][_0x1c6a63(0x1aa)](_0x493a71=>_0x493a71[_0x1c6a63(0xf2)]['toLowerCase']()===_0x2ea0a3[_0x1c6a63(0xf2)][_0x1c6a63(0xf5)]())?.[_0x1c6a63(0x13d)]?.[_0x4a7787];for(const _0x120851 of Object[_0x1c6a63(0x15b)](_0x2ea0a3['steps'])){const _0x3ddd88=_0x2ea0a3[_0x1c6a63(0x13d)][_0x120851],_0x5cbf1d=_0x402450(_0x120851);if(_0x3ddd88[_0x1c6a63(0xff)]===_0x1c6a63(0x130)&&_0x3ddd88[_0x1c6a63(0x118)]&&(isPendingActivationId(_0x3ddd88['journeyActivationStepId'])||_0x3ddd88[_0x1c6a63(0x118)]==='')){if(_0x5cbf1d?.[_0x1c6a63(0x118)]&&isPendingActivationId(_0x5cbf1d[_0x1c6a63(0x118)])){const _0x59fe2d=extractPendingActivationName(_0x5cbf1d[_0x1c6a63(0x118)]),_0x2592c5=_0x1d3307['get'](_0x59fe2d);_0x2592c5&&(_0x3ddd88[_0x1c6a63(0x118)]=_0x2592c5);}}if(_0x3ddd88[_0x1c6a63(0xff)]===_0x1c6a63(0xf7)&&_0x3ddd88[_0x1c6a63(0x19d)]&&_0x5cbf1d?.['branches'])for(let _0x3ed7d6=0x0;_0x3ed7d6<_0x3ddd88[_0x1c6a63(0x19d)]['length'];_0x3ed7d6++){const _0x5ef6e7=_0x3ddd88['branches'][_0x3ed7d6],_0x4e4699=_0x5cbf1d['branches'][_0x3ed7d6];if(_0x4e4699?.['segmentId']&&isPendingSegmentId(_0x4e4699[_0x1c6a63(0x121)])){const _0x31ce5b=_0x1f6e8e(_0x4e4699[_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x5ef6e7[_0x1c6a63(0xf2)]||_0x3ed7d6)+'\x27');_0x31ce5b&&(_0x5ef6e7['segmentId']=_0x31ce5b);}}if(_0x3ddd88[_0x1c6a63(0xff)]===_0x1c6a63(0x145)&&_0x3ddd88[_0x1c6a63(0x159)]?.[_0x1c6a63(0x121)]&&_0x5cbf1d?.[_0x1c6a63(0x159)]?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x5cbf1d[_0x1c6a63(0x159)][_0x1c6a63(0x121)])){const _0x249039=_0x1f6e8e(_0x5cbf1d[_0x1c6a63(0x159)][_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+_0x1c6a63(0x171));_0x249039&&(_0x3ddd88[_0x1c6a63(0x159)]['segmentId']=_0x249039);}}}}}
1
+ const a119_0x4f28a3=a119_0x2c28;(function(_0x1ac8d2,_0x4419b4){const _0x2971e7=a119_0x2c28,_0x1fd95a=_0x1ac8d2();while(!![]){try{const _0x54524f=parseInt(_0x2971e7(0x112))/0x1*(parseInt(_0x2971e7(0x163))/0x2)+parseInt(_0x2971e7(0x10d))/0x3*(-parseInt(_0x2971e7(0x12b))/0x4)+-parseInt(_0x2971e7(0x19b))/0x5+-parseInt(_0x2971e7(0x18a))/0x6*(parseInt(_0x2971e7(0x1a9))/0x7)+parseInt(_0x2971e7(0x113))/0x8*(-parseInt(_0x2971e7(0x17e))/0x9)+-parseInt(_0x2971e7(0xfc))/0xa+parseInt(_0x2971e7(0x1d8))/0xb*(parseInt(_0x2971e7(0x1c4))/0xc);if(_0x54524f===_0x4419b4)break;else _0x1fd95a['push'](_0x1fd95a['shift']());}catch(_0x499882){_0x1fd95a['push'](_0x1fd95a['shift']());}}}(a119_0x3fb9,0x1f599));import{createHash}from'crypto';function a119_0x2c28(_0x337935,_0x426d38){_0x337935=_0x337935-0xf9;const _0x3fb9ef=a119_0x3fb9();let _0x2c28bf=_0x3fb9ef[_0x337935];return _0x2c28bf;}export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a119_0x4f28a3(0x10f);export function createPendingSegmentId(_0x1b70ae){return''+PENDING_SEGMENT_PREFIX+_0x1b70ae+'__';}export function isPendingSegmentId(_0x2b2496){const _0x41783c=a119_0x4f28a3;return _0x2b2496[_0x41783c(0x1a2)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x53b6bf){const _0x487ec1=a119_0x4f28a3;return _0x53b6bf[_0x487ec1(0x153)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x300e08){return''+PENDING_ACTIVATION_PREFIX+_0x300e08+'__';}export function isPendingActivationId(_0x2e4155){return _0x2e4155['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1c41a9){const _0x4e9d2e=a119_0x4f28a3;return _0x1c41a9[_0x4e9d2e(0x153)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x308e29,_0x3dbccc){const _0x5cc778=a119_0x4f28a3,_0x58276c=_0x308e29+'::'+(_0x3dbccc['trim']()||_0x5cc778(0x132)),_0x395b99=createHash(_0x5cc778(0x1da))[_0x5cc778(0x197)](_0x58276c)['digest'](_0x5cc778(0x178))[_0x5cc778(0x166)](0x0,0xc);return _0x5cc778(0x1c5)+_0x395b99;}function a119_0x3fb9(){const _0x28d6e0=['JOURNEY_UPDATE_ERROR','activationParams','journey_updating','effectiveFolderId','reduce','message','Created\x20segment\x20\x27','object','hex','createFolder','updateActivation','all','Creating\x20segment\x20\x27','push','1214631cUJOtg','Created\x20activation\x20\x27','createdSegmentId','\x27\x20decision\x20point\x20branch\x20\x27','validatedRequest','journey','folderPath','Updated\x20activation\x20\x27','listSegments','idToName','Updating\x20activation\x20\x27','activations','198102lOXuJH','stringify','SEGMENT_UPDATE_ERROR','draft','diff','connection','deleteActivation','notification','activationContext','\x20journey\x20from\x20file:\x20','description','hasChanges','existingSegments','update','NOT_FOUND','user','utf-8','1255960FXzNem','idToEmailMap','isNew','\x27\x20exit\x20criteria','absolutePath','listActivations','size','startsWith','activation_created','yamlConfig','existingActivation','Creating\x20folder\x20\x27','from','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','21JYiwzb','connector_config','buildUserMaps','segment_updated','embedded_segment_creating','\x27\x20for\x20','\x20(referenced\x20in\x20journey\x20','columns','journeyId','existingJourney','folderPathToId','activation_updated','\x27...','results','schedule','\x20activation\x20\x27','relationships','activation_deleting','createJourneySegment','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','\x20segment\x20from\x20file:\x20','unchanged','decision_point','split','deleteSegment','):\x20','embeddedSegmentNameToId','90924biZHHI','journey_entry_criteria_','type','segmentNameToId','Fetching\x20','logDeleted','errors','goal\x20criteria','resolveJourneyId','SEGMENT_SYNTAX_ERROR','SEGMENT_NOT_FOUND','with','segmentFolderId','entryCriteria','find','yamlActivation','parentSegmentFolder','folderId','withProgress','flatMap','1243mgsRUt','localSegmentRules','sha1','create','Activation',').\x20','logWarning','activation_updating','goal','nameToId','createActivation','Updated\x20journey\x20\x27','segments','delete','segment_deleted','updateSegmentById','relative','journeyBundleName','1493390mvxLWj','ACTIVATION_SYNTAX_ERROR','rootFolderId','Segment\x20not\x20found:\x20','stage\x20\x27','nameToType','set','./child-segment-yaml.js','Updated\x20segment\x20\x27','\x27\x20wait\x20condition','getJourney','Deleting\x20activation\x20\x27','updated','Failed\x20to\x20','folder','INTERNAL','getSegment','222luykde','progress','__pending_act_','parseDocument','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','130747Ksrnqc','8secBVN','dirname','kind','activation_template_id','versionNumber','../../utils/async.js','parentId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','behavior','journeys','parentFolder','add','get','embedded_activation_created','journeyById','toLowerCase','rule','created','milestone','activationActions','\x0a\x20\x20','data','length','createSegment','12108FiCZUH','join','max','entry','Updating\x20segment\x20\x27','embedded_segment_created','existingSegment','segment','parse','map','connectionIdToNameMap','onProgress','journeyStages','resolveSegment','segmentId','deleted','name','list','activationStepsById','segment_updating','Entry\x20criteria:\x20','fetchJourney','all_columns','includes','exitCriterias','ACTIVATION_UPDATE_ERROR','logSuccess','Stage\x20\x27','keys','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','segment_creating','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','JOURNEY_SYNTAX_ERROR','action','./journey-yaml.js','toString','Created\x20folder\x20\x27','Journey\x20\x27','item','journeyActivationStepId','replace','steps','has','attributes','null','logInfo','stages','filter','sort','index','getActivation','segment_created','WaitStep','activation_','Deleted\x20activation\x20\x27','activation_creating','2txEiio','\x20error(s)','\x27\x20from\x20file:\x20','slice','\x27\x20entry\x20criteria','waitCondition','state','entry_criteria','Deleted\x20segment\x20\x27','journey_created','values','branches','segment_deleting'];a119_0x3fb9=function(){return _0x28d6e0;};return a119_0x3fb9();}export function ensureJourneyDefaults(_0x2e7b8a){const _0x1d1419=a119_0x4f28a3;!_0x2e7b8a[_0x1d1419(0x194)]&&(_0x2e7b8a['description']=''),!_0x2e7b8a['state']&&(_0x2e7b8a[_0x1d1419(0x169)]=_0x1d1419(0x18d));}export function resolveTDFolderPath(_0x3989b7,_0x2cd0d2,_0x134a70){if(!_0x2cd0d2)return _0x3989b7;if(_0x3989b7===_0x134a70||_0x3989b7['startsWith'](_0x134a70+'/'))return _0x3989b7;return _0x3989b7?_0x134a70+'/'+_0x3989b7:_0x134a70;}export function addFoldersToCreate(_0x1a88b0,_0x215d56,_0x2a6350){const _0x60ea06=a119_0x4f28a3;if(!_0x1a88b0)return;if(_0x215d56['has'](_0x1a88b0))return;const _0x4ee948=_0x1a88b0[_0x60ea06(0x1c0)]('/');let _0x17bcd4='';for(const _0x10f254 of _0x4ee948){_0x17bcd4=_0x17bcd4?_0x17bcd4+'/'+_0x10f254:_0x10f254,!_0x215d56[_0x60ea06(0x155)](_0x17bcd4)&&_0x2a6350[_0x60ea06(0x11e)](_0x17bcd4);}}import*as a119_0x122c73 from'yaml';import{readFileSync}from'fs';import a119_0xbbf4fa from'path';import{isJourneyDef,parseYamlString as a119_0x4ff776,toYamlString as a119_0x17b759,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(_0xe7dd5e){const _0x73f413=a119_0x4f28a3;if(Array['isArray'](_0xe7dd5e))return'['+_0xe7dd5e['map'](_0x1cf660=>stableStringify(_0x1cf660))[_0x73f413(0x12c)](',')+']';if(_0xe7dd5e&&typeof _0xe7dd5e===_0x73f413(0x177)){const _0x11ea5e=_0xe7dd5e,_0x28c972=Object[_0x73f413(0x147)](_0x11ea5e)[_0x73f413(0x15b)](),_0x17935a=_0x28c972[_0x73f413(0x134)](_0x5532ee=>'\x22'+_0x5532ee+'\x22:'+stableStringify(_0x11ea5e[_0x5532ee]));return'{'+_0x17935a['join'](',')+'}';}const _0x564eab=JSON['stringify'](_0xe7dd5e);return _0x564eab===undefined?_0x73f413(0x157):_0x564eab;}function activationSignature(_0xf53ff){const _0x20096a=a119_0x4f28a3,_0x494966={'connection':_0xf53ff[_0x20096a(0x18f)],..._0xf53ff[_0x20096a(0x141)]!==undefined&&{'all_columns':_0xf53ff[_0x20096a(0x141)]},..._0xf53ff[_0x20096a(0x1b0)]!==undefined&&{'columns':_0xf53ff[_0x20096a(0x1b0)]},..._0xf53ff[_0x20096a(0x11b)]!==undefined&&{'behavior':_0xf53ff[_0x20096a(0x11b)]},..._0xf53ff['schedule']!==undefined&&{'schedule':_0xf53ff[_0x20096a(0x1b7)]},..._0xf53ff['notification']!==undefined&&{'notification':_0xf53ff[_0x20096a(0x191)]},..._0xf53ff[_0x20096a(0x1aa)]!==undefined&&{'connector_config':_0xf53ff[_0x20096a(0x1aa)]},..._0xf53ff['activation_template_id']!==undefined&&{'activation_template_id':_0xf53ff[_0x20096a(0x116)]}};return stableStringify(_0x494966);}export async function prepareSegmentFiles(_0x25772e,_0x4d6961,_0x5025d5,_0x79648a,_0x4002ec){const _0x535784=a119_0x4f28a3,{activationDefToCreateRequest:_0x2ec800}=await import(_0x535784(0x103)),_0x2b1a8a=[],_0x2bf3d8=new Set();for(const {yamlConfig:_0x2fb6e9,folderPath:_0x18f592,sourcePath:_0xb8885e}of _0x25772e){const _0x51e93f=resolveTDFolderPath(_0x18f592,_0x79648a,_0x4002ec),_0x565b6e=_0x51e93f+':'+_0x2fb6e9[_0x535784(0x13b)],_0x335d32=_0x4d6961['segmentByFolderAndName']['get'](_0x565b6e),_0x5dbd5f=_0x335d32?_0x4d6961['activationsBySegmentId'][_0x535784(0x11f)](_0x335d32['id'])||[]:[];addFoldersToCreate(_0x51e93f,_0x4d6961[_0x535784(0x1b3)],_0x2bf3d8);const _0x3eafa6=calculateActivationActions(_0x2fb6e9['activations']||[],_0x5dbd5f,_0x4d6961[_0x535784(0x19c)],_0x4d6961[_0x535784(0x135)]);for(const _0x1f6cc3 of _0x3eafa6){(_0x1f6cc3[_0x535784(0x1c6)]===_0x535784(0x1db)||_0x1f6cc3[_0x535784(0x1c6)]===_0x535784(0x197))&&_0x1f6cc3[_0x535784(0x1d3)]&&(_0x1f6cc3[_0x535784(0x182)]=await _0x2ec800(_0x1f6cc3[_0x535784(0x1d3)],_0x5025d5));}const _0x4c8ca1=calculateSegmentDiff(_0x2fb6e9,_0x335d32,_0x5dbd5f,_0x4d6961['idToEmailMap'],_0x4d6961[_0x535784(0x135)]);_0x2b1a8a[_0x535784(0x17d)]({'relativePath':_0x2fb6e9[_0x535784(0x13b)],'absolutePath':_0xb8885e,'yamlConfig':_0x2fb6e9,'folderPath':_0x51e93f,'existingSegment':_0x335d32,'existingActivations':_0x5dbd5f,'isNew':_0x4c8ca1[_0x535784(0x19d)],'hasChanges':_0x4c8ca1[_0x535784(0x195)],'diff':_0x4c8ca1['diff'],'activationActions':_0x3eafa6});}return{'segmentFiles':_0x2b1a8a,'foldersToCreate':_0x2bf3d8};}export async function prepareJourneyFiles(_0x26c77c,_0x477b31,_0x3b0391,_0x3fac89){const _0x35dcc0=a119_0x4f28a3,_0x3ca5d0=[],_0x166be7=new Set();for(const {yamlConfig:_0x535ae1,folderPath:_0x5087b6,sourcePath:_0x44db6b}of _0x26c77c){const _0x705d2c=resolveTDFolderPath(_0x5087b6,_0x3b0391,_0x3fac89),_0x13b508=_0x705d2c+':'+_0x535ae1['name'],_0x410c13=_0x477b31['journeyBundlesByFolderAndName']['get'](_0x13b508);let _0x4acdec,_0xc11524;if(_0x410c13&&_0x410c13['length']>0x0){const _0x5c6266=buildLocalExpandedRuleMappings(_0x535ae1),{createYamlContext:_0x5daeda,prefetchJourneySegments:_0x2fce36}=createPushYamlContextForBundle(_0x477b31['deps'],_0x477b31[_0x35dcc0(0x119)],_0x477b31[_0x35dcc0(0x196)],_0x5c6266,_0x477b31[_0x35dcc0(0x19c)],_0x477b31[_0x35dcc0(0x135)],_0x477b31[_0x35dcc0(0x13d)],_0x477b31[_0x35dcc0(0x121)]);await _0x2fce36(_0x410c13[_0x35dcc0(0x134)](_0x70e4af=>_0x70e4af['id']));const _0x331e69=hasMultipleVersions(_0x535ae1),_0x5946e2=async _0x383b68=>{const _0xe1bf=_0x35dcc0,_0x3faf9e=_0x477b31[_0xe1bf(0x121)]?.[_0xe1bf(0x11f)](_0x383b68);if(_0x3faf9e)return _0x3faf9e;return _0x477b31[_0xe1bf(0x140)]({'journeyId':_0x383b68,'journeyName':_0x535ae1['name'],'isMultiVersion':_0x410c13[_0xe1bf(0x129)]>0x1});};if(_0x331e69&&_0x410c13[_0x35dcc0(0x129)]>0x1){const _0x2e48e6=[];for(const _0x493f22 of _0x410c13){const _0x50f549=_0x493f22[_0x35dcc0(0x117)]||0x1;_0x477b31['progress']?.[_0x35dcc0(0x197)](_0x35dcc0(0x1c8)+_0x535ae1[_0x35dcc0(0x13b)]+'\x20v'+_0x50f549);const _0x4c9e5c=await _0x5946e2(_0x493f22['id']),_0x553de6=_0x5daeda(_0x493f22['id']),_0x4a487c=await journeyResponseToDef(_0x4c9e5c,_0x553de6);_0x2e48e6[_0x35dcc0(0x17d)]({'item':_0x493f22,'yaml':_0x4a487c});}const _0x2859d8=buildLocalRuleToNameMappingFromJourney(_0x535ae1);_0xc11524=buildMergedJourneyDef(_0x2e48e6,_0x2859d8);const _0x185633=Math[_0x35dcc0(0x12d)](..._0x2e48e6['map'](_0x5604e6=>_0x5604e6[_0x35dcc0(0x151)][_0x35dcc0(0x117)]||0x0)),_0x10b89c=_0x410c13[_0x35dcc0(0x1d2)](_0x592dcd=>(_0x592dcd[_0x35dcc0(0x117)]||0x0)===_0x185633);_0x10b89c&&(_0x477b31[_0x35dcc0(0x10e)]?.[_0x35dcc0(0x197)](_0x35dcc0(0x1c8)+_0x535ae1[_0x35dcc0(0x13b)]+'\x20v'+_0x185633),_0x4acdec=await _0x5946e2(_0x10b89c['id']));}else{const _0x386fc2=_0x410c13[_0x410c13['length']-0x1];_0x477b31[_0x35dcc0(0x10e)]?.['update'](_0x35dcc0(0x1c8)+_0x535ae1['name']),_0x4acdec=await _0x5946e2(_0x386fc2['id']);const _0x1b5864=_0x5daeda(_0x386fc2['id']),_0x37603a=await journeyResponseToDef(_0x4acdec,_0x1b5864),_0x204356=buildLocalRuleToNameMappingFromJourney(_0x535ae1);_0xc11524=buildMergedJourneyDef([{'item':_0x386fc2,'yaml':_0x37603a}],_0x204356);}}addFoldersToCreate(_0x705d2c,_0x477b31[_0x35dcc0(0x1b3)],_0x166be7);const _0x410293=calculateJourneyDiff(_0x535ae1,_0xc11524);_0x3ca5d0[_0x35dcc0(0x17d)]({'relativePath':_0x535ae1[_0x35dcc0(0x13b)],'absolutePath':_0x44db6b,'yamlConfig':_0x535ae1,'folderPath':_0x705d2c,'existingJourney':_0x4acdec,'isNew':_0x410293[_0x35dcc0(0x19d)],'hasChanges':_0x410293['hasChanges'],'diff':_0x410293[_0x35dcc0(0x18e)]});}return{'journeyFiles':_0x3ca5d0,'foldersToCreate':_0x166be7};}export function calculateActivationActions(_0x60cc2d,_0x530959,_0x31ff2b,_0x4a7147){const _0x5c0b7d=a119_0x4f28a3,_0x5a193a=[],_0x2c89dd=new Map();for(const _0x53d134 of _0x530959){_0x2c89dd[_0x5c0b7d(0x102)](_0x53d134[_0x5c0b7d(0x13b)],_0x53d134);}const _0xa01e5b=new Map();for(const _0x3d1c68 of _0x60cc2d){_0xa01e5b[_0x5c0b7d(0x102)](_0x3d1c68[_0x5c0b7d(0x13b)],_0x3d1c68);}for(const _0x50364a of _0x60cc2d){const _0x1c20e2=_0x2c89dd[_0x5c0b7d(0x11f)](_0x50364a[_0x5c0b7d(0x13b)]);if(!_0x1c20e2)_0x5a193a['push']({'type':_0x5c0b7d(0x1db),'name':_0x50364a[_0x5c0b7d(0x13b)],'yamlActivation':_0x50364a});else{const _0x3ea77f=activationResponseToDef(_0x1c20e2,_0x31ff2b,_0x4a7147),_0x5ef6bc=a119_0x122c73[_0x5c0b7d(0x18b)](_0x3ea77f),_0x4f21c0=a119_0x122c73[_0x5c0b7d(0x18b)](_0x50364a);_0x5ef6bc!==_0x4f21c0&&_0x5a193a[_0x5c0b7d(0x17d)]({'type':_0x5c0b7d(0x197),'name':_0x50364a[_0x5c0b7d(0x13b)],'yamlActivation':_0x50364a,'existingActivation':_0x1c20e2});}}for(const _0x39dc1c of _0x530959){!_0xa01e5b['has'](_0x39dc1c[_0x5c0b7d(0x13b)])&&_0x5a193a[_0x5c0b7d(0x17d)]({'type':'delete','name':_0x39dc1c[_0x5c0b7d(0x13b)],'existingActivation':_0x39dc1c});}return _0x5a193a;}export function calculateSegmentDiff(_0x4d7fb9,_0x4deddc,_0x8953f3,_0x37dd3c,_0x5c5c94){const _0x36c3d0=segmentToYamlString(_0x4d7fb9);if(_0x4deddc){const _0x4c0c6b=segmentWithActivationsToYaml(_0x4deddc,_0x8953f3,undefined,_0x37dd3c,_0x5c5c94),_0x411edd=segmentToYamlString(_0x4c0c6b),_0x12e701=generateDiff(_0x411edd,_0x36c3d0),_0x23f98b=hasChanges(_0x12e701);return{'isNew':![],'hasChanges':_0x23f98b,'diff':_0x23f98b?formatDiffWithColors(_0x12e701):undefined};}const _0x58535=generateDiff('',_0x36c3d0);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x58535)};}export function calculateJourneyDiff(_0x3b5334,_0x145e02){const _0x20eb08=normalizeJourneyDef(_0x3b5334,_0x3b5334),_0x486b57=a119_0x17b759(_0x20eb08);if(_0x145e02){const _0x33186e=normalizeJourneyDef(_0x145e02,_0x3b5334),_0x4ab7e0=a119_0x17b759(_0x33186e),_0x36481b=generateDiff(_0x4ab7e0,_0x486b57),_0x1cad6c=hasChanges(_0x36481b);return{'isNew':![],'hasChanges':_0x1cad6c,'diff':_0x1cad6c?formatDiffWithColors(_0x36481b):undefined};}const _0x5c2c7e=generateDiff('',_0x486b57);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5c2c7e)};}export function findSegmentsToDelete(_0x117534,_0x55fdf8,_0x1e92ad,_0x57bdd5,_0x410a45){const _0xf61762=a119_0x4f28a3,_0x31b270=new Set();for(const {yamlConfig:_0x1848fd,folderPath:_0x5b08de}of _0x55fdf8){_0x31b270[_0xf61762(0x11e)](_0x5b08de+':'+_0x1848fd[_0xf61762(0x13b)]);}return _0x117534['filter'](_0x344bb5=>{const _0x22667d=_0xf61762,_0x454c3b=_0x344bb5['segmentFolderId']?_0x1e92ad[_0x22667d(0x11f)](_0x344bb5[_0x22667d(0x1d0)][_0x22667d(0x14e)]())||'':'',_0x5f046f=_0x454c3b+':'+_0x344bb5[_0x22667d(0x13b)];if(_0x31b270[_0x22667d(0x155)](_0x5f046f))return![];if(_0x410a45)return _0x454c3b===_0x57bdd5||_0x454c3b[_0x22667d(0x1a2)](_0x57bdd5+'/');return!![];});}export function findJourneysToDelete(_0x2f5e2a,_0x5ed978,_0x2b5876,_0x21a27c,_0x33ebe5){const _0x332a49=a119_0x4f28a3,_0x4f95a1=new Set();for(const {yamlConfig:_0x34602c,folderPath:_0x242985}of _0x5ed978){_0x4f95a1['add'](_0x242985+':'+_0x34602c[_0x332a49(0x13b)]);}return _0x2f5e2a['filter'](_0x1d08a0=>{const _0x2243d9=_0x332a49,_0x3355d4=_0x1d08a0[_0x2243d9(0x1d5)]?_0x2b5876['get'](_0x1d08a0[_0x2243d9(0x1d5)])||'':'',_0xca3b16=_0x3355d4+':'+_0x1d08a0[_0x2243d9(0xfb)];if(_0x4f95a1[_0x2243d9(0x155)](_0xca3b16))return![];if(_0x33ebe5)return _0x3355d4===_0x21a27c||_0x3355d4[_0x2243d9(0x1a2)](_0x21a27c+'/');return!![];});}export function buildSegmentLookupMap(_0x57e966,_0x26f6d3){const _0xbf075f=a119_0x4f28a3,_0x134fcd=new Map();for(const _0x27620b of _0x57e966){const _0x152323=_0x27620b[_0xbf075f(0x1d0)]?_0x26f6d3['get'](_0x27620b['segmentFolderId'][_0xbf075f(0x14e)]())||'':'',_0x3ae5c1=_0x152323+':'+_0x27620b[_0xbf075f(0x13b)];_0x134fcd[_0xbf075f(0x102)](_0x3ae5c1,_0x27620b);}return _0x134fcd;}export function buildSegmentNameToIdMap(_0x314717){const _0x4b9e72=a119_0x4f28a3,_0x53b06f=new Map();for(const _0x11499c of _0x314717){_0x53b06f['set'](_0x11499c[_0x4b9e72(0x13b)],_0x11499c['id']);}return _0x53b06f;}export function buildJourneyBundleLookupMap(_0x460476,_0x2016c0){const _0xc24c69=a119_0x4f28a3,_0x1df086=new Map();for(const _0x47d125 of _0x460476){const _0x381b39=_0x47d125['folderId']?_0x2016c0[_0xc24c69(0x11f)](_0x47d125[_0xc24c69(0x1d5)])||'':'',_0x2b081d=_0x381b39+':'+_0x47d125[_0xc24c69(0xfb)];!_0x1df086[_0xc24c69(0x155)](_0x2b081d)&&_0x1df086[_0xc24c69(0x102)](_0x2b081d,[]),_0x1df086[_0xc24c69(0x11f)](_0x2b081d)['push'](_0x47d125);}for(const _0x30ca5f of _0x1df086[_0xc24c69(0x16d)]()){_0x30ca5f[_0xc24c69(0x15b)]((_0x50ba85,_0x403030)=>(_0x50ba85['versionNumber']||0x0)-(_0x403030[_0xc24c69(0x117)]||0x0));}return _0x1df086;}export function collectFoldersToCreate(_0x127b54,_0x400cf9){const _0x111db5=a119_0x4f28a3,_0x31e057=new Set();for(const _0x5c81e3 of _0x127b54){if(!_0x5c81e3)continue;if(_0x400cf9[_0x111db5(0x155)](_0x5c81e3))continue;const _0x2f9830=_0x5c81e3[_0x111db5(0x1c0)]('/');let _0x3b5409='';for(const _0x2a4835 of _0x2f9830){_0x3b5409=_0x3b5409?_0x3b5409+'/'+_0x2a4835:_0x2a4835,!_0x400cf9[_0x111db5(0x155)](_0x3b5409)&&_0x31e057['add'](_0x3b5409);}}return _0x31e057;}export function parseAndClassifyYamlFiles(_0x33383b,_0x71cac6,_0x2c7f93){const _0x4e6a62=a119_0x4f28a3,_0x15e0b8=[],_0x46dbd6=[];for(const _0x589e16 of _0x33383b){const _0x4730aa=a119_0xbbf4fa[_0x4e6a62(0xfa)](_0x71cac6,a119_0xbbf4fa[_0x4e6a62(0x114)](_0x589e16)),_0x58578b=_0x4730aa==='.'?'':_0x4730aa,_0x56a9d1=readFileSync(_0x589e16,_0x4e6a62(0x19a)),_0x796c3c=a119_0x122c73[_0x4e6a62(0x133)](_0x56a9d1);if(isJourneyDef(_0x796c3c)){const _0x3ffbc9=a119_0x4ff776(_0x56a9d1);_0x46dbd6[_0x4e6a62(0x17d)]({'yamlConfig':_0x3ffbc9,'folderPath':_0x58578b,'sourcePath':_0x589e16});}else{if(!_0x2c7f93?.['skipSegments']){const _0x4dc758=parseSegmentYamlFile(_0x56a9d1),_0x1c9c4c=normalizeChildSegmentYaml(_0x4dc758);_0x15e0b8['push']({'yamlConfig':_0x1c9c4c,'folderPath':_0x58578b,'sourcePath':_0x589e16});}}}return{'segments':_0x15e0b8,'journeys':_0x46dbd6};}export function validateParsedFiles(_0xe19b33,_0x35c662){const _0x34a252=a119_0x4f28a3,_0x2a0e7b=[];for(const {yamlConfig:_0x247990,sourcePath:_0x325bb6}of _0xe19b33['segments']){const _0x4c6356=readFileSync(_0x325bb6,_0x34a252(0x19a)),_0xb7048f=a119_0x122c73[_0x34a252(0x110)](_0x4c6356),_0x123707=validateSegmentDef(_0x247990,{'source':_0x4c6356,'document':_0xb7048f});if(!_0x123707['valid']){const _0x4f5339=a119_0xbbf4fa['relative'](_0x35c662,_0x325bb6);_0x2a0e7b[_0x34a252(0x17d)]({'filePath':_0x4f5339,'source':_0x4c6356,'result':_0x123707,'isJourney':![]});}}for(const {yamlConfig:_0x5773eb,sourcePath:_0x2552fe}of _0xe19b33[_0x34a252(0x11c)]){const _0x20b75=readFileSync(_0x2552fe,_0x34a252(0x19a)),_0x445989=a119_0x122c73[_0x34a252(0x110)](_0x20b75),_0x372136=validateJourneyDef(_0x5773eb,{'source':_0x20b75,'document':_0x445989});if(!_0x372136['valid']){const _0x3bbae3=a119_0xbbf4fa[_0x34a252(0xfa)](_0x35c662,_0x2552fe);_0x2a0e7b[_0x34a252(0x17d)]({'filePath':_0x3bbae3,'source':_0x20b75,'result':_0x372136,'isJourney':!![]});}}return _0x2a0e7b;}export function formatValidationErrors(_0x451126){const _0x12aebf=a119_0x4f28a3,_0x3f7446=[];for(const {filePath:_0x5acb45,source:_0xdd7399,result:_0x3e87f3,isJourney:_0x3a4360}of _0x451126){const _0x47c26c=_0x3a4360?'journey':_0x12aebf(0x132);_0x3f7446[_0x12aebf(0x17d)]('\x0a'+_0x5acb45+'\x20('+_0x47c26c+_0x12aebf(0x1c2)+_0x3e87f3[_0x12aebf(0x1ca)][_0x12aebf(0x129)]+_0x12aebf(0x164)),_0x3f7446[_0x12aebf(0x17d)](formatValidationResult(_0x3e87f3,_0xdd7399,_0x5acb45));}return _0x3f7446[_0x12aebf(0x12c)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4fe29c){const _0xc71780=a119_0x4f28a3,_0x3a422a=new Set(),_0xa6a0bb=new Map(),_0x31074c=collectSegmentUsageCounts(_0x4fe29c);if(_0x4fe29c[_0xc71780(0x1e4)])for(const [_0x185fc2,_0x39b2c3]of Object['entries'](_0x4fe29c[_0xc71780(0x1e4)])){_0x3a422a[_0xc71780(0x11e)](_0x185fc2);if(_0x39b2c3[_0xc71780(0x123)]){const _0x291a08=yamlRuleToApi(_0x39b2c3[_0xc71780(0x123)]),_0xe2bf88=apiRuleToYaml(_0x291a08);_0xa6a0bb[_0xc71780(0x102)](_0x185fc2,_0xe2bf88);}}const _0x40eb2a=new Map();let _0x37d6e3=0x0;for(const [_0x55a89a,_0x387388]of _0xa6a0bb){const _0x2a0ba6=serializeExpandedRule(_0x387388,_0xa6a0bb),_0x94df38=_0x40eb2a[_0xc71780(0x11f)](_0x2a0ba6)||[];_0x94df38['push']({'name':_0x55a89a,'index':_0x37d6e3}),_0x40eb2a[_0xc71780(0x102)](_0x2a0ba6,_0x94df38),_0x37d6e3++;}const _0x357d9c=new Map();for(const [_0x43e442,_0x51e736]of _0x40eb2a){const _0x419db8=_0x51e736[_0xc71780(0x166)]()['sort']((_0x3ed0d7,_0x5febf1)=>{const _0x1fe316=_0xc71780,_0x3d05e8=_0x31074c[_0x1fe316(0x11f)](_0x3ed0d7['name'])||0x0,_0x272089=_0x31074c[_0x1fe316(0x11f)](_0x5febf1[_0x1fe316(0x13b)])||0x0;if(_0x3d05e8!==_0x272089)return _0x272089-_0x3d05e8;return _0x3ed0d7[_0x1fe316(0x15c)]-_0x5febf1[_0x1fe316(0x15c)];})[_0xc71780(0x134)](_0x534d55=>_0x534d55[_0xc71780(0x13b)]),_0x51cf08=[];for(const _0x39f7c1 of _0x419db8){const _0x1a286d=_0x31074c[_0xc71780(0x11f)](_0x39f7c1)||0x0,_0x201b35=Math['max'](_0x1a286d,0x1);for(let _0x29adf1=0x0;_0x29adf1<_0x201b35;_0x29adf1++){_0x51cf08['push'](_0x39f7c1);}}_0x357d9c['set'](_0x43e442,_0x51cf08);}return{'existingLocalSegmentNames':_0x3a422a,'localSegmentRules':_0xa6a0bb,'localExpandedRuleToNames':_0x357d9c};}async function buildServerSegmentRuleMap(_0x5473be,_0x286295,_0x420af3,_0x34a5e1){const _0x4c2bd0=new Map(),_0xa7cfee=new Set(),_0x58c850=async _0x5ddf22=>{const _0x4d2026=a119_0x2c28;if(_0xa7cfee[_0x4d2026(0x155)](_0x5ddf22))return;_0xa7cfee[_0x4d2026(0x11e)](_0x5ddf22);let _0xcc8ca3=_0x420af3[_0x4d2026(0x1d2)](_0x132f5c=>_0x132f5c['id']===_0x5ddf22);if(!_0xcc8ca3)try{_0xcc8ca3=await _0x5473be[_0x4d2026(0x132)][_0x4d2026(0x10c)](_0x286295,_0x5ddf22);}catch{return;}if(!_0xcc8ca3?.['rule'])return;const _0x3c55ae=apiRuleToYaml(_0xcc8ca3[_0x4d2026(0x123)]);_0x4c2bd0[_0x4d2026(0x102)](_0x5ddf22,_0x3c55ae);const _0x25c7ea=collectSegmentRefsFromRule(_0x3c55ae);for(const _0x534012 of _0x25c7ea){await _0x58c850(_0x534012);}};for(const _0x5575c8 of _0x34a5e1){await _0x58c850(_0x5575c8);}return _0x4c2bd0;}export function createSegmentIdResolver(_0x339d1a,_0xd1ef36){return async _0x5cfb5b=>{const _0x277c16=a119_0x2c28,_0x519287=_0x339d1a['get'](_0x5cfb5b);if(!_0x519287)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x277c16(0xff)+_0x5cfb5b+_0x277c16(0x11a)+_0xd1ef36+'\x27)');return _0x519287;};}export function extractRootFolderId(_0x414444){const _0xf2e5d3=a119_0x4f28a3;return _0x414444[_0xf2e5d3(0x1b9)]?.[_0xf2e5d3(0x1d4)]?.[_0xf2e5d3(0x128)]?.['id']||_0x414444[_0xf2e5d3(0x1b9)]?.[_0xf2e5d3(0x11d)]?.[_0xf2e5d3(0x128)]?.['id'];}export function buildConnectionMaps(_0x1b3881){const _0x4e9626=a119_0x4f28a3,_0x2094b0=new Map(),_0x3aa3dc=new Map(),_0x5e5417=new Map();for(const _0x589c0d of _0x1b3881){_0x2094b0[_0x4e9626(0x102)](_0x589c0d[_0x4e9626(0x13b)],parseInt(_0x589c0d['id'],0xa)),_0x3aa3dc[_0x4e9626(0x102)](_0x589c0d['id'],_0x589c0d[_0x4e9626(0x13b)]),_0x5e5417[_0x4e9626(0x102)](_0x589c0d['name'],_0x589c0d[_0x4e9626(0x1c6)]);}return{'nameToId':_0x2094b0,'idToName':_0x3aa3dc,'nameToType':_0x5e5417};}export function calculatePushStats(_0x331cdc,_0x4b78f2,_0x4b56e7,_0x9fefad,_0x31dbb8,_0x35b438,_0x39a44f){const _0x3a7bf9=a119_0x4f28a3,_0x78905a=_0x331cdc['filter'](_0xc61514=>_0xc61514[_0x3a7bf9(0x19d)]),_0x28a447=_0x331cdc[_0x3a7bf9(0x15a)](_0x44d1f4=>!_0x44d1f4[_0x3a7bf9(0x19d)]&&_0x44d1f4['hasChanges']),_0x7d23d8=_0x331cdc[_0x3a7bf9(0x15a)](_0x7df72e=>!_0x7df72e[_0x3a7bf9(0x19d)]&&!_0x7df72e[_0x3a7bf9(0x195)]),_0x57b16a=_0x35b438?_0x9fefad:[],_0x2e74cd=_0x4b78f2[_0x3a7bf9(0x15a)](_0x3fe0b1=>_0x3fe0b1['isNew']),_0x2dfdfd=_0x4b78f2[_0x3a7bf9(0x15a)](_0x5534dd=>!_0x5534dd[_0x3a7bf9(0x19d)]&&_0x5534dd[_0x3a7bf9(0x195)]),_0x5c6ff9=_0x4b78f2[_0x3a7bf9(0x15a)](_0x46ab05=>!_0x46ab05[_0x3a7bf9(0x19d)]&&!_0x46ab05[_0x3a7bf9(0x195)]),_0x33b547=_0x35b438?_0x31dbb8:[],_0x230ba7=_0x331cdc[_0x3a7bf9(0x1d7)](_0x305823=>_0x305823[_0x3a7bf9(0x126)]),_0x45be7b=_0x230ba7[_0x3a7bf9(0x15a)](_0x5c57af=>_0x5c57af[_0x3a7bf9(0x1c6)]===_0x3a7bf9(0x1db)),_0x4564ad=_0x230ba7['filter'](_0x22f95c=>_0x22f95c[_0x3a7bf9(0x1c6)]===_0x3a7bf9(0x197)),_0x17ce55=_0x230ba7['filter'](_0x1a4195=>_0x1a4195[_0x3a7bf9(0x1c6)]===_0x3a7bf9(0x1e5)),_0x710224=Array[_0x3a7bf9(0x1a7)](_0x4b56e7)[_0x3a7bf9(0x15b)](),_0x27d19b=_0x39a44f?![]:_0x78905a[_0x3a7bf9(0x129)]>0x0||_0x28a447[_0x3a7bf9(0x129)]>0x0||_0x57b16a['length']>0x0,_0x565e90=_0x2e74cd['length']>0x0||_0x2dfdfd[_0x3a7bf9(0x129)]>0x0||_0x33b547[_0x3a7bf9(0x129)]>0x0,_0x149dd9=_0x39a44f?![]:_0x230ba7[_0x3a7bf9(0x129)]>0x0,_0x10d6b3=_0x710224[_0x3a7bf9(0x129)]>0x0;return{'segments':{'new':_0x78905a,'changed':_0x28a447,'unchanged':_0x7d23d8,'toDelete':_0x57b16a},'journeys':{'new':_0x2e74cd,'changed':_0x2dfdfd,'unchanged':_0x5c6ff9,'toDelete':_0x33b547},'activations':{'all':_0x230ba7,'toCreate':_0x45be7b,'toUpdate':_0x4564ad,'toDelete':_0x17ce55},'folders':{'toCreate':_0x710224},'counts':{'segments':{'new':_0x78905a[_0x3a7bf9(0x129)],'changed':_0x28a447['length'],'unchanged':_0x7d23d8['length'],'toDelete':_0x57b16a[_0x3a7bf9(0x129)]},'journeys':{'new':_0x2e74cd[_0x3a7bf9(0x129)],'changed':_0x2dfdfd[_0x3a7bf9(0x129)],'unchanged':_0x5c6ff9[_0x3a7bf9(0x129)],'toDelete':_0x33b547[_0x3a7bf9(0x129)]},'activations':{'create':_0x45be7b[_0x3a7bf9(0x129)],'update':_0x4564ad[_0x3a7bf9(0x129)],'delete':_0x17ce55['length']},'folders':_0x710224[_0x3a7bf9(0x129)]},'hasChanges':_0x27d19b||_0x565e90||_0x149dd9||_0x10d6b3};}export async function buildPushExecutionContext(_0x55675f,_0xbe9078,_0x226389,_0xd6cdf6,_0xe58f7,_0x5b0c9a){const _0x2aa2cf=a119_0x4f28a3,_0x4ed21c=extractRootFolderId(_0x226389),{pathToId:_0x1a314b,idToPath:_0x3e289e}=buildFolderMaps(_0xe58f7),_0x5c2f07=buildSegmentNameToIdMap(_0xd6cdf6),_0x5c9814=new Map(),{batchAsync:_0x11d99e}=await import(_0x2aa2cf(0x118)),[_0x3645d6,_0x47dd32]=await Promise['all']([_0x55675f[_0x2aa2cf(0x199)][_0x2aa2cf(0x1ab)](),_0x55675f[_0x2aa2cf(0x18f)][_0x2aa2cf(0x13c)](),((async()=>{const _0x29d525=_0x2aa2cf;!_0x5b0c9a&&_0xd6cdf6[_0x29d525(0x129)]>0x0&&await _0x11d99e(_0xd6cdf6,async _0x109176=>{const _0x51d749=_0x29d525,_0x3c7008=await _0x55675f[_0x51d749(0x132)]['listActivations'](_0xbe9078,_0x109176['id']);_0x5c9814[_0x51d749(0x102)](_0x109176['id'],_0x3c7008);});})())]),{emailToId:_0x13c413,idToEmail:_0x40acfa}=_0x3645d6,_0x5a099e=buildConnectionMaps(_0x47dd32);return{'rootFolderId':_0x4ed21c,'folderPathToId':_0x1a314b,'folderIdToPath':_0x3e289e,'segmentNameToId':_0x5c2f07,'activationsBySegmentId':_0x5c9814,'emailToIdMap':_0x13c413,'idToEmailMap':_0x40acfa,'connectionNameToIdMap':_0x5a099e[_0x2aa2cf(0x1e1)],'connectionIdToNameMap':_0x5a099e[_0x2aa2cf(0x187)],'connectionNameToTypeMap':_0x5a099e[_0x2aa2cf(0x101)]};}export function createPushYamlContextForBundle(_0x5766eb,_0x354b52,_0x3cbbe2,_0xc72f42,_0x2af621,_0x21f959,_0x30c3dd,_0x1df004){const {existingLocalSegmentNames:_0x20f9b9,localExpandedRuleToNames:_0x9c2959}=_0xc72f42,_0x596f60=new Set(),_0x2aa40f=new Map(),_0x4e6e39=new Map(),_0x1d8430=new Map(),_0x4373ec=createJumpTargetCache(),_0x545388=new Map(),_0x4504fd=new Map(),_0x39e357=new Set();let _0x2269f9;const _0x141cda=_0x11f6bd=>{const _0x2a8783={'resolveSegment':async _0x206467=>{const _0x1ba7ce=a119_0x2c28,_0x3cf7d1=_0x1d8430[_0x1ba7ce(0x11f)](_0x206467);if(_0x3cf7d1!==undefined)return{'name':_0x3cf7d1,'isJourneyLocal':!![]};try{let _0x596509=_0x3cbbe2[_0x1ba7ce(0x1d2)](_0x3d8faf=>_0x3d8faf['id']===_0x206467);!_0x596509&&(_0x596509=await _0x5766eb[_0x1ba7ce(0x132)][_0x1ba7ce(0x10c)](_0x354b52,_0x206467));const _0x96ab7e=generateJourneyLocalName(_0x596509[_0x1ba7ce(0x13b)]),_0x26f7d1=_0x596509[_0x1ba7ce(0x115)]===SEGMENT_KIND_JOURNEY&&_0x96ab7e!==undefined;let _0x27b433=_0x596509[_0x1ba7ce(0x13b)],_0x4129c5;if(_0x26f7d1&&_0x596509['rule']){const _0x39e583=apiRuleToYaml(_0x596509['rule']);_0x4504fd[_0x1ba7ce(0x102)](_0x206467,_0x39e583);const _0x34492a=async _0x58e216=>{const _0x53936d=_0x1ba7ce,_0x2acbf1=collectSegmentRefsFromRule(_0x58e216);for(const _0x321651 of _0x2acbf1){if(!_0x4504fd[_0x53936d(0x155)](_0x321651))try{const _0x4f0f18=await _0x5766eb[_0x53936d(0x132)][_0x53936d(0x10c)](_0x354b52,_0x321651);if(_0x4f0f18?.[_0x53936d(0x123)]){const _0x15d011=apiRuleToYaml(_0x4f0f18[_0x53936d(0x123)]);_0x4504fd[_0x53936d(0x102)](_0x321651,_0x15d011),await _0x34492a(_0x15d011);}}catch{}}};await _0x34492a(_0x39e583);const _0x1e6478=serializeExpandedRule(_0x39e583,_0x4504fd),_0x4bdffd=_0x9c2959[_0x1ba7ce(0x11f)](_0x1e6478);if(_0x4bdffd&&_0x4bdffd[_0x1ba7ce(0x129)]>0x0){const _0x259e6b=_0x2aa40f[_0x1ba7ce(0x11f)](_0x1e6478)||0x0,_0x169926=_0x4bdffd[_0x259e6b]||_0x4bdffd[_0x4bdffd['length']-0x1];_0x2aa40f[_0x1ba7ce(0x102)](_0x1e6478,_0x259e6b+0x1),_0x27b433=_0x169926,_0x596f60[_0x1ba7ce(0x11e)](_0x27b433),_0x1d8430[_0x1ba7ce(0x102)](_0x206467,_0x27b433);const _0x25a188=await resolveRuleSegmentRefs(_0x39e583,async _0x44dbc4=>{const _0x2f9655=_0x1ba7ce,_0x266149=_0x1d8430[_0x2f9655(0x11f)](_0x44dbc4);if(_0x266149)return _0x266149;const _0x489e88=await _0x2269f9[_0x2f9655(0x138)](_0x44dbc4);return _0x489e88[_0x2f9655(0x13b)];});_0x4129c5={'description':_0x596509[_0x1ba7ce(0x194)],'rule':_0x25a188};}else{const _0xeafb47=_0x545388['get'](_0x1e6478);if(_0xeafb47)_0x27b433=_0xeafb47,_0x1d8430[_0x1ba7ce(0x102)](_0x206467,_0x27b433);else{if(_0x96ab7e){let _0x1f1a38=_0x96ab7e,_0x54921=0x2;while(_0x596f60['has'](_0x1f1a38)||_0x20f9b9[_0x1ba7ce(0x155)](_0x1f1a38)){_0x1f1a38=_0x96ab7e+'_'+_0x54921,_0x54921++;}_0x596f60[_0x1ba7ce(0x11e)](_0x1f1a38),_0x27b433=_0x1f1a38;}_0x1d8430['set'](_0x206467,_0x27b433),_0x545388[_0x1ba7ce(0x102)](_0x1e6478,_0x27b433);const _0x16ec01=await resolveRuleSegmentRefs(_0x39e583,async _0x9db26a=>{const _0x1c14b0=_0x1ba7ce,_0x2ad618=_0x1d8430['get'](_0x9db26a);if(_0x2ad618)return _0x2ad618;const _0x58620a=await _0x2269f9[_0x1c14b0(0x138)](_0x9db26a);return _0x58620a[_0x1c14b0(0x13b)];});_0x4129c5={'description':_0x596509[_0x1ba7ce(0x194)],'rule':_0x16ec01};}}}return{'name':_0x27b433,'isJourneyLocal':_0x26f7d1,'definition':_0x4129c5};}catch{return{'name':_0x206467,'isJourneyLocal':![]};}},'resolveActivation':async _0x10a8ec=>{const _0x1ecb2e=a119_0x2c28,_0xd64e8e=_0x4e6e39[_0x1ecb2e(0x11f)](_0x10a8ec);if(_0xd64e8e!==undefined)return{'name':_0xd64e8e,'isJourneyLocal':!![]};try{let _0x2a7887=_0x30c3dd?.[_0x1ecb2e(0x11f)](_0x10a8ec);!_0x2a7887&&(_0x2a7887=await _0x5766eb[_0x1ecb2e(0x183)][_0x1ecb2e(0x15d)](_0x11f6bd,_0x10a8ec));const _0x325a20=_0x2a7887[_0x1ecb2e(0x156)][_0x1ecb2e(0x171)]['name']||_0x10a8ec,_0x4874b1=sanitizeYamlKey(_0x325a20)||_0x1ecb2e(0x160)+_0x10a8ec,_0x1a6026=_0x4874b1;_0x4e6e39['set'](_0x10a8ec,_0x1a6026);const _0x53b610=journeyActivationStepToYaml(_0x2a7887,_0x2af621,_0x21f959);return{'name':_0x1a6026,'isJourneyLocal':!![],'definition':_0x53b610};}catch{return{'name':_0x10a8ec,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2f309e,_0x1d8f1b)=>resolveJumpTarget(_0x2f309e,_0x1d8f1b,_0x4373ec,async _0x77e1e2=>{const _0x32d57e=a119_0x2c28,_0x2b57d7=_0x1df004?.[_0x32d57e(0x11f)](_0x77e1e2);if(_0x2b57d7)return _0x2b57d7;return _0x5766eb[_0x32d57e(0x183)][_0x32d57e(0x106)](_0x77e1e2);})};return _0x2269f9=_0x2a8783,_0x2a8783;},_0x57d5bb=async _0x6c8efb=>{const _0x68008a=a119_0x2c28,{collectSegmentIdsFromJourneyApi:_0x5a3832}=await import('./journey-yaml.js'),{batchAsync:_0x2511ae}=await import(_0x68008a(0x118)),_0x1996de=new Set();for(const _0x57a6c3 of _0x6c8efb){let _0xc76d12=_0x1df004?.[_0x68008a(0x11f)](_0x57a6c3);!_0xc76d12&&(_0xc76d12=await _0x5766eb['journey'][_0x68008a(0x106)](_0x57a6c3));const _0xb66cbe=_0x5a3832(_0xc76d12);for(const _0x2a9fff of _0xb66cbe){_0x1996de[_0x68008a(0x11e)](_0x2a9fff);}}let _0x29b572=Array[_0x68008a(0x1a7)](_0x1996de);while(_0x29b572[_0x68008a(0x129)]>0x0){const _0x4188d6=_0x29b572[_0x68008a(0x15a)](_0x288bea=>!_0x39e357['has'](_0x288bea));if(_0x4188d6[_0x68008a(0x129)]===0x0)break;const _0x5b25fd=await _0x2511ae(_0x4188d6,async _0x34f0c7=>{const _0x4c2246=_0x68008a;_0x39e357['add'](_0x34f0c7);let _0x4e373b=_0x3cbbe2[_0x4c2246(0x1d2)](_0xef8fa=>_0xef8fa['id']===_0x34f0c7);if(!_0x4e373b)try{_0x4e373b=await _0x5766eb['segment'][_0x4c2246(0x10c)](_0x354b52,_0x34f0c7);}catch{return null;}return{'segmentId':_0x34f0c7,'segment':_0x4e373b};},0xa),_0x4750e5=new Set();for(const _0x5cd471 of _0x5b25fd){if(!_0x5cd471?.[_0x68008a(0x132)]?.[_0x68008a(0x123)])continue;const _0x2de31e=apiRuleToYaml(_0x5cd471['segment']['rule']);_0x4504fd[_0x68008a(0x102)](_0x5cd471[_0x68008a(0x139)],_0x2de31e);const _0x262175=collectSegmentRefsFromRule(_0x2de31e);for(const _0x5b3de2 of _0x262175){!_0x39e357[_0x68008a(0x155)](_0x5b3de2)&&_0x4750e5[_0x68008a(0x11e)](_0x5b3de2);}}_0x29b572=Array[_0x68008a(0x1a7)](_0x4750e5);}};return{'createYamlContext':_0x141cda,'prefetchJourneySegments':_0x57d5bb};}export async function executePushSegments(_0x552b14,_0x34a8fb,_0x200998,_0x5409d,_0x5211b7){const _0x1eaa72=a119_0x4f28a3,{segmentDefToCreateRequest:_0x18dffd,segmentDefToUpdateRequest:_0x5759ee}=await import('./child-segment-yaml.js'),_0x5441a9=_0x200998['folderPathToId'],_0x16f2bd=0x5,_0x566803=async _0x2bf6d3=>{const _0x10bf6d=a119_0x2c28,_0x3f5c74=_0x2bf6d3[_0x10bf6d(0x184)]?_0x5441a9[_0x10bf6d(0x11f)](_0x2bf6d3[_0x10bf6d(0x184)]):undefined;let _0x45cff7;const _0x5c5eb5={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x2bf6d3[_0x10bf6d(0x19d)]){_0x5211b7[_0x10bf6d(0x136)]?.({'type':_0x10bf6d(0x149),'name':_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]});const _0x42c7df=_0x18dffd(_0x2bf6d3[_0x10bf6d(0x1a4)],_0x3f5c74),_0x16b209=await _0x5211b7['withProgress'](_0x10bf6d(0x17c)+_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]+'\x27...',()=>_0x552b14['segment'][_0x10bf6d(0x12a)](_0x5409d[_0x10bf6d(0x119)],_0x42c7df));_0x45cff7=_0x16b209[_0x10bf6d(0x128)]['id'],_0x5c5eb5['createdSegmentId']={'name':_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)],'id':_0x45cff7},_0x5211b7[_0x10bf6d(0x136)]?.({'type':_0x10bf6d(0x15e),'name':_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)],'segmentId':_0x45cff7}),_0x5211b7[_0x10bf6d(0x145)]?.(_0x10bf6d(0x176)+_0x2bf6d3[_0x10bf6d(0x1a4)]['name']+'\x27'),_0x5c5eb5[_0x10bf6d(0x124)]=0x1;}else{if(_0x2bf6d3[_0x10bf6d(0x195)]){_0x5211b7[_0x10bf6d(0x136)]?.({'type':_0x10bf6d(0x13e),'name':_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]});const _0x3dd09d=_0x5759ee(_0x2bf6d3[_0x10bf6d(0x1a4)]);_0x3f5c74!==_0x2bf6d3[_0x10bf6d(0x131)]?.[_0x10bf6d(0x1d0)]&&(_0x3dd09d[_0x10bf6d(0x1d0)]=_0x3f5c74?parseInt(_0x3f5c74,0xa):undefined),await _0x5211b7[_0x10bf6d(0x1d6)](_0x10bf6d(0x12f)+_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]+'\x27...',()=>_0x552b14[_0x10bf6d(0x132)][_0x10bf6d(0xf9)](_0x5409d[_0x10bf6d(0x119)],_0x2bf6d3[_0x10bf6d(0x131)]['id'],_0x3dd09d)),_0x45cff7=_0x2bf6d3[_0x10bf6d(0x131)]['id'],_0x5211b7['onProgress']?.({'type':_0x10bf6d(0x1ac),'name':_0x2bf6d3[_0x10bf6d(0x1a4)]['name']}),_0x5211b7['logSuccess']?.(_0x10bf6d(0x104)+_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]+'\x27'),_0x5c5eb5[_0x10bf6d(0x108)]=0x1;}else _0x45cff7=_0x2bf6d3[_0x10bf6d(0x131)]['id'];}}catch(_0x2e7939){const _0x313d4d=isHttp400Error(_0x2e7939),_0x16c5ef=_0x313d4d?ErrorCode[_0x10bf6d(0x1cd)]:ErrorCode[_0x10bf6d(0x18c)],_0xc4dfd5=getErrorMessage(_0x2e7939);throw new SDKError(_0x16c5ef,_0x10bf6d(0x109)+(_0x2bf6d3[_0x10bf6d(0x19d)]?_0x10bf6d(0x1db):_0x10bf6d(0x197))+_0x10bf6d(0x1bd)+_0x2bf6d3[_0x10bf6d(0x19f)]+'\x0a\x20\x20'+_0xc4dfd5,_0x2e7939);}try{const _0x42d34c=await syncActivationsForSegment(_0x552b14,_0x5409d['parentId'],_0x45cff7,_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)],_0x2bf6d3[_0x10bf6d(0x126)],_0x5211b7,_0x2bf6d3[_0x10bf6d(0x19f)]);_0x5c5eb5['activations']=_0x42d34c;}catch(_0x513552){if(_0x513552 instanceof SDKError)throw _0x513552;throw new SDKError(ErrorCode[_0x10bf6d(0x144)],_0x10bf6d(0x111)+_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]+_0x10bf6d(0x165)+_0x2bf6d3['absolutePath']+_0x10bf6d(0x127)+getErrorMessage(_0x513552),_0x513552);}return _0x5c5eb5;},_0xd8a3ef=await batchAsync(_0x34a8fb,_0x566803,_0x16f2bd),_0xdbabf8={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2b4f15 of _0xd8a3ef){_0xdbabf8['created']+=_0x2b4f15[_0x1eaa72(0x124)],_0xdbabf8[_0x1eaa72(0x108)]+=_0x2b4f15[_0x1eaa72(0x108)],_0x2b4f15[_0x1eaa72(0x180)]&&_0xdbabf8['createdSegmentIds'][_0x1eaa72(0x102)](_0x2b4f15[_0x1eaa72(0x180)][_0x1eaa72(0x13b)],_0x2b4f15[_0x1eaa72(0x180)]['id']),_0xdbabf8[_0x1eaa72(0x189)][_0x1eaa72(0x124)]+=_0x2b4f15['activations'][_0x1eaa72(0x124)],_0xdbabf8['activations'][_0x1eaa72(0x108)]+=_0x2b4f15['activations']['updated'],_0xdbabf8[_0x1eaa72(0x189)][_0x1eaa72(0x13a)]+=_0x2b4f15[_0x1eaa72(0x189)][_0x1eaa72(0x13a)];}return _0xdbabf8;}async function syncActivationsForSegment(_0x4bd4ef,_0x578348,_0x2cd111,_0x65f92b,_0x564b65,_0x1407fd,_0x19130e){const _0x306fbd=a119_0x4f28a3,_0x2d7129={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1dabd9 of _0x564b65){try{if(_0x1dabd9[_0x306fbd(0x1c6)]===_0x306fbd(0x1db)&&_0x1dabd9[_0x306fbd(0x182)])_0x1407fd['onProgress']?.({'type':_0x306fbd(0x162),'segmentName':_0x65f92b,'activationName':_0x1dabd9['name']}),await _0x1407fd['withProgress']('Creating\x20activation\x20\x27'+_0x1dabd9[_0x306fbd(0x13b)]+'\x27...',()=>_0x4bd4ef[_0x306fbd(0x132)]['createActivation'](_0x578348,_0x2cd111,_0x1dabd9[_0x306fbd(0x182)])),_0x1407fd[_0x306fbd(0x136)]?.({'type':_0x306fbd(0x1a3),'segmentName':_0x65f92b,'activationName':_0x1dabd9['name']}),_0x1407fd[_0x306fbd(0x145)]?.(_0x306fbd(0x17f)+_0x1dabd9[_0x306fbd(0x13b)]+'\x27'),_0x2d7129[_0x306fbd(0x124)]++;else{if(_0x1dabd9['type']===_0x306fbd(0x197)&&_0x1dabd9[_0x306fbd(0x182)]&&_0x1dabd9[_0x306fbd(0x1a5)])_0x1407fd[_0x306fbd(0x136)]?.({'type':_0x306fbd(0x1df),'segmentName':_0x65f92b,'activationName':_0x1dabd9[_0x306fbd(0x13b)]}),await _0x1407fd[_0x306fbd(0x1d6)](_0x306fbd(0x188)+_0x1dabd9[_0x306fbd(0x13b)]+_0x306fbd(0x1b5),()=>_0x4bd4ef[_0x306fbd(0x132)][_0x306fbd(0x17a)](_0x578348,_0x2cd111,_0x1dabd9['existingActivation']['id'],_0x1dabd9[_0x306fbd(0x182)])),_0x1407fd[_0x306fbd(0x136)]?.({'type':_0x306fbd(0x1b4),'segmentName':_0x65f92b,'activationName':_0x1dabd9[_0x306fbd(0x13b)]}),_0x1407fd[_0x306fbd(0x145)]?.(_0x306fbd(0x185)+_0x1dabd9['name']+'\x27'),_0x2d7129['updated']++;else _0x1dabd9[_0x306fbd(0x1c6)]===_0x306fbd(0x1e5)&&_0x1dabd9[_0x306fbd(0x1a5)]&&(_0x1407fd[_0x306fbd(0x136)]?.({'type':_0x306fbd(0x1ba),'segmentName':_0x65f92b,'activationName':_0x1dabd9[_0x306fbd(0x13b)]}),await _0x1407fd[_0x306fbd(0x1d6)](_0x306fbd(0x107)+_0x1dabd9[_0x306fbd(0x13b)]+_0x306fbd(0x1b5),()=>_0x4bd4ef[_0x306fbd(0x132)][_0x306fbd(0x190)](_0x578348,_0x2cd111,_0x1dabd9['existingActivation']['id'])),_0x1407fd['onProgress']?.({'type':'activation_deleted','segmentName':_0x65f92b,'activationName':_0x1dabd9[_0x306fbd(0x13b)]}),_0x1407fd[_0x306fbd(0x1c9)]?.(_0x306fbd(0x161)+_0x1dabd9[_0x306fbd(0x13b)]+'\x27'),_0x2d7129[_0x306fbd(0x13a)]++);}}catch(_0x3f8d3f){const _0x4014c5=isHttp400Error(_0x3f8d3f),_0x45eff6=_0x4014c5?ErrorCode[_0x306fbd(0xfd)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xa0ce19=getErrorMessage(_0x3f8d3f);throw new SDKError(_0x45eff6,_0x306fbd(0x109)+_0x1dabd9[_0x306fbd(0x1c6)]+_0x306fbd(0x1b8)+_0x1dabd9[_0x306fbd(0x13b)]+_0x306fbd(0x165)+_0x19130e+_0x306fbd(0x127)+_0xa0ce19,_0x3f8d3f);}}return _0x2d7129;}export async function executePushFolders(_0x12ddf7,_0x2dab6c,_0x500d59,_0x2972d1,_0x56ee4d){const _0x4f59ff=a119_0x4f28a3,_0x38ad35=new Map(_0x500d59);for(const _0xe97eed of _0x2dab6c){const _0x4b142b=_0xe97eed[_0x4f59ff(0x1c0)]('/'),_0x3e97c0=_0x4b142b[_0x4b142b[_0x4f59ff(0x129)]-0x1],_0x415d1c=_0x4b142b[_0x4f59ff(0x166)](0x0,-0x1)['join']('/'),_0x9e4c1f=_0x38ad35['get'](_0x415d1c);_0x56ee4d['onProgress']?.({'type':'folder_creating','folder':_0xe97eed});const _0x38b602={'name':_0x3e97c0,'parentFolderId':_0x9e4c1f},_0x268382=await _0x56ee4d[_0x4f59ff(0x1d6)](_0x4f59ff(0x1a6)+_0xe97eed+_0x4f59ff(0x1b5),()=>_0x12ddf7['segment'][_0x4f59ff(0x179)](_0x2972d1[_0x4f59ff(0x119)],_0x38b602));_0x38ad35[_0x4f59ff(0x102)](_0xe97eed,_0x268382[_0x4f59ff(0x128)]['id']),_0x56ee4d[_0x4f59ff(0x136)]?.({'type':'folder_created','folder':_0xe97eed,'folderId':_0x268382[_0x4f59ff(0x128)]['id']}),_0x56ee4d[_0x4f59ff(0x158)]?.(_0x4f59ff(0x14f)+_0xe97eed+'\x27');}return _0x38ad35;}export async function executePushSegmentDeletions(_0x3c07bd,_0x5788e1,_0x3394ea){const _0x43071a=a119_0x4f28a3;if(_0x5788e1['length']===0x0)return 0x0;const {batchAsync:_0x2dbcee}=await import(_0x43071a(0x118)),_0x4a48fe=0x5,_0x21b8f2=await _0x2dbcee(_0x5788e1,async _0xf6e0b1=>{const _0x12ff78=_0x43071a;return _0x3394ea['onProgress']?.({'type':_0x12ff78(0x16f),'name':_0xf6e0b1[_0x12ff78(0x13b)]}),await _0x3c07bd[_0x12ff78(0x132)][_0x12ff78(0x1c1)](_0xf6e0b1['id']),_0x3394ea[_0x12ff78(0x136)]?.({'type':_0x12ff78(0x1e6),'name':_0xf6e0b1[_0x12ff78(0x13b)]}),_0x3394ea[_0x12ff78(0x1c9)]?.(_0x12ff78(0x16b)+_0xf6e0b1[_0x12ff78(0x13b)]+'\x27'),0x1;},_0x4a48fe);return _0x21b8f2[_0x43071a(0x174)]((_0x41fc3d,_0x503f27)=>_0x41fc3d+_0x503f27,0x0);}export async function executePushJourneys(_0x1d8358,_0x466a8c,_0x128931,_0xbbaa83,_0x2c3322){const _0x31d0bf=a119_0x4f28a3,{journeyDefToRequest:_0x8f4a92}=await import(_0x31d0bf(0x14d)),{activationDefToCreateRequest:_0x5b436a,yamlRuleToApi:_0x29e49b,validateSegmentRule:_0x4beec9}=await import(_0x31d0bf(0x103)),_0x353e44={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x431a67=new Map(_0x128931[_0x31d0bf(0x1c7)]),_0x9e758f=0x5;for(let _0xe46b7=0x0;_0xe46b7<_0x466a8c[_0x31d0bf(0x129)];_0xe46b7+=_0x9e758f){const _0x173bdd=_0x466a8c[_0x31d0bf(0x166)](_0xe46b7,_0xe46b7+_0x9e758f),_0x33e89a=await Promise[_0x31d0bf(0x17b)](_0x173bdd['map'](async _0x38ffb6=>{const _0x382cb5=_0x31d0bf;if(!_0x38ffb6[_0x382cb5(0x19d)]&&!_0x38ffb6[_0x382cb5(0x195)])return{'action':_0x382cb5(0x1be),'name':_0x38ffb6['yamlConfig']['name'],'journeyId':_0x38ffb6[_0x382cb5(0x1b2)]?.['id']};const _0x389ce6=_0x38ffb6[_0x382cb5(0x184)]?_0x128931[_0x382cb5(0x1b3)][_0x382cb5(0x11f)](_0x38ffb6[_0x382cb5(0x184)]):undefined;_0x2c3322[_0x382cb5(0x136)]?.({'type':_0x38ffb6[_0x382cb5(0x19d)]?'journey_creating':_0x382cb5(0x172),'name':_0x38ffb6[_0x382cb5(0x1a4)][_0x382cb5(0x13b)]});try{const _0x4014f3=await executeSingleJourneyPush(_0x1d8358,_0x38ffb6,{..._0x128931,'segmentNameToId':_0x431a67},{'parentId':_0xbbaa83[_0x382cb5(0x119)],'rootFolderId':_0xbbaa83['rootFolderId'],'folderId':_0x389ce6,'verbose':_0xbbaa83['verbose']},_0x2c3322,{'journeyDefToRequest':_0x8f4a92,'activationDefToCreateRequest':_0x5b436a,'yamlRuleToApi':_0x29e49b,'validateSegmentRule':_0x4beec9});for(const [_0x470076,_0x45f6da]of _0x4014f3[_0x382cb5(0x1c3)]){_0x431a67['set'](_0x470076,_0x45f6da),_0x353e44[_0x382cb5(0x1c3)]['set'](_0x470076,_0x45f6da);}if(_0x4014f3[_0x382cb5(0x14c)]===_0x382cb5(0x124))_0x2c3322[_0x382cb5(0x136)]?.({'type':_0x382cb5(0x16c),'name':_0x38ffb6['yamlConfig'][_0x382cb5(0x13b)],'journeyId':_0x4014f3[_0x382cb5(0x1b1)]}),_0x2c3322['logSuccess']?.('Created\x20journey\x20\x27'+_0x38ffb6['yamlConfig'][_0x382cb5(0x13b)]+'\x27'),_0x353e44[_0x382cb5(0x124)]++;else _0x4014f3[_0x382cb5(0x14c)]===_0x382cb5(0x108)&&(_0x2c3322[_0x382cb5(0x136)]?.({'type':'journey_updated','name':_0x38ffb6[_0x382cb5(0x1a4)][_0x382cb5(0x13b)]}),_0x2c3322['logSuccess']?.(_0x382cb5(0x1e3)+_0x38ffb6[_0x382cb5(0x1a4)][_0x382cb5(0x13b)]+'\x27'),_0x353e44['updated']++);return{'action':_0x4014f3['action'],'name':_0x38ffb6[_0x382cb5(0x1a4)][_0x382cb5(0x13b)],'journeyId':_0x4014f3['journeyId']};}catch(_0x5c5806){const _0x3b2fbb=isHttp400Error(_0x5c5806),_0x3e6513=_0x3b2fbb?ErrorCode[_0x382cb5(0x14b)]:ErrorCode[_0x382cb5(0x170)],_0x7173de=getErrorMessage(_0x5c5806);throw new SDKError(_0x3e6513,_0x382cb5(0x109)+(_0x38ffb6[_0x382cb5(0x19d)]?'create':_0x382cb5(0x197))+_0x382cb5(0x193)+_0x38ffb6[_0x382cb5(0x19f)]+_0x382cb5(0x127)+_0x7173de,_0x5c5806);}}));_0x353e44[_0x31d0bf(0x1b6)]['push'](..._0x33e89a);}return _0x353e44;}async function executeSingleJourneyPush(_0x56e878,_0x2455da,_0x254f18,_0x195c95,_0x1cbff3,_0x45edbf){const _0x470eb7=a119_0x4f28a3,{journeyDefToRequest:_0x53c3f2,activationDefToCreateRequest:_0x18cda2,yamlRuleToApi:_0x54dcdf,validateSegmentRule:_0x78428}=_0x45edbf,_0x168d60=new Map(),_0x3175c1=new Map(),_0x2d4f3f=new Map(),_0x28df19=new Map(),_0x353796=new Map();let _0x255bec;const _0x49bef1=async()=>{const _0x1f2f87=a119_0x2c28;if(_0x255bec)return;_0x255bec=new Map();if(!_0x2455da['existingJourney'])return;const _0x300435=await _0x56e878[_0x1f2f87(0x183)][_0x1f2f87(0x1a0)](_0x2455da['existingJourney']['id']);for(const _0x11777e of _0x300435){const _0x22e7a1=journeyActivationStepToYaml(_0x11777e,_0x254f18[_0x1f2f87(0x19c)],_0x254f18[_0x1f2f87(0x135)]),_0x54ea33=activationSignature(_0x22e7a1);!_0x255bec[_0x1f2f87(0x155)](_0x54ea33)&&_0x255bec[_0x1f2f87(0x102)](_0x54ea33,_0x11777e['id']),_0x22e7a1[_0x1f2f87(0x13b)]&&_0x3175c1['set'](_0x22e7a1['name'],_0x11777e['id']);}};if(_0x2455da[_0x470eb7(0x1b2)]&&_0x2455da[_0x470eb7(0x1a4)][_0x470eb7(0x1e4)]){const _0x35cd68=buildLocalExpandedRuleMappings(_0x2455da[_0x470eb7(0x1a4)]),_0x1af5c1=_0x35cd68[_0x470eb7(0x1d9)];if(_0x1af5c1[_0x470eb7(0x1a1)]>0x0){const _0x1bd7a6=new Map();for(const [_0x3a27d8,_0x1c8ea1]of _0x1af5c1){const _0x54594a=serializeExpandedRule(_0x1c8ea1,_0x1af5c1);_0x1bd7a6['set'](_0x3a27d8,_0x54594a);}const _0x46532b=collectSegmentIdsFromJourneyApi(_0x2455da[_0x470eb7(0x1b2)]);if(_0x46532b[_0x470eb7(0x1a1)]>0x0){const _0xfd76a3=await buildServerSegmentRuleMap(_0x56e878,_0x195c95['parentId'],_0x254f18['existingSegments'],_0x46532b);if(_0xfd76a3['size']>0x0){const _0x50798a=new Map();for(const [_0x2b087b,_0x49e300]of _0xfd76a3){const _0x366cfb=serializeExpandedRule(_0x49e300,_0xfd76a3);!_0x50798a[_0x470eb7(0x155)](_0x366cfb)&&_0x50798a['set'](_0x366cfb,_0x2b087b);}for(const [_0x572f1e,_0x4e8b15]of _0x1bd7a6){const _0x5d8b21=_0x50798a[_0x470eb7(0x11f)](_0x4e8b15);_0x5d8b21&&(_0x353796[_0x470eb7(0x102)](_0x572f1e,_0x5d8b21),_0x254f18['segmentNameToId'][_0x470eb7(0x102)](_0x572f1e,_0x5d8b21));}}}}}const _0x1ba95f={'resolveSegmentId':async _0x383f3d=>{const _0x9c5f6c=_0x470eb7,_0x458c91=_0x254f18['segmentNameToId'][_0x9c5f6c(0x11f)](_0x383f3d);if(!_0x458c91)throw new SDKError(ErrorCode[_0x9c5f6c(0x1ce)],_0x9c5f6c(0xff)+_0x383f3d+'\x20(referenced\x20in\x20journey\x20'+_0x2455da[_0x9c5f6c(0x1a4)]['name']+')');return _0x458c91;},'resolveEmbeddedSegmentId':async(_0x6d1635,_0x5a9bd4)=>{const _0x5c4291=_0x470eb7,_0x3350f3=_0x254f18[_0x5c4291(0x1c7)][_0x5c4291(0x11f)](_0x6d1635);if(_0x3350f3)return _0x3350f3;const _0x32f7f7=_0x353796['get'](_0x6d1635);if(_0x32f7f7)return _0x254f18[_0x5c4291(0x1c7)][_0x5c4291(0x102)](_0x6d1635,_0x32f7f7),_0x32f7f7;const _0x40df14=_0x254f18[_0x5c4291(0x196)][_0x5c4291(0x1d2)](_0x10084a=>_0x10084a[_0x5c4291(0x13b)]===_0x6d1635);if(_0x40df14)return _0x254f18[_0x5c4291(0x1c7)]['set'](_0x6d1635,_0x40df14['id']),_0x40df14['id'];if(_0x2455da[_0x5c4291(0x19d)]){const {stageName:_0x408890,criteriaName:_0x41bfa0}=findSegmentCriteriaLocation(_0x2455da[_0x5c4291(0x1a4)],_0x6d1635);return _0x78428(_0x6d1635,_0x5a9bd4[_0x5c4291(0x123)]),_0x2d4f3f[_0x5c4291(0x102)](_0x6d1635,{'definition':_0x5a9bd4,'stageName':_0x408890,'criteriaName':_0x41bfa0}),createPendingSegmentId(_0x6d1635);}const _0x2ed946=_0x2455da['existingJourney']?.['id'];if(!_0x2ed946)throw new SDKError(ErrorCode[_0x5c4291(0x10b)],_0x5c4291(0x14a));_0x78428(_0x6d1635,_0x5a9bd4['rule']);const _0x5cb1c3=generateDeterministicJourneySegmentName(_0x2455da[_0x5c4291(0x1a4)][_0x5c4291(0x13b)],_0x6d1635),_0x79a898=_0x254f18[_0x5c4291(0x196)]['find'](_0x5c42ce=>_0x5c42ce[_0x5c4291(0x13b)]===_0x5cb1c3),_0x39271f=createSegmentIdResolver(_0x254f18[_0x5c4291(0x1c7)],_0x6d1635),_0x286220=await resolveRuleSegmentIds(_0x5a9bd4[_0x5c4291(0x123)],_0x39271f);let _0x3c86d4;if(_0x79a898)await _0x56e878['segment']['updateSegmentById'](_0x195c95[_0x5c4291(0x119)],_0x79a898['id'],{'description':_0x5a9bd4[_0x5c4291(0x194)]||_0x5c4291(0x13f)+_0x6d1635,'rule':_0x54dcdf(_0x286220,!![]),'countPopulation':!![]}),_0x3c86d4=_0x79a898['id'];else try{_0x3c86d4=await _0x56e878[_0x5c4291(0x132)][_0x5c4291(0x1bb)]({'name':_0x5cb1c3,'description':_0x5a9bd4[_0x5c4291(0x194)]||_0x5c4291(0x13f)+_0x6d1635,'journeyId':_0x2ed946,'rule':_0x54dcdf(_0x286220,!![]),'countPopulation':!![],'parentFolderId':_0x195c95[_0x5c4291(0xfe)]||'','audienceId':_0x195c95[_0x5c4291(0x119)]});}catch(_0x374065){const _0x3c99f3=_0x374065 instanceof Error&&_0x374065[_0x5c4291(0x175)][_0x5c4291(0x142)]('Name\x20has\x20already\x20been\x20taken');if(_0x3c99f3){const _0x22813f=await _0x56e878['segment'][_0x5c4291(0x186)](_0x195c95[_0x5c4291(0x119)]),_0x38c9fc=_0x22813f['find'](_0x538c69=>_0x538c69['name']===_0x5cb1c3);if(_0x38c9fc)await _0x56e878[_0x5c4291(0x132)][_0x5c4291(0xf9)](_0x195c95[_0x5c4291(0x119)],_0x38c9fc['id'],{'description':_0x5a9bd4[_0x5c4291(0x194)]||_0x5c4291(0x13f)+_0x6d1635,'rule':_0x54dcdf(_0x286220,!![]),'countPopulation':!![]}),_0x3c86d4=_0x38c9fc['id'];else throw _0x374065;}else throw _0x374065;}return _0x254f18[_0x5c4291(0x1c7)][_0x5c4291(0x102)](_0x6d1635,_0x3c86d4),_0x168d60[_0x5c4291(0x102)](_0x6d1635,_0x3c86d4),_0x3c86d4;},'resolveActivationId':async _0x424027=>{const _0x4137e7=_0x470eb7,_0x5e6c5f=_0x3175c1[_0x4137e7(0x11f)](_0x424027);if(_0x5e6c5f)return _0x5e6c5f;if(_0x2455da['existingJourney']){await _0x49bef1();const _0x58d214=_0x3175c1['get'](_0x424027);if(_0x58d214)return _0x58d214;}throw new SDKError(ErrorCode[_0x4137e7(0x198)],'Activation\x20not\x20found:\x20'+_0x424027+_0x4137e7(0x1af)+_0x2455da[_0x4137e7(0x1a4)][_0x4137e7(0x13b)]+_0x4137e7(0x1dd)+_0x4137e7(0x148));},'resolveEmbeddedActivationId':async(_0x3a8246,_0x349671)=>{const _0x4850e1=_0x470eb7,_0x14eb89=_0x3175c1[_0x4850e1(0x11f)](_0x3a8246);if(_0x14eb89)return _0x14eb89;if(_0x2455da['isNew'])return _0x28df19[_0x4850e1(0x102)](_0x3a8246,_0x349671),createPendingActivationId(_0x3a8246);if(_0x2455da[_0x4850e1(0x1b2)]){await _0x49bef1();const _0x22937b=_0x3175c1[_0x4850e1(0x11f)](_0x349671['name']);if(_0x22937b)return _0x3175c1[_0x4850e1(0x102)](_0x3a8246,_0x22937b),_0x22937b;const _0x293cae=activationSignature(_0x349671),_0x27aac2=_0x255bec?.[_0x4850e1(0x11f)](_0x293cae);if(_0x27aac2)return _0x3175c1['set'](_0x3a8246,_0x27aac2),_0x27aac2;const _0x425ccf=await _0x18cda2(_0x349671,_0x254f18[_0x4850e1(0x192)]),_0x2e6556=await _0x56e878['journey'][_0x4850e1(0x1e2)](_0x2455da[_0x4850e1(0x1b2)]['id'],_0x425ccf);return _0x3175c1[_0x4850e1(0x102)](_0x3a8246,_0x2e6556['id']),_0x2e6556['id'];}throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x36ce92=>{const _0x498c40=_0x470eb7;try{return await _0x56e878['journey'][_0x498c40(0x1cc)](_0x195c95[_0x498c40(0x119)],_0x36ce92);}catch(_0x2dd682){throw new SDKError(ErrorCode[_0x498c40(0x198)],_0x498c40(0x150)+_0x36ce92+_0x498c40(0x1a8)+_0x2455da['yamlConfig']['name']+'\x27)',_0x2dd682);}},'resolveStageId':async(_0x113d7c,_0x4c6a2e)=>{const _0x19b8c9=_0x470eb7,_0xa9d301=await _0x56e878[_0x19b8c9(0x183)][_0x19b8c9(0x106)](_0x113d7c),_0x5a1fb9=_0xa9d301['attributes']['journeyStages'][_0x19b8c9(0x1d2)](_0x5e5aaa=>_0x5e5aaa[_0x19b8c9(0x13b)][_0x19b8c9(0x122)]()===_0x4c6a2e['toLowerCase']());if(!_0x5a1fb9?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x19b8c9(0x146)+_0x4c6a2e+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0xa9d301[_0x19b8c9(0x156)][_0x19b8c9(0xfb)]||_0xa9d301[_0x19b8c9(0x156)]['name'])+'\x27');return _0x5a1fb9['id'];}},_0xc1da0a=await _0x53c3f2(_0x2455da[_0x470eb7(0x1a4)],_0x195c95[_0x470eb7(0x119)],_0x1ba95f),_0x3295b4=_0x195c95['folderId']||_0x195c95[_0x470eb7(0xfe)];_0x3295b4&&(_0xc1da0a[_0x470eb7(0x1b9)]={'parentFolder':{'data':{'id':_0x3295b4,'type':_0x470eb7(0x10a)}}});if(_0x2455da[_0x470eb7(0x19d)]){if(_0x2d4f3f[_0x470eb7(0x1a1)]>0x0||_0x28df19[_0x470eb7(0x1a1)]>0x0)return await executeThreeStepJourneyCreate(_0x56e878,_0x2455da,_0xc1da0a,{'pendingEmbeddedSegments':_0x2d4f3f,'pendingEmbeddedActivations':_0x28df19,'embeddedSegmentNameToId':_0x168d60,'journeyActivationNameToId':_0x3175c1},{..._0x195c95,'effectiveFolderId':_0x3295b4},_0x254f18,_0x1cbff3,_0x45edbf);else{ensureJourneyDefaults(_0xc1da0a[_0x470eb7(0x156)]);const _0x555ff8=await _0x56e878[_0x470eb7(0x183)][_0x470eb7(0x1db)](_0xc1da0a);return{'action':_0x470eb7(0x124),'journeyId':_0x555ff8['id'],'embeddedSegmentNameToId':_0x168d60};}}else{if(_0x2455da['hasChanges']&&_0x2455da['existingJourney'])return ensureJourneyDefaults(_0xc1da0a[_0x470eb7(0x156)]),await _0x56e878[_0x470eb7(0x183)][_0x470eb7(0x197)](_0x2455da['existingJourney']['id'],_0xc1da0a),{'action':'updated','journeyId':_0x2455da[_0x470eb7(0x1b2)]['id'],'embeddedSegmentNameToId':_0x168d60};}return{'action':_0x470eb7(0x1be),'journeyId':_0x2455da[_0x470eb7(0x1b2)]?.['id'],'embeddedSegmentNameToId':_0x168d60};}function findSegmentCriteriaLocation(_0x2a080e,_0x1b9967){const _0x4e9714=a119_0x4f28a3,_0x3b54dd=_0x2a080e[_0x4e9714(0x159)]||_0x2a080e[_0x4e9714(0x11c)]?.[0x0]?.['stages']||[];let _0x37bc67=_0x4e9714(0x12e),_0x6dfdcb=_0x1b9967;const _0x28a153=_0x2a080e['goal']||_0x2a080e[_0x4e9714(0x11c)]?.[0x0]?.[_0x4e9714(0x1e0)];if(_0x28a153?.[_0x4e9714(0x132)]===_0x1b9967)return{'stageName':'goal','criteriaName':_0x28a153['name']||_0x1b9967};_0x22b783:for(const _0x1f620e of _0x3b54dd){if(_0x1f620e['entry_criteria']?.[_0x4e9714(0x132)]===_0x1b9967){_0x37bc67=_0x1f620e[_0x4e9714(0x13b)],_0x6dfdcb=_0x1f620e[_0x4e9714(0x16a)][_0x4e9714(0x13b)]||_0x1b9967;break;}if(_0x1f620e[_0x4e9714(0x154)])for(const _0x350b9a of _0x1f620e[_0x4e9714(0x154)]){if(_0x350b9a[_0x4e9714(0x1c6)]===_0x4e9714(0x1bf)&&_0x350b9a[_0x4e9714(0x1cf)]?.[_0x4e9714(0x16e)])for(const _0x434b0a of _0x350b9a[_0x4e9714(0x1cf)]['branches']){if(_0x434b0a['segment']===_0x1b9967){_0x37bc67=_0x1f620e[_0x4e9714(0x13b)],_0x6dfdcb=_0x434b0a['name']||_0x1b9967;break _0x22b783;}}}}return{'stageName':_0x37bc67,'criteriaName':_0x6dfdcb};}async function executeThreeStepJourneyCreate(_0x17ee19,_0x318927,_0x1aaeec,_0x2b70be,_0x3980fa,_0x16eabd,_0x34ddb2,_0x35e8d0){const _0x16fdd9=a119_0x4f28a3,{activationDefToCreateRequest:_0x4878d6,yamlRuleToApi:_0xb3cc2e}=_0x35e8d0,{pendingEmbeddedSegments:_0x85c537,pendingEmbeddedActivations:_0x3620b8,embeddedSegmentNameToId:_0xc44fed}=_0x2b70be,_0x45ae09=JSON['parse'](JSON[_0x16fdd9(0x18b)](_0x1aaeec));ensureJourneyDefaults(_0x45ae09[_0x16fdd9(0x156)]),stripPendingIds(_0x45ae09);const _0x3ff7e6=await _0x17ee19[_0x16fdd9(0x183)][_0x16fdd9(0x1db)](_0x45ae09),_0x497d85=_0x3ff7e6['id'],_0x3b731c=new Map();for(const _0x137773 of _0x3ff7e6['attributes'][_0x16fdd9(0x137)]){_0x3b731c['set'](_0x137773[_0x16fdd9(0x13b)][_0x16fdd9(0x122)](),_0x137773['id']);}for(const [_0x5f1e99,{definition:_0x5a2bcd}]of _0x85c537){const _0x2f9823=generateDeterministicJourneySegmentName(_0x318927[_0x16fdd9(0x1a4)][_0x16fdd9(0x13b)],_0x5f1e99);_0x34ddb2['onProgress']?.({'type':_0x16fdd9(0x1ad),'journeyName':_0x318927[_0x16fdd9(0x1a4)][_0x16fdd9(0x13b)],'segmentName':_0x5f1e99});const _0x51f774=createSegmentIdResolver(_0x16eabd[_0x16fdd9(0x1c7)],_0x5f1e99),_0x47ca9d=await resolveRuleSegmentIds(_0x5a2bcd[_0x16fdd9(0x123)],_0x51f774),_0x156478=await _0x17ee19[_0x16fdd9(0x132)][_0x16fdd9(0x1bb)]({'name':_0x2f9823,'description':_0x5a2bcd[_0x16fdd9(0x194)]||_0x16fdd9(0x13f)+_0x5f1e99,'journeyId':_0x497d85,'rule':_0xb3cc2e(_0x47ca9d,!![]),'countPopulation':!![],'parentFolderId':_0x3980fa[_0x16fdd9(0x173)]||'','audienceId':_0x3980fa[_0x16fdd9(0x119)]});_0xc44fed[_0x16fdd9(0x102)](_0x5f1e99,_0x156478),_0x16eabd[_0x16fdd9(0x1c7)]['set'](_0x5f1e99,_0x156478),_0x34ddb2[_0x16fdd9(0x136)]?.({'type':_0x16fdd9(0x130),'journeyName':_0x318927[_0x16fdd9(0x1a4)][_0x16fdd9(0x13b)],'segmentName':_0x5f1e99});}const _0x12818b=new Map();for(const [_0x4676c4,_0x229df5]of _0x3620b8){_0x34ddb2['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x318927['yamlConfig'][_0x16fdd9(0x13b)],'activationName':_0x4676c4});const _0x45dd68=await _0x4878d6(_0x229df5,_0x16eabd[_0x16fdd9(0x192)]),_0x471e26=await _0x17ee19['journey'][_0x16fdd9(0x1e2)](_0x497d85,_0x45dd68);_0x12818b[_0x16fdd9(0x102)](_0x4676c4,_0x471e26['id']),_0x2b70be['journeyActivationNameToId'][_0x16fdd9(0x102)](_0x4676c4,_0x471e26['id']),_0x34ddb2[_0x16fdd9(0x136)]?.({'type':_0x16fdd9(0x120),'journeyName':_0x318927[_0x16fdd9(0x1a4)][_0x16fdd9(0x13b)],'activationName':_0x4676c4});}const _0x403bc7=JSON[_0x16fdd9(0x133)](JSON[_0x16fdd9(0x18b)](_0x1aaeec));return _0x403bc7['id']=_0x497d85,ensureJourneyDefaults(_0x403bc7[_0x16fdd9(0x156)]),resolvePendingIdsInRequest(_0x403bc7,_0x1aaeec,_0x3b731c,_0xc44fed,_0x12818b,_0x34ddb2),await _0x17ee19[_0x16fdd9(0x183)][_0x16fdd9(0x197)](_0x497d85,_0x403bc7),{'action':_0x16fdd9(0x124),'journeyId':_0x497d85,'embeddedSegmentNameToId':_0xc44fed};}function stripPendingIds(_0x3b516f){const _0x2144d6=a119_0x4f28a3;for(const _0x5a1d3c of _0x3b516f[_0x2144d6(0x156)][_0x2144d6(0x137)]||[]){_0x5a1d3c['entryCriteria']?.[_0x2144d6(0x139)]&&isPendingSegmentId(_0x5a1d3c[_0x2144d6(0x1d1)]['segmentId'])&&delete _0x5a1d3c[_0x2144d6(0x1d1)];if(_0x5a1d3c['steps'])for(const _0xfb017f of Object[_0x2144d6(0x147)](_0x5a1d3c[_0x2144d6(0x154)])){const _0x4cfad2=_0x5a1d3c[_0x2144d6(0x154)][_0xfb017f];_0x4cfad2['type']===_0x2144d6(0x1dc)&&_0x4cfad2[_0x2144d6(0x152)]&&isPendingActivationId(_0x4cfad2[_0x2144d6(0x152)])&&(_0x4cfad2['journeyActivationStepId']='');if(_0x4cfad2['type']==='DecisionPoint'&&_0x4cfad2[_0x2144d6(0x16e)])for(const _0x4ef901 of _0x4cfad2[_0x2144d6(0x16e)]){_0x4ef901[_0x2144d6(0x139)]&&isPendingSegmentId(_0x4ef901[_0x2144d6(0x139)])&&(_0x4ef901['segmentId']='');}_0x4cfad2[_0x2144d6(0x1c6)]===_0x2144d6(0x15f)&&_0x4cfad2[_0x2144d6(0x168)]?.['segmentId']&&isPendingSegmentId(_0x4cfad2['waitCondition'][_0x2144d6(0x139)])&&(_0x4cfad2[_0x2144d6(0x168)][_0x2144d6(0x139)]='');}}}function resolvePendingIdsInRequest(_0x12df44,_0x5742cb,_0x3ae61c,_0xc9aae0,_0xb64173,_0xc5714c){const _0x29adc9=a119_0x4f28a3,_0x5bfed4=(_0x3eff7d,_0x462eca)=>{const _0xf998bc=a119_0x2c28;if(!isPendingSegmentId(_0x3eff7d))return _0x3eff7d;const _0x565e5f=extractPendingSegmentName(_0x3eff7d),_0x2c9560=_0xc9aae0['get'](_0x565e5f);return!_0x2c9560&&_0xc5714c[_0xf998bc(0x1de)]?.(_0xf998bc(0x1bc)+_0x565e5f+_0xf998bc(0x1ae)+_0x462eca),_0x2c9560;};if(_0x12df44['attributes'][_0x29adc9(0x1e0)]?.['segmentId']&&isPendingSegmentId(_0x12df44[_0x29adc9(0x156)][_0x29adc9(0x1e0)][_0x29adc9(0x139)])){const _0x5dfdaa=_0x5bfed4(_0x12df44[_0x29adc9(0x156)][_0x29adc9(0x1e0)]['segmentId'],_0x29adc9(0x1cb));_0x5dfdaa&&(_0x12df44[_0x29adc9(0x156)]['goal'][_0x29adc9(0x139)]=_0x5dfdaa);}for(const _0x1c91f4 of _0x12df44[_0x29adc9(0x156)][_0x29adc9(0x137)]||[]){const _0x4b2e58=_0x3ae61c[_0x29adc9(0x11f)](_0x1c91f4[_0x29adc9(0x13b)][_0x29adc9(0x122)]());_0x4b2e58&&(_0x1c91f4['id']=_0x4b2e58);if(_0x1c91f4[_0x29adc9(0x1d1)]?.[_0x29adc9(0x139)]&&isPendingSegmentId(_0x1c91f4[_0x29adc9(0x1d1)][_0x29adc9(0x139)])){const _0x1fb221=_0x5bfed4(_0x1c91f4[_0x29adc9(0x1d1)]['segmentId'],'stage\x20\x27'+_0x1c91f4['name']+_0x29adc9(0x167));_0x1fb221&&(_0x1c91f4[_0x29adc9(0x1d1)][_0x29adc9(0x139)]=_0x1fb221);}if(_0x1c91f4[_0x29adc9(0x143)])for(const _0x48629d of _0x1c91f4[_0x29adc9(0x143)]){if(_0x48629d[_0x29adc9(0x139)]&&isPendingSegmentId(_0x48629d['segmentId'])){const _0x26ee2c=_0x5bfed4(_0x48629d['segmentId'],'stage\x20\x27'+_0x1c91f4[_0x29adc9(0x13b)]+_0x29adc9(0x19e));_0x26ee2c&&(_0x48629d[_0x29adc9(0x139)]=_0x26ee2c);}}if(_0x1c91f4['milestone']?.[_0x29adc9(0x139)]&&isPendingSegmentId(_0x1c91f4[_0x29adc9(0x125)][_0x29adc9(0x139)])){const _0x3fabca=_0x5bfed4(_0x1c91f4['milestone']['segmentId'],_0x29adc9(0x100)+_0x1c91f4['name']+'\x27\x20milestone');_0x3fabca&&(_0x1c91f4[_0x29adc9(0x125)]['segmentId']=_0x3fabca);}if(_0x1c91f4[_0x29adc9(0x154)]){const _0x316526=_0x32f95f=>_0x5742cb['attributes'][_0x29adc9(0x137)][_0x29adc9(0x1d2)](_0x206014=>_0x206014['name']['toLowerCase']()===_0x1c91f4[_0x29adc9(0x13b)][_0x29adc9(0x122)]())?.[_0x29adc9(0x154)]?.[_0x32f95f];for(const _0x5861ab of Object['keys'](_0x1c91f4[_0x29adc9(0x154)])){const _0x41c9e2=_0x1c91f4[_0x29adc9(0x154)][_0x5861ab],_0x172da9=_0x316526(_0x5861ab);if(_0x41c9e2[_0x29adc9(0x1c6)]==='Activation'&&_0x41c9e2[_0x29adc9(0x152)]&&(isPendingActivationId(_0x41c9e2[_0x29adc9(0x152)])||_0x41c9e2[_0x29adc9(0x152)]==='')){if(_0x172da9?.[_0x29adc9(0x152)]&&isPendingActivationId(_0x172da9[_0x29adc9(0x152)])){const _0x5d397f=extractPendingActivationName(_0x172da9[_0x29adc9(0x152)]),_0x4890a0=_0xb64173[_0x29adc9(0x11f)](_0x5d397f);_0x4890a0&&(_0x41c9e2['journeyActivationStepId']=_0x4890a0);}}if(_0x41c9e2[_0x29adc9(0x1c6)]==='DecisionPoint'&&_0x41c9e2[_0x29adc9(0x16e)]&&_0x172da9?.['branches'])for(let _0x2e147e=0x0;_0x2e147e<_0x41c9e2[_0x29adc9(0x16e)][_0x29adc9(0x129)];_0x2e147e++){const _0x1f74cc=_0x41c9e2['branches'][_0x2e147e],_0x2d7226=_0x172da9[_0x29adc9(0x16e)][_0x2e147e];if(_0x2d7226?.[_0x29adc9(0x139)]&&isPendingSegmentId(_0x2d7226['segmentId'])){const _0x447027=_0x5bfed4(_0x2d7226[_0x29adc9(0x139)],_0x29adc9(0x100)+_0x1c91f4['name']+_0x29adc9(0x181)+(_0x1f74cc[_0x29adc9(0x13b)]||_0x2e147e)+'\x27');_0x447027&&(_0x1f74cc['segmentId']=_0x447027);}}if(_0x41c9e2[_0x29adc9(0x1c6)]===_0x29adc9(0x15f)&&_0x41c9e2[_0x29adc9(0x168)]?.[_0x29adc9(0x139)]&&_0x172da9?.[_0x29adc9(0x168)]?.[_0x29adc9(0x139)]&&isPendingSegmentId(_0x172da9[_0x29adc9(0x168)]['segmentId'])){const _0x2ef2f6=_0x5bfed4(_0x172da9[_0x29adc9(0x168)]['segmentId'],_0x29adc9(0x100)+_0x1c91f4[_0x29adc9(0x13b)]+_0x29adc9(0x105));_0x2ef2f6&&(_0x41c9e2[_0x29adc9(0x168)][_0x29adc9(0x139)]=_0x2ef2f6);}}}}}
@@ -1 +1 @@
1
- (function(_0x156df5,_0x128000){const _0x5d182b=a120_0x2bfa,_0x1bbc85=_0x156df5();while(!![]){try{const _0x423005=-parseInt(_0x5d182b(0x1e4))/0x1+parseInt(_0x5d182b(0x1de))/0x2+parseInt(_0x5d182b(0x1df))/0x3+parseInt(_0x5d182b(0x1e1))/0x4*(parseInt(_0x5d182b(0x1ea))/0x5)+-parseInt(_0x5d182b(0x1e3))/0x6*(parseInt(_0x5d182b(0x1e5))/0x7)+parseInt(_0x5d182b(0x1ed))/0x8+parseInt(_0x5d182b(0x1e2))/0x9*(parseInt(_0x5d182b(0x1e9))/0xa);if(_0x423005===_0x128000)break;else _0x1bbc85['push'](_0x1bbc85['shift']());}catch(_0x1e7fad){_0x1bbc85['push'](_0x1bbc85['shift']());}}}(a120_0x4ac8,0xb94fe));export function buildFolderIdToPathMap(_0x15c94a){const _0x42052e=a120_0x2bfa,_0x2afb9b=new Map(),_0x1bd4a0=new Map();for(const _0x2007cd of _0x15c94a){_0x1bd4a0[_0x42052e(0x1eb)](_0x2007cd['id'],_0x2007cd);}const _0x2acaab=new Set();for(const _0x3ee145 of _0x15c94a){!_0x3ee145[_0x42052e(0x1e7)]&&_0x2acaab[_0x42052e(0x1ec)](_0x3ee145['id']);}function _0x3a50ea(_0x4d5d0d){const _0x596e4e=_0x42052e;if(_0x2afb9b[_0x596e4e(0x1e6)](_0x4d5d0d['id']))return _0x2afb9b['get'](_0x4d5d0d['id']);if(_0x2acaab[_0x596e4e(0x1e6)](_0x4d5d0d['id']))return _0x2afb9b['set'](_0x4d5d0d['id'],''),'';if(_0x4d5d0d[_0x596e4e(0x1e7)]){const _0x56e6d7=_0x1bd4a0['get'](_0x4d5d0d[_0x596e4e(0x1e7)]);if(_0x56e6d7){const _0x1588f6=_0x3a50ea(_0x56e6d7),_0x8978a6=_0x1588f6?_0x1588f6+'/'+_0x4d5d0d[_0x596e4e(0x1e0)]:_0x4d5d0d[_0x596e4e(0x1e0)];return _0x2afb9b['set'](_0x4d5d0d['id'],_0x8978a6),_0x8978a6;}}const _0x51a079=_0x4d5d0d[_0x596e4e(0x1e0)];return _0x2afb9b[_0x596e4e(0x1eb)](_0x4d5d0d['id'],_0x51a079),_0x51a079;}for(const _0x429c8b of _0x15c94a){_0x3a50ea(_0x429c8b);}return _0x2afb9b;}function a120_0x4ac8(){const _0x490397=['name','8PLezwe','18110376fTWOrk','6AVOwxS','1426549nmbsFZ','10238459YldAuM','has','parentFolderId','get','10QCjTVf','666560FfFkLB','set','add','3793832idvYOh','533890HQpIqm','1884486EvpRfy'];a120_0x4ac8=function(){return _0x490397;};return a120_0x4ac8();}export function buildFolderPathToIdMap(_0x574ea1){const _0x51fd63=a120_0x2bfa,_0x51e795=new Map(),_0x27a6a1=new Map();for(const _0x1e4fba of _0x574ea1){_0x27a6a1[_0x51fd63(0x1eb)](_0x1e4fba['id'],_0x1e4fba);}const _0x48dfc3=new Set();for(const _0x5a4171 of _0x574ea1){!_0x5a4171[_0x51fd63(0x1e7)]&&_0x48dfc3[_0x51fd63(0x1ec)](_0x5a4171['id']);}function _0x118658(_0x152ff0){const _0xd1611=_0x51fd63;if(_0x48dfc3[_0xd1611(0x1e6)](_0x152ff0['id']))return'';if(_0x152ff0[_0xd1611(0x1e7)]){const _0x12b632=_0x27a6a1[_0xd1611(0x1e8)](_0x152ff0['parentFolderId']);if(_0x12b632){const _0x3e6273=_0x118658(_0x12b632);return _0x3e6273?_0x3e6273+'/'+_0x152ff0[_0xd1611(0x1e0)]:_0x152ff0[_0xd1611(0x1e0)];}}return _0x152ff0[_0xd1611(0x1e0)];}for(const _0x5e0de3 of _0x574ea1){const _0x26f083=_0x118658(_0x5e0de3);_0x51e795[_0x51fd63(0x1eb)](_0x26f083,_0x5e0de3['id']);}return _0x51e795;}function a120_0x2bfa(_0x327a76,_0x4ac72d){_0x327a76=_0x327a76-0x1de;const _0x4ac8c1=a120_0x4ac8();let _0x2bfaac=_0x4ac8c1[_0x327a76];return _0x2bfaac;}export function buildFolderMaps(_0x31bfb8){const _0x5089dd=a120_0x2bfa,_0x5d0b5b=buildFolderIdToPathMap(_0x31bfb8),_0x1c5ed5=new Map();for(const [_0x1acf2,_0xb1cef7]of _0x5d0b5b){_0x1c5ed5[_0x5089dd(0x1eb)](_0xb1cef7,_0x1acf2);}return{'idToPath':_0x5d0b5b,'pathToId':_0x1c5ed5};}export function getFolderPath(_0x386923,_0x4e4d36){const _0x4adc98=a120_0x2bfa;if(!_0x386923)return'';return _0x4e4d36[_0x4adc98(0x1e8)](_0x386923)??'';}
1
+ (function(_0x574c8a,_0x276c2c){const _0x454fa8=a120_0x3833,_0x4b4c5c=_0x574c8a();while(!![]){try{const _0x276669=-parseInt(_0x454fa8(0x1ac))/0x1*(-parseInt(_0x454fa8(0x1a3))/0x2)+parseInt(_0x454fa8(0x1a5))/0x3*(-parseInt(_0x454fa8(0x1af))/0x4)+-parseInt(_0x454fa8(0x1a9))/0x5*(parseInt(_0x454fa8(0x1a7))/0x6)+parseInt(_0x454fa8(0x1ae))/0x7*(parseInt(_0x454fa8(0x1a4))/0x8)+-parseInt(_0x454fa8(0x1b0))/0x9*(-parseInt(_0x454fa8(0x1b5))/0xa)+-parseInt(_0x454fa8(0x1a8))/0xb+-parseInt(_0x454fa8(0x1ab))/0xc*(parseInt(_0x454fa8(0x1b2))/0xd);if(_0x276669===_0x276c2c)break;else _0x4b4c5c['push'](_0x4b4c5c['shift']());}catch(_0x1c680c){_0x4b4c5c['push'](_0x4b4c5c['shift']());}}}(a120_0x4a4b,0x23460));export function buildFolderIdToPathMap(_0xf3e73){const _0x1c0a93=a120_0x3833,_0x462761=new Map(),_0x5bb96=new Map();for(const _0x41983a of _0xf3e73){_0x5bb96[_0x1c0a93(0x1a6)](_0x41983a['id'],_0x41983a);}const _0x3a9ba8=new Set();for(const _0x427b78 of _0xf3e73){!_0x427b78[_0x1c0a93(0x1b3)]&&_0x3a9ba8[_0x1c0a93(0x1b4)](_0x427b78['id']);}function _0x6d0a8c(_0x2fa1){const _0x233e78=_0x1c0a93;if(_0x462761[_0x233e78(0x1ad)](_0x2fa1['id']))return _0x462761[_0x233e78(0x1aa)](_0x2fa1['id']);if(_0x3a9ba8[_0x233e78(0x1ad)](_0x2fa1['id']))return _0x462761['set'](_0x2fa1['id'],''),'';if(_0x2fa1[_0x233e78(0x1b3)]){const _0x4aefc4=_0x5bb96[_0x233e78(0x1aa)](_0x2fa1['parentFolderId']);if(_0x4aefc4){const _0x30dd98=_0x6d0a8c(_0x4aefc4),_0x1e8603=_0x30dd98?_0x30dd98+'/'+_0x2fa1[_0x233e78(0x1b1)]:_0x2fa1[_0x233e78(0x1b1)];return _0x462761[_0x233e78(0x1a6)](_0x2fa1['id'],_0x1e8603),_0x1e8603;}}const _0x489ba8=_0x2fa1[_0x233e78(0x1b1)];return _0x462761[_0x233e78(0x1a6)](_0x2fa1['id'],_0x489ba8),_0x489ba8;}for(const _0x393848 of _0xf3e73){_0x6d0a8c(_0x393848);}return _0x462761;}function a120_0x3833(_0x412de7,_0x423928){_0x412de7=_0x412de7-0x1a3;const _0x4a4bd7=a120_0x4a4b();let _0x3833d1=_0x4a4bd7[_0x412de7];return _0x3833d1;}export function buildFolderPathToIdMap(_0x444403){const _0x1b7a3b=a120_0x3833,_0x52a296=new Map(),_0x241c58=new Map();for(const _0x2695d6 of _0x444403){_0x241c58[_0x1b7a3b(0x1a6)](_0x2695d6['id'],_0x2695d6);}const _0x34e870=new Set();for(const _0x3745b6 of _0x444403){!_0x3745b6[_0x1b7a3b(0x1b3)]&&_0x34e870['add'](_0x3745b6['id']);}function _0x2a6de5(_0x4de55a){const _0x481c62=_0x1b7a3b;if(_0x34e870['has'](_0x4de55a['id']))return'';if(_0x4de55a['parentFolderId']){const _0x4433ab=_0x241c58[_0x481c62(0x1aa)](_0x4de55a[_0x481c62(0x1b3)]);if(_0x4433ab){const _0x528c5f=_0x2a6de5(_0x4433ab);return _0x528c5f?_0x528c5f+'/'+_0x4de55a[_0x481c62(0x1b1)]:_0x4de55a['name'];}}return _0x4de55a[_0x481c62(0x1b1)];}for(const _0x426013 of _0x444403){const _0x4654ef=_0x2a6de5(_0x426013);_0x52a296[_0x1b7a3b(0x1a6)](_0x4654ef,_0x426013['id']);}return _0x52a296;}export function buildFolderMaps(_0xa76e0d){const _0x54cf21=a120_0x3833,_0xa7aaca=buildFolderIdToPathMap(_0xa76e0d),_0x16b684=new Map();for(const [_0x14aae3,_0xcc2b26]of _0xa7aaca){_0x16b684[_0x54cf21(0x1a6)](_0xcc2b26,_0x14aae3);}return{'idToPath':_0xa7aaca,'pathToId':_0x16b684};}function a120_0x4a4b(){const _0x5b5647=['1182NMaxuK','2163678bwPBlb','40gqkFZx','get','17412XfWlMj','58rMFwhV','has','492198lCJLPR','296ghoDAe','581481rNvTDP','name','26uThJaj','parentFolderId','add','40EUZapE','8552AvWtKW','8rkPOVE','9369qFZhSA','set'];a120_0x4a4b=function(){return _0x5b5647;};return a120_0x4a4b();}export function getFolderPath(_0x5c8a9b,_0x2e9d02){if(!_0x5c8a9b)return'';return _0x2e9d02['get'](_0x5c8a9b)??'';}
@@ -1 +1 @@
1
- (function(_0x511166,_0x5bf493){const _0x233055=a121_0x50ce,_0x1e7fd8=_0x511166();while(!![]){try{const _0x106675=parseInt(_0x233055(0xaa))/0x1+parseInt(_0x233055(0xc4))/0x2+parseInt(_0x233055(0xc7))/0x3+parseInt(_0x233055(0xbc))/0x4+-parseInt(_0x233055(0xc2))/0x5+parseInt(_0x233055(0xba))/0x6*(-parseInt(_0x233055(0xbb))/0x7)+-parseInt(_0x233055(0xce))/0x8*(parseInt(_0x233055(0xc3))/0x9);if(_0x106675===_0x5bf493)break;else _0x1e7fd8['push'](_0x1e7fd8['shift']());}catch(_0x4a1537){_0x1e7fd8['push'](_0x1e7fd8['shift']());}}}(a121_0x3377,0xd1710));import a121_0x2ad30c from'path';import{parse as a121_0x87ca5e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x25a784){const _0x252207=a121_0x50ce;if(!_0x25a784||_0x25a784[_0x252207(0xb3)]()==='')throw new Error(_0x252207(0xb0));const _0x2af440=_0x25a784['trim']();if(_0x2af440==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x25a784};const _0x10ef4f=_0x2af440[_0x252207(0xa1)]('/')?_0x2af440[_0x252207(0xcf)](0x1):_0x2af440,_0x444820=_0x10ef4f[_0x252207(0xad)]('/')[_0x252207(0xbf)](_0x20b6eb=>_0x20b6eb!=='');if(_0x444820[_0x252207(0xb7)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0xb83f00=_0x2af440[_0x252207(0xa1)]('/')||!isRelativePathSegment(_0x444820[0x0]);for(const _0x5e4ad2 of _0x444820){validatePathSegment(_0x5e4ad2);}return{'segments':_0x444820,'isAbsolute':_0xb83f00,'raw':_0x25a784};}function isRelativePathSegment(_0x5cac60){return _0x5cac60==='.'||_0x5cac60==='..';}function a121_0x3377(){const _0x2ece88=['2186634Eamcyf','relative','No\x20tdx.json\x20found\x20for\x20file:\x20','isAbsolute','Path\x20attempts\x20to\x20navigate\x20above\x20root','push','.yaml','134096rIUnNp','substring','startsWith','exists','segments','segment','name','.yml','pop','replace','Cannot\x20split\x20empty\x20path','835002WeoeSQ','journey','endsWith','split','join','parse','Path\x20cannot\x20be\x20empty','Path\x20segment\x20cannot\x20be\x20empty','parent_segment','trim','readFile','root','dirname','length','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','14694dSLkEd','1638cbwVUl','3998520PZaBih','raw','type','filter','File\x20not\x20found:\x20','Cannot\x20navigate\x20above\x20root','4820980prjwfR','387RMVgRr','1104780SfwfKG','resolve','tdx.json'];a121_0x3377=function(){return _0x2ece88;};return a121_0x3377();}function validatePathSegment(_0x4cfd58){const _0x13ca7b=a121_0x50ce;if(_0x4cfd58==='')throw new Error(_0x13ca7b(0xb1));if(_0x4cfd58==='.'||_0x4cfd58==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x4cfd58))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x4cfd58);if(_0x4cfd58!==_0x4cfd58[_0x13ca7b(0xb3)]()){}}export function validatePath(_0x313894){const _0x406edf=a121_0x50ce;if(_0x313894[_0x406edf(0xa3)][_0x406edf(0xb7)]===0x0&&!_0x313894[_0x406edf(0xca)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x313894['isAbsolute']){if(_0x313894[_0x406edf(0xa3)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x4e7753=0x0;for(const _0x542afb of _0x313894[_0x406edf(0xa3)]){if(_0x542afb==='..'){if(_0x4e7753===0x0)throw new Error(_0x406edf(0xcb));_0x4e7753--;}else _0x542afb!=='.'&&_0x4e7753++;}}}export function joinPaths(_0x48b296,_0x4272fe){const _0x174c7b=a121_0x50ce;if(!_0x48b296||_0x48b296==='/')return _0x4272fe;if(!_0x4272fe||_0x4272fe==='.')return _0x48b296;if(_0x4272fe[_0x174c7b(0xa1)]('/'))return _0x4272fe;const _0x1e3223=parsePath(_0x48b296),_0x12e198=parsePath(_0x4272fe),_0x5871bf=[..._0x1e3223[_0x174c7b(0xa3)]];for(const _0xfc9a74 of _0x12e198['segments']){if(_0xfc9a74==='.')continue;else{if(_0xfc9a74==='..'){if(_0x5871bf[_0x174c7b(0xb7)]===0x0)throw new Error(_0x174c7b(0xc1));_0x5871bf[_0x174c7b(0xa7)]();}else _0x5871bf['push'](_0xfc9a74);}}const _0x3130b3=_0x5871bf[_0x174c7b(0xae)]('/');return _0x1e3223[_0x174c7b(0xbd)][_0x174c7b(0xa1)]('/')?'/'+_0x3130b3:_0x3130b3;}function a121_0x50ce(_0x423eeb,_0x54db2e){_0x423eeb=_0x423eeb-0xa1;const _0x337716=a121_0x3377();let _0x50ce6a=_0x337716[_0x423eeb];return _0x50ce6a;}export function normalizePath(_0x43725b){const _0x52be99=a121_0x50ce,_0x1debab=parsePath(_0x43725b),_0xb5aa2c=[];for(const _0x50c55a of _0x1debab['segments']){if(_0x50c55a==='.')continue;else{if(_0x50c55a==='..'){if(_0xb5aa2c['length']===0x0){if(_0x1debab[_0x52be99(0xca)])throw new Error(_0x52be99(0xc1));_0xb5aa2c[_0x52be99(0xcc)]('..');}else _0xb5aa2c[_0xb5aa2c[_0x52be99(0xb7)]-0x1]==='..'?_0xb5aa2c[_0x52be99(0xcc)]('..'):_0xb5aa2c[_0x52be99(0xa7)]();}else _0xb5aa2c['push'](_0x50c55a);}}if(_0xb5aa2c[_0x52be99(0xb7)]===0x0)return _0x1debab[_0x52be99(0xca)]?'/':'.';const _0x5acd98=_0xb5aa2c[_0x52be99(0xae)]('/');return _0x1debab['raw'][_0x52be99(0xa1)]('/')?'/'+_0x5acd98:_0x5acd98;}export function getParentPath(_0x390453){const _0x605125=a121_0x50ce,_0x12d7b7=parsePath(_0x390453);if(_0x12d7b7[_0x605125(0xa3)][_0x605125(0xb7)]<=0x1)return'/';const _0x101a63=_0x12d7b7[_0x605125(0xa3)]['slice'](0x0,-0x1)[_0x605125(0xae)]('/');return _0x12d7b7[_0x605125(0xbd)][_0x605125(0xa1)]('/')?'/'+_0x101a63:_0x101a63;}export function getBaseName(_0x958ebe){const _0x594543=a121_0x50ce,_0x19ed7a=parsePath(_0x958ebe);return _0x19ed7a['segments'][_0x19ed7a[_0x594543(0xa3)][_0x594543(0xb7)]-0x1]||'';}export function isChildPath(_0xaa8622,_0x46d182){const _0x5618c8=a121_0x50ce,_0x8694fe=parsePath(_0xaa8622),_0x52cd58=parsePath(_0x46d182);if(_0x8694fe['segments'][_0x5618c8(0xb7)]<=_0x52cd58[_0x5618c8(0xa3)][_0x5618c8(0xb7)])return![];for(let _0xa69cd2=0x0;_0xa69cd2<_0x52cd58[_0x5618c8(0xa3)][_0x5618c8(0xb7)];_0xa69cd2++){if(_0x8694fe[_0x5618c8(0xa3)][_0xa69cd2]!==_0x52cd58[_0x5618c8(0xa3)][_0xa69cd2])return![];}return!![];}export function splitPath(_0x26ddd7){const _0x2c424f=a121_0x50ce,_0x15f7c9=parsePath(_0x26ddd7);if(_0x15f7c9[_0x2c424f(0xa3)]['length']===0x0)throw new Error(_0x2c424f(0xa9));if(_0x15f7c9['segments'][_0x2c424f(0xb7)]===0x1)return{'parent':_0x15f7c9[_0x2c424f(0xa3)][0x0]};return{'parent':_0x15f7c9[_0x2c424f(0xa3)][0x0],'child':_0x15f7c9[_0x2c424f(0xa3)]['slice'](0x1)[_0x2c424f(0xae)]('/')};}export function isYamlFilePath(_0xf12d){const _0x2aa8cd=a121_0x50ce;return _0xf12d[_0x2aa8cd(0xac)](_0x2aa8cd(0xa6))||_0xf12d[_0x2aa8cd(0xac)](_0x2aa8cd(0xcd));}export async function resolveYamlFilePath(_0x25d454,_0x3423b4=nodeFileSystem){const _0x44e61f=a121_0x50ce,_0xeed52=a121_0x2ad30c[_0x44e61f(0xc5)](_0x25d454);if(!await _0x3423b4[_0x44e61f(0xa2)](_0xeed52))throw new Error(_0x44e61f(0xc0)+_0x25d454);let _0x5633a6=a121_0x2ad30c['dirname'](_0xeed52),_0xb8aa53=null,_0x3f3068=null;const _0x536c2a=a121_0x2ad30c[_0x44e61f(0xaf)](_0x5633a6)[_0x44e61f(0xb5)];while(_0x5633a6!==_0x536c2a){const _0x27447c=a121_0x2ad30c['join'](_0x5633a6,_0x44e61f(0xc6));if(await _0x3423b4[_0x44e61f(0xa2)](_0x27447c)){_0xb8aa53=_0x27447c,_0x3f3068=_0x5633a6;break;}_0x5633a6=a121_0x2ad30c['dirname'](_0x5633a6);}if(!_0xb8aa53||!_0x3f3068)throw new Error(_0x44e61f(0xc9)+_0x25d454);const _0x2b93b9=await _0x3423b4['readFile'](_0xb8aa53),_0x55abb9=JSON[_0x44e61f(0xaf)](_0x2b93b9),_0x10c97f=_0x55abb9[_0x44e61f(0xb2)];if(!_0x10c97f)throw new Error(_0x44e61f(0xb9));const _0x6b279d=await _0x3423b4[_0x44e61f(0xb4)](_0xeed52),_0x53532b=a121_0x87ca5e(_0x6b279d),_0x511a40=_0x53532b[_0x44e61f(0xa5)];if(!_0x511a40)throw new Error(_0x44e61f(0xb8)+_0x25d454);const _0x4719cc=_0x53532b[_0x44e61f(0xbe)]===_0x44e61f(0xab)?'journey':_0x44e61f(0xa4),_0x5b974e=a121_0x2ad30c[_0x44e61f(0xc8)](_0x3f3068,_0xeed52),_0x2bf839=a121_0x2ad30c[_0x44e61f(0xb6)](_0x5b974e),_0x155321=_0x2bf839==='.'?'':_0x2bf839[_0x44e61f(0xa8)](/\\/g,'/'),_0x381e0a=_0x155321?_0x10c97f+'/'+_0x155321+'/'+_0x511a40:_0x10c97f+'/'+_0x511a40;return{'parentSegment':_0x10c97f,'segmentName':_0x511a40,'folderPath':_0x155321,'fullPath':_0x381e0a,'resourceType':_0x4719cc};}
1
+ (function(_0x56a5af,_0x4c9d6a){const _0x5f4ab6=a121_0x3223,_0x5c0e2f=_0x56a5af();while(!![]){try{const _0x5ee2c0=parseInt(_0x5f4ab6(0x1b2))/0x1*(parseInt(_0x5f4ab6(0x1be))/0x2)+parseInt(_0x5f4ab6(0x1b4))/0x3*(parseInt(_0x5f4ab6(0x18c))/0x4)+-parseInt(_0x5f4ab6(0x1bc))/0x5*(parseInt(_0x5f4ab6(0x196))/0x6)+parseInt(_0x5f4ab6(0x1a8))/0x7*(-parseInt(_0x5f4ab6(0x1ad))/0x8)+parseInt(_0x5f4ab6(0x1bb))/0x9*(parseInt(_0x5f4ab6(0x18b))/0xa)+-parseInt(_0x5f4ab6(0x1b9))/0xb*(parseInt(_0x5f4ab6(0x191))/0xc)+-parseInt(_0x5f4ab6(0x195))/0xd*(-parseInt(_0x5f4ab6(0x19f))/0xe);if(_0x5ee2c0===_0x4c9d6a)break;else _0x5c0e2f['push'](_0x5c0e2f['shift']());}catch(_0x37f412){_0x5c0e2f['push'](_0x5c0e2f['shift']());}}}(a121_0x38d9,0xe3886));import a121_0x4fca57 from'path';function a121_0x38d9(){const _0x20e313=['segment','.yaml','15613frJqyV','12OxdBGv','resolve','Relative\x20path\x20cannot\x20be\x20empty','join','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','tdx.json','Path\x20attempts\x20to\x20navigate\x20above\x20root','segments','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','7042YQrOWJ','raw','push','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','parse','replace','name','Cannot\x20split\x20empty\x20path','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','140sSTrkn','test','Path\x20segment\x20cannot\x20be\x20empty','relative','isAbsolute','600536thJxxc','substring','pop','trim','startsWith','65SutTIo','type','66IojGmH','exists','filter','Path\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','9790OvUZbm','dirname','424314BmTGbN','803905TbArkq','split','40678UdpzBS','journey','.yml','230AmbcPO','257580JJNqLi','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','length','slice','22548OGdtYA','readFile'];a121_0x38d9=function(){return _0x20e313;};return a121_0x38d9();}import{parse as a121_0x2b24e9}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x313ac4){const _0x18ca14=a121_0x3223;if(!_0x313ac4||_0x313ac4[_0x18ca14(0x1b0)]()==='')throw new Error(_0x18ca14(0x1b7));const _0x3152c5=_0x313ac4[_0x18ca14(0x1b0)]();if(_0x3152c5==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x313ac4};const _0x94503a=_0x3152c5['startsWith']('/')?_0x3152c5[_0x18ca14(0x1ae)](0x1):_0x3152c5,_0x54bb43=_0x94503a[_0x18ca14(0x1bd)]('/')[_0x18ca14(0x1b6)](_0x399d5e=>_0x399d5e!=='');if(_0x54bb43[_0x18ca14(0x18f)]===0x0)throw new Error(_0x18ca14(0x19e));const _0x2c1443=_0x3152c5['startsWith']('/')||!isRelativePathSegment(_0x54bb43[0x0]);for(const _0x32ee98 of _0x54bb43){validatePathSegment(_0x32ee98);}return{'segments':_0x54bb43,'isAbsolute':_0x2c1443,'raw':_0x313ac4};}function isRelativePathSegment(_0xa462f7){return _0xa462f7==='.'||_0xa462f7==='..';}function validatePathSegment(_0x313f7c){const _0x1b865d=a121_0x3223;if(_0x313f7c==='')throw new Error(_0x1b865d(0x1aa));if(_0x313f7c==='.'||_0x313f7c==='..')return;if(/[\x00-\x1F\x7F]/[_0x1b865d(0x1a9)](_0x313f7c))throw new Error(_0x1b865d(0x18e)+_0x313f7c);if(_0x313f7c!==_0x313f7c[_0x1b865d(0x1b0)]()){}}export function validatePath(_0x33e4eb){const _0xeb92e8=a121_0x3223;if(_0x33e4eb[_0xeb92e8(0x19d)][_0xeb92e8(0x18f)]===0x0&&!_0x33e4eb['isAbsolute'])throw new Error(_0xeb92e8(0x198));if(_0x33e4eb[_0xeb92e8(0x1ac)]){if(_0x33e4eb[_0xeb92e8(0x19d)][0x0]==='..')throw new Error(_0xeb92e8(0x1a2));let _0x356e40=0x0;for(const _0x38a8b1 of _0x33e4eb[_0xeb92e8(0x19d)]){if(_0x38a8b1==='..'){if(_0x356e40===0x0)throw new Error(_0xeb92e8(0x19c));_0x356e40--;}else _0x38a8b1!=='.'&&_0x356e40++;}}}export function joinPaths(_0x361bf,_0x206be1){const _0x2dd7aa=a121_0x3223;if(!_0x361bf||_0x361bf==='/')return _0x206be1;if(!_0x206be1||_0x206be1==='.')return _0x361bf;if(_0x206be1[_0x2dd7aa(0x1b1)]('/'))return _0x206be1;const _0x1fbc3f=parsePath(_0x361bf),_0x5727fa=parsePath(_0x206be1),_0x105cad=[..._0x1fbc3f[_0x2dd7aa(0x19d)]];for(const _0x57e046 of _0x5727fa[_0x2dd7aa(0x19d)]){if(_0x57e046==='.')continue;else{if(_0x57e046==='..'){if(_0x105cad['length']===0x0)throw new Error(_0x2dd7aa(0x1b8));_0x105cad[_0x2dd7aa(0x1af)]();}else _0x105cad[_0x2dd7aa(0x1a1)](_0x57e046);}}const _0x1625e8=_0x105cad[_0x2dd7aa(0x199)]('/');return _0x1fbc3f[_0x2dd7aa(0x1a0)]['startsWith']('/')?'/'+_0x1625e8:_0x1625e8;}export function normalizePath(_0x3c8edb){const _0x3abd38=a121_0x3223,_0x447f12=parsePath(_0x3c8edb),_0x35de24=[];for(const _0x58e57f of _0x447f12['segments']){if(_0x58e57f==='.')continue;else{if(_0x58e57f==='..'){if(_0x35de24[_0x3abd38(0x18f)]===0x0){if(_0x447f12[_0x3abd38(0x1ac)])throw new Error(_0x3abd38(0x1b8));_0x35de24[_0x3abd38(0x1a1)]('..');}else _0x35de24[_0x35de24[_0x3abd38(0x18f)]-0x1]==='..'?_0x35de24[_0x3abd38(0x1a1)]('..'):_0x35de24[_0x3abd38(0x1af)]();}else _0x35de24[_0x3abd38(0x1a1)](_0x58e57f);}}if(_0x35de24['length']===0x0)return _0x447f12[_0x3abd38(0x1ac)]?'/':'.';const _0x37d617=_0x35de24[_0x3abd38(0x199)]('/');return _0x447f12[_0x3abd38(0x1a0)]['startsWith']('/')?'/'+_0x37d617:_0x37d617;}function a121_0x3223(_0x10d421,_0xbc134a){_0x10d421=_0x10d421-0x189;const _0x38d907=a121_0x38d9();let _0x3223da=_0x38d907[_0x10d421];return _0x3223da;}export function getParentPath(_0x3e846b){const _0x4f5324=a121_0x3223,_0x473cd2=parsePath(_0x3e846b);if(_0x473cd2[_0x4f5324(0x19d)][_0x4f5324(0x18f)]<=0x1)return'/';const _0x4e974a=_0x473cd2[_0x4f5324(0x19d)][_0x4f5324(0x190)](0x0,-0x1)[_0x4f5324(0x199)]('/');return _0x473cd2[_0x4f5324(0x1a0)]['startsWith']('/')?'/'+_0x4e974a:_0x4e974a;}export function getBaseName(_0x300a1c){const _0x3cd322=a121_0x3223,_0xdfe036=parsePath(_0x300a1c);return _0xdfe036[_0x3cd322(0x19d)][_0xdfe036['segments'][_0x3cd322(0x18f)]-0x1]||'';}export function isChildPath(_0x1eb4eb,_0x5295ac){const _0x594392=a121_0x3223,_0x4670dc=parsePath(_0x1eb4eb),_0x2b0650=parsePath(_0x5295ac);if(_0x4670dc[_0x594392(0x19d)][_0x594392(0x18f)]<=_0x2b0650[_0x594392(0x19d)][_0x594392(0x18f)])return![];for(let _0x4ba508=0x0;_0x4ba508<_0x2b0650['segments'][_0x594392(0x18f)];_0x4ba508++){if(_0x4670dc[_0x594392(0x19d)][_0x4ba508]!==_0x2b0650[_0x594392(0x19d)][_0x4ba508])return![];}return!![];}export function splitPath(_0x3967f0){const _0x5db01c=a121_0x3223,_0x51f026=parsePath(_0x3967f0);if(_0x51f026['segments'][_0x5db01c(0x18f)]===0x0)throw new Error(_0x5db01c(0x1a6));if(_0x51f026[_0x5db01c(0x19d)][_0x5db01c(0x18f)]===0x1)return{'parent':_0x51f026['segments'][0x0]};return{'parent':_0x51f026[_0x5db01c(0x19d)][0x0],'child':_0x51f026[_0x5db01c(0x19d)]['slice'](0x1)['join']('/')};}export function isYamlFilePath(_0x58d649){const _0x13ddf1=a121_0x3223;return _0x58d649['endsWith'](_0x13ddf1(0x18a))||_0x58d649['endsWith'](_0x13ddf1(0x194));}export async function resolveYamlFilePath(_0x3c10b6,_0x39f097=nodeFileSystem){const _0x4eaefe=a121_0x3223,_0x86fc60=a121_0x4fca57[_0x4eaefe(0x197)](_0x3c10b6);if(!await _0x39f097['exists'](_0x86fc60))throw new Error('File\x20not\x20found:\x20'+_0x3c10b6);let _0x4eb272=a121_0x4fca57[_0x4eaefe(0x1ba)](_0x86fc60),_0x4005a2=null,_0x355323=null;const _0x150b01=a121_0x4fca57['parse'](_0x4eb272)['root'];while(_0x4eb272!==_0x150b01){const _0x227f16=a121_0x4fca57[_0x4eaefe(0x199)](_0x4eb272,_0x4eaefe(0x19b));if(await _0x39f097[_0x4eaefe(0x1b5)](_0x227f16)){_0x4005a2=_0x227f16,_0x355323=_0x4eb272;break;}_0x4eb272=a121_0x4fca57[_0x4eaefe(0x1ba)](_0x4eb272);}if(!_0x4005a2||!_0x355323)throw new Error(_0x4eaefe(0x18d)+_0x3c10b6);const _0x2f8b48=await _0x39f097[_0x4eaefe(0x192)](_0x4005a2),_0x59500f=JSON[_0x4eaefe(0x1a3)](_0x2f8b48),_0x57f5bb=_0x59500f['parent_segment'];if(!_0x57f5bb)throw new Error(_0x4eaefe(0x1a7));const _0x5b0b63=await _0x39f097[_0x4eaefe(0x192)](_0x86fc60),_0x334a6=a121_0x2b24e9(_0x5b0b63),_0x5f5a59=_0x334a6[_0x4eaefe(0x1a5)];if(!_0x5f5a59)throw new Error(_0x4eaefe(0x19a)+_0x3c10b6);const _0xf4d429=_0x334a6[_0x4eaefe(0x1b3)]===_0x4eaefe(0x189)?_0x4eaefe(0x189):_0x4eaefe(0x193),_0x439f00=a121_0x4fca57[_0x4eaefe(0x1ab)](_0x355323,_0x86fc60),_0x54dd7f=a121_0x4fca57[_0x4eaefe(0x1ba)](_0x439f00),_0x4b0990=_0x54dd7f==='.'?'':_0x54dd7f[_0x4eaefe(0x1a4)](/\\/g,'/'),_0x429fa3=_0x4b0990?_0x57f5bb+'/'+_0x4b0990+'/'+_0x5f5a59:_0x57f5bb+'/'+_0x5f5a59;return{'parentSegment':_0x57f5bb,'segmentName':_0x5f5a59,'folderPath':_0x4b0990,'fullPath':_0x429fa3,'resourceType':_0xf4d429};}
@@ -1 +1 @@
1
- function a122_0x3e36(_0x16915f,_0x4951d5){_0x16915f=_0x16915f-0x123;const _0x450ef0=a122_0x450e();let _0x3e3645=_0x450ef0[_0x16915f];return _0x3e3645;}function a122_0x450e(){const _0x1d110e=['4274928ZOFFVg','893704obiONl','22LcHgpL','24pybQfi','358404rKqKYh','377199MQlcEA','70hyJruj','214012QIpKHK','199367VzhSLQ','371370cAPTmX','Invalid\x20segment\x20reference\x20format:\x20','substring','3Qxbqgz','8ncHFEC','.\x20Parent\x20name\x20cannot\x20be\x20empty'];a122_0x450e=function(){return _0x1d110e;};return a122_0x450e();}(function(_0x12215a,_0x180b35){const _0x3c140c=a122_0x3e36,_0x45edca=_0x12215a();while(!![]){try{const _0x96da80=-parseInt(_0x3c140c(0x12d))/0x1+-parseInt(_0x3c140c(0x130))/0x2*(-parseInt(_0x3c140c(0x126))/0x3)+-parseInt(_0x3c140c(0x12a))/0x4+-parseInt(_0x3c140c(0x123))/0x5*(parseInt(_0x3c140c(0x12c))/0x6)+-parseInt(_0x3c140c(0x131))/0x7*(parseInt(_0x3c140c(0x127))/0x8)+-parseInt(_0x3c140c(0x12e))/0x9*(-parseInt(_0x3c140c(0x12f))/0xa)+parseInt(_0x3c140c(0x12b))/0xb*(parseInt(_0x3c140c(0x129))/0xc);if(_0x96da80===_0x180b35)break;else _0x45edca['push'](_0x45edca['shift']());}catch(_0x106a38){_0x45edca['push'](_0x45edca['shift']());}}}(a122_0x450e,0x32298));export function parseSegmentRef(_0xc699d9){const _0x2489e5=a122_0x3e36,_0x2c3269=_0xc699d9['indexOf']('/');if(_0x2c3269===-0x1)return{'parentId':_0xc699d9};if(_0x2c3269===0x0)throw new Error(_0x2489e5(0x124)+_0xc699d9+_0x2489e5(0x128));const _0x100d9a=_0xc699d9[_0x2489e5(0x125)](0x0,_0x2c3269),_0x3a6684=_0xc699d9['substring'](_0x2c3269+0x1);if(_0x3a6684==='')throw new Error(_0x2489e5(0x124)+_0xc699d9+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x100d9a,'childId':_0x3a6684};}
1
+ (function(_0x5ce4c1,_0x2a67e9){const _0x27bfaa=a122_0x216f,_0x49fb9e=_0x5ce4c1();while(!![]){try{const _0x37dc56=parseInt(_0x27bfaa(0x176))/0x1*(-parseInt(_0x27bfaa(0x17c))/0x2)+-parseInt(_0x27bfaa(0x17a))/0x3*(-parseInt(_0x27bfaa(0x17d))/0x4)+parseInt(_0x27bfaa(0x17e))/0x5+parseInt(_0x27bfaa(0x177))/0x6*(-parseInt(_0x27bfaa(0x181))/0x7)+parseInt(_0x27bfaa(0x17f))/0x8+parseInt(_0x27bfaa(0x180))/0x9+parseInt(_0x27bfaa(0x17b))/0xa;if(_0x37dc56===_0x2a67e9)break;else _0x49fb9e['push'](_0x49fb9e['shift']());}catch(_0x129d0e){_0x49fb9e['push'](_0x49fb9e['shift']());}}}(a122_0x1465,0x1c5b4));function a122_0x216f(_0x995575,_0x37e55f){_0x995575=_0x995575-0x176;const _0x1465ae=a122_0x1465();let _0x216fe2=_0x1465ae[_0x995575];return _0x216fe2;}export function parseSegmentRef(_0x1ba550){const _0x553bcc=a122_0x216f,_0x27bb66=_0x1ba550[_0x553bcc(0x178)]('/');if(_0x27bb66===-0x1)return{'parentId':_0x1ba550};if(_0x27bb66===0x0)throw new Error(_0x553bcc(0x182)+_0x1ba550+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0xeb29aa=_0x1ba550[_0x553bcc(0x179)](0x0,_0x27bb66),_0x523150=_0x1ba550[_0x553bcc(0x179)](_0x27bb66+0x1);if(_0x523150==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1ba550+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0xeb29aa,'childId':_0x523150};}function a122_0x1465(){const _0x610b97=['20020PckSmc','20660bJNUJA','926832Vxoqpg','374121toVEUA','7syvYvU','Invalid\x20segment\x20reference\x20format:\x20','52382VZLWgP','273534ZmggQh','indexOf','substring','87AUGcvn','645650lkYoKG','8izlvSN'];a122_0x1465=function(){return _0x610b97;};return a122_0x1465();}
@@ -1 +1 @@
1
- (function(_0x3ddeb6,_0x38272a){const _0x35ca75=a123_0x3407,_0x4ecbd4=_0x3ddeb6();while(!![]){try{const _0x10d82c=parseInt(_0x35ca75(0x1d5))/0x1+-parseInt(_0x35ca75(0x1b4))/0x2*(parseInt(_0x35ca75(0x1ac))/0x3)+parseInt(_0x35ca75(0x1aa))/0x4*(-parseInt(_0x35ca75(0x1c5))/0x5)+parseInt(_0x35ca75(0x1c9))/0x6+-parseInt(_0x35ca75(0x1b1))/0x7+-parseInt(_0x35ca75(0x1b7))/0x8*(parseInt(_0x35ca75(0x1be))/0x9)+parseInt(_0x35ca75(0x1cd))/0xa;if(_0x10d82c===_0x38272a)break;else _0x4ecbd4['push'](_0x4ecbd4['shift']());}catch(_0x413652){_0x4ecbd4['push'](_0x4ecbd4['shift']());}}}(a123_0x1e29,0xcc927));import a123_0x5a6beb from'path';function a123_0x1e29(){const _0x18184c=['folderPath','directory','parse','18KrYlvn','parent_name','exists','Parent\x20segment\x20not\x20specified','stat','File\x20not\x20found:\x20','type','8980TZnBIH','isDirectory','no_parent','segment','3934020WbeDZf','extname','tdx.json','error','52836210OTVCxQ','isScoped','trim','parent_segment','replace','basename','resourceType','segmentName','481276wRcPBg','startsWith','invalid_yaml','includes','match','parentSegment','scopedFolderPath','File\x20not\x20found','file','resolve','journey','isFile','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','3156nHrdVw','file_not_found','60594vMmYRD','dirname','readFile','no_config','relative','11381930StpQeK','No\x20tdx.json\x20found\x20for\x20file:\x20','configDir','140vywbuZ','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','4502984yHpqEN','cwd','message','string'];a123_0x1e29=function(){return _0x18184c;};return a123_0x1e29();}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(_0x27a4d8){const _0x4a0146=a123_0x3407;return _0x27a4d8[_0x4a0146(0x1c4)]!==_0x4a0146(0x1cc);}export function isScopedResolution(_0x48e998){const _0xea4401=a123_0x3407;return _0x48e998[_0xea4401(0x1c4)]===_0xea4401(0x1bc)||_0x48e998[_0xea4401(0x1c4)]===_0xea4401(0x1a5)||_0x48e998['type']===_0xea4401(0x1b5);}export function getScopedDetails(_0x169c68){if(isScopedResolution(_0x169c68))return{'isScoped':_0x169c68['isScoped'],'scopedFolderPath':_0x169c68['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x3521f4,_0x2de1de){const _0x55136b=a123_0x3407;let _0x2b5892=a123_0x5a6beb['resolve'](_0x3521f4);const _0x1397e0=a123_0x5a6beb['parse'](_0x2b5892)['root'];while(_0x2b5892!==_0x1397e0){const _0x5f2b52=a123_0x5a6beb['join'](_0x2b5892,_0x55136b(0x1cb));if(await _0x2de1de['exists'](_0x5f2b52))try{const _0x30baa5=await _0x2de1de[_0x55136b(0x1ae)](_0x5f2b52),_0x44984e=JSON[_0x55136b(0x1bd)](_0x30baa5);if(_0x44984e[_0x55136b(0x1d0)]&&typeof _0x44984e[_0x55136b(0x1d0)]===_0x55136b(0x1ba))return{'configPath':_0x5f2b52,'configDir':_0x2b5892,'parentSegment':_0x44984e[_0x55136b(0x1d0)]};}catch{}_0x2b5892=a123_0x5a6beb['dirname'](_0x2b5892);}return null;}function a123_0x3407(_0x2d80e4,_0x17c576){_0x2d80e4=_0x2d80e4-0x1a1;const _0x1e29e9=a123_0x1e29();let _0x340781=_0x1e29e9[_0x2d80e4];return _0x340781;}function calculateScopedPath(_0x1f7d7a,_0x4a0b30){const _0x4a7639=a123_0x3407,_0x9f5f8c=a123_0x5a6beb[_0x4a7639(0x1b0)](_0x4a0b30,_0x1f7d7a),_0x16b7cc=_0x9f5f8c!==''&&_0x9f5f8c!=='.'&&!_0x9f5f8c[_0x4a7639(0x1d6)]('..');return{'isScoped':_0x16b7cc,'scopedFolderPath':_0x16b7cc?_0x9f5f8c[_0x4a7639(0x1d1)](/\\/g,'/'):''};}export async function resolveTarget(_0x3d9371){const _0x4a3b36=a123_0x3407,{arg:_0x573496,contextParent:_0x4e1475,cwd:cwd=process[_0x4a3b36(0x1b8)](),fs:fs=nodeFileSystem}=_0x3d9371;if(_0x573496&&isYamlFilePath(_0x573496))try{const _0x2a512f=await resolveYamlFilePath(_0x573496,fs),_0x3d2497=a123_0x5a6beb[_0x4a3b36(0x1a6)](_0x573496),_0xe06eba=a123_0x5a6beb[_0x4a3b36(0x1ad)](_0x3d2497),_0xd9a180=await findTdxConfigAsync(_0xe06eba,fs);if(!_0xd9a180){if(_0x4e1475){const _0x5d330f=a123_0x5a6beb['dirname'](_0x3d2497);return{'type':'file','parentName':_0x4e1475,'targetDir':_0x5d330f,'configRoot':_0x5d330f,'filePath':_0x3d2497,'resourceName':_0x2a512f[_0x4a3b36(0x1d4)],'folderPath':_0x2a512f[_0x4a3b36(0x1bb)],'resourceType':_0x2a512f[_0x4a3b36(0x1d3)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1af),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x573496,'arg':_0x573496,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}const _0x4a271a=calculateScopedPath(_0xe06eba,_0xd9a180[_0x4a3b36(0x1b3)]);return{'type':_0x4a3b36(0x1a5),'parentName':_0xd9a180[_0x4a3b36(0x1a2)],'targetDir':_0xd9a180[_0x4a3b36(0x1b3)],'configRoot':_0xd9a180[_0x4a3b36(0x1b3)],'filePath':_0x3d2497,'resourceName':_0x2a512f[_0x4a3b36(0x1d4)],'folderPath':_0x2a512f[_0x4a3b36(0x1bb)],'resourceType':_0x2a512f['resourceType'],'isScoped':_0x4a271a['isScoped'],'scopedFolderPath':_0x4a271a['scopedFolderPath']};}catch(_0x10c589){const _0x41f602=_0x10c589 instanceof Error?_0x10c589[_0x4a3b36(0x1b9)]:String(_0x10c589);if(_0x41f602['includes'](_0x4a3b36(0x1a4)))return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1ab),'message':_0x4a3b36(0x1c3)+_0x573496,'arg':_0x573496};if(_0x41f602[_0x4a3b36(0x1d8)]('No\x20tdx.json\x20found')){if(_0x4e1475){const _0xd45816=a123_0x5a6beb[_0x4a3b36(0x1a6)](_0x573496);if(await fs[_0x4a3b36(0x1c0)](_0xd45816)){const _0x5a6163=a123_0x5a6beb[_0x4a3b36(0x1ad)](_0xd45816),_0x3825ef=await fs[_0x4a3b36(0x1ae)](_0xd45816),_0x1b2691=_0x3825ef['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0xeaddda=_0x3825ef[_0x4a3b36(0x1a1)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x1a0ff0=_0x1b2691?_0x1b2691[0x1][_0x4a3b36(0x1cf)]():a123_0x5a6beb[_0x4a3b36(0x1d2)](_0x573496,a123_0x5a6beb[_0x4a3b36(0x1ca)](_0x573496)),_0x141e6a=_0xeaddda&&_0xeaddda[0x1][_0x4a3b36(0x1cf)]()===_0x4a3b36(0x1a7)?_0x4a3b36(0x1a7):_0x4a3b36(0x1c8);return{'type':'file','parentName':_0x4e1475,'targetDir':_0x5a6163,'configRoot':_0x5a6163,'filePath':_0xd45816,'resourceName':_0x1a0ff0,'folderPath':'','resourceType':_0x141e6a,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x4a3b36(0x1cc),'errorCode':'no_config','message':_0x4a3b36(0x1b2)+_0x573496,'arg':_0x573496,'helpText':_0x4a3b36(0x1b6)};}return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1d7),'message':_0x41f602,'arg':_0x573496};}if(_0x573496){const _0xa9ad71=a123_0x5a6beb[_0x4a3b36(0x1a6)](cwd,_0x573496);let _0x1fc3aa=null;try{_0x1fc3aa=await fs[_0x4a3b36(0x1c2)](_0xa9ad71);}catch{}if(_0x1fc3aa?.[_0x4a3b36(0x1c6)]()){const _0x169b4e=await findTdxConfigAsync(_0xa9ad71,fs);if(_0x169b4e){const _0x388d16=calculateScopedPath(_0xa9ad71,_0x169b4e['configDir']);return{'type':_0x4a3b36(0x1bc),'parentName':_0x169b4e[_0x4a3b36(0x1a2)],'targetDir':_0xa9ad71,'configRoot':_0x169b4e['configDir'],'isScoped':_0x388d16[_0x4a3b36(0x1ce)],'scopedFolderPath':_0x388d16[_0x4a3b36(0x1a3)]};}if(_0x4e1475)return{'type':'directory','parentName':_0x4e1475,'targetDir':_0xa9ad71,'configRoot':_0xa9ad71,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x4a3b36(0x1af),'message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x573496,'arg':_0x573496,'helpText':_0x4a3b36(0x1b6)};}if(_0x1fc3aa?.[_0x4a3b36(0x1a8)]())return{'type':_0x4a3b36(0x1cc),'errorCode':'invalid_yaml','message':'Not\x20a\x20YAML\x20file:\x20'+_0x573496,'arg':_0x573496,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x502a09=sanitizeFileName(_0x573496),_0x4dd464=getSegmentRootDir(_0x502a09,cwd);return{'type':_0x4a3b36(0x1bf),'parentName':_0x573496,'targetDir':_0x4dd464,'configRoot':_0x4dd464};}const _0x21d39f=await findTdxConfigAsync(cwd,fs);if(_0x21d39f){const _0x2de4b5=calculateScopedPath(cwd,_0x21d39f[_0x4a3b36(0x1b3)]);return{'type':_0x4a3b36(0x1b5),'parentName':_0x21d39f[_0x4a3b36(0x1a2)],'targetDir':cwd,'configRoot':_0x21d39f[_0x4a3b36(0x1b3)],'isScoped':_0x2de4b5[_0x4a3b36(0x1ce)],'scopedFolderPath':_0x2de4b5['scopedFolderPath']};}if(_0x4e1475){const _0x53586c=sanitizeFileName(_0x4e1475),_0x3ac17d=getSegmentRootDir(_0x53586c,cwd);return{'type':_0x4a3b36(0x1b5),'parentName':_0x4e1475,'targetDir':_0x3ac17d,'configRoot':_0x3ac17d,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1c7),'message':_0x4a3b36(0x1c1),'helpText':_0x4a3b36(0x1a9)};}
1
+ (function(_0xd576ac,_0x384b13){const _0x75125b=a123_0x3d21,_0x34df70=_0xd576ac();while(!![]){try{const _0x4140b4=parseInt(_0x75125b(0x15c))/0x1+-parseInt(_0x75125b(0x155))/0x2*(parseInt(_0x75125b(0x167))/0x3)+-parseInt(_0x75125b(0x16b))/0x4*(-parseInt(_0x75125b(0x185))/0x5)+-parseInt(_0x75125b(0x17b))/0x6+-parseInt(_0x75125b(0x159))/0x7*(-parseInt(_0x75125b(0x16f))/0x8)+parseInt(_0x75125b(0x171))/0x9+-parseInt(_0x75125b(0x14f))/0xa*(parseInt(_0x75125b(0x16c))/0xb);if(_0x4140b4===_0x384b13)break;else _0x34df70['push'](_0x34df70['shift']());}catch(_0x146c1d){_0x34df70['push'](_0x34df70['shift']());}}}(a123_0x1ab0,0xb4969));function a123_0x3d21(_0x4d3361,_0x36f713){_0x4d3361=_0x4d3361-0x14e;const _0x1ab0f0=a123_0x1ab0();let _0x3d21f3=_0x1ab0f0[_0x4d3361];return _0x3d21f3;}import a123_0x5be149 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(_0x26bbd8){const _0x5123ed=a123_0x3d21;return _0x26bbd8[_0x5123ed(0x158)]!==_0x5123ed(0x166);}export function isScopedResolution(_0x2d6c3f){const _0x2c15c8=a123_0x3d21;return _0x2d6c3f[_0x2c15c8(0x158)]===_0x2c15c8(0x16e)||_0x2d6c3f[_0x2c15c8(0x158)]===_0x2c15c8(0x17f)||_0x2d6c3f[_0x2c15c8(0x158)]===_0x2c15c8(0x170);}export function getScopedDetails(_0xf63b57){const _0x224c19=a123_0x3d21;if(isScopedResolution(_0xf63b57))return{'isScoped':_0xf63b57['isScoped'],'scopedFolderPath':_0xf63b57[_0x224c19(0x15f)]};return undefined;}function a123_0x1ab0(){const _0x3165db=['File\x20not\x20found','join','journey','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','resolve','699698VEQxGc','cwd','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','type','1638YRBcps','stat','parent_segment','632910hKgnJB','trim','isFile','scopedFolderPath','message','parse','resourceType','exists','root','isScoped','error','3PWOLDX','startsWith','readFile','string','686300LMMBnv','1113827jIOcXK','relative','directory','8112MCNwKA','context','11435283faGkav','isDirectory','Parent\x20segment\x20not\x20specified','no_config','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','configDir','dirname','extname','tdx.json','segmentName','6408690JAFkAQ','No\x20tdx.json\x20found\x20for\x20file:\x20','segment','folderPath','file','replace','No\x20tdx.json\x20found','parentSegment','no_parent','file_not_found','30srUzvv','invalid_yaml','match','100RbUoDM'];a123_0x1ab0=function(){return _0x3165db;};return a123_0x1ab0();}async function findTdxConfigAsync(_0x4f2b01,_0x512f34){const _0x15dc72=a123_0x3d21;let _0x57d3aa=a123_0x5be149[_0x15dc72(0x154)](_0x4f2b01);const _0x114161=a123_0x5be149[_0x15dc72(0x161)](_0x57d3aa)[_0x15dc72(0x164)];while(_0x57d3aa!==_0x114161){const _0x504d35=a123_0x5be149[_0x15dc72(0x151)](_0x57d3aa,_0x15dc72(0x179));if(await _0x512f34[_0x15dc72(0x163)](_0x504d35))try{const _0xc7f3cf=await _0x512f34['readFile'](_0x504d35),_0x44871d=JSON[_0x15dc72(0x161)](_0xc7f3cf);if(_0x44871d['parent_segment']&&typeof _0x44871d[_0x15dc72(0x15b)]===_0x15dc72(0x16a))return{'configPath':_0x504d35,'configDir':_0x57d3aa,'parentSegment':_0x44871d[_0x15dc72(0x15b)]};}catch{}_0x57d3aa=a123_0x5be149[_0x15dc72(0x177)](_0x57d3aa);}return null;}function calculateScopedPath(_0x3c0c59,_0x3df03d){const _0x1ef9c7=a123_0x3d21,_0x45b5a5=a123_0x5be149[_0x1ef9c7(0x16d)](_0x3df03d,_0x3c0c59),_0x366ecc=_0x45b5a5!==''&&_0x45b5a5!=='.'&&!_0x45b5a5[_0x1ef9c7(0x168)]('..');return{'isScoped':_0x366ecc,'scopedFolderPath':_0x366ecc?_0x45b5a5[_0x1ef9c7(0x180)](/\\/g,'/'):''};}export async function resolveTarget(_0x2648ea){const _0x46586d=a123_0x3d21,{arg:_0x30f7b2,contextParent:_0x2966e2,cwd:cwd=process[_0x46586d(0x156)](),fs:fs=nodeFileSystem}=_0x2648ea;if(_0x30f7b2&&isYamlFilePath(_0x30f7b2))try{const _0x34dd3d=await resolveYamlFilePath(_0x30f7b2,fs),_0x5c1e53=a123_0x5be149['resolve'](_0x30f7b2),_0x496e1f=a123_0x5be149[_0x46586d(0x177)](_0x5c1e53),_0x15a120=await findTdxConfigAsync(_0x496e1f,fs);if(!_0x15a120){if(_0x2966e2){const _0x29f4e3=a123_0x5be149[_0x46586d(0x177)](_0x5c1e53);return{'type':_0x46586d(0x17f),'parentName':_0x2966e2,'targetDir':_0x29f4e3,'configRoot':_0x29f4e3,'filePath':_0x5c1e53,'resourceName':_0x34dd3d[_0x46586d(0x17a)],'folderPath':_0x34dd3d[_0x46586d(0x17e)],'resourceType':_0x34dd3d['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x174),'message':_0x46586d(0x17c)+_0x30f7b2,'arg':_0x30f7b2,'helpText':_0x46586d(0x175)};}const _0x5e0910=calculateScopedPath(_0x496e1f,_0x15a120[_0x46586d(0x176)]);return{'type':_0x46586d(0x17f),'parentName':_0x15a120[_0x46586d(0x182)],'targetDir':_0x15a120[_0x46586d(0x176)],'configRoot':_0x15a120[_0x46586d(0x176)],'filePath':_0x5c1e53,'resourceName':_0x34dd3d['segmentName'],'folderPath':_0x34dd3d['folderPath'],'resourceType':_0x34dd3d[_0x46586d(0x162)],'isScoped':_0x5e0910[_0x46586d(0x165)],'scopedFolderPath':_0x5e0910[_0x46586d(0x15f)]};}catch(_0xd02985){const _0x1a7dd1=_0xd02985 instanceof Error?_0xd02985[_0x46586d(0x160)]:String(_0xd02985);if(_0x1a7dd1['includes'](_0x46586d(0x150)))return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x184),'message':'File\x20not\x20found:\x20'+_0x30f7b2,'arg':_0x30f7b2};if(_0x1a7dd1['includes'](_0x46586d(0x181))){if(_0x2966e2){const _0x149337=a123_0x5be149['resolve'](_0x30f7b2);if(await fs['exists'](_0x149337)){const _0x15380c=a123_0x5be149[_0x46586d(0x177)](_0x149337),_0x8df884=await fs[_0x46586d(0x169)](_0x149337),_0x45c02b=_0x8df884[_0x46586d(0x14e)](/^name:\s*["']?([^"'\n]+)["']?/m),_0xaafe08=_0x8df884[_0x46586d(0x14e)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x1a79ce=_0x45c02b?_0x45c02b[0x1][_0x46586d(0x15d)]():a123_0x5be149['basename'](_0x30f7b2,a123_0x5be149[_0x46586d(0x178)](_0x30f7b2)),_0x107c48=_0xaafe08&&_0xaafe08[0x1][_0x46586d(0x15d)]()===_0x46586d(0x152)?_0x46586d(0x152):_0x46586d(0x17d);return{'type':_0x46586d(0x17f),'parentName':_0x2966e2,'targetDir':_0x15380c,'configRoot':_0x15380c,'filePath':_0x149337,'resourceName':_0x1a79ce,'folderPath':'','resourceType':_0x107c48,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x174),'message':_0x46586d(0x17c)+_0x30f7b2,'arg':_0x30f7b2,'helpText':_0x46586d(0x175)};}return{'type':'error','errorCode':_0x46586d(0x186),'message':_0x1a7dd1,'arg':_0x30f7b2};}if(_0x30f7b2){const _0xa1309=a123_0x5be149[_0x46586d(0x154)](cwd,_0x30f7b2);let _0x1ea6c8=null;try{_0x1ea6c8=await fs[_0x46586d(0x15a)](_0xa1309);}catch{}if(_0x1ea6c8?.[_0x46586d(0x172)]()){const _0x35b086=await findTdxConfigAsync(_0xa1309,fs);if(_0x35b086){const _0x5eb49a=calculateScopedPath(_0xa1309,_0x35b086[_0x46586d(0x176)]);return{'type':_0x46586d(0x16e),'parentName':_0x35b086[_0x46586d(0x182)],'targetDir':_0xa1309,'configRoot':_0x35b086['configDir'],'isScoped':_0x5eb49a['isScoped'],'scopedFolderPath':_0x5eb49a[_0x46586d(0x15f)]};}if(_0x2966e2)return{'type':_0x46586d(0x16e),'parentName':_0x2966e2,'targetDir':_0xa1309,'configRoot':_0xa1309,'isScoped':![],'scopedFolderPath':''};return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x174),'message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x30f7b2,'arg':_0x30f7b2,'helpText':_0x46586d(0x175)};}if(_0x1ea6c8?.[_0x46586d(0x15e)]())return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x186),'message':'Not\x20a\x20YAML\x20file:\x20'+_0x30f7b2,'arg':_0x30f7b2,'helpText':_0x46586d(0x153)};const _0x13cddd=sanitizeFileName(_0x30f7b2),_0x3ef6c6=getSegmentRootDir(_0x13cddd,cwd);return{'type':'parent_name','parentName':_0x30f7b2,'targetDir':_0x3ef6c6,'configRoot':_0x3ef6c6};}const _0x320e69=await findTdxConfigAsync(cwd,fs);if(_0x320e69){const _0x4c9c0f=calculateScopedPath(cwd,_0x320e69[_0x46586d(0x176)]);return{'type':_0x46586d(0x170),'parentName':_0x320e69[_0x46586d(0x182)],'targetDir':cwd,'configRoot':_0x320e69[_0x46586d(0x176)],'isScoped':_0x4c9c0f[_0x46586d(0x165)],'scopedFolderPath':_0x4c9c0f[_0x46586d(0x15f)]};}if(_0x2966e2){const _0x4fd3f3=sanitizeFileName(_0x2966e2),_0x4f84d1=getSegmentRootDir(_0x4fd3f3,cwd);return{'type':'context','parentName':_0x2966e2,'targetDir':_0x4f84d1,'configRoot':_0x4f84d1,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x183),'message':_0x46586d(0x173),'helpText':_0x46586d(0x157)};}
@@ -1 +1 @@
1
- function a124_0x2d21(){const _0x2d2d81=['370HjBVSd','object','startsWith','154656HFbHkr','root','stringify','191640xaCkUf','dirname','2847713NVvyhi','8eIeIwp','77777LSGicV','utf-8','cwd','parse','resolve','segments','tdx.json','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','2970276jDyKJR','315miAkMf','parent_segment','replace','Invalid\x20JSON\x20in\x20','70932ADCXFh','11188ujMKoQ','join','relative','string','296QHZVjb','Invalid\x20tdx.json:\x20expected\x20object','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field'];a124_0x2d21=function(){return _0x2d2d81;};return a124_0x2d21();}const a124_0x24683d=a124_0x4a2c;(function(_0x5b5ecc,_0x6c6590){const _0x2eb3a2=a124_0x4a2c,_0x4a8da6=_0x5b5ecc();while(!![]){try{const _0x458384=-parseInt(_0x2eb3a2(0x1a1))/0x1+-parseInt(_0x2eb3a2(0x185))/0x2*(parseInt(_0x2eb3a2(0x193))/0x3)+-parseInt(_0x2eb3a2(0x194))/0x4*(-parseInt(_0x2eb3a2(0x18f))/0x5)+parseInt(_0x2eb3a2(0x18e))/0x6+parseInt(_0x2eb3a2(0x186))/0x7*(-parseInt(_0x2eb3a2(0x198))/0x8)+parseInt(_0x2eb3a2(0x19e))/0x9*(parseInt(_0x2eb3a2(0x19b))/0xa)+-parseInt(_0x2eb3a2(0x184))/0xb;if(_0x458384===_0x6c6590)break;else _0x4a8da6['push'](_0x4a8da6['shift']());}catch(_0x538a06){_0x4a8da6['push'](_0x4a8da6['shift']());}}}(a124_0x2d21,0x55a8b));import{existsSync,readFileSync}from'fs';import a124_0xecb9fc from'path';const TDX_CONFIG_FILE=a124_0x24683d(0x18c),SEGMENTS_DIR=a124_0x24683d(0x18b);export function findTdxConfigPath(_0x1824d0=process[a124_0x24683d(0x188)]()){const _0x1af8cd=a124_0x24683d;let _0x5d2dec=a124_0xecb9fc[_0x1af8cd(0x18a)](_0x1824d0);const _0x37e29e=a124_0xecb9fc[_0x1af8cd(0x189)](_0x5d2dec)[_0x1af8cd(0x19f)];while(_0x5d2dec!==_0x37e29e){const _0xb1f1c2=a124_0xecb9fc[_0x1af8cd(0x195)](_0x5d2dec,TDX_CONFIG_FILE);if(existsSync(_0xb1f1c2))return _0xb1f1c2;_0x5d2dec=a124_0xecb9fc[_0x1af8cd(0x183)](_0x5d2dec);}return null;}function a124_0x4a2c(_0x26911d,_0x86b07f){_0x26911d=_0x26911d-0x183;const _0x2d211b=a124_0x2d21();let _0x4a2cf8=_0x2d211b[_0x26911d];return _0x4a2cf8;}export function loadTdxConfig(_0x4ec2f4){const _0x258a92=a124_0x24683d,_0x4b35d5=readFileSync(_0x4ec2f4,_0x258a92(0x187));let _0x55acfc;try{_0x55acfc=JSON['parse'](_0x4b35d5);}catch{throw new Error(_0x258a92(0x192)+_0x4ec2f4);}if(!_0x55acfc||typeof _0x55acfc!==_0x258a92(0x19c))throw new Error(_0x258a92(0x199));const _0x693c69=_0x55acfc;if(!_0x693c69[_0x258a92(0x190)]||typeof _0x693c69['parent_segment']!==_0x258a92(0x197))throw new Error(_0x258a92(0x19a));return{'parent_segment':_0x693c69[_0x258a92(0x190)]};}export function findTdxConfig(_0x3b0ec6=process[a124_0x24683d(0x188)]()){const _0x25405a=a124_0x24683d,_0xf762a7=findTdxConfigPath(_0x3b0ec6);if(!_0xf762a7)throw new Error(_0x25405a(0x18d));const _0x273957=loadTdxConfig(_0xf762a7),_0x410c94=a124_0xecb9fc[_0x25405a(0x183)](_0xf762a7);return{'config':_0x273957,'configPath':_0xf762a7,'configDir':_0x410c94};}export function tryFindTdxConfig(_0x2c9769){try{return findTdxConfig(_0x2c9769);}catch{return null;}}export function getSegmentRootDir(_0x3db9b1,_0x114635=process[a124_0x24683d(0x188)]()){return a124_0xecb9fc['join'](_0x114635,SEGMENTS_DIR,_0x3db9b1);}export function getTdxConfigPath(_0x18e9a9,_0x44898f=process[a124_0x24683d(0x188)]()){const _0x5c8e2e=a124_0x24683d;return a124_0xecb9fc[_0x5c8e2e(0x195)](getSegmentRootDir(_0x18e9a9,_0x44898f),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x41b21b,_0x1b5600){const _0x3cf2d1=a124_0x24683d,_0x5166c7=a124_0xecb9fc[_0x3cf2d1(0x18a)](_0x41b21b),_0x196481=a124_0xecb9fc[_0x3cf2d1(0x196)](_0x1b5600,_0x5166c7);if(_0x196481[_0x3cf2d1(0x19d)]('..'))return'';return _0x196481;}export function localPathToTdFolderPath(_0x45aa46){const _0x37c74d=a124_0x24683d,_0x440555=a124_0xecb9fc[_0x37c74d(0x183)](_0x45aa46);if(_0x440555==='.'||_0x440555==='')return'';return _0x440555[_0x37c74d(0x191)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x577f69,_0x317936){if(!_0x577f69)return _0x317936;return a124_0xecb9fc['join'](_0x317936,_0x577f69);}export function createTdxConfigContent(_0x249034){const _0x282f89=a124_0x24683d,_0x471336={'parent_segment':_0x249034};return JSON[_0x282f89(0x1a0)](_0x471336,null,0x2)+'\x0a';}
1
+ const a124_0x1eb463=a124_0x4991;(function(_0x4fac38,_0x18e845){const _0x44dda0=a124_0x4991,_0x50b5b0=_0x4fac38();while(!![]){try{const _0x925bf1=parseInt(_0x44dda0(0x156))/0x1+-parseInt(_0x44dda0(0x153))/0x2+-parseInt(_0x44dda0(0x14d))/0x3+parseInt(_0x44dda0(0x14e))/0x4+-parseInt(_0x44dda0(0x152))/0x5+-parseInt(_0x44dda0(0x159))/0x6*(parseInt(_0x44dda0(0x164))/0x7)+parseInt(_0x44dda0(0x15d))/0x8;if(_0x925bf1===_0x18e845)break;else _0x50b5b0['push'](_0x50b5b0['shift']());}catch(_0x156b3f){_0x50b5b0['push'](_0x50b5b0['shift']());}}}(a124_0x44fa,0x947f8));import{existsSync,readFileSync}from'fs';import a124_0x13c159 from'path';function a124_0x4991(_0x2c1b58,_0x4a8f30){_0x2c1b58=_0x2c1b58-0x14d;const _0x44fa8e=a124_0x44fa();let _0x4991f1=_0x44fa8e[_0x2c1b58];return _0x4991f1;}function a124_0x44fa(){const _0x214193=['startsWith','parse','3265598NTathq','1251783jjlKlM','1719816EcKzmH','stringify','segments','parent_segment','742005OopoOQ','1143890ZjFoGC','object','relative','1001802Gnhrjz','tdx.json','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','6PSpgDJ','Invalid\x20tdx.json:\x20expected\x20object','dirname','utf-8','6244904FVdBvi','root','cwd','resolve','join'];a124_0x44fa=function(){return _0x214193;};return a124_0x44fa();}const TDX_CONFIG_FILE=a124_0x1eb463(0x157),SEGMENTS_DIR=a124_0x1eb463(0x150);export function findTdxConfigPath(_0x1a2d0a=process[a124_0x1eb463(0x15f)]()){const _0x24b02=a124_0x1eb463;let _0x17eaef=a124_0x13c159[_0x24b02(0x160)](_0x1a2d0a);const _0x23772d=a124_0x13c159[_0x24b02(0x163)](_0x17eaef)[_0x24b02(0x15e)];while(_0x17eaef!==_0x23772d){const _0x182b30=a124_0x13c159[_0x24b02(0x161)](_0x17eaef,TDX_CONFIG_FILE);if(existsSync(_0x182b30))return _0x182b30;_0x17eaef=a124_0x13c159[_0x24b02(0x15b)](_0x17eaef);}return null;}export function loadTdxConfig(_0x303462){const _0x2defad=a124_0x1eb463,_0x1da075=readFileSync(_0x303462,_0x2defad(0x15c));let _0xe6c51a;try{_0xe6c51a=JSON[_0x2defad(0x163)](_0x1da075);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x303462);}if(!_0xe6c51a||typeof _0xe6c51a!==_0x2defad(0x154))throw new Error(_0x2defad(0x15a));const _0x58e795=_0xe6c51a;if(!_0x58e795[_0x2defad(0x151)]||typeof _0x58e795['parent_segment']!=='string')throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field');return{'parent_segment':_0x58e795[_0x2defad(0x151)]};}export function findTdxConfig(_0x36477b=process['cwd']()){const _0xeb39ea=a124_0x1eb463,_0x349111=findTdxConfigPath(_0x36477b);if(!_0x349111)throw new Error(_0xeb39ea(0x158));const _0x27cca8=loadTdxConfig(_0x349111),_0x2bacda=a124_0x13c159[_0xeb39ea(0x15b)](_0x349111);return{'config':_0x27cca8,'configPath':_0x349111,'configDir':_0x2bacda};}export function tryFindTdxConfig(_0x45ed95){try{return findTdxConfig(_0x45ed95);}catch{return null;}}export function getSegmentRootDir(_0x4fa82e,_0x370e0e=process[a124_0x1eb463(0x15f)]()){const _0x4e6b33=a124_0x1eb463;return a124_0x13c159[_0x4e6b33(0x161)](_0x370e0e,SEGMENTS_DIR,_0x4fa82e);}export function getTdxConfigPath(_0x295a12,_0x153ead=process[a124_0x1eb463(0x15f)]()){const _0x32159d=a124_0x1eb463;return a124_0x13c159[_0x32159d(0x161)](getSegmentRootDir(_0x295a12,_0x153ead),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x5ac194,_0x53af57){const _0x11691b=a124_0x1eb463,_0x492ffa=a124_0x13c159['resolve'](_0x5ac194),_0x3a59cf=a124_0x13c159[_0x11691b(0x155)](_0x53af57,_0x492ffa);if(_0x3a59cf[_0x11691b(0x162)]('..'))return'';return _0x3a59cf;}export function localPathToTdFolderPath(_0x44c481){const _0x514bc4=a124_0x1eb463,_0x49e9a2=a124_0x13c159[_0x514bc4(0x15b)](_0x44c481);if(_0x49e9a2==='.'||_0x49e9a2==='')return'';return _0x49e9a2['replace'](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x160c1f,_0x2a93e7){if(!_0x160c1f)return _0x2a93e7;return a124_0x13c159['join'](_0x2a93e7,_0x160c1f);}export function createTdxConfigContent(_0x2b2401){const _0x1769b1=a124_0x1eb463,_0x54a0a9={'parent_segment':_0x2b2401};return JSON[_0x1769b1(0x14f)](_0x54a0a9,null,0x2)+'\x0a';}