@treasuredata/tdx 0.19.0 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/README.md +4 -8
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-command.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/journey-command.js +1 -1
  22. package/dist/commands/journey-validate-command.js +1 -1
  23. package/dist/commands/llm-command.js +1 -1
  24. package/dist/commands/llm-proxy.js +1 -1
  25. package/dist/commands/mcp-command.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profile-command.js +1 -1
  28. package/dist/commands/profiles-command.js +1 -1
  29. package/dist/commands/query-command.js +1 -1
  30. package/dist/commands/schedule-command.js +1 -1
  31. package/dist/commands/segment-command.js +1 -1
  32. package/dist/commands/segment-create-command.js +1 -1
  33. package/dist/commands/segment-fields-command.js +1 -1
  34. package/dist/commands/segment-pull-command.js +1 -1
  35. package/dist/commands/segment-push-command.js +1 -1
  36. package/dist/commands/segment-update-command.js +1 -1
  37. package/dist/commands/segment-use-command.js +1 -1
  38. package/dist/commands/segment-validate-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/status-command.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/unset-command.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/command-output.js +1 -1
  49. package/dist/core/config.js +1 -1
  50. package/dist/core/connection-cache.js +1 -1
  51. package/dist/core/constants.js +1 -1
  52. package/dist/core/credential-cache.js +1 -1
  53. package/dist/core/global-context.js +1 -1
  54. package/dist/core/keychain.js +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/project-config.js +1 -1
  57. package/dist/core/session.js +1 -1
  58. package/dist/core/user-cache.js +1 -1
  59. package/dist/core/version.js +1 -1
  60. package/dist/index.js +1 -1
  61. package/dist/mcp/server.js +1 -1
  62. package/dist/mcp/tools/index.js +1 -1
  63. package/dist/mcp/tools/tdx-run.js +1 -1
  64. package/dist/mcp/tools/tdx-search.js +1 -1
  65. package/dist/mcp/utils.js +1 -1
  66. package/dist/proxy/anthropic-adapter.js +1 -1
  67. package/dist/proxy/claude-usage-tracker.js +1 -1
  68. package/dist/proxy/context-signature.js +1 -1
  69. package/dist/proxy/conversation-utils.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/server.js +1 -1
  72. package/dist/proxy/session-cache.js +1 -1
  73. package/dist/proxy/sse-usage-parser.js +1 -1
  74. package/dist/sdk/agent/agent-config.js +1 -1
  75. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  76. package/dist/sdk/agent/agent-yaml.js +1 -1
  77. package/dist/sdk/agent/test/evaluator.js +1 -1
  78. package/dist/sdk/agent/test/executor.js +1 -1
  79. package/dist/sdk/agent/test/index.js +1 -1
  80. package/dist/sdk/agent/test/output.js +1 -1
  81. package/dist/sdk/agent/test/parser.js +1 -1
  82. package/dist/sdk/api.js +1 -1
  83. package/dist/sdk/client/cdp-api-client.js +1 -1
  84. package/dist/sdk/client/endpoints.js +1 -1
  85. package/dist/sdk/client/engage-api-client.js +1 -1
  86. package/dist/sdk/client/http-client.js +1 -1
  87. package/dist/sdk/client/llm-api-client.js +1 -1
  88. package/dist/sdk/client/rate-limiter.js +1 -1
  89. package/dist/sdk/client/td-api-client.js +1 -1
  90. package/dist/sdk/client/trino-api-client.js +1 -1
  91. package/dist/sdk/client/workflow-client.js +1 -1
  92. package/dist/sdk/connection-validator.js +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/engage.js +1 -1
  95. package/dist/sdk/errors.js +1 -1
  96. package/dist/sdk/index.js +1 -1
  97. package/dist/sdk/io/index.js +1 -1
  98. package/dist/sdk/io/node-filesystem.js +1 -1
  99. package/dist/sdk/job.js +1 -1
  100. package/dist/sdk/journey.js +1 -1
  101. package/dist/sdk/llm/chat-cache.js +1 -1
  102. package/dist/sdk/llm/index.js +1 -1
  103. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  104. package/dist/sdk/llm/model-aliases.js +1 -1
  105. package/dist/sdk/llm/model-factors.js +1 -1
  106. package/dist/sdk/query/index.js +1 -1
  107. package/dist/sdk/query/sql-parser.js +1 -1
  108. package/dist/sdk/schedule.js +1 -1
  109. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  110. package/dist/sdk/segment/fields-display.js +1 -1
  111. package/dist/sdk/segment/file-discovery.js +1 -1
  112. package/dist/sdk/segment/journey-utils.js +1 -1
  113. package/dist/sdk/segment/journey-yaml.js +1 -1
  114. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  115. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  116. package/dist/sdk/segment/pull-workflow.js +1 -1
  117. package/dist/sdk/segment/push-workflow.js +1 -1
  118. package/dist/sdk/segment/resolution-context.js +1 -1
  119. package/dist/sdk/segment/segment-path-parser.js +1 -1
  120. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  121. package/dist/sdk/segment/target-resolution.js +1 -1
  122. package/dist/sdk/segment/tdx-config.js +1 -1
  123. package/dist/sdk/segment/validate-files.js +1 -1
  124. package/dist/sdk/segment/yaml-validator.js +1 -1
  125. package/dist/sdk/segment.js +1 -1
  126. package/dist/sdk/types/index.js +1 -1
  127. package/dist/sdk/types/progress.js +1 -1
  128. package/dist/sdk/user.js +1 -1
  129. package/dist/sdk/util/format-detector.js +1 -1
  130. package/dist/sdk/util/formatters.js +1 -1
  131. package/dist/sdk/util/index.js +1 -1
  132. package/dist/sdk/util/tree-formatter.js +1 -1
  133. package/dist/sdk/workflow/archive-validation.js +1 -1
  134. package/dist/sdk/workflow/clone-workflow.js +1 -1
  135. package/dist/sdk/workflow/index.js +1 -1
  136. package/dist/sdk/workflow/pull-workflow.js +1 -1
  137. package/dist/sdk/workflow/push-workflow.js +1 -1
  138. package/dist/sdk/workflow/tdx-config.js +1 -1
  139. package/dist/sdk/workflow/workflow-utils.js +1 -1
  140. package/dist/test-utils/command-runner.js +1 -1
  141. package/dist/test-utils/factories.js +1 -1
  142. package/dist/test-utils/fixtures.js +1 -1
  143. package/dist/test-utils/http-mock.js +1 -1
  144. package/dist/test-utils/index.js +1 -1
  145. package/dist/utils/async.js +1 -1
  146. package/dist/utils/colors.js +1 -1
  147. package/dist/utils/diff.js +1 -1
  148. package/dist/utils/file-permissions.js +1 -1
  149. package/dist/utils/global-cache.js +1 -1
  150. package/dist/utils/json-loader.js +1 -1
  151. package/dist/utils/local-cache.js +1 -1
  152. package/dist/utils/logger/formatters/default-formatter.d.ts.map +1 -1
  153. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  154. package/dist/utils/logger/formatters/default-formatter.js.map +1 -1
  155. package/dist/utils/logger/formatters/index.js +1 -1
  156. package/dist/utils/logger/handlers/console-handler.js +1 -1
  157. package/dist/utils/logger/handlers/file-handler.js +1 -1
  158. package/dist/utils/logger/handlers/index.js +1 -1
  159. package/dist/utils/logger/handlers/null-handler.js +1 -1
  160. package/dist/utils/logger/index.js +1 -1
  161. package/dist/utils/logger/logger.js +1 -1
  162. package/dist/utils/logger/types.js +1 -1
  163. package/dist/utils/option-validation.js +1 -1
  164. package/dist/utils/port.js +1 -1
  165. package/dist/utils/process.js +1 -1
  166. package/dist/utils/prompt.js +1 -1
  167. package/dist/utils/spinner.js +1 -1
  168. package/dist/utils/sse-parser.js +1 -1
  169. package/dist/utils/string-utils.js +1 -1
  170. package/dist/utils/table-ref-parser.js +1 -1
  171. package/dist/utils/tdx-logger.js +1 -1
  172. package/dist/utils/version-check.js +1 -1
  173. package/package.json +3 -1
