@treasuredata/tdx 0.16.16 → 0.16.18

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 (169) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.d.ts.map +1 -1
  62. package/dist/mcp/tools/tdx-run.js +1 -1
  63. package/dist/mcp/tools/tdx-run.js.map +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/segment/child-segment-yaml.js +1 -1
  109. package/dist/sdk/segment/fields-display.js +1 -1
  110. package/dist/sdk/segment/file-discovery.js +1 -1
  111. package/dist/sdk/segment/journey-utils.js +1 -1
  112. package/dist/sdk/segment/journey-yaml.js +1 -1
  113. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  114. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  115. package/dist/sdk/segment/pull-workflow.js +1 -1
  116. package/dist/sdk/segment/push-workflow.js +1 -1
  117. package/dist/sdk/segment/resolution-context.js +1 -1
  118. package/dist/sdk/segment/segment-path-parser.js +1 -1
  119. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  120. package/dist/sdk/segment/target-resolution.js +1 -1
  121. package/dist/sdk/segment/tdx-config.js +1 -1
  122. package/dist/sdk/segment/validate-files.js +1 -1
  123. package/dist/sdk/segment/yaml-validator.js +1 -1
  124. package/dist/sdk/segment.js +1 -1
  125. package/dist/sdk/types/index.js +1 -1
  126. package/dist/sdk/types/progress.js +1 -1
  127. package/dist/sdk/user.js +1 -1
  128. package/dist/sdk/util/format-detector.js +1 -1
  129. package/dist/sdk/util/formatters.js +1 -1
  130. package/dist/sdk/util/index.js +1 -1
  131. package/dist/sdk/util/tree-formatter.js +1 -1
  132. package/dist/sdk/workflow/clone-workflow.js +1 -1
  133. package/dist/sdk/workflow/index.js +1 -1
  134. package/dist/sdk/workflow/pull-workflow.js +1 -1
  135. package/dist/sdk/workflow/push-workflow.js +1 -1
  136. package/dist/sdk/workflow/tdx-config.js +1 -1
  137. package/dist/sdk/workflow/workflow-utils.js +1 -1
  138. package/dist/test-utils/command-runner.js +1 -1
  139. package/dist/test-utils/factories.js +1 -1
  140. package/dist/test-utils/fixtures.js +1 -1
  141. package/dist/test-utils/http-mock.js +1 -1
  142. package/dist/test-utils/index.js +1 -1
  143. package/dist/utils/async.js +1 -1
  144. package/dist/utils/colors.js +1 -1
  145. package/dist/utils/diff.js +1 -1
  146. package/dist/utils/file-permissions.js +1 -1
  147. package/dist/utils/global-cache.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  151. package/dist/utils/logger/formatters/index.js +1 -1
  152. package/dist/utils/logger/handlers/console-handler.js +1 -1
  153. package/dist/utils/logger/handlers/file-handler.js +1 -1
  154. package/dist/utils/logger/handlers/index.js +1 -1
  155. package/dist/utils/logger/handlers/null-handler.js +1 -1
  156. package/dist/utils/logger/index.js +1 -1
  157. package/dist/utils/logger/logger.js +1 -1
  158. package/dist/utils/logger/types.js +1 -1
  159. package/dist/utils/option-validation.js +1 -1
  160. package/dist/utils/port.js +1 -1
  161. package/dist/utils/process.js +1 -1
  162. package/dist/utils/prompt.js +1 -1
  163. package/dist/utils/spinner.js +1 -1
  164. package/dist/utils/sse-parser.js +1 -1
  165. package/dist/utils/string-utils.js +1 -1
  166. package/dist/utils/table-ref-parser.js +1 -1
  167. package/dist/utils/tdx-logger.js +1 -1
  168. package/dist/utils/version-check.js +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- const a115_0x19deef=a115_0x329b;(function(_0x308777,_0xb7046b){const _0x274b43=a115_0x329b,_0x35f01b=_0x308777();while(!![]){try{const _0x200b22=parseInt(_0x274b43(0x8c))/0x1+-parseInt(_0x274b43(0xca))/0x2*(-parseInt(_0x274b43(0x95))/0x3)+-parseInt(_0x274b43(0xab))/0x4*(parseInt(_0x274b43(0x155))/0x5)+parseInt(_0x274b43(0x86))/0x6+-parseInt(_0x274b43(0x7d))/0x7+parseInt(_0x274b43(0x9e))/0x8+parseInt(_0x274b43(0xb3))/0x9*(-parseInt(_0x274b43(0x81))/0xa);if(_0x200b22===_0xb7046b)break;else _0x35f01b['push'](_0x35f01b['shift']());}catch(_0x17ad54){_0x35f01b['push'](_0x35f01b['shift']());}}}(a115_0xbb9c,0x26b62));import{createHash}from'crypto';function a115_0x329b(_0x110105,_0x5ebfbc){_0x110105=_0x110105-0x72;const _0xbb9c1d=a115_0xbb9c();let _0x329be5=_0xbb9c1d[_0x110105];return _0x329be5;}export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a115_0x19deef(0x11e);export function createPendingSegmentId(_0xa0fc3d){return''+PENDING_SEGMENT_PREFIX+_0xa0fc3d+'__';}export function isPendingSegmentId(_0x45a794){return _0x45a794['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5c1b26){const _0x25fd65=a115_0x19deef;return _0x5c1b26[_0x25fd65(0x9c)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5ba34e){return''+PENDING_ACTIVATION_PREFIX+_0x5ba34e+'__';}export function isPendingActivationId(_0x1625a1){const _0x5bf066=a115_0x19deef;return _0x1625a1[_0x5bf066(0xed)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x11012d){const _0x1cbc65=a115_0x19deef;return _0x11012d[_0x1cbc65(0x9c)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x5a7c1d,_0x599971){const _0xb6d8de=a115_0x19deef,_0x2cac83=_0x5a7c1d+'::'+(_0x599971[_0xb6d8de(0x12b)]()||_0xb6d8de(0x14b)),_0x43f76b=createHash(_0xb6d8de(0x154))[_0xb6d8de(0x8f)](_0x2cac83)[_0xb6d8de(0x10f)]('hex')[_0xb6d8de(0xa8)](0x0,0xc);return'journey_entry_criteria_'+_0x43f76b;}export function ensureJourneyDefaults(_0x12e875){const _0x3be878=a115_0x19deef;!_0x12e875[_0x3be878(0x12f)]&&(_0x12e875[_0x3be878(0x12f)]=''),!_0x12e875[_0x3be878(0xb7)]&&(_0x12e875['state']='draft');}export function resolveTDFolderPath(_0x29372b,_0x40964d,_0x392657){const _0x3c0ee1=a115_0x19deef;if(!_0x40964d)return _0x29372b;if(_0x29372b===_0x392657||_0x29372b[_0x3c0ee1(0xed)](_0x392657+'/'))return _0x29372b;return _0x29372b?_0x392657+'/'+_0x29372b:_0x392657;}export function addFoldersToCreate(_0x5db2ef,_0x3a99a3,_0x2cbeed){const _0x3bb0b9=a115_0x19deef;if(!_0x5db2ef)return;if(_0x3a99a3[_0x3bb0b9(0xac)](_0x5db2ef))return;const _0x32ea10=_0x5db2ef[_0x3bb0b9(0x130)]('/');let _0x4106c3='';for(const _0xf6a2af of _0x32ea10){_0x4106c3=_0x4106c3?_0x4106c3+'/'+_0xf6a2af:_0xf6a2af,!_0x3a99a3[_0x3bb0b9(0xac)](_0x4106c3)&&_0x2cbeed['add'](_0x4106c3);}}import*as a115_0x1aa398 from'yaml';import{readFileSync}from'fs';import a115_0x16dbcf from'path';import{isJourneyDef,parseYamlString as a115_0x2363d8,toYamlString as a115_0x4f8158,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 a115_0xbb9c(){const _0x4b5833=['Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','embedded_activation_creating','activation_template_id','Deleting\x20activation\x20\x27','segment','segments','journeyStages','Updating\x20activation\x20\x27','goal\x20criteria','Activation\x20not\x20found:\x20','isNew','nameToId','nameToType','sha1','610UQFxJW','resolveSegment','notification','WaitStep','Created\x20segment\x20\x27','data','listActivations','errors','INTERNAL','Deleted\x20activation\x20\x27','push','folderPath','list','Name\x20has\x20already\x20been\x20taken','362397OOLswD','parseDocument','delete','exitCriterias','10hdaDSw','embeddedSegmentNameToId','values','updated','createdSegmentId','1485228rbitQB','parse','DecisionPoint','NOT_FOUND','with','updateSegmentById','110833aFjgBg','type','segment_deleted','update','goal','\x27\x20wait\x20condition','deleteActivation','length','journeyActivationStepId','940683nTgZAu','add','Updated\x20activation\x20\x27','):\x20','\x27\x20from\x20file:\x20','relative','segment_updated','replace','Updating\x20segment\x20\x27','695568ijDsad','Entry\x20criteria:\x20','activationsBySegmentId','includes','folder','Creating\x20segment\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','buildUserMaps','name','logInfo','slice','Created\x20journey\x20\x27','withProgress','3712tSBhkw','has','Creating\x20folder\x20\x27','stringify','activation_updating','all','getSegment','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','3917961nzXzFy','idToName','activation_created','activation_creating','state','from','entries','sort','\x27\x20decision\x20point\x20branch\x20\x27','\x20segment\x20from\x20file:\x20','schedule','versionNumber','\x27\x20milestone','idToEmailMap','progress','branches',').\x20','keys','existingActivation','Updated\x20journey\x20\x27','SEGMENT_SYNTAX_ERROR','journeyBundleName','Journey\x20\x27','2VNCLWD','activationActions','steps','existingJourney','segmentFolderId','updateActivation','createActivation','getActivation','\x20activation\x20\x27','localSegmentRules','folder_creating','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','map','createdSegmentIds','verbose','embedded_segment_creating','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','entry','stage\x20\x27','Fetching\x20','\x20error(s)','connection','\x27\x20entry\x20criteria','toString','SEGMENT_NOT_FOUND','Deleted\x20segment\x20\x27','segment_updating','null','journey','set','yamlActivation','connectionIdToNameMap','Creating\x20activation\x20\x27','\x20(referenced\x20in\x20journey\x20','kind','startsWith','results','attributes','relationships','existingSegments','parentId','validatedRequest','skipSegments','JOURNEY_UPDATE_ERROR','journeyBundlesByFolderAndName','\x27\x20for\x20','item','activations','folderPathToId','\x20journey\x20from\x20file:\x20','isArray','onProgress','createSegment','diff','decision_point','connector_config','getJourney','yamlConfig','size','logSuccess','activationContext','filter','rule','waitCondition','embedded_segment_created','./journey-yaml.js','create','deleted','\x0a\x20\x20','digest','../../utils/async.js','stages','Created\x20activation\x20\x27','Segment\x20not\x20found:\x20','ACTIVATION_UPDATE_ERROR','find','join','deps','segmentId','Stage\x20\x27','unchanged','createJourneySegment','segmentNameToId','./child-segment-yaml.js','__pending_act_','embedded_activation_created','toLowerCase','entry_criteria','activation_deleting','index','get','segmentByFolderAndName','action','\x27\x20exit\x20criteria','created','\x27...','journeys','trim','segment_created','max','activationStepsById','description','split','absolutePath','logDeleted','hasChanges','all_columns','journey_created','ACTIVATION_SYNTAX_ERROR','parentFolder','Failed\x20to\x20','journey_updated','dirname','behavior','activation_','utf-8','columns','valid','resolveJourneyId','folderId','rootFolderId','journey_creating','milestone','entryCriteria','existingSegment'];a115_0xbb9c=function(){return _0x4b5833;};return a115_0xbb9c();}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(_0x5c7a44){const _0x20be8d=a115_0x19deef;if(Array[_0x20be8d(0xfc)](_0x5c7a44))return'['+_0x5c7a44[_0x20be8d(0xd6)](_0x266c7f=>stableStringify(_0x266c7f))[_0x20be8d(0x116)](',')+']';if(_0x5c7a44&&typeof _0x5c7a44==='object'){const _0x1bb504=_0x5c7a44,_0x20a8f2=Object[_0x20be8d(0xc4)](_0x1bb504)[_0x20be8d(0xba)](),_0x24812e=_0x20a8f2[_0x20be8d(0xd6)](_0x1d16eb=>'\x22'+_0x1d16eb+'\x22:'+stableStringify(_0x1bb504[_0x1d16eb]));return'{'+_0x24812e[_0x20be8d(0x116)](',')+'}';}const _0x51e188=JSON['stringify'](_0x5c7a44);return _0x51e188===undefined?_0x20be8d(0xe5):_0x51e188;}function activationSignature(_0x13a3ad){const _0x643845=a115_0x19deef,_0x4a6173={'connection':_0x13a3ad[_0x643845(0xdf)],..._0x13a3ad[_0x643845(0x134)]!==undefined&&{'all_columns':_0x13a3ad[_0x643845(0x134)]},..._0x13a3ad[_0x643845(0x13e)]!==undefined&&{'columns':_0x13a3ad['columns']},..._0x13a3ad[_0x643845(0x13b)]!==undefined&&{'behavior':_0x13a3ad[_0x643845(0x13b)]},..._0x13a3ad['schedule']!==undefined&&{'schedule':_0x13a3ad[_0x643845(0xbd)]},..._0x13a3ad[_0x643845(0x157)]!==undefined&&{'notification':_0x13a3ad[_0x643845(0x157)]},..._0x13a3ad[_0x643845(0x101)]!==undefined&&{'connector_config':_0x13a3ad[_0x643845(0x101)]},..._0x13a3ad[_0x643845(0x149)]!==undefined&&{'activation_template_id':_0x13a3ad[_0x643845(0x149)]}};return stableStringify(_0x4a6173);}export async function prepareSegmentFiles(_0x31e6f8,_0x5f3895,_0x15ee51,_0x4e839d,_0x322798){const _0x11d3d7=a115_0x19deef,{activationDefToCreateRequest:_0xa3c42d}=await import('./child-segment-yaml.js'),_0x33a566=[],_0x5b8057=new Set();for(const {yamlConfig:_0x404c90,folderPath:_0x7995a5,sourcePath:_0x4e2e04}of _0x31e6f8){const _0x2f7821=resolveTDFolderPath(_0x7995a5,_0x4e839d,_0x322798),_0xf789c6=_0x2f7821+':'+_0x404c90['name'],_0x3ee7b9=_0x5f3895[_0x11d3d7(0x125)][_0x11d3d7(0x124)](_0xf789c6),_0x400802=_0x3ee7b9?_0x5f3895[_0x11d3d7(0xa0)][_0x11d3d7(0x124)](_0x3ee7b9['id'])||[]:[];addFoldersToCreate(_0x2f7821,_0x5f3895[_0x11d3d7(0xfa)],_0x5b8057);const _0x54db4a=calculateActivationActions(_0x404c90[_0x11d3d7(0xf9)]||[],_0x400802,_0x5f3895[_0x11d3d7(0xc0)],_0x5f3895['connectionIdToNameMap']);for(const _0x41aa5b of _0x54db4a){(_0x41aa5b[_0x11d3d7(0x8d)]==='create'||_0x41aa5b[_0x11d3d7(0x8d)]===_0x11d3d7(0x8f))&&_0x41aa5b[_0x11d3d7(0xe8)]&&(_0x41aa5b[_0x11d3d7(0xf3)]=await _0xa3c42d(_0x41aa5b[_0x11d3d7(0xe8)],_0x15ee51));}const _0x1fd4e4=calculateSegmentDiff(_0x404c90,_0x3ee7b9,_0x400802,_0x5f3895[_0x11d3d7(0xc0)],_0x5f3895[_0x11d3d7(0xe9)]);_0x33a566[_0x11d3d7(0x79)]({'relativePath':_0x404c90[_0x11d3d7(0xa6)],'absolutePath':_0x4e2e04,'yamlConfig':_0x404c90,'folderPath':_0x2f7821,'existingSegment':_0x3ee7b9,'existingActivations':_0x400802,'isNew':_0x1fd4e4[_0x11d3d7(0x151)],'hasChanges':_0x1fd4e4[_0x11d3d7(0x133)],'diff':_0x1fd4e4[_0x11d3d7(0xff)],'activationActions':_0x54db4a});}return{'segmentFiles':_0x33a566,'foldersToCreate':_0x5b8057};}export async function prepareJourneyFiles(_0x3045a8,_0x3d61be,_0x509fe4,_0x2bac5f){const _0x1dc5b8=a115_0x19deef,_0x75441b=[],_0x572749=new Set();for(const {yamlConfig:_0x474ea6,folderPath:_0x27f905,sourcePath:_0x3861cd}of _0x3045a8){const _0x5622ef=resolveTDFolderPath(_0x27f905,_0x509fe4,_0x2bac5f),_0xbca311=_0x5622ef+':'+_0x474ea6['name'],_0x5857c8=_0x3d61be[_0x1dc5b8(0xf6)][_0x1dc5b8(0x124)](_0xbca311);let _0x59147b,_0x8dab4;if(_0x5857c8&&_0x5857c8['length']>0x0){const _0x29642a=buildLocalExpandedRuleMappings(_0x474ea6),{createYamlContext:_0x6ed88,prefetchJourneySegments:_0x2d6789}=createPushYamlContextForBundle(_0x3d61be[_0x1dc5b8(0x117)],_0x3d61be[_0x1dc5b8(0xf2)],_0x3d61be[_0x1dc5b8(0xf1)],_0x29642a,_0x3d61be[_0x1dc5b8(0xc0)],_0x3d61be[_0x1dc5b8(0xe9)],_0x3d61be[_0x1dc5b8(0x12e)],_0x3d61be['journeyById']);await _0x2d6789(_0x5857c8[_0x1dc5b8(0xd6)](_0x4e24d4=>_0x4e24d4['id']));const _0x383371=hasMultipleVersions(_0x474ea6),_0x31a2a3=async _0x3f2b11=>{const _0x453b5a=_0x1dc5b8,_0x4fcd49=_0x3d61be['journeyById']?.[_0x453b5a(0x124)](_0x3f2b11);if(_0x4fcd49)return _0x4fcd49;return _0x3d61be['fetchJourney']({'journeyId':_0x3f2b11,'journeyName':_0x474ea6[_0x453b5a(0xa6)],'isMultiVersion':_0x5857c8['length']>0x1});};if(_0x383371&&_0x5857c8[_0x1dc5b8(0x93)]>0x1){const _0x56cfd2=[];for(const _0x11b027 of _0x5857c8){const _0x57fe27=_0x11b027[_0x1dc5b8(0xbe)]||0x1;_0x3d61be[_0x1dc5b8(0xc1)]?.[_0x1dc5b8(0x8f)](_0x1dc5b8(0xdd)+_0x474ea6[_0x1dc5b8(0xa6)]+'\x20v'+_0x57fe27);const _0x16ef0f=await _0x31a2a3(_0x11b027['id']),_0xa759a0=_0x6ed88(_0x11b027['id']),_0x25481e=await journeyResponseToDef(_0x16ef0f,_0xa759a0);_0x56cfd2[_0x1dc5b8(0x79)]({'item':_0x11b027,'yaml':_0x25481e});}const _0x53ec2e=buildLocalRuleToNameMappingFromJourney(_0x474ea6);_0x8dab4=buildMergedJourneyDef(_0x56cfd2,_0x53ec2e);const _0xbf0eae=Math[_0x1dc5b8(0x12d)](..._0x56cfd2[_0x1dc5b8(0xd6)](_0x563723=>_0x563723[_0x1dc5b8(0xf8)][_0x1dc5b8(0xbe)]||0x0)),_0x5cbedb=_0x5857c8[_0x1dc5b8(0x115)](_0x9171e5=>(_0x9171e5['versionNumber']||0x0)===_0xbf0eae);_0x5cbedb&&(_0x3d61be[_0x1dc5b8(0xc1)]?.[_0x1dc5b8(0x8f)](_0x1dc5b8(0xdd)+_0x474ea6['name']+'\x20v'+_0xbf0eae),_0x59147b=await _0x31a2a3(_0x5cbedb['id']));}else{const _0x2a4828=_0x5857c8[_0x5857c8[_0x1dc5b8(0x93)]-0x1];_0x3d61be[_0x1dc5b8(0xc1)]?.['update'](_0x1dc5b8(0xdd)+_0x474ea6[_0x1dc5b8(0xa6)]),_0x59147b=await _0x31a2a3(_0x2a4828['id']);const _0x2d6556=_0x6ed88(_0x2a4828['id']),_0x14ab3b=await journeyResponseToDef(_0x59147b,_0x2d6556),_0x5b6def=buildLocalRuleToNameMappingFromJourney(_0x474ea6);_0x8dab4=buildMergedJourneyDef([{'item':_0x2a4828,'yaml':_0x14ab3b}],_0x5b6def);}}addFoldersToCreate(_0x5622ef,_0x3d61be[_0x1dc5b8(0xfa)],_0x572749);const _0x1bb6cb=calculateJourneyDiff(_0x474ea6,_0x8dab4);_0x75441b[_0x1dc5b8(0x79)]({'relativePath':_0x474ea6[_0x1dc5b8(0xa6)],'absolutePath':_0x3861cd,'yamlConfig':_0x474ea6,'folderPath':_0x5622ef,'existingJourney':_0x59147b,'isNew':_0x1bb6cb[_0x1dc5b8(0x151)],'hasChanges':_0x1bb6cb[_0x1dc5b8(0x133)],'diff':_0x1bb6cb[_0x1dc5b8(0xff)]});}return{'journeyFiles':_0x75441b,'foldersToCreate':_0x572749};}export function calculateActivationActions(_0x1742ca,_0x1e0424,_0x2271d4,_0x2adf74){const _0x50985c=a115_0x19deef,_0x83c799=[],_0x10c42a=new Map();for(const _0x38dc83 of _0x1e0424){_0x10c42a[_0x50985c(0xe7)](_0x38dc83['name'],_0x38dc83);}const _0x24ee00=new Map();for(const _0x39422c of _0x1742ca){_0x24ee00[_0x50985c(0xe7)](_0x39422c[_0x50985c(0xa6)],_0x39422c);}for(const _0x585602 of _0x1742ca){const _0x24d4d9=_0x10c42a[_0x50985c(0x124)](_0x585602[_0x50985c(0xa6)]);if(!_0x24d4d9)_0x83c799[_0x50985c(0x79)]({'type':_0x50985c(0x10c),'name':_0x585602[_0x50985c(0xa6)],'yamlActivation':_0x585602});else{const _0x34eb03=activationResponseToDef(_0x24d4d9,_0x2271d4,_0x2adf74),_0x469f51=a115_0x1aa398['stringify'](_0x34eb03),_0x27c2a3=a115_0x1aa398['stringify'](_0x585602);_0x469f51!==_0x27c2a3&&_0x83c799[_0x50985c(0x79)]({'type':_0x50985c(0x8f),'name':_0x585602[_0x50985c(0xa6)],'yamlActivation':_0x585602,'existingActivation':_0x24d4d9});}}for(const _0x4efc35 of _0x1e0424){!_0x24ee00[_0x50985c(0xac)](_0x4efc35[_0x50985c(0xa6)])&&_0x83c799[_0x50985c(0x79)]({'type':_0x50985c(0x7f),'name':_0x4efc35[_0x50985c(0xa6)],'existingActivation':_0x4efc35});}return _0x83c799;}export function calculateSegmentDiff(_0x5a3f21,_0x220af3,_0x48ab88,_0x134fed,_0x270cec){const _0x12c439=segmentToYamlString(_0x5a3f21);if(_0x220af3){const _0x4d6e44=segmentWithActivationsToYaml(_0x220af3,_0x48ab88,undefined,_0x134fed,_0x270cec),_0x2bc31b=segmentToYamlString(_0x4d6e44),_0x39ee2a=generateDiff(_0x2bc31b,_0x12c439),_0xcd8c=hasChanges(_0x39ee2a);return{'isNew':![],'hasChanges':_0xcd8c,'diff':_0xcd8c?formatDiffWithColors(_0x39ee2a):undefined};}const _0x1f5ba6=generateDiff('',_0x12c439);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1f5ba6)};}export function calculateJourneyDiff(_0x30574f,_0x38c021){const _0x2082c2=normalizeJourneyDef(_0x30574f,_0x30574f),_0x4e488e=a115_0x4f8158(_0x2082c2);if(_0x38c021){const _0x1d8e42=normalizeJourneyDef(_0x38c021,_0x30574f),_0xc96398=a115_0x4f8158(_0x1d8e42),_0x282f7d=generateDiff(_0xc96398,_0x4e488e),_0x68ec5a=hasChanges(_0x282f7d);return{'isNew':![],'hasChanges':_0x68ec5a,'diff':_0x68ec5a?formatDiffWithColors(_0x282f7d):undefined};}const _0x4338ac=generateDiff('',_0x4e488e);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4338ac)};}export function findSegmentsToDelete(_0x54a36a,_0x3afd7c,_0x257476,_0xf730b1,_0x57dc9e){const _0x8e1a6c=a115_0x19deef,_0x2e4647=new Set();for(const {yamlConfig:_0x16c082,folderPath:_0x169f6a}of _0x3afd7c){_0x2e4647[_0x8e1a6c(0x96)](_0x169f6a+':'+_0x16c082[_0x8e1a6c(0xa6)]);}return _0x54a36a[_0x8e1a6c(0x107)](_0x1d15bd=>{const _0x3f20a4=_0x8e1a6c,_0x4b5ee9=_0x1d15bd[_0x3f20a4(0xce)]?_0x257476[_0x3f20a4(0x124)](_0x1d15bd['segmentFolderId'][_0x3f20a4(0xe1)]())||'':'',_0x3b00c8=_0x4b5ee9+':'+_0x1d15bd[_0x3f20a4(0xa6)];if(_0x2e4647[_0x3f20a4(0xac)](_0x3b00c8))return![];if(_0x57dc9e)return _0x4b5ee9===_0xf730b1||_0x4b5ee9[_0x3f20a4(0xed)](_0xf730b1+'/');return!![];});}export function findJourneysToDelete(_0x37a818,_0x307a40,_0x499050,_0x5d68c8,_0x4c9aba){const _0x5ab3ca=a115_0x19deef,_0xcdacdf=new Set();for(const {yamlConfig:_0xc5b71a,folderPath:_0x348462}of _0x307a40){_0xcdacdf[_0x5ab3ca(0x96)](_0x348462+':'+_0xc5b71a[_0x5ab3ca(0xa6)]);}return _0x37a818[_0x5ab3ca(0x107)](_0xaabe1e=>{const _0x26e2a0=_0x5ab3ca,_0x37ca76=_0xaabe1e['folderId']?_0x499050[_0x26e2a0(0x124)](_0xaabe1e[_0x26e2a0(0x141)])||'':'',_0x32a756=_0x37ca76+':'+_0xaabe1e[_0x26e2a0(0xc8)];if(_0xcdacdf['has'](_0x32a756))return![];if(_0x4c9aba)return _0x37ca76===_0x5d68c8||_0x37ca76[_0x26e2a0(0xed)](_0x5d68c8+'/');return!![];});}export function buildSegmentLookupMap(_0x3d76c6,_0xcdb10){const _0x164bb9=a115_0x19deef,_0x365b4a=new Map();for(const _0x17b940 of _0x3d76c6){const _0x42a94c=_0x17b940[_0x164bb9(0xce)]?_0xcdb10[_0x164bb9(0x124)](_0x17b940[_0x164bb9(0xce)][_0x164bb9(0xe1)]())||'':'',_0x24ad9e=_0x42a94c+':'+_0x17b940[_0x164bb9(0xa6)];_0x365b4a['set'](_0x24ad9e,_0x17b940);}return _0x365b4a;}export function buildSegmentNameToIdMap(_0x253669){const _0x4bce56=a115_0x19deef,_0x4106fa=new Map();for(const _0x36805e of _0x253669){_0x4106fa[_0x4bce56(0xe7)](_0x36805e[_0x4bce56(0xa6)],_0x36805e['id']);}return _0x4106fa;}export function buildJourneyBundleLookupMap(_0x371c78,_0x2c3f04){const _0x2c909b=a115_0x19deef,_0x877a21=new Map();for(const _0x350061 of _0x371c78){const _0x46b355=_0x350061[_0x2c909b(0x141)]?_0x2c3f04[_0x2c909b(0x124)](_0x350061['folderId'])||'':'',_0x305078=_0x46b355+':'+_0x350061[_0x2c909b(0xc8)];!_0x877a21['has'](_0x305078)&&_0x877a21[_0x2c909b(0xe7)](_0x305078,[]),_0x877a21[_0x2c909b(0x124)](_0x305078)[_0x2c909b(0x79)](_0x350061);}for(const _0x476da5 of _0x877a21[_0x2c909b(0x83)]()){_0x476da5[_0x2c909b(0xba)]((_0x6737e4,_0x14825b)=>(_0x6737e4['versionNumber']||0x0)-(_0x14825b['versionNumber']||0x0));}return _0x877a21;}export function collectFoldersToCreate(_0x102644,_0x5a7d90){const _0x3336b3=a115_0x19deef,_0xd089a6=new Set();for(const _0x36d99c of _0x102644){if(!_0x36d99c)continue;if(_0x5a7d90[_0x3336b3(0xac)](_0x36d99c))continue;const _0x178235=_0x36d99c[_0x3336b3(0x130)]('/');let _0x41d17a='';for(const _0x29fa6b of _0x178235){_0x41d17a=_0x41d17a?_0x41d17a+'/'+_0x29fa6b:_0x29fa6b,!_0x5a7d90['has'](_0x41d17a)&&_0xd089a6[_0x3336b3(0x96)](_0x41d17a);}}return _0xd089a6;}export function parseAndClassifyYamlFiles(_0x583c4a,_0x5a2a3e,_0xe95697){const _0x3bcfd0=a115_0x19deef,_0x608247=[],_0x16a2d5=[];for(const _0x3e9d00 of _0x583c4a){const _0x518314=a115_0x16dbcf[_0x3bcfd0(0x9a)](_0x5a2a3e,a115_0x16dbcf[_0x3bcfd0(0x13a)](_0x3e9d00)),_0x40078e=_0x518314==='.'?'':_0x518314,_0x127a59=readFileSync(_0x3e9d00,_0x3bcfd0(0x13d)),_0x34655c=a115_0x1aa398[_0x3bcfd0(0x87)](_0x127a59);if(isJourneyDef(_0x34655c)){const _0x36d8ee=a115_0x2363d8(_0x127a59);_0x16a2d5[_0x3bcfd0(0x79)]({'yamlConfig':_0x36d8ee,'folderPath':_0x40078e,'sourcePath':_0x3e9d00});}else{if(!_0xe95697?.[_0x3bcfd0(0xf4)]){const _0xa7a1cb=parseSegmentYamlFile(_0x127a59),_0x590f22=normalizeChildSegmentYaml(_0xa7a1cb);_0x608247[_0x3bcfd0(0x79)]({'yamlConfig':_0x590f22,'folderPath':_0x40078e,'sourcePath':_0x3e9d00});}}}return{'segments':_0x608247,'journeys':_0x16a2d5};}export function validateParsedFiles(_0x2766fc,_0x2a0a43){const _0x302d16=a115_0x19deef,_0x4331ba=[];for(const {yamlConfig:_0x1a3646,sourcePath:_0x286a53}of _0x2766fc['segments']){const _0x28e909=readFileSync(_0x286a53,_0x302d16(0x13d)),_0x587d33=a115_0x1aa398[_0x302d16(0x7e)](_0x28e909),_0x109c4f=validateSegmentDef(_0x1a3646,{'source':_0x28e909,'document':_0x587d33});if(!_0x109c4f['valid']){const _0x7623e8=a115_0x16dbcf[_0x302d16(0x9a)](_0x2a0a43,_0x286a53);_0x4331ba[_0x302d16(0x79)]({'filePath':_0x7623e8,'source':_0x28e909,'result':_0x109c4f,'isJourney':![]});}}for(const {yamlConfig:_0x364d1f,sourcePath:_0x500604}of _0x2766fc['journeys']){const _0x1b8f00=readFileSync(_0x500604,_0x302d16(0x13d)),_0x9c00fc=a115_0x1aa398[_0x302d16(0x7e)](_0x1b8f00),_0x1b50fc=validateJourneyDef(_0x364d1f,{'source':_0x1b8f00,'document':_0x9c00fc});if(!_0x1b50fc[_0x302d16(0x13f)]){const _0x335694=a115_0x16dbcf[_0x302d16(0x9a)](_0x2a0a43,_0x500604);_0x4331ba[_0x302d16(0x79)]({'filePath':_0x335694,'source':_0x1b8f00,'result':_0x1b50fc,'isJourney':!![]});}}return _0x4331ba;}export function formatValidationErrors(_0x209bbb){const _0x4afb77=a115_0x19deef,_0x1b4c39=[];for(const {filePath:_0x3fc9b2,source:_0x55ad58,result:_0x4ad9b4,isJourney:_0x48a9bf}of _0x209bbb){const _0x1482a2=_0x48a9bf?_0x4afb77(0xe6):'segment';_0x1b4c39['push']('\x0a'+_0x3fc9b2+'\x20('+_0x1482a2+_0x4afb77(0x98)+_0x4ad9b4[_0x4afb77(0x76)][_0x4afb77(0x93)]+_0x4afb77(0xde)),_0x1b4c39[_0x4afb77(0x79)](formatValidationResult(_0x4ad9b4,_0x55ad58,_0x3fc9b2));}return _0x1b4c39[_0x4afb77(0x116)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x1f6c12){const _0x1a04d1=a115_0x19deef,_0x50c2e9=new Set(),_0x57cc7c=new Map(),_0x40d15d=collectSegmentUsageCounts(_0x1f6c12);if(_0x1f6c12[_0x1a04d1(0x14c)])for(const [_0x533848,_0x598db9]of Object[_0x1a04d1(0xb9)](_0x1f6c12[_0x1a04d1(0x14c)])){_0x50c2e9[_0x1a04d1(0x96)](_0x533848);if(_0x598db9[_0x1a04d1(0x108)]){const _0x263753=yamlRuleToApi(_0x598db9[_0x1a04d1(0x108)]),_0x438608=apiRuleToYaml(_0x263753);_0x57cc7c[_0x1a04d1(0xe7)](_0x533848,_0x438608);}}const _0x5d5390=new Map();let _0x276e1b=0x0;for(const [_0x2c758d,_0x4856dc]of _0x57cc7c){const _0x5c50b9=serializeExpandedRule(_0x4856dc,_0x57cc7c),_0xf7a40a=_0x5d5390['get'](_0x5c50b9)||[];_0xf7a40a[_0x1a04d1(0x79)]({'name':_0x2c758d,'index':_0x276e1b}),_0x5d5390[_0x1a04d1(0xe7)](_0x5c50b9,_0xf7a40a),_0x276e1b++;}const _0x14adc0=new Map();for(const [_0x41553f,_0x229010]of _0x5d5390){const _0x8065cf=_0x229010['slice']()[_0x1a04d1(0xba)]((_0x327536,_0x11cc24)=>{const _0x5e65ed=_0x1a04d1,_0x1f74e3=_0x40d15d['get'](_0x327536[_0x5e65ed(0xa6)])||0x0,_0x2444bb=_0x40d15d[_0x5e65ed(0x124)](_0x11cc24[_0x5e65ed(0xa6)])||0x0;if(_0x1f74e3!==_0x2444bb)return _0x2444bb-_0x1f74e3;return _0x327536['index']-_0x11cc24[_0x5e65ed(0x123)];})['map'](_0x2822c7=>_0x2822c7[_0x1a04d1(0xa6)]),_0x15e566=[];for(const _0x1648ac of _0x8065cf){const _0x9bb2ff=_0x40d15d[_0x1a04d1(0x124)](_0x1648ac)||0x0,_0x48c83c=Math[_0x1a04d1(0x12d)](_0x9bb2ff,0x1);for(let _0x12aa68=0x0;_0x12aa68<_0x48c83c;_0x12aa68++){_0x15e566['push'](_0x1648ac);}}_0x14adc0[_0x1a04d1(0xe7)](_0x41553f,_0x15e566);}return{'existingLocalSegmentNames':_0x50c2e9,'localSegmentRules':_0x57cc7c,'localExpandedRuleToNames':_0x14adc0};}async function buildServerSegmentRuleMap(_0x4231f7,_0x4809e2,_0x969709,_0x19c825){const _0x375f44=new Map(),_0x4fdcd5=new Set(),_0x4c8d78=async _0x8a880a=>{const _0x39947e=a115_0x329b;if(_0x4fdcd5[_0x39947e(0xac)](_0x8a880a))return;_0x4fdcd5[_0x39947e(0x96)](_0x8a880a);let _0x5861be=_0x969709[_0x39947e(0x115)](_0x25d85a=>_0x25d85a['id']===_0x8a880a);if(!_0x5861be)try{_0x5861be=await _0x4231f7['segment'][_0x39947e(0xb1)](_0x4809e2,_0x8a880a);}catch{return;}if(!_0x5861be?.[_0x39947e(0x108)])return;const _0x167a22=apiRuleToYaml(_0x5861be[_0x39947e(0x108)]);_0x375f44[_0x39947e(0xe7)](_0x8a880a,_0x167a22);const _0x5353c9=collectSegmentRefsFromRule(_0x167a22);for(const _0x2cd8c4 of _0x5353c9){await _0x4c8d78(_0x2cd8c4);}};for(const _0x157000 of _0x19c825){await _0x4c8d78(_0x157000);}return _0x375f44;}export function createSegmentIdResolver(_0x58cf7c,_0x201729){return async _0x51eaba=>{const _0xf16b81=a115_0x329b,_0x3af313=_0x58cf7c[_0xf16b81(0x124)](_0x51eaba);if(!_0x3af313)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xf16b81(0x113)+_0x51eaba+_0xf16b81(0xb2)+_0x201729+'\x27)');return _0x3af313;};}export function extractRootFolderId(_0x1daabd){const _0x3b07a7=a115_0x19deef;return _0x1daabd[_0x3b07a7(0xf0)]?.['parentSegmentFolder']?.[_0x3b07a7(0x74)]?.['id']||_0x1daabd[_0x3b07a7(0xf0)]?.[_0x3b07a7(0x137)]?.[_0x3b07a7(0x74)]?.['id'];}export function buildConnectionMaps(_0x154875){const _0x287601=a115_0x19deef,_0xba83fe=new Map(),_0x12faf6=new Map(),_0x23d4e1=new Map();for(const _0x3f1c71 of _0x154875){_0xba83fe[_0x287601(0xe7)](_0x3f1c71[_0x287601(0xa6)],parseInt(_0x3f1c71['id'],0xa)),_0x12faf6[_0x287601(0xe7)](_0x3f1c71['id'],_0x3f1c71[_0x287601(0xa6)]),_0x23d4e1[_0x287601(0xe7)](_0x3f1c71[_0x287601(0xa6)],_0x3f1c71[_0x287601(0x8d)]);}return{'nameToId':_0xba83fe,'idToName':_0x12faf6,'nameToType':_0x23d4e1};}export function calculatePushStats(_0x2bb76c,_0x35b9ec,_0x5f14ea,_0x21d848,_0xaa8be0,_0x54e7fc,_0x2c8f93){const _0x2dbcc0=a115_0x19deef,_0x1c5f00=_0x2bb76c[_0x2dbcc0(0x107)](_0x63ef30=>_0x63ef30[_0x2dbcc0(0x151)]),_0x3a683c=_0x2bb76c[_0x2dbcc0(0x107)](_0x590d85=>!_0x590d85[_0x2dbcc0(0x151)]&&_0x590d85[_0x2dbcc0(0x133)]),_0x287edf=_0x2bb76c[_0x2dbcc0(0x107)](_0x14cff3=>!_0x14cff3[_0x2dbcc0(0x151)]&&!_0x14cff3['hasChanges']),_0x8cfd0=_0x54e7fc?_0x21d848:[],_0x4f6b5d=_0x35b9ec['filter'](_0x1118ff=>_0x1118ff[_0x2dbcc0(0x151)]),_0x44cc69=_0x35b9ec['filter'](_0x95ad23=>!_0x95ad23[_0x2dbcc0(0x151)]&&_0x95ad23[_0x2dbcc0(0x133)]),_0x5aae86=_0x35b9ec[_0x2dbcc0(0x107)](_0x12b2d9=>!_0x12b2d9[_0x2dbcc0(0x151)]&&!_0x12b2d9[_0x2dbcc0(0x133)]),_0x52bf87=_0x54e7fc?_0xaa8be0:[],_0x225423=_0x2bb76c['flatMap'](_0x95d39=>_0x95d39[_0x2dbcc0(0xcb)]),_0x136804=_0x225423[_0x2dbcc0(0x107)](_0xb4423c=>_0xb4423c['type']===_0x2dbcc0(0x10c)),_0x1d7851=_0x225423[_0x2dbcc0(0x107)](_0x4d88ca=>_0x4d88ca[_0x2dbcc0(0x8d)]===_0x2dbcc0(0x8f)),_0x4c08bc=_0x225423[_0x2dbcc0(0x107)](_0x41197b=>_0x41197b[_0x2dbcc0(0x8d)]===_0x2dbcc0(0x7f)),_0x1662ec=Array[_0x2dbcc0(0xb8)](_0x5f14ea)['sort'](),_0x5b5566=_0x2c8f93?![]:_0x1c5f00['length']>0x0||_0x3a683c[_0x2dbcc0(0x93)]>0x0||_0x8cfd0[_0x2dbcc0(0x93)]>0x0,_0x1ac235=_0x4f6b5d[_0x2dbcc0(0x93)]>0x0||_0x44cc69['length']>0x0||_0x52bf87[_0x2dbcc0(0x93)]>0x0,_0x54e87a=_0x2c8f93?![]:_0x225423['length']>0x0,_0x1dd33f=_0x1662ec['length']>0x0;return{'segments':{'new':_0x1c5f00,'changed':_0x3a683c,'unchanged':_0x287edf,'toDelete':_0x8cfd0},'journeys':{'new':_0x4f6b5d,'changed':_0x44cc69,'unchanged':_0x5aae86,'toDelete':_0x52bf87},'activations':{'all':_0x225423,'toCreate':_0x136804,'toUpdate':_0x1d7851,'toDelete':_0x4c08bc},'folders':{'toCreate':_0x1662ec},'counts':{'segments':{'new':_0x1c5f00[_0x2dbcc0(0x93)],'changed':_0x3a683c[_0x2dbcc0(0x93)],'unchanged':_0x287edf[_0x2dbcc0(0x93)],'toDelete':_0x8cfd0[_0x2dbcc0(0x93)]},'journeys':{'new':_0x4f6b5d[_0x2dbcc0(0x93)],'changed':_0x44cc69[_0x2dbcc0(0x93)],'unchanged':_0x5aae86[_0x2dbcc0(0x93)],'toDelete':_0x52bf87[_0x2dbcc0(0x93)]},'activations':{'create':_0x136804[_0x2dbcc0(0x93)],'update':_0x1d7851['length'],'delete':_0x4c08bc['length']},'folders':_0x1662ec[_0x2dbcc0(0x93)]},'hasChanges':_0x5b5566||_0x1ac235||_0x54e87a||_0x1dd33f};}export async function buildPushExecutionContext(_0x43be61,_0x4998d2,_0x5c973d,_0xcf6e91,_0x3c190e,_0x2b365a){const _0x5690c4=a115_0x19deef,_0x324ee1=extractRootFolderId(_0x5c973d),{pathToId:_0xba002c,idToPath:_0x546572}=buildFolderMaps(_0x3c190e),_0x5eb21a=buildSegmentNameToIdMap(_0xcf6e91),_0x334e87=new Map(),{batchAsync:_0x376004}=await import(_0x5690c4(0x110)),[_0x4e9968,_0x4eab3d]=await Promise[_0x5690c4(0xb0)]([_0x43be61['user'][_0x5690c4(0xa5)](),_0x43be61[_0x5690c4(0xdf)][_0x5690c4(0x7b)](),((async()=>{const _0x1d3a4d=_0x5690c4;!_0x2b365a&&_0xcf6e91[_0x1d3a4d(0x93)]>0x0&&await _0x376004(_0xcf6e91,async _0x18ff6b=>{const _0xb5f7f8=_0x1d3a4d,_0x1e52a2=await _0x43be61['segment'][_0xb5f7f8(0x75)](_0x4998d2,_0x18ff6b['id']);_0x334e87[_0xb5f7f8(0xe7)](_0x18ff6b['id'],_0x1e52a2);});})())]),{emailToId:_0x55454e,idToEmail:_0x3c0eac}=_0x4e9968,_0x4e012d=buildConnectionMaps(_0x4eab3d);return{'rootFolderId':_0x324ee1,'folderPathToId':_0xba002c,'folderIdToPath':_0x546572,'segmentNameToId':_0x5eb21a,'activationsBySegmentId':_0x334e87,'emailToIdMap':_0x55454e,'idToEmailMap':_0x3c0eac,'connectionNameToIdMap':_0x4e012d[_0x5690c4(0x152)],'connectionIdToNameMap':_0x4e012d[_0x5690c4(0xb4)],'connectionNameToTypeMap':_0x4e012d[_0x5690c4(0x153)]};}export function createPushYamlContextForBundle(_0x3800cb,_0x812b7,_0x478937,_0x1f7fa4,_0x3c6c74,_0x337c0f,_0xfef4c9,_0x122c14){const {existingLocalSegmentNames:_0x35fa1f,localExpandedRuleToNames:_0x2c5592}=_0x1f7fa4,_0x5bb6a6=new Set(),_0x30fc35=new Map(),_0x5e4cdc=new Map(),_0x47c8ff=new Map(),_0x3920fc=createJumpTargetCache(),_0x3ffd05=new Map(),_0xaf18b2=new Map(),_0x5bfabe=new Set();let _0x3e99ba;const _0x15757e=_0x468f2f=>{const _0x1f62ac={'resolveSegment':async _0x505400=>{const _0x51455c=a115_0x329b,_0x13d973=_0x47c8ff['get'](_0x505400);if(_0x13d973!==undefined)return{'name':_0x13d973,'isJourneyLocal':!![]};try{let _0x102035=_0x478937['find'](_0x239533=>_0x239533['id']===_0x505400);!_0x102035&&(_0x102035=await _0x3800cb['segment']['getSegment'](_0x812b7,_0x505400));const _0x1f65d8=generateJourneyLocalName(_0x102035[_0x51455c(0xa6)]),_0x1f787c=_0x102035[_0x51455c(0xec)]===SEGMENT_KIND_JOURNEY&&_0x1f65d8!==undefined;let _0x21c1df=_0x102035['name'],_0xb53d56;if(_0x1f787c&&_0x102035['rule']){const _0x3f2d4f=apiRuleToYaml(_0x102035[_0x51455c(0x108)]);_0xaf18b2[_0x51455c(0xe7)](_0x505400,_0x3f2d4f);const _0x54a8f4=async _0x4b1da1=>{const _0x4c9a9e=_0x51455c,_0x126d33=collectSegmentRefsFromRule(_0x4b1da1);for(const _0x1001d8 of _0x126d33){if(!_0xaf18b2[_0x4c9a9e(0xac)](_0x1001d8))try{const _0x99620=await _0x3800cb[_0x4c9a9e(0x14b)][_0x4c9a9e(0xb1)](_0x812b7,_0x1001d8);if(_0x99620?.[_0x4c9a9e(0x108)]){const _0x488ac5=apiRuleToYaml(_0x99620[_0x4c9a9e(0x108)]);_0xaf18b2['set'](_0x1001d8,_0x488ac5),await _0x54a8f4(_0x488ac5);}}catch{}}};await _0x54a8f4(_0x3f2d4f);const _0x17e7ba=serializeExpandedRule(_0x3f2d4f,_0xaf18b2),_0x18af09=_0x2c5592[_0x51455c(0x124)](_0x17e7ba);if(_0x18af09&&_0x18af09['length']>0x0){const _0x4d23eb=_0x30fc35[_0x51455c(0x124)](_0x17e7ba)||0x0,_0x3d21d4=_0x18af09[_0x4d23eb]||_0x18af09[_0x18af09[_0x51455c(0x93)]-0x1];_0x30fc35[_0x51455c(0xe7)](_0x17e7ba,_0x4d23eb+0x1),_0x21c1df=_0x3d21d4,_0x5bb6a6['add'](_0x21c1df),_0x47c8ff[_0x51455c(0xe7)](_0x505400,_0x21c1df);const _0x11a7e7=await resolveRuleSegmentRefs(_0x3f2d4f,async _0x2898ba=>{const _0x143ea4=_0x51455c,_0x4146e9=_0x47c8ff[_0x143ea4(0x124)](_0x2898ba);if(_0x4146e9)return _0x4146e9;const _0x4358a1=await _0x3e99ba['resolveSegment'](_0x2898ba);return _0x4358a1['name'];});_0xb53d56={'description':_0x102035[_0x51455c(0x12f)],'rule':_0x11a7e7};}else{const _0x2c267e=_0x3ffd05[_0x51455c(0x124)](_0x17e7ba);if(_0x2c267e)_0x21c1df=_0x2c267e,_0x47c8ff[_0x51455c(0xe7)](_0x505400,_0x21c1df);else{if(_0x1f65d8){let _0x4b7bfb=_0x1f65d8,_0x521e21=0x2;while(_0x5bb6a6[_0x51455c(0xac)](_0x4b7bfb)||_0x35fa1f[_0x51455c(0xac)](_0x4b7bfb)){_0x4b7bfb=_0x1f65d8+'_'+_0x521e21,_0x521e21++;}_0x5bb6a6['add'](_0x4b7bfb),_0x21c1df=_0x4b7bfb;}_0x47c8ff[_0x51455c(0xe7)](_0x505400,_0x21c1df),_0x3ffd05['set'](_0x17e7ba,_0x21c1df);const _0x434b7f=await resolveRuleSegmentRefs(_0x3f2d4f,async _0x346884=>{const _0x32cda7=_0x51455c,_0x22fdd1=_0x47c8ff[_0x32cda7(0x124)](_0x346884);if(_0x22fdd1)return _0x22fdd1;const _0x50e88e=await _0x3e99ba[_0x32cda7(0x156)](_0x346884);return _0x50e88e[_0x32cda7(0xa6)];});_0xb53d56={'description':_0x102035[_0x51455c(0x12f)],'rule':_0x434b7f};}}}return{'name':_0x21c1df,'isJourneyLocal':_0x1f787c,'definition':_0xb53d56};}catch{return{'name':_0x505400,'isJourneyLocal':![]};}},'resolveActivation':async _0x5d889f=>{const _0x177c90=a115_0x329b,_0x5d9303=_0x5e4cdc['get'](_0x5d889f);if(_0x5d9303!==undefined)return{'name':_0x5d9303,'isJourneyLocal':!![]};try{let _0x4707e5=_0xfef4c9?.[_0x177c90(0x124)](_0x5d889f);!_0x4707e5&&(_0x4707e5=await _0x3800cb[_0x177c90(0xe6)][_0x177c90(0xd1)](_0x468f2f,_0x5d889f));const _0x17a929=_0x4707e5[_0x177c90(0xef)]['activationParams'][_0x177c90(0xa6)]||_0x5d889f,_0x3f1130=sanitizeYamlKey(_0x17a929)||_0x177c90(0x13c)+_0x5d889f,_0x22a94a=_0x3f1130;_0x5e4cdc[_0x177c90(0xe7)](_0x5d889f,_0x22a94a);const _0x1c9f0f=journeyActivationStepToYaml(_0x4707e5,_0x3c6c74,_0x337c0f);return{'name':_0x22a94a,'isJourneyLocal':!![],'definition':_0x1c9f0f};}catch{return{'name':_0x5d889f,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xffd040,_0x23e225)=>resolveJumpTarget(_0xffd040,_0x23e225,_0x3920fc,async _0x6a6311=>{const _0x2e4bd5=a115_0x329b,_0xeb89b8=_0x122c14?.[_0x2e4bd5(0x124)](_0x6a6311);if(_0xeb89b8)return _0xeb89b8;return _0x3800cb[_0x2e4bd5(0xe6)][_0x2e4bd5(0x102)](_0x6a6311);})};return _0x3e99ba=_0x1f62ac,_0x1f62ac;},_0x5f44d2=async _0x21415d=>{const _0x17556f=a115_0x329b,{collectSegmentIdsFromJourneyApi:_0x227e5b}=await import(_0x17556f(0x10b)),{batchAsync:_0x1aaff5}=await import('../../utils/async.js'),_0x187a7a=new Set();for(const _0x2a31f3 of _0x21415d){let _0x14c469=_0x122c14?.[_0x17556f(0x124)](_0x2a31f3);!_0x14c469&&(_0x14c469=await _0x3800cb[_0x17556f(0xe6)][_0x17556f(0x102)](_0x2a31f3));const _0x4ac1f5=_0x227e5b(_0x14c469);for(const _0x12b5a5 of _0x4ac1f5){_0x187a7a['add'](_0x12b5a5);}}let _0xefeea4=Array['from'](_0x187a7a);while(_0xefeea4[_0x17556f(0x93)]>0x0){const _0x306fdd=_0xefeea4[_0x17556f(0x107)](_0x28318d=>!_0x5bfabe[_0x17556f(0xac)](_0x28318d));if(_0x306fdd['length']===0x0)break;const _0x3d9c56=await _0x1aaff5(_0x306fdd,async _0x294735=>{const _0x9d7501=_0x17556f;_0x5bfabe['add'](_0x294735);let _0x5080eb=_0x478937[_0x9d7501(0x115)](_0x1154d2=>_0x1154d2['id']===_0x294735);if(!_0x5080eb)try{_0x5080eb=await _0x3800cb[_0x9d7501(0x14b)][_0x9d7501(0xb1)](_0x812b7,_0x294735);}catch{return null;}return{'segmentId':_0x294735,'segment':_0x5080eb};},0xa),_0x102e1b=new Set();for(const _0x2c74ab of _0x3d9c56){if(!_0x2c74ab?.[_0x17556f(0x14b)]?.['rule'])continue;const _0x13b341=apiRuleToYaml(_0x2c74ab[_0x17556f(0x14b)][_0x17556f(0x108)]);_0xaf18b2['set'](_0x2c74ab['segmentId'],_0x13b341);const _0x51da15=collectSegmentRefsFromRule(_0x13b341);for(const _0x28fdd7 of _0x51da15){!_0x5bfabe[_0x17556f(0xac)](_0x28fdd7)&&_0x102e1b[_0x17556f(0x96)](_0x28fdd7);}}_0xefeea4=Array[_0x17556f(0xb8)](_0x102e1b);}};return{'createYamlContext':_0x15757e,'prefetchJourneySegments':_0x5f44d2};}export async function executePushSegments(_0x16951f,_0x1aeb0c,_0x1f6594,_0x1d390a,_0x13f2f0){const _0x576cf7=a115_0x19deef,{segmentDefToCreateRequest:_0x266f20,segmentDefToUpdateRequest:_0x1e13ab}=await import(_0x576cf7(0x11d)),_0x2aaa45=_0x1f6594[_0x576cf7(0xfa)],_0x52ecf0=0x5,_0x278e5f=async _0x12bcab=>{const _0x135340=_0x576cf7,_0x205146=_0x12bcab['folderPath']?_0x2aaa45[_0x135340(0x124)](_0x12bcab[_0x135340(0x7a)]):undefined;let _0x147321;const _0x5455af={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x12bcab[_0x135340(0x151)]){_0x13f2f0['onProgress']?.({'type':'segment_creating','name':_0x12bcab['yamlConfig']['name']});const _0x3d0bfa=_0x266f20(_0x12bcab[_0x135340(0x103)],_0x205146),_0x20ed1b=await _0x13f2f0[_0x135340(0xaa)](_0x135340(0xa3)+_0x12bcab[_0x135340(0x103)][_0x135340(0xa6)]+'\x27...',()=>_0x16951f[_0x135340(0x14b)][_0x135340(0xfe)](_0x1d390a['parentId'],_0x3d0bfa));_0x147321=_0x20ed1b[_0x135340(0x74)]['id'],_0x5455af['createdSegmentId']={'name':_0x12bcab[_0x135340(0x103)]['name'],'id':_0x147321},_0x13f2f0[_0x135340(0xfd)]?.({'type':_0x135340(0x12c),'name':_0x12bcab['yamlConfig'][_0x135340(0xa6)],'segmentId':_0x147321}),_0x13f2f0[_0x135340(0x105)]?.(_0x135340(0x73)+_0x12bcab[_0x135340(0x103)][_0x135340(0xa6)]+'\x27'),_0x5455af[_0x135340(0x128)]=0x1;}else{if(_0x12bcab[_0x135340(0x133)]){_0x13f2f0[_0x135340(0xfd)]?.({'type':_0x135340(0xe4),'name':_0x12bcab['yamlConfig']['name']});const _0x14dafc=_0x1e13ab(_0x12bcab['yamlConfig']);_0x205146!==_0x12bcab[_0x135340(0x146)]?.[_0x135340(0xce)]&&(_0x14dafc[_0x135340(0xce)]=_0x205146?parseInt(_0x205146,0xa):undefined),await _0x13f2f0[_0x135340(0xaa)](_0x135340(0x9d)+_0x12bcab[_0x135340(0x103)][_0x135340(0xa6)]+_0x135340(0x129),()=>_0x16951f[_0x135340(0x14b)][_0x135340(0x8b)](_0x1d390a['parentId'],_0x12bcab[_0x135340(0x146)]['id'],_0x14dafc)),_0x147321=_0x12bcab[_0x135340(0x146)]['id'],_0x13f2f0['onProgress']?.({'type':_0x135340(0x9b),'name':_0x12bcab['yamlConfig'][_0x135340(0xa6)]}),_0x13f2f0['logSuccess']?.('Updated\x20segment\x20\x27'+_0x12bcab[_0x135340(0x103)][_0x135340(0xa6)]+'\x27'),_0x5455af[_0x135340(0x84)]=0x1;}else _0x147321=_0x12bcab[_0x135340(0x146)]['id'];}}catch(_0x1ba511){const _0x11614f=isHttp400Error(_0x1ba511),_0x27654c=_0x11614f?ErrorCode[_0x135340(0xc7)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x247206=getErrorMessage(_0x1ba511);throw new SDKError(_0x27654c,_0x135340(0x138)+(_0x12bcab[_0x135340(0x151)]?'create':_0x135340(0x8f))+_0x135340(0xbc)+_0x12bcab['absolutePath']+_0x135340(0x10e)+_0x247206,_0x1ba511);}try{const _0x78f84=await syncActivationsForSegment(_0x16951f,_0x1d390a[_0x135340(0xf2)],_0x147321,_0x12bcab[_0x135340(0x103)]['name'],_0x12bcab[_0x135340(0xcb)],_0x13f2f0,_0x12bcab[_0x135340(0x131)]);_0x5455af['activations']=_0x78f84;}catch(_0x497794){if(_0x497794 instanceof SDKError)throw _0x497794;throw new SDKError(ErrorCode[_0x135340(0x114)],_0x135340(0x147)+_0x12bcab[_0x135340(0x103)][_0x135340(0xa6)]+_0x135340(0x99)+_0x12bcab[_0x135340(0x131)]+_0x135340(0x10e)+getErrorMessage(_0x497794),_0x497794);}return _0x5455af;},_0x464be9=await batchAsync(_0x1aeb0c,_0x278e5f,_0x52ecf0),_0x11a3b4={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1c525d of _0x464be9){_0x11a3b4[_0x576cf7(0x128)]+=_0x1c525d[_0x576cf7(0x128)],_0x11a3b4[_0x576cf7(0x84)]+=_0x1c525d[_0x576cf7(0x84)],_0x1c525d[_0x576cf7(0x85)]&&_0x11a3b4[_0x576cf7(0xd7)][_0x576cf7(0xe7)](_0x1c525d[_0x576cf7(0x85)]['name'],_0x1c525d[_0x576cf7(0x85)]['id']),_0x11a3b4['activations'][_0x576cf7(0x128)]+=_0x1c525d['activations'][_0x576cf7(0x128)],_0x11a3b4[_0x576cf7(0xf9)][_0x576cf7(0x84)]+=_0x1c525d[_0x576cf7(0xf9)]['updated'],_0x11a3b4[_0x576cf7(0xf9)]['deleted']+=_0x1c525d[_0x576cf7(0xf9)][_0x576cf7(0x10d)];}return _0x11a3b4;}async function syncActivationsForSegment(_0x44f83e,_0x1e45b0,_0xd49d82,_0x3b85c5,_0x59e025,_0x44e038,_0x3d9d1f){const _0x4313b3=a115_0x19deef,_0x368a27={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2add4b of _0x59e025){try{if(_0x2add4b['type']===_0x4313b3(0x10c)&&_0x2add4b[_0x4313b3(0xf3)])_0x44e038['onProgress']?.({'type':_0x4313b3(0xb6),'segmentName':_0x3b85c5,'activationName':_0x2add4b[_0x4313b3(0xa6)]}),await _0x44e038[_0x4313b3(0xaa)](_0x4313b3(0xea)+_0x2add4b[_0x4313b3(0xa6)]+'\x27...',()=>_0x44f83e[_0x4313b3(0x14b)][_0x4313b3(0xd0)](_0x1e45b0,_0xd49d82,_0x2add4b[_0x4313b3(0xf3)])),_0x44e038[_0x4313b3(0xfd)]?.({'type':_0x4313b3(0xb5),'segmentName':_0x3b85c5,'activationName':_0x2add4b['name']}),_0x44e038[_0x4313b3(0x105)]?.(_0x4313b3(0x112)+_0x2add4b[_0x4313b3(0xa6)]+'\x27'),_0x368a27[_0x4313b3(0x128)]++;else{if(_0x2add4b['type']===_0x4313b3(0x8f)&&_0x2add4b[_0x4313b3(0xf3)]&&_0x2add4b[_0x4313b3(0xc5)])_0x44e038[_0x4313b3(0xfd)]?.({'type':_0x4313b3(0xaf),'segmentName':_0x3b85c5,'activationName':_0x2add4b[_0x4313b3(0xa6)]}),await _0x44e038['withProgress'](_0x4313b3(0x14e)+_0x2add4b[_0x4313b3(0xa6)]+_0x4313b3(0x129),()=>_0x44f83e['segment'][_0x4313b3(0xcf)](_0x1e45b0,_0xd49d82,_0x2add4b[_0x4313b3(0xc5)]['id'],_0x2add4b[_0x4313b3(0xf3)])),_0x44e038[_0x4313b3(0xfd)]?.({'type':'activation_updated','segmentName':_0x3b85c5,'activationName':_0x2add4b[_0x4313b3(0xa6)]}),_0x44e038[_0x4313b3(0x105)]?.(_0x4313b3(0x97)+_0x2add4b[_0x4313b3(0xa6)]+'\x27'),_0x368a27[_0x4313b3(0x84)]++;else _0x2add4b[_0x4313b3(0x8d)]===_0x4313b3(0x7f)&&_0x2add4b['existingActivation']&&(_0x44e038[_0x4313b3(0xfd)]?.({'type':_0x4313b3(0x122),'segmentName':_0x3b85c5,'activationName':_0x2add4b[_0x4313b3(0xa6)]}),await _0x44e038[_0x4313b3(0xaa)](_0x4313b3(0x14a)+_0x2add4b[_0x4313b3(0xa6)]+_0x4313b3(0x129),()=>_0x44f83e[_0x4313b3(0x14b)][_0x4313b3(0x92)](_0x1e45b0,_0xd49d82,_0x2add4b[_0x4313b3(0xc5)]['id'])),_0x44e038['onProgress']?.({'type':'activation_deleted','segmentName':_0x3b85c5,'activationName':_0x2add4b[_0x4313b3(0xa6)]}),_0x44e038[_0x4313b3(0x132)]?.(_0x4313b3(0x78)+_0x2add4b['name']+'\x27'),_0x368a27['deleted']++);}}catch(_0x52e1b1){const _0x4287c3=isHttp400Error(_0x52e1b1),_0x11fe22=_0x4287c3?ErrorCode[_0x4313b3(0x136)]:ErrorCode[_0x4313b3(0x114)],_0x3f44a8=getErrorMessage(_0x52e1b1);throw new SDKError(_0x11fe22,_0x4313b3(0x138)+_0x2add4b['type']+_0x4313b3(0xd2)+_0x2add4b['name']+_0x4313b3(0x99)+_0x3d9d1f+_0x4313b3(0x10e)+_0x3f44a8,_0x52e1b1);}}return _0x368a27;}export async function executePushFolders(_0x9f8ebf,_0x584f17,_0x21c033,_0x55c439,_0x22e59e){const _0x33b78d=a115_0x19deef,_0x5c8314=new Map(_0x21c033);for(const _0xa623c1 of _0x584f17){const _0x5efc43=_0xa623c1[_0x33b78d(0x130)]('/'),_0x5e6f10=_0x5efc43[_0x5efc43['length']-0x1],_0x5266ab=_0x5efc43[_0x33b78d(0xa8)](0x0,-0x1)[_0x33b78d(0x116)]('/'),_0x501652=_0x5c8314[_0x33b78d(0x124)](_0x5266ab);_0x22e59e[_0x33b78d(0xfd)]?.({'type':_0x33b78d(0xd4),'folder':_0xa623c1});const _0x44e3d4={'name':_0x5e6f10,'parentFolderId':_0x501652},_0x4b36c7=await _0x22e59e[_0x33b78d(0xaa)](_0x33b78d(0xad)+_0xa623c1+'\x27...',()=>_0x9f8ebf['segment']['createFolder'](_0x55c439[_0x33b78d(0xf2)],_0x44e3d4));_0x5c8314[_0x33b78d(0xe7)](_0xa623c1,_0x4b36c7[_0x33b78d(0x74)]['id']),_0x22e59e[_0x33b78d(0xfd)]?.({'type':'folder_created','folder':_0xa623c1,'folderId':_0x4b36c7[_0x33b78d(0x74)]['id']}),_0x22e59e[_0x33b78d(0xa7)]?.('Created\x20folder\x20\x27'+_0xa623c1+'\x27');}return _0x5c8314;}export async function executePushSegmentDeletions(_0x5c9683,_0x1897df,_0x28a055){const _0x5d3f79=a115_0x19deef;if(_0x1897df[_0x5d3f79(0x93)]===0x0)return 0x0;const {batchAsync:_0x342bac}=await import(_0x5d3f79(0x110)),_0x32a778=0x5,_0x573c53=await _0x342bac(_0x1897df,async _0x82f0ac=>{const _0x35e9a6=_0x5d3f79;return _0x28a055[_0x35e9a6(0xfd)]?.({'type':'segment_deleting','name':_0x82f0ac[_0x35e9a6(0xa6)]}),await _0x5c9683[_0x35e9a6(0x14b)]['deleteSegment'](_0x82f0ac['id']),_0x28a055['onProgress']?.({'type':_0x35e9a6(0x8e),'name':_0x82f0ac['name']}),_0x28a055[_0x35e9a6(0x132)]?.(_0x35e9a6(0xe3)+_0x82f0ac[_0x35e9a6(0xa6)]+'\x27'),0x1;},_0x32a778);return _0x573c53['reduce']((_0x24163a,_0x16b4ea)=>_0x24163a+_0x16b4ea,0x0);}export async function executePushJourneys(_0x1c244a,_0xac6c95,_0x34f583,_0x3438a9,_0x157977){const _0x5c969d=a115_0x19deef,{journeyDefToRequest:_0x249437}=await import(_0x5c969d(0x10b)),{activationDefToCreateRequest:_0xd059cc,yamlRuleToApi:_0x4778de,validateSegmentRule:_0x2421a6}=await import('./child-segment-yaml.js'),_0x2dd1ee={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4f0be7=new Map(_0x34f583['segmentNameToId']),_0x490b59=0x5;for(let _0xa398ff=0x0;_0xa398ff<_0xac6c95['length'];_0xa398ff+=_0x490b59){const _0xb8b95b=_0xac6c95[_0x5c969d(0xa8)](_0xa398ff,_0xa398ff+_0x490b59),_0x1ac588=await Promise['all'](_0xb8b95b[_0x5c969d(0xd6)](async _0x4885f6=>{const _0x1108a4=_0x5c969d;if(!_0x4885f6[_0x1108a4(0x151)]&&!_0x4885f6['hasChanges'])return{'action':_0x1108a4(0x11a),'name':_0x4885f6[_0x1108a4(0x103)][_0x1108a4(0xa6)],'journeyId':_0x4885f6[_0x1108a4(0xcd)]?.['id']};const _0x27e75d=_0x4885f6[_0x1108a4(0x7a)]?_0x34f583['folderPathToId']['get'](_0x4885f6['folderPath']):undefined;_0x157977[_0x1108a4(0xfd)]?.({'type':_0x4885f6[_0x1108a4(0x151)]?_0x1108a4(0x143):'journey_updating','name':_0x4885f6[_0x1108a4(0x103)][_0x1108a4(0xa6)]});try{const _0x2eb209=await executeSingleJourneyPush(_0x1c244a,_0x4885f6,{..._0x34f583,'segmentNameToId':_0x4f0be7},{'parentId':_0x3438a9[_0x1108a4(0xf2)],'rootFolderId':_0x3438a9['rootFolderId'],'folderId':_0x27e75d,'verbose':_0x3438a9[_0x1108a4(0xd8)]},_0x157977,{'journeyDefToRequest':_0x249437,'activationDefToCreateRequest':_0xd059cc,'yamlRuleToApi':_0x4778de,'validateSegmentRule':_0x2421a6});for(const [_0x4b0cc3,_0x2f4b3f]of _0x2eb209[_0x1108a4(0x82)]){_0x4f0be7['set'](_0x4b0cc3,_0x2f4b3f),_0x2dd1ee[_0x1108a4(0x82)][_0x1108a4(0xe7)](_0x4b0cc3,_0x2f4b3f);}if(_0x2eb209[_0x1108a4(0x126)]===_0x1108a4(0x128))_0x157977[_0x1108a4(0xfd)]?.({'type':_0x1108a4(0x135),'name':_0x4885f6[_0x1108a4(0x103)][_0x1108a4(0xa6)],'journeyId':_0x2eb209['journeyId']}),_0x157977[_0x1108a4(0x105)]?.(_0x1108a4(0xa9)+_0x4885f6[_0x1108a4(0x103)][_0x1108a4(0xa6)]+'\x27'),_0x2dd1ee[_0x1108a4(0x128)]++;else _0x2eb209[_0x1108a4(0x126)]==='updated'&&(_0x157977[_0x1108a4(0xfd)]?.({'type':_0x1108a4(0x139),'name':_0x4885f6[_0x1108a4(0x103)][_0x1108a4(0xa6)]}),_0x157977[_0x1108a4(0x105)]?.(_0x1108a4(0xc6)+_0x4885f6[_0x1108a4(0x103)][_0x1108a4(0xa6)]+'\x27'),_0x2dd1ee[_0x1108a4(0x84)]++);return{'action':_0x2eb209['action'],'name':_0x4885f6['yamlConfig'][_0x1108a4(0xa6)],'journeyId':_0x2eb209['journeyId']};}catch(_0x7de451){const _0x1a7307=isHttp400Error(_0x7de451),_0xabbdc5=_0x1a7307?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x1108a4(0xf5)],_0x318aea=getErrorMessage(_0x7de451);throw new SDKError(_0xabbdc5,_0x1108a4(0x138)+(_0x4885f6[_0x1108a4(0x151)]?'create':_0x1108a4(0x8f))+_0x1108a4(0xfb)+_0x4885f6[_0x1108a4(0x131)]+'\x0a\x20\x20'+_0x318aea,_0x7de451);}}));_0x2dd1ee[_0x5c969d(0xee)]['push'](..._0x1ac588);}return _0x2dd1ee;}async function executeSingleJourneyPush(_0xcc3005,_0x2c832c,_0x55dc52,_0x2cb38d,_0x588beb,_0x20c4b4){const _0x502f22=a115_0x19deef,{journeyDefToRequest:_0x3dbabb,activationDefToCreateRequest:_0x25141c,yamlRuleToApi:_0x29b9d0,validateSegmentRule:_0x4c3d4d}=_0x20c4b4,_0x474e68=new Map(),_0x1a2294=new Map(),_0x2edb33=new Map(),_0x359a4a=new Map(),_0x3e74c9=new Map();let _0x8e95e5;const _0x5e0fae=async()=>{const _0x45aa56=a115_0x329b;if(_0x8e95e5)return;_0x8e95e5=new Map();if(!_0x2c832c['existingJourney'])return;const _0x238666=await _0xcc3005[_0x45aa56(0xe6)]['listActivations'](_0x2c832c['existingJourney']['id']);for(const _0x5e2b2c of _0x238666){const _0x3c0525=journeyActivationStepToYaml(_0x5e2b2c,_0x55dc52[_0x45aa56(0xc0)],_0x55dc52[_0x45aa56(0xe9)]),_0x4e7585=activationSignature(_0x3c0525);!_0x8e95e5['has'](_0x4e7585)&&_0x8e95e5[_0x45aa56(0xe7)](_0x4e7585,_0x5e2b2c['id']),_0x3c0525[_0x45aa56(0xa6)]&&_0x1a2294[_0x45aa56(0xe7)](_0x3c0525[_0x45aa56(0xa6)],_0x5e2b2c['id']);}};if(_0x2c832c[_0x502f22(0xcd)]&&_0x2c832c[_0x502f22(0x103)][_0x502f22(0x14c)]){const _0x1eda9c=buildLocalExpandedRuleMappings(_0x2c832c[_0x502f22(0x103)]),_0x385ae5=_0x1eda9c[_0x502f22(0xd3)];if(_0x385ae5[_0x502f22(0x104)]>0x0){const _0x1a5f74=new Map();for(const [_0x327b64,_0x58255e]of _0x385ae5){const _0xeaae0=serializeExpandedRule(_0x58255e,_0x385ae5);_0x1a5f74['set'](_0x327b64,_0xeaae0);}const _0x6099d=collectSegmentIdsFromJourneyApi(_0x2c832c[_0x502f22(0xcd)]);if(_0x6099d[_0x502f22(0x104)]>0x0){const _0x4a7eab=await buildServerSegmentRuleMap(_0xcc3005,_0x2cb38d['parentId'],_0x55dc52['existingSegments'],_0x6099d);if(_0x4a7eab[_0x502f22(0x104)]>0x0){const _0x5d1e5e=new Map();for(const [_0x5964e4,_0x4c148e]of _0x4a7eab){const _0x2789cb=serializeExpandedRule(_0x4c148e,_0x4a7eab);!_0x5d1e5e[_0x502f22(0xac)](_0x2789cb)&&_0x5d1e5e[_0x502f22(0xe7)](_0x2789cb,_0x5964e4);}for(const [_0x51729b,_0x4b8cbd]of _0x1a5f74){const _0x3890ee=_0x5d1e5e[_0x502f22(0x124)](_0x4b8cbd);_0x3890ee&&(_0x3e74c9[_0x502f22(0xe7)](_0x51729b,_0x3890ee),_0x55dc52['segmentNameToId'][_0x502f22(0xe7)](_0x51729b,_0x3890ee));}}}}}const _0x14deed={'resolveSegmentId':async _0x4f9b06=>{const _0x498891=_0x502f22,_0x19584e=_0x55dc52[_0x498891(0x11c)][_0x498891(0x124)](_0x4f9b06);if(!_0x19584e)throw new SDKError(ErrorCode[_0x498891(0xe2)],_0x498891(0x113)+_0x4f9b06+'\x20(referenced\x20in\x20journey\x20'+_0x2c832c[_0x498891(0x103)][_0x498891(0xa6)]+')');return _0x19584e;},'resolveEmbeddedSegmentId':async(_0x37f42b,_0x38347b)=>{const _0x2c7179=_0x502f22,_0xfe92be=_0x55dc52[_0x2c7179(0x11c)][_0x2c7179(0x124)](_0x37f42b);if(_0xfe92be)return _0xfe92be;const _0x29f56=_0x3e74c9['get'](_0x37f42b);if(_0x29f56)return _0x55dc52[_0x2c7179(0x11c)][_0x2c7179(0xe7)](_0x37f42b,_0x29f56),_0x29f56;const _0x4e06fd=_0x55dc52[_0x2c7179(0xf1)]['find'](_0xfdd69b=>_0xfdd69b[_0x2c7179(0xa6)]===_0x37f42b);if(_0x4e06fd)return _0x55dc52['segmentNameToId'][_0x2c7179(0xe7)](_0x37f42b,_0x4e06fd['id']),_0x4e06fd['id'];if(_0x2c832c[_0x2c7179(0x151)]){const {stageName:_0x1e4985,criteriaName:_0x2ded86}=findSegmentCriteriaLocation(_0x2c832c['yamlConfig'],_0x37f42b);return _0x4c3d4d(_0x37f42b,_0x38347b[_0x2c7179(0x108)]),_0x2edb33[_0x2c7179(0xe7)](_0x37f42b,{'definition':_0x38347b,'stageName':_0x1e4985,'criteriaName':_0x2ded86}),createPendingSegmentId(_0x37f42b);}const _0x56f684=_0x2c832c['existingJourney']?.['id'];if(!_0x56f684)throw new SDKError(ErrorCode[_0x2c7179(0x77)],_0x2c7179(0xda));_0x4c3d4d(_0x37f42b,_0x38347b[_0x2c7179(0x108)]);const _0x5df058=generateDeterministicJourneySegmentName(_0x2c832c[_0x2c7179(0x103)][_0x2c7179(0xa6)],_0x37f42b),_0x2e8832=_0x55dc52[_0x2c7179(0xf1)][_0x2c7179(0x115)](_0x3598c1=>_0x3598c1['name']===_0x5df058),_0x500038=createSegmentIdResolver(_0x55dc52[_0x2c7179(0x11c)],_0x37f42b),_0x23a867=await resolveRuleSegmentIds(_0x38347b[_0x2c7179(0x108)],_0x500038);let _0x2ee163;if(_0x2e8832)await _0xcc3005[_0x2c7179(0x14b)][_0x2c7179(0x8b)](_0x2cb38d[_0x2c7179(0xf2)],_0x2e8832['id'],{'description':_0x38347b['description']||'Entry\x20criteria:\x20'+_0x37f42b,'rule':_0x29b9d0(_0x23a867,!![]),'countPopulation':!![]}),_0x2ee163=_0x2e8832['id'];else try{_0x2ee163=await _0xcc3005[_0x2c7179(0x14b)][_0x2c7179(0x11b)]({'name':_0x5df058,'description':_0x38347b['description']||'Entry\x20criteria:\x20'+_0x37f42b,'journeyId':_0x56f684,'rule':_0x29b9d0(_0x23a867,!![]),'countPopulation':!![],'parentFolderId':_0x2cb38d['rootFolderId']||'','audienceId':_0x2cb38d[_0x2c7179(0xf2)]});}catch(_0x554705){const _0x14b809=_0x554705 instanceof Error&&_0x554705['message'][_0x2c7179(0xa1)](_0x2c7179(0x7c));if(_0x14b809){const _0x42fdb0=await _0xcc3005['segment']['listSegments'](_0x2cb38d[_0x2c7179(0xf2)]),_0x45a876=_0x42fdb0['find'](_0x1fa169=>_0x1fa169[_0x2c7179(0xa6)]===_0x5df058);if(_0x45a876)await _0xcc3005[_0x2c7179(0x14b)][_0x2c7179(0x8b)](_0x2cb38d['parentId'],_0x45a876['id'],{'description':_0x38347b['description']||_0x2c7179(0x9f)+_0x37f42b,'rule':_0x29b9d0(_0x23a867,!![]),'countPopulation':!![]}),_0x2ee163=_0x45a876['id'];else throw _0x554705;}else throw _0x554705;}return _0x55dc52[_0x2c7179(0x11c)][_0x2c7179(0xe7)](_0x37f42b,_0x2ee163),_0x474e68['set'](_0x37f42b,_0x2ee163),_0x2ee163;},'resolveActivationId':async _0x4a740e=>{const _0x329d50=_0x502f22,_0x5a95a5=_0x1a2294[_0x329d50(0x124)](_0x4a740e);if(_0x5a95a5)return _0x5a95a5;if(_0x2c832c[_0x329d50(0xcd)]){await _0x5e0fae();const _0x24134a=_0x1a2294[_0x329d50(0x124)](_0x4a740e);if(_0x24134a)return _0x24134a;}throw new SDKError(ErrorCode[_0x329d50(0x89)],_0x329d50(0x150)+_0x4a740e+_0x329d50(0xeb)+_0x2c832c[_0x329d50(0x103)][_0x329d50(0xa6)]+_0x329d50(0xc3)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x5a86f6,_0x704687)=>{const _0x2a26da=_0x502f22,_0x57da11=_0x1a2294[_0x2a26da(0x124)](_0x5a86f6);if(_0x57da11)return _0x57da11;if(_0x2c832c[_0x2a26da(0x151)])return _0x359a4a['set'](_0x5a86f6,_0x704687),createPendingActivationId(_0x5a86f6);if(_0x2c832c[_0x2a26da(0xcd)]){await _0x5e0fae();const _0xa7394=_0x1a2294['get'](_0x704687[_0x2a26da(0xa6)]);if(_0xa7394)return _0x1a2294['set'](_0x5a86f6,_0xa7394),_0xa7394;const _0x2bfe47=activationSignature(_0x704687),_0x181adf=_0x8e95e5?.[_0x2a26da(0x124)](_0x2bfe47);if(_0x181adf)return _0x1a2294[_0x2a26da(0xe7)](_0x5a86f6,_0x181adf),_0x181adf;const _0x4804ab=await _0x25141c(_0x704687,_0x55dc52[_0x2a26da(0x106)]),_0x3246d4=await _0xcc3005[_0x2a26da(0xe6)][_0x2a26da(0xd0)](_0x2c832c[_0x2a26da(0xcd)]['id'],_0x4804ab);return _0x1a2294[_0x2a26da(0xe7)](_0x5a86f6,_0x3246d4['id']),_0x3246d4['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x2a26da(0xa4));},'resolveJourneyId':async _0xa722da=>{const _0x5ceba1=_0x502f22;try{return await _0xcc3005['journey'][_0x5ceba1(0x140)](_0x2cb38d[_0x5ceba1(0xf2)],_0xa722da);}catch(_0x3ed015){throw new SDKError(ErrorCode[_0x5ceba1(0x89)],_0x5ceba1(0xc9)+_0xa722da+_0x5ceba1(0xd5)+_0x2c832c[_0x5ceba1(0x103)][_0x5ceba1(0xa6)]+'\x27)',_0x3ed015);}},'resolveStageId':async(_0x45c102,_0x44445e)=>{const _0x3483e9=_0x502f22,_0xcb224=await _0xcc3005[_0x3483e9(0xe6)][_0x3483e9(0x102)](_0x45c102),_0xce01ae=_0xcb224[_0x3483e9(0xef)]['journeyStages'][_0x3483e9(0x115)](_0x584610=>_0x584610[_0x3483e9(0xa6)][_0x3483e9(0x120)]()===_0x44445e['toLowerCase']());if(!_0xce01ae?.['id'])throw new SDKError(ErrorCode[_0x3483e9(0x89)],_0x3483e9(0x119)+_0x44445e+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0xcb224[_0x3483e9(0xef)][_0x3483e9(0xc8)]||_0xcb224[_0x3483e9(0xef)][_0x3483e9(0xa6)])+'\x27');return _0xce01ae['id'];}},_0x232254=await _0x3dbabb(_0x2c832c[_0x502f22(0x103)],_0x2cb38d[_0x502f22(0xf2)],_0x14deed),_0x442fe6=_0x2cb38d[_0x502f22(0x141)]||_0x2cb38d[_0x502f22(0x142)];_0x442fe6&&(_0x232254[_0x502f22(0xf0)]={'parentFolder':{'data':{'id':_0x442fe6,'type':_0x502f22(0xa2)}}});if(_0x2c832c[_0x502f22(0x151)]){if(_0x2edb33['size']>0x0||_0x359a4a[_0x502f22(0x104)]>0x0)return await executeThreeStepJourneyCreate(_0xcc3005,_0x2c832c,_0x232254,{'pendingEmbeddedSegments':_0x2edb33,'pendingEmbeddedActivations':_0x359a4a,'embeddedSegmentNameToId':_0x474e68,'journeyActivationNameToId':_0x1a2294},{..._0x2cb38d,'effectiveFolderId':_0x442fe6},_0x55dc52,_0x588beb,_0x20c4b4);else{ensureJourneyDefaults(_0x232254[_0x502f22(0xef)]);const _0x1c057d=await _0xcc3005[_0x502f22(0xe6)]['create'](_0x232254);return{'action':_0x502f22(0x128),'journeyId':_0x1c057d['id'],'embeddedSegmentNameToId':_0x474e68};}}else{if(_0x2c832c[_0x502f22(0x133)]&&_0x2c832c['existingJourney'])return ensureJourneyDefaults(_0x232254[_0x502f22(0xef)]),await _0xcc3005['journey']['update'](_0x2c832c[_0x502f22(0xcd)]['id'],_0x232254),{'action':'updated','journeyId':_0x2c832c['existingJourney']['id'],'embeddedSegmentNameToId':_0x474e68};}return{'action':_0x502f22(0x11a),'journeyId':_0x2c832c[_0x502f22(0xcd)]?.['id'],'embeddedSegmentNameToId':_0x474e68};}function findSegmentCriteriaLocation(_0x55a73e,_0x1c9666){const _0x560c61=a115_0x19deef,_0x422b92=_0x55a73e['stages']||_0x55a73e['journeys']?.[0x0]?.[_0x560c61(0x111)]||[];let _0x2edcb7=_0x560c61(0xdb),_0x4f7503=_0x1c9666;const _0x2f876d=_0x55a73e[_0x560c61(0x90)]||_0x55a73e[_0x560c61(0x12a)]?.[0x0]?.['goal'];if(_0x2f876d?.[_0x560c61(0x14b)]===_0x1c9666)return{'stageName':'goal','criteriaName':_0x2f876d['name']||_0x1c9666};_0x4cc3d8:for(const _0x40dbfe of _0x422b92){if(_0x40dbfe['entry_criteria']?.['segment']===_0x1c9666){_0x2edcb7=_0x40dbfe[_0x560c61(0xa6)],_0x4f7503=_0x40dbfe[_0x560c61(0x121)][_0x560c61(0xa6)]||_0x1c9666;break;}if(_0x40dbfe['steps'])for(const _0x4ec3f9 of _0x40dbfe[_0x560c61(0xcc)]){if(_0x4ec3f9[_0x560c61(0x8d)]===_0x560c61(0x100)&&_0x4ec3f9['with']?.[_0x560c61(0xc2)])for(const _0x569f3f of _0x4ec3f9[_0x560c61(0x8a)]['branches']){if(_0x569f3f[_0x560c61(0x14b)]===_0x1c9666){_0x2edcb7=_0x40dbfe[_0x560c61(0xa6)],_0x4f7503=_0x569f3f['name']||_0x1c9666;break _0x4cc3d8;}}}}return{'stageName':_0x2edcb7,'criteriaName':_0x4f7503};}async function executeThreeStepJourneyCreate(_0x5bb4d8,_0x4fd0fe,_0x2d8c10,_0x3aa7be,_0x872da,_0x356a48,_0x4e6500,_0x4a6485){const _0x5d0dd7=a115_0x19deef,{activationDefToCreateRequest:_0x2b9ee0,yamlRuleToApi:_0x532674}=_0x4a6485,{pendingEmbeddedSegments:_0x5903b1,pendingEmbeddedActivations:_0x27b92a,embeddedSegmentNameToId:_0x2b6822}=_0x3aa7be,_0x1664c8=JSON[_0x5d0dd7(0x87)](JSON['stringify'](_0x2d8c10));ensureJourneyDefaults(_0x1664c8[_0x5d0dd7(0xef)]),stripPendingIds(_0x1664c8);const _0x16afae=await _0x5bb4d8['journey']['create'](_0x1664c8),_0x252f50=_0x16afae['id'],_0x39d494=new Map();for(const _0x2b4d49 of _0x16afae[_0x5d0dd7(0xef)][_0x5d0dd7(0x14d)]){_0x39d494[_0x5d0dd7(0xe7)](_0x2b4d49['name'][_0x5d0dd7(0x120)](),_0x2b4d49['id']);}for(const [_0x29fb6a,{definition:_0x44c855}]of _0x5903b1){const _0x4f99ee=generateDeterministicJourneySegmentName(_0x4fd0fe['yamlConfig'][_0x5d0dd7(0xa6)],_0x29fb6a);_0x4e6500[_0x5d0dd7(0xfd)]?.({'type':_0x5d0dd7(0xd9),'journeyName':_0x4fd0fe['yamlConfig']['name'],'segmentName':_0x29fb6a});const _0x16bc8e=createSegmentIdResolver(_0x356a48[_0x5d0dd7(0x11c)],_0x29fb6a),_0x2d1fc5=await resolveRuleSegmentIds(_0x44c855[_0x5d0dd7(0x108)],_0x16bc8e),_0x3d69cd=await _0x5bb4d8[_0x5d0dd7(0x14b)]['createJourneySegment']({'name':_0x4f99ee,'description':_0x44c855[_0x5d0dd7(0x12f)]||_0x5d0dd7(0x9f)+_0x29fb6a,'journeyId':_0x252f50,'rule':_0x532674(_0x2d1fc5,!![]),'countPopulation':!![],'parentFolderId':_0x872da['effectiveFolderId']||'','audienceId':_0x872da[_0x5d0dd7(0xf2)]});_0x2b6822['set'](_0x29fb6a,_0x3d69cd),_0x356a48[_0x5d0dd7(0x11c)]['set'](_0x29fb6a,_0x3d69cd),_0x4e6500['onProgress']?.({'type':_0x5d0dd7(0x10a),'journeyName':_0x4fd0fe[_0x5d0dd7(0x103)][_0x5d0dd7(0xa6)],'segmentName':_0x29fb6a});}const _0x5d4bb9=new Map();for(const [_0x5b3220,_0x965c2f]of _0x27b92a){_0x4e6500[_0x5d0dd7(0xfd)]?.({'type':_0x5d0dd7(0x148),'journeyName':_0x4fd0fe[_0x5d0dd7(0x103)][_0x5d0dd7(0xa6)],'activationName':_0x5b3220});const _0x51576a=await _0x2b9ee0(_0x965c2f,_0x356a48[_0x5d0dd7(0x106)]),_0x5256b1=await _0x5bb4d8[_0x5d0dd7(0xe6)][_0x5d0dd7(0xd0)](_0x252f50,_0x51576a);_0x5d4bb9['set'](_0x5b3220,_0x5256b1['id']),_0x3aa7be['journeyActivationNameToId'][_0x5d0dd7(0xe7)](_0x5b3220,_0x5256b1['id']),_0x4e6500[_0x5d0dd7(0xfd)]?.({'type':_0x5d0dd7(0x11f),'journeyName':_0x4fd0fe[_0x5d0dd7(0x103)]['name'],'activationName':_0x5b3220});}const _0x4667ab=JSON[_0x5d0dd7(0x87)](JSON[_0x5d0dd7(0xae)](_0x2d8c10));return _0x4667ab['id']=_0x252f50,ensureJourneyDefaults(_0x4667ab[_0x5d0dd7(0xef)]),resolvePendingIdsInRequest(_0x4667ab,_0x2d8c10,_0x39d494,_0x2b6822,_0x5d4bb9,_0x4e6500),await _0x5bb4d8[_0x5d0dd7(0xe6)][_0x5d0dd7(0x8f)](_0x252f50,_0x4667ab),{'action':_0x5d0dd7(0x128),'journeyId':_0x252f50,'embeddedSegmentNameToId':_0x2b6822};}function stripPendingIds(_0x4a1ed2){const _0x5efc8d=a115_0x19deef;for(const _0x2c26fa of _0x4a1ed2[_0x5efc8d(0xef)][_0x5efc8d(0x14d)]||[]){_0x2c26fa['entryCriteria']?.[_0x5efc8d(0x118)]&&isPendingSegmentId(_0x2c26fa[_0x5efc8d(0x145)][_0x5efc8d(0x118)])&&delete _0x2c26fa[_0x5efc8d(0x145)];if(_0x2c26fa[_0x5efc8d(0xcc)])for(const _0x2261d2 of Object[_0x5efc8d(0xc4)](_0x2c26fa[_0x5efc8d(0xcc)])){const _0x554f=_0x2c26fa[_0x5efc8d(0xcc)][_0x2261d2];_0x554f[_0x5efc8d(0x8d)]==='Activation'&&_0x554f[_0x5efc8d(0x94)]&&isPendingActivationId(_0x554f['journeyActivationStepId'])&&(_0x554f[_0x5efc8d(0x94)]='');if(_0x554f[_0x5efc8d(0x8d)]===_0x5efc8d(0x88)&&_0x554f[_0x5efc8d(0xc2)])for(const _0x476676 of _0x554f[_0x5efc8d(0xc2)]){_0x476676['segmentId']&&isPendingSegmentId(_0x476676[_0x5efc8d(0x118)])&&(_0x476676['segmentId']='');}_0x554f[_0x5efc8d(0x8d)]==='WaitStep'&&_0x554f[_0x5efc8d(0x109)]?.[_0x5efc8d(0x118)]&&isPendingSegmentId(_0x554f[_0x5efc8d(0x109)][_0x5efc8d(0x118)])&&(_0x554f[_0x5efc8d(0x109)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x48a9e4,_0x2b3600,_0x4af3ff,_0x1c0b17,_0x4cd473,_0x2969c3){const _0x593523=a115_0x19deef,_0x20e6a6=(_0x5842f8,_0x23c3a1)=>{const _0x515258=a115_0x329b;if(!isPendingSegmentId(_0x5842f8))return _0x5842f8;const _0x3e22c9=extractPendingSegmentName(_0x5842f8),_0x25e1b6=_0x1c0b17[_0x515258(0x124)](_0x3e22c9);return!_0x25e1b6&&_0x2969c3['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x3e22c9+_0x515258(0xf7)+_0x23c3a1),_0x25e1b6;};if(_0x48a9e4[_0x593523(0xef)][_0x593523(0x90)]?.[_0x593523(0x118)]&&isPendingSegmentId(_0x48a9e4[_0x593523(0xef)][_0x593523(0x90)][_0x593523(0x118)])){const _0x42407c=_0x20e6a6(_0x48a9e4[_0x593523(0xef)][_0x593523(0x90)]['segmentId'],_0x593523(0x14f));_0x42407c&&(_0x48a9e4[_0x593523(0xef)][_0x593523(0x90)][_0x593523(0x118)]=_0x42407c);}for(const _0x5d16b1 of _0x48a9e4[_0x593523(0xef)][_0x593523(0x14d)]||[]){const _0x180931=_0x4af3ff[_0x593523(0x124)](_0x5d16b1[_0x593523(0xa6)][_0x593523(0x120)]());_0x180931&&(_0x5d16b1['id']=_0x180931);if(_0x5d16b1[_0x593523(0x145)]?.[_0x593523(0x118)]&&isPendingSegmentId(_0x5d16b1['entryCriteria'][_0x593523(0x118)])){const _0xdf4a9b=_0x20e6a6(_0x5d16b1[_0x593523(0x145)]['segmentId'],_0x593523(0xdc)+_0x5d16b1['name']+_0x593523(0xe0));_0xdf4a9b&&(_0x5d16b1[_0x593523(0x145)][_0x593523(0x118)]=_0xdf4a9b);}if(_0x5d16b1[_0x593523(0x80)])for(const _0x4d746c of _0x5d16b1[_0x593523(0x80)]){if(_0x4d746c['segmentId']&&isPendingSegmentId(_0x4d746c[_0x593523(0x118)])){const _0x3175ba=_0x20e6a6(_0x4d746c[_0x593523(0x118)],_0x593523(0xdc)+_0x5d16b1[_0x593523(0xa6)]+_0x593523(0x127));_0x3175ba&&(_0x4d746c[_0x593523(0x118)]=_0x3175ba);}}if(_0x5d16b1['milestone']?.[_0x593523(0x118)]&&isPendingSegmentId(_0x5d16b1[_0x593523(0x144)][_0x593523(0x118)])){const _0x3ce58a=_0x20e6a6(_0x5d16b1[_0x593523(0x144)][_0x593523(0x118)],'stage\x20\x27'+_0x5d16b1[_0x593523(0xa6)]+_0x593523(0xbf));_0x3ce58a&&(_0x5d16b1[_0x593523(0x144)][_0x593523(0x118)]=_0x3ce58a);}if(_0x5d16b1[_0x593523(0xcc)]){const _0x390165=_0xf6b15d=>_0x2b3600[_0x593523(0xef)][_0x593523(0x14d)][_0x593523(0x115)](_0x274f85=>_0x274f85[_0x593523(0xa6)][_0x593523(0x120)]()===_0x5d16b1[_0x593523(0xa6)][_0x593523(0x120)]())?.['steps']?.[_0xf6b15d];for(const _0x4c32bc of Object[_0x593523(0xc4)](_0x5d16b1[_0x593523(0xcc)])){const _0x298d4d=_0x5d16b1[_0x593523(0xcc)][_0x4c32bc],_0x2214e9=_0x390165(_0x4c32bc);if(_0x298d4d['type']==='Activation'&&_0x298d4d['journeyActivationStepId']&&(isPendingActivationId(_0x298d4d['journeyActivationStepId'])||_0x298d4d[_0x593523(0x94)]==='')){if(_0x2214e9?.['journeyActivationStepId']&&isPendingActivationId(_0x2214e9[_0x593523(0x94)])){const _0x3b314a=extractPendingActivationName(_0x2214e9[_0x593523(0x94)]),_0xd9850=_0x4cd473[_0x593523(0x124)](_0x3b314a);_0xd9850&&(_0x298d4d[_0x593523(0x94)]=_0xd9850);}}if(_0x298d4d[_0x593523(0x8d)]===_0x593523(0x88)&&_0x298d4d[_0x593523(0xc2)]&&_0x2214e9?.['branches'])for(let _0x5390e4=0x0;_0x5390e4<_0x298d4d[_0x593523(0xc2)][_0x593523(0x93)];_0x5390e4++){const _0x58114c=_0x298d4d['branches'][_0x5390e4],_0x3f209d=_0x2214e9[_0x593523(0xc2)][_0x5390e4];if(_0x3f209d?.['segmentId']&&isPendingSegmentId(_0x3f209d[_0x593523(0x118)])){const _0x2ce720=_0x20e6a6(_0x3f209d[_0x593523(0x118)],_0x593523(0xdc)+_0x5d16b1['name']+_0x593523(0xbb)+(_0x58114c[_0x593523(0xa6)]||_0x5390e4)+'\x27');_0x2ce720&&(_0x58114c[_0x593523(0x118)]=_0x2ce720);}}if(_0x298d4d[_0x593523(0x8d)]===_0x593523(0x72)&&_0x298d4d[_0x593523(0x109)]?.[_0x593523(0x118)]&&_0x2214e9?.[_0x593523(0x109)]?.[_0x593523(0x118)]&&isPendingSegmentId(_0x2214e9[_0x593523(0x109)]['segmentId'])){const _0x1700fc=_0x20e6a6(_0x2214e9['waitCondition'][_0x593523(0x118)],_0x593523(0xdc)+_0x5d16b1[_0x593523(0xa6)]+_0x593523(0x91));_0x1700fc&&(_0x298d4d[_0x593523(0x109)][_0x593523(0x118)]=_0x1700fc);}}}}}
1
+ const a115_0x27b239=a115_0x5512;(function(_0x193a11,_0xe82978){const _0x267f27=a115_0x5512,_0x51d0fa=_0x193a11();while(!![]){try{const _0x42245f=-parseInt(_0x267f27(0x9b))/0x1+parseInt(_0x267f27(0x157))/0x2*(parseInt(_0x267f27(0x158))/0x3)+-parseInt(_0x267f27(0x159))/0x4+-parseInt(_0x267f27(0x132))/0x5*(parseInt(_0x267f27(0x101))/0x6)+parseInt(_0x267f27(0xb7))/0x7*(parseInt(_0x267f27(0x107))/0x8)+-parseInt(_0x267f27(0xa1))/0x9+parseInt(_0x267f27(0xd1))/0xa;if(_0x42245f===_0xe82978)break;else _0x51d0fa['push'](_0x51d0fa['shift']());}catch(_0x3c05d3){_0x51d0fa['push'](_0x51d0fa['shift']());}}}(a115_0x26ae,0xcd7ff));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a115_0x27b239(0x8b);export const PENDING_ACTIVATION_PREFIX=a115_0x27b239(0xab);export function createPendingSegmentId(_0x56194b){return''+PENDING_SEGMENT_PREFIX+_0x56194b+'__';}export function isPendingSegmentId(_0x3538e9){return _0x3538e9['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x127712){const _0x43cc63=a115_0x27b239;return _0x127712[_0x43cc63(0x105)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x13144d){return''+PENDING_ACTIVATION_PREFIX+_0x13144d+'__';}export function isPendingActivationId(_0x1bf524){const _0x172b0f=a115_0x27b239;return _0x1bf524[_0x172b0f(0xd0)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x19c07d){return _0x19c07d['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x353c80,_0x3ec396){const _0x394977=a115_0x27b239,_0x4d0850=_0x353c80+'::'+(_0x3ec396['trim']()||_0x394977(0x15c)),_0x39eefc=createHash(_0x394977(0x89))[_0x394977(0xf8)](_0x4d0850)[_0x394977(0xf9)]('hex')[_0x394977(0xd3)](0x0,0xc);return _0x394977(0xc5)+_0x39eefc;}export function ensureJourneyDefaults(_0x27c547){const _0xf36df5=a115_0x27b239;!_0x27c547[_0xf36df5(0xec)]&&(_0x27c547[_0xf36df5(0xec)]=''),!_0x27c547['state']&&(_0x27c547[_0xf36df5(0x170)]='draft');}export function resolveTDFolderPath(_0x5d928c,_0x3f4ff2,_0x160cc8){const _0x1c881d=a115_0x27b239;if(!_0x3f4ff2)return _0x5d928c;if(_0x5d928c===_0x160cc8||_0x5d928c[_0x1c881d(0xd0)](_0x160cc8+'/'))return _0x5d928c;return _0x5d928c?_0x160cc8+'/'+_0x5d928c:_0x160cc8;}export function addFoldersToCreate(_0x254df8,_0x5f0532,_0x43d0ba){const _0x4214b8=a115_0x27b239;if(!_0x254df8)return;if(_0x5f0532[_0x4214b8(0xea)](_0x254df8))return;const _0x3495e7=_0x254df8[_0x4214b8(0xee)]('/');let _0x28be2d='';for(const _0x1e11f9 of _0x3495e7){_0x28be2d=_0x28be2d?_0x28be2d+'/'+_0x1e11f9:_0x1e11f9,!_0x5f0532['has'](_0x28be2d)&&_0x43d0ba[_0x4214b8(0xb6)](_0x28be2d);}}import*as a115_0x2a8b6d from'yaml';import{readFileSync}from'fs';function a115_0x5512(_0xcb89b9,_0xedb845){_0xcb89b9=_0xcb89b9-0x87;const _0x26aeaf=a115_0x26ae();let _0x5512d0=_0x26aeaf[_0xcb89b9];return _0x5512d0;}import a115_0x18a336 from'path';import{isJourneyDef,parseYamlString as a115_0xaa80c0,toYamlString as a115_0x42b1a4,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(_0x4fa633){const _0x2e7778=a115_0x27b239;if(Array[_0x2e7778(0xaf)](_0x4fa633))return'['+_0x4fa633[_0x2e7778(0xb5)](_0x39e816=>stableStringify(_0x39e816))[_0x2e7778(0xef)](',')+']';if(_0x4fa633&&typeof _0x4fa633===_0x2e7778(0x10d)){const _0x4b6bb0=_0x4fa633,_0x20910e=Object[_0x2e7778(0xff)](_0x4b6bb0)['sort'](),_0x47a60a=_0x20910e[_0x2e7778(0xb5)](_0x246a1c=>'\x22'+_0x246a1c+'\x22:'+stableStringify(_0x4b6bb0[_0x246a1c]));return'{'+_0x47a60a[_0x2e7778(0xef)](',')+'}';}const _0xc6ff7b=JSON[_0x2e7778(0x110)](_0x4fa633);return _0xc6ff7b===undefined?_0x2e7778(0x12a):_0xc6ff7b;}function activationSignature(_0x3b4655){const _0x2ebbe9=a115_0x27b239,_0x3e669d={'connection':_0x3b4655[_0x2ebbe9(0x16d)],..._0x3b4655[_0x2ebbe9(0x12e)]!==undefined&&{'all_columns':_0x3b4655[_0x2ebbe9(0x12e)]},..._0x3b4655[_0x2ebbe9(0xe7)]!==undefined&&{'columns':_0x3b4655[_0x2ebbe9(0xe7)]},..._0x3b4655[_0x2ebbe9(0xb9)]!==undefined&&{'behavior':_0x3b4655[_0x2ebbe9(0xb9)]},..._0x3b4655[_0x2ebbe9(0x134)]!==undefined&&{'schedule':_0x3b4655[_0x2ebbe9(0x134)]},..._0x3b4655['notification']!==undefined&&{'notification':_0x3b4655[_0x2ebbe9(0x9d)]},..._0x3b4655[_0x2ebbe9(0xf2)]!==undefined&&{'connector_config':_0x3b4655['connector_config']},..._0x3b4655['activation_template_id']!==undefined&&{'activation_template_id':_0x3b4655['activation_template_id']}};return stableStringify(_0x3e669d);}export async function prepareSegmentFiles(_0x16cd70,_0x497944,_0x55363a,_0x5f1f7a,_0x14a834){const _0x5cc8ba=a115_0x27b239,{activationDefToCreateRequest:_0x3df107}=await import(_0x5cc8ba(0xba)),_0x301078=[],_0x19d338=new Set();for(const {yamlConfig:_0x2950dc,folderPath:_0x588280,sourcePath:_0x2b5384}of _0x16cd70){const _0x461448=resolveTDFolderPath(_0x588280,_0x5f1f7a,_0x14a834),_0x2637a9=_0x461448+':'+_0x2950dc[_0x5cc8ba(0x156)],_0x16b5c5=_0x497944[_0x5cc8ba(0x162)]['get'](_0x2637a9),_0x188771=_0x16b5c5?_0x497944['activationsBySegmentId']['get'](_0x16b5c5['id'])||[]:[];addFoldersToCreate(_0x461448,_0x497944[_0x5cc8ba(0xb1)],_0x19d338);const _0x488658=calculateActivationActions(_0x2950dc['activations']||[],_0x188771,_0x497944['idToEmailMap'],_0x497944['connectionIdToNameMap']);for(const _0x782771 of _0x488658){(_0x782771['type']===_0x5cc8ba(0x9e)||_0x782771[_0x5cc8ba(0x117)]==='update')&&_0x782771['yamlActivation']&&(_0x782771[_0x5cc8ba(0xac)]=await _0x3df107(_0x782771[_0x5cc8ba(0xf6)],_0x55363a));}const _0x3fc682=calculateSegmentDiff(_0x2950dc,_0x16b5c5,_0x188771,_0x497944['idToEmailMap'],_0x497944[_0x5cc8ba(0x11c)]);_0x301078[_0x5cc8ba(0x15a)]({'relativePath':_0x2950dc[_0x5cc8ba(0x156)],'absolutePath':_0x2b5384,'yamlConfig':_0x2950dc,'folderPath':_0x461448,'existingSegment':_0x16b5c5,'existingActivations':_0x188771,'isNew':_0x3fc682[_0x5cc8ba(0x12f)],'hasChanges':_0x3fc682[_0x5cc8ba(0xa8)],'diff':_0x3fc682[_0x5cc8ba(0x164)],'activationActions':_0x488658});}return{'segmentFiles':_0x301078,'foldersToCreate':_0x19d338};}export async function prepareJourneyFiles(_0x4bc85f,_0x2e7aa4,_0x5cc6a8,_0x46b970){const _0x35d15c=a115_0x27b239,_0x24a1ea=[],_0x1bb35a=new Set();for(const {yamlConfig:_0x57d786,folderPath:_0x1592cc,sourcePath:_0x228c5e}of _0x4bc85f){const _0x59ac17=resolveTDFolderPath(_0x1592cc,_0x5cc6a8,_0x46b970),_0x5b1172=_0x59ac17+':'+_0x57d786[_0x35d15c(0x156)],_0x1eb133=_0x2e7aa4['journeyBundlesByFolderAndName'][_0x35d15c(0x10f)](_0x5b1172);let _0x353594,_0xd9f41;if(_0x1eb133&&_0x1eb133[_0x35d15c(0x141)]>0x0){const _0x4166dd=buildLocalExpandedRuleMappings(_0x57d786),{createYamlContext:_0x2d6a0c,prefetchJourneySegments:_0xe03799}=createPushYamlContextForBundle(_0x2e7aa4['deps'],_0x2e7aa4[_0x35d15c(0x16c)],_0x2e7aa4[_0x35d15c(0xcb)],_0x4166dd,_0x2e7aa4[_0x35d15c(0xe8)],_0x2e7aa4[_0x35d15c(0x11c)],_0x2e7aa4['activationStepsById'],_0x2e7aa4[_0x35d15c(0x124)]);await _0xe03799(_0x1eb133[_0x35d15c(0xb5)](_0x493e54=>_0x493e54['id']));const _0x4fbb1c=hasMultipleVersions(_0x57d786),_0x34dd0f=async _0x3e4182=>{const _0x143e82=_0x35d15c,_0xc1f7de=_0x2e7aa4[_0x143e82(0x124)]?.[_0x143e82(0x10f)](_0x3e4182);if(_0xc1f7de)return _0xc1f7de;return _0x2e7aa4[_0x143e82(0x148)]({'journeyId':_0x3e4182,'journeyName':_0x57d786[_0x143e82(0x156)],'isMultiVersion':_0x1eb133[_0x143e82(0x141)]>0x1});};if(_0x4fbb1c&&_0x1eb133['length']>0x1){const _0x4a2e92=[];for(const _0x1e3ba9 of _0x1eb133){const _0x1dcb82=_0x1e3ba9[_0x35d15c(0x11b)]||0x1;_0x2e7aa4[_0x35d15c(0x136)]?.[_0x35d15c(0xf8)](_0x35d15c(0xd6)+_0x57d786[_0x35d15c(0x156)]+'\x20v'+_0x1dcb82);const _0x133a6e=await _0x34dd0f(_0x1e3ba9['id']),_0x210ec6=_0x2d6a0c(_0x1e3ba9['id']),_0x43a49f=await journeyResponseToDef(_0x133a6e,_0x210ec6);_0x4a2e92[_0x35d15c(0x15a)]({'item':_0x1e3ba9,'yaml':_0x43a49f});}const _0xe552a8=buildLocalRuleToNameMappingFromJourney(_0x57d786);_0xd9f41=buildMergedJourneyDef(_0x4a2e92,_0xe552a8);const _0xfd6de=Math[_0x35d15c(0x16a)](..._0x4a2e92[_0x35d15c(0xb5)](_0x26e2cf=>_0x26e2cf[_0x35d15c(0x135)][_0x35d15c(0x11b)]||0x0)),_0x553668=_0x1eb133[_0x35d15c(0x12b)](_0x193f10=>(_0x193f10[_0x35d15c(0x11b)]||0x0)===_0xfd6de);_0x553668&&(_0x2e7aa4[_0x35d15c(0x136)]?.[_0x35d15c(0xf8)](_0x35d15c(0xd6)+_0x57d786['name']+'\x20v'+_0xfd6de),_0x353594=await _0x34dd0f(_0x553668['id']));}else{const _0x419d2e=_0x1eb133[_0x1eb133['length']-0x1];_0x2e7aa4['progress']?.[_0x35d15c(0xf8)](_0x35d15c(0xd6)+_0x57d786['name']),_0x353594=await _0x34dd0f(_0x419d2e['id']);const _0x562d70=_0x2d6a0c(_0x419d2e['id']),_0x753572=await journeyResponseToDef(_0x353594,_0x562d70),_0x392272=buildLocalRuleToNameMappingFromJourney(_0x57d786);_0xd9f41=buildMergedJourneyDef([{'item':_0x419d2e,'yaml':_0x753572}],_0x392272);}}addFoldersToCreate(_0x59ac17,_0x2e7aa4['folderPathToId'],_0x1bb35a);const _0x3657e1=calculateJourneyDiff(_0x57d786,_0xd9f41);_0x24a1ea['push']({'relativePath':_0x57d786[_0x35d15c(0x156)],'absolutePath':_0x228c5e,'yamlConfig':_0x57d786,'folderPath':_0x59ac17,'existingJourney':_0x353594,'isNew':_0x3657e1[_0x35d15c(0x12f)],'hasChanges':_0x3657e1[_0x35d15c(0xa8)],'diff':_0x3657e1['diff']});}return{'journeyFiles':_0x24a1ea,'foldersToCreate':_0x1bb35a};}export function calculateActivationActions(_0x34623f,_0x552d03,_0x4cdbd4,_0xc9c77c){const _0x41d838=a115_0x27b239,_0x385615=[],_0x166513=new Map();for(const _0x33c36e of _0x552d03){_0x166513['set'](_0x33c36e['name'],_0x33c36e);}const _0x3c9ee9=new Map();for(const _0x30a911 of _0x34623f){_0x3c9ee9[_0x41d838(0x13c)](_0x30a911[_0x41d838(0x156)],_0x30a911);}for(const _0x1eaea8 of _0x34623f){const _0x2328c7=_0x166513[_0x41d838(0x10f)](_0x1eaea8[_0x41d838(0x156)]);if(!_0x2328c7)_0x385615['push']({'type':_0x41d838(0x9e),'name':_0x1eaea8[_0x41d838(0x156)],'yamlActivation':_0x1eaea8});else{const _0x2949f2=activationResponseToDef(_0x2328c7,_0x4cdbd4,_0xc9c77c),_0xf84410=a115_0x2a8b6d[_0x41d838(0x110)](_0x2949f2),_0x29ef45=a115_0x2a8b6d['stringify'](_0x1eaea8);_0xf84410!==_0x29ef45&&_0x385615[_0x41d838(0x15a)]({'type':_0x41d838(0xf8),'name':_0x1eaea8[_0x41d838(0x156)],'yamlActivation':_0x1eaea8,'existingActivation':_0x2328c7});}}for(const _0x27441d of _0x552d03){!_0x3c9ee9['has'](_0x27441d[_0x41d838(0x156)])&&_0x385615[_0x41d838(0x15a)]({'type':_0x41d838(0x93),'name':_0x27441d[_0x41d838(0x156)],'existingActivation':_0x27441d});}return _0x385615;}export function calculateSegmentDiff(_0x43942e,_0x30b317,_0x2b8ccc,_0x328f8c,_0x3f0428){const _0x17232e=segmentToYamlString(_0x43942e);if(_0x30b317){const _0x3e4dd7=segmentWithActivationsToYaml(_0x30b317,_0x2b8ccc,undefined,_0x328f8c,_0x3f0428),_0x1d94c3=segmentToYamlString(_0x3e4dd7),_0x16d79f=generateDiff(_0x1d94c3,_0x17232e),_0x5c8966=hasChanges(_0x16d79f);return{'isNew':![],'hasChanges':_0x5c8966,'diff':_0x5c8966?formatDiffWithColors(_0x16d79f):undefined};}const _0x122b17=generateDiff('',_0x17232e);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x122b17)};}export function calculateJourneyDiff(_0x3e7792,_0x4431bb){const _0x4f75de=normalizeJourneyDef(_0x3e7792,_0x3e7792),_0x2e093b=a115_0x42b1a4(_0x4f75de);if(_0x4431bb){const _0x3ec9f3=normalizeJourneyDef(_0x4431bb,_0x3e7792),_0x4f3126=a115_0x42b1a4(_0x3ec9f3),_0x21f565=generateDiff(_0x4f3126,_0x2e093b),_0x5da841=hasChanges(_0x21f565);return{'isNew':![],'hasChanges':_0x5da841,'diff':_0x5da841?formatDiffWithColors(_0x21f565):undefined};}const _0x4f311c=generateDiff('',_0x2e093b);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4f311c)};}export function findSegmentsToDelete(_0x5eb420,_0x2f0486,_0x6c9d31,_0x2809fa,_0x2be689){const _0x58fb71=a115_0x27b239,_0x2c74cb=new Set();for(const {yamlConfig:_0x3f541e,folderPath:_0x29ea58}of _0x2f0486){_0x2c74cb[_0x58fb71(0xb6)](_0x29ea58+':'+_0x3f541e[_0x58fb71(0x156)]);}return _0x5eb420[_0x58fb71(0x147)](_0x4cc934=>{const _0x292ed3=_0x58fb71,_0x4fa604=_0x4cc934[_0x292ed3(0x137)]?_0x6c9d31[_0x292ed3(0x10f)](_0x4cc934[_0x292ed3(0x137)][_0x292ed3(0xe3)]())||'':'',_0x1680dd=_0x4fa604+':'+_0x4cc934['name'];if(_0x2c74cb[_0x292ed3(0xea)](_0x1680dd))return![];if(_0x2be689)return _0x4fa604===_0x2809fa||_0x4fa604[_0x292ed3(0xd0)](_0x2809fa+'/');return!![];});}export function findJourneysToDelete(_0x50f8b8,_0x342261,_0x1edf46,_0x3ef935,_0xb57908){const _0x4cbb64=a115_0x27b239,_0x15a302=new Set();for(const {yamlConfig:_0x14abb9,folderPath:_0x108979}of _0x342261){_0x15a302[_0x4cbb64(0xb6)](_0x108979+':'+_0x14abb9['name']);}return _0x50f8b8[_0x4cbb64(0x147)](_0x1ace85=>{const _0x3debbe=_0x4cbb64,_0x4d0164=_0x1ace85[_0x3debbe(0x16b)]?_0x1edf46[_0x3debbe(0x10f)](_0x1ace85[_0x3debbe(0x16b)])||'':'',_0x1bd49b=_0x4d0164+':'+_0x1ace85['journeyBundleName'];if(_0x15a302['has'](_0x1bd49b))return![];if(_0xb57908)return _0x4d0164===_0x3ef935||_0x4d0164[_0x3debbe(0xd0)](_0x3ef935+'/');return!![];});}export function buildSegmentLookupMap(_0x18b5d9,_0x5b9fd9){const _0x1720c8=a115_0x27b239,_0x4103b5=new Map();for(const _0x1d44dd of _0x18b5d9){const _0x5c459f=_0x1d44dd[_0x1720c8(0x137)]?_0x5b9fd9[_0x1720c8(0x10f)](_0x1d44dd[_0x1720c8(0x137)][_0x1720c8(0xe3)]())||'':'',_0x410f5c=_0x5c459f+':'+_0x1d44dd[_0x1720c8(0x156)];_0x4103b5[_0x1720c8(0x13c)](_0x410f5c,_0x1d44dd);}return _0x4103b5;}export function buildSegmentNameToIdMap(_0x4cf7c3){const _0x36e8dc=a115_0x27b239,_0x126f0d=new Map();for(const _0x42c646 of _0x4cf7c3){_0x126f0d['set'](_0x42c646[_0x36e8dc(0x156)],_0x42c646['id']);}return _0x126f0d;}export function buildJourneyBundleLookupMap(_0x191ff2,_0x207ba1){const _0x389be1=a115_0x27b239,_0x31646d=new Map();for(const _0x37282f of _0x191ff2){const _0x2cbffe=_0x37282f['folderId']?_0x207ba1[_0x389be1(0x10f)](_0x37282f['folderId'])||'':'',_0x405a79=_0x2cbffe+':'+_0x37282f[_0x389be1(0x129)];!_0x31646d[_0x389be1(0xea)](_0x405a79)&&_0x31646d[_0x389be1(0x13c)](_0x405a79,[]),_0x31646d['get'](_0x405a79)[_0x389be1(0x15a)](_0x37282f);}for(const _0x2ef670 of _0x31646d[_0x389be1(0x92)]()){_0x2ef670[_0x389be1(0xbb)]((_0x22fbc7,_0x5ef5f0)=>(_0x22fbc7[_0x389be1(0x11b)]||0x0)-(_0x5ef5f0[_0x389be1(0x11b)]||0x0));}return _0x31646d;}export function collectFoldersToCreate(_0x3a1e41,_0x4bdc4b){const _0x399f21=a115_0x27b239,_0xb1ea4d=new Set();for(const _0x5631e7 of _0x3a1e41){if(!_0x5631e7)continue;if(_0x4bdc4b[_0x399f21(0xea)](_0x5631e7))continue;const _0x395480=_0x5631e7[_0x399f21(0xee)]('/');let _0x592baa='';for(const _0x349b0f of _0x395480){_0x592baa=_0x592baa?_0x592baa+'/'+_0x349b0f:_0x349b0f,!_0x4bdc4b[_0x399f21(0xea)](_0x592baa)&&_0xb1ea4d[_0x399f21(0xb6)](_0x592baa);}}return _0xb1ea4d;}export function parseAndClassifyYamlFiles(_0x707c89,_0x3b009a,_0x4c53cf){const _0x460ad6=a115_0x27b239,_0x30bce4=[],_0x2f8291=[];for(const _0x57a97a of _0x707c89){const _0x5b55e6=a115_0x18a336['relative'](_0x3b009a,a115_0x18a336[_0x460ad6(0x8c)](_0x57a97a)),_0xef6e19=_0x5b55e6==='.'?'':_0x5b55e6,_0x180512=readFileSync(_0x57a97a,'utf-8'),_0x518f61=a115_0x2a8b6d[_0x460ad6(0x99)](_0x180512);if(isJourneyDef(_0x518f61)){const _0x20b47a=a115_0xaa80c0(_0x180512);_0x2f8291[_0x460ad6(0x15a)]({'yamlConfig':_0x20b47a,'folderPath':_0xef6e19,'sourcePath':_0x57a97a});}else{if(!_0x4c53cf?.[_0x460ad6(0x115)]){const _0x13e234=parseSegmentYamlFile(_0x180512),_0x5b6cc3=normalizeChildSegmentYaml(_0x13e234);_0x30bce4[_0x460ad6(0x15a)]({'yamlConfig':_0x5b6cc3,'folderPath':_0xef6e19,'sourcePath':_0x57a97a});}}}return{'segments':_0x30bce4,'journeys':_0x2f8291};}function a115_0x26ae(){const _0x6512d7=['entryCriteria','\x27...','activation_creating','Segment\x20not\x20found:\x20','logWarning','SEGMENT_NOT_FOUND','\x27\x20decision\x20point\x20branch\x20\x27','utf-8','toString','entry_criteria','journeyActivationStepId','action','columns','idToEmailMap','all','has','Activation','description','unchanged','split','join','toLowerCase','ACTIVATION_UPDATE_ERROR','connector_config','withProgress','createFolder','decision_point','yamlActivation','rootFolderId','update','digest','journey_creating','\x27\x20milestone','embeddedSegmentNameToId','NOT_FOUND','Created\x20folder\x20\x27','keys','segment_creating','7999638otWnvz','rule','updateActivation','Failed\x20to\x20','replace','embedded_activation_created','124792dYXmok','Deleted\x20segment\x20\x27','onProgress','Entry\x20criteria:\x20','\x27\x20wait\x20condition','WaitStep','object','getJourney','get','stringify','parseDocument','activation_updating','milestone','results','skipSegments','Creating\x20folder\x20\x27','type','folder','goal','\x20journey\x20from\x20file:\x20','versionNumber','connectionIdToNameMap','nameToType','Deleting\x20activation\x20\x27','DecisionPoint','steps','index','Created\x20activation\x20\x27','\x0a\x20\x20','journeyById','Journey\x20\x27','logDeleted','existingActivation','yamlConfig','journeyBundleName','null','find','\x20segment\x20from\x20file:\x20','stages','all_columns','isNew','idToName','activation_updated','5INRGJo','createActivation','schedule','item','progress','segmentFolderId','folder_creating','createJourneySegment','activation_deleted','\x27\x20exit\x20criteria','set','journeys','segmentNameToId','embedded_segment_created','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','length','existingJourney','branches','exitCriterias','deleteActivation','\x27\x20from\x20file:\x20','filter','fetchJourney','Stage\x20\x27','journeyStages','journeyId','segment_updated','journey_updated','createdSegmentId','created','effectiveFolderId','folderPath','existingSegment','message','user','Updated\x20journey\x20\x27','name','105062PuyVKS','51WFvVEV','4230132TSidtC','push','errors','segment','getSegment','journeyActivationNameToId','deleted','logSuccess','parentSegmentFolder','segmentByFolderAndName','./journey-yaml.js','diff','listActivations','resolveSegment','entries','resolveJourneyId','):\x20','max','folderId','parentId','connection','size','data','state','\x27\x20entry\x20criteria','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','sha1','entry','__pending_','dirname','with','activation_deleting','flatMap','segments','activation_created','values','delete','activationActions','updateSegmentById','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context',').\x20','includes','parse','segment_deleted','89929YENWwI','JOURNEY_SYNTAX_ERROR','notification','create','segment_created','activationParams','2635173HQEUYj','attributes','createSegment','valid','folder_created','from','absolutePath','hasChanges','list','activationContext','__pending_act_','validatedRequest','\x20activation\x20\x27','verbose','isArray','journey','folderPathToId','../../utils/async.js','embedded_segment_creating','updated','map','add','574mtcdcF','createdSegmentIds','behavior','./child-segment-yaml.js','sort','segment_deleting','segmentId','Created\x20segment\x20\x27','nameToId','buildUserMaps','segment_updating','INTERNAL','\x27\x20not\x20found\x20in\x20journey\x20\x27','listSegments','journey_entry_criteria_','stage\x20\x27','reduce','relative','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','existingSegments','Name\x20has\x20already\x20been\x20taken','JOURNEY_UPDATE_ERROR','SEGMENT_SYNTAX_ERROR','Activation\x20not\x20found:\x20','startsWith','14431140yBLhXa','relationships','slice','waitCondition','Updating\x20segment\x20\x27','Fetching\x20','activations','ACTIVATION_SYNTAX_ERROR','journey_updating','\x27\x20for\x20'];a115_0x26ae=function(){return _0x6512d7;};return a115_0x26ae();}export function validateParsedFiles(_0x33e978,_0x240e54){const _0x4f9215=a115_0x27b239,_0x245159=[];for(const {yamlConfig:_0x6baceb,sourcePath:_0x3a76c9}of _0x33e978['segments']){const _0x9f2aca=readFileSync(_0x3a76c9,_0x4f9215(0xe2)),_0x312284=a115_0x2a8b6d[_0x4f9215(0x111)](_0x9f2aca),_0x310588=validateSegmentDef(_0x6baceb,{'source':_0x9f2aca,'document':_0x312284});if(!_0x310588['valid']){const _0x529445=a115_0x18a336[_0x4f9215(0xc8)](_0x240e54,_0x3a76c9);_0x245159['push']({'filePath':_0x529445,'source':_0x9f2aca,'result':_0x310588,'isJourney':![]});}}for(const {yamlConfig:_0x20c21c,sourcePath:_0x4530e6}of _0x33e978[_0x4f9215(0x13d)]){const _0x345b22=readFileSync(_0x4530e6,_0x4f9215(0xe2)),_0x39bac6=a115_0x2a8b6d[_0x4f9215(0x111)](_0x345b22),_0x12ab2d=validateJourneyDef(_0x20c21c,{'source':_0x345b22,'document':_0x39bac6});if(!_0x12ab2d[_0x4f9215(0xa4)]){const _0x227003=a115_0x18a336[_0x4f9215(0xc8)](_0x240e54,_0x4530e6);_0x245159[_0x4f9215(0x15a)]({'filePath':_0x227003,'source':_0x345b22,'result':_0x12ab2d,'isJourney':!![]});}}return _0x245159;}export function formatValidationErrors(_0x8c881d){const _0x3558e5=a115_0x27b239,_0x461d75=[];for(const {filePath:_0x4583ac,source:_0x46e1f0,result:_0x30730b,isJourney:_0xbed1a6}of _0x8c881d){const _0x90d3e1=_0xbed1a6?_0x3558e5(0xb0):_0x3558e5(0x15c);_0x461d75[_0x3558e5(0x15a)]('\x0a'+_0x4583ac+'\x20('+_0x90d3e1+_0x3558e5(0x169)+_0x30730b[_0x3558e5(0x15b)][_0x3558e5(0x141)]+'\x20error(s)'),_0x461d75[_0x3558e5(0x15a)](formatValidationResult(_0x30730b,_0x46e1f0,_0x4583ac));}return _0x461d75[_0x3558e5(0xef)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x45954e){const _0x51ecb2=a115_0x27b239,_0x53201d=new Set(),_0x2ef4e8=new Map(),_0x52ec95=collectSegmentUsageCounts(_0x45954e);if(_0x45954e['segments'])for(const [_0x41c6dc,_0x9b01a3]of Object[_0x51ecb2(0x167)](_0x45954e[_0x51ecb2(0x90)])){_0x53201d[_0x51ecb2(0xb6)](_0x41c6dc);if(_0x9b01a3['rule']){const _0x2e35fd=yamlRuleToApi(_0x9b01a3[_0x51ecb2(0x102)]),_0x25004e=apiRuleToYaml(_0x2e35fd);_0x2ef4e8['set'](_0x41c6dc,_0x25004e);}}const _0x299552=new Map();let _0x274a1b=0x0;for(const [_0x39fa29,_0x209418]of _0x2ef4e8){const _0x2a0b6d=serializeExpandedRule(_0x209418,_0x2ef4e8),_0x3d60a6=_0x299552[_0x51ecb2(0x10f)](_0x2a0b6d)||[];_0x3d60a6[_0x51ecb2(0x15a)]({'name':_0x39fa29,'index':_0x274a1b}),_0x299552[_0x51ecb2(0x13c)](_0x2a0b6d,_0x3d60a6),_0x274a1b++;}const _0x3f3229=new Map();for(const [_0x36a27e,_0x174a5b]of _0x299552){const _0x418e50=_0x174a5b[_0x51ecb2(0xd3)]()[_0x51ecb2(0xbb)]((_0x374002,_0x258260)=>{const _0x524780=_0x51ecb2,_0x20a7fc=_0x52ec95[_0x524780(0x10f)](_0x374002[_0x524780(0x156)])||0x0,_0x488b1e=_0x52ec95[_0x524780(0x10f)](_0x258260[_0x524780(0x156)])||0x0;if(_0x20a7fc!==_0x488b1e)return _0x488b1e-_0x20a7fc;return _0x374002['index']-_0x258260[_0x524780(0x121)];})[_0x51ecb2(0xb5)](_0x560519=>_0x560519[_0x51ecb2(0x156)]),_0x3db1a5=[];for(const _0x42bfcc of _0x418e50){const _0x5f278e=_0x52ec95[_0x51ecb2(0x10f)](_0x42bfcc)||0x0,_0x49ad2c=Math[_0x51ecb2(0x16a)](_0x5f278e,0x1);for(let _0x2194d9=0x0;_0x2194d9<_0x49ad2c;_0x2194d9++){_0x3db1a5[_0x51ecb2(0x15a)](_0x42bfcc);}}_0x3f3229['set'](_0x36a27e,_0x3db1a5);}return{'existingLocalSegmentNames':_0x53201d,'localSegmentRules':_0x2ef4e8,'localExpandedRuleToNames':_0x3f3229};}async function buildServerSegmentRuleMap(_0x2ffbea,_0x9e4b7b,_0x5ce5eb,_0xa1d80c){const _0x30e985=new Map(),_0x2dbf3e=new Set(),_0x28dda7=async _0x4edf32=>{const _0x46c548=a115_0x5512;if(_0x2dbf3e[_0x46c548(0xea)](_0x4edf32))return;_0x2dbf3e['add'](_0x4edf32);let _0x11f64f=_0x5ce5eb['find'](_0x5d939b=>_0x5d939b['id']===_0x4edf32);if(!_0x11f64f)try{_0x11f64f=await _0x2ffbea[_0x46c548(0x15c)][_0x46c548(0x15d)](_0x9e4b7b,_0x4edf32);}catch{return;}if(!_0x11f64f?.['rule'])return;const _0x2bc6aa=apiRuleToYaml(_0x11f64f[_0x46c548(0x102)]);_0x30e985[_0x46c548(0x13c)](_0x4edf32,_0x2bc6aa);const _0x5a18c1=collectSegmentRefsFromRule(_0x2bc6aa);for(const _0xb8efe2 of _0x5a18c1){await _0x28dda7(_0xb8efe2);}};for(const _0x57f02b of _0xa1d80c){await _0x28dda7(_0x57f02b);}return _0x30e985;}export function createSegmentIdResolver(_0x5e5fc0,_0x1de982){return async _0x11bb9a=>{const _0x6aef43=a115_0x5512,_0x175c02=_0x5e5fc0['get'](_0x11bb9a);if(!_0x175c02)throw new SDKError(ErrorCode[_0x6aef43(0xe0)],_0x6aef43(0xde)+_0x11bb9a+_0x6aef43(0xc9)+_0x1de982+'\x27)');return _0x175c02;};}export function extractRootFolderId(_0x326dd0){const _0x2ddb87=a115_0x27b239;return _0x326dd0[_0x2ddb87(0xd2)]?.[_0x2ddb87(0x161)]?.[_0x2ddb87(0x16f)]?.['id']||_0x326dd0[_0x2ddb87(0xd2)]?.['parentFolder']?.['data']?.['id'];}export function buildConnectionMaps(_0x2d5a1b){const _0x4b71a2=a115_0x27b239,_0x4cd298=new Map(),_0x3751ff=new Map(),_0x298971=new Map();for(const _0x54aaf8 of _0x2d5a1b){_0x4cd298['set'](_0x54aaf8[_0x4b71a2(0x156)],parseInt(_0x54aaf8['id'],0xa)),_0x3751ff[_0x4b71a2(0x13c)](_0x54aaf8['id'],_0x54aaf8[_0x4b71a2(0x156)]),_0x298971[_0x4b71a2(0x13c)](_0x54aaf8[_0x4b71a2(0x156)],_0x54aaf8[_0x4b71a2(0x117)]);}return{'nameToId':_0x4cd298,'idToName':_0x3751ff,'nameToType':_0x298971};}export function calculatePushStats(_0x3f1007,_0x1ce945,_0x3667fb,_0x39b44c,_0x1a5562,_0x5ec82d,_0x234109){const _0x155cc6=a115_0x27b239,_0x34e3dc=_0x3f1007[_0x155cc6(0x147)](_0x10aa08=>_0x10aa08[_0x155cc6(0x12f)]),_0x155e1c=_0x3f1007['filter'](_0x3f8b94=>!_0x3f8b94[_0x155cc6(0x12f)]&&_0x3f8b94[_0x155cc6(0xa8)]),_0x234646=_0x3f1007[_0x155cc6(0x147)](_0x123fad=>!_0x123fad[_0x155cc6(0x12f)]&&!_0x123fad[_0x155cc6(0xa8)]),_0x258388=_0x5ec82d?_0x39b44c:[],_0x3fb152=_0x1ce945[_0x155cc6(0x147)](_0x10e47d=>_0x10e47d['isNew']),_0x569f85=_0x1ce945[_0x155cc6(0x147)](_0xf6565=>!_0xf6565[_0x155cc6(0x12f)]&&_0xf6565[_0x155cc6(0xa8)]),_0x578dbf=_0x1ce945[_0x155cc6(0x147)](_0x503d90=>!_0x503d90[_0x155cc6(0x12f)]&&!_0x503d90[_0x155cc6(0xa8)]),_0x5baa58=_0x5ec82d?_0x1a5562:[],_0x51135a=_0x3f1007[_0x155cc6(0x8f)](_0x468710=>_0x468710[_0x155cc6(0x94)]),_0x10a538=_0x51135a['filter'](_0x5d4e45=>_0x5d4e45[_0x155cc6(0x117)]===_0x155cc6(0x9e)),_0x9d4928=_0x51135a[_0x155cc6(0x147)](_0x11f53e=>_0x11f53e[_0x155cc6(0x117)]===_0x155cc6(0xf8)),_0x551b39=_0x51135a[_0x155cc6(0x147)](_0x37a695=>_0x37a695['type']===_0x155cc6(0x93)),_0x564093=Array[_0x155cc6(0xa6)](_0x3667fb)['sort'](),_0x314faa=_0x234109?![]:_0x34e3dc[_0x155cc6(0x141)]>0x0||_0x155e1c[_0x155cc6(0x141)]>0x0||_0x258388[_0x155cc6(0x141)]>0x0,_0x146cb9=_0x3fb152[_0x155cc6(0x141)]>0x0||_0x569f85[_0x155cc6(0x141)]>0x0||_0x5baa58[_0x155cc6(0x141)]>0x0,_0x5a62a7=_0x234109?![]:_0x51135a[_0x155cc6(0x141)]>0x0,_0x3a197b=_0x564093['length']>0x0;return{'segments':{'new':_0x34e3dc,'changed':_0x155e1c,'unchanged':_0x234646,'toDelete':_0x258388},'journeys':{'new':_0x3fb152,'changed':_0x569f85,'unchanged':_0x578dbf,'toDelete':_0x5baa58},'activations':{'all':_0x51135a,'toCreate':_0x10a538,'toUpdate':_0x9d4928,'toDelete':_0x551b39},'folders':{'toCreate':_0x564093},'counts':{'segments':{'new':_0x34e3dc[_0x155cc6(0x141)],'changed':_0x155e1c['length'],'unchanged':_0x234646['length'],'toDelete':_0x258388['length']},'journeys':{'new':_0x3fb152[_0x155cc6(0x141)],'changed':_0x569f85[_0x155cc6(0x141)],'unchanged':_0x578dbf[_0x155cc6(0x141)],'toDelete':_0x5baa58[_0x155cc6(0x141)]},'activations':{'create':_0x10a538[_0x155cc6(0x141)],'update':_0x9d4928[_0x155cc6(0x141)],'delete':_0x551b39[_0x155cc6(0x141)]},'folders':_0x564093['length']},'hasChanges':_0x314faa||_0x146cb9||_0x5a62a7||_0x3a197b};}export async function buildPushExecutionContext(_0x139c94,_0x1ddb0b,_0xe18f2c,_0x51a9bc,_0x543220,_0x1fae65){const _0xa4b4cb=a115_0x27b239,_0x36597b=extractRootFolderId(_0xe18f2c),{pathToId:_0x1c1387,idToPath:_0x642e46}=buildFolderMaps(_0x543220),_0x2d522d=buildSegmentNameToIdMap(_0x51a9bc),_0x555c1e=new Map(),{batchAsync:_0x990b89}=await import(_0xa4b4cb(0xb2)),[_0x1c3603,_0x6e5b6b]=await Promise['all']([_0x139c94[_0xa4b4cb(0x154)][_0xa4b4cb(0xc0)](),_0x139c94[_0xa4b4cb(0x16d)][_0xa4b4cb(0xa9)](),((async()=>{const _0x36f765=_0xa4b4cb;!_0x1fae65&&_0x51a9bc[_0x36f765(0x141)]>0x0&&await _0x990b89(_0x51a9bc,async _0x20ebca=>{const _0x40fa2a=_0x36f765,_0x2bf7b3=await _0x139c94[_0x40fa2a(0x15c)][_0x40fa2a(0x165)](_0x1ddb0b,_0x20ebca['id']);_0x555c1e[_0x40fa2a(0x13c)](_0x20ebca['id'],_0x2bf7b3);});})())]),{emailToId:_0x3d8f5f,idToEmail:_0x26b97e}=_0x1c3603,_0xfe7186=buildConnectionMaps(_0x6e5b6b);return{'rootFolderId':_0x36597b,'folderPathToId':_0x1c1387,'folderIdToPath':_0x642e46,'segmentNameToId':_0x2d522d,'activationsBySegmentId':_0x555c1e,'emailToIdMap':_0x3d8f5f,'idToEmailMap':_0x26b97e,'connectionNameToIdMap':_0xfe7186[_0xa4b4cb(0xbf)],'connectionIdToNameMap':_0xfe7186[_0xa4b4cb(0x130)],'connectionNameToTypeMap':_0xfe7186[_0xa4b4cb(0x11d)]};}export function createPushYamlContextForBundle(_0x111044,_0x57d4a7,_0x2e30ed,_0x31a896,_0x11bddc,_0xac472d,_0x15c226,_0x394e2e){const {existingLocalSegmentNames:_0x4bb17d,localExpandedRuleToNames:_0x19d1d7}=_0x31a896,_0x467ff5=new Set(),_0x2e72bf=new Map(),_0x2242e0=new Map(),_0x11afc7=new Map(),_0x553aa1=createJumpTargetCache(),_0x3f87b4=new Map(),_0x20b15e=new Map(),_0x206981=new Set();let _0x1306fd;const _0x758f24=_0x4ba3b8=>{const _0x5d7f19={'resolveSegment':async _0x487c85=>{const _0x5f349c=a115_0x5512,_0x3b79f3=_0x11afc7['get'](_0x487c85);if(_0x3b79f3!==undefined)return{'name':_0x3b79f3,'isJourneyLocal':!![]};try{let _0x1e72ea=_0x2e30ed[_0x5f349c(0x12b)](_0xa9ef7a=>_0xa9ef7a['id']===_0x487c85);!_0x1e72ea&&(_0x1e72ea=await _0x111044[_0x5f349c(0x15c)][_0x5f349c(0x15d)](_0x57d4a7,_0x487c85));const _0x4e4b73=generateJourneyLocalName(_0x1e72ea['name']),_0x187fbd=_0x1e72ea['kind']===SEGMENT_KIND_JOURNEY&&_0x4e4b73!==undefined;let _0x29c624=_0x1e72ea['name'],_0x3badb7;if(_0x187fbd&&_0x1e72ea[_0x5f349c(0x102)]){const _0x4732f3=apiRuleToYaml(_0x1e72ea[_0x5f349c(0x102)]);_0x20b15e['set'](_0x487c85,_0x4732f3);const _0x100a50=async _0x3c6cf2=>{const _0x11f6e4=_0x5f349c,_0x15e7a2=collectSegmentRefsFromRule(_0x3c6cf2);for(const _0x4cd4eb of _0x15e7a2){if(!_0x20b15e[_0x11f6e4(0xea)](_0x4cd4eb))try{const _0x2788ad=await _0x111044['segment'][_0x11f6e4(0x15d)](_0x57d4a7,_0x4cd4eb);if(_0x2788ad?.[_0x11f6e4(0x102)]){const _0xdeaea3=apiRuleToYaml(_0x2788ad[_0x11f6e4(0x102)]);_0x20b15e[_0x11f6e4(0x13c)](_0x4cd4eb,_0xdeaea3),await _0x100a50(_0xdeaea3);}}catch{}}};await _0x100a50(_0x4732f3);const _0x1914e4=serializeExpandedRule(_0x4732f3,_0x20b15e),_0x3d46ca=_0x19d1d7['get'](_0x1914e4);if(_0x3d46ca&&_0x3d46ca[_0x5f349c(0x141)]>0x0){const _0x324172=_0x2e72bf[_0x5f349c(0x10f)](_0x1914e4)||0x0,_0x20ed3c=_0x3d46ca[_0x324172]||_0x3d46ca[_0x3d46ca[_0x5f349c(0x141)]-0x1];_0x2e72bf[_0x5f349c(0x13c)](_0x1914e4,_0x324172+0x1),_0x29c624=_0x20ed3c,_0x467ff5[_0x5f349c(0xb6)](_0x29c624),_0x11afc7[_0x5f349c(0x13c)](_0x487c85,_0x29c624);const _0x337caa=await resolveRuleSegmentRefs(_0x4732f3,async _0x58ef1f=>{const _0x3453bf=_0x5f349c,_0x14a438=_0x11afc7['get'](_0x58ef1f);if(_0x14a438)return _0x14a438;const _0x2f2312=await _0x1306fd[_0x3453bf(0x166)](_0x58ef1f);return _0x2f2312['name'];});_0x3badb7={'description':_0x1e72ea[_0x5f349c(0xec)],'rule':_0x337caa};}else{const _0x5c598d=_0x3f87b4[_0x5f349c(0x10f)](_0x1914e4);if(_0x5c598d)_0x29c624=_0x5c598d,_0x11afc7[_0x5f349c(0x13c)](_0x487c85,_0x29c624);else{if(_0x4e4b73){let _0x99029f=_0x4e4b73,_0x49be31=0x2;while(_0x467ff5[_0x5f349c(0xea)](_0x99029f)||_0x4bb17d[_0x5f349c(0xea)](_0x99029f)){_0x99029f=_0x4e4b73+'_'+_0x49be31,_0x49be31++;}_0x467ff5[_0x5f349c(0xb6)](_0x99029f),_0x29c624=_0x99029f;}_0x11afc7['set'](_0x487c85,_0x29c624),_0x3f87b4[_0x5f349c(0x13c)](_0x1914e4,_0x29c624);const _0x397c44=await resolveRuleSegmentRefs(_0x4732f3,async _0x3ae74f=>{const _0x543fe3=_0x5f349c,_0x21cf09=_0x11afc7[_0x543fe3(0x10f)](_0x3ae74f);if(_0x21cf09)return _0x21cf09;const _0x18637a=await _0x1306fd[_0x543fe3(0x166)](_0x3ae74f);return _0x18637a[_0x543fe3(0x156)];});_0x3badb7={'description':_0x1e72ea[_0x5f349c(0xec)],'rule':_0x397c44};}}}return{'name':_0x29c624,'isJourneyLocal':_0x187fbd,'definition':_0x3badb7};}catch{return{'name':_0x487c85,'isJourneyLocal':![]};}},'resolveActivation':async _0x4dada5=>{const _0x35d1f6=a115_0x5512,_0x146c66=_0x2242e0[_0x35d1f6(0x10f)](_0x4dada5);if(_0x146c66!==undefined)return{'name':_0x146c66,'isJourneyLocal':!![]};try{let _0x45865b=_0x15c226?.[_0x35d1f6(0x10f)](_0x4dada5);!_0x45865b&&(_0x45865b=await _0x111044[_0x35d1f6(0xb0)]['getActivation'](_0x4ba3b8,_0x4dada5));const _0x4af03d=_0x45865b['attributes'][_0x35d1f6(0xa0)][_0x35d1f6(0x156)]||_0x4dada5,_0x5944f0=sanitizeYamlKey(_0x4af03d)||'activation_'+_0x4dada5,_0x342df0=_0x5944f0;_0x2242e0[_0x35d1f6(0x13c)](_0x4dada5,_0x342df0);const _0x42801e=journeyActivationStepToYaml(_0x45865b,_0x11bddc,_0xac472d);return{'name':_0x342df0,'isJourneyLocal':!![],'definition':_0x42801e};}catch{return{'name':_0x4dada5,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x48b9ab,_0x3d5958)=>resolveJumpTarget(_0x48b9ab,_0x3d5958,_0x553aa1,async _0x1926bc=>{const _0xe76e3c=a115_0x5512,_0x3647f4=_0x394e2e?.[_0xe76e3c(0x10f)](_0x1926bc);if(_0x3647f4)return _0x3647f4;return _0x111044[_0xe76e3c(0xb0)][_0xe76e3c(0x10e)](_0x1926bc);})};return _0x1306fd=_0x5d7f19,_0x5d7f19;},_0x24dd93=async _0x4f732a=>{const _0x253f45=a115_0x5512,{collectSegmentIdsFromJourneyApi:_0x223aa7}=await import(_0x253f45(0x163)),{batchAsync:_0x4b145f}=await import(_0x253f45(0xb2)),_0x3b616a=new Set();for(const _0xf48aa9 of _0x4f732a){let _0x1b2410=_0x394e2e?.[_0x253f45(0x10f)](_0xf48aa9);!_0x1b2410&&(_0x1b2410=await _0x111044['journey'][_0x253f45(0x10e)](_0xf48aa9));const _0xafec3b=_0x223aa7(_0x1b2410);for(const _0x76a151 of _0xafec3b){_0x3b616a[_0x253f45(0xb6)](_0x76a151);}}let _0x321354=Array[_0x253f45(0xa6)](_0x3b616a);while(_0x321354['length']>0x0){const _0x158c00=_0x321354[_0x253f45(0x147)](_0x5b355e=>!_0x206981['has'](_0x5b355e));if(_0x158c00[_0x253f45(0x141)]===0x0)break;const _0x1aef3a=await _0x4b145f(_0x158c00,async _0x41f468=>{const _0x219c5a=_0x253f45;_0x206981['add'](_0x41f468);let _0x1fcda6=_0x2e30ed[_0x219c5a(0x12b)](_0x2b7f5a=>_0x2b7f5a['id']===_0x41f468);if(!_0x1fcda6)try{_0x1fcda6=await _0x111044[_0x219c5a(0x15c)][_0x219c5a(0x15d)](_0x57d4a7,_0x41f468);}catch{return null;}return{'segmentId':_0x41f468,'segment':_0x1fcda6};},0xa),_0x353ad6=new Set();for(const _0x12379a of _0x1aef3a){if(!_0x12379a?.[_0x253f45(0x15c)]?.[_0x253f45(0x102)])continue;const _0x298be8=apiRuleToYaml(_0x12379a[_0x253f45(0x15c)][_0x253f45(0x102)]);_0x20b15e[_0x253f45(0x13c)](_0x12379a[_0x253f45(0xbd)],_0x298be8);const _0x161a42=collectSegmentRefsFromRule(_0x298be8);for(const _0x376450 of _0x161a42){!_0x206981[_0x253f45(0xea)](_0x376450)&&_0x353ad6[_0x253f45(0xb6)](_0x376450);}}_0x321354=Array[_0x253f45(0xa6)](_0x353ad6);}};return{'createYamlContext':_0x758f24,'prefetchJourneySegments':_0x24dd93};}export async function executePushSegments(_0x1c4915,_0x347e6a,_0x199a92,_0x56081e,_0x4524ef){const _0x223f38=a115_0x27b239,{segmentDefToCreateRequest:_0x5c509e,segmentDefToUpdateRequest:_0x347fd9}=await import(_0x223f38(0xba)),_0x51ef68=_0x199a92[_0x223f38(0xb1)],_0x27af77=0x5,_0x8059b1=async _0x1701cd=>{const _0x1774a2=_0x223f38,_0x2fd403=_0x1701cd[_0x1774a2(0x151)]?_0x51ef68['get'](_0x1701cd[_0x1774a2(0x151)]):undefined;let _0x4cdaf4;const _0x49fc31={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x1701cd['isNew']){_0x4524ef['onProgress']?.({'type':_0x1774a2(0x100),'name':_0x1701cd[_0x1774a2(0x128)]['name']});const _0x5dedac=_0x5c509e(_0x1701cd[_0x1774a2(0x128)],_0x2fd403),_0xe70854=await _0x4524ef[_0x1774a2(0xf3)]('Creating\x20segment\x20\x27'+_0x1701cd[_0x1774a2(0x128)]['name']+'\x27...',()=>_0x1c4915[_0x1774a2(0x15c)][_0x1774a2(0xa3)](_0x56081e[_0x1774a2(0x16c)],_0x5dedac));_0x4cdaf4=_0xe70854[_0x1774a2(0x16f)]['id'],_0x49fc31['createdSegmentId']={'name':_0x1701cd['yamlConfig'][_0x1774a2(0x156)],'id':_0x4cdaf4},_0x4524ef[_0x1774a2(0x109)]?.({'type':_0x1774a2(0x9f),'name':_0x1701cd[_0x1774a2(0x128)][_0x1774a2(0x156)],'segmentId':_0x4cdaf4}),_0x4524ef['logSuccess']?.(_0x1774a2(0xbe)+_0x1701cd['yamlConfig'][_0x1774a2(0x156)]+'\x27'),_0x49fc31[_0x1774a2(0x14f)]=0x1;}else{if(_0x1701cd[_0x1774a2(0xa8)]){_0x4524ef[_0x1774a2(0x109)]?.({'type':_0x1774a2(0xc1),'name':_0x1701cd[_0x1774a2(0x128)][_0x1774a2(0x156)]});const _0x338116=_0x347fd9(_0x1701cd[_0x1774a2(0x128)]);_0x2fd403!==_0x1701cd[_0x1774a2(0x152)]?.['segmentFolderId']&&(_0x338116[_0x1774a2(0x137)]=_0x2fd403?parseInt(_0x2fd403,0xa):undefined),await _0x4524ef[_0x1774a2(0xf3)](_0x1774a2(0xd5)+_0x1701cd['yamlConfig']['name']+_0x1774a2(0xdc),()=>_0x1c4915[_0x1774a2(0x15c)][_0x1774a2(0x95)](_0x56081e[_0x1774a2(0x16c)],_0x1701cd[_0x1774a2(0x152)]['id'],_0x338116)),_0x4cdaf4=_0x1701cd[_0x1774a2(0x152)]['id'],_0x4524ef['onProgress']?.({'type':_0x1774a2(0x14c),'name':_0x1701cd['yamlConfig']['name']}),_0x4524ef['logSuccess']?.('Updated\x20segment\x20\x27'+_0x1701cd[_0x1774a2(0x128)]['name']+'\x27'),_0x49fc31[_0x1774a2(0xb4)]=0x1;}else _0x4cdaf4=_0x1701cd[_0x1774a2(0x152)]['id'];}}catch(_0x32c294){const _0x555e52=isHttp400Error(_0x32c294),_0x4916f6=_0x555e52?ErrorCode[_0x1774a2(0xce)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4e5bbf=getErrorMessage(_0x32c294);throw new SDKError(_0x4916f6,_0x1774a2(0x104)+(_0x1701cd[_0x1774a2(0x12f)]?_0x1774a2(0x9e):_0x1774a2(0xf8))+_0x1774a2(0x12c)+_0x1701cd[_0x1774a2(0xa7)]+_0x1774a2(0x123)+_0x4e5bbf,_0x32c294);}try{const _0x5c9613=await syncActivationsForSegment(_0x1c4915,_0x56081e['parentId'],_0x4cdaf4,_0x1701cd[_0x1774a2(0x128)]['name'],_0x1701cd[_0x1774a2(0x94)],_0x4524ef,_0x1701cd[_0x1774a2(0xa7)]);_0x49fc31[_0x1774a2(0xd7)]=_0x5c9613;}catch(_0x2193e6){if(_0x2193e6 instanceof SDKError)throw _0x2193e6;throw new SDKError(ErrorCode[_0x1774a2(0xf1)],_0x1774a2(0x140)+_0x1701cd['yamlConfig'][_0x1774a2(0x156)]+_0x1774a2(0x146)+_0x1701cd[_0x1774a2(0xa7)]+'\x0a\x20\x20'+getErrorMessage(_0x2193e6),_0x2193e6);}return _0x49fc31;},_0x13e251=await batchAsync(_0x347e6a,_0x8059b1,_0x27af77),_0x33c558={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5300a9 of _0x13e251){_0x33c558[_0x223f38(0x14f)]+=_0x5300a9['created'],_0x33c558['updated']+=_0x5300a9['updated'],_0x5300a9[_0x223f38(0x14e)]&&_0x33c558[_0x223f38(0xb8)][_0x223f38(0x13c)](_0x5300a9[_0x223f38(0x14e)][_0x223f38(0x156)],_0x5300a9[_0x223f38(0x14e)]['id']),_0x33c558[_0x223f38(0xd7)][_0x223f38(0x14f)]+=_0x5300a9['activations'][_0x223f38(0x14f)],_0x33c558[_0x223f38(0xd7)][_0x223f38(0xb4)]+=_0x5300a9[_0x223f38(0xd7)][_0x223f38(0xb4)],_0x33c558[_0x223f38(0xd7)][_0x223f38(0x15f)]+=_0x5300a9['activations']['deleted'];}return _0x33c558;}async function syncActivationsForSegment(_0x423aa4,_0x3d7703,_0x2ff489,_0x379c80,_0x36e4f5,_0x11d008,_0x1d268c){const _0x58cd30=a115_0x27b239,_0xbe7127={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4a75b8 of _0x36e4f5){try{if(_0x4a75b8[_0x58cd30(0x117)]==='create'&&_0x4a75b8['validatedRequest'])_0x11d008[_0x58cd30(0x109)]?.({'type':_0x58cd30(0xdd),'segmentName':_0x379c80,'activationName':_0x4a75b8['name']}),await _0x11d008[_0x58cd30(0xf3)]('Creating\x20activation\x20\x27'+_0x4a75b8[_0x58cd30(0x156)]+'\x27...',()=>_0x423aa4[_0x58cd30(0x15c)][_0x58cd30(0x133)](_0x3d7703,_0x2ff489,_0x4a75b8[_0x58cd30(0xac)])),_0x11d008['onProgress']?.({'type':_0x58cd30(0x91),'segmentName':_0x379c80,'activationName':_0x4a75b8['name']}),_0x11d008[_0x58cd30(0x160)]?.(_0x58cd30(0x122)+_0x4a75b8[_0x58cd30(0x156)]+'\x27'),_0xbe7127['created']++;else{if(_0x4a75b8[_0x58cd30(0x117)]===_0x58cd30(0xf8)&&_0x4a75b8[_0x58cd30(0xac)]&&_0x4a75b8[_0x58cd30(0x127)])_0x11d008['onProgress']?.({'type':_0x58cd30(0x112),'segmentName':_0x379c80,'activationName':_0x4a75b8[_0x58cd30(0x156)]}),await _0x11d008['withProgress']('Updating\x20activation\x20\x27'+_0x4a75b8[_0x58cd30(0x156)]+_0x58cd30(0xdc),()=>_0x423aa4[_0x58cd30(0x15c)][_0x58cd30(0x103)](_0x3d7703,_0x2ff489,_0x4a75b8[_0x58cd30(0x127)]['id'],_0x4a75b8[_0x58cd30(0xac)])),_0x11d008['onProgress']?.({'type':_0x58cd30(0x131),'segmentName':_0x379c80,'activationName':_0x4a75b8[_0x58cd30(0x156)]}),_0x11d008['logSuccess']?.('Updated\x20activation\x20\x27'+_0x4a75b8[_0x58cd30(0x156)]+'\x27'),_0xbe7127[_0x58cd30(0xb4)]++;else _0x4a75b8['type']==='delete'&&_0x4a75b8[_0x58cd30(0x127)]&&(_0x11d008[_0x58cd30(0x109)]?.({'type':_0x58cd30(0x8e),'segmentName':_0x379c80,'activationName':_0x4a75b8[_0x58cd30(0x156)]}),await _0x11d008[_0x58cd30(0xf3)](_0x58cd30(0x11e)+_0x4a75b8[_0x58cd30(0x156)]+_0x58cd30(0xdc),()=>_0x423aa4[_0x58cd30(0x15c)][_0x58cd30(0x145)](_0x3d7703,_0x2ff489,_0x4a75b8[_0x58cd30(0x127)]['id'])),_0x11d008['onProgress']?.({'type':_0x58cd30(0x13a),'segmentName':_0x379c80,'activationName':_0x4a75b8[_0x58cd30(0x156)]}),_0x11d008['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x4a75b8[_0x58cd30(0x156)]+'\x27'),_0xbe7127['deleted']++);}}catch(_0x416a09){const _0x77ff28=isHttp400Error(_0x416a09),_0x44e4f2=_0x77ff28?ErrorCode[_0x58cd30(0xd8)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2925d7=getErrorMessage(_0x416a09);throw new SDKError(_0x44e4f2,_0x58cd30(0x104)+_0x4a75b8['type']+_0x58cd30(0xad)+_0x4a75b8[_0x58cd30(0x156)]+_0x58cd30(0x146)+_0x1d268c+_0x58cd30(0x123)+_0x2925d7,_0x416a09);}}return _0xbe7127;}export async function executePushFolders(_0x36d02b,_0x4e07e3,_0x104092,_0x4002b4,_0x4d04f6){const _0x2a8a7e=a115_0x27b239,_0x2f4238=new Map(_0x104092);for(const _0x3e085f of _0x4e07e3){const _0x5362ed=_0x3e085f['split']('/'),_0x4d9a7e=_0x5362ed[_0x5362ed[_0x2a8a7e(0x141)]-0x1],_0x566e33=_0x5362ed['slice'](0x0,-0x1)['join']('/'),_0xbd7197=_0x2f4238['get'](_0x566e33);_0x4d04f6[_0x2a8a7e(0x109)]?.({'type':_0x2a8a7e(0x138),'folder':_0x3e085f});const _0x9fd5ad={'name':_0x4d9a7e,'parentFolderId':_0xbd7197},_0x46ed1b=await _0x4d04f6['withProgress'](_0x2a8a7e(0x116)+_0x3e085f+'\x27...',()=>_0x36d02b['segment'][_0x2a8a7e(0xf4)](_0x4002b4[_0x2a8a7e(0x16c)],_0x9fd5ad));_0x2f4238['set'](_0x3e085f,_0x46ed1b[_0x2a8a7e(0x16f)]['id']),_0x4d04f6[_0x2a8a7e(0x109)]?.({'type':_0x2a8a7e(0xa5),'folder':_0x3e085f,'folderId':_0x46ed1b[_0x2a8a7e(0x16f)]['id']}),_0x4d04f6['logInfo']?.(_0x2a8a7e(0xfe)+_0x3e085f+'\x27');}return _0x2f4238;}export async function executePushSegmentDeletions(_0x239467,_0x439cbb,_0x247869){const _0x25f979=a115_0x27b239;if(_0x439cbb['length']===0x0)return 0x0;const {batchAsync:_0x2945e5}=await import(_0x25f979(0xb2)),_0x1a7114=0x5,_0x18a764=await _0x2945e5(_0x439cbb,async _0x2ca781=>{const _0x14d01d=_0x25f979;return _0x247869[_0x14d01d(0x109)]?.({'type':_0x14d01d(0xbc),'name':_0x2ca781[_0x14d01d(0x156)]}),await _0x239467[_0x14d01d(0x15c)]['deleteSegment'](_0x2ca781['id']),_0x247869['onProgress']?.({'type':_0x14d01d(0x9a),'name':_0x2ca781[_0x14d01d(0x156)]}),_0x247869[_0x14d01d(0x126)]?.(_0x14d01d(0x108)+_0x2ca781['name']+'\x27'),0x1;},_0x1a7114);return _0x18a764[_0x25f979(0xc7)]((_0x3fbc0b,_0x257653)=>_0x3fbc0b+_0x257653,0x0);}export async function executePushJourneys(_0x1d6e91,_0x26187e,_0x3dafb3,_0x4486c5,_0x217fd5){const _0x936834=a115_0x27b239,{journeyDefToRequest:_0x42e575}=await import(_0x936834(0x163)),{activationDefToCreateRequest:_0x365542,yamlRuleToApi:_0x402e56,validateSegmentRule:_0x18e5dc}=await import(_0x936834(0xba)),_0x1e55a0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x56f3a2=new Map(_0x3dafb3[_0x936834(0x13e)]),_0x587c55=0x5;for(let _0x164e6c=0x0;_0x164e6c<_0x26187e['length'];_0x164e6c+=_0x587c55){const _0x43508d=_0x26187e[_0x936834(0xd3)](_0x164e6c,_0x164e6c+_0x587c55),_0x1857ef=await Promise[_0x936834(0xe9)](_0x43508d['map'](async _0x9b31c3=>{const _0x3210d6=_0x936834;if(!_0x9b31c3['isNew']&&!_0x9b31c3[_0x3210d6(0xa8)])return{'action':_0x3210d6(0xed),'name':_0x9b31c3[_0x3210d6(0x128)][_0x3210d6(0x156)],'journeyId':_0x9b31c3['existingJourney']?.['id']};const _0x25cbed=_0x9b31c3[_0x3210d6(0x151)]?_0x3dafb3['folderPathToId'][_0x3210d6(0x10f)](_0x9b31c3[_0x3210d6(0x151)]):undefined;_0x217fd5['onProgress']?.({'type':_0x9b31c3['isNew']?_0x3210d6(0xfa):_0x3210d6(0xd9),'name':_0x9b31c3[_0x3210d6(0x128)][_0x3210d6(0x156)]});try{const _0x52ae85=await executeSingleJourneyPush(_0x1d6e91,_0x9b31c3,{..._0x3dafb3,'segmentNameToId':_0x56f3a2},{'parentId':_0x4486c5[_0x3210d6(0x16c)],'rootFolderId':_0x4486c5['rootFolderId'],'folderId':_0x25cbed,'verbose':_0x4486c5[_0x3210d6(0xae)]},_0x217fd5,{'journeyDefToRequest':_0x42e575,'activationDefToCreateRequest':_0x365542,'yamlRuleToApi':_0x402e56,'validateSegmentRule':_0x18e5dc});for(const [_0x50d3a5,_0x227433]of _0x52ae85[_0x3210d6(0xfc)]){_0x56f3a2['set'](_0x50d3a5,_0x227433),_0x1e55a0[_0x3210d6(0xfc)]['set'](_0x50d3a5,_0x227433);}if(_0x52ae85[_0x3210d6(0xe6)]===_0x3210d6(0x14f))_0x217fd5['onProgress']?.({'type':'journey_created','name':_0x9b31c3[_0x3210d6(0x128)][_0x3210d6(0x156)],'journeyId':_0x52ae85[_0x3210d6(0x14b)]}),_0x217fd5['logSuccess']?.('Created\x20journey\x20\x27'+_0x9b31c3[_0x3210d6(0x128)][_0x3210d6(0x156)]+'\x27'),_0x1e55a0[_0x3210d6(0x14f)]++;else _0x52ae85[_0x3210d6(0xe6)]===_0x3210d6(0xb4)&&(_0x217fd5[_0x3210d6(0x109)]?.({'type':_0x3210d6(0x14d),'name':_0x9b31c3[_0x3210d6(0x128)][_0x3210d6(0x156)]}),_0x217fd5[_0x3210d6(0x160)]?.(_0x3210d6(0x155)+_0x9b31c3[_0x3210d6(0x128)]['name']+'\x27'),_0x1e55a0[_0x3210d6(0xb4)]++);return{'action':_0x52ae85['action'],'name':_0x9b31c3['yamlConfig']['name'],'journeyId':_0x52ae85[_0x3210d6(0x14b)]};}catch(_0x5f0fd3){const _0x19ba3e=isHttp400Error(_0x5f0fd3),_0xd3de9d=_0x19ba3e?ErrorCode[_0x3210d6(0x9c)]:ErrorCode[_0x3210d6(0xcd)],_0x1f6998=getErrorMessage(_0x5f0fd3);throw new SDKError(_0xd3de9d,_0x3210d6(0x104)+(_0x9b31c3[_0x3210d6(0x12f)]?_0x3210d6(0x9e):'update')+_0x3210d6(0x11a)+_0x9b31c3[_0x3210d6(0xa7)]+'\x0a\x20\x20'+_0x1f6998,_0x5f0fd3);}}));_0x1e55a0[_0x936834(0x114)]['push'](..._0x1857ef);}return _0x1e55a0;}async function executeSingleJourneyPush(_0x100882,_0x239f9b,_0x3777fe,_0x37e5c3,_0x1c4ff1,_0x4a4a82){const _0x326625=a115_0x27b239,{journeyDefToRequest:_0x2e1a7f,activationDefToCreateRequest:_0x3aad14,yamlRuleToApi:_0x559ac0,validateSegmentRule:_0x4537ad}=_0x4a4a82,_0xfc3a88=new Map(),_0x4c6e71=new Map(),_0x1a5be8=new Map(),_0x4e01c5=new Map(),_0xcafa07=new Map();let _0x45fa4f;const _0x5a2ef3=async()=>{const _0x3ad627=a115_0x5512;if(_0x45fa4f)return;_0x45fa4f=new Map();if(!_0x239f9b[_0x3ad627(0x142)])return;const _0x261323=await _0x100882['journey']['listActivations'](_0x239f9b[_0x3ad627(0x142)]['id']);for(const _0x352b6c of _0x261323){const _0x121c75=journeyActivationStepToYaml(_0x352b6c,_0x3777fe['idToEmailMap'],_0x3777fe[_0x3ad627(0x11c)]),_0x1b941c=activationSignature(_0x121c75);!_0x45fa4f[_0x3ad627(0xea)](_0x1b941c)&&_0x45fa4f[_0x3ad627(0x13c)](_0x1b941c,_0x352b6c['id']),_0x121c75[_0x3ad627(0x156)]&&_0x4c6e71[_0x3ad627(0x13c)](_0x121c75[_0x3ad627(0x156)],_0x352b6c['id']);}};if(_0x239f9b['existingJourney']&&_0x239f9b['yamlConfig'][_0x326625(0x90)]){const _0x30156e=buildLocalExpandedRuleMappings(_0x239f9b[_0x326625(0x128)]),_0x1e960d=_0x30156e['localSegmentRules'];if(_0x1e960d[_0x326625(0x16e)]>0x0){const _0x18d212=new Map();for(const [_0x1ac824,_0x12907]of _0x1e960d){const _0x1982a1=serializeExpandedRule(_0x12907,_0x1e960d);_0x18d212[_0x326625(0x13c)](_0x1ac824,_0x1982a1);}const _0x4e86b5=collectSegmentIdsFromJourneyApi(_0x239f9b[_0x326625(0x142)]);if(_0x4e86b5[_0x326625(0x16e)]>0x0){const _0x425853=await buildServerSegmentRuleMap(_0x100882,_0x37e5c3[_0x326625(0x16c)],_0x3777fe[_0x326625(0xcb)],_0x4e86b5);if(_0x425853[_0x326625(0x16e)]>0x0){const _0x4fa5b2=new Map();for(const [_0x31867f,_0x30b6c1]of _0x425853){const _0x37fb31=serializeExpandedRule(_0x30b6c1,_0x425853);!_0x4fa5b2[_0x326625(0xea)](_0x37fb31)&&_0x4fa5b2[_0x326625(0x13c)](_0x37fb31,_0x31867f);}for(const [_0x1bad4c,_0x4b8af6]of _0x18d212){const _0x365d4a=_0x4fa5b2['get'](_0x4b8af6);_0x365d4a&&(_0xcafa07[_0x326625(0x13c)](_0x1bad4c,_0x365d4a),_0x3777fe[_0x326625(0x13e)]['set'](_0x1bad4c,_0x365d4a));}}}}}const _0x10509d={'resolveSegmentId':async _0x4836a3=>{const _0x5e7657=_0x326625,_0x307bf4=_0x3777fe[_0x5e7657(0x13e)][_0x5e7657(0x10f)](_0x4836a3);if(!_0x307bf4)throw new SDKError(ErrorCode[_0x5e7657(0xe0)],_0x5e7657(0xde)+_0x4836a3+'\x20(referenced\x20in\x20journey\x20'+_0x239f9b['yamlConfig'][_0x5e7657(0x156)]+')');return _0x307bf4;},'resolveEmbeddedSegmentId':async(_0x4fef1e,_0x216b61)=>{const _0x532622=_0x326625,_0x46be88=_0x3777fe[_0x532622(0x13e)][_0x532622(0x10f)](_0x4fef1e);if(_0x46be88)return _0x46be88;const _0x1e174c=_0xcafa07[_0x532622(0x10f)](_0x4fef1e);if(_0x1e174c)return _0x3777fe[_0x532622(0x13e)][_0x532622(0x13c)](_0x4fef1e,_0x1e174c),_0x1e174c;const _0x472c91=_0x3777fe[_0x532622(0xcb)][_0x532622(0x12b)](_0x26c2c4=>_0x26c2c4['name']===_0x4fef1e);if(_0x472c91)return _0x3777fe['segmentNameToId']['set'](_0x4fef1e,_0x472c91['id']),_0x472c91['id'];if(_0x239f9b[_0x532622(0x12f)]){const {stageName:_0x3f00ed,criteriaName:_0x5ce685}=findSegmentCriteriaLocation(_0x239f9b[_0x532622(0x128)],_0x4fef1e);return _0x4537ad(_0x4fef1e,_0x216b61['rule']),_0x1a5be8['set'](_0x4fef1e,{'definition':_0x216b61,'stageName':_0x3f00ed,'criteriaName':_0x5ce685}),createPendingSegmentId(_0x4fef1e);}const _0x28d757=_0x239f9b[_0x532622(0x142)]?.['id'];if(!_0x28d757)throw new SDKError(ErrorCode[_0x532622(0xc2)],_0x532622(0xca));_0x4537ad(_0x4fef1e,_0x216b61[_0x532622(0x102)]);const _0x1c4eca=generateDeterministicJourneySegmentName(_0x239f9b[_0x532622(0x128)][_0x532622(0x156)],_0x4fef1e),_0x1477e7=_0x3777fe[_0x532622(0xcb)][_0x532622(0x12b)](_0x40a6c3=>_0x40a6c3[_0x532622(0x156)]===_0x1c4eca),_0x1bc74c=createSegmentIdResolver(_0x3777fe[_0x532622(0x13e)],_0x4fef1e),_0x2b3e1e=await resolveRuleSegmentIds(_0x216b61[_0x532622(0x102)],_0x1bc74c);let _0x411358;if(_0x1477e7)await _0x100882[_0x532622(0x15c)][_0x532622(0x95)](_0x37e5c3['parentId'],_0x1477e7['id'],{'description':_0x216b61[_0x532622(0xec)]||_0x532622(0x10a)+_0x4fef1e,'rule':_0x559ac0(_0x2b3e1e,!![]),'countPopulation':!![]}),_0x411358=_0x1477e7['id'];else try{_0x411358=await _0x100882[_0x532622(0x15c)][_0x532622(0x139)]({'name':_0x1c4eca,'description':_0x216b61['description']||'Entry\x20criteria:\x20'+_0x4fef1e,'journeyId':_0x28d757,'rule':_0x559ac0(_0x2b3e1e,!![]),'countPopulation':!![],'parentFolderId':_0x37e5c3[_0x532622(0xf7)]||'','audienceId':_0x37e5c3[_0x532622(0x16c)]});}catch(_0x15ac3e){const _0x55524f=_0x15ac3e instanceof Error&&_0x15ac3e[_0x532622(0x153)][_0x532622(0x98)](_0x532622(0xcc));if(_0x55524f){const _0x52ff10=await _0x100882[_0x532622(0x15c)][_0x532622(0xc4)](_0x37e5c3[_0x532622(0x16c)]),_0x2fa39b=_0x52ff10[_0x532622(0x12b)](_0x3bbaff=>_0x3bbaff[_0x532622(0x156)]===_0x1c4eca);if(_0x2fa39b)await _0x100882[_0x532622(0x15c)][_0x532622(0x95)](_0x37e5c3['parentId'],_0x2fa39b['id'],{'description':_0x216b61[_0x532622(0xec)]||'Entry\x20criteria:\x20'+_0x4fef1e,'rule':_0x559ac0(_0x2b3e1e,!![]),'countPopulation':!![]}),_0x411358=_0x2fa39b['id'];else throw _0x15ac3e;}else throw _0x15ac3e;}return _0x3777fe['segmentNameToId'][_0x532622(0x13c)](_0x4fef1e,_0x411358),_0xfc3a88[_0x532622(0x13c)](_0x4fef1e,_0x411358),_0x411358;},'resolveActivationId':async _0xe93ab3=>{const _0x533cb9=_0x326625,_0x3b6d72=_0x4c6e71[_0x533cb9(0x10f)](_0xe93ab3);if(_0x3b6d72)return _0x3b6d72;if(_0x239f9b[_0x533cb9(0x142)]){await _0x5a2ef3();const _0x2a0a8a=_0x4c6e71[_0x533cb9(0x10f)](_0xe93ab3);if(_0x2a0a8a)return _0x2a0a8a;}throw new SDKError(ErrorCode[_0x533cb9(0xfd)],_0x533cb9(0xcf)+_0xe93ab3+'\x20(referenced\x20in\x20journey\x20'+_0x239f9b[_0x533cb9(0x128)][_0x533cb9(0x156)]+_0x533cb9(0x97)+_0x533cb9(0x88));},'resolveEmbeddedActivationId':async(_0x443523,_0x2bdc06)=>{const _0x4ca03c=_0x326625,_0xf9c7ad=_0x4c6e71[_0x4ca03c(0x10f)](_0x443523);if(_0xf9c7ad)return _0xf9c7ad;if(_0x239f9b[_0x4ca03c(0x12f)])return _0x4e01c5[_0x4ca03c(0x13c)](_0x443523,_0x2bdc06),createPendingActivationId(_0x443523);if(_0x239f9b['existingJourney']){await _0x5a2ef3();const _0x424784=_0x4c6e71[_0x4ca03c(0x10f)](_0x2bdc06[_0x4ca03c(0x156)]);if(_0x424784)return _0x4c6e71[_0x4ca03c(0x13c)](_0x443523,_0x424784),_0x424784;const _0x1ed5c3=activationSignature(_0x2bdc06),_0x2ca664=_0x45fa4f?.[_0x4ca03c(0x10f)](_0x1ed5c3);if(_0x2ca664)return _0x4c6e71[_0x4ca03c(0x13c)](_0x443523,_0x2ca664),_0x2ca664;const _0x3c9239=await _0x3aad14(_0x2bdc06,_0x3777fe[_0x4ca03c(0xaa)]),_0xc656a0=await _0x100882[_0x4ca03c(0xb0)][_0x4ca03c(0x133)](_0x239f9b[_0x4ca03c(0x142)]['id'],_0x3c9239);return _0x4c6e71['set'](_0x443523,_0xc656a0['id']),_0xc656a0['id'];}throw new SDKError(ErrorCode[_0x4ca03c(0xc2)],_0x4ca03c(0x96));},'resolveJourneyId':async _0x39c59a=>{const _0x9d6ef3=_0x326625;try{return await _0x100882['journey'][_0x9d6ef3(0x168)](_0x37e5c3[_0x9d6ef3(0x16c)],_0x39c59a);}catch(_0x4ee940){throw new SDKError(ErrorCode[_0x9d6ef3(0xfd)],_0x9d6ef3(0x125)+_0x39c59a+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x239f9b[_0x9d6ef3(0x128)][_0x9d6ef3(0x156)]+'\x27)',_0x4ee940);}},'resolveStageId':async(_0x52f7f0,_0x11c122)=>{const _0x1a696b=_0x326625,_0x34e028=await _0x100882['journey'][_0x1a696b(0x10e)](_0x52f7f0),_0x1b075a=_0x34e028['attributes'][_0x1a696b(0x14a)][_0x1a696b(0x12b)](_0x48289f=>_0x48289f[_0x1a696b(0x156)][_0x1a696b(0xf0)]()===_0x11c122[_0x1a696b(0xf0)]());if(!_0x1b075a?.['id'])throw new SDKError(ErrorCode[_0x1a696b(0xfd)],_0x1a696b(0x149)+_0x11c122+_0x1a696b(0xc3)+(_0x34e028[_0x1a696b(0xa2)]['journeyBundleName']||_0x34e028[_0x1a696b(0xa2)]['name'])+'\x27');return _0x1b075a['id'];}},_0x50cc0c=await _0x2e1a7f(_0x239f9b['yamlConfig'],_0x37e5c3[_0x326625(0x16c)],_0x10509d),_0x38c1ec=_0x37e5c3['folderId']||_0x37e5c3[_0x326625(0xf7)];_0x38c1ec&&(_0x50cc0c[_0x326625(0xd2)]={'parentFolder':{'data':{'id':_0x38c1ec,'type':_0x326625(0x118)}}});if(_0x239f9b[_0x326625(0x12f)]){if(_0x1a5be8[_0x326625(0x16e)]>0x0||_0x4e01c5[_0x326625(0x16e)]>0x0)return await executeThreeStepJourneyCreate(_0x100882,_0x239f9b,_0x50cc0c,{'pendingEmbeddedSegments':_0x1a5be8,'pendingEmbeddedActivations':_0x4e01c5,'embeddedSegmentNameToId':_0xfc3a88,'journeyActivationNameToId':_0x4c6e71},{..._0x37e5c3,'effectiveFolderId':_0x38c1ec},_0x3777fe,_0x1c4ff1,_0x4a4a82);else{ensureJourneyDefaults(_0x50cc0c['attributes']);const _0xf88a55=await _0x100882[_0x326625(0xb0)][_0x326625(0x9e)](_0x50cc0c);return{'action':_0x326625(0x14f),'journeyId':_0xf88a55['id'],'embeddedSegmentNameToId':_0xfc3a88};}}else{if(_0x239f9b[_0x326625(0xa8)]&&_0x239f9b[_0x326625(0x142)])return ensureJourneyDefaults(_0x50cc0c[_0x326625(0xa2)]),await _0x100882[_0x326625(0xb0)]['update'](_0x239f9b[_0x326625(0x142)]['id'],_0x50cc0c),{'action':_0x326625(0xb4),'journeyId':_0x239f9b[_0x326625(0x142)]['id'],'embeddedSegmentNameToId':_0xfc3a88};}return{'action':'unchanged','journeyId':_0x239f9b[_0x326625(0x142)]?.['id'],'embeddedSegmentNameToId':_0xfc3a88};}function findSegmentCriteriaLocation(_0x241d72,_0x4b9551){const _0x32a42c=a115_0x27b239,_0x58545e=_0x241d72[_0x32a42c(0x12d)]||_0x241d72['journeys']?.[0x0]?.[_0x32a42c(0x12d)]||[];let _0x7d305b=_0x32a42c(0x8a),_0x24e624=_0x4b9551;const _0x1d44ce=_0x241d72[_0x32a42c(0x119)]||_0x241d72['journeys']?.[0x0]?.[_0x32a42c(0x119)];if(_0x1d44ce?.[_0x32a42c(0x15c)]===_0x4b9551)return{'stageName':_0x32a42c(0x119),'criteriaName':_0x1d44ce[_0x32a42c(0x156)]||_0x4b9551};_0x22d89a:for(const _0x5be455 of _0x58545e){if(_0x5be455[_0x32a42c(0xe4)]?.[_0x32a42c(0x15c)]===_0x4b9551){_0x7d305b=_0x5be455[_0x32a42c(0x156)],_0x24e624=_0x5be455[_0x32a42c(0xe4)][_0x32a42c(0x156)]||_0x4b9551;break;}if(_0x5be455[_0x32a42c(0x120)])for(const _0x3b9715 of _0x5be455[_0x32a42c(0x120)]){if(_0x3b9715['type']===_0x32a42c(0xf5)&&_0x3b9715[_0x32a42c(0x8d)]?.[_0x32a42c(0x143)])for(const _0xb88db5 of _0x3b9715[_0x32a42c(0x8d)][_0x32a42c(0x143)]){if(_0xb88db5[_0x32a42c(0x15c)]===_0x4b9551){_0x7d305b=_0x5be455[_0x32a42c(0x156)],_0x24e624=_0xb88db5[_0x32a42c(0x156)]||_0x4b9551;break _0x22d89a;}}}}return{'stageName':_0x7d305b,'criteriaName':_0x24e624};}async function executeThreeStepJourneyCreate(_0x4e5d04,_0x22449d,_0x22e859,_0x2e5007,_0x2ea41f,_0x25bd0f,_0x38f885,_0x31feef){const _0x3c06a6=a115_0x27b239,{activationDefToCreateRequest:_0x55a9b7,yamlRuleToApi:_0x5a9572}=_0x31feef,{pendingEmbeddedSegments:_0x16674d,pendingEmbeddedActivations:_0x586a97,embeddedSegmentNameToId:_0x41af11}=_0x2e5007,_0xfa05f4=JSON[_0x3c06a6(0x99)](JSON[_0x3c06a6(0x110)](_0x22e859));ensureJourneyDefaults(_0xfa05f4[_0x3c06a6(0xa2)]),stripPendingIds(_0xfa05f4);const _0x8b97eb=await _0x4e5d04[_0x3c06a6(0xb0)][_0x3c06a6(0x9e)](_0xfa05f4),_0x472954=_0x8b97eb['id'],_0x7f0046=new Map();for(const _0x3203a8 of _0x8b97eb[_0x3c06a6(0xa2)][_0x3c06a6(0x14a)]){_0x7f0046['set'](_0x3203a8['name'][_0x3c06a6(0xf0)](),_0x3203a8['id']);}for(const [_0x1607e5,{definition:_0x3b0f5f}]of _0x16674d){const _0xa08302=generateDeterministicJourneySegmentName(_0x22449d['yamlConfig'][_0x3c06a6(0x156)],_0x1607e5);_0x38f885['onProgress']?.({'type':_0x3c06a6(0xb3),'journeyName':_0x22449d[_0x3c06a6(0x128)]['name'],'segmentName':_0x1607e5});const _0xd36f26=createSegmentIdResolver(_0x25bd0f[_0x3c06a6(0x13e)],_0x1607e5),_0x2781c6=await resolveRuleSegmentIds(_0x3b0f5f[_0x3c06a6(0x102)],_0xd36f26),_0x503144=await _0x4e5d04['segment']['createJourneySegment']({'name':_0xa08302,'description':_0x3b0f5f[_0x3c06a6(0xec)]||_0x3c06a6(0x10a)+_0x1607e5,'journeyId':_0x472954,'rule':_0x5a9572(_0x2781c6,!![]),'countPopulation':!![],'parentFolderId':_0x2ea41f[_0x3c06a6(0x150)]||'','audienceId':_0x2ea41f[_0x3c06a6(0x16c)]});_0x41af11['set'](_0x1607e5,_0x503144),_0x25bd0f[_0x3c06a6(0x13e)]['set'](_0x1607e5,_0x503144),_0x38f885[_0x3c06a6(0x109)]?.({'type':_0x3c06a6(0x13f),'journeyName':_0x22449d[_0x3c06a6(0x128)][_0x3c06a6(0x156)],'segmentName':_0x1607e5});}const _0x282b22=new Map();for(const [_0xeb4045,_0x530ea1]of _0x586a97){_0x38f885['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x22449d[_0x3c06a6(0x128)]['name'],'activationName':_0xeb4045});const _0x5af6f3=await _0x55a9b7(_0x530ea1,_0x25bd0f[_0x3c06a6(0xaa)]),_0xac615d=await _0x4e5d04['journey'][_0x3c06a6(0x133)](_0x472954,_0x5af6f3);_0x282b22[_0x3c06a6(0x13c)](_0xeb4045,_0xac615d['id']),_0x2e5007[_0x3c06a6(0x15e)]['set'](_0xeb4045,_0xac615d['id']),_0x38f885['onProgress']?.({'type':_0x3c06a6(0x106),'journeyName':_0x22449d[_0x3c06a6(0x128)][_0x3c06a6(0x156)],'activationName':_0xeb4045});}const _0x1ba846=JSON[_0x3c06a6(0x99)](JSON[_0x3c06a6(0x110)](_0x22e859));return _0x1ba846['id']=_0x472954,ensureJourneyDefaults(_0x1ba846[_0x3c06a6(0xa2)]),resolvePendingIdsInRequest(_0x1ba846,_0x22e859,_0x7f0046,_0x41af11,_0x282b22,_0x38f885),await _0x4e5d04[_0x3c06a6(0xb0)]['update'](_0x472954,_0x1ba846),{'action':_0x3c06a6(0x14f),'journeyId':_0x472954,'embeddedSegmentNameToId':_0x41af11};}function stripPendingIds(_0x4a667f){const _0x521178=a115_0x27b239;for(const _0x59791b of _0x4a667f['attributes'][_0x521178(0x14a)]||[]){_0x59791b[_0x521178(0xdb)]?.[_0x521178(0xbd)]&&isPendingSegmentId(_0x59791b[_0x521178(0xdb)][_0x521178(0xbd)])&&delete _0x59791b[_0x521178(0xdb)];if(_0x59791b[_0x521178(0x120)])for(const _0x324e63 of Object['keys'](_0x59791b[_0x521178(0x120)])){const _0x5998e6=_0x59791b[_0x521178(0x120)][_0x324e63];_0x5998e6[_0x521178(0x117)]===_0x521178(0xeb)&&_0x5998e6[_0x521178(0xe5)]&&isPendingActivationId(_0x5998e6[_0x521178(0xe5)])&&(_0x5998e6['journeyActivationStepId']='');if(_0x5998e6['type']===_0x521178(0x11f)&&_0x5998e6[_0x521178(0x143)])for(const _0x1f3183 of _0x5998e6[_0x521178(0x143)]){_0x1f3183['segmentId']&&isPendingSegmentId(_0x1f3183[_0x521178(0xbd)])&&(_0x1f3183[_0x521178(0xbd)]='');}_0x5998e6[_0x521178(0x117)]==='WaitStep'&&_0x5998e6[_0x521178(0xd4)]?.['segmentId']&&isPendingSegmentId(_0x5998e6[_0x521178(0xd4)][_0x521178(0xbd)])&&(_0x5998e6[_0x521178(0xd4)][_0x521178(0xbd)]='');}}}function resolvePendingIdsInRequest(_0x3bd0b1,_0x13bde6,_0x1abb72,_0xd9d789,_0x2ca241,_0x535bfb){const _0xb0d5d0=a115_0x27b239,_0x4d7e71=(_0x4ea9d1,_0xf22719)=>{const _0x30f4d2=a115_0x5512;if(!isPendingSegmentId(_0x4ea9d1))return _0x4ea9d1;const _0x4a8fba=extractPendingSegmentName(_0x4ea9d1),_0x8f7da6=_0xd9d789['get'](_0x4a8fba);return!_0x8f7da6&&_0x535bfb[_0x30f4d2(0xdf)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x4a8fba+_0x30f4d2(0xda)+_0xf22719),_0x8f7da6;};if(_0x3bd0b1['attributes']['goal']?.['segmentId']&&isPendingSegmentId(_0x3bd0b1['attributes'][_0xb0d5d0(0x119)][_0xb0d5d0(0xbd)])){const _0x2f8d68=_0x4d7e71(_0x3bd0b1[_0xb0d5d0(0xa2)][_0xb0d5d0(0x119)][_0xb0d5d0(0xbd)],'goal\x20criteria');_0x2f8d68&&(_0x3bd0b1[_0xb0d5d0(0xa2)][_0xb0d5d0(0x119)]['segmentId']=_0x2f8d68);}for(const _0x370890 of _0x3bd0b1['attributes'][_0xb0d5d0(0x14a)]||[]){const _0x23bb0a=_0x1abb72[_0xb0d5d0(0x10f)](_0x370890[_0xb0d5d0(0x156)]['toLowerCase']());_0x23bb0a&&(_0x370890['id']=_0x23bb0a);if(_0x370890[_0xb0d5d0(0xdb)]?.[_0xb0d5d0(0xbd)]&&isPendingSegmentId(_0x370890[_0xb0d5d0(0xdb)][_0xb0d5d0(0xbd)])){const _0x6db7f9=_0x4d7e71(_0x370890[_0xb0d5d0(0xdb)][_0xb0d5d0(0xbd)],_0xb0d5d0(0xc6)+_0x370890['name']+_0xb0d5d0(0x87));_0x6db7f9&&(_0x370890[_0xb0d5d0(0xdb)][_0xb0d5d0(0xbd)]=_0x6db7f9);}if(_0x370890['exitCriterias'])for(const _0x229f0b of _0x370890[_0xb0d5d0(0x144)]){if(_0x229f0b[_0xb0d5d0(0xbd)]&&isPendingSegmentId(_0x229f0b[_0xb0d5d0(0xbd)])){const _0x3ea435=_0x4d7e71(_0x229f0b[_0xb0d5d0(0xbd)],_0xb0d5d0(0xc6)+_0x370890['name']+_0xb0d5d0(0x13b));_0x3ea435&&(_0x229f0b['segmentId']=_0x3ea435);}}if(_0x370890[_0xb0d5d0(0x113)]?.['segmentId']&&isPendingSegmentId(_0x370890['milestone'][_0xb0d5d0(0xbd)])){const _0x226457=_0x4d7e71(_0x370890[_0xb0d5d0(0x113)][_0xb0d5d0(0xbd)],_0xb0d5d0(0xc6)+_0x370890[_0xb0d5d0(0x156)]+_0xb0d5d0(0xfb));_0x226457&&(_0x370890[_0xb0d5d0(0x113)][_0xb0d5d0(0xbd)]=_0x226457);}if(_0x370890[_0xb0d5d0(0x120)]){const _0x3cfaea=_0x345e69=>_0x13bde6['attributes']['journeyStages'][_0xb0d5d0(0x12b)](_0x3b63e3=>_0x3b63e3[_0xb0d5d0(0x156)]['toLowerCase']()===_0x370890[_0xb0d5d0(0x156)][_0xb0d5d0(0xf0)]())?.['steps']?.[_0x345e69];for(const _0x10ad84 of Object[_0xb0d5d0(0xff)](_0x370890['steps'])){const _0x2b9ff6=_0x370890[_0xb0d5d0(0x120)][_0x10ad84],_0x1289dd=_0x3cfaea(_0x10ad84);if(_0x2b9ff6[_0xb0d5d0(0x117)]===_0xb0d5d0(0xeb)&&_0x2b9ff6[_0xb0d5d0(0xe5)]&&(isPendingActivationId(_0x2b9ff6[_0xb0d5d0(0xe5)])||_0x2b9ff6[_0xb0d5d0(0xe5)]==='')){if(_0x1289dd?.['journeyActivationStepId']&&isPendingActivationId(_0x1289dd[_0xb0d5d0(0xe5)])){const _0x36856d=extractPendingActivationName(_0x1289dd[_0xb0d5d0(0xe5)]),_0x5b18da=_0x2ca241[_0xb0d5d0(0x10f)](_0x36856d);_0x5b18da&&(_0x2b9ff6['journeyActivationStepId']=_0x5b18da);}}if(_0x2b9ff6['type']===_0xb0d5d0(0x11f)&&_0x2b9ff6[_0xb0d5d0(0x143)]&&_0x1289dd?.[_0xb0d5d0(0x143)])for(let _0x589d8b=0x0;_0x589d8b<_0x2b9ff6[_0xb0d5d0(0x143)]['length'];_0x589d8b++){const _0x5bae24=_0x2b9ff6[_0xb0d5d0(0x143)][_0x589d8b],_0x2f5036=_0x1289dd[_0xb0d5d0(0x143)][_0x589d8b];if(_0x2f5036?.[_0xb0d5d0(0xbd)]&&isPendingSegmentId(_0x2f5036[_0xb0d5d0(0xbd)])){const _0x533a7f=_0x4d7e71(_0x2f5036[_0xb0d5d0(0xbd)],_0xb0d5d0(0xc6)+_0x370890[_0xb0d5d0(0x156)]+_0xb0d5d0(0xe1)+(_0x5bae24[_0xb0d5d0(0x156)]||_0x589d8b)+'\x27');_0x533a7f&&(_0x5bae24[_0xb0d5d0(0xbd)]=_0x533a7f);}}if(_0x2b9ff6[_0xb0d5d0(0x117)]===_0xb0d5d0(0x10c)&&_0x2b9ff6['waitCondition']?.[_0xb0d5d0(0xbd)]&&_0x1289dd?.[_0xb0d5d0(0xd4)]?.[_0xb0d5d0(0xbd)]&&isPendingSegmentId(_0x1289dd[_0xb0d5d0(0xd4)][_0xb0d5d0(0xbd)])){const _0x3c51e8=_0x4d7e71(_0x1289dd[_0xb0d5d0(0xd4)][_0xb0d5d0(0xbd)],'stage\x20\x27'+_0x370890[_0xb0d5d0(0x156)]+_0xb0d5d0(0x10b));_0x3c51e8&&(_0x2b9ff6[_0xb0d5d0(0xd4)]['segmentId']=_0x3c51e8);}}}}}
@@ -1 +1 @@
1
- function a116_0x1446(){const _0x128091=['900dfjMFJ','has','1BvwDOe','477018fajKhC','get','1062810jGYNDA','906692NZMBcx','33056OPSxrN','add','parentFolderId','set','415386OEygRx','name','163442CyimWq','315875zueUiS'];a116_0x1446=function(){return _0x128091;};return a116_0x1446();}(function(_0x57f687,_0x30579e){const _0x273143=a116_0x58e5,_0x476f22=_0x57f687();while(!![]){try{const _0x5558c7=-parseInt(_0x273143(0x1ff))/0x1*(-parseInt(_0x273143(0x1fb))/0x2)+-parseInt(_0x273143(0x1f9))/0x3+-parseInt(_0x273143(0x1f4))/0x4+parseInt(_0x273143(0x1fc))/0x5+parseInt(_0x273143(0x200))/0x6+-parseInt(_0x273143(0x1f3))/0x7+-parseInt(_0x273143(0x1f5))/0x8*(-parseInt(_0x273143(0x1fd))/0x9);if(_0x5558c7===_0x30579e)break;else _0x476f22['push'](_0x476f22['shift']());}catch(_0x831b69){_0x476f22['push'](_0x476f22['shift']());}}}(a116_0x1446,0x1d73a));export function buildFolderIdToPathMap(_0x230fa2){const _0x2bffa2=a116_0x58e5,_0x79b575=new Map(),_0x253a97=new Map();for(const _0x92d0ea of _0x230fa2){_0x253a97[_0x2bffa2(0x1f8)](_0x92d0ea['id'],_0x92d0ea);}const _0x336d6d=new Set();for(const _0xd97819 of _0x230fa2){!_0xd97819[_0x2bffa2(0x1f7)]&&_0x336d6d[_0x2bffa2(0x1f6)](_0xd97819['id']);}function _0x58483c(_0x2f3b08){const _0x3aae58=_0x2bffa2;if(_0x79b575['has'](_0x2f3b08['id']))return _0x79b575[_0x3aae58(0x201)](_0x2f3b08['id']);if(_0x336d6d[_0x3aae58(0x1fe)](_0x2f3b08['id']))return _0x79b575[_0x3aae58(0x1f8)](_0x2f3b08['id'],''),'';if(_0x2f3b08[_0x3aae58(0x1f7)]){const _0x380260=_0x253a97[_0x3aae58(0x201)](_0x2f3b08[_0x3aae58(0x1f7)]);if(_0x380260){const _0x5e537f=_0x58483c(_0x380260),_0x5cc95f=_0x5e537f?_0x5e537f+'/'+_0x2f3b08['name']:_0x2f3b08['name'];return _0x79b575[_0x3aae58(0x1f8)](_0x2f3b08['id'],_0x5cc95f),_0x5cc95f;}}const _0x39cbc8=_0x2f3b08[_0x3aae58(0x1fa)];return _0x79b575['set'](_0x2f3b08['id'],_0x39cbc8),_0x39cbc8;}for(const _0x16d189 of _0x230fa2){_0x58483c(_0x16d189);}return _0x79b575;}export function buildFolderPathToIdMap(_0x141308){const _0x1110ed=a116_0x58e5,_0x429aad=new Map(),_0x44f6b8=new Map();for(const _0x31735c of _0x141308){_0x44f6b8[_0x1110ed(0x1f8)](_0x31735c['id'],_0x31735c);}const _0x51fe58=new Set();for(const _0x5b847b of _0x141308){!_0x5b847b[_0x1110ed(0x1f7)]&&_0x51fe58[_0x1110ed(0x1f6)](_0x5b847b['id']);}function _0xbecead(_0x419433){const _0x4e9c08=_0x1110ed;if(_0x51fe58['has'](_0x419433['id']))return'';if(_0x419433[_0x4e9c08(0x1f7)]){const _0x2f2d02=_0x44f6b8[_0x4e9c08(0x201)](_0x419433[_0x4e9c08(0x1f7)]);if(_0x2f2d02){const _0x33e600=_0xbecead(_0x2f2d02);return _0x33e600?_0x33e600+'/'+_0x419433[_0x4e9c08(0x1fa)]:_0x419433[_0x4e9c08(0x1fa)];}}return _0x419433['name'];}for(const _0x234ee2 of _0x141308){const _0x26baa6=_0xbecead(_0x234ee2);_0x429aad[_0x1110ed(0x1f8)](_0x26baa6,_0x234ee2['id']);}return _0x429aad;}function a116_0x58e5(_0x10e9ad,_0x54bcbc){_0x10e9ad=_0x10e9ad-0x1f3;const _0x144690=a116_0x1446();let _0x58e508=_0x144690[_0x10e9ad];return _0x58e508;}export function buildFolderMaps(_0xc13d4c){const _0x396e0f=a116_0x58e5,_0x224d89=buildFolderIdToPathMap(_0xc13d4c),_0xaa435a=new Map();for(const [_0x2bb48f,_0x1d01a5]of _0x224d89){_0xaa435a[_0x396e0f(0x1f8)](_0x1d01a5,_0x2bb48f);}return{'idToPath':_0x224d89,'pathToId':_0xaa435a};}export function getFolderPath(_0x49c3ad,_0x3ef819){const _0x43b9f5=a116_0x58e5;if(!_0x49c3ad)return'';return _0x3ef819[_0x43b9f5(0x201)](_0x49c3ad)??'';}
1
+ (function(_0x415222,_0x4dba2f){const _0x4dd2bc=a116_0x1e25,_0x1f5d2c=_0x415222();while(!![]){try{const _0x5250e8=parseInt(_0x4dd2bc(0x19d))/0x1+parseInt(_0x4dd2bc(0x19b))/0x2*(parseInt(_0x4dd2bc(0x1a3))/0x3)+parseInt(_0x4dd2bc(0x1a1))/0x4+parseInt(_0x4dd2bc(0x194))/0x5+-parseInt(_0x4dd2bc(0x195))/0x6*(-parseInt(_0x4dd2bc(0x19f))/0x7)+parseInt(_0x4dd2bc(0x19c))/0x8+parseInt(_0x4dd2bc(0x1a0))/0x9*(-parseInt(_0x4dd2bc(0x197))/0xa);if(_0x5250e8===_0x4dba2f)break;else _0x1f5d2c['push'](_0x1f5d2c['shift']());}catch(_0x486d3e){_0x1f5d2c['push'](_0x1f5d2c['shift']());}}}(a116_0x44e2,0x2e481));export function buildFolderIdToPathMap(_0x5ead19){const _0x4729ef=a116_0x1e25,_0x59b898=new Map(),_0x54ad9f=new Map();for(const _0x40a7b8 of _0x5ead19){_0x54ad9f[_0x4729ef(0x19e)](_0x40a7b8['id'],_0x40a7b8);}const _0x43d661=new Set();for(const _0x2afe4f of _0x5ead19){!_0x2afe4f[_0x4729ef(0x198)]&&_0x43d661[_0x4729ef(0x199)](_0x2afe4f['id']);}function _0x352e92(_0x210622){const _0x4a2521=_0x4729ef;if(_0x59b898[_0x4a2521(0x196)](_0x210622['id']))return _0x59b898[_0x4a2521(0x19a)](_0x210622['id']);if(_0x43d661[_0x4a2521(0x196)](_0x210622['id']))return _0x59b898[_0x4a2521(0x19e)](_0x210622['id'],''),'';if(_0x210622[_0x4a2521(0x198)]){const _0x1fe1b9=_0x54ad9f[_0x4a2521(0x19a)](_0x210622['parentFolderId']);if(_0x1fe1b9){const _0x849df2=_0x352e92(_0x1fe1b9),_0x2c4eb2=_0x849df2?_0x849df2+'/'+_0x210622['name']:_0x210622[_0x4a2521(0x1a2)];return _0x59b898[_0x4a2521(0x19e)](_0x210622['id'],_0x2c4eb2),_0x2c4eb2;}}const _0x465ae8=_0x210622[_0x4a2521(0x1a2)];return _0x59b898[_0x4a2521(0x19e)](_0x210622['id'],_0x465ae8),_0x465ae8;}for(const _0x15b50a of _0x5ead19){_0x352e92(_0x15b50a);}return _0x59b898;}export function buildFolderPathToIdMap(_0x272e5b){const _0x4abe87=a116_0x1e25,_0x3cf5cb=new Map(),_0x186b24=new Map();for(const _0x106383 of _0x272e5b){_0x186b24[_0x4abe87(0x19e)](_0x106383['id'],_0x106383);}const _0x1c4e96=new Set();for(const _0x55ca64 of _0x272e5b){!_0x55ca64[_0x4abe87(0x198)]&&_0x1c4e96['add'](_0x55ca64['id']);}function _0x30c975(_0x572b3d){const _0x46bdc6=_0x4abe87;if(_0x1c4e96['has'](_0x572b3d['id']))return'';if(_0x572b3d[_0x46bdc6(0x198)]){const _0xa58364=_0x186b24[_0x46bdc6(0x19a)](_0x572b3d[_0x46bdc6(0x198)]);if(_0xa58364){const _0x31dc9d=_0x30c975(_0xa58364);return _0x31dc9d?_0x31dc9d+'/'+_0x572b3d[_0x46bdc6(0x1a2)]:_0x572b3d[_0x46bdc6(0x1a2)];}}return _0x572b3d[_0x46bdc6(0x1a2)];}for(const _0xe7a13d of _0x272e5b){const _0x50f31b=_0x30c975(_0xe7a13d);_0x3cf5cb[_0x4abe87(0x19e)](_0x50f31b,_0xe7a13d['id']);}return _0x3cf5cb;}function a116_0x1e25(_0x988c31,_0x19b5e8){_0x988c31=_0x988c31-0x194;const _0x44e244=a116_0x44e2();let _0x1e2544=_0x44e244[_0x988c31];return _0x1e2544;}function a116_0x44e2(){const _0x156fa9=['parentFolderId','add','get','700358mtmJfW','1269632ASlOBB','215334SpzPJB','set','112532ULCpAr','27lKGgiX','850188nXcMsl','name','3lvuWTM','1507360YztcvF','48QRSqCo','has','3924250HmUlVK'];a116_0x44e2=function(){return _0x156fa9;};return a116_0x44e2();}export function buildFolderMaps(_0x4bb8d6){const _0x50a341=a116_0x1e25,_0x1c473d=buildFolderIdToPathMap(_0x4bb8d6),_0x3ace27=new Map();for(const [_0x4ef747,_0x306a76]of _0x1c473d){_0x3ace27[_0x50a341(0x19e)](_0x306a76,_0x4ef747);}return{'idToPath':_0x1c473d,'pathToId':_0x3ace27};}export function getFolderPath(_0x4b8712,_0x1ded78){const _0x1a3b2=a116_0x1e25;if(!_0x4b8712)return'';return _0x1ded78[_0x1a3b2(0x19a)](_0x4b8712)??'';}
@@ -1 +1 @@
1
- (function(_0x54234c,_0x436e95){const _0x4dc5f1=a117_0x163f,_0x98d5f0=_0x54234c();while(!![]){try{const _0x50631c=parseInt(_0x4dc5f1(0xbf))/0x1+-parseInt(_0x4dc5f1(0xb9))/0x2*(-parseInt(_0x4dc5f1(0xad))/0x3)+parseInt(_0x4dc5f1(0xae))/0x4*(-parseInt(_0x4dc5f1(0xc9))/0x5)+parseInt(_0x4dc5f1(0xbb))/0x6+parseInt(_0x4dc5f1(0xaf))/0x7*(parseInt(_0x4dc5f1(0xbe))/0x8)+-parseInt(_0x4dc5f1(0xd1))/0x9*(-parseInt(_0x4dc5f1(0xc3))/0xa)+-parseInt(_0x4dc5f1(0xd3))/0xb;if(_0x50631c===_0x436e95)break;else _0x98d5f0['push'](_0x98d5f0['shift']());}catch(_0x47e362){_0x98d5f0['push'](_0x98d5f0['shift']());}}}(a117_0x16c5,0x68e48));import a117_0x21897f from'path';import{parse as a117_0xb899c5}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x3cf290){const _0x257eee=a117_0x163f;if(!_0x3cf290||_0x3cf290[_0x257eee(0xb4)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x15c12e=_0x3cf290[_0x257eee(0xb4)]();if(_0x15c12e==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x3cf290};const _0x4ed60d=_0x15c12e[_0x257eee(0xb8)]('/')?_0x15c12e[_0x257eee(0xca)](0x1):_0x15c12e,_0x39f824=_0x4ed60d['split']('/')[_0x257eee(0xd6)](_0x3ff325=>_0x3ff325!=='');if(_0x39f824[_0x257eee(0xba)]===0x0)throw new Error(_0x257eee(0xc1));const _0x558b9d=_0x15c12e['startsWith']('/')||!isRelativePathSegment(_0x39f824[0x0]);for(const _0x3a496c of _0x39f824){validatePathSegment(_0x3a496c);}return{'segments':_0x39f824,'isAbsolute':_0x558b9d,'raw':_0x3cf290};}function isRelativePathSegment(_0x18e5e6){return _0x18e5e6==='.'||_0x18e5e6==='..';}function a117_0x163f(_0x3bb628,_0x20d165){_0x3bb628=_0x3bb628-0xaa;const _0x16c55b=a117_0x16c5();let _0x163f38=_0x16c55b[_0x3bb628];return _0x163f38;}function validatePathSegment(_0x25c4be){const _0x2c288e=a117_0x163f;if(_0x25c4be==='')throw new Error(_0x2c288e(0xd2));if(_0x25c4be==='.'||_0x25c4be==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x25c4be))throw new Error(_0x2c288e(0xd7)+_0x25c4be);if(_0x25c4be!==_0x25c4be['trim']()){}}export function validatePath(_0xae3691){const _0x4ce2a1=a117_0x163f;if(_0xae3691[_0x4ce2a1(0xce)][_0x4ce2a1(0xba)]===0x0&&!_0xae3691[_0x4ce2a1(0xd4)])throw new Error(_0x4ce2a1(0xcf));if(_0xae3691[_0x4ce2a1(0xd4)]){if(_0xae3691[_0x4ce2a1(0xce)][0x0]==='..')throw new Error(_0x4ce2a1(0xaa));let _0x2c331d=0x0;for(const _0x8be522 of _0xae3691[_0x4ce2a1(0xce)]){if(_0x8be522==='..'){if(_0x2c331d===0x0)throw new Error(_0x4ce2a1(0xb1));_0x2c331d--;}else _0x8be522!=='.'&&_0x2c331d++;}}}export function joinPaths(_0x37b96b,_0x54c5ae){const _0x53e54e=a117_0x163f;if(!_0x37b96b||_0x37b96b==='/')return _0x54c5ae;if(!_0x54c5ae||_0x54c5ae==='.')return _0x37b96b;if(_0x54c5ae[_0x53e54e(0xb8)]('/'))return _0x54c5ae;const _0x284fb8=parsePath(_0x37b96b),_0x593769=parsePath(_0x54c5ae),_0x2f95da=[..._0x284fb8[_0x53e54e(0xce)]];for(const _0x7e7aea of _0x593769[_0x53e54e(0xce)]){if(_0x7e7aea==='.')continue;else{if(_0x7e7aea==='..'){if(_0x2f95da[_0x53e54e(0xba)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x2f95da[_0x53e54e(0xc4)]();}else _0x2f95da[_0x53e54e(0xac)](_0x7e7aea);}}const _0x54a67b=_0x2f95da['join']('/');return _0x284fb8['raw']['startsWith']('/')?'/'+_0x54a67b:_0x54a67b;}export function normalizePath(_0x15b228){const _0x13ca63=a117_0x163f,_0x2169b9=parsePath(_0x15b228),_0x373086=[];for(const _0xbb9bec of _0x2169b9['segments']){if(_0xbb9bec==='.')continue;else{if(_0xbb9bec==='..'){if(_0x373086[_0x13ca63(0xba)]===0x0){if(_0x2169b9['isAbsolute'])throw new Error(_0x13ca63(0xc6));_0x373086[_0x13ca63(0xac)]('..');}else _0x373086[_0x373086[_0x13ca63(0xba)]-0x1]==='..'?_0x373086['push']('..'):_0x373086[_0x13ca63(0xc4)]();}else _0x373086[_0x13ca63(0xac)](_0xbb9bec);}}if(_0x373086[_0x13ca63(0xba)]===0x0)return _0x2169b9['isAbsolute']?'/':'.';const _0x22f7df=_0x373086[_0x13ca63(0xb0)]('/');return _0x2169b9[_0x13ca63(0xb7)][_0x13ca63(0xb8)]('/')?'/'+_0x22f7df:_0x22f7df;}export function getParentPath(_0x341bda){const _0x9bf519=a117_0x163f,_0x16c4e9=parsePath(_0x341bda);if(_0x16c4e9[_0x9bf519(0xce)][_0x9bf519(0xba)]<=0x1)return'/';const _0x7555a7=_0x16c4e9[_0x9bf519(0xce)][_0x9bf519(0xb6)](0x0,-0x1)[_0x9bf519(0xb0)]('/');return _0x16c4e9[_0x9bf519(0xb7)][_0x9bf519(0xb8)]('/')?'/'+_0x7555a7:_0x7555a7;}export function getBaseName(_0x3c055e){const _0x5c33c0=a117_0x163f,_0x17bcef=parsePath(_0x3c055e);return _0x17bcef[_0x5c33c0(0xce)][_0x17bcef['segments']['length']-0x1]||'';}function a117_0x16c5(){const _0x50e18f=['Path\x20must\x20contain\x20at\x20least\x20one\x20segment','segment','10dUKJSC','pop','File\x20not\x20found:\x20','Cannot\x20navigate\x20above\x20root','.yml','readFile','4123145agEBbf','substring','parse','endsWith','Cannot\x20split\x20empty\x20path','segments','Relative\x20path\x20cannot\x20be\x20empty','journey','981009FceVLT','Path\x20segment\x20cannot\x20be\x20empty','3795033dIJWco','isAbsolute','exists','filter','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','root','push','19911YQTgps','4rLIJoO','61166KcEdUK','join','Path\x20attempts\x20to\x20navigate\x20above\x20root','resolve','replace','trim','dirname','slice','raw','startsWith','234JruueU','length','234066mOEMKI','No\x20tdx.json\x20found\x20for\x20file:\x20','type','464MDsDbt','167927cxgQkd','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field'];a117_0x16c5=function(){return _0x50e18f;};return a117_0x16c5();}export function isChildPath(_0x1b8e7f,_0x35e14e){const _0x32e8fd=a117_0x163f,_0x12541d=parsePath(_0x1b8e7f),_0x1c9f16=parsePath(_0x35e14e);if(_0x12541d[_0x32e8fd(0xce)][_0x32e8fd(0xba)]<=_0x1c9f16[_0x32e8fd(0xce)][_0x32e8fd(0xba)])return![];for(let _0xb17991=0x0;_0xb17991<_0x1c9f16[_0x32e8fd(0xce)][_0x32e8fd(0xba)];_0xb17991++){if(_0x12541d['segments'][_0xb17991]!==_0x1c9f16[_0x32e8fd(0xce)][_0xb17991])return![];}return!![];}export function splitPath(_0x534f81){const _0x117560=a117_0x163f,_0x5cb510=parsePath(_0x534f81);if(_0x5cb510[_0x117560(0xce)]['length']===0x0)throw new Error(_0x117560(0xcd));if(_0x5cb510[_0x117560(0xce)]['length']===0x1)return{'parent':_0x5cb510[_0x117560(0xce)][0x0]};return{'parent':_0x5cb510[_0x117560(0xce)][0x0],'child':_0x5cb510['segments'][_0x117560(0xb6)](0x1)['join']('/')};}export function isYamlFilePath(_0x3a1247){const _0x491191=a117_0x163f;return _0x3a1247[_0x491191(0xcc)](_0x491191(0xc7))||_0x3a1247[_0x491191(0xcc)]('.yaml');}export async function resolveYamlFilePath(_0x151a96,_0xa6bcb8=nodeFileSystem){const _0x5eac47=a117_0x163f,_0xdb1a5e=a117_0x21897f[_0x5eac47(0xb2)](_0x151a96);if(!await _0xa6bcb8[_0x5eac47(0xd5)](_0xdb1a5e))throw new Error(_0x5eac47(0xc5)+_0x151a96);let _0x445d0d=a117_0x21897f[_0x5eac47(0xb5)](_0xdb1a5e),_0x3af4d4=null,_0x243855=null;const _0x522a9b=a117_0x21897f['parse'](_0x445d0d)[_0x5eac47(0xab)];while(_0x445d0d!==_0x522a9b){const _0x4d8ff1=a117_0x21897f['join'](_0x445d0d,'tdx.json');if(await _0xa6bcb8[_0x5eac47(0xd5)](_0x4d8ff1)){_0x3af4d4=_0x4d8ff1,_0x243855=_0x445d0d;break;}_0x445d0d=a117_0x21897f[_0x5eac47(0xb5)](_0x445d0d);}if(!_0x3af4d4||!_0x243855)throw new Error(_0x5eac47(0xbc)+_0x151a96);const _0x153de2=await _0xa6bcb8[_0x5eac47(0xc8)](_0x3af4d4),_0x44629e=JSON[_0x5eac47(0xcb)](_0x153de2),_0x21a547=_0x44629e['parent_segment'];if(!_0x21a547)throw new Error(_0x5eac47(0xc0));const _0x4f3151=await _0xa6bcb8[_0x5eac47(0xc8)](_0xdb1a5e),_0x177871=a117_0xb899c5(_0x4f3151),_0x56661c=_0x177871['name'];if(!_0x56661c)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x151a96);const _0x13f6c7=_0x177871[_0x5eac47(0xbd)]===_0x5eac47(0xd0)?_0x5eac47(0xd0):_0x5eac47(0xc2),_0x452b1e=a117_0x21897f['relative'](_0x243855,_0xdb1a5e),_0x56e8ab=a117_0x21897f[_0x5eac47(0xb5)](_0x452b1e),_0x113a50=_0x56e8ab==='.'?'':_0x56e8ab[_0x5eac47(0xb3)](/\\/g,'/'),_0x4fdbdb=_0x113a50?_0x21a547+'/'+_0x113a50+'/'+_0x56661c:_0x21a547+'/'+_0x56661c;return{'parentSegment':_0x21a547,'segmentName':_0x56661c,'folderPath':_0x113a50,'fullPath':_0x4fdbdb,'resourceType':_0x13f6c7};}
1
+ (function(_0x316994,_0x4b799b){const _0x11b341=a117_0x2d71,_0x4ac57a=_0x316994();while(!![]){try{const _0x327530=parseInt(_0x11b341(0x18c))/0x1+parseInt(_0x11b341(0x179))/0x2+parseInt(_0x11b341(0x189))/0x3+parseInt(_0x11b341(0x18b))/0x4*(parseInt(_0x11b341(0x19c))/0x5)+parseInt(_0x11b341(0x17c))/0x6*(-parseInt(_0x11b341(0x188))/0x7)+parseInt(_0x11b341(0x19e))/0x8*(-parseInt(_0x11b341(0x1a1))/0x9)+-parseInt(_0x11b341(0x187))/0xa*(-parseInt(_0x11b341(0x18d))/0xb);if(_0x327530===_0x4b799b)break;else _0x4ac57a['push'](_0x4ac57a['shift']());}catch(_0x402611){_0x4ac57a['push'](_0x4ac57a['shift']());}}}(a117_0x4e79,0xd3554));function a117_0x4e79(){const _0x8292ad=['Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Relative\x20path\x20cannot\x20be\x20empty','journey','30xTxpbu','Path\x20cannot\x20be\x20empty','110864LTlcUZ','test','tdx.json','468JLpOBT','isAbsolute','.yaml','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','144874owAlsl','startsWith','pop','892326HgVeeG','Cannot\x20navigate\x20above\x20root','replace','Path\x20attempts\x20to\x20navigate\x20above\x20root','length','join','parent_segment','File\x20not\x20found:\x20','parse','exists','segments','1509130MLEzRh','49DMERId','2916837VcomVn','segment','540388CySxbY','470159oflWOG','22zeDVIi','No\x20tdx.json\x20found\x20for\x20file:\x20','dirname','raw','split','Cannot\x20split\x20empty\x20path','endsWith','trim','name','push','resolve','readFile'];a117_0x4e79=function(){return _0x8292ad;};return a117_0x4e79();}import a117_0x55ae4d from'path';import{parse as a117_0x2fdd33}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x213b53){const _0xe5924a=a117_0x2d71;if(!_0x213b53||_0x213b53[_0xe5924a(0x194)]()==='')throw new Error(_0xe5924a(0x19d));const _0x46c66e=_0x213b53['trim']();if(_0x46c66e==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x213b53};const _0x5ea70d=_0x46c66e[_0xe5924a(0x17a)]('/')?_0x46c66e['substring'](0x1):_0x46c66e,_0x44c105=_0x5ea70d[_0xe5924a(0x191)]('/')['filter'](_0x4722af=>_0x4722af!=='');if(_0x44c105['length']===0x0)throw new Error(_0xe5924a(0x199));const _0x46dae0=_0x46c66e[_0xe5924a(0x17a)]('/')||!isRelativePathSegment(_0x44c105[0x0]);for(const _0x4f322e of _0x44c105){validatePathSegment(_0x4f322e);}return{'segments':_0x44c105,'isAbsolute':_0x46dae0,'raw':_0x213b53};}function isRelativePathSegment(_0x2147b6){return _0x2147b6==='.'||_0x2147b6==='..';}function validatePathSegment(_0x5b4404){const _0x43ba62=a117_0x2d71;if(_0x5b4404==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x5b4404==='.'||_0x5b4404==='..')return;if(/[\x00-\x1F\x7F]/[_0x43ba62(0x19f)](_0x5b4404))throw new Error(_0x43ba62(0x1a4)+_0x5b4404);if(_0x5b4404!==_0x5b4404[_0x43ba62(0x194)]()){}}export function validatePath(_0x23ef23){const _0x12c125=a117_0x2d71;if(_0x23ef23[_0x12c125(0x186)]['length']===0x0&&!_0x23ef23[_0x12c125(0x1a2)])throw new Error(_0x12c125(0x19a));if(_0x23ef23[_0x12c125(0x1a2)]){if(_0x23ef23[_0x12c125(0x186)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x275d00=0x0;for(const _0x24da82 of _0x23ef23[_0x12c125(0x186)]){if(_0x24da82==='..'){if(_0x275d00===0x0)throw new Error(_0x12c125(0x17f));_0x275d00--;}else _0x24da82!=='.'&&_0x275d00++;}}}export function joinPaths(_0x3c652b,_0x2d912a){const _0x5ea6ff=a117_0x2d71;if(!_0x3c652b||_0x3c652b==='/')return _0x2d912a;if(!_0x2d912a||_0x2d912a==='.')return _0x3c652b;if(_0x2d912a[_0x5ea6ff(0x17a)]('/'))return _0x2d912a;const _0x1a3ef4=parsePath(_0x3c652b),_0x427b9c=parsePath(_0x2d912a),_0x46c68c=[..._0x1a3ef4['segments']];for(const _0xcd59cc of _0x427b9c['segments']){if(_0xcd59cc==='.')continue;else{if(_0xcd59cc==='..'){if(_0x46c68c[_0x5ea6ff(0x180)]===0x0)throw new Error(_0x5ea6ff(0x17d));_0x46c68c[_0x5ea6ff(0x17b)]();}else _0x46c68c[_0x5ea6ff(0x196)](_0xcd59cc);}}const _0x29c7a3=_0x46c68c[_0x5ea6ff(0x181)]('/');return _0x1a3ef4['raw']['startsWith']('/')?'/'+_0x29c7a3:_0x29c7a3;}export function normalizePath(_0x9dbd06){const _0xb28697=a117_0x2d71,_0x3d37b4=parsePath(_0x9dbd06),_0x5566ca=[];for(const _0x26697a of _0x3d37b4[_0xb28697(0x186)]){if(_0x26697a==='.')continue;else{if(_0x26697a==='..'){if(_0x5566ca[_0xb28697(0x180)]===0x0){if(_0x3d37b4['isAbsolute'])throw new Error(_0xb28697(0x17d));_0x5566ca['push']('..');}else _0x5566ca[_0x5566ca[_0xb28697(0x180)]-0x1]==='..'?_0x5566ca[_0xb28697(0x196)]('..'):_0x5566ca[_0xb28697(0x17b)]();}else _0x5566ca[_0xb28697(0x196)](_0x26697a);}}if(_0x5566ca['length']===0x0)return _0x3d37b4[_0xb28697(0x1a2)]?'/':'.';const _0x39bdc0=_0x5566ca['join']('/');return _0x3d37b4[_0xb28697(0x190)][_0xb28697(0x17a)]('/')?'/'+_0x39bdc0:_0x39bdc0;}export function getParentPath(_0x5e17d3){const _0x20917=a117_0x2d71,_0x1afb15=parsePath(_0x5e17d3);if(_0x1afb15['segments'][_0x20917(0x180)]<=0x1)return'/';const _0x322c53=_0x1afb15['segments']['slice'](0x0,-0x1)['join']('/');return _0x1afb15[_0x20917(0x190)]['startsWith']('/')?'/'+_0x322c53:_0x322c53;}function a117_0x2d71(_0x50dcac,_0x5924b6){_0x50dcac=_0x50dcac-0x179;const _0x4e798b=a117_0x4e79();let _0x2d7111=_0x4e798b[_0x50dcac];return _0x2d7111;}export function getBaseName(_0x89800c){const _0x498bc3=a117_0x2d71,_0x542883=parsePath(_0x89800c);return _0x542883[_0x498bc3(0x186)][_0x542883[_0x498bc3(0x186)][_0x498bc3(0x180)]-0x1]||'';}export function isChildPath(_0x4394c7,_0x124e18){const _0x10011d=a117_0x2d71,_0x27d44f=parsePath(_0x4394c7),_0x1dfd43=parsePath(_0x124e18);if(_0x27d44f['segments'][_0x10011d(0x180)]<=_0x1dfd43[_0x10011d(0x186)][_0x10011d(0x180)])return![];for(let _0x67a864=0x0;_0x67a864<_0x1dfd43['segments'][_0x10011d(0x180)];_0x67a864++){if(_0x27d44f[_0x10011d(0x186)][_0x67a864]!==_0x1dfd43[_0x10011d(0x186)][_0x67a864])return![];}return!![];}export function splitPath(_0x25984f){const _0x51aba5=a117_0x2d71,_0xf5a465=parsePath(_0x25984f);if(_0xf5a465[_0x51aba5(0x186)][_0x51aba5(0x180)]===0x0)throw new Error(_0x51aba5(0x192));if(_0xf5a465['segments'][_0x51aba5(0x180)]===0x1)return{'parent':_0xf5a465[_0x51aba5(0x186)][0x0]};return{'parent':_0xf5a465[_0x51aba5(0x186)][0x0],'child':_0xf5a465[_0x51aba5(0x186)]['slice'](0x1)[_0x51aba5(0x181)]('/')};}export function isYamlFilePath(_0x9a25f3){const _0x57c4a2=a117_0x2d71;return _0x9a25f3['endsWith']('.yml')||_0x9a25f3[_0x57c4a2(0x193)](_0x57c4a2(0x1a3));}export async function resolveYamlFilePath(_0x688db8,_0x143e50=nodeFileSystem){const _0x2640e3=a117_0x2d71,_0x250956=a117_0x55ae4d[_0x2640e3(0x197)](_0x688db8);if(!await _0x143e50[_0x2640e3(0x185)](_0x250956))throw new Error(_0x2640e3(0x183)+_0x688db8);let _0x14c63a=a117_0x55ae4d['dirname'](_0x250956),_0x4d6355=null,_0x1c2b27=null;const _0x5c4a47=a117_0x55ae4d['parse'](_0x14c63a)['root'];while(_0x14c63a!==_0x5c4a47){const _0x2ad8cc=a117_0x55ae4d[_0x2640e3(0x181)](_0x14c63a,_0x2640e3(0x1a0));if(await _0x143e50['exists'](_0x2ad8cc)){_0x4d6355=_0x2ad8cc,_0x1c2b27=_0x14c63a;break;}_0x14c63a=a117_0x55ae4d[_0x2640e3(0x18f)](_0x14c63a);}if(!_0x4d6355||!_0x1c2b27)throw new Error(_0x2640e3(0x18e)+_0x688db8);const _0x7fa7db=await _0x143e50[_0x2640e3(0x198)](_0x4d6355),_0x5a324a=JSON[_0x2640e3(0x184)](_0x7fa7db),_0x252c80=_0x5a324a[_0x2640e3(0x182)];if(!_0x252c80)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x10f2cf=await _0x143e50[_0x2640e3(0x198)](_0x250956),_0x1a2303=a117_0x2fdd33(_0x10f2cf),_0x7a6aa6=_0x1a2303[_0x2640e3(0x195)];if(!_0x7a6aa6)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x688db8);const _0x3e7e2a=_0x1a2303['type']===_0x2640e3(0x19b)?_0x2640e3(0x19b):_0x2640e3(0x18a),_0x167d15=a117_0x55ae4d['relative'](_0x1c2b27,_0x250956),_0x40ea98=a117_0x55ae4d['dirname'](_0x167d15),_0x524e8e=_0x40ea98==='.'?'':_0x40ea98[_0x2640e3(0x17e)](/\\/g,'/'),_0x4c4594=_0x524e8e?_0x252c80+'/'+_0x524e8e+'/'+_0x7a6aa6:_0x252c80+'/'+_0x7a6aa6;return{'parentSegment':_0x252c80,'segmentName':_0x7a6aa6,'folderPath':_0x524e8e,'fullPath':_0x4c4594,'resourceType':_0x3e7e2a};}
@@ -1 +1 @@
1
- function a118_0x570f(_0x822167,_0x42daca){_0x822167=_0x822167-0x17c;const _0x49cc7b=a118_0x49cc();let _0x570f4e=_0x49cc7b[_0x822167];return _0x570f4e;}function a118_0x49cc(){const _0x487d39=['Invalid\x20segment\x20reference\x20format:\x20','2EQEovn','.\x20Child\x20name\x20cannot\x20be\x20empty','2336Qinhkn','5706267SCnBMb','517694KZkmWZ','10985NkHawq','3236577gaUGec','10457595wSzMhB','8OPCgfR','substring','32855290iRCVQK','1135428arsmoW'];a118_0x49cc=function(){return _0x487d39;};return a118_0x49cc();}(function(_0x43f1b4,_0x4be6cb){const _0x1f6576=a118_0x570f,_0x3b452a=_0x43f1b4();while(!![]){try{const _0x21355b=parseInt(_0x1f6576(0x188))/0x1*(-parseInt(_0x1f6576(0x17f))/0x2)+parseInt(_0x1f6576(0x181))/0x3+parseInt(_0x1f6576(0x17d))/0x4*(parseInt(_0x1f6576(0x180))/0x5)+parseInt(_0x1f6576(0x186))/0x6+parseInt(_0x1f6576(0x17e))/0x7+parseInt(_0x1f6576(0x183))/0x8*(parseInt(_0x1f6576(0x182))/0x9)+-parseInt(_0x1f6576(0x185))/0xa;if(_0x21355b===_0x4be6cb)break;else _0x3b452a['push'](_0x3b452a['shift']());}catch(_0x48bb09){_0x3b452a['push'](_0x3b452a['shift']());}}}(a118_0x49cc,0xb1042));export function parseSegmentRef(_0x10b21c){const _0x1d13c5=a118_0x570f,_0x14405c=_0x10b21c['indexOf']('/');if(_0x14405c===-0x1)return{'parentId':_0x10b21c};if(_0x14405c===0x0)throw new Error(_0x1d13c5(0x187)+_0x10b21c+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x20ab72=_0x10b21c[_0x1d13c5(0x184)](0x0,_0x14405c),_0x2a6c0d=_0x10b21c[_0x1d13c5(0x184)](_0x14405c+0x1);if(_0x2a6c0d==='')throw new Error(_0x1d13c5(0x187)+_0x10b21c+_0x1d13c5(0x17c));return{'parentId':_0x20ab72,'childId':_0x2a6c0d};}
1
+ (function(_0x4091e2,_0x162309){const _0x4af749=a118_0x37fb,_0x6f80cf=_0x4091e2();while(!![]){try{const _0x16c7c9=parseInt(_0x4af749(0xd8))/0x1+parseInt(_0x4af749(0xe1))/0x2*(-parseInt(_0x4af749(0xdf))/0x3)+parseInt(_0x4af749(0xda))/0x4*(-parseInt(_0x4af749(0xd6))/0x5)+parseInt(_0x4af749(0xe0))/0x6+parseInt(_0x4af749(0xdd))/0x7+-parseInt(_0x4af749(0xd9))/0x8*(parseInt(_0x4af749(0xdc))/0x9)+parseInt(_0x4af749(0xdb))/0xa;if(_0x16c7c9===_0x162309)break;else _0x6f80cf['push'](_0x6f80cf['shift']());}catch(_0x55b525){_0x6f80cf['push'](_0x6f80cf['shift']());}}}(a118_0x31fa,0x7c1c5));function a118_0x37fb(_0x1d1e7f,_0x3e4d03){_0x1d1e7f=_0x1d1e7f-0xd6;const _0x31fad2=a118_0x31fa();let _0x37fb82=_0x31fad2[_0x1d1e7f];return _0x37fb82;}function a118_0x31fa(){const _0x112430=['5ZliBJr','.\x20Child\x20name\x20cannot\x20be\x20empty','772880VjCEwe','4904tSacQN','1483072BBoVBK','5731720GyAvzl','8865svCRGX','3676554QzurMy','Invalid\x20segment\x20reference\x20format:\x20','43746SBhpmB','2394504ZKaYal','108rVHpNF','substring'];a118_0x31fa=function(){return _0x112430;};return a118_0x31fa();}export function parseSegmentRef(_0x4f4e9b){const _0x35ac18=a118_0x37fb,_0x48267e=_0x4f4e9b['indexOf']('/');if(_0x48267e===-0x1)return{'parentId':_0x4f4e9b};if(_0x48267e===0x0)throw new Error(_0x35ac18(0xde)+_0x4f4e9b+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x1e97ce=_0x4f4e9b['substring'](0x0,_0x48267e),_0xc62d40=_0x4f4e9b[_0x35ac18(0xe2)](_0x48267e+0x1);if(_0xc62d40==='')throw new Error(_0x35ac18(0xde)+_0x4f4e9b+_0x35ac18(0xd7));return{'parentId':_0x1e97ce,'childId':_0xc62d40};}
@@ -1 +1 @@
1
- (function(_0x1d0e0d,_0x1932e9){const _0x568a42=a119_0x1a90,_0x10136b=_0x1d0e0d();while(!![]){try{const _0x234aa8=parseInt(_0x568a42(0x14f))/0x1*(-parseInt(_0x568a42(0x15c))/0x2)+parseInt(_0x568a42(0x166))/0x3+-parseInt(_0x568a42(0x164))/0x4+parseInt(_0x568a42(0x14b))/0x5+-parseInt(_0x568a42(0x14c))/0x6+-parseInt(_0x568a42(0x13a))/0x7*(-parseInt(_0x568a42(0x156))/0x8)+-parseInt(_0x568a42(0x143))/0x9;if(_0x234aa8===_0x1932e9)break;else _0x10136b['push'](_0x10136b['shift']());}catch(_0x253248){_0x10136b['push'](_0x10136b['shift']());}}}(a119_0x3cec,0x2c55f));import a119_0x4067eb from'path';function a119_0x3cec(){const _0x42e9f1=['parentSegment','readFile','747316pqFapb','error','112548rfAxto','resolve','isFile','parent_name','no_config','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parse','basename','7812EecrDt','relative','includes','File\x20not\x20found','type','directory','dirname','parent_segment','exists','615600HpOARf','Not\x20a\x20YAML\x20file:\x20','segmentName','folderPath','No\x20tdx.json\x20found\x20for\x20file:\x20','file','join','configDir','1779735MMqYhz','746184mwFmDr','replace','no_parent','863OOgxuI','scopedFolderPath','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','startsWith','File\x20not\x20found:\x20','extname','trim','1456QrImFW','match','string','isDirectory','journey','context','82PuMZOc','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','invalid_yaml','resourceType','isScoped','cwd'];a119_0x3cec=function(){return _0x42e9f1;};return a119_0x3cec();}import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x36fcc3){const _0x229453=a119_0x1a90;return _0x36fcc3[_0x229453(0x13e)]!==_0x229453(0x165);}export function isScopedResolution(_0x445451){const _0x5d804e=a119_0x1a90;return _0x445451[_0x5d804e(0x13e)]==='directory'||_0x445451[_0x5d804e(0x13e)]===_0x5d804e(0x148)||_0x445451['type']===_0x5d804e(0x15b);}function a119_0x1a90(_0x569e78,_0x4eb2ae){_0x569e78=_0x569e78-0x135;const _0x3cecaa=a119_0x3cec();let _0x1a90d4=_0x3cecaa[_0x569e78];return _0x1a90d4;}export function getScopedDetails(_0x1673a3){const _0x559284=a119_0x1a90;if(isScopedResolution(_0x1673a3))return{'isScoped':_0x1673a3[_0x559284(0x160)],'scopedFolderPath':_0x1673a3['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x30dac4,_0x1ee490){const _0x3a13e1=a119_0x1a90;let _0x4ecb7d=a119_0x4067eb['resolve'](_0x30dac4);const _0x283702=a119_0x4067eb[_0x3a13e1(0x138)](_0x4ecb7d)['root'];while(_0x4ecb7d!==_0x283702){const _0x1d4393=a119_0x4067eb[_0x3a13e1(0x149)](_0x4ecb7d,'tdx.json');if(await _0x1ee490[_0x3a13e1(0x142)](_0x1d4393))try{const _0x389a20=await _0x1ee490[_0x3a13e1(0x163)](_0x1d4393),_0x264363=JSON['parse'](_0x389a20);if(_0x264363[_0x3a13e1(0x141)]&&typeof _0x264363[_0x3a13e1(0x141)]===_0x3a13e1(0x158))return{'configPath':_0x1d4393,'configDir':_0x4ecb7d,'parentSegment':_0x264363[_0x3a13e1(0x141)]};}catch{}_0x4ecb7d=a119_0x4067eb[_0x3a13e1(0x140)](_0x4ecb7d);}return null;}function calculateScopedPath(_0x39787d,_0x2fc1b4){const _0x14ba42=a119_0x1a90,_0x1c5c71=a119_0x4067eb[_0x14ba42(0x13b)](_0x2fc1b4,_0x39787d),_0x4136cc=_0x1c5c71!==''&&_0x1c5c71!=='.'&&!_0x1c5c71[_0x14ba42(0x152)]('..');return{'isScoped':_0x4136cc,'scopedFolderPath':_0x4136cc?_0x1c5c71[_0x14ba42(0x14d)](/\\/g,'/'):''};}export async function resolveTarget(_0x347477){const _0x1d9ae4=a119_0x1a90,{arg:_0x37393e,contextParent:_0x4ff795,cwd:cwd=process[_0x1d9ae4(0x161)](),fs:fs=nodeFileSystem}=_0x347477;if(_0x37393e&&isYamlFilePath(_0x37393e))try{const _0x27b6e3=await resolveYamlFilePath(_0x37393e,fs),_0x3757e7=a119_0x4067eb[_0x1d9ae4(0x167)](_0x37393e),_0x22d71e=a119_0x4067eb[_0x1d9ae4(0x140)](_0x3757e7),_0x50a9af=await findTdxConfigAsync(_0x22d71e,fs);if(!_0x50a9af){if(_0x4ff795){const _0x56b0f2=a119_0x4067eb[_0x1d9ae4(0x140)](_0x3757e7);return{'type':_0x1d9ae4(0x148),'parentName':_0x4ff795,'targetDir':_0x56b0f2,'configRoot':_0x56b0f2,'filePath':_0x3757e7,'resourceName':_0x27b6e3['segmentName'],'folderPath':_0x27b6e3[_0x1d9ae4(0x146)],'resourceType':_0x27b6e3[_0x1d9ae4(0x15f)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1d9ae4(0x165),'errorCode':_0x1d9ae4(0x136),'message':_0x1d9ae4(0x147)+_0x37393e,'arg':_0x37393e,'helpText':_0x1d9ae4(0x15d)};}const _0x3fe3ca=calculateScopedPath(_0x22d71e,_0x50a9af[_0x1d9ae4(0x14a)]);return{'type':_0x1d9ae4(0x148),'parentName':_0x50a9af['parentSegment'],'targetDir':_0x50a9af[_0x1d9ae4(0x14a)],'configRoot':_0x50a9af[_0x1d9ae4(0x14a)],'filePath':_0x3757e7,'resourceName':_0x27b6e3[_0x1d9ae4(0x145)],'folderPath':_0x27b6e3[_0x1d9ae4(0x146)],'resourceType':_0x27b6e3['resourceType'],'isScoped':_0x3fe3ca[_0x1d9ae4(0x160)],'scopedFolderPath':_0x3fe3ca[_0x1d9ae4(0x150)]};}catch(_0x45c507){const _0x31cc7a=_0x45c507 instanceof Error?_0x45c507['message']:String(_0x45c507);if(_0x31cc7a[_0x1d9ae4(0x13c)](_0x1d9ae4(0x13d)))return{'type':'error','errorCode':'file_not_found','message':_0x1d9ae4(0x153)+_0x37393e,'arg':_0x37393e};if(_0x31cc7a[_0x1d9ae4(0x13c)]('No\x20tdx.json\x20found')){if(_0x4ff795){const _0x1ce54d=a119_0x4067eb[_0x1d9ae4(0x167)](_0x37393e);if(await fs[_0x1d9ae4(0x142)](_0x1ce54d)){const _0x34c711=a119_0x4067eb['dirname'](_0x1ce54d),_0x212559=await fs[_0x1d9ae4(0x163)](_0x1ce54d),_0x535535=_0x212559[_0x1d9ae4(0x157)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x3279db=_0x212559[_0x1d9ae4(0x157)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x34d7b2=_0x535535?_0x535535[0x1][_0x1d9ae4(0x155)]():a119_0x4067eb[_0x1d9ae4(0x139)](_0x37393e,a119_0x4067eb[_0x1d9ae4(0x154)](_0x37393e)),_0x28c3b0=_0x3279db&&_0x3279db[0x1][_0x1d9ae4(0x155)]()===_0x1d9ae4(0x15a)?_0x1d9ae4(0x15a):'segment';return{'type':_0x1d9ae4(0x148),'parentName':_0x4ff795,'targetDir':_0x34c711,'configRoot':_0x34c711,'filePath':_0x1ce54d,'resourceName':_0x34d7b2,'folderPath':'','resourceType':_0x28c3b0,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':'no_config','message':_0x1d9ae4(0x147)+_0x37393e,'arg':_0x37393e,'helpText':_0x1d9ae4(0x15d)};}return{'type':_0x1d9ae4(0x165),'errorCode':_0x1d9ae4(0x15e),'message':_0x31cc7a,'arg':_0x37393e};}if(_0x37393e){const _0x5caefe=a119_0x4067eb['resolve'](cwd,_0x37393e);let _0x52a736=null;try{_0x52a736=await fs['stat'](_0x5caefe);}catch{}if(_0x52a736?.[_0x1d9ae4(0x159)]()){const _0x1e425f=await findTdxConfigAsync(_0x5caefe,fs);if(_0x1e425f){const _0x3c1ee1=calculateScopedPath(_0x5caefe,_0x1e425f[_0x1d9ae4(0x14a)]);return{'type':_0x1d9ae4(0x13f),'parentName':_0x1e425f['parentSegment'],'targetDir':_0x5caefe,'configRoot':_0x1e425f[_0x1d9ae4(0x14a)],'isScoped':_0x3c1ee1[_0x1d9ae4(0x160)],'scopedFolderPath':_0x3c1ee1[_0x1d9ae4(0x150)]};}if(_0x4ff795)return{'type':_0x1d9ae4(0x13f),'parentName':_0x4ff795,'targetDir':_0x5caefe,'configRoot':_0x5caefe,'isScoped':![],'scopedFolderPath':''};return{'type':_0x1d9ae4(0x165),'errorCode':_0x1d9ae4(0x136),'message':_0x1d9ae4(0x137)+_0x37393e,'arg':_0x37393e,'helpText':_0x1d9ae4(0x15d)};}if(_0x52a736?.[_0x1d9ae4(0x168)]())return{'type':_0x1d9ae4(0x165),'errorCode':_0x1d9ae4(0x15e),'message':_0x1d9ae4(0x144)+_0x37393e,'arg':_0x37393e,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x3ef482=sanitizeFileName(_0x37393e),_0x4c26f6=getSegmentRootDir(_0x3ef482,cwd);return{'type':_0x1d9ae4(0x135),'parentName':_0x37393e,'targetDir':_0x4c26f6,'configRoot':_0x4c26f6};}const _0x3d0ca7=await findTdxConfigAsync(cwd,fs);if(_0x3d0ca7){const _0x5e6a43=calculateScopedPath(cwd,_0x3d0ca7[_0x1d9ae4(0x14a)]);return{'type':_0x1d9ae4(0x15b),'parentName':_0x3d0ca7[_0x1d9ae4(0x162)],'targetDir':cwd,'configRoot':_0x3d0ca7[_0x1d9ae4(0x14a)],'isScoped':_0x5e6a43[_0x1d9ae4(0x160)],'scopedFolderPath':_0x5e6a43['scopedFolderPath']};}if(_0x4ff795){const _0x3b67bc=sanitizeFileName(_0x4ff795),_0x27c345=getSegmentRootDir(_0x3b67bc,cwd);return{'type':'context','parentName':_0x4ff795,'targetDir':_0x27c345,'configRoot':_0x27c345,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1d9ae4(0x165),'errorCode':_0x1d9ae4(0x14e),'message':'Parent\x20segment\x20not\x20specified','helpText':_0x1d9ae4(0x151)};}
1
+ (function(_0x4b4800,_0x5b7a4c){const _0x41a1e9=a119_0x2724,_0x48233a=_0x4b4800();while(!![]){try{const _0x167b6f=-parseInt(_0x41a1e9(0x7d))/0x1*(-parseInt(_0x41a1e9(0x99))/0x2)+parseInt(_0x41a1e9(0x74))/0x3+parseInt(_0x41a1e9(0x9d))/0x4+parseInt(_0x41a1e9(0x6d))/0x5+parseInt(_0x41a1e9(0x84))/0x6*(-parseInt(_0x41a1e9(0x91))/0x7)+-parseInt(_0x41a1e9(0x7a))/0x8*(parseInt(_0x41a1e9(0x8e))/0x9)+-parseInt(_0x41a1e9(0x90))/0xa;if(_0x167b6f===_0x5b7a4c)break;else _0x48233a['push'](_0x48233a['shift']());}catch(_0x420376){_0x48233a['push'](_0x48233a['shift']());}}}(a119_0x3f3d,0x9861f));import a119_0x48f796 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';function a119_0x2724(_0x1d7b30,_0xd4783f){_0x1d7b30=_0x1d7b30-0x69;const _0x3f3da3=a119_0x3f3d();let _0x2724f0=_0x3f3da3[_0x1d7b30];return _0x2724f0;}import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x32f439){const _0x19c1b3=a119_0x2724;return _0x32f439[_0x19c1b3(0x78)]!=='error';}export function isScopedResolution(_0x2fb9cd){const _0x4868ad=a119_0x2724;return _0x2fb9cd[_0x4868ad(0x78)]===_0x4868ad(0x8f)||_0x2fb9cd['type']==='file'||_0x2fb9cd[_0x4868ad(0x78)]===_0x4868ad(0x96);}export function getScopedDetails(_0x597106){const _0x32b15e=a119_0x2724;if(isScopedResolution(_0x597106))return{'isScoped':_0x597106[_0x32b15e(0x6a)],'scopedFolderPath':_0x597106[_0x32b15e(0x75)]};return undefined;}function a119_0x3f3d(){const _0x468ed8=['journey','resolve','context','parse','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','14FnAaIP','no_config','error','message','4265636KlAzrV','parent_name','string','basename','exists','isScoped','readFile','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','2103870hqnCXh','relative','join','File\x20not\x20found:\x20','match','no_parent','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','3622161zMntoV','scopedFolderPath','parent_segment','tdx.json','type','parentSegment','8JTDhNY','cwd','dirname','59103pRbmjV','extname','No\x20tdx.json\x20found\x20for\x20file:\x20','Parent\x20segment\x20not\x20specified','invalid_yaml','No\x20tdx.json\x20found','File\x20not\x20found','66DamlNJ','trim','segmentName','replace','includes','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','root','isDirectory','file','folderPath','5059953wDXeBC','directory','16541640SyAffV','170387VSePpE','resourceType','configDir'];a119_0x3f3d=function(){return _0x468ed8;};return a119_0x3f3d();}async function findTdxConfigAsync(_0x3ba9ff,_0x4d57cf){const _0x448e1c=a119_0x2724;let _0x8e55cc=a119_0x48f796[_0x448e1c(0x95)](_0x3ba9ff);const _0x52e563=a119_0x48f796[_0x448e1c(0x97)](_0x8e55cc)[_0x448e1c(0x8a)];while(_0x8e55cc!==_0x52e563){const _0x5d4598=a119_0x48f796[_0x448e1c(0x6f)](_0x8e55cc,_0x448e1c(0x77));if(await _0x4d57cf[_0x448e1c(0x69)](_0x5d4598))try{const _0x5cdbf2=await _0x4d57cf[_0x448e1c(0x6b)](_0x5d4598),_0xac18c9=JSON[_0x448e1c(0x97)](_0x5cdbf2);if(_0xac18c9[_0x448e1c(0x76)]&&typeof _0xac18c9[_0x448e1c(0x76)]===_0x448e1c(0x9f))return{'configPath':_0x5d4598,'configDir':_0x8e55cc,'parentSegment':_0xac18c9[_0x448e1c(0x76)]};}catch{}_0x8e55cc=a119_0x48f796['dirname'](_0x8e55cc);}return null;}function calculateScopedPath(_0x4ce485,_0x2c3652){const _0x4f2e0e=a119_0x2724,_0x20ca19=a119_0x48f796[_0x4f2e0e(0x6e)](_0x2c3652,_0x4ce485),_0x59d285=_0x20ca19!==''&&_0x20ca19!=='.'&&!_0x20ca19['startsWith']('..');return{'isScoped':_0x59d285,'scopedFolderPath':_0x59d285?_0x20ca19[_0x4f2e0e(0x87)](/\\/g,'/'):''};}export async function resolveTarget(_0x555682){const _0xb132bb=a119_0x2724,{arg:_0x244ab7,contextParent:_0x2ab02c,cwd:cwd=process[_0xb132bb(0x7b)](),fs:fs=nodeFileSystem}=_0x555682;if(_0x244ab7&&isYamlFilePath(_0x244ab7))try{const _0x5d8f19=await resolveYamlFilePath(_0x244ab7,fs),_0xbc4d99=a119_0x48f796[_0xb132bb(0x95)](_0x244ab7),_0xb99bd8=a119_0x48f796['dirname'](_0xbc4d99),_0xffac25=await findTdxConfigAsync(_0xb99bd8,fs);if(!_0xffac25){if(_0x2ab02c){const _0x273e15=a119_0x48f796[_0xb132bb(0x7c)](_0xbc4d99);return{'type':_0xb132bb(0x8c),'parentName':_0x2ab02c,'targetDir':_0x273e15,'configRoot':_0x273e15,'filePath':_0xbc4d99,'resourceName':_0x5d8f19[_0xb132bb(0x86)],'folderPath':_0x5d8f19[_0xb132bb(0x8d)],'resourceType':_0x5d8f19['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':'no_config','message':_0xb132bb(0x7f)+_0x244ab7,'arg':_0x244ab7,'helpText':_0xb132bb(0x73)};}const _0x165250=calculateScopedPath(_0xb99bd8,_0xffac25['configDir']);return{'type':'file','parentName':_0xffac25[_0xb132bb(0x79)],'targetDir':_0xffac25[_0xb132bb(0x93)],'configRoot':_0xffac25['configDir'],'filePath':_0xbc4d99,'resourceName':_0x5d8f19['segmentName'],'folderPath':_0x5d8f19['folderPath'],'resourceType':_0x5d8f19[_0xb132bb(0x92)],'isScoped':_0x165250['isScoped'],'scopedFolderPath':_0x165250['scopedFolderPath']};}catch(_0x8920bb){const _0x10b37d=_0x8920bb instanceof Error?_0x8920bb[_0xb132bb(0x9c)]:String(_0x8920bb);if(_0x10b37d[_0xb132bb(0x88)](_0xb132bb(0x83)))return{'type':'error','errorCode':'file_not_found','message':_0xb132bb(0x70)+_0x244ab7,'arg':_0x244ab7};if(_0x10b37d[_0xb132bb(0x88)](_0xb132bb(0x82))){if(_0x2ab02c){const _0x539746=a119_0x48f796['resolve'](_0x244ab7);if(await fs['exists'](_0x539746)){const _0x51085e=a119_0x48f796['dirname'](_0x539746),_0x234296=await fs[_0xb132bb(0x6b)](_0x539746),_0x2ecc74=_0x234296[_0xb132bb(0x71)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x19545a=_0x234296[_0xb132bb(0x71)](/^type:\s*["']?([^"'\n]+)["']?/m),_0xeb91b2=_0x2ecc74?_0x2ecc74[0x1][_0xb132bb(0x85)]():a119_0x48f796[_0xb132bb(0xa0)](_0x244ab7,a119_0x48f796[_0xb132bb(0x7e)](_0x244ab7)),_0x4975c7=_0x19545a&&_0x19545a[0x1][_0xb132bb(0x85)]()===_0xb132bb(0x94)?_0xb132bb(0x94):'segment';return{'type':_0xb132bb(0x8c),'parentName':_0x2ab02c,'targetDir':_0x51085e,'configRoot':_0x51085e,'filePath':_0x539746,'resourceName':_0xeb91b2,'folderPath':'','resourceType':_0x4975c7,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0xb132bb(0x9b),'errorCode':'no_config','message':_0xb132bb(0x7f)+_0x244ab7,'arg':_0x244ab7,'helpText':_0xb132bb(0x73)};}return{'type':_0xb132bb(0x9b),'errorCode':_0xb132bb(0x81),'message':_0x10b37d,'arg':_0x244ab7};}if(_0x244ab7){const _0x94ce99=a119_0x48f796[_0xb132bb(0x95)](cwd,_0x244ab7);let _0x5e6fbe=null;try{_0x5e6fbe=await fs['stat'](_0x94ce99);}catch{}if(_0x5e6fbe?.[_0xb132bb(0x8b)]()){const _0x2a56ff=await findTdxConfigAsync(_0x94ce99,fs);if(_0x2a56ff){const _0x43df09=calculateScopedPath(_0x94ce99,_0x2a56ff['configDir']);return{'type':_0xb132bb(0x8f),'parentName':_0x2a56ff[_0xb132bb(0x79)],'targetDir':_0x94ce99,'configRoot':_0x2a56ff[_0xb132bb(0x93)],'isScoped':_0x43df09[_0xb132bb(0x6a)],'scopedFolderPath':_0x43df09['scopedFolderPath']};}if(_0x2ab02c)return{'type':'directory','parentName':_0x2ab02c,'targetDir':_0x94ce99,'configRoot':_0x94ce99,'isScoped':![],'scopedFolderPath':''};return{'type':_0xb132bb(0x9b),'errorCode':_0xb132bb(0x9a),'message':_0xb132bb(0x98)+_0x244ab7,'arg':_0x244ab7,'helpText':_0xb132bb(0x73)};}if(_0x5e6fbe?.['isFile']())return{'type':_0xb132bb(0x9b),'errorCode':_0xb132bb(0x81),'message':'Not\x20a\x20YAML\x20file:\x20'+_0x244ab7,'arg':_0x244ab7,'helpText':_0xb132bb(0x6c)};const _0x47369c=sanitizeFileName(_0x244ab7),_0x28256f=getSegmentRootDir(_0x47369c,cwd);return{'type':_0xb132bb(0x9e),'parentName':_0x244ab7,'targetDir':_0x28256f,'configRoot':_0x28256f};}const _0x24568e=await findTdxConfigAsync(cwd,fs);if(_0x24568e){const _0x5bb4ef=calculateScopedPath(cwd,_0x24568e[_0xb132bb(0x93)]);return{'type':_0xb132bb(0x96),'parentName':_0x24568e[_0xb132bb(0x79)],'targetDir':cwd,'configRoot':_0x24568e[_0xb132bb(0x93)],'isScoped':_0x5bb4ef[_0xb132bb(0x6a)],'scopedFolderPath':_0x5bb4ef['scopedFolderPath']};}if(_0x2ab02c){const _0x4cf1a2=sanitizeFileName(_0x2ab02c),_0x1dbeff=getSegmentRootDir(_0x4cf1a2,cwd);return{'type':'context','parentName':_0x2ab02c,'targetDir':_0x1dbeff,'configRoot':_0x1dbeff,'isScoped':![],'scopedFolderPath':''};}return{'type':_0xb132bb(0x9b),'errorCode':_0xb132bb(0x72),'message':_0xb132bb(0x80),'helpText':_0xb132bb(0x89)};}
@@ -1 +1 @@
1
- const a120_0x460808=a120_0x2a36;(function(_0x119f9f,_0x113d09){const _0x47cc88=a120_0x2a36,_0x304f30=_0x119f9f();while(!![]){try{const _0x134a3c=-parseInt(_0x47cc88(0x1c6))/0x1+-parseInt(_0x47cc88(0x1c5))/0x2*(parseInt(_0x47cc88(0x1ae))/0x3)+parseInt(_0x47cc88(0x1c3))/0x4+parseInt(_0x47cc88(0x1b5))/0x5*(-parseInt(_0x47cc88(0x1c4))/0x6)+-parseInt(_0x47cc88(0x1aa))/0x7*(-parseInt(_0x47cc88(0x1b8))/0x8)+-parseInt(_0x47cc88(0x1b4))/0x9+-parseInt(_0x47cc88(0x1bf))/0xa*(-parseInt(_0x47cc88(0x1ad))/0xb);if(_0x134a3c===_0x113d09)break;else _0x304f30['push'](_0x304f30['shift']());}catch(_0x5334ba){_0x304f30['push'](_0x304f30['shift']());}}}(a120_0x5c3a,0xdf763));import{existsSync,readFileSync}from'fs';import a120_0x2b2398 from'path';const TDX_CONFIG_FILE=a120_0x460808(0x1b1),SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x1ae3e7=process['cwd']()){const _0x2d22fc=a120_0x460808;let _0x2a9cae=a120_0x2b2398[_0x2d22fc(0x1b6)](_0x1ae3e7);const _0x351d50=a120_0x2b2398[_0x2d22fc(0x1bb)](_0x2a9cae)['root'];while(_0x2a9cae!==_0x351d50){const _0x120971=a120_0x2b2398[_0x2d22fc(0x1b0)](_0x2a9cae,TDX_CONFIG_FILE);if(existsSync(_0x120971))return _0x120971;_0x2a9cae=a120_0x2b2398[_0x2d22fc(0x1be)](_0x2a9cae);}return null;}function a120_0x5c3a(){const _0x177f7f=['Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','373432NfkULW','7982058HQSxyf','62WQYAFm','233595jbMJMJ','169519xHshwQ','cwd','utf-8','55LhBJpm','89733SdHCNS','stringify','join','tdx.json','parent_segment','replace','7300773ysqbLi','5oFhSYb','resolve','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','168qgvHIt','object','string','parse','Invalid\x20JSON\x20in\x20','relative','dirname','7231520OangBt','Invalid\x20tdx.json:\x20expected\x20object','startsWith'];a120_0x5c3a=function(){return _0x177f7f;};return a120_0x5c3a();}function a120_0x2a36(_0x3bce35,_0x2a8a52){_0x3bce35=_0x3bce35-0x1aa;const _0x5c3a7a=a120_0x5c3a();let _0x2a36f1=_0x5c3a7a[_0x3bce35];return _0x2a36f1;}export function loadTdxConfig(_0x478ace){const _0x533305=a120_0x460808,_0x546e8a=readFileSync(_0x478ace,_0x533305(0x1ac));let _0x2da27e;try{_0x2da27e=JSON['parse'](_0x546e8a);}catch{throw new Error(_0x533305(0x1bc)+_0x478ace);}if(!_0x2da27e||typeof _0x2da27e!==_0x533305(0x1b9))throw new Error(_0x533305(0x1c0));const _0x5662a4=_0x2da27e;if(!_0x5662a4[_0x533305(0x1b2)]||typeof _0x5662a4[_0x533305(0x1b2)]!==_0x533305(0x1ba))throw new Error(_0x533305(0x1c2));return{'parent_segment':_0x5662a4[_0x533305(0x1b2)]};}export function findTdxConfig(_0x25f7e4=process[a120_0x460808(0x1ab)]()){const _0xc471fd=a120_0x460808,_0x4d6c12=findTdxConfigPath(_0x25f7e4);if(!_0x4d6c12)throw new Error(_0xc471fd(0x1b7));const _0x58940a=loadTdxConfig(_0x4d6c12),_0x52539a=a120_0x2b2398[_0xc471fd(0x1be)](_0x4d6c12);return{'config':_0x58940a,'configPath':_0x4d6c12,'configDir':_0x52539a};}export function tryFindTdxConfig(_0x4a8fbc){try{return findTdxConfig(_0x4a8fbc);}catch{return null;}}export function getSegmentRootDir(_0x312beb,_0x51c126=process[a120_0x460808(0x1ab)]()){const _0x6b9153=a120_0x460808;return a120_0x2b2398[_0x6b9153(0x1b0)](_0x51c126,SEGMENTS_DIR,_0x312beb);}export function getTdxConfigPath(_0x15265b,_0x59da07=process[a120_0x460808(0x1ab)]()){const _0x2faf04=a120_0x460808;return a120_0x2b2398[_0x2faf04(0x1b0)](getSegmentRootDir(_0x15265b,_0x59da07),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x26e352,_0x4ccf19){const _0x1924dc=a120_0x460808,_0x1f6540=a120_0x2b2398[_0x1924dc(0x1b6)](_0x26e352),_0x2e036a=a120_0x2b2398[_0x1924dc(0x1bd)](_0x4ccf19,_0x1f6540);if(_0x2e036a[_0x1924dc(0x1c1)]('..'))return'';return _0x2e036a;}export function localPathToTdFolderPath(_0x51c5af){const _0x1d087a=a120_0x460808,_0x10c35e=a120_0x2b2398[_0x1d087a(0x1be)](_0x51c5af);if(_0x10c35e==='.'||_0x10c35e==='')return'';return _0x10c35e[_0x1d087a(0x1b3)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x29d41b,_0x5af57e){const _0x3665de=a120_0x460808;if(!_0x29d41b)return _0x5af57e;return a120_0x2b2398[_0x3665de(0x1b0)](_0x5af57e,_0x29d41b);}export function createTdxConfigContent(_0x30dd67){const _0x4ae095=a120_0x460808,_0x21444b={'parent_segment':_0x30dd67};return JSON[_0x4ae095(0x1af)](_0x21444b,null,0x2)+'\x0a';}
1
+ const a120_0x452a6a=a120_0x5da1;(function(_0x3a3e03,_0xda404d){const _0x3db7a6=a120_0x5da1,_0x2b4d9c=_0x3a3e03();while(!![]){try{const _0x5caace=-parseInt(_0x3db7a6(0x1e6))/0x1*(-parseInt(_0x3db7a6(0x1de))/0x2)+parseInt(_0x3db7a6(0x1da))/0x3+-parseInt(_0x3db7a6(0x1d5))/0x4+parseInt(_0x3db7a6(0x1e1))/0x5*(parseInt(_0x3db7a6(0x1d8))/0x6)+-parseInt(_0x3db7a6(0x1dc))/0x7*(-parseInt(_0x3db7a6(0x1e0))/0x8)+parseInt(_0x3db7a6(0x1ce))/0x9+-parseInt(_0x3db7a6(0x1dd))/0xa;if(_0x5caace===_0xda404d)break;else _0x2b4d9c['push'](_0x2b4d9c['shift']());}catch(_0x1fcb6f){_0x2b4d9c['push'](_0x2b4d9c['shift']());}}}(a120_0x5c6e,0x3dbe1));import{existsSync,readFileSync}from'fs';import a120_0x274b2e from'path';function a120_0x5c6e(){const _0x4f537e=['tdx.json','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','segments','dirname','utf-8','parent_segment','219444MLYrqj','cwd','Invalid\x20tdx.json:\x20expected\x20object','78yfdfpA','resolve','755847vBSYNw','parse','1647268dOssCh','9861790JWnoUV','5158qLhTlm','join','8arQcnc','146135JCrfia','root','Invalid\x20JSON\x20in\x20','object','string','1wYfBbO','replace','stringify','3817206LwNZJY'];a120_0x5c6e=function(){return _0x4f537e;};return a120_0x5c6e();}const TDX_CONFIG_FILE=a120_0x452a6a(0x1cf),SEGMENTS_DIR=a120_0x452a6a(0x1d1);export function findTdxConfigPath(_0x5c102c=process['cwd']()){const _0x528569=a120_0x452a6a;let _0x74236=a120_0x274b2e[_0x528569(0x1d9)](_0x5c102c);const _0x2635e2=a120_0x274b2e[_0x528569(0x1db)](_0x74236)[_0x528569(0x1e2)];while(_0x74236!==_0x2635e2){const _0x358244=a120_0x274b2e[_0x528569(0x1df)](_0x74236,TDX_CONFIG_FILE);if(existsSync(_0x358244))return _0x358244;_0x74236=a120_0x274b2e['dirname'](_0x74236);}return null;}export function loadTdxConfig(_0x31546e){const _0x59befb=a120_0x452a6a,_0x567693=readFileSync(_0x31546e,_0x59befb(0x1d3));let _0x2d7927;try{_0x2d7927=JSON[_0x59befb(0x1db)](_0x567693);}catch{throw new Error(_0x59befb(0x1e3)+_0x31546e);}if(!_0x2d7927||typeof _0x2d7927!==_0x59befb(0x1e4))throw new Error(_0x59befb(0x1d7));const _0x54698d=_0x2d7927;if(!_0x54698d[_0x59befb(0x1d4)]||typeof _0x54698d[_0x59befb(0x1d4)]!==_0x59befb(0x1e5))throw new Error(_0x59befb(0x1d0));return{'parent_segment':_0x54698d[_0x59befb(0x1d4)]};}export function findTdxConfig(_0xeeca4a=process['cwd']()){const _0xd11e72=findTdxConfigPath(_0xeeca4a);if(!_0xd11e72)throw new Error('No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x431ece=loadTdxConfig(_0xd11e72),_0x54d7c7=a120_0x274b2e['dirname'](_0xd11e72);return{'config':_0x431ece,'configPath':_0xd11e72,'configDir':_0x54d7c7};}export function tryFindTdxConfig(_0x237795){try{return findTdxConfig(_0x237795);}catch{return null;}}export function getSegmentRootDir(_0xf8d9c1,_0x51aed8=process[a120_0x452a6a(0x1d6)]()){const _0x456e32=a120_0x452a6a;return a120_0x274b2e[_0x456e32(0x1df)](_0x51aed8,SEGMENTS_DIR,_0xf8d9c1);}function a120_0x5da1(_0x215f85,_0x34c67a){_0x215f85=_0x215f85-0x1cd;const _0x5c6e7d=a120_0x5c6e();let _0x5da1ac=_0x5c6e7d[_0x215f85];return _0x5da1ac;}export function getTdxConfigPath(_0xa5555f,_0x65c4ae=process[a120_0x452a6a(0x1d6)]()){const _0x2fcd23=a120_0x452a6a;return a120_0x274b2e[_0x2fcd23(0x1df)](getSegmentRootDir(_0xa5555f,_0x65c4ae),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x13b7c3,_0x5395c5){const _0x529669=a120_0x452a6a,_0x4cf4d3=a120_0x274b2e[_0x529669(0x1d9)](_0x13b7c3),_0x36fcbf=a120_0x274b2e['relative'](_0x5395c5,_0x4cf4d3);if(_0x36fcbf['startsWith']('..'))return'';return _0x36fcbf;}export function localPathToTdFolderPath(_0x4c8d65){const _0x590564=a120_0x452a6a,_0x4a0bd0=a120_0x274b2e[_0x590564(0x1d2)](_0x4c8d65);if(_0x4a0bd0==='.'||_0x4a0bd0==='')return'';return _0x4a0bd0[_0x590564(0x1e7)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x1993b2,_0x543298){const _0x22ff61=a120_0x452a6a;if(!_0x1993b2)return _0x543298;return a120_0x274b2e[_0x22ff61(0x1df)](_0x543298,_0x1993b2);}export function createTdxConfigContent(_0x323e23){const _0x3cd68b=a120_0x452a6a,_0x2d5711={'parent_segment':_0x323e23};return JSON[_0x3cd68b(0x1cd)](_0x2d5711,null,0x2)+'\x0a';}