@treasuredata/tdx 0.28.2 → 0.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) 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.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-utils.js.map +1 -1
  122. package/dist/sdk/segment/journey-validator.js +1 -1
  123. package/dist/sdk/segment/journey-validator.js.map +1 -1
  124. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  125. package/dist/sdk/segment/journey-yaml.js +1 -1
  126. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  127. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  128. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/pull-workflow.js +1 -1
  130. package/dist/sdk/segment/push-recovery.js +1 -1
  131. package/dist/sdk/segment/push-workflow.js +1 -1
  132. package/dist/sdk/segment/resolution-context.js +1 -1
  133. package/dist/sdk/segment/segment-path-parser.js +1 -1
  134. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  135. package/dist/sdk/segment/target-resolution.js +1 -1
  136. package/dist/sdk/segment/tdx-config.js +1 -1
  137. package/dist/sdk/segment/validate-files.js +1 -1
  138. package/dist/sdk/segment/yaml-validator.js +1 -1
  139. package/dist/sdk/segment.js +1 -1
  140. package/dist/sdk/types/index.js +1 -1
  141. package/dist/sdk/types/progress.js +1 -1
  142. package/dist/sdk/user.js +1 -1
  143. package/dist/sdk/util/format-detector.js +1 -1
  144. package/dist/sdk/util/formatters.js +1 -1
  145. package/dist/sdk/util/index.js +1 -1
  146. package/dist/sdk/util/tree-formatter.js +1 -1
  147. package/dist/sdk/workflow/archive-validation.js +1 -1
  148. package/dist/sdk/workflow/clone-workflow.js +1 -1
  149. package/dist/sdk/workflow/index.js +1 -1
  150. package/dist/sdk/workflow/pull-workflow.js +1 -1
  151. package/dist/sdk/workflow/push-workflow.js +1 -1
  152. package/dist/sdk/workflow/tdx-config.js +1 -1
  153. package/dist/sdk/workflow/workflow-utils.js +1 -1
  154. package/dist/test-utils/command-runner.js +1 -1
  155. package/dist/test-utils/factories.js +1 -1
  156. package/dist/test-utils/fixtures.js +1 -1
  157. package/dist/test-utils/http-mock.js +1 -1
  158. package/dist/test-utils/index.js +1 -1
  159. package/dist/utils/async.js +1 -1
  160. package/dist/utils/colors.js +1 -1
  161. package/dist/utils/diff.js +1 -1
  162. package/dist/utils/file-permissions.js +1 -1
  163. package/dist/utils/global-cache.js +1 -1
  164. package/dist/utils/json-loader.js +1 -1
  165. package/dist/utils/local-cache.js +1 -1
  166. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  167. package/dist/utils/logger/formatters/index.js +1 -1
  168. package/dist/utils/logger/handlers/console-handler.js +1 -1
  169. package/dist/utils/logger/handlers/file-handler.js +1 -1
  170. package/dist/utils/logger/handlers/index.js +1 -1
  171. package/dist/utils/logger/handlers/null-handler.js +1 -1
  172. package/dist/utils/logger/index.js +1 -1
  173. package/dist/utils/logger/logger.js +1 -1
  174. package/dist/utils/logger/types.js +1 -1
  175. package/dist/utils/option-validation.js +1 -1
  176. package/dist/utils/process.js +1 -1
  177. package/dist/utils/prompt.js +1 -1
  178. package/dist/utils/spinner.js +1 -1
  179. package/dist/utils/sse-parser.js +1 -1
  180. package/dist/utils/string-utils.js +1 -1
  181. package/dist/utils/table-ref-parser.js +1 -1
  182. package/dist/utils/tdx-logger.js +1 -1
  183. package/dist/utils/version-check.js +1 -1
  184. package/package.json +1 -1
