@treasuredata/tdx 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) 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/api-command.js +1 -1
  10. package/dist/commands/api-command.js.map +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.d.ts +1 -0
  14. package/dist/commands/claude-command.d.ts.map +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-command.js.map +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/job-command.js +1 -1
  25. package/dist/commands/journey-command.js +1 -1
  26. package/dist/commands/journey-validate-command.js +1 -1
  27. package/dist/commands/llm-command.js +1 -1
  28. package/dist/commands/llm-proxy.js +1 -1
  29. package/dist/commands/parent-segment-command.js +1 -1
  30. package/dist/commands/profile-command.d.ts +3 -4
  31. package/dist/commands/profile-command.d.ts.map +1 -1
  32. package/dist/commands/profile-command.js +1 -1
  33. package/dist/commands/profile-command.js.map +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pull-command.js +1 -1
  40. package/dist/commands/segment-push-command.js +1 -1
  41. package/dist/commands/segment-update-command.js +1 -1
  42. package/dist/commands/segment-use-command.js +1 -1
  43. package/dist/commands/segment-validate-command.js +1 -1
  44. package/dist/commands/segments.js +1 -1
  45. package/dist/commands/show.js +1 -1
  46. package/dist/commands/tables.js +1 -1
  47. package/dist/commands/use-command.js +1 -1
  48. package/dist/commands/user-command.js +1 -1
  49. package/dist/commands/workflow-command.js +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/command-output.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/connection-cache.js +1 -1
  54. package/dist/core/constants.js +1 -1
  55. package/dist/core/credential-cache.js +1 -1
  56. package/dist/core/global-context.js +1 -1
  57. package/dist/core/keychain.js +1 -1
  58. package/dist/core/profile.js +1 -1
  59. package/dist/core/project-config.js +1 -1
  60. package/dist/core/session.js +1 -1
  61. package/dist/core/user-cache.js +1 -1
  62. package/dist/core/version.js +1 -1
  63. package/dist/index.js +1 -1
  64. package/dist/proxy/anthropic-adapter.js +1 -1
  65. package/dist/proxy/claude-usage-tracker.d.ts +2 -0
  66. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  67. package/dist/proxy/claude-usage-tracker.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  69. package/dist/proxy/context-signature.js +1 -1
  70. package/dist/proxy/conversation-utils.js +1 -1
  71. package/dist/proxy/passthrough-server.d.ts +86 -0
  72. package/dist/proxy/passthrough-server.d.ts.map +1 -0
  73. package/dist/proxy/passthrough-server.js +1 -0
  74. package/dist/proxy/passthrough-server.js.map +1 -0
  75. package/dist/proxy/server.js +1 -1
  76. package/dist/proxy/session-cache.js +1 -1
  77. package/dist/proxy/sse-usage-parser.d.ts +99 -0
  78. package/dist/proxy/sse-usage-parser.d.ts.map +1 -0
  79. package/dist/proxy/sse-usage-parser.js +1 -0
  80. package/dist/proxy/sse-usage-parser.js.map +1 -0
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/api.js +1 -1
  85. package/dist/sdk/client/cdp-api-client.js +1 -1
  86. package/dist/sdk/client/endpoints.d.ts +5 -0
  87. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  88. package/dist/sdk/client/endpoints.js +1 -1
  89. package/dist/sdk/client/endpoints.js.map +1 -1
  90. package/dist/sdk/client/engage-api-client.js +1 -1
  91. package/dist/sdk/client/http-client.js +1 -1
  92. package/dist/sdk/client/llm-api-client.js +1 -1
  93. package/dist/sdk/client/rate-limiter.js +1 -1
  94. package/dist/sdk/client/td-api-client.js +1 -1
  95. package/dist/sdk/client/trino-api-client.js +1 -1
  96. package/dist/sdk/client/workflow-client.js +1 -1
  97. package/dist/sdk/connection-validator.js +1 -1
  98. package/dist/sdk/connection.js +1 -1
  99. package/dist/sdk/engage.js +1 -1
  100. package/dist/sdk/errors.js +1 -1
  101. package/dist/sdk/index.js +1 -1
  102. package/dist/sdk/io/index.js +1 -1
  103. package/dist/sdk/io/node-filesystem.js +1 -1
  104. package/dist/sdk/job.js +1 -1
  105. package/dist/sdk/journey.js +1 -1
  106. package/dist/sdk/llm/chat-cache.js +1 -1
  107. package/dist/sdk/llm/index.js +1 -1
  108. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  109. package/dist/sdk/llm/model-aliases.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/query/index.js +1 -1
  112. package/dist/sdk/query/sql-parser.js +1 -1
  113. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  114. package/dist/sdk/segment/fields-display.js +1 -1
  115. package/dist/sdk/segment/file-discovery.js +1 -1
  116. package/dist/sdk/segment/journey-utils.js +1 -1
  117. package/dist/sdk/segment/journey-yaml.js +1 -1
  118. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  119. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  120. package/dist/sdk/segment/pull-workflow.js +1 -1
  121. package/dist/sdk/segment/push-workflow.js +1 -1
  122. package/dist/sdk/segment/resolution-context.js +1 -1
  123. package/dist/sdk/segment/segment-path-parser.js +1 -1
  124. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  125. package/dist/sdk/segment/target-resolution.js +1 -1
  126. package/dist/sdk/segment/tdx-config.js +1 -1
  127. package/dist/sdk/segment/validate-files.js +1 -1
  128. package/dist/sdk/segment/yaml-validator.js +1 -1
  129. package/dist/sdk/segment.js +1 -1
  130. package/dist/sdk/types/index.d.ts +1 -1
  131. package/dist/sdk/types/index.d.ts.map +1 -1
  132. package/dist/sdk/types/index.js +1 -1
  133. package/dist/sdk/types/progress.js +1 -1
  134. package/dist/sdk/user.js +1 -1
  135. package/dist/sdk/util/format-detector.js +1 -1
  136. package/dist/sdk/util/formatters.js +1 -1
  137. package/dist/sdk/util/index.js +1 -1
  138. package/dist/sdk/util/tree-formatter.js +1 -1
  139. package/dist/sdk/workflow/clone-workflow.js +1 -1
  140. package/dist/sdk/workflow/index.js +1 -1
  141. package/dist/sdk/workflow/pull-workflow.js +1 -1
  142. package/dist/sdk/workflow/push-workflow.js +1 -1
  143. package/dist/sdk/workflow/tdx-config.js +1 -1
  144. package/dist/sdk/workflow/workflow-utils.js +1 -1
  145. package/dist/utils/async.js +1 -1
  146. package/dist/utils/colors.js +1 -1
  147. package/dist/utils/diff.js +1 -1
  148. package/dist/utils/file-permissions.js +1 -1
  149. package/dist/utils/json-loader.js +1 -1
  150. package/dist/utils/option-validation.js +1 -1
  151. package/dist/utils/port.js +1 -1
  152. package/dist/utils/process.js +1 -1
  153. package/dist/utils/prompt.js +1 -1
  154. package/dist/utils/spinner.js +1 -1
  155. package/dist/utils/sse-parser.js +1 -1
  156. package/dist/utils/string-utils.js +1 -1
  157. package/dist/utils/table-ref-parser.js +1 -1
  158. package/dist/utils/tdx-logger.js +1 -1
  159. package/dist/utils/version-check.js +1 -1
  160. package/package.json +1 -1
