@treasuredata/tdx 2026.3.48 → 2026.3.50

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 (258) 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.d.ts +22 -0
  12. package/dist/commands/auth-command.d.ts.map +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-command.js.map +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/delivery-command.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.d.ts +5 -5
  41. package/dist/commands/profile-command.d.ts.map +1 -1
  42. package/dist/commands/profile-command.js +1 -1
  43. package/dist/commands/profile-command.js.map +1 -1
  44. package/dist/commands/profiles-command.js +1 -1
  45. package/dist/commands/query-command.js +1 -1
  46. package/dist/commands/schedule-command.js +1 -1
  47. package/dist/commands/segment-command.js +1 -1
  48. package/dist/commands/segment-create-command.js +1 -1
  49. package/dist/commands/segment-fields-command.js +1 -1
  50. package/dist/commands/segment-pull-command.js +1 -1
  51. package/dist/commands/segment-push-command.js +1 -1
  52. package/dist/commands/segment-update-command.js +1 -1
  53. package/dist/commands/segment-use-command.js +1 -1
  54. package/dist/commands/segment-validate-command.js +1 -1
  55. package/dist/commands/segments.js +1 -1
  56. package/dist/commands/show.js +1 -1
  57. package/dist/commands/status-command.js +1 -1
  58. package/dist/commands/tables.js +1 -1
  59. package/dist/commands/unset-command.js +1 -1
  60. package/dist/commands/upgrade-command.js +1 -1
  61. package/dist/commands/use-command.js +1 -1
  62. package/dist/commands/user-command.js +1 -1
  63. package/dist/commands/work-command.js +1 -1
  64. package/dist/commands/workflow-command.js +1 -1
  65. package/dist/core/auth.js +1 -1
  66. package/dist/core/command-output.js +1 -1
  67. package/dist/core/config.d.ts +6 -4
  68. package/dist/core/config.d.ts.map +1 -1
  69. package/dist/core/config.js +1 -1
  70. package/dist/core/config.js.map +1 -1
  71. package/dist/core/connection-cache.js +1 -1
  72. package/dist/core/constants.js +1 -1
  73. package/dist/core/credential-cache.js +1 -1
  74. package/dist/core/global-context.js +1 -1
  75. package/dist/core/keychain.js +1 -1
  76. package/dist/core/oauth-keychain.js +1 -1
  77. package/dist/core/oauth.d.ts +12 -8
  78. package/dist/core/oauth.d.ts.map +1 -1
  79. package/dist/core/oauth.js +1 -1
  80. package/dist/core/oauth.js.map +1 -1
  81. package/dist/core/profile.js +1 -1
  82. package/dist/core/project-config.js +1 -1
  83. package/dist/core/session.js +1 -1
  84. package/dist/core/user-cache.js +1 -1
  85. package/dist/core/version.js +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/mcp/server.js +1 -1
  88. package/dist/mcp/tools/index.js +1 -1
  89. package/dist/mcp/tools/tdx-run.js +1 -1
  90. package/dist/mcp/tools/tdx-search.js +1 -1
  91. package/dist/mcp/utils.d.ts.map +1 -1
  92. package/dist/mcp/utils.js +1 -1
  93. package/dist/mcp/utils.js.map +1 -1
  94. package/dist/proxy/claude-usage-tracker.js +1 -1
  95. package/dist/proxy/passthrough-server.js +1 -1
  96. package/dist/proxy/sse-usage-parser.js +1 -1
  97. package/dist/sdk/agent/agent-config.js +1 -1
  98. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  99. package/dist/sdk/agent/agent-yaml.js +1 -1
  100. package/dist/sdk/agent/test/evaluator.js +1 -1
  101. package/dist/sdk/agent/test/executor.js +1 -1
  102. package/dist/sdk/agent/test/index.js +1 -1
  103. package/dist/sdk/agent/test/output.js +1 -1
  104. package/dist/sdk/agent/test/parser.js +1 -1
  105. package/dist/sdk/agent/tool-target-registry.js +1 -1
  106. package/dist/sdk/api.js +1 -1
  107. package/dist/sdk/cas/cas-api-client.js +1 -1
  108. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  109. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  110. package/dist/sdk/cas/index.js +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/client/cdp-api-client.js +1 -1
  114. package/dist/sdk/client/delivery-api-client.js +1 -1
  115. package/dist/sdk/client/endpoints.js +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.js +1 -1
  119. package/dist/sdk/client/oauth-refresh.js +1 -1
  120. package/dist/sdk/client/rate-limiter.js +1 -1
  121. package/dist/sdk/client/td-api-client.js +1 -1
  122. package/dist/sdk/client/trino-api-client.js +1 -1
  123. package/dist/sdk/client/workflow-client.js +1 -1
  124. package/dist/sdk/connection-validator.js +1 -1
  125. package/dist/sdk/connection.js +1 -1
  126. package/dist/sdk/delivery.js +1 -1
  127. package/dist/sdk/engage/campaign-pull.js +1 -1
  128. package/dist/sdk/engage/campaign-push.js +1 -1
  129. package/dist/sdk/engage/campaign-validator.js +1 -1
  130. package/dist/sdk/engage/campaign-yaml.js +1 -1
  131. package/dist/sdk/engage/template-pull.js +1 -1
  132. package/dist/sdk/engage/template-push.js +1 -1
  133. package/dist/sdk/engage/template-validator.js +1 -1
  134. package/dist/sdk/engage/template-yaml.js +1 -1
  135. package/dist/sdk/engage/types/campaign-def.js +1 -1
  136. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  137. package/dist/sdk/engage/types/template-schema.js +1 -1
  138. package/dist/sdk/engage.js +1 -1
  139. package/dist/sdk/errors.js +1 -1
  140. package/dist/sdk/index.js +1 -1
  141. package/dist/sdk/io/index.js +1 -1
  142. package/dist/sdk/io/node-filesystem.js +1 -1
  143. package/dist/sdk/job.js +1 -1
  144. package/dist/sdk/journey.js +1 -1
  145. package/dist/sdk/llm/chat-cache.js +1 -1
  146. package/dist/sdk/llm/index.js +1 -1
  147. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  148. package/dist/sdk/llm/model-factors.js +1 -1
  149. package/dist/sdk/personalization.js +1 -1
  150. package/dist/sdk/policy.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 +8 -0
  156. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  157. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  158. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  159. package/dist/sdk/segment/fields-display.js +1 -1
  160. package/dist/sdk/segment/file-discovery.js +1 -1
  161. package/dist/sdk/segment/journey-utils.js +1 -1
  162. package/dist/sdk/segment/journey-validator.js +1 -1
  163. package/dist/sdk/segment/journey-yaml.js +1 -1
  164. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  165. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  166. package/dist/sdk/segment/pull-workflow.js +1 -1
  167. package/dist/sdk/segment/push-recovery.js +1 -1
  168. package/dist/sdk/segment/push-workflow.js +1 -1
  169. package/dist/sdk/segment/resolution-context.js +1 -1
  170. package/dist/sdk/segment/segment-path-parser.js +1 -1
  171. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  172. package/dist/sdk/segment/segment-validator.js +1 -1
  173. package/dist/sdk/segment/target-resolution.js +1 -1
  174. package/dist/sdk/segment/tdx-config.js +1 -1
  175. package/dist/sdk/segment/types/activation-schema.js +1 -1
  176. package/dist/sdk/segment/types/journey-def.js +1 -1
  177. package/dist/sdk/segment/types/journey-schema.js +1 -1
  178. package/dist/sdk/segment/types/segment-def.js +1 -1
  179. package/dist/sdk/segment/types/segment-schema.js +1 -1
  180. package/dist/sdk/segment/validate-files.js +1 -1
  181. package/dist/sdk/segment/yaml-validator.js +1 -1
  182. package/dist/sdk/segment.js +1 -1
  183. package/dist/sdk/types/index.d.ts +1 -1
  184. package/dist/sdk/types/index.d.ts.map +1 -1
  185. package/dist/sdk/types/index.js +1 -1
  186. package/dist/sdk/types/index.js.map +1 -1
  187. package/dist/sdk/types/progress.js +1 -1
  188. package/dist/sdk/types/workspace.d.ts +29 -0
  189. package/dist/sdk/types/workspace.d.ts.map +1 -1
  190. package/dist/sdk/types/workspace.js +1 -1
  191. package/dist/sdk/user.js +1 -1
  192. package/dist/sdk/util/format-detector.js +1 -1
  193. package/dist/sdk/util/formatters.js +1 -1
  194. package/dist/sdk/util/index.js +1 -1
  195. package/dist/sdk/util/paginate.js +1 -1
  196. package/dist/sdk/util/tree-formatter.js +1 -1
  197. package/dist/sdk/workflow/archive-validation.js +1 -1
  198. package/dist/sdk/workflow/clone-workflow.js +1 -1
  199. package/dist/sdk/workflow/index.js +1 -1
  200. package/dist/sdk/workflow/pull-workflow.js +1 -1
  201. package/dist/sdk/workflow/push-workflow.js +1 -1
  202. package/dist/sdk/workflow/tdx-config.js +1 -1
  203. package/dist/sdk/workflow/workflow-utils.js +1 -1
  204. package/dist/sdk/workspace/frontmatter.js +1 -1
  205. package/dist/sdk/workspace/git.d.ts +4 -1
  206. package/dist/sdk/workspace/git.d.ts.map +1 -1
  207. package/dist/sdk/workspace/git.js +1 -1
  208. package/dist/sdk/workspace/git.js.map +1 -1
  209. package/dist/sdk/workspace/index.d.ts +8 -15
  210. package/dist/sdk/workspace/index.d.ts.map +1 -1
  211. package/dist/sdk/workspace/index.js +1 -1
  212. package/dist/sdk/workspace/index.js.map +1 -1
  213. package/dist/sdk/workspace/templates.js +1 -1
  214. package/dist/sdk/workspace/weekly.d.ts +3 -13
  215. package/dist/sdk/workspace/weekly.d.ts.map +1 -1
  216. package/dist/sdk/workspace/weekly.js +1 -1
  217. package/dist/sdk/workspace/weekly.js.map +1 -1
  218. package/dist/sdk/workspace/wikilinks.d.ts +15 -0
  219. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
  220. package/dist/sdk/workspace/wikilinks.js +1 -1
  221. package/dist/sdk/workspace/wikilinks.js.map +1 -1
  222. package/dist/test-utils/command-runner.js +1 -1
  223. package/dist/test-utils/factories.js +1 -1
  224. package/dist/test-utils/fixtures.js +1 -1
  225. package/dist/test-utils/http-mock.js +1 -1
  226. package/dist/test-utils/index.js +1 -1
  227. package/dist/utils/async.js +1 -1
  228. package/dist/utils/colors.js +1 -1
  229. package/dist/utils/diff.js +1 -1
  230. package/dist/utils/file-permissions.js +1 -1
  231. package/dist/utils/file-reader.js +1 -1
  232. package/dist/utils/github-releases.js +1 -1
  233. package/dist/utils/global-cache.js +1 -1
  234. package/dist/utils/json-loader.js +1 -1
  235. package/dist/utils/local-cache.js +1 -1
  236. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  237. package/dist/utils/logger/formatters/index.js +1 -1
  238. package/dist/utils/logger/handlers/console-handler.js +1 -1
  239. package/dist/utils/logger/handlers/file-handler.js +1 -1
  240. package/dist/utils/logger/handlers/index.js +1 -1
  241. package/dist/utils/logger/handlers/null-handler.js +1 -1
  242. package/dist/utils/logger/index.js +1 -1
  243. package/dist/utils/logger/logger.js +1 -1
  244. package/dist/utils/logger/types.js +1 -1
  245. package/dist/utils/option-validation.js +1 -1
  246. package/dist/utils/process.js +1 -1
  247. package/dist/utils/prompt.js +1 -1
  248. package/dist/utils/spinner.js +1 -1
  249. package/dist/utils/sse-parser.js +1 -1
  250. package/dist/utils/string-utils.js +1 -1
  251. package/dist/utils/table-ref-parser.js +1 -1
  252. package/dist/utils/tdx-logger.js +1 -1
  253. package/dist/utils/version-check.js +1 -1
  254. package/package.json +1 -1
  255. package/dist/commands/auth-login-command.d.ts +0 -29
  256. package/dist/commands/auth-login-command.d.ts.map +0 -1
  257. package/dist/commands/auth-login-command.js +0 -1
  258. package/dist/commands/auth-login-command.js.map +0 -1
