@treasuredata/tdx 2026.6.0 → 2026.6.2

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 (248) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/table-deleted.js +1 -1
  53. package/dist/commands/tables.js +1 -1
  54. package/dist/commands/unset-command.js +1 -1
  55. package/dist/commands/upgrade-command.js +1 -1
  56. package/dist/commands/use-command.js +1 -1
  57. package/dist/commands/user-command.js +1 -1
  58. package/dist/commands/work-command.js +1 -1
  59. package/dist/commands/workflow-command.d.ts +2 -2
  60. package/dist/commands/workflow-command.d.ts.map +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/commands/workflow-command.js.map +1 -1
  63. package/dist/core/auth.js +1 -1
  64. package/dist/core/command-output.js +1 -1
  65. package/dist/core/config.js +1 -1
  66. package/dist/core/connection-cache.js +1 -1
  67. package/dist/core/constants.js +1 -1
  68. package/dist/core/credential-cache.js +1 -1
  69. package/dist/core/global-context.js +1 -1
  70. package/dist/core/keychain.js +1 -1
  71. package/dist/core/oauth-keychain.js +1 -1
  72. package/dist/core/oauth.js +1 -1
  73. package/dist/core/profile.js +1 -1
  74. package/dist/core/project-config.js +1 -1
  75. package/dist/core/session.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/tools/work-create-item.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/sse-usage-parser.js +1 -1
  88. package/dist/sdk/agent/agent-config.js +1 -1
  89. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  90. package/dist/sdk/agent/agent-yaml.js +1 -1
  91. package/dist/sdk/agent/test/evaluator.js +1 -1
  92. package/dist/sdk/agent/test/executor.js +1 -1
  93. package/dist/sdk/agent/test/index.js +1 -1
  94. package/dist/sdk/agent/test/output.js +1 -1
  95. package/dist/sdk/agent/test/parser.js +1 -1
  96. package/dist/sdk/agent/tool-target-registry.js +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/cas/cas-api-client.js +1 -1
  99. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  100. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  101. package/dist/sdk/cas/index.js +1 -1
  102. package/dist/sdk/cas/pull-workflow.js +1 -1
  103. package/dist/sdk/cas/push-workflow.js +1 -1
  104. package/dist/sdk/client/cdp-api-client.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  106. package/dist/sdk/client/delivery-api-client.js +1 -1
  107. package/dist/sdk/client/endpoints.js +1 -1
  108. package/dist/sdk/client/engage-api-client.js +1 -1
  109. package/dist/sdk/client/http-client.js +1 -1
  110. package/dist/sdk/client/llm-api-client.js +1 -1
  111. package/dist/sdk/client/oauth-refresh.js +1 -1
  112. package/dist/sdk/client/rate-limiter.js +1 -1
  113. package/dist/sdk/client/td-api-client.js +1 -1
  114. package/dist/sdk/client/trino-api-client.js +1 -1
  115. package/dist/sdk/client/workflow-client.d.ts +23 -1
  116. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  117. package/dist/sdk/client/workflow-client.js +1 -1
  118. package/dist/sdk/client/workflow-client.js.map +1 -1
  119. package/dist/sdk/connection-validator.js +1 -1
  120. package/dist/sdk/connection.js +1 -1
  121. package/dist/sdk/delivery.js +1 -1
  122. package/dist/sdk/engage/campaign-pull.js +1 -1
  123. package/dist/sdk/engage/campaign-push.js +1 -1
  124. package/dist/sdk/engage/campaign-validator.js +1 -1
  125. package/dist/sdk/engage/campaign-yaml.js +1 -1
  126. package/dist/sdk/engage/template-pull.js +1 -1
  127. package/dist/sdk/engage/template-push.js +1 -1
  128. package/dist/sdk/engage/template-validator.js +1 -1
  129. package/dist/sdk/engage/template-yaml.js +1 -1
  130. package/dist/sdk/engage/types/campaign-def.js +1 -1
  131. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  132. package/dist/sdk/engage/types/template-schema.js +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/errors.js +1 -1
  135. package/dist/sdk/index.js +1 -1
  136. package/dist/sdk/io/index.js +1 -1
  137. package/dist/sdk/io/node-filesystem.js +1 -1
  138. package/dist/sdk/job.js +1 -1
  139. package/dist/sdk/journey.js +1 -1
  140. package/dist/sdk/llm/chat-cache.js +1 -1
  141. package/dist/sdk/llm/index.js +1 -1
  142. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  143. package/dist/sdk/llm/model-factors.d.ts +8 -4
  144. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  145. package/dist/sdk/llm/model-factors.js +1 -1
  146. package/dist/sdk/llm/model-factors.js.map +1 -1
  147. package/dist/sdk/llm/user-settings.js +1 -1
  148. package/dist/sdk/personalization.js +1 -1
  149. package/dist/sdk/policy.js +1 -1
  150. package/dist/sdk/query/deleted-table-validation.js +1 -1
  151. package/dist/sdk/query/index.js +1 -1
  152. package/dist/sdk/query/sql-parser.js +1 -1
  153. package/dist/sdk/realtime.js +1 -1
  154. package/dist/sdk/schedule.js +1 -1
  155. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  156. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  157. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  158. package/dist/sdk/segment/fields-display.js +1 -1
  159. package/dist/sdk/segment/file-discovery.js +1 -1
  160. package/dist/sdk/segment/journey-utils.js +1 -1
  161. package/dist/sdk/segment/journey-validator.js +1 -1
  162. package/dist/sdk/segment/journey-yaml.js +1 -1
  163. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  164. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  165. package/dist/sdk/segment/pull-workflow.js +1 -1
  166. package/dist/sdk/segment/push-recovery.js +1 -1
  167. package/dist/sdk/segment/push-workflow.js +1 -1
  168. package/dist/sdk/segment/resolution-context.js +1 -1
  169. package/dist/sdk/segment/segment-path-parser.js +1 -1
  170. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  171. package/dist/sdk/segment/segment-validator.js +1 -1
  172. package/dist/sdk/segment/target-resolution.js +1 -1
  173. package/dist/sdk/segment/tdx-config.js +1 -1
  174. package/dist/sdk/segment/types/activation-schema.js +1 -1
  175. package/dist/sdk/segment/types/journey-def.js +1 -1
  176. package/dist/sdk/segment/types/journey-schema.js +1 -1
  177. package/dist/sdk/segment/types/segment-def.js +1 -1
  178. package/dist/sdk/segment/types/segment-schema.js +1 -1
  179. package/dist/sdk/segment/validate-files.js +1 -1
  180. package/dist/sdk/segment/yaml-validator.js +1 -1
  181. package/dist/sdk/segment.js +1 -1
  182. package/dist/sdk/types/cdp.d.ts +4 -3
  183. package/dist/sdk/types/cdp.d.ts.map +1 -1
  184. package/dist/sdk/types/index.js +1 -1
  185. package/dist/sdk/types/progress.js +1 -1
  186. package/dist/sdk/types/workflow.d.ts +1 -1
  187. package/dist/sdk/types/workflow.d.ts.map +1 -1
  188. package/dist/sdk/types/workspace.js +1 -1
  189. package/dist/sdk/user.js +1 -1
  190. package/dist/sdk/util/format-detector.js +1 -1
  191. package/dist/sdk/util/formatters.js +1 -1
  192. package/dist/sdk/util/index.js +1 -1
  193. package/dist/sdk/util/paginate.js +1 -1
  194. package/dist/sdk/util/tree-formatter.js +1 -1
  195. package/dist/sdk/workflow/archive-validation.js +1 -1
  196. package/dist/sdk/workflow/clone-workflow.js +1 -1
  197. package/dist/sdk/workflow/index.d.ts +23 -2
  198. package/dist/sdk/workflow/index.d.ts.map +1 -1
  199. package/dist/sdk/workflow/index.js +1 -1
  200. package/dist/sdk/workflow/index.js.map +1 -1
  201. package/dist/sdk/workflow/pull-workflow.js +1 -1
  202. package/dist/sdk/workflow/push-workflow.d.ts +4 -0
  203. package/dist/sdk/workflow/push-workflow.d.ts.map +1 -1
  204. package/dist/sdk/workflow/push-workflow.js +1 -1
  205. package/dist/sdk/workflow/push-workflow.js.map +1 -1
  206. package/dist/sdk/workflow/task-graph.js +1 -1
  207. package/dist/sdk/workflow/tdx-config.js +1 -1
  208. package/dist/sdk/workflow/workflow-utils.js +1 -1
  209. package/dist/sdk/workspace/access-tracker.js +1 -1
  210. package/dist/sdk/workspace/frontmatter.js +1 -1
  211. package/dist/sdk/workspace/git.js +1 -1
  212. package/dist/sdk/workspace/index.js +1 -1
  213. package/dist/sdk/workspace/templates.js +1 -1
  214. package/dist/sdk/workspace/weekly.js +1 -1
  215. package/dist/sdk/workspace/wikilinks.js +1 -1
  216. package/dist/test-utils/command-runner.js +1 -1
  217. package/dist/test-utils/factories.js +1 -1
  218. package/dist/test-utils/fixtures.js +1 -1
  219. package/dist/test-utils/http-mock.js +1 -1
  220. package/dist/test-utils/index.js +1 -1
  221. package/dist/utils/async.js +1 -1
  222. package/dist/utils/colors.js +1 -1
  223. package/dist/utils/diff.js +1 -1
  224. package/dist/utils/file-permissions.js +1 -1
  225. package/dist/utils/file-reader.js +1 -1
  226. package/dist/utils/github-releases.js +1 -1
  227. package/dist/utils/global-cache.js +1 -1
  228. package/dist/utils/json-loader.js +1 -1
  229. package/dist/utils/local-cache.js +1 -1
  230. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  231. package/dist/utils/logger/formatters/index.js +1 -1
  232. package/dist/utils/logger/handlers/console-handler.js +1 -1
  233. package/dist/utils/logger/handlers/file-handler.js +1 -1
  234. package/dist/utils/logger/handlers/index.js +1 -1
  235. package/dist/utils/logger/handlers/null-handler.js +1 -1
  236. package/dist/utils/logger/index.js +1 -1
  237. package/dist/utils/logger/logger.js +1 -1
  238. package/dist/utils/logger/types.js +1 -1
  239. package/dist/utils/option-validation.js +1 -1
  240. package/dist/utils/process.js +1 -1
  241. package/dist/utils/prompt.js +1 -1
  242. package/dist/utils/spinner.js +1 -1
  243. package/dist/utils/sse-parser.js +1 -1
  244. package/dist/utils/string-utils.js +1 -1
  245. package/dist/utils/table-ref-parser.js +1 -1
  246. package/dist/utils/tdx-logger.js +1 -1
  247. package/dist/utils/version-check.js +1 -1
  248. package/package.json +1 -1
