@treasuredata/tdx 0.11.0 β†’ 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/context-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/llm-proxy.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.d.ts +39 -5
  43. package/dist/commands/workflow-command.d.ts.map +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/commands/workflow-command.js.map +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/command-output.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/constants.js +1 -1
  51. package/dist/core/credential-cache.js +1 -1
  52. package/dist/core/global-context.js +1 -1
  53. package/dist/core/keychain.js +1 -1
  54. package/dist/core/profile.js +1 -1
  55. package/dist/core/project-config.js +1 -1
  56. package/dist/core/session.js +1 -1
  57. package/dist/core/user-cache.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/proxy/anthropic-adapter.js +1 -1
  60. package/dist/proxy/claude-usage-tracker.js +1 -1
  61. package/dist/proxy/context-signature.js +1 -1
  62. package/dist/proxy/conversation-utils.js +1 -1
  63. package/dist/proxy/server.js +1 -1
  64. package/dist/proxy/session-cache.js +1 -1
  65. package/dist/sdk/agent/agent-config.js +1 -1
  66. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  67. package/dist/sdk/agent/agent-yaml.js +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/client/cdp-api-client.js +1 -1
  70. package/dist/sdk/client/endpoints.d.ts +8 -0
  71. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  72. package/dist/sdk/client/endpoints.js +1 -1
  73. package/dist/sdk/client/endpoints.js.map +1 -1
  74. package/dist/sdk/client/engage-api-client.js +1 -1
  75. package/dist/sdk/client/http-client.js +1 -1
  76. package/dist/sdk/client/llm-api-client.js +1 -1
  77. package/dist/sdk/client/rate-limiter.js +1 -1
  78. package/dist/sdk/client/td-api-client.js +1 -1
  79. package/dist/sdk/client/trino-api-client.js +1 -1
  80. package/dist/sdk/client/workflow-client.js +1 -1
  81. package/dist/sdk/connection-validator.js +1 -1
  82. package/dist/sdk/connection.js +1 -1
  83. package/dist/sdk/engage.js +1 -1
  84. package/dist/sdk/errors.d.ts +2 -0
  85. package/dist/sdk/errors.d.ts.map +1 -1
  86. package/dist/sdk/errors.js +1 -1
  87. package/dist/sdk/errors.js.map +1 -1
  88. package/dist/sdk/index.js +1 -1
  89. package/dist/sdk/io/index.js +1 -1
  90. package/dist/sdk/io/node-filesystem.js +1 -1
  91. package/dist/sdk/job.js +1 -1
  92. package/dist/sdk/journey.js +1 -1
  93. package/dist/sdk/llm/chat-cache.js +1 -1
  94. package/dist/sdk/llm/index.js +1 -1
  95. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  96. package/dist/sdk/llm/model-aliases.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  101. package/dist/sdk/segment/fields-display.js +1 -1
  102. package/dist/sdk/segment/file-discovery.js +1 -1
  103. package/dist/sdk/segment/journey-utils.js +1 -1
  104. package/dist/sdk/segment/journey-yaml.js +1 -1
  105. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  106. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  107. package/dist/sdk/segment/pull-workflow.js +1 -1
  108. package/dist/sdk/segment/push-workflow.js +1 -1
  109. package/dist/sdk/segment/resolution-context.js +1 -1
  110. package/dist/sdk/segment/segment-path-parser.js +1 -1
  111. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  112. package/dist/sdk/segment/target-resolution.js +1 -1
  113. package/dist/sdk/segment/tdx-config.js +1 -1
  114. package/dist/sdk/segment/validate-files.js +1 -1
  115. package/dist/sdk/segment/yaml-validator.js +1 -1
  116. package/dist/sdk/segment.js +1 -1
  117. package/dist/sdk/types/index.js +1 -1
  118. package/dist/sdk/types/progress.js +1 -1
  119. package/dist/sdk/user.js +1 -1
  120. package/dist/sdk/util/format-detector.js +1 -1
  121. package/dist/sdk/util/formatters.js +1 -1
  122. package/dist/sdk/util/index.js +1 -1
  123. package/dist/sdk/util/tree-formatter.js +1 -1
  124. package/dist/sdk/workflow/clone-workflow.d.ts +80 -0
  125. package/dist/sdk/workflow/clone-workflow.d.ts.map +1 -0
  126. package/dist/sdk/workflow/clone-workflow.js +1 -0
  127. package/dist/sdk/workflow/clone-workflow.js.map +1 -0
  128. package/dist/sdk/workflow/index.d.ts +94 -0
  129. package/dist/sdk/workflow/index.d.ts.map +1 -1
  130. package/dist/sdk/workflow/index.js +1 -1
  131. package/dist/sdk/workflow/index.js.map +1 -1
  132. package/dist/sdk/workflow/pull-workflow.d.ts +77 -0
  133. package/dist/sdk/workflow/pull-workflow.d.ts.map +1 -0
  134. package/dist/sdk/workflow/pull-workflow.js +1 -0
  135. package/dist/sdk/workflow/pull-workflow.js.map +1 -0
  136. package/dist/sdk/workflow/push-workflow.d.ts +66 -0
  137. package/dist/sdk/workflow/push-workflow.d.ts.map +1 -0
  138. package/dist/sdk/workflow/push-workflow.js +1 -0
  139. package/dist/sdk/workflow/push-workflow.js.map +1 -0
  140. package/dist/sdk/workflow/tdx-config.d.ts +110 -0
  141. package/dist/sdk/workflow/tdx-config.d.ts.map +1 -0
  142. package/dist/sdk/workflow/tdx-config.js +1 -0
  143. package/dist/sdk/workflow/tdx-config.js.map +1 -0
  144. package/dist/sdk/workflow/workflow-utils.d.ts +10 -7
  145. package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -1
  146. package/dist/sdk/workflow/workflow-utils.js +1 -1
  147. package/dist/sdk/workflow/workflow-utils.js.map +1 -1
  148. package/dist/utils/async.js +1 -1
  149. package/dist/utils/colors.js +1 -1
  150. package/dist/utils/diff.js +1 -1
  151. package/dist/utils/file-permissions.js +1 -1
  152. package/dist/utils/json-loader.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/prompt.js +1 -1
  157. package/dist/utils/spinner.js +1 -1
  158. package/dist/utils/sse-parser.js +1 -1
  159. package/dist/utils/string-utils.js +1 -1
  160. package/dist/utils/table-ref-parser.js +1 -1
  161. package/dist/utils/tdx-logger.js +1 -1
  162. package/dist/utils/version-check.js +1 -1
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- const a15_0x3b6605=a15_0x2875;(function(_0x2ca161,_0x2143f3){const _0x128f84=a15_0x2875,_0x58b998=_0x2ca161();while(!![]){try{const _0x3282d6=-parseInt(_0x128f84(0x7f))/0x1+-parseInt(_0x128f84(0x76))/0x2*(parseInt(_0x128f84(0x80))/0x3)+parseInt(_0x128f84(0x82))/0x4+parseInt(_0x128f84(0x70))/0x5*(parseInt(_0x128f84(0x67))/0x6)+parseInt(_0x128f84(0x89))/0x7+-parseInt(_0x128f84(0x88))/0x8*(-parseInt(_0x128f84(0x86))/0x9)+parseInt(_0x128f84(0x68))/0xa;if(_0x3282d6===_0x2143f3)break;else _0x58b998['push'](_0x58b998['shift']());}catch(_0x4975f4){_0x58b998['push'](_0x58b998['shift']());}}}(a15_0x2b43,0x53dc7));import{BaseCommand}from'./command.js';function a15_0x2875(_0x3d1af2,_0x4b2942){_0x3d1af2=_0x3d1af2-0x66;const _0x2b4375=a15_0x2b43();let _0x28754c=_0x2b4375[_0x3d1af2];return _0x28754c;}import{SDKError}from'../sdk/index.js';function a15_0x2b43(){const _0x7dfd07=['10hvMNWC','Describe\x20table\x20schema','Table\x20\x27','cause','name','Error:\x20','912196NPFJVR','data','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','site','table','\x27\x20does\x20not\x20exist','verbose','error','length','631846QJFLYU','3JlzMUz','validate','359316hbDKuX','Describing\x20table\x20','...','database','1015407MNJyMw','description','48ydWMxd','1113140noXJeb','execute','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','\x20\x20Cause:\x20','431310leocPN','3618820tzHVwh','βœ”\x20Found\x20','βœ–\x20Table\x20not\x20found','\x20in\x20','describeTable','args','message','Database:\x20'];a15_0x2b43=function(){return _0x7dfd07;};return a15_0x2b43();}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a15_0x3b6605(0x74)]='describe';[a15_0x3b6605(0x87)]=a15_0x3b6605(0x71);async[a15_0x3b6605(0x8a)](_0x531ba6){return this['describeTable'](_0x531ba6);}async['describeTable'](_0x3faeb9){const _0x184a6f=a15_0x3b6605,{options:_0x10abc3,args:_0xadddd3,tdx:_0x41c183}=_0x3faeb9;let _0x201f00;try{_0x201f00=parseTableReference(_0xadddd3[0x0]);const _0x31c7c6=_0x10abc3[_0x184a6f(0x85)];!_0x201f00[_0x184a6f(0x85)]&&_0x31c7c6&&(_0x201f00['database']=_0x31c7c6);const _0x13bad4=validateTableDescribeReference(_0x201f00);if(_0x13bad4)return console[_0x184a6f(0x7d)](_0x184a6f(0x75)+_0x13bad4),0x1;}catch(_0x2f04c6){return console['error'](_0x184a6f(0x75)+_0x2f04c6[_0x184a6f(0x6e)]),0x1;}const _0x165a5a=_0x201f00['database'],_0xb4b7ca=_0x201f00[_0x184a6f(0x7a)];try{_0x10abc3[_0x184a6f(0x7c)]&&(console[_0x184a6f(0x7d)]('Site:\x20'+_0x10abc3[_0x184a6f(0x79)]),console[_0x184a6f(0x7d)](_0x184a6f(0x6f)+_0x165a5a),console[_0x184a6f(0x7d)]('Table:\x20'+_0xb4b7ca));const _0x379700=await withSpinner(_0x184a6f(0x83)+_0x165a5a+'.'+_0xb4b7ca+_0x184a6f(0x84),()=>_0x41c183['query'][_0x184a6f(0x6c)](_0x165a5a,_0xb4b7ca),{'verbose':_0x10abc3[_0x184a6f(0x7c)]}),_0x46d052=_0x379700[_0x184a6f(0x77)];if(_0x46d052['length']===0x0)return console[_0x184a6f(0x7d)](_0x184a6f(0x6a)),console[_0x184a6f(0x7d)](_0x184a6f(0x72)+_0x165a5a+'.'+_0xb4b7ca+_0x184a6f(0x7b)),0x1;return console[_0x184a6f(0x7d)](_0x184a6f(0x69)+_0x46d052[_0x184a6f(0x7e)]+'\x20column'+(_0x46d052[_0x184a6f(0x7e)]!==0x1?'s':'')+_0x184a6f(0x6b)+_0x165a5a+'.'+_0xb4b7ca),await handleSDKOutput(_0x46d052,_0x10abc3),0x0;}catch(_0x3fc3e9){if(_0x3fc3e9 instanceof SDKError)return console['error'](_0x184a6f(0x75)+_0x3fc3e9['message']),_0x3fc3e9[_0x184a6f(0x73)]&&console[_0x184a6f(0x7d)](_0x184a6f(0x66)+_0x3fc3e9[_0x184a6f(0x73)]),0x1;throw _0x3fc3e9;}}[a15_0x3b6605(0x81)](_0x4cad39){const _0x54f7d0=a15_0x3b6605;if(_0x4cad39[_0x54f7d0(0x6d)][_0x54f7d0(0x7e)]===0x0)return _0x54f7d0(0x78);if(_0x4cad39[_0x54f7d0(0x6d)]['length']>0x1)return _0x54f7d0(0x8b);return undefined;}}
1
+ const a15_0x2c0b19=a15_0x17f7;(function(_0x4999af,_0x689ca1){const _0x1ea7f3=a15_0x17f7,_0x1fa4cc=_0x4999af();while(!![]){try{const _0x1c64da=-parseInt(_0x1ea7f3(0x126))/0x1+parseInt(_0x1ea7f3(0x13e))/0x2+parseInt(_0x1ea7f3(0x12e))/0x3+-parseInt(_0x1ea7f3(0x134))/0x4*(parseInt(_0x1ea7f3(0x13c))/0x5)+parseInt(_0x1ea7f3(0x125))/0x6*(parseInt(_0x1ea7f3(0x131))/0x7)+-parseInt(_0x1ea7f3(0x127))/0x8*(parseInt(_0x1ea7f3(0x130))/0x9)+parseInt(_0x1ea7f3(0x118))/0xa*(parseInt(_0x1ea7f3(0x121))/0xb);if(_0x1c64da===_0x689ca1)break;else _0x1fa4cc['push'](_0x1fa4cc['shift']());}catch(_0x31359d){_0x1fa4cc['push'](_0x1fa4cc['shift']());}}}(a15_0x420d,0x3a2ee));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a15_0x17f7(_0x3f9f10,_0x1803c5){_0x3f9f10=_0x3f9f10-0x118;const _0x420dff=a15_0x420d();let _0x17f777=_0x420dff[_0x3f9f10];return _0x17f777;}function a15_0x420d(){const _0x3c86d5=['data','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','describeTable','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','\x20column','site','Table\x20\x27','length','2343XrZLUa','verbose','Describe\x20table\x20schema','Table:\x20','6OBcOPo','280069BYfAxR','8ZUNhKO','message','Database:\x20','execute','describe','Describing\x20table\x20','...','1197666VBGsAP','βœ–\x20Table\x20not\x20found','3680811uPzAkp','2889509AdfbTF','\x20in\x20','error','112604CvSCIV','\x20\x20Cause:\x20','Error:\x20','validate','args','database','description','\x27\x20does\x20not\x20exist','25FpQCWN','βœ”\x20Found\x20','63646yvybYo','Site:\x20','10530KjkwuR'];a15_0x420d=function(){return _0x3c86d5;};return a15_0x420d();}import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{['name']=a15_0x2c0b19(0x12b);[a15_0x2c0b19(0x13a)]=a15_0x2c0b19(0x123);async[a15_0x2c0b19(0x12a)](_0xd08b99){const _0x4d9f02=a15_0x2c0b19;return this[_0x4d9f02(0x11b)](_0xd08b99);}async[a15_0x2c0b19(0x11b)](_0x32ccd9){const _0xb596=a15_0x2c0b19,{options:_0x45af99,args:_0x36197f,tdx:_0x57e310}=_0x32ccd9;let _0x2b9b1d;try{_0x2b9b1d=parseTableReference(_0x36197f[0x0]);const _0x4b5fba=_0x45af99[_0xb596(0x139)];!_0x2b9b1d['database']&&_0x4b5fba&&(_0x2b9b1d['database']=_0x4b5fba);const _0x36adec=validateTableDescribeReference(_0x2b9b1d);if(_0x36adec)return console['error'](_0xb596(0x136)+_0x36adec),0x1;}catch(_0x4c7eba){return console['error']('Error:\x20'+_0x4c7eba[_0xb596(0x128)]),0x1;}const _0x1c29ed=_0x2b9b1d[_0xb596(0x139)],_0x3aadcd=_0x2b9b1d['table'];try{_0x45af99['verbose']&&(console[_0xb596(0x133)](_0xb596(0x13f)+_0x45af99[_0xb596(0x11e)]),console[_0xb596(0x133)](_0xb596(0x129)+_0x1c29ed),console[_0xb596(0x133)](_0xb596(0x124)+_0x3aadcd));const _0x5e11df=await withSpinner(_0xb596(0x12c)+_0x1c29ed+'.'+_0x3aadcd+_0xb596(0x12d),()=>_0x57e310['query'][_0xb596(0x11b)](_0x1c29ed,_0x3aadcd),{'verbose':_0x45af99[_0xb596(0x122)]}),_0x2580d4=_0x5e11df[_0xb596(0x119)];if(_0x2580d4['length']===0x0)return console['error'](_0xb596(0x12f)),console[_0xb596(0x133)](_0xb596(0x11f)+_0x1c29ed+'.'+_0x3aadcd+_0xb596(0x13b)),0x1;return console[_0xb596(0x133)](_0xb596(0x13d)+_0x2580d4[_0xb596(0x120)]+_0xb596(0x11d)+(_0x2580d4[_0xb596(0x120)]!==0x1?'s':'')+_0xb596(0x132)+_0x1c29ed+'.'+_0x3aadcd),await handleSDKOutput(_0x2580d4,_0x45af99),0x0;}catch(_0x34e2d3){if(_0x34e2d3 instanceof SDKError)return console[_0xb596(0x133)](_0xb596(0x136)+_0x34e2d3[_0xb596(0x128)]),_0x34e2d3['cause']&&console['error'](_0xb596(0x135)+_0x34e2d3['cause']),0x1;throw _0x34e2d3;}}[a15_0x2c0b19(0x137)](_0x48e641){const _0x37aad5=a15_0x2c0b19;if(_0x48e641[_0x37aad5(0x138)][_0x37aad5(0x120)]===0x0)return _0x37aad5(0x11a);if(_0x48e641[_0x37aad5(0x138)]['length']>0x1)return _0x37aad5(0x11c);return undefined;}}
@@ -1 +1 @@
1
- const a16_0x12ae71=a16_0x2d19;(function(_0x170820,_0x3490ca){const _0x12fa28=a16_0x2d19,_0x35d13a=_0x170820();while(!![]){try{const _0x509982=parseInt(_0x12fa28(0x11f))/0x1+-parseInt(_0x12fa28(0x12b))/0x2*(-parseInt(_0x12fa28(0x116))/0x3)+-parseInt(_0x12fa28(0xc0))/0x4*(parseInt(_0x12fa28(0x129))/0x5)+-parseInt(_0x12fa28(0x139))/0x6+parseInt(_0x12fa28(0x11b))/0x7+parseInt(_0x12fa28(0x13d))/0x8*(parseInt(_0x12fa28(0xcc))/0x9)+parseInt(_0x12fa28(0xd4))/0xa;if(_0x509982===_0x3490ca)break;else _0x35d13a['push'](_0x35d13a['shift']());}catch(_0x24dc85){_0x35d13a['push'](_0x35d13a['shift']());}}}(a16_0x1fec,0x6fd13));import{BaseCommand}from'./command.js';import{handleSDKOutput}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';async function resolveWorkspaceIdFromOptions(_0xa68771,_0x4feab4,_0x4e3ede=![]){const _0x39b999=a16_0x2d19;if(_0xa68771[_0x39b999(0xea)])return await _0x4feab4[_0x39b999(0xef)][_0x39b999(0x125)](_0xa68771[_0x39b999(0xea)]);const _0x347b4a=loadSessionContext(_0xa68771[_0x39b999(0xb5)]);if(_0x347b4a?.[_0x39b999(0xfd)])return await _0x4feab4['engage'][_0x39b999(0x125)](_0x347b4a[_0x39b999(0xfd)]);if(_0x4e3ede)throw new SDKError(ErrorCode[_0x39b999(0xe6)],_0x39b999(0x104),undefined,{'helpText':_0x39b999(0x100)});return undefined;}async function resolveSegmentFromOptions(_0x37f0cf,_0x35e1cd){const _0x26d3db=a16_0x2d19;if(!_0x37f0cf[_0x26d3db(0x143)])return{};const _0x405344=_0x37f0cf['segment'],_0x41cbd1=await _0x35e1cd[_0x26d3db(0x143)][_0x26d3db(0x13c)](_0x405344);return{'audienceId':_0x41cbd1[_0x26d3db(0x121)],'audienceName':_0x41cbd1[_0x26d3db(0xff)],..._0x41cbd1['segmentId']&&{'segmentId':_0x41cbd1[_0x26d3db(0x142)],'segmentName':_0x41cbd1['segmentName']}};}function a16_0x2d19(_0x27146a,_0x97f83c){_0x27146a=_0x27146a-0xb3;const _0x1fec6c=a16_0x1fec();let _0x2d199a=_0x1fec6c[_0x27146a];return _0x2d199a;}function buildConnectorConfig(_0x56f7b5){const _0x2853a2=a16_0x2d19,_0x4b444a=_0x56f7b5[_0x2853a2(0x133)],_0x538e7e=_0x56f7b5['jsonColumns'];if(!_0x4b444a&&!_0x538e7e)return undefined;return{..._0x4b444a&&{'emailSenderId':_0x4b444a},..._0x538e7e&&{'jsonColumns':_0x538e7e}};}export class EngageCampaignsCommand extends BaseCommand{['name']=a16_0x12ae71(0xfc);[a16_0x12ae71(0x141)]='List\x20campaigns';async[a16_0x12ae71(0xee)](_0x5e7a1b){const _0x106070=a16_0x12ae71,{options:_0x212886,args:_0x4650bf,tdx:_0x828a14}=_0x5e7a1b,_0x427157=_0x4650bf[0x0],_0x4f3132=resolveLimit(_0x212886[_0x106070(0xf6)],DEFAULT_LLM_LIMIT),_0xc909ec=_0x212886,_0x2f1fad=_0xc909ec[_0x106070(0xbe)],_0x5f508e=_0xc909ec[_0x106070(0xc6)],_0x4fc980=await resolveWorkspaceIdFromOptions(_0xc909ec,_0x828a14),_0x281bb9=await withSpinner(_0x106070(0x12f),()=>_0x828a14[_0x106070(0xef)][_0x106070(0x118)]({'type':_0x2f1fad,'status':_0x5f508e,'workspaceId':_0x4fc980,'limit':_0x4f3132}),{'verbose':_0x212886[_0x106070(0xcf)]});let _0x2938ca=_0x281bb9[_0x106070(0xf0)];return _0x427157&&(_0x2938ca=_0x281bb9[_0x106070(0xf0)][_0x106070(0xc2)](_0x54db2a=>matchGlobPattern(_0x54db2a[_0x106070(0x127)],_0x427157))),await handleSDKOutput(_0x2938ca,_0x212886),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x122);['description']=a16_0x12ae71(0x146);async['execute'](_0x37519e){const _0x2dc518=a16_0x12ae71,{options:_0x29c325,args:_0x324d43,tdx:_0x38dbd6}=_0x37519e;if(_0x324d43[_0x2dc518(0xbb)]===0x0)return console[_0x2dc518(0xcd)](_0x2dc518(0xca)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x4f4993=_0x324d43[0x0],_0x502098=_0x29c325,_0x15e1df=await resolveWorkspaceIdFromOptions(_0x502098,_0x38dbd6),_0x341c49=_0x502098['full'];if(_0x341c49){const _0xcf0296=await withSpinner('Fetching\x20campaign\x20\x27'+_0x4f4993+_0x2dc518(0x114),()=>_0x38dbd6[_0x2dc518(0xef)]['getCampaignFull'](_0x4f4993,_0x15e1df),{'verbose':_0x29c325[_0x2dc518(0xcf)]});await handleSDKOutput([_0xcf0296],_0x29c325);}else{const _0x2a0cd2=await withSpinner(_0x2dc518(0x111)+_0x4f4993+_0x2dc518(0x114),()=>_0x38dbd6[_0x2dc518(0xef)][_0x2dc518(0x147)](_0x4f4993,_0x15e1df),{'verbose':_0x29c325[_0x2dc518(0xcf)]});await handleSDKOutput([_0x2a0cd2],_0x29c325);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x112);[a16_0x12ae71(0x141)]=a16_0x12ae71(0x117);async[a16_0x12ae71(0xee)](_0x484d72){const _0x5701b7=a16_0x12ae71,{options:_0x1a0e56,tdx:_0x571dc9}=_0x484d72,_0x4a373b=_0x1a0e56,_0x5bec3c=_0x4a373b['name'],_0x4a954d=_0x4a373b[_0x5701b7(0xbe)];if(!_0x5bec3c)return console[_0x5701b7(0xcd)](_0x5701b7(0xc8)),console['error'](_0x5701b7(0x11d)),0x1;if(!_0x4a954d)return console['error']('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console[_0x5701b7(0xcd)](_0x5701b7(0x11d)),0x1;const _0x4ddf7f=await resolveWorkspaceIdFromOptions(_0x4a373b,_0x571dc9,!![]),_0x11efa3=await resolveSegmentFromOptions(_0x4a373b,_0x571dc9),_0x3f5e9a=buildConnectorConfig(_0x4a373b),_0x3c1de2={'name':_0x5bec3c,'campaignType':_0x4a954d,'workspaceId':_0x4ddf7f,'description':_0x4a373b['description'],..._0x11efa3,'connectorConfig':_0x3f5e9a,'startAt':_0x4a373b[_0x5701b7(0x13e)],'timezone':_0x4a373b['timezone']},_0x121b58=await withSpinner(_0x5701b7(0x12d)+_0x5bec3c+_0x5701b7(0x114),()=>_0x571dc9[_0x5701b7(0xef)]['createCampaign'](_0x3c1de2));return await handleSDKOutput([_0x121b58[_0x5701b7(0xf0)]],_0x1a0e56),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0xe1);['description']=a16_0x12ae71(0xe7);async['execute'](_0x6c3ac){const _0x3cbf69=a16_0x12ae71,{options:_0x5081db,args:_0xf948cf,tdx:_0x390006}=_0x6c3ac;if(_0xf948cf[_0x3cbf69(0xbb)]===0x0)return console[_0x3cbf69(0xcd)](_0x3cbf69(0xca)),console['error'](_0x3cbf69(0x11c)),0x1;const _0x4cb34e=_0xf948cf[0x0],_0x590bf4=_0x5081db,_0x213b3d=await resolveWorkspaceIdFromOptions(_0x590bf4,_0x390006),_0x5a05d1=await resolveSegmentFromOptions(_0x590bf4,_0x390006),_0x290260=buildConnectorConfig(_0x590bf4),_0x3e2e1f={'name':_0x590bf4['name'],'description':_0x590bf4[_0x3cbf69(0x141)],..._0x5a05d1,'connectorConfig':_0x290260,'startAt':_0x590bf4[_0x3cbf69(0x13e)],'timezone':_0x590bf4[_0x3cbf69(0xbd)]},_0x4a93bd=Object['fromEntries'](Object[_0x3cbf69(0xe0)](_0x3e2e1f)[_0x3cbf69(0xc2)](([,_0x575496])=>_0x575496!==undefined));if(Object[_0x3cbf69(0x13b)](_0x4a93bd)[_0x3cbf69(0xbb)]===0x0)return console['error'](_0x3cbf69(0x126)),console['error'](_0x3cbf69(0x145)),0x1;const _0x557827=await withSpinner('Updating\x20campaign\x20\x27'+_0x4cb34e+'\x27...',()=>_0x390006[_0x3cbf69(0xef)][_0x3cbf69(0xc5)](_0x4cb34e,_0x4a93bd,_0x213b3d),{'verbose':_0x5081db[_0x3cbf69(0xcf)]});return await handleSDKOutput([_0x557827[_0x3cbf69(0xf0)]],_0x5081db),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x120);[a16_0x12ae71(0x141)]=a16_0x12ae71(0xd7);async['execute'](_0x3b6456){const _0x4b82bf=a16_0x12ae71,{options:_0x1d0c74,args:_0x227523,tdx:_0x3467f6}=_0x3b6456;if(_0x227523[_0x4b82bf(0xbb)]===0x0)return console[_0x4b82bf(0xcd)](_0x4b82bf(0xca)),console[_0x4b82bf(0xcd)](_0x4b82bf(0xda)),0x1;const _0x5288cc=_0x227523[0x0],_0x474ca9=_0x1d0c74,_0xb43175=await resolveWorkspaceIdFromOptions(_0x474ca9,_0x3467f6);if(!_0x1d0c74[_0x4b82bf(0xd2)]){const _0x571db4=await confirm(_0x4b82bf(0xe2)+_0x5288cc+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x571db4)return console[_0x4b82bf(0xe8)](_0x4b82bf(0x102)),0x0;}return await withSpinner(_0x4b82bf(0xf5)+_0x5288cc+_0x4b82bf(0x114),()=>_0x3467f6[_0x4b82bf(0xef)]['deleteCampaign'](_0x5288cc,_0xb43175),{'verbose':_0x1d0c74[_0x4b82bf(0xcf)]}),console['log'](_0x4b82bf(0xc1)+_0x5288cc+_0x4b82bf(0xf4)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x110);[a16_0x12ae71(0x141)]='Launch\x20a\x20campaign';async[a16_0x12ae71(0xee)](_0x125609){const _0xecc524=a16_0x12ae71,{options:_0xf9c6ef,args:_0x244177,tdx:_0x477b05}=_0x125609;if(_0x244177['length']===0x0)return console[_0xecc524(0xcd)](_0xecc524(0xca)),console['error'](_0xecc524(0x13f)),0x1;const _0x3d2800=_0x244177[0x0],_0x3044c3=_0xf9c6ef,_0x58ca24=await resolveWorkspaceIdFromOptions(_0x3044c3,_0x477b05);return await withSpinner(_0xecc524(0x134)+_0x3d2800+_0xecc524(0x114),()=>_0x477b05[_0xecc524(0xef)][_0xecc524(0xc9)](_0x3d2800,_0x58ca24),{'verbose':_0xf9c6ef['verbose']}),console[_0xecc524(0xe8)](_0xecc524(0xc1)+_0x3d2800+_0xecc524(0xf2)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0xb9);[a16_0x12ae71(0x141)]='Pause\x20a\x20campaign';async['execute'](_0xe220df){const _0x4700dc=a16_0x12ae71,{options:_0x371427,args:_0x3d677e,tdx:_0x50ab3f}=_0xe220df;if(_0x3d677e[_0x4700dc(0xbb)]===0x0)return console[_0x4700dc(0xcd)](_0x4700dc(0xca)),console[_0x4700dc(0xcd)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x3284a6=_0x3d677e[0x0],_0x33f0e7=_0x371427,_0x6e9f0d=await resolveWorkspaceIdFromOptions(_0x33f0e7,_0x50ab3f);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x3284a6+'\x27...',()=>_0x50ab3f[_0x4700dc(0xef)][_0x4700dc(0xec)](_0x3284a6,_0x6e9f0d),{'verbose':_0x371427[_0x4700dc(0xcf)]}),console[_0x4700dc(0xe8)](_0x4700dc(0xc1)+_0x3284a6+_0x4700dc(0xeb)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a16_0x12ae71(0xb6);['description']=a16_0x12ae71(0x107);async['execute'](_0x3cc549){const _0x52d8b9=a16_0x12ae71,{options:_0x289ca0,args:_0x325581,tdx:_0x21708a}=_0x3cc549;if(_0x325581['length']===0x0)return console[_0x52d8b9(0xcd)](_0x52d8b9(0xca)),console[_0x52d8b9(0xcd)](_0x52d8b9(0xf9)),0x1;const _0x3edcff=_0x325581[0x0],_0x21895e=_0x289ca0,_0x2395ca=await resolveWorkspaceIdFromOptions(_0x21895e,_0x21708a);return await withSpinner(_0x52d8b9(0x105)+_0x3edcff+_0x52d8b9(0x114),()=>_0x21708a[_0x52d8b9(0xef)][_0x52d8b9(0x135)](_0x3edcff,_0x2395ca),{'verbose':_0x289ca0[_0x52d8b9(0xcf)]}),console[_0x52d8b9(0xe8)]('Campaign\x20\x27'+_0x3edcff+_0x52d8b9(0x124)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']='engage:campaign:duplicate';[a16_0x12ae71(0x141)]=a16_0x12ae71(0xe4);async[a16_0x12ae71(0xee)](_0x4dfea0){const _0x11f4db=a16_0x12ae71,{options:_0x54e510,args:_0x4b953a,tdx:_0x56b85f}=_0x4dfea0;if(_0x4b953a['length']===0x0)return console[_0x11f4db(0xcd)](_0x11f4db(0xca)),console[_0x11f4db(0xcd)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x12bde2=_0x4b953a[0x0],_0x44cfb3=_0x54e510,_0x59c53e=await resolveWorkspaceIdFromOptions(_0x44cfb3,_0x56b85f),_0x225f9b=await withSpinner(_0x11f4db(0xfb)+_0x12bde2+_0x11f4db(0x114),()=>_0x56b85f[_0x11f4db(0xef)]['duplicateCampaign'](_0x12bde2,_0x59c53e),{'verbose':_0x54e510[_0x11f4db(0xcf)]});return await handleSDKOutput([_0x225f9b['data']],_0x54e510),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a16_0x12ae71(0x132);[a16_0x12ae71(0x141)]=a16_0x12ae71(0xfa);async[a16_0x12ae71(0xee)](_0x42ae2e){const _0x1cc9e3=a16_0x12ae71,{options:_0x46da1e,args:_0x420926,tdx:_0x58901e}=_0x42ae2e,_0x984653=_0x420926[0x0],_0x4bf790=resolveLimit(_0x46da1e['limit'],DEFAULT_LLM_LIMIT),_0x5ed718=_0x46da1e,_0x2e3bc7=await resolveWorkspaceIdFromOptions(_0x5ed718,_0x58901e),_0x13746c=await withSpinner(_0x1cc9e3(0xb4),()=>_0x58901e[_0x1cc9e3(0xef)][_0x1cc9e3(0x10b)]({'workspaceId':_0x2e3bc7,'limit':_0x4bf790}),{'verbose':_0x46da1e[_0x1cc9e3(0xcf)]});let _0x34d560=_0x13746c[_0x1cc9e3(0xf0)];return _0x984653&&(_0x34d560=_0x13746c[_0x1cc9e3(0xf0)][_0x1cc9e3(0xc2)](_0x437fc4=>matchGlobPattern(_0x437fc4[_0x1cc9e3(0x127)],_0x984653))),await handleSDKOutput(_0x34d560,_0x46da1e),0x0;}}function a16_0x1fec(){const _0x477fe8=['Deleting\x20campaign\x20\x27','limit','Fetching\x20workspaces...','Error:\x20--html\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','List\x20email\x20templates','Duplicating\x20campaign\x20\x27','engage:campaigns','engage_workspace','Template\x20\x27','parentName','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Fetching\x20template\x20\x27','Operation\x20cancelled','updateWorkspace','Workspace\x20is\x20required\x20for\x20this\x20operation','Resuming\x20campaign\x20\x27','Create\x20a\x20workspace','Resume\x20a\x20paused\x20campaign','editorType','getWorkspace','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','listTemplates','Delete\x20an\x20email\x20template','List\x20workspaces','fromEntries','Updating\x20workspace\x20\x27','engage:campaign:launch','Fetching\x20campaign\x20\x27','engage:campaign:create','Error:\x20Workspace\x20name\x20is\x20required','\x27...','Error:\x20--subject\x20is\x20required','380127vyoIxX','Create\x20a\x20new\x20campaign','listCampaigns','engage:template:create','engage:workspace:use','1905813jODUcU','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','plaintext','219974QPUslA','engage:campaign:delete','parentId','engage:campaign:show','engage:template:show','\x27\x20resumed\x20successfully','resolveWorkspaceId','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','name','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','25HdsXmR','Delete\x20a\x20workspace','10DDWqyt','full','Creating\x20campaign\x20\x27','createWorkspace','Fetching\x20campaigns...','listWorkspaces','Deleting\x20template\x20\x27','engage:templates','emailSenderId','Launching\x20campaign\x20\x27','resumeCampaign','engage:template:update','engage:workspace:delete','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','2815728jSqjSc','engage:workspace:show','keys','resolvePathToResource','6992gAEoVl','startAt','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','description','segmentId','segment','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','Show\x20campaign\x20details','getCampaign','getTemplateFull','Fetching\x20templates...','session','engage:campaign:resume','Verifying\x20workspace\x20\x27','engage:template:delete','engage:campaign:pause','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','length','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','timezone','type','Deleting\x20workspace\x20\x27','480256SYNWhq','Campaign\x20\x27','filter','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','Update\x20an\x20email\x20template','updateCampaign','status','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Error:\x20--name\x20is\x20required','launchCampaign','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','getTemplate','3618JgWTet','error','Updating\x20template\x20\x27','verbose','deleteTemplate','Engage\x20workspace\x20set\x20to:\x20','yes','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','504850oITUlP','Creating\x20template\x20\x27','Options:\x20--name,\x20--description','Delete\x20a\x20campaign','Show\x20email\x20template\x20details','getWorkspaceFull','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Update\x20a\x20workspace','Creating\x20workspace\x20\x27','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Fetching\x20workspace\x20\x27','\x27?\x20This\x20cannot\x20be\x20undone.','entries','engage:campaign:update','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','html','Duplicate\x20a\x20campaign','Set\x20workspace\x20context\x20for\x20Engage\x20commands','MISSING_ARGUMENT','Update\x20a\x20campaign','log','createTemplate','workspace','\x27\x20paused\x20successfully','pauseCampaign','Workspace\x20\x27','execute','engage','data','subject','\x27\x20launched\x20successfully','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x27\x20deleted\x20successfully'];a16_0x1fec=function(){return _0x477fe8;};return a16_0x1fec();}export class EngageTemplateShowCommand extends BaseCommand{['name']=a16_0x12ae71(0x123);[a16_0x12ae71(0x141)]=a16_0x12ae71(0xd8);async[a16_0x12ae71(0xee)](_0xae6438){const _0xaa9c95=a16_0x12ae71,{options:_0x2a449d,args:_0x16da54,tdx:_0x208e99}=_0xae6438;if(_0x16da54[_0xaa9c95(0xbb)]===0x0)return console['error'](_0xaa9c95(0x10a)),console[_0xaa9c95(0xcd)]('Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>'),0x1;const _0x30b4ae=_0x16da54[0x0],_0xfbbc20=_0x2a449d,_0x44dc3c=await resolveWorkspaceIdFromOptions(_0xfbbc20,_0x208e99),_0x395ca9=_0xfbbc20[_0xaa9c95(0x12c)];if(_0x395ca9){const _0x4f044f=await withSpinner(_0xaa9c95(0x101)+_0x30b4ae+'\x27...',()=>_0x208e99[_0xaa9c95(0xef)][_0xaa9c95(0xb3)](_0x30b4ae,_0x44dc3c),{'verbose':_0x2a449d['verbose']});await handleSDKOutput([_0x4f044f],_0x2a449d);}else{const _0x11cd15=await withSpinner(_0xaa9c95(0x101)+_0x30b4ae+'\x27...',()=>_0x208e99['engage'][_0xaa9c95(0xcb)](_0x30b4ae,_0x44dc3c),{'verbose':_0x2a449d[_0xaa9c95(0xcf)]});await handleSDKOutput([_0x11cd15],_0x2a449d);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x119);['description']='Create\x20an\x20email\x20template';async[a16_0x12ae71(0xee)](_0x4da13b){const _0x132447=a16_0x12ae71,{options:_0x4e12d2,tdx:_0x15932f}=_0x4da13b,_0x2d6275=_0x4e12d2,_0x1f7f07=_0x2d6275[_0x132447(0x127)],_0x4a40d9=_0x2d6275[_0x132447(0xf1)],_0x363b30=_0x2d6275[_0x132447(0xe3)];if(!_0x1f7f07)return console['error']('Error:\x20--name\x20is\x20required'),console['error'](_0x132447(0x144)),0x1;if(!_0x4a40d9)return console[_0x132447(0xcd)](_0x132447(0x115)),0x1;if(!_0x363b30)return console['error'](_0x132447(0xf8)),0x1;const _0x4c6042=await resolveWorkspaceIdFromOptions(_0x2d6275,_0x15932f,!![]),_0x1282f6={'name':_0x1f7f07,'subjectTemplate':_0x4a40d9,'htmlTemplate':_0x363b30,'workspaceId':_0x4c6042,'plaintextTemplate':_0x2d6275[_0x132447(0x11e)],'editorType':_0x2d6275[_0x132447(0x108)]},_0x35bd16=await withSpinner(_0x132447(0xd5)+_0x1f7f07+_0x132447(0x114),()=>_0x15932f[_0x132447(0xef)][_0x132447(0xe9)](_0x1282f6));return await handleSDKOutput([_0x35bd16['data']],_0x4e12d2),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a16_0x12ae71(0x136);[a16_0x12ae71(0x141)]=a16_0x12ae71(0xc4);async[a16_0x12ae71(0xee)](_0x448397){const _0x316477=a16_0x12ae71,{options:_0x27e722,args:_0x53d4b6,tdx:_0x2341ad}=_0x448397;if(_0x53d4b6[_0x316477(0xbb)]===0x0)return console[_0x316477(0xcd)](_0x316477(0x10a)),console[_0x316477(0xcd)](_0x316477(0xba)),0x1;const _0xaed696=_0x53d4b6[0x0],_0x50c572=_0x27e722,_0xecb0f7=await resolveWorkspaceIdFromOptions(_0x50c572,_0x2341ad),_0x30d380={'name':_0x50c572['name'],'subjectTemplate':_0x50c572[_0x316477(0xf1)],'htmlTemplate':_0x50c572[_0x316477(0xe3)],'plaintextTemplate':_0x50c572[_0x316477(0x11e)]},_0x206e41=Object[_0x316477(0x10e)](Object['entries'](_0x30d380)['filter'](([,_0x55b040])=>_0x55b040!==undefined));if(Object[_0x316477(0x13b)](_0x206e41)['length']===0x0)return console['error'](_0x316477(0x126)),console['error'](_0x316477(0xdd)),0x1;const _0x312b70=await withSpinner(_0x316477(0xce)+_0xaed696+'\x27...',()=>_0x2341ad[_0x316477(0xef)]['updateTemplate'](_0xaed696,_0x206e41,_0xecb0f7),{'verbose':_0x27e722[_0x316477(0xcf)]});return await handleSDKOutput([_0x312b70[_0x316477(0xf0)]],_0x27e722),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0xb8);[a16_0x12ae71(0x141)]=a16_0x12ae71(0x10c);async['execute'](_0x40b6c5){const _0xfa72a5=a16_0x12ae71,{options:_0x11d4f6,args:_0x236613,tdx:_0x23af80}=_0x40b6c5;if(_0x236613[_0xfa72a5(0xbb)]===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0xfa72a5(0xcd)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x1b26cb=_0x236613[0x0],_0x24ebae=_0x11d4f6,_0x16f004=await resolveWorkspaceIdFromOptions(_0x24ebae,_0x23af80);if(!_0x11d4f6[_0xfa72a5(0xd2)]){const _0x48f57e=await confirm(_0xfa72a5(0xbc)+_0x1b26cb+_0xfa72a5(0xdf));if(!_0x48f57e)return console[_0xfa72a5(0xe8)](_0xfa72a5(0x102)),0x0;}return await withSpinner(_0xfa72a5(0x131)+_0x1b26cb+_0xfa72a5(0x114),()=>_0x23af80[_0xfa72a5(0xef)][_0xfa72a5(0xd0)](_0x1b26cb,_0x16f004),{'verbose':_0x11d4f6[_0xfa72a5(0xcf)]}),console[_0xfa72a5(0xe8)](_0xfa72a5(0xfe)+_0x1b26cb+_0xfa72a5(0xf4)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x12ae71(0x127)]='engage:workspaces';[a16_0x12ae71(0x141)]=a16_0x12ae71(0x10d);async[a16_0x12ae71(0xee)](_0x49af96){const _0x55318f=a16_0x12ae71,{options:_0x2d68ec,args:_0x2c756d,tdx:_0x5dba93}=_0x49af96,_0x54669c=_0x2c756d[0x0],_0x4de187=resolveLimit(_0x2d68ec[_0x55318f(0xf6)],DEFAULT_LLM_LIMIT),_0x577243=await withSpinner(_0x55318f(0xf7),()=>_0x5dba93[_0x55318f(0xef)][_0x55318f(0x130)]({'limit':_0x4de187}),{'verbose':_0x2d68ec[_0x55318f(0xcf)]});let _0x43700d=_0x577243[_0x55318f(0xf0)];return _0x54669c&&(_0x43700d=_0x577243[_0x55318f(0xf0)][_0x55318f(0xc2)](_0x58f26=>matchGlobPattern(_0x58f26[_0x55318f(0x127)],_0x54669c))),await handleSDKOutput(_0x43700d,_0x2d68ec),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x13a);[a16_0x12ae71(0x141)]='Show\x20workspace\x20details';async[a16_0x12ae71(0xee)](_0xca6976){const _0x4c4a7f=a16_0x12ae71,{options:_0x560baf,args:_0x4b822f,tdx:_0x3bbf91}=_0xca6976;if(_0x4b822f['length']===0x0)return console[_0x4c4a7f(0xcd)](_0x4c4a7f(0x128)),console[_0x4c4a7f(0xcd)](_0x4c4a7f(0xc7)),0x1;const _0x451d32=_0x4b822f[0x0],_0x522031=_0x560baf,_0x20ecc4=_0x522031[_0x4c4a7f(0x12c)];if(_0x20ecc4){const _0x722550=await withSpinner('Fetching\x20workspace\x20\x27'+_0x451d32+_0x4c4a7f(0x114),()=>_0x3bbf91['engage'][_0x4c4a7f(0xd9)](_0x451d32),{'verbose':_0x560baf['verbose']});await handleSDKOutput([_0x722550],_0x560baf);}else{const _0x507535=await withSpinner(_0x4c4a7f(0xde)+_0x451d32+_0x4c4a7f(0x114),()=>_0x3bbf91[_0x4c4a7f(0xef)][_0x4c4a7f(0x109)](_0x451d32),{'verbose':_0x560baf[_0x4c4a7f(0xcf)]});await handleSDKOutput([_0x507535],_0x560baf);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x12ae71(0x127)]='engage:workspace:create';[a16_0x12ae71(0x141)]=a16_0x12ae71(0x106);async[a16_0x12ae71(0xee)](_0x39b875){const _0x5272e9=a16_0x12ae71,{options:_0x40eb80,tdx:_0x16a046}=_0x39b875,_0x41eb74=_0x40eb80,_0x3e55d1=_0x41eb74[_0x5272e9(0x127)];if(!_0x3e55d1)return console['error'](_0x5272e9(0xc8)),console['error'](_0x5272e9(0x138)),0x1;const _0x4b8b51={'name':_0x3e55d1,'description':_0x41eb74[_0x5272e9(0x141)]},_0x2e8c1b=await withSpinner(_0x5272e9(0xdc)+_0x3e55d1+_0x5272e9(0x114),()=>_0x16a046[_0x5272e9(0xef)][_0x5272e9(0x12e)](_0x4b8b51));return await handleSDKOutput([_0x2e8c1b[_0x5272e9(0xf0)]],_0x40eb80),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x12ae71(0x127)]='engage:workspace:update';[a16_0x12ae71(0x141)]=a16_0x12ae71(0xdb);async[a16_0x12ae71(0xee)](_0x3b2d4b){const _0x3f1dd1=a16_0x12ae71,{options:_0x1acafd,args:_0x315d41,tdx:_0x4ee499}=_0x3b2d4b;if(_0x315d41[_0x3f1dd1(0xbb)]===0x0)return console[_0x3f1dd1(0xcd)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x3f1dd1(0xcd)](_0x3f1dd1(0xd3)),0x1;const _0x537f01=_0x315d41[0x0],_0x4e32a0=_0x1acafd,_0x3d8145={'name':_0x4e32a0[_0x3f1dd1(0x127)],'description':_0x4e32a0[_0x3f1dd1(0x141)]},_0x544a74=Object[_0x3f1dd1(0x10e)](Object['entries'](_0x3d8145)['filter'](([,_0x7f9ae1])=>_0x7f9ae1!==undefined));if(Object[_0x3f1dd1(0x13b)](_0x544a74)[_0x3f1dd1(0xbb)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x3f1dd1(0xcd)](_0x3f1dd1(0xd6)),0x1;const _0x1b8c71=await withSpinner(_0x3f1dd1(0x10f)+_0x537f01+'\x27...',()=>_0x4ee499[_0x3f1dd1(0xef)][_0x3f1dd1(0x103)](_0x537f01,_0x544a74),{'verbose':_0x1acafd[_0x3f1dd1(0xcf)]});return await handleSDKOutput([_0x1b8c71['data']],_0x1acafd),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x137);['description']=a16_0x12ae71(0x12a);async[a16_0x12ae71(0xee)](_0x50daaa){const _0x3c9467=a16_0x12ae71,{options:_0x3476c6,args:_0x18dac7,tdx:_0x509182}=_0x50daaa;if(_0x18dac7[_0x3c9467(0xbb)]===0x0)return console[_0x3c9467(0xcd)](_0x3c9467(0x128)),console[_0x3c9467(0xcd)](_0x3c9467(0x140)),0x1;const _0x1f6c84=_0x18dac7[0x0];if(!_0x3476c6[_0x3c9467(0xd2)]){const _0x107a0a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x1f6c84+_0x3c9467(0xdf));if(!_0x107a0a)return console[_0x3c9467(0xe8)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x3c9467(0xbf)+_0x1f6c84+_0x3c9467(0x114),()=>_0x509182[_0x3c9467(0xef)]['deleteWorkspace'](_0x1f6c84),{'verbose':_0x3476c6[_0x3c9467(0xcf)]}),console[_0x3c9467(0xe8)](_0x3c9467(0xed)+_0x1f6c84+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a16_0x12ae71(0x11a);[a16_0x12ae71(0x141)]=a16_0x12ae71(0xe5);async[a16_0x12ae71(0xee)](_0x5f2f00){const _0x179728=a16_0x12ae71,{options:_0x2b1f58,args:_0x1ab5a6,tdx:_0x288803}=_0x5f2f00;if(_0x1ab5a6['length']===0x0)return console[_0x179728(0xcd)](_0x179728(0x113)),console['error'](_0x179728(0xc3)),0x1;const _0x290387=_0x1ab5a6[0x0];await withSpinner(_0x179728(0xb7)+_0x290387+_0x179728(0x114),()=>_0x288803['engage'][_0x179728(0x125)](_0x290387));const _0x18f149=_0x2b1f58['session']||undefined;return saveSessionContext({'engage_workspace':_0x290387},_0x18f149),console[_0x179728(0xe8)](_0x179728(0xd1)+_0x290387),console['log'](_0x179728(0xf3)),0x0;}}
1
+ function a16_0x505c(_0x5c145f,_0xa80cb0){_0x5c145f=_0x5c145f-0x143;const _0x298893=a16_0x2988();let _0x505c5e=_0x298893[_0x5c145f];return _0x505c5e;}const a16_0x34ce30=a16_0x505c;(function(_0x3872b4,_0x4aeeb0){const _0x20c41e=a16_0x505c,_0x2b6f9d=_0x3872b4();while(!![]){try{const _0x5eb63d=-parseInt(_0x20c41e(0x1bd))/0x1+parseInt(_0x20c41e(0x1c2))/0x2+-parseInt(_0x20c41e(0x1be))/0x3+parseInt(_0x20c41e(0x1c1))/0x4+-parseInt(_0x20c41e(0x1c9))/0x5*(parseInt(_0x20c41e(0x145))/0x6)+-parseInt(_0x20c41e(0x1c0))/0x7+parseInt(_0x20c41e(0x1bb))/0x8;if(_0x5eb63d===_0x4aeeb0)break;else _0x2b6f9d['push'](_0x2b6f9d['shift']());}catch(_0x332634){_0x2b6f9d['push'](_0x2b6f9d['shift']());}}}(a16_0x2988,0x72a15));import{BaseCommand}from'./command.js';import{handleSDKOutput}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';async function resolveWorkspaceIdFromOptions(_0x2ebc95,_0x467f6f,_0x4f88cf=![]){const _0x32d542=a16_0x505c;if(_0x2ebc95[_0x32d542(0x15d)])return await _0x467f6f['engage'][_0x32d542(0x195)](_0x2ebc95[_0x32d542(0x15d)]);const _0x46271a=loadSessionContext(_0x2ebc95[_0x32d542(0x167)]);if(_0x46271a?.[_0x32d542(0x143)])return await _0x467f6f[_0x32d542(0x1cd)]['resolveWorkspaceId'](_0x46271a[_0x32d542(0x143)]);if(_0x4f88cf)throw new SDKError(ErrorCode[_0x32d542(0x197)],_0x32d542(0x177),undefined,{'helpText':_0x32d542(0x168)});return undefined;}async function resolveSegmentFromOptions(_0x4e7209,_0x59e43c){const _0x3b60f8=a16_0x505c;if(!_0x4e7209[_0x3b60f8(0x1af)])return{};const _0x348fd9=_0x4e7209['segment'],_0x4e8847=await _0x59e43c[_0x3b60f8(0x1af)][_0x3b60f8(0x189)](_0x348fd9);return{'audienceId':_0x4e8847[_0x3b60f8(0x16c)],'audienceName':_0x4e8847[_0x3b60f8(0x1c7)],..._0x4e8847[_0x3b60f8(0x17f)]&&{'segmentId':_0x4e8847['segmentId'],'segmentName':_0x4e8847['segmentName']}};}function buildConnectorConfig(_0x8b8e17){const _0x299b17=a16_0x505c,_0x2ffd74=_0x8b8e17['emailSenderId'],_0x3147d8=_0x8b8e17[_0x299b17(0x164)];if(!_0x2ffd74&&!_0x3147d8)return undefined;return{..._0x2ffd74&&{'emailSenderId':_0x2ffd74},..._0x3147d8&&{'jsonColumns':_0x3147d8}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x34ce30(0x156)]='engage:campaigns';['description']=a16_0x34ce30(0x153);async[a16_0x34ce30(0x1b7)](_0x2c3dee){const _0xd0e61b=a16_0x34ce30,{options:_0x26e64c,args:_0x1dd7a9,tdx:_0x380afd}=_0x2c3dee,_0x4821be=_0x1dd7a9[0x0],_0x1f7b86=resolveLimit(_0x26e64c['limit'],DEFAULT_LLM_LIMIT),_0x1312ea=_0x26e64c,_0x1c0214=_0x1312ea[_0xd0e61b(0x169)],_0x376dd2=_0x1312ea[_0xd0e61b(0x1d3)],_0x90d5ab=await resolveWorkspaceIdFromOptions(_0x1312ea,_0x380afd),_0x5d6e1f=await withSpinner('Fetching\x20campaigns...',()=>_0x380afd['engage']['listCampaigns']({'type':_0x1c0214,'status':_0x376dd2,'workspaceId':_0x90d5ab,'limit':_0x1f7b86}),{'verbose':_0x26e64c['verbose']});let _0x3e328e=_0x5d6e1f['data'];return _0x4821be&&(_0x3e328e=_0x5d6e1f[_0xd0e61b(0x157)][_0xd0e61b(0x150)](_0x346d75=>matchGlobPattern(_0x346d75[_0xd0e61b(0x156)],_0x4821be))),await handleSDKOutput(_0x3e328e,_0x26e64c),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x1b2);['description']=a16_0x34ce30(0x15e);async[a16_0x34ce30(0x1b7)](_0x4124dc){const _0x4daae2=a16_0x34ce30,{options:_0x51e1ff,args:_0x200d31,tdx:_0x3e4dac}=_0x4124dc;if(_0x200d31[_0x4daae2(0x160)]===0x0)return console[_0x4daae2(0x184)](_0x4daae2(0x172)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x2f8b74=_0x200d31[0x0],_0x514946=_0x51e1ff,_0xfd6d8e=await resolveWorkspaceIdFromOptions(_0x514946,_0x3e4dac),_0x2a2396=_0x514946[_0x4daae2(0x16a)];if(_0x2a2396){const _0x10a70f=await withSpinner(_0x4daae2(0x1b1)+_0x2f8b74+_0x4daae2(0x1ae),()=>_0x3e4dac[_0x4daae2(0x1cd)][_0x4daae2(0x1b0)](_0x2f8b74,_0xfd6d8e),{'verbose':_0x51e1ff[_0x4daae2(0x1c4)]});await handleSDKOutput([_0x10a70f],_0x51e1ff);}else{const _0x3078c5=await withSpinner('Fetching\x20campaign\x20\x27'+_0x2f8b74+_0x4daae2(0x1ae),()=>_0x3e4dac[_0x4daae2(0x1cd)]['getCampaign'](_0x2f8b74,_0xfd6d8e),{'verbose':_0x51e1ff[_0x4daae2(0x1c4)]});await handleSDKOutput([_0x3078c5],_0x51e1ff);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x19e);[a16_0x34ce30(0x1ba)]=a16_0x34ce30(0x16d);async['execute'](_0x406d9c){const _0x2b4dfa=a16_0x34ce30,{options:_0x1ad10a,tdx:_0x2f65a2}=_0x406d9c,_0x2e20c9=_0x1ad10a,_0x18deca=_0x2e20c9['name'],_0x33c7dc=_0x2e20c9['type'];if(!_0x18deca)return console['error'](_0x2b4dfa(0x17c)),console[_0x2b4dfa(0x184)](_0x2b4dfa(0x1d0)),0x1;if(!_0x33c7dc)return console[_0x2b4dfa(0x184)](_0x2b4dfa(0x16e)),console[_0x2b4dfa(0x184)](_0x2b4dfa(0x1d0)),0x1;const _0x41b684=await resolveWorkspaceIdFromOptions(_0x2e20c9,_0x2f65a2,!![]),_0x2bb499=await resolveSegmentFromOptions(_0x2e20c9,_0x2f65a2),_0x2a6860=buildConnectorConfig(_0x2e20c9),_0xeb036a={'name':_0x18deca,'campaignType':_0x33c7dc,'workspaceId':_0x41b684,'description':_0x2e20c9[_0x2b4dfa(0x1ba)],..._0x2bb499,'connectorConfig':_0x2a6860,'startAt':_0x2e20c9[_0x2b4dfa(0x14b)],'timezone':_0x2e20c9[_0x2b4dfa(0x1d4)]},_0x2d0ad9=await withSpinner(_0x2b4dfa(0x1c6)+_0x18deca+'\x27...',()=>_0x2f65a2[_0x2b4dfa(0x1cd)][_0x2b4dfa(0x14f)](_0xeb036a));return await handleSDKOutput([_0x2d0ad9[_0x2b4dfa(0x157)]],_0x1ad10a),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x1a3);[a16_0x34ce30(0x1ba)]='Update\x20a\x20campaign';async[a16_0x34ce30(0x1b7)](_0x509a4d){const _0xddc936=a16_0x34ce30,{options:_0x3906a7,args:_0x115479,tdx:_0x597563}=_0x509a4d;if(_0x115479[_0xddc936(0x160)]===0x0)return console[_0xddc936(0x184)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0xddc936(0x1b3)),0x1;const _0x29e2ec=_0x115479[0x0],_0x1da41d=_0x3906a7,_0x2de4fc=await resolveWorkspaceIdFromOptions(_0x1da41d,_0x597563),_0x4fc6b3=await resolveSegmentFromOptions(_0x1da41d,_0x597563),_0x33536b=buildConnectorConfig(_0x1da41d),_0x2bc834={'name':_0x1da41d[_0xddc936(0x156)],'description':_0x1da41d[_0xddc936(0x1ba)],..._0x4fc6b3,'connectorConfig':_0x33536b,'startAt':_0x1da41d['startAt'],'timezone':_0x1da41d[_0xddc936(0x1d4)]},_0x173ac5=Object[_0xddc936(0x178)](Object[_0xddc936(0x1ab)](_0x2bc834)[_0xddc936(0x150)](([,_0x34ba69])=>_0x34ba69!==undefined));if(Object[_0xddc936(0x1cf)](_0x173ac5)[_0xddc936(0x160)]===0x0)return console[_0xddc936(0x184)](_0xddc936(0x146)),console[_0xddc936(0x184)](_0xddc936(0x1c8)),0x1;const _0x4506a3=await withSpinner(_0xddc936(0x18e)+_0x29e2ec+_0xddc936(0x1ae),()=>_0x597563['engage'][_0xddc936(0x18d)](_0x29e2ec,_0x173ac5,_0x2de4fc),{'verbose':_0x3906a7[_0xddc936(0x1c4)]});return await handleSDKOutput([_0x4506a3['data']],_0x3906a7),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x147);['description']='Delete\x20a\x20campaign';async['execute'](_0x509773){const _0x105ae0=a16_0x34ce30,{options:_0x1609b1,args:_0x25ec03,tdx:_0x1e3028}=_0x509773;if(_0x25ec03['length']===0x0)return console[_0x105ae0(0x184)](_0x105ae0(0x172)),console[_0x105ae0(0x184)](_0x105ae0(0x16f)),0x1;const _0x109de3=_0x25ec03[0x0],_0x4e0086=_0x1609b1,_0x5c8952=await resolveWorkspaceIdFromOptions(_0x4e0086,_0x1e3028);if(!_0x1609b1[_0x105ae0(0x154)]){const _0x7b953f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27'+_0x109de3+_0x105ae0(0x1cc));if(!_0x7b953f)return console[_0x105ae0(0x19f)](_0x105ae0(0x187)),0x0;}return await withSpinner(_0x105ae0(0x179)+_0x109de3+_0x105ae0(0x1ae),()=>_0x1e3028['engage'][_0x105ae0(0x152)](_0x109de3,_0x5c8952),{'verbose':_0x1609b1[_0x105ae0(0x1c4)]}),console[_0x105ae0(0x19f)](_0x105ae0(0x198)+_0x109de3+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x34ce30(0x156)]='engage:campaign:launch';[a16_0x34ce30(0x1ba)]=a16_0x34ce30(0x18c);async['execute'](_0x363e93){const _0x32c4ff=a16_0x34ce30,{options:_0x4fc8ea,args:_0x472217,tdx:_0x3ed684}=_0x363e93;if(_0x472217['length']===0x0)return console[_0x32c4ff(0x184)](_0x32c4ff(0x172)),console[_0x32c4ff(0x184)](_0x32c4ff(0x1a7)),0x1;const _0x4664a9=_0x472217[0x0],_0xc53f79=_0x4fc8ea,_0x3e7df0=await resolveWorkspaceIdFromOptions(_0xc53f79,_0x3ed684);return await withSpinner(_0x32c4ff(0x171)+_0x4664a9+'\x27...',()=>_0x3ed684[_0x32c4ff(0x1cd)][_0x32c4ff(0x14c)](_0x4664a9,_0x3e7df0),{'verbose':_0x4fc8ea[_0x32c4ff(0x1c4)]}),console[_0x32c4ff(0x19f)]('Campaign\x20\x27'+_0x4664a9+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x34ce30(0x156)]='engage:campaign:pause';[a16_0x34ce30(0x1ba)]=a16_0x34ce30(0x14d);async[a16_0x34ce30(0x1b7)](_0x11515e){const _0x5e5c68=a16_0x34ce30,{options:_0x5e9f09,args:_0x50dc7a,tdx:_0x7e87a}=_0x11515e;if(_0x50dc7a[_0x5e5c68(0x160)]===0x0)return console[_0x5e5c68(0x184)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x5e5c68(0x184)](_0x5e5c68(0x183)),0x1;const _0xaa8c05=_0x50dc7a[0x0],_0x100e05=_0x5e9f09,_0x200970=await resolveWorkspaceIdFromOptions(_0x100e05,_0x7e87a);return await withSpinner(_0x5e5c68(0x15a)+_0xaa8c05+'\x27...',()=>_0x7e87a[_0x5e5c68(0x1cd)][_0x5e5c68(0x165)](_0xaa8c05,_0x200970),{'verbose':_0x5e9f09[_0x5e5c68(0x1c4)]}),console[_0x5e5c68(0x19f)](_0x5e5c68(0x198)+_0xaa8c05+_0x5e5c68(0x1a4)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x148);[a16_0x34ce30(0x1ba)]='Resume\x20a\x20paused\x20campaign';async[a16_0x34ce30(0x1b7)](_0x4e161a){const _0xda30b8=a16_0x34ce30,{options:_0x25456f,args:_0x4d2a5a,tdx:_0x468d2b}=_0x4e161a;if(_0x4d2a5a['length']===0x0)return console[_0xda30b8(0x184)](_0xda30b8(0x172)),console[_0xda30b8(0x184)](_0xda30b8(0x190)),0x1;const _0x494beb=_0x4d2a5a[0x0],_0x31e709=_0x25456f,_0x123e8f=await resolveWorkspaceIdFromOptions(_0x31e709,_0x468d2b);return await withSpinner(_0xda30b8(0x173)+_0x494beb+_0xda30b8(0x1ae),()=>_0x468d2b[_0xda30b8(0x1cd)][_0xda30b8(0x15f)](_0x494beb,_0x123e8f),{'verbose':_0x25456f[_0xda30b8(0x1c4)]}),console[_0xda30b8(0x19f)](_0xda30b8(0x198)+_0x494beb+_0xda30b8(0x1a0)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a16_0x34ce30(0x17b);[a16_0x34ce30(0x1ba)]=a16_0x34ce30(0x1ac);async[a16_0x34ce30(0x1b7)](_0x1c29e0){const _0x379293=a16_0x34ce30,{options:_0x469d32,args:_0x20de83,tdx:_0x23e83e}=_0x1c29e0;if(_0x20de83['length']===0x0)return console['error'](_0x379293(0x172)),console[_0x379293(0x184)](_0x379293(0x175)),0x1;const _0x106802=_0x20de83[0x0],_0x468375=_0x469d32,_0x25f40f=await resolveWorkspaceIdFromOptions(_0x468375,_0x23e83e),_0x4d2871=await withSpinner(_0x379293(0x186)+_0x106802+'\x27...',()=>_0x23e83e['engage'][_0x379293(0x185)](_0x106802,_0x25f40f),{'verbose':_0x469d32['verbose']});return await handleSDKOutput([_0x4d2871['data']],_0x469d32),0x0;}}function a16_0x2988(){const _0x587579=['editorType','engage:workspace:create','subject','Options:\x20--name,\x20--description','engage:campaign:create','log','\x27\x20resumed\x20successfully','html','limit','engage:campaign:update','\x27\x20paused\x20successfully','Engage\x20workspace\x20set\x20to:\x20','engage:workspace:update','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Update\x20a\x20workspace','getTemplateFull','Update\x20an\x20email\x20template','entries','Duplicate\x20a\x20campaign','List\x20workspaces','\x27...','segment','getCampaignFull','Fetching\x20campaign\x20\x27','engage:campaign:show','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','\x27\x20deleted\x20successfully','List\x20email\x20templates','engage:workspace:show','execute','listTemplates','updateWorkspace','description','12084224Xzptzo','listWorkspaces','285455CNORve','908559vZfNpS','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','4018861WRLTIM','1422052fnHnYZ','643680ZXUFOv','Error:\x20--subject\x20is\x20required','verbose','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','Creating\x20campaign\x20\x27','parentName','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','4625NvUUWi','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Create\x20an\x20email\x20template','\x27?\x20This\x20cannot\x20be\x20undone.','engage','engage:templates','keys','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','engage:workspace:use','Deleting\x20workspace\x20\x27','status','timezone','engage_workspace','Fetching\x20template\x20\x27','3606jDDhLp','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','engage:campaign:delete','engage:campaign:resume','Deleting\x20template\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','startAt','launchCampaign','Pause\x20a\x20campaign','plaintext','createCampaign','filter','Error:\x20--html\x20is\x20required','deleteCampaign','List\x20campaigns','yes','Fetching\x20workspace\x20\x27','name','data','engage:template:delete','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Pausing\x20campaign\x20\x27','engage:workspace:delete','engage:template:show','workspace','Show\x20campaign\x20details','resumeCampaign','length','Updating\x20workspace\x20\x27','Create\x20a\x20workspace','engage:template:create','jsonColumns','pauseCampaign','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','session','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','type','full','Updating\x20template\x20\x27','parentId','Create\x20a\x20new\x20campaign','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Launching\x20campaign\x20\x27','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Resuming\x20campaign\x20\x27','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','deleteWorkspace','Workspace\x20is\x20required\x20for\x20this\x20operation','fromEntries','Deleting\x20campaign\x20\x27','getTemplate','engage:campaign:duplicate','Error:\x20--name\x20is\x20required','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','getWorkspaceFull','segmentId','Creating\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','updateTemplate','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','error','duplicateCampaign','Duplicating\x20campaign\x20\x27','Operation\x20cancelled','getWorkspace','resolvePathToResource','Error:\x20Workspace\x20name\x20is\x20required','Template\x20\x27','Launch\x20a\x20campaign','updateCampaign','Updating\x20campaign\x20\x27','Show\x20workspace\x20details','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','Verifying\x20workspace\x20\x27','Fetching\x20templates...','createWorkspace','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','resolveWorkspaceId','engage:workspaces','MISSING_ARGUMENT','Campaign\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'];a16_0x2988=function(){return _0x587579;};return a16_0x2988();}export class EngageTemplatesCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x1ce);[a16_0x34ce30(0x1ba)]=a16_0x34ce30(0x1b5);async[a16_0x34ce30(0x1b7)](_0x1c3875){const _0x47eac3=a16_0x34ce30,{options:_0x573a8f,args:_0x33c374,tdx:_0x2a7f18}=_0x1c3875,_0x3e9178=_0x33c374[0x0],_0x3de31f=resolveLimit(_0x573a8f[_0x47eac3(0x1a2)],DEFAULT_LLM_LIMIT),_0x237dc9=_0x573a8f,_0x352777=await resolveWorkspaceIdFromOptions(_0x237dc9,_0x2a7f18),_0x537f97=await withSpinner(_0x47eac3(0x192),()=>_0x2a7f18['engage'][_0x47eac3(0x1b8)]({'workspaceId':_0x352777,'limit':_0x3de31f}),{'verbose':_0x573a8f['verbose']});let _0x479dab=_0x537f97['data'];return _0x3e9178&&(_0x479dab=_0x537f97['data'][_0x47eac3(0x150)](_0x3fff91=>matchGlobPattern(_0x3fff91[_0x47eac3(0x156)],_0x3e9178))),await handleSDKOutput(_0x479dab,_0x573a8f),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x15c);[a16_0x34ce30(0x1ba)]='Show\x20email\x20template\x20details';async[a16_0x34ce30(0x1b7)](_0x1005a2){const _0xe11128=a16_0x34ce30,{options:_0x26344a,args:_0x10d8a2,tdx:_0x252dab}=_0x1005a2;if(_0x10d8a2[_0xe11128(0x160)]===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0xe11128(0x184)](_0xe11128(0x1bf)),0x1;const _0x3d04ea=_0x10d8a2[0x0],_0x89b78d=_0x26344a,_0x4f4455=await resolveWorkspaceIdFromOptions(_0x89b78d,_0x252dab),_0x38ac57=_0x89b78d[_0xe11128(0x16a)];if(_0x38ac57){const _0x4d0aec=await withSpinner(_0xe11128(0x144)+_0x3d04ea+'\x27...',()=>_0x252dab[_0xe11128(0x1cd)][_0xe11128(0x1a9)](_0x3d04ea,_0x4f4455),{'verbose':_0x26344a[_0xe11128(0x1c4)]});await handleSDKOutput([_0x4d0aec],_0x26344a);}else{const _0x5ee1a2=await withSpinner(_0xe11128(0x144)+_0x3d04ea+_0xe11128(0x1ae),()=>_0x252dab[_0xe11128(0x1cd)][_0xe11128(0x17a)](_0x3d04ea,_0x4f4455),{'verbose':_0x26344a[_0xe11128(0x1c4)]});await handleSDKOutput([_0x5ee1a2],_0x26344a);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x163);[a16_0x34ce30(0x1ba)]=a16_0x34ce30(0x1cb);async['execute'](_0x1a8c23){const _0x9b0307=a16_0x34ce30,{options:_0xa1bedb,tdx:_0xe0c908}=_0x1a8c23,_0x1b1c0e=_0xa1bedb,_0x3dacd7=_0x1b1c0e['name'],_0x372083=_0x1b1c0e['subject'],_0x3c7c5d=_0x1b1c0e[_0x9b0307(0x1a1)];if(!_0x3dacd7)return console[_0x9b0307(0x184)](_0x9b0307(0x17c)),console[_0x9b0307(0x184)](_0x9b0307(0x159)),0x1;if(!_0x372083)return console[_0x9b0307(0x184)](_0x9b0307(0x1c3)),0x1;if(!_0x3c7c5d)return console[_0x9b0307(0x184)](_0x9b0307(0x151)),0x1;const _0x390244=await resolveWorkspaceIdFromOptions(_0x1b1c0e,_0xe0c908,!![]),_0x181577={'name':_0x3dacd7,'subjectTemplate':_0x372083,'htmlTemplate':_0x3c7c5d,'workspaceId':_0x390244,'plaintextTemplate':_0x1b1c0e[_0x9b0307(0x14e)],'editorType':_0x1b1c0e[_0x9b0307(0x19a)]},_0x1353f4=await withSpinner('Creating\x20template\x20\x27'+_0x3dacd7+_0x9b0307(0x1ae),()=>_0xe0c908[_0x9b0307(0x1cd)]['createTemplate'](_0x181577));return await handleSDKOutput([_0x1353f4[_0x9b0307(0x157)]],_0xa1bedb),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x34ce30(0x156)]='engage:template:update';[a16_0x34ce30(0x1ba)]=a16_0x34ce30(0x1aa);async['execute'](_0x247271){const _0x4f656e=a16_0x34ce30,{options:_0x141643,args:_0x4c9b8a,tdx:_0x3255ef}=_0x247271;if(_0x4c9b8a[_0x4f656e(0x160)]===0x0)return console[_0x4f656e(0x184)](_0x4f656e(0x170)),console[_0x4f656e(0x184)](_0x4f656e(0x17d)),0x1;const _0x51d7bd=_0x4c9b8a[0x0],_0x37fb00=_0x141643,_0x19c98f=await resolveWorkspaceIdFromOptions(_0x37fb00,_0x3255ef),_0x21f67b={'name':_0x37fb00[_0x4f656e(0x156)],'subjectTemplate':_0x37fb00[_0x4f656e(0x19c)],'htmlTemplate':_0x37fb00['html'],'plaintextTemplate':_0x37fb00[_0x4f656e(0x14e)]},_0x567812=Object[_0x4f656e(0x178)](Object[_0x4f656e(0x1ab)](_0x21f67b)[_0x4f656e(0x150)](([,_0x469656])=>_0x469656!==undefined));if(Object[_0x4f656e(0x1cf)](_0x567812)[_0x4f656e(0x160)]===0x0)return console[_0x4f656e(0x184)](_0x4f656e(0x146)),console['error']('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x93ae5b=await withSpinner(_0x4f656e(0x16b)+_0x51d7bd+'\x27...',()=>_0x3255ef[_0x4f656e(0x1cd)][_0x4f656e(0x182)](_0x51d7bd,_0x567812,_0x19c98f),{'verbose':_0x141643[_0x4f656e(0x1c4)]});return await handleSDKOutput([_0x93ae5b['data']],_0x141643),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x158);[a16_0x34ce30(0x1ba)]='Delete\x20an\x20email\x20template';async[a16_0x34ce30(0x1b7)](_0x3a2f11){const _0x155980=a16_0x34ce30,{options:_0x280e18,args:_0x444326,tdx:_0x323c33}=_0x3a2f11;if(_0x444326[_0x155980(0x160)]===0x0)return console[_0x155980(0x184)](_0x155980(0x170)),console[_0x155980(0x184)](_0x155980(0x194)),0x1;const _0x529e59=_0x444326[0x0],_0x28212e=_0x280e18,_0x1658e4=await resolveWorkspaceIdFromOptions(_0x28212e,_0x323c33);if(!_0x280e18['yes']){const _0x54c8ac=await confirm(_0x155980(0x1ca)+_0x529e59+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x54c8ac)return console['log'](_0x155980(0x187)),0x0;}return await withSpinner(_0x155980(0x149)+_0x529e59+_0x155980(0x1ae),()=>_0x323c33[_0x155980(0x1cd)]['deleteTemplate'](_0x529e59,_0x1658e4),{'verbose':_0x280e18['verbose']}),console['log'](_0x155980(0x18b)+_0x529e59+_0x155980(0x1b4)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x196);[a16_0x34ce30(0x1ba)]=a16_0x34ce30(0x1ad);async[a16_0x34ce30(0x1b7)](_0x2bccf0){const _0x1940c6=a16_0x34ce30,{options:_0x1a66cc,args:_0x1bb880,tdx:_0xc42bb0}=_0x2bccf0,_0x43c323=_0x1bb880[0x0],_0x5b4756=resolveLimit(_0x1a66cc['limit'],DEFAULT_LLM_LIMIT),_0x5d815c=await withSpinner('Fetching\x20workspaces...',()=>_0xc42bb0['engage'][_0x1940c6(0x1bc)]({'limit':_0x5b4756}),{'verbose':_0x1a66cc[_0x1940c6(0x1c4)]});let _0x6fefb6=_0x5d815c[_0x1940c6(0x157)];return _0x43c323&&(_0x6fefb6=_0x5d815c[_0x1940c6(0x157)][_0x1940c6(0x150)](_0x36000c=>matchGlobPattern(_0x36000c[_0x1940c6(0x156)],_0x43c323))),await handleSDKOutput(_0x6fefb6,_0x1a66cc),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x1b6);[a16_0x34ce30(0x1ba)]=a16_0x34ce30(0x18f);async[a16_0x34ce30(0x1b7)](_0x3c4394){const _0x16f1fa=a16_0x34ce30,{options:_0x3f5743,args:_0x547cd8,tdx:_0x348fd3}=_0x3c4394;if(_0x547cd8[_0x16f1fa(0x160)]===0x0)return console[_0x16f1fa(0x184)](_0x16f1fa(0x174)),console[_0x16f1fa(0x184)](_0x16f1fa(0x14a)),0x1;const _0xfe8cc=_0x547cd8[0x0],_0x35a7a8=_0x3f5743,_0xa5d6f=_0x35a7a8[_0x16f1fa(0x16a)];if(_0xa5d6f){const _0x30e52b=await withSpinner(_0x16f1fa(0x155)+_0xfe8cc+_0x16f1fa(0x1ae),()=>_0x348fd3[_0x16f1fa(0x1cd)][_0x16f1fa(0x17e)](_0xfe8cc),{'verbose':_0x3f5743[_0x16f1fa(0x1c4)]});await handleSDKOutput([_0x30e52b],_0x3f5743);}else{const _0x4134be=await withSpinner('Fetching\x20workspace\x20\x27'+_0xfe8cc+_0x16f1fa(0x1ae),()=>_0x348fd3[_0x16f1fa(0x1cd)][_0x16f1fa(0x188)](_0xfe8cc),{'verbose':_0x3f5743[_0x16f1fa(0x1c4)]});await handleSDKOutput([_0x4134be],_0x3f5743);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x19b);['description']=a16_0x34ce30(0x162);async[a16_0x34ce30(0x1b7)](_0x13fdca){const _0x1d1ab2=a16_0x34ce30,{options:_0x47f0e0,tdx:_0x1690a4}=_0x13fdca,_0x127de5=_0x47f0e0,_0x387c92=_0x127de5[_0x1d1ab2(0x156)];if(!_0x387c92)return console[_0x1d1ab2(0x184)](_0x1d1ab2(0x17c)),console[_0x1d1ab2(0x184)](_0x1d1ab2(0x181)),0x1;const _0x34aa2d={'name':_0x387c92,'description':_0x127de5[_0x1d1ab2(0x1ba)]},_0x24f3aa=await withSpinner(_0x1d1ab2(0x180)+_0x387c92+_0x1d1ab2(0x1ae),()=>_0x1690a4[_0x1d1ab2(0x1cd)][_0x1d1ab2(0x193)](_0x34aa2d));return await handleSDKOutput([_0x24f3aa['data']],_0x47f0e0),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x1a6);[a16_0x34ce30(0x1ba)]=a16_0x34ce30(0x1a8);async[a16_0x34ce30(0x1b7)](_0x44d268){const _0x4a60d4=a16_0x34ce30,{options:_0x2be5d2,args:_0x41f33f,tdx:_0x50f0ff}=_0x44d268;if(_0x41f33f[_0x4a60d4(0x160)]===0x0)return console['error'](_0x4a60d4(0x174)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x594b63=_0x41f33f[0x0],_0x3b93ed=_0x2be5d2,_0x490531={'name':_0x3b93ed[_0x4a60d4(0x156)],'description':_0x3b93ed[_0x4a60d4(0x1ba)]},_0x6a6f93=Object[_0x4a60d4(0x178)](Object[_0x4a60d4(0x1ab)](_0x490531)[_0x4a60d4(0x150)](([,_0x40f004])=>_0x40f004!==undefined));if(Object[_0x4a60d4(0x1cf)](_0x6a6f93)[_0x4a60d4(0x160)]===0x0)return console[_0x4a60d4(0x184)](_0x4a60d4(0x146)),console[_0x4a60d4(0x184)](_0x4a60d4(0x19d)),0x1;const _0x3fcd4b=await withSpinner(_0x4a60d4(0x161)+_0x594b63+_0x4a60d4(0x1ae),()=>_0x50f0ff[_0x4a60d4(0x1cd)][_0x4a60d4(0x1b9)](_0x594b63,_0x6a6f93),{'verbose':_0x2be5d2['verbose']});return await handleSDKOutput([_0x3fcd4b['data']],_0x2be5d2),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x34ce30(0x156)]=a16_0x34ce30(0x15b);[a16_0x34ce30(0x1ba)]='Delete\x20a\x20workspace';async['execute'](_0x17930d){const _0x56c37e=a16_0x34ce30,{options:_0x2dd5db,args:_0x5847ce,tdx:_0x266322}=_0x17930d;if(_0x5847ce[_0x56c37e(0x160)]===0x0)return console[_0x56c37e(0x184)](_0x56c37e(0x174)),console[_0x56c37e(0x184)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x468af5=_0x5847ce[0x0];if(!_0x2dd5db[_0x56c37e(0x154)]){const _0x2a8fce=await confirm(_0x56c37e(0x199)+_0x468af5+_0x56c37e(0x1cc));if(!_0x2a8fce)return console[_0x56c37e(0x19f)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x56c37e(0x1d2)+_0x468af5+_0x56c37e(0x1ae),()=>_0x266322[_0x56c37e(0x1cd)][_0x56c37e(0x176)](_0x468af5),{'verbose':_0x2dd5db[_0x56c37e(0x1c4)]}),console[_0x56c37e(0x19f)]('Workspace\x20\x27'+_0x468af5+_0x56c37e(0x1b4)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a16_0x34ce30(0x1d1);['description']='Set\x20workspace\x20context\x20for\x20Engage\x20commands';async['execute'](_0x81500c){const _0x57a539=a16_0x34ce30,{options:_0x57cdfe,args:_0x18e8bb,tdx:_0x1e37b0}=_0x81500c;if(_0x18e8bb[_0x57a539(0x160)]===0x0)return console[_0x57a539(0x184)](_0x57a539(0x18a)),console[_0x57a539(0x184)](_0x57a539(0x1c5)),0x1;const _0xb88c4a=_0x18e8bb[0x0];await withSpinner(_0x57a539(0x191)+_0xb88c4a+_0x57a539(0x1ae),()=>_0x1e37b0[_0x57a539(0x1cd)][_0x57a539(0x195)](_0xb88c4a));const _0x461dfc=_0x57cdfe[_0x57a539(0x167)]||undefined;return saveSessionContext({'engage_workspace':_0xb88c4a},_0x461dfc),console[_0x57a539(0x19f)](_0x57a539(0x1a5)+_0xb88c4a),console[_0x57a539(0x19f)](_0x57a539(0x166)),0x0;}}
@@ -1 +1 @@
1
- function a17_0x4512(){const _0x32f3d0=['Error:\x20','Getting\x20job\x20results...','Show\x20job\x20details','49670Oprjgu','\x27\x20to\x20verify\x20the\x20job\x20status','start_at','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','url','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','message','Limit:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','created_at','kill','substring','Get\x20job\x20results','job:kill','limit','round','\x20\x20Job\x20ID:\x20','query','Submit\x20a\x20job','Error:\x20Query\x20is\x20required','βœ”\x20Job\x20submitted','type','105987seGsPv','Usage:\x20job\x20show\x20<job-id>','show','\x20\x20Cause:\x20','Query:\x20','3378OwtJya','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','job:show','yes','\x20row','48QloSHI','data','jobs','description','debug','3990304mxdhbQ','job_id','Submitting\x20job...','βœ”\x20Retrieved\x20','status','Listing\x20jobs...','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Usage:\x20job\x20result\x20<job-id>','492440shIirn','name','user_name','32876rLKIjk','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','\x20job','information_schema','length','priority','error','verbose','Status\x20filter:\x20','βœ”\x20Kill\x20request\x20submitted\x20for\x20job\x20','352gcHIeF','job:result','cause','420mmWUTH','end_at','Error:\x20Job\x20ID\x20is\x20required','job:submit','Job\x20type:\x20','execute','βœ”\x20Found\x20','3058452DscRJz','getTime','database','93JjARvo','result'];a17_0x4512=function(){return _0x32f3d0;};return a17_0x4512();}const a17_0x407ef7=a17_0x2246;(function(_0x258586,_0x30a6b6){const _0x242dec=a17_0x2246,_0x416d1c=_0x258586();while(!![]){try{const _0x5eefe0=-parseInt(_0x242dec(0x1c0))/0x1*(-parseInt(_0x242dec(0x19e))/0x2)+-parseInt(_0x242dec(0x17d))/0x3*(-parseInt(_0x242dec(0x1b3))/0x4)+parseInt(_0x242dec(0x1b0))/0x5*(-parseInt(_0x242dec(0x1a3))/0x6)+-parseInt(_0x242dec(0x199))/0x7+parseInt(_0x242dec(0x1a8))/0x8+-parseInt(_0x242dec(0x17a))/0x9+parseInt(_0x242dec(0x182))/0xa*(parseInt(_0x242dec(0x1bd))/0xb);if(_0x5eefe0===_0x30a6b6)break;else _0x416d1c['push'](_0x416d1c['shift']());}catch(_0x539a49){_0x416d1c['push'](_0x416d1c['shift']());}}}(a17_0x4512,0x74f34));import{BaseCommand}from'./command.js';import{SDKError}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']=a17_0x407ef7(0x1a5);[a17_0x407ef7(0x1a6)]='List\x20jobs';async['execute'](_0x5c2c5c){const _0x2a85ff=a17_0x407ef7,{options:_0x4620e0,tdx:_0x8b48f8}=_0x5c2c5c;try{const _0x212077=resolveLimit(_0x4620e0[_0x2a85ff(0x191)],DEFAULT_DISPLAY_LIMIT),_0x29d041=_0x4620e0[_0x2a85ff(0x1ac)];_0x4620e0['verbose']&&(console[_0x2a85ff(0x1b9)](_0x2a85ff(0x189)+_0x212077+'\x20jobs'),_0x29d041&&console[_0x2a85ff(0x1b9)](_0x2a85ff(0x1bb)+_0x29d041));const _0xc38a38=await withSpinner(_0x2a85ff(0x1ad),()=>_0x8b48f8['jobs']['list']({'from':0x0,'to':_0x212077-0x1,'status':_0x29d041}),{'verbose':_0x4620e0[_0x2a85ff(0x1ba)]}),_0x376b2d=_0xc38a38['data'];console[_0x2a85ff(0x1b9)](_0x2a85ff(0x179)+_0x376b2d['length']+_0x2a85ff(0x1b5)+(_0x376b2d['length']!==0x1?'s':''));const _0x14a933=_0x376b2d['map'](_0x562706=>{const _0x53fb39=_0x2a85ff;let _0x52f635;if(_0x562706['start_at']&&_0x562706[_0x53fb39(0x1c1)]){const _0x40d931=new Date(_0x562706[_0x53fb39(0x184)])[_0x53fb39(0x17b)](),_0x20dd80=new Date(_0x562706['end_at'])[_0x53fb39(0x17b)]();_0x52f635=Math[_0x53fb39(0x192)]((_0x20dd80-_0x40d931)/0x3e8);}return{'job_id':_0x562706[_0x53fb39(0x1a9)],'type':_0x562706[_0x53fb39(0x198)],'status':_0x562706[_0x53fb39(0x1ac)],'user_name':_0x562706[_0x53fb39(0x1b2)],'duration_sec':_0x52f635,'created_at':_0x562706[_0x53fb39(0x18c)],'started_at':_0x562706[_0x53fb39(0x184)],'end_at':_0x562706['end_at']};});return await handleSDKOutput(_0x14a933,_0x4620e0),0x0;}catch(_0x16825){if(_0x16825 instanceof SDKError)return console[_0x2a85ff(0x1b9)]('Error:\x20'+_0x16825[_0x2a85ff(0x188)]),_0x16825[_0x2a85ff(0x1bf)]&&console[_0x2a85ff(0x1b9)](_0x2a85ff(0x19c)+_0x16825[_0x2a85ff(0x1bf)]),0x1;throw _0x16825;}}}export class JobShowCommand extends BaseCommand{[a17_0x407ef7(0x1b1)]=a17_0x407ef7(0x1a0);['description']=a17_0x407ef7(0x181);async[a17_0x407ef7(0x178)](_0x5848ec){const _0x4f9108=a17_0x407ef7,{options:_0x8fd261,args:_0x1d37cb,tdx:_0x769971}=_0x5848ec,_0x1dca61=_0x1d37cb[0x0];if(!_0x1dca61)return console[_0x4f9108(0x1b9)](_0x4f9108(0x1c2)),console['error'](_0x4f9108(0x19a)),0x1;try{const _0x57104c=await withSpinner('Getting\x20job\x20details...',()=>_0x769971['jobs'][_0x4f9108(0x19b)](_0x1dca61),{'verbose':_0x8fd261['verbose']}),_0x149213=_0x57104c['data'];let _0x376055;if(_0x149213[_0x4f9108(0x184)]&&_0x149213[_0x4f9108(0x1c1)]){const _0x39541d=new Date(_0x149213[_0x4f9108(0x184)])['getTime'](),_0x9bd20d=new Date(_0x149213[_0x4f9108(0x1c1)])[_0x4f9108(0x17b)]();_0x376055=Math[_0x4f9108(0x192)]((_0x9bd20d-_0x39541d)/0x3e8);}const _0x30fabf={'job_id':_0x149213[_0x4f9108(0x1a9)],'type':_0x149213[_0x4f9108(0x198)],'status':_0x149213[_0x4f9108(0x1ac)],..._0x149213[_0x4f9108(0x1b2)]&&{'user_name':_0x149213['user_name']},..._0x376055!==undefined&&{'duration_sec':_0x376055},..._0x149213[_0x4f9108(0x18c)]&&{'created_at':_0x149213[_0x4f9108(0x18c)]},..._0x149213[_0x4f9108(0x184)]&&{'started_at':_0x149213[_0x4f9108(0x184)]},..._0x149213[_0x4f9108(0x1c1)]&&{'end_at':_0x149213['end_at']},..._0x149213[_0x4f9108(0x17c)]&&{'database':_0x149213[_0x4f9108(0x17c)]},..._0x149213[_0x4f9108(0x1b8)]!==undefined&&{'priority':_0x149213[_0x4f9108(0x1b8)]},..._0x149213[_0x4f9108(0x186)]&&{'url':_0x149213['url']},..._0x149213['query']&&{'query':_0x149213[_0x4f9108(0x194)]},..._0x149213[_0x4f9108(0x1a7)]&&{'debug':_0x149213['debug']}};return await handleSingleObjectOutput(_0x30fabf,_0x8fd261),0x0;}catch(_0x2b962c){if(_0x2b962c instanceof SDKError)return console[_0x4f9108(0x1b9)]('Error:\x20'+_0x2b962c[_0x4f9108(0x188)]),_0x2b962c['cause']&&console[_0x4f9108(0x1b9)](_0x4f9108(0x19c)+_0x2b962c[_0x4f9108(0x1bf)]),0x1;throw _0x2b962c;}}}export class JobKillCommand extends BaseCommand{[a17_0x407ef7(0x1b1)]=a17_0x407ef7(0x190);['description']='Kill\x20a\x20job';async[a17_0x407ef7(0x178)](_0x3299a7){const _0xd4c9eb=a17_0x407ef7,{options:_0x7c0a15,args:_0x2c07dc,tdx:_0x4e14cc}=_0x3299a7,_0x473568=_0x2c07dc[0x0];if(!_0x473568)return console[_0xd4c9eb(0x1b9)](_0xd4c9eb(0x1c2)),console[_0xd4c9eb(0x1b9)]('Usage:\x20job\x20kill\x20<job-id>'),0x1;try{if(!_0x7c0a15[_0xd4c9eb(0x1a1)]){const _0x566352=await confirm(_0xd4c9eb(0x18a)+_0x473568+'?');if(!_0x566352)return console[_0xd4c9eb(0x1b9)]('Cancelled'),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x4e14cc[_0xd4c9eb(0x1a5)][_0xd4c9eb(0x18d)](_0x473568),{'verbose':_0x7c0a15[_0xd4c9eb(0x1ba)]}),console[_0xd4c9eb(0x1b9)](_0xd4c9eb(0x1bc)+_0x473568),console['error'](_0xd4c9eb(0x185)+_0x473568+_0xd4c9eb(0x183)),0x0;}catch(_0x4dae8a){if(_0x4dae8a instanceof SDKError)return console[_0xd4c9eb(0x1b9)](_0xd4c9eb(0x17f)+_0x4dae8a[_0xd4c9eb(0x188)]),_0x4dae8a[_0xd4c9eb(0x1bf)]&&console[_0xd4c9eb(0x1b9)]('\x20\x20Cause:\x20'+_0x4dae8a['cause']),0x1;throw _0x4dae8a;}}}function a17_0x2246(_0x186425,_0x265ddf){_0x186425=_0x186425-0x178;const _0x45129d=a17_0x4512();let _0x2246ae=_0x45129d[_0x186425];return _0x2246ae;}export class JobSubmitCommand extends BaseCommand{[a17_0x407ef7(0x1b1)]=a17_0x407ef7(0x1c3);[a17_0x407ef7(0x1a6)]=a17_0x407ef7(0x195);async['execute'](_0x1c8f37){const _0x3b0bfa=a17_0x407ef7,{options:_0x4c949a,args:_0x3e0147,tdx:_0x2b7ae8}=_0x1c8f37;try{const _0x2cec28=_0x4c949a['jobType']||'trino',_0x287fd1=_0x4c949a['file'],_0x2bfcd8=_0x4c949a[_0x3b0bfa(0x17c)]||_0x3b0bfa(0x1b6);if(_0x2cec28!=='trino'&&_0x2cec28!=='hive')return console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x19f)),0x1;let _0x1e00aa;if(_0x287fd1){if(_0x3e0147[0x0])return console['error'](_0x3b0bfa(0x18b)),0x1;const _0x1777a1=readSqlStatementsFromFile(_0x287fd1);if(_0x1777a1[_0x3b0bfa(0x1b7)]===0x0)return console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x187)),0x1;if(_0x1777a1[_0x3b0bfa(0x1b7)]>0x1)return console['error'](_0x3b0bfa(0x1ae)),0x1;_0x1e00aa=_0x1777a1[0x0];}else{if(!_0x3e0147[0x0])return console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x196)),console['error'](_0x3b0bfa(0x1b4)),0x1;_0x1e00aa=_0x3e0147[0x0];}_0x4c949a['verbose']&&(console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x1c4)+_0x2cec28),console['error']('Database:\x20'+_0x2bfcd8),console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x19d)+_0x1e00aa[_0x3b0bfa(0x18e)](0x0,0x64)+(_0x1e00aa['length']>0x64?'...':'')));const _0x468049=await withSpinner(_0x3b0bfa(0x1aa),()=>_0x2b7ae8[_0x3b0bfa(0x1a5)]['submit'](_0x2bfcd8,_0x1e00aa,_0x2cec28),{'verbose':_0x4c949a[_0x3b0bfa(0x1ba)]}),_0x52a147=_0x468049[_0x3b0bfa(0x1a4)];return console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x197)),console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x193)+_0x52a147[_0x3b0bfa(0x1a9)]),await handleSDKOutput([_0x52a147],_0x4c949a),0x0;}catch(_0x4fb4bb){if(_0x4fb4bb instanceof SDKError)return console[_0x3b0bfa(0x1b9)]('Error:\x20'+_0x4fb4bb[_0x3b0bfa(0x188)]),_0x4fb4bb[_0x3b0bfa(0x1bf)]&&console['error'](_0x3b0bfa(0x19c)+_0x4fb4bb['cause']),0x1;throw _0x4fb4bb;}}}export class JobResultCommand extends BaseCommand{['name']=a17_0x407ef7(0x1be);[a17_0x407ef7(0x1a6)]=a17_0x407ef7(0x18f);async[a17_0x407ef7(0x178)](_0x1aa4f1){const _0x176279=a17_0x407ef7,{options:_0x2d1fc6,args:_0x2aeafe,tdx:_0x2807d9}=_0x1aa4f1,_0x1774de=_0x2aeafe[0x0];if(!_0x1774de)return console[_0x176279(0x1b9)](_0x176279(0x1c2)),console[_0x176279(0x1b9)](_0x176279(0x1af)),0x1;try{const _0x3381ee=await withSpinner(_0x176279(0x180),()=>_0x2807d9[_0x176279(0x1a5)][_0x176279(0x17e)](_0x1774de),{'verbose':_0x2d1fc6['verbose']}),_0x28cb14=_0x3381ee[_0x176279(0x1a4)];return console['error'](_0x176279(0x1ab)+_0x28cb14['length']+_0x176279(0x1a2)+(_0x28cb14[_0x176279(0x1b7)]!==0x1?'s':'')),await handleSDKOutput(_0x28cb14,_0x2d1fc6),0x0;}catch(_0x1c03c2){if(_0x1c03c2 instanceof SDKError)return console[_0x176279(0x1b9)](_0x176279(0x17f)+_0x1c03c2[_0x176279(0x188)]),_0x1c03c2[_0x176279(0x1bf)]&&console[_0x176279(0x1b9)](_0x176279(0x19c)+_0x1c03c2[_0x176279(0x1bf)]),0x1;throw _0x1c03c2;}}}
1
+ function a17_0x525e(_0x1b0eca,_0x2f6543){_0x1b0eca=_0x1b0eca-0x9e;const _0x3a6321=a17_0x3a63();let _0x525e24=_0x3a6321[_0x1b0eca];return _0x525e24;}const a17_0x285966=a17_0x525e;(function(_0x22b6e3,_0x4b81d0){const _0x1f6889=a17_0x525e,_0x3c9063=_0x22b6e3();while(!![]){try{const _0x4aa8d5=-parseInt(_0x1f6889(0xa8))/0x1+-parseInt(_0x1f6889(0xa1))/0x2*(-parseInt(_0x1f6889(0xd5))/0x3)+-parseInt(_0x1f6889(0xd1))/0x4+-parseInt(_0x1f6889(0xc6))/0x5+parseInt(_0x1f6889(0xca))/0x6*(-parseInt(_0x1f6889(0xe5))/0x7)+parseInt(_0x1f6889(0xc2))/0x8*(parseInt(_0x1f6889(0xa6))/0x9)+-parseInt(_0x1f6889(0xa5))/0xa*(-parseInt(_0x1f6889(0xcf))/0xb);if(_0x4aa8d5===_0x4b81d0)break;else _0x3c9063['push'](_0x3c9063['shift']());}catch(_0x295cd9){_0x3c9063['push'](_0x3c9063['shift']());}}}(a17_0x3a63,0x73ce8));import{BaseCommand}from'./command.js';import{SDKError}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{[a17_0x285966(0x9f)]=a17_0x285966(0xe6);[a17_0x285966(0xb7)]=a17_0x285966(0xa0);async[a17_0x285966(0xde)](_0x58f770){const _0x7cd621=a17_0x285966,{options:_0x515366,tdx:_0x268685}=_0x58f770;try{const _0x39db77=resolveLimit(_0x515366[_0x7cd621(0xe9)],DEFAULT_DISPLAY_LIMIT),_0x199aa8=_0x515366[_0x7cd621(0xe7)];_0x515366[_0x7cd621(0xe4)]&&(console['error'](_0x7cd621(0xb8)+_0x39db77+_0x7cd621(0xae)),_0x199aa8&&console[_0x7cd621(0xb6)](_0x7cd621(0xbc)+_0x199aa8));const _0x20cfdb=await withSpinner(_0x7cd621(0xce),()=>_0x268685[_0x7cd621(0xe6)]['list']({'from':0x0,'to':_0x39db77-0x1,'status':_0x199aa8}),{'verbose':_0x515366[_0x7cd621(0xe4)]}),_0x3ec373=_0x20cfdb['data'];console[_0x7cd621(0xb6)](_0x7cd621(0xd8)+_0x3ec373[_0x7cd621(0xab)]+_0x7cd621(0xc1)+(_0x3ec373[_0x7cd621(0xab)]!==0x1?'s':''));const _0x2bd4f3=_0x3ec373[_0x7cd621(0xaa)](_0x5acf3a=>{const _0x5ce9f9=_0x7cd621;let _0xb6b110;if(_0x5acf3a['start_at']&&_0x5acf3a[_0x5ce9f9(0x9e)]){const _0x1f87b0=new Date(_0x5acf3a[_0x5ce9f9(0xdb)])[_0x5ce9f9(0xb9)](),_0x432ae6=new Date(_0x5acf3a['end_at'])['getTime']();_0xb6b110=Math[_0x5ce9f9(0xc9)]((_0x432ae6-_0x1f87b0)/0x3e8);}return{'job_id':_0x5acf3a['job_id'],'type':_0x5acf3a[_0x5ce9f9(0xd0)],'status':_0x5acf3a[_0x5ce9f9(0xe7)],'user_name':_0x5acf3a[_0x5ce9f9(0xa3)],'duration_sec':_0xb6b110,'created_at':_0x5acf3a[_0x5ce9f9(0xe2)],'started_at':_0x5acf3a[_0x5ce9f9(0xdb)],'end_at':_0x5acf3a[_0x5ce9f9(0x9e)]};});return await handleSDKOutput(_0x2bd4f3,_0x515366),0x0;}catch(_0x589196){if(_0x589196 instanceof SDKError)return console[_0x7cd621(0xb6)](_0x7cd621(0xc7)+_0x589196[_0x7cd621(0xa2)]),_0x589196['cause']&&console['error'](_0x7cd621(0xb5)+_0x589196[_0x7cd621(0xc4)]),0x1;throw _0x589196;}}}export class JobShowCommand extends BaseCommand{[a17_0x285966(0x9f)]=a17_0x285966(0xa9);[a17_0x285966(0xb7)]='Show\x20job\x20details';async[a17_0x285966(0xde)](_0x5ab2cf){const _0x5272a6=a17_0x285966,{options:_0x17e69d,args:_0x3da296,tdx:_0x3e29f7}=_0x5ab2cf,_0x1fb93e=_0x3da296[0x0];if(!_0x1fb93e)return console[_0x5272a6(0xb6)]('Error:\x20Job\x20ID\x20is\x20required'),console['error'](_0x5272a6(0xc8)),0x1;try{const _0x4c0033=await withSpinner('Getting\x20job\x20details...',()=>_0x3e29f7[_0x5272a6(0xe6)][_0x5272a6(0xac)](_0x1fb93e),{'verbose':_0x17e69d[_0x5272a6(0xe4)]}),_0x460376=_0x4c0033[_0x5272a6(0xcd)];let _0x2a0976;if(_0x460376[_0x5272a6(0xdb)]&&_0x460376['end_at']){const _0x5c003e=new Date(_0x460376[_0x5272a6(0xdb)])[_0x5272a6(0xb9)](),_0x384883=new Date(_0x460376['end_at'])['getTime']();_0x2a0976=Math[_0x5272a6(0xc9)]((_0x384883-_0x5c003e)/0x3e8);}const _0x4ebc09={'job_id':_0x460376['job_id'],'type':_0x460376[_0x5272a6(0xd0)],'status':_0x460376[_0x5272a6(0xe7)],..._0x460376[_0x5272a6(0xa3)]&&{'user_name':_0x460376[_0x5272a6(0xa3)]},..._0x2a0976!==undefined&&{'duration_sec':_0x2a0976},..._0x460376[_0x5272a6(0xe2)]&&{'created_at':_0x460376['created_at']},..._0x460376[_0x5272a6(0xdb)]&&{'started_at':_0x460376['start_at']},..._0x460376[_0x5272a6(0x9e)]&&{'end_at':_0x460376[_0x5272a6(0x9e)]},..._0x460376[_0x5272a6(0xaf)]&&{'database':_0x460376[_0x5272a6(0xaf)]},..._0x460376[_0x5272a6(0xbf)]!==undefined&&{'priority':_0x460376[_0x5272a6(0xbf)]},..._0x460376[_0x5272a6(0xcc)]&&{'url':_0x460376[_0x5272a6(0xcc)]},..._0x460376[_0x5272a6(0xc3)]&&{'query':_0x460376[_0x5272a6(0xc3)]},..._0x460376['debug']&&{'debug':_0x460376[_0x5272a6(0xea)]}};return await handleSingleObjectOutput(_0x4ebc09,_0x17e69d),0x0;}catch(_0x3b53d2){if(_0x3b53d2 instanceof SDKError)return console['error'](_0x5272a6(0xc7)+_0x3b53d2[_0x5272a6(0xa2)]),_0x3b53d2[_0x5272a6(0xc4)]&&console['error']('\x20\x20Cause:\x20'+_0x3b53d2[_0x5272a6(0xc4)]),0x1;throw _0x3b53d2;}}}export class JobKillCommand extends BaseCommand{[a17_0x285966(0x9f)]=a17_0x285966(0xd4);[a17_0x285966(0xb7)]='Kill\x20a\x20job';async['execute'](_0x485633){const _0x4e3ed0=a17_0x285966,{options:_0x3c75eb,args:_0x2cc576,tdx:_0x192977}=_0x485633,_0x112418=_0x2cc576[0x0];if(!_0x112418)return console[_0x4e3ed0(0xb6)](_0x4e3ed0(0xdd)),console[_0x4e3ed0(0xb6)](_0x4e3ed0(0xdf)),0x1;try{if(!_0x3c75eb[_0x4e3ed0(0xad)]){const _0x1e9ad9=await confirm(_0x4e3ed0(0xd3)+_0x112418+'?');if(!_0x1e9ad9)return console[_0x4e3ed0(0xb6)]('Cancelled'),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x192977[_0x4e3ed0(0xe6)][_0x4e3ed0(0xd2)](_0x112418),{'verbose':_0x3c75eb[_0x4e3ed0(0xe4)]}),console['error']('βœ”\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x112418),console[_0x4e3ed0(0xb6)](_0x4e3ed0(0xb0)+_0x112418+_0x4e3ed0(0xd9)),0x0;}catch(_0x3de2cc){if(_0x3de2cc instanceof SDKError)return console['error'](_0x4e3ed0(0xc7)+_0x3de2cc['message']),_0x3de2cc['cause']&&console[_0x4e3ed0(0xb6)](_0x4e3ed0(0xb5)+_0x3de2cc[_0x4e3ed0(0xc4)]),0x1;throw _0x3de2cc;}}}export class JobSubmitCommand extends BaseCommand{[a17_0x285966(0x9f)]='job:submit';[a17_0x285966(0xb7)]='Submit\x20a\x20job';async[a17_0x285966(0xde)](_0x2a2c65){const _0x4b8ab1=a17_0x285966,{options:_0x57a418,args:_0x2877af,tdx:_0xfa4080}=_0x2a2c65;try{const _0x594fdc=_0x57a418[_0x4b8ab1(0xcb)]||_0x4b8ab1(0xb3),_0xeec8c2=_0x57a418['file'],_0x3f6a7f=_0x57a418['database']||_0x4b8ab1(0xbd);if(_0x594fdc!==_0x4b8ab1(0xb3)&&_0x594fdc!==_0x4b8ab1(0xe1))return console[_0x4b8ab1(0xb6)](_0x4b8ab1(0xbe)),0x1;let _0xa243a;if(_0xeec8c2){if(_0x2877af[0x0])return console[_0x4b8ab1(0xb6)](_0x4b8ab1(0xb2)),0x1;const _0x1c9ea0=readSqlStatementsFromFile(_0xeec8c2);if(_0x1c9ea0['length']===0x0)return console[_0x4b8ab1(0xb6)](_0x4b8ab1(0xc0)),0x1;if(_0x1c9ea0[_0x4b8ab1(0xab)]>0x1)return console[_0x4b8ab1(0xb6)]('Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'),0x1;_0xa243a=_0x1c9ea0[0x0];}else{if(!_0x2877af[0x0])return console['error'](_0x4b8ab1(0xe8)),console[_0x4b8ab1(0xb6)](_0x4b8ab1(0xba)),0x1;_0xa243a=_0x2877af[0x0];}_0x57a418[_0x4b8ab1(0xe4)]&&(console['error']('Job\x20type:\x20'+_0x594fdc),console[_0x4b8ab1(0xb6)](_0x4b8ab1(0xdc)+_0x3f6a7f),console[_0x4b8ab1(0xb6)]('Query:\x20'+_0xa243a['substring'](0x0,0x64)+(_0xa243a[_0x4b8ab1(0xab)]>0x64?_0x4b8ab1(0xd7):'')));const _0x43a9a2=await withSpinner(_0x4b8ab1(0xc5),()=>_0xfa4080['jobs'][_0x4b8ab1(0xe0)](_0x3f6a7f,_0xa243a,_0x594fdc),{'verbose':_0x57a418[_0x4b8ab1(0xe4)]}),_0x580245=_0x43a9a2[_0x4b8ab1(0xcd)];return console[_0x4b8ab1(0xb6)](_0x4b8ab1(0xda)),console[_0x4b8ab1(0xb6)](_0x4b8ab1(0xa7)+_0x580245[_0x4b8ab1(0xe3)]),await handleSDKOutput([_0x580245],_0x57a418),0x0;}catch(_0xc32294){if(_0xc32294 instanceof SDKError)return console[_0x4b8ab1(0xb6)]('Error:\x20'+_0xc32294[_0x4b8ab1(0xa2)]),_0xc32294[_0x4b8ab1(0xc4)]&&console['error'](_0x4b8ab1(0xb5)+_0xc32294[_0x4b8ab1(0xc4)]),0x1;throw _0xc32294;}}}export class JobResultCommand extends BaseCommand{[a17_0x285966(0x9f)]=a17_0x285966(0xa4);[a17_0x285966(0xb7)]='Get\x20job\x20results';async[a17_0x285966(0xde)](_0x3971cf){const _0x5a809f=a17_0x285966,{options:_0x5c00a5,args:_0x9abb98,tdx:_0x5c47e5}=_0x3971cf,_0x3d931b=_0x9abb98[0x0];if(!_0x3d931b)return console[_0x5a809f(0xb6)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x5a809f(0xb6)](_0x5a809f(0xd6)),0x1;try{const _0x3c43dd=await withSpinner(_0x5a809f(0xb1),()=>_0x5c47e5[_0x5a809f(0xe6)][_0x5a809f(0xbb)](_0x3d931b),{'verbose':_0x5c00a5[_0x5a809f(0xe4)]}),_0x5dfabe=_0x3c43dd['data'];return console['error'](_0x5a809f(0xb4)+_0x5dfabe[_0x5a809f(0xab)]+'\x20row'+(_0x5dfabe[_0x5a809f(0xab)]!==0x1?'s':'')),await handleSDKOutput(_0x5dfabe,_0x5c00a5),0x0;}catch(_0x47f6f5){if(_0x47f6f5 instanceof SDKError)return console[_0x5a809f(0xb6)](_0x5a809f(0xc7)+_0x47f6f5['message']),_0x47f6f5['cause']&&console[_0x5a809f(0xb6)](_0x5a809f(0xb5)+_0x47f6f5[_0x5a809f(0xc4)]),0x1;throw _0x47f6f5;}}}function a17_0x3a63(){const _0x4214b1=['\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Getting\x20job\x20results...','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','trino','βœ”\x20Retrieved\x20','\x20\x20Cause:\x20','error','description','Limit:\x20','getTime','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','result','Status\x20filter:\x20','information_schema','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','priority','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','\x20job','144SYvmbT','query','cause','Submitting\x20job...','1670280lbifre','Error:\x20','Usage:\x20job\x20show\x20<job-id>','round','2313702SmufqV','jobType','url','data','Listing\x20jobs...','9548YJyVsX','type','3088268tDYFCG','kill','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','job:kill','12105KcIGDu','Usage:\x20job\x20result\x20<job-id>','...','βœ”\x20Found\x20','\x27\x20to\x20verify\x20the\x20job\x20status','βœ”\x20Job\x20submitted','start_at','Database:\x20','Error:\x20Job\x20ID\x20is\x20required','execute','Usage:\x20job\x20kill\x20<job-id>','submit','hive','created_at','job_id','verbose','7OzmlPr','jobs','status','Error:\x20Query\x20is\x20required','limit','debug','end_at','name','List\x20jobs','258SvKGxM','message','user_name','job:result','22110UvlmTu','88713gZFAkZ','\x20\x20Job\x20ID:\x20','651005qaxLeX','job:show','map','length','show','yes','\x20jobs','database'];a17_0x3a63=function(){return _0x4214b1;};return a17_0x3a63();}
@@ -1 +1 @@
1
- const a18_0x1f87e3=a18_0x61b5;(function(_0x1e6c7d,_0x1419c4){const _0x27cc0d=a18_0x61b5,_0x5d7756=_0x1e6c7d();while(!![]){try{const _0x3e4bfe=-parseInt(_0x27cc0d(0x7b))/0x1*(parseInt(_0x27cc0d(0x79))/0x2)+parseInt(_0x27cc0d(0x82))/0x3+parseInt(_0x27cc0d(0x9d))/0x4+-parseInt(_0x27cc0d(0x90))/0x5+parseInt(_0x27cc0d(0x8f))/0x6+-parseInt(_0x27cc0d(0x143))/0x7*(-parseInt(_0x27cc0d(0xa3))/0x8)+-parseInt(_0x27cc0d(0x8d))/0x9;if(_0x3e4bfe===_0x1419c4)break;else _0x5d7756['push'](_0x5d7756['shift']());}catch(_0x4ba414){_0x5d7756['push'](_0x5d7756['shift']());}}}(a18_0x2663,0x38884));import a18_0x45756c from'chalk';import a18_0x965be4 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';function a18_0x61b5(_0x179129,_0x456d78){_0x179129=_0x179129-0x75;const _0x26638e=a18_0x2663();let _0x61b52=_0x26638e[_0x179129];return _0x61b52;}function a18_0x2663(){const _0x23987f=['helpText','launched','segmentPushCommand','24jCcSfG','Getting\x20journey\x20statistics...','25303bEMlck','\x20\x20Statistics\x20not\x20available','parentSegment','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Aborted.','type','getSegment','1030419fIHOou','versionNumber','dryRun','segments','get','includeStats','Cancelled','journeyBundleName','(root)','resolveParentId','red','1917162bkHmBP','\x20(rule\x20match)','376836ndOAlk','1484425DAPYhJ','βœ”\x20Context\x20set:\x20','\x20\x20Target:\x20','journey:stats','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20files?','dim','resourceName','Folder\x20path:\x20','totalGoalAchieved','Found\x20','journey','1006968OCFiMG','Warning:\x20Stage\x20\x22','\x20Opening\x20','Show\x20journey\x20details','session','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','16CFvJvH','\x20new\x20files','βœ”\x20Found\x20','Error:\x20Parent\x20segment\x20context\x20required','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Write\x20','draft','listJourneysFromParentSegment','map','/e/','Options:','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','audienceId','resolveJourneyId','Usage:\x20journey\x20resume\x20<name-or-path>','description','file','\x20journey','all','\x20(paused)','stringify','sort','\x20=\x20','pause','Error:\x20','yellow','\x20\x20Folder\x20path:\x20','state','log','Resolving\x20parent\x20segment...','\x20journeys','absolutePath','table','Resolved\x20YAML\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','getActivation','json','Parent\x20segment:\x20','Resuming\x20journey...','INVALID_ARGUMENT','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','listFolders','archived','error','join','values','\x20versions)','activationParams','Usage:\x20journey\x20stats\x20<name-or-path>','activation_','stages','Journey\x20name:\x20','\x20unchanged\x20files','site','hasChanges','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Fetching\x20folders...','message','\x27\x20not\x20found\x20in\x20','paused','journey:list','name','\x20\x20Parent\x20segment:\x20','getJourney','connector_config','Pausing\x20journey...','journeyBundleId','size','population','attributes','...','relativePath','cyan','/app/ps/','Error:\x20Journey\x20\x27','split','resolveSegment','Export\x20journey(s)\x20as\x20YAML\x20files','stage','journeyName','No\x20journeys\x20found','/j/da','\x20(ID:\x20','yes','verbose','No\x20statistics\x20available\x20for\x20journey:\x20','errorCode','test','setPhase','connection','\x20\x20Name:\x20','execute','Input:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','folderId','format','content','add','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','resume','has','options','Resolving\x20journey...','toLowerCase','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','set','segmentName','then','buildIdToEmailMap','getStatistics','Target\x20directory:\x20','no_parent','relative','parent_segment','entered','goalRate','journey:resume','πŸ“\x20','Listing\x20journeys...','user','conversionRate','push','segment','\x0aPull\x20summary:','journey:pull','.yml','web','List\x20journeys\x20in\x20current\x20context','totalEntered','isNew','Pause\x20a\x20running\x20journey','stageName','/j/da/je','\x20\x20-\x20','\x22\x20not\x20found','green','kind','filePath','Error:\x20Journey\x20not\x20found:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','\x22\x20paused','utf-8','rule','Resume\x20a\x20paused\x20journey','journeyId','Fetching\x20parent\x20segment...','Fetching\x20','exited','Warning:\x20Could\x20not\x20resolve\x20activation\x20','journey:push','folderPath','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','reentryMode','filter','βœ”\x20Journey\x20\x22','data','repeat','cwd','1354759tzRIat','goal','length','find','\x0aChanges\x20to\x20\x27','Usage:\x20journey\x20pause\x20<name-or-path>','rootFolderId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','root\x20folder','\x5c$&'];a18_0x2663=function(){return _0x23987f;};return a18_0x2663();}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey}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{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';function formatJourneyState(_0x2525d6){const _0x541b78=a18_0x61b5;switch(_0x2525d6){case _0x541b78(0x77):return a18_0x45756c['green'](_0x2525d6);case _0x541b78(0xa9):return a18_0x45756c['gray'](_0x2525d6);case _0x541b78(0xce):return a18_0x45756c[_0x541b78(0x97)](_0x2525d6);default:return _0x2525d6;}}function formatJourneyItem(_0x5af528,_0x3df9c6='',_0x428844){const _0xc1c9e5=a18_0x61b5,_0x330961=formatJourneyState(_0x5af528[_0xc1c9e5(0xbe)]),_0x1ab85d=_0x5af528[_0xc1c9e5(0xdf)]?a18_0x45756c[_0xc1c9e5(0xbc)](_0xc1c9e5(0xb6)):'',_0x55303f=_0x428844?'\x20'+a18_0x45756c[_0xc1c9e5(0xec)](_0x428844):'';return _0x3df9c6+'πŸ—ΊοΈ\x20'+_0x5af528[_0xc1c9e5(0x89)]+'\x20('+_0x330961+')'+_0x1ab85d+_0x55303f;}function escapeRegex(_0x586439){const _0x24248f=a18_0x61b5;return _0x586439['replace'](/[.*+?^${}()|[\]\\]/g,_0x24248f(0x75));}function globToRegex(_0x35371d){const _0x123c32=a18_0x61b5,_0x5c088c=_0x35371d[_0x123c32(0xef)]('*')[_0x123c32(0xab)](escapeRegex);return new RegExp(_0x5c088c['join']('.*'),'i');}function buildRuleToNameMapping(_0x2e18c6){const _0xde567c=a18_0x61b5,_0x1e5476=new Map();if(_0x2e18c6[_0xde567c(0x85)])for(const [_0x4ffc31,_0x3ec567]of Object['entries'](_0x2e18c6[_0xde567c(0x85)])){if(_0x3ec567[_0xde567c(0x133)]){const _0x53c1ab=serializeRule(_0x3ec567[_0xde567c(0x133)]),_0x4fd28b=_0x1e5476['get'](_0x53c1ab);_0x4fd28b?_0x4fd28b[_0xde567c(0x11e)](_0x4ffc31):_0x1e5476[_0xde567c(0x10e)](_0x53c1ab,[_0x4ffc31]);}}return _0x1e5476;}async function resolveJourneyTarget(_0x363b68,_0x1085a3,_0x15aee7){const _0x41823e=a18_0x61b5;if(isYamlFilePath(_0x363b68))try{const _0x24eccd=await resolveYamlFilePath(_0x363b68);return _0x15aee7&&(console[_0x41823e(0xcf)](_0x41823e(0xc4)+_0x363b68),console[_0x41823e(0xcf)](_0x41823e(0xe2)+_0x24eccd[_0x41823e(0x7d)]),console['error'](_0x41823e(0xfe)+_0x24eccd[_0x41823e(0x10f)]),console[_0x41823e(0xcf)](_0x41823e(0xbd)+(_0x24eccd[_0x41823e(0x13b)]||_0x41823e(0x8a)))),{'journeyName':_0x24eccd[_0x41823e(0x10f)],'parentSegment':_0x24eccd[_0x41823e(0x7d)],'resolved':_0x24eccd};}catch(_0x4d38c0){throw new SDKError(ErrorCode[_0x41823e(0xcb)],_0x41823e(0xcc)+_0x4d38c0[_0x41823e(0xdd)]);}if(!_0x1085a3)throw new SDKError(ErrorCode[_0x41823e(0xcb)],_0x41823e(0x10d));return{'journeyName':_0x363b68,'parentSegment':_0x1085a3};}export class JourneyListCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]=a18_0x1f87e3(0xe0);[a18_0x1f87e3(0xb2)]=a18_0x1f87e3(0x124);async[a18_0x1f87e3(0xff)](_0x2f8dbc){const _0x1adbfc=a18_0x1f87e3,{options:_0x32a62d,args:_0x2657c1,tdx:_0x5d6ce6}=_0x2f8dbc,_0x3bc7aa=_0x2657c1[0x0],_0x563c77=_0x32a62d[_0x1adbfc(0x123)],_0xf2084f=_0x32a62d[_0x1adbfc(0x7d)];if(!_0xf2084f)return console['error'](_0x1adbfc(0xa6)),console[_0x1adbfc(0xcf)](_0x1adbfc(0xae)),0x1;const _0x29decd=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x5d6ce6[_0x1adbfc(0x11f)][_0x1adbfc(0x8b)](_0xf2084f),{'verbose':_0x32a62d[_0x1adbfc(0xf8)]}),_0x1ea759=_0x29decd[_0x1adbfc(0x140)];_0x32a62d[_0x1adbfc(0xf8)]&&(console[_0x1adbfc(0xcf)](_0x1adbfc(0xc9)+_0xf2084f+_0x1adbfc(0xf6)+_0x1ea759+')'),_0x3bc7aa&&console['error']('Pattern:\x20'+_0x3bc7aa));const [_0x1fa2be,_0x53b79a,_0x1c4468]=await Promise[_0x1adbfc(0xb5)]([withSpinner(_0x1adbfc(0x136),()=>_0x5d6ce6['segment']['getParentFull'](_0x1ea759),{'verbose':_0x32a62d[_0x1adbfc(0xf8)]}),withSpinner(_0x1adbfc(0xdc),()=>_0x5d6ce6['segment']['listFolders'](_0x1ea759),{'verbose':_0x32a62d[_0x1adbfc(0xf8)]}),withSpinner('Listing\x20journeys...',()=>_0x5d6ce6['journey'][_0x1adbfc(0xaa)](_0x1ea759),{'verbose':_0x32a62d[_0x1adbfc(0xf8)]})]),_0x22ee36=_0x1fa2be[_0x1adbfc(0x140)],_0x15c101=_0x53b79a[_0x1adbfc(0x140)];let _0x49abf3=_0x1c4468['data'];const _0x1a8819=_0x22ee36[_0x1adbfc(0x149)],_0x5d10e3=new Map();for(const _0x310792 of _0x15c101){_0x5d10e3[_0x1adbfc(0x10e)](_0x310792['id'],_0x310792[_0x1adbfc(0xe1)]);}if(_0x3bc7aa){const _0x1d2105=globToRegex(_0x3bc7aa);_0x49abf3=_0x49abf3[_0x1adbfc(0x13e)](_0x53b445=>_0x1d2105[_0x1adbfc(0xfb)](_0x53b445[_0x1adbfc(0x89)]));}console[_0x1adbfc(0xcf)](_0x1adbfc(0xa5)+_0x49abf3[_0x1adbfc(0x145)]+_0x1adbfc(0xb4)+(_0x49abf3[_0x1adbfc(0x145)]!==0x1?'s':''));const _0x25a719=_0x51a8ba=>{const _0x52268f=_0x1adbfc;return getConsoleNextUrl(_0x32a62d[_0x52268f(0xd9)],'/app/ps/'+_0x1ea759+_0x52268f(0xac)+_0x51a8ba+_0x52268f(0xf5));};if(_0x32a62d['format']===_0x1adbfc(0xc3))await handleSDKOutput(_0x49abf3,_0x32a62d);else{if(_0x32a62d[_0x1adbfc(0x104)]===_0x1adbfc(0xc8)){const _0x24d11f=_0x49abf3[_0x1adbfc(0xab)](_0x43c46c=>({..._0x43c46c,'url':_0x25a719(_0x43c46c['id'])}));await handleSDKOutput(_0x24d11f,_0x32a62d);}else{console[_0x1adbfc(0xbf)]('['+_0xf2084f+']');const _0x1c723a=new Map(),_0x7be434=[];for(const _0x318259 of _0x49abf3){if(!_0x318259[_0x1adbfc(0x103)]||_0x318259[_0x1adbfc(0x103)]===_0x1a8819)_0x7be434[_0x1adbfc(0x11e)](_0x318259);else{const _0x23189e=_0x1c723a[_0x1adbfc(0x86)](_0x318259[_0x1adbfc(0x103)])||[];_0x23189e[_0x1adbfc(0x11e)](_0x318259),_0x1c723a[_0x1adbfc(0x10e)](_0x318259['folderId'],_0x23189e);}}for(const _0x583b27 of _0x7be434){const _0x1ff6fe=_0x563c77?_0x25a719(_0x583b27['id']):undefined;console[_0x1adbfc(0xbf)](formatJourneyItem(_0x583b27,'',_0x1ff6fe));}for(const [_0x4a735e,_0x216f49]of _0x1c723a){const _0x464241=_0x5d10e3['get'](_0x4a735e)||_0x4a735e;console[_0x1adbfc(0xbf)](_0x1adbfc(0x11a)+_0x464241);for(const _0x209176 of _0x216f49){const _0x3935dd=_0x563c77?_0x25a719(_0x209176['id']):undefined;console[_0x1adbfc(0xbf)](formatJourneyItem(_0x209176,'\x20\x20',_0x3935dd));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']='journey:view';[a18_0x1f87e3(0xb2)]=a18_0x1f87e3(0xa0);async[a18_0x1f87e3(0xff)](_0x1000f2){const _0x5a64bb=a18_0x1f87e3,{options:_0x5bd7f4,args:_0x5ca38f,tdx:_0x2c05c5}=_0x1000f2,_0x232ba6=_0x5ca38f[0x0];if(!_0x232ba6)return console[_0x5a64bb(0xcf)](_0x5a64bb(0x102)),console[_0x5a64bb(0xcf)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x5a64bb(0xcf)](_0x5a64bb(0xad)),console[_0x5a64bb(0xcf)](_0x5a64bb(0xc6)),0x1;_0x5bd7f4[_0x5a64bb(0xf8)]&&console['error'](_0x5a64bb(0x100)+_0x232ba6);const _0x15de1e=await resolveJourneyTarget(_0x232ba6,_0x5bd7f4['parentSegment'],_0x5bd7f4['verbose']),_0x34c0ed=await withSpinner(_0x5a64bb(0xc0),()=>_0x2c05c5[_0x5a64bb(0x11f)]['resolveParentId'](_0x15de1e[_0x5a64bb(0x7d)]),{'verbose':_0x5bd7f4[_0x5a64bb(0xf8)]}),_0x50821a=_0x34c0ed[_0x5a64bb(0x140)],_0x443d48=await withSpinner(_0x5a64bb(0x10b),()=>_0x2c05c5[_0x5a64bb(0x9c)][_0x5a64bb(0xb0)](_0x50821a,_0x15de1e[_0x5a64bb(0xf3)]),{'verbose':_0x5bd7f4[_0x5a64bb(0xf8)]}),_0x51c75a=_0x443d48[_0x5a64bb(0x140)];if(_0x5bd7f4[_0x5a64bb(0x123)]){const _0x159fc7=getConsoleNextUrl(_0x5bd7f4[_0x5a64bb(0xd9)],_0x5a64bb(0xed)+_0x50821a+'/e/'+_0x51c75a+'/j/da/je');return console['error'](a18_0x45756c['green']('βœ”')+_0x5a64bb(0x9f)+a18_0x45756c[_0x5a64bb(0xec)](_0x159fc7)),openBrowser(_0x159fc7),0x0;}const _0x25cc86=await withSpinner('Getting\x20journey\x20details...',()=>_0x2c05c5[_0x5a64bb(0x9c)][_0x5a64bb(0xe3)](_0x51c75a),{'verbose':_0x5bd7f4[_0x5a64bb(0xf8)]}),_0x5b8b67=_0x25cc86[_0x5a64bb(0x140)],_0x56814c=_0x5bd7f4[_0x5a64bb(0x87)];let _0x5f5602;if(_0x56814c)try{const _0x570f36=await withSpinner(_0x5a64bb(0x7a),()=>_0x2c05c5[_0x5a64bb(0x9c)][_0x5a64bb(0x112)](_0x51c75a),{'verbose':_0x5bd7f4['verbose']});_0x5f5602=_0x570f36[_0x5a64bb(0x140)];}catch{_0x5bd7f4[_0x5a64bb(0xf8)]&&console[_0x5a64bb(0xcf)](_0x5a64bb(0x7c));}const _0x46315a=getConsoleNextUrl(_0x5bd7f4[_0x5a64bb(0xd9)],_0x5a64bb(0xed)+_0x50821a+_0x5a64bb(0xac)+_0x51c75a+_0x5a64bb(0x129)),_0x53b4f5={'id':_0x5b8b67['id'],'name':_0x5b8b67[_0x5a64bb(0xe9)][_0x5a64bb(0xe1)],'description':_0x5b8b67['attributes'][_0x5a64bb(0xb2)],'state':_0x5b8b67['attributes'][_0x5a64bb(0xbe)],'paused':_0x5b8b67[_0x5a64bb(0xe9)][_0x5a64bb(0xdf)],'reentry_mode':_0x5b8b67[_0x5a64bb(0xe9)][_0x5a64bb(0x13d)],'stages':_0x5b8b67[_0x5a64bb(0xe9)]['journeyStages']?.[_0x5a64bb(0x145)]||0x0,..._0x5b8b67[_0x5a64bb(0xe9)][_0x5a64bb(0x144)]&&{'goal':_0x5b8b67['attributes'][_0x5a64bb(0x144)][_0x5a64bb(0xe1)]},..._0x5f5602&&{'statistics':{'total_entered':_0x5f5602[_0x5a64bb(0x125)],'goal_achieved':_0x5f5602[_0x5a64bb(0x9a)],'goal_rate':_0x5f5602['goalRate'],'stages':_0x5f5602['stages']}},'url':_0x46315a};return await handleSingleObjectOutput(_0x53b4f5,_0x5bd7f4),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]=a18_0x1f87e3(0x93);[a18_0x1f87e3(0xb2)]='Show\x20journey\x20statistics';async[a18_0x1f87e3(0xff)](_0x53dec0){const _0x197cda=a18_0x1f87e3,{options:_0x1b8173,args:_0x12274b,tdx:_0x3aa8a8}=_0x53dec0,_0x58ff06=_0x12274b[0x0];if(!_0x58ff06)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x197cda(0xcf)](_0x197cda(0xd4)),0x1;_0x1b8173[_0x197cda(0xf8)]&&console[_0x197cda(0xcf)](_0x197cda(0x100)+_0x58ff06);const _0x596c9b=await resolveJourneyTarget(_0x58ff06,_0x1b8173[_0x197cda(0x7d)],_0x1b8173[_0x197cda(0xf8)]),_0x2d1c76=await withSpinner(_0x197cda(0xc0),()=>_0x3aa8a8[_0x197cda(0x11f)][_0x197cda(0x8b)](_0x596c9b['parentSegment']),{'verbose':_0x1b8173[_0x197cda(0xf8)]}),_0x5233a9=_0x2d1c76[_0x197cda(0x140)],_0x443c80=await withSpinner(_0x197cda(0x10b),()=>_0x3aa8a8[_0x197cda(0x9c)][_0x197cda(0xb0)](_0x5233a9,_0x596c9b[_0x197cda(0xf3)]),{'verbose':_0x1b8173['verbose']}),_0xd559e6=_0x443c80[_0x197cda(0x140)],_0x479255=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x3aa8a8[_0x197cda(0x9c)][_0x197cda(0x112)](_0xd559e6),{'verbose':_0x1b8173[_0x197cda(0xf8)]}),_0x1380f8=_0x479255[_0x197cda(0x140)];if(!_0x1380f8||_0x1380f8['journeyId']===null)return console['error'](_0x197cda(0xf9)+_0x596c9b['journeyName']),console[_0x197cda(0xcf)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x1002c3={'journey_id':_0x1380f8[_0x197cda(0x135)],'total_entered':_0x1380f8['totalEntered'],'goal_achieved':_0x1380f8[_0x197cda(0x9a)],'goal_rate':_0x1380f8[_0x197cda(0x118)],'stages':_0x1380f8[_0x197cda(0xd6)]?.[_0x197cda(0xab)](_0x27d38f=>({'name':_0x27d38f[_0x197cda(0x128)],'population':_0x27d38f[_0x197cda(0xe8)],'entered':_0x27d38f[_0x197cda(0x117)],'exited':_0x27d38f['exited'],'conversion_rate':_0x27d38f[_0x197cda(0x11d)]}))},_0x4d3afd=_0x1b8173[_0x197cda(0xf2)];if(_0x4d3afd&&_0x1380f8[_0x197cda(0xd6)]){const _0x5c9572=_0x1380f8[_0x197cda(0xd6)][_0x197cda(0x146)](_0x16439c=>_0x16439c[_0x197cda(0x128)]['toLowerCase']()===_0x4d3afd['toLowerCase']());if(_0x5c9572)return await handleSingleObjectOutput({'stage_name':_0x5c9572[_0x197cda(0x128)],'population':_0x5c9572[_0x197cda(0xe8)],'entered':_0x5c9572[_0x197cda(0x117)],'exited':_0x5c9572[_0x197cda(0x138)],'conversion_rate':_0x5c9572[_0x197cda(0x11d)]},_0x1b8173),0x0;console[_0x197cda(0xcf)](_0x197cda(0x9e)+_0x4d3afd+_0x197cda(0x12b));}return await handleSingleObjectOutput(_0x1002c3,_0x1b8173),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]='journey:pause';[a18_0x1f87e3(0xb2)]=a18_0x1f87e3(0x127);async[a18_0x1f87e3(0xff)](_0x479312){const _0x5e82d5=a18_0x1f87e3,{options:_0x3bd92b,args:_0x4270b9,tdx:_0x2f4fe3}=_0x479312,_0x29b7ac=_0x4270b9[0x0];if(!_0x29b7ac)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x5e82d5(0xcf)](_0x5e82d5(0x148)),0x1;_0x3bd92b[_0x5e82d5(0xf8)]&&console[_0x5e82d5(0xcf)]('Input:\x20'+_0x29b7ac);const _0x5bad5d=await resolveJourneyTarget(_0x29b7ac,_0x3bd92b[_0x5e82d5(0x7d)],_0x3bd92b[_0x5e82d5(0xf8)]),_0x837b20=await withSpinner(_0x5e82d5(0xc0),()=>_0x2f4fe3['segment'][_0x5e82d5(0x8b)](_0x5bad5d['parentSegment']),{'verbose':_0x3bd92b[_0x5e82d5(0xf8)]}),_0x3ac5af=_0x837b20[_0x5e82d5(0x140)],_0x49ad0e=await withSpinner(_0x5e82d5(0x10b),()=>_0x2f4fe3[_0x5e82d5(0x9c)][_0x5e82d5(0xb0)](_0x3ac5af,_0x5bad5d[_0x5e82d5(0xf3)]),{'verbose':_0x3bd92b[_0x5e82d5(0xf8)]}),_0x50b3a5=_0x49ad0e[_0x5e82d5(0x140)];if(!_0x3bd92b[_0x5e82d5(0xf7)]){const _0x28fbc6=await confirm(_0x5e82d5(0xa2)+_0x5bad5d['journeyName']+'\x22?');if(!_0x28fbc6)return console['error'](_0x5e82d5(0x88)),0x0;}const _0x4cdc86=await withSpinner(_0x5e82d5(0xe5),()=>_0x2f4fe3[_0x5e82d5(0x9c)][_0x5e82d5(0xba)](_0x50b3a5),{'verbose':_0x3bd92b[_0x5e82d5(0xf8)]}),_0x34654b=_0x4cdc86[_0x5e82d5(0x140)];return console['error'](_0x5e82d5(0x13f)+_0x34654b[_0x5e82d5(0xe9)][_0x5e82d5(0xe1)]+_0x5e82d5(0x131)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]=a18_0x1f87e3(0x119);[a18_0x1f87e3(0xb2)]=a18_0x1f87e3(0x134);async[a18_0x1f87e3(0xff)](_0x1c323a){const _0x116f87=a18_0x1f87e3,{options:_0x15f1bd,args:_0x18962c,tdx:_0x2bea63}=_0x1c323a,_0x32a409=_0x18962c[0x0];if(!_0x32a409)return console[_0x116f87(0xcf)](_0x116f87(0x102)),console['error'](_0x116f87(0xb1)),0x1;_0x15f1bd['verbose']&&console[_0x116f87(0xcf)]('Input:\x20'+_0x32a409);const _0x437cf3=await resolveJourneyTarget(_0x32a409,_0x15f1bd[_0x116f87(0x7d)],_0x15f1bd[_0x116f87(0xf8)]),_0x16347e=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x2bea63[_0x116f87(0x11f)][_0x116f87(0x8b)](_0x437cf3[_0x116f87(0x7d)]),{'verbose':_0x15f1bd[_0x116f87(0xf8)]}),_0x395b58=_0x16347e[_0x116f87(0x140)],_0x242e0f=await withSpinner('Resolving\x20journey...',()=>_0x2bea63[_0x116f87(0x9c)][_0x116f87(0xb0)](_0x395b58,_0x437cf3[_0x116f87(0xf3)]),{'verbose':_0x15f1bd['verbose']}),_0x5b4ee1=_0x242e0f[_0x116f87(0x140)];if(!_0x15f1bd[_0x116f87(0xf7)]){const _0xfebb79=await confirm(_0x116f87(0xdb)+_0x437cf3['journeyName']+'\x22?');if(!_0xfebb79)return console[_0x116f87(0xcf)]('Cancelled'),0x0;}const _0x244000=await withSpinner(_0x116f87(0xca),()=>_0x2bea63['journey'][_0x116f87(0x108)](_0x5b4ee1),{'verbose':_0x15f1bd[_0x116f87(0xf8)]}),_0x53188c=_0x244000['data'];return console['error'](_0x116f87(0x13f)+_0x53188c[_0x116f87(0xe9)]['name']+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]=a18_0x1f87e3(0x121);[a18_0x1f87e3(0xb2)]=a18_0x1f87e3(0xf1);async['execute'](_0x2f9cd6){const _0x42bfc7=a18_0x1f87e3,{options:_0x24518c,args:_0x1c2bb4,tdx:_0x474f27}=_0x2f9cd6,_0x49bccf=_0x24518c,_0x31c94b=_0x1c2bb4[0x0],_0x1a6975=_0x31c94b&&isYamlFilePath(_0x31c94b),_0x4a8f5=await resolveTarget({'arg':_0x1a6975?_0x31c94b:undefined,'contextParent':_0x24518c[_0x42bfc7(0x7d)],'cwd':process[_0x42bfc7(0x142)]()});if(!isSuccessfulResolution(_0x4a8f5))return _0x4a8f5[_0x42bfc7(0xfa)]===_0x42bfc7(0x114)?(console[_0x42bfc7(0xcf)](a18_0x45756c[_0x42bfc7(0xbc)](_0x42bfc7(0x14a))),console['error']('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['error'](_0x42bfc7(0x101)),console[_0x42bfc7(0xcf)](_0x42bfc7(0xc5)),console[_0x42bfc7(0xcf)](_0x42bfc7(0x107))):(console[_0x42bfc7(0xcf)](a18_0x45756c[_0x42bfc7(0x8c)](_0x42bfc7(0xbb)+_0x4a8f5[_0x42bfc7(0xdd)]+'\x0a')),_0x4a8f5['helpText']&&console['error'](a18_0x45756c[_0x42bfc7(0xec)](_0x4a8f5[_0x42bfc7(0x76)]))),0x1;let _0xc3890c=_0x1a6975?undefined:_0x31c94b,_0x1f767a,_0x5b52ba;_0x4a8f5[_0x42bfc7(0x80)]===_0x42bfc7(0xb3)&&(_0xc3890c=_0x4a8f5[_0x42bfc7(0x98)],_0x1f767a=_0x4a8f5[_0x42bfc7(0x12e)],_0x5b52ba=_0x4a8f5[_0x42bfc7(0x13b)]);const _0x20ed24=_0x4a8f5['parentName'],_0x4d3e01=_0x4a8f5['targetDir'];_0x49bccf[_0x42bfc7(0xf8)]&&(console[_0x42bfc7(0xcf)](_0x42bfc7(0xc9)+_0x20ed24),console[_0x42bfc7(0xcf)](_0x42bfc7(0x113)+_0x4d3e01),_0xc3890c&&console[_0x42bfc7(0xcf)](_0x42bfc7(0xd7)+_0xc3890c),_0x1f767a&&console[_0x42bfc7(0xcf)]('Target\x20file:\x20'+_0x1f767a),_0x5b52ba&&console[_0x42bfc7(0xcf)](_0x42bfc7(0x99)+_0x5b52ba));const _0x4c92f5=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x474f27[_0x42bfc7(0x11f)][_0x42bfc7(0x8b)](_0x20ed24),{'verbose':_0x24518c['verbose']}),_0x33b95a=_0x4c92f5[_0x42bfc7(0x140)],[_0x1ff55b,_0x1e347a]=await Promise[_0x42bfc7(0xb5)]([withSpinner(_0x42bfc7(0x11b),()=>_0x474f27['journey']['listJourneysFromParentSegment'](_0x33b95a),{'verbose':_0x24518c[_0x42bfc7(0xf8)]}),withSpinner('Listing\x20folders...',()=>_0x474f27[_0x42bfc7(0x11f)][_0x42bfc7(0xcd)](_0x33b95a),{'verbose':_0x24518c[_0x42bfc7(0xf8)]})]);let _0x5ebe9b=_0x1ff55b['data'];const _0x3e7d57=_0x1e347a[_0x42bfc7(0x140)],_0x67d05f=buildFolderIdToPathMap(_0x3e7d57);if(_0xc3890c){const _0x5309bf=_0x5ebe9b[_0x42bfc7(0x13e)](_0xc80cb1=>_0xc80cb1['journeyBundleName'][_0x42bfc7(0x10c)]()===_0xc3890c[_0x42bfc7(0x10c)]());if(_0x5309bf[_0x42bfc7(0x145)]===0x0)return console[_0x42bfc7(0xcf)](_0x42bfc7(0x12f)+_0xc3890c),console['error'](_0x42bfc7(0x13c)),0x1;_0x5ebe9b=_0x5309bf;}if(_0x5b52ba!==undefined){const _0x2dcc37=_0x5ebe9b[_0x42bfc7(0x13e)](_0x163490=>{const _0x52dd4f=_0x42bfc7,_0xca11ce=_0x163490[_0x52dd4f(0x103)]?_0x67d05f['get'](_0x163490[_0x52dd4f(0x103)])||'':'';return _0xca11ce===_0x5b52ba;});if(_0x2dcc37[_0x42bfc7(0x145)]===0x0&&_0x5ebe9b[_0x42bfc7(0x145)]>0x0){console['error'](_0x42bfc7(0xee)+_0xc3890c+_0x42bfc7(0xde)+(_0x5b52ba||_0x42bfc7(0x14b))),console[_0x42bfc7(0xcf)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x3d05b7 of _0x5ebe9b){const _0x26b252=_0x3d05b7[_0x42bfc7(0x103)]?_0x67d05f[_0x42bfc7(0x86)](_0x3d05b7[_0x42bfc7(0x103)])||'':'';console[_0x42bfc7(0xcf)](_0x42bfc7(0x12a)+(_0x26b252||'(root)')+'/'+_0x3d05b7[_0x42bfc7(0x89)]);}return 0x1;}_0x5ebe9b=_0x2dcc37;}if(_0x5ebe9b[_0x42bfc7(0x145)]===0x0)return console[_0x42bfc7(0xcf)](_0x42bfc7(0xf4)),0x0;const _0x474791=new Map();for(const _0x965cc0 of _0x5ebe9b){const _0x20a109=_0x965cc0[_0x42bfc7(0xe6)];!_0x474791['has'](_0x20a109)&&_0x474791[_0x42bfc7(0x10e)](_0x20a109,[]),_0x474791[_0x42bfc7(0x86)](_0x20a109)[_0x42bfc7(0x11e)](_0x965cc0);}for(const _0x383f69 of _0x474791[_0x42bfc7(0xd1)]()){_0x383f69[_0x42bfc7(0xb8)]((_0x57f6e5,_0x3a655c)=>(_0x57f6e5[_0x42bfc7(0x83)]||0x0)-(_0x3a655c[_0x42bfc7(0x83)]||0x0));}const _0x3fb4a2=[],[_0x4c971d,_0x542319]=await Promise[_0x42bfc7(0xb5)]([withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x474f27[_0x42bfc7(0x11c)][_0x42bfc7(0x111)](),{'verbose':_0x24518c[_0x42bfc7(0xf8)]})[_0x42bfc7(0x110)](_0x2c7e81=>_0x2c7e81[_0x42bfc7(0x140)]),withSpinner(_0x42bfc7(0x130),()=>_0x474f27[_0x42bfc7(0xfd)]['buildIdToNameMap'](),{'verbose':_0x24518c[_0x42bfc7(0xf8)]})[_0x42bfc7(0x110)](_0x2f43cb=>_0x2f43cb['data'])]);for(const _0x120292 of _0x474791[_0x42bfc7(0xd1)]()){const _0x3d303b=_0x120292[0x0][_0x42bfc7(0x89)],_0x4a8fbc=_0x120292[0x0]['folderId'],_0x552b3b=_0x4a8fbc?_0x67d05f[_0x42bfc7(0x86)](_0x4a8fbc)||'':'',_0x42951c=_0x552b3b?a18_0x965be4[_0x42bfc7(0xd0)](_0x4d3e01,_0x552b3b):_0x4d3e01,_0x27abb7=_0x1f767a||a18_0x965be4[_0x42bfc7(0xd0)](_0x42951c,sanitizeFileName(_0x3d303b)+_0x42bfc7(0x122));let _0x7aaae0,_0x4bf12e;if(existsSync(_0x27abb7))try{const _0x13d2c3=readFileSync(_0x27abb7,_0x42bfc7(0x132)),_0x52bb82=parseYamlString(_0x13d2c3);_0x4bf12e=_0x52bb82,_0x7aaae0=buildRuleToNameMapping(_0x52bb82),_0x49bccf[_0x42bfc7(0xf8)]&&_0x7aaae0[_0x42bfc7(0xe7)]>0x0&&console[_0x42bfc7(0xcf)](_0x42bfc7(0x9b)+_0x7aaae0[_0x42bfc7(0xe7)]+_0x42bfc7(0x95)+_0x3d303b);}catch(_0x114309){_0x49bccf[_0x42bfc7(0xf8)]&&console[_0x42bfc7(0xcf)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x114309['message']);}const _0x5e7e6a=[],_0xf22768=new Set(),_0xb008c6=new Map(),_0x10a4ff=new Map(),_0x5ee211=new Set(),_0x5e57a8=new Map(),_0x1436b1=new Map(),_0x3ff96e=createJumpTargetCache();await withProgressSpinner(_0x42bfc7(0x137)+_0x3d303b+_0x42bfc7(0xea),async _0x53e97e=>{const _0x3e8b8e=_0x42bfc7;for(const _0x38c28d of _0x120292){const _0x18e35a=_0x120292[_0x3e8b8e(0x145)]>0x1?_0x38c28d['journeyBundleName']+'\x20v'+(_0x38c28d[_0x3e8b8e(0x83)]||0x1):_0x38c28d[_0x3e8b8e(0x89)];_0x53e97e[_0x3e8b8e(0xfc)](_0x3e8b8e(0x137)+_0x18e35a);const _0x956d1e=await _0x474f27[_0x3e8b8e(0x9c)][_0x3e8b8e(0xe3)](_0x38c28d['id']),_0x37c89f=_0x956d1e[_0x3e8b8e(0xe9)]?.[_0x3e8b8e(0xaf)],_0x42107={'resolveSegment':async _0xcfc0dd=>{const _0x3dec1e=_0x3e8b8e;if(!_0x37c89f)return{'name':_0xcfc0dd,'isJourneyLocal':![]};const _0x1303da=_0xb008c6[_0x3dec1e(0x86)](_0xcfc0dd);if(_0x1303da)return _0x1303da;try{const _0x3a1930=await _0x474f27[_0x3dec1e(0x11f)][_0x3dec1e(0x81)](_0x37c89f,_0xcfc0dd),_0x6b76bc=_0x3a1930[_0x3dec1e(0x12d)]===SEGMENT_KIND_JOURNEY;let _0x30533a,_0x1122a0=_0x3a1930['name'];if(_0x6b76bc&&_0x3a1930['rule']){const _0x48ad55=await segmentResponseToDef(_0x3a1930,{'resolveSegmentName':async _0x3611c6=>{const _0x18d144=_0x3dec1e,_0x3a82c9=_0xb008c6['get'](_0x3611c6);if(_0x3a82c9)return _0x3a82c9[_0x18d144(0xe1)];const _0x455e1e=await _0x42107[_0x18d144(0xf0)](_0x3611c6);return _0x455e1e['name'];}}),_0x4c4239=_0x48ad55['rule'];_0x30533a={'description':_0x3a1930[_0x3dec1e(0xb2)],'rule':_0x4c4239};const _0x371352=serializeRule(_0x4c4239),_0x17a818=_0x10a4ff[_0x3dec1e(0x86)](_0x371352);if(_0x17a818)_0x1122a0=_0x17a818,_0x30533a=undefined,_0x49bccf[_0x3dec1e(0xf8)]&&console[_0x3dec1e(0xcf)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x3a1930[_0x3dec1e(0xe1)]+'\x20->\x20'+_0x17a818);else{let _0x4d52cf=![];if(_0x7aaae0){const _0xc93998=_0x7aaae0[_0x3dec1e(0x86)](_0x371352);if(_0xc93998){const _0x21778d=_0xc93998[_0x3dec1e(0x146)](_0x2d71be=>!_0xf22768[_0x3dec1e(0x109)](_0x2d71be));_0x21778d&&(_0x1122a0=_0x21778d,_0xf22768[_0x3dec1e(0x106)](_0x21778d),_0x10a4ff[_0x3dec1e(0x10e)](_0x371352,_0x21778d),_0x4d52cf=!![],_0x49bccf[_0x3dec1e(0xf8)]&&console[_0x3dec1e(0xcf)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x21778d+_0x3dec1e(0x8e)));}}if(!_0x4d52cf){const _0x1f9f27=generateJourneyLocalName(_0x3a1930[_0x3dec1e(0xe1)]);_0x1f9f27&&(_0x1122a0=_0x1f9f27);let _0x1238b0=_0x1122a0,_0x33414a=0x2;while(_0xf22768[_0x3dec1e(0x109)](_0x1238b0)){_0x1238b0=_0x1122a0+'_'+_0x33414a,_0x33414a++;}_0xf22768[_0x3dec1e(0x106)](_0x1238b0),_0x10a4ff[_0x3dec1e(0x10e)](_0x371352,_0x1238b0),_0x1122a0=_0x1238b0;}}}const _0x4b9748={'name':_0x1122a0,'isJourneyLocal':_0x6b76bc,'definition':_0x30533a};return _0xb008c6[_0x3dec1e(0x10e)](_0xcfc0dd,_0x4b9748),_0x4b9748;}catch(_0x9db73e){return _0x24518c[_0x3dec1e(0xf8)]&&console[_0x3dec1e(0xcf)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0xcfc0dd+':\x20'+_0x9db73e[_0x3dec1e(0xdd)]),{'name':_0xcfc0dd,'isJourneyLocal':![]};}},'resolveActivation':async _0x58dc0b=>{const _0x187177=_0x3e8b8e,_0x4769f6=_0x5e57a8[_0x187177(0x86)](_0x58dc0b);if(_0x4769f6)return _0x4769f6;try{const _0x7574a4=await _0x474f27[_0x187177(0x9c)][_0x187177(0xc7)](_0x38c28d['id'],_0x58dc0b),_0x50c40d=journeyActivationStepToYaml(_0x7574a4,_0x4c971d,_0x542319),_0x450f94=JSON[_0x187177(0xb7)]({'name':_0x50c40d[_0x187177(0xe1)],'connection':_0x50c40d['connection'],'connector_config':_0x50c40d[_0x187177(0xe4)]}),_0x2f9297=_0x1436b1[_0x187177(0x86)](_0x450f94);if(_0x2f9297){const _0x1e6167={'name':_0x2f9297,'isJourneyLocal':!![],'definition':_0x50c40d};return _0x5e57a8[_0x187177(0x10e)](_0x58dc0b,_0x1e6167),_0x1e6167;}const _0x3269d6=_0x7574a4[_0x187177(0xe9)][_0x187177(0xd3)][_0x187177(0xe1)]||_0x58dc0b,_0x33887a=sanitizeYamlKey(_0x3269d6)||_0x187177(0xd5)+_0x58dc0b;let _0x38a385=_0x33887a,_0x9745cd=0x2;while(_0x5ee211[_0x187177(0x109)](_0x38a385)){_0x38a385=_0x33887a+'_'+_0x9745cd,_0x9745cd++;}_0x5ee211[_0x187177(0x106)](_0x38a385),_0x1436b1[_0x187177(0x10e)](_0x450f94,_0x38a385);const _0x49f103={'name':_0x38a385,'isJourneyLocal':!![],'definition':_0x50c40d};return _0x5e57a8['set'](_0x58dc0b,_0x49f103),_0x49f103;}catch(_0x4d1143){return _0x24518c[_0x187177(0xf8)]&&console[_0x187177(0xcf)](_0x187177(0x139)+_0x58dc0b+':\x20'+_0x4d1143['message']),{'name':_0x58dc0b,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x361c48,_0x3c9683)=>{const _0x5b1e51=_0x3e8b8e;return resolveJumpTarget(_0x361c48,_0x3c9683,_0x3ff96e,_0xdc73fd=>_0x474f27[_0x5b1e51(0x9c)]['getJourney'](_0xdc73fd));}},_0x4a6074=await journeyResponseToDef(_0x956d1e,_0x42107);_0x5e7e6a['push']({'item':_0x38c28d,'yaml':_0x4a6074});}},{'verbose':_0x24518c[_0x42bfc7(0xf8)]});const _0x5260e3=buildMergedJourneyDef(_0x5e7e6a,_0x7aaae0),_0x5997c4=normalizeJourneyDef(_0x5260e3,_0x4bf12e),_0x193ddd=toYamlString(_0x5997c4),_0x34503a=_0x1f767a||a18_0x965be4['join'](_0x42951c,sanitizeFileName(_0x3d303b)+_0x42bfc7(0x122));!_0x1f767a&&_0x552b3b&&!existsSync(_0x42951c)&&mkdirSync(_0x42951c,{'recursive':!![]});const _0x581b7b=a18_0x965be4[_0x42bfc7(0x115)](process[_0x42bfc7(0x142)](),_0x34503a);if(existsSync(_0x34503a)){const _0x15ce0e=readFileSync(_0x34503a,_0x42bfc7(0x132)),_0x8f72a1=generateDiff(_0x15ce0e,_0x193ddd),_0x3112af=hasChanges(_0x8f72a1);_0x3fb4a2[_0x42bfc7(0x11e)]({'relativePath':_0x581b7b,'absolutePath':_0x34503a,'content':_0x193ddd,'isNew':![],'hasChanges':_0x3112af,'diff':_0x3112af?formatDiffWithColors(_0x8f72a1):undefined});}else _0x3fb4a2['push']({'relativePath':_0x581b7b,'absolutePath':_0x34503a,'content':_0x193ddd,'isNew':!![],'hasChanges':![]});}const _0x4d35ce=_0x3fb4a2['filter'](_0x3d8413=>_0x3d8413[_0x42bfc7(0x126)]),_0x58d2d7=_0x3fb4a2[_0x42bfc7(0x13e)](_0x274e8b=>!_0x274e8b['isNew']&&_0x274e8b[_0x42bfc7(0xda)]),_0x262e02=_0x3fb4a2['filter'](_0x582647=>!_0x582647[_0x42bfc7(0x126)]&&!_0x582647[_0x42bfc7(0xda)]),_0x55d973=_0x5ebe9b['length'],_0x31f3a8=_0x474791[_0x42bfc7(0xe7)],_0x163af6=_0x55d973>_0x31f3a8?'\x20('+_0x55d973+_0x42bfc7(0xd2):'';console[_0x42bfc7(0xcf)](_0x42bfc7(0x120)),console[_0x42bfc7(0xcf)]('\x20\x20'+a18_0x45756c['cyan'](_0x31f3a8+_0x42bfc7(0xc1))+a18_0x45756c[_0x42bfc7(0x97)](_0x163af6)),console['error']('\x20\x20'+a18_0x45756c[_0x42bfc7(0x12c)]('+\x20'+_0x4d35ce[_0x42bfc7(0x145)]+_0x42bfc7(0xa4))),console[_0x42bfc7(0xcf)]('\x20\x20'+a18_0x45756c[_0x42bfc7(0xbc)]('~\x20'+_0x58d2d7[_0x42bfc7(0x145)]+'\x20changed\x20files')),console[_0x42bfc7(0xcf)]('\x20\x20'+a18_0x45756c[_0x42bfc7(0x97)]('=\x20'+_0x262e02[_0x42bfc7(0x145)]+_0x42bfc7(0xd8))),console['error'](_0x42bfc7(0x92)+a18_0x45756c[_0x42bfc7(0xec)](_0x4d3e01)+'\x0a');if(_0x58d2d7[_0x42bfc7(0x145)]>0x0)for(const _0x24c641 of _0x58d2d7){console['error'](_0x42bfc7(0x147)+_0x24c641[_0x42bfc7(0xeb)]+'\x27:'),console[_0x42bfc7(0xcf)]('─'['repeat'](0x3c)),console[_0x42bfc7(0xcf)](_0x24c641['diff']),console[_0x42bfc7(0xcf)]('─'[_0x42bfc7(0x141)](0x3c));}if(_0x49bccf[_0x42bfc7(0x84)])return console[_0x42bfc7(0xcf)](a18_0x45756c['yellow'](_0x42bfc7(0x7e))),0x0;if(_0x4d35ce[_0x42bfc7(0x145)]===0x0&&_0x58d2d7['length']===0x0)return console[_0x42bfc7(0xcf)](a18_0x45756c[_0x42bfc7(0x12c)](_0x42bfc7(0x94))),saveSessionContext({'parent_segment':_0x20ed24},_0x49bccf[_0x42bfc7(0xa1)]),console[_0x42bfc7(0xcf)](a18_0x45756c[_0x42bfc7(0x12c)](_0x42bfc7(0x91)+a18_0x45756c[_0x42bfc7(0x97)]('parent_segment')+'\x20=\x20'+a18_0x45756c[_0x42bfc7(0xec)](_0x20ed24))),0x0;if(!_0x49bccf[_0x42bfc7(0xf7)]&&(_0x4d35ce[_0x42bfc7(0x145)]>0x0||_0x58d2d7['length']>0x0)){const _0x1685dd=await confirmKey(_0x42bfc7(0xa8)+(_0x4d35ce[_0x42bfc7(0x145)]+_0x58d2d7[_0x42bfc7(0x145)])+_0x42bfc7(0x96));if(!_0x1685dd)return console['error'](_0x42bfc7(0x7f)),0x1;}!existsSync(_0x4d3e01)&&mkdirSync(_0x4d3e01,{'recursive':!![]});for(const _0x84ec30 of _0x3fb4a2){(_0x84ec30[_0x42bfc7(0x126)]||_0x84ec30[_0x42bfc7(0xda)])&&writeFileSync(_0x84ec30[_0x42bfc7(0xc2)],_0x84ec30[_0x42bfc7(0x105)],'utf-8');}return console['error'](a18_0x45756c[_0x42bfc7(0x12c)]('βœ”\x20Pulled\x20'+(_0x4d35ce[_0x42bfc7(0x145)]+_0x58d2d7[_0x42bfc7(0x145)])+'\x20journey\x20files\x20to\x20'+_0x4d3e01)),saveSessionContext({'parent_segment':_0x20ed24},_0x49bccf[_0x42bfc7(0xa1)]),console[_0x42bfc7(0xcf)](a18_0x45756c[_0x42bfc7(0x12c)](_0x42bfc7(0x91)+a18_0x45756c[_0x42bfc7(0x97)](_0x42bfc7(0x116))+_0x42bfc7(0xb9)+a18_0x45756c[_0x42bfc7(0xec)](_0x20ed24))),0x0;}}export class JourneyPushCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]=a18_0x1f87e3(0x13a);['description']=a18_0x1f87e3(0xa7);[a18_0x1f87e3(0x78)]=new SegmentPushCommand();async[a18_0x1f87e3(0xff)](_0x147512){const _0xe6cffb=a18_0x1f87e3,_0x2d2e33={..._0x147512,'options':{..._0x147512[_0xe6cffb(0x10a)],'journeysOnly':!![]}};return this[_0xe6cffb(0x78)]['execute'](_0x2d2e33);}}
1
+ const a18_0x45a513=a18_0x1061;(function(_0x4f5532,_0x2fbbd4){const _0xe41511=a18_0x1061,_0x321bac=_0x4f5532();while(!![]){try{const _0x2b536e=-parseInt(_0xe41511(0xc2))/0x1+-parseInt(_0xe41511(0x130))/0x2*(-parseInt(_0xe41511(0xec))/0x3)+parseInt(_0xe41511(0xdd))/0x4*(parseInt(_0xe41511(0xee))/0x5)+parseInt(_0xe41511(0xd9))/0x6*(parseInt(_0xe41511(0x111))/0x7)+-parseInt(_0xe41511(0xbc))/0x8+parseInt(_0xe41511(0xa2))/0x9*(-parseInt(_0xe41511(0xac))/0xa)+-parseInt(_0xe41511(0xae))/0xb*(-parseInt(_0xe41511(0x74))/0xc);if(_0x2b536e===_0x2fbbd4)break;else _0x321bac['push'](_0x321bac['shift']());}catch(_0x4484cd){_0x321bac['push'](_0x321bac['shift']());}}}(a18_0x5278,0x8b907));import a18_0x5956c7 from'chalk';import a18_0xd04e2e from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';function a18_0x1061(_0x3dacb5,_0x918f22){_0x3dacb5=_0x3dacb5-0x65;const _0x5278b0=a18_0x5278();let _0x1061aa=_0x5278b0[_0x3dacb5];return _0x1061aa;}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{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';function formatJourneyState(_0x170922){const _0x4a868a=a18_0x1061;switch(_0x170922){case _0x4a868a(0x10f):return a18_0x5956c7[_0x4a868a(0xfe)](_0x170922);case _0x4a868a(0x8a):return a18_0x5956c7[_0x4a868a(0xf0)](_0x170922);case _0x4a868a(0xe7):return a18_0x5956c7[_0x4a868a(0x103)](_0x170922);default:return _0x170922;}}function formatJourneyItem(_0x45c1cb,_0x4a0b79='',_0x3f8a9d){const _0x24255e=a18_0x1061,_0x5548e2=formatJourneyState(_0x45c1cb['state']),_0x17c69e=_0x45c1cb[_0x24255e(0xb8)]?a18_0x5956c7['yellow'](_0x24255e(0xa3)):'',_0x1925c3=_0x3f8a9d?'\x20'+a18_0x5956c7[_0x24255e(0xdb)](_0x3f8a9d):'';return _0x4a0b79+_0x24255e(0x109)+_0x45c1cb[_0x24255e(0xaf)]+'\x20('+_0x5548e2+')'+_0x17c69e+_0x1925c3;}function escapeRegex(_0x4b330c){const _0xf1eb77=a18_0x1061;return _0x4b330c['replace'](/[.*+?^${}()|[\]\\]/g,_0xf1eb77(0xa1));}function globToRegex(_0x215443){const _0x1c337c=a18_0x1061,_0x280095=_0x215443[_0x1c337c(0x137)]('*')[_0x1c337c(0x7d)](escapeRegex);return new RegExp(_0x280095['join']('.*'),'i');}function buildRuleToNameMapping(_0x470356){const _0x420e89=a18_0x1061,_0xc97e2b=new Map();if(_0x470356[_0x420e89(0xe0)])for(const [_0x296030,_0xdd5f2e]of Object[_0x420e89(0x10a)](_0x470356[_0x420e89(0xe0)])){if(_0xdd5f2e['rule']){const _0xe78e67=serializeRule(_0xdd5f2e[_0x420e89(0xc5)]),_0x530c8c=_0xc97e2b['get'](_0xe78e67);_0x530c8c?_0x530c8c['push'](_0x296030):_0xc97e2b[_0x420e89(0xc3)](_0xe78e67,[_0x296030]);}}return _0xc97e2b;}async function resolveJourneyTarget(_0x48fe1e,_0x185172,_0x5293d9){const _0x4c0791=a18_0x1061;if(isYamlFilePath(_0x48fe1e))try{const _0x4d6909=await resolveYamlFilePath(_0x48fe1e);return _0x5293d9&&(console[_0x4c0791(0xde)](_0x4c0791(0x106)+_0x48fe1e),console['error'](_0x4c0791(0xbe)+_0x4d6909[_0x4c0791(0xb2)]),console[_0x4c0791(0xde)](_0x4c0791(0xbf)+_0x4d6909[_0x4c0791(0xf8)]),console[_0x4c0791(0xde)](_0x4c0791(0x104)+(_0x4d6909[_0x4c0791(0xe6)]||_0x4c0791(0x97)))),{'journeyName':_0x4d6909[_0x4c0791(0xf8)],'parentSegment':_0x4d6909[_0x4c0791(0xb2)],'resolved':_0x4d6909};}catch(_0x3038a9){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x3038a9['message']);}if(!_0x185172)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4c0791(0xd8));return{'journeyName':_0x48fe1e,'parentSegment':_0x185172};}export class JourneyListCommand extends BaseCommand{[a18_0x45a513(0x7c)]=a18_0x45a513(0xbb);[a18_0x45a513(0x8c)]=a18_0x45a513(0x133);async[a18_0x45a513(0x12c)](_0x4bb5ab){const _0x3e343b=a18_0x45a513,{options:_0x27915d,args:_0x2927bd,tdx:_0x23fa5d}=_0x4bb5ab,_0x436785=_0x2927bd[0x0],_0x344af4=_0x27915d[_0x3e343b(0xbd)],_0x3839c5=_0x27915d[_0x3e343b(0xb2)];if(!_0x3839c5)return console[_0x3e343b(0xde)]('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0x3e343b(0xf3)),0x1;const _0x54eac9=await withSpinner(_0x3e343b(0xd7),()=>_0x23fa5d[_0x3e343b(0x138)][_0x3e343b(0x117)](_0x3839c5),{'verbose':_0x27915d[_0x3e343b(0x139)]}),_0x5eea4f=_0x54eac9['data'];_0x27915d[_0x3e343b(0x139)]&&(console[_0x3e343b(0xde)](_0x3e343b(0xa9)+_0x3839c5+'\x20(ID:\x20'+_0x5eea4f+')'),_0x436785&&console[_0x3e343b(0xde)]('Pattern:\x20'+_0x436785));const [_0x95922d,_0x1dbc2e,_0x17894b]=await Promise[_0x3e343b(0xc8)]([withSpinner(_0x3e343b(0x94),()=>_0x23fa5d[_0x3e343b(0x138)]['getParentFull'](_0x5eea4f),{'verbose':_0x27915d[_0x3e343b(0x139)]}),withSpinner(_0x3e343b(0x9d),()=>_0x23fa5d[_0x3e343b(0x138)][_0x3e343b(0x77)](_0x5eea4f),{'verbose':_0x27915d['verbose']}),withSpinner(_0x3e343b(0x96),()=>_0x23fa5d['journey']['listJourneysFromParentSegment'](_0x5eea4f),{'verbose':_0x27915d[_0x3e343b(0x139)]})]),_0x525851=_0x95922d['data'],_0x49cf51=_0x1dbc2e[_0x3e343b(0xf1)];let _0x344c0c=_0x17894b[_0x3e343b(0xf1)];const _0x500584=_0x525851[_0x3e343b(0xe1)],_0x42f2fb=new Map();for(const _0x56faf8 of _0x49cf51){_0x42f2fb[_0x3e343b(0xc3)](_0x56faf8['id'],_0x56faf8['name']);}if(_0x436785){const _0x5d2a4e=globToRegex(_0x436785);_0x344c0c=_0x344c0c[_0x3e343b(0x6a)](_0x148247=>_0x5d2a4e[_0x3e343b(0x112)](_0x148247[_0x3e343b(0xaf)]));}console[_0x3e343b(0xde)](_0x3e343b(0x71)+_0x344c0c[_0x3e343b(0xd2)]+_0x3e343b(0x98)+(_0x344c0c['length']!==0x1?'s':''));const _0x882cc=_0x4ecd41=>{const _0x103430=_0x3e343b;return getConsoleNextUrl(_0x27915d[_0x103430(0x8f)],_0x103430(0x7e)+_0x5eea4f+_0x103430(0xcf)+_0x4ecd41+_0x103430(0x11a));};if(_0x27915d[_0x3e343b(0xd0)]===_0x3e343b(0xe5))await handleSDKOutput(_0x344c0c,_0x27915d);else{if(_0x27915d['format']===_0x3e343b(0x12a)){const _0x57df4b=_0x344c0c[_0x3e343b(0x7d)](_0x5ead8e=>({..._0x5ead8e,'url':_0x882cc(_0x5ead8e['id'])}));await handleSDKOutput(_0x57df4b,_0x27915d);}else{console[_0x3e343b(0x116)]('['+_0x3839c5+']');const _0x17f591=new Map(),_0x3fc63a=[];for(const _0x123cb6 of _0x344c0c){if(!_0x123cb6[_0x3e343b(0xfc)]||_0x123cb6[_0x3e343b(0xfc)]===_0x500584)_0x3fc63a[_0x3e343b(0x108)](_0x123cb6);else{const _0x1e3a2f=_0x17f591[_0x3e343b(0x134)](_0x123cb6[_0x3e343b(0xfc)])||[];_0x1e3a2f[_0x3e343b(0x108)](_0x123cb6),_0x17f591[_0x3e343b(0xc3)](_0x123cb6[_0x3e343b(0xfc)],_0x1e3a2f);}}for(const _0x2dbac9 of _0x3fc63a){const _0x2f31d0=_0x344af4?_0x882cc(_0x2dbac9['id']):undefined;console['log'](formatJourneyItem(_0x2dbac9,'',_0x2f31d0));}for(const [_0x317ac6,_0x5a6d43]of _0x17f591){const _0x11c067=_0x42f2fb[_0x3e343b(0x134)](_0x317ac6)||_0x317ac6;console[_0x3e343b(0x116)](_0x3e343b(0xd6)+_0x11c067);for(const _0x11aea5 of _0x5a6d43){const _0x15dab1=_0x344af4?_0x882cc(_0x11aea5['id']):undefined;console['log'](formatJourneyItem(_0x11aea5,'\x20\x20',_0x15dab1));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a18_0x45a513(0x7c)]=a18_0x45a513(0x121);['description']=a18_0x45a513(0x6c);async[a18_0x45a513(0x12c)](_0x47cb92){const _0x37f3c9=a18_0x45a513,{options:_0x467c38,args:_0x2cbbca,tdx:_0x4ceab2}=_0x47cb92,_0x31a427=_0x2cbbca[0x0];if(!_0x31a427)return console['error'](_0x37f3c9(0xe2)),console[_0x37f3c9(0xde)](_0x37f3c9(0xc6)),console[_0x37f3c9(0xde)](_0x37f3c9(0x76)),console[_0x37f3c9(0xde)](_0x37f3c9(0x70)),0x1;_0x467c38[_0x37f3c9(0x139)]&&console[_0x37f3c9(0xde)](_0x37f3c9(0x131)+_0x31a427);const _0x1cbd1b=await resolveJourneyTarget(_0x31a427,_0x467c38[_0x37f3c9(0xb2)],_0x467c38[_0x37f3c9(0x139)]),_0x2e40f8=await withSpinner(_0x37f3c9(0xd7),()=>_0x4ceab2[_0x37f3c9(0x138)][_0x37f3c9(0x117)](_0x1cbd1b[_0x37f3c9(0xb2)]),{'verbose':_0x467c38[_0x37f3c9(0x139)]}),_0x5a187b=_0x2e40f8[_0x37f3c9(0xf1)],_0x208e7d=await withSpinner(_0x37f3c9(0x79),()=>_0x4ceab2[_0x37f3c9(0xfa)][_0x37f3c9(0x82)](_0x5a187b,_0x1cbd1b[_0x37f3c9(0x10b)]),{'verbose':_0x467c38[_0x37f3c9(0x139)]}),_0x3dde8d=_0x208e7d[_0x37f3c9(0xf1)];if(_0x467c38[_0x37f3c9(0xbd)]){const _0x1ebcd5=getConsoleNextUrl(_0x467c38['site'],'/app/ps/'+_0x5a187b+_0x37f3c9(0xcf)+_0x3dde8d+_0x37f3c9(0x126));return console[_0x37f3c9(0xde)](a18_0x5956c7[_0x37f3c9(0xfe)]('βœ”')+_0x37f3c9(0x136)+a18_0x5956c7[_0x37f3c9(0xdb)](_0x1ebcd5)),openBrowser(_0x1ebcd5),0x0;}const _0x27f006=await withSpinner('Getting\x20journey\x20details...',()=>_0x4ceab2[_0x37f3c9(0xfa)][_0x37f3c9(0x124)](_0x3dde8d),{'verbose':_0x467c38[_0x37f3c9(0x139)]}),_0x45b455=_0x27f006['data'],_0x5b186f=_0x467c38['includeStats'];let _0x59fa6d;if(_0x5b186f)try{const _0xa39b98=await withSpinner(_0x37f3c9(0xb5),()=>_0x4ceab2[_0x37f3c9(0xfa)][_0x37f3c9(0x87)](_0x3dde8d),{'verbose':_0x467c38[_0x37f3c9(0x139)]});_0x59fa6d=_0xa39b98['data'];}catch{_0x467c38[_0x37f3c9(0x139)]&&console[_0x37f3c9(0xde)](_0x37f3c9(0x119));}const _0x38a9ef=getConsoleNextUrl(_0x467c38[_0x37f3c9(0x8f)],'/app/ps/'+_0x5a187b+_0x37f3c9(0xcf)+_0x3dde8d+_0x37f3c9(0x126)),_0x3bbd00={'id':_0x45b455['id'],'name':_0x45b455[_0x37f3c9(0xfb)][_0x37f3c9(0x7c)],'description':_0x45b455[_0x37f3c9(0xfb)][_0x37f3c9(0x8c)],'state':_0x45b455[_0x37f3c9(0xfb)]['state'],'paused':_0x45b455[_0x37f3c9(0xfb)]['paused'],'reentry_mode':_0x45b455[_0x37f3c9(0xfb)]['reentryMode'],'stages':_0x45b455[_0x37f3c9(0xfb)][_0x37f3c9(0x90)]?.[_0x37f3c9(0xd2)]||0x0,..._0x45b455[_0x37f3c9(0xfb)][_0x37f3c9(0xb6)]&&{'goal':_0x45b455[_0x37f3c9(0xfb)][_0x37f3c9(0xb6)][_0x37f3c9(0x7c)]},..._0x59fa6d&&{'statistics':{'total_entered':_0x59fa6d[_0x37f3c9(0x73)],'goal_achieved':_0x59fa6d['totalGoalAchieved'],'goal_rate':_0x59fa6d[_0x37f3c9(0x101)],'stages':_0x59fa6d[_0x37f3c9(0x9e)]}},'url':_0x38a9ef};return await handleSingleObjectOutput(_0x3bbd00,_0x467c38),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']='journey:stats';[a18_0x45a513(0x8c)]=a18_0x45a513(0xe9);async[a18_0x45a513(0x12c)](_0x241b37){const _0x40cf46=a18_0x45a513,{options:_0x14dca0,args:_0x134187,tdx:_0x15b2aa}=_0x241b37,_0x10ab8b=_0x134187[0x0];if(!_0x10ab8b)return console[_0x40cf46(0xde)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x40cf46(0xde)](_0x40cf46(0xb0)),0x1;_0x14dca0[_0x40cf46(0x139)]&&console['error'](_0x40cf46(0x131)+_0x10ab8b);const _0x3301fe=await resolveJourneyTarget(_0x10ab8b,_0x14dca0['parentSegment'],_0x14dca0[_0x40cf46(0x139)]),_0x49633d=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x15b2aa['segment'][_0x40cf46(0x117)](_0x3301fe[_0x40cf46(0xb2)]),{'verbose':_0x14dca0[_0x40cf46(0x139)]}),_0x164429=_0x49633d[_0x40cf46(0xf1)],_0x3e1322=await withSpinner(_0x40cf46(0x79),()=>_0x15b2aa['journey'][_0x40cf46(0x82)](_0x164429,_0x3301fe[_0x40cf46(0x10b)]),{'verbose':_0x14dca0[_0x40cf46(0x139)]}),_0x16c52a=_0x3e1322['data'],_0x44cd8a=await withSpinner(_0x40cf46(0xb5),()=>_0x15b2aa['journey']['getStatistics'](_0x16c52a),{'verbose':_0x14dca0[_0x40cf46(0x139)]}),_0x3d44a5=_0x44cd8a[_0x40cf46(0xf1)];if(!_0x3d44a5||_0x3d44a5[_0x40cf46(0xdc)]===null)return console['error'](_0x40cf46(0x107)+_0x3301fe['journeyName']),console[_0x40cf46(0xde)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x5069f9={'journey_id':_0x3d44a5[_0x40cf46(0xdc)],'total_entered':_0x3d44a5['totalEntered'],'goal_achieved':_0x3d44a5[_0x40cf46(0x68)],'goal_rate':_0x3d44a5['goalRate'],'stages':_0x3d44a5[_0x40cf46(0x9e)]?.[_0x40cf46(0x7d)](_0x3efb85=>({'name':_0x3efb85['stageName'],'population':_0x3efb85['population'],'entered':_0x3efb85[_0x40cf46(0x118)],'exited':_0x3efb85[_0x40cf46(0x12e)],'conversion_rate':_0x3efb85['conversionRate']}))},_0x395e6e=_0x14dca0[_0x40cf46(0xb1)];if(_0x395e6e&&_0x3d44a5[_0x40cf46(0x9e)]){const _0x3ad58a=_0x3d44a5[_0x40cf46(0x9e)][_0x40cf46(0xf6)](_0x228616=>_0x228616[_0x40cf46(0x99)][_0x40cf46(0x6f)]()===_0x395e6e[_0x40cf46(0x6f)]());if(_0x3ad58a)return await handleSingleObjectOutput({'stage_name':_0x3ad58a[_0x40cf46(0x99)],'population':_0x3ad58a[_0x40cf46(0xb4)],'entered':_0x3ad58a[_0x40cf46(0x118)],'exited':_0x3ad58a[_0x40cf46(0x12e)],'conversion_rate':_0x3ad58a[_0x40cf46(0xa4)]},_0x14dca0),0x0;console[_0x40cf46(0xde)](_0x40cf46(0xc0)+_0x395e6e+_0x40cf46(0x115));}return await handleSingleObjectOutput(_0x5069f9,_0x14dca0),0x0;}}function a18_0x5278(){const _0x7db61=['map','/app/ps/','then','versionNumber','filePath','resolveJourneyId','stringify','\x27\x20not\x20found\x20in\x20','values','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','getStatistics','Listing\x20folders...','Target\x20directory:\x20','draft','\x20\x20-\x20','description','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','No\x20journeys\x20found','site','journeyStages','session','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','content','Fetching\x20parent\x20segment...','Journey\x20name:\x20','Listing\x20journeys...','(root)','\x20journey','stageName','\x22\x20resumed','isNew','join','Fetching\x20folders...','stages','relativePath','journey:push','\x5c$&','9EzvdGA','\x20(paused)','conversionRate','hasChanges','segmentPushCommand','Usage:\x20journey\x20pause\x20<name-or-path>','getSegment','Parent\x20segment:\x20','size','resume','9356960BmQkem','\x20new\x20files','22xJxSUP','journeyBundleName','Usage:\x20journey\x20stats\x20<name-or-path>','stage','parentSegment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','population','Getting\x20journey\x20statistics...','goal','kind','paused','targetDir','Warning:\x20Could\x20not\x20resolve\x20activation\x20','journey:list','8682248FLQGJJ','web','\x20\x20Parent\x20segment:\x20','\x20\x20Name:\x20','Warning:\x20Stage\x20\x22','\x20\x20Consolidating\x20duplicate\x20segment:\x20','265536NJWxzO','set','\x20journey\x20files\x20to\x20','rule','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Target\x20file:\x20','all','add','\x20changed\x20files','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Pausing\x20journey...','listJourneysFromParentSegment','\x0aPull\x20summary:','/e/','format','\x0aChanges\x20to\x20\x27','length','Error:\x20Journey\x20not\x20found:\x20','has','diff','πŸ“\x20','Resolving\x20parent\x20segment...','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','2933346WAfcjo','audienceId','cyan','journeyId','20owIBOg','error','.yml','segments','rootFolderId','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','user','\x20\x20Target:\x20','table','folderPath','archived','resolveSegment','Show\x20journey\x20statistics','connector_config','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','96NeskHm','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','707230sBRQFw','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','gray','data','Fetching\x20users\x20for\x20email\x20resolution...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20unchanged\x20files','sort','find','Resume\x20a\x20paused\x20journey','segmentName','\x20->\x20','journey','attributes','folderId','helpText','green','repeat','Aborted.','goalRate','buildIdToEmailMap','dim','\x20\x20Folder\x20path:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','Resolved\x20YAML\x20file:\x20','No\x20statistics\x20available\x20for\x20journey:\x20','push','πŸ—ΊοΈ\x20','entries','journeyName','file','Fetching\x20','root\x20folder','launched','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','14FAMeoR','test','dryRun','Usage:\x20journey\x20resume\x20<name-or-path>','\x22\x20not\x20found','log','resolveParentId','entered','\x20\x20Statistics\x20not\x20available','/j/da','\x20(rule\x20match)','yellow','connection','pause','\x20versions)','Folder\x20path:\x20','journey:view','type','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','getJourney','resourceName','/j/da/je','journey:pull','journey:pause','journey:resume','json','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','execute','utf-8','exited','setPhase','70678LGFdXR','Input:\x20','Error:\x20','List\x20journeys\x20in\x20current\x20context','get','Cancelled','\x20Opening\x20','split','segment','verbose','message','\x20=\x20','getActivation','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','βœ”\x20Journey\x20\x22','totalGoalAchieved','βœ”\x20Pulled\x20','filter','absolutePath','Show\x20journey\x20details','no_parent','yes','toLowerCase','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','βœ”\x20Found\x20','Export\x20journey(s)\x20as\x20YAML\x20files','totalEntered','253848OMYjqU','relative','Options:','listFolders','Found\x20','Resolving\x20journey...','Warning:\x20Could\x20not\x20resolve\x20segment\x20','parent_segment','name'];a18_0x5278=function(){return _0x7db61;};return a18_0x5278();}export class JourneyPauseCommand extends BaseCommand{['name']=a18_0x45a513(0x128);[a18_0x45a513(0x8c)]='Pause\x20a\x20running\x20journey';async[a18_0x45a513(0x12c)](_0x21f2a2){const _0x31501c=a18_0x45a513,{options:_0x3cb568,args:_0x18430c,tdx:_0x59da7e}=_0x21f2a2,_0x5811c0=_0x18430c[0x0];if(!_0x5811c0)return console['error'](_0x31501c(0xe2)),console['error'](_0x31501c(0xa7)),0x1;_0x3cb568[_0x31501c(0x139)]&&console[_0x31501c(0xde)](_0x31501c(0x131)+_0x5811c0);const _0x599ffe=await resolveJourneyTarget(_0x5811c0,_0x3cb568[_0x31501c(0xb2)],_0x3cb568[_0x31501c(0x139)]),_0x418788=await withSpinner(_0x31501c(0xd7),()=>_0x59da7e[_0x31501c(0x138)]['resolveParentId'](_0x599ffe['parentSegment']),{'verbose':_0x3cb568[_0x31501c(0x139)]}),_0x2f021c=_0x418788[_0x31501c(0xf1)],_0x31147e=await withSpinner(_0x31501c(0x79),()=>_0x59da7e[_0x31501c(0xfa)][_0x31501c(0x82)](_0x2f021c,_0x599ffe['journeyName']),{'verbose':_0x3cb568[_0x31501c(0x139)]}),_0x50e84d=_0x31147e[_0x31501c(0xf1)];if(!_0x3cb568[_0x31501c(0x6e)]){const _0x525a36=await confirm(_0x31501c(0xcb)+_0x599ffe[_0x31501c(0x10b)]+'\x22?');if(!_0x525a36)return console['error'](_0x31501c(0x135)),0x0;}const _0x1ebd41=await withSpinner(_0x31501c(0xcc),()=>_0x59da7e[_0x31501c(0xfa)][_0x31501c(0x11e)](_0x50e84d),{'verbose':_0x3cb568[_0x31501c(0x139)]}),_0x2006ff=_0x1ebd41['data'];return console[_0x31501c(0xde)](_0x31501c(0x67)+_0x2006ff[_0x31501c(0xfb)]['name']+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a18_0x45a513(0x7c)]=a18_0x45a513(0x129);['description']=a18_0x45a513(0xf7);async['execute'](_0x42b93a){const _0x194019=a18_0x45a513,{options:_0x16ecb8,args:_0x29e511,tdx:_0x1d941a}=_0x42b93a,_0x3de5b0=_0x29e511[0x0];if(!_0x3de5b0)return console[_0x194019(0xde)](_0x194019(0xe2)),console[_0x194019(0xde)](_0x194019(0x114)),0x1;_0x16ecb8[_0x194019(0x139)]&&console['error'](_0x194019(0x131)+_0x3de5b0);const _0x5b5836=await resolveJourneyTarget(_0x3de5b0,_0x16ecb8[_0x194019(0xb2)],_0x16ecb8[_0x194019(0x139)]),_0x58711e=await withSpinner(_0x194019(0xd7),()=>_0x1d941a['segment'][_0x194019(0x117)](_0x5b5836[_0x194019(0xb2)]),{'verbose':_0x16ecb8[_0x194019(0x139)]}),_0x35b503=_0x58711e[_0x194019(0xf1)],_0x1f7518=await withSpinner(_0x194019(0x79),()=>_0x1d941a[_0x194019(0xfa)][_0x194019(0x82)](_0x35b503,_0x5b5836['journeyName']),{'verbose':_0x16ecb8[_0x194019(0x139)]}),_0x703846=_0x1f7518[_0x194019(0xf1)];if(!_0x16ecb8[_0x194019(0x6e)]){const _0x453569=await confirm(_0x194019(0x12b)+_0x5b5836[_0x194019(0x10b)]+'\x22?');if(!_0x453569)return console['error'](_0x194019(0x135)),0x0;}const _0x3cf665=await withSpinner('Resuming\x20journey...',()=>_0x1d941a[_0x194019(0xfa)][_0x194019(0xab)](_0x703846),{'verbose':_0x16ecb8[_0x194019(0x139)]}),_0x1a2fbc=_0x3cf665[_0x194019(0xf1)];return console[_0x194019(0xde)](_0x194019(0x67)+_0x1a2fbc['attributes'][_0x194019(0x7c)]+_0x194019(0x9a)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a18_0x45a513(0x7c)]=a18_0x45a513(0x127);[a18_0x45a513(0x8c)]=a18_0x45a513(0x72);async[a18_0x45a513(0x12c)](_0x205825){const _0x1c8c12=a18_0x45a513,{options:_0x5e9c52,args:_0x261351,tdx:_0x284125}=_0x205825,_0x115ce9=_0x5e9c52,_0x5afd49=_0x261351[0x0],_0x219e60=_0x5afd49&&isYamlFilePath(_0x5afd49),_0x4b16bb=await resolveTarget({'arg':_0x219e60?_0x5afd49:undefined,'contextParent':_0x5e9c52[_0x1c8c12(0xb2)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4b16bb))return _0x4b16bb['errorCode']===_0x1c8c12(0x6d)?(console[_0x1c8c12(0xde)](a18_0x5956c7['yellow'](_0x1c8c12(0xb3))),console[_0x1c8c12(0xde)]('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[_0x1c8c12(0xde)](_0x1c8c12(0x92)),console[_0x1c8c12(0xde)](_0x1c8c12(0xeb)),console['error'](_0x1c8c12(0x66))):(console[_0x1c8c12(0xde)](a18_0x5956c7['red'](_0x1c8c12(0x132)+_0x4b16bb[_0x1c8c12(0x13a)]+'\x0a')),_0x4b16bb[_0x1c8c12(0xfd)]&&console[_0x1c8c12(0xde)](a18_0x5956c7[_0x1c8c12(0xdb)](_0x4b16bb[_0x1c8c12(0xfd)]))),0x1;let _0x153ce8=_0x219e60?undefined:_0x5afd49,_0x3ffe3a,_0x380bde;_0x4b16bb[_0x1c8c12(0x122)]===_0x1c8c12(0x10c)&&(_0x153ce8=_0x4b16bb[_0x1c8c12(0x125)],_0x3ffe3a=_0x4b16bb[_0x1c8c12(0x81)],_0x380bde=_0x4b16bb['folderPath']);const _0x1e1d72=_0x4b16bb['parentName'],_0x8f7c44=_0x4b16bb[_0x1c8c12(0xb9)];_0x115ce9[_0x1c8c12(0x139)]&&(console['error'](_0x1c8c12(0xa9)+_0x1e1d72),console['error'](_0x1c8c12(0x89)+_0x8f7c44),_0x153ce8&&console[_0x1c8c12(0xde)](_0x1c8c12(0x95)+_0x153ce8),_0x3ffe3a&&console[_0x1c8c12(0xde)](_0x1c8c12(0xc7)+_0x3ffe3a),_0x380bde&&console[_0x1c8c12(0xde)](_0x1c8c12(0x120)+_0x380bde));const _0x4a26b8=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x284125[_0x1c8c12(0x138)]['resolveParentId'](_0x1e1d72),{'verbose':_0x5e9c52[_0x1c8c12(0x139)]}),_0x386d82=_0x4a26b8['data'],[_0x5a39b3,_0x21d1d5]=await Promise['all']([withSpinner(_0x1c8c12(0x96),()=>_0x284125['journey'][_0x1c8c12(0xcd)](_0x386d82),{'verbose':_0x5e9c52['verbose']}),withSpinner(_0x1c8c12(0x88),()=>_0x284125[_0x1c8c12(0x138)][_0x1c8c12(0x77)](_0x386d82),{'verbose':_0x5e9c52[_0x1c8c12(0x139)]})]);let _0x294943=_0x5a39b3['data'];const _0x477850=_0x21d1d5[_0x1c8c12(0xf1)],_0x510d68=buildFolderIdToPathMap(_0x477850);if(_0x153ce8){const _0x2da0e9=_0x294943[_0x1c8c12(0x6a)](_0x268c4b=>_0x268c4b[_0x1c8c12(0xaf)]['toLowerCase']()===_0x153ce8[_0x1c8c12(0x6f)]());if(_0x2da0e9[_0x1c8c12(0xd2)]===0x0)return console['error'](_0x1c8c12(0xd3)+_0x153ce8),console['error'](_0x1c8c12(0x123)),0x1;_0x294943=_0x2da0e9;}if(_0x380bde!==undefined){const _0x57eafc=_0x294943['filter'](_0xc587b=>{const _0x1887c9=_0x1c8c12,_0x46cbe4=_0xc587b[_0x1887c9(0xfc)]?_0x510d68['get'](_0xc587b[_0x1887c9(0xfc)])||'':'';return _0x46cbe4===_0x380bde;});if(_0x57eafc[_0x1c8c12(0xd2)]===0x0&&_0x294943[_0x1c8c12(0xd2)]>0x0){console[_0x1c8c12(0xde)]('Error:\x20Journey\x20\x27'+_0x153ce8+_0x1c8c12(0x84)+(_0x380bde||_0x1c8c12(0x10e))),console[_0x1c8c12(0xde)](_0x1c8c12(0x8d));for(const _0x2fbf72 of _0x294943){const _0x22e3c6=_0x2fbf72[_0x1c8c12(0xfc)]?_0x510d68[_0x1c8c12(0x134)](_0x2fbf72[_0x1c8c12(0xfc)])||'':'';console[_0x1c8c12(0xde)](_0x1c8c12(0x8b)+(_0x22e3c6||_0x1c8c12(0x97))+'/'+_0x2fbf72['journeyBundleName']);}return 0x1;}_0x294943=_0x57eafc;}if(_0x294943[_0x1c8c12(0xd2)]===0x0)return console[_0x1c8c12(0xde)](_0x1c8c12(0x8e)),0x0;const _0x14602e=new Map();for(const _0x33ef1c of _0x294943){const _0x1f0ffd=_0x33ef1c['journeyBundleId'];!_0x14602e[_0x1c8c12(0xd4)](_0x1f0ffd)&&_0x14602e['set'](_0x1f0ffd,[]),_0x14602e[_0x1c8c12(0x134)](_0x1f0ffd)[_0x1c8c12(0x108)](_0x33ef1c);}for(const _0x22ccb7 of _0x14602e[_0x1c8c12(0x85)]()){_0x22ccb7[_0x1c8c12(0xf5)]((_0x5a4165,_0x49f392)=>(_0x5a4165['versionNumber']||0x0)-(_0x49f392[_0x1c8c12(0x80)]||0x0));}const _0x5255e7=[],[_0x20cce4,_0x2d3aeb]=await Promise[_0x1c8c12(0xc8)]([withSpinner(_0x1c8c12(0xf2),()=>_0x284125[_0x1c8c12(0xe3)][_0x1c8c12(0x102)](),{'verbose':_0x5e9c52['verbose']})[_0x1c8c12(0x7f)](_0x21ffa7=>_0x21ffa7[_0x1c8c12(0xf1)]),withSpinner(_0x1c8c12(0x105),()=>_0x284125[_0x1c8c12(0x11d)]['buildIdToNameMap'](),{'verbose':_0x5e9c52['verbose']})[_0x1c8c12(0x7f)](_0x4fff06=>_0x4fff06[_0x1c8c12(0xf1)])]);for(const _0x2b6a76 of _0x14602e['values']()){const _0x20a636=_0x2b6a76[0x0][_0x1c8c12(0xaf)],_0x2c396b=_0x2b6a76[0x0]['folderId'],_0x5d4614=_0x2c396b?_0x510d68['get'](_0x2c396b)||'':'',_0x266d0d=_0x5d4614?a18_0xd04e2e[_0x1c8c12(0x9c)](_0x8f7c44,_0x5d4614):_0x8f7c44,_0x3f115e=_0x3ffe3a||a18_0xd04e2e[_0x1c8c12(0x9c)](_0x266d0d,sanitizeFileName(_0x20a636)+_0x1c8c12(0xdf));let _0x1c6918,_0x4eb119;if(existsSync(_0x3f115e))try{const _0x31d586=readFileSync(_0x3f115e,_0x1c8c12(0x12d)),_0x1ba9a0=parseYamlString(_0x31d586);_0x4eb119=_0x1ba9a0,_0x1c6918=buildRuleToNameMapping(_0x1ba9a0),_0x115ce9[_0x1c8c12(0x139)]&&_0x1c6918[_0x1c8c12(0xaa)]>0x0&&console['error'](_0x1c8c12(0x78)+_0x1c6918[_0x1c8c12(0xaa)]+_0x1c8c12(0x86)+_0x20a636);}catch(_0x589488){_0x115ce9[_0x1c8c12(0x139)]&&console[_0x1c8c12(0xde)](_0x1c8c12(0xed)+_0x589488[_0x1c8c12(0x13a)]);}const _0x1728a6=[],_0x1aadfa=new Set(),_0x43f1ad=new Map(),_0x18c19c=new Map(),_0x5915b1=new Set(),_0x78f2df=new Map(),_0x4ed633=new Map(),_0xc5eec5=createJumpTargetCache();await withProgressSpinner(_0x1c8c12(0x10d)+_0x20a636+'...',async _0x43d5bb=>{const _0xa7e2a2=_0x1c8c12;for(const _0xc0193e of _0x2b6a76){const _0x192cba=_0x2b6a76['length']>0x1?_0xc0193e[_0xa7e2a2(0xaf)]+'\x20v'+(_0xc0193e[_0xa7e2a2(0x80)]||0x1):_0xc0193e[_0xa7e2a2(0xaf)];_0x43d5bb[_0xa7e2a2(0x12f)](_0xa7e2a2(0x10d)+_0x192cba);const _0x298a4f=await _0x284125[_0xa7e2a2(0xfa)][_0xa7e2a2(0x124)](_0xc0193e['id']),_0x3bc7cc=_0x298a4f['attributes']?.[_0xa7e2a2(0xda)],_0x421fc9={'resolveSegment':async _0x3b677b=>{const _0x35c6e8=_0xa7e2a2;if(!_0x3bc7cc)return{'name':_0x3b677b,'isJourneyLocal':![]};const _0x31a269=_0x43f1ad[_0x35c6e8(0x134)](_0x3b677b);if(_0x31a269)return _0x31a269;try{const _0x102ae9=await _0x284125[_0x35c6e8(0x138)][_0x35c6e8(0xa8)](_0x3bc7cc,_0x3b677b),_0x31f57a=_0x102ae9[_0x35c6e8(0xb7)]===SEGMENT_KIND_JOURNEY;let _0x1500bc,_0x409d8a=_0x102ae9[_0x35c6e8(0x7c)];if(_0x31f57a&&_0x102ae9['rule']){const _0x50aaf8=await segmentResponseToDef(_0x102ae9,{'resolveSegmentName':async _0x5bc6fb=>{const _0x22ef61=_0x35c6e8,_0x68c4b4=_0x43f1ad['get'](_0x5bc6fb);if(_0x68c4b4)return _0x68c4b4[_0x22ef61(0x7c)];const _0x307894=await _0x421fc9[_0x22ef61(0xe8)](_0x5bc6fb);return _0x307894['name'];}}),_0x3c9f9a=_0x50aaf8['rule'];_0x1500bc={'description':_0x102ae9[_0x35c6e8(0x8c)],'rule':_0x3c9f9a};const _0x4ed4b1=serializeRule(_0x3c9f9a),_0x7514b0=_0x18c19c[_0x35c6e8(0x134)](_0x4ed4b1);if(_0x7514b0)_0x409d8a=_0x7514b0,_0x1500bc=undefined,_0x115ce9['verbose']&&console[_0x35c6e8(0xde)](_0x35c6e8(0xc1)+_0x102ae9[_0x35c6e8(0x7c)]+_0x35c6e8(0xf9)+_0x7514b0);else{let _0x804317=![];if(_0x1c6918){const _0xe4c52a=_0x1c6918['get'](_0x4ed4b1);if(_0xe4c52a){const _0x5eae03=_0xe4c52a[_0x35c6e8(0xf6)](_0x19d78e=>!_0x1aadfa[_0x35c6e8(0xd4)](_0x19d78e));_0x5eae03&&(_0x409d8a=_0x5eae03,_0x1aadfa[_0x35c6e8(0xc9)](_0x5eae03),_0x18c19c['set'](_0x4ed4b1,_0x5eae03),_0x804317=!![],_0x115ce9[_0x35c6e8(0x139)]&&console[_0x35c6e8(0xde)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x5eae03+_0x35c6e8(0x11b)));}}if(!_0x804317){const _0x5f0fac=generateJourneyLocalName(_0x102ae9[_0x35c6e8(0x7c)]);_0x5f0fac&&(_0x409d8a=_0x5f0fac);let _0x2dc1a8=_0x409d8a,_0x339b6e=0x2;while(_0x1aadfa[_0x35c6e8(0xd4)](_0x2dc1a8)){_0x2dc1a8=_0x409d8a+'_'+_0x339b6e,_0x339b6e++;}_0x1aadfa[_0x35c6e8(0xc9)](_0x2dc1a8),_0x18c19c[_0x35c6e8(0xc3)](_0x4ed4b1,_0x2dc1a8),_0x409d8a=_0x2dc1a8;}}}const _0x1b9a59={'name':_0x409d8a,'isJourneyLocal':_0x31f57a,'definition':_0x1500bc};return _0x43f1ad[_0x35c6e8(0xc3)](_0x3b677b,_0x1b9a59),_0x1b9a59;}catch(_0x2c1ba9){return _0x5e9c52[_0x35c6e8(0x139)]&&console['error'](_0x35c6e8(0x7a)+_0x3b677b+':\x20'+_0x2c1ba9[_0x35c6e8(0x13a)]),{'name':_0x3b677b,'isJourneyLocal':![]};}},'resolveActivation':async _0x5908ee=>{const _0x824390=_0xa7e2a2,_0x2605b2=_0x78f2df[_0x824390(0x134)](_0x5908ee);if(_0x2605b2)return _0x2605b2;try{const _0x3aa03a=await _0x284125[_0x824390(0xfa)][_0x824390(0x65)](_0xc0193e['id'],_0x5908ee),_0x3018ba=journeyActivationStepToYaml(_0x3aa03a,_0x20cce4,_0x2d3aeb),_0x78e13c=JSON[_0x824390(0x83)]({'name':_0x3018ba[_0x824390(0x7c)],'connection':_0x3018ba[_0x824390(0x11d)],'connector_config':_0x3018ba[_0x824390(0xea)]}),_0x513887=_0x4ed633[_0x824390(0x134)](_0x78e13c);if(_0x513887){const _0x4f043b={'name':_0x513887,'isJourneyLocal':!![],'definition':_0x3018ba};return _0x78f2df[_0x824390(0xc3)](_0x5908ee,_0x4f043b),_0x4f043b;}const _0x4111ae=_0x3aa03a[_0x824390(0xfb)]['activationParams'][_0x824390(0x7c)]||_0x5908ee,_0x27066f=sanitizeYamlKey(_0x4111ae)||'activation_'+_0x5908ee;let _0x3e4c50=_0x27066f,_0x475efa=0x2;while(_0x5915b1['has'](_0x3e4c50)){_0x3e4c50=_0x27066f+'_'+_0x475efa,_0x475efa++;}_0x5915b1[_0x824390(0xc9)](_0x3e4c50),_0x4ed633[_0x824390(0xc3)](_0x78e13c,_0x3e4c50);const _0x29e7b0={'name':_0x3e4c50,'isJourneyLocal':!![],'definition':_0x3018ba};return _0x78f2df[_0x824390(0xc3)](_0x5908ee,_0x29e7b0),_0x29e7b0;}catch(_0x5e5730){return _0x5e9c52[_0x824390(0x139)]&&console[_0x824390(0xde)](_0x824390(0xba)+_0x5908ee+':\x20'+_0x5e5730[_0x824390(0x13a)]),{'name':_0x5908ee,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x35bd82,_0x469481)=>{const _0x41d173=_0xa7e2a2;return resolveJumpTarget(_0x35bd82,_0x469481,_0xc5eec5,_0x31947c=>_0x284125[_0x41d173(0xfa)][_0x41d173(0x124)](_0x31947c));}},_0x499997=await journeyResponseToDef(_0x298a4f,_0x421fc9);_0x1728a6[_0xa7e2a2(0x108)]({'item':_0xc0193e,'yaml':_0x499997});}},{'verbose':_0x5e9c52[_0x1c8c12(0x139)]});const _0x22820e=buildMergedJourneyDef(_0x1728a6,_0x1c6918),_0x3f81de=normalizeJourneyDef(_0x22820e,_0x4eb119),_0x116de7=toYamlString(_0x3f81de),_0x5c3b7d=_0x3ffe3a||a18_0xd04e2e[_0x1c8c12(0x9c)](_0x266d0d,sanitizeFileName(_0x20a636)+_0x1c8c12(0xdf));!_0x3ffe3a&&_0x5d4614&&!existsSync(_0x266d0d)&&mkdirSync(_0x266d0d,{'recursive':!![]});const _0x3e173d=a18_0xd04e2e[_0x1c8c12(0x75)](process['cwd'](),_0x5c3b7d);if(existsSync(_0x5c3b7d)){const _0xeec606=readFileSync(_0x5c3b7d,'utf-8'),_0x20fabb=generateDiff(_0xeec606,_0x116de7),_0x30a136=hasChanges(_0x20fabb);_0x5255e7[_0x1c8c12(0x108)]({'relativePath':_0x3e173d,'absolutePath':_0x5c3b7d,'content':_0x116de7,'isNew':![],'hasChanges':_0x30a136,'diff':_0x30a136?formatDiffWithColors(_0x20fabb):undefined});}else _0x5255e7['push']({'relativePath':_0x3e173d,'absolutePath':_0x5c3b7d,'content':_0x116de7,'isNew':!![],'hasChanges':![]});}const _0x60f820=_0x5255e7['filter'](_0x208295=>_0x208295[_0x1c8c12(0x9b)]),_0x4655f5=_0x5255e7[_0x1c8c12(0x6a)](_0x1157de=>!_0x1157de['isNew']&&_0x1157de[_0x1c8c12(0xa5)]),_0x11a293=_0x5255e7[_0x1c8c12(0x6a)](_0x1190c9=>!_0x1190c9[_0x1c8c12(0x9b)]&&!_0x1190c9[_0x1c8c12(0xa5)]),_0x37f4e6=_0x294943[_0x1c8c12(0xd2)],_0xf0939c=_0x14602e[_0x1c8c12(0xaa)],_0x114aec=_0x37f4e6>_0xf0939c?'\x20('+_0x37f4e6+_0x1c8c12(0x11f):'';console[_0x1c8c12(0xde)](_0x1c8c12(0xce)),console[_0x1c8c12(0xde)]('\x20\x20'+a18_0x5956c7[_0x1c8c12(0xdb)](_0xf0939c+'\x20journeys')+a18_0x5956c7['dim'](_0x114aec)),console[_0x1c8c12(0xde)]('\x20\x20'+a18_0x5956c7[_0x1c8c12(0xfe)]('+\x20'+_0x60f820[_0x1c8c12(0xd2)]+_0x1c8c12(0xad))),console[_0x1c8c12(0xde)]('\x20\x20'+a18_0x5956c7[_0x1c8c12(0x11c)]('~\x20'+_0x4655f5[_0x1c8c12(0xd2)]+_0x1c8c12(0xca))),console[_0x1c8c12(0xde)]('\x20\x20'+a18_0x5956c7[_0x1c8c12(0x103)]('=\x20'+_0x11a293[_0x1c8c12(0xd2)]+_0x1c8c12(0xf4))),console['error'](_0x1c8c12(0xe4)+a18_0x5956c7[_0x1c8c12(0xdb)](_0x8f7c44)+'\x0a');if(_0x4655f5[_0x1c8c12(0xd2)]>0x0)for(const _0x303fdc of _0x4655f5){console[_0x1c8c12(0xde)](_0x1c8c12(0xd1)+_0x303fdc[_0x1c8c12(0x9f)]+'\x27:'),console[_0x1c8c12(0xde)]('─'[_0x1c8c12(0xff)](0x3c)),console[_0x1c8c12(0xde)](_0x303fdc[_0x1c8c12(0xd5)]),console[_0x1c8c12(0xde)]('─'[_0x1c8c12(0xff)](0x3c));}if(_0x115ce9[_0x1c8c12(0x113)])return console[_0x1c8c12(0xde)](a18_0x5956c7['yellow'](_0x1c8c12(0x110))),0x0;if(_0x60f820[_0x1c8c12(0xd2)]===0x0&&_0x4655f5['length']===0x0)return console['error'](a18_0x5956c7[_0x1c8c12(0xfe)](_0x1c8c12(0xef))),saveSessionContext({'parent_segment':_0x1e1d72},_0x115ce9['session']),console['error'](a18_0x5956c7['green']('βœ”\x20Context\x20set:\x20'+a18_0x5956c7[_0x1c8c12(0x103)](_0x1c8c12(0x7b))+'\x20=\x20'+a18_0x5956c7['cyan'](_0x1e1d72))),0x0;if(!_0x115ce9[_0x1c8c12(0x6e)]&&(_0x60f820[_0x1c8c12(0xd2)]>0x0||_0x4655f5['length']>0x0)){const _0x356997=await confirmKey('Write\x20'+(_0x60f820[_0x1c8c12(0xd2)]+_0x4655f5[_0x1c8c12(0xd2)])+'\x20files?');if(!_0x356997)return console[_0x1c8c12(0xde)](_0x1c8c12(0x100)),0x1;}!existsSync(_0x8f7c44)&&mkdirSync(_0x8f7c44,{'recursive':!![]});for(const _0x42e42f of _0x5255e7){(_0x42e42f['isNew']||_0x42e42f[_0x1c8c12(0xa5)])&&writeFileSync(_0x42e42f[_0x1c8c12(0x6b)],_0x42e42f[_0x1c8c12(0x93)],_0x1c8c12(0x12d));}return console[_0x1c8c12(0xde)](a18_0x5956c7['green'](_0x1c8c12(0x69)+(_0x60f820['length']+_0x4655f5['length'])+_0x1c8c12(0xc4)+_0x8f7c44)),saveSessionContext({'parent_segment':_0x1e1d72},_0x115ce9[_0x1c8c12(0x91)]),console[_0x1c8c12(0xde)](a18_0x5956c7['green']('βœ”\x20Context\x20set:\x20'+a18_0x5956c7[_0x1c8c12(0x103)](_0x1c8c12(0x7b))+_0x1c8c12(0x13b)+a18_0x5956c7['cyan'](_0x1e1d72))),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a18_0x45a513(0xa0);[a18_0x45a513(0x8c)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';['segmentPushCommand']=new SegmentPushCommand();async[a18_0x45a513(0x12c)](_0x3c9d83){const _0x5429d2=a18_0x45a513,_0x54643d={..._0x3c9d83,'options':{..._0x3c9d83['options'],'journeysOnly':!![]}};return this[_0x5429d2(0xa6)][_0x5429d2(0x12c)](_0x54643d);}}
@@ -1 +1 @@
1
- function a19_0x309f(_0x1a0003,_0x42f7fa){_0x1a0003=_0x1a0003-0xb5;const _0x51a278=a19_0x51a2();let _0x309f9e=_0x51a278[_0x1a0003];return _0x309f9e;}const a19_0x1b1698=a19_0x309f;(function(_0x27efce,_0x4abee6){const _0x48d19f=a19_0x309f,_0x43e667=_0x27efce();while(!![]){try{const _0x949b92=-parseInt(_0x48d19f(0xdb))/0x1*(parseInt(_0x48d19f(0xd0))/0x2)+-parseInt(_0x48d19f(0xca))/0x3+-parseInt(_0x48d19f(0xb8))/0x4*(-parseInt(_0x48d19f(0xc8))/0x5)+parseInt(_0x48d19f(0xc9))/0x6*(-parseInt(_0x48d19f(0xd9))/0x7)+-parseInt(_0x48d19f(0xdd))/0x8+-parseInt(_0x48d19f(0xf0))/0x9*(parseInt(_0x48d19f(0xe7))/0xa)+parseInt(_0x48d19f(0xeb))/0xb;if(_0x949b92===_0x4abee6)break;else _0x43e667['push'](_0x43e667['shift']());}catch(_0x11ef35){_0x43e667['push'](_0x43e667['shift']());}}}(a19_0x51a2,0x77218));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a19_0x23f054 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a19_0x1b1698(0xd3)]='journey:validate';[a19_0x1b1698(0xe8)]=a19_0x1b1698(0xb9);async[a19_0x1b1698(0xbd)](_0x58b46e){const _0x289916=a19_0x1b1698,{options:_0xf3b3e0,args:_0x20b6e2}=_0x58b46e,_0x564122=_0xf3b3e0,_0x1a8ab5=await resolveTarget({'arg':_0x20b6e2[0x0],'contextParent':_0xf3b3e0[_0x289916(0xb5)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1a8ab5))return _0x1a8ab5[_0x289916(0xf1)]===_0x289916(0xc5)?(console[_0x289916(0xcd)](a19_0x23f054[_0x289916(0xe2)](_0x289916(0xe5))),console[_0x289916(0xcd)](_0x289916(0xc1)),console[_0x289916(0xcd)](_0x289916(0xba)),console[_0x289916(0xcd)](_0x289916(0xd4))):(console['error'](a19_0x23f054[_0x289916(0xbf)](_0x289916(0xee)+_0x1a8ab5[_0x289916(0xc2)]+'\x0a')),_0x1a8ab5[_0x289916(0xd6)]&&console[_0x289916(0xcd)](a19_0x23f054[_0x289916(0xd1)](_0x1a8ab5[_0x289916(0xd6)]))),0x1;const _0x4524b8=_0x1a8ab5[_0x289916(0xdf)],_0x434a27=_0x1a8ab5[_0x289916(0xc3)]==='file'?_0x1a8ab5[_0x289916(0xbe)]:undefined;if(!_0x434a27&&!existsSync(_0x4524b8))return console[_0x289916(0xcd)](a19_0x23f054[_0x289916(0xbf)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4524b8+'\x0a')),0x1;let _0x4371a0;if(_0x434a27){if(!_0x434a27[_0x289916(0xbc)](_0x289916(0xc4))&&!_0x434a27[_0x289916(0xbc)](_0x289916(0xe9)))return console[_0x289916(0xcd)](a19_0x23f054[_0x289916(0xbf)](_0x289916(0xdc)+_0x434a27+'\x0a')),0x1;_0x4371a0=[_0x434a27];}else _0x4371a0=findYamlFiles(_0x4524b8);if(_0x4371a0[_0x289916(0xcb)]===0x0)return console[_0x289916(0xcd)](a19_0x23f054['red'](_0x289916(0xe3)+_0x4524b8+'\x0a')),0x1;const _0x4fccf8=validateYamlFiles(_0x4371a0,_0x4524b8,{'filterType':_0x289916(0xed)}),_0x3ae963=calculateSummary(_0x4fccf8),_0x46ca61=_0x4fccf8[_0x289916(0xec)](isValidationResult);if(_0x46ca61['length']===0x0)return console[_0x289916(0xcd)](a19_0x23f054[_0x289916(0xe2)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x4524b8+'\x0a')),_0x3ae963[_0x289916(0xc6)]>0x0&&console[_0x289916(0xcd)](a19_0x23f054['dim']('('+_0x3ae963[_0x289916(0xc6)]+_0x289916(0xb6))),0x0;for(const _0x1c172a of _0x4fccf8){if(!isValidationResult(_0x1c172a)){_0x564122['verbose']&&console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xda)]('-\x20'+_0x1c172a[_0x289916(0xcc)]+_0x289916(0xd2)+_0x1c172a['reason']+')'));continue;}const {relativePath:_0x5ed872,source:_0xa35def,result:_0x331e53}=_0x1c172a;if(_0x331e53['valid']&&_0x331e53['warnings'][_0x289916(0xcb)]===0x0)_0x564122[_0x289916(0xd7)]&&console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xe4)]('βœ”\x20'+_0x5ed872));else _0x331e53[_0x289916(0xcf)]?(console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xe2)]('⚠\x20'+_0x5ed872+':\x20'+_0x331e53[_0x289916(0xd8)]['length']+_0x289916(0xe1))),console[_0x289916(0xce)](formatValidationResult(_0x331e53,_0xa35def,_0x5ed872))):(console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xbf)]('βœ–\x20'+_0x5ed872+':\x20'+_0x331e53[_0x289916(0xc0)][_0x289916(0xcb)]+'\x20error(s)')),console[_0x289916(0xce)](formatValidationResult(_0x331e53,_0xa35def,_0x5ed872)));}return console[_0x289916(0xce)](''),_0x3ae963[_0x289916(0xbb)]?(console['log'](a19_0x23f054[_0x289916(0xbf)]('Validation\x20failed:\x20'+_0x3ae963[_0x289916(0xd5)]+_0x289916(0xde)+_0x3ae963[_0x289916(0xe0)]+_0x289916(0xb7))),_0x3ae963['warningCount']>0x0&&console['log'](a19_0x23f054[_0x289916(0xe2)](_0x3ae963[_0x289916(0xe6)]+_0x289916(0xc7))),_0x3ae963[_0x289916(0xc6)]>0x0&&console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xda)](_0x3ae963[_0x289916(0xc6)]+_0x289916(0xea))),0x1):(console['log'](a19_0x23f054['green']('βœ”\x20All\x20'+_0x3ae963['validCount']+_0x289916(0xef))),_0x3ae963['warningCount']>0x0&&console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xe2)](_0x3ae963[_0x289916(0xe6)]+_0x289916(0xc7))),_0x3ae963[_0x289916(0xc6)]>0x0&&console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xda)](_0x3ae963[_0x289916(0xc6)]+_0x289916(0xea))),0x0);}}function a19_0x51a2(){const _0x262a16=['targetDir','validCount','\x20warning(s)','yellow','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','warningCount','2154940KzmLNM','description','.yaml','\x20segment\x20file(s)\x20skipped','22753588ivJIab','filter','journey','Error:\x20','\x20journey(s)\x20valid','36hKyLfH','errorCode','parentSegment','\x20segment\x20file(s)\x20skipped)','\x20valid','8236eNTfjm','Validate\x20journey\x20YAML\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','hasErrors','endsWith','execute','filePath','red','errors','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','message','type','.yml','no_parent','skippedCount','\x20warning(s)\x20found','1265ykUUhQ','3306ninnTB','386049eRmBVv','length','relativePath','error','log','valid','30auQbTO','cyan','\x20(skipped:\x20','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','invalidCount','helpText','verbose','warnings','5768LQNIJe','dim','8081GrfaXe','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','4284616mUpYJS','\x20journey(s)\x20with\x20errors,\x20'];a19_0x51a2=function(){return _0x262a16;};return a19_0x51a2();}
1
+ function a19_0x4ff1(){const _0x384a59=['endsWith','log','\x20segment\x20file(s)\x20skipped','invalidCount','warnings','name','filePath','validCount','hasErrors','green','\x20valid','Validate\x20journey\x20YAML\x20files','journey','188SinXmj','verbose','helpText','\x20(skipped:\x20','1079706nDzCZD','red','736XvmOEy','.yaml','targetDir','reason','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','file','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','No\x20journey\x20YAML\x20files\x20found\x20in\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','warningCount','\x20journey(s)\x20with\x20errors,\x20','valid','614880MmucWQ','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','error','skippedCount','no_parent','parentSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','7819056cbghMC','relativePath','length','520680xCuTSR','filter','\x20error(s)','17878EqmUqy','execute','yellow','134345ktTCAO','cwd','\x20journey(s)\x20valid','errorCode','.yml','cyan','message','Error:\x20','description','\x20warning(s)','errors','7377NZqyfD'];a19_0x4ff1=function(){return _0x384a59;};return a19_0x4ff1();}const a19_0x9508bd=a19_0x2624;function a19_0x2624(_0x1d1cab,_0x3727f0){_0x1d1cab=_0x1d1cab-0xc4;const _0x4ff107=a19_0x4ff1();let _0x262453=_0x4ff107[_0x1d1cab];return _0x262453;}(function(_0x32a1c2,_0x9a6c77){const _0xe6e650=a19_0x2624,_0x2455e9=_0x32a1c2();while(!![]){try{const _0x2a0fc4=-parseInt(_0xe6e650(0xf5))/0x1+-parseInt(_0xe6e650(0xef))/0x2+parseInt(_0xe6e650(0xc4))/0x3*(-parseInt(_0xe6e650(0xd2))/0x4)+-parseInt(_0xe6e650(0xe4))/0x5+parseInt(_0xe6e650(0xd6))/0x6+parseInt(_0xe6e650(0xf2))/0x7*(-parseInt(_0xe6e650(0xd8))/0x8)+parseInt(_0xe6e650(0xec))/0x9;if(_0x2a0fc4===_0x9a6c77)break;else _0x2455e9['push'](_0x2455e9['shift']());}catch(_0x71711f){_0x2455e9['push'](_0x2455e9['shift']());}}}(a19_0x4ff1,0x2c135));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a19_0x48af3d from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a19_0x9508bd(0xca)]='journey:validate';[a19_0x9508bd(0xfd)]=a19_0x9508bd(0xd0);async[a19_0x9508bd(0xf3)](_0x22cd75){const _0x9e8a56=a19_0x9508bd,{options:_0x43903e,args:_0x4a7edc}=_0x22cd75,_0x9b04e1=_0x43903e,_0x3ad03a=await resolveTarget({'arg':_0x4a7edc[0x0],'contextParent':_0x43903e[_0x9e8a56(0xea)],'cwd':process[_0x9e8a56(0xf6)]()});if(!isSuccessfulResolution(_0x3ad03a))return _0x3ad03a[_0x9e8a56(0xf8)]===_0x9e8a56(0xe9)?(console['error'](a19_0x48af3d['yellow'](_0x9e8a56(0xdc))),console[_0x9e8a56(0xe7)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x9e8a56(0xe7)](_0x9e8a56(0xe6)),console[_0x9e8a56(0xe7)](_0x9e8a56(0xeb))):(console[_0x9e8a56(0xe7)](a19_0x48af3d['red'](_0x9e8a56(0xfc)+_0x3ad03a[_0x9e8a56(0xfb)]+'\x0a')),_0x3ad03a['helpText']&&console['error'](a19_0x48af3d[_0x9e8a56(0xfa)](_0x3ad03a[_0x9e8a56(0xd4)]))),0x1;const _0x2da6af=_0x3ad03a[_0x9e8a56(0xda)],_0x2ee8ac=_0x3ad03a['type']===_0x9e8a56(0xdd)?_0x3ad03a[_0x9e8a56(0xcb)]:undefined;if(!_0x2ee8ac&&!existsSync(_0x2da6af))return console[_0x9e8a56(0xe7)](a19_0x48af3d[_0x9e8a56(0xd7)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2da6af+'\x0a')),0x1;let _0xf97220;if(_0x2ee8ac){if(!_0x2ee8ac['endsWith'](_0x9e8a56(0xf9))&&!_0x2ee8ac[_0x9e8a56(0xc5)](_0x9e8a56(0xd9)))return console[_0x9e8a56(0xe7)](a19_0x48af3d['red'](_0x9e8a56(0xe0)+_0x2ee8ac+'\x0a')),0x1;_0xf97220=[_0x2ee8ac];}else _0xf97220=findYamlFiles(_0x2da6af);if(_0xf97220[_0x9e8a56(0xee)]===0x0)return console[_0x9e8a56(0xe7)](a19_0x48af3d['red'](_0x9e8a56(0xde)+_0x2da6af+'\x0a')),0x1;const _0x50ba4a=validateYamlFiles(_0xf97220,_0x2da6af,{'filterType':_0x9e8a56(0xd1)}),_0x137bb9=calculateSummary(_0x50ba4a),_0x2f090e=_0x50ba4a[_0x9e8a56(0xf0)](isValidationResult);if(_0x2f090e[_0x9e8a56(0xee)]===0x0)return console[_0x9e8a56(0xe7)](a19_0x48af3d[_0x9e8a56(0xf4)](_0x9e8a56(0xdf)+_0x2da6af+'\x0a')),_0x137bb9[_0x9e8a56(0xe8)]>0x0&&console[_0x9e8a56(0xe7)](a19_0x48af3d[_0x9e8a56(0xe5)]('('+_0x137bb9[_0x9e8a56(0xe8)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x18835c of _0x50ba4a){if(!isValidationResult(_0x18835c)){_0x9b04e1['verbose']&&console['log'](a19_0x48af3d['dim']('-\x20'+_0x18835c[_0x9e8a56(0xed)]+_0x9e8a56(0xd5)+_0x18835c[_0x9e8a56(0xdb)]+')'));continue;}const {relativePath:_0x11196a,source:_0x4a440d,result:_0x4cbb33}=_0x18835c;if(_0x4cbb33[_0x9e8a56(0xe3)]&&_0x4cbb33[_0x9e8a56(0xc9)][_0x9e8a56(0xee)]===0x0)_0x9b04e1[_0x9e8a56(0xd3)]&&console[_0x9e8a56(0xc6)](a19_0x48af3d[_0x9e8a56(0xce)]('βœ”\x20'+_0x11196a));else _0x4cbb33[_0x9e8a56(0xe3)]?(console[_0x9e8a56(0xc6)](a19_0x48af3d[_0x9e8a56(0xf4)]('⚠\x20'+_0x11196a+':\x20'+_0x4cbb33[_0x9e8a56(0xc9)][_0x9e8a56(0xee)]+_0x9e8a56(0xfe))),console[_0x9e8a56(0xc6)](formatValidationResult(_0x4cbb33,_0x4a440d,_0x11196a))):(console[_0x9e8a56(0xc6)](a19_0x48af3d['red']('βœ–\x20'+_0x11196a+':\x20'+_0x4cbb33[_0x9e8a56(0xff)]['length']+_0x9e8a56(0xf1))),console['log'](formatValidationResult(_0x4cbb33,_0x4a440d,_0x11196a)));}return console[_0x9e8a56(0xc6)](''),_0x137bb9[_0x9e8a56(0xcd)]?(console[_0x9e8a56(0xc6)](a19_0x48af3d['red']('Validation\x20failed:\x20'+_0x137bb9[_0x9e8a56(0xc8)]+_0x9e8a56(0xe2)+_0x137bb9[_0x9e8a56(0xcc)]+_0x9e8a56(0xcf))),_0x137bb9[_0x9e8a56(0xe1)]>0x0&&console[_0x9e8a56(0xc6)](a19_0x48af3d['yellow'](_0x137bb9[_0x9e8a56(0xe1)]+'\x20warning(s)\x20found')),_0x137bb9[_0x9e8a56(0xe8)]>0x0&&console['log'](a19_0x48af3d[_0x9e8a56(0xe5)](_0x137bb9['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x1):(console['log'](a19_0x48af3d[_0x9e8a56(0xce)]('βœ”\x20All\x20'+_0x137bb9[_0x9e8a56(0xcc)]+_0x9e8a56(0xf7))),_0x137bb9[_0x9e8a56(0xe1)]>0x0&&console[_0x9e8a56(0xc6)](a19_0x48af3d['yellow'](_0x137bb9[_0x9e8a56(0xe1)]+'\x20warning(s)\x20found')),_0x137bb9['skippedCount']>0x0&&console[_0x9e8a56(0xc6)](a19_0x48af3d[_0x9e8a56(0xe5)](_0x137bb9[_0x9e8a56(0xe8)]+_0x9e8a56(0xc7))),0x0);}}