@@ -1 +1 @@
1
- const a98_0x545ff9=a98_0x1668;(function(_0x5cbce2,_0x3695ce){const _0x368ae2=a98_0x1668,_0x461531=_0x5cbce2();while(!![]){try{const _0x555eab=parseInt(_0x368ae2(0x201))/0x1*(parseInt(_0x368ae2(0x27c))/0x2)+parseInt(_0x368ae2(0x215))/0x3*(parseInt(_0x368ae2(0x1c0))/0x4)+parseInt(_0x368ae2(0x25d))/0x5+-parseInt(_0x368ae2(0x23c))/0x6+-parseInt(_0x368ae2(0x25f))/0x7+-parseInt(_0x368ae2(0x1e8))/0x8*(parseInt(_0x368ae2(0x220))/0x9)+-parseInt(_0x368ae2(0x1df))/0xa;if(_0x555eab===_0x3695ce)break;else _0x461531['push'](_0x461531['shift']());}catch(_0x4b5bc6){_0x461531['push'](_0x461531['shift']());}}}(a98_0x3634,0xe48a2));function a98_0x1668(_0x21142c,_0x279883){_0x21142c=_0x21142c-0x1ab;const _0x3634b6=a98_0x3634();let _0x16680b=_0x3634b6[_0x21142c];return _0x16680b;}import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a98_0x545ff9(0x225);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x4a3209){return''+PENDING_SEGMENT_PREFIX+_0x4a3209+'__';}export function isPendingSegmentId(_0x5f2603){const _0x1a98d1=a98_0x545ff9;return _0x5f2603[_0x1a98d1(0x1cc)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x1618d6){const _0x344d8c=a98_0x545ff9;return _0x1618d6[_0x344d8c(0x237)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5876dc){return''+PENDING_ACTIVATION_PREFIX+_0x5876dc+'__';}export function isPendingActivationId(_0x53a585){const _0x3cb3f1=a98_0x545ff9;return _0x53a585[_0x3cb3f1(0x1cc)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x19fea5){const _0xd635d6=a98_0x545ff9;return _0x19fea5[_0xd635d6(0x237)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x45e7ca,_0x5b3d6e){const _0x3a9698=a98_0x545ff9,_0x3793ae=_0x45e7ca+'::'+(_0x5b3d6e['trim']()||'segment'),_0x3eb22b=createHash(_0x3a9698(0x260))[_0x3a9698(0x203)](_0x3793ae)[_0x3a9698(0x261)]('hex')[_0x3a9698(0x26d)](0x0,0xc);return _0x3a9698(0x27a)+_0x3eb22b;}export function ensureJourneyDefaults(_0x24dcf5){const _0x3a694d=a98_0x545ff9;!_0x24dcf5[_0x3a694d(0x247)]&&(_0x24dcf5[_0x3a694d(0x247)]=''),!_0x24dcf5['state']&&(_0x24dcf5['state']='draft');}export function resolveTDFolderPath(_0x4b0350,_0x4380f6,_0x1a3324){if(!_0x4380f6)return _0x4b0350;if(_0x4b0350===_0x1a3324||_0x4b0350['startsWith'](_0x1a3324+'/'))return _0x4b0350;return _0x4b0350?_0x1a3324+'/'+_0x4b0350:_0x1a3324;}export function addFoldersToCreate(_0x456867,_0x5a3012,_0x3e2f5a){const _0x5559e6=a98_0x545ff9;if(!_0x456867)return;if(_0x5a3012[_0x5559e6(0x1f0)](_0x456867))return;const _0x54e9ba=_0x456867[_0x5559e6(0x1ce)]('/');let _0x478fae='';for(const _0x255ee3 of _0x54e9ba){_0x478fae=_0x478fae?_0x478fae+'/'+_0x255ee3:_0x255ee3,!_0x5a3012[_0x5559e6(0x1f0)](_0x478fae)&&_0x3e2f5a[_0x5559e6(0x23e)](_0x478fae);}}import*as a98_0x1fee7e from'yaml';import{readFileSync}from'fs';import a98_0x4a9171 from'path';import{isJourneyDef,parseYamlString as a98_0x13dd3b,toYamlString as a98_0x4774d0,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(_0x49b1db){const _0xd8a1b=a98_0x545ff9;if(Array[_0xd8a1b(0x20c)](_0x49b1db))return'['+_0x49b1db[_0xd8a1b(0x1bf)](_0x2f718d=>stableStringify(_0x2f718d))[_0xd8a1b(0x254)](',')+']';if(_0x49b1db&&typeof _0x49b1db==='object'){const _0x4165b1=_0x49b1db,_0x1425ff=Object[_0xd8a1b(0x228)](_0x4165b1)['sort'](),_0x4df573=_0x1425ff[_0xd8a1b(0x1bf)](_0x58e50a=>'\x22'+_0x58e50a+'\x22:'+stableStringify(_0x4165b1[_0x58e50a]));return'{'+_0x4df573[_0xd8a1b(0x254)](',')+'}';}const _0xb0ec35=JSON[_0xd8a1b(0x1b9)](_0x49b1db);return _0xb0ec35===undefined?'null':_0xb0ec35;}function activationSignature(_0x20783d){const _0x408bc7=a98_0x545ff9,_0x58fb3c={'connection':_0x20783d[_0x408bc7(0x213)],..._0x20783d['all_columns']!==undefined&&{'all_columns':_0x20783d[_0x408bc7(0x21f)]},..._0x20783d[_0x408bc7(0x21b)]!==undefined&&{'columns':_0x20783d['columns']},..._0x20783d['behavior']!==undefined&&{'behavior':_0x20783d['behavior']},..._0x20783d[_0x408bc7(0x1e6)]!==undefined&&{'schedule':_0x20783d[_0x408bc7(0x1e6)]},..._0x20783d[_0x408bc7(0x1d0)]!==undefined&&{'notification':_0x20783d[_0x408bc7(0x1d0)]},..._0x20783d[_0x408bc7(0x1b1)]!==undefined&&{'connector_config':_0x20783d['connector_config']},..._0x20783d['activation_template_id']!==undefined&&{'activation_template_id':_0x20783d[_0x408bc7(0x23d)]}};return stableStringify(_0x58fb3c);}export async function prepareSegmentFiles(_0x380f12,_0xf2dd12,_0x2d3c1c,_0x1e3a3e,_0x36873a){const _0x50988e=a98_0x545ff9,{activationDefToCreateRequest:_0x260dfd}=await import(_0x50988e(0x22f)),_0xfefd4a=[],_0x18c5cd=new Set();for(const {yamlConfig:_0x625ca7,folderPath:_0x25f21f,sourcePath:_0x278c5d}of _0x380f12){const _0x2174bc=resolveTDFolderPath(_0x25f21f,_0x1e3a3e,_0x36873a),_0x18736e=_0x2174bc+':'+_0x625ca7[_0x50988e(0x1e7)],_0x359101=_0xf2dd12['segmentByFolderAndName'][_0x50988e(0x1ad)](_0x18736e),_0x1927b1=_0x359101?_0xf2dd12[_0x50988e(0x1f6)]['get'](_0x359101['id'])||[]:[];addFoldersToCreate(_0x2174bc,_0xf2dd12[_0x50988e(0x1c7)],_0x18c5cd);const _0x25bf1b=calculateActivationActions(_0x625ca7[_0x50988e(0x245)]||[],_0x1927b1,_0xf2dd12[_0x50988e(0x1e5)],_0xf2dd12[_0x50988e(0x253)]);for(const _0x558756 of _0x25bf1b){(_0x558756[_0x50988e(0x1ef)]==='create'||_0x558756[_0x50988e(0x1ef)]===_0x50988e(0x203))&&_0x558756[_0x50988e(0x238)]&&(_0x558756[_0x50988e(0x281)]=await _0x260dfd(_0x558756[_0x50988e(0x238)],_0x2d3c1c));}const _0x322f3e=calculateSegmentDiff(_0x625ca7,_0x359101,_0x1927b1,_0xf2dd12[_0x50988e(0x1e5)],_0xf2dd12['connectionIdToNameMap']);_0xfefd4a[_0x50988e(0x277)]({'relativePath':_0x625ca7[_0x50988e(0x1e7)],'absolutePath':_0x278c5d,'yamlConfig':_0x625ca7,'folderPath':_0x2174bc,'existingSegment':_0x359101,'existingActivations':_0x1927b1,'isNew':_0x322f3e[_0x50988e(0x1e0)],'hasChanges':_0x322f3e['hasChanges'],'diff':_0x322f3e['diff'],'activationActions':_0x25bf1b});}return{'segmentFiles':_0xfefd4a,'foldersToCreate':_0x18c5cd};}export async function prepareJourneyFiles(_0x206c76,_0x4566b2,_0x4ceb89,_0x521ba1){const _0x2cb74e=a98_0x545ff9,_0x78b25b=[],_0x2933c6=new Set();for(const {yamlConfig:_0x3a5e3c,folderPath:_0x145240,sourcePath:_0x483d9b}of _0x206c76){const _0x5bd4c8=resolveTDFolderPath(_0x145240,_0x4ceb89,_0x521ba1),_0x26094c=_0x5bd4c8+':'+_0x3a5e3c[_0x2cb74e(0x1e7)],_0x5c3f84=_0x4566b2['journeyBundlesByFolderAndName'][_0x2cb74e(0x1ad)](_0x26094c);let _0x250b21,_0x466e28;if(_0x5c3f84&&_0x5c3f84[_0x2cb74e(0x226)]>0x0){const _0x518a1c=buildLocalExpandedRuleMappings(_0x3a5e3c),{createYamlContext:_0x35a34a,prefetchJourneySegments:_0xf9eaab}=createPushYamlContextForBundle(_0x4566b2[_0x2cb74e(0x1d8)],_0x4566b2[_0x2cb74e(0x231)],_0x4566b2[_0x2cb74e(0x24f)],_0x518a1c,_0x4566b2[_0x2cb74e(0x1e5)],_0x4566b2['connectionIdToNameMap'],_0x4566b2[_0x2cb74e(0x289)],_0x4566b2['journeyById']);await _0xf9eaab(_0x5c3f84[_0x2cb74e(0x1bf)](_0xee6b69=>_0xee6b69['id']));const _0x582cc0=hasMultipleVersions(_0x3a5e3c),_0x5d5f93=async _0x252c25=>{const _0x366c91=_0x2cb74e,_0xace943=_0x4566b2[_0x366c91(0x1c2)]?.['get'](_0x252c25);if(_0xace943)return _0xace943;return _0x4566b2[_0x366c91(0x1ba)]({'journeyId':_0x252c25,'journeyName':_0x3a5e3c[_0x366c91(0x1e7)],'isMultiVersion':_0x5c3f84[_0x366c91(0x226)]>0x1});};if(_0x582cc0&&_0x5c3f84[_0x2cb74e(0x226)]>0x1){const _0x25a2ea=[];for(const _0xc8832 of _0x5c3f84){const _0x4dc2b4=_0xc8832['versionNumber']||0x1;_0x4566b2[_0x2cb74e(0x246)]?.[_0x2cb74e(0x203)](_0x2cb74e(0x219)+_0x3a5e3c[_0x2cb74e(0x1e7)]+'\x20v'+_0x4dc2b4);const _0x10c506=await _0x5d5f93(_0xc8832['id']),_0x271050=_0x35a34a(_0xc8832['id']),_0x35637c=await journeyResponseToDef(_0x10c506,_0x271050);_0x25a2ea[_0x2cb74e(0x277)]({'item':_0xc8832,'yaml':_0x35637c});}const _0xe01b6a=buildLocalRuleToNameMappingFromJourney(_0x3a5e3c);_0x466e28=buildMergedJourneyDef(_0x25a2ea,_0xe01b6a);const _0x5861c1=Math[_0x2cb74e(0x234)](..._0x25a2ea[_0x2cb74e(0x1bf)](_0x4e167b=>_0x4e167b[_0x2cb74e(0x285)][_0x2cb74e(0x233)]||0x0)),_0x97753d=_0x5c3f84[_0x2cb74e(0x284)](_0x1b4f76=>(_0x1b4f76[_0x2cb74e(0x233)]||0x0)===_0x5861c1);_0x97753d&&(_0x4566b2[_0x2cb74e(0x246)]?.['update'](_0x2cb74e(0x219)+_0x3a5e3c[_0x2cb74e(0x1e7)]+'\x20v'+_0x5861c1),_0x250b21=await _0x5d5f93(_0x97753d['id']));}else{const _0x5d6569=_0x5c3f84[_0x5c3f84[_0x2cb74e(0x226)]-0x1];_0x4566b2[_0x2cb74e(0x246)]?.[_0x2cb74e(0x203)](_0x2cb74e(0x219)+_0x3a5e3c[_0x2cb74e(0x1e7)]),_0x250b21=await _0x5d5f93(_0x5d6569['id']);const _0x44f48b=_0x35a34a(_0x5d6569['id']),_0x258f80=await journeyResponseToDef(_0x250b21,_0x44f48b),_0x2bf4d1=buildLocalRuleToNameMappingFromJourney(_0x3a5e3c);_0x466e28=buildMergedJourneyDef([{'item':_0x5d6569,'yaml':_0x258f80}],_0x2bf4d1);}}addFoldersToCreate(_0x5bd4c8,_0x4566b2[_0x2cb74e(0x1c7)],_0x2933c6);const _0x2e456c=calculateJourneyDiff(_0x3a5e3c,_0x466e28);_0x78b25b[_0x2cb74e(0x277)]({'relativePath':_0x3a5e3c['name'],'absolutePath':_0x483d9b,'yamlConfig':_0x3a5e3c,'folderPath':_0x5bd4c8,'existingJourney':_0x250b21,'isNew':_0x2e456c['isNew'],'hasChanges':_0x2e456c[_0x2cb74e(0x1d4)],'diff':_0x2e456c[_0x2cb74e(0x24a)]});}return{'journeyFiles':_0x78b25b,'foldersToCreate':_0x2933c6};}export function calculateActivationActions(_0x3ccd10,_0x415286,_0x31a9c8,_0x48e22f){const _0x4fd9a5=a98_0x545ff9,_0x555781=[],_0x4e3ff7=new Map();for(const _0x9504ee of _0x415286){_0x4e3ff7[_0x4fd9a5(0x22b)](_0x9504ee[_0x4fd9a5(0x1e7)],_0x9504ee);}const _0x8d481f=new Map();for(const _0x30444a of _0x3ccd10){_0x8d481f[_0x4fd9a5(0x22b)](_0x30444a[_0x4fd9a5(0x1e7)],_0x30444a);}for(const _0x13fa34 of _0x3ccd10){const _0x4e3025=_0x4e3ff7[_0x4fd9a5(0x1ad)](_0x13fa34[_0x4fd9a5(0x1e7)]);if(!_0x4e3025)_0x555781[_0x4fd9a5(0x277)]({'type':_0x4fd9a5(0x270),'name':_0x13fa34[_0x4fd9a5(0x1e7)],'yamlActivation':_0x13fa34});else{const _0x41744c=activationResponseToDef(_0x4e3025,_0x31a9c8,_0x48e22f),_0x281436=a98_0x1fee7e[_0x4fd9a5(0x1b9)](_0x41744c),_0xf6962d=a98_0x1fee7e[_0x4fd9a5(0x1b9)](_0x13fa34);_0x281436!==_0xf6962d&&_0x555781[_0x4fd9a5(0x277)]({'type':_0x4fd9a5(0x203),'name':_0x13fa34[_0x4fd9a5(0x1e7)],'yamlActivation':_0x13fa34,'existingActivation':_0x4e3025});}}for(const _0x2aef59 of _0x415286){!_0x8d481f['has'](_0x2aef59['name'])&&_0x555781[_0x4fd9a5(0x277)]({'type':_0x4fd9a5(0x1c4),'name':_0x2aef59['name'],'existingActivation':_0x2aef59});}return _0x555781;}export function calculateSegmentDiff(_0x4668b4,_0x45e8e4,_0x4f502c,_0x96fca7,_0x4b6191){const _0x46c81f=segmentToYamlString(_0x4668b4);if(_0x45e8e4){const _0x596197=segmentWithActivationsToYaml(_0x45e8e4,_0x4f502c,undefined,_0x96fca7,_0x4b6191),_0x51004b=segmentToYamlString(_0x596197),_0x3384bd=generateDiff(_0x51004b,_0x46c81f),_0x45c540=hasChanges(_0x3384bd);return{'isNew':![],'hasChanges':_0x45c540,'diff':_0x45c540?formatDiffWithColors(_0x3384bd):undefined};}const _0x3292a1=generateDiff('',_0x46c81f);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3292a1)};}export function calculateJourneyDiff(_0x26c8bd,_0x339806){const _0x310348=normalizeJourneyDef(_0x26c8bd,_0x26c8bd),_0x565cec=a98_0x4774d0(_0x310348);if(_0x339806){const _0x21a38e=normalizeJourneyDef(_0x339806,_0x26c8bd),_0x40de8b=a98_0x4774d0(_0x21a38e),_0x47d85c=generateDiff(_0x40de8b,_0x565cec),_0x254db3=hasChanges(_0x47d85c);return{'isNew':![],'hasChanges':_0x254db3,'diff':_0x254db3?formatDiffWithColors(_0x47d85c):undefined};}const _0x12eccb=generateDiff('',_0x565cec);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x12eccb)};}export function findSegmentsToDelete(_0x24f3aa,_0x5106b8,_0x47ca97,_0x154c59,_0x263b0d){const _0xd1f56=a98_0x545ff9,_0x5f164b=new Set();for(const {yamlConfig:_0x42cd13,folderPath:_0x4c489d}of _0x5106b8){_0x5f164b[_0xd1f56(0x23e)](_0x4c489d+':'+_0x42cd13['name']);}return _0x24f3aa['filter'](_0x481b80=>{const _0x40da34=_0xd1f56,_0x5c3148=_0x481b80[_0x40da34(0x22e)]?_0x47ca97[_0x40da34(0x1ad)](_0x481b80[_0x40da34(0x22e)][_0x40da34(0x1f2)]())||'':'',_0x4b7ae3=_0x5c3148+':'+_0x481b80[_0x40da34(0x1e7)];if(_0x5f164b[_0x40da34(0x1f0)](_0x4b7ae3))return![];if(_0x263b0d)return _0x5c3148===_0x154c59||_0x5c3148['startsWith'](_0x154c59+'/');return!![];});}export function findJourneysToDelete(_0xef9ae1,_0x391d7b,_0x19dc2a,_0x561d3d,_0x45d3e4){const _0xa1e6a7=a98_0x545ff9,_0x5acbac=new Set();for(const {yamlConfig:_0x31de67,folderPath:_0x43569b}of _0x391d7b){_0x5acbac[_0xa1e6a7(0x23e)](_0x43569b+':'+_0x31de67['name']);}return _0xef9ae1[_0xa1e6a7(0x20e)](_0x5ebdf1=>{const _0x374b62=_0xa1e6a7,_0x80abc6=_0x5ebdf1[_0x374b62(0x257)]?_0x19dc2a[_0x374b62(0x1ad)](_0x5ebdf1[_0x374b62(0x257)])||'':'',_0x9b2aec=_0x80abc6+':'+_0x5ebdf1['journeyBundleName'];if(_0x5acbac['has'](_0x9b2aec))return![];if(_0x45d3e4)return _0x80abc6===_0x561d3d||_0x80abc6[_0x374b62(0x1cc)](_0x561d3d+'/');return!![];});}export function buildSegmentLookupMap(_0x26bbc7,_0x65e4a){const _0x1d87c4=a98_0x545ff9,_0x53ba6a=new Map();for(const _0x20be35 of _0x26bbc7){const _0x32388b=_0x20be35['segmentFolderId']?_0x65e4a['get'](_0x20be35['segmentFolderId']['toString']())||'':'',_0x145c8e=_0x32388b+':'+_0x20be35[_0x1d87c4(0x1e7)];_0x53ba6a['set'](_0x145c8e,_0x20be35);}return _0x53ba6a;}export function buildSegmentNameToIdMap(_0x1d1b18){const _0x214b89=a98_0x545ff9,_0xc9246=new Map();for(const _0x1ea982 of _0x1d1b18){_0xc9246[_0x214b89(0x22b)](_0x1ea982[_0x214b89(0x1e7)],_0x1ea982['id']);}return _0xc9246;}export function buildJourneyBundleLookupMap(_0x7280aa,_0x50a519){const _0x43da6d=a98_0x545ff9,_0x2844fd=new Map();for(const _0x25a428 of _0x7280aa){const _0x2ed6d5=_0x25a428[_0x43da6d(0x257)]?_0x50a519['get'](_0x25a428[_0x43da6d(0x257)])||'':'',_0x10cd5f=_0x2ed6d5+':'+_0x25a428[_0x43da6d(0x274)];!_0x2844fd[_0x43da6d(0x1f0)](_0x10cd5f)&&_0x2844fd[_0x43da6d(0x22b)](_0x10cd5f,[]),_0x2844fd[_0x43da6d(0x1ad)](_0x10cd5f)['push'](_0x25a428);}for(const _0x30b540 of _0x2844fd[_0x43da6d(0x1d1)]()){_0x30b540[_0x43da6d(0x26e)]((_0x1bb756,_0x1065f)=>(_0x1bb756[_0x43da6d(0x233)]||0x0)-(_0x1065f[_0x43da6d(0x233)]||0x0));}return _0x2844fd;}export function collectFoldersToCreate(_0x5a3812,_0x5b3f95){const _0xf17fb0=a98_0x545ff9,_0x476971=new Set();for(const _0x594c00 of _0x5a3812){if(!_0x594c00)continue;if(_0x5b3f95[_0xf17fb0(0x1f0)](_0x594c00))continue;const _0x2ff654=_0x594c00[_0xf17fb0(0x1ce)]('/');let _0x2ab68d='';for(const _0x31a1d7 of _0x2ff654){_0x2ab68d=_0x2ab68d?_0x2ab68d+'/'+_0x31a1d7:_0x31a1d7,!_0x5b3f95['has'](_0x2ab68d)&&_0x476971[_0xf17fb0(0x23e)](_0x2ab68d);}}return _0x476971;}export function parseAndClassifyYamlFiles(_0xa5741,_0x43f4ad,_0xbd5073){const _0x1aec9b=a98_0x545ff9,_0x1b5269=[],_0x33e675=[];for(const _0x3de1fd of _0xa5741){const _0x214b5c=a98_0x4a9171[_0x1aec9b(0x1ea)](_0x43f4ad,a98_0x4a9171[_0x1aec9b(0x1d5)](_0x3de1fd)),_0xefd256=_0x214b5c==='.'?'':_0x214b5c,_0x24f98a=readFileSync(_0x3de1fd,'utf-8'),_0x5306e9=a98_0x1fee7e[_0x1aec9b(0x255)](_0x24f98a);if(isJourneyDef(_0x5306e9)){const _0x40e151=a98_0x13dd3b(_0x24f98a);_0x33e675[_0x1aec9b(0x277)]({'yamlConfig':_0x40e151,'folderPath':_0xefd256,'sourcePath':_0x3de1fd});}else{if(!_0xbd5073?.[_0x1aec9b(0x200)]){const _0x31ac2c=parseSegmentYamlFile(_0x24f98a),_0x439ba1=normalizeChildSegmentYaml(_0x31ac2c);_0x1b5269[_0x1aec9b(0x277)]({'yamlConfig':_0x439ba1,'folderPath':_0xefd256,'sourcePath':_0x3de1fd});}}}return{'segments':_0x1b5269,'journeys':_0x33e675};}function a98_0x3634(){const _0x62ff44=['find','item','\x27\x20from\x20file:\x20','getJourney','with','activationStepsById','parseDocument','WaitStep','\x27\x20milestone','size','get','onProgress','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','all','connector_config','getSegment','user','attributes','INTERNAL','\x27...','message','activation_updating','stringify','fetchJourney','withProgress','Segment\x20not\x20found:\x20','resolveJourneyId','ACTIVATION_UPDATE_ERROR','map','105724famhpc','activationContext','journeyById','\x20(referenced\x20in\x20journey\x20','delete','kind','Created\x20journey\x20\x27','folderPathToId','activation_created','parentFolder','segmentNameToId','journey_created','startsWith','embedded_activation_created','split','flatMap','notification','values','listSegments','decision_point','hasChanges','dirname','journeyStages','stage\x20\x27','deps','createdSegmentId','nameToId','embeddedSegmentNameToId','segmentId','logSuccess','DecisionPoint','4930700LcQCdk','isNew','reduce','utf-8','createdSegmentIds','goal','idToEmailMap','schedule','name','10358312PHBUEz','createJourneySegment','relative','Created\x20activation\x20\x27','segment_deleted','absolutePath','action','type','has','entryCriteria','toString','results','stages','idToName','activationsBySegmentId','created','activation_deleted','segment_deleting','verbose','segment','Activation','toLowerCase','embedded_activation_creating','existingJourney','skipSegments','26kCGxUi','activationActions','update','embedded_segment_creating','activation_creating','journeyActivationNameToId','journeys','journeyId','Deleted\x20segment\x20\x27','deleted','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','isArray','valid','filter','\x27\x20entry\x20criteria','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','entry_criteria','journey','connection','existingActivation','6BkGhjb','createFolder','index','JOURNEY_SYNTAX_ERROR','Fetching\x20','\x20error(s)','columns','Updating\x20activation\x20\x27','Creating\x20activation\x20\x27','exitCriterias','all_columns','9crOnWT','segment_updated','journeyActivationStepId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','deleteActivation','__pending_','length','logDeleted','keys','segment_updating','includes','set','./journey-yaml.js','Created\x20segment\x20\x27','segmentFolderId','./child-segment-yaml.js','entries','parentId','Updated\x20journey\x20\x27','versionNumber','max','resolveSegment','data','replace','yamlActivation','localSegmentRules','\x27\x20wait\x20condition',').\x20','1322166BBaoEl','activation_template_id','add','milestone','Stage\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','createSegment','waitCondition','SEGMENT_SYNTAX_ERROR','activations','progress','description','folderPath','from','diff','createActivation','NOT_FOUND','segment_created','existingSegment','existingSegments','listActivations','Deleted\x20activation\x20\x27','updated','connectionIdToNameMap','join','parse','rootFolderId','folderId','steps','\x27\x20exit\x20criteria','SEGMENT_NOT_FOUND','\x0a\x20\x20','list','6626680DoLygD','\x20activation\x20\x27','367752tckRvG','sha1','digest','\x20journey\x20from\x20file:\x20','folder','updateActivation','yamlConfig','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','segments','Creating\x20segment\x20\x27','activation_','unchanged','Updated\x20segment\x20\x27','\x27\x20decision\x20point\x20branch\x20\x27','slice','sort','../../utils/async.js','create','errors','Entry\x20criteria:\x20','Failed\x20to\x20','journeyBundleName','\x27\x20for\x20','buildUserMaps','push','SEGMENT_UPDATE_ERROR','Activation\x20not\x20found:\x20','journey_entry_criteria_','activation_deleting','124512oHsDPI','journey_updating','\x20segment\x20from\x20file:\x20','rule','relationships','validatedRequest','getActivation','branches'];a98_0x3634=function(){return _0x62ff44;};return a98_0x3634();}export function validateParsedFiles(_0x49c9bc,_0x52a4cb){const _0x227e38=a98_0x545ff9,_0x535ffc=[];for(const {yamlConfig:_0x2b323b,sourcePath:_0x1535ba}of _0x49c9bc[_0x227e38(0x267)]){const _0x2af58c=readFileSync(_0x1535ba,_0x227e38(0x1e2)),_0x1f39ec=a98_0x1fee7e[_0x227e38(0x28a)](_0x2af58c),_0x2f9eb5=validateSegmentDef(_0x2b323b,{'source':_0x2af58c,'document':_0x1f39ec});if(!_0x2f9eb5[_0x227e38(0x20d)]){const _0x5a9b3c=a98_0x4a9171[_0x227e38(0x1ea)](_0x52a4cb,_0x1535ba);_0x535ffc[_0x227e38(0x277)]({'filePath':_0x5a9b3c,'source':_0x2af58c,'result':_0x2f9eb5,'isJourney':![]});}}for(const {yamlConfig:_0x4e70fd,sourcePath:_0x4f1bc4}of _0x49c9bc['journeys']){const _0x532ecc=readFileSync(_0x4f1bc4,_0x227e38(0x1e2)),_0x2546df=a98_0x1fee7e[_0x227e38(0x28a)](_0x532ecc),_0x2e857c=validateJourneyDef(_0x4e70fd,{'source':_0x532ecc,'document':_0x2546df});if(!_0x2e857c[_0x227e38(0x20d)]){const _0x5b1fa4=a98_0x4a9171[_0x227e38(0x1ea)](_0x52a4cb,_0x4f1bc4);_0x535ffc[_0x227e38(0x277)]({'filePath':_0x5b1fa4,'source':_0x532ecc,'result':_0x2e857c,'isJourney':!![]});}}return _0x535ffc;}export function formatValidationErrors(_0x3ff87d){const _0x5cf9d0=a98_0x545ff9,_0x5af0ec=[];for(const {filePath:_0x31272a,source:_0x215ab2,result:_0x3ae9dc,isJourney:_0x386cad}of _0x3ff87d){const _0x38ad3c=_0x386cad?_0x5cf9d0(0x212):_0x5cf9d0(0x1fb);_0x5af0ec[_0x5cf9d0(0x277)]('\x0a'+_0x31272a+'\x20('+_0x38ad3c+'):\x20'+_0x3ae9dc[_0x5cf9d0(0x271)][_0x5cf9d0(0x226)]+_0x5cf9d0(0x21a)),_0x5af0ec[_0x5cf9d0(0x277)](formatValidationResult(_0x3ae9dc,_0x215ab2,_0x31272a));}return _0x5af0ec[_0x5cf9d0(0x254)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x3fdec0){const _0x20459b=a98_0x545ff9,_0x267993=new Set(),_0x58ea11=new Map(),_0x2434b7=collectSegmentUsageCounts(_0x3fdec0);if(_0x3fdec0[_0x20459b(0x267)])for(const [_0x3fb1b7,_0x2cf66c]of Object[_0x20459b(0x230)](_0x3fdec0[_0x20459b(0x267)])){_0x267993['add'](_0x3fb1b7);if(_0x2cf66c[_0x20459b(0x27f)]){const _0x4f6ab5=yamlRuleToApi(_0x2cf66c[_0x20459b(0x27f)]),_0x15a6d4=apiRuleToYaml(_0x4f6ab5);_0x58ea11[_0x20459b(0x22b)](_0x3fb1b7,_0x15a6d4);}}const _0x4057c4=new Map();let _0x472a08=0x0;for(const [_0x5a9bc6,_0x2091ca]of _0x58ea11){const _0x2b6f66=serializeExpandedRule(_0x2091ca,_0x58ea11),_0x4b212e=_0x4057c4[_0x20459b(0x1ad)](_0x2b6f66)||[];_0x4b212e[_0x20459b(0x277)]({'name':_0x5a9bc6,'index':_0x472a08}),_0x4057c4[_0x20459b(0x22b)](_0x2b6f66,_0x4b212e),_0x472a08++;}const _0x40a066=new Map();for(const [_0xa9dfef,_0x8e4507]of _0x4057c4){const _0x1dca06=_0x8e4507['slice']()[_0x20459b(0x26e)]((_0x11b04c,_0x2063b4)=>{const _0x2687a7=_0x20459b,_0x1f4a3f=_0x2434b7[_0x2687a7(0x1ad)](_0x11b04c[_0x2687a7(0x1e7)])||0x0,_0x801395=_0x2434b7[_0x2687a7(0x1ad)](_0x2063b4[_0x2687a7(0x1e7)])||0x0;if(_0x1f4a3f!==_0x801395)return _0x801395-_0x1f4a3f;return _0x11b04c[_0x2687a7(0x217)]-_0x2063b4[_0x2687a7(0x217)];})[_0x20459b(0x1bf)](_0x3a0d93=>_0x3a0d93[_0x20459b(0x1e7)]),_0x5e1c23=[];for(const _0x4fde36 of _0x1dca06){const _0x4dedbc=_0x2434b7[_0x20459b(0x1ad)](_0x4fde36)||0x0,_0x7e7e3f=Math[_0x20459b(0x234)](_0x4dedbc,0x1);for(let _0x3bbfd5=0x0;_0x3bbfd5<_0x7e7e3f;_0x3bbfd5++){_0x5e1c23[_0x20459b(0x277)](_0x4fde36);}}_0x40a066[_0x20459b(0x22b)](_0xa9dfef,_0x5e1c23);}return{'existingLocalSegmentNames':_0x267993,'localSegmentRules':_0x58ea11,'localExpandedRuleToNames':_0x40a066};}async function buildServerSegmentRuleMap(_0x2a9ccf,_0x1bc91b,_0xafc8b6,_0x4be332){const _0x122085=new Map(),_0x40bc1b=new Set(),_0x25b757=async _0x2481b9=>{const _0x1f0e8d=a98_0x1668;if(_0x40bc1b['has'](_0x2481b9))return;_0x40bc1b[_0x1f0e8d(0x23e)](_0x2481b9);let _0x3e186a=_0xafc8b6[_0x1f0e8d(0x284)](_0x17d374=>_0x17d374['id']===_0x2481b9);if(!_0x3e186a)try{_0x3e186a=await _0x2a9ccf[_0x1f0e8d(0x1fb)][_0x1f0e8d(0x1b2)](_0x1bc91b,_0x2481b9);}catch{return;}if(!_0x3e186a?.['rule'])return;const _0x191991=apiRuleToYaml(_0x3e186a[_0x1f0e8d(0x27f)]);_0x122085[_0x1f0e8d(0x22b)](_0x2481b9,_0x191991);const _0x3e582f=collectSegmentRefsFromRule(_0x191991);for(const _0x44d007 of _0x3e582f){await _0x25b757(_0x44d007);}};for(const _0x41b856 of _0x4be332){await _0x25b757(_0x41b856);}return _0x122085;}export function createSegmentIdResolver(_0x2fd889,_0x34824f){return async _0x977483=>{const _0x371d8b=a98_0x1668,_0x2b00f9=_0x2fd889[_0x371d8b(0x1ad)](_0x977483);if(!_0x2b00f9)throw new SDKError(ErrorCode[_0x371d8b(0x25a)],_0x371d8b(0x1bc)+_0x977483+_0x371d8b(0x223)+_0x34824f+'\x27)');return _0x2b00f9;};}export function extractRootFolderId(_0x1611a9){const _0x55f7b9=a98_0x545ff9;return _0x1611a9[_0x55f7b9(0x280)]?.['parentSegmentFolder']?.[_0x55f7b9(0x236)]?.['id']||_0x1611a9[_0x55f7b9(0x280)]?.[_0x55f7b9(0x1c9)]?.[_0x55f7b9(0x236)]?.['id'];}export function buildConnectionMaps(_0x1b2118){const _0x27ac87=a98_0x545ff9,_0x148946=new Map(),_0x4ca259=new Map(),_0x23b7e9=new Map();for(const _0x3cde4e of _0x1b2118){_0x148946[_0x27ac87(0x22b)](_0x3cde4e['name'],parseInt(_0x3cde4e['id'],0xa)),_0x4ca259[_0x27ac87(0x22b)](_0x3cde4e['id'],_0x3cde4e['name']),_0x23b7e9[_0x27ac87(0x22b)](_0x3cde4e['name'],_0x3cde4e['type']);}return{'nameToId':_0x148946,'idToName':_0x4ca259,'nameToType':_0x23b7e9};}export function calculatePushStats(_0x4e3a51,_0x51c8b6,_0x4f2a28,_0x4d2304,_0x570445,_0x23dd10,_0x10140b){const _0x361deb=a98_0x545ff9,_0x499926=_0x4e3a51[_0x361deb(0x20e)](_0x589817=>_0x589817[_0x361deb(0x1e0)]),_0x30660b=_0x4e3a51['filter'](_0x54bbd3=>!_0x54bbd3['isNew']&&_0x54bbd3[_0x361deb(0x1d4)]),_0x158eed=_0x4e3a51['filter'](_0x46d1e0=>!_0x46d1e0[_0x361deb(0x1e0)]&&!_0x46d1e0[_0x361deb(0x1d4)]),_0x2621ce=_0x23dd10?_0x4d2304:[],_0x1d2557=_0x51c8b6[_0x361deb(0x20e)](_0x353544=>_0x353544[_0x361deb(0x1e0)]),_0x525a36=_0x51c8b6[_0x361deb(0x20e)](_0x39e23b=>!_0x39e23b[_0x361deb(0x1e0)]&&_0x39e23b['hasChanges']),_0x83b237=_0x51c8b6[_0x361deb(0x20e)](_0x65adf6=>!_0x65adf6[_0x361deb(0x1e0)]&&!_0x65adf6[_0x361deb(0x1d4)]),_0x490e8d=_0x23dd10?_0x570445:[],_0x23bff4=_0x4e3a51[_0x361deb(0x1cf)](_0x27584f=>_0x27584f[_0x361deb(0x202)]),_0x2c032b=_0x23bff4[_0x361deb(0x20e)](_0x28be89=>_0x28be89['type']===_0x361deb(0x270)),_0x4a0d0c=_0x23bff4[_0x361deb(0x20e)](_0x4bbd42=>_0x4bbd42['type']===_0x361deb(0x203)),_0x288e17=_0x23bff4[_0x361deb(0x20e)](_0x147226=>_0x147226[_0x361deb(0x1ef)]==='delete'),_0x30382d=Array[_0x361deb(0x249)](_0x4f2a28)[_0x361deb(0x26e)](),_0x127173=_0x10140b?![]:_0x499926[_0x361deb(0x226)]>0x0||_0x30660b[_0x361deb(0x226)]>0x0||_0x2621ce[_0x361deb(0x226)]>0x0,_0x365b6f=_0x1d2557[_0x361deb(0x226)]>0x0||_0x525a36[_0x361deb(0x226)]>0x0||_0x490e8d[_0x361deb(0x226)]>0x0,_0x13f146=_0x10140b?![]:_0x23bff4[_0x361deb(0x226)]>0x0,_0x36cfbf=_0x30382d[_0x361deb(0x226)]>0x0;return{'segments':{'new':_0x499926,'changed':_0x30660b,'unchanged':_0x158eed,'toDelete':_0x2621ce},'journeys':{'new':_0x1d2557,'changed':_0x525a36,'unchanged':_0x83b237,'toDelete':_0x490e8d},'activations':{'all':_0x23bff4,'toCreate':_0x2c032b,'toUpdate':_0x4a0d0c,'toDelete':_0x288e17},'folders':{'toCreate':_0x30382d},'counts':{'segments':{'new':_0x499926[_0x361deb(0x226)],'changed':_0x30660b['length'],'unchanged':_0x158eed[_0x361deb(0x226)],'toDelete':_0x2621ce[_0x361deb(0x226)]},'journeys':{'new':_0x1d2557[_0x361deb(0x226)],'changed':_0x525a36['length'],'unchanged':_0x83b237[_0x361deb(0x226)],'toDelete':_0x490e8d[_0x361deb(0x226)]},'activations':{'create':_0x2c032b[_0x361deb(0x226)],'update':_0x4a0d0c[_0x361deb(0x226)],'delete':_0x288e17['length']},'folders':_0x30382d[_0x361deb(0x226)]},'hasChanges':_0x127173||_0x365b6f||_0x13f146||_0x36cfbf};}export async function buildPushExecutionContext(_0x44379d,_0x5d77fa,_0xb12d65,_0xe614,_0x2dab5a,_0x3e7e4e){const _0x1c91bb=a98_0x545ff9,_0x1e349a=extractRootFolderId(_0xb12d65),{pathToId:_0x5e822a,idToPath:_0xbbbde9}=buildFolderMaps(_0x2dab5a),_0x43aa75=buildSegmentNameToIdMap(_0xe614),_0x500fbe=new Map(),{batchAsync:_0x2e9eed}=await import(_0x1c91bb(0x26f)),[_0x3f6361,_0x414754]=await Promise[_0x1c91bb(0x1b0)]([_0x44379d[_0x1c91bb(0x1b3)][_0x1c91bb(0x276)](),_0x44379d[_0x1c91bb(0x213)][_0x1c91bb(0x25c)](),((async()=>{const _0x37141c=_0x1c91bb;!_0x3e7e4e&&_0xe614[_0x37141c(0x226)]>0x0&&await _0x2e9eed(_0xe614,async _0x456ae4=>{const _0x5a95ff=_0x37141c,_0x36c486=await _0x44379d['segment'][_0x5a95ff(0x250)](_0x5d77fa,_0x456ae4['id']);_0x500fbe[_0x5a95ff(0x22b)](_0x456ae4['id'],_0x36c486);});})())]),{emailToId:_0xb7e373,idToEmail:_0x100513}=_0x3f6361,_0x10e053=buildConnectionMaps(_0x414754);return{'rootFolderId':_0x1e349a,'folderPathToId':_0x5e822a,'folderIdToPath':_0xbbbde9,'segmentNameToId':_0x43aa75,'activationsBySegmentId':_0x500fbe,'emailToIdMap':_0xb7e373,'idToEmailMap':_0x100513,'connectionNameToIdMap':_0x10e053[_0x1c91bb(0x1da)],'connectionIdToNameMap':_0x10e053[_0x1c91bb(0x1f5)],'connectionNameToTypeMap':_0x10e053['nameToType']};}export function createPushYamlContextForBundle(_0x3d98d8,_0x4c53d8,_0x1ec99,_0x57ca5e,_0x33ac29,_0x593ff9,_0x5b8800,_0x52f52d){const {existingLocalSegmentNames:_0x449527,localExpandedRuleToNames:_0x343bcd}=_0x57ca5e,_0x105d27=new Set(),_0x388c28=new Map(),_0x3494e6=new Map(),_0x3fb7bd=new Map(),_0x5c716c=createJumpTargetCache(),_0x388c10=new Map(),_0xf5c451=new Map(),_0x3388db=new Set();let _0x20d9f1;const _0x50cfb9=_0x51f9eb=>{const _0x409040={'resolveSegment':async _0x5f34f6=>{const _0x254813=a98_0x1668,_0xc5e67d=_0x3fb7bd[_0x254813(0x1ad)](_0x5f34f6);if(_0xc5e67d!==undefined)return{'name':_0xc5e67d,'isJourneyLocal':!![]};try{let _0x3e44fe=_0x1ec99[_0x254813(0x284)](_0x42a2a8=>_0x42a2a8['id']===_0x5f34f6);!_0x3e44fe&&(_0x3e44fe=await _0x3d98d8['segment'][_0x254813(0x1b2)](_0x4c53d8,_0x5f34f6));const _0x32719e=generateJourneyLocalName(_0x3e44fe[_0x254813(0x1e7)]),_0x3f18c0=_0x3e44fe[_0x254813(0x1c5)]===SEGMENT_KIND_JOURNEY&&_0x32719e!==undefined;let _0x5deb07=_0x3e44fe['name'],_0x5a3393;if(_0x3f18c0&&_0x3e44fe[_0x254813(0x27f)]){const _0x569773=apiRuleToYaml(_0x3e44fe[_0x254813(0x27f)]);_0xf5c451[_0x254813(0x22b)](_0x5f34f6,_0x569773);const _0x228e8a=async _0x3ce2ae=>{const _0x1e5604=_0x254813,_0x243de5=collectSegmentRefsFromRule(_0x3ce2ae);for(const _0xc981f1 of _0x243de5){if(!_0xf5c451[_0x1e5604(0x1f0)](_0xc981f1))try{const _0x3b00e4=await _0x3d98d8[_0x1e5604(0x1fb)][_0x1e5604(0x1b2)](_0x4c53d8,_0xc981f1);if(_0x3b00e4?.['rule']){const _0x368117=apiRuleToYaml(_0x3b00e4[_0x1e5604(0x27f)]);_0xf5c451[_0x1e5604(0x22b)](_0xc981f1,_0x368117),await _0x228e8a(_0x368117);}}catch{}}};await _0x228e8a(_0x569773);const _0x2ac18=serializeExpandedRule(_0x569773,_0xf5c451),_0x1cab83=_0x343bcd['get'](_0x2ac18);if(_0x1cab83&&_0x1cab83['length']>0x0){const _0x17cfdb=_0x388c28[_0x254813(0x1ad)](_0x2ac18)||0x0,_0x5bccbc=_0x1cab83[_0x17cfdb]||_0x1cab83[_0x1cab83['length']-0x1];_0x388c28[_0x254813(0x22b)](_0x2ac18,_0x17cfdb+0x1),_0x5deb07=_0x5bccbc,_0x105d27['add'](_0x5deb07),_0x3fb7bd[_0x254813(0x22b)](_0x5f34f6,_0x5deb07);const _0x1f5955=await resolveRuleSegmentRefs(_0x569773,async _0x44669a=>{const _0x53b99e=_0x254813,_0x4b0146=_0x3fb7bd[_0x53b99e(0x1ad)](_0x44669a);if(_0x4b0146)return _0x4b0146;const _0x435760=await _0x20d9f1[_0x53b99e(0x235)](_0x44669a);return _0x435760['name'];});_0x5a3393={'description':_0x3e44fe['description'],'rule':_0x1f5955};}else{const _0x154851=_0x388c10[_0x254813(0x1ad)](_0x2ac18);if(_0x154851)_0x5deb07=_0x154851,_0x3fb7bd[_0x254813(0x22b)](_0x5f34f6,_0x5deb07);else{if(_0x32719e){let _0x2784ce=_0x32719e,_0x4d0483=0x2;while(_0x105d27[_0x254813(0x1f0)](_0x2784ce)||_0x449527[_0x254813(0x1f0)](_0x2784ce)){_0x2784ce=_0x32719e+'_'+_0x4d0483,_0x4d0483++;}_0x105d27['add'](_0x2784ce),_0x5deb07=_0x2784ce;}_0x3fb7bd['set'](_0x5f34f6,_0x5deb07),_0x388c10[_0x254813(0x22b)](_0x2ac18,_0x5deb07);const _0x4fe7c7=await resolveRuleSegmentRefs(_0x569773,async _0x2ff80f=>{const _0x48db2f=_0x254813,_0xd6488f=_0x3fb7bd['get'](_0x2ff80f);if(_0xd6488f)return _0xd6488f;const _0x3b8198=await _0x20d9f1[_0x48db2f(0x235)](_0x2ff80f);return _0x3b8198['name'];});_0x5a3393={'description':_0x3e44fe[_0x254813(0x247)],'rule':_0x4fe7c7};}}}return{'name':_0x5deb07,'isJourneyLocal':_0x3f18c0,'definition':_0x5a3393};}catch{return{'name':_0x5f34f6,'isJourneyLocal':![]};}},'resolveActivation':async _0x1450e5=>{const _0x45a83a=a98_0x1668,_0x4850a6=_0x3494e6[_0x45a83a(0x1ad)](_0x1450e5);if(_0x4850a6!==undefined)return{'name':_0x4850a6,'isJourneyLocal':!![]};try{let _0x17ed4a=_0x5b8800?.[_0x45a83a(0x1ad)](_0x1450e5);!_0x17ed4a&&(_0x17ed4a=await _0x3d98d8[_0x45a83a(0x212)][_0x45a83a(0x282)](_0x51f9eb,_0x1450e5));const _0x2abfae=_0x17ed4a[_0x45a83a(0x1b4)]['activationParams'][_0x45a83a(0x1e7)]||_0x1450e5,_0x3d2bc5=sanitizeYamlKey(_0x2abfae)||_0x45a83a(0x269)+_0x1450e5,_0x4e6028=_0x3d2bc5;_0x3494e6[_0x45a83a(0x22b)](_0x1450e5,_0x4e6028);const _0x5c19ac=journeyActivationStepToYaml(_0x17ed4a,_0x33ac29,_0x593ff9);return{'name':_0x4e6028,'isJourneyLocal':!![],'definition':_0x5c19ac};}catch{return{'name':_0x1450e5,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5a1efc,_0x2add03)=>resolveJumpTarget(_0x5a1efc,_0x2add03,_0x5c716c,async _0xd6e0c9=>{const _0x331f58=a98_0x1668,_0x5ce015=_0x52f52d?.[_0x331f58(0x1ad)](_0xd6e0c9);if(_0x5ce015)return _0x5ce015;return _0x3d98d8[_0x331f58(0x212)]['getJourney'](_0xd6e0c9);})};return _0x20d9f1=_0x409040,_0x409040;},_0x5b3d6d=async _0x87a9b4=>{const _0x2d3af7=a98_0x1668,{collectSegmentIdsFromJourneyApi:_0x4fb92d}=await import(_0x2d3af7(0x22c)),{batchAsync:_0xd6b6c2}=await import('../../utils/async.js'),_0x34cc6f=new Set();for(const _0x2c033d of _0x87a9b4){let _0x1b3c7d=_0x52f52d?.[_0x2d3af7(0x1ad)](_0x2c033d);!_0x1b3c7d&&(_0x1b3c7d=await _0x3d98d8['journey'][_0x2d3af7(0x287)](_0x2c033d));const _0x1a5c81=_0x4fb92d(_0x1b3c7d);for(const _0x5d0e07 of _0x1a5c81){_0x34cc6f[_0x2d3af7(0x23e)](_0x5d0e07);}}let _0x37230e=Array['from'](_0x34cc6f);while(_0x37230e[_0x2d3af7(0x226)]>0x0){const _0x427c2f=_0x37230e[_0x2d3af7(0x20e)](_0x55f80e=>!_0x3388db[_0x2d3af7(0x1f0)](_0x55f80e));if(_0x427c2f[_0x2d3af7(0x226)]===0x0)break;const _0x3b558a=await _0xd6b6c2(_0x427c2f,async _0x494387=>{const _0x5c74d2=_0x2d3af7;_0x3388db['add'](_0x494387);let _0x15c931=_0x1ec99[_0x5c74d2(0x284)](_0x2f4f2c=>_0x2f4f2c['id']===_0x494387);if(!_0x15c931)try{_0x15c931=await _0x3d98d8['segment'][_0x5c74d2(0x1b2)](_0x4c53d8,_0x494387);}catch{return null;}return{'segmentId':_0x494387,'segment':_0x15c931};},0xa),_0x118ca9=new Set();for(const _0x25b324 of _0x3b558a){if(!_0x25b324?.['segment']?.[_0x2d3af7(0x27f)])continue;const _0x788389=apiRuleToYaml(_0x25b324[_0x2d3af7(0x1fb)]['rule']);_0xf5c451[_0x2d3af7(0x22b)](_0x25b324[_0x2d3af7(0x1dc)],_0x788389);const _0x2be5fa=collectSegmentRefsFromRule(_0x788389);for(const _0x448911 of _0x2be5fa){!_0x3388db[_0x2d3af7(0x1f0)](_0x448911)&&_0x118ca9[_0x2d3af7(0x23e)](_0x448911);}}_0x37230e=Array[_0x2d3af7(0x249)](_0x118ca9);}};return{'createYamlContext':_0x50cfb9,'prefetchJourneySegments':_0x5b3d6d};}export async function executePushSegments(_0x5cb398,_0x2e5ba1,_0x141042,_0x15258b,_0x592bee){const _0x38421b=a98_0x545ff9,{segmentDefToCreateRequest:_0x1a6cae,segmentDefToUpdateRequest:_0x5e9545}=await import(_0x38421b(0x22f)),_0x378f77=_0x141042['folderPathToId'],_0x318d85=0x5,_0x2eae01=async _0x47d65d=>{const _0x4b55b3=_0x38421b,_0x50352e=_0x47d65d[_0x4b55b3(0x248)]?_0x378f77[_0x4b55b3(0x1ad)](_0x47d65d[_0x4b55b3(0x248)]):undefined;let _0x45ae72;const _0x5de558={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x47d65d['isNew']){_0x592bee[_0x4b55b3(0x1ae)]?.({'type':'segment_creating','name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]});const _0x39c9d0=_0x1a6cae(_0x47d65d['yamlConfig'],_0x50352e),_0x6c44b9=await _0x592bee['withProgress'](_0x4b55b3(0x268)+_0x47d65d[_0x4b55b3(0x265)]['name']+_0x4b55b3(0x1b6),()=>_0x5cb398['segment'][_0x4b55b3(0x242)](_0x15258b['parentId'],_0x39c9d0));_0x45ae72=_0x6c44b9['data']['id'],_0x5de558[_0x4b55b3(0x1d9)]={'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)],'id':_0x45ae72},_0x592bee['onProgress']?.({'type':_0x4b55b3(0x24d),'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)],'segmentId':_0x45ae72}),_0x592bee['logSuccess']?.(_0x4b55b3(0x22d)+_0x47d65d[_0x4b55b3(0x265)]['name']+'\x27'),_0x5de558[_0x4b55b3(0x1f7)]=0x1;}else{if(_0x47d65d[_0x4b55b3(0x1d4)]){_0x592bee[_0x4b55b3(0x1ae)]?.({'type':_0x4b55b3(0x229),'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]});const _0x1facf4=_0x5e9545(_0x47d65d[_0x4b55b3(0x265)]);_0x50352e!==_0x47d65d[_0x4b55b3(0x24e)]?.[_0x4b55b3(0x22e)]&&(_0x1facf4[_0x4b55b3(0x22e)]=_0x50352e?parseInt(_0x50352e,0xa):undefined),await _0x592bee[_0x4b55b3(0x1bb)]('Updating\x20segment\x20\x27'+_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]+_0x4b55b3(0x1b6),()=>_0x5cb398['segment']['updateSegmentById'](_0x15258b[_0x4b55b3(0x231)],_0x47d65d['existingSegment']['id'],_0x1facf4)),_0x45ae72=_0x47d65d['existingSegment']['id'],_0x592bee[_0x4b55b3(0x1ae)]?.({'type':_0x4b55b3(0x221),'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]}),_0x592bee[_0x4b55b3(0x1dd)]?.(_0x4b55b3(0x26b)+_0x47d65d[_0x4b55b3(0x265)]['name']+'\x27'),_0x5de558[_0x4b55b3(0x252)]=0x1;}else _0x45ae72=_0x47d65d[_0x4b55b3(0x24e)]['id'];}}catch(_0xbb29d1){const _0xb0546e=isHttp400Error(_0xbb29d1),_0x2b390d=_0xb0546e?ErrorCode[_0x4b55b3(0x244)]:ErrorCode[_0x4b55b3(0x278)],_0x4446ab=getErrorMessage(_0xbb29d1);throw new SDKError(_0x2b390d,_0x4b55b3(0x273)+(_0x47d65d[_0x4b55b3(0x1e0)]?_0x4b55b3(0x270):_0x4b55b3(0x203))+_0x4b55b3(0x27e)+_0x47d65d[_0x4b55b3(0x1ed)]+_0x4b55b3(0x25b)+_0x4446ab,_0xbb29d1);}try{const _0x4a7589=await syncActivationsForSegment(_0x5cb398,_0x15258b[_0x4b55b3(0x231)],_0x45ae72,_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)],_0x47d65d[_0x4b55b3(0x202)],_0x592bee,_0x47d65d[_0x4b55b3(0x1ed)]);_0x5de558[_0x4b55b3(0x245)]=_0x4a7589;}catch(_0x2c3488){if(_0x2c3488 instanceof SDKError)throw _0x2c3488;throw new SDKError(ErrorCode[_0x4b55b3(0x1be)],_0x4b55b3(0x241)+_0x47d65d['yamlConfig'][_0x4b55b3(0x1e7)]+'\x27\x20from\x20file:\x20'+_0x47d65d['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0x2c3488),_0x2c3488);}return _0x5de558;},_0x3f8163=await batchAsync(_0x2e5ba1,_0x2eae01,_0x318d85),_0x2250f7={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5e9c33 of _0x3f8163){_0x2250f7['created']+=_0x5e9c33['created'],_0x2250f7[_0x38421b(0x252)]+=_0x5e9c33[_0x38421b(0x252)],_0x5e9c33[_0x38421b(0x1d9)]&&_0x2250f7[_0x38421b(0x1e3)]['set'](_0x5e9c33['createdSegmentId'][_0x38421b(0x1e7)],_0x5e9c33[_0x38421b(0x1d9)]['id']),_0x2250f7[_0x38421b(0x245)][_0x38421b(0x1f7)]+=_0x5e9c33[_0x38421b(0x245)]['created'],_0x2250f7[_0x38421b(0x245)][_0x38421b(0x252)]+=_0x5e9c33['activations'][_0x38421b(0x252)],_0x2250f7[_0x38421b(0x245)][_0x38421b(0x20a)]+=_0x5e9c33['activations'][_0x38421b(0x20a)];}return _0x2250f7;}async function syncActivationsForSegment(_0x459475,_0x199cd0,_0x1379d3,_0x401402,_0x19f926,_0x5c2438,_0x26e7ac){const _0x7e8658=a98_0x545ff9,_0x399e8f={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4d5c80 of _0x19f926){try{if(_0x4d5c80['type']===_0x7e8658(0x270)&&_0x4d5c80['validatedRequest'])_0x5c2438['onProgress']?.({'type':_0x7e8658(0x205),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),await _0x5c2438[_0x7e8658(0x1bb)](_0x7e8658(0x21d)+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x1b6),()=>_0x459475[_0x7e8658(0x1fb)][_0x7e8658(0x24b)](_0x199cd0,_0x1379d3,_0x4d5c80['validatedRequest'])),_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x1c8),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),_0x5c2438[_0x7e8658(0x1dd)]?.(_0x7e8658(0x1eb)+_0x4d5c80[_0x7e8658(0x1e7)]+'\x27'),_0x399e8f[_0x7e8658(0x1f7)]++;else{if(_0x4d5c80[_0x7e8658(0x1ef)]==='update'&&_0x4d5c80[_0x7e8658(0x281)]&&_0x4d5c80[_0x7e8658(0x214)])_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x1b8),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),await _0x5c2438[_0x7e8658(0x1bb)](_0x7e8658(0x21c)+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x1b6),()=>_0x459475[_0x7e8658(0x1fb)][_0x7e8658(0x264)](_0x199cd0,_0x1379d3,_0x4d5c80[_0x7e8658(0x214)]['id'],_0x4d5c80[_0x7e8658(0x281)])),_0x5c2438['onProgress']?.({'type':'activation_updated','segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),_0x5c2438[_0x7e8658(0x1dd)]?.('Updated\x20activation\x20\x27'+_0x4d5c80['name']+'\x27'),_0x399e8f[_0x7e8658(0x252)]++;else _0x4d5c80['type']===_0x7e8658(0x1c4)&&_0x4d5c80['existingActivation']&&(_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x27b),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),await _0x5c2438[_0x7e8658(0x1bb)]('Deleting\x20activation\x20\x27'+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x1b6),()=>_0x459475[_0x7e8658(0x1fb)][_0x7e8658(0x224)](_0x199cd0,_0x1379d3,_0x4d5c80[_0x7e8658(0x214)]['id'])),_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x1f8),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),_0x5c2438['logDeleted']?.(_0x7e8658(0x251)+_0x4d5c80[_0x7e8658(0x1e7)]+'\x27'),_0x399e8f[_0x7e8658(0x20a)]++);}}catch(_0xa1cc86){const _0x1fc165=isHttp400Error(_0xa1cc86),_0x126880=_0x1fc165?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x3df723=getErrorMessage(_0xa1cc86);throw new SDKError(_0x126880,_0x7e8658(0x273)+_0x4d5c80['type']+_0x7e8658(0x25e)+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x286)+_0x26e7ac+_0x7e8658(0x25b)+_0x3df723,_0xa1cc86);}}return _0x399e8f;}export async function executePushFolders(_0x2a6bd7,_0x1f6d8d,_0x5663df,_0x1d1992,_0x5cce4f){const _0xb295d8=a98_0x545ff9,_0x41dc18=new Map(_0x5663df);for(const _0x3195d0 of _0x1f6d8d){const _0x369543=_0x3195d0[_0xb295d8(0x1ce)]('/'),_0x2528cd=_0x369543[_0x369543['length']-0x1],_0x5dd12f=_0x369543[_0xb295d8(0x26d)](0x0,-0x1)[_0xb295d8(0x254)]('/'),_0x30db51=_0x41dc18[_0xb295d8(0x1ad)](_0x5dd12f);_0x5cce4f['onProgress']?.({'type':'folder_creating','folder':_0x3195d0});const _0x48a8fd={'name':_0x2528cd,'parentFolderId':_0x30db51},_0x4e832b=await _0x5cce4f[_0xb295d8(0x1bb)]('Creating\x20folder\x20\x27'+_0x3195d0+_0xb295d8(0x1b6),()=>_0x2a6bd7[_0xb295d8(0x1fb)][_0xb295d8(0x216)](_0x1d1992[_0xb295d8(0x231)],_0x48a8fd));_0x41dc18['set'](_0x3195d0,_0x4e832b[_0xb295d8(0x236)]['id']),_0x5cce4f[_0xb295d8(0x1ae)]?.({'type':'folder_created','folder':_0x3195d0,'folderId':_0x4e832b[_0xb295d8(0x236)]['id']}),_0x5cce4f['logInfo']?.('Created\x20folder\x20\x27'+_0x3195d0+'\x27');}return _0x41dc18;}export async function executePushSegmentDeletions(_0x9cbdb0,_0x58f029,_0x4e08a8){const _0x4b0bc4=a98_0x545ff9;if(_0x58f029['length']===0x0)return 0x0;const {batchAsync:_0x157747}=await import(_0x4b0bc4(0x26f)),_0x1f4530=0x5,_0x17721d=await _0x157747(_0x58f029,async _0x188b01=>{const _0x2479dd=_0x4b0bc4;return _0x4e08a8['onProgress']?.({'type':_0x2479dd(0x1f9),'name':_0x188b01[_0x2479dd(0x1e7)]}),await _0x9cbdb0[_0x2479dd(0x1fb)]['deleteSegment'](_0x188b01['id']),_0x4e08a8[_0x2479dd(0x1ae)]?.({'type':_0x2479dd(0x1ec),'name':_0x188b01['name']}),_0x4e08a8[_0x2479dd(0x227)]?.(_0x2479dd(0x209)+_0x188b01[_0x2479dd(0x1e7)]+'\x27'),0x1;},_0x1f4530);return _0x17721d[_0x4b0bc4(0x1e1)]((_0x518562,_0x38df0a)=>_0x518562+_0x38df0a,0x0);}export async function executePushJourneys(_0x2e5819,_0x18c266,_0x2ca293,_0x4a700c,_0x44dd8f){const _0x362eca=a98_0x545ff9,{journeyDefToRequest:_0x1ed69b}=await import(_0x362eca(0x22c)),{activationDefToCreateRequest:_0x4e4f1f,yamlRuleToApi:_0x575318,validateSegmentRule:_0x665502}=await import(_0x362eca(0x22f)),_0x450256={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x249fb3=new Map(_0x2ca293[_0x362eca(0x1ca)]),_0x5da4e4=0x5;for(let _0x40b369=0x0;_0x40b369<_0x18c266['length'];_0x40b369+=_0x5da4e4){const _0x5aa9b6=_0x18c266[_0x362eca(0x26d)](_0x40b369,_0x40b369+_0x5da4e4),_0xfa43f3=await Promise[_0x362eca(0x1b0)](_0x5aa9b6[_0x362eca(0x1bf)](async _0x37643d=>{const _0x4c3b1f=_0x362eca;if(!_0x37643d[_0x4c3b1f(0x1e0)]&&!_0x37643d[_0x4c3b1f(0x1d4)])return{'action':'unchanged','name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)],'journeyId':_0x37643d[_0x4c3b1f(0x1ff)]?.['id']};const _0x18d52d=_0x37643d[_0x4c3b1f(0x248)]?_0x2ca293[_0x4c3b1f(0x1c7)]['get'](_0x37643d[_0x4c3b1f(0x248)]):undefined;_0x44dd8f['onProgress']?.({'type':_0x37643d[_0x4c3b1f(0x1e0)]?'journey_creating':_0x4c3b1f(0x27d),'name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]});try{const _0x4cb435=await executeSingleJourneyPush(_0x2e5819,_0x37643d,{..._0x2ca293,'segmentNameToId':_0x249fb3},{'parentId':_0x4a700c['parentId'],'rootFolderId':_0x4a700c[_0x4c3b1f(0x256)],'folderId':_0x18d52d,'verbose':_0x4a700c[_0x4c3b1f(0x1fa)]},_0x44dd8f,{'journeyDefToRequest':_0x1ed69b,'activationDefToCreateRequest':_0x4e4f1f,'yamlRuleToApi':_0x575318,'validateSegmentRule':_0x665502});for(const [_0x32225c,_0x2ddb1f]of _0x4cb435['embeddedSegmentNameToId']){_0x249fb3[_0x4c3b1f(0x22b)](_0x32225c,_0x2ddb1f),_0x450256[_0x4c3b1f(0x1db)][_0x4c3b1f(0x22b)](_0x32225c,_0x2ddb1f);}if(_0x4cb435[_0x4c3b1f(0x1ee)]===_0x4c3b1f(0x1f7))_0x44dd8f[_0x4c3b1f(0x1ae)]?.({'type':_0x4c3b1f(0x1cb),'name':_0x37643d['yamlConfig'][_0x4c3b1f(0x1e7)],'journeyId':_0x4cb435[_0x4c3b1f(0x208)]}),_0x44dd8f[_0x4c3b1f(0x1dd)]?.(_0x4c3b1f(0x1c6)+_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]+'\x27'),_0x450256[_0x4c3b1f(0x1f7)]++;else _0x4cb435[_0x4c3b1f(0x1ee)]===_0x4c3b1f(0x252)&&(_0x44dd8f[_0x4c3b1f(0x1ae)]?.({'type':'journey_updated','name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]}),_0x44dd8f[_0x4c3b1f(0x1dd)]?.(_0x4c3b1f(0x232)+_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]+'\x27'),_0x450256['updated']++);return{'action':_0x4cb435[_0x4c3b1f(0x1ee)],'name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)],'journeyId':_0x4cb435[_0x4c3b1f(0x208)]};}catch(_0x5f05f7){const _0x46bee0=isHttp400Error(_0x5f05f7),_0x5476fa=_0x46bee0?ErrorCode[_0x4c3b1f(0x218)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x2ab0c8=getErrorMessage(_0x5f05f7);throw new SDKError(_0x5476fa,_0x4c3b1f(0x273)+(_0x37643d[_0x4c3b1f(0x1e0)]?_0x4c3b1f(0x270):_0x4c3b1f(0x203))+_0x4c3b1f(0x262)+_0x37643d[_0x4c3b1f(0x1ed)]+_0x4c3b1f(0x25b)+_0x2ab0c8,_0x5f05f7);}}));_0x450256[_0x362eca(0x1f3)][_0x362eca(0x277)](..._0xfa43f3);}return _0x450256;}async function executeSingleJourneyPush(_0x4dc700,_0x4d803e,_0x4154f8,_0xf7b9ef,_0x12c454,_0x5d4516){const _0x50cc66=a98_0x545ff9,{journeyDefToRequest:_0x4555ff,activationDefToCreateRequest:_0x189100,yamlRuleToApi:_0xec6ccc,validateSegmentRule:_0x152641}=_0x5d4516,_0x16366c=new Map(),_0x325639=new Map(),_0x482da5=new Map(),_0x2b1d33=new Map(),_0x355ca3=new Map();let _0x1a5a97;const _0x2f5440=async()=>{const _0x3a3728=a98_0x1668;if(_0x1a5a97)return;_0x1a5a97=new Map();if(!_0x4d803e[_0x3a3728(0x1ff)])return;const _0x33c222=await _0x4dc700['journey'][_0x3a3728(0x250)](_0x4d803e[_0x3a3728(0x1ff)]['id']);for(const _0x4835a8 of _0x33c222){const _0x39d16d=journeyActivationStepToYaml(_0x4835a8,_0x4154f8[_0x3a3728(0x1e5)],_0x4154f8[_0x3a3728(0x253)]),_0x4b7936=activationSignature(_0x39d16d);!_0x1a5a97[_0x3a3728(0x1f0)](_0x4b7936)&&_0x1a5a97[_0x3a3728(0x22b)](_0x4b7936,_0x4835a8['id']),_0x39d16d[_0x3a3728(0x1e7)]&&_0x325639['set'](_0x39d16d[_0x3a3728(0x1e7)],_0x4835a8['id']);}};if(_0x4d803e[_0x50cc66(0x1ff)]&&_0x4d803e[_0x50cc66(0x265)][_0x50cc66(0x267)]){const _0x8b42f9=buildLocalExpandedRuleMappings(_0x4d803e['yamlConfig']),_0x41512b=_0x8b42f9[_0x50cc66(0x239)];if(_0x41512b['size']>0x0){const _0x5c3f52=new Map();for(const [_0x4fc331,_0x14f965]of _0x41512b){const _0x6ff573=serializeExpandedRule(_0x14f965,_0x41512b);_0x5c3f52[_0x50cc66(0x22b)](_0x4fc331,_0x6ff573);}const _0x20f501=collectSegmentIdsFromJourneyApi(_0x4d803e[_0x50cc66(0x1ff)]);if(_0x20f501['size']>0x0){const _0x393ccc=await buildServerSegmentRuleMap(_0x4dc700,_0xf7b9ef[_0x50cc66(0x231)],_0x4154f8[_0x50cc66(0x24f)],_0x20f501);if(_0x393ccc[_0x50cc66(0x1ac)]>0x0){const _0x1b68f5=new Map();for(const [_0x1bccd7,_0x460993]of _0x393ccc){const _0x1341e0=serializeExpandedRule(_0x460993,_0x393ccc);!_0x1b68f5[_0x50cc66(0x1f0)](_0x1341e0)&&_0x1b68f5[_0x50cc66(0x22b)](_0x1341e0,_0x1bccd7);}for(const [_0x4d4cef,_0x5237f8]of _0x5c3f52){const _0x1ed86a=_0x1b68f5[_0x50cc66(0x1ad)](_0x5237f8);_0x1ed86a&&(_0x355ca3[_0x50cc66(0x22b)](_0x4d4cef,_0x1ed86a),_0x4154f8['segmentNameToId'][_0x50cc66(0x22b)](_0x4d4cef,_0x1ed86a));}}}}}const _0x18743d={'resolveSegmentId':async _0x456f50=>{const _0x1a6018=_0x50cc66,_0x38635d=_0x4154f8[_0x1a6018(0x1ca)][_0x1a6018(0x1ad)](_0x456f50);if(!_0x38635d)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1a6018(0x1bc)+_0x456f50+_0x1a6018(0x1c3)+_0x4d803e[_0x1a6018(0x265)][_0x1a6018(0x1e7)]+')');return _0x38635d;},'resolveEmbeddedSegmentId':async(_0x26f94b,_0x3371a3)=>{const _0x3e641b=_0x50cc66,_0x2757f9=_0x4154f8['segmentNameToId'][_0x3e641b(0x1ad)](_0x26f94b);if(_0x2757f9)return _0x2757f9;const _0x41e09e=_0x355ca3['get'](_0x26f94b);if(_0x41e09e)return _0x4154f8[_0x3e641b(0x1ca)]['set'](_0x26f94b,_0x41e09e),_0x41e09e;const _0x13a71b=_0x4154f8[_0x3e641b(0x24f)][_0x3e641b(0x284)](_0x2c77fb=>_0x2c77fb[_0x3e641b(0x1e7)]===_0x26f94b);if(_0x13a71b)return _0x4154f8['segmentNameToId'][_0x3e641b(0x22b)](_0x26f94b,_0x13a71b['id']),_0x13a71b['id'];if(_0x4d803e[_0x3e641b(0x1e0)]){const {stageName:_0x2df014,criteriaName:_0x235e1c}=findSegmentCriteriaLocation(_0x4d803e[_0x3e641b(0x265)],_0x26f94b);return _0x152641(_0x26f94b,_0x3371a3[_0x3e641b(0x27f)]),_0x482da5[_0x3e641b(0x22b)](_0x26f94b,{'definition':_0x3371a3,'stageName':_0x2df014,'criteriaName':_0x235e1c}),createPendingSegmentId(_0x26f94b);}const _0x2af282=_0x4d803e[_0x3e641b(0x1ff)]?.['id'];if(!_0x2af282)throw new SDKError(ErrorCode[_0x3e641b(0x1b5)],_0x3e641b(0x266));_0x152641(_0x26f94b,_0x3371a3['rule']);const _0x47c6ac=generateDeterministicJourneySegmentName(_0x4d803e[_0x3e641b(0x265)][_0x3e641b(0x1e7)],_0x26f94b),_0x2cf793=_0x4154f8[_0x3e641b(0x24f)][_0x3e641b(0x284)](_0x312e9a=>_0x312e9a[_0x3e641b(0x1e7)]===_0x47c6ac),_0x110baa=createSegmentIdResolver(_0x4154f8['segmentNameToId'],_0x26f94b),_0x30e5d5=await resolveRuleSegmentIds(_0x3371a3[_0x3e641b(0x27f)],_0x110baa);let _0x1021e5;if(_0x2cf793)await _0x4dc700[_0x3e641b(0x1fb)]['updateSegmentById'](_0xf7b9ef[_0x3e641b(0x231)],_0x2cf793['id'],{'description':_0x3371a3[_0x3e641b(0x247)]||_0x3e641b(0x272)+_0x26f94b,'rule':_0xec6ccc(_0x30e5d5,!![]),'countPopulation':!![]}),_0x1021e5=_0x2cf793['id'];else try{_0x1021e5=await _0x4dc700[_0x3e641b(0x1fb)][_0x3e641b(0x1e9)]({'name':_0x47c6ac,'description':_0x3371a3[_0x3e641b(0x247)]||'Entry\x20criteria:\x20'+_0x26f94b,'journeyId':_0x2af282,'rule':_0xec6ccc(_0x30e5d5,!![]),'countPopulation':!![],'parentFolderId':_0xf7b9ef['rootFolderId']||'','audienceId':_0xf7b9ef[_0x3e641b(0x231)]});}catch(_0x8e882b){const _0x4f179c=_0x8e882b instanceof Error&&_0x8e882b[_0x3e641b(0x1b7)][_0x3e641b(0x22a)]('Name\x20has\x20already\x20been\x20taken');if(_0x4f179c){const _0xfd3b68=await _0x4dc700[_0x3e641b(0x1fb)][_0x3e641b(0x1d2)](_0xf7b9ef['parentId']),_0x35051c=_0xfd3b68[_0x3e641b(0x284)](_0x5be499=>_0x5be499[_0x3e641b(0x1e7)]===_0x47c6ac);if(_0x35051c)await _0x4dc700[_0x3e641b(0x1fb)]['updateSegmentById'](_0xf7b9ef[_0x3e641b(0x231)],_0x35051c['id'],{'description':_0x3371a3[_0x3e641b(0x247)]||'Entry\x20criteria:\x20'+_0x26f94b,'rule':_0xec6ccc(_0x30e5d5,!![]),'countPopulation':!![]}),_0x1021e5=_0x35051c['id'];else throw _0x8e882b;}else throw _0x8e882b;}return _0x4154f8['segmentNameToId'][_0x3e641b(0x22b)](_0x26f94b,_0x1021e5),_0x16366c['set'](_0x26f94b,_0x1021e5),_0x1021e5;},'resolveActivationId':async _0x53fe85=>{const _0x3602f4=_0x50cc66,_0x380daa=_0x325639['get'](_0x53fe85);if(_0x380daa)return _0x380daa;if(_0x4d803e[_0x3602f4(0x1ff)]){await _0x2f5440();const _0x21a89e=_0x325639[_0x3602f4(0x1ad)](_0x53fe85);if(_0x21a89e)return _0x21a89e;}throw new SDKError(ErrorCode[_0x3602f4(0x24c)],_0x3602f4(0x279)+_0x53fe85+_0x3602f4(0x1c3)+_0x4d803e[_0x3602f4(0x265)]['name']+_0x3602f4(0x23b)+_0x3602f4(0x1af));},'resolveEmbeddedActivationId':async(_0x334b10,_0x433060)=>{const _0x26040d=_0x50cc66,_0x4c5358=_0x325639[_0x26040d(0x1ad)](_0x334b10);if(_0x4c5358)return _0x4c5358;if(_0x4d803e[_0x26040d(0x1e0)])return _0x2b1d33[_0x26040d(0x22b)](_0x334b10,_0x433060),createPendingActivationId(_0x334b10);if(_0x4d803e['existingJourney']){await _0x2f5440();const _0x529ee7=_0x325639['get'](_0x433060[_0x26040d(0x1e7)]);if(_0x529ee7)return _0x325639[_0x26040d(0x22b)](_0x334b10,_0x529ee7),_0x529ee7;const _0xbd0871=activationSignature(_0x433060),_0x22b745=_0x1a5a97?.['get'](_0xbd0871);if(_0x22b745)return _0x325639[_0x26040d(0x22b)](_0x334b10,_0x22b745),_0x22b745;const _0x37a5c9=await _0x189100(_0x433060,_0x4154f8[_0x26040d(0x1c1)]),_0x4dd77f=await _0x4dc700[_0x26040d(0x212)]['createActivation'](_0x4d803e[_0x26040d(0x1ff)]['id'],_0x37a5c9);return _0x325639[_0x26040d(0x22b)](_0x334b10,_0x4dd77f['id']),_0x4dd77f['id'];}throw new SDKError(ErrorCode[_0x26040d(0x1b5)],_0x26040d(0x20b));},'resolveJourneyId':async _0x9b8e07=>{const _0x51c2c1=_0x50cc66;try{return await _0x4dc700[_0x51c2c1(0x212)][_0x51c2c1(0x1bd)](_0xf7b9ef[_0x51c2c1(0x231)],_0x9b8e07);}catch(_0x4651b9){throw new SDKError(ErrorCode[_0x51c2c1(0x24c)],'Journey\x20\x27'+_0x9b8e07+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x4d803e[_0x51c2c1(0x265)][_0x51c2c1(0x1e7)]+'\x27)',_0x4651b9);}},'resolveStageId':async(_0x8937dc,_0x18261f)=>{const _0x291b34=_0x50cc66,_0x3bcdf3=await _0x4dc700[_0x291b34(0x212)]['getJourney'](_0x8937dc),_0x184b9b=_0x3bcdf3[_0x291b34(0x1b4)][_0x291b34(0x1d6)]['find'](_0xee530c=>_0xee530c[_0x291b34(0x1e7)][_0x291b34(0x1fd)]()===_0x18261f['toLowerCase']());if(!_0x184b9b?.['id'])throw new SDKError(ErrorCode[_0x291b34(0x24c)],_0x291b34(0x240)+_0x18261f+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x3bcdf3['attributes'][_0x291b34(0x274)]||_0x3bcdf3['attributes']['name'])+'\x27');return _0x184b9b['id'];}},_0x19fcb9=await _0x4555ff(_0x4d803e['yamlConfig'],_0xf7b9ef[_0x50cc66(0x231)],_0x18743d),_0x485973=_0xf7b9ef[_0x50cc66(0x257)]||_0xf7b9ef[_0x50cc66(0x256)];_0x485973&&(_0x19fcb9[_0x50cc66(0x280)]={'parentFolder':{'data':{'id':_0x485973,'type':_0x50cc66(0x263)}}});if(_0x4d803e['isNew']){if(_0x482da5[_0x50cc66(0x1ac)]>0x0||_0x2b1d33['size']>0x0)return await executeThreeStepJourneyCreate(_0x4dc700,_0x4d803e,_0x19fcb9,{'pendingEmbeddedSegments':_0x482da5,'pendingEmbeddedActivations':_0x2b1d33,'embeddedSegmentNameToId':_0x16366c,'journeyActivationNameToId':_0x325639},{..._0xf7b9ef,'effectiveFolderId':_0x485973},_0x4154f8,_0x12c454,_0x5d4516);else{ensureJourneyDefaults(_0x19fcb9[_0x50cc66(0x1b4)]);const _0x28b970=await _0x4dc700[_0x50cc66(0x212)]['create'](_0x19fcb9);return{'action':_0x50cc66(0x1f7),'journeyId':_0x28b970['id'],'embeddedSegmentNameToId':_0x16366c};}}else{if(_0x4d803e[_0x50cc66(0x1d4)]&&_0x4d803e['existingJourney'])return ensureJourneyDefaults(_0x19fcb9[_0x50cc66(0x1b4)]),await _0x4dc700[_0x50cc66(0x212)][_0x50cc66(0x203)](_0x4d803e['existingJourney']['id'],_0x19fcb9),{'action':_0x50cc66(0x252),'journeyId':_0x4d803e['existingJourney']['id'],'embeddedSegmentNameToId':_0x16366c};}return{'action':_0x50cc66(0x26a),'journeyId':_0x4d803e['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x16366c};}function findSegmentCriteriaLocation(_0x3b89d9,_0x640b6c){const _0x5b8dbe=a98_0x545ff9,_0x5d0840=_0x3b89d9[_0x5b8dbe(0x1f4)]||_0x3b89d9[_0x5b8dbe(0x207)]?.[0x0]?.['stages']||[];let _0x258e77='entry',_0x4ff962=_0x640b6c;const _0x41bba4=_0x3b89d9['goal']||_0x3b89d9[_0x5b8dbe(0x207)]?.[0x0]?.[_0x5b8dbe(0x1e4)];if(_0x41bba4?.['segment']===_0x640b6c)return{'stageName':_0x5b8dbe(0x1e4),'criteriaName':_0x41bba4[_0x5b8dbe(0x1e7)]||_0x640b6c};_0x485a27:for(const _0x289101 of _0x5d0840){if(_0x289101[_0x5b8dbe(0x211)]?.[_0x5b8dbe(0x1fb)]===_0x640b6c){_0x258e77=_0x289101['name'],_0x4ff962=_0x289101['entry_criteria'][_0x5b8dbe(0x1e7)]||_0x640b6c;break;}if(_0x289101[_0x5b8dbe(0x258)])for(const _0x5dc7b0 of _0x289101[_0x5b8dbe(0x258)]){if(_0x5dc7b0['type']===_0x5b8dbe(0x1d3)&&_0x5dc7b0[_0x5b8dbe(0x288)]?.['branches'])for(const _0x1c2e25 of _0x5dc7b0['with']['branches']){if(_0x1c2e25[_0x5b8dbe(0x1fb)]===_0x640b6c){_0x258e77=_0x289101[_0x5b8dbe(0x1e7)],_0x4ff962=_0x1c2e25[_0x5b8dbe(0x1e7)]||_0x640b6c;break _0x485a27;}}}}return{'stageName':_0x258e77,'criteriaName':_0x4ff962};}async function executeThreeStepJourneyCreate(_0x2a6d9e,_0xf9109,_0x53458f,_0x2b815c,_0x494dd4,_0x853d14,_0x55c907,_0x37e882){const _0x579343=a98_0x545ff9,{activationDefToCreateRequest:_0x2c33f2,yamlRuleToApi:_0x83b3be}=_0x37e882,{pendingEmbeddedSegments:_0x4519e2,pendingEmbeddedActivations:_0x5e3711,embeddedSegmentNameToId:_0x2cacca}=_0x2b815c,_0x254034=JSON['parse'](JSON['stringify'](_0x53458f));ensureJourneyDefaults(_0x254034['attributes']),stripPendingIds(_0x254034);const _0x14e589=await _0x2a6d9e['journey']['create'](_0x254034),_0x1a484e=_0x14e589['id'],_0x5119ba=new Map();for(const _0x58bfe8 of _0x14e589[_0x579343(0x1b4)]['journeyStages']){_0x5119ba[_0x579343(0x22b)](_0x58bfe8[_0x579343(0x1e7)][_0x579343(0x1fd)](),_0x58bfe8['id']);}for(const [_0x20cc5d,{definition:_0x10ad78}]of _0x4519e2){const _0x33935b=generateDeterministicJourneySegmentName(_0xf9109[_0x579343(0x265)]['name'],_0x20cc5d);_0x55c907[_0x579343(0x1ae)]?.({'type':_0x579343(0x204),'journeyName':_0xf9109[_0x579343(0x265)]['name'],'segmentName':_0x20cc5d});const _0x532ec0=createSegmentIdResolver(_0x853d14[_0x579343(0x1ca)],_0x20cc5d),_0x349ca1=await resolveRuleSegmentIds(_0x10ad78[_0x579343(0x27f)],_0x532ec0),_0x5d2cbf=await _0x2a6d9e['segment'][_0x579343(0x1e9)]({'name':_0x33935b,'description':_0x10ad78[_0x579343(0x247)]||_0x579343(0x272)+_0x20cc5d,'journeyId':_0x1a484e,'rule':_0x83b3be(_0x349ca1,!![]),'countPopulation':!![],'parentFolderId':_0x494dd4['effectiveFolderId']||'','audienceId':_0x494dd4['parentId']});_0x2cacca[_0x579343(0x22b)](_0x20cc5d,_0x5d2cbf),_0x853d14[_0x579343(0x1ca)][_0x579343(0x22b)](_0x20cc5d,_0x5d2cbf),_0x55c907[_0x579343(0x1ae)]?.({'type':'embedded_segment_created','journeyName':_0xf9109[_0x579343(0x265)][_0x579343(0x1e7)],'segmentName':_0x20cc5d});}const _0x58e004=new Map();for(const [_0x4d8100,_0x243562]of _0x5e3711){_0x55c907['onProgress']?.({'type':_0x579343(0x1fe),'journeyName':_0xf9109[_0x579343(0x265)][_0x579343(0x1e7)],'activationName':_0x4d8100});const _0x4fe0e1=await _0x2c33f2(_0x243562,_0x853d14[_0x579343(0x1c1)]),_0x5be152=await _0x2a6d9e['journey'][_0x579343(0x24b)](_0x1a484e,_0x4fe0e1);_0x58e004[_0x579343(0x22b)](_0x4d8100,_0x5be152['id']),_0x2b815c[_0x579343(0x206)][_0x579343(0x22b)](_0x4d8100,_0x5be152['id']),_0x55c907[_0x579343(0x1ae)]?.({'type':_0x579343(0x1cd),'journeyName':_0xf9109[_0x579343(0x265)][_0x579343(0x1e7)],'activationName':_0x4d8100});}const _0x599f96=JSON[_0x579343(0x255)](JSON[_0x579343(0x1b9)](_0x53458f));return _0x599f96['id']=_0x1a484e,ensureJourneyDefaults(_0x599f96[_0x579343(0x1b4)]),resolvePendingIdsInRequest(_0x599f96,_0x53458f,_0x5119ba,_0x2cacca,_0x58e004,_0x55c907),await _0x2a6d9e['journey'][_0x579343(0x203)](_0x1a484e,_0x599f96),{'action':_0x579343(0x1f7),'journeyId':_0x1a484e,'embeddedSegmentNameToId':_0x2cacca};}function stripPendingIds(_0x43e81b){const _0x21e4b7=a98_0x545ff9;for(const _0x4a499f of _0x43e81b[_0x21e4b7(0x1b4)][_0x21e4b7(0x1d6)]||[]){_0x4a499f['entryCriteria']?.[_0x21e4b7(0x1dc)]&&isPendingSegmentId(_0x4a499f[_0x21e4b7(0x1f1)]['segmentId'])&&delete _0x4a499f[_0x21e4b7(0x1f1)];if(_0x4a499f['steps'])for(const _0x4102dd of Object[_0x21e4b7(0x228)](_0x4a499f['steps'])){const _0x2f8f9f=_0x4a499f[_0x21e4b7(0x258)][_0x4102dd];_0x2f8f9f[_0x21e4b7(0x1ef)]==='Activation'&&_0x2f8f9f[_0x21e4b7(0x222)]&&isPendingActivationId(_0x2f8f9f['journeyActivationStepId'])&&(_0x2f8f9f[_0x21e4b7(0x222)]='');if(_0x2f8f9f[_0x21e4b7(0x1ef)]===_0x21e4b7(0x1de)&&_0x2f8f9f['branches'])for(const _0x4dfce0 of _0x2f8f9f['branches']){_0x4dfce0['segmentId']&&isPendingSegmentId(_0x4dfce0[_0x21e4b7(0x1dc)])&&(_0x4dfce0[_0x21e4b7(0x1dc)]='');}_0x2f8f9f[_0x21e4b7(0x1ef)]===_0x21e4b7(0x28b)&&_0x2f8f9f['waitCondition']?.[_0x21e4b7(0x1dc)]&&isPendingSegmentId(_0x2f8f9f['waitCondition'][_0x21e4b7(0x1dc)])&&(_0x2f8f9f[_0x21e4b7(0x243)][_0x21e4b7(0x1dc)]='');}}}function resolvePendingIdsInRequest(_0x144dc5,_0xcfc61,_0x101fa9,_0x3cce76,_0x18938d,_0x40764e){const _0x314451=a98_0x545ff9,_0x437160=(_0x51dc05,_0x939822)=>{const _0x4f121a=a98_0x1668;if(!isPendingSegmentId(_0x51dc05))return _0x51dc05;const _0x2d38cc=extractPendingSegmentName(_0x51dc05),_0x17218a=_0x3cce76['get'](_0x2d38cc);return!_0x17218a&&_0x40764e['logWarning']?.(_0x4f121a(0x210)+_0x2d38cc+_0x4f121a(0x275)+_0x939822),_0x17218a;};if(_0x144dc5[_0x314451(0x1b4)]['goal']?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x144dc5[_0x314451(0x1b4)][_0x314451(0x1e4)]['segmentId'])){const _0x3e922c=_0x437160(_0x144dc5[_0x314451(0x1b4)][_0x314451(0x1e4)][_0x314451(0x1dc)],'goal\x20criteria');_0x3e922c&&(_0x144dc5[_0x314451(0x1b4)]['goal'][_0x314451(0x1dc)]=_0x3e922c);}for(const _0x570f7d of _0x144dc5[_0x314451(0x1b4)]['journeyStages']||[]){const _0x13325c=_0x101fa9[_0x314451(0x1ad)](_0x570f7d[_0x314451(0x1e7)][_0x314451(0x1fd)]());_0x13325c&&(_0x570f7d['id']=_0x13325c);if(_0x570f7d[_0x314451(0x1f1)]?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x570f7d['entryCriteria'][_0x314451(0x1dc)])){const _0x9940d7=_0x437160(_0x570f7d['entryCriteria']['segmentId'],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x20f));_0x9940d7&&(_0x570f7d[_0x314451(0x1f1)][_0x314451(0x1dc)]=_0x9940d7);}if(_0x570f7d[_0x314451(0x21e)])for(const _0x32d488 of _0x570f7d[_0x314451(0x21e)]){if(_0x32d488[_0x314451(0x1dc)]&&isPendingSegmentId(_0x32d488[_0x314451(0x1dc)])){const _0xa29267=_0x437160(_0x32d488[_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d['name']+_0x314451(0x259));_0xa29267&&(_0x32d488['segmentId']=_0xa29267);}}if(_0x570f7d['milestone']?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x570f7d[_0x314451(0x23f)]['segmentId'])){const _0x4fa705=_0x437160(_0x570f7d['milestone'][_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x1ab));_0x4fa705&&(_0x570f7d[_0x314451(0x23f)][_0x314451(0x1dc)]=_0x4fa705);}if(_0x570f7d[_0x314451(0x258)]){const _0x2e82b6=_0x304c7f=>_0xcfc61[_0x314451(0x1b4)][_0x314451(0x1d6)][_0x314451(0x284)](_0x464ada=>_0x464ada[_0x314451(0x1e7)][_0x314451(0x1fd)]()===_0x570f7d[_0x314451(0x1e7)]['toLowerCase']())?.[_0x314451(0x258)]?.[_0x304c7f];for(const _0x4b273b of Object[_0x314451(0x228)](_0x570f7d['steps'])){const _0x3f79ac=_0x570f7d['steps'][_0x4b273b],_0x5494ff=_0x2e82b6(_0x4b273b);if(_0x3f79ac['type']===_0x314451(0x1fc)&&_0x3f79ac[_0x314451(0x222)]&&(isPendingActivationId(_0x3f79ac[_0x314451(0x222)])||_0x3f79ac[_0x314451(0x222)]==='')){if(_0x5494ff?.['journeyActivationStepId']&&isPendingActivationId(_0x5494ff['journeyActivationStepId'])){const _0x5e16ec=extractPendingActivationName(_0x5494ff[_0x314451(0x222)]),_0xb33432=_0x18938d[_0x314451(0x1ad)](_0x5e16ec);_0xb33432&&(_0x3f79ac[_0x314451(0x222)]=_0xb33432);}}if(_0x3f79ac[_0x314451(0x1ef)]===_0x314451(0x1de)&&_0x3f79ac[_0x314451(0x283)]&&_0x5494ff?.[_0x314451(0x283)])for(let _0x95f5d5=0x0;_0x95f5d5<_0x3f79ac[_0x314451(0x283)][_0x314451(0x226)];_0x95f5d5++){const _0x230a89=_0x3f79ac[_0x314451(0x283)][_0x95f5d5],_0x3c6506=_0x5494ff[_0x314451(0x283)][_0x95f5d5];if(_0x3c6506?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x3c6506[_0x314451(0x1dc)])){const _0x2524b2=_0x437160(_0x3c6506[_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x26c)+(_0x230a89['name']||_0x95f5d5)+'\x27');_0x2524b2&&(_0x230a89[_0x314451(0x1dc)]=_0x2524b2);}}if(_0x3f79ac[_0x314451(0x1ef)]===_0x314451(0x28b)&&_0x3f79ac[_0x314451(0x243)]?.[_0x314451(0x1dc)]&&_0x5494ff?.[_0x314451(0x243)]?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x5494ff[_0x314451(0x243)][_0x314451(0x1dc)])){const _0x189833=_0x437160(_0x5494ff[_0x314451(0x243)][_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x23a));_0x189833&&(_0x3f79ac[_0x314451(0x243)]['segmentId']=_0x189833);}}}}}
1
+ const a100_0x25feef=a100_0x386c;(function(_0x22a4b7,_0x46a1e5){const _0x19cce8=a100_0x386c,_0x497656=_0x22a4b7();while(!![]){try{const _0x7ee3e3=-parseInt(_0x19cce8(0x1c6))/0x1+-parseInt(_0x19cce8(0x18f))/0x2+parseInt(_0x19cce8(0x1b4))/0x3*(parseInt(_0x19cce8(0x199))/0x4)+parseInt(_0x19cce8(0xfb))/0x5+parseInt(_0x19cce8(0x17a))/0x6*(-parseInt(_0x19cce8(0x192))/0x7)+parseInt(_0x19cce8(0x130))/0x8+parseInt(_0x19cce8(0x13d))/0x9*(parseInt(_0x19cce8(0x164))/0xa);if(_0x7ee3e3===_0x46a1e5)break;else _0x497656['push'](_0x497656['shift']());}catch(_0x2426e3){_0x497656['push'](_0x497656['shift']());}}}(a100_0x4dc7,0x92e5d));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a100_0x25feef(0x189);export const PENDING_ACTIVATION_PREFIX=a100_0x25feef(0x1c5);export function createPendingSegmentId(_0x463766){return''+PENDING_SEGMENT_PREFIX+_0x463766+'__';}export function isPendingSegmentId(_0x2fc4e7){return _0x2fc4e7['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x276644){return _0x276644['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x195359){return''+PENDING_ACTIVATION_PREFIX+_0x195359+'__';}export function isPendingActivationId(_0x595b58){const _0x555455=a100_0x25feef;return _0x595b58[_0x555455(0x1bb)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x2e6133){const _0x46f2cc=a100_0x25feef;return _0x2e6133[_0x46f2cc(0x1ac)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x1daae3,_0x5f08a9){const _0x2cdee3=a100_0x25feef,_0x53491e=_0x1daae3+'::'+(_0x5f08a9[_0x2cdee3(0x14a)]()||_0x2cdee3(0x15d)),_0x4481aa=createHash(_0x2cdee3(0x1c3))[_0x2cdee3(0x10a)](_0x53491e)['digest'](_0x2cdee3(0x142))['slice'](0x0,0xc);return _0x2cdee3(0x1c0)+_0x4481aa;}export function ensureJourneyDefaults(_0x5e910e){const _0x5162ef=a100_0x25feef;!_0x5e910e['description']&&(_0x5e910e[_0x5162ef(0x114)]=''),!_0x5e910e[_0x5162ef(0x158)]&&(_0x5e910e['state']=_0x5162ef(0x1d1));}export function resolveTDFolderPath(_0x17e495,_0x458e8d,_0x38a48e){const _0x13d878=a100_0x25feef;if(!_0x458e8d)return _0x17e495;if(_0x17e495===_0x38a48e||_0x17e495[_0x13d878(0x1bb)](_0x38a48e+'/'))return _0x17e495;return _0x17e495?_0x38a48e+'/'+_0x17e495:_0x38a48e;}export function addFoldersToCreate(_0x1adbff,_0x56995e,_0x4d0562){const _0x11c41b=a100_0x25feef;if(!_0x1adbff)return;if(_0x56995e[_0x11c41b(0x16a)](_0x1adbff))return;const _0x53a48c=_0x1adbff[_0x11c41b(0x162)]('/');let _0x13ff3a='';for(const _0x3beb49 of _0x53a48c){_0x13ff3a=_0x13ff3a?_0x13ff3a+'/'+_0x3beb49:_0x3beb49,!_0x56995e[_0x11c41b(0x16a)](_0x13ff3a)&&_0x4d0562[_0x11c41b(0x132)](_0x13ff3a);}}function a100_0x4dc7(){const _0x3093fa=['getJourney','171940QvBpDU','waitCondition','\x27\x20for\x20','getActivation','idToEmailMap','Updating\x20segment\x20\x27','has','null','activation_updated','folder','existingSegment','activation_updating','flatMap','valid','SEGMENT_UPDATE_ERROR','NOT_FOUND','Activation','folder_created','type','slice','\x27...','versionNumber','12UYSKoM','entry_criteria','DecisionPoint','hasChanges','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','updateSegmentById','Entry\x20criteria:\x20','existingJourney','journey','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','toLowerCase','activation_deleting','Deleted\x20activation\x20\x27','relationships','yamlConfig','__pending_','listSegments','columns','getSegment','embedded_activation_creating','connection','775658MLbCAq','Created\x20folder\x20\x27','nameToType','2611966RTmKkj','journeyStages','logInfo','segment_deleted','entries','segments','decision_point','100396UDhpzz','activation_','behavior','goal','push','localSegmentRules','progress','createSegment','withProgress','fetchJourney','exitCriterias','activationContext','idToName','branches','effectiveFolderId','diff','Activation\x20not\x20found:\x20','activation_template_id','all_columns','replace','existingActivation','\x20activation\x20\x27','createFolder','buildUserMaps','all','activation_deleted','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','21JFBjyH','createdSegmentIds','validatedRequest','rule','deps','folderPathToId','Name\x20has\x20already\x20been\x20taken','startsWith','entryCriteria','journeyId','created','connectionIdToNameMap','journey_entry_criteria_','milestone','activationStepsById','sha1','segmentByFolderAndName','__pending_act_','408934pEoUta','with','Created\x20journey\x20\x27','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','isNew','\x0a\x20\x20','stages','journeys','filter','segmentNameToId','find','draft','JOURNEY_UPDATE_ERROR','keys','journey_updating','kind','data','JOURNEY_SYNTAX_ERROR','activation_creating','journey_updated','segment_created','1058785XxPhCH','values','Fetching\x20','Creating\x20activation\x20\x27','dirname','reduce','folderPath','segment_updated','delete','deleteSegment','Journey\x20\x27','notification','relative','steps','list','update','index','get','folder_creating','journeyActivationNameToId','segment_creating','unchanged','ACTIVATION_UPDATE_ERROR','createdSegmentId','schedule','description','sort','\x27\x20decision\x20point\x20branch\x20\x27','object','segment_updating','utf-8','Updated\x20activation\x20\x27','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','INTERNAL','WaitStep','length','activations','action','errors','):\x20','segment_deleting','activation_created','createActivation','skipSegments','\x27\x20exit\x20criteria','updated','logSuccess','includes','\x20error(s)','updateActivation','existingSegments','join','6768000fYkJAd','Creating\x20segment\x20\x27','add','../../utils/async.js','createJourneySegment','./journey-yaml.js','create','Failed\x20to\x20','item','size','max','absolutePath','\x27\x20wait\x20condition','477fyzDuO','parse','journeyById','parentFolder','logDeleted','hex','stage\x20\x27','attributes','segmentId','journeyActivationStepId','segmentFolderId','resolveJourneyId','\x20(referenced\x20in\x20journey\x20','trim','ACTIVATION_SYNTAX_ERROR','deleted','map','journeyBundleName','name','from','\x27\x20not\x20found\x20in\x20journey\x20\x27','onProgress','deleteActivation','Deleted\x20segment\x20\x27','parentId','folderId','\x20segment\x20from\x20file:\x20','state','set','yamlActivation','Updated\x20journey\x20\x27','SEGMENT_NOT_FOUND','segment','Created\x20segment\x20\x27','embeddedSegmentNameToId','stringify','./child-segment-yaml.js','split'];a100_0x4dc7=function(){return _0x3093fa;};return a100_0x4dc7();}import*as a100_0x226117 from'yaml';import{readFileSync}from'fs';import a100_0x4cc6a1 from'path';import{isJourneyDef,parseYamlString as a100_0x54e692,toYamlString as a100_0x3a64c3,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 a100_0x386c(_0x3a574f,_0x5d35d2){_0x3a574f=_0x3a574f-0xf2;const _0x4dc740=a100_0x4dc7();let _0x386c82=_0x4dc740[_0x3a574f];return _0x386c82;}function stableStringify(_0x53ea2d){const _0x607793=a100_0x25feef;if(Array['isArray'](_0x53ea2d))return'['+_0x53ea2d[_0x607793(0x14d)](_0x427ceb=>stableStringify(_0x427ceb))[_0x607793(0x12f)](',')+']';if(_0x53ea2d&&typeof _0x53ea2d===_0x607793(0x117)){const _0x49ad58=_0x53ea2d,_0x84f5b3=Object[_0x607793(0xf3)](_0x49ad58)['sort'](),_0x454b33=_0x84f5b3[_0x607793(0x14d)](_0xc09907=>'\x22'+_0xc09907+'\x22:'+stableStringify(_0x49ad58[_0xc09907]));return'{'+_0x454b33['join'](',')+'}';}const _0x4b06aa=JSON[_0x607793(0x160)](_0x53ea2d);return _0x4b06aa===undefined?_0x607793(0x16b):_0x4b06aa;}function activationSignature(_0xc68326){const _0x7db68e=a100_0x25feef,_0x15b19c={'connection':_0xc68326[_0x7db68e(0x18e)],..._0xc68326[_0x7db68e(0x1ab)]!==undefined&&{'all_columns':_0xc68326[_0x7db68e(0x1ab)]},..._0xc68326[_0x7db68e(0x18b)]!==undefined&&{'columns':_0xc68326[_0x7db68e(0x18b)]},..._0xc68326[_0x7db68e(0x19b)]!==undefined&&{'behavior':_0xc68326[_0x7db68e(0x19b)]},..._0xc68326[_0x7db68e(0x113)]!==undefined&&{'schedule':_0xc68326['schedule']},..._0xc68326['notification']!==undefined&&{'notification':_0xc68326[_0x7db68e(0x106)]},..._0xc68326['connector_config']!==undefined&&{'connector_config':_0xc68326['connector_config']},..._0xc68326[_0x7db68e(0x1aa)]!==undefined&&{'activation_template_id':_0xc68326[_0x7db68e(0x1aa)]}};return stableStringify(_0x15b19c);}export async function prepareSegmentFiles(_0x565e7d,_0x243453,_0x958042,_0x35c742,_0x37195f){const _0x360f04=a100_0x25feef,{activationDefToCreateRequest:_0x590795}=await import(_0x360f04(0x161)),_0x119450=[],_0x4eed78=new Set();for(const {yamlConfig:_0x1c9fcf,folderPath:_0xab9427,sourcePath:_0x1124dc}of _0x565e7d){const _0x4c0072=resolveTDFolderPath(_0xab9427,_0x35c742,_0x37195f),_0x3cf690=_0x4c0072+':'+_0x1c9fcf[_0x360f04(0x14f)],_0x3af6f2=_0x243453[_0x360f04(0x1c4)]['get'](_0x3cf690),_0xd874e0=_0x3af6f2?_0x243453['activationsBySegmentId']['get'](_0x3af6f2['id'])||[]:[];addFoldersToCreate(_0x4c0072,_0x243453[_0x360f04(0x1b9)],_0x4eed78);const _0x4f4361=calculateActivationActions(_0x1c9fcf[_0x360f04(0x120)]||[],_0xd874e0,_0x243453[_0x360f04(0x168)],_0x243453[_0x360f04(0x1bf)]);for(const _0x2f81b9 of _0x4f4361){(_0x2f81b9[_0x360f04(0x176)]===_0x360f04(0x136)||_0x2f81b9['type']==='update')&&_0x2f81b9[_0x360f04(0x15a)]&&(_0x2f81b9[_0x360f04(0x1b6)]=await _0x590795(_0x2f81b9[_0x360f04(0x15a)],_0x958042));}const _0x2be191=calculateSegmentDiff(_0x1c9fcf,_0x3af6f2,_0xd874e0,_0x243453[_0x360f04(0x168)],_0x243453[_0x360f04(0x1bf)]);_0x119450[_0x360f04(0x19d)]({'relativePath':_0x1c9fcf[_0x360f04(0x14f)],'absolutePath':_0x1124dc,'yamlConfig':_0x1c9fcf,'folderPath':_0x4c0072,'existingSegment':_0x3af6f2,'existingActivations':_0xd874e0,'isNew':_0x2be191[_0x360f04(0x1ca)],'hasChanges':_0x2be191[_0x360f04(0x17d)],'diff':_0x2be191['diff'],'activationActions':_0x4f4361});}return{'segmentFiles':_0x119450,'foldersToCreate':_0x4eed78};}export async function prepareJourneyFiles(_0x570d78,_0x1052fd,_0x310958,_0x4d0321){const _0x8bc3e8=a100_0x25feef,_0x40b4b1=[],_0x590deb=new Set();for(const {yamlConfig:_0x5834ff,folderPath:_0x530eeb,sourcePath:_0x3e52ed}of _0x570d78){const _0x3bb115=resolveTDFolderPath(_0x530eeb,_0x310958,_0x4d0321),_0x35a1d4=_0x3bb115+':'+_0x5834ff[_0x8bc3e8(0x14f)],_0x3969f1=_0x1052fd['journeyBundlesByFolderAndName'][_0x8bc3e8(0x10c)](_0x35a1d4);let _0x2a4591,_0x406b94;if(_0x3969f1&&_0x3969f1[_0x8bc3e8(0x11f)]>0x0){const _0x1e76b9=buildLocalExpandedRuleMappings(_0x5834ff),{createYamlContext:_0x29ce12,prefetchJourneySegments:_0x197019}=createPushYamlContextForBundle(_0x1052fd[_0x8bc3e8(0x1b8)],_0x1052fd[_0x8bc3e8(0x155)],_0x1052fd['existingSegments'],_0x1e76b9,_0x1052fd[_0x8bc3e8(0x168)],_0x1052fd[_0x8bc3e8(0x1bf)],_0x1052fd[_0x8bc3e8(0x1c2)],_0x1052fd[_0x8bc3e8(0x13f)]);await _0x197019(_0x3969f1[_0x8bc3e8(0x14d)](_0x446ef8=>_0x446ef8['id']));const _0x2895ab=hasMultipleVersions(_0x5834ff),_0xff17a7=async _0x321016=>{const _0x534b41=_0x8bc3e8,_0x5ef366=_0x1052fd[_0x534b41(0x13f)]?.[_0x534b41(0x10c)](_0x321016);if(_0x5ef366)return _0x5ef366;return _0x1052fd[_0x534b41(0x1a2)]({'journeyId':_0x321016,'journeyName':_0x5834ff[_0x534b41(0x14f)],'isMultiVersion':_0x3969f1['length']>0x1});};if(_0x2895ab&&_0x3969f1['length']>0x1){const _0x52651c=[];for(const _0x2c3010 of _0x3969f1){const _0x5e841d=_0x2c3010[_0x8bc3e8(0x179)]||0x1;_0x1052fd['progress']?.[_0x8bc3e8(0x10a)](_0x8bc3e8(0xfd)+_0x5834ff[_0x8bc3e8(0x14f)]+'\x20v'+_0x5e841d);const _0x375ff2=await _0xff17a7(_0x2c3010['id']),_0x5b263f=_0x29ce12(_0x2c3010['id']),_0x48d507=await journeyResponseToDef(_0x375ff2,_0x5b263f);_0x52651c[_0x8bc3e8(0x19d)]({'item':_0x2c3010,'yaml':_0x48d507});}const _0x58f8df=buildLocalRuleToNameMappingFromJourney(_0x5834ff);_0x406b94=buildMergedJourneyDef(_0x52651c,_0x58f8df);const _0x38fb58=Math['max'](..._0x52651c[_0x8bc3e8(0x14d)](_0x3afdb7=>_0x3afdb7[_0x8bc3e8(0x138)]['versionNumber']||0x0)),_0x45ce53=_0x3969f1[_0x8bc3e8(0x1d0)](_0x531a8d=>(_0x531a8d[_0x8bc3e8(0x179)]||0x0)===_0x38fb58);_0x45ce53&&(_0x1052fd[_0x8bc3e8(0x19f)]?.[_0x8bc3e8(0x10a)]('Fetching\x20'+_0x5834ff['name']+'\x20v'+_0x38fb58),_0x2a4591=await _0xff17a7(_0x45ce53['id']));}else{const _0x28b4ce=_0x3969f1[_0x3969f1[_0x8bc3e8(0x11f)]-0x1];_0x1052fd[_0x8bc3e8(0x19f)]?.[_0x8bc3e8(0x10a)]('Fetching\x20'+_0x5834ff[_0x8bc3e8(0x14f)]),_0x2a4591=await _0xff17a7(_0x28b4ce['id']);const _0x3f99cf=_0x29ce12(_0x28b4ce['id']),_0x2f0d01=await journeyResponseToDef(_0x2a4591,_0x3f99cf),_0x2f98f8=buildLocalRuleToNameMappingFromJourney(_0x5834ff);_0x406b94=buildMergedJourneyDef([{'item':_0x28b4ce,'yaml':_0x2f0d01}],_0x2f98f8);}}addFoldersToCreate(_0x3bb115,_0x1052fd[_0x8bc3e8(0x1b9)],_0x590deb);const _0x518b35=calculateJourneyDiff(_0x5834ff,_0x406b94);_0x40b4b1[_0x8bc3e8(0x19d)]({'relativePath':_0x5834ff[_0x8bc3e8(0x14f)],'absolutePath':_0x3e52ed,'yamlConfig':_0x5834ff,'folderPath':_0x3bb115,'existingJourney':_0x2a4591,'isNew':_0x518b35[_0x8bc3e8(0x1ca)],'hasChanges':_0x518b35[_0x8bc3e8(0x17d)],'diff':_0x518b35[_0x8bc3e8(0x1a8)]});}return{'journeyFiles':_0x40b4b1,'foldersToCreate':_0x590deb};}export function calculateActivationActions(_0x111326,_0x50ec3f,_0x2b4628,_0x3f943e){const _0x3072bd=a100_0x25feef,_0x221470=[],_0x219336=new Map();for(const _0xeb4d89 of _0x50ec3f){_0x219336[_0x3072bd(0x159)](_0xeb4d89[_0x3072bd(0x14f)],_0xeb4d89);}const _0x501a42=new Map();for(const _0x2753f3 of _0x111326){_0x501a42[_0x3072bd(0x159)](_0x2753f3[_0x3072bd(0x14f)],_0x2753f3);}for(const _0xb08ec of _0x111326){const _0x4d37e8=_0x219336[_0x3072bd(0x10c)](_0xb08ec['name']);if(!_0x4d37e8)_0x221470[_0x3072bd(0x19d)]({'type':_0x3072bd(0x136),'name':_0xb08ec[_0x3072bd(0x14f)],'yamlActivation':_0xb08ec});else{const _0x262c6a=activationResponseToDef(_0x4d37e8,_0x2b4628,_0x3f943e),_0x23e3e3=a100_0x226117[_0x3072bd(0x160)](_0x262c6a),_0xa41d18=a100_0x226117[_0x3072bd(0x160)](_0xb08ec);_0x23e3e3!==_0xa41d18&&_0x221470[_0x3072bd(0x19d)]({'type':'update','name':_0xb08ec[_0x3072bd(0x14f)],'yamlActivation':_0xb08ec,'existingActivation':_0x4d37e8});}}for(const _0x42a5d7 of _0x50ec3f){!_0x501a42[_0x3072bd(0x16a)](_0x42a5d7[_0x3072bd(0x14f)])&&_0x221470[_0x3072bd(0x19d)]({'type':'delete','name':_0x42a5d7[_0x3072bd(0x14f)],'existingActivation':_0x42a5d7});}return _0x221470;}export function calculateSegmentDiff(_0x48b2bc,_0x85908b,_0x1043d6,_0x3160bd,_0x3bbbc2){const _0x34d2b0=segmentToYamlString(_0x48b2bc);if(_0x85908b){const _0x209c04=segmentWithActivationsToYaml(_0x85908b,_0x1043d6,undefined,_0x3160bd,_0x3bbbc2),_0x21295d=segmentToYamlString(_0x209c04),_0x30e86f=generateDiff(_0x21295d,_0x34d2b0),_0x1aad55=hasChanges(_0x30e86f);return{'isNew':![],'hasChanges':_0x1aad55,'diff':_0x1aad55?formatDiffWithColors(_0x30e86f):undefined};}const _0x1884e9=generateDiff('',_0x34d2b0);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1884e9)};}export function calculateJourneyDiff(_0x217d49,_0xe74366){const _0x408cc1=normalizeJourneyDef(_0x217d49,_0x217d49),_0x4075b6=a100_0x3a64c3(_0x408cc1);if(_0xe74366){const _0x1c8b14=normalizeJourneyDef(_0xe74366,_0x217d49),_0x58baaa=a100_0x3a64c3(_0x1c8b14),_0x1b9e7d=generateDiff(_0x58baaa,_0x4075b6),_0x527ebd=hasChanges(_0x1b9e7d);return{'isNew':![],'hasChanges':_0x527ebd,'diff':_0x527ebd?formatDiffWithColors(_0x1b9e7d):undefined};}const _0x3a827a=generateDiff('',_0x4075b6);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3a827a)};}export function findSegmentsToDelete(_0x9a3183,_0x13e86d,_0x3cf85d,_0x386633,_0x21f14d){const _0x282703=a100_0x25feef,_0x40e5f4=new Set();for(const {yamlConfig:_0x1fa284,folderPath:_0xf6cb32}of _0x13e86d){_0x40e5f4[_0x282703(0x132)](_0xf6cb32+':'+_0x1fa284[_0x282703(0x14f)]);}return _0x9a3183[_0x282703(0x1ce)](_0x2f1af2=>{const _0x300dbc=_0x282703,_0x2fcfaa=_0x2f1af2['segmentFolderId']?_0x3cf85d[_0x300dbc(0x10c)](_0x2f1af2[_0x300dbc(0x147)]['toString']())||'':'',_0x4c6d05=_0x2fcfaa+':'+_0x2f1af2[_0x300dbc(0x14f)];if(_0x40e5f4['has'](_0x4c6d05))return![];if(_0x21f14d)return _0x2fcfaa===_0x386633||_0x2fcfaa[_0x300dbc(0x1bb)](_0x386633+'/');return!![];});}export function findJourneysToDelete(_0x213412,_0x44023b,_0x5065c1,_0x47f03e,_0x336ca9){const _0x36e731=a100_0x25feef,_0x5a8505=new Set();for(const {yamlConfig:_0x573c0b,folderPath:_0x58990f}of _0x44023b){_0x5a8505[_0x36e731(0x132)](_0x58990f+':'+_0x573c0b['name']);}return _0x213412['filter'](_0x2f70ee=>{const _0x583494=_0x36e731,_0x3c59bf=_0x2f70ee[_0x583494(0x156)]?_0x5065c1['get'](_0x2f70ee[_0x583494(0x156)])||'':'',_0x2f2f64=_0x3c59bf+':'+_0x2f70ee[_0x583494(0x14e)];if(_0x5a8505[_0x583494(0x16a)](_0x2f2f64))return![];if(_0x336ca9)return _0x3c59bf===_0x47f03e||_0x3c59bf['startsWith'](_0x47f03e+'/');return!![];});}export function buildSegmentLookupMap(_0x1e8f68,_0x4d8179){const _0x514713=a100_0x25feef,_0x2f7b18=new Map();for(const _0x25c1f4 of _0x1e8f68){const _0x343f65=_0x25c1f4[_0x514713(0x147)]?_0x4d8179['get'](_0x25c1f4[_0x514713(0x147)]['toString']())||'':'',_0x1c4c7a=_0x343f65+':'+_0x25c1f4['name'];_0x2f7b18[_0x514713(0x159)](_0x1c4c7a,_0x25c1f4);}return _0x2f7b18;}export function buildSegmentNameToIdMap(_0x18cda8){const _0x185073=a100_0x25feef,_0x3f25af=new Map();for(const _0x282b93 of _0x18cda8){_0x3f25af[_0x185073(0x159)](_0x282b93[_0x185073(0x14f)],_0x282b93['id']);}return _0x3f25af;}export function buildJourneyBundleLookupMap(_0x5d2e21,_0x22fb90){const _0x13a754=a100_0x25feef,_0x4e1d29=new Map();for(const _0x5aee1f of _0x5d2e21){const _0x30fe9b=_0x5aee1f[_0x13a754(0x156)]?_0x22fb90[_0x13a754(0x10c)](_0x5aee1f['folderId'])||'':'',_0x533376=_0x30fe9b+':'+_0x5aee1f['journeyBundleName'];!_0x4e1d29['has'](_0x533376)&&_0x4e1d29[_0x13a754(0x159)](_0x533376,[]),_0x4e1d29[_0x13a754(0x10c)](_0x533376)[_0x13a754(0x19d)](_0x5aee1f);}for(const _0x238463 of _0x4e1d29[_0x13a754(0xfc)]()){_0x238463[_0x13a754(0x115)]((_0x5dd7b6,_0x1bb8a8)=>(_0x5dd7b6[_0x13a754(0x179)]||0x0)-(_0x1bb8a8[_0x13a754(0x179)]||0x0));}return _0x4e1d29;}export function collectFoldersToCreate(_0x41c4de,_0xb17952){const _0x23cb9d=a100_0x25feef,_0x43a951=new Set();for(const _0x55cd2f of _0x41c4de){if(!_0x55cd2f)continue;if(_0xb17952['has'](_0x55cd2f))continue;const _0x26f997=_0x55cd2f[_0x23cb9d(0x162)]('/');let _0xd6b761='';for(const _0x11664d of _0x26f997){_0xd6b761=_0xd6b761?_0xd6b761+'/'+_0x11664d:_0x11664d,!_0xb17952['has'](_0xd6b761)&&_0x43a951[_0x23cb9d(0x132)](_0xd6b761);}}return _0x43a951;}export function parseAndClassifyYamlFiles(_0x4cdd3f,_0x4b2718,_0x2028bc){const _0x156247=a100_0x25feef,_0x46a8cc=[],_0x4cd260=[];for(const _0x17152f of _0x4cdd3f){const _0x55d3db=a100_0x4cc6a1[_0x156247(0x107)](_0x4b2718,a100_0x4cc6a1[_0x156247(0xff)](_0x17152f)),_0x108238=_0x55d3db==='.'?'':_0x55d3db,_0x8b8c2=readFileSync(_0x17152f,'utf-8'),_0x2785fe=a100_0x226117['parse'](_0x8b8c2);if(isJourneyDef(_0x2785fe)){const _0x33e42e=a100_0x54e692(_0x8b8c2);_0x4cd260['push']({'yamlConfig':_0x33e42e,'folderPath':_0x108238,'sourcePath':_0x17152f});}else{if(!_0x2028bc?.[_0x156247(0x127)]){const _0x443ec9=parseSegmentYamlFile(_0x8b8c2),_0x3ed6bb=normalizeChildSegmentYaml(_0x443ec9);_0x46a8cc[_0x156247(0x19d)]({'yamlConfig':_0x3ed6bb,'folderPath':_0x108238,'sourcePath':_0x17152f});}}}return{'segments':_0x46a8cc,'journeys':_0x4cd260};}export function validateParsedFiles(_0x12490a,_0x29bcd0){const _0x544a07=a100_0x25feef,_0x2d7449=[];for(const {yamlConfig:_0x327a00,sourcePath:_0x4dbfb7}of _0x12490a[_0x544a07(0x197)]){const _0x126224=readFileSync(_0x4dbfb7,_0x544a07(0x119)),_0xf564cd=a100_0x226117['parseDocument'](_0x126224),_0x338e01=validateSegmentDef(_0x327a00,{'source':_0x126224,'document':_0xf564cd});if(!_0x338e01[_0x544a07(0x171)]){const _0x297c5b=a100_0x4cc6a1['relative'](_0x29bcd0,_0x4dbfb7);_0x2d7449[_0x544a07(0x19d)]({'filePath':_0x297c5b,'source':_0x126224,'result':_0x338e01,'isJourney':![]});}}for(const {yamlConfig:_0x401cfa,sourcePath:_0x2bd86a}of _0x12490a['journeys']){const _0x97bd36=readFileSync(_0x2bd86a,_0x544a07(0x119)),_0x57be96=a100_0x226117['parseDocument'](_0x97bd36),_0x5c7b45=validateJourneyDef(_0x401cfa,{'source':_0x97bd36,'document':_0x57be96});if(!_0x5c7b45[_0x544a07(0x171)]){const _0x4a4220=a100_0x4cc6a1['relative'](_0x29bcd0,_0x2bd86a);_0x2d7449[_0x544a07(0x19d)]({'filePath':_0x4a4220,'source':_0x97bd36,'result':_0x5c7b45,'isJourney':!![]});}}return _0x2d7449;}export function formatValidationErrors(_0x4e2b7e){const _0x4f45de=a100_0x25feef,_0x17b13b=[];for(const {filePath:_0x335588,source:_0x1fe930,result:_0x3f3344,isJourney:_0xa2cf56}of _0x4e2b7e){const _0x264fb0=_0xa2cf56?_0x4f45de(0x182):_0x4f45de(0x15d);_0x17b13b[_0x4f45de(0x19d)]('\x0a'+_0x335588+'\x20('+_0x264fb0+_0x4f45de(0x123)+_0x3f3344[_0x4f45de(0x122)][_0x4f45de(0x11f)]+_0x4f45de(0x12c)),_0x17b13b[_0x4f45de(0x19d)](formatValidationResult(_0x3f3344,_0x1fe930,_0x335588));}return _0x17b13b[_0x4f45de(0x12f)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4da6de){const _0x4eb50e=a100_0x25feef,_0x48f2da=new Set(),_0x2e1ec3=new Map(),_0x52e150=collectSegmentUsageCounts(_0x4da6de);if(_0x4da6de['segments'])for(const [_0x3cac72,_0x24db47]of Object[_0x4eb50e(0x196)](_0x4da6de['segments'])){_0x48f2da[_0x4eb50e(0x132)](_0x3cac72);if(_0x24db47[_0x4eb50e(0x1b7)]){const _0x5a9f5f=yamlRuleToApi(_0x24db47['rule']),_0x5da0aa=apiRuleToYaml(_0x5a9f5f);_0x2e1ec3['set'](_0x3cac72,_0x5da0aa);}}const _0x3681c3=new Map();let _0x3ca06c=0x0;for(const [_0x3ec044,_0x1ad216]of _0x2e1ec3){const _0x5611f1=serializeExpandedRule(_0x1ad216,_0x2e1ec3),_0x153df1=_0x3681c3[_0x4eb50e(0x10c)](_0x5611f1)||[];_0x153df1[_0x4eb50e(0x19d)]({'name':_0x3ec044,'index':_0x3ca06c}),_0x3681c3[_0x4eb50e(0x159)](_0x5611f1,_0x153df1),_0x3ca06c++;}const _0x178347=new Map();for(const [_0x1f33e9,_0x62e387]of _0x3681c3){const _0x5d0665=_0x62e387[_0x4eb50e(0x177)]()[_0x4eb50e(0x115)]((_0xf1c9cb,_0x14b34a)=>{const _0x42f6c3=_0x4eb50e,_0x26ac09=_0x52e150[_0x42f6c3(0x10c)](_0xf1c9cb[_0x42f6c3(0x14f)])||0x0,_0x4eceb3=_0x52e150[_0x42f6c3(0x10c)](_0x14b34a['name'])||0x0;if(_0x26ac09!==_0x4eceb3)return _0x4eceb3-_0x26ac09;return _0xf1c9cb[_0x42f6c3(0x10b)]-_0x14b34a['index'];})[_0x4eb50e(0x14d)](_0x3bc743=>_0x3bc743[_0x4eb50e(0x14f)]),_0x59ced5=[];for(const _0x17dcc1 of _0x5d0665){const _0x2cbeba=_0x52e150[_0x4eb50e(0x10c)](_0x17dcc1)||0x0,_0x53fb6f=Math[_0x4eb50e(0x13a)](_0x2cbeba,0x1);for(let _0x424032=0x0;_0x424032<_0x53fb6f;_0x424032++){_0x59ced5[_0x4eb50e(0x19d)](_0x17dcc1);}}_0x178347[_0x4eb50e(0x159)](_0x1f33e9,_0x59ced5);}return{'existingLocalSegmentNames':_0x48f2da,'localSegmentRules':_0x2e1ec3,'localExpandedRuleToNames':_0x178347};}async function buildServerSegmentRuleMap(_0x3cdeb0,_0x37cd1b,_0x59d1be,_0x44fa05){const _0x51ed15=new Map(),_0x51d913=new Set(),_0x5cbe15=async _0x4ab291=>{const _0x1a914d=a100_0x386c;if(_0x51d913[_0x1a914d(0x16a)](_0x4ab291))return;_0x51d913['add'](_0x4ab291);let _0x638bed=_0x59d1be[_0x1a914d(0x1d0)](_0x1fbec8=>_0x1fbec8['id']===_0x4ab291);if(!_0x638bed)try{_0x638bed=await _0x3cdeb0[_0x1a914d(0x15d)][_0x1a914d(0x18c)](_0x37cd1b,_0x4ab291);}catch{return;}if(!_0x638bed?.[_0x1a914d(0x1b7)])return;const _0x10c604=apiRuleToYaml(_0x638bed[_0x1a914d(0x1b7)]);_0x51ed15['set'](_0x4ab291,_0x10c604);const _0x2b763c=collectSegmentRefsFromRule(_0x10c604);for(const _0x2bc21e of _0x2b763c){await _0x5cbe15(_0x2bc21e);}};for(const _0x1f58ab of _0x44fa05){await _0x5cbe15(_0x1f58ab);}return _0x51ed15;}export function createSegmentIdResolver(_0x43a493,_0xb2d04e){return async _0x37a7e2=>{const _0x48f5c5=a100_0x386c,_0xb8effa=_0x43a493[_0x48f5c5(0x10c)](_0x37a7e2);if(!_0xb8effa)throw new SDKError(ErrorCode[_0x48f5c5(0x15c)],'Segment\x20not\x20found:\x20'+_0x37a7e2+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0xb2d04e+'\x27)');return _0xb8effa;};}export function extractRootFolderId(_0x2fd8a7){const _0x5b555b=a100_0x25feef;return _0x2fd8a7['relationships']?.['parentSegmentFolder']?.[_0x5b555b(0xf6)]?.['id']||_0x2fd8a7[_0x5b555b(0x187)]?.[_0x5b555b(0x140)]?.[_0x5b555b(0xf6)]?.['id'];}export function buildConnectionMaps(_0x48b5e8){const _0x2a7258=a100_0x25feef,_0x284d48=new Map(),_0x583706=new Map(),_0x26ebcd=new Map();for(const _0x24b0c6 of _0x48b5e8){_0x284d48['set'](_0x24b0c6[_0x2a7258(0x14f)],parseInt(_0x24b0c6['id'],0xa)),_0x583706[_0x2a7258(0x159)](_0x24b0c6['id'],_0x24b0c6[_0x2a7258(0x14f)]),_0x26ebcd[_0x2a7258(0x159)](_0x24b0c6[_0x2a7258(0x14f)],_0x24b0c6[_0x2a7258(0x176)]);}return{'nameToId':_0x284d48,'idToName':_0x583706,'nameToType':_0x26ebcd};}export function calculatePushStats(_0x200ca7,_0x553e96,_0x35ca59,_0x20d880,_0x5dc3f9,_0x82c12c,_0x217e5c){const _0x1320c3=a100_0x25feef,_0x41d2d0=_0x200ca7[_0x1320c3(0x1ce)](_0x143a09=>_0x143a09[_0x1320c3(0x1ca)]),_0x4bc284=_0x200ca7[_0x1320c3(0x1ce)](_0x45f0db=>!_0x45f0db['isNew']&&_0x45f0db[_0x1320c3(0x17d)]),_0x35e4dc=_0x200ca7[_0x1320c3(0x1ce)](_0x49973f=>!_0x49973f[_0x1320c3(0x1ca)]&&!_0x49973f[_0x1320c3(0x17d)]),_0x587697=_0x82c12c?_0x20d880:[],_0x340f65=_0x553e96[_0x1320c3(0x1ce)](_0x20d5ea=>_0x20d5ea['isNew']),_0x1df204=_0x553e96[_0x1320c3(0x1ce)](_0x2cf066=>!_0x2cf066[_0x1320c3(0x1ca)]&&_0x2cf066[_0x1320c3(0x17d)]),_0x4da5ab=_0x553e96['filter'](_0x3a9266=>!_0x3a9266['isNew']&&!_0x3a9266[_0x1320c3(0x17d)]),_0x482a70=_0x82c12c?_0x5dc3f9:[],_0x584d79=_0x200ca7[_0x1320c3(0x170)](_0x1d3d99=>_0x1d3d99['activationActions']),_0x1163bb=_0x584d79[_0x1320c3(0x1ce)](_0x371cc1=>_0x371cc1['type']===_0x1320c3(0x136)),_0xd20dfc=_0x584d79['filter'](_0x527703=>_0x527703['type']===_0x1320c3(0x10a)),_0x2fbc98=_0x584d79[_0x1320c3(0x1ce)](_0x4dfe48=>_0x4dfe48['type']===_0x1320c3(0x103)),_0x28ec1a=Array[_0x1320c3(0x150)](_0x35ca59)[_0x1320c3(0x115)](),_0x1623c3=_0x217e5c?![]:_0x41d2d0['length']>0x0||_0x4bc284[_0x1320c3(0x11f)]>0x0||_0x587697[_0x1320c3(0x11f)]>0x0,_0x50537b=_0x340f65[_0x1320c3(0x11f)]>0x0||_0x1df204[_0x1320c3(0x11f)]>0x0||_0x482a70[_0x1320c3(0x11f)]>0x0,_0x3fb01f=_0x217e5c?![]:_0x584d79[_0x1320c3(0x11f)]>0x0,_0x5b08df=_0x28ec1a[_0x1320c3(0x11f)]>0x0;return{'segments':{'new':_0x41d2d0,'changed':_0x4bc284,'unchanged':_0x35e4dc,'toDelete':_0x587697},'journeys':{'new':_0x340f65,'changed':_0x1df204,'unchanged':_0x4da5ab,'toDelete':_0x482a70},'activations':{'all':_0x584d79,'toCreate':_0x1163bb,'toUpdate':_0xd20dfc,'toDelete':_0x2fbc98},'folders':{'toCreate':_0x28ec1a},'counts':{'segments':{'new':_0x41d2d0[_0x1320c3(0x11f)],'changed':_0x4bc284[_0x1320c3(0x11f)],'unchanged':_0x35e4dc[_0x1320c3(0x11f)],'toDelete':_0x587697[_0x1320c3(0x11f)]},'journeys':{'new':_0x340f65[_0x1320c3(0x11f)],'changed':_0x1df204['length'],'unchanged':_0x4da5ab[_0x1320c3(0x11f)],'toDelete':_0x482a70['length']},'activations':{'create':_0x1163bb[_0x1320c3(0x11f)],'update':_0xd20dfc[_0x1320c3(0x11f)],'delete':_0x2fbc98[_0x1320c3(0x11f)]},'folders':_0x28ec1a[_0x1320c3(0x11f)]},'hasChanges':_0x1623c3||_0x50537b||_0x3fb01f||_0x5b08df};}export async function buildPushExecutionContext(_0x1ebaaa,_0x4655d8,_0x41d378,_0x28eea3,_0x15d7bb,_0x4774fc){const _0x434fe2=a100_0x25feef,_0x6fe49d=extractRootFolderId(_0x41d378),{pathToId:_0x5c6fd9,idToPath:_0x168058}=buildFolderMaps(_0x15d7bb),_0x54f1f3=buildSegmentNameToIdMap(_0x28eea3),_0x1bec3b=new Map(),{batchAsync:_0x490ca2}=await import(_0x434fe2(0x133)),[_0x167c1b,_0x127032]=await Promise['all']([_0x1ebaaa['user'][_0x434fe2(0x1b0)](),_0x1ebaaa[_0x434fe2(0x18e)][_0x434fe2(0x109)](),((async()=>{const _0x279e51=_0x434fe2;!_0x4774fc&&_0x28eea3[_0x279e51(0x11f)]>0x0&&await _0x490ca2(_0x28eea3,async _0x44bc30=>{const _0x2a964e=_0x279e51,_0x88ecd2=await _0x1ebaaa['segment']['listActivations'](_0x4655d8,_0x44bc30['id']);_0x1bec3b[_0x2a964e(0x159)](_0x44bc30['id'],_0x88ecd2);});})())]),{emailToId:_0xe7a3eb,idToEmail:_0x287290}=_0x167c1b,_0x32330e=buildConnectionMaps(_0x127032);return{'rootFolderId':_0x6fe49d,'folderPathToId':_0x5c6fd9,'folderIdToPath':_0x168058,'segmentNameToId':_0x54f1f3,'activationsBySegmentId':_0x1bec3b,'emailToIdMap':_0xe7a3eb,'idToEmailMap':_0x287290,'connectionNameToIdMap':_0x32330e['nameToId'],'connectionIdToNameMap':_0x32330e[_0x434fe2(0x1a5)],'connectionNameToTypeMap':_0x32330e[_0x434fe2(0x191)]};}export function createPushYamlContextForBundle(_0x386929,_0x227b0e,_0xa252b7,_0x4a44eb,_0x175c77,_0x20aaa9,_0x57db2f,_0x394025){const {existingLocalSegmentNames:_0x27e0ee,localExpandedRuleToNames:_0x2ffd04}=_0x4a44eb,_0x4166cf=new Set(),_0x593cac=new Map(),_0x11d8e8=new Map(),_0x183b24=new Map(),_0x2f8992=createJumpTargetCache(),_0x2e7852=new Map(),_0x208fcb=new Map(),_0x1ece52=new Set();let _0x19119e;const _0x365397=_0x31ff70=>{const _0xc544c1={'resolveSegment':async _0x3f5091=>{const _0x4c80c7=a100_0x386c,_0x257f5e=_0x183b24[_0x4c80c7(0x10c)](_0x3f5091);if(_0x257f5e!==undefined)return{'name':_0x257f5e,'isJourneyLocal':!![]};try{let _0x15eba3=_0xa252b7[_0x4c80c7(0x1d0)](_0x5c988f=>_0x5c988f['id']===_0x3f5091);!_0x15eba3&&(_0x15eba3=await _0x386929[_0x4c80c7(0x15d)][_0x4c80c7(0x18c)](_0x227b0e,_0x3f5091));const _0x440889=generateJourneyLocalName(_0x15eba3['name']),_0x322d53=_0x15eba3[_0x4c80c7(0xf5)]===SEGMENT_KIND_JOURNEY&&_0x440889!==undefined;let _0x12e89b=_0x15eba3[_0x4c80c7(0x14f)],_0x4c5df3;if(_0x322d53&&_0x15eba3[_0x4c80c7(0x1b7)]){const _0x40073d=apiRuleToYaml(_0x15eba3['rule']);_0x208fcb[_0x4c80c7(0x159)](_0x3f5091,_0x40073d);const _0x1b16fc=async _0x291f93=>{const _0x185afa=_0x4c80c7,_0x5f2c0b=collectSegmentRefsFromRule(_0x291f93);for(const _0x29d7b4 of _0x5f2c0b){if(!_0x208fcb['has'](_0x29d7b4))try{const _0x244e03=await _0x386929['segment'][_0x185afa(0x18c)](_0x227b0e,_0x29d7b4);if(_0x244e03?.['rule']){const _0x54a74c=apiRuleToYaml(_0x244e03[_0x185afa(0x1b7)]);_0x208fcb[_0x185afa(0x159)](_0x29d7b4,_0x54a74c),await _0x1b16fc(_0x54a74c);}}catch{}}};await _0x1b16fc(_0x40073d);const _0x3a2abc=serializeExpandedRule(_0x40073d,_0x208fcb),_0x378c1a=_0x2ffd04[_0x4c80c7(0x10c)](_0x3a2abc);if(_0x378c1a&&_0x378c1a[_0x4c80c7(0x11f)]>0x0){const _0x197fee=_0x593cac[_0x4c80c7(0x10c)](_0x3a2abc)||0x0,_0x36450f=_0x378c1a[_0x197fee]||_0x378c1a[_0x378c1a['length']-0x1];_0x593cac[_0x4c80c7(0x159)](_0x3a2abc,_0x197fee+0x1),_0x12e89b=_0x36450f,_0x4166cf[_0x4c80c7(0x132)](_0x12e89b),_0x183b24[_0x4c80c7(0x159)](_0x3f5091,_0x12e89b);const _0x2f896a=await resolveRuleSegmentRefs(_0x40073d,async _0x4cdc20=>{const _0x5427fc=_0x4c80c7,_0x1bcda7=_0x183b24[_0x5427fc(0x10c)](_0x4cdc20);if(_0x1bcda7)return _0x1bcda7;const _0x16aaa1=await _0x19119e['resolveSegment'](_0x4cdc20);return _0x16aaa1[_0x5427fc(0x14f)];});_0x4c5df3={'description':_0x15eba3[_0x4c80c7(0x114)],'rule':_0x2f896a};}else{const _0x14db26=_0x2e7852[_0x4c80c7(0x10c)](_0x3a2abc);if(_0x14db26)_0x12e89b=_0x14db26,_0x183b24[_0x4c80c7(0x159)](_0x3f5091,_0x12e89b);else{if(_0x440889){let _0x1c05c2=_0x440889,_0x530f49=0x2;while(_0x4166cf['has'](_0x1c05c2)||_0x27e0ee[_0x4c80c7(0x16a)](_0x1c05c2)){_0x1c05c2=_0x440889+'_'+_0x530f49,_0x530f49++;}_0x4166cf[_0x4c80c7(0x132)](_0x1c05c2),_0x12e89b=_0x1c05c2;}_0x183b24[_0x4c80c7(0x159)](_0x3f5091,_0x12e89b),_0x2e7852[_0x4c80c7(0x159)](_0x3a2abc,_0x12e89b);const _0x55cbeb=await resolveRuleSegmentRefs(_0x40073d,async _0x40f9b4=>{const _0x50df96=_0x4c80c7,_0x2a0da1=_0x183b24[_0x50df96(0x10c)](_0x40f9b4);if(_0x2a0da1)return _0x2a0da1;const _0x17478f=await _0x19119e['resolveSegment'](_0x40f9b4);return _0x17478f['name'];});_0x4c5df3={'description':_0x15eba3[_0x4c80c7(0x114)],'rule':_0x55cbeb};}}}return{'name':_0x12e89b,'isJourneyLocal':_0x322d53,'definition':_0x4c5df3};}catch{return{'name':_0x3f5091,'isJourneyLocal':![]};}},'resolveActivation':async _0x38124f=>{const _0x369996=a100_0x386c,_0x282bca=_0x11d8e8[_0x369996(0x10c)](_0x38124f);if(_0x282bca!==undefined)return{'name':_0x282bca,'isJourneyLocal':!![]};try{let _0x163e8c=_0x57db2f?.[_0x369996(0x10c)](_0x38124f);!_0x163e8c&&(_0x163e8c=await _0x386929[_0x369996(0x182)][_0x369996(0x167)](_0x31ff70,_0x38124f));const _0x46bc30=_0x163e8c[_0x369996(0x144)]['activationParams'][_0x369996(0x14f)]||_0x38124f,_0x35ebf7=sanitizeYamlKey(_0x46bc30)||_0x369996(0x19a)+_0x38124f,_0x5b94ff=_0x35ebf7;_0x11d8e8[_0x369996(0x159)](_0x38124f,_0x5b94ff);const _0x345f82=journeyActivationStepToYaml(_0x163e8c,_0x175c77,_0x20aaa9);return{'name':_0x5b94ff,'isJourneyLocal':!![],'definition':_0x345f82};}catch{return{'name':_0x38124f,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4e1e1b,_0x2a2117)=>resolveJumpTarget(_0x4e1e1b,_0x2a2117,_0x2f8992,async _0x4b0271=>{const _0x502267=a100_0x386c,_0x3204a9=_0x394025?.[_0x502267(0x10c)](_0x4b0271);if(_0x3204a9)return _0x3204a9;return _0x386929[_0x502267(0x182)]['getJourney'](_0x4b0271);})};return _0x19119e=_0xc544c1,_0xc544c1;},_0x3b0fd3=async _0x4fbac0=>{const _0x4df796=a100_0x386c,{collectSegmentIdsFromJourneyApi:_0x548159}=await import('./journey-yaml.js'),{batchAsync:_0x30c8f6}=await import('../../utils/async.js'),_0x4d1fb1=new Set();for(const _0x48de19 of _0x4fbac0){let _0x44bc1a=_0x394025?.[_0x4df796(0x10c)](_0x48de19);!_0x44bc1a&&(_0x44bc1a=await _0x386929[_0x4df796(0x182)]['getJourney'](_0x48de19));const _0x2f606a=_0x548159(_0x44bc1a);for(const _0x19ede5 of _0x2f606a){_0x4d1fb1['add'](_0x19ede5);}}let _0x2bc497=Array['from'](_0x4d1fb1);while(_0x2bc497[_0x4df796(0x11f)]>0x0){const _0x30f1c1=_0x2bc497['filter'](_0x9d235d=>!_0x1ece52[_0x4df796(0x16a)](_0x9d235d));if(_0x30f1c1['length']===0x0)break;const _0x4d3fc9=await _0x30c8f6(_0x30f1c1,async _0x11dc8c=>{const _0x55c81f=_0x4df796;_0x1ece52['add'](_0x11dc8c);let _0x3b48e1=_0xa252b7[_0x55c81f(0x1d0)](_0x45a78a=>_0x45a78a['id']===_0x11dc8c);if(!_0x3b48e1)try{_0x3b48e1=await _0x386929[_0x55c81f(0x15d)][_0x55c81f(0x18c)](_0x227b0e,_0x11dc8c);}catch{return null;}return{'segmentId':_0x11dc8c,'segment':_0x3b48e1};},0xa),_0xa8c982=new Set();for(const _0x17de7d of _0x4d3fc9){if(!_0x17de7d?.[_0x4df796(0x15d)]?.[_0x4df796(0x1b7)])continue;const _0x23b405=apiRuleToYaml(_0x17de7d[_0x4df796(0x15d)][_0x4df796(0x1b7)]);_0x208fcb[_0x4df796(0x159)](_0x17de7d[_0x4df796(0x145)],_0x23b405);const _0x50a3f8=collectSegmentRefsFromRule(_0x23b405);for(const _0x4eec5a of _0x50a3f8){!_0x1ece52[_0x4df796(0x16a)](_0x4eec5a)&&_0xa8c982[_0x4df796(0x132)](_0x4eec5a);}}_0x2bc497=Array['from'](_0xa8c982);}};return{'createYamlContext':_0x365397,'prefetchJourneySegments':_0x3b0fd3};}export async function executePushSegments(_0x374883,_0x3f4f2f,_0x1ecc57,_0x5c74eb,_0x47c2cb){const _0x58968c=a100_0x25feef,{segmentDefToCreateRequest:_0x18e430,segmentDefToUpdateRequest:_0x3705e1}=await import('./child-segment-yaml.js'),_0x55d4b3=_0x1ecc57[_0x58968c(0x1b9)],_0x2fdcf3=0x5,_0x4ae8c8=async _0x1ebc3f=>{const _0x1335ae=_0x58968c,_0x2597d3=_0x1ebc3f[_0x1335ae(0x101)]?_0x55d4b3[_0x1335ae(0x10c)](_0x1ebc3f[_0x1335ae(0x101)]):undefined;let _0x36fafe;const _0x44095f={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x1ebc3f[_0x1335ae(0x1ca)]){_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0x10f),'name':_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]});const _0x3d0d82=_0x18e430(_0x1ebc3f['yamlConfig'],_0x2597d3),_0x2b3bcd=await _0x47c2cb[_0x1335ae(0x1a1)](_0x1335ae(0x131)+_0x1ebc3f[_0x1335ae(0x188)]['name']+_0x1335ae(0x178),()=>_0x374883[_0x1335ae(0x15d)][_0x1335ae(0x1a0)](_0x5c74eb[_0x1335ae(0x155)],_0x3d0d82));_0x36fafe=_0x2b3bcd['data']['id'],_0x44095f[_0x1335ae(0x112)]={'name':_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)],'id':_0x36fafe},_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0xfa),'name':_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)],'segmentId':_0x36fafe}),_0x47c2cb[_0x1335ae(0x12a)]?.(_0x1335ae(0x15e)+_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]+'\x27'),_0x44095f[_0x1335ae(0x1be)]=0x1;}else{if(_0x1ebc3f[_0x1335ae(0x17d)]){_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0x118),'name':_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]});const _0xf60ba4=_0x3705e1(_0x1ebc3f['yamlConfig']);_0x2597d3!==_0x1ebc3f[_0x1335ae(0x16e)]?.[_0x1335ae(0x147)]&&(_0xf60ba4[_0x1335ae(0x147)]=_0x2597d3?parseInt(_0x2597d3,0xa):undefined),await _0x47c2cb['withProgress'](_0x1335ae(0x169)+_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]+'\x27...',()=>_0x374883[_0x1335ae(0x15d)][_0x1335ae(0x17f)](_0x5c74eb[_0x1335ae(0x155)],_0x1ebc3f['existingSegment']['id'],_0xf60ba4)),_0x36fafe=_0x1ebc3f[_0x1335ae(0x16e)]['id'],_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0x102),'name':_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)]}),_0x47c2cb[_0x1335ae(0x12a)]?.('Updated\x20segment\x20\x27'+_0x1ebc3f['yamlConfig']['name']+'\x27'),_0x44095f[_0x1335ae(0x129)]=0x1;}else _0x36fafe=_0x1ebc3f[_0x1335ae(0x16e)]['id'];}}catch(_0x30b8d2){const _0xdc807=isHttp400Error(_0x30b8d2),_0x2e1f92=_0xdc807?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1335ae(0x172)],_0x367992=getErrorMessage(_0x30b8d2);throw new SDKError(_0x2e1f92,'Failed\x20to\x20'+(_0x1ebc3f[_0x1335ae(0x1ca)]?_0x1335ae(0x136):_0x1335ae(0x10a))+_0x1335ae(0x157)+_0x1ebc3f[_0x1335ae(0x13b)]+'\x0a\x20\x20'+_0x367992,_0x30b8d2);}try{const _0x229ca8=await syncActivationsForSegment(_0x374883,_0x5c74eb[_0x1335ae(0x155)],_0x36fafe,_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)],_0x1ebc3f['activationActions'],_0x47c2cb,_0x1ebc3f['absolutePath']);_0x44095f['activations']=_0x229ca8;}catch(_0x4cfbb8){if(_0x4cfbb8 instanceof SDKError)throw _0x4cfbb8;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x1335ae(0x183)+_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)]+'\x27\x20from\x20file:\x20'+_0x1ebc3f[_0x1335ae(0x13b)]+_0x1335ae(0x1cb)+getErrorMessage(_0x4cfbb8),_0x4cfbb8);}return _0x44095f;},_0x5db3bc=await batchAsync(_0x3f4f2f,_0x4ae8c8,_0x2fdcf3),_0x1433a4={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x336581 of _0x5db3bc){_0x1433a4[_0x58968c(0x1be)]+=_0x336581['created'],_0x1433a4[_0x58968c(0x129)]+=_0x336581['updated'],_0x336581[_0x58968c(0x112)]&&_0x1433a4[_0x58968c(0x1b5)][_0x58968c(0x159)](_0x336581['createdSegmentId']['name'],_0x336581['createdSegmentId']['id']),_0x1433a4[_0x58968c(0x120)][_0x58968c(0x1be)]+=_0x336581[_0x58968c(0x120)]['created'],_0x1433a4[_0x58968c(0x120)]['updated']+=_0x336581[_0x58968c(0x120)][_0x58968c(0x129)],_0x1433a4['activations'][_0x58968c(0x14c)]+=_0x336581[_0x58968c(0x120)][_0x58968c(0x14c)];}return _0x1433a4;}async function syncActivationsForSegment(_0x4ab81d,_0x79536c,_0x55adc2,_0x36bc7d,_0x4f3b86,_0x166a80,_0x1d6c87){const _0x50867e=a100_0x25feef,_0x21edfc={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5a4b84 of _0x4f3b86){try{if(_0x5a4b84[_0x50867e(0x176)]===_0x50867e(0x136)&&_0x5a4b84['validatedRequest'])_0x166a80['onProgress']?.({'type':_0x50867e(0xf8),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),await _0x166a80[_0x50867e(0x1a1)](_0x50867e(0xfe)+_0x5a4b84[_0x50867e(0x14f)]+_0x50867e(0x178),()=>_0x4ab81d[_0x50867e(0x15d)]['createActivation'](_0x79536c,_0x55adc2,_0x5a4b84[_0x50867e(0x1b6)])),_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x125),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),_0x166a80[_0x50867e(0x12a)]?.('Created\x20activation\x20\x27'+_0x5a4b84[_0x50867e(0x14f)]+'\x27'),_0x21edfc['created']++;else{if(_0x5a4b84[_0x50867e(0x176)]===_0x50867e(0x10a)&&_0x5a4b84[_0x50867e(0x1b6)]&&_0x5a4b84['existingActivation'])_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x16f),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),await _0x166a80[_0x50867e(0x1a1)]('Updating\x20activation\x20\x27'+_0x5a4b84[_0x50867e(0x14f)]+'\x27...',()=>_0x4ab81d[_0x50867e(0x15d)][_0x50867e(0x12d)](_0x79536c,_0x55adc2,_0x5a4b84[_0x50867e(0x1ad)]['id'],_0x5a4b84[_0x50867e(0x1b6)])),_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x16c),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),_0x166a80[_0x50867e(0x12a)]?.(_0x50867e(0x11a)+_0x5a4b84[_0x50867e(0x14f)]+'\x27'),_0x21edfc['updated']++;else _0x5a4b84['type']===_0x50867e(0x103)&&_0x5a4b84['existingActivation']&&(_0x166a80['onProgress']?.({'type':_0x50867e(0x185),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),await _0x166a80[_0x50867e(0x1a1)]('Deleting\x20activation\x20\x27'+_0x5a4b84['name']+_0x50867e(0x178),()=>_0x4ab81d[_0x50867e(0x15d)][_0x50867e(0x153)](_0x79536c,_0x55adc2,_0x5a4b84[_0x50867e(0x1ad)]['id'])),_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x1b2),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),_0x166a80[_0x50867e(0x141)]?.(_0x50867e(0x186)+_0x5a4b84[_0x50867e(0x14f)]+'\x27'),_0x21edfc[_0x50867e(0x14c)]++);}}catch(_0x1d6d4c){const _0x3f3834=isHttp400Error(_0x1d6d4c),_0x2ca210=_0x3f3834?ErrorCode[_0x50867e(0x14b)]:ErrorCode[_0x50867e(0x111)],_0x29d32b=getErrorMessage(_0x1d6d4c);throw new SDKError(_0x2ca210,_0x50867e(0x137)+_0x5a4b84['type']+_0x50867e(0x1ae)+_0x5a4b84[_0x50867e(0x14f)]+'\x27\x20from\x20file:\x20'+_0x1d6c87+'\x0a\x20\x20'+_0x29d32b,_0x1d6d4c);}}return _0x21edfc;}export async function executePushFolders(_0x46951e,_0x35d080,_0x3a81be,_0x58580d,_0x1e3cc7){const _0xe162e0=a100_0x25feef,_0x32e730=new Map(_0x3a81be);for(const _0x573677 of _0x35d080){const _0x14acc0=_0x573677[_0xe162e0(0x162)]('/'),_0xd5e29b=_0x14acc0[_0x14acc0[_0xe162e0(0x11f)]-0x1],_0xec2a01=_0x14acc0['slice'](0x0,-0x1)['join']('/'),_0x3755c2=_0x32e730[_0xe162e0(0x10c)](_0xec2a01);_0x1e3cc7['onProgress']?.({'type':_0xe162e0(0x10d),'folder':_0x573677});const _0x1b5709={'name':_0xd5e29b,'parentFolderId':_0x3755c2},_0x2389cf=await _0x1e3cc7[_0xe162e0(0x1a1)]('Creating\x20folder\x20\x27'+_0x573677+_0xe162e0(0x178),()=>_0x46951e[_0xe162e0(0x15d)][_0xe162e0(0x1af)](_0x58580d[_0xe162e0(0x155)],_0x1b5709));_0x32e730[_0xe162e0(0x159)](_0x573677,_0x2389cf[_0xe162e0(0xf6)]['id']),_0x1e3cc7[_0xe162e0(0x152)]?.({'type':_0xe162e0(0x175),'folder':_0x573677,'folderId':_0x2389cf[_0xe162e0(0xf6)]['id']}),_0x1e3cc7[_0xe162e0(0x194)]?.(_0xe162e0(0x190)+_0x573677+'\x27');}return _0x32e730;}export async function executePushSegmentDeletions(_0x565b8e,_0x4bb3fb,_0x3e3402){const _0x46b454=a100_0x25feef;if(_0x4bb3fb[_0x46b454(0x11f)]===0x0)return 0x0;const {batchAsync:_0x33a112}=await import(_0x46b454(0x133)),_0x217b3d=0x5,_0x4e8876=await _0x33a112(_0x4bb3fb,async _0x154c6b=>{const _0x449f13=_0x46b454;return _0x3e3402[_0x449f13(0x152)]?.({'type':_0x449f13(0x124),'name':_0x154c6b[_0x449f13(0x14f)]}),await _0x565b8e[_0x449f13(0x15d)][_0x449f13(0x104)](_0x154c6b['id']),_0x3e3402[_0x449f13(0x152)]?.({'type':_0x449f13(0x195),'name':_0x154c6b[_0x449f13(0x14f)]}),_0x3e3402[_0x449f13(0x141)]?.(_0x449f13(0x154)+_0x154c6b[_0x449f13(0x14f)]+'\x27'),0x1;},_0x217b3d);return _0x4e8876[_0x46b454(0x100)]((_0x2335cf,_0x41ffb5)=>_0x2335cf+_0x41ffb5,0x0);}export async function executePushJourneys(_0x2097e7,_0x48d7a1,_0x4bad9a,_0x4174cb,_0x137d00){const _0x3188dd=a100_0x25feef,{journeyDefToRequest:_0x118189}=await import(_0x3188dd(0x135)),{activationDefToCreateRequest:_0x4c3086,yamlRuleToApi:_0x4c3041,validateSegmentRule:_0x4ae32f}=await import('./child-segment-yaml.js'),_0x3c9bba={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x437e0c=new Map(_0x4bad9a[_0x3188dd(0x1cf)]),_0x120463=0x5;for(let _0x1c30c1=0x0;_0x1c30c1<_0x48d7a1[_0x3188dd(0x11f)];_0x1c30c1+=_0x120463){const _0x2649c2=_0x48d7a1[_0x3188dd(0x177)](_0x1c30c1,_0x1c30c1+_0x120463),_0x48e35d=await Promise[_0x3188dd(0x1b1)](_0x2649c2['map'](async _0x5a0998=>{const _0x550a8e=_0x3188dd;if(!_0x5a0998[_0x550a8e(0x1ca)]&&!_0x5a0998[_0x550a8e(0x17d)])return{'action':_0x550a8e(0x110),'name':_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)],'journeyId':_0x5a0998[_0x550a8e(0x181)]?.['id']};const _0x5ba12a=_0x5a0998['folderPath']?_0x4bad9a[_0x550a8e(0x1b9)][_0x550a8e(0x10c)](_0x5a0998['folderPath']):undefined;_0x137d00[_0x550a8e(0x152)]?.({'type':_0x5a0998['isNew']?'journey_creating':_0x550a8e(0xf4),'name':_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)]});try{const _0x29b3aa=await executeSingleJourneyPush(_0x2097e7,_0x5a0998,{..._0x4bad9a,'segmentNameToId':_0x437e0c},{'parentId':_0x4174cb[_0x550a8e(0x155)],'rootFolderId':_0x4174cb['rootFolderId'],'folderId':_0x5ba12a,'verbose':_0x4174cb['verbose']},_0x137d00,{'journeyDefToRequest':_0x118189,'activationDefToCreateRequest':_0x4c3086,'yamlRuleToApi':_0x4c3041,'validateSegmentRule':_0x4ae32f});for(const [_0x370cff,_0x48b4ab]of _0x29b3aa[_0x550a8e(0x15f)]){_0x437e0c[_0x550a8e(0x159)](_0x370cff,_0x48b4ab),_0x3c9bba[_0x550a8e(0x15f)]['set'](_0x370cff,_0x48b4ab);}if(_0x29b3aa[_0x550a8e(0x121)]===_0x550a8e(0x1be))_0x137d00[_0x550a8e(0x152)]?.({'type':'journey_created','name':_0x5a0998['yamlConfig']['name'],'journeyId':_0x29b3aa['journeyId']}),_0x137d00[_0x550a8e(0x12a)]?.(_0x550a8e(0x1c8)+_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)]+'\x27'),_0x3c9bba[_0x550a8e(0x1be)]++;else _0x29b3aa['action']===_0x550a8e(0x129)&&(_0x137d00['onProgress']?.({'type':_0x550a8e(0xf9),'name':_0x5a0998[_0x550a8e(0x188)]['name']}),_0x137d00[_0x550a8e(0x12a)]?.(_0x550a8e(0x15b)+_0x5a0998['yamlConfig'][_0x550a8e(0x14f)]+'\x27'),_0x3c9bba[_0x550a8e(0x129)]++);return{'action':_0x29b3aa[_0x550a8e(0x121)],'name':_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)],'journeyId':_0x29b3aa[_0x550a8e(0x1bd)]};}catch(_0x395372){const _0x1def86=isHttp400Error(_0x395372),_0xa74bfe=_0x1def86?ErrorCode[_0x550a8e(0xf7)]:ErrorCode[_0x550a8e(0xf2)],_0x2ac4a2=getErrorMessage(_0x395372);throw new SDKError(_0xa74bfe,_0x550a8e(0x137)+(_0x5a0998['isNew']?'create':_0x550a8e(0x10a))+'\x20journey\x20from\x20file:\x20'+_0x5a0998['absolutePath']+_0x550a8e(0x1cb)+_0x2ac4a2,_0x395372);}}));_0x3c9bba['results'][_0x3188dd(0x19d)](..._0x48e35d);}return _0x3c9bba;}async function executeSingleJourneyPush(_0x18ed20,_0x52292c,_0x137ad8,_0x5ab9a4,_0x254e9a,_0x200578){const _0x4e5ac6=a100_0x25feef,{journeyDefToRequest:_0x2409d4,activationDefToCreateRequest:_0x12da5e,yamlRuleToApi:_0x489c4,validateSegmentRule:_0x5b2153}=_0x200578,_0x23426c=new Map(),_0x4e723f=new Map(),_0x287088=new Map(),_0x589f1e=new Map(),_0x4c564=new Map();let _0x26ed48;const _0x15ddd4=async()=>{const _0x4706fe=a100_0x386c;if(_0x26ed48)return;_0x26ed48=new Map();if(!_0x52292c[_0x4706fe(0x181)])return;const _0x4a0f82=await _0x18ed20[_0x4706fe(0x182)]['listActivations'](_0x52292c[_0x4706fe(0x181)]['id']);for(const _0x3bbe7e of _0x4a0f82){const _0x4311e5=journeyActivationStepToYaml(_0x3bbe7e,_0x137ad8[_0x4706fe(0x168)],_0x137ad8[_0x4706fe(0x1bf)]),_0x5b550e=activationSignature(_0x4311e5);!_0x26ed48[_0x4706fe(0x16a)](_0x5b550e)&&_0x26ed48[_0x4706fe(0x159)](_0x5b550e,_0x3bbe7e['id']),_0x4311e5[_0x4706fe(0x14f)]&&_0x4e723f[_0x4706fe(0x159)](_0x4311e5[_0x4706fe(0x14f)],_0x3bbe7e['id']);}};if(_0x52292c[_0x4e5ac6(0x181)]&&_0x52292c[_0x4e5ac6(0x188)]['segments']){const _0x3d7bd3=buildLocalExpandedRuleMappings(_0x52292c[_0x4e5ac6(0x188)]),_0x73e929=_0x3d7bd3[_0x4e5ac6(0x19e)];if(_0x73e929['size']>0x0){const _0x2b36d8=new Map();for(const [_0x3028a8,_0x2fc1e7]of _0x73e929){const _0x1adf8f=serializeExpandedRule(_0x2fc1e7,_0x73e929);_0x2b36d8[_0x4e5ac6(0x159)](_0x3028a8,_0x1adf8f);}const _0x154ffd=collectSegmentIdsFromJourneyApi(_0x52292c[_0x4e5ac6(0x181)]);if(_0x154ffd['size']>0x0){const _0xef50c9=await buildServerSegmentRuleMap(_0x18ed20,_0x5ab9a4[_0x4e5ac6(0x155)],_0x137ad8[_0x4e5ac6(0x12e)],_0x154ffd);if(_0xef50c9[_0x4e5ac6(0x139)]>0x0){const _0x4a199c=new Map();for(const [_0x5323a9,_0x2d8a02]of _0xef50c9){const _0x406a5c=serializeExpandedRule(_0x2d8a02,_0xef50c9);!_0x4a199c['has'](_0x406a5c)&&_0x4a199c[_0x4e5ac6(0x159)](_0x406a5c,_0x5323a9);}for(const [_0x59903d,_0x8c1098]of _0x2b36d8){const _0x30a153=_0x4a199c[_0x4e5ac6(0x10c)](_0x8c1098);_0x30a153&&(_0x4c564[_0x4e5ac6(0x159)](_0x59903d,_0x30a153),_0x137ad8['segmentNameToId'][_0x4e5ac6(0x159)](_0x59903d,_0x30a153));}}}}}const _0x2988a8={'resolveSegmentId':async _0xeb666e=>{const _0x33da77=_0x4e5ac6,_0x236887=_0x137ad8[_0x33da77(0x1cf)]['get'](_0xeb666e);if(!_0x236887)throw new SDKError(ErrorCode[_0x33da77(0x15c)],'Segment\x20not\x20found:\x20'+_0xeb666e+_0x33da77(0x149)+_0x52292c[_0x33da77(0x188)][_0x33da77(0x14f)]+')');return _0x236887;},'resolveEmbeddedSegmentId':async(_0x8c315d,_0x2a2ebe)=>{const _0x5e5886=_0x4e5ac6,_0x419382=_0x137ad8[_0x5e5886(0x1cf)][_0x5e5886(0x10c)](_0x8c315d);if(_0x419382)return _0x419382;const _0x17b02a=_0x4c564['get'](_0x8c315d);if(_0x17b02a)return _0x137ad8['segmentNameToId']['set'](_0x8c315d,_0x17b02a),_0x17b02a;const _0x458a89=_0x137ad8[_0x5e5886(0x12e)]['find'](_0x21c4e9=>_0x21c4e9[_0x5e5886(0x14f)]===_0x8c315d);if(_0x458a89)return _0x137ad8['segmentNameToId'][_0x5e5886(0x159)](_0x8c315d,_0x458a89['id']),_0x458a89['id'];if(_0x52292c[_0x5e5886(0x1ca)]){const {stageName:_0x42c396,criteriaName:_0x2f4644}=findSegmentCriteriaLocation(_0x52292c['yamlConfig'],_0x8c315d);return _0x5b2153(_0x8c315d,_0x2a2ebe[_0x5e5886(0x1b7)]),_0x287088['set'](_0x8c315d,{'definition':_0x2a2ebe,'stageName':_0x42c396,'criteriaName':_0x2f4644}),createPendingSegmentId(_0x8c315d);}const _0x508ba1=_0x52292c[_0x5e5886(0x181)]?.['id'];if(!_0x508ba1)throw new SDKError(ErrorCode[_0x5e5886(0x11d)],_0x5e5886(0x11c));_0x5b2153(_0x8c315d,_0x2a2ebe[_0x5e5886(0x1b7)]);const _0x2afd7c=generateDeterministicJourneySegmentName(_0x52292c[_0x5e5886(0x188)]['name'],_0x8c315d),_0xd99351=_0x137ad8[_0x5e5886(0x12e)][_0x5e5886(0x1d0)](_0x2c90b5=>_0x2c90b5[_0x5e5886(0x14f)]===_0x2afd7c),_0x425388=createSegmentIdResolver(_0x137ad8[_0x5e5886(0x1cf)],_0x8c315d),_0x446045=await resolveRuleSegmentIds(_0x2a2ebe[_0x5e5886(0x1b7)],_0x425388);let _0xc9191e;if(_0xd99351)await _0x18ed20[_0x5e5886(0x15d)][_0x5e5886(0x17f)](_0x5ab9a4[_0x5e5886(0x155)],_0xd99351['id'],{'description':_0x2a2ebe[_0x5e5886(0x114)]||'Entry\x20criteria:\x20'+_0x8c315d,'rule':_0x489c4(_0x446045,!![]),'countPopulation':!![]}),_0xc9191e=_0xd99351['id'];else try{_0xc9191e=await _0x18ed20[_0x5e5886(0x15d)][_0x5e5886(0x134)]({'name':_0x2afd7c,'description':_0x2a2ebe[_0x5e5886(0x114)]||_0x5e5886(0x180)+_0x8c315d,'journeyId':_0x508ba1,'rule':_0x489c4(_0x446045,!![]),'countPopulation':!![],'parentFolderId':_0x5ab9a4['rootFolderId']||'','audienceId':_0x5ab9a4[_0x5e5886(0x155)]});}catch(_0x20347c){const _0x13cf2a=_0x20347c instanceof Error&&_0x20347c['message'][_0x5e5886(0x12b)](_0x5e5886(0x1ba));if(_0x13cf2a){const _0x4315e=await _0x18ed20['segment'][_0x5e5886(0x18a)](_0x5ab9a4[_0x5e5886(0x155)]),_0x401c7e=_0x4315e[_0x5e5886(0x1d0)](_0xe0774d=>_0xe0774d[_0x5e5886(0x14f)]===_0x2afd7c);if(_0x401c7e)await _0x18ed20[_0x5e5886(0x15d)][_0x5e5886(0x17f)](_0x5ab9a4[_0x5e5886(0x155)],_0x401c7e['id'],{'description':_0x2a2ebe[_0x5e5886(0x114)]||_0x5e5886(0x180)+_0x8c315d,'rule':_0x489c4(_0x446045,!![]),'countPopulation':!![]}),_0xc9191e=_0x401c7e['id'];else throw _0x20347c;}else throw _0x20347c;}return _0x137ad8['segmentNameToId'][_0x5e5886(0x159)](_0x8c315d,_0xc9191e),_0x23426c[_0x5e5886(0x159)](_0x8c315d,_0xc9191e),_0xc9191e;},'resolveActivationId':async _0x4dd80e=>{const _0x20f5b9=_0x4e5ac6,_0x46f6aa=_0x4e723f[_0x20f5b9(0x10c)](_0x4dd80e);if(_0x46f6aa)return _0x46f6aa;if(_0x52292c['existingJourney']){await _0x15ddd4();const _0x22acdb=_0x4e723f[_0x20f5b9(0x10c)](_0x4dd80e);if(_0x22acdb)return _0x22acdb;}throw new SDKError(ErrorCode[_0x20f5b9(0x173)],_0x20f5b9(0x1a9)+_0x4dd80e+_0x20f5b9(0x149)+_0x52292c['yamlConfig'][_0x20f5b9(0x14f)]+').\x20'+_0x20f5b9(0x11b));},'resolveEmbeddedActivationId':async(_0x8a0731,_0x538947)=>{const _0x20e8ee=_0x4e5ac6,_0x670ef1=_0x4e723f['get'](_0x8a0731);if(_0x670ef1)return _0x670ef1;if(_0x52292c[_0x20e8ee(0x1ca)])return _0x589f1e[_0x20e8ee(0x159)](_0x8a0731,_0x538947),createPendingActivationId(_0x8a0731);if(_0x52292c[_0x20e8ee(0x181)]){await _0x15ddd4();const _0x3f6132=_0x4e723f[_0x20e8ee(0x10c)](_0x538947[_0x20e8ee(0x14f)]);if(_0x3f6132)return _0x4e723f[_0x20e8ee(0x159)](_0x8a0731,_0x3f6132),_0x3f6132;const _0x4d7823=activationSignature(_0x538947),_0x2b7434=_0x26ed48?.[_0x20e8ee(0x10c)](_0x4d7823);if(_0x2b7434)return _0x4e723f[_0x20e8ee(0x159)](_0x8a0731,_0x2b7434),_0x2b7434;const _0x5f432c=await _0x12da5e(_0x538947,_0x137ad8['activationContext']),_0x1f744a=await _0x18ed20[_0x20e8ee(0x182)][_0x20e8ee(0x126)](_0x52292c[_0x20e8ee(0x181)]['id'],_0x5f432c);return _0x4e723f['set'](_0x8a0731,_0x1f744a['id']),_0x1f744a['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x20e8ee(0x1b3));},'resolveJourneyId':async _0x584705=>{const _0xf67636=_0x4e5ac6;try{return await _0x18ed20[_0xf67636(0x182)][_0xf67636(0x148)](_0x5ab9a4[_0xf67636(0x155)],_0x584705);}catch(_0x21bb58){throw new SDKError(ErrorCode[_0xf67636(0x173)],_0xf67636(0x105)+_0x584705+_0xf67636(0x1c9)+_0x52292c['yamlConfig']['name']+'\x27)',_0x21bb58);}},'resolveStageId':async(_0x57edaa,_0x2bc85a)=>{const _0x3e161b=_0x4e5ac6,_0xd028e0=await _0x18ed20[_0x3e161b(0x182)][_0x3e161b(0x163)](_0x57edaa),_0x5ce3d4=_0xd028e0[_0x3e161b(0x144)]['journeyStages'][_0x3e161b(0x1d0)](_0x23ab6d=>_0x23ab6d[_0x3e161b(0x14f)][_0x3e161b(0x184)]()===_0x2bc85a[_0x3e161b(0x184)]());if(!_0x5ce3d4?.['id'])throw new SDKError(ErrorCode[_0x3e161b(0x173)],'Stage\x20\x27'+_0x2bc85a+_0x3e161b(0x151)+(_0xd028e0['attributes'][_0x3e161b(0x14e)]||_0xd028e0[_0x3e161b(0x144)][_0x3e161b(0x14f)])+'\x27');return _0x5ce3d4['id'];}},_0x1934ae=await _0x2409d4(_0x52292c[_0x4e5ac6(0x188)],_0x5ab9a4[_0x4e5ac6(0x155)],_0x2988a8),_0x216707=_0x5ab9a4[_0x4e5ac6(0x156)]||_0x5ab9a4['rootFolderId'];_0x216707&&(_0x1934ae[_0x4e5ac6(0x187)]={'parentFolder':{'data':{'id':_0x216707,'type':_0x4e5ac6(0x16d)}}});if(_0x52292c['isNew']){if(_0x287088[_0x4e5ac6(0x139)]>0x0||_0x589f1e[_0x4e5ac6(0x139)]>0x0)return await executeThreeStepJourneyCreate(_0x18ed20,_0x52292c,_0x1934ae,{'pendingEmbeddedSegments':_0x287088,'pendingEmbeddedActivations':_0x589f1e,'embeddedSegmentNameToId':_0x23426c,'journeyActivationNameToId':_0x4e723f},{..._0x5ab9a4,'effectiveFolderId':_0x216707},_0x137ad8,_0x254e9a,_0x200578);else{ensureJourneyDefaults(_0x1934ae[_0x4e5ac6(0x144)]);const _0x1c9b89=await _0x18ed20[_0x4e5ac6(0x182)]['create'](_0x1934ae);return{'action':'created','journeyId':_0x1c9b89['id'],'embeddedSegmentNameToId':_0x23426c};}}else{if(_0x52292c[_0x4e5ac6(0x17d)]&&_0x52292c['existingJourney'])return ensureJourneyDefaults(_0x1934ae['attributes']),await _0x18ed20['journey'][_0x4e5ac6(0x10a)](_0x52292c[_0x4e5ac6(0x181)]['id'],_0x1934ae),{'action':_0x4e5ac6(0x129),'journeyId':_0x52292c[_0x4e5ac6(0x181)]['id'],'embeddedSegmentNameToId':_0x23426c};}return{'action':_0x4e5ac6(0x110),'journeyId':_0x52292c[_0x4e5ac6(0x181)]?.['id'],'embeddedSegmentNameToId':_0x23426c};}function findSegmentCriteriaLocation(_0x31ec65,_0xdb759c){const _0x5d9756=a100_0x25feef,_0x2f9bd0=_0x31ec65[_0x5d9756(0x1cc)]||_0x31ec65[_0x5d9756(0x1cd)]?.[0x0]?.['stages']||[];let _0x44575d='entry',_0x83824a=_0xdb759c;const _0x2e6313=_0x31ec65[_0x5d9756(0x19c)]||_0x31ec65[_0x5d9756(0x1cd)]?.[0x0]?.[_0x5d9756(0x19c)];if(_0x2e6313?.['segment']===_0xdb759c)return{'stageName':_0x5d9756(0x19c),'criteriaName':_0x2e6313[_0x5d9756(0x14f)]||_0xdb759c};_0x4c0952:for(const _0x59073d of _0x2f9bd0){if(_0x59073d[_0x5d9756(0x17b)]?.[_0x5d9756(0x15d)]===_0xdb759c){_0x44575d=_0x59073d['name'],_0x83824a=_0x59073d[_0x5d9756(0x17b)][_0x5d9756(0x14f)]||_0xdb759c;break;}if(_0x59073d[_0x5d9756(0x108)])for(const _0x10e7ac of _0x59073d[_0x5d9756(0x108)]){if(_0x10e7ac[_0x5d9756(0x176)]===_0x5d9756(0x198)&&_0x10e7ac['with']?.['branches'])for(const _0x23f6e3 of _0x10e7ac[_0x5d9756(0x1c7)][_0x5d9756(0x1a6)]){if(_0x23f6e3['segment']===_0xdb759c){_0x44575d=_0x59073d['name'],_0x83824a=_0x23f6e3['name']||_0xdb759c;break _0x4c0952;}}}}return{'stageName':_0x44575d,'criteriaName':_0x83824a};}async function executeThreeStepJourneyCreate(_0x26384b,_0x8d4915,_0xf2fbed,_0x66dfb0,_0x15a7d1,_0x4e6a6d,_0x1d183d,_0x240f1a){const _0x251d45=a100_0x25feef,{activationDefToCreateRequest:_0x16d222,yamlRuleToApi:_0x49eeba}=_0x240f1a,{pendingEmbeddedSegments:_0x112402,pendingEmbeddedActivations:_0x359671,embeddedSegmentNameToId:_0x54193b}=_0x66dfb0,_0x56bf57=JSON[_0x251d45(0x13e)](JSON[_0x251d45(0x160)](_0xf2fbed));ensureJourneyDefaults(_0x56bf57[_0x251d45(0x144)]),stripPendingIds(_0x56bf57);const _0x17f446=await _0x26384b[_0x251d45(0x182)][_0x251d45(0x136)](_0x56bf57),_0x2d6be5=_0x17f446['id'],_0x4aa9dd=new Map();for(const _0x242090 of _0x17f446[_0x251d45(0x144)]['journeyStages']){_0x4aa9dd[_0x251d45(0x159)](_0x242090['name'][_0x251d45(0x184)](),_0x242090['id']);}for(const [_0x469c65,{definition:_0x5432c6}]of _0x112402){const _0x245cf4=generateDeterministicJourneySegmentName(_0x8d4915[_0x251d45(0x188)]['name'],_0x469c65);_0x1d183d[_0x251d45(0x152)]?.({'type':'embedded_segment_creating','journeyName':_0x8d4915[_0x251d45(0x188)]['name'],'segmentName':_0x469c65});const _0x5a6f72=createSegmentIdResolver(_0x4e6a6d[_0x251d45(0x1cf)],_0x469c65),_0x3ce80e=await resolveRuleSegmentIds(_0x5432c6['rule'],_0x5a6f72),_0x20fe56=await _0x26384b['segment']['createJourneySegment']({'name':_0x245cf4,'description':_0x5432c6[_0x251d45(0x114)]||_0x251d45(0x180)+_0x469c65,'journeyId':_0x2d6be5,'rule':_0x49eeba(_0x3ce80e,!![]),'countPopulation':!![],'parentFolderId':_0x15a7d1[_0x251d45(0x1a7)]||'','audienceId':_0x15a7d1[_0x251d45(0x155)]});_0x54193b[_0x251d45(0x159)](_0x469c65,_0x20fe56),_0x4e6a6d[_0x251d45(0x1cf)]['set'](_0x469c65,_0x20fe56),_0x1d183d[_0x251d45(0x152)]?.({'type':'embedded_segment_created','journeyName':_0x8d4915[_0x251d45(0x188)][_0x251d45(0x14f)],'segmentName':_0x469c65});}const _0x4424a4=new Map();for(const [_0x55fc1f,_0x44f3ac]of _0x359671){_0x1d183d['onProgress']?.({'type':_0x251d45(0x18d),'journeyName':_0x8d4915[_0x251d45(0x188)][_0x251d45(0x14f)],'activationName':_0x55fc1f});const _0x4224bb=await _0x16d222(_0x44f3ac,_0x4e6a6d[_0x251d45(0x1a4)]),_0x24d34a=await _0x26384b[_0x251d45(0x182)][_0x251d45(0x126)](_0x2d6be5,_0x4224bb);_0x4424a4[_0x251d45(0x159)](_0x55fc1f,_0x24d34a['id']),_0x66dfb0[_0x251d45(0x10e)]['set'](_0x55fc1f,_0x24d34a['id']),_0x1d183d[_0x251d45(0x152)]?.({'type':'embedded_activation_created','journeyName':_0x8d4915[_0x251d45(0x188)][_0x251d45(0x14f)],'activationName':_0x55fc1f});}const _0x5489be=JSON[_0x251d45(0x13e)](JSON[_0x251d45(0x160)](_0xf2fbed));return _0x5489be['id']=_0x2d6be5,ensureJourneyDefaults(_0x5489be['attributes']),resolvePendingIdsInRequest(_0x5489be,_0xf2fbed,_0x4aa9dd,_0x54193b,_0x4424a4,_0x1d183d),await _0x26384b[_0x251d45(0x182)]['update'](_0x2d6be5,_0x5489be),{'action':_0x251d45(0x1be),'journeyId':_0x2d6be5,'embeddedSegmentNameToId':_0x54193b};}function stripPendingIds(_0x46ed52){const _0x48e07c=a100_0x25feef;for(const _0x1e1cef of _0x46ed52['attributes'][_0x48e07c(0x193)]||[]){_0x1e1cef[_0x48e07c(0x1bc)]?.[_0x48e07c(0x145)]&&isPendingSegmentId(_0x1e1cef[_0x48e07c(0x1bc)][_0x48e07c(0x145)])&&delete _0x1e1cef[_0x48e07c(0x1bc)];if(_0x1e1cef['steps'])for(const _0x238c68 of Object[_0x48e07c(0xf3)](_0x1e1cef[_0x48e07c(0x108)])){const _0x1be8a3=_0x1e1cef[_0x48e07c(0x108)][_0x238c68];_0x1be8a3[_0x48e07c(0x176)]===_0x48e07c(0x174)&&_0x1be8a3[_0x48e07c(0x146)]&&isPendingActivationId(_0x1be8a3[_0x48e07c(0x146)])&&(_0x1be8a3['journeyActivationStepId']='');if(_0x1be8a3['type']===_0x48e07c(0x17c)&&_0x1be8a3[_0x48e07c(0x1a6)])for(const _0x3a68e5 of _0x1be8a3['branches']){_0x3a68e5[_0x48e07c(0x145)]&&isPendingSegmentId(_0x3a68e5[_0x48e07c(0x145)])&&(_0x3a68e5[_0x48e07c(0x145)]='');}_0x1be8a3[_0x48e07c(0x176)]==='WaitStep'&&_0x1be8a3[_0x48e07c(0x165)]?.[_0x48e07c(0x145)]&&isPendingSegmentId(_0x1be8a3[_0x48e07c(0x165)]['segmentId'])&&(_0x1be8a3[_0x48e07c(0x165)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x205a87,_0x50adad,_0x48f9df,_0x2d8df1,_0x225cf0,_0x44685f){const _0x247f80=a100_0x25feef,_0xdc9029=(_0x3eee4a,_0x3425cd)=>{const _0x33b1d1=a100_0x386c;if(!isPendingSegmentId(_0x3eee4a))return _0x3eee4a;const _0x364c57=extractPendingSegmentName(_0x3eee4a),_0x846f89=_0x2d8df1[_0x33b1d1(0x10c)](_0x364c57);return!_0x846f89&&_0x44685f['logWarning']?.(_0x33b1d1(0x17e)+_0x364c57+_0x33b1d1(0x166)+_0x3425cd),_0x846f89;};if(_0x205a87[_0x247f80(0x144)]['goal']?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x205a87['attributes']['goal'][_0x247f80(0x145)])){const _0x43bd40=_0xdc9029(_0x205a87[_0x247f80(0x144)]['goal'][_0x247f80(0x145)],'goal\x20criteria');_0x43bd40&&(_0x205a87[_0x247f80(0x144)][_0x247f80(0x19c)][_0x247f80(0x145)]=_0x43bd40);}for(const _0x24b721 of _0x205a87[_0x247f80(0x144)][_0x247f80(0x193)]||[]){const _0x17352c=_0x48f9df[_0x247f80(0x10c)](_0x24b721[_0x247f80(0x14f)][_0x247f80(0x184)]());_0x17352c&&(_0x24b721['id']=_0x17352c);if(_0x24b721[_0x247f80(0x1bc)]?.['segmentId']&&isPendingSegmentId(_0x24b721[_0x247f80(0x1bc)][_0x247f80(0x145)])){const _0x15aa1d=_0xdc9029(_0x24b721[_0x247f80(0x1bc)][_0x247f80(0x145)],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+'\x27\x20entry\x20criteria');_0x15aa1d&&(_0x24b721[_0x247f80(0x1bc)][_0x247f80(0x145)]=_0x15aa1d);}if(_0x24b721[_0x247f80(0x1a3)])for(const _0x1a8afa of _0x24b721[_0x247f80(0x1a3)]){if(_0x1a8afa['segmentId']&&isPendingSegmentId(_0x1a8afa['segmentId'])){const _0x1a74ce=_0xdc9029(_0x1a8afa['segmentId'],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+_0x247f80(0x128));_0x1a74ce&&(_0x1a8afa[_0x247f80(0x145)]=_0x1a74ce);}}if(_0x24b721[_0x247f80(0x1c1)]?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x24b721['milestone'][_0x247f80(0x145)])){const _0x299ac4=_0xdc9029(_0x24b721[_0x247f80(0x1c1)]['segmentId'],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+'\x27\x20milestone');_0x299ac4&&(_0x24b721[_0x247f80(0x1c1)][_0x247f80(0x145)]=_0x299ac4);}if(_0x24b721[_0x247f80(0x108)]){const _0x55941a=_0x13a993=>_0x50adad[_0x247f80(0x144)][_0x247f80(0x193)][_0x247f80(0x1d0)](_0x372ad7=>_0x372ad7[_0x247f80(0x14f)][_0x247f80(0x184)]()===_0x24b721[_0x247f80(0x14f)][_0x247f80(0x184)]())?.[_0x247f80(0x108)]?.[_0x13a993];for(const _0x8824b6 of Object[_0x247f80(0xf3)](_0x24b721['steps'])){const _0x322845=_0x24b721[_0x247f80(0x108)][_0x8824b6],_0x4dc8bc=_0x55941a(_0x8824b6);if(_0x322845['type']===_0x247f80(0x174)&&_0x322845['journeyActivationStepId']&&(isPendingActivationId(_0x322845[_0x247f80(0x146)])||_0x322845[_0x247f80(0x146)]==='')){if(_0x4dc8bc?.[_0x247f80(0x146)]&&isPendingActivationId(_0x4dc8bc['journeyActivationStepId'])){const _0x47301b=extractPendingActivationName(_0x4dc8bc[_0x247f80(0x146)]),_0x391e1f=_0x225cf0[_0x247f80(0x10c)](_0x47301b);_0x391e1f&&(_0x322845[_0x247f80(0x146)]=_0x391e1f);}}if(_0x322845[_0x247f80(0x176)]==='DecisionPoint'&&_0x322845['branches']&&_0x4dc8bc?.[_0x247f80(0x1a6)])for(let _0xe03e7=0x0;_0xe03e7<_0x322845['branches'][_0x247f80(0x11f)];_0xe03e7++){const _0x44d8cc=_0x322845[_0x247f80(0x1a6)][_0xe03e7],_0x1dbe39=_0x4dc8bc['branches'][_0xe03e7];if(_0x1dbe39?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x1dbe39[_0x247f80(0x145)])){const _0x193a56=_0xdc9029(_0x1dbe39[_0x247f80(0x145)],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+_0x247f80(0x116)+(_0x44d8cc['name']||_0xe03e7)+'\x27');_0x193a56&&(_0x44d8cc['segmentId']=_0x193a56);}}if(_0x322845[_0x247f80(0x176)]===_0x247f80(0x11e)&&_0x322845[_0x247f80(0x165)]?.[_0x247f80(0x145)]&&_0x4dc8bc?.[_0x247f80(0x165)]?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x4dc8bc[_0x247f80(0x165)][_0x247f80(0x145)])){const _0x56cb26=_0xdc9029(_0x4dc8bc['waitCondition']['segmentId'],'stage\x20\x27'+_0x24b721[_0x247f80(0x14f)]+_0x247f80(0x13c));_0x56cb26&&(_0x322845[_0x247f80(0x165)]['segmentId']=_0x56cb26);}}}}}
@@ -1 +1 @@
1
- function a99_0x28fb(){const _0x2d2ca5=['has','5146839HaNcdJ','2729065LgkQAQ','set','parentFolderId','get','1300520QQICym','8996160EfFkyz','756ETTtQD','name','10199wTxNGc','2658759jxvANV','30oVkzjc','6eLTFeE','87719mnCkwt','add'];a99_0x28fb=function(){return _0x2d2ca5;};return a99_0x28fb();}(function(_0x188d0a,_0x34f667){const _0x265349=a99_0x2533,_0x26d911=_0x188d0a();while(!![]){try{const _0x4d6bb1=parseInt(_0x265349(0x98))/0x1*(parseInt(_0x265349(0x97))/0x2)+parseInt(_0x265349(0x95))/0x3+-parseInt(_0x265349(0xa0))/0x4+parseInt(_0x265349(0x9c))/0x5+parseInt(_0x265349(0x92))/0x6*(-parseInt(_0x265349(0x94))/0x7)+parseInt(_0x265349(0xa1))/0x8+-parseInt(_0x265349(0x9b))/0x9*(parseInt(_0x265349(0x96))/0xa);if(_0x4d6bb1===_0x34f667)break;else _0x26d911['push'](_0x26d911['shift']());}catch(_0x4ff742){_0x26d911['push'](_0x26d911['shift']());}}}(a99_0x28fb,0x915da));function a99_0x2533(_0x452039,_0x4a6c5b){_0x452039=_0x452039-0x92;const _0x28fbc7=a99_0x28fb();let _0x2533ca=_0x28fbc7[_0x452039];return _0x2533ca;}export function buildFolderIdToPathMap(_0x2a4564){const _0x371847=a99_0x2533,_0x312c85=new Map(),_0x4ebbca=new Map();for(const _0x420501 of _0x2a4564){_0x4ebbca[_0x371847(0x9d)](_0x420501['id'],_0x420501);}const _0x5b9dbc=new Set();for(const _0x59f0ac of _0x2a4564){!_0x59f0ac['parentFolderId']&&_0x5b9dbc['add'](_0x59f0ac['id']);}function _0x4f5721(_0x2a15a3){const _0x134f99=_0x371847;if(_0x312c85[_0x134f99(0x9a)](_0x2a15a3['id']))return _0x312c85[_0x134f99(0x9f)](_0x2a15a3['id']);if(_0x5b9dbc[_0x134f99(0x9a)](_0x2a15a3['id']))return _0x312c85[_0x134f99(0x9d)](_0x2a15a3['id'],''),'';if(_0x2a15a3['parentFolderId']){const _0x1f1461=_0x4ebbca[_0x134f99(0x9f)](_0x2a15a3[_0x134f99(0x9e)]);if(_0x1f1461){const _0x476fce=_0x4f5721(_0x1f1461),_0x15fbf6=_0x476fce?_0x476fce+'/'+_0x2a15a3['name']:_0x2a15a3[_0x134f99(0x93)];return _0x312c85[_0x134f99(0x9d)](_0x2a15a3['id'],_0x15fbf6),_0x15fbf6;}}const _0x38f9a6=_0x2a15a3[_0x134f99(0x93)];return _0x312c85[_0x134f99(0x9d)](_0x2a15a3['id'],_0x38f9a6),_0x38f9a6;}for(const _0x5ace50 of _0x2a4564){_0x4f5721(_0x5ace50);}return _0x312c85;}export function buildFolderPathToIdMap(_0x1768aa){const _0x4d7664=a99_0x2533,_0x9a24b0=new Map(),_0x13c647=new Map();for(const _0x7ea310 of _0x1768aa){_0x13c647[_0x4d7664(0x9d)](_0x7ea310['id'],_0x7ea310);}const _0x1061ea=new Set();for(const _0x3fc49b of _0x1768aa){!_0x3fc49b['parentFolderId']&&_0x1061ea[_0x4d7664(0x99)](_0x3fc49b['id']);}function _0x42e876(_0x447af5){const _0x4d0055=_0x4d7664;if(_0x1061ea[_0x4d0055(0x9a)](_0x447af5['id']))return'';if(_0x447af5[_0x4d0055(0x9e)]){const _0x49ef85=_0x13c647['get'](_0x447af5[_0x4d0055(0x9e)]);if(_0x49ef85){const _0x3eb2f7=_0x42e876(_0x49ef85);return _0x3eb2f7?_0x3eb2f7+'/'+_0x447af5[_0x4d0055(0x93)]:_0x447af5[_0x4d0055(0x93)];}}return _0x447af5[_0x4d0055(0x93)];}for(const _0x2f59ad of _0x1768aa){const _0x469763=_0x42e876(_0x2f59ad);_0x9a24b0[_0x4d7664(0x9d)](_0x469763,_0x2f59ad['id']);}return _0x9a24b0;}export function buildFolderMaps(_0x2a7699){const _0x1c8791=a99_0x2533,_0x4cac96=buildFolderIdToPathMap(_0x2a7699),_0x299d26=new Map();for(const [_0x3b1e66,_0x1d218b]of _0x4cac96){_0x299d26[_0x1c8791(0x9d)](_0x1d218b,_0x3b1e66);}return{'idToPath':_0x4cac96,'pathToId':_0x299d26};}export function getFolderPath(_0x107378,_0x16c1bb){const _0x4465eb=a99_0x2533;if(!_0x107378)return'';return _0x16c1bb[_0x4465eb(0x9f)](_0x107378)??'';}
1
+ (function(_0x372593,_0x2e3106){const _0x4c76a8=a101_0x3e27,_0x294a1f=_0x372593();while(!![]){try{const _0x32d02b=parseInt(_0x4c76a8(0x118))/0x1+-parseInt(_0x4c76a8(0x126))/0x2+-parseInt(_0x4c76a8(0x122))/0x3+parseInt(_0x4c76a8(0x11b))/0x4*(parseInt(_0x4c76a8(0x11e))/0x5)+-parseInt(_0x4c76a8(0x123))/0x6*(-parseInt(_0x4c76a8(0x124))/0x7)+parseInt(_0x4c76a8(0x119))/0x8+-parseInt(_0x4c76a8(0x121))/0x9*(parseInt(_0x4c76a8(0x11d))/0xa);if(_0x32d02b===_0x2e3106)break;else _0x294a1f['push'](_0x294a1f['shift']());}catch(_0x225d9c){_0x294a1f['push'](_0x294a1f['shift']());}}}(a101_0x472b,0x8baf9));function a101_0x472b(){const _0x90c4a4=['1574470NcAfAB','parentFolderId','1117012aIrozM','2509936eDhFhq','get','1468cxyppN','set','809260mHHGBr','4475LgoUKv','name','has','45cVZFUE','3009393WGWavy','12342kDQKgA','3430cpoBtc','add'];a101_0x472b=function(){return _0x90c4a4;};return a101_0x472b();}export function buildFolderIdToPathMap(_0x3f7cd5){const _0x145e2f=a101_0x3e27,_0x9da250=new Map(),_0x4cc3a3=new Map();for(const _0xd68099 of _0x3f7cd5){_0x4cc3a3[_0x145e2f(0x11c)](_0xd68099['id'],_0xd68099);}const _0x5e0c9e=new Set();for(const _0x37ddda of _0x3f7cd5){!_0x37ddda['parentFolderId']&&_0x5e0c9e[_0x145e2f(0x125)](_0x37ddda['id']);}function _0x863281(_0x191cc9){const _0x8c1c11=_0x145e2f;if(_0x9da250[_0x8c1c11(0x120)](_0x191cc9['id']))return _0x9da250[_0x8c1c11(0x11a)](_0x191cc9['id']);if(_0x5e0c9e[_0x8c1c11(0x120)](_0x191cc9['id']))return _0x9da250[_0x8c1c11(0x11c)](_0x191cc9['id'],''),'';if(_0x191cc9['parentFolderId']){const _0x2fea4b=_0x4cc3a3['get'](_0x191cc9['parentFolderId']);if(_0x2fea4b){const _0x4a799f=_0x863281(_0x2fea4b),_0x1ed406=_0x4a799f?_0x4a799f+'/'+_0x191cc9['name']:_0x191cc9[_0x8c1c11(0x11f)];return _0x9da250[_0x8c1c11(0x11c)](_0x191cc9['id'],_0x1ed406),_0x1ed406;}}const _0x493600=_0x191cc9[_0x8c1c11(0x11f)];return _0x9da250[_0x8c1c11(0x11c)](_0x191cc9['id'],_0x493600),_0x493600;}for(const _0x206157 of _0x3f7cd5){_0x863281(_0x206157);}return _0x9da250;}export function buildFolderPathToIdMap(_0x1f509d){const _0x2b5085=a101_0x3e27,_0x3b20d7=new Map(),_0x3bdce0=new Map();for(const _0x456e99 of _0x1f509d){_0x3bdce0[_0x2b5085(0x11c)](_0x456e99['id'],_0x456e99);}const _0x1b1049=new Set();for(const _0x58d9d3 of _0x1f509d){!_0x58d9d3['parentFolderId']&&_0x1b1049['add'](_0x58d9d3['id']);}function _0x167a29(_0x24a830){const _0xcba426=_0x2b5085;if(_0x1b1049[_0xcba426(0x120)](_0x24a830['id']))return'';if(_0x24a830['parentFolderId']){const _0x85971=_0x3bdce0[_0xcba426(0x11a)](_0x24a830[_0xcba426(0x117)]);if(_0x85971){const _0x533a31=_0x167a29(_0x85971);return _0x533a31?_0x533a31+'/'+_0x24a830[_0xcba426(0x11f)]:_0x24a830[_0xcba426(0x11f)];}}return _0x24a830[_0xcba426(0x11f)];}for(const _0x2b2356 of _0x1f509d){const _0x37ca2b=_0x167a29(_0x2b2356);_0x3b20d7[_0x2b5085(0x11c)](_0x37ca2b,_0x2b2356['id']);}return _0x3b20d7;}function a101_0x3e27(_0x238694,_0x508a04){_0x238694=_0x238694-0x117;const _0x472bc3=a101_0x472b();let _0x3e27ff=_0x472bc3[_0x238694];return _0x3e27ff;}export function buildFolderMaps(_0x3323cf){const _0x13de85=a101_0x3e27,_0x576777=buildFolderIdToPathMap(_0x3323cf),_0x71fda4=new Map();for(const [_0x37e79e,_0x1ab03f]of _0x576777){_0x71fda4[_0x13de85(0x11c)](_0x1ab03f,_0x37e79e);}return{'idToPath':_0x576777,'pathToId':_0x71fda4};}export function getFolderPath(_0x23f595,_0xf05700){const _0x5685bf=a101_0x3e27;if(!_0x23f595)return'';return _0xf05700[_0x5685bf(0x11a)](_0x23f595)??'';}
@@ -1 +1 @@
1
- (function(_0xebc0ea,_0x2069c2){const _0x1a41c8=a100_0x3484,_0x17defd=_0xebc0ea();while(!![]){try{const _0x277e4a=parseInt(_0x1a41c8(0x16c))/0x1*(parseInt(_0x1a41c8(0x156))/0x2)+parseInt(_0x1a41c8(0x16e))/0x3+-parseInt(_0x1a41c8(0x15f))/0x4+parseInt(_0x1a41c8(0x150))/0x5*(parseInt(_0x1a41c8(0x15a))/0x6)+parseInt(_0x1a41c8(0x175))/0x7+parseInt(_0x1a41c8(0x154))/0x8*(parseInt(_0x1a41c8(0x15b))/0x9)+-parseInt(_0x1a41c8(0x153))/0xa;if(_0x277e4a===_0x2069c2)break;else _0x17defd['push'](_0x17defd['shift']());}catch(_0x1b90d8){_0x17defd['push'](_0x17defd['shift']());}}}(a100_0x234e,0x996f5));import a100_0x243d01 from'path';import{parse as a100_0x2a554a}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x55b482){const _0x473cd8=a100_0x3484;if(!_0x55b482||_0x55b482[_0x473cd8(0x165)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x2d4905=_0x55b482[_0x473cd8(0x165)]();if(_0x2d4905==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x55b482};const _0x4c6ca0=_0x2d4905['startsWith']('/')?_0x2d4905['substring'](0x1):_0x2d4905,_0x35793a=_0x4c6ca0[_0x473cd8(0x151)]('/')[_0x473cd8(0x171)](_0x3068e5=>_0x3068e5!=='');if(_0x35793a[_0x473cd8(0x164)]===0x0)throw new Error(_0x473cd8(0x167));const _0x3929e8=_0x2d4905[_0x473cd8(0x157)]('/')||!isRelativePathSegment(_0x35793a[0x0]);for(const _0xc0157c of _0x35793a){validatePathSegment(_0xc0157c);}return{'segments':_0x35793a,'isAbsolute':_0x3929e8,'raw':_0x55b482};}function isRelativePathSegment(_0x36782){return _0x36782==='.'||_0x36782==='..';}function validatePathSegment(_0x451d91){const _0x1f21f8=a100_0x3484;if(_0x451d91==='')throw new Error(_0x1f21f8(0x174));if(_0x451d91==='.'||_0x451d91==='..')return;if(/[\x00-\x1F\x7F]/[_0x1f21f8(0x166)](_0x451d91))throw new Error(_0x1f21f8(0x162)+_0x451d91);if(_0x451d91!==_0x451d91[_0x1f21f8(0x165)]()){}}export function validatePath(_0x151f4f){const _0x479124=a100_0x3484;if(_0x151f4f[_0x479124(0x163)][_0x479124(0x164)]===0x0&&!_0x151f4f['isAbsolute'])throw new Error(_0x479124(0x15d));if(_0x151f4f['isAbsolute']){if(_0x151f4f['segments'][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x50e7d6=0x0;for(const _0x14a0db of _0x151f4f[_0x479124(0x163)]){if(_0x14a0db==='..'){if(_0x50e7d6===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x50e7d6--;}else _0x14a0db!=='.'&&_0x50e7d6++;}}}export function joinPaths(_0x3a7176,_0x4a965b){const _0x536bb9=a100_0x3484;if(!_0x3a7176||_0x3a7176==='/')return _0x4a965b;if(!_0x4a965b||_0x4a965b==='.')return _0x3a7176;if(_0x4a965b[_0x536bb9(0x157)]('/'))return _0x4a965b;const _0x2cdf6f=parsePath(_0x3a7176),_0x458475=parsePath(_0x4a965b),_0x5b659f=[..._0x2cdf6f[_0x536bb9(0x163)]];for(const _0x102d1b of _0x458475[_0x536bb9(0x163)]){if(_0x102d1b==='.')continue;else{if(_0x102d1b==='..'){if(_0x5b659f[_0x536bb9(0x164)]===0x0)throw new Error(_0x536bb9(0x15c));_0x5b659f['pop']();}else _0x5b659f[_0x536bb9(0x16b)](_0x102d1b);}}const _0x1c9191=_0x5b659f[_0x536bb9(0x179)]('/');return _0x2cdf6f[_0x536bb9(0x176)][_0x536bb9(0x157)]('/')?'/'+_0x1c9191:_0x1c9191;}export function normalizePath(_0x4d7a8a){const _0x3c2b8d=a100_0x3484,_0x34c7b9=parsePath(_0x4d7a8a),_0x423787=[];for(const _0x3dd2ac of _0x34c7b9[_0x3c2b8d(0x163)]){if(_0x3dd2ac==='.')continue;else{if(_0x3dd2ac==='..'){if(_0x423787[_0x3c2b8d(0x164)]===0x0){if(_0x34c7b9[_0x3c2b8d(0x161)])throw new Error(_0x3c2b8d(0x15c));_0x423787[_0x3c2b8d(0x16b)]('..');}else _0x423787[_0x423787[_0x3c2b8d(0x164)]-0x1]==='..'?_0x423787[_0x3c2b8d(0x16b)]('..'):_0x423787['pop']();}else _0x423787[_0x3c2b8d(0x16b)](_0x3dd2ac);}}if(_0x423787['length']===0x0)return _0x34c7b9[_0x3c2b8d(0x161)]?'/':'.';const _0x284dc3=_0x423787[_0x3c2b8d(0x179)]('/');return _0x34c7b9['raw'][_0x3c2b8d(0x157)]('/')?'/'+_0x284dc3:_0x284dc3;}export function getParentPath(_0x9e8715){const _0x5e5242=a100_0x3484,_0xb3a3c=parsePath(_0x9e8715);if(_0xb3a3c[_0x5e5242(0x163)]['length']<=0x1)return'/';const _0x5c7d6f=_0xb3a3c['segments']['slice'](0x0,-0x1)[_0x5e5242(0x179)]('/');return _0xb3a3c[_0x5e5242(0x176)]['startsWith']('/')?'/'+_0x5c7d6f:_0x5c7d6f;}export function getBaseName(_0x1e00d9){const _0x877bc0=a100_0x3484,_0x4be63d=parsePath(_0x1e00d9);return _0x4be63d[_0x877bc0(0x163)][_0x4be63d[_0x877bc0(0x163)][_0x877bc0(0x164)]-0x1]||'';}export function isChildPath(_0x1ee773,_0x2196ca){const _0x294e5a=a100_0x3484,_0x2809e5=parsePath(_0x1ee773),_0x5d9b8e=parsePath(_0x2196ca);if(_0x2809e5[_0x294e5a(0x163)]['length']<=_0x5d9b8e['segments'][_0x294e5a(0x164)])return![];for(let _0x3d728b=0x0;_0x3d728b<_0x5d9b8e[_0x294e5a(0x163)][_0x294e5a(0x164)];_0x3d728b++){if(_0x2809e5[_0x294e5a(0x163)][_0x3d728b]!==_0x5d9b8e[_0x294e5a(0x163)][_0x3d728b])return![];}return!![];}export function splitPath(_0x129890){const _0x4430a3=a100_0x3484,_0x5664e4=parsePath(_0x129890);if(_0x5664e4['segments'][_0x4430a3(0x164)]===0x0)throw new Error(_0x4430a3(0x16d));if(_0x5664e4[_0x4430a3(0x163)][_0x4430a3(0x164)]===0x1)return{'parent':_0x5664e4[_0x4430a3(0x163)][0x0]};return{'parent':_0x5664e4['segments'][0x0],'child':_0x5664e4[_0x4430a3(0x163)][_0x4430a3(0x160)](0x1)['join']('/')};}export function isYamlFilePath(_0x54e5dc){const _0x145bc0=a100_0x3484;return _0x54e5dc[_0x145bc0(0x177)](_0x145bc0(0x168))||_0x54e5dc[_0x145bc0(0x177)](_0x145bc0(0x14e));}function a100_0x3484(_0x57a03c,_0x15b505){_0x57a03c=_0x57a03c-0x14e;const _0x234e1d=a100_0x234e();let _0x348404=_0x234e1d[_0x57a03c];return _0x348404;}export async function resolveYamlFilePath(_0x17a05a,_0x4ad1a3=nodeFileSystem){const _0x50b455=a100_0x3484,_0x570863=a100_0x243d01[_0x50b455(0x172)](_0x17a05a);if(!await _0x4ad1a3[_0x50b455(0x169)](_0x570863))throw new Error(_0x50b455(0x17a)+_0x17a05a);let _0x23c962=a100_0x243d01['dirname'](_0x570863),_0x354da7=null,_0x58d914=null;const _0x2bd5f7=a100_0x243d01[_0x50b455(0x16f)](_0x23c962)['root'];while(_0x23c962!==_0x2bd5f7){const _0x4cae2f=a100_0x243d01[_0x50b455(0x179)](_0x23c962,_0x50b455(0x16a));if(await _0x4ad1a3[_0x50b455(0x169)](_0x4cae2f)){_0x354da7=_0x4cae2f,_0x58d914=_0x23c962;break;}_0x23c962=a100_0x243d01['dirname'](_0x23c962);}if(!_0x354da7||!_0x58d914)throw new Error(_0x50b455(0x155)+_0x17a05a);const _0x2b6eff=await _0x4ad1a3[_0x50b455(0x159)](_0x354da7),_0x1ba647=JSON[_0x50b455(0x16f)](_0x2b6eff),_0x68a374=_0x1ba647[_0x50b455(0x17d)];if(!_0x68a374)throw new Error(_0x50b455(0x170));const _0x576086=await _0x4ad1a3[_0x50b455(0x159)](_0x570863),_0x11a92c=a100_0x2a554a(_0x576086),_0x95e1f5=_0x11a92c[_0x50b455(0x17b)];if(!_0x95e1f5)throw new Error(_0x50b455(0x158)+_0x17a05a);const _0x490e15=_0x11a92c[_0x50b455(0x15e)]===_0x50b455(0x152)?_0x50b455(0x152):_0x50b455(0x14f),_0x587da6=a100_0x243d01[_0x50b455(0x17c)](_0x58d914,_0x570863),_0x39ca8f=a100_0x243d01[_0x50b455(0x173)](_0x587da6),_0x342851=_0x39ca8f==='.'?'':_0x39ca8f[_0x50b455(0x178)](/\\/g,'/'),_0x13772e=_0x342851?_0x68a374+'/'+_0x342851+'/'+_0x95e1f5:_0x68a374+'/'+_0x95e1f5;return{'parentSegment':_0x68a374,'segmentName':_0x95e1f5,'folderPath':_0x342851,'fullPath':_0x13772e,'resourceType':_0x490e15};}function a100_0x234e(){const _0x32c2c4=['parse','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','filter','resolve','dirname','Path\x20segment\x20cannot\x20be\x20empty','8183021JDPPhL','raw','endsWith','replace','join','File\x20not\x20found:\x20','name','relative','parent_segment','.yaml','segment','25CVPMWV','split','journey','24497920wldPQI','8OOPymR','No\x20tdx.json\x20found\x20for\x20file:\x20','1385558fRWlwl','startsWith','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','readFile','261930IwdxAJ','1766511xfGjNB','Cannot\x20navigate\x20above\x20root','Relative\x20path\x20cannot\x20be\x20empty','type','790772HWfPuA','slice','isAbsolute','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','segments','length','trim','test','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','.yml','exists','tdx.json','push','1YxsgEA','Cannot\x20split\x20empty\x20path','2998854mKmMDf'];a100_0x234e=function(){return _0x32c2c4;};return a100_0x234e();}
1
+ function a102_0x2862(_0x2e8be9,_0x5845ea){_0x2e8be9=_0x2e8be9-0x1e2;const _0x14de2d=a102_0x14de();let _0x28620f=_0x14de2d[_0x2e8be9];return _0x28620f;}function a102_0x14de(){const _0x49b8d0=['.yml','split','segments','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','1821515ouekcc','test','trim','File\x20not\x20found:\x20','startsWith','exists','raw','122454CsJfHJ','endsWith','name','3326jzNDox','journey','Relative\x20path\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','parent_segment','130ZnwNTo','dirname','type','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','pop','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','readFile','1033602TVIMre','4029040FANioy','push','join','977123sqyIAt','parse','No\x20tdx.json\x20found\x20for\x20file:\x20','length','18vgjkym','isAbsolute','4MPQSTD','substring','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','slice','relative','6295124sbfMhW','144UGYqsV','resolve','Cannot\x20split\x20empty\x20path','tdx.json','segment'];a102_0x14de=function(){return _0x49b8d0;};return a102_0x14de();}(function(_0x38a6a1,_0x556e00){const _0x22940a=a102_0x2862,_0x1ddc5d=_0x38a6a1();while(!![]){try{const _0x403a87=-parseInt(_0x22940a(0x1e3))/0x1*(parseInt(_0x22940a(0x20d))/0x2)+parseInt(_0x22940a(0x1ea))/0x3+parseInt(_0x22940a(0x1f4))/0x4*(-parseInt(_0x22940a(0x203))/0x5)+-parseInt(_0x22940a(0x1f2))/0x6*(-parseInt(_0x22940a(0x1ee))/0x7)+parseInt(_0x22940a(0x1fa))/0x8*(parseInt(_0x22940a(0x20a))/0x9)+parseInt(_0x22940a(0x1eb))/0xa+-parseInt(_0x22940a(0x1f9))/0xb;if(_0x403a87===_0x556e00)break;else _0x1ddc5d['push'](_0x1ddc5d['shift']());}catch(_0x22caaa){_0x1ddc5d['push'](_0x1ddc5d['shift']());}}}(a102_0x14de,0x3f120));import a102_0x4bf119 from'path';import{parse as a102_0x159e68}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0xfeac8e){const _0x1d642b=a102_0x2862;if(!_0xfeac8e||_0xfeac8e[_0x1d642b(0x205)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x4932f1=_0xfeac8e[_0x1d642b(0x205)]();if(_0x4932f1==='/')return{'segments':[],'isAbsolute':!![],'raw':_0xfeac8e};const _0x2591c8=_0x4932f1[_0x1d642b(0x207)]('/')?_0x4932f1[_0x1d642b(0x1f5)](0x1):_0x4932f1,_0x2a8fbe=_0x2591c8[_0x1d642b(0x200)]('/')['filter'](_0x5e8a15=>_0x5e8a15!=='');if(_0x2a8fbe[_0x1d642b(0x1f1)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x18ccf5=_0x4932f1[_0x1d642b(0x207)]('/')||!isRelativePathSegment(_0x2a8fbe[0x0]);for(const _0x5a9b67 of _0x2a8fbe){validatePathSegment(_0x5a9b67);}return{'segments':_0x2a8fbe,'isAbsolute':_0x18ccf5,'raw':_0xfeac8e};}function isRelativePathSegment(_0x211d24){return _0x211d24==='.'||_0x211d24==='..';}function validatePathSegment(_0x9aaeeb){const _0x298c3b=a102_0x2862;if(_0x9aaeeb==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x9aaeeb==='.'||_0x9aaeeb==='..')return;if(/[\x00-\x1F\x7F]/[_0x298c3b(0x204)](_0x9aaeeb))throw new Error(_0x298c3b(0x1f6)+_0x9aaeeb);if(_0x9aaeeb!==_0x9aaeeb[_0x298c3b(0x205)]()){}}export function validatePath(_0x156a18){const _0x1e42d2=a102_0x2862;if(_0x156a18[_0x1e42d2(0x201)][_0x1e42d2(0x1f1)]===0x0&&!_0x156a18[_0x1e42d2(0x1f3)])throw new Error(_0x1e42d2(0x20f));if(_0x156a18['isAbsolute']){if(_0x156a18[_0x1e42d2(0x201)][0x0]==='..')throw new Error(_0x1e42d2(0x202));let _0xa1f8c4=0x0;for(const _0x5821f0 of _0x156a18[_0x1e42d2(0x201)]){if(_0x5821f0==='..'){if(_0xa1f8c4===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0xa1f8c4--;}else _0x5821f0!=='.'&&_0xa1f8c4++;}}}export function joinPaths(_0x371a8b,_0x5d387e){const _0x36fa3f=a102_0x2862;if(!_0x371a8b||_0x371a8b==='/')return _0x5d387e;if(!_0x5d387e||_0x5d387e==='.')return _0x371a8b;if(_0x5d387e[_0x36fa3f(0x207)]('/'))return _0x5d387e;const _0xcb4f99=parsePath(_0x371a8b),_0x53fdf9=parsePath(_0x5d387e),_0x27c780=[..._0xcb4f99[_0x36fa3f(0x201)]];for(const _0x15e73b of _0x53fdf9[_0x36fa3f(0x201)]){if(_0x15e73b==='.')continue;else{if(_0x15e73b==='..'){if(_0x27c780[_0x36fa3f(0x1f1)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x27c780[_0x36fa3f(0x1e7)]();}else _0x27c780[_0x36fa3f(0x1ec)](_0x15e73b);}}const _0x5a6c20=_0x27c780[_0x36fa3f(0x1ed)]('/');return _0xcb4f99[_0x36fa3f(0x209)]['startsWith']('/')?'/'+_0x5a6c20:_0x5a6c20;}export function normalizePath(_0xffabdf){const _0x2a25a5=a102_0x2862,_0x5ccd65=parsePath(_0xffabdf),_0x21d310=[];for(const _0x476144 of _0x5ccd65[_0x2a25a5(0x201)]){if(_0x476144==='.')continue;else{if(_0x476144==='..'){if(_0x21d310['length']===0x0){if(_0x5ccd65[_0x2a25a5(0x1f3)])throw new Error(_0x2a25a5(0x210));_0x21d310[_0x2a25a5(0x1ec)]('..');}else _0x21d310[_0x21d310[_0x2a25a5(0x1f1)]-0x1]==='..'?_0x21d310['push']('..'):_0x21d310[_0x2a25a5(0x1e7)]();}else _0x21d310[_0x2a25a5(0x1ec)](_0x476144);}}if(_0x21d310[_0x2a25a5(0x1f1)]===0x0)return _0x5ccd65[_0x2a25a5(0x1f3)]?'/':'.';const _0x4c9368=_0x21d310[_0x2a25a5(0x1ed)]('/');return _0x5ccd65[_0x2a25a5(0x209)]['startsWith']('/')?'/'+_0x4c9368:_0x4c9368;}export function getParentPath(_0x49a57a){const _0x505b99=a102_0x2862,_0x5ba633=parsePath(_0x49a57a);if(_0x5ba633['segments']['length']<=0x1)return'/';const _0x9f1b2a=_0x5ba633['segments'][_0x505b99(0x1f7)](0x0,-0x1)[_0x505b99(0x1ed)]('/');return _0x5ba633[_0x505b99(0x209)]['startsWith']('/')?'/'+_0x9f1b2a:_0x9f1b2a;}export function getBaseName(_0x5bdd9c){const _0x1ca84d=a102_0x2862,_0xabf7cf=parsePath(_0x5bdd9c);return _0xabf7cf[_0x1ca84d(0x201)][_0xabf7cf['segments'][_0x1ca84d(0x1f1)]-0x1]||'';}export function isChildPath(_0x3199ef,_0x3906e5){const _0x135be9=a102_0x2862,_0x20cf7d=parsePath(_0x3199ef),_0x57b5ad=parsePath(_0x3906e5);if(_0x20cf7d['segments'][_0x135be9(0x1f1)]<=_0x57b5ad[_0x135be9(0x201)][_0x135be9(0x1f1)])return![];for(let _0x1da0a6=0x0;_0x1da0a6<_0x57b5ad[_0x135be9(0x201)][_0x135be9(0x1f1)];_0x1da0a6++){if(_0x20cf7d['segments'][_0x1da0a6]!==_0x57b5ad['segments'][_0x1da0a6])return![];}return!![];}export function splitPath(_0x711321){const _0xefc985=a102_0x2862,_0x2ad63d=parsePath(_0x711321);if(_0x2ad63d['segments'][_0xefc985(0x1f1)]===0x0)throw new Error(_0xefc985(0x1fc));if(_0x2ad63d[_0xefc985(0x201)][_0xefc985(0x1f1)]===0x1)return{'parent':_0x2ad63d[_0xefc985(0x201)][0x0]};return{'parent':_0x2ad63d['segments'][0x0],'child':_0x2ad63d['segments']['slice'](0x1)['join']('/')};}export function isYamlFilePath(_0x51bda9){const _0x5dd84f=a102_0x2862;return _0x51bda9[_0x5dd84f(0x20b)](_0x5dd84f(0x1ff))||_0x51bda9['endsWith']('.yaml');}export async function resolveYamlFilePath(_0x2aac25,_0x474100=nodeFileSystem){const _0x592c07=a102_0x2862,_0x3e5f4a=a102_0x4bf119[_0x592c07(0x1fb)](_0x2aac25);if(!await _0x474100['exists'](_0x3e5f4a))throw new Error(_0x592c07(0x206)+_0x2aac25);let _0x2f406d=a102_0x4bf119[_0x592c07(0x1e4)](_0x3e5f4a),_0x43032a=null,_0x263d8b=null;const _0x10f771=a102_0x4bf119[_0x592c07(0x1ef)](_0x2f406d)['root'];while(_0x2f406d!==_0x10f771){const _0x5f49c2=a102_0x4bf119[_0x592c07(0x1ed)](_0x2f406d,_0x592c07(0x1fd));if(await _0x474100[_0x592c07(0x208)](_0x5f49c2)){_0x43032a=_0x5f49c2,_0x263d8b=_0x2f406d;break;}_0x2f406d=a102_0x4bf119['dirname'](_0x2f406d);}if(!_0x43032a||!_0x263d8b)throw new Error(_0x592c07(0x1f0)+_0x2aac25);const _0x2fdb69=await _0x474100[_0x592c07(0x1e9)](_0x43032a),_0x2a4796=JSON[_0x592c07(0x1ef)](_0x2fdb69),_0x3ba69b=_0x2a4796[_0x592c07(0x1e2)];if(!_0x3ba69b)throw new Error(_0x592c07(0x1e8));const _0x3adae8=await _0x474100['readFile'](_0x3e5f4a),_0x1fd307=a102_0x159e68(_0x3adae8),_0x5a953e=_0x1fd307[_0x592c07(0x20c)];if(!_0x5a953e)throw new Error(_0x592c07(0x1e6)+_0x2aac25);const _0x2e578e=_0x1fd307[_0x592c07(0x1e5)]==='journey'?_0x592c07(0x20e):_0x592c07(0x1fe),_0x546e40=a102_0x4bf119[_0x592c07(0x1f8)](_0x263d8b,_0x3e5f4a),_0x556a48=a102_0x4bf119[_0x592c07(0x1e4)](_0x546e40),_0x574ed1=_0x556a48==='.'?'':_0x556a48['replace'](/\\/g,'/'),_0xe866d5=_0x574ed1?_0x3ba69b+'/'+_0x574ed1+'/'+_0x5a953e:_0x3ba69b+'/'+_0x5a953e;return{'parentSegment':_0x3ba69b,'segmentName':_0x5a953e,'folderPath':_0x574ed1,'fullPath':_0xe866d5,'resourceType':_0x2e578e};}
@@ -1 +1 @@
1
- (function(_0x19666c,_0x3947ac){const _0x105b2a=a101_0x3989,_0x518892=_0x19666c();while(!![]){try{const _0x31d7a4=parseInt(_0x105b2a(0xb2))/0x1+parseInt(_0x105b2a(0xb4))/0x2*(-parseInt(_0x105b2a(0xa9))/0x3)+-parseInt(_0x105b2a(0xab))/0x4*(parseInt(_0x105b2a(0xb3))/0x5)+parseInt(_0x105b2a(0xb0))/0x6+parseInt(_0x105b2a(0xae))/0x7*(-parseInt(_0x105b2a(0xad))/0x8)+parseInt(_0x105b2a(0xa8))/0x9+parseInt(_0x105b2a(0xb1))/0xa;if(_0x31d7a4===_0x3947ac)break;else _0x518892['push'](_0x518892['shift']());}catch(_0x43cfa6){_0x518892['push'](_0x518892['shift']());}}}(a101_0x487f,0x53256));function a101_0x3989(_0x211d63,_0x39e1a0){_0x211d63=_0x211d63-0xa8;const _0x487f79=a101_0x487f();let _0x39896d=_0x487f79[_0x211d63];return _0x39896d;}function a101_0x487f(){const _0x2cdd23=['substring','3257718WvFpye','3780790TOEXZX','213409mCrVau','5eObLaU','14216EZuPmN','472464ZYAhvO','192bLnpJj','Invalid\x20segment\x20reference\x20format:\x20','724252KWhkTv','.\x20Parent\x20name\x20cannot\x20be\x20empty','3152xCUPyA','3738XacFUI'];a101_0x487f=function(){return _0x2cdd23;};return a101_0x487f();}export function parseSegmentRef(_0x1d8d0a){const _0x5139e2=a101_0x3989,_0x2b1cae=_0x1d8d0a['indexOf']('/');if(_0x2b1cae===-0x1)return{'parentId':_0x1d8d0a};if(_0x2b1cae===0x0)throw new Error(_0x5139e2(0xaa)+_0x1d8d0a+_0x5139e2(0xac));const _0x3d7614=_0x1d8d0a['substring'](0x0,_0x2b1cae),_0x11f6f1=_0x1d8d0a[_0x5139e2(0xaf)](_0x2b1cae+0x1);if(_0x11f6f1==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1d8d0a+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x3d7614,'childId':_0x11f6f1};}
1
+ function a103_0x19f9(){const _0x28a501=['2146220QuoTyi','3006342YKkBvM','Invalid\x20segment\x20reference\x20format:\x20','433812ZxLXCu','415872LAiOyr','10vQCfHh','indexOf','3poCdzw','15810399Hjsaze','495650yHWpVD','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring','7hNmPEu','.\x20Child\x20name\x20cannot\x20be\x20empty','286952BegbPu'];a103_0x19f9=function(){return _0x28a501;};return a103_0x19f9();}function a103_0x2d9d(_0x419ba5,_0x20c401){_0x419ba5=_0x419ba5-0x12c;const _0x19f970=a103_0x19f9();let _0x2d9d39=_0x19f970[_0x419ba5];return _0x2d9d39;}(function(_0x1ef557,_0x672136){const _0x1696a1=a103_0x2d9d,_0x10828f=_0x1ef557();while(!![]){try{const _0x2b0a3e=-parseInt(_0x1696a1(0x132))/0x1+-parseInt(_0x1696a1(0x12d))/0x2+parseInt(_0x1696a1(0x130))/0x3*(parseInt(_0x1696a1(0x12c))/0x4)+-parseInt(_0x1696a1(0x138))/0x5+-parseInt(_0x1696a1(0x139))/0x6*(parseInt(_0x1696a1(0x135))/0x7)+parseInt(_0x1696a1(0x137))/0x8+parseInt(_0x1696a1(0x131))/0x9*(parseInt(_0x1696a1(0x12e))/0xa);if(_0x2b0a3e===_0x672136)break;else _0x10828f['push'](_0x10828f['shift']());}catch(_0x448931){_0x10828f['push'](_0x10828f['shift']());}}}(a103_0x19f9,0x4138a));export function parseSegmentRef(_0x2ed90c){const _0x72f7e9=a103_0x2d9d,_0x2e5811=_0x2ed90c[_0x72f7e9(0x12f)]('/');if(_0x2e5811===-0x1)return{'parentId':_0x2ed90c};if(_0x2e5811===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2ed90c+_0x72f7e9(0x133));const _0x56f7f8=_0x2ed90c[_0x72f7e9(0x134)](0x0,_0x2e5811),_0x4246a3=_0x2ed90c['substring'](_0x2e5811+0x1);if(_0x4246a3==='')throw new Error(_0x72f7e9(0x13a)+_0x2ed90c+_0x72f7e9(0x136));return{'parentId':_0x56f7f8,'childId':_0x4246a3};}
@@ -1 +1 @@
1
- (function(_0x4b41ee,_0x421134){const _0x187e21=a102_0x39d4,_0x33db0e=_0x4b41ee();while(!![]){try{const _0x171a3f=parseInt(_0x187e21(0x12c))/0x1+-parseInt(_0x187e21(0x108))/0x2+parseInt(_0x187e21(0xfc))/0x3+parseInt(_0x187e21(0x11a))/0x4+-parseInt(_0x187e21(0x10a))/0x5*(-parseInt(_0x187e21(0x124))/0x6)+parseInt(_0x187e21(0x109))/0x7*(parseInt(_0x187e21(0x11e))/0x8)+parseInt(_0x187e21(0x10e))/0x9*(-parseInt(_0x187e21(0x129))/0xa);if(_0x171a3f===_0x421134)break;else _0x33db0e['push'](_0x33db0e['shift']());}catch(_0x3188ad){_0x33db0e['push'](_0x33db0e['shift']());}}}(a102_0x3d92,0x5ac54));function a102_0x3d92(){const _0x471a05=['no_parent','546968scufDL','isDirectory','type','segmentName','match','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','183102zooMqH','resolve','scopedFolderPath','tdx.json','parse','2920OguFVp','root','exists','463521awxTkf','startsWith','readFile','File\x20not\x20found:\x20','parent_name','basename','1915341wJQiIJ','stat','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','resourceType','file','dirname','no_config','includes','isScoped','error','trim','invalid_yaml','345858VEEuyG','14vFkjgs','120MfAbEN','parentSegment','configDir','extname','62649UeYAAx','relative','file_not_found','join','journey','message','context','Not\x20a\x20YAML\x20file:\x20','parent_segment','cwd','replace','isFile','2424876IKQQEl','No\x20tdx.json\x20found','folderPath'];a102_0x3d92=function(){return _0x471a05;};return a102_0x3d92();}import a102_0x2befb8 from'path';function a102_0x39d4(_0x352205,_0x1b7d02){_0x352205=_0x352205-0xfb;const _0x3d9214=a102_0x3d92();let _0x39d49a=_0x3d9214[_0x352205];return _0x39d49a;}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(_0x188db8){const _0x3580f4=a102_0x39d4;return _0x188db8[_0x3580f4(0x120)]!=='error';}export function isScopedResolution(_0x14ccb5){const _0x5665c1=a102_0x39d4;return _0x14ccb5[_0x5665c1(0x120)]==='directory'||_0x14ccb5['type']===_0x5665c1(0x100)||_0x14ccb5[_0x5665c1(0x120)]===_0x5665c1(0x114);}export function getScopedDetails(_0x483bb4){const _0x36639f=a102_0x39d4;if(isScopedResolution(_0x483bb4))return{'isScoped':_0x483bb4['isScoped'],'scopedFolderPath':_0x483bb4[_0x36639f(0x126)]};return undefined;}async function findTdxConfigAsync(_0x29660c,_0x484b76){const _0x164806=a102_0x39d4;let _0x4331c4=a102_0x2befb8[_0x164806(0x125)](_0x29660c);const _0x664bc9=a102_0x2befb8['parse'](_0x4331c4)[_0x164806(0x12a)];while(_0x4331c4!==_0x664bc9){const _0x5bfad5=a102_0x2befb8[_0x164806(0x111)](_0x4331c4,_0x164806(0x127));if(await _0x484b76[_0x164806(0x12b)](_0x5bfad5))try{const _0x5563a2=await _0x484b76[_0x164806(0x12e)](_0x5bfad5),_0x39d1c1=JSON[_0x164806(0x128)](_0x5563a2);if(_0x39d1c1[_0x164806(0x116)]&&typeof _0x39d1c1['parent_segment']==='string')return{'configPath':_0x5bfad5,'configDir':_0x4331c4,'parentSegment':_0x39d1c1['parent_segment']};}catch{}_0x4331c4=a102_0x2befb8[_0x164806(0x101)](_0x4331c4);}return null;}function calculateScopedPath(_0x46f726,_0x4ecee0){const _0x212571=a102_0x39d4,_0x57b654=a102_0x2befb8[_0x212571(0x10f)](_0x4ecee0,_0x46f726),_0x4029a2=_0x57b654!==''&&_0x57b654!=='.'&&!_0x57b654[_0x212571(0x12d)]('..');return{'isScoped':_0x4029a2,'scopedFolderPath':_0x4029a2?_0x57b654[_0x212571(0x118)](/\\/g,'/'):''};}export async function resolveTarget(_0x4ecce1){const _0x24bb6b=a102_0x39d4,{arg:_0x215fd8,contextParent:_0x4ffb65,cwd:cwd=process[_0x24bb6b(0x117)](),fs:fs=nodeFileSystem}=_0x4ecce1;if(_0x215fd8&&isYamlFilePath(_0x215fd8))try{const _0x199255=await resolveYamlFilePath(_0x215fd8,fs),_0x5d7d05=a102_0x2befb8[_0x24bb6b(0x125)](_0x215fd8),_0x598f80=a102_0x2befb8[_0x24bb6b(0x101)](_0x5d7d05),_0x540d9b=await findTdxConfigAsync(_0x598f80,fs);if(!_0x540d9b){if(_0x4ffb65){const _0x44c9bb=a102_0x2befb8[_0x24bb6b(0x101)](_0x5d7d05);return{'type':_0x24bb6b(0x100),'parentName':_0x4ffb65,'targetDir':_0x44c9bb,'configRoot':_0x44c9bb,'filePath':_0x5d7d05,'resourceName':_0x199255[_0x24bb6b(0x121)],'folderPath':_0x199255[_0x24bb6b(0x11c)],'resourceType':_0x199255[_0x24bb6b(0xff)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x24bb6b(0x105),'errorCode':_0x24bb6b(0x102),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x215fd8,'arg':_0x215fd8,'helpText':_0x24bb6b(0x123)};}const _0x35f42f=calculateScopedPath(_0x598f80,_0x540d9b[_0x24bb6b(0x10c)]);return{'type':_0x24bb6b(0x100),'parentName':_0x540d9b[_0x24bb6b(0x10b)],'targetDir':_0x540d9b[_0x24bb6b(0x10c)],'configRoot':_0x540d9b[_0x24bb6b(0x10c)],'filePath':_0x5d7d05,'resourceName':_0x199255['segmentName'],'folderPath':_0x199255[_0x24bb6b(0x11c)],'resourceType':_0x199255[_0x24bb6b(0xff)],'isScoped':_0x35f42f[_0x24bb6b(0x104)],'scopedFolderPath':_0x35f42f[_0x24bb6b(0x126)]};}catch(_0x144b24){const _0x1c3486=_0x144b24 instanceof Error?_0x144b24[_0x24bb6b(0x113)]:String(_0x144b24);if(_0x1c3486[_0x24bb6b(0x103)]('File\x20not\x20found'))return{'type':_0x24bb6b(0x105),'errorCode':_0x24bb6b(0x110),'message':_0x24bb6b(0x12f)+_0x215fd8,'arg':_0x215fd8};if(_0x1c3486[_0x24bb6b(0x103)](_0x24bb6b(0x11b))){if(_0x4ffb65){const _0x211b34=a102_0x2befb8['resolve'](_0x215fd8);if(await fs[_0x24bb6b(0x12b)](_0x211b34)){const _0x3ea49c=a102_0x2befb8['dirname'](_0x211b34),_0x5190b4=await fs[_0x24bb6b(0x12e)](_0x211b34),_0x22251d=_0x5190b4['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x1d6355=_0x5190b4[_0x24bb6b(0x122)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x36d83d=_0x22251d?_0x22251d[0x1][_0x24bb6b(0x106)]():a102_0x2befb8[_0x24bb6b(0xfb)](_0x215fd8,a102_0x2befb8[_0x24bb6b(0x10d)](_0x215fd8)),_0x20cf7a=_0x1d6355&&_0x1d6355[0x1][_0x24bb6b(0x106)]()===_0x24bb6b(0x112)?'journey':'segment';return{'type':'file','parentName':_0x4ffb65,'targetDir':_0x3ea49c,'configRoot':_0x3ea49c,'filePath':_0x211b34,'resourceName':_0x36d83d,'folderPath':'','resourceType':_0x20cf7a,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x24bb6b(0x105),'errorCode':'no_config','message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x215fd8,'arg':_0x215fd8,'helpText':_0x24bb6b(0x123)};}return{'type':_0x24bb6b(0x105),'errorCode':_0x24bb6b(0x107),'message':_0x1c3486,'arg':_0x215fd8};}if(_0x215fd8){const _0x10e210=a102_0x2befb8[_0x24bb6b(0x125)](cwd,_0x215fd8);let _0x639f22=null;try{_0x639f22=await fs[_0x24bb6b(0xfd)](_0x10e210);}catch{}if(_0x639f22?.[_0x24bb6b(0x11f)]()){const _0x3d8ab6=await findTdxConfigAsync(_0x10e210,fs);if(_0x3d8ab6){const _0x3385fc=calculateScopedPath(_0x10e210,_0x3d8ab6[_0x24bb6b(0x10c)]);return{'type':'directory','parentName':_0x3d8ab6['parentSegment'],'targetDir':_0x10e210,'configRoot':_0x3d8ab6['configDir'],'isScoped':_0x3385fc[_0x24bb6b(0x104)],'scopedFolderPath':_0x3385fc['scopedFolderPath']};}if(_0x4ffb65)return{'type':'directory','parentName':_0x4ffb65,'targetDir':_0x10e210,'configRoot':_0x10e210,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x24bb6b(0x102),'message':_0x24bb6b(0xfe)+_0x215fd8,'arg':_0x215fd8,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}if(_0x639f22?.[_0x24bb6b(0x119)]())return{'type':_0x24bb6b(0x105),'errorCode':_0x24bb6b(0x107),'message':_0x24bb6b(0x115)+_0x215fd8,'arg':_0x215fd8,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x5b5a18=sanitizeFileName(_0x215fd8),_0x1cb2fa=getSegmentRootDir(_0x5b5a18,cwd);return{'type':_0x24bb6b(0x130),'parentName':_0x215fd8,'targetDir':_0x1cb2fa,'configRoot':_0x1cb2fa};}const _0x5cce53=await findTdxConfigAsync(cwd,fs);if(_0x5cce53){const _0x5a039b=calculateScopedPath(cwd,_0x5cce53[_0x24bb6b(0x10c)]);return{'type':'context','parentName':_0x5cce53[_0x24bb6b(0x10b)],'targetDir':cwd,'configRoot':_0x5cce53[_0x24bb6b(0x10c)],'isScoped':_0x5a039b[_0x24bb6b(0x104)],'scopedFolderPath':_0x5a039b[_0x24bb6b(0x126)]};}if(_0x4ffb65){const _0x1c44ea=sanitizeFileName(_0x4ffb65),_0x23b2cd=getSegmentRootDir(_0x1c44ea,cwd);return{'type':_0x24bb6b(0x114),'parentName':_0x4ffb65,'targetDir':_0x23b2cd,'configRoot':_0x23b2cd,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x24bb6b(0x105),'errorCode':_0x24bb6b(0x11d),'message':'Parent\x20segment\x20not\x20specified','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(_0x15e651,_0x58a0b7){const _0x57a3ba=a104_0x3ba5,_0x3e18e1=_0x15e651();while(!![]){try{const _0x272681=parseInt(_0x57a3ba(0x1d6))/0x1+parseInt(_0x57a3ba(0x1de))/0x2*(parseInt(_0x57a3ba(0x1df))/0x3)+-parseInt(_0x57a3ba(0x202))/0x4*(parseInt(_0x57a3ba(0x20d))/0x5)+-parseInt(_0x57a3ba(0x1db))/0x6*(-parseInt(_0x57a3ba(0x1f1))/0x7)+-parseInt(_0x57a3ba(0x200))/0x8+-parseInt(_0x57a3ba(0x20c))/0x9*(-parseInt(_0x57a3ba(0x209))/0xa)+-parseInt(_0x57a3ba(0x205))/0xb;if(_0x272681===_0x58a0b7)break;else _0x3e18e1['push'](_0x3e18e1['shift']());}catch(_0x1869cc){_0x3e18e1['push'](_0x3e18e1['shift']());}}}(a104_0x351d,0x65f59));import a104_0x2c2053 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(_0x287136){const _0x3742da=a104_0x3ba5;return _0x287136[_0x3742da(0x1e8)]!=='error';}export function isScopedResolution(_0x22cf69){const _0x42dedb=a104_0x3ba5;return _0x22cf69[_0x42dedb(0x1e8)]==='directory'||_0x22cf69['type']===_0x42dedb(0x1f5)||_0x22cf69[_0x42dedb(0x1e8)]===_0x42dedb(0x20f);}function a104_0x351d(){const _0x4f045f=['join','extname','4095144dtlJhZ','File\x20not\x20found','76KcjJRA','segment','resourceType','2314862RqVdQj','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','Parent\x20segment\x20not\x20specified','string','10990sNUyMK','no_parent','parentSegment','279cFuMAW','2410kjKxjx','parent_name','context','scopedFolderPath','497708TIBSIV','readFile','folderPath','message','error','3102276OppZBJ','File\x20not\x20found:\x20','root','130LnEAmW','4629KNlghc','stat','No\x20tdx.json\x20found','match','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Not\x20a\x20YAML\x20file:\x20','journey','includes','No\x20tdx.json\x20found\x20for\x20file:\x20','type','resolve','cwd','invalid_yaml','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','replace','directory','configDir','isScoped','7nAYbnj','trim','file_not_found','dirname','file','tdx.json','no_config','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','exists','parent_segment','basename','parse','segmentName'];a104_0x351d=function(){return _0x4f045f;};return a104_0x351d();}export function getScopedDetails(_0xd96558){const _0x29b98f=a104_0x3ba5;if(isScopedResolution(_0xd96558))return{'isScoped':_0xd96558[_0x29b98f(0x1f0)],'scopedFolderPath':_0xd96558['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x111db1,_0x3dbb10){const _0x1dc57c=a104_0x3ba5;let _0x2492f4=a104_0x2c2053[_0x1dc57c(0x1e9)](_0x111db1);const _0x55242b=a104_0x2c2053['parse'](_0x2492f4)[_0x1dc57c(0x1dd)];while(_0x2492f4!==_0x55242b){const _0x24b9e0=a104_0x2c2053[_0x1dc57c(0x1fe)](_0x2492f4,_0x1dc57c(0x1f6));if(await _0x3dbb10[_0x1dc57c(0x1f9)](_0x24b9e0))try{const _0x336e4b=await _0x3dbb10[_0x1dc57c(0x1d7)](_0x24b9e0),_0x1c4932=JSON[_0x1dc57c(0x1fc)](_0x336e4b);if(_0x1c4932[_0x1dc57c(0x1fa)]&&typeof _0x1c4932[_0x1dc57c(0x1fa)]===_0x1dc57c(0x208))return{'configPath':_0x24b9e0,'configDir':_0x2492f4,'parentSegment':_0x1c4932['parent_segment']};}catch{}_0x2492f4=a104_0x2c2053['dirname'](_0x2492f4);}return null;}function a104_0x3ba5(_0x4e692e,_0x590d79){_0x4e692e=_0x4e692e-0x1d6;const _0x351d9a=a104_0x351d();let _0x3ba5e9=_0x351d9a[_0x4e692e];return _0x3ba5e9;}function calculateScopedPath(_0x120e6b,_0x146969){const _0x237259=a104_0x3ba5,_0x131989=a104_0x2c2053['relative'](_0x146969,_0x120e6b),_0x29db6d=_0x131989!==''&&_0x131989!=='.'&&!_0x131989['startsWith']('..');return{'isScoped':_0x29db6d,'scopedFolderPath':_0x29db6d?_0x131989[_0x237259(0x1ed)](/\\/g,'/'):''};}export async function resolveTarget(_0x1c9060){const _0x2ae4a3=a104_0x3ba5,{arg:_0x41f349,contextParent:_0x484a66,cwd:cwd=process[_0x2ae4a3(0x1ea)](),fs:fs=nodeFileSystem}=_0x1c9060;if(_0x41f349&&isYamlFilePath(_0x41f349))try{const _0x5375f2=await resolveYamlFilePath(_0x41f349,fs),_0x5e7813=a104_0x2c2053['resolve'](_0x41f349),_0x4cb4f5=a104_0x2c2053[_0x2ae4a3(0x1f4)](_0x5e7813),_0x35db88=await findTdxConfigAsync(_0x4cb4f5,fs);if(!_0x35db88){if(_0x484a66){const _0x54ca07=a104_0x2c2053[_0x2ae4a3(0x1f4)](_0x5e7813);return{'type':_0x2ae4a3(0x1f5),'parentName':_0x484a66,'targetDir':_0x54ca07,'configRoot':_0x54ca07,'filePath':_0x5e7813,'resourceName':_0x5375f2[_0x2ae4a3(0x1fd)],'folderPath':_0x5375f2[_0x2ae4a3(0x1d8)],'resourceType':_0x5375f2[_0x2ae4a3(0x204)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1f7),'message':_0x2ae4a3(0x1e7)+_0x41f349,'arg':_0x41f349,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}const _0x394f64=calculateScopedPath(_0x4cb4f5,_0x35db88[_0x2ae4a3(0x1ef)]);return{'type':_0x2ae4a3(0x1f5),'parentName':_0x35db88[_0x2ae4a3(0x20b)],'targetDir':_0x35db88[_0x2ae4a3(0x1ef)],'configRoot':_0x35db88[_0x2ae4a3(0x1ef)],'filePath':_0x5e7813,'resourceName':_0x5375f2[_0x2ae4a3(0x1fd)],'folderPath':_0x5375f2[_0x2ae4a3(0x1d8)],'resourceType':_0x5375f2[_0x2ae4a3(0x204)],'isScoped':_0x394f64[_0x2ae4a3(0x1f0)],'scopedFolderPath':_0x394f64[_0x2ae4a3(0x210)]};}catch(_0x51f007){const _0x1aaa4c=_0x51f007 instanceof Error?_0x51f007[_0x2ae4a3(0x1d9)]:String(_0x51f007);if(_0x1aaa4c['includes'](_0x2ae4a3(0x201)))return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1f3),'message':_0x2ae4a3(0x1dc)+_0x41f349,'arg':_0x41f349};if(_0x1aaa4c[_0x2ae4a3(0x1e6)](_0x2ae4a3(0x1e1))){if(_0x484a66){const _0x4114c7=a104_0x2c2053[_0x2ae4a3(0x1e9)](_0x41f349);if(await fs[_0x2ae4a3(0x1f9)](_0x4114c7)){const _0x15628a=a104_0x2c2053[_0x2ae4a3(0x1f4)](_0x4114c7),_0xa04114=await fs[_0x2ae4a3(0x1d7)](_0x4114c7),_0x1d8f0c=_0xa04114['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x4ee644=_0xa04114[_0x2ae4a3(0x1e2)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x101a6c=_0x1d8f0c?_0x1d8f0c[0x1]['trim']():a104_0x2c2053[_0x2ae4a3(0x1fb)](_0x41f349,a104_0x2c2053[_0x2ae4a3(0x1ff)](_0x41f349)),_0x35f45a=_0x4ee644&&_0x4ee644[0x1][_0x2ae4a3(0x1f2)]()===_0x2ae4a3(0x1e5)?_0x2ae4a3(0x1e5):_0x2ae4a3(0x203);return{'type':_0x2ae4a3(0x1f5),'parentName':_0x484a66,'targetDir':_0x15628a,'configRoot':_0x15628a,'filePath':_0x4114c7,'resourceName':_0x101a6c,'folderPath':'','resourceType':_0x35f45a,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1f7),'message':_0x2ae4a3(0x1e7)+_0x41f349,'arg':_0x41f349,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1eb),'message':_0x1aaa4c,'arg':_0x41f349};}if(_0x41f349){const _0x537405=a104_0x2c2053[_0x2ae4a3(0x1e9)](cwd,_0x41f349);let _0x1a90f5=null;try{_0x1a90f5=await fs[_0x2ae4a3(0x1e0)](_0x537405);}catch{}if(_0x1a90f5?.['isDirectory']()){const _0x48f447=await findTdxConfigAsync(_0x537405,fs);if(_0x48f447){const _0x414025=calculateScopedPath(_0x537405,_0x48f447['configDir']);return{'type':'directory','parentName':_0x48f447[_0x2ae4a3(0x20b)],'targetDir':_0x537405,'configRoot':_0x48f447['configDir'],'isScoped':_0x414025[_0x2ae4a3(0x1f0)],'scopedFolderPath':_0x414025[_0x2ae4a3(0x210)]};}if(_0x484a66)return{'type':_0x2ae4a3(0x1ee),'parentName':_0x484a66,'targetDir':_0x537405,'configRoot':_0x537405,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x2ae4a3(0x1f7),'message':_0x2ae4a3(0x1e3)+_0x41f349,'arg':_0x41f349,'helpText':_0x2ae4a3(0x206)};}if(_0x1a90f5?.['isFile']())return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1eb),'message':_0x2ae4a3(0x1e4)+_0x41f349,'arg':_0x41f349,'helpText':_0x2ae4a3(0x1f8)};const _0x3f1d72=sanitizeFileName(_0x41f349),_0x18859b=getSegmentRootDir(_0x3f1d72,cwd);return{'type':_0x2ae4a3(0x20e),'parentName':_0x41f349,'targetDir':_0x18859b,'configRoot':_0x18859b};}const _0x486ac4=await findTdxConfigAsync(cwd,fs);if(_0x486ac4){const _0x12ae28=calculateScopedPath(cwd,_0x486ac4[_0x2ae4a3(0x1ef)]);return{'type':_0x2ae4a3(0x20f),'parentName':_0x486ac4[_0x2ae4a3(0x20b)],'targetDir':cwd,'configRoot':_0x486ac4[_0x2ae4a3(0x1ef)],'isScoped':_0x12ae28[_0x2ae4a3(0x1f0)],'scopedFolderPath':_0x12ae28[_0x2ae4a3(0x210)]};}if(_0x484a66){const _0x17f81c=sanitizeFileName(_0x484a66),_0x3539cd=getSegmentRootDir(_0x17f81c,cwd);return{'type':_0x2ae4a3(0x20f),'parentName':_0x484a66,'targetDir':_0x3539cd,'configRoot':_0x3539cd,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x2ae4a3(0x20a),'message':_0x2ae4a3(0x207),'helpText':_0x2ae4a3(0x1ec)};}
@@ -1 +1 @@
1
- const a103_0x3ca6f5=a103_0x20b1;(function(_0x35ffaf,_0x1ea934){const _0x3ead4e=a103_0x20b1,_0x4b7572=_0x35ffaf();while(!![]){try{const _0x4ccb37=-parseInt(_0x3ead4e(0xee))/0x1+parseInt(_0x3ead4e(0xef))/0x2+parseInt(_0x3ead4e(0xdb))/0x3+-parseInt(_0x3ead4e(0xda))/0x4*(-parseInt(_0x3ead4e(0xe2))/0x5)+-parseInt(_0x3ead4e(0xe5))/0x6+parseInt(_0x3ead4e(0xeb))/0x7+-parseInt(_0x3ead4e(0xdd))/0x8;if(_0x4ccb37===_0x1ea934)break;else _0x4b7572['push'](_0x4b7572['shift']());}catch(_0x18e81a){_0x4b7572['push'](_0x4b7572['shift']());}}}(a103_0x528a,0x6d45b));import{existsSync,readFileSync}from'fs';import a103_0x51be65 from'path';const TDX_CONFIG_FILE=a103_0x3ca6f5(0xd8),SEGMENTS_DIR=a103_0x3ca6f5(0xe4);export function findTdxConfigPath(_0x314a42=process[a103_0x3ca6f5(0xed)]()){const _0x57aef4=a103_0x3ca6f5;let _0x15fd8b=a103_0x51be65[_0x57aef4(0xd9)](_0x314a42);const _0x505d0d=a103_0x51be65[_0x57aef4(0xe1)](_0x15fd8b)[_0x57aef4(0xe0)];while(_0x15fd8b!==_0x505d0d){const _0x1e3246=a103_0x51be65[_0x57aef4(0xd7)](_0x15fd8b,TDX_CONFIG_FILE);if(existsSync(_0x1e3246))return _0x1e3246;_0x15fd8b=a103_0x51be65[_0x57aef4(0xe9)](_0x15fd8b);}return null;}export function loadTdxConfig(_0x1ac49c){const _0x15cabb=a103_0x3ca6f5,_0x1b8cf5=readFileSync(_0x1ac49c,_0x15cabb(0xe7));let _0x4fb66c;try{_0x4fb66c=JSON['parse'](_0x1b8cf5);}catch{throw new Error(_0x15cabb(0xde)+_0x1ac49c);}if(!_0x4fb66c||typeof _0x4fb66c!==_0x15cabb(0xdc))throw new Error(_0x15cabb(0xe6));const _0x22fdc7=_0x4fb66c;if(!_0x22fdc7[_0x15cabb(0xe8)]||typeof _0x22fdc7[_0x15cabb(0xe8)]!==_0x15cabb(0xea))throw new Error(_0x15cabb(0xdf));return{'parent_segment':_0x22fdc7[_0x15cabb(0xe8)]};}function a103_0x20b1(_0x5c03b7,_0x18f5d5){_0x5c03b7=_0x5c03b7-0xd6;const _0x528a88=a103_0x528a();let _0x20b1b7=_0x528a88[_0x5c03b7];return _0x20b1b7;}export function findTdxConfig(_0x40b554=process['cwd']()){const _0x422279=a103_0x3ca6f5,_0x3a7acb=findTdxConfigPath(_0x40b554);if(!_0x3a7acb)throw new Error(_0x422279(0xe3));const _0x172689=loadTdxConfig(_0x3a7acb),_0x2a7ada=a103_0x51be65[_0x422279(0xe9)](_0x3a7acb);return{'config':_0x172689,'configPath':_0x3a7acb,'configDir':_0x2a7ada};}export function tryFindTdxConfig(_0x1fc516){try{return findTdxConfig(_0x1fc516);}catch{return null;}}export function getSegmentRootDir(_0x297911,_0x263e6e=process[a103_0x3ca6f5(0xed)]()){const _0x2b48d2=a103_0x3ca6f5;return a103_0x51be65[_0x2b48d2(0xd7)](_0x263e6e,SEGMENTS_DIR,_0x297911);}function a103_0x528a(){const _0x583f4d=['4734282JAhvxY','relative','cwd','295856jKjDrQ','880950LKdoca','replace','join','tdx.json','resolve','160144wBcbZf','769311OggHjR','object','584960WqUtMy','Invalid\x20JSON\x20in\x20','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','root','parse','20dJljUq','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','segments','4300962FkQxHp','Invalid\x20tdx.json:\x20expected\x20object','utf-8','parent_segment','dirname','string'];a103_0x528a=function(){return _0x583f4d;};return a103_0x528a();}export function getTdxConfigPath(_0x366227,_0x2262ba=process[a103_0x3ca6f5(0xed)]()){const _0x3cd967=a103_0x3ca6f5;return a103_0x51be65[_0x3cd967(0xd7)](getSegmentRootDir(_0x366227,_0x2262ba),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x247393,_0x39f70f){const _0x39a401=a103_0x3ca6f5,_0x33d4c5=a103_0x51be65['resolve'](_0x247393),_0xc6de61=a103_0x51be65[_0x39a401(0xec)](_0x39f70f,_0x33d4c5);if(_0xc6de61['startsWith']('..'))return'';return _0xc6de61;}export function localPathToTdFolderPath(_0x652db2){const _0x4acb37=a103_0x3ca6f5,_0x43a9ea=a103_0x51be65[_0x4acb37(0xe9)](_0x652db2);if(_0x43a9ea==='.'||_0x43a9ea==='')return'';return _0x43a9ea[_0x4acb37(0xd6)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x19d8c0,_0x3f7dd2){if(!_0x19d8c0)return _0x3f7dd2;return a103_0x51be65['join'](_0x3f7dd2,_0x19d8c0);}export function createTdxConfigContent(_0x277386){const _0x3e4229={'parent_segment':_0x277386};return JSON['stringify'](_0x3e4229,null,0x2)+'\x0a';}
1
+ const a105_0x316567=a105_0x16ef;(function(_0x583e17,_0x4a3cdc){const _0x3ce386=a105_0x16ef,_0x26ab3d=_0x583e17();while(!![]){try{const _0x257dd6=parseInt(_0x3ce386(0x105))/0x1*(-parseInt(_0x3ce386(0x117))/0x2)+-parseInt(_0x3ce386(0x103))/0x3*(-parseInt(_0x3ce386(0x10a))/0x4)+parseInt(_0x3ce386(0x116))/0x5*(-parseInt(_0x3ce386(0x107))/0x6)+-parseInt(_0x3ce386(0xfe))/0x7*(-parseInt(_0x3ce386(0x109))/0x8)+-parseInt(_0x3ce386(0x111))/0x9+parseInt(_0x3ce386(0xfc))/0xa+parseInt(_0x3ce386(0x10b))/0xb;if(_0x257dd6===_0x4a3cdc)break;else _0x26ab3d['push'](_0x26ab3d['shift']());}catch(_0x3c51be){_0x26ab3d['push'](_0x26ab3d['shift']());}}}(a105_0x48e5,0x753c5));function a105_0x48e5(){const _0x5c3f4c=['524iXiNwb','22978131kXCYbp','parent_segment','string','root','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','5576337BIFJEo','startsWith','tdx.json','replace','join','3018325aBHWZr','2SbpUQO','1398250unRsZe','object','91385HetQJZ','resolve','cwd','Invalid\x20tdx.json:\x20expected\x20object','dirname','3855CvcYoP','parse','745846pfRZLa','relative','6cSOMGK','Invalid\x20JSON\x20in\x20','32wBVuIf'];a105_0x48e5=function(){return _0x5c3f4c;};return a105_0x48e5();}import{existsSync,readFileSync}from'fs';import a105_0x14be35 from'path';const TDX_CONFIG_FILE=a105_0x316567(0x113),SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x5d973a=process['cwd']()){const _0x2f1bb0=a105_0x316567;let _0x5ee1a5=a105_0x14be35[_0x2f1bb0(0xff)](_0x5d973a);const _0xcf30cf=a105_0x14be35[_0x2f1bb0(0x104)](_0x5ee1a5)[_0x2f1bb0(0x10e)];while(_0x5ee1a5!==_0xcf30cf){const _0x3813df=a105_0x14be35['join'](_0x5ee1a5,TDX_CONFIG_FILE);if(existsSync(_0x3813df))return _0x3813df;_0x5ee1a5=a105_0x14be35[_0x2f1bb0(0x102)](_0x5ee1a5);}return null;}export function loadTdxConfig(_0x5b3108){const _0x2c1f00=a105_0x316567,_0x2eebae=readFileSync(_0x5b3108,'utf-8');let _0x169183;try{_0x169183=JSON[_0x2c1f00(0x104)](_0x2eebae);}catch{throw new Error(_0x2c1f00(0x108)+_0x5b3108);}if(!_0x169183||typeof _0x169183!==_0x2c1f00(0xfd))throw new Error(_0x2c1f00(0x101));const _0xd6d9fb=_0x169183;if(!_0xd6d9fb['parent_segment']||typeof _0xd6d9fb[_0x2c1f00(0x10c)]!==_0x2c1f00(0x10d))throw new Error(_0x2c1f00(0x110));return{'parent_segment':_0xd6d9fb[_0x2c1f00(0x10c)]};}function a105_0x16ef(_0x4dacef,_0xd00f17){_0x4dacef=_0x4dacef-0xfc;const _0x48e50d=a105_0x48e5();let _0x16effe=_0x48e50d[_0x4dacef];return _0x16effe;}export function findTdxConfig(_0x32c200=process['cwd']()){const _0x3393e2=a105_0x316567,_0xab2e07=findTdxConfigPath(_0x32c200);if(!_0xab2e07)throw new Error(_0x3393e2(0x10f));const _0x138e0b=loadTdxConfig(_0xab2e07),_0x25596a=a105_0x14be35[_0x3393e2(0x102)](_0xab2e07);return{'config':_0x138e0b,'configPath':_0xab2e07,'configDir':_0x25596a};}export function tryFindTdxConfig(_0x4f4397){try{return findTdxConfig(_0x4f4397);}catch{return null;}}export function getSegmentRootDir(_0x2a678a,_0x292e85=process[a105_0x316567(0x100)]()){const _0x19f384=a105_0x316567;return a105_0x14be35[_0x19f384(0x115)](_0x292e85,SEGMENTS_DIR,_0x2a678a);}export function getTdxConfigPath(_0x218cb8,_0x28415c=process['cwd']()){const _0x49761a=a105_0x316567;return a105_0x14be35[_0x49761a(0x115)](getSegmentRootDir(_0x218cb8,_0x28415c),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x3fc48d,_0x982fa4){const _0x19b0e8=a105_0x316567,_0x4b61b8=a105_0x14be35[_0x19b0e8(0xff)](_0x3fc48d),_0x4a5cbe=a105_0x14be35[_0x19b0e8(0x106)](_0x982fa4,_0x4b61b8);if(_0x4a5cbe[_0x19b0e8(0x112)]('..'))return'';return _0x4a5cbe;}export function localPathToTdFolderPath(_0x40149a){const _0x2b4c45=a105_0x316567,_0x19a4e4=a105_0x14be35[_0x2b4c45(0x102)](_0x40149a);if(_0x19a4e4==='.'||_0x19a4e4==='')return'';return _0x19a4e4[_0x2b4c45(0x114)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x4cd92d,_0x104318){const _0x26f577=a105_0x316567;if(!_0x4cd92d)return _0x104318;return a105_0x14be35[_0x26f577(0x115)](_0x104318,_0x4cd92d);}export function createTdxConfigContent(_0x1892d9){const _0x5e183a={'parent_segment':_0x1892d9};return JSON['stringify'](_0x5e183a,null,0x2)+'\x0a';}