@@ -1 +1 @@
1
- const a24_0x68e686=a24_0x140d;function a24_0x6a76(){const _0x1eb790=['error','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','execute','configDir','\x0aPush\x20summary\x20for\x20workspace\x20\x27','templateId','Workspace\x20is\x20required.','site','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','dim','path','906194cPjRxX','setPhase','\x20errors:','✔\x20Created\x20','Aborted.','1188222QTFJgv','✔\x20Updated\x20','-\x20no\x20changes\x20applied','valid','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','4755996CBpdmf','1\x20template\x20file:\x20','1168904jcwqWq','created','updated','\x20new\x20templates:','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','name','yes','def','cwd','\x0aError:','message','81JnXPbQ','\x27...','Push\x20','\x20templates','1418130gmvaED','results','workspace','Found\x20','engage_workspace','dirname','cyan','\x20templates\x20to\x20update:','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','red','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','yellow','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','config','651388tMXVAA','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','session','engage','engage:template:push','4053126EcDprB','warnings','action','resolve','data','\x20templates?','Preparing\x20push\x20to\x20workspace\x20\x27','green','errors','verbose','dryRun','20zwkQxm','\x20\x20\x20\x20'];a24_0x6a76=function(){return _0x1eb790;};return a24_0x6a76();}(function(_0x20f017,_0xe5e209){const _0x401464=a24_0x140d,_0x121420=_0x20f017();while(!![]){try{const _0x1b22b9=parseInt(_0x401464(0x1e5))/0x1+parseInt(_0x401464(0x201))/0x2+-parseInt(_0x401464(0x1ea))/0x3+parseInt(_0x401464(0x210))/0x4*(parseInt(_0x401464(0x1d8))/0x5)+parseInt(_0x401464(0x215))/0x6+-parseInt(_0x401464(0x1ef))/0x7+-parseInt(_0x401464(0x1f1))/0x8*(parseInt(_0x401464(0x1fd))/0x9);if(_0x1b22b9===_0xe5e209)break;else _0x121420['push'](_0x121420['shift']());}catch(_0x441423){_0x121420['push'](_0x121420['shift']());}}}(a24_0x6a76,0x86ae1));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0xa2eb78 from'chalk';import a24_0x515500 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';function a24_0x140d(_0x334359,_0x431177){_0x334359=_0x334359-0x1d7;const _0x6a76cf=a24_0x6a76();let _0x140d20=_0x6a76cf[_0x334359];return _0x140d20;}import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x68e686(0x1f7)]=a24_0x68e686(0x214);['description']=a24_0x68e686(0x1e2);async[a24_0x68e686(0x1dc)](_0x124e87){const _0x36de03=a24_0x68e686,{options:_0x32af02,args:_0x20d234,tdx:_0x389cfd}=_0x124e87,_0x3ac680=_0x32af02,_0x1dc06a=_0x20d234[0x0],_0x87d8ef=_0x1dc06a?a24_0x515500[_0x36de03(0x218)](_0x1dc06a):undefined,_0x4b1792=_0x87d8ef?isYamlFile(_0x87d8ef):![];let _0x567138;if(_0x4b1792&&_0x87d8ef)_0x567138=a24_0x515500[_0x36de03(0x206)](_0x87d8ef);else _0x87d8ef?_0x567138=_0x87d8ef:_0x567138=process[_0x36de03(0x1fa)]();let _0xa171db;const _0x490854=tryFindTdxConfig(_0x567138);_0x490854?.[_0x36de03(0x20f)]['engage_workspace']&&(_0xa171db=_0x490854[_0x36de03(0x20f)]['engage_workspace'],!_0x4b1792&&(_0x567138=_0x490854[_0x36de03(0x1dd)]));_0x3ac680[_0x36de03(0x203)]&&(_0xa171db=_0x3ac680[_0x36de03(0x203)]);if(!_0xa171db){const _0x241507=loadSessionContext(_0x3ac680[_0x36de03(0x212)]);_0x241507?.[_0x36de03(0x205)]&&(_0xa171db=_0x241507[_0x36de03(0x205)]);}if(!_0xa171db)return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20d)](_0x36de03(0x1e0))),console['error'](_0x36de03(0x20a)),console[_0x36de03(0x1da)](_0x36de03(0x1db)),console[_0x36de03(0x1da)](_0x36de03(0x1f6)),console[_0x36de03(0x1da)](_0x36de03(0x209)),0x1;let _0x4ba940;_0x4b1792&&_0x87d8ef?_0x4ba940=[parseTemplateFile(_0x87d8ef,a24_0x515500[_0x36de03(0x206)](_0x87d8ef))]:_0x4ba940=discoverAndParseTemplateFiles(_0x567138);if(_0x4ba940[_0x36de03(0x1f5)]===0x0)return console['error'](a24_0xa2eb78[_0x36de03(0x20d)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x567138)),console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x1e3)](_0x36de03(0x20e))),0x1;const _0x1487b4=_0x4ba940[_0x36de03(0x1f5)]===0x1?_0x36de03(0x1f0)+_0x4ba940[0x0][_0x36de03(0x1f9)][_0x36de03(0x1f7)]:_0x4ba940[_0x36de03(0x1f5)]+'\x20template\x20files';console[_0x36de03(0x1da)](_0x36de03(0x204)+a24_0xa2eb78[_0x36de03(0x207)](_0x1487b4));let _0x1c0361=![];for(const _0x391045 of _0x4ba940){const _0x1cc900=validateTemplateDef(_0x391045[_0x36de03(0x1f9)]);if(!_0x1cc900[_0x36de03(0x1ed)]){_0x1c0361=!![],console['error'](a24_0xa2eb78[_0x36de03(0x20b)]('\x0aValidation\x20errors\x20in\x20'+_0x391045['relativePath']+':'));for(const _0x41278d of _0x1cc900[_0x36de03(0x21d)]){console[_0x36de03(0x1da)]('\x20\x20'+a24_0xa2eb78['red']('✗')+'\x20'+_0x41278d[_0x36de03(0x1e4)]+':\x20'+_0x41278d[_0x36de03(0x1fc)]);}}for(const _0x2c5d6b of _0x1cc900[_0x36de03(0x216)]){console['error']('\x20\x20'+a24_0xa2eb78[_0x36de03(0x20d)]('⚠')+'\x20'+_0x2c5d6b['path']+':\x20'+_0x2c5d6b['message']);}}if(_0x1c0361)return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20b)](_0x36de03(0x211))),0x1;const _0x5e1b8f=await _0x389cfd[_0x36de03(0x213)]['resolveWorkspaceId'](_0xa171db),_0x4161f7=await withProgressSpinner(_0x36de03(0x21b)+_0xa171db+_0x36de03(0x1fe),_0x1c6851=>preparePush({'engage':_0x389cfd['engage']},_0x4ba940,_0x5e1b8f,{'progress':{'update':_0x5281b3=>_0x1c6851[_0x36de03(0x1e6)](_0x5281b3)}}),{'verbose':_0x3ac680[_0x36de03(0x21e)]}),_0x270bda=_0x4161f7[_0x36de03(0x219)];await withProgressSpinner('Resolving\x20references...',_0x3a253e=>resolveAndBuildInputs({'engage':_0x389cfd[_0x36de03(0x213)]},_0x270bda,_0x5e1b8f,{'progress':{'update':_0xfdc96=>_0x3a253e[_0x36de03(0x1e6)](_0xfdc96)}}),{'verbose':_0x3ac680[_0x36de03(0x21e)]});const _0x54bff2=_0x270bda['filter'](_0x5cf4d8=>_0x5cf4d8[_0x36de03(0x217)]==='create'),_0x3831b9=_0x270bda['filter'](_0x4fe271=>_0x4fe271['action']==='update');console[_0x36de03(0x1da)](_0x36de03(0x1de)+_0xa171db+'\x27:');if(_0x54bff2[_0x36de03(0x1f5)]>0x0){console['error']('\x20\x20'+a24_0xa2eb78[_0x36de03(0x21c)]('+\x20'+_0x54bff2[_0x36de03(0x1f5)]+_0x36de03(0x1f4)));for(const _0x561c3e of _0x54bff2){console[_0x36de03(0x1da)]('\x20\x20\x20\x20'+a24_0xa2eb78[_0x36de03(0x21c)]('+')+'\x20'+_0x561c3e[_0x36de03(0x1f9)][_0x36de03(0x1f7)]);}}if(_0x3831b9['length']>0x0){console[_0x36de03(0x1da)]('\x20\x20'+a24_0xa2eb78[_0x36de03(0x20d)]('~\x20'+_0x3831b9['length']+_0x36de03(0x208)));for(const _0xe60fb0 of _0x3831b9){console[_0x36de03(0x1da)](_0x36de03(0x1d9)+a24_0xa2eb78[_0x36de03(0x20d)]('~')+'\x20'+_0xe60fb0[_0x36de03(0x1f9)][_0x36de03(0x1f7)]);}}if(_0x54bff2[_0x36de03(0x1f5)]===0x0&&_0x3831b9[_0x36de03(0x1f5)]===0x0)return console['error'](a24_0xa2eb78[_0x36de03(0x21c)]('✔\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x3ac680[_0x36de03(0x1d7)])return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20d)](_0x36de03(0x20c))),0x0;if(!_0x3ac680[_0x36de03(0x1f8)]){if(!isInteractive())return console['error'](a24_0xa2eb78['red'](_0x36de03(0x1fb)),_0x36de03(0x1ee)),console['error'](a24_0xa2eb78[_0x36de03(0x1e3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x28ddba=await confirmKey(_0x36de03(0x1ff)+(_0x54bff2[_0x36de03(0x1f5)]+_0x3831b9[_0x36de03(0x1f5)])+_0x36de03(0x21a));if(!_0x28ddba)return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20d)](_0x36de03(0x1e9)),_0x36de03(0x1ec)),0x1;}const _0x2a87dc=await withProgressSpinner('Pushing\x20templates...',_0xb89116=>executePush({'engage':_0x389cfd[_0x36de03(0x213)]},_0x270bda,{'progress':{'update':_0x19f8c3=>_0xb89116[_0x36de03(0x1e6)](_0x19f8c3)}}),{'verbose':_0x3ac680[_0x36de03(0x21e)]}),_0x130c00=_0x2a87dc[_0x36de03(0x219)];for(const _0x35b96c of _0x130c00[_0x36de03(0x202)]){if(_0x35b96c[_0x36de03(0x1df)]&&(_0x35b96c[_0x36de03(0x217)]==='created'||_0x35b96c[_0x36de03(0x217)]==='updated')){const _0x5afb2f=getTemplateUrl(_0x3ac680[_0x36de03(0x1e1)],_0x5e1b8f,_0x35b96c['templateId']),_0x5475e0=_0x35b96c['action']===_0x36de03(0x1f2)?'+':'~',_0x2263cc=_0x35b96c['action']===_0x36de03(0x1f2)?a24_0xa2eb78[_0x36de03(0x21c)](_0x5475e0):a24_0xa2eb78[_0x36de03(0x20d)](_0x5475e0);console[_0x36de03(0x1da)]('\x20\x20'+_0x2263cc+'\x20'+hyperlink(_0x35b96c[_0x36de03(0x1f7)],_0x5afb2f)+'\x20'+a24_0xa2eb78['dim'](_0x5afb2f));}}_0x130c00[_0x36de03(0x1f2)]>0x0&&console[_0x36de03(0x1da)](a24_0xa2eb78['green'](_0x36de03(0x1e8)+_0x130c00[_0x36de03(0x1f2)]+_0x36de03(0x200)));_0x130c00[_0x36de03(0x1f3)]>0x0&&console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x21c)](_0x36de03(0x1eb)+_0x130c00['updated']+'\x20templates'));if(_0x130c00[_0x36de03(0x21d)][_0x36de03(0x1f5)]>0x0){console['error'](a24_0xa2eb78[_0x36de03(0x20b)]('✘\x20'+_0x130c00['errors'][_0x36de03(0x1f5)]+_0x36de03(0x1e7)));for(const _0x2c8b30 of _0x130c00['errors']){console[_0x36de03(0x1da)]('\x20\x20'+a24_0xa2eb78[_0x36de03(0x20b)](_0x2c8b30['name'])+':\x20'+_0x2c8b30[_0x36de03(0x1da)]);}}return saveSessionContext({'engage_workspace':_0xa171db},_0x3ac680[_0x36de03(0x212)]),_0x130c00['errors']['length']>0x0?0x1:0x0;}}
1
+ function a24_0x3382(_0x2b1806,_0xad14ad){_0x2b1806=_0x2b1806-0x136;const _0x2fae2a=a24_0x2fae();let _0x338299=_0x2fae2a[_0x2b1806];return _0x338299;}const a24_0x2aabcc=a24_0x3382;(function(_0xdfc97,_0x2b8fa0){const _0x234249=a24_0x3382,_0x4f22f1=_0xdfc97();while(!![]){try{const _0x58516b=parseInt(_0x234249(0x142))/0x1*(parseInt(_0x234249(0x153))/0x2)+parseInt(_0x234249(0x15f))/0x3*(parseInt(_0x234249(0x176))/0x4)+parseInt(_0x234249(0x177))/0x5*(-parseInt(_0x234249(0x13e))/0x6)+parseInt(_0x234249(0x13f))/0x7*(parseInt(_0x234249(0x14a))/0x8)+-parseInt(_0x234249(0x165))/0x9*(-parseInt(_0x234249(0x164))/0xa)+parseInt(_0x234249(0x14b))/0xb+-parseInt(_0x234249(0x137))/0xc;if(_0x58516b===_0x2b8fa0)break;else _0x4f22f1['push'](_0x4f22f1['shift']());}catch(_0x57a6c5){_0x4f22f1['push'](_0x4f22f1['shift']());}}}(a24_0x2fae,0xce063));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x230d30 from'chalk';import a24_0xaa2f6a from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x2aabcc(0x156)]=a24_0x2aabcc(0x13d);[a24_0x2aabcc(0x16f)]=a24_0x2aabcc(0x174);async[a24_0x2aabcc(0x13b)](_0x457097){const _0x2ee3d1=a24_0x2aabcc,{options:_0x356c4d,args:_0xb90136,tdx:_0x28f2d6}=_0x457097,_0x4f9179=_0x356c4d,_0xd29805=_0xb90136[0x0],_0x580c02=_0xd29805?a24_0xaa2f6a[_0x2ee3d1(0x166)](_0xd29805):undefined,_0x35306f=_0x580c02?isYamlFile(_0x580c02):![];let _0x25643a;if(_0x35306f&&_0x580c02)_0x25643a=a24_0xaa2f6a['dirname'](_0x580c02);else _0x580c02?_0x25643a=_0x580c02:_0x25643a=process['cwd']();let _0x56bad7;const _0x37a399=tryFindTdxConfig(_0x25643a);_0x37a399?.['config'][_0x2ee3d1(0x173)]&&(_0x56bad7=_0x37a399[_0x2ee3d1(0x161)][_0x2ee3d1(0x173)],!_0x35306f&&(_0x25643a=_0x37a399[_0x2ee3d1(0x150)]));_0x4f9179[_0x2ee3d1(0x160)]&&(_0x56bad7=_0x4f9179['workspace']);if(!_0x56bad7){const _0x52b2bd=loadSessionContext(_0x4f9179[_0x2ee3d1(0x151)]);_0x52b2bd?.['engage_workspace']&&(_0x56bad7=_0x52b2bd[_0x2ee3d1(0x173)]);}if(!_0x56bad7)return console[_0x2ee3d1(0x169)](a24_0x230d30['yellow'](_0x2ee3d1(0x15e))),console[_0x2ee3d1(0x169)](_0x2ee3d1(0x148)),console[_0x2ee3d1(0x169)](_0x2ee3d1(0x175)),console[_0x2ee3d1(0x169)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace'),console[_0x2ee3d1(0x169)](_0x2ee3d1(0x168)),0x1;let _0x24eda0;_0x35306f&&_0x580c02?_0x24eda0=[parseTemplateFile(_0x580c02,a24_0xaa2f6a[_0x2ee3d1(0x136)](_0x580c02))]:_0x24eda0=discoverAndParseTemplateFiles(_0x25643a);if(_0x24eda0[_0x2ee3d1(0x155)]===0x0)return console[_0x2ee3d1(0x169)](a24_0x230d30[_0x2ee3d1(0x144)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x25643a)),console[_0x2ee3d1(0x169)](a24_0x230d30[_0x2ee3d1(0x15d)](_0x2ee3d1(0x16d))),0x1;const _0xc171c7=_0x24eda0[_0x2ee3d1(0x155)]===0x1?_0x2ee3d1(0x13a)+_0x24eda0[0x0][_0x2ee3d1(0x14d)]['name']:_0x24eda0['length']+_0x2ee3d1(0x16c);console[_0x2ee3d1(0x169)](_0x2ee3d1(0x17b)+a24_0x230d30[_0x2ee3d1(0x139)](_0xc171c7));let _0xcbe29a=![];for(const _0x48d86e of _0x24eda0){const _0x152558=validateTemplateDef(_0x48d86e[_0x2ee3d1(0x14d)]);if(!_0x152558['valid']){_0xcbe29a=!![],console[_0x2ee3d1(0x169)](a24_0x230d30[_0x2ee3d1(0x16b)]('\x0aValidation\x20errors\x20in\x20'+_0x48d86e[_0x2ee3d1(0x159)]+':'));for(const _0x163276 of _0x152558[_0x2ee3d1(0x14e)]){console[_0x2ee3d1(0x169)]('\x20\x20'+a24_0x230d30[_0x2ee3d1(0x16b)]('✗')+'\x20'+_0x163276['path']+':\x20'+_0x163276[_0x2ee3d1(0x140)]);}}for(const _0x4c4def of _0x152558['warnings']){console[_0x2ee3d1(0x169)]('\x20\x20'+a24_0x230d30[_0x2ee3d1(0x144)]('⚠')+'\x20'+_0x4c4def['path']+':\x20'+_0x4c4def['message']);}}if(_0xcbe29a)return console['error'](a24_0x230d30['red']('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x17bb1a=await _0x28f2d6[_0x2ee3d1(0x15a)][_0x2ee3d1(0x149)](_0x56bad7),_0x37c248=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x56bad7+'\x27...',_0x131718=>preparePush({'engage':_0x28f2d6[_0x2ee3d1(0x15a)]},_0x24eda0,_0x17bb1a,{'progress':{'update':_0x1153d1=>_0x131718[_0x2ee3d1(0x145)](_0x1153d1)}}),{'verbose':_0x4f9179[_0x2ee3d1(0x167)]}),_0x4f0eb8=_0x37c248[_0x2ee3d1(0x138)];await withProgressSpinner('Resolving\x20references...',_0x38fe6d=>resolveAndBuildInputs({'engage':_0x28f2d6[_0x2ee3d1(0x15a)]},_0x4f0eb8,_0x17bb1a,{'progress':{'update':_0x2bf457=>_0x38fe6d['setPhase'](_0x2bf457)}}),{'verbose':_0x4f9179[_0x2ee3d1(0x167)]});const _0x18ff78=_0x4f0eb8[_0x2ee3d1(0x15b)](_0x4bf6ed=>_0x4bf6ed[_0x2ee3d1(0x13c)]==='create'),_0x158e62=_0x4f0eb8[_0x2ee3d1(0x15b)](_0x465064=>_0x465064[_0x2ee3d1(0x13c)]==='update');console[_0x2ee3d1(0x169)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x56bad7+'\x27:');if(_0x18ff78[_0x2ee3d1(0x155)]>0x0){console['error']('\x20\x20'+a24_0x230d30[_0x2ee3d1(0x154)]('+\x20'+_0x18ff78[_0x2ee3d1(0x155)]+_0x2ee3d1(0x152)));for(const _0x1094ef of _0x18ff78){console['error'](_0x2ee3d1(0x171)+a24_0x230d30[_0x2ee3d1(0x154)]('+')+'\x20'+_0x1094ef[_0x2ee3d1(0x14d)]['name']);}}if(_0x158e62[_0x2ee3d1(0x155)]>0x0){console['error']('\x20\x20'+a24_0x230d30['yellow']('~\x20'+_0x158e62[_0x2ee3d1(0x155)]+_0x2ee3d1(0x143)));for(const _0x25c217 of _0x158e62){console[_0x2ee3d1(0x169)](_0x2ee3d1(0x171)+a24_0x230d30[_0x2ee3d1(0x144)]('~')+'\x20'+_0x25c217[_0x2ee3d1(0x14d)][_0x2ee3d1(0x156)]);}}if(_0x18ff78[_0x2ee3d1(0x155)]===0x0&&_0x158e62[_0x2ee3d1(0x155)]===0x0)return console['error'](a24_0x230d30[_0x2ee3d1(0x154)](_0x2ee3d1(0x16e))),0x0;if(_0x4f9179[_0x2ee3d1(0x16a)])return console[_0x2ee3d1(0x169)](a24_0x230d30[_0x2ee3d1(0x144)](_0x2ee3d1(0x15c))),0x0;if(!_0x4f9179[_0x2ee3d1(0x163)]){if(!isInteractive())return console[_0x2ee3d1(0x169)](a24_0x230d30[_0x2ee3d1(0x16b)](_0x2ee3d1(0x157)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2ee3d1(0x169)](a24_0x230d30[_0x2ee3d1(0x15d)](_0x2ee3d1(0x178))),0x1;const _0x32caeb=await confirmKey('Push\x20'+(_0x18ff78[_0x2ee3d1(0x155)]+_0x158e62['length'])+_0x2ee3d1(0x141));if(!_0x32caeb)return console['error'](a24_0x230d30[_0x2ee3d1(0x144)]('Aborted.'),_0x2ee3d1(0x146)),0x1;}const _0x20d44c=await withProgressSpinner(_0x2ee3d1(0x172),_0x5a5e00=>executePush({'engage':_0x28f2d6['engage']},_0x4f0eb8,{'progress':{'update':_0xea9cfb=>_0x5a5e00[_0x2ee3d1(0x145)](_0xea9cfb)}}),{'verbose':_0x4f9179[_0x2ee3d1(0x167)]}),_0x430dad=_0x20d44c[_0x2ee3d1(0x138)];for(const _0x26cbe5 of _0x430dad['results']){if(_0x26cbe5['templateId']&&(_0x26cbe5[_0x2ee3d1(0x13c)]==='created'||_0x26cbe5[_0x2ee3d1(0x13c)]===_0x2ee3d1(0x14c))){const _0x126b90=getTemplateUrl(_0x4f9179[_0x2ee3d1(0x17a)],_0x17bb1a,_0x26cbe5[_0x2ee3d1(0x147)]),_0x337d79=_0x26cbe5[_0x2ee3d1(0x13c)]===_0x2ee3d1(0x170)?'+':'~',_0x5b1edc=_0x26cbe5[_0x2ee3d1(0x13c)]===_0x2ee3d1(0x170)?a24_0x230d30[_0x2ee3d1(0x154)](_0x337d79):a24_0x230d30[_0x2ee3d1(0x144)](_0x337d79);console['error']('\x20\x20'+_0x5b1edc+'\x20'+hyperlink(_0x26cbe5[_0x2ee3d1(0x156)],_0x126b90)+'\x20'+a24_0x230d30[_0x2ee3d1(0x15d)](_0x126b90));}}_0x430dad[_0x2ee3d1(0x170)]>0x0&&console[_0x2ee3d1(0x169)](a24_0x230d30[_0x2ee3d1(0x154)](_0x2ee3d1(0x179)+_0x430dad[_0x2ee3d1(0x170)]+_0x2ee3d1(0x158)));_0x430dad[_0x2ee3d1(0x14c)]>0x0&&console[_0x2ee3d1(0x169)](a24_0x230d30[_0x2ee3d1(0x154)](_0x2ee3d1(0x162)+_0x430dad[_0x2ee3d1(0x14c)]+_0x2ee3d1(0x158)));if(_0x430dad[_0x2ee3d1(0x14e)]['length']>0x0){console[_0x2ee3d1(0x169)](a24_0x230d30[_0x2ee3d1(0x16b)]('✘\x20'+_0x430dad[_0x2ee3d1(0x14e)][_0x2ee3d1(0x155)]+_0x2ee3d1(0x14f)));for(const _0x2d6167 of _0x430dad[_0x2ee3d1(0x14e)]){console[_0x2ee3d1(0x169)]('\x20\x20'+a24_0x230d30[_0x2ee3d1(0x16b)](_0x2d6167[_0x2ee3d1(0x156)])+':\x20'+_0x2d6167['error']);}}return saveSessionContext({'engage_workspace':_0x56bad7},_0x4f9179[_0x2ee3d1(0x151)]),_0x430dad[_0x2ee3d1(0x14e)]['length']>0x0?0x1:0x0;}}function a24_0x2fae(){const _0x438459=['55287rUsqud','\x20templates\x20to\x20update:','yellow','setPhase','-\x20no\x20changes\x20applied','templateId','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','resolveWorkspaceId','176xIFUwk','9859465xzRooA','updated','def','errors','\x20errors:','configDir','session','\x20new\x20templates:','4OxWcKb','green','length','name','\x0aError:','\x20templates','relativePath','engage','filter','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','dim','Workspace\x20is\x20required.','3391752nLIwAX','workspace','config','✔\x20Updated\x20','yes','245690oDrWNZ','477cyHblp','resolve','verbose','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','error','dryRun','red','\x20template\x20files','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','✔\x20All\x20templates\x20are\x20up\x20to\x20date','description','created','\x20\x20\x20\x20','Pushing\x20templates...','engage_workspace','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','4MEFrTM','2397155WdSpqA','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','✔\x20Created\x20','site','Found\x20','dirname','26527128FtcWUo','data','cyan','1\x20template\x20file:\x20','execute','action','engage:template:push','6UdeBLU','29995hgXqEo','message','\x20templates?'];a24_0x2fae=function(){return _0x438459;};return a24_0x2fae();}
@@ -1 +1 @@
1
- const a25_0x1a5d74=a25_0x3e7d;function a25_0x2ad6(){const _0x5380ca=['yellow','9VMJsWn','resolve','.yaml','8utjKrL','1584772vOglsJ','cwd','warnings','\x20(skipped:\x20','reason','16498TEIbOF','Validate\x20template\x20YAML\x20files','\x20template(s)\x20with\x20errors,\x20','\x20non-template\x20file(s)\x20skipped)','Error:\x20Directory\x20not\x20found:\x20','skippedCount','red','\x20non-template\x20file(s)\x20skipped','2531331UDxQkQ','name','339410lbjbkZ','errors','error','length','validCount','25302pLDFdz','execute','endsWith','description','log','warningCount','engage:template:validate','11886700rAXpcG','invalidCount','440GMaTeY','verbose','1551837wgWCcp','\x20template(s)\x20valid','\x20warning(s)','.yml','No\x20template\x20YAML\x20files\x20found\x20in\x20','valid','template','Error:\x20No\x20YAML\x20files\x20found\x20in\x20'];a25_0x2ad6=function(){return _0x5380ca;};return a25_0x2ad6();}(function(_0x136520,_0x58a558){const _0x586ea8=a25_0x3e7d,_0x35aa77=_0x136520();while(!![]){try{const _0x5ebd7f=parseInt(_0x586ea8(0x1c9))/0x1+-parseInt(_0x586ea8(0x1bf))/0x2*(parseInt(_0x586ea8(0x1e2))/0x3)+-parseInt(_0x586ea8(0x1ba))/0x4+parseInt(_0x586ea8(0x1d7))/0x5*(-parseInt(_0x586ea8(0x1ce))/0x6)+-parseInt(_0x586ea8(0x1d9))/0x7*(parseInt(_0x586ea8(0x1b9))/0x8)+-parseInt(_0x586ea8(0x1c7))/0x9+parseInt(_0x586ea8(0x1d5))/0xa;if(_0x5ebd7f===_0x58a558)break;else _0x35aa77['push'](_0x35aa77['shift']());}catch(_0x3da7f2){_0x35aa77['push'](_0x35aa77['shift']());}}}(a25_0x2ad6,0x38e86));function a25_0x3e7d(_0x5e6e73,_0x28ae06){_0x5e6e73=_0x5e6e73-0x1b9;const _0x2ad647=a25_0x2ad6();let _0x3e7da9=_0x2ad647[_0x5e6e73];return _0x3e7da9;}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x3de6ff from'chalk';import a25_0x4a1a70 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x1a5d74(0x1c8)]=a25_0x1a5d74(0x1d4);[a25_0x1a5d74(0x1d1)]=a25_0x1a5d74(0x1c0);async[a25_0x1a5d74(0x1cf)](_0x294428){const _0x153d90=a25_0x1a5d74,{options:_0x3002eb,args:_0x1c36cd}=_0x294428,_0x59875d=_0x3002eb,_0x254165=_0x1c36cd[0x0],_0x24e57e=_0x254165?a25_0x4a1a70[_0x153d90(0x1e3)](_0x254165):undefined,_0x547264=_0x24e57e?isYamlFile(_0x24e57e):![];let _0x41816b,_0xadb725;if(_0x547264&&_0x24e57e)_0x41816b=a25_0x4a1a70['dirname'](_0x24e57e),_0xadb725=_0x24e57e;else _0x24e57e?_0x41816b=_0x24e57e:_0x41816b=process[_0x153d90(0x1bb)]();if(!_0xadb725&&!existsSync(_0x41816b))return console[_0x153d90(0x1cb)](a25_0x3de6ff['red'](_0x153d90(0x1c3)+_0x41816b+'\x0a')),0x1;let _0x506298;if(_0xadb725){if(!_0xadb725[_0x153d90(0x1d0)](_0x153d90(0x1dc))&&!_0xadb725[_0x153d90(0x1d0)](_0x153d90(0x1e4)))return console[_0x153d90(0x1cb)](a25_0x3de6ff['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0xadb725+'\x0a')),0x1;_0x506298=[_0xadb725];}else _0x506298=findYamlFiles(_0x41816b);if(_0x506298[_0x153d90(0x1cc)]===0x0)return console[_0x153d90(0x1cb)](a25_0x3de6ff['red'](_0x153d90(0x1e0)+_0x41816b+'\x0a')),0x1;const _0x55090e=validateYamlFiles(_0x506298,_0x41816b,{'filterType':_0x153d90(0x1df)}),_0x364ac0=calculateSummary(_0x55090e),_0x4b69a2=_0x55090e['filter'](isValidationResult);if(_0x4b69a2[_0x153d90(0x1cc)]===0x0)return console[_0x153d90(0x1cb)](a25_0x3de6ff['yellow'](_0x153d90(0x1dd)+_0x41816b+'\x0a')),_0x364ac0[_0x153d90(0x1c4)]>0x0&&console[_0x153d90(0x1cb)](a25_0x3de6ff['dim']('('+_0x364ac0[_0x153d90(0x1c4)]+_0x153d90(0x1c2))),0x0;for(const _0x5874cc of _0x55090e){if(!isValidationResult(_0x5874cc)){_0x59875d[_0x153d90(0x1d8)]&&console[_0x153d90(0x1d2)](a25_0x3de6ff['dim']('-\x20'+_0x5874cc['relativePath']+_0x153d90(0x1bd)+_0x5874cc[_0x153d90(0x1be)]+')'));continue;}const {relativePath:_0x31e140,source:_0x555b14,result:_0x1734e4}=_0x5874cc;if(_0x1734e4[_0x153d90(0x1de)]&&_0x1734e4[_0x153d90(0x1bc)][_0x153d90(0x1cc)]===0x0)_0x59875d[_0x153d90(0x1d8)]&&console[_0x153d90(0x1d2)](a25_0x3de6ff['green']('✔\x20'+_0x31e140));else _0x1734e4[_0x153d90(0x1de)]?(console[_0x153d90(0x1d2)](a25_0x3de6ff[_0x153d90(0x1e1)]('⚠\x20'+_0x31e140+':\x20'+_0x1734e4[_0x153d90(0x1bc)]['length']+_0x153d90(0x1db))),console[_0x153d90(0x1d2)](formatValidationResult(_0x1734e4,_0x555b14,_0x31e140))):(console[_0x153d90(0x1d2)](a25_0x3de6ff[_0x153d90(0x1c5)]('✖\x20'+_0x31e140+':\x20'+_0x1734e4[_0x153d90(0x1ca)][_0x153d90(0x1cc)]+'\x20error(s)')),console[_0x153d90(0x1d2)](formatValidationResult(_0x1734e4,_0x555b14,_0x31e140)));}return console[_0x153d90(0x1d2)](''),_0x364ac0['hasErrors']?(console[_0x153d90(0x1d2)](a25_0x3de6ff[_0x153d90(0x1c5)]('Validation\x20failed:\x20'+_0x364ac0[_0x153d90(0x1d6)]+_0x153d90(0x1c1)+_0x364ac0['validCount']+'\x20valid')),_0x364ac0['warningCount']>0x0&&console[_0x153d90(0x1d2)](a25_0x3de6ff[_0x153d90(0x1e1)](_0x364ac0[_0x153d90(0x1d3)]+'\x20warning(s)\x20found')),_0x364ac0[_0x153d90(0x1c4)]>0x0&&console[_0x153d90(0x1d2)](a25_0x3de6ff['dim'](_0x364ac0[_0x153d90(0x1c4)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x153d90(0x1d2)](a25_0x3de6ff['green']('✔\x20All\x20'+_0x364ac0[_0x153d90(0x1cd)]+_0x153d90(0x1da))),_0x364ac0[_0x153d90(0x1d3)]>0x0&&console[_0x153d90(0x1d2)](a25_0x3de6ff[_0x153d90(0x1e1)](_0x364ac0[_0x153d90(0x1d3)]+'\x20warning(s)\x20found')),_0x364ac0[_0x153d90(0x1c4)]>0x0&&console['log'](a25_0x3de6ff['dim'](_0x364ac0[_0x153d90(0x1c4)]+_0x153d90(0x1c6))),0x0);}}
1
+ function a25_0x54d6(_0x4970c8,_0x147574){_0x4970c8=_0x4970c8-0x199;const _0x2832cb=a25_0x2832();let _0x54d6fa=_0x2832cb[_0x4970c8];return _0x54d6fa;}const a25_0x1c537f=a25_0x54d6;(function(_0x7da96,_0x5c8515){const _0xa4ef00=a25_0x54d6,_0x1433f4=_0x7da96();while(!![]){try{const _0x18bb08=-parseInt(_0xa4ef00(0x1b1))/0x1+parseInt(_0xa4ef00(0x1c7))/0x2+parseInt(_0xa4ef00(0x1a3))/0x3+-parseInt(_0xa4ef00(0x19a))/0x4+parseInt(_0xa4ef00(0x1c3))/0x5*(parseInt(_0xa4ef00(0x1c2))/0x6)+-parseInt(_0xa4ef00(0x1bd))/0x7+-parseInt(_0xa4ef00(0x1ac))/0x8*(-parseInt(_0xa4ef00(0x1b7))/0x9);if(_0x18bb08===_0x5c8515)break;else _0x1433f4['push'](_0x1433f4['shift']());}catch(_0x430476){_0x1433f4['push'](_0x1433f4['shift']());}}}(a25_0x2832,0x3f0d2));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a25_0x2832(){const _0x1eeeed=['endsWith','execute','Validation\x20failed:\x20','\x20error(s)','validCount','1215512pGwCpx','warningCount','\x20non-template\x20file(s)\x20skipped','.yaml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','481604ukaZFD','template','red','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20non-template\x20file(s)\x20skipped)','valid','9JraCEm','error','.yml','✔\x20All\x20','yellow','relativePath','2550583yDzaAT','invalidCount','engage:template:validate','cwd','verbose','12ANatDP','1019595ueVJpE','reason','Error:\x20Directory\x20not\x20found:\x20','name','364614zdpZqG','skippedCount','\x20template(s)\x20with\x20errors,\x20','length','description','540564UNElyz','filter','log','green','warnings','resolve','\x20warning(s)\x20found','dim','Validate\x20template\x20YAML\x20files','1491864UqElPK','errors','\x20template(s)\x20valid','dirname'];a25_0x2832=function(){return _0x1eeeed;};return a25_0x2832();}import{existsSync}from'fs';import a25_0x1a74c7 from'chalk';import a25_0x38c04e from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x1c537f(0x1c6)]=a25_0x1c537f(0x1bf);[a25_0x1c537f(0x199)]=a25_0x1c537f(0x1a2);async[a25_0x1c537f(0x1a8)](_0x2d7ff6){const _0x2fd1dd=a25_0x1c537f,{options:_0x3f9f27,args:_0x2f712d}=_0x2d7ff6,_0x365da5=_0x3f9f27,_0x211c73=_0x2f712d[0x0],_0x3afc24=_0x211c73?a25_0x38c04e[_0x2fd1dd(0x19f)](_0x211c73):undefined,_0x132a43=_0x3afc24?isYamlFile(_0x3afc24):![];let _0x28bc6e,_0x35c9a8;if(_0x132a43&&_0x3afc24)_0x28bc6e=a25_0x38c04e[_0x2fd1dd(0x1a6)](_0x3afc24),_0x35c9a8=_0x3afc24;else _0x3afc24?_0x28bc6e=_0x3afc24:_0x28bc6e=process[_0x2fd1dd(0x1c0)]();if(!_0x35c9a8&&!existsSync(_0x28bc6e))return console[_0x2fd1dd(0x1b8)](a25_0x1a74c7[_0x2fd1dd(0x1b3)](_0x2fd1dd(0x1c5)+_0x28bc6e+'\x0a')),0x1;let _0x2f7a5c;if(_0x35c9a8){if(!_0x35c9a8['endsWith'](_0x2fd1dd(0x1b9))&&!_0x35c9a8[_0x2fd1dd(0x1a7)](_0x2fd1dd(0x1af)))return console[_0x2fd1dd(0x1b8)](a25_0x1a74c7[_0x2fd1dd(0x1b3)](_0x2fd1dd(0x1b4)+_0x35c9a8+'\x0a')),0x1;_0x2f7a5c=[_0x35c9a8];}else _0x2f7a5c=findYamlFiles(_0x28bc6e);if(_0x2f7a5c[_0x2fd1dd(0x1ca)]===0x0)return console[_0x2fd1dd(0x1b8)](a25_0x1a74c7[_0x2fd1dd(0x1b3)](_0x2fd1dd(0x1b0)+_0x28bc6e+'\x0a')),0x1;const _0x2b2ecb=validateYamlFiles(_0x2f7a5c,_0x28bc6e,{'filterType':_0x2fd1dd(0x1b2)}),_0x207f1a=calculateSummary(_0x2b2ecb),_0x4164c7=_0x2b2ecb[_0x2fd1dd(0x19b)](isValidationResult);if(_0x4164c7['length']===0x0)return console['error'](a25_0x1a74c7['yellow']('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x28bc6e+'\x0a')),_0x207f1a[_0x2fd1dd(0x1c8)]>0x0&&console[_0x2fd1dd(0x1b8)](a25_0x1a74c7[_0x2fd1dd(0x1a1)]('('+_0x207f1a[_0x2fd1dd(0x1c8)]+_0x2fd1dd(0x1b5))),0x0;for(const _0x4efe39 of _0x2b2ecb){if(!isValidationResult(_0x4efe39)){_0x365da5['verbose']&&console[_0x2fd1dd(0x19c)](a25_0x1a74c7['dim']('-\x20'+_0x4efe39[_0x2fd1dd(0x1bc)]+'\x20(skipped:\x20'+_0x4efe39[_0x2fd1dd(0x1c4)]+')'));continue;}const {relativePath:_0x339d9b,source:_0x537f10,result:_0xbfbe84}=_0x4efe39;if(_0xbfbe84[_0x2fd1dd(0x1b6)]&&_0xbfbe84[_0x2fd1dd(0x19e)][_0x2fd1dd(0x1ca)]===0x0)_0x365da5[_0x2fd1dd(0x1c1)]&&console[_0x2fd1dd(0x19c)](a25_0x1a74c7[_0x2fd1dd(0x19d)]('✔\x20'+_0x339d9b));else _0xbfbe84['valid']?(console[_0x2fd1dd(0x19c)](a25_0x1a74c7[_0x2fd1dd(0x1bb)]('⚠\x20'+_0x339d9b+':\x20'+_0xbfbe84[_0x2fd1dd(0x19e)][_0x2fd1dd(0x1ca)]+'\x20warning(s)')),console['log'](formatValidationResult(_0xbfbe84,_0x537f10,_0x339d9b))):(console[_0x2fd1dd(0x19c)](a25_0x1a74c7[_0x2fd1dd(0x1b3)]('✖\x20'+_0x339d9b+':\x20'+_0xbfbe84[_0x2fd1dd(0x1a4)]['length']+_0x2fd1dd(0x1aa))),console[_0x2fd1dd(0x19c)](formatValidationResult(_0xbfbe84,_0x537f10,_0x339d9b)));}return console[_0x2fd1dd(0x19c)](''),_0x207f1a['hasErrors']?(console['log'](a25_0x1a74c7[_0x2fd1dd(0x1b3)](_0x2fd1dd(0x1a9)+_0x207f1a[_0x2fd1dd(0x1be)]+_0x2fd1dd(0x1c9)+_0x207f1a[_0x2fd1dd(0x1ab)]+'\x20valid')),_0x207f1a[_0x2fd1dd(0x1ad)]>0x0&&console[_0x2fd1dd(0x19c)](a25_0x1a74c7[_0x2fd1dd(0x1bb)](_0x207f1a[_0x2fd1dd(0x1ad)]+_0x2fd1dd(0x1a0))),_0x207f1a[_0x2fd1dd(0x1c8)]>0x0&&console[_0x2fd1dd(0x19c)](a25_0x1a74c7['dim'](_0x207f1a['skippedCount']+_0x2fd1dd(0x1ae))),0x1):(console['log'](a25_0x1a74c7[_0x2fd1dd(0x19d)](_0x2fd1dd(0x1ba)+_0x207f1a[_0x2fd1dd(0x1ab)]+_0x2fd1dd(0x1a5))),_0x207f1a[_0x2fd1dd(0x1ad)]>0x0&&console[_0x2fd1dd(0x19c)](a25_0x1a74c7['yellow'](_0x207f1a[_0x2fd1dd(0x1ad)]+_0x2fd1dd(0x1a0))),_0x207f1a[_0x2fd1dd(0x1c8)]>0x0&&console[_0x2fd1dd(0x19c)](a25_0x1a74c7[_0x2fd1dd(0x1a1)](_0x207f1a[_0x2fd1dd(0x1c8)]+_0x2fd1dd(0x1ae))),0x0);}}
@@ -1 +1 @@
1
- const a26_0x16265d=a26_0x8100;(function(_0x126985,_0x14699d){const _0x283a9e=a26_0x8100,_0x25579b=_0x126985();while(!![]){try{const _0x45457c=-parseInt(_0x283a9e(0x1c0))/0x1*(parseInt(_0x283a9e(0x1b9))/0x2)+-parseInt(_0x283a9e(0x1a4))/0x3*(parseInt(_0x283a9e(0x1c1))/0x4)+parseInt(_0x283a9e(0x1bc))/0x5*(-parseInt(_0x283a9e(0x1ac))/0x6)+parseInt(_0x283a9e(0x1d6))/0x7*(parseInt(_0x283a9e(0x193))/0x8)+parseInt(_0x283a9e(0x1c7))/0x9+-parseInt(_0x283a9e(0x191))/0xa*(parseInt(_0x283a9e(0x1d8))/0xb)+parseInt(_0x283a9e(0x1a8))/0xc*(parseInt(_0x283a9e(0x1e7))/0xd);if(_0x45457c===_0x14699d)break;else _0x25579b['push'](_0x25579b['shift']());}catch(_0x2c1813){_0x25579b['push'](_0x25579b['shift']());}}}(a26_0xfd63,0x5dfc7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a26_0xfd63(){const _0x1f8a12=['Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','round','\x20row','success','Show\x20job\x20details','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','substring','presto','join','d\x20ago','push','130686bdOsHC','priority','✔\x20Job\x20submitted','database','44376wWFJsD','end_at','Database:\x20','trino','2999556urORqm','No\x20SQL\x20statements\x20found\x20in\x20file','map','user_name','now','job_id','args','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','start_at','site','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','execute','4BFHvjg','status','error','5wFaHCg','List\x20jobs','length','Submit\x20a\x20job','97943WYLQyx','44KQtXEV','INVALID_ARGUMENT','kill','✔\x20Retrieved\x20','jobs','getTime','5653116eoHPTE','validate','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','job:kill','\x20jobs','yes','floor','data','mo\x20ago','verbose','limit','Get\x20job\x20results','Status\x20filter:\x20','created_at','information_schema','68656aZalJO','result','133617AfpSZZ','name','type','description','file','Submitting\x20kill\x20request...','dim','Listing\x20jobs...','debug','\x20job','submit','Submitting\x20job...','\x20\x20Job\x20ID:\x20','Cancelled','Getting\x20job\x20results...','2639InqvWz','h\x20ago','url','Limit:\x20','show','just\x20now','✔\x20Found\x20','190goJGVe','query','336kIBZmh','Job\x20type:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','green','m\x20ago','abs'];a26_0xfd63=function(){return _0x1f8a12;};return a26_0xfd63();}import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x2942b7 from'chalk';function formatDuration(_0x4c4e71){const _0x486441=a26_0x8100;if(_0x4c4e71<0x3c)return _0x4c4e71+'s';if(_0x4c4e71<0xe10)return Math[_0x486441(0x1cd)](_0x4c4e71/0x3c)+'m\x20'+_0x4c4e71%0x3c+'s';const _0x315548=Math['floor'](_0x4c4e71/0xe10),_0x1bb5ca=Math[_0x486441(0x1cd)](_0x4c4e71%0xe10/0x3c);return _0x1bb5ca>0x0?_0x315548+'h\x20'+_0x1bb5ca+'m':_0x315548+'h';}function formatRelativeTime(_0x1f994f){const _0x212f80=a26_0x8100,_0x5f3e81=Date[_0x212f80(0x1b0)]()-_0x1f994f[_0x212f80(0x1c6)](),_0x4a5aee=Math[_0x212f80(0x1cd)](Math[_0x212f80(0x198)](_0x5f3e81)/0x3e8);if(_0x4a5aee<0x3c)return _0x212f80(0x1ec);const _0x5a36c3=Math[_0x212f80(0x1cd)](_0x4a5aee/0x3c);if(_0x5a36c3<0x3c)return _0x5a36c3+_0x212f80(0x197);const _0x40a5a7=Math[_0x212f80(0x1cd)](_0x5a36c3/0x3c);if(_0x40a5a7<0x18)return _0x40a5a7+_0x212f80(0x1e8);const _0x5aaf8c=Math[_0x212f80(0x1cd)](_0x40a5a7/0x18);if(_0x5aaf8c<0x1e)return _0x5aaf8c+_0x212f80(0x1a2);return Math[_0x212f80(0x1cd)](_0x5aaf8c/0x1e)+_0x212f80(0x1cf);}export class JobListCommand extends BaseCommand{[a26_0x16265d(0x1d9)]=a26_0x16265d(0x1c5);['description']=a26_0x16265d(0x1bd);async[a26_0x16265d(0x1b8)](_0x3c3f70){const _0x447bf5=a26_0x16265d,{options:_0x531024,tdx:_0x11bb08}=_0x3c3f70,_0x3f6323=resolveLimit(_0x531024[_0x447bf5(0x1d1)],DEFAULT_DISPLAY_LIMIT),_0x179dbf=_0x531024[_0x447bf5(0x1ba)];_0x531024[_0x447bf5(0x1d0)]&&(console[_0x447bf5(0x1bb)](_0x447bf5(0x1ea)+_0x3f6323+_0x447bf5(0x1cb)),_0x179dbf&&console['error'](_0x447bf5(0x1d3)+_0x179dbf));const _0x4abb8f=await withSpinner(_0x447bf5(0x1df),()=>_0x11bb08['jobs']['list']({'from':0x0,'to':_0x3f6323-0x1,'status':_0x179dbf}),{'verbose':_0x531024['verbose']}),_0x5cb73e=_0x4abb8f['data'];console[_0x447bf5(0x1bb)](_0x447bf5(0x1ed)+_0x5cb73e['length']+_0x447bf5(0x1e1)+(_0x5cb73e[_0x447bf5(0x1be)]!==0x1?'s':''));const _0x58e974=_0x531024[_0x447bf5(0x1b6)];if(isStructuredFormat(_0x531024)){const _0xe48e57=_0x5cb73e[_0x447bf5(0x1ae)](_0x52f4eb=>{const _0x2ea552=_0x447bf5;let _0xce87c5;if(_0x52f4eb['start_at']&&_0x52f4eb[_0x2ea552(0x1a9)]){const _0x50a845=new Date(_0x52f4eb['start_at'])[_0x2ea552(0x1c6)](),_0x4bd04b=new Date(_0x52f4eb[_0x2ea552(0x1a9)])[_0x2ea552(0x1c6)]();_0xce87c5=Math[_0x2ea552(0x19a)]((_0x4bd04b-_0x50a845)/0x3e8);}return{'job_id':_0x52f4eb[_0x2ea552(0x1b1)],'type':_0x52f4eb[_0x2ea552(0x1da)]===_0x2ea552(0x1a0)?_0x2ea552(0x1ab):_0x52f4eb[_0x2ea552(0x1da)],'status':_0x52f4eb[_0x2ea552(0x1ba)],'user_name':_0x52f4eb[_0x2ea552(0x1af)],'duration_sec':_0xce87c5,'created_at':_0x52f4eb['created_at'],'started_at':_0x52f4eb[_0x2ea552(0x1b5)],'end_at':_0x52f4eb[_0x2ea552(0x1a9)]};});await handleSDKOutput(_0xe48e57,_0x531024);}else for(const _0x583ce2 of _0x5cb73e){const _0x69dc07=_0x583ce2[_0x447bf5(0x1ba)]===_0x447bf5(0x19c)?a26_0x2942b7[_0x447bf5(0x196)]:_0x583ce2[_0x447bf5(0x1ba)]==='error'?a26_0x2942b7['red']:a26_0x2942b7[_0x447bf5(0x1de)],_0x201de5=_0x69dc07(_0x583ce2[_0x447bf5(0x1ba)]),_0x18908e=getJobUrl(_0x58e974,_0x583ce2[_0x447bf5(0x1b1)]),_0x2ac982=hyperlink(_0x583ce2[_0x447bf5(0x1b1)],_0x18908e),_0x1bfef2=a26_0x2942b7[_0x447bf5(0x1de)](_0x583ce2[_0x447bf5(0x1da)]===_0x447bf5(0x1a0)?_0x447bf5(0x1ab):_0x583ce2[_0x447bf5(0x1da)]),_0x10a760=[];if(_0x583ce2[_0x447bf5(0x1b5)]&&_0x583ce2[_0x447bf5(0x1a9)]){const _0x4790b5=Math[_0x447bf5(0x19a)]((new Date(_0x583ce2[_0x447bf5(0x1a9)])[_0x447bf5(0x1c6)]()-new Date(_0x583ce2[_0x447bf5(0x1b5)])[_0x447bf5(0x1c6)]())/0x3e8);_0x10a760[_0x447bf5(0x1a3)](formatDuration(_0x4790b5));}if(_0x583ce2[_0x447bf5(0x1a9)])_0x10a760['push'](formatRelativeTime(new Date(_0x583ce2[_0x447bf5(0x1a9)])));else _0x583ce2[_0x447bf5(0x1b5)]&&_0x10a760[_0x447bf5(0x1a3)](formatRelativeTime(new Date(_0x583ce2[_0x447bf5(0x1b5)])));const _0x572600=_0x10a760[_0x447bf5(0x1be)]>0x0?a26_0x2942b7[_0x447bf5(0x1de)]('\x20'+_0x10a760[_0x447bf5(0x1a1)](',\x20')):'';console['log']('⚡\x20'+_0x2ac982+'\x20'+_0x1bfef2+'\x20'+_0x201de5+_0x572600);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x16265d(0x1d9)]='job:show';[a26_0x16265d(0x1db)]=a26_0x16265d(0x19d);['validate'](_0x1aa18a){const _0x1b86b3=a26_0x16265d,_0x3528c5=_0x1aa18a[_0x1b86b3(0x1b2)][0x0];if(!_0x3528c5)return _0x1b86b3(0x195);return undefined;}async[a26_0x16265d(0x1b8)](_0x4e5270){const _0x4ebf61=a26_0x16265d,{options:_0xcc61b1,args:_0x174b35,tdx:_0x48952d}=_0x4e5270,_0x1fa0c1=_0x174b35[0x0],_0x517201=await withSpinner('Getting\x20job\x20details...',()=>_0x48952d[_0x4ebf61(0x1c5)][_0x4ebf61(0x1eb)](_0x1fa0c1),{'verbose':_0xcc61b1[_0x4ebf61(0x1d0)]}),_0x4bc12a=_0x517201[_0x4ebf61(0x1ce)];let _0x3a56c2;if(_0x4bc12a[_0x4ebf61(0x1b5)]&&_0x4bc12a['end_at']){const _0x417c4c=new Date(_0x4bc12a['start_at'])[_0x4ebf61(0x1c6)](),_0x329909=new Date(_0x4bc12a[_0x4ebf61(0x1a9)])[_0x4ebf61(0x1c6)]();_0x3a56c2=Math[_0x4ebf61(0x19a)]((_0x329909-_0x417c4c)/0x3e8);}const _0x4e75bb={'job_id':_0x4bc12a[_0x4ebf61(0x1b1)],'type':_0x4bc12a[_0x4ebf61(0x1da)],'status':_0x4bc12a[_0x4ebf61(0x1ba)],..._0x4bc12a[_0x4ebf61(0x1af)]&&{'user_name':_0x4bc12a[_0x4ebf61(0x1af)]},..._0x3a56c2!==undefined&&{'duration_sec':_0x3a56c2},..._0x4bc12a[_0x4ebf61(0x1d4)]&&{'created_at':_0x4bc12a[_0x4ebf61(0x1d4)]},..._0x4bc12a['start_at']&&{'started_at':_0x4bc12a[_0x4ebf61(0x1b5)]},..._0x4bc12a['end_at']&&{'end_at':_0x4bc12a['end_at']},..._0x4bc12a[_0x4ebf61(0x1a7)]&&{'database':_0x4bc12a[_0x4ebf61(0x1a7)]},..._0x4bc12a['priority']!==undefined&&{'priority':_0x4bc12a[_0x4ebf61(0x1a5)]},..._0x4bc12a[_0x4ebf61(0x1e9)]&&{'url':_0x4bc12a[_0x4ebf61(0x1e9)]},..._0x4bc12a['query']&&{'query':_0x4bc12a[_0x4ebf61(0x192)]},..._0x4bc12a['debug']&&{'debug':_0x4bc12a[_0x4ebf61(0x1e0)]}};return await handleSingleObjectOutput(_0x4e75bb,_0xcc61b1),0x0;}}function a26_0x8100(_0x18830e,_0x2597b8){_0x18830e=_0x18830e-0x191;const _0xfd6382=a26_0xfd63();let _0x8100c0=_0xfd6382[_0x18830e];return _0x8100c0;}export class JobKillCommand extends BaseCommand{['name']=a26_0x16265d(0x1ca);[a26_0x16265d(0x1db)]='Kill\x20a\x20job';[a26_0x16265d(0x1c8)](_0x271ca9){const _0x455754=a26_0x16265d,_0xe4488e=_0x271ca9[_0x455754(0x1b2)][0x0];if(!_0xe4488e)return _0x455754(0x19e);return undefined;}async[a26_0x16265d(0x1b8)](_0x23fe62){const _0x1c76bd=a26_0x16265d,{options:_0x28aeba,args:_0x1cddfd,tdx:_0x485fef}=_0x23fe62,_0x149ac0=_0x1cddfd[0x0];if(!_0x28aeba[_0x1c76bd(0x1cc)]){const _0x4d23bd=await confirm(_0x1c76bd(0x199)+_0x149ac0+'?');if(!_0x4d23bd)return console[_0x1c76bd(0x1bb)](_0x1c76bd(0x1e5)),0x0;}return await withSpinner(_0x1c76bd(0x1dd),()=>_0x485fef[_0x1c76bd(0x1c5)][_0x1c76bd(0x1c3)](_0x149ac0),{'verbose':_0x28aeba[_0x1c76bd(0x1d0)]}),console['error'](_0x1c76bd(0x1c9)+_0x149ac0),console[_0x1c76bd(0x1bb)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x149ac0+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a26_0x16265d(0x1db)]=a26_0x16265d(0x1bf);async['execute'](_0x3344ab){const _0x4505c3=a26_0x16265d,{options:_0x19fd4d,args:_0x35a846,tdx:_0x5318ca}=_0x3344ab,_0x8da89c=_0x19fd4d['jobType']||_0x4505c3(0x1ab),_0x2087d9=_0x19fd4d[_0x4505c3(0x1dc)],_0x57f821=_0x19fd4d['database']||_0x4505c3(0x1d5),_0x2e4b6c=_0x19fd4d[_0x4505c3(0x1d7)];if(_0x8da89c!==_0x4505c3(0x1ab)&&_0x8da89c!=='hive')throw new SDKError(ErrorCode[_0x4505c3(0x1c2)],_0x4505c3(0x1b4));let _0x45f2ae;if(_0x2087d9){if(_0x35a846[0x0])throw new SDKError(ErrorCode[_0x4505c3(0x1c2)],_0x4505c3(0x1b7));const _0x5aa022=readSqlStatementsFromFile(_0x2087d9);if(_0x5aa022[_0x4505c3(0x1be)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4505c3(0x1ad));if(_0x5aa022[_0x4505c3(0x1be)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x45f2ae=_0x5aa022[0x0];}else{if(!_0x35a846[0x0])throw new SDKError(ErrorCode[_0x4505c3(0x1c2)],_0x4505c3(0x1b3));_0x45f2ae=_0x35a846[0x0];}_0x19fd4d[_0x4505c3(0x1d0)]&&(console['error'](_0x4505c3(0x194)+_0x8da89c),console[_0x4505c3(0x1bb)](_0x4505c3(0x1aa)+_0x57f821),console[_0x4505c3(0x1bb)]('Query:\x20'+_0x45f2ae[_0x4505c3(0x19f)](0x0,0x64)+(_0x45f2ae[_0x4505c3(0x1be)]>0x64?'...':'')));const _0x11a383=await withSpinner(_0x4505c3(0x1e3),()=>_0x5318ca[_0x4505c3(0x1c5)][_0x4505c3(0x1e2)](_0x57f821,_0x45f2ae,_0x8da89c,_0x2e4b6c),{'verbose':_0x19fd4d[_0x4505c3(0x1d0)]}),_0x4685df=_0x11a383['data'];return console['error'](_0x4505c3(0x1a6)),console[_0x4505c3(0x1bb)](_0x4505c3(0x1e4)+_0x4685df[_0x4505c3(0x1b1)]),await handleSDKOutput([_0x4685df],_0x19fd4d),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x16265d(0x1d9)]='job:result';[a26_0x16265d(0x1db)]=a26_0x16265d(0x1d2);[a26_0x16265d(0x1c8)](_0x4bc829){const _0x5d335d=a26_0x16265d,_0xe49c74=_0x4bc829[_0x5d335d(0x1b2)][0x0];if(!_0xe49c74)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x16265d(0x1b8)](_0x52155b){const _0x1ce41e=a26_0x16265d,{options:_0x1b9539,args:_0x5e0f03,tdx:_0x4d0595}=_0x52155b,_0x2a4365=_0x5e0f03[0x0],_0x4b1117=await withSpinner(_0x1ce41e(0x1e6),()=>_0x4d0595[_0x1ce41e(0x1c5)][_0x1ce41e(0x1d7)](_0x2a4365),{'verbose':_0x1b9539['verbose']}),_0x697253=_0x4b1117[_0x1ce41e(0x1ce)];return console[_0x1ce41e(0x1bb)](_0x1ce41e(0x1c4)+_0x697253[_0x1ce41e(0x1be)]+_0x1ce41e(0x19b)+(_0x697253[_0x1ce41e(0x1be)]!==0x1?'s':'')),await handleSDKOutput(_0x697253,_0x1b9539),0x0;}}
1
+ function a26_0x20a8(){const _0x331575=['603578KyJQDU','validate','Query:\x20','Show\x20job\x20details','start_at','Get\x20job\x20results','round','7442855TFWCud','getTime','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','9WYQNvm','18628810LrZXxv','35076VXymWV','Getting\x20job\x20details...','Submit\x20a\x20job','user_name','substring','\x20job','1244220lwhFNP','length','job:submit','verbose','debug','database','\x20jobs','Limit:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','show','job:kill','priority','3774568LLrPlp','success','status','error','Submitting\x20kill\x20request...','description','presto','trino','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','map','end_at','1180mdjjJu','Job\x20type:\x20','push','✔\x20Job\x20submitted','h\x20ago','2IRIZLx','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','green','query','jobs','list','type','limit','m\x20ago','url','information_schema','Getting\x20job\x20results...','name','site','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','✔\x20Found\x20','result','58103507PuUTLs','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','kill','✔\x20Retrieved\x20','file','floor','Kill\x20a\x20job','8dTtffE','...','args','yes','Cancelled','job:show','execute','Submitting\x20job...','log','INVALID_ARGUMENT','job_id','dim','data'];a26_0x20a8=function(){return _0x331575;};return a26_0x20a8();}const a26_0x42f72c=a26_0x4dec;(function(_0x26d8c9,_0x1f7181){const _0x13a614=a26_0x4dec,_0x14d9eb=_0x26d8c9();while(!![]){try{const _0x5d40b6=parseInt(_0x13a614(0xc1))/0x1*(parseInt(_0x13a614(0x9c))/0x2)+parseInt(_0x13a614(0xd3))/0x3+parseInt(_0x13a614(0xdf))/0x4+parseInt(_0x13a614(0xea))/0x5*(parseInt(_0x13a614(0xcd))/0x6)+parseInt(_0x13a614(0xc8))/0x7*(parseInt(_0x13a614(0xb4))/0x8)+parseInt(_0x13a614(0xcb))/0x9*(parseInt(_0x13a614(0xcc))/0xa)+-parseInt(_0x13a614(0xad))/0xb;if(_0x5d40b6===_0x1f7181)break;else _0x14d9eb['push'](_0x14d9eb['shift']());}catch(_0x5a134e){_0x14d9eb['push'](_0x14d9eb['shift']());}}}(a26_0x20a8,0xf0a19));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x2b98b4 from'chalk';function formatDuration(_0x3fec34){const _0x4b135e=a26_0x4dec;if(_0x3fec34<0x3c)return _0x3fec34+'s';if(_0x3fec34<0xe10)return Math[_0x4b135e(0xb2)](_0x3fec34/0x3c)+'m\x20'+_0x3fec34%0x3c+'s';const _0x6ddfcf=Math[_0x4b135e(0xb2)](_0x3fec34/0xe10),_0x3cf310=Math['floor'](_0x3fec34%0xe10/0x3c);return _0x3cf310>0x0?_0x6ddfcf+'h\x20'+_0x3cf310+'m':_0x6ddfcf+'h';}function formatRelativeTime(_0x1c75ce){const _0x5e6829=a26_0x4dec,_0x227eab=Date['now']()-_0x1c75ce[_0x5e6829(0xc9)](),_0x449bb0=Math['floor'](Math['abs'](_0x227eab)/0x3e8);if(_0x449bb0<0x3c)return'just\x20now';const _0x1bad25=Math[_0x5e6829(0xb2)](_0x449bb0/0x3c);if(_0x1bad25<0x3c)return _0x1bad25+_0x5e6829(0xa4);const _0x560661=Math['floor'](_0x1bad25/0x3c);if(_0x560661<0x18)return _0x560661+_0x5e6829(0x9b);const _0x555c17=Math[_0x5e6829(0xb2)](_0x560661/0x18);if(_0x555c17<0x1e)return _0x555c17+'d\x20ago';return Math[_0x5e6829(0xb2)](_0x555c17/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{['name']='jobs';['description']='List\x20jobs';async[a26_0x42f72c(0xba)](_0x2f5252){const _0x28db30=a26_0x42f72c,{options:_0xd430e5,tdx:_0x410633}=_0x2f5252,_0x580339=resolveLimit(_0xd430e5[_0x28db30(0xa3)],DEFAULT_DISPLAY_LIMIT),_0x5f46e6=_0xd430e5['status'];_0xd430e5[_0x28db30(0xd6)]&&(console[_0x28db30(0xe2)](_0x28db30(0xda)+_0x580339+_0x28db30(0xd9)),_0x5f46e6&&console[_0x28db30(0xe2)]('Status\x20filter:\x20'+_0x5f46e6));const _0x53d9d7=await withSpinner('Listing\x20jobs...',()=>_0x410633[_0x28db30(0xa0)][_0x28db30(0xa1)]({'from':0x0,'to':_0x580339-0x1,'status':_0x5f46e6}),{'verbose':_0xd430e5[_0x28db30(0xd6)]}),_0x255dc6=_0x53d9d7['data'];console[_0x28db30(0xe2)](_0x28db30(0xab)+_0x255dc6[_0x28db30(0xd4)]+_0x28db30(0xd2)+(_0x255dc6[_0x28db30(0xd4)]!==0x1?'s':''));const _0x2a0922=_0xd430e5[_0x28db30(0xa9)];if(isStructuredFormat(_0xd430e5)){const _0x26b5f9=_0x255dc6[_0x28db30(0xe8)](_0x1b747c=>{const _0x13930a=_0x28db30;let _0x104c0b;if(_0x1b747c[_0x13930a(0xc5)]&&_0x1b747c[_0x13930a(0xe9)]){const _0x51b454=new Date(_0x1b747c[_0x13930a(0xc5)])[_0x13930a(0xc9)](),_0xaf9c90=new Date(_0x1b747c[_0x13930a(0xe9)])[_0x13930a(0xc9)]();_0x104c0b=Math['round']((_0xaf9c90-_0x51b454)/0x3e8);}return{'job_id':_0x1b747c[_0x13930a(0xbe)],'type':_0x1b747c['type']===_0x13930a(0xe5)?_0x13930a(0xe6):_0x1b747c[_0x13930a(0xa2)],'status':_0x1b747c[_0x13930a(0xe1)],'user_name':_0x1b747c[_0x13930a(0xd0)],'duration_sec':_0x104c0b,'created_at':_0x1b747c['created_at'],'started_at':_0x1b747c[_0x13930a(0xc5)],'end_at':_0x1b747c[_0x13930a(0xe9)]};});await handleSDKOutput(_0x26b5f9,_0xd430e5);}else for(const _0x4da8b2 of _0x255dc6){const _0x1e4b0d=_0x4da8b2[_0x28db30(0xe1)]===_0x28db30(0xe0)?a26_0x2b98b4[_0x28db30(0x9e)]:_0x4da8b2['status']==='error'?a26_0x2b98b4['red']:a26_0x2b98b4[_0x28db30(0xbf)],_0x57ae79=_0x1e4b0d(_0x4da8b2[_0x28db30(0xe1)]),_0x14063f=getJobUrl(_0x2a0922,_0x4da8b2['job_id']),_0x426793=hyperlink(_0x4da8b2[_0x28db30(0xbe)],_0x14063f),_0x51f49d=a26_0x2b98b4['dim'](_0x4da8b2[_0x28db30(0xa2)]===_0x28db30(0xe5)?_0x28db30(0xe6):_0x4da8b2[_0x28db30(0xa2)]),_0x3e7435=[];if(_0x4da8b2['start_at']&&_0x4da8b2[_0x28db30(0xe9)]){const _0x375427=Math['round']((new Date(_0x4da8b2['end_at'])['getTime']()-new Date(_0x4da8b2[_0x28db30(0xc5)])[_0x28db30(0xc9)]())/0x3e8);_0x3e7435[_0x28db30(0x99)](formatDuration(_0x375427));}if(_0x4da8b2['end_at'])_0x3e7435[_0x28db30(0x99)](formatRelativeTime(new Date(_0x4da8b2['end_at'])));else _0x4da8b2['start_at']&&_0x3e7435[_0x28db30(0x99)](formatRelativeTime(new Date(_0x4da8b2[_0x28db30(0xc5)])));const _0x3c47c7=_0x3e7435['length']>0x0?a26_0x2b98b4[_0x28db30(0xbf)]('\x20'+_0x3e7435['join'](',\x20')):'';console[_0x28db30(0xbc)]('⚡\x20'+_0x426793+'\x20'+_0x51f49d+'\x20'+_0x57ae79+_0x3c47c7);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a26_0x42f72c(0xb9);[a26_0x42f72c(0xe4)]=a26_0x42f72c(0xc4);[a26_0x42f72c(0xc2)](_0x495e74){const _0x397414=a26_0x42f72c,_0x1fa363=_0x495e74[_0x397414(0xb6)][0x0];if(!_0x1fa363)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0x42f72c(0xba)](_0x79e4cc){const _0x4baadc=a26_0x42f72c,{options:_0x24b203,args:_0x3cec96,tdx:_0x1e144c}=_0x79e4cc,_0xae8ba6=_0x3cec96[0x0],_0x282476=await withSpinner(_0x4baadc(0xce),()=>_0x1e144c['jobs'][_0x4baadc(0xdc)](_0xae8ba6),{'verbose':_0x24b203[_0x4baadc(0xd6)]}),_0x1e9a90=_0x282476[_0x4baadc(0xc0)];let _0x15a67c;if(_0x1e9a90[_0x4baadc(0xc5)]&&_0x1e9a90[_0x4baadc(0xe9)]){const _0xd7c1bd=new Date(_0x1e9a90[_0x4baadc(0xc5)])[_0x4baadc(0xc9)](),_0x253e52=new Date(_0x1e9a90[_0x4baadc(0xe9)])['getTime']();_0x15a67c=Math[_0x4baadc(0xc7)]((_0x253e52-_0xd7c1bd)/0x3e8);}const _0x16612f={'job_id':_0x1e9a90[_0x4baadc(0xbe)],'type':_0x1e9a90[_0x4baadc(0xa2)],'status':_0x1e9a90[_0x4baadc(0xe1)],..._0x1e9a90[_0x4baadc(0xd0)]&&{'user_name':_0x1e9a90[_0x4baadc(0xd0)]},..._0x15a67c!==undefined&&{'duration_sec':_0x15a67c},..._0x1e9a90['created_at']&&{'created_at':_0x1e9a90['created_at']},..._0x1e9a90[_0x4baadc(0xc5)]&&{'started_at':_0x1e9a90[_0x4baadc(0xc5)]},..._0x1e9a90['end_at']&&{'end_at':_0x1e9a90[_0x4baadc(0xe9)]},..._0x1e9a90[_0x4baadc(0xd8)]&&{'database':_0x1e9a90[_0x4baadc(0xd8)]},..._0x1e9a90['priority']!==undefined&&{'priority':_0x1e9a90[_0x4baadc(0xde)]},..._0x1e9a90[_0x4baadc(0xa5)]&&{'url':_0x1e9a90[_0x4baadc(0xa5)]},..._0x1e9a90[_0x4baadc(0x9f)]&&{'query':_0x1e9a90[_0x4baadc(0x9f)]},..._0x1e9a90[_0x4baadc(0xd7)]&&{'debug':_0x1e9a90[_0x4baadc(0xd7)]}};return await handleSingleObjectOutput(_0x16612f,_0x24b203),0x0;}}function a26_0x4dec(_0x29f306,_0x4755c7){_0x29f306=_0x29f306-0x98;const _0x20a844=a26_0x20a8();let _0x4dec01=_0x20a844[_0x29f306];return _0x4dec01;}export class JobKillCommand extends BaseCommand{[a26_0x42f72c(0xa8)]=a26_0x42f72c(0xdd);[a26_0x42f72c(0xe4)]=a26_0x42f72c(0xb3);[a26_0x42f72c(0xc2)](_0x468819){const _0x4563d6=a26_0x42f72c,_0x4b67ae=_0x468819[_0x4563d6(0xb6)][0x0];if(!_0x4b67ae)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a26_0x42f72c(0xba)](_0x56f666){const _0x24c31c=a26_0x42f72c,{options:_0xe4b58e,args:_0x3c0f7e,tdx:_0x5f18e6}=_0x56f666,_0x3ccdfe=_0x3c0f7e[0x0];if(!_0xe4b58e[_0x24c31c(0xb7)]){const _0x2882f4=await confirm(_0x24c31c(0xdb)+_0x3ccdfe+'?');if(!_0x2882f4)return console['error'](_0x24c31c(0xb8)),0x0;}return await withSpinner(_0x24c31c(0xe3),()=>_0x5f18e6[_0x24c31c(0xa0)][_0x24c31c(0xaf)](_0x3ccdfe),{'verbose':_0xe4b58e[_0x24c31c(0xd6)]}),console[_0x24c31c(0xe2)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x3ccdfe),console[_0x24c31c(0xe2)](_0x24c31c(0x9d)+_0x3ccdfe+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x42f72c(0xa8)]=a26_0x42f72c(0xd5);['description']=a26_0x42f72c(0xcf);async[a26_0x42f72c(0xba)](_0x4bf657){const _0x2aaabb=a26_0x42f72c,{options:_0x64990a,args:_0x959fd4,tdx:_0x78dcee}=_0x4bf657,_0x3131f4=_0x64990a['jobType']||_0x2aaabb(0xe6),_0x3a40e4=_0x64990a[_0x2aaabb(0xb1)],_0x20cb7a=_0x64990a[_0x2aaabb(0xd8)]||_0x2aaabb(0xa6),_0x13451f=_0x64990a[_0x2aaabb(0xac)];if(_0x3131f4!==_0x2aaabb(0xe6)&&_0x3131f4!=='hive')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2aaabb(0xaa));let _0x4793c9;if(_0x3a40e4){if(_0x959fd4[0x0])throw new SDKError(ErrorCode[_0x2aaabb(0xbd)],_0x2aaabb(0xca));const _0x3d07b8=readSqlStatementsFromFile(_0x3a40e4);if(_0x3d07b8['length']===0x0)throw new SDKError(ErrorCode[_0x2aaabb(0xbd)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x3d07b8[_0x2aaabb(0xd4)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x4793c9=_0x3d07b8[0x0];}else{if(!_0x959fd4[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2aaabb(0xae));_0x4793c9=_0x959fd4[0x0];}_0x64990a[_0x2aaabb(0xd6)]&&(console['error'](_0x2aaabb(0x98)+_0x3131f4),console[_0x2aaabb(0xe2)]('Database:\x20'+_0x20cb7a),console[_0x2aaabb(0xe2)](_0x2aaabb(0xc3)+_0x4793c9[_0x2aaabb(0xd1)](0x0,0x64)+(_0x4793c9[_0x2aaabb(0xd4)]>0x64?_0x2aaabb(0xb5):'')));const _0x57be4c=await withSpinner(_0x2aaabb(0xbb),()=>_0x78dcee[_0x2aaabb(0xa0)]['submit'](_0x20cb7a,_0x4793c9,_0x3131f4,_0x13451f),{'verbose':_0x64990a[_0x2aaabb(0xd6)]}),_0x3a1067=_0x57be4c[_0x2aaabb(0xc0)];return console[_0x2aaabb(0xe2)](_0x2aaabb(0x9a)),console[_0x2aaabb(0xe2)]('\x20\x20Job\x20ID:\x20'+_0x3a1067['job_id']),await handleSDKOutput([_0x3a1067],_0x64990a),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x42f72c(0xa8)]='job:result';['description']=a26_0x42f72c(0xc6);[a26_0x42f72c(0xc2)](_0x4c5c9c){const _0x460d6c=a26_0x42f72c,_0xe65a68=_0x4c5c9c['args'][0x0];if(!_0xe65a68)return _0x460d6c(0xe7);return undefined;}async[a26_0x42f72c(0xba)](_0xb96557){const _0xff61da=a26_0x42f72c,{options:_0x11db6c,args:_0x210314,tdx:_0xfa9bff}=_0xb96557,_0x387a4f=_0x210314[0x0],_0xa72318=await withSpinner(_0xff61da(0xa7),()=>_0xfa9bff[_0xff61da(0xa0)][_0xff61da(0xac)](_0x387a4f),{'verbose':_0x11db6c[_0xff61da(0xd6)]}),_0x2b6625=_0xa72318[_0xff61da(0xc0)];return console[_0xff61da(0xe2)](_0xff61da(0xb0)+_0x2b6625[_0xff61da(0xd4)]+'\x20row'+(_0x2b6625['length']!==0x1?'s':'')),await handleSDKOutput(_0x2b6625,_0x11db6c),0x0;}}
@@ -1 +1 @@
1
- const a27_0x4c00bc=a27_0x30cf;(function(_0x4a6289,_0x3c0b3d){const _0x1087cb=a27_0x30cf,_0x2222ea=_0x4a6289();while(!![]){try{const _0x87ac3=parseInt(_0x1087cb(0xb1))/0x1*(parseInt(_0x1087cb(0x12d))/0x2)+-parseInt(_0x1087cb(0x120))/0x3+-parseInt(_0x1087cb(0x155))/0x4+-parseInt(_0x1087cb(0x112))/0x5+-parseInt(_0x1087cb(0xee))/0x6*(-parseInt(_0x1087cb(0x185))/0x7)+-parseInt(_0x1087cb(0xca))/0x8+parseInt(_0x1087cb(0xfd))/0x9;if(_0x87ac3===_0x3c0b3d)break;else _0x2222ea['push'](_0x2222ea['shift']());}catch(_0xe5061a){_0x2222ea['push'](_0x2222ea['shift']());}}}(a27_0x3305,0xe4106));import a27_0x2a8216 from'chalk';import a27_0x576223 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a27_0x30cf(_0x545530,_0x11e852){_0x545530=_0x545530-0x7f;const _0x33058e=a27_0x3305();let _0x30cf80=_0x33058e[_0x545530];return _0x30cf80;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl,getWorkflowSessionUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x1b85ed){const _0x3ac23d=a27_0x30cf;return!_0x1b85ed&&(console[_0x3ac23d(0x133)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x3ac23d(0x133)](_0x3ac23d(0x13b))),!!_0x1b85ed;}function withJsonFormat(_0x1f96f6){const _0xc4ef96=a27_0x30cf;if(!_0x1f96f6[_0xc4ef96(0xb9)]&&!_0x1f96f6[_0xc4ef96(0xeb)]&&!_0x1f96f6[_0xc4ef96(0x138)]&&!_0x1f96f6['tsv'])return{..._0x1f96f6,'format':_0xc4ef96(0xeb),'json':!![]};return _0x1f96f6;}function formatJourneyState(_0x28c779){const _0x249294=a27_0x30cf;switch(_0x28c779){case'launched':return a27_0x2a8216['green'](_0x249294(0xf3));case _0x249294(0x93):return a27_0x2a8216[_0x249294(0x10e)](_0x249294(0xc8));case _0x249294(0xc5):return a27_0x2a8216[_0x249294(0xa6)]('(paused)');case _0x249294(0x163):return a27_0x2a8216['blue'](_0x249294(0x95));case'archived':return a27_0x2a8216[_0x249294(0x10e)](_0x249294(0xbd));default:return'('+_0x28c779+')';}}function a27_0x3305(){const _0x4cf7c0=['INVALID_ARGUMENT','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','add','\x20\x20Name:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','cwd','options','connectionId','nodes','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','2YEOFNP','\x20->\x20','runAfterJourneyRefresh','updatedAt','journeyStages','session','error','/app/ps/','runAt','setPhase','journey:columns','jsonl','links','folderPath','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','attributes','enteredSize','Paused\x20at:','exitOrJumpRate','status','tdx.json','completeMilestoneRate','Fetching\x20','\x20\x20Statistics\x20not\x20available','Getting\x20journey\x20traffic\x20data...','journey:stats','(unnamed)','\x20\x20←\x20','parentName','rule','columns','Error:\x20Version\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','replace','\x20\x20Journey\x20ID:\x20','journey:resume','audienceId','entries','no\x20connection','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','5762364ApoJdS','parent_segment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Table:\x20','base','\x5c$&','listVersions','scheduleType','yes','Listing\x20journey\x20activations...','type','Error:\x20Invalid\x20version\x20number:\x20','join','set','completed','Warning:\x20Could\x20not\x20resolve\x20activation\x20','📁\x20','reentryMode','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','getColumnMapping','\x20[runs\x20on\x20refresh]','\x20activation','resolveParentId','milestoneSize','push','Getting\x20journey\x20statistics...','history',',\x20schedule:\x20','includeStats','no_parent','dryRun','\x20changed\x20files','Input:\x20','executeDryRun','State:','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','workflowSessionId','\x20details...','⚠️\x20','Listing\x20journeys...','Session:','getStatistics','Listing\x20journey\x20versions...','Pattern:\x20','size','get','Error:\x20Journey\x20not\x20found:\x20','site','10815791HrfIyJ','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20not\x20found.\x20Available:\x20','\x0aError:','stages','kind','createVersion','segments','journey:view','file','\x20=\x20','\x20(rule\x20match)','Aborted.','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','No\x20statistics\x20available\x20for\x20journey:\x20','\x20\x20Target:\x20','Resolving\x20parent\x20segment...','bold','Error:\x20Stage\x20\x22','verbose','state','\x20journey\x20files\x20to\x20','message','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','pausedAt','root\x20folder','data','green','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Getting\x20journey\x20details...','red','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','map','Options:','activation','Folder\x20path:\x20','resume','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','cyan','listActivationsFlat','content','\x20unchanged\x20files','resolveSegment','.yml','getParentFull','journey:pull','relativePath','ID:','utf-8','absolutePath','folderId','\x20Opening\x20','all','draft','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','(completed)','\x20@\x20','\x20(ID:\x20','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','buildIdToEmailMap','versionNumber','segmentPushCommand','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','version','Error:\x20Journey\x20\x27','values','exitOrJumpSize','Export\x20journey(s)\x20as\x20YAML\x20files','pause','description','getActivation','yellow','Paused:','length','table','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Error:\x20Invalid\x20--type\x20\x22','connection','name','Resolved\x20YAML\x20file:\x20','sort','Cancelled','1122123Ijfsdv','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','/j/da','journeyName','...','Activations:','folders','Fetching\x20journeys\x20and\x20folders...','format','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Write\x20','Error:\x20','(archived)','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','journeys','\x20\x20-\x20','resolveJourneyId','conversion','journey:list','has','paused','✔\x20Journey\x20\x22','Resuming\x20journey...','(draft)','Fetching\x20journey\x20','9789688QkEbcT','buildIdToNameMap','parentSegment','-\x20no\x20files\x20written','journeyId','getLatestJourneyId','Parent\x20segment\x20ID:','listJourneysWithFolders','/e/','segment','hasPeriod','\x20\x20Parent\x20segment:\x20','filePath','targetDir','split','Triggering\x20journey\x20workflow...','then','hasChanges','createdAt','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','repeat','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Getting\x20version\x20','filter','Resume\x20a\x20paused\x20journey','✔\x20Context\x20set:\x20','Target\x20file:\x20','goal','Show\x20journey\x20details','journey','journeyBundleId','✔\x20Found\x20','stringify','json','/j/da/je','Error:\x20Parent\x20segment\x20context\x20required','6vOsVuw','connector_config','\x20journeys','segmentName','\x20\x20Folder\x20path:\x20','(running)','\x20Created\x20v','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','connection\x20','List\x20all\x20versions\x20of\x20a\x20journey','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','rootFolderId','Target\x20directory:\x20','args','goalSize','26527527iBcUtt','Stages:','toLowerCase','Show\x20journey\x20statistics','find','✔\x20Pulled\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','execute','No\x20journeys\x20found','relative','Fetching\x20users\x20and\x20connections...','journey:pause','log','database','limit','\x0aPull\x20summary:','getJourney','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Pause\x20a\x20running\x20journey','Getting\x20column\x20mapping...','7564015jaHvxd','Journey:','\x0aChanges\x20to\x20\x27','journey:run','diff','\x27\x20not\x20found\x20in\x20','isNew','(root)','getTrafficData','Resolving\x20version...','\x20version','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','Creating\x20new\x20version...','journeyBundleName','1510452xnwukj'];a27_0x3305=function(){return _0x4cf7c0;};return a27_0x3305();}function formatJourneyItem(_0x354753,_0x346a84='',_0x2a4579){const _0xa0568f=a27_0x30cf,_0x51d9d6=formatJourneyState(_0x354753[_0xa0568f(0x199)]),_0x2cf954=_0x2a4579?hyperlink(_0x354753['journeyBundleName'],_0x2a4579):_0x354753[_0xa0568f(0x11f)];return _0x346a84+'🗺️\x20'+_0x2cf954+'\x20'+_0x51d9d6;}function escapeRegex(_0x38ed11){const _0x9ed1a3=a27_0x30cf;return _0x38ed11[_0x9ed1a3(0x14e)](/[.*+?^${}()|[\]\\]/g,_0x9ed1a3(0x15a));}function globToRegex(_0x1e76e2){const _0x43dbc0=a27_0x30cf,_0x3f5d4d=_0x1e76e2[_0x43dbc0(0xd8)]('*')[_0x43dbc0(0x1a5)](escapeRegex);return new RegExp(_0x3f5d4d[_0x43dbc0(0x161)]('.*'),'i');}function buildRuleToNameMapping(_0x3296f4){const _0x4d3665=a27_0x30cf,_0x3ef412=new Map();if(_0x3296f4[_0x4d3665(0x18c)])for(const [_0x335178,_0x2a480a]of Object['entries'](_0x3296f4[_0x4d3665(0x18c)])){if(_0x2a480a[_0x4d3665(0x14a)]){const _0x59531c=serializeRule(_0x2a480a[_0x4d3665(0x14a)]),_0x2119f9=_0x3ef412[_0x4d3665(0x182)](_0x59531c);_0x2119f9?_0x2119f9['push'](_0x335178):_0x3ef412[_0x4d3665(0x162)](_0x59531c,[_0x335178]);}}return _0x3ef412;}async function resolveJourneyIdFromInput(_0x16b1d9,_0x3010d0,_0x4d30ca){const _0x17c480=a27_0x30cf,_0xc7fb49=await resolveJourneyTarget(_0x16b1d9,_0x3010d0['parentSegment'],_0x3010d0[_0x17c480(0x198)]),_0x1bcf60=_0xc7fb49[_0x17c480(0xcc)];if(!_0x1bcf60)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x17c480(0xf8));const _0x1955a3=await withSpinner(_0x17c480(0x195),()=>_0x4d30ca[_0x17c480(0xd3)][_0x17c480(0x16b)](_0x1bcf60),{'verbose':_0x3010d0[_0x17c480(0x198)]}),_0x870977=_0x1955a3['data'],_0x1022f5=await withSpinner('Resolving\x20journey...',()=>_0x4d30ca[_0x17c480(0xe7)][_0x17c480(0xc1)](_0x870977,_0xc7fb49[_0x17c480(0xb4)]),{'verbose':_0x3010d0[_0x17c480(0x198)]});return{'journeyId':_0x1022f5[_0x17c480(0x19f)],'journeyName':_0xc7fb49['journeyName'],'parentSegmentId':_0x870977};}async function resolveJourneyTarget(_0x3b8ebc,_0x4a906c,_0x166acc){const _0x39096d=a27_0x30cf;if(isYamlFilePath(_0x3b8ebc))try{const _0x1386da=await resolveYamlFilePath(_0x3b8ebc);return _0x166acc&&(console['error'](_0x39096d(0xae)+_0x3b8ebc),console[_0x39096d(0x133)](_0x39096d(0xd5)+_0x1386da['parentSegment']),console[_0x39096d(0x133)](_0x39096d(0x126)+_0x1386da[_0x39096d(0xf1)]),console[_0x39096d(0x133)](_0x39096d(0xf2)+(_0x1386da[_0x39096d(0x13a)]||_0x39096d(0x119)))),{'journeyName':_0x1386da[_0x39096d(0xf1)],'parentSegment':_0x1386da[_0x39096d(0xcc)],'resolved':_0x1386da};}catch(_0x28780f){throw new SDKError(ErrorCode[_0x39096d(0x121)],_0x39096d(0x94)+_0x28780f[_0x39096d(0x19b)]);}if(!_0x4a906c)throw new SDKError(ErrorCode[_0x39096d(0x121)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x3b8ebc,'parentSegment':_0x4a906c};}export class JourneyListCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0xc3);[a27_0x4c00bc(0xa4)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x4c00bc(0x104)](_0x34eedd){const _0x1df8a5=a27_0x4c00bc,{options:_0xcce67b,args:_0x33cf1f,tdx:_0x18dff6}=_0x34eedd,_0x20bd53=_0x33cf1f[0x0],_0x11f51e=_0xcce67b['parentSegment'];if(!_0x11f51e)return console[_0x1df8a5(0x133)](_0x1df8a5(0xed)),console[_0x1df8a5(0x133)](_0x1df8a5(0x124)),0x1;const _0x41d0a2=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x18dff6['segment'][_0x1df8a5(0x16b)](_0x11f51e),{'verbose':_0xcce67b['verbose']}),_0x73cff=_0x41d0a2[_0x1df8a5(0x19f)];_0xcce67b[_0x1df8a5(0x198)]&&(console[_0x1df8a5(0x133)]('Parent\x20segment:\x20'+_0x11f51e+_0x1df8a5(0x97)+_0x73cff+')'),_0x20bd53&&console[_0x1df8a5(0x133)](_0x1df8a5(0x180)+_0x20bd53));const _0x1fe90a=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x18dff6[_0x1df8a5(0xd3)][_0x1df8a5(0x8a)](_0x73cff),{'verbose':_0xcce67b[_0x1df8a5(0x198)]}),_0x2a4aef=_0x1fe90a[_0x1df8a5(0x19f)],_0x2e667a=_0x2a4aef[_0x1df8a5(0xf9)],_0x4a0782=await withSpinner(_0x1df8a5(0x17c),()=>_0x18dff6[_0x1df8a5(0xe7)][_0x1df8a5(0xd1)](_0x73cff,_0x2e667a),{'verbose':_0xcce67b[_0x1df8a5(0x198)]});let _0x39e614=_0x4a0782['data'][_0x1df8a5(0xbf)];const _0x42914f=_0x4a0782['data'][_0x1df8a5(0xb7)],_0x119a21=new Map();for(const _0x5df9c8 of _0x42914f){_0x119a21[_0x1df8a5(0x162)](_0x5df9c8['id'],_0x5df9c8['name']);}if(_0x20bd53){const _0x28424e=globToRegex(_0x20bd53);_0x39e614=_0x39e614['filter'](_0x176e23=>_0x28424e['test'](_0x176e23['journeyBundleName']));}console[_0x1df8a5(0x133)](_0x1df8a5(0xe9)+_0x39e614[_0x1df8a5(0xa8)]+'\x20journey'+(_0x39e614[_0x1df8a5(0xa8)]!==0x1?'s':''));const _0x3f6691=_0x18c785=>{const _0x32a9e1=_0x1df8a5;return getConsoleNextUrl(_0xcce67b[_0x32a9e1(0x184)],_0x32a9e1(0x134)+_0x73cff+_0x32a9e1(0xd2)+_0x18c785+_0x32a9e1(0xb3));};if(_0xcce67b[_0x1df8a5(0xb9)]===_0x1df8a5(0xa9))await handleSDKOutput(_0x39e614,_0xcce67b);else{if(_0xcce67b[_0x1df8a5(0xb9)]===_0x1df8a5(0xeb)){const _0x4d0f10=_0x39e614[_0x1df8a5(0x1a5)](_0x3f7ced=>({..._0x3f7ced,'url':_0x3f6691(_0x3f7ced['id'])}));await handleSDKOutput(_0x4d0f10,_0xcce67b);}else{console['log']('['+_0x11f51e+']');const _0xeb899f=new Map(),_0x579e1d=[];for(const _0xc41cf9 of _0x39e614){if(!_0xc41cf9[_0x1df8a5(0x90)]||_0xc41cf9[_0x1df8a5(0x90)]===_0x2e667a)_0x579e1d[_0x1df8a5(0x16d)](_0xc41cf9);else{const _0x29f0f9=_0xeb899f['get'](_0xc41cf9[_0x1df8a5(0x90)])||[];_0x29f0f9[_0x1df8a5(0x16d)](_0xc41cf9),_0xeb899f[_0x1df8a5(0x162)](_0xc41cf9[_0x1df8a5(0x90)],_0x29f0f9);}}const _0x6f3ee0=(_0xc3fd54,_0xe4df71)=>_0xc3fd54[_0x1df8a5(0x11f)]['localeCompare'](_0xe4df71[_0x1df8a5(0x11f)],undefined,{'sensitivity':'base'});_0x579e1d[_0x1df8a5(0xaf)](_0x6f3ee0);for(const _0x25bc95 of _0x579e1d){console[_0x1df8a5(0x109)](formatJourneyItem(_0x25bc95,'',_0x3f6691(_0x25bc95['id'])));}const _0x11bd3b=[..._0xeb899f[_0x1df8a5(0x152)]()]['sort']((_0x28104e,_0x196c41)=>{const _0x24f953=_0x1df8a5,_0x12cda6=_0x119a21[_0x24f953(0x182)](_0x28104e[0x0])||_0x28104e[0x0],_0x24c1f7=_0x119a21[_0x24f953(0x182)](_0x196c41[0x0])||_0x196c41[0x0];return _0x12cda6['localeCompare'](_0x24c1f7,undefined,{'sensitivity':_0x24f953(0x159)});});for(const [_0x279d25,_0x1e662d]of _0x11bd3b){const _0xc021ab=_0x119a21['get'](_0x279d25)||_0x279d25;console[_0x1df8a5(0x109)](_0x1df8a5(0x165)+_0xc021ab),_0x1e662d[_0x1df8a5(0xaf)](_0x6f3ee0);for(const _0x6d7c81 of _0x1e662d){console[_0x1df8a5(0x109)](formatJourneyItem(_0x6d7c81,'\x20\x20',_0x3f6691(_0x6d7c81['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x18d);['description']=a27_0x4c00bc(0xe6);async[a27_0x4c00bc(0x104)](_0x283d23){const _0x1b918f=a27_0x4c00bc,{options:_0x55cdbf,args:_0x2b140d,tdx:_0x3bd2af}=_0x283d23,_0x54eb6b=_0x2b140d[0x0];if(!_0x54eb6b)return console[_0x1b918f(0x133)](_0x1b918f(0xf5)),console[_0x1b918f(0x133)](_0x1b918f(0x192)),console[_0x1b918f(0x133)](_0x1b918f(0x7f)),console['error'](_0x1b918f(0x154)),0x1;_0x55cdbf[_0x1b918f(0x198)]&&console[_0x1b918f(0x133)](_0x1b918f(0x175)+_0x54eb6b);const {journeyId:_0x5e4e93,parentSegmentId:_0x3a15c2}=await resolveJourneyIdFromInput(_0x54eb6b,_0x55cdbf,_0x3bd2af);if(_0x55cdbf['web']){const _0x141319=getConsoleNextUrl(_0x55cdbf[_0x1b918f(0x184)],'/app/ps/'+_0x3a15c2+_0x1b918f(0xd2)+_0x5e4e93+_0x1b918f(0xec));return console[_0x1b918f(0x133)](a27_0x2a8216['green']('✔')+_0x1b918f(0x91)+a27_0x2a8216[_0x1b918f(0x84)](_0x141319)),openBrowser(_0x141319),0x0;}const _0x160599=await withSpinner(_0x1b918f(0x1a2),()=>_0x3bd2af[_0x1b918f(0xe7)][_0x1b918f(0x10d)](_0x5e4e93),{'verbose':_0x55cdbf[_0x1b918f(0x198)]}),_0x21e039=_0x160599[_0x1b918f(0x19f)],_0x551b27=_0x55cdbf[_0x1b918f(0x171)];let _0x5636dc;if(_0x551b27)try{const _0x540f5b=await withSpinner(_0x1b918f(0x16e),()=>_0x3bd2af[_0x1b918f(0xe7)][_0x1b918f(0x17e)](_0x5e4e93),{'verbose':_0x55cdbf[_0x1b918f(0x198)]});_0x5636dc=_0x540f5b['data'];}catch{_0x55cdbf[_0x1b918f(0x198)]&&console[_0x1b918f(0x133)](_0x1b918f(0x144));}const _0x4ad5d6=getConsoleNextUrl(_0x55cdbf[_0x1b918f(0x184)],'/app/ps/'+_0x3a15c2+_0x1b918f(0xd2)+_0x5e4e93+'/j/da/je'),_0x289f9c={'id':_0x21e039['id'],'name':_0x21e039['attributes']['name'],'description':_0x21e039[_0x1b918f(0x13c)][_0x1b918f(0xa4)],'state':_0x21e039['attributes'][_0x1b918f(0x199)],'paused':_0x21e039[_0x1b918f(0x13c)][_0x1b918f(0xc5)],'reentry_mode':_0x21e039[_0x1b918f(0x13c)]['reentryMode'],'stages':_0x21e039[_0x1b918f(0x13c)][_0x1b918f(0x131)]?.['length']||0x0,..._0x21e039[_0x1b918f(0x13c)][_0x1b918f(0xe5)]&&{'goal':_0x21e039[_0x1b918f(0x13c)]['goal']['name']},..._0x5636dc&&{'statistics':{'size':_0x5636dc[_0x1b918f(0x181)],'entered':_0x5636dc[_0x1b918f(0x13d)],'goal_achieved':_0x5636dc[_0x1b918f(0xfc)],'completion_rate':_0x5636dc['completionRate'],'exit_or_jump':_0x5636dc[_0x1b918f(0xa1)],'exit_or_jump_rate':_0x5636dc[_0x1b918f(0x13f)],'stages':_0x5636dc['stages']}},'url':_0x4ad5d6};return await handleSingleObjectOutput(_0x289f9c,_0x55cdbf),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x146);[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x100);async[a27_0x4c00bc(0x104)](_0x2a93cf){const _0x506c7d=a27_0x4c00bc,{options:_0x52ce2d,args:_0x95fdb9,tdx:_0x4f107f}=_0x2a93cf,_0x3429ac=_0x95fdb9[0x0];if(!requireNameOrPath(_0x3429ac))return 0x1;_0x52ce2d['verbose']&&console[_0x506c7d(0x133)]('Input:\x20'+_0x3429ac);const _0x18a128=_0x52ce2d,_0x3899e3=_0x18a128['from'],_0x37f692=_0x18a128['to'],_0x32b0f0=_0x18a128['includeHistory'],_0x243188=_0x18a128['stage'];_0x32b0f0&&!_0x3899e3&&!_0x37f692&&console[_0x506c7d(0x133)](_0x506c7d(0x186));const _0x16a83d=_0x32b0f0?withJsonFormat(_0x52ce2d):_0x52ce2d,{journeyId:_0x35069f,journeyName:_0x4d11ea}=await resolveJourneyIdFromInput(_0x3429ac,_0x16a83d,_0x4f107f),_0x4133e0=_0x3899e3||_0x37f692?{'from':_0x3899e3,'to':_0x37f692}:undefined,_0xcb816=await withSpinner(_0x506c7d(0x16e),()=>Promise[_0x506c7d(0x92)]([_0x4f107f[_0x506c7d(0xe7)][_0x506c7d(0x10d)](_0x35069f),_0x4f107f[_0x506c7d(0xe7)][_0x506c7d(0x17e)](_0x35069f,_0x4133e0)]),{'verbose':_0x16a83d['verbose']}),[_0x448f82,_0x483c24]=_0xcb816[_0x506c7d(0x19f)];if(!_0x483c24||_0x483c24[_0x506c7d(0xce)]===null)return console[_0x506c7d(0x133)](_0x506c7d(0x193)+_0x4d11ea),console[_0x506c7d(0x133)](_0x506c7d(0x178)),0x0;const _0x4b02e3=buildStageNameMap(_0x448f82),_0x3fb926=!!(_0x4133e0&&_0x483c24['history']?.[_0x506c7d(0xa8)]),_0x1f205d={'stageNameMap':_0x4b02e3,'hasPeriod':_0x3fb926,'includeHistory':!!_0x32b0f0};if(_0x243188&&_0x483c24[_0x506c7d(0x189)]){const _0x598661=_0x483c24[_0x506c7d(0x189)]['find'](_0x518f93=>{const _0x1b889a=_0x506c7d,_0x2501c2=_0x4b02e3[_0x1b889a(0x182)](_0x518f93['id'])??'';return _0x2501c2['toLowerCase']()===_0x243188['toLowerCase']();});if(_0x598661)return await handleSingleObjectOutput(formatStageStats(_0x598661,_0x1f205d),_0x16a83d),0x0;const _0x154a00=_0x483c24[_0x506c7d(0x189)]['map'](_0x597956=>_0x4b02e3['get'](_0x597956['id'])??_0x597956['id']);return console[_0x506c7d(0x133)](_0x506c7d(0x197)+_0x243188+'\x22\x20not\x20found'),console['error']('Available\x20stages:\x20'+_0x154a00[_0x506c7d(0x161)](',\x20')),0x1;}const _0x416fc8=_0x483c24[_0x506c7d(0x189)]?.['map'](_0x1df05e=>formatStageStats(_0x1df05e,_0x1f205d)),_0x573aa2=assembleJourneyStats(_0x483c24,{'from':_0x3899e3,'to':_0x37f692,'includeHistory':_0x32b0f0});return await this['renderStats'](_0x573aa2,_0x416fc8??[],_0x16a83d),0x0;}async['renderStats'](_0x4a22d9,_0x5b2d5c,_0x41c24e){const _0x33de08=a27_0x4c00bc,_0x15c9fc=_0x41c24e['format']===_0x33de08(0xeb)||_0x41c24e[_0x33de08(0xb9)]===_0x33de08(0x138)||_0x41c24e[_0x33de08(0xeb)]||_0x41c24e[_0x33de08(0x138)];if(_0x15c9fc){_0x4a22d9[_0x33de08(0x189)]=_0x5b2d5c,await handleSingleObjectOutput(_0x4a22d9,_0x41c24e);return;}await handleSingleObjectOutput(_0x4a22d9,_0x41c24e);for(const _0x44f03a of _0x5b2d5c){console[_0x33de08(0x109)](''),console[_0x33de08(0x109)](String(a27_0x2a8216[_0x33de08(0x84)][_0x33de08(0x196)]('['+_0x44f03a[_0x33de08(0xad)]+']'))+a27_0x2a8216[_0x33de08(0x10e)]('\x20'+_0x44f03a['id']));const {id:_0x204282,name:_0x4cabee,..._0xe9c3fc}=_0x44f03a;await handleSingleObjectOutput(_0xe9c3fc,_0x41c24e);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:traffic';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x127);async[a27_0x4c00bc(0x104)](_0x15146a){const _0x18176c=a27_0x4c00bc,{options:_0x37709d,args:_0x40fa4f,tdx:_0x406128}=_0x15146a,_0x479731=_0x40fa4f[0x0];if(!requireNameOrPath(_0x479731))return 0x1;_0x37709d[_0x18176c(0x198)]&&console['error'](_0x18176c(0x175)+_0x479731);const _0xa18e16=_0x37709d,_0x284688=_0xa18e16[_0x18176c(0x15f)],_0xbe4160=_0xa18e16['from'],_0x5b0d7d=_0xa18e16['to'],_0x3733a1=_0xa18e16[_0x18176c(0x10b)];if(_0x284688&&_0x284688!==_0x18176c(0xc2)&&_0x284688!==_0x18176c(0x80))return console['error'](_0x18176c(0xab)+_0x284688+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x5b276=withJsonFormat(_0x37709d),{journeyId:_0x2551b4,journeyName:_0x1b03cf}=await resolveJourneyIdFromInput(_0x479731,_0x5b276,_0x406128),_0x5a3310={'type':_0x284688,'from':_0xbe4160,'to':_0x5b0d7d,'limit':_0x3733a1},_0x2a68ed=await withSpinner(_0x18176c(0x145),()=>_0x406128[_0x18176c(0xe7)][_0x18176c(0x11a)](_0x2551b4,_0x5a3310),{'verbose':_0x5b276[_0x18176c(0x198)]}),_0x524423=_0x2a68ed[_0x18176c(0x19f)],_0xd91427=_0x524423[_0x18176c(0xc2)]&&(_0x524423[_0x18176c(0xc2)][_0x18176c(0x12b)][_0x18176c(0xa8)]>0x0||_0x524423[_0x18176c(0xc2)][_0x18176c(0x139)]['length']>0x0),_0x5e7401=_0x524423['activation']&&_0x524423[_0x18176c(0x80)][_0x18176c(0xa8)]>0x0;if(!_0xd91427&&!_0x5e7401)return console[_0x18176c(0x133)](_0x18176c(0x1a4)+_0x1b03cf),console[_0x18176c(0x133)](_0x18176c(0x12c)),_0xbe4160&&_0x5b0d7d&&console['error'](_0x18176c(0xdd)),0x0;return await handleSingleObjectOutput(_0x524423,_0x5b276),0x0;}}function formatStageStats(_0x5481e9,_0x35a529){const _0x5c923d=a27_0x4c00bc,_0x2f80dd=_0x35a529[_0x5c923d(0xd4)]&&_0x5481e9['history']?.['length']?aggregateStageHistory(_0x5481e9['history']):{'size':_0x5481e9[_0x5c923d(0x181)],'entered':_0x5481e9[_0x5c923d(0x13d)],'milestone':_0x5481e9[_0x5c923d(0x16c)],'milestone_rate':_0x5481e9[_0x5c923d(0x142)],'exit_or_jump':_0x5481e9[_0x5c923d(0xa1)],'exit_or_jump_rate':_0x5481e9[_0x5c923d(0x13f)]},_0x2b5b7e={'id':_0x5481e9['id'],'name':_0x35a529['stageNameMap'][_0x5c923d(0x182)](_0x5481e9['id'])??_0x5481e9['id'],..._0x2f80dd};return _0x35a529['hasPeriod']&&_0x35a529['includeHistory']&&_0x5481e9[_0x5c923d(0x16f)]&&(_0x2b5b7e[_0x5c923d(0x16f)]=_0x5481e9[_0x5c923d(0x16f)]),_0x2b5b7e;}export class JourneyPauseCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x108);[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x110);async['execute'](_0x23731e){const _0x3188d6=a27_0x4c00bc,{options:_0x486743,args:_0x18f630,tdx:_0x3e984f}=_0x23731e,_0x4b8c26=_0x18f630[0x0];if(!requireNameOrPath(_0x4b8c26))return 0x1;_0x486743[_0x3188d6(0x198)]&&console[_0x3188d6(0x133)]('Input:\x20'+_0x4b8c26);const {journeyId:_0x5a985f,journeyName:_0x444854}=await resolveJourneyIdFromInput(_0x4b8c26,_0x486743,_0x3e984f);if(!_0x486743[_0x3188d6(0x15d)]){const _0x35e023=await confirm(_0x3188d6(0x103)+_0x444854+'\x22?');if(!_0x35e023)return console[_0x3188d6(0x133)]('Cancelled'),0x0;}const _0x273350=await withSpinner('Pausing\x20journey...',()=>_0x3e984f[_0x3188d6(0xe7)][_0x3188d6(0xa3)](_0x5a985f),{'verbose':_0x486743[_0x3188d6(0x198)]}),_0x408030=_0x273350[_0x3188d6(0x19f)];return console[_0x3188d6(0x133)](_0x3188d6(0xc6)+_0x408030['attributes'][_0x3188d6(0xad)]+'\x22\x20paused'),0x0;}}export class JourneyRunCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x115);['description']='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a27_0x4c00bc(0x104)](_0x561e2e){const _0x1dcee1=a27_0x4c00bc,{options:_0x3a15f7,args:_0xe27bd8,tdx:_0x473e3a}=_0x561e2e,_0x40df19=_0xe27bd8[0x0];if(!requireNameOrPath(_0x40df19))return 0x1;_0x3a15f7['verbose']&&console[_0x1dcee1(0x133)]('Input:\x20'+_0x40df19);const {journeyId:_0x377de4,journeyName:_0x3c35c3}=await resolveJourneyIdFromInput(_0x40df19,_0x3a15f7,_0x473e3a);if(_0x3a15f7[_0x1dcee1(0x173)])return await this[_0x1dcee1(0x176)](_0x561e2e,_0x377de4,_0x3c35c3);if(!_0x3a15f7[_0x1dcee1(0x15d)]){const _0x295cb0=await confirm(_0x1dcee1(0x9c)+_0x3c35c3+'\x22?');if(!_0x295cb0)return console[_0x1dcee1(0x133)]('Cancelled'),0x0;}const _0x411f3d=await withSpinner(_0x1dcee1(0xd9),()=>_0x473e3a[_0x1dcee1(0xe7)]['run'](_0x377de4),{'verbose':_0x3a15f7[_0x1dcee1(0x198)]}),_0x480a10=_0x411f3d[_0x1dcee1(0x19f)],_0xf8265d=getWorkflowSessionUrl(_0x3a15f7[_0x1dcee1(0x184)],_0x480a10['workflowId'],_0x480a10[_0x1dcee1(0x179)]);return console[_0x1dcee1(0x133)]('\x0a'+a27_0x2a8216[_0x1dcee1(0x1a0)]('✔')+'\x20Journey\x20workflow\x20started'),console[_0x1dcee1(0x133)]('\x20\x20'+a27_0x2a8216['dim'](_0x1dcee1(0x113))+'\x20'+_0x3c35c3),console['error']('\x20\x20'+a27_0x2a8216[_0x1dcee1(0x10e)]('Status:')+'\x20'+_0x480a10[_0x1dcee1(0x140)]),console['error']('\x20\x20'+a27_0x2a8216[_0x1dcee1(0x10e)](_0x1dcee1(0x17d))+'\x20'+_0x480a10[_0x1dcee1(0x179)]),console[_0x1dcee1(0x133)]('\x20\x20'+_0xf8265d),0x0;}async[a27_0x4c00bc(0x176)](_0x3f31af,_0xfc5a35,_0x2b9ea1){const _0x57e832=a27_0x4c00bc,{options:_0x1d4015,tdx:_0x4be0b2}=_0x3f31af,_0x496672=await withSpinner('Fetching\x20journey\x20'+_0x2b9ea1+_0x57e832(0xb5),()=>Promise['all']([_0x4be0b2[_0x57e832(0xe7)][_0x57e832(0x10d)](_0xfc5a35),_0x4be0b2['journey'][_0x57e832(0x85)](_0xfc5a35)]),{'verbose':_0x1d4015[_0x57e832(0x198)]}),[_0x8310f8,_0x19b80b]=_0x496672[_0x57e832(0x19f)],_0xd3262a=_0x8310f8[_0x57e832(0x13c)],_0x135916=_0xd3262a['journeyStages'];console[_0x57e832(0x109)](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0x113)),_0xd3262a[_0x57e832(0xad)]),console['log'](a27_0x2a8216[_0x57e832(0x196)]('ID:'),_0x8310f8['id']),console[_0x57e832(0x109)](a27_0x2a8216['bold'](_0x57e832(0x177)),_0xd3262a['state']),console[_0x57e832(0x109)](a27_0x2a8216['bold'](_0x57e832(0xa7)),_0xd3262a['paused']?a27_0x2a8216['yellow'](_0x57e832(0x15d)):a27_0x2a8216[_0x57e832(0x1a0)]('no')),console['log'](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0xd0)),_0xd3262a[_0x57e832(0x151)]);const _0x5c9ff6=_0x135916[_0x57e832(0xa8)]>0x0?'\x20('+_0x135916[_0x57e832(0x1a5)](_0x4ef7b5=>_0x4ef7b5[_0x57e832(0xad)])['join'](',\x20')+')':'';console['log'](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0xfe)),''+_0x135916[_0x57e832(0xa8)]+_0x5c9ff6),console[_0x57e832(0x109)]('');if(_0x19b80b['length']===0x0)console[_0x57e832(0x109)](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0xb6)),a27_0x2a8216[_0x57e832(0x10e)]('(none)'));else{console[_0x57e832(0x109)](a27_0x2a8216['bold'](_0x57e832(0xb6)));for(const _0x12778f of _0x19b80b){const _0x3b7fe0=_0x12778f[_0x57e832(0xad)]??_0x57e832(0x147),_0x214d56=_0x12778f[_0x57e832(0x12a)]!=null?_0x57e832(0xf6)+_0x12778f['connectionId']:_0x57e832(0x153),_0xfe1e59=_0x12778f['scheduleType']?''+_0x12778f[_0x57e832(0x15c)]+(_0x12778f[_0x57e832(0x135)]?_0x57e832(0x96)+_0x12778f[_0x57e832(0x135)]:''):'none',_0x3ee8c3=_0x12778f[_0x57e832(0x12f)]?_0x57e832(0x169):'';console['log']('\x20\x20'+a27_0x2a8216[_0x57e832(0xa6)]('⚠️\x20')+'\x20'+_0x3b7fe0+_0x57e832(0x148)+_0x214d56+_0x57e832(0x170)+_0xfe1e59+_0x3ee8c3);}}return console[_0x57e832(0x109)](a27_0x2a8216[_0x57e832(0xa6)](_0x57e832(0x11d))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x150);['description']=a27_0x4c00bc(0xe2);async[a27_0x4c00bc(0x104)](_0x4f5341){const _0x2a61fa=a27_0x4c00bc,{options:_0x7f81f1,args:_0x5e8335,tdx:_0x689d9a}=_0x4f5341,_0x2cf046=_0x5e8335[0x0];if(!requireNameOrPath(_0x2cf046))return 0x1;_0x7f81f1['verbose']&&console[_0x2a61fa(0x133)]('Input:\x20'+_0x2cf046);const {journeyId:_0x333fb9,journeyName:_0x30b121}=await resolveJourneyIdFromInput(_0x2cf046,_0x7f81f1,_0x689d9a);if(_0x7f81f1[_0x2a61fa(0x173)])return await this[_0x2a61fa(0x176)](_0x4f5341,_0x333fb9,_0x30b121);if(!_0x7f81f1['yes']){const _0x185ab9=await confirm(_0x2a61fa(0x9d)+_0x30b121+'\x22?');if(!_0x185ab9)return console[_0x2a61fa(0x133)](_0x2a61fa(0xb0)),0x0;}const _0xbc55ba=await withSpinner(_0x2a61fa(0xc7),()=>_0x689d9a[_0x2a61fa(0xe7)][_0x2a61fa(0x82)](_0x333fb9),{'verbose':_0x7f81f1['verbose']}),_0x36cd7a=_0xbc55ba['data'];return console['error']('✔\x20Journey\x20\x22'+_0x36cd7a[_0x2a61fa(0x13c)][_0x2a61fa(0xad)]+'\x22\x20resumed'),0x0;}async['executeDryRun'](_0x16038d,_0x40f0ca,_0x64ef77){const _0x1a18f0=a27_0x4c00bc,{options:_0x2e0718,tdx:_0x150c79}=_0x16038d,_0x3fa4fa=await withSpinner(_0x1a18f0(0xc9)+_0x64ef77+_0x1a18f0(0xb5),()=>Promise['all']([_0x150c79[_0x1a18f0(0xe7)][_0x1a18f0(0x10d)](_0x40f0ca),_0x150c79[_0x1a18f0(0xe7)][_0x1a18f0(0x85)](_0x40f0ca)]),{'verbose':_0x2e0718[_0x1a18f0(0x198)]}),[_0x2c2f6c,_0xfbc3ff]=_0x3fa4fa[_0x1a18f0(0x19f)],_0xee01d2=_0x2c2f6c[_0x1a18f0(0x13c)],_0x5f2e14=_0xee01d2[_0x1a18f0(0x131)];console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x113)),_0xee01d2[_0x1a18f0(0xad)]),console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x8d)),_0x2c2f6c['id']),console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x177)),_0xee01d2['state']),console['log'](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xa7)),_0xee01d2[_0x1a18f0(0xc5)]?a27_0x2a8216[_0x1a18f0(0xa6)](_0x1a18f0(0x15d)):a27_0x2a8216['green']('no'));_0xee01d2[_0x1a18f0(0x19d)]&&console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x13e)),_0xee01d2['pausedAt']);console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xd0)),_0xee01d2[_0x1a18f0(0x151)]);const _0x52a059=_0x5f2e14['length']>0x0?'\x20('+_0x5f2e14['map'](_0x1f038e=>_0x1f038e['name'])[_0x1a18f0(0x161)](',\x20')+')':'';console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xfe)),''+_0x5f2e14[_0x1a18f0(0xa8)]+_0x52a059),console[_0x1a18f0(0x109)]('');if(_0xfbc3ff[_0x1a18f0(0xa8)]===0x0)console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xb6)),a27_0x2a8216['dim']('(none)'));else{console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xb6)));for(const _0x29da44 of _0xfbc3ff){const _0x276bf9=_0x29da44[_0x1a18f0(0xad)]??_0x1a18f0(0x147),_0x1a5f8c=_0x29da44[_0x1a18f0(0x12a)]!=null?'connection\x20'+_0x29da44[_0x1a18f0(0x12a)]:_0x1a18f0(0x153),_0x587861=_0x29da44[_0x1a18f0(0x15c)]?''+_0x29da44['scheduleType']+(_0x29da44['runAt']?_0x1a18f0(0x96)+_0x29da44[_0x1a18f0(0x135)]:''):'none',_0x2122af=_0x29da44[_0x1a18f0(0x12f)]?_0x1a18f0(0x169):'';console[_0x1a18f0(0x109)]('\x20\x20'+a27_0x2a8216[_0x1a18f0(0xa6)](_0x1a18f0(0x17b))+'\x20'+_0x276bf9+_0x1a18f0(0x148)+_0x1a5f8c+_0x1a18f0(0x170)+_0x587861+_0x2122af);}}return console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0xa6)](_0x1a18f0(0x83))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x8b);[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0xa2);async[a27_0x4c00bc(0x104)](_0x5e728b){const _0x190bea=a27_0x4c00bc,{options:_0x50eb65,args:_0x368cf3,tdx:_0x3dc5e7}=_0x5e728b,_0x2770e2=_0x50eb65,_0x1c327f=_0x368cf3[0x0],_0x14d022=_0x1c327f&&isYamlFilePath(_0x1c327f),_0x63c769=await resolveTarget({'arg':_0x14d022?_0x1c327f:undefined,'contextParent':_0x50eb65['parentSegment'],'cwd':process[_0x190bea(0x128)]()});if(!isSuccessfulResolution(_0x63c769))return _0x63c769['errorCode']===_0x190bea(0x172)?(console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0xa6)](_0x190bea(0x157))),console[_0x190bea(0x133)](_0x190bea(0x98)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x190bea(0x10f)),console[_0x190bea(0x133)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x1a3)](_0x190bea(0xbc)+_0x63c769['message']+'\x0a')),_0x63c769['helpText']&&console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x84)](_0x63c769['helpText']))),0x1;let _0x26b984=_0x14d022?undefined:_0x1c327f,_0x5ef123,_0x1c696a;_0x63c769[_0x190bea(0x15f)]===_0x190bea(0x18e)&&(_0x26b984=_0x63c769['resourceName'],_0x5ef123=_0x63c769['filePath'],_0x1c696a=_0x63c769[_0x190bea(0x13a)]);const _0x45ce42=_0x63c769[_0x190bea(0x149)],_0x57a808=_0x63c769[_0x190bea(0xd7)];_0x2770e2[_0x190bea(0x198)]&&(console[_0x190bea(0x133)]('Parent\x20segment:\x20'+_0x45ce42),console['error'](_0x190bea(0xfa)+_0x57a808),_0x26b984&&console['error']('Journey\x20name:\x20'+_0x26b984),_0x5ef123&&console['error'](_0x190bea(0xe4)+_0x5ef123),_0x1c696a&&console[_0x190bea(0x133)](_0x190bea(0x81)+_0x1c696a));const _0x6fa035=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3dc5e7[_0x190bea(0xd3)][_0x190bea(0x16b)](_0x45ce42),{'verbose':_0x50eb65[_0x190bea(0x198)]}),_0x19ec8d=_0x6fa035[_0x190bea(0x19f)],{journeys:_0x484f56,folders:_0x4cfab8}=await withSpinner(_0x190bea(0xb8),async()=>{const _0x1d8515=_0x190bea,[_0x37bb4d,_0x4a7ad2]=await Promise[_0x1d8515(0x92)]([_0x3dc5e7['journey']['listJourneysFromParentSegment'](_0x19ec8d,undefined,{'includeAllVersions':!![]}),_0x3dc5e7[_0x1d8515(0xd3)]['listFolders'](_0x19ec8d)]);return{'journeys':_0x37bb4d,'folders':_0x4a7ad2};},{'verbose':_0x50eb65[_0x190bea(0x198)]})[_0x190bea(0xda)](_0x1de5b8=>_0x1de5b8[_0x190bea(0x19f)]);let _0x3b3fce=_0x484f56;const _0x2c27e4=buildFolderIdToPathMap(_0x4cfab8);if(_0x26b984){const _0x5a18b0=_0x3b3fce[_0x190bea(0xe1)](_0x46c391=>_0x46c391[_0x190bea(0x11f)][_0x190bea(0xff)]()===_0x26b984['toLowerCase']());if(_0x5a18b0[_0x190bea(0xa8)]===0x0)return console[_0x190bea(0x133)](_0x190bea(0x183)+_0x26b984),console['error'](_0x190bea(0xbe)),0x1;_0x3b3fce=_0x5a18b0;}if(_0x1c696a!==undefined){const _0x209890=_0x3b3fce[_0x190bea(0xe1)](_0x17f350=>{const _0x34bb5d=_0x190bea,_0x20bcf0=_0x17f350['folderId']?_0x2c27e4['get'](_0x17f350[_0x34bb5d(0x90)])||'':'';return _0x20bcf0===_0x1c696a;});if(_0x209890['length']===0x0&&_0x3b3fce[_0x190bea(0xa8)]>0x0){console[_0x190bea(0x133)](_0x190bea(0x9f)+_0x26b984+_0x190bea(0x117)+(_0x1c696a||_0x190bea(0x19e))),console['error'](_0x190bea(0x122));for(const _0x4b42af of _0x3b3fce){const _0x332635=_0x4b42af['folderId']?_0x2c27e4[_0x190bea(0x182)](_0x4b42af[_0x190bea(0x90)])||'':'';console[_0x190bea(0x133)](_0x190bea(0xc0)+(_0x332635||_0x190bea(0x119))+'/'+_0x4b42af[_0x190bea(0x11f)]);}return 0x1;}_0x3b3fce=_0x209890;}if(_0x3b3fce[_0x190bea(0xa8)]===0x0)return console[_0x190bea(0x133)](_0x190bea(0x105)),0x0;const _0x1a98cd=new Map();for(const _0x39d2cd of _0x3b3fce){const _0x43aa06=_0x39d2cd[_0x190bea(0xe8)];!_0x1a98cd[_0x190bea(0xc4)](_0x43aa06)&&_0x1a98cd['set'](_0x43aa06,[]),_0x1a98cd[_0x190bea(0x182)](_0x43aa06)[_0x190bea(0x16d)](_0x39d2cd);}for(const _0x1ec293 of _0x1a98cd['values']()){_0x1ec293[_0x190bea(0xaf)]((_0x1f83a7,_0x455c7d)=>(_0x1f83a7[_0x190bea(0x9a)]||0x0)-(_0x455c7d['versionNumber']||0x0));}const _0x2f08a9=[],{idToEmailMap:_0x48ad27,connectionIdToNameMap:_0x4237c1}=await withSpinner(_0x190bea(0x107),async()=>{const _0x363f7f=_0x190bea,[_0x2349a0,_0x4b983a]=await Promise[_0x363f7f(0x92)]([_0x3dc5e7['user'][_0x363f7f(0x99)](),_0x3dc5e7[_0x363f7f(0xac)][_0x363f7f(0xcb)]()]);return{'idToEmailMap':_0x2349a0,'connectionIdToNameMap':_0x4b983a};},{'verbose':_0x50eb65[_0x190bea(0x198)]})[_0x190bea(0xda)](_0x42d91c=>_0x42d91c[_0x190bea(0x19f)]);for(const _0x2f368f of _0x1a98cd[_0x190bea(0xa0)]()){const _0x1aa554=_0x2f368f[0x0][_0x190bea(0x11f)],_0x1ed508=_0x2f368f[0x0][_0x190bea(0x90)],_0x30960e=_0x1ed508?_0x2c27e4[_0x190bea(0x182)](_0x1ed508)||'':'',_0x21a37c=_0x30960e?a27_0x576223[_0x190bea(0x161)](_0x57a808,_0x30960e):_0x57a808,_0x2914ef=_0x5ef123||a27_0x576223['join'](_0x21a37c,sanitizeFileName(_0x1aa554)+_0x190bea(0x89));let _0x2acae6,_0x3312e7;if(existsSync(_0x2914ef))try{const _0x328098=readFileSync(_0x2914ef,_0x190bea(0x8e)),_0x20fdf5=parseYamlString(_0x328098);_0x3312e7=_0x20fdf5,_0x2acae6=buildRuleToNameMapping(_0x20fdf5),_0x2770e2[_0x190bea(0x198)]&&_0x2acae6[_0x190bea(0x181)]>0x0&&console[_0x190bea(0x133)]('Found\x20'+_0x2acae6[_0x190bea(0x181)]+_0x190bea(0xba)+_0x1aa554);}catch(_0x4740d8){_0x2770e2['verbose']&&console[_0x190bea(0x133)](_0x190bea(0xdf)+_0x4740d8[_0x190bea(0x19b)]);}const _0x3dd878=[],_0x32ac76=new Set(),_0x320c89=new Map(),_0x22a3eb=new Map(),_0x409bc5=new Set(),_0x3d1d6e=new Map(),_0x144b32=new Map(),_0x4ead6a=createJumpTargetCache();await withProgressSpinner(_0x190bea(0x143)+_0x1aa554+_0x190bea(0xb5),async _0x27c563=>{const _0x1f8749=_0x190bea;for(const _0x1d17bc of _0x2f368f){const _0x483037=_0x2f368f[_0x1f8749(0xa8)]>0x1?_0x1d17bc['journeyBundleName']+'\x20v'+(_0x1d17bc[_0x1f8749(0x9a)]||0x1):_0x1d17bc[_0x1f8749(0x11f)];_0x27c563[_0x1f8749(0x136)](_0x1f8749(0x143)+_0x483037);const _0x3f49a5=await _0x3dc5e7[_0x1f8749(0xe7)][_0x1f8749(0x10d)](_0x1d17bc['id']),_0x1064a3=_0x3f49a5[_0x1f8749(0x13c)]?.[_0x1f8749(0x151)],_0x533e71={'resolveSegment':async _0x508259=>{const _0x405895=_0x1f8749;if(!_0x1064a3)return{'name':_0x508259,'isJourneyLocal':![]};const _0x567e87=_0x320c89[_0x405895(0x182)](_0x508259);if(_0x567e87)return _0x567e87;try{const _0x77388e=await _0x3dc5e7[_0x405895(0xd3)]['getSegment'](_0x1064a3,_0x508259),_0x5c3c16=_0x77388e[_0x405895(0x18a)]===SEGMENT_KIND_JOURNEY;let _0x4027ab,_0xe5e58b=_0x77388e[_0x405895(0xad)];if(_0x5c3c16&&_0x77388e[_0x405895(0x14a)]){const _0x4c0a30=await segmentResponseToDef(_0x77388e,{'resolveSegmentName':async _0x30ac03=>{const _0x4a9c23=_0x405895,_0x208ae1=_0x320c89[_0x4a9c23(0x182)](_0x30ac03);if(_0x208ae1)return _0x208ae1['name'];const _0x1ede7d=await _0x533e71[_0x4a9c23(0x88)](_0x30ac03);return _0x1ede7d[_0x4a9c23(0xad)];}}),_0x292340=_0x4c0a30[_0x405895(0x14a)];_0x4027ab={'description':_0x77388e['description'],'rule':_0x292340};const _0x3ffb9f=serializeRule(_0x292340),_0x570c15=_0x22a3eb[_0x405895(0x182)](_0x3ffb9f);if(_0x570c15)_0xe5e58b=_0x570c15,_0x4027ab=undefined,_0x2770e2[_0x405895(0x198)]&&console[_0x405895(0x133)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x77388e[_0x405895(0xad)]+_0x405895(0x12e)+_0x570c15);else{let _0x379515=![];if(_0x2acae6){const _0x36434d=_0x2acae6[_0x405895(0x182)](_0x3ffb9f);if(_0x36434d){const _0x3d4677=_0x36434d[_0x405895(0x101)](_0x151d43=>!_0x32ac76[_0x405895(0xc4)](_0x151d43));_0x3d4677&&(_0xe5e58b=_0x3d4677,_0x32ac76['add'](_0x3d4677),_0x22a3eb[_0x405895(0x162)](_0x3ffb9f,_0x3d4677),_0x379515=!![],_0x2770e2[_0x405895(0x198)]&&console[_0x405895(0x133)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x3d4677+_0x405895(0x190)));}}if(!_0x379515){const _0x6dbeaf=generateJourneyLocalName(_0x77388e['name']);_0x6dbeaf&&(_0xe5e58b=_0x6dbeaf);let _0x5a898d=_0xe5e58b,_0x2cd1fc=0x2;while(_0x32ac76['has'](_0x5a898d)){_0x5a898d=_0xe5e58b+'_'+_0x2cd1fc,_0x2cd1fc++;}_0x32ac76[_0x405895(0x125)](_0x5a898d),_0x22a3eb[_0x405895(0x162)](_0x3ffb9f,_0x5a898d),_0xe5e58b=_0x5a898d;}}}const _0xce502b={'name':_0xe5e58b,'isJourneyLocal':_0x5c3c16,'definition':_0x4027ab};return _0x320c89[_0x405895(0x162)](_0x508259,_0xce502b),_0xce502b;}catch(_0x1cc926){return _0x50eb65[_0x405895(0x198)]&&console[_0x405895(0x133)](_0x405895(0xaa)+_0x508259+':\x20'+_0x1cc926[_0x405895(0x19b)]),{'name':_0x508259,'isJourneyLocal':![]};}},'resolveActivation':async _0x6d7897=>{const _0x123818=_0x1f8749,_0xb4b251=_0x3d1d6e[_0x123818(0x182)](_0x6d7897);if(_0xb4b251)return _0xb4b251;try{const _0xbe3621=await _0x3dc5e7[_0x123818(0xe7)][_0x123818(0xa5)](_0x1d17bc['id'],_0x6d7897),_0x5f09fd=journeyActivationStepToYaml(_0xbe3621,_0x48ad27,_0x4237c1),_0xbe7dec=JSON[_0x123818(0xea)]({'name':_0x5f09fd[_0x123818(0xad)],'connection':_0x5f09fd[_0x123818(0xac)],'connector_config':_0x5f09fd[_0x123818(0xef)]}),_0x202081=_0x144b32[_0x123818(0x182)](_0xbe7dec);if(_0x202081){const _0x3bdbf1={'name':_0x202081,'isJourneyLocal':!![],'definition':_0x5f09fd};return _0x3d1d6e[_0x123818(0x162)](_0x6d7897,_0x3bdbf1),_0x3bdbf1;}const _0x5b58aa=_0xbe3621[_0x123818(0x13c)]['activationParams']['name']||_0x6d7897,_0x39199f=sanitizeYamlKey(_0x5b58aa)||'activation_'+_0x6d7897;let _0xe3fbc3=_0x39199f,_0x1689e7=0x2;while(_0x409bc5[_0x123818(0xc4)](_0xe3fbc3)){_0xe3fbc3=_0x39199f+'_'+_0x1689e7,_0x1689e7++;}_0x409bc5['add'](_0xe3fbc3),_0x144b32[_0x123818(0x162)](_0xbe7dec,_0xe3fbc3);const _0x306809={'name':_0xe3fbc3,'isJourneyLocal':!![],'definition':_0x5f09fd};return _0x3d1d6e['set'](_0x6d7897,_0x306809),_0x306809;}catch(_0xc02063){return _0x50eb65[_0x123818(0x198)]&&console['error'](_0x123818(0x164)+_0x6d7897+':\x20'+_0xc02063[_0x123818(0x19b)]),{'name':_0x6d7897,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x405f9f,_0x4285a1)=>{const _0x2bf3ff=_0x1f8749;return resolveJumpTarget(_0x405f9f,_0x4285a1,_0x4ead6a,_0x4af410=>_0x3dc5e7[_0x2bf3ff(0xe7)][_0x2bf3ff(0x10d)](_0x4af410));}},_0x92ee58=await journeyResponseToDef(_0x3f49a5,_0x533e71);_0x3dd878[_0x1f8749(0x16d)]({'item':_0x1d17bc,'yaml':_0x92ee58});}},{'verbose':_0x50eb65[_0x190bea(0x198)]});const _0x32faec=await _0x3dc5e7[_0x190bea(0xe7)][_0x190bea(0xcf)](_0x2f368f[0x0][_0x190bea(0xe8)]),_0x4eb849=buildMergedJourneyDef(_0x3dd878,_0x2acae6,_0x32faec),_0x4e3000=normalizeJourneyDef(_0x4eb849,_0x3312e7),_0x294a5=toYamlString(_0x4e3000),_0x42fbac=_0x5ef123||a27_0x576223['join'](_0x21a37c,sanitizeFileName(_0x1aa554)+_0x190bea(0x89));!_0x5ef123&&_0x30960e&&!existsSync(_0x21a37c)&&mkdirSync(_0x21a37c,{'recursive':!![]});const _0x4e4412=a27_0x576223[_0x190bea(0x106)](process[_0x190bea(0x128)](),_0x42fbac);if(existsSync(_0x42fbac)){const _0xa02e24=readFileSync(_0x42fbac,'utf-8'),_0x26fba5=generateDiff(_0xa02e24,_0x294a5),_0x4064ba=hasChanges(_0x26fba5);_0x2f08a9['push']({'relativePath':_0x4e4412,'absolutePath':_0x42fbac,'content':_0x294a5,'isNew':![],'hasChanges':_0x4064ba,'diff':_0x4064ba?formatDiffWithColors(_0x26fba5):undefined});}else _0x2f08a9[_0x190bea(0x16d)]({'relativePath':_0x4e4412,'absolutePath':_0x42fbac,'content':_0x294a5,'isNew':!![],'hasChanges':![]});}const _0x521bcd=_0x2f08a9[_0x190bea(0xe1)](_0x262051=>_0x262051[_0x190bea(0x118)]),_0x868edd=_0x2f08a9[_0x190bea(0xe1)](_0x549fc1=>!_0x549fc1[_0x190bea(0x118)]&&_0x549fc1['hasChanges']),_0x40753e=_0x2f08a9['filter'](_0x40362e=>!_0x40362e[_0x190bea(0x118)]&&!_0x40362e[_0x190bea(0xdb)]),_0x393bf5=_0x3b3fce[_0x190bea(0xa8)],_0x10d2a1=_0x1a98cd[_0x190bea(0x181)],_0x4fc624=_0x393bf5>_0x10d2a1?'\x20('+_0x393bf5+'\x20versions)':'';console[_0x190bea(0x133)](_0x190bea(0x10c)),console[_0x190bea(0x133)]('\x20\x20'+a27_0x2a8216[_0x190bea(0x84)](_0x10d2a1+_0x190bea(0xf0))+a27_0x2a8216[_0x190bea(0x10e)](_0x4fc624)),console[_0x190bea(0x133)]('\x20\x20'+a27_0x2a8216['green']('+\x20'+_0x521bcd['length']+'\x20new\x20files')),console[_0x190bea(0x133)]('\x20\x20'+a27_0x2a8216[_0x190bea(0xa6)]('~\x20'+_0x868edd[_0x190bea(0xa8)]+_0x190bea(0x174))),console['error']('\x20\x20'+a27_0x2a8216[_0x190bea(0x10e)]('=\x20'+_0x40753e[_0x190bea(0xa8)]+_0x190bea(0x87))),console[_0x190bea(0x133)](_0x190bea(0x194)+a27_0x2a8216['cyan'](_0x57a808)+'\x0a');if(_0x868edd[_0x190bea(0xa8)]>0x0)for(const _0x2983f8 of _0x868edd){console[_0x190bea(0x133)](_0x190bea(0x114)+_0x2983f8[_0x190bea(0x8c)]+'\x27:'),console[_0x190bea(0x133)]('─'[_0x190bea(0xde)](0x3c)),console[_0x190bea(0x133)](_0x2983f8[_0x190bea(0x116)]),console[_0x190bea(0x133)]('─'['repeat'](0x3c));}if(_0x2770e2[_0x190bea(0x173)])return console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0xa6)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x521bcd['length']===0x0&&_0x868edd['length']===0x0)return console['error'](a27_0x2a8216[_0x190bea(0x1a0)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x45ce42},_0x2770e2[_0x190bea(0x132)]),console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x1a0)](_0x190bea(0xe3)+a27_0x2a8216[_0x190bea(0x10e)](_0x190bea(0x156))+_0x190bea(0x18f)+a27_0x2a8216[_0x190bea(0x84)](_0x45ce42))),0x0;if(!_0x2770e2[_0x190bea(0x15d)]&&(_0x521bcd['length']>0x0||_0x868edd[_0x190bea(0xa8)]>0x0)){if(!isInteractive())return console['error'](a27_0x2a8216['red'](_0x190bea(0x188)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x10e)](_0x190bea(0x19c))),0x1;const _0x450cc1=await confirmKey(_0x190bea(0xbb)+(_0x521bcd[_0x190bea(0xa8)]+_0x868edd['length'])+'\x20files?');if(!_0x450cc1)return console['error'](a27_0x2a8216[_0x190bea(0xa6)](_0x190bea(0x191)),_0x190bea(0xcd)),0x1;}!existsSync(_0x57a808)&&mkdirSync(_0x57a808,{'recursive':!![]});const _0x3ff38e=a27_0x576223[_0x190bea(0x161)](_0x57a808,_0x190bea(0x141));writeFileSync(_0x3ff38e,createTdxConfigContent(_0x45ce42),_0x190bea(0x8e));for(const _0x37b201 of _0x2f08a9){(_0x37b201[_0x190bea(0x118)]||_0x37b201['hasChanges'])&&writeFileSync(_0x37b201[_0x190bea(0x8f)],_0x37b201[_0x190bea(0x86)],'utf-8');}return console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x1a0)](_0x190bea(0x102)+(_0x521bcd[_0x190bea(0xa8)]+_0x868edd[_0x190bea(0xa8)])+_0x190bea(0x19a)+_0x57a808)),saveSessionContext({'parent_segment':_0x45ce42},_0x2770e2[_0x190bea(0x132)]),console['error'](a27_0x2a8216['green'](_0x190bea(0xe3)+a27_0x2a8216['dim']('parent_segment')+_0x190bea(0x18f)+a27_0x2a8216[_0x190bea(0x84)](_0x45ce42))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x137);[a27_0x4c00bc(0xa4)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x4c00bc(0x104)](_0x456ec7){const _0x301631=a27_0x4c00bc,{options:_0x55089c,args:_0x47bdfc,tdx:_0x1fa3d1}=_0x456ec7,_0x32ed95=_0x47bdfc[0x0];if(!requireNameOrPath(_0x32ed95))return 0x1;_0x55089c[_0x301631(0x198)]&&console['error']('Input:\x20'+_0x32ed95);const {journeyId:_0x161fe1}=await resolveJourneyIdFromInput(_0x32ed95,_0x55089c,_0x1fa3d1),_0x3e6d71=await withSpinner(_0x301631(0x111),()=>_0x1fa3d1['journey'][_0x301631(0x168)](_0x161fe1),{'verbose':_0x55089c[_0x301631(0x198)]}),_0x4b43e4=_0x3e6d71[_0x301631(0x19f)];return console[_0x301631(0x109)]('Database:\x20'+_0x4b43e4[_0x301631(0x10a)]),console[_0x301631(0x109)](_0x301631(0x158)+_0x4b43e4[_0x301631(0xa9)]),await handleSDKOutput(_0x4b43e4[_0x301631(0x14b)],_0x55089c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']='journey:activations';[a27_0x4c00bc(0xa4)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x4c00bc(0x104)](_0x108f64){const _0x39dfd0=a27_0x4c00bc,{options:_0x1b97a4,args:_0x5ac393,tdx:_0x1ade52}=_0x108f64,_0xb57d15=_0x5ac393[0x0];if(!requireNameOrPath(_0xb57d15))return 0x1;_0x1b97a4[_0x39dfd0(0x198)]&&console[_0x39dfd0(0x133)]('Input:\x20'+_0xb57d15);const {journeyId:_0x1aefe0}=await resolveJourneyIdFromInput(_0xb57d15,_0x1b97a4,_0x1ade52),_0x2fde32=await withSpinner(_0x39dfd0(0x15e),()=>_0x1ade52[_0x39dfd0(0xe7)]['listActivationsFlat'](_0x1aefe0),{'verbose':_0x1b97a4['verbose']}),_0x1606c1=_0x2fde32[_0x39dfd0(0x19f)];return console['error']('Found\x20'+_0x1606c1[_0x39dfd0(0xa8)]+_0x39dfd0(0x16a)+(_0x1606c1[_0x39dfd0(0xa8)]!==0x1?'s':'')),await handleSDKOutput(_0x1606c1,_0x1b97a4),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:push';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0xb2);[a27_0x4c00bc(0x9b)]=new SegmentPushCommand();async[a27_0x4c00bc(0x104)](_0x3b3232){const _0x58de36=a27_0x4c00bc,_0x5f7c69=_0x3b3232[_0x58de36(0xfb)][0x0];let _0x4ef3c8;if(_0x5f7c69){const _0x5dafd8=await resolveTarget({'arg':_0x5f7c69,'contextParent':_0x3b3232[_0x58de36(0x129)]['parentSegment'],'cwd':process['cwd']()});isSuccessfulResolution(_0x5dafd8)&&_0x5dafd8[_0x58de36(0x15f)]==='file'&&(_0x4ef3c8=_0x5dafd8[_0x58de36(0xd6)]);}const _0x4f0688={..._0x3b3232,'options':{..._0x3b3232[_0x58de36(0x129)],'journeysOnly':!![],..._0x4ef3c8&&{'singleFilePath':_0x4ef3c8}}};return this[_0x58de36(0x9b)][_0x58de36(0x104)](_0x4f0688);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:versions';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0xf7);async['execute'](_0x159546){const _0xcdeb5a=a27_0x4c00bc,{options:_0x1c66c8,args:_0x127e1e,tdx:_0x4c68bd}=_0x159546,_0x34319f=_0x127e1e[0x0];if(!requireNameOrPath(_0x34319f))return 0x1;if(_0x1c66c8[_0xcdeb5a(0x198)])console[_0xcdeb5a(0x133)]('Input:\x20'+_0x34319f);const {journeyId:_0x154655}=await resolveJourneyIdFromInput(_0x34319f,_0x1c66c8,_0x4c68bd),_0x293ae2=await withSpinner(_0xcdeb5a(0x17f),()=>_0x4c68bd[_0xcdeb5a(0xe7)][_0xcdeb5a(0x15b)](_0x154655),{'verbose':_0x1c66c8[_0xcdeb5a(0x198)]}),{bundleName:_0x51c7d3,versions:_0x1d4861,latestJourneyId:_0x2c1d34}=_0x293ae2['data'];console[_0xcdeb5a(0x133)](_0x51c7d3+':\x20'+_0x1d4861[_0xcdeb5a(0xa8)]+_0xcdeb5a(0x11c)+(_0x1d4861['length']!==0x1?'s':''));const _0x4e11e6=_0x1d4861[_0xcdeb5a(0x1a5)](_0x10d87b=>({'version':_0x10d87b[_0xcdeb5a(0x9a)],'journey_id':_0x10d87b[_0xcdeb5a(0xce)],'name':_0x10d87b[_0xcdeb5a(0xad)],'state':_0x10d87b[_0xcdeb5a(0x199)],'paused':_0x10d87b['paused'],'latest':_0x10d87b[_0xcdeb5a(0xce)]===_0x2c1d34,'created_at':_0x10d87b['createdAt']}));return await handleSDKOutput(_0x4e11e6,_0x1c66c8),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:version:create';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x14d);async[a27_0x4c00bc(0x104)](_0x316729){const _0x1aaa0b=a27_0x4c00bc,{options:_0x426742,args:_0x170d10,tdx:_0x19e69f}=_0x316729,_0x485eaf=_0x170d10[0x0];if(!requireNameOrPath(_0x485eaf))return 0x1;if(_0x426742[_0x1aaa0b(0x198)])console[_0x1aaa0b(0x133)]('Input:\x20'+_0x485eaf);const {journeyId:_0x20633a,journeyName:_0x3ed3eb}=await resolveJourneyIdFromInput(_0x485eaf,_0x426742,_0x19e69f);if(!_0x426742[_0x1aaa0b(0x15d)]){const _0x4c8ff6=await confirm(_0x1aaa0b(0x167)+_0x3ed3eb+'\x22?');if(!_0x4c8ff6)return console[_0x1aaa0b(0x133)](_0x1aaa0b(0xb0)),0x0;}const _0x23f86a=await withSpinner(_0x1aaa0b(0x11e),()=>_0x19e69f['journey'][_0x1aaa0b(0x18b)](_0x20633a),{'verbose':_0x426742[_0x1aaa0b(0x198)]}),_0x287c7f=_0x23f86a[_0x1aaa0b(0x19f)];return console[_0x1aaa0b(0x133)](a27_0x2a8216[_0x1aaa0b(0x1a0)]('✔')+_0x1aaa0b(0xf4)+_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0x9a)]+'\x20(draft)\x20—\x20\x22'+_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0xad)]+'\x22'),console[_0x1aaa0b(0x133)](_0x1aaa0b(0x14f)+_0x287c7f['id']),await handleSingleObjectOutput({'id':_0x287c7f['id'],'name':_0x287c7f['attributes'][_0x1aaa0b(0xad)],'version':_0x287c7f[_0x1aaa0b(0x13c)]['versionNumber'],'state':_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0x199)],'bundle_id':_0x287c7f['attributes'][_0x1aaa0b(0xe8)],'created_at':_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0xdc)]},_0x426742),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:version:view';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x123);async['execute'](_0x1b5e04){const _0x65dffc=a27_0x4c00bc,{options:_0x192093,args:_0x298392,tdx:_0x453bc6}=_0x1b5e04,_0x40c551=_0x298392[0x0];if(!requireNameOrPath(_0x40c551))return 0x1;const _0x1ec4b1=_0x192093[_0x65dffc(0x9e)];if(!_0x1ec4b1)return console[_0x65dffc(0x133)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x65dffc(0x133)](_0x65dffc(0x1a1)),0x1;const _0x3abd0f=parseInt(_0x1ec4b1,0xa);if(isNaN(_0x3abd0f)||_0x3abd0f<0x1)return console[_0x65dffc(0x133)](_0x65dffc(0x160)+_0x1ec4b1),0x1;if(_0x192093[_0x65dffc(0x198)])console[_0x65dffc(0x133)](_0x65dffc(0x175)+_0x40c551+',\x20version:\x20'+_0x3abd0f);const {journeyId:_0x54ebf2,parentSegmentId:_0x1e819a}=await resolveJourneyIdFromInput(_0x40c551,_0x192093,_0x453bc6),_0x19e2bc=await withSpinner(_0x65dffc(0x11b),()=>_0x453bc6['journey']['listVersions'](_0x54ebf2),{'verbose':_0x192093['verbose']}),{versions:_0x2b7bfb,latestJourneyId:_0x2b0c55}=_0x19e2bc['data'],_0x1a0548=_0x2b7bfb[_0x65dffc(0x101)](_0x57a90e=>_0x57a90e[_0x65dffc(0x9a)]===_0x3abd0f);if(!_0x1a0548){const _0x3dd5f3=_0x2b7bfb[_0x65dffc(0x1a5)](_0x5db883=>'v'+_0x5db883[_0x65dffc(0x9a)])[_0x65dffc(0x161)](',\x20');return console[_0x65dffc(0x133)](_0x65dffc(0x14c)+_0x3abd0f+_0x65dffc(0x187)+_0x3dd5f3),0x1;}const _0x582b88=await withSpinner(_0x65dffc(0xe0)+_0x3abd0f+_0x65dffc(0x17a),()=>_0x453bc6[_0x65dffc(0xe7)][_0x65dffc(0x10d)](_0x1a0548[_0x65dffc(0xce)]),{'verbose':_0x192093[_0x65dffc(0x198)]}),_0x54a82c=_0x582b88[_0x65dffc(0x19f)],_0x4ddece=getConsoleNextUrl(_0x192093['site'],'/app/ps/'+_0x1e819a+_0x65dffc(0xd2)+_0x1a0548[_0x65dffc(0xce)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x54a82c['id'],'name':_0x54a82c['attributes']['name'],'version':_0x54a82c['attributes']['versionNumber'],'description':_0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0xa4)],'state':_0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0x199)],'paused':_0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0xc5)],'reentry_mode':_0x54a82c['attributes'][_0x65dffc(0x166)],'stages':_0x54a82c['attributes'][_0x65dffc(0x131)]?.[_0x65dffc(0xa8)]||0x0,..._0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0xe5)]&&{'goal':_0x54a82c['attributes']['goal']['name']},'latest':_0x1a0548[_0x65dffc(0xce)]===_0x2b0c55,'created_at':_0x54a82c[_0x65dffc(0x13c)]['createdAt'],'updated_at':_0x54a82c['attributes'][_0x65dffc(0x130)],'url':_0x4ddece},_0x192093),0x0;}}
1
+ const a27_0x466491=a27_0xe88c;(function(_0x17fa91,_0x1df71e){const _0x566ab7=a27_0xe88c,_0x72a768=_0x17fa91();while(!![]){try{const _0xe9c6b=parseInt(_0x566ab7(0x1b1))/0x1+parseInt(_0x566ab7(0x1dd))/0x2*(parseInt(_0x566ab7(0x299))/0x3)+parseInt(_0x566ab7(0x29e))/0x4*(parseInt(_0x566ab7(0x22a))/0x5)+parseInt(_0x566ab7(0x1d2))/0x6+parseInt(_0x566ab7(0x226))/0x7+parseInt(_0x566ab7(0x277))/0x8*(parseInt(_0x566ab7(0x197))/0x9)+-parseInt(_0x566ab7(0x1cc))/0xa;if(_0xe9c6b===_0x1df71e)break;else _0x72a768['push'](_0x72a768['shift']());}catch(_0x314553){_0x72a768['push'](_0x72a768['shift']());}}}(a27_0x32ce,0xc4a4b));import a27_0x5bb097 from'chalk';import a27_0x35f653 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';function a27_0xe88c(_0x5b7801,_0x581fd5){_0x5b7801=_0x5b7801-0x175;const _0x32ce31=a27_0x32ce();let _0xe88cfe=_0x32ce31[_0x5b7801];return _0xe88cfe;}import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl,getWorkflowSessionUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x530073){const _0x2eaef9=a27_0xe88c;return!_0x530073&&(console[_0x2eaef9(0x25e)](_0x2eaef9(0x253)),console[_0x2eaef9(0x25e)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x530073;}function withJsonFormat(_0x11c116){const _0x122638=a27_0xe88c;if(!_0x11c116[_0x122638(0x1ee)]&&!_0x11c116['json']&&!_0x11c116[_0x122638(0x26d)]&&!_0x11c116['tsv'])return{..._0x11c116,'format':_0x122638(0x1c2),'json':!![]};return _0x11c116;}function formatJourneyState(_0x5292d8){const _0x17fb97=a27_0xe88c;switch(_0x5292d8){case _0x17fb97(0x254):return a27_0x5bb097[_0x17fb97(0x18f)](_0x17fb97(0x252));case _0x17fb97(0x298):return a27_0x5bb097[_0x17fb97(0x239)](_0x17fb97(0x1e0));case _0x17fb97(0x1b9):return a27_0x5bb097[_0x17fb97(0x256)](_0x17fb97(0x24e));case _0x17fb97(0x24b):return a27_0x5bb097['blue'](_0x17fb97(0x1ec));case _0x17fb97(0x1a5):return a27_0x5bb097[_0x17fb97(0x239)](_0x17fb97(0x293));default:return'('+_0x5292d8+')';}}function formatJourneyItem(_0x1d9782,_0x5aabad='',_0x142d6d){const _0x220149=a27_0xe88c,_0x56bc67=formatJourneyState(_0x1d9782[_0x220149(0x296)]),_0x2964b5=_0x142d6d?hyperlink(_0x1d9782[_0x220149(0x1e6)],_0x142d6d):_0x1d9782['journeyBundleName'];return _0x5aabad+_0x220149(0x275)+_0x2964b5+'\x20'+_0x56bc67;}function escapeRegex(_0x1808c7){const _0x367a06=a27_0xe88c;return _0x1808c7['replace'](/[.*+?^${}()|[\]\\]/g,_0x367a06(0x28a));}function globToRegex(_0x670918){const _0x4dd7d1=a27_0xe88c,_0x4a8da5=_0x670918[_0x4dd7d1(0x258)]('*')['map'](escapeRegex);return new RegExp(_0x4a8da5['join']('.*'),'i');}function buildRuleToNameMapping(_0x561ab8){const _0x4118d4=a27_0xe88c,_0xa76095=new Map();if(_0x561ab8['segments'])for(const [_0x1c0feb,_0x1ba976]of Object[_0x4118d4(0x278)](_0x561ab8[_0x4118d4(0x255)])){if(_0x1ba976['rule']){const _0x2d9b75=serializeRule(_0x1ba976[_0x4118d4(0x259)]),_0x49f260=_0xa76095['get'](_0x2d9b75);_0x49f260?_0x49f260[_0x4118d4(0x1d9)](_0x1c0feb):_0xa76095[_0x4118d4(0x1c7)](_0x2d9b75,[_0x1c0feb]);}}return _0xa76095;}async function resolveJourneyIdFromInput(_0x139912,_0x149aed,_0x139d17){const _0xe75371=a27_0xe88c,_0x2c6b6b=await resolveJourneyTarget(_0x139912,_0x149aed[_0xe75371(0x276)],_0x149aed[_0xe75371(0x23b)]),_0x1041db=_0x2c6b6b['parentSegment'];if(!_0x1041db)throw new SDKError(ErrorCode[_0xe75371(0x28f)],_0xe75371(0x18c));const _0x376f60=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x139d17['segment'][_0xe75371(0x20f)](_0x1041db),{'verbose':_0x149aed[_0xe75371(0x23b)]}),_0x447010=_0x376f60['data'],_0x377f79=await withSpinner(_0xe75371(0x23e),()=>_0x139d17[_0xe75371(0x21e)][_0xe75371(0x194)](_0x447010,_0x2c6b6b[_0xe75371(0x17a)]),{'verbose':_0x149aed['verbose']});return{'journeyId':_0x377f79[_0xe75371(0x17f)],'journeyName':_0x2c6b6b['journeyName'],'parentSegmentId':_0x447010};}async function resolveJourneyTarget(_0xfd2a05,_0x4f89da,_0x525003){const _0xed1013=a27_0xe88c;if(isYamlFilePath(_0xfd2a05))try{const _0x4acaee=await resolveYamlFilePath(_0xfd2a05);return _0x525003&&(console[_0xed1013(0x25e)]('Resolved\x20YAML\x20file:\x20'+_0xfd2a05),console[_0xed1013(0x25e)]('\x20\x20Parent\x20segment:\x20'+_0x4acaee[_0xed1013(0x276)]),console[_0xed1013(0x25e)]('\x20\x20Name:\x20'+_0x4acaee[_0xed1013(0x1ba)]),console[_0xed1013(0x25e)](_0xed1013(0x1ff)+(_0x4acaee[_0xed1013(0x178)]||'(root)'))),{'journeyName':_0x4acaee['segmentName'],'parentSegment':_0x4acaee[_0xed1013(0x276)],'resolved':_0x4acaee};}catch(_0x5b6882){throw new SDKError(ErrorCode[_0xed1013(0x28f)],_0xed1013(0x238)+_0x5b6882[_0xed1013(0x2a2)]);}if(!_0x4f89da)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xed1013(0x26c));return{'journeyName':_0xfd2a05,'parentSegment':_0x4f89da};}export class JourneyListCommand extends BaseCommand{[a27_0x466491(0x29b)]='journey:list';[a27_0x466491(0x270)]=a27_0x466491(0x211);async[a27_0x466491(0x271)](_0x196b71){const _0x15c7b6=a27_0x466491,{options:_0x5b6f30,args:_0x3d2735,tdx:_0x2dda55}=_0x196b71,_0x5c3a19=_0x3d2735[0x0],_0x288eea=_0x5b6f30['parentSegment'];if(!_0x288eea)return console[_0x15c7b6(0x25e)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x15c7b6(0x25e)](_0x15c7b6(0x210)),0x1;const _0x4ef5da=await withSpinner(_0x15c7b6(0x273),()=>_0x2dda55['segment'][_0x15c7b6(0x20f)](_0x288eea),{'verbose':_0x5b6f30['verbose']}),_0x2cc1f8=_0x4ef5da[_0x15c7b6(0x17f)];_0x5b6f30['verbose']&&(console[_0x15c7b6(0x25e)](_0x15c7b6(0x1be)+_0x288eea+'\x20(ID:\x20'+_0x2cc1f8+')'),_0x5c3a19&&console[_0x15c7b6(0x25e)]('Pattern:\x20'+_0x5c3a19));const _0x54521a=await withSpinner(_0x15c7b6(0x1a4),()=>_0x2dda55[_0x15c7b6(0x1e5)]['getParentFull'](_0x2cc1f8),{'verbose':_0x5b6f30[_0x15c7b6(0x23b)]}),_0x5e7667=_0x54521a[_0x15c7b6(0x17f)],_0x512b96=_0x5e7667[_0x15c7b6(0x1b7)],_0x347508=await withSpinner('Listing\x20journeys...',()=>_0x2dda55['journey'][_0x15c7b6(0x2a3)](_0x2cc1f8,_0x512b96),{'verbose':_0x5b6f30['verbose']});let _0x392fd0=_0x347508['data'][_0x15c7b6(0x1ca)];const _0x12d8a8=_0x347508[_0x15c7b6(0x17f)][_0x15c7b6(0x184)],_0x5bd4b2=new Map();for(const _0xc3dc73 of _0x12d8a8){_0x5bd4b2[_0x15c7b6(0x1c7)](_0xc3dc73['id'],_0xc3dc73[_0x15c7b6(0x29b)]);}if(_0x5c3a19){const _0x556f0a=globToRegex(_0x5c3a19);_0x392fd0=_0x392fd0['filter'](_0x528df8=>_0x556f0a[_0x15c7b6(0x24a)](_0x528df8[_0x15c7b6(0x1e6)]));}console['error']('✔\x20Found\x20'+_0x392fd0[_0x15c7b6(0x1c4)]+_0x15c7b6(0x292)+(_0x392fd0['length']!==0x1?'s':''));const _0x26530f=_0x11fcef=>{const _0x335bbf=_0x15c7b6;return getConsoleNextUrl(_0x5b6f30[_0x335bbf(0x1d0)],'/app/ps/'+_0x2cc1f8+'/e/'+_0x11fcef+_0x335bbf(0x266));};if(_0x5b6f30[_0x15c7b6(0x1ee)]==='table')await handleSDKOutput(_0x392fd0,_0x5b6f30);else{if(_0x5b6f30[_0x15c7b6(0x1ee)]===_0x15c7b6(0x1c2)){const _0x144dfd=_0x392fd0[_0x15c7b6(0x262)](_0x121686=>({..._0x121686,'url':_0x26530f(_0x121686['id'])}));await handleSDKOutput(_0x144dfd,_0x5b6f30);}else{console['log']('['+_0x288eea+']');const _0x2b6e99=new Map(),_0x185d7e=[];for(const _0x431ab8 of _0x392fd0){if(!_0x431ab8[_0x15c7b6(0x176)]||_0x431ab8[_0x15c7b6(0x176)]===_0x512b96)_0x185d7e[_0x15c7b6(0x1d9)](_0x431ab8);else{const _0x4ce949=_0x2b6e99[_0x15c7b6(0x1e1)](_0x431ab8[_0x15c7b6(0x176)])||[];_0x4ce949[_0x15c7b6(0x1d9)](_0x431ab8),_0x2b6e99[_0x15c7b6(0x1c7)](_0x431ab8[_0x15c7b6(0x176)],_0x4ce949);}}const _0x211bdd=(_0x546ee9,_0x1bfff0)=>_0x546ee9[_0x15c7b6(0x1e6)][_0x15c7b6(0x1bd)](_0x1bfff0[_0x15c7b6(0x1e6)],undefined,{'sensitivity':'base'});_0x185d7e['sort'](_0x211bdd);for(const _0x3b142a of _0x185d7e){console[_0x15c7b6(0x1df)](formatJourneyItem(_0x3b142a,'',_0x26530f(_0x3b142a['id'])));}const _0x401041=[..._0x2b6e99[_0x15c7b6(0x278)]()]['sort']((_0x176678,_0x8c9879)=>{const _0x2b4d5b=_0x15c7b6,_0x51c6ae=_0x5bd4b2[_0x2b4d5b(0x1e1)](_0x176678[0x0])||_0x176678[0x0],_0x341dc2=_0x5bd4b2[_0x2b4d5b(0x1e1)](_0x8c9879[0x0])||_0x8c9879[0x0];return _0x51c6ae[_0x2b4d5b(0x1bd)](_0x341dc2,undefined,{'sensitivity':_0x2b4d5b(0x1c9)});});for(const [_0x17172a,_0x1b8718]of _0x401041){const _0x302579=_0x5bd4b2[_0x15c7b6(0x1e1)](_0x17172a)||_0x17172a;console['log'](_0x15c7b6(0x1d7)+_0x302579),_0x1b8718[_0x15c7b6(0x182)](_0x211bdd);for(const _0x393b22 of _0x1b8718){console[_0x15c7b6(0x1df)](formatJourneyItem(_0x393b22,'\x20\x20',_0x26530f(_0x393b22['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x466491(0x29b)]=a27_0x466491(0x21f);[a27_0x466491(0x270)]=a27_0x466491(0x218);async[a27_0x466491(0x271)](_0x47a271){const _0x246146=a27_0x466491,{options:_0x27709f,args:_0x2a4f8c,tdx:_0x16b498}=_0x47a271,_0x5d20f9=_0x2a4f8c[0x0];if(!_0x5d20f9)return console[_0x246146(0x25e)](_0x246146(0x253)),console[_0x246146(0x25e)](_0x246146(0x1b2)),console[_0x246146(0x25e)](_0x246146(0x290)),console[_0x246146(0x25e)](_0x246146(0x1cb)),0x1;_0x27709f[_0x246146(0x23b)]&&console[_0x246146(0x25e)](_0x246146(0x18a)+_0x5d20f9);const {journeyId:_0x1abc07,parentSegmentId:_0x246e58}=await resolveJourneyIdFromInput(_0x5d20f9,_0x27709f,_0x16b498);if(_0x27709f[_0x246146(0x206)]){const _0x5c9b9c=getConsoleNextUrl(_0x27709f[_0x246146(0x1d0)],_0x246146(0x225)+_0x246e58+_0x246146(0x17b)+_0x1abc07+_0x246146(0x1b4));return console['error'](a27_0x5bb097[_0x246146(0x18f)]('✔')+_0x246146(0x250)+a27_0x5bb097[_0x246146(0x1ea)](_0x5c9b9c)),openBrowser(_0x5c9b9c),0x0;}const _0x1a0fb8=await withSpinner('Getting\x20journey\x20details...',()=>_0x16b498[_0x246146(0x21e)][_0x246146(0x240)](_0x1abc07),{'verbose':_0x27709f[_0x246146(0x23b)]}),_0x1d6dc0=_0x1a0fb8['data'],_0x624851=_0x27709f['includeStats'];let _0x5d08d9;if(_0x624851)try{const _0x2f97ca=await withSpinner(_0x246146(0x297),()=>_0x16b498[_0x246146(0x21e)][_0x246146(0x1da)](_0x1abc07),{'verbose':_0x27709f[_0x246146(0x23b)]});_0x5d08d9=_0x2f97ca[_0x246146(0x17f)];}catch{_0x27709f[_0x246146(0x23b)]&&console[_0x246146(0x25e)](_0x246146(0x231));}const _0x441cbb=getConsoleNextUrl(_0x27709f[_0x246146(0x1d0)],'/app/ps/'+_0x246e58+_0x246146(0x17b)+_0x1abc07+_0x246146(0x1b4)),_0x7344fe={'id':_0x1d6dc0['id'],'name':_0x1d6dc0[_0x246146(0x27d)][_0x246146(0x29b)],'description':_0x1d6dc0[_0x246146(0x27d)][_0x246146(0x270)],'state':_0x1d6dc0[_0x246146(0x27d)][_0x246146(0x296)],'paused':_0x1d6dc0[_0x246146(0x27d)][_0x246146(0x1b9)],'reentry_mode':_0x1d6dc0[_0x246146(0x27d)]['reentryMode'],'stages':_0x1d6dc0[_0x246146(0x27d)][_0x246146(0x23d)]?.[_0x246146(0x1c4)]||0x0,..._0x1d6dc0['attributes'][_0x246146(0x189)]&&{'goal':_0x1d6dc0[_0x246146(0x27d)][_0x246146(0x189)][_0x246146(0x29b)]},..._0x5d08d9&&{'statistics':{'size':_0x5d08d9['size'],'entered':_0x5d08d9[_0x246146(0x216)],'goal_achieved':_0x5d08d9[_0x246146(0x21b)],'completion_rate':_0x5d08d9['completionRate'],'exit_or_jump':_0x5d08d9[_0x246146(0x1ac)],'exit_or_jump_rate':_0x5d08d9[_0x246146(0x21a)],'stages':_0x5d08d9[_0x246146(0x26a)]}},'url':_0x441cbb};return await handleSingleObjectOutput(_0x7344fe,_0x27709f),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x466491(0x193);[a27_0x466491(0x270)]=a27_0x466491(0x261);async[a27_0x466491(0x271)](_0x30989c){const _0x1e90db=a27_0x466491,{options:_0x3be4ff,args:_0x108559,tdx:_0x116a84}=_0x30989c,_0x1ac4e1=_0x108559[0x0];if(!requireNameOrPath(_0x1ac4e1))return 0x1;_0x3be4ff['verbose']&&console['error'](_0x1e90db(0x18a)+_0x1ac4e1);const _0x527fe8=_0x3be4ff,_0x41609b=_0x527fe8['from'],_0x2efad8=_0x527fe8['to'],_0xb86ce=_0x527fe8['includeHistory'],_0x1b9627=_0x527fe8[_0x1e90db(0x1f2)];_0xb86ce&&!_0x41609b&&!_0x2efad8&&console[_0x1e90db(0x25e)](_0x1e90db(0x198));const _0x1c5a8d=_0xb86ce?withJsonFormat(_0x3be4ff):_0x3be4ff,{journeyId:_0x133fba,journeyName:_0x5d9475}=await resolveJourneyIdFromInput(_0x1ac4e1,_0x1c5a8d,_0x116a84),_0x2d1115=_0x41609b||_0x2efad8?{'from':_0x41609b,'to':_0x2efad8}:undefined,_0x5df060=await withSpinner(_0x1e90db(0x297),()=>Promise[_0x1e90db(0x1fa)]([_0x116a84['journey']['getJourney'](_0x133fba),_0x116a84[_0x1e90db(0x21e)][_0x1e90db(0x1da)](_0x133fba,_0x2d1115)]),{'verbose':_0x1c5a8d[_0x1e90db(0x23b)]}),[_0x771c94,_0x2d1fe8]=_0x5df060[_0x1e90db(0x17f)];if(!_0x2d1fe8||_0x2d1fe8[_0x1e90db(0x1f9)]===null)return console[_0x1e90db(0x25e)](_0x1e90db(0x207)+_0x5d9475),console['error'](_0x1e90db(0x1ae)),0x0;const _0x2ceade=buildStageNameMap(_0x771c94),_0x4081d2=!!(_0x2d1115&&_0x2d1fe8[_0x1e90db(0x267)]?.[_0x1e90db(0x1c4)]),_0x5c456e={'stageNameMap':_0x2ceade,'hasPeriod':_0x4081d2,'includeHistory':!!_0xb86ce};if(_0x1b9627&&_0x2d1fe8[_0x1e90db(0x26a)]){const _0x5dcec7=_0x2d1fe8[_0x1e90db(0x26a)][_0x1e90db(0x175)](_0x244b7a=>{const _0x1bbaf2=_0x1e90db,_0x4667ac=_0x2ceade[_0x1bbaf2(0x1e1)](_0x244b7a['id'])??'';return _0x4667ac[_0x1bbaf2(0x214)]()===_0x1b9627[_0x1bbaf2(0x214)]();});if(_0x5dcec7)return await handleSingleObjectOutput(formatStageStats(_0x5dcec7,_0x5c456e),_0x1c5a8d),0x0;const _0x257d2a=_0x2d1fe8[_0x1e90db(0x26a)][_0x1e90db(0x262)](_0xace72b=>_0x2ceade[_0x1e90db(0x1e1)](_0xace72b['id'])??_0xace72b['id']);return console[_0x1e90db(0x25e)](_0x1e90db(0x187)+_0x1b9627+_0x1e90db(0x196)),console[_0x1e90db(0x25e)](_0x1e90db(0x22c)+_0x257d2a[_0x1e90db(0x236)](',\x20')),0x1;}const _0xd55cbe=_0x2d1fe8['stages']?.[_0x1e90db(0x262)](_0x125d6c=>formatStageStats(_0x125d6c,_0x5c456e)),_0x4351fa=assembleJourneyStats(_0x2d1fe8,{'from':_0x41609b,'to':_0x2efad8,'includeHistory':_0xb86ce});return await this['renderStats'](_0x4351fa,_0xd55cbe??[],_0x1c5a8d),0x0;}async[a27_0x466491(0x177)](_0x7fd530,_0x21bba2,_0x32d7ba){const _0xfe06aa=a27_0x466491,_0x1016c7=_0x32d7ba[_0xfe06aa(0x1ee)]==='json'||_0x32d7ba[_0xfe06aa(0x1ee)]===_0xfe06aa(0x26d)||_0x32d7ba[_0xfe06aa(0x1c2)]||_0x32d7ba[_0xfe06aa(0x26d)];if(_0x1016c7){_0x7fd530[_0xfe06aa(0x26a)]=_0x21bba2,await handleSingleObjectOutput(_0x7fd530,_0x32d7ba);return;}await handleSingleObjectOutput(_0x7fd530,_0x32d7ba);for(const _0x2ca323 of _0x21bba2){console['log'](''),console[_0xfe06aa(0x1df)](String(a27_0x5bb097[_0xfe06aa(0x1ea)][_0xfe06aa(0x1cf)]('['+_0x2ca323[_0xfe06aa(0x29b)]+']'))+a27_0x5bb097[_0xfe06aa(0x239)]('\x20'+_0x2ca323['id']));const {id:_0x2ea5c5,name:_0x56ee0b,..._0xdbba8d}=_0x2ca323;await handleSingleObjectOutput(_0xdbba8d,_0x32d7ba);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x466491(0x29b)]='journey:traffic';['description']=a27_0x466491(0x1a0);async[a27_0x466491(0x271)](_0x5711ee){const _0x2d2043=a27_0x466491,{options:_0x1611ab,args:_0x54b542,tdx:_0x480b1b}=_0x5711ee,_0x32589e=_0x54b542[0x0];if(!requireNameOrPath(_0x32589e))return 0x1;_0x1611ab[_0x2d2043(0x23b)]&&console[_0x2d2043(0x25e)](_0x2d2043(0x18a)+_0x32589e);const _0x1348b3=_0x1611ab,_0x341a4e=_0x1348b3[_0x2d2043(0x25d)],_0x260bc3=_0x1348b3[_0x2d2043(0x221)],_0x57cda5=_0x1348b3['to'],_0x20690b=_0x1348b3[_0x2d2043(0x288)];if(_0x341a4e&&_0x341a4e!==_0x2d2043(0x1fb)&&_0x341a4e!==_0x2d2043(0x1bb))return console[_0x2d2043(0x25e)]('Error:\x20Invalid\x20--type\x20\x22'+_0x341a4e+_0x2d2043(0x2a1)),0x1;const _0x13f96f=withJsonFormat(_0x1611ab),{journeyId:_0x4b6ab1,journeyName:_0x3b5b2b}=await resolveJourneyIdFromInput(_0x32589e,_0x13f96f,_0x480b1b),_0x51fc1c={'type':_0x341a4e,'from':_0x260bc3,'to':_0x57cda5,'limit':_0x20690b},_0x5bedcc=await withSpinner(_0x2d2043(0x281),()=>_0x480b1b[_0x2d2043(0x21e)][_0x2d2043(0x25b)](_0x4b6ab1,_0x51fc1c),{'verbose':_0x13f96f[_0x2d2043(0x23b)]}),_0x36c775=_0x5bedcc[_0x2d2043(0x17f)],_0x3eca11=_0x36c775[_0x2d2043(0x1fb)]&&(_0x36c775['conversion'][_0x2d2043(0x1f0)][_0x2d2043(0x1c4)]>0x0||_0x36c775[_0x2d2043(0x1fb)][_0x2d2043(0x22f)][_0x2d2043(0x1c4)]>0x0),_0x252f3b=_0x36c775[_0x2d2043(0x1bb)]&&_0x36c775[_0x2d2043(0x1bb)][_0x2d2043(0x1c4)]>0x0;if(!_0x3eca11&&!_0x252f3b)return console[_0x2d2043(0x25e)](_0x2d2043(0x200)+_0x3b5b2b),console['error']('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x260bc3&&_0x57cda5&&console[_0x2d2043(0x25e)](_0x2d2043(0x287)),0x0;return await handleSingleObjectOutput(_0x36c775,_0x13f96f),0x0;}}function formatStageStats(_0x1b23b3,_0x3f8eb1){const _0x370bc2=a27_0x466491,_0x1be5af=_0x3f8eb1['hasPeriod']&&_0x1b23b3[_0x370bc2(0x267)]?.[_0x370bc2(0x1c4)]?aggregateStageHistory(_0x1b23b3[_0x370bc2(0x267)]):{'size':_0x1b23b3[_0x370bc2(0x222)],'entered':_0x1b23b3[_0x370bc2(0x216)],'milestone':_0x1b23b3[_0x370bc2(0x201)],'milestone_rate':_0x1b23b3[_0x370bc2(0x17e)],'exit_or_jump':_0x1b23b3['exitOrJumpSize'],'exit_or_jump_rate':_0x1b23b3[_0x370bc2(0x21a)]},_0x49b358={'id':_0x1b23b3['id'],'name':_0x3f8eb1[_0x370bc2(0x1ef)][_0x370bc2(0x1e1)](_0x1b23b3['id'])??_0x1b23b3['id'],..._0x1be5af};return _0x3f8eb1[_0x370bc2(0x17c)]&&_0x3f8eb1[_0x370bc2(0x1e2)]&&_0x1b23b3['history']&&(_0x49b358[_0x370bc2(0x267)]=_0x1b23b3[_0x370bc2(0x267)]),_0x49b358;}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';[a27_0x466491(0x270)]=a27_0x466491(0x1d1);async['execute'](_0x22cab6){const _0x3576ef=a27_0x466491,{options:_0x1eef4d,args:_0x17551d,tdx:_0x4f1476}=_0x22cab6,_0x4d4288=_0x17551d[0x0];if(!requireNameOrPath(_0x4d4288))return 0x1;_0x1eef4d[_0x3576ef(0x23b)]&&console[_0x3576ef(0x25e)](_0x3576ef(0x18a)+_0x4d4288);const {journeyId:_0x1e2a53,journeyName:_0xbc06b9}=await resolveJourneyIdFromInput(_0x4d4288,_0x1eef4d,_0x4f1476);if(!_0x1eef4d[_0x3576ef(0x28b)]){const _0x547441=await confirm(_0x3576ef(0x28e)+_0xbc06b9+'\x22?');if(!_0x547441)return console[_0x3576ef(0x25e)](_0x3576ef(0x26f)),0x0;}const _0x32180c=await withSpinner(_0x3576ef(0x249),()=>_0x4f1476[_0x3576ef(0x21e)]['pause'](_0x1e2a53),{'verbose':_0x1eef4d[_0x3576ef(0x23b)]}),_0x97e3ba=_0x32180c['data'];return console['error']('✔\x20Journey\x20\x22'+_0x97e3ba['attributes']['name']+_0x3576ef(0x247)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a27_0x466491(0x29b)]=a27_0x466491(0x188);[a27_0x466491(0x270)]='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a27_0x466491(0x271)](_0x5c0b8f){const _0x459452=a27_0x466491,{options:_0xe0f7ee,args:_0x56ed21,tdx:_0x1805db}=_0x5c0b8f,_0x1cd67f=_0x56ed21[0x0];if(!requireNameOrPath(_0x1cd67f))return 0x1;_0xe0f7ee['verbose']&&console['error']('Input:\x20'+_0x1cd67f);const {journeyId:_0x1eafae,journeyName:_0x51f544}=await resolveJourneyIdFromInput(_0x1cd67f,_0xe0f7ee,_0x1805db);if(_0xe0f7ee[_0x459452(0x1eb)])return await this[_0x459452(0x272)](_0x5c0b8f,_0x1eafae,_0x51f544);if(!_0xe0f7ee[_0x459452(0x28b)]){const _0x4f7135=await confirm(_0x459452(0x223)+_0x51f544+'\x22?');if(!_0x4f7135)return console[_0x459452(0x25e)]('Cancelled'),0x0;}const _0x3e3256=await withSpinner(_0x459452(0x183),()=>_0x1805db[_0x459452(0x21e)][_0x459452(0x1c3)](_0x1eafae),{'verbose':_0xe0f7ee['verbose']}),_0x51966c=_0x3e3256[_0x459452(0x17f)],_0x37056b=getWorkflowSessionUrl(_0xe0f7ee[_0x459452(0x1d0)],_0x51966c[_0x459452(0x1ed)],_0x51966c['workflowSessionId']);return console[_0x459452(0x25e)]('\x0a'+a27_0x5bb097[_0x459452(0x18f)]('✔')+_0x459452(0x1d6)),console[_0x459452(0x25e)]('\x20\x20'+a27_0x5bb097['dim'](_0x459452(0x1af))+'\x20'+_0x51f544),console[_0x459452(0x25e)]('\x20\x20'+a27_0x5bb097['dim'](_0x459452(0x1f8))+'\x20'+_0x51966c['status']),console[_0x459452(0x25e)]('\x20\x20'+a27_0x5bb097['dim'](_0x459452(0x1fc))+'\x20'+_0x51966c[_0x459452(0x1fd)]),console[_0x459452(0x25e)]('\x20\x20'+_0x37056b),0x0;}async['executeDryRun'](_0x319c47,_0x5a686a,_0x342314){const _0x28931f=a27_0x466491,{options:_0x534478,tdx:_0x2c828c}=_0x319c47,_0x5dc1da=await withSpinner(_0x28931f(0x192)+_0x342314+'...',()=>Promise[_0x28931f(0x1fa)]([_0x2c828c[_0x28931f(0x21e)]['getJourney'](_0x5a686a),_0x2c828c[_0x28931f(0x21e)][_0x28931f(0x22d)](_0x5a686a)]),{'verbose':_0x534478[_0x28931f(0x23b)]}),[_0x401455,_0x1bc167]=_0x5dc1da[_0x28931f(0x17f)],_0x4eb292=_0x401455[_0x28931f(0x27d)],_0x5aee2c=_0x4eb292[_0x28931f(0x23d)];console['log'](a27_0x5bb097[_0x28931f(0x1cf)](_0x28931f(0x1af)),_0x4eb292[_0x28931f(0x29b)]),console[_0x28931f(0x1df)](a27_0x5bb097[_0x28931f(0x1cf)](_0x28931f(0x294)),_0x401455['id']),console[_0x28931f(0x1df)](a27_0x5bb097[_0x28931f(0x1cf)](_0x28931f(0x18b)),_0x4eb292['state']),console['log'](a27_0x5bb097[_0x28931f(0x1cf)](_0x28931f(0x1f5)),_0x4eb292[_0x28931f(0x1b9)]?a27_0x5bb097['yellow'](_0x28931f(0x28b)):a27_0x5bb097[_0x28931f(0x18f)]('no')),console[_0x28931f(0x1df)](a27_0x5bb097[_0x28931f(0x1cf)]('Parent\x20segment\x20ID:'),_0x4eb292['audienceId']);const _0x2bfecb=_0x5aee2c[_0x28931f(0x1c4)]>0x0?'\x20('+_0x5aee2c[_0x28931f(0x262)](_0x28d016=>_0x28d016[_0x28931f(0x29b)])[_0x28931f(0x236)](',\x20')+')':'';console[_0x28931f(0x1df)](a27_0x5bb097[_0x28931f(0x1cf)]('Stages:'),''+_0x5aee2c[_0x28931f(0x1c4)]+_0x2bfecb),console[_0x28931f(0x1df)]('');if(_0x1bc167[_0x28931f(0x1c4)]===0x0)console[_0x28931f(0x1df)](a27_0x5bb097[_0x28931f(0x1cf)](_0x28931f(0x233)),a27_0x5bb097[_0x28931f(0x239)](_0x28931f(0x257)));else{console[_0x28931f(0x1df)](a27_0x5bb097[_0x28931f(0x1cf)](_0x28931f(0x233)));for(const _0x14f375 of _0x1bc167){const _0x2b79ec=_0x14f375[_0x28931f(0x29b)]??_0x28931f(0x220),_0x13beff=_0x14f375[_0x28931f(0x203)]!=null?_0x28931f(0x1a7)+_0x14f375[_0x28931f(0x203)]:_0x28931f(0x230),_0x39513c=_0x14f375[_0x28931f(0x1fe)]?''+_0x14f375[_0x28931f(0x1fe)]+(_0x14f375[_0x28931f(0x27b)]?_0x28931f(0x227)+_0x14f375[_0x28931f(0x27b)]:''):_0x28931f(0x217),_0x322ed1=_0x14f375['runAfterJourneyRefresh']?_0x28931f(0x191):'';console[_0x28931f(0x1df)]('\x20\x20'+a27_0x5bb097[_0x28931f(0x256)](_0x28931f(0x1c5))+'\x20'+_0x2b79ec+_0x28931f(0x1a8)+_0x13beff+_0x28931f(0x20d)+_0x39513c+_0x322ed1);}}return console[_0x28931f(0x1df)](a27_0x5bb097[_0x28931f(0x256)](_0x28931f(0x235))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x466491(0x29b)]=a27_0x466491(0x195);[a27_0x466491(0x270)]=a27_0x466491(0x1c0);async[a27_0x466491(0x271)](_0x3a0980){const _0x15175a=a27_0x466491,{options:_0x2565ab,args:_0x2cea7a,tdx:_0xed4fbe}=_0x3a0980,_0x59dd0f=_0x2cea7a[0x0];if(!requireNameOrPath(_0x59dd0f))return 0x1;_0x2565ab['verbose']&&console[_0x15175a(0x25e)](_0x15175a(0x18a)+_0x59dd0f);const {journeyId:_0x599a45,journeyName:_0x54b445}=await resolveJourneyIdFromInput(_0x59dd0f,_0x2565ab,_0xed4fbe);if(_0x2565ab[_0x15175a(0x1eb)])return await this[_0x15175a(0x272)](_0x3a0980,_0x599a45,_0x54b445);if(!_0x2565ab['yes']){const _0x4c1ce3=await confirm(_0x15175a(0x1dc)+_0x54b445+'\x22?');if(!_0x4c1ce3)return console[_0x15175a(0x25e)](_0x15175a(0x26f)),0x0;}const _0x41b6a9=await withSpinner(_0x15175a(0x1aa),()=>_0xed4fbe[_0x15175a(0x21e)]['resume'](_0x599a45),{'verbose':_0x2565ab[_0x15175a(0x23b)]}),_0x523cfc=_0x41b6a9[_0x15175a(0x17f)];return console[_0x15175a(0x25e)](_0x15175a(0x1d5)+_0x523cfc[_0x15175a(0x27d)][_0x15175a(0x29b)]+_0x15175a(0x1d8)),0x0;}async[a27_0x466491(0x272)](_0x27f968,_0x1e4a0b,_0x6b0722){const _0x40789f=a27_0x466491,{options:_0x2e7378,tdx:_0x21a3fa}=_0x27f968,_0x4de32f=await withSpinner('Fetching\x20journey\x20'+_0x6b0722+'...',()=>Promise[_0x40789f(0x1fa)]([_0x21a3fa['journey'][_0x40789f(0x240)](_0x1e4a0b),_0x21a3fa['journey'][_0x40789f(0x22d)](_0x1e4a0b)]),{'verbose':_0x2e7378['verbose']}),[_0x474fd9,_0x5bc56c]=_0x4de32f['data'],_0x23148d=_0x474fd9[_0x40789f(0x27d)],_0x1edab8=_0x23148d[_0x40789f(0x23d)];console[_0x40789f(0x1df)](a27_0x5bb097[_0x40789f(0x1cf)](_0x40789f(0x1af)),_0x23148d[_0x40789f(0x29b)]),console[_0x40789f(0x1df)](a27_0x5bb097[_0x40789f(0x1cf)](_0x40789f(0x294)),_0x474fd9['id']),console['log'](a27_0x5bb097[_0x40789f(0x1cf)](_0x40789f(0x18b)),_0x23148d['state']),console[_0x40789f(0x1df)](a27_0x5bb097[_0x40789f(0x1cf)](_0x40789f(0x1f5)),_0x23148d['paused']?a27_0x5bb097[_0x40789f(0x256)](_0x40789f(0x28b)):a27_0x5bb097[_0x40789f(0x18f)]('no'));_0x23148d[_0x40789f(0x1a2)]&&console['log'](a27_0x5bb097['bold']('Paused\x20at:'),_0x23148d[_0x40789f(0x1a2)]);console[_0x40789f(0x1df)](a27_0x5bb097[_0x40789f(0x1cf)]('Parent\x20segment\x20ID:'),_0x23148d[_0x40789f(0x1e8)]);const _0x44f3a5=_0x1edab8[_0x40789f(0x1c4)]>0x0?'\x20('+_0x1edab8[_0x40789f(0x262)](_0x4adffa=>_0x4adffa[_0x40789f(0x29b)])['join'](',\x20')+')':'';console[_0x40789f(0x1df)](a27_0x5bb097[_0x40789f(0x1cf)](_0x40789f(0x27a)),''+_0x1edab8[_0x40789f(0x1c4)]+_0x44f3a5),console[_0x40789f(0x1df)]('');if(_0x5bc56c[_0x40789f(0x1c4)]===0x0)console[_0x40789f(0x1df)](a27_0x5bb097[_0x40789f(0x1cf)](_0x40789f(0x233)),a27_0x5bb097[_0x40789f(0x239)](_0x40789f(0x257)));else{console['log'](a27_0x5bb097['bold'](_0x40789f(0x233)));for(const _0x198e86 of _0x5bc56c){const _0x5a6562=_0x198e86['name']??_0x40789f(0x220),_0x25a7f3=_0x198e86[_0x40789f(0x203)]!=null?'connection\x20'+_0x198e86[_0x40789f(0x203)]:_0x40789f(0x230),_0x51a724=_0x198e86[_0x40789f(0x1fe)]?''+_0x198e86[_0x40789f(0x1fe)]+(_0x198e86[_0x40789f(0x27b)]?_0x40789f(0x227)+_0x198e86[_0x40789f(0x27b)]:''):'none',_0x2f95a6=_0x198e86[_0x40789f(0x208)]?_0x40789f(0x191):'';console[_0x40789f(0x1df)]('\x20\x20'+a27_0x5bb097[_0x40789f(0x256)](_0x40789f(0x1c5))+'\x20'+_0x5a6562+_0x40789f(0x1a8)+_0x25a7f3+_0x40789f(0x20d)+_0x51a724+_0x2f95a6);}}return console[_0x40789f(0x1df)](a27_0x5bb097['yellow'](_0x40789f(0x185))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x466491(0x29b)]=a27_0x466491(0x186);['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x466491(0x271)](_0xa4809a){const _0x28bcad=a27_0x466491,{options:_0x4aa1c1,args:_0x5c1283,tdx:_0x570b60}=_0xa4809a,_0x3e14bf=_0x4aa1c1,_0xcd468c=_0x5c1283[0x0],_0x16a6c8=_0xcd468c&&isYamlFilePath(_0xcd468c),_0x2e5208=await resolveTarget({'arg':_0x16a6c8?_0xcd468c:undefined,'contextParent':_0x4aa1c1[_0x28bcad(0x276)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2e5208))return _0x2e5208[_0x28bcad(0x22b)]===_0x28bcad(0x1f4)?(console[_0x28bcad(0x25e)](a27_0x5bb097[_0x28bcad(0x256)](_0x28bcad(0x23a))),console['error'](_0x28bcad(0x19c)),console['error'](_0x28bcad(0x1b6)),console[_0x28bcad(0x25e)](_0x28bcad(0x26b)),console[_0x28bcad(0x25e)](_0x28bcad(0x237))):(console[_0x28bcad(0x25e)](a27_0x5bb097[_0x28bcad(0x212)](_0x28bcad(0x215)+_0x2e5208[_0x28bcad(0x2a2)]+'\x0a')),_0x2e5208[_0x28bcad(0x22e)]&&console[_0x28bcad(0x25e)](a27_0x5bb097[_0x28bcad(0x1ea)](_0x2e5208[_0x28bcad(0x22e)]))),0x1;let _0x1d5fb9=_0x16a6c8?undefined:_0xcd468c,_0x23b63b,_0x16be69;_0x2e5208[_0x28bcad(0x25d)]===_0x28bcad(0x286)&&(_0x1d5fb9=_0x2e5208['resourceName'],_0x23b63b=_0x2e5208[_0x28bcad(0x213)],_0x16be69=_0x2e5208[_0x28bcad(0x178)]);const _0x2d21dc=_0x2e5208['parentName'],_0x4baddc=_0x2e5208[_0x28bcad(0x1e7)];_0x3e14bf[_0x28bcad(0x23b)]&&(console[_0x28bcad(0x25e)](_0x28bcad(0x1be)+_0x2d21dc),console[_0x28bcad(0x25e)](_0x28bcad(0x282)+_0x4baddc),_0x1d5fb9&&console['error'](_0x28bcad(0x27c)+_0x1d5fb9),_0x23b63b&&console['error'](_0x28bcad(0x2a5)+_0x23b63b),_0x16be69&&console[_0x28bcad(0x25e)]('Folder\x20path:\x20'+_0x16be69));const _0x3b555b=await withSpinner(_0x28bcad(0x273),()=>_0x570b60[_0x28bcad(0x1e5)][_0x28bcad(0x20f)](_0x2d21dc),{'verbose':_0x4aa1c1[_0x28bcad(0x23b)]}),_0x11d5a4=_0x3b555b[_0x28bcad(0x17f)],{journeys:_0x1c9def,folders:_0x130e79}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x438d94=_0x28bcad,[_0x5abf1d,_0x4f7447]=await Promise['all']([_0x570b60['journey'][_0x438d94(0x1f7)](_0x11d5a4,undefined,{'includeAllVersions':!![]}),_0x570b60[_0x438d94(0x1e5)][_0x438d94(0x209)](_0x11d5a4)]);return{'journeys':_0x5abf1d,'folders':_0x4f7447};},{'verbose':_0x4aa1c1[_0x28bcad(0x23b)]})['then'](_0x2998cc=>_0x2998cc[_0x28bcad(0x17f)]);let _0x1913f0=_0x1c9def;const _0x4d04d5=buildFolderIdToPathMap(_0x130e79);if(_0x1d5fb9){const _0x4f7426=_0x1913f0[_0x28bcad(0x269)](_0x7a135b=>_0x7a135b[_0x28bcad(0x1e6)]['toLowerCase']()===_0x1d5fb9[_0x28bcad(0x214)]());if(_0x4f7426[_0x28bcad(0x1c4)]===0x0)return console['error'](_0x28bcad(0x1e4)+_0x1d5fb9),console[_0x28bcad(0x25e)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x1913f0=_0x4f7426;}if(_0x16be69!==undefined){const _0x4eb266=_0x1913f0[_0x28bcad(0x269)](_0x413b0d=>{const _0x3866da=_0x28bcad,_0x37517a=_0x413b0d[_0x3866da(0x176)]?_0x4d04d5[_0x3866da(0x1e1)](_0x413b0d[_0x3866da(0x176)])||'':'';return _0x37517a===_0x16be69;});if(_0x4eb266[_0x28bcad(0x1c4)]===0x0&&_0x1913f0[_0x28bcad(0x1c4)]>0x0){console[_0x28bcad(0x25e)](_0x28bcad(0x21c)+_0x1d5fb9+_0x28bcad(0x19d)+(_0x16be69||_0x28bcad(0x246))),console[_0x28bcad(0x25e)](_0x28bcad(0x241));for(const _0x510b3b of _0x1913f0){const _0x291740=_0x510b3b['folderId']?_0x4d04d5[_0x28bcad(0x1e1)](_0x510b3b[_0x28bcad(0x176)])||'':'';console[_0x28bcad(0x25e)](_0x28bcad(0x1a3)+(_0x291740||_0x28bcad(0x1b0))+'/'+_0x510b3b['journeyBundleName']);}return 0x1;}_0x1913f0=_0x4eb266;}if(_0x1913f0[_0x28bcad(0x1c4)]===0x0)return console['error']('No\x20journeys\x20found'),0x0;const _0x1cf84e=new Map();for(const _0x3dd22f of _0x1913f0){const _0x43afdb=_0x3dd22f['journeyBundleId'];!_0x1cf84e['has'](_0x43afdb)&&_0x1cf84e[_0x28bcad(0x1c7)](_0x43afdb,[]),_0x1cf84e[_0x28bcad(0x1e1)](_0x43afdb)[_0x28bcad(0x1d9)](_0x3dd22f);}for(const _0x553c38 of _0x1cf84e['values']()){_0x553c38['sort']((_0x30a7bb,_0x12f721)=>(_0x30a7bb['versionNumber']||0x0)-(_0x12f721[_0x28bcad(0x18d)]||0x0));}const _0x46f4da=[],{idToEmailMap:_0x15bfea,connectionIdToNameMap:_0x3c9373}=await withSpinner(_0x28bcad(0x29d),async()=>{const _0xf3a8bd=_0x28bcad,[_0x31c0a7,_0x1730a1]=await Promise['all']([_0x570b60[_0xf3a8bd(0x1b3)]['buildIdToEmailMap'](),_0x570b60['connection'][_0xf3a8bd(0x234)]()]);return{'idToEmailMap':_0x31c0a7,'connectionIdToNameMap':_0x1730a1};},{'verbose':_0x4aa1c1[_0x28bcad(0x23b)]})[_0x28bcad(0x1ab)](_0x3a9e58=>_0x3a9e58[_0x28bcad(0x17f)]);for(const _0x394976 of _0x1cf84e[_0x28bcad(0x1f3)]()){const _0x271a12=_0x394976[0x0][_0x28bcad(0x1e6)],_0x3bca87=_0x394976[0x0][_0x28bcad(0x176)],_0x4bc618=_0x3bca87?_0x4d04d5[_0x28bcad(0x1e1)](_0x3bca87)||'':'',_0x52f43b=_0x4bc618?a27_0x35f653[_0x28bcad(0x236)](_0x4baddc,_0x4bc618):_0x4baddc,_0x26030f=_0x23b63b||a27_0x35f653['join'](_0x52f43b,sanitizeFileName(_0x271a12)+_0x28bcad(0x20b));let _0x4d0dd2,_0x3e8a1b;if(existsSync(_0x26030f))try{const _0x1453c7=readFileSync(_0x26030f,_0x28bcad(0x29a)),_0x266d4d=parseYamlString(_0x1453c7);_0x3e8a1b=_0x266d4d,_0x4d0dd2=buildRuleToNameMapping(_0x266d4d),_0x3e14bf[_0x28bcad(0x23b)]&&_0x4d0dd2['size']>0x0&&console[_0x28bcad(0x25e)](_0x28bcad(0x229)+_0x4d0dd2['size']+_0x28bcad(0x202)+_0x271a12);}catch(_0x9bd167){_0x3e14bf[_0x28bcad(0x23b)]&&console[_0x28bcad(0x25e)](_0x28bcad(0x242)+_0x9bd167['message']);}const _0x12d3b9=[],_0x9f00c8=new Set(),_0x256bd8=new Map(),_0x1a55b7=new Map(),_0x48df60=new Set(),_0x53bd6d=new Map(),_0x4bad85=new Map(),_0x322413=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x271a12+_0x28bcad(0x28c),async _0x5f561e=>{const _0x465a85=_0x28bcad;for(const _0x8f794c of _0x394976){const _0xc2d6b6=_0x394976[_0x465a85(0x1c4)]>0x1?_0x8f794c[_0x465a85(0x1e6)]+'\x20v'+(_0x8f794c[_0x465a85(0x18d)]||0x1):_0x8f794c[_0x465a85(0x1e6)];_0x5f561e['setPhase'](_0x465a85(0x1a1)+_0xc2d6b6);const _0x57e549=await _0x570b60[_0x465a85(0x21e)][_0x465a85(0x240)](_0x8f794c['id']),_0xe9c420=_0x57e549[_0x465a85(0x27d)]?.[_0x465a85(0x1e8)],_0x404ecc={'resolveSegment':async _0x13f06b=>{const _0x2c572d=_0x465a85;if(!_0xe9c420)return{'name':_0x13f06b,'isJourneyLocal':![]};const _0x353c33=_0x256bd8[_0x2c572d(0x1e1)](_0x13f06b);if(_0x353c33)return _0x353c33;try{const _0x3b3aed=await _0x570b60[_0x2c572d(0x1e5)][_0x2c572d(0x24c)](_0xe9c420,_0x13f06b),_0x501185=_0x3b3aed[_0x2c572d(0x1db)]===SEGMENT_KIND_JOURNEY;let _0x3aabcc,_0x25f9e5=_0x3b3aed[_0x2c572d(0x29b)];if(_0x501185&&_0x3b3aed[_0x2c572d(0x259)]){const _0x4933c4=await segmentResponseToDef(_0x3b3aed,{'resolveSegmentName':async _0x286955=>{const _0x5ec0d3=_0x2c572d,_0x2b1497=_0x256bd8[_0x5ec0d3(0x1e1)](_0x286955);if(_0x2b1497)return _0x2b1497['name'];const _0x324057=await _0x404ecc[_0x5ec0d3(0x205)](_0x286955);return _0x324057[_0x5ec0d3(0x29b)];}}),_0x3c93d6=_0x4933c4[_0x2c572d(0x259)];_0x3aabcc={'description':_0x3b3aed['description'],'rule':_0x3c93d6};const _0x132250=serializeRule(_0x3c93d6),_0x46c711=_0x1a55b7[_0x2c572d(0x1e1)](_0x132250);if(_0x46c711)_0x25f9e5=_0x46c711,_0x3aabcc=undefined,_0x3e14bf[_0x2c572d(0x23b)]&&console[_0x2c572d(0x25e)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x3b3aed[_0x2c572d(0x29b)]+_0x2c572d(0x1c6)+_0x46c711);else{let _0x121cd3=![];if(_0x4d0dd2){const _0x2e82ce=_0x4d0dd2[_0x2c572d(0x1e1)](_0x132250);if(_0x2e82ce){const _0x378880=_0x2e82ce['find'](_0x4a603c=>!_0x9f00c8[_0x2c572d(0x19f)](_0x4a603c));_0x378880&&(_0x25f9e5=_0x378880,_0x9f00c8[_0x2c572d(0x289)](_0x378880),_0x1a55b7[_0x2c572d(0x1c7)](_0x132250,_0x378880),_0x121cd3=!![],_0x3e14bf[_0x2c572d(0x23b)]&&console[_0x2c572d(0x25e)](_0x2c572d(0x25c)+_0x378880+'\x20(rule\x20match)'));}}if(!_0x121cd3){const _0x1ae876=generateJourneyLocalName(_0x3b3aed[_0x2c572d(0x29b)]);_0x1ae876&&(_0x25f9e5=_0x1ae876);let _0x2ce916=_0x25f9e5,_0xa94876=0x2;while(_0x9f00c8[_0x2c572d(0x19f)](_0x2ce916)){_0x2ce916=_0x25f9e5+'_'+_0xa94876,_0xa94876++;}_0x9f00c8[_0x2c572d(0x289)](_0x2ce916),_0x1a55b7[_0x2c572d(0x1c7)](_0x132250,_0x2ce916),_0x25f9e5=_0x2ce916;}}}const _0x17cfd2={'name':_0x25f9e5,'isJourneyLocal':_0x501185,'definition':_0x3aabcc};return _0x256bd8[_0x2c572d(0x1c7)](_0x13f06b,_0x17cfd2),_0x17cfd2;}catch(_0x22f294){return _0x4aa1c1[_0x2c572d(0x23b)]&&console[_0x2c572d(0x25e)](_0x2c572d(0x1b8)+_0x13f06b+':\x20'+_0x22f294[_0x2c572d(0x2a2)]),{'name':_0x13f06b,'isJourneyLocal':![]};}},'resolveActivation':async _0x10ee97=>{const _0x49aa71=_0x465a85,_0x15c66c=_0x53bd6d[_0x49aa71(0x1e1)](_0x10ee97);if(_0x15c66c)return _0x15c66c;try{const _0x2b944b=await _0x570b60['journey'][_0x49aa71(0x228)](_0x8f794c['id'],_0x10ee97),_0x23357e=journeyActivationStepToYaml(_0x2b944b,_0x15bfea,_0x3c9373),_0x58bf36=JSON[_0x49aa71(0x232)]({'name':_0x23357e['name'],'connection':_0x23357e['connection'],'connector_config':_0x23357e[_0x49aa71(0x1bc)]}),_0x1956b7=_0x4bad85[_0x49aa71(0x1e1)](_0x58bf36);if(_0x1956b7){const _0x5ed61a={'name':_0x1956b7,'isJourneyLocal':!![],'definition':_0x23357e};return _0x53bd6d['set'](_0x10ee97,_0x5ed61a),_0x5ed61a;}const _0x4d16ec=_0x2b944b[_0x49aa71(0x27d)][_0x49aa71(0x181)]['name']||_0x10ee97,_0x1656aa=sanitizeYamlKey(_0x4d16ec)||_0x49aa71(0x27e)+_0x10ee97;let _0xca0144=_0x1656aa,_0x4e45f0=0x2;while(_0x48df60['has'](_0xca0144)){_0xca0144=_0x1656aa+'_'+_0x4e45f0,_0x4e45f0++;}_0x48df60[_0x49aa71(0x289)](_0xca0144),_0x4bad85['set'](_0x58bf36,_0xca0144);const _0x1c0d4b={'name':_0xca0144,'isJourneyLocal':!![],'definition':_0x23357e};return _0x53bd6d['set'](_0x10ee97,_0x1c0d4b),_0x1c0d4b;}catch(_0x99a738){return _0x4aa1c1[_0x49aa71(0x23b)]&&console[_0x49aa71(0x25e)](_0x49aa71(0x1ad)+_0x10ee97+':\x20'+_0x99a738[_0x49aa71(0x2a2)]),{'name':_0x10ee97,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x4254e0,_0x29b26d)=>{const _0x769a02=_0x465a85;return resolveJumpTarget(_0x4254e0,_0x29b26d,_0x322413,_0x4de763=>_0x570b60[_0x769a02(0x21e)][_0x769a02(0x240)](_0x4de763));}},_0x3c4d22=await journeyResponseToDef(_0x57e549,_0x404ecc);_0x12d3b9[_0x465a85(0x1d9)]({'item':_0x8f794c,'yaml':_0x3c4d22});}},{'verbose':_0x4aa1c1[_0x28bcad(0x23b)]});const _0x58d067=await _0x570b60['journey'][_0x28bcad(0x248)](_0x394976[0x0][_0x28bcad(0x1a6)]),_0x29583c=buildMergedJourneyDef(_0x12d3b9,_0x4d0dd2,_0x58d067),_0x3703b4=normalizeJourneyDef(_0x29583c,_0x3e8a1b),_0x27689c=toYamlString(_0x3703b4),_0x72a47=_0x23b63b||a27_0x35f653[_0x28bcad(0x236)](_0x52f43b,sanitizeFileName(_0x271a12)+_0x28bcad(0x20b));!_0x23b63b&&_0x4bc618&&!existsSync(_0x52f43b)&&mkdirSync(_0x52f43b,{'recursive':!![]});const _0x5a7130=a27_0x35f653[_0x28bcad(0x1ce)](process[_0x28bcad(0x244)](),_0x72a47);if(existsSync(_0x72a47)){const _0x473741=readFileSync(_0x72a47,_0x28bcad(0x29a)),_0x3855ed=generateDiff(_0x473741,_0x27689c),_0x1be56f=hasChanges(_0x3855ed);_0x46f4da['push']({'relativePath':_0x5a7130,'absolutePath':_0x72a47,'content':_0x27689c,'isNew':![],'hasChanges':_0x1be56f,'diff':_0x1be56f?formatDiffWithColors(_0x3855ed):undefined});}else _0x46f4da['push']({'relativePath':_0x5a7130,'absolutePath':_0x72a47,'content':_0x27689c,'isNew':!![],'hasChanges':![]});}const _0x34a75f=_0x46f4da[_0x28bcad(0x269)](_0xf7a0e3=>_0xf7a0e3['isNew']),_0x2ad2c4=_0x46f4da[_0x28bcad(0x269)](_0x350b97=>!_0x350b97[_0x28bcad(0x1e9)]&&_0x350b97[_0x28bcad(0x1e3)]),_0x72f025=_0x46f4da['filter'](_0x4190a4=>!_0x4190a4[_0x28bcad(0x1e9)]&&!_0x4190a4[_0x28bcad(0x1e3)]),_0x197584=_0x1913f0[_0x28bcad(0x1c4)],_0x21bf17=_0x1cf84e[_0x28bcad(0x222)],_0x2fdd07=_0x197584>_0x21bf17?'\x20('+_0x197584+'\x20versions)':'';console[_0x28bcad(0x25e)](_0x28bcad(0x1f1)),console['error']('\x20\x20'+a27_0x5bb097[_0x28bcad(0x1ea)](_0x21bf17+'\x20journeys')+a27_0x5bb097[_0x28bcad(0x239)](_0x2fdd07)),console['error']('\x20\x20'+a27_0x5bb097[_0x28bcad(0x18f)]('+\x20'+_0x34a75f[_0x28bcad(0x1c4)]+_0x28bcad(0x1d4))),console[_0x28bcad(0x25e)]('\x20\x20'+a27_0x5bb097[_0x28bcad(0x256)]('~\x20'+_0x2ad2c4[_0x28bcad(0x1c4)]+_0x28bcad(0x1de))),console[_0x28bcad(0x25e)]('\x20\x20'+a27_0x5bb097['dim']('=\x20'+_0x72f025[_0x28bcad(0x1c4)]+_0x28bcad(0x20c))),console[_0x28bcad(0x25e)](_0x28bcad(0x1c1)+a27_0x5bb097['cyan'](_0x4baddc)+'\x0a');if(_0x2ad2c4['length']>0x0)for(const _0x461548 of _0x2ad2c4){console[_0x28bcad(0x25e)](_0x28bcad(0x18e)+_0x461548['relativePath']+'\x27:'),console[_0x28bcad(0x25e)]('─'[_0x28bcad(0x204)](0x3c)),console[_0x28bcad(0x25e)](_0x461548[_0x28bcad(0x264)]),console['error']('─'[_0x28bcad(0x204)](0x3c));}if(_0x3e14bf[_0x28bcad(0x1eb)])return console[_0x28bcad(0x25e)](a27_0x5bb097[_0x28bcad(0x256)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x34a75f[_0x28bcad(0x1c4)]===0x0&&_0x2ad2c4[_0x28bcad(0x1c4)]===0x0)return console[_0x28bcad(0x25e)](a27_0x5bb097[_0x28bcad(0x18f)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2d21dc},_0x3e14bf[_0x28bcad(0x24d)]),console[_0x28bcad(0x25e)](a27_0x5bb097[_0x28bcad(0x18f)](_0x28bcad(0x295)+a27_0x5bb097[_0x28bcad(0x239)](_0x28bcad(0x29f))+_0x28bcad(0x1c8)+a27_0x5bb097['cyan'](_0x2d21dc))),0x0;if(!_0x3e14bf[_0x28bcad(0x28b)]&&(_0x34a75f[_0x28bcad(0x1c4)]>0x0||_0x2ad2c4[_0x28bcad(0x1c4)]>0x0)){if(!isInteractive())return console[_0x28bcad(0x25e)](a27_0x5bb097[_0x28bcad(0x212)]('\x0aError:'),_0x28bcad(0x28d)),console[_0x28bcad(0x25e)](a27_0x5bb097[_0x28bcad(0x239)](_0x28bcad(0x1d3))),0x1;const _0x5e86d6=await confirmKey(_0x28bcad(0x199)+(_0x34a75f[_0x28bcad(0x1c4)]+_0x2ad2c4[_0x28bcad(0x1c4)])+_0x28bcad(0x24f));if(!_0x5e86d6)return console['error'](a27_0x5bb097[_0x28bcad(0x256)](_0x28bcad(0x243)),_0x28bcad(0x1f6)),0x1;}!existsSync(_0x4baddc)&&mkdirSync(_0x4baddc,{'recursive':!![]});const _0x8d8343=a27_0x35f653[_0x28bcad(0x236)](_0x4baddc,'tdx.json');writeFileSync(_0x8d8343,createTdxConfigContent(_0x2d21dc),_0x28bcad(0x29a));for(const _0x3f365f of _0x46f4da){(_0x3f365f[_0x28bcad(0x1e9)]||_0x3f365f[_0x28bcad(0x1e3)])&&writeFileSync(_0x3f365f['absolutePath'],_0x3f365f[_0x28bcad(0x285)],_0x28bcad(0x29a));}return console[_0x28bcad(0x25e)](a27_0x5bb097['green'](_0x28bcad(0x1b5)+(_0x34a75f['length']+_0x2ad2c4[_0x28bcad(0x1c4)])+_0x28bcad(0x219)+_0x4baddc)),saveSessionContext({'parent_segment':_0x2d21dc},_0x3e14bf[_0x28bcad(0x24d)]),console[_0x28bcad(0x25e)](a27_0x5bb097['green'](_0x28bcad(0x295)+a27_0x5bb097[_0x28bcad(0x239)](_0x28bcad(0x29f))+_0x28bcad(0x1c8)+a27_0x5bb097[_0x28bcad(0x1ea)](_0x2d21dc))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x466491(0x29b)]=a27_0x466491(0x21d);[a27_0x466491(0x270)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x466491(0x271)](_0x1e44a){const _0x8c80f4=a27_0x466491,{options:_0x53deab,args:_0xedd26e,tdx:_0x47999f}=_0x1e44a,_0x3c7405=_0xedd26e[0x0];if(!requireNameOrPath(_0x3c7405))return 0x1;_0x53deab[_0x8c80f4(0x23b)]&&console[_0x8c80f4(0x25e)](_0x8c80f4(0x18a)+_0x3c7405);const {journeyId:_0x23e072}=await resolveJourneyIdFromInput(_0x3c7405,_0x53deab,_0x47999f),_0x14ec08=await withSpinner(_0x8c80f4(0x27f),()=>_0x47999f[_0x8c80f4(0x21e)]['getColumnMapping'](_0x23e072),{'verbose':_0x53deab[_0x8c80f4(0x23b)]}),_0x22b333=_0x14ec08[_0x8c80f4(0x17f)];return console[_0x8c80f4(0x1df)](_0x8c80f4(0x2a0)+_0x22b333['database']),console[_0x8c80f4(0x1df)](_0x8c80f4(0x224)+_0x22b333['table']),await handleSDKOutput(_0x22b333[_0x8c80f4(0x280)],_0x53deab),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x466491(0x284);[a27_0x466491(0x270)]=a27_0x466491(0x20a);async[a27_0x466491(0x271)](_0x420927){const _0x57dee4=a27_0x466491,{options:_0x3f841c,args:_0x14899c,tdx:_0x186375}=_0x420927,_0x2d912f=_0x14899c[0x0];if(!requireNameOrPath(_0x2d912f))return 0x1;_0x3f841c['verbose']&&console['error'](_0x57dee4(0x18a)+_0x2d912f);const {journeyId:_0x20e497}=await resolveJourneyIdFromInput(_0x2d912f,_0x3f841c,_0x186375),_0x464eac=await withSpinner('Listing\x20journey\x20activations...',()=>_0x186375[_0x57dee4(0x21e)][_0x57dee4(0x22d)](_0x20e497),{'verbose':_0x3f841c[_0x57dee4(0x23b)]}),_0x8f1459=_0x464eac['data'];return console[_0x57dee4(0x25e)](_0x57dee4(0x229)+_0x8f1459[_0x57dee4(0x1c4)]+'\x20activation'+(_0x8f1459[_0x57dee4(0x1c4)]!==0x1?'s':'')),await handleSDKOutput(_0x8f1459,_0x3f841c),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a27_0x466491(0x283);['description']='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI';[a27_0x466491(0x180)]=new SegmentPushCommand();async[a27_0x466491(0x271)](_0x417ceb){const _0x3369bd=a27_0x466491,_0x1658fe=_0x417ceb[_0x3369bd(0x291)][0x0];let _0x25396f;if(_0x1658fe){const _0x2c68bf=await resolveTarget({'arg':_0x1658fe,'contextParent':_0x417ceb[_0x3369bd(0x26e)][_0x3369bd(0x276)],'cwd':process[_0x3369bd(0x244)]()});isSuccessfulResolution(_0x2c68bf)&&_0x2c68bf['type']===_0x3369bd(0x286)&&(_0x25396f=_0x2c68bf['filePath']);}const _0x19984a={..._0x417ceb,'options':{..._0x417ceb[_0x3369bd(0x26e)],'journeysOnly':!![],..._0x25396f&&{'singleFilePath':_0x25396f}}};return this[_0x3369bd(0x180)][_0x3369bd(0x271)](_0x19984a);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x466491(0x29b)]=a27_0x466491(0x1a9);['description']=a27_0x466491(0x251);async[a27_0x466491(0x271)](_0x452253){const _0x25e907=a27_0x466491,{options:_0x1642cf,args:_0x2f3611,tdx:_0x207a41}=_0x452253,_0x315268=_0x2f3611[0x0];if(!requireNameOrPath(_0x315268))return 0x1;if(_0x1642cf[_0x25e907(0x23b)])console[_0x25e907(0x25e)](_0x25e907(0x18a)+_0x315268);const {journeyId:_0x4a098c}=await resolveJourneyIdFromInput(_0x315268,_0x1642cf,_0x207a41),_0xa00fed=await withSpinner('Listing\x20journey\x20versions...',()=>_0x207a41['journey'][_0x25e907(0x265)](_0x4a098c),{'verbose':_0x1642cf['verbose']}),{bundleName:_0xa042f0,versions:_0x31beb2,latestJourneyId:_0x2d8e0d}=_0xa00fed[_0x25e907(0x17f)];console[_0x25e907(0x25e)](_0xa042f0+':\x20'+_0x31beb2[_0x25e907(0x1c4)]+_0x25e907(0x23c)+(_0x31beb2['length']!==0x1?'s':''));const _0x1a85a8=_0x31beb2[_0x25e907(0x262)](_0x39e4aa=>({'version':_0x39e4aa[_0x25e907(0x18d)],'journey_id':_0x39e4aa[_0x25e907(0x1f9)],'name':_0x39e4aa[_0x25e907(0x29b)],'state':_0x39e4aa['state'],'paused':_0x39e4aa[_0x25e907(0x1b9)],'latest':_0x39e4aa[_0x25e907(0x1f9)]===_0x2d8e0d,'created_at':_0x39e4aa['createdAt']}));return await handleSDKOutput(_0x1a85a8,_0x1642cf),0x0;}}function a27_0x32ce(){const _0x452270=['activation_','Getting\x20column\x20mapping...','columns','Getting\x20journey\x20traffic\x20data...','Target\x20directory:\x20','journey:push','journey:activations','content','file','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','limit','add','\x5c$&','yes','...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','INVALID_ARGUMENT','Options:','args','\x20journey','(archived)','ID:','✔\x20Context\x20set:\x20','state','Getting\x20journey\x20statistics...','draft','3qlPQOm','utf-8','name','\x20(draft)\x20—\x20\x22','Fetching\x20users\x20and\x20connections...','140860ouBngE','parent_segment','Database:\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','message','listJourneysWithFolders','version','Target\x20file:\x20','find','folderId','renderStats','folderPath','\x20\x20Journey\x20ID:\x20','journeyName','/e/','hasPeriod','Getting\x20version\x20','completeMilestoneRate','data','segmentPushCommand','activationParams','sort','Triggering\x20journey\x20workflow...','folders','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','journey:pull','Error:\x20Stage\x20\x22','journey:run','goal','Input:\x20','State:','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','versionNumber','\x0aChanges\x20to\x20\x27','green','\x20details...','\x20[runs\x20on\x20refresh]','Fetching\x20journey\x20','journey:stats','resolveJourneyId','journey:resume','\x22\x20not\x20found','464175GbRtLG','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Write\x20','\x20not\x20found.\x20Available:\x20','Error:\x20Invalid\x20version\x20number:\x20','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','\x27\x20not\x20found\x20in\x20','createdAt','has','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Fetching\x20','pausedAt','\x20\x20-\x20','Fetching\x20parent\x20segment...','archived','journeyBundleId','connection\x20','\x20\x20←\x20','journey:versions','Resuming\x20journey...','then','exitOrJumpSize','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Journey:','(root)','1571339RthDyx','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','user','/j/da/je','✔\x20Pulled\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','rootFolderId','Warning:\x20Could\x20not\x20resolve\x20segment\x20','paused','segmentName','activation','connector_config','localeCompare','Parent\x20segment:\x20','reentryMode','Resume\x20a\x20paused\x20journey','\x20\x20Target:\x20','json','run','length','⚠️\x20','\x20->\x20','set','\x20=\x20','base','journeys','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','52165430oNPyzK','journey:version:view','relative','bold','site','Pause\x20a\x20running\x20journey','6445092zsPdHd','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20new\x20files','✔\x20Journey\x20\x22','\x20Journey\x20workflow\x20started','📁\x20','\x22\x20resumed','push','getStatistics','kind','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','725986LTHgDr','\x20changed\x20files','log','(draft)','get','includeHistory','hasChanges','Error:\x20Journey\x20not\x20found:\x20','segment','journeyBundleName','targetDir','audienceId','isNew','cyan','dryRun','(completed)','workflowId','format','stageNameMap','nodes','\x0aPull\x20summary:','stage','values','no_parent','Paused:','-\x20no\x20files\x20written','listJourneysFromParentSegment','Status:','journeyId','all','conversion','Session:','workflowSessionId','scheduleType','\x20\x20Folder\x20path:\x20','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','milestoneSize','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','connectionId','repeat','resolveSegment','web','No\x20statistics\x20available\x20for\x20journey:\x20','runAfterJourneyRefresh','listFolders','List\x20activations\x20for\x20a\x20journey','.yml','\x20unchanged\x20files',',\x20schedule:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','resolveParentId','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','List\x20journeys\x20in\x20current\x20context','red','filePath','toLowerCase','Error:\x20','enteredSize','none','Show\x20journey\x20details','\x20journey\x20files\x20to\x20','exitOrJumpRate','goalSize','Error:\x20Journey\x20\x27','journey:columns','journey','journey:view','(unnamed)','from','size','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','Table:\x20','/app/ps/','6082755kqlPEE','\x20@\x20','getActivation','Found\x20','180TYteyB','errorCode','Available\x20stages:\x20','listActivationsFlat','helpText','links','no\x20connection','\x20\x20Statistics\x20not\x20available','stringify','Activations:','buildIdToNameMap','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','join','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','dim','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','verbose','\x20version','journeyStages','Resolving\x20journey...','createVersion','getJourney','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Aborted.','cwd','\x20Created\x20v','root\x20folder','\x22\x20paused','getLatestJourneyId','Pausing\x20journey...','test','completed','getSegment','session','(paused)','\x20files?','\x20Opening\x20','List\x20all\x20versions\x20of\x20a\x20journey','(running)','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','launched','segments','yellow','(none)','split','rule','Resolving\x20version...','getTrafficData','\x20\x20Preserving\x20local\x20segment\x20name:\x20','type','error','Error:\x20--version\x20option\x20is\x20required','Error:\x20Version\x20','Show\x20journey\x20statistics','map','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','diff','listVersions','/j/da','history','Creating\x20new\x20version...','filter','stages','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','jsonl','options','Cancelled','description','execute','executeDryRun','Resolving\x20parent\x20segment...','View\x20a\x20specific\x20version\x20of\x20a\x20journey','🗺️\x20','parentSegment','136kpxRlo','entries','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Stages:','runAt','Journey\x20name:\x20','attributes'];a27_0x32ce=function(){return _0x452270;};return a27_0x32ce();}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x466491(0x29b)]='journey:version:create';[a27_0x466491(0x270)]=a27_0x466491(0x20e);async[a27_0x466491(0x271)](_0x568d9e){const _0x56af20=a27_0x466491,{options:_0x1d17e7,args:_0x190d2a,tdx:_0x4d329c}=_0x568d9e,_0x179b6a=_0x190d2a[0x0];if(!requireNameOrPath(_0x179b6a))return 0x1;if(_0x1d17e7[_0x56af20(0x23b)])console[_0x56af20(0x25e)]('Input:\x20'+_0x179b6a);const {journeyId:_0xaa0b12,journeyName:_0x5ec1df}=await resolveJourneyIdFromInput(_0x179b6a,_0x1d17e7,_0x4d329c);if(!_0x1d17e7['yes']){const _0x50b3f6=await confirm(_0x56af20(0x263)+_0x5ec1df+'\x22?');if(!_0x50b3f6)return console[_0x56af20(0x25e)](_0x56af20(0x26f)),0x0;}const _0x338591=await withSpinner(_0x56af20(0x268),()=>_0x4d329c[_0x56af20(0x21e)][_0x56af20(0x23f)](_0xaa0b12),{'verbose':_0x1d17e7[_0x56af20(0x23b)]}),_0x572204=_0x338591[_0x56af20(0x17f)];return console[_0x56af20(0x25e)](a27_0x5bb097[_0x56af20(0x18f)]('✔')+_0x56af20(0x245)+_0x572204[_0x56af20(0x27d)]['versionNumber']+_0x56af20(0x29c)+_0x572204[_0x56af20(0x27d)][_0x56af20(0x29b)]+'\x22'),console[_0x56af20(0x25e)](_0x56af20(0x179)+_0x572204['id']),await handleSingleObjectOutput({'id':_0x572204['id'],'name':_0x572204[_0x56af20(0x27d)][_0x56af20(0x29b)],'version':_0x572204[_0x56af20(0x27d)][_0x56af20(0x18d)],'state':_0x572204['attributes'][_0x56af20(0x296)],'bundle_id':_0x572204[_0x56af20(0x27d)]['journeyBundleId'],'created_at':_0x572204['attributes'][_0x56af20(0x19e)]},_0x1d17e7),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a27_0x466491(0x1cd);['description']=a27_0x466491(0x274);async[a27_0x466491(0x271)](_0xaf45a6){const _0x5dadfa=a27_0x466491,{options:_0x5ed798,args:_0x20d4d6,tdx:_0x333f63}=_0xaf45a6,_0x2a1cfa=_0x20d4d6[0x0];if(!requireNameOrPath(_0x2a1cfa))return 0x1;const _0x99fcf4=_0x5ed798[_0x5dadfa(0x2a4)];if(!_0x99fcf4)return console[_0x5dadfa(0x25e)](_0x5dadfa(0x25f)),console['error'](_0x5dadfa(0x279)),0x1;const _0x13f45a=parseInt(_0x99fcf4,0xa);if(isNaN(_0x13f45a)||_0x13f45a<0x1)return console[_0x5dadfa(0x25e)](_0x5dadfa(0x19b)+_0x99fcf4),0x1;if(_0x5ed798[_0x5dadfa(0x23b)])console[_0x5dadfa(0x25e)](_0x5dadfa(0x18a)+_0x2a1cfa+',\x20version:\x20'+_0x13f45a);const {journeyId:_0x56856f,parentSegmentId:_0xc3f4bc}=await resolveJourneyIdFromInput(_0x2a1cfa,_0x5ed798,_0x333f63),_0x7e86ff=await withSpinner(_0x5dadfa(0x25a),()=>_0x333f63[_0x5dadfa(0x21e)][_0x5dadfa(0x265)](_0x56856f),{'verbose':_0x5ed798['verbose']}),{versions:_0x146ec8,latestJourneyId:_0x5ab626}=_0x7e86ff[_0x5dadfa(0x17f)],_0x58051a=_0x146ec8[_0x5dadfa(0x175)](_0x2edb35=>_0x2edb35[_0x5dadfa(0x18d)]===_0x13f45a);if(!_0x58051a){const _0x20d9c3=_0x146ec8[_0x5dadfa(0x262)](_0x369ee7=>'v'+_0x369ee7[_0x5dadfa(0x18d)])[_0x5dadfa(0x236)](',\x20');return console[_0x5dadfa(0x25e)](_0x5dadfa(0x260)+_0x13f45a+_0x5dadfa(0x19a)+_0x20d9c3),0x1;}const _0xd8408a=await withSpinner(_0x5dadfa(0x17d)+_0x13f45a+_0x5dadfa(0x190),()=>_0x333f63['journey'][_0x5dadfa(0x240)](_0x58051a[_0x5dadfa(0x1f9)]),{'verbose':_0x5ed798[_0x5dadfa(0x23b)]}),_0x2a45e1=_0xd8408a[_0x5dadfa(0x17f)],_0x44606f=getConsoleNextUrl(_0x5ed798['site'],_0x5dadfa(0x225)+_0xc3f4bc+_0x5dadfa(0x17b)+_0x58051a['journeyId']+_0x5dadfa(0x1b4));return await handleSingleObjectOutput({'id':_0x2a45e1['id'],'name':_0x2a45e1[_0x5dadfa(0x27d)][_0x5dadfa(0x29b)],'version':_0x2a45e1[_0x5dadfa(0x27d)]['versionNumber'],'description':_0x2a45e1[_0x5dadfa(0x27d)]['description'],'state':_0x2a45e1[_0x5dadfa(0x27d)][_0x5dadfa(0x296)],'paused':_0x2a45e1['attributes']['paused'],'reentry_mode':_0x2a45e1[_0x5dadfa(0x27d)][_0x5dadfa(0x1bf)],'stages':_0x2a45e1[_0x5dadfa(0x27d)][_0x5dadfa(0x23d)]?.[_0x5dadfa(0x1c4)]||0x0,..._0x2a45e1[_0x5dadfa(0x27d)]['goal']&&{'goal':_0x2a45e1[_0x5dadfa(0x27d)][_0x5dadfa(0x189)]['name']},'latest':_0x58051a['journeyId']===_0x5ab626,'created_at':_0x2a45e1[_0x5dadfa(0x27d)][_0x5dadfa(0x19e)],'updated_at':_0x2a45e1['attributes']['updatedAt'],'url':_0x44606f},_0x5ed798),0x0;}}
@@ -1 +1 @@
1
- const a28_0x38ee08=a28_0x18c2;(function(_0x477c56,_0xfd7b1d){const _0x3ca0cb=a28_0x18c2,_0x3964c2=_0x477c56();while(!![]){try{const _0x21653e=parseInt(_0x3ca0cb(0x125))/0x1+-parseInt(_0x3ca0cb(0x114))/0x2+-parseInt(_0x3ca0cb(0x11a))/0x3+-parseInt(_0x3ca0cb(0x113))/0x4+-parseInt(_0x3ca0cb(0x105))/0x5+parseInt(_0x3ca0cb(0x112))/0x6*(parseInt(_0x3ca0cb(0x119))/0x7)+parseInt(_0x3ca0cb(0x110))/0x8*(parseInt(_0x3ca0cb(0x126))/0x9);if(_0x21653e===_0xfd7b1d)break;else _0x3964c2['push'](_0x3964c2['shift']());}catch(_0x103a6f){_0x3964c2['push'](_0x3964c2['shift']());}}}(a28_0x3666,0x6ef16));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x18c2(_0x5ffed8,_0x19a243){_0x5ffed8=_0x5ffed8-0xf2;const _0x366693=a28_0x3666();let _0x18c260=_0x366693[_0x5ffed8];return _0x18c260;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x42fa77 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0x3666(){const _0x42ffe3=['\x20valid','warnings','skippedCount','\x20segment\x20file(s)\x20skipped)','journey:validate','40090zUOQkF','verbose','filePath','red','\x20journey(s)\x20valid','warningCount','dim','Validation\x20failed:\x20','yellow','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','700968QCxiys','validCount','6BLVuBv','303140sjWrdu','1481282upmSjG','errorCode','hasErrors','helpText','no_parent','860902cnLXRd','1805736HzFUhK','No\x20journey\x20YAML\x20files\x20found\x20in\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','errors','✔\x20All\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','name','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','green','targetDir','\x20warning(s)','268235lLzjcN','153TzSatR','type','error','\x20error(s)','\x20(skipped:\x20','execute','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','relativePath','filter','log','\x20warning(s)\x20found','Validate\x20journey\x20YAML\x20files','parentSegment','.yml','file','\x20journey(s)\x20with\x20errors,\x20','\x20segment\x20file(s)\x20skipped','length','description','valid'];a28_0x3666=function(){return _0x42ffe3;};return a28_0x3666();}export class JourneyValidateCommand extends BaseCommand{[a28_0x38ee08(0x120)]=a28_0x38ee08(0x104);[a28_0x38ee08(0xfe)]=a28_0x38ee08(0xf7);async[a28_0x38ee08(0x12b)](_0x3390a4){const _0x3493aa=a28_0x38ee08,{options:_0x2df516,args:_0x2b1eb1}=_0x3390a4,_0x2488fb=_0x2df516,_0x5643f1=await resolveTarget({'arg':_0x2b1eb1[0x0],'contextParent':_0x2df516[_0x3493aa(0xf8)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5643f1))return _0x5643f1[_0x3493aa(0x115)]===_0x3493aa(0x118)?(console[_0x3493aa(0x128)](a28_0x42fa77[_0x3493aa(0x10d)](_0x3493aa(0x11c))),console[_0x3493aa(0x128)](_0x3493aa(0xf2)),console[_0x3493aa(0x128)](_0x3493aa(0x11f)),console[_0x3493aa(0x128)](_0x3493aa(0x10f))):(console[_0x3493aa(0x128)](a28_0x42fa77[_0x3493aa(0x108)]('Error:\x20'+_0x5643f1['message']+'\x0a')),_0x5643f1[_0x3493aa(0x117)]&&console[_0x3493aa(0x128)](a28_0x42fa77['cyan'](_0x5643f1[_0x3493aa(0x117)]))),0x1;const _0x1f3e1b=_0x5643f1[_0x3493aa(0x123)],_0x4bf7d4=_0x5643f1[_0x3493aa(0x127)]===_0x3493aa(0xfa)?_0x5643f1[_0x3493aa(0x107)]:undefined;if(!_0x4bf7d4&&!existsSync(_0x1f3e1b))return console['error'](a28_0x42fa77[_0x3493aa(0x108)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1f3e1b+'\x0a')),0x1;let _0xe1a140;if(_0x4bf7d4){if(!_0x4bf7d4[_0x3493aa(0x10e)](_0x3493aa(0xf9))&&!_0x4bf7d4[_0x3493aa(0x10e)]('.yaml'))return console['error'](a28_0x42fa77[_0x3493aa(0x108)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x4bf7d4+'\x0a')),0x1;_0xe1a140=[_0x4bf7d4];}else _0xe1a140=findYamlFiles(_0x1f3e1b);if(_0xe1a140[_0x3493aa(0xfd)]===0x0)return console['error'](a28_0x42fa77[_0x3493aa(0x108)](_0x3493aa(0x121)+_0x1f3e1b+'\x0a')),0x1;const _0x2cf0ee=validateYamlFiles(_0xe1a140,_0x1f3e1b,{'filterType':'journey'}),_0x5ce08c=calculateSummary(_0x2cf0ee),_0x5c556f=_0x2cf0ee[_0x3493aa(0xf4)](isValidationResult);if(_0x5c556f[_0x3493aa(0xfd)]===0x0)return console['error'](a28_0x42fa77[_0x3493aa(0x10d)](_0x3493aa(0x11b)+_0x1f3e1b+'\x0a')),_0x5ce08c[_0x3493aa(0x102)]>0x0&&console[_0x3493aa(0x128)](a28_0x42fa77[_0x3493aa(0x10b)]('('+_0x5ce08c[_0x3493aa(0x102)]+_0x3493aa(0x103))),0x0;for(const _0x290feb of _0x2cf0ee){if(!isValidationResult(_0x290feb)){_0x2488fb[_0x3493aa(0x106)]&&console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x10b)]('-\x20'+_0x290feb[_0x3493aa(0xf3)]+_0x3493aa(0x12a)+_0x290feb['reason']+')'));continue;}const {relativePath:_0x401d79,source:_0x3a927b,result:_0x1b3f55}=_0x290feb;if(_0x1b3f55[_0x3493aa(0xff)]&&_0x1b3f55['warnings'][_0x3493aa(0xfd)]===0x0)_0x2488fb[_0x3493aa(0x106)]&&console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x122)]('✔\x20'+_0x401d79));else _0x1b3f55[_0x3493aa(0xff)]?(console['log'](a28_0x42fa77[_0x3493aa(0x10d)]('⚠\x20'+_0x401d79+':\x20'+_0x1b3f55[_0x3493aa(0x101)][_0x3493aa(0xfd)]+_0x3493aa(0x124))),console[_0x3493aa(0xf5)](formatValidationResult(_0x1b3f55,_0x3a927b,_0x401d79))):(console[_0x3493aa(0xf5)](a28_0x42fa77['red']('✖\x20'+_0x401d79+':\x20'+_0x1b3f55[_0x3493aa(0x11d)][_0x3493aa(0xfd)]+_0x3493aa(0x129))),console['log'](formatValidationResult(_0x1b3f55,_0x3a927b,_0x401d79)));}return console['log'](''),_0x5ce08c[_0x3493aa(0x116)]?(console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x108)](_0x3493aa(0x10c)+_0x5ce08c['invalidCount']+_0x3493aa(0xfb)+_0x5ce08c[_0x3493aa(0x111)]+_0x3493aa(0x100))),_0x5ce08c[_0x3493aa(0x10a)]>0x0&&console['log'](a28_0x42fa77[_0x3493aa(0x10d)](_0x5ce08c['warningCount']+_0x3493aa(0xf6))),_0x5ce08c[_0x3493aa(0x102)]>0x0&&console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x10b)](_0x5ce08c['skippedCount']+_0x3493aa(0xfc))),0x1):(console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x122)](_0x3493aa(0x11e)+_0x5ce08c[_0x3493aa(0x111)]+_0x3493aa(0x109))),_0x5ce08c[_0x3493aa(0x10a)]>0x0&&console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x10d)](_0x5ce08c['warningCount']+_0x3493aa(0xf6))),_0x5ce08c[_0x3493aa(0x102)]>0x0&&console['log'](a28_0x42fa77['dim'](_0x5ce08c['skippedCount']+_0x3493aa(0xfc))),0x0);}}
1
+ const a28_0x4c58f1=a28_0x1a64;(function(_0x5e78c7,_0x55cf00){const _0x42bce7=a28_0x1a64,_0x46a7a4=_0x5e78c7();while(!![]){try{const _0x4dfa94=parseInt(_0x42bce7(0x133))/0x1+parseInt(_0x42bce7(0x12d))/0x2*(-parseInt(_0x42bce7(0x145))/0x3)+parseInt(_0x42bce7(0x148))/0x4*(-parseInt(_0x42bce7(0x13a))/0x5)+-parseInt(_0x42bce7(0x163))/0x6*(-parseInt(_0x42bce7(0x146))/0x7)+-parseInt(_0x42bce7(0x13f))/0x8+-parseInt(_0x42bce7(0x137))/0x9+-parseInt(_0x42bce7(0x157))/0xa*(-parseInt(_0x42bce7(0x136))/0xb);if(_0x4dfa94===_0x55cf00)break;else _0x46a7a4['push'](_0x46a7a4['shift']());}catch(_0x54dfa6){_0x46a7a4['push'](_0x46a7a4['shift']());}}}(a28_0x55e2,0x4e5d5));import{BaseCommand}from'./command.js';function a28_0x55e2(){const _0x41f931=['404651ahEwHm','Validate\x20journey\x20YAML\x20files','dim','11243045dtezZV','3197538DkhxcT','execute','red','15vLwGGE','green','validCount','\x20segment\x20file(s)\x20skipped','endsWith','907688fEnrjD','file','relativePath','reason','error','\x20warning(s)\x20found','62634cmONYj','595QuVcuE','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','330300VxZRRS','yellow','valid','Error:\x20Directory\x20not\x20found:\x20','warningCount','No\x20journey\x20YAML\x20files\x20found\x20in\x20','\x20valid','verbose','invalidCount','filePath','helpText','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20segment\x20file(s)\x20skipped)','skippedCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','10GDPfbi','name','targetDir','journey:validate','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','errorCode','journey','\x20(skipped:\x20','log','description','\x20journey(s)\x20valid','7890fvFjeY','\x20warning(s)','length','cwd','hasErrors','Validation\x20failed:\x20','✔\x20All\x20','type','48BRJztk','warnings','.yml','no_parent','errors','\x20journey(s)\x20with\x20errors,\x20'];a28_0x55e2=function(){return _0x41f931;};return a28_0x55e2();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x4f36a0 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0x1a64(_0x4fe181,_0x2ac0df){_0x4fe181=_0x4fe181-0x12a;const _0x55e2e1=a28_0x55e2();let _0x1a6415=_0x55e2e1[_0x4fe181];return _0x1a6415;}export class JourneyValidateCommand extends BaseCommand{[a28_0x4c58f1(0x158)]=a28_0x4c58f1(0x15a);[a28_0x4c58f1(0x161)]=a28_0x4c58f1(0x134);async[a28_0x4c58f1(0x138)](_0x59265d){const _0x5265b1=a28_0x4c58f1,{options:_0x3645cd,args:_0x740f6d}=_0x59265d,_0x1a5359=_0x3645cd,_0x5109a5=await resolveTarget({'arg':_0x740f6d[0x0],'contextParent':_0x3645cd['parentSegment'],'cwd':process[_0x5265b1(0x166)]()});if(!isSuccessfulResolution(_0x5109a5))return _0x5109a5[_0x5265b1(0x15d)]===_0x5265b1(0x130)?(console[_0x5265b1(0x143)](a28_0x4f36a0[_0x5265b1(0x149)](_0x5265b1(0x147))),console[_0x5265b1(0x143)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x5265b1(0x143)](_0x5265b1(0x15b)),console[_0x5265b1(0x143)](_0x5265b1(0x15c))):(console[_0x5265b1(0x143)](a28_0x4f36a0[_0x5265b1(0x139)]('Error:\x20'+_0x5109a5['message']+'\x0a')),_0x5109a5[_0x5265b1(0x152)]&&console[_0x5265b1(0x143)](a28_0x4f36a0['cyan'](_0x5109a5[_0x5265b1(0x152)]))),0x1;const _0x80158e=_0x5109a5[_0x5265b1(0x159)],_0x26c9aa=_0x5109a5[_0x5265b1(0x12c)]===_0x5265b1(0x140)?_0x5109a5[_0x5265b1(0x151)]:undefined;if(!_0x26c9aa&&!existsSync(_0x80158e))return console[_0x5265b1(0x143)](a28_0x4f36a0[_0x5265b1(0x139)](_0x5265b1(0x14b)+_0x80158e+'\x0a')),0x1;let _0x37b5b8;if(_0x26c9aa){if(!_0x26c9aa[_0x5265b1(0x13e)](_0x5265b1(0x12f))&&!_0x26c9aa[_0x5265b1(0x13e)]('.yaml'))return console[_0x5265b1(0x143)](a28_0x4f36a0[_0x5265b1(0x139)](_0x5265b1(0x153)+_0x26c9aa+'\x0a')),0x1;_0x37b5b8=[_0x26c9aa];}else _0x37b5b8=findYamlFiles(_0x80158e);if(_0x37b5b8['length']===0x0)return console['error'](a28_0x4f36a0[_0x5265b1(0x139)](_0x5265b1(0x156)+_0x80158e+'\x0a')),0x1;const _0x59b74e=validateYamlFiles(_0x37b5b8,_0x80158e,{'filterType':_0x5265b1(0x15e)}),_0x1a1947=calculateSummary(_0x59b74e),_0xf87da1=_0x59b74e['filter'](isValidationResult);if(_0xf87da1[_0x5265b1(0x165)]===0x0)return console['error'](a28_0x4f36a0['yellow'](_0x5265b1(0x14d)+_0x80158e+'\x0a')),_0x1a1947[_0x5265b1(0x155)]>0x0&&console[_0x5265b1(0x143)](a28_0x4f36a0[_0x5265b1(0x135)]('('+_0x1a1947[_0x5265b1(0x155)]+_0x5265b1(0x154))),0x0;for(const _0x4389d8 of _0x59b74e){if(!isValidationResult(_0x4389d8)){_0x1a5359[_0x5265b1(0x14f)]&&console[_0x5265b1(0x160)](a28_0x4f36a0[_0x5265b1(0x135)]('-\x20'+_0x4389d8[_0x5265b1(0x141)]+_0x5265b1(0x15f)+_0x4389d8[_0x5265b1(0x142)]+')'));continue;}const {relativePath:_0xba5bf9,source:_0x2dd0a8,result:_0x425254}=_0x4389d8;if(_0x425254['valid']&&_0x425254[_0x5265b1(0x12e)]['length']===0x0)_0x1a5359[_0x5265b1(0x14f)]&&console[_0x5265b1(0x160)](a28_0x4f36a0[_0x5265b1(0x13b)]('✔\x20'+_0xba5bf9));else _0x425254[_0x5265b1(0x14a)]?(console[_0x5265b1(0x160)](a28_0x4f36a0[_0x5265b1(0x149)]('⚠\x20'+_0xba5bf9+':\x20'+_0x425254[_0x5265b1(0x12e)]['length']+_0x5265b1(0x164))),console['log'](formatValidationResult(_0x425254,_0x2dd0a8,_0xba5bf9))):(console[_0x5265b1(0x160)](a28_0x4f36a0[_0x5265b1(0x139)]('✖\x20'+_0xba5bf9+':\x20'+_0x425254[_0x5265b1(0x131)][_0x5265b1(0x165)]+'\x20error(s)')),console[_0x5265b1(0x160)](formatValidationResult(_0x425254,_0x2dd0a8,_0xba5bf9)));}return console['log'](''),_0x1a1947[_0x5265b1(0x167)]?(console[_0x5265b1(0x160)](a28_0x4f36a0[_0x5265b1(0x139)](_0x5265b1(0x12a)+_0x1a1947[_0x5265b1(0x150)]+_0x5265b1(0x132)+_0x1a1947[_0x5265b1(0x13c)]+_0x5265b1(0x14e))),_0x1a1947[_0x5265b1(0x14c)]>0x0&&console[_0x5265b1(0x160)](a28_0x4f36a0[_0x5265b1(0x149)](_0x1a1947['warningCount']+_0x5265b1(0x144))),_0x1a1947[_0x5265b1(0x155)]>0x0&&console[_0x5265b1(0x160)](a28_0x4f36a0[_0x5265b1(0x135)](_0x1a1947[_0x5265b1(0x155)]+_0x5265b1(0x13d))),0x1):(console[_0x5265b1(0x160)](a28_0x4f36a0[_0x5265b1(0x13b)](_0x5265b1(0x12b)+_0x1a1947[_0x5265b1(0x13c)]+_0x5265b1(0x162))),_0x1a1947['warningCount']>0x0&&console[_0x5265b1(0x160)](a28_0x4f36a0['yellow'](_0x1a1947[_0x5265b1(0x14c)]+_0x5265b1(0x144))),_0x1a1947[_0x5265b1(0x155)]>0x0&&console[_0x5265b1(0x160)](a28_0x4f36a0[_0x5265b1(0x135)](_0x1a1947['skippedCount']+_0x5265b1(0x13d))),0x0);}}