@@ -1 +1 @@
1
- const a26_0x54ee4d=a26_0x3f37;(function(_0x53a698,_0x2ee14f){const _0xc95ac=a26_0x3f37,_0x1c5e35=_0x53a698();while(!![]){try{const _0x5e70e8=parseInt(_0xc95ac(0x197))/0x1*(-parseInt(_0xc95ac(0x19d))/0x2)+-parseInt(_0xc95ac(0x191))/0x3+-parseInt(_0xc95ac(0x18f))/0x4*(-parseInt(_0xc95ac(0x196))/0x5)+parseInt(_0xc95ac(0x1a1))/0x6*(parseInt(_0xc95ac(0x1aa))/0x7)+-parseInt(_0xc95ac(0x1a0))/0x8+parseInt(_0xc95ac(0x199))/0x9+-parseInt(_0xc95ac(0x19b))/0xa*(parseInt(_0xc95ac(0x193))/0xb);if(_0x5e70e8===_0x2ee14f)break;else _0x1c5e35['push'](_0x1c5e35['shift']());}catch(_0x1ac6c9){_0x1c5e35['push'](_0x1c5e35['shift']());}}}(a26_0x3328,0xd0ac2));import{BaseCommand}from'./command.js';function a26_0x3f37(_0x4235e5,_0x5634e5){_0x4235e5=_0x4235e5-0x17e;const _0x332897=a26_0x3328();let _0x3f3730=_0x332897[_0x4235e5];return _0x3f3730;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x3ecec2 from'chalk';function a26_0x3328(){const _0x11895f=['skippedCount','green','6463440NdqrtW','161358qJPiIC','dirname','resolve','invalidCount','log','\x20warning(s)\x20found','\x20non-template\x20file(s)\x20skipped','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20error(s)','343sKdIdC','\x20template(s)\x20valid','\x20template(s)\x20with\x20errors,\x20','\x20valid','validCount','\x20warning(s)','name','.yaml','Validation\x20failed:\x20','warningCount','length','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yml','errors','template','verbose','dim','error','warnings','yellow','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','4tYSHPg','red','621069WwHZEK','valid','22oPBcdX','Error:\x20Directory\x20not\x20found:\x20','hasErrors','7575905GexDiG','23RRtDME','cwd','13765842UcEWfg','endsWith','4098790vjKqoE','\x20non-template\x20file(s)\x20skipped)','145482CcFBuF'];a26_0x3328=function(){return _0x11895f;};return a26_0x3328();}import a26_0x254869 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{[a26_0x54ee4d(0x180)]='engage:template:validate';['description']='Validate\x20template\x20YAML\x20files';async['execute'](_0x35a1b0){const _0x3086dc=a26_0x54ee4d,{options:_0x58299c,args:_0x4aa1f9}=_0x35a1b0,_0x333775=_0x58299c,_0x5baf51=_0x4aa1f9[0x0],_0x3a212c=_0x5baf51?a26_0x254869[_0x3086dc(0x1a3)](_0x5baf51):undefined,_0x179141=_0x3a212c?isYamlFile(_0x3a212c):![];let _0x3d056a,_0x15188a;if(_0x179141&&_0x3a212c)_0x3d056a=a26_0x254869[_0x3086dc(0x1a2)](_0x3a212c),_0x15188a=_0x3a212c;else _0x3a212c?_0x3d056a=_0x3a212c:_0x3d056a=process[_0x3086dc(0x198)]();if(!_0x15188a&&!existsSync(_0x3d056a))return console['error'](a26_0x3ecec2[_0x3086dc(0x190)](_0x3086dc(0x194)+_0x3d056a+'\x0a')),0x1;let _0x2eb5d6;if(_0x15188a){if(!_0x15188a[_0x3086dc(0x19a)](_0x3086dc(0x186))&&!_0x15188a[_0x3086dc(0x19a)](_0x3086dc(0x181)))return console['error'](a26_0x3ecec2[_0x3086dc(0x190)](_0x3086dc(0x18e)+_0x15188a+'\x0a')),0x1;_0x2eb5d6=[_0x15188a];}else _0x2eb5d6=findYamlFiles(_0x3d056a);if(_0x2eb5d6[_0x3086dc(0x184)]===0x0)return console[_0x3086dc(0x18b)](a26_0x3ecec2[_0x3086dc(0x190)](_0x3086dc(0x185)+_0x3d056a+'\x0a')),0x1;const _0x3563c5=validateYamlFiles(_0x2eb5d6,_0x3d056a,{'filterType':_0x3086dc(0x188)}),_0x6caf01=calculateSummary(_0x3563c5),_0x7bffda=_0x3563c5['filter'](isValidationResult);if(_0x7bffda[_0x3086dc(0x184)]===0x0)return console[_0x3086dc(0x18b)](a26_0x3ecec2[_0x3086dc(0x18d)](_0x3086dc(0x1a8)+_0x3d056a+'\x0a')),_0x6caf01[_0x3086dc(0x19e)]>0x0&&console[_0x3086dc(0x18b)](a26_0x3ecec2[_0x3086dc(0x18a)]('('+_0x6caf01[_0x3086dc(0x19e)]+_0x3086dc(0x19c))),0x0;for(const _0xd6c246 of _0x3563c5){if(!isValidationResult(_0xd6c246)){_0x333775[_0x3086dc(0x189)]&&console['log'](a26_0x3ecec2[_0x3086dc(0x18a)]('-\x20'+_0xd6c246['relativePath']+'\x20(skipped:\x20'+_0xd6c246['reason']+')'));continue;}const {relativePath:_0x8a4b37,source:_0x350e7a,result:_0x73214a}=_0xd6c246;if(_0x73214a[_0x3086dc(0x192)]&&_0x73214a[_0x3086dc(0x18c)][_0x3086dc(0x184)]===0x0)_0x333775[_0x3086dc(0x189)]&&console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x19f)]('✔\x20'+_0x8a4b37));else _0x73214a['valid']?(console['log'](a26_0x3ecec2['yellow']('⚠\x20'+_0x8a4b37+':\x20'+_0x73214a[_0x3086dc(0x18c)][_0x3086dc(0x184)]+_0x3086dc(0x17f))),console['log'](formatValidationResult(_0x73214a,_0x350e7a,_0x8a4b37))):(console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x190)]('✖\x20'+_0x8a4b37+':\x20'+_0x73214a[_0x3086dc(0x187)]['length']+_0x3086dc(0x1a9))),console[_0x3086dc(0x1a5)](formatValidationResult(_0x73214a,_0x350e7a,_0x8a4b37)));}return console[_0x3086dc(0x1a5)](''),_0x6caf01[_0x3086dc(0x195)]?(console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x190)](_0x3086dc(0x182)+_0x6caf01[_0x3086dc(0x1a4)]+_0x3086dc(0x1ac)+_0x6caf01[_0x3086dc(0x17e)]+_0x3086dc(0x1ad))),_0x6caf01[_0x3086dc(0x183)]>0x0&&console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x18d)](_0x6caf01[_0x3086dc(0x183)]+_0x3086dc(0x1a6))),_0x6caf01[_0x3086dc(0x19e)]>0x0&&console[_0x3086dc(0x1a5)](a26_0x3ecec2['dim'](_0x6caf01[_0x3086dc(0x19e)]+_0x3086dc(0x1a7))),0x1):(console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x19f)]('✔\x20All\x20'+_0x6caf01[_0x3086dc(0x17e)]+_0x3086dc(0x1ab))),_0x6caf01[_0x3086dc(0x183)]>0x0&&console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x18d)](_0x6caf01['warningCount']+'\x20warning(s)\x20found')),_0x6caf01[_0x3086dc(0x19e)]>0x0&&console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x18a)](_0x6caf01[_0x3086dc(0x19e)]+_0x3086dc(0x1a7))),0x0);}}
1
+ const a25_0x21cc05=a25_0x25a1;(function(_0x4dcbfb,_0x265ced){const _0x5ec406=a25_0x25a1,_0x349187=_0x4dcbfb();while(!![]){try{const _0x1c143c=-parseInt(_0x5ec406(0xcc))/0x1+-parseInt(_0x5ec406(0xbd))/0x2+-parseInt(_0x5ec406(0xd0))/0x3+parseInt(_0x5ec406(0xbc))/0x4*(parseInt(_0x5ec406(0xcf))/0x5)+parseInt(_0x5ec406(0xac))/0x6+parseInt(_0x5ec406(0xce))/0x7+parseInt(_0x5ec406(0xbf))/0x8*(-parseInt(_0x5ec406(0xb5))/0x9);if(_0x1c143c===_0x265ced)break;else _0x349187['push'](_0x349187['shift']());}catch(_0x47ce3f){_0x349187['push'](_0x349187['shift']());}}}(a25_0x819c,0x75f36));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x991f4 from'chalk';function a25_0x25a1(_0x44f8a0,_0x360b48){_0x44f8a0=_0x44f8a0-0xa4;const _0x819cda=a25_0x819c();let _0x25a1c8=_0x819cda[_0x44f8a0];return _0x25a1c8;}function a25_0x819c(){const _0x3b705e=['\x20(skipped:\x20','✔\x20All\x20','Validate\x20template\x20YAML\x20files','Error:\x20Directory\x20not\x20found:\x20','red','reason','3447222ZwyjhA','\x20non-template\x20file(s)\x20skipped','\x20valid','dim','warningCount','.yml','endsWith','green','\x20template(s)\x20valid','9UggrFx','log','\x20warning(s)\x20found','error','\x20non-template\x20file(s)\x20skipped)','warnings','description','1912848BBwCBM','339948OGRHaP','length','3624232AlaFZs','yellow','relativePath','verbose','No\x20template\x20YAML\x20files\x20found\x20in\x20','name','skippedCount','validCount','\x20template(s)\x20with\x20errors,\x20','invalidCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','execute','\x20error(s)','298592RmlWWC','template','4336654qSVucw','5dQjnKb','802650XBIchy','.yaml','\x20warning(s)','valid'];a25_0x819c=function(){return _0x3b705e;};return a25_0x819c();}import a25_0x4ab48e 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_0x21cc05(0xc4)]='engage:template:validate';[a25_0x21cc05(0xbb)]=a25_0x21cc05(0xa8);async[a25_0x21cc05(0xca)](_0x5579ec){const _0xb51add=a25_0x21cc05,{options:_0x152cec,args:_0x348522}=_0x5579ec,_0xdd1bd6=_0x152cec,_0xfd857d=_0x348522[0x0],_0x1cc318=_0xfd857d?a25_0x4ab48e['resolve'](_0xfd857d):undefined,_0x1abe5c=_0x1cc318?isYamlFile(_0x1cc318):![];let _0x436d08,_0x366ddf;if(_0x1abe5c&&_0x1cc318)_0x436d08=a25_0x4ab48e['dirname'](_0x1cc318),_0x366ddf=_0x1cc318;else _0x1cc318?_0x436d08=_0x1cc318:_0x436d08=process['cwd']();if(!_0x366ddf&&!existsSync(_0x436d08))return console['error'](a25_0x991f4[_0xb51add(0xaa)](_0xb51add(0xa9)+_0x436d08+'\x0a')),0x1;let _0x1a8296;if(_0x366ddf){if(!_0x366ddf[_0xb51add(0xb2)](_0xb51add(0xb1))&&!_0x366ddf[_0xb51add(0xb2)](_0xb51add(0xd1)))return console['error'](a25_0x991f4[_0xb51add(0xaa)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x366ddf+'\x0a')),0x1;_0x1a8296=[_0x366ddf];}else _0x1a8296=findYamlFiles(_0x436d08);if(_0x1a8296[_0xb51add(0xbe)]===0x0)return console[_0xb51add(0xb8)](a25_0x991f4[_0xb51add(0xaa)](_0xb51add(0xc9)+_0x436d08+'\x0a')),0x1;const _0x46d740=validateYamlFiles(_0x1a8296,_0x436d08,{'filterType':_0xb51add(0xcd)}),_0x27b32e=calculateSummary(_0x46d740),_0x2bb549=_0x46d740['filter'](isValidationResult);if(_0x2bb549[_0xb51add(0xbe)]===0x0)return console['error'](a25_0x991f4[_0xb51add(0xc0)](_0xb51add(0xc3)+_0x436d08+'\x0a')),_0x27b32e[_0xb51add(0xc5)]>0x0&&console[_0xb51add(0xb8)](a25_0x991f4[_0xb51add(0xaf)]('('+_0x27b32e[_0xb51add(0xc5)]+_0xb51add(0xb9))),0x0;for(const _0x414a1c of _0x46d740){if(!isValidationResult(_0x414a1c)){_0xdd1bd6[_0xb51add(0xc2)]&&console[_0xb51add(0xb6)](a25_0x991f4[_0xb51add(0xaf)]('-\x20'+_0x414a1c[_0xb51add(0xc1)]+_0xb51add(0xa6)+_0x414a1c[_0xb51add(0xab)]+')'));continue;}const {relativePath:_0x1d3349,source:_0x63e8b2,result:_0x5b0327}=_0x414a1c;if(_0x5b0327['valid']&&_0x5b0327[_0xb51add(0xba)]['length']===0x0)_0xdd1bd6['verbose']&&console['log'](a25_0x991f4[_0xb51add(0xb3)]('✔\x20'+_0x1d3349));else _0x5b0327[_0xb51add(0xa5)]?(console[_0xb51add(0xb6)](a25_0x991f4[_0xb51add(0xc0)]('⚠\x20'+_0x1d3349+':\x20'+_0x5b0327[_0xb51add(0xba)][_0xb51add(0xbe)]+_0xb51add(0xa4))),console[_0xb51add(0xb6)](formatValidationResult(_0x5b0327,_0x63e8b2,_0x1d3349))):(console[_0xb51add(0xb6)](a25_0x991f4[_0xb51add(0xaa)]('✖\x20'+_0x1d3349+':\x20'+_0x5b0327['errors'][_0xb51add(0xbe)]+_0xb51add(0xcb))),console[_0xb51add(0xb6)](formatValidationResult(_0x5b0327,_0x63e8b2,_0x1d3349)));}return console[_0xb51add(0xb6)](''),_0x27b32e['hasErrors']?(console[_0xb51add(0xb6)](a25_0x991f4[_0xb51add(0xaa)]('Validation\x20failed:\x20'+_0x27b32e[_0xb51add(0xc8)]+_0xb51add(0xc7)+_0x27b32e[_0xb51add(0xc6)]+_0xb51add(0xae))),_0x27b32e['warningCount']>0x0&&console[_0xb51add(0xb6)](a25_0x991f4[_0xb51add(0xc0)](_0x27b32e[_0xb51add(0xb0)]+'\x20warning(s)\x20found')),_0x27b32e['skippedCount']>0x0&&console[_0xb51add(0xb6)](a25_0x991f4['dim'](_0x27b32e[_0xb51add(0xc5)]+_0xb51add(0xad))),0x1):(console[_0xb51add(0xb6)](a25_0x991f4[_0xb51add(0xb3)](_0xb51add(0xa7)+_0x27b32e[_0xb51add(0xc6)]+_0xb51add(0xb4))),_0x27b32e['warningCount']>0x0&&console[_0xb51add(0xb6)](a25_0x991f4['yellow'](_0x27b32e[_0xb51add(0xb0)]+_0xb51add(0xb7))),_0x27b32e[_0xb51add(0xc5)]>0x0&&console['log'](a25_0x991f4['dim'](_0x27b32e[_0xb51add(0xc5)]+_0xb51add(0xad))),0x0);}}
@@ -1 +1 @@
1
- const a27_0x2b2d97=a27_0x2ffc;(function(_0x4f6cd8,_0x2c6c5f){const _0x522247=a27_0x2ffc,_0x5e131b=_0x4f6cd8();while(!![]){try{const _0x4c220b=-parseInt(_0x522247(0x194))/0x1*(parseInt(_0x522247(0x19a))/0x2)+-parseInt(_0x522247(0x15e))/0x3+parseInt(_0x522247(0x1a3))/0x4+-parseInt(_0x522247(0x18a))/0x5+parseInt(_0x522247(0x1ae))/0x6*(-parseInt(_0x522247(0x16f))/0x7)+parseInt(_0x522247(0x171))/0x8*(parseInt(_0x522247(0x162))/0x9)+parseInt(_0x522247(0x1ad))/0xa;if(_0x4c220b===_0x2c6c5f)break;else _0x5e131b['push'](_0x5e131b['shift']());}catch(_0x16a200){_0x5e131b['push'](_0x5e131b['shift']());}}}(a27_0x415d,0xdef4a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a27_0x415d(){const _0x544e7a=['✔\x20Found\x20','red','kill','✔\x20Job\x20submitted','floor','submit','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','yes','map','file','status','priority','just\x20now','Limit:\x20','dim','Database:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','job:result','debug','Status\x20filter:\x20','url','join','4478030bhtNoe','Getting\x20job\x20results...','job_id','args','database','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Submit\x20a\x20job','start_at','Submitting\x20job...','1qcxfcP','\x20job','type','h\x20ago','No\x20SQL\x20statements\x20found\x20in\x20file','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','3070842QZqsqb','length','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','round','result','jobs','\x20\x20Job\x20ID:\x20','log','✔\x20Retrieved\x20','486928jMNwgl','abs','execute','site','m\x20ago','user_name','Cancelled','data','Query:\x20','now','45607920FjIkDM','6ZgQmGR','verbose','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','hive','Listing\x20jobs...','list','job:kill','Get\x20job\x20results','green','List\x20jobs','4193484XvZdXv','Job\x20type:\x20','presto','created_at','879354APipTX','job:submit','error','name','query','getTime','end_at','Show\x20job\x20details','success','push','trino','validate','description','1634927oPvgJN','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','24SJLMyf','INVALID_ARGUMENT','job:show'];a27_0x415d=function(){return _0x544e7a;};return a27_0x415d();}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';function a27_0x2ffc(_0x52c070,_0x4a0d0d){_0x52c070=_0x52c070-0x157;const _0x415df4=a27_0x415d();let _0x2ffcac=_0x415df4[_0x52c070];return _0x2ffcac;}import{hyperlink}from'../sdk/util/formatters.js';import a27_0x2870ad from'chalk';function formatDuration(_0x4f6f17){const _0x393bcb=a27_0x2ffc;if(_0x4f6f17<0x3c)return _0x4f6f17+'s';if(_0x4f6f17<0xe10)return Math[_0x393bcb(0x178)](_0x4f6f17/0x3c)+'m\x20'+_0x4f6f17%0x3c+'s';const _0x1c143b=Math['floor'](_0x4f6f17/0xe10),_0x1ff579=Math[_0x393bcb(0x178)](_0x4f6f17%0xe10/0x3c);return _0x1ff579>0x0?_0x1c143b+'h\x20'+_0x1ff579+'m':_0x1c143b+'h';}function formatRelativeTime(_0x227254){const _0x3db378=a27_0x2ffc,_0x1cd64d=Date[_0x3db378(0x1ac)]()-_0x227254[_0x3db378(0x167)](),_0x2602d3=Math['floor'](Math[_0x3db378(0x1a4)](_0x1cd64d)/0x3e8);if(_0x2602d3<0x3c)return _0x3db378(0x180);const _0x5f4cf7=Math['floor'](_0x2602d3/0x3c);if(_0x5f4cf7<0x3c)return _0x5f4cf7+_0x3db378(0x1a7);const _0x353d87=Math[_0x3db378(0x178)](_0x5f4cf7/0x3c);if(_0x353d87<0x18)return _0x353d87+_0x3db378(0x197);const _0x15f5f5=Math[_0x3db378(0x178)](_0x353d87/0x18);if(_0x15f5f5<0x1e)return _0x15f5f5+'d\x20ago';return Math[_0x3db378(0x178)](_0x15f5f5/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a27_0x2b2d97(0x165)]='jobs';[a27_0x2b2d97(0x16e)]=a27_0x2b2d97(0x15d);async[a27_0x2b2d97(0x1a5)](_0x1110f4){const _0xdcfc4f=a27_0x2b2d97,{options:_0x299088,tdx:_0x47dd02}=_0x1110f4,_0x32656f=resolveLimit(_0x299088['limit'],DEFAULT_DISPLAY_LIMIT),_0x350775=_0x299088['status'];_0x299088[_0xdcfc4f(0x1af)]&&(console['error'](_0xdcfc4f(0x181)+_0x32656f+'\x20jobs'),_0x350775&&console['error'](_0xdcfc4f(0x187)+_0x350775));const _0xc1415d=await withSpinner(_0xdcfc4f(0x158),()=>_0x47dd02[_0xdcfc4f(0x19f)][_0xdcfc4f(0x159)]({'from':0x0,'to':_0x32656f-0x1,'status':_0x350775}),{'verbose':_0x299088[_0xdcfc4f(0x1af)]}),_0x3fb333=_0xc1415d[_0xdcfc4f(0x1aa)];console[_0xdcfc4f(0x164)](_0xdcfc4f(0x174)+_0x3fb333[_0xdcfc4f(0x19b)]+_0xdcfc4f(0x195)+(_0x3fb333['length']!==0x1?'s':''));const _0x4fc5c=_0x299088[_0xdcfc4f(0x1a6)];if(isStructuredFormat(_0x299088)){const _0x11823e=_0x3fb333[_0xdcfc4f(0x17c)](_0x2f1f56=>{const _0x1b4a8f=_0xdcfc4f;let _0x14af9c;if(_0x2f1f56[_0x1b4a8f(0x192)]&&_0x2f1f56[_0x1b4a8f(0x168)]){const _0x97257c=new Date(_0x2f1f56[_0x1b4a8f(0x192)])[_0x1b4a8f(0x167)](),_0x4f79f2=new Date(_0x2f1f56[_0x1b4a8f(0x168)])['getTime']();_0x14af9c=Math[_0x1b4a8f(0x19d)]((_0x4f79f2-_0x97257c)/0x3e8);}return{'job_id':_0x2f1f56[_0x1b4a8f(0x18c)],'type':_0x2f1f56[_0x1b4a8f(0x196)]===_0x1b4a8f(0x160)?'trino':_0x2f1f56['type'],'status':_0x2f1f56[_0x1b4a8f(0x17e)],'user_name':_0x2f1f56[_0x1b4a8f(0x1a8)],'duration_sec':_0x14af9c,'created_at':_0x2f1f56[_0x1b4a8f(0x161)],'started_at':_0x2f1f56[_0x1b4a8f(0x192)],'end_at':_0x2f1f56[_0x1b4a8f(0x168)]};});await handleSDKOutput(_0x11823e,_0x299088);}else for(const _0x1f853e of _0x3fb333){const _0x52c267=_0x1f853e[_0xdcfc4f(0x17e)]===_0xdcfc4f(0x16a)?a27_0x2870ad[_0xdcfc4f(0x15c)]:_0x1f853e[_0xdcfc4f(0x17e)]==='error'?a27_0x2870ad[_0xdcfc4f(0x175)]:a27_0x2870ad[_0xdcfc4f(0x182)],_0x3aea76=_0x52c267(_0x1f853e['status']),_0x49b7e2=getJobUrl(_0x4fc5c,_0x1f853e[_0xdcfc4f(0x18c)]),_0x4b7ce0=hyperlink(_0x1f853e[_0xdcfc4f(0x18c)],_0x49b7e2),_0x5e6b64=a27_0x2870ad[_0xdcfc4f(0x182)](_0x1f853e['type']===_0xdcfc4f(0x160)?_0xdcfc4f(0x16c):_0x1f853e[_0xdcfc4f(0x196)]),_0x537d20=[];if(_0x1f853e[_0xdcfc4f(0x192)]&&_0x1f853e[_0xdcfc4f(0x168)]){const _0x30f0a6=Math[_0xdcfc4f(0x19d)]((new Date(_0x1f853e[_0xdcfc4f(0x168)])[_0xdcfc4f(0x167)]()-new Date(_0x1f853e[_0xdcfc4f(0x192)])[_0xdcfc4f(0x167)]())/0x3e8);_0x537d20[_0xdcfc4f(0x16b)](formatDuration(_0x30f0a6));}if(_0x1f853e[_0xdcfc4f(0x168)])_0x537d20[_0xdcfc4f(0x16b)](formatRelativeTime(new Date(_0x1f853e['end_at'])));else _0x1f853e[_0xdcfc4f(0x192)]&&_0x537d20[_0xdcfc4f(0x16b)](formatRelativeTime(new Date(_0x1f853e[_0xdcfc4f(0x192)])));const _0x49846a=_0x537d20[_0xdcfc4f(0x19b)]>0x0?a27_0x2870ad[_0xdcfc4f(0x182)]('\x20'+_0x537d20[_0xdcfc4f(0x189)](',\x20')):'';console[_0xdcfc4f(0x1a1)]('⚡\x20'+_0x4b7ce0+'\x20'+_0x5e6b64+'\x20'+_0x3aea76+_0x49846a);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x2b2d97(0x165)]=a27_0x2b2d97(0x173);[a27_0x2b2d97(0x16e)]=a27_0x2b2d97(0x169);[a27_0x2b2d97(0x16d)](_0x147a70){const _0x32c4c4=a27_0x2b2d97,_0x2fb64e=_0x147a70[_0x32c4c4(0x18d)][0x0];if(!_0x2fb64e)return _0x32c4c4(0x184);return undefined;}async['execute'](_0x4e8b92){const _0x47c2d4=a27_0x2b2d97,{options:_0x301039,args:_0x52850c,tdx:_0x35a772}=_0x4e8b92,_0x1e15bc=_0x52850c[0x0],_0x2fd992=await withSpinner('Getting\x20job\x20details...',()=>_0x35a772[_0x47c2d4(0x19f)]['show'](_0x1e15bc),{'verbose':_0x301039[_0x47c2d4(0x1af)]}),_0x38e7a2=_0x2fd992[_0x47c2d4(0x1aa)];let _0x540e5f;if(_0x38e7a2[_0x47c2d4(0x192)]&&_0x38e7a2[_0x47c2d4(0x168)]){const _0x50884a=new Date(_0x38e7a2[_0x47c2d4(0x192)])[_0x47c2d4(0x167)](),_0x4cb888=new Date(_0x38e7a2['end_at'])[_0x47c2d4(0x167)]();_0x540e5f=Math[_0x47c2d4(0x19d)]((_0x4cb888-_0x50884a)/0x3e8);}const _0xd4bcaa={'job_id':_0x38e7a2[_0x47c2d4(0x18c)],'type':_0x38e7a2[_0x47c2d4(0x196)],'status':_0x38e7a2[_0x47c2d4(0x17e)],..._0x38e7a2[_0x47c2d4(0x1a8)]&&{'user_name':_0x38e7a2[_0x47c2d4(0x1a8)]},..._0x540e5f!==undefined&&{'duration_sec':_0x540e5f},..._0x38e7a2[_0x47c2d4(0x161)]&&{'created_at':_0x38e7a2[_0x47c2d4(0x161)]},..._0x38e7a2[_0x47c2d4(0x192)]&&{'started_at':_0x38e7a2[_0x47c2d4(0x192)]},..._0x38e7a2['end_at']&&{'end_at':_0x38e7a2['end_at']},..._0x38e7a2[_0x47c2d4(0x18e)]&&{'database':_0x38e7a2[_0x47c2d4(0x18e)]},..._0x38e7a2['priority']!==undefined&&{'priority':_0x38e7a2[_0x47c2d4(0x17f)]},..._0x38e7a2[_0x47c2d4(0x188)]&&{'url':_0x38e7a2[_0x47c2d4(0x188)]},..._0x38e7a2[_0x47c2d4(0x166)]&&{'query':_0x38e7a2[_0x47c2d4(0x166)]},..._0x38e7a2[_0x47c2d4(0x186)]&&{'debug':_0x38e7a2['debug']}};return await handleSingleObjectOutput(_0xd4bcaa,_0x301039),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a27_0x2b2d97(0x15a);[a27_0x2b2d97(0x16e)]='Kill\x20a\x20job';[a27_0x2b2d97(0x16d)](_0x557de7){const _0x170219=a27_0x2b2d97,_0x3eb009=_0x557de7[_0x170219(0x18d)][0x0];if(!_0x3eb009)return _0x170219(0x170);return undefined;}async[a27_0x2b2d97(0x1a5)](_0x4aa92c){const _0x4a4ba3=a27_0x2b2d97,{options:_0x4a6689,args:_0x39fd25,tdx:_0x2c7d90}=_0x4aa92c,_0x4c9cb7=_0x39fd25[0x0];if(!_0x4a6689[_0x4a4ba3(0x17b)]){const _0x4dcb23=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x4c9cb7+'?');if(!_0x4dcb23)return console[_0x4a4ba3(0x164)](_0x4a4ba3(0x1a9)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x2c7d90[_0x4a4ba3(0x19f)][_0x4a4ba3(0x176)](_0x4c9cb7),{'verbose':_0x4a6689[_0x4a4ba3(0x1af)]}),console['error'](_0x4a4ba3(0x1b0)+_0x4c9cb7),console['error'](_0x4a4ba3(0x199)+_0x4c9cb7+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x2b2d97(0x165)]=a27_0x2b2d97(0x163);[a27_0x2b2d97(0x16e)]=a27_0x2b2d97(0x191);async[a27_0x2b2d97(0x1a5)](_0x1b3f49){const _0x2e478a=a27_0x2b2d97,{options:_0x9980a,args:_0x5281d0,tdx:_0x3bcf7f}=_0x1b3f49,_0x5e533c=_0x9980a['jobType']||_0x2e478a(0x16c),_0x3ea830=_0x9980a[_0x2e478a(0x17d)],_0x139e19=_0x9980a['database']||'information_schema',_0x4dace7=_0x9980a[_0x2e478a(0x19e)];if(_0x5e533c!==_0x2e478a(0x16c)&&_0x5e533c!==_0x2e478a(0x157))throw new SDKError(ErrorCode[_0x2e478a(0x172)],_0x2e478a(0x18f));let _0x2c2f6a;if(_0x3ea830){if(_0x5281d0[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2e478a(0x190));const _0x31c576=readSqlStatementsFromFile(_0x3ea830);if(_0x31c576[_0x2e478a(0x19b)]===0x0)throw new SDKError(ErrorCode[_0x2e478a(0x172)],_0x2e478a(0x198));if(_0x31c576['length']>0x1)throw new SDKError(ErrorCode[_0x2e478a(0x172)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x2c2f6a=_0x31c576[0x0];}else{if(!_0x5281d0[0x0])throw new SDKError(ErrorCode[_0x2e478a(0x172)],_0x2e478a(0x19c));_0x2c2f6a=_0x5281d0[0x0];}_0x9980a[_0x2e478a(0x1af)]&&(console[_0x2e478a(0x164)](_0x2e478a(0x15f)+_0x5e533c),console[_0x2e478a(0x164)](_0x2e478a(0x183)+_0x139e19),console[_0x2e478a(0x164)](_0x2e478a(0x1ab)+_0x2c2f6a['substring'](0x0,0x64)+(_0x2c2f6a['length']>0x64?'...':'')));const _0x314033=await withSpinner(_0x2e478a(0x193),()=>_0x3bcf7f[_0x2e478a(0x19f)][_0x2e478a(0x179)](_0x139e19,_0x2c2f6a,_0x5e533c,_0x4dace7),{'verbose':_0x9980a['verbose']}),_0x5a29ee=_0x314033['data'];return console[_0x2e478a(0x164)](_0x2e478a(0x177)),console[_0x2e478a(0x164)](_0x2e478a(0x1a0)+_0x5a29ee[_0x2e478a(0x18c)]),await handleSDKOutput([_0x5a29ee],_0x9980a),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x2b2d97(0x165)]=a27_0x2b2d97(0x185);[a27_0x2b2d97(0x16e)]=a27_0x2b2d97(0x15b);[a27_0x2b2d97(0x16d)](_0x7dbe7b){const _0x4233bc=a27_0x2b2d97,_0x3f44ff=_0x7dbe7b[_0x4233bc(0x18d)][0x0];if(!_0x3f44ff)return _0x4233bc(0x17a);return undefined;}async[a27_0x2b2d97(0x1a5)](_0x563416){const _0x5b9a2d=a27_0x2b2d97,{options:_0x718fdd,args:_0x52dad6,tdx:_0x26ffaf}=_0x563416,_0x5734a0=_0x52dad6[0x0],_0x89791f=await withSpinner(_0x5b9a2d(0x18b),()=>_0x26ffaf['jobs']['result'](_0x5734a0),{'verbose':_0x718fdd[_0x5b9a2d(0x1af)]}),_0x20db71=_0x89791f['data'];return console[_0x5b9a2d(0x164)](_0x5b9a2d(0x1a2)+_0x20db71[_0x5b9a2d(0x19b)]+'\x20row'+(_0x20db71['length']!==0x1?'s':'')),await handleSDKOutput(_0x20db71,_0x718fdd),0x0;}}
1
+ const a26_0xfd6530=a26_0x4f30;(function(_0x5782d6,_0x34a635){const _0xd5ec08=a26_0x4f30,_0x506880=_0x5782d6();while(!![]){try{const _0x3a6947=parseInt(_0xd5ec08(0xba))/0x1+parseInt(_0xd5ec08(0xf1))/0x2+parseInt(_0xd5ec08(0xe5))/0x3*(-parseInt(_0xd5ec08(0xf2))/0x4)+-parseInt(_0xd5ec08(0xf3))/0x5*(parseInt(_0xd5ec08(0xca))/0x6)+parseInt(_0xd5ec08(0x110))/0x7+-parseInt(_0xd5ec08(0xc3))/0x8+parseInt(_0xd5ec08(0xda))/0x9;if(_0x3a6947===_0x34a635)break;else _0x506880['push'](_0x506880['shift']());}catch(_0x1b4fb8){_0x506880['push'](_0x506880['shift']());}}}(a26_0x3c31,0xd3469));function a26_0x4f30(_0x36b707,_0x14b112){_0x36b707=_0x36b707-0xb7;const _0x3c3116=a26_0x3c31();let _0x4f3008=_0x3c3116[_0x36b707];return _0x4f3008;}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_0x48eed4 from'chalk';function formatDuration(_0x9b2736){const _0x5b168e=a26_0x4f30;if(_0x9b2736<0x3c)return _0x9b2736+'s';if(_0x9b2736<0xe10)return Math[_0x5b168e(0x10f)](_0x9b2736/0x3c)+'m\x20'+_0x9b2736%0x3c+'s';const _0x368f32=Math[_0x5b168e(0x10f)](_0x9b2736/0xe10),_0x9eeb14=Math[_0x5b168e(0x10f)](_0x9b2736%0xe10/0x3c);return _0x9eeb14>0x0?_0x368f32+'h\x20'+_0x9eeb14+'m':_0x368f32+'h';}function formatRelativeTime(_0x5ac7ed){const _0x516be8=a26_0x4f30,_0x1ebefc=Date[_0x516be8(0x100)]()-_0x5ac7ed[_0x516be8(0xf0)](),_0x4cbfc1=Math['floor'](Math[_0x516be8(0x105)](_0x1ebefc)/0x3e8);if(_0x4cbfc1<0x3c)return _0x516be8(0x104);const _0x19c1c4=Math[_0x516be8(0x10f)](_0x4cbfc1/0x3c);if(_0x19c1c4<0x3c)return _0x19c1c4+_0x516be8(0xe8);const _0x2454d8=Math[_0x516be8(0x10f)](_0x19c1c4/0x3c);if(_0x2454d8<0x18)return _0x2454d8+_0x516be8(0xbe);const _0x3ad262=Math['floor'](_0x2454d8/0x18);if(_0x3ad262<0x1e)return _0x3ad262+'d\x20ago';return Math[_0x516be8(0x10f)](_0x3ad262/0x1e)+_0x516be8(0x107);}export class JobListCommand extends BaseCommand{[a26_0xfd6530(0xc2)]='jobs';['description']=a26_0xfd6530(0xfb);async[a26_0xfd6530(0xde)](_0x1ad5fd){const _0x8f683b=a26_0xfd6530,{options:_0x5bd447,tdx:_0x4c8eef}=_0x1ad5fd,_0x333b09=resolveLimit(_0x5bd447[_0x8f683b(0xb9)],DEFAULT_DISPLAY_LIMIT),_0x47e60c=_0x5bd447['status'];_0x5bd447[_0x8f683b(0xd4)]&&(console[_0x8f683b(0xf7)](_0x8f683b(0xbb)+_0x333b09+_0x8f683b(0xd6)),_0x47e60c&&console['error'](_0x8f683b(0xd2)+_0x47e60c));const _0x5cbc5a=await withSpinner(_0x8f683b(0x101),()=>_0x4c8eef['jobs'][_0x8f683b(0xc1)]({'from':0x0,'to':_0x333b09-0x1,'status':_0x47e60c}),{'verbose':_0x5bd447[_0x8f683b(0xd4)]}),_0xa32d79=_0x5cbc5a[_0x8f683b(0x10d)];console['error']('✔\x20Found\x20'+_0xa32d79['length']+'\x20job'+(_0xa32d79['length']!==0x1?'s':''));const _0x54d61c=_0x5bd447[_0x8f683b(0xdf)];if(isStructuredFormat(_0x5bd447)){const _0x8b7c3=_0xa32d79[_0x8f683b(0xdb)](_0x12aefa=>{const _0x107de2=_0x8f683b;let _0x233e8d;if(_0x12aefa[_0x107de2(0x10c)]&&_0x12aefa[_0x107de2(0xf5)]){const _0x2368d3=new Date(_0x12aefa['start_at'])[_0x107de2(0xf0)](),_0x1a9a68=new Date(_0x12aefa['end_at'])['getTime']();_0x233e8d=Math[_0x107de2(0xe3)]((_0x1a9a68-_0x2368d3)/0x3e8);}return{'job_id':_0x12aefa[_0x107de2(0xed)],'type':_0x12aefa[_0x107de2(0xe6)]===_0x107de2(0xc6)?_0x107de2(0xf4):_0x12aefa[_0x107de2(0xe6)],'status':_0x12aefa[_0x107de2(0xbc)],'user_name':_0x12aefa[_0x107de2(0xe1)],'duration_sec':_0x233e8d,'created_at':_0x12aefa[_0x107de2(0x10b)],'started_at':_0x12aefa['start_at'],'end_at':_0x12aefa[_0x107de2(0xf5)]};});await handleSDKOutput(_0x8b7c3,_0x5bd447);}else for(const _0x1a2816 of _0xa32d79){const _0x219a2f=_0x1a2816[_0x8f683b(0xbc)]===_0x8f683b(0xd0)?a26_0x48eed4['green']:_0x1a2816[_0x8f683b(0xbc)]==='error'?a26_0x48eed4[_0x8f683b(0xfd)]:a26_0x48eed4[_0x8f683b(0xc4)],_0x1aa982=_0x219a2f(_0x1a2816[_0x8f683b(0xbc)]),_0x511013=getJobUrl(_0x54d61c,_0x1a2816['job_id']),_0x1e5538=hyperlink(_0x1a2816[_0x8f683b(0xed)],_0x511013),_0x19518e=a26_0x48eed4[_0x8f683b(0xc4)](_0x1a2816[_0x8f683b(0xe6)]===_0x8f683b(0xc6)?_0x8f683b(0xf4):_0x1a2816['type']),_0x420e57=[];if(_0x1a2816[_0x8f683b(0x10c)]&&_0x1a2816['end_at']){const _0x2ca8ff=Math['round']((new Date(_0x1a2816[_0x8f683b(0xf5)])['getTime']()-new Date(_0x1a2816[_0x8f683b(0x10c)])[_0x8f683b(0xf0)]())/0x3e8);_0x420e57[_0x8f683b(0x102)](formatDuration(_0x2ca8ff));}if(_0x1a2816[_0x8f683b(0xf5)])_0x420e57[_0x8f683b(0x102)](formatRelativeTime(new Date(_0x1a2816[_0x8f683b(0xf5)])));else _0x1a2816['start_at']&&_0x420e57[_0x8f683b(0x102)](formatRelativeTime(new Date(_0x1a2816[_0x8f683b(0x10c)])));const _0x4680ec=_0x420e57[_0x8f683b(0xd3)]>0x0?a26_0x48eed4['dim']('\x20'+_0x420e57['join'](',\x20')):'';console['log']('⚡\x20'+_0x1e5538+'\x20'+_0x19518e+'\x20'+_0x1aa982+_0x4680ec);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0xfd6530(0xc2)]=a26_0xfd6530(0xcc);[a26_0xfd6530(0xd7)]=a26_0xfd6530(0xf9);['validate'](_0x334a69){const _0x807646=_0x334a69['args'][0x0];if(!_0x807646)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0xfd6530(0xde)](_0x31283a){const _0x2ac926=a26_0xfd6530,{options:_0x13f703,args:_0x58ae09,tdx:_0x154f5d}=_0x31283a,_0x2e2d02=_0x58ae09[0x0],_0x4e476b=await withSpinner(_0x2ac926(0xcf),()=>_0x154f5d[_0x2ac926(0xc7)][_0x2ac926(0x10a)](_0x2e2d02),{'verbose':_0x13f703[_0x2ac926(0xd4)]}),_0x3d5aa6=_0x4e476b[_0x2ac926(0x10d)];let _0x190c1c;if(_0x3d5aa6[_0x2ac926(0x10c)]&&_0x3d5aa6[_0x2ac926(0xf5)]){const _0x475e96=new Date(_0x3d5aa6[_0x2ac926(0x10c)])[_0x2ac926(0xf0)](),_0x24fd64=new Date(_0x3d5aa6[_0x2ac926(0xf5)])[_0x2ac926(0xf0)]();_0x190c1c=Math[_0x2ac926(0xe3)]((_0x24fd64-_0x475e96)/0x3e8);}const _0x13ebb4={'job_id':_0x3d5aa6[_0x2ac926(0xed)],'type':_0x3d5aa6[_0x2ac926(0xe6)],'status':_0x3d5aa6['status'],..._0x3d5aa6[_0x2ac926(0xe1)]&&{'user_name':_0x3d5aa6['user_name']},..._0x190c1c!==undefined&&{'duration_sec':_0x190c1c},..._0x3d5aa6['created_at']&&{'created_at':_0x3d5aa6[_0x2ac926(0x10b)]},..._0x3d5aa6['start_at']&&{'started_at':_0x3d5aa6[_0x2ac926(0x10c)]},..._0x3d5aa6[_0x2ac926(0xf5)]&&{'end_at':_0x3d5aa6[_0x2ac926(0xf5)]},..._0x3d5aa6['database']&&{'database':_0x3d5aa6[_0x2ac926(0xdd)]},..._0x3d5aa6[_0x2ac926(0xd8)]!==undefined&&{'priority':_0x3d5aa6[_0x2ac926(0xd8)]},..._0x3d5aa6[_0x2ac926(0xfa)]&&{'url':_0x3d5aa6['url']},..._0x3d5aa6[_0x2ac926(0xcb)]&&{'query':_0x3d5aa6[_0x2ac926(0xcb)]},..._0x3d5aa6['debug']&&{'debug':_0x3d5aa6[_0x2ac926(0xc0)]}};return await handleSingleObjectOutput(_0x13ebb4,_0x13f703),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0xfd6530(0xc2)]=a26_0xfd6530(0xe7);[a26_0xfd6530(0xd7)]=a26_0xfd6530(0xef);[a26_0xfd6530(0xbf)](_0x1d7713){const _0x26d013=a26_0xfd6530,_0xa248c4=_0x1d7713[_0x26d013(0xf8)][0x0];if(!_0xa248c4)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a26_0xfd6530(0xde)](_0x3b364e){const _0xb4a0d4=a26_0xfd6530,{options:_0x45d2da,args:_0x1dd2c0,tdx:_0x514aa4}=_0x3b364e,_0x58de36=_0x1dd2c0[0x0];if(!_0x45d2da[_0xb4a0d4(0xb8)]){const _0x58697d=await confirm(_0xb4a0d4(0xcd)+_0x58de36+'?');if(!_0x58697d)return console[_0xb4a0d4(0xf7)](_0xb4a0d4(0xd9)),0x0;}return await withSpinner(_0xb4a0d4(0xc8),()=>_0x514aa4[_0xb4a0d4(0xc7)]['kill'](_0x58de36),{'verbose':_0x45d2da[_0xb4a0d4(0xd4)]}),console[_0xb4a0d4(0xf7)](_0xb4a0d4(0xd5)+_0x58de36),console['error']('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x58de36+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0xfd6530(0xc2)]=a26_0xfd6530(0xea);[a26_0xfd6530(0xd7)]=a26_0xfd6530(0x108);async['execute'](_0x585734){const _0x5017e0=a26_0xfd6530,{options:_0x5c0015,args:_0x5d66f2,tdx:_0x4bf261}=_0x585734,_0x3044f9=_0x5c0015[_0x5017e0(0xc9)]||_0x5017e0(0xf4),_0x451fa2=_0x5c0015[_0x5017e0(0xbd)],_0x3eb99f=_0x5c0015[_0x5017e0(0xdd)]||'information_schema',_0x3897c4=_0x5c0015[_0x5017e0(0xec)];if(_0x3044f9!==_0x5017e0(0xf4)&&_0x3044f9!==_0x5017e0(0xb7))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5017e0(0xee));let _0x47bd99;if(_0x451fa2){if(_0x5d66f2[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5017e0(0xc5));const _0x399954=readSqlStatementsFromFile(_0x451fa2);if(_0x399954[_0x5017e0(0xd3)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5017e0(0xdc));if(_0x399954[_0x5017e0(0xd3)]>0x1)throw new SDKError(ErrorCode[_0x5017e0(0xfe)],_0x5017e0(0x103));_0x47bd99=_0x399954[0x0];}else{if(!_0x5d66f2[0x0])throw new SDKError(ErrorCode[_0x5017e0(0xfe)],_0x5017e0(0x10e));_0x47bd99=_0x5d66f2[0x0];}_0x5c0015[_0x5017e0(0xd4)]&&(console[_0x5017e0(0xf7)](_0x5017e0(0x106)+_0x3044f9),console['error'](_0x5017e0(0xfc)+_0x3eb99f),console['error'](_0x5017e0(0x109)+_0x47bd99['substring'](0x0,0x64)+(_0x47bd99[_0x5017e0(0xd3)]>0x64?_0x5017e0(0xe0):'')));const _0x8f772f=await withSpinner(_0x5017e0(0xeb),()=>_0x4bf261[_0x5017e0(0xc7)][_0x5017e0(0xe2)](_0x3eb99f,_0x47bd99,_0x3044f9,_0x3897c4),{'verbose':_0x5c0015['verbose']}),_0xde28af=_0x8f772f[_0x5017e0(0x10d)];return console['error'](_0x5017e0(0xff)),console[_0x5017e0(0xf7)]('\x20\x20Job\x20ID:\x20'+_0xde28af[_0x5017e0(0xed)]),await handleSDKOutput([_0xde28af],_0x5c0015),0x0;}}function a26_0x3c31(){const _0x3a8777=['h\x20ago','validate','debug','list','name','10905520JrTMLV','dim','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','presto','jobs','Submitting\x20kill\x20request...','jobType','12PYoSFx','query','job:show','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Get\x20job\x20results','Getting\x20job\x20details...','success','job:result','Status\x20filter:\x20','length','verbose','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','\x20jobs','description','priority','Cancelled','20998116CEvZxG','map','No\x20SQL\x20statements\x20found\x20in\x20file','database','execute','site','...','user_name','submit','round','✔\x20Retrieved\x20','3982008JxAQzn','type','job:kill','m\x20ago','\x20row','job:submit','Submitting\x20job...','result','job_id','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Kill\x20a\x20job','getTime','2543866bYhCEN','4kmioOe','3859105TUqOnr','trino','end_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','error','args','Show\x20job\x20details','url','List\x20jobs','Database:\x20','red','INVALID_ARGUMENT','✔\x20Job\x20submitted','now','Listing\x20jobs...','push','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','just\x20now','abs','Job\x20type:\x20','mo\x20ago','Submit\x20a\x20job','Query:\x20','show','created_at','start_at','data','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','floor','9543030vLaZVH','hive','yes','limit','131206Hkcczk','Limit:\x20','status','file'];a26_0x3c31=function(){return _0x3a8777;};return a26_0x3c31();}export class JobResultCommand extends BaseCommand{[a26_0xfd6530(0xc2)]=a26_0xfd6530(0xd1);['description']=a26_0xfd6530(0xce);[a26_0xfd6530(0xbf)](_0x37b155){const _0x4d7b0b=a26_0xfd6530,_0x411fcc=_0x37b155['args'][0x0];if(!_0x411fcc)return _0x4d7b0b(0xf6);return undefined;}async['execute'](_0x1d5a35){const _0x36618b=a26_0xfd6530,{options:_0x3a99a3,args:_0x547c27,tdx:_0x47b068}=_0x1d5a35,_0x1fb310=_0x547c27[0x0],_0xd3abe4=await withSpinner('Getting\x20job\x20results...',()=>_0x47b068[_0x36618b(0xc7)][_0x36618b(0xec)](_0x1fb310),{'verbose':_0x3a99a3['verbose']}),_0x40b8b2=_0xd3abe4[_0x36618b(0x10d)];return console[_0x36618b(0xf7)](_0x36618b(0xe4)+_0x40b8b2['length']+_0x36618b(0xe9)+(_0x40b8b2[_0x36618b(0xd3)]!==0x1?'s':'')),await handleSDKOutput(_0x40b8b2,_0x3a99a3),0x0;}}
@@ -1 +1 @@
1
- const a28_0x4d4d86=a28_0x4fe4;(function(_0x57ef9c,_0x38d14d){const _0x3401ed=a28_0x4fe4,_0x22e9cf=_0x57ef9c();while(!![]){try{const _0x40928e=-parseInt(_0x3401ed(0x232))/0x1*(parseInt(_0x3401ed(0x27e))/0x2)+-parseInt(_0x3401ed(0x284))/0x3*(parseInt(_0x3401ed(0x23c))/0x4)+-parseInt(_0x3401ed(0x237))/0x5+parseInt(_0x3401ed(0x1ba))/0x6*(parseInt(_0x3401ed(0x1e4))/0x7)+parseInt(_0x3401ed(0x1ac))/0x8*(-parseInt(_0x3401ed(0x1c9))/0x9)+-parseInt(_0x3401ed(0x212))/0xa*(-parseInt(_0x3401ed(0x28d))/0xb)+parseInt(_0x3401ed(0x1d5))/0xc*(parseInt(_0x3401ed(0x1a6))/0xd);if(_0x40928e===_0x38d14d)break;else _0x22e9cf['push'](_0x22e9cf['shift']());}catch(_0xd00538){_0x22e9cf['push'](_0x22e9cf['shift']());}}}(a28_0x1a48,0xe0bba));import a28_0x4474e0 from'chalk';import a28_0x3aa0f7 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';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}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x354dc1){const _0xff3422=a28_0x4fe4;return!_0x354dc1&&(console[_0xff3422(0x1cd)](_0xff3422(0x26c)),console[_0xff3422(0x1cd)](_0xff3422(0x1c6))),!!_0x354dc1;}function withJsonFormat(_0x32c71f){const _0x48aabb=a28_0x4fe4;if(!_0x32c71f[_0x48aabb(0x259)]&&!_0x32c71f[_0x48aabb(0x1e3)]&&!_0x32c71f[_0x48aabb(0x21a)]&&!_0x32c71f['tsv'])return{..._0x32c71f,'format':_0x48aabb(0x1e3),'json':!![]};return _0x32c71f;}function formatJourneyState(_0x3d1b79){const _0x1c13be=a28_0x4fe4;switch(_0x3d1b79){case _0x1c13be(0x280):return a28_0x4474e0[_0x1c13be(0x1f0)]('(running)');case'draft':return a28_0x4474e0['dim']('(draft)');case'paused':return a28_0x4474e0[_0x1c13be(0x270)]('(paused)');case _0x1c13be(0x1fb):return a28_0x4474e0[_0x1c13be(0x266)]('(completed)');case _0x1c13be(0x209):return a28_0x4474e0['dim']('(archived)');default:return'('+_0x3d1b79+')';}}function a28_0x4fe4(_0x5be1bc,_0x4df57c){_0x5be1bc=_0x5be1bc-0x181;const _0x1a4851=a28_0x1a48();let _0x4fe489=_0x1a4851[_0x5be1bc];return _0x4fe489;}function formatJourneyItem(_0xdce187,_0x4838d2='',_0x3025c1){const _0x2366fb=a28_0x4fe4,_0x40e7a0=formatJourneyState(_0xdce187[_0x2366fb(0x25b)]),_0x4d8452=_0x3025c1?hyperlink(_0xdce187[_0x2366fb(0x213)],_0x3025c1):_0xdce187[_0x2366fb(0x213)];return _0x4838d2+'🗺️\x20'+_0x4d8452+'\x20'+_0x40e7a0;}function escapeRegex(_0x15e6f7){const _0xfd557c=a28_0x4fe4;return _0x15e6f7[_0xfd557c(0x1cf)](/[.*+?^${}()|[\]\\]/g,_0xfd557c(0x189));}function globToRegex(_0x2b0c37){const _0x129045=a28_0x4fe4,_0xc60f0d=_0x2b0c37[_0x129045(0x257)]('*')[_0x129045(0x203)](escapeRegex);return new RegExp(_0xc60f0d['join']('.*'),'i');}function buildRuleToNameMapping(_0x18e07e){const _0x54348b=a28_0x4fe4,_0x163b28=new Map();if(_0x18e07e['segments'])for(const [_0x459866,_0x427382]of Object[_0x54348b(0x260)](_0x18e07e['segments'])){if(_0x427382['rule']){const _0x191b09=serializeRule(_0x427382[_0x54348b(0x25f)]),_0x4838f6=_0x163b28[_0x54348b(0x1ec)](_0x191b09);_0x4838f6?_0x4838f6[_0x54348b(0x1bb)](_0x459866):_0x163b28[_0x54348b(0x24e)](_0x191b09,[_0x459866]);}}return _0x163b28;}async function resolveJourneyIdFromInput(_0x484802,_0x187424,_0x2242cb){const _0x35dc70=a28_0x4fe4,_0x10d202=await resolveJourneyTarget(_0x484802,_0x187424[_0x35dc70(0x271)],_0x187424[_0x35dc70(0x217)]),_0x4c1637=_0x10d202['parentSegment'];if(!_0x4c1637)throw new SDKError(ErrorCode[_0x35dc70(0x1f9)],_0x35dc70(0x1fe));const _0x2f4790=await withSpinner(_0x35dc70(0x250),()=>_0x2242cb[_0x35dc70(0x1ed)]['resolveParentId'](_0x4c1637),{'verbose':_0x187424[_0x35dc70(0x217)]}),_0x1bc984=_0x2f4790['data'],_0x49d996=await withSpinner(_0x35dc70(0x221),()=>_0x2242cb[_0x35dc70(0x276)][_0x35dc70(0x1df)](_0x1bc984,_0x10d202['journeyName']),{'verbose':_0x187424[_0x35dc70(0x217)]});return{'journeyId':_0x49d996['data'],'journeyName':_0x10d202[_0x35dc70(0x18b)],'parentSegmentId':_0x1bc984};}async function resolveJourneyTarget(_0x2f383a,_0x2e722c,_0x478c54){const _0x287ede=a28_0x4fe4;if(isYamlFilePath(_0x2f383a))try{const _0x3716d3=await resolveYamlFilePath(_0x2f383a);return _0x478c54&&(console[_0x287ede(0x1cd)](_0x287ede(0x26e)+_0x2f383a),console[_0x287ede(0x1cd)]('\x20\x20Parent\x20segment:\x20'+_0x3716d3['parentSegment']),console['error'](_0x287ede(0x214)+_0x3716d3[_0x287ede(0x256)]),console[_0x287ede(0x1cd)](_0x287ede(0x220)+(_0x3716d3['folderPath']||_0x287ede(0x27b)))),{'journeyName':_0x3716d3[_0x287ede(0x256)],'parentSegment':_0x3716d3[_0x287ede(0x271)],'resolved':_0x3716d3};}catch(_0x94d124){throw new SDKError(ErrorCode[_0x287ede(0x1f9)],_0x287ede(0x223)+_0x94d124[_0x287ede(0x23b)]);}if(!_0x2e722c)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x287ede(0x1ce));return{'journeyName':_0x2f383a,'parentSegment':_0x2e722c};}export class JourneyListCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x191);['description']='List\x20journeys\x20in\x20current\x20context';async[a28_0x4d4d86(0x1b9)](_0x589bf2){const _0x421175=a28_0x4d4d86,{options:_0x37059b,args:_0x1f8edb,tdx:_0x5b2dcc}=_0x589bf2,_0x5c0a39=_0x1f8edb[0x0],_0x307c12=_0x37059b['parentSegment'];if(!_0x307c12)return console['error'](_0x421175(0x1db)),console[_0x421175(0x1cd)](_0x421175(0x27c)),0x1;const _0x7fbe6a=await withSpinner(_0x421175(0x250),()=>_0x5b2dcc[_0x421175(0x1ed)][_0x421175(0x278)](_0x307c12),{'verbose':_0x37059b[_0x421175(0x217)]}),_0x262f32=_0x7fbe6a[_0x421175(0x26d)];_0x37059b['verbose']&&(console['error'](_0x421175(0x1cb)+_0x307c12+'\x20(ID:\x20'+_0x262f32+')'),_0x5c0a39&&console['error'](_0x421175(0x264)+_0x5c0a39));const _0x44037b=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x5b2dcc[_0x421175(0x1ed)][_0x421175(0x28b)](_0x262f32),{'verbose':_0x37059b['verbose']}),_0x35c524=_0x44037b['data'],_0x3d0b56=_0x35c524[_0x421175(0x205)],_0xa0449b=await withSpinner(_0x421175(0x1af),()=>_0x5b2dcc['journey'][_0x421175(0x28f)](_0x262f32,_0x3d0b56),{'verbose':_0x37059b[_0x421175(0x217)]});let _0x2cb23d=_0xa0449b[_0x421175(0x26d)][_0x421175(0x282)];const _0x150ec9=_0xa0449b[_0x421175(0x26d)][_0x421175(0x1d4)],_0x47012e=new Map();for(const _0x5028d5 of _0x150ec9){_0x47012e[_0x421175(0x24e)](_0x5028d5['id'],_0x5028d5[_0x421175(0x233)]);}if(_0x5c0a39){const _0x19e562=globToRegex(_0x5c0a39);_0x2cb23d=_0x2cb23d[_0x421175(0x22b)](_0x27f618=>_0x19e562[_0x421175(0x1c2)](_0x27f618['journeyBundleName']));}console[_0x421175(0x1cd)](_0x421175(0x1ff)+_0x2cb23d[_0x421175(0x18c)]+_0x421175(0x19b)+(_0x2cb23d[_0x421175(0x18c)]!==0x1?'s':''));const _0xc295a2=_0x289e6b=>{const _0x51686d=_0x421175;return getConsoleNextUrl(_0x37059b[_0x51686d(0x21f)],'/app/ps/'+_0x262f32+_0x51686d(0x1c4)+_0x289e6b+'/j/da');};if(_0x37059b[_0x421175(0x259)]===_0x421175(0x1d1))await handleSDKOutput(_0x2cb23d,_0x37059b);else{if(_0x37059b[_0x421175(0x259)]===_0x421175(0x1e3)){const _0x5c7dcc=_0x2cb23d['map'](_0x5dcea9=>({..._0x5dcea9,'url':_0xc295a2(_0x5dcea9['id'])}));await handleSDKOutput(_0x5c7dcc,_0x37059b);}else{console[_0x421175(0x291)]('['+_0x307c12+']');const _0x42f34a=new Map(),_0x29aebc=[];for(const _0x48c71d of _0x2cb23d){if(!_0x48c71d[_0x421175(0x20e)]||_0x48c71d[_0x421175(0x20e)]===_0x3d0b56)_0x29aebc['push'](_0x48c71d);else{const _0x3e874c=_0x42f34a[_0x421175(0x1ec)](_0x48c71d['folderId'])||[];_0x3e874c['push'](_0x48c71d),_0x42f34a[_0x421175(0x24e)](_0x48c71d['folderId'],_0x3e874c);}}const _0x4cdeb7=(_0x453126,_0x372621)=>_0x453126[_0x421175(0x213)][_0x421175(0x1f5)](_0x372621[_0x421175(0x213)],undefined,{'sensitivity':_0x421175(0x1a2)});_0x29aebc['sort'](_0x4cdeb7);for(const _0x4add4c of _0x29aebc){console[_0x421175(0x291)](formatJourneyItem(_0x4add4c,'',_0xc295a2(_0x4add4c['id'])));}const _0x11b9a8=[..._0x42f34a[_0x421175(0x260)]()]['sort']((_0x30cb18,_0x40f44e)=>{const _0x528c5b=_0x421175,_0x28406a=_0x47012e['get'](_0x30cb18[0x0])||_0x30cb18[0x0],_0x485880=_0x47012e[_0x528c5b(0x1ec)](_0x40f44e[0x0])||_0x40f44e[0x0];return _0x28406a[_0x528c5b(0x1f5)](_0x485880,undefined,{'sensitivity':_0x528c5b(0x1a2)});});for(const [_0x3c2be4,_0x2747fd]of _0x11b9a8){const _0x1f85ff=_0x47012e[_0x421175(0x1ec)](_0x3c2be4)||_0x3c2be4;console[_0x421175(0x291)](_0x421175(0x263)+_0x1f85ff),_0x2747fd['sort'](_0x4cdeb7);for(const _0x4f10bc of _0x2747fd){console[_0x421175(0x291)](formatJourneyItem(_0x4f10bc,'\x20\x20',_0xc295a2(_0x4f10bc['id'])));}}}}return 0x0;}}function a28_0x1a48(){const _0xa7c4af=['enteredSize','site','\x20\x20Folder\x20path:\x20','Resolving\x20journey...','reentryMode','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','repeat','file','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Error:\x20Journey\x20not\x20found:\x20','\x20\x20Target:\x20','Show\x20journey\x20details','filter','\x0aError:','Getting\x20journey\x20statistics...','stages','then','\x20not\x20found.\x20Available:\x20','journey:pull','3TotHgF','name','Journey\x20name:\x20','all','goalSize','6385635pjysIS','Getting\x20column\x20mapping...','yes','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','message','4UugYhQ','Getting\x20journey\x20details...','folderPath','\x20files?','goal','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20Invalid\x20--type\x20\x22','resourceName','View\x20a\x20specific\x20version\x20of\x20a\x20journey','connector_config','/j/da/je','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','exitOrJumpSize','red','find','targetDir','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','set','listFolders','Resolving\x20parent\x20segment...','type','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','setPhase','Error:\x20Invalid\x20version\x20number:\x20','.yml','segmentName','split','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','format','conversion','state','\x20versions)','\x22\x20paused','Aborted.','rule','entries','Listing\x20journey\x20activations...','\x20Created\x20v','📁\x20','Pattern:\x20','stringify','blue','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','root\x20folder','has','paused','journeyStages','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','data','Resolved\x20YAML\x20file:\x20','\x20version','yellow','parentSegment','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','journeyId','sort','audienceId','journey','buildIdToEmailMap','resolveParentId','user','helpText','(root)','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','utf-8','38186hCHpWV','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','launched','database','journeys','Pausing\x20journey...','2229801EDHiJb','parentName','\x20->\x20','Input:\x20','join','createdAt','activation_','getParentFull','Fetching\x20users\x20and\x20connections...','11gGLkZF','/app/ps/','listJourneysWithFolders','nodes','log','listJourneysFromParentSegment','activation','getLatestJourneyId','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','toLowerCase','Resolving\x20version...','journey:activations','Listing\x20journey\x20versions...','List\x20all\x20versions\x20of\x20a\x20journey','\x5c$&','segmentPushCommand','journeyName','length','journeyBundleId','resume','filePath','\x20\x20Statistics\x20not\x20available','journey:list','isNew','cwd','✔\x20All\x20files\x20are\x20up\x20to\x20date','journey:resume','Fetching\x20journeys\x20and\x20folders...','pause','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Write\x20','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x20journey','\x20Opening\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','from','Options:','limit','renderStats','base','description','Database:\x20','links','281047uoOJbb','values','args','Getting\x20journey\x20traffic\x20data...','\x20details...','tdx.json','32rUUJMB','Resume\x20a\x20paused\x20journey','Error:\x20Stage\x20\x22','Listing\x20journeys...','stageNameMap','Creating\x20new\x20version...','getStatistics','journey:view','Error:\x20Version\x20','versionNumber','getColumnMapping','\x0aChanges\x20to\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','execute','1542858IxOxxr','push','activationParams','\x20\x20-\x20','parent_segment','version','bold','Table:\x20','test','cyan','/e/','listActivationsFlat','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','milestoneSize','diff','1884456RUFABG','createVersion','Parent\x20segment:\x20','\x20(rule\x20match)','error','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','replace','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)','table','Found\x20','\x20(draft)\x20—\x20\x22','folders','1644jBFFFI','journey:traffic','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20Pulled\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','session','Error:\x20Parent\x20segment\x20context\x20required','\x22\x20resumed','updatedAt','Folder\x20path:\x20','resolveJourneyId','exitOrJumpRate','\x20\x20Preserving\x20local\x20segment\x20name:\x20','web','json','7xRavlc','journey:versions','buildIdToNameMap','includeHistory','Resuming\x20journey...','Fetching\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','relative','get','segment','\x22\x20not\x20found','dim','green','✔\x20Journey\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','hasPeriod','relativePath','localeCompare','\x20journey\x20files\x20to\x20','Available\x20stages:\x20','kind','INVALID_ARGUMENT','...','completed','\x20=\x20',',\x20version:\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','✔\x20Found\x20','getActivation','Warning:\x20Could\x20not\x20resolve\x20segment\x20','size','map','✔\x20Context\x20set:\x20','rootFolderId','listVersions','Cancelled','attributes','archived','journey:version:view','getTrafficData','getJourney','options','folderId','journey:stats','history','completeMilestoneRate','6167690ueWriP','journeyBundleName','\x20\x20Name:\x20','completionRate','add','verbose','dryRun','\x27\x20not\x20found\x20in\x20','jsonl','Getting\x20version\x20','hasChanges','\x20new\x20files'];a28_0x1a48=function(){return _0xa7c4af;};return a28_0x1a48();}export class JourneyViewCommand extends BaseCommand{['name']=a28_0x4d4d86(0x1b3);[a28_0x4d4d86(0x1a3)]=a28_0x4d4d86(0x22a);async[a28_0x4d4d86(0x1b9)](_0x48b8e9){const _0x4dec94=a28_0x4d4d86,{options:_0x26bdce,args:_0x730394,tdx:_0x2487e3}=_0x48b8e9,_0x14b4e6=_0x730394[0x0];if(!_0x14b4e6)return console[_0x4dec94(0x1cd)](_0x4dec94(0x26c)),console[_0x4dec94(0x1cd)](_0x4dec94(0x226)),console[_0x4dec94(0x1cd)](_0x4dec94(0x19f)),console[_0x4dec94(0x1cd)](_0x4dec94(0x1b8)),0x1;_0x26bdce[_0x4dec94(0x217)]&&console['error'](_0x4dec94(0x287)+_0x14b4e6);const {journeyId:_0x331a2a,parentSegmentId:_0x4769c6}=await resolveJourneyIdFromInput(_0x14b4e6,_0x26bdce,_0x2487e3);if(_0x26bdce[_0x4dec94(0x1e2)]){const _0x27349b=getConsoleNextUrl(_0x26bdce[_0x4dec94(0x21f)],_0x4dec94(0x28e)+_0x4769c6+_0x4dec94(0x1c4)+_0x331a2a+_0x4dec94(0x247));return console[_0x4dec94(0x1cd)](a28_0x4474e0['green']('✔')+_0x4dec94(0x19c)+a28_0x4474e0[_0x4dec94(0x1c3)](_0x27349b)),openBrowser(_0x27349b),0x0;}const _0x2d26c6=await withSpinner(_0x4dec94(0x23d),()=>_0x2487e3[_0x4dec94(0x276)][_0x4dec94(0x20c)](_0x331a2a),{'verbose':_0x26bdce[_0x4dec94(0x217)]}),_0x271798=_0x2d26c6[_0x4dec94(0x26d)],_0xdf07a5=_0x26bdce['includeStats'];let _0x1d5b6a;if(_0xdf07a5)try{const _0x290014=await withSpinner(_0x4dec94(0x22d),()=>_0x2487e3[_0x4dec94(0x276)][_0x4dec94(0x1b2)](_0x331a2a),{'verbose':_0x26bdce['verbose']});_0x1d5b6a=_0x290014['data'];}catch{_0x26bdce[_0x4dec94(0x217)]&&console[_0x4dec94(0x1cd)](_0x4dec94(0x190));}const _0x28acd9=getConsoleNextUrl(_0x26bdce[_0x4dec94(0x21f)],_0x4dec94(0x28e)+_0x4769c6+_0x4dec94(0x1c4)+_0x331a2a+'/j/da/je'),_0x59b845={'id':_0x271798['id'],'name':_0x271798['attributes'][_0x4dec94(0x233)],'description':_0x271798[_0x4dec94(0x208)]['description'],'state':_0x271798[_0x4dec94(0x208)][_0x4dec94(0x25b)],'paused':_0x271798[_0x4dec94(0x208)][_0x4dec94(0x26a)],'reentry_mode':_0x271798[_0x4dec94(0x208)][_0x4dec94(0x222)],'stages':_0x271798[_0x4dec94(0x208)]['journeyStages']?.['length']||0x0,..._0x271798[_0x4dec94(0x208)]['goal']&&{'goal':_0x271798[_0x4dec94(0x208)][_0x4dec94(0x240)][_0x4dec94(0x233)]},..._0x1d5b6a&&{'statistics':{'size':_0x1d5b6a[_0x4dec94(0x202)],'entered':_0x1d5b6a[_0x4dec94(0x21e)],'goal_achieved':_0x1d5b6a[_0x4dec94(0x236)],'completion_rate':_0x1d5b6a[_0x4dec94(0x215)],'exit_or_jump':_0x1d5b6a[_0x4dec94(0x249)],'exit_or_jump_rate':_0x1d5b6a['exitOrJumpRate'],'stages':_0x1d5b6a[_0x4dec94(0x22e)]}},'url':_0x28acd9};return await handleSingleObjectOutput(_0x59b845,_0x26bdce),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x20f);[a28_0x4d4d86(0x1a3)]='Show\x20journey\x20statistics';async[a28_0x4d4d86(0x1b9)](_0xcc1ccc){const _0x990ac9=a28_0x4d4d86,{options:_0x2b9fda,args:_0x563848,tdx:_0x1690fb}=_0xcc1ccc,_0x4e7f46=_0x563848[0x0];if(!requireNameOrPath(_0x4e7f46))return 0x1;_0x2b9fda[_0x990ac9(0x217)]&&console[_0x990ac9(0x1cd)]('Input:\x20'+_0x4e7f46);const _0x38b8d8=_0x2b9fda,_0x948fcb=_0x38b8d8[_0x990ac9(0x19e)],_0x50d088=_0x38b8d8['to'],_0x4eb07d=_0x38b8d8[_0x990ac9(0x1e7)],_0x287cea=_0x38b8d8['stage'];_0x4eb07d&&!_0x948fcb&&!_0x50d088&&console[_0x990ac9(0x1cd)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x4168b2=_0x4eb07d?withJsonFormat(_0x2b9fda):_0x2b9fda,{journeyId:_0x16ebd1,journeyName:_0x441841}=await resolveJourneyIdFromInput(_0x4e7f46,_0x4168b2,_0x1690fb),_0x328330=_0x948fcb||_0x50d088?{'from':_0x948fcb,'to':_0x50d088}:undefined,_0x3a21a5=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x990ac9(0x235)]([_0x1690fb[_0x990ac9(0x276)][_0x990ac9(0x20c)](_0x16ebd1),_0x1690fb['journey'][_0x990ac9(0x1b2)](_0x16ebd1,_0x328330)]),{'verbose':_0x4168b2[_0x990ac9(0x217)]}),[_0x1eb54f,_0x25dbef]=_0x3a21a5['data'];if(!_0x25dbef||_0x25dbef[_0x990ac9(0x273)]===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x441841),console[_0x990ac9(0x1cd)](_0x990ac9(0x198)),0x0;const _0x2e8521=buildStageNameMap(_0x1eb54f),_0x1d8ac6=!!(_0x328330&&_0x25dbef[_0x990ac9(0x210)]?.[_0x990ac9(0x18c)]),_0x3738bd={'stageNameMap':_0x2e8521,'hasPeriod':_0x1d8ac6,'includeHistory':!!_0x4eb07d};if(_0x287cea&&_0x25dbef[_0x990ac9(0x22e)]){const _0xafd151=_0x25dbef[_0x990ac9(0x22e)][_0x990ac9(0x24b)](_0x44c86e=>{const _0x21f85f=_0x990ac9,_0x387c57=_0x2e8521['get'](_0x44c86e['id'])??'';return _0x387c57[_0x21f85f(0x184)]()===_0x287cea[_0x21f85f(0x184)]();});if(_0xafd151)return await handleSingleObjectOutput(formatStageStats(_0xafd151,_0x3738bd),_0x4168b2),0x0;const _0x3cf312=_0x25dbef[_0x990ac9(0x22e)][_0x990ac9(0x203)](_0x455071=>_0x2e8521['get'](_0x455071['id'])??_0x455071['id']);return console['error'](_0x990ac9(0x1ae)+_0x287cea+_0x990ac9(0x1ee)),console[_0x990ac9(0x1cd)](_0x990ac9(0x1f7)+_0x3cf312['join'](',\x20')),0x1;}const _0x5e0642=_0x25dbef['stages']?.['map'](_0xd13d28=>formatStageStats(_0xd13d28,_0x3738bd)),_0x1a4d5d=assembleJourneyStats(_0x25dbef,{'from':_0x948fcb,'to':_0x50d088,'includeHistory':_0x4eb07d});return await this[_0x990ac9(0x1a1)](_0x1a4d5d,_0x5e0642??[],_0x4168b2),0x0;}async[a28_0x4d4d86(0x1a1)](_0x3c7ec0,_0x139498,_0x5b0242){const _0x2c7100=a28_0x4d4d86,_0x361f58=_0x5b0242[_0x2c7100(0x259)]===_0x2c7100(0x1e3)||_0x5b0242[_0x2c7100(0x259)]===_0x2c7100(0x21a)||_0x5b0242[_0x2c7100(0x1e3)]||_0x5b0242['jsonl'];if(_0x361f58){_0x3c7ec0[_0x2c7100(0x22e)]=_0x139498,await handleSingleObjectOutput(_0x3c7ec0,_0x5b0242);return;}await handleSingleObjectOutput(_0x3c7ec0,_0x5b0242);for(const _0x2e946c of _0x139498){console[_0x2c7100(0x291)](''),console['log'](String(a28_0x4474e0['cyan'][_0x2c7100(0x1c0)]('['+_0x2e946c[_0x2c7100(0x233)]+']'))+a28_0x4474e0[_0x2c7100(0x1ef)]('\x20'+_0x2e946c['id']));const {id:_0x42227e,name:_0x2094f9,..._0x1f1818}=_0x2e946c;await handleSingleObjectOutput(_0x1f1818,_0x5b0242);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x1d6);[a28_0x4d4d86(0x1a3)]=a28_0x4d4d86(0x227);async[a28_0x4d4d86(0x1b9)](_0x2ff006){const _0x805ea=a28_0x4d4d86,{options:_0x3d5764,args:_0x43512e,tdx:_0x42d455}=_0x2ff006,_0x332ae3=_0x43512e[0x0];if(!requireNameOrPath(_0x332ae3))return 0x1;_0x3d5764[_0x805ea(0x217)]&&console[_0x805ea(0x1cd)]('Input:\x20'+_0x332ae3);const _0x2d8a7b=_0x3d5764,_0x293852=_0x2d8a7b[_0x805ea(0x251)],_0x28ebec=_0x2d8a7b[_0x805ea(0x19e)],_0x1ac7bd=_0x2d8a7b['to'],_0x35491c=_0x2d8a7b[_0x805ea(0x1a0)];if(_0x293852&&_0x293852!==_0x805ea(0x25a)&&_0x293852!==_0x805ea(0x181))return console[_0x805ea(0x1cd)](_0x805ea(0x243)+_0x293852+_0x805ea(0x272)),0x1;const _0x473275=withJsonFormat(_0x3d5764),{journeyId:_0x51d6ad,journeyName:_0x35e732}=await resolveJourneyIdFromInput(_0x332ae3,_0x473275,_0x42d455),_0x168336={'type':_0x293852,'from':_0x28ebec,'to':_0x1ac7bd,'limit':_0x35491c},_0x359ba1=await withSpinner(_0x805ea(0x1a9),()=>_0x42d455[_0x805ea(0x276)][_0x805ea(0x20b)](_0x51d6ad,_0x168336),{'verbose':_0x473275[_0x805ea(0x217)]}),_0x30b130=_0x359ba1[_0x805ea(0x26d)],_0x19aef2=_0x30b130[_0x805ea(0x25a)]&&(_0x30b130[_0x805ea(0x25a)][_0x805ea(0x290)][_0x805ea(0x18c)]>0x0||_0x30b130[_0x805ea(0x25a)][_0x805ea(0x1a5)][_0x805ea(0x18c)]>0x0),_0x1ac608=_0x30b130[_0x805ea(0x181)]&&_0x30b130[_0x805ea(0x181)][_0x805ea(0x18c)]>0x0;if(!_0x19aef2&&!_0x1ac608)return console[_0x805ea(0x1cd)](_0x805ea(0x252)+_0x35e732),console[_0x805ea(0x1cd)](_0x805ea(0x241)),_0x28ebec&&_0x1ac7bd&&console[_0x805ea(0x1cd)](_0x805ea(0x27f)),0x0;return await handleSingleObjectOutput(_0x30b130,_0x473275),0x0;}}function formatStageStats(_0x123dbd,_0x1121b1){const _0x3fd692=a28_0x4d4d86,_0x535b48=_0x1121b1[_0x3fd692(0x1f3)]&&_0x123dbd[_0x3fd692(0x210)]?.[_0x3fd692(0x18c)]?aggregateStageHistory(_0x123dbd[_0x3fd692(0x210)]):{'size':_0x123dbd[_0x3fd692(0x202)],'entered':_0x123dbd[_0x3fd692(0x21e)],'milestone':_0x123dbd[_0x3fd692(0x1c7)],'milestone_rate':_0x123dbd[_0x3fd692(0x211)],'exit_or_jump':_0x123dbd[_0x3fd692(0x249)],'exit_or_jump_rate':_0x123dbd[_0x3fd692(0x1e0)]},_0x8fffe7={'id':_0x123dbd['id'],'name':_0x1121b1[_0x3fd692(0x1b0)]['get'](_0x123dbd['id'])??_0x123dbd['id'],..._0x535b48};return _0x1121b1[_0x3fd692(0x1f3)]&&_0x1121b1['includeHistory']&&_0x123dbd[_0x3fd692(0x210)]&&(_0x8fffe7['history']=_0x123dbd[_0x3fd692(0x210)]),_0x8fffe7;}export class JourneyPauseCommand extends BaseCommand{[a28_0x4d4d86(0x233)]='journey:pause';[a28_0x4d4d86(0x1a3)]='Pause\x20a\x20running\x20journey';async[a28_0x4d4d86(0x1b9)](_0x3fcacb){const _0x1e4cc6=a28_0x4d4d86,{options:_0x3c303b,args:_0xa752ba,tdx:_0x5efd13}=_0x3fcacb,_0x18d4a6=_0xa752ba[0x0];if(!requireNameOrPath(_0x18d4a6))return 0x1;_0x3c303b[_0x1e4cc6(0x217)]&&console[_0x1e4cc6(0x1cd)](_0x1e4cc6(0x287)+_0x18d4a6);const {journeyId:_0x2535df,journeyName:_0x2cb045}=await resolveJourneyIdFromInput(_0x18d4a6,_0x3c303b,_0x5efd13);if(!_0x3c303b[_0x1e4cc6(0x239)]){const _0x1e3e11=await confirm(_0x1e4cc6(0x1d9)+_0x2cb045+'\x22?');if(!_0x1e3e11)return console['error']('Cancelled'),0x0;}const _0x2df818=await withSpinner(_0x1e4cc6(0x283),()=>_0x5efd13['journey'][_0x1e4cc6(0x197)](_0x2535df),{'verbose':_0x3c303b['verbose']}),_0x12b3c7=_0x2df818[_0x1e4cc6(0x26d)];return console['error']('✔\x20Journey\x20\x22'+_0x12b3c7['attributes'][_0x1e4cc6(0x233)]+_0x1e4cc6(0x25d)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x195);['description']=a28_0x4d4d86(0x1ad);async[a28_0x4d4d86(0x1b9)](_0xf3de0f){const _0x447499=a28_0x4d4d86,{options:_0x1c73d9,args:_0xe0b46e,tdx:_0xe60e07}=_0xf3de0f,_0x4bf5e5=_0xe0b46e[0x0];if(!requireNameOrPath(_0x4bf5e5))return 0x1;_0x1c73d9[_0x447499(0x217)]&&console[_0x447499(0x1cd)](_0x447499(0x287)+_0x4bf5e5);const {journeyId:_0xf68519,journeyName:_0x5be6b3}=await resolveJourneyIdFromInput(_0x4bf5e5,_0x1c73d9,_0xe60e07);if(!_0x1c73d9[_0x447499(0x239)]){const _0x28e595=await confirm(_0x447499(0x19d)+_0x5be6b3+'\x22?');if(!_0x28e595)return console['error']('Cancelled'),0x0;}const _0x14c426=await withSpinner(_0x447499(0x1e8),()=>_0xe60e07[_0x447499(0x276)][_0x447499(0x18e)](_0xf68519),{'verbose':_0x1c73d9[_0x447499(0x217)]}),_0x590404=_0x14c426[_0x447499(0x26d)];return console[_0x447499(0x1cd)](_0x447499(0x1f1)+_0x590404[_0x447499(0x208)][_0x447499(0x233)]+_0x447499(0x1dc)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x231);[a28_0x4d4d86(0x1a3)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a28_0x4d4d86(0x1b9)](_0x54cae1){const _0x4299ad=a28_0x4d4d86,{options:_0x2977bc,args:_0x57dcda,tdx:_0x34db8e}=_0x54cae1,_0x101303=_0x2977bc,_0x5a6ab2=_0x57dcda[0x0],_0x373f6c=_0x5a6ab2&&isYamlFilePath(_0x5a6ab2),_0x41d9fe=await resolveTarget({'arg':_0x373f6c?_0x5a6ab2:undefined,'contextParent':_0x2977bc['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x41d9fe))return _0x41d9fe['errorCode']==='no_parent'?(console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x270)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x4299ad(0x1cd)](_0x4299ad(0x1d0)),console['error'](_0x4299ad(0x258)),console[_0x4299ad(0x1cd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x4299ad(0x1cd)](_0x4299ad(0x183))):(console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x24a)]('Error:\x20'+_0x41d9fe[_0x4299ad(0x23b)]+'\x0a')),_0x41d9fe[_0x4299ad(0x27a)]&&console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x1c3)](_0x41d9fe[_0x4299ad(0x27a)]))),0x1;let _0x16e8c7=_0x373f6c?undefined:_0x5a6ab2,_0x3f8b97,_0x1c75bd;_0x41d9fe[_0x4299ad(0x251)]===_0x4299ad(0x225)&&(_0x16e8c7=_0x41d9fe[_0x4299ad(0x244)],_0x3f8b97=_0x41d9fe[_0x4299ad(0x18f)],_0x1c75bd=_0x41d9fe[_0x4299ad(0x23e)]);const _0x473227=_0x41d9fe[_0x4299ad(0x285)],_0x1072d4=_0x41d9fe[_0x4299ad(0x24c)];_0x101303[_0x4299ad(0x217)]&&(console[_0x4299ad(0x1cd)]('Parent\x20segment:\x20'+_0x473227),console[_0x4299ad(0x1cd)]('Target\x20directory:\x20'+_0x1072d4),_0x16e8c7&&console[_0x4299ad(0x1cd)](_0x4299ad(0x234)+_0x16e8c7),_0x3f8b97&&console[_0x4299ad(0x1cd)]('Target\x20file:\x20'+_0x3f8b97),_0x1c75bd&&console[_0x4299ad(0x1cd)](_0x4299ad(0x1de)+_0x1c75bd));const _0x5ebbb2=await withSpinner(_0x4299ad(0x250),()=>_0x34db8e[_0x4299ad(0x1ed)][_0x4299ad(0x278)](_0x473227),{'verbose':_0x2977bc[_0x4299ad(0x217)]}),_0x57defd=_0x5ebbb2[_0x4299ad(0x26d)],{journeys:_0x1ce01b,folders:_0xe2e803}=await withSpinner(_0x4299ad(0x196),async()=>{const _0x45acbb=_0x4299ad,[_0x15b355,_0xd8c10a]=await Promise[_0x45acbb(0x235)]([_0x34db8e[_0x45acbb(0x276)][_0x45acbb(0x292)](_0x57defd,undefined,{'includeAllVersions':!![]}),_0x34db8e[_0x45acbb(0x1ed)][_0x45acbb(0x24f)](_0x57defd)]);return{'journeys':_0x15b355,'folders':_0xd8c10a};},{'verbose':_0x2977bc['verbose']})[_0x4299ad(0x22f)](_0x132b75=>_0x132b75[_0x4299ad(0x26d)]);let _0x6c98b6=_0x1ce01b;const _0x2a972c=buildFolderIdToPathMap(_0xe2e803);if(_0x16e8c7){const _0x3d881c=_0x6c98b6[_0x4299ad(0x22b)](_0x141bfe=>_0x141bfe[_0x4299ad(0x213)][_0x4299ad(0x184)]()===_0x16e8c7['toLowerCase']());if(_0x3d881c[_0x4299ad(0x18c)]===0x0)return console['error'](_0x4299ad(0x228)+_0x16e8c7),console['error'](_0x4299ad(0x248)),0x1;_0x6c98b6=_0x3d881c;}if(_0x1c75bd!==undefined){const _0x46f9bf=_0x6c98b6['filter'](_0x2b1d4f=>{const _0x1341d0=_0x4299ad,_0x14849a=_0x2b1d4f['folderId']?_0x2a972c[_0x1341d0(0x1ec)](_0x2b1d4f[_0x1341d0(0x20e)])||'':'';return _0x14849a===_0x1c75bd;});if(_0x46f9bf['length']===0x0&&_0x6c98b6['length']>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x16e8c7+_0x4299ad(0x219)+(_0x1c75bd||_0x4299ad(0x268))),console[_0x4299ad(0x1cd)](_0x4299ad(0x242));for(const _0x2862bd of _0x6c98b6){const _0x4b31f1=_0x2862bd[_0x4299ad(0x20e)]?_0x2a972c['get'](_0x2862bd[_0x4299ad(0x20e)])||'':'';console[_0x4299ad(0x1cd)](_0x4299ad(0x1bd)+(_0x4b31f1||'(root)')+'/'+_0x2862bd[_0x4299ad(0x213)]);}return 0x1;}_0x6c98b6=_0x46f9bf;}if(_0x6c98b6[_0x4299ad(0x18c)]===0x0)return console['error']('No\x20journeys\x20found'),0x0;const _0x26a98c=new Map();for(const _0x4ed8ba of _0x6c98b6){const _0x548869=_0x4ed8ba[_0x4299ad(0x18d)];!_0x26a98c['has'](_0x548869)&&_0x26a98c['set'](_0x548869,[]),_0x26a98c[_0x4299ad(0x1ec)](_0x548869)['push'](_0x4ed8ba);}for(const _0x4546a8 of _0x26a98c[_0x4299ad(0x1a7)]()){_0x4546a8[_0x4299ad(0x274)]((_0x36d479,_0x10b46e)=>(_0x36d479[_0x4299ad(0x1b5)]||0x0)-(_0x10b46e['versionNumber']||0x0));}const _0x41e5ee=[],{idToEmailMap:_0x1746c2,connectionIdToNameMap:_0x5ca9dd}=await withSpinner(_0x4299ad(0x28c),async()=>{const _0x2dd53e=_0x4299ad,[_0x34072e,_0x2d9e25]=await Promise['all']([_0x34db8e[_0x2dd53e(0x279)][_0x2dd53e(0x277)](),_0x34db8e['connection'][_0x2dd53e(0x1e6)]()]);return{'idToEmailMap':_0x34072e,'connectionIdToNameMap':_0x2d9e25};},{'verbose':_0x2977bc[_0x4299ad(0x217)]})['then'](_0x35ad7e=>_0x35ad7e[_0x4299ad(0x26d)]);for(const _0x63e3f of _0x26a98c['values']()){const _0x3e0d3d=_0x63e3f[0x0][_0x4299ad(0x213)],_0x2255d7=_0x63e3f[0x0][_0x4299ad(0x20e)],_0x3a62d6=_0x2255d7?_0x2a972c[_0x4299ad(0x1ec)](_0x2255d7)||'':'',_0x4e8b50=_0x3a62d6?a28_0x3aa0f7[_0x4299ad(0x288)](_0x1072d4,_0x3a62d6):_0x1072d4,_0x15980e=_0x3f8b97||a28_0x3aa0f7[_0x4299ad(0x288)](_0x4e8b50,sanitizeFileName(_0x3e0d3d)+_0x4299ad(0x255));let _0x36f7fd,_0x59b9bf;if(existsSync(_0x15980e))try{const _0x23f6d0=readFileSync(_0x15980e,_0x4299ad(0x27d)),_0x2c1ac1=parseYamlString(_0x23f6d0);_0x59b9bf=_0x2c1ac1,_0x36f7fd=buildRuleToNameMapping(_0x2c1ac1),_0x101303[_0x4299ad(0x217)]&&_0x36f7fd[_0x4299ad(0x202)]>0x0&&console[_0x4299ad(0x1cd)](_0x4299ad(0x1d2)+_0x36f7fd[_0x4299ad(0x202)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x3e0d3d);}catch(_0x1df7cc){_0x101303[_0x4299ad(0x217)]&&console[_0x4299ad(0x1cd)](_0x4299ad(0x24d)+_0x1df7cc[_0x4299ad(0x23b)]);}const _0x32f382=[],_0x377588=new Set(),_0x293d1b=new Map(),_0x15fad0=new Map(),_0x4966dd=new Set(),_0x9f3e13=new Map(),_0x29d6bb=new Map(),_0x3b9eb2=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x3e0d3d+_0x4299ad(0x1fa),async _0x3abe3f=>{const _0x51cf4c=_0x4299ad;for(const _0x35d2d7 of _0x63e3f){const _0x24c5d5=_0x63e3f['length']>0x1?_0x35d2d7[_0x51cf4c(0x213)]+'\x20v'+(_0x35d2d7[_0x51cf4c(0x1b5)]||0x1):_0x35d2d7[_0x51cf4c(0x213)];_0x3abe3f[_0x51cf4c(0x253)](_0x51cf4c(0x1e9)+_0x24c5d5);const _0x2f9976=await _0x34db8e[_0x51cf4c(0x276)][_0x51cf4c(0x20c)](_0x35d2d7['id']),_0x2a36d3=_0x2f9976[_0x51cf4c(0x208)]?.[_0x51cf4c(0x275)],_0x5a92f={'resolveSegment':async _0x1bdf50=>{const _0x1cf2be=_0x51cf4c;if(!_0x2a36d3)return{'name':_0x1bdf50,'isJourneyLocal':![]};const _0x4d9ed6=_0x293d1b[_0x1cf2be(0x1ec)](_0x1bdf50);if(_0x4d9ed6)return _0x4d9ed6;try{const _0x1a8f6a=await _0x34db8e['segment']['getSegment'](_0x2a36d3,_0x1bdf50),_0x390a45=_0x1a8f6a[_0x1cf2be(0x1f8)]===SEGMENT_KIND_JOURNEY;let _0x16348f,_0x469abf=_0x1a8f6a[_0x1cf2be(0x233)];if(_0x390a45&&_0x1a8f6a[_0x1cf2be(0x25f)]){const _0x5920d6=await segmentResponseToDef(_0x1a8f6a,{'resolveSegmentName':async _0x2a6d2d=>{const _0x13781b=_0x1cf2be,_0x2f8099=_0x293d1b['get'](_0x2a6d2d);if(_0x2f8099)return _0x2f8099[_0x13781b(0x233)];const _0x41d4aa=await _0x5a92f['resolveSegment'](_0x2a6d2d);return _0x41d4aa[_0x13781b(0x233)];}}),_0x43ef0a=_0x5920d6[_0x1cf2be(0x25f)];_0x16348f={'description':_0x1a8f6a[_0x1cf2be(0x1a3)],'rule':_0x43ef0a};const _0x2da19c=serializeRule(_0x43ef0a),_0x352001=_0x15fad0[_0x1cf2be(0x1ec)](_0x2da19c);if(_0x352001)_0x469abf=_0x352001,_0x16348f=undefined,_0x101303[_0x1cf2be(0x217)]&&console[_0x1cf2be(0x1cd)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x1a8f6a[_0x1cf2be(0x233)]+_0x1cf2be(0x286)+_0x352001);else{let _0x1bd531=![];if(_0x36f7fd){const _0x168b6f=_0x36f7fd[_0x1cf2be(0x1ec)](_0x2da19c);if(_0x168b6f){const _0x5436cd=_0x168b6f['find'](_0x552ee0=>!_0x377588[_0x1cf2be(0x269)](_0x552ee0));_0x5436cd&&(_0x469abf=_0x5436cd,_0x377588[_0x1cf2be(0x216)](_0x5436cd),_0x15fad0[_0x1cf2be(0x24e)](_0x2da19c,_0x5436cd),_0x1bd531=!![],_0x101303['verbose']&&console[_0x1cf2be(0x1cd)](_0x1cf2be(0x1e1)+_0x5436cd+_0x1cf2be(0x1cc)));}}if(!_0x1bd531){const _0x5d30ad=generateJourneyLocalName(_0x1a8f6a[_0x1cf2be(0x233)]);_0x5d30ad&&(_0x469abf=_0x5d30ad);let _0x43de72=_0x469abf,_0x6e774a=0x2;while(_0x377588[_0x1cf2be(0x269)](_0x43de72)){_0x43de72=_0x469abf+'_'+_0x6e774a,_0x6e774a++;}_0x377588[_0x1cf2be(0x216)](_0x43de72),_0x15fad0[_0x1cf2be(0x24e)](_0x2da19c,_0x43de72),_0x469abf=_0x43de72;}}}const _0xd8121f={'name':_0x469abf,'isJourneyLocal':_0x390a45,'definition':_0x16348f};return _0x293d1b[_0x1cf2be(0x24e)](_0x1bdf50,_0xd8121f),_0xd8121f;}catch(_0x5821db){return _0x2977bc['verbose']&&console[_0x1cf2be(0x1cd)](_0x1cf2be(0x201)+_0x1bdf50+':\x20'+_0x5821db[_0x1cf2be(0x23b)]),{'name':_0x1bdf50,'isJourneyLocal':![]};}},'resolveActivation':async _0xd9aab=>{const _0x54e994=_0x51cf4c,_0x3c2d4f=_0x9f3e13[_0x54e994(0x1ec)](_0xd9aab);if(_0x3c2d4f)return _0x3c2d4f;try{const _0xcd95d1=await _0x34db8e['journey'][_0x54e994(0x200)](_0x35d2d7['id'],_0xd9aab),_0x562354=journeyActivationStepToYaml(_0xcd95d1,_0x1746c2,_0x5ca9dd),_0x108f64=JSON[_0x54e994(0x265)]({'name':_0x562354[_0x54e994(0x233)],'connection':_0x562354['connection'],'connector_config':_0x562354[_0x54e994(0x246)]}),_0x227406=_0x29d6bb[_0x54e994(0x1ec)](_0x108f64);if(_0x227406){const _0x181b9f={'name':_0x227406,'isJourneyLocal':!![],'definition':_0x562354};return _0x9f3e13['set'](_0xd9aab,_0x181b9f),_0x181b9f;}const _0x497518=_0xcd95d1[_0x54e994(0x208)][_0x54e994(0x1bc)][_0x54e994(0x233)]||_0xd9aab,_0x42816d=sanitizeYamlKey(_0x497518)||_0x54e994(0x28a)+_0xd9aab;let _0x96f1dc=_0x42816d,_0x4266ee=0x2;while(_0x4966dd[_0x54e994(0x269)](_0x96f1dc)){_0x96f1dc=_0x42816d+'_'+_0x4266ee,_0x4266ee++;}_0x4966dd[_0x54e994(0x216)](_0x96f1dc),_0x29d6bb[_0x54e994(0x24e)](_0x108f64,_0x96f1dc);const _0x3cc2b6={'name':_0x96f1dc,'isJourneyLocal':!![],'definition':_0x562354};return _0x9f3e13['set'](_0xd9aab,_0x3cc2b6),_0x3cc2b6;}catch(_0xfd680a){return _0x2977bc[_0x54e994(0x217)]&&console[_0x54e994(0x1cd)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0xd9aab+':\x20'+_0xfd680a[_0x54e994(0x23b)]),{'name':_0xd9aab,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x3674fb,_0x13a6fd)=>{const _0x5cb913=_0x51cf4c;return resolveJumpTarget(_0x3674fb,_0x13a6fd,_0x3b9eb2,_0x5c4a38=>_0x34db8e[_0x5cb913(0x276)][_0x5cb913(0x20c)](_0x5c4a38));}},_0x52cce7=await journeyResponseToDef(_0x2f9976,_0x5a92f);_0x32f382[_0x51cf4c(0x1bb)]({'item':_0x35d2d7,'yaml':_0x52cce7});}},{'verbose':_0x2977bc[_0x4299ad(0x217)]});const _0x118606=await _0x34db8e[_0x4299ad(0x276)][_0x4299ad(0x182)](_0x63e3f[0x0]['journeyBundleId']),_0x4ecd20=buildMergedJourneyDef(_0x32f382,_0x36f7fd,_0x118606),_0x197cdc=normalizeJourneyDef(_0x4ecd20,_0x59b9bf),_0x4ef554=toYamlString(_0x197cdc),_0x19c187=_0x3f8b97||a28_0x3aa0f7[_0x4299ad(0x288)](_0x4e8b50,sanitizeFileName(_0x3e0d3d)+'.yml');!_0x3f8b97&&_0x3a62d6&&!existsSync(_0x4e8b50)&&mkdirSync(_0x4e8b50,{'recursive':!![]});const _0x44fcba=a28_0x3aa0f7[_0x4299ad(0x1eb)](process['cwd'](),_0x19c187);if(existsSync(_0x19c187)){const _0x93af09=readFileSync(_0x19c187,_0x4299ad(0x27d)),_0x192e29=generateDiff(_0x93af09,_0x4ef554),_0x2bfa7a=hasChanges(_0x192e29);_0x41e5ee[_0x4299ad(0x1bb)]({'relativePath':_0x44fcba,'absolutePath':_0x19c187,'content':_0x4ef554,'isNew':![],'hasChanges':_0x2bfa7a,'diff':_0x2bfa7a?formatDiffWithColors(_0x192e29):undefined});}else _0x41e5ee[_0x4299ad(0x1bb)]({'relativePath':_0x44fcba,'absolutePath':_0x19c187,'content':_0x4ef554,'isNew':!![],'hasChanges':![]});}const _0x595816=_0x41e5ee[_0x4299ad(0x22b)](_0x3f7ef2=>_0x3f7ef2[_0x4299ad(0x192)]),_0x3e0a48=_0x41e5ee[_0x4299ad(0x22b)](_0x66b4a6=>!_0x66b4a6['isNew']&&_0x66b4a6[_0x4299ad(0x21c)]),_0x95f1db=_0x41e5ee[_0x4299ad(0x22b)](_0x5e196d=>!_0x5e196d[_0x4299ad(0x192)]&&!_0x5e196d[_0x4299ad(0x21c)]),_0xdc8dd4=_0x6c98b6['length'],_0x4b67a5=_0x26a98c[_0x4299ad(0x202)],_0x26b0eb=_0xdc8dd4>_0x4b67a5?'\x20('+_0xdc8dd4+_0x4299ad(0x25c):'';console[_0x4299ad(0x1cd)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a28_0x4474e0[_0x4299ad(0x1c3)](_0x4b67a5+'\x20journeys')+a28_0x4474e0['dim'](_0x26b0eb)),console[_0x4299ad(0x1cd)]('\x20\x20'+a28_0x4474e0['green']('+\x20'+_0x595816[_0x4299ad(0x18c)]+_0x4299ad(0x21d))),console[_0x4299ad(0x1cd)]('\x20\x20'+a28_0x4474e0[_0x4299ad(0x270)]('~\x20'+_0x3e0a48[_0x4299ad(0x18c)]+'\x20changed\x20files')),console['error']('\x20\x20'+a28_0x4474e0[_0x4299ad(0x1ef)]('=\x20'+_0x95f1db[_0x4299ad(0x18c)]+'\x20unchanged\x20files')),console['error'](_0x4299ad(0x229)+a28_0x4474e0[_0x4299ad(0x1c3)](_0x1072d4)+'\x0a');if(_0x3e0a48['length']>0x0)for(const _0x241026 of _0x3e0a48){console['error'](_0x4299ad(0x1b7)+_0x241026[_0x4299ad(0x1f4)]+'\x27:'),console[_0x4299ad(0x1cd)]('─'['repeat'](0x3c)),console[_0x4299ad(0x1cd)](_0x241026[_0x4299ad(0x1c8)]),console[_0x4299ad(0x1cd)]('─'[_0x4299ad(0x224)](0x3c));}if(_0x101303[_0x4299ad(0x218)])return console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x270)](_0x4299ad(0x1f2))),0x0;if(_0x595816[_0x4299ad(0x18c)]===0x0&&_0x3e0a48['length']===0x0)return console[_0x4299ad(0x1cd)](a28_0x4474e0['green'](_0x4299ad(0x194))),saveSessionContext({'parent_segment':_0x473227},_0x101303[_0x4299ad(0x1da)]),console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x1f0)](_0x4299ad(0x204)+a28_0x4474e0[_0x4299ad(0x1ef)](_0x4299ad(0x1be))+_0x4299ad(0x1fc)+a28_0x4474e0[_0x4299ad(0x1c3)](_0x473227))),0x0;if(!_0x101303[_0x4299ad(0x239)]&&(_0x595816[_0x4299ad(0x18c)]>0x0||_0x3e0a48[_0x4299ad(0x18c)]>0x0)){if(!isInteractive())return console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x24a)](_0x4299ad(0x22c)),_0x4299ad(0x1d7)),console[_0x4299ad(0x1cd)](a28_0x4474e0['dim'](_0x4299ad(0x1ea))),0x1;const _0x479512=await confirmKey(_0x4299ad(0x199)+(_0x595816[_0x4299ad(0x18c)]+_0x3e0a48[_0x4299ad(0x18c)])+_0x4299ad(0x23f));if(!_0x479512)return console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x270)](_0x4299ad(0x25e)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x1072d4)&&mkdirSync(_0x1072d4,{'recursive':!![]});const _0x31c1f1=a28_0x3aa0f7[_0x4299ad(0x288)](_0x1072d4,_0x4299ad(0x1ab));writeFileSync(_0x31c1f1,createTdxConfigContent(_0x473227),_0x4299ad(0x27d));for(const _0x1ca77f of _0x41e5ee){(_0x1ca77f[_0x4299ad(0x192)]||_0x1ca77f[_0x4299ad(0x21c)])&&writeFileSync(_0x1ca77f['absolutePath'],_0x1ca77f['content'],_0x4299ad(0x27d));}return console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x1f0)](_0x4299ad(0x1d8)+(_0x595816[_0x4299ad(0x18c)]+_0x3e0a48[_0x4299ad(0x18c)])+_0x4299ad(0x1f6)+_0x1072d4)),saveSessionContext({'parent_segment':_0x473227},_0x101303[_0x4299ad(0x1da)]),console['error'](a28_0x4474e0[_0x4299ad(0x1f0)](_0x4299ad(0x204)+a28_0x4474e0[_0x4299ad(0x1ef)](_0x4299ad(0x1be))+_0x4299ad(0x1fc)+a28_0x4474e0[_0x4299ad(0x1c3)](_0x473227))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']='journey:columns';[a28_0x4d4d86(0x1a3)]='Show\x20journey\x20table\x20column\x20mapping';async['execute'](_0x2e20d5){const _0x4db939=a28_0x4d4d86,{options:_0x575d55,args:_0x2976ba,tdx:_0x2238bb}=_0x2e20d5,_0x427fed=_0x2976ba[0x0];if(!requireNameOrPath(_0x427fed))return 0x1;_0x575d55[_0x4db939(0x217)]&&console[_0x4db939(0x1cd)](_0x4db939(0x287)+_0x427fed);const {journeyId:_0x2f5b03}=await resolveJourneyIdFromInput(_0x427fed,_0x575d55,_0x2238bb),_0x1d31e1=await withSpinner(_0x4db939(0x238),()=>_0x2238bb[_0x4db939(0x276)][_0x4db939(0x1b6)](_0x2f5b03),{'verbose':_0x575d55[_0x4db939(0x217)]}),_0x1deb9e=_0x1d31e1[_0x4db939(0x26d)];return console[_0x4db939(0x291)](_0x4db939(0x1a4)+_0x1deb9e[_0x4db939(0x281)]),console['log'](_0x4db939(0x1c1)+_0x1deb9e[_0x4db939(0x1d1)]),await handleSDKOutput(_0x1deb9e['columns'],_0x575d55),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a28_0x4d4d86(0x186);[a28_0x4d4d86(0x1a3)]='List\x20activations\x20for\x20a\x20journey';async[a28_0x4d4d86(0x1b9)](_0x1f8f61){const _0x4c1b68=a28_0x4d4d86,{options:_0x4b7614,args:_0x28710c,tdx:_0x183cb1}=_0x1f8f61,_0x1ac3d7=_0x28710c[0x0];if(!requireNameOrPath(_0x1ac3d7))return 0x1;_0x4b7614['verbose']&&console['error'](_0x4c1b68(0x287)+_0x1ac3d7);const {journeyId:_0x228f84}=await resolveJourneyIdFromInput(_0x1ac3d7,_0x4b7614,_0x183cb1),_0x1401b2=await withSpinner(_0x4c1b68(0x261),()=>_0x183cb1['journey'][_0x4c1b68(0x1c5)](_0x228f84),{'verbose':_0x4b7614[_0x4c1b68(0x217)]}),_0x13611a=_0x1401b2[_0x4c1b68(0x26d)];return console[_0x4c1b68(0x1cd)](_0x4c1b68(0x1d2)+_0x13611a['length']+'\x20activation'+(_0x13611a[_0x4c1b68(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0x13611a,_0x4b7614),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x4d4d86(0x233)]='journey:push';[a28_0x4d4d86(0x1a3)]=a28_0x4d4d86(0x267);[a28_0x4d4d86(0x18a)]=new SegmentPushCommand();async[a28_0x4d4d86(0x1b9)](_0x42759a){const _0x319ff4=a28_0x4d4d86,_0x5ea6bf=_0x42759a[_0x319ff4(0x1a8)][0x0];let _0x2dada9;if(_0x5ea6bf){const _0x254b37=await resolveTarget({'arg':_0x5ea6bf,'contextParent':_0x42759a[_0x319ff4(0x20d)][_0x319ff4(0x271)],'cwd':process[_0x319ff4(0x193)]()});isSuccessfulResolution(_0x254b37)&&_0x254b37[_0x319ff4(0x251)]==='file'&&(_0x2dada9=_0x254b37[_0x319ff4(0x18f)]);}const _0xbc230a={..._0x42759a,'options':{..._0x42759a['options'],'journeysOnly':!![],..._0x2dada9&&{'singleFilePath':_0x2dada9}}};return this[_0x319ff4(0x18a)]['execute'](_0xbc230a);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a28_0x4d4d86(0x1e5);[a28_0x4d4d86(0x1a3)]=a28_0x4d4d86(0x188);async[a28_0x4d4d86(0x1b9)](_0x3219ac){const _0x26c6c2=a28_0x4d4d86,{options:_0x2f7c58,args:_0x51c308,tdx:_0x255c96}=_0x3219ac,_0xb16bb7=_0x51c308[0x0];if(!requireNameOrPath(_0xb16bb7))return 0x1;if(_0x2f7c58[_0x26c6c2(0x217)])console['error'](_0x26c6c2(0x287)+_0xb16bb7);const {journeyId:_0x276a27}=await resolveJourneyIdFromInput(_0xb16bb7,_0x2f7c58,_0x255c96),_0x3c9986=await withSpinner(_0x26c6c2(0x187),()=>_0x255c96[_0x26c6c2(0x276)][_0x26c6c2(0x206)](_0x276a27),{'verbose':_0x2f7c58[_0x26c6c2(0x217)]}),{bundleName:_0x11f408,versions:_0x1a1308,latestJourneyId:_0x1313e3}=_0x3c9986['data'];console['error'](_0x11f408+':\x20'+_0x1a1308[_0x26c6c2(0x18c)]+_0x26c6c2(0x26f)+(_0x1a1308[_0x26c6c2(0x18c)]!==0x1?'s':''));const _0x194bf1=_0x1a1308[_0x26c6c2(0x203)](_0x289ff7=>({'version':_0x289ff7[_0x26c6c2(0x1b5)],'journey_id':_0x289ff7['journeyId'],'name':_0x289ff7['name'],'state':_0x289ff7[_0x26c6c2(0x25b)],'paused':_0x289ff7['paused'],'latest':_0x289ff7[_0x26c6c2(0x273)]===_0x1313e3,'created_at':_0x289ff7[_0x26c6c2(0x289)]}));return await handleSDKOutput(_0x194bf1,_0x2f7c58),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x4d4d86(0x233)]='journey:version:create';[a28_0x4d4d86(0x1a3)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a28_0x4d4d86(0x1b9)](_0x4b0d7c){const _0xe032e6=a28_0x4d4d86,{options:_0x139f2d,args:_0x545ded,tdx:_0x1b324e}=_0x4b0d7c,_0x4abf29=_0x545ded[0x0];if(!requireNameOrPath(_0x4abf29))return 0x1;if(_0x139f2d[_0xe032e6(0x217)])console['error'](_0xe032e6(0x287)+_0x4abf29);const {journeyId:_0x2fad12,journeyName:_0x34e627}=await resolveJourneyIdFromInput(_0x4abf29,_0x139f2d,_0x1b324e);if(!_0x139f2d[_0xe032e6(0x239)]){const _0x14527a=await confirm(_0xe032e6(0x23a)+_0x34e627+'\x22?');if(!_0x14527a)return console[_0xe032e6(0x1cd)](_0xe032e6(0x207)),0x0;}const _0x34c2c7=await withSpinner(_0xe032e6(0x1b1),()=>_0x1b324e[_0xe032e6(0x276)][_0xe032e6(0x1ca)](_0x2fad12),{'verbose':_0x139f2d[_0xe032e6(0x217)]}),_0x4b209e=_0x34c2c7[_0xe032e6(0x26d)];return console[_0xe032e6(0x1cd)](a28_0x4474e0['green']('✔')+_0xe032e6(0x262)+_0x4b209e[_0xe032e6(0x208)]['versionNumber']+_0xe032e6(0x1d3)+_0x4b209e[_0xe032e6(0x208)][_0xe032e6(0x233)]+'\x22'),console[_0xe032e6(0x1cd)]('\x20\x20Journey\x20ID:\x20'+_0x4b209e['id']),await handleSingleObjectOutput({'id':_0x4b209e['id'],'name':_0x4b209e[_0xe032e6(0x208)][_0xe032e6(0x233)],'version':_0x4b209e['attributes'][_0xe032e6(0x1b5)],'state':_0x4b209e['attributes'][_0xe032e6(0x25b)],'bundle_id':_0x4b209e[_0xe032e6(0x208)][_0xe032e6(0x18d)],'created_at':_0x4b209e[_0xe032e6(0x208)]['createdAt']},_0x139f2d),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x20a);[a28_0x4d4d86(0x1a3)]=a28_0x4d4d86(0x245);async[a28_0x4d4d86(0x1b9)](_0x464b5b){const _0x31cf93=a28_0x4d4d86,{options:_0xf93f1,args:_0x376b5c,tdx:_0x2d68bb}=_0x464b5b,_0xa0aa46=_0x376b5c[0x0];if(!requireNameOrPath(_0xa0aa46))return 0x1;const _0x172251=_0xf93f1[_0x31cf93(0x1bf)];if(!_0x172251)return console[_0x31cf93(0x1cd)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x31cf93(0x1cd)](_0x31cf93(0x19a)),0x1;const _0x16ed33=parseInt(_0x172251,0xa);if(isNaN(_0x16ed33)||_0x16ed33<0x1)return console[_0x31cf93(0x1cd)](_0x31cf93(0x254)+_0x172251),0x1;if(_0xf93f1[_0x31cf93(0x217)])console[_0x31cf93(0x1cd)](_0x31cf93(0x287)+_0xa0aa46+_0x31cf93(0x1fd)+_0x16ed33);const {journeyId:_0xec543f,parentSegmentId:_0x3fb9b0}=await resolveJourneyIdFromInput(_0xa0aa46,_0xf93f1,_0x2d68bb),_0x249fd6=await withSpinner(_0x31cf93(0x185),()=>_0x2d68bb[_0x31cf93(0x276)]['listVersions'](_0xec543f),{'verbose':_0xf93f1[_0x31cf93(0x217)]}),{versions:_0x53b2d5,latestJourneyId:_0xaa9e7e}=_0x249fd6[_0x31cf93(0x26d)],_0xfc4345=_0x53b2d5[_0x31cf93(0x24b)](_0x21f9c1=>_0x21f9c1[_0x31cf93(0x1b5)]===_0x16ed33);if(!_0xfc4345){const _0x45d37b=_0x53b2d5[_0x31cf93(0x203)](_0x56d389=>'v'+_0x56d389[_0x31cf93(0x1b5)])[_0x31cf93(0x288)](',\x20');return console[_0x31cf93(0x1cd)](_0x31cf93(0x1b4)+_0x16ed33+_0x31cf93(0x230)+_0x45d37b),0x1;}const _0x3c0d2d=await withSpinner(_0x31cf93(0x21b)+_0x16ed33+_0x31cf93(0x1aa),()=>_0x2d68bb[_0x31cf93(0x276)][_0x31cf93(0x20c)](_0xfc4345['journeyId']),{'verbose':_0xf93f1['verbose']}),_0x231393=_0x3c0d2d['data'],_0x35bcd1=getConsoleNextUrl(_0xf93f1[_0x31cf93(0x21f)],_0x31cf93(0x28e)+_0x3fb9b0+'/e/'+_0xfc4345[_0x31cf93(0x273)]+_0x31cf93(0x247));return await handleSingleObjectOutput({'id':_0x231393['id'],'name':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x233)],'version':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x1b5)],'description':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x1a3)],'state':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x25b)],'paused':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x26a)],'reentry_mode':_0x231393['attributes']['reentryMode'],'stages':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x26b)]?.[_0x31cf93(0x18c)]||0x0,..._0x231393['attributes'][_0x31cf93(0x240)]&&{'goal':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x240)][_0x31cf93(0x233)]},'latest':_0xfc4345['journeyId']===_0xaa9e7e,'created_at':_0x231393['attributes'][_0x31cf93(0x289)],'updated_at':_0x231393['attributes'][_0x31cf93(0x1dd)],'url':_0x35bcd1},_0xf93f1),0x0;}}
1
+ const a27_0x1ccf16=a27_0x2962;(function(_0x12b7bd,_0x546a2a){const _0x54589e=a27_0x2962,_0x238c39=_0x12b7bd();while(!![]){try{const _0xa8e116=-parseInt(_0x54589e(0x25e))/0x1*(-parseInt(_0x54589e(0x265))/0x2)+-parseInt(_0x54589e(0x1c7))/0x3+-parseInt(_0x54589e(0x1bb))/0x4*(-parseInt(_0x54589e(0x1fd))/0x5)+parseInt(_0x54589e(0x16b))/0x6*(-parseInt(_0x54589e(0x20c))/0x7)+-parseInt(_0x54589e(0x1d2))/0x8+-parseInt(_0x54589e(0x17b))/0x9*(-parseInt(_0x54589e(0x1f2))/0xa)+-parseInt(_0x54589e(0x1b9))/0xb*(-parseInt(_0x54589e(0x21d))/0xc);if(_0xa8e116===_0x546a2a)break;else _0x238c39['push'](_0x238c39['shift']());}catch(_0x5e0158){_0x238c39['push'](_0x238c39['shift']());}}}(a27_0x2192,0x4b5c0));import a27_0x3af12a from'chalk';import a27_0xce06a6 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';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';function a27_0x2192(){const _0x134e07=['conversion','find','.yml','listFolders','No\x20statistics\x20available\x20for\x20journey:\x20','hasChanges','Fetching\x20parent\x20segment...','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','listJourneysFromParentSegment','INVALID_ARGUMENT','✔\x20Pulled\x20','-\x20no\x20files\x20written','file','3090HMiVKd','connector_config','\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','site','segment','getParentFull','type','history','Resuming\x20journey...','buildIdToNameMap','...','folderPath','/app/ps/','map','Getting\x20version\x20','1084833zvIsDx','relative','Write\x20','includeStats','limit','database','all','completionRate','journeyName','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','resolveJourneyId','length','\x20\x20Preserving\x20local\x20segment\x20name:\x20','state','getActivation','\x22\x20paused','Resolved\x20YAML\x20file:\x20','json','Resolving\x20parent\x20segment...','versionNumber','List\x20activations\x20for\x20a\x20journey','\x22\x20resumed','(draft)','📁\x20','values','journey:list','Cancelled','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20not\x20found.\x20Available:\x20','journey:view','getSegment','isNew','execute','session','Journey\x20name:\x20','rule','repeat','\x20\x20Statistics\x20not\x20available','archived','/e/','hasPeriod','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20Version\x20','getTrafficData','helpText','Parent\x20segment:\x20','connection','(running)','\x20version','split','utf-8','table','paused','\x20\x20Journey\x20ID:\x20','\x20\x20Name:\x20','args','red','journeyBundleId','\x20files?','Error:\x20Journey\x20not\x20found:\x20','(root)','\x5c$&','11NyNykZ','push','1046396dRcsRU','format','parentSegment','Warning:\x20Could\x20not\x20resolve\x20segment\x20','size','\x20Created\x20v','log','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','draft','\x22\x20not\x20found','\x20journey\x20files\x20to\x20','570198WRAwyW','message','listVersions','get','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Export\x20journey(s)\x20as\x20YAML\x20files','bold','(archived)','root\x20folder','✔\x20Context\x20set:\x20','\x20\x20-\x20','3296448brgzqF','\x27\x20not\x20found\x20in\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20\x20Target:\x20','segmentPushCommand','toLowerCase','options','listJourneysWithFolders','reentryMode','journeys','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','links','goal','goalSize','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Resolving\x20journey...','localeCompare','\x20activation','Target\x20directory:\x20','exitOrJumpRate','journeyId','data','/j/da/je','relativePath','Resolving\x20version...','stages','includeHistory','has','Pattern:\x20','pause','updatedAt','getJourney','10nYacbk','renderStats','Fetching\x20journeys\x20and\x20folders...','then','journey:stats','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','/j/da','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','buildIdToEmailMap','green','5UtebjW','Pause\x20a\x20running\x20journey','\x20Opening\x20','Error:\x20Journey\x20\x27','getStatistics','List\x20journeys\x20in\x20current\x20context','Error:\x20Stage\x20\x22','\x20new\x20files','filter','Pausing\x20journey...','journeyStages','audienceId','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','Aborted.','error','3143qMKiDM','completeMilestoneRate','Listing\x20journeys...','resourceName','rootFolderId','\x20\x20Folder\x20path:\x20','filePath','absolutePath','kind','createVersion','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','journey','join','attributes','Listing\x20journey\x20versions...','✔\x20Journey\x20\x22','8290428aagmMu','web','yellow','resolveSegment','\x20versions)','List\x20all\x20versions\x20of\x20a\x20journey','resolveParentId','\x20\x20Parent\x20segment:\x20','exitOrJumpSize','Found\x20','version','\x20(ID:\x20','Show\x20journey\x20details','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20changed\x20files','user','Database:\x20','jsonl','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','activation_','Getting\x20journey\x20traffic\x20data...','base','\x20(draft)\x20—\x20\x22','journey:version:view','Getting\x20journey\x20statistics...','replace','Show\x20journey\x20table\x20column\x20mapping','yes','stringify','tdx.json','nodes','description','enteredSize','activationParams','stage','journeyBundleName','cwd','dryRun','cyan','dim','completed','\x20->\x20','Show\x20journey\x20statistics','Getting\x20column\x20mapping...','folderId','Target\x20file:\x20','getLatestJourneyId','journey:versions','Error:\x20Invalid\x20version\x20number:\x20','set','createdAt','\x0aChanges\x20to\x20\x27','resume','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journey:columns','tsv','Listing\x20journey\x20activations...','sort','listActivationsFlat','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','journey:pull','add','\x20journeys','Input:\x20','milestoneSize','3gAajRm','Error:\x20--version\x20option\x20is\x20required','Options:','✔\x20All\x20files\x20are\x20up\x20to\x20date','diff','\x20(rule\x20match)','test','46016wRnANY','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','verbose','(completed)','activation','journey:version:create','Fetching\x20','content','\x0aPull\x20summary:','parent_segment'];a27_0x2192=function(){return _0x134e07;};return a27_0x2192();}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}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function a27_0x2962(_0x43642b,_0x6a7baf){_0x43642b=_0x43642b-0x163;const _0x21925=a27_0x2192();let _0x296223=_0x21925[_0x43642b];return _0x296223;}function requireNameOrPath(_0x136887){const _0xf40ea8=a27_0x2962;return!_0x136887&&(console[_0xf40ea8(0x20b)](_0xf40ea8(0x1cb)),console[_0xf40ea8(0x20b)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x136887;}function withJsonFormat(_0x45cfbb){const _0x3779e7=a27_0x2962;if(!_0x45cfbb['format']&&!_0x45cfbb[_0x3779e7(0x18c)]&&!_0x45cfbb[_0x3779e7(0x22e)]&&!_0x45cfbb[_0x3779e7(0x254)])return{..._0x45cfbb,'format':'json','json':!![]};return _0x45cfbb;}function formatJourneyState(_0x3688a3){const _0x2a4e7d=a27_0x2962;switch(_0x3688a3){case'launched':return a27_0x3af12a['green'](_0x2a4e7d(0x1aa));case _0x2a4e7d(0x1c4):return a27_0x3af12a[_0x2a4e7d(0x244)](_0x2a4e7d(0x191));case _0x2a4e7d(0x1af):return a27_0x3af12a[_0x2a4e7d(0x21f)]('(paused)');case _0x2a4e7d(0x245):return a27_0x3af12a['blue'](_0x2a4e7d(0x269));case _0x2a4e7d(0x1a1):return a27_0x3af12a['dim'](_0x2a4e7d(0x1ce));default:return'('+_0x3688a3+')';}}function formatJourneyItem(_0x5c10bb,_0x3c8324='',_0xc43f9){const _0x13b4df=a27_0x2962,_0x3085aa=formatJourneyState(_0x5c10bb[_0x13b4df(0x188)]),_0x175564=_0xc43f9?hyperlink(_0x5c10bb[_0x13b4df(0x240)],_0xc43f9):_0x5c10bb[_0x13b4df(0x240)];return _0x3c8324+'🗺️\x20'+_0x175564+'\x20'+_0x3085aa;}function escapeRegex(_0x1faebb){const _0x481ee1=a27_0x2962;return _0x1faebb[_0x481ee1(0x236)](/[.*+?^${}()|[\]\\]/g,_0x481ee1(0x1b8));}function globToRegex(_0x3d09eb){const _0x504724=a27_0x2962,_0x12e44c=_0x3d09eb[_0x504724(0x1ac)]('*')[_0x504724(0x179)](escapeRegex);return new RegExp(_0x12e44c[_0x504724(0x219)]('.*'),'i');}function buildRuleToNameMapping(_0x1dc046){const _0x597968=a27_0x2962,_0x2697c6=new Map();if(_0x1dc046['segments'])for(const [_0x57f7af,_0x57ec19]of Object['entries'](_0x1dc046['segments'])){if(_0x57ec19[_0x597968(0x19e)]){const _0x5cf85d=serializeRule(_0x57ec19['rule']),_0xab8c1b=_0x2697c6['get'](_0x5cf85d);_0xab8c1b?_0xab8c1b[_0x597968(0x1ba)](_0x57f7af):_0x2697c6[_0x597968(0x24e)](_0x5cf85d,[_0x57f7af]);}}return _0x2697c6;}async function resolveJourneyIdFromInput(_0x13230a,_0x5e23ce,_0xfa87b5){const _0xd7e3f3=a27_0x2962,_0x2e0e99=await resolveJourneyTarget(_0x13230a,_0x5e23ce[_0xd7e3f3(0x1bd)],_0x5e23ce['verbose']),_0x46b2c8=_0x2e0e99[_0xd7e3f3(0x1bd)];if(!_0x46b2c8)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x58ddd9=await withSpinner(_0xd7e3f3(0x18d),()=>_0xfa87b5[_0xd7e3f3(0x170)][_0xd7e3f3(0x223)](_0x46b2c8),{'verbose':_0x5e23ce[_0xd7e3f3(0x268)]}),_0x26a0d1=_0x58ddd9[_0xd7e3f3(0x1e7)],_0x4e3c71=await withSpinner(_0xd7e3f3(0x1e1),()=>_0xfa87b5[_0xd7e3f3(0x218)][_0xd7e3f3(0x185)](_0x26a0d1,_0x2e0e99['journeyName']),{'verbose':_0x5e23ce[_0xd7e3f3(0x268)]});return{'journeyId':_0x4e3c71[_0xd7e3f3(0x1e7)],'journeyName':_0x2e0e99[_0xd7e3f3(0x183)],'parentSegmentId':_0x26a0d1};}async function resolveJourneyTarget(_0x187fa7,_0x44259b,_0x49f575){const _0x17d064=a27_0x2962;if(isYamlFilePath(_0x187fa7))try{const _0x22bb28=await resolveYamlFilePath(_0x187fa7);return _0x49f575&&(console[_0x17d064(0x20b)](_0x17d064(0x18b)+_0x187fa7),console[_0x17d064(0x20b)](_0x17d064(0x224)+_0x22bb28[_0x17d064(0x1bd)]),console['error'](_0x17d064(0x1b1)+_0x22bb28['segmentName']),console[_0x17d064(0x20b)](_0x17d064(0x211)+(_0x22bb28['folderPath']||_0x17d064(0x1b7)))),{'journeyName':_0x22bb28['segmentName'],'parentSegment':_0x22bb28['parentSegment'],'resolved':_0x22bb28};}catch(_0x1f2301){throw new SDKError(ErrorCode[_0x17d064(0x167)],_0x17d064(0x1a4)+_0x1f2301['message']);}if(!_0x44259b)throw new SDKError(ErrorCode[_0x17d064(0x167)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x187fa7,'parentSegment':_0x44259b};}export class JourneyListCommand extends BaseCommand{[a27_0x1ccf16(0x266)]=a27_0x1ccf16(0x194);[a27_0x1ccf16(0x23c)]=a27_0x1ccf16(0x202);async[a27_0x1ccf16(0x19b)](_0x3f5543){const _0x1b56fc=a27_0x1ccf16,{options:_0x5ec603,args:_0x555bf9,tdx:_0x518729}=_0x3f5543,_0x55f44f=_0x555bf9[0x0],_0x1dd0ef=_0x5ec603[_0x1b56fc(0x1bd)];if(!_0x1dd0ef)return console[_0x1b56fc(0x20b)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x1b56fc(0x20b)](_0x1b56fc(0x196)),0x1;const _0x10caaa=await withSpinner(_0x1b56fc(0x18d),()=>_0x518729[_0x1b56fc(0x170)][_0x1b56fc(0x223)](_0x1dd0ef),{'verbose':_0x5ec603[_0x1b56fc(0x268)]}),_0x1cb0ac=_0x10caaa[_0x1b56fc(0x1e7)];_0x5ec603[_0x1b56fc(0x268)]&&(console['error'](_0x1b56fc(0x1a8)+_0x1dd0ef+_0x1b56fc(0x228)+_0x1cb0ac+')'),_0x55f44f&&console[_0x1b56fc(0x20b)](_0x1b56fc(0x1ee)+_0x55f44f));const _0x424443=await withSpinner(_0x1b56fc(0x164),()=>_0x518729['segment'][_0x1b56fc(0x171)](_0x1cb0ac),{'verbose':_0x5ec603[_0x1b56fc(0x268)]}),_0xd8d71c=_0x424443[_0x1b56fc(0x1e7)],_0x509ce1=_0xd8d71c[_0x1b56fc(0x210)],_0x521aa4=await withSpinner(_0x1b56fc(0x20e),()=>_0x518729['journey'][_0x1b56fc(0x1d9)](_0x1cb0ac,_0x509ce1),{'verbose':_0x5ec603['verbose']});let _0x199500=_0x521aa4[_0x1b56fc(0x1e7)][_0x1b56fc(0x1db)];const _0x9acd1a=_0x521aa4['data']['folders'],_0x3857e2=new Map();for(const _0xf121ec of _0x9acd1a){_0x3857e2['set'](_0xf121ec['id'],_0xf121ec['name']);}if(_0x55f44f){const _0x40595a=globToRegex(_0x55f44f);_0x199500=_0x199500[_0x1b56fc(0x205)](_0x1af7b2=>_0x40595a[_0x1b56fc(0x264)](_0x1af7b2[_0x1b56fc(0x240)]));}console[_0x1b56fc(0x20b)]('✔\x20Found\x20'+_0x199500[_0x1b56fc(0x186)]+_0x1b56fc(0x16d)+(_0x199500[_0x1b56fc(0x186)]!==0x1?'s':''));const _0x5847a6=_0xedc9a7=>{const _0x4aa18e=_0x1b56fc;return getConsoleNextUrl(_0x5ec603['site'],_0x4aa18e(0x178)+_0x1cb0ac+'/e/'+_0xedc9a7+_0x4aa18e(0x1f9));};if(_0x5ec603['format']===_0x1b56fc(0x1ae))await handleSDKOutput(_0x199500,_0x5ec603);else{if(_0x5ec603[_0x1b56fc(0x1bc)]==='json'){const _0x237d27=_0x199500['map'](_0x342e96=>({..._0x342e96,'url':_0x5847a6(_0x342e96['id'])}));await handleSDKOutput(_0x237d27,_0x5ec603);}else{console[_0x1b56fc(0x1c1)]('['+_0x1dd0ef+']');const _0x187e51=new Map(),_0x3a0bef=[];for(const _0x2c2f65 of _0x199500){if(!_0x2c2f65[_0x1b56fc(0x249)]||_0x2c2f65[_0x1b56fc(0x249)]===_0x509ce1)_0x3a0bef[_0x1b56fc(0x1ba)](_0x2c2f65);else{const _0x58c058=_0x187e51[_0x1b56fc(0x1ca)](_0x2c2f65[_0x1b56fc(0x249)])||[];_0x58c058[_0x1b56fc(0x1ba)](_0x2c2f65),_0x187e51['set'](_0x2c2f65[_0x1b56fc(0x249)],_0x58c058);}}const _0xe5e82a=(_0x1275cf,_0x215803)=>_0x1275cf[_0x1b56fc(0x240)][_0x1b56fc(0x1e2)](_0x215803[_0x1b56fc(0x240)],undefined,{'sensitivity':_0x1b56fc(0x232)});_0x3a0bef[_0x1b56fc(0x256)](_0xe5e82a);for(const _0x3f0a18 of _0x3a0bef){console[_0x1b56fc(0x1c1)](formatJourneyItem(_0x3f0a18,'',_0x5847a6(_0x3f0a18['id'])));}const _0x43cb6a=[..._0x187e51['entries']()][_0x1b56fc(0x256)]((_0x2122ad,_0x56dace)=>{const _0x2df5cd=_0x1b56fc,_0x3a2a19=_0x3857e2[_0x2df5cd(0x1ca)](_0x2122ad[0x0])||_0x2122ad[0x0],_0x4e9f42=_0x3857e2['get'](_0x56dace[0x0])||_0x56dace[0x0];return _0x3a2a19['localeCompare'](_0x4e9f42,undefined,{'sensitivity':_0x2df5cd(0x232)});});for(const [_0x51d493,_0x2185be]of _0x43cb6a){const _0x42dab2=_0x3857e2[_0x1b56fc(0x1ca)](_0x51d493)||_0x51d493;console[_0x1b56fc(0x1c1)](_0x1b56fc(0x192)+_0x42dab2),_0x2185be[_0x1b56fc(0x256)](_0xe5e82a);for(const _0x359f09 of _0x2185be){console[_0x1b56fc(0x1c1)](formatJourneyItem(_0x359f09,'\x20\x20',_0x5847a6(_0x359f09['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x1ccf16(0x266)]=a27_0x1ccf16(0x198);[a27_0x1ccf16(0x23c)]=a27_0x1ccf16(0x229);async['execute'](_0x2e229c){const _0x42704c=a27_0x1ccf16,{options:_0x4588bf,args:_0x55badf,tdx:_0x581457}=_0x2e229c,_0x3dd03d=_0x55badf[0x0];if(!_0x3dd03d)return console[_0x42704c(0x20b)](_0x42704c(0x1cb)),console['error']('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console['error'](_0x42704c(0x260)),console[_0x42704c(0x20b)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x4588bf[_0x42704c(0x268)]&&console['error'](_0x42704c(0x25c)+_0x3dd03d);const {journeyId:_0x1cb613,parentSegmentId:_0x2f3852}=await resolveJourneyIdFromInput(_0x3dd03d,_0x4588bf,_0x581457);if(_0x4588bf[_0x42704c(0x21e)]){const _0x1dc79b=getConsoleNextUrl(_0x4588bf[_0x42704c(0x16f)],_0x42704c(0x178)+_0x2f3852+_0x42704c(0x1a2)+_0x1cb613+_0x42704c(0x1e8));return console[_0x42704c(0x20b)](a27_0x3af12a[_0x42704c(0x1fc)]('✔')+_0x42704c(0x1ff)+a27_0x3af12a[_0x42704c(0x243)](_0x1dc79b)),openBrowser(_0x1dc79b),0x0;}const _0x1770e2=await withSpinner('Getting\x20journey\x20details...',()=>_0x581457[_0x42704c(0x218)][_0x42704c(0x1f1)](_0x1cb613),{'verbose':_0x4588bf[_0x42704c(0x268)]}),_0x1d5912=_0x1770e2['data'],_0x3fe569=_0x4588bf[_0x42704c(0x17e)];let _0x33885e;if(_0x3fe569)try{const _0x5f1e8e=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x581457[_0x42704c(0x218)][_0x42704c(0x201)](_0x1cb613),{'verbose':_0x4588bf[_0x42704c(0x268)]});_0x33885e=_0x5f1e8e['data'];}catch{_0x4588bf[_0x42704c(0x268)]&&console[_0x42704c(0x20b)](_0x42704c(0x1a0));}const _0x45f2b7=getConsoleNextUrl(_0x4588bf[_0x42704c(0x16f)],_0x42704c(0x178)+_0x2f3852+_0x42704c(0x1a2)+_0x1cb613+_0x42704c(0x1e8)),_0xffe0f2={'id':_0x1d5912['id'],'name':_0x1d5912[_0x42704c(0x21a)][_0x42704c(0x266)],'description':_0x1d5912[_0x42704c(0x21a)]['description'],'state':_0x1d5912[_0x42704c(0x21a)][_0x42704c(0x188)],'paused':_0x1d5912[_0x42704c(0x21a)]['paused'],'reentry_mode':_0x1d5912[_0x42704c(0x21a)][_0x42704c(0x1da)],'stages':_0x1d5912['attributes'][_0x42704c(0x207)]?.[_0x42704c(0x186)]||0x0,..._0x1d5912['attributes'][_0x42704c(0x1de)]&&{'goal':_0x1d5912[_0x42704c(0x21a)][_0x42704c(0x1de)][_0x42704c(0x266)]},..._0x33885e&&{'statistics':{'size':_0x33885e[_0x42704c(0x1bf)],'entered':_0x33885e['enteredSize'],'goal_achieved':_0x33885e[_0x42704c(0x1df)],'completion_rate':_0x33885e[_0x42704c(0x182)],'exit_or_jump':_0x33885e[_0x42704c(0x225)],'exit_or_jump_rate':_0x33885e[_0x42704c(0x1e5)],'stages':_0x33885e['stages']}},'url':_0x45f2b7};return await handleSingleObjectOutput(_0xffe0f2,_0x4588bf),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x1ccf16(0x266)]=a27_0x1ccf16(0x1f6);[a27_0x1ccf16(0x23c)]=a27_0x1ccf16(0x247);async[a27_0x1ccf16(0x19b)](_0x1099c9){const _0x4c0475=a27_0x1ccf16,{options:_0x292ab9,args:_0x5c07d3,tdx:_0x3af272}=_0x1099c9,_0x57c7e4=_0x5c07d3[0x0];if(!requireNameOrPath(_0x57c7e4))return 0x1;_0x292ab9[_0x4c0475(0x268)]&&console[_0x4c0475(0x20b)](_0x4c0475(0x25c)+_0x57c7e4);const _0x30735e=_0x292ab9,_0x451f6a=_0x30735e['from'],_0x147da8=_0x30735e['to'],_0xc6937b=_0x30735e['includeHistory'],_0x20ccdf=_0x30735e[_0x4c0475(0x23f)];_0xc6937b&&!_0x451f6a&&!_0x147da8&&console[_0x4c0475(0x20b)](_0x4c0475(0x1d4));const _0x3ea899=_0xc6937b?withJsonFormat(_0x292ab9):_0x292ab9,{journeyId:_0x317344,journeyName:_0x974b46}=await resolveJourneyIdFromInput(_0x57c7e4,_0x3ea899,_0x3af272),_0x2ae7bf=_0x451f6a||_0x147da8?{'from':_0x451f6a,'to':_0x147da8}:undefined,_0x2ab1a8=await withSpinner(_0x4c0475(0x235),()=>Promise[_0x4c0475(0x181)]([_0x3af272[_0x4c0475(0x218)][_0x4c0475(0x1f1)](_0x317344),_0x3af272[_0x4c0475(0x218)][_0x4c0475(0x201)](_0x317344,_0x2ae7bf)]),{'verbose':_0x3ea899[_0x4c0475(0x268)]}),[_0x4a58b7,_0x1787fc]=_0x2ab1a8[_0x4c0475(0x1e7)];if(!_0x1787fc||_0x1787fc[_0x4c0475(0x1e6)]===null)return console[_0x4c0475(0x20b)](_0x4c0475(0x274)+_0x974b46),console[_0x4c0475(0x20b)](_0x4c0475(0x252)),0x0;const _0x194cbb=buildStageNameMap(_0x4a58b7),_0x17d1a5=!!(_0x2ae7bf&&_0x1787fc[_0x4c0475(0x173)]?.[_0x4c0475(0x186)]),_0xd6cb84={'stageNameMap':_0x194cbb,'hasPeriod':_0x17d1a5,'includeHistory':!!_0xc6937b};if(_0x20ccdf&&_0x1787fc[_0x4c0475(0x1eb)]){const _0x4a4376=_0x1787fc[_0x4c0475(0x1eb)][_0x4c0475(0x271)](_0x3c7f57=>{const _0x39fec1=_0x4c0475,_0x2f7058=_0x194cbb['get'](_0x3c7f57['id'])??'';return _0x2f7058[_0x39fec1(0x1d7)]()===_0x20ccdf[_0x39fec1(0x1d7)]();});if(_0x4a4376)return await handleSingleObjectOutput(formatStageStats(_0x4a4376,_0xd6cb84),_0x3ea899),0x0;const _0x315540=_0x1787fc[_0x4c0475(0x1eb)][_0x4c0475(0x179)](_0x479b16=>_0x194cbb[_0x4c0475(0x1ca)](_0x479b16['id'])??_0x479b16['id']);return console[_0x4c0475(0x20b)](_0x4c0475(0x203)+_0x20ccdf+_0x4c0475(0x1c5)),console[_0x4c0475(0x20b)]('Available\x20stages:\x20'+_0x315540['join'](',\x20')),0x1;}const _0x4a6cff=_0x1787fc[_0x4c0475(0x1eb)]?.[_0x4c0475(0x179)](_0x24b5d7=>formatStageStats(_0x24b5d7,_0xd6cb84)),_0x372a68=assembleJourneyStats(_0x1787fc,{'from':_0x451f6a,'to':_0x147da8,'includeHistory':_0xc6937b});return await this[_0x4c0475(0x1f3)](_0x372a68,_0x4a6cff??[],_0x3ea899),0x0;}async[a27_0x1ccf16(0x1f3)](_0x7e3278,_0x1cf6f0,_0x311af3){const _0x5447b7=a27_0x1ccf16,_0x5e071f=_0x311af3[_0x5447b7(0x1bc)]==='json'||_0x311af3[_0x5447b7(0x1bc)]===_0x5447b7(0x22e)||_0x311af3['json']||_0x311af3[_0x5447b7(0x22e)];if(_0x5e071f){_0x7e3278[_0x5447b7(0x1eb)]=_0x1cf6f0,await handleSingleObjectOutput(_0x7e3278,_0x311af3);return;}await handleSingleObjectOutput(_0x7e3278,_0x311af3);for(const _0x204586 of _0x1cf6f0){console[_0x5447b7(0x1c1)](''),console[_0x5447b7(0x1c1)](String(a27_0x3af12a['cyan'][_0x5447b7(0x1cd)]('['+_0x204586[_0x5447b7(0x266)]+']'))+a27_0x3af12a[_0x5447b7(0x244)]('\x20'+_0x204586['id']));const {id:_0x40decd,name:_0x4726c5,..._0x5a45d8}=_0x204586;await handleSingleObjectOutput(_0x5a45d8,_0x311af3);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x1ccf16(0x266)]='journey:traffic';[a27_0x1ccf16(0x23c)]=a27_0x1ccf16(0x1e0);async[a27_0x1ccf16(0x19b)](_0x3054e1){const _0x583db7=a27_0x1ccf16,{options:_0x5b9583,args:_0x4f1e82,tdx:_0x841391}=_0x3054e1,_0x13cb27=_0x4f1e82[0x0];if(!requireNameOrPath(_0x13cb27))return 0x1;_0x5b9583[_0x583db7(0x268)]&&console[_0x583db7(0x20b)](_0x583db7(0x25c)+_0x13cb27);const _0x1a09d5=_0x5b9583,_0x446bc=_0x1a09d5[_0x583db7(0x172)],_0x587e23=_0x1a09d5['from'],_0x29edd9=_0x1a09d5['to'],_0x4d730b=_0x1a09d5[_0x583db7(0x17f)];if(_0x446bc&&_0x446bc!=='conversion'&&_0x446bc!==_0x583db7(0x26a))return console['error']('Error:\x20Invalid\x20--type\x20\x22'+_0x446bc+_0x583db7(0x1f7)),0x1;const _0x1beafc=withJsonFormat(_0x5b9583),{journeyId:_0x48ab43,journeyName:_0x2dfa19}=await resolveJourneyIdFromInput(_0x13cb27,_0x1beafc,_0x841391),_0x5d90c8={'type':_0x446bc,'from':_0x587e23,'to':_0x29edd9,'limit':_0x4d730b},_0x3d011b=await withSpinner(_0x583db7(0x231),()=>_0x841391['journey'][_0x583db7(0x1a6)](_0x48ab43,_0x5d90c8),{'verbose':_0x1beafc[_0x583db7(0x268)]}),_0x395efa=_0x3d011b[_0x583db7(0x1e7)],_0xf17a36=_0x395efa['conversion']&&(_0x395efa[_0x583db7(0x270)][_0x583db7(0x23b)]['length']>0x0||_0x395efa[_0x583db7(0x270)][_0x583db7(0x1dd)][_0x583db7(0x186)]>0x0),_0x40cb73=_0x395efa['activation']&&_0x395efa[_0x583db7(0x26a)][_0x583db7(0x186)]>0x0;if(!_0xf17a36&&!_0x40cb73)return console[_0x583db7(0x20b)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x2dfa19),console[_0x583db7(0x20b)](_0x583db7(0x22f)),_0x587e23&&_0x29edd9&&console[_0x583db7(0x20b)](_0x583db7(0x258)),0x0;return await handleSingleObjectOutput(_0x395efa,_0x1beafc),0x0;}}function formatStageStats(_0x3cc5e5,_0x2cb2ab){const _0x6ee351=a27_0x1ccf16,_0x5041bf=_0x2cb2ab[_0x6ee351(0x1a3)]&&_0x3cc5e5[_0x6ee351(0x173)]?.['length']?aggregateStageHistory(_0x3cc5e5[_0x6ee351(0x173)]):{'size':_0x3cc5e5[_0x6ee351(0x1bf)],'entered':_0x3cc5e5[_0x6ee351(0x23d)],'milestone':_0x3cc5e5[_0x6ee351(0x25d)],'milestone_rate':_0x3cc5e5[_0x6ee351(0x20d)],'exit_or_jump':_0x3cc5e5[_0x6ee351(0x225)],'exit_or_jump_rate':_0x3cc5e5[_0x6ee351(0x1e5)]},_0x5b2932={'id':_0x3cc5e5['id'],'name':_0x2cb2ab['stageNameMap']['get'](_0x3cc5e5['id'])??_0x3cc5e5['id'],..._0x5041bf};return _0x2cb2ab[_0x6ee351(0x1a3)]&&_0x2cb2ab[_0x6ee351(0x1ec)]&&_0x3cc5e5[_0x6ee351(0x173)]&&(_0x5b2932[_0x6ee351(0x173)]=_0x3cc5e5[_0x6ee351(0x173)]),_0x5b2932;}export class JourneyPauseCommand extends BaseCommand{[a27_0x1ccf16(0x266)]='journey:pause';[a27_0x1ccf16(0x23c)]=a27_0x1ccf16(0x1fe);async['execute'](_0x2cf13e){const _0x53e8c3=a27_0x1ccf16,{options:_0x542a5a,args:_0x2d8b36,tdx:_0x268e8f}=_0x2cf13e,_0x24fa2f=_0x2d8b36[0x0];if(!requireNameOrPath(_0x24fa2f))return 0x1;_0x542a5a[_0x53e8c3(0x268)]&&console[_0x53e8c3(0x20b)](_0x53e8c3(0x25c)+_0x24fa2f);const {journeyId:_0x542161,journeyName:_0x23a5b1}=await resolveJourneyIdFromInput(_0x24fa2f,_0x542a5a,_0x268e8f);if(!_0x542a5a['yes']){const _0x23fd03=await confirm(_0x53e8c3(0x165)+_0x23a5b1+'\x22?');if(!_0x23fd03)return console['error'](_0x53e8c3(0x195)),0x0;}const _0x52450c=await withSpinner(_0x53e8c3(0x206),()=>_0x268e8f['journey'][_0x53e8c3(0x1ef)](_0x542161),{'verbose':_0x542a5a['verbose']}),_0x796eaf=_0x52450c[_0x53e8c3(0x1e7)];return console[_0x53e8c3(0x20b)]('✔\x20Journey\x20\x22'+_0x796eaf[_0x53e8c3(0x21a)]['name']+_0x53e8c3(0x18a)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']='journey:resume';[a27_0x1ccf16(0x23c)]='Resume\x20a\x20paused\x20journey';async[a27_0x1ccf16(0x19b)](_0x273e7c){const _0xda1118=a27_0x1ccf16,{options:_0x34e368,args:_0x3e5b4e,tdx:_0x4b2317}=_0x273e7c,_0x48d903=_0x3e5b4e[0x0];if(!requireNameOrPath(_0x48d903))return 0x1;_0x34e368[_0xda1118(0x268)]&&console['error'](_0xda1118(0x25c)+_0x48d903);const {journeyId:_0x2a76d0,journeyName:_0x4ab31b}=await resolveJourneyIdFromInput(_0x48d903,_0x34e368,_0x4b2317);if(!_0x34e368['yes']){const _0xd581c3=await confirm(_0xda1118(0x16e)+_0x4ab31b+'\x22?');if(!_0xd581c3)return console[_0xda1118(0x20b)](_0xda1118(0x195)),0x0;}const _0x282db1=await withSpinner(_0xda1118(0x174),()=>_0x4b2317['journey'][_0xda1118(0x251)](_0x2a76d0),{'verbose':_0x34e368[_0xda1118(0x268)]}),_0x3a5912=_0x282db1[_0xda1118(0x1e7)];return console[_0xda1118(0x20b)](_0xda1118(0x21c)+_0x3a5912[_0xda1118(0x21a)][_0xda1118(0x266)]+_0xda1118(0x190)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x1ccf16(0x266)]=a27_0x1ccf16(0x259);[a27_0x1ccf16(0x23c)]=a27_0x1ccf16(0x1cc);async[a27_0x1ccf16(0x19b)](_0x1b0d51){const _0x2cec1b=a27_0x1ccf16,{options:_0x40b81a,args:_0x4260be,tdx:_0x18a23f}=_0x1b0d51,_0x3bc085=_0x40b81a,_0x525b7c=_0x4260be[0x0],_0x111d36=_0x525b7c&&isYamlFilePath(_0x525b7c),_0x4e37c2=await resolveTarget({'arg':_0x111d36?_0x525b7c:undefined,'contextParent':_0x40b81a[_0x2cec1b(0x1bd)],'cwd':process[_0x2cec1b(0x241)]()});if(!isSuccessfulResolution(_0x4e37c2))return _0x4e37c2['errorCode']==='no_parent'?(console[_0x2cec1b(0x20b)](a27_0x3af12a[_0x2cec1b(0x21f)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2cec1b(0x20b)]('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)'),console[_0x2cec1b(0x20b)](_0x2cec1b(0x217)),console[_0x2cec1b(0x20b)](_0x2cec1b(0x184)),console[_0x2cec1b(0x20b)](_0x2cec1b(0x22a))):(console[_0x2cec1b(0x20b)](a27_0x3af12a[_0x2cec1b(0x1b3)]('Error:\x20'+_0x4e37c2[_0x2cec1b(0x1c8)]+'\x0a')),_0x4e37c2[_0x2cec1b(0x1a7)]&&console[_0x2cec1b(0x20b)](a27_0x3af12a[_0x2cec1b(0x243)](_0x4e37c2[_0x2cec1b(0x1a7)]))),0x1;let _0x5ce94f=_0x111d36?undefined:_0x525b7c,_0x5c680e,_0x128294;_0x4e37c2[_0x2cec1b(0x172)]===_0x2cec1b(0x16a)&&(_0x5ce94f=_0x4e37c2[_0x2cec1b(0x20f)],_0x5c680e=_0x4e37c2[_0x2cec1b(0x212)],_0x128294=_0x4e37c2[_0x2cec1b(0x177)]);const _0x4f89a7=_0x4e37c2['parentName'],_0x244bd1=_0x4e37c2['targetDir'];_0x3bc085[_0x2cec1b(0x268)]&&(console['error']('Parent\x20segment:\x20'+_0x4f89a7),console[_0x2cec1b(0x20b)](_0x2cec1b(0x1e4)+_0x244bd1),_0x5ce94f&&console[_0x2cec1b(0x20b)](_0x2cec1b(0x19d)+_0x5ce94f),_0x5c680e&&console[_0x2cec1b(0x20b)](_0x2cec1b(0x24a)+_0x5c680e),_0x128294&&console['error']('Folder\x20path:\x20'+_0x128294));const _0x31bbe0=await withSpinner(_0x2cec1b(0x18d),()=>_0x18a23f[_0x2cec1b(0x170)][_0x2cec1b(0x223)](_0x4f89a7),{'verbose':_0x40b81a[_0x2cec1b(0x268)]}),_0x21cb82=_0x31bbe0[_0x2cec1b(0x1e7)],{journeys:_0x57b2fc,folders:_0x3c528f}=await withSpinner(_0x2cec1b(0x1f4),async()=>{const _0x490cba=_0x2cec1b,[_0x21f263,_0x393be5]=await Promise[_0x490cba(0x181)]([_0x18a23f[_0x490cba(0x218)][_0x490cba(0x166)](_0x21cb82,undefined,{'includeAllVersions':!![]}),_0x18a23f[_0x490cba(0x170)][_0x490cba(0x273)](_0x21cb82)]);return{'journeys':_0x21f263,'folders':_0x393be5};},{'verbose':_0x40b81a['verbose']})[_0x2cec1b(0x1f5)](_0x1fd049=>_0x1fd049[_0x2cec1b(0x1e7)]);let _0x2299ed=_0x57b2fc;const _0x5dc01a=buildFolderIdToPathMap(_0x3c528f);if(_0x5ce94f){const _0x3fd073=_0x2299ed[_0x2cec1b(0x205)](_0x4a65a4=>_0x4a65a4[_0x2cec1b(0x240)]['toLowerCase']()===_0x5ce94f[_0x2cec1b(0x1d7)]());if(_0x3fd073[_0x2cec1b(0x186)]===0x0)return console['error'](_0x2cec1b(0x1b6)+_0x5ce94f),console['error']('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x2299ed=_0x3fd073;}if(_0x128294!==undefined){const _0x417d9f=_0x2299ed[_0x2cec1b(0x205)](_0x4813c7=>{const _0x2b0210=_0x2cec1b,_0x34a3ce=_0x4813c7[_0x2b0210(0x249)]?_0x5dc01a[_0x2b0210(0x1ca)](_0x4813c7[_0x2b0210(0x249)])||'':'';return _0x34a3ce===_0x128294;});if(_0x417d9f['length']===0x0&&_0x2299ed[_0x2cec1b(0x186)]>0x0){console[_0x2cec1b(0x20b)](_0x2cec1b(0x200)+_0x5ce94f+_0x2cec1b(0x1d3)+(_0x128294||_0x2cec1b(0x1cf))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x5e2e78 of _0x2299ed){const _0x21b547=_0x5e2e78['folderId']?_0x5dc01a[_0x2cec1b(0x1ca)](_0x5e2e78[_0x2cec1b(0x249)])||'':'';console['error'](_0x2cec1b(0x1d1)+(_0x21b547||_0x2cec1b(0x1b7))+'/'+_0x5e2e78[_0x2cec1b(0x240)]);}return 0x1;}_0x2299ed=_0x417d9f;}if(_0x2299ed['length']===0x0)return console[_0x2cec1b(0x20b)]('No\x20journeys\x20found'),0x0;const _0x517166=new Map();for(const _0x3c467b of _0x2299ed){const _0x4b145f=_0x3c467b[_0x2cec1b(0x1b4)];!_0x517166[_0x2cec1b(0x1ed)](_0x4b145f)&&_0x517166['set'](_0x4b145f,[]),_0x517166['get'](_0x4b145f)[_0x2cec1b(0x1ba)](_0x3c467b);}for(const _0x56b5db of _0x517166[_0x2cec1b(0x193)]()){_0x56b5db['sort']((_0x38f03f,_0x5a3fff)=>(_0x38f03f[_0x2cec1b(0x18e)]||0x0)-(_0x5a3fff[_0x2cec1b(0x18e)]||0x0));}const _0x7dd3dc=[],{idToEmailMap:_0x4fbb9c,connectionIdToNameMap:_0x366725}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x17e9bd=_0x2cec1b,[_0x340fe8,_0x21fd49]=await Promise[_0x17e9bd(0x181)]([_0x18a23f[_0x17e9bd(0x22c)][_0x17e9bd(0x1fb)](),_0x18a23f[_0x17e9bd(0x1a9)][_0x17e9bd(0x175)]()]);return{'idToEmailMap':_0x340fe8,'connectionIdToNameMap':_0x21fd49};},{'verbose':_0x40b81a[_0x2cec1b(0x268)]})['then'](_0x2fa4e0=>_0x2fa4e0['data']);for(const _0x106c73 of _0x517166[_0x2cec1b(0x193)]()){const _0x3584ee=_0x106c73[0x0][_0x2cec1b(0x240)],_0x451b74=_0x106c73[0x0][_0x2cec1b(0x249)],_0x65c59d=_0x451b74?_0x5dc01a[_0x2cec1b(0x1ca)](_0x451b74)||'':'',_0x3b52d3=_0x65c59d?a27_0xce06a6[_0x2cec1b(0x219)](_0x244bd1,_0x65c59d):_0x244bd1,_0x4093b4=_0x5c680e||a27_0xce06a6['join'](_0x3b52d3,sanitizeFileName(_0x3584ee)+_0x2cec1b(0x272));let _0x2486cf,_0x35e479;if(existsSync(_0x4093b4))try{const _0x373220=readFileSync(_0x4093b4,'utf-8'),_0x5024d8=parseYamlString(_0x373220);_0x35e479=_0x5024d8,_0x2486cf=buildRuleToNameMapping(_0x5024d8),_0x3bc085[_0x2cec1b(0x268)]&&_0x2486cf[_0x2cec1b(0x1bf)]>0x0&&console[_0x2cec1b(0x20b)]('Found\x20'+_0x2486cf[_0x2cec1b(0x1bf)]+_0x2cec1b(0x1dc)+_0x3584ee);}catch(_0x374622){_0x3bc085['verbose']&&console['error'](_0x2cec1b(0x1fa)+_0x374622[_0x2cec1b(0x1c8)]);}const _0x243929=[],_0x47ff4e=new Set(),_0xf0f2b7=new Map(),_0x4ee185=new Map(),_0x2734e3=new Set(),_0x3d9794=new Map(),_0x59f730=new Map(),_0x16f5a8=createJumpTargetCache();await withProgressSpinner(_0x2cec1b(0x26c)+_0x3584ee+_0x2cec1b(0x176),async _0x2f981a=>{const _0x543df1=_0x2cec1b;for(const _0x50939e of _0x106c73){const _0x1bb2f3=_0x106c73[_0x543df1(0x186)]>0x1?_0x50939e[_0x543df1(0x240)]+'\x20v'+(_0x50939e[_0x543df1(0x18e)]||0x1):_0x50939e[_0x543df1(0x240)];_0x2f981a['setPhase'](_0x543df1(0x26c)+_0x1bb2f3);const _0xc1e69b=await _0x18a23f['journey'][_0x543df1(0x1f1)](_0x50939e['id']),_0x1c7eee=_0xc1e69b[_0x543df1(0x21a)]?.[_0x543df1(0x208)],_0x53bb26={'resolveSegment':async _0x3f6d45=>{const _0x470815=_0x543df1;if(!_0x1c7eee)return{'name':_0x3f6d45,'isJourneyLocal':![]};const _0x1850c1=_0xf0f2b7[_0x470815(0x1ca)](_0x3f6d45);if(_0x1850c1)return _0x1850c1;try{const _0x9867e=await _0x18a23f[_0x470815(0x170)][_0x470815(0x199)](_0x1c7eee,_0x3f6d45),_0x53c0ec=_0x9867e[_0x470815(0x214)]===SEGMENT_KIND_JOURNEY;let _0x32222d,_0x307a6d=_0x9867e[_0x470815(0x266)];if(_0x53c0ec&&_0x9867e['rule']){const _0x4197c6=await segmentResponseToDef(_0x9867e,{'resolveSegmentName':async _0x26b749=>{const _0x39c8d3=_0x470815,_0x10c12d=_0xf0f2b7[_0x39c8d3(0x1ca)](_0x26b749);if(_0x10c12d)return _0x10c12d[_0x39c8d3(0x266)];const _0x18866e=await _0x53bb26[_0x39c8d3(0x220)](_0x26b749);return _0x18866e[_0x39c8d3(0x266)];}}),_0x59b7cd=_0x4197c6[_0x470815(0x19e)];_0x32222d={'description':_0x9867e[_0x470815(0x23c)],'rule':_0x59b7cd};const _0x13cabd=serializeRule(_0x59b7cd),_0x443254=_0x4ee185[_0x470815(0x1ca)](_0x13cabd);if(_0x443254)_0x307a6d=_0x443254,_0x32222d=undefined,_0x3bc085['verbose']&&console['error'](_0x470815(0x216)+_0x9867e[_0x470815(0x266)]+_0x470815(0x246)+_0x443254);else{let _0x349896=![];if(_0x2486cf){const _0x515e34=_0x2486cf[_0x470815(0x1ca)](_0x13cabd);if(_0x515e34){const _0x1eb8fa=_0x515e34[_0x470815(0x271)](_0x2cc8b6=>!_0x47ff4e[_0x470815(0x1ed)](_0x2cc8b6));_0x1eb8fa&&(_0x307a6d=_0x1eb8fa,_0x47ff4e[_0x470815(0x25a)](_0x1eb8fa),_0x4ee185[_0x470815(0x24e)](_0x13cabd,_0x1eb8fa),_0x349896=!![],_0x3bc085[_0x470815(0x268)]&&console['error'](_0x470815(0x187)+_0x1eb8fa+_0x470815(0x263)));}}if(!_0x349896){const _0x3c5eb2=generateJourneyLocalName(_0x9867e[_0x470815(0x266)]);_0x3c5eb2&&(_0x307a6d=_0x3c5eb2);let _0x50ec88=_0x307a6d,_0x45345a=0x2;while(_0x47ff4e[_0x470815(0x1ed)](_0x50ec88)){_0x50ec88=_0x307a6d+'_'+_0x45345a,_0x45345a++;}_0x47ff4e[_0x470815(0x25a)](_0x50ec88),_0x4ee185[_0x470815(0x24e)](_0x13cabd,_0x50ec88),_0x307a6d=_0x50ec88;}}}const _0x46ff63={'name':_0x307a6d,'isJourneyLocal':_0x53c0ec,'definition':_0x32222d};return _0xf0f2b7[_0x470815(0x24e)](_0x3f6d45,_0x46ff63),_0x46ff63;}catch(_0x119cbe){return _0x40b81a[_0x470815(0x268)]&&console[_0x470815(0x20b)](_0x470815(0x1be)+_0x3f6d45+':\x20'+_0x119cbe['message']),{'name':_0x3f6d45,'isJourneyLocal':![]};}},'resolveActivation':async _0x2c350c=>{const _0x26ba79=_0x543df1,_0x11daf7=_0x3d9794[_0x26ba79(0x1ca)](_0x2c350c);if(_0x11daf7)return _0x11daf7;try{const _0x525559=await _0x18a23f[_0x26ba79(0x218)][_0x26ba79(0x189)](_0x50939e['id'],_0x2c350c),_0x171121=journeyActivationStepToYaml(_0x525559,_0x4fbb9c,_0x366725),_0xf049a=JSON[_0x26ba79(0x239)]({'name':_0x171121[_0x26ba79(0x266)],'connection':_0x171121[_0x26ba79(0x1a9)],'connector_config':_0x171121[_0x26ba79(0x16c)]}),_0x3f4cab=_0x59f730['get'](_0xf049a);if(_0x3f4cab){const _0x409bbc={'name':_0x3f4cab,'isJourneyLocal':!![],'definition':_0x171121};return _0x3d9794[_0x26ba79(0x24e)](_0x2c350c,_0x409bbc),_0x409bbc;}const _0xd2a45f=_0x525559[_0x26ba79(0x21a)][_0x26ba79(0x23e)][_0x26ba79(0x266)]||_0x2c350c,_0x1a7fad=sanitizeYamlKey(_0xd2a45f)||_0x26ba79(0x230)+_0x2c350c;let _0xc746e3=_0x1a7fad,_0xfbaa5f=0x2;while(_0x2734e3[_0x26ba79(0x1ed)](_0xc746e3)){_0xc746e3=_0x1a7fad+'_'+_0xfbaa5f,_0xfbaa5f++;}_0x2734e3['add'](_0xc746e3),_0x59f730[_0x26ba79(0x24e)](_0xf049a,_0xc746e3);const _0x3b8761={'name':_0xc746e3,'isJourneyLocal':!![],'definition':_0x171121};return _0x3d9794['set'](_0x2c350c,_0x3b8761),_0x3b8761;}catch(_0x2523d8){return _0x40b81a[_0x26ba79(0x268)]&&console[_0x26ba79(0x20b)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x2c350c+':\x20'+_0x2523d8['message']),{'name':_0x2c350c,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1be8d6,_0x181fa9)=>{const _0x376518=_0x543df1;return resolveJumpTarget(_0x1be8d6,_0x181fa9,_0x16f5a8,_0xc77bad=>_0x18a23f[_0x376518(0x218)][_0x376518(0x1f1)](_0xc77bad));}},_0x5a4380=await journeyResponseToDef(_0xc1e69b,_0x53bb26);_0x243929[_0x543df1(0x1ba)]({'item':_0x50939e,'yaml':_0x5a4380});}},{'verbose':_0x40b81a['verbose']});const _0x29d030=await _0x18a23f['journey'][_0x2cec1b(0x24b)](_0x106c73[0x0][_0x2cec1b(0x1b4)]),_0xace144=buildMergedJourneyDef(_0x243929,_0x2486cf,_0x29d030),_0xfc2783=normalizeJourneyDef(_0xace144,_0x35e479),_0x35ecb7=toYamlString(_0xfc2783),_0x20f798=_0x5c680e||a27_0xce06a6[_0x2cec1b(0x219)](_0x3b52d3,sanitizeFileName(_0x3584ee)+'.yml');!_0x5c680e&&_0x65c59d&&!existsSync(_0x3b52d3)&&mkdirSync(_0x3b52d3,{'recursive':!![]});const _0x379f49=a27_0xce06a6[_0x2cec1b(0x17c)](process[_0x2cec1b(0x241)](),_0x20f798);if(existsSync(_0x20f798)){const _0x11aaeb=readFileSync(_0x20f798,_0x2cec1b(0x1ad)),_0x4c7a31=generateDiff(_0x11aaeb,_0x35ecb7),_0x3a1cc0=hasChanges(_0x4c7a31);_0x7dd3dc[_0x2cec1b(0x1ba)]({'relativePath':_0x379f49,'absolutePath':_0x20f798,'content':_0x35ecb7,'isNew':![],'hasChanges':_0x3a1cc0,'diff':_0x3a1cc0?formatDiffWithColors(_0x4c7a31):undefined});}else _0x7dd3dc[_0x2cec1b(0x1ba)]({'relativePath':_0x379f49,'absolutePath':_0x20f798,'content':_0x35ecb7,'isNew':!![],'hasChanges':![]});}const _0x7eeb18=_0x7dd3dc['filter'](_0x322ab8=>_0x322ab8[_0x2cec1b(0x19a)]),_0x17d771=_0x7dd3dc[_0x2cec1b(0x205)](_0x48133d=>!_0x48133d['isNew']&&_0x48133d[_0x2cec1b(0x163)]),_0x158f6e=_0x7dd3dc[_0x2cec1b(0x205)](_0x500430=>!_0x500430[_0x2cec1b(0x19a)]&&!_0x500430[_0x2cec1b(0x163)]),_0x3ed5ff=_0x2299ed[_0x2cec1b(0x186)],_0x16e130=_0x517166[_0x2cec1b(0x1bf)],_0x128151=_0x3ed5ff>_0x16e130?'\x20('+_0x3ed5ff+_0x2cec1b(0x221):'';console['error'](_0x2cec1b(0x26e)),console['error']('\x20\x20'+a27_0x3af12a[_0x2cec1b(0x243)](_0x16e130+_0x2cec1b(0x25b))+a27_0x3af12a[_0x2cec1b(0x244)](_0x128151)),console[_0x2cec1b(0x20b)]('\x20\x20'+a27_0x3af12a[_0x2cec1b(0x1fc)]('+\x20'+_0x7eeb18[_0x2cec1b(0x186)]+_0x2cec1b(0x204))),console[_0x2cec1b(0x20b)]('\x20\x20'+a27_0x3af12a[_0x2cec1b(0x21f)]('~\x20'+_0x17d771[_0x2cec1b(0x186)]+_0x2cec1b(0x22b))),console[_0x2cec1b(0x20b)]('\x20\x20'+a27_0x3af12a[_0x2cec1b(0x244)]('=\x20'+_0x158f6e[_0x2cec1b(0x186)]+'\x20unchanged\x20files')),console[_0x2cec1b(0x20b)](_0x2cec1b(0x1d5)+a27_0x3af12a['cyan'](_0x244bd1)+'\x0a');if(_0x17d771[_0x2cec1b(0x186)]>0x0)for(const _0x51a6c6 of _0x17d771){console[_0x2cec1b(0x20b)](_0x2cec1b(0x250)+_0x51a6c6[_0x2cec1b(0x1e9)]+'\x27:'),console[_0x2cec1b(0x20b)]('─'[_0x2cec1b(0x19f)](0x3c)),console['error'](_0x51a6c6[_0x2cec1b(0x262)]),console[_0x2cec1b(0x20b)]('─'[_0x2cec1b(0x19f)](0x3c));}if(_0x3bc085[_0x2cec1b(0x242)])return console[_0x2cec1b(0x20b)](a27_0x3af12a[_0x2cec1b(0x21f)](_0x2cec1b(0x1f8))),0x0;if(_0x7eeb18['length']===0x0&&_0x17d771[_0x2cec1b(0x186)]===0x0)return console[_0x2cec1b(0x20b)](a27_0x3af12a[_0x2cec1b(0x1fc)](_0x2cec1b(0x261))),saveSessionContext({'parent_segment':_0x4f89a7},_0x3bc085[_0x2cec1b(0x19c)]),console['error'](a27_0x3af12a[_0x2cec1b(0x1fc)](_0x2cec1b(0x1d0)+a27_0x3af12a[_0x2cec1b(0x244)](_0x2cec1b(0x26f))+'\x20=\x20'+a27_0x3af12a[_0x2cec1b(0x243)](_0x4f89a7))),0x0;if(!_0x3bc085[_0x2cec1b(0x238)]&&(_0x7eeb18[_0x2cec1b(0x186)]>0x0||_0x17d771[_0x2cec1b(0x186)]>0x0)){if(!isInteractive())return console[_0x2cec1b(0x20b)](a27_0x3af12a[_0x2cec1b(0x1b3)]('\x0aError:'),_0x2cec1b(0x1c3)),console['error'](a27_0x3af12a[_0x2cec1b(0x244)](_0x2cec1b(0x267))),0x1;const _0x4ef287=await confirmKey(_0x2cec1b(0x17d)+(_0x7eeb18[_0x2cec1b(0x186)]+_0x17d771[_0x2cec1b(0x186)])+_0x2cec1b(0x1b5));if(!_0x4ef287)return console['error'](a27_0x3af12a[_0x2cec1b(0x21f)](_0x2cec1b(0x20a)),_0x2cec1b(0x169)),0x1;}!existsSync(_0x244bd1)&&mkdirSync(_0x244bd1,{'recursive':!![]});const _0x6f744f=a27_0xce06a6[_0x2cec1b(0x219)](_0x244bd1,_0x2cec1b(0x23a));writeFileSync(_0x6f744f,createTdxConfigContent(_0x4f89a7),'utf-8');for(const _0x49bc79 of _0x7dd3dc){(_0x49bc79['isNew']||_0x49bc79['hasChanges'])&&writeFileSync(_0x49bc79[_0x2cec1b(0x213)],_0x49bc79[_0x2cec1b(0x26d)],'utf-8');}return console[_0x2cec1b(0x20b)](a27_0x3af12a[_0x2cec1b(0x1fc)](_0x2cec1b(0x168)+(_0x7eeb18['length']+_0x17d771[_0x2cec1b(0x186)])+_0x2cec1b(0x1c6)+_0x244bd1)),saveSessionContext({'parent_segment':_0x4f89a7},_0x3bc085[_0x2cec1b(0x19c)]),console[_0x2cec1b(0x20b)](a27_0x3af12a[_0x2cec1b(0x1fc)](_0x2cec1b(0x1d0)+a27_0x3af12a[_0x2cec1b(0x244)](_0x2cec1b(0x26f))+'\x20=\x20'+a27_0x3af12a[_0x2cec1b(0x243)](_0x4f89a7))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x1ccf16(0x266)]=a27_0x1ccf16(0x253);['description']=a27_0x1ccf16(0x237);async['execute'](_0x199e68){const _0x34a8fb=a27_0x1ccf16,{options:_0x46e4fc,args:_0xbc6adf,tdx:_0xff338a}=_0x199e68,_0x5d6669=_0xbc6adf[0x0];if(!requireNameOrPath(_0x5d6669))return 0x1;_0x46e4fc[_0x34a8fb(0x268)]&&console[_0x34a8fb(0x20b)](_0x34a8fb(0x25c)+_0x5d6669);const {journeyId:_0x45ee17}=await resolveJourneyIdFromInput(_0x5d6669,_0x46e4fc,_0xff338a),_0x216de1=await withSpinner(_0x34a8fb(0x248),()=>_0xff338a[_0x34a8fb(0x218)]['getColumnMapping'](_0x45ee17),{'verbose':_0x46e4fc[_0x34a8fb(0x268)]}),_0x53d33b=_0x216de1[_0x34a8fb(0x1e7)];return console[_0x34a8fb(0x1c1)](_0x34a8fb(0x22d)+_0x53d33b[_0x34a8fb(0x180)]),console[_0x34a8fb(0x1c1)]('Table:\x20'+_0x53d33b['table']),await handleSDKOutput(_0x53d33b['columns'],_0x46e4fc),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x1ccf16(0x266)]='journey:activations';['description']=a27_0x1ccf16(0x18f);async[a27_0x1ccf16(0x19b)](_0x62fc1d){const _0x548375=a27_0x1ccf16,{options:_0x26f4b0,args:_0x3a08b6,tdx:_0x4631b4}=_0x62fc1d,_0x331680=_0x3a08b6[0x0];if(!requireNameOrPath(_0x331680))return 0x1;_0x26f4b0[_0x548375(0x268)]&&console[_0x548375(0x20b)](_0x548375(0x25c)+_0x331680);const {journeyId:_0x1b3ae4}=await resolveJourneyIdFromInput(_0x331680,_0x26f4b0,_0x4631b4),_0x5c2bd2=await withSpinner(_0x548375(0x255),()=>_0x4631b4[_0x548375(0x218)][_0x548375(0x257)](_0x1b3ae4),{'verbose':_0x26f4b0['verbose']}),_0x537b8f=_0x5c2bd2[_0x548375(0x1e7)];return console[_0x548375(0x20b)](_0x548375(0x226)+_0x537b8f[_0x548375(0x186)]+_0x548375(0x1e3)+(_0x537b8f['length']!==0x1?'s':'')),await handleSDKOutput(_0x537b8f,_0x26f4b0),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x1ccf16(0x266)]='journey:push';[a27_0x1ccf16(0x23c)]=a27_0x1ccf16(0x1c2);[a27_0x1ccf16(0x1d6)]=new SegmentPushCommand();async[a27_0x1ccf16(0x19b)](_0x3ab978){const _0x1c1ecf=a27_0x1ccf16,_0x57f02e=_0x3ab978[_0x1c1ecf(0x1b2)][0x0];let _0x526f97;if(_0x57f02e){const _0xd25d91=await resolveTarget({'arg':_0x57f02e,'contextParent':_0x3ab978['options'][_0x1c1ecf(0x1bd)],'cwd':process[_0x1c1ecf(0x241)]()});isSuccessfulResolution(_0xd25d91)&&_0xd25d91['type']==='file'&&(_0x526f97=_0xd25d91['filePath']);}const _0x252a1e={..._0x3ab978,'options':{..._0x3ab978[_0x1c1ecf(0x1d8)],'journeysOnly':!![],..._0x526f97&&{'singleFilePath':_0x526f97}}};return this[_0x1c1ecf(0x1d6)]['execute'](_0x252a1e);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x1ccf16(0x266)]=a27_0x1ccf16(0x24c);[a27_0x1ccf16(0x23c)]=a27_0x1ccf16(0x222);async[a27_0x1ccf16(0x19b)](_0xcd8057){const _0x5b4cc1=a27_0x1ccf16,{options:_0x3279c1,args:_0x308aaf,tdx:_0x47ee44}=_0xcd8057,_0x51a1ce=_0x308aaf[0x0];if(!requireNameOrPath(_0x51a1ce))return 0x1;if(_0x3279c1['verbose'])console[_0x5b4cc1(0x20b)]('Input:\x20'+_0x51a1ce);const {journeyId:_0x1aa475}=await resolveJourneyIdFromInput(_0x51a1ce,_0x3279c1,_0x47ee44),_0x586651=await withSpinner(_0x5b4cc1(0x21b),()=>_0x47ee44[_0x5b4cc1(0x218)][_0x5b4cc1(0x1c9)](_0x1aa475),{'verbose':_0x3279c1[_0x5b4cc1(0x268)]}),{bundleName:_0xdff4cc,versions:_0x26a0a3,latestJourneyId:_0x430f13}=_0x586651['data'];console['error'](_0xdff4cc+':\x20'+_0x26a0a3[_0x5b4cc1(0x186)]+_0x5b4cc1(0x1ab)+(_0x26a0a3[_0x5b4cc1(0x186)]!==0x1?'s':''));const _0x1e87fd=_0x26a0a3[_0x5b4cc1(0x179)](_0x521541=>({'version':_0x521541['versionNumber'],'journey_id':_0x521541[_0x5b4cc1(0x1e6)],'name':_0x521541[_0x5b4cc1(0x266)],'state':_0x521541[_0x5b4cc1(0x188)],'paused':_0x521541[_0x5b4cc1(0x1af)],'latest':_0x521541[_0x5b4cc1(0x1e6)]===_0x430f13,'created_at':_0x521541[_0x5b4cc1(0x24f)]}));return await handleSDKOutput(_0x1e87fd,_0x3279c1),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x1ccf16(0x266)]=a27_0x1ccf16(0x26b);[a27_0x1ccf16(0x23c)]=a27_0x1ccf16(0x209);async[a27_0x1ccf16(0x19b)](_0x39dcb0){const _0x5236b3=a27_0x1ccf16,{options:_0x48cf9a,args:_0x22646b,tdx:_0x12e9c3}=_0x39dcb0,_0x14a655=_0x22646b[0x0];if(!requireNameOrPath(_0x14a655))return 0x1;if(_0x48cf9a[_0x5236b3(0x268)])console[_0x5236b3(0x20b)](_0x5236b3(0x25c)+_0x14a655);const {journeyId:_0x2513f9,journeyName:_0x317d12}=await resolveJourneyIdFromInput(_0x14a655,_0x48cf9a,_0x12e9c3);if(!_0x48cf9a[_0x5236b3(0x238)]){const _0x5ca3e8=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x317d12+'\x22?');if(!_0x5ca3e8)return console[_0x5236b3(0x20b)](_0x5236b3(0x195)),0x0;}const _0x47b542=await withSpinner('Creating\x20new\x20version...',()=>_0x12e9c3[_0x5236b3(0x218)][_0x5236b3(0x215)](_0x2513f9),{'verbose':_0x48cf9a[_0x5236b3(0x268)]}),_0x41858f=_0x47b542['data'];return console[_0x5236b3(0x20b)](a27_0x3af12a['green']('✔')+_0x5236b3(0x1c0)+_0x41858f[_0x5236b3(0x21a)][_0x5236b3(0x18e)]+_0x5236b3(0x233)+_0x41858f['attributes']['name']+'\x22'),console[_0x5236b3(0x20b)](_0x5236b3(0x1b0)+_0x41858f['id']),await handleSingleObjectOutput({'id':_0x41858f['id'],'name':_0x41858f[_0x5236b3(0x21a)][_0x5236b3(0x266)],'version':_0x41858f['attributes'][_0x5236b3(0x18e)],'state':_0x41858f['attributes']['state'],'bundle_id':_0x41858f[_0x5236b3(0x21a)][_0x5236b3(0x1b4)],'created_at':_0x41858f[_0x5236b3(0x21a)][_0x5236b3(0x24f)]},_0x48cf9a),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x1ccf16(0x266)]=a27_0x1ccf16(0x234);[a27_0x1ccf16(0x23c)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x1ccf16(0x19b)](_0x504d28){const _0xacfd05=a27_0x1ccf16,{options:_0x218434,args:_0x5549b0,tdx:_0x358b65}=_0x504d28,_0x40c271=_0x5549b0[0x0];if(!requireNameOrPath(_0x40c271))return 0x1;const _0x133b82=_0x218434[_0xacfd05(0x227)];if(!_0x133b82)return console[_0xacfd05(0x20b)](_0xacfd05(0x25f)),console[_0xacfd05(0x20b)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0xc0834e=parseInt(_0x133b82,0xa);if(isNaN(_0xc0834e)||_0xc0834e<0x1)return console['error'](_0xacfd05(0x24d)+_0x133b82),0x1;if(_0x218434['verbose'])console[_0xacfd05(0x20b)]('Input:\x20'+_0x40c271+',\x20version:\x20'+_0xc0834e);const {journeyId:_0x1224cc,parentSegmentId:_0x1ed227}=await resolveJourneyIdFromInput(_0x40c271,_0x218434,_0x358b65),_0x37068a=await withSpinner(_0xacfd05(0x1ea),()=>_0x358b65['journey'][_0xacfd05(0x1c9)](_0x1224cc),{'verbose':_0x218434[_0xacfd05(0x268)]}),{versions:_0x403c5d,latestJourneyId:_0x48bef6}=_0x37068a[_0xacfd05(0x1e7)],_0x865b72=_0x403c5d['find'](_0x5587d2=>_0x5587d2[_0xacfd05(0x18e)]===_0xc0834e);if(!_0x865b72){const _0x4d4b09=_0x403c5d[_0xacfd05(0x179)](_0x48c4f6=>'v'+_0x48c4f6[_0xacfd05(0x18e)])[_0xacfd05(0x219)](',\x20');return console[_0xacfd05(0x20b)](_0xacfd05(0x1a5)+_0xc0834e+_0xacfd05(0x197)+_0x4d4b09),0x1;}const _0x14e00f=await withSpinner(_0xacfd05(0x17a)+_0xc0834e+'\x20details...',()=>_0x358b65[_0xacfd05(0x218)][_0xacfd05(0x1f1)](_0x865b72[_0xacfd05(0x1e6)]),{'verbose':_0x218434[_0xacfd05(0x268)]}),_0x24e900=_0x14e00f[_0xacfd05(0x1e7)],_0x40a517=getConsoleNextUrl(_0x218434['site'],_0xacfd05(0x178)+_0x1ed227+_0xacfd05(0x1a2)+_0x865b72[_0xacfd05(0x1e6)]+_0xacfd05(0x1e8));return await handleSingleObjectOutput({'id':_0x24e900['id'],'name':_0x24e900[_0xacfd05(0x21a)][_0xacfd05(0x266)],'version':_0x24e900[_0xacfd05(0x21a)][_0xacfd05(0x18e)],'description':_0x24e900[_0xacfd05(0x21a)][_0xacfd05(0x23c)],'state':_0x24e900['attributes'][_0xacfd05(0x188)],'paused':_0x24e900['attributes'][_0xacfd05(0x1af)],'reentry_mode':_0x24e900[_0xacfd05(0x21a)]['reentryMode'],'stages':_0x24e900['attributes'][_0xacfd05(0x207)]?.[_0xacfd05(0x186)]||0x0,..._0x24e900[_0xacfd05(0x21a)]['goal']&&{'goal':_0x24e900['attributes'][_0xacfd05(0x1de)][_0xacfd05(0x266)]},'latest':_0x865b72[_0xacfd05(0x1e6)]===_0x48bef6,'created_at':_0x24e900[_0xacfd05(0x21a)][_0xacfd05(0x24f)],'updated_at':_0x24e900[_0xacfd05(0x21a)][_0xacfd05(0x1f0)],'url':_0x40a517},_0x218434),0x0;}}
@@ -1 +1 @@
1
- const a29_0x328bdf=a29_0x49e1;(function(_0x3ec81e,_0x2557df){const _0x2aa990=a29_0x49e1,_0x274a1d=_0x3ec81e();while(!![]){try{const _0x245ba5=parseInt(_0x2aa990(0x1b0))/0x1*(parseInt(_0x2aa990(0x1b8))/0x2)+parseInt(_0x2aa990(0x1dc))/0x3*(parseInt(_0x2aa990(0x1e4))/0x4)+-parseInt(_0x2aa990(0x1bf))/0x5*(-parseInt(_0x2aa990(0x1cd))/0x6)+-parseInt(_0x2aa990(0x1df))/0x7+-parseInt(_0x2aa990(0x1d4))/0x8+-parseInt(_0x2aa990(0x1c9))/0x9+parseInt(_0x2aa990(0x1d8))/0xa*(parseInt(_0x2aa990(0x1c7))/0xb);if(_0x245ba5===_0x2557df)break;else _0x274a1d['push'](_0x274a1d['shift']());}catch(_0xc82cf7){_0x274a1d['push'](_0x274a1d['shift']());}}}(a29_0x2336,0x1cd59));function a29_0x2336(){const _0x5ccb9f=['\x20valid','Validation\x20failed:\x20','type','warningCount','134005yzzSNH','Error:\x20Directory\x20not\x20found:\x20','reason','\x20segment\x20file(s)\x20skipped','relativePath','red','targetDir','\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','1847747lzBYNy','Validate\x20journey\x20YAML\x20files','16164pOmRJR','filter','skippedCount','\x20error(s)','18UylLsh','log','No\x20journey\x20YAML\x20files\x20found\x20in\x20','hasErrors','\x20warning(s)\x20found','warnings','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','1386520oojvEP','name','journey:validate','\x20warning(s)','10AGAteW','.yaml','invalidCount','file','6nNJCgf','✔\x20All\x20','validCount','126112tPBSDy','valid','dim','verbose','\x20journey(s)\x20valid','3084POPjuI','cwd','errorCode','error','endsWith','6131tObQDC','length','helpText','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','errors','.yml','\x20journey(s)\x20with\x20errors,\x20','yellow','20RIynHQ','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','green'];a29_0x2336=function(){return _0x5ccb9f;};return a29_0x2336();}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0x1fe165 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a29_0x49e1(_0x4cb966,_0x2b9ef2){_0x4cb966=_0x4cb966-0x1b0;const _0x233697=a29_0x2336();let _0x49e110=_0x233697[_0x4cb966];return _0x49e110;}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a29_0x328bdf(0x1d5)]=a29_0x328bdf(0x1d6);['description']=a29_0x328bdf(0x1c8);async['execute'](_0x53959e){const _0x40f5df=a29_0x328bdf,{options:_0x1a2db3,args:_0x3ccea4}=_0x53959e,_0x1cf06c=_0x1a2db3,_0x136ddc=await resolveTarget({'arg':_0x3ccea4[0x0],'contextParent':_0x1a2db3['parentSegment'],'cwd':process[_0x40f5df(0x1e5)]()});if(!isSuccessfulResolution(_0x136ddc))return _0x136ddc[_0x40f5df(0x1e6)]==='no_parent'?(console[_0x40f5df(0x1e7)](a29_0x1fe165[_0x40f5df(0x1b7)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x40f5df(0x1e7)](_0x40f5df(0x1b3)),console[_0x40f5df(0x1e7)](_0x40f5df(0x1c6)),console[_0x40f5df(0x1e7)](_0x40f5df(0x1b9))):(console['error'](a29_0x1fe165[_0x40f5df(0x1c4)]('Error:\x20'+_0x136ddc['message']+'\x0a')),_0x136ddc['helpText']&&console[_0x40f5df(0x1e7)](a29_0x1fe165['cyan'](_0x136ddc[_0x40f5df(0x1b2)]))),0x1;const _0x17a593=_0x136ddc[_0x40f5df(0x1c5)],_0x48eb35=_0x136ddc[_0x40f5df(0x1bd)]===_0x40f5df(0x1db)?_0x136ddc['filePath']:undefined;if(!_0x48eb35&&!existsSync(_0x17a593))return console['error'](a29_0x1fe165[_0x40f5df(0x1c4)](_0x40f5df(0x1c0)+_0x17a593+'\x0a')),0x1;let _0x39fca8;if(_0x48eb35){if(!_0x48eb35[_0x40f5df(0x1e8)](_0x40f5df(0x1b5))&&!_0x48eb35['endsWith'](_0x40f5df(0x1d9)))return console[_0x40f5df(0x1e7)](a29_0x1fe165[_0x40f5df(0x1c4)](_0x40f5df(0x1d3)+_0x48eb35+'\x0a')),0x1;_0x39fca8=[_0x48eb35];}else _0x39fca8=findYamlFiles(_0x17a593);if(_0x39fca8['length']===0x0)return console[_0x40f5df(0x1e7)](a29_0x1fe165[_0x40f5df(0x1c4)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x17a593+'\x0a')),0x1;const _0x133b1b=validateYamlFiles(_0x39fca8,_0x17a593,{'filterType':'journey'}),_0x315dee=calculateSummary(_0x133b1b),_0x490dc6=_0x133b1b[_0x40f5df(0x1ca)](isValidationResult);if(_0x490dc6[_0x40f5df(0x1b1)]===0x0)return console['error'](a29_0x1fe165[_0x40f5df(0x1b7)](_0x40f5df(0x1cf)+_0x17a593+'\x0a')),_0x315dee[_0x40f5df(0x1cb)]>0x0&&console[_0x40f5df(0x1e7)](a29_0x1fe165['dim']('('+_0x315dee['skippedCount']+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x2d7c1d of _0x133b1b){if(!isValidationResult(_0x2d7c1d)){_0x1cf06c[_0x40f5df(0x1e2)]&&console[_0x40f5df(0x1ce)](a29_0x1fe165[_0x40f5df(0x1e1)]('-\x20'+_0x2d7c1d[_0x40f5df(0x1c3)]+'\x20(skipped:\x20'+_0x2d7c1d[_0x40f5df(0x1c1)]+')'));continue;}const {relativePath:_0x39fe7d,source:_0x5b092c,result:_0x262a24}=_0x2d7c1d;if(_0x262a24[_0x40f5df(0x1e0)]&&_0x262a24[_0x40f5df(0x1d2)]['length']===0x0)_0x1cf06c[_0x40f5df(0x1e2)]&&console['log'](a29_0x1fe165[_0x40f5df(0x1ba)]('✔\x20'+_0x39fe7d));else _0x262a24[_0x40f5df(0x1e0)]?(console[_0x40f5df(0x1ce)](a29_0x1fe165['yellow']('⚠\x20'+_0x39fe7d+':\x20'+_0x262a24['warnings']['length']+_0x40f5df(0x1d7))),console['log'](formatValidationResult(_0x262a24,_0x5b092c,_0x39fe7d))):(console[_0x40f5df(0x1ce)](a29_0x1fe165[_0x40f5df(0x1c4)]('✖\x20'+_0x39fe7d+':\x20'+_0x262a24[_0x40f5df(0x1b4)][_0x40f5df(0x1b1)]+_0x40f5df(0x1cc))),console['log'](formatValidationResult(_0x262a24,_0x5b092c,_0x39fe7d)));}return console[_0x40f5df(0x1ce)](''),_0x315dee[_0x40f5df(0x1d0)]?(console[_0x40f5df(0x1ce)](a29_0x1fe165['red'](_0x40f5df(0x1bc)+_0x315dee[_0x40f5df(0x1da)]+_0x40f5df(0x1b6)+_0x315dee['validCount']+_0x40f5df(0x1bb))),_0x315dee[_0x40f5df(0x1be)]>0x0&&console[_0x40f5df(0x1ce)](a29_0x1fe165[_0x40f5df(0x1b7)](_0x315dee[_0x40f5df(0x1be)]+_0x40f5df(0x1d1))),_0x315dee[_0x40f5df(0x1cb)]>0x0&&console[_0x40f5df(0x1ce)](a29_0x1fe165['dim'](_0x315dee[_0x40f5df(0x1cb)]+'\x20segment\x20file(s)\x20skipped')),0x1):(console['log'](a29_0x1fe165[_0x40f5df(0x1ba)](_0x40f5df(0x1dd)+_0x315dee[_0x40f5df(0x1de)]+_0x40f5df(0x1e3))),_0x315dee[_0x40f5df(0x1be)]>0x0&&console['log'](a29_0x1fe165['yellow'](_0x315dee['warningCount']+'\x20warning(s)\x20found')),_0x315dee[_0x40f5df(0x1cb)]>0x0&&console[_0x40f5df(0x1ce)](a29_0x1fe165[_0x40f5df(0x1e1)](_0x315dee[_0x40f5df(0x1cb)]+_0x40f5df(0x1c2))),0x0);}}
1
+ function a28_0x4595(){const _0x386f6f=['1619512rdvtKu','parentSegment','targetDir','15IjFMVH','Error:\x20Directory\x20not\x20found:\x20','filePath','\x20warning(s)\x20found','.yaml','log','valid','warningCount','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','journey','Validation\x20failed:\x20','60iJqkAs','validCount','type','red','No\x20journey\x20YAML\x20files\x20found\x20in\x20','yellow','\x20error(s)','\x20journey(s)\x20with\x20errors,\x20','name','message','432873RibzXq','hasErrors','endsWith','errorCode','176rFLeBL','error','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','4364886ScSupv','dim','1208589fLuVRc','skippedCount','2EzCVtP','309150qdDGfO','reason','\x20journey(s)\x20valid','\x20valid','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','3777036LPekio','helpText','✔\x20All\x20','\x20segment\x20file(s)\x20skipped','verbose','invalidCount','journey:validate','14701313wGETud','description','24MIgkmp','green','length','\x20warning(s)'];a28_0x4595=function(){return _0x386f6f;};return a28_0x4595();}const a28_0x3a6220=a28_0x1e5d;(function(_0x2814c4,_0x4ac115){const _0x103617=a28_0x1e5d,_0x157c16=_0x2814c4();while(!![]){try{const _0x492041=-parseInt(_0x103617(0x135))/0x1*(parseInt(_0x103617(0x137))/0x2)+parseInt(_0x103617(0x13d))/0x3+-parseInt(_0x103617(0x14a))/0x4*(-parseInt(_0x103617(0x14d))/0x5)+parseInt(_0x103617(0x133))/0x6+-parseInt(_0x103617(0x12c))/0x7*(-parseInt(_0x103617(0x130))/0x8)+parseInt(_0x103617(0x138))/0x9*(parseInt(_0x103617(0x158))/0xa)+-parseInt(_0x103617(0x144))/0xb*(parseInt(_0x103617(0x146))/0xc);if(_0x492041===_0x4ac115)break;else _0x157c16['push'](_0x157c16['shift']());}catch(_0x1743dd){_0x157c16['push'](_0x157c16['shift']());}}}(a28_0x4595,0xd8572));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x5ce07e from'chalk';function a28_0x1e5d(_0x4c1058,_0x4190a8){_0x4c1058=_0x4c1058-0x124;const _0x4595b9=a28_0x4595();let _0x1e5de3=_0x4595b9[_0x4c1058];return _0x1e5de3;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x3a6220(0x12a)]=a28_0x3a6220(0x143);[a28_0x3a6220(0x145)]='Validate\x20journey\x20YAML\x20files';async['execute'](_0x292b1d){const _0x4f279d=a28_0x3a6220,{options:_0x5ac902,args:_0x5e925e}=_0x292b1d,_0x1a9bb4=_0x5ac902,_0x3525b8=await resolveTarget({'arg':_0x5e925e[0x0],'contextParent':_0x5ac902[_0x4f279d(0x14b)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3525b8))return _0x3525b8[_0x4f279d(0x12f)]==='no_parent'?(console[_0x4f279d(0x131)](a28_0x5ce07e['yellow'](_0x4f279d(0x132))),console[_0x4f279d(0x131)](_0x4f279d(0x155)),console[_0x4f279d(0x131)]('\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'),console[_0x4f279d(0x131)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x4f279d(0x131)](a28_0x5ce07e[_0x4f279d(0x125)]('Error:\x20'+_0x3525b8[_0x4f279d(0x12b)]+'\x0a')),_0x3525b8[_0x4f279d(0x13e)]&&console[_0x4f279d(0x131)](a28_0x5ce07e['cyan'](_0x3525b8[_0x4f279d(0x13e)]))),0x1;const _0x498f6b=_0x3525b8[_0x4f279d(0x14c)],_0x47c792=_0x3525b8[_0x4f279d(0x124)]==='file'?_0x3525b8[_0x4f279d(0x14f)]:undefined;if(!_0x47c792&&!existsSync(_0x498f6b))return console[_0x4f279d(0x131)](a28_0x5ce07e[_0x4f279d(0x125)](_0x4f279d(0x14e)+_0x498f6b+'\x0a')),0x1;let _0x38476b;if(_0x47c792){if(!_0x47c792[_0x4f279d(0x12e)]('.yml')&&!_0x47c792[_0x4f279d(0x12e)](_0x4f279d(0x151)))return console['error'](a28_0x5ce07e[_0x4f279d(0x125)](_0x4f279d(0x13c)+_0x47c792+'\x0a')),0x1;_0x38476b=[_0x47c792];}else _0x38476b=findYamlFiles(_0x498f6b);if(_0x38476b[_0x4f279d(0x148)]===0x0)return console[_0x4f279d(0x131)](a28_0x5ce07e[_0x4f279d(0x125)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x498f6b+'\x0a')),0x1;const _0xef7dc5=validateYamlFiles(_0x38476b,_0x498f6b,{'filterType':_0x4f279d(0x156)}),_0x3b60d1=calculateSummary(_0xef7dc5),_0x5ebb74=_0xef7dc5['filter'](isValidationResult);if(_0x5ebb74['length']===0x0)return console['error'](a28_0x5ce07e[_0x4f279d(0x127)](_0x4f279d(0x126)+_0x498f6b+'\x0a')),_0x3b60d1[_0x4f279d(0x136)]>0x0&&console[_0x4f279d(0x131)](a28_0x5ce07e[_0x4f279d(0x134)]('('+_0x3b60d1[_0x4f279d(0x136)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x4061fb of _0xef7dc5){if(!isValidationResult(_0x4061fb)){_0x1a9bb4[_0x4f279d(0x141)]&&console[_0x4f279d(0x152)](a28_0x5ce07e[_0x4f279d(0x134)]('-\x20'+_0x4061fb['relativePath']+'\x20(skipped:\x20'+_0x4061fb[_0x4f279d(0x139)]+')'));continue;}const {relativePath:_0x3be982,source:_0x1ec5e9,result:_0x3f4d23}=_0x4061fb;if(_0x3f4d23[_0x4f279d(0x153)]&&_0x3f4d23['warnings'][_0x4f279d(0x148)]===0x0)_0x1a9bb4[_0x4f279d(0x141)]&&console['log'](a28_0x5ce07e[_0x4f279d(0x147)]('✔\x20'+_0x3be982));else _0x3f4d23['valid']?(console[_0x4f279d(0x152)](a28_0x5ce07e['yellow']('⚠\x20'+_0x3be982+':\x20'+_0x3f4d23['warnings']['length']+_0x4f279d(0x149))),console[_0x4f279d(0x152)](formatValidationResult(_0x3f4d23,_0x1ec5e9,_0x3be982))):(console['log'](a28_0x5ce07e[_0x4f279d(0x125)]('✖\x20'+_0x3be982+':\x20'+_0x3f4d23['errors'][_0x4f279d(0x148)]+_0x4f279d(0x128))),console[_0x4f279d(0x152)](formatValidationResult(_0x3f4d23,_0x1ec5e9,_0x3be982)));}return console[_0x4f279d(0x152)](''),_0x3b60d1[_0x4f279d(0x12d)]?(console['log'](a28_0x5ce07e[_0x4f279d(0x125)](_0x4f279d(0x157)+_0x3b60d1[_0x4f279d(0x142)]+_0x4f279d(0x129)+_0x3b60d1[_0x4f279d(0x159)]+_0x4f279d(0x13b))),_0x3b60d1[_0x4f279d(0x154)]>0x0&&console['log'](a28_0x5ce07e[_0x4f279d(0x127)](_0x3b60d1[_0x4f279d(0x154)]+_0x4f279d(0x150))),_0x3b60d1['skippedCount']>0x0&&console[_0x4f279d(0x152)](a28_0x5ce07e[_0x4f279d(0x134)](_0x3b60d1['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x1):(console[_0x4f279d(0x152)](a28_0x5ce07e[_0x4f279d(0x147)](_0x4f279d(0x13f)+_0x3b60d1[_0x4f279d(0x159)]+_0x4f279d(0x13a))),_0x3b60d1[_0x4f279d(0x154)]>0x0&&console[_0x4f279d(0x152)](a28_0x5ce07e['yellow'](_0x3b60d1['warningCount']+_0x4f279d(0x150))),_0x3b60d1[_0x4f279d(0x136)]>0x0&&console['log'](a28_0x5ce07e[_0x4f279d(0x134)](_0x3b60d1[_0x4f279d(0x136)]+_0x4f279d(0x140))),0x0);}}