@treasuredata/tdx 0.8.12 → 0.9.0

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 (163) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/client/cdp-api-client.js +1 -1
  10. package/dist/client/engage-api-client.js +1 -1
  11. package/dist/client/http-client.js +1 -1
  12. package/dist/client/llm-api-client.d.ts +88 -0
  13. package/dist/client/llm-api-client.d.ts.map +1 -1
  14. package/dist/client/llm-api-client.js +1 -1
  15. package/dist/client/llm-api-client.js.map +1 -1
  16. package/dist/client/rate-limiter.js +1 -1
  17. package/dist/client/td-api-client.js +1 -1
  18. package/dist/client/trino-api-client.js +1 -1
  19. package/dist/client/workflow-client.js +1 -1
  20. package/dist/commands/activations.js +1 -1
  21. package/dist/commands/agent-command.d.ts +32 -0
  22. package/dist/commands/agent-command.d.ts.map +1 -0
  23. package/dist/commands/agent-command.js +1 -0
  24. package/dist/commands/agent-command.js.map +1 -0
  25. package/dist/commands/api-command.js +1 -1
  26. package/dist/commands/auth-command.js +1 -1
  27. package/dist/commands/chat-command.d.ts +3 -2
  28. package/dist/commands/chat-command.d.ts.map +1 -1
  29. package/dist/commands/chat-command.js +1 -1
  30. package/dist/commands/chat-command.js.map +1 -1
  31. package/dist/commands/claude-command.js +1 -1
  32. package/dist/commands/claude-statusline-command.js +1 -1
  33. package/dist/commands/claude-usage-command.js +1 -1
  34. package/dist/commands/command.js +1 -1
  35. package/dist/commands/connection-command.js +1 -1
  36. package/dist/commands/context-command.js +1 -1
  37. package/dist/commands/databases.js +1 -1
  38. package/dist/commands/describe.js +1 -1
  39. package/dist/commands/engage-command.js +1 -1
  40. package/dist/commands/job-command.js +1 -1
  41. package/dist/commands/journey-command.js +1 -1
  42. package/dist/commands/llm-command.d.ts +8 -4
  43. package/dist/commands/llm-command.d.ts.map +1 -1
  44. package/dist/commands/llm-command.js +1 -1
  45. package/dist/commands/llm-command.js.map +1 -1
  46. package/dist/commands/llm-proxy.js +1 -1
  47. package/dist/commands/parent-segment-command.js +1 -1
  48. package/dist/commands/profiles-command.js +1 -1
  49. package/dist/commands/query-command.js +1 -1
  50. package/dist/commands/segment-command.js +1 -1
  51. package/dist/commands/segment-create-command.js +1 -1
  52. package/dist/commands/segment-fields-command.js +1 -1
  53. package/dist/commands/segment-pull-command.js +1 -1
  54. package/dist/commands/segment-push-command.js +1 -1
  55. package/dist/commands/segment-update-command.js +1 -1
  56. package/dist/commands/segment-use-command.js +1 -1
  57. package/dist/commands/segments.js +1 -1
  58. package/dist/commands/show.js +1 -1
  59. package/dist/commands/tables.js +1 -1
  60. package/dist/commands/use-command.d.ts +1 -0
  61. package/dist/commands/use-command.d.ts.map +1 -1
  62. package/dist/commands/use-command.js +1 -1
  63. package/dist/commands/use-command.js.map +1 -1
  64. package/dist/commands/user-command.js +1 -1
  65. package/dist/commands/workflow-command.js +1 -1
  66. package/dist/core/auth.js +1 -1
  67. package/dist/core/config.d.ts +32 -0
  68. package/dist/core/config.d.ts.map +1 -1
  69. package/dist/core/config.js +1 -1
  70. package/dist/core/config.js.map +1 -1
  71. package/dist/core/connection-cache.js +1 -1
  72. package/dist/core/credential-cache.js +1 -1
  73. package/dist/core/global-context.d.ts +1 -0
  74. package/dist/core/global-context.d.ts.map +1 -1
  75. package/dist/core/global-context.js +1 -1
  76. package/dist/core/global-context.js.map +1 -1
  77. package/dist/core/keychain.js +1 -1
  78. package/dist/core/profile.js +1 -1
  79. package/dist/core/project-config.js +1 -1
  80. package/dist/core/session.d.ts +1 -0
  81. package/dist/core/session.d.ts.map +1 -1
  82. package/dist/core/session.js +1 -1
  83. package/dist/core/session.js.map +1 -1
  84. package/dist/core/user-cache.js +1 -1
  85. package/dist/index.js +1 -1
  86. package/dist/proxy/anthropic-adapter.js +1 -1
  87. package/dist/proxy/claude-usage-tracker.js +1 -1
  88. package/dist/proxy/context-signature.js +1 -1
  89. package/dist/proxy/conversation-utils.js +1 -1
  90. package/dist/proxy/server.js +1 -1
  91. package/dist/proxy/session-cache.js +1 -1
  92. package/dist/sdk/agent/agent-yaml.d.ts +386 -0
  93. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -0
  94. package/dist/sdk/agent/agent-yaml.js +1 -0
  95. package/dist/sdk/agent/agent-yaml.js.map +1 -0
  96. package/dist/sdk/api.js +1 -1
  97. package/dist/sdk/connection.js +1 -1
  98. package/dist/sdk/engage.js +1 -1
  99. package/dist/sdk/errors.d.ts +4 -0
  100. package/dist/sdk/errors.d.ts.map +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/errors.js.map +1 -1
  103. package/dist/sdk/index.js +1 -1
  104. package/dist/sdk/job.js +1 -1
  105. package/dist/sdk/journey.js +1 -1
  106. package/dist/sdk/llm.d.ts +114 -0
  107. package/dist/sdk/llm.d.ts.map +1 -1
  108. package/dist/sdk/llm.js +1 -1
  109. package/dist/sdk/llm.js.map +1 -1
  110. package/dist/sdk/query.js +1 -1
  111. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  112. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  113. package/dist/sdk/segment/journey-yaml.js +1 -1
  114. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  115. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  116. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  117. package/dist/sdk/segment.js +1 -1
  118. package/dist/sdk/user.js +1 -1
  119. package/dist/sdk/workflow.js +1 -1
  120. package/dist/types/endpoints.d.ts +17 -0
  121. package/dist/types/endpoints.d.ts.map +1 -1
  122. package/dist/types/endpoints.js +1 -1
  123. package/dist/types/endpoints.js.map +1 -1
  124. package/dist/types/index.js +1 -1
  125. package/dist/types/llm.d.ts +203 -0
  126. package/dist/types/llm.d.ts.map +1 -1
  127. package/dist/utils/agent-config.d.ts +124 -0
  128. package/dist/utils/agent-config.d.ts.map +1 -0
  129. package/dist/utils/agent-config.js +1 -0
  130. package/dist/utils/agent-config.js.map +1 -0
  131. package/dist/utils/agent-ref-parser.js +1 -1
  132. package/dist/utils/async.js +1 -1
  133. package/dist/utils/chat-cache.js +1 -1
  134. package/dist/utils/colors.js +1 -1
  135. package/dist/utils/command-output.js +1 -1
  136. package/dist/utils/constants.js +1 -1
  137. package/dist/utils/diff.js +1 -1
  138. package/dist/utils/fields-display.js +1 -1
  139. package/dist/utils/file-permissions.js +1 -1
  140. package/dist/utils/format-detector.js +1 -1
  141. package/dist/utils/formatters.js +1 -1
  142. package/dist/utils/journey-utils.js +1 -1
  143. package/dist/utils/json-loader.js +1 -1
  144. package/dist/utils/llm-backup-utils.js +1 -1
  145. package/dist/utils/model-aliases.js +1 -1
  146. package/dist/utils/model-factors.js +1 -1
  147. package/dist/utils/option-validation.js +1 -1
  148. package/dist/utils/port.js +1 -1
  149. package/dist/utils/process.js +1 -1
  150. package/dist/utils/prompt.js +1 -1
  151. package/dist/utils/segment-path-parser.js +1 -1
  152. package/dist/utils/segment-ref-parser.js +1 -1
  153. package/dist/utils/spinner.js +1 -1
  154. package/dist/utils/sql-parser.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-config.js +1 -1
  159. package/dist/utils/tdx-logger.js +1 -1
  160. package/dist/utils/tree-formatter.js +1 -1
  161. package/dist/utils/version-check.js +1 -1
  162. package/dist/utils/workflow-utils.js +1 -1
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- const a32_0x1f6aa8=a32_0x3e35;(function(_0x49bda1,_0x1e1e16){const _0x47e066=a32_0x3e35,_0xff0790=_0x49bda1();while(!![]){try{const _0x41dd8e=parseInt(_0x47e066(0x119))/0x1+parseInt(_0x47e066(0x13e))/0x2+parseInt(_0x47e066(0x121))/0x3*(parseInt(_0x47e066(0x137))/0x4)+-parseInt(_0x47e066(0x145))/0x5*(-parseInt(_0x47e066(0x131))/0x6)+-parseInt(_0x47e066(0x11e))/0x7*(-parseInt(_0x47e066(0x132))/0x8)+parseInt(_0x47e066(0x127))/0x9+parseInt(_0x47e066(0x138))/0xa*(-parseInt(_0x47e066(0x114))/0xb);if(_0x41dd8e===_0x1e1e16)break;else _0xff0790['push'](_0xff0790['shift']());}catch(_0x441c80){_0xff0790['push'](_0xff0790['shift']());}}}(a32_0x58b7,0x6b5fe));import{BaseCommand}from'./command.js';function a32_0x3e35(_0x247fd7,_0x4f03f6){_0x247fd7=_0x247fd7-0x114;const _0x58b70e=a32_0x58b7();let _0x3e3510=_0x58b70e[_0x247fd7];return _0x3e3510;}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a32_0x58b7(){const _0x4482bf=['noCountPopulation','6QFejZv','8JvFvjn','execute','site','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x27...','4TtQXHb','10UVakVi','resolvePathToResource','length','segment','segmentPath','Target\x20path:\x20','1188282rNwtHB','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Examples:','resolveParentId','verbose','parent','Resolving\x20folder\x20\x27','1449400dAlcaV','Resolving\x20folder\x20path\x20\x27','32786622JhRsVb','kind','name','yellow','error','746622pznrss','Creating\x20segment\x20\x27','type','createSegment','description','2672061LWtguh','Site:\x20','Resolved\x20folder\x20ID:\x20','2170761ZCnJhz','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segments','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','resolveFolderId','6160095JMXagW','Create\x20child\x20segment\x20with\x20filtering\x20rules','folder','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Segment\x20name:\x20','✔\x20Created\x20segment\x20\x27','data','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'];a32_0x58b7=function(){return _0x4482bf;};return a32_0x58b7();}import a32_0x2cf0d3 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x1f6aa8(0x116)]='segment:create';[a32_0x1f6aa8(0x11d)]=a32_0x1f6aa8(0x128);async[a32_0x1f6aa8(0x133)](_0x3db6e7){const _0x84e3a9=a32_0x1f6aa8;console[_0x84e3a9(0x118)](a32_0x2cf0d3['yellow'](_0x84e3a9(0x12e))),console[_0x84e3a9(0x118)](a32_0x2cf0d3[_0x84e3a9(0x117)](_0x84e3a9(0x135)));const {options:_0x12adc9,args:_0x11377f,tdx:_0x223a41}=_0x3db6e7,_0x4a3b7b=_0x12adc9;if(_0x11377f['length']===0x0)return console[_0x84e3a9(0x118)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x84e3a9(0x12a)),console[_0x84e3a9(0x118)](_0x84e3a9(0x140)),console[_0x84e3a9(0x118)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console['error'](_0x84e3a9(0x123)),console[_0x84e3a9(0x118)](_0x84e3a9(0x13f)),0x1;const _0x5652e7=_0x11377f[0x0],_0x48660b=_0x12adc9[_0x84e3a9(0x13c)];let _0x4d2af9=_0x5652e7;_0x48660b&&!_0x5652e7['includes']('/')&&(_0x4d2af9=_0x48660b+'/'+_0x5652e7,_0x4a3b7b['verbose']&&console[_0x84e3a9(0x118)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4d2af9));const _0x25d27f=parsePath(_0x4d2af9);if(_0x25d27f[_0x84e3a9(0x124)][_0x84e3a9(0x13a)]<0x2)return console['error'](_0x84e3a9(0x125)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x540926=_0x25d27f[_0x84e3a9(0x124)][0x0],_0x1b7983=getBaseName(_0x4d2af9),_0x5826b9=getParentPath(_0x4d2af9);_0x4a3b7b[_0x84e3a9(0x142)]&&(console[_0x84e3a9(0x118)](_0x84e3a9(0x11f)+_0x4a3b7b[_0x84e3a9(0x134)]),console[_0x84e3a9(0x118)](_0x84e3a9(0x13d)+_0x4d2af9),console['error']('Parent:\x20'+_0x540926),console[_0x84e3a9(0x118)](_0x84e3a9(0x12b)+_0x1b7983),console[_0x84e3a9(0x118)]('Parent\x20path:\x20'+_0x5826b9));const _0x4081a6=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x540926+_0x84e3a9(0x136),()=>_0x223a41[_0x84e3a9(0x13b)][_0x84e3a9(0x141)](_0x540926),{'verbose':_0x4a3b7b[_0x84e3a9(0x142)]}),_0x81f8cd=_0x4081a6[_0x84e3a9(0x12d)];let _0x5303fa;if(_0x25d27f[_0x84e3a9(0x124)][_0x84e3a9(0x13a)]>0x2){const _0x3ee738=await withSpinner(_0x84e3a9(0x146)+_0x5826b9+_0x84e3a9(0x136),()=>_0x223a41[_0x84e3a9(0x13b)][_0x84e3a9(0x139)](_0x5826b9),{'verbose':_0x4a3b7b[_0x84e3a9(0x142)]}),_0x581985=_0x3ee738[_0x84e3a9(0x12d)];if(_0x581985[_0x84e3a9(0x11b)]!==_0x84e3a9(0x129)&&_0x581985[_0x84e3a9(0x11b)]!==_0x84e3a9(0x143))return console[_0x84e3a9(0x118)](_0x84e3a9(0x12f)),0x1;_0x5303fa=_0x581985['folderId'];}else{if(_0x4a3b7b[_0x84e3a9(0x129)]){const _0x20d7f3=await withSpinner(_0x84e3a9(0x144)+_0x4a3b7b[_0x84e3a9(0x129)]+'\x27...',()=>_0x223a41[_0x84e3a9(0x13b)][_0x84e3a9(0x126)](_0x81f8cd,_0x4a3b7b[_0x84e3a9(0x129)]),{'verbose':_0x4a3b7b['verbose']});_0x5303fa=_0x20d7f3[_0x84e3a9(0x12d)];}}_0x4a3b7b[_0x84e3a9(0x142)]&&_0x5303fa&&console[_0x84e3a9(0x118)](_0x84e3a9(0x120)+_0x5303fa);const _0x553019=await loadJSONFromOptions(_0x4a3b7b['rule'],_0x4a3b7b['ruleFile']),_0x2dd7b6={'name':_0x1b7983,'description':_0x4a3b7b[_0x84e3a9(0x11d)],'rule':_0x553019,'kind':_0x4a3b7b[_0x84e3a9(0x115)]!==undefined?parseInt(_0x4a3b7b['kind'],0xa):undefined,'isVisible':_0x4a3b7b['invisible']?![]:undefined,'segmentFolderId':_0x5303fa,'countPopulation':_0x4a3b7b[_0x84e3a9(0x130)]?![]:undefined},_0x561829=await withSpinner(_0x84e3a9(0x11a)+_0x1b7983+_0x84e3a9(0x136),()=>_0x223a41['segment'][_0x84e3a9(0x11c)](_0x81f8cd,_0x2dd7b6),{'verbose':_0x4a3b7b['verbose']}),_0x407c75=_0x561829['data'];return console[_0x84e3a9(0x118)](_0x84e3a9(0x12c)+_0x407c75['name']+_0x84e3a9(0x122)+_0x407c75['id']),_0x4d2af9!==_0x5652e7&&console[_0x84e3a9(0x118)]('\x20\x20\x20Path:\x20'+_0x4d2af9),await handleSDKOutput([_0x407c75],_0x4a3b7b),0x0;}}
1
+ const a33_0x252783=a33_0x49e1;(function(_0x4e5308,_0x1fa83f){const _0x3034d3=a33_0x49e1,_0x424687=_0x4e5308();while(!![]){try{const _0x2ca0b2=parseInt(_0x3034d3(0xcc))/0x1*(parseInt(_0x3034d3(0xa9))/0x2)+-parseInt(_0x3034d3(0x9f))/0x3+parseInt(_0x3034d3(0xb7))/0x4*(parseInt(_0x3034d3(0xb6))/0x5)+-parseInt(_0x3034d3(0xaa))/0x6*(-parseInt(_0x3034d3(0xa6))/0x7)+parseInt(_0x3034d3(0xba))/0x8*(parseInt(_0x3034d3(0xb4))/0x9)+-parseInt(_0x3034d3(0x9c))/0xa*(parseInt(_0x3034d3(0xc6))/0xb)+-parseInt(_0x3034d3(0xd9))/0xc*(parseInt(_0x3034d3(0xad))/0xd);if(_0x2ca0b2===_0x1fa83f)break;else _0x424687['push'](_0x424687['shift']());}catch(_0x27cb38){_0x424687['push'](_0x424687['shift']());}}}(a33_0x3844,0xcc528));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a33_0x49e1(_0x1b0847,_0x5c107d){_0x1b0847=_0x1b0847-0x9c;const _0x3844ec=a33_0x3844();let _0x49e142=_0x3844ec[_0x1b0847];return _0x49e142;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a33_0x3dc2a5 from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a33_0x252783(0xbb);[a33_0x252783(0xcd)]=a33_0x252783(0xab);async[a33_0x252783(0xc0)](_0x3a1f56){const _0x49fb3a=a33_0x252783;console[_0x49fb3a(0xce)](a33_0x3dc2a5[_0x49fb3a(0xb0)](_0x49fb3a(0xd0))),console['error'](a33_0x3dc2a5[_0x49fb3a(0xb0)](_0x49fb3a(0xa2)));const {options:_0x140ac8,args:_0x462ddd,tdx:_0x408b14}=_0x3a1f56,_0xb914f7=_0x140ac8;if(_0x462ddd[_0x49fb3a(0xa0)]===0x0)return console[_0x49fb3a(0xce)](_0x49fb3a(0xcb)),console[_0x49fb3a(0xce)](_0x49fb3a(0xc5)),console[_0x49fb3a(0xce)](_0x49fb3a(0xd2)),console['error'](_0x49fb3a(0xc1)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x49fb3a(0xce)](_0x49fb3a(0xb1)),0x1;const _0x4dc331=_0x462ddd[0x0],_0x432f23=_0x140ac8[_0x49fb3a(0xbd)];let _0x2dfa11=_0x4dc331;_0x432f23&&!_0x4dc331[_0x49fb3a(0xd7)]('/')&&(_0x2dfa11=_0x432f23+'/'+_0x4dc331,_0xb914f7[_0x49fb3a(0xac)]&&console[_0x49fb3a(0xce)](_0x49fb3a(0xae)+_0x2dfa11));const _0x5bd8e9=parsePath(_0x2dfa11);if(_0x5bd8e9[_0x49fb3a(0xd5)][_0x49fb3a(0xa0)]<0x2)return console['error'](_0x49fb3a(0xbc)),console[_0x49fb3a(0xce)](_0x49fb3a(0xd6)),0x1;const _0x36b3a3=_0x5bd8e9[_0x49fb3a(0xd5)][0x0],_0x52a761=getBaseName(_0x2dfa11),_0x464cea=getParentPath(_0x2dfa11);_0xb914f7['verbose']&&(console[_0x49fb3a(0xce)]('Site:\x20'+_0xb914f7[_0x49fb3a(0xcf)]),console['error'](_0x49fb3a(0xa8)+_0x2dfa11),console[_0x49fb3a(0xce)](_0x49fb3a(0xa7)+_0x36b3a3),console[_0x49fb3a(0xce)](_0x49fb3a(0xa5)+_0x52a761),console[_0x49fb3a(0xce)](_0x49fb3a(0xc2)+_0x464cea));const _0x10c979=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x36b3a3+_0x49fb3a(0xd4),()=>_0x408b14[_0x49fb3a(0xd1)][_0x49fb3a(0xa3)](_0x36b3a3),{'verbose':_0xb914f7[_0x49fb3a(0xac)]}),_0x11547f=_0x10c979[_0x49fb3a(0xc8)];let _0x29cdb2;if(_0x5bd8e9[_0x49fb3a(0xd5)][_0x49fb3a(0xa0)]>0x2){const _0x287be8=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x464cea+_0x49fb3a(0xd4),()=>_0x408b14[_0x49fb3a(0xd1)][_0x49fb3a(0xca)](_0x464cea),{'verbose':_0xb914f7[_0x49fb3a(0xac)]}),_0x323c98=_0x287be8['data'];if(_0x323c98[_0x49fb3a(0xc3)]!==_0x49fb3a(0xc9)&&_0x323c98[_0x49fb3a(0xc3)]!==_0x49fb3a(0xc7))return console[_0x49fb3a(0xce)](_0x49fb3a(0x9e)),0x1;_0x29cdb2=_0x323c98[_0x49fb3a(0xbf)];}else{if(_0xb914f7['folder']){const _0xa395e3=await withSpinner(_0x49fb3a(0xaf)+_0xb914f7[_0x49fb3a(0xc9)]+'\x27...',()=>_0x408b14['segment'][_0x49fb3a(0x9d)](_0x11547f,_0xb914f7[_0x49fb3a(0xc9)]),{'verbose':_0xb914f7[_0x49fb3a(0xac)]});_0x29cdb2=_0xa395e3['data'];}}_0xb914f7[_0x49fb3a(0xac)]&&_0x29cdb2&&console[_0x49fb3a(0xce)](_0x49fb3a(0xb9)+_0x29cdb2);const _0x29d470=await loadJSONFromOptions(_0xb914f7[_0x49fb3a(0xb5)],_0xb914f7[_0x49fb3a(0xd3)]),_0x5ba15d={'name':_0x52a761,'description':_0xb914f7[_0x49fb3a(0xcd)],'rule':_0x29d470,'kind':_0xb914f7[_0x49fb3a(0xbe)]!==undefined?parseInt(_0xb914f7['kind'],0xa):undefined,'isVisible':_0xb914f7[_0x49fb3a(0xd8)]?![]:undefined,'segmentFolderId':_0x29cdb2,'countPopulation':_0xb914f7[_0x49fb3a(0xb2)]?![]:undefined},_0x22d7a0=await withSpinner(_0x49fb3a(0xa4)+_0x52a761+'\x27...',()=>_0x408b14[_0x49fb3a(0xd1)]['createSegment'](_0x11547f,_0x5ba15d),{'verbose':_0xb914f7['verbose']}),_0x50f408=_0x22d7a0[_0x49fb3a(0xc8)];return console['error'](_0x49fb3a(0xc4)+_0x50f408[_0x49fb3a(0xb8)]+_0x49fb3a(0xb3)+_0x50f408['id']),_0x2dfa11!==_0x4dc331&&console['error'](_0x49fb3a(0xa1)+_0x2dfa11),await handleSDKOutput([_0x50f408],_0xb914f7),0x0;}}function a33_0x3844(){const _0xd18ac=['2939718hWedVC','length','\x20\x20\x20Path:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','resolveParentId','Creating\x20segment\x20\x27','Segment\x20name:\x20','1491QsFHix','Parent:\x20','Target\x20path:\x20','4eZmxzy','42918bwaJrK','Create\x20child\x20segment\x20with\x20filtering\x20rules','verbose','247pQbwGV','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20folder\x20\x27','yellow','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','noCountPopulation','\x27\x20with\x20ID:\x20','261ACuhIq','rule','20TUdcty','1671176kLZGgY','name','Resolved\x20folder\x20ID:\x20','421712RDtrHa','segment:create','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segmentPath','kind','folderId','execute','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Parent\x20path:\x20','type','✔\x20Created\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','66IrYJJP','parent','data','folder','resolvePathToResource','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','371519CqZtRu','description','error','site','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','segment','Examples:','ruleFile','\x27...','segments','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','includes','invisible','2286300MhLolN','49540kGGNSZ','resolveFolderId','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'];a33_0x3844=function(){return _0xd18ac;};return a33_0x3844();}
@@ -1 +1 @@
1
- const a33_0x48e536=a33_0x4ea4;(function(_0x2eae1a,_0x3fd490){const _0x124f6d=a33_0x4ea4,_0x2bf6f5=_0x2eae1a();while(!![]){try{const _0x3e28c2=parseInt(_0x124f6d(0x205))/0x1*(-parseInt(_0x124f6d(0x1ed))/0x2)+-parseInt(_0x124f6d(0x1f8))/0x3*(parseInt(_0x124f6d(0x1f2))/0x4)+-parseInt(_0x124f6d(0x1f6))/0x5+-parseInt(_0x124f6d(0x1fd))/0x6+-parseInt(_0x124f6d(0x1f5))/0x7*(parseInt(_0x124f6d(0x209))/0x8)+-parseInt(_0x124f6d(0x1ff))/0x9*(parseInt(_0x124f6d(0x1fa))/0xa)+parseInt(_0x124f6d(0x20a))/0xb*(parseInt(_0x124f6d(0x1ef))/0xc);if(_0x3e28c2===_0x3fd490)break;else _0x2bf6f5['push'](_0x2bf6f5['shift']());}catch(_0x3cf2b5){_0x2bf6f5['push'](_0x2bf6f5['shift']());}}}(a33_0x4455,0xeb13e));function a33_0x4ea4(_0x56a6e4,_0x46b153){_0x56a6e4=_0x56a6e4-0x1ed;const _0x445593=a33_0x4455();let _0x4ea4d5=_0x445593[_0x56a6e4];return _0x4ea4d5;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a33_0x48e536(0x206)]=a33_0x48e536(0x1f4);[a33_0x48e536(0x200)]=a33_0x48e536(0x1fc);async[a33_0x48e536(0x208)](_0x571644){const _0x203a25=a33_0x48e536,{options:_0x1c5b88,args:_0x13a1f4,tdx:_0x323e26}=_0x571644,_0x510647=_0x13a1f4[0x0]||_0x1c5b88[_0x203a25(0x207)];if(!_0x510647)return console['error'](_0x203a25(0x1f0)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x203a25(0x1f3)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x1c5b88[_0x203a25(0x20b)]&&(console[_0x203a25(0x1f3)]('Site:\x20'+_0x1c5b88[_0x203a25(0x1ee)]),console[_0x203a25(0x1f3)](_0x203a25(0x202)+_0x510647));const _0x4aad10=await withSpinner(_0x203a25(0x204)+_0x510647+_0x203a25(0x201),()=>_0x323e26[_0x203a25(0x203)][_0x203a25(0x1f7)](_0x510647),{'verbose':_0x1c5b88[_0x203a25(0x20b)]}),_0x527a77=_0x4aad10['data'];console[_0x203a25(0x1f3)](_0x203a25(0x20c)+_0x527a77[_0x203a25(0x1fe)]+_0x203a25(0x1fb)+(_0x527a77[_0x203a25(0x1fe)]!==0x1?'s':''));if(_0x1c5b88[_0x203a25(0x1f9)]||_0x1c5b88[_0x203a25(0x1f1)])return await handleSDKOutput(_0x527a77,_0x1c5b88),0x0;return displayFieldsHumanReadable(_0x527a77,_0x510647),0x0;}}function a33_0x4455(){const _0x11de63=['segment:fields','1337rFQDQr','1024555iUNQKh','listFields','2586nlTxUc','json','3572930AQDRYZ','\x20field','List\x20available\x20fields\x20for\x20segmentation','6216072ojadpN','length','45riNYNE','description','\x27...','Parent\x20segment:\x20','segment','Listing\x20fields\x20for\x20\x27','21858RLWMTr','name','parentSegment','execute','248CXOgxA','1749JiWaOp','verbose','✔\x20Found\x20','118LFcoIK','site','424236MTnLtm','Error:\x20Parent\x20segment\x20name\x20is\x20required','jsonl','1556LQJFAm','error'];a33_0x4455=function(){return _0x11de63;};return a33_0x4455();}
1
+ const a34_0xc8407c=a34_0xc464;(function(_0x126f85,_0x567b4f){const _0x2194f7=a34_0xc464,_0x56123f=_0x126f85();while(!![]){try{const _0x568d88=parseInt(_0x2194f7(0xe2))/0x1*(parseInt(_0x2194f7(0xfa))/0x2)+parseInt(_0x2194f7(0xe3))/0x3+parseInt(_0x2194f7(0xe6))/0x4+parseInt(_0x2194f7(0xe7))/0x5+parseInt(_0x2194f7(0xf1))/0x6*(-parseInt(_0x2194f7(0xf5))/0x7)+parseInt(_0x2194f7(0xe9))/0x8+-parseInt(_0x2194f7(0xf0))/0x9;if(_0x568d88===_0x567b4f)break;else _0x56123f['push'](_0x56123f['shift']());}catch(_0x47c95a){_0x56123f['push'](_0x56123f['shift']());}}}(a34_0x2c34,0xd10b3));function a34_0xc464(_0x478e99,_0x47c646){_0x478e99=_0x478e99-0xdf;const _0x2c3416=a34_0x2c34();let _0xc464fb=_0x2c3416[_0x478e99];return _0xc464fb;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a34_0xc8407c(0xe0)]='segment:fields';[a34_0xc8407c(0xf8)]=a34_0xc8407c(0xeb);async[a34_0xc8407c(0xee)](_0x243cd4){const _0x3a71ae=a34_0xc8407c,{options:_0x14f99a,args:_0x22081b,tdx:_0x6838df}=_0x243cd4,_0x3b8e34=_0x22081b[0x0]||_0x14f99a[_0x3a71ae(0xf3)];if(!_0x3b8e34)return console[_0x3a71ae(0xed)](_0x3a71ae(0xec)),console[_0x3a71ae(0xed)](_0x3a71ae(0xe1)),console[_0x3a71ae(0xed)](_0x3a71ae(0xf2)),0x1;_0x14f99a[_0x3a71ae(0xf4)]&&(console['error'](_0x3a71ae(0xe8)+_0x14f99a['site']),console[_0x3a71ae(0xed)](_0x3a71ae(0xef)+_0x3b8e34));const _0x3ed610=await withSpinner(_0x3a71ae(0xea)+_0x3b8e34+_0x3a71ae(0xe4),()=>_0x6838df[_0x3a71ae(0xf6)]['listFields'](_0x3b8e34),{'verbose':_0x14f99a[_0x3a71ae(0xf4)]}),_0x28951b=_0x3ed610[_0x3a71ae(0xe5)];console[_0x3a71ae(0xed)]('✔\x20Found\x20'+_0x28951b[_0x3a71ae(0xf7)]+_0x3a71ae(0xdf)+(_0x28951b[_0x3a71ae(0xf7)]!==0x1?'s':''));if(_0x14f99a['json']||_0x14f99a[_0x3a71ae(0xf9)])return await handleSDKOutput(_0x28951b,_0x14f99a),0x0;return displayFieldsHumanReadable(_0x28951b,_0x3b8e34),0x0;}}function a34_0x2c34(){const _0x377523=['\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parentSegment','verbose','42QbmSwb','segment','length','description','jsonl','144770YMZkFz','\x20field','name','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','11hhcUwp','2956539BlzVlD','\x27...','data','4772804dAKVOo','7784590zIFYXp','Site:\x20','11536744mIgbdE','Listing\x20fields\x20for\x20\x27','List\x20available\x20fields\x20for\x20segmentation','Error:\x20Parent\x20segment\x20name\x20is\x20required','error','execute','Parent\x20segment:\x20','31882347hqvNSq','1575234TALpsv'];a34_0x2c34=function(){return _0x377523;};return a34_0x2c34();}
@@ -1 +1 @@
1
- const a34_0x2c95b8=a34_0x45c8;(function(_0x580615,_0x4e824b){const _0x1ccff8=a34_0x45c8,_0x8e9ee=_0x580615();while(!![]){try{const _0x138df5=parseInt(_0x1ccff8(0x1ed))/0x1*(parseInt(_0x1ccff8(0x1ae))/0x2)+parseInt(_0x1ccff8(0x211))/0x3*(parseInt(_0x1ccff8(0x1e5))/0x4)+parseInt(_0x1ccff8(0x1d0))/0x5+parseInt(_0x1ccff8(0x1f1))/0x6*(parseInt(_0x1ccff8(0x1b3))/0x7)+parseInt(_0x1ccff8(0x212))/0x8*(-parseInt(_0x1ccff8(0x1ad))/0x9)+-parseInt(_0x1ccff8(0x1f4))/0xa*(-parseInt(_0x1ccff8(0x1dc))/0xb)+parseInt(_0x1ccff8(0x1c9))/0xc*(-parseInt(_0x1ccff8(0x1ab))/0xd);if(_0x138df5===_0x4e824b)break;else _0x8e9ee['push'](_0x8e9ee['shift']());}catch(_0x3d7dca){_0x8e9ee['push'](_0x8e9ee['shift']());}}}(a34_0x187d,0xf40db));import{BaseCommand}from'./command.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';function a34_0x45c8(_0x36a8f7,_0x232d34){_0x36a8f7=_0x36a8f7-0x1a8;const _0x187d23=a34_0x187d();let _0x45c89c=_0x187d23[_0x36a8f7];return _0x45c89c;}import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';import{apiToYamlAsync,toYamlString as a34_0x4e305b}from'../sdk/segment/journey-yaml.js';import a34_0x2ac790 from'chalk';import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a34_0x254046 from'path';function a34_0x187d(){const _0x2536b1=['44aWiDxM','Fetching\x20connections\x20for\x20name\x20resolution...','Processing\x20journeys...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','length','reduce','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','dim','304462qrYiBd','buildIdToEmailMap','session','get','10059864iBgHPO','content','connection','90IUQcOD','isDirectory','\x20with\x20','Write\x20','dirname','\x0aPull\x20summary\x20for\x20\x27','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','getJourney','diff','Site:\x20','Fetching\x20parent\x20segment\x20info...','Fetching\x20segments...','listActivations','error','journey','✔\x20All\x20files\x20are\x20up\x20to\x20date','Fetching\x20journeys...','absolutePath','yellow','\x20\x20🎯\x20','has','message','buildIdToNameMap','.yml','\x20files\x20to\x20','folderId','add','Fetching\x20users\x20for\x20email\x20resolution...','journeyBundleName','79713RWoBUn','3890792uMHyPu','yaml','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','green','verbose','segment:pull','utf-8','activationParams','segment','slice','then','parent_segment','versionNumber','155597SubHGB','data','9RBHFYZ','4zTCFAR','parentFolderId','\x20\x20🗺️\x20\x20','filter','sort','7QrJhDN','\x20\x20Target:\x20','Using\x20parent\x20segment:\x20','listFolders','size','rule','all','red','Resolving\x20parent\x20segment\x20\x27','getParent','Aborted.','Fetching\x20folders...','attributes','push','tdx.json','\x20new\x20files','relative','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','parentSegment','\x20files?','kind','description','3036QbMtRn','from','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','execute','repeat','cyan','set','6474485aCXnoN','values','isNew','setExtra','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Warning:\x20Could\x20not\x20resolve\x20activation\x20','site','setPhase','yes','hasChanges','join','\x27...','783937SEQowK','Found\x20existing\x20tdx.json\x20at:\x20','\x0aChanges\x20to\x20\x27','resolveParentId','Found\x20tdx.json\x20at:\x20','✔\x20Context\x20set:\x20','audienceId','Fetching\x20activations...','name'];a34_0x187d=function(){return _0x2536b1;};return a34_0x187d();}import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{['name']=a34_0x2c95b8(0x218);[a34_0x2c95b8(0x1c8)]=a34_0x2c95b8(0x1c4);async[a34_0x2c95b8(0x1cc)](_0x5e8d4e){const _0x407a7b=a34_0x2c95b8,{options:_0x50613e,args:_0x514290,tdx:_0x11ea95}=_0x5e8d4e,_0x45f276=_0x50613e,_0x27fd04=_0x50613e[_0x407a7b(0x1c5)],_0x584a6b=_0x514290[0x0],_0x1cd7ac=findTdxConfigPath();let _0xc96684,_0x1db2ea;if(!_0x584a6b&&_0x1cd7ac){const _0x4cf69e=loadTdxConfig(_0x1cd7ac);_0xc96684=_0x4cf69e[_0x407a7b(0x1a9)],_0x1db2ea=a34_0x254046[_0x407a7b(0x1f8)](_0x1cd7ac),_0x45f276[_0x407a7b(0x217)]&&(console[_0x407a7b(0x201)](_0x407a7b(0x1dd)+_0x1cd7ac),console[_0x407a7b(0x201)](_0x407a7b(0x1b5)+_0xc96684));}else{if(_0x584a6b){if(existsSync(_0x584a6b)&&statSync(_0x584a6b)[_0x407a7b(0x1f5)]()){const _0x1dda04=findTdxConfigPath(_0x584a6b);if(_0x1dda04){const _0x54d5c6=loadTdxConfig(_0x1dda04);_0xc96684=_0x54d5c6['parent_segment'],_0x1db2ea=a34_0x254046['dirname'](_0x1dda04),_0x45f276['verbose']&&(console[_0x407a7b(0x201)](_0x407a7b(0x1e0)+_0x1dda04),console['error']('Using\x20parent\x20segment:\x20'+_0xc96684));}else return console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x1ba)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x584a6b+'\x0a')),console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x1ce)](_0x407a7b(0x1eb))),0x1;}else _0xc96684=_0x584a6b;}else _0xc96684=_0x27fd04;}if(!_0xc96684)return console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x206)](_0x407a7b(0x215))),console[_0x407a7b(0x201)](_0x407a7b(0x1fa)),console[_0x407a7b(0x201)](_0x407a7b(0x1d4)),console[_0x407a7b(0x201)](_0x407a7b(0x1e8)),0x1;_0x45f276[_0x407a7b(0x217)]&&(console['error'](_0x407a7b(0x1fd)+_0x45f276[_0x407a7b(0x1d6)]),console[_0x407a7b(0x201)]('Parent\x20segment:\x20'+_0xc96684));const _0xa3058b=await withSpinner(_0x407a7b(0x1bb)+_0xc96684+_0x407a7b(0x1db),()=>_0x11ea95[_0x407a7b(0x21b)][_0x407a7b(0x1df)](_0xc96684),{'verbose':_0x45f276[_0x407a7b(0x217)]}),_0x2adc1c=_0xa3058b[_0x407a7b(0x1ac)],_0x16ad9a=await withSpinner(_0x407a7b(0x1fe),()=>_0x11ea95[_0x407a7b(0x21b)][_0x407a7b(0x1bc)](_0x2adc1c),{'verbose':_0x45f276['verbose']}),_0x7df88=_0x16ad9a[_0x407a7b(0x1ac)][_0x407a7b(0x1bf)][_0x407a7b(0x1e4)];_0x45f276[_0x407a7b(0x217)]&&console[_0x407a7b(0x201)]('Resolved\x20parent\x20name:\x20'+_0x7df88);const [_0x1cba86,_0x27ab80,_0x45dd26]=await Promise[_0x407a7b(0x1b9)]([withSpinner(_0x407a7b(0x1ff),()=>_0x11ea95[_0x407a7b(0x21b)]['listSegments'](_0x2adc1c),{'verbose':_0x45f276[_0x407a7b(0x217)]}),withSpinner(_0x407a7b(0x1be),()=>_0x11ea95[_0x407a7b(0x21b)][_0x407a7b(0x1b6)](_0x2adc1c),{'verbose':_0x45f276['verbose']}),withSpinner(_0x407a7b(0x204),()=>_0x11ea95['journey']['listJourneysFromParentSegment'](_0x2adc1c),{'verbose':_0x45f276[_0x407a7b(0x217)]})]),_0xf324e0=_0x1cba86[_0x407a7b(0x1ac)],_0x47d008=_0x27ab80[_0x407a7b(0x1ac)],_0x37fee4=_0x45dd26[_0x407a7b(0x1ac)];if(_0xf324e0[_0x407a7b(0x1e9)]===0x0&&_0x37fee4[_0x407a7b(0x1e9)]===0x0)return console['error'](a34_0x2ac790['yellow'](_0x407a7b(0x214)+_0x7df88+'\x27')),0x0;const _0x2f83e8=buildFolderPathMap(_0x47d008),_0x127bd0=_0x1db2ea||getSegmentRootDir(sanitizeFileName(_0xc96684)),_0x2ba2dd=new Map();await withSpinner(_0x407a7b(0x1e3),async()=>{await batchAsync(_0xf324e0,async _0x19b5a6=>{const _0x48967e=a34_0x45c8,_0x13d38f=await _0x11ea95['segment'][_0x48967e(0x200)](_0x2adc1c,_0x19b5a6['id']);_0x2ba2dd[_0x48967e(0x1cf)](_0x19b5a6['id'],_0x13d38f);});},{'verbose':_0x45f276[_0x407a7b(0x217)]});const _0x12daa4=await withSpinner(_0x407a7b(0x20f),()=>_0x11ea95['user'][_0x407a7b(0x1ee)](),{'verbose':_0x45f276[_0x407a7b(0x217)]})[_0x407a7b(0x1a8)](_0x42c85d=>_0x42c85d[_0x407a7b(0x1ac)]),_0x39d4c8=await withSpinner(_0x407a7b(0x1e6),()=>_0x11ea95[_0x407a7b(0x1f3)][_0x407a7b(0x20a)](),{'verbose':_0x45f276[_0x407a7b(0x217)]})[_0x407a7b(0x1a8)](_0x4ebfe9=>_0x4ebfe9[_0x407a7b(0x1ac)]),_0x40d600=[],_0x57e410=a34_0x254046['join'](_0x127bd0,_0x407a7b(0x1c1)),_0x3861ca=createTdxConfigContent(_0x7df88);_0x40d600[_0x407a7b(0x1c0)](prepareFile(_0x57e410,_0x3861ca,_0x127bd0));const _0x41bb46=new Map();for(const _0x58180f of _0xf324e0){if(_0x58180f[_0x407a7b(0x1c7)]===SEGMENT_KIND_JOURNEY)continue;const _0x3d8136=_0x58180f['segmentFolderId']?_0x2f83e8[_0x407a7b(0x1f0)](_0x58180f['segmentFolderId'])||'':'',_0x4fbb0c=_0x2ba2dd[_0x407a7b(0x1f0)](_0x58180f['id'])||[],_0x138116=segmentWithActivationsToYaml(_0x58180f,_0x4fbb0c,undefined,_0x12daa4,_0x39d4c8),_0x44675f=_0x3d8136?a34_0x254046[_0x407a7b(0x1da)](_0x127bd0,_0x3d8136):_0x127bd0,_0x28bd76=sanitizeFileName(_0x58180f[_0x407a7b(0x1e4)]),_0x557882=getUniqueFileName(_0x44675f,_0x28bd76,_0x41bb46),_0x1c66d8=a34_0x254046['join'](_0x44675f,_0x557882+'.yml'),_0x4b7c7c=segmentToYamlString(_0x138116);_0x40d600[_0x407a7b(0x1c0)](prepareFile(_0x1c66d8,_0x4b7c7c,_0x127bd0));}const _0x5d63dd=new Map();for(const _0x3d88ca of _0xf324e0){_0x5d63dd[_0x407a7b(0x1cf)](_0x3d88ca['id'],_0x3d88ca);}const _0x4392af=new Map();for(const _0x391d70 of _0x37fee4){const _0x449c9e=_0x391d70['journeyBundleId'];!_0x4392af[_0x407a7b(0x208)](_0x449c9e)&&_0x4392af['set'](_0x449c9e,[]),_0x4392af[_0x407a7b(0x1f0)](_0x449c9e)[_0x407a7b(0x1c0)](_0x391d70);}for(const _0x3017fd of _0x4392af[_0x407a7b(0x1d1)]()){_0x3017fd[_0x407a7b(0x1b2)]((_0x5422f0,_0x389e3e)=>(_0x5422f0[_0x407a7b(0x1aa)]||0x0)-(_0x389e3e['versionNumber']||0x0));}const _0x18f2a0=()=>{const _0x556b0e=_0x407a7b,_0x268cb7=new Set(),_0x47249b=new Set(),_0x3684e0=new Map(),_0x557148=new Map(),_0x427792=createJumpTargetCache(),_0x2c1e55=(_0x43e3d0,_0x485580)=>({'resolveSegment':async _0x307c15=>{const _0xe2ffd0=a34_0x45c8,_0x3b2210=_0x3684e0[_0xe2ffd0(0x1f0)](_0x307c15);if(_0x3b2210!==undefined)return{'name':_0x3b2210,'isJourneyLocal':!![]};if(!_0x485580)return{'name':_0x307c15,'isJourneyLocal':![]};try{let _0x38c140=_0x5d63dd[_0xe2ffd0(0x1f0)](_0x307c15);!_0x38c140&&(_0x38c140=await _0x11ea95[_0xe2ffd0(0x21b)]['getSegment'](_0x485580,_0x307c15));const _0x2359f2=generateJourneyLocalName(_0x38c140['name']),_0x3ce5ef=_0x38c140[_0xe2ffd0(0x1c7)]===SEGMENT_KIND_JOURNEY&&_0x2359f2!==undefined;let _0x525d2e=_0x38c140['name'];if(_0x3ce5ef&&_0x2359f2){let _0x294f94=_0x2359f2,_0x2c649c=0x2;while(_0x268cb7[_0xe2ffd0(0x208)](_0x294f94)){_0x294f94=_0x2359f2+'_'+_0x2c649c,_0x2c649c++;}_0x268cb7[_0xe2ffd0(0x20e)](_0x294f94),_0x525d2e=_0x294f94,_0x3684e0[_0xe2ffd0(0x1cf)](_0x307c15,_0x525d2e);}let _0x2fa309;return _0x3ce5ef&&_0x38c140[_0xe2ffd0(0x1b8)]&&(_0x2fa309={'description':_0x38c140['description'],'rule':apiRuleToYaml(_0x38c140['rule'])}),{'name':_0x525d2e,'isJourneyLocal':_0x3ce5ef,'definition':_0x2fa309};}catch(_0x4e1260){return _0x45f276[_0xe2ffd0(0x217)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x307c15+':\x20'+_0x4e1260[_0xe2ffd0(0x209)]),{'name':_0x307c15,'isJourneyLocal':![]};}},'resolveActivation':async _0xcecb77=>{const _0x207f9f=a34_0x45c8,_0x3aa667=_0x557148[_0x207f9f(0x1f0)](_0xcecb77);if(_0x3aa667!==undefined)return{'name':_0x3aa667,'isJourneyLocal':!![]};try{const _0x572998=await _0x11ea95[_0x207f9f(0x202)]['getActivation'](_0x43e3d0,_0xcecb77),_0x457714=_0x572998[_0x207f9f(0x1bf)][_0x207f9f(0x21a)][_0x207f9f(0x1e4)]||_0xcecb77,_0x2a678c=sanitizeYamlKey(_0x457714)||'activation_'+_0xcecb77;let _0xb7e1bb=_0x2a678c,_0xa77447=0x2;while(_0x47249b[_0x207f9f(0x208)](_0xb7e1bb)){_0xb7e1bb=_0x2a678c+'_'+_0xa77447,_0xa77447++;}_0x47249b[_0x207f9f(0x20e)](_0xb7e1bb),_0x557148[_0x207f9f(0x1cf)](_0xcecb77,_0xb7e1bb);const _0x270bb1=journeyActivationStepToYaml(_0x572998,_0x12daa4,_0x39d4c8);return{'name':_0xb7e1bb,'isJourneyLocal':!![],'definition':_0x270bb1};}catch(_0x3e5539){return _0x45f276[_0x207f9f(0x217)]&&console['error'](_0x207f9f(0x1d5)+_0xcecb77+':\x20'+_0x3e5539[_0x207f9f(0x209)]),{'name':_0xcecb77,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x46a890,_0x452a7e)=>resolveJumpTarget(_0x46a890,_0x452a7e,_0x427792,_0x3b8955=>_0x11ea95['journey'][_0x556b0e(0x1fb)](_0x3b8955))});return{'createYamlContext':_0x2c1e55};};if(_0x4392af['size']>0x0){const _0x286b63=Array[_0x407a7b(0x1ca)](_0x4392af[_0x407a7b(0x1d1)]()),_0xc8daf4=await withQuerySpinner(_0x407a7b(0x1e7),async _0x1fdc20=>{const _0x549bf8=_0x407a7b,_0x9c6890=[];let _0x472e75=0x0;const _0x35dbb8=0x5;for(let _0x2bf4fb=0x0;_0x2bf4fb<_0x286b63[_0x549bf8(0x1e9)];_0x2bf4fb+=_0x35dbb8){const _0x59b225=_0x286b63[_0x549bf8(0x21c)](_0x2bf4fb,_0x2bf4fb+_0x35dbb8),_0x370200=await Promise[_0x549bf8(0x1b9)](_0x59b225['map'](async _0x34483d=>{const _0x511664=_0x549bf8,_0x578a5a=_0x34483d[0x0],_0x223f4e=_0x578a5a[_0x511664(0x210)];_0x1fdc20[_0x511664(0x1d7)]('Fetching\x20journey\x20\x27'+_0x223f4e+'\x27');const _0xb06b08=_0x578a5a[_0x511664(0x20d)]?_0x2f83e8[_0x511664(0x1f0)](_0x578a5a['folderId'])||'':'',{createYamlContext:_0x45506b}=_0x18f2a0(),_0x17d9c2=[];for(const _0xb312b1 of _0x34483d){const _0xb04956=await _0x11ea95[_0x511664(0x202)][_0x511664(0x1fb)](_0xb312b1['id']),_0x1b35de=_0xb04956[_0x511664(0x1bf)]?.[_0x511664(0x1e2)],_0x46973a=_0x45506b(_0xb312b1['id'],_0x1b35de),_0x550714=await apiToYamlAsync(_0xb04956,_0x46973a);_0x17d9c2[_0x511664(0x1c0)]({'item':_0xb312b1,'yaml':_0x550714});}let _0x20102a;return _0x17d9c2[_0x511664(0x1e9)]===0x1?_0x20102a=_0x17d9c2[0x0][_0x511664(0x213)]:_0x20102a=buildMergedJourneyYaml(_0x17d9c2),{'bundleName':_0x223f4e,'folderPath':_0xb06b08,'finalYaml':_0x20102a};}));_0x9c6890[_0x549bf8(0x1c0)](..._0x370200),_0x472e75+=_0x59b225[_0x549bf8(0x1e9)],_0x1fdc20[_0x549bf8(0x1d3)]('('+_0x472e75+'/'+_0x286b63[_0x549bf8(0x1e9)]+')');}return _0x9c6890;},{'verbose':_0x45f276[_0x407a7b(0x217)]});for(const {bundleName:_0x2a1d55,folderPath:_0x2a94ec,finalYaml:_0x46930b}of _0xc8daf4[_0x407a7b(0x1ac)]){const _0x1c0a92=a34_0x4e305b(_0x46930b),_0x2e9d21=_0x2a94ec?a34_0x254046[_0x407a7b(0x1da)](_0x127bd0,_0x2a94ec):_0x127bd0,_0x4b191c=sanitizeFileName(_0x2a1d55),_0x3ae1e0=getUniqueFileName(_0x2e9d21,_0x4b191c,_0x41bb46),_0x469fca=a34_0x254046[_0x407a7b(0x1da)](_0x2e9d21,_0x3ae1e0+_0x407a7b(0x20b));_0x40d600['push'](prepareFile(_0x469fca,_0x1c0a92,_0x127bd0));}}const _0x36848b=Array[_0x407a7b(0x1ca)](_0x2ba2dd['values']())[_0x407a7b(0x1ea)]((_0x5e5eaf,_0x2c2fd7)=>_0x5e5eaf+_0x2c2fd7['length'],0x0),_0x177e4a=_0x40d600[_0x407a7b(0x1b1)](_0x49ed2b=>_0x49ed2b[_0x407a7b(0x1d2)]),_0x2e3a83=_0x40d600[_0x407a7b(0x1b1)](_0x4fb1f3=>!_0x4fb1f3[_0x407a7b(0x1d2)]&&_0x4fb1f3[_0x407a7b(0x1d9)]),_0x47a988=_0x40d600[_0x407a7b(0x1b1)](_0x3206c8=>!_0x3206c8[_0x407a7b(0x1d2)]&&!_0x3206c8['hasChanges']),_0x5eb7ff=_0xf324e0[_0x407a7b(0x1b1)](_0x2139d4=>_0x2139d4[_0x407a7b(0x1c7)]!==SEGMENT_KIND_JOURNEY);console['error'](_0x407a7b(0x1f9)+_0x7df88+'\x27:'),console[_0x407a7b(0x201)](_0x407a7b(0x207)+a34_0x2ac790[_0x407a7b(0x1ce)](_0x5eb7ff[_0x407a7b(0x1e9)]+'\x20segments')+_0x407a7b(0x1f6)+a34_0x2ac790['cyan'](_0x36848b+'\x20activations'));if(_0x4392af[_0x407a7b(0x1b7)]>0x0){const _0x159136=_0x37fee4['length'],_0x15715c=_0x4392af[_0x407a7b(0x1b7)],_0x2fc781=_0x159136>_0x15715c?'\x20('+_0x159136+'\x20versions)':'';console[_0x407a7b(0x201)](_0x407a7b(0x1b0)+a34_0x2ac790['cyan'](_0x15715c+'\x20journeys')+a34_0x2ac790[_0x407a7b(0x1ec)](_0x2fc781));}console[_0x407a7b(0x201)]('\x20\x20'+a34_0x2ac790[_0x407a7b(0x216)]('+\x20'+_0x177e4a['length']+_0x407a7b(0x1c2))),console[_0x407a7b(0x201)]('\x20\x20'+a34_0x2ac790[_0x407a7b(0x206)]('~\x20'+_0x2e3a83[_0x407a7b(0x1e9)]+'\x20changed\x20files')),console[_0x407a7b(0x201)]('\x20\x20'+a34_0x2ac790['dim']('=\x20'+_0x47a988[_0x407a7b(0x1e9)]+'\x20unchanged\x20files')),console[_0x407a7b(0x201)](_0x407a7b(0x1b4)+a34_0x2ac790[_0x407a7b(0x1ce)](_0x127bd0)+'\x0a');if(_0x2e3a83[_0x407a7b(0x1e9)]>0x0)for(const _0x1fe4c4 of _0x2e3a83){console['error'](_0x407a7b(0x1de)+_0x1fe4c4['relativePath']+'\x27:'),console[_0x407a7b(0x201)]('─'['repeat'](0x3c)),console[_0x407a7b(0x201)](_0x1fe4c4[_0x407a7b(0x1fc)]),console[_0x407a7b(0x201)]('─'[_0x407a7b(0x1cd)](0x3c));}if(_0x45f276['dryRun'])return console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x206)](_0x407a7b(0x1cb))),0x0;if(_0x177e4a[_0x407a7b(0x1e9)]===0x0&&_0x2e3a83[_0x407a7b(0x1e9)]===0x0)return console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x216)](_0x407a7b(0x203))),saveSessionContext({'parent_segment':_0x7df88},_0x45f276[_0x407a7b(0x1ef)]),console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x216)]('✔\x20Context\x20set:\x20'+a34_0x2ac790[_0x407a7b(0x1ec)](_0x407a7b(0x1a9))+'\x20=\x20'+a34_0x2ac790[_0x407a7b(0x1ce)](_0x7df88))),0x0;if(!_0x45f276[_0x407a7b(0x1d8)]&&(_0x177e4a['length']>0x0||_0x2e3a83[_0x407a7b(0x1e9)]>0x0)){const _0x364b61=await confirmKey(_0x407a7b(0x1f7)+(_0x177e4a['length']+_0x2e3a83[_0x407a7b(0x1e9)])+_0x407a7b(0x1c6));if(!_0x364b61)return console[_0x407a7b(0x201)](_0x407a7b(0x1bd)),0x1;}for(const _0x5a4319 of _0x40d600){if(_0x5a4319[_0x407a7b(0x1d2)]||_0x5a4319[_0x407a7b(0x1d9)]){const _0x2f2199=a34_0x254046[_0x407a7b(0x1f8)](_0x5a4319[_0x407a7b(0x205)]);!existsSync(_0x2f2199)&&mkdirSync(_0x2f2199,{'recursive':!![]}),writeFileSync(_0x5a4319[_0x407a7b(0x205)],_0x5a4319[_0x407a7b(0x1f2)],_0x407a7b(0x219));}}return console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x216)]('✔\x20Pulled\x20'+(_0x177e4a[_0x407a7b(0x1e9)]+_0x2e3a83[_0x407a7b(0x1e9)])+_0x407a7b(0x20c)+_0x127bd0)),saveSessionContext({'parent_segment':_0x7df88},_0x45f276[_0x407a7b(0x1ef)]),console[_0x407a7b(0x201)](a34_0x2ac790['green'](_0x407a7b(0x1e1)+a34_0x2ac790[_0x407a7b(0x1ec)]('parent_segment')+'\x20=\x20'+a34_0x2ac790[_0x407a7b(0x1ce)](_0x7df88))),0x0;}}function buildFolderPathMap(_0x4817f4){const _0x2f950f=a34_0x2c95b8,_0x18babf=new Map(),_0x4feb47=new Map();for(const _0x3bf625 of _0x4817f4){_0x4feb47[_0x2f950f(0x1cf)](_0x3bf625['id'],_0x3bf625);}const _0xd0e84=new Set();for(const _0xf379e5 of _0x4817f4){!_0xf379e5[_0x2f950f(0x1af)]&&_0xd0e84['add'](_0xf379e5['id']);}function _0x35ed5a(_0x32e435){const _0x1193c0=_0x2f950f;if(_0x18babf['has'](_0x32e435['id']))return _0x18babf[_0x1193c0(0x1f0)](_0x32e435['id']);if(_0xd0e84[_0x1193c0(0x208)](_0x32e435['id']))return _0x18babf[_0x1193c0(0x1cf)](_0x32e435['id'],''),'';if(_0x32e435['parentFolderId']){const _0x6d3833=_0x4feb47[_0x1193c0(0x1f0)](_0x32e435[_0x1193c0(0x1af)]);if(_0x6d3833){const _0x43d8a0=_0x35ed5a(_0x6d3833),_0x18da64=_0x43d8a0?_0x43d8a0+'/'+_0x32e435[_0x1193c0(0x1e4)]:_0x32e435[_0x1193c0(0x1e4)];return _0x18babf[_0x1193c0(0x1cf)](_0x32e435['id'],_0x18da64),_0x18da64;}}const _0x2d5f6a=_0x32e435[_0x1193c0(0x1e4)];return _0x18babf[_0x1193c0(0x1cf)](_0x32e435['id'],_0x2d5f6a),_0x2d5f6a;}for(const _0x47a38a of _0x4817f4){_0x35ed5a(_0x47a38a);}return _0x18babf;}function getUniqueFileName(_0x1eaa33,_0x46b4bf,_0x359292){const _0x15628f=a34_0x2c95b8,_0x1d59c5=_0x1eaa33+':'+_0x46b4bf,_0x15b5fd=_0x359292['get'](_0x1d59c5)||0x0;_0x359292[_0x15628f(0x1cf)](_0x1d59c5,_0x15b5fd+0x1);if(_0x15b5fd===0x0)return _0x46b4bf;return _0x46b4bf+'-'+_0x15b5fd;}function prepareFile(_0x411655,_0x20f1f9,_0x5b5521){const _0x4aee73=a34_0x2c95b8,_0x3d5eba=a34_0x254046[_0x4aee73(0x1c3)](_0x5b5521,_0x411655);if(existsSync(_0x411655)){const _0xc5beaf=readFileSync(_0x411655,'utf-8'),_0x73e170=generateDiff(_0xc5beaf,_0x20f1f9),_0x41b947=hasChanges(_0x73e170);return{'relativePath':_0x3d5eba,'absolutePath':_0x411655,'content':_0x20f1f9,'isNew':![],'hasChanges':_0x41b947,'diff':_0x41b947?formatDiffWithColors(_0x73e170):undefined};}return{'relativePath':_0x3d5eba,'absolutePath':_0x411655,'content':_0x20f1f9,'isNew':!![],'hasChanges':![]};}
1
+ const a35_0x816586=a35_0x4548;(function(_0xbeffbb,_0x3ac8d6){const _0x55eb7f=a35_0x4548,_0x5d64a0=_0xbeffbb();while(!![]){try{const _0x205fd7=parseInt(_0x55eb7f(0x22d))/0x1+-parseInt(_0x55eb7f(0x1ea))/0x2*(-parseInt(_0x55eb7f(0x21c))/0x3)+-parseInt(_0x55eb7f(0x1fb))/0x4+-parseInt(_0x55eb7f(0x215))/0x5+parseInt(_0x55eb7f(0x22f))/0x6+-parseInt(_0x55eb7f(0x1f2))/0x7*(parseInt(_0x55eb7f(0x232))/0x8)+parseInt(_0x55eb7f(0x1f6))/0x9*(-parseInt(_0x55eb7f(0x224))/0xa);if(_0x205fd7===_0x3ac8d6)break;else _0x5d64a0['push'](_0x5d64a0['shift']());}catch(_0x447d3b){_0x5d64a0['push'](_0x5d64a0['shift']());}}}(a35_0x5938,0x3833b));import{BaseCommand}from'./command.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';import{apiToYamlAsync,toYamlString as a35_0x51a693}from'../sdk/segment/journey-yaml.js';import a35_0x398218 from'chalk';function a35_0x4548(_0x38131f,_0x41e73c){_0x38131f=_0x38131f-0x1e0;const _0x59387a=a35_0x5938();let _0x4548bf=_0x59387a[_0x38131f];return _0x4548bf;}import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a35_0x2741df from'path';import{sanitizeFileName}from'../utils/string-utils.js';function a35_0x5938(){const _0x20931f=['Fetching\x20parent\x20segment\x20info...','isNew','journeyBundleId','\x20\x20Target:\x20','journeyBundleName','verbose','Fetching\x20journey\x20\x27','444050epUFvd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','1802310vzAxGQ','hasChanges','size','13872lsNELR','error','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','set','\x20journeys','then','dim','\x0aPull\x20summary\x20for\x20\x27','session','name','getActivation','Fetching\x20journeys...','join','Found\x20tdx.json\x20at:\x20','utf-8','filter','isDirectory','content','✔\x20Context\x20set:\x20','red','data','get','\x20=\x20','segment','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','add','relativePath','dryRun','site','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','.yml','description','journey','\x0aChanges\x20to\x20\x27','Fetching\x20activations...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','activationParams','message','getParent','values','✔\x20Pulled\x20','repeat','yellow','\x20\x20🗺️\x20\x20','\x20files\x20to\x20','1682tiwDOq','rule','resolveParentId','\x27...','all','listSegments','cyan','Resolving\x20parent\x20segment\x20\x27','357PGCChB','folderId','from','listActivations','1670103DWJTmV','green','diff','kind','versionNumber','98432fqHqZV','execute','Fetching\x20connections\x20for\x20name\x20resolution...','user','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Using\x20parent\x20segment:\x20','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Parent\x20segment:\x20','Fetching\x20folders...','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','parent_segment','push','\x20unchanged\x20files','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x20with\x20','dirname','\x20\x20🎯\x20','Processing\x20journeys...','length','setExtra','getJourney','parentSegment','sort','buildIdToEmailMap','absolutePath','getSegment','1365525CtoBcj','audienceId','\x20segments','\x20new\x20files','attributes','\x20files?','\x20versions)','867uLOCHh','relative','connection','listFolders','yaml','parentFolderId','has','reduce','20hMxMIE','setPhase'];a35_0x5938=function(){return _0x20931f;};return a35_0x5938();}import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{[a35_0x816586(0x23b)]='segment:pull';[a35_0x816586(0x251)]=a35_0x816586(0x204);async[a35_0x816586(0x1fc)](_0x45ac65){const _0x524813=a35_0x816586,{options:_0x74043b,args:_0x5ca3c7,tdx:_0x2c5b60}=_0x45ac65,_0x3f6063=_0x74043b,_0x25b80e=_0x74043b[_0x524813(0x210)],_0x2feb9d=_0x5ca3c7[0x0],_0x176d0c=findTdxConfigPath();let _0x47ce57,_0x1d6724;if(!_0x2feb9d&&_0x176d0c){const _0x174773=loadTdxConfig(_0x176d0c);_0x47ce57=_0x174773[_0x524813(0x205)],_0x1d6724=a35_0x2741df[_0x524813(0x20a)](_0x176d0c),_0x3f6063[_0x524813(0x22b)]&&(console[_0x524813(0x233)]('Found\x20existing\x20tdx.json\x20at:\x20'+_0x176d0c),console[_0x524813(0x233)](_0x524813(0x200)+_0x47ce57));}else{if(_0x2feb9d){if(existsSync(_0x2feb9d)&&statSync(_0x2feb9d)[_0x524813(0x242)]()){const _0x4e08bd=findTdxConfigPath(_0x2feb9d);if(_0x4e08bd){const _0x3268cd=loadTdxConfig(_0x4e08bd);_0x47ce57=_0x3268cd['parent_segment'],_0x1d6724=a35_0x2741df[_0x524813(0x20a)](_0x4e08bd),_0x3f6063[_0x524813(0x22b)]&&(console[_0x524813(0x233)](_0x524813(0x23f)+_0x4e08bd),console['error']('Using\x20parent\x20segment:\x20'+_0x47ce57));}else return console[_0x524813(0x233)](a35_0x398218[_0x524813(0x245)](_0x524813(0x24a)+_0x2feb9d+'\x0a')),console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1f0)](_0x524813(0x1ff))),0x1;}else _0x47ce57=_0x2feb9d;}else _0x47ce57=_0x25b80e;}if(!_0x47ce57)return console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1e7)](_0x524813(0x234))),console[_0x524813(0x233)](_0x524813(0x24f)),console['error'](_0x524813(0x1e0)),console[_0x524813(0x233)](_0x524813(0x22e)),0x1;_0x3f6063[_0x524813(0x22b)]&&(console[_0x524813(0x233)]('Site:\x20'+_0x3f6063[_0x524813(0x24e)]),console['error'](_0x524813(0x202)+_0x47ce57));const _0x3e214c=await withSpinner(_0x524813(0x1f1)+_0x47ce57+_0x524813(0x1ed),()=>_0x2c5b60[_0x524813(0x249)][_0x524813(0x1ec)](_0x47ce57),{'verbose':_0x3f6063[_0x524813(0x22b)]}),_0x36456f=_0x3e214c['data'],_0xf2503=await withSpinner(_0x524813(0x226),()=>_0x2c5b60[_0x524813(0x249)][_0x524813(0x1e3)](_0x36456f),{'verbose':_0x3f6063['verbose']}),_0x4327d1=_0xf2503[_0x524813(0x246)][_0x524813(0x219)]['name'];_0x3f6063['verbose']&&console[_0x524813(0x233)]('Resolved\x20parent\x20name:\x20'+_0x4327d1);const [_0x5adf48,_0x51d580,_0x4cb255]=await Promise[_0x524813(0x1ee)]([withSpinner('Fetching\x20segments...',()=>_0x2c5b60[_0x524813(0x249)][_0x524813(0x1ef)](_0x36456f),{'verbose':_0x3f6063[_0x524813(0x22b)]}),withSpinner(_0x524813(0x203),()=>_0x2c5b60[_0x524813(0x249)][_0x524813(0x21f)](_0x36456f),{'verbose':_0x3f6063['verbose']}),withSpinner(_0x524813(0x23d),()=>_0x2c5b60[_0x524813(0x252)]['listJourneysFromParentSegment'](_0x36456f),{'verbose':_0x3f6063[_0x524813(0x22b)]})]),_0x1c6ce7=_0x5adf48['data'],_0x264f97=_0x51d580[_0x524813(0x246)],_0x4bb3c2=_0x4cb255[_0x524813(0x246)];if(_0x1c6ce7[_0x524813(0x20d)]===0x0&&_0x4bb3c2[_0x524813(0x20d)]===0x0)return console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1e7)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x4327d1+'\x27')),0x0;const _0x64cb46=buildFolderPathMap(_0x264f97),_0x12592b=_0x1d6724||getSegmentRootDir(sanitizeFileName(_0x47ce57)),_0x630f36=new Map();await withSpinner(_0x524813(0x254),async()=>{await batchAsync(_0x1c6ce7,async _0x5dda05=>{const _0x5dec0b=a35_0x4548,_0x4ae122=await _0x2c5b60['segment'][_0x5dec0b(0x1f5)](_0x36456f,_0x5dda05['id']);_0x630f36[_0x5dec0b(0x235)](_0x5dda05['id'],_0x4ae122);});},{'verbose':_0x3f6063[_0x524813(0x22b)]});const _0x4d49c9=await withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x2c5b60[_0x524813(0x1fe)][_0x524813(0x212)](),{'verbose':_0x3f6063[_0x524813(0x22b)]})[_0x524813(0x237)](_0x16d633=>_0x16d633['data']),_0x8ee975=await withSpinner(_0x524813(0x1fd),()=>_0x2c5b60[_0x524813(0x21e)]['buildIdToNameMap'](),{'verbose':_0x3f6063[_0x524813(0x22b)]})[_0x524813(0x237)](_0x16bcb2=>_0x16bcb2[_0x524813(0x246)]),_0x11de11=[],_0x187991=a35_0x2741df[_0x524813(0x23e)](_0x12592b,'tdx.json'),_0x283cf9=createTdxConfigContent(_0x4327d1);_0x11de11['push'](prepareFile(_0x187991,_0x283cf9,_0x12592b));const _0x430774=new Map();for(const _0x5703c8 of _0x1c6ce7){if(_0x5703c8[_0x524813(0x1f9)]===SEGMENT_KIND_JOURNEY)continue;const _0x3984a4=_0x5703c8['segmentFolderId']?_0x64cb46[_0x524813(0x247)](_0x5703c8['segmentFolderId'])||'':'',_0x43e205=_0x630f36[_0x524813(0x247)](_0x5703c8['id'])||[],_0x38835b=segmentWithActivationsToYaml(_0x5703c8,_0x43e205,undefined,_0x4d49c9,_0x8ee975),_0x313a0d=_0x3984a4?a35_0x2741df['join'](_0x12592b,_0x3984a4):_0x12592b,_0x32253a=sanitizeFileName(_0x5703c8[_0x524813(0x23b)]),_0x637c9f=getUniqueFileName(_0x313a0d,_0x32253a,_0x430774),_0x53d052=a35_0x2741df[_0x524813(0x23e)](_0x313a0d,_0x637c9f+_0x524813(0x250)),_0x2791eb=segmentToYamlString(_0x38835b);_0x11de11[_0x524813(0x206)](prepareFile(_0x53d052,_0x2791eb,_0x12592b));}const _0x5c8a92=new Map();for(const _0x3caed2 of _0x1c6ce7){_0x5c8a92[_0x524813(0x235)](_0x3caed2['id'],_0x3caed2);}const _0x328e43=new Map();for(const _0x108641 of _0x4bb3c2){const _0x536afe=_0x108641[_0x524813(0x228)];!_0x328e43[_0x524813(0x222)](_0x536afe)&&_0x328e43[_0x524813(0x235)](_0x536afe,[]),_0x328e43[_0x524813(0x247)](_0x536afe)[_0x524813(0x206)](_0x108641);}for(const _0x2de750 of _0x328e43['values']()){_0x2de750[_0x524813(0x211)]((_0x4886b8,_0x597a52)=>(_0x4886b8[_0x524813(0x1fa)]||0x0)-(_0x597a52[_0x524813(0x1fa)]||0x0));}const _0x5f4b54=()=>{const _0x2b970b=_0x524813,_0x3e7726=new Set(),_0x180ee8=new Set(),_0x1d12d2=new Map(),_0x2a7411=new Map(),_0x5475f1=createJumpTargetCache(),_0x35b84b=(_0x14a6dd,_0xa95da5)=>({'resolveSegment':async _0x12864a=>{const _0x2ab5a6=a35_0x4548,_0x5513e4=_0x1d12d2[_0x2ab5a6(0x247)](_0x12864a);if(_0x5513e4!==undefined)return{'name':_0x5513e4,'isJourneyLocal':!![]};if(!_0xa95da5)return{'name':_0x12864a,'isJourneyLocal':![]};try{let _0x416627=_0x5c8a92[_0x2ab5a6(0x247)](_0x12864a);!_0x416627&&(_0x416627=await _0x2c5b60[_0x2ab5a6(0x249)][_0x2ab5a6(0x214)](_0xa95da5,_0x12864a));const _0x4635a6=generateJourneyLocalName(_0x416627[_0x2ab5a6(0x23b)]),_0x4f2cf4=_0x416627[_0x2ab5a6(0x1f9)]===SEGMENT_KIND_JOURNEY&&_0x4635a6!==undefined;let _0x4e1d38=_0x416627[_0x2ab5a6(0x23b)];if(_0x4f2cf4&&_0x4635a6){let _0x375707=_0x4635a6,_0x381b90=0x2;while(_0x3e7726[_0x2ab5a6(0x222)](_0x375707)){_0x375707=_0x4635a6+'_'+_0x381b90,_0x381b90++;}_0x3e7726[_0x2ab5a6(0x24b)](_0x375707),_0x4e1d38=_0x375707,_0x1d12d2[_0x2ab5a6(0x235)](_0x12864a,_0x4e1d38);}let _0x23161e;return _0x4f2cf4&&_0x416627['rule']&&(_0x23161e={'description':_0x416627[_0x2ab5a6(0x251)],'rule':apiRuleToYaml(_0x416627[_0x2ab5a6(0x1eb)])}),{'name':_0x4e1d38,'isJourneyLocal':_0x4f2cf4,'definition':_0x23161e};}catch(_0xcc0911){return _0x3f6063['verbose']&&console['error'](_0x2ab5a6(0x201)+_0x12864a+':\x20'+_0xcc0911[_0x2ab5a6(0x1e2)]),{'name':_0x12864a,'isJourneyLocal':![]};}},'resolveActivation':async _0x272705=>{const _0x2d9fe3=a35_0x4548,_0x192237=_0x2a7411[_0x2d9fe3(0x247)](_0x272705);if(_0x192237!==undefined)return{'name':_0x192237,'isJourneyLocal':!![]};try{const _0x418791=await _0x2c5b60[_0x2d9fe3(0x252)][_0x2d9fe3(0x23c)](_0x14a6dd,_0x272705),_0x499318=_0x418791[_0x2d9fe3(0x219)][_0x2d9fe3(0x1e1)]['name']||_0x272705,_0x5bd31a=sanitizeYamlKey(_0x499318)||'activation_'+_0x272705;let _0x3dcddf=_0x5bd31a,_0x1e9b57=0x2;while(_0x180ee8[_0x2d9fe3(0x222)](_0x3dcddf)){_0x3dcddf=_0x5bd31a+'_'+_0x1e9b57,_0x1e9b57++;}_0x180ee8[_0x2d9fe3(0x24b)](_0x3dcddf),_0x2a7411[_0x2d9fe3(0x235)](_0x272705,_0x3dcddf);const _0xdc64ba=journeyActivationStepToYaml(_0x418791,_0x4d49c9,_0x8ee975);return{'name':_0x3dcddf,'isJourneyLocal':!![],'definition':_0xdc64ba};}catch(_0xe2351e){return _0x3f6063[_0x2d9fe3(0x22b)]&&console['error'](_0x2d9fe3(0x208)+_0x272705+':\x20'+_0xe2351e['message']),{'name':_0x272705,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x259b3e,_0x8ddb5d)=>resolveJumpTarget(_0x259b3e,_0x8ddb5d,_0x5475f1,_0x5eef6b=>_0x2c5b60[_0x2b970b(0x252)]['getJourney'](_0x5eef6b))});return{'createYamlContext':_0x35b84b};};if(_0x328e43['size']>0x0){const _0x16cd37=Array[_0x524813(0x1f4)](_0x328e43['values']()),_0x239bf8=await withQuerySpinner(_0x524813(0x20c),async _0x510142=>{const _0x41ee8e=_0x524813,_0x16f9ed=[];let _0x34ef05=0x0;const _0xe45743=0x5;for(let _0x246c29=0x0;_0x246c29<_0x16cd37[_0x41ee8e(0x20d)];_0x246c29+=_0xe45743){const _0x2e38e9=_0x16cd37['slice'](_0x246c29,_0x246c29+_0xe45743),_0x2117ec=await Promise['all'](_0x2e38e9['map'](async _0x3d572c=>{const _0x27996e=_0x41ee8e,_0xabc60b=_0x3d572c[0x0],_0x21ed9d=_0xabc60b[_0x27996e(0x22a)];_0x510142[_0x27996e(0x225)](_0x27996e(0x22c)+_0x21ed9d+'\x27');const _0x3a147b=_0xabc60b[_0x27996e(0x1f3)]?_0x64cb46[_0x27996e(0x247)](_0xabc60b[_0x27996e(0x1f3)])||'':'',{createYamlContext:_0x5294c2}=_0x5f4b54(),_0x30896b=[];for(const _0x1511fa of _0x3d572c){const _0x4effb5=await _0x2c5b60[_0x27996e(0x252)][_0x27996e(0x20f)](_0x1511fa['id']),_0x5aa9a7=_0x4effb5[_0x27996e(0x219)]?.[_0x27996e(0x216)],_0xdcce4e=_0x5294c2(_0x1511fa['id'],_0x5aa9a7),_0xcc2e97=await apiToYamlAsync(_0x4effb5,_0xdcce4e);_0x30896b[_0x27996e(0x206)]({'item':_0x1511fa,'yaml':_0xcc2e97});}let _0x30ad52;return _0x30896b[_0x27996e(0x20d)]===0x1?_0x30ad52=_0x30896b[0x0][_0x27996e(0x220)]:_0x30ad52=buildMergedJourneyYaml(_0x30896b),{'bundleName':_0x21ed9d,'folderPath':_0x3a147b,'finalYaml':_0x30ad52};}));_0x16f9ed[_0x41ee8e(0x206)](..._0x2117ec),_0x34ef05+=_0x2e38e9[_0x41ee8e(0x20d)],_0x510142[_0x41ee8e(0x20e)]('('+_0x34ef05+'/'+_0x16cd37[_0x41ee8e(0x20d)]+')');}return _0x16f9ed;},{'verbose':_0x3f6063[_0x524813(0x22b)]});for(const {bundleName:_0x31d7ee,folderPath:_0x50779e,finalYaml:_0x569e0c}of _0x239bf8[_0x524813(0x246)]){const _0x1e0579=a35_0x51a693(_0x569e0c),_0x510301=_0x50779e?a35_0x2741df[_0x524813(0x23e)](_0x12592b,_0x50779e):_0x12592b,_0x4e4008=sanitizeFileName(_0x31d7ee),_0x1cacfd=getUniqueFileName(_0x510301,_0x4e4008,_0x430774),_0xae9a50=a35_0x2741df['join'](_0x510301,_0x1cacfd+_0x524813(0x250));_0x11de11[_0x524813(0x206)](prepareFile(_0xae9a50,_0x1e0579,_0x12592b));}}const _0x537ac7=Array['from'](_0x630f36[_0x524813(0x1e4)]())[_0x524813(0x223)]((_0x3b3568,_0x77a24)=>_0x3b3568+_0x77a24[_0x524813(0x20d)],0x0),_0x2c68aa=_0x11de11[_0x524813(0x241)](_0x3f5cf5=>_0x3f5cf5['isNew']),_0x83e86d=_0x11de11[_0x524813(0x241)](_0x558716=>!_0x558716[_0x524813(0x227)]&&_0x558716[_0x524813(0x230)]),_0x5e0f07=_0x11de11[_0x524813(0x241)](_0xc44b9=>!_0xc44b9[_0x524813(0x227)]&&!_0xc44b9['hasChanges']),_0x3395cc=_0x1c6ce7['filter'](_0xffd883=>_0xffd883['kind']!==SEGMENT_KIND_JOURNEY);console['error'](_0x524813(0x239)+_0x4327d1+'\x27:'),console[_0x524813(0x233)](_0x524813(0x20b)+a35_0x398218['cyan'](_0x3395cc['length']+_0x524813(0x217))+_0x524813(0x209)+a35_0x398218[_0x524813(0x1f0)](_0x537ac7+'\x20activations'));if(_0x328e43[_0x524813(0x231)]>0x0){const _0x18697d=_0x4bb3c2[_0x524813(0x20d)],_0x584bc6=_0x328e43['size'],_0x279dde=_0x18697d>_0x584bc6?'\x20('+_0x18697d+_0x524813(0x21b):'';console[_0x524813(0x233)](_0x524813(0x1e8)+a35_0x398218[_0x524813(0x1f0)](_0x584bc6+_0x524813(0x236))+a35_0x398218['dim'](_0x279dde));}console[_0x524813(0x233)]('\x20\x20'+a35_0x398218[_0x524813(0x1f7)]('+\x20'+_0x2c68aa[_0x524813(0x20d)]+_0x524813(0x218))),console[_0x524813(0x233)]('\x20\x20'+a35_0x398218['yellow']('~\x20'+_0x83e86d['length']+'\x20changed\x20files')),console[_0x524813(0x233)]('\x20\x20'+a35_0x398218[_0x524813(0x238)]('=\x20'+_0x5e0f07[_0x524813(0x20d)]+_0x524813(0x207))),console['error'](_0x524813(0x229)+a35_0x398218['cyan'](_0x12592b)+'\x0a');if(_0x83e86d[_0x524813(0x20d)]>0x0)for(const _0x508b23 of _0x83e86d){console['error'](_0x524813(0x253)+_0x508b23[_0x524813(0x24c)]+'\x27:'),console[_0x524813(0x233)]('─'[_0x524813(0x1e6)](0x3c)),console['error'](_0x508b23[_0x524813(0x1f8)]),console[_0x524813(0x233)]('─'[_0x524813(0x1e6)](0x3c));}if(_0x3f6063[_0x524813(0x24d)])return console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1e7)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2c68aa[_0x524813(0x20d)]===0x0&&_0x83e86d[_0x524813(0x20d)]===0x0)return console[_0x524813(0x233)](a35_0x398218['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x4327d1},_0x3f6063['session']),console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1f7)](_0x524813(0x244)+a35_0x398218[_0x524813(0x238)](_0x524813(0x205))+_0x524813(0x248)+a35_0x398218[_0x524813(0x1f0)](_0x4327d1))),0x0;if(!_0x3f6063['yes']&&(_0x2c68aa[_0x524813(0x20d)]>0x0||_0x83e86d[_0x524813(0x20d)]>0x0)){const _0x1ad495=await confirmKey('Write\x20'+(_0x2c68aa[_0x524813(0x20d)]+_0x83e86d[_0x524813(0x20d)])+_0x524813(0x21a));if(!_0x1ad495)return console[_0x524813(0x233)]('Aborted.'),0x1;}for(const _0x16775d of _0x11de11){if(_0x16775d[_0x524813(0x227)]||_0x16775d[_0x524813(0x230)]){const _0x4a9e9a=a35_0x2741df['dirname'](_0x16775d[_0x524813(0x213)]);!existsSync(_0x4a9e9a)&&mkdirSync(_0x4a9e9a,{'recursive':!![]}),writeFileSync(_0x16775d[_0x524813(0x213)],_0x16775d[_0x524813(0x243)],_0x524813(0x240));}}return console[_0x524813(0x233)](a35_0x398218['green'](_0x524813(0x1e5)+(_0x2c68aa['length']+_0x83e86d[_0x524813(0x20d)])+_0x524813(0x1e9)+_0x12592b)),saveSessionContext({'parent_segment':_0x4327d1},_0x3f6063[_0x524813(0x23a)]),console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1f7)]('✔\x20Context\x20set:\x20'+a35_0x398218[_0x524813(0x238)](_0x524813(0x205))+_0x524813(0x248)+a35_0x398218['cyan'](_0x4327d1))),0x0;}}function buildFolderPathMap(_0x1a8e79){const _0x40350c=a35_0x816586,_0xc7ab7b=new Map(),_0x340ad2=new Map();for(const _0x3a47f1 of _0x1a8e79){_0x340ad2['set'](_0x3a47f1['id'],_0x3a47f1);}const _0x36f7a8=new Set();for(const _0x1f0cec of _0x1a8e79){!_0x1f0cec[_0x40350c(0x221)]&&_0x36f7a8[_0x40350c(0x24b)](_0x1f0cec['id']);}function _0x3d86ae(_0x2dab0d){const _0x1ab614=_0x40350c;if(_0xc7ab7b['has'](_0x2dab0d['id']))return _0xc7ab7b['get'](_0x2dab0d['id']);if(_0x36f7a8[_0x1ab614(0x222)](_0x2dab0d['id']))return _0xc7ab7b[_0x1ab614(0x235)](_0x2dab0d['id'],''),'';if(_0x2dab0d[_0x1ab614(0x221)]){const _0x23cdcd=_0x340ad2[_0x1ab614(0x247)](_0x2dab0d[_0x1ab614(0x221)]);if(_0x23cdcd){const _0x181615=_0x3d86ae(_0x23cdcd),_0x453789=_0x181615?_0x181615+'/'+_0x2dab0d[_0x1ab614(0x23b)]:_0x2dab0d[_0x1ab614(0x23b)];return _0xc7ab7b['set'](_0x2dab0d['id'],_0x453789),_0x453789;}}const _0x4dc7f2=_0x2dab0d[_0x1ab614(0x23b)];return _0xc7ab7b[_0x1ab614(0x235)](_0x2dab0d['id'],_0x4dc7f2),_0x4dc7f2;}for(const _0x154d34 of _0x1a8e79){_0x3d86ae(_0x154d34);}return _0xc7ab7b;}function getUniqueFileName(_0x2680bd,_0x3709c6,_0x4d429d){const _0x3b5134=a35_0x816586,_0x34e755=_0x2680bd+':'+_0x3709c6,_0x1faba1=_0x4d429d[_0x3b5134(0x247)](_0x34e755)||0x0;_0x4d429d[_0x3b5134(0x235)](_0x34e755,_0x1faba1+0x1);if(_0x1faba1===0x0)return _0x3709c6;return _0x3709c6+'-'+_0x1faba1;}function prepareFile(_0x111328,_0x506523,_0x54057e){const _0x40a32e=a35_0x816586,_0x126da3=a35_0x2741df[_0x40a32e(0x21d)](_0x54057e,_0x111328);if(existsSync(_0x111328)){const _0x5710a6=readFileSync(_0x111328,_0x40a32e(0x240)),_0x1361c2=generateDiff(_0x5710a6,_0x506523),_0x49af44=hasChanges(_0x1361c2);return{'relativePath':_0x126da3,'absolutePath':_0x111328,'content':_0x506523,'isNew':![],'hasChanges':_0x49af44,'diff':_0x49af44?formatDiffWithColors(_0x1361c2):undefined};}return{'relativePath':_0x126da3,'absolutePath':_0x111328,'content':_0x506523,'isNew':!![],'hasChanges':![]};}
@@ -1 +1 @@
1
- const a35_0x502313=a35_0x55dd;(function(_0x37fc35,_0x103cc3){const _0xf6bc43=a35_0x55dd,_0x16460b=_0x37fc35();while(!![]){try{const _0x28ee92=-parseInt(_0xf6bc43(0x1f7))/0x1+-parseInt(_0xf6bc43(0x242))/0x2+parseInt(_0xf6bc43(0x267))/0x3+-parseInt(_0xf6bc43(0x2a3))/0x4+parseInt(_0xf6bc43(0x20f))/0x5+-parseInt(_0xf6bc43(0x27b))/0x6+parseInt(_0xf6bc43(0x279))/0x7;if(_0x28ee92===_0x103cc3)break;else _0x16460b['push'](_0x16460b['shift']());}catch(_0x315871){_0x16460b['push'](_0x16460b['shift']());}}}(a35_0x2840,0xb29e4));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../sdk/errors.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,yamlActivationToUpdateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a35_0x16738f,yamlToApi as a35_0x39979b,toYamlString as a35_0x13b2c5,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';function a35_0x55dd(_0x58283d,_0x5abe1e){_0x58283d=_0x58283d-0x1c9;const _0x284002=a35_0x2840();let _0x55dd94=_0x284002[_0x58283d];return _0x55dd94;}import a35_0x775e6 from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a35_0x2e958f from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a35_0x2c3d0b from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX='__pending_';function createPendingSegmentId(_0x752d6e){return''+PENDING_SEGMENT_PREFIX+_0x752d6e+'__';}function isPendingSegmentId(_0x32b5d4){const _0x38cd52=a35_0x55dd;return _0x32b5d4[_0x38cd52(0x244)](PENDING_SEGMENT_PREFIX);}function a35_0x2840(){const _0x5da91c=['Creating','state','journey_entry_criteria_','split','\x27\x20details...','name','updateSegmentById','size','all','journeysOnly','getParent','parse','created','createSegment','deleteActivation','Creating\x20folder\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Activations:','\x20\x20✔\x20Updated\x20activation\x20\x27',')\x20with\x20ID:\x20','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','map','dim','get','listJourneysFromParentSegment','INTERNAL','journeyBundleName','\x27:\x20','activation_','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','Resolving\x20parent\x20segment\x20\x27','getSegment','Fetching\x20users\x20for\x20email\x20resolution...','\x20YAML\x20files\x20found','rule','\x20\x20Segments:\x20','update','\x20\x20📊\x20Segments:','data','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','1707430LqwMAY','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','startsWith','sort','listActivations','Failed\x20to\x20create\x20embedded\x20segment\x20\x27','\x20\x20\x20\x20','diff','Entry\x20criteria:\x20','set','hasChanges','\x27\x20(internal:\x20','\x20\x20✔\x20Deleted\x20activation\x20\x27','SEGMENT_SYNTAX_ERROR','stages','Failed\x20to\x20','repeat','config','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','SEGMENT_UPDATE_ERROR','utf-8','\x27...','\x20\x20Created\x20embedded\x20activation\x20\x27','segment\x20or\x20journey','yes','endsWith','/j/da/je','✔\x20Created\x20journey\x20\x27','Deleting\x20segment\x20\x27','\x20deleted','create','\x20segment\x20from\x20file:\x20','No\x20','\x27\x20with\x20ID:\x20','getJourney','\x20journey\x20\x27','__pending_act_','4236990POHgCB','randomUUID','createJourneySegment','\x20updated','SEGMENT_NOT_FOUND','Fetching\x20existing\x20segments...','setPhase','segmentId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','has','type','Error\x20parsing\x20','Deleting\x20activation\x20\x27','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','resolveParentId','Scoped\x20to\x20folder:\x20','length','11401761kbbLSq','Fetching\x20existing\x20journeys...','1566612bzKTwh','message','Changes\x20to:','\x20changes?','Fetching\x20journey\x20\x27','folderId','\x20to\x20create','Activation','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','unchanged','\x20\x20✔\x20Created\x20activation\x20\x27','existingSegment','buildIdToNameMap','Parent\x20segment:\x20','cwd','✔\x20Updated\x20journey\x20\x27','entry_criteria','dirname','Source\x20directory:\x20','JOURNEY_UPDATE_ERROR','segmentFolderId','ACTIVATION_SYNTAX_ERROR','toString','buildNameToIdMap','\x20created','✔\x20Created\x20segment\x20\x27','then','configDir','isDirectory','parentFolderId','stringify','\x20new','steps','✔\x20Updated\x20segment\x20\x27','yamlActivation','journeyStages','setExtra','\x20unchanged','/e/','\x20\x20Journeys:\x20','2332880EZjclx','\x20\x20Created\x20embedded\x20segment\x20\x27','entryCriteria','join','Fetching\x20connections\x20for\x20name\x20resolution...','Fetching\x20parent\x20segment\x20details...','absolutePath','.yml','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','folderPath','\x20activation\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x20\x20🗺️\x20\x20Journeys:','Folders\x20to\x20create:','relative','New\x20segment:','execute','\x0a\x20\x20','item','Error:\x20Directory\x20not\x20found:\x20','flatMap','action','dryRun','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','entries','\x20folders\x20to\x20create','journeyActivationStepId','replace','values','activations','Activation\x20not\x20found:\x20','/app/ps/','NOT_FOUND','\x20to\x20delete','activationActions','delete','journeys','parent_segment','segment','listSegments','Site:\x20','yellow','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Creating\x20segment\x20\x27','getActivation','toLowerCase','journey','verbose','attributes','blue','\x27\x20v','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','updateActivation','existingJourney','\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Source:\x20','parentSegmentFolder','isFile','.yaml','activationParams','Fetching\x20existing\x20folders...','\x20activations]','branches','versionNumber','isNew','Fetching\x20existing\x20activations...','folder','add','1313021dcruOC','journeyId','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','createFolder','green','Segment\x20not\x20found:\x20','Stage\x20\x27','\x27\x20from\x20file:\x20','DecisionPoint','keys','Updating\x20activation\x20\x27','New\x20journey:','listFolders','description','red','createActivation','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20(referenced\x20in\x20journey\x20','draft','resolve','push','existingActivation','find','Creating\x20activation\x20\x27','3507625FXhdBU','yamlConfig','\x0aPush\x20summary\x20for\x20\x27','error','relationships','ACTIVATION_UPDATE_ERROR','Updating','cyan','site','Pushing\x20journeys...','filter'];a35_0x2840=function(){return _0x5da91c;};return a35_0x2840();}function extractPendingSegmentName(_0x515567){const _0x8859ab=a35_0x55dd;return _0x515567[_0x8859ab(0x1cc)](/^__pending_(.+)__$/,'$1');}const PENDING_ACTIVATION_PREFIX=a35_0x502313(0x266);function createPendingActivationId(_0x124e7e){return''+PENDING_ACTIVATION_PREFIX+_0x124e7e+'__';}function isPendingActivationId(_0x3bde92){return _0x3bde92['startsWith'](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x4661db){const _0x78580e=a35_0x502313;return _0x4661db[_0x78580e(0x1cc)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x51b44a){const _0x556add=a35_0x502313;!_0x51b44a['description']&&(_0x51b44a[_0x556add(0x204)]=''),!_0x51b44a[_0x556add(0x21b)]&&(_0x51b44a[_0x556add(0x21b)]=_0x556add(0x209));}function tryFindTdxConfig(_0x12ce13){try{return findTdxConfig(_0x12ce13);}catch{return null;}}function resolveTDFolderPath(_0x3cc848,_0xfee92e,_0x562dbb){if(!_0xfee92e)return _0x3cc848;return _0x3cc848?_0x562dbb+'/'+_0x3cc848:_0x562dbb;}export class SegmentPushCommand extends BaseCommand{[a35_0x502313(0x21f)]='segment:push';['description']=a35_0x502313(0x2ba);async[a35_0x502313(0x2b3)](_0x58813e){const _0x3c505d=a35_0x502313,{options:_0x1b6cd0,args:_0x58c800,tdx:_0x478b93}=_0x58813e,_0x5a4305=_0x1b6cd0,_0x3a7dcd=_0x1b6cd0['parentSegment'],_0x4e0cd6=_0x58c800[0x0];let _0x504b72,_0xf01b49,_0x2cbcbc,_0x5a076f;if(_0x4e0cd6){if(existsSync(_0x4e0cd6)&&statSync(_0x4e0cd6)[_0x3c505d(0x297)]()){const _0xff3387=tryFindTdxConfig(_0x4e0cd6);if(_0xff3387)_0x504b72=_0xff3387['config'][_0x3c505d(0x1d6)],_0xf01b49=_0x4e0cd6,_0x2cbcbc=_0xff3387['configDir'];else return console['error'](a35_0x775e6['red'](_0x3c505d(0x254)+_0x4e0cd6+'\x0a')),console['error'](a35_0x775e6[_0x3c505d(0x216)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}else{if(existsSync(_0x4e0cd6)&&statSync(_0x4e0cd6)[_0x3c505d(0x1ec)]()){const _0x59e3ef=a35_0x2e958f[_0x3c505d(0x28c)](_0x4e0cd6),_0x446914=tryFindTdxConfig(_0x59e3ef);if(_0x446914)_0x504b72=_0x446914[_0x3c505d(0x253)]['parent_segment'],_0x2cbcbc=_0x446914['configDir'],_0xf01b49=_0x446914[_0x3c505d(0x296)],_0x5a076f=a35_0x2e958f[_0x3c505d(0x20a)](_0x4e0cd6);else return console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x205)](_0x3c505d(0x254)+_0x59e3ef+'\x0a')),console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x216)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}else _0x504b72=_0x4e0cd6;}}else{const _0x1ceba1=tryFindTdxConfig(process['cwd']());_0x1ceba1?(_0x504b72=_0x1ceba1[_0x3c505d(0x253)][_0x3c505d(0x1d6)],_0xf01b49=process[_0x3c505d(0x289)](),_0x2cbcbc=_0x1ceba1['configDir']):_0x504b72=_0x3a7dcd;}if(!_0x504b72)return console['error'](a35_0x775e6[_0x3c505d(0x1da)](_0x3c505d(0x22a))),console[_0x3c505d(0x212)](_0x3c505d(0x1db)),console[_0x3c505d(0x212)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x3c505d(0x212)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file'),0x1;const _0x5ec8e4=_0xf01b49||getSegmentRootDir(sanitizeFileName(_0x504b72)),_0x522c73=_0x2cbcbc||_0x5ec8e4,_0x10e3fb=a35_0x2e958f[_0x3c505d(0x2b1)](_0x522c73,_0x5ec8e4),_0x8db47f=_0x10e3fb!==''&&_0x10e3fb!=='.';if(!existsSync(_0x5ec8e4))return console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x205)](_0x3c505d(0x2b6)+_0x5ec8e4+'\x0a')),console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x216)](_0x3c505d(0x207))),0x1;_0x5a4305['verbose']&&(console['error'](_0x3c505d(0x1d9)+_0x5a4305[_0x3c505d(0x217)]),console[_0x3c505d(0x212)](_0x3c505d(0x288)+_0x504b72),console[_0x3c505d(0x212)](_0x3c505d(0x28d)+_0x5ec8e4),_0x8db47f&&console[_0x3c505d(0x212)](_0x3c505d(0x277)+_0x10e3fb));const _0x12dbcd=await withSpinner(_0x3c505d(0x238)+_0x504b72+_0x3c505d(0x257),()=>_0x478b93['segment'][_0x3c505d(0x276)](_0x504b72),{'verbose':_0x5a4305['verbose']}),_0x4d869e=_0x12dbcd['data'],[_0x376062,_0xe148f,_0x1c6f79,_0x23979c,_0x3cc366]=await Promise[_0x3c505d(0x222)]([withSpinner(_0x3c505d(0x2a8),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x224)](_0x4d869e),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),withSpinner(_0x3c505d(0x26c),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x1d8)](_0x4d869e),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),withSpinner(_0x3c505d(0x1ef),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x203)](_0x4d869e),{'verbose':_0x5a4305['verbose']}),withSpinner(_0x3c505d(0x27a),()=>_0x478b93[_0x3c505d(0x1df)][_0x3c505d(0x232)](_0x4d869e),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),withSpinner(_0x3c505d(0x23a),()=>_0x478b93['user']['buildUserMaps'](),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]})[_0x3c505d(0x295)](_0x185539=>_0x185539[_0x3c505d(0x240)])]),_0x14c6df=_0x376062[_0x3c505d(0x240)],_0x326beb=_0x14c6df[_0x3c505d(0x213)]?.[_0x3c505d(0x1eb)]?.[_0x3c505d(0x240)]?.['id']||_0x14c6df['relationships']?.['parentFolder']?.[_0x3c505d(0x240)]?.['id'],_0x284777=_0xe148f[_0x3c505d(0x240)],_0xa5d757=_0x1c6f79[_0x3c505d(0x240)],_0x3820c6=_0x23979c[_0x3c505d(0x240)],{emailToId:_0x47b79c,idToEmail:_0x583b40}=_0x3cc366,[_0x174bb4,_0x2a1a81]=await withSpinner(_0x3c505d(0x2a7),async()=>{const _0x29b607=_0x3c505d,[_0x51f3ff,_0x10967e]=await Promise[_0x29b607(0x222)]([_0x478b93['connection'][_0x29b607(0x292)](),_0x478b93['connection'][_0x29b607(0x287)]()]);return[_0x51f3ff,_0x10967e];},{'verbose':_0x5a4305[_0x3c505d(0x1e0)]})[_0x3c505d(0x295)](_0x5a2ea4=>_0x5a2ea4[_0x3c505d(0x240)]),_0x4a10a0=buildFolderPathToIdMap(_0xa5d757),_0x4fd007=new Map();for(const [_0x114b6a,_0x2c3bd2]of _0x4a10a0[_0x3c505d(0x1c9)]()){_0x4fd007[_0x3c505d(0x24b)](_0x2c3bd2,_0x114b6a);}const _0x4c4b3b=new Map();for(const _0x1868fb of _0x284777){const _0x21e330=_0x1868fb[_0x3c505d(0x28f)]?_0x4fd007[_0x3c505d(0x231)](_0x1868fb[_0x3c505d(0x28f)][_0x3c505d(0x291)]())||'':'',_0xbc9160=_0x21e330+':'+_0x1868fb['name'];_0x4c4b3b['set'](_0xbc9160,_0x1868fb);}const _0x132bf0=new Map();for(const _0xbcb5ec of _0x284777){_0x132bf0['set'](_0xbcb5ec[_0x3c505d(0x21f)],_0xbcb5ec['id']);}const _0x385ea1=new Map();for(const _0x3034e0 of _0x3820c6){const _0xbc0676=_0x3034e0[_0x3c505d(0x280)]?_0x4fd007[_0x3c505d(0x231)](_0x3034e0[_0x3c505d(0x280)])||'':'',_0x2b7f3c=_0xbc0676+':'+_0x3034e0[_0x3c505d(0x234)];!_0x385ea1[_0x3c505d(0x271)](_0x2b7f3c)&&_0x385ea1['set'](_0x2b7f3c,[]),_0x385ea1['get'](_0x2b7f3c)[_0x3c505d(0x20b)](_0x3034e0);}for(const _0x3c0ebe of _0x385ea1[_0x3c505d(0x1cd)]()){_0x3c0ebe[_0x3c505d(0x245)]((_0x11c7b3,_0x5343db)=>(_0x11c7b3[_0x3c505d(0x1f2)]||0x0)-(_0x5343db['versionNumber']||0x0));}let _0x192644;if(_0x5a076f){if(!_0x5a076f[_0x3c505d(0x25b)](_0x3c505d(0x2aa))&&!_0x5a076f[_0x3c505d(0x25b)](_0x3c505d(0x1ed)))return console[_0x3c505d(0x212)](a35_0x775e6['red'](_0x3c505d(0x275)+_0x5a076f+'\x0a')),0x1;_0x192644=[_0x5a076f];}else _0x192644=findYamlFiles(_0x5ec8e4);if(_0x192644[_0x3c505d(0x278)]===0x0)return console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x205)](_0x3c505d(0x26f)+_0x5ec8e4+'\x0a')),console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x216)](_0x3c505d(0x283))),0x1;const _0x22e1ab=[],_0x37dcdb=[];for(const _0x4cb548 of _0x192644){const _0x3025c3=a35_0x2e958f[_0x3c505d(0x2b1)](_0x5ec8e4,a35_0x2e958f[_0x3c505d(0x28c)](_0x4cb548)),_0x449292=_0x3025c3==='.'?'':_0x3025c3,_0x5ace42=readFileSync(_0x4cb548,_0x3c505d(0x256));try{const _0x583889=a35_0x2c3d0b['parse'](_0x5ace42);if(isJourneyYaml(_0x583889)){const _0x5c7579=a35_0x16738f(_0x5ace42);_0x37dcdb[_0x3c505d(0x20b)]({'yamlConfig':_0x5c7579,'folderPath':_0x449292,'sourcePath':_0x4cb548});}else{if(!_0x5a4305[_0x3c505d(0x223)]){const _0x174a38=parseSegmentYamlFile(_0x5ace42),_0x5cc778=normalizeChildSegmentYaml(_0x174a38);_0x22e1ab[_0x3c505d(0x20b)]({'yamlConfig':_0x5cc778,'folderPath':_0x449292,'sourcePath':_0x4cb548});}}}catch(_0x80d23a){return console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x205)](_0x3c505d(0x273)+_0x4cb548+':\x20'+(_0x80d23a instanceof Error?_0x80d23a[_0x3c505d(0x27c)]:_0x80d23a))),0x1;}}if(_0x22e1ab[_0x3c505d(0x278)]===0x0&&_0x37dcdb[_0x3c505d(0x278)]===0x0){const _0x1f8d43=_0x5a4305['journeysOnly']?_0x3c505d(0x1df):_0x3c505d(0x259);return console['error'](a35_0x775e6['yellow'](_0x3c505d(0x262)+_0x1f8d43+_0x3c505d(0x23b))),0x0;}const _0x4ce545=new Map();_0x284777[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x223)]&&await withSpinner(_0x3c505d(0x1f4),async()=>{await batchAsync(_0x284777,async _0x4cfc64=>{const _0x1b9ef9=a35_0x55dd,_0x49cc99=await _0x478b93[_0x1b9ef9(0x1d7)][_0x1b9ef9(0x246)](_0x4d869e,_0x4cfc64['id']);_0x4ce545[_0x1b9ef9(0x24b)](_0x4cfc64['id'],_0x49cc99);});},{'verbose':_0x5a4305[_0x3c505d(0x1e0)]});const _0x4db0e2=[],_0x2e8030=new Set();for(const {yamlConfig:_0x577b20,folderPath:_0x1d2eb8,sourcePath:_0x46723a}of _0x22e1ab){const _0x199818=resolveTDFolderPath(_0x1d2eb8,_0x8db47f,_0x10e3fb),_0x136ce9=_0x199818+':'+_0x577b20[_0x3c505d(0x21f)],_0x3a55ed=_0x4c4b3b[_0x3c505d(0x231)](_0x136ce9),_0x5edd12=_0x3a55ed?_0x4ce545[_0x3c505d(0x231)](_0x3a55ed['id'])||[]:[];if(_0x199818&&!_0x4a10a0[_0x3c505d(0x271)](_0x199818)){const _0x30e39c=_0x199818[_0x3c505d(0x21d)]('/');let _0x5f519a='';for(const _0x3887b6 of _0x30e39c){_0x5f519a=_0x5f519a?_0x5f519a+'/'+_0x3887b6:_0x3887b6,!_0x4a10a0[_0x3c505d(0x271)](_0x5f519a)&&_0x2e8030[_0x3c505d(0x1f6)](_0x5f519a);}}const _0x26b42=calculateActivationActions(_0x577b20[_0x3c505d(0x1ce)]||[],_0x5edd12,_0x583b40,_0x2a1a81),_0x31d95e=segmentToYamlString(_0x577b20);let _0x2fc1be,_0x4793a0=![],_0x58d920;if(_0x3a55ed){const _0x21557c=segmentWithActivationsToYaml(_0x3a55ed,_0x5edd12,undefined,_0x583b40,_0x2a1a81),_0xcee673=segmentToYamlString(_0x21557c);_0x2fc1be=generateDiff(_0xcee673,_0x31d95e),_0x4793a0=hasChanges(_0x2fc1be),_0x4793a0&&(_0x58d920=formatDiffWithColors(_0x2fc1be));}else _0x2fc1be=generateDiff('',_0x31d95e),_0x58d920=formatDiffWithColors(_0x2fc1be);_0x4db0e2['push']({'relativePath':_0x577b20[_0x3c505d(0x21f)],'absolutePath':_0x46723a,'yamlConfig':_0x577b20,'folderPath':_0x199818,'existingSegment':_0x3a55ed,'existingActivations':_0x5edd12,'isNew':!_0x3a55ed,'hasChanges':_0x4793a0,'diff':_0x58d920,'activationActions':_0x26b42});}let _0x4ec38b=[];if(!_0x5a076f){const _0x32c935=new Set();for(const {yamlConfig:_0x3b0f56,folderPath:_0x28c5e2}of _0x22e1ab){const _0xab3cfe=resolveTDFolderPath(_0x28c5e2,_0x8db47f,_0x10e3fb);_0x32c935['add'](_0xab3cfe+':'+_0x3b0f56['name']);}_0x4ec38b=_0x284777[_0x3c505d(0x219)](_0x1063bd=>{const _0x2beb47=_0x3c505d,_0x13f703=_0x1063bd[_0x2beb47(0x28f)]?_0x4fd007[_0x2beb47(0x231)](_0x1063bd[_0x2beb47(0x28f)][_0x2beb47(0x291)]())||'':'',_0x528688=_0x13f703+':'+_0x1063bd[_0x2beb47(0x21f)];if(_0x32c935['has'](_0x528688))return![];if(_0x8db47f)return _0x13f703===_0x10e3fb||_0x13f703[_0x2beb47(0x244)](_0x10e3fb+'/');return!![];});}const _0x28a2ab=[];for(const {yamlConfig:_0x5642a4,folderPath:_0x50e906,sourcePath:_0x2fbaaf}of _0x37dcdb){const _0x49ee62=resolveTDFolderPath(_0x50e906,_0x8db47f,_0x10e3fb),_0x2b455e=_0x49ee62+':'+_0x5642a4[_0x3c505d(0x21f)],_0x57e534=_0x385ea1['get'](_0x2b455e);let _0x282f78,_0x26c5ce;if(_0x57e534&&_0x57e534['length']>0x0){const _0x4976bd=new Set(),_0x4d5d0d=new Set(),_0x59092f=new Map(),_0x4d2ef7=new Map(),_0x70c766=createJumpTargetCache(),_0x15e02b=_0x4f55b9=>({'resolveSegment':async _0x1c6ef9=>{const _0x494762=_0x3c505d,_0x53cdaa=_0x4d2ef7[_0x494762(0x231)](_0x1c6ef9);if(_0x53cdaa!==undefined)return{'name':_0x53cdaa,'isJourneyLocal':!![]};try{let _0xf259cd=_0x284777[_0x494762(0x20d)](_0x31f6c9=>_0x31f6c9['id']===_0x1c6ef9);!_0xf259cd&&(_0xf259cd=await _0x478b93[_0x494762(0x1d7)][_0x494762(0x239)](_0x4d869e,_0x1c6ef9));const _0x29aac2=generateJourneyLocalName(_0xf259cd['name']),_0x4f1bb4=_0xf259cd['kind']===SEGMENT_KIND_JOURNEY&&_0x29aac2!==undefined;let _0x4502bf=_0xf259cd[_0x494762(0x21f)];if(_0x4f1bb4&&_0x29aac2){let _0x2a8b2f=_0x29aac2,_0x15b3a0=0x2;while(_0x4976bd['has'](_0x2a8b2f)){_0x2a8b2f=_0x29aac2+'_'+_0x15b3a0,_0x15b3a0++;}_0x4976bd[_0x494762(0x1f6)](_0x2a8b2f),_0x4502bf=_0x2a8b2f,_0x4d2ef7[_0x494762(0x24b)](_0x1c6ef9,_0x4502bf);}let _0x15f8c1;return _0x4f1bb4&&_0xf259cd[_0x494762(0x23c)]&&(_0x15f8c1={'description':_0xf259cd[_0x494762(0x204)],'rule':apiRuleToYaml(_0xf259cd['rule'])}),{'name':_0x4502bf,'isJourneyLocal':_0x4f1bb4,'definition':_0x15f8c1};}catch{return{'name':_0x1c6ef9,'isJourneyLocal':![]};}},'resolveActivation':async _0x2b6f04=>{const _0x34b36b=_0x3c505d,_0x4c0c49=_0x59092f['get'](_0x2b6f04);if(_0x4c0c49!==undefined)return{'name':_0x4c0c49,'isJourneyLocal':!![]};try{const _0x10d62c=await _0x478b93['journey'][_0x34b36b(0x1dd)](_0x4f55b9,_0x2b6f04),_0xfbabf6=_0x10d62c[_0x34b36b(0x1e1)]['activationParams'][_0x34b36b(0x21f)]||_0x2b6f04,_0x2aed18=sanitizeYamlKey(_0xfbabf6)||_0x34b36b(0x236)+_0x2b6f04;let _0x1f6254=_0x2aed18,_0x21de9a=0x2;while(_0x4d5d0d[_0x34b36b(0x271)](_0x1f6254)){_0x1f6254=_0x2aed18+'_'+_0x21de9a,_0x21de9a++;}_0x4d5d0d[_0x34b36b(0x1f6)](_0x1f6254),_0x59092f[_0x34b36b(0x24b)](_0x2b6f04,_0x1f6254);const _0x357ef2=journeyActivationStepToYaml(_0x10d62c,_0x583b40,_0x2a1a81);return{'name':_0x1f6254,'isJourneyLocal':!![],'definition':_0x357ef2};}catch{return{'name':_0x2b6f04,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x78e900,_0x15fe40)=>resolveJumpTarget(_0x78e900,_0x15fe40,_0x70c766,_0x5e4962=>_0x478b93['journey'][_0x3c505d(0x264)](_0x5e4962))}),_0x29284d=hasMultipleVersions(_0x5642a4);if(_0x29284d&&_0x57e534['length']>0x1){const _0x5957a9=[];for(const _0x3c0870 of _0x57e534){const _0x4e0ec1=await withSpinner(_0x3c505d(0x27f)+_0x5642a4[_0x3c505d(0x21f)]+_0x3c505d(0x1e3)+(_0x3c0870[_0x3c505d(0x1f2)]||0x1)+'...',()=>_0x478b93[_0x3c505d(0x1df)]['getJourney'](_0x3c0870['id']),{'verbose':_0x5a4305['verbose']}),_0x123b04=_0x15e02b(_0x3c0870['id']),_0x1ffd0f=await apiToYamlAsync(_0x4e0ec1[_0x3c505d(0x240)],_0x123b04);_0x5957a9[_0x3c505d(0x20b)]({'item':_0x3c0870,'yaml':_0x1ffd0f});}_0x26c5ce=buildMergedJourneyYaml(_0x5957a9);const _0x559e3f=Math['max'](..._0x5957a9[_0x3c505d(0x22f)](_0x3510fb=>_0x3510fb[_0x3c505d(0x2b5)][_0x3c505d(0x1f2)]||0x0)),_0x146926=_0x57e534['find'](_0xcca4de=>(_0xcca4de[_0x3c505d(0x1f2)]||0x0)===_0x559e3f);_0x146926&&(_0x282f78=await _0x478b93['journey']['getJourney'](_0x146926['id']));}else{const _0x4591e4=_0x57e534[_0x57e534[_0x3c505d(0x278)]-0x1],_0x413a6c=await withSpinner(_0x3c505d(0x27f)+_0x5642a4[_0x3c505d(0x21f)]+_0x3c505d(0x21e),()=>_0x478b93[_0x3c505d(0x1df)]['getJourney'](_0x4591e4['id']),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]});_0x282f78=_0x413a6c[_0x3c505d(0x240)];const _0x15aa7e=_0x15e02b(_0x4591e4['id']);_0x26c5ce=await apiToYamlAsync(_0x282f78,_0x15aa7e);}}if(_0x49ee62&&!_0x4a10a0[_0x3c505d(0x271)](_0x49ee62)){const _0xd88a46=_0x49ee62['split']('/');let _0x476d4c='';for(const _0x4018a5 of _0xd88a46){_0x476d4c=_0x476d4c?_0x476d4c+'/'+_0x4018a5:_0x4018a5,!_0x4a10a0[_0x3c505d(0x271)](_0x476d4c)&&_0x2e8030['add'](_0x476d4c);}}const _0x202cbf=normalizeJourneyYaml(_0x5642a4),_0x3d69dc=a35_0x13b2c5(_0x202cbf);let _0x5d9280=![],_0x23d2b1;if(_0x26c5ce){const _0x29a20b=normalizeJourneyYaml(_0x26c5ce),_0x5ebc73=a35_0x13b2c5(_0x29a20b),_0x3aee5d=generateDiff(_0x5ebc73,_0x3d69dc);_0x5d9280=hasChanges(_0x3aee5d),_0x5d9280&&(_0x23d2b1=formatDiffWithColors(_0x3aee5d));}else{const _0x2bb7f0=generateDiff('',_0x3d69dc);_0x23d2b1=formatDiffWithColors(_0x2bb7f0);}_0x28a2ab[_0x3c505d(0x20b)]({'relativePath':_0x5642a4[_0x3c505d(0x21f)],'absolutePath':_0x2fbaaf,'yamlConfig':_0x5642a4,'folderPath':_0x49ee62,'existingJourney':_0x282f78,'isNew':!_0x282f78,'hasChanges':_0x5d9280,'diff':_0x23d2b1});}let _0x230edf=[];if(!_0x5a076f){const _0x833391=new Set();for(const {yamlConfig:_0x15ca96,folderPath:_0x548022}of _0x37dcdb){const _0x2a05b2=resolveTDFolderPath(_0x548022,_0x8db47f,_0x10e3fb);_0x833391[_0x3c505d(0x1f6)](_0x2a05b2+':'+_0x15ca96[_0x3c505d(0x21f)]);}_0x230edf=_0x3820c6[_0x3c505d(0x219)](_0x35cb1b=>{const _0x5da649=_0x3c505d,_0x1f9a11=_0x35cb1b[_0x5da649(0x280)]?_0x4fd007[_0x5da649(0x231)](_0x35cb1b[_0x5da649(0x280)])||'':'',_0x49fc86=_0x1f9a11+':'+_0x35cb1b[_0x5da649(0x234)];if(_0x833391[_0x5da649(0x271)](_0x49fc86))return![];if(_0x8db47f)return _0x1f9a11===_0x10e3fb||_0x1f9a11[_0x5da649(0x244)](_0x10e3fb+'/');return!![];});}const _0x5d83d5=_0x4db0e2['filter'](_0x596dc0=>_0x596dc0[_0x3c505d(0x1f3)]),_0xfdd612=_0x4db0e2['filter'](_0x54ca5f=>!_0x54ca5f['isNew']&&_0x54ca5f['hasChanges']),_0x2bb1ee=_0x4db0e2[_0x3c505d(0x219)](_0xa3e439=>!_0xa3e439['isNew']&&!_0xa3e439[_0x3c505d(0x24c)]),_0x468177=Array['from'](_0x2e8030)[_0x3c505d(0x245)](),_0x271870=_0x5a4305[_0x3c505d(0x1d4)]?_0x4ec38b:[],_0x495a5f=_0x5a4305[_0x3c505d(0x1d4)]?_0x230edf:[],_0x21a547=_0x4db0e2[_0x3c505d(0x2b7)](_0x1c7f23=>_0x1c7f23[_0x3c505d(0x1d3)]),_0x23cd7f=_0x21a547['filter'](_0x4ec27e=>_0x4ec27e[_0x3c505d(0x272)]===_0x3c505d(0x260)),_0x324248=_0x21a547[_0x3c505d(0x219)](_0x3a2efa=>_0x3a2efa[_0x3c505d(0x272)]===_0x3c505d(0x23e)),_0x1bde84=_0x21a547[_0x3c505d(0x219)](_0x55dc7d=>_0x55dc7d[_0x3c505d(0x272)]===_0x3c505d(0x1d4)),_0x2f0e9f=_0x28a2ab[_0x3c505d(0x219)](_0x2b334a=>_0x2b334a[_0x3c505d(0x1f3)]),_0xf0ae22=_0x28a2ab[_0x3c505d(0x219)](_0x3a40c3=>!_0x3a40c3['isNew']&&_0x3a40c3['hasChanges']),_0x13b11e=_0x28a2ab[_0x3c505d(0x219)](_0x47d517=>!_0x47d517['isNew']&&!_0x47d517['hasChanges']);console[_0x3c505d(0x212)](_0x3c505d(0x211)+_0x504b72+'\x27:');_0x468177[_0x3c505d(0x278)]>0x0&&console['error']('\x20\x20'+a35_0x775e6['blue']('📁\x20'+_0x468177['length']+_0x3c505d(0x1ca)));if(!_0x5a4305[_0x3c505d(0x223)]){console['error'](_0x3c505d(0x23f)),console['error']('\x20\x20\x20\x20'+a35_0x775e6['green']('+\x20'+_0x5d83d5['length']+_0x3c505d(0x29a))),console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x1da)]('~\x20'+_0xfdd612['length']+'\x20changed'));if(_0x271870[_0x3c505d(0x278)]>0x0)console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6['red']('-\x20'+_0x271870[_0x3c505d(0x278)]+_0x3c505d(0x1d2)));else _0x4ec38b[_0x3c505d(0x278)]>0x0&&!_0x5a4305['delete']&&console[_0x3c505d(0x212)]('\x20\x20\x20\x20'+a35_0x775e6['dim'](_0x4ec38b[_0x3c505d(0x278)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x230)]('=\x20'+_0x2bb1ee['length']+_0x3c505d(0x2a0)));}if(_0x28a2ab[_0x3c505d(0x278)]>0x0||_0x230edf[_0x3c505d(0x278)]>0x0){console[_0x3c505d(0x212)](_0x3c505d(0x2af)),console['error'](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x1fb)]('+\x20'+_0x2f0e9f[_0x3c505d(0x278)]+_0x3c505d(0x29a))),console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x1da)]('~\x20'+_0xf0ae22[_0x3c505d(0x278)]+'\x20changed'));if(_0x495a5f[_0x3c505d(0x278)]>0x0)console[_0x3c505d(0x212)]('\x20\x20\x20\x20'+a35_0x775e6[_0x3c505d(0x205)]('-\x20'+_0x495a5f[_0x3c505d(0x278)]+_0x3c505d(0x1d2)));else _0x230edf[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x1d4)]&&console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x230)](_0x230edf[_0x3c505d(0x278)]+_0x3c505d(0x1e9)));console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x230)]('=\x20'+_0x13b11e['length']+_0x3c505d(0x2a0)));}_0x21a547['length']>0x0&&!_0x5a4305['journeysOnly']&&(console[_0x3c505d(0x212)](''),console[_0x3c505d(0x212)](_0x3c505d(0x22b)),_0x23cd7f[_0x3c505d(0x278)]>0x0&&console['error'](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x1fb)]('+\x20'+_0x23cd7f['length']+_0x3c505d(0x281))),_0x324248[_0x3c505d(0x278)]>0x0&&console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6['yellow']('~\x20'+_0x324248[_0x3c505d(0x278)]+'\x20to\x20update')),_0x1bde84[_0x3c505d(0x278)]>0x0&&console[_0x3c505d(0x212)]('\x20\x20\x20\x20'+a35_0x775e6[_0x3c505d(0x205)]('-\x20'+_0x1bde84[_0x3c505d(0x278)]+_0x3c505d(0x1d2))));console[_0x3c505d(0x212)](_0x3c505d(0x1ea)+a35_0x775e6['cyan'](_0x5ec8e4)+'\x0a');if(_0x468177['length']>0x0){console['error'](_0x3c505d(0x2b0));for(const _0x45c4e1 of _0x468177){console[_0x3c505d(0x212)]('\x20\x20'+a35_0x775e6[_0x3c505d(0x1e2)]('+')+'\x20'+_0x45c4e1);}console['error']('');}if(_0x5d83d5[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x223)])for(const _0x6e72e9 of _0x5d83d5){const _0xc91d5f=_0x6e72e9[_0x3c505d(0x2ac)]?_0x6e72e9[_0x3c505d(0x2ac)]+'/'+_0x6e72e9[_0x3c505d(0x210)]['name']:_0x6e72e9[_0x3c505d(0x210)][_0x3c505d(0x21f)],_0x4ec5e3=_0x6e72e9[_0x3c505d(0x210)][_0x3c505d(0x1ce)]?.[_0x3c505d(0x278)]||0x0,_0xed86e2=_0x4ec5e3>0x0?a35_0x775e6[_0x3c505d(0x230)]('\x20['+_0x4ec5e3+_0x3c505d(0x1f0)):'';console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6['green'](_0x3c505d(0x2b2))+'\x20'+_0xc91d5f+_0xed86e2),console['error']('─'[_0x3c505d(0x252)](0x3c)),_0x6e72e9[_0x3c505d(0x249)]&&console[_0x3c505d(0x212)](_0x6e72e9[_0x3c505d(0x249)]),console['error']('─'[_0x3c505d(0x252)](0x3c));}if(_0x271870[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x223)])for(const _0x4694d7 of _0x271870){const _0x553571=_0x4694d7[_0x3c505d(0x28f)]?_0x4fd007[_0x3c505d(0x231)](_0x4694d7[_0x3c505d(0x28f)]['toString']())||'':'',_0x316a28=_0x553571?_0x553571+'/'+_0x4694d7[_0x3c505d(0x21f)]:_0x4694d7[_0x3c505d(0x21f)],_0x338997=_0x4ce545[_0x3c505d(0x231)](_0x4694d7['id'])||[],_0x519e9b=_0x338997['length']>0x0?a35_0x775e6[_0x3c505d(0x230)]('\x20['+_0x338997['length']+_0x3c505d(0x1f0)):'';console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6[_0x3c505d(0x205)]('Delete\x20segment:')+'\x20'+_0x316a28+_0x519e9b),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c));const _0x3d0030=segmentWithActivationsToYaml(_0x4694d7,_0x338997,undefined,_0x583b40,_0x2a1a81),_0x493979=segmentToYamlString(_0x3d0030),_0x309ebe=generateDiff(_0x493979,'');console[_0x3c505d(0x212)](formatDiffWithColors(_0x309ebe)),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c));}const _0x31b9bf=_0x4db0e2[_0x3c505d(0x219)](_0x1ca255=>!_0x1ca255[_0x3c505d(0x1f3)]&&_0x1ca255[_0x3c505d(0x249)]);if(_0x31b9bf[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x223)])for(const _0x1134c7 of _0x31b9bf){const _0x8dd299=_0x1134c7[_0x3c505d(0x2ac)]?_0x1134c7[_0x3c505d(0x2ac)]+'/'+_0x1134c7['yamlConfig'][_0x3c505d(0x21f)]:_0x1134c7[_0x3c505d(0x210)]['name'];console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6[_0x3c505d(0x1da)](_0x3c505d(0x27d))+'\x20'+_0x8dd299),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c)),console['error'](_0x1134c7['diff']),console['error']('─'[_0x3c505d(0x252)](0x3c));}if(_0x2f0e9f['length']>0x0)for(const _0x5ea333 of _0x2f0e9f){const _0x17f63c=_0x5ea333[_0x3c505d(0x2ac)]?_0x5ea333[_0x3c505d(0x2ac)]+'/'+_0x5ea333[_0x3c505d(0x210)][_0x3c505d(0x21f)]:_0x5ea333[_0x3c505d(0x210)]['name'];console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6[_0x3c505d(0x1fb)](_0x3c505d(0x202))+'\x20'+_0x17f63c),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c)),_0x5ea333[_0x3c505d(0x249)]&&console['error'](_0x5ea333[_0x3c505d(0x249)]),console[_0x3c505d(0x212)]('─'['repeat'](0x3c));}const _0x3652d6=_0x28a2ab[_0x3c505d(0x219)](_0x1723c0=>!_0x1723c0[_0x3c505d(0x1f3)]&&_0x1723c0['diff']);if(_0x3652d6[_0x3c505d(0x278)]>0x0)for(const _0x1a544d of _0x3652d6){const _0x2c0e58=_0x1a544d[_0x3c505d(0x2ac)]?_0x1a544d[_0x3c505d(0x2ac)]+'/'+_0x1a544d[_0x3c505d(0x210)][_0x3c505d(0x21f)]:_0x1a544d[_0x3c505d(0x210)][_0x3c505d(0x21f)];console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x2c0e58),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c)),console[_0x3c505d(0x212)](_0x1a544d[_0x3c505d(0x249)]),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c));}if(_0x495a5f[_0x3c505d(0x278)]>0x0)for(const _0x561c32 of _0x495a5f){const _0x14aa7c=_0x561c32['folderId']?_0x4fd007['get'](_0x561c32['folderId'])||'':'',_0xa988d4=_0x14aa7c?_0x14aa7c+'/'+_0x561c32['journeyBundleName']:_0x561c32['journeyBundleName'];console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6['red']('Delete\x20journey:')+'\x20'+_0xa988d4),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c)),console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x205)]('(Journey\x20will\x20be\x20deleted)')),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c));}if(_0x5a4305[_0x3c505d(0x2b9)])return console[_0x3c505d(0x212)](a35_0x775e6['yellow'](_0x3c505d(0x1f9))),0x0;const _0x188c57=_0x5a4305[_0x3c505d(0x223)]?![]:_0x5d83d5['length']>0x0||_0xfdd612[_0x3c505d(0x278)]>0x0||_0x271870[_0x3c505d(0x278)]>0x0,_0x5ee401=_0x2f0e9f[_0x3c505d(0x278)]>0x0||_0xf0ae22[_0x3c505d(0x278)]>0x0||_0x495a5f[_0x3c505d(0x278)]>0x0,_0x21a648=_0x5a4305[_0x3c505d(0x223)]?![]:_0x21a547['length']>0x0,_0x1c3d6b=_0x468177[_0x3c505d(0x278)]>0x0;if(!_0x188c57&&!_0x5ee401&&!_0x21a648&&!_0x1c3d6b){const _0x1dc07f=_0x5a4305['journeysOnly']?_0x3c505d(0x241):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x1fb)](_0x1dc07f));if(_0x5a076f&&_0x13b11e[_0x3c505d(0x278)]===0x1){const _0x59d797=_0x13b11e[0x0];if(_0x59d797[_0x3c505d(0x1e7)]?.['id']){const _0x4a5735=getConsoleNextUrl(_0x5a4305[_0x3c505d(0x217)],_0x3c505d(0x1d0)+_0x4d869e+_0x3c505d(0x2a1)+_0x59d797[_0x3c505d(0x1e7)]['id']+_0x3c505d(0x25c));console[_0x3c505d(0x212)]('\x20\x20'+a35_0x775e6['cyan'](_0x4a5735));}}return 0x0;}const _0xcdd556=_0x5a4305[_0x3c505d(0x223)]?_0x2f0e9f[_0x3c505d(0x278)]+_0xf0ae22[_0x3c505d(0x278)]+_0x495a5f['length']+_0x468177[_0x3c505d(0x278)]:_0x5d83d5['length']+_0xfdd612[_0x3c505d(0x278)]+_0x271870['length']+_0x2f0e9f[_0x3c505d(0x278)]+_0xf0ae22[_0x3c505d(0x278)]+_0x495a5f[_0x3c505d(0x278)]+_0x468177[_0x3c505d(0x278)]+_0x21a547[_0x3c505d(0x278)];if(!_0x5a4305[_0x3c505d(0x25a)]&&_0xcdd556>0x0){const _0x261067=await confirmKey('Push\x20'+_0xcdd556+_0x3c505d(0x27e));if(!_0x261067)return console[_0x3c505d(0x212)]('Aborted.'),0x1;}for(const _0x26452f of _0x468177){const _0x51d875=_0x26452f[_0x3c505d(0x21d)]('/'),_0x25501f=_0x51d875[_0x51d875[_0x3c505d(0x278)]-0x1],_0x24e328=_0x51d875['slice'](0x0,-0x1)[_0x3c505d(0x2a6)]('/'),_0x48ea7d=_0x4a10a0['get'](_0x24e328),_0x621a1a={'name':_0x25501f,'parentFolderId':_0x48ea7d},_0x1840fd=await withSpinner(_0x3c505d(0x229)+_0x26452f+_0x3c505d(0x257),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x1fa)](_0x4d869e,_0x621a1a),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]});_0x4a10a0[_0x3c505d(0x24b)](_0x26452f,_0x1840fd[_0x3c505d(0x240)]['id']),console['error'](a35_0x775e6[_0x3c505d(0x1e2)]('✔\x20Created\x20folder\x20\x27'+_0x26452f+'\x27'));}let _0x532bfe=0x0,_0x338d4f=0x0,_0x6aa33f=0x0,_0x436294=0x0,_0x289af1=0x0,_0x1b46a8=0x0;const _0x20bf67=new Map();for(const _0x540505 of _0x5a4305['journeysOnly']?[]:_0x4db0e2){const _0x5c90c6=_0x540505[_0x3c505d(0x2ac)]?_0x4a10a0[_0x3c505d(0x231)](_0x540505['folderPath']):undefined;let _0x15c914;try{if(_0x540505[_0x3c505d(0x1f3)]){const _0x209ade=yamlToCreateRequest(_0x540505[_0x3c505d(0x210)],_0x5c90c6),_0x55c59e=await withSpinner(_0x3c505d(0x1dc)+_0x540505[_0x3c505d(0x210)][_0x3c505d(0x21f)]+_0x3c505d(0x257),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x227)](_0x4d869e,_0x209ade),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]});_0x15c914=_0x55c59e[_0x3c505d(0x240)]['id'],_0x20bf67[_0x3c505d(0x24b)](_0x540505[_0x3c505d(0x210)]['name'],_0x15c914),console['error'](a35_0x775e6[_0x3c505d(0x1fb)](_0x3c505d(0x294)+_0x540505[_0x3c505d(0x210)]['name']+'\x27')),_0x532bfe++;}else{if(_0x540505[_0x3c505d(0x24c)]){const _0x1aebab=yamlToUpdateRequest(_0x540505[_0x3c505d(0x210)]);_0x5c90c6!==_0x540505[_0x3c505d(0x286)]?.[_0x3c505d(0x28f)]&&(_0x1aebab[_0x3c505d(0x28f)]=_0x5c90c6?parseInt(_0x5c90c6,0xa):undefined),await withSpinner('Updating\x20segment\x20\x27'+_0x540505['yamlConfig'][_0x3c505d(0x21f)]+_0x3c505d(0x257),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x220)](_0x4d869e,_0x540505[_0x3c505d(0x286)]['id'],_0x1aebab),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),_0x15c914=_0x540505[_0x3c505d(0x286)]['id'],console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x1da)](_0x3c505d(0x29c)+_0x540505[_0x3c505d(0x210)][_0x3c505d(0x21f)]+'\x27')),_0x338d4f++;}else _0x15c914=_0x540505[_0x3c505d(0x286)]['id'];}}catch(_0x193316){const _0x750b3=isHttp400Error(_0x193316),_0x5ce335=_0x750b3?ErrorCode[_0x3c505d(0x24f)]:ErrorCode[_0x3c505d(0x255)],_0x244f52=getErrorMessage(_0x193316);throw new SDKError(_0x5ce335,_0x3c505d(0x251)+(_0x540505[_0x3c505d(0x1f3)]?_0x3c505d(0x260):_0x3c505d(0x23e))+_0x3c505d(0x261)+_0x540505[_0x3c505d(0x2a9)]+_0x3c505d(0x2b4)+_0x244f52,_0x193316);}for(const _0x5e39e of _0x540505[_0x3c505d(0x1d3)]){try{if(_0x5e39e[_0x3c505d(0x272)]===_0x3c505d(0x260)&&_0x5e39e[_0x3c505d(0x29d)]){const _0x5a84c3=yamlActivationToCreateRequest(_0x5e39e[_0x3c505d(0x29d)],_0x47b79c,_0x174bb4);await withSpinner(_0x3c505d(0x20e)+_0x5e39e['name']+'\x27...',()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x206)](_0x4d869e,_0x15c914,_0x5a84c3),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),console[_0x3c505d(0x212)](a35_0x775e6['green'](_0x3c505d(0x285)+_0x5e39e[_0x3c505d(0x21f)]+'\x27')),_0x436294++;}else{if(_0x5e39e['type']===_0x3c505d(0x23e)&&_0x5e39e[_0x3c505d(0x29d)]&&_0x5e39e[_0x3c505d(0x20c)]){const _0x86e37a=yamlActivationToUpdateRequest(_0x5e39e['yamlActivation'],_0x47b79c,_0x174bb4);await withSpinner(_0x3c505d(0x201)+_0x5e39e[_0x3c505d(0x21f)]+'\x27...',()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x1e6)](_0x4d869e,_0x15c914,_0x5e39e[_0x3c505d(0x20c)]['id'],_0x86e37a),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x1da)](_0x3c505d(0x22c)+_0x5e39e[_0x3c505d(0x21f)]+'\x27')),_0x289af1++;}else _0x5e39e['type']===_0x3c505d(0x1d4)&&_0x5e39e[_0x3c505d(0x20c)]&&(await withSpinner(_0x3c505d(0x274)+_0x5e39e['name']+'\x27...',()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x228)](_0x4d869e,_0x15c914,_0x5e39e[_0x3c505d(0x20c)]['id']),{'verbose':_0x5a4305['verbose']}),console[_0x3c505d(0x212)](a35_0x775e6['red'](_0x3c505d(0x24e)+_0x5e39e['name']+'\x27')),_0x1b46a8++);}}catch(_0x43fab6){const _0x45b6ab=isHttp400Error(_0x43fab6),_0x2e794c=_0x45b6ab?ErrorCode[_0x3c505d(0x290)]:ErrorCode[_0x3c505d(0x214)],_0x3439ff=getErrorMessage(_0x43fab6);throw new SDKError(_0x2e794c,'Failed\x20to\x20'+_0x5e39e[_0x3c505d(0x272)]+_0x3c505d(0x2ad)+_0x5e39e[_0x3c505d(0x21f)]+_0x3c505d(0x1fe)+_0x540505[_0x3c505d(0x2a9)]+_0x3c505d(0x2b4)+_0x3439ff,_0x43fab6);}}}for(const _0x413e75 of _0x5a4305['journeysOnly']?[]:_0x271870){await withSpinner(_0x3c505d(0x25e)+_0x413e75[_0x3c505d(0x21f)]+_0x3c505d(0x257),()=>_0x478b93['segment']['deleteSegment'](_0x413e75['id']),{'verbose':_0x5a4305['verbose']}),console[_0x3c505d(0x212)](a35_0x775e6['red']('✔\x20Deleted\x20segment\x20\x27'+_0x413e75['name']+'\x27')),_0x6aa33f++;}let _0x4617db=0x0,_0x2fa3fa=0x0,_0x551c9d=0x0;const _0x2c78c3=new Map(_0x132bf0);for(const _0x1538be of _0x4db0e2){_0x1538be[_0x3c505d(0x1f3)]&&_0x20bf67['has'](_0x1538be[_0x3c505d(0x210)][_0x3c505d(0x21f)])&&_0x2c78c3[_0x3c505d(0x24b)](_0x1538be[_0x3c505d(0x210)]['name'],_0x20bf67['get'](_0x1538be[_0x3c505d(0x210)][_0x3c505d(0x21f)]));}if(_0x28a2ab['length']>0x0){const _0x53219c=await withQuerySpinner(_0x3c505d(0x218),async _0x14c8ce=>{const _0x445fbf=_0x3c505d,_0x5973b4=[];let _0x5378a7=0x0;const _0x5115f2=0x5;for(let _0x557f81=0x0;_0x557f81<_0x28a2ab['length'];_0x557f81+=_0x5115f2){const _0x40654e=_0x28a2ab['slice'](_0x557f81,_0x557f81+_0x5115f2),_0x18e383=await Promise[_0x445fbf(0x222)](_0x40654e[_0x445fbf(0x22f)](async _0x202d39=>{const _0x51d373=_0x445fbf;if(!_0x202d39['isNew']&&!_0x202d39[_0x51d373(0x24c)])return{'action':_0x51d373(0x284),'name':_0x202d39['yamlConfig'][_0x51d373(0x21f)],'journeyId':_0x202d39['existingJourney']?.['id']};const _0x1d4852=_0x202d39[_0x51d373(0x2ac)]?_0x4a10a0['get'](_0x202d39[_0x51d373(0x2ac)]):undefined,_0x1ffc07=_0x202d39[_0x51d373(0x1f3)]?_0x51d373(0x21a):_0x51d373(0x215);_0x14c8ce[_0x51d373(0x26d)](_0x1ffc07+_0x51d373(0x265)+_0x202d39[_0x51d373(0x210)][_0x51d373(0x21f)]+'\x27');const _0x4ccd0e=new Map(),_0x4aacff=new Map(),_0x36153b=new Map(),_0x53a98c={'resolveSegmentId':async _0x1decc9=>{const _0x411494=_0x51d373,_0x3b1534=_0x2c78c3[_0x411494(0x231)](_0x1decc9);if(!_0x3b1534)throw new SDKError(ErrorCode[_0x411494(0x26b)],_0x411494(0x1fc)+_0x1decc9+_0x411494(0x208)+_0x202d39[_0x411494(0x210)][_0x411494(0x21f)]+')');return _0x3b1534;},'resolveEmbeddedSegmentId':async(_0x4bdf9e,_0x421929)=>{const _0x55f3b9=_0x51d373,_0x1aef70=_0x2c78c3[_0x55f3b9(0x231)](_0x4bdf9e);if(_0x1aef70)return _0x1aef70;const _0x150aa7=_0x284777['find'](_0x377522=>_0x377522[_0x55f3b9(0x21f)]===_0x4bdf9e);if(_0x150aa7)return _0x2c78c3[_0x55f3b9(0x24b)](_0x4bdf9e,_0x150aa7['id']),_0x150aa7['id'];if(_0x202d39[_0x55f3b9(0x1f3)]){const _0xf65d32=_0x202d39[_0x55f3b9(0x210)][_0x55f3b9(0x250)]||_0x202d39['yamlConfig'][_0x55f3b9(0x1d5)]?.[0x0]?.[_0x55f3b9(0x250)]||[];let _0x285eb8='entry',_0x50ea3a=_0x4bdf9e;for(const _0x40bd95 of _0xf65d32){if(_0x40bd95[_0x55f3b9(0x28b)]?.[_0x55f3b9(0x1d7)]===_0x4bdf9e){_0x285eb8=_0x40bd95[_0x55f3b9(0x21f)],_0x50ea3a=_0x40bd95['entry_criteria'][_0x55f3b9(0x21f)]||_0x4bdf9e;break;}}return _0x4aacff[_0x55f3b9(0x24b)](_0x4bdf9e,{'definition':_0x421929,'stageName':_0x285eb8,'criteriaName':_0x50ea3a}),createPendingSegmentId(_0x4bdf9e);}const _0x298598=_0x202d39[_0x55f3b9(0x1e7)]?.['id'];if(!_0x298598)throw new SDKError(ErrorCode[_0x55f3b9(0x233)],_0x55f3b9(0x2ae));const _0x5e5457=_0x55f3b9(0x21c)+crypto['randomUUID']();try{const _0x266cbc=await _0x478b93['segment'][_0x55f3b9(0x269)]({'name':_0x5e5457,'description':_0x421929['description']||'Entry\x20criteria:\x20'+_0x4bdf9e,'journeyId':_0x298598,'rule':yamlRuleToApi(_0x421929[_0x55f3b9(0x23c)],!![]),'countPopulation':!![],'parentFolderId':_0x326beb||'','audienceId':_0x4d869e});return _0x5a4305['verbose']&&console[_0x55f3b9(0x212)](_0x55f3b9(0x2a4)+_0x4bdf9e+_0x55f3b9(0x24d)+_0x5e5457+_0x55f3b9(0x22d)+_0x266cbc),_0x2c78c3[_0x55f3b9(0x24b)](_0x4bdf9e,_0x266cbc),_0x266cbc;}catch(_0x2784e1){throw new SDKError(ErrorCode[_0x55f3b9(0x255)],_0x55f3b9(0x247)+_0x4bdf9e+_0x55f3b9(0x235)+getErrorMessage(_0x2784e1),_0x2784e1);}},'resolveActivationId':async _0x10a1ce=>{const _0x40fb12=_0x51d373,_0x5874eb=_0x4ccd0e['get'](_0x10a1ce);if(_0x5874eb)return _0x5874eb;if(_0x202d39[_0x40fb12(0x1e7)]){const _0x1fdd53=await _0x478b93['journey'][_0x40fb12(0x246)](_0x202d39['existingJourney']['id']),_0x2b0396=_0x1fdd53['find'](_0x36c2a5=>_0x36c2a5[_0x40fb12(0x1e1)][_0x40fb12(0x1ee)]?.['name']===_0x10a1ce);if(_0x2b0396)return _0x4ccd0e[_0x40fb12(0x24b)](_0x10a1ce,_0x2b0396['id']),_0x2b0396['id'];}throw new SDKError(ErrorCode[_0x40fb12(0x1d1)],_0x40fb12(0x1cf)+_0x10a1ce+_0x40fb12(0x208)+_0x202d39['yamlConfig'][_0x40fb12(0x21f)]+').\x20'+_0x40fb12(0x2ab));},'resolveEmbeddedActivationId':async(_0x21b434,_0xc500d5)=>{const _0x380a97=_0x51d373,_0x50884d=_0x4ccd0e[_0x380a97(0x231)](_0x21b434);if(_0x50884d)return _0x50884d;if(_0x202d39[_0x380a97(0x1f3)])return _0x36153b[_0x380a97(0x24b)](_0x21b434,_0xc500d5),createPendingActivationId(_0x21b434);if(_0x202d39[_0x380a97(0x1e7)]){const _0x34a503=await _0x478b93[_0x380a97(0x1df)]['listActivations'](_0x202d39[_0x380a97(0x1e7)]['id']),_0x1b5bab=_0x34a503[_0x380a97(0x20d)](_0x5e6d3b=>_0x5e6d3b['attributes'][_0x380a97(0x1ee)]?.['name']===_0xc500d5[_0x380a97(0x21f)]);if(_0x1b5bab)return _0x4ccd0e[_0x380a97(0x24b)](_0x21b434,_0x1b5bab['id']),_0x1b5bab['id'];try{const _0x902071=yamlActivationToCreateRequest(_0xc500d5,_0x47b79c,_0x174bb4),_0x2ac626=await _0x478b93['journey'][_0x380a97(0x206)](_0x202d39[_0x380a97(0x1e7)]['id'],_0x902071);return _0x5a4305['verbose']&&console[_0x380a97(0x212)]('\x20\x20Created\x20embedded\x20activation\x20\x27'+_0x21b434+_0x380a97(0x263)+_0x2ac626['id']),_0x4ccd0e[_0x380a97(0x24b)](_0x21b434,_0x2ac626['id']),_0x2ac626['id'];}catch(_0x223c99){throw new SDKError(ErrorCode[_0x380a97(0x28e)],'Failed\x20to\x20create\x20embedded\x20activation\x20\x27'+_0x21b434+_0x380a97(0x235)+getErrorMessage(_0x223c99),_0x223c99);}}throw new SDKError(ErrorCode[_0x380a97(0x233)],_0x380a97(0x22e));},'resolveJourneyId':async _0x4bb716=>{const _0x5964df=_0x51d373;try{return await _0x478b93[_0x5964df(0x1df)]['resolveJourneyId'](_0x4d869e,_0x4bb716);}catch(_0x2bc19a){throw new SDKError(ErrorCode[_0x5964df(0x1d1)],'Journey\x20\x27'+_0x4bb716+_0x5964df(0x243)+_0x202d39[_0x5964df(0x210)][_0x5964df(0x21f)]+'\x27)',_0x2bc19a);}},'resolveStageId':async(_0x4b5b51,_0x440d56)=>{const _0x2f4c70=_0x51d373,_0x5b9264=await _0x478b93['journey']['getJourney'](_0x4b5b51),_0x4cba6b=_0x5b9264['attributes'][_0x2f4c70(0x29e)][_0x2f4c70(0x20d)](_0x548b14=>_0x548b14['name']['toLowerCase']()===_0x440d56[_0x2f4c70(0x1de)]());if(!_0x4cba6b?.['id'])throw new SDKError(ErrorCode[_0x2f4c70(0x1d1)],_0x2f4c70(0x1fd)+_0x440d56+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x5b9264[_0x2f4c70(0x1e1)][_0x2f4c70(0x234)]||_0x5b9264['attributes'][_0x2f4c70(0x21f)])+'\x27');return _0x4cba6b['id'];}};try{const _0x46f7de=await a35_0x39979b(_0x202d39[_0x51d373(0x210)],_0x4d869e,_0x53a98c),_0xd7cd0f=_0x1d4852||_0x326beb;_0xd7cd0f&&(_0x46f7de['relationships']={'parentFolder':{'data':{'id':_0xd7cd0f,'type':_0x51d373(0x1f5)}}});if(_0x202d39[_0x51d373(0x1f3)]){if(_0x4aacff[_0x51d373(0x221)]>0x0||_0x36153b[_0x51d373(0x221)]>0x0){const _0x11c05b=JSON['parse'](JSON[_0x51d373(0x299)](_0x46f7de));ensureJourneyDefaults(_0x11c05b['attributes']);for(const _0x4d69c8 of _0x11c05b['attributes'][_0x51d373(0x29e)]){_0x4d69c8['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x4d69c8['entryCriteria']['segmentId'])&&delete _0x4d69c8['entryCriteria'];if(_0x4d69c8[_0x51d373(0x29b)])for(const _0x973f8d of Object['keys'](_0x4d69c8[_0x51d373(0x29b)])){const _0x17c550=_0x4d69c8[_0x51d373(0x29b)][_0x973f8d];_0x17c550[_0x51d373(0x272)]===_0x51d373(0x282)&&_0x17c550[_0x51d373(0x1cb)]&&isPendingActivationId(_0x17c550[_0x51d373(0x1cb)])&&(_0x17c550[_0x51d373(0x1cb)]='');if(_0x17c550[_0x51d373(0x272)]===_0x51d373(0x1ff)&&_0x17c550[_0x51d373(0x1f1)])for(const _0x3086c8 of _0x17c550['branches']){_0x3086c8[_0x51d373(0x26e)]&&isPendingSegmentId(_0x3086c8['segmentId'])&&(_0x3086c8[_0x51d373(0x26e)]='');}}}_0x5a4305[_0x51d373(0x1e0)]&&console[_0x51d373(0x212)](_0x51d373(0x1e8)+JSON['stringify'](_0x11c05b,null,0x2));const _0x3df753=await _0x478b93[_0x51d373(0x1df)][_0x51d373(0x260)](_0x11c05b),_0x19dfa3=_0x3df753['id'],_0x392fd1=new Map();for(const _0x4c49d7 of _0x3df753[_0x51d373(0x1e1)]['journeyStages']){_0x392fd1['set'](_0x4c49d7[_0x51d373(0x21f)][_0x51d373(0x1de)](),_0x4c49d7['id']);}const _0x38b795=new Map();for(const [_0x4293cf,{definition:_0x1f1bc1,criteriaName:_0x18634b}]of _0x4aacff){const _0x2771b0=generateJourneyLocalName(_0x18634b)||'journey_entry_criteria_'+crypto[_0x51d373(0x268)]();_0x5a4305[_0x51d373(0x1e0)]&&console[_0x51d373(0x212)](_0x51d373(0x1e5)+_0x4293cf+_0x51d373(0x24d)+_0x2771b0+')\x20with\x20journeyId:\x20'+_0x19dfa3);const _0x412011=await _0x478b93[_0x51d373(0x1d7)][_0x51d373(0x269)]({'name':_0x2771b0,'description':_0x1f1bc1[_0x51d373(0x204)]||_0x51d373(0x24a)+_0x4293cf,'journeyId':_0x19dfa3,'rule':yamlRuleToApi(_0x1f1bc1['rule'],!![]),'countPopulation':!![],'parentFolderId':_0xd7cd0f||'','audienceId':_0x4d869e});_0x38b795['set'](_0x4293cf,_0x412011),_0x2c78c3[_0x51d373(0x24b)](_0x4293cf,_0x412011),_0x5a4305['verbose']&&console[_0x51d373(0x212)](_0x51d373(0x2a4)+_0x4293cf+_0x51d373(0x263)+_0x412011);}const _0x35935e=new Map();for(const [_0x54c738,_0x2cbaf3]of _0x36153b){_0x5a4305[_0x51d373(0x1e0)]&&console['error'](_0x51d373(0x237)+_0x54c738+'\x27\x20with\x20journeyId:\x20'+_0x19dfa3);try{const _0xcaf082=yamlActivationToCreateRequest(_0x2cbaf3,_0x47b79c,_0x174bb4),_0xe127c=await _0x478b93[_0x51d373(0x1df)][_0x51d373(0x206)](_0x19dfa3,_0xcaf082);_0x35935e['set'](_0x54c738,_0xe127c['id']),_0x4ccd0e['set'](_0x54c738,_0xe127c['id']),_0x5a4305[_0x51d373(0x1e0)]&&console[_0x51d373(0x212)](_0x51d373(0x258)+_0x54c738+'\x27\x20with\x20ID:\x20'+_0xe127c['id']);}catch(_0x46397f){throw new SDKError(ErrorCode[_0x51d373(0x28e)],_0x51d373(0x1e4)+_0x54c738+_0x51d373(0x235)+getErrorMessage(_0x46397f),_0x46397f);}}const _0x4d0c61=JSON[_0x51d373(0x225)](JSON['stringify'](_0x46f7de));_0x4d0c61['id']=_0x19dfa3,ensureJourneyDefaults(_0x4d0c61['attributes']);for(const _0x4b8f15 of _0x4d0c61[_0x51d373(0x1e1)][_0x51d373(0x29e)]){const _0x3499a2=_0x392fd1['get'](_0x4b8f15[_0x51d373(0x21f)][_0x51d373(0x1de)]());_0x3499a2&&(_0x4b8f15['id']=_0x3499a2);if(_0x4b8f15[_0x51d373(0x2a5)]?.[_0x51d373(0x26e)]&&isPendingSegmentId(_0x4b8f15[_0x51d373(0x2a5)][_0x51d373(0x26e)])){const _0x427978=extractPendingSegmentName(_0x4b8f15[_0x51d373(0x2a5)][_0x51d373(0x26e)]),_0x5688bc=_0x38b795['get'](_0x427978);_0x5688bc&&(_0x4b8f15['entryCriteria']['segmentId']=_0x5688bc);}if(_0x4b8f15[_0x51d373(0x29b)]){const _0x1b20dd=_0x3e1b96=>_0x46f7de['attributes'][_0x51d373(0x29e)]['find'](_0x40b02d=>_0x40b02d[_0x51d373(0x21f)][_0x51d373(0x1de)]()===_0x4b8f15[_0x51d373(0x21f)]['toLowerCase']())?.[_0x51d373(0x29b)]?.[_0x3e1b96];for(const _0x5b5281 of Object[_0x51d373(0x200)](_0x4b8f15['steps'])){const _0x51bddb=_0x4b8f15[_0x51d373(0x29b)][_0x5b5281],_0x4de2c9=_0x1b20dd(_0x5b5281);if(_0x51bddb[_0x51d373(0x272)]==='Activation'&&_0x51bddb[_0x51d373(0x1cb)]&&(isPendingActivationId(_0x51bddb[_0x51d373(0x1cb)])||_0x51bddb[_0x51d373(0x1cb)]==='')){if(_0x4de2c9?.['journeyActivationStepId']&&isPendingActivationId(_0x4de2c9[_0x51d373(0x1cb)])){const _0x580626=extractPendingActivationName(_0x4de2c9[_0x51d373(0x1cb)]),_0x2ac1f7=_0x35935e[_0x51d373(0x231)](_0x580626);_0x2ac1f7&&(_0x51bddb['journeyActivationStepId']=_0x2ac1f7);}}if(_0x51bddb[_0x51d373(0x272)]===_0x51d373(0x1ff)&&_0x51bddb[_0x51d373(0x1f1)]&&_0x4de2c9?.[_0x51d373(0x1f1)])for(let _0x55fe27=0x0;_0x55fe27<_0x51bddb['branches']['length'];_0x55fe27++){const _0x4022e4=_0x51bddb['branches'][_0x55fe27],_0x1c2ba0=_0x4de2c9['branches'][_0x55fe27];if(_0x1c2ba0?.[_0x51d373(0x26e)]&&isPendingSegmentId(_0x1c2ba0['segmentId'])){const _0x48b71b=extractPendingSegmentName(_0x1c2ba0[_0x51d373(0x26e)]),_0x380988=_0x38b795['get'](_0x48b71b);_0x380988&&(_0x4022e4[_0x51d373(0x26e)]=_0x380988);}}}}}return _0x5a4305[_0x51d373(0x1e0)]&&console[_0x51d373(0x212)]('\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20'+JSON[_0x51d373(0x299)](_0x4d0c61,null,0x2)),await _0x478b93[_0x51d373(0x1df)]['update'](_0x19dfa3,_0x4d0c61),{'action':_0x51d373(0x226),'name':_0x202d39['yamlConfig'][_0x51d373(0x21f)],'journeyId':_0x19dfa3};}else{ensureJourneyDefaults(_0x46f7de['attributes']);_0x5a4305[_0x51d373(0x1e0)]&&console[_0x51d373(0x212)]('\x20\x20Journey\x20API\x20request:\x20'+JSON[_0x51d373(0x299)](_0x46f7de,null,0x2));const _0x3a38d9=await _0x478b93[_0x51d373(0x1df)][_0x51d373(0x260)](_0x46f7de);return{'action':_0x51d373(0x226),'name':_0x202d39[_0x51d373(0x210)][_0x51d373(0x21f)],'journeyId':_0x3a38d9['id']};}}else{if(_0x202d39[_0x51d373(0x24c)]&&_0x202d39[_0x51d373(0x1e7)])return ensureJourneyDefaults(_0x46f7de['attributes']),await _0x478b93[_0x51d373(0x1df)]['update'](_0x202d39[_0x51d373(0x1e7)]['id'],_0x46f7de),{'action':'updated','name':_0x202d39[_0x51d373(0x210)]['name'],'journeyId':_0x202d39[_0x51d373(0x1e7)]['id']};}return{'action':_0x51d373(0x284),'name':_0x202d39['yamlConfig'][_0x51d373(0x21f)],'journeyId':_0x202d39[_0x51d373(0x1e7)]?.['id']};}catch(_0x38148f){const _0x4a2e8e=isHttp400Error(_0x38148f),_0x4d8425=_0x4a2e8e?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x51d373(0x28e)],_0x3036f0=getErrorMessage(_0x38148f);throw new SDKError(_0x4d8425,_0x51d373(0x251)+(_0x202d39[_0x51d373(0x1f3)]?_0x51d373(0x260):'update')+'\x20journey\x20from\x20file:\x20'+_0x202d39[_0x51d373(0x2a9)]+_0x51d373(0x2b4)+_0x3036f0,_0x38148f);}}));_0x5973b4[_0x445fbf(0x20b)](..._0x18e383),_0x5378a7+=_0x40654e[_0x445fbf(0x278)],_0x14c8ce[_0x445fbf(0x29f)]('('+_0x5378a7+'/'+_0x28a2ab['length']+')');}return _0x5973b4;},{'verbose':_0x5a4305[_0x3c505d(0x1e0)]});for(const _0x876014 of _0x53219c['data']){if(_0x876014[_0x3c505d(0x2b8)]===_0x3c505d(0x226))console['error'](a35_0x775e6[_0x3c505d(0x1fb)](_0x3c505d(0x25d)+_0x876014[_0x3c505d(0x21f)]+'\x27')),_0x4617db++;else _0x876014['action']==='updated'&&(console['error'](a35_0x775e6['yellow'](_0x3c505d(0x28a)+_0x876014[_0x3c505d(0x21f)]+'\x27')),_0x2fa3fa++);}if(_0x5a076f&&_0x53219c[_0x3c505d(0x240)]['length']===0x1){const _0x2a633e=_0x53219c[_0x3c505d(0x240)][0x0];if(_0x2a633e[_0x3c505d(0x1f8)]){const _0x14948c=getConsoleNextUrl(_0x5a4305[_0x3c505d(0x217)],_0x3c505d(0x1d0)+_0x4d869e+'/e/'+_0x2a633e[_0x3c505d(0x1f8)]+_0x3c505d(0x25c));console[_0x3c505d(0x212)]('\x20\x20'+a35_0x775e6[_0x3c505d(0x216)](_0x14948c));}}}for(const _0x2cce66 of _0x495a5f){console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x1da)](_0x3c505d(0x270)+_0x2cce66['journeyBundleName'])),_0x551c9d++;}const _0x5983ff=[];if(_0x532bfe>0x0)_0x5983ff['push'](_0x532bfe+_0x3c505d(0x293));if(_0x338d4f>0x0)_0x5983ff['push'](_0x338d4f+_0x3c505d(0x26a));if(_0x6aa33f>0x0)_0x5983ff[_0x3c505d(0x20b)](_0x6aa33f+_0x3c505d(0x25f));const _0x53e4ad=[];if(_0x4617db>0x0)_0x53e4ad[_0x3c505d(0x20b)](_0x4617db+_0x3c505d(0x293));if(_0x2fa3fa>0x0)_0x53e4ad[_0x3c505d(0x20b)](_0x2fa3fa+'\x20updated');if(_0x551c9d>0x0)_0x53e4ad['push'](_0x551c9d+'\x20deleted');const _0x313f1c=[];if(_0x436294>0x0)_0x313f1c[_0x3c505d(0x20b)](_0x436294+_0x3c505d(0x293));if(_0x289af1>0x0)_0x313f1c['push'](_0x289af1+_0x3c505d(0x26a));if(_0x1b46a8>0x0)_0x313f1c[_0x3c505d(0x20b)](_0x1b46a8+_0x3c505d(0x25f));return console[_0x3c505d(0x212)](a35_0x775e6['green']('\x0a✔\x20Push\x20complete')),_0x5983ff[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x223)]&&console[_0x3c505d(0x212)](_0x3c505d(0x23d)+_0x5983ff[_0x3c505d(0x2a6)](',\x20')),_0x53e4ad['length']>0x0&&console[_0x3c505d(0x212)](_0x3c505d(0x2a2)+_0x53e4ad[_0x3c505d(0x2a6)](',\x20')),_0x313f1c['length']>0x0&&!_0x5a4305[_0x3c505d(0x223)]&&console[_0x3c505d(0x212)]('\x20\x20Activations:\x20'+_0x313f1c[_0x3c505d(0x2a6)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x324b06){const _0x24132b=a35_0x502313,_0x311089=new Map(),_0x14c280=new Map();for(const _0x3a2761 of _0x324b06){_0x14c280['set'](_0x3a2761['id'],_0x3a2761);}const _0x3998db=new Set();for(const _0x355cd8 of _0x324b06){!_0x355cd8[_0x24132b(0x298)]&&_0x3998db[_0x24132b(0x1f6)](_0x355cd8['id']);}function _0x5b86a5(_0x208f03){const _0x3a7d4a=_0x24132b;if(_0x3998db[_0x3a7d4a(0x271)](_0x208f03['id']))return'';if(_0x208f03[_0x3a7d4a(0x298)]){const _0x1c2b95=_0x14c280[_0x3a7d4a(0x231)](_0x208f03['parentFolderId']);if(_0x1c2b95){const _0x111a5a=_0x5b86a5(_0x1c2b95);return _0x111a5a?_0x111a5a+'/'+_0x208f03[_0x3a7d4a(0x21f)]:_0x208f03[_0x3a7d4a(0x21f)];}}return _0x208f03[_0x3a7d4a(0x21f)];}for(const _0x234d39 of _0x324b06){const _0x16866a=_0x5b86a5(_0x234d39);_0x311089[_0x24132b(0x24b)](_0x16866a,_0x234d39['id']);}return _0x311089;}function findYamlFiles(_0x469ef8){const _0x1ff7fb=[];function _0x510946(_0x29eed4){const _0x232f7d=a35_0x55dd,_0x59feed=readdirSync(_0x29eed4,{'withFileTypes':!![]});for(const _0x47bfec of _0x59feed){const _0x43018c=a35_0x2e958f[_0x232f7d(0x2a6)](_0x29eed4,_0x47bfec[_0x232f7d(0x21f)]);if(_0x47bfec['isDirectory']())_0x510946(_0x43018c);else(_0x47bfec[_0x232f7d(0x21f)][_0x232f7d(0x25b)](_0x232f7d(0x2aa))||_0x47bfec['name'][_0x232f7d(0x25b)](_0x232f7d(0x1ed)))&&_0x1ff7fb[_0x232f7d(0x20b)](_0x43018c);}}return _0x510946(_0x469ef8),_0x1ff7fb;}function calculateActivationActions(_0x38bbcd,_0x303646,_0x592579,_0x341f19){const _0x99b1aa=a35_0x502313,_0xa9e90=[],_0x5000ea=new Map();for(const _0x445c31 of _0x303646){_0x5000ea[_0x99b1aa(0x24b)](_0x445c31[_0x99b1aa(0x21f)],_0x445c31);}const _0x519d8c=new Map();for(const _0x2313a1 of _0x38bbcd){_0x519d8c[_0x99b1aa(0x24b)](_0x2313a1[_0x99b1aa(0x21f)],_0x2313a1);}for(const _0x652125 of _0x38bbcd){const _0x46e228=_0x5000ea[_0x99b1aa(0x231)](_0x652125['name']);if(!_0x46e228)_0xa9e90['push']({'type':'create','name':_0x652125[_0x99b1aa(0x21f)],'yamlActivation':_0x652125});else{const _0x54cae0=activationToYaml(_0x46e228,_0x592579,_0x341f19),_0x227983=a35_0x2c3d0b['stringify'](_0x54cae0),_0x26e287=a35_0x2c3d0b['stringify'](_0x652125);_0x227983!==_0x26e287&&_0xa9e90[_0x99b1aa(0x20b)]({'type':_0x99b1aa(0x23e),'name':_0x652125[_0x99b1aa(0x21f)],'yamlActivation':_0x652125,'existingActivation':_0x46e228});}}for(const _0x4ac68b of _0x303646){!_0x519d8c[_0x99b1aa(0x271)](_0x4ac68b['name'])&&_0xa9e90['push']({'type':_0x99b1aa(0x1d4),'name':_0x4ac68b['name'],'existingActivation':_0x4ac68b});}return _0xa9e90;}
1
+ const a36_0x23a37f=a36_0x1d1c;(function(_0x1f1a06,_0x344b74){const _0x4094df=a36_0x1d1c,_0x321aa5=_0x1f1a06();while(!![]){try{const _0x2042e3=-parseInt(_0x4094df(0x23f))/0x1*(-parseInt(_0x4094df(0x278))/0x2)+parseInt(_0x4094df(0x1e1))/0x3+-parseInt(_0x4094df(0x208))/0x4+-parseInt(_0x4094df(0x223))/0x5*(-parseInt(_0x4094df(0x220))/0x6)+parseInt(_0x4094df(0x1c0))/0x7*(parseInt(_0x4094df(0x272))/0x8)+parseInt(_0x4094df(0x24f))/0x9+-parseInt(_0x4094df(0x23d))/0xa;if(_0x2042e3===_0x344b74)break;else _0x321aa5['push'](_0x321aa5['shift']());}catch(_0x2f1fca){_0x321aa5['push'](_0x321aa5['shift']());}}}(a36_0xa6c3,0x6b6ec));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../sdk/errors.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,yamlActivationToUpdateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x4aa7d6,yamlToApi as a36_0x3c7ba,toYamlString as a36_0xdc6651,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a36_0x55958f from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a36_0x327b7c from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a36_0x54d85f from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';function a36_0xa6c3(){const _0x444640=['JOURNEY_UPDATE_ERROR','\x20\x20🗺️\x20\x20Journeys:','\x20created','\x27\x20with\x20journeyId:\x20','\x20\x20Created\x20embedded\x20activation\x20\x27','SEGMENT_UPDATE_ERROR','journeyActivationStepId','Deleting\x20activation\x20\x27','\x20activations]','journey_entry_criteria_','entry_criteria','Creating','size','from','2474670NZiHIC','cyan','split','DecisionPoint','endsWith','existingSegment','attributes','all','/j/da/je','diff','stages','Fetching\x20parent\x20segment\x20details...','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Scoped\x20to\x20folder:\x20','\x20new','activations','unchanged','updateActivation','find','get','\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20','dryRun','\x20(referenced\x20in\x20journey\x20','createFolder','/e/','\x20segment\x20from\x20file:\x20','\x27\x20from\x20file:\x20','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','slice','.yml','\x20deleted','listActivations','created','kind','stringify','\x20\x20Journeys:\x20','sort','verbose','randomUUID','1970828kBcLxT','\x20journey\x20from\x20file:\x20','buildUserMaps','\x20to\x20update','Pushing\x20journeys...','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','rule','length','absolutePath','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20Created\x20embedded\x20segment\x20\x27','parentSegment','dim','Updating\x20activation\x20\x27','New\x20segment:','\x20unchanged','\x20\x20\x20\x20','createSegment','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','journey','📁\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','parent_segment','✔\x20Created\x20journey\x20\x27','972TRqbvc','journeyBundleName','Creating\x20folder\x20\x27','11300NfTttO','relative','update','site','activationActions','listFolders','utf-8','Creating\x20segment\x20\x27','configDir','segmentId','name','parentFolder','user','\x0a✔\x20Push\x20complete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20Source:\x20','\x27\x20v','Fetching\x20existing\x20folders...','\x20\x20✔\x20Created\x20activation\x20\x27','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','connection','Delete\x20segment:','error','push','\x20updated','yes','12739000oHTaFd','\x20journey\x20\x27','1NJZcRg','.yaml','execute','data','state','isNew','filter','createActivation',')\x20with\x20journeyId:\x20','entries','Failed\x20to\x20create\x20embedded\x20segment\x20\x27','segmentFolderId','Activation','add','ACTIVATION_SYNTAX_ERROR','item','1771866eXIfjY','steps','__pending_','yamlConfig','Delete\x20journey:','keys','delete','\x20\x20Activations:','versionNumber','Failed\x20to\x20','segment\x20or\x20journey','Fetching\x20existing\x20activations...','action','create','entryCriteria','existingActivation','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','hasChanges',')\x20with\x20ID:\x20','updateSegmentById','createJourneySegment','Fetching\x20existing\x20journeys...','\x20changed','draft','folder','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','updated','journeys','activation_','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','cwd','has','join','\x0a\x20\x20','/app/ps/','112JQTOEr','max','replace','journeyStages','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20changes?','946354GISOUC','✔\x20Created\x20folder\x20\x27','Source\x20directory:\x20','red','getJourney','\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segment','\x27\x20with\x20ID:\x20','yamlActivation','journeysOnly','folderPath','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x20\x20Activations:\x20','getParent','toLowerCase','blue','green','parentFolderId','\x27\x20(internal:\x20','Updating\x20segment\x20\x27','journeyId','description','parse','Fetching\x20existing\x20segments...','set','Journey\x20\x27','Push\x20','ACTIVATION_UPDATE_ERROR','\x20to\x20delete','buildIdToNameMap','Stage\x20\x27','getActivation','message','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','config','INTERNAL','activationParams','resolve','\x20\x20📊\x20Segments:','repeat','Creating\x20activation\x20\x27','\x27:\x20','relationships','isDirectory','getSegment','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','entry','\x27\x20details...','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','SEGMENT_NOT_FOUND','\x27...','resolveParentId','__pending_act_','Changes\x20to\x20journey:','map','\x20\x20Segments:\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','✔\x20Updated\x20journey\x20\x27','setPhase','segment:push','NOT_FOUND','startsWith','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','172795FcjKut','Fetching\x20journey\x20\x27','then','type','toString','Deleting\x20segment\x20\x27','folderId','✔\x20Updated\x20segment\x20\x27','branches','Entry\x20criteria:\x20','\x20activation\x20\x27','dirname','Segment\x20not\x20found:\x20','existingJourney','parentSegmentFolder','Folders\x20to\x20create:','...','yellow','\x20YAML\x20files\x20found'];a36_0xa6c3=function(){return _0x444640;};return a36_0xa6c3();}import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX=a36_0x23a37f(0x251);function createPendingSegmentId(_0xa04785){return''+PENDING_SEGMENT_PREFIX+_0xa04785+'__';}function isPendingSegmentId(_0x42b554){const _0x40336b=a36_0x23a37f;return _0x42b554[_0x40336b(0x1be)](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x560c1f){return _0x560c1f['replace'](/^__pending_(.+)__$/,'$1');}const PENDING_ACTIVATION_PREFIX=a36_0x23a37f(0x1b5);function createPendingActivationId(_0x4bd6e6){return''+PENDING_ACTIVATION_PREFIX+_0x4bd6e6+'__';}function isPendingActivationId(_0x3e2dce){const _0x53c64f=a36_0x23a37f;return _0x3e2dce[_0x53c64f(0x1be)](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x560228){const _0x36ff53=a36_0x23a37f;return _0x560228[_0x36ff53(0x274)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0xbb909a){const _0x32f2b1=a36_0x23a37f;!_0xbb909a[_0x32f2b1(0x28e)]&&(_0xbb909a['description']=''),!_0xbb909a['state']&&(_0xbb909a[_0x32f2b1(0x243)]=_0x32f2b1(0x266));}function tryFindTdxConfig(_0x13b08f){try{return findTdxConfig(_0x13b08f);}catch{return null;}}function resolveTDFolderPath(_0x5b6e96,_0x370dfc,_0x44516b){if(!_0x370dfc)return _0x5b6e96;return _0x5b6e96?_0x44516b+'/'+_0x5b6e96:_0x44516b;}export class SegmentPushCommand extends BaseCommand{[a36_0x23a37f(0x22d)]=a36_0x23a37f(0x1bc);[a36_0x23a37f(0x28e)]=a36_0x23a37f(0x1fc);async[a36_0x23a37f(0x241)](_0x17ecfc){const _0x4cc7ef=a36_0x23a37f,{options:_0x16b71b,args:_0x5a3a35,tdx:_0x464609}=_0x17ecfc,_0x2cc35f=_0x16b71b,_0x1464ed=_0x16b71b[_0x4cc7ef(0x213)],_0x5deae0=_0x5a3a35[0x0];let _0x27d9b8,_0xbb9df9,_0x3401f2,_0x293aae;if(_0x5deae0){if(existsSync(_0x5deae0)&&statSync(_0x5deae0)[_0x4cc7ef(0x2a4)]()){const _0x577055=tryFindTdxConfig(_0x5deae0);if(_0x577055)_0x27d9b8=_0x577055[_0x4cc7ef(0x29b)][_0x4cc7ef(0x21e)],_0xbb9df9=_0x5deae0,_0x3401f2=_0x577055[_0x4cc7ef(0x22b)];else return console[_0x4cc7ef(0x239)](a36_0x55958f['red'](_0x4cc7ef(0x284)+_0x5deae0+'\x0a')),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1e2)](_0x4cc7ef(0x27e))),0x1;}else{if(existsSync(_0x5deae0)&&statSync(_0x5deae0)['isFile']()){const _0x267aee=a36_0x327b7c[_0x4cc7ef(0x1cb)](_0x5deae0),_0x5370f2=tryFindTdxConfig(_0x267aee);if(_0x5370f2)_0x27d9b8=_0x5370f2['config'][_0x4cc7ef(0x21e)],_0x3401f2=_0x5370f2['configDir'],_0xbb9df9=_0x5370f2[_0x4cc7ef(0x22b)],_0x293aae=a36_0x327b7c[_0x4cc7ef(0x29e)](_0x5deae0);else return console['error'](a36_0x55958f[_0x4cc7ef(0x27b)](_0x4cc7ef(0x284)+_0x267aee+'\x0a')),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1e2)](_0x4cc7ef(0x27e))),0x1;}else _0x27d9b8=_0x5deae0;}}else{const _0x2427f9=tryFindTdxConfig(process[_0x4cc7ef(0x26d)]());_0x2427f9?(_0x27d9b8=_0x2427f9[_0x4cc7ef(0x29b)][_0x4cc7ef(0x21e)],_0xbb9df9=process[_0x4cc7ef(0x26d)](),_0x3401f2=_0x2427f9[_0x4cc7ef(0x22b)]):_0x27d9b8=_0x1464ed;}if(!_0x27d9b8)return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1d1)](_0x4cc7ef(0x268))),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x4cc7ef(0x239)](_0x4cc7ef(0x276)),console[_0x4cc7ef(0x239)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file'),0x1;const _0x46bd24=_0xbb9df9||getSegmentRootDir(sanitizeFileName(_0x27d9b8)),_0x4c4025=_0x3401f2||_0x46bd24,_0x112337=a36_0x327b7c[_0x4cc7ef(0x224)](_0x4c4025,_0x46bd24),_0x4fe784=_0x112337!==''&&_0x112337!=='.';if(!existsSync(_0x46bd24))return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)]('Error:\x20Directory\x20not\x20found:\x20'+_0x46bd24+'\x0a')),console['error'](a36_0x55958f[_0x4cc7ef(0x1e2)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x2cc35f[_0x4cc7ef(0x206)]&&(console[_0x4cc7ef(0x239)]('Site:\x20'+_0x2cc35f['site']),console[_0x4cc7ef(0x239)]('Parent\x20segment:\x20'+_0x27d9b8),console[_0x4cc7ef(0x239)](_0x4cc7ef(0x27a)+_0x46bd24),_0x4fe784&&console[_0x4cc7ef(0x239)](_0x4cc7ef(0x1ee)+_0x112337));const _0xb4fbaa=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x27d9b8+_0x4cc7ef(0x1b3),()=>_0x464609[_0x4cc7ef(0x27f)][_0x4cc7ef(0x1b4)](_0x27d9b8),{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]}),_0xf2a83c=_0xb4fbaa[_0x4cc7ef(0x242)],[_0x3fa212,_0xcb5a3d,_0x5890c6,_0x1511be,_0x5a05f0]=await Promise[_0x4cc7ef(0x1e8)]([withSpinner(_0x4cc7ef(0x1ec),()=>_0x464609['segment'][_0x4cc7ef(0x286)](_0xf2a83c),{'verbose':_0x2cc35f['verbose']}),withSpinner(_0x4cc7ef(0x290),()=>_0x464609['segment']['listSegments'](_0xf2a83c),{'verbose':_0x2cc35f['verbose']}),withSpinner(_0x4cc7ef(0x234),()=>_0x464609[_0x4cc7ef(0x27f)][_0x4cc7ef(0x228)](_0xf2a83c),{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]}),withSpinner(_0x4cc7ef(0x264),()=>_0x464609[_0x4cc7ef(0x21b)]['listJourneysFromParentSegment'](_0xf2a83c),{'verbose':_0x2cc35f['verbose']}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x464609[_0x4cc7ef(0x22f)][_0x4cc7ef(0x20a)](),{'verbose':_0x2cc35f['verbose']})[_0x4cc7ef(0x1c2)](_0x246261=>_0x246261[_0x4cc7ef(0x242)])]),_0xf8df0b=_0x3fa212[_0x4cc7ef(0x242)],_0x44a1b7=_0xf8df0b[_0x4cc7ef(0x2a3)]?.[_0x4cc7ef(0x1ce)]?.[_0x4cc7ef(0x242)]?.['id']||_0xf8df0b[_0x4cc7ef(0x2a3)]?.[_0x4cc7ef(0x22e)]?.['data']?.['id'],_0x40a69b=_0xcb5a3d[_0x4cc7ef(0x242)],_0x5b1ddf=_0x5890c6['data'],_0x56fb9b=_0x1511be[_0x4cc7ef(0x242)],{emailToId:_0x539eff,idToEmail:_0x5cfa1c}=_0x5a05f0,[_0x26400c,_0x1e87e0]=await withSpinner(_0x4cc7ef(0x211),async()=>{const _0x528c88=_0x4cc7ef,[_0x3b1f0f,_0x439563]=await Promise['all']([_0x464609[_0x528c88(0x237)]['buildNameToIdMap'](),_0x464609[_0x528c88(0x237)][_0x528c88(0x296)]()]);return[_0x3b1f0f,_0x439563];},{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]})[_0x4cc7ef(0x1c2)](_0x15e217=>_0x15e217[_0x4cc7ef(0x242)]),_0xa5bdaa=buildFolderPathToIdMap(_0x5b1ddf),_0x3eff8d=new Map();for(const [_0x4cd1b2,_0x3fc50a]of _0xa5bdaa[_0x4cc7ef(0x248)]()){_0x3eff8d[_0x4cc7ef(0x291)](_0x3fc50a,_0x4cd1b2);}const _0x2b55f7=new Map();for(const _0x45f802 of _0x40a69b){const _0x56c7ec=_0x45f802[_0x4cc7ef(0x24a)]?_0x3eff8d[_0x4cc7ef(0x1f4)](_0x45f802[_0x4cc7ef(0x24a)][_0x4cc7ef(0x1c4)]())||'':'',_0x46a9c9=_0x56c7ec+':'+_0x45f802['name'];_0x2b55f7[_0x4cc7ef(0x291)](_0x46a9c9,_0x45f802);}const _0x3a6dd9=new Map();for(const _0x11e544 of _0x40a69b){_0x3a6dd9[_0x4cc7ef(0x291)](_0x11e544[_0x4cc7ef(0x22d)],_0x11e544['id']);}const _0x3408da=new Map();for(const _0x1024af of _0x56fb9b){const _0x5af5f7=_0x1024af[_0x4cc7ef(0x1c6)]?_0x3eff8d[_0x4cc7ef(0x1f4)](_0x1024af[_0x4cc7ef(0x1c6)])||'':'',_0x4708b5=_0x5af5f7+':'+_0x1024af[_0x4cc7ef(0x221)];!_0x3408da[_0x4cc7ef(0x26e)](_0x4708b5)&&_0x3408da[_0x4cc7ef(0x291)](_0x4708b5,[]),_0x3408da[_0x4cc7ef(0x1f4)](_0x4708b5)[_0x4cc7ef(0x23a)](_0x1024af);}for(const _0x5931c0 of _0x3408da['values']()){_0x5931c0[_0x4cc7ef(0x205)]((_0x4c8701,_0x102925)=>(_0x4c8701[_0x4cc7ef(0x257)]||0x0)-(_0x102925['versionNumber']||0x0));}let _0x2cec18;if(_0x293aae){if(!_0x293aae[_0x4cc7ef(0x1e5)](_0x4cc7ef(0x1fe))&&!_0x293aae[_0x4cc7ef(0x1e5)](_0x4cc7ef(0x240)))return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)](_0x4cc7ef(0x231)+_0x293aae+'\x0a')),0x1;_0x2cec18=[_0x293aae];}else _0x2cec18=findYamlFiles(_0x46bd24);if(_0x2cec18[_0x4cc7ef(0x20f)]===0x0)return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x46bd24+'\x0a')),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1e2)](_0x4cc7ef(0x1bf))),0x1;const _0xf9bf17=[],_0x4bfb65=[];for(const _0x421be7 of _0x2cec18){const _0x52b655=a36_0x327b7c[_0x4cc7ef(0x224)](_0x46bd24,a36_0x327b7c[_0x4cc7ef(0x1cb)](_0x421be7)),_0x445d0f=_0x52b655==='.'?'':_0x52b655,_0x3428e8=readFileSync(_0x421be7,_0x4cc7ef(0x229));try{const _0x2a0c59=a36_0x54d85f[_0x4cc7ef(0x28f)](_0x3428e8);if(isJourneyYaml(_0x2a0c59)){const _0x3d2d7a=a36_0x4aa7d6(_0x3428e8);_0x4bfb65[_0x4cc7ef(0x23a)]({'yamlConfig':_0x3d2d7a,'folderPath':_0x445d0f,'sourcePath':_0x421be7});}else{if(!_0x2cc35f[_0x4cc7ef(0x282)]){const _0x4c26c8=parseSegmentYamlFile(_0x3428e8),_0x513bbb=normalizeChildSegmentYaml(_0x4c26c8);_0xf9bf17[_0x4cc7ef(0x23a)]({'yamlConfig':_0x513bbb,'folderPath':_0x445d0f,'sourcePath':_0x421be7});}}}catch(_0x1e7806){return console[_0x4cc7ef(0x239)](a36_0x55958f['red']('Error\x20parsing\x20'+_0x421be7+':\x20'+(_0x1e7806 instanceof Error?_0x1e7806[_0x4cc7ef(0x299)]:_0x1e7806))),0x1;}}if(_0xf9bf17[_0x4cc7ef(0x20f)]===0x0&&_0x4bfb65[_0x4cc7ef(0x20f)]===0x0){const _0x4e0354=_0x2cc35f[_0x4cc7ef(0x282)]?_0x4cc7ef(0x21b):_0x4cc7ef(0x259);return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1d1)]('No\x20'+_0x4e0354+_0x4cc7ef(0x1d2))),0x0;}const _0x4a94c1=new Map();_0x40a69b[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f[_0x4cc7ef(0x282)]&&await withSpinner(_0x4cc7ef(0x25a),async()=>{await batchAsync(_0x40a69b,async _0x1966de=>{const _0x49185b=a36_0x1d1c,_0x41da04=await _0x464609['segment']['listActivations'](_0xf2a83c,_0x1966de['id']);_0x4a94c1[_0x49185b(0x291)](_0x1966de['id'],_0x41da04);});},{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]});const _0x469f95=[],_0xa9ccc7=new Set();for(const {yamlConfig:_0x93230,folderPath:_0x2d8df2,sourcePath:_0x6fc482}of _0xf9bf17){const _0xe1bd7d=resolveTDFolderPath(_0x2d8df2,_0x4fe784,_0x112337),_0x2bf690=_0xe1bd7d+':'+_0x93230[_0x4cc7ef(0x22d)],_0x44c556=_0x2b55f7[_0x4cc7ef(0x1f4)](_0x2bf690),_0x17ea6f=_0x44c556?_0x4a94c1['get'](_0x44c556['id'])||[]:[];if(_0xe1bd7d&&!_0xa5bdaa[_0x4cc7ef(0x26e)](_0xe1bd7d)){const _0x55ccd9=_0xe1bd7d[_0x4cc7ef(0x1e3)]('/');let _0x49b88e='';for(const _0x1e2fad of _0x55ccd9){_0x49b88e=_0x49b88e?_0x49b88e+'/'+_0x1e2fad:_0x1e2fad,!_0xa5bdaa[_0x4cc7ef(0x26e)](_0x49b88e)&&_0xa9ccc7[_0x4cc7ef(0x24c)](_0x49b88e);}}const _0x19a34e=calculateActivationActions(_0x93230[_0x4cc7ef(0x1f0)]||[],_0x17ea6f,_0x5cfa1c,_0x1e87e0),_0x15f992=segmentToYamlString(_0x93230);let _0x562b67,_0x2cc774=![],_0x8681ca;if(_0x44c556){const _0x7778c8=segmentWithActivationsToYaml(_0x44c556,_0x17ea6f,undefined,_0x5cfa1c,_0x1e87e0),_0x24cd82=segmentToYamlString(_0x7778c8);_0x562b67=generateDiff(_0x24cd82,_0x15f992),_0x2cc774=hasChanges(_0x562b67),_0x2cc774&&(_0x8681ca=formatDiffWithColors(_0x562b67));}else _0x562b67=generateDiff('',_0x15f992),_0x8681ca=formatDiffWithColors(_0x562b67);_0x469f95[_0x4cc7ef(0x23a)]({'relativePath':_0x93230[_0x4cc7ef(0x22d)],'absolutePath':_0x6fc482,'yamlConfig':_0x93230,'folderPath':_0xe1bd7d,'existingSegment':_0x44c556,'existingActivations':_0x17ea6f,'isNew':!_0x44c556,'hasChanges':_0x2cc774,'diff':_0x8681ca,'activationActions':_0x19a34e});}let _0x58b14b=[];if(!_0x293aae){const _0x575d3a=new Set();for(const {yamlConfig:_0x226121,folderPath:_0xe67faa}of _0xf9bf17){const _0x4d21b3=resolveTDFolderPath(_0xe67faa,_0x4fe784,_0x112337);_0x575d3a[_0x4cc7ef(0x24c)](_0x4d21b3+':'+_0x226121[_0x4cc7ef(0x22d)]);}_0x58b14b=_0x40a69b[_0x4cc7ef(0x245)](_0x188e8b=>{const _0x507241=_0x4cc7ef,_0x57c240=_0x188e8b[_0x507241(0x24a)]?_0x3eff8d[_0x507241(0x1f4)](_0x188e8b[_0x507241(0x24a)][_0x507241(0x1c4)]())||'':'',_0x22c5f8=_0x57c240+':'+_0x188e8b[_0x507241(0x22d)];if(_0x575d3a[_0x507241(0x26e)](_0x22c5f8))return![];if(_0x4fe784)return _0x57c240===_0x112337||_0x57c240[_0x507241(0x1be)](_0x112337+'/');return!![];});}const _0x53c9e6=[];for(const {yamlConfig:_0x265615,folderPath:_0x56c1f4,sourcePath:_0xc2bb0e}of _0x4bfb65){const _0x4a9acd=resolveTDFolderPath(_0x56c1f4,_0x4fe784,_0x112337),_0x4185d1=_0x4a9acd+':'+_0x265615[_0x4cc7ef(0x22d)],_0x1058c5=_0x3408da[_0x4cc7ef(0x1f4)](_0x4185d1);let _0x28868f,_0x2788ea;if(_0x1058c5&&_0x1058c5['length']>0x0){const _0x222344=new Set(),_0x35932e=new Set(),_0x5dd02e=new Map(),_0x4b44df=new Map(),_0x39f65c=createJumpTargetCache(),_0x388e60=_0x2463d6=>({'resolveSegment':async _0x1ead67=>{const _0x104593=_0x4cc7ef,_0x512532=_0x4b44df[_0x104593(0x1f4)](_0x1ead67);if(_0x512532!==undefined)return{'name':_0x512532,'isJourneyLocal':!![]};try{let _0x6ad625=_0x40a69b[_0x104593(0x1f3)](_0x1ed518=>_0x1ed518['id']===_0x1ead67);!_0x6ad625&&(_0x6ad625=await _0x464609['segment'][_0x104593(0x2a5)](_0xf2a83c,_0x1ead67));const _0x2382a2=generateJourneyLocalName(_0x6ad625[_0x104593(0x22d)]),_0x340f73=_0x6ad625[_0x104593(0x202)]===SEGMENT_KIND_JOURNEY&&_0x2382a2!==undefined;let _0x122a64=_0x6ad625['name'];if(_0x340f73&&_0x2382a2){let _0x253f3e=_0x2382a2,_0x11fca1=0x2;while(_0x222344['has'](_0x253f3e)){_0x253f3e=_0x2382a2+'_'+_0x11fca1,_0x11fca1++;}_0x222344[_0x104593(0x24c)](_0x253f3e),_0x122a64=_0x253f3e,_0x4b44df[_0x104593(0x291)](_0x1ead67,_0x122a64);}let _0x86ec41;return _0x340f73&&_0x6ad625['rule']&&(_0x86ec41={'description':_0x6ad625['description'],'rule':apiRuleToYaml(_0x6ad625[_0x104593(0x20e)])}),{'name':_0x122a64,'isJourneyLocal':_0x340f73,'definition':_0x86ec41};}catch{return{'name':_0x1ead67,'isJourneyLocal':![]};}},'resolveActivation':async _0x4e5750=>{const _0x572af5=_0x4cc7ef,_0x5c2d26=_0x5dd02e[_0x572af5(0x1f4)](_0x4e5750);if(_0x5c2d26!==undefined)return{'name':_0x5c2d26,'isJourneyLocal':!![]};try{const _0x48baac=await _0x464609[_0x572af5(0x21b)][_0x572af5(0x298)](_0x2463d6,_0x4e5750),_0x545693=_0x48baac[_0x572af5(0x1e7)][_0x572af5(0x29d)]['name']||_0x4e5750,_0x590602=sanitizeYamlKey(_0x545693)||_0x572af5(0x26b)+_0x4e5750;let _0x49adbb=_0x590602,_0x76a130=0x2;while(_0x35932e['has'](_0x49adbb)){_0x49adbb=_0x590602+'_'+_0x76a130,_0x76a130++;}_0x35932e[_0x572af5(0x24c)](_0x49adbb),_0x5dd02e[_0x572af5(0x291)](_0x4e5750,_0x49adbb);const _0x1d7043=journeyActivationStepToYaml(_0x48baac,_0x5cfa1c,_0x1e87e0);return{'name':_0x49adbb,'isJourneyLocal':!![],'definition':_0x1d7043};}catch{return{'name':_0x4e5750,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x231671,_0x3b2bcc)=>resolveJumpTarget(_0x231671,_0x3b2bcc,_0x39f65c,_0x4ebb59=>_0x464609['journey']['getJourney'](_0x4ebb59))}),_0x31195e=hasMultipleVersions(_0x265615);if(_0x31195e&&_0x1058c5[_0x4cc7ef(0x20f)]>0x1){const _0x121cf4=[];for(const _0x5c32a6 of _0x1058c5){const _0x376f36=await withSpinner('Fetching\x20journey\x20\x27'+_0x265615[_0x4cc7ef(0x22d)]+_0x4cc7ef(0x233)+(_0x5c32a6[_0x4cc7ef(0x257)]||0x1)+_0x4cc7ef(0x1d0),()=>_0x464609['journey'][_0x4cc7ef(0x27c)](_0x5c32a6['id']),{'verbose':_0x2cc35f['verbose']}),_0x2ff7b7=_0x388e60(_0x5c32a6['id']),_0x3a59cf=await apiToYamlAsync(_0x376f36[_0x4cc7ef(0x242)],_0x2ff7b7);_0x121cf4[_0x4cc7ef(0x23a)]({'item':_0x5c32a6,'yaml':_0x3a59cf});}_0x2788ea=buildMergedJourneyYaml(_0x121cf4);const _0x567a4d=Math[_0x4cc7ef(0x273)](..._0x121cf4[_0x4cc7ef(0x1b7)](_0x363012=>_0x363012[_0x4cc7ef(0x24e)][_0x4cc7ef(0x257)]||0x0)),_0x17634f=_0x1058c5[_0x4cc7ef(0x1f3)](_0x4bdbc2=>(_0x4bdbc2['versionNumber']||0x0)===_0x567a4d);_0x17634f&&(_0x28868f=await _0x464609[_0x4cc7ef(0x21b)]['getJourney'](_0x17634f['id']));}else{const _0xfc99b0=_0x1058c5[_0x1058c5['length']-0x1],_0x551a92=await withSpinner(_0x4cc7ef(0x1c1)+_0x265615[_0x4cc7ef(0x22d)]+_0x4cc7ef(0x2a8),()=>_0x464609[_0x4cc7ef(0x21b)]['getJourney'](_0xfc99b0['id']),{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]});_0x28868f=_0x551a92['data'];const _0x4f4721=_0x388e60(_0xfc99b0['id']);_0x2788ea=await apiToYamlAsync(_0x28868f,_0x4f4721);}}if(_0x4a9acd&&!_0xa5bdaa[_0x4cc7ef(0x26e)](_0x4a9acd)){const _0x2383bf=_0x4a9acd['split']('/');let _0x1d3390='';for(const _0x49ba15 of _0x2383bf){_0x1d3390=_0x1d3390?_0x1d3390+'/'+_0x49ba15:_0x49ba15,!_0xa5bdaa['has'](_0x1d3390)&&_0xa9ccc7['add'](_0x1d3390);}}const _0x33d534=normalizeJourneyYaml(_0x265615),_0x5f51ec=a36_0xdc6651(_0x33d534);let _0x3e03fe=![],_0x52e7e7;if(_0x2788ea){const _0x211470=normalizeJourneyYaml(_0x2788ea),_0x53eea6=a36_0xdc6651(_0x211470),_0x514569=generateDiff(_0x53eea6,_0x5f51ec);_0x3e03fe=hasChanges(_0x514569),_0x3e03fe&&(_0x52e7e7=formatDiffWithColors(_0x514569));}else{const _0x53d360=generateDiff('',_0x5f51ec);_0x52e7e7=formatDiffWithColors(_0x53d360);}_0x53c9e6[_0x4cc7ef(0x23a)]({'relativePath':_0x265615['name'],'absolutePath':_0xc2bb0e,'yamlConfig':_0x265615,'folderPath':_0x4a9acd,'existingJourney':_0x28868f,'isNew':!_0x28868f,'hasChanges':_0x3e03fe,'diff':_0x52e7e7});}let _0x5c20c9=[];if(!_0x293aae){const _0x16b3e2=new Set();for(const {yamlConfig:_0x1118e5,folderPath:_0x380ef4}of _0x4bfb65){const _0x3e0936=resolveTDFolderPath(_0x380ef4,_0x4fe784,_0x112337);_0x16b3e2[_0x4cc7ef(0x24c)](_0x3e0936+':'+_0x1118e5['name']);}_0x5c20c9=_0x56fb9b[_0x4cc7ef(0x245)](_0x336350=>{const _0x3b78c6=_0x4cc7ef,_0x24671d=_0x336350[_0x3b78c6(0x1c6)]?_0x3eff8d['get'](_0x336350[_0x3b78c6(0x1c6)])||'':'',_0x1d737d=_0x24671d+':'+_0x336350[_0x3b78c6(0x221)];if(_0x16b3e2[_0x3b78c6(0x26e)](_0x1d737d))return![];if(_0x4fe784)return _0x24671d===_0x112337||_0x24671d[_0x3b78c6(0x1be)](_0x112337+'/');return!![];});}const _0x23e01f=_0x469f95[_0x4cc7ef(0x245)](_0x115b1a=>_0x115b1a[_0x4cc7ef(0x244)]),_0xee1891=_0x469f95['filter'](_0x3264ef=>!_0x3264ef[_0x4cc7ef(0x244)]&&_0x3264ef[_0x4cc7ef(0x260)]),_0x1b244c=_0x469f95[_0x4cc7ef(0x245)](_0x9a0cff=>!_0x9a0cff[_0x4cc7ef(0x244)]&&!_0x9a0cff[_0x4cc7ef(0x260)]),_0xad6d47=Array[_0x4cc7ef(0x1e0)](_0xa9ccc7)['sort'](),_0x40fa0c=_0x2cc35f['delete']?_0x58b14b:[],_0x48d9a3=_0x2cc35f[_0x4cc7ef(0x255)]?_0x5c20c9:[],_0xd427e6=_0x469f95['flatMap'](_0x49e7f3=>_0x49e7f3[_0x4cc7ef(0x227)]),_0x36b24c=_0xd427e6[_0x4cc7ef(0x245)](_0x5e796d=>_0x5e796d[_0x4cc7ef(0x1c3)]===_0x4cc7ef(0x25c)),_0x5e245b=_0xd427e6[_0x4cc7ef(0x245)](_0x1347c4=>_0x1347c4[_0x4cc7ef(0x1c3)]===_0x4cc7ef(0x225)),_0x58ddbd=_0xd427e6[_0x4cc7ef(0x245)](_0x339c7a=>_0x339c7a['type']===_0x4cc7ef(0x255)),_0x5581a4=_0x53c9e6[_0x4cc7ef(0x245)](_0x3bf34b=>_0x3bf34b[_0x4cc7ef(0x244)]),_0x1b33d5=_0x53c9e6[_0x4cc7ef(0x245)](_0x239fe9=>!_0x239fe9['isNew']&&_0x239fe9['hasChanges']),_0x3c1e93=_0x53c9e6[_0x4cc7ef(0x245)](_0x11ef23=>!_0x11ef23['isNew']&&!_0x11ef23[_0x4cc7ef(0x260)]);console[_0x4cc7ef(0x239)]('\x0aPush\x20summary\x20for\x20\x27'+_0x27d9b8+'\x27:');_0xad6d47['length']>0x0&&console[_0x4cc7ef(0x239)]('\x20\x20'+a36_0x55958f[_0x4cc7ef(0x288)](_0x4cc7ef(0x21c)+_0xad6d47[_0x4cc7ef(0x20f)]+'\x20folders\x20to\x20create'));if(!_0x2cc35f['journeysOnly']){console[_0x4cc7ef(0x239)](_0x4cc7ef(0x29f)),console['error'](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x289)]('+\x20'+_0x23e01f['length']+_0x4cc7ef(0x1ef))),console[_0x4cc7ef(0x239)](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x1d1)]('~\x20'+_0xee1891[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x265)));if(_0x40fa0c[_0x4cc7ef(0x20f)]>0x0)console['error'](_0x4cc7ef(0x218)+a36_0x55958f['red']('-\x20'+_0x40fa0c[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x295)));else _0x58b14b[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f[_0x4cc7ef(0x255)]&&console[_0x4cc7ef(0x239)](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x214)](_0x58b14b[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x29a)));console['error']('\x20\x20\x20\x20'+a36_0x55958f['dim']('=\x20'+_0x1b244c[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x217)));}if(_0x53c9e6[_0x4cc7ef(0x20f)]>0x0||_0x5c20c9[_0x4cc7ef(0x20f)]>0x0){console[_0x4cc7ef(0x239)](_0x4cc7ef(0x1d4)),console[_0x4cc7ef(0x239)]('\x20\x20\x20\x20'+a36_0x55958f[_0x4cc7ef(0x289)]('+\x20'+_0x5581a4[_0x4cc7ef(0x20f)]+'\x20new')),console[_0x4cc7ef(0x239)]('\x20\x20\x20\x20'+a36_0x55958f[_0x4cc7ef(0x1d1)]('~\x20'+_0x1b33d5[_0x4cc7ef(0x20f)]+'\x20changed'));if(_0x48d9a3[_0x4cc7ef(0x20f)]>0x0)console[_0x4cc7ef(0x239)](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x27b)]('-\x20'+_0x48d9a3[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x295)));else _0x5c20c9[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f[_0x4cc7ef(0x255)]&&console[_0x4cc7ef(0x239)]('\x20\x20\x20\x20'+a36_0x55958f['dim'](_0x5c20c9[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x29a)));console['error'](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x214)]('=\x20'+_0x3c1e93[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x217)));}_0xd427e6[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f[_0x4cc7ef(0x282)]&&(console[_0x4cc7ef(0x239)](''),console[_0x4cc7ef(0x239)](_0x4cc7ef(0x256)),_0x36b24c[_0x4cc7ef(0x20f)]>0x0&&console[_0x4cc7ef(0x239)](_0x4cc7ef(0x218)+a36_0x55958f[_0x4cc7ef(0x289)]('+\x20'+_0x36b24c['length']+'\x20to\x20create')),_0x5e245b[_0x4cc7ef(0x20f)]>0x0&&console[_0x4cc7ef(0x239)]('\x20\x20\x20\x20'+a36_0x55958f[_0x4cc7ef(0x1d1)]('~\x20'+_0x5e245b[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x20b))),_0x58ddbd[_0x4cc7ef(0x20f)]>0x0&&console['error']('\x20\x20\x20\x20'+a36_0x55958f[_0x4cc7ef(0x27b)]('-\x20'+_0x58ddbd['length']+'\x20to\x20delete')));console[_0x4cc7ef(0x239)](_0x4cc7ef(0x232)+a36_0x55958f[_0x4cc7ef(0x1e2)](_0x46bd24)+'\x0a');if(_0xad6d47['length']>0x0){console[_0x4cc7ef(0x239)](_0x4cc7ef(0x1cf));for(const _0xd33463 of _0xad6d47){console[_0x4cc7ef(0x239)]('\x20\x20'+a36_0x55958f['blue']('+')+'\x20'+_0xd33463);}console['error']('');}if(_0x23e01f[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f['journeysOnly'])for(const _0x2dd00d of _0x23e01f){const _0xfc540f=_0x2dd00d[_0x4cc7ef(0x283)]?_0x2dd00d[_0x4cc7ef(0x283)]+'/'+_0x2dd00d[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]:_0x2dd00d[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)],_0x1825fd=_0x2dd00d[_0x4cc7ef(0x252)][_0x4cc7ef(0x1f0)]?.[_0x4cc7ef(0x20f)]||0x0,_0xa271fc=_0x1825fd>0x0?a36_0x55958f[_0x4cc7ef(0x214)]('\x20['+_0x1825fd+_0x4cc7ef(0x1db)):'';console[_0x4cc7ef(0x239)]('\x0a'+a36_0x55958f[_0x4cc7ef(0x289)](_0x4cc7ef(0x216))+'\x20'+_0xfc540f+_0xa271fc),console['error']('─'[_0x4cc7ef(0x2a0)](0x3c)),_0x2dd00d[_0x4cc7ef(0x1ea)]&&console[_0x4cc7ef(0x239)](_0x2dd00d[_0x4cc7ef(0x1ea)]),console[_0x4cc7ef(0x239)]('─'[_0x4cc7ef(0x2a0)](0x3c));}if(_0x40fa0c[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f['journeysOnly'])for(const _0x928f7e of _0x40fa0c){const _0x11c02f=_0x928f7e[_0x4cc7ef(0x24a)]?_0x3eff8d[_0x4cc7ef(0x1f4)](_0x928f7e['segmentFolderId'][_0x4cc7ef(0x1c4)]())||'':'',_0x1778ac=_0x11c02f?_0x11c02f+'/'+_0x928f7e[_0x4cc7ef(0x22d)]:_0x928f7e[_0x4cc7ef(0x22d)],_0x4cf127=_0x4a94c1[_0x4cc7ef(0x1f4)](_0x928f7e['id'])||[],_0x5aea84=_0x4cf127['length']>0x0?a36_0x55958f[_0x4cc7ef(0x214)]('\x20['+_0x4cf127[_0x4cc7ef(0x20f)]+_0x4cc7ef(0x1db)):'';console[_0x4cc7ef(0x239)]('\x0a'+a36_0x55958f['red'](_0x4cc7ef(0x238))+'\x20'+_0x1778ac+_0x5aea84),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c));const _0xd937fb=segmentWithActivationsToYaml(_0x928f7e,_0x4cf127,undefined,_0x5cfa1c,_0x1e87e0),_0x2eeb78=segmentToYamlString(_0xd937fb),_0x4f08bf=generateDiff(_0x2eeb78,'');console[_0x4cc7ef(0x239)](formatDiffWithColors(_0x4f08bf)),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c));}const _0x392ce1=_0x469f95[_0x4cc7ef(0x245)](_0x2df194=>!_0x2df194[_0x4cc7ef(0x244)]&&_0x2df194[_0x4cc7ef(0x1ea)]);if(_0x392ce1[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f[_0x4cc7ef(0x282)])for(const _0x1095a0 of _0x392ce1){const _0x348528=_0x1095a0[_0x4cc7ef(0x283)]?_0x1095a0[_0x4cc7ef(0x283)]+'/'+_0x1095a0[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]:_0x1095a0[_0x4cc7ef(0x252)]['name'];console[_0x4cc7ef(0x239)]('\x0a'+a36_0x55958f[_0x4cc7ef(0x1d1)]('Changes\x20to:')+'\x20'+_0x348528),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c)),console[_0x4cc7ef(0x239)](_0x1095a0[_0x4cc7ef(0x1ea)]),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c));}if(_0x5581a4[_0x4cc7ef(0x20f)]>0x0)for(const _0x135ece of _0x5581a4){const _0x57d71a=_0x135ece[_0x4cc7ef(0x283)]?_0x135ece[_0x4cc7ef(0x283)]+'/'+_0x135ece[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]:_0x135ece[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)];console[_0x4cc7ef(0x239)]('\x0a'+a36_0x55958f['green']('New\x20journey:')+'\x20'+_0x57d71a),console['error']('─'['repeat'](0x3c)),_0x135ece[_0x4cc7ef(0x1ea)]&&console[_0x4cc7ef(0x239)](_0x135ece[_0x4cc7ef(0x1ea)]),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c));}const _0x2dabab=_0x53c9e6[_0x4cc7ef(0x245)](_0x1a501f=>!_0x1a501f[_0x4cc7ef(0x244)]&&_0x1a501f['diff']);if(_0x2dabab['length']>0x0)for(const _0x256081 of _0x2dabab){const _0xbc418a=_0x256081[_0x4cc7ef(0x283)]?_0x256081['folderPath']+'/'+_0x256081[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]:_0x256081['yamlConfig'][_0x4cc7ef(0x22d)];console['error']('\x0a'+a36_0x55958f['yellow'](_0x4cc7ef(0x1b6))+'\x20'+_0xbc418a),console[_0x4cc7ef(0x239)]('─'['repeat'](0x3c)),console['error'](_0x256081[_0x4cc7ef(0x1ea)]),console[_0x4cc7ef(0x239)]('─'[_0x4cc7ef(0x2a0)](0x3c));}if(_0x48d9a3[_0x4cc7ef(0x20f)]>0x0)for(const _0xb58f5 of _0x48d9a3){const _0x5bfece=_0xb58f5['folderId']?_0x3eff8d[_0x4cc7ef(0x1f4)](_0xb58f5['folderId'])||'':'',_0x33f49a=_0x5bfece?_0x5bfece+'/'+_0xb58f5[_0x4cc7ef(0x221)]:_0xb58f5[_0x4cc7ef(0x221)];console[_0x4cc7ef(0x239)]('\x0a'+a36_0x55958f['red'](_0x4cc7ef(0x253))+'\x20'+_0x33f49a),console[_0x4cc7ef(0x239)]('─'[_0x4cc7ef(0x2a0)](0x3c)),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)]('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x4cc7ef(0x2a0)](0x3c));}if(_0x2cc35f[_0x4cc7ef(0x1f6)])return console['error'](a36_0x55958f[_0x4cc7ef(0x1d1)](_0x4cc7ef(0x2a6))),0x0;const _0x2d4583=_0x2cc35f[_0x4cc7ef(0x282)]?![]:_0x23e01f[_0x4cc7ef(0x20f)]>0x0||_0xee1891[_0x4cc7ef(0x20f)]>0x0||_0x40fa0c[_0x4cc7ef(0x20f)]>0x0,_0x289046=_0x5581a4[_0x4cc7ef(0x20f)]>0x0||_0x1b33d5[_0x4cc7ef(0x20f)]>0x0||_0x48d9a3[_0x4cc7ef(0x20f)]>0x0,_0x45ec44=_0x2cc35f['journeysOnly']?![]:_0xd427e6[_0x4cc7ef(0x20f)]>0x0,_0x181ad6=_0xad6d47[_0x4cc7ef(0x20f)]>0x0;if(!_0x2d4583&&!_0x289046&&!_0x45ec44&&!_0x181ad6){const _0x404de5=_0x2cc35f[_0x4cc7ef(0x282)]?_0x4cc7ef(0x25f):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x289)](_0x404de5));if(_0x293aae&&_0x3c1e93[_0x4cc7ef(0x20f)]===0x1){const _0x58485d=_0x3c1e93[0x0];if(_0x58485d[_0x4cc7ef(0x1cd)]?.['id']){const _0x93dd68=getConsoleNextUrl(_0x2cc35f[_0x4cc7ef(0x226)],_0x4cc7ef(0x271)+_0xf2a83c+_0x4cc7ef(0x1f9)+_0x58485d['existingJourney']['id']+'/j/da/je');console['error']('\x20\x20'+a36_0x55958f[_0x4cc7ef(0x1e2)](_0x93dd68));}}return 0x0;}const _0x364e6e=_0x2cc35f[_0x4cc7ef(0x282)]?_0x5581a4[_0x4cc7ef(0x20f)]+_0x1b33d5['length']+_0x48d9a3[_0x4cc7ef(0x20f)]+_0xad6d47[_0x4cc7ef(0x20f)]:_0x23e01f['length']+_0xee1891[_0x4cc7ef(0x20f)]+_0x40fa0c[_0x4cc7ef(0x20f)]+_0x5581a4['length']+_0x1b33d5['length']+_0x48d9a3['length']+_0xad6d47['length']+_0xd427e6[_0x4cc7ef(0x20f)];if(!_0x2cc35f[_0x4cc7ef(0x23c)]&&_0x364e6e>0x0){const _0x26d878=await confirmKey(_0x4cc7ef(0x293)+_0x364e6e+_0x4cc7ef(0x277));if(!_0x26d878)return console['error']('Aborted.'),0x1;}for(const _0x2805b1 of _0xad6d47){const _0x14c7a4=_0x2805b1['split']('/'),_0x42518a=_0x14c7a4[_0x14c7a4[_0x4cc7ef(0x20f)]-0x1],_0x385b79=_0x14c7a4[_0x4cc7ef(0x1fd)](0x0,-0x1)[_0x4cc7ef(0x26f)]('/'),_0x4a44d7=_0xa5bdaa[_0x4cc7ef(0x1f4)](_0x385b79),_0x2cfed2={'name':_0x42518a,'parentFolderId':_0x4a44d7},_0x11065c=await withSpinner(_0x4cc7ef(0x222)+_0x2805b1+_0x4cc7ef(0x1b3),()=>_0x464609['segment'][_0x4cc7ef(0x1f8)](_0xf2a83c,_0x2cfed2),{'verbose':_0x2cc35f['verbose']});_0xa5bdaa[_0x4cc7ef(0x291)](_0x2805b1,_0x11065c['data']['id']),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x288)](_0x4cc7ef(0x279)+_0x2805b1+'\x27'));}let _0x34d0c5=0x0,_0x3f318e=0x0,_0x134af7=0x0,_0x1927a9=0x0,_0x4f9954=0x0,_0x21d8ee=0x0;const _0x1882b4=new Map();for(const _0x555f24 of _0x2cc35f[_0x4cc7ef(0x282)]?[]:_0x469f95){const _0x50a42c=_0x555f24['folderPath']?_0xa5bdaa[_0x4cc7ef(0x1f4)](_0x555f24[_0x4cc7ef(0x283)]):undefined;let _0x1bda2e;try{if(_0x555f24['isNew']){const _0x5531bc=yamlToCreateRequest(_0x555f24[_0x4cc7ef(0x252)],_0x50a42c),_0xdaf103=await withSpinner(_0x4cc7ef(0x22a)+_0x555f24['yamlConfig'][_0x4cc7ef(0x22d)]+_0x4cc7ef(0x1b3),()=>_0x464609['segment'][_0x4cc7ef(0x219)](_0xf2a83c,_0x5531bc),{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]});_0x1bda2e=_0xdaf103[_0x4cc7ef(0x242)]['id'],_0x1882b4[_0x4cc7ef(0x291)](_0x555f24[_0x4cc7ef(0x252)]['name'],_0x1bda2e),console[_0x4cc7ef(0x239)](a36_0x55958f['green']('✔\x20Created\x20segment\x20\x27'+_0x555f24[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]+'\x27')),_0x34d0c5++;}else{if(_0x555f24['hasChanges']){const _0x13c2b2=yamlToUpdateRequest(_0x555f24[_0x4cc7ef(0x252)]);_0x50a42c!==_0x555f24[_0x4cc7ef(0x1e6)]?.[_0x4cc7ef(0x24a)]&&(_0x13c2b2[_0x4cc7ef(0x24a)]=_0x50a42c?parseInt(_0x50a42c,0xa):undefined),await withSpinner(_0x4cc7ef(0x28c)+_0x555f24['yamlConfig'][_0x4cc7ef(0x22d)]+'\x27...',()=>_0x464609['segment'][_0x4cc7ef(0x262)](_0xf2a83c,_0x555f24[_0x4cc7ef(0x1e6)]['id'],_0x13c2b2),{'verbose':_0x2cc35f['verbose']}),_0x1bda2e=_0x555f24[_0x4cc7ef(0x1e6)]['id'],console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1d1)](_0x4cc7ef(0x1c7)+_0x555f24[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]+'\x27')),_0x3f318e++;}else _0x1bda2e=_0x555f24[_0x4cc7ef(0x1e6)]['id'];}}catch(_0x4c0fb4){const _0x50f1d9=isHttp400Error(_0x4c0fb4),_0x149bf8=_0x50f1d9?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x4cc7ef(0x1d8)],_0x4072fa=getErrorMessage(_0x4c0fb4);throw new SDKError(_0x149bf8,_0x4cc7ef(0x258)+(_0x555f24[_0x4cc7ef(0x244)]?_0x4cc7ef(0x25c):'update')+_0x4cc7ef(0x1fa)+_0x555f24[_0x4cc7ef(0x210)]+'\x0a\x20\x20'+_0x4072fa,_0x4c0fb4);}for(const _0x255732 of _0x555f24[_0x4cc7ef(0x227)]){try{if(_0x255732[_0x4cc7ef(0x1c3)]===_0x4cc7ef(0x25c)&&_0x255732[_0x4cc7ef(0x281)]){const _0x4fdfe7=yamlActivationToCreateRequest(_0x255732['yamlActivation'],_0x539eff,_0x26400c);await withSpinner(_0x4cc7ef(0x2a1)+_0x255732[_0x4cc7ef(0x22d)]+_0x4cc7ef(0x1b3),()=>_0x464609[_0x4cc7ef(0x27f)][_0x4cc7ef(0x246)](_0xf2a83c,_0x1bda2e,_0x4fdfe7),{'verbose':_0x2cc35f['verbose']}),console['error'](a36_0x55958f[_0x4cc7ef(0x289)](_0x4cc7ef(0x235)+_0x255732[_0x4cc7ef(0x22d)]+'\x27')),_0x1927a9++;}else{if(_0x255732['type']===_0x4cc7ef(0x225)&&_0x255732[_0x4cc7ef(0x281)]&&_0x255732[_0x4cc7ef(0x25e)]){const _0x325b08=yamlActivationToUpdateRequest(_0x255732[_0x4cc7ef(0x281)],_0x539eff,_0x26400c);await withSpinner(_0x4cc7ef(0x215)+_0x255732['name']+'\x27...',()=>_0x464609[_0x4cc7ef(0x27f)][_0x4cc7ef(0x1f2)](_0xf2a83c,_0x1bda2e,_0x255732[_0x4cc7ef(0x25e)]['id'],_0x325b08),{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]}),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x1d1)]('\x20\x20✔\x20Updated\x20activation\x20\x27'+_0x255732[_0x4cc7ef(0x22d)]+'\x27')),_0x4f9954++;}else _0x255732[_0x4cc7ef(0x1c3)]===_0x4cc7ef(0x255)&&_0x255732[_0x4cc7ef(0x25e)]&&(await withSpinner(_0x4cc7ef(0x1da)+_0x255732['name']+_0x4cc7ef(0x1b3),()=>_0x464609[_0x4cc7ef(0x27f)]['deleteActivation'](_0xf2a83c,_0x1bda2e,_0x255732['existingActivation']['id']),{'verbose':_0x2cc35f['verbose']}),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)]('\x20\x20✔\x20Deleted\x20activation\x20\x27'+_0x255732[_0x4cc7ef(0x22d)]+'\x27')),_0x21d8ee++);}}catch(_0x37b99f){const _0x508477=isHttp400Error(_0x37b99f),_0xc6d638=_0x508477?ErrorCode[_0x4cc7ef(0x24d)]:ErrorCode[_0x4cc7ef(0x294)],_0x33670e=getErrorMessage(_0x37b99f);throw new SDKError(_0xc6d638,_0x4cc7ef(0x258)+_0x255732['type']+_0x4cc7ef(0x1ca)+_0x255732['name']+_0x4cc7ef(0x1fb)+_0x555f24['absolutePath']+'\x0a\x20\x20'+_0x33670e,_0x37b99f);}}}for(const _0x524f31 of _0x2cc35f[_0x4cc7ef(0x282)]?[]:_0x40fa0c){await withSpinner(_0x4cc7ef(0x1c5)+_0x524f31['name']+_0x4cc7ef(0x1b3),()=>_0x464609[_0x4cc7ef(0x27f)]['deleteSegment'](_0x524f31['id']),{'verbose':_0x2cc35f['verbose']}),console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x27b)]('✔\x20Deleted\x20segment\x20\x27'+_0x524f31['name']+'\x27')),_0x134af7++;}let _0x55f4f0=0x0,_0x50f087=0x0,_0x3c5eb5=0x0;const _0x4169c0=new Map(_0x3a6dd9);for(const _0x44a8b8 of _0x469f95){_0x44a8b8[_0x4cc7ef(0x244)]&&_0x1882b4[_0x4cc7ef(0x26e)](_0x44a8b8[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)])&&_0x4169c0[_0x4cc7ef(0x291)](_0x44a8b8[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)],_0x1882b4[_0x4cc7ef(0x1f4)](_0x44a8b8[_0x4cc7ef(0x252)][_0x4cc7ef(0x22d)]));}if(_0x53c9e6['length']>0x0){const _0x75f1e=await withQuerySpinner(_0x4cc7ef(0x20c),async _0x210be6=>{const _0x4f86b4=_0x4cc7ef,_0x43c4dc=[];let _0x6105ce=0x0;const _0x3121d1=0x5;for(let _0x38f3af=0x0;_0x38f3af<_0x53c9e6[_0x4f86b4(0x20f)];_0x38f3af+=_0x3121d1){const _0x15d85b=_0x53c9e6[_0x4f86b4(0x1fd)](_0x38f3af,_0x38f3af+_0x3121d1),_0x2d3e29=await Promise[_0x4f86b4(0x1e8)](_0x15d85b[_0x4f86b4(0x1b7)](async _0x587dee=>{const _0x30fda7=_0x4f86b4;if(!_0x587dee['isNew']&&!_0x587dee['hasChanges'])return{'action':_0x30fda7(0x1f1),'name':_0x587dee[_0x30fda7(0x252)][_0x30fda7(0x22d)],'journeyId':_0x587dee[_0x30fda7(0x1cd)]?.['id']};const _0x3fcafc=_0x587dee[_0x30fda7(0x283)]?_0xa5bdaa['get'](_0x587dee[_0x30fda7(0x283)]):undefined,_0x2f8806=_0x587dee[_0x30fda7(0x244)]?_0x30fda7(0x1de):'Updating';_0x210be6[_0x30fda7(0x1bb)](_0x2f8806+_0x30fda7(0x23e)+_0x587dee[_0x30fda7(0x252)]['name']+'\x27');const _0x173019=new Map(),_0x1bd4c6=new Map(),_0x47524a=new Map(),_0x44dc70={'resolveSegmentId':async _0x52d85a=>{const _0xeb8ad8=_0x30fda7,_0x28554e=_0x4169c0[_0xeb8ad8(0x1f4)](_0x52d85a);if(!_0x28554e)throw new SDKError(ErrorCode[_0xeb8ad8(0x2aa)],_0xeb8ad8(0x1cc)+_0x52d85a+_0xeb8ad8(0x1f7)+_0x587dee['yamlConfig'][_0xeb8ad8(0x22d)]+')');return _0x28554e;},'resolveEmbeddedSegmentId':async(_0x3b6ffe,_0x421bb3)=>{const _0x19cff0=_0x30fda7,_0x1d4fb2=_0x4169c0[_0x19cff0(0x1f4)](_0x3b6ffe);if(_0x1d4fb2)return _0x1d4fb2;const _0x4d353b=_0x40a69b[_0x19cff0(0x1f3)](_0x36f322=>_0x36f322[_0x19cff0(0x22d)]===_0x3b6ffe);if(_0x4d353b)return _0x4169c0[_0x19cff0(0x291)](_0x3b6ffe,_0x4d353b['id']),_0x4d353b['id'];if(_0x587dee[_0x19cff0(0x244)]){const _0x7a7b8e=_0x587dee['yamlConfig'][_0x19cff0(0x1eb)]||_0x587dee['yamlConfig'][_0x19cff0(0x26a)]?.[0x0]?.[_0x19cff0(0x1eb)]||[];let _0x11cda4=_0x19cff0(0x2a7),_0x48561f=_0x3b6ffe;for(const _0x20aab5 of _0x7a7b8e){if(_0x20aab5[_0x19cff0(0x1dd)]?.['segment']===_0x3b6ffe){_0x11cda4=_0x20aab5[_0x19cff0(0x22d)],_0x48561f=_0x20aab5[_0x19cff0(0x1dd)][_0x19cff0(0x22d)]||_0x3b6ffe;break;}}return _0x1bd4c6['set'](_0x3b6ffe,{'definition':_0x421bb3,'stageName':_0x11cda4,'criteriaName':_0x48561f}),createPendingSegmentId(_0x3b6ffe);}const _0x17c038=_0x587dee[_0x19cff0(0x1cd)]?.['id'];if(!_0x17c038)throw new SDKError(ErrorCode[_0x19cff0(0x29c)],_0x19cff0(0x21d));const _0x3a1080=_0x19cff0(0x1dc)+crypto['randomUUID']();try{const _0x43e15b=await _0x464609[_0x19cff0(0x27f)][_0x19cff0(0x263)]({'name':_0x3a1080,'description':_0x421bb3[_0x19cff0(0x28e)]||_0x19cff0(0x1c9)+_0x3b6ffe,'journeyId':_0x17c038,'rule':yamlRuleToApi(_0x421bb3[_0x19cff0(0x20e)],!![]),'countPopulation':!![],'parentFolderId':_0x44a1b7||'','audienceId':_0xf2a83c});return _0x2cc35f[_0x19cff0(0x206)]&&console[_0x19cff0(0x239)]('\x20\x20Created\x20embedded\x20segment\x20\x27'+_0x3b6ffe+_0x19cff0(0x28b)+_0x3a1080+_0x19cff0(0x261)+_0x43e15b),_0x4169c0[_0x19cff0(0x291)](_0x3b6ffe,_0x43e15b),_0x43e15b;}catch(_0x16bd8d){throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x19cff0(0x249)+_0x3b6ffe+_0x19cff0(0x2a2)+getErrorMessage(_0x16bd8d),_0x16bd8d);}},'resolveActivationId':async _0x3c022d=>{const _0x1047e9=_0x30fda7,_0x50bec6=_0x173019['get'](_0x3c022d);if(_0x50bec6)return _0x50bec6;if(_0x587dee[_0x1047e9(0x1cd)]){const _0xe593d5=await _0x464609['journey'][_0x1047e9(0x200)](_0x587dee['existingJourney']['id']),_0x2cbcad=_0xe593d5['find'](_0x143afe=>_0x143afe['attributes'][_0x1047e9(0x29d)]?.['name']===_0x3c022d);if(_0x2cbcad)return _0x173019[_0x1047e9(0x291)](_0x3c022d,_0x2cbcad['id']),_0x2cbcad['id'];}throw new SDKError(ErrorCode[_0x1047e9(0x1bd)],'Activation\x20not\x20found:\x20'+_0x3c022d+_0x1047e9(0x1f7)+_0x587dee['yamlConfig'][_0x1047e9(0x22d)]+').\x20'+_0x1047e9(0x20d));},'resolveEmbeddedActivationId':async(_0x5ef008,_0x104a5d)=>{const _0x2459fd=_0x30fda7,_0x1f0409=_0x173019[_0x2459fd(0x1f4)](_0x5ef008);if(_0x1f0409)return _0x1f0409;if(_0x587dee[_0x2459fd(0x244)])return _0x47524a[_0x2459fd(0x291)](_0x5ef008,_0x104a5d),createPendingActivationId(_0x5ef008);if(_0x587dee['existingJourney']){const _0x9b6d12=await _0x464609[_0x2459fd(0x21b)][_0x2459fd(0x200)](_0x587dee[_0x2459fd(0x1cd)]['id']),_0x3e4018=_0x9b6d12['find'](_0x393fc2=>_0x393fc2[_0x2459fd(0x1e7)][_0x2459fd(0x29d)]?.[_0x2459fd(0x22d)]===_0x104a5d[_0x2459fd(0x22d)]);if(_0x3e4018)return _0x173019[_0x2459fd(0x291)](_0x5ef008,_0x3e4018['id']),_0x3e4018['id'];try{const _0xb3e09a=yamlActivationToCreateRequest(_0x104a5d,_0x539eff,_0x26400c),_0x28150c=await _0x464609[_0x2459fd(0x21b)]['createActivation'](_0x587dee['existingJourney']['id'],_0xb3e09a);return _0x2cc35f[_0x2459fd(0x206)]&&console[_0x2459fd(0x239)](_0x2459fd(0x1d7)+_0x5ef008+_0x2459fd(0x280)+_0x28150c['id']),_0x173019[_0x2459fd(0x291)](_0x5ef008,_0x28150c['id']),_0x28150c['id'];}catch(_0x42da61){throw new SDKError(ErrorCode['JOURNEY_UPDATE_ERROR'],_0x2459fd(0x26c)+_0x5ef008+_0x2459fd(0x2a2)+getErrorMessage(_0x42da61),_0x42da61);}}throw new SDKError(ErrorCode[_0x2459fd(0x29c)],_0x2459fd(0x2a9));},'resolveJourneyId':async _0x4e8491=>{const _0x59f221=_0x30fda7;try{return await _0x464609['journey']['resolveJourneyId'](_0xf2a83c,_0x4e8491);}catch(_0x33fbab){throw new SDKError(ErrorCode['NOT_FOUND'],_0x59f221(0x292)+_0x4e8491+_0x59f221(0x236)+_0x587dee[_0x59f221(0x252)][_0x59f221(0x22d)]+'\x27)',_0x33fbab);}},'resolveStageId':async(_0x210901,_0x376eaf)=>{const _0x48149c=_0x30fda7,_0x241f1e=await _0x464609[_0x48149c(0x21b)]['getJourney'](_0x210901),_0x5effc7=_0x241f1e[_0x48149c(0x1e7)][_0x48149c(0x275)]['find'](_0x400b5d=>_0x400b5d[_0x48149c(0x22d)][_0x48149c(0x287)]()===_0x376eaf[_0x48149c(0x287)]());if(!_0x5effc7?.['id'])throw new SDKError(ErrorCode[_0x48149c(0x1bd)],_0x48149c(0x297)+_0x376eaf+_0x48149c(0x1b9)+(_0x241f1e[_0x48149c(0x1e7)][_0x48149c(0x221)]||_0x241f1e[_0x48149c(0x1e7)][_0x48149c(0x22d)])+'\x27');return _0x5effc7['id'];}};try{const _0x5eeda1=await a36_0x3c7ba(_0x587dee['yamlConfig'],_0xf2a83c,_0x44dc70),_0x5134fe=_0x3fcafc||_0x44a1b7;_0x5134fe&&(_0x5eeda1[_0x30fda7(0x2a3)]={'parentFolder':{'data':{'id':_0x5134fe,'type':_0x30fda7(0x267)}}});if(_0x587dee[_0x30fda7(0x244)]){if(_0x1bd4c6[_0x30fda7(0x1df)]>0x0||_0x47524a['size']>0x0){const _0x2bec6d=JSON[_0x30fda7(0x28f)](JSON[_0x30fda7(0x203)](_0x5eeda1));ensureJourneyDefaults(_0x2bec6d[_0x30fda7(0x1e7)]);for(const _0x1ad19d of _0x2bec6d[_0x30fda7(0x1e7)][_0x30fda7(0x275)]){_0x1ad19d[_0x30fda7(0x25d)]?.[_0x30fda7(0x22c)]&&isPendingSegmentId(_0x1ad19d[_0x30fda7(0x25d)][_0x30fda7(0x22c)])&&delete _0x1ad19d[_0x30fda7(0x25d)];if(_0x1ad19d[_0x30fda7(0x250)])for(const _0x564e9d of Object[_0x30fda7(0x254)](_0x1ad19d[_0x30fda7(0x250)])){const _0x5e234b=_0x1ad19d['steps'][_0x564e9d];_0x5e234b[_0x30fda7(0x1c3)]===_0x30fda7(0x24b)&&_0x5e234b[_0x30fda7(0x1d9)]&&isPendingActivationId(_0x5e234b[_0x30fda7(0x1d9)])&&(_0x5e234b[_0x30fda7(0x1d9)]='');if(_0x5e234b[_0x30fda7(0x1c3)]===_0x30fda7(0x1e4)&&_0x5e234b[_0x30fda7(0x1c8)])for(const _0x3c0bef of _0x5e234b[_0x30fda7(0x1c8)]){_0x3c0bef[_0x30fda7(0x22c)]&&isPendingSegmentId(_0x3c0bef[_0x30fda7(0x22c)])&&(_0x3c0bef[_0x30fda7(0x22c)]='');}}}_0x2cc35f[_0x30fda7(0x206)]&&console['error'](_0x30fda7(0x27d)+JSON[_0x30fda7(0x203)](_0x2bec6d,null,0x2));const _0x417316=await _0x464609[_0x30fda7(0x21b)][_0x30fda7(0x25c)](_0x2bec6d),_0x118a97=_0x417316['id'],_0x46274f=new Map();for(const _0x1a6dcf of _0x417316[_0x30fda7(0x1e7)]['journeyStages']){_0x46274f[_0x30fda7(0x291)](_0x1a6dcf[_0x30fda7(0x22d)]['toLowerCase'](),_0x1a6dcf['id']);}const _0x397636=new Map();for(const [_0x4c1c17,{definition:_0x1abf69,criteriaName:_0x17e775}]of _0x1bd4c6){const _0x15b70a=generateJourneyLocalName(_0x17e775)||_0x30fda7(0x1dc)+crypto[_0x30fda7(0x207)]();_0x2cc35f[_0x30fda7(0x206)]&&console[_0x30fda7(0x239)]('\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27'+_0x4c1c17+_0x30fda7(0x28b)+_0x15b70a+_0x30fda7(0x247)+_0x118a97);const _0x1ff380=await _0x464609[_0x30fda7(0x27f)]['createJourneySegment']({'name':_0x15b70a,'description':_0x1abf69['description']||_0x30fda7(0x1c9)+_0x4c1c17,'journeyId':_0x118a97,'rule':yamlRuleToApi(_0x1abf69[_0x30fda7(0x20e)],!![]),'countPopulation':!![],'parentFolderId':_0x5134fe||'','audienceId':_0xf2a83c});_0x397636[_0x30fda7(0x291)](_0x4c1c17,_0x1ff380),_0x4169c0[_0x30fda7(0x291)](_0x4c1c17,_0x1ff380),_0x2cc35f[_0x30fda7(0x206)]&&console[_0x30fda7(0x239)](_0x30fda7(0x212)+_0x4c1c17+_0x30fda7(0x280)+_0x1ff380);}const _0x2c164c=new Map();for(const [_0x194df2,_0x27cf23]of _0x47524a){_0x2cc35f[_0x30fda7(0x206)]&&console[_0x30fda7(0x239)](_0x30fda7(0x21a)+_0x194df2+_0x30fda7(0x1d6)+_0x118a97);try{const _0x5782cc=yamlActivationToCreateRequest(_0x27cf23,_0x539eff,_0x26400c),_0x5094ae=await _0x464609[_0x30fda7(0x21b)][_0x30fda7(0x246)](_0x118a97,_0x5782cc);_0x2c164c[_0x30fda7(0x291)](_0x194df2,_0x5094ae['id']),_0x173019[_0x30fda7(0x291)](_0x194df2,_0x5094ae['id']),_0x2cc35f['verbose']&&console[_0x30fda7(0x239)]('\x20\x20Created\x20embedded\x20activation\x20\x27'+_0x194df2+_0x30fda7(0x280)+_0x5094ae['id']);}catch(_0x50ba2f){throw new SDKError(ErrorCode['JOURNEY_UPDATE_ERROR'],'Failed\x20to\x20create\x20embedded\x20activation\x20\x27'+_0x194df2+_0x30fda7(0x2a2)+getErrorMessage(_0x50ba2f),_0x50ba2f);}}const _0x55728f=JSON[_0x30fda7(0x28f)](JSON['stringify'](_0x5eeda1));_0x55728f['id']=_0x118a97,ensureJourneyDefaults(_0x55728f[_0x30fda7(0x1e7)]);for(const _0x3d1441 of _0x55728f['attributes'][_0x30fda7(0x275)]){const _0xa913f3=_0x46274f[_0x30fda7(0x1f4)](_0x3d1441[_0x30fda7(0x22d)]['toLowerCase']());_0xa913f3&&(_0x3d1441['id']=_0xa913f3);if(_0x3d1441[_0x30fda7(0x25d)]?.[_0x30fda7(0x22c)]&&isPendingSegmentId(_0x3d1441[_0x30fda7(0x25d)][_0x30fda7(0x22c)])){const _0x1790f9=extractPendingSegmentName(_0x3d1441[_0x30fda7(0x25d)][_0x30fda7(0x22c)]),_0x5a35f4=_0x397636[_0x30fda7(0x1f4)](_0x1790f9);_0x5a35f4&&(_0x3d1441[_0x30fda7(0x25d)][_0x30fda7(0x22c)]=_0x5a35f4);}if(_0x3d1441[_0x30fda7(0x250)]){const _0x17b7cc=_0x320607=>_0x5eeda1[_0x30fda7(0x1e7)]['journeyStages'][_0x30fda7(0x1f3)](_0x240b16=>_0x240b16[_0x30fda7(0x22d)][_0x30fda7(0x287)]()===_0x3d1441[_0x30fda7(0x22d)][_0x30fda7(0x287)]())?.[_0x30fda7(0x250)]?.[_0x320607];for(const _0xa5bfe of Object['keys'](_0x3d1441[_0x30fda7(0x250)])){const _0x1db124=_0x3d1441[_0x30fda7(0x250)][_0xa5bfe],_0x15ea66=_0x17b7cc(_0xa5bfe);if(_0x1db124['type']==='Activation'&&_0x1db124['journeyActivationStepId']&&(isPendingActivationId(_0x1db124['journeyActivationStepId'])||_0x1db124['journeyActivationStepId']==='')){if(_0x15ea66?.[_0x30fda7(0x1d9)]&&isPendingActivationId(_0x15ea66['journeyActivationStepId'])){const _0x53affa=extractPendingActivationName(_0x15ea66['journeyActivationStepId']),_0x17ca95=_0x2c164c[_0x30fda7(0x1f4)](_0x53affa);_0x17ca95&&(_0x1db124[_0x30fda7(0x1d9)]=_0x17ca95);}}if(_0x1db124['type']===_0x30fda7(0x1e4)&&_0x1db124[_0x30fda7(0x1c8)]&&_0x15ea66?.[_0x30fda7(0x1c8)])for(let _0x5e91cc=0x0;_0x5e91cc<_0x1db124['branches'][_0x30fda7(0x20f)];_0x5e91cc++){const _0x39cfb7=_0x1db124['branches'][_0x5e91cc],_0x2baf0f=_0x15ea66[_0x30fda7(0x1c8)][_0x5e91cc];if(_0x2baf0f?.['segmentId']&&isPendingSegmentId(_0x2baf0f[_0x30fda7(0x22c)])){const _0x2acabc=extractPendingSegmentName(_0x2baf0f[_0x30fda7(0x22c)]),_0x41a008=_0x397636[_0x30fda7(0x1f4)](_0x2acabc);_0x41a008&&(_0x39cfb7['segmentId']=_0x41a008);}}}}}return _0x2cc35f[_0x30fda7(0x206)]&&console['error'](_0x30fda7(0x1f5)+JSON[_0x30fda7(0x203)](_0x55728f,null,0x2)),await _0x464609[_0x30fda7(0x21b)][_0x30fda7(0x225)](_0x118a97,_0x55728f),{'action':'created','name':_0x587dee[_0x30fda7(0x252)][_0x30fda7(0x22d)],'journeyId':_0x118a97};}else{ensureJourneyDefaults(_0x5eeda1['attributes']);_0x2cc35f[_0x30fda7(0x206)]&&console['error']('\x20\x20Journey\x20API\x20request:\x20'+JSON[_0x30fda7(0x203)](_0x5eeda1,null,0x2));const _0xb8da31=await _0x464609['journey'][_0x30fda7(0x25c)](_0x5eeda1);return{'action':_0x30fda7(0x201),'name':_0x587dee[_0x30fda7(0x252)][_0x30fda7(0x22d)],'journeyId':_0xb8da31['id']};}}else{if(_0x587dee[_0x30fda7(0x260)]&&_0x587dee[_0x30fda7(0x1cd)])return ensureJourneyDefaults(_0x5eeda1[_0x30fda7(0x1e7)]),await _0x464609[_0x30fda7(0x21b)][_0x30fda7(0x225)](_0x587dee[_0x30fda7(0x1cd)]['id'],_0x5eeda1),{'action':'updated','name':_0x587dee[_0x30fda7(0x252)][_0x30fda7(0x22d)],'journeyId':_0x587dee[_0x30fda7(0x1cd)]['id']};}return{'action':_0x30fda7(0x1f1),'name':_0x587dee[_0x30fda7(0x252)]['name'],'journeyId':_0x587dee[_0x30fda7(0x1cd)]?.['id']};}catch(_0x209e46){const _0x4aae3c=isHttp400Error(_0x209e46),_0x19c167=_0x4aae3c?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x30fda7(0x1d3)],_0x10fa56=getErrorMessage(_0x209e46);throw new SDKError(_0x19c167,_0x30fda7(0x258)+(_0x587dee['isNew']?_0x30fda7(0x25c):_0x30fda7(0x225))+_0x30fda7(0x209)+_0x587dee['absolutePath']+_0x30fda7(0x270)+_0x10fa56,_0x209e46);}}));_0x43c4dc[_0x4f86b4(0x23a)](..._0x2d3e29),_0x6105ce+=_0x15d85b['length'],_0x210be6['setExtra']('('+_0x6105ce+'/'+_0x53c9e6[_0x4f86b4(0x20f)]+')');}return _0x43c4dc;},{'verbose':_0x2cc35f[_0x4cc7ef(0x206)]});for(const _0x1c9838 of _0x75f1e['data']){if(_0x1c9838[_0x4cc7ef(0x25b)]===_0x4cc7ef(0x201))console[_0x4cc7ef(0x239)](a36_0x55958f['green'](_0x4cc7ef(0x21f)+_0x1c9838['name']+'\x27')),_0x55f4f0++;else _0x1c9838['action']===_0x4cc7ef(0x269)&&(console['error'](a36_0x55958f[_0x4cc7ef(0x1d1)](_0x4cc7ef(0x1ba)+_0x1c9838[_0x4cc7ef(0x22d)]+'\x27')),_0x50f087++);}if(_0x293aae&&_0x75f1e[_0x4cc7ef(0x242)][_0x4cc7ef(0x20f)]===0x1){const _0x280eaf=_0x75f1e[_0x4cc7ef(0x242)][0x0];if(_0x280eaf[_0x4cc7ef(0x28d)]){const _0x441b1c=getConsoleNextUrl(_0x2cc35f['site'],'/app/ps/'+_0xf2a83c+_0x4cc7ef(0x1f9)+_0x280eaf[_0x4cc7ef(0x28d)]+_0x4cc7ef(0x1e9));console[_0x4cc7ef(0x239)]('\x20\x20'+a36_0x55958f[_0x4cc7ef(0x1e2)](_0x441b1c));}}}for(const _0x5b7cc7 of _0x48d9a3){console[_0x4cc7ef(0x239)](a36_0x55958f['yellow'](_0x4cc7ef(0x1ed)+_0x5b7cc7['journeyBundleName'])),_0x3c5eb5++;}const _0x12f585=[];if(_0x34d0c5>0x0)_0x12f585['push'](_0x34d0c5+_0x4cc7ef(0x1d5));if(_0x3f318e>0x0)_0x12f585['push'](_0x3f318e+'\x20updated');if(_0x134af7>0x0)_0x12f585[_0x4cc7ef(0x23a)](_0x134af7+_0x4cc7ef(0x1ff));const _0x386db7=[];if(_0x55f4f0>0x0)_0x386db7[_0x4cc7ef(0x23a)](_0x55f4f0+_0x4cc7ef(0x1d5));if(_0x50f087>0x0)_0x386db7[_0x4cc7ef(0x23a)](_0x50f087+_0x4cc7ef(0x23b));if(_0x3c5eb5>0x0)_0x386db7['push'](_0x3c5eb5+_0x4cc7ef(0x1ff));const _0x48ba67=[];if(_0x1927a9>0x0)_0x48ba67['push'](_0x1927a9+_0x4cc7ef(0x1d5));if(_0x4f9954>0x0)_0x48ba67['push'](_0x4f9954+_0x4cc7ef(0x23b));if(_0x21d8ee>0x0)_0x48ba67[_0x4cc7ef(0x23a)](_0x21d8ee+_0x4cc7ef(0x1ff));return console[_0x4cc7ef(0x239)](a36_0x55958f[_0x4cc7ef(0x289)](_0x4cc7ef(0x230))),_0x12f585['length']>0x0&&!_0x2cc35f[_0x4cc7ef(0x282)]&&console[_0x4cc7ef(0x239)](_0x4cc7ef(0x1b8)+_0x12f585['join'](',\x20')),_0x386db7[_0x4cc7ef(0x20f)]>0x0&&console[_0x4cc7ef(0x239)](_0x4cc7ef(0x204)+_0x386db7[_0x4cc7ef(0x26f)](',\x20')),_0x48ba67[_0x4cc7ef(0x20f)]>0x0&&!_0x2cc35f['journeysOnly']&&console['error'](_0x4cc7ef(0x285)+_0x48ba67[_0x4cc7ef(0x26f)](',\x20')),0x0;}}function a36_0x1d1c(_0x2bbcb1,_0x192f97){_0x2bbcb1=_0x2bbcb1-0x1b3;const _0xa6c34e=a36_0xa6c3();let _0x1d1c37=_0xa6c34e[_0x2bbcb1];return _0x1d1c37;}function buildFolderPathToIdMap(_0xddbf6d){const _0x5ba503=a36_0x23a37f,_0x4bf895=new Map(),_0x2a17a1=new Map();for(const _0x1650ec of _0xddbf6d){_0x2a17a1[_0x5ba503(0x291)](_0x1650ec['id'],_0x1650ec);}const _0x469832=new Set();for(const _0x3ebb5c of _0xddbf6d){!_0x3ebb5c['parentFolderId']&&_0x469832[_0x5ba503(0x24c)](_0x3ebb5c['id']);}function _0x2279d4(_0x2dab84){const _0x5512ef=_0x5ba503;if(_0x469832['has'](_0x2dab84['id']))return'';if(_0x2dab84[_0x5512ef(0x28a)]){const _0x30dadc=_0x2a17a1[_0x5512ef(0x1f4)](_0x2dab84['parentFolderId']);if(_0x30dadc){const _0x4e5cab=_0x2279d4(_0x30dadc);return _0x4e5cab?_0x4e5cab+'/'+_0x2dab84[_0x5512ef(0x22d)]:_0x2dab84[_0x5512ef(0x22d)];}}return _0x2dab84['name'];}for(const _0x5c6b33 of _0xddbf6d){const _0x45048a=_0x2279d4(_0x5c6b33);_0x4bf895[_0x5ba503(0x291)](_0x45048a,_0x5c6b33['id']);}return _0x4bf895;}function findYamlFiles(_0x38bec2){const _0x3d3f7f=[];function _0x4ca9f0(_0x348e8b){const _0xc7fc26=a36_0x1d1c,_0x125d2f=readdirSync(_0x348e8b,{'withFileTypes':!![]});for(const _0x472dbb of _0x125d2f){const _0x123657=a36_0x327b7c['join'](_0x348e8b,_0x472dbb[_0xc7fc26(0x22d)]);if(_0x472dbb[_0xc7fc26(0x2a4)]())_0x4ca9f0(_0x123657);else(_0x472dbb[_0xc7fc26(0x22d)][_0xc7fc26(0x1e5)](_0xc7fc26(0x1fe))||_0x472dbb[_0xc7fc26(0x22d)]['endsWith'](_0xc7fc26(0x240)))&&_0x3d3f7f[_0xc7fc26(0x23a)](_0x123657);}}return _0x4ca9f0(_0x38bec2),_0x3d3f7f;}function calculateActivationActions(_0x1b770d,_0x1f0e7a,_0x566573,_0x169cc6){const _0x4ac8ea=a36_0x23a37f,_0x16786c=[],_0x5ea53b=new Map();for(const _0x384e08 of _0x1f0e7a){_0x5ea53b[_0x4ac8ea(0x291)](_0x384e08['name'],_0x384e08);}const _0x40c572=new Map();for(const _0x18fcd7 of _0x1b770d){_0x40c572[_0x4ac8ea(0x291)](_0x18fcd7[_0x4ac8ea(0x22d)],_0x18fcd7);}for(const _0x45f8d3 of _0x1b770d){const _0x18d98e=_0x5ea53b[_0x4ac8ea(0x1f4)](_0x45f8d3[_0x4ac8ea(0x22d)]);if(!_0x18d98e)_0x16786c[_0x4ac8ea(0x23a)]({'type':_0x4ac8ea(0x25c),'name':_0x45f8d3[_0x4ac8ea(0x22d)],'yamlActivation':_0x45f8d3});else{const _0x1b32aa=activationToYaml(_0x18d98e,_0x566573,_0x169cc6),_0x427a21=a36_0x54d85f[_0x4ac8ea(0x203)](_0x1b32aa),_0xcd6e6a=a36_0x54d85f['stringify'](_0x45f8d3);_0x427a21!==_0xcd6e6a&&_0x16786c[_0x4ac8ea(0x23a)]({'type':_0x4ac8ea(0x225),'name':_0x45f8d3[_0x4ac8ea(0x22d)],'yamlActivation':_0x45f8d3,'existingActivation':_0x18d98e});}}for(const _0x3b33dd of _0x1f0e7a){!_0x40c572[_0x4ac8ea(0x26e)](_0x3b33dd[_0x4ac8ea(0x22d)])&&_0x16786c['push']({'type':_0x4ac8ea(0x255),'name':_0x3b33dd['name'],'existingActivation':_0x3b33dd});}return _0x16786c;}
@@ -1 +1 @@
1
- const a36_0x43f93b=a36_0x1a9e;function a36_0x1a9e(_0x4bfc00,_0x1b6d02){_0x4bfc00=_0x4bfc00-0x1b6;const _0x15e306=a36_0x15e3();let _0x1a9e20=_0x15e306[_0x4bfc00];return _0x1a9e20;}(function(_0x47fdf6,_0x13cb89){const _0x1cbf33=a36_0x1a9e,_0x78a6b1=_0x47fdf6();while(!![]){try{const _0x3bac52=parseInt(_0x1cbf33(0x1c0))/0x1+-parseInt(_0x1cbf33(0x1c2))/0x2+-parseInt(_0x1cbf33(0x1e7))/0x3+-parseInt(_0x1cbf33(0x1d7))/0x4*(-parseInt(_0x1cbf33(0x1e0))/0x5)+-parseInt(_0x1cbf33(0x1cc))/0x6*(parseInt(_0x1cbf33(0x1c6))/0x7)+parseInt(_0x1cbf33(0x1e4))/0x8+parseInt(_0x1cbf33(0x1ba))/0x9;if(_0x3bac52===_0x13cb89)break;else _0x78a6b1['push'](_0x78a6b1['shift']());}catch(_0x37d266){_0x78a6b1['push'](_0x78a6b1['shift']());}}}(a36_0x15e3,0x47c02));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a36_0x15e3(){const _0x2ee221=['rule','7nIToon','Updating\x20segment\x20\x27','verbose','segmentName','name','description','792378luzCkV','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','resolvePathToResource','INTERNAL','Examples:','ruleFile','data','Error:\x20Cannot\x20update\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolving\x20path\x20\x27','execute','1268vgMAOU','segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentId','\x27...','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','error','Resolved\x20relative\x20path\x20to:\x20','Update\x20existing\x20child\x20segment','4275XtKJmM','\x20\x20\x20Path:\x20','segmentPath','Parent\x20ID:\x20','1073704lbJHwr','✔\x20Updated\x20segment\x20\x27','type','1147737lNysWd','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','yellow','segment:update','Segment\x20ID:\x20','folder','parentId','5291991wbILzA','includes','kind','updateSegmentById','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Segment\x20ID\x20missing\x20from\x20resolved\x20path','218024hxKapz','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','805478PFJGyl','Resolved\x20folder\x20ID:\x20','resolveFolderId'];a36_0x15e3=function(){return _0x2ee221;};return a36_0x15e3();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a36_0x44b3c4 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a36_0x43f93b(0x1ca)]=a36_0x43f93b(0x1b6);['description']=a36_0x43f93b(0x1df);async[a36_0x43f93b(0x1d6)](_0xa4bae1){const _0x3fd88f=a36_0x43f93b;console[_0x3fd88f(0x1dd)](a36_0x44b3c4[_0x3fd88f(0x1e9)](_0x3fd88f(0x1cd))),console[_0x3fd88f(0x1dd)](a36_0x44b3c4[_0x3fd88f(0x1e9)](_0x3fd88f(0x1be)));const {options:_0x28bef1,args:_0x103d05,tdx:_0x217c7b}=_0xa4bae1,_0x5bc333=_0x28bef1;if(_0x103d05['length']===0x0)return console[_0x3fd88f(0x1dd)](_0x3fd88f(0x1c1)),console[_0x3fd88f(0x1dd)](_0x3fd88f(0x1d4)),console['error'](_0x3fd88f(0x1d0)),console[_0x3fd88f(0x1dd)](_0x3fd88f(0x1e8)),console[_0x3fd88f(0x1dd)](_0x3fd88f(0x1d9)),0x1;const _0x4bbc56=_0x103d05[0x0],_0x4c631d=_0x28bef1[_0x3fd88f(0x1e2)];let _0x4f1af5=_0x4bbc56;_0x4c631d&&!_0x4bbc56[_0x3fd88f(0x1bb)]('/')&&(_0x4f1af5=_0x4c631d+'/'+_0x4bbc56,_0x5bc333[_0x3fd88f(0x1c8)]&&console[_0x3fd88f(0x1dd)](_0x3fd88f(0x1de)+_0x4f1af5));const _0x301392=await withSpinner(_0x3fd88f(0x1d5)+_0x4f1af5+_0x3fd88f(0x1db),()=>_0x217c7b[_0x3fd88f(0x1d8)][_0x3fd88f(0x1ce)](_0x4f1af5),{'verbose':_0x5bc333[_0x3fd88f(0x1c8)]}),_0x28ba28=_0x301392[_0x3fd88f(0x1d2)];_0x5bc333[_0x3fd88f(0x1c8)]&&console[_0x3fd88f(0x1dd)]('Resolved\x20type:\x20'+_0x28ba28[_0x3fd88f(0x1e6)]);if(_0x28ba28[_0x3fd88f(0x1e6)]!==_0x3fd88f(0x1d8))return console[_0x3fd88f(0x1dd)](_0x3fd88f(0x1d3)+_0x28ba28[_0x3fd88f(0x1e6)]+_0x3fd88f(0x1dc)),console[_0x3fd88f(0x1dd)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x28ba28[_0x3fd88f(0x1da)])throw new SDKError(ErrorCode[_0x3fd88f(0x1cf)],_0x3fd88f(0x1bf));const _0x55f4aa=_0x28ba28[_0x3fd88f(0x1b9)],_0x1a9d51=_0x28ba28[_0x3fd88f(0x1da)];_0x5bc333['verbose']&&(console[_0x3fd88f(0x1dd)](_0x3fd88f(0x1e3)+_0x55f4aa),console[_0x3fd88f(0x1dd)](_0x3fd88f(0x1b7)+_0x1a9d51));let _0x1bb005;if(_0x5bc333['folder']){const _0x4f4c66=_0x5bc333[_0x3fd88f(0x1b8)],_0x3cd65a=await withSpinner('Resolving\x20folder\x20\x27'+_0x4f4c66+'\x27...',()=>_0x217c7b[_0x3fd88f(0x1d8)][_0x3fd88f(0x1c4)](_0x55f4aa,_0x4f4c66),{'verbose':_0x5bc333['verbose']});_0x1bb005=parseInt(_0x3cd65a['data'],0xa),_0x5bc333['verbose']&&console['error'](_0x3fd88f(0x1c3)+_0x1bb005);}const _0x57fb2e=await loadJSONFromOptions(_0x5bc333[_0x3fd88f(0x1c5)],_0x5bc333[_0x3fd88f(0x1d1)]),_0x27453a={'name':_0x5bc333[_0x3fd88f(0x1ca)],'description':_0x5bc333[_0x3fd88f(0x1cb)],'rule':_0x57fb2e,'kind':_0x5bc333['kind']!==undefined?parseInt(_0x5bc333[_0x3fd88f(0x1bc)],0xa):undefined,'segmentFolderId':_0x1bb005},_0xcae2bb=await withSpinner(_0x3fd88f(0x1c7)+_0x28ba28[_0x3fd88f(0x1c9)]+_0x3fd88f(0x1db),()=>_0x217c7b[_0x3fd88f(0x1d8)][_0x3fd88f(0x1bd)](_0x55f4aa,_0x1a9d51,_0x27453a),{'verbose':_0x5bc333[_0x3fd88f(0x1c8)]}),_0xc33b07=_0xcae2bb[_0x3fd88f(0x1d2)];return console[_0x3fd88f(0x1dd)](_0x3fd88f(0x1e5)+_0xc33b07[_0x3fd88f(0x1ca)]+'\x27'),_0x4f1af5!==_0x4bbc56&&console['error'](_0x3fd88f(0x1e1)+_0x4f1af5),await handleSDKOutput([_0xc33b07],_0x5bc333),0x0;}}
1
+ const a37_0x489ae1=a37_0x363e;(function(_0x26275a,_0x1b3372){const _0x29d1a8=a37_0x363e,_0x4641e9=_0x26275a();while(!![]){try{const _0xa61318=-parseInt(_0x29d1a8(0x1af))/0x1+-parseInt(_0x29d1a8(0x19b))/0x2*(parseInt(_0x29d1a8(0x1ac))/0x3)+parseInt(_0x29d1a8(0x197))/0x4*(parseInt(_0x29d1a8(0x1b4))/0x5)+parseInt(_0x29d1a8(0x1bf))/0x6*(-parseInt(_0x29d1a8(0x1b3))/0x7)+-parseInt(_0x29d1a8(0x196))/0x8*(-parseInt(_0x29d1a8(0x1a4))/0x9)+-parseInt(_0x29d1a8(0x1c1))/0xa*(parseInt(_0x29d1a8(0x1c0))/0xb)+parseInt(_0x29d1a8(0x195))/0xc;if(_0xa61318===_0x1b3372)break;else _0x4641e9['push'](_0x4641e9['shift']());}catch(_0x1ef0a4){_0x4641e9['push'](_0x4641e9['shift']());}}}(a37_0x1e80,0x618da));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x363e(_0x25fd85,_0x2f2934){_0x25fd85=_0x25fd85-0x191;const _0x1e8025=a37_0x1e80();let _0x363ed8=_0x1e8025[_0x25fd85];return _0x363ed8;}import{loadJSONFromOptions}from'../utils/json-loader.js';function a37_0x1e80(){const _0x57d9eb=['parentId','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','rule','27mDCXOI','Resolved\x20folder\x20ID:\x20','data','594218ldWHDg','✔\x20Updated\x20segment\x20\x27','folder','type','73339AePppK','440egVCJI','segmentId','segmentName','\x20\x20\x20Path:\x20','length','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','name','Examples:','segmentPath','Segment\x20ID\x20missing\x20from\x20resolved\x20path','258fIewNJ','864545ximafM','20WFBkBu','Resolved\x20type:\x20','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','INTERNAL','21601104WOEbJL','35736EvUtUU','4544MiOjDs','description','\x27...','includes','135834xUMUYr','kind','yellow','error','Segment\x20ID:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Updating\x20segment\x20\x27','segment','resolveFolderId','630PEzYkV','Error:\x20Cannot\x20update\x20'];a37_0x1e80=function(){return _0x57d9eb;};return a37_0x1e80();}import{SDKError,ErrorCode}from'../sdk/index.js';import a37_0x2adf5e from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a37_0x489ae1(0x1bb)]='segment:update';[a37_0x489ae1(0x198)]='Update\x20existing\x20child\x20segment';async['execute'](_0x47fcc5){const _0x21b4a1=a37_0x489ae1;console[_0x21b4a1(0x19e)](a37_0x2adf5e['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x21b4a1(0x19e)](a37_0x2adf5e[_0x21b4a1(0x19d)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0xdc4b0,args:_0x4661f6,tdx:_0x16aaa4}=_0x47fcc5,_0x547534=_0xdc4b0;if(_0x4661f6[_0x21b4a1(0x1b8)]===0x0)return console[_0x21b4a1(0x19e)](_0x21b4a1(0x1a9)),console[_0x21b4a1(0x19e)](_0x21b4a1(0x1aa)),console[_0x21b4a1(0x19e)](_0x21b4a1(0x1bc)),console[_0x21b4a1(0x19e)](_0x21b4a1(0x1a0)),console[_0x21b4a1(0x19e)](_0x21b4a1(0x193)),0x1;const _0x4f526d=_0x4661f6[0x0],_0x2579f3=_0xdc4b0[_0x21b4a1(0x1bd)];let _0x37fbf9=_0x4f526d;_0x2579f3&&!_0x4f526d[_0x21b4a1(0x19a)]('/')&&(_0x37fbf9=_0x2579f3+'/'+_0x4f526d,_0x547534[_0x21b4a1(0x1a8)]&&console[_0x21b4a1(0x19e)](_0x21b4a1(0x1ba)+_0x37fbf9));const _0x165f53=await withSpinner(_0x21b4a1(0x192)+_0x37fbf9+'\x27...',()=>_0x16aaa4[_0x21b4a1(0x1a2)]['resolvePathToResource'](_0x37fbf9),{'verbose':_0x547534[_0x21b4a1(0x1a8)]}),_0x3fbe51=_0x165f53[_0x21b4a1(0x1ae)];_0x547534[_0x21b4a1(0x1a8)]&&console['error'](_0x21b4a1(0x191)+_0x3fbe51[_0x21b4a1(0x1b2)]);if(_0x3fbe51[_0x21b4a1(0x1b2)]!==_0x21b4a1(0x1a2))return console[_0x21b4a1(0x19e)](_0x21b4a1(0x1a5)+_0x3fbe51[_0x21b4a1(0x1b2)]+_0x21b4a1(0x1a7)),console[_0x21b4a1(0x19e)](_0x21b4a1(0x1b9)),0x1;if(!_0x3fbe51[_0x21b4a1(0x1b5)])throw new SDKError(ErrorCode[_0x21b4a1(0x194)],_0x21b4a1(0x1be));const _0x5edd32=_0x3fbe51[_0x21b4a1(0x1a6)],_0x4ae246=_0x3fbe51[_0x21b4a1(0x1b5)];_0x547534[_0x21b4a1(0x1a8)]&&(console['error']('Parent\x20ID:\x20'+_0x5edd32),console[_0x21b4a1(0x19e)](_0x21b4a1(0x19f)+_0x4ae246));let _0xf0b06;if(_0x547534[_0x21b4a1(0x1b1)]){const _0x409e3d=_0x547534[_0x21b4a1(0x1b1)],_0x5009f8=await withSpinner('Resolving\x20folder\x20\x27'+_0x409e3d+_0x21b4a1(0x199),()=>_0x16aaa4[_0x21b4a1(0x1a2)][_0x21b4a1(0x1a3)](_0x5edd32,_0x409e3d),{'verbose':_0x547534['verbose']});_0xf0b06=parseInt(_0x5009f8[_0x21b4a1(0x1ae)],0xa),_0x547534[_0x21b4a1(0x1a8)]&&console[_0x21b4a1(0x19e)](_0x21b4a1(0x1ad)+_0xf0b06);}const _0x2ae3b2=await loadJSONFromOptions(_0x547534[_0x21b4a1(0x1ab)],_0x547534['ruleFile']),_0x55ab10={'name':_0x547534[_0x21b4a1(0x1bb)],'description':_0x547534['description'],'rule':_0x2ae3b2,'kind':_0x547534[_0x21b4a1(0x19c)]!==undefined?parseInt(_0x547534[_0x21b4a1(0x19c)],0xa):undefined,'segmentFolderId':_0xf0b06},_0x1d4458=await withSpinner(_0x21b4a1(0x1a1)+_0x3fbe51[_0x21b4a1(0x1b6)]+_0x21b4a1(0x199),()=>_0x16aaa4['segment']['updateSegmentById'](_0x5edd32,_0x4ae246,_0x55ab10),{'verbose':_0x547534[_0x21b4a1(0x1a8)]}),_0x5097ed=_0x1d4458[_0x21b4a1(0x1ae)];return console[_0x21b4a1(0x19e)](_0x21b4a1(0x1b0)+_0x5097ed[_0x21b4a1(0x1bb)]+'\x27'),_0x37fbf9!==_0x4f526d&&console['error'](_0x21b4a1(0x1b7)+_0x37fbf9),await handleSDKOutput([_0x5097ed],_0x547534),0x0;}}