@@ -1 +1 @@
1
- (function(_0x3b8580,_0x3972bb){const _0x40f601=a117_0xaf1b,_0x193a62=_0x3b8580();while(!![]){try{const _0x2ff6da=parseInt(_0x40f601(0x164))/0x1*(-parseInt(_0x40f601(0xfe))/0x2)+parseInt(_0x40f601(0xf8))/0x3*(parseInt(_0x40f601(0x178))/0x4)+-parseInt(_0x40f601(0x130))/0x5*(parseInt(_0x40f601(0xe0))/0x6)+-parseInt(_0x40f601(0x15a))/0x7+parseInt(_0x40f601(0x120))/0x8+parseInt(_0x40f601(0x169))/0x9+parseInt(_0x40f601(0x161))/0xa*(-parseInt(_0x40f601(0x19f))/0xb);if(_0x2ff6da===_0x3972bb)break;else _0x193a62['push'](_0x193a62['shift']());}catch(_0x815e7b){_0x193a62['push'](_0x193a62['shift']());}}}(a117_0x4a16,0xa5c3f));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x99430e){return''+PENDING_SEGMENT_PREFIX+_0x99430e+'__';}export function isPendingSegmentId(_0xf78bdf){const _0x18e7a0=a117_0xaf1b;return _0xf78bdf[_0x18e7a0(0x144)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x4f6eb4){const _0x58843c=a117_0xaf1b;return _0x4f6eb4[_0x58843c(0x150)](/^__pending_(.+)__$/,'$1');}function a117_0x4a16(){const _0x38e6b7=['segmentFolderId','logInfo','diff','join','\x20segment\x20from\x20file:\x20','Updating\x20segment\x20\x27','1073002XQTfyS','folder','activations','get','goal\x20criteria','logWarning','skipSegments','10eEPlRB','NOT_FOUND','waitCondition','244015FkExHR','Deleted\x20segment\x20\x27','find','with','\x20error(s)','9199242SohKrI','segmentByFolderAndName','validatedRequest','Deleted\x20activation\x20\x27','columns','Updated\x20activation\x20\x27','segment_deleted','folder_created','draft','updateSegmentById','utf-8','deleted','resolveJourneyId','toLowerCase','segment_creating','5028ILomPH','Stage\x20\x27','values','item','createFolder','null','created','Updating\x20activation\x20\x27','set','SEGMENT_UPDATE_ERROR','exitCriterias','segment','deleteSegment','nameToId','updated','rootFolderId','split','hasChanges','journey','toString','getActivation','activationActions','INTERNAL','segmentId','folderPath','stage\x20\x27','stages','parse','all','\x0a\x20\x20','kind','Created\x20folder\x20\x27','map','\x27\x20wait\x20condition','onProgress','relationships','./journey-yaml.js','state','existingSegment','909733WQyyPH','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','entryCriteria','\x27\x20milestone','folderPathToId','parentId','Deleting\x20activation\x20\x27','JOURNEY_UPDATE_ERROR','Creating\x20segment\x20\x27','JOURNEY_SYNTAX_ERROR','\x27\x20exit\x20criteria','versionNumber','WaitStep','nameToType','hex','progress',').\x20','journeyActivationStepId','embedded_segment_created','has','stringify','buildUserMaps','embedded_activation_created','journey_updating','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','Creating\x20folder\x20\x27','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','object','create','Failed\x20to\x20','logSuccess','withProgress','sort','slice','journey_updated','activationsBySegmentId','journeyBundleName','Name\x20has\x20already\x20been\x20taken','activationParams','decision_point','\x27\x20from\x20file:\x20','25710eCUggZ','valid','filter','reduce','name','parentFolder','deps','Activation\x20not\x20found:\x20','Creating\x20activation\x20\x27','all_columns','Fetching\x20','list','type','deleteActivation','flatMap','update','length','createdSegmentIds','idToEmailMap','add','embeddedSegmentNameToId','isNew','segments','verbose','426BLzCzp','createSegment','errors','activation_created','entry_criteria','activationStepsById','2WDTiel','segment_deleting','goal','activation_','getSegment','\x27\x20entry\x20criteria','\x20activation\x20\x27','segmentNameToId','yamlConfig','connectionIdToNameMap','delete','results','activation_deleted','existingActivation','DecisionPoint','embedded_segment_creating','journeyActivationNameToId','Journey\x20\x27','\x27\x20not\x20found\x20in\x20journey\x20\x27','data','journeyBundlesByFolderAndName','schedule','milestone','createActivation','./child-segment-yaml.js','relative','keys','):\x20','folderId','journeyById','resolveSegment','activation_template_id','journey_creating','fetchJourney','3540416IsHfDZ','Updated\x20journey\x20\x27','getJourney','existingJourney','branches','from','logDeleted','push','Segment\x20not\x20found:\x20','absolutePath','journeyId','connector_config','activation_updated','action','journey_entry_criteria_','steps','565YKrvXB','rule','Created\x20journey\x20\x27','Entry\x20criteria:\x20','listActivations','sha1','message','attributes','max','SEGMENT_NOT_FOUND','\x27...','embedded_activation_creating','journeyStages','idToName','activation_creating','connection','existingSegments','description','parseDocument','Activation','startsWith','\x20journey\x20from\x20file:\x20','size','createdSegmentId','../../utils/async.js','\x27\x20decision\x20point\x20branch\x20\x27','trim','createJourneySegment','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','ACTIVATION_UPDATE_ERROR','journeys','entry','replace','localSegmentRules','folder_creating','Created\x20activation\x20\x27'];a117_0x4a16=function(){return _0x38e6b7;};return a117_0x4a16();}export function createPendingActivationId(_0x220760){return''+PENDING_ACTIVATION_PREFIX+_0x220760+'__';}export function isPendingActivationId(_0xa6424f){const _0xfec5e8=a117_0xaf1b;return _0xa6424f[_0xfec5e8(0x144)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x381e0d){const _0x5f2f54=a117_0xaf1b;return _0x381e0d[_0x5f2f54(0x150)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x258122,_0x1dcf38){const _0xa538b2=a117_0xaf1b,_0x36349d=_0x258122+'::'+(_0x1dcf38[_0xa538b2(0x14a)]()||_0xa538b2(0x183)),_0x5abd7b=createHash(_0xa538b2(0x135))[_0xa538b2(0xef)](_0x36349d)['digest'](_0xa538b2(0x1ad))[_0xa538b2(0xd8)](0x0,0xc);return _0xa538b2(0x12e)+_0x5abd7b;}export function ensureJourneyDefaults(_0x20b93f){const _0x159a34=a117_0xaf1b;!_0x20b93f[_0x159a34(0x141)]&&(_0x20b93f[_0x159a34(0x141)]=''),!_0x20b93f[_0x159a34(0x19d)]&&(_0x20b93f[_0x159a34(0x19d)]=_0x159a34(0x171));}export function resolveTDFolderPath(_0x3c907e,_0x5d861e,_0x436acd){if(!_0x5d861e)return _0x3c907e;if(_0x3c907e===_0x436acd||_0x3c907e['startsWith'](_0x436acd+'/'))return _0x3c907e;return _0x3c907e?_0x436acd+'/'+_0x3c907e:_0x436acd;}export function addFoldersToCreate(_0x6be204,_0x29f085,_0x5acbf5){const _0x27367f=a117_0xaf1b;if(!_0x6be204)return;if(_0x29f085[_0x27367f(0x1b2)](_0x6be204))return;const _0x5c3ffa=_0x6be204[_0x27367f(0x188)]('/');let _0x4c3c40='';for(const _0x13b4b1 of _0x5c3ffa){_0x4c3c40=_0x4c3c40?_0x4c3c40+'/'+_0x13b4b1:_0x13b4b1,!_0x29f085[_0x27367f(0x1b2)](_0x4c3c40)&&_0x5acbf5[_0x27367f(0xf3)](_0x4c3c40);}}import*as a117_0x50cedf from'yaml';import{readFileSync}from'fs';import a117_0x5af366 from'path';import{isJourneyDef,parseYamlString as a117_0x4b3dc4,toYamlString as a117_0x5b7182,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(_0x2a60f4){const _0x558e82=a117_0xaf1b;if(Array['isArray'](_0x2a60f4))return'['+_0x2a60f4[_0x558e82(0x198)](_0x540998=>stableStringify(_0x540998))[_0x558e82(0x157)](',')+']';if(_0x2a60f4&&typeof _0x2a60f4===_0x558e82(0x1bb)){const _0xfc9179=_0x2a60f4,_0x4da792=Object['keys'](_0xfc9179)['sort'](),_0x209bc9=_0x4da792[_0x558e82(0x198)](_0x2ec2ab=>'\x22'+_0x2ec2ab+'\x22:'+stableStringify(_0xfc9179[_0x2ec2ab]));return'{'+_0x209bc9[_0x558e82(0x157)](',')+'}';}const _0x3b838e=JSON[_0x558e82(0x1b3)](_0x2a60f4);return _0x3b838e===undefined?_0x558e82(0x17d):_0x3b838e;}function a117_0xaf1b(_0x5af6bd,_0x4568fe){_0x5af6bd=_0x5af6bd-0xd8;const _0x4a162c=a117_0x4a16();let _0xaf1be6=_0x4a162c[_0x5af6bd];return _0xaf1be6;}function activationSignature(_0x2ef3a2){const _0x30a710=a117_0xaf1b,_0x3ab3e2={'connection':_0x2ef3a2[_0x30a710(0x13f)],..._0x2ef3a2[_0x30a710(0xe9)]!==undefined&&{'all_columns':_0x2ef3a2[_0x30a710(0xe9)]},..._0x2ef3a2['columns']!==undefined&&{'columns':_0x2ef3a2[_0x30a710(0x16d)]},..._0x2ef3a2['behavior']!==undefined&&{'behavior':_0x2ef3a2['behavior']},..._0x2ef3a2[_0x30a710(0x113)]!==undefined&&{'schedule':_0x2ef3a2[_0x30a710(0x113)]},..._0x2ef3a2['notification']!==undefined&&{'notification':_0x2ef3a2['notification']},..._0x2ef3a2[_0x30a710(0x12b)]!==undefined&&{'connector_config':_0x2ef3a2[_0x30a710(0x12b)]},..._0x2ef3a2[_0x30a710(0x11d)]!==undefined&&{'activation_template_id':_0x2ef3a2['activation_template_id']}};return stableStringify(_0x3ab3e2);}export async function prepareSegmentFiles(_0x1becfe,_0x24c4b5,_0x510f4d,_0x30116a,_0x1f83e4){const _0x496270=a117_0xaf1b,{activationDefToCreateRequest:_0x42e09f}=await import('./child-segment-yaml.js'),_0x1d0260=[],_0x2a4a96=new Set();for(const {yamlConfig:_0x1cbddd,folderPath:_0x3c3f6a,sourcePath:_0xebd5e8}of _0x1becfe){const _0x3b9cda=resolveTDFolderPath(_0x3c3f6a,_0x30116a,_0x1f83e4),_0x36514e=_0x3b9cda+':'+_0x1cbddd[_0x496270(0xe4)],_0x5cbe1d=_0x24c4b5[_0x496270(0x16a)][_0x496270(0x15d)](_0x36514e),_0x1dc465=_0x5cbe1d?_0x24c4b5[_0x496270(0xda)][_0x496270(0x15d)](_0x5cbe1d['id'])||[]:[];addFoldersToCreate(_0x3b9cda,_0x24c4b5['folderPathToId'],_0x2a4a96);const _0x117d31=calculateActivationActions(_0x1cbddd[_0x496270(0x15c)]||[],_0x1dc465,_0x24c4b5[_0x496270(0xf2)],_0x24c4b5[_0x496270(0x107)]);for(const _0x3d6bf2 of _0x117d31){(_0x3d6bf2['type']==='create'||_0x3d6bf2[_0x496270(0xec)]===_0x496270(0xef))&&_0x3d6bf2['yamlActivation']&&(_0x3d6bf2[_0x496270(0x16b)]=await _0x42e09f(_0x3d6bf2['yamlActivation'],_0x510f4d));}const _0x41b8cd=calculateSegmentDiff(_0x1cbddd,_0x5cbe1d,_0x1dc465,_0x24c4b5[_0x496270(0xf2)],_0x24c4b5[_0x496270(0x107)]);_0x1d0260[_0x496270(0x127)]({'relativePath':_0x1cbddd[_0x496270(0xe4)],'absolutePath':_0xebd5e8,'yamlConfig':_0x1cbddd,'folderPath':_0x3b9cda,'existingSegment':_0x5cbe1d,'existingActivations':_0x1dc465,'isNew':_0x41b8cd['isNew'],'hasChanges':_0x41b8cd['hasChanges'],'diff':_0x41b8cd[_0x496270(0x156)],'activationActions':_0x117d31});}return{'segmentFiles':_0x1d0260,'foldersToCreate':_0x2a4a96};}export async function prepareJourneyFiles(_0x5238c9,_0x37d7fd,_0x398abb,_0x222830){const _0x216f46=a117_0xaf1b,_0x13708f=[],_0x38f5cc=new Set();for(const {yamlConfig:_0x597cf1,folderPath:_0x471e0a,sourcePath:_0x57aa57}of _0x5238c9){const _0x28fd2e=resolveTDFolderPath(_0x471e0a,_0x398abb,_0x222830),_0xa9ce76=_0x28fd2e+':'+_0x597cf1[_0x216f46(0xe4)],_0x4cd150=_0x37d7fd[_0x216f46(0x112)][_0x216f46(0x15d)](_0xa9ce76);let _0x13a1a4,_0x354944;if(_0x4cd150&&_0x4cd150[_0x216f46(0xf0)]>0x0){const _0x46ba9f=buildLocalExpandedRuleMappings(_0x597cf1),{createYamlContext:_0x4461a9,prefetchJourneySegments:_0x190773}=createPushYamlContextForBundle(_0x37d7fd[_0x216f46(0xe6)],_0x37d7fd['parentId'],_0x37d7fd[_0x216f46(0x140)],_0x46ba9f,_0x37d7fd[_0x216f46(0xf2)],_0x37d7fd['connectionIdToNameMap'],_0x37d7fd[_0x216f46(0xfd)],_0x37d7fd[_0x216f46(0x11b)]);await _0x190773(_0x4cd150[_0x216f46(0x198)](_0x32a903=>_0x32a903['id']));const _0x454530=hasMultipleVersions(_0x597cf1),_0x2c67d7=async _0x116021=>{const _0x309dd5=_0x216f46,_0x15c75d=_0x37d7fd[_0x309dd5(0x11b)]?.[_0x309dd5(0x15d)](_0x116021);if(_0x15c75d)return _0x15c75d;return _0x37d7fd[_0x309dd5(0x11f)]({'journeyId':_0x116021,'journeyName':_0x597cf1[_0x309dd5(0xe4)],'isMultiVersion':_0x4cd150[_0x309dd5(0xf0)]>0x1});};if(_0x454530&&_0x4cd150[_0x216f46(0xf0)]>0x1){const _0x1f8799=[];for(const _0x257346 of _0x4cd150){const _0x2bd15f=_0x257346[_0x216f46(0x1aa)]||0x1;_0x37d7fd['progress']?.['update'](_0x216f46(0xea)+_0x597cf1['name']+'\x20v'+_0x2bd15f);const _0x42f185=await _0x2c67d7(_0x257346['id']),_0x18e2e2=_0x4461a9(_0x257346['id']),_0x294ea2=await journeyResponseToDef(_0x42f185,_0x18e2e2);_0x1f8799[_0x216f46(0x127)]({'item':_0x257346,'yaml':_0x294ea2});}const _0x3baacf=buildLocalRuleToNameMappingFromJourney(_0x597cf1);_0x354944=buildMergedJourneyDef(_0x1f8799,_0x3baacf);const _0x50f71a=Math[_0x216f46(0x138)](..._0x1f8799['map'](_0x5bec0a=>_0x5bec0a[_0x216f46(0x17b)][_0x216f46(0x1aa)]||0x0)),_0x2b2b2c=_0x4cd150[_0x216f46(0x166)](_0x38b1bd=>(_0x38b1bd['versionNumber']||0x0)===_0x50f71a);_0x2b2b2c&&(_0x37d7fd[_0x216f46(0x1ae)]?.[_0x216f46(0xef)](_0x216f46(0xea)+_0x597cf1[_0x216f46(0xe4)]+'\x20v'+_0x50f71a),_0x13a1a4=await _0x2c67d7(_0x2b2b2c['id']));}else{const _0x56fec9=_0x4cd150[_0x4cd150[_0x216f46(0xf0)]-0x1];_0x37d7fd[_0x216f46(0x1ae)]?.['update']('Fetching\x20'+_0x597cf1[_0x216f46(0xe4)]),_0x13a1a4=await _0x2c67d7(_0x56fec9['id']);const _0x255a61=_0x4461a9(_0x56fec9['id']),_0x229b92=await journeyResponseToDef(_0x13a1a4,_0x255a61),_0x39b600=buildLocalRuleToNameMappingFromJourney(_0x597cf1);_0x354944=buildMergedJourneyDef([{'item':_0x56fec9,'yaml':_0x229b92}],_0x39b600);}}addFoldersToCreate(_0x28fd2e,_0x37d7fd[_0x216f46(0x1a3)],_0x38f5cc);const _0x16400c=calculateJourneyDiff(_0x597cf1,_0x354944);_0x13708f[_0x216f46(0x127)]({'relativePath':_0x597cf1[_0x216f46(0xe4)],'absolutePath':_0x57aa57,'yamlConfig':_0x597cf1,'folderPath':_0x28fd2e,'existingJourney':_0x13a1a4,'isNew':_0x16400c['isNew'],'hasChanges':_0x16400c[_0x216f46(0x189)],'diff':_0x16400c['diff']});}return{'journeyFiles':_0x13708f,'foldersToCreate':_0x38f5cc};}export function calculateActivationActions(_0x32ee7a,_0x72d1af,_0x3bfc1e,_0x1a1bce){const _0x279325=a117_0xaf1b,_0x4523d3=[],_0x3c65fa=new Map();for(const _0x1d8d92 of _0x72d1af){_0x3c65fa['set'](_0x1d8d92[_0x279325(0xe4)],_0x1d8d92);}const _0x4b8d07=new Map();for(const _0x371a61 of _0x32ee7a){_0x4b8d07[_0x279325(0x180)](_0x371a61[_0x279325(0xe4)],_0x371a61);}for(const _0x3e9960 of _0x32ee7a){const _0x41dc9d=_0x3c65fa['get'](_0x3e9960[_0x279325(0xe4)]);if(!_0x41dc9d)_0x4523d3['push']({'type':_0x279325(0x1bc),'name':_0x3e9960[_0x279325(0xe4)],'yamlActivation':_0x3e9960});else{const _0x565e64=activationResponseToDef(_0x41dc9d,_0x3bfc1e,_0x1a1bce),_0x5530bb=a117_0x50cedf[_0x279325(0x1b3)](_0x565e64),_0x33b5cc=a117_0x50cedf[_0x279325(0x1b3)](_0x3e9960);_0x5530bb!==_0x33b5cc&&_0x4523d3['push']({'type':_0x279325(0xef),'name':_0x3e9960['name'],'yamlActivation':_0x3e9960,'existingActivation':_0x41dc9d});}}for(const _0xe76943 of _0x72d1af){!_0x4b8d07[_0x279325(0x1b2)](_0xe76943[_0x279325(0xe4)])&&_0x4523d3[_0x279325(0x127)]({'type':_0x279325(0x108),'name':_0xe76943['name'],'existingActivation':_0xe76943});}return _0x4523d3;}export function calculateSegmentDiff(_0xd51a73,_0x3557d3,_0x2f52b1,_0xd03f53,_0x6e299b){const _0xfaff62=segmentToYamlString(_0xd51a73);if(_0x3557d3){const _0x3d6e40=segmentWithActivationsToYaml(_0x3557d3,_0x2f52b1,undefined,_0xd03f53,_0x6e299b),_0x7c1ef9=segmentToYamlString(_0x3d6e40),_0xdf33ff=generateDiff(_0x7c1ef9,_0xfaff62),_0x1db724=hasChanges(_0xdf33ff);return{'isNew':![],'hasChanges':_0x1db724,'diff':_0x1db724?formatDiffWithColors(_0xdf33ff):undefined};}const _0x4ebef5=generateDiff('',_0xfaff62);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4ebef5)};}export function calculateJourneyDiff(_0x1cd664,_0x462b6b){const _0x23ecf2=normalizeJourneyDef(_0x1cd664,_0x1cd664),_0x2f2455=a117_0x5b7182(_0x23ecf2);if(_0x462b6b){const _0x314d83=normalizeJourneyDef(_0x462b6b,_0x1cd664),_0x4cf994=a117_0x5b7182(_0x314d83),_0x389c6e=generateDiff(_0x4cf994,_0x2f2455),_0xff3ae4=hasChanges(_0x389c6e);return{'isNew':![],'hasChanges':_0xff3ae4,'diff':_0xff3ae4?formatDiffWithColors(_0x389c6e):undefined};}const _0xf00c79=generateDiff('',_0x2f2455);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xf00c79)};}export function findSegmentsToDelete(_0xb7710,_0x241a4e,_0x1b6da6,_0x46a975,_0x53789c){const _0x307f7e=a117_0xaf1b,_0x1e243f=new Set();for(const {yamlConfig:_0x357fff,folderPath:_0x2f60c6}of _0x241a4e){_0x1e243f['add'](_0x2f60c6+':'+_0x357fff[_0x307f7e(0xe4)]);}return _0xb7710[_0x307f7e(0xe2)](_0x4c5ae3=>{const _0x310688=_0x307f7e,_0x4cf061=_0x4c5ae3[_0x310688(0x154)]?_0x1b6da6[_0x310688(0x15d)](_0x4c5ae3['segmentFolderId'][_0x310688(0x18b)]())||'':'',_0x202244=_0x4cf061+':'+_0x4c5ae3[_0x310688(0xe4)];if(_0x1e243f[_0x310688(0x1b2)](_0x202244))return![];if(_0x53789c)return _0x4cf061===_0x46a975||_0x4cf061[_0x310688(0x144)](_0x46a975+'/');return!![];});}export function findJourneysToDelete(_0x4fea98,_0x19903c,_0x4f6ec4,_0x3f7319,_0x1028aa){const _0x38a711=a117_0xaf1b,_0x24fe7b=new Set();for(const {yamlConfig:_0x12fa46,folderPath:_0x38d079}of _0x19903c){_0x24fe7b['add'](_0x38d079+':'+_0x12fa46[_0x38a711(0xe4)]);}return _0x4fea98['filter'](_0x4c31b6=>{const _0x3a931f=_0x38a711,_0xac3383=_0x4c31b6[_0x3a931f(0x11a)]?_0x4f6ec4['get'](_0x4c31b6[_0x3a931f(0x11a)])||'':'',_0x248abd=_0xac3383+':'+_0x4c31b6[_0x3a931f(0xdb)];if(_0x24fe7b[_0x3a931f(0x1b2)](_0x248abd))return![];if(_0x1028aa)return _0xac3383===_0x3f7319||_0xac3383[_0x3a931f(0x144)](_0x3f7319+'/');return!![];});}export function buildSegmentLookupMap(_0x1585f8,_0x17ff11){const _0x63e27e=a117_0xaf1b,_0x2dbf30=new Map();for(const _0xbdf6c1 of _0x1585f8){const _0x1f2189=_0xbdf6c1['segmentFolderId']?_0x17ff11[_0x63e27e(0x15d)](_0xbdf6c1[_0x63e27e(0x154)][_0x63e27e(0x18b)]())||'':'',_0x1e4ca4=_0x1f2189+':'+_0xbdf6c1['name'];_0x2dbf30[_0x63e27e(0x180)](_0x1e4ca4,_0xbdf6c1);}return _0x2dbf30;}export function buildSegmentNameToIdMap(_0x33a2a3){const _0x4927e4=a117_0xaf1b,_0x513bd4=new Map();for(const _0x390e99 of _0x33a2a3){_0x513bd4[_0x4927e4(0x180)](_0x390e99[_0x4927e4(0xe4)],_0x390e99['id']);}return _0x513bd4;}export function buildJourneyBundleLookupMap(_0x363364,_0x4f0d88){const _0x5c0b85=a117_0xaf1b,_0x3fbfd1=new Map();for(const _0x5600db of _0x363364){const _0x19e6d2=_0x5600db[_0x5c0b85(0x11a)]?_0x4f0d88[_0x5c0b85(0x15d)](_0x5600db[_0x5c0b85(0x11a)])||'':'',_0x4bf21a=_0x19e6d2+':'+_0x5600db[_0x5c0b85(0xdb)];!_0x3fbfd1[_0x5c0b85(0x1b2)](_0x4bf21a)&&_0x3fbfd1[_0x5c0b85(0x180)](_0x4bf21a,[]),_0x3fbfd1[_0x5c0b85(0x15d)](_0x4bf21a)[_0x5c0b85(0x127)](_0x5600db);}for(const _0x4be6d5 of _0x3fbfd1[_0x5c0b85(0x17a)]()){_0x4be6d5[_0x5c0b85(0x1c0)]((_0x341113,_0x2f9c51)=>(_0x341113[_0x5c0b85(0x1aa)]||0x0)-(_0x2f9c51[_0x5c0b85(0x1aa)]||0x0));}return _0x3fbfd1;}export function collectFoldersToCreate(_0x468143,_0x52d93c){const _0x1cc388=a117_0xaf1b,_0x8c79b2=new Set();for(const _0x4ab231 of _0x468143){if(!_0x4ab231)continue;if(_0x52d93c[_0x1cc388(0x1b2)](_0x4ab231))continue;const _0x4b2b18=_0x4ab231['split']('/');let _0x3550c1='';for(const _0x41328b of _0x4b2b18){_0x3550c1=_0x3550c1?_0x3550c1+'/'+_0x41328b:_0x41328b,!_0x52d93c['has'](_0x3550c1)&&_0x8c79b2[_0x1cc388(0xf3)](_0x3550c1);}}return _0x8c79b2;}export function parseAndClassifyYamlFiles(_0x24de57,_0x56a836,_0x1ce766){const _0x38a2b5=a117_0xaf1b,_0x3fa9a5=[],_0x213357=[];for(const _0x206fe1 of _0x24de57){const _0x3c3d53=a117_0x5af366['relative'](_0x56a836,a117_0x5af366['dirname'](_0x206fe1)),_0x2920d5=_0x3c3d53==='.'?'':_0x3c3d53,_0x1e6988=readFileSync(_0x206fe1,_0x38a2b5(0x173)),_0x48a5ec=a117_0x50cedf[_0x38a2b5(0x193)](_0x1e6988);if(isJourneyDef(_0x48a5ec)){const _0xb15e12=a117_0x4b3dc4(_0x1e6988);_0x213357[_0x38a2b5(0x127)]({'yamlConfig':_0xb15e12,'folderPath':_0x2920d5,'sourcePath':_0x206fe1});}else{if(!_0x1ce766?.[_0x38a2b5(0x160)]){const _0x2af2ff=parseSegmentYamlFile(_0x1e6988),_0x294a50=normalizeChildSegmentYaml(_0x2af2ff);_0x3fa9a5['push']({'yamlConfig':_0x294a50,'folderPath':_0x2920d5,'sourcePath':_0x206fe1});}}}return{'segments':_0x3fa9a5,'journeys':_0x213357};}export function validateParsedFiles(_0x27af04,_0x1e81b0){const _0xa06bcf=a117_0xaf1b,_0x398777=[];for(const {yamlConfig:_0x57e3bb,sourcePath:_0xb5152a}of _0x27af04[_0xa06bcf(0xf6)]){const _0x3f9ce2=readFileSync(_0xb5152a,_0xa06bcf(0x173)),_0x561385=a117_0x50cedf[_0xa06bcf(0x142)](_0x3f9ce2),_0x40cab6=validateSegmentDef(_0x57e3bb,{'source':_0x3f9ce2,'document':_0x561385});if(!_0x40cab6[_0xa06bcf(0xe1)]){const _0xea088c=a117_0x5af366['relative'](_0x1e81b0,_0xb5152a);_0x398777[_0xa06bcf(0x127)]({'filePath':_0xea088c,'source':_0x3f9ce2,'result':_0x40cab6,'isJourney':![]});}}for(const {yamlConfig:_0x588067,sourcePath:_0x1bf45a}of _0x27af04[_0xa06bcf(0x14e)]){const _0x2905e2=readFileSync(_0x1bf45a,'utf-8'),_0x867a06=a117_0x50cedf[_0xa06bcf(0x142)](_0x2905e2),_0x70ca06=validateJourneyDef(_0x588067,{'source':_0x2905e2,'document':_0x867a06});if(!_0x70ca06[_0xa06bcf(0xe1)]){const _0x1f95c5=a117_0x5af366[_0xa06bcf(0x117)](_0x1e81b0,_0x1bf45a);_0x398777[_0xa06bcf(0x127)]({'filePath':_0x1f95c5,'source':_0x2905e2,'result':_0x70ca06,'isJourney':!![]});}}return _0x398777;}export function formatValidationErrors(_0x139591){const _0x578d8d=a117_0xaf1b,_0x5b851f=[];for(const {filePath:_0x28c310,source:_0x1af7a3,result:_0x24def9,isJourney:_0xfb44bc}of _0x139591){const _0x159192=_0xfb44bc?'journey':_0x578d8d(0x183);_0x5b851f[_0x578d8d(0x127)]('\x0a'+_0x28c310+'\x20('+_0x159192+_0x578d8d(0x119)+_0x24def9[_0x578d8d(0xfa)][_0x578d8d(0xf0)]+_0x578d8d(0x168)),_0x5b851f[_0x578d8d(0x127)](formatValidationResult(_0x24def9,_0x1af7a3,_0x28c310));}return _0x5b851f[_0x578d8d(0x157)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x20bee5){const _0x2f293e=a117_0xaf1b,_0x34435d=new Set(),_0x4c2261=new Map(),_0x3a2182=collectSegmentUsageCounts(_0x20bee5);if(_0x20bee5['segments'])for(const [_0x4cac46,_0x274856]of Object['entries'](_0x20bee5[_0x2f293e(0xf6)])){_0x34435d[_0x2f293e(0xf3)](_0x4cac46);if(_0x274856['rule']){const _0xad7b78=yamlRuleToApi(_0x274856['rule']),_0x3f1733=apiRuleToYaml(_0xad7b78);_0x4c2261['set'](_0x4cac46,_0x3f1733);}}const _0x562190=new Map();let _0x328945=0x0;for(const [_0x4d6b9b,_0x1260d9]of _0x4c2261){const _0x466e7e=serializeExpandedRule(_0x1260d9,_0x4c2261),_0xade4b4=_0x562190['get'](_0x466e7e)||[];_0xade4b4[_0x2f293e(0x127)]({'name':_0x4d6b9b,'index':_0x328945}),_0x562190['set'](_0x466e7e,_0xade4b4),_0x328945++;}const _0x3fb281=new Map();for(const [_0x27589c,_0x3437a2]of _0x562190){const _0x281fd5=_0x3437a2[_0x2f293e(0xd8)]()['sort']((_0x4c2698,_0x4feacf)=>{const _0x29d323=_0x2f293e,_0x91880e=_0x3a2182[_0x29d323(0x15d)](_0x4c2698[_0x29d323(0xe4)])||0x0,_0x231bad=_0x3a2182[_0x29d323(0x15d)](_0x4feacf[_0x29d323(0xe4)])||0x0;if(_0x91880e!==_0x231bad)return _0x231bad-_0x91880e;return _0x4c2698['index']-_0x4feacf['index'];})[_0x2f293e(0x198)](_0x2d4a39=>_0x2d4a39[_0x2f293e(0xe4)]),_0x4113bc=[];for(const _0x279c72 of _0x281fd5){const _0x5bcc4c=_0x3a2182['get'](_0x279c72)||0x0,_0x470caa=Math[_0x2f293e(0x138)](_0x5bcc4c,0x1);for(let _0x206cb5=0x0;_0x206cb5<_0x470caa;_0x206cb5++){_0x4113bc['push'](_0x279c72);}}_0x3fb281[_0x2f293e(0x180)](_0x27589c,_0x4113bc);}return{'existingLocalSegmentNames':_0x34435d,'localSegmentRules':_0x4c2261,'localExpandedRuleToNames':_0x3fb281};}async function buildServerSegmentRuleMap(_0x31bb88,_0x39a820,_0x2c34fb,_0x55dd17){const _0x5b695f=new Map(),_0x58cca7=new Set(),_0x3101f8=async _0xff443d=>{const _0x2401b4=a117_0xaf1b;if(_0x58cca7[_0x2401b4(0x1b2)](_0xff443d))return;_0x58cca7[_0x2401b4(0xf3)](_0xff443d);let _0x588e85=_0x2c34fb[_0x2401b4(0x166)](_0x4401b2=>_0x4401b2['id']===_0xff443d);if(!_0x588e85)try{_0x588e85=await _0x31bb88[_0x2401b4(0x183)][_0x2401b4(0x102)](_0x39a820,_0xff443d);}catch{return;}if(!_0x588e85?.[_0x2401b4(0x131)])return;const _0x39dd66=apiRuleToYaml(_0x588e85[_0x2401b4(0x131)]);_0x5b695f[_0x2401b4(0x180)](_0xff443d,_0x39dd66);const _0x382275=collectSegmentRefsFromRule(_0x39dd66);for(const _0x38e06b of _0x382275){await _0x3101f8(_0x38e06b);}};for(const _0x4f9506 of _0x55dd17){await _0x3101f8(_0x4f9506);}return _0x5b695f;}export function createSegmentIdResolver(_0x3d8c2c,_0x1d9d99){return async _0x19ee2d=>{const _0x4e8748=a117_0xaf1b,_0x30e90f=_0x3d8c2c[_0x4e8748(0x15d)](_0x19ee2d);if(!_0x30e90f)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x19ee2d+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x1d9d99+'\x27)');return _0x30e90f;};}export function extractRootFolderId(_0x40ec61){const _0x24c5c5=a117_0xaf1b;return _0x40ec61[_0x24c5c5(0x19b)]?.['parentSegmentFolder']?.[_0x24c5c5(0x111)]?.['id']||_0x40ec61[_0x24c5c5(0x19b)]?.[_0x24c5c5(0xe5)]?.['data']?.['id'];}export function buildConnectionMaps(_0x5b063e){const _0x4e5e5a=a117_0xaf1b,_0x51fda0=new Map(),_0x43eea6=new Map(),_0x182d7c=new Map();for(const _0x505827 of _0x5b063e){_0x51fda0['set'](_0x505827[_0x4e5e5a(0xe4)],parseInt(_0x505827['id'],0xa)),_0x43eea6[_0x4e5e5a(0x180)](_0x505827['id'],_0x505827['name']),_0x182d7c[_0x4e5e5a(0x180)](_0x505827[_0x4e5e5a(0xe4)],_0x505827[_0x4e5e5a(0xec)]);}return{'nameToId':_0x51fda0,'idToName':_0x43eea6,'nameToType':_0x182d7c};}export function calculatePushStats(_0x3e5ef4,_0x2063cd,_0x49b053,_0x101bbd,_0x1c12c3,_0x8acc1c,_0x5d46a4){const _0x2560d9=a117_0xaf1b,_0x2664e3=_0x3e5ef4['filter'](_0x37bedb=>_0x37bedb['isNew']),_0x313175=_0x3e5ef4[_0x2560d9(0xe2)](_0x450313=>!_0x450313[_0x2560d9(0xf5)]&&_0x450313[_0x2560d9(0x189)]),_0x30fd07=_0x3e5ef4[_0x2560d9(0xe2)](_0x36b41f=>!_0x36b41f['isNew']&&!_0x36b41f[_0x2560d9(0x189)]),_0x7867f4=_0x8acc1c?_0x101bbd:[],_0x30cf0b=_0x2063cd[_0x2560d9(0xe2)](_0x42af84=>_0x42af84[_0x2560d9(0xf5)]),_0x31466e=_0x2063cd[_0x2560d9(0xe2)](_0x48374f=>!_0x48374f[_0x2560d9(0xf5)]&&_0x48374f[_0x2560d9(0x189)]),_0x8259e0=_0x2063cd[_0x2560d9(0xe2)](_0x299c86=>!_0x299c86['isNew']&&!_0x299c86[_0x2560d9(0x189)]),_0x595deb=_0x8acc1c?_0x1c12c3:[],_0x4079d=_0x3e5ef4[_0x2560d9(0xee)](_0x53f4d5=>_0x53f4d5[_0x2560d9(0x18d)]),_0x46d5ab=_0x4079d['filter'](_0x237d8c=>_0x237d8c[_0x2560d9(0xec)]==='create'),_0x37a8f4=_0x4079d['filter'](_0x414634=>_0x414634['type']===_0x2560d9(0xef)),_0x1e9f06=_0x4079d['filter'](_0x4aa317=>_0x4aa317[_0x2560d9(0xec)]===_0x2560d9(0x108)),_0x36a8b8=Array[_0x2560d9(0x125)](_0x49b053)[_0x2560d9(0x1c0)](),_0x429d8c=_0x5d46a4?![]:_0x2664e3[_0x2560d9(0xf0)]>0x0||_0x313175[_0x2560d9(0xf0)]>0x0||_0x7867f4[_0x2560d9(0xf0)]>0x0,_0x182ba0=_0x30cf0b[_0x2560d9(0xf0)]>0x0||_0x31466e['length']>0x0||_0x595deb['length']>0x0,_0x50b1bb=_0x5d46a4?![]:_0x4079d[_0x2560d9(0xf0)]>0x0,_0x2dda95=_0x36a8b8[_0x2560d9(0xf0)]>0x0;return{'segments':{'new':_0x2664e3,'changed':_0x313175,'unchanged':_0x30fd07,'toDelete':_0x7867f4},'journeys':{'new':_0x30cf0b,'changed':_0x31466e,'unchanged':_0x8259e0,'toDelete':_0x595deb},'activations':{'all':_0x4079d,'toCreate':_0x46d5ab,'toUpdate':_0x37a8f4,'toDelete':_0x1e9f06},'folders':{'toCreate':_0x36a8b8},'counts':{'segments':{'new':_0x2664e3['length'],'changed':_0x313175[_0x2560d9(0xf0)],'unchanged':_0x30fd07['length'],'toDelete':_0x7867f4[_0x2560d9(0xf0)]},'journeys':{'new':_0x30cf0b[_0x2560d9(0xf0)],'changed':_0x31466e[_0x2560d9(0xf0)],'unchanged':_0x8259e0[_0x2560d9(0xf0)],'toDelete':_0x595deb['length']},'activations':{'create':_0x46d5ab[_0x2560d9(0xf0)],'update':_0x37a8f4[_0x2560d9(0xf0)],'delete':_0x1e9f06[_0x2560d9(0xf0)]},'folders':_0x36a8b8['length']},'hasChanges':_0x429d8c||_0x182ba0||_0x50b1bb||_0x2dda95};}export async function buildPushExecutionContext(_0x5db22e,_0x2add5d,_0x477b07,_0x24b7ca,_0x5c1de5,_0x9ec89b){const _0x1eccce=a117_0xaf1b,_0x4d8c51=extractRootFolderId(_0x477b07),{pathToId:_0x532675,idToPath:_0x139048}=buildFolderMaps(_0x5c1de5),_0x1611fc=buildSegmentNameToIdMap(_0x24b7ca),_0x24d7e2=new Map(),{batchAsync:_0x8ddba6}=await import(_0x1eccce(0x148)),[_0x558991,_0x1d2ab2]=await Promise[_0x1eccce(0x194)]([_0x5db22e['user'][_0x1eccce(0x1b4)](),_0x5db22e[_0x1eccce(0x13f)][_0x1eccce(0xeb)](),((async()=>{!_0x9ec89b&&_0x24b7ca['length']>0x0&&await _0x8ddba6(_0x24b7ca,async _0x14df61=>{const _0x4ed2d2=a117_0xaf1b,_0x254a7c=await _0x5db22e['segment'][_0x4ed2d2(0x134)](_0x2add5d,_0x14df61['id']);_0x24d7e2['set'](_0x14df61['id'],_0x254a7c);});})())]),{emailToId:_0x28e734,idToEmail:_0x28176e}=_0x558991,_0x20cb27=buildConnectionMaps(_0x1d2ab2);return{'rootFolderId':_0x4d8c51,'folderPathToId':_0x532675,'folderIdToPath':_0x139048,'segmentNameToId':_0x1611fc,'activationsBySegmentId':_0x24d7e2,'emailToIdMap':_0x28e734,'idToEmailMap':_0x28176e,'connectionNameToIdMap':_0x20cb27[_0x1eccce(0x185)],'connectionIdToNameMap':_0x20cb27[_0x1eccce(0x13d)],'connectionNameToTypeMap':_0x20cb27[_0x1eccce(0x1ac)]};}export function createPushYamlContextForBundle(_0x2b7f41,_0x545801,_0xe14a18,_0x4feab8,_0x5b0467,_0x7140cc,_0x225cbe,_0x22ce3d){const {existingLocalSegmentNames:_0x1e508f,localExpandedRuleToNames:_0x141b97}=_0x4feab8,_0x147377=new Set(),_0x324f33=new Map(),_0x13dbe8=new Map(),_0x21de4f=new Map(),_0x2573ef=createJumpTargetCache(),_0x2d425e=new Map(),_0x595039=new Map(),_0x251bc1=new Set();let _0x173e8b;const _0x534dfe=_0x40b24c=>{const _0x5f0762={'resolveSegment':async _0x16c5c5=>{const _0x546ac3=a117_0xaf1b,_0x168a68=_0x21de4f['get'](_0x16c5c5);if(_0x168a68!==undefined)return{'name':_0x168a68,'isJourneyLocal':!![]};try{let _0x26b057=_0xe14a18['find'](_0x4cb728=>_0x4cb728['id']===_0x16c5c5);!_0x26b057&&(_0x26b057=await _0x2b7f41['segment'][_0x546ac3(0x102)](_0x545801,_0x16c5c5));const _0x2efbef=generateJourneyLocalName(_0x26b057[_0x546ac3(0xe4)]),_0x2c234e=_0x26b057[_0x546ac3(0x196)]===SEGMENT_KIND_JOURNEY&&_0x2efbef!==undefined;let _0x5abd99=_0x26b057[_0x546ac3(0xe4)],_0x370019;if(_0x2c234e&&_0x26b057[_0x546ac3(0x131)]){const _0x45c379=apiRuleToYaml(_0x26b057[_0x546ac3(0x131)]);_0x595039['set'](_0x16c5c5,_0x45c379);const _0x169e96=async _0x3f184c=>{const _0x2c60fc=_0x546ac3,_0x5178dc=collectSegmentRefsFromRule(_0x3f184c);for(const _0x1d5144 of _0x5178dc){if(!_0x595039[_0x2c60fc(0x1b2)](_0x1d5144))try{const _0x5d34dd=await _0x2b7f41['segment'][_0x2c60fc(0x102)](_0x545801,_0x1d5144);if(_0x5d34dd?.['rule']){const _0x5d0359=apiRuleToYaml(_0x5d34dd[_0x2c60fc(0x131)]);_0x595039[_0x2c60fc(0x180)](_0x1d5144,_0x5d0359),await _0x169e96(_0x5d0359);}}catch{}}};await _0x169e96(_0x45c379);const _0xcdbcc4=serializeExpandedRule(_0x45c379,_0x595039),_0x5d408b=_0x141b97[_0x546ac3(0x15d)](_0xcdbcc4);if(_0x5d408b&&_0x5d408b[_0x546ac3(0xf0)]>0x0){const _0x3ae7de=_0x324f33[_0x546ac3(0x15d)](_0xcdbcc4)||0x0,_0x46d13f=_0x5d408b[_0x3ae7de]||_0x5d408b[_0x5d408b[_0x546ac3(0xf0)]-0x1];_0x324f33[_0x546ac3(0x180)](_0xcdbcc4,_0x3ae7de+0x1),_0x5abd99=_0x46d13f,_0x147377['add'](_0x5abd99),_0x21de4f['set'](_0x16c5c5,_0x5abd99);const _0x30cc74=await resolveRuleSegmentRefs(_0x45c379,async _0x596543=>{const _0x1a8b71=_0x546ac3,_0x4da19c=_0x21de4f['get'](_0x596543);if(_0x4da19c)return _0x4da19c;const _0x42f98d=await _0x173e8b['resolveSegment'](_0x596543);return _0x42f98d[_0x1a8b71(0xe4)];});_0x370019={'description':_0x26b057[_0x546ac3(0x141)],'rule':_0x30cc74};}else{const _0x927ae8=_0x2d425e[_0x546ac3(0x15d)](_0xcdbcc4);if(_0x927ae8)_0x5abd99=_0x927ae8,_0x21de4f[_0x546ac3(0x180)](_0x16c5c5,_0x5abd99);else{if(_0x2efbef){let _0x286d3d=_0x2efbef,_0xee1a95=0x2;while(_0x147377[_0x546ac3(0x1b2)](_0x286d3d)||_0x1e508f[_0x546ac3(0x1b2)](_0x286d3d)){_0x286d3d=_0x2efbef+'_'+_0xee1a95,_0xee1a95++;}_0x147377[_0x546ac3(0xf3)](_0x286d3d),_0x5abd99=_0x286d3d;}_0x21de4f[_0x546ac3(0x180)](_0x16c5c5,_0x5abd99),_0x2d425e[_0x546ac3(0x180)](_0xcdbcc4,_0x5abd99);const _0x5dcd5f=await resolveRuleSegmentRefs(_0x45c379,async _0xa75ffc=>{const _0x221341=_0x546ac3,_0x530d8f=_0x21de4f['get'](_0xa75ffc);if(_0x530d8f)return _0x530d8f;const _0x4f4d44=await _0x173e8b[_0x221341(0x11c)](_0xa75ffc);return _0x4f4d44[_0x221341(0xe4)];});_0x370019={'description':_0x26b057[_0x546ac3(0x141)],'rule':_0x5dcd5f};}}}return{'name':_0x5abd99,'isJourneyLocal':_0x2c234e,'definition':_0x370019};}catch{return{'name':_0x16c5c5,'isJourneyLocal':![]};}},'resolveActivation':async _0xc32330=>{const _0x19fa2c=a117_0xaf1b,_0x63d713=_0x13dbe8[_0x19fa2c(0x15d)](_0xc32330);if(_0x63d713!==undefined)return{'name':_0x63d713,'isJourneyLocal':!![]};try{let _0x4dd09b=_0x225cbe?.['get'](_0xc32330);!_0x4dd09b&&(_0x4dd09b=await _0x2b7f41[_0x19fa2c(0x18a)][_0x19fa2c(0x18c)](_0x40b24c,_0xc32330));const _0x98301d=_0x4dd09b[_0x19fa2c(0x137)][_0x19fa2c(0xdd)][_0x19fa2c(0xe4)]||_0xc32330,_0x5407a1=sanitizeYamlKey(_0x98301d)||_0x19fa2c(0x101)+_0xc32330,_0xcdb69b=_0x5407a1;_0x13dbe8['set'](_0xc32330,_0xcdb69b);const _0x46c544=journeyActivationStepToYaml(_0x4dd09b,_0x5b0467,_0x7140cc);return{'name':_0xcdb69b,'isJourneyLocal':!![],'definition':_0x46c544};}catch{return{'name':_0xc32330,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xc1f3,_0x207d88)=>resolveJumpTarget(_0xc1f3,_0x207d88,_0x2573ef,async _0x2833e6=>{const _0x586dfe=a117_0xaf1b,_0x5404f1=_0x22ce3d?.[_0x586dfe(0x15d)](_0x2833e6);if(_0x5404f1)return _0x5404f1;return _0x2b7f41[_0x586dfe(0x18a)][_0x586dfe(0x122)](_0x2833e6);})};return _0x173e8b=_0x5f0762,_0x5f0762;},_0x15b2d3=async _0x46fa33=>{const _0x4f9866=a117_0xaf1b,{collectSegmentIdsFromJourneyApi:_0x492aa7}=await import(_0x4f9866(0x19c)),{batchAsync:_0x492bf2}=await import(_0x4f9866(0x148)),_0x320329=new Set();for(const _0x198fa9 of _0x46fa33){let _0x2d2ecf=_0x22ce3d?.['get'](_0x198fa9);!_0x2d2ecf&&(_0x2d2ecf=await _0x2b7f41[_0x4f9866(0x18a)][_0x4f9866(0x122)](_0x198fa9));const _0x297381=_0x492aa7(_0x2d2ecf);for(const _0xdb325 of _0x297381){_0x320329[_0x4f9866(0xf3)](_0xdb325);}}let _0x37fc93=Array['from'](_0x320329);while(_0x37fc93['length']>0x0){const _0x37a140=_0x37fc93['filter'](_0x148941=>!_0x251bc1[_0x4f9866(0x1b2)](_0x148941));if(_0x37a140[_0x4f9866(0xf0)]===0x0)break;const _0x1c1f9c=await _0x492bf2(_0x37a140,async _0xf08a9d=>{const _0x4fe58b=_0x4f9866;_0x251bc1[_0x4fe58b(0xf3)](_0xf08a9d);let _0x134498=_0xe14a18['find'](_0x356222=>_0x356222['id']===_0xf08a9d);if(!_0x134498)try{_0x134498=await _0x2b7f41[_0x4fe58b(0x183)]['getSegment'](_0x545801,_0xf08a9d);}catch{return null;}return{'segmentId':_0xf08a9d,'segment':_0x134498};},0xa),_0x30b27c=new Set();for(const _0x68574 of _0x1c1f9c){if(!_0x68574?.[_0x4f9866(0x183)]?.[_0x4f9866(0x131)])continue;const _0x26d5a8=apiRuleToYaml(_0x68574[_0x4f9866(0x183)][_0x4f9866(0x131)]);_0x595039[_0x4f9866(0x180)](_0x68574[_0x4f9866(0x18f)],_0x26d5a8);const _0x4060c6=collectSegmentRefsFromRule(_0x26d5a8);for(const _0x3cb3e7 of _0x4060c6){!_0x251bc1[_0x4f9866(0x1b2)](_0x3cb3e7)&&_0x30b27c[_0x4f9866(0xf3)](_0x3cb3e7);}}_0x37fc93=Array[_0x4f9866(0x125)](_0x30b27c);}};return{'createYamlContext':_0x534dfe,'prefetchJourneySegments':_0x15b2d3};}export async function executePushSegments(_0x203e9a,_0x346eb8,_0x53cb36,_0x29a341,_0x15cb96){const _0x5714c6=a117_0xaf1b,{segmentDefToCreateRequest:_0x5aa083,segmentDefToUpdateRequest:_0x234bcc}=await import(_0x5714c6(0x116)),_0x1eb225=_0x53cb36[_0x5714c6(0x1a3)],_0x3bb47a=0x5,_0x2d8b28=async _0x5e32d4=>{const _0x4ea4f8=_0x5714c6,_0x5f207e=_0x5e32d4[_0x4ea4f8(0x190)]?_0x1eb225[_0x4ea4f8(0x15d)](_0x5e32d4[_0x4ea4f8(0x190)]):undefined;let _0x519592;const _0x18b38c={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5e32d4['isNew']){_0x15cb96[_0x4ea4f8(0x19a)]?.({'type':_0x4ea4f8(0x177),'name':_0x5e32d4[_0x4ea4f8(0x106)][_0x4ea4f8(0xe4)]});const _0xeffa4f=_0x5aa083(_0x5e32d4[_0x4ea4f8(0x106)],_0x5f207e),_0x4aaa72=await _0x15cb96[_0x4ea4f8(0x1bf)](_0x4ea4f8(0x1a7)+_0x5e32d4['yamlConfig'][_0x4ea4f8(0xe4)]+'\x27...',()=>_0x203e9a[_0x4ea4f8(0x183)][_0x4ea4f8(0xf9)](_0x29a341['parentId'],_0xeffa4f));_0x519592=_0x4aaa72['data']['id'],_0x18b38c['createdSegmentId']={'name':_0x5e32d4[_0x4ea4f8(0x106)][_0x4ea4f8(0xe4)],'id':_0x519592},_0x15cb96[_0x4ea4f8(0x19a)]?.({'type':'segment_created','name':_0x5e32d4[_0x4ea4f8(0x106)][_0x4ea4f8(0xe4)],'segmentId':_0x519592}),_0x15cb96[_0x4ea4f8(0x1be)]?.('Created\x20segment\x20\x27'+_0x5e32d4[_0x4ea4f8(0x106)][_0x4ea4f8(0xe4)]+'\x27'),_0x18b38c[_0x4ea4f8(0x17e)]=0x1;}else{if(_0x5e32d4[_0x4ea4f8(0x189)]){_0x15cb96[_0x4ea4f8(0x19a)]?.({'type':'segment_updating','name':_0x5e32d4[_0x4ea4f8(0x106)][_0x4ea4f8(0xe4)]});const _0x2c88aa=_0x234bcc(_0x5e32d4[_0x4ea4f8(0x106)]);_0x5f207e!==_0x5e32d4['existingSegment']?.[_0x4ea4f8(0x154)]&&(_0x2c88aa[_0x4ea4f8(0x154)]=_0x5f207e?parseInt(_0x5f207e,0xa):undefined),await _0x15cb96[_0x4ea4f8(0x1bf)](_0x4ea4f8(0x159)+_0x5e32d4[_0x4ea4f8(0x106)][_0x4ea4f8(0xe4)]+_0x4ea4f8(0x13a),()=>_0x203e9a[_0x4ea4f8(0x183)][_0x4ea4f8(0x172)](_0x29a341[_0x4ea4f8(0x1a4)],_0x5e32d4[_0x4ea4f8(0x19e)]['id'],_0x2c88aa)),_0x519592=_0x5e32d4[_0x4ea4f8(0x19e)]['id'],_0x15cb96['onProgress']?.({'type':'segment_updated','name':_0x5e32d4[_0x4ea4f8(0x106)][_0x4ea4f8(0xe4)]}),_0x15cb96[_0x4ea4f8(0x1be)]?.('Updated\x20segment\x20\x27'+_0x5e32d4[_0x4ea4f8(0x106)][_0x4ea4f8(0xe4)]+'\x27'),_0x18b38c[_0x4ea4f8(0x186)]=0x1;}else _0x519592=_0x5e32d4[_0x4ea4f8(0x19e)]['id'];}}catch(_0x1a7604){const _0x59d1a7=isHttp400Error(_0x1a7604),_0x44ecbf=_0x59d1a7?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x4ea4f8(0x181)],_0x6e69e2=getErrorMessage(_0x1a7604);throw new SDKError(_0x44ecbf,_0x4ea4f8(0x1bd)+(_0x5e32d4[_0x4ea4f8(0xf5)]?_0x4ea4f8(0x1bc):'update')+_0x4ea4f8(0x158)+_0x5e32d4['absolutePath']+'\x0a\x20\x20'+_0x6e69e2,_0x1a7604);}try{const _0x287555=await syncActivationsForSegment(_0x203e9a,_0x29a341[_0x4ea4f8(0x1a4)],_0x519592,_0x5e32d4[_0x4ea4f8(0x106)][_0x4ea4f8(0xe4)],_0x5e32d4[_0x4ea4f8(0x18d)],_0x15cb96,_0x5e32d4['absolutePath']);_0x18b38c[_0x4ea4f8(0x15c)]=_0x287555;}catch(_0x30f9ed){if(_0x30f9ed instanceof SDKError)throw _0x30f9ed;throw new SDKError(ErrorCode[_0x4ea4f8(0x14d)],_0x4ea4f8(0x14c)+_0x5e32d4[_0x4ea4f8(0x106)][_0x4ea4f8(0xe4)]+'\x27\x20from\x20file:\x20'+_0x5e32d4[_0x4ea4f8(0x129)]+_0x4ea4f8(0x195)+getErrorMessage(_0x30f9ed),_0x30f9ed);}return _0x18b38c;},_0x1868c2=await batchAsync(_0x346eb8,_0x2d8b28,_0x3bb47a),_0x495567={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4fd1f2 of _0x1868c2){_0x495567[_0x5714c6(0x17e)]+=_0x4fd1f2[_0x5714c6(0x17e)],_0x495567[_0x5714c6(0x186)]+=_0x4fd1f2[_0x5714c6(0x186)],_0x4fd1f2[_0x5714c6(0x147)]&&_0x495567[_0x5714c6(0xf1)][_0x5714c6(0x180)](_0x4fd1f2[_0x5714c6(0x147)][_0x5714c6(0xe4)],_0x4fd1f2[_0x5714c6(0x147)]['id']),_0x495567[_0x5714c6(0x15c)][_0x5714c6(0x17e)]+=_0x4fd1f2[_0x5714c6(0x15c)][_0x5714c6(0x17e)],_0x495567['activations'][_0x5714c6(0x186)]+=_0x4fd1f2[_0x5714c6(0x15c)][_0x5714c6(0x186)],_0x495567[_0x5714c6(0x15c)][_0x5714c6(0x174)]+=_0x4fd1f2[_0x5714c6(0x15c)][_0x5714c6(0x174)];}return _0x495567;}async function syncActivationsForSegment(_0x5c0f16,_0xe6feb6,_0x18a532,_0x4b75bc,_0x3a6e87,_0x43b4f5,_0x1d38e8){const _0x256cb4=a117_0xaf1b,_0x37b90c={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4177f8 of _0x3a6e87){try{if(_0x4177f8[_0x256cb4(0xec)]===_0x256cb4(0x1bc)&&_0x4177f8[_0x256cb4(0x16b)])_0x43b4f5[_0x256cb4(0x19a)]?.({'type':_0x256cb4(0x13e),'segmentName':_0x4b75bc,'activationName':_0x4177f8[_0x256cb4(0xe4)]}),await _0x43b4f5[_0x256cb4(0x1bf)](_0x256cb4(0xe8)+_0x4177f8['name']+_0x256cb4(0x13a),()=>_0x5c0f16[_0x256cb4(0x183)][_0x256cb4(0x115)](_0xe6feb6,_0x18a532,_0x4177f8['validatedRequest'])),_0x43b4f5[_0x256cb4(0x19a)]?.({'type':_0x256cb4(0xfb),'segmentName':_0x4b75bc,'activationName':_0x4177f8['name']}),_0x43b4f5[_0x256cb4(0x1be)]?.(_0x256cb4(0x153)+_0x4177f8[_0x256cb4(0xe4)]+'\x27'),_0x37b90c[_0x256cb4(0x17e)]++;else{if(_0x4177f8[_0x256cb4(0xec)]===_0x256cb4(0xef)&&_0x4177f8['validatedRequest']&&_0x4177f8[_0x256cb4(0x10b)])_0x43b4f5[_0x256cb4(0x19a)]?.({'type':'activation_updating','segmentName':_0x4b75bc,'activationName':_0x4177f8[_0x256cb4(0xe4)]}),await _0x43b4f5['withProgress'](_0x256cb4(0x17f)+_0x4177f8[_0x256cb4(0xe4)]+_0x256cb4(0x13a),()=>_0x5c0f16['segment']['updateActivation'](_0xe6feb6,_0x18a532,_0x4177f8[_0x256cb4(0x10b)]['id'],_0x4177f8[_0x256cb4(0x16b)])),_0x43b4f5[_0x256cb4(0x19a)]?.({'type':_0x256cb4(0x12c),'segmentName':_0x4b75bc,'activationName':_0x4177f8[_0x256cb4(0xe4)]}),_0x43b4f5['logSuccess']?.(_0x256cb4(0x16e)+_0x4177f8[_0x256cb4(0xe4)]+'\x27'),_0x37b90c['updated']++;else _0x4177f8[_0x256cb4(0xec)]===_0x256cb4(0x108)&&_0x4177f8['existingActivation']&&(_0x43b4f5[_0x256cb4(0x19a)]?.({'type':'activation_deleting','segmentName':_0x4b75bc,'activationName':_0x4177f8[_0x256cb4(0xe4)]}),await _0x43b4f5[_0x256cb4(0x1bf)](_0x256cb4(0x1a5)+_0x4177f8['name']+_0x256cb4(0x13a),()=>_0x5c0f16['segment'][_0x256cb4(0xed)](_0xe6feb6,_0x18a532,_0x4177f8[_0x256cb4(0x10b)]['id'])),_0x43b4f5[_0x256cb4(0x19a)]?.({'type':_0x256cb4(0x10a),'segmentName':_0x4b75bc,'activationName':_0x4177f8[_0x256cb4(0xe4)]}),_0x43b4f5[_0x256cb4(0x126)]?.(_0x256cb4(0x16c)+_0x4177f8[_0x256cb4(0xe4)]+'\x27'),_0x37b90c['deleted']++);}}catch(_0x494b62){const _0x173569=isHttp400Error(_0x494b62),_0x390905=_0x173569?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x256cb4(0x14d)],_0x4bd1ae=getErrorMessage(_0x494b62);throw new SDKError(_0x390905,_0x256cb4(0x1bd)+_0x4177f8[_0x256cb4(0xec)]+_0x256cb4(0x104)+_0x4177f8['name']+_0x256cb4(0xdf)+_0x1d38e8+'\x0a\x20\x20'+_0x4bd1ae,_0x494b62);}}return _0x37b90c;}export async function executePushFolders(_0x7dce,_0x2c03f7,_0x1c861e,_0x44910e,_0x34b7d5){const _0x2d3d89=a117_0xaf1b,_0x426e48=new Map(_0x1c861e);for(const _0x1867ef of _0x2c03f7){const _0x4e759c=_0x1867ef['split']('/'),_0x4124f1=_0x4e759c[_0x4e759c[_0x2d3d89(0xf0)]-0x1],_0x2a8c7b=_0x4e759c['slice'](0x0,-0x1)[_0x2d3d89(0x157)]('/'),_0x48963a=_0x426e48[_0x2d3d89(0x15d)](_0x2a8c7b);_0x34b7d5[_0x2d3d89(0x19a)]?.({'type':_0x2d3d89(0x152),'folder':_0x1867ef});const _0x15be1a={'name':_0x4124f1,'parentFolderId':_0x48963a},_0x6241b3=await _0x34b7d5[_0x2d3d89(0x1bf)](_0x2d3d89(0x1b8)+_0x1867ef+_0x2d3d89(0x13a),()=>_0x7dce[_0x2d3d89(0x183)][_0x2d3d89(0x17c)](_0x44910e['parentId'],_0x15be1a));_0x426e48[_0x2d3d89(0x180)](_0x1867ef,_0x6241b3[_0x2d3d89(0x111)]['id']),_0x34b7d5[_0x2d3d89(0x19a)]?.({'type':_0x2d3d89(0x170),'folder':_0x1867ef,'folderId':_0x6241b3[_0x2d3d89(0x111)]['id']}),_0x34b7d5[_0x2d3d89(0x155)]?.(_0x2d3d89(0x197)+_0x1867ef+'\x27');}return _0x426e48;}export async function executePushSegmentDeletions(_0x166aa7,_0x1cc88b,_0x1d72ad){const _0x27a62a=a117_0xaf1b;if(_0x1cc88b[_0x27a62a(0xf0)]===0x0)return 0x0;const {batchAsync:_0x373454}=await import('../../utils/async.js'),_0x7a4ee=0x5,_0x36cb05=await _0x373454(_0x1cc88b,async _0x36a25d=>{const _0x187fcf=_0x27a62a;return _0x1d72ad['onProgress']?.({'type':_0x187fcf(0xff),'name':_0x36a25d[_0x187fcf(0xe4)]}),await _0x166aa7[_0x187fcf(0x183)][_0x187fcf(0x184)](_0x36a25d['id']),_0x1d72ad[_0x187fcf(0x19a)]?.({'type':_0x187fcf(0x16f),'name':_0x36a25d[_0x187fcf(0xe4)]}),_0x1d72ad[_0x187fcf(0x126)]?.(_0x187fcf(0x165)+_0x36a25d[_0x187fcf(0xe4)]+'\x27'),0x1;},_0x7a4ee);return _0x36cb05[_0x27a62a(0xe3)]((_0x84ffcc,_0x155e91)=>_0x84ffcc+_0x155e91,0x0);}export async function executePushJourneys(_0x23c53c,_0xd8a336,_0x47b06b,_0x3e598c,_0x3bc011){const _0x27cb56=a117_0xaf1b,{journeyDefToRequest:_0x3f18ab}=await import(_0x27cb56(0x19c)),{activationDefToCreateRequest:_0x3694ca,yamlRuleToApi:_0x1fc430,validateSegmentRule:_0x5888c6}=await import(_0x27cb56(0x116)),_0x54043c={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3faa6a=new Map(_0x47b06b['segmentNameToId']),_0x4e676e=0x5;for(let _0x9360c8=0x0;_0x9360c8<_0xd8a336[_0x27cb56(0xf0)];_0x9360c8+=_0x4e676e){const _0x154562=_0xd8a336['slice'](_0x9360c8,_0x9360c8+_0x4e676e),_0xf6c998=await Promise['all'](_0x154562[_0x27cb56(0x198)](async _0x1f3ab0=>{const _0x436fb8=_0x27cb56;if(!_0x1f3ab0[_0x436fb8(0xf5)]&&!_0x1f3ab0[_0x436fb8(0x189)])return{'action':'unchanged','name':_0x1f3ab0[_0x436fb8(0x106)][_0x436fb8(0xe4)],'journeyId':_0x1f3ab0['existingJourney']?.['id']};const _0x20f5e5=_0x1f3ab0['folderPath']?_0x47b06b[_0x436fb8(0x1a3)][_0x436fb8(0x15d)](_0x1f3ab0[_0x436fb8(0x190)]):undefined;_0x3bc011[_0x436fb8(0x19a)]?.({'type':_0x1f3ab0['isNew']?_0x436fb8(0x11e):_0x436fb8(0x1b6),'name':_0x1f3ab0[_0x436fb8(0x106)][_0x436fb8(0xe4)]});try{const _0x3e937b=await executeSingleJourneyPush(_0x23c53c,_0x1f3ab0,{..._0x47b06b,'segmentNameToId':_0x3faa6a},{'parentId':_0x3e598c['parentId'],'rootFolderId':_0x3e598c[_0x436fb8(0x187)],'folderId':_0x20f5e5,'verbose':_0x3e598c[_0x436fb8(0xf7)]},_0x3bc011,{'journeyDefToRequest':_0x3f18ab,'activationDefToCreateRequest':_0x3694ca,'yamlRuleToApi':_0x1fc430,'validateSegmentRule':_0x5888c6});for(const [_0x360bfd,_0x16929b]of _0x3e937b[_0x436fb8(0xf4)]){_0x3faa6a[_0x436fb8(0x180)](_0x360bfd,_0x16929b),_0x54043c[_0x436fb8(0xf4)][_0x436fb8(0x180)](_0x360bfd,_0x16929b);}if(_0x3e937b['action']===_0x436fb8(0x17e))_0x3bc011[_0x436fb8(0x19a)]?.({'type':'journey_created','name':_0x1f3ab0['yamlConfig'][_0x436fb8(0xe4)],'journeyId':_0x3e937b[_0x436fb8(0x12a)]}),_0x3bc011[_0x436fb8(0x1be)]?.(_0x436fb8(0x132)+_0x1f3ab0['yamlConfig'][_0x436fb8(0xe4)]+'\x27'),_0x54043c[_0x436fb8(0x17e)]++;else _0x3e937b[_0x436fb8(0x12d)]===_0x436fb8(0x186)&&(_0x3bc011[_0x436fb8(0x19a)]?.({'type':_0x436fb8(0xd9),'name':_0x1f3ab0['yamlConfig'][_0x436fb8(0xe4)]}),_0x3bc011['logSuccess']?.(_0x436fb8(0x121)+_0x1f3ab0['yamlConfig'][_0x436fb8(0xe4)]+'\x27'),_0x54043c[_0x436fb8(0x186)]++);return{'action':_0x3e937b[_0x436fb8(0x12d)],'name':_0x1f3ab0[_0x436fb8(0x106)][_0x436fb8(0xe4)],'journeyId':_0x3e937b[_0x436fb8(0x12a)]};}catch(_0x5ad8a3){const _0x3b7fdf=isHttp400Error(_0x5ad8a3),_0x34504f=_0x3b7fdf?ErrorCode[_0x436fb8(0x1a8)]:ErrorCode[_0x436fb8(0x1a6)],_0x2cad66=getErrorMessage(_0x5ad8a3);throw new SDKError(_0x34504f,_0x436fb8(0x1bd)+(_0x1f3ab0[_0x436fb8(0xf5)]?'create':_0x436fb8(0xef))+_0x436fb8(0x145)+_0x1f3ab0[_0x436fb8(0x129)]+_0x436fb8(0x195)+_0x2cad66,_0x5ad8a3);}}));_0x54043c[_0x27cb56(0x109)][_0x27cb56(0x127)](..._0xf6c998);}return _0x54043c;}async function executeSingleJourneyPush(_0x5938c3,_0xffe590,_0x16b760,_0x37291a,_0x446117,_0x359afb){const _0x1ddffe=a117_0xaf1b,{journeyDefToRequest:_0x12e0e5,activationDefToCreateRequest:_0x41d438,yamlRuleToApi:_0x35f3a0,validateSegmentRule:_0x3d29d8}=_0x359afb,_0x2f735f=new Map(),_0xbc6c56=new Map(),_0x3ef431=new Map(),_0x164e70=new Map(),_0x569ce0=new Map();let _0x1363f4;const _0x5a15ab=async()=>{const _0x184fd9=a117_0xaf1b;if(_0x1363f4)return;_0x1363f4=new Map();if(!_0xffe590[_0x184fd9(0x123)])return;const _0x87ffb3=await _0x5938c3[_0x184fd9(0x18a)]['listActivations'](_0xffe590[_0x184fd9(0x123)]['id']);for(const _0x447976 of _0x87ffb3){const _0x457707=journeyActivationStepToYaml(_0x447976,_0x16b760[_0x184fd9(0xf2)],_0x16b760['connectionIdToNameMap']),_0x1ab631=activationSignature(_0x457707);!_0x1363f4[_0x184fd9(0x1b2)](_0x1ab631)&&_0x1363f4[_0x184fd9(0x180)](_0x1ab631,_0x447976['id']),_0x457707[_0x184fd9(0xe4)]&&_0xbc6c56[_0x184fd9(0x180)](_0x457707['name'],_0x447976['id']);}};if(_0xffe590['existingJourney']&&_0xffe590['yamlConfig']['segments']){const _0x2e1234=buildLocalExpandedRuleMappings(_0xffe590[_0x1ddffe(0x106)]),_0xfb71ff=_0x2e1234[_0x1ddffe(0x151)];if(_0xfb71ff['size']>0x0){const _0x2f8bc3=new Map();for(const [_0x32e4fc,_0x3dbdb2]of _0xfb71ff){const _0x5d2921=serializeExpandedRule(_0x3dbdb2,_0xfb71ff);_0x2f8bc3[_0x1ddffe(0x180)](_0x32e4fc,_0x5d2921);}const _0x2a6131=collectSegmentIdsFromJourneyApi(_0xffe590[_0x1ddffe(0x123)]);if(_0x2a6131[_0x1ddffe(0x146)]>0x0){const _0x3300f4=await buildServerSegmentRuleMap(_0x5938c3,_0x37291a[_0x1ddffe(0x1a4)],_0x16b760[_0x1ddffe(0x140)],_0x2a6131);if(_0x3300f4[_0x1ddffe(0x146)]>0x0){const _0x353961=new Map();for(const [_0x5cc166,_0x2b5cc0]of _0x3300f4){const _0x2a9dba=serializeExpandedRule(_0x2b5cc0,_0x3300f4);!_0x353961[_0x1ddffe(0x1b2)](_0x2a9dba)&&_0x353961[_0x1ddffe(0x180)](_0x2a9dba,_0x5cc166);}for(const [_0x31a671,_0x3a8f91]of _0x2f8bc3){const _0x3b2039=_0x353961[_0x1ddffe(0x15d)](_0x3a8f91);_0x3b2039&&(_0x569ce0[_0x1ddffe(0x180)](_0x31a671,_0x3b2039),_0x16b760[_0x1ddffe(0x105)][_0x1ddffe(0x180)](_0x31a671,_0x3b2039));}}}}}const _0xa576d9={'resolveSegmentId':async _0x5108fb=>{const _0x4c7c4c=_0x1ddffe,_0x4fbf3a=_0x16b760['segmentNameToId'][_0x4c7c4c(0x15d)](_0x5108fb);if(!_0x4fbf3a)throw new SDKError(ErrorCode[_0x4c7c4c(0x139)],_0x4c7c4c(0x128)+_0x5108fb+'\x20(referenced\x20in\x20journey\x20'+_0xffe590['yamlConfig'][_0x4c7c4c(0xe4)]+')');return _0x4fbf3a;},'resolveEmbeddedSegmentId':async(_0x4d9d4d,_0x2d849c)=>{const _0x3e37d6=_0x1ddffe,_0x515d28=_0x16b760[_0x3e37d6(0x105)]['get'](_0x4d9d4d);if(_0x515d28)return _0x515d28;const _0x26e855=_0x569ce0['get'](_0x4d9d4d);if(_0x26e855)return _0x16b760[_0x3e37d6(0x105)][_0x3e37d6(0x180)](_0x4d9d4d,_0x26e855),_0x26e855;const _0x5b2e56=_0x16b760[_0x3e37d6(0x140)][_0x3e37d6(0x166)](_0x1a93d6=>_0x1a93d6[_0x3e37d6(0xe4)]===_0x4d9d4d);if(_0x5b2e56)return _0x16b760[_0x3e37d6(0x105)][_0x3e37d6(0x180)](_0x4d9d4d,_0x5b2e56['id']),_0x5b2e56['id'];if(_0xffe590['isNew']){const {stageName:_0x4eccad,criteriaName:_0x534301}=findSegmentCriteriaLocation(_0xffe590['yamlConfig'],_0x4d9d4d);return _0x3d29d8(_0x4d9d4d,_0x2d849c['rule']),_0x3ef431[_0x3e37d6(0x180)](_0x4d9d4d,{'definition':_0x2d849c,'stageName':_0x4eccad,'criteriaName':_0x534301}),createPendingSegmentId(_0x4d9d4d);}const _0x10f6e5=_0xffe590[_0x3e37d6(0x123)]?.['id'];if(!_0x10f6e5)throw new SDKError(ErrorCode[_0x3e37d6(0x18e)],_0x3e37d6(0x1ba));_0x3d29d8(_0x4d9d4d,_0x2d849c[_0x3e37d6(0x131)]);const _0x58c533=generateDeterministicJourneySegmentName(_0xffe590[_0x3e37d6(0x106)][_0x3e37d6(0xe4)],_0x4d9d4d),_0x61dd51=_0x16b760[_0x3e37d6(0x140)][_0x3e37d6(0x166)](_0x2516cf=>_0x2516cf[_0x3e37d6(0xe4)]===_0x58c533),_0xefa2f0=createSegmentIdResolver(_0x16b760[_0x3e37d6(0x105)],_0x4d9d4d),_0x55b04c=await resolveRuleSegmentIds(_0x2d849c['rule'],_0xefa2f0);let _0x2c542a;if(_0x61dd51)await _0x5938c3['segment'][_0x3e37d6(0x172)](_0x37291a[_0x3e37d6(0x1a4)],_0x61dd51['id'],{'description':_0x2d849c['description']||_0x3e37d6(0x133)+_0x4d9d4d,'rule':_0x35f3a0(_0x55b04c,!![]),'countPopulation':!![]}),_0x2c542a=_0x61dd51['id'];else try{_0x2c542a=await _0x5938c3[_0x3e37d6(0x183)][_0x3e37d6(0x14b)]({'name':_0x58c533,'description':_0x2d849c['description']||_0x3e37d6(0x133)+_0x4d9d4d,'journeyId':_0x10f6e5,'rule':_0x35f3a0(_0x55b04c,!![]),'countPopulation':!![],'parentFolderId':_0x37291a[_0x3e37d6(0x187)]||'','audienceId':_0x37291a[_0x3e37d6(0x1a4)]});}catch(_0x27c065){const _0x39a8d=_0x27c065 instanceof Error&&_0x27c065[_0x3e37d6(0x136)]['includes'](_0x3e37d6(0xdc));if(_0x39a8d){const _0x199a0f=await _0x5938c3[_0x3e37d6(0x183)]['listSegments'](_0x37291a[_0x3e37d6(0x1a4)]),_0x5c9605=_0x199a0f[_0x3e37d6(0x166)](_0x105a85=>_0x105a85[_0x3e37d6(0xe4)]===_0x58c533);if(_0x5c9605)await _0x5938c3[_0x3e37d6(0x183)]['updateSegmentById'](_0x37291a[_0x3e37d6(0x1a4)],_0x5c9605['id'],{'description':_0x2d849c['description']||'Entry\x20criteria:\x20'+_0x4d9d4d,'rule':_0x35f3a0(_0x55b04c,!![]),'countPopulation':!![]}),_0x2c542a=_0x5c9605['id'];else throw _0x27c065;}else throw _0x27c065;}return _0x16b760['segmentNameToId'][_0x3e37d6(0x180)](_0x4d9d4d,_0x2c542a),_0x2f735f[_0x3e37d6(0x180)](_0x4d9d4d,_0x2c542a),_0x2c542a;},'resolveActivationId':async _0x181aa1=>{const _0x239138=_0x1ddffe,_0xd2a171=_0xbc6c56['get'](_0x181aa1);if(_0xd2a171)return _0xd2a171;if(_0xffe590[_0x239138(0x123)]){await _0x5a15ab();const _0x1ce2e7=_0xbc6c56[_0x239138(0x15d)](_0x181aa1);if(_0x1ce2e7)return _0x1ce2e7;}throw new SDKError(ErrorCode[_0x239138(0x162)],_0x239138(0xe7)+_0x181aa1+'\x20(referenced\x20in\x20journey\x20'+_0xffe590[_0x239138(0x106)][_0x239138(0xe4)]+_0x239138(0x1af)+_0x239138(0x1b9));},'resolveEmbeddedActivationId':async(_0x2817a6,_0x4c325c)=>{const _0x2214de=_0x1ddffe,_0x51901b=_0xbc6c56[_0x2214de(0x15d)](_0x2817a6);if(_0x51901b)return _0x51901b;if(_0xffe590[_0x2214de(0xf5)])return _0x164e70[_0x2214de(0x180)](_0x2817a6,_0x4c325c),createPendingActivationId(_0x2817a6);if(_0xffe590[_0x2214de(0x123)]){await _0x5a15ab();const _0x3182de=_0xbc6c56['get'](_0x4c325c[_0x2214de(0xe4)]);if(_0x3182de)return _0xbc6c56[_0x2214de(0x180)](_0x2817a6,_0x3182de),_0x3182de;const _0x393b93=activationSignature(_0x4c325c),_0x3aca6e=_0x1363f4?.[_0x2214de(0x15d)](_0x393b93);if(_0x3aca6e)return _0xbc6c56['set'](_0x2817a6,_0x3aca6e),_0x3aca6e;const _0x28bda9=await _0x41d438(_0x4c325c,_0x16b760['activationContext']),_0x164909=await _0x5938c3[_0x2214de(0x18a)][_0x2214de(0x115)](_0xffe590[_0x2214de(0x123)]['id'],_0x28bda9);return _0xbc6c56[_0x2214de(0x180)](_0x2817a6,_0x164909['id']),_0x164909['id'];}throw new SDKError(ErrorCode[_0x2214de(0x18e)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x4a576f=>{const _0x719611=_0x1ddffe;try{return await _0x5938c3[_0x719611(0x18a)][_0x719611(0x175)](_0x37291a[_0x719611(0x1a4)],_0x4a576f);}catch(_0x3ae045){throw new SDKError(ErrorCode[_0x719611(0x162)],_0x719611(0x10f)+_0x4a576f+_0x719611(0x1a0)+_0xffe590[_0x719611(0x106)][_0x719611(0xe4)]+'\x27)',_0x3ae045);}},'resolveStageId':async(_0x40240f,_0xa83c9e)=>{const _0x38bc1e=_0x1ddffe,_0x492f1f=await _0x5938c3[_0x38bc1e(0x18a)]['getJourney'](_0x40240f),_0x1d04cc=_0x492f1f[_0x38bc1e(0x137)]['journeyStages'][_0x38bc1e(0x166)](_0x2dd52c=>_0x2dd52c[_0x38bc1e(0xe4)][_0x38bc1e(0x176)]()===_0xa83c9e[_0x38bc1e(0x176)]());if(!_0x1d04cc?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x38bc1e(0x179)+_0xa83c9e+_0x38bc1e(0x110)+(_0x492f1f['attributes'][_0x38bc1e(0xdb)]||_0x492f1f[_0x38bc1e(0x137)][_0x38bc1e(0xe4)])+'\x27');return _0x1d04cc['id'];}},_0x10b53a=await _0x12e0e5(_0xffe590[_0x1ddffe(0x106)],_0x37291a['parentId'],_0xa576d9),_0x4d3ee9=_0x37291a[_0x1ddffe(0x11a)]||_0x37291a[_0x1ddffe(0x187)];_0x4d3ee9&&(_0x10b53a[_0x1ddffe(0x19b)]={'parentFolder':{'data':{'id':_0x4d3ee9,'type':_0x1ddffe(0x15b)}}});if(_0xffe590[_0x1ddffe(0xf5)]){if(_0x3ef431[_0x1ddffe(0x146)]>0x0||_0x164e70[_0x1ddffe(0x146)]>0x0)return await executeThreeStepJourneyCreate(_0x5938c3,_0xffe590,_0x10b53a,{'pendingEmbeddedSegments':_0x3ef431,'pendingEmbeddedActivations':_0x164e70,'embeddedSegmentNameToId':_0x2f735f,'journeyActivationNameToId':_0xbc6c56},{..._0x37291a,'effectiveFolderId':_0x4d3ee9},_0x16b760,_0x446117,_0x359afb);else{ensureJourneyDefaults(_0x10b53a['attributes']);const _0x3c7e9e=await _0x5938c3[_0x1ddffe(0x18a)][_0x1ddffe(0x1bc)](_0x10b53a);return{'action':_0x1ddffe(0x17e),'journeyId':_0x3c7e9e['id'],'embeddedSegmentNameToId':_0x2f735f};}}else{if(_0xffe590['hasChanges']&&_0xffe590[_0x1ddffe(0x123)])return ensureJourneyDefaults(_0x10b53a[_0x1ddffe(0x137)]),await _0x5938c3[_0x1ddffe(0x18a)][_0x1ddffe(0xef)](_0xffe590[_0x1ddffe(0x123)]['id'],_0x10b53a),{'action':'updated','journeyId':_0xffe590[_0x1ddffe(0x123)]['id'],'embeddedSegmentNameToId':_0x2f735f};}return{'action':'unchanged','journeyId':_0xffe590['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x2f735f};}function findSegmentCriteriaLocation(_0x501c4a,_0x44b44b){const _0x1bcaac=a117_0xaf1b,_0x4b0f7e=_0x501c4a[_0x1bcaac(0x192)]||_0x501c4a[_0x1bcaac(0x14e)]?.[0x0]?.[_0x1bcaac(0x192)]||[];let _0x1032b4=_0x1bcaac(0x14f),_0x1dd618=_0x44b44b;const _0x46668a=_0x501c4a[_0x1bcaac(0x100)]||_0x501c4a[_0x1bcaac(0x14e)]?.[0x0]?.[_0x1bcaac(0x100)];if(_0x46668a?.[_0x1bcaac(0x183)]===_0x44b44b)return{'stageName':_0x1bcaac(0x100),'criteriaName':_0x46668a[_0x1bcaac(0xe4)]||_0x44b44b};_0xfbdcd0:for(const _0x82b746 of _0x4b0f7e){if(_0x82b746[_0x1bcaac(0xfc)]?.[_0x1bcaac(0x183)]===_0x44b44b){_0x1032b4=_0x82b746[_0x1bcaac(0xe4)],_0x1dd618=_0x82b746[_0x1bcaac(0xfc)]['name']||_0x44b44b;break;}if(_0x82b746['steps'])for(const _0x220f4f of _0x82b746[_0x1bcaac(0x12f)]){if(_0x220f4f[_0x1bcaac(0xec)]===_0x1bcaac(0xde)&&_0x220f4f['with']?.[_0x1bcaac(0x124)])for(const _0x124637 of _0x220f4f[_0x1bcaac(0x167)][_0x1bcaac(0x124)]){if(_0x124637[_0x1bcaac(0x183)]===_0x44b44b){_0x1032b4=_0x82b746[_0x1bcaac(0xe4)],_0x1dd618=_0x124637[_0x1bcaac(0xe4)]||_0x44b44b;break _0xfbdcd0;}}}}return{'stageName':_0x1032b4,'criteriaName':_0x1dd618};}async function executeThreeStepJourneyCreate(_0xa3621d,_0x26aeba,_0x23bdde,_0x184d42,_0x454294,_0x581c9c,_0x5de7ba,_0x1f92ae){const _0x213c96=a117_0xaf1b,{activationDefToCreateRequest:_0x5504c9,yamlRuleToApi:_0x121fe5}=_0x1f92ae,{pendingEmbeddedSegments:_0x3a62ac,pendingEmbeddedActivations:_0x595a9e,embeddedSegmentNameToId:_0xb88857}=_0x184d42,_0x81b60b=JSON[_0x213c96(0x193)](JSON['stringify'](_0x23bdde));ensureJourneyDefaults(_0x81b60b[_0x213c96(0x137)]),stripPendingIds(_0x81b60b);const _0x4c08e9=await _0xa3621d[_0x213c96(0x18a)]['create'](_0x81b60b),_0x56fd34=_0x4c08e9['id'],_0x49d4aa=new Map();for(const _0x1914dd of _0x4c08e9[_0x213c96(0x137)][_0x213c96(0x13c)]){_0x49d4aa[_0x213c96(0x180)](_0x1914dd[_0x213c96(0xe4)][_0x213c96(0x176)](),_0x1914dd['id']);}for(const [_0x21dece,{definition:_0x15935b}]of _0x3a62ac){const _0x310421=generateDeterministicJourneySegmentName(_0x26aeba['yamlConfig']['name'],_0x21dece);_0x5de7ba[_0x213c96(0x19a)]?.({'type':_0x213c96(0x10d),'journeyName':_0x26aeba[_0x213c96(0x106)][_0x213c96(0xe4)],'segmentName':_0x21dece});const _0x528585=createSegmentIdResolver(_0x581c9c[_0x213c96(0x105)],_0x21dece),_0x1854b3=await resolveRuleSegmentIds(_0x15935b[_0x213c96(0x131)],_0x528585),_0x34e1a6=await _0xa3621d[_0x213c96(0x183)][_0x213c96(0x14b)]({'name':_0x310421,'description':_0x15935b[_0x213c96(0x141)]||_0x213c96(0x133)+_0x21dece,'journeyId':_0x56fd34,'rule':_0x121fe5(_0x1854b3,!![]),'countPopulation':!![],'parentFolderId':_0x454294['effectiveFolderId']||'','audienceId':_0x454294[_0x213c96(0x1a4)]});_0xb88857[_0x213c96(0x180)](_0x21dece,_0x34e1a6),_0x581c9c[_0x213c96(0x105)]['set'](_0x21dece,_0x34e1a6),_0x5de7ba[_0x213c96(0x19a)]?.({'type':_0x213c96(0x1b1),'journeyName':_0x26aeba['yamlConfig'][_0x213c96(0xe4)],'segmentName':_0x21dece});}const _0x2ba531=new Map();for(const [_0x2587c2,_0x3454fc]of _0x595a9e){_0x5de7ba[_0x213c96(0x19a)]?.({'type':_0x213c96(0x13b),'journeyName':_0x26aeba[_0x213c96(0x106)][_0x213c96(0xe4)],'activationName':_0x2587c2});const _0x2f60ea=await _0x5504c9(_0x3454fc,_0x581c9c['activationContext']),_0x1ac435=await _0xa3621d['journey'][_0x213c96(0x115)](_0x56fd34,_0x2f60ea);_0x2ba531[_0x213c96(0x180)](_0x2587c2,_0x1ac435['id']),_0x184d42[_0x213c96(0x10e)]['set'](_0x2587c2,_0x1ac435['id']),_0x5de7ba[_0x213c96(0x19a)]?.({'type':_0x213c96(0x1b5),'journeyName':_0x26aeba[_0x213c96(0x106)][_0x213c96(0xe4)],'activationName':_0x2587c2});}const _0x53e929=JSON[_0x213c96(0x193)](JSON['stringify'](_0x23bdde));return _0x53e929['id']=_0x56fd34,ensureJourneyDefaults(_0x53e929[_0x213c96(0x137)]),resolvePendingIdsInRequest(_0x53e929,_0x23bdde,_0x49d4aa,_0xb88857,_0x2ba531,_0x5de7ba),await _0xa3621d[_0x213c96(0x18a)]['update'](_0x56fd34,_0x53e929),{'action':_0x213c96(0x17e),'journeyId':_0x56fd34,'embeddedSegmentNameToId':_0xb88857};}function stripPendingIds(_0x2d9a53){const _0x189753=a117_0xaf1b;for(const _0x27a9a3 of _0x2d9a53['attributes']['journeyStages']||[]){_0x27a9a3[_0x189753(0x1a1)]?.['segmentId']&&isPendingSegmentId(_0x27a9a3['entryCriteria'][_0x189753(0x18f)])&&delete _0x27a9a3[_0x189753(0x1a1)];if(_0x27a9a3[_0x189753(0x12f)])for(const _0x52e939 of Object[_0x189753(0x118)](_0x27a9a3[_0x189753(0x12f)])){const _0x342939=_0x27a9a3['steps'][_0x52e939];_0x342939['type']===_0x189753(0x143)&&_0x342939[_0x189753(0x1b0)]&&isPendingActivationId(_0x342939['journeyActivationStepId'])&&(_0x342939['journeyActivationStepId']='');if(_0x342939[_0x189753(0xec)]===_0x189753(0x10c)&&_0x342939[_0x189753(0x124)])for(const _0x1f1595 of _0x342939[_0x189753(0x124)]){_0x1f1595[_0x189753(0x18f)]&&isPendingSegmentId(_0x1f1595[_0x189753(0x18f)])&&(_0x1f1595[_0x189753(0x18f)]='');}_0x342939[_0x189753(0xec)]===_0x189753(0x1ab)&&_0x342939[_0x189753(0x163)]?.['segmentId']&&isPendingSegmentId(_0x342939[_0x189753(0x163)][_0x189753(0x18f)])&&(_0x342939[_0x189753(0x163)][_0x189753(0x18f)]='');}}}function resolvePendingIdsInRequest(_0x3982a6,_0x19ebc2,_0x2d9fb5,_0x53293d,_0x52c685,_0xa3b76){const _0x74996=a117_0xaf1b,_0x51c06d=(_0x1847ca,_0x2a695a)=>{const _0x21782c=a117_0xaf1b;if(!isPendingSegmentId(_0x1847ca))return _0x1847ca;const _0x5e2fe0=extractPendingSegmentName(_0x1847ca),_0x151c24=_0x53293d['get'](_0x5e2fe0);return!_0x151c24&&_0xa3b76[_0x21782c(0x15f)]?.(_0x21782c(0x1b7)+_0x5e2fe0+'\x27\x20for\x20'+_0x2a695a),_0x151c24;};if(_0x3982a6[_0x74996(0x137)][_0x74996(0x100)]?.[_0x74996(0x18f)]&&isPendingSegmentId(_0x3982a6[_0x74996(0x137)][_0x74996(0x100)][_0x74996(0x18f)])){const _0x43dabc=_0x51c06d(_0x3982a6['attributes'][_0x74996(0x100)][_0x74996(0x18f)],_0x74996(0x15e));_0x43dabc&&(_0x3982a6[_0x74996(0x137)][_0x74996(0x100)][_0x74996(0x18f)]=_0x43dabc);}for(const _0x1c3ab3 of _0x3982a6[_0x74996(0x137)][_0x74996(0x13c)]||[]){const _0x4622dc=_0x2d9fb5[_0x74996(0x15d)](_0x1c3ab3[_0x74996(0xe4)]['toLowerCase']());_0x4622dc&&(_0x1c3ab3['id']=_0x4622dc);if(_0x1c3ab3[_0x74996(0x1a1)]?.['segmentId']&&isPendingSegmentId(_0x1c3ab3[_0x74996(0x1a1)]['segmentId'])){const _0x10cdda=_0x51c06d(_0x1c3ab3[_0x74996(0x1a1)][_0x74996(0x18f)],_0x74996(0x191)+_0x1c3ab3[_0x74996(0xe4)]+_0x74996(0x103));_0x10cdda&&(_0x1c3ab3[_0x74996(0x1a1)][_0x74996(0x18f)]=_0x10cdda);}if(_0x1c3ab3[_0x74996(0x182)])for(const _0x54af4b of _0x1c3ab3[_0x74996(0x182)]){if(_0x54af4b[_0x74996(0x18f)]&&isPendingSegmentId(_0x54af4b[_0x74996(0x18f)])){const _0x79066d=_0x51c06d(_0x54af4b[_0x74996(0x18f)],_0x74996(0x191)+_0x1c3ab3[_0x74996(0xe4)]+_0x74996(0x1a9));_0x79066d&&(_0x54af4b[_0x74996(0x18f)]=_0x79066d);}}if(_0x1c3ab3[_0x74996(0x114)]?.['segmentId']&&isPendingSegmentId(_0x1c3ab3['milestone'][_0x74996(0x18f)])){const _0x17140f=_0x51c06d(_0x1c3ab3[_0x74996(0x114)]['segmentId'],_0x74996(0x191)+_0x1c3ab3['name']+_0x74996(0x1a2));_0x17140f&&(_0x1c3ab3['milestone']['segmentId']=_0x17140f);}if(_0x1c3ab3[_0x74996(0x12f)]){const _0x44d87f=_0x54d103=>_0x19ebc2[_0x74996(0x137)]['journeyStages'][_0x74996(0x166)](_0x28831c=>_0x28831c[_0x74996(0xe4)]['toLowerCase']()===_0x1c3ab3[_0x74996(0xe4)]['toLowerCase']())?.[_0x74996(0x12f)]?.[_0x54d103];for(const _0x2b243f of Object['keys'](_0x1c3ab3[_0x74996(0x12f)])){const _0x45ca86=_0x1c3ab3[_0x74996(0x12f)][_0x2b243f],_0x77550a=_0x44d87f(_0x2b243f);if(_0x45ca86['type']===_0x74996(0x143)&&_0x45ca86[_0x74996(0x1b0)]&&(isPendingActivationId(_0x45ca86['journeyActivationStepId'])||_0x45ca86[_0x74996(0x1b0)]==='')){if(_0x77550a?.['journeyActivationStepId']&&isPendingActivationId(_0x77550a[_0x74996(0x1b0)])){const _0x44a3e6=extractPendingActivationName(_0x77550a[_0x74996(0x1b0)]),_0x3d80d4=_0x52c685[_0x74996(0x15d)](_0x44a3e6);_0x3d80d4&&(_0x45ca86['journeyActivationStepId']=_0x3d80d4);}}if(_0x45ca86[_0x74996(0xec)]===_0x74996(0x10c)&&_0x45ca86[_0x74996(0x124)]&&_0x77550a?.['branches'])for(let _0x251078=0x0;_0x251078<_0x45ca86[_0x74996(0x124)]['length'];_0x251078++){const _0xbee1ac=_0x45ca86[_0x74996(0x124)][_0x251078],_0x4817ce=_0x77550a[_0x74996(0x124)][_0x251078];if(_0x4817ce?.['segmentId']&&isPendingSegmentId(_0x4817ce[_0x74996(0x18f)])){const _0x1ff946=_0x51c06d(_0x4817ce[_0x74996(0x18f)],_0x74996(0x191)+_0x1c3ab3[_0x74996(0xe4)]+_0x74996(0x149)+(_0xbee1ac['name']||_0x251078)+'\x27');_0x1ff946&&(_0xbee1ac[_0x74996(0x18f)]=_0x1ff946);}}if(_0x45ca86['type']==='WaitStep'&&_0x45ca86[_0x74996(0x163)]?.['segmentId']&&_0x77550a?.[_0x74996(0x163)]?.[_0x74996(0x18f)]&&isPendingSegmentId(_0x77550a[_0x74996(0x163)][_0x74996(0x18f)])){const _0x34b7c8=_0x51c06d(_0x77550a[_0x74996(0x163)][_0x74996(0x18f)],_0x74996(0x191)+_0x1c3ab3[_0x74996(0xe4)]+_0x74996(0x199));_0x34b7c8&&(_0x45ca86['waitCondition']['segmentId']=_0x34b7c8);}}}}}
1
+ (function(_0x43704c,_0x34c2ea){const _0x59480f=a117_0x3948,_0x169a11=_0x43704c();while(!![]){try{const _0x3bf4f4=-parseInt(_0x59480f(0x13f))/0x1+parseInt(_0x59480f(0x124))/0x2+-parseInt(_0x59480f(0xb8))/0x3*(parseInt(_0x59480f(0x135))/0x4)+-parseInt(_0x59480f(0x150))/0x5+parseInt(_0x59480f(0x162))/0x6+parseInt(_0x59480f(0xae))/0x7+parseInt(_0x59480f(0x10f))/0x8;if(_0x3bf4f4===_0x34c2ea)break;else _0x169a11['push'](_0x169a11['shift']());}catch(_0x474bd0){_0x169a11['push'](_0x169a11['shift']());}}}(a117_0x5407,0xc57a1));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x152751){return''+PENDING_SEGMENT_PREFIX+_0x152751+'__';}export function isPendingSegmentId(_0x561763){const _0x108cbf=a117_0x3948;return _0x561763[_0x108cbf(0x13e)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0xead6c6){const _0x5db939=a117_0x3948;return _0xead6c6[_0x5db939(0xdd)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x2ae2cc){return''+PENDING_ACTIVATION_PREFIX+_0x2ae2cc+'__';}export function isPendingActivationId(_0x1800f4){return _0x1800f4['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x11cbb7){return _0x11cbb7['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x15b06f,_0x28e789){const _0x53ca14=a117_0x3948,_0x3db5bd=_0x15b06f+'::'+(_0x28e789[_0x53ca14(0x166)]()||_0x53ca14(0x103)),_0x5a6945=createHash(_0x53ca14(0x11c))[_0x53ca14(0x149)](_0x3db5bd)['digest'](_0x53ca14(0xb1))[_0x53ca14(0xe4)](0x0,0xc);return'journey_entry_criteria_'+_0x5a6945;}export function ensureJourneyDefaults(_0x471eb3){const _0x2f8631=a117_0x3948;!_0x471eb3[_0x2f8631(0x18d)]&&(_0x471eb3[_0x2f8631(0x18d)]=''),!_0x471eb3[_0x2f8631(0x183)]&&(_0x471eb3['state']=_0x2f8631(0x121));}export function resolveTDFolderPath(_0x5c1163,_0x33cd0a,_0x510976){const _0x4775f2=a117_0x3948;if(!_0x33cd0a)return _0x5c1163;if(_0x5c1163===_0x510976||_0x5c1163[_0x4775f2(0x13e)](_0x510976+'/'))return _0x5c1163;return _0x5c1163?_0x510976+'/'+_0x5c1163:_0x510976;}export function addFoldersToCreate(_0xe0fc14,_0x5ab2a1,_0x4911b0){const _0x42e091=a117_0x3948;if(!_0xe0fc14)return;if(_0x5ab2a1[_0x42e091(0xda)](_0xe0fc14))return;const _0x473d43=_0xe0fc14[_0x42e091(0x17d)]('/');let _0x3bd60f='';for(const _0x482580 of _0x473d43){_0x3bd60f=_0x3bd60f?_0x3bd60f+'/'+_0x482580:_0x482580,!_0x5ab2a1[_0x42e091(0xda)](_0x3bd60f)&&_0x4911b0[_0x42e091(0xf5)](_0x3bd60f);}}import*as a117_0x4ace2d from'yaml';import{readFileSync}from'fs';import a117_0x42768f from'path';import{isJourneyDef,parseYamlString as a117_0xaedc8f,toYamlString as a117_0x86dca2,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';function a117_0x3948(_0x347d43,_0xa60048){_0x347d43=_0x347d43-0xae;const _0x5407d3=a117_0x5407();let _0x394828=_0x5407d3[_0x347d43];return _0x394828;}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(_0x2d0bc9){const _0x3e5813=a117_0x3948;if(Array[_0x3e5813(0x10d)](_0x2d0bc9))return'['+_0x2d0bc9[_0x3e5813(0xe6)](_0xf51210=>stableStringify(_0xf51210))[_0x3e5813(0x114)](',')+']';if(_0x2d0bc9&&typeof _0x2d0bc9===_0x3e5813(0xba)){const _0x1d58be=_0x2d0bc9,_0xa024a3=Object[_0x3e5813(0xb5)](_0x1d58be)[_0x3e5813(0x170)](),_0x91955f=_0xa024a3[_0x3e5813(0xe6)](_0x4e2a35=>'\x22'+_0x4e2a35+'\x22:'+stableStringify(_0x1d58be[_0x4e2a35]));return'{'+_0x91955f[_0x3e5813(0x114)](',')+'}';}const _0x1239d5=JSON[_0x3e5813(0x145)](_0x2d0bc9);return _0x1239d5===undefined?_0x3e5813(0x16c):_0x1239d5;}function activationSignature(_0x5b5bde){const _0x43e7e0=a117_0x3948,_0x334868={'connection':_0x5b5bde['connection'],..._0x5b5bde['all_columns']!==undefined&&{'all_columns':_0x5b5bde[_0x43e7e0(0x174)]},..._0x5b5bde[_0x43e7e0(0x171)]!==undefined&&{'columns':_0x5b5bde[_0x43e7e0(0x171)]},..._0x5b5bde[_0x43e7e0(0x16a)]!==undefined&&{'behavior':_0x5b5bde[_0x43e7e0(0x16a)]},..._0x5b5bde[_0x43e7e0(0x181)]!==undefined&&{'schedule':_0x5b5bde[_0x43e7e0(0x181)]},..._0x5b5bde['notification']!==undefined&&{'notification':_0x5b5bde[_0x43e7e0(0xf0)]},..._0x5b5bde[_0x43e7e0(0x16d)]!==undefined&&{'connector_config':_0x5b5bde['connector_config']},..._0x5b5bde[_0x43e7e0(0xc7)]!==undefined&&{'activation_template_id':_0x5b5bde[_0x43e7e0(0xc7)]}};return stableStringify(_0x334868);}export async function prepareSegmentFiles(_0x5b8b9b,_0x2e0de4,_0x3d1d9d,_0xd2dc57,_0x2d93bc){const _0x4032c1=a117_0x3948,{activationDefToCreateRequest:_0x24b97d}=await import(_0x4032c1(0x14c)),_0x2fe08d=[],_0x5e47e0=new Set();for(const {yamlConfig:_0x360d2e,folderPath:_0x252215,sourcePath:_0x53812d}of _0x5b8b9b){const _0xe21ab=resolveTDFolderPath(_0x252215,_0xd2dc57,_0x2d93bc),_0x4bae2e=_0xe21ab+':'+_0x360d2e['name'],_0x447871=_0x2e0de4[_0x4032c1(0xd1)][_0x4032c1(0xb0)](_0x4bae2e),_0x4c86bf=_0x447871?_0x2e0de4[_0x4032c1(0xbc)][_0x4032c1(0xb0)](_0x447871['id'])||[]:[];addFoldersToCreate(_0xe21ab,_0x2e0de4[_0x4032c1(0xcb)],_0x5e47e0);const _0x3eae81=calculateActivationActions(_0x360d2e[_0x4032c1(0x140)]||[],_0x4c86bf,_0x2e0de4['idToEmailMap'],_0x2e0de4[_0x4032c1(0xe7)]);for(const _0x24aa1f of _0x3eae81){(_0x24aa1f['type']===_0x4032c1(0xdb)||_0x24aa1f[_0x4032c1(0x15e)]==='update')&&_0x24aa1f[_0x4032c1(0x13d)]&&(_0x24aa1f['validatedRequest']=await _0x24b97d(_0x24aa1f[_0x4032c1(0x13d)],_0x3d1d9d));}const _0x54edd2=calculateSegmentDiff(_0x360d2e,_0x447871,_0x4c86bf,_0x2e0de4[_0x4032c1(0x11e)],_0x2e0de4[_0x4032c1(0xe7)]);_0x2fe08d[_0x4032c1(0x129)]({'relativePath':_0x360d2e['name'],'absolutePath':_0x53812d,'yamlConfig':_0x360d2e,'folderPath':_0xe21ab,'existingSegment':_0x447871,'existingActivations':_0x4c86bf,'isNew':_0x54edd2['isNew'],'hasChanges':_0x54edd2[_0x4032c1(0xea)],'diff':_0x54edd2['diff'],'activationActions':_0x3eae81});}return{'segmentFiles':_0x2fe08d,'foldersToCreate':_0x5e47e0};}export async function prepareJourneyFiles(_0x383dee,_0x101b2c,_0x72bd91,_0x57a93b){const _0x13372a=a117_0x3948,_0x139ff6=[],_0x4fb67f=new Set();for(const {yamlConfig:_0x29efe5,folderPath:_0x4a7297,sourcePath:_0x46eabe}of _0x383dee){const _0x3cee41=resolveTDFolderPath(_0x4a7297,_0x72bd91,_0x57a93b),_0x4425c6=_0x3cee41+':'+_0x29efe5['name'],_0x5c3a7a=_0x101b2c[_0x13372a(0xbf)][_0x13372a(0xb0)](_0x4425c6);let _0x36d599,_0x353f25;if(_0x5c3a7a&&_0x5c3a7a[_0x13372a(0x13c)]>0x0){const _0x594141=buildLocalExpandedRuleMappings(_0x29efe5),{createYamlContext:_0x4b88d7,prefetchJourneySegments:_0x487b04}=createPushYamlContextForBundle(_0x101b2c[_0x13372a(0x165)],_0x101b2c[_0x13372a(0x12b)],_0x101b2c['existingSegments'],_0x594141,_0x101b2c[_0x13372a(0x11e)],_0x101b2c[_0x13372a(0xe7)],_0x101b2c[_0x13372a(0x164)],_0x101b2c[_0x13372a(0xe9)]);await _0x487b04(_0x5c3a7a[_0x13372a(0xe6)](_0x3e34dd=>_0x3e34dd['id']));const _0x1df7d0=hasMultipleVersions(_0x29efe5),_0x2e1935=async _0x4ab48c=>{const _0x217e63=_0x13372a,_0x346128=_0x101b2c[_0x217e63(0xe9)]?.[_0x217e63(0xb0)](_0x4ab48c);if(_0x346128)return _0x346128;return _0x101b2c[_0x217e63(0x190)]({'journeyId':_0x4ab48c,'journeyName':_0x29efe5[_0x217e63(0xb9)],'isMultiVersion':_0x5c3a7a[_0x217e63(0x13c)]>0x1});};if(_0x1df7d0&&_0x5c3a7a[_0x13372a(0x13c)]>0x1){const _0x48459c=[];for(const _0x1a1f5c of _0x5c3a7a){const _0x3f3ac5=_0x1a1f5c['versionNumber']||0x1;_0x101b2c[_0x13372a(0x189)]?.[_0x13372a(0x149)]('Fetching\x20'+_0x29efe5[_0x13372a(0xb9)]+'\x20v'+_0x3f3ac5);const _0x2ac442=await _0x2e1935(_0x1a1f5c['id']),_0x5dffee=_0x4b88d7(_0x1a1f5c['id']),_0x48dd0a=await journeyResponseToDef(_0x2ac442,_0x5dffee);_0x48459c['push']({'item':_0x1a1f5c,'yaml':_0x48dd0a});}const _0x7943b=buildLocalRuleToNameMappingFromJourney(_0x29efe5);_0x353f25=buildMergedJourneyDef(_0x48459c,_0x7943b);const _0xc016bd=Math[_0x13372a(0x17c)](..._0x48459c[_0x13372a(0xe6)](_0x4d9ccc=>_0x4d9ccc[_0x13372a(0x131)][_0x13372a(0x158)]||0x0)),_0x3448a2=_0x5c3a7a['find'](_0x1fcd81=>(_0x1fcd81['versionNumber']||0x0)===_0xc016bd);_0x3448a2&&(_0x101b2c[_0x13372a(0x189)]?.[_0x13372a(0x149)](_0x13372a(0x173)+_0x29efe5[_0x13372a(0xb9)]+'\x20v'+_0xc016bd),_0x36d599=await _0x2e1935(_0x3448a2['id']));}else{const _0x1f2fe5=_0x5c3a7a[_0x5c3a7a['length']-0x1];_0x101b2c['progress']?.['update'](_0x13372a(0x173)+_0x29efe5['name']),_0x36d599=await _0x2e1935(_0x1f2fe5['id']);const _0x23e2a2=_0x4b88d7(_0x1f2fe5['id']),_0x377dc2=await journeyResponseToDef(_0x36d599,_0x23e2a2),_0x43727c=buildLocalRuleToNameMappingFromJourney(_0x29efe5);_0x353f25=buildMergedJourneyDef([{'item':_0x1f2fe5,'yaml':_0x377dc2}],_0x43727c);}}addFoldersToCreate(_0x3cee41,_0x101b2c[_0x13372a(0xcb)],_0x4fb67f);const _0x48f6b5=calculateJourneyDiff(_0x29efe5,_0x353f25);_0x139ff6[_0x13372a(0x129)]({'relativePath':_0x29efe5[_0x13372a(0xb9)],'absolutePath':_0x46eabe,'yamlConfig':_0x29efe5,'folderPath':_0x3cee41,'existingJourney':_0x36d599,'isNew':_0x48f6b5[_0x13372a(0x15d)],'hasChanges':_0x48f6b5[_0x13372a(0xea)],'diff':_0x48f6b5[_0x13372a(0x132)]});}return{'journeyFiles':_0x139ff6,'foldersToCreate':_0x4fb67f};}export function calculateActivationActions(_0x5679bd,_0x510aa5,_0xbd6cd9,_0x110e1e){const _0x44ad6c=a117_0x3948,_0x389ce7=[],_0x10cd78=new Map();for(const _0x3be5c2 of _0x510aa5){_0x10cd78['set'](_0x3be5c2[_0x44ad6c(0xb9)],_0x3be5c2);}const _0xb3f1b=new Map();for(const _0x30392f of _0x5679bd){_0xb3f1b['set'](_0x30392f['name'],_0x30392f);}for(const _0x39e999 of _0x5679bd){const _0x56a944=_0x10cd78[_0x44ad6c(0xb0)](_0x39e999[_0x44ad6c(0xb9)]);if(!_0x56a944)_0x389ce7['push']({'type':_0x44ad6c(0xdb),'name':_0x39e999[_0x44ad6c(0xb9)],'yamlActivation':_0x39e999});else{const _0x685d6a=activationResponseToDef(_0x56a944,_0xbd6cd9,_0x110e1e),_0x1d89ab=a117_0x4ace2d[_0x44ad6c(0x145)](_0x685d6a),_0x325b9a=a117_0x4ace2d[_0x44ad6c(0x145)](_0x39e999);_0x1d89ab!==_0x325b9a&&_0x389ce7['push']({'type':_0x44ad6c(0x149),'name':_0x39e999['name'],'yamlActivation':_0x39e999,'existingActivation':_0x56a944});}}for(const _0x1423c1 of _0x510aa5){!_0xb3f1b['has'](_0x1423c1['name'])&&_0x389ce7[_0x44ad6c(0x129)]({'type':_0x44ad6c(0xb6),'name':_0x1423c1[_0x44ad6c(0xb9)],'existingActivation':_0x1423c1});}return _0x389ce7;}export function calculateSegmentDiff(_0x11724f,_0x9cc5f1,_0x376d06,_0x52fa65,_0x5db9da){const _0x59ae1f=segmentToYamlString(_0x11724f);if(_0x9cc5f1){const _0x236be5=segmentWithActivationsToYaml(_0x9cc5f1,_0x376d06,undefined,_0x52fa65,_0x5db9da),_0x327fd6=segmentToYamlString(_0x236be5),_0x6c9a2e=generateDiff(_0x327fd6,_0x59ae1f),_0x121da8=hasChanges(_0x6c9a2e);return{'isNew':![],'hasChanges':_0x121da8,'diff':_0x121da8?formatDiffWithColors(_0x6c9a2e):undefined};}const _0x478506=generateDiff('',_0x59ae1f);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x478506)};}export function calculateJourneyDiff(_0x133e60,_0x29f3ee){const _0x1e4c73=normalizeJourneyDef(_0x133e60,_0x133e60),_0x114a60=a117_0x86dca2(_0x1e4c73);if(_0x29f3ee){const _0x37e7b4=normalizeJourneyDef(_0x29f3ee,_0x133e60),_0x107d62=a117_0x86dca2(_0x37e7b4),_0x334ee4=generateDiff(_0x107d62,_0x114a60),_0x2f72aa=hasChanges(_0x334ee4);return{'isNew':![],'hasChanges':_0x2f72aa,'diff':_0x2f72aa?formatDiffWithColors(_0x334ee4):undefined};}const _0x1dd435=generateDiff('',_0x114a60);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1dd435)};}export function findSegmentsToDelete(_0x5390de,_0x45a39b,_0x56c603,_0x51fe0e,_0x4b3208){const _0x5f3d39=a117_0x3948,_0x57614f=new Set();for(const {yamlConfig:_0x4718f4,folderPath:_0x469aa2}of _0x45a39b){_0x57614f[_0x5f3d39(0xf5)](_0x469aa2+':'+_0x4718f4['name']);}return _0x5390de[_0x5f3d39(0xdc)](_0x2c8646=>{const _0x2c75c0=_0x5f3d39,_0x41087d=_0x2c8646[_0x2c75c0(0x14d)]?_0x56c603[_0x2c75c0(0xb0)](_0x2c8646[_0x2c75c0(0x14d)]['toString']())||'':'',_0x403df1=_0x41087d+':'+_0x2c8646['name'];if(_0x57614f[_0x2c75c0(0xda)](_0x403df1))return![];if(_0x4b3208)return _0x41087d===_0x51fe0e||_0x41087d[_0x2c75c0(0x13e)](_0x51fe0e+'/');return!![];});}export function findJourneysToDelete(_0x377ecc,_0x45ec90,_0x254266,_0x5f0a2f,_0x736811){const _0x55a3c9=a117_0x3948,_0x4f14d5=new Set();for(const {yamlConfig:_0x171e7f,folderPath:_0x4c296d}of _0x45ec90){_0x4f14d5['add'](_0x4c296d+':'+_0x171e7f[_0x55a3c9(0xb9)]);}return _0x377ecc[_0x55a3c9(0xdc)](_0x2df1ed=>{const _0x90b591=_0x55a3c9,_0x1f4412=_0x2df1ed[_0x90b591(0x10a)]?_0x254266['get'](_0x2df1ed[_0x90b591(0x10a)])||'':'',_0x4276fa=_0x1f4412+':'+_0x2df1ed[_0x90b591(0xbe)];if(_0x4f14d5[_0x90b591(0xda)](_0x4276fa))return![];if(_0x736811)return _0x1f4412===_0x5f0a2f||_0x1f4412[_0x90b591(0x13e)](_0x5f0a2f+'/');return!![];});}function a117_0x5407(){const _0x212d5d=['\x0a\x20\x20','getSegment','list','folder','createdSegmentId','attributes','logDeleted','sha1','updateActivation','idToEmailMap','\x20error(s)','errors','draft','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','onProgress','11398PNuHHg','Creating\x20activation\x20\x27','activationContext','../../utils/async.js','validatedRequest','push','with','parentId','createJourneySegment','deleteActivation','SEGMENT_UPDATE_ERROR','effectiveFolderId','embedded_segment_created','item','diff','activation_','getActivation','453380pLwEMm','journey','\x20segment\x20from\x20file:\x20','relative','size','Creating\x20segment\x20\x27','Entry\x20criteria:\x20','length','yamlActivation','startsWith','1059367lUCaRy','activations','Activation','journeyActivationStepId','\x20journey\x20from\x20file:\x20','segment_updated','stringify','journeys','dirname','data','update','rule','entry','./child-segment-yaml.js','segmentFolderId','\x27\x20exit\x20criteria','rootFolderId','4202960NOlMCe','activation_updating','\x20activation\x20\x27','getJourney','valid','includes','folder_created','all','versionNumber','entry_criteria','createActivation','toLowerCase','createFolder','isNew','type','existingSegment','folderPath','activationActions','5700864FQEnYp','milestone','activationStepsById','deps','trim','Name\x20has\x20already\x20been\x20taken','reduce','branches','behavior','\x27...','null','connector_config','stage\x20\x27','steps','sort','columns','Journey\x20\x27','Fetching\x20','all_columns','embedded_activation_created','DecisionPoint','activation_deleting','journey_updated','Updated\x20journey\x20\x27','listSegments','utf-8','max','split','journeyId','journey_creating','activation_deleted','schedule','entries','state','Failed\x20to\x20','Segment\x20not\x20found:\x20','Stage\x20\x27','updated','segmentNameToId','progress','journeyActivationNameToId','segment_updating','logInfo','description',').\x20','\x27\x20for\x20','fetchJourney','activationParams','Deleting\x20activation\x20\x27','flatMap','\x27\x20decision\x20point\x20branch\x20\x27','segmentId','existingSegments','skipSegments','11026799UASoJn','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','get','hex','index','absolutePath','parseDocument','keys','delete','INTERNAL','3txgWCx','name','object','NOT_FOUND','activationsBySegmentId','nameToType','journeyBundleName','journeyBundlesByFolderAndName','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','created','Created\x20journey\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Deleted\x20segment\x20\x27','embedded_segment_creating','Updated\x20activation\x20\x27','activation_template_id','buildUserMaps','waitCondition','SEGMENT_SYNTAX_ERROR','folderPathToId','existingJourney','JOURNEY_SYNTAX_ERROR','journeyStages','deleted','parentFolder','segmentByFolderAndName','logWarning','folder_creating','stages','deleteSegment','embedded_activation_creating','decision_point','toString','user','has','create','filter','replace','logSuccess','journey_updating','set','parse','\x27\x20from\x20file:\x20','WaitStep','slice','listActivations','map','connectionIdToNameMap','withProgress','journeyById','hasChanges','from','Activation\x20not\x20found:\x20','\x27\x20wait\x20condition','exitCriterias','\x27\x20entry\x20criteria','notification','createdSegmentIds','relationships','./journey-yaml.js','yamlConfig','add','ACTIVATION_SYNTAX_ERROR','activation_creating','Updating\x20activation\x20\x27','):\x20','find','embeddedSegmentNameToId','existingActivation','ACTIVATION_UPDATE_ERROR','goal\x20criteria','Created\x20segment\x20\x27','createSegment','segment_created','action','segment','parentSegmentFolder','\x20(referenced\x20in\x20journey\x20','segments','goal','SEGMENT_NOT_FOUND','resolveSegment','folderId','Updated\x20segment\x20\x27','entryCriteria','isArray','segment_creating','2328552LLgayI','kind','updateSegmentById','message','unchanged','join'];a117_0x5407=function(){return _0x212d5d;};return a117_0x5407();}export function buildSegmentLookupMap(_0x39d5c4,_0x397c4){const _0x44cbe3=a117_0x3948,_0xf6aa0f=new Map();for(const _0x264449 of _0x39d5c4){const _0xcc6ec=_0x264449[_0x44cbe3(0x14d)]?_0x397c4[_0x44cbe3(0xb0)](_0x264449['segmentFolderId'][_0x44cbe3(0xd8)]())||'':'',_0x20694a=_0xcc6ec+':'+_0x264449['name'];_0xf6aa0f['set'](_0x20694a,_0x264449);}return _0xf6aa0f;}export function buildSegmentNameToIdMap(_0x4453cb){const _0x5379fb=a117_0x3948,_0x32ba2f=new Map();for(const _0x40963e of _0x4453cb){_0x32ba2f['set'](_0x40963e[_0x5379fb(0xb9)],_0x40963e['id']);}return _0x32ba2f;}export function buildJourneyBundleLookupMap(_0x16c05d,_0x1ea98a){const _0x289ce1=a117_0x3948,_0x4f3f90=new Map();for(const _0x560c25 of _0x16c05d){const _0x320a1e=_0x560c25[_0x289ce1(0x10a)]?_0x1ea98a[_0x289ce1(0xb0)](_0x560c25[_0x289ce1(0x10a)])||'':'',_0x4b56e0=_0x320a1e+':'+_0x560c25[_0x289ce1(0xbe)];!_0x4f3f90[_0x289ce1(0xda)](_0x4b56e0)&&_0x4f3f90['set'](_0x4b56e0,[]),_0x4f3f90[_0x289ce1(0xb0)](_0x4b56e0)['push'](_0x560c25);}for(const _0x42a57e of _0x4f3f90['values']()){_0x42a57e[_0x289ce1(0x170)]((_0x4984fa,_0x7c4fa3)=>(_0x4984fa[_0x289ce1(0x158)]||0x0)-(_0x7c4fa3[_0x289ce1(0x158)]||0x0));}return _0x4f3f90;}export function collectFoldersToCreate(_0x253ca0,_0x532da1){const _0x26b14d=a117_0x3948,_0x4871ab=new Set();for(const _0x49310b of _0x253ca0){if(!_0x49310b)continue;if(_0x532da1[_0x26b14d(0xda)](_0x49310b))continue;const _0x2a722a=_0x49310b[_0x26b14d(0x17d)]('/');let _0x35e929='';for(const _0xd8544d of _0x2a722a){_0x35e929=_0x35e929?_0x35e929+'/'+_0xd8544d:_0xd8544d,!_0x532da1[_0x26b14d(0xda)](_0x35e929)&&_0x4871ab[_0x26b14d(0xf5)](_0x35e929);}}return _0x4871ab;}export function parseAndClassifyYamlFiles(_0x4c4aac,_0x1d37e5,_0x2a0ab9){const _0x1c0e07=a117_0x3948,_0x277eca=[],_0x4717be=[];for(const _0x32db20 of _0x4c4aac){const _0x1bcab4=a117_0x42768f['relative'](_0x1d37e5,a117_0x42768f[_0x1c0e07(0x147)](_0x32db20)),_0x1fc92b=_0x1bcab4==='.'?'':_0x1bcab4,_0x3b43f7=readFileSync(_0x32db20,_0x1c0e07(0x17b)),_0x1aa71f=a117_0x4ace2d[_0x1c0e07(0xe1)](_0x3b43f7);if(isJourneyDef(_0x1aa71f)){const _0x24b2f6=a117_0xaedc8f(_0x3b43f7);_0x4717be[_0x1c0e07(0x129)]({'yamlConfig':_0x24b2f6,'folderPath':_0x1fc92b,'sourcePath':_0x32db20});}else{if(!_0x2a0ab9?.[_0x1c0e07(0x197)]){const _0x1263bb=parseSegmentYamlFile(_0x3b43f7),_0x2db34d=normalizeChildSegmentYaml(_0x1263bb);_0x277eca['push']({'yamlConfig':_0x2db34d,'folderPath':_0x1fc92b,'sourcePath':_0x32db20});}}}return{'segments':_0x277eca,'journeys':_0x4717be};}export function validateParsedFiles(_0x50ed4e,_0x5034d3){const _0x5ded0f=a117_0x3948,_0x13f00f=[];for(const {yamlConfig:_0x56f878,sourcePath:_0xe989d}of _0x50ed4e[_0x5ded0f(0x106)]){const _0x4daf12=readFileSync(_0xe989d,_0x5ded0f(0x17b)),_0x14264b=a117_0x4ace2d['parseDocument'](_0x4daf12),_0x25051a=validateSegmentDef(_0x56f878,{'source':_0x4daf12,'document':_0x14264b});if(!_0x25051a[_0x5ded0f(0x154)]){const _0x3c3d28=a117_0x42768f[_0x5ded0f(0x138)](_0x5034d3,_0xe989d);_0x13f00f[_0x5ded0f(0x129)]({'filePath':_0x3c3d28,'source':_0x4daf12,'result':_0x25051a,'isJourney':![]});}}for(const {yamlConfig:_0x49d0cc,sourcePath:_0x3dabcd}of _0x50ed4e[_0x5ded0f(0x146)]){const _0x486cc0=readFileSync(_0x3dabcd,_0x5ded0f(0x17b)),_0x436fe5=a117_0x4ace2d[_0x5ded0f(0xb4)](_0x486cc0),_0xae3ce5=validateJourneyDef(_0x49d0cc,{'source':_0x486cc0,'document':_0x436fe5});if(!_0xae3ce5[_0x5ded0f(0x154)]){const _0x3ca010=a117_0x42768f['relative'](_0x5034d3,_0x3dabcd);_0x13f00f['push']({'filePath':_0x3ca010,'source':_0x486cc0,'result':_0xae3ce5,'isJourney':!![]});}}return _0x13f00f;}export function formatValidationErrors(_0x531b3e){const _0x2e41e=a117_0x3948,_0x2a5c38=[];for(const {filePath:_0x513b86,source:_0x2828b8,result:_0x103796,isJourney:_0x47e0a0}of _0x531b3e){const _0x3dc975=_0x47e0a0?_0x2e41e(0x136):'segment';_0x2a5c38[_0x2e41e(0x129)]('\x0a'+_0x513b86+'\x20('+_0x3dc975+_0x2e41e(0xf9)+_0x103796[_0x2e41e(0x120)][_0x2e41e(0x13c)]+_0x2e41e(0x11f)),_0x2a5c38[_0x2e41e(0x129)](formatValidationResult(_0x103796,_0x2828b8,_0x513b86));}return _0x2a5c38[_0x2e41e(0x114)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x469adf){const _0x1be9c9=a117_0x3948,_0x51104e=new Set(),_0x5c9f21=new Map(),_0x45ed0f=collectSegmentUsageCounts(_0x469adf);if(_0x469adf['segments'])for(const [_0x5a4df3,_0x143fec]of Object[_0x1be9c9(0x182)](_0x469adf['segments'])){_0x51104e[_0x1be9c9(0xf5)](_0x5a4df3);if(_0x143fec[_0x1be9c9(0x14a)]){const _0x4b1851=yamlRuleToApi(_0x143fec[_0x1be9c9(0x14a)]),_0x33a627=apiRuleToYaml(_0x4b1851);_0x5c9f21[_0x1be9c9(0xe0)](_0x5a4df3,_0x33a627);}}const _0x1f6727=new Map();let _0x395cf2=0x0;for(const [_0x5474a1,_0xa55c47]of _0x5c9f21){const _0x316c6f=serializeExpandedRule(_0xa55c47,_0x5c9f21),_0x520224=_0x1f6727[_0x1be9c9(0xb0)](_0x316c6f)||[];_0x520224[_0x1be9c9(0x129)]({'name':_0x5474a1,'index':_0x395cf2}),_0x1f6727['set'](_0x316c6f,_0x520224),_0x395cf2++;}const _0x1360c0=new Map();for(const [_0x1b2ccb,_0x419641]of _0x1f6727){const _0x27ca93=_0x419641['slice']()['sort']((_0xc0a328,_0x11c357)=>{const _0x129066=_0x1be9c9,_0x28a1c6=_0x45ed0f[_0x129066(0xb0)](_0xc0a328[_0x129066(0xb9)])||0x0,_0x42a663=_0x45ed0f[_0x129066(0xb0)](_0x11c357[_0x129066(0xb9)])||0x0;if(_0x28a1c6!==_0x42a663)return _0x42a663-_0x28a1c6;return _0xc0a328[_0x129066(0xb2)]-_0x11c357[_0x129066(0xb2)];})['map'](_0x1ee63c=>_0x1ee63c[_0x1be9c9(0xb9)]),_0x490b85=[];for(const _0x24126d of _0x27ca93){const _0x1a8df4=_0x45ed0f[_0x1be9c9(0xb0)](_0x24126d)||0x0,_0xc58037=Math[_0x1be9c9(0x17c)](_0x1a8df4,0x1);for(let _0x4b0e93=0x0;_0x4b0e93<_0xc58037;_0x4b0e93++){_0x490b85[_0x1be9c9(0x129)](_0x24126d);}}_0x1360c0['set'](_0x1b2ccb,_0x490b85);}return{'existingLocalSegmentNames':_0x51104e,'localSegmentRules':_0x5c9f21,'localExpandedRuleToNames':_0x1360c0};}async function buildServerSegmentRuleMap(_0x5c6a2e,_0xc3c3cc,_0x1538ab,_0x48e6e3){const _0x1f5e03=new Map(),_0x8c53f0=new Set(),_0x3fa107=async _0x288c85=>{const _0x1c934e=a117_0x3948;if(_0x8c53f0[_0x1c934e(0xda)](_0x288c85))return;_0x8c53f0[_0x1c934e(0xf5)](_0x288c85);let _0x43b821=_0x1538ab[_0x1c934e(0xfa)](_0x31bd98=>_0x31bd98['id']===_0x288c85);if(!_0x43b821)try{_0x43b821=await _0x5c6a2e[_0x1c934e(0x103)][_0x1c934e(0x116)](_0xc3c3cc,_0x288c85);}catch{return;}if(!_0x43b821?.[_0x1c934e(0x14a)])return;const _0x47fbb7=apiRuleToYaml(_0x43b821[_0x1c934e(0x14a)]);_0x1f5e03[_0x1c934e(0xe0)](_0x288c85,_0x47fbb7);const _0x44db9d=collectSegmentRefsFromRule(_0x47fbb7);for(const _0xe6c7d3 of _0x44db9d){await _0x3fa107(_0xe6c7d3);}};for(const _0x420048 of _0x48e6e3){await _0x3fa107(_0x420048);}return _0x1f5e03;}export function createSegmentIdResolver(_0x3ff916,_0x101e11){return async _0xb5f2cb=>{const _0xdeb874=a117_0x3948,_0xa55bf6=_0x3ff916[_0xdeb874(0xb0)](_0xb5f2cb);if(!_0xa55bf6)throw new SDKError(ErrorCode[_0xdeb874(0x108)],_0xdeb874(0x185)+_0xb5f2cb+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x101e11+'\x27)');return _0xa55bf6;};}export function extractRootFolderId(_0x47fc97){const _0x57f7d9=a117_0x3948;return _0x47fc97['relationships']?.[_0x57f7d9(0x104)]?.['data']?.['id']||_0x47fc97['relationships']?.[_0x57f7d9(0xd0)]?.[_0x57f7d9(0x148)]?.['id'];}export function buildConnectionMaps(_0x50a951){const _0x236a0c=a117_0x3948,_0xd2d32c=new Map(),_0x151189=new Map(),_0x26b7a8=new Map();for(const _0x3afc22 of _0x50a951){_0xd2d32c[_0x236a0c(0xe0)](_0x3afc22[_0x236a0c(0xb9)],parseInt(_0x3afc22['id'],0xa)),_0x151189['set'](_0x3afc22['id'],_0x3afc22['name']),_0x26b7a8['set'](_0x3afc22[_0x236a0c(0xb9)],_0x3afc22[_0x236a0c(0x15e)]);}return{'nameToId':_0xd2d32c,'idToName':_0x151189,'nameToType':_0x26b7a8};}export function calculatePushStats(_0x48c199,_0xfc0faf,_0x2bf140,_0x42d6eb,_0x3bfe38,_0x2f8d5f,_0x32201c){const _0x528c58=a117_0x3948,_0x22dc4e=_0x48c199[_0x528c58(0xdc)](_0x2fdb4f=>_0x2fdb4f[_0x528c58(0x15d)]),_0x469c36=_0x48c199[_0x528c58(0xdc)](_0x584075=>!_0x584075[_0x528c58(0x15d)]&&_0x584075['hasChanges']),_0xc5e1=_0x48c199[_0x528c58(0xdc)](_0x3e5398=>!_0x3e5398[_0x528c58(0x15d)]&&!_0x3e5398[_0x528c58(0xea)]),_0x579a78=_0x2f8d5f?_0x42d6eb:[],_0x580d5b=_0xfc0faf[_0x528c58(0xdc)](_0x55de9e=>_0x55de9e[_0x528c58(0x15d)]),_0x5e02f5=_0xfc0faf[_0x528c58(0xdc)](_0x2f5be8=>!_0x2f5be8[_0x528c58(0x15d)]&&_0x2f5be8['hasChanges']),_0x1b4fcf=_0xfc0faf[_0x528c58(0xdc)](_0x52c9d9=>!_0x52c9d9[_0x528c58(0x15d)]&&!_0x52c9d9[_0x528c58(0xea)]),_0x596304=_0x2f8d5f?_0x3bfe38:[],_0x6986c1=_0x48c199[_0x528c58(0x193)](_0xc42dba=>_0xc42dba[_0x528c58(0x161)]),_0x1f26c6=_0x6986c1[_0x528c58(0xdc)](_0x3ea7b4=>_0x3ea7b4[_0x528c58(0x15e)]===_0x528c58(0xdb)),_0x39030b=_0x6986c1[_0x528c58(0xdc)](_0xb5803a=>_0xb5803a[_0x528c58(0x15e)]===_0x528c58(0x149)),_0x5d6940=_0x6986c1[_0x528c58(0xdc)](_0x127cd4=>_0x127cd4[_0x528c58(0x15e)]===_0x528c58(0xb6)),_0x4faa01=Array[_0x528c58(0xeb)](_0x2bf140)[_0x528c58(0x170)](),_0x44e26b=_0x32201c?![]:_0x22dc4e[_0x528c58(0x13c)]>0x0||_0x469c36[_0x528c58(0x13c)]>0x0||_0x579a78[_0x528c58(0x13c)]>0x0,_0x1a4902=_0x580d5b[_0x528c58(0x13c)]>0x0||_0x5e02f5['length']>0x0||_0x596304[_0x528c58(0x13c)]>0x0,_0x2d39ba=_0x32201c?![]:_0x6986c1[_0x528c58(0x13c)]>0x0,_0x306f7e=_0x4faa01[_0x528c58(0x13c)]>0x0;return{'segments':{'new':_0x22dc4e,'changed':_0x469c36,'unchanged':_0xc5e1,'toDelete':_0x579a78},'journeys':{'new':_0x580d5b,'changed':_0x5e02f5,'unchanged':_0x1b4fcf,'toDelete':_0x596304},'activations':{'all':_0x6986c1,'toCreate':_0x1f26c6,'toUpdate':_0x39030b,'toDelete':_0x5d6940},'folders':{'toCreate':_0x4faa01},'counts':{'segments':{'new':_0x22dc4e[_0x528c58(0x13c)],'changed':_0x469c36[_0x528c58(0x13c)],'unchanged':_0xc5e1['length'],'toDelete':_0x579a78[_0x528c58(0x13c)]},'journeys':{'new':_0x580d5b[_0x528c58(0x13c)],'changed':_0x5e02f5[_0x528c58(0x13c)],'unchanged':_0x1b4fcf['length'],'toDelete':_0x596304['length']},'activations':{'create':_0x1f26c6[_0x528c58(0x13c)],'update':_0x39030b[_0x528c58(0x13c)],'delete':_0x5d6940['length']},'folders':_0x4faa01['length']},'hasChanges':_0x44e26b||_0x1a4902||_0x2d39ba||_0x306f7e};}export async function buildPushExecutionContext(_0x57d2a5,_0x5692cb,_0x19544c,_0x35d7eb,_0x5c23d2,_0x667cd9){const _0x3ab7d3=a117_0x3948,_0x4571bc=extractRootFolderId(_0x19544c),{pathToId:_0x55de44,idToPath:_0x1c1d37}=buildFolderMaps(_0x5c23d2),_0x1e8aeb=buildSegmentNameToIdMap(_0x35d7eb),_0x4fc665=new Map(),{batchAsync:_0x3e8ec6}=await import(_0x3ab7d3(0x127)),[_0x1c8268,_0xbfc85]=await Promise[_0x3ab7d3(0x157)]([_0x57d2a5[_0x3ab7d3(0xd9)][_0x3ab7d3(0xc8)](),_0x57d2a5['connection'][_0x3ab7d3(0x117)](),((async()=>{const _0x34f0a3=_0x3ab7d3;!_0x667cd9&&_0x35d7eb[_0x34f0a3(0x13c)]>0x0&&await _0x3e8ec6(_0x35d7eb,async _0x281342=>{const _0x25c887=await _0x57d2a5['segment']['listActivations'](_0x5692cb,_0x281342['id']);_0x4fc665['set'](_0x281342['id'],_0x25c887);});})())]),{emailToId:_0x22b543,idToEmail:_0x5cebe5}=_0x1c8268,_0x4bd10a=buildConnectionMaps(_0xbfc85);return{'rootFolderId':_0x4571bc,'folderPathToId':_0x55de44,'folderIdToPath':_0x1c1d37,'segmentNameToId':_0x1e8aeb,'activationsBySegmentId':_0x4fc665,'emailToIdMap':_0x22b543,'idToEmailMap':_0x5cebe5,'connectionNameToIdMap':_0x4bd10a['nameToId'],'connectionIdToNameMap':_0x4bd10a['idToName'],'connectionNameToTypeMap':_0x4bd10a[_0x3ab7d3(0xbd)]};}export function createPushYamlContextForBundle(_0x1c2bca,_0x38e364,_0x445fae,_0x3312ba,_0x5f3573,_0x26625b,_0x5c2631,_0x3419c4){const {existingLocalSegmentNames:_0x59b751,localExpandedRuleToNames:_0x2cffc0}=_0x3312ba,_0x1aa048=new Set(),_0x38c0d6=new Map(),_0x580012=new Map(),_0x2f5d9e=new Map(),_0x48a202=createJumpTargetCache(),_0x59309a=new Map(),_0x347857=new Map(),_0x23a3f3=new Set();let _0x320aff;const _0x2305bd=_0x585e78=>{const _0x38d092={'resolveSegment':async _0xfbbdf2=>{const _0x29899e=a117_0x3948,_0x2a85b1=_0x2f5d9e['get'](_0xfbbdf2);if(_0x2a85b1!==undefined)return{'name':_0x2a85b1,'isJourneyLocal':!![]};try{let _0x259471=_0x445fae[_0x29899e(0xfa)](_0x10e08a=>_0x10e08a['id']===_0xfbbdf2);!_0x259471&&(_0x259471=await _0x1c2bca[_0x29899e(0x103)][_0x29899e(0x116)](_0x38e364,_0xfbbdf2));const _0x4164aa=generateJourneyLocalName(_0x259471[_0x29899e(0xb9)]),_0x326047=_0x259471[_0x29899e(0x110)]===SEGMENT_KIND_JOURNEY&&_0x4164aa!==undefined;let _0x31c14d=_0x259471[_0x29899e(0xb9)],_0x1b6861;if(_0x326047&&_0x259471[_0x29899e(0x14a)]){const _0x3536e3=apiRuleToYaml(_0x259471[_0x29899e(0x14a)]);_0x347857[_0x29899e(0xe0)](_0xfbbdf2,_0x3536e3);const _0x4813ba=async _0x3f0b84=>{const _0x59c9b7=_0x29899e,_0x356d85=collectSegmentRefsFromRule(_0x3f0b84);for(const _0x1aea78 of _0x356d85){if(!_0x347857[_0x59c9b7(0xda)](_0x1aea78))try{const _0x37e3ff=await _0x1c2bca['segment'][_0x59c9b7(0x116)](_0x38e364,_0x1aea78);if(_0x37e3ff?.['rule']){const _0x143387=apiRuleToYaml(_0x37e3ff['rule']);_0x347857[_0x59c9b7(0xe0)](_0x1aea78,_0x143387),await _0x4813ba(_0x143387);}}catch{}}};await _0x4813ba(_0x3536e3);const _0x4dbac7=serializeExpandedRule(_0x3536e3,_0x347857),_0x3bd98f=_0x2cffc0[_0x29899e(0xb0)](_0x4dbac7);if(_0x3bd98f&&_0x3bd98f[_0x29899e(0x13c)]>0x0){const _0x284f62=_0x38c0d6[_0x29899e(0xb0)](_0x4dbac7)||0x0,_0x4fc021=_0x3bd98f[_0x284f62]||_0x3bd98f[_0x3bd98f[_0x29899e(0x13c)]-0x1];_0x38c0d6[_0x29899e(0xe0)](_0x4dbac7,_0x284f62+0x1),_0x31c14d=_0x4fc021,_0x1aa048[_0x29899e(0xf5)](_0x31c14d),_0x2f5d9e[_0x29899e(0xe0)](_0xfbbdf2,_0x31c14d);const _0x11da50=await resolveRuleSegmentRefs(_0x3536e3,async _0x3fe092=>{const _0x214918=_0x29899e,_0x219893=_0x2f5d9e['get'](_0x3fe092);if(_0x219893)return _0x219893;const _0x450685=await _0x320aff[_0x214918(0x109)](_0x3fe092);return _0x450685['name'];});_0x1b6861={'description':_0x259471[_0x29899e(0x18d)],'rule':_0x11da50};}else{const _0x15ffb1=_0x59309a[_0x29899e(0xb0)](_0x4dbac7);if(_0x15ffb1)_0x31c14d=_0x15ffb1,_0x2f5d9e[_0x29899e(0xe0)](_0xfbbdf2,_0x31c14d);else{if(_0x4164aa){let _0x10bcad=_0x4164aa,_0x3302ad=0x2;while(_0x1aa048[_0x29899e(0xda)](_0x10bcad)||_0x59b751[_0x29899e(0xda)](_0x10bcad)){_0x10bcad=_0x4164aa+'_'+_0x3302ad,_0x3302ad++;}_0x1aa048[_0x29899e(0xf5)](_0x10bcad),_0x31c14d=_0x10bcad;}_0x2f5d9e['set'](_0xfbbdf2,_0x31c14d),_0x59309a[_0x29899e(0xe0)](_0x4dbac7,_0x31c14d);const _0x155f19=await resolveRuleSegmentRefs(_0x3536e3,async _0x311c1a=>{const _0x24c3f2=_0x29899e,_0x348460=_0x2f5d9e['get'](_0x311c1a);if(_0x348460)return _0x348460;const _0x3dac47=await _0x320aff[_0x24c3f2(0x109)](_0x311c1a);return _0x3dac47[_0x24c3f2(0xb9)];});_0x1b6861={'description':_0x259471[_0x29899e(0x18d)],'rule':_0x155f19};}}}return{'name':_0x31c14d,'isJourneyLocal':_0x326047,'definition':_0x1b6861};}catch{return{'name':_0xfbbdf2,'isJourneyLocal':![]};}},'resolveActivation':async _0x4dbbc0=>{const _0x370346=a117_0x3948,_0x3aab98=_0x580012[_0x370346(0xb0)](_0x4dbbc0);if(_0x3aab98!==undefined)return{'name':_0x3aab98,'isJourneyLocal':!![]};try{let _0x166bce=_0x5c2631?.[_0x370346(0xb0)](_0x4dbbc0);!_0x166bce&&(_0x166bce=await _0x1c2bca[_0x370346(0x136)][_0x370346(0x134)](_0x585e78,_0x4dbbc0));const _0x3f0697=_0x166bce[_0x370346(0x11a)][_0x370346(0x191)][_0x370346(0xb9)]||_0x4dbbc0,_0x4ec1b8=sanitizeYamlKey(_0x3f0697)||_0x370346(0x133)+_0x4dbbc0,_0x32654c=_0x4ec1b8;_0x580012[_0x370346(0xe0)](_0x4dbbc0,_0x32654c);const _0x14074c=journeyActivationStepToYaml(_0x166bce,_0x5f3573,_0x26625b);return{'name':_0x32654c,'isJourneyLocal':!![],'definition':_0x14074c};}catch{return{'name':_0x4dbbc0,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xf04477,_0x29e0c3)=>resolveJumpTarget(_0xf04477,_0x29e0c3,_0x48a202,async _0x2ee775=>{const _0x1f8c9e=a117_0x3948,_0x591864=_0x3419c4?.['get'](_0x2ee775);if(_0x591864)return _0x591864;return _0x1c2bca[_0x1f8c9e(0x136)][_0x1f8c9e(0x153)](_0x2ee775);})};return _0x320aff=_0x38d092,_0x38d092;},_0x4cfcef=async _0x4caf1a=>{const _0xa62f84=a117_0x3948,{collectSegmentIdsFromJourneyApi:_0x2e6165}=await import(_0xa62f84(0xf3)),{batchAsync:_0x2c5cc9}=await import('../../utils/async.js'),_0x3caaf0=new Set();for(const _0x5a2e18 of _0x4caf1a){let _0x37e362=_0x3419c4?.[_0xa62f84(0xb0)](_0x5a2e18);!_0x37e362&&(_0x37e362=await _0x1c2bca[_0xa62f84(0x136)][_0xa62f84(0x153)](_0x5a2e18));const _0x97246b=_0x2e6165(_0x37e362);for(const _0x12854e of _0x97246b){_0x3caaf0[_0xa62f84(0xf5)](_0x12854e);}}let _0x1f4916=Array[_0xa62f84(0xeb)](_0x3caaf0);while(_0x1f4916[_0xa62f84(0x13c)]>0x0){const _0x40513c=_0x1f4916['filter'](_0x590c40=>!_0x23a3f3[_0xa62f84(0xda)](_0x590c40));if(_0x40513c[_0xa62f84(0x13c)]===0x0)break;const _0x5692c5=await _0x2c5cc9(_0x40513c,async _0x287375=>{const _0x1b0a94=_0xa62f84;_0x23a3f3[_0x1b0a94(0xf5)](_0x287375);let _0x2c9e49=_0x445fae[_0x1b0a94(0xfa)](_0x4d5b20=>_0x4d5b20['id']===_0x287375);if(!_0x2c9e49)try{_0x2c9e49=await _0x1c2bca['segment'][_0x1b0a94(0x116)](_0x38e364,_0x287375);}catch{return null;}return{'segmentId':_0x287375,'segment':_0x2c9e49};},0xa),_0x5bcdde=new Set();for(const _0x1f789c of _0x5692c5){if(!_0x1f789c?.[_0xa62f84(0x103)]?.[_0xa62f84(0x14a)])continue;const _0x347166=apiRuleToYaml(_0x1f789c[_0xa62f84(0x103)][_0xa62f84(0x14a)]);_0x347857[_0xa62f84(0xe0)](_0x1f789c[_0xa62f84(0x195)],_0x347166);const _0x5c1d0d=collectSegmentRefsFromRule(_0x347166);for(const _0x12a465 of _0x5c1d0d){!_0x23a3f3[_0xa62f84(0xda)](_0x12a465)&&_0x5bcdde[_0xa62f84(0xf5)](_0x12a465);}}_0x1f4916=Array['from'](_0x5bcdde);}};return{'createYamlContext':_0x2305bd,'prefetchJourneySegments':_0x4cfcef};}export async function executePushSegments(_0x56e2b1,_0x29e551,_0x171a1f,_0x24156f,_0xafad9d){const _0x3b90f3=a117_0x3948,{segmentDefToCreateRequest:_0xace74c,segmentDefToUpdateRequest:_0x52e9cb}=await import('./child-segment-yaml.js'),_0x40b593=_0x171a1f[_0x3b90f3(0xcb)],_0x431e84=0x5,_0x3bff1d=async _0x4509b9=>{const _0x2998aa=_0x3b90f3,_0x2884f7=_0x4509b9[_0x2998aa(0x160)]?_0x40b593['get'](_0x4509b9[_0x2998aa(0x160)]):undefined;let _0x1ff322;const _0x21013c={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x4509b9[_0x2998aa(0x15d)]){_0xafad9d['onProgress']?.({'type':_0x2998aa(0x10e),'name':_0x4509b9[_0x2998aa(0xf4)]['name']});const _0x18bbad=_0xace74c(_0x4509b9['yamlConfig'],_0x2884f7),_0x586b80=await _0xafad9d[_0x2998aa(0xe8)](_0x2998aa(0x13a)+_0x4509b9['yamlConfig'][_0x2998aa(0xb9)]+'\x27...',()=>_0x56e2b1[_0x2998aa(0x103)][_0x2998aa(0x100)](_0x24156f[_0x2998aa(0x12b)],_0x18bbad));_0x1ff322=_0x586b80[_0x2998aa(0x148)]['id'],_0x21013c[_0x2998aa(0x119)]={'name':_0x4509b9[_0x2998aa(0xf4)][_0x2998aa(0xb9)],'id':_0x1ff322},_0xafad9d[_0x2998aa(0x123)]?.({'type':_0x2998aa(0x101),'name':_0x4509b9[_0x2998aa(0xf4)]['name'],'segmentId':_0x1ff322}),_0xafad9d[_0x2998aa(0xde)]?.(_0x2998aa(0xff)+_0x4509b9[_0x2998aa(0xf4)][_0x2998aa(0xb9)]+'\x27'),_0x21013c['created']=0x1;}else{if(_0x4509b9[_0x2998aa(0xea)]){_0xafad9d[_0x2998aa(0x123)]?.({'type':_0x2998aa(0x18b),'name':_0x4509b9[_0x2998aa(0xf4)]['name']});const _0x3a3316=_0x52e9cb(_0x4509b9['yamlConfig']);_0x2884f7!==_0x4509b9[_0x2998aa(0x15f)]?.[_0x2998aa(0x14d)]&&(_0x3a3316[_0x2998aa(0x14d)]=_0x2884f7?parseInt(_0x2884f7,0xa):undefined),await _0xafad9d['withProgress']('Updating\x20segment\x20\x27'+_0x4509b9['yamlConfig']['name']+'\x27...',()=>_0x56e2b1[_0x2998aa(0x103)][_0x2998aa(0x111)](_0x24156f[_0x2998aa(0x12b)],_0x4509b9[_0x2998aa(0x15f)]['id'],_0x3a3316)),_0x1ff322=_0x4509b9[_0x2998aa(0x15f)]['id'],_0xafad9d[_0x2998aa(0x123)]?.({'type':_0x2998aa(0x144),'name':_0x4509b9[_0x2998aa(0xf4)]['name']}),_0xafad9d[_0x2998aa(0xde)]?.(_0x2998aa(0x10b)+_0x4509b9[_0x2998aa(0xf4)]['name']+'\x27'),_0x21013c[_0x2998aa(0x187)]=0x1;}else _0x1ff322=_0x4509b9[_0x2998aa(0x15f)]['id'];}}catch(_0xe66283){const _0x3a8fee=isHttp400Error(_0xe66283),_0x27b0d8=_0x3a8fee?ErrorCode[_0x2998aa(0xca)]:ErrorCode[_0x2998aa(0x12e)],_0x24ce37=getErrorMessage(_0xe66283);throw new SDKError(_0x27b0d8,_0x2998aa(0x184)+(_0x4509b9['isNew']?_0x2998aa(0xdb):_0x2998aa(0x149))+_0x2998aa(0x137)+_0x4509b9[_0x2998aa(0xb3)]+_0x2998aa(0x115)+_0x24ce37,_0xe66283);}try{const _0x283521=await syncActivationsForSegment(_0x56e2b1,_0x24156f[_0x2998aa(0x12b)],_0x1ff322,_0x4509b9[_0x2998aa(0xf4)][_0x2998aa(0xb9)],_0x4509b9['activationActions'],_0xafad9d,_0x4509b9[_0x2998aa(0xb3)]);_0x21013c[_0x2998aa(0x140)]=_0x283521;}catch(_0x46049a){if(_0x46049a instanceof SDKError)throw _0x46049a;throw new SDKError(ErrorCode[_0x2998aa(0xfd)],_0x2998aa(0x122)+_0x4509b9['yamlConfig']['name']+_0x2998aa(0xe2)+_0x4509b9[_0x2998aa(0xb3)]+_0x2998aa(0x115)+getErrorMessage(_0x46049a),_0x46049a);}return _0x21013c;},_0x31d866=await batchAsync(_0x29e551,_0x3bff1d,_0x431e84),_0x159b90={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5bcd53 of _0x31d866){_0x159b90[_0x3b90f3(0xc1)]+=_0x5bcd53[_0x3b90f3(0xc1)],_0x159b90[_0x3b90f3(0x187)]+=_0x5bcd53[_0x3b90f3(0x187)],_0x5bcd53[_0x3b90f3(0x119)]&&_0x159b90[_0x3b90f3(0xf1)][_0x3b90f3(0xe0)](_0x5bcd53[_0x3b90f3(0x119)][_0x3b90f3(0xb9)],_0x5bcd53[_0x3b90f3(0x119)]['id']),_0x159b90[_0x3b90f3(0x140)][_0x3b90f3(0xc1)]+=_0x5bcd53[_0x3b90f3(0x140)][_0x3b90f3(0xc1)],_0x159b90[_0x3b90f3(0x140)][_0x3b90f3(0x187)]+=_0x5bcd53[_0x3b90f3(0x140)][_0x3b90f3(0x187)],_0x159b90[_0x3b90f3(0x140)][_0x3b90f3(0xcf)]+=_0x5bcd53[_0x3b90f3(0x140)]['deleted'];}return _0x159b90;}async function syncActivationsForSegment(_0x28229e,_0x3ecf17,_0x4f1f06,_0x13ef0f,_0x211991,_0x3c5c60,_0x382520){const _0x39ec3e=a117_0x3948,_0x748ea1={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x203e8a of _0x211991){try{if(_0x203e8a[_0x39ec3e(0x15e)]===_0x39ec3e(0xdb)&&_0x203e8a[_0x39ec3e(0x128)])_0x3c5c60[_0x39ec3e(0x123)]?.({'type':_0x39ec3e(0xf7),'segmentName':_0x13ef0f,'activationName':_0x203e8a[_0x39ec3e(0xb9)]}),await _0x3c5c60[_0x39ec3e(0xe8)](_0x39ec3e(0x125)+_0x203e8a['name']+_0x39ec3e(0x16b),()=>_0x28229e[_0x39ec3e(0x103)][_0x39ec3e(0x15a)](_0x3ecf17,_0x4f1f06,_0x203e8a[_0x39ec3e(0x128)])),_0x3c5c60[_0x39ec3e(0x123)]?.({'type':'activation_created','segmentName':_0x13ef0f,'activationName':_0x203e8a[_0x39ec3e(0xb9)]}),_0x3c5c60[_0x39ec3e(0xde)]?.('Created\x20activation\x20\x27'+_0x203e8a[_0x39ec3e(0xb9)]+'\x27'),_0x748ea1[_0x39ec3e(0xc1)]++;else{if(_0x203e8a[_0x39ec3e(0x15e)]===_0x39ec3e(0x149)&&_0x203e8a[_0x39ec3e(0x128)]&&_0x203e8a[_0x39ec3e(0xfc)])_0x3c5c60[_0x39ec3e(0x123)]?.({'type':_0x39ec3e(0x151),'segmentName':_0x13ef0f,'activationName':_0x203e8a[_0x39ec3e(0xb9)]}),await _0x3c5c60[_0x39ec3e(0xe8)](_0x39ec3e(0xf8)+_0x203e8a[_0x39ec3e(0xb9)]+'\x27...',()=>_0x28229e[_0x39ec3e(0x103)][_0x39ec3e(0x11d)](_0x3ecf17,_0x4f1f06,_0x203e8a[_0x39ec3e(0xfc)]['id'],_0x203e8a[_0x39ec3e(0x128)])),_0x3c5c60[_0x39ec3e(0x123)]?.({'type':'activation_updated','segmentName':_0x13ef0f,'activationName':_0x203e8a[_0x39ec3e(0xb9)]}),_0x3c5c60[_0x39ec3e(0xde)]?.(_0x39ec3e(0xc6)+_0x203e8a['name']+'\x27'),_0x748ea1[_0x39ec3e(0x187)]++;else _0x203e8a[_0x39ec3e(0x15e)]===_0x39ec3e(0xb6)&&_0x203e8a[_0x39ec3e(0xfc)]&&(_0x3c5c60[_0x39ec3e(0x123)]?.({'type':_0x39ec3e(0x177),'segmentName':_0x13ef0f,'activationName':_0x203e8a[_0x39ec3e(0xb9)]}),await _0x3c5c60[_0x39ec3e(0xe8)](_0x39ec3e(0x192)+_0x203e8a[_0x39ec3e(0xb9)]+_0x39ec3e(0x16b),()=>_0x28229e[_0x39ec3e(0x103)][_0x39ec3e(0x12d)](_0x3ecf17,_0x4f1f06,_0x203e8a[_0x39ec3e(0xfc)]['id'])),_0x3c5c60[_0x39ec3e(0x123)]?.({'type':_0x39ec3e(0x180),'segmentName':_0x13ef0f,'activationName':_0x203e8a['name']}),_0x3c5c60[_0x39ec3e(0x11b)]?.('Deleted\x20activation\x20\x27'+_0x203e8a[_0x39ec3e(0xb9)]+'\x27'),_0x748ea1[_0x39ec3e(0xcf)]++);}}catch(_0x44cdd0){const _0x5e8165=isHttp400Error(_0x44cdd0),_0x330895=_0x5e8165?ErrorCode[_0x39ec3e(0xf6)]:ErrorCode[_0x39ec3e(0xfd)],_0x487d8f=getErrorMessage(_0x44cdd0);throw new SDKError(_0x330895,'Failed\x20to\x20'+_0x203e8a[_0x39ec3e(0x15e)]+_0x39ec3e(0x152)+_0x203e8a[_0x39ec3e(0xb9)]+_0x39ec3e(0xe2)+_0x382520+_0x39ec3e(0x115)+_0x487d8f,_0x44cdd0);}}return _0x748ea1;}export async function executePushFolders(_0x28ed47,_0x4be5af,_0x305262,_0x353350,_0x5b6809){const _0x3df13c=a117_0x3948,_0x1f6450=new Map(_0x305262);for(const _0x5c65b3 of _0x4be5af){const _0x3344fe=_0x5c65b3['split']('/'),_0x38196f=_0x3344fe[_0x3344fe[_0x3df13c(0x13c)]-0x1],_0x2b1f8b=_0x3344fe[_0x3df13c(0xe4)](0x0,-0x1)[_0x3df13c(0x114)]('/'),_0x58eeaf=_0x1f6450['get'](_0x2b1f8b);_0x5b6809[_0x3df13c(0x123)]?.({'type':_0x3df13c(0xd3),'folder':_0x5c65b3});const _0x30aa37={'name':_0x38196f,'parentFolderId':_0x58eeaf},_0x5d145a=await _0x5b6809[_0x3df13c(0xe8)]('Creating\x20folder\x20\x27'+_0x5c65b3+'\x27...',()=>_0x28ed47[_0x3df13c(0x103)][_0x3df13c(0x15c)](_0x353350['parentId'],_0x30aa37));_0x1f6450[_0x3df13c(0xe0)](_0x5c65b3,_0x5d145a[_0x3df13c(0x148)]['id']),_0x5b6809[_0x3df13c(0x123)]?.({'type':_0x3df13c(0x156),'folder':_0x5c65b3,'folderId':_0x5d145a[_0x3df13c(0x148)]['id']}),_0x5b6809[_0x3df13c(0x18c)]?.('Created\x20folder\x20\x27'+_0x5c65b3+'\x27');}return _0x1f6450;}export async function executePushSegmentDeletions(_0xbd87af,_0xb0c268,_0x58674e){const _0x488477=a117_0x3948;if(_0xb0c268[_0x488477(0x13c)]===0x0)return 0x0;const {batchAsync:_0x4ead3e}=await import('../../utils/async.js'),_0x5372c5=0x5,_0x891511=await _0x4ead3e(_0xb0c268,async _0x4f506d=>{const _0x1fb3e9=_0x488477;return _0x58674e[_0x1fb3e9(0x123)]?.({'type':'segment_deleting','name':_0x4f506d['name']}),await _0xbd87af[_0x1fb3e9(0x103)][_0x1fb3e9(0xd5)](_0x4f506d['id']),_0x58674e['onProgress']?.({'type':'segment_deleted','name':_0x4f506d[_0x1fb3e9(0xb9)]}),_0x58674e[_0x1fb3e9(0x11b)]?.(_0x1fb3e9(0xc4)+_0x4f506d['name']+'\x27'),0x1;},_0x5372c5);return _0x891511[_0x488477(0x168)]((_0x1cc1b1,_0x4c2c06)=>_0x1cc1b1+_0x4c2c06,0x0);}export async function executePushJourneys(_0x58a280,_0x4e1b17,_0x3ef15b,_0x161631,_0x345ab2){const _0xf74812=a117_0x3948,{journeyDefToRequest:_0x29465c}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x5a8b88,yamlRuleToApi:_0x1db553,validateSegmentRule:_0x5efa29}=await import('./child-segment-yaml.js'),_0x3da07f={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1adb5a=new Map(_0x3ef15b[_0xf74812(0x188)]),_0x47e868=0x5;for(let _0x5207ee=0x0;_0x5207ee<_0x4e1b17[_0xf74812(0x13c)];_0x5207ee+=_0x47e868){const _0x3fb2f0=_0x4e1b17['slice'](_0x5207ee,_0x5207ee+_0x47e868),_0x1ad493=await Promise[_0xf74812(0x157)](_0x3fb2f0[_0xf74812(0xe6)](async _0x25dfbe=>{const _0x21f944=_0xf74812;if(!_0x25dfbe[_0x21f944(0x15d)]&&!_0x25dfbe['hasChanges'])return{'action':_0x21f944(0x113),'name':_0x25dfbe[_0x21f944(0xf4)]['name'],'journeyId':_0x25dfbe[_0x21f944(0xcc)]?.['id']};const _0x42cb54=_0x25dfbe[_0x21f944(0x160)]?_0x3ef15b[_0x21f944(0xcb)][_0x21f944(0xb0)](_0x25dfbe[_0x21f944(0x160)]):undefined;_0x345ab2['onProgress']?.({'type':_0x25dfbe[_0x21f944(0x15d)]?_0x21f944(0x17f):_0x21f944(0xdf),'name':_0x25dfbe[_0x21f944(0xf4)]['name']});try{const _0x15882c=await executeSingleJourneyPush(_0x58a280,_0x25dfbe,{..._0x3ef15b,'segmentNameToId':_0x1adb5a},{'parentId':_0x161631['parentId'],'rootFolderId':_0x161631[_0x21f944(0x14f)],'folderId':_0x42cb54,'verbose':_0x161631['verbose']},_0x345ab2,{'journeyDefToRequest':_0x29465c,'activationDefToCreateRequest':_0x5a8b88,'yamlRuleToApi':_0x1db553,'validateSegmentRule':_0x5efa29});for(const [_0x53f7da,_0x3a7105]of _0x15882c[_0x21f944(0xfb)]){_0x1adb5a[_0x21f944(0xe0)](_0x53f7da,_0x3a7105),_0x3da07f[_0x21f944(0xfb)]['set'](_0x53f7da,_0x3a7105);}if(_0x15882c['action']===_0x21f944(0xc1))_0x345ab2[_0x21f944(0x123)]?.({'type':'journey_created','name':_0x25dfbe['yamlConfig']['name'],'journeyId':_0x15882c[_0x21f944(0x17e)]}),_0x345ab2[_0x21f944(0xde)]?.(_0x21f944(0xc2)+_0x25dfbe[_0x21f944(0xf4)][_0x21f944(0xb9)]+'\x27'),_0x3da07f[_0x21f944(0xc1)]++;else _0x15882c[_0x21f944(0x102)]===_0x21f944(0x187)&&(_0x345ab2[_0x21f944(0x123)]?.({'type':_0x21f944(0x178),'name':_0x25dfbe[_0x21f944(0xf4)][_0x21f944(0xb9)]}),_0x345ab2[_0x21f944(0xde)]?.(_0x21f944(0x179)+_0x25dfbe['yamlConfig'][_0x21f944(0xb9)]+'\x27'),_0x3da07f[_0x21f944(0x187)]++);return{'action':_0x15882c[_0x21f944(0x102)],'name':_0x25dfbe[_0x21f944(0xf4)][_0x21f944(0xb9)],'journeyId':_0x15882c[_0x21f944(0x17e)]};}catch(_0x3f75cb){const _0x1a4833=isHttp400Error(_0x3f75cb),_0x10ddec=_0x1a4833?ErrorCode[_0x21f944(0xcd)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x46aa20=getErrorMessage(_0x3f75cb);throw new SDKError(_0x10ddec,_0x21f944(0x184)+(_0x25dfbe[_0x21f944(0x15d)]?_0x21f944(0xdb):_0x21f944(0x149))+_0x21f944(0x143)+_0x25dfbe[_0x21f944(0xb3)]+_0x21f944(0x115)+_0x46aa20,_0x3f75cb);}}));_0x3da07f['results'][_0xf74812(0x129)](..._0x1ad493);}return _0x3da07f;}async function executeSingleJourneyPush(_0x5de33b,_0x56b229,_0x32ba79,_0x322155,_0x1b6963,_0x4168e7){const _0x5af640=a117_0x3948,{journeyDefToRequest:_0x577864,activationDefToCreateRequest:_0x14b3f0,yamlRuleToApi:_0x58545b,validateSegmentRule:_0x516e5e}=_0x4168e7,_0x3e2910=new Map(),_0x105dad=new Map(),_0x8ae3aa=new Map(),_0xd640d=new Map(),_0x4cc0f6=new Map();let _0xc1171;const _0x54a890=async()=>{const _0x467d3a=a117_0x3948;if(_0xc1171)return;_0xc1171=new Map();if(!_0x56b229[_0x467d3a(0xcc)])return;const _0x4ac248=await _0x5de33b[_0x467d3a(0x136)][_0x467d3a(0xe5)](_0x56b229[_0x467d3a(0xcc)]['id']);for(const _0x40ba37 of _0x4ac248){const _0x49894b=journeyActivationStepToYaml(_0x40ba37,_0x32ba79['idToEmailMap'],_0x32ba79[_0x467d3a(0xe7)]),_0x169db2=activationSignature(_0x49894b);!_0xc1171[_0x467d3a(0xda)](_0x169db2)&&_0xc1171['set'](_0x169db2,_0x40ba37['id']),_0x49894b[_0x467d3a(0xb9)]&&_0x105dad['set'](_0x49894b[_0x467d3a(0xb9)],_0x40ba37['id']);}};if(_0x56b229[_0x5af640(0xcc)]&&_0x56b229[_0x5af640(0xf4)][_0x5af640(0x106)]){const _0x1549e9=buildLocalExpandedRuleMappings(_0x56b229['yamlConfig']),_0xbd603=_0x1549e9['localSegmentRules'];if(_0xbd603['size']>0x0){const _0x4b8e19=new Map();for(const [_0x4f75c7,_0x1ae14f]of _0xbd603){const _0x45b51b=serializeExpandedRule(_0x1ae14f,_0xbd603);_0x4b8e19[_0x5af640(0xe0)](_0x4f75c7,_0x45b51b);}const _0xe65799=collectSegmentIdsFromJourneyApi(_0x56b229[_0x5af640(0xcc)]);if(_0xe65799[_0x5af640(0x139)]>0x0){const _0x5e8859=await buildServerSegmentRuleMap(_0x5de33b,_0x322155['parentId'],_0x32ba79[_0x5af640(0x196)],_0xe65799);if(_0x5e8859[_0x5af640(0x139)]>0x0){const _0x111f77=new Map();for(const [_0x58f9d1,_0x1e6ae2]of _0x5e8859){const _0x44de6f=serializeExpandedRule(_0x1e6ae2,_0x5e8859);!_0x111f77[_0x5af640(0xda)](_0x44de6f)&&_0x111f77['set'](_0x44de6f,_0x58f9d1);}for(const [_0x3f7977,_0x4eefc5]of _0x4b8e19){const _0x55a04e=_0x111f77[_0x5af640(0xb0)](_0x4eefc5);_0x55a04e&&(_0x4cc0f6[_0x5af640(0xe0)](_0x3f7977,_0x55a04e),_0x32ba79['segmentNameToId'][_0x5af640(0xe0)](_0x3f7977,_0x55a04e));}}}}}const _0x4b7732={'resolveSegmentId':async _0x41f9b5=>{const _0xf7aca9=_0x5af640,_0x5ef64f=_0x32ba79[_0xf7aca9(0x188)][_0xf7aca9(0xb0)](_0x41f9b5);if(!_0x5ef64f)throw new SDKError(ErrorCode[_0xf7aca9(0x108)],_0xf7aca9(0x185)+_0x41f9b5+_0xf7aca9(0x105)+_0x56b229[_0xf7aca9(0xf4)][_0xf7aca9(0xb9)]+')');return _0x5ef64f;},'resolveEmbeddedSegmentId':async(_0x15be2c,_0x196f84)=>{const _0x92a68b=_0x5af640,_0x44306f=_0x32ba79[_0x92a68b(0x188)][_0x92a68b(0xb0)](_0x15be2c);if(_0x44306f)return _0x44306f;const _0xe1a148=_0x4cc0f6[_0x92a68b(0xb0)](_0x15be2c);if(_0xe1a148)return _0x32ba79['segmentNameToId'][_0x92a68b(0xe0)](_0x15be2c,_0xe1a148),_0xe1a148;const _0x1e451d=_0x32ba79[_0x92a68b(0x196)]['find'](_0x1d10a2=>_0x1d10a2[_0x92a68b(0xb9)]===_0x15be2c);if(_0x1e451d)return _0x32ba79['segmentNameToId'][_0x92a68b(0xe0)](_0x15be2c,_0x1e451d['id']),_0x1e451d['id'];if(_0x56b229['isNew']){const {stageName:_0xcb9a0,criteriaName:_0x2b7d9f}=findSegmentCriteriaLocation(_0x56b229['yamlConfig'],_0x15be2c);return _0x516e5e(_0x15be2c,_0x196f84[_0x92a68b(0x14a)]),_0x8ae3aa['set'](_0x15be2c,{'definition':_0x196f84,'stageName':_0xcb9a0,'criteriaName':_0x2b7d9f}),createPendingSegmentId(_0x15be2c);}const _0x5615ec=_0x56b229[_0x92a68b(0xcc)]?.['id'];if(!_0x5615ec)throw new SDKError(ErrorCode[_0x92a68b(0xb7)],_0x92a68b(0xaf));_0x516e5e(_0x15be2c,_0x196f84[_0x92a68b(0x14a)]);const _0x3f20d5=generateDeterministicJourneySegmentName(_0x56b229[_0x92a68b(0xf4)]['name'],_0x15be2c),_0x3238f6=_0x32ba79[_0x92a68b(0x196)]['find'](_0x5255c6=>_0x5255c6[_0x92a68b(0xb9)]===_0x3f20d5),_0x3ec185=createSegmentIdResolver(_0x32ba79[_0x92a68b(0x188)],_0x15be2c),_0x1d8e15=await resolveRuleSegmentIds(_0x196f84[_0x92a68b(0x14a)],_0x3ec185);let _0x44f433;if(_0x3238f6)await _0x5de33b[_0x92a68b(0x103)][_0x92a68b(0x111)](_0x322155[_0x92a68b(0x12b)],_0x3238f6['id'],{'description':_0x196f84[_0x92a68b(0x18d)]||_0x92a68b(0x13b)+_0x15be2c,'rule':_0x58545b(_0x1d8e15,!![]),'countPopulation':!![]}),_0x44f433=_0x3238f6['id'];else try{_0x44f433=await _0x5de33b[_0x92a68b(0x103)]['createJourneySegment']({'name':_0x3f20d5,'description':_0x196f84[_0x92a68b(0x18d)]||_0x92a68b(0x13b)+_0x15be2c,'journeyId':_0x5615ec,'rule':_0x58545b(_0x1d8e15,!![]),'countPopulation':!![],'parentFolderId':_0x322155[_0x92a68b(0x14f)]||'','audienceId':_0x322155[_0x92a68b(0x12b)]});}catch(_0x210ac3){const _0x4ae7c5=_0x210ac3 instanceof Error&&_0x210ac3[_0x92a68b(0x112)][_0x92a68b(0x155)](_0x92a68b(0x167));if(_0x4ae7c5){const _0x137803=await _0x5de33b[_0x92a68b(0x103)][_0x92a68b(0x17a)](_0x322155[_0x92a68b(0x12b)]),_0x5b6539=_0x137803[_0x92a68b(0xfa)](_0x19565c=>_0x19565c[_0x92a68b(0xb9)]===_0x3f20d5);if(_0x5b6539)await _0x5de33b[_0x92a68b(0x103)][_0x92a68b(0x111)](_0x322155[_0x92a68b(0x12b)],_0x5b6539['id'],{'description':_0x196f84['description']||'Entry\x20criteria:\x20'+_0x15be2c,'rule':_0x58545b(_0x1d8e15,!![]),'countPopulation':!![]}),_0x44f433=_0x5b6539['id'];else throw _0x210ac3;}else throw _0x210ac3;}return _0x32ba79['segmentNameToId']['set'](_0x15be2c,_0x44f433),_0x3e2910[_0x92a68b(0xe0)](_0x15be2c,_0x44f433),_0x44f433;},'resolveActivationId':async _0x2d218b=>{const _0x331d56=_0x5af640,_0x5e0d4a=_0x105dad['get'](_0x2d218b);if(_0x5e0d4a)return _0x5e0d4a;if(_0x56b229[_0x331d56(0xcc)]){await _0x54a890();const _0x249f91=_0x105dad[_0x331d56(0xb0)](_0x2d218b);if(_0x249f91)return _0x249f91;}throw new SDKError(ErrorCode[_0x331d56(0xbb)],_0x331d56(0xec)+_0x2d218b+_0x331d56(0x105)+_0x56b229[_0x331d56(0xf4)][_0x331d56(0xb9)]+_0x331d56(0x18e)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x983b43,_0x58d5e8)=>{const _0x474ed6=_0x5af640,_0x3c3d1b=_0x105dad[_0x474ed6(0xb0)](_0x983b43);if(_0x3c3d1b)return _0x3c3d1b;if(_0x56b229[_0x474ed6(0x15d)])return _0xd640d[_0x474ed6(0xe0)](_0x983b43,_0x58d5e8),createPendingActivationId(_0x983b43);if(_0x56b229[_0x474ed6(0xcc)]){await _0x54a890();const _0x4606e9=_0x105dad[_0x474ed6(0xb0)](_0x58d5e8[_0x474ed6(0xb9)]);if(_0x4606e9)return _0x105dad[_0x474ed6(0xe0)](_0x983b43,_0x4606e9),_0x4606e9;const _0x23da5f=activationSignature(_0x58d5e8),_0x29894b=_0xc1171?.[_0x474ed6(0xb0)](_0x23da5f);if(_0x29894b)return _0x105dad[_0x474ed6(0xe0)](_0x983b43,_0x29894b),_0x29894b;const _0x401df9=await _0x14b3f0(_0x58d5e8,_0x32ba79[_0x474ed6(0x126)]),_0xf00215=await _0x5de33b[_0x474ed6(0x136)][_0x474ed6(0x15a)](_0x56b229[_0x474ed6(0xcc)]['id'],_0x401df9);return _0x105dad[_0x474ed6(0xe0)](_0x983b43,_0xf00215['id']),_0xf00215['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x474ed6(0xc3));},'resolveJourneyId':async _0x54c1d8=>{const _0x18c9be=_0x5af640;try{return await _0x5de33b[_0x18c9be(0x136)]['resolveJourneyId'](_0x322155[_0x18c9be(0x12b)],_0x54c1d8);}catch(_0x984250){throw new SDKError(ErrorCode['NOT_FOUND'],_0x18c9be(0x172)+_0x54c1d8+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x56b229[_0x18c9be(0xf4)][_0x18c9be(0xb9)]+'\x27)',_0x984250);}},'resolveStageId':async(_0x5648b5,_0x2bb28e)=>{const _0x4ccaa8=_0x5af640,_0x4afde3=await _0x5de33b['journey'][_0x4ccaa8(0x153)](_0x5648b5),_0x52b6f1=_0x4afde3[_0x4ccaa8(0x11a)]['journeyStages'][_0x4ccaa8(0xfa)](_0x2c983e=>_0x2c983e[_0x4ccaa8(0xb9)][_0x4ccaa8(0x15b)]()===_0x2bb28e[_0x4ccaa8(0x15b)]());if(!_0x52b6f1?.['id'])throw new SDKError(ErrorCode[_0x4ccaa8(0xbb)],_0x4ccaa8(0x186)+_0x2bb28e+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x4afde3[_0x4ccaa8(0x11a)][_0x4ccaa8(0xbe)]||_0x4afde3[_0x4ccaa8(0x11a)]['name'])+'\x27');return _0x52b6f1['id'];}},_0x569117=await _0x577864(_0x56b229[_0x5af640(0xf4)],_0x322155['parentId'],_0x4b7732),_0x1d9d7b=_0x322155[_0x5af640(0x10a)]||_0x322155['rootFolderId'];_0x1d9d7b&&(_0x569117[_0x5af640(0xf2)]={'parentFolder':{'data':{'id':_0x1d9d7b,'type':_0x5af640(0x118)}}});if(_0x56b229[_0x5af640(0x15d)]){if(_0x8ae3aa[_0x5af640(0x139)]>0x0||_0xd640d[_0x5af640(0x139)]>0x0)return await executeThreeStepJourneyCreate(_0x5de33b,_0x56b229,_0x569117,{'pendingEmbeddedSegments':_0x8ae3aa,'pendingEmbeddedActivations':_0xd640d,'embeddedSegmentNameToId':_0x3e2910,'journeyActivationNameToId':_0x105dad},{..._0x322155,'effectiveFolderId':_0x1d9d7b},_0x32ba79,_0x1b6963,_0x4168e7);else{ensureJourneyDefaults(_0x569117[_0x5af640(0x11a)]);const _0x153bf6=await _0x5de33b[_0x5af640(0x136)][_0x5af640(0xdb)](_0x569117);return{'action':_0x5af640(0xc1),'journeyId':_0x153bf6['id'],'embeddedSegmentNameToId':_0x3e2910};}}else{if(_0x56b229['hasChanges']&&_0x56b229[_0x5af640(0xcc)])return ensureJourneyDefaults(_0x569117[_0x5af640(0x11a)]),await _0x5de33b[_0x5af640(0x136)][_0x5af640(0x149)](_0x56b229[_0x5af640(0xcc)]['id'],_0x569117),{'action':_0x5af640(0x187),'journeyId':_0x56b229[_0x5af640(0xcc)]['id'],'embeddedSegmentNameToId':_0x3e2910};}return{'action':_0x5af640(0x113),'journeyId':_0x56b229[_0x5af640(0xcc)]?.['id'],'embeddedSegmentNameToId':_0x3e2910};}function findSegmentCriteriaLocation(_0x18172e,_0x5c51fe){const _0xf16772=a117_0x3948,_0xa4382e=_0x18172e[_0xf16772(0xd4)]||_0x18172e[_0xf16772(0x146)]?.[0x0]?.['stages']||[];let _0x55dfd5=_0xf16772(0x14b),_0x9f06a3=_0x5c51fe;const _0x480690=_0x18172e[_0xf16772(0x107)]||_0x18172e[_0xf16772(0x146)]?.[0x0]?.['goal'];if(_0x480690?.[_0xf16772(0x103)]===_0x5c51fe)return{'stageName':_0xf16772(0x107),'criteriaName':_0x480690['name']||_0x5c51fe};_0x25bdd2:for(const _0x401599 of _0xa4382e){if(_0x401599[_0xf16772(0x159)]?.['segment']===_0x5c51fe){_0x55dfd5=_0x401599[_0xf16772(0xb9)],_0x9f06a3=_0x401599[_0xf16772(0x159)][_0xf16772(0xb9)]||_0x5c51fe;break;}if(_0x401599[_0xf16772(0x16f)])for(const _0x3f6c8d of _0x401599[_0xf16772(0x16f)]){if(_0x3f6c8d[_0xf16772(0x15e)]===_0xf16772(0xd7)&&_0x3f6c8d[_0xf16772(0x12a)]?.[_0xf16772(0x169)])for(const _0x1521d9 of _0x3f6c8d[_0xf16772(0x12a)][_0xf16772(0x169)]){if(_0x1521d9[_0xf16772(0x103)]===_0x5c51fe){_0x55dfd5=_0x401599[_0xf16772(0xb9)],_0x9f06a3=_0x1521d9['name']||_0x5c51fe;break _0x25bdd2;}}}}return{'stageName':_0x55dfd5,'criteriaName':_0x9f06a3};}async function executeThreeStepJourneyCreate(_0x1c566d,_0x3fa239,_0x26a51c,_0x485d0d,_0x3007c2,_0x131324,_0x415ad3,_0x204651){const _0x240c63=a117_0x3948,{activationDefToCreateRequest:_0x5d69b1,yamlRuleToApi:_0x793bbb}=_0x204651,{pendingEmbeddedSegments:_0x5705b4,pendingEmbeddedActivations:_0x35ed1,embeddedSegmentNameToId:_0x54b28f}=_0x485d0d,_0x31ca22=JSON['parse'](JSON[_0x240c63(0x145)](_0x26a51c));ensureJourneyDefaults(_0x31ca22[_0x240c63(0x11a)]),stripPendingIds(_0x31ca22);const _0x43def0=await _0x1c566d[_0x240c63(0x136)][_0x240c63(0xdb)](_0x31ca22),_0xb64a68=_0x43def0['id'],_0x544aac=new Map();for(const _0x791c0d of _0x43def0[_0x240c63(0x11a)]['journeyStages']){_0x544aac[_0x240c63(0xe0)](_0x791c0d[_0x240c63(0xb9)][_0x240c63(0x15b)](),_0x791c0d['id']);}for(const [_0x3302dd,{definition:_0x18fae0}]of _0x5705b4){const _0x2e9765=generateDeterministicJourneySegmentName(_0x3fa239[_0x240c63(0xf4)][_0x240c63(0xb9)],_0x3302dd);_0x415ad3[_0x240c63(0x123)]?.({'type':_0x240c63(0xc5),'journeyName':_0x3fa239['yamlConfig']['name'],'segmentName':_0x3302dd});const _0x4ba7d4=createSegmentIdResolver(_0x131324[_0x240c63(0x188)],_0x3302dd),_0xa03bea=await resolveRuleSegmentIds(_0x18fae0[_0x240c63(0x14a)],_0x4ba7d4),_0x216425=await _0x1c566d[_0x240c63(0x103)][_0x240c63(0x12c)]({'name':_0x2e9765,'description':_0x18fae0[_0x240c63(0x18d)]||_0x240c63(0x13b)+_0x3302dd,'journeyId':_0xb64a68,'rule':_0x793bbb(_0xa03bea,!![]),'countPopulation':!![],'parentFolderId':_0x3007c2[_0x240c63(0x12f)]||'','audienceId':_0x3007c2[_0x240c63(0x12b)]});_0x54b28f[_0x240c63(0xe0)](_0x3302dd,_0x216425),_0x131324['segmentNameToId'][_0x240c63(0xe0)](_0x3302dd,_0x216425),_0x415ad3[_0x240c63(0x123)]?.({'type':_0x240c63(0x130),'journeyName':_0x3fa239[_0x240c63(0xf4)][_0x240c63(0xb9)],'segmentName':_0x3302dd});}const _0x401051=new Map();for(const [_0x31d38b,_0xd393b2]of _0x35ed1){_0x415ad3['onProgress']?.({'type':_0x240c63(0xd6),'journeyName':_0x3fa239['yamlConfig'][_0x240c63(0xb9)],'activationName':_0x31d38b});const _0xaeb2b0=await _0x5d69b1(_0xd393b2,_0x131324[_0x240c63(0x126)]),_0x34efb4=await _0x1c566d[_0x240c63(0x136)][_0x240c63(0x15a)](_0xb64a68,_0xaeb2b0);_0x401051[_0x240c63(0xe0)](_0x31d38b,_0x34efb4['id']),_0x485d0d[_0x240c63(0x18a)][_0x240c63(0xe0)](_0x31d38b,_0x34efb4['id']),_0x415ad3[_0x240c63(0x123)]?.({'type':_0x240c63(0x175),'journeyName':_0x3fa239[_0x240c63(0xf4)][_0x240c63(0xb9)],'activationName':_0x31d38b});}const _0x19d4ed=JSON[_0x240c63(0xe1)](JSON[_0x240c63(0x145)](_0x26a51c));return _0x19d4ed['id']=_0xb64a68,ensureJourneyDefaults(_0x19d4ed['attributes']),resolvePendingIdsInRequest(_0x19d4ed,_0x26a51c,_0x544aac,_0x54b28f,_0x401051,_0x415ad3),await _0x1c566d[_0x240c63(0x136)][_0x240c63(0x149)](_0xb64a68,_0x19d4ed),{'action':_0x240c63(0xc1),'journeyId':_0xb64a68,'embeddedSegmentNameToId':_0x54b28f};}function stripPendingIds(_0x52f377){const _0x2790c4=a117_0x3948;for(const _0x1c8ce2 of _0x52f377[_0x2790c4(0x11a)][_0x2790c4(0xce)]||[]){_0x1c8ce2['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x1c8ce2[_0x2790c4(0x10c)][_0x2790c4(0x195)])&&delete _0x1c8ce2['entryCriteria'];if(_0x1c8ce2[_0x2790c4(0x16f)])for(const _0x102fe2 of Object[_0x2790c4(0xb5)](_0x1c8ce2['steps'])){const _0x11e6f1=_0x1c8ce2[_0x2790c4(0x16f)][_0x102fe2];_0x11e6f1[_0x2790c4(0x15e)]===_0x2790c4(0x141)&&_0x11e6f1['journeyActivationStepId']&&isPendingActivationId(_0x11e6f1[_0x2790c4(0x142)])&&(_0x11e6f1[_0x2790c4(0x142)]='');if(_0x11e6f1[_0x2790c4(0x15e)]===_0x2790c4(0x176)&&_0x11e6f1['branches'])for(const _0x2d8bfb of _0x11e6f1[_0x2790c4(0x169)]){_0x2d8bfb['segmentId']&&isPendingSegmentId(_0x2d8bfb[_0x2790c4(0x195)])&&(_0x2d8bfb[_0x2790c4(0x195)]='');}_0x11e6f1[_0x2790c4(0x15e)]===_0x2790c4(0xe3)&&_0x11e6f1['waitCondition']?.['segmentId']&&isPendingSegmentId(_0x11e6f1['waitCondition'][_0x2790c4(0x195)])&&(_0x11e6f1['waitCondition'][_0x2790c4(0x195)]='');}}}function resolvePendingIdsInRequest(_0x3fd8ae,_0x4cdb22,_0x18783c,_0x23dc95,_0x1be3b4,_0x521d94){const _0x4bab66=a117_0x3948,_0x2fe1c1=(_0x998ebc,_0x59e30a)=>{const _0x280382=a117_0x3948;if(!isPendingSegmentId(_0x998ebc))return _0x998ebc;const _0x39cbb3=extractPendingSegmentName(_0x998ebc),_0x47e3d5=_0x23dc95['get'](_0x39cbb3);return!_0x47e3d5&&_0x521d94[_0x280382(0xd2)]?.(_0x280382(0xc0)+_0x39cbb3+_0x280382(0x18f)+_0x59e30a),_0x47e3d5;};if(_0x3fd8ae[_0x4bab66(0x11a)][_0x4bab66(0x107)]?.[_0x4bab66(0x195)]&&isPendingSegmentId(_0x3fd8ae[_0x4bab66(0x11a)]['goal'][_0x4bab66(0x195)])){const _0x2c8b5c=_0x2fe1c1(_0x3fd8ae[_0x4bab66(0x11a)][_0x4bab66(0x107)][_0x4bab66(0x195)],_0x4bab66(0xfe));_0x2c8b5c&&(_0x3fd8ae[_0x4bab66(0x11a)][_0x4bab66(0x107)][_0x4bab66(0x195)]=_0x2c8b5c);}for(const _0x3cd974 of _0x3fd8ae[_0x4bab66(0x11a)][_0x4bab66(0xce)]||[]){const _0xd3ad4a=_0x18783c[_0x4bab66(0xb0)](_0x3cd974[_0x4bab66(0xb9)][_0x4bab66(0x15b)]());_0xd3ad4a&&(_0x3cd974['id']=_0xd3ad4a);if(_0x3cd974[_0x4bab66(0x10c)]?.[_0x4bab66(0x195)]&&isPendingSegmentId(_0x3cd974[_0x4bab66(0x10c)]['segmentId'])){const _0x188751=_0x2fe1c1(_0x3cd974[_0x4bab66(0x10c)][_0x4bab66(0x195)],_0x4bab66(0x16e)+_0x3cd974['name']+_0x4bab66(0xef));_0x188751&&(_0x3cd974[_0x4bab66(0x10c)]['segmentId']=_0x188751);}if(_0x3cd974[_0x4bab66(0xee)])for(const _0x347021 of _0x3cd974[_0x4bab66(0xee)]){if(_0x347021[_0x4bab66(0x195)]&&isPendingSegmentId(_0x347021[_0x4bab66(0x195)])){const _0x52b5c7=_0x2fe1c1(_0x347021['segmentId'],_0x4bab66(0x16e)+_0x3cd974[_0x4bab66(0xb9)]+_0x4bab66(0x14e));_0x52b5c7&&(_0x347021[_0x4bab66(0x195)]=_0x52b5c7);}}if(_0x3cd974[_0x4bab66(0x163)]?.[_0x4bab66(0x195)]&&isPendingSegmentId(_0x3cd974['milestone'][_0x4bab66(0x195)])){const _0x415581=_0x2fe1c1(_0x3cd974[_0x4bab66(0x163)][_0x4bab66(0x195)],_0x4bab66(0x16e)+_0x3cd974[_0x4bab66(0xb9)]+'\x27\x20milestone');_0x415581&&(_0x3cd974[_0x4bab66(0x163)][_0x4bab66(0x195)]=_0x415581);}if(_0x3cd974[_0x4bab66(0x16f)]){const _0x1686c3=_0x65fb28=>_0x4cdb22['attributes'][_0x4bab66(0xce)][_0x4bab66(0xfa)](_0x383857=>_0x383857[_0x4bab66(0xb9)]['toLowerCase']()===_0x3cd974['name'][_0x4bab66(0x15b)]())?.[_0x4bab66(0x16f)]?.[_0x65fb28];for(const _0x3104f7 of Object[_0x4bab66(0xb5)](_0x3cd974[_0x4bab66(0x16f)])){const _0x2c2f9d=_0x3cd974[_0x4bab66(0x16f)][_0x3104f7],_0x3df721=_0x1686c3(_0x3104f7);if(_0x2c2f9d[_0x4bab66(0x15e)]==='Activation'&&_0x2c2f9d[_0x4bab66(0x142)]&&(isPendingActivationId(_0x2c2f9d['journeyActivationStepId'])||_0x2c2f9d[_0x4bab66(0x142)]==='')){if(_0x3df721?.[_0x4bab66(0x142)]&&isPendingActivationId(_0x3df721[_0x4bab66(0x142)])){const _0x34e2d0=extractPendingActivationName(_0x3df721[_0x4bab66(0x142)]),_0x23237e=_0x1be3b4[_0x4bab66(0xb0)](_0x34e2d0);_0x23237e&&(_0x2c2f9d['journeyActivationStepId']=_0x23237e);}}if(_0x2c2f9d[_0x4bab66(0x15e)]===_0x4bab66(0x176)&&_0x2c2f9d[_0x4bab66(0x169)]&&_0x3df721?.['branches'])for(let _0x5ab876=0x0;_0x5ab876<_0x2c2f9d[_0x4bab66(0x169)][_0x4bab66(0x13c)];_0x5ab876++){const _0x484f4f=_0x2c2f9d['branches'][_0x5ab876],_0x3c0307=_0x3df721[_0x4bab66(0x169)][_0x5ab876];if(_0x3c0307?.[_0x4bab66(0x195)]&&isPendingSegmentId(_0x3c0307[_0x4bab66(0x195)])){const _0x1b51d1=_0x2fe1c1(_0x3c0307[_0x4bab66(0x195)],_0x4bab66(0x16e)+_0x3cd974['name']+_0x4bab66(0x194)+(_0x484f4f[_0x4bab66(0xb9)]||_0x5ab876)+'\x27');_0x1b51d1&&(_0x484f4f[_0x4bab66(0x195)]=_0x1b51d1);}}if(_0x2c2f9d[_0x4bab66(0x15e)]==='WaitStep'&&_0x2c2f9d['waitCondition']?.[_0x4bab66(0x195)]&&_0x3df721?.[_0x4bab66(0xc9)]?.['segmentId']&&isPendingSegmentId(_0x3df721['waitCondition'][_0x4bab66(0x195)])){const _0x453e6d=_0x2fe1c1(_0x3df721[_0x4bab66(0xc9)][_0x4bab66(0x195)],_0x4bab66(0x16e)+_0x3cd974[_0x4bab66(0xb9)]+_0x4bab66(0xed));_0x453e6d&&(_0x2c2f9d[_0x4bab66(0xc9)][_0x4bab66(0x195)]=_0x453e6d);}}}}}
@@ -1 +1 @@
1
- (function(_0x2cb584,_0x377e2e){const _0x2a90d9=a118_0x3114,_0x5ec206=_0x2cb584();while(!![]){try{const _0x1e8117=-parseInt(_0x2a90d9(0x99))/0x1+parseInt(_0x2a90d9(0xa4))/0x2+-parseInt(_0x2a90d9(0x9b))/0x3*(parseInt(_0x2a90d9(0xa7))/0x4)+parseInt(_0x2a90d9(0xa5))/0x5+parseInt(_0x2a90d9(0xa0))/0x6+parseInt(_0x2a90d9(0x9f))/0x7+parseInt(_0x2a90d9(0xa6))/0x8*(-parseInt(_0x2a90d9(0x9d))/0x9);if(_0x1e8117===_0x377e2e)break;else _0x5ec206['push'](_0x5ec206['shift']());}catch(_0x2ba9cf){_0x5ec206['push'](_0x5ec206['shift']());}}}(a118_0x2a47,0x98677));export function buildFolderIdToPathMap(_0x2258c8){const _0x46d93d=a118_0x3114,_0x40f55f=new Map(),_0x4a6573=new Map();for(const _0x3fd833 of _0x2258c8){_0x4a6573[_0x46d93d(0x9c)](_0x3fd833['id'],_0x3fd833);}const _0x24f97a=new Set();for(const _0x427a6d of _0x2258c8){!_0x427a6d[_0x46d93d(0xa3)]&&_0x24f97a[_0x46d93d(0xa2)](_0x427a6d['id']);}function _0x1d07c6(_0x8da9cf){const _0x2ee3eb=_0x46d93d;if(_0x40f55f[_0x2ee3eb(0xa1)](_0x8da9cf['id']))return _0x40f55f['get'](_0x8da9cf['id']);if(_0x24f97a[_0x2ee3eb(0xa1)](_0x8da9cf['id']))return _0x40f55f[_0x2ee3eb(0x9c)](_0x8da9cf['id'],''),'';if(_0x8da9cf['parentFolderId']){const _0x3e07f3=_0x4a6573[_0x2ee3eb(0x9e)](_0x8da9cf['parentFolderId']);if(_0x3e07f3){const _0x1de1de=_0x1d07c6(_0x3e07f3),_0x1a321b=_0x1de1de?_0x1de1de+'/'+_0x8da9cf[_0x2ee3eb(0x9a)]:_0x8da9cf[_0x2ee3eb(0x9a)];return _0x40f55f[_0x2ee3eb(0x9c)](_0x8da9cf['id'],_0x1a321b),_0x1a321b;}}const _0x331d2f=_0x8da9cf[_0x2ee3eb(0x9a)];return _0x40f55f[_0x2ee3eb(0x9c)](_0x8da9cf['id'],_0x331d2f),_0x331d2f;}for(const _0x3b93e8 of _0x2258c8){_0x1d07c6(_0x3b93e8);}return _0x40f55f;}export function buildFolderPathToIdMap(_0x48a2ea){const _0x5ced0b=a118_0x3114,_0xde8074=new Map(),_0x5c2afc=new Map();for(const _0x36fae7 of _0x48a2ea){_0x5c2afc['set'](_0x36fae7['id'],_0x36fae7);}const _0x181e9f=new Set();for(const _0x4ca813 of _0x48a2ea){!_0x4ca813['parentFolderId']&&_0x181e9f[_0x5ced0b(0xa2)](_0x4ca813['id']);}function _0xae7acc(_0x243c55){const _0xac4864=_0x5ced0b;if(_0x181e9f[_0xac4864(0xa1)](_0x243c55['id']))return'';if(_0x243c55[_0xac4864(0xa3)]){const _0x449e4d=_0x5c2afc['get'](_0x243c55['parentFolderId']);if(_0x449e4d){const _0x3e8264=_0xae7acc(_0x449e4d);return _0x3e8264?_0x3e8264+'/'+_0x243c55['name']:_0x243c55[_0xac4864(0x9a)];}}return _0x243c55[_0xac4864(0x9a)];}for(const _0x1d02cf of _0x48a2ea){const _0x22da38=_0xae7acc(_0x1d02cf);_0xde8074[_0x5ced0b(0x9c)](_0x22da38,_0x1d02cf['id']);}return _0xde8074;}export function buildFolderMaps(_0x1c2726){const _0x472af5=a118_0x3114,_0x778e27=buildFolderIdToPathMap(_0x1c2726),_0x57dab8=new Map();for(const [_0x2f92a9,_0x4b2bd2]of _0x778e27){_0x57dab8[_0x472af5(0x9c)](_0x4b2bd2,_0x2f92a9);}return{'idToPath':_0x778e27,'pathToId':_0x57dab8};}function a118_0x2a47(){const _0xd2b5ee=['951522rzjjgn','name','3ekBZuU','set','18mwjyox','get','7529270lvtVxT','5279322NczssA','has','add','parentFolderId','2227438gBtKto','1389695NgunBv','6494816MNJUOl','590728kWtNVN'];a118_0x2a47=function(){return _0xd2b5ee;};return a118_0x2a47();}function a118_0x3114(_0x319399,_0x34889c){_0x319399=_0x319399-0x99;const _0x2a477c=a118_0x2a47();let _0x31144e=_0x2a477c[_0x319399];return _0x31144e;}export function getFolderPath(_0x2156a9,_0x1e9120){const _0x3c7d3e=a118_0x3114;if(!_0x2156a9)return'';return _0x1e9120[_0x3c7d3e(0x9e)](_0x2156a9)??'';}
1
+ (function(_0x406adf,_0x3df865){const _0x4558ed=a118_0x4949,_0x1efee2=_0x406adf();while(!![]){try{const _0x1c24f8=parseInt(_0x4558ed(0x137))/0x1*(-parseInt(_0x4558ed(0x133))/0x2)+-parseInt(_0x4558ed(0x134))/0x3+parseInt(_0x4558ed(0x130))/0x4*(parseInt(_0x4558ed(0x12d))/0x5)+-parseInt(_0x4558ed(0x12c))/0x6+-parseInt(_0x4558ed(0x12f))/0x7+parseInt(_0x4558ed(0x136))/0x8*(parseInt(_0x4558ed(0x12b))/0x9)+parseInt(_0x4558ed(0x12e))/0xa*(parseInt(_0x4558ed(0x127))/0xb);if(_0x1c24f8===_0x3df865)break;else _0x1efee2['push'](_0x1efee2['shift']());}catch(_0x54df25){_0x1efee2['push'](_0x1efee2['shift']());}}}(a118_0x401e,0xa24b7));export function buildFolderIdToPathMap(_0x78397c){const _0x27272c=a118_0x4949,_0x475ff9=new Map(),_0x309140=new Map();for(const _0x4d898c of _0x78397c){_0x309140[_0x27272c(0x135)](_0x4d898c['id'],_0x4d898c);}const _0xc4a20a=new Set();for(const _0x242cbf of _0x78397c){!_0x242cbf['parentFolderId']&&_0xc4a20a[_0x27272c(0x132)](_0x242cbf['id']);}function _0x58c71f(_0xa02a8b){const _0x554113=_0x27272c;if(_0x475ff9[_0x554113(0x131)](_0xa02a8b['id']))return _0x475ff9[_0x554113(0x12a)](_0xa02a8b['id']);if(_0xc4a20a[_0x554113(0x131)](_0xa02a8b['id']))return _0x475ff9[_0x554113(0x135)](_0xa02a8b['id'],''),'';if(_0xa02a8b[_0x554113(0x129)]){const _0x488172=_0x309140[_0x554113(0x12a)](_0xa02a8b[_0x554113(0x129)]);if(_0x488172){const _0x43994c=_0x58c71f(_0x488172),_0x240c66=_0x43994c?_0x43994c+'/'+_0xa02a8b[_0x554113(0x128)]:_0xa02a8b['name'];return _0x475ff9[_0x554113(0x135)](_0xa02a8b['id'],_0x240c66),_0x240c66;}}const _0x2d234a=_0xa02a8b[_0x554113(0x128)];return _0x475ff9[_0x554113(0x135)](_0xa02a8b['id'],_0x2d234a),_0x2d234a;}for(const _0x28b358 of _0x78397c){_0x58c71f(_0x28b358);}return _0x475ff9;}function a118_0x401e(){const _0x4074ff=['get','9243SEXidN','3398094lEVmOO','510010jzFVqR','391420nZGIjP','6676299BxpEvg','52JnGIQp','has','add','746CdavUc','1101558oYJnYI','set','5296GhKuEN','1579hNUjGM','319fNFjTz','name','parentFolderId'];a118_0x401e=function(){return _0x4074ff;};return a118_0x401e();}export function buildFolderPathToIdMap(_0x573a49){const _0x324626=a118_0x4949,_0x1b7b1a=new Map(),_0x1d2e45=new Map();for(const _0x222f94 of _0x573a49){_0x1d2e45['set'](_0x222f94['id'],_0x222f94);}const _0x26d21e=new Set();for(const _0x594840 of _0x573a49){!_0x594840[_0x324626(0x129)]&&_0x26d21e[_0x324626(0x132)](_0x594840['id']);}function _0xdbc526(_0x2b1b17){const _0x4b504e=_0x324626;if(_0x26d21e[_0x4b504e(0x131)](_0x2b1b17['id']))return'';if(_0x2b1b17[_0x4b504e(0x129)]){const _0x3a29a0=_0x1d2e45['get'](_0x2b1b17[_0x4b504e(0x129)]);if(_0x3a29a0){const _0x255407=_0xdbc526(_0x3a29a0);return _0x255407?_0x255407+'/'+_0x2b1b17[_0x4b504e(0x128)]:_0x2b1b17[_0x4b504e(0x128)];}}return _0x2b1b17['name'];}for(const _0x4419eb of _0x573a49){const _0x1235ca=_0xdbc526(_0x4419eb);_0x1b7b1a[_0x324626(0x135)](_0x1235ca,_0x4419eb['id']);}return _0x1b7b1a;}function a118_0x4949(_0x1dd23a,_0xd2e96a){_0x1dd23a=_0x1dd23a-0x127;const _0x401e0a=a118_0x401e();let _0x4949d1=_0x401e0a[_0x1dd23a];return _0x4949d1;}export function buildFolderMaps(_0x1a6aec){const _0x48fc7f=buildFolderIdToPathMap(_0x1a6aec),_0x492000=new Map();for(const [_0x2df570,_0x36d6b5]of _0x48fc7f){_0x492000['set'](_0x36d6b5,_0x2df570);}return{'idToPath':_0x48fc7f,'pathToId':_0x492000};}export function getFolderPath(_0x543483,_0x24ec41){const _0x35f389=a118_0x4949;if(!_0x543483)return'';return _0x24ec41[_0x35f389(0x12a)](_0x543483)??'';}
@@ -1 +1 @@
1
- function a119_0x35f2(_0x2e3c23,_0x86f619){_0x2e3c23=_0x2e3c23-0x1b3;const _0x4a03cf=a119_0x4a03();let _0x35f2dd=_0x4a03cf[_0x2e3c23];return _0x35f2dd;}(function(_0x1be021,_0x5b71a4){const _0x44be33=a119_0x35f2,_0x4595c0=_0x1be021();while(!![]){try{const _0x3f7af=parseInt(_0x44be33(0x1c5))/0x1+parseInt(_0x44be33(0x1bf))/0x2+parseInt(_0x44be33(0x1c4))/0x3+parseInt(_0x44be33(0x1dd))/0x4*(-parseInt(_0x44be33(0x1c6))/0x5)+-parseInt(_0x44be33(0x1b6))/0x6+-parseInt(_0x44be33(0x1c0))/0x7+parseInt(_0x44be33(0x1b5))/0x8*(parseInt(_0x44be33(0x1bc))/0x9);if(_0x3f7af===_0x5b71a4)break;else _0x4595c0['push'](_0x4595c0['shift']());}catch(_0x337724){_0x4595c0['push'](_0x4595c0['shift']());}}}(a119_0x4a03,0x6cbdc));import a119_0x357be6 from'path';import{parse as a119_0x206018}from'yaml';function a119_0x4a03(){const _0x3d7add=['.yaml','exists','type','isAbsolute','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','File\x20not\x20found:\x20','filter','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','parent_segment','segment','trim','relative','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','length','Relative\x20path\x20cannot\x20be\x20empty','Path\x20attempts\x20to\x20navigate\x20above\x20root','push','pop','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','3000148jhkyrh','parse','name','Path\x20segment\x20cannot\x20be\x20empty','raw','160xIPbhW','3453678mXYeTb','slice','root','tdx.json','endsWith','dirname','371043SrCKwO','resolve','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','1711838NtQQiv','5169150geiHad','readFile','join','startsWith','823263OZTfGh','554624vFqHKr','5ipouqb','replace','segments','journey'];a119_0x4a03=function(){return _0x3d7add;};return a119_0x4a03();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x52f4a6){const _0x460cd7=a119_0x35f2;if(!_0x52f4a6||_0x52f4a6[_0x460cd7(0x1d4)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x41a246=_0x52f4a6[_0x460cd7(0x1d4)]();if(_0x41a246==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x52f4a6};const _0xa6af9c=_0x41a246[_0x460cd7(0x1c3)]('/')?_0x41a246['substring'](0x1):_0x41a246,_0x124a1d=_0xa6af9c['split']('/')[_0x460cd7(0x1d0)](_0xd0e6fc=>_0xd0e6fc!=='');if(_0x124a1d[_0x460cd7(0x1d7)]===0x0)throw new Error(_0x460cd7(0x1d1));const _0x2b03e6=_0x41a246[_0x460cd7(0x1c3)]('/')||!isRelativePathSegment(_0x124a1d[0x0]);for(const _0x1ed389 of _0x124a1d){validatePathSegment(_0x1ed389);}return{'segments':_0x124a1d,'isAbsolute':_0x2b03e6,'raw':_0x52f4a6};}function isRelativePathSegment(_0x41d67a){return _0x41d67a==='.'||_0x41d67a==='..';}function validatePathSegment(_0x24d745){const _0x4b2630=a119_0x35f2;if(_0x24d745==='')throw new Error(_0x4b2630(0x1b3));if(_0x24d745==='.'||_0x24d745==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x24d745))throw new Error(_0x4b2630(0x1d6)+_0x24d745);if(_0x24d745!==_0x24d745[_0x4b2630(0x1d4)]()){}}export function validatePath(_0x1027e3){const _0x31ae5e=a119_0x35f2;if(_0x1027e3[_0x31ae5e(0x1c8)]['length']===0x0&&!_0x1027e3[_0x31ae5e(0x1cd)])throw new Error(_0x31ae5e(0x1d8));if(_0x1027e3[_0x31ae5e(0x1cd)]){if(_0x1027e3[_0x31ae5e(0x1c8)][0x0]==='..')throw new Error(_0x31ae5e(0x1dc));let _0x38fc48=0x0;for(const _0x5bf9b2 of _0x1027e3[_0x31ae5e(0x1c8)]){if(_0x5bf9b2==='..'){if(_0x38fc48===0x0)throw new Error(_0x31ae5e(0x1d9));_0x38fc48--;}else _0x5bf9b2!=='.'&&_0x38fc48++;}}}export function joinPaths(_0x4ac640,_0x22c69b){const _0x5946c6=a119_0x35f2;if(!_0x4ac640||_0x4ac640==='/')return _0x22c69b;if(!_0x22c69b||_0x22c69b==='.')return _0x4ac640;if(_0x22c69b[_0x5946c6(0x1c3)]('/'))return _0x22c69b;const _0x153596=parsePath(_0x4ac640),_0x201542=parsePath(_0x22c69b),_0x3ac000=[..._0x153596[_0x5946c6(0x1c8)]];for(const _0x4b0947 of _0x201542['segments']){if(_0x4b0947==='.')continue;else{if(_0x4b0947==='..'){if(_0x3ac000[_0x5946c6(0x1d7)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x3ac000[_0x5946c6(0x1db)]();}else _0x3ac000[_0x5946c6(0x1da)](_0x4b0947);}}const _0xcc606f=_0x3ac000[_0x5946c6(0x1c2)]('/');return _0x153596[_0x5946c6(0x1b4)][_0x5946c6(0x1c3)]('/')?'/'+_0xcc606f:_0xcc606f;}export function normalizePath(_0x324997){const _0x3298d0=a119_0x35f2,_0x5a387f=parsePath(_0x324997),_0x5907bb=[];for(const _0x2742c0 of _0x5a387f[_0x3298d0(0x1c8)]){if(_0x2742c0==='.')continue;else{if(_0x2742c0==='..'){if(_0x5907bb[_0x3298d0(0x1d7)]===0x0){if(_0x5a387f[_0x3298d0(0x1cd)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x5907bb['push']('..');}else _0x5907bb[_0x5907bb['length']-0x1]==='..'?_0x5907bb[_0x3298d0(0x1da)]('..'):_0x5907bb['pop']();}else _0x5907bb[_0x3298d0(0x1da)](_0x2742c0);}}if(_0x5907bb[_0x3298d0(0x1d7)]===0x0)return _0x5a387f[_0x3298d0(0x1cd)]?'/':'.';const _0x5e7f9a=_0x5907bb[_0x3298d0(0x1c2)]('/');return _0x5a387f[_0x3298d0(0x1b4)][_0x3298d0(0x1c3)]('/')?'/'+_0x5e7f9a:_0x5e7f9a;}export function getParentPath(_0xeadac3){const _0x316282=a119_0x35f2,_0x1853c5=parsePath(_0xeadac3);if(_0x1853c5['segments'][_0x316282(0x1d7)]<=0x1)return'/';const _0x139fc3=_0x1853c5[_0x316282(0x1c8)][_0x316282(0x1b7)](0x0,-0x1)[_0x316282(0x1c2)]('/');return _0x1853c5['raw'][_0x316282(0x1c3)]('/')?'/'+_0x139fc3:_0x139fc3;}export function getBaseName(_0x26f4bc){const _0x4eb128=a119_0x35f2,_0x5342c3=parsePath(_0x26f4bc);return _0x5342c3['segments'][_0x5342c3['segments'][_0x4eb128(0x1d7)]-0x1]||'';}export function isChildPath(_0x547894,_0x317923){const _0x4841cb=a119_0x35f2,_0x4406c3=parsePath(_0x547894),_0x4b9d89=parsePath(_0x317923);if(_0x4406c3['segments'][_0x4841cb(0x1d7)]<=_0x4b9d89[_0x4841cb(0x1c8)][_0x4841cb(0x1d7)])return![];for(let _0xe52305=0x0;_0xe52305<_0x4b9d89[_0x4841cb(0x1c8)][_0x4841cb(0x1d7)];_0xe52305++){if(_0x4406c3[_0x4841cb(0x1c8)][_0xe52305]!==_0x4b9d89[_0x4841cb(0x1c8)][_0xe52305])return![];}return!![];}export function splitPath(_0x3f8612){const _0x19713c=a119_0x35f2,_0xc0c4e1=parsePath(_0x3f8612);if(_0xc0c4e1['segments'][_0x19713c(0x1d7)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0xc0c4e1['segments'][_0x19713c(0x1d7)]===0x1)return{'parent':_0xc0c4e1[_0x19713c(0x1c8)][0x0]};return{'parent':_0xc0c4e1[_0x19713c(0x1c8)][0x0],'child':_0xc0c4e1[_0x19713c(0x1c8)][_0x19713c(0x1b7)](0x1)[_0x19713c(0x1c2)]('/')};}export function isYamlFilePath(_0x4005f6){const _0x455629=a119_0x35f2;return _0x4005f6[_0x455629(0x1ba)]('.yml')||_0x4005f6[_0x455629(0x1ba)](_0x455629(0x1ca));}export async function resolveYamlFilePath(_0x5b5ea3,_0x7c3e6c=nodeFileSystem){const _0x417b2b=a119_0x35f2,_0x49af36=a119_0x357be6[_0x417b2b(0x1bd)](_0x5b5ea3);if(!await _0x7c3e6c[_0x417b2b(0x1cb)](_0x49af36))throw new Error(_0x417b2b(0x1cf)+_0x5b5ea3);let _0x2710e0=a119_0x357be6[_0x417b2b(0x1bb)](_0x49af36),_0x390d88=null,_0x25efb9=null;const _0x1d9aa0=a119_0x357be6[_0x417b2b(0x1de)](_0x2710e0)[_0x417b2b(0x1b8)];while(_0x2710e0!==_0x1d9aa0){const _0x3ae21e=a119_0x357be6[_0x417b2b(0x1c2)](_0x2710e0,_0x417b2b(0x1b9));if(await _0x7c3e6c[_0x417b2b(0x1cb)](_0x3ae21e)){_0x390d88=_0x3ae21e,_0x25efb9=_0x2710e0;break;}_0x2710e0=a119_0x357be6[_0x417b2b(0x1bb)](_0x2710e0);}if(!_0x390d88||!_0x25efb9)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x5b5ea3);const _0x34cdcb=await _0x7c3e6c[_0x417b2b(0x1c1)](_0x390d88),_0x12849e=JSON['parse'](_0x34cdcb),_0x4a633a=_0x12849e[_0x417b2b(0x1d2)];if(!_0x4a633a)throw new Error(_0x417b2b(0x1ce));const _0x54922b=await _0x7c3e6c[_0x417b2b(0x1c1)](_0x49af36),_0x58ab44=a119_0x206018(_0x54922b),_0x133141=_0x58ab44[_0x417b2b(0x1df)];if(!_0x133141)throw new Error(_0x417b2b(0x1be)+_0x5b5ea3);const _0x27ab2a=_0x58ab44[_0x417b2b(0x1cc)]===_0x417b2b(0x1c9)?'journey':_0x417b2b(0x1d3),_0x455e8f=a119_0x357be6[_0x417b2b(0x1d5)](_0x25efb9,_0x49af36),_0x12dad7=a119_0x357be6['dirname'](_0x455e8f),_0x28f843=_0x12dad7==='.'?'':_0x12dad7[_0x417b2b(0x1c7)](/\\/g,'/'),_0x35130d=_0x28f843?_0x4a633a+'/'+_0x28f843+'/'+_0x133141:_0x4a633a+'/'+_0x133141;return{'parentSegment':_0x4a633a,'segmentName':_0x133141,'folderPath':_0x28f843,'fullPath':_0x35130d,'resourceType':_0x27ab2a};}
1
+ (function(_0x2732b8,_0x13d756){const _0x9b5b10=a119_0x5f1b,_0x1d81d3=_0x2732b8();while(!![]){try{const _0x347a25=parseInt(_0x9b5b10(0xec))/0x1+-parseInt(_0x9b5b10(0xc8))/0x2+parseInt(_0x9b5b10(0xe1))/0x3+parseInt(_0x9b5b10(0xc7))/0x4+-parseInt(_0x9b5b10(0xdb))/0x5+-parseInt(_0x9b5b10(0xe2))/0x6*(-parseInt(_0x9b5b10(0xd2))/0x7)+parseInt(_0x9b5b10(0xde))/0x8;if(_0x347a25===_0x13d756)break;else _0x1d81d3['push'](_0x1d81d3['shift']());}catch(_0x177a8a){_0x1d81d3['push'](_0x1d81d3['shift']());}}}(a119_0x2a9c,0x191d9));import a119_0x348340 from'path';import{parse as a119_0x54adef}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x267d11){const _0x3cfc0d=a119_0x5f1b;if(!_0x267d11||_0x267d11[_0x3cfc0d(0xc4)]()==='')throw new Error(_0x3cfc0d(0xd3));const _0x246257=_0x267d11[_0x3cfc0d(0xc4)]();if(_0x246257==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x267d11};const _0x54f31d=_0x246257[_0x3cfc0d(0xeb)]('/')?_0x246257[_0x3cfc0d(0xc9)](0x1):_0x246257,_0x39f813=_0x54f31d[_0x3cfc0d(0xe5)]('/')[_0x3cfc0d(0xdc)](_0x100797=>_0x100797!=='');if(_0x39f813[_0x3cfc0d(0xd5)]===0x0)throw new Error(_0x3cfc0d(0xd7));const _0x15af13=_0x246257[_0x3cfc0d(0xeb)]('/')||!isRelativePathSegment(_0x39f813[0x0]);for(const _0xbe6a23 of _0x39f813){validatePathSegment(_0xbe6a23);}return{'segments':_0x39f813,'isAbsolute':_0x15af13,'raw':_0x267d11};}function isRelativePathSegment(_0x48344f){return _0x48344f==='.'||_0x48344f==='..';}function validatePathSegment(_0x51568b){const _0x5c5880=a119_0x5f1b;if(_0x51568b==='')throw new Error(_0x5c5880(0xce));if(_0x51568b==='.'||_0x51568b==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x51568b))throw new Error(_0x5c5880(0xda)+_0x51568b);if(_0x51568b!==_0x51568b[_0x5c5880(0xc4)]()){}}function a119_0x2a9c(){const _0xa1b39b=['Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','split','raw','parent_segment','replace','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','tdx.json','startsWith','14836TmGdFg','Cannot\x20split\x20empty\x20path','push','name','dirname','segments','relative','.yaml','trim','parse','pop','309308lsWcMR','197966gdepDp','substring','isAbsolute','Path\x20attempts\x20to\x20navigate\x20above\x20root','No\x20tdx.json\x20found\x20for\x20file:\x20','File\x20not\x20found:\x20','Path\x20segment\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','Relative\x20path\x20cannot\x20be\x20empty','endsWith','119077ULGAHA','Path\x20cannot\x20be\x20empty','exists','length','readFile','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','journey','.yml','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','316435wemeym','filter','segment','270720jRulPT','type','resolve','213288vKJzJv','24qeaEdy','join'];a119_0x2a9c=function(){return _0xa1b39b;};return a119_0x2a9c();}export function validatePath(_0x575d58){const _0x30cb4d=a119_0x5f1b;if(_0x575d58[_0x30cb4d(0xc1)]['length']===0x0&&!_0x575d58[_0x30cb4d(0xca)])throw new Error(_0x30cb4d(0xd0));if(_0x575d58[_0x30cb4d(0xca)]){if(_0x575d58[_0x30cb4d(0xc1)][0x0]==='..')throw new Error(_0x30cb4d(0xe9));let _0x2cc59f=0x0;for(const _0x39e3ca of _0x575d58[_0x30cb4d(0xc1)]){if(_0x39e3ca==='..'){if(_0x2cc59f===0x0)throw new Error(_0x30cb4d(0xcb));_0x2cc59f--;}else _0x39e3ca!=='.'&&_0x2cc59f++;}}}export function joinPaths(_0x1d2097,_0x187cc5){const _0x529dea=a119_0x5f1b;if(!_0x1d2097||_0x1d2097==='/')return _0x187cc5;if(!_0x187cc5||_0x187cc5==='.')return _0x1d2097;if(_0x187cc5['startsWith']('/'))return _0x187cc5;const _0x98349b=parsePath(_0x1d2097),_0x5c1b7f=parsePath(_0x187cc5),_0x37632a=[..._0x98349b['segments']];for(const _0x2458e0 of _0x5c1b7f['segments']){if(_0x2458e0==='.')continue;else{if(_0x2458e0==='..'){if(_0x37632a['length']===0x0)throw new Error(_0x529dea(0xcf));_0x37632a[_0x529dea(0xc6)]();}else _0x37632a[_0x529dea(0xee)](_0x2458e0);}}const _0x36ff7d=_0x37632a['join']('/');return _0x98349b[_0x529dea(0xe6)][_0x529dea(0xeb)]('/')?'/'+_0x36ff7d:_0x36ff7d;}function a119_0x5f1b(_0x26e8ec,_0x57a9ad){_0x26e8ec=_0x26e8ec-0xbf;const _0x2a9c63=a119_0x2a9c();let _0x5f1bbf=_0x2a9c63[_0x26e8ec];return _0x5f1bbf;}export function normalizePath(_0x31b662){const _0x159147=a119_0x5f1b,_0x3b3a1c=parsePath(_0x31b662),_0x4cc346=[];for(const _0x58d7a7 of _0x3b3a1c['segments']){if(_0x58d7a7==='.')continue;else{if(_0x58d7a7==='..'){if(_0x4cc346['length']===0x0){if(_0x3b3a1c[_0x159147(0xca)])throw new Error(_0x159147(0xcf));_0x4cc346[_0x159147(0xee)]('..');}else _0x4cc346[_0x4cc346[_0x159147(0xd5)]-0x1]==='..'?_0x4cc346[_0x159147(0xee)]('..'):_0x4cc346[_0x159147(0xc6)]();}else _0x4cc346['push'](_0x58d7a7);}}if(_0x4cc346[_0x159147(0xd5)]===0x0)return _0x3b3a1c[_0x159147(0xca)]?'/':'.';const _0x50f19e=_0x4cc346['join']('/');return _0x3b3a1c[_0x159147(0xe6)][_0x159147(0xeb)]('/')?'/'+_0x50f19e:_0x50f19e;}export function getParentPath(_0x452f69){const _0x2f62e0=a119_0x5f1b,_0x1fb204=parsePath(_0x452f69);if(_0x1fb204[_0x2f62e0(0xc1)][_0x2f62e0(0xd5)]<=0x1)return'/';const _0x5b0635=_0x1fb204['segments']['slice'](0x0,-0x1)['join']('/');return _0x1fb204['raw'][_0x2f62e0(0xeb)]('/')?'/'+_0x5b0635:_0x5b0635;}export function getBaseName(_0xfe48e0){const _0x14d383=a119_0x5f1b,_0x1257b9=parsePath(_0xfe48e0);return _0x1257b9[_0x14d383(0xc1)][_0x1257b9['segments'][_0x14d383(0xd5)]-0x1]||'';}export function isChildPath(_0x511b4d,_0x52fdda){const _0x9a630c=a119_0x5f1b,_0x2fec44=parsePath(_0x511b4d),_0x65925f=parsePath(_0x52fdda);if(_0x2fec44['segments'][_0x9a630c(0xd5)]<=_0x65925f[_0x9a630c(0xc1)][_0x9a630c(0xd5)])return![];for(let _0x4138d4=0x0;_0x4138d4<_0x65925f[_0x9a630c(0xc1)][_0x9a630c(0xd5)];_0x4138d4++){if(_0x2fec44['segments'][_0x4138d4]!==_0x65925f[_0x9a630c(0xc1)][_0x4138d4])return![];}return!![];}export function splitPath(_0x24e263){const _0x3bc309=a119_0x5f1b,_0x28b711=parsePath(_0x24e263);if(_0x28b711[_0x3bc309(0xc1)][_0x3bc309(0xd5)]===0x0)throw new Error(_0x3bc309(0xed));if(_0x28b711['segments'][_0x3bc309(0xd5)]===0x1)return{'parent':_0x28b711[_0x3bc309(0xc1)][0x0]};return{'parent':_0x28b711[_0x3bc309(0xc1)][0x0],'child':_0x28b711[_0x3bc309(0xc1)]['slice'](0x1)[_0x3bc309(0xe3)]('/')};}export function isYamlFilePath(_0x1b62b1){const _0x57a1cd=a119_0x5f1b;return _0x1b62b1[_0x57a1cd(0xd1)](_0x57a1cd(0xd9))||_0x1b62b1[_0x57a1cd(0xd1)](_0x57a1cd(0xc3));}export async function resolveYamlFilePath(_0x61bc3c,_0x2b6d9b=nodeFileSystem){const _0xc60e0c=a119_0x5f1b,_0x17d03f=a119_0x348340[_0xc60e0c(0xe0)](_0x61bc3c);if(!await _0x2b6d9b[_0xc60e0c(0xd4)](_0x17d03f))throw new Error(_0xc60e0c(0xcd)+_0x61bc3c);let _0x3c706e=a119_0x348340[_0xc60e0c(0xc0)](_0x17d03f),_0x28d068=null,_0x4a25d4=null;const _0x133acb=a119_0x348340[_0xc60e0c(0xc5)](_0x3c706e)['root'];while(_0x3c706e!==_0x133acb){const _0x306823=a119_0x348340[_0xc60e0c(0xe3)](_0x3c706e,_0xc60e0c(0xea));if(await _0x2b6d9b['exists'](_0x306823)){_0x28d068=_0x306823,_0x4a25d4=_0x3c706e;break;}_0x3c706e=a119_0x348340[_0xc60e0c(0xc0)](_0x3c706e);}if(!_0x28d068||!_0x4a25d4)throw new Error(_0xc60e0c(0xcc)+_0x61bc3c);const _0x3bb8b1=await _0x2b6d9b[_0xc60e0c(0xd6)](_0x28d068),_0x3cebd5=JSON[_0xc60e0c(0xc5)](_0x3bb8b1),_0x37b251=_0x3cebd5[_0xc60e0c(0xe7)];if(!_0x37b251)throw new Error(_0xc60e0c(0xe4));const _0x39c40e=await _0x2b6d9b[_0xc60e0c(0xd6)](_0x17d03f),_0x1b64e7=a119_0x54adef(_0x39c40e),_0x2a1eda=_0x1b64e7[_0xc60e0c(0xbf)];if(!_0x2a1eda)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x61bc3c);const _0x1204b7=_0x1b64e7[_0xc60e0c(0xdf)]===_0xc60e0c(0xd8)?_0xc60e0c(0xd8):_0xc60e0c(0xdd),_0x10ee86=a119_0x348340[_0xc60e0c(0xc2)](_0x4a25d4,_0x17d03f),_0x20346b=a119_0x348340[_0xc60e0c(0xc0)](_0x10ee86),_0x3619bc=_0x20346b==='.'?'':_0x20346b[_0xc60e0c(0xe8)](/\\/g,'/'),_0x21423d=_0x3619bc?_0x37b251+'/'+_0x3619bc+'/'+_0x2a1eda:_0x37b251+'/'+_0x2a1eda;return{'parentSegment':_0x37b251,'segmentName':_0x2a1eda,'folderPath':_0x3619bc,'fullPath':_0x21423d,'resourceType':_0x1204b7};}
@@ -1 +1 @@
1
- function a120_0x7657(_0x19e2ff,_0x4eeb0d){_0x19e2ff=_0x19e2ff-0x90;const _0x1a68af=a120_0x1a68();let _0x765712=_0x1a68af[_0x19e2ff];return _0x765712;}(function(_0x3d86af,_0x3388c0){const _0x1ec159=a120_0x7657,_0x4edafb=_0x3d86af();while(!![]){try{const _0x5e05c4=-parseInt(_0x1ec159(0x92))/0x1*(parseInt(_0x1ec159(0x9f))/0x2)+parseInt(_0x1ec159(0x90))/0x3*(-parseInt(_0x1ec159(0x93))/0x4)+-parseInt(_0x1ec159(0x99))/0x5*(-parseInt(_0x1ec159(0x9d))/0x6)+parseInt(_0x1ec159(0x95))/0x7+parseInt(_0x1ec159(0x9b))/0x8+parseInt(_0x1ec159(0x96))/0x9+parseInt(_0x1ec159(0x98))/0xa*(-parseInt(_0x1ec159(0x9a))/0xb);if(_0x5e05c4===_0x3388c0)break;else _0x4edafb['push'](_0x4edafb['shift']());}catch(_0xc84bb9){_0x4edafb['push'](_0x4edafb['shift']());}}}(a120_0x1a68,0x4321d));export function parseSegmentRef(_0x29f849){const _0x356d19=a120_0x7657,_0x47c9a5=_0x29f849[_0x356d19(0x91)]('/');if(_0x47c9a5===-0x1)return{'parentId':_0x29f849};if(_0x47c9a5===0x0)throw new Error(_0x356d19(0x9e)+_0x29f849+_0x356d19(0x94));const _0xe8548a=_0x29f849[_0x356d19(0x97)](0x0,_0x47c9a5),_0x2a4654=_0x29f849['substring'](_0x47c9a5+0x1);if(_0x2a4654==='')throw new Error(_0x356d19(0x9e)+_0x29f849+_0x356d19(0x9c));return{'parentId':_0xe8548a,'childId':_0x2a4654};}function a120_0x1a68(){const _0xea5779=['Invalid\x20segment\x20reference\x20format:\x20','25406cvPyUO','6OndoBw','indexOf','10nqdlJS','818932igBzif','.\x20Parent\x20name\x20cannot\x20be\x20empty','1759807WQeOZR','2514447IhmVOY','substring','2631950dtShdE','5810SGByRK','11znHjoY','2863680XlIGdR','.\x20Child\x20name\x20cannot\x20be\x20empty','960uzKVie'];a120_0x1a68=function(){return _0xea5779;};return a120_0x1a68();}
1
+ (function(_0xca15c2,_0x522ca2){const _0x3e122e=a120_0x5b02,_0x516734=_0xca15c2();while(!![]){try{const _0x56bfaf=parseInt(_0x3e122e(0xc1))/0x1+-parseInt(_0x3e122e(0xc3))/0x2+-parseInt(_0x3e122e(0xc2))/0x3+parseInt(_0x3e122e(0xb9))/0x4*(parseInt(_0x3e122e(0xbe))/0x5)+parseInt(_0x3e122e(0xba))/0x6+parseInt(_0x3e122e(0xb8))/0x7+-parseInt(_0x3e122e(0xbf))/0x8*(parseInt(_0x3e122e(0xbd))/0x9);if(_0x56bfaf===_0x522ca2)break;else _0x516734['push'](_0x516734['shift']());}catch(_0x4021a4){_0x516734['push'](_0x516734['shift']());}}}(a120_0x11b7,0x9229f));function a120_0x5b02(_0x4ed3d4,_0x2e4a33){_0x4ed3d4=_0x4ed3d4-0xb8;const _0x11b7c6=a120_0x11b7();let _0x5b02a4=_0x11b7c6[_0x4ed3d4];return _0x5b02a4;}export function parseSegmentRef(_0x17ef2d){const _0x5401f2=a120_0x5b02,_0x4308e9=_0x17ef2d[_0x5401f2(0xc0)]('/');if(_0x4308e9===-0x1)return{'parentId':_0x17ef2d};if(_0x4308e9===0x0)throw new Error(_0x5401f2(0xc4)+_0x17ef2d+_0x5401f2(0xbc));const _0x34603a=_0x17ef2d[_0x5401f2(0xbb)](0x0,_0x4308e9),_0x578fd1=_0x17ef2d['substring'](_0x4308e9+0x1);if(_0x578fd1==='')throw new Error(_0x5401f2(0xc4)+_0x17ef2d+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x34603a,'childId':_0x578fd1};}function a120_0x11b7(){const _0x3867aa=['22320MClycS','2680ZAfDVK','indexOf','336395BrKtIf','2523162opXaVg','166338zpqBkt','Invalid\x20segment\x20reference\x20format:\x20','5700247XKZhZy','276IQAiuh','1100628WoXwtk','substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','3204TDrLKO'];a120_0x11b7=function(){return _0x3867aa;};return a120_0x11b7();}
@@ -1 +1 @@
1
- (function(_0x1eafe8,_0x269e13){const _0x11fc02=a121_0x4007,_0x5df270=_0x1eafe8();while(!![]){try{const _0x4e0972=parseInt(_0x11fc02(0xc9))/0x1+-parseInt(_0x11fc02(0xad))/0x2+parseInt(_0x11fc02(0xcc))/0x3+-parseInt(_0x11fc02(0xc5))/0x4*(parseInt(_0x11fc02(0xc6))/0x5)+parseInt(_0x11fc02(0xb6))/0x6*(-parseInt(_0x11fc02(0xa8))/0x7)+-parseInt(_0x11fc02(0xc4))/0x8*(parseInt(_0x11fc02(0xc2))/0x9)+-parseInt(_0x11fc02(0xc1))/0xa*(-parseInt(_0x11fc02(0xa0))/0xb);if(_0x4e0972===_0x269e13)break;else _0x5df270['push'](_0x5df270['shift']());}catch(_0x5eee13){_0x5df270['push'](_0x5df270['shift']());}}}(a121_0x73b1,0xcfd3f));import a121_0x242f2d from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';function a121_0x73b1(){const _0x13a51e=['31914580RXYGfo','54sIMUBf','match','899408MsFoYZ','4Bvobyb','7796515koTMcR','configDir','parentSegment','495956gFeRUf','basename','no_parent','1613034WSCtfN','includes','folderPath','segment','extname','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','tdx.json','directory','isDirectory','startsWith','parse','resourceType','11ithGdv','File\x20not\x20found','exists','resolve','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','replace','File\x20not\x20found:\x20','1045002oKSQiv','cwd','string','trim','No\x20tdx.json\x20found\x20for\x20file:\x20','1981368hGmVbG','Not\x20a\x20YAML\x20file:\x20','parent_segment','dirname','scopedFolderPath','parent_name','type','error','context','6mxMbSI','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','readFile','join','stat','segmentName','no_config','invalid_yaml','journey','isScoped','file'];a121_0x73b1=function(){return _0x13a51e;};return a121_0x73b1();}function a121_0x4007(_0x229714,_0x5f479c){_0x229714=_0x229714-0x9c;const _0x73b14=a121_0x73b1();let _0x40077d=_0x73b14[_0x229714];return _0x40077d;}import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x47f2e9){const _0x1bd8bd=a121_0x4007;return _0x47f2e9['type']!==_0x1bd8bd(0xb4);}export function isScopedResolution(_0x8a0fb0){const _0x38c5c3=a121_0x4007;return _0x8a0fb0[_0x38c5c3(0xb3)]===_0x38c5c3(0xd3)||_0x8a0fb0[_0x38c5c3(0xb3)]===_0x38c5c3(0xc0)||_0x8a0fb0[_0x38c5c3(0xb3)]===_0x38c5c3(0xb5);}export function getScopedDetails(_0x77e4ca){const _0x3b90f5=a121_0x4007;if(isScopedResolution(_0x77e4ca))return{'isScoped':_0x77e4ca[_0x3b90f5(0xbf)],'scopedFolderPath':_0x77e4ca[_0x3b90f5(0xb1)]};return undefined;}async function findTdxConfigAsync(_0x247de0,_0x433778){const _0x2b9023=a121_0x4007;let _0x3bd05c=a121_0x242f2d[_0x2b9023(0xa3)](_0x247de0);const _0x5e8e9b=a121_0x242f2d['parse'](_0x3bd05c)['root'];while(_0x3bd05c!==_0x5e8e9b){const _0x26b265=a121_0x242f2d[_0x2b9023(0xb9)](_0x3bd05c,_0x2b9023(0xd2));if(await _0x433778[_0x2b9023(0xa2)](_0x26b265))try{const _0x43b638=await _0x433778[_0x2b9023(0xb8)](_0x26b265),_0x2e6c0e=JSON[_0x2b9023(0x9e)](_0x43b638);if(_0x2e6c0e[_0x2b9023(0xaf)]&&typeof _0x2e6c0e[_0x2b9023(0xaf)]===_0x2b9023(0xaa))return{'configPath':_0x26b265,'configDir':_0x3bd05c,'parentSegment':_0x2e6c0e[_0x2b9023(0xaf)]};}catch{}_0x3bd05c=a121_0x242f2d[_0x2b9023(0xb0)](_0x3bd05c);}return null;}function calculateScopedPath(_0x28e5ec,_0xcc35cb){const _0x54a688=a121_0x4007,_0x2c8957=a121_0x242f2d['relative'](_0xcc35cb,_0x28e5ec),_0x5e918f=_0x2c8957!==''&&_0x2c8957!=='.'&&!_0x2c8957[_0x54a688(0x9d)]('..');return{'isScoped':_0x5e918f,'scopedFolderPath':_0x5e918f?_0x2c8957[_0x54a688(0xa6)](/\\/g,'/'):''};}export async function resolveTarget(_0x2011a8){const _0x22ddf2=a121_0x4007,{arg:_0x3119c4,contextParent:_0x2e70d7,cwd:cwd=process[_0x22ddf2(0xa9)](),fs:fs=nodeFileSystem}=_0x2011a8;if(_0x3119c4&&isYamlFilePath(_0x3119c4))try{const _0x56ef7e=await resolveYamlFilePath(_0x3119c4,fs),_0x49ad07=a121_0x242f2d[_0x22ddf2(0xa3)](_0x3119c4),_0x21a58e=a121_0x242f2d[_0x22ddf2(0xb0)](_0x49ad07),_0x4a7d9f=await findTdxConfigAsync(_0x21a58e,fs);if(!_0x4a7d9f){if(_0x2e70d7){const _0x29ded7=a121_0x242f2d[_0x22ddf2(0xb0)](_0x49ad07);return{'type':'file','parentName':_0x2e70d7,'targetDir':_0x29ded7,'configRoot':_0x29ded7,'filePath':_0x49ad07,'resourceName':_0x56ef7e[_0x22ddf2(0xbb)],'folderPath':_0x56ef7e['folderPath'],'resourceType':_0x56ef7e[_0x22ddf2(0x9f)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x22ddf2(0xb4),'errorCode':'no_config','message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x3119c4,'arg':_0x3119c4,'helpText':_0x22ddf2(0xd1)};}const _0x322424=calculateScopedPath(_0x21a58e,_0x4a7d9f[_0x22ddf2(0xc7)]);return{'type':'file','parentName':_0x4a7d9f[_0x22ddf2(0xc8)],'targetDir':_0x4a7d9f[_0x22ddf2(0xc7)],'configRoot':_0x4a7d9f['configDir'],'filePath':_0x49ad07,'resourceName':_0x56ef7e['segmentName'],'folderPath':_0x56ef7e[_0x22ddf2(0xce)],'resourceType':_0x56ef7e[_0x22ddf2(0x9f)],'isScoped':_0x322424[_0x22ddf2(0xbf)],'scopedFolderPath':_0x322424[_0x22ddf2(0xb1)]};}catch(_0x26f689){const _0x1f2246=_0x26f689 instanceof Error?_0x26f689['message']:String(_0x26f689);if(_0x1f2246[_0x22ddf2(0xcd)](_0x22ddf2(0xa1)))return{'type':'error','errorCode':'file_not_found','message':_0x22ddf2(0xa7)+_0x3119c4,'arg':_0x3119c4};if(_0x1f2246[_0x22ddf2(0xcd)]('No\x20tdx.json\x20found')){if(_0x2e70d7){const _0x13842c=a121_0x242f2d[_0x22ddf2(0xa3)](_0x3119c4);if(await fs['exists'](_0x13842c)){const _0x4c3d68=a121_0x242f2d[_0x22ddf2(0xb0)](_0x13842c),_0x427c74=await fs[_0x22ddf2(0xb8)](_0x13842c),_0x3747a9=_0x427c74[_0x22ddf2(0xc3)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x23a619=_0x427c74['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x29dcf1=_0x3747a9?_0x3747a9[0x1][_0x22ddf2(0xab)]():a121_0x242f2d[_0x22ddf2(0xca)](_0x3119c4,a121_0x242f2d[_0x22ddf2(0xd0)](_0x3119c4)),_0x204534=_0x23a619&&_0x23a619[0x1][_0x22ddf2(0xab)]()==='journey'?_0x22ddf2(0xbe):_0x22ddf2(0xcf);return{'type':_0x22ddf2(0xc0),'parentName':_0x2e70d7,'targetDir':_0x4c3d68,'configRoot':_0x4c3d68,'filePath':_0x13842c,'resourceName':_0x29dcf1,'folderPath':'','resourceType':_0x204534,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x22ddf2(0xb4),'errorCode':_0x22ddf2(0xbc),'message':_0x22ddf2(0xac)+_0x3119c4,'arg':_0x3119c4,'helpText':_0x22ddf2(0xd1)};}return{'type':_0x22ddf2(0xb4),'errorCode':_0x22ddf2(0xbd),'message':_0x1f2246,'arg':_0x3119c4};}if(_0x3119c4){const _0x1cfe92=a121_0x242f2d[_0x22ddf2(0xa3)](cwd,_0x3119c4);let _0x40711c=null;try{_0x40711c=await fs[_0x22ddf2(0xba)](_0x1cfe92);}catch{}if(_0x40711c?.[_0x22ddf2(0x9c)]()){const _0x4f6e3c=await findTdxConfigAsync(_0x1cfe92,fs);if(_0x4f6e3c){const _0x164c9e=calculateScopedPath(_0x1cfe92,_0x4f6e3c[_0x22ddf2(0xc7)]);return{'type':_0x22ddf2(0xd3),'parentName':_0x4f6e3c[_0x22ddf2(0xc8)],'targetDir':_0x1cfe92,'configRoot':_0x4f6e3c[_0x22ddf2(0xc7)],'isScoped':_0x164c9e[_0x22ddf2(0xbf)],'scopedFolderPath':_0x164c9e[_0x22ddf2(0xb1)]};}if(_0x2e70d7)return{'type':'directory','parentName':_0x2e70d7,'targetDir':_0x1cfe92,'configRoot':_0x1cfe92,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x22ddf2(0xbc),'message':_0x22ddf2(0xb7)+_0x3119c4,'arg':_0x3119c4,'helpText':_0x22ddf2(0xd1)};}if(_0x40711c?.[_0x22ddf2(0xa4)]())return{'type':_0x22ddf2(0xb4),'errorCode':'invalid_yaml','message':_0x22ddf2(0xae)+_0x3119c4,'arg':_0x3119c4,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x4bfbd2=sanitizeFileName(_0x3119c4),_0x4d044d=getSegmentRootDir(_0x4bfbd2,cwd);return{'type':_0x22ddf2(0xb2),'parentName':_0x3119c4,'targetDir':_0x4d044d,'configRoot':_0x4d044d};}const _0x25ddd1=await findTdxConfigAsync(cwd,fs);if(_0x25ddd1){const _0x253998=calculateScopedPath(cwd,_0x25ddd1['configDir']);return{'type':_0x22ddf2(0xb5),'parentName':_0x25ddd1[_0x22ddf2(0xc8)],'targetDir':cwd,'configRoot':_0x25ddd1[_0x22ddf2(0xc7)],'isScoped':_0x253998[_0x22ddf2(0xbf)],'scopedFolderPath':_0x253998[_0x22ddf2(0xb1)]};}if(_0x2e70d7){const _0x4b6509=sanitizeFileName(_0x2e70d7),_0x31c93c=getSegmentRootDir(_0x4b6509,cwd);return{'type':_0x22ddf2(0xb5),'parentName':_0x2e70d7,'targetDir':_0x31c93c,'configRoot':_0x31c93c,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x22ddf2(0xb4),'errorCode':_0x22ddf2(0xcb),'message':'Parent\x20segment\x20not\x20specified','helpText':_0x22ddf2(0xa5)};}
1
+ function a121_0x4d5b(_0x3f18ce,_0x49ebea){_0x3f18ce=_0x3f18ce-0x17b;const _0x3e7794=a121_0x3e77();let _0x4d5b85=_0x3e7794[_0x3f18ce];return _0x4d5b85;}(function(_0x12b5aa,_0x3052dc){const _0x3bee70=a121_0x4d5b,_0x5a71ee=_0x12b5aa();while(!![]){try{const _0x2440a1=-parseInt(_0x3bee70(0x1ab))/0x1*(parseInt(_0x3bee70(0x19b))/0x2)+-parseInt(_0x3bee70(0x180))/0x3*(-parseInt(_0x3bee70(0x195))/0x4)+-parseInt(_0x3bee70(0x17f))/0x5+-parseInt(_0x3bee70(0x1ac))/0x6+-parseInt(_0x3bee70(0x19d))/0x7+parseInt(_0x3bee70(0x17d))/0x8+parseInt(_0x3bee70(0x19e))/0x9;if(_0x2440a1===_0x3052dc)break;else _0x5a71ee['push'](_0x5a71ee['shift']());}catch(_0x43f482){_0x5a71ee['push'](_0x5a71ee['shift']());}}}(a121_0x3e77,0x9fc7a));import a121_0x4d1865 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';function a121_0x3e77(){const _0x4c913d=['segmentName','invalid_yaml','142UNsslx','no_parent','3232369decACn','17841483QIMKvt','match','basename','No\x20tdx.json\x20found','type','join','trim','readFile','parentSegment','extname','parse','string','cwd','15635WukYFb','7348104dIyGtt','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','message','isFile','root','isDirectory','6341016rqiAKP','isScoped','2800365Uwnqsr','3708159aONJWU','exists','error','parent_segment','directory','includes','context','parent_name','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','tdx.json','startsWith','dirname','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','journey','replace','scopedFolderPath','resolve','no_config','file','resourceType','4LrthVT','folderPath','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','Parent\x20segment\x20not\x20specified'];a121_0x3e77=function(){return _0x4c913d;};return a121_0x3e77();}import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x45a08d){const _0x478daa=a121_0x4d5b;return _0x45a08d[_0x478daa(0x1a2)]!=='error';}export function isScopedResolution(_0x47c9fe){const _0x9a11d7=a121_0x4d5b;return _0x47c9fe[_0x9a11d7(0x1a2)]===_0x9a11d7(0x184)||_0x47c9fe['type']===_0x9a11d7(0x193)||_0x47c9fe['type']===_0x9a11d7(0x186);}export function getScopedDetails(_0xf9581c){const _0x565d79=a121_0x4d5b;if(isScopedResolution(_0xf9581c))return{'isScoped':_0xf9581c[_0x565d79(0x17e)],'scopedFolderPath':_0xf9581c['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x187c59,_0x5bcfca){const _0x21bb52=a121_0x4d5b;let _0xa47edb=a121_0x4d1865['resolve'](_0x187c59);const _0x53efbc=a121_0x4d1865[_0x21bb52(0x1a8)](_0xa47edb)[_0x21bb52(0x17b)];while(_0xa47edb!==_0x53efbc){const _0x6d747f=a121_0x4d1865[_0x21bb52(0x1a3)](_0xa47edb,_0x21bb52(0x189));if(await _0x5bcfca[_0x21bb52(0x181)](_0x6d747f))try{const _0x15597f=await _0x5bcfca[_0x21bb52(0x1a5)](_0x6d747f),_0xf290f6=JSON['parse'](_0x15597f);if(_0xf290f6[_0x21bb52(0x183)]&&typeof _0xf290f6['parent_segment']===_0x21bb52(0x1a9))return{'configPath':_0x6d747f,'configDir':_0xa47edb,'parentSegment':_0xf290f6[_0x21bb52(0x183)]};}catch{}_0xa47edb=a121_0x4d1865[_0x21bb52(0x18b)](_0xa47edb);}return null;}function calculateScopedPath(_0x1db7d1,_0x548558){const _0x839b76=a121_0x4d5b,_0x55fba0=a121_0x4d1865['relative'](_0x548558,_0x1db7d1),_0x51bfa9=_0x55fba0!==''&&_0x55fba0!=='.'&&!_0x55fba0[_0x839b76(0x18a)]('..');return{'isScoped':_0x51bfa9,'scopedFolderPath':_0x51bfa9?_0x55fba0[_0x839b76(0x18f)](/\\/g,'/'):''};}export async function resolveTarget(_0x21e53e){const _0x1aa4ff=a121_0x4d5b,{arg:_0x1f4e7a,contextParent:_0x3641db,cwd:cwd=process[_0x1aa4ff(0x1aa)](),fs:fs=nodeFileSystem}=_0x21e53e;if(_0x1f4e7a&&isYamlFilePath(_0x1f4e7a))try{const _0x3d9c53=await resolveYamlFilePath(_0x1f4e7a,fs),_0x24ca8d=a121_0x4d1865[_0x1aa4ff(0x191)](_0x1f4e7a),_0x314f02=a121_0x4d1865['dirname'](_0x24ca8d),_0x52858d=await findTdxConfigAsync(_0x314f02,fs);if(!_0x52858d){if(_0x3641db){const _0x49ed62=a121_0x4d1865[_0x1aa4ff(0x18b)](_0x24ca8d);return{'type':_0x1aa4ff(0x193),'parentName':_0x3641db,'targetDir':_0x49ed62,'configRoot':_0x49ed62,'filePath':_0x24ca8d,'resourceName':_0x3d9c53[_0x1aa4ff(0x199)],'folderPath':_0x3d9c53[_0x1aa4ff(0x196)],'resourceType':_0x3d9c53['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1aa4ff(0x182),'errorCode':_0x1aa4ff(0x192),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x1f4e7a,'arg':_0x1f4e7a,'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 _0x5bef30=calculateScopedPath(_0x314f02,_0x52858d['configDir']);return{'type':'file','parentName':_0x52858d[_0x1aa4ff(0x1a6)],'targetDir':_0x52858d[_0x1aa4ff(0x18d)],'configRoot':_0x52858d['configDir'],'filePath':_0x24ca8d,'resourceName':_0x3d9c53[_0x1aa4ff(0x199)],'folderPath':_0x3d9c53[_0x1aa4ff(0x196)],'resourceType':_0x3d9c53[_0x1aa4ff(0x194)],'isScoped':_0x5bef30[_0x1aa4ff(0x17e)],'scopedFolderPath':_0x5bef30['scopedFolderPath']};}catch(_0x24b8e7){const _0x553388=_0x24b8e7 instanceof Error?_0x24b8e7[_0x1aa4ff(0x1ae)]:String(_0x24b8e7);if(_0x553388[_0x1aa4ff(0x185)]('File\x20not\x20found'))return{'type':'error','errorCode':'file_not_found','message':'File\x20not\x20found:\x20'+_0x1f4e7a,'arg':_0x1f4e7a};if(_0x553388['includes'](_0x1aa4ff(0x1a1))){if(_0x3641db){const _0x5af083=a121_0x4d1865[_0x1aa4ff(0x191)](_0x1f4e7a);if(await fs[_0x1aa4ff(0x181)](_0x5af083)){const _0x39436c=a121_0x4d1865[_0x1aa4ff(0x18b)](_0x5af083),_0x3f7cf9=await fs[_0x1aa4ff(0x1a5)](_0x5af083),_0x2e1689=_0x3f7cf9[_0x1aa4ff(0x19f)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x6bb919=_0x3f7cf9[_0x1aa4ff(0x19f)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4717dd=_0x2e1689?_0x2e1689[0x1][_0x1aa4ff(0x1a4)]():a121_0x4d1865[_0x1aa4ff(0x1a0)](_0x1f4e7a,a121_0x4d1865[_0x1aa4ff(0x1a7)](_0x1f4e7a)),_0x183a48=_0x6bb919&&_0x6bb919[0x1][_0x1aa4ff(0x1a4)]()===_0x1aa4ff(0x18e)?_0x1aa4ff(0x18e):'segment';return{'type':_0x1aa4ff(0x193),'parentName':_0x3641db,'targetDir':_0x39436c,'configRoot':_0x39436c,'filePath':_0x5af083,'resourceName':_0x4717dd,'folderPath':'','resourceType':_0x183a48,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x1aa4ff(0x182),'errorCode':'no_config','message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x1f4e7a,'arg':_0x1f4e7a,'helpText':_0x1aa4ff(0x18c)};}return{'type':_0x1aa4ff(0x182),'errorCode':'invalid_yaml','message':_0x553388,'arg':_0x1f4e7a};}if(_0x1f4e7a){const _0x543d05=a121_0x4d1865[_0x1aa4ff(0x191)](cwd,_0x1f4e7a);let _0x173011=null;try{_0x173011=await fs['stat'](_0x543d05);}catch{}if(_0x173011?.[_0x1aa4ff(0x17c)]()){const _0x439ae5=await findTdxConfigAsync(_0x543d05,fs);if(_0x439ae5){const _0x24d47f=calculateScopedPath(_0x543d05,_0x439ae5[_0x1aa4ff(0x18d)]);return{'type':_0x1aa4ff(0x184),'parentName':_0x439ae5['parentSegment'],'targetDir':_0x543d05,'configRoot':_0x439ae5['configDir'],'isScoped':_0x24d47f['isScoped'],'scopedFolderPath':_0x24d47f[_0x1aa4ff(0x190)]};}if(_0x3641db)return{'type':_0x1aa4ff(0x184),'parentName':_0x3641db,'targetDir':_0x543d05,'configRoot':_0x543d05,'isScoped':![],'scopedFolderPath':''};return{'type':_0x1aa4ff(0x182),'errorCode':'no_config','message':_0x1aa4ff(0x188)+_0x1f4e7a,'arg':_0x1f4e7a,'helpText':_0x1aa4ff(0x18c)};}if(_0x173011?.[_0x1aa4ff(0x1af)]())return{'type':_0x1aa4ff(0x182),'errorCode':_0x1aa4ff(0x19a),'message':'Not\x20a\x20YAML\x20file:\x20'+_0x1f4e7a,'arg':_0x1f4e7a,'helpText':_0x1aa4ff(0x197)};const _0x22aa76=sanitizeFileName(_0x1f4e7a),_0x23cec9=getSegmentRootDir(_0x22aa76,cwd);return{'type':_0x1aa4ff(0x187),'parentName':_0x1f4e7a,'targetDir':_0x23cec9,'configRoot':_0x23cec9};}const _0xa57359=await findTdxConfigAsync(cwd,fs);if(_0xa57359){const _0x50fcf1=calculateScopedPath(cwd,_0xa57359[_0x1aa4ff(0x18d)]);return{'type':_0x1aa4ff(0x186),'parentName':_0xa57359[_0x1aa4ff(0x1a6)],'targetDir':cwd,'configRoot':_0xa57359['configDir'],'isScoped':_0x50fcf1['isScoped'],'scopedFolderPath':_0x50fcf1[_0x1aa4ff(0x190)]};}if(_0x3641db){const _0x598cef=sanitizeFileName(_0x3641db),_0x594c06=getSegmentRootDir(_0x598cef,cwd);return{'type':'context','parentName':_0x3641db,'targetDir':_0x594c06,'configRoot':_0x594c06,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1aa4ff(0x182),'errorCode':_0x1aa4ff(0x19c),'message':_0x1aa4ff(0x198),'helpText':_0x1aa4ff(0x1ad)};}
@@ -1 +1 @@
1
- const a122_0x962f81=a122_0x2793;(function(_0x4c2544,_0x39a1f0){const _0x2c3a08=a122_0x2793,_0x1b1f98=_0x4c2544();while(!![]){try{const _0x2306fb=parseInt(_0x2c3a08(0x152))/0x1*(parseInt(_0x2c3a08(0x164))/0x2)+parseInt(_0x2c3a08(0x167))/0x3+-parseInt(_0x2c3a08(0x15a))/0x4*(-parseInt(_0x2c3a08(0x151))/0x5)+-parseInt(_0x2c3a08(0x161))/0x6*(-parseInt(_0x2c3a08(0x157))/0x7)+parseInt(_0x2c3a08(0x153))/0x8+parseInt(_0x2c3a08(0x16a))/0x9*(-parseInt(_0x2c3a08(0x150))/0xa)+-parseInt(_0x2c3a08(0x15d))/0xb*(parseInt(_0x2c3a08(0x160))/0xc);if(_0x2306fb===_0x39a1f0)break;else _0x1b1f98['push'](_0x1b1f98['shift']());}catch(_0x2fac85){_0x1b1f98['push'](_0x1b1f98['shift']());}}}(a122_0x110c,0xba08d));import{existsSync,readFileSync}from'fs';import a122_0x1e725c from'path';const TDX_CONFIG_FILE='tdx.json',SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x261668=process[a122_0x962f81(0x15e)]()){const _0x38cab4=a122_0x962f81;let _0x95bfcf=a122_0x1e725c[_0x38cab4(0x15c)](_0x261668);const _0x2d044c=a122_0x1e725c['parse'](_0x95bfcf)[_0x38cab4(0x15b)];while(_0x95bfcf!==_0x2d044c){const _0x4f5034=a122_0x1e725c[_0x38cab4(0x169)](_0x95bfcf,TDX_CONFIG_FILE);if(existsSync(_0x4f5034))return _0x4f5034;_0x95bfcf=a122_0x1e725c['dirname'](_0x95bfcf);}return null;}export function loadTdxConfig(_0x18d745){const _0x51b978=a122_0x962f81,_0x2f8d03=readFileSync(_0x18d745,_0x51b978(0x165));let _0x57e791;try{_0x57e791=JSON['parse'](_0x2f8d03);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x18d745);}if(!_0x57e791||typeof _0x57e791!==_0x51b978(0x158))throw new Error(_0x51b978(0x159));const _0x22081e=_0x57e791;if(!_0x22081e[_0x51b978(0x168)]||typeof _0x22081e[_0x51b978(0x168)]!==_0x51b978(0x162))throw new Error(_0x51b978(0x166));return{'parent_segment':_0x22081e['parent_segment']};}export function findTdxConfig(_0x512f00=process[a122_0x962f81(0x15e)]()){const _0x3c0a4e=a122_0x962f81,_0x3285d4=findTdxConfigPath(_0x512f00);if(!_0x3285d4)throw new Error(_0x3c0a4e(0x154));const _0x193dd4=loadTdxConfig(_0x3285d4),_0x50bd21=a122_0x1e725c[_0x3c0a4e(0x15f)](_0x3285d4);return{'config':_0x193dd4,'configPath':_0x3285d4,'configDir':_0x50bd21};}export function tryFindTdxConfig(_0x241a70){try{return findTdxConfig(_0x241a70);}catch{return null;}}export function getSegmentRootDir(_0x5781ad,_0x39432a=process[a122_0x962f81(0x15e)]()){const _0x27a2c6=a122_0x962f81;return a122_0x1e725c[_0x27a2c6(0x169)](_0x39432a,SEGMENTS_DIR,_0x5781ad);}export function getTdxConfigPath(_0x4a2a26,_0xbcc75f=process[a122_0x962f81(0x15e)]()){const _0x411a77=a122_0x962f81;return a122_0x1e725c[_0x411a77(0x169)](getSegmentRootDir(_0x4a2a26,_0xbcc75f),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0xc7a3a2,_0x40fc2c){const _0x49c429=a122_0x962f81,_0x1424cc=a122_0x1e725c[_0x49c429(0x15c)](_0xc7a3a2),_0x4442ee=a122_0x1e725c[_0x49c429(0x163)](_0x40fc2c,_0x1424cc);if(_0x4442ee[_0x49c429(0x155)]('..'))return'';return _0x4442ee;}export function localPathToTdFolderPath(_0x40d009){const _0x4aa4bd=a122_0x962f81,_0x1c1546=a122_0x1e725c[_0x4aa4bd(0x15f)](_0x40d009);if(_0x1c1546==='.'||_0x1c1546==='')return'';return _0x1c1546['replace'](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x43b604,_0x5333a1){if(!_0x43b604)return _0x5333a1;return a122_0x1e725c['join'](_0x5333a1,_0x43b604);}export function createTdxConfigContent(_0x724c85){const _0x1d27b3=a122_0x962f81,_0x156bc7={'parent_segment':_0x724c85};return JSON[_0x1d27b3(0x156)](_0x156bc7,null,0x2)+'\x0a';}function a122_0x2793(_0xf9ecc7,_0x2c616f){_0xf9ecc7=_0xf9ecc7-0x150;const _0x110cf7=a122_0x110c();let _0x279341=_0x110cf7[_0xf9ecc7];return _0x279341;}function a122_0x110c(){const _0xb62964=['167FxfDWU','8258912rufQoy','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','startsWith','stringify','2050482XivBSH','object','Invalid\x20tdx.json:\x20expected\x20object','16LIevMA','root','resolve','1859yuasnV','cwd','dirname','146292JaRsod','12BKarfu','string','relative','1012VINqvN','utf-8','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','2568696gItPrO','parent_segment','join','49230wEnxNo','1270vpykoi','1197520yCiHFz'];a122_0x110c=function(){return _0xb62964;};return a122_0x110c();}
1
+ const a122_0x55d811=a122_0x3b70;(function(_0x1aebd3,_0x995ff4){const _0x5b7d65=a122_0x3b70,_0x401198=_0x1aebd3();while(!![]){try{const _0x26988d=parseInt(_0x5b7d65(0x1bd))/0x1+parseInt(_0x5b7d65(0x1cf))/0x2*(parseInt(_0x5b7d65(0x1c2))/0x3)+-parseInt(_0x5b7d65(0x1ca))/0x4+parseInt(_0x5b7d65(0x1c9))/0x5*(-parseInt(_0x5b7d65(0x1cb))/0x6)+-parseInt(_0x5b7d65(0x1be))/0x7+parseInt(_0x5b7d65(0x1bf))/0x8*(-parseInt(_0x5b7d65(0x1c4))/0x9)+parseInt(_0x5b7d65(0x1d1))/0xa;if(_0x26988d===_0x995ff4)break;else _0x401198['push'](_0x401198['shift']());}catch(_0x460025){_0x401198['push'](_0x401198['shift']());}}}(a122_0x4c92,0x491f9));import{existsSync,readFileSync}from'fs';import a122_0x5d9dfd from'path';const TDX_CONFIG_FILE='tdx.json',SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x3d2ba9=process[a122_0x55d811(0x1bc)]()){const _0x27f2fc=a122_0x55d811;let _0x14bdbb=a122_0x5d9dfd[_0x27f2fc(0x1c6)](_0x3d2ba9);const _0x51f9f3=a122_0x5d9dfd[_0x27f2fc(0x1c1)](_0x14bdbb)[_0x27f2fc(0x1c0)];while(_0x14bdbb!==_0x51f9f3){const _0x419950=a122_0x5d9dfd[_0x27f2fc(0x1d2)](_0x14bdbb,TDX_CONFIG_FILE);if(existsSync(_0x419950))return _0x419950;_0x14bdbb=a122_0x5d9dfd[_0x27f2fc(0x1c3)](_0x14bdbb);}return null;}export function loadTdxConfig(_0x3f6055){const _0x3f97ef=a122_0x55d811,_0x12d11b=readFileSync(_0x3f6055,'utf-8');let _0x45774d;try{_0x45774d=JSON['parse'](_0x12d11b);}catch{throw new Error(_0x3f97ef(0x1c7)+_0x3f6055);}if(!_0x45774d||typeof _0x45774d!==_0x3f97ef(0x1ba))throw new Error(_0x3f97ef(0x1ce));const _0x311f96=_0x45774d;if(!_0x311f96['parent_segment']||typeof _0x311f96[_0x3f97ef(0x1bb)]!==_0x3f97ef(0x1d3))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field');return{'parent_segment':_0x311f96[_0x3f97ef(0x1bb)]};}export function findTdxConfig(_0x3865d5=process[a122_0x55d811(0x1bc)]()){const _0x52c8c4=a122_0x55d811,_0x778e87=findTdxConfigPath(_0x3865d5);if(!_0x778e87)throw new Error(_0x52c8c4(0x1cc));const _0x5bef1f=loadTdxConfig(_0x778e87),_0x31a10c=a122_0x5d9dfd[_0x52c8c4(0x1c3)](_0x778e87);return{'config':_0x5bef1f,'configPath':_0x778e87,'configDir':_0x31a10c};}export function tryFindTdxConfig(_0xb26699){try{return findTdxConfig(_0xb26699);}catch{return null;}}export function getSegmentRootDir(_0x589dce,_0x4c0d2f=process[a122_0x55d811(0x1bc)]()){const _0x5e8ab1=a122_0x55d811;return a122_0x5d9dfd[_0x5e8ab1(0x1d2)](_0x4c0d2f,SEGMENTS_DIR,_0x589dce);}export function getTdxConfigPath(_0x3c3d12,_0x210d17=process['cwd']()){const _0x419043=a122_0x55d811;return a122_0x5d9dfd[_0x419043(0x1d2)](getSegmentRootDir(_0x3c3d12,_0x210d17),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x5ebbf6,_0x4fa03f){const _0x4230a8=a122_0x55d811,_0x343382=a122_0x5d9dfd['resolve'](_0x5ebbf6),_0x10b542=a122_0x5d9dfd[_0x4230a8(0x1c8)](_0x4fa03f,_0x343382);if(_0x10b542[_0x4230a8(0x1d0)]('..'))return'';return _0x10b542;}export function localPathToTdFolderPath(_0x1caea1){const _0x250b7a=a122_0x55d811,_0x285c0c=a122_0x5d9dfd[_0x250b7a(0x1c3)](_0x1caea1);if(_0x285c0c==='.'||_0x285c0c==='')return'';return _0x285c0c[_0x250b7a(0x1c5)](/\\/g,'/');}function a122_0x3b70(_0x33f644,_0x54f81f){_0x33f644=_0x33f644-0x1ba;const _0x4c922b=a122_0x4c92();let _0x3b7096=_0x4c922b[_0x33f644];return _0x3b7096;}export function tdFolderPathToLocalPath(_0x2d4f97,_0x539f39){const _0x127379=a122_0x55d811;if(!_0x2d4f97)return _0x539f39;return a122_0x5d9dfd[_0x127379(0x1d2)](_0x539f39,_0x2d4f97);}export function createTdxConfigContent(_0x5f4a8e){const _0x23daa7=a122_0x55d811,_0x57f451={'parent_segment':_0x5f4a8e};return JSON[_0x23daa7(0x1cd)](_0x57f451,null,0x2)+'\x0a';}function a122_0x4c92(){const _0x19ed21=['117AcyIoi','replace','resolve','Invalid\x20JSON\x20in\x20','relative','5ahZdYW','205404jUIvXi','1657662vTzgiL','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','stringify','Invalid\x20tdx.json:\x20expected\x20object','8TNlQDi','startsWith','4850150RIHqyX','join','string','object','parent_segment','cwd','214366HRIows','875483vFjAjW','181080hPdwpL','root','parse','260313bjTNZX','dirname'];a122_0x4c92=function(){return _0x19ed21;};return a122_0x4c92();}