@treasuredata/tdx 0.25.2 → 0.25.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/mcp-command.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profile-command.js +1 -1
  28. package/dist/commands/profiles-command.js +1 -1
  29. package/dist/commands/query-command.js +1 -1
  30. package/dist/commands/schedule-command.js +1 -1
  31. package/dist/commands/segment-command.js +1 -1
  32. package/dist/commands/segment-create-command.js +1 -1
  33. package/dist/commands/segment-fields-command.js +1 -1
  34. package/dist/commands/segment-pull-command.js +1 -1
  35. package/dist/commands/segment-push-command.js +1 -1
  36. package/dist/commands/segment-update-command.js +1 -1
  37. package/dist/commands/segment-use-command.js +1 -1
  38. package/dist/commands/segment-validate-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/status-command.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/unset-command.js +1 -1
  44. package/dist/commands/use-command.d.ts.map +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/use-command.js.map +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.d.ts +16 -0
  52. package/dist/core/config.d.ts.map +1 -1
  53. package/dist/core/config.js +1 -1
  54. package/dist/core/config.js.map +1 -1
  55. package/dist/core/connection-cache.js +1 -1
  56. package/dist/core/constants.js +1 -1
  57. package/dist/core/credential-cache.js +1 -1
  58. package/dist/core/global-context.js +1 -1
  59. package/dist/core/keychain.js +1 -1
  60. package/dist/core/profile.js +1 -1
  61. package/dist/core/project-config.js +1 -1
  62. package/dist/core/session.js +1 -1
  63. package/dist/core/user-cache.js +1 -1
  64. package/dist/core/version.js +1 -1
  65. package/dist/index.js +1 -1
  66. package/dist/mcp/server.js +1 -1
  67. package/dist/mcp/tools/index.js +1 -1
  68. package/dist/mcp/tools/tdx-run.js +1 -1
  69. package/dist/mcp/tools/tdx-search.js +1 -1
  70. package/dist/mcp/utils.js +1 -1
  71. package/dist/proxy/claude-usage-tracker.js +1 -1
  72. package/dist/proxy/passthrough-server.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-factors.js +1 -1
  105. package/dist/sdk/query/index.js +1 -1
  106. package/dist/sdk/query/sql-parser.js +1 -1
  107. package/dist/sdk/schedule.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/archive-validation.js +1 -1
  133. package/dist/sdk/workflow/clone-workflow.js +1 -1
  134. package/dist/sdk/workflow/index.js +1 -1
  135. package/dist/sdk/workflow/pull-workflow.js +1 -1
  136. package/dist/sdk/workflow/push-workflow.js +1 -1
  137. package/dist/sdk/workflow/tdx-config.js +1 -1
  138. package/dist/sdk/workflow/workflow-utils.js +1 -1
  139. package/dist/test-utils/command-runner.js +1 -1
  140. package/dist/test-utils/factories.js +1 -1
  141. package/dist/test-utils/fixtures.js +1 -1
  142. package/dist/test-utils/http-mock.js +1 -1
  143. package/dist/test-utils/index.js +1 -1
  144. package/dist/utils/async.js +1 -1
  145. package/dist/utils/colors.js +1 -1
  146. package/dist/utils/diff.js +1 -1
  147. package/dist/utils/file-permissions.js +1 -1
  148. package/dist/utils/global-cache.js +1 -1
  149. package/dist/utils/json-loader.js +1 -1
  150. package/dist/utils/local-cache.js +1 -1
  151. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  152. package/dist/utils/logger/formatters/index.js +1 -1
  153. package/dist/utils/logger/handlers/console-handler.js +1 -1
  154. package/dist/utils/logger/handlers/file-handler.js +1 -1
  155. package/dist/utils/logger/handlers/index.js +1 -1
  156. package/dist/utils/logger/handlers/null-handler.js +1 -1
  157. package/dist/utils/logger/index.js +1 -1
  158. package/dist/utils/logger/logger.js +1 -1
  159. package/dist/utils/logger/types.js +1 -1
  160. package/dist/utils/option-validation.js +1 -1
  161. package/dist/utils/port.js +1 -1
  162. package/dist/utils/process.js +1 -1
  163. package/dist/utils/prompt.js +1 -1
  164. package/dist/utils/spinner.js +1 -1
  165. package/dist/utils/sse-parser.js +1 -1
  166. package/dist/utils/string-utils.js +1 -1
  167. package/dist/utils/table-ref-parser.js +1 -1
  168. package/dist/utils/tdx-logger.js +1 -1
  169. package/dist/utils/version-check.d.ts +4 -1
  170. package/dist/utils/version-check.d.ts.map +1 -1
  171. package/dist/utils/version-check.js +1 -1
  172. package/dist/utils/version-check.js.map +1 -1
  173. package/package.json +2 -1