@@ -1 +1 @@
1
- const a19_0x2ec8d9=a19_0x4e78;(function(_0x26b017,_0x4a1b99){const _0x48768d=a19_0x4e78,_0x7f2bbe=_0x26b017();while(!![]){try{const _0x400e09=parseInt(_0x48768d(0x1b1))/0x1*(-parseInt(_0x48768d(0x1bd))/0x2)+parseInt(_0x48768d(0x1c1))/0x3*(parseInt(_0x48768d(0x1d0))/0x4)+-parseInt(_0x48768d(0x1b2))/0x5+-parseInt(_0x48768d(0x1b7))/0x6+parseInt(_0x48768d(0x1cd))/0x7+parseInt(_0x48768d(0x1ad))/0x8+-parseInt(_0x48768d(0x1b3))/0x9*(-parseInt(_0x48768d(0x1c0))/0xa);if(_0x400e09===_0x4a1b99)break;else _0x7f2bbe['push'](_0x7f2bbe['shift']());}catch(_0x336e2f){_0x7f2bbe['push'](_0x7f2bbe['shift']());}}}(a19_0x20b9,0xb7be4));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a19_0x4e78(_0x3c8448,_0x584581){_0x3c8448=_0x3c8448-0x1a4;const _0x20b9ed=a19_0x20b9();let _0x4e7808=_0x20b9ed[_0x3c8448];return _0x4e7808;}import a19_0x3dca2f from'chalk';import a19_0x1f7219 from'path';function a19_0x20b9(){const _0x363e11=['Validation\x20failed:\x20','filter','4ZYguTE','4895105nTTKZJ','80460RhSUcl','warnings','\x20warning(s)\x20found','yellow','8409408OwxKIW','verbose','.yaml','\x20non-campaign\x20file(s)\x20skipped','validCount','log','174260BZSOrg','green','\x20error(s)','1220dNtVvK','3aQnPCE','red','Validate\x20campaign\x20YAML\x20files','execute','dim','\x20valid','error','✔\x20All\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20campaign(s)\x20valid','\x20non-campaign\x20file(s)\x20skipped)','resolve','3383709ErfByA','\x20campaign(s)\x20with\x20errors,\x20','campaign','3244588ASLXYG','skippedCount','endsWith','valid','cwd','name','length','description','Error:\x20Directory\x20not\x20found:\x20','dirname','.yml','errors','8772056nPEHeZ','warningCount'];a19_0x20b9=function(){return _0x363e11;};return a19_0x20b9();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a19_0x2ec8d9(0x1a6)]='engage:campaign:validate';[a19_0x2ec8d9(0x1a8)]=a19_0x2ec8d9(0x1c3);async[a19_0x2ec8d9(0x1c4)](_0x5b1f4b){const _0x1f2d64=a19_0x2ec8d9,{options:_0x57980a,args:_0x1e2269}=_0x5b1f4b,_0x1147da=_0x57980a,_0x118e2a=_0x1e2269[0x0],_0x24dda3=_0x118e2a?a19_0x1f7219[_0x1f2d64(0x1cc)](_0x118e2a):undefined,_0x414cf2=_0x24dda3?isYamlFile(_0x24dda3):![];let _0x4652f5,_0x1be171;if(_0x414cf2&&_0x24dda3)_0x4652f5=a19_0x1f7219[_0x1f2d64(0x1aa)](_0x24dda3),_0x1be171=_0x24dda3;else _0x24dda3?_0x4652f5=_0x24dda3:_0x4652f5=process[_0x1f2d64(0x1a5)]();if(!_0x1be171&&!existsSync(_0x4652f5))return console[_0x1f2d64(0x1c7)](a19_0x3dca2f[_0x1f2d64(0x1c2)](_0x1f2d64(0x1a9)+_0x4652f5+'\x0a')),0x1;let _0x4c8040;if(_0x1be171){if(!_0x1be171[_0x1f2d64(0x1d2)](_0x1f2d64(0x1ab))&&!_0x1be171[_0x1f2d64(0x1d2)](_0x1f2d64(0x1b9)))return console['error'](a19_0x3dca2f[_0x1f2d64(0x1c2)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1be171+'\x0a')),0x1;_0x4c8040=[_0x1be171];}else _0x4c8040=findYamlFiles(_0x4652f5);if(_0x4c8040[_0x1f2d64(0x1a7)]===0x0)return console[_0x1f2d64(0x1c7)](a19_0x3dca2f['red'](_0x1f2d64(0x1c9)+_0x4652f5+'\x0a')),0x1;const _0x199bc2=validateYamlFiles(_0x4c8040,_0x4652f5,{'filterType':_0x1f2d64(0x1cf)}),_0x49139d=calculateSummary(_0x199bc2),_0x111852=_0x199bc2[_0x1f2d64(0x1b0)](isValidationResult);if(_0x111852['length']===0x0)return console['error'](a19_0x3dca2f[_0x1f2d64(0x1b6)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x4652f5+'\x0a')),_0x49139d[_0x1f2d64(0x1d1)]>0x0&&console[_0x1f2d64(0x1c7)](a19_0x3dca2f[_0x1f2d64(0x1c5)]('('+_0x49139d['skippedCount']+_0x1f2d64(0x1cb))),0x0;for(const _0x11bbaf of _0x199bc2){if(!isValidationResult(_0x11bbaf)){_0x1147da[_0x1f2d64(0x1b8)]&&console['log'](a19_0x3dca2f[_0x1f2d64(0x1c5)]('-\x20'+_0x11bbaf['relativePath']+'\x20(skipped:\x20'+_0x11bbaf['reason']+')'));continue;}const {relativePath:_0x3dd6a9,source:_0x23f301,result:_0x30397a}=_0x11bbaf;if(_0x30397a[_0x1f2d64(0x1a4)]&&_0x30397a[_0x1f2d64(0x1b4)][_0x1f2d64(0x1a7)]===0x0)_0x1147da['verbose']&&console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1be)]('✔\x20'+_0x3dd6a9));else _0x30397a[_0x1f2d64(0x1a4)]?(console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1b6)]('⚠\x20'+_0x3dd6a9+':\x20'+_0x30397a[_0x1f2d64(0x1b4)][_0x1f2d64(0x1a7)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x30397a,_0x23f301,_0x3dd6a9))):(console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1c2)]('✖\x20'+_0x3dd6a9+':\x20'+_0x30397a[_0x1f2d64(0x1ac)][_0x1f2d64(0x1a7)]+_0x1f2d64(0x1bf))),console[_0x1f2d64(0x1bc)](formatValidationResult(_0x30397a,_0x23f301,_0x3dd6a9)));}return console[_0x1f2d64(0x1bc)](''),_0x49139d['hasErrors']?(console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1c2)](_0x1f2d64(0x1af)+_0x49139d['invalidCount']+_0x1f2d64(0x1ce)+_0x49139d[_0x1f2d64(0x1bb)]+_0x1f2d64(0x1c6))),_0x49139d[_0x1f2d64(0x1ae)]>0x0&&console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1b6)](_0x49139d[_0x1f2d64(0x1ae)]+_0x1f2d64(0x1b5))),_0x49139d['skippedCount']>0x0&&console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1c5)](_0x49139d[_0x1f2d64(0x1d1)]+_0x1f2d64(0x1ba))),0x1):(console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1be)](_0x1f2d64(0x1c8)+_0x49139d[_0x1f2d64(0x1bb)]+_0x1f2d64(0x1ca))),_0x49139d[_0x1f2d64(0x1ae)]>0x0&&console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1b6)](_0x49139d[_0x1f2d64(0x1ae)]+_0x1f2d64(0x1b5))),_0x49139d['skippedCount']>0x0&&console[_0x1f2d64(0x1bc)](a19_0x3dca2f['dim'](_0x49139d[_0x1f2d64(0x1d1)]+_0x1f2d64(0x1ba))),0x0);}}
1
+ const a19_0x33202b=a19_0x5a7a;(function(_0x1ec585,_0x1c923b){const _0x265ea2=a19_0x5a7a,_0xcdcdeb=_0x1ec585();while(!![]){try{const _0x5567e0=-parseInt(_0x265ea2(0x1a6))/0x1*(parseInt(_0x265ea2(0x19b))/0x2)+-parseInt(_0x265ea2(0x1b7))/0x3*(-parseInt(_0x265ea2(0x191))/0x4)+parseInt(_0x265ea2(0x1b1))/0x5+parseInt(_0x265ea2(0x19d))/0x6*(parseInt(_0x265ea2(0x1ab))/0x7)+-parseInt(_0x265ea2(0x1b3))/0x8+parseInt(_0x265ea2(0x198))/0x9*(parseInt(_0x265ea2(0x1b6))/0xa)+-parseInt(_0x265ea2(0x1b8))/0xb;if(_0x5567e0===_0x1c923b)break;else _0xcdcdeb['push'](_0xcdcdeb['shift']());}catch(_0x5998fa){_0xcdcdeb['push'](_0xcdcdeb['shift']());}}}(a19_0x29e7,0x8ea8a));import{BaseCommand}from'./command.js';function a19_0x5a7a(_0x27d20c,_0x7a8527){_0x27d20c=_0x27d20c-0x190;const _0x29e7b8=a19_0x29e7();let _0x5a7a15=_0x29e7b8[_0x27d20c];return _0x5a7a15;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a19_0x21271c from'chalk';import a19_0x401f46 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a19_0x33202b(0x1bd)]=a19_0x33202b(0x19c);[a19_0x33202b(0x193)]=a19_0x33202b(0x196);async[a19_0x33202b(0x1c0)](_0x1a9806){const _0x4f431f=a19_0x33202b,{options:_0x4e5580,args:_0x1e8178}=_0x1a9806,_0x454859=_0x4e5580,_0x19fe3d=_0x1e8178[0x0],_0x23624e=_0x19fe3d?a19_0x401f46[_0x4f431f(0x195)](_0x19fe3d):undefined,_0x4a70a5=_0x23624e?isYamlFile(_0x23624e):![];let _0x4b1042,_0x41554b;if(_0x4a70a5&&_0x23624e)_0x4b1042=a19_0x401f46[_0x4f431f(0x1a2)](_0x23624e),_0x41554b=_0x23624e;else _0x23624e?_0x4b1042=_0x23624e:_0x4b1042=process[_0x4f431f(0x1ae)]();if(!_0x41554b&&!existsSync(_0x4b1042))return console[_0x4f431f(0x1a1)](a19_0x21271c['red'](_0x4f431f(0x1ba)+_0x4b1042+'\x0a')),0x1;let _0x21e6c2;if(_0x41554b){if(!_0x41554b[_0x4f431f(0x1a0)]('.yml')&&!_0x41554b[_0x4f431f(0x1a0)](_0x4f431f(0x1c2)))return console['error'](a19_0x21271c['red'](_0x4f431f(0x1b9)+_0x41554b+'\x0a')),0x1;_0x21e6c2=[_0x41554b];}else _0x21e6c2=findYamlFiles(_0x4b1042);if(_0x21e6c2['length']===0x0)return console[_0x4f431f(0x1a1)](a19_0x21271c['red'](_0x4f431f(0x1c1)+_0x4b1042+'\x0a')),0x1;const _0x19e151=validateYamlFiles(_0x21e6c2,_0x4b1042,{'filterType':'campaign'}),_0x4655ea=calculateSummary(_0x19e151),_0x487f8a=_0x19e151['filter'](isValidationResult);if(_0x487f8a['length']===0x0)return console[_0x4f431f(0x1a1)](a19_0x21271c[_0x4f431f(0x1ad)](_0x4f431f(0x19e)+_0x4b1042+'\x0a')),_0x4655ea[_0x4f431f(0x1aa)]>0x0&&console['error'](a19_0x21271c[_0x4f431f(0x1a3)]('('+_0x4655ea['skippedCount']+_0x4f431f(0x1be))),0x0;for(const _0x111a0c of _0x19e151){if(!isValidationResult(_0x111a0c)){_0x454859[_0x4f431f(0x1a8)]&&console[_0x4f431f(0x1a9)](a19_0x21271c['dim']('-\x20'+_0x111a0c[_0x4f431f(0x1bc)]+_0x4f431f(0x197)+_0x111a0c['reason']+')'));continue;}const {relativePath:_0x56d727,source:_0x3d9fe8,result:_0xd9ae9b}=_0x111a0c;if(_0xd9ae9b[_0x4f431f(0x19a)]&&_0xd9ae9b[_0x4f431f(0x1bf)]['length']===0x0)_0x454859[_0x4f431f(0x1a8)]&&console[_0x4f431f(0x1a9)](a19_0x21271c[_0x4f431f(0x1af)]('✔\x20'+_0x56d727));else _0xd9ae9b[_0x4f431f(0x19a)]?(console[_0x4f431f(0x1a9)](a19_0x21271c[_0x4f431f(0x1ad)]('⚠\x20'+_0x56d727+':\x20'+_0xd9ae9b[_0x4f431f(0x1bf)][_0x4f431f(0x1a5)]+_0x4f431f(0x1a7))),console[_0x4f431f(0x1a9)](formatValidationResult(_0xd9ae9b,_0x3d9fe8,_0x56d727))):(console[_0x4f431f(0x1a9)](a19_0x21271c[_0x4f431f(0x1b5)]('✖\x20'+_0x56d727+':\x20'+_0xd9ae9b[_0x4f431f(0x1ac)]['length']+_0x4f431f(0x199))),console[_0x4f431f(0x1a9)](formatValidationResult(_0xd9ae9b,_0x3d9fe8,_0x56d727)));}return console[_0x4f431f(0x1a9)](''),_0x4655ea[_0x4f431f(0x1b0)]?(console['log'](a19_0x21271c[_0x4f431f(0x1b5)]('Validation\x20failed:\x20'+_0x4655ea[_0x4f431f(0x1a4)]+_0x4f431f(0x1bb)+_0x4655ea[_0x4f431f(0x1b2)]+_0x4f431f(0x1b4))),_0x4655ea[_0x4f431f(0x19f)]>0x0&&console[_0x4f431f(0x1a9)](a19_0x21271c[_0x4f431f(0x1ad)](_0x4655ea['warningCount']+_0x4f431f(0x194))),_0x4655ea[_0x4f431f(0x1aa)]>0x0&&console[_0x4f431f(0x1a9)](a19_0x21271c[_0x4f431f(0x1a3)](_0x4655ea[_0x4f431f(0x1aa)]+_0x4f431f(0x1c3))),0x1):(console['log'](a19_0x21271c[_0x4f431f(0x1af)](_0x4f431f(0x190)+_0x4655ea[_0x4f431f(0x1b2)]+_0x4f431f(0x192))),_0x4655ea[_0x4f431f(0x19f)]>0x0&&console['log'](a19_0x21271c[_0x4f431f(0x1ad)](_0x4655ea[_0x4f431f(0x19f)]+'\x20warning(s)\x20found')),_0x4655ea['skippedCount']>0x0&&console[_0x4f431f(0x1a9)](a19_0x21271c['dim'](_0x4655ea[_0x4f431f(0x1aa)]+_0x4f431f(0x1c3))),0x0);}}function a19_0x29e7(){const _0x1d6b86=['\x20campaign(s)\x20with\x20errors,\x20','relativePath','name','\x20non-campaign\x20file(s)\x20skipped)','warnings','execute','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yaml','\x20non-campaign\x20file(s)\x20skipped','✔\x20All\x20','1660tNimIp','\x20campaign(s)\x20valid','description','\x20warning(s)\x20found','resolve','Validate\x20campaign\x20YAML\x20files','\x20(skipped:\x20','27EfShZH','\x20error(s)','valid','137548kjDECV','engage:campaign:validate','5182350xOtoHz','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','warningCount','endsWith','error','dirname','dim','invalidCount','length','16LknSnv','\x20warning(s)','verbose','log','skippedCount','7thvGdE','errors','yellow','cwd','green','hasErrors','5266495pftQuS','validCount','5587216owukub','\x20valid','red','2478290NAmrcK','1122STcUrx','4758655ZnVlIO','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Error:\x20Directory\x20not\x20found:\x20'];a19_0x29e7=function(){return _0x1d6b86;};return a19_0x29e7();}
@@ -1 +1 @@
1
- const a20_0x1d3a8b=a20_0x45e1;(function(_0xea41bc,_0x432792){const _0x599993=a20_0x45e1,_0x38d99e=_0xea41bc();while(!![]){try{const _0x415f5e=-parseInt(_0x599993(0x9e))/0x1*(-parseInt(_0x599993(0x105))/0x2)+-parseInt(_0x599993(0xc0))/0x3+-parseInt(_0x599993(0xbe))/0x4+parseInt(_0x599993(0x103))/0x5+-parseInt(_0x599993(0xd2))/0x6+parseInt(_0x599993(0x104))/0x7*(parseInt(_0x599993(0x96))/0x8)+-parseInt(_0x599993(0xf7))/0x9*(-parseInt(_0x599993(0xf0))/0xa);if(_0x415f5e===_0x432792)break;else _0x38d99e['push'](_0x38d99e['shift']());}catch(_0x2d0826){_0x38d99e['push'](_0x38d99e['shift']());}}}(a20_0x2579,0x28249));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';export async function resolveWorkspaceIdFromOptions(_0xf03766,_0x58c92c,_0x32a86e=![]){const _0x3450e2=a20_0x45e1;if(_0xf03766[_0x3450e2(0xa5)])return await _0x58c92c[_0x3450e2(0xa6)][_0x3450e2(0x123)](_0xf03766[_0x3450e2(0xa5)]);const _0x2e82e2=loadSessionContext(_0xf03766[_0x3450e2(0xd3)]);if(_0x2e82e2?.[_0x3450e2(0xd0)])return await _0x58c92c[_0x3450e2(0xa6)][_0x3450e2(0x123)](_0x2e82e2[_0x3450e2(0xd0)]);if(_0x32a86e)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x3450e2(0x9a),undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x166c24,_0x280fc0){const _0x1569de=a20_0x45e1;if(!_0x166c24['segment'])return{};const _0x558de5=_0x166c24['segment'],_0x588d97=await _0x280fc0[_0x1569de(0x110)][_0x1569de(0xe6)](_0x558de5);return{'audienceId':_0x588d97[_0x1569de(0x118)],'audienceName':_0x588d97[_0x1569de(0xdb)],..._0x588d97[_0x1569de(0xc9)]&&{'segmentId':_0x588d97[_0x1569de(0xc9)],'segmentName':_0x588d97['segmentName']}};}function buildConnectorConfig(_0x3796e2){const _0x5a266b=a20_0x45e1,_0x17174d=_0x3796e2['emailSenderId'],_0x3e38e4=_0x3796e2[_0x5a266b(0xfe)];if(!_0x17174d&&!_0x3e38e4)return undefined;return{..._0x17174d&&{'emailSenderId':_0x17174d},..._0x3e38e4&&{'jsonColumns':_0x3e38e4}};}export class EngageCampaignsCommand extends BaseCommand{['name']='engage:campaigns';[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xcc);async['execute'](_0x2c78bf){const _0x3ffe16=a20_0x1d3a8b,{options:_0x2a9568,args:_0x565e49,tdx:_0x1603bc}=_0x2c78bf,_0x3cda2d=_0x565e49[0x0],_0x109d80=resolveLimit(_0x2a9568['limit'],DEFAULT_LLM_LIMIT),_0x3546c6=_0x2a9568,_0x29fb4b=_0x3546c6[_0x3ffe16(0x92)],_0x13b91d=_0x3546c6['status'],_0x232f92=await resolveWorkspaceIdFromOptions(_0x3546c6,_0x1603bc),_0x4afeab=await withSpinner(_0x3ffe16(0x9c),()=>_0x1603bc[_0x3ffe16(0xa6)]['listCampaigns']({'type':_0x29fb4b,'status':_0x13b91d,'workspaceId':_0x232f92,'limit':_0x109d80}),{'verbose':_0x2a9568[_0x3ffe16(0x10b)]});let _0x28cbe4=_0x4afeab[_0x3ffe16(0x91)];_0x3cda2d&&(_0x28cbe4=_0x4afeab['data'][_0x3ffe16(0xb8)](_0x3a7954=>matchGlobPattern(_0x3a7954['name'],_0x3cda2d)));const _0x1a8b6f=_0x2a9568[_0x3ffe16(0x10c)];if(_0x2a9568['format']===_0x3ffe16(0xea)||_0x2a9568[_0x3ffe16(0x100)]===_0x3ffe16(0x97)){const _0x245b60=_0x28cbe4[_0x3ffe16(0xe9)](_0x4e504d=>({..._0x4e504d,'url':_0x4e504d['workspaceId']?getCampaignUrl(_0x1a8b6f,_0x4e504d['workspaceId'],_0x4e504d['id']):undefined}));await handleSDKOutput(_0x245b60,_0x2a9568);}else await handleSDKOutput(_0x28cbe4,_0x2a9568);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]='engage:campaign:show';[a20_0x1d3a8b(0x119)]='Show\x20campaign\x20details';async['execute'](_0x4d4054){const _0x1587c1=a20_0x1d3a8b,{options:_0x16ba29,args:_0x215374,tdx:_0x4c1f50}=_0x4d4054;if(_0x215374[_0x1587c1(0xa4)]===0x0)return console[_0x1587c1(0x98)](_0x1587c1(0x121)),console[_0x1587c1(0x98)](_0x1587c1(0xb9)),0x1;const _0x3a18a2=_0x215374[0x0],_0x1d2687=_0x16ba29,_0x4d0a93=await resolveWorkspaceIdFromOptions(_0x1d2687,_0x4c1f50),_0x505e38=_0x1d2687[_0x1587c1(0xdd)],_0x141f82=_0x16ba29[_0x1587c1(0x10c)];if(_0x505e38){const _0x42d39f=await withSpinner(_0x1587c1(0xb6)+_0x3a18a2+_0x1587c1(0xf1),()=>_0x4c1f50['engage'][_0x1587c1(0xf6)](_0x3a18a2,_0x4d0a93),{'verbose':_0x16ba29['verbose']}),_0x417225=_0x42d39f['data'],_0x333f2c=_0x417225[_0x1587c1(0xbb)][_0x1587c1(0x111)]?getCampaignUrl(_0x141f82,_0x417225[_0x1587c1(0xbb)][_0x1587c1(0x111)],_0x417225['id']):undefined;await handleSDKOutput([{..._0x417225,..._0x333f2c&&{'url':_0x333f2c}}],_0x16ba29);}else{const _0x8a10cb=await withSpinner(_0x1587c1(0xb6)+_0x3a18a2+_0x1587c1(0xf1),()=>_0x4c1f50[_0x1587c1(0xa6)][_0x1587c1(0xf8)](_0x3a18a2,_0x4d0a93),{'verbose':_0x16ba29[_0x1587c1(0x10b)]}),_0x55bdde=_0x8a10cb[_0x1587c1(0x91)],_0x5ce931=_0x55bdde['workspaceId']?getCampaignUrl(_0x141f82,_0x55bdde[_0x1587c1(0x111)],_0x55bdde['id']):undefined;await handleSingleObjectOutput({..._0x55bdde,..._0x5ce931&&{'url':_0x5ce931}},_0x16ba29);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]='engage:campaign:create';['description']=a20_0x1d3a8b(0x120);async['execute'](_0x29748b){const _0x5a2c01=a20_0x1d3a8b,{options:_0x52de9e,tdx:_0x426cd0}=_0x29748b,_0x5d947e=_0x52de9e,_0x3efdf6=_0x5d947e['name'],_0x1cbc3a=_0x5d947e[_0x5a2c01(0x92)];if(!_0x3efdf6)return console['error'](_0x5a2c01(0xbc)),console['error'](_0x5a2c01(0xaa)),0x1;if(!_0x1cbc3a)return console['error'](_0x5a2c01(0x9f)),console['error'](_0x5a2c01(0xaa)),0x1;const _0xb94b1a=await resolveWorkspaceIdFromOptions(_0x5d947e,_0x426cd0,!![]),_0x387ca2=await resolveSegmentFromOptions(_0x5d947e,_0x426cd0),_0x357b9c=buildConnectorConfig(_0x5d947e),_0x5437a7={'name':_0x3efdf6,'campaignType':_0x1cbc3a,'workspaceId':_0xb94b1a,'description':_0x5d947e[_0x5a2c01(0x119)],..._0x387ca2,'connectorConfig':_0x357b9c,'startAt':_0x5d947e[_0x5a2c01(0xfd)],'timezone':_0x5d947e['timezone']},_0x5a6162=await withSpinner(_0x5a2c01(0xda)+_0x3efdf6+_0x5a2c01(0xf1),()=>_0x426cd0[_0x5a2c01(0xa6)][_0x5a2c01(0xed)](_0x5437a7));return await handleSDKOutput([_0x5a6162[_0x5a2c01(0x91)]],_0x52de9e),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]='engage:campaign:update';['description']='Update\x20a\x20campaign';async[a20_0x1d3a8b(0xcb)](_0x5cb3b6){const _0x10cc83=a20_0x1d3a8b,{options:_0x6805fe,args:_0x18ed39,tdx:_0x4175d8}=_0x5cb3b6;if(_0x18ed39['length']===0x0)return console[_0x10cc83(0x98)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x10cc83(0x98)]('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x5870c2=_0x18ed39[0x0],_0x5b76c2=_0x6805fe,_0x3f6a38=await resolveWorkspaceIdFromOptions(_0x5b76c2,_0x4175d8),_0x130c29=await resolveSegmentFromOptions(_0x5b76c2,_0x4175d8),_0x32fe03=buildConnectorConfig(_0x5b76c2),_0x4255f0={'name':_0x5b76c2[_0x10cc83(0xe3)],'description':_0x5b76c2['description'],..._0x130c29,'connectorConfig':_0x32fe03,'startAt':_0x5b76c2[_0x10cc83(0xfd)],'timezone':_0x5b76c2[_0x10cc83(0xa7)]},_0xe42ad4=Object[_0x10cc83(0xcf)](Object[_0x10cc83(0xa8)](_0x4255f0)[_0x10cc83(0xb8)](([,_0x354aae])=>_0x354aae!==undefined));if(Object[_0x10cc83(0x11f)](_0xe42ad4)[_0x10cc83(0xa4)]===0x0)return console[_0x10cc83(0x98)](_0x10cc83(0xf5)),console[_0x10cc83(0x98)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x4689f5=await withSpinner(_0x10cc83(0xe7)+_0x5870c2+_0x10cc83(0xf1),()=>_0x4175d8['engage']['updateCampaign'](_0x5870c2,_0xe42ad4,_0x3f6a38),{'verbose':_0x6805fe[_0x10cc83(0x10b)]});return await handleSDKOutput([_0x4689f5[_0x10cc83(0x91)]],_0x6805fe),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xad);[a20_0x1d3a8b(0x119)]='Delete\x20a\x20campaign';async[a20_0x1d3a8b(0xcb)](_0x311732){const _0x2d6464=a20_0x1d3a8b,{options:_0x3cb157,args:_0x22d44d,tdx:_0x1fa995}=_0x311732;if(_0x22d44d[_0x2d6464(0xa4)]===0x0)return console['error'](_0x2d6464(0x121)),console['error'](_0x2d6464(0xdf)),0x1;const _0x50b2a4=_0x22d44d[0x0],_0x565c1c=_0x3cb157,_0x1b827f=await resolveWorkspaceIdFromOptions(_0x565c1c,_0x1fa995);if(!_0x3cb157['yes']){const _0x3415a5=await confirm(_0x2d6464(0x11c)+_0x50b2a4+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x3415a5)return console[_0x2d6464(0x113)](_0x2d6464(0xc2)),0x0;}return await withSpinner(_0x2d6464(0x11b)+_0x50b2a4+_0x2d6464(0xf1),()=>_0x1fa995['engage'][_0x2d6464(0xa3)](_0x50b2a4,_0x1b827f),{'verbose':_0x3cb157[_0x2d6464(0x10b)]}),console[_0x2d6464(0x113)](_0x2d6464(0xa9)+_0x50b2a4+_0x2d6464(0xba)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']=a20_0x1d3a8b(0xb2);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xd8);async[a20_0x1d3a8b(0xcb)](_0x2c4b68){const _0x1ba3db=a20_0x1d3a8b,{options:_0x5a3c21,args:_0x38fda5,tdx:_0x136891}=_0x2c4b68;if(_0x38fda5['length']===0x0)return console[_0x1ba3db(0x98)](_0x1ba3db(0x121)),console[_0x1ba3db(0x98)](_0x1ba3db(0x9d)),0x1;const _0x103959=_0x38fda5[0x0],_0x5d8535=_0x5a3c21,_0x208e95=await resolveWorkspaceIdFromOptions(_0x5d8535,_0x136891);return await withSpinner('Launching\x20campaign\x20\x27'+_0x103959+_0x1ba3db(0xf1),()=>_0x136891[_0x1ba3db(0xa6)]['launchCampaign'](_0x103959,_0x208e95),{'verbose':_0x5a3c21[_0x1ba3db(0x10b)]}),console[_0x1ba3db(0x113)]('Campaign\x20\x27'+_0x103959+_0x1ba3db(0xd6)),0x0;}}function a20_0x45e1(_0x47aa73,_0x30d549){_0x47aa73=_0x47aa73-0x90;const _0x25792f=a20_0x2579();let _0x45e102=_0x25792f[_0x47aa73];return _0x45e102;}export class EngageCampaignPauseCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xef);['description']=a20_0x1d3a8b(0xa2);async[a20_0x1d3a8b(0xcb)](_0xf5eb37){const _0xe9d02d=a20_0x1d3a8b,{options:_0x128fc2,args:_0xbd7918,tdx:_0x5797a9}=_0xf5eb37;if(_0xbd7918[_0xe9d02d(0xa4)]===0x0)return console[_0xe9d02d(0x98)](_0xe9d02d(0x121)),console[_0xe9d02d(0x98)](_0xe9d02d(0x11d)),0x1;const _0x501b1f=_0xbd7918[0x0],_0x517ece=_0x128fc2,_0x47e13c=await resolveWorkspaceIdFromOptions(_0x517ece,_0x5797a9);return await withSpinner(_0xe9d02d(0xf9)+_0x501b1f+'\x27...',()=>_0x5797a9['engage'][_0xe9d02d(0x10a)](_0x501b1f,_0x47e13c),{'verbose':_0x128fc2[_0xe9d02d(0x10b)]}),console[_0xe9d02d(0x113)](_0xe9d02d(0xa9)+_0x501b1f+_0xe9d02d(0xb3)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0x10e);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xe5);async[a20_0x1d3a8b(0xcb)](_0x55cbe2){const _0x1a763a=a20_0x1d3a8b,{options:_0x1b3e34,args:_0xabda97,tdx:_0x52a8a6}=_0x55cbe2;if(_0xabda97[_0x1a763a(0xa4)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x1a763a(0x98)](_0x1a763a(0xb1)),0x1;const _0x5436fd=_0xabda97[0x0],_0x5f2224=_0x1b3e34,_0x4947aa=await resolveWorkspaceIdFromOptions(_0x5f2224,_0x52a8a6);return await withSpinner(_0x1a763a(0x101)+_0x5436fd+_0x1a763a(0xf1),()=>_0x52a8a6[_0x1a763a(0xa6)][_0x1a763a(0x9b)](_0x5436fd,_0x4947aa),{'verbose':_0x1b3e34[_0x1a763a(0x10b)]}),console[_0x1a763a(0x113)](_0x1a763a(0xa9)+_0x5436fd+_0x1a763a(0xc6)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0x102);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xf2);async[a20_0x1d3a8b(0xcb)](_0x1c39d1){const _0x601b94=a20_0x1d3a8b,{options:_0x43fd17,args:_0x40fb1b,tdx:_0x1d26b5}=_0x1c39d1;if(_0x40fb1b[_0x601b94(0xa4)]===0x0)return console[_0x601b94(0x98)](_0x601b94(0x121)),console[_0x601b94(0x98)](_0x601b94(0xde)),0x1;const _0x242231=_0x40fb1b[0x0],_0x478318=_0x43fd17,_0x39d7b6=await resolveWorkspaceIdFromOptions(_0x478318,_0x1d26b5),_0x57da86=await withSpinner(_0x601b94(0xff)+_0x242231+'\x27...',()=>_0x1d26b5[_0x601b94(0xa6)][_0x601b94(0xca)](_0x242231,_0x39d7b6),{'verbose':_0x43fd17[_0x601b94(0x10b)]});return await handleSDKOutput([_0x57da86['data']],_0x43fd17),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a20_0x1d3a8b(0x122);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xcd);async[a20_0x1d3a8b(0xcb)](_0x61628b){const _0x230ff6=a20_0x1d3a8b,{options:_0xe89078,args:_0x5dac08,tdx:_0x4529aa}=_0x61628b,_0x13a737=_0x5dac08[0x0],_0x4973b6=resolveLimit(_0xe89078[_0x230ff6(0xd5)],DEFAULT_LLM_LIMIT),_0x16c5b1=_0xe89078,_0x32a450=await resolveWorkspaceIdFromOptions(_0x16c5b1,_0x4529aa),_0x447341=await withSpinner(_0x230ff6(0xe8),()=>_0x4529aa[_0x230ff6(0xa6)][_0x230ff6(0x108)]({'workspaceId':_0x32a450,'limit':_0x4973b6}),{'verbose':_0xe89078[_0x230ff6(0x10b)]});let _0x1e978b=_0x447341['data'];return _0x13a737&&(_0x1e978b=_0x447341[_0x230ff6(0x91)][_0x230ff6(0xb8)](_0x45bcda=>matchGlobPattern(_0x45bcda[_0x230ff6(0xe3)],_0x13a737))),await handleSDKOutput(_0x1e978b,_0xe89078),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0x99);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xbf);async[a20_0x1d3a8b(0xcb)](_0x4a2ff7){const _0x58a013=a20_0x1d3a8b,{options:_0x598b08,args:_0xeadf55,tdx:_0x1e4949}=_0x4a2ff7;if(_0xeadf55[_0x58a013(0xa4)]===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x58a013(0x115)),0x1;const _0x458ae4=_0xeadf55[0x0],_0x5bc6ea=_0x598b08,_0x2fd597=await resolveWorkspaceIdFromOptions(_0x5bc6ea,_0x1e4949),_0x566023=_0x5bc6ea[_0x58a013(0xdd)];if(_0x566023){const _0x29e51a=await withSpinner(_0x58a013(0xe2)+_0x458ae4+_0x58a013(0xf1),()=>_0x1e4949[_0x58a013(0xa6)]['getTemplateFull'](_0x458ae4,_0x2fd597),{'verbose':_0x598b08[_0x58a013(0x10b)]});await handleSDKOutput([_0x29e51a],_0x598b08);}else{const _0x38e281=await withSpinner(_0x58a013(0xe2)+_0x458ae4+_0x58a013(0xf1),()=>_0x1e4949['engage'][_0x58a013(0xd4)](_0x458ae4,_0x2fd597),{'verbose':_0x598b08['verbose']});await handleSDKOutput([_0x38e281],_0x598b08);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']='engage:template:create';['description']='Create\x20an\x20email\x20template';async[a20_0x1d3a8b(0xcb)](_0x4b1849){const _0x13a925=a20_0x1d3a8b,{options:_0x26a0e5,tdx:_0xfac02b}=_0x4b1849,_0x1309fa=_0x26a0e5,_0x218518=_0x1309fa[_0x13a925(0xe3)],_0x4a84f2=_0x1309fa[_0x13a925(0xeb)],_0x1872e9=_0x1309fa[_0x13a925(0xd7)];if(!_0x218518)return console['error'](_0x13a925(0xbc)),console[_0x13a925(0x98)]('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x4a84f2)return console[_0x13a925(0x98)](_0x13a925(0xa1)),0x1;if(!_0x1872e9)return console[_0x13a925(0x98)]('Error:\x20--html\x20is\x20required'),0x1;const _0x1c204d=await resolveWorkspaceIdFromOptions(_0x1309fa,_0xfac02b,!![]),_0x1c225c={'name':_0x218518,'subjectTemplate':_0x4a84f2,'htmlTemplate':_0x1872e9,'workspaceId':_0x1c204d,'plaintextTemplate':_0x1309fa[_0x13a925(0x114)],'editorType':_0x1309fa[_0x13a925(0xdc)]},_0xc6ab1a=await withSpinner(_0x13a925(0xd1)+_0x218518+'\x27...',()=>_0xfac02b[_0x13a925(0xa6)][_0x13a925(0xb7)](_0x1c225c));return await handleSDKOutput([_0xc6ab1a['data']],_0x26a0e5),0x0;}}function a20_0x2579(){const _0x396611=['createCampaign','Set\x20workspace\x20context\x20for\x20Engage\x20commands','engage:campaign:pause','100920phPApv','\x27...','Duplicate\x20a\x20campaign','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','updateTemplate','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','getCampaignFull','207mJVizy','getCampaign','Pausing\x20campaign\x20\x27','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','deleteTemplate','engage:workspace:show','startAt','jsonColumns','Duplicating\x20campaign\x20\x27','format','Resuming\x20campaign\x20\x27','engage:campaign:duplicate','276660oqRnnz','22449qWqWhQ','3458aJujKj','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Deleting\x20workspace\x20\x27','listTemplates','Delete\x20an\x20email\x20template','pauseCampaign','verbose','site','Creating\x20workspace\x20\x27','engage:campaign:resume','yes','segment','workspaceId','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','log','plaintext','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Options:\x20--name,\x20--description','Delete\x20a\x20workspace','parentId','description','updateWorkspace','Deleting\x20campaign\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Update\x20an\x20email\x20template','keys','Create\x20a\x20new\x20campaign','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:templates','resolveWorkspaceId','Error:\x20Workspace\x20name\x20is\x20required','data','type','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','getWorkspaceFull','\x27?\x20This\x20cannot\x20be\x20undone.','488ICqEEO','jsonl','error','engage:template:show','Workspace\x20is\x20required\x20for\x20this\x20operation','resumeCampaign','Fetching\x20campaigns...','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','175rqzvvr','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','engage:template:update','Error:\x20--subject\x20is\x20required','Pause\x20a\x20campaign','deleteCampaign','length','workspace','engage','timezone','entries','Campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Updating\x20template\x20\x27','Deleting\x20template\x20\x27','engage:campaign:delete','Engage\x20workspace\x20set\x20to:\x20','engage:template:delete','getWorkspace','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','engage:campaign:launch','\x27\x20paused\x20successfully','Fetching\x20workspace\x20\x27','Fetching\x20workspaces...','Fetching\x20campaign\x20\x27','createTemplate','filter','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','\x27\x20deleted\x20successfully','attributes','Error:\x20--name\x20is\x20required','Template\x20\x27','245788vypEcV','Show\x20email\x20template\x20details','799611AHBCGX','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','Operation\x20cancelled','Create\x20a\x20workspace','engage:workspace:create','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','\x27\x20resumed\x20successfully','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','deleteWorkspace','segmentId','duplicateCampaign','execute','List\x20campaigns','List\x20email\x20templates','engage:workspaces','fromEntries','engage_workspace','Creating\x20template\x20\x27','1759446zwAXUK','session','getTemplate','limit','\x27\x20launched\x20successfully','html','Launch\x20a\x20campaign','Update\x20a\x20workspace','Creating\x20campaign\x20\x27','parentName','editorType','full','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','List\x20workspaces','Verifying\x20workspace\x20\x27','Fetching\x20template\x20\x27','name','engage:workspace:delete','Resume\x20a\x20paused\x20campaign','resolvePathToResource','Updating\x20campaign\x20\x27','Fetching\x20templates...','map','json','subject','engage:workspace:use'];a20_0x2579=function(){return _0x396611;};return a20_0x2579();}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a20_0x1d3a8b(0xa0);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0x11e);async['execute'](_0x41b2a7){const _0x55d312=a20_0x1d3a8b,{options:_0x26c307,args:_0x4c4d75,tdx:_0x5e191a}=_0x41b2a7;if(_0x4c4d75['length']===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x55d312(0x98)]('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x30caaf=_0x4c4d75[0x0],_0x10b380=_0x26c307,_0x2db5df=await resolveWorkspaceIdFromOptions(_0x10b380,_0x5e191a),_0x4f8b11={'name':_0x10b380[_0x55d312(0xe3)],'subjectTemplate':_0x10b380[_0x55d312(0xeb)],'htmlTemplate':_0x10b380[_0x55d312(0xd7)],'plaintextTemplate':_0x10b380[_0x55d312(0x114)]},_0x232827=Object[_0x55d312(0xcf)](Object[_0x55d312(0xa8)](_0x4f8b11)[_0x55d312(0xb8)](([,_0x206e23])=>_0x206e23!==undefined));if(Object[_0x55d312(0x11f)](_0x232827)['length']===0x0)return console[_0x55d312(0x98)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x55d312(0x98)](_0x55d312(0xc5)),0x1;const _0x3230d8=await withSpinner(_0x55d312(0xab)+_0x30caaf+_0x55d312(0xf1),()=>_0x5e191a[_0x55d312(0xa6)][_0x55d312(0xf4)](_0x30caaf,_0x232827,_0x2db5df),{'verbose':_0x26c307[_0x55d312(0x10b)]});return await handleSDKOutput([_0x3230d8[_0x55d312(0x91)]],_0x26c307),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xaf);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0x109);async[a20_0x1d3a8b(0xcb)](_0x199407){const _0x1c5276=a20_0x1d3a8b,{options:_0x10dd38,args:_0xc6706e,tdx:_0x10ce5b}=_0x199407;if(_0xc6706e['length']===0x0)return console[_0x1c5276(0x98)](_0x1c5276(0xc7)),console[_0x1c5276(0x98)](_0x1c5276(0xc1)),0x1;const _0x304e3e=_0xc6706e[0x0],_0x28398d=_0x10dd38,_0x29e7e2=await resolveWorkspaceIdFromOptions(_0x28398d,_0x10ce5b);if(!_0x10dd38[_0x1c5276(0x10f)]){const _0x5a52b4=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x304e3e+_0x1c5276(0x95));if(!_0x5a52b4)return console[_0x1c5276(0x113)](_0x1c5276(0xc2)),0x0;}return await withSpinner(_0x1c5276(0xac)+_0x304e3e+'\x27...',()=>_0x10ce5b[_0x1c5276(0xa6)][_0x1c5276(0xfb)](_0x304e3e,_0x29e7e2),{'verbose':_0x10dd38['verbose']}),console[_0x1c5276(0x113)](_0x1c5276(0xbd)+_0x304e3e+_0x1c5276(0xba)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xce);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xe0);async[a20_0x1d3a8b(0xcb)](_0x47e050){const _0x50c99f=a20_0x1d3a8b,{options:_0xcdf62f,args:_0x40c087,tdx:_0x1bfb5a}=_0x47e050,_0x42a149=_0x40c087[0x0],_0x64fc50=resolveLimit(_0xcdf62f[_0x50c99f(0xd5)],DEFAULT_LLM_LIMIT),_0x1c464e=await withSpinner(_0x50c99f(0xb5),()=>_0x1bfb5a[_0x50c99f(0xa6)]['listWorkspaces']({'limit':_0x64fc50}),{'verbose':_0xcdf62f[_0x50c99f(0x10b)]});let _0x5591d3=_0x1c464e[_0x50c99f(0x91)];return _0x42a149&&(_0x5591d3=_0x1c464e[_0x50c99f(0x91)][_0x50c99f(0xb8)](_0x37307e=>matchGlobPattern(_0x37307e[_0x50c99f(0xe3)],_0x42a149))),await handleSDKOutput(_0x5591d3,_0xcdf62f),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']=a20_0x1d3a8b(0xfc);[a20_0x1d3a8b(0x119)]='Show\x20workspace\x20details';async['execute'](_0x8942ff){const _0x581eb3=a20_0x1d3a8b,{options:_0x580810,args:_0x3a1b92,tdx:_0x4b28d0}=_0x8942ff;if(_0x3a1b92[_0x581eb3(0xa4)]===0x0)return console[_0x581eb3(0x98)](_0x581eb3(0x93)),console['error'](_0x581eb3(0x106)),0x1;const _0x2802bf=_0x3a1b92[0x0],_0x116f26=_0x580810,_0xbb2351=_0x116f26[_0x581eb3(0xdd)];if(_0xbb2351){const _0x235358=await withSpinner(_0x581eb3(0xb4)+_0x2802bf+_0x581eb3(0xf1),()=>_0x4b28d0['engage'][_0x581eb3(0x94)](_0x2802bf),{'verbose':_0x580810[_0x581eb3(0x10b)]});await handleSDKOutput([_0x235358],_0x580810);}else{const _0x28492a=await withSpinner('Fetching\x20workspace\x20\x27'+_0x2802bf+_0x581eb3(0xf1),()=>_0x4b28d0[_0x581eb3(0xa6)][_0x581eb3(0xb0)](_0x2802bf),{'verbose':_0x580810[_0x581eb3(0x10b)]});await handleSDKOutput([_0x28492a],_0x580810);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xc4);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xc3);async[a20_0x1d3a8b(0xcb)](_0x1becdc){const _0x2eca84=a20_0x1d3a8b,{options:_0x20d53c,tdx:_0x57aea8}=_0x1becdc,_0xd0f209=_0x20d53c,_0x1c29bb=_0xd0f209['name'];if(!_0x1c29bb)return console['error'](_0x2eca84(0xbc)),console[_0x2eca84(0x98)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x105b72={'name':_0x1c29bb,'description':_0xd0f209[_0x2eca84(0x119)]},_0xe03cd7=await withSpinner(_0x2eca84(0x10d)+_0x1c29bb+_0x2eca84(0xf1),()=>_0x57aea8['engage']['createWorkspace'](_0x105b72));return await handleSDKOutput([_0xe03cd7['data']],_0x20d53c),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{['name']='engage:workspace:update';[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xd9);async[a20_0x1d3a8b(0xcb)](_0x5126e9){const _0x51b133=a20_0x1d3a8b,{options:_0x189820,args:_0x54a097,tdx:_0xf43983}=_0x5126e9;if(_0x54a097['length']===0x0)return console[_0x51b133(0x98)](_0x51b133(0x93)),console['error'](_0x51b133(0xf3)),0x1;const _0x4cd64d=_0x54a097[0x0],_0x43c954=_0x189820,_0x206950={'name':_0x43c954[_0x51b133(0xe3)],'description':_0x43c954[_0x51b133(0x119)]},_0x710edc=Object[_0x51b133(0xcf)](Object['entries'](_0x206950)[_0x51b133(0xb8)](([,_0x1d078d])=>_0x1d078d!==undefined));if(Object[_0x51b133(0x11f)](_0x710edc)[_0x51b133(0xa4)]===0x0)return console[_0x51b133(0x98)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x51b133(0x98)](_0x51b133(0x116)),0x1;const _0x5dc7d2=await withSpinner('Updating\x20workspace\x20\x27'+_0x4cd64d+_0x51b133(0xf1),()=>_0xf43983['engage'][_0x51b133(0x11a)](_0x4cd64d,_0x710edc),{'verbose':_0x189820[_0x51b133(0x10b)]});return await handleSDKOutput([_0x5dc7d2['data']],_0x189820),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xe4);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0x117);async['execute'](_0x27f670){const _0x2b80a5=a20_0x1d3a8b,{options:_0x2e4b09,args:_0x746566,tdx:_0x44e837}=_0x27f670;if(_0x746566[_0x2b80a5(0xa4)]===0x0)return console['error'](_0x2b80a5(0x93)),console[_0x2b80a5(0x98)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x27a3b4=_0x746566[0x0];if(!_0x2e4b09[_0x2b80a5(0x10f)]){const _0x2c3872=await confirm(_0x2b80a5(0x112)+_0x27a3b4+_0x2b80a5(0x95));if(!_0x2c3872)return console[_0x2b80a5(0x113)](_0x2b80a5(0xc2)),0x0;}return await withSpinner(_0x2b80a5(0x107)+_0x27a3b4+_0x2b80a5(0xf1),()=>_0x44e837['engage'][_0x2b80a5(0xc8)](_0x27a3b4),{'verbose':_0x2e4b09['verbose']}),console[_0x2b80a5(0x113)]('Workspace\x20\x27'+_0x27a3b4+_0x2b80a5(0xba)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xec);['description']=a20_0x1d3a8b(0xee);async[a20_0x1d3a8b(0xcb)](_0x4c645b){const _0x46b03a=a20_0x1d3a8b,{options:_0x3cc3f8,args:_0x5498a1,tdx:_0x1b467a}=_0x4c645b;if(_0x5498a1['length']===0x0)return console[_0x46b03a(0x98)](_0x46b03a(0x90)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x51550c=_0x5498a1[0x0];await withSpinner(_0x46b03a(0xe1)+_0x51550c+_0x46b03a(0xf1),()=>_0x1b467a['engage'][_0x46b03a(0x123)](_0x51550c));const _0x42024f=_0x3cc3f8['session']||undefined;return saveSessionContext({'engage_workspace':_0x51550c},_0x42024f),console[_0x46b03a(0x113)](_0x46b03a(0xae)+_0x51550c),console[_0x46b03a(0x113)](_0x46b03a(0xfa)),0x0;}}
1
+ const a20_0x4ffd04=a20_0x3407;(function(_0x4c6853,_0x105e46){const _0x47c762=a20_0x3407,_0x2e85a4=_0x4c6853();while(!![]){try{const _0x25c3b2=-parseInt(_0x47c762(0x16b))/0x1+-parseInt(_0x47c762(0x154))/0x2+parseInt(_0x47c762(0x10a))/0x3*(-parseInt(_0x47c762(0xef))/0x4)+parseInt(_0x47c762(0x12a))/0x5+-parseInt(_0x47c762(0x11a))/0x6*(parseInt(_0x47c762(0x105))/0x7)+parseInt(_0x47c762(0x13a))/0x8*(parseInt(_0x47c762(0x108))/0x9)+parseInt(_0x47c762(0x14d))/0xa;if(_0x25c3b2===_0x105e46)break;else _0x2e85a4['push'](_0x2e85a4['shift']());}catch(_0x2eff94){_0x2e85a4['push'](_0x2e85a4['shift']());}}}(a20_0x27cf,0xefb0b));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';export async function resolveWorkspaceIdFromOptions(_0x2d003c,_0x423957,_0x504f09=![]){const _0x34f5ca=a20_0x3407;if(_0x2d003c[_0x34f5ca(0x165)])return await _0x423957[_0x34f5ca(0x184)][_0x34f5ca(0xf6)](_0x2d003c[_0x34f5ca(0x165)]);const _0x8363f8=loadSessionContext(_0x2d003c[_0x34f5ca(0x17f)]);if(_0x8363f8?.[_0x34f5ca(0x160)])return await _0x423957[_0x34f5ca(0x184)][_0x34f5ca(0xf6)](_0x8363f8['engage_workspace']);if(_0x504f09)throw new SDKError(ErrorCode[_0x34f5ca(0x145)],_0x34f5ca(0x10b),undefined,{'helpText':_0x34f5ca(0x113)});return undefined;}async function resolveSegmentFromOptions(_0x2be12b,_0x49279e){const _0x3d5438=a20_0x3407;if(!_0x2be12b[_0x3d5438(0x180)])return{};const _0x3894cc=_0x2be12b['segment'],_0x3ae2f4=await _0x49279e[_0x3d5438(0x180)][_0x3d5438(0x15e)](_0x3894cc);return{'audienceId':_0x3ae2f4[_0x3d5438(0x142)],'audienceName':_0x3ae2f4[_0x3d5438(0x123)],..._0x3ae2f4[_0x3d5438(0x13f)]&&{'segmentId':_0x3ae2f4['segmentId'],'segmentName':_0x3ae2f4[_0x3d5438(0x12d)]}};}function buildConnectorConfig(_0x436137){const _0x14e1d2=a20_0x3407,_0x46c75f=_0x436137[_0x14e1d2(0x134)],_0x5efd17=_0x436137[_0x14e1d2(0x107)];if(!_0x46c75f&&!_0x5efd17)return undefined;return{..._0x46c75f&&{'emailSenderId':_0x46c75f},..._0x5efd17&&{'jsonColumns':_0x5efd17}};}export class EngageCampaignsCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x163);['description']=a20_0x4ffd04(0x17d);async[a20_0x4ffd04(0xf7)](_0x45283b){const _0x2277cb=a20_0x4ffd04,{options:_0x56a07,args:_0x5a89d5,tdx:_0x5d3718}=_0x45283b,_0x5a26ed=_0x5a89d5[0x0],_0x591fbb=resolveLimit(_0x56a07[_0x2277cb(0x12b)],DEFAULT_LLM_LIMIT),_0x242b22=_0x56a07,_0x3831e0=_0x242b22['type'],_0x27f011=_0x242b22[_0x2277cb(0x126)],_0x595c63=await resolveWorkspaceIdFromOptions(_0x242b22,_0x5d3718),_0x43702b=await withSpinner(_0x2277cb(0x11b),()=>_0x5d3718[_0x2277cb(0x184)][_0x2277cb(0xf0)]({'type':_0x3831e0,'status':_0x27f011,'workspaceId':_0x595c63,'limit':_0x591fbb}),{'verbose':_0x56a07['verbose']});let _0x512af2=_0x43702b['data'];_0x5a26ed&&(_0x512af2=_0x43702b['data'][_0x2277cb(0xfb)](_0x5d17e2=>matchGlobPattern(_0x5d17e2['name'],_0x5a26ed)));const _0x1a79ec=_0x56a07[_0x2277cb(0xff)];if(_0x56a07[_0x2277cb(0x119)]===_0x2277cb(0x12e)||_0x56a07['format']===_0x2277cb(0xf2)){const _0x2d1330=_0x512af2[_0x2277cb(0x14e)](_0x579c33=>({..._0x579c33,'url':_0x579c33[_0x2277cb(0x124)]?getCampaignUrl(_0x1a79ec,_0x579c33['workspaceId'],_0x579c33['id']):undefined}));await handleSDKOutput(_0x2d1330,_0x56a07);}else await handleSDKOutput(_0x512af2,_0x56a07);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x166);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x148);async[a20_0x4ffd04(0xf7)](_0x20013f){const _0xb16500=a20_0x4ffd04,{options:_0x185d46,args:_0x7a9ece,tdx:_0x249868}=_0x20013f;if(_0x7a9ece['length']===0x0)return console[_0xb16500(0x155)](_0xb16500(0x13b)),console[_0xb16500(0x155)](_0xb16500(0x13c)),0x1;const _0x168016=_0x7a9ece[0x0],_0x3c57b5=_0x185d46,_0x286909=await resolveWorkspaceIdFromOptions(_0x3c57b5,_0x249868),_0x2a6cfd=_0x3c57b5['full'],_0x5baf81=_0x185d46['site'];if(_0x2a6cfd){const _0x45fb49=await withSpinner(_0xb16500(0x11e)+_0x168016+_0xb16500(0x183),()=>_0x249868[_0xb16500(0x184)][_0xb16500(0x15b)](_0x168016,_0x286909),{'verbose':_0x185d46['verbose']}),_0x282051=_0x45fb49[_0xb16500(0x151)],_0x3c4b5f=_0x282051[_0xb16500(0x156)][_0xb16500(0x124)]?getCampaignUrl(_0x5baf81,_0x282051[_0xb16500(0x156)][_0xb16500(0x124)],_0x282051['id']):undefined;await handleSDKOutput([{..._0x282051,..._0x3c4b5f&&{'url':_0x3c4b5f}}],_0x185d46);}else{const _0xb7d72=await withSpinner('Fetching\x20campaign\x20\x27'+_0x168016+_0xb16500(0x183),()=>_0x249868[_0xb16500(0x184)]['getCampaign'](_0x168016,_0x286909),{'verbose':_0x185d46['verbose']}),_0xb92e7c=_0xb7d72[_0xb16500(0x151)],_0x1fe8e2=_0xb92e7c[_0xb16500(0x124)]?getCampaignUrl(_0x5baf81,_0xb92e7c[_0xb16500(0x124)],_0xb92e7c['id']):undefined;await handleSingleObjectOutput({..._0xb92e7c,..._0x1fe8e2&&{'url':_0x1fe8e2}},_0x185d46);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a20_0x4ffd04(0x16d);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x172);async[a20_0x4ffd04(0xf7)](_0x550440){const _0x192a54=a20_0x4ffd04,{options:_0x26e163,tdx:_0x56aaa9}=_0x550440,_0x3f2090=_0x26e163,_0x3169d1=_0x3f2090[_0x192a54(0x170)],_0x367200=_0x3f2090[_0x192a54(0x117)];if(!_0x3169d1)return console[_0x192a54(0x155)](_0x192a54(0x181)),console[_0x192a54(0x155)](_0x192a54(0x100)),0x1;if(!_0x367200)return console[_0x192a54(0x155)](_0x192a54(0x182)),console['error'](_0x192a54(0x100)),0x1;const _0x2033a0=await resolveWorkspaceIdFromOptions(_0x3f2090,_0x56aaa9,!![]),_0x4125f6=await resolveSegmentFromOptions(_0x3f2090,_0x56aaa9),_0x146c70=buildConnectorConfig(_0x3f2090),_0x1233a7={'name':_0x3169d1,'campaignType':_0x367200,'workspaceId':_0x2033a0,'description':_0x3f2090[_0x192a54(0x102)],..._0x4125f6,'connectorConfig':_0x146c70,'startAt':_0x3f2090[_0x192a54(0x167)],'timezone':_0x3f2090[_0x192a54(0x143)]},_0x11e247=await withSpinner('Creating\x20campaign\x20\x27'+_0x3169d1+_0x192a54(0x183),()=>_0x56aaa9[_0x192a54(0x184)]['createCampaign'](_0x1233a7));return await handleSDKOutput([_0x11e247[_0x192a54(0x151)]],_0x26e163),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a20_0x4ffd04(0x109);['description']='Update\x20a\x20campaign';async['execute'](_0x828ffc){const _0x831464=a20_0x4ffd04,{options:_0xe440ae,args:_0x405c1e,tdx:_0x463675}=_0x828ffc;if(_0x405c1e[_0x831464(0x135)]===0x0)return console[_0x831464(0x155)](_0x831464(0x13b)),console[_0x831464(0x155)](_0x831464(0x16c)),0x1;const _0xf9ecad=_0x405c1e[0x0],_0x2fcb0d=_0xe440ae,_0x3e0e6d=await resolveWorkspaceIdFromOptions(_0x2fcb0d,_0x463675),_0xbf57c=await resolveSegmentFromOptions(_0x2fcb0d,_0x463675),_0x240372=buildConnectorConfig(_0x2fcb0d),_0x4afd5f={'name':_0x2fcb0d[_0x831464(0x170)],'description':_0x2fcb0d['description'],..._0xbf57c,'connectorConfig':_0x240372,'startAt':_0x2fcb0d['startAt'],'timezone':_0x2fcb0d[_0x831464(0x143)]},_0x2480a4=Object[_0x831464(0x187)](Object[_0x831464(0x140)](_0x4afd5f)[_0x831464(0xfb)](([,_0x222ae2])=>_0x222ae2!==undefined));if(Object['keys'](_0x2480a4)[_0x831464(0x135)]===0x0)return console[_0x831464(0x155)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x831464(0x137)),0x1;const _0x189bf9=await withSpinner(_0x831464(0x144)+_0xf9ecad+_0x831464(0x183),()=>_0x463675[_0x831464(0x184)][_0x831464(0x14c)](_0xf9ecad,_0x2480a4,_0x3e0e6d),{'verbose':_0xe440ae[_0x831464(0x16f)]});return await handleSDKOutput([_0x189bf9['data']],_0xe440ae),0x0;}}function a20_0x3407(_0x4df060,_0x4ccbd7){_0x4df060=_0x4df060-0xee;const _0x27cfb2=a20_0x27cf();let _0x340704=_0x27cfb2[_0x4df060];return _0x340704;}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a20_0x4ffd04(0x186);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x10d);async[a20_0x4ffd04(0xf7)](_0x2d5fe5){const _0x20a833=a20_0x4ffd04,{options:_0x27eea3,args:_0x2e2c55,tdx:_0x24093d}=_0x2d5fe5;if(_0x2e2c55['length']===0x0)return console[_0x20a833(0x155)](_0x20a833(0x13b)),console[_0x20a833(0x155)](_0x20a833(0x104)),0x1;const _0x41c6eb=_0x2e2c55[0x0],_0x3c40bc=_0x27eea3,_0x44dca1=await resolveWorkspaceIdFromOptions(_0x3c40bc,_0x24093d);if(!_0x27eea3['yes']){const _0x3dbec7=await confirm(_0x20a833(0xf1)+_0x41c6eb+_0x20a833(0x133));if(!_0x3dbec7)return console[_0x20a833(0xfc)](_0x20a833(0x15c)),0x0;}return await withSpinner(_0x20a833(0x17a)+_0x41c6eb+_0x20a833(0x183),()=>_0x24093d[_0x20a833(0x184)][_0x20a833(0x101)](_0x41c6eb,_0x44dca1),{'verbose':_0x27eea3['verbose']}),console[_0x20a833(0xfc)](_0x20a833(0x146)+_0x41c6eb+_0x20a833(0x139)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x179);['description']=a20_0x4ffd04(0x12c);async[a20_0x4ffd04(0xf7)](_0x3e2b78){const _0x39c09d=a20_0x4ffd04,{options:_0x582b82,args:_0x3cbe70,tdx:_0xda68c8}=_0x3e2b78;if(_0x3cbe70[_0x39c09d(0x135)]===0x0)return console['error'](_0x39c09d(0x13b)),console[_0x39c09d(0x155)](_0x39c09d(0x174)),0x1;const _0x5b74bb=_0x3cbe70[0x0],_0x177082=_0x582b82,_0x41b8b5=await resolveWorkspaceIdFromOptions(_0x177082,_0xda68c8);return await withSpinner(_0x39c09d(0x159)+_0x5b74bb+_0x39c09d(0x183),()=>_0xda68c8[_0x39c09d(0x184)][_0x39c09d(0x16a)](_0x5b74bb,_0x41b8b5),{'verbose':_0x582b82['verbose']}),console[_0x39c09d(0xfc)](_0x39c09d(0x146)+_0x5b74bb+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a20_0x4ffd04(0x130);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0xfa);async['execute'](_0x257539){const _0xad3f7=a20_0x4ffd04,{options:_0xbbdb16,args:_0x398358,tdx:_0x39ef07}=_0x257539;if(_0x398358[_0xad3f7(0x135)]===0x0)return console[_0xad3f7(0x155)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0xad3f7(0x178)),0x1;const _0x4d9503=_0x398358[0x0],_0x4ab296=_0xbbdb16,_0x5bd829=await resolveWorkspaceIdFromOptions(_0x4ab296,_0x39ef07);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x4d9503+_0xad3f7(0x183),()=>_0x39ef07['engage'][_0xad3f7(0x129)](_0x4d9503,_0x5bd829),{'verbose':_0xbbdb16['verbose']}),console[_0xad3f7(0xfc)](_0xad3f7(0x146)+_0x4d9503+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x120);[a20_0x4ffd04(0x102)]='Resume\x20a\x20paused\x20campaign';async[a20_0x4ffd04(0xf7)](_0x5ccb6a){const _0x286226=a20_0x4ffd04,{options:_0x44ecdb,args:_0x64c35c,tdx:_0x448113}=_0x5ccb6a;if(_0x64c35c[_0x286226(0x135)]===0x0)return console[_0x286226(0x155)](_0x286226(0x13b)),console[_0x286226(0x155)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x4d3d8a=_0x64c35c[0x0],_0x5bced1=_0x44ecdb,_0x268d9e=await resolveWorkspaceIdFromOptions(_0x5bced1,_0x448113);return await withSpinner('Resuming\x20campaign\x20\x27'+_0x4d3d8a+_0x286226(0x183),()=>_0x448113['engage'][_0x286226(0x118)](_0x4d3d8a,_0x268d9e),{'verbose':_0x44ecdb['verbose']}),console[_0x286226(0xfc)](_0x286226(0x146)+_0x4d3d8a+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x11d);['description']=a20_0x4ffd04(0x12f);async[a20_0x4ffd04(0xf7)](_0x5b18e1){const _0x1fe7bd=a20_0x4ffd04,{options:_0x264129,args:_0x262db5,tdx:_0x3293aa}=_0x5b18e1;if(_0x262db5[_0x1fe7bd(0x135)]===0x0)return console['error'](_0x1fe7bd(0x13b)),console[_0x1fe7bd(0x155)](_0x1fe7bd(0x112)),0x1;const _0x1b871d=_0x262db5[0x0],_0x95b8ee=_0x264129,_0x25306a=await resolveWorkspaceIdFromOptions(_0x95b8ee,_0x3293aa),_0x18d0c0=await withSpinner(_0x1fe7bd(0x14b)+_0x1b871d+_0x1fe7bd(0x183),()=>_0x3293aa[_0x1fe7bd(0x184)][_0x1fe7bd(0x11f)](_0x1b871d,_0x25306a),{'verbose':_0x264129[_0x1fe7bd(0x16f)]});return await handleSDKOutput([_0x18d0c0[_0x1fe7bd(0x151)]],_0x264129),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x153);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x171);async['execute'](_0x36cd50){const _0x28ae61=a20_0x4ffd04,{options:_0x1cc9b7,args:_0x2dfeda,tdx:_0x4996d0}=_0x36cd50,_0x14f254=_0x2dfeda[0x0],_0x166005=resolveLimit(_0x1cc9b7[_0x28ae61(0x12b)],DEFAULT_LLM_LIMIT),_0x219253=_0x1cc9b7,_0x2000d0=await resolveWorkspaceIdFromOptions(_0x219253,_0x4996d0),_0x2235c1=await withSpinner(_0x28ae61(0xee),()=>_0x4996d0[_0x28ae61(0x184)][_0x28ae61(0xf5)]({'workspaceId':_0x2000d0,'limit':_0x166005}),{'verbose':_0x1cc9b7['verbose']});let _0x2622cf=_0x2235c1[_0x28ae61(0x151)];return _0x14f254&&(_0x2622cf=_0x2235c1['data'][_0x28ae61(0xfb)](_0x3c3ec9=>matchGlobPattern(_0x3c3ec9[_0x28ae61(0x170)],_0x14f254))),await handleSDKOutput(_0x2622cf,_0x1cc9b7),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']=a20_0x4ffd04(0x147);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0xf4);async[a20_0x4ffd04(0xf7)](_0x2e861c){const _0x36134e=a20_0x4ffd04,{options:_0x272dc7,args:_0x2ccab2,tdx:_0x3a1f9b}=_0x2e861c;if(_0x2ccab2[_0x36134e(0x135)]===0x0)return console[_0x36134e(0x155)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x36134e(0x155)](_0x36134e(0x17c)),0x1;const _0x732e3c=_0x2ccab2[0x0],_0x5e3c67=_0x272dc7,_0xa223b0=await resolveWorkspaceIdFromOptions(_0x5e3c67,_0x3a1f9b),_0x9e6a57=_0x5e3c67['full'];if(_0x9e6a57){const _0x33b3f9=await withSpinner(_0x36134e(0x115)+_0x732e3c+'\x27...',()=>_0x3a1f9b['engage'][_0x36134e(0x111)](_0x732e3c,_0xa223b0),{'verbose':_0x272dc7[_0x36134e(0x16f)]});await handleSDKOutput([_0x33b3f9],_0x272dc7);}else{const _0x35e8b1=await withSpinner('Fetching\x20template\x20\x27'+_0x732e3c+_0x36134e(0x183),()=>_0x3a1f9b['engage'][_0x36134e(0x125)](_0x732e3c,_0xa223b0),{'verbose':_0x272dc7['verbose']});await handleSDKOutput([_0x35e8b1],_0x272dc7);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a20_0x4ffd04(0x170)]='engage:template:create';[a20_0x4ffd04(0x102)]='Create\x20an\x20email\x20template';async[a20_0x4ffd04(0xf7)](_0x159aef){const _0x547f1c=a20_0x4ffd04,{options:_0x1bd77b,tdx:_0x499437}=_0x159aef,_0xde517d=_0x1bd77b,_0x94c1aa=_0xde517d[_0x547f1c(0x170)],_0xb1d4f6=_0xde517d[_0x547f1c(0x169)],_0x483470=_0xde517d[_0x547f1c(0x13e)];if(!_0x94c1aa)return console[_0x547f1c(0x155)](_0x547f1c(0x181)),console[_0x547f1c(0x155)](_0x547f1c(0x141)),0x1;if(!_0xb1d4f6)return console['error'](_0x547f1c(0x164)),0x1;if(!_0x483470)return console['error'](_0x547f1c(0x122)),0x1;const _0x288302=await resolveWorkspaceIdFromOptions(_0xde517d,_0x499437,!![]),_0x2466a3={'name':_0x94c1aa,'subjectTemplate':_0xb1d4f6,'htmlTemplate':_0x483470,'workspaceId':_0x288302,'plaintextTemplate':_0xde517d[_0x547f1c(0x149)],'editorType':_0xde517d[_0x547f1c(0x110)]},_0x1903cf=await withSpinner(_0x547f1c(0x15f)+_0x94c1aa+_0x547f1c(0x183),()=>_0x499437['engage'][_0x547f1c(0x136)](_0x2466a3));return await handleSDKOutput([_0x1903cf['data']],_0x1bd77b),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x158);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x177);async[a20_0x4ffd04(0xf7)](_0x5dca75){const _0x423fbb=a20_0x4ffd04,{options:_0x43a8a7,args:_0x26f651,tdx:_0x4c9b1d}=_0x5dca75;if(_0x26f651[_0x423fbb(0x135)]===0x0)return console[_0x423fbb(0x155)](_0x423fbb(0x16e)),console[_0x423fbb(0x155)]('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x29dda2=_0x26f651[0x0],_0x1d3888=_0x43a8a7,_0x2300dc=await resolveWorkspaceIdFromOptions(_0x1d3888,_0x4c9b1d),_0x54f09e={'name':_0x1d3888['name'],'subjectTemplate':_0x1d3888[_0x423fbb(0x169)],'htmlTemplate':_0x1d3888[_0x423fbb(0x13e)],'plaintextTemplate':_0x1d3888[_0x423fbb(0x149)]},_0x542627=Object[_0x423fbb(0x187)](Object['entries'](_0x54f09e)[_0x423fbb(0xfb)](([,_0x222abb])=>_0x222abb!==undefined));if(Object[_0x423fbb(0x152)](_0x542627)['length']===0x0)return console[_0x423fbb(0x155)](_0x423fbb(0x10e)),console[_0x423fbb(0x155)]('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x182041=await withSpinner(_0x423fbb(0x173)+_0x29dda2+'\x27...',()=>_0x4c9b1d[_0x423fbb(0x184)][_0x423fbb(0x168)](_0x29dda2,_0x542627,_0x2300dc),{'verbose':_0x43a8a7[_0x423fbb(0x16f)]});return await handleSDKOutput([_0x182041[_0x423fbb(0x151)]],_0x43a8a7),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']='engage:template:delete';['description']=a20_0x4ffd04(0x157);async['execute'](_0x358891){const _0x73ed87=a20_0x4ffd04,{options:_0x4105b9,args:_0x5879e0,tdx:_0x4f257c}=_0x358891;if(_0x5879e0['length']===0x0)return console['error'](_0x73ed87(0x16e)),console[_0x73ed87(0x155)](_0x73ed87(0x114)),0x1;const _0x1174a6=_0x5879e0[0x0],_0x5b1e18=_0x4105b9,_0x50c549=await resolveWorkspaceIdFromOptions(_0x5b1e18,_0x4f257c);if(!_0x4105b9['yes']){const _0x4e3dab=await confirm(_0x73ed87(0x14a)+_0x1174a6+_0x73ed87(0x133));if(!_0x4e3dab)return console[_0x73ed87(0xfc)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x73ed87(0x128)+_0x1174a6+_0x73ed87(0x183),()=>_0x4f257c[_0x73ed87(0x184)]['deleteTemplate'](_0x1174a6,_0x50c549),{'verbose':_0x4105b9[_0x73ed87(0x16f)]}),console['log'](_0x73ed87(0x175)+_0x1174a6+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x15d);[a20_0x4ffd04(0x102)]='List\x20workspaces';async[a20_0x4ffd04(0xf7)](_0x5bd2ae){const _0x231aee=a20_0x4ffd04,{options:_0x28c1f3,args:_0x5b366e,tdx:_0x4c4b10}=_0x5bd2ae,_0x278ef1=_0x5b366e[0x0],_0xdc179=resolveLimit(_0x28c1f3[_0x231aee(0x12b)],DEFAULT_LLM_LIMIT),_0x4ff9e3=await withSpinner(_0x231aee(0x161),()=>_0x4c4b10[_0x231aee(0x184)][_0x231aee(0x10c)]({'limit':_0xdc179}),{'verbose':_0x28c1f3[_0x231aee(0x16f)]});let _0x559a74=_0x4ff9e3['data'];return _0x278ef1&&(_0x559a74=_0x4ff9e3[_0x231aee(0x151)][_0x231aee(0xfb)](_0x3f5fc8=>matchGlobPattern(_0x3f5fc8[_0x231aee(0x170)],_0x278ef1))),await handleSDKOutput(_0x559a74,_0x28c1f3),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']='engage:workspace:show';[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x13d);async[a20_0x4ffd04(0xf7)](_0xf94da1){const _0x301b7a=a20_0x4ffd04,{options:_0x35833b,args:_0x1468ff,tdx:_0x3a5e45}=_0xf94da1;if(_0x1468ff[_0x301b7a(0x135)]===0x0)return console[_0x301b7a(0x155)](_0x301b7a(0x17e)),console[_0x301b7a(0x155)](_0x301b7a(0x150)),0x1;const _0x2e52fb=_0x1468ff[0x0],_0x311fe8=_0x35833b,_0x252274=_0x311fe8['full'];if(_0x252274){const _0x11d597=await withSpinner('Fetching\x20workspace\x20\x27'+_0x2e52fb+_0x301b7a(0x183),()=>_0x3a5e45[_0x301b7a(0x184)][_0x301b7a(0xfe)](_0x2e52fb),{'verbose':_0x35833b[_0x301b7a(0x16f)]});await handleSDKOutput([_0x11d597],_0x35833b);}else{const _0x100735=await withSpinner(_0x301b7a(0x121)+_0x2e52fb+_0x301b7a(0x183),()=>_0x3a5e45[_0x301b7a(0x184)]['getWorkspace'](_0x2e52fb),{'verbose':_0x35833b[_0x301b7a(0x16f)]});await handleSDKOutput([_0x100735],_0x35833b);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a20_0x4ffd04(0x170)]='engage:workspace:create';[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x11c);async[a20_0x4ffd04(0xf7)](_0x1c90f4){const _0x26e0f6=a20_0x4ffd04,{options:_0x11e0d6,tdx:_0x473283}=_0x1c90f4,_0x4fd246=_0x11e0d6,_0x5510a4=_0x4fd246['name'];if(!_0x5510a4)return console[_0x26e0f6(0x155)](_0x26e0f6(0x181)),console[_0x26e0f6(0x155)](_0x26e0f6(0x162)),0x1;const _0x4549c2={'name':_0x5510a4,'description':_0x4fd246[_0x26e0f6(0x102)]},_0x2563b4=await withSpinner('Creating\x20workspace\x20\x27'+_0x5510a4+_0x26e0f6(0x183),()=>_0x473283['engage'][_0x26e0f6(0x103)](_0x4549c2));return await handleSDKOutput([_0x2563b4[_0x26e0f6(0x151)]],_0x11e0d6),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x131);[a20_0x4ffd04(0x102)]='Update\x20a\x20workspace';async[a20_0x4ffd04(0xf7)](_0x1211aa){const _0xe13a34=a20_0x4ffd04,{options:_0x58249c,args:_0x1dd6e,tdx:_0x2b4e4f}=_0x1211aa;if(_0x1dd6e[_0xe13a34(0x135)]===0x0)return console['error'](_0xe13a34(0x17e)),console[_0xe13a34(0x155)](_0xe13a34(0x15a)),0x1;const _0x88c30f=_0x1dd6e[0x0],_0x2d2e9a=_0x58249c,_0x2eb378={'name':_0x2d2e9a['name'],'description':_0x2d2e9a[_0xe13a34(0x102)]},_0x470bf0=Object['fromEntries'](Object[_0xe13a34(0x140)](_0x2eb378)[_0xe13a34(0xfb)](([,_0x535f9a])=>_0x535f9a!==undefined));if(Object[_0xe13a34(0x152)](_0x470bf0)['length']===0x0)return console[_0xe13a34(0x155)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0xe13a34(0x155)]('Options:\x20--name,\x20--description'),0x1;const _0x464052=await withSpinner(_0xe13a34(0x17b)+_0x88c30f+_0xe13a34(0x183),()=>_0x2b4e4f['engage'][_0xe13a34(0x116)](_0x88c30f,_0x470bf0),{'verbose':_0x58249c[_0xe13a34(0x16f)]});return await handleSDKOutput([_0x464052[_0xe13a34(0x151)]],_0x58249c),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x127);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x185);async['execute'](_0x2ce902){const _0x5a7077=a20_0x4ffd04,{options:_0x2d4b36,args:_0x11a795,tdx:_0x42f47a}=_0x2ce902;if(_0x11a795[_0x5a7077(0x135)]===0x0)return console[_0x5a7077(0x155)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x5a7077(0x155)](_0x5a7077(0xf8)),0x1;const _0x391e20=_0x11a795[0x0];if(!_0x2d4b36[_0x5a7077(0x138)]){const _0x55144d=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x391e20+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x55144d)return console[_0x5a7077(0xfc)]('Operation\x20cancelled'),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x391e20+_0x5a7077(0x183),()=>_0x42f47a['engage'][_0x5a7077(0x132)](_0x391e20),{'verbose':_0x2d4b36[_0x5a7077(0x16f)]}),console[_0x5a7077(0xfc)](_0x5a7077(0x176)+_0x391e20+_0x5a7077(0x139)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x10f);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0xf3);async[a20_0x4ffd04(0xf7)](_0x3105d3){const _0x306eec=a20_0x4ffd04,{options:_0x547677,args:_0x23f08d,tdx:_0x76e79}=_0x3105d3;if(_0x23f08d[_0x306eec(0x135)]===0x0)return console[_0x306eec(0x155)](_0x306eec(0xfd)),console['error'](_0x306eec(0x106)),0x1;const _0x13d3b5=_0x23f08d[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0x13d3b5+_0x306eec(0x183),()=>_0x76e79[_0x306eec(0x184)][_0x306eec(0xf6)](_0x13d3b5));const _0x2ea2d5=_0x547677[_0x306eec(0x17f)]||undefined;return saveSessionContext({'engage_workspace':_0x13d3b5},_0x2ea2d5),console[_0x306eec(0xfc)](_0x306eec(0x14f)+_0x13d3b5),console[_0x306eec(0xfc)](_0x306eec(0xf9)),0x0;}}function a20_0x27cf(){const _0x187c07=['Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Template\x20\x27','Workspace\x20\x27','Update\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','engage:campaign:launch','Deleting\x20campaign\x20\x27','Updating\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','List\x20campaigns','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','session','segment','Error:\x20--name\x20is\x20required','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','\x27...','engage','Delete\x20a\x20workspace','engage:campaign:delete','fromEntries','Fetching\x20templates...','348100BmbOyS','listCampaigns','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','jsonl','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Show\x20email\x20template\x20details','listTemplates','resolveWorkspaceId','execute','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Pause\x20a\x20campaign','filter','log','Error:\x20Workspace\x20name\x20is\x20required','getWorkspaceFull','site','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','deleteCampaign','description','createWorkspace','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','1239dyFlzD','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','jsonColumns','1046295lUIihN','engage:campaign:update','9QLswKy','Workspace\x20is\x20required\x20for\x20this\x20operation','listWorkspaces','Delete\x20a\x20campaign','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','engage:workspace:use','editorType','getTemplateFull','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','Fetching\x20template\x20\x27','updateWorkspace','type','resumeCampaign','format','5766XOBmJC','Fetching\x20campaigns...','Create\x20a\x20workspace','engage:campaign:duplicate','Fetching\x20campaign\x20\x27','duplicateCampaign','engage:campaign:resume','Fetching\x20workspace\x20\x27','Error:\x20--html\x20is\x20required','parentName','workspaceId','getTemplate','status','engage:workspace:delete','Deleting\x20template\x20\x27','pauseCampaign','2121195WIGXTz','limit','Launch\x20a\x20campaign','segmentName','json','Duplicate\x20a\x20campaign','engage:campaign:pause','engage:workspace:update','deleteWorkspace','\x27?\x20This\x20cannot\x20be\x20undone.','emailSenderId','length','createTemplate','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','yes','\x27\x20deleted\x20successfully','112GMznWx','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Show\x20workspace\x20details','html','segmentId','entries','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','parentId','timezone','Updating\x20campaign\x20\x27','MISSING_ARGUMENT','Campaign\x20\x27','engage:template:show','Show\x20campaign\x20details','plaintext','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Duplicating\x20campaign\x20\x27','updateCampaign','2897180QnWpkq','map','Engage\x20workspace\x20set\x20to:\x20','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','data','keys','engage:templates','886782uRGGcL','error','attributes','Delete\x20an\x20email\x20template','engage:template:update','Launching\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','getCampaignFull','Operation\x20cancelled','engage:workspaces','resolvePathToResource','Creating\x20template\x20\x27','engage_workspace','Fetching\x20workspaces...','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','engage:campaigns','Error:\x20--subject\x20is\x20required','workspace','engage:campaign:show','startAt','updateTemplate','subject','launchCampaign','485193fEnnjv','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','engage:campaign:create','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','verbose','name','List\x20email\x20templates','Create\x20a\x20new\x20campaign','Updating\x20template\x20\x27'];a20_0x27cf=function(){return _0x187c07;};return a20_0x27cf();}
@@ -1 +1 @@
1
- const a21_0x8609f0=a21_0x22d6;(function(_0x450296,_0xa1368f){const _0x136ced=a21_0x22d6,_0x289ba1=_0x450296();while(!![]){try{const _0x59a691=parseInt(_0x136ced(0x1b1))/0x1+-parseInt(_0x136ced(0x19e))/0x2*(parseInt(_0x136ced(0x1a2))/0x3)+parseInt(_0x136ced(0x19d))/0x4+parseInt(_0x136ced(0x19b))/0x5*(parseInt(_0x136ced(0x1ae))/0x6)+-parseInt(_0x136ced(0x18b))/0x7+-parseInt(_0x136ced(0x1ab))/0x8+parseInt(_0x136ced(0x178))/0x9*(parseInt(_0x136ced(0x1bd))/0xa);if(_0x59a691===_0xa1368f)break;else _0x289ba1['push'](_0x289ba1['shift']());}catch(_0x3711c7){_0x289ba1['push'](_0x289ba1['shift']());}}}(a21_0x9dde,0x33848));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a21_0x9dde(){const _0x1f8892=['\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','start_at','execute','Limit:\x20','\x20\x20Job\x20ID:\x20','round','debug','name','473238BrhLot','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','job:result','✔\x20Retrieved\x20','kill','job:submit','job:show','✔\x20Job\x20submitted','Submitting\x20kill\x20request...','status','Query:\x20','Kill\x20a\x20job','data','Job\x20type:\x20','Show\x20job\x20details','substring','user_name','information_schema','No\x20SQL\x20statements\x20found\x20in\x20file','1029238ScZzeq','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','✔\x20Found\x20','getTime','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','yes','priority','type','Submit\x20a\x20job','INVALID_ARGUMENT','file','created_at','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Getting\x20job\x20results...','error','url','5WftVSg','description','782100xiLcuG','36298BuyBTQ','database','\x20jobs','Listing\x20jobs...','39ZJfPQi','length','submit','verbose','Cancelled','...','show','trino','end_at','1820872eoRyPD','args','hive','2129766ibNcuL','jobs','query','60782zWmzDA','list','Getting\x20job\x20details...','\x27\x20to\x20verify\x20the\x20job\x20status','job_id','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','validate','\x20job','job:kill','map','Get\x20job\x20results','limit','40KbULJN'];a21_0x9dde=function(){return _0x1f8892;};return a21_0x9dde();}import{handleSDKOutput,handleSingleObjectOutput}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';function a21_0x22d6(_0x263ada,_0x563753){_0x263ada=_0x263ada-0x177;const _0x9ddee5=a21_0x9dde();let _0x22d613=_0x9ddee5[_0x263ada];return _0x22d613;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{[a21_0x8609f0(0x177)]='jobs';[a21_0x8609f0(0x19c)]='List\x20jobs';async['execute'](_0x33c3ed){const _0x9c4b5d=a21_0x8609f0,{options:_0x15012e,tdx:_0x53dfdb}=_0x33c3ed,_0x387aba=resolveLimit(_0x15012e[_0x9c4b5d(0x1bc)],DEFAULT_DISPLAY_LIMIT),_0x62a605=_0x15012e['status'];_0x15012e[_0x9c4b5d(0x1a5)]&&(console[_0x9c4b5d(0x199)](_0x9c4b5d(0x1c1)+_0x387aba+_0x9c4b5d(0x1a0)),_0x62a605&&console[_0x9c4b5d(0x199)]('Status\x20filter:\x20'+_0x62a605));const _0x1ccb64=await withSpinner(_0x9c4b5d(0x1a1),()=>_0x53dfdb[_0x9c4b5d(0x1af)][_0x9c4b5d(0x1b2)]({'from':0x0,'to':_0x387aba-0x1,'status':_0x62a605}),{'verbose':_0x15012e['verbose']}),_0x197286=_0x1ccb64[_0x9c4b5d(0x184)];console[_0x9c4b5d(0x199)](_0x9c4b5d(0x18d)+_0x197286[_0x9c4b5d(0x1a3)]+_0x9c4b5d(0x1b8)+(_0x197286[_0x9c4b5d(0x1a3)]!==0x1?'s':''));const _0x47aee6=_0x197286[_0x9c4b5d(0x1ba)](_0x3b403e=>{const _0x36510b=_0x9c4b5d;let _0x807a8b;if(_0x3b403e[_0x36510b(0x1bf)]&&_0x3b403e[_0x36510b(0x1aa)]){const _0x40f9dc=new Date(_0x3b403e[_0x36510b(0x1bf)])[_0x36510b(0x18e)](),_0x36d3ee=new Date(_0x3b403e[_0x36510b(0x1aa)])[_0x36510b(0x18e)]();_0x807a8b=Math['round']((_0x36d3ee-_0x40f9dc)/0x3e8);}return{'job_id':_0x3b403e[_0x36510b(0x1b5)],'type':_0x3b403e[_0x36510b(0x192)],'status':_0x3b403e['status'],'user_name':_0x3b403e[_0x36510b(0x188)],'duration_sec':_0x807a8b,'created_at':_0x3b403e[_0x36510b(0x196)],'started_at':_0x3b403e[_0x36510b(0x1bf)],'end_at':_0x3b403e[_0x36510b(0x1aa)]};});return await handleSDKOutput(_0x47aee6,_0x15012e),0x0;}}export class JobShowCommand extends BaseCommand{[a21_0x8609f0(0x177)]=a21_0x8609f0(0x17e);[a21_0x8609f0(0x19c)]=a21_0x8609f0(0x186);[a21_0x8609f0(0x1b7)](_0x495c8a){const _0x2999ef=a21_0x8609f0,_0x1f83b9=_0x495c8a[_0x2999ef(0x1ac)][0x0];if(!_0x1f83b9)return _0x2999ef(0x179);return undefined;}async[a21_0x8609f0(0x1c0)](_0xa940c7){const _0x32e24e=a21_0x8609f0,{options:_0x309426,args:_0x2a196a,tdx:_0x31d234}=_0xa940c7,_0x2894b7=_0x2a196a[0x0],_0x3110c0=await withSpinner(_0x32e24e(0x1b3),()=>_0x31d234[_0x32e24e(0x1af)][_0x32e24e(0x1a8)](_0x2894b7),{'verbose':_0x309426['verbose']}),_0x2764e5=_0x3110c0[_0x32e24e(0x184)];let _0x4551aa;if(_0x2764e5[_0x32e24e(0x1bf)]&&_0x2764e5[_0x32e24e(0x1aa)]){const _0x380d8a=new Date(_0x2764e5[_0x32e24e(0x1bf)])[_0x32e24e(0x18e)](),_0x44fb4f=new Date(_0x2764e5[_0x32e24e(0x1aa)])[_0x32e24e(0x18e)]();_0x4551aa=Math[_0x32e24e(0x1c3)]((_0x44fb4f-_0x380d8a)/0x3e8);}const _0x41c9c4={'job_id':_0x2764e5[_0x32e24e(0x1b5)],'type':_0x2764e5['type'],'status':_0x2764e5[_0x32e24e(0x181)],..._0x2764e5[_0x32e24e(0x188)]&&{'user_name':_0x2764e5['user_name']},..._0x4551aa!==undefined&&{'duration_sec':_0x4551aa},..._0x2764e5['created_at']&&{'created_at':_0x2764e5[_0x32e24e(0x196)]},..._0x2764e5['start_at']&&{'started_at':_0x2764e5[_0x32e24e(0x1bf)]},..._0x2764e5[_0x32e24e(0x1aa)]&&{'end_at':_0x2764e5['end_at']},..._0x2764e5[_0x32e24e(0x19f)]&&{'database':_0x2764e5[_0x32e24e(0x19f)]},..._0x2764e5[_0x32e24e(0x191)]!==undefined&&{'priority':_0x2764e5[_0x32e24e(0x191)]},..._0x2764e5[_0x32e24e(0x19a)]&&{'url':_0x2764e5[_0x32e24e(0x19a)]},..._0x2764e5[_0x32e24e(0x1b0)]&&{'query':_0x2764e5[_0x32e24e(0x1b0)]},..._0x2764e5[_0x32e24e(0x1c4)]&&{'debug':_0x2764e5[_0x32e24e(0x1c4)]}};return await handleSingleObjectOutput(_0x41c9c4,_0x309426),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a21_0x8609f0(0x1b9);[a21_0x8609f0(0x19c)]=a21_0x8609f0(0x183);[a21_0x8609f0(0x1b7)](_0x5640bf){const _0x2c5365=a21_0x8609f0,_0x30a3a4=_0x5640bf[_0x2c5365(0x1ac)][0x0];if(!_0x30a3a4)return _0x2c5365(0x18c);return undefined;}async[a21_0x8609f0(0x1c0)](_0x456fc3){const _0x33462d=a21_0x8609f0,{options:_0x13c681,args:_0x185b10,tdx:_0x4ff56e}=_0x456fc3,_0xe8e669=_0x185b10[0x0];if(!_0x13c681[_0x33462d(0x190)]){const _0x211004=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0xe8e669+'?');if(!_0x211004)return console[_0x33462d(0x199)](_0x33462d(0x1a6)),0x0;}return await withSpinner(_0x33462d(0x180),()=>_0x4ff56e[_0x33462d(0x1af)][_0x33462d(0x17c)](_0xe8e669),{'verbose':_0x13c681[_0x33462d(0x1a5)]}),console[_0x33462d(0x199)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0xe8e669),console[_0x33462d(0x199)](_0x33462d(0x1be)+_0xe8e669+_0x33462d(0x1b4)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a21_0x8609f0(0x177)]=a21_0x8609f0(0x17d);[a21_0x8609f0(0x19c)]=a21_0x8609f0(0x193);async[a21_0x8609f0(0x1c0)](_0x202e2b){const _0xf0dbcd=a21_0x8609f0,{options:_0x28fcf4,args:_0x3a96b8,tdx:_0x261986}=_0x202e2b,_0x19dff8=_0x28fcf4['jobType']||'trino',_0x67bc73=_0x28fcf4[_0xf0dbcd(0x195)],_0x602b1c=_0x28fcf4[_0xf0dbcd(0x19f)]||_0xf0dbcd(0x189),_0x42548f=_0x28fcf4['result'];if(_0x19dff8!==_0xf0dbcd(0x1a9)&&_0x19dff8!==_0xf0dbcd(0x1ad))throw new SDKError(ErrorCode[_0xf0dbcd(0x194)],_0xf0dbcd(0x197));let _0x270613;if(_0x67bc73){if(_0x3a96b8[0x0])throw new SDKError(ErrorCode[_0xf0dbcd(0x194)],_0xf0dbcd(0x1b6));const _0x17ed7b=readSqlStatementsFromFile(_0x67bc73);if(_0x17ed7b[_0xf0dbcd(0x1a3)]===0x0)throw new SDKError(ErrorCode[_0xf0dbcd(0x194)],_0xf0dbcd(0x18a));if(_0x17ed7b['length']>0x1)throw new SDKError(ErrorCode[_0xf0dbcd(0x194)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x270613=_0x17ed7b[0x0];}else{if(!_0x3a96b8[0x0])throw new SDKError(ErrorCode[_0xf0dbcd(0x194)],_0xf0dbcd(0x18f));_0x270613=_0x3a96b8[0x0];}_0x28fcf4[_0xf0dbcd(0x1a5)]&&(console[_0xf0dbcd(0x199)](_0xf0dbcd(0x185)+_0x19dff8),console['error']('Database:\x20'+_0x602b1c),console['error'](_0xf0dbcd(0x182)+_0x270613[_0xf0dbcd(0x187)](0x0,0x64)+(_0x270613[_0xf0dbcd(0x1a3)]>0x64?_0xf0dbcd(0x1a7):'')));const _0x2a8e4f=await withSpinner('Submitting\x20job...',()=>_0x261986[_0xf0dbcd(0x1af)][_0xf0dbcd(0x1a4)](_0x602b1c,_0x270613,_0x19dff8,_0x42548f),{'verbose':_0x28fcf4['verbose']}),_0x114179=_0x2a8e4f['data'];return console[_0xf0dbcd(0x199)](_0xf0dbcd(0x17f)),console[_0xf0dbcd(0x199)](_0xf0dbcd(0x1c2)+_0x114179['job_id']),await handleSDKOutput([_0x114179],_0x28fcf4),0x0;}}export class JobResultCommand extends BaseCommand{[a21_0x8609f0(0x177)]=a21_0x8609f0(0x17a);['description']=a21_0x8609f0(0x1bb);[a21_0x8609f0(0x1b7)](_0x70895d){const _0x54fa3c=a21_0x8609f0,_0x327b49=_0x70895d[_0x54fa3c(0x1ac)][0x0];if(!_0x327b49)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a21_0x8609f0(0x1c0)](_0xf70026){const _0x292430=a21_0x8609f0,{options:_0x211914,args:_0x4eb2af,tdx:_0x326813}=_0xf70026,_0x4192b8=_0x4eb2af[0x0],_0xd52e30=await withSpinner(_0x292430(0x198),()=>_0x326813[_0x292430(0x1af)]['result'](_0x4192b8),{'verbose':_0x211914[_0x292430(0x1a5)]}),_0x12268f=_0xd52e30[_0x292430(0x184)];return console[_0x292430(0x199)](_0x292430(0x17b)+_0x12268f['length']+'\x20row'+(_0x12268f[_0x292430(0x1a3)]!==0x1?'s':'')),await handleSDKOutput(_0x12268f,_0x211914),0x0;}}
1
+ const a21_0xb5e50b=a21_0x4e36;(function(_0x4ccdbf,_0x2048d1){const _0x1d1b15=a21_0x4e36,_0x275fa1=_0x4ccdbf();while(!![]){try{const _0x51f465=parseInt(_0x1d1b15(0x1dc))/0x1+-parseInt(_0x1d1b15(0x1fb))/0x2*(parseInt(_0x1d1b15(0x1f5))/0x3)+parseInt(_0x1d1b15(0x213))/0x4*(parseInt(_0x1d1b15(0x1d2))/0x5)+parseInt(_0x1d1b15(0x20a))/0x6+parseInt(_0x1d1b15(0x20c))/0x7*(-parseInt(_0x1d1b15(0x20e))/0x8)+parseInt(_0x1d1b15(0x1f3))/0x9*(-parseInt(_0x1d1b15(0x204))/0xa)+-parseInt(_0x1d1b15(0x211))/0xb*(-parseInt(_0x1d1b15(0x1d5))/0xc);if(_0x51f465===_0x2048d1)break;else _0x275fa1['push'](_0x275fa1['shift']());}catch(_0x5a875c){_0x275fa1['push'](_0x275fa1['shift']());}}}(a21_0x1a7b,0xbbaa9));function a21_0x1a7b(){const _0x214236=['Get\x20job\x20results','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','1426584RoetRS','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Getting\x20job\x20results...','Submitting\x20kill\x20request...','length','status','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','job:kill','description','10EmxaNz','verbose','\x20jobs','\x20job','job:submit','jobs','6385044rbQVTh','args','91VjxCyo','getTime','123352JQZPMP','type','map','209chiDvQ','url','1115664CepsEl','substring','Show\x20job\x20details','Cancelled','list','data','start_at','INVALID_ARGUMENT','information_schema','5UoKKws','query','job_id','1006536ifPwCZ','✔\x20Found\x20','priority','end_at','validate','database','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','470947KMRXxz','user_name','limit','trino','✔\x20Retrieved\x20','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','name','Submit\x20a\x20job','Getting\x20job\x20details...','execute','Job\x20type:\x20','hive','\x27\x20to\x20verify\x20the\x20job\x20status','yes','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','submit','error','kill','created_at','Submitting\x20job...','job:show','result','9108063AsgVJB','List\x20jobs','6FeBYUH','Limit:\x20','Kill\x20a\x20job','show'];a21_0x1a7b=function(){return _0x214236;};return a21_0x1a7b();}function a21_0x4e36(_0x2f14f5,_0x488c6d){_0x2f14f5=_0x2f14f5-0x1ce;const _0x1a7bd1=a21_0x1a7b();let _0x4e36cd=_0x1a7bd1[_0x2f14f5];return _0x4e36cd;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}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';export class JobListCommand extends BaseCommand{['name']=a21_0xb5e50b(0x209);['description']=a21_0xb5e50b(0x1f4);async[a21_0xb5e50b(0x1e5)](_0x40d922){const _0x1c57a1=a21_0xb5e50b,{options:_0x1e133d,tdx:_0x2f3c3a}=_0x40d922,_0x59e8a3=resolveLimit(_0x1e133d[_0x1c57a1(0x1de)],DEFAULT_DISPLAY_LIMIT),_0x18e875=_0x1e133d[_0x1c57a1(0x200)];_0x1e133d['verbose']&&(console['error'](_0x1c57a1(0x1f6)+_0x59e8a3+_0x1c57a1(0x206)),_0x18e875&&console[_0x1c57a1(0x1ed)]('Status\x20filter:\x20'+_0x18e875));const _0x32bb96=await withSpinner('Listing\x20jobs...',()=>_0x2f3c3a[_0x1c57a1(0x209)][_0x1c57a1(0x217)]({'from':0x0,'to':_0x59e8a3-0x1,'status':_0x18e875}),{'verbose':_0x1e133d[_0x1c57a1(0x205)]}),_0x27d38e=_0x32bb96[_0x1c57a1(0x1ce)];console[_0x1c57a1(0x1ed)](_0x1c57a1(0x1d6)+_0x27d38e[_0x1c57a1(0x1ff)]+_0x1c57a1(0x207)+(_0x27d38e[_0x1c57a1(0x1ff)]!==0x1?'s':''));const _0x4e6d26=_0x27d38e[_0x1c57a1(0x210)](_0x27b125=>{const _0x43fd90=_0x1c57a1;let _0x3fc801;if(_0x27b125[_0x43fd90(0x1cf)]&&_0x27b125[_0x43fd90(0x1d8)]){const _0x6e3587=new Date(_0x27b125[_0x43fd90(0x1cf)])[_0x43fd90(0x20d)](),_0x4131e8=new Date(_0x27b125[_0x43fd90(0x1d8)])[_0x43fd90(0x20d)]();_0x3fc801=Math['round']((_0x4131e8-_0x6e3587)/0x3e8);}return{'job_id':_0x27b125[_0x43fd90(0x1d4)],'type':_0x27b125[_0x43fd90(0x20f)],'status':_0x27b125['status'],'user_name':_0x27b125[_0x43fd90(0x1dd)],'duration_sec':_0x3fc801,'created_at':_0x27b125['created_at'],'started_at':_0x27b125[_0x43fd90(0x1cf)],'end_at':_0x27b125[_0x43fd90(0x1d8)]};});return await handleSDKOutput(_0x4e6d26,_0x1e133d),0x0;}}export class JobShowCommand extends BaseCommand{[a21_0xb5e50b(0x1e2)]=a21_0xb5e50b(0x1f1);['description']=a21_0xb5e50b(0x215);[a21_0xb5e50b(0x1d9)](_0x2b3ac7){const _0x2c5ed5=a21_0xb5e50b,_0xcd7ae6=_0x2b3ac7[_0x2c5ed5(0x20b)][0x0];if(!_0xcd7ae6)return _0x2c5ed5(0x1ea);return undefined;}async[a21_0xb5e50b(0x1e5)](_0x283661){const _0x34fcbf=a21_0xb5e50b,{options:_0x18c6b0,args:_0x2ab86f,tdx:_0x1ed5af}=_0x283661,_0x18cedc=_0x2ab86f[0x0],_0x5eb904=await withSpinner(_0x34fcbf(0x1e4),()=>_0x1ed5af[_0x34fcbf(0x209)][_0x34fcbf(0x1f8)](_0x18cedc),{'verbose':_0x18c6b0[_0x34fcbf(0x205)]}),_0x755f7f=_0x5eb904['data'];let _0x57b291;if(_0x755f7f[_0x34fcbf(0x1cf)]&&_0x755f7f[_0x34fcbf(0x1d8)]){const _0x1136d4=new Date(_0x755f7f[_0x34fcbf(0x1cf)])['getTime'](),_0x18d783=new Date(_0x755f7f['end_at'])[_0x34fcbf(0x20d)]();_0x57b291=Math['round']((_0x18d783-_0x1136d4)/0x3e8);}const _0xd24538={'job_id':_0x755f7f[_0x34fcbf(0x1d4)],'type':_0x755f7f[_0x34fcbf(0x20f)],'status':_0x755f7f[_0x34fcbf(0x200)],..._0x755f7f['user_name']&&{'user_name':_0x755f7f[_0x34fcbf(0x1dd)]},..._0x57b291!==undefined&&{'duration_sec':_0x57b291},..._0x755f7f[_0x34fcbf(0x1ef)]&&{'created_at':_0x755f7f[_0x34fcbf(0x1ef)]},..._0x755f7f[_0x34fcbf(0x1cf)]&&{'started_at':_0x755f7f[_0x34fcbf(0x1cf)]},..._0x755f7f['end_at']&&{'end_at':_0x755f7f['end_at']},..._0x755f7f['database']&&{'database':_0x755f7f[_0x34fcbf(0x1da)]},..._0x755f7f[_0x34fcbf(0x1d7)]!==undefined&&{'priority':_0x755f7f[_0x34fcbf(0x1d7)]},..._0x755f7f[_0x34fcbf(0x212)]&&{'url':_0x755f7f[_0x34fcbf(0x212)]},..._0x755f7f[_0x34fcbf(0x1d3)]&&{'query':_0x755f7f[_0x34fcbf(0x1d3)]},..._0x755f7f['debug']&&{'debug':_0x755f7f['debug']}};return await handleSingleObjectOutput(_0xd24538,_0x18c6b0),0x0;}}export class JobKillCommand extends BaseCommand{[a21_0xb5e50b(0x1e2)]=a21_0xb5e50b(0x202);[a21_0xb5e50b(0x203)]=a21_0xb5e50b(0x1f7);[a21_0xb5e50b(0x1d9)](_0x307e5f){const _0x42b15c=a21_0xb5e50b,_0x3f1b22=_0x307e5f[_0x42b15c(0x20b)][0x0];if(!_0x3f1b22)return _0x42b15c(0x201);return undefined;}async[a21_0xb5e50b(0x1e5)](_0x17536a){const _0x49c6f6=a21_0xb5e50b,{options:_0x1f7dd0,args:_0x381634,tdx:_0x405b29}=_0x17536a,_0x156865=_0x381634[0x0];if(!_0x1f7dd0[_0x49c6f6(0x1e9)]){const _0x5bed28=await confirm(_0x49c6f6(0x1eb)+_0x156865+'?');if(!_0x5bed28)return console['error'](_0x49c6f6(0x216)),0x0;}return await withSpinner(_0x49c6f6(0x1fe),()=>_0x405b29[_0x49c6f6(0x209)][_0x49c6f6(0x1ee)](_0x156865),{'verbose':_0x1f7dd0['verbose']}),console[_0x49c6f6(0x1ed)](_0x49c6f6(0x1fc)+_0x156865),console['error'](_0x49c6f6(0x1fa)+_0x156865+_0x49c6f6(0x1e8)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a21_0xb5e50b(0x1e2)]=a21_0xb5e50b(0x208);[a21_0xb5e50b(0x203)]=a21_0xb5e50b(0x1e3);async[a21_0xb5e50b(0x1e5)](_0x1ea5f0){const _0x8fc451=a21_0xb5e50b,{options:_0x137a7a,args:_0x1ca22a,tdx:_0x3a9781}=_0x1ea5f0,_0x1769c1=_0x137a7a['jobType']||_0x8fc451(0x1df),_0xb3558b=_0x137a7a['file'],_0x529cee=_0x137a7a[_0x8fc451(0x1da)]||_0x8fc451(0x1d1),_0x26a54c=_0x137a7a[_0x8fc451(0x1f2)];if(_0x1769c1!==_0x8fc451(0x1df)&&_0x1769c1!==_0x8fc451(0x1e7))throw new SDKError(ErrorCode[_0x8fc451(0x1d0)],_0x8fc451(0x1e1));let _0x4bb81c;if(_0xb3558b){if(_0x1ca22a[0x0])throw new SDKError(ErrorCode[_0x8fc451(0x1d0)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x120416=readSqlStatementsFromFile(_0xb3558b);if(_0x120416[_0x8fc451(0x1ff)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x120416[_0x8fc451(0x1ff)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x4bb81c=_0x120416[0x0];}else{if(!_0x1ca22a[0x0])throw new SDKError(ErrorCode[_0x8fc451(0x1d0)],_0x8fc451(0x1db));_0x4bb81c=_0x1ca22a[0x0];}_0x137a7a[_0x8fc451(0x205)]&&(console['error'](_0x8fc451(0x1e6)+_0x1769c1),console[_0x8fc451(0x1ed)]('Database:\x20'+_0x529cee),console[_0x8fc451(0x1ed)]('Query:\x20'+_0x4bb81c[_0x8fc451(0x214)](0x0,0x64)+(_0x4bb81c[_0x8fc451(0x1ff)]>0x64?'...':'')));const _0x2559cd=await withSpinner(_0x8fc451(0x1f0),()=>_0x3a9781[_0x8fc451(0x209)][_0x8fc451(0x1ec)](_0x529cee,_0x4bb81c,_0x1769c1,_0x26a54c),{'verbose':_0x137a7a[_0x8fc451(0x205)]}),_0x628a9e=_0x2559cd[_0x8fc451(0x1ce)];return console[_0x8fc451(0x1ed)]('✔\x20Job\x20submitted'),console[_0x8fc451(0x1ed)]('\x20\x20Job\x20ID:\x20'+_0x628a9e[_0x8fc451(0x1d4)]),await handleSDKOutput([_0x628a9e],_0x137a7a),0x0;}}export class JobResultCommand extends BaseCommand{[a21_0xb5e50b(0x1e2)]='job:result';[a21_0xb5e50b(0x203)]=a21_0xb5e50b(0x1f9);['validate'](_0x4be938){const _0x2d6580=a21_0xb5e50b,_0x4d685b=_0x4be938[_0x2d6580(0x20b)][0x0];if(!_0x4d685b)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async['execute'](_0x4e6fe2){const _0x32581e=a21_0xb5e50b,{options:_0x23149d,args:_0x5751b4,tdx:_0x3c4963}=_0x4e6fe2,_0x3a7121=_0x5751b4[0x0],_0x2ab536=await withSpinner(_0x32581e(0x1fd),()=>_0x3c4963[_0x32581e(0x209)]['result'](_0x3a7121),{'verbose':_0x23149d['verbose']}),_0x32afc9=_0x2ab536[_0x32581e(0x1ce)];return console[_0x32581e(0x1ed)](_0x32581e(0x1e0)+_0x32afc9[_0x32581e(0x1ff)]+'\x20row'+(_0x32afc9[_0x32581e(0x1ff)]!==0x1?'s':'')),await handleSDKOutput(_0x32afc9,_0x23149d),0x0;}}
@@ -1 +1 @@
1
- const a22_0x54fb49=a22_0x5170;function a22_0x442e(){const _0x5eefdb=['\x20\x20Consolidating\x20duplicate\x20segment:\x20','(root)','jsonl','/app/ps/','nodes','limit','Pattern:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Fetching\x20journeys\x20and\x20folders...','\x20(rule\x20match)','Aborted.','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Getting\x20column\x20mapping...','verbose','all','yes','createdAt','content','3010776NRZAam','journey:versions','length','folderPath','folderId','getJourney','push','red','journey:stats','localeCompare','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','411qmbsBD','updatedAt','Listing\x20journeys...','✔\x20Journey\x20\x22','3649176zLBSbY','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20unchanged\x20files','Cancelled','/j/da/je','test','renderStats','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','exitOrJumpSize','session','\x20journey\x20files\x20to\x20','map','paused','blue','\x0aError:','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','2677833DnVARF','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','buildIdToNameMap','database','listJourneysFromParentSegment','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','exitOrJumpRate','✔\x20All\x20files\x20are\x20up\x20to\x20date','diff','hasChanges','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','65vaKtcK','Folder\x20path:\x20','stringify','\x20version','\x0aChanges\x20to\x20\x27','cyan','set','Error:\x20Journey\x20not\x20found:\x20','Getting\x20journey\x20traffic\x20data...','...','View\x20a\x20specific\x20version\x20of\x20a\x20journey','stageNameMap','data','Resume\x20a\x20paused\x20journey','Export\x20journey(s)\x20as\x20YAML\x20files','\x20(draft)\x20—\x20\x22','getTrafficData','journeyBundleId','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','segmentPushCommand','history','Getting\x20version\x20','Pause\x20a\x20running\x20journey','journey:pull','Error:\x20Stage\x20\x22','join','includeHistory','connection','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','get','\x20journey','utf-8','size','tdx.json','isNew','INVALID_ARGUMENT','\x20details...','type','cwd','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','add','153940lHMpze','entries','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','parent_segment','relativePath','Journey\x20name:\x20','format','\x20not\x20found.\x20Available:\x20','name','message','Show\x20journey\x20details','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20->\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','then','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','✔\x20Found\x20','parentSegment','\x5c$&','\x20\x20Folder\x20path:\x20','find','journeyBundleName','journey:view','setPhase','conversion','green','repeat','\x27\x20not\x20found\x20in\x20','has','Database:\x20','journey:list','.yml','rootFolderId','\x22\x20not\x20found','journey:version:create','\x20changed\x20files','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','execute','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','journey','segments','journey:traffic','values','(completed)','6642jeBMzn','8qsNaAZ','archived','✔\x20Pulled\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','description','\x20\x20Parent\x20segment:\x20','Error:\x20Version\x20','Getting\x20journey\x20statistics...','\x20=\x20','/j/da','resolveSegment','Parent\x20segment:\x20','Error:\x20','listActivationsFlat','Resolving\x20parent\x20segment...','journey:columns','enteredSize','Input:\x20','pause','Fetching\x20users\x20and\x20connections...','listFolders','\x20\x20Journey\x20ID:\x20','sort','listJourneysWithFolders','getActivation','journeyStages','Resolving\x20journey...','json','table','state','Getting\x20journey\x20details...','file','resume','base','attributes','resolveParentId','No\x20journeys\x20found','Listing\x20journey\x20activations...','split','replace','getStatistics','11yHLPZU','Show\x20journey\x20statistics','args','journey:pause','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Target\x20file:\x20','5042990HSpASx','/e/','Fetching\x20parent\x20segment...','listVersions','goal','Fetching\x20','no_parent','(running)','segment','helpText','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','from','journey:activations','segmentName','Warning:\x20Could\x20not\x20resolve\x20segment\x20','activationParams','getColumnMapping','\x20\x20Name:\x20','stages','Write\x20','-\x20no\x20files\x20written','yellow','Resolved\x20YAML\x20file:\x20','user','toLowerCase','Options:','Available\x20stages:\x20','site','Show\x20journey\x20table\x20column\x20mapping','✔\x20Context\x20set:\x20','targetDir','goalSize','journeyId','List\x20activations\x20for\x20a\x20journey','dim','includeStats','createVersion','error','versionNumber','5344724OeAOcE','\x20(ID:\x20','buildIdToEmailMap','completed','journey:push','draft','milestoneSize','launched','filter','\x20new\x20files','Resolving\x20version...','folders','Target\x20directory:\x20','errorCode','resourceName','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','hasPeriod','Pausing\x20journey...','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','reentryMode','parentName','log','\x20\x20Statistics\x20not\x20available','\x20activation','journey:version:view','completionRate','rule','activation'];a22_0x442e=function(){return _0x5eefdb;};return a22_0x442e();}(function(_0x213c45,_0x1604f2){const _0x5d5958=a22_0x5170,_0x3bffd6=_0x213c45();while(!![]){try{const _0x15e1d6=-parseInt(_0x5d5958(0x262))/0x1*(-parseInt(_0x5d5958(0x1d2))/0x2)+-parseInt(_0x5d5958(0x266))/0x3+parseInt(_0x5d5958(0x2ad))/0x4*(parseInt(_0x5d5958(0x282))/0x5)+-parseInt(_0x5d5958(0x257))/0x6+parseInt(_0x5d5958(0x229))/0x7+-parseInt(_0x5d5958(0x1d3))/0x8*(-parseInt(_0x5d5958(0x277))/0x9)+parseInt(_0x5d5958(0x202))/0xa*(-parseInt(_0x5d5958(0x1fc))/0xb);if(_0x15e1d6===_0x1604f2)break;else _0x3bffd6['push'](_0x3bffd6['shift']());}catch(_0x5b32f2){_0x3bffd6['push'](_0x3bffd6['shift']());}}}(a22_0x442e,0xabd4a));import a22_0x22ee6a from'chalk';import a22_0x1a2b3d 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(_0x9664e){const _0x105b5a=a22_0x5170;return!_0x9664e&&(console[_0x105b5a(0x227)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x105b5a(0x227)](_0x105b5a(0x200))),!!_0x9664e;}function withJsonFormat(_0x7f34d8){const _0x5e43df=a22_0x5170;if(!_0x7f34d8[_0x5e43df(0x2b3)]&&!_0x7f34d8[_0x5e43df(0x1ee)]&&!_0x7f34d8['jsonl']&&!_0x7f34d8['tsv'])return{..._0x7f34d8,'format':_0x5e43df(0x1ee),'json':!![]};return _0x7f34d8;}function formatJourneyState(_0x3dd88c){const _0xc532e=a22_0x5170;switch(_0x3dd88c){case _0xc532e(0x230):return a22_0x22ee6a[_0xc532e(0x1bf)](_0xc532e(0x209));case _0xc532e(0x22e):return a22_0x22ee6a[_0xc532e(0x224)]('(draft)');case _0xc532e(0x272):return a22_0x22ee6a[_0xc532e(0x217)]('(paused)');case _0xc532e(0x22c):return a22_0x22ee6a[_0xc532e(0x273)](_0xc532e(0x1d1));case _0xc532e(0x1d4):return a22_0x22ee6a[_0xc532e(0x224)]('(archived)');default:return'('+_0x3dd88c+')';}}function formatJourneyItem(_0x1bae68,_0x5b800f='',_0x254fe7){const _0xa40704=a22_0x5170,_0x1161aa=formatJourneyState(_0x1bae68[_0xa40704(0x1f0)]),_0x4447ce=_0x254fe7?hyperlink(_0x1bae68['journeyBundleName'],_0x254fe7):_0x1bae68[_0xa40704(0x1bb)];return _0x5b800f+'🗺️\x20'+_0x4447ce+'\x20'+_0x1161aa;}function escapeRegex(_0x3393b4){const _0x498829=a22_0x5170;return _0x3393b4[_0x498829(0x1fa)](/[.*+?^${}()|[\]\\]/g,_0x498829(0x1b8));}function globToRegex(_0x80e001){const _0x3f5905=a22_0x5170,_0x2820b7=_0x80e001[_0x3f5905(0x1f9)]('*')['map'](escapeRegex);return new RegExp(_0x2820b7['join']('.*'),'i');}function buildRuleToNameMapping(_0x38e449){const _0x401f5f=a22_0x5170,_0x451f99=new Map();if(_0x38e449[_0x401f5f(0x1ce)])for(const [_0x42d717,_0x1de041]of Object[_0x401f5f(0x2ae)](_0x38e449[_0x401f5f(0x1ce)])){if(_0x1de041[_0x401f5f(0x243)]){const _0x2ad6c6=serializeRule(_0x1de041[_0x401f5f(0x243)]),_0x214f6a=_0x451f99[_0x401f5f(0x2a0)](_0x2ad6c6);_0x214f6a?_0x214f6a[_0x401f5f(0x25d)](_0x42d717):_0x451f99['set'](_0x2ad6c6,[_0x42d717]);}}return _0x451f99;}async function resolveJourneyIdFromInput(_0x424c6d,_0x39ac9c,_0x12f0df){const _0x499b20=a22_0x5170,_0x5367e4=await resolveJourneyTarget(_0x424c6d,_0x39ac9c[_0x499b20(0x1b7)],_0x39ac9c[_0x499b20(0x252)]),_0x3fc16b=_0x5367e4[_0x499b20(0x1b7)];if(!_0x3fc16b)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x499b20(0x281));const _0x4eb0bc=await withSpinner(_0x499b20(0x1e1),()=>_0x12f0df[_0x499b20(0x20a)]['resolveParentId'](_0x3fc16b),{'verbose':_0x39ac9c['verbose']}),_0x130c9f=_0x4eb0bc[_0x499b20(0x28e)],_0x38773b=await withSpinner(_0x499b20(0x1ed),()=>_0x12f0df[_0x499b20(0x1cd)]['resolveJourneyId'](_0x130c9f,_0x5367e4['journeyName']),{'verbose':_0x39ac9c[_0x499b20(0x252)]});return{'journeyId':_0x38773b['data'],'journeyName':_0x5367e4['journeyName'],'parentSegmentId':_0x130c9f};}async function resolveJourneyTarget(_0x50de11,_0x335fd3,_0x1de458){const _0x5b7a4a=a22_0x5170;if(isYamlFilePath(_0x50de11))try{const _0x477cc7=await resolveYamlFilePath(_0x50de11);return _0x1de458&&(console['error'](_0x5b7a4a(0x218)+_0x50de11),console['error'](_0x5b7a4a(0x1d8)+_0x477cc7[_0x5b7a4a(0x1b7)]),console[_0x5b7a4a(0x227)](_0x5b7a4a(0x213)+_0x477cc7[_0x5b7a4a(0x20f)]),console[_0x5b7a4a(0x227)](_0x5b7a4a(0x1b9)+(_0x477cc7[_0x5b7a4a(0x25a)]||_0x5b7a4a(0x246)))),{'journeyName':_0x477cc7[_0x5b7a4a(0x20f)],'parentSegment':_0x477cc7['parentSegment'],'resolved':_0x477cc7};}catch(_0xabe2d6){throw new SDKError(ErrorCode[_0x5b7a4a(0x2a6)],_0x5b7a4a(0x1cc)+_0xabe2d6[_0x5b7a4a(0x2b6)]);}if(!_0x335fd3)throw new SDKError(ErrorCode[_0x5b7a4a(0x2a6)],_0x5b7a4a(0x24c));return{'journeyName':_0x50de11,'parentSegment':_0x335fd3};}export class JourneyListCommand extends BaseCommand{['name']=a22_0x54fb49(0x1c4);[a22_0x54fb49(0x1d7)]='List\x20journeys\x20in\x20current\x20context';async['execute'](_0x5e001d){const _0x2b74f5=a22_0x54fb49,{options:_0xacf7af,args:_0x37cccd,tdx:_0x3f0a00}=_0x5e001d,_0x54fb0e=_0x37cccd[0x0],_0x4623d8=_0xacf7af[_0x2b74f5(0x1b7)];if(!_0x4623d8)return console[_0x2b74f5(0x227)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x2b74f5(0x227)](_0x2b74f5(0x267)),0x1;const _0x50058b=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3f0a00[_0x2b74f5(0x20a)][_0x2b74f5(0x1f6)](_0x4623d8),{'verbose':_0xacf7af['verbose']}),_0x3636e7=_0x50058b[_0x2b74f5(0x28e)];_0xacf7af[_0x2b74f5(0x252)]&&(console[_0x2b74f5(0x227)]('Parent\x20segment:\x20'+_0x4623d8+_0x2b74f5(0x22a)+_0x3636e7+')'),_0x54fb0e&&console[_0x2b74f5(0x227)](_0x2b74f5(0x24b)+_0x54fb0e));const _0x24c3c4=await withSpinner(_0x2b74f5(0x204),()=>_0x3f0a00[_0x2b74f5(0x20a)]['getParentFull'](_0x3636e7),{'verbose':_0xacf7af[_0x2b74f5(0x252)]}),_0x4f7375=_0x24c3c4[_0x2b74f5(0x28e)],_0x31bf02=_0x4f7375[_0x2b74f5(0x1c6)],_0x51e0e9=await withSpinner(_0x2b74f5(0x264),()=>_0x3f0a00[_0x2b74f5(0x1cd)][_0x2b74f5(0x1ea)](_0x3636e7,_0x31bf02),{'verbose':_0xacf7af['verbose']});let _0x4e0ca0=_0x51e0e9[_0x2b74f5(0x28e)]['journeys'];const _0x5384d8=_0x51e0e9[_0x2b74f5(0x28e)][_0x2b74f5(0x234)],_0x556fb5=new Map();for(const _0x241882 of _0x5384d8){_0x556fb5[_0x2b74f5(0x288)](_0x241882['id'],_0x241882[_0x2b74f5(0x2b5)]);}if(_0x54fb0e){const _0x38932a=globToRegex(_0x54fb0e);_0x4e0ca0=_0x4e0ca0[_0x2b74f5(0x231)](_0x42c94c=>_0x38932a[_0x2b74f5(0x26b)](_0x42c94c[_0x2b74f5(0x1bb)]));}console[_0x2b74f5(0x227)](_0x2b74f5(0x1b6)+_0x4e0ca0['length']+_0x2b74f5(0x2a1)+(_0x4e0ca0[_0x2b74f5(0x259)]!==0x1?'s':''));const _0x4ba440=_0x16dede=>{const _0x592108=_0x2b74f5;return getConsoleNextUrl(_0xacf7af[_0x592108(0x21d)],_0x592108(0x248)+_0x3636e7+'/e/'+_0x16dede+_0x592108(0x1dc));};if(_0xacf7af[_0x2b74f5(0x2b3)]===_0x2b74f5(0x1ef))await handleSDKOutput(_0x4e0ca0,_0xacf7af);else{if(_0xacf7af[_0x2b74f5(0x2b3)]==='json'){const _0x23a9a6=_0x4e0ca0[_0x2b74f5(0x271)](_0x3a1467=>({..._0x3a1467,'url':_0x4ba440(_0x3a1467['id'])}));await handleSDKOutput(_0x23a9a6,_0xacf7af);}else{console[_0x2b74f5(0x23e)]('['+_0x4623d8+']');const _0x4be70d=new Map(),_0x348578=[];for(const _0x38ccb3 of _0x4e0ca0){if(!_0x38ccb3['folderId']||_0x38ccb3['folderId']===_0x31bf02)_0x348578[_0x2b74f5(0x25d)](_0x38ccb3);else{const _0x15b947=_0x4be70d[_0x2b74f5(0x2a0)](_0x38ccb3[_0x2b74f5(0x25b)])||[];_0x15b947[_0x2b74f5(0x25d)](_0x38ccb3),_0x4be70d[_0x2b74f5(0x288)](_0x38ccb3[_0x2b74f5(0x25b)],_0x15b947);}}const _0x50b333=(_0x304616,_0x29f29f)=>_0x304616['journeyBundleName']['localeCompare'](_0x29f29f['journeyBundleName'],undefined,{'sensitivity':_0x2b74f5(0x1f4)});_0x348578[_0x2b74f5(0x1e9)](_0x50b333);for(const _0x4458f7 of _0x348578){console[_0x2b74f5(0x23e)](formatJourneyItem(_0x4458f7,'',_0x4ba440(_0x4458f7['id'])));}const _0x495bbe=[..._0x4be70d['entries']()][_0x2b74f5(0x1e9)]((_0x4c0d3d,_0x4934c8)=>{const _0x47ec48=_0x2b74f5,_0x4a7b07=_0x556fb5['get'](_0x4c0d3d[0x0])||_0x4c0d3d[0x0],_0x12f7a2=_0x556fb5[_0x47ec48(0x2a0)](_0x4934c8[0x0])||_0x4934c8[0x0];return _0x4a7b07[_0x47ec48(0x260)](_0x12f7a2,undefined,{'sensitivity':_0x47ec48(0x1f4)});});for(const [_0x2bbff2,_0x11e895]of _0x495bbe){const _0x10777c=_0x556fb5[_0x2b74f5(0x2a0)](_0x2bbff2)||_0x2bbff2;console[_0x2b74f5(0x23e)]('📁\x20'+_0x10777c),_0x11e895[_0x2b74f5(0x1e9)](_0x50b333);for(const _0x22d667 of _0x11e895){console[_0x2b74f5(0x23e)](formatJourneyItem(_0x22d667,'\x20\x20',_0x4ba440(_0x22d667['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x1bc);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x2b7);async['execute'](_0x2cb409){const _0x5d0dfa=a22_0x54fb49,{options:_0x3259db,args:_0x4bd742,tdx:_0x490545}=_0x2cb409,_0xcf6795=_0x4bd742[0x0];if(!_0xcf6795)return console[_0x5d0dfa(0x227)](_0x5d0dfa(0x1b5)),console[_0x5d0dfa(0x227)](_0x5d0dfa(0x2af)),console[_0x5d0dfa(0x227)](_0x5d0dfa(0x21b)),console[_0x5d0dfa(0x227)](_0x5d0dfa(0x23b)),0x1;_0x3259db[_0x5d0dfa(0x252)]&&console[_0x5d0dfa(0x227)](_0x5d0dfa(0x1e4)+_0xcf6795);const {journeyId:_0x4b06bb,parentSegmentId:_0x15e6cd}=await resolveJourneyIdFromInput(_0xcf6795,_0x3259db,_0x490545);if(_0x3259db['web']){const _0x290b13=getConsoleNextUrl(_0x3259db[_0x5d0dfa(0x21d)],'/app/ps/'+_0x15e6cd+_0x5d0dfa(0x203)+_0x4b06bb+_0x5d0dfa(0x26a));return console['error'](a22_0x22ee6a['green']('✔')+'\x20Opening\x20'+a22_0x22ee6a['cyan'](_0x290b13)),openBrowser(_0x290b13),0x0;}const _0x8ced44=await withSpinner(_0x5d0dfa(0x1f1),()=>_0x490545[_0x5d0dfa(0x1cd)][_0x5d0dfa(0x25c)](_0x4b06bb),{'verbose':_0x3259db[_0x5d0dfa(0x252)]}),_0x5ad0b1=_0x8ced44['data'],_0x323efd=_0x3259db[_0x5d0dfa(0x225)];let _0x259192;if(_0x323efd)try{const _0x84e03=await withSpinner(_0x5d0dfa(0x1da),()=>_0x490545[_0x5d0dfa(0x1cd)][_0x5d0dfa(0x1fb)](_0x4b06bb),{'verbose':_0x3259db[_0x5d0dfa(0x252)]});_0x259192=_0x84e03[_0x5d0dfa(0x28e)];}catch{_0x3259db['verbose']&&console[_0x5d0dfa(0x227)](_0x5d0dfa(0x23f));}const _0x2ecb02=getConsoleNextUrl(_0x3259db[_0x5d0dfa(0x21d)],_0x5d0dfa(0x248)+_0x15e6cd+_0x5d0dfa(0x203)+_0x4b06bb+_0x5d0dfa(0x26a)),_0x5d1320={'id':_0x5ad0b1['id'],'name':_0x5ad0b1[_0x5d0dfa(0x1f5)][_0x5d0dfa(0x2b5)],'description':_0x5ad0b1['attributes']['description'],'state':_0x5ad0b1[_0x5d0dfa(0x1f5)][_0x5d0dfa(0x1f0)],'paused':_0x5ad0b1[_0x5d0dfa(0x1f5)][_0x5d0dfa(0x272)],'reentry_mode':_0x5ad0b1[_0x5d0dfa(0x1f5)]['reentryMode'],'stages':_0x5ad0b1['attributes'][_0x5d0dfa(0x1ec)]?.[_0x5d0dfa(0x259)]||0x0,..._0x5ad0b1[_0x5d0dfa(0x1f5)][_0x5d0dfa(0x206)]&&{'goal':_0x5ad0b1['attributes'][_0x5d0dfa(0x206)][_0x5d0dfa(0x2b5)]},..._0x259192&&{'statistics':{'size':_0x259192[_0x5d0dfa(0x2a3)],'entered':_0x259192[_0x5d0dfa(0x1e3)],'goal_achieved':_0x259192[_0x5d0dfa(0x221)],'completion_rate':_0x259192[_0x5d0dfa(0x242)],'exit_or_jump':_0x259192[_0x5d0dfa(0x26e)],'exit_or_jump_rate':_0x259192['exitOrJumpRate'],'stages':_0x259192[_0x5d0dfa(0x214)]}},'url':_0x2ecb02};return await handleSingleObjectOutput(_0x5d1320,_0x3259db),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x25f);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x1fd);async[a22_0x54fb49(0x1cb)](_0x525423){const _0x4c5645=a22_0x54fb49,{options:_0x1959ba,args:_0x5b1c85,tdx:_0x27e173}=_0x525423,_0x1c89f2=_0x5b1c85[0x0];if(!requireNameOrPath(_0x1c89f2))return 0x1;_0x1959ba[_0x4c5645(0x252)]&&console['error'](_0x4c5645(0x1e4)+_0x1c89f2);const _0x18e78a=_0x1959ba,_0x31164a=_0x18e78a[_0x4c5645(0x20d)],_0x46f93b=_0x18e78a['to'],_0x3b853e=_0x18e78a[_0x4c5645(0x29c)],_0x17f64c=_0x18e78a['stage'];_0x3b853e&&!_0x31164a&&!_0x46f93b&&console[_0x4c5645(0x227)](_0x4c5645(0x29f));const _0x3ad23f=_0x3b853e?withJsonFormat(_0x1959ba):_0x1959ba,{journeyId:_0x33ba1f,journeyName:_0x1f2cdc}=await resolveJourneyIdFromInput(_0x1c89f2,_0x3ad23f,_0x27e173),_0x2fb89f=_0x31164a||_0x46f93b?{'from':_0x31164a,'to':_0x46f93b}:undefined,_0x40ba4d=await withSpinner(_0x4c5645(0x1da),()=>Promise[_0x4c5645(0x253)]([_0x27e173[_0x4c5645(0x1cd)][_0x4c5645(0x25c)](_0x33ba1f),_0x27e173[_0x4c5645(0x1cd)][_0x4c5645(0x1fb)](_0x33ba1f,_0x2fb89f)]),{'verbose':_0x3ad23f[_0x4c5645(0x252)]}),[_0x290a2b,_0x2813c2]=_0x40ba4d[_0x4c5645(0x28e)];if(!_0x2813c2||_0x2813c2[_0x4c5645(0x222)]===null)return console[_0x4c5645(0x227)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x1f2cdc),console[_0x4c5645(0x227)](_0x4c5645(0x29e)),0x0;const _0x2416bd=buildStageNameMap(_0x290a2b),_0x45af28=!!(_0x2fb89f&&_0x2813c2[_0x4c5645(0x296)]?.[_0x4c5645(0x259)]),_0x4cc930={'stageNameMap':_0x2416bd,'hasPeriod':_0x45af28,'includeHistory':!!_0x3b853e};if(_0x17f64c&&_0x2813c2[_0x4c5645(0x214)]){const _0x2edc78=_0x2813c2[_0x4c5645(0x214)][_0x4c5645(0x1ba)](_0x1f23cf=>{const _0x436e98=_0x4c5645,_0x4e4ff7=_0x2416bd[_0x436e98(0x2a0)](_0x1f23cf['id'])??'';return _0x4e4ff7[_0x436e98(0x21a)]()===_0x17f64c['toLowerCase']();});if(_0x2edc78)return await handleSingleObjectOutput(formatStageStats(_0x2edc78,_0x4cc930),_0x3ad23f),0x0;const _0x4e92d0=_0x2813c2[_0x4c5645(0x214)]['map'](_0x3e916a=>_0x2416bd[_0x4c5645(0x2a0)](_0x3e916a['id'])??_0x3e916a['id']);return console['error'](_0x4c5645(0x29a)+_0x17f64c+_0x4c5645(0x1c7)),console['error'](_0x4c5645(0x21c)+_0x4e92d0['join'](',\x20')),0x1;}const _0x73d534=_0x2813c2['stages']?.[_0x4c5645(0x271)](_0x209708=>formatStageStats(_0x209708,_0x4cc930)),_0xb63a28=assembleJourneyStats(_0x2813c2,{'from':_0x31164a,'to':_0x46f93b,'includeHistory':_0x3b853e});return await this[_0x4c5645(0x26c)](_0xb63a28,_0x73d534??[],_0x3ad23f),0x0;}async[a22_0x54fb49(0x26c)](_0x41b65e,_0x22e3ff,_0x3c30bc){const _0x291994=a22_0x54fb49,_0xa6467d=_0x3c30bc[_0x291994(0x2b3)]===_0x291994(0x1ee)||_0x3c30bc[_0x291994(0x2b3)]===_0x291994(0x247)||_0x3c30bc[_0x291994(0x1ee)]||_0x3c30bc['jsonl'];if(_0xa6467d){_0x41b65e[_0x291994(0x214)]=_0x22e3ff,await handleSingleObjectOutput(_0x41b65e,_0x3c30bc);return;}await handleSingleObjectOutput(_0x41b65e,_0x3c30bc);for(const _0x2199a3 of _0x22e3ff){console[_0x291994(0x23e)](''),console[_0x291994(0x23e)](String(a22_0x22ee6a[_0x291994(0x287)]['bold']('['+_0x2199a3[_0x291994(0x2b5)]+']'))+a22_0x22ee6a[_0x291994(0x224)]('\x20'+_0x2199a3['id']));const {id:_0x28ed9b,name:_0x3071f3,..._0x136833}=_0x2199a3;await handleSingleObjectOutput(_0x136833,_0x3c30bc);}}}export class JourneyTrafficCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x1cf);[a22_0x54fb49(0x1d7)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a22_0x54fb49(0x1cb)](_0x295116){const _0x4b57ab=a22_0x54fb49,{options:_0x5c3f9f,args:_0x322dd1,tdx:_0x2b6a92}=_0x295116,_0x1f0d10=_0x322dd1[0x0];if(!requireNameOrPath(_0x1f0d10))return 0x1;_0x5c3f9f[_0x4b57ab(0x252)]&&console[_0x4b57ab(0x227)](_0x4b57ab(0x1e4)+_0x1f0d10);const _0x3c406b=_0x5c3f9f,_0x284475=_0x3c406b['type'],_0x1c3347=_0x3c406b[_0x4b57ab(0x20d)],_0xdf2e11=_0x3c406b['to'],_0x5a92a8=_0x3c406b[_0x4b57ab(0x24a)];if(_0x284475&&_0x284475!==_0x4b57ab(0x1be)&&_0x284475!==_0x4b57ab(0x244))return console[_0x4b57ab(0x227)]('Error:\x20Invalid\x20--type\x20\x22'+_0x284475+_0x4b57ab(0x238)),0x1;const _0x45dd66=withJsonFormat(_0x5c3f9f),{journeyId:_0x27c8ac,journeyName:_0x42d37a}=await resolveJourneyIdFromInput(_0x1f0d10,_0x45dd66,_0x2b6a92),_0x3a86af={'type':_0x284475,'from':_0x1c3347,'to':_0xdf2e11,'limit':_0x5a92a8},_0x49540a=await withSpinner(_0x4b57ab(0x28a),()=>_0x2b6a92[_0x4b57ab(0x1cd)][_0x4b57ab(0x292)](_0x27c8ac,_0x3a86af),{'verbose':_0x45dd66[_0x4b57ab(0x252)]}),_0x3edae9=_0x49540a['data'],_0x261864=_0x3edae9['conversion']&&(_0x3edae9['conversion'][_0x4b57ab(0x249)][_0x4b57ab(0x259)]>0x0||_0x3edae9[_0x4b57ab(0x1be)]['links'][_0x4b57ab(0x259)]>0x0),_0x16c8af=_0x3edae9[_0x4b57ab(0x244)]&&_0x3edae9[_0x4b57ab(0x244)]['length']>0x0;if(!_0x261864&&!_0x16c8af)return console[_0x4b57ab(0x227)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x42d37a),console['error']('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x1c3347&&_0xdf2e11&&console[_0x4b57ab(0x227)](_0x4b57ab(0x27c)),0x0;return await handleSingleObjectOutput(_0x3edae9,_0x45dd66),0x0;}}function formatStageStats(_0x5b7dd6,_0x2480bb){const _0x3c65f0=a22_0x54fb49,_0x585d22=_0x2480bb[_0x3c65f0(0x239)]&&_0x5b7dd6['history']?.['length']?aggregateStageHistory(_0x5b7dd6[_0x3c65f0(0x296)]):{'size':_0x5b7dd6[_0x3c65f0(0x2a3)],'entered':_0x5b7dd6[_0x3c65f0(0x1e3)],'milestone':_0x5b7dd6[_0x3c65f0(0x22f)],'milestone_rate':_0x5b7dd6['completeMilestoneRate'],'exit_or_jump':_0x5b7dd6[_0x3c65f0(0x26e)],'exit_or_jump_rate':_0x5b7dd6[_0x3c65f0(0x27d)]},_0x2fa20a={'id':_0x5b7dd6['id'],'name':_0x2480bb[_0x3c65f0(0x28d)][_0x3c65f0(0x2a0)](_0x5b7dd6['id'])??_0x5b7dd6['id'],..._0x585d22};return _0x2480bb['hasPeriod']&&_0x2480bb[_0x3c65f0(0x29c)]&&_0x5b7dd6[_0x3c65f0(0x296)]&&(_0x2fa20a[_0x3c65f0(0x296)]=_0x5b7dd6[_0x3c65f0(0x296)]),_0x2fa20a;}export class JourneyPauseCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x1ff);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x298);async[a22_0x54fb49(0x1cb)](_0x3e6c98){const _0x41dbb9=a22_0x54fb49,{options:_0x570c12,args:_0x4b6dd4,tdx:_0x3ff64e}=_0x3e6c98,_0x52cf30=_0x4b6dd4[0x0];if(!requireNameOrPath(_0x52cf30))return 0x1;_0x570c12[_0x41dbb9(0x252)]&&console[_0x41dbb9(0x227)](_0x41dbb9(0x1e4)+_0x52cf30);const {journeyId:_0x40fa27,journeyName:_0xf1cb84}=await resolveJourneyIdFromInput(_0x52cf30,_0x570c12,_0x3ff64e);if(!_0x570c12['yes']){const _0x2eeafb=await confirm(_0x41dbb9(0x278)+_0xf1cb84+'\x22?');if(!_0x2eeafb)return console['error'](_0x41dbb9(0x269)),0x0;}const _0x3d8e28=await withSpinner(_0x41dbb9(0x23a),()=>_0x3ff64e[_0x41dbb9(0x1cd)][_0x41dbb9(0x1e5)](_0x40fa27),{'verbose':_0x570c12[_0x41dbb9(0x252)]}),_0x5a2666=_0x3d8e28['data'];return console[_0x41dbb9(0x227)](_0x41dbb9(0x265)+_0x5a2666['attributes']['name']+'\x22\x20paused'),0x0;}}function a22_0x5170(_0x885f31,_0x2a5ce7){_0x885f31=_0x885f31-0x1b3;const _0x442ea9=a22_0x442e();let _0x517086=_0x442ea9[_0x885f31];return _0x517086;}export class JourneyResumeCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]='journey:resume';[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x28f);async[a22_0x54fb49(0x1cb)](_0x177087){const _0x484fd9=a22_0x54fb49,{options:_0x1c7f57,args:_0x10250c,tdx:_0x107c0b}=_0x177087,_0x2f49de=_0x10250c[0x0];if(!requireNameOrPath(_0x2f49de))return 0x1;_0x1c7f57['verbose']&&console[_0x484fd9(0x227)](_0x484fd9(0x1e4)+_0x2f49de);const {journeyId:_0x2a3093,journeyName:_0x2edde6}=await resolveJourneyIdFromInput(_0x2f49de,_0x1c7f57,_0x107c0b);if(!_0x1c7f57[_0x484fd9(0x254)]){const _0x4df230=await confirm(_0x484fd9(0x20c)+_0x2edde6+'\x22?');if(!_0x4df230)return console[_0x484fd9(0x227)](_0x484fd9(0x269)),0x0;}const _0x1318aa=await withSpinner('Resuming\x20journey...',()=>_0x107c0b[_0x484fd9(0x1cd)][_0x484fd9(0x1f3)](_0x2a3093),{'verbose':_0x1c7f57[_0x484fd9(0x252)]}),_0x374d8f=_0x1318aa[_0x484fd9(0x28e)];return console[_0x484fd9(0x227)](_0x484fd9(0x265)+_0x374d8f[_0x484fd9(0x1f5)][_0x484fd9(0x2b5)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a22_0x54fb49(0x299);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x290);async[a22_0x54fb49(0x1cb)](_0x364f37){const _0x45e3b2=a22_0x54fb49,{options:_0x274e6e,args:_0x578d1f,tdx:_0x3327e3}=_0x364f37,_0x2eeef3=_0x274e6e,_0x42dff3=_0x578d1f[0x0],_0x2f8a2c=_0x42dff3&&isYamlFilePath(_0x42dff3),_0x5b926e=await resolveTarget({'arg':_0x2f8a2c?_0x42dff3:undefined,'contextParent':_0x274e6e[_0x45e3b2(0x1b7)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5b926e))return _0x5b926e[_0x45e3b2(0x236)]===_0x45e3b2(0x208)?(console[_0x45e3b2(0x227)](a22_0x22ee6a['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x45e3b2(0x227)]('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[_0x45e3b2(0x227)](_0x45e3b2(0x250)),console[_0x45e3b2(0x227)](_0x45e3b2(0x261)),console[_0x45e3b2(0x227)](_0x45e3b2(0x26d))):(console[_0x45e3b2(0x227)](a22_0x22ee6a['red'](_0x45e3b2(0x1df)+_0x5b926e[_0x45e3b2(0x2b6)]+'\x0a')),_0x5b926e[_0x45e3b2(0x20b)]&&console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x287)](_0x5b926e['helpText']))),0x1;let _0x290d8c=_0x2f8a2c?undefined:_0x42dff3,_0xc92995,_0x4c2cf2;_0x5b926e[_0x45e3b2(0x2a8)]===_0x45e3b2(0x1f2)&&(_0x290d8c=_0x5b926e[_0x45e3b2(0x237)],_0xc92995=_0x5b926e['filePath'],_0x4c2cf2=_0x5b926e['folderPath']);const _0x1a9c2d=_0x5b926e[_0x45e3b2(0x23d)],_0x44241e=_0x5b926e[_0x45e3b2(0x220)];_0x2eeef3[_0x45e3b2(0x252)]&&(console[_0x45e3b2(0x227)](_0x45e3b2(0x1de)+_0x1a9c2d),console[_0x45e3b2(0x227)](_0x45e3b2(0x235)+_0x44241e),_0x290d8c&&console['error'](_0x45e3b2(0x2b2)+_0x290d8c),_0xc92995&&console['error'](_0x45e3b2(0x201)+_0xc92995),_0x4c2cf2&&console[_0x45e3b2(0x227)](_0x45e3b2(0x283)+_0x4c2cf2));const _0x3a4d14=await withSpinner(_0x45e3b2(0x1e1),()=>_0x3327e3['segment'][_0x45e3b2(0x1f6)](_0x1a9c2d),{'verbose':_0x274e6e[_0x45e3b2(0x252)]}),_0xf2b909=_0x3a4d14[_0x45e3b2(0x28e)],{journeys:_0x268a31,folders:_0x5189de}=await withSpinner(_0x45e3b2(0x24d),async()=>{const _0x2119d6=_0x45e3b2,[_0x3d53b1,_0x32f446]=await Promise['all']([_0x3327e3[_0x2119d6(0x1cd)][_0x2119d6(0x27b)](_0xf2b909,undefined,{'includeAllVersions':!![]}),_0x3327e3['segment'][_0x2119d6(0x1e7)](_0xf2b909)]);return{'journeys':_0x3d53b1,'folders':_0x32f446};},{'verbose':_0x274e6e[_0x45e3b2(0x252)]})[_0x45e3b2(0x1b4)](_0x21e62a=>_0x21e62a[_0x45e3b2(0x28e)]);let _0x41674f=_0x268a31;const _0x5d4402=buildFolderIdToPathMap(_0x5189de);if(_0x290d8c){const _0x53c533=_0x41674f[_0x45e3b2(0x231)](_0x11d73a=>_0x11d73a[_0x45e3b2(0x1bb)]['toLowerCase']()===_0x290d8c[_0x45e3b2(0x21a)]());if(_0x53c533['length']===0x0)return console[_0x45e3b2(0x227)](_0x45e3b2(0x289)+_0x290d8c),console[_0x45e3b2(0x227)](_0x45e3b2(0x2aa)),0x1;_0x41674f=_0x53c533;}if(_0x4c2cf2!==undefined){const _0x38781d=_0x41674f['filter'](_0x4f7f70=>{const _0x5947b9=_0x45e3b2,_0x18e0e1=_0x4f7f70[_0x5947b9(0x25b)]?_0x5d4402[_0x5947b9(0x2a0)](_0x4f7f70[_0x5947b9(0x25b)])||'':'';return _0x18e0e1===_0x4c2cf2;});if(_0x38781d[_0x45e3b2(0x259)]===0x0&&_0x41674f[_0x45e3b2(0x259)]>0x0){console[_0x45e3b2(0x227)]('Error:\x20Journey\x20\x27'+_0x290d8c+_0x45e3b2(0x1c1)+(_0x4c2cf2||'root\x20folder')),console[_0x45e3b2(0x227)](_0x45e3b2(0x1b3));for(const _0x39bd7d of _0x41674f){const _0x167281=_0x39bd7d[_0x45e3b2(0x25b)]?_0x5d4402[_0x45e3b2(0x2a0)](_0x39bd7d[_0x45e3b2(0x25b)])||'':'';console[_0x45e3b2(0x227)]('\x20\x20-\x20'+(_0x167281||_0x45e3b2(0x246))+'/'+_0x39bd7d[_0x45e3b2(0x1bb)]);}return 0x1;}_0x41674f=_0x38781d;}if(_0x41674f[_0x45e3b2(0x259)]===0x0)return console['error'](_0x45e3b2(0x1f7)),0x0;const _0x5663ef=new Map();for(const _0x5511c6 of _0x41674f){const _0x169cc3=_0x5511c6[_0x45e3b2(0x293)];!_0x5663ef[_0x45e3b2(0x1c2)](_0x169cc3)&&_0x5663ef[_0x45e3b2(0x288)](_0x169cc3,[]),_0x5663ef[_0x45e3b2(0x2a0)](_0x169cc3)[_0x45e3b2(0x25d)](_0x5511c6);}for(const _0xcf7d74 of _0x5663ef[_0x45e3b2(0x1d0)]()){_0xcf7d74[_0x45e3b2(0x1e9)]((_0x2d060f,_0x2ef3f3)=>(_0x2d060f[_0x45e3b2(0x228)]||0x0)-(_0x2ef3f3[_0x45e3b2(0x228)]||0x0));}const _0x417348=[],{idToEmailMap:_0x64bf01,connectionIdToNameMap:_0x5c95bc}=await withSpinner(_0x45e3b2(0x1e6),async()=>{const _0x5856ea=_0x45e3b2,[_0x33ac0a,_0x33a594]=await Promise[_0x5856ea(0x253)]([_0x3327e3[_0x5856ea(0x219)][_0x5856ea(0x22b)](),_0x3327e3[_0x5856ea(0x29d)][_0x5856ea(0x279)]()]);return{'idToEmailMap':_0x33ac0a,'connectionIdToNameMap':_0x33a594};},{'verbose':_0x274e6e[_0x45e3b2(0x252)]})[_0x45e3b2(0x1b4)](_0xedd3d6=>_0xedd3d6['data']);for(const _0x55383b of _0x5663ef['values']()){const _0x1632ed=_0x55383b[0x0][_0x45e3b2(0x1bb)],_0x30e33c=_0x55383b[0x0][_0x45e3b2(0x25b)],_0x1bf1da=_0x30e33c?_0x5d4402[_0x45e3b2(0x2a0)](_0x30e33c)||'':'',_0x114ced=_0x1bf1da?a22_0x1a2b3d[_0x45e3b2(0x29b)](_0x44241e,_0x1bf1da):_0x44241e,_0x4ad232=_0xc92995||a22_0x1a2b3d[_0x45e3b2(0x29b)](_0x114ced,sanitizeFileName(_0x1632ed)+_0x45e3b2(0x1c5));let _0xaa782d,_0x361b2e;if(existsSync(_0x4ad232))try{const _0x40a926=readFileSync(_0x4ad232,'utf-8'),_0x305ffe=parseYamlString(_0x40a926);_0x361b2e=_0x305ffe,_0xaa782d=buildRuleToNameMapping(_0x305ffe),_0x2eeef3[_0x45e3b2(0x252)]&&_0xaa782d[_0x45e3b2(0x2a3)]>0x0&&console['error']('Found\x20'+_0xaa782d[_0x45e3b2(0x2a3)]+_0x45e3b2(0x294)+_0x1632ed);}catch(_0x284a22){_0x2eeef3[_0x45e3b2(0x252)]&&console[_0x45e3b2(0x227)](_0x45e3b2(0x1ca)+_0x284a22[_0x45e3b2(0x2b6)]);}const _0xc1c42=[],_0x1ae2cd=new Set(),_0x1cf9b8=new Map(),_0x24bb86=new Map(),_0x210f10=new Set(),_0x50d761=new Map(),_0x4a86d4=new Map(),_0x2f4f5c=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x1632ed+_0x45e3b2(0x28b),async _0x56dcab=>{const _0x5c4bd1=_0x45e3b2;for(const _0x27b06d of _0x55383b){const _0x1e3f46=_0x55383b[_0x5c4bd1(0x259)]>0x1?_0x27b06d[_0x5c4bd1(0x1bb)]+'\x20v'+(_0x27b06d[_0x5c4bd1(0x228)]||0x1):_0x27b06d['journeyBundleName'];_0x56dcab[_0x5c4bd1(0x1bd)](_0x5c4bd1(0x207)+_0x1e3f46);const _0x52938f=await _0x3327e3[_0x5c4bd1(0x1cd)][_0x5c4bd1(0x25c)](_0x27b06d['id']),_0x2822e6=_0x52938f[_0x5c4bd1(0x1f5)]?.['audienceId'],_0x54cbd0={'resolveSegment':async _0xbac87e=>{const _0x1ec70a=_0x5c4bd1;if(!_0x2822e6)return{'name':_0xbac87e,'isJourneyLocal':![]};const _0x22395d=_0x1cf9b8[_0x1ec70a(0x2a0)](_0xbac87e);if(_0x22395d)return _0x22395d;try{const _0x3a60dc=await _0x3327e3[_0x1ec70a(0x20a)]['getSegment'](_0x2822e6,_0xbac87e),_0x1ea063=_0x3a60dc['kind']===SEGMENT_KIND_JOURNEY;let _0xb08e24,_0x2d1d84=_0x3a60dc[_0x1ec70a(0x2b5)];if(_0x1ea063&&_0x3a60dc[_0x1ec70a(0x243)]){const _0x7628f3=await segmentResponseToDef(_0x3a60dc,{'resolveSegmentName':async _0x471388=>{const _0x128f31=_0x1ec70a,_0x53a113=_0x1cf9b8[_0x128f31(0x2a0)](_0x471388);if(_0x53a113)return _0x53a113['name'];const _0x13e8d7=await _0x54cbd0[_0x128f31(0x1dd)](_0x471388);return _0x13e8d7[_0x128f31(0x2b5)];}}),_0xeb76d2=_0x7628f3[_0x1ec70a(0x243)];_0xb08e24={'description':_0x3a60dc[_0x1ec70a(0x1d7)],'rule':_0xeb76d2};const _0x278581=serializeRule(_0xeb76d2),_0x471e6e=_0x24bb86[_0x1ec70a(0x2a0)](_0x278581);if(_0x471e6e)_0x2d1d84=_0x471e6e,_0xb08e24=undefined,_0x2eeef3['verbose']&&console[_0x1ec70a(0x227)](_0x1ec70a(0x245)+_0x3a60dc['name']+_0x1ec70a(0x2b9)+_0x471e6e);else{let _0x6ffb64=![];if(_0xaa782d){const _0x5baaf4=_0xaa782d['get'](_0x278581);if(_0x5baaf4){const _0x168306=_0x5baaf4[_0x1ec70a(0x1ba)](_0x4987be=>!_0x1ae2cd[_0x1ec70a(0x1c2)](_0x4987be));_0x168306&&(_0x2d1d84=_0x168306,_0x1ae2cd[_0x1ec70a(0x2ac)](_0x168306),_0x24bb86[_0x1ec70a(0x288)](_0x278581,_0x168306),_0x6ffb64=!![],_0x2eeef3[_0x1ec70a(0x252)]&&console[_0x1ec70a(0x227)](_0x1ec70a(0x275)+_0x168306+_0x1ec70a(0x24e)));}}if(!_0x6ffb64){const _0x32d318=generateJourneyLocalName(_0x3a60dc['name']);_0x32d318&&(_0x2d1d84=_0x32d318);let _0x52e1ca=_0x2d1d84,_0xdd7abf=0x2;while(_0x1ae2cd['has'](_0x52e1ca)){_0x52e1ca=_0x2d1d84+'_'+_0xdd7abf,_0xdd7abf++;}_0x1ae2cd[_0x1ec70a(0x2ac)](_0x52e1ca),_0x24bb86[_0x1ec70a(0x288)](_0x278581,_0x52e1ca),_0x2d1d84=_0x52e1ca;}}}const _0x396fef={'name':_0x2d1d84,'isJourneyLocal':_0x1ea063,'definition':_0xb08e24};return _0x1cf9b8[_0x1ec70a(0x288)](_0xbac87e,_0x396fef),_0x396fef;}catch(_0x2ce76d){return _0x274e6e[_0x1ec70a(0x252)]&&console[_0x1ec70a(0x227)](_0x1ec70a(0x210)+_0xbac87e+':\x20'+_0x2ce76d[_0x1ec70a(0x2b6)]),{'name':_0xbac87e,'isJourneyLocal':![]};}},'resolveActivation':async _0x11b3c8=>{const _0x5a37ae=_0x5c4bd1,_0x363178=_0x50d761[_0x5a37ae(0x2a0)](_0x11b3c8);if(_0x363178)return _0x363178;try{const _0x2de21f=await _0x3327e3[_0x5a37ae(0x1cd)][_0x5a37ae(0x1eb)](_0x27b06d['id'],_0x11b3c8),_0x494ab7=journeyActivationStepToYaml(_0x2de21f,_0x64bf01,_0x5c95bc),_0x3821bf=JSON[_0x5a37ae(0x284)]({'name':_0x494ab7[_0x5a37ae(0x2b5)],'connection':_0x494ab7[_0x5a37ae(0x29d)],'connector_config':_0x494ab7['connector_config']}),_0x24bed8=_0x4a86d4[_0x5a37ae(0x2a0)](_0x3821bf);if(_0x24bed8){const _0x104d8f={'name':_0x24bed8,'isJourneyLocal':!![],'definition':_0x494ab7};return _0x50d761[_0x5a37ae(0x288)](_0x11b3c8,_0x104d8f),_0x104d8f;}const _0x7fdb94=_0x2de21f['attributes'][_0x5a37ae(0x211)]['name']||_0x11b3c8,_0xc0ee52=sanitizeYamlKey(_0x7fdb94)||'activation_'+_0x11b3c8;let _0x4f76ad=_0xc0ee52,_0x46ac8c=0x2;while(_0x210f10[_0x5a37ae(0x1c2)](_0x4f76ad)){_0x4f76ad=_0xc0ee52+'_'+_0x46ac8c,_0x46ac8c++;}_0x210f10[_0x5a37ae(0x2ac)](_0x4f76ad),_0x4a86d4[_0x5a37ae(0x288)](_0x3821bf,_0x4f76ad);const _0x40eede={'name':_0x4f76ad,'isJourneyLocal':!![],'definition':_0x494ab7};return _0x50d761['set'](_0x11b3c8,_0x40eede),_0x40eede;}catch(_0x4a05bb){return _0x274e6e[_0x5a37ae(0x252)]&&console[_0x5a37ae(0x227)](_0x5a37ae(0x276)+_0x11b3c8+':\x20'+_0x4a05bb[_0x5a37ae(0x2b6)]),{'name':_0x11b3c8,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x311d6f,_0x40a5f8)=>{const _0x135818=_0x5c4bd1;return resolveJumpTarget(_0x311d6f,_0x40a5f8,_0x2f4f5c,_0x30f6eb=>_0x3327e3['journey'][_0x135818(0x25c)](_0x30f6eb));}},_0x5343d0=await journeyResponseToDef(_0x52938f,_0x54cbd0);_0xc1c42[_0x5c4bd1(0x25d)]({'item':_0x27b06d,'yaml':_0x5343d0});}},{'verbose':_0x274e6e[_0x45e3b2(0x252)]});const _0x15d51d=buildMergedJourneyDef(_0xc1c42,_0xaa782d),_0x4bc0d4=normalizeJourneyDef(_0x15d51d,_0x361b2e),_0x4ec9ce=toYamlString(_0x4bc0d4),_0x2fa659=_0xc92995||a22_0x1a2b3d[_0x45e3b2(0x29b)](_0x114ced,sanitizeFileName(_0x1632ed)+'.yml');!_0xc92995&&_0x1bf1da&&!existsSync(_0x114ced)&&mkdirSync(_0x114ced,{'recursive':!![]});const _0x5c3869=a22_0x1a2b3d['relative'](process[_0x45e3b2(0x2a9)](),_0x2fa659);if(existsSync(_0x2fa659)){const _0x5917b3=readFileSync(_0x2fa659,_0x45e3b2(0x2a2)),_0x25a736=generateDiff(_0x5917b3,_0x4ec9ce),_0x5edbe0=hasChanges(_0x25a736);_0x417348[_0x45e3b2(0x25d)]({'relativePath':_0x5c3869,'absolutePath':_0x2fa659,'content':_0x4ec9ce,'isNew':![],'hasChanges':_0x5edbe0,'diff':_0x5edbe0?formatDiffWithColors(_0x25a736):undefined});}else _0x417348[_0x45e3b2(0x25d)]({'relativePath':_0x5c3869,'absolutePath':_0x2fa659,'content':_0x4ec9ce,'isNew':!![],'hasChanges':![]});}const _0x739bb8=_0x417348[_0x45e3b2(0x231)](_0x592a85=>_0x592a85[_0x45e3b2(0x2a5)]),_0x3c2094=_0x417348[_0x45e3b2(0x231)](_0xf92a7f=>!_0xf92a7f[_0x45e3b2(0x2a5)]&&_0xf92a7f['hasChanges']),_0x5eb9a5=_0x417348['filter'](_0x1c5dce=>!_0x1c5dce[_0x45e3b2(0x2a5)]&&!_0x1c5dce[_0x45e3b2(0x280)]),_0x30b6d5=_0x41674f[_0x45e3b2(0x259)],_0x228840=_0x5663ef[_0x45e3b2(0x2a3)],_0x31c5e6=_0x30b6d5>_0x228840?'\x20('+_0x30b6d5+'\x20versions)':'';console[_0x45e3b2(0x227)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a22_0x22ee6a[_0x45e3b2(0x287)](_0x228840+'\x20journeys')+a22_0x22ee6a['dim'](_0x31c5e6)),console['error']('\x20\x20'+a22_0x22ee6a['green']('+\x20'+_0x739bb8['length']+_0x45e3b2(0x232))),console[_0x45e3b2(0x227)]('\x20\x20'+a22_0x22ee6a['yellow']('~\x20'+_0x3c2094[_0x45e3b2(0x259)]+_0x45e3b2(0x1c9))),console[_0x45e3b2(0x227)]('\x20\x20'+a22_0x22ee6a[_0x45e3b2(0x224)]('=\x20'+_0x5eb9a5[_0x45e3b2(0x259)]+_0x45e3b2(0x268))),console['error']('\x20\x20Target:\x20'+a22_0x22ee6a[_0x45e3b2(0x287)](_0x44241e)+'\x0a');if(_0x3c2094['length']>0x0)for(const _0x162ab7 of _0x3c2094){console[_0x45e3b2(0x227)](_0x45e3b2(0x286)+_0x162ab7[_0x45e3b2(0x2b1)]+'\x27:'),console['error']('─'[_0x45e3b2(0x1c0)](0x3c)),console['error'](_0x162ab7[_0x45e3b2(0x27f)]),console[_0x45e3b2(0x227)]('─'[_0x45e3b2(0x1c0)](0x3c));}if(_0x2eeef3['dryRun'])return console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x217)](_0x45e3b2(0x1d6))),0x0;if(_0x739bb8[_0x45e3b2(0x259)]===0x0&&_0x3c2094[_0x45e3b2(0x259)]===0x0)return console[_0x45e3b2(0x227)](a22_0x22ee6a['green'](_0x45e3b2(0x27e))),saveSessionContext({'parent_segment':_0x1a9c2d},_0x2eeef3[_0x45e3b2(0x26f)]),console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x1bf)](_0x45e3b2(0x21f)+a22_0x22ee6a['dim'](_0x45e3b2(0x2b0))+_0x45e3b2(0x1db)+a22_0x22ee6a['cyan'](_0x1a9c2d))),0x0;if(!_0x2eeef3[_0x45e3b2(0x254)]&&(_0x739bb8[_0x45e3b2(0x259)]>0x0||_0x3c2094[_0x45e3b2(0x259)]>0x0)){if(!isInteractive())return console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x25e)](_0x45e3b2(0x274)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x224)](_0x45e3b2(0x2b8))),0x1;const _0x244a49=await confirmKey(_0x45e3b2(0x215)+(_0x739bb8[_0x45e3b2(0x259)]+_0x3c2094['length'])+'\x20files?');if(!_0x244a49)return console[_0x45e3b2(0x227)](a22_0x22ee6a['yellow'](_0x45e3b2(0x24f)),_0x45e3b2(0x216)),0x1;}!existsSync(_0x44241e)&&mkdirSync(_0x44241e,{'recursive':!![]});const _0x1e0e77=a22_0x1a2b3d[_0x45e3b2(0x29b)](_0x44241e,_0x45e3b2(0x2a4));writeFileSync(_0x1e0e77,createTdxConfigContent(_0x1a9c2d),'utf-8');for(const _0x258b7e of _0x417348){(_0x258b7e[_0x45e3b2(0x2a5)]||_0x258b7e[_0x45e3b2(0x280)])&&writeFileSync(_0x258b7e['absolutePath'],_0x258b7e[_0x45e3b2(0x256)],_0x45e3b2(0x2a2));}return console[_0x45e3b2(0x227)](a22_0x22ee6a['green'](_0x45e3b2(0x1d5)+(_0x739bb8[_0x45e3b2(0x259)]+_0x3c2094[_0x45e3b2(0x259)])+_0x45e3b2(0x270)+_0x44241e)),saveSessionContext({'parent_segment':_0x1a9c2d},_0x2eeef3['session']),console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x1bf)](_0x45e3b2(0x21f)+a22_0x22ee6a[_0x45e3b2(0x224)](_0x45e3b2(0x2b0))+'\x20=\x20'+a22_0x22ee6a[_0x45e3b2(0x287)](_0x1a9c2d))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a22_0x54fb49(0x1e2);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x21e);async[a22_0x54fb49(0x1cb)](_0x40d615){const _0x310402=a22_0x54fb49,{options:_0x22c0cf,args:_0x52d26e,tdx:_0x1033c2}=_0x40d615,_0x585add=_0x52d26e[0x0];if(!requireNameOrPath(_0x585add))return 0x1;_0x22c0cf['verbose']&&console['error'](_0x310402(0x1e4)+_0x585add);const {journeyId:_0x372680}=await resolveJourneyIdFromInput(_0x585add,_0x22c0cf,_0x1033c2),_0x5462a2=await withSpinner(_0x310402(0x251),()=>_0x1033c2['journey'][_0x310402(0x212)](_0x372680),{'verbose':_0x22c0cf[_0x310402(0x252)]}),_0x14c2a4=_0x5462a2[_0x310402(0x28e)];return console[_0x310402(0x23e)](_0x310402(0x1c3)+_0x14c2a4[_0x310402(0x27a)]),console[_0x310402(0x23e)]('Table:\x20'+_0x14c2a4['table']),await handleSDKOutput(_0x14c2a4['columns'],_0x22c0cf),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x20e);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x223);async[a22_0x54fb49(0x1cb)](_0x4fcc18){const _0x55e615=a22_0x54fb49,{options:_0x2ee13e,args:_0x161eab,tdx:_0x4b9de6}=_0x4fcc18,_0x53664d=_0x161eab[0x0];if(!requireNameOrPath(_0x53664d))return 0x1;_0x2ee13e[_0x55e615(0x252)]&&console[_0x55e615(0x227)](_0x55e615(0x1e4)+_0x53664d);const {journeyId:_0x339d76}=await resolveJourneyIdFromInput(_0x53664d,_0x2ee13e,_0x4b9de6),_0x443e36=await withSpinner(_0x55e615(0x1f8),()=>_0x4b9de6[_0x55e615(0x1cd)][_0x55e615(0x1e0)](_0x339d76),{'verbose':_0x2ee13e[_0x55e615(0x252)]}),_0x5e62c2=_0x443e36[_0x55e615(0x28e)];return console[_0x55e615(0x227)]('Found\x20'+_0x5e62c2[_0x55e615(0x259)]+_0x55e615(0x240)+(_0x5e62c2[_0x55e615(0x259)]!==0x1?'s':'')),await handleSDKOutput(_0x5e62c2,_0x2ee13e),0x0;}}export class JourneyPushCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x22d);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x2ab);[a22_0x54fb49(0x295)]=new SegmentPushCommand();async['execute'](_0x24f131){const _0x3b32af=a22_0x54fb49,_0x2ae73c=_0x24f131[_0x3b32af(0x1fe)][0x0];let _0x1ecf17;if(_0x2ae73c){const _0x4f9b96=await resolveTarget({'arg':_0x2ae73c,'contextParent':_0x24f131['options']['parentSegment'],'cwd':process[_0x3b32af(0x2a9)]()});isSuccessfulResolution(_0x4f9b96)&&_0x4f9b96['type']===_0x3b32af(0x1f2)&&(_0x1ecf17=_0x4f9b96['filePath']);}const _0x15f925={..._0x24f131,'options':{..._0x24f131['options'],'journeysOnly':!![],..._0x1ecf17&&{'singleFilePath':_0x1ecf17}}};return this[_0x3b32af(0x295)][_0x3b32af(0x1cb)](_0x15f925);}}export class JourneyVersionsCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x258);[a22_0x54fb49(0x1d7)]='List\x20all\x20versions\x20of\x20a\x20journey';async['execute'](_0x3066a1){const _0x3e63d5=a22_0x54fb49,{options:_0x4026dd,args:_0x1f77cc,tdx:_0x390bce}=_0x3066a1,_0x52703b=_0x1f77cc[0x0];if(!requireNameOrPath(_0x52703b))return 0x1;if(_0x4026dd[_0x3e63d5(0x252)])console['error'](_0x3e63d5(0x1e4)+_0x52703b);const {journeyId:_0x556be5}=await resolveJourneyIdFromInput(_0x52703b,_0x4026dd,_0x390bce),_0x161138=await withSpinner('Listing\x20journey\x20versions...',()=>_0x390bce[_0x3e63d5(0x1cd)][_0x3e63d5(0x205)](_0x556be5),{'verbose':_0x4026dd[_0x3e63d5(0x252)]}),{bundleName:_0x393dac,versions:_0x421fa3,latestJourneyId:_0x60e5fc}=_0x161138[_0x3e63d5(0x28e)];console[_0x3e63d5(0x227)](_0x393dac+':\x20'+_0x421fa3[_0x3e63d5(0x259)]+_0x3e63d5(0x285)+(_0x421fa3[_0x3e63d5(0x259)]!==0x1?'s':''));const _0x49a444=_0x421fa3[_0x3e63d5(0x271)](_0x5de1c0=>({'version':_0x5de1c0[_0x3e63d5(0x228)],'journey_id':_0x5de1c0[_0x3e63d5(0x222)],'name':_0x5de1c0['name'],'state':_0x5de1c0['state'],'paused':_0x5de1c0[_0x3e63d5(0x272)],'latest':_0x5de1c0[_0x3e63d5(0x222)]===_0x60e5fc,'created_at':_0x5de1c0['createdAt']}));return await handleSDKOutput(_0x49a444,_0x4026dd),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a22_0x54fb49(0x1c8);[a22_0x54fb49(0x1d7)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a22_0x54fb49(0x1cb)](_0x42db52){const _0x29dd21=a22_0x54fb49,{options:_0x5acc55,args:_0x4e81cc,tdx:_0x5b3b20}=_0x42db52,_0x45be32=_0x4e81cc[0x0];if(!requireNameOrPath(_0x45be32))return 0x1;if(_0x5acc55[_0x29dd21(0x252)])console[_0x29dd21(0x227)]('Input:\x20'+_0x45be32);const {journeyId:_0x4c7a96,journeyName:_0x12a0e5}=await resolveJourneyIdFromInput(_0x45be32,_0x5acc55,_0x5b3b20);if(!_0x5acc55[_0x29dd21(0x254)]){const _0x85696c=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x12a0e5+'\x22?');if(!_0x85696c)return console['error'](_0x29dd21(0x269)),0x0;}const _0x68d675=await withSpinner('Creating\x20new\x20version...',()=>_0x5b3b20[_0x29dd21(0x1cd)][_0x29dd21(0x226)](_0x4c7a96),{'verbose':_0x5acc55[_0x29dd21(0x252)]}),_0x12b762=_0x68d675[_0x29dd21(0x28e)];return console[_0x29dd21(0x227)](a22_0x22ee6a['green']('✔')+'\x20Created\x20v'+_0x12b762['attributes'][_0x29dd21(0x228)]+_0x29dd21(0x291)+_0x12b762[_0x29dd21(0x1f5)]['name']+'\x22'),console[_0x29dd21(0x227)](_0x29dd21(0x1e8)+_0x12b762['id']),await handleSingleObjectOutput({'id':_0x12b762['id'],'name':_0x12b762['attributes'][_0x29dd21(0x2b5)],'version':_0x12b762[_0x29dd21(0x1f5)]['versionNumber'],'state':_0x12b762['attributes']['state'],'bundle_id':_0x12b762[_0x29dd21(0x1f5)][_0x29dd21(0x293)],'created_at':_0x12b762[_0x29dd21(0x1f5)]['createdAt']},_0x5acc55),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x241);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x28c);async[a22_0x54fb49(0x1cb)](_0x186816){const _0x449a64=a22_0x54fb49,{options:_0xa70e4f,args:_0x18cac4,tdx:_0x460f32}=_0x186816,_0x18bb3a=_0x18cac4[0x0];if(!requireNameOrPath(_0x18bb3a))return 0x1;const _0x2ebcee=_0xa70e4f['version'];if(!_0x2ebcee)return console[_0x449a64(0x227)]('Error:\x20--version\x20option\x20is\x20required'),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x29a867=parseInt(_0x2ebcee,0xa);if(isNaN(_0x29a867)||_0x29a867<0x1)return console[_0x449a64(0x227)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x2ebcee),0x1;if(_0xa70e4f[_0x449a64(0x252)])console[_0x449a64(0x227)]('Input:\x20'+_0x18bb3a+',\x20version:\x20'+_0x29a867);const {journeyId:_0x5df0e3,parentSegmentId:_0x11ed7e}=await resolveJourneyIdFromInput(_0x18bb3a,_0xa70e4f,_0x460f32),_0x2af8a1=await withSpinner(_0x449a64(0x233),()=>_0x460f32[_0x449a64(0x1cd)]['listVersions'](_0x5df0e3),{'verbose':_0xa70e4f[_0x449a64(0x252)]}),{versions:_0x4cd7cd,latestJourneyId:_0x452e22}=_0x2af8a1[_0x449a64(0x28e)],_0x12c2b0=_0x4cd7cd[_0x449a64(0x1ba)](_0x21f133=>_0x21f133['versionNumber']===_0x29a867);if(!_0x12c2b0){const _0x312d30=_0x4cd7cd['map'](_0x2e4a8f=>'v'+_0x2e4a8f[_0x449a64(0x228)])[_0x449a64(0x29b)](',\x20');return console[_0x449a64(0x227)](_0x449a64(0x1d9)+_0x29a867+_0x449a64(0x2b4)+_0x312d30),0x1;}const _0x370af0=await withSpinner(_0x449a64(0x297)+_0x29a867+_0x449a64(0x2a7),()=>_0x460f32[_0x449a64(0x1cd)]['getJourney'](_0x12c2b0['journeyId']),{'verbose':_0xa70e4f[_0x449a64(0x252)]}),_0x2a6466=_0x370af0[_0x449a64(0x28e)],_0x1a8f4c=getConsoleNextUrl(_0xa70e4f[_0x449a64(0x21d)],_0x449a64(0x248)+_0x11ed7e+_0x449a64(0x203)+_0x12c2b0['journeyId']+'/j/da/je');return await handleSingleObjectOutput({'id':_0x2a6466['id'],'name':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x2b5)],'version':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x228)],'description':_0x2a6466['attributes'][_0x449a64(0x1d7)],'state':_0x2a6466['attributes'][_0x449a64(0x1f0)],'paused':_0x2a6466[_0x449a64(0x1f5)]['paused'],'reentry_mode':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x23c)],'stages':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x1ec)]?.[_0x449a64(0x259)]||0x0,..._0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x206)]&&{'goal':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x206)][_0x449a64(0x2b5)]},'latest':_0x12c2b0[_0x449a64(0x222)]===_0x452e22,'created_at':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x255)],'updated_at':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x263)],'url':_0x1a8f4c},_0xa70e4f),0x0;}}
1
+ const a22_0x4786ae=a22_0x8975;(function(_0x8b81d6,_0x3a9a64){const _0x2e9183=a22_0x8975,_0xc7e9eb=_0x8b81d6();while(!![]){try{const _0x3516dc=parseInt(_0x2e9183(0xff))/0x1*(parseInt(_0x2e9183(0x11f))/0x2)+parseInt(_0x2e9183(0x11b))/0x3+parseInt(_0x2e9183(0xa6))/0x4+parseInt(_0x2e9183(0xb5))/0x5+-parseInt(_0x2e9183(0x185))/0x6*(-parseInt(_0x2e9183(0x122))/0x7)+-parseInt(_0x2e9183(0x167))/0x8+-parseInt(_0x2e9183(0xbf))/0x9*(parseInt(_0x2e9183(0xfd))/0xa);if(_0x3516dc===_0x3a9a64)break;else _0xc7e9eb['push'](_0xc7e9eb['shift']());}catch(_0x270044){_0xc7e9eb['push'](_0xc7e9eb['shift']());}}}(a22_0x2c33,0x903ca));import a22_0x20b6d8 from'chalk';import a22_0x3e42a2 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';function a22_0x8975(_0x4959e2,_0x3a29b4){_0x4959e2=_0x4959e2-0x9a;const _0x2c3354=a22_0x2c33();let _0x897586=_0x2c3354[_0x4959e2];return _0x897586;}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(_0x3b2b02){const _0x1b7a9b=a22_0x8975;return!_0x3b2b02&&(console['error'](_0x1b7a9b(0xd2)),console[_0x1b7a9b(0xc5)](_0x1b7a9b(0x152))),!!_0x3b2b02;}function withJsonFormat(_0x202f6c){const _0x4ca7c2=a22_0x8975;if(!_0x202f6c['format']&&!_0x202f6c['json']&&!_0x202f6c[_0x4ca7c2(0x10e)]&&!_0x202f6c[_0x4ca7c2(0x140)])return{..._0x202f6c,'format':_0x4ca7c2(0x118),'json':!![]};return _0x202f6c;}function formatJourneyState(_0x1a7c31){const _0xd8e759=a22_0x8975;switch(_0x1a7c31){case _0xd8e759(0xe7):return a22_0x20b6d8['green'](_0xd8e759(0x188));case'draft':return a22_0x20b6d8[_0xd8e759(0xbe)](_0xd8e759(0x171));case _0xd8e759(0x153):return a22_0x20b6d8[_0xd8e759(0xe6)](_0xd8e759(0xe5));case _0xd8e759(0xd6):return a22_0x20b6d8['blue'](_0xd8e759(0xa5));case _0xd8e759(0x110):return a22_0x20b6d8[_0xd8e759(0xbe)](_0xd8e759(0x135));default:return'('+_0x1a7c31+')';}}function formatJourneyItem(_0x8ddc3,_0x5a52a2='',_0x3d49dc){const _0x4b75a7=a22_0x8975,_0x5ce7ed=formatJourneyState(_0x8ddc3[_0x4b75a7(0x149)]),_0x2c81d7=_0x3d49dc?hyperlink(_0x8ddc3[_0x4b75a7(0x1a3)],_0x3d49dc):_0x8ddc3[_0x4b75a7(0x1a3)];return _0x5a52a2+_0x4b75a7(0x15a)+_0x2c81d7+'\x20'+_0x5ce7ed;}function escapeRegex(_0x411290){const _0x2a9587=a22_0x8975;return _0x411290[_0x2a9587(0x17f)](/[.*+?^${}()|[\]\\]/g,_0x2a9587(0x189));}function globToRegex(_0x475d1e){const _0x4f7166=a22_0x8975,_0x15ea0b=_0x475d1e['split']('*')[_0x4f7166(0xe4)](escapeRegex);return new RegExp(_0x15ea0b[_0x4f7166(0x125)]('.*'),'i');}function buildRuleToNameMapping(_0x851ad5){const _0x4dd2b6=a22_0x8975,_0x25ac61=new Map();if(_0x851ad5[_0x4dd2b6(0x17c)])for(const [_0xa87a5e,_0x503527]of Object[_0x4dd2b6(0xbd)](_0x851ad5[_0x4dd2b6(0x17c)])){if(_0x503527[_0x4dd2b6(0x10c)]){const _0x25d0fe=serializeRule(_0x503527['rule']),_0x2fb339=_0x25ac61[_0x4dd2b6(0x126)](_0x25d0fe);_0x2fb339?_0x2fb339[_0x4dd2b6(0x151)](_0xa87a5e):_0x25ac61[_0x4dd2b6(0x130)](_0x25d0fe,[_0xa87a5e]);}}return _0x25ac61;}async function resolveJourneyIdFromInput(_0x2a63d4,_0x5395ee,_0x438615){const _0xc7bb0e=a22_0x8975,_0xfbe6f3=await resolveJourneyTarget(_0x2a63d4,_0x5395ee[_0xc7bb0e(0x144)],_0x5395ee['verbose']),_0x2cb864=_0xfbe6f3['parentSegment'];if(!_0x2cb864)throw new SDKError(ErrorCode[_0xc7bb0e(0xc9)],_0xc7bb0e(0xcc));const _0x489be7=await withSpinner(_0xc7bb0e(0xcf),()=>_0x438615['segment']['resolveParentId'](_0x2cb864),{'verbose':_0x5395ee[_0xc7bb0e(0x18f)]}),_0x206c73=_0x489be7['data'],_0x2675c3=await withSpinner(_0xc7bb0e(0xe9),()=>_0x438615[_0xc7bb0e(0x155)][_0xc7bb0e(0x14c)](_0x206c73,_0xfbe6f3[_0xc7bb0e(0xb4)]),{'verbose':_0x5395ee[_0xc7bb0e(0x18f)]});return{'journeyId':_0x2675c3[_0xc7bb0e(0xc6)],'journeyName':_0xfbe6f3[_0xc7bb0e(0xb4)],'parentSegmentId':_0x206c73};}async function resolveJourneyTarget(_0x42bdaf,_0x3dd11f,_0x5a6bdf){const _0x3978f3=a22_0x8975;if(isYamlFilePath(_0x42bdaf))try{const _0x395a10=await resolveYamlFilePath(_0x42bdaf);return _0x5a6bdf&&(console[_0x3978f3(0xc5)]('Resolved\x20YAML\x20file:\x20'+_0x42bdaf),console[_0x3978f3(0xc5)](_0x3978f3(0x169)+_0x395a10[_0x3978f3(0x144)]),console[_0x3978f3(0xc5)](_0x3978f3(0xb7)+_0x395a10['segmentName']),console[_0x3978f3(0xc5)]('\x20\x20Folder\x20path:\x20'+(_0x395a10[_0x3978f3(0xa8)]||_0x3978f3(0x18e)))),{'journeyName':_0x395a10['segmentName'],'parentSegment':_0x395a10['parentSegment'],'resolved':_0x395a10};}catch(_0x20655c){throw new SDKError(ErrorCode[_0x3978f3(0xc9)],_0x3978f3(0x1a0)+_0x20655c['message']);}if(!_0x3dd11f)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3978f3(0x15c));return{'journeyName':_0x42bdaf,'parentSegment':_0x3dd11f};}export class JourneyListCommand extends BaseCommand{['name']=a22_0x4786ae(0xbb);[a22_0x4786ae(0x160)]=a22_0x4786ae(0x12c);async[a22_0x4786ae(0xde)](_0x1152bc){const _0x36c250=a22_0x4786ae,{options:_0x3b55d3,args:_0x361cd8,tdx:_0x4b5444}=_0x1152bc,_0x37602a=_0x361cd8[0x0],_0x2a4c8e=_0x3b55d3[_0x36c250(0x144)];if(!_0x2a4c8e)return console[_0x36c250(0xc5)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x36c250(0xc5)](_0x36c250(0x16e)),0x1;const _0x5680ec=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x4b5444[_0x36c250(0x19a)]['resolveParentId'](_0x2a4c8e),{'verbose':_0x3b55d3['verbose']}),_0x26a68b=_0x5680ec[_0x36c250(0xc6)];_0x3b55d3[_0x36c250(0x18f)]&&(console['error'](_0x36c250(0x134)+_0x2a4c8e+_0x36c250(0xf7)+_0x26a68b+')'),_0x37602a&&console[_0x36c250(0xc5)](_0x36c250(0xda)+_0x37602a));const _0x28a11b=await withSpinner(_0x36c250(0x10d),()=>_0x4b5444[_0x36c250(0x19a)]['getParentFull'](_0x26a68b),{'verbose':_0x3b55d3[_0x36c250(0x18f)]}),_0x3d8578=_0x28a11b['data'],_0x25e836=_0x3d8578[_0x36c250(0x19d)],_0x45dc8b=await withSpinner('Listing\x20journeys...',()=>_0x4b5444[_0x36c250(0x155)]['listJourneysWithFolders'](_0x26a68b,_0x25e836),{'verbose':_0x3b55d3['verbose']});let _0x408304=_0x45dc8b[_0x36c250(0xc6)][_0x36c250(0x109)];const _0x3137bc=_0x45dc8b[_0x36c250(0xc6)][_0x36c250(0x181)],_0xbe9b1a=new Map();for(const _0x274014 of _0x3137bc){_0xbe9b1a['set'](_0x274014['id'],_0x274014[_0x36c250(0xba)]);}if(_0x37602a){const _0x1af4c4=globToRegex(_0x37602a);_0x408304=_0x408304['filter'](_0x3ec29d=>_0x1af4c4['test'](_0x3ec29d['journeyBundleName']));}console['error'](_0x36c250(0xd1)+_0x408304['length']+_0x36c250(0x120)+(_0x408304[_0x36c250(0x199)]!==0x1?'s':''));const _0x5a5258=_0x4172c7=>{const _0x45b61d=_0x36c250;return getConsoleNextUrl(_0x3b55d3[_0x45b61d(0xfa)],'/app/ps/'+_0x26a68b+_0x45b61d(0xea)+_0x4172c7+'/j/da');};if(_0x3b55d3[_0x36c250(0xef)]==='table')await handleSDKOutput(_0x408304,_0x3b55d3);else{if(_0x3b55d3[_0x36c250(0xef)]===_0x36c250(0x118)){const _0x437dc5=_0x408304[_0x36c250(0xe4)](_0x3c71a4=>({..._0x3c71a4,'url':_0x5a5258(_0x3c71a4['id'])}));await handleSDKOutput(_0x437dc5,_0x3b55d3);}else{console[_0x36c250(0x179)]('['+_0x2a4c8e+']');const _0x574650=new Map(),_0x2f2b38=[];for(const _0x5793d4 of _0x408304){if(!_0x5793d4[_0x36c250(0x19f)]||_0x5793d4[_0x36c250(0x19f)]===_0x25e836)_0x2f2b38[_0x36c250(0x151)](_0x5793d4);else{const _0x32ae72=_0x574650[_0x36c250(0x126)](_0x5793d4[_0x36c250(0x19f)])||[];_0x32ae72[_0x36c250(0x151)](_0x5793d4),_0x574650[_0x36c250(0x130)](_0x5793d4[_0x36c250(0x19f)],_0x32ae72);}}const _0x6160b1=(_0x24fdbd,_0x467a90)=>_0x24fdbd['journeyBundleName'][_0x36c250(0xb0)](_0x467a90['journeyBundleName'],undefined,{'sensitivity':'base'});_0x2f2b38[_0x36c250(0x108)](_0x6160b1);for(const _0x4618bb of _0x2f2b38){console[_0x36c250(0x179)](formatJourneyItem(_0x4618bb,'',_0x5a5258(_0x4618bb['id'])));}const _0x4e6d9d=[..._0x574650[_0x36c250(0xbd)]()][_0x36c250(0x108)]((_0x5dc89a,_0x457891)=>{const _0x41d0b6=_0x36c250,_0x4f57e0=_0xbe9b1a['get'](_0x5dc89a[0x0])||_0x5dc89a[0x0],_0x3263e6=_0xbe9b1a[_0x41d0b6(0x126)](_0x457891[0x0])||_0x457891[0x0];return _0x4f57e0['localeCompare'](_0x3263e6,undefined,{'sensitivity':_0x41d0b6(0x13c)});});for(const [_0x1f69b7,_0x766f85]of _0x4e6d9d){const _0x5d31a1=_0xbe9b1a[_0x36c250(0x126)](_0x1f69b7)||_0x1f69b7;console[_0x36c250(0x179)](_0x36c250(0x9c)+_0x5d31a1),_0x766f85['sort'](_0x6160b1);for(const _0x4eaf49 of _0x766f85){console[_0x36c250(0x179)](formatJourneyItem(_0x4eaf49,'\x20\x20',_0x5a5258(_0x4eaf49['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a22_0x4786ae(0x116);[a22_0x4786ae(0x160)]=a22_0x4786ae(0xb1);async['execute'](_0x1ace3d){const _0x227dee=a22_0x4786ae,{options:_0x563879,args:_0x12e4ba,tdx:_0x526fe9}=_0x1ace3d,_0x666258=_0x12e4ba[0x0];if(!_0x666258)return console[_0x227dee(0xc5)](_0x227dee(0xd2)),console[_0x227dee(0xc5)](_0x227dee(0x106)),console[_0x227dee(0xc5)]('Options:'),console[_0x227dee(0xc5)](_0x227dee(0x137)),0x1;_0x563879[_0x227dee(0x18f)]&&console['error'](_0x227dee(0x18d)+_0x666258);const {journeyId:_0x3d2db0,parentSegmentId:_0x5ae199}=await resolveJourneyIdFromInput(_0x666258,_0x563879,_0x526fe9);if(_0x563879[_0x227dee(0xcd)]){const _0x5e4e01=getConsoleNextUrl(_0x563879[_0x227dee(0xfa)],_0x227dee(0x175)+_0x5ae199+_0x227dee(0xea)+_0x3d2db0+_0x227dee(0x113));return console[_0x227dee(0xc5)](a22_0x20b6d8[_0x227dee(0xf8)]('✔')+_0x227dee(0x17b)+a22_0x20b6d8[_0x227dee(0xed)](_0x5e4e01)),openBrowser(_0x5e4e01),0x0;}const _0x1c426a=await withSpinner(_0x227dee(0x159),()=>_0x526fe9['journey'][_0x227dee(0x14e)](_0x3d2db0),{'verbose':_0x563879[_0x227dee(0x18f)]}),_0x52674a=_0x1c426a['data'],_0xc6d694=_0x563879[_0x227dee(0x197)];let _0x1ac0a0;if(_0xc6d694)try{const _0x1a8f65=await withSpinner(_0x227dee(0xcb),()=>_0x526fe9[_0x227dee(0x155)][_0x227dee(0x17a)](_0x3d2db0),{'verbose':_0x563879[_0x227dee(0x18f)]});_0x1ac0a0=_0x1a8f65[_0x227dee(0xc6)];}catch{_0x563879[_0x227dee(0x18f)]&&console['error'](_0x227dee(0x136));}const _0x54ea28=getConsoleNextUrl(_0x563879['site'],_0x227dee(0x175)+_0x5ae199+'/e/'+_0x3d2db0+'/j/da/je'),_0x312a30={'id':_0x52674a['id'],'name':_0x52674a[_0x227dee(0xfb)]['name'],'description':_0x52674a[_0x227dee(0xfb)][_0x227dee(0x160)],'state':_0x52674a[_0x227dee(0xfb)]['state'],'paused':_0x52674a[_0x227dee(0xfb)]['paused'],'reentry_mode':_0x52674a[_0x227dee(0xfb)][_0x227dee(0x10b)],'stages':_0x52674a[_0x227dee(0xfb)]['journeyStages']?.[_0x227dee(0x199)]||0x0,..._0x52674a[_0x227dee(0xfb)][_0x227dee(0x13e)]&&{'goal':_0x52674a[_0x227dee(0xfb)][_0x227dee(0x13e)][_0x227dee(0xba)]},..._0x1ac0a0&&{'statistics':{'size':_0x1ac0a0[_0x227dee(0x17d)],'entered':_0x1ac0a0[_0x227dee(0x187)],'goal_achieved':_0x1ac0a0[_0x227dee(0x191)],'completion_rate':_0x1ac0a0[_0x227dee(0xc3)],'exit_or_jump':_0x1ac0a0['exitOrJumpSize'],'exit_or_jump_rate':_0x1ac0a0[_0x227dee(0xd8)],'stages':_0x1ac0a0['stages']}},'url':_0x54ea28};return await handleSingleObjectOutput(_0x312a30,_0x563879),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xd0);[a22_0x4786ae(0x160)]=a22_0x4786ae(0x15b);async['execute'](_0x1c165d){const _0x1127d0=a22_0x4786ae,{options:_0x4eeb4a,args:_0x33066e,tdx:_0x4e0757}=_0x1c165d,_0xb8e7a6=_0x33066e[0x0];if(!requireNameOrPath(_0xb8e7a6))return 0x1;_0x4eeb4a[_0x1127d0(0x18f)]&&console['error'](_0x1127d0(0x18d)+_0xb8e7a6);const _0x15694c=_0x4eeb4a,_0x1c5206=_0x15694c['from'],_0x3b0716=_0x15694c['to'],_0x5da8ab=_0x15694c[_0x1127d0(0x19e)],_0x571aa3=_0x15694c['stage'];_0x5da8ab&&!_0x1c5206&&!_0x3b0716&&console[_0x1127d0(0xc5)](_0x1127d0(0x102));const _0x5a1f7a=_0x5da8ab?withJsonFormat(_0x4eeb4a):_0x4eeb4a,{journeyId:_0x3196a1,journeyName:_0x386f38}=await resolveJourneyIdFromInput(_0xb8e7a6,_0x5a1f7a,_0x4e0757),_0x5b9c49=_0x1c5206||_0x3b0716?{'from':_0x1c5206,'to':_0x3b0716}:undefined,_0x11c7a6=await withSpinner(_0x1127d0(0xcb),()=>Promise['all']([_0x4e0757['journey'][_0x1127d0(0x14e)](_0x3196a1),_0x4e0757['journey'][_0x1127d0(0x17a)](_0x3196a1,_0x5b9c49)]),{'verbose':_0x5a1f7a[_0x1127d0(0x18f)]}),[_0xafaaec,_0x48853c]=_0x11c7a6[_0x1127d0(0xc6)];if(!_0x48853c||_0x48853c[_0x1127d0(0xeb)]===null)return console[_0x1127d0(0xc5)](_0x1127d0(0x18c)+_0x386f38),console[_0x1127d0(0xc5)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x3b3718=buildStageNameMap(_0xafaaec),_0xf8bf1c=!!(_0x5b9c49&&_0x48853c[_0x1127d0(0x190)]?.[_0x1127d0(0x199)]),_0x5b8186={'stageNameMap':_0x3b3718,'hasPeriod':_0xf8bf1c,'includeHistory':!!_0x5da8ab};if(_0x571aa3&&_0x48853c[_0x1127d0(0x194)]){const _0x153534=_0x48853c[_0x1127d0(0x194)][_0x1127d0(0xdd)](_0x3d2664=>{const _0x3e2a87=_0x1127d0,_0x27cd62=_0x3b3718[_0x3e2a87(0x126)](_0x3d2664['id'])??'';return _0x27cd62[_0x3e2a87(0xa7)]()===_0x571aa3[_0x3e2a87(0xa7)]();});if(_0x153534)return await handleSingleObjectOutput(formatStageStats(_0x153534,_0x5b8186),_0x5a1f7a),0x0;const _0xb22c17=_0x48853c[_0x1127d0(0x194)][_0x1127d0(0xe4)](_0x42944e=>_0x3b3718[_0x1127d0(0x126)](_0x42944e['id'])??_0x42944e['id']);return console[_0x1127d0(0xc5)]('Error:\x20Stage\x20\x22'+_0x571aa3+_0x1127d0(0xc1)),console[_0x1127d0(0xc5)](_0x1127d0(0xf5)+_0xb22c17['join'](',\x20')),0x1;}const _0x1e2041=_0x48853c[_0x1127d0(0x194)]?.[_0x1127d0(0xe4)](_0x4415ea=>formatStageStats(_0x4415ea,_0x5b8186)),_0x5e4098=assembleJourneyStats(_0x48853c,{'from':_0x1c5206,'to':_0x3b0716,'includeHistory':_0x5da8ab});return await this[_0x1127d0(0xd7)](_0x5e4098,_0x1e2041??[],_0x5a1f7a),0x0;}async[a22_0x4786ae(0xd7)](_0x1399d6,_0x3c6eb6,_0x5acd1b){const _0x366b6a=a22_0x4786ae,_0x3f7af2=_0x5acd1b[_0x366b6a(0xef)]===_0x366b6a(0x118)||_0x5acd1b[_0x366b6a(0xef)]===_0x366b6a(0x10e)||_0x5acd1b['json']||_0x5acd1b[_0x366b6a(0x10e)];if(_0x3f7af2){_0x1399d6[_0x366b6a(0x194)]=_0x3c6eb6,await handleSingleObjectOutput(_0x1399d6,_0x5acd1b);return;}await handleSingleObjectOutput(_0x1399d6,_0x5acd1b);for(const _0x4de83f of _0x3c6eb6){console[_0x366b6a(0x179)](''),console['log'](String(a22_0x20b6d8[_0x366b6a(0xed)][_0x366b6a(0x121)]('['+_0x4de83f[_0x366b6a(0xba)]+']'))+a22_0x20b6d8[_0x366b6a(0xbe)]('\x20'+_0x4de83f['id']));const {id:_0x4150ca,name:_0x7d0c26,..._0x3e7d45}=_0x4de83f;await handleSingleObjectOutput(_0x3e7d45,_0x5acd1b);}}}export class JourneyTrafficCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xe3);['description']=a22_0x4786ae(0x178);async[a22_0x4786ae(0xde)](_0x594187){const _0x30bd12=a22_0x4786ae,{options:_0x5c4c2c,args:_0xcde669,tdx:_0x5cfcc0}=_0x594187,_0x49316d=_0xcde669[0x0];if(!requireNameOrPath(_0x49316d))return 0x1;_0x5c4c2c['verbose']&&console[_0x30bd12(0xc5)]('Input:\x20'+_0x49316d);const _0xbbcac0=_0x5c4c2c,_0x36ee74=_0xbbcac0[_0x30bd12(0xd9)],_0x5e3e07=_0xbbcac0[_0x30bd12(0x170)],_0x4b9465=_0xbbcac0['to'],_0x2d22bd=_0xbbcac0[_0x30bd12(0x119)];if(_0x36ee74&&_0x36ee74!==_0x30bd12(0x19b)&&_0x36ee74!=='activation')return console[_0x30bd12(0xc5)]('Error:\x20Invalid\x20--type\x20\x22'+_0x36ee74+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x5c10d5=withJsonFormat(_0x5c4c2c),{journeyId:_0x2d4785,journeyName:_0x2ea279}=await resolveJourneyIdFromInput(_0x49316d,_0x5c10d5,_0x5cfcc0),_0x295ea0={'type':_0x36ee74,'from':_0x5e3e07,'to':_0x4b9465,'limit':_0x2d22bd},_0x1d0e6c=await withSpinner(_0x30bd12(0xb3),()=>_0x5cfcc0[_0x30bd12(0x155)]['getTrafficData'](_0x2d4785,_0x295ea0),{'verbose':_0x5c10d5[_0x30bd12(0x18f)]}),_0x26a1ed=_0x1d0e6c[_0x30bd12(0xc6)],_0xdf58a5=_0x26a1ed[_0x30bd12(0x19b)]&&(_0x26a1ed[_0x30bd12(0x19b)][_0x30bd12(0x1a4)][_0x30bd12(0x199)]>0x0||_0x26a1ed[_0x30bd12(0x19b)]['links'][_0x30bd12(0x199)]>0x0),_0x1a4588=_0x26a1ed[_0x30bd12(0xe8)]&&_0x26a1ed['activation'][_0x30bd12(0x199)]>0x0;if(!_0xdf58a5&&!_0x1a4588)return console['error'](_0x30bd12(0x164)+_0x2ea279),console[_0x30bd12(0xc5)](_0x30bd12(0x1a1)),_0x5e3e07&&_0x4b9465&&console[_0x30bd12(0xc5)](_0x30bd12(0xec)),0x0;return await handleSingleObjectOutput(_0x26a1ed,_0x5c10d5),0x0;}}function formatStageStats(_0x2bc4b2,_0x4ac5d8){const _0x5c3cc4=a22_0x4786ae,_0x3fde78=_0x4ac5d8[_0x5c3cc4(0x146)]&&_0x2bc4b2[_0x5c3cc4(0x190)]?.[_0x5c3cc4(0x199)]?aggregateStageHistory(_0x2bc4b2['history']):{'size':_0x2bc4b2['size'],'entered':_0x2bc4b2[_0x5c3cc4(0x187)],'milestone':_0x2bc4b2[_0x5c3cc4(0xd3)],'milestone_rate':_0x2bc4b2[_0x5c3cc4(0x141)],'exit_or_jump':_0x2bc4b2['exitOrJumpSize'],'exit_or_jump_rate':_0x2bc4b2[_0x5c3cc4(0xd8)]},_0x3b60fc={'id':_0x2bc4b2['id'],'name':_0x4ac5d8[_0x5c3cc4(0x16c)]['get'](_0x2bc4b2['id'])??_0x2bc4b2['id'],..._0x3fde78};return _0x4ac5d8[_0x5c3cc4(0x146)]&&_0x4ac5d8[_0x5c3cc4(0x19e)]&&_0x2bc4b2['history']&&(_0x3b60fc[_0x5c3cc4(0x190)]=_0x2bc4b2[_0x5c3cc4(0x190)]),_0x3b60fc;}export class JourneyPauseCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xa2);[a22_0x4786ae(0x160)]='Pause\x20a\x20running\x20journey';async[a22_0x4786ae(0xde)](_0x4e0834){const _0x3c4f5b=a22_0x4786ae,{options:_0x42df77,args:_0x562544,tdx:_0x58b51c}=_0x4e0834,_0x8bc6e=_0x562544[0x0];if(!requireNameOrPath(_0x8bc6e))return 0x1;_0x42df77[_0x3c4f5b(0x18f)]&&console[_0x3c4f5b(0xc5)](_0x3c4f5b(0x18d)+_0x8bc6e);const {journeyId:_0x52be9f,journeyName:_0x204ca9}=await resolveJourneyIdFromInput(_0x8bc6e,_0x42df77,_0x58b51c);if(!_0x42df77[_0x3c4f5b(0x15f)]){const _0xf8f570=await confirm(_0x3c4f5b(0x158)+_0x204ca9+'\x22?');if(!_0xf8f570)return console[_0x3c4f5b(0xc5)](_0x3c4f5b(0x1a7)),0x0;}const _0x1a64ce=await withSpinner(_0x3c4f5b(0x14b),()=>_0x58b51c[_0x3c4f5b(0x155)][_0x3c4f5b(0xf2)](_0x52be9f),{'verbose':_0x42df77['verbose']}),_0x120408=_0x1a64ce[_0x3c4f5b(0xc6)];return console[_0x3c4f5b(0xc5)](_0x3c4f5b(0x16d)+_0x120408['attributes']['name']+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xfe);['description']='Resume\x20a\x20paused\x20journey';async['execute'](_0x2726c4){const _0x49c8e7=a22_0x4786ae,{options:_0xfd4d18,args:_0x297739,tdx:_0x4b7015}=_0x2726c4,_0x8eb5f5=_0x297739[0x0];if(!requireNameOrPath(_0x8eb5f5))return 0x1;_0xfd4d18[_0x49c8e7(0x18f)]&&console[_0x49c8e7(0xc5)](_0x49c8e7(0x18d)+_0x8eb5f5);const {journeyId:_0x5a4e4a,journeyName:_0x5836d3}=await resolveJourneyIdFromInput(_0x8eb5f5,_0xfd4d18,_0x4b7015);if(!_0xfd4d18[_0x49c8e7(0x15f)]){const _0x27c36c=await confirm(_0x49c8e7(0x147)+_0x5836d3+'\x22?');if(!_0x27c36c)return console['error'](_0x49c8e7(0x1a7)),0x0;}const _0x2d1c9e=await withSpinner(_0x49c8e7(0xd4),()=>_0x4b7015[_0x49c8e7(0x155)][_0x49c8e7(0x145)](_0x5a4e4a),{'verbose':_0xfd4d18['verbose']}),_0x1bb2aa=_0x2d1c9e[_0x49c8e7(0xc6)];return console[_0x49c8e7(0xc5)](_0x49c8e7(0x16d)+_0x1bb2aa[_0x49c8e7(0xfb)][_0x49c8e7(0xba)]+_0x49c8e7(0x142)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xdb);[a22_0x4786ae(0x160)]=a22_0x4786ae(0x107);async[a22_0x4786ae(0xde)](_0x4a25fa){const _0x1389e1=a22_0x4786ae,{options:_0x5da746,args:_0x5e1468,tdx:_0xaadfd}=_0x4a25fa,_0x3c8a43=_0x5da746,_0x524387=_0x5e1468[0x0],_0x3cdfe5=_0x524387&&isYamlFilePath(_0x524387),_0xebae26=await resolveTarget({'arg':_0x3cdfe5?_0x524387:undefined,'contextParent':_0x5da746[_0x1389e1(0x144)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xebae26))return _0xebae26[_0x1389e1(0x11a)]===_0x1389e1(0x174)?(console['error'](a22_0x20b6d8['yellow'](_0x1389e1(0x186))),console[_0x1389e1(0xc5)](_0x1389e1(0xad)),console[_0x1389e1(0xc5)](_0x1389e1(0x10f)),console[_0x1389e1(0xc5)](_0x1389e1(0x192)),console[_0x1389e1(0xc5)](_0x1389e1(0x105))):(console['error'](a22_0x20b6d8[_0x1389e1(0x14f)](_0x1389e1(0x16f)+_0xebae26[_0x1389e1(0x16b)]+'\x0a')),_0xebae26[_0x1389e1(0x13f)]&&console['error'](a22_0x20b6d8[_0x1389e1(0xed)](_0xebae26[_0x1389e1(0x13f)]))),0x1;let _0x406dd5=_0x3cdfe5?undefined:_0x524387,_0x15f6e6,_0x4a485e;_0xebae26['type']===_0x1389e1(0xb9)&&(_0x406dd5=_0xebae26['resourceName'],_0x15f6e6=_0xebae26[_0x1389e1(0x172)],_0x4a485e=_0xebae26[_0x1389e1(0xa8)]);const _0x51ac70=_0xebae26[_0x1389e1(0xdf)],_0xb172e2=_0xebae26[_0x1389e1(0x123)];_0x3c8a43[_0x1389e1(0x18f)]&&(console['error'](_0x1389e1(0x134)+_0x51ac70),console[_0x1389e1(0xc5)](_0x1389e1(0x13b)+_0xb172e2),_0x406dd5&&console[_0x1389e1(0xc5)](_0x1389e1(0x133)+_0x406dd5),_0x15f6e6&&console[_0x1389e1(0xc5)]('Target\x20file:\x20'+_0x15f6e6),_0x4a485e&&console[_0x1389e1(0xc5)](_0x1389e1(0xae)+_0x4a485e));const _0x4818e7=await withSpinner(_0x1389e1(0xcf),()=>_0xaadfd[_0x1389e1(0x19a)][_0x1389e1(0x124)](_0x51ac70),{'verbose':_0x5da746[_0x1389e1(0x18f)]}),_0x554f2a=_0x4818e7['data'],{journeys:_0x4db046,folders:_0x388b09}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x1cf84a=_0x1389e1,[_0x101131,_0x492077]=await Promise[_0x1cf84a(0xce)]([_0xaadfd['journey'][_0x1cf84a(0x1a6)](_0x554f2a,undefined,{'includeAllVersions':!![]}),_0xaadfd['segment'][_0x1cf84a(0x19c)](_0x554f2a)]);return{'journeys':_0x101131,'folders':_0x492077};},{'verbose':_0x5da746[_0x1389e1(0x18f)]})[_0x1389e1(0x16a)](_0xd82ebc=>_0xd82ebc[_0x1389e1(0xc6)]);let _0x20c4a7=_0x4db046;const _0xfcd9a7=buildFolderIdToPathMap(_0x388b09);if(_0x406dd5){const _0x6d8224=_0x20c4a7['filter'](_0x37d93e=>_0x37d93e[_0x1389e1(0x1a3)]['toLowerCase']()===_0x406dd5[_0x1389e1(0xa7)]());if(_0x6d8224[_0x1389e1(0x199)]===0x0)return console[_0x1389e1(0xc5)]('Error:\x20Journey\x20not\x20found:\x20'+_0x406dd5),console[_0x1389e1(0xc5)](_0x1389e1(0x196)),0x1;_0x20c4a7=_0x6d8224;}if(_0x4a485e!==undefined){const _0x3ef025=_0x20c4a7[_0x1389e1(0x127)](_0x150f5a=>{const _0x23a2aa=_0x1389e1,_0x29c5ad=_0x150f5a[_0x23a2aa(0x19f)]?_0xfcd9a7['get'](_0x150f5a['folderId'])||'':'';return _0x29c5ad===_0x4a485e;});if(_0x3ef025[_0x1389e1(0x199)]===0x0&&_0x20c4a7[_0x1389e1(0x199)]>0x0){console[_0x1389e1(0xc5)](_0x1389e1(0x132)+_0x406dd5+_0x1389e1(0xdc)+(_0x4a485e||'root\x20folder')),console['error'](_0x1389e1(0xb6));for(const _0x48d8e3 of _0x20c4a7){const _0x289fbe=_0x48d8e3[_0x1389e1(0x19f)]?_0xfcd9a7[_0x1389e1(0x126)](_0x48d8e3[_0x1389e1(0x19f)])||'':'';console[_0x1389e1(0xc5)](_0x1389e1(0x129)+(_0x289fbe||'(root)')+'/'+_0x48d8e3[_0x1389e1(0x1a3)]);}return 0x1;}_0x20c4a7=_0x3ef025;}if(_0x20c4a7[_0x1389e1(0x199)]===0x0)return console[_0x1389e1(0xc5)](_0x1389e1(0xbc)),0x0;const _0x264b2a=new Map();for(const _0x3ee755 of _0x20c4a7){const _0x159538=_0x3ee755['journeyBundleId'];!_0x264b2a['has'](_0x159538)&&_0x264b2a['set'](_0x159538,[]),_0x264b2a['get'](_0x159538)['push'](_0x3ee755);}for(const _0x3391e6 of _0x264b2a['values']()){_0x3391e6[_0x1389e1(0x108)]((_0x2100a2,_0x3f75f3)=>(_0x2100a2[_0x1389e1(0xf0)]||0x0)-(_0x3f75f3[_0x1389e1(0xf0)]||0x0));}const _0x540430=[],{idToEmailMap:_0x347004,connectionIdToNameMap:_0x54bbfa}=await withSpinner(_0x1389e1(0xe1),async()=>{const _0x55dda4=_0x1389e1,[_0x30a3c2,_0x33c930]=await Promise[_0x55dda4(0xce)]([_0xaadfd['user'][_0x55dda4(0x161)](),_0xaadfd['connection'][_0x55dda4(0x1a5)]()]);return{'idToEmailMap':_0x30a3c2,'connectionIdToNameMap':_0x33c930};},{'verbose':_0x5da746['verbose']})[_0x1389e1(0x16a)](_0x4abced=>_0x4abced['data']);for(const _0x487b0f of _0x264b2a[_0x1389e1(0x12f)]()){const _0x38978b=_0x487b0f[0x0]['journeyBundleName'],_0xdaa243=_0x487b0f[0x0][_0x1389e1(0x19f)],_0x222643=_0xdaa243?_0xfcd9a7[_0x1389e1(0x126)](_0xdaa243)||'':'',_0x4e4361=_0x222643?a22_0x3e42a2[_0x1389e1(0x125)](_0xb172e2,_0x222643):_0xb172e2,_0x26cbdc=_0x15f6e6||a22_0x3e42a2['join'](_0x4e4361,sanitizeFileName(_0x38978b)+_0x1389e1(0x176));let _0x1a204d,_0x15a673;if(existsSync(_0x26cbdc))try{const _0x5db7ee=readFileSync(_0x26cbdc,'utf-8'),_0x318278=parseYamlString(_0x5db7ee);_0x15a673=_0x318278,_0x1a204d=buildRuleToNameMapping(_0x318278),_0x3c8a43[_0x1389e1(0x18f)]&&_0x1a204d[_0x1389e1(0x17d)]>0x0&&console[_0x1389e1(0xc5)](_0x1389e1(0x117)+_0x1a204d[_0x1389e1(0x17d)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x38978b);}catch(_0x424e89){_0x3c8a43[_0x1389e1(0x18f)]&&console[_0x1389e1(0xc5)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x424e89[_0x1389e1(0x16b)]);}const _0x2042ac=[],_0xa3dd18=new Set(),_0x4111f6=new Map(),_0x1dc771=new Map(),_0x347137=new Set(),_0x42c865=new Map(),_0xa0a4=new Map(),_0x3a1bc4=createJumpTargetCache();await withProgressSpinner(_0x1389e1(0x13a)+_0x38978b+'...',async _0x716a43=>{const _0x2b2edb=_0x1389e1;for(const _0x3db2f1 of _0x487b0f){const _0x542568=_0x487b0f[_0x2b2edb(0x199)]>0x1?_0x3db2f1['journeyBundleName']+'\x20v'+(_0x3db2f1[_0x2b2edb(0xf0)]||0x1):_0x3db2f1[_0x2b2edb(0x1a3)];_0x716a43[_0x2b2edb(0x12d)](_0x2b2edb(0x13a)+_0x542568);const _0x2450d5=await _0xaadfd['journey']['getJourney'](_0x3db2f1['id']),_0x5a7142=_0x2450d5['attributes']?.[_0x2b2edb(0xf3)],_0x595080={'resolveSegment':async _0x33bd32=>{const _0x1de857=_0x2b2edb;if(!_0x5a7142)return{'name':_0x33bd32,'isJourneyLocal':![]};const _0x2382e0=_0x4111f6['get'](_0x33bd32);if(_0x2382e0)return _0x2382e0;try{const _0x29b089=await _0xaadfd[_0x1de857(0x19a)]['getSegment'](_0x5a7142,_0x33bd32),_0x2ffad4=_0x29b089['kind']===SEGMENT_KIND_JOURNEY;let _0x56bdb5,_0x4be0ad=_0x29b089[_0x1de857(0xba)];if(_0x2ffad4&&_0x29b089[_0x1de857(0x10c)]){const _0x1ef1ff=await segmentResponseToDef(_0x29b089,{'resolveSegmentName':async _0x513909=>{const _0x71d45f=_0x1de857,_0x2f76a1=_0x4111f6[_0x71d45f(0x126)](_0x513909);if(_0x2f76a1)return _0x2f76a1[_0x71d45f(0xba)];const _0x2e07ff=await _0x595080[_0x71d45f(0x9e)](_0x513909);return _0x2e07ff[_0x71d45f(0xba)];}}),_0x1cae20=_0x1ef1ff[_0x1de857(0x10c)];_0x56bdb5={'description':_0x29b089[_0x1de857(0x160)],'rule':_0x1cae20};const _0x5f402a=serializeRule(_0x1cae20),_0x2c8832=_0x1dc771['get'](_0x5f402a);if(_0x2c8832)_0x4be0ad=_0x2c8832,_0x56bdb5=undefined,_0x3c8a43[_0x1de857(0x18f)]&&console[_0x1de857(0xc5)](_0x1de857(0x11c)+_0x29b089['name']+_0x1de857(0x14d)+_0x2c8832);else{let _0x5105c9=![];if(_0x1a204d){const _0x132074=_0x1a204d[_0x1de857(0x126)](_0x5f402a);if(_0x132074){const _0x5bffb8=_0x132074[_0x1de857(0xdd)](_0x50f6bb=>!_0xa3dd18[_0x1de857(0x9d)](_0x50f6bb));_0x5bffb8&&(_0x4be0ad=_0x5bffb8,_0xa3dd18[_0x1de857(0x12a)](_0x5bffb8),_0x1dc771[_0x1de857(0x130)](_0x5f402a,_0x5bffb8),_0x5105c9=!![],_0x3c8a43[_0x1de857(0x18f)]&&console['error'](_0x1de857(0xab)+_0x5bffb8+_0x1de857(0xf6)));}}if(!_0x5105c9){const _0x31cccc=generateJourneyLocalName(_0x29b089[_0x1de857(0xba)]);_0x31cccc&&(_0x4be0ad=_0x31cccc);let _0x325cd4=_0x4be0ad,_0x480ab7=0x2;while(_0xa3dd18['has'](_0x325cd4)){_0x325cd4=_0x4be0ad+'_'+_0x480ab7,_0x480ab7++;}_0xa3dd18[_0x1de857(0x12a)](_0x325cd4),_0x1dc771[_0x1de857(0x130)](_0x5f402a,_0x325cd4),_0x4be0ad=_0x325cd4;}}}const _0x384112={'name':_0x4be0ad,'isJourneyLocal':_0x2ffad4,'definition':_0x56bdb5};return _0x4111f6[_0x1de857(0x130)](_0x33bd32,_0x384112),_0x384112;}catch(_0x4e123f){return _0x5da746[_0x1de857(0x18f)]&&console[_0x1de857(0xc5)](_0x1de857(0xb8)+_0x33bd32+':\x20'+_0x4e123f[_0x1de857(0x16b)]),{'name':_0x33bd32,'isJourneyLocal':![]};}},'resolveActivation':async _0x15807e=>{const _0x31654e=_0x2b2edb,_0x111792=_0x42c865[_0x31654e(0x126)](_0x15807e);if(_0x111792)return _0x111792;try{const _0x32920a=await _0xaadfd[_0x31654e(0x155)][_0x31654e(0x18b)](_0x3db2f1['id'],_0x15807e),_0x5ef4f3=journeyActivationStepToYaml(_0x32920a,_0x347004,_0x54bbfa),_0xbc2597=JSON['stringify']({'name':_0x5ef4f3[_0x31654e(0xba)],'connection':_0x5ef4f3[_0x31654e(0x157)],'connector_config':_0x5ef4f3[_0x31654e(0x177)]}),_0x1227d7=_0xa0a4['get'](_0xbc2597);if(_0x1227d7){const _0x1c50ce={'name':_0x1227d7,'isJourneyLocal':!![],'definition':_0x5ef4f3};return _0x42c865[_0x31654e(0x130)](_0x15807e,_0x1c50ce),_0x1c50ce;}const _0x105b25=_0x32920a['attributes'][_0x31654e(0x114)][_0x31654e(0xba)]||_0x15807e,_0x40d9ca=sanitizeYamlKey(_0x105b25)||'activation_'+_0x15807e;let _0x2ceeda=_0x40d9ca,_0xb18091=0x2;while(_0x347137[_0x31654e(0x9d)](_0x2ceeda)){_0x2ceeda=_0x40d9ca+'_'+_0xb18091,_0xb18091++;}_0x347137['add'](_0x2ceeda),_0xa0a4[_0x31654e(0x130)](_0xbc2597,_0x2ceeda);const _0x4eca8b={'name':_0x2ceeda,'isJourneyLocal':!![],'definition':_0x5ef4f3};return _0x42c865['set'](_0x15807e,_0x4eca8b),_0x4eca8b;}catch(_0x13fe0d){return _0x5da746[_0x31654e(0x18f)]&&console[_0x31654e(0xc5)](_0x31654e(0x162)+_0x15807e+':\x20'+_0x13fe0d[_0x31654e(0x16b)]),{'name':_0x15807e,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x55fc99,_0x1d6132)=>{const _0x1c9e68=_0x2b2edb;return resolveJumpTarget(_0x55fc99,_0x1d6132,_0x3a1bc4,_0xd797d=>_0xaadfd[_0x1c9e68(0x155)]['getJourney'](_0xd797d));}},_0x1b0a8d=await journeyResponseToDef(_0x2450d5,_0x595080);_0x2042ac[_0x2b2edb(0x151)]({'item':_0x3db2f1,'yaml':_0x1b0a8d});}},{'verbose':_0x5da746[_0x1389e1(0x18f)]});const _0x325258=buildMergedJourneyDef(_0x2042ac,_0x1a204d),_0x38de36=normalizeJourneyDef(_0x325258,_0x15a673),_0x45f210=toYamlString(_0x38de36),_0x11309c=_0x15f6e6||a22_0x3e42a2[_0x1389e1(0x125)](_0x4e4361,sanitizeFileName(_0x38978b)+_0x1389e1(0x176));!_0x15f6e6&&_0x222643&&!existsSync(_0x4e4361)&&mkdirSync(_0x4e4361,{'recursive':!![]});const _0x19cdfb=a22_0x3e42a2[_0x1389e1(0x9a)](process[_0x1389e1(0x173)](),_0x11309c);if(existsSync(_0x11309c)){const _0x3e81ef=readFileSync(_0x11309c,_0x1389e1(0x139)),_0x2647b6=generateDiff(_0x3e81ef,_0x45f210),_0x3a746d=hasChanges(_0x2647b6);_0x540430[_0x1389e1(0x151)]({'relativePath':_0x19cdfb,'absolutePath':_0x11309c,'content':_0x45f210,'isNew':![],'hasChanges':_0x3a746d,'diff':_0x3a746d?formatDiffWithColors(_0x2647b6):undefined});}else _0x540430[_0x1389e1(0x151)]({'relativePath':_0x19cdfb,'absolutePath':_0x11309c,'content':_0x45f210,'isNew':!![],'hasChanges':![]});}const _0x82a672=_0x540430[_0x1389e1(0x127)](_0x1de043=>_0x1de043[_0x1389e1(0x128)]),_0x1e5902=_0x540430[_0x1389e1(0x127)](_0x402808=>!_0x402808['isNew']&&_0x402808[_0x1389e1(0xe2)]),_0x2263ec=_0x540430[_0x1389e1(0x127)](_0x3bed51=>!_0x3bed51[_0x1389e1(0x128)]&&!_0x3bed51[_0x1389e1(0xe2)]),_0x5a83b8=_0x20c4a7[_0x1389e1(0x199)],_0x51384e=_0x264b2a[_0x1389e1(0x17d)],_0x3deacd=_0x5a83b8>_0x51384e?'\x20('+_0x5a83b8+_0x1389e1(0xc0):'';console[_0x1389e1(0xc5)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a22_0x20b6d8[_0x1389e1(0xed)](_0x51384e+_0x1389e1(0x9f))+a22_0x20b6d8[_0x1389e1(0xbe)](_0x3deacd)),console[_0x1389e1(0xc5)]('\x20\x20'+a22_0x20b6d8[_0x1389e1(0xf8)]('+\x20'+_0x82a672[_0x1389e1(0x199)]+_0x1389e1(0xe0))),console[_0x1389e1(0xc5)]('\x20\x20'+a22_0x20b6d8[_0x1389e1(0xe6)]('~\x20'+_0x1e5902['length']+_0x1389e1(0xf4))),console[_0x1389e1(0xc5)]('\x20\x20'+a22_0x20b6d8[_0x1389e1(0xbe)]('=\x20'+_0x2263ec[_0x1389e1(0x199)]+_0x1389e1(0x168))),console[_0x1389e1(0xc5)](_0x1389e1(0x100)+a22_0x20b6d8[_0x1389e1(0xed)](_0xb172e2)+'\x0a');if(_0x1e5902[_0x1389e1(0x199)]>0x0)for(const _0x3af099 of _0x1e5902){console[_0x1389e1(0xc5)]('\x0aChanges\x20to\x20\x27'+_0x3af099[_0x1389e1(0xb2)]+'\x27:'),console[_0x1389e1(0xc5)]('─'[_0x1389e1(0xc7)](0x3c)),console[_0x1389e1(0xc5)](_0x3af099[_0x1389e1(0x195)]),console[_0x1389e1(0xc5)]('─'[_0x1389e1(0xc7)](0x3c));}if(_0x3c8a43[_0x1389e1(0xca)])return console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0xe6)](_0x1389e1(0x165))),0x0;if(_0x82a672[_0x1389e1(0x199)]===0x0&&_0x1e5902[_0x1389e1(0x199)]===0x0)return console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0xf8)](_0x1389e1(0xa0))),saveSessionContext({'parent_segment':_0x51ac70},_0x3c8a43[_0x1389e1(0xc4)]),console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0xf8)](_0x1389e1(0x183)+a22_0x20b6d8[_0x1389e1(0xbe)](_0x1389e1(0x166))+'\x20=\x20'+a22_0x20b6d8[_0x1389e1(0xed)](_0x51ac70))),0x0;if(!_0x3c8a43[_0x1389e1(0x15f)]&&(_0x82a672[_0x1389e1(0x199)]>0x0||_0x1e5902[_0x1389e1(0x199)]>0x0)){if(!isInteractive())return console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0x14f)](_0x1389e1(0x156)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1389e1(0xc5)](a22_0x20b6d8['dim'](_0x1389e1(0x103))),0x1;const _0x2b3b86=await confirmKey(_0x1389e1(0x17e)+(_0x82a672[_0x1389e1(0x199)]+_0x1e5902['length'])+'\x20files?');if(!_0x2b3b86)return console[_0x1389e1(0xc5)](a22_0x20b6d8['yellow']('Aborted.'),_0x1389e1(0x13d)),0x1;}!existsSync(_0xb172e2)&&mkdirSync(_0xb172e2,{'recursive':!![]});const _0x263123=a22_0x3e42a2[_0x1389e1(0x125)](_0xb172e2,_0x1389e1(0x18a));writeFileSync(_0x263123,createTdxConfigContent(_0x51ac70),_0x1389e1(0x139));for(const _0x470ebe of _0x540430){(_0x470ebe[_0x1389e1(0x128)]||_0x470ebe['hasChanges'])&&writeFileSync(_0x470ebe[_0x1389e1(0x143)],_0x470ebe[_0x1389e1(0x193)],_0x1389e1(0x139));}return console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0xf8)]('✔\x20Pulled\x20'+(_0x82a672[_0x1389e1(0x199)]+_0x1e5902[_0x1389e1(0x199)])+_0x1389e1(0x11e)+_0xb172e2)),saveSessionContext({'parent_segment':_0x51ac70},_0x3c8a43[_0x1389e1(0xc4)]),console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0xf8)]('✔\x20Context\x20set:\x20'+a22_0x20b6d8['dim'](_0x1389e1(0x166))+_0x1389e1(0xa4)+a22_0x20b6d8[_0x1389e1(0xed)](_0x51ac70))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a22_0x4786ae(0xba)]='journey:columns';[a22_0x4786ae(0x160)]=a22_0x4786ae(0x115);async[a22_0x4786ae(0xde)](_0x16713e){const _0xedaec2=a22_0x4786ae,{options:_0x106c7c,args:_0x379988,tdx:_0x14a06a}=_0x16713e,_0x46c469=_0x379988[0x0];if(!requireNameOrPath(_0x46c469))return 0x1;_0x106c7c[_0xedaec2(0x18f)]&&console[_0xedaec2(0xc5)]('Input:\x20'+_0x46c469);const {journeyId:_0x59fb44}=await resolveJourneyIdFromInput(_0x46c469,_0x106c7c,_0x14a06a),_0x40d19a=await withSpinner(_0xedaec2(0x1a2),()=>_0x14a06a[_0xedaec2(0x155)][_0xedaec2(0x15e)](_0x59fb44),{'verbose':_0x106c7c[_0xedaec2(0x18f)]}),_0x3bf0e3=_0x40d19a[_0xedaec2(0xc6)];return console['log']('Database:\x20'+_0x3bf0e3[_0xedaec2(0x184)]),console[_0xedaec2(0x179)](_0xedaec2(0x104)+_0x3bf0e3[_0xedaec2(0xf9)]),await handleSDKOutput(_0x3bf0e3[_0xedaec2(0xaf)],_0x106c7c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xc8);[a22_0x4786ae(0x160)]=a22_0x4786ae(0xfc);async[a22_0x4786ae(0xde)](_0x487d43){const _0x5be2fa=a22_0x4786ae,{options:_0x17d05f,args:_0x25ceed,tdx:_0x25b2c}=_0x487d43,_0x1d0da9=_0x25ceed[0x0];if(!requireNameOrPath(_0x1d0da9))return 0x1;_0x17d05f[_0x5be2fa(0x18f)]&&console[_0x5be2fa(0xc5)](_0x5be2fa(0x18d)+_0x1d0da9);const {journeyId:_0xa72496}=await resolveJourneyIdFromInput(_0x1d0da9,_0x17d05f,_0x25b2c),_0x37c749=await withSpinner(_0x5be2fa(0x180),()=>_0x25b2c[_0x5be2fa(0x155)][_0x5be2fa(0x163)](_0xa72496),{'verbose':_0x17d05f[_0x5be2fa(0x18f)]}),_0x1c9f41=_0x37c749['data'];return console[_0x5be2fa(0xc5)]('Found\x20'+_0x1c9f41[_0x5be2fa(0x199)]+_0x5be2fa(0xa1)+(_0x1c9f41[_0x5be2fa(0x199)]!==0x1?'s':'')),await handleSDKOutput(_0x1c9f41,_0x17d05f),0x0;}}export class JourneyPushCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0x138);['description']=a22_0x4786ae(0x101);[a22_0x4786ae(0x111)]=new SegmentPushCommand();async[a22_0x4786ae(0xde)](_0x3970dc){const _0x5347e0=a22_0x4786ae,_0x279ba3=_0x3970dc['args'][0x0];let _0x122109;if(_0x279ba3){const _0xd26f1b=await resolveTarget({'arg':_0x279ba3,'contextParent':_0x3970dc[_0x5347e0(0x198)][_0x5347e0(0x144)],'cwd':process[_0x5347e0(0x173)]()});isSuccessfulResolution(_0xd26f1b)&&_0xd26f1b[_0x5347e0(0xd9)]==='file'&&(_0x122109=_0xd26f1b[_0x5347e0(0x172)]);}const _0x23882b={..._0x3970dc,'options':{..._0x3970dc[_0x5347e0(0x198)],'journeysOnly':!![],..._0x122109&&{'singleFilePath':_0x122109}}};return this[_0x5347e0(0x111)][_0x5347e0(0xde)](_0x23882b);}}export class JourneyVersionsCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0x9b);[a22_0x4786ae(0x160)]='List\x20all\x20versions\x20of\x20a\x20journey';async['execute'](_0x2b1aed){const _0x5b5adf=a22_0x4786ae,{options:_0x90e239,args:_0x33edc0,tdx:_0x52d098}=_0x2b1aed,_0xc882c7=_0x33edc0[0x0];if(!requireNameOrPath(_0xc882c7))return 0x1;if(_0x90e239[_0x5b5adf(0x18f)])console[_0x5b5adf(0xc5)](_0x5b5adf(0x18d)+_0xc882c7);const {journeyId:_0x761dce}=await resolveJourneyIdFromInput(_0xc882c7,_0x90e239,_0x52d098),_0x3c982d=await withSpinner(_0x5b5adf(0xee),()=>_0x52d098[_0x5b5adf(0x155)][_0x5b5adf(0x14a)](_0x761dce),{'verbose':_0x90e239[_0x5b5adf(0x18f)]}),{bundleName:_0x5465ff,versions:_0x1b86fd,latestJourneyId:_0x3189f3}=_0x3c982d[_0x5b5adf(0xc6)];console[_0x5b5adf(0xc5)](_0x5465ff+':\x20'+_0x1b86fd[_0x5b5adf(0x199)]+'\x20version'+(_0x1b86fd[_0x5b5adf(0x199)]!==0x1?'s':''));const _0x36cf6e=_0x1b86fd[_0x5b5adf(0xe4)](_0x10be6f=>({'version':_0x10be6f[_0x5b5adf(0xf0)],'journey_id':_0x10be6f[_0x5b5adf(0xeb)],'name':_0x10be6f[_0x5b5adf(0xba)],'state':_0x10be6f[_0x5b5adf(0x149)],'paused':_0x10be6f[_0x5b5adf(0x153)],'latest':_0x10be6f['journeyId']===_0x3189f3,'created_at':_0x10be6f[_0x5b5adf(0x182)]}));return await handleSDKOutput(_0x36cf6e,_0x90e239),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xc2);[a22_0x4786ae(0x160)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a22_0x4786ae(0xde)](_0x4fd621){const _0x117959=a22_0x4786ae,{options:_0x3b4e8b,args:_0x15cef7,tdx:_0x310eaf}=_0x4fd621,_0x4b643a=_0x15cef7[0x0];if(!requireNameOrPath(_0x4b643a))return 0x1;if(_0x3b4e8b['verbose'])console[_0x117959(0xc5)](_0x117959(0x18d)+_0x4b643a);const {journeyId:_0x4be139,journeyName:_0x1942f4}=await resolveJourneyIdFromInput(_0x4b643a,_0x3b4e8b,_0x310eaf);if(!_0x3b4e8b['yes']){const _0x25cce8=await confirm(_0x117959(0xa9)+_0x1942f4+'\x22?');if(!_0x25cce8)return console['error']('Cancelled'),0x0;}const _0x35924b=await withSpinner('Creating\x20new\x20version...',()=>_0x310eaf[_0x117959(0x155)][_0x117959(0x11d)](_0x4be139),{'verbose':_0x3b4e8b[_0x117959(0x18f)]}),_0x5d114b=_0x35924b['data'];return console[_0x117959(0xc5)](a22_0x20b6d8[_0x117959(0xf8)]('✔')+_0x117959(0xa3)+_0x5d114b[_0x117959(0xfb)][_0x117959(0xf0)]+_0x117959(0x154)+_0x5d114b[_0x117959(0xfb)]['name']+'\x22'),console[_0x117959(0xc5)](_0x117959(0xac)+_0x5d114b['id']),await handleSingleObjectOutput({'id':_0x5d114b['id'],'name':_0x5d114b[_0x117959(0xfb)][_0x117959(0xba)],'version':_0x5d114b[_0x117959(0xfb)][_0x117959(0xf0)],'state':_0x5d114b['attributes'][_0x117959(0x149)],'bundle_id':_0x5d114b[_0x117959(0xfb)][_0x117959(0x15d)],'created_at':_0x5d114b['attributes'][_0x117959(0x182)]},_0x3b4e8b),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a22_0x4786ae(0x112);[a22_0x4786ae(0x160)]=a22_0x4786ae(0x150);async['execute'](_0x2c016a){const _0x14b471=a22_0x4786ae,{options:_0x1cc884,args:_0xa7c57b,tdx:_0x26b224}=_0x2c016a,_0x1d1f40=_0xa7c57b[0x0];if(!requireNameOrPath(_0x1d1f40))return 0x1;const _0x1fb923=_0x1cc884[_0x14b471(0x148)];if(!_0x1fb923)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x14b471(0xc5)](_0x14b471(0xf1)),0x1;const _0x5efe1a=parseInt(_0x1fb923,0xa);if(isNaN(_0x5efe1a)||_0x5efe1a<0x1)return console[_0x14b471(0xc5)](_0x14b471(0x12e)+_0x1fb923),0x1;if(_0x1cc884[_0x14b471(0x18f)])console['error'](_0x14b471(0x18d)+_0x1d1f40+_0x14b471(0xaa)+_0x5efe1a);const {journeyId:_0x14adce,parentSegmentId:_0x282db5}=await resolveJourneyIdFromInput(_0x1d1f40,_0x1cc884,_0x26b224),_0xccb8e1=await withSpinner(_0x14b471(0x131),()=>_0x26b224['journey']['listVersions'](_0x14adce),{'verbose':_0x1cc884['verbose']}),{versions:_0x121c79,latestJourneyId:_0x194ed2}=_0xccb8e1[_0x14b471(0xc6)],_0x293246=_0x121c79[_0x14b471(0xdd)](_0x4ea8fa=>_0x4ea8fa[_0x14b471(0xf0)]===_0x5efe1a);if(!_0x293246){const _0x2ae51f=_0x121c79[_0x14b471(0xe4)](_0xb6582c=>'v'+_0xb6582c[_0x14b471(0xf0)])[_0x14b471(0x125)](',\x20');return console[_0x14b471(0xc5)](_0x14b471(0x10a)+_0x5efe1a+'\x20not\x20found.\x20Available:\x20'+_0x2ae51f),0x1;}const _0x25753f=await withSpinner('Getting\x20version\x20'+_0x5efe1a+_0x14b471(0xd5),()=>_0x26b224[_0x14b471(0x155)][_0x14b471(0x14e)](_0x293246['journeyId']),{'verbose':_0x1cc884[_0x14b471(0x18f)]}),_0x335d00=_0x25753f[_0x14b471(0xc6)],_0x3a7858=getConsoleNextUrl(_0x1cc884[_0x14b471(0xfa)],_0x14b471(0x175)+_0x282db5+_0x14b471(0xea)+_0x293246[_0x14b471(0xeb)]+_0x14b471(0x113));return await handleSingleObjectOutput({'id':_0x335d00['id'],'name':_0x335d00[_0x14b471(0xfb)]['name'],'version':_0x335d00[_0x14b471(0xfb)][_0x14b471(0xf0)],'description':_0x335d00['attributes'][_0x14b471(0x160)],'state':_0x335d00[_0x14b471(0xfb)][_0x14b471(0x149)],'paused':_0x335d00[_0x14b471(0xfb)][_0x14b471(0x153)],'reentry_mode':_0x335d00[_0x14b471(0xfb)][_0x14b471(0x10b)],'stages':_0x335d00['attributes'][_0x14b471(0x12b)]?.[_0x14b471(0x199)]||0x0,..._0x335d00[_0x14b471(0xfb)][_0x14b471(0x13e)]&&{'goal':_0x335d00[_0x14b471(0xfb)]['goal'][_0x14b471(0xba)]},'latest':_0x293246[_0x14b471(0xeb)]===_0x194ed2,'created_at':_0x335d00[_0x14b471(0xfb)][_0x14b471(0x182)],'updated_at':_0x335d00[_0x14b471(0xfb)]['updatedAt'],'url':_0x3a7858},_0x1cc884),0x0;}}function a22_0x2c33(){const _0x13c100=['execute','parentName','\x20new\x20files','Fetching\x20users\x20and\x20connections...','hasChanges','journey:traffic','map','(paused)','yellow','launched','activation','Resolving\x20journey...','/e/','journeyId','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','cyan','Listing\x20journey\x20versions...','format','versionNumber','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','pause','audienceId','\x20changed\x20files','Available\x20stages:\x20','\x20(rule\x20match)','\x20(ID:\x20','green','table','site','attributes','List\x20activations\x20for\x20a\x20journey','615590KxMbxG','journey:resume','18RRKKXs','\x20\x20Target:\x20','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Table:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Export\x20journey(s)\x20as\x20YAML\x20files','sort','journeys','Error:\x20Version\x20','reentryMode','rule','Fetching\x20parent\x20segment...','jsonl','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','archived','segmentPushCommand','journey:version:view','/j/da/je','activationParams','Show\x20journey\x20table\x20column\x20mapping','journey:view','Found\x20','json','limit','errorCode','2304387herkCN','\x20\x20Consolidating\x20duplicate\x20segment:\x20','createVersion','\x20journey\x20files\x20to\x20','73212QnzZQk','\x20journey','bold','175PeoZKZ','targetDir','resolveParentId','join','get','filter','isNew','\x20\x20-\x20','add','journeyStages','List\x20journeys\x20in\x20current\x20context','setPhase','Error:\x20Invalid\x20version\x20number:\x20','values','set','Resolving\x20version...','Error:\x20Journey\x20\x27','Journey\x20name:\x20','Parent\x20segment:\x20','(archived)','\x20\x20Statistics\x20not\x20available','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','journey:push','utf-8','Fetching\x20','Target\x20directory:\x20','base','-\x20no\x20files\x20written','goal','helpText','tsv','completeMilestoneRate','\x22\x20resumed','absolutePath','parentSegment','resume','hasPeriod','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','version','state','listVersions','Pausing\x20journey...','resolveJourneyId','\x20->\x20','getJourney','red','View\x20a\x20specific\x20version\x20of\x20a\x20journey','push','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','paused','\x20(draft)\x20—\x20\x22','journey','\x0aError:','connection','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Getting\x20journey\x20details...','🗺️\x20','Show\x20journey\x20statistics','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','journeyBundleId','getColumnMapping','yes','description','buildIdToEmailMap','Warning:\x20Could\x20not\x20resolve\x20activation\x20','listActivationsFlat','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parent_segment','3814488nQIRNo','\x20unchanged\x20files','\x20\x20Parent\x20segment:\x20','then','message','stageNameMap','✔\x20Journey\x20\x22','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Error:\x20','from','(draft)','filePath','cwd','no_parent','/app/ps/','.yml','connector_config','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','log','getStatistics','\x20Opening\x20','segments','size','Write\x20','replace','Listing\x20journey\x20activations...','folders','createdAt','✔\x20Context\x20set:\x20','database','270180LqnyZP','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','enteredSize','(running)','\x5c$&','tdx.json','getActivation','No\x20statistics\x20available\x20for\x20journey:\x20','Input:\x20','(root)','verbose','history','goalSize','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','content','stages','diff','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','includeStats','options','length','segment','conversion','listFolders','rootFolderId','includeHistory','folderId','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Getting\x20column\x20mapping...','journeyBundleName','nodes','buildIdToNameMap','listJourneysFromParentSegment','Cancelled','relative','journey:versions','📁\x20','has','resolveSegment','\x20journeys','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20activation','journey:pause','\x20Created\x20v','\x20=\x20','(completed)','2469780VqkrxG','toLowerCase','folderPath','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22',',\x20version:\x20','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x20\x20Journey\x20ID:\x20','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','Folder\x20path:\x20','columns','localeCompare','Show\x20journey\x20details','relativePath','Getting\x20journey\x20traffic\x20data...','journeyName','2722050tKWEkw','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','\x20\x20Name:\x20','Warning:\x20Could\x20not\x20resolve\x20segment\x20','file','name','journey:list','No\x20journeys\x20found','entries','dim','387AjUQyG','\x20versions)','\x22\x20not\x20found','journey:version:create','completionRate','session','error','data','repeat','journey:activations','INVALID_ARGUMENT','dryRun','Getting\x20journey\x20statistics...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','web','all','Resolving\x20parent\x20segment...','journey:stats','✔\x20Found\x20','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','milestoneSize','Resuming\x20journey...','\x20details...','completed','renderStats','exitOrJumpRate','type','Pattern:\x20','journey:pull','\x27\x20not\x20found\x20in\x20','find'];a22_0x2c33=function(){return _0x13c100;};return a22_0x2c33();}