@@ -1 +1 @@
1
- const a110_0x4accd9=a110_0x574b;(function(_0x25f1eb,_0x5a958c){const _0x2c5da7=a110_0x574b,_0x4a0166=_0x25f1eb();while(!![]){try{const _0x44a6c1=-parseInt(_0x2c5da7(0xd4))/0x1+parseInt(_0x2c5da7(0x15e))/0x2*(parseInt(_0x2c5da7(0xe1))/0x3)+parseInt(_0x2c5da7(0x123))/0x4*(-parseInt(_0x2c5da7(0x133))/0x5)+-parseInt(_0x2c5da7(0x1a8))/0x6+-parseInt(_0x2c5da7(0x136))/0x7*(parseInt(_0x2c5da7(0xf2))/0x8)+-parseInt(_0x2c5da7(0x17e))/0x9+parseInt(_0x2c5da7(0x156))/0xa*(parseInt(_0x2c5da7(0x14f))/0xb);if(_0x44a6c1===_0x5a958c)break;else _0x4a0166['push'](_0x4a0166['shift']());}catch(_0x2c5d36){_0x4a0166['push'](_0x4a0166['shift']());}}}(a110_0xff5c,0x7e5d9));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a110_0x4accd9(0x189);export const PENDING_ACTIVATION_PREFIX=a110_0x4accd9(0x198);export function createPendingSegmentId(_0x447cec){return''+PENDING_SEGMENT_PREFIX+_0x447cec+'__';}export function isPendingSegmentId(_0x1ce24a){const _0x35d25f=a110_0x4accd9;return _0x1ce24a[_0x35d25f(0xf7)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x68e7ac){return _0x68e7ac['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x56bb5b){return''+PENDING_ACTIVATION_PREFIX+_0x56bb5b+'__';}export function isPendingActivationId(_0x466e9f){const _0x3aea46=a110_0x4accd9;return _0x466e9f[_0x3aea46(0xf7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x331501){const _0x55866b=a110_0x4accd9;return _0x331501[_0x55866b(0x101)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x4b654e,_0x16fb8d){const _0x3073d3=a110_0x4accd9,_0x588de0=_0x4b654e+'::'+(_0x16fb8d[_0x3073d3(0x129)]()||_0x3073d3(0xe6)),_0x1e7159=createHash('sha1')[_0x3073d3(0x14e)](_0x588de0)[_0x3073d3(0x120)](_0x3073d3(0x11f))['slice'](0x0,0xc);return _0x3073d3(0xef)+_0x1e7159;}export function ensureJourneyDefaults(_0x36c9bc){const _0x1ea07a=a110_0x4accd9;!_0x36c9bc[_0x1ea07a(0x1ae)]&&(_0x36c9bc[_0x1ea07a(0x1ae)]=''),!_0x36c9bc[_0x1ea07a(0xfb)]&&(_0x36c9bc['state']=_0x1ea07a(0xde));}export function resolveTDFolderPath(_0x270670,_0xa22085,_0x5baf50){const _0xbb13cc=a110_0x4accd9;if(!_0xa22085)return _0x270670;if(_0x270670===_0x5baf50||_0x270670[_0xbb13cc(0xf7)](_0x5baf50+'/'))return _0x270670;return _0x270670?_0x5baf50+'/'+_0x270670:_0x5baf50;}export function addFoldersToCreate(_0x71b8f2,_0x4bcba5,_0x20e905){const _0x38c88d=a110_0x4accd9;if(!_0x71b8f2)return;if(_0x4bcba5[_0x38c88d(0x121)](_0x71b8f2))return;const _0x4544a4=_0x71b8f2[_0x38c88d(0x1a4)]('/');let _0x198aa3='';for(const _0x34c725 of _0x4544a4){_0x198aa3=_0x198aa3?_0x198aa3+'/'+_0x34c725:_0x34c725,!_0x4bcba5[_0x38c88d(0x121)](_0x198aa3)&&_0x20e905[_0x38c88d(0x18a)](_0x198aa3);}}import*as a110_0x4fe816 from'yaml';import{readFileSync}from'fs';import a110_0x32e708 from'path';import{isJourneyDef,parseYamlString as a110_0x29d79d,toYamlString as a110_0x305637,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(_0x3acdec){const _0x3911c5=a110_0x4accd9;if(Array[_0x3911c5(0xfc)](_0x3acdec))return'['+_0x3acdec[_0x3911c5(0x190)](_0x5206f9=>stableStringify(_0x5206f9))[_0x3911c5(0x1a7)](',')+']';if(_0x3acdec&&typeof _0x3acdec==='object'){const _0x15ae70=_0x3acdec,_0x30c891=Object[_0x3911c5(0x117)](_0x15ae70)[_0x3911c5(0xcc)](),_0x22af2b=_0x30c891['map'](_0x2ee51c=>'\x22'+_0x2ee51c+'\x22:'+stableStringify(_0x15ae70[_0x2ee51c]));return'{'+_0x22af2b['join'](',')+'}';}const _0x21d02d=JSON[_0x3911c5(0x14a)](_0x3acdec);return _0x21d02d===undefined?_0x3911c5(0x100):_0x21d02d;}function a110_0xff5c(){const _0x2f2e37=['idToEmailMap','action','create','existingJourney','embedded_activation_created','logDeleted','sort','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','journeyBundleName','updateActivation','set','type','createdSegmentId','activations','975478VSxTqA','relative','created','attributes','Updating\x20activation\x20\x27','from','\x27\x20not\x20found\x20in\x20journey\x20\x27','yamlConfig','journeyActivationStepId','NOT_FOUND','draft','activationActions','\x20activation\x20\x27','114SwaSoG','connectionIdToNameMap','results','idToName','getActivation','segment','folderId','\x27\x20decision\x20point\x20branch\x20\x27','logWarning','createActivation','connector_config','activation_template_id','createSegment','\x27...','journey_entry_criteria_','find','journeyBundlesByFolderAndName','1442632BkzGqW','valid','Creating\x20activation\x20\x27','resolveJourneyId','embedded_segment_created','startsWith','journey_created','\x0a\x20\x20','segmentByFolderAndName','state','isArray','Created\x20segment\x20\x27','toString','flatMap','null','replace','stage\x20\x27','journey_creating','activation_deleted','segment_creating','unchanged','segmentId','activationsBySegmentId','Updated\x20segment\x20\x27','absolutePath','Deleting\x20activation\x20\x27','kind','onProgress','Updated\x20activation\x20\x27','\x20journey\x20from\x20file:\x20','Journey\x20\x27','parentSegmentFolder','all','deleted','activation_updating','folderPathToId','WaitStep','keys','ACTIVATION_UPDATE_ERROR','segmentFolderId','steps','max','yamlActivation','parentFolder','segmentNameToId','hex','digest','has','Created\x20journey\x20\x27','581304LhKhnu','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','deps','waitCondition','Activation','INTERNAL','trim','values','embeddedSegmentNameToId','fetchJourney','push','diff','SEGMENT_UPDATE_ERROR','Updated\x20journey\x20\x27','getSegment','parse','25dfMEeR','activation_creating','deleteActivation','21rDUCiV','nameToId','Segment\x20not\x20found:\x20','parseDocument','activation_created','createdSegmentIds','JOURNEY_SYNTAX_ERROR','dirname','SEGMENT_NOT_FOUND','parentId','entry_criteria','Activation\x20not\x20found:\x20','getJourney','decision_point','columns','stages','withProgress','name','journeyById','hasChanges','stringify','skipSegments','versionNumber','activationParams','update','11WoxUuR','embedded_segment_creating','Created\x20folder\x20\x27','segment_deleting','all_columns','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','34026360hvHhyw','effectiveFolderId','logSuccess','user','data','Updating\x20segment\x20\x27','branches','goal','21286YKitFp','listSegments','isNew','length','localSegmentRules','Stage\x20\x27','utf-8','goal\x20criteria','journeyStages','Failed\x20to\x20','segment_deleted','updated','notification','journeys','activationStepsById','folderPath','./child-segment-yaml.js','rootFolderId','schedule','deleteSegment','existingSegments','existingSegment','Name\x20has\x20already\x20been\x20taken','createJourneySegment','\x20segment\x20from\x20file:\x20','milestone','updateSegmentById','slice','filter','relationships','\x27\x20milestone','logInfo','5629293oxJpBD','entryCriteria','entry','Entry\x20criteria:\x20','exitCriterias','activationContext',').\x20','message','journey','existingActivation','activation_deleting','__pending_','add','listActivations','rule','folder_creating','list','journey_updating','map','./journey-yaml.js','../../utils/async.js','segments','\x27\x20wait\x20condition','\x20(referenced\x20in\x20journey\x20','with','folder','__pending_act_','resolveSegment','SEGMENT_SYNTAX_ERROR','get','index','progress','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','toLowerCase','Creating\x20segment\x20\x27','\x20error(s)','\x27\x20exit\x20criteria','connection','split','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','createFolder','join','2525430yFZRpB','Creating\x20folder\x20\x27','delete','size','validatedRequest','behavior','description','\x27\x20from\x20file:\x20','Fetching\x20','DecisionPoint','activation_updated'];a110_0xff5c=function(){return _0x2f2e37;};return a110_0xff5c();}function activationSignature(_0x3ba547){const _0x5081ff=a110_0x4accd9,_0x1cd047={'connection':_0x3ba547[_0x5081ff(0x1a3)],..._0x3ba547['all_columns']!==undefined&&{'all_columns':_0x3ba547[_0x5081ff(0x153)]},..._0x3ba547[_0x5081ff(0x144)]!==undefined&&{'columns':_0x3ba547['columns']},..._0x3ba547['behavior']!==undefined&&{'behavior':_0x3ba547[_0x5081ff(0x1ad)]},..._0x3ba547['schedule']!==undefined&&{'schedule':_0x3ba547[_0x5081ff(0x170)]},..._0x3ba547[_0x5081ff(0x16a)]!==undefined&&{'notification':_0x3ba547[_0x5081ff(0x16a)]},..._0x3ba547[_0x5081ff(0xeb)]!==undefined&&{'connector_config':_0x3ba547[_0x5081ff(0xeb)]},..._0x3ba547[_0x5081ff(0xec)]!==undefined&&{'activation_template_id':_0x3ba547['activation_template_id']}};return stableStringify(_0x1cd047);}export async function prepareSegmentFiles(_0x230e4d,_0x3d2673,_0x3864af,_0x386e6d,_0x59f3ef){const _0x5ed39c=a110_0x4accd9,{activationDefToCreateRequest:_0x19840a}=await import(_0x5ed39c(0x16e)),_0x2675cf=[],_0x3a3ab3=new Set();for(const {yamlConfig:_0x264a69,folderPath:_0x79d61a,sourcePath:_0x2d6568}of _0x230e4d){const _0x6f8df=resolveTDFolderPath(_0x79d61a,_0x386e6d,_0x59f3ef),_0x4b7489=_0x6f8df+':'+_0x264a69['name'],_0xfc5fc9=_0x3d2673[_0x5ed39c(0xfa)][_0x5ed39c(0x19b)](_0x4b7489),_0x2bb43e=_0xfc5fc9?_0x3d2673[_0x5ed39c(0x108)][_0x5ed39c(0x19b)](_0xfc5fc9['id'])||[]:[];addFoldersToCreate(_0x6f8df,_0x3d2673['folderPathToId'],_0x3a3ab3);const _0x4f3c45=calculateActivationActions(_0x264a69[_0x5ed39c(0xd3)]||[],_0x2bb43e,_0x3d2673[_0x5ed39c(0x1b3)],_0x3d2673[_0x5ed39c(0xe2)]);for(const _0x1384a7 of _0x4f3c45){(_0x1384a7[_0x5ed39c(0xd1)]===_0x5ed39c(0x1b5)||_0x1384a7[_0x5ed39c(0xd1)]==='update')&&_0x1384a7[_0x5ed39c(0x11c)]&&(_0x1384a7[_0x5ed39c(0x1ac)]=await _0x19840a(_0x1384a7[_0x5ed39c(0x11c)],_0x3864af));}const _0x2b73e4=calculateSegmentDiff(_0x264a69,_0xfc5fc9,_0x2bb43e,_0x3d2673[_0x5ed39c(0x1b3)],_0x3d2673[_0x5ed39c(0xe2)]);_0x2675cf[_0x5ed39c(0x12d)]({'relativePath':_0x264a69['name'],'absolutePath':_0x2d6568,'yamlConfig':_0x264a69,'folderPath':_0x6f8df,'existingSegment':_0xfc5fc9,'existingActivations':_0x2bb43e,'isNew':_0x2b73e4[_0x5ed39c(0x160)],'hasChanges':_0x2b73e4[_0x5ed39c(0x149)],'diff':_0x2b73e4['diff'],'activationActions':_0x4f3c45});}return{'segmentFiles':_0x2675cf,'foldersToCreate':_0x3a3ab3};}export async function prepareJourneyFiles(_0x595090,_0x352604,_0xef2785,_0x3592be){const _0x9cd071=a110_0x4accd9,_0x4a95e0=[],_0x1d1c5b=new Set();for(const {yamlConfig:_0x45ff51,folderPath:_0x3f0579,sourcePath:_0x205844}of _0x595090){const _0x694bf6=resolveTDFolderPath(_0x3f0579,_0xef2785,_0x3592be),_0x405588=_0x694bf6+':'+_0x45ff51[_0x9cd071(0x147)],_0x42ae9a=_0x352604[_0x9cd071(0xf1)][_0x9cd071(0x19b)](_0x405588);let _0x27430f,_0x436abe;if(_0x42ae9a&&_0x42ae9a[_0x9cd071(0x161)]>0x0){const _0x5a8d73=buildLocalExpandedRuleMappings(_0x45ff51),{createYamlContext:_0x1587da,prefetchJourneySegments:_0x4de2a5}=createPushYamlContextForBundle(_0x352604[_0x9cd071(0x125)],_0x352604[_0x9cd071(0x13f)],_0x352604[_0x9cd071(0x172)],_0x5a8d73,_0x352604[_0x9cd071(0x1b3)],_0x352604[_0x9cd071(0xe2)],_0x352604[_0x9cd071(0x16c)],_0x352604[_0x9cd071(0x148)]);await _0x4de2a5(_0x42ae9a[_0x9cd071(0x190)](_0x27ed4a=>_0x27ed4a['id']));const _0x3800ab=hasMultipleVersions(_0x45ff51),_0x24296f=async _0x524e63=>{const _0x158b50=_0x9cd071,_0x4cfc9a=_0x352604[_0x158b50(0x148)]?.['get'](_0x524e63);if(_0x4cfc9a)return _0x4cfc9a;return _0x352604[_0x158b50(0x12c)]({'journeyId':_0x524e63,'journeyName':_0x45ff51['name'],'isMultiVersion':_0x42ae9a[_0x158b50(0x161)]>0x1});};if(_0x3800ab&&_0x42ae9a[_0x9cd071(0x161)]>0x1){const _0x1227e9=[];for(const _0x5a7552 of _0x42ae9a){const _0x4ccd8b=_0x5a7552[_0x9cd071(0x14c)]||0x1;_0x352604['progress']?.['update'](_0x9cd071(0x1b0)+_0x45ff51[_0x9cd071(0x147)]+'\x20v'+_0x4ccd8b);const _0x2d46e1=await _0x24296f(_0x5a7552['id']),_0x1072f0=_0x1587da(_0x5a7552['id']),_0x206c1a=await journeyResponseToDef(_0x2d46e1,_0x1072f0);_0x1227e9['push']({'item':_0x5a7552,'yaml':_0x206c1a});}const _0x183467=buildLocalRuleToNameMappingFromJourney(_0x45ff51);_0x436abe=buildMergedJourneyDef(_0x1227e9,_0x183467);const _0x4d6433=Math[_0x9cd071(0x11b)](..._0x1227e9['map'](_0x34e1f8=>_0x34e1f8['item'][_0x9cd071(0x14c)]||0x0)),_0x46feb0=_0x42ae9a['find'](_0x40d110=>(_0x40d110[_0x9cd071(0x14c)]||0x0)===_0x4d6433);_0x46feb0&&(_0x352604[_0x9cd071(0x19d)]?.['update'](_0x9cd071(0x1b0)+_0x45ff51[_0x9cd071(0x147)]+'\x20v'+_0x4d6433),_0x27430f=await _0x24296f(_0x46feb0['id']));}else{const _0x1dcfae=_0x42ae9a[_0x42ae9a[_0x9cd071(0x161)]-0x1];_0x352604[_0x9cd071(0x19d)]?.[_0x9cd071(0x14e)]('Fetching\x20'+_0x45ff51[_0x9cd071(0x147)]),_0x27430f=await _0x24296f(_0x1dcfae['id']);const _0x4811d3=_0x1587da(_0x1dcfae['id']),_0x592765=await journeyResponseToDef(_0x27430f,_0x4811d3),_0x18e460=buildLocalRuleToNameMappingFromJourney(_0x45ff51);_0x436abe=buildMergedJourneyDef([{'item':_0x1dcfae,'yaml':_0x592765}],_0x18e460);}}addFoldersToCreate(_0x694bf6,_0x352604[_0x9cd071(0x115)],_0x1d1c5b);const _0x9c0622=calculateJourneyDiff(_0x45ff51,_0x436abe);_0x4a95e0[_0x9cd071(0x12d)]({'relativePath':_0x45ff51['name'],'absolutePath':_0x205844,'yamlConfig':_0x45ff51,'folderPath':_0x694bf6,'existingJourney':_0x27430f,'isNew':_0x9c0622['isNew'],'hasChanges':_0x9c0622[_0x9cd071(0x149)],'diff':_0x9c0622[_0x9cd071(0x12e)]});}return{'journeyFiles':_0x4a95e0,'foldersToCreate':_0x1d1c5b};}export function calculateActivationActions(_0x4e6b1e,_0x234243,_0x5c997c,_0x5763a2){const _0x1a0fb6=a110_0x4accd9,_0x449daa=[],_0x574de2=new Map();for(const _0x4fc86c of _0x234243){_0x574de2[_0x1a0fb6(0xd0)](_0x4fc86c['name'],_0x4fc86c);}const _0x420c63=new Map();for(const _0x1183a6 of _0x4e6b1e){_0x420c63['set'](_0x1183a6[_0x1a0fb6(0x147)],_0x1183a6);}for(const _0x242899 of _0x4e6b1e){const _0x31da99=_0x574de2['get'](_0x242899[_0x1a0fb6(0x147)]);if(!_0x31da99)_0x449daa[_0x1a0fb6(0x12d)]({'type':_0x1a0fb6(0x1b5),'name':_0x242899[_0x1a0fb6(0x147)],'yamlActivation':_0x242899});else{const _0xb8cc83=activationResponseToDef(_0x31da99,_0x5c997c,_0x5763a2),_0x345372=a110_0x4fe816[_0x1a0fb6(0x14a)](_0xb8cc83),_0x3a5a35=a110_0x4fe816[_0x1a0fb6(0x14a)](_0x242899);_0x345372!==_0x3a5a35&&_0x449daa[_0x1a0fb6(0x12d)]({'type':_0x1a0fb6(0x14e),'name':_0x242899[_0x1a0fb6(0x147)],'yamlActivation':_0x242899,'existingActivation':_0x31da99});}}for(const _0x1ba29a of _0x234243){!_0x420c63[_0x1a0fb6(0x121)](_0x1ba29a[_0x1a0fb6(0x147)])&&_0x449daa['push']({'type':'delete','name':_0x1ba29a[_0x1a0fb6(0x147)],'existingActivation':_0x1ba29a});}return _0x449daa;}export function calculateSegmentDiff(_0x42d4d7,_0x3d7e97,_0x3b7cd6,_0x1e5ebb,_0xd4866a){const _0x2d7be5=segmentToYamlString(_0x42d4d7);if(_0x3d7e97){const _0x5cc811=segmentWithActivationsToYaml(_0x3d7e97,_0x3b7cd6,undefined,_0x1e5ebb,_0xd4866a),_0x24abb6=segmentToYamlString(_0x5cc811),_0x5d22bb=generateDiff(_0x24abb6,_0x2d7be5),_0x5be215=hasChanges(_0x5d22bb);return{'isNew':![],'hasChanges':_0x5be215,'diff':_0x5be215?formatDiffWithColors(_0x5d22bb):undefined};}const _0x24e5e5=generateDiff('',_0x2d7be5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x24e5e5)};}export function calculateJourneyDiff(_0x292f0b,_0x4a4b2b){const _0x18f990=normalizeJourneyDef(_0x292f0b,_0x292f0b),_0x316416=a110_0x305637(_0x18f990);if(_0x4a4b2b){const _0x5eb790=normalizeJourneyDef(_0x4a4b2b,_0x292f0b),_0x365383=a110_0x305637(_0x5eb790),_0x1b6e6f=generateDiff(_0x365383,_0x316416),_0x991138=hasChanges(_0x1b6e6f);return{'isNew':![],'hasChanges':_0x991138,'diff':_0x991138?formatDiffWithColors(_0x1b6e6f):undefined};}const _0x2d70e5=generateDiff('',_0x316416);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2d70e5)};}export function findSegmentsToDelete(_0x430436,_0x49f173,_0x3d04ed,_0x44b35c,_0x24556a){const _0x28cf98=a110_0x4accd9,_0x49cf3e=new Set();for(const {yamlConfig:_0x3c41ca,folderPath:_0x25bebe}of _0x49f173){_0x49cf3e['add'](_0x25bebe+':'+_0x3c41ca[_0x28cf98(0x147)]);}return _0x430436[_0x28cf98(0x17a)](_0x5edf06=>{const _0x35309f=_0x28cf98,_0x2020d7=_0x5edf06['segmentFolderId']?_0x3d04ed['get'](_0x5edf06[_0x35309f(0x119)][_0x35309f(0xfe)]())||'':'',_0x1d2b84=_0x2020d7+':'+_0x5edf06[_0x35309f(0x147)];if(_0x49cf3e[_0x35309f(0x121)](_0x1d2b84))return![];if(_0x24556a)return _0x2020d7===_0x44b35c||_0x2020d7[_0x35309f(0xf7)](_0x44b35c+'/');return!![];});}export function findJourneysToDelete(_0xea42ed,_0x5d8170,_0x42ba99,_0x35d580,_0x54b4c6){const _0xc08d4=a110_0x4accd9,_0x3ec376=new Set();for(const {yamlConfig:_0x2ead91,folderPath:_0x57b459}of _0x5d8170){_0x3ec376[_0xc08d4(0x18a)](_0x57b459+':'+_0x2ead91[_0xc08d4(0x147)]);}return _0xea42ed[_0xc08d4(0x17a)](_0x52fb0b=>{const _0x519eb1=_0xc08d4,_0x1557b8=_0x52fb0b[_0x519eb1(0xe7)]?_0x42ba99['get'](_0x52fb0b[_0x519eb1(0xe7)])||'':'',_0x423a7a=_0x1557b8+':'+_0x52fb0b[_0x519eb1(0xce)];if(_0x3ec376['has'](_0x423a7a))return![];if(_0x54b4c6)return _0x1557b8===_0x35d580||_0x1557b8[_0x519eb1(0xf7)](_0x35d580+'/');return!![];});}export function buildSegmentLookupMap(_0x5acb82,_0x28c937){const _0x7e33e6=a110_0x4accd9,_0x9bc7e4=new Map();for(const _0x321883 of _0x5acb82){const _0x1f9ffc=_0x321883['segmentFolderId']?_0x28c937['get'](_0x321883[_0x7e33e6(0x119)][_0x7e33e6(0xfe)]())||'':'',_0x4d244e=_0x1f9ffc+':'+_0x321883[_0x7e33e6(0x147)];_0x9bc7e4[_0x7e33e6(0xd0)](_0x4d244e,_0x321883);}return _0x9bc7e4;}export function buildSegmentNameToIdMap(_0x1e6562){const _0x8f7c7f=a110_0x4accd9,_0x33b0e7=new Map();for(const _0x4e1143 of _0x1e6562){_0x33b0e7[_0x8f7c7f(0xd0)](_0x4e1143['name'],_0x4e1143['id']);}return _0x33b0e7;}export function buildJourneyBundleLookupMap(_0x2a85d7,_0x1aac5d){const _0x22e101=a110_0x4accd9,_0x10fbe8=new Map();for(const _0x3c4c40 of _0x2a85d7){const _0x7aa4b1=_0x3c4c40[_0x22e101(0xe7)]?_0x1aac5d[_0x22e101(0x19b)](_0x3c4c40[_0x22e101(0xe7)])||'':'',_0x2e0717=_0x7aa4b1+':'+_0x3c4c40[_0x22e101(0xce)];!_0x10fbe8['has'](_0x2e0717)&&_0x10fbe8[_0x22e101(0xd0)](_0x2e0717,[]),_0x10fbe8[_0x22e101(0x19b)](_0x2e0717)[_0x22e101(0x12d)](_0x3c4c40);}for(const _0x4f96d4 of _0x10fbe8[_0x22e101(0x12a)]()){_0x4f96d4['sort']((_0x261543,_0x1a7be8)=>(_0x261543['versionNumber']||0x0)-(_0x1a7be8[_0x22e101(0x14c)]||0x0));}return _0x10fbe8;}export function collectFoldersToCreate(_0x2bb290,_0x6b3e42){const _0x194736=a110_0x4accd9,_0x4ea2d1=new Set();for(const _0x7e14e4 of _0x2bb290){if(!_0x7e14e4)continue;if(_0x6b3e42[_0x194736(0x121)](_0x7e14e4))continue;const _0x47d8d7=_0x7e14e4[_0x194736(0x1a4)]('/');let _0x5b4ee8='';for(const _0x23d55d of _0x47d8d7){_0x5b4ee8=_0x5b4ee8?_0x5b4ee8+'/'+_0x23d55d:_0x23d55d,!_0x6b3e42[_0x194736(0x121)](_0x5b4ee8)&&_0x4ea2d1[_0x194736(0x18a)](_0x5b4ee8);}}return _0x4ea2d1;}export function parseAndClassifyYamlFiles(_0x10dedd,_0x54d6a4,_0x1e1062){const _0x3b0def=a110_0x4accd9,_0x27ce93=[],_0x4c439d=[];for(const _0x1402ae of _0x10dedd){const _0x4082cd=a110_0x32e708['relative'](_0x54d6a4,a110_0x32e708[_0x3b0def(0x13d)](_0x1402ae)),_0x2a4b6a=_0x4082cd==='.'?'':_0x4082cd,_0x4aa8f7=readFileSync(_0x1402ae,_0x3b0def(0x164)),_0x31dfb9=a110_0x4fe816[_0x3b0def(0x132)](_0x4aa8f7);if(isJourneyDef(_0x31dfb9)){const _0x5aeef0=a110_0x29d79d(_0x4aa8f7);_0x4c439d[_0x3b0def(0x12d)]({'yamlConfig':_0x5aeef0,'folderPath':_0x2a4b6a,'sourcePath':_0x1402ae});}else{if(!_0x1e1062?.[_0x3b0def(0x14b)]){const _0x306484=parseSegmentYamlFile(_0x4aa8f7),_0x9d176e=normalizeChildSegmentYaml(_0x306484);_0x27ce93[_0x3b0def(0x12d)]({'yamlConfig':_0x9d176e,'folderPath':_0x2a4b6a,'sourcePath':_0x1402ae});}}}return{'segments':_0x27ce93,'journeys':_0x4c439d};}export function validateParsedFiles(_0xde4155,_0x5305ae){const _0x2b8836=a110_0x4accd9,_0x550d4f=[];for(const {yamlConfig:_0x1f26b7,sourcePath:_0x10804e}of _0xde4155[_0x2b8836(0x193)]){const _0x5817fd=readFileSync(_0x10804e,'utf-8'),_0x528f38=a110_0x4fe816[_0x2b8836(0x139)](_0x5817fd),_0x259e03=validateSegmentDef(_0x1f26b7,{'source':_0x5817fd,'document':_0x528f38});if(!_0x259e03[_0x2b8836(0xf3)]){const _0xab5f8d=a110_0x32e708['relative'](_0x5305ae,_0x10804e);_0x550d4f[_0x2b8836(0x12d)]({'filePath':_0xab5f8d,'source':_0x5817fd,'result':_0x259e03,'isJourney':![]});}}for(const {yamlConfig:_0x4a26dc,sourcePath:_0xf1936e}of _0xde4155[_0x2b8836(0x16b)]){const _0x110f72=readFileSync(_0xf1936e,'utf-8'),_0x1138b9=a110_0x4fe816['parseDocument'](_0x110f72),_0x4a1c23=validateJourneyDef(_0x4a26dc,{'source':_0x110f72,'document':_0x1138b9});if(!_0x4a1c23['valid']){const _0x4116b6=a110_0x32e708[_0x2b8836(0xd5)](_0x5305ae,_0xf1936e);_0x550d4f[_0x2b8836(0x12d)]({'filePath':_0x4116b6,'source':_0x110f72,'result':_0x4a1c23,'isJourney':!![]});}}return _0x550d4f;}export function formatValidationErrors(_0x41c61d){const _0x301b68=a110_0x4accd9,_0xd533cf=[];for(const {filePath:_0x2576da,source:_0x4df972,result:_0x455d59,isJourney:_0x39a1bf}of _0x41c61d){const _0x291e00=_0x39a1bf?_0x301b68(0x186):'segment';_0xd533cf[_0x301b68(0x12d)]('\x0a'+_0x2576da+'\x20('+_0x291e00+'):\x20'+_0x455d59['errors'][_0x301b68(0x161)]+_0x301b68(0x1a1)),_0xd533cf[_0x301b68(0x12d)](formatValidationResult(_0x455d59,_0x4df972,_0x2576da));}return _0xd533cf[_0x301b68(0x1a7)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x342a22){const _0xbbb011=a110_0x4accd9,_0x106bb6=new Set(),_0x96e67b=new Map(),_0x44c372=collectSegmentUsageCounts(_0x342a22);if(_0x342a22[_0xbbb011(0x193)])for(const [_0x57d4e4,_0x3dce0b]of Object['entries'](_0x342a22[_0xbbb011(0x193)])){_0x106bb6[_0xbbb011(0x18a)](_0x57d4e4);if(_0x3dce0b[_0xbbb011(0x18c)]){const _0x48c032=yamlRuleToApi(_0x3dce0b[_0xbbb011(0x18c)]),_0x14d1ab=apiRuleToYaml(_0x48c032);_0x96e67b['set'](_0x57d4e4,_0x14d1ab);}}const _0x306b22=new Map();let _0xde0f5=0x0;for(const [_0x4d0f1d,_0x26fa1c]of _0x96e67b){const _0x74ea04=serializeExpandedRule(_0x26fa1c,_0x96e67b),_0x6b34c3=_0x306b22[_0xbbb011(0x19b)](_0x74ea04)||[];_0x6b34c3[_0xbbb011(0x12d)]({'name':_0x4d0f1d,'index':_0xde0f5}),_0x306b22['set'](_0x74ea04,_0x6b34c3),_0xde0f5++;}const _0xb04fff=new Map();for(const [_0x5efc5f,_0x5935df]of _0x306b22){const _0x45ebdf=_0x5935df['slice']()['sort']((_0x48517f,_0xd70a)=>{const _0x47d739=_0xbbb011,_0x143c1b=_0x44c372[_0x47d739(0x19b)](_0x48517f[_0x47d739(0x147)])||0x0,_0x4c4433=_0x44c372['get'](_0xd70a['name'])||0x0;if(_0x143c1b!==_0x4c4433)return _0x4c4433-_0x143c1b;return _0x48517f[_0x47d739(0x19c)]-_0xd70a['index'];})[_0xbbb011(0x190)](_0x59ecf7=>_0x59ecf7[_0xbbb011(0x147)]),_0x663230=[];for(const _0xac6716 of _0x45ebdf){const _0x30fd64=_0x44c372[_0xbbb011(0x19b)](_0xac6716)||0x0,_0x501f08=Math[_0xbbb011(0x11b)](_0x30fd64,0x1);for(let _0x2b1f3a=0x0;_0x2b1f3a<_0x501f08;_0x2b1f3a++){_0x663230[_0xbbb011(0x12d)](_0xac6716);}}_0xb04fff[_0xbbb011(0xd0)](_0x5efc5f,_0x663230);}return{'existingLocalSegmentNames':_0x106bb6,'localSegmentRules':_0x96e67b,'localExpandedRuleToNames':_0xb04fff};}async function buildServerSegmentRuleMap(_0x518887,_0x280c0e,_0x21d2cc,_0x30a694){const _0x22cbb7=new Map(),_0x192f01=new Set(),_0x4b9330=async _0x3e2520=>{const _0x3054de=a110_0x574b;if(_0x192f01['has'](_0x3e2520))return;_0x192f01['add'](_0x3e2520);let _0x160758=_0x21d2cc[_0x3054de(0xf0)](_0xe777bf=>_0xe777bf['id']===_0x3e2520);if(!_0x160758)try{_0x160758=await _0x518887[_0x3054de(0xe6)][_0x3054de(0x131)](_0x280c0e,_0x3e2520);}catch{return;}if(!_0x160758?.[_0x3054de(0x18c)])return;const _0x358119=apiRuleToYaml(_0x160758[_0x3054de(0x18c)]);_0x22cbb7[_0x3054de(0xd0)](_0x3e2520,_0x358119);const _0x92ed47=collectSegmentRefsFromRule(_0x358119);for(const _0x32a262 of _0x92ed47){await _0x4b9330(_0x32a262);}};for(const _0x108f4e of _0x30a694){await _0x4b9330(_0x108f4e);}return _0x22cbb7;}export function createSegmentIdResolver(_0x5b08e6,_0x23cf35){return async _0xc76ebb=>{const _0x6c2b70=a110_0x574b,_0xcc1adc=_0x5b08e6[_0x6c2b70(0x19b)](_0xc76ebb);if(!_0xcc1adc)throw new SDKError(ErrorCode[_0x6c2b70(0x13e)],_0x6c2b70(0x138)+_0xc76ebb+_0x6c2b70(0x124)+_0x23cf35+'\x27)');return _0xcc1adc;};}export function extractRootFolderId(_0x4e0f19){const _0x1321b=a110_0x4accd9;return _0x4e0f19[_0x1321b(0x17b)]?.[_0x1321b(0x111)]?.['data']?.['id']||_0x4e0f19['relationships']?.[_0x1321b(0x11d)]?.['data']?.['id'];}export function buildConnectionMaps(_0xaaf584){const _0x121205=a110_0x4accd9,_0x1ba1f4=new Map(),_0xfff451=new Map(),_0x16c782=new Map();for(const _0x5b1f99 of _0xaaf584){_0x1ba1f4[_0x121205(0xd0)](_0x5b1f99[_0x121205(0x147)],parseInt(_0x5b1f99['id'],0xa)),_0xfff451['set'](_0x5b1f99['id'],_0x5b1f99[_0x121205(0x147)]),_0x16c782[_0x121205(0xd0)](_0x5b1f99[_0x121205(0x147)],_0x5b1f99['type']);}return{'nameToId':_0x1ba1f4,'idToName':_0xfff451,'nameToType':_0x16c782};}export function calculatePushStats(_0x5e8c7b,_0x4b736e,_0x242472,_0x3dded8,_0x4e020a,_0x470c13,_0x4ab999){const _0x34f16b=a110_0x4accd9,_0x5c7ec2=_0x5e8c7b[_0x34f16b(0x17a)](_0x1752c8=>_0x1752c8[_0x34f16b(0x160)]),_0x34816b=_0x5e8c7b[_0x34f16b(0x17a)](_0x1ac205=>!_0x1ac205['isNew']&&_0x1ac205[_0x34f16b(0x149)]),_0x5ba285=_0x5e8c7b['filter'](_0x219642=>!_0x219642[_0x34f16b(0x160)]&&!_0x219642['hasChanges']),_0x7db320=_0x470c13?_0x3dded8:[],_0x4cf355=_0x4b736e[_0x34f16b(0x17a)](_0xa3e380=>_0xa3e380[_0x34f16b(0x160)]),_0x2a5b9d=_0x4b736e['filter'](_0x5e84d8=>!_0x5e84d8[_0x34f16b(0x160)]&&_0x5e84d8[_0x34f16b(0x149)]),_0x4d23c2=_0x4b736e[_0x34f16b(0x17a)](_0x180f0b=>!_0x180f0b['isNew']&&!_0x180f0b[_0x34f16b(0x149)]),_0x8f8812=_0x470c13?_0x4e020a:[],_0x35bcac=_0x5e8c7b[_0x34f16b(0xff)](_0x3cb1c5=>_0x3cb1c5[_0x34f16b(0xdf)]),_0x2fcb99=_0x35bcac[_0x34f16b(0x17a)](_0x5cf375=>_0x5cf375['type']==='create'),_0x9df34f=_0x35bcac[_0x34f16b(0x17a)](_0x339de8=>_0x339de8[_0x34f16b(0xd1)]===_0x34f16b(0x14e)),_0x32685b=_0x35bcac[_0x34f16b(0x17a)](_0x228755=>_0x228755[_0x34f16b(0xd1)]==='delete'),_0xa0d76c=Array[_0x34f16b(0xd9)](_0x242472)[_0x34f16b(0xcc)](),_0x4216d2=_0x4ab999?![]:_0x5c7ec2[_0x34f16b(0x161)]>0x0||_0x34816b[_0x34f16b(0x161)]>0x0||_0x7db320[_0x34f16b(0x161)]>0x0,_0x469dae=_0x4cf355[_0x34f16b(0x161)]>0x0||_0x2a5b9d[_0x34f16b(0x161)]>0x0||_0x8f8812[_0x34f16b(0x161)]>0x0,_0x70998d=_0x4ab999?![]:_0x35bcac[_0x34f16b(0x161)]>0x0,_0x2979de=_0xa0d76c['length']>0x0;return{'segments':{'new':_0x5c7ec2,'changed':_0x34816b,'unchanged':_0x5ba285,'toDelete':_0x7db320},'journeys':{'new':_0x4cf355,'changed':_0x2a5b9d,'unchanged':_0x4d23c2,'toDelete':_0x8f8812},'activations':{'all':_0x35bcac,'toCreate':_0x2fcb99,'toUpdate':_0x9df34f,'toDelete':_0x32685b},'folders':{'toCreate':_0xa0d76c},'counts':{'segments':{'new':_0x5c7ec2[_0x34f16b(0x161)],'changed':_0x34816b['length'],'unchanged':_0x5ba285[_0x34f16b(0x161)],'toDelete':_0x7db320[_0x34f16b(0x161)]},'journeys':{'new':_0x4cf355['length'],'changed':_0x2a5b9d[_0x34f16b(0x161)],'unchanged':_0x4d23c2['length'],'toDelete':_0x8f8812[_0x34f16b(0x161)]},'activations':{'create':_0x2fcb99[_0x34f16b(0x161)],'update':_0x9df34f[_0x34f16b(0x161)],'delete':_0x32685b[_0x34f16b(0x161)]},'folders':_0xa0d76c[_0x34f16b(0x161)]},'hasChanges':_0x4216d2||_0x469dae||_0x70998d||_0x2979de};}export async function buildPushExecutionContext(_0x1666e1,_0x4541b6,_0x2085e2,_0x383517,_0x4d0519,_0xbbe4ff){const _0x422919=a110_0x4accd9,_0x34e13e=extractRootFolderId(_0x2085e2),{pathToId:_0x3dff36,idToPath:_0x5a83b5}=buildFolderMaps(_0x4d0519),_0x2745bd=buildSegmentNameToIdMap(_0x383517),_0x4c0882=new Map(),{batchAsync:_0x13157c}=await import('../../utils/async.js'),[_0x350abd,_0x4a000d]=await Promise[_0x422919(0x112)]([_0x1666e1[_0x422919(0x159)]['buildUserMaps'](),_0x1666e1[_0x422919(0x1a3)][_0x422919(0x18e)](),((async()=>{const _0x4c2c79=_0x422919;!_0xbbe4ff&&_0x383517[_0x4c2c79(0x161)]>0x0&&await _0x13157c(_0x383517,async _0x343a43=>{const _0x2af1a5=_0x4c2c79,_0x4e43c0=await _0x1666e1['segment']['listActivations'](_0x4541b6,_0x343a43['id']);_0x4c0882[_0x2af1a5(0xd0)](_0x343a43['id'],_0x4e43c0);});})())]),{emailToId:_0xc495b9,idToEmail:_0x3a0e4d}=_0x350abd,_0x4e649e=buildConnectionMaps(_0x4a000d);return{'rootFolderId':_0x34e13e,'folderPathToId':_0x3dff36,'folderIdToPath':_0x5a83b5,'segmentNameToId':_0x2745bd,'activationsBySegmentId':_0x4c0882,'emailToIdMap':_0xc495b9,'idToEmailMap':_0x3a0e4d,'connectionNameToIdMap':_0x4e649e[_0x422919(0x137)],'connectionIdToNameMap':_0x4e649e[_0x422919(0xe4)],'connectionNameToTypeMap':_0x4e649e['nameToType']};}export function createPushYamlContextForBundle(_0xb9a924,_0x204b19,_0x48b0cc,_0xc5d5d,_0x2134cb,_0x146d70,_0xc99d0a,_0x3762de){const {existingLocalSegmentNames:_0x18d205,localExpandedRuleToNames:_0x2e972b}=_0xc5d5d,_0x389736=new Set(),_0x15af53=new Map(),_0x2d0643=new Map(),_0x2b5d1d=new Map(),_0x3b5abe=createJumpTargetCache(),_0x24ed03=new Map(),_0x2a65de=new Map(),_0x478511=new Set();let _0x39bdb7;const _0x1c50fc=_0x5e13c2=>{const _0x5188e4={'resolveSegment':async _0x4c1258=>{const _0x4ce6da=a110_0x574b,_0x5a1a3b=_0x2b5d1d['get'](_0x4c1258);if(_0x5a1a3b!==undefined)return{'name':_0x5a1a3b,'isJourneyLocal':!![]};try{let _0x13c83d=_0x48b0cc[_0x4ce6da(0xf0)](_0xeb85c8=>_0xeb85c8['id']===_0x4c1258);!_0x13c83d&&(_0x13c83d=await _0xb9a924['segment'][_0x4ce6da(0x131)](_0x204b19,_0x4c1258));const _0x3a038f=generateJourneyLocalName(_0x13c83d[_0x4ce6da(0x147)]),_0x167a37=_0x13c83d[_0x4ce6da(0x10c)]===SEGMENT_KIND_JOURNEY&&_0x3a038f!==undefined;let _0x53feb2=_0x13c83d[_0x4ce6da(0x147)],_0x3bd461;if(_0x167a37&&_0x13c83d['rule']){const _0x285754=apiRuleToYaml(_0x13c83d[_0x4ce6da(0x18c)]);_0x2a65de[_0x4ce6da(0xd0)](_0x4c1258,_0x285754);const _0x29acf0=async _0x2bfec4=>{const _0x2bc775=_0x4ce6da,_0x51935e=collectSegmentRefsFromRule(_0x2bfec4);for(const _0x38b271 of _0x51935e){if(!_0x2a65de[_0x2bc775(0x121)](_0x38b271))try{const _0x1691fd=await _0xb9a924[_0x2bc775(0xe6)][_0x2bc775(0x131)](_0x204b19,_0x38b271);if(_0x1691fd?.[_0x2bc775(0x18c)]){const _0x444445=apiRuleToYaml(_0x1691fd[_0x2bc775(0x18c)]);_0x2a65de[_0x2bc775(0xd0)](_0x38b271,_0x444445),await _0x29acf0(_0x444445);}}catch{}}};await _0x29acf0(_0x285754);const _0x7d8b9=serializeExpandedRule(_0x285754,_0x2a65de),_0x175fee=_0x2e972b[_0x4ce6da(0x19b)](_0x7d8b9);if(_0x175fee&&_0x175fee[_0x4ce6da(0x161)]>0x0){const _0x28a848=_0x15af53[_0x4ce6da(0x19b)](_0x7d8b9)||0x0,_0x1d8113=_0x175fee[_0x28a848]||_0x175fee[_0x175fee[_0x4ce6da(0x161)]-0x1];_0x15af53[_0x4ce6da(0xd0)](_0x7d8b9,_0x28a848+0x1),_0x53feb2=_0x1d8113,_0x389736[_0x4ce6da(0x18a)](_0x53feb2),_0x2b5d1d[_0x4ce6da(0xd0)](_0x4c1258,_0x53feb2);const _0x265d26=await resolveRuleSegmentRefs(_0x285754,async _0x78ba97=>{const _0x4a5e04=_0x4ce6da,_0x47d798=_0x2b5d1d[_0x4a5e04(0x19b)](_0x78ba97);if(_0x47d798)return _0x47d798;const _0x7a2989=await _0x39bdb7['resolveSegment'](_0x78ba97);return _0x7a2989['name'];});_0x3bd461={'description':_0x13c83d[_0x4ce6da(0x1ae)],'rule':_0x265d26};}else{const _0x17b8b7=_0x24ed03[_0x4ce6da(0x19b)](_0x7d8b9);if(_0x17b8b7)_0x53feb2=_0x17b8b7,_0x2b5d1d[_0x4ce6da(0xd0)](_0x4c1258,_0x53feb2);else{if(_0x3a038f){let _0x3baed8=_0x3a038f,_0x2b96ac=0x2;while(_0x389736['has'](_0x3baed8)||_0x18d205['has'](_0x3baed8)){_0x3baed8=_0x3a038f+'_'+_0x2b96ac,_0x2b96ac++;}_0x389736[_0x4ce6da(0x18a)](_0x3baed8),_0x53feb2=_0x3baed8;}_0x2b5d1d[_0x4ce6da(0xd0)](_0x4c1258,_0x53feb2),_0x24ed03[_0x4ce6da(0xd0)](_0x7d8b9,_0x53feb2);const _0xb32518=await resolveRuleSegmentRefs(_0x285754,async _0x5271ac=>{const _0x297f08=_0x4ce6da,_0x2978c1=_0x2b5d1d[_0x297f08(0x19b)](_0x5271ac);if(_0x2978c1)return _0x2978c1;const _0x28f5d6=await _0x39bdb7[_0x297f08(0x199)](_0x5271ac);return _0x28f5d6[_0x297f08(0x147)];});_0x3bd461={'description':_0x13c83d[_0x4ce6da(0x1ae)],'rule':_0xb32518};}}}return{'name':_0x53feb2,'isJourneyLocal':_0x167a37,'definition':_0x3bd461};}catch{return{'name':_0x4c1258,'isJourneyLocal':![]};}},'resolveActivation':async _0x328975=>{const _0x46fe8e=a110_0x574b,_0x4b29ee=_0x2d0643[_0x46fe8e(0x19b)](_0x328975);if(_0x4b29ee!==undefined)return{'name':_0x4b29ee,'isJourneyLocal':!![]};try{let _0x41e2be=_0xc99d0a?.[_0x46fe8e(0x19b)](_0x328975);!_0x41e2be&&(_0x41e2be=await _0xb9a924[_0x46fe8e(0x186)][_0x46fe8e(0xe5)](_0x5e13c2,_0x328975));const _0xc088ba=_0x41e2be[_0x46fe8e(0xd7)][_0x46fe8e(0x14d)][_0x46fe8e(0x147)]||_0x328975,_0x12b63b=sanitizeYamlKey(_0xc088ba)||'activation_'+_0x328975,_0x2580fe=_0x12b63b;_0x2d0643[_0x46fe8e(0xd0)](_0x328975,_0x2580fe);const _0x706e3a=journeyActivationStepToYaml(_0x41e2be,_0x2134cb,_0x146d70);return{'name':_0x2580fe,'isJourneyLocal':!![],'definition':_0x706e3a};}catch{return{'name':_0x328975,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4f3c82,_0x33ab0c)=>resolveJumpTarget(_0x4f3c82,_0x33ab0c,_0x3b5abe,async _0x2695d3=>{const _0x3954f1=a110_0x574b,_0x2e0169=_0x3762de?.[_0x3954f1(0x19b)](_0x2695d3);if(_0x2e0169)return _0x2e0169;return _0xb9a924['journey'][_0x3954f1(0x142)](_0x2695d3);})};return _0x39bdb7=_0x5188e4,_0x5188e4;},_0x252386=async _0x14993e=>{const _0x3c173f=a110_0x574b,{collectSegmentIdsFromJourneyApi:_0x9d92a}=await import(_0x3c173f(0x191)),{batchAsync:_0xddecc3}=await import(_0x3c173f(0x192)),_0x13cc0a=new Set();for(const _0x5e0f26 of _0x14993e){let _0x362ed3=_0x3762de?.[_0x3c173f(0x19b)](_0x5e0f26);!_0x362ed3&&(_0x362ed3=await _0xb9a924['journey']['getJourney'](_0x5e0f26));const _0x5b6f32=_0x9d92a(_0x362ed3);for(const _0x26dc7e of _0x5b6f32){_0x13cc0a[_0x3c173f(0x18a)](_0x26dc7e);}}let _0x65781d=Array[_0x3c173f(0xd9)](_0x13cc0a);while(_0x65781d[_0x3c173f(0x161)]>0x0){const _0x21b8bd=_0x65781d[_0x3c173f(0x17a)](_0x53ef6c=>!_0x478511['has'](_0x53ef6c));if(_0x21b8bd['length']===0x0)break;const _0x74b4da=await _0xddecc3(_0x21b8bd,async _0x3485e7=>{const _0x1e66cc=_0x3c173f;_0x478511[_0x1e66cc(0x18a)](_0x3485e7);let _0x5d5ef7=_0x48b0cc[_0x1e66cc(0xf0)](_0x4d6c05=>_0x4d6c05['id']===_0x3485e7);if(!_0x5d5ef7)try{_0x5d5ef7=await _0xb9a924[_0x1e66cc(0xe6)][_0x1e66cc(0x131)](_0x204b19,_0x3485e7);}catch{return null;}return{'segmentId':_0x3485e7,'segment':_0x5d5ef7};},0xa),_0x4576c0=new Set();for(const _0x244705 of _0x74b4da){if(!_0x244705?.['segment']?.[_0x3c173f(0x18c)])continue;const _0x1970c6=apiRuleToYaml(_0x244705[_0x3c173f(0xe6)][_0x3c173f(0x18c)]);_0x2a65de[_0x3c173f(0xd0)](_0x244705[_0x3c173f(0x107)],_0x1970c6);const _0xdb9acc=collectSegmentRefsFromRule(_0x1970c6);for(const _0x58fb69 of _0xdb9acc){!_0x478511['has'](_0x58fb69)&&_0x4576c0['add'](_0x58fb69);}}_0x65781d=Array['from'](_0x4576c0);}};return{'createYamlContext':_0x1c50fc,'prefetchJourneySegments':_0x252386};}export async function executePushSegments(_0x30ea91,_0x122e78,_0x4e36e3,_0x4587a3,_0x4597a3){const _0x1442b1=a110_0x4accd9,{segmentDefToCreateRequest:_0x15553a,segmentDefToUpdateRequest:_0x534b64}=await import(_0x1442b1(0x16e)),_0x5a677a=_0x4e36e3[_0x1442b1(0x115)],_0x2a83a3=0x5,_0x287543=async _0x3038dd=>{const _0xcf3898=_0x1442b1,_0x1d77d5=_0x3038dd['folderPath']?_0x5a677a[_0xcf3898(0x19b)](_0x3038dd[_0xcf3898(0x16d)]):undefined;let _0x206975;const _0x4ca30e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x3038dd[_0xcf3898(0x160)]){_0x4597a3['onProgress']?.({'type':_0xcf3898(0x105),'name':_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]});const _0x10b070=_0x15553a(_0x3038dd[_0xcf3898(0xdb)],_0x1d77d5),_0x10f759=await _0x4597a3[_0xcf3898(0x146)](_0xcf3898(0x1a0)+_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]+_0xcf3898(0xee),()=>_0x30ea91[_0xcf3898(0xe6)][_0xcf3898(0xed)](_0x4587a3[_0xcf3898(0x13f)],_0x10b070));_0x206975=_0x10f759['data']['id'],_0x4ca30e[_0xcf3898(0xd2)]={'name':_0x3038dd['yamlConfig']['name'],'id':_0x206975},_0x4597a3['onProgress']?.({'type':'segment_created','name':_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)],'segmentId':_0x206975}),_0x4597a3['logSuccess']?.(_0xcf3898(0xfd)+_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]+'\x27'),_0x4ca30e['created']=0x1;}else{if(_0x3038dd[_0xcf3898(0x149)]){_0x4597a3['onProgress']?.({'type':'segment_updating','name':_0x3038dd[_0xcf3898(0xdb)]['name']});const _0x477d24=_0x534b64(_0x3038dd[_0xcf3898(0xdb)]);_0x1d77d5!==_0x3038dd[_0xcf3898(0x173)]?.['segmentFolderId']&&(_0x477d24[_0xcf3898(0x119)]=_0x1d77d5?parseInt(_0x1d77d5,0xa):undefined),await _0x4597a3[_0xcf3898(0x146)](_0xcf3898(0x15b)+_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]+_0xcf3898(0xee),()=>_0x30ea91['segment'][_0xcf3898(0x178)](_0x4587a3[_0xcf3898(0x13f)],_0x3038dd['existingSegment']['id'],_0x477d24)),_0x206975=_0x3038dd['existingSegment']['id'],_0x4597a3['onProgress']?.({'type':'segment_updated','name':_0x3038dd[_0xcf3898(0xdb)]['name']}),_0x4597a3['logSuccess']?.(_0xcf3898(0x109)+_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]+'\x27'),_0x4ca30e[_0xcf3898(0x169)]=0x1;}else _0x206975=_0x3038dd['existingSegment']['id'];}}catch(_0x4e6c98){const _0x295d17=isHttp400Error(_0x4e6c98),_0x5cf7e7=_0x295d17?ErrorCode[_0xcf3898(0x19a)]:ErrorCode[_0xcf3898(0x12f)],_0x1d0a16=getErrorMessage(_0x4e6c98);throw new SDKError(_0x5cf7e7,_0xcf3898(0x167)+(_0x3038dd[_0xcf3898(0x160)]?'create':_0xcf3898(0x14e))+_0xcf3898(0x176)+_0x3038dd[_0xcf3898(0x10a)]+_0xcf3898(0xf9)+_0x1d0a16,_0x4e6c98);}try{const _0x339daa=await syncActivationsForSegment(_0x30ea91,_0x4587a3[_0xcf3898(0x13f)],_0x206975,_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)],_0x3038dd[_0xcf3898(0xdf)],_0x4597a3,_0x3038dd[_0xcf3898(0x10a)]);_0x4ca30e[_0xcf3898(0xd3)]=_0x339daa;}catch(_0x75d451){if(_0x75d451 instanceof SDKError)throw _0x75d451;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xcf3898(0x19e)+_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]+_0xcf3898(0x1af)+_0x3038dd[_0xcf3898(0x10a)]+'\x0a\x20\x20'+getErrorMessage(_0x75d451),_0x75d451);}return _0x4ca30e;},_0x252553=await batchAsync(_0x122e78,_0x287543,_0x2a83a3),_0xf707e5={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5d2a2e of _0x252553){_0xf707e5[_0x1442b1(0xd6)]+=_0x5d2a2e[_0x1442b1(0xd6)],_0xf707e5[_0x1442b1(0x169)]+=_0x5d2a2e['updated'],_0x5d2a2e[_0x1442b1(0xd2)]&&_0xf707e5[_0x1442b1(0x13b)][_0x1442b1(0xd0)](_0x5d2a2e[_0x1442b1(0xd2)][_0x1442b1(0x147)],_0x5d2a2e[_0x1442b1(0xd2)]['id']),_0xf707e5[_0x1442b1(0xd3)][_0x1442b1(0xd6)]+=_0x5d2a2e['activations'][_0x1442b1(0xd6)],_0xf707e5[_0x1442b1(0xd3)]['updated']+=_0x5d2a2e[_0x1442b1(0xd3)][_0x1442b1(0x169)],_0xf707e5['activations']['deleted']+=_0x5d2a2e[_0x1442b1(0xd3)][_0x1442b1(0x113)];}return _0xf707e5;}async function syncActivationsForSegment(_0x5dfbef,_0x1d6c6f,_0x341fc6,_0x47a975,_0x75fabb,_0x5f6004,_0x52c61b){const _0x1f9c70=a110_0x4accd9,_0x496c28={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2c2fc7 of _0x75fabb){try{if(_0x2c2fc7[_0x1f9c70(0xd1)]==='create'&&_0x2c2fc7[_0x1f9c70(0x1ac)])_0x5f6004['onProgress']?.({'type':_0x1f9c70(0x134),'segmentName':_0x47a975,'activationName':_0x2c2fc7[_0x1f9c70(0x147)]}),await _0x5f6004[_0x1f9c70(0x146)](_0x1f9c70(0xf4)+_0x2c2fc7[_0x1f9c70(0x147)]+'\x27...',()=>_0x5dfbef[_0x1f9c70(0xe6)][_0x1f9c70(0xea)](_0x1d6c6f,_0x341fc6,_0x2c2fc7['validatedRequest'])),_0x5f6004['onProgress']?.({'type':_0x1f9c70(0x13a),'segmentName':_0x47a975,'activationName':_0x2c2fc7['name']}),_0x5f6004[_0x1f9c70(0x158)]?.('Created\x20activation\x20\x27'+_0x2c2fc7[_0x1f9c70(0x147)]+'\x27'),_0x496c28[_0x1f9c70(0xd6)]++;else{if(_0x2c2fc7[_0x1f9c70(0xd1)]==='update'&&_0x2c2fc7[_0x1f9c70(0x1ac)]&&_0x2c2fc7[_0x1f9c70(0x187)])_0x5f6004[_0x1f9c70(0x10d)]?.({'type':_0x1f9c70(0x114),'segmentName':_0x47a975,'activationName':_0x2c2fc7['name']}),await _0x5f6004[_0x1f9c70(0x146)](_0x1f9c70(0xd8)+_0x2c2fc7[_0x1f9c70(0x147)]+_0x1f9c70(0xee),()=>_0x5dfbef['segment'][_0x1f9c70(0xcf)](_0x1d6c6f,_0x341fc6,_0x2c2fc7[_0x1f9c70(0x187)]['id'],_0x2c2fc7[_0x1f9c70(0x1ac)])),_0x5f6004[_0x1f9c70(0x10d)]?.({'type':_0x1f9c70(0x1b2),'segmentName':_0x47a975,'activationName':_0x2c2fc7[_0x1f9c70(0x147)]}),_0x5f6004[_0x1f9c70(0x158)]?.(_0x1f9c70(0x10e)+_0x2c2fc7['name']+'\x27'),_0x496c28[_0x1f9c70(0x169)]++;else _0x2c2fc7[_0x1f9c70(0xd1)]===_0x1f9c70(0x1aa)&&_0x2c2fc7[_0x1f9c70(0x187)]&&(_0x5f6004[_0x1f9c70(0x10d)]?.({'type':_0x1f9c70(0x188),'segmentName':_0x47a975,'activationName':_0x2c2fc7[_0x1f9c70(0x147)]}),await _0x5f6004['withProgress'](_0x1f9c70(0x10b)+_0x2c2fc7[_0x1f9c70(0x147)]+_0x1f9c70(0xee),()=>_0x5dfbef[_0x1f9c70(0xe6)][_0x1f9c70(0x135)](_0x1d6c6f,_0x341fc6,_0x2c2fc7[_0x1f9c70(0x187)]['id'])),_0x5f6004['onProgress']?.({'type':_0x1f9c70(0x104),'segmentName':_0x47a975,'activationName':_0x2c2fc7[_0x1f9c70(0x147)]}),_0x5f6004['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x2c2fc7['name']+'\x27'),_0x496c28[_0x1f9c70(0x113)]++);}}catch(_0x40e6e3){const _0x1d5847=isHttp400Error(_0x40e6e3),_0x3bac8f=_0x1d5847?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x1f9c70(0x118)],_0x39da6a=getErrorMessage(_0x40e6e3);throw new SDKError(_0x3bac8f,'Failed\x20to\x20'+_0x2c2fc7[_0x1f9c70(0xd1)]+_0x1f9c70(0xe0)+_0x2c2fc7[_0x1f9c70(0x147)]+_0x1f9c70(0x1af)+_0x52c61b+_0x1f9c70(0xf9)+_0x39da6a,_0x40e6e3);}}return _0x496c28;}export async function executePushFolders(_0x10208a,_0x1f91aa,_0x2e1e78,_0x147c8,_0x5e7b0e){const _0x5479f0=a110_0x4accd9,_0x3c783e=new Map(_0x2e1e78);for(const _0x42c09c of _0x1f91aa){const _0x7a91d=_0x42c09c[_0x5479f0(0x1a4)]('/'),_0x409ac4=_0x7a91d[_0x7a91d[_0x5479f0(0x161)]-0x1],_0x5188cf=_0x7a91d['slice'](0x0,-0x1)[_0x5479f0(0x1a7)]('/'),_0x563f8a=_0x3c783e['get'](_0x5188cf);_0x5e7b0e[_0x5479f0(0x10d)]?.({'type':_0x5479f0(0x18d),'folder':_0x42c09c});const _0x54c2e1={'name':_0x409ac4,'parentFolderId':_0x563f8a},_0x35e0a8=await _0x5e7b0e['withProgress'](_0x5479f0(0x1a9)+_0x42c09c+_0x5479f0(0xee),()=>_0x10208a['segment'][_0x5479f0(0x1a6)](_0x147c8[_0x5479f0(0x13f)],_0x54c2e1));_0x3c783e['set'](_0x42c09c,_0x35e0a8['data']['id']),_0x5e7b0e[_0x5479f0(0x10d)]?.({'type':'folder_created','folder':_0x42c09c,'folderId':_0x35e0a8[_0x5479f0(0x15a)]['id']}),_0x5e7b0e[_0x5479f0(0x17d)]?.(_0x5479f0(0x151)+_0x42c09c+'\x27');}return _0x3c783e;}export async function executePushSegmentDeletions(_0x2eee8b,_0x3603c7,_0x472ed8){const _0x519b32=a110_0x4accd9;if(_0x3603c7['length']===0x0)return 0x0;const {batchAsync:_0x223380}=await import(_0x519b32(0x192)),_0xedb521=0x5,_0x1bde47=await _0x223380(_0x3603c7,async _0x1d61cb=>{const _0x2f2c16=_0x519b32;return _0x472ed8['onProgress']?.({'type':_0x2f2c16(0x152),'name':_0x1d61cb['name']}),await _0x2eee8b[_0x2f2c16(0xe6)][_0x2f2c16(0x171)](_0x1d61cb['id']),_0x472ed8[_0x2f2c16(0x10d)]?.({'type':_0x2f2c16(0x168),'name':_0x1d61cb['name']}),_0x472ed8[_0x2f2c16(0xcb)]?.('Deleted\x20segment\x20\x27'+_0x1d61cb[_0x2f2c16(0x147)]+'\x27'),0x1;},_0xedb521);return _0x1bde47['reduce']((_0x49173f,_0xf3847e)=>_0x49173f+_0xf3847e,0x0);}function a110_0x574b(_0x2b6d9b,_0x1b01d2){_0x2b6d9b=_0x2b6d9b-0xc9;const _0xff5ce6=a110_0xff5c();let _0x574b14=_0xff5ce6[_0x2b6d9b];return _0x574b14;}export async function executePushJourneys(_0x19f3bf,_0x245e48,_0x43c4ed,_0x9c0fcb,_0x2a95a8){const _0x55e00f=a110_0x4accd9,{journeyDefToRequest:_0x4e7581}=await import(_0x55e00f(0x191)),{activationDefToCreateRequest:_0x1d0ec8,yamlRuleToApi:_0x5e49f4,validateSegmentRule:_0x59c507}=await import(_0x55e00f(0x16e)),_0x1ae0dd={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x224cb3=new Map(_0x43c4ed['segmentNameToId']),_0x3519a1=0x5;for(let _0x19627a=0x0;_0x19627a<_0x245e48[_0x55e00f(0x161)];_0x19627a+=_0x3519a1){const _0x587a84=_0x245e48[_0x55e00f(0x179)](_0x19627a,_0x19627a+_0x3519a1),_0x4d8c8a=await Promise[_0x55e00f(0x112)](_0x587a84[_0x55e00f(0x190)](async _0x542159=>{const _0x300612=_0x55e00f;if(!_0x542159[_0x300612(0x160)]&&!_0x542159[_0x300612(0x149)])return{'action':_0x300612(0x106),'name':_0x542159[_0x300612(0xdb)][_0x300612(0x147)],'journeyId':_0x542159['existingJourney']?.['id']};const _0x12b455=_0x542159['folderPath']?_0x43c4ed[_0x300612(0x115)][_0x300612(0x19b)](_0x542159[_0x300612(0x16d)]):undefined;_0x2a95a8[_0x300612(0x10d)]?.({'type':_0x542159[_0x300612(0x160)]?_0x300612(0x103):_0x300612(0x18f),'name':_0x542159['yamlConfig']['name']});try{const _0x379709=await executeSingleJourneyPush(_0x19f3bf,_0x542159,{..._0x43c4ed,'segmentNameToId':_0x224cb3},{'parentId':_0x9c0fcb[_0x300612(0x13f)],'rootFolderId':_0x9c0fcb[_0x300612(0x16f)],'folderId':_0x12b455,'verbose':_0x9c0fcb['verbose']},_0x2a95a8,{'journeyDefToRequest':_0x4e7581,'activationDefToCreateRequest':_0x1d0ec8,'yamlRuleToApi':_0x5e49f4,'validateSegmentRule':_0x59c507});for(const [_0x5baea0,_0x40f6c9]of _0x379709[_0x300612(0x12b)]){_0x224cb3[_0x300612(0xd0)](_0x5baea0,_0x40f6c9),_0x1ae0dd['embeddedSegmentNameToId']['set'](_0x5baea0,_0x40f6c9);}if(_0x379709[_0x300612(0x1b4)]===_0x300612(0xd6))_0x2a95a8[_0x300612(0x10d)]?.({'type':_0x300612(0xf8),'name':_0x542159['yamlConfig']['name'],'journeyId':_0x379709['journeyId']}),_0x2a95a8[_0x300612(0x158)]?.(_0x300612(0x122)+_0x542159[_0x300612(0xdb)][_0x300612(0x147)]+'\x27'),_0x1ae0dd[_0x300612(0xd6)]++;else _0x379709[_0x300612(0x1b4)]===_0x300612(0x169)&&(_0x2a95a8[_0x300612(0x10d)]?.({'type':'journey_updated','name':_0x542159[_0x300612(0xdb)][_0x300612(0x147)]}),_0x2a95a8[_0x300612(0x158)]?.(_0x300612(0x130)+_0x542159['yamlConfig']['name']+'\x27'),_0x1ae0dd[_0x300612(0x169)]++);return{'action':_0x379709[_0x300612(0x1b4)],'name':_0x542159['yamlConfig'][_0x300612(0x147)],'journeyId':_0x379709['journeyId']};}catch(_0x29d736){const _0x3356fd=isHttp400Error(_0x29d736),_0x4abd2a=_0x3356fd?ErrorCode[_0x300612(0x13c)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x421b74=getErrorMessage(_0x29d736);throw new SDKError(_0x4abd2a,_0x300612(0x167)+(_0x542159[_0x300612(0x160)]?_0x300612(0x1b5):_0x300612(0x14e))+_0x300612(0x10f)+_0x542159['absolutePath']+_0x300612(0xf9)+_0x421b74,_0x29d736);}}));_0x1ae0dd[_0x55e00f(0xe3)][_0x55e00f(0x12d)](..._0x4d8c8a);}return _0x1ae0dd;}async function executeSingleJourneyPush(_0x55c94b,_0x540c86,_0x10c1cb,_0x546b21,_0x9d0134,_0x2b7232){const _0x52db46=a110_0x4accd9,{journeyDefToRequest:_0x536439,activationDefToCreateRequest:_0x3ceb40,yamlRuleToApi:_0xc47257,validateSegmentRule:_0x228a99}=_0x2b7232,_0x32ff3c=new Map(),_0x2d0c5c=new Map(),_0x23cc79=new Map(),_0x79d122=new Map(),_0x39bee0=new Map();let _0x2d1bc8;const _0x3473c4=async()=>{const _0x3aa058=a110_0x574b;if(_0x2d1bc8)return;_0x2d1bc8=new Map();if(!_0x540c86['existingJourney'])return;const _0x4290e8=await _0x55c94b['journey'][_0x3aa058(0x18b)](_0x540c86[_0x3aa058(0xc9)]['id']);for(const _0x1da27f of _0x4290e8){const _0x49852a=journeyActivationStepToYaml(_0x1da27f,_0x10c1cb['idToEmailMap'],_0x10c1cb[_0x3aa058(0xe2)]),_0x1c4ec6=activationSignature(_0x49852a);!_0x2d1bc8[_0x3aa058(0x121)](_0x1c4ec6)&&_0x2d1bc8['set'](_0x1c4ec6,_0x1da27f['id']),_0x49852a[_0x3aa058(0x147)]&&_0x2d0c5c[_0x3aa058(0xd0)](_0x49852a[_0x3aa058(0x147)],_0x1da27f['id']);}};if(_0x540c86[_0x52db46(0xc9)]&&_0x540c86[_0x52db46(0xdb)]['segments']){const _0x3cce34=buildLocalExpandedRuleMappings(_0x540c86['yamlConfig']),_0x367f47=_0x3cce34[_0x52db46(0x162)];if(_0x367f47['size']>0x0){const _0xcc8257=new Map();for(const [_0x2e964f,_0x264477]of _0x367f47){const _0x2eae14=serializeExpandedRule(_0x264477,_0x367f47);_0xcc8257[_0x52db46(0xd0)](_0x2e964f,_0x2eae14);}const _0x13d3be=collectSegmentIdsFromJourneyApi(_0x540c86[_0x52db46(0xc9)]);if(_0x13d3be[_0x52db46(0x1ab)]>0x0){const _0x1c1579=await buildServerSegmentRuleMap(_0x55c94b,_0x546b21['parentId'],_0x10c1cb[_0x52db46(0x172)],_0x13d3be);if(_0x1c1579[_0x52db46(0x1ab)]>0x0){const _0x414722=new Map();for(const [_0xaa070c,_0x82d194]of _0x1c1579){const _0x3cea43=serializeExpandedRule(_0x82d194,_0x1c1579);!_0x414722[_0x52db46(0x121)](_0x3cea43)&&_0x414722[_0x52db46(0xd0)](_0x3cea43,_0xaa070c);}for(const [_0x38f035,_0x3b42f6]of _0xcc8257){const _0x4d3029=_0x414722[_0x52db46(0x19b)](_0x3b42f6);_0x4d3029&&(_0x39bee0[_0x52db46(0xd0)](_0x38f035,_0x4d3029),_0x10c1cb['segmentNameToId'][_0x52db46(0xd0)](_0x38f035,_0x4d3029));}}}}}const _0x588ab1={'resolveSegmentId':async _0x277b67=>{const _0x5b0f7e=_0x52db46,_0x1aff7b=_0x10c1cb[_0x5b0f7e(0x11e)][_0x5b0f7e(0x19b)](_0x277b67);if(!_0x1aff7b)throw new SDKError(ErrorCode[_0x5b0f7e(0x13e)],_0x5b0f7e(0x138)+_0x277b67+_0x5b0f7e(0x195)+_0x540c86[_0x5b0f7e(0xdb)][_0x5b0f7e(0x147)]+')');return _0x1aff7b;},'resolveEmbeddedSegmentId':async(_0x17e98d,_0x19dd13)=>{const _0x14a87f=_0x52db46,_0x1d9ff2=_0x10c1cb[_0x14a87f(0x11e)][_0x14a87f(0x19b)](_0x17e98d);if(_0x1d9ff2)return _0x1d9ff2;const _0x70a6d7=_0x39bee0[_0x14a87f(0x19b)](_0x17e98d);if(_0x70a6d7)return _0x10c1cb[_0x14a87f(0x11e)][_0x14a87f(0xd0)](_0x17e98d,_0x70a6d7),_0x70a6d7;const _0x4b9a74=_0x10c1cb[_0x14a87f(0x172)][_0x14a87f(0xf0)](_0x297d90=>_0x297d90[_0x14a87f(0x147)]===_0x17e98d);if(_0x4b9a74)return _0x10c1cb[_0x14a87f(0x11e)][_0x14a87f(0xd0)](_0x17e98d,_0x4b9a74['id']),_0x4b9a74['id'];if(_0x540c86[_0x14a87f(0x160)]){const {stageName:_0x25ce78,criteriaName:_0x4ae1fc}=findSegmentCriteriaLocation(_0x540c86['yamlConfig'],_0x17e98d);return _0x228a99(_0x17e98d,_0x19dd13['rule']),_0x23cc79['set'](_0x17e98d,{'definition':_0x19dd13,'stageName':_0x25ce78,'criteriaName':_0x4ae1fc}),createPendingSegmentId(_0x17e98d);}const _0x1670b1=_0x540c86[_0x14a87f(0xc9)]?.['id'];if(!_0x1670b1)throw new SDKError(ErrorCode[_0x14a87f(0x128)],_0x14a87f(0xcd));_0x228a99(_0x17e98d,_0x19dd13[_0x14a87f(0x18c)]);const _0x3a0652=generateDeterministicJourneySegmentName(_0x540c86[_0x14a87f(0xdb)][_0x14a87f(0x147)],_0x17e98d),_0x150344=_0x10c1cb[_0x14a87f(0x172)][_0x14a87f(0xf0)](_0x14703e=>_0x14703e[_0x14a87f(0x147)]===_0x3a0652),_0x176728=createSegmentIdResolver(_0x10c1cb['segmentNameToId'],_0x17e98d),_0x5d3383=await resolveRuleSegmentIds(_0x19dd13['rule'],_0x176728);let _0x700c2c;if(_0x150344)await _0x55c94b[_0x14a87f(0xe6)]['updateSegmentById'](_0x546b21[_0x14a87f(0x13f)],_0x150344['id'],{'description':_0x19dd13[_0x14a87f(0x1ae)]||_0x14a87f(0x181)+_0x17e98d,'rule':_0xc47257(_0x5d3383,!![]),'countPopulation':!![]}),_0x700c2c=_0x150344['id'];else try{_0x700c2c=await _0x55c94b[_0x14a87f(0xe6)][_0x14a87f(0x175)]({'name':_0x3a0652,'description':_0x19dd13[_0x14a87f(0x1ae)]||_0x14a87f(0x181)+_0x17e98d,'journeyId':_0x1670b1,'rule':_0xc47257(_0x5d3383,!![]),'countPopulation':!![],'parentFolderId':_0x546b21[_0x14a87f(0x16f)]||'','audienceId':_0x546b21[_0x14a87f(0x13f)]});}catch(_0x3e97ff){const _0x38df9e=_0x3e97ff instanceof Error&&_0x3e97ff[_0x14a87f(0x185)]['includes'](_0x14a87f(0x174));if(_0x38df9e){const _0x229206=await _0x55c94b[_0x14a87f(0xe6)][_0x14a87f(0x15f)](_0x546b21[_0x14a87f(0x13f)]),_0x5d9d62=_0x229206['find'](_0x33c9c6=>_0x33c9c6[_0x14a87f(0x147)]===_0x3a0652);if(_0x5d9d62)await _0x55c94b[_0x14a87f(0xe6)][_0x14a87f(0x178)](_0x546b21[_0x14a87f(0x13f)],_0x5d9d62['id'],{'description':_0x19dd13['description']||_0x14a87f(0x181)+_0x17e98d,'rule':_0xc47257(_0x5d3383,!![]),'countPopulation':!![]}),_0x700c2c=_0x5d9d62['id'];else throw _0x3e97ff;}else throw _0x3e97ff;}return _0x10c1cb[_0x14a87f(0x11e)][_0x14a87f(0xd0)](_0x17e98d,_0x700c2c),_0x32ff3c[_0x14a87f(0xd0)](_0x17e98d,_0x700c2c),_0x700c2c;},'resolveActivationId':async _0x1e6689=>{const _0x4788d8=_0x52db46,_0x468d17=_0x2d0c5c['get'](_0x1e6689);if(_0x468d17)return _0x468d17;if(_0x540c86[_0x4788d8(0xc9)]){await _0x3473c4();const _0x2c5fd0=_0x2d0c5c[_0x4788d8(0x19b)](_0x1e6689);if(_0x2c5fd0)return _0x2c5fd0;}throw new SDKError(ErrorCode[_0x4788d8(0xdd)],_0x4788d8(0x141)+_0x1e6689+_0x4788d8(0x195)+_0x540c86[_0x4788d8(0xdb)][_0x4788d8(0x147)]+_0x4788d8(0x184)+_0x4788d8(0x1a5));},'resolveEmbeddedActivationId':async(_0x107e4b,_0xfcb0a1)=>{const _0x8b366d=_0x52db46,_0x1c976a=_0x2d0c5c['get'](_0x107e4b);if(_0x1c976a)return _0x1c976a;if(_0x540c86[_0x8b366d(0x160)])return _0x79d122[_0x8b366d(0xd0)](_0x107e4b,_0xfcb0a1),createPendingActivationId(_0x107e4b);if(_0x540c86[_0x8b366d(0xc9)]){await _0x3473c4();const _0xef6fe3=_0x2d0c5c[_0x8b366d(0x19b)](_0xfcb0a1[_0x8b366d(0x147)]);if(_0xef6fe3)return _0x2d0c5c[_0x8b366d(0xd0)](_0x107e4b,_0xef6fe3),_0xef6fe3;const _0x3b72d0=activationSignature(_0xfcb0a1),_0xae512e=_0x2d1bc8?.[_0x8b366d(0x19b)](_0x3b72d0);if(_0xae512e)return _0x2d0c5c[_0x8b366d(0xd0)](_0x107e4b,_0xae512e),_0xae512e;const _0x4ff381=await _0x3ceb40(_0xfcb0a1,_0x10c1cb[_0x8b366d(0x183)]),_0x17276b=await _0x55c94b[_0x8b366d(0x186)][_0x8b366d(0xea)](_0x540c86['existingJourney']['id'],_0x4ff381);return _0x2d0c5c[_0x8b366d(0xd0)](_0x107e4b,_0x17276b['id']),_0x17276b['id'];}throw new SDKError(ErrorCode[_0x8b366d(0x128)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x20d947=>{const _0x56acd4=_0x52db46;try{return await _0x55c94b['journey'][_0x56acd4(0xf5)](_0x546b21[_0x56acd4(0x13f)],_0x20d947);}catch(_0x1aef66){throw new SDKError(ErrorCode[_0x56acd4(0xdd)],_0x56acd4(0x110)+_0x20d947+_0x56acd4(0x154)+_0x540c86[_0x56acd4(0xdb)]['name']+'\x27)',_0x1aef66);}},'resolveStageId':async(_0x82761d,_0x3ce63c)=>{const _0x3f4777=_0x52db46,_0x595e2b=await _0x55c94b['journey'][_0x3f4777(0x142)](_0x82761d),_0x5444f8=_0x595e2b[_0x3f4777(0xd7)][_0x3f4777(0x166)]['find'](_0x3e4b77=>_0x3e4b77[_0x3f4777(0x147)][_0x3f4777(0x19f)]()===_0x3ce63c[_0x3f4777(0x19f)]());if(!_0x5444f8?.['id'])throw new SDKError(ErrorCode[_0x3f4777(0xdd)],_0x3f4777(0x163)+_0x3ce63c+_0x3f4777(0xda)+(_0x595e2b['attributes']['journeyBundleName']||_0x595e2b[_0x3f4777(0xd7)]['name'])+'\x27');return _0x5444f8['id'];}},_0x20ab17=await _0x536439(_0x540c86[_0x52db46(0xdb)],_0x546b21[_0x52db46(0x13f)],_0x588ab1),_0x34f1bd=_0x546b21[_0x52db46(0xe7)]||_0x546b21[_0x52db46(0x16f)];_0x34f1bd&&(_0x20ab17[_0x52db46(0x17b)]={'parentFolder':{'data':{'id':_0x34f1bd,'type':_0x52db46(0x197)}}});if(_0x540c86[_0x52db46(0x160)]){if(_0x23cc79[_0x52db46(0x1ab)]>0x0||_0x79d122['size']>0x0)return await executeThreeStepJourneyCreate(_0x55c94b,_0x540c86,_0x20ab17,{'pendingEmbeddedSegments':_0x23cc79,'pendingEmbeddedActivations':_0x79d122,'embeddedSegmentNameToId':_0x32ff3c,'journeyActivationNameToId':_0x2d0c5c},{..._0x546b21,'effectiveFolderId':_0x34f1bd},_0x10c1cb,_0x9d0134,_0x2b7232);else{ensureJourneyDefaults(_0x20ab17['attributes']);const _0x6c394b=await _0x55c94b['journey'][_0x52db46(0x1b5)](_0x20ab17);return{'action':_0x52db46(0xd6),'journeyId':_0x6c394b['id'],'embeddedSegmentNameToId':_0x32ff3c};}}else{if(_0x540c86[_0x52db46(0x149)]&&_0x540c86[_0x52db46(0xc9)])return ensureJourneyDefaults(_0x20ab17[_0x52db46(0xd7)]),await _0x55c94b[_0x52db46(0x186)]['update'](_0x540c86[_0x52db46(0xc9)]['id'],_0x20ab17),{'action':_0x52db46(0x169),'journeyId':_0x540c86['existingJourney']['id'],'embeddedSegmentNameToId':_0x32ff3c};}return{'action':_0x52db46(0x106),'journeyId':_0x540c86[_0x52db46(0xc9)]?.['id'],'embeddedSegmentNameToId':_0x32ff3c};}function findSegmentCriteriaLocation(_0x358937,_0x2e6fc9){const _0x529028=a110_0x4accd9,_0x5bcd3b=_0x358937[_0x529028(0x145)]||_0x358937[_0x529028(0x16b)]?.[0x0]?.['stages']||[];let _0x4192eb=_0x529028(0x180),_0x51eb75=_0x2e6fc9;const _0x26dca4=_0x358937[_0x529028(0x15d)]||_0x358937[_0x529028(0x16b)]?.[0x0]?.[_0x529028(0x15d)];if(_0x26dca4?.['segment']===_0x2e6fc9)return{'stageName':_0x529028(0x15d),'criteriaName':_0x26dca4[_0x529028(0x147)]||_0x2e6fc9};_0x556721:for(const _0x393307 of _0x5bcd3b){if(_0x393307['entry_criteria']?.[_0x529028(0xe6)]===_0x2e6fc9){_0x4192eb=_0x393307[_0x529028(0x147)],_0x51eb75=_0x393307[_0x529028(0x140)][_0x529028(0x147)]||_0x2e6fc9;break;}if(_0x393307[_0x529028(0x11a)])for(const _0x1a7618 of _0x393307[_0x529028(0x11a)]){if(_0x1a7618[_0x529028(0xd1)]===_0x529028(0x143)&&_0x1a7618[_0x529028(0x196)]?.[_0x529028(0x15c)])for(const _0x2cf2ad of _0x1a7618['with'][_0x529028(0x15c)]){if(_0x2cf2ad['segment']===_0x2e6fc9){_0x4192eb=_0x393307[_0x529028(0x147)],_0x51eb75=_0x2cf2ad[_0x529028(0x147)]||_0x2e6fc9;break _0x556721;}}}}return{'stageName':_0x4192eb,'criteriaName':_0x51eb75};}async function executeThreeStepJourneyCreate(_0x1b64c8,_0x225541,_0xb8ed80,_0x311fff,_0x3a087b,_0x286752,_0x5d1f27,_0x145ff8){const _0x314a2b=a110_0x4accd9,{activationDefToCreateRequest:_0x3dff13,yamlRuleToApi:_0x371406}=_0x145ff8,{pendingEmbeddedSegments:_0x174173,pendingEmbeddedActivations:_0x56311f,embeddedSegmentNameToId:_0x3e3484}=_0x311fff,_0x416d8f=JSON[_0x314a2b(0x132)](JSON[_0x314a2b(0x14a)](_0xb8ed80));ensureJourneyDefaults(_0x416d8f['attributes']),stripPendingIds(_0x416d8f);const _0x43189a=await _0x1b64c8[_0x314a2b(0x186)]['create'](_0x416d8f),_0xbe10b6=_0x43189a['id'],_0x960b34=new Map();for(const _0x3a28c6 of _0x43189a[_0x314a2b(0xd7)][_0x314a2b(0x166)]){_0x960b34[_0x314a2b(0xd0)](_0x3a28c6[_0x314a2b(0x147)][_0x314a2b(0x19f)](),_0x3a28c6['id']);}for(const [_0x49cbd4,{definition:_0x54953d}]of _0x174173){const _0x3b390f=generateDeterministicJourneySegmentName(_0x225541[_0x314a2b(0xdb)][_0x314a2b(0x147)],_0x49cbd4);_0x5d1f27[_0x314a2b(0x10d)]?.({'type':_0x314a2b(0x150),'journeyName':_0x225541[_0x314a2b(0xdb)][_0x314a2b(0x147)],'segmentName':_0x49cbd4});const _0x502bba=createSegmentIdResolver(_0x286752[_0x314a2b(0x11e)],_0x49cbd4),_0x3db84d=await resolveRuleSegmentIds(_0x54953d[_0x314a2b(0x18c)],_0x502bba),_0x531b5a=await _0x1b64c8[_0x314a2b(0xe6)][_0x314a2b(0x175)]({'name':_0x3b390f,'description':_0x54953d[_0x314a2b(0x1ae)]||_0x314a2b(0x181)+_0x49cbd4,'journeyId':_0xbe10b6,'rule':_0x371406(_0x3db84d,!![]),'countPopulation':!![],'parentFolderId':_0x3a087b[_0x314a2b(0x157)]||'','audienceId':_0x3a087b[_0x314a2b(0x13f)]});_0x3e3484['set'](_0x49cbd4,_0x531b5a),_0x286752[_0x314a2b(0x11e)]['set'](_0x49cbd4,_0x531b5a),_0x5d1f27[_0x314a2b(0x10d)]?.({'type':_0x314a2b(0xf6),'journeyName':_0x225541['yamlConfig']['name'],'segmentName':_0x49cbd4});}const _0x2f9f8c=new Map();for(const [_0x28d2ed,_0x24e434]of _0x56311f){_0x5d1f27[_0x314a2b(0x10d)]?.({'type':'embedded_activation_creating','journeyName':_0x225541['yamlConfig'][_0x314a2b(0x147)],'activationName':_0x28d2ed});const _0x510422=await _0x3dff13(_0x24e434,_0x286752['activationContext']),_0x11f43d=await _0x1b64c8['journey'][_0x314a2b(0xea)](_0xbe10b6,_0x510422);_0x2f9f8c[_0x314a2b(0xd0)](_0x28d2ed,_0x11f43d['id']),_0x311fff['journeyActivationNameToId'][_0x314a2b(0xd0)](_0x28d2ed,_0x11f43d['id']),_0x5d1f27[_0x314a2b(0x10d)]?.({'type':_0x314a2b(0xca),'journeyName':_0x225541[_0x314a2b(0xdb)][_0x314a2b(0x147)],'activationName':_0x28d2ed});}const _0xa3ba31=JSON[_0x314a2b(0x132)](JSON[_0x314a2b(0x14a)](_0xb8ed80));return _0xa3ba31['id']=_0xbe10b6,ensureJourneyDefaults(_0xa3ba31['attributes']),resolvePendingIdsInRequest(_0xa3ba31,_0xb8ed80,_0x960b34,_0x3e3484,_0x2f9f8c,_0x5d1f27),await _0x1b64c8[_0x314a2b(0x186)]['update'](_0xbe10b6,_0xa3ba31),{'action':'created','journeyId':_0xbe10b6,'embeddedSegmentNameToId':_0x3e3484};}function stripPendingIds(_0x463fdc){const _0x2cb6ba=a110_0x4accd9;for(const _0x246aa5 of _0x463fdc['attributes']['journeyStages']||[]){_0x246aa5[_0x2cb6ba(0x17f)]?.[_0x2cb6ba(0x107)]&&isPendingSegmentId(_0x246aa5[_0x2cb6ba(0x17f)][_0x2cb6ba(0x107)])&&delete _0x246aa5[_0x2cb6ba(0x17f)];if(_0x246aa5[_0x2cb6ba(0x11a)])for(const _0x1759aa of Object[_0x2cb6ba(0x117)](_0x246aa5[_0x2cb6ba(0x11a)])){const _0x203e31=_0x246aa5[_0x2cb6ba(0x11a)][_0x1759aa];_0x203e31[_0x2cb6ba(0xd1)]===_0x2cb6ba(0x127)&&_0x203e31[_0x2cb6ba(0xdc)]&&isPendingActivationId(_0x203e31['journeyActivationStepId'])&&(_0x203e31[_0x2cb6ba(0xdc)]='');if(_0x203e31[_0x2cb6ba(0xd1)]===_0x2cb6ba(0x1b1)&&_0x203e31[_0x2cb6ba(0x15c)])for(const _0xda92e2 of _0x203e31[_0x2cb6ba(0x15c)]){_0xda92e2['segmentId']&&isPendingSegmentId(_0xda92e2['segmentId'])&&(_0xda92e2[_0x2cb6ba(0x107)]='');}_0x203e31[_0x2cb6ba(0xd1)]===_0x2cb6ba(0x116)&&_0x203e31[_0x2cb6ba(0x126)]?.['segmentId']&&isPendingSegmentId(_0x203e31[_0x2cb6ba(0x126)][_0x2cb6ba(0x107)])&&(_0x203e31[_0x2cb6ba(0x126)][_0x2cb6ba(0x107)]='');}}}function resolvePendingIdsInRequest(_0x35b29d,_0x416b2b,_0x3c5a37,_0x597954,_0x5954b5,_0x252359){const _0x7c1fe4=a110_0x4accd9,_0x3a74d9=(_0x1ae8c3,_0x21f3c7)=>{const _0xcb5e3f=a110_0x574b;if(!isPendingSegmentId(_0x1ae8c3))return _0x1ae8c3;const _0x3fb860=extractPendingSegmentName(_0x1ae8c3),_0x3831d9=_0x597954[_0xcb5e3f(0x19b)](_0x3fb860);return!_0x3831d9&&_0x252359[_0xcb5e3f(0xe9)]?.(_0xcb5e3f(0x155)+_0x3fb860+'\x27\x20for\x20'+_0x21f3c7),_0x3831d9;};if(_0x35b29d[_0x7c1fe4(0xd7)][_0x7c1fe4(0x15d)]?.['segmentId']&&isPendingSegmentId(_0x35b29d[_0x7c1fe4(0xd7)][_0x7c1fe4(0x15d)][_0x7c1fe4(0x107)])){const _0x1ac55e=_0x3a74d9(_0x35b29d['attributes']['goal'][_0x7c1fe4(0x107)],_0x7c1fe4(0x165));_0x1ac55e&&(_0x35b29d[_0x7c1fe4(0xd7)]['goal'][_0x7c1fe4(0x107)]=_0x1ac55e);}for(const _0x246ed5 of _0x35b29d[_0x7c1fe4(0xd7)][_0x7c1fe4(0x166)]||[]){const _0x3c38c6=_0x3c5a37['get'](_0x246ed5[_0x7c1fe4(0x147)][_0x7c1fe4(0x19f)]());_0x3c38c6&&(_0x246ed5['id']=_0x3c38c6);if(_0x246ed5[_0x7c1fe4(0x17f)]?.['segmentId']&&isPendingSegmentId(_0x246ed5[_0x7c1fe4(0x17f)][_0x7c1fe4(0x107)])){const _0x986b4=_0x3a74d9(_0x246ed5['entryCriteria'][_0x7c1fe4(0x107)],_0x7c1fe4(0x102)+_0x246ed5['name']+'\x27\x20entry\x20criteria');_0x986b4&&(_0x246ed5[_0x7c1fe4(0x17f)][_0x7c1fe4(0x107)]=_0x986b4);}if(_0x246ed5[_0x7c1fe4(0x182)])for(const _0x4a5e92 of _0x246ed5['exitCriterias']){if(_0x4a5e92['segmentId']&&isPendingSegmentId(_0x4a5e92[_0x7c1fe4(0x107)])){const _0x2a4e6e=_0x3a74d9(_0x4a5e92[_0x7c1fe4(0x107)],_0x7c1fe4(0x102)+_0x246ed5[_0x7c1fe4(0x147)]+_0x7c1fe4(0x1a2));_0x2a4e6e&&(_0x4a5e92[_0x7c1fe4(0x107)]=_0x2a4e6e);}}if(_0x246ed5['milestone']?.[_0x7c1fe4(0x107)]&&isPendingSegmentId(_0x246ed5[_0x7c1fe4(0x177)][_0x7c1fe4(0x107)])){const _0x660cfe=_0x3a74d9(_0x246ed5[_0x7c1fe4(0x177)][_0x7c1fe4(0x107)],_0x7c1fe4(0x102)+_0x246ed5[_0x7c1fe4(0x147)]+_0x7c1fe4(0x17c));_0x660cfe&&(_0x246ed5[_0x7c1fe4(0x177)]['segmentId']=_0x660cfe);}if(_0x246ed5['steps']){const _0xcabf0e=_0x1353a7=>_0x416b2b[_0x7c1fe4(0xd7)][_0x7c1fe4(0x166)]['find'](_0x598146=>_0x598146[_0x7c1fe4(0x147)]['toLowerCase']()===_0x246ed5[_0x7c1fe4(0x147)]['toLowerCase']())?.[_0x7c1fe4(0x11a)]?.[_0x1353a7];for(const _0x1c84c4 of Object[_0x7c1fe4(0x117)](_0x246ed5[_0x7c1fe4(0x11a)])){const _0x3df2c4=_0x246ed5['steps'][_0x1c84c4],_0x12edf7=_0xcabf0e(_0x1c84c4);if(_0x3df2c4['type']==='Activation'&&_0x3df2c4[_0x7c1fe4(0xdc)]&&(isPendingActivationId(_0x3df2c4['journeyActivationStepId'])||_0x3df2c4[_0x7c1fe4(0xdc)]==='')){if(_0x12edf7?.[_0x7c1fe4(0xdc)]&&isPendingActivationId(_0x12edf7['journeyActivationStepId'])){const _0x4c63f4=extractPendingActivationName(_0x12edf7[_0x7c1fe4(0xdc)]),_0x4d594c=_0x5954b5[_0x7c1fe4(0x19b)](_0x4c63f4);_0x4d594c&&(_0x3df2c4['journeyActivationStepId']=_0x4d594c);}}if(_0x3df2c4[_0x7c1fe4(0xd1)]===_0x7c1fe4(0x1b1)&&_0x3df2c4[_0x7c1fe4(0x15c)]&&_0x12edf7?.['branches'])for(let _0x27a0b9=0x0;_0x27a0b9<_0x3df2c4['branches']['length'];_0x27a0b9++){const _0x12ba1f=_0x3df2c4[_0x7c1fe4(0x15c)][_0x27a0b9],_0x1491ea=_0x12edf7[_0x7c1fe4(0x15c)][_0x27a0b9];if(_0x1491ea?.[_0x7c1fe4(0x107)]&&isPendingSegmentId(_0x1491ea['segmentId'])){const _0x2dac10=_0x3a74d9(_0x1491ea['segmentId'],'stage\x20\x27'+_0x246ed5[_0x7c1fe4(0x147)]+_0x7c1fe4(0xe8)+(_0x12ba1f['name']||_0x27a0b9)+'\x27');_0x2dac10&&(_0x12ba1f[_0x7c1fe4(0x107)]=_0x2dac10);}}if(_0x3df2c4[_0x7c1fe4(0xd1)]===_0x7c1fe4(0x116)&&_0x3df2c4[_0x7c1fe4(0x126)]?.['segmentId']&&_0x12edf7?.[_0x7c1fe4(0x126)]?.[_0x7c1fe4(0x107)]&&isPendingSegmentId(_0x12edf7['waitCondition'][_0x7c1fe4(0x107)])){const _0x58063b=_0x3a74d9(_0x12edf7[_0x7c1fe4(0x126)][_0x7c1fe4(0x107)],_0x7c1fe4(0x102)+_0x246ed5[_0x7c1fe4(0x147)]+_0x7c1fe4(0x194));_0x58063b&&(_0x3df2c4[_0x7c1fe4(0x126)][_0x7c1fe4(0x107)]=_0x58063b);}}}}}
1
+ const a110_0x2c5cc6=a110_0x2c2f;(function(_0x372472,_0x40661f){const _0x51fe2f=a110_0x2c2f,_0x28579f=_0x372472();while(!![]){try{const _0x5eaf5c=-parseInt(_0x51fe2f(0x196))/0x1+-parseInt(_0x51fe2f(0x133))/0x2*(-parseInt(_0x51fe2f(0x16d))/0x3)+parseInt(_0x51fe2f(0x10c))/0x4*(-parseInt(_0x51fe2f(0x19c))/0x5)+-parseInt(_0x51fe2f(0x148))/0x6+parseInt(_0x51fe2f(0x173))/0x7*(-parseInt(_0x51fe2f(0xd7))/0x8)+parseInt(_0x51fe2f(0x1a0))/0x9+parseInt(_0x51fe2f(0x160))/0xa*(parseInt(_0x51fe2f(0x174))/0xb);if(_0x5eaf5c===_0x40661f)break;else _0x28579f['push'](_0x28579f['shift']());}catch(_0x298376){_0x28579f['push'](_0x28579f['shift']());}}}(a110_0x569a,0x99636));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a110_0x2c5cc6(0x194);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x14ad8c){return''+PENDING_SEGMENT_PREFIX+_0x14ad8c+'__';}export function isPendingSegmentId(_0x405838){return _0x405838['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x7b7b27){const _0x3155b8=a110_0x2c5cc6;return _0x7b7b27[_0x3155b8(0x1aa)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x333ccd){return''+PENDING_ACTIVATION_PREFIX+_0x333ccd+'__';}export function isPendingActivationId(_0x1ba139){const _0xecc2c3=a110_0x2c5cc6;return _0x1ba139[_0xecc2c3(0xe4)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x16f035){const _0x61b06=a110_0x2c5cc6;return _0x16f035[_0x61b06(0x1aa)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x381890,_0x2a1176){const _0x8bf8b8=a110_0x2c5cc6,_0x2061c9=_0x381890+'::'+(_0x2a1176[_0x8bf8b8(0x152)]()||_0x8bf8b8(0x11f)),_0x53d570=createHash(_0x8bf8b8(0x10d))[_0x8bf8b8(0x104)](_0x2061c9)[_0x8bf8b8(0x180)]('hex')[_0x8bf8b8(0x135)](0x0,0xc);return _0x8bf8b8(0x16a)+_0x53d570;}export function ensureJourneyDefaults(_0x2e3a91){const _0x2ef3d6=a110_0x2c5cc6;!_0x2e3a91[_0x2ef3d6(0x187)]&&(_0x2e3a91[_0x2ef3d6(0x187)]=''),!_0x2e3a91['state']&&(_0x2e3a91['state']=_0x2ef3d6(0x127));}export function resolveTDFolderPath(_0x35635b,_0x17e893,_0x17df29){const _0x21669b=a110_0x2c5cc6;if(!_0x17e893)return _0x35635b;if(_0x35635b===_0x17df29||_0x35635b[_0x21669b(0xe4)](_0x17df29+'/'))return _0x35635b;return _0x35635b?_0x17df29+'/'+_0x35635b:_0x17df29;}export function addFoldersToCreate(_0x3ea594,_0x187fac,_0x4e2cbd){const _0x23d2c7=a110_0x2c5cc6;if(!_0x3ea594)return;if(_0x187fac['has'](_0x3ea594))return;const _0x46f9b1=_0x3ea594[_0x23d2c7(0x15e)]('/');let _0x27f73f='';for(const _0x3e0aae of _0x46f9b1){_0x27f73f=_0x27f73f?_0x27f73f+'/'+_0x3e0aae:_0x3e0aae,!_0x187fac['has'](_0x27f73f)&&_0x4e2cbd[_0x23d2c7(0x156)](_0x27f73f);}}import*as a110_0x5a09b7 from'yaml';import{readFileSync}from'fs';import a110_0x122b0b from'path';import{isJourneyDef,parseYamlString as a110_0x28971b,toYamlString as a110_0x8d07eb,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(_0x27f3b3){const _0x1d65e8=a110_0x2c5cc6;if(Array[_0x1d65e8(0x14b)](_0x27f3b3))return'['+_0x27f3b3[_0x1d65e8(0x10e)](_0x59d956=>stableStringify(_0x59d956))['join'](',')+']';if(_0x27f3b3&&typeof _0x27f3b3===_0x1d65e8(0x11e)){const _0xa70ce1=_0x27f3b3,_0x4385c4=Object[_0x1d65e8(0x176)](_0xa70ce1)[_0x1d65e8(0xfc)](),_0x10bf61=_0x4385c4[_0x1d65e8(0x10e)](_0x1bf2d9=>'\x22'+_0x1bf2d9+'\x22:'+stableStringify(_0xa70ce1[_0x1bf2d9]));return'{'+_0x10bf61['join'](',')+'}';}const _0x248cd0=JSON['stringify'](_0x27f3b3);return _0x248cd0===undefined?'null':_0x248cd0;}function activationSignature(_0x2e90b2){const _0x4e56e0=a110_0x2c5cc6,_0x989f76={'connection':_0x2e90b2[_0x4e56e0(0x169)],..._0x2e90b2[_0x4e56e0(0x110)]!==undefined&&{'all_columns':_0x2e90b2['all_columns']},..._0x2e90b2[_0x4e56e0(0x1a1)]!==undefined&&{'columns':_0x2e90b2[_0x4e56e0(0x1a1)]},..._0x2e90b2[_0x4e56e0(0x136)]!==undefined&&{'behavior':_0x2e90b2[_0x4e56e0(0x136)]},..._0x2e90b2[_0x4e56e0(0x125)]!==undefined&&{'schedule':_0x2e90b2['schedule']},..._0x2e90b2[_0x4e56e0(0x102)]!==undefined&&{'notification':_0x2e90b2[_0x4e56e0(0x102)]},..._0x2e90b2['connector_config']!==undefined&&{'connector_config':_0x2e90b2[_0x4e56e0(0xe5)]},..._0x2e90b2[_0x4e56e0(0xd3)]!==undefined&&{'activation_template_id':_0x2e90b2[_0x4e56e0(0xd3)]}};return stableStringify(_0x989f76);}export async function prepareSegmentFiles(_0x5b4653,_0x2aca28,_0x1f85fa,_0x1c55fd,_0x136f18){const _0x3aab9d=a110_0x2c5cc6,{activationDefToCreateRequest:_0xfef864}=await import(_0x3aab9d(0x147)),_0x2cdb3e=[],_0x290158=new Set();for(const {yamlConfig:_0x51b713,folderPath:_0x2ae5ee,sourcePath:_0x1666b4}of _0x5b4653){const _0x50d078=resolveTDFolderPath(_0x2ae5ee,_0x1c55fd,_0x136f18),_0x6232de=_0x50d078+':'+_0x51b713[_0x3aab9d(0x1a2)],_0x148fd1=_0x2aca28[_0x3aab9d(0x118)][_0x3aab9d(0x13d)](_0x6232de),_0xa81d56=_0x148fd1?_0x2aca28['activationsBySegmentId']['get'](_0x148fd1['id'])||[]:[];addFoldersToCreate(_0x50d078,_0x2aca28[_0x3aab9d(0x184)],_0x290158);const _0x3e2074=calculateActivationActions(_0x51b713[_0x3aab9d(0x198)]||[],_0xa81d56,_0x2aca28[_0x3aab9d(0x18e)],_0x2aca28['connectionIdToNameMap']);for(const _0x166fe6 of _0x3e2074){(_0x166fe6[_0x3aab9d(0x170)]===_0x3aab9d(0x188)||_0x166fe6[_0x3aab9d(0x170)]===_0x3aab9d(0x104))&&_0x166fe6['yamlActivation']&&(_0x166fe6[_0x3aab9d(0x126)]=await _0xfef864(_0x166fe6[_0x3aab9d(0x16e)],_0x1f85fa));}const _0x2004b9=calculateSegmentDiff(_0x51b713,_0x148fd1,_0xa81d56,_0x2aca28[_0x3aab9d(0x18e)],_0x2aca28['connectionIdToNameMap']);_0x2cdb3e['push']({'relativePath':_0x51b713[_0x3aab9d(0x1a2)],'absolutePath':_0x1666b4,'yamlConfig':_0x51b713,'folderPath':_0x50d078,'existingSegment':_0x148fd1,'existingActivations':_0xa81d56,'isNew':_0x2004b9['isNew'],'hasChanges':_0x2004b9[_0x3aab9d(0x15f)],'diff':_0x2004b9[_0x3aab9d(0xe8)],'activationActions':_0x3e2074});}return{'segmentFiles':_0x2cdb3e,'foldersToCreate':_0x290158};}export async function prepareJourneyFiles(_0x12a174,_0x315eda,_0x4305b0,_0x3566dc){const _0x600377=a110_0x2c5cc6,_0x5dc858=[],_0x5abfe5=new Set();for(const {yamlConfig:_0x262114,folderPath:_0x168431,sourcePath:_0x5d2f4c}of _0x12a174){const _0x4e51fa=resolveTDFolderPath(_0x168431,_0x4305b0,_0x3566dc),_0x11d25f=_0x4e51fa+':'+_0x262114['name'],_0x1bcabf=_0x315eda[_0x600377(0x132)][_0x600377(0x13d)](_0x11d25f);let _0x4a13af,_0x5558d6;if(_0x1bcabf&&_0x1bcabf[_0x600377(0x19b)]>0x0){const _0x53eaa2=buildLocalExpandedRuleMappings(_0x262114),{createYamlContext:_0x44490b,prefetchJourneySegments:_0x4a2f8f}=createPushYamlContextForBundle(_0x315eda[_0x600377(0xd1)],_0x315eda[_0x600377(0x14e)],_0x315eda[_0x600377(0x100)],_0x53eaa2,_0x315eda[_0x600377(0x18e)],_0x315eda[_0x600377(0xd9)],_0x315eda['activationStepsById'],_0x315eda['journeyById']);await _0x4a2f8f(_0x1bcabf['map'](_0x1fadec=>_0x1fadec['id']));const _0x3258e8=hasMultipleVersions(_0x262114),_0xaf5b8c=async _0x17ddc8=>{const _0x1d8ee8=_0x600377,_0x38782e=_0x315eda['journeyById']?.['get'](_0x17ddc8);if(_0x38782e)return _0x38782e;return _0x315eda[_0x1d8ee8(0x166)]({'journeyId':_0x17ddc8,'journeyName':_0x262114['name'],'isMultiVersion':_0x1bcabf[_0x1d8ee8(0x19b)]>0x1});};if(_0x3258e8&&_0x1bcabf[_0x600377(0x19b)]>0x1){const _0x31fa3c=[];for(const _0x56e017 of _0x1bcabf){const _0x2b7b01=_0x56e017[_0x600377(0x1ac)]||0x1;_0x315eda['progress']?.[_0x600377(0x104)](_0x600377(0x116)+_0x262114['name']+'\x20v'+_0x2b7b01);const _0x313359=await _0xaf5b8c(_0x56e017['id']),_0x29253f=_0x44490b(_0x56e017['id']),_0x4c265d=await journeyResponseToDef(_0x313359,_0x29253f);_0x31fa3c['push']({'item':_0x56e017,'yaml':_0x4c265d});}const _0x54cd5b=buildLocalRuleToNameMappingFromJourney(_0x262114);_0x5558d6=buildMergedJourneyDef(_0x31fa3c,_0x54cd5b);const _0x2fbc93=Math['max'](..._0x31fa3c[_0x600377(0x10e)](_0xfae9cb=>_0xfae9cb['item'][_0x600377(0x1ac)]||0x0)),_0x11de7b=_0x1bcabf[_0x600377(0x19e)](_0x43cd14=>(_0x43cd14['versionNumber']||0x0)===_0x2fbc93);_0x11de7b&&(_0x315eda[_0x600377(0xf3)]?.['update']('Fetching\x20'+_0x262114['name']+'\x20v'+_0x2fbc93),_0x4a13af=await _0xaf5b8c(_0x11de7b['id']));}else{const _0x4c619f=_0x1bcabf[_0x1bcabf[_0x600377(0x19b)]-0x1];_0x315eda[_0x600377(0xf3)]?.[_0x600377(0x104)](_0x600377(0x116)+_0x262114[_0x600377(0x1a2)]),_0x4a13af=await _0xaf5b8c(_0x4c619f['id']);const _0x305af8=_0x44490b(_0x4c619f['id']),_0x1e5118=await journeyResponseToDef(_0x4a13af,_0x305af8),_0x28b694=buildLocalRuleToNameMappingFromJourney(_0x262114);_0x5558d6=buildMergedJourneyDef([{'item':_0x4c619f,'yaml':_0x1e5118}],_0x28b694);}}addFoldersToCreate(_0x4e51fa,_0x315eda['folderPathToId'],_0x5abfe5);const _0x269bf5=calculateJourneyDiff(_0x262114,_0x5558d6);_0x5dc858['push']({'relativePath':_0x262114[_0x600377(0x1a2)],'absolutePath':_0x5d2f4c,'yamlConfig':_0x262114,'folderPath':_0x4e51fa,'existingJourney':_0x4a13af,'isNew':_0x269bf5[_0x600377(0xff)],'hasChanges':_0x269bf5[_0x600377(0x15f)],'diff':_0x269bf5['diff']});}return{'journeyFiles':_0x5dc858,'foldersToCreate':_0x5abfe5};}export function calculateActivationActions(_0x180f04,_0xa0f483,_0x1465a7,_0xd4cb8a){const _0x224eaf=a110_0x2c5cc6,_0x3c6349=[],_0xac6095=new Map();for(const _0x2b9661 of _0xa0f483){_0xac6095[_0x224eaf(0x191)](_0x2b9661['name'],_0x2b9661);}const _0x15bd49=new Map();for(const _0x3c2858 of _0x180f04){_0x15bd49[_0x224eaf(0x191)](_0x3c2858[_0x224eaf(0x1a2)],_0x3c2858);}for(const _0x2c1ed9 of _0x180f04){const _0x19e9ca=_0xac6095[_0x224eaf(0x13d)](_0x2c1ed9[_0x224eaf(0x1a2)]);if(!_0x19e9ca)_0x3c6349['push']({'type':_0x224eaf(0x188),'name':_0x2c1ed9[_0x224eaf(0x1a2)],'yamlActivation':_0x2c1ed9});else{const _0x34eff6=activationResponseToDef(_0x19e9ca,_0x1465a7,_0xd4cb8a),_0x290324=a110_0x5a09b7[_0x224eaf(0xfb)](_0x34eff6),_0x4b7312=a110_0x5a09b7[_0x224eaf(0xfb)](_0x2c1ed9);_0x290324!==_0x4b7312&&_0x3c6349['push']({'type':_0x224eaf(0x104),'name':_0x2c1ed9[_0x224eaf(0x1a2)],'yamlActivation':_0x2c1ed9,'existingActivation':_0x19e9ca});}}for(const _0x175760 of _0xa0f483){!_0x15bd49[_0x224eaf(0x183)](_0x175760[_0x224eaf(0x1a2)])&&_0x3c6349[_0x224eaf(0xf7)]({'type':_0x224eaf(0x17b),'name':_0x175760[_0x224eaf(0x1a2)],'existingActivation':_0x175760});}return _0x3c6349;}function a110_0x2c2f(_0x1acbd0,_0x1e2f7b){_0x1acbd0=_0x1acbd0-0xcd;const _0x569af5=a110_0x569a();let _0x2c2f66=_0x569af5[_0x1acbd0];return _0x2c2f66;}export function calculateSegmentDiff(_0x2810cb,_0x4de59c,_0x1165fa,_0x593d5c,_0x1e6fdd){const _0x4c6f06=segmentToYamlString(_0x2810cb);if(_0x4de59c){const _0x5af7f6=segmentWithActivationsToYaml(_0x4de59c,_0x1165fa,undefined,_0x593d5c,_0x1e6fdd),_0x8343fb=segmentToYamlString(_0x5af7f6),_0x3dbb48=generateDiff(_0x8343fb,_0x4c6f06),_0x3d8df2=hasChanges(_0x3dbb48);return{'isNew':![],'hasChanges':_0x3d8df2,'diff':_0x3d8df2?formatDiffWithColors(_0x3dbb48):undefined};}const _0x160d89=generateDiff('',_0x4c6f06);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x160d89)};}export function calculateJourneyDiff(_0x200cf4,_0x5cb71d){const _0x1a34fa=normalizeJourneyDef(_0x200cf4,_0x200cf4),_0x13d486=a110_0x8d07eb(_0x1a34fa);if(_0x5cb71d){const _0x1b6754=normalizeJourneyDef(_0x5cb71d,_0x200cf4),_0x7c3c23=a110_0x8d07eb(_0x1b6754),_0x454432=generateDiff(_0x7c3c23,_0x13d486),_0x12d88e=hasChanges(_0x454432);return{'isNew':![],'hasChanges':_0x12d88e,'diff':_0x12d88e?formatDiffWithColors(_0x454432):undefined};}const _0x130216=generateDiff('',_0x13d486);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x130216)};}export function findSegmentsToDelete(_0x4b1b44,_0x1b9369,_0x4e99e9,_0x1eee1f,_0x41cd9c){const _0x4ee677=a110_0x2c5cc6,_0x3f50ff=new Set();for(const {yamlConfig:_0x459db0,folderPath:_0x29d6d9}of _0x1b9369){_0x3f50ff[_0x4ee677(0x156)](_0x29d6d9+':'+_0x459db0[_0x4ee677(0x1a2)]);}return _0x4b1b44['filter'](_0x1cc910=>{const _0x25c31d=_0x4ee677,_0x19ec62=_0x1cc910['segmentFolderId']?_0x4e99e9[_0x25c31d(0x13d)](_0x1cc910['segmentFolderId'][_0x25c31d(0x195)]())||'':'',_0x4b420c=_0x19ec62+':'+_0x1cc910[_0x25c31d(0x1a2)];if(_0x3f50ff[_0x25c31d(0x183)](_0x4b420c))return![];if(_0x41cd9c)return _0x19ec62===_0x1eee1f||_0x19ec62['startsWith'](_0x1eee1f+'/');return!![];});}export function findJourneysToDelete(_0xac2f7a,_0x45465a,_0x3891b2,_0x268331,_0x4dee34){const _0x5699d1=a110_0x2c5cc6,_0x195ff6=new Set();for(const {yamlConfig:_0x4cc1a6,folderPath:_0x19b1d3}of _0x45465a){_0x195ff6[_0x5699d1(0x156)](_0x19b1d3+':'+_0x4cc1a6[_0x5699d1(0x1a2)]);}return _0xac2f7a[_0x5699d1(0x1b4)](_0x3f7314=>{const _0x39d8c5=_0x5699d1,_0x144a11=_0x3f7314['folderId']?_0x3891b2[_0x39d8c5(0x13d)](_0x3f7314[_0x39d8c5(0x128)])||'':'',_0xc83a90=_0x144a11+':'+_0x3f7314['journeyBundleName'];if(_0x195ff6[_0x39d8c5(0x183)](_0xc83a90))return![];if(_0x4dee34)return _0x144a11===_0x268331||_0x144a11['startsWith'](_0x268331+'/');return!![];});}export function buildSegmentLookupMap(_0x3f7643,_0x57f224){const _0x1ec958=a110_0x2c5cc6,_0x5e34e5=new Map();for(const _0x46d0ba of _0x3f7643){const _0x4f3f7d=_0x46d0ba[_0x1ec958(0x155)]?_0x57f224[_0x1ec958(0x13d)](_0x46d0ba[_0x1ec958(0x155)][_0x1ec958(0x195)]())||'':'',_0x28a195=_0x4f3f7d+':'+_0x46d0ba[_0x1ec958(0x1a2)];_0x5e34e5['set'](_0x28a195,_0x46d0ba);}return _0x5e34e5;}export function buildSegmentNameToIdMap(_0x803ab0){const _0x528a07=a110_0x2c5cc6,_0x2e6b81=new Map();for(const _0x34ec6b of _0x803ab0){_0x2e6b81[_0x528a07(0x191)](_0x34ec6b[_0x528a07(0x1a2)],_0x34ec6b['id']);}return _0x2e6b81;}export function buildJourneyBundleLookupMap(_0x15a9dd,_0x3d7db1){const _0x192e17=a110_0x2c5cc6,_0x4d54c5=new Map();for(const _0x556653 of _0x15a9dd){const _0x240aa9=_0x556653[_0x192e17(0x128)]?_0x3d7db1['get'](_0x556653[_0x192e17(0x128)])||'':'',_0x3975ef=_0x240aa9+':'+_0x556653[_0x192e17(0xd0)];!_0x4d54c5[_0x192e17(0x183)](_0x3975ef)&&_0x4d54c5['set'](_0x3975ef,[]),_0x4d54c5[_0x192e17(0x13d)](_0x3975ef)['push'](_0x556653);}for(const _0x5e1576 of _0x4d54c5['values']()){_0x5e1576['sort']((_0x13bde4,_0x4db1bc)=>(_0x13bde4[_0x192e17(0x1ac)]||0x0)-(_0x4db1bc[_0x192e17(0x1ac)]||0x0));}return _0x4d54c5;}export function collectFoldersToCreate(_0x3c2740,_0x5e0411){const _0xbf5b9=a110_0x2c5cc6,_0x19466d=new Set();for(const _0x2bd9ac of _0x3c2740){if(!_0x2bd9ac)continue;if(_0x5e0411[_0xbf5b9(0x183)](_0x2bd9ac))continue;const _0x9676b0=_0x2bd9ac[_0xbf5b9(0x15e)]('/');let _0x4e7c31='';for(const _0x59f4ec of _0x9676b0){_0x4e7c31=_0x4e7c31?_0x4e7c31+'/'+_0x59f4ec:_0x59f4ec,!_0x5e0411[_0xbf5b9(0x183)](_0x4e7c31)&&_0x19466d['add'](_0x4e7c31);}}return _0x19466d;}export function parseAndClassifyYamlFiles(_0x17ed7a,_0x4b0db8,_0x4abcb9){const _0x503d39=a110_0x2c5cc6,_0x4a2ffa=[],_0x5b2898=[];for(const _0x7dc63b of _0x17ed7a){const _0x34a13d=a110_0x122b0b[_0x503d39(0x1ad)](_0x4b0db8,a110_0x122b0b['dirname'](_0x7dc63b)),_0x369b8c=_0x34a13d==='.'?'':_0x34a13d,_0x385236=readFileSync(_0x7dc63b,'utf-8'),_0x571317=a110_0x5a09b7[_0x503d39(0x12d)](_0x385236);if(isJourneyDef(_0x571317)){const _0x455ed2=a110_0x28971b(_0x385236);_0x5b2898['push']({'yamlConfig':_0x455ed2,'folderPath':_0x369b8c,'sourcePath':_0x7dc63b});}else{if(!_0x4abcb9?.['skipSegments']){const _0x271ecf=parseSegmentYamlFile(_0x385236),_0x1b0d2a=normalizeChildSegmentYaml(_0x271ecf);_0x4a2ffa[_0x503d39(0xf7)]({'yamlConfig':_0x1b0d2a,'folderPath':_0x369b8c,'sourcePath':_0x7dc63b});}}}return{'segments':_0x4a2ffa,'journeys':_0x5b2898};}export function validateParsedFiles(_0x169ede,_0x5ab493){const _0x234278=a110_0x2c5cc6,_0x413bf5=[];for(const {yamlConfig:_0x45749d,sourcePath:_0x12dff8}of _0x169ede['segments']){const _0x6695=readFileSync(_0x12dff8,'utf-8'),_0x12a96c=a110_0x5a09b7[_0x234278(0x14f)](_0x6695),_0x4bf0d9=validateSegmentDef(_0x45749d,{'source':_0x6695,'document':_0x12a96c});if(!_0x4bf0d9[_0x234278(0x157)]){const _0x226f18=a110_0x122b0b[_0x234278(0x1ad)](_0x5ab493,_0x12dff8);_0x413bf5[_0x234278(0xf7)]({'filePath':_0x226f18,'source':_0x6695,'result':_0x4bf0d9,'isJourney':![]});}}for(const {yamlConfig:_0x448346,sourcePath:_0x45e03f}of _0x169ede[_0x234278(0x13b)]){const _0x11d953=readFileSync(_0x45e03f,_0x234278(0xee)),_0x5ce34f=a110_0x5a09b7['parseDocument'](_0x11d953),_0x5d1006=validateJourneyDef(_0x448346,{'source':_0x11d953,'document':_0x5ce34f});if(!_0x5d1006['valid']){const _0x295d97=a110_0x122b0b['relative'](_0x5ab493,_0x45e03f);_0x413bf5[_0x234278(0xf7)]({'filePath':_0x295d97,'source':_0x11d953,'result':_0x5d1006,'isJourney':!![]});}}return _0x413bf5;}export function formatValidationErrors(_0x104753){const _0x350a09=a110_0x2c5cc6,_0x565bf1=[];for(const {filePath:_0x2cba62,source:_0x59987c,result:_0x5d157d,isJourney:_0x3b0ff4}of _0x104753){const _0xf02497=_0x3b0ff4?_0x350a09(0x177):_0x350a09(0x11f);_0x565bf1[_0x350a09(0xf7)]('\x0a'+_0x2cba62+'\x20('+_0xf02497+_0x350a09(0x146)+_0x5d157d[_0x350a09(0x123)][_0x350a09(0x19b)]+_0x350a09(0x14a)),_0x565bf1['push'](formatValidationResult(_0x5d157d,_0x59987c,_0x2cba62));}return _0x565bf1['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x21f3ad){const _0x3eb23a=a110_0x2c5cc6,_0x46b89c=new Set(),_0x43d7f0=new Map(),_0x2175c9=collectSegmentUsageCounts(_0x21f3ad);if(_0x21f3ad[_0x3eb23a(0xf4)])for(const [_0xb8f380,_0x397081]of Object[_0x3eb23a(0x14c)](_0x21f3ad[_0x3eb23a(0xf4)])){_0x46b89c[_0x3eb23a(0x156)](_0xb8f380);if(_0x397081[_0x3eb23a(0xef)]){const _0x219f0f=yamlRuleToApi(_0x397081[_0x3eb23a(0xef)]),_0x56e54f=apiRuleToYaml(_0x219f0f);_0x43d7f0['set'](_0xb8f380,_0x56e54f);}}const _0x801fda=new Map();let _0x4d8653=0x0;for(const [_0x23a0dc,_0x161f14]of _0x43d7f0){const _0x58634d=serializeExpandedRule(_0x161f14,_0x43d7f0),_0x21f072=_0x801fda['get'](_0x58634d)||[];_0x21f072[_0x3eb23a(0xf7)]({'name':_0x23a0dc,'index':_0x4d8653}),_0x801fda[_0x3eb23a(0x191)](_0x58634d,_0x21f072),_0x4d8653++;}const _0x35c589=new Map();for(const [_0x419bc5,_0x3243cd]of _0x801fda){const _0x3a3b24=_0x3243cd[_0x3eb23a(0x135)]()[_0x3eb23a(0xfc)]((_0x943ef0,_0x181272)=>{const _0x24ce64=_0x3eb23a,_0x18c38c=_0x2175c9['get'](_0x943ef0[_0x24ce64(0x1a2)])||0x0,_0x355a05=_0x2175c9[_0x24ce64(0x13d)](_0x181272['name'])||0x0;if(_0x18c38c!==_0x355a05)return _0x355a05-_0x18c38c;return _0x943ef0[_0x24ce64(0xcd)]-_0x181272['index'];})[_0x3eb23a(0x10e)](_0x253992=>_0x253992['name']),_0x44f546=[];for(const _0x2857bc of _0x3a3b24){const _0x208bdf=_0x2175c9[_0x3eb23a(0x13d)](_0x2857bc)||0x0,_0x23f867=Math[_0x3eb23a(0x171)](_0x208bdf,0x1);for(let _0x1baf59=0x0;_0x1baf59<_0x23f867;_0x1baf59++){_0x44f546[_0x3eb23a(0xf7)](_0x2857bc);}}_0x35c589[_0x3eb23a(0x191)](_0x419bc5,_0x44f546);}return{'existingLocalSegmentNames':_0x46b89c,'localSegmentRules':_0x43d7f0,'localExpandedRuleToNames':_0x35c589};}async function buildServerSegmentRuleMap(_0x417883,_0x495f69,_0x2df3a6,_0x5c56a7){const _0x55d8f0=new Map(),_0x523e22=new Set(),_0x36ed49=async _0x18039a=>{const _0x2eb5a6=a110_0x2c2f;if(_0x523e22[_0x2eb5a6(0x183)](_0x18039a))return;_0x523e22['add'](_0x18039a);let _0x4e3d11=_0x2df3a6['find'](_0x4e2785=>_0x4e2785['id']===_0x18039a);if(!_0x4e3d11)try{_0x4e3d11=await _0x417883[_0x2eb5a6(0x11f)]['getSegment'](_0x495f69,_0x18039a);}catch{return;}if(!_0x4e3d11?.[_0x2eb5a6(0xef)])return;const _0x36f97a=apiRuleToYaml(_0x4e3d11['rule']);_0x55d8f0[_0x2eb5a6(0x191)](_0x18039a,_0x36f97a);const _0x572f3e=collectSegmentRefsFromRule(_0x36f97a);for(const _0x394066 of _0x572f3e){await _0x36ed49(_0x394066);}};for(const _0x49be01 of _0x5c56a7){await _0x36ed49(_0x49be01);}return _0x55d8f0;}export function createSegmentIdResolver(_0x3aa9c1,_0x454ed3){return async _0x2d85e2=>{const _0x361604=a110_0x2c2f,_0x1881f9=_0x3aa9c1[_0x361604(0x13d)](_0x2d85e2);if(!_0x1881f9)throw new SDKError(ErrorCode[_0x361604(0xf9)],_0x361604(0x151)+_0x2d85e2+_0x361604(0x18b)+_0x454ed3+'\x27)');return _0x1881f9;};}export function extractRootFolderId(_0x1409b1){const _0x2f43c7=a110_0x2c5cc6;return _0x1409b1['relationships']?.[_0x2f43c7(0xea)]?.['data']?.['id']||_0x1409b1[_0x2f43c7(0x114)]?.[_0x2f43c7(0x138)]?.[_0x2f43c7(0x15b)]?.['id'];}export function buildConnectionMaps(_0x53805a){const _0x3e6452=a110_0x2c5cc6,_0x1903bd=new Map(),_0x2a3bde=new Map(),_0x182bcd=new Map();for(const _0x4b5df2 of _0x53805a){_0x1903bd[_0x3e6452(0x191)](_0x4b5df2['name'],parseInt(_0x4b5df2['id'],0xa)),_0x2a3bde[_0x3e6452(0x191)](_0x4b5df2['id'],_0x4b5df2[_0x3e6452(0x1a2)]),_0x182bcd['set'](_0x4b5df2[_0x3e6452(0x1a2)],_0x4b5df2[_0x3e6452(0x170)]);}return{'nameToId':_0x1903bd,'idToName':_0x2a3bde,'nameToType':_0x182bcd};}function a110_0x569a(){const _0x507793=['deleted','reduce','effectiveFolderId','journey_created','):\x20','./child-segment-yaml.js','861780RbECau','segmentNameToId','\x20error(s)','isArray','entries','Created\x20segment\x20\x27','parentId','parseDocument','activation_','Segment\x20not\x20found:\x20','trim','createdSegmentIds','Updated\x20journey\x20\x27','segmentFolderId','add','valid','journeyStages','JOURNEY_UPDATE_ERROR','Created\x20journey\x20\x27','data','createSegment','SEGMENT_UPDATE_ERROR','split','hasChanges','15213370CYymKh','buildUserMaps','Created\x20activation\x20\x27','activation_deleting','verbose','yamlConfig','fetchJourney','resolveJourneyId','\x0a\x20\x20','connection','journey_entry_criteria_','ACTIVATION_UPDATE_ERROR','\x27\x20decision\x20point\x20branch\x20\x27','6KbetYy','yamlActivation','attributes','type','max','activationActions','329XjMTqW','11nGoEqo','Activation','keys','journey','\x20activation\x20\x27','createFolder','stages','delete','Updating\x20segment\x20\x27','created','logSuccess','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','digest','action','Creating\x20segment\x20\x27','has','folderPathToId','decision_point','\x20segment\x20from\x20file:\x20','description','create','logDeleted','Journey\x20\x27','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','journey_updated','folder_created','idToEmailMap','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','existingJourney','set','embeddedSegmentNameToId','updated','__pending_','toString','698922VecKmN','createJourneySegment','activations','existingSegment','size','length','32705PfzFKv','embedded_segment_created','find','listActivations','7612353aCQWXG','columns','name','folderPath','Updated\x20activation\x20\x27','nameToId','localSegmentRules','activationParams','unchanged','message','replace','rootFolderId','versionNumber','relative','flatMap','entryCriteria','entry','INTERNAL','./journey-yaml.js','Stage\x20\x27','filter','index','activation_updating','DecisionPoint','journeyBundleName','deps','\x27\x20from\x20file:\x20','activation_template_id','Creating\x20activation\x20\x27','\x27\x20exit\x20criteria','WaitStep','199768YMysKJ','../../utils/async.js','connectionIdToNameMap','Deleted\x20activation\x20\x27','waitCondition','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','createActivation','segment_creating','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','withProgress','list','toLowerCase','steps','startsWith','connector_config','segment_updating','journeyActivationStepId','diff','existingActivation','parentSegmentFolder','from','branches','activation_deleted','utf-8','rule','embedded_segment_creating','Deleted\x20segment\x20\x27','getSegment','progress','segments','milestone','with','push','deleteActivation','SEGMENT_NOT_FOUND','\x27\x20wait\x20condition','stringify','sort','stage\x20\x27','journeyActivationNameToId','isNew','existingSegments','Activation\x20not\x20found:\x20','notification','logWarning','update','embedded_activation_creating','listSegments','Updating\x20activation\x20\x27','\x27...','Created\x20folder\x20\x27','absolutePath','segment_deleting','572bOyseW','sha1','map','entry_criteria','all_columns','folder_creating','NOT_FOUND','join','relationships','journeyId','Fetching\x20','kind','segmentByFolderAndName','\x20(referenced\x20in\x20journey\x20','folder','user','activation_created','onProgress','object','segment','segment_deleted','Entry\x20criteria:\x20','includes','errors','segmentId','schedule','validatedRequest','draft','folderId','Creating\x20folder\x20\x27','nameToType','Failed\x20to\x20','Updated\x20segment\x20\x27','parse','activation_updated','ACTIVATION_SYNTAX_ERROR','exitCriterias','activationContext','journeyBundlesByFolderAndName','1212676Iarixo','journey_creating','slice','behavior','goal\x20criteria','parentFolder','JOURNEY_SYNTAX_ERROR','getJourney','journeys','updateSegmentById','get','getActivation','SEGMENT_SYNTAX_ERROR','createdSegmentId','goal'];a110_0x569a=function(){return _0x507793;};return a110_0x569a();}export function calculatePushStats(_0x468952,_0x2ec39d,_0x20de5b,_0x2bbe94,_0x28a6a8,_0x365e31,_0x341057){const _0x323efd=a110_0x2c5cc6,_0x3c561d=_0x468952[_0x323efd(0x1b4)](_0x1c1142=>_0x1c1142[_0x323efd(0xff)]),_0x548898=_0x468952[_0x323efd(0x1b4)](_0x3d6ebb=>!_0x3d6ebb[_0x323efd(0xff)]&&_0x3d6ebb[_0x323efd(0x15f)]),_0x50ad30=_0x468952[_0x323efd(0x1b4)](_0x5d399f=>!_0x5d399f[_0x323efd(0xff)]&&!_0x5d399f['hasChanges']),_0x156ad7=_0x365e31?_0x2bbe94:[],_0x2a91a6=_0x2ec39d[_0x323efd(0x1b4)](_0x5d9e22=>_0x5d9e22[_0x323efd(0xff)]),_0xb9d9cd=_0x2ec39d['filter'](_0x76da20=>!_0x76da20['isNew']&&_0x76da20[_0x323efd(0x15f)]),_0x2a2cae=_0x2ec39d[_0x323efd(0x1b4)](_0x1e7b99=>!_0x1e7b99[_0x323efd(0xff)]&&!_0x1e7b99[_0x323efd(0x15f)]),_0x3d1935=_0x365e31?_0x28a6a8:[],_0x702029=_0x468952[_0x323efd(0x1ae)](_0x1f1481=>_0x1f1481[_0x323efd(0x172)]),_0x388a7b=_0x702029['filter'](_0x2cfce4=>_0x2cfce4['type']===_0x323efd(0x188)),_0x1be02b=_0x702029[_0x323efd(0x1b4)](_0x507a2f=>_0x507a2f['type']===_0x323efd(0x104)),_0x537904=_0x702029[_0x323efd(0x1b4)](_0x28f112=>_0x28f112[_0x323efd(0x170)]===_0x323efd(0x17b)),_0x27ab4c=Array[_0x323efd(0xeb)](_0x20de5b)[_0x323efd(0xfc)](),_0x18690d=_0x341057?![]:_0x3c561d['length']>0x0||_0x548898[_0x323efd(0x19b)]>0x0||_0x156ad7[_0x323efd(0x19b)]>0x0,_0x22299b=_0x2a91a6[_0x323efd(0x19b)]>0x0||_0xb9d9cd['length']>0x0||_0x3d1935[_0x323efd(0x19b)]>0x0,_0x3fa446=_0x341057?![]:_0x702029[_0x323efd(0x19b)]>0x0,_0x2dd3fc=_0x27ab4c[_0x323efd(0x19b)]>0x0;return{'segments':{'new':_0x3c561d,'changed':_0x548898,'unchanged':_0x50ad30,'toDelete':_0x156ad7},'journeys':{'new':_0x2a91a6,'changed':_0xb9d9cd,'unchanged':_0x2a2cae,'toDelete':_0x3d1935},'activations':{'all':_0x702029,'toCreate':_0x388a7b,'toUpdate':_0x1be02b,'toDelete':_0x537904},'folders':{'toCreate':_0x27ab4c},'counts':{'segments':{'new':_0x3c561d[_0x323efd(0x19b)],'changed':_0x548898['length'],'unchanged':_0x50ad30[_0x323efd(0x19b)],'toDelete':_0x156ad7[_0x323efd(0x19b)]},'journeys':{'new':_0x2a91a6['length'],'changed':_0xb9d9cd[_0x323efd(0x19b)],'unchanged':_0x2a2cae['length'],'toDelete':_0x3d1935[_0x323efd(0x19b)]},'activations':{'create':_0x388a7b[_0x323efd(0x19b)],'update':_0x1be02b[_0x323efd(0x19b)],'delete':_0x537904[_0x323efd(0x19b)]},'folders':_0x27ab4c[_0x323efd(0x19b)]},'hasChanges':_0x18690d||_0x22299b||_0x3fa446||_0x2dd3fc};}export async function buildPushExecutionContext(_0xf52c70,_0x24db2b,_0x5f3b79,_0x32b109,_0x1efe97,_0x1fc8cb){const _0x105fa7=a110_0x2c5cc6,_0x29c581=extractRootFolderId(_0x5f3b79),{pathToId:_0x5e8aec,idToPath:_0x130e74}=buildFolderMaps(_0x1efe97),_0x1485ad=buildSegmentNameToIdMap(_0x32b109),_0x541770=new Map(),{batchAsync:_0x22c53e}=await import(_0x105fa7(0xd8)),[_0x361bef,_0x2cbfb6]=await Promise['all']([_0xf52c70[_0x105fa7(0x11b)][_0x105fa7(0x161)](),_0xf52c70['connection'][_0x105fa7(0xe1)](),((async()=>{!_0x1fc8cb&&_0x32b109['length']>0x0&&await _0x22c53e(_0x32b109,async _0x432287=>{const _0x224ca7=a110_0x2c2f,_0x8c5376=await _0xf52c70['segment'][_0x224ca7(0x19f)](_0x24db2b,_0x432287['id']);_0x541770[_0x224ca7(0x191)](_0x432287['id'],_0x8c5376);});})())]),{emailToId:_0x458910,idToEmail:_0x1ae44a}=_0x361bef,_0x1ea147=buildConnectionMaps(_0x2cbfb6);return{'rootFolderId':_0x29c581,'folderPathToId':_0x5e8aec,'folderIdToPath':_0x130e74,'segmentNameToId':_0x1485ad,'activationsBySegmentId':_0x541770,'emailToIdMap':_0x458910,'idToEmailMap':_0x1ae44a,'connectionNameToIdMap':_0x1ea147[_0x105fa7(0x1a5)],'connectionIdToNameMap':_0x1ea147['idToName'],'connectionNameToTypeMap':_0x1ea147[_0x105fa7(0x12a)]};}export function createPushYamlContextForBundle(_0x4642ef,_0x59ace3,_0x25d12d,_0x50cd31,_0x3767a7,_0x3ccd04,_0x25bc60,_0x44bf1c){const {existingLocalSegmentNames:_0x439bd0,localExpandedRuleToNames:_0x46b1d9}=_0x50cd31,_0x3dd3c6=new Set(),_0x2e69d6=new Map(),_0x1c789f=new Map(),_0x18e4fa=new Map(),_0x4da3b8=createJumpTargetCache(),_0x2f0ef0=new Map(),_0x2e254=new Map(),_0x454030=new Set();let _0x175892;const _0x6fe477=_0x58820b=>{const _0x567b73={'resolveSegment':async _0x3d8536=>{const _0x4d01b9=a110_0x2c2f,_0x596af7=_0x18e4fa[_0x4d01b9(0x13d)](_0x3d8536);if(_0x596af7!==undefined)return{'name':_0x596af7,'isJourneyLocal':!![]};try{let _0x4e24a9=_0x25d12d['find'](_0x501251=>_0x501251['id']===_0x3d8536);!_0x4e24a9&&(_0x4e24a9=await _0x4642ef[_0x4d01b9(0x11f)][_0x4d01b9(0xf2)](_0x59ace3,_0x3d8536));const _0x15f763=generateJourneyLocalName(_0x4e24a9[_0x4d01b9(0x1a2)]),_0x20d76b=_0x4e24a9[_0x4d01b9(0x117)]===SEGMENT_KIND_JOURNEY&&_0x15f763!==undefined;let _0x33835d=_0x4e24a9[_0x4d01b9(0x1a2)],_0x26b3fb;if(_0x20d76b&&_0x4e24a9[_0x4d01b9(0xef)]){const _0x271cc5=apiRuleToYaml(_0x4e24a9['rule']);_0x2e254[_0x4d01b9(0x191)](_0x3d8536,_0x271cc5);const _0x27bdc0=async _0x1dde44=>{const _0x38a86c=_0x4d01b9,_0x37d71c=collectSegmentRefsFromRule(_0x1dde44);for(const _0x2f9ab3 of _0x37d71c){if(!_0x2e254[_0x38a86c(0x183)](_0x2f9ab3))try{const _0x137ca0=await _0x4642ef['segment'][_0x38a86c(0xf2)](_0x59ace3,_0x2f9ab3);if(_0x137ca0?.[_0x38a86c(0xef)]){const _0x2e1921=apiRuleToYaml(_0x137ca0[_0x38a86c(0xef)]);_0x2e254[_0x38a86c(0x191)](_0x2f9ab3,_0x2e1921),await _0x27bdc0(_0x2e1921);}}catch{}}};await _0x27bdc0(_0x271cc5);const _0x5c1eb0=serializeExpandedRule(_0x271cc5,_0x2e254),_0x368d82=_0x46b1d9[_0x4d01b9(0x13d)](_0x5c1eb0);if(_0x368d82&&_0x368d82[_0x4d01b9(0x19b)]>0x0){const _0x35187f=_0x2e69d6[_0x4d01b9(0x13d)](_0x5c1eb0)||0x0,_0x358b17=_0x368d82[_0x35187f]||_0x368d82[_0x368d82[_0x4d01b9(0x19b)]-0x1];_0x2e69d6[_0x4d01b9(0x191)](_0x5c1eb0,_0x35187f+0x1),_0x33835d=_0x358b17,_0x3dd3c6[_0x4d01b9(0x156)](_0x33835d),_0x18e4fa[_0x4d01b9(0x191)](_0x3d8536,_0x33835d);const _0x1be8de=await resolveRuleSegmentRefs(_0x271cc5,async _0x3f3f6e=>{const _0x3a78ef=_0x4d01b9,_0x3fd3f8=_0x18e4fa['get'](_0x3f3f6e);if(_0x3fd3f8)return _0x3fd3f8;const _0x5aac73=await _0x175892['resolveSegment'](_0x3f3f6e);return _0x5aac73[_0x3a78ef(0x1a2)];});_0x26b3fb={'description':_0x4e24a9[_0x4d01b9(0x187)],'rule':_0x1be8de};}else{const _0x4355d9=_0x2f0ef0[_0x4d01b9(0x13d)](_0x5c1eb0);if(_0x4355d9)_0x33835d=_0x4355d9,_0x18e4fa[_0x4d01b9(0x191)](_0x3d8536,_0x33835d);else{if(_0x15f763){let _0x32cb6f=_0x15f763,_0x25df0d=0x2;while(_0x3dd3c6[_0x4d01b9(0x183)](_0x32cb6f)||_0x439bd0[_0x4d01b9(0x183)](_0x32cb6f)){_0x32cb6f=_0x15f763+'_'+_0x25df0d,_0x25df0d++;}_0x3dd3c6['add'](_0x32cb6f),_0x33835d=_0x32cb6f;}_0x18e4fa[_0x4d01b9(0x191)](_0x3d8536,_0x33835d),_0x2f0ef0[_0x4d01b9(0x191)](_0x5c1eb0,_0x33835d);const _0x60af75=await resolveRuleSegmentRefs(_0x271cc5,async _0x1e6f65=>{const _0x3f1136=_0x4d01b9,_0x3662cb=_0x18e4fa[_0x3f1136(0x13d)](_0x1e6f65);if(_0x3662cb)return _0x3662cb;const _0x5402cd=await _0x175892['resolveSegment'](_0x1e6f65);return _0x5402cd['name'];});_0x26b3fb={'description':_0x4e24a9['description'],'rule':_0x60af75};}}}return{'name':_0x33835d,'isJourneyLocal':_0x20d76b,'definition':_0x26b3fb};}catch{return{'name':_0x3d8536,'isJourneyLocal':![]};}},'resolveActivation':async _0x566885=>{const _0x23ae2a=a110_0x2c2f,_0xb0aa8=_0x1c789f[_0x23ae2a(0x13d)](_0x566885);if(_0xb0aa8!==undefined)return{'name':_0xb0aa8,'isJourneyLocal':!![]};try{let _0x2f2952=_0x25bc60?.['get'](_0x566885);!_0x2f2952&&(_0x2f2952=await _0x4642ef['journey'][_0x23ae2a(0x13e)](_0x58820b,_0x566885));const _0x52accc=_0x2f2952[_0x23ae2a(0x16f)][_0x23ae2a(0x1a7)][_0x23ae2a(0x1a2)]||_0x566885,_0x205439=sanitizeYamlKey(_0x52accc)||_0x23ae2a(0x150)+_0x566885,_0x14204d=_0x205439;_0x1c789f[_0x23ae2a(0x191)](_0x566885,_0x14204d);const _0x569076=journeyActivationStepToYaml(_0x2f2952,_0x3767a7,_0x3ccd04);return{'name':_0x14204d,'isJourneyLocal':!![],'definition':_0x569076};}catch{return{'name':_0x566885,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x176266,_0x5a9f81)=>resolveJumpTarget(_0x176266,_0x5a9f81,_0x4da3b8,async _0x5256f6=>{const _0x5cf36f=a110_0x2c2f,_0x192034=_0x44bf1c?.[_0x5cf36f(0x13d)](_0x5256f6);if(_0x192034)return _0x192034;return _0x4642ef[_0x5cf36f(0x177)][_0x5cf36f(0x13a)](_0x5256f6);})};return _0x175892=_0x567b73,_0x567b73;},_0x7a66d2=async _0x382cbc=>{const _0x22187e=a110_0x2c2f,{collectSegmentIdsFromJourneyApi:_0x3469ce}=await import(_0x22187e(0x1b2)),{batchAsync:_0x4c696e}=await import(_0x22187e(0xd8)),_0x1d955c=new Set();for(const _0x2495fb of _0x382cbc){let _0x43b607=_0x44bf1c?.[_0x22187e(0x13d)](_0x2495fb);!_0x43b607&&(_0x43b607=await _0x4642ef[_0x22187e(0x177)][_0x22187e(0x13a)](_0x2495fb));const _0x48def8=_0x3469ce(_0x43b607);for(const _0x301c37 of _0x48def8){_0x1d955c[_0x22187e(0x156)](_0x301c37);}}let _0x131ee1=Array[_0x22187e(0xeb)](_0x1d955c);while(_0x131ee1['length']>0x0){const _0x27182d=_0x131ee1['filter'](_0x5c2531=>!_0x454030[_0x22187e(0x183)](_0x5c2531));if(_0x27182d[_0x22187e(0x19b)]===0x0)break;const _0x14d0a5=await _0x4c696e(_0x27182d,async _0x40c297=>{const _0x407178=_0x22187e;_0x454030[_0x407178(0x156)](_0x40c297);let _0x510997=_0x25d12d[_0x407178(0x19e)](_0x5d7ab2=>_0x5d7ab2['id']===_0x40c297);if(!_0x510997)try{_0x510997=await _0x4642ef['segment'][_0x407178(0xf2)](_0x59ace3,_0x40c297);}catch{return null;}return{'segmentId':_0x40c297,'segment':_0x510997};},0xa),_0x2db545=new Set();for(const _0x4e6fb7 of _0x14d0a5){if(!_0x4e6fb7?.['segment']?.[_0x22187e(0xef)])continue;const _0x4ef50f=apiRuleToYaml(_0x4e6fb7[_0x22187e(0x11f)][_0x22187e(0xef)]);_0x2e254[_0x22187e(0x191)](_0x4e6fb7[_0x22187e(0x124)],_0x4ef50f);const _0x12d6de=collectSegmentRefsFromRule(_0x4ef50f);for(const _0x1c6def of _0x12d6de){!_0x454030[_0x22187e(0x183)](_0x1c6def)&&_0x2db545[_0x22187e(0x156)](_0x1c6def);}}_0x131ee1=Array[_0x22187e(0xeb)](_0x2db545);}};return{'createYamlContext':_0x6fe477,'prefetchJourneySegments':_0x7a66d2};}export async function executePushSegments(_0x286dd2,_0x11141c,_0x50234b,_0x576908,_0x41da59){const _0x472f1f=a110_0x2c5cc6,{segmentDefToCreateRequest:_0x534cd7,segmentDefToUpdateRequest:_0x5d55b2}=await import(_0x472f1f(0x147)),_0x2404be=_0x50234b[_0x472f1f(0x184)],_0x58d737=0x5,_0x292e92=async _0x5b5f92=>{const _0x8979c8=_0x472f1f,_0x44fe3c=_0x5b5f92['folderPath']?_0x2404be['get'](_0x5b5f92[_0x8979c8(0x1a3)]):undefined;let _0x41f598;const _0x59d0cc={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5b5f92[_0x8979c8(0xff)]){_0x41da59[_0x8979c8(0x11d)]?.({'type':_0x8979c8(0xde),'name':_0x5b5f92[_0x8979c8(0x165)]['name']});const _0x50f565=_0x534cd7(_0x5b5f92['yamlConfig'],_0x44fe3c),_0x45bf52=await _0x41da59[_0x8979c8(0xe0)](_0x8979c8(0x182)+_0x5b5f92[_0x8979c8(0x165)][_0x8979c8(0x1a2)]+_0x8979c8(0x108),()=>_0x286dd2['segment'][_0x8979c8(0x15c)](_0x576908[_0x8979c8(0x14e)],_0x50f565));_0x41f598=_0x45bf52[_0x8979c8(0x15b)]['id'],_0x59d0cc['createdSegmentId']={'name':_0x5b5f92[_0x8979c8(0x165)]['name'],'id':_0x41f598},_0x41da59[_0x8979c8(0x11d)]?.({'type':'segment_created','name':_0x5b5f92[_0x8979c8(0x165)][_0x8979c8(0x1a2)],'segmentId':_0x41f598}),_0x41da59[_0x8979c8(0x17e)]?.(_0x8979c8(0x14d)+_0x5b5f92[_0x8979c8(0x165)][_0x8979c8(0x1a2)]+'\x27'),_0x59d0cc['created']=0x1;}else{if(_0x5b5f92['hasChanges']){_0x41da59['onProgress']?.({'type':_0x8979c8(0xe6),'name':_0x5b5f92[_0x8979c8(0x165)][_0x8979c8(0x1a2)]});const _0x541f0d=_0x5d55b2(_0x5b5f92[_0x8979c8(0x165)]);_0x44fe3c!==_0x5b5f92['existingSegment']?.[_0x8979c8(0x155)]&&(_0x541f0d['segmentFolderId']=_0x44fe3c?parseInt(_0x44fe3c,0xa):undefined),await _0x41da59[_0x8979c8(0xe0)](_0x8979c8(0x17c)+_0x5b5f92[_0x8979c8(0x165)][_0x8979c8(0x1a2)]+_0x8979c8(0x108),()=>_0x286dd2[_0x8979c8(0x11f)]['updateSegmentById'](_0x576908[_0x8979c8(0x14e)],_0x5b5f92[_0x8979c8(0x199)]['id'],_0x541f0d)),_0x41f598=_0x5b5f92['existingSegment']['id'],_0x41da59['onProgress']?.({'type':'segment_updated','name':_0x5b5f92[_0x8979c8(0x165)][_0x8979c8(0x1a2)]}),_0x41da59[_0x8979c8(0x17e)]?.(_0x8979c8(0x12c)+_0x5b5f92[_0x8979c8(0x165)][_0x8979c8(0x1a2)]+'\x27'),_0x59d0cc['updated']=0x1;}else _0x41f598=_0x5b5f92[_0x8979c8(0x199)]['id'];}}catch(_0x370a6d){const _0x97434e=isHttp400Error(_0x370a6d),_0xfc406f=_0x97434e?ErrorCode[_0x8979c8(0x13f)]:ErrorCode[_0x8979c8(0x15d)],_0x5f1be1=getErrorMessage(_0x370a6d);throw new SDKError(_0xfc406f,_0x8979c8(0x12b)+(_0x5b5f92[_0x8979c8(0xff)]?'create':_0x8979c8(0x104))+_0x8979c8(0x186)+_0x5b5f92['absolutePath']+_0x8979c8(0x168)+_0x5f1be1,_0x370a6d);}try{const _0x1d3084=await syncActivationsForSegment(_0x286dd2,_0x576908[_0x8979c8(0x14e)],_0x41f598,_0x5b5f92[_0x8979c8(0x165)][_0x8979c8(0x1a2)],_0x5b5f92[_0x8979c8(0x172)],_0x41da59,_0x5b5f92[_0x8979c8(0x10a)]);_0x59d0cc['activations']=_0x1d3084;}catch(_0x311250){if(_0x311250 instanceof SDKError)throw _0x311250;throw new SDKError(ErrorCode[_0x8979c8(0x16b)],_0x8979c8(0xdf)+_0x5b5f92[_0x8979c8(0x165)]['name']+_0x8979c8(0xd2)+_0x5b5f92['absolutePath']+_0x8979c8(0x168)+getErrorMessage(_0x311250),_0x311250);}return _0x59d0cc;},_0xf247f0=await batchAsync(_0x11141c,_0x292e92,_0x58d737),_0x3828a3={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xa6b320 of _0xf247f0){_0x3828a3['created']+=_0xa6b320[_0x472f1f(0x17d)],_0x3828a3[_0x472f1f(0x193)]+=_0xa6b320[_0x472f1f(0x193)],_0xa6b320[_0x472f1f(0x140)]&&_0x3828a3[_0x472f1f(0x153)][_0x472f1f(0x191)](_0xa6b320[_0x472f1f(0x140)]['name'],_0xa6b320[_0x472f1f(0x140)]['id']),_0x3828a3['activations'][_0x472f1f(0x17d)]+=_0xa6b320[_0x472f1f(0x198)][_0x472f1f(0x17d)],_0x3828a3[_0x472f1f(0x198)]['updated']+=_0xa6b320[_0x472f1f(0x198)]['updated'],_0x3828a3[_0x472f1f(0x198)]['deleted']+=_0xa6b320[_0x472f1f(0x198)][_0x472f1f(0x142)];}return _0x3828a3;}async function syncActivationsForSegment(_0xdcef40,_0x30d71f,_0x1cd97e,_0xbf5975,_0x1098a4,_0xc990d4,_0x2c6a48){const _0x455430=a110_0x2c5cc6,_0x36da9f={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x617847 of _0x1098a4){try{if(_0x617847[_0x455430(0x170)]===_0x455430(0x188)&&_0x617847[_0x455430(0x126)])_0xc990d4[_0x455430(0x11d)]?.({'type':'activation_creating','segmentName':_0xbf5975,'activationName':_0x617847[_0x455430(0x1a2)]}),await _0xc990d4[_0x455430(0xe0)](_0x455430(0xd4)+_0x617847[_0x455430(0x1a2)]+'\x27...',()=>_0xdcef40['segment'][_0x455430(0xdd)](_0x30d71f,_0x1cd97e,_0x617847['validatedRequest'])),_0xc990d4[_0x455430(0x11d)]?.({'type':_0x455430(0x11c),'segmentName':_0xbf5975,'activationName':_0x617847[_0x455430(0x1a2)]}),_0xc990d4[_0x455430(0x17e)]?.(_0x455430(0x162)+_0x617847[_0x455430(0x1a2)]+'\x27'),_0x36da9f[_0x455430(0x17d)]++;else{if(_0x617847[_0x455430(0x170)]===_0x455430(0x104)&&_0x617847['validatedRequest']&&_0x617847[_0x455430(0xe9)])_0xc990d4[_0x455430(0x11d)]?.({'type':_0x455430(0xce),'segmentName':_0xbf5975,'activationName':_0x617847[_0x455430(0x1a2)]}),await _0xc990d4[_0x455430(0xe0)](_0x455430(0x107)+_0x617847[_0x455430(0x1a2)]+_0x455430(0x108),()=>_0xdcef40[_0x455430(0x11f)]['updateActivation'](_0x30d71f,_0x1cd97e,_0x617847[_0x455430(0xe9)]['id'],_0x617847[_0x455430(0x126)])),_0xc990d4['onProgress']?.({'type':_0x455430(0x12e),'segmentName':_0xbf5975,'activationName':_0x617847[_0x455430(0x1a2)]}),_0xc990d4['logSuccess']?.(_0x455430(0x1a4)+_0x617847[_0x455430(0x1a2)]+'\x27'),_0x36da9f[_0x455430(0x193)]++;else _0x617847[_0x455430(0x170)]===_0x455430(0x17b)&&_0x617847['existingActivation']&&(_0xc990d4['onProgress']?.({'type':_0x455430(0x163),'segmentName':_0xbf5975,'activationName':_0x617847[_0x455430(0x1a2)]}),await _0xc990d4['withProgress']('Deleting\x20activation\x20\x27'+_0x617847['name']+_0x455430(0x108),()=>_0xdcef40[_0x455430(0x11f)][_0x455430(0xf8)](_0x30d71f,_0x1cd97e,_0x617847[_0x455430(0xe9)]['id'])),_0xc990d4['onProgress']?.({'type':_0x455430(0xed),'segmentName':_0xbf5975,'activationName':_0x617847[_0x455430(0x1a2)]}),_0xc990d4[_0x455430(0x189)]?.(_0x455430(0xda)+_0x617847['name']+'\x27'),_0x36da9f['deleted']++);}}catch(_0x421d62){const _0xe9ea27=isHttp400Error(_0x421d62),_0x2adda9=_0xe9ea27?ErrorCode[_0x455430(0x12f)]:ErrorCode[_0x455430(0x16b)],_0x475ba6=getErrorMessage(_0x421d62);throw new SDKError(_0x2adda9,_0x455430(0x12b)+_0x617847[_0x455430(0x170)]+_0x455430(0x178)+_0x617847[_0x455430(0x1a2)]+_0x455430(0xd2)+_0x2c6a48+'\x0a\x20\x20'+_0x475ba6,_0x421d62);}}return _0x36da9f;}export async function executePushFolders(_0x19c311,_0x4cb00d,_0x41e830,_0x4e6be,_0x35ba1b){const _0x58c3c6=a110_0x2c5cc6,_0x3212cd=new Map(_0x41e830);for(const _0x4f134c of _0x4cb00d){const _0x3b2e64=_0x4f134c[_0x58c3c6(0x15e)]('/'),_0x473e14=_0x3b2e64[_0x3b2e64['length']-0x1],_0xa1953a=_0x3b2e64['slice'](0x0,-0x1)[_0x58c3c6(0x113)]('/'),_0xcb72f6=_0x3212cd['get'](_0xa1953a);_0x35ba1b['onProgress']?.({'type':_0x58c3c6(0x111),'folder':_0x4f134c});const _0x2c2562={'name':_0x473e14,'parentFolderId':_0xcb72f6},_0x17e899=await _0x35ba1b[_0x58c3c6(0xe0)](_0x58c3c6(0x129)+_0x4f134c+_0x58c3c6(0x108),()=>_0x19c311[_0x58c3c6(0x11f)][_0x58c3c6(0x179)](_0x4e6be[_0x58c3c6(0x14e)],_0x2c2562));_0x3212cd[_0x58c3c6(0x191)](_0x4f134c,_0x17e899[_0x58c3c6(0x15b)]['id']),_0x35ba1b[_0x58c3c6(0x11d)]?.({'type':_0x58c3c6(0x18d),'folder':_0x4f134c,'folderId':_0x17e899['data']['id']}),_0x35ba1b['logInfo']?.(_0x58c3c6(0x109)+_0x4f134c+'\x27');}return _0x3212cd;}export async function executePushSegmentDeletions(_0x1dc6fa,_0x4d0ee6,_0x5735d7){const _0x58a77b=a110_0x2c5cc6;if(_0x4d0ee6['length']===0x0)return 0x0;const {batchAsync:_0x1a87d7}=await import(_0x58a77b(0xd8)),_0xb52321=0x5,_0x27a4f1=await _0x1a87d7(_0x4d0ee6,async _0x21960f=>{const _0x27b3be=_0x58a77b;return _0x5735d7[_0x27b3be(0x11d)]?.({'type':_0x27b3be(0x10b),'name':_0x21960f[_0x27b3be(0x1a2)]}),await _0x1dc6fa[_0x27b3be(0x11f)]['deleteSegment'](_0x21960f['id']),_0x5735d7[_0x27b3be(0x11d)]?.({'type':_0x27b3be(0x120),'name':_0x21960f['name']}),_0x5735d7[_0x27b3be(0x189)]?.(_0x27b3be(0xf1)+_0x21960f['name']+'\x27'),0x1;},_0xb52321);return _0x27a4f1[_0x58a77b(0x143)]((_0x17153c,_0x63c90c)=>_0x17153c+_0x63c90c,0x0);}export async function executePushJourneys(_0x49bc9c,_0x479727,_0x53140d,_0x24bf1c,_0x5c1666){const _0x83c978=a110_0x2c5cc6,{journeyDefToRequest:_0x4661ed}=await import(_0x83c978(0x1b2)),{activationDefToCreateRequest:_0xa2e94e,yamlRuleToApi:_0x5f5618,validateSegmentRule:_0xf9ad72}=await import(_0x83c978(0x147)),_0x29bdc1={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1633ee=new Map(_0x53140d['segmentNameToId']),_0x5e6e25=0x5;for(let _0x3f0c14=0x0;_0x3f0c14<_0x479727[_0x83c978(0x19b)];_0x3f0c14+=_0x5e6e25){const _0x329d2e=_0x479727[_0x83c978(0x135)](_0x3f0c14,_0x3f0c14+_0x5e6e25),_0x81e013=await Promise['all'](_0x329d2e[_0x83c978(0x10e)](async _0x21c98a=>{const _0x3b1973=_0x83c978;if(!_0x21c98a[_0x3b1973(0xff)]&&!_0x21c98a[_0x3b1973(0x15f)])return{'action':_0x3b1973(0x1a8),'name':_0x21c98a[_0x3b1973(0x165)][_0x3b1973(0x1a2)],'journeyId':_0x21c98a[_0x3b1973(0x190)]?.['id']};const _0x337431=_0x21c98a[_0x3b1973(0x1a3)]?_0x53140d[_0x3b1973(0x184)][_0x3b1973(0x13d)](_0x21c98a[_0x3b1973(0x1a3)]):undefined;_0x5c1666[_0x3b1973(0x11d)]?.({'type':_0x21c98a['isNew']?_0x3b1973(0x134):'journey_updating','name':_0x21c98a['yamlConfig'][_0x3b1973(0x1a2)]});try{const _0x35ae64=await executeSingleJourneyPush(_0x49bc9c,_0x21c98a,{..._0x53140d,'segmentNameToId':_0x1633ee},{'parentId':_0x24bf1c[_0x3b1973(0x14e)],'rootFolderId':_0x24bf1c[_0x3b1973(0x1ab)],'folderId':_0x337431,'verbose':_0x24bf1c[_0x3b1973(0x164)]},_0x5c1666,{'journeyDefToRequest':_0x4661ed,'activationDefToCreateRequest':_0xa2e94e,'yamlRuleToApi':_0x5f5618,'validateSegmentRule':_0xf9ad72});for(const [_0x3eb8cc,_0x220a13]of _0x35ae64[_0x3b1973(0x192)]){_0x1633ee[_0x3b1973(0x191)](_0x3eb8cc,_0x220a13),_0x29bdc1['embeddedSegmentNameToId'][_0x3b1973(0x191)](_0x3eb8cc,_0x220a13);}if(_0x35ae64[_0x3b1973(0x181)]===_0x3b1973(0x17d))_0x5c1666[_0x3b1973(0x11d)]?.({'type':_0x3b1973(0x145),'name':_0x21c98a[_0x3b1973(0x165)][_0x3b1973(0x1a2)],'journeyId':_0x35ae64['journeyId']}),_0x5c1666[_0x3b1973(0x17e)]?.(_0x3b1973(0x15a)+_0x21c98a[_0x3b1973(0x165)]['name']+'\x27'),_0x29bdc1[_0x3b1973(0x17d)]++;else _0x35ae64[_0x3b1973(0x181)]===_0x3b1973(0x193)&&(_0x5c1666[_0x3b1973(0x11d)]?.({'type':_0x3b1973(0x18c),'name':_0x21c98a[_0x3b1973(0x165)][_0x3b1973(0x1a2)]}),_0x5c1666[_0x3b1973(0x17e)]?.(_0x3b1973(0x154)+_0x21c98a[_0x3b1973(0x165)]['name']+'\x27'),_0x29bdc1['updated']++);return{'action':_0x35ae64['action'],'name':_0x21c98a[_0x3b1973(0x165)][_0x3b1973(0x1a2)],'journeyId':_0x35ae64[_0x3b1973(0x115)]};}catch(_0x47e7e8){const _0x11eef3=isHttp400Error(_0x47e7e8),_0x27bb21=_0x11eef3?ErrorCode[_0x3b1973(0x139)]:ErrorCode[_0x3b1973(0x159)],_0xf2ec13=getErrorMessage(_0x47e7e8);throw new SDKError(_0x27bb21,'Failed\x20to\x20'+(_0x21c98a[_0x3b1973(0xff)]?'create':_0x3b1973(0x104))+'\x20journey\x20from\x20file:\x20'+_0x21c98a[_0x3b1973(0x10a)]+_0x3b1973(0x168)+_0xf2ec13,_0x47e7e8);}}));_0x29bdc1['results']['push'](..._0x81e013);}return _0x29bdc1;}async function executeSingleJourneyPush(_0x564706,_0xfcc502,_0x2537c9,_0x60f28f,_0x42bd53,_0x5ec2dd){const _0x131afd=a110_0x2c5cc6,{journeyDefToRequest:_0xa91177,activationDefToCreateRequest:_0x427bf2,yamlRuleToApi:_0xac2369,validateSegmentRule:_0x5efac0}=_0x5ec2dd,_0x3ad277=new Map(),_0x396603=new Map(),_0x244a1b=new Map(),_0x3b89d9=new Map(),_0x5a071d=new Map();let _0x3ae613;const _0x3c5aba=async()=>{const _0x10afbc=a110_0x2c2f;if(_0x3ae613)return;_0x3ae613=new Map();if(!_0xfcc502['existingJourney'])return;const _0x238cbb=await _0x564706['journey']['listActivations'](_0xfcc502[_0x10afbc(0x190)]['id']);for(const _0x39eb4f of _0x238cbb){const _0x3d2b5b=journeyActivationStepToYaml(_0x39eb4f,_0x2537c9[_0x10afbc(0x18e)],_0x2537c9[_0x10afbc(0xd9)]),_0x46e9d0=activationSignature(_0x3d2b5b);!_0x3ae613[_0x10afbc(0x183)](_0x46e9d0)&&_0x3ae613[_0x10afbc(0x191)](_0x46e9d0,_0x39eb4f['id']),_0x3d2b5b[_0x10afbc(0x1a2)]&&_0x396603[_0x10afbc(0x191)](_0x3d2b5b[_0x10afbc(0x1a2)],_0x39eb4f['id']);}};if(_0xfcc502['existingJourney']&&_0xfcc502[_0x131afd(0x165)][_0x131afd(0xf4)]){const _0x5bd7f4=buildLocalExpandedRuleMappings(_0xfcc502[_0x131afd(0x165)]),_0x45e2c1=_0x5bd7f4[_0x131afd(0x1a6)];if(_0x45e2c1[_0x131afd(0x19a)]>0x0){const _0x46f6ec=new Map();for(const [_0x5cbc02,_0x1fdc4b]of _0x45e2c1){const _0x305677=serializeExpandedRule(_0x1fdc4b,_0x45e2c1);_0x46f6ec[_0x131afd(0x191)](_0x5cbc02,_0x305677);}const _0x202e1b=collectSegmentIdsFromJourneyApi(_0xfcc502[_0x131afd(0x190)]);if(_0x202e1b['size']>0x0){const _0x511e9b=await buildServerSegmentRuleMap(_0x564706,_0x60f28f[_0x131afd(0x14e)],_0x2537c9[_0x131afd(0x100)],_0x202e1b);if(_0x511e9b[_0x131afd(0x19a)]>0x0){const _0x48f13a=new Map();for(const [_0x2adfe6,_0x371f1a]of _0x511e9b){const _0x5a23bf=serializeExpandedRule(_0x371f1a,_0x511e9b);!_0x48f13a[_0x131afd(0x183)](_0x5a23bf)&&_0x48f13a[_0x131afd(0x191)](_0x5a23bf,_0x2adfe6);}for(const [_0x4d9c2e,_0x1d8b22]of _0x46f6ec){const _0x26ede7=_0x48f13a[_0x131afd(0x13d)](_0x1d8b22);_0x26ede7&&(_0x5a071d[_0x131afd(0x191)](_0x4d9c2e,_0x26ede7),_0x2537c9[_0x131afd(0x149)]['set'](_0x4d9c2e,_0x26ede7));}}}}}const _0x2a2b0d={'resolveSegmentId':async _0x4156db=>{const _0x1de346=_0x131afd,_0x1ed436=_0x2537c9[_0x1de346(0x149)][_0x1de346(0x13d)](_0x4156db);if(!_0x1ed436)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1de346(0x151)+_0x4156db+_0x1de346(0x119)+_0xfcc502[_0x1de346(0x165)][_0x1de346(0x1a2)]+')');return _0x1ed436;},'resolveEmbeddedSegmentId':async(_0x5035f1,_0x232b16)=>{const _0x538add=_0x131afd,_0x3231e4=_0x2537c9[_0x538add(0x149)][_0x538add(0x13d)](_0x5035f1);if(_0x3231e4)return _0x3231e4;const _0x17370d=_0x5a071d[_0x538add(0x13d)](_0x5035f1);if(_0x17370d)return _0x2537c9[_0x538add(0x149)][_0x538add(0x191)](_0x5035f1,_0x17370d),_0x17370d;const _0x51cbd9=_0x2537c9['existingSegments'][_0x538add(0x19e)](_0x3b9065=>_0x3b9065[_0x538add(0x1a2)]===_0x5035f1);if(_0x51cbd9)return _0x2537c9[_0x538add(0x149)][_0x538add(0x191)](_0x5035f1,_0x51cbd9['id']),_0x51cbd9['id'];if(_0xfcc502[_0x538add(0xff)]){const {stageName:_0x13b62e,criteriaName:_0xd6f0d4}=findSegmentCriteriaLocation(_0xfcc502[_0x538add(0x165)],_0x5035f1);return _0x5efac0(_0x5035f1,_0x232b16[_0x538add(0xef)]),_0x244a1b['set'](_0x5035f1,{'definition':_0x232b16,'stageName':_0x13b62e,'criteriaName':_0xd6f0d4}),createPendingSegmentId(_0x5035f1);}const _0x5109d2=_0xfcc502[_0x538add(0x190)]?.['id'];if(!_0x5109d2)throw new SDKError(ErrorCode[_0x538add(0x1b1)],_0x538add(0x17f));_0x5efac0(_0x5035f1,_0x232b16[_0x538add(0xef)]);const _0x439e67=generateDeterministicJourneySegmentName(_0xfcc502[_0x538add(0x165)][_0x538add(0x1a2)],_0x5035f1),_0x2f0b9d=_0x2537c9[_0x538add(0x100)][_0x538add(0x19e)](_0x4e3fc5=>_0x4e3fc5[_0x538add(0x1a2)]===_0x439e67),_0x1b75ca=createSegmentIdResolver(_0x2537c9[_0x538add(0x149)],_0x5035f1),_0x466d91=await resolveRuleSegmentIds(_0x232b16[_0x538add(0xef)],_0x1b75ca);let _0x354ad0;if(_0x2f0b9d)await _0x564706['segment'][_0x538add(0x13c)](_0x60f28f[_0x538add(0x14e)],_0x2f0b9d['id'],{'description':_0x232b16[_0x538add(0x187)]||_0x538add(0x121)+_0x5035f1,'rule':_0xac2369(_0x466d91,!![]),'countPopulation':!![]}),_0x354ad0=_0x2f0b9d['id'];else try{_0x354ad0=await _0x564706['segment'][_0x538add(0x197)]({'name':_0x439e67,'description':_0x232b16[_0x538add(0x187)]||'Entry\x20criteria:\x20'+_0x5035f1,'journeyId':_0x5109d2,'rule':_0xac2369(_0x466d91,!![]),'countPopulation':!![],'parentFolderId':_0x60f28f['rootFolderId']||'','audienceId':_0x60f28f[_0x538add(0x14e)]});}catch(_0x31629f){const _0x49c367=_0x31629f instanceof Error&&_0x31629f[_0x538add(0x1a9)][_0x538add(0x122)]('Name\x20has\x20already\x20been\x20taken');if(_0x49c367){const _0x7f2da9=await _0x564706['segment'][_0x538add(0x106)](_0x60f28f['parentId']),_0x16aadc=_0x7f2da9[_0x538add(0x19e)](_0x42e72b=>_0x42e72b['name']===_0x439e67);if(_0x16aadc)await _0x564706[_0x538add(0x11f)][_0x538add(0x13c)](_0x60f28f[_0x538add(0x14e)],_0x16aadc['id'],{'description':_0x232b16['description']||_0x538add(0x121)+_0x5035f1,'rule':_0xac2369(_0x466d91,!![]),'countPopulation':!![]}),_0x354ad0=_0x16aadc['id'];else throw _0x31629f;}else throw _0x31629f;}return _0x2537c9[_0x538add(0x149)]['set'](_0x5035f1,_0x354ad0),_0x3ad277[_0x538add(0x191)](_0x5035f1,_0x354ad0),_0x354ad0;},'resolveActivationId':async _0x4033de=>{const _0x1c7cb9=_0x131afd,_0x1d5e34=_0x396603['get'](_0x4033de);if(_0x1d5e34)return _0x1d5e34;if(_0xfcc502[_0x1c7cb9(0x190)]){await _0x3c5aba();const _0x578a8e=_0x396603['get'](_0x4033de);if(_0x578a8e)return _0x578a8e;}throw new SDKError(ErrorCode[_0x1c7cb9(0x112)],_0x1c7cb9(0x101)+_0x4033de+'\x20(referenced\x20in\x20journey\x20'+_0xfcc502[_0x1c7cb9(0x165)][_0x1c7cb9(0x1a2)]+').\x20'+_0x1c7cb9(0x18f));},'resolveEmbeddedActivationId':async(_0x3ef40a,_0x2c9d3e)=>{const _0x2a5a31=_0x131afd,_0x588d9f=_0x396603[_0x2a5a31(0x13d)](_0x3ef40a);if(_0x588d9f)return _0x588d9f;if(_0xfcc502['isNew'])return _0x3b89d9[_0x2a5a31(0x191)](_0x3ef40a,_0x2c9d3e),createPendingActivationId(_0x3ef40a);if(_0xfcc502[_0x2a5a31(0x190)]){await _0x3c5aba();const _0x58baa6=_0x396603[_0x2a5a31(0x13d)](_0x2c9d3e[_0x2a5a31(0x1a2)]);if(_0x58baa6)return _0x396603[_0x2a5a31(0x191)](_0x3ef40a,_0x58baa6),_0x58baa6;const _0x409825=activationSignature(_0x2c9d3e),_0x367801=_0x3ae613?.[_0x2a5a31(0x13d)](_0x409825);if(_0x367801)return _0x396603[_0x2a5a31(0x191)](_0x3ef40a,_0x367801),_0x367801;const _0x215cc0=await _0x427bf2(_0x2c9d3e,_0x2537c9[_0x2a5a31(0x131)]),_0x40effe=await _0x564706[_0x2a5a31(0x177)][_0x2a5a31(0xdd)](_0xfcc502[_0x2a5a31(0x190)]['id'],_0x215cc0);return _0x396603['set'](_0x3ef40a,_0x40effe['id']),_0x40effe['id'];}throw new SDKError(ErrorCode[_0x2a5a31(0x1b1)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x17c7e4=>{const _0x18c97c=_0x131afd;try{return await _0x564706[_0x18c97c(0x177)][_0x18c97c(0x167)](_0x60f28f['parentId'],_0x17c7e4);}catch(_0x4401e3){throw new SDKError(ErrorCode[_0x18c97c(0x112)],_0x18c97c(0x18a)+_0x17c7e4+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0xfcc502[_0x18c97c(0x165)][_0x18c97c(0x1a2)]+'\x27)',_0x4401e3);}},'resolveStageId':async(_0x9b8bf3,_0x252c89)=>{const _0x280bde=_0x131afd,_0x2f9c76=await _0x564706[_0x280bde(0x177)][_0x280bde(0x13a)](_0x9b8bf3),_0x452640=_0x2f9c76['attributes'][_0x280bde(0x158)][_0x280bde(0x19e)](_0x20b2f3=>_0x20b2f3[_0x280bde(0x1a2)][_0x280bde(0xe2)]()===_0x252c89[_0x280bde(0xe2)]());if(!_0x452640?.['id'])throw new SDKError(ErrorCode[_0x280bde(0x112)],_0x280bde(0x1b3)+_0x252c89+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x2f9c76[_0x280bde(0x16f)][_0x280bde(0xd0)]||_0x2f9c76[_0x280bde(0x16f)]['name'])+'\x27');return _0x452640['id'];}},_0x10f91c=await _0xa91177(_0xfcc502['yamlConfig'],_0x60f28f[_0x131afd(0x14e)],_0x2a2b0d),_0x41e4bb=_0x60f28f[_0x131afd(0x128)]||_0x60f28f[_0x131afd(0x1ab)];_0x41e4bb&&(_0x10f91c['relationships']={'parentFolder':{'data':{'id':_0x41e4bb,'type':_0x131afd(0x11a)}}});if(_0xfcc502[_0x131afd(0xff)]){if(_0x244a1b['size']>0x0||_0x3b89d9[_0x131afd(0x19a)]>0x0)return await executeThreeStepJourneyCreate(_0x564706,_0xfcc502,_0x10f91c,{'pendingEmbeddedSegments':_0x244a1b,'pendingEmbeddedActivations':_0x3b89d9,'embeddedSegmentNameToId':_0x3ad277,'journeyActivationNameToId':_0x396603},{..._0x60f28f,'effectiveFolderId':_0x41e4bb},_0x2537c9,_0x42bd53,_0x5ec2dd);else{ensureJourneyDefaults(_0x10f91c[_0x131afd(0x16f)]);const _0x56da3d=await _0x564706[_0x131afd(0x177)]['create'](_0x10f91c);return{'action':_0x131afd(0x17d),'journeyId':_0x56da3d['id'],'embeddedSegmentNameToId':_0x3ad277};}}else{if(_0xfcc502['hasChanges']&&_0xfcc502[_0x131afd(0x190)])return ensureJourneyDefaults(_0x10f91c[_0x131afd(0x16f)]),await _0x564706[_0x131afd(0x177)][_0x131afd(0x104)](_0xfcc502['existingJourney']['id'],_0x10f91c),{'action':_0x131afd(0x193),'journeyId':_0xfcc502[_0x131afd(0x190)]['id'],'embeddedSegmentNameToId':_0x3ad277};}return{'action':_0x131afd(0x1a8),'journeyId':_0xfcc502[_0x131afd(0x190)]?.['id'],'embeddedSegmentNameToId':_0x3ad277};}function findSegmentCriteriaLocation(_0x165741,_0x336618){const _0x5e1894=a110_0x2c5cc6,_0xcac2e0=_0x165741[_0x5e1894(0x17a)]||_0x165741[_0x5e1894(0x13b)]?.[0x0]?.['stages']||[];let _0x4a6d88=_0x5e1894(0x1b0),_0x547c8c=_0x336618;const _0x1b3fa2=_0x165741[_0x5e1894(0x141)]||_0x165741[_0x5e1894(0x13b)]?.[0x0]?.[_0x5e1894(0x141)];if(_0x1b3fa2?.[_0x5e1894(0x11f)]===_0x336618)return{'stageName':_0x5e1894(0x141),'criteriaName':_0x1b3fa2[_0x5e1894(0x1a2)]||_0x336618};_0x5a7e3e:for(const _0x3cbbff of _0xcac2e0){if(_0x3cbbff['entry_criteria']?.[_0x5e1894(0x11f)]===_0x336618){_0x4a6d88=_0x3cbbff[_0x5e1894(0x1a2)],_0x547c8c=_0x3cbbff[_0x5e1894(0x10f)][_0x5e1894(0x1a2)]||_0x336618;break;}if(_0x3cbbff['steps'])for(const _0x1badb1 of _0x3cbbff['steps']){if(_0x1badb1[_0x5e1894(0x170)]===_0x5e1894(0x185)&&_0x1badb1[_0x5e1894(0xf6)]?.[_0x5e1894(0xec)])for(const _0x5aa59b of _0x1badb1['with'][_0x5e1894(0xec)]){if(_0x5aa59b[_0x5e1894(0x11f)]===_0x336618){_0x4a6d88=_0x3cbbff[_0x5e1894(0x1a2)],_0x547c8c=_0x5aa59b[_0x5e1894(0x1a2)]||_0x336618;break _0x5a7e3e;}}}}return{'stageName':_0x4a6d88,'criteriaName':_0x547c8c};}async function executeThreeStepJourneyCreate(_0x525818,_0x493717,_0xe4d106,_0xb24603,_0x2102b7,_0x32be42,_0x26e545,_0x1661ae){const _0x5c9089=a110_0x2c5cc6,{activationDefToCreateRequest:_0xe3734c,yamlRuleToApi:_0x5deab6}=_0x1661ae,{pendingEmbeddedSegments:_0x136c23,pendingEmbeddedActivations:_0x32299d,embeddedSegmentNameToId:_0x1e01c9}=_0xb24603,_0x37fdce=JSON[_0x5c9089(0x12d)](JSON[_0x5c9089(0xfb)](_0xe4d106));ensureJourneyDefaults(_0x37fdce['attributes']),stripPendingIds(_0x37fdce);const _0x21587b=await _0x525818['journey'][_0x5c9089(0x188)](_0x37fdce),_0x2e2900=_0x21587b['id'],_0x2757fa=new Map();for(const _0x37848f of _0x21587b['attributes'][_0x5c9089(0x158)]){_0x2757fa[_0x5c9089(0x191)](_0x37848f[_0x5c9089(0x1a2)][_0x5c9089(0xe2)](),_0x37848f['id']);}for(const [_0x24a43d,{definition:_0x1b39ed}]of _0x136c23){const _0x2ae069=generateDeterministicJourneySegmentName(_0x493717[_0x5c9089(0x165)][_0x5c9089(0x1a2)],_0x24a43d);_0x26e545[_0x5c9089(0x11d)]?.({'type':_0x5c9089(0xf0),'journeyName':_0x493717['yamlConfig']['name'],'segmentName':_0x24a43d});const _0x282532=createSegmentIdResolver(_0x32be42[_0x5c9089(0x149)],_0x24a43d),_0x242419=await resolveRuleSegmentIds(_0x1b39ed[_0x5c9089(0xef)],_0x282532),_0x247c41=await _0x525818[_0x5c9089(0x11f)]['createJourneySegment']({'name':_0x2ae069,'description':_0x1b39ed[_0x5c9089(0x187)]||_0x5c9089(0x121)+_0x24a43d,'journeyId':_0x2e2900,'rule':_0x5deab6(_0x242419,!![]),'countPopulation':!![],'parentFolderId':_0x2102b7[_0x5c9089(0x144)]||'','audienceId':_0x2102b7[_0x5c9089(0x14e)]});_0x1e01c9[_0x5c9089(0x191)](_0x24a43d,_0x247c41),_0x32be42[_0x5c9089(0x149)][_0x5c9089(0x191)](_0x24a43d,_0x247c41),_0x26e545[_0x5c9089(0x11d)]?.({'type':_0x5c9089(0x19d),'journeyName':_0x493717['yamlConfig'][_0x5c9089(0x1a2)],'segmentName':_0x24a43d});}const _0x2396fc=new Map();for(const [_0x35ddfc,_0x312706]of _0x32299d){_0x26e545[_0x5c9089(0x11d)]?.({'type':_0x5c9089(0x105),'journeyName':_0x493717[_0x5c9089(0x165)][_0x5c9089(0x1a2)],'activationName':_0x35ddfc});const _0x486a64=await _0xe3734c(_0x312706,_0x32be42['activationContext']),_0x4784a7=await _0x525818[_0x5c9089(0x177)][_0x5c9089(0xdd)](_0x2e2900,_0x486a64);_0x2396fc[_0x5c9089(0x191)](_0x35ddfc,_0x4784a7['id']),_0xb24603[_0x5c9089(0xfe)][_0x5c9089(0x191)](_0x35ddfc,_0x4784a7['id']),_0x26e545['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x493717[_0x5c9089(0x165)][_0x5c9089(0x1a2)],'activationName':_0x35ddfc});}const _0x143d98=JSON[_0x5c9089(0x12d)](JSON['stringify'](_0xe4d106));return _0x143d98['id']=_0x2e2900,ensureJourneyDefaults(_0x143d98[_0x5c9089(0x16f)]),resolvePendingIdsInRequest(_0x143d98,_0xe4d106,_0x2757fa,_0x1e01c9,_0x2396fc,_0x26e545),await _0x525818[_0x5c9089(0x177)][_0x5c9089(0x104)](_0x2e2900,_0x143d98),{'action':_0x5c9089(0x17d),'journeyId':_0x2e2900,'embeddedSegmentNameToId':_0x1e01c9};}function stripPendingIds(_0x9a8cc8){const _0x4038fe=a110_0x2c5cc6;for(const _0x227f5b of _0x9a8cc8[_0x4038fe(0x16f)]['journeyStages']||[]){_0x227f5b[_0x4038fe(0x1af)]?.['segmentId']&&isPendingSegmentId(_0x227f5b[_0x4038fe(0x1af)][_0x4038fe(0x124)])&&delete _0x227f5b[_0x4038fe(0x1af)];if(_0x227f5b['steps'])for(const _0x3cc7d2 of Object[_0x4038fe(0x176)](_0x227f5b['steps'])){const _0x5341ef=_0x227f5b[_0x4038fe(0xe3)][_0x3cc7d2];_0x5341ef[_0x4038fe(0x170)]===_0x4038fe(0x175)&&_0x5341ef['journeyActivationStepId']&&isPendingActivationId(_0x5341ef[_0x4038fe(0xe7)])&&(_0x5341ef['journeyActivationStepId']='');if(_0x5341ef[_0x4038fe(0x170)]===_0x4038fe(0xcf)&&_0x5341ef[_0x4038fe(0xec)])for(const _0x237c89 of _0x5341ef[_0x4038fe(0xec)]){_0x237c89[_0x4038fe(0x124)]&&isPendingSegmentId(_0x237c89[_0x4038fe(0x124)])&&(_0x237c89[_0x4038fe(0x124)]='');}_0x5341ef[_0x4038fe(0x170)]===_0x4038fe(0xd6)&&_0x5341ef[_0x4038fe(0xdb)]?.['segmentId']&&isPendingSegmentId(_0x5341ef[_0x4038fe(0xdb)][_0x4038fe(0x124)])&&(_0x5341ef[_0x4038fe(0xdb)][_0x4038fe(0x124)]='');}}}function resolvePendingIdsInRequest(_0x304680,_0x4f1f4c,_0x590c7b,_0x46967b,_0x2dec6e,_0xe990b7){const _0x23b09b=a110_0x2c5cc6,_0x296341=(_0x14af6a,_0x27582a)=>{const _0x105a39=a110_0x2c2f;if(!isPendingSegmentId(_0x14af6a))return _0x14af6a;const _0x517bbc=extractPendingSegmentName(_0x14af6a),_0x11aa18=_0x46967b[_0x105a39(0x13d)](_0x517bbc);return!_0x11aa18&&_0xe990b7[_0x105a39(0x103)]?.(_0x105a39(0xdc)+_0x517bbc+'\x27\x20for\x20'+_0x27582a),_0x11aa18;};if(_0x304680[_0x23b09b(0x16f)]['goal']?.['segmentId']&&isPendingSegmentId(_0x304680[_0x23b09b(0x16f)][_0x23b09b(0x141)][_0x23b09b(0x124)])){const _0xa2f2bc=_0x296341(_0x304680['attributes'][_0x23b09b(0x141)][_0x23b09b(0x124)],_0x23b09b(0x137));_0xa2f2bc&&(_0x304680[_0x23b09b(0x16f)]['goal'][_0x23b09b(0x124)]=_0xa2f2bc);}for(const _0x439cd4 of _0x304680[_0x23b09b(0x16f)]['journeyStages']||[]){const _0x2dce6d=_0x590c7b['get'](_0x439cd4[_0x23b09b(0x1a2)][_0x23b09b(0xe2)]());_0x2dce6d&&(_0x439cd4['id']=_0x2dce6d);if(_0x439cd4[_0x23b09b(0x1af)]?.[_0x23b09b(0x124)]&&isPendingSegmentId(_0x439cd4[_0x23b09b(0x1af)][_0x23b09b(0x124)])){const _0x2a8de2=_0x296341(_0x439cd4[_0x23b09b(0x1af)][_0x23b09b(0x124)],'stage\x20\x27'+_0x439cd4[_0x23b09b(0x1a2)]+'\x27\x20entry\x20criteria');_0x2a8de2&&(_0x439cd4[_0x23b09b(0x1af)][_0x23b09b(0x124)]=_0x2a8de2);}if(_0x439cd4[_0x23b09b(0x130)])for(const _0x3a05f4 of _0x439cd4[_0x23b09b(0x130)]){if(_0x3a05f4[_0x23b09b(0x124)]&&isPendingSegmentId(_0x3a05f4[_0x23b09b(0x124)])){const _0x39dde8=_0x296341(_0x3a05f4['segmentId'],_0x23b09b(0xfd)+_0x439cd4[_0x23b09b(0x1a2)]+_0x23b09b(0xd5));_0x39dde8&&(_0x3a05f4[_0x23b09b(0x124)]=_0x39dde8);}}if(_0x439cd4[_0x23b09b(0xf5)]?.['segmentId']&&isPendingSegmentId(_0x439cd4[_0x23b09b(0xf5)][_0x23b09b(0x124)])){const _0x12ecdd=_0x296341(_0x439cd4[_0x23b09b(0xf5)]['segmentId'],_0x23b09b(0xfd)+_0x439cd4['name']+'\x27\x20milestone');_0x12ecdd&&(_0x439cd4[_0x23b09b(0xf5)][_0x23b09b(0x124)]=_0x12ecdd);}if(_0x439cd4['steps']){const _0x5a409c=_0x3f4fc0=>_0x4f1f4c[_0x23b09b(0x16f)][_0x23b09b(0x158)][_0x23b09b(0x19e)](_0x3c75c1=>_0x3c75c1[_0x23b09b(0x1a2)][_0x23b09b(0xe2)]()===_0x439cd4[_0x23b09b(0x1a2)]['toLowerCase']())?.[_0x23b09b(0xe3)]?.[_0x3f4fc0];for(const _0x461c81 of Object[_0x23b09b(0x176)](_0x439cd4[_0x23b09b(0xe3)])){const _0x50fc8f=_0x439cd4[_0x23b09b(0xe3)][_0x461c81],_0x5d93fa=_0x5a409c(_0x461c81);if(_0x50fc8f[_0x23b09b(0x170)]===_0x23b09b(0x175)&&_0x50fc8f['journeyActivationStepId']&&(isPendingActivationId(_0x50fc8f['journeyActivationStepId'])||_0x50fc8f[_0x23b09b(0xe7)]==='')){if(_0x5d93fa?.[_0x23b09b(0xe7)]&&isPendingActivationId(_0x5d93fa[_0x23b09b(0xe7)])){const _0x59afe1=extractPendingActivationName(_0x5d93fa[_0x23b09b(0xe7)]),_0x5d23f7=_0x2dec6e[_0x23b09b(0x13d)](_0x59afe1);_0x5d23f7&&(_0x50fc8f['journeyActivationStepId']=_0x5d23f7);}}if(_0x50fc8f[_0x23b09b(0x170)]==='DecisionPoint'&&_0x50fc8f[_0x23b09b(0xec)]&&_0x5d93fa?.[_0x23b09b(0xec)])for(let _0x18bfcf=0x0;_0x18bfcf<_0x50fc8f[_0x23b09b(0xec)]['length'];_0x18bfcf++){const _0x43c5f2=_0x50fc8f[_0x23b09b(0xec)][_0x18bfcf],_0x5f3e70=_0x5d93fa[_0x23b09b(0xec)][_0x18bfcf];if(_0x5f3e70?.['segmentId']&&isPendingSegmentId(_0x5f3e70[_0x23b09b(0x124)])){const _0x2c0c08=_0x296341(_0x5f3e70['segmentId'],'stage\x20\x27'+_0x439cd4[_0x23b09b(0x1a2)]+_0x23b09b(0x16c)+(_0x43c5f2[_0x23b09b(0x1a2)]||_0x18bfcf)+'\x27');_0x2c0c08&&(_0x43c5f2[_0x23b09b(0x124)]=_0x2c0c08);}}if(_0x50fc8f[_0x23b09b(0x170)]===_0x23b09b(0xd6)&&_0x50fc8f[_0x23b09b(0xdb)]?.[_0x23b09b(0x124)]&&_0x5d93fa?.[_0x23b09b(0xdb)]?.[_0x23b09b(0x124)]&&isPendingSegmentId(_0x5d93fa[_0x23b09b(0xdb)][_0x23b09b(0x124)])){const _0x416438=_0x296341(_0x5d93fa[_0x23b09b(0xdb)][_0x23b09b(0x124)],_0x23b09b(0xfd)+_0x439cd4[_0x23b09b(0x1a2)]+_0x23b09b(0xfa));_0x416438&&(_0x50fc8f['waitCondition']['segmentId']=_0x416438);}}}}}
@@ -1 +1 @@
1
- function a111_0x4690(_0x3ec79c,_0x2c7101){_0x3ec79c=_0x3ec79c-0x173;const _0x120aff=a111_0x120a();let _0x4690b6=_0x120aff[_0x3ec79c];return _0x4690b6;}(function(_0x114186,_0x3a9479){const _0x16b480=a111_0x4690,_0x5b9c2b=_0x114186();while(!![]){try{const _0x172dbb=parseInt(_0x16b480(0x174))/0x1+-parseInt(_0x16b480(0x17d))/0x2+parseInt(_0x16b480(0x17b))/0x3*(parseInt(_0x16b480(0x181))/0x4)+-parseInt(_0x16b480(0x180))/0x5*(parseInt(_0x16b480(0x177))/0x6)+-parseInt(_0x16b480(0x17f))/0x7+-parseInt(_0x16b480(0x176))/0x8+-parseInt(_0x16b480(0x173))/0x9*(-parseInt(_0x16b480(0x17c))/0xa);if(_0x172dbb===_0x3a9479)break;else _0x5b9c2b['push'](_0x5b9c2b['shift']());}catch(_0x214f95){_0x5b9c2b['push'](_0x5b9c2b['shift']());}}}(a111_0x120a,0xb0f5f));export function buildFolderIdToPathMap(_0x5393f3){const _0x1fd253=a111_0x4690,_0xecfe0a=new Map(),_0x498867=new Map();for(const _0x13d821 of _0x5393f3){_0x498867[_0x1fd253(0x175)](_0x13d821['id'],_0x13d821);}const _0x5d584b=new Set();for(const _0x417921 of _0x5393f3){!_0x417921['parentFolderId']&&_0x5d584b[_0x1fd253(0x17a)](_0x417921['id']);}function _0x5185e6(_0x45f634){const _0x1015eb=_0x1fd253;if(_0xecfe0a['has'](_0x45f634['id']))return _0xecfe0a[_0x1015eb(0x17e)](_0x45f634['id']);if(_0x5d584b['has'](_0x45f634['id']))return _0xecfe0a[_0x1015eb(0x175)](_0x45f634['id'],''),'';if(_0x45f634[_0x1015eb(0x182)]){const _0x101f92=_0x498867[_0x1015eb(0x17e)](_0x45f634['parentFolderId']);if(_0x101f92){const _0xcf28d9=_0x5185e6(_0x101f92),_0x5c43af=_0xcf28d9?_0xcf28d9+'/'+_0x45f634['name']:_0x45f634['name'];return _0xecfe0a[_0x1015eb(0x175)](_0x45f634['id'],_0x5c43af),_0x5c43af;}}const _0x1487bd=_0x45f634['name'];return _0xecfe0a['set'](_0x45f634['id'],_0x1487bd),_0x1487bd;}for(const _0x2f3d1f of _0x5393f3){_0x5185e6(_0x2f3d1f);}return _0xecfe0a;}function a111_0x120a(){const _0x4b0159=['set','3172952cCCZaS','588828uFlMQQ','name','has','add','3405891kjLoUc','1864810mEjlgF','127344ZpksEp','get','3155789zogUks','55jZTkuA','4JrteJh','parentFolderId','45wXmjiq','647765ocOvSh'];a111_0x120a=function(){return _0x4b0159;};return a111_0x120a();}export function buildFolderPathToIdMap(_0x581bd9){const _0x476ea2=a111_0x4690,_0x557328=new Map(),_0x191b94=new Map();for(const _0x16a228 of _0x581bd9){_0x191b94['set'](_0x16a228['id'],_0x16a228);}const _0x25352d=new Set();for(const _0x124a55 of _0x581bd9){!_0x124a55[_0x476ea2(0x182)]&&_0x25352d['add'](_0x124a55['id']);}function _0x209598(_0x255bb9){const _0x388638=_0x476ea2;if(_0x25352d[_0x388638(0x179)](_0x255bb9['id']))return'';if(_0x255bb9['parentFolderId']){const _0x2deae1=_0x191b94['get'](_0x255bb9[_0x388638(0x182)]);if(_0x2deae1){const _0x1e4528=_0x209598(_0x2deae1);return _0x1e4528?_0x1e4528+'/'+_0x255bb9[_0x388638(0x178)]:_0x255bb9[_0x388638(0x178)];}}return _0x255bb9[_0x388638(0x178)];}for(const _0x11b659 of _0x581bd9){const _0x494307=_0x209598(_0x11b659);_0x557328[_0x476ea2(0x175)](_0x494307,_0x11b659['id']);}return _0x557328;}export function buildFolderMaps(_0x185d40){const _0x1b47ad=buildFolderIdToPathMap(_0x185d40),_0x1dc15c=new Map();for(const [_0x72559e,_0x26ed1d]of _0x1b47ad){_0x1dc15c['set'](_0x26ed1d,_0x72559e);}return{'idToPath':_0x1b47ad,'pathToId':_0x1dc15c};}export function getFolderPath(_0x221f15,_0x49bb49){if(!_0x221f15)return'';return _0x49bb49['get'](_0x221f15)??'';}
1
+ (function(_0x865b21,_0x250d65){const _0x53c26a=a111_0x173d,_0x4fefb4=_0x865b21();while(!![]){try{const _0x243eb8=parseInt(_0x53c26a(0x135))/0x1*(-parseInt(_0x53c26a(0x13a))/0x2)+-parseInt(_0x53c26a(0x139))/0x3*(parseInt(_0x53c26a(0x13e))/0x4)+-parseInt(_0x53c26a(0x143))/0x5+parseInt(_0x53c26a(0x141))/0x6+-parseInt(_0x53c26a(0x145))/0x7*(parseInt(_0x53c26a(0x13d))/0x8)+-parseInt(_0x53c26a(0x13c))/0x9+parseInt(_0x53c26a(0x13f))/0xa*(parseInt(_0x53c26a(0x13b))/0xb);if(_0x243eb8===_0x250d65)break;else _0x4fefb4['push'](_0x4fefb4['shift']());}catch(_0xa89d20){_0x4fefb4['push'](_0x4fefb4['shift']());}}}(a111_0x17df,0x61edd));function a111_0x17df(){const _0x5c1b3f=['get','3013110EXVxjr','name','816325uHBczf','add','1617nXcXfm','36611hcHqPG','has','parentFolderId','set','2155653qPMCNt','2BZOWvn','187HvOnnx','1865799yNiqGK','25096ciHhuz','4qXMRTI','1029010iSdawk'];a111_0x17df=function(){return _0x5c1b3f;};return a111_0x17df();}export function buildFolderIdToPathMap(_0x2dc6f8){const _0x72d3f6=a111_0x173d,_0x39180b=new Map(),_0x5915bc=new Map();for(const _0x3ebc09 of _0x2dc6f8){_0x5915bc[_0x72d3f6(0x138)](_0x3ebc09['id'],_0x3ebc09);}const _0x36cdee=new Set();for(const _0x4dfaa0 of _0x2dc6f8){!_0x4dfaa0['parentFolderId']&&_0x36cdee[_0x72d3f6(0x144)](_0x4dfaa0['id']);}function _0x10c1fe(_0x45f6e0){const _0x31327f=_0x72d3f6;if(_0x39180b[_0x31327f(0x136)](_0x45f6e0['id']))return _0x39180b[_0x31327f(0x140)](_0x45f6e0['id']);if(_0x36cdee[_0x31327f(0x136)](_0x45f6e0['id']))return _0x39180b[_0x31327f(0x138)](_0x45f6e0['id'],''),'';if(_0x45f6e0[_0x31327f(0x137)]){const _0x1fb75f=_0x5915bc[_0x31327f(0x140)](_0x45f6e0[_0x31327f(0x137)]);if(_0x1fb75f){const _0x5ed075=_0x10c1fe(_0x1fb75f),_0x3c78b1=_0x5ed075?_0x5ed075+'/'+_0x45f6e0['name']:_0x45f6e0[_0x31327f(0x142)];return _0x39180b[_0x31327f(0x138)](_0x45f6e0['id'],_0x3c78b1),_0x3c78b1;}}const _0x520d03=_0x45f6e0[_0x31327f(0x142)];return _0x39180b[_0x31327f(0x138)](_0x45f6e0['id'],_0x520d03),_0x520d03;}for(const _0x361080 of _0x2dc6f8){_0x10c1fe(_0x361080);}return _0x39180b;}function a111_0x173d(_0x23ecff,_0x4f1698){_0x23ecff=_0x23ecff-0x135;const _0x17df66=a111_0x17df();let _0x173de4=_0x17df66[_0x23ecff];return _0x173de4;}export function buildFolderPathToIdMap(_0x36dcd8){const _0x23f1ab=a111_0x173d,_0x464fc3=new Map(),_0x55612a=new Map();for(const _0x227372 of _0x36dcd8){_0x55612a['set'](_0x227372['id'],_0x227372);}const _0x1b7043=new Set();for(const _0x5b83af of _0x36dcd8){!_0x5b83af[_0x23f1ab(0x137)]&&_0x1b7043[_0x23f1ab(0x144)](_0x5b83af['id']);}function _0x4081ba(_0x1b3803){const _0x103c4d=_0x23f1ab;if(_0x1b7043[_0x103c4d(0x136)](_0x1b3803['id']))return'';if(_0x1b3803[_0x103c4d(0x137)]){const _0x4d48ad=_0x55612a['get'](_0x1b3803[_0x103c4d(0x137)]);if(_0x4d48ad){const _0x1d69c8=_0x4081ba(_0x4d48ad);return _0x1d69c8?_0x1d69c8+'/'+_0x1b3803[_0x103c4d(0x142)]:_0x1b3803[_0x103c4d(0x142)];}}return _0x1b3803[_0x103c4d(0x142)];}for(const _0x29942c of _0x36dcd8){const _0x5bcea1=_0x4081ba(_0x29942c);_0x464fc3[_0x23f1ab(0x138)](_0x5bcea1,_0x29942c['id']);}return _0x464fc3;}export function buildFolderMaps(_0x4361fb){const _0x218d54=a111_0x173d,_0x430235=buildFolderIdToPathMap(_0x4361fb),_0x23b063=new Map();for(const [_0x2a390d,_0x2315dc]of _0x430235){_0x23b063[_0x218d54(0x138)](_0x2315dc,_0x2a390d);}return{'idToPath':_0x430235,'pathToId':_0x23b063};}export function getFolderPath(_0x467dda,_0x42dbac){const _0x214156=a111_0x173d;if(!_0x467dda)return'';return _0x42dbac[_0x214156(0x140)](_0x467dda)??'';}
@@ -1 +1 @@
1
- (function(_0x24baf6,_0x1bc1ee){const _0x16d13f=a112_0x3d83,_0x520df9=_0x24baf6();while(!![]){try{const _0xbf4751=-parseInt(_0x16d13f(0x127))/0x1*(parseInt(_0x16d13f(0x12c))/0x2)+parseInt(_0x16d13f(0x116))/0x3+-parseInt(_0x16d13f(0x137))/0x4*(-parseInt(_0x16d13f(0x134))/0x5)+parseInt(_0x16d13f(0x135))/0x6+-parseInt(_0x16d13f(0x121))/0x7*(-parseInt(_0x16d13f(0x144))/0x8)+-parseInt(_0x16d13f(0x13a))/0x9*(-parseInt(_0x16d13f(0x131))/0xa)+-parseInt(_0x16d13f(0x143))/0xb;if(_0xbf4751===_0x1bc1ee)break;else _0x520df9['push'](_0x520df9['shift']());}catch(_0x59e87b){_0x520df9['push'](_0x520df9['shift']());}}}(a112_0x5454,0x7b677));import a112_0x40376d from'path';import{parse as a112_0x41949f}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a112_0x3d83(_0x166a45,_0x1d906d){_0x166a45=_0x166a45-0x116;const _0x545485=a112_0x5454();let _0x3d831d=_0x545485[_0x166a45];return _0x3d831d;}function a112_0x5454(){const _0x13973b=['.yml','endsWith','9GjfZIw','filter','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','trim','pop','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','push','Path\x20attempts\x20to\x20navigate\x20above\x20root','split','14900193lvXnWw','6945720ktUjOR','readFile','1474680nXeCFK','File\x20not\x20found:\x20','name','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Cannot\x20navigate\x20above\x20root','length','startsWith','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','substring','journey','7GvceNo','slice','Path\x20cannot\x20be\x20empty','exists','raw','join','5KCGUkk','type','root','resolve','Path\x20segment\x20cannot\x20be\x20empty','276922hFAUSq','segment','parse','isAbsolute','segments','3659380fVeIzb','No\x20tdx.json\x20found\x20for\x20file:\x20','dirname','45295NqeEUN','2078946TvqtJM','Relative\x20path\x20cannot\x20be\x20empty','212iUNExe'];a112_0x5454=function(){return _0x13973b;};return a112_0x5454();}export function parsePath(_0x58c984){const _0x178dd2=a112_0x3d83;if(!_0x58c984||_0x58c984[_0x178dd2(0x13d)]()==='')throw new Error(_0x178dd2(0x123));const _0x5e8c65=_0x58c984[_0x178dd2(0x13d)]();if(_0x5e8c65==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x58c984};const _0x4741e7=_0x5e8c65[_0x178dd2(0x11c)]('/')?_0x5e8c65[_0x178dd2(0x11f)](0x1):_0x5e8c65,_0x72e80d=_0x4741e7[_0x178dd2(0x142)]('/')[_0x178dd2(0x13b)](_0x3c90dc=>_0x3c90dc!=='');if(_0x72e80d['length']===0x0)throw new Error(_0x178dd2(0x11d));const _0x10b7ca=_0x5e8c65['startsWith']('/')||!isRelativePathSegment(_0x72e80d[0x0]);for(const _0x24ef11 of _0x72e80d){validatePathSegment(_0x24ef11);}return{'segments':_0x72e80d,'isAbsolute':_0x10b7ca,'raw':_0x58c984};}function isRelativePathSegment(_0x20a66f){return _0x20a66f==='.'||_0x20a66f==='..';}function validatePathSegment(_0x43d4d5){const _0x3a7391=a112_0x3d83;if(_0x43d4d5==='')throw new Error(_0x3a7391(0x12b));if(_0x43d4d5==='.'||_0x43d4d5==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x43d4d5))throw new Error(_0x3a7391(0x13f)+_0x43d4d5);if(_0x43d4d5!==_0x43d4d5[_0x3a7391(0x13d)]()){}}export function validatePath(_0x5cc694){const _0x503723=a112_0x3d83;if(_0x5cc694[_0x503723(0x130)][_0x503723(0x11b)]===0x0&&!_0x5cc694[_0x503723(0x12f)])throw new Error(_0x503723(0x136));if(_0x5cc694[_0x503723(0x12f)]){if(_0x5cc694[_0x503723(0x130)][0x0]==='..')throw new Error(_0x503723(0x119));let _0x3524ad=0x0;for(const _0x241ea8 of _0x5cc694['segments']){if(_0x241ea8==='..'){if(_0x3524ad===0x0)throw new Error(_0x503723(0x141));_0x3524ad--;}else _0x241ea8!=='.'&&_0x3524ad++;}}}export function joinPaths(_0x554923,_0x192717){const _0x357d2e=a112_0x3d83;if(!_0x554923||_0x554923==='/')return _0x192717;if(!_0x192717||_0x192717==='.')return _0x554923;if(_0x192717[_0x357d2e(0x11c)]('/'))return _0x192717;const _0x147f05=parsePath(_0x554923),_0x3c0a5a=parsePath(_0x192717),_0x5dafb4=[..._0x147f05['segments']];for(const _0x6bdc14 of _0x3c0a5a['segments']){if(_0x6bdc14==='.')continue;else{if(_0x6bdc14==='..'){if(_0x5dafb4['length']===0x0)throw new Error(_0x357d2e(0x11a));_0x5dafb4[_0x357d2e(0x13e)]();}else _0x5dafb4[_0x357d2e(0x140)](_0x6bdc14);}}const _0x3fdf3e=_0x5dafb4[_0x357d2e(0x126)]('/');return _0x147f05[_0x357d2e(0x125)]['startsWith']('/')?'/'+_0x3fdf3e:_0x3fdf3e;}export function normalizePath(_0x974c8d){const _0x3d18d8=a112_0x3d83,_0x49e496=parsePath(_0x974c8d),_0x1ede25=[];for(const _0x45a22b of _0x49e496[_0x3d18d8(0x130)]){if(_0x45a22b==='.')continue;else{if(_0x45a22b==='..'){if(_0x1ede25['length']===0x0){if(_0x49e496['isAbsolute'])throw new Error(_0x3d18d8(0x11a));_0x1ede25[_0x3d18d8(0x140)]('..');}else _0x1ede25[_0x1ede25['length']-0x1]==='..'?_0x1ede25[_0x3d18d8(0x140)]('..'):_0x1ede25[_0x3d18d8(0x13e)]();}else _0x1ede25[_0x3d18d8(0x140)](_0x45a22b);}}if(_0x1ede25[_0x3d18d8(0x11b)]===0x0)return _0x49e496[_0x3d18d8(0x12f)]?'/':'.';const _0x180e26=_0x1ede25['join']('/');return _0x49e496[_0x3d18d8(0x125)][_0x3d18d8(0x11c)]('/')?'/'+_0x180e26:_0x180e26;}export function getParentPath(_0xc2a32a){const _0x66b73a=a112_0x3d83,_0x3993d0=parsePath(_0xc2a32a);if(_0x3993d0[_0x66b73a(0x130)]['length']<=0x1)return'/';const _0x39b5e6=_0x3993d0[_0x66b73a(0x130)][_0x66b73a(0x122)](0x0,-0x1)[_0x66b73a(0x126)]('/');return _0x3993d0[_0x66b73a(0x125)][_0x66b73a(0x11c)]('/')?'/'+_0x39b5e6:_0x39b5e6;}export function getBaseName(_0x4e4724){const _0x5b2238=parsePath(_0x4e4724);return _0x5b2238['segments'][_0x5b2238['segments']['length']-0x1]||'';}export function isChildPath(_0x192b8d,_0x154f4d){const _0x24b9d7=a112_0x3d83,_0x120f52=parsePath(_0x192b8d),_0xf4033f=parsePath(_0x154f4d);if(_0x120f52['segments'][_0x24b9d7(0x11b)]<=_0xf4033f['segments'][_0x24b9d7(0x11b)])return![];for(let _0x12d873=0x0;_0x12d873<_0xf4033f['segments']['length'];_0x12d873++){if(_0x120f52[_0x24b9d7(0x130)][_0x12d873]!==_0xf4033f[_0x24b9d7(0x130)][_0x12d873])return![];}return!![];}export function splitPath(_0x1a3e5c){const _0x74e03e=a112_0x3d83,_0x50c572=parsePath(_0x1a3e5c);if(_0x50c572['segments']['length']===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x50c572['segments'][_0x74e03e(0x11b)]===0x1)return{'parent':_0x50c572[_0x74e03e(0x130)][0x0]};return{'parent':_0x50c572[_0x74e03e(0x130)][0x0],'child':_0x50c572[_0x74e03e(0x130)][_0x74e03e(0x122)](0x1)[_0x74e03e(0x126)]('/')};}export function isYamlFilePath(_0x51b290){const _0x8a8da3=a112_0x3d83;return _0x51b290[_0x8a8da3(0x139)](_0x8a8da3(0x138))||_0x51b290['endsWith']('.yaml');}export async function resolveYamlFilePath(_0xfb44ea,_0x4eeb7b=nodeFileSystem){const _0x840382=a112_0x3d83,_0x1a17de=a112_0x40376d[_0x840382(0x12a)](_0xfb44ea);if(!await _0x4eeb7b[_0x840382(0x124)](_0x1a17de))throw new Error(_0x840382(0x117)+_0xfb44ea);let _0x2c294b=a112_0x40376d[_0x840382(0x133)](_0x1a17de),_0x160eac=null,_0x34d4fd=null;const _0x3d1925=a112_0x40376d[_0x840382(0x12e)](_0x2c294b)[_0x840382(0x129)];while(_0x2c294b!==_0x3d1925){const _0x138564=a112_0x40376d['join'](_0x2c294b,'tdx.json');if(await _0x4eeb7b[_0x840382(0x124)](_0x138564)){_0x160eac=_0x138564,_0x34d4fd=_0x2c294b;break;}_0x2c294b=a112_0x40376d[_0x840382(0x133)](_0x2c294b);}if(!_0x160eac||!_0x34d4fd)throw new Error(_0x840382(0x132)+_0xfb44ea);const _0x5bb6ac=await _0x4eeb7b[_0x840382(0x145)](_0x160eac),_0x591413=JSON[_0x840382(0x12e)](_0x5bb6ac),_0x544e71=_0x591413['parent_segment'];if(!_0x544e71)throw new Error(_0x840382(0x13c));const _0x10979a=await _0x4eeb7b[_0x840382(0x145)](_0x1a17de),_0x81f7ef=a112_0x41949f(_0x10979a),_0x2f9060=_0x81f7ef[_0x840382(0x118)];if(!_0x2f9060)throw new Error(_0x840382(0x11e)+_0xfb44ea);const _0x301f50=_0x81f7ef[_0x840382(0x128)]==='journey'?_0x840382(0x120):_0x840382(0x12d),_0x3408ed=a112_0x40376d['relative'](_0x34d4fd,_0x1a17de),_0xe97828=a112_0x40376d[_0x840382(0x133)](_0x3408ed),_0x4b7873=_0xe97828==='.'?'':_0xe97828['replace'](/\\/g,'/'),_0xa41f8f=_0x4b7873?_0x544e71+'/'+_0x4b7873+'/'+_0x2f9060:_0x544e71+'/'+_0x2f9060;return{'parentSegment':_0x544e71,'segmentName':_0x2f9060,'folderPath':_0x4b7873,'fullPath':_0xa41f8f,'resourceType':_0x301f50};}
1
+ (function(_0x1d1686,_0x44cfb8){const _0x242022=a112_0x1ffd,_0x10a9f9=_0x1d1686();while(!![]){try{const _0x5a9b48=-parseInt(_0x242022(0x188))/0x1+-parseInt(_0x242022(0x1a2))/0x2*(-parseInt(_0x242022(0x192))/0x3)+-parseInt(_0x242022(0x191))/0x4+-parseInt(_0x242022(0x190))/0x5*(-parseInt(_0x242022(0x18c))/0x6)+-parseInt(_0x242022(0x184))/0x7*(parseInt(_0x242022(0x19c))/0x8)+parseInt(_0x242022(0x19d))/0x9+-parseInt(_0x242022(0x18f))/0xa*(-parseInt(_0x242022(0x1a8))/0xb);if(_0x5a9b48===_0x44cfb8)break;else _0x10a9f9['push'](_0x10a9f9['shift']());}catch(_0x3b9115){_0x10a9f9['push'](_0x10a9f9['shift']());}}}(a112_0x11f9,0x6a619));import a112_0xbcfae9 from'path';import{parse as a112_0x1e733e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0xcffc64){const _0xf44986=a112_0x1ffd;if(!_0xcffc64||_0xcffc64[_0xf44986(0x1a6)]()==='')throw new Error(_0xf44986(0x18e));const _0xe04e21=_0xcffc64[_0xf44986(0x1a6)]();if(_0xe04e21==='/')return{'segments':[],'isAbsolute':!![],'raw':_0xcffc64};const _0x2b3840=_0xe04e21[_0xf44986(0x1ab)]('/')?_0xe04e21['substring'](0x1):_0xe04e21,_0xbed673=_0x2b3840['split']('/')[_0xf44986(0x196)](_0x47f298=>_0x47f298!=='');if(_0xbed673[_0xf44986(0x19a)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x40e973=_0xe04e21[_0xf44986(0x1ab)]('/')||!isRelativePathSegment(_0xbed673[0x0]);for(const _0x559622 of _0xbed673){validatePathSegment(_0x559622);}return{'segments':_0xbed673,'isAbsolute':_0x40e973,'raw':_0xcffc64};}function a112_0x1ffd(_0xb33d83,_0x1cd63f){_0xb33d83=_0xb33d83-0x184;const _0x11f949=a112_0x11f9();let _0x1ffde7=_0x11f949[_0xb33d83];return _0x1ffde7;}function isRelativePathSegment(_0x1b1739){return _0x1b1739==='.'||_0x1b1739==='..';}function validatePathSegment(_0x35963a){const _0x714912=a112_0x1ffd;if(_0x35963a==='')throw new Error(_0x714912(0x19e));if(_0x35963a==='.'||_0x35963a==='..')return;if(/[\x00-\x1F\x7F]/[_0x714912(0x18d)](_0x35963a))throw new Error(_0x714912(0x199)+_0x35963a);if(_0x35963a!==_0x35963a['trim']()){}}export function validatePath(_0x57cba3){const _0x6a9d20=a112_0x1ffd;if(_0x57cba3['segments']['length']===0x0&&!_0x57cba3[_0x6a9d20(0x189)])throw new Error(_0x6a9d20(0x1ae));if(_0x57cba3[_0x6a9d20(0x189)]){if(_0x57cba3[_0x6a9d20(0x1a1)][0x0]==='..')throw new Error(_0x6a9d20(0x1ad));let _0x51dd2e=0x0;for(const _0x3eb856 of _0x57cba3[_0x6a9d20(0x1a1)]){if(_0x3eb856==='..'){if(_0x51dd2e===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x51dd2e--;}else _0x3eb856!=='.'&&_0x51dd2e++;}}}export function joinPaths(_0x1f292a,_0x443948){const _0x3c44fa=a112_0x1ffd;if(!_0x1f292a||_0x1f292a==='/')return _0x443948;if(!_0x443948||_0x443948==='.')return _0x1f292a;if(_0x443948[_0x3c44fa(0x1ab)]('/'))return _0x443948;const _0x3ee0a3=parsePath(_0x1f292a),_0x550a9a=parsePath(_0x443948),_0x134379=[..._0x3ee0a3['segments']];for(const _0x8b4c70 of _0x550a9a[_0x3c44fa(0x1a1)]){if(_0x8b4c70==='.')continue;else{if(_0x8b4c70==='..'){if(_0x134379['length']===0x0)throw new Error(_0x3c44fa(0x195));_0x134379[_0x3c44fa(0x18a)]();}else _0x134379[_0x3c44fa(0x1aa)](_0x8b4c70);}}const _0x30b966=_0x134379[_0x3c44fa(0x197)]('/');return _0x3ee0a3['raw'][_0x3c44fa(0x1ab)]('/')?'/'+_0x30b966:_0x30b966;}export function normalizePath(_0x5d6279){const _0x107c6a=a112_0x1ffd,_0x17fec2=parsePath(_0x5d6279),_0x21f0f1=[];for(const _0x3288f6 of _0x17fec2['segments']){if(_0x3288f6==='.')continue;else{if(_0x3288f6==='..'){if(_0x21f0f1['length']===0x0){if(_0x17fec2['isAbsolute'])throw new Error('Cannot\x20navigate\x20above\x20root');_0x21f0f1[_0x107c6a(0x1aa)]('..');}else _0x21f0f1[_0x21f0f1[_0x107c6a(0x19a)]-0x1]==='..'?_0x21f0f1['push']('..'):_0x21f0f1[_0x107c6a(0x18a)]();}else _0x21f0f1[_0x107c6a(0x1aa)](_0x3288f6);}}if(_0x21f0f1[_0x107c6a(0x19a)]===0x0)return _0x17fec2[_0x107c6a(0x189)]?'/':'.';const _0x92075b=_0x21f0f1[_0x107c6a(0x197)]('/');return _0x17fec2[_0x107c6a(0x1b0)][_0x107c6a(0x1ab)]('/')?'/'+_0x92075b:_0x92075b;}function a112_0x11f9(){const _0x7bb252=['slice','journey','trim','readFile','2638471VsYsVF','root','push','startsWith','segment','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Relative\x20path\x20cannot\x20be\x20empty','name','raw','.yaml','27188TPZfbb','relative','Cannot\x20split\x20empty\x20path','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','765351CDxhPx','isAbsolute','pop','File\x20not\x20found:\x20','20472gTevZk','test','Path\x20cannot\x20be\x20empty','20uwNvIg','565kceAwx','1071628xniDQm','20157kezdhi','tdx.json','.yml','Cannot\x20navigate\x20above\x20root','filter','join','parse','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','length','endsWith','1208wKjAOg','6297426NKnqng','Path\x20segment\x20cannot\x20be\x20empty','replace','dirname','segments','146gQqXyk','type'];a112_0x11f9=function(){return _0x7bb252;};return a112_0x11f9();}export function getParentPath(_0x26ac56){const _0x5b8bfa=a112_0x1ffd,_0x11b09d=parsePath(_0x26ac56);if(_0x11b09d[_0x5b8bfa(0x1a1)][_0x5b8bfa(0x19a)]<=0x1)return'/';const _0x212ff2=_0x11b09d[_0x5b8bfa(0x1a1)]['slice'](0x0,-0x1)[_0x5b8bfa(0x197)]('/');return _0x11b09d[_0x5b8bfa(0x1b0)][_0x5b8bfa(0x1ab)]('/')?'/'+_0x212ff2:_0x212ff2;}export function getBaseName(_0x5c9e4b){const _0x1cdb1d=a112_0x1ffd,_0x5ba1c6=parsePath(_0x5c9e4b);return _0x5ba1c6[_0x1cdb1d(0x1a1)][_0x5ba1c6['segments'][_0x1cdb1d(0x19a)]-0x1]||'';}export function isChildPath(_0x220d0c,_0x70b0ed){const _0x4603da=a112_0x1ffd,_0x457ead=parsePath(_0x220d0c),_0x52b32c=parsePath(_0x70b0ed);if(_0x457ead[_0x4603da(0x1a1)][_0x4603da(0x19a)]<=_0x52b32c[_0x4603da(0x1a1)][_0x4603da(0x19a)])return![];for(let _0x5cec58=0x0;_0x5cec58<_0x52b32c[_0x4603da(0x1a1)][_0x4603da(0x19a)];_0x5cec58++){if(_0x457ead[_0x4603da(0x1a1)][_0x5cec58]!==_0x52b32c[_0x4603da(0x1a1)][_0x5cec58])return![];}return!![];}export function splitPath(_0x1afb93){const _0x53ac2a=a112_0x1ffd,_0x1e2970=parsePath(_0x1afb93);if(_0x1e2970[_0x53ac2a(0x1a1)][_0x53ac2a(0x19a)]===0x0)throw new Error(_0x53ac2a(0x186));if(_0x1e2970[_0x53ac2a(0x1a1)][_0x53ac2a(0x19a)]===0x1)return{'parent':_0x1e2970[_0x53ac2a(0x1a1)][0x0]};return{'parent':_0x1e2970['segments'][0x0],'child':_0x1e2970[_0x53ac2a(0x1a1)][_0x53ac2a(0x1a4)](0x1)['join']('/')};}export function isYamlFilePath(_0x4f5f8f){const _0xbd1672=a112_0x1ffd;return _0x4f5f8f[_0xbd1672(0x19b)](_0xbd1672(0x194))||_0x4f5f8f[_0xbd1672(0x19b)](_0xbd1672(0x1b1));}export async function resolveYamlFilePath(_0x2fbf41,_0x1d6a4b=nodeFileSystem){const _0x4b8c50=a112_0x1ffd,_0x4a82d7=a112_0xbcfae9['resolve'](_0x2fbf41);if(!await _0x1d6a4b['exists'](_0x4a82d7))throw new Error(_0x4b8c50(0x18b)+_0x2fbf41);let _0xdd8054=a112_0xbcfae9['dirname'](_0x4a82d7),_0x1f862e=null,_0x56bee5=null;const _0x30495e=a112_0xbcfae9[_0x4b8c50(0x198)](_0xdd8054)[_0x4b8c50(0x1a9)];while(_0xdd8054!==_0x30495e){const _0x45beca=a112_0xbcfae9[_0x4b8c50(0x197)](_0xdd8054,_0x4b8c50(0x193));if(await _0x1d6a4b['exists'](_0x45beca)){_0x1f862e=_0x45beca,_0x56bee5=_0xdd8054;break;}_0xdd8054=a112_0xbcfae9[_0x4b8c50(0x1a0)](_0xdd8054);}if(!_0x1f862e||!_0x56bee5)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x2fbf41);const _0x106c00=await _0x1d6a4b[_0x4b8c50(0x1a7)](_0x1f862e),_0x387b6b=JSON['parse'](_0x106c00),_0x3b78ab=_0x387b6b['parent_segment'];if(!_0x3b78ab)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x12bd2b=await _0x1d6a4b['readFile'](_0x4a82d7),_0x28646e=a112_0x1e733e(_0x12bd2b),_0x1d4867=_0x28646e[_0x4b8c50(0x1af)];if(!_0x1d4867)throw new Error(_0x4b8c50(0x187)+_0x2fbf41);const _0x8952e3=_0x28646e[_0x4b8c50(0x1a3)]===_0x4b8c50(0x1a5)?_0x4b8c50(0x1a5):_0x4b8c50(0x1ac),_0x25a0cf=a112_0xbcfae9[_0x4b8c50(0x185)](_0x56bee5,_0x4a82d7),_0x44eee9=a112_0xbcfae9[_0x4b8c50(0x1a0)](_0x25a0cf),_0x55d8f6=_0x44eee9==='.'?'':_0x44eee9[_0x4b8c50(0x19f)](/\\/g,'/'),_0x3e9d5d=_0x55d8f6?_0x3b78ab+'/'+_0x55d8f6+'/'+_0x1d4867:_0x3b78ab+'/'+_0x1d4867;return{'parentSegment':_0x3b78ab,'segmentName':_0x1d4867,'folderPath':_0x55d8f6,'fullPath':_0x3e9d5d,'resourceType':_0x8952e3};}
@@ -1 +1 @@
1
- (function(_0x24c345,_0x522a2f){const _0x549aff=a113_0x407f,_0x15b1f2=_0x24c345();while(!![]){try{const _0x395082=parseInt(_0x549aff(0x19c))/0x1+parseInt(_0x549aff(0x19b))/0x2+-parseInt(_0x549aff(0x1a0))/0x3+-parseInt(_0x549aff(0x199))/0x4+-parseInt(_0x549aff(0x19d))/0x5+parseInt(_0x549aff(0x19f))/0x6*(parseInt(_0x549aff(0x1a4))/0x7)+parseInt(_0x549aff(0x198))/0x8*(parseInt(_0x549aff(0x1a1))/0x9);if(_0x395082===_0x522a2f)break;else _0x15b1f2['push'](_0x15b1f2['shift']());}catch(_0x46a23e){_0x15b1f2['push'](_0x15b1f2['shift']());}}}(a113_0x5dab,0xc1b84));export function parseSegmentRef(_0x47c7b5){const _0x16e91b=a113_0x407f,_0x971e3b=_0x47c7b5['indexOf']('/');if(_0x971e3b===-0x1)return{'parentId':_0x47c7b5};if(_0x971e3b===0x0)throw new Error(_0x16e91b(0x19a)+_0x47c7b5+_0x16e91b(0x19e));const _0x504391=_0x47c7b5['substring'](0x0,_0x971e3b),_0x5dede2=_0x47c7b5[_0x16e91b(0x1a3)](_0x971e3b+0x1);if(_0x5dede2==='')throw new Error(_0x16e91b(0x19a)+_0x47c7b5+_0x16e91b(0x1a2));return{'parentId':_0x504391,'childId':_0x5dede2};}function a113_0x407f(_0x585d61,_0x12d0d2){_0x585d61=_0x585d61-0x198;const _0x5dabea=a113_0x5dab();let _0x407f20=_0x5dabea[_0x585d61];return _0x407f20;}function a113_0x5dab(){const _0x1200d4=['6075590mnvZRm','.\x20Parent\x20name\x20cannot\x20be\x20empty','12HJdDgQ','324129RISgyB','5788899KqxAqr','.\x20Child\x20name\x20cannot\x20be\x20empty','substring','3772069oMAkkI','8pJfjWN','78948LWVcDi','Invalid\x20segment\x20reference\x20format:\x20','483540DVAUeD','173659jvtNcP'];a113_0x5dab=function(){return _0x1200d4;};return a113_0x5dab();}
1
+ function a113_0x580e(_0x9fdd6e,_0x971aef){_0x9fdd6e=_0x9fdd6e-0x129;const _0x46c344=a113_0x46c3();let _0x580e6f=_0x46c344[_0x9fdd6e];return _0x580e6f;}function a113_0x46c3(){const _0x160736=['1286336TdvHzq','.\x20Parent\x20name\x20cannot\x20be\x20empty','751129pKRCmp','2913903sARfFS','substring','indexOf','221526FgTNjJ','.\x20Child\x20name\x20cannot\x20be\x20empty','Invalid\x20segment\x20reference\x20format:\x20','2855958VqSwyJ','7527672pWmddL','105BAWeDb','644ERZVDY','9675XDXCnE'];a113_0x46c3=function(){return _0x160736;};return a113_0x46c3();}(function(_0x4412c5,_0x377000){const _0x18e3a3=a113_0x580e,_0x1ae9ae=_0x4412c5();while(!![]){try{const _0x437be9=parseInt(_0x18e3a3(0x12f))/0x1+-parseInt(_0x18e3a3(0x12d))/0x2+-parseInt(_0x18e3a3(0x136))/0x3+-parseInt(_0x18e3a3(0x12b))/0x4*(parseInt(_0x18e3a3(0x12c))/0x5)+-parseInt(_0x18e3a3(0x133))/0x6*(-parseInt(_0x18e3a3(0x12a))/0x7)+parseInt(_0x18e3a3(0x129))/0x8+parseInt(_0x18e3a3(0x130))/0x9;if(_0x437be9===_0x377000)break;else _0x1ae9ae['push'](_0x1ae9ae['shift']());}catch(_0xcf807e){_0x1ae9ae['push'](_0x1ae9ae['shift']());}}}(a113_0x46c3,0xa1dc5));export function parseSegmentRef(_0x13a225){const _0x5e0823=a113_0x580e,_0xb9039f=_0x13a225[_0x5e0823(0x132)]('/');if(_0xb9039f===-0x1)return{'parentId':_0x13a225};if(_0xb9039f===0x0)throw new Error(_0x5e0823(0x135)+_0x13a225+_0x5e0823(0x12e));const _0x5e547b=_0x13a225[_0x5e0823(0x131)](0x0,_0xb9039f),_0x16ce12=_0x13a225[_0x5e0823(0x131)](_0xb9039f+0x1);if(_0x16ce12==='')throw new Error(_0x5e0823(0x135)+_0x13a225+_0x5e0823(0x134));return{'parentId':_0x5e547b,'childId':_0x16ce12};}
@@ -1 +1 @@
1
- (function(_0x15df23,_0x44508c){const _0x205c99=a114_0x4da5,_0x4000f0=_0x15df23();while(!![]){try{const _0x3923bb=parseInt(_0x205c99(0x169))/0x1+parseInt(_0x205c99(0x161))/0x2+-parseInt(_0x205c99(0x15a))/0x3+parseInt(_0x205c99(0x145))/0x4+parseInt(_0x205c99(0x15b))/0x5+parseInt(_0x205c99(0x15e))/0x6+-parseInt(_0x205c99(0x164))/0x7;if(_0x3923bb===_0x44508c)break;else _0x4000f0['push'](_0x4000f0['shift']());}catch(_0x2b4728){_0x4000f0['push'](_0x4000f0['shift']());}}}(a114_0x3f0a,0x50bdc));import a114_0x517e09 from'path';function a114_0x4da5(_0x2ca15f,_0x2f8e23){_0x2ca15f=_0x2ca15f-0x145;const _0x3f0ac2=a114_0x3f0a();let _0x4da598=_0x3f0ac2[_0x2ca15f];return _0x4da598;}import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';function a114_0x3f0a(){const _0x338baf=['segmentName','10221981iRtRZP','journey','isFile','File\x20not\x20found:\x20','includes','284600IrpjpB','root','basename','readFile','no_config','Parent\x20segment\x20not\x20specified','No\x20tdx.json\x20found\x20for\x20file:\x20','parentSegment','extname','match','directory','stat','trim','isScoped','context','no_parent','2454292AnVuAk','invalid_yaml','Not\x20a\x20YAML\x20file:\x20','file_not_found','parent_segment','isDirectory','error','scopedFolderPath','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','parse','folderPath','replace','dirname','resolve','cwd','startsWith','join','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','exists','file','type','551037zKlNgD','2922995rxjOet','relative','configDir','956070SWZbhW','string','No\x20tdx.json\x20found','665122ediACk','resourceType'];a114_0x3f0a=function(){return _0x338baf;};return a114_0x3f0a();}import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0xdafc16){const _0x56ac6b=a114_0x4da5;return _0xdafc16[_0x56ac6b(0x159)]!==_0x56ac6b(0x14b);}export function isScopedResolution(_0x2d8bd7){const _0x35e554=a114_0x4da5;return _0x2d8bd7[_0x35e554(0x159)]===_0x35e554(0x173)||_0x2d8bd7[_0x35e554(0x159)]===_0x35e554(0x158)||_0x2d8bd7[_0x35e554(0x159)]===_0x35e554(0x177);}export function getScopedDetails(_0x3b4c66){const _0x5cf339=a114_0x4da5;if(isScopedResolution(_0x3b4c66))return{'isScoped':_0x3b4c66[_0x5cf339(0x176)],'scopedFolderPath':_0x3b4c66[_0x5cf339(0x14c)]};return undefined;}async function findTdxConfigAsync(_0x23fdde,_0x220851){const _0x396b2e=a114_0x4da5;let _0x496685=a114_0x517e09[_0x396b2e(0x152)](_0x23fdde);const _0x5cf453=a114_0x517e09[_0x396b2e(0x14e)](_0x496685)[_0x396b2e(0x16a)];while(_0x496685!==_0x5cf453){const _0x532996=a114_0x517e09[_0x396b2e(0x155)](_0x496685,'tdx.json');if(await _0x220851[_0x396b2e(0x157)](_0x532996))try{const _0x403ffc=await _0x220851[_0x396b2e(0x16c)](_0x532996),_0x168bf=JSON[_0x396b2e(0x14e)](_0x403ffc);if(_0x168bf[_0x396b2e(0x149)]&&typeof _0x168bf['parent_segment']===_0x396b2e(0x15f))return{'configPath':_0x532996,'configDir':_0x496685,'parentSegment':_0x168bf[_0x396b2e(0x149)]};}catch{}_0x496685=a114_0x517e09[_0x396b2e(0x151)](_0x496685);}return null;}function calculateScopedPath(_0x1976c6,_0x2094e9){const _0x470f2c=a114_0x4da5,_0x2a2695=a114_0x517e09[_0x470f2c(0x15c)](_0x2094e9,_0x1976c6),_0x307b57=_0x2a2695!==''&&_0x2a2695!=='.'&&!_0x2a2695[_0x470f2c(0x154)]('..');return{'isScoped':_0x307b57,'scopedFolderPath':_0x307b57?_0x2a2695[_0x470f2c(0x150)](/\\/g,'/'):''};}export async function resolveTarget(_0xbae44f){const _0x430926=a114_0x4da5,{arg:_0x347166,contextParent:_0x1d0fa6,cwd:cwd=process[_0x430926(0x153)](),fs:fs=nodeFileSystem}=_0xbae44f;if(_0x347166&&isYamlFilePath(_0x347166))try{const _0x2af35c=await resolveYamlFilePath(_0x347166,fs),_0x55f1c4=a114_0x517e09['resolve'](_0x347166),_0x135548=a114_0x517e09[_0x430926(0x151)](_0x55f1c4),_0x34f3c6=await findTdxConfigAsync(_0x135548,fs);if(!_0x34f3c6){if(_0x1d0fa6){const _0x187279=a114_0x517e09[_0x430926(0x151)](_0x55f1c4);return{'type':_0x430926(0x158),'parentName':_0x1d0fa6,'targetDir':_0x187279,'configRoot':_0x187279,'filePath':_0x55f1c4,'resourceName':_0x2af35c[_0x430926(0x163)],'folderPath':_0x2af35c[_0x430926(0x14f)],'resourceType':_0x2af35c[_0x430926(0x162)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x430926(0x14b),'errorCode':_0x430926(0x16d),'message':_0x430926(0x16f)+_0x347166,'arg':_0x347166,'helpText':_0x430926(0x14d)};}const _0x4b23e8=calculateScopedPath(_0x135548,_0x34f3c6[_0x430926(0x15d)]);return{'type':_0x430926(0x158),'parentName':_0x34f3c6[_0x430926(0x170)],'targetDir':_0x34f3c6[_0x430926(0x15d)],'configRoot':_0x34f3c6['configDir'],'filePath':_0x55f1c4,'resourceName':_0x2af35c[_0x430926(0x163)],'folderPath':_0x2af35c[_0x430926(0x14f)],'resourceType':_0x2af35c[_0x430926(0x162)],'isScoped':_0x4b23e8['isScoped'],'scopedFolderPath':_0x4b23e8[_0x430926(0x14c)]};}catch(_0x40be95){const _0x5ce8e8=_0x40be95 instanceof Error?_0x40be95['message']:String(_0x40be95);if(_0x5ce8e8[_0x430926(0x168)]('File\x20not\x20found'))return{'type':_0x430926(0x14b),'errorCode':_0x430926(0x148),'message':_0x430926(0x167)+_0x347166,'arg':_0x347166};if(_0x5ce8e8[_0x430926(0x168)](_0x430926(0x160))){if(_0x1d0fa6){const _0x1efa0d=a114_0x517e09[_0x430926(0x152)](_0x347166);if(await fs['exists'](_0x1efa0d)){const _0x4b0040=a114_0x517e09[_0x430926(0x151)](_0x1efa0d),_0x1fe498=await fs[_0x430926(0x16c)](_0x1efa0d),_0x280b21=_0x1fe498[_0x430926(0x172)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x2e37c5=_0x1fe498['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x12cbfc=_0x280b21?_0x280b21[0x1][_0x430926(0x175)]():a114_0x517e09[_0x430926(0x16b)](_0x347166,a114_0x517e09[_0x430926(0x171)](_0x347166)),_0x46db69=_0x2e37c5&&_0x2e37c5[0x1][_0x430926(0x175)]()==='journey'?_0x430926(0x165):'segment';return{'type':_0x430926(0x158),'parentName':_0x1d0fa6,'targetDir':_0x4b0040,'configRoot':_0x4b0040,'filePath':_0x1efa0d,'resourceName':_0x12cbfc,'folderPath':'','resourceType':_0x46db69,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x430926(0x14b),'errorCode':_0x430926(0x16d),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x347166,'arg':_0x347166,'helpText':_0x430926(0x14d)};}return{'type':'error','errorCode':_0x430926(0x146),'message':_0x5ce8e8,'arg':_0x347166};}if(_0x347166){const _0xa99f2=a114_0x517e09[_0x430926(0x152)](cwd,_0x347166);let _0x26be12=null;try{_0x26be12=await fs[_0x430926(0x174)](_0xa99f2);}catch{}if(_0x26be12?.[_0x430926(0x14a)]()){const _0x13edec=await findTdxConfigAsync(_0xa99f2,fs);if(_0x13edec){const _0x22a3b9=calculateScopedPath(_0xa99f2,_0x13edec['configDir']);return{'type':_0x430926(0x173),'parentName':_0x13edec['parentSegment'],'targetDir':_0xa99f2,'configRoot':_0x13edec[_0x430926(0x15d)],'isScoped':_0x22a3b9[_0x430926(0x176)],'scopedFolderPath':_0x22a3b9[_0x430926(0x14c)]};}if(_0x1d0fa6)return{'type':_0x430926(0x173),'parentName':_0x1d0fa6,'targetDir':_0xa99f2,'configRoot':_0xa99f2,'isScoped':![],'scopedFolderPath':''};return{'type':_0x430926(0x14b),'errorCode':'no_config','message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x347166,'arg':_0x347166,'helpText':_0x430926(0x14d)};}if(_0x26be12?.[_0x430926(0x166)]())return{'type':_0x430926(0x14b),'errorCode':_0x430926(0x146),'message':_0x430926(0x147)+_0x347166,'arg':_0x347166,'helpText':_0x430926(0x156)};const _0x294a5e=sanitizeFileName(_0x347166),_0x5d69fc=getSegmentRootDir(_0x294a5e,cwd);return{'type':'parent_name','parentName':_0x347166,'targetDir':_0x5d69fc,'configRoot':_0x5d69fc};}const _0x324d1f=await findTdxConfigAsync(cwd,fs);if(_0x324d1f){const _0x324943=calculateScopedPath(cwd,_0x324d1f[_0x430926(0x15d)]);return{'type':_0x430926(0x177),'parentName':_0x324d1f['parentSegment'],'targetDir':cwd,'configRoot':_0x324d1f['configDir'],'isScoped':_0x324943['isScoped'],'scopedFolderPath':_0x324943['scopedFolderPath']};}if(_0x1d0fa6){const _0x190e1b=sanitizeFileName(_0x1d0fa6),_0x37e16a=getSegmentRootDir(_0x190e1b,cwd);return{'type':_0x430926(0x177),'parentName':_0x1d0fa6,'targetDir':_0x37e16a,'configRoot':_0x37e16a,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x430926(0x14b),'errorCode':_0x430926(0x178),'message':_0x430926(0x16e),'helpText':'Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure'};}
1
+ (function(_0xdd738a,_0x387322){const _0x1f0347=a114_0xcdd9,_0x1eeca8=_0xdd738a();while(!![]){try{const _0x2e2ea1=parseInt(_0x1f0347(0x121))/0x1+parseInt(_0x1f0347(0x140))/0x2*(parseInt(_0x1f0347(0x12a))/0x3)+parseInt(_0x1f0347(0x126))/0x4*(-parseInt(_0x1f0347(0x120))/0x5)+-parseInt(_0x1f0347(0x11d))/0x6+-parseInt(_0x1f0347(0x147))/0x7+parseInt(_0x1f0347(0x138))/0x8+-parseInt(_0x1f0347(0x12b))/0x9*(-parseInt(_0x1f0347(0x123))/0xa);if(_0x2e2ea1===_0x387322)break;else _0x1eeca8['push'](_0x1eeca8['shift']());}catch(_0xf9227d){_0x1eeca8['push'](_0x1eeca8['shift']());}}}(a114_0x38f4,0xc6f6c));import a114_0x6f4d06 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x5b824b){const _0x33470b=a114_0xcdd9;return _0x5b824b[_0x33470b(0x149)]!==_0x33470b(0x133);}export function isScopedResolution(_0x373abf){const _0x37cc76=a114_0xcdd9;return _0x373abf[_0x37cc76(0x149)]===_0x37cc76(0x127)||_0x373abf[_0x37cc76(0x149)]===_0x37cc76(0x12d)||_0x373abf[_0x37cc76(0x149)]===_0x37cc76(0x131);}function a114_0x38f4(){const _0x507910=['no_config','journey','exists','parent_name','9535736tIsVmt','match','type','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','configDir','dirname','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','relative','Parent\x20segment\x20not\x20specified','join','6453090nxlmbN','File\x20not\x20found','invalid_yaml','15355wLszKx','1209219dbnHuv','stat','460210RSBgJE','isFile','parentSegment','12pMcmOW','directory','parent_segment','string','61221ftOLfo','207AlPhQN','folderPath','file','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','isScoped','tdx.json','context','isDirectory','error','resourceType','resolve','replace','parse','1913368dwDrTA','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','readFile','includes','segmentName','startsWith','No\x20tdx.json\x20found\x20for\x20file:\x20','cwd','74wDhFlI','no_parent','trim'];a114_0x38f4=function(){return _0x507910;};return a114_0x38f4();}export function getScopedDetails(_0x5922a9){const _0x1d76bd=a114_0xcdd9;if(isScopedResolution(_0x5922a9))return{'isScoped':_0x5922a9[_0x1d76bd(0x12f)],'scopedFolderPath':_0x5922a9['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x4df255,_0x5c77c4){const _0x2481d7=a114_0xcdd9;let _0x31cc4d=a114_0x6f4d06[_0x2481d7(0x135)](_0x4df255);const _0x2b9110=a114_0x6f4d06[_0x2481d7(0x137)](_0x31cc4d)['root'];while(_0x31cc4d!==_0x2b9110){const _0x1030e8=a114_0x6f4d06[_0x2481d7(0x11c)](_0x31cc4d,_0x2481d7(0x130));if(await _0x5c77c4[_0x2481d7(0x145)](_0x1030e8))try{const _0x294571=await _0x5c77c4[_0x2481d7(0x13a)](_0x1030e8),_0x4a5501=JSON['parse'](_0x294571);if(_0x4a5501['parent_segment']&&typeof _0x4a5501['parent_segment']===_0x2481d7(0x129))return{'configPath':_0x1030e8,'configDir':_0x31cc4d,'parentSegment':_0x4a5501[_0x2481d7(0x128)]};}catch{}_0x31cc4d=a114_0x6f4d06[_0x2481d7(0x118)](_0x31cc4d);}return null;}function a114_0xcdd9(_0x20d787,_0x257b4e){_0x20d787=_0x20d787-0x116;const _0x38f4a6=a114_0x38f4();let _0xcdd954=_0x38f4a6[_0x20d787];return _0xcdd954;}function calculateScopedPath(_0x30228c,_0x32bd0d){const _0x5b1004=a114_0xcdd9,_0x83b4af=a114_0x6f4d06[_0x5b1004(0x11a)](_0x32bd0d,_0x30228c),_0x1480ad=_0x83b4af!==''&&_0x83b4af!=='.'&&!_0x83b4af[_0x5b1004(0x13d)]('..');return{'isScoped':_0x1480ad,'scopedFolderPath':_0x1480ad?_0x83b4af[_0x5b1004(0x136)](/\\/g,'/'):''};}export async function resolveTarget(_0x390fcf){const _0xc81da7=a114_0xcdd9,{arg:_0x52f6e6,contextParent:_0x377698,cwd:cwd=process[_0xc81da7(0x13f)](),fs:fs=nodeFileSystem}=_0x390fcf;if(_0x52f6e6&&isYamlFilePath(_0x52f6e6))try{const _0x15ca23=await resolveYamlFilePath(_0x52f6e6,fs),_0x17f0df=a114_0x6f4d06[_0xc81da7(0x135)](_0x52f6e6),_0x1bae68=a114_0x6f4d06[_0xc81da7(0x118)](_0x17f0df),_0x1252a9=await findTdxConfigAsync(_0x1bae68,fs);if(!_0x1252a9){if(_0x377698){const _0x48e1df=a114_0x6f4d06[_0xc81da7(0x118)](_0x17f0df);return{'type':_0xc81da7(0x12d),'parentName':_0x377698,'targetDir':_0x48e1df,'configRoot':_0x48e1df,'filePath':_0x17f0df,'resourceName':_0x15ca23[_0xc81da7(0x13c)],'folderPath':_0x15ca23[_0xc81da7(0x12c)],'resourceType':_0x15ca23['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':_0xc81da7(0x133),'errorCode':_0xc81da7(0x143),'message':_0xc81da7(0x13e)+_0x52f6e6,'arg':_0x52f6e6,'helpText':_0xc81da7(0x116)};}const _0x40f6f5=calculateScopedPath(_0x1bae68,_0x1252a9[_0xc81da7(0x117)]);return{'type':_0xc81da7(0x12d),'parentName':_0x1252a9[_0xc81da7(0x125)],'targetDir':_0x1252a9[_0xc81da7(0x117)],'configRoot':_0x1252a9[_0xc81da7(0x117)],'filePath':_0x17f0df,'resourceName':_0x15ca23[_0xc81da7(0x13c)],'folderPath':_0x15ca23[_0xc81da7(0x12c)],'resourceType':_0x15ca23[_0xc81da7(0x134)],'isScoped':_0x40f6f5[_0xc81da7(0x12f)],'scopedFolderPath':_0x40f6f5['scopedFolderPath']};}catch(_0x299e30){const _0x56c50b=_0x299e30 instanceof Error?_0x299e30['message']:String(_0x299e30);if(_0x56c50b['includes'](_0xc81da7(0x11e)))return{'type':'error','errorCode':'file_not_found','message':'File\x20not\x20found:\x20'+_0x52f6e6,'arg':_0x52f6e6};if(_0x56c50b[_0xc81da7(0x13b)]('No\x20tdx.json\x20found')){if(_0x377698){const _0x3a5c13=a114_0x6f4d06[_0xc81da7(0x135)](_0x52f6e6);if(await fs[_0xc81da7(0x145)](_0x3a5c13)){const _0x3765bf=a114_0x6f4d06[_0xc81da7(0x118)](_0x3a5c13),_0x2baf52=await fs['readFile'](_0x3a5c13),_0x3f4898=_0x2baf52[_0xc81da7(0x148)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x12c1ab=_0x2baf52[_0xc81da7(0x148)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4bc445=_0x3f4898?_0x3f4898[0x1][_0xc81da7(0x142)]():a114_0x6f4d06['basename'](_0x52f6e6,a114_0x6f4d06['extname'](_0x52f6e6)),_0xca04bb=_0x12c1ab&&_0x12c1ab[0x1][_0xc81da7(0x142)]()===_0xc81da7(0x144)?_0xc81da7(0x144):'segment';return{'type':_0xc81da7(0x12d),'parentName':_0x377698,'targetDir':_0x3765bf,'configRoot':_0x3765bf,'filePath':_0x3a5c13,'resourceName':_0x4bc445,'folderPath':'','resourceType':_0xca04bb,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':'no_config','message':_0xc81da7(0x13e)+_0x52f6e6,'arg':_0x52f6e6,'helpText':_0xc81da7(0x116)};}return{'type':_0xc81da7(0x133),'errorCode':_0xc81da7(0x11f),'message':_0x56c50b,'arg':_0x52f6e6};}if(_0x52f6e6){const _0x72d45c=a114_0x6f4d06[_0xc81da7(0x135)](cwd,_0x52f6e6);let _0x266293=null;try{_0x266293=await fs[_0xc81da7(0x122)](_0x72d45c);}catch{}if(_0x266293?.[_0xc81da7(0x132)]()){const _0x599d60=await findTdxConfigAsync(_0x72d45c,fs);if(_0x599d60){const _0x2590a0=calculateScopedPath(_0x72d45c,_0x599d60[_0xc81da7(0x117)]);return{'type':_0xc81da7(0x127),'parentName':_0x599d60['parentSegment'],'targetDir':_0x72d45c,'configRoot':_0x599d60[_0xc81da7(0x117)],'isScoped':_0x2590a0['isScoped'],'scopedFolderPath':_0x2590a0['scopedFolderPath']};}if(_0x377698)return{'type':_0xc81da7(0x127),'parentName':_0x377698,'targetDir':_0x72d45c,'configRoot':_0x72d45c,'isScoped':![],'scopedFolderPath':''};return{'type':_0xc81da7(0x133),'errorCode':'no_config','message':_0xc81da7(0x119)+_0x52f6e6,'arg':_0x52f6e6,'helpText':_0xc81da7(0x116)};}if(_0x266293?.[_0xc81da7(0x124)]())return{'type':'error','errorCode':_0xc81da7(0x11f),'message':'Not\x20a\x20YAML\x20file:\x20'+_0x52f6e6,'arg':_0x52f6e6,'helpText':_0xc81da7(0x139)};const _0x2b88e8=sanitizeFileName(_0x52f6e6),_0x3119f2=getSegmentRootDir(_0x2b88e8,cwd);return{'type':_0xc81da7(0x146),'parentName':_0x52f6e6,'targetDir':_0x3119f2,'configRoot':_0x3119f2};}const _0xa7a7c8=await findTdxConfigAsync(cwd,fs);if(_0xa7a7c8){const _0x5afc7d=calculateScopedPath(cwd,_0xa7a7c8[_0xc81da7(0x117)]);return{'type':_0xc81da7(0x131),'parentName':_0xa7a7c8['parentSegment'],'targetDir':cwd,'configRoot':_0xa7a7c8[_0xc81da7(0x117)],'isScoped':_0x5afc7d[_0xc81da7(0x12f)],'scopedFolderPath':_0x5afc7d['scopedFolderPath']};}if(_0x377698){const _0xe53781=sanitizeFileName(_0x377698),_0x1ac96e=getSegmentRootDir(_0xe53781,cwd);return{'type':_0xc81da7(0x131),'parentName':_0x377698,'targetDir':_0x1ac96e,'configRoot':_0x1ac96e,'isScoped':![],'scopedFolderPath':''};}return{'type':_0xc81da7(0x133),'errorCode':_0xc81da7(0x141),'message':_0xc81da7(0x11b),'helpText':_0xc81da7(0x12e)};}
@@ -1 +1 @@
1
- const a115_0x3b1a77=a115_0x7294;(function(_0x3109a9,_0x152f2e){const _0x55e339=a115_0x7294,_0x427762=_0x3109a9();while(!![]){try{const _0x3a0fd7=-parseInt(_0x55e339(0xc1))/0x1*(parseInt(_0x55e339(0xd0))/0x2)+parseInt(_0x55e339(0xd5))/0x3+parseInt(_0x55e339(0xcd))/0x4*(parseInt(_0x55e339(0xc7))/0x5)+-parseInt(_0x55e339(0xd7))/0x6+-parseInt(_0x55e339(0xcb))/0x7+parseInt(_0x55e339(0xc4))/0x8+-parseInt(_0x55e339(0xbe))/0x9*(-parseInt(_0x55e339(0xd6))/0xa);if(_0x3a0fd7===_0x152f2e)break;else _0x427762['push'](_0x427762['shift']());}catch(_0x98fd5a){_0x427762['push'](_0x427762['shift']());}}}(a115_0x3776,0x97cec));import{existsSync,readFileSync}from'fs';import a115_0x7a0a85 from'path';function a115_0x7294(_0x16da1e,_0x148cea){_0x16da1e=_0x16da1e-0xbe;const _0x37768f=a115_0x3776();let _0x729469=_0x37768f[_0x16da1e];return _0x729469;}const TDX_CONFIG_FILE=a115_0x3b1a77(0xcf),SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x1b7cbf=process[a115_0x3b1a77(0xc5)]()){const _0x1809a4=a115_0x3b1a77;let _0x3594fb=a115_0x7a0a85[_0x1809a4(0xd1)](_0x1b7cbf);const _0x55b559=a115_0x7a0a85[_0x1809a4(0xbf)](_0x3594fb)[_0x1809a4(0xca)];while(_0x3594fb!==_0x55b559){const _0x441af8=a115_0x7a0a85[_0x1809a4(0xc2)](_0x3594fb,TDX_CONFIG_FILE);if(existsSync(_0x441af8))return _0x441af8;_0x3594fb=a115_0x7a0a85[_0x1809a4(0xc3)](_0x3594fb);}return null;}export function loadTdxConfig(_0x2de51f){const _0x51f786=a115_0x3b1a77,_0x452feb=readFileSync(_0x2de51f,_0x51f786(0xc6));let _0x1a4d9b;try{_0x1a4d9b=JSON[_0x51f786(0xbf)](_0x452feb);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x2de51f);}if(!_0x1a4d9b||typeof _0x1a4d9b!==_0x51f786(0xc0))throw new Error(_0x51f786(0xc9));const _0x1fc585=_0x1a4d9b;if(!_0x1fc585[_0x51f786(0xce)]||typeof _0x1fc585[_0x51f786(0xce)]!==_0x51f786(0xcc))throw new Error(_0x51f786(0xd2));return{'parent_segment':_0x1fc585[_0x51f786(0xce)]};}export function findTdxConfig(_0x471ec9=process[a115_0x3b1a77(0xc5)]()){const _0x48e794=a115_0x3b1a77,_0x25a058=findTdxConfigPath(_0x471ec9);if(!_0x25a058)throw new Error(_0x48e794(0xd4));const _0x1879e1=loadTdxConfig(_0x25a058),_0x2ef78a=a115_0x7a0a85[_0x48e794(0xc3)](_0x25a058);return{'config':_0x1879e1,'configPath':_0x25a058,'configDir':_0x2ef78a};}export function tryFindTdxConfig(_0x3ac3f8){try{return findTdxConfig(_0x3ac3f8);}catch{return null;}}export function getSegmentRootDir(_0x5bb17a,_0x5edc76=process[a115_0x3b1a77(0xc5)]()){const _0x390c53=a115_0x3b1a77;return a115_0x7a0a85[_0x390c53(0xc2)](_0x5edc76,SEGMENTS_DIR,_0x5bb17a);}export function getTdxConfigPath(_0x3bf5d8,_0x99523c=process[a115_0x3b1a77(0xc5)]()){return a115_0x7a0a85['join'](getSegmentRootDir(_0x3bf5d8,_0x99523c),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x45783e,_0x4fbdc4){const _0x4c79cc=a115_0x3b1a77,_0x3e345d=a115_0x7a0a85[_0x4c79cc(0xd1)](_0x45783e),_0x55978b=a115_0x7a0a85['relative'](_0x4fbdc4,_0x3e345d);if(_0x55978b[_0x4c79cc(0xc8)]('..'))return'';return _0x55978b;}function a115_0x3776(){const _0x41ac3e=['3867208IpwDeU','cwd','utf-8','10lFFTVo','startsWith','Invalid\x20tdx.json:\x20expected\x20object','root','7386162xJINUK','string','1611164kXBEuQ','parent_segment','tdx.json','779068VoKWKn','resolve','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','stringify','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','2391744xilGKK','915350gRsziA','667572mYZOQg','9PhfTzT','parse','object','1Ahajmk','join','dirname'];a115_0x3776=function(){return _0x41ac3e;};return a115_0x3776();}export function localPathToTdFolderPath(_0x5687a1){const _0x1b5a56=a115_0x3b1a77,_0x2d7a53=a115_0x7a0a85[_0x1b5a56(0xc3)](_0x5687a1);if(_0x2d7a53==='.'||_0x2d7a53==='')return'';return _0x2d7a53['replace'](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x38f689,_0x49539c){const _0x11ba49=a115_0x3b1a77;if(!_0x38f689)return _0x49539c;return a115_0x7a0a85[_0x11ba49(0xc2)](_0x49539c,_0x38f689);}export function createTdxConfigContent(_0x2a96f3){const _0x2ba717=a115_0x3b1a77,_0x433708={'parent_segment':_0x2a96f3};return JSON[_0x2ba717(0xd3)](_0x433708,null,0x2)+'\x0a';}
1
+ const a115_0x3f3470=a115_0x36d6;(function(_0x422179,_0x11364d){const _0x4b91f9=a115_0x36d6,_0x444f92=_0x422179();while(!![]){try{const _0x4c6538=parseInt(_0x4b91f9(0x152))/0x1*(parseInt(_0x4b91f9(0x157))/0x2)+parseInt(_0x4b91f9(0x14c))/0x3+parseInt(_0x4b91f9(0x14d))/0x4+parseInt(_0x4b91f9(0x163))/0x5+-parseInt(_0x4b91f9(0x158))/0x6+-parseInt(_0x4b91f9(0x15d))/0x7*(-parseInt(_0x4b91f9(0x162))/0x8)+-parseInt(_0x4b91f9(0x164))/0x9*(parseInt(_0x4b91f9(0x161))/0xa);if(_0x4c6538===_0x11364d)break;else _0x444f92['push'](_0x444f92['shift']());}catch(_0x4a4256){_0x444f92['push'](_0x444f92['shift']());}}}(a115_0x59bf,0x194f6));import{existsSync,readFileSync}from'fs';import a115_0x389020 from'path';const TDX_CONFIG_FILE=a115_0x3f3470(0x15b),SEGMENTS_DIR=a115_0x3f3470(0x159);export function findTdxConfigPath(_0x45e7d5=process[a115_0x3f3470(0x160)]()){const _0x13f44d=a115_0x3f3470;let _0x307430=a115_0x389020[_0x13f44d(0x14e)](_0x45e7d5);const _0x2162f8=a115_0x389020['parse'](_0x307430)[_0x13f44d(0x166)];while(_0x307430!==_0x2162f8){const _0x157ff3=a115_0x389020['join'](_0x307430,TDX_CONFIG_FILE);if(existsSync(_0x157ff3))return _0x157ff3;_0x307430=a115_0x389020['dirname'](_0x307430);}return null;}export function loadTdxConfig(_0x20fb96){const _0x57fa4f=a115_0x3f3470,_0x21145b=readFileSync(_0x20fb96,_0x57fa4f(0x14b));let _0x575499;try{_0x575499=JSON[_0x57fa4f(0x15c)](_0x21145b);}catch{throw new Error(_0x57fa4f(0x151)+_0x20fb96);}if(!_0x575499||typeof _0x575499!=='object')throw new Error(_0x57fa4f(0x15f));const _0x161267=_0x575499;if(!_0x161267[_0x57fa4f(0x14f)]||typeof _0x161267[_0x57fa4f(0x14f)]!==_0x57fa4f(0x155))throw new Error(_0x57fa4f(0x154));return{'parent_segment':_0x161267['parent_segment']};}export function findTdxConfig(_0x56539a=process[a115_0x3f3470(0x160)]()){const _0x550e32=a115_0x3f3470,_0x10cd70=findTdxConfigPath(_0x56539a);if(!_0x10cd70)throw new Error(_0x550e32(0x14a));const _0x5982e1=loadTdxConfig(_0x10cd70),_0x115d00=a115_0x389020[_0x550e32(0x165)](_0x10cd70);return{'config':_0x5982e1,'configPath':_0x10cd70,'configDir':_0x115d00};}export function tryFindTdxConfig(_0xa52363){try{return findTdxConfig(_0xa52363);}catch{return null;}}export function getSegmentRootDir(_0x588646,_0x544b72=process[a115_0x3f3470(0x160)]()){const _0x16a3c6=a115_0x3f3470;return a115_0x389020[_0x16a3c6(0x15e)](_0x544b72,SEGMENTS_DIR,_0x588646);}export function getTdxConfigPath(_0x107e26,_0x5ccf83=process[a115_0x3f3470(0x160)]()){return a115_0x389020['join'](getSegmentRootDir(_0x107e26,_0x5ccf83),TDX_CONFIG_FILE);}function a115_0x36d6(_0x537b37,_0x363e44){_0x537b37=_0x537b37-0x14a;const _0x59bf49=a115_0x59bf();let _0x36d666=_0x59bf49[_0x537b37];return _0x36d666;}export function getRelativePathFromConfig(_0x3cdb58,_0x593fda){const _0x5ecfa6=a115_0x3f3470,_0x2ada8c=a115_0x389020[_0x5ecfa6(0x14e)](_0x3cdb58),_0x2869cc=a115_0x389020[_0x5ecfa6(0x15a)](_0x593fda,_0x2ada8c);if(_0x2869cc[_0x5ecfa6(0x153)]('..'))return'';return _0x2869cc;}function a115_0x59bf(){const _0x4ab967=['No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','utf-8','389337LWwunH','31028RQHWiu','resolve','parent_segment','stringify','Invalid\x20JSON\x20in\x20','40SLxCNa','startsWith','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','string','replace','508AqQNou','317232tDabJQ','segments','relative','tdx.json','parse','8001QPSfib','join','Invalid\x20tdx.json:\x20expected\x20object','cwd','10hIKIsz','472SIXNqN','395490tEdSnd','1239201lbjYSU','dirname','root'];a115_0x59bf=function(){return _0x4ab967;};return a115_0x59bf();}export function localPathToTdFolderPath(_0x25ea5d){const _0x447ce8=a115_0x3f3470,_0x30b2bc=a115_0x389020[_0x447ce8(0x165)](_0x25ea5d);if(_0x30b2bc==='.'||_0x30b2bc==='')return'';return _0x30b2bc[_0x447ce8(0x156)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x233ab2,_0x279f32){const _0x3e4777=a115_0x3f3470;if(!_0x233ab2)return _0x279f32;return a115_0x389020[_0x3e4777(0x15e)](_0x279f32,_0x233ab2);}export function createTdxConfigContent(_0x2a74fe){const _0x4684be=a115_0x3f3470,_0x3c5580={'parent_segment':_0x2a74fe};return JSON[_0x4684be(0x150)](_0x3c5580,null,0x2)+'\x0a';}