@treasuredata/tdx 2026.3.6 → 2026.3.8
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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.d.ts.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/profiles-command.js.map +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.d.ts.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/user-command.js.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function a25_0x4c82(_0x19b602,_0x59ed91){_0x19b602=_0x19b602-0xd8;const _0x4ca130=a25_0x4ca1();let _0x4c827b=_0x4ca130[_0x19b602];return _0x4c827b;}const a25_0x12cf62=a25_0x4c82;(function(_0x4bb757,_0x3f9161){const _0x3d28dc=a25_0x4c82,_0x1b593c=_0x4bb757();while(!![]){try{const _0x15a92e=parseInt(_0x3d28dc(0x125))/0x1*(-parseInt(_0x3d28dc(0x114))/0x2)+parseInt(_0x3d28dc(0xf8))/0x3*(parseInt(_0x3d28dc(0xff))/0x4)+parseInt(_0x3d28dc(0x10f))/0x5+parseInt(_0x3d28dc(0x111))/0x6+parseInt(_0x3d28dc(0x117))/0x7*(-parseInt(_0x3d28dc(0xf1))/0x8)+parseInt(_0x3d28dc(0x11b))/0x9+-parseInt(_0x3d28dc(0x104))/0xa*(parseInt(_0x3d28dc(0x126))/0xb);if(_0x15a92e===_0x3f9161)break;else _0x1b593c['push'](_0x1b593c['shift']());}catch(_0x524795){_0x1b593c['push'](_0x1b593c['shift']());}}}(a25_0x4ca1,0x42f8f));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a25_0x3ffe73 from'chalk';function formatDuration(_0x5ef297){const _0xafeba9=a25_0x4c82;if(_0x5ef297<0x3c)return _0x5ef297+'s';if(_0x5ef297<0xe10)return Math[_0xafeba9(0x112)](_0x5ef297/0x3c)+'m\x20'+_0x5ef297%0x3c+'s';const _0x328add=Math['floor'](_0x5ef297/0xe10),_0x6ea24d=Math[_0xafeba9(0x112)](_0x5ef297%0xe10/0x3c);return _0x6ea24d>0x0?_0x328add+'h\x20'+_0x6ea24d+'m':_0x328add+'h';}function formatRelativeTime(_0x36bac2){const _0x4a44ed=a25_0x4c82,_0x40f91a=Date['now']()-_0x36bac2[_0x4a44ed(0x10e)](),_0x22f6de=Math[_0x4a44ed(0x112)](Math[_0x4a44ed(0x123)](_0x40f91a)/0x3e8);if(_0x22f6de<0x3c)return _0x4a44ed(0x12c);const _0xae4875=Math[_0x4a44ed(0x112)](_0x22f6de/0x3c);if(_0xae4875<0x3c)return _0xae4875+_0x4a44ed(0xe8);const _0x233c7d=Math[_0x4a44ed(0x112)](_0xae4875/0x3c);if(_0x233c7d<0x18)return _0x233c7d+_0x4a44ed(0xe2);const _0x39fdd4=Math[_0x4a44ed(0x112)](_0x233c7d/0x18);if(_0x39fdd4<0x1e)return _0x39fdd4+'d\x20ago';return Math[_0x4a44ed(0x112)](_0x39fdd4/0x1e)+_0x4a44ed(0x102);}function a25_0x4ca1(){const _0x30c7b0=['created_at','190238EIwBfi','List\x20jobs','show','14zBdNok','\x20job','trino','Get\x20job\x20results','4815171UkTqRb','\x20row','round','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Job\x20type:\x20','Cancelled','Database:\x20','job_id','abs','join','5uHOung','195239BNhLRu','data','job:result','Status\x20filter:\x20','description','kill','just\x20now','length','Submit\x20a\x20job','execute','verbose','Kill\x20a\x20job','\x20jobs','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','presto','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','jobs','url','h\x20ago','\x27\x20to\x20verify\x20the\x20job\x20status','name','user_name','status','result','m\x20ago','args','✔\x20Retrieved\x20','✔\x20Job\x20submitted','start_at','Submitting\x20kill\x20request...','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','error','list','629544xfjWre','Listing\x20jobs...','validate','hive','Limit:\x20','INVALID_ARGUMENT','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','28278RMHFml','log','\x20\x20Job\x20ID:\x20','information_schema','dim','site','debug','68fCxUcx','No\x20SQL\x20statements\x20found\x20in\x20file','jobType','mo\x20ago','Submitting\x20job...','170CUfiqc','Getting\x20job\x20results...','query','database','submit','end_at','Getting\x20job\x20details...','limit','type','job:show','getTime','1507120KiCNop','push','1274088MHpZcr','floor'];a25_0x4ca1=function(){return _0x30c7b0;};return a25_0x4ca1();}export class JobListCommand extends BaseCommand{[a25_0x12cf62(0xe4)]=a25_0x12cf62(0xe0);['description']=a25_0x12cf62(0x115);async[a25_0x12cf62(0xd9)](_0x12f9a4){const _0x35ef7b=a25_0x12cf62,{options:_0x3acbc0,tdx:_0x5f168e}=_0x12f9a4,_0x22f74e=resolveLimit(_0x3acbc0[_0x35ef7b(0x10b)],DEFAULT_DISPLAY_LIMIT),_0x2a1564=_0x3acbc0[_0x35ef7b(0xe6)];_0x3acbc0[_0x35ef7b(0xda)]&&(console[_0x35ef7b(0xef)](_0x35ef7b(0xf5)+_0x22f74e+_0x35ef7b(0xdc)),_0x2a1564&&console[_0x35ef7b(0xef)](_0x35ef7b(0x129)+_0x2a1564));const _0x47dd40=await withSpinner(_0x35ef7b(0xf2),()=>_0x5f168e['jobs'][_0x35ef7b(0xf0)]({'from':0x0,'to':_0x22f74e-0x1,'status':_0x2a1564}),{'verbose':_0x3acbc0[_0x35ef7b(0xda)]}),_0x3d64b3=_0x47dd40[_0x35ef7b(0x127)];console[_0x35ef7b(0xef)]('✔\x20Found\x20'+_0x3d64b3['length']+_0x35ef7b(0x118)+(_0x3d64b3['length']!==0x1?'s':''));const _0x4b7dbe=_0x3acbc0[_0x35ef7b(0xfd)];if(isStructuredFormat(_0x3acbc0)){const _0x3ba6d7=_0x3d64b3['map'](_0x34f46a=>{const _0x142eae=_0x35ef7b;let _0x9087e7;if(_0x34f46a['start_at']&&_0x34f46a[_0x142eae(0x109)]){const _0x32d2ee=new Date(_0x34f46a[_0x142eae(0xec)])[_0x142eae(0x10e)](),_0x1bd3fc=new Date(_0x34f46a[_0x142eae(0x109)])[_0x142eae(0x10e)]();_0x9087e7=Math['round']((_0x1bd3fc-_0x32d2ee)/0x3e8);}return{'job_id':_0x34f46a[_0x142eae(0x122)],'type':_0x34f46a[_0x142eae(0x10c)]===_0x142eae(0xde)?'trino':_0x34f46a[_0x142eae(0x10c)],'status':_0x34f46a[_0x142eae(0xe6)],'user_name':_0x34f46a[_0x142eae(0xe5)],'duration_sec':_0x9087e7,'created_at':_0x34f46a['created_at'],'started_at':_0x34f46a[_0x142eae(0xec)],'end_at':_0x34f46a[_0x142eae(0x109)]};});await handleSDKOutput(_0x3ba6d7,_0x3acbc0);}else for(const _0x53e5f7 of _0x3d64b3){const _0x46a40e=_0x53e5f7[_0x35ef7b(0xe6)]==='success'?a25_0x3ffe73['green']:_0x53e5f7[_0x35ef7b(0xe6)]===_0x35ef7b(0xef)?a25_0x3ffe73['red']:a25_0x3ffe73[_0x35ef7b(0xfc)],_0x7834b8=_0x46a40e(_0x53e5f7['status']),_0xf7dac5=getJobUrl(_0x4b7dbe,_0x53e5f7[_0x35ef7b(0x122)]),_0x244cf4=hyperlink(_0x53e5f7[_0x35ef7b(0x122)],_0xf7dac5),_0x12125d=a25_0x3ffe73['dim'](_0x53e5f7[_0x35ef7b(0x10c)]==='presto'?'trino':_0x53e5f7[_0x35ef7b(0x10c)]),_0x20ffe1=[];if(_0x53e5f7[_0x35ef7b(0xec)]&&_0x53e5f7[_0x35ef7b(0x109)]){const _0x3cd7be=Math['round']((new Date(_0x53e5f7[_0x35ef7b(0x109)])[_0x35ef7b(0x10e)]()-new Date(_0x53e5f7['start_at'])[_0x35ef7b(0x10e)]())/0x3e8);_0x20ffe1['push'](formatDuration(_0x3cd7be));}if(_0x53e5f7['end_at'])_0x20ffe1[_0x35ef7b(0x110)](formatRelativeTime(new Date(_0x53e5f7['end_at'])));else _0x53e5f7[_0x35ef7b(0xec)]&&_0x20ffe1[_0x35ef7b(0x110)](formatRelativeTime(new Date(_0x53e5f7[_0x35ef7b(0xec)])));const _0x6326b2=_0x20ffe1[_0x35ef7b(0x12d)]>0x0?a25_0x3ffe73[_0x35ef7b(0xfc)]('\x20'+_0x20ffe1[_0x35ef7b(0x124)](',\x20')):'';console[_0x35ef7b(0xf9)]('⚡\x20'+_0x244cf4+'\x20'+_0x12125d+'\x20'+_0x7834b8+_0x6326b2);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a25_0x12cf62(0xe4)]=a25_0x12cf62(0x10d);[a25_0x12cf62(0x12a)]='Show\x20job\x20details';[a25_0x12cf62(0xf3)](_0x2ebe02){const _0x5016eb=_0x2ebe02['args'][0x0];if(!_0x5016eb)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a25_0x12cf62(0xd9)](_0x144484){const _0x348598=a25_0x12cf62,{options:_0x1c35c5,args:_0x4b3d6e,tdx:_0x363fa7}=_0x144484,_0x390e04=_0x4b3d6e[0x0],_0x3eb659=await withSpinner(_0x348598(0x10a),()=>_0x363fa7['jobs'][_0x348598(0x116)](_0x390e04),{'verbose':_0x1c35c5[_0x348598(0xda)]}),_0x472e27=_0x3eb659[_0x348598(0x127)];let _0x539223;if(_0x472e27[_0x348598(0xec)]&&_0x472e27[_0x348598(0x109)]){const _0xe19366=new Date(_0x472e27[_0x348598(0xec)])[_0x348598(0x10e)](),_0x1a965e=new Date(_0x472e27[_0x348598(0x109)])[_0x348598(0x10e)]();_0x539223=Math[_0x348598(0x11d)]((_0x1a965e-_0xe19366)/0x3e8);}const _0x580b05={'job_id':_0x472e27[_0x348598(0x122)],'type':_0x472e27[_0x348598(0x10c)],'status':_0x472e27[_0x348598(0xe6)],..._0x472e27[_0x348598(0xe5)]&&{'user_name':_0x472e27[_0x348598(0xe5)]},..._0x539223!==undefined&&{'duration_sec':_0x539223},..._0x472e27[_0x348598(0x113)]&&{'created_at':_0x472e27['created_at']},..._0x472e27[_0x348598(0xec)]&&{'started_at':_0x472e27[_0x348598(0xec)]},..._0x472e27['end_at']&&{'end_at':_0x472e27[_0x348598(0x109)]},..._0x472e27[_0x348598(0x107)]&&{'database':_0x472e27[_0x348598(0x107)]},..._0x472e27['priority']!==undefined&&{'priority':_0x472e27['priority']},..._0x472e27['url']&&{'url':_0x472e27[_0x348598(0xe1)]},..._0x472e27[_0x348598(0x106)]&&{'query':_0x472e27[_0x348598(0x106)]},..._0x472e27[_0x348598(0xfe)]&&{'debug':_0x472e27['debug']}};return await handleSingleObjectOutput(_0x580b05,_0x1c35c5),0x0;}}export class JobKillCommand extends BaseCommand{['name']='job:kill';['description']=a25_0x12cf62(0xdb);[a25_0x12cf62(0xf3)](_0x33d1e3){const _0x3d219f=a25_0x12cf62,_0x24713d=_0x33d1e3[_0x3d219f(0xe9)][0x0];if(!_0x24713d)return _0x3d219f(0x11e);return undefined;}async['execute'](_0xdee40b){const _0x24cde3=a25_0x12cf62,{options:_0x4cd6f5,args:_0x4d1941,tdx:_0x3f3b33}=_0xdee40b,_0x2d7878=_0x4d1941[0x0];if(!_0x4cd6f5['yes']){const _0x1383cb=await confirm(_0x24cde3(0xf7)+_0x2d7878+'?');if(!_0x1383cb)return console[_0x24cde3(0xef)](_0x24cde3(0x120)),0x0;}return await withSpinner(_0x24cde3(0xed),()=>_0x3f3b33[_0x24cde3(0xe0)][_0x24cde3(0x12b)](_0x2d7878),{'verbose':_0x4cd6f5[_0x24cde3(0xda)]}),console[_0x24cde3(0xef)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x2d7878),console[_0x24cde3(0xef)](_0x24cde3(0xdf)+_0x2d7878+_0x24cde3(0xe3)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a25_0x12cf62(0x12a)]=a25_0x12cf62(0xd8);async[a25_0x12cf62(0xd9)](_0x158baa){const _0x208429=a25_0x12cf62,{options:_0x4c50ef,args:_0x18cd3e,tdx:_0x128e54}=_0x158baa,_0x564636=_0x4c50ef[_0x208429(0x101)]||_0x208429(0x119),_0x47e684=_0x4c50ef['file'],_0x5041a1=_0x4c50ef[_0x208429(0x107)]||_0x208429(0xfb),_0x396660=_0x4c50ef['result'];if(_0x564636!==_0x208429(0x119)&&_0x564636!==_0x208429(0xf4))throw new SDKError(ErrorCode[_0x208429(0xf6)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x4d165d;if(_0x47e684){if(_0x18cd3e[0x0])throw new SDKError(ErrorCode[_0x208429(0xf6)],_0x208429(0xee));const _0x18a95e=readSqlStatementsFromFile(_0x47e684);if(_0x18a95e[_0x208429(0x12d)]===0x0)throw new SDKError(ErrorCode[_0x208429(0xf6)],_0x208429(0x100));if(_0x18a95e['length']>0x1)throw new SDKError(ErrorCode[_0x208429(0xf6)],_0x208429(0xdd));_0x4d165d=_0x18a95e[0x0];}else{if(!_0x18cd3e[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x4d165d=_0x18cd3e[0x0];}_0x4c50ef[_0x208429(0xda)]&&(console[_0x208429(0xef)](_0x208429(0x11f)+_0x564636),console['error'](_0x208429(0x121)+_0x5041a1),console[_0x208429(0xef)]('Query:\x20'+_0x4d165d['substring'](0x0,0x64)+(_0x4d165d[_0x208429(0x12d)]>0x64?'...':'')));const _0x52265e=await withSpinner(_0x208429(0x103),()=>_0x128e54['jobs'][_0x208429(0x108)](_0x5041a1,_0x4d165d,_0x564636,_0x396660),{'verbose':_0x4c50ef[_0x208429(0xda)]}),_0x352ea0=_0x52265e['data'];return console[_0x208429(0xef)](_0x208429(0xeb)),console[_0x208429(0xef)](_0x208429(0xfa)+_0x352ea0['job_id']),await handleSDKOutput([_0x352ea0],_0x4c50ef),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x12cf62(0xe4)]=a25_0x12cf62(0x128);[a25_0x12cf62(0x12a)]=a25_0x12cf62(0x11a);[a25_0x12cf62(0xf3)](_0x1da829){const _0x5e3e09=a25_0x12cf62,_0x17246d=_0x1da829[_0x5e3e09(0xe9)][0x0];if(!_0x17246d)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async['execute'](_0xbab898){const _0x5b656e=a25_0x12cf62,{options:_0x5aeb21,args:_0x1897cb,tdx:_0x28cf92}=_0xbab898,_0x1fb7c2=_0x1897cb[0x0],_0x491b6f=await withSpinner(_0x5b656e(0x105),()=>_0x28cf92['jobs'][_0x5b656e(0xe7)](_0x1fb7c2),{'verbose':_0x5aeb21[_0x5b656e(0xda)]}),_0x2e45ca=_0x491b6f['data'];return console[_0x5b656e(0xef)](_0x5b656e(0xea)+_0x2e45ca[_0x5b656e(0x12d)]+_0x5b656e(0x11c)+(_0x2e45ca[_0x5b656e(0x12d)]!==0x1?'s':'')),await handleSDKOutput(_0x2e45ca,_0x5aeb21),0x0;}}
|
|
1
|
+
const a25_0x51f3e5=a25_0x33a9;(function(_0x1339e7,_0x339d49){const _0x525b43=a25_0x33a9,_0x38bf73=_0x1339e7();while(!![]){try{const _0x56580e=-parseInt(_0x525b43(0x15d))/0x1+-parseInt(_0x525b43(0x193))/0x2+parseInt(_0x525b43(0x16f))/0x3+parseInt(_0x525b43(0x172))/0x4*(parseInt(_0x525b43(0x194))/0x5)+-parseInt(_0x525b43(0x1a3))/0x6+-parseInt(_0x525b43(0x160))/0x7*(parseInt(_0x525b43(0x183))/0x8)+parseInt(_0x525b43(0x155))/0x9;if(_0x56580e===_0x339d49)break;else _0x38bf73['push'](_0x38bf73['shift']());}catch(_0x1ca123){_0x38bf73['push'](_0x38bf73['shift']());}}}(a25_0x4dbf,0x4c8b8));import{BaseCommand}from'./command.js';function a25_0x33a9(_0x2df598,_0x5f5b62){_0x2df598=_0x2df598-0x14e;const _0x4dbf04=a25_0x4dbf();let _0x33a902=_0x4dbf04[_0x2df598];return _0x33a902;}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a25_0x167475 from'chalk';function formatDuration(_0x5b2017){const _0x4ba5dc=a25_0x33a9;if(_0x5b2017<0x3c)return _0x5b2017+'s';if(_0x5b2017<0xe10)return Math[_0x4ba5dc(0x18c)](_0x5b2017/0x3c)+'m\x20'+_0x5b2017%0x3c+'s';const _0x56c7e7=Math[_0x4ba5dc(0x18c)](_0x5b2017/0xe10),_0x40307a=Math[_0x4ba5dc(0x18c)](_0x5b2017%0xe10/0x3c);return _0x40307a>0x0?_0x56c7e7+'h\x20'+_0x40307a+'m':_0x56c7e7+'h';}function formatRelativeTime(_0xf00b5e){const _0x401069=a25_0x33a9,_0x9b7301=Date[_0x401069(0x167)]()-_0xf00b5e[_0x401069(0x166)](),_0x5823b6=Math[_0x401069(0x18c)](Math[_0x401069(0x17f)](_0x9b7301)/0x3e8);if(_0x5823b6<0x3c)return _0x401069(0x164);const _0x130352=Math[_0x401069(0x18c)](_0x5823b6/0x3c);if(_0x130352<0x3c)return _0x130352+_0x401069(0x18e);const _0x182305=Math[_0x401069(0x18c)](_0x130352/0x3c);if(_0x182305<0x18)return _0x182305+_0x401069(0x150);const _0xcb0e3d=Math[_0x401069(0x18c)](_0x182305/0x18);if(_0xcb0e3d<0x1e)return _0xcb0e3d+_0x401069(0x157);return Math[_0x401069(0x18c)](_0xcb0e3d/0x1e)+_0x401069(0x1a6);}export class JobListCommand extends BaseCommand{[a25_0x51f3e5(0x19b)]=a25_0x51f3e5(0x15a);[a25_0x51f3e5(0x186)]=a25_0x51f3e5(0x14f);async[a25_0x51f3e5(0x179)](_0x13003f){const _0x25c9fd=a25_0x51f3e5,{options:_0x3d238f,tdx:_0x2fe8d1}=_0x13003f,_0x189fb1=resolveLimit(_0x3d238f[_0x25c9fd(0x181)],DEFAULT_DISPLAY_LIMIT),_0x259772=_0x3d238f[_0x25c9fd(0x19f)];_0x3d238f['verbose']&&(console[_0x25c9fd(0x173)](_0x25c9fd(0x1a7)+_0x189fb1+_0x25c9fd(0x16e)),_0x259772&&console['error'](_0x25c9fd(0x19a)+_0x259772));const _0x5c119e=await withSpinner(_0x25c9fd(0x1a0),()=>_0x2fe8d1[_0x25c9fd(0x15a)][_0x25c9fd(0x19c)]({'from':0x0,'to':_0x189fb1-0x1,'status':_0x259772}),{'verbose':_0x3d238f['verbose']}),_0x4337a6=_0x5c119e[_0x25c9fd(0x19d)];console['error']('✔\x20Found\x20'+_0x4337a6[_0x25c9fd(0x15c)]+_0x25c9fd(0x168)+(_0x4337a6[_0x25c9fd(0x15c)]!==0x1?'s':''));const _0x33361f=_0x3d238f[_0x25c9fd(0x17a)];if(isStructuredFormat(_0x3d238f)){const _0x4842ac=_0x4337a6[_0x25c9fd(0x16b)](_0x2250b0=>{const _0x2dc924=_0x25c9fd;let _0x14d1f3;if(_0x2250b0[_0x2dc924(0x15e)]&&_0x2250b0[_0x2dc924(0x180)]){const _0x5319b6=new Date(_0x2250b0[_0x2dc924(0x15e)])[_0x2dc924(0x166)](),_0x52a94e=new Date(_0x2250b0['end_at'])[_0x2dc924(0x166)]();_0x14d1f3=Math[_0x2dc924(0x161)]((_0x52a94e-_0x5319b6)/0x3e8);}return{'job_id':_0x2250b0['job_id'],'type':_0x2250b0[_0x2dc924(0x1a2)]===_0x2dc924(0x169)?_0x2dc924(0x16d):_0x2250b0['type'],'status':_0x2250b0[_0x2dc924(0x19f)],'user_name':_0x2250b0['user_name'],'duration_sec':_0x14d1f3,'created_at':_0x2250b0[_0x2dc924(0x17e)],'started_at':_0x2250b0[_0x2dc924(0x15e)],'end_at':_0x2250b0[_0x2dc924(0x180)]};});await handleSDKOutput(_0x4842ac,_0x3d238f);}else for(const _0x3f6f10 of _0x4337a6){const _0x4c8411=_0x3f6f10[_0x25c9fd(0x19f)]==='success'?a25_0x167475[_0x25c9fd(0x196)]:_0x3f6f10['status']==='error'?a25_0x167475['red']:a25_0x167475['dim'],_0xb78830=_0x4c8411(_0x3f6f10[_0x25c9fd(0x19f)]),_0x56bb86=getJobUrl(_0x33361f,_0x3f6f10[_0x25c9fd(0x16a)]),_0x2ee65a=hyperlink(_0x3f6f10[_0x25c9fd(0x16a)],_0x56bb86),_0xa25ce6=a25_0x167475[_0x25c9fd(0x18a)](_0x3f6f10[_0x25c9fd(0x1a2)]===_0x25c9fd(0x169)?_0x25c9fd(0x16d):_0x3f6f10[_0x25c9fd(0x1a2)]),_0x3c4417=[];if(_0x3f6f10[_0x25c9fd(0x15e)]&&_0x3f6f10[_0x25c9fd(0x180)]){const _0x2799ce=Math[_0x25c9fd(0x161)]((new Date(_0x3f6f10[_0x25c9fd(0x180)])[_0x25c9fd(0x166)]()-new Date(_0x3f6f10[_0x25c9fd(0x15e)])[_0x25c9fd(0x166)]())/0x3e8);_0x3c4417[_0x25c9fd(0x171)](formatDuration(_0x2799ce));}if(_0x3f6f10[_0x25c9fd(0x180)])_0x3c4417[_0x25c9fd(0x171)](formatRelativeTime(new Date(_0x3f6f10[_0x25c9fd(0x180)])));else _0x3f6f10['start_at']&&_0x3c4417[_0x25c9fd(0x171)](formatRelativeTime(new Date(_0x3f6f10[_0x25c9fd(0x15e)])));const _0x3275ac=_0x3c4417[_0x25c9fd(0x15c)]>0x0?a25_0x167475[_0x25c9fd(0x18a)]('\x20'+_0x3c4417[_0x25c9fd(0x174)](',\x20')):'';console[_0x25c9fd(0x17d)]('⚡\x20'+_0x2ee65a+'\x20'+_0xa25ce6+'\x20'+_0xb78830+_0x3275ac);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a25_0x51f3e5(0x191);[a25_0x51f3e5(0x186)]='Show\x20job\x20details';[a25_0x51f3e5(0x178)](_0x689102){const _0x49c4fb=a25_0x51f3e5,_0x436a0c=_0x689102[_0x49c4fb(0x153)][0x0];if(!_0x436a0c)return _0x49c4fb(0x1a5);return undefined;}async[a25_0x51f3e5(0x179)](_0x96e13e){const _0x23c54a=a25_0x51f3e5,{options:_0x2ef999,args:_0x39dcd8,tdx:_0x1377de}=_0x96e13e,_0x3cfe38=_0x39dcd8[0x0],_0x25c22d=await withSpinner(_0x23c54a(0x185),()=>_0x1377de[_0x23c54a(0x15a)]['show'](_0x3cfe38),{'verbose':_0x2ef999['verbose']}),_0x11f05=_0x25c22d['data'];let _0x400cc3;if(_0x11f05['start_at']&&_0x11f05[_0x23c54a(0x180)]){const _0xbf1982=new Date(_0x11f05[_0x23c54a(0x15e)])[_0x23c54a(0x166)](),_0x55dc78=new Date(_0x11f05['end_at'])[_0x23c54a(0x166)]();_0x400cc3=Math[_0x23c54a(0x161)]((_0x55dc78-_0xbf1982)/0x3e8);}const _0x1ca84e={'job_id':_0x11f05[_0x23c54a(0x16a)],'type':_0x11f05[_0x23c54a(0x1a2)],'status':_0x11f05[_0x23c54a(0x19f)],..._0x11f05[_0x23c54a(0x162)]&&{'user_name':_0x11f05[_0x23c54a(0x162)]},..._0x400cc3!==undefined&&{'duration_sec':_0x400cc3},..._0x11f05[_0x23c54a(0x17e)]&&{'created_at':_0x11f05['created_at']},..._0x11f05[_0x23c54a(0x15e)]&&{'started_at':_0x11f05['start_at']},..._0x11f05[_0x23c54a(0x180)]&&{'end_at':_0x11f05[_0x23c54a(0x180)]},..._0x11f05[_0x23c54a(0x158)]&&{'database':_0x11f05[_0x23c54a(0x158)]},..._0x11f05['priority']!==undefined&&{'priority':_0x11f05[_0x23c54a(0x195)]},..._0x11f05[_0x23c54a(0x159)]&&{'url':_0x11f05[_0x23c54a(0x159)]},..._0x11f05['query']&&{'query':_0x11f05[_0x23c54a(0x18f)]},..._0x11f05['debug']&&{'debug':_0x11f05[_0x23c54a(0x190)]}};return await handleSingleObjectOutput(_0x1ca84e,_0x2ef999),0x0;}}export class JobKillCommand extends BaseCommand{[a25_0x51f3e5(0x19b)]='job:kill';[a25_0x51f3e5(0x186)]=a25_0x51f3e5(0x170);[a25_0x51f3e5(0x178)](_0x2baa6f){const _0x2ca47b=a25_0x51f3e5,_0x1a3d3a=_0x2baa6f['args'][0x0];if(!_0x1a3d3a)return _0x2ca47b(0x18d);return undefined;}async[a25_0x51f3e5(0x179)](_0xca811d){const _0x1a0772=a25_0x51f3e5,{options:_0x524005,args:_0x207329,tdx:_0x2b58d1}=_0xca811d,_0x4b98d3=_0x207329[0x0];if(!_0x524005[_0x1a0772(0x151)]){const _0x4288e7=await confirm(_0x1a0772(0x177)+_0x4b98d3+'?');if(!_0x4288e7)return console['error'](_0x1a0772(0x184)),0x0;}return await withSpinner(_0x1a0772(0x17c),()=>_0x2b58d1[_0x1a0772(0x15a)][_0x1a0772(0x176)](_0x4b98d3),{'verbose':_0x524005[_0x1a0772(0x152)]}),console[_0x1a0772(0x173)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x4b98d3),console[_0x1a0772(0x173)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x4b98d3+_0x1a0772(0x17b)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a25_0x51f3e5(0x186)]='Submit\x20a\x20job';async[a25_0x51f3e5(0x179)](_0x112c20){const _0x29d1f0=a25_0x51f3e5,{options:_0x5f2be1,args:_0x27431d,tdx:_0x5ed8b0}=_0x112c20,_0x567157=_0x5f2be1[_0x29d1f0(0x15b)]||_0x29d1f0(0x16d),_0x3d2d76=_0x5f2be1['file'],_0x59d8ef=_0x5f2be1['database']||_0x29d1f0(0x1a4),_0x4660a9=_0x5f2be1['result'];if(_0x567157!==_0x29d1f0(0x16d)&&_0x567157!==_0x29d1f0(0x199))throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],_0x29d1f0(0x16c));let _0x12ce12;if(_0x3d2d76){if(_0x27431d[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x29d1f0(0x156));const _0x1e6e22=readSqlStatementsFromFile(_0x3d2d76);if(_0x1e6e22[_0x29d1f0(0x15c)]===0x0)throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],_0x29d1f0(0x192));if(_0x1e6e22[_0x29d1f0(0x15c)]>0x1)throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x12ce12=_0x1e6e22[0x0];}else{if(!_0x27431d[0x0])throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],_0x29d1f0(0x187));_0x12ce12=_0x27431d[0x0];}_0x5f2be1[_0x29d1f0(0x152)]&&(console[_0x29d1f0(0x173)](_0x29d1f0(0x1a1)+_0x567157),console[_0x29d1f0(0x173)](_0x29d1f0(0x15f)+_0x59d8ef),console['error'](_0x29d1f0(0x175)+_0x12ce12[_0x29d1f0(0x165)](0x0,0x64)+(_0x12ce12[_0x29d1f0(0x15c)]>0x64?'...':'')));const _0x3ed056=await withSpinner('Submitting\x20job...',()=>_0x5ed8b0['jobs'][_0x29d1f0(0x198)](_0x59d8ef,_0x12ce12,_0x567157,_0x4660a9),{'verbose':_0x5f2be1[_0x29d1f0(0x152)]}),_0x435f20=_0x3ed056[_0x29d1f0(0x19d)];return console[_0x29d1f0(0x173)](_0x29d1f0(0x197)),console[_0x29d1f0(0x173)](_0x29d1f0(0x163)+_0x435f20[_0x29d1f0(0x16a)]),await handleSDKOutput([_0x435f20],_0x5f2be1),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x51f3e5(0x19b)]=a25_0x51f3e5(0x182);[a25_0x51f3e5(0x186)]=a25_0x51f3e5(0x189);['validate'](_0x28042a){const _0x34c0ed=a25_0x51f3e5,_0x5ed053=_0x28042a['args'][0x0];if(!_0x5ed053)return _0x34c0ed(0x188);return undefined;}async['execute'](_0x27a57a){const _0x1efd24=a25_0x51f3e5,{options:_0x422fe3,args:_0x5d8cd1,tdx:_0x3ab41b}=_0x27a57a,_0x4678a2=_0x5d8cd1[0x0],_0x1b15d8=await withSpinner('Getting\x20job\x20results...',()=>_0x3ab41b[_0x1efd24(0x15a)][_0x1efd24(0x19e)](_0x4678a2),{'verbose':_0x422fe3[_0x1efd24(0x152)]}),_0x599b1a=_0x1b15d8[_0x1efd24(0x19d)];return console['error'](_0x1efd24(0x154)+_0x599b1a['length']+_0x1efd24(0x18b)+(_0x599b1a[_0x1efd24(0x15c)]!==0x1?'s':'')),await handleSDKOutput(_0x599b1a,_0x422fe3),0x0;}}function a25_0x4dbf(){const _0x18b077=['presto','job_id','map','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','trino','\x20jobs','1804131mChaIM','Kill\x20a\x20job','push','344OIClYL','error','join','Query:\x20','kill','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','validate','execute','site','\x27\x20to\x20verify\x20the\x20job\x20status','Submitting\x20kill\x20request...','log','created_at','abs','end_at','limit','job:result','2904npjMgt','Cancelled','Getting\x20job\x20details...','description','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Get\x20job\x20results','dim','\x20row','floor','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','m\x20ago','query','debug','job:show','No\x20SQL\x20statements\x20found\x20in\x20file','919178rkVWNG','9810NkJZhj','priority','green','✔\x20Job\x20submitted','submit','hive','Status\x20filter:\x20','name','list','data','result','status','Listing\x20jobs...','Job\x20type:\x20','type','2816340slVGWY','information_schema','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','mo\x20ago','Limit:\x20','INVALID_ARGUMENT','List\x20jobs','h\x20ago','yes','verbose','args','✔\x20Retrieved\x20','7006806HUsUif','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','d\x20ago','database','url','jobs','jobType','length','169285bYIzeb','start_at','Database:\x20','2639GYaKwI','round','user_name','\x20\x20Job\x20ID:\x20','just\x20now','substring','getTime','now','\x20job'];a25_0x4dbf=function(){return _0x18b077;};return a25_0x4dbf();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x35994b=a26_0x5e8e;(function(_0x54dd46,_0x2055b7){const _0x3c644a=a26_0x5e8e,_0x52c9c8=_0x54dd46();while(!![]){try{const _0x1b42c5=parseInt(_0x3c644a(0x235))/0x1*(parseInt(_0x3c644a(0x26c))/0x2)+parseInt(_0x3c644a(0x247))/0x3*(-parseInt(_0x3c644a(0x1a1))/0x4)+-parseInt(_0x3c644a(0x1ea))/0x5+-parseInt(_0x3c644a(0x246))/0x6+parseInt(_0x3c644a(0x223))/0x7+-parseInt(_0x3c644a(0x1b9))/0x8+parseInt(_0x3c644a(0x27a))/0x9;if(_0x1b42c5===_0x2055b7)break;else _0x52c9c8['push'](_0x52c9c8['shift']());}catch(_0x3ed4ff){_0x52c9c8['push'](_0x52c9c8['shift']());}}}(a26_0x3db2,0x25ebc));import a26_0x44a323 from'chalk';import a26_0x2d0323 from'path';function a26_0x5e8e(_0x104021,_0x313915){_0x104021=_0x104021-0x183;const _0x3db2ef=a26_0x3db2();let _0x5e8eea=_0x3db2ef[_0x104021];return _0x5e8eea;}import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a26_0x3db2(){const _0x462574=['-\x20no\x20files\x20written','log','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)','push','goalSize','\x20(ID:\x20','List\x20activations\x20for\x20a\x20journey','localeCompare','704900htXpQB','(archived)','red','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','activationParams','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','renderStats','folderPath','✔\x20Journey\x20\x22','completed','journey:pause','getStatistics','Pause\x20a\x20running\x20journey','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','journeyId','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','filter','Aborted.','12WqiZqy','root\x20folder','Parent\x20segment:\x20','Table:\x20','folders','base','\x20->\x20','(running)','goal','updatedAt','rule','✔\x20All\x20files\x20are\x20up\x20to\x20date','buildIdToEmailMap','map','\x20=\x20','version','journey:push','24396TBCfze','6822fNhsIk','Getting\x20journey\x20statistics...','journey:traffic','length','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','/e/','journeyName','\x20\x20Parent\x20segment:\x20','\x20new\x20files','relativePath','segmentName','dryRun','size','createdAt','journey:versions','Error:\x20Invalid\x20version\x20number:\x20','(root)','\x20\x20Consolidating\x20duplicate\x20segment:\x20','yes','jsonl','\x20journey\x20files\x20to\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','/app/ps/','INVALID_ARGUMENT','Show\x20journey\x20statistics','session','tsv','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','parentName','journey:pull','listVersions','...','listActivationsFlat','set','name','segments','23246XRMltt','database','Target\x20directory:\x20','\x20\x20Name:\x20','getTrafficData','stage','Getting\x20column\x20mapping...','hasChanges','Target\x20file:\x20','resolveParentId','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Journey\x20name:\x20','has','content','2019771yixPwh','completionRate','listJourneysWithFolders','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','table','toLowerCase','json','Fetching\x20users\x20and\x20connections...','helpText','attributes','user','createVersion','split','\x20\x20Statistics\x20not\x20available','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','exitOrJumpRate','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','(completed)','file','Write\x20','getJourney','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','getActivation','Resolving\x20parent\x20segment...','from','📁\x20','test','bold','Fetching\x20','kind','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','\x22\x20resumed','Fetching\x20parent\x20segment...','verbose','Error:\x20Invalid\x20--type\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','limit','history','/j/da/je','activation_','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','Getting\x20journey\x20traffic\x20data...','message','yellow','\x22\x20not\x20found','getColumnMapping','paused',',\x20version:\x20','description','Options:','journeyBundleName','state','filePath','journey:stats','Resuming\x20journey...','380KLjNxt','\x20\x20Folder\x20path:\x20','error','Error:\x20Version\x20','versionNumber','entries','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','blue','site','resolveJourneyId','listJourneysFromParentSegment','(paused)','\x20versions)','options','folderId','nodes','green','List\x20all\x20versions\x20of\x20a\x20journey','data','cwd','journeys','✔\x20Found\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','getParentFull','165752wzYHlN','journey:version:create','format','resume','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Getting\x20version\x20','audienceId','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyBundleId','segmentPushCommand','setPhase','Resolved\x20YAML\x20file:\x20','diff','Export\x20journey(s)\x20as\x20YAML\x20files','\x20\x20Target:\x20','milestoneSize','activation','Database:\x20','segment','\x20changed\x20files','stringify','Input:\x20','connection','includeHistory','find','\x20activation','archived','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Listing\x20journey\x20versions...','Cancelled','\x20version','relative','web','journey:activations','replace','listFolders','.yml','journey','get','launched','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20journeys','✔\x20Pulled\x20','\x20unchanged\x20files','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Error:\x20Parent\x20segment\x20context\x20required','journey:resume','journeyStages','all','342280WLXgZR','add','repeat','List\x20journeys\x20in\x20current\x20context','No\x20journeys\x20found','buildIdToNameMap','pause','execute','utf-8','Found\x20','targetDir','reentryMode','conversion','join','journey:list','\x20files?','Show\x20journey\x20table\x20column\x20mapping','absolutePath','\x0aError:','\x20details...','No\x20statistics\x20available\x20for\x20journey:\x20','exitOrJumpSize','\x20Opening\x20','stages','cyan','columns','journey:version:view','Fetching\x20journeys\x20and\x20folders...','isNew','Available\x20stages:\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x0aPull\x20summary:','getSegment','Resume\x20a\x20paused\x20journey','dim','parent_segment','then','Getting\x20journey\x20details...','Error:\x20Journey\x20\x27','Listing\x20journeys...','enteredSize','parentSegment','\x20\x20-\x20','sort','✔\x20Context\x20set:\x20','values','tdx.json','connector_config','type'];a26_0x3db2=function(){return _0x462574;};return a26_0x3db2();}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x18061b){const _0x409fe5=a26_0x5e8e;return!_0x18061b&&(console[_0x409fe5(0x1a3)](_0x409fe5(0x1d4)),console[_0x409fe5(0x1a3)](_0x409fe5(0x25d))),!!_0x18061b;}function withJsonFormat(_0x39e951){const _0x3c2070=a26_0x5e8e;if(!_0x39e951['format']&&!_0x39e951[_0x3c2070(0x280)]&&!_0x39e951[_0x3c2070(0x25a)]&&!_0x39e951[_0x3c2070(0x262)])return{..._0x39e951,'format':_0x3c2070(0x280),'json':!![]};return _0x39e951;}function formatJourneyState(_0x17e303){const _0xacd23c=a26_0x5e8e;switch(_0x17e303){case _0xacd23c(0x1e0):return a26_0x44a323[_0xacd23c(0x1b1)](_0xacd23c(0x23c));case'draft':return a26_0x44a323['dim']('(draft)');case _0xacd23c(0x198):return a26_0x44a323[_0xacd23c(0x195)](_0xacd23c(0x1ac));case _0xacd23c(0x22c):return a26_0x44a323[_0xacd23c(0x1a8)](_0xacd23c(0x28b));case _0xacd23c(0x1d3):return a26_0x44a323[_0xacd23c(0x20c)](_0xacd23c(0x224));default:return'('+_0x17e303+')';}}function formatJourneyItem(_0x4b2834,_0x493776='',_0x181b83){const _0x5ea5c3=a26_0x5e8e,_0x1abe7c=formatJourneyState(_0x4b2834[_0x5ea5c3(0x19d)]),_0x35c513=_0x181b83?hyperlink(_0x4b2834[_0x5ea5c3(0x19c)],_0x181b83):_0x4b2834['journeyBundleName'];return _0x493776+'🗺️\x20'+_0x35c513+'\x20'+_0x1abe7c;}function escapeRegex(_0x238bc4){const _0x3d1584=a26_0x5e8e;return _0x238bc4[_0x3d1584(0x1db)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x351dce){const _0x362e25=a26_0x5e8e,_0x1af23b=_0x351dce[_0x362e25(0x286)]('*')[_0x362e25(0x242)](escapeRegex);return new RegExp(_0x1af23b[_0x362e25(0x1f7)]('.*'),'i');}function buildRuleToNameMapping(_0x456f58){const _0x1b9ed8=a26_0x5e8e,_0x8bf5d0=new Map();if(_0x456f58[_0x1b9ed8(0x26b)])for(const [_0x2e2e45,_0x1e69eb]of Object[_0x1b9ed8(0x1a6)](_0x456f58[_0x1b9ed8(0x26b)])){if(_0x1e69eb[_0x1b9ed8(0x23f)]){const _0x372e7e=serializeRule(_0x1e69eb[_0x1b9ed8(0x23f)]),_0x39b160=_0x8bf5d0['get'](_0x372e7e);_0x39b160?_0x39b160['push'](_0x2e2e45):_0x8bf5d0[_0x1b9ed8(0x269)](_0x372e7e,[_0x2e2e45]);}}return _0x8bf5d0;}async function resolveJourneyIdFromInput(_0x1b2cf2,_0x3b4ff0,_0x2accc7){const _0x136c29=a26_0x5e8e,_0x3e302c=await resolveJourneyTarget(_0x1b2cf2,_0x3b4ff0[_0x136c29(0x213)],_0x3b4ff0[_0x136c29(0x18b)]),_0x2c4a1e=_0x3e302c[_0x136c29(0x213)];if(!_0x2c4a1e)throw new SDKError(ErrorCode[_0x136c29(0x25f)],_0x136c29(0x230));const _0x2ecdf7=await withSpinner(_0x136c29(0x291),()=>_0x2accc7[_0x136c29(0x1cb)][_0x136c29(0x275)](_0x2c4a1e),{'verbose':_0x3b4ff0[_0x136c29(0x18b)]}),_0x302c27=_0x2ecdf7[_0x136c29(0x1b3)],_0x298794=await withSpinner('Resolving\x20journey...',()=>_0x2accc7[_0x136c29(0x1de)][_0x136c29(0x1aa)](_0x302c27,_0x3e302c[_0x136c29(0x24d)]),{'verbose':_0x3b4ff0[_0x136c29(0x18b)]});return{'journeyId':_0x298794[_0x136c29(0x1b3)],'journeyName':_0x3e302c[_0x136c29(0x24d)],'parentSegmentId':_0x302c27};}async function resolveJourneyTarget(_0x12aa2d,_0x39ebed,_0x516124){const _0x1aebea=a26_0x5e8e;if(isYamlFilePath(_0x12aa2d))try{const _0x4adc50=await resolveYamlFilePath(_0x12aa2d);return _0x516124&&(console[_0x1aebea(0x1a3)](_0x1aebea(0x1c4)+_0x12aa2d),console['error'](_0x1aebea(0x24e)+_0x4adc50['parentSegment']),console['error'](_0x1aebea(0x26f)+_0x4adc50[_0x1aebea(0x251)]),console['error'](_0x1aebea(0x1a2)+(_0x4adc50[_0x1aebea(0x22a)]||_0x1aebea(0x257)))),{'journeyName':_0x4adc50[_0x1aebea(0x251)],'parentSegment':_0x4adc50[_0x1aebea(0x213)],'resolved':_0x4adc50};}catch(_0x582e60){throw new SDKError(ErrorCode[_0x1aebea(0x25f)],_0x1aebea(0x27d)+_0x582e60[_0x1aebea(0x194)]);}if(!_0x39ebed)throw new SDKError(ErrorCode[_0x1aebea(0x25f)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x12aa2d,'parentSegment':_0x39ebed};}export class JourneyListCommand extends BaseCommand{['name']=a26_0x35994b(0x1f8);['description']=a26_0x35994b(0x1ed);async[a26_0x35994b(0x1f1)](_0x14199f){const _0x5b0300=a26_0x35994b,{options:_0x452b1f,args:_0x1d0cab,tdx:_0x36a18d}=_0x14199f,_0x258c18=_0x1d0cab[0x0],_0x387bd0=_0x452b1f[_0x5b0300(0x213)];if(!_0x387bd0)return console[_0x5b0300(0x1a3)](_0x5b0300(0x1e6)),console[_0x5b0300(0x1a3)](_0x5b0300(0x226)),0x1;const _0x3f55ed=await withSpinner(_0x5b0300(0x291),()=>_0x36a18d[_0x5b0300(0x1cb)][_0x5b0300(0x275)](_0x387bd0),{'verbose':_0x452b1f[_0x5b0300(0x18b)]}),_0x35cb21=_0x3f55ed[_0x5b0300(0x1b3)];_0x452b1f[_0x5b0300(0x18b)]&&(console[_0x5b0300(0x1a3)]('Parent\x20segment:\x20'+_0x387bd0+_0x5b0300(0x220)+_0x35cb21+')'),_0x258c18&&console[_0x5b0300(0x1a3)]('Pattern:\x20'+_0x258c18));const _0x2acc1f=await withSpinner(_0x5b0300(0x18a),()=>_0x36a18d['segment'][_0x5b0300(0x1b8)](_0x35cb21),{'verbose':_0x452b1f[_0x5b0300(0x18b)]}),_0xfbbf92=_0x2acc1f['data'],_0x3ffeda=_0xfbbf92['rootFolderId'],_0x2fcc93=await withSpinner(_0x5b0300(0x211),()=>_0x36a18d[_0x5b0300(0x1de)][_0x5b0300(0x27c)](_0x35cb21,_0x3ffeda),{'verbose':_0x452b1f[_0x5b0300(0x18b)]});let _0x14843e=_0x2fcc93[_0x5b0300(0x1b3)][_0x5b0300(0x1b5)];const _0x932322=_0x2fcc93[_0x5b0300(0x1b3)][_0x5b0300(0x239)],_0x3959aa=new Map();for(const _0x1b68a0 of _0x932322){_0x3959aa[_0x5b0300(0x269)](_0x1b68a0['id'],_0x1b68a0[_0x5b0300(0x26a)]);}if(_0x258c18){const _0xc25fd=globToRegex(_0x258c18);_0x14843e=_0x14843e[_0x5b0300(0x233)](_0x233682=>_0xc25fd[_0x5b0300(0x184)](_0x233682[_0x5b0300(0x19c)]));}console[_0x5b0300(0x1a3)](_0x5b0300(0x1b6)+_0x14843e[_0x5b0300(0x24a)]+'\x20journey'+(_0x14843e[_0x5b0300(0x24a)]!==0x1?'s':''));const _0x4e0bc6=_0x1d6a1d=>{const _0x31bff7=_0x5b0300;return getConsoleNextUrl(_0x452b1f[_0x31bff7(0x1a9)],'/app/ps/'+_0x35cb21+_0x31bff7(0x24c)+_0x1d6a1d+'/j/da');};if(_0x452b1f[_0x5b0300(0x1bb)]===_0x5b0300(0x27e))await handleSDKOutput(_0x14843e,_0x452b1f);else{if(_0x452b1f[_0x5b0300(0x1bb)]===_0x5b0300(0x280)){const _0x163bbc=_0x14843e[_0x5b0300(0x242)](_0x4a1c03=>({..._0x4a1c03,'url':_0x4e0bc6(_0x4a1c03['id'])}));await handleSDKOutput(_0x163bbc,_0x452b1f);}else{console[_0x5b0300(0x21c)]('['+_0x387bd0+']');const _0x1d5d95=new Map(),_0x466993=[];for(const _0x497130 of _0x14843e){if(!_0x497130[_0x5b0300(0x1af)]||_0x497130['folderId']===_0x3ffeda)_0x466993['push'](_0x497130);else{const _0x4d083e=_0x1d5d95[_0x5b0300(0x1df)](_0x497130['folderId'])||[];_0x4d083e[_0x5b0300(0x21e)](_0x497130),_0x1d5d95[_0x5b0300(0x269)](_0x497130[_0x5b0300(0x1af)],_0x4d083e);}}const _0x553586=(_0x34a4f9,_0xe3cd31)=>_0x34a4f9[_0x5b0300(0x19c)]['localeCompare'](_0xe3cd31[_0x5b0300(0x19c)],undefined,{'sensitivity':_0x5b0300(0x23a)});_0x466993[_0x5b0300(0x215)](_0x553586);for(const _0x160022 of _0x466993){console['log'](formatJourneyItem(_0x160022,'',_0x4e0bc6(_0x160022['id'])));}const _0x3283ac=[..._0x1d5d95[_0x5b0300(0x1a6)]()][_0x5b0300(0x215)]((_0x342e17,_0x23f655)=>{const _0x3c12e0=_0x5b0300,_0x3a763a=_0x3959aa['get'](_0x342e17[0x0])||_0x342e17[0x0],_0x27206b=_0x3959aa[_0x3c12e0(0x1df)](_0x23f655[0x0])||_0x23f655[0x0];return _0x3a763a[_0x3c12e0(0x222)](_0x27206b,undefined,{'sensitivity':_0x3c12e0(0x23a)});});for(const [_0x2fa270,_0x3666f7]of _0x3283ac){const _0x52c196=_0x3959aa[_0x5b0300(0x1df)](_0x2fa270)||_0x2fa270;console[_0x5b0300(0x21c)](_0x5b0300(0x183)+_0x52c196),_0x3666f7['sort'](_0x553586);for(const _0x311264 of _0x3666f7){console['log'](formatJourneyItem(_0x311264,'\x20\x20',_0x4e0bc6(_0x311264['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a26_0x35994b(0x26a)]='journey:view';[a26_0x35994b(0x19a)]='Show\x20journey\x20details';async[a26_0x35994b(0x1f1)](_0x4a8395){const _0x468f79=a26_0x35994b,{options:_0x3f79a8,args:_0x1a1b4f,tdx:_0x47b7a5}=_0x4a8395,_0x5b0fd5=_0x1a1b4f[0x0];if(!_0x5b0fd5)return console[_0x468f79(0x1a3)](_0x468f79(0x1d4)),console[_0x468f79(0x1a3)](_0x468f79(0x1bd)),console[_0x468f79(0x1a3)](_0x468f79(0x19b)),console[_0x468f79(0x1a3)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x3f79a8[_0x468f79(0x18b)]&&console[_0x468f79(0x1a3)](_0x468f79(0x1ce)+_0x5b0fd5);const {journeyId:_0x3b23e6,parentSegmentId:_0x441c9e}=await resolveJourneyIdFromInput(_0x5b0fd5,_0x3f79a8,_0x47b7a5);if(_0x3f79a8[_0x468f79(0x1d9)]){const _0x547399=getConsoleNextUrl(_0x3f79a8[_0x468f79(0x1a9)],'/app/ps/'+_0x441c9e+_0x468f79(0x24c)+_0x3b23e6+_0x468f79(0x190));return console[_0x468f79(0x1a3)](a26_0x44a323[_0x468f79(0x1b1)]('✔')+_0x468f79(0x200)+a26_0x44a323[_0x468f79(0x202)](_0x547399)),openBrowser(_0x547399),0x0;}const _0xafaad8=await withSpinner(_0x468f79(0x20f),()=>_0x47b7a5['journey'][_0x468f79(0x28e)](_0x3b23e6),{'verbose':_0x3f79a8[_0x468f79(0x18b)]}),_0x204248=_0xafaad8[_0x468f79(0x1b3)],_0x171721=_0x3f79a8['includeStats'];let _0x291ea1;if(_0x171721)try{const _0xd2680a=await withSpinner(_0x468f79(0x248),()=>_0x47b7a5[_0x468f79(0x1de)][_0x468f79(0x22e)](_0x3b23e6),{'verbose':_0x3f79a8['verbose']});_0x291ea1=_0xd2680a[_0x468f79(0x1b3)];}catch{_0x3f79a8[_0x468f79(0x18b)]&&console['error'](_0x468f79(0x287));}const _0x427081=getConsoleNextUrl(_0x3f79a8[_0x468f79(0x1a9)],_0x468f79(0x25e)+_0x441c9e+'/e/'+_0x3b23e6+_0x468f79(0x190)),_0x51e095={'id':_0x204248['id'],'name':_0x204248[_0x468f79(0x283)]['name'],'description':_0x204248[_0x468f79(0x283)][_0x468f79(0x19a)],'state':_0x204248[_0x468f79(0x283)][_0x468f79(0x19d)],'paused':_0x204248[_0x468f79(0x283)][_0x468f79(0x198)],'reentry_mode':_0x204248[_0x468f79(0x283)][_0x468f79(0x1f5)],'stages':_0x204248[_0x468f79(0x283)][_0x468f79(0x1e8)]?.['length']||0x0,..._0x204248[_0x468f79(0x283)]['goal']&&{'goal':_0x204248['attributes'][_0x468f79(0x23d)]['name']},..._0x291ea1&&{'statistics':{'size':_0x291ea1[_0x468f79(0x253)],'entered':_0x291ea1['enteredSize'],'goal_achieved':_0x291ea1[_0x468f79(0x21f)],'completion_rate':_0x291ea1[_0x468f79(0x27b)],'exit_or_jump':_0x291ea1[_0x468f79(0x1ff)],'exit_or_jump_rate':_0x291ea1['exitOrJumpRate'],'stages':_0x291ea1[_0x468f79(0x201)]}},'url':_0x427081};return await handleSingleObjectOutput(_0x51e095,_0x3f79a8),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x19f);[a26_0x35994b(0x19a)]=a26_0x35994b(0x260);async['execute'](_0x383239){const _0x4405a2=a26_0x35994b,{options:_0x34a498,args:_0x9f1312,tdx:_0x7ea5dc}=_0x383239,_0x5a052b=_0x9f1312[0x0];if(!requireNameOrPath(_0x5a052b))return 0x1;_0x34a498[_0x4405a2(0x18b)]&&console[_0x4405a2(0x1a3)]('Input:\x20'+_0x5a052b);const _0x351cc0=_0x34a498,_0x5272b8=_0x351cc0[_0x4405a2(0x292)],_0x1ae882=_0x351cc0['to'],_0x4f7a3e=_0x351cc0[_0x4405a2(0x1d0)],_0x5ccb12=_0x351cc0[_0x4405a2(0x271)];_0x4f7a3e&&!_0x5272b8&&!_0x1ae882&&console[_0x4405a2(0x1a3)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0xdc255a=_0x4f7a3e?withJsonFormat(_0x34a498):_0x34a498,{journeyId:_0x415841,journeyName:_0x4cf1a6}=await resolveJourneyIdFromInput(_0x5a052b,_0xdc255a,_0x7ea5dc),_0x2bb9d5=_0x5272b8||_0x1ae882?{'from':_0x5272b8,'to':_0x1ae882}:undefined,_0x7a307d=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x4405a2(0x1e9)]([_0x7ea5dc[_0x4405a2(0x1de)][_0x4405a2(0x28e)](_0x415841),_0x7ea5dc[_0x4405a2(0x1de)][_0x4405a2(0x22e)](_0x415841,_0x2bb9d5)]),{'verbose':_0xdc255a[_0x4405a2(0x18b)]}),[_0x45c96c,_0x5b2526]=_0x7a307d['data'];if(!_0x5b2526||_0x5b2526[_0x4405a2(0x231)]===null)return console['error'](_0x4405a2(0x1fe)+_0x4cf1a6),console[_0x4405a2(0x1a3)](_0x4405a2(0x1c0)),0x0;const _0x533a86=buildStageNameMap(_0x45c96c),_0xaea401=!!(_0x2bb9d5&&_0x5b2526['history']?.[_0x4405a2(0x24a)]),_0x30e0cc={'stageNameMap':_0x533a86,'hasPeriod':_0xaea401,'includeHistory':!!_0x4f7a3e};if(_0x5ccb12&&_0x5b2526[_0x4405a2(0x201)]){const _0x5372ac=_0x5b2526[_0x4405a2(0x201)]['find'](_0x5ca5f7=>{const _0x4a254c=_0x4405a2,_0xe409eb=_0x533a86[_0x4a254c(0x1df)](_0x5ca5f7['id'])??'';return _0xe409eb[_0x4a254c(0x27f)]()===_0x5ccb12[_0x4a254c(0x27f)]();});if(_0x5372ac)return await handleSingleObjectOutput(formatStageStats(_0x5372ac,_0x30e0cc),_0xdc255a),0x0;const _0x4b07dc=_0x5b2526[_0x4405a2(0x201)][_0x4405a2(0x242)](_0x480bb7=>_0x533a86[_0x4405a2(0x1df)](_0x480bb7['id'])??_0x480bb7['id']);return console['error']('Error:\x20Stage\x20\x22'+_0x5ccb12+_0x4405a2(0x196)),console[_0x4405a2(0x1a3)](_0x4405a2(0x207)+_0x4b07dc[_0x4405a2(0x1f7)](',\x20')),0x1;}const _0x3bbda1=_0x5b2526[_0x4405a2(0x201)]?.[_0x4405a2(0x242)](_0x4ee3bc=>formatStageStats(_0x4ee3bc,_0x30e0cc)),_0x4a7130=assembleJourneyStats(_0x5b2526,{'from':_0x5272b8,'to':_0x1ae882,'includeHistory':_0x4f7a3e});return await this[_0x4405a2(0x229)](_0x4a7130,_0x3bbda1??[],_0xdc255a),0x0;}async['renderStats'](_0x4a8f5c,_0x388404,_0x2ba3bc){const _0x51347f=a26_0x35994b,_0x1cebc2=_0x2ba3bc[_0x51347f(0x1bb)]==='json'||_0x2ba3bc[_0x51347f(0x1bb)]===_0x51347f(0x25a)||_0x2ba3bc[_0x51347f(0x280)]||_0x2ba3bc[_0x51347f(0x25a)];if(_0x1cebc2){_0x4a8f5c['stages']=_0x388404,await handleSingleObjectOutput(_0x4a8f5c,_0x2ba3bc);return;}await handleSingleObjectOutput(_0x4a8f5c,_0x2ba3bc);for(const _0x4f28c0 of _0x388404){console[_0x51347f(0x21c)](''),console[_0x51347f(0x21c)](String(a26_0x44a323[_0x51347f(0x202)][_0x51347f(0x185)]('['+_0x4f28c0['name']+']'))+a26_0x44a323[_0x51347f(0x20c)]('\x20'+_0x4f28c0['id']));const {id:_0x4cb996,name:_0x1f1bcb,..._0x54d458}=_0x4f28c0;await handleSingleObjectOutput(_0x54d458,_0x2ba3bc);}}}export class JourneyTrafficCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x249);[a26_0x35994b(0x19a)]=a26_0x35994b(0x25c);async[a26_0x35994b(0x1f1)](_0x4810c4){const _0xd14e72=a26_0x35994b,{options:_0x22cf40,args:_0x552dec,tdx:_0x4f882f}=_0x4810c4,_0x33dc9c=_0x552dec[0x0];if(!requireNameOrPath(_0x33dc9c))return 0x1;_0x22cf40[_0xd14e72(0x18b)]&&console[_0xd14e72(0x1a3)](_0xd14e72(0x1ce)+_0x33dc9c);const _0x4e4952=_0x22cf40,_0x27465a=_0x4e4952[_0xd14e72(0x21a)],_0x11cb17=_0x4e4952['from'],_0x451a66=_0x4e4952['to'],_0x23532e=_0x4e4952[_0xd14e72(0x18e)];if(_0x27465a&&_0x27465a!=='conversion'&&_0x27465a!=='activation')return console['error'](_0xd14e72(0x18c)+_0x27465a+_0xd14e72(0x288)),0x1;const _0xc4d18f=withJsonFormat(_0x22cf40),{journeyId:_0x9b4099,journeyName:_0x2f5547}=await resolveJourneyIdFromInput(_0x33dc9c,_0xc4d18f,_0x4f882f),_0x499e64={'type':_0x27465a,'from':_0x11cb17,'to':_0x451a66,'limit':_0x23532e},_0x3c1208=await withSpinner(_0xd14e72(0x193),()=>_0x4f882f[_0xd14e72(0x1de)][_0xd14e72(0x270)](_0x9b4099,_0x499e64),{'verbose':_0xc4d18f['verbose']}),_0x5cd2f6=_0x3c1208['data'],_0x3d4079=_0x5cd2f6[_0xd14e72(0x1f6)]&&(_0x5cd2f6[_0xd14e72(0x1f6)][_0xd14e72(0x1b0)][_0xd14e72(0x24a)]>0x0||_0x5cd2f6[_0xd14e72(0x1f6)]['links'][_0xd14e72(0x24a)]>0x0),_0xb83c50=_0x5cd2f6[_0xd14e72(0x1c9)]&&_0x5cd2f6[_0xd14e72(0x1c9)][_0xd14e72(0x24a)]>0x0;if(!_0x3d4079&&!_0xb83c50)return console[_0xd14e72(0x1a3)](_0xd14e72(0x188)+_0x2f5547),console[_0xd14e72(0x1a3)](_0xd14e72(0x28f)),_0x11cb17&&_0x451a66&&console[_0xd14e72(0x1a3)](_0xd14e72(0x232)),0x0;return await handleSingleObjectOutput(_0x5cd2f6,_0xc4d18f),0x0;}}function formatStageStats(_0x1ed0b6,_0x171e89){const _0x4280cc=a26_0x35994b,_0x6ac3d2=_0x171e89['hasPeriod']&&_0x1ed0b6['history']?.[_0x4280cc(0x24a)]?aggregateStageHistory(_0x1ed0b6[_0x4280cc(0x18f)]):{'size':_0x1ed0b6[_0x4280cc(0x253)],'entered':_0x1ed0b6[_0x4280cc(0x212)],'milestone':_0x1ed0b6[_0x4280cc(0x1c8)],'milestone_rate':_0x1ed0b6['completeMilestoneRate'],'exit_or_jump':_0x1ed0b6['exitOrJumpSize'],'exit_or_jump_rate':_0x1ed0b6[_0x4280cc(0x289)]},_0xecf233={'id':_0x1ed0b6['id'],'name':_0x171e89['stageNameMap'][_0x4280cc(0x1df)](_0x1ed0b6['id'])??_0x1ed0b6['id'],..._0x6ac3d2};return _0x171e89['hasPeriod']&&_0x171e89['includeHistory']&&_0x1ed0b6['history']&&(_0xecf233['history']=_0x1ed0b6['history']),_0xecf233;}export class JourneyPauseCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x22d);[a26_0x35994b(0x19a)]=a26_0x35994b(0x22f);async[a26_0x35994b(0x1f1)](_0x108024){const _0x5285c9=a26_0x35994b,{options:_0x4abae5,args:_0x40019a,tdx:_0x580264}=_0x108024,_0xc7425d=_0x40019a[0x0];if(!requireNameOrPath(_0xc7425d))return 0x1;_0x4abae5['verbose']&&console[_0x5285c9(0x1a3)](_0x5285c9(0x1ce)+_0xc7425d);const {journeyId:_0x52821b,journeyName:_0x53957b}=await resolveJourneyIdFromInput(_0xc7425d,_0x4abae5,_0x580264);if(!_0x4abae5['yes']){const _0x49618b=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x53957b+'\x22?');if(!_0x49618b)return console[_0x5285c9(0x1a3)]('Cancelled'),0x0;}const _0x1f868c=await withSpinner('Pausing\x20journey...',()=>_0x580264['journey'][_0x5285c9(0x1f0)](_0x52821b),{'verbose':_0x4abae5[_0x5285c9(0x18b)]}),_0x370add=_0x1f868c[_0x5285c9(0x1b3)];return console[_0x5285c9(0x1a3)](_0x5285c9(0x22b)+_0x370add[_0x5285c9(0x283)]['name']+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x1e7);[a26_0x35994b(0x19a)]=a26_0x35994b(0x20b);async['execute'](_0x4831af){const _0x43a23a=a26_0x35994b,{options:_0x6f7707,args:_0x262ab4,tdx:_0x595a5e}=_0x4831af,_0x273bbc=_0x262ab4[0x0];if(!requireNameOrPath(_0x273bbc))return 0x1;_0x6f7707['verbose']&&console['error'](_0x43a23a(0x1ce)+_0x273bbc);const {journeyId:_0x495976,journeyName:_0x5564d0}=await resolveJourneyIdFromInput(_0x273bbc,_0x6f7707,_0x595a5e);if(!_0x6f7707[_0x43a23a(0x259)]){const _0x1abf0e=await confirm(_0x43a23a(0x263)+_0x5564d0+'\x22?');if(!_0x1abf0e)return console['error'](_0x43a23a(0x1d6)),0x0;}const _0x170bf9=await withSpinner(_0x43a23a(0x1a0),()=>_0x595a5e[_0x43a23a(0x1de)][_0x43a23a(0x1bc)](_0x495976),{'verbose':_0x6f7707[_0x43a23a(0x18b)]}),_0x216825=_0x170bf9[_0x43a23a(0x1b3)];return console[_0x43a23a(0x1a3)](_0x43a23a(0x22b)+_0x216825[_0x43a23a(0x283)][_0x43a23a(0x26a)]+_0x43a23a(0x189)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x265);['description']=a26_0x35994b(0x1c6);async[a26_0x35994b(0x1f1)](_0x272c01){const _0x1f2553=a26_0x35994b,{options:_0x578dfc,args:_0x43b29c,tdx:_0x39e6f6}=_0x272c01,_0x177173=_0x578dfc,_0x5b8f2f=_0x43b29c[0x0],_0x939e94=_0x5b8f2f&&isYamlFilePath(_0x5b8f2f),_0x2ecfd9=await resolveTarget({'arg':_0x939e94?_0x5b8f2f:undefined,'contextParent':_0x578dfc[_0x1f2553(0x213)],'cwd':process[_0x1f2553(0x1b4)]()});if(!isSuccessfulResolution(_0x2ecfd9))return _0x2ecfd9['errorCode']==='no_parent'?(console['error'](a26_0x44a323[_0x1f2553(0x195)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x1f2553(0x1a3)](_0x1f2553(0x21d)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x1f2553(0x1a3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x1f2553(0x1a3)](a26_0x44a323[_0x1f2553(0x225)]('Error:\x20'+_0x2ecfd9[_0x1f2553(0x194)]+'\x0a')),_0x2ecfd9['helpText']&&console['error'](a26_0x44a323['cyan'](_0x2ecfd9[_0x1f2553(0x282)]))),0x1;let _0x18b990=_0x939e94?undefined:_0x5b8f2f,_0x51ab26,_0x496c2d;_0x2ecfd9[_0x1f2553(0x21a)]===_0x1f2553(0x28c)&&(_0x18b990=_0x2ecfd9['resourceName'],_0x51ab26=_0x2ecfd9['filePath'],_0x496c2d=_0x2ecfd9[_0x1f2553(0x22a)]);const _0x24fcb6=_0x2ecfd9[_0x1f2553(0x264)],_0x212739=_0x2ecfd9[_0x1f2553(0x1f4)];_0x177173['verbose']&&(console[_0x1f2553(0x1a3)](_0x1f2553(0x237)+_0x24fcb6),console[_0x1f2553(0x1a3)](_0x1f2553(0x26e)+_0x212739),_0x18b990&&console[_0x1f2553(0x1a3)](_0x1f2553(0x277)+_0x18b990),_0x51ab26&&console[_0x1f2553(0x1a3)](_0x1f2553(0x274)+_0x51ab26),_0x496c2d&&console[_0x1f2553(0x1a3)]('Folder\x20path:\x20'+_0x496c2d));const _0x4aabc5=await withSpinner(_0x1f2553(0x291),()=>_0x39e6f6[_0x1f2553(0x1cb)][_0x1f2553(0x275)](_0x24fcb6),{'verbose':_0x578dfc[_0x1f2553(0x18b)]}),_0x3fc285=_0x4aabc5[_0x1f2553(0x1b3)],{journeys:_0x321b40,folders:_0x4a4458}=await withSpinner(_0x1f2553(0x205),async()=>{const _0x12fa7c=_0x1f2553,[_0x908af0,_0x496ce]=await Promise['all']([_0x39e6f6[_0x12fa7c(0x1de)][_0x12fa7c(0x1ab)](_0x3fc285,undefined,{'includeAllVersions':!![]}),_0x39e6f6[_0x12fa7c(0x1cb)][_0x12fa7c(0x1dc)](_0x3fc285)]);return{'journeys':_0x908af0,'folders':_0x496ce};},{'verbose':_0x578dfc[_0x1f2553(0x18b)]})[_0x1f2553(0x20e)](_0x3bb729=>_0x3bb729[_0x1f2553(0x1b3)]);let _0x4649ad=_0x321b40;const _0x5d5abd=buildFolderIdToPathMap(_0x4a4458);if(_0x18b990){const _0x5a2dbd=_0x4649ad[_0x1f2553(0x233)](_0x9b1b5f=>_0x9b1b5f[_0x1f2553(0x19c)]['toLowerCase']()===_0x18b990[_0x1f2553(0x27f)]());if(_0x5a2dbd[_0x1f2553(0x24a)]===0x0)return console['error']('Error:\x20Journey\x20not\x20found:\x20'+_0x18b990),console[_0x1f2553(0x1a3)](_0x1f2553(0x228)),0x1;_0x4649ad=_0x5a2dbd;}if(_0x496c2d!==undefined){const _0xd83a9a=_0x4649ad['filter'](_0x1159fe=>{const _0x5c6a0f=_0x1f2553,_0x461025=_0x1159fe['folderId']?_0x5d5abd[_0x5c6a0f(0x1df)](_0x1159fe[_0x5c6a0f(0x1af)])||'':'';return _0x461025===_0x496c2d;});if(_0xd83a9a[_0x1f2553(0x24a)]===0x0&&_0x4649ad[_0x1f2553(0x24a)]>0x0){console[_0x1f2553(0x1a3)](_0x1f2553(0x210)+_0x18b990+'\x27\x20not\x20found\x20in\x20'+(_0x496c2d||_0x1f2553(0x236))),console[_0x1f2553(0x1a3)](_0x1f2553(0x1a7));for(const _0x36b07a of _0x4649ad){const _0x134717=_0x36b07a[_0x1f2553(0x1af)]?_0x5d5abd['get'](_0x36b07a[_0x1f2553(0x1af)])||'':'';console[_0x1f2553(0x1a3)](_0x1f2553(0x214)+(_0x134717||_0x1f2553(0x257))+'/'+_0x36b07a[_0x1f2553(0x19c)]);}return 0x1;}_0x4649ad=_0xd83a9a;}if(_0x4649ad[_0x1f2553(0x24a)]===0x0)return console[_0x1f2553(0x1a3)](_0x1f2553(0x1ee)),0x0;const _0x173959=new Map();for(const _0x1fd151 of _0x4649ad){const _0x428ca8=_0x1fd151[_0x1f2553(0x1c1)];!_0x173959[_0x1f2553(0x278)](_0x428ca8)&&_0x173959['set'](_0x428ca8,[]),_0x173959[_0x1f2553(0x1df)](_0x428ca8)[_0x1f2553(0x21e)](_0x1fd151);}for(const _0x4e4438 of _0x173959[_0x1f2553(0x217)]()){_0x4e4438['sort']((_0x1c6a22,_0x50e951)=>(_0x1c6a22['versionNumber']||0x0)-(_0x50e951[_0x1f2553(0x1a5)]||0x0));}const _0x3e7ee2=[],{idToEmailMap:_0x5a60fd,connectionIdToNameMap:_0x4c29df}=await withSpinner(_0x1f2553(0x281),async()=>{const _0x3fd1e1=_0x1f2553,[_0x4976fc,_0x8fccc9]=await Promise['all']([_0x39e6f6[_0x3fd1e1(0x284)][_0x3fd1e1(0x241)](),_0x39e6f6[_0x3fd1e1(0x1cf)][_0x3fd1e1(0x1ef)]()]);return{'idToEmailMap':_0x4976fc,'connectionIdToNameMap':_0x8fccc9};},{'verbose':_0x578dfc[_0x1f2553(0x18b)]})[_0x1f2553(0x20e)](_0x99ba98=>_0x99ba98[_0x1f2553(0x1b3)]);for(const _0x584b3d of _0x173959[_0x1f2553(0x217)]()){const _0x352b8c=_0x584b3d[0x0][_0x1f2553(0x19c)],_0x4fae84=_0x584b3d[0x0][_0x1f2553(0x1af)],_0xd1fd91=_0x4fae84?_0x5d5abd['get'](_0x4fae84)||'':'',_0x27f3fe=_0xd1fd91?a26_0x2d0323[_0x1f2553(0x1f7)](_0x212739,_0xd1fd91):_0x212739,_0x33143c=_0x51ab26||a26_0x2d0323[_0x1f2553(0x1f7)](_0x27f3fe,sanitizeFileName(_0x352b8c)+_0x1f2553(0x1dd));let _0x2fe4e1,_0x5d54a6;if(existsSync(_0x33143c))try{const _0x39afbb=readFileSync(_0x33143c,_0x1f2553(0x1f2)),_0x318103=parseYamlString(_0x39afbb);_0x5d54a6=_0x318103,_0x2fe4e1=buildRuleToNameMapping(_0x318103),_0x177173[_0x1f2553(0x18b)]&&_0x2fe4e1[_0x1f2553(0x253)]>0x0&&console[_0x1f2553(0x1a3)](_0x1f2553(0x1f3)+_0x2fe4e1[_0x1f2553(0x253)]+_0x1f2553(0x208)+_0x352b8c);}catch(_0x394ea8){_0x177173['verbose']&&console[_0x1f2553(0x1a3)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x394ea8[_0x1f2553(0x194)]);}const _0x5c6e8b=[],_0x1c625d=new Set(),_0x4d596b=new Map(),_0x3772d2=new Map(),_0x1d651e=new Set(),_0x27f38f=new Map(),_0x20a2ae=new Map(),_0x37b3ae=createJumpTargetCache();await withProgressSpinner(_0x1f2553(0x186)+_0x352b8c+_0x1f2553(0x267),async _0x48c79f=>{const _0x34ff3c=_0x1f2553;for(const _0x4f360d of _0x584b3d){const _0x120205=_0x584b3d['length']>0x1?_0x4f360d['journeyBundleName']+'\x20v'+(_0x4f360d[_0x34ff3c(0x1a5)]||0x1):_0x4f360d[_0x34ff3c(0x19c)];_0x48c79f[_0x34ff3c(0x1c3)](_0x34ff3c(0x186)+_0x120205);const _0x2ea9de=await _0x39e6f6[_0x34ff3c(0x1de)][_0x34ff3c(0x28e)](_0x4f360d['id']),_0x546ef3=_0x2ea9de[_0x34ff3c(0x283)]?.[_0x34ff3c(0x1bf)],_0x9880b={'resolveSegment':async _0x186d6c=>{const _0x405e8e=_0x34ff3c;if(!_0x546ef3)return{'name':_0x186d6c,'isJourneyLocal':![]};const _0x34bb4b=_0x4d596b[_0x405e8e(0x1df)](_0x186d6c);if(_0x34bb4b)return _0x34bb4b;try{const _0x4d6b69=await _0x39e6f6[_0x405e8e(0x1cb)][_0x405e8e(0x20a)](_0x546ef3,_0x186d6c),_0x406ee5=_0x4d6b69[_0x405e8e(0x187)]===SEGMENT_KIND_JOURNEY;let _0x1f4e3a,_0x207a66=_0x4d6b69['name'];if(_0x406ee5&&_0x4d6b69[_0x405e8e(0x23f)]){const _0xa2be2e=await segmentResponseToDef(_0x4d6b69,{'resolveSegmentName':async _0x5a1fde=>{const _0x178b65=_0x405e8e,_0x577511=_0x4d596b[_0x178b65(0x1df)](_0x5a1fde);if(_0x577511)return _0x577511[_0x178b65(0x26a)];const _0x66b4db=await _0x9880b['resolveSegment'](_0x5a1fde);return _0x66b4db[_0x178b65(0x26a)];}}),_0x591220=_0xa2be2e['rule'];_0x1f4e3a={'description':_0x4d6b69['description'],'rule':_0x591220};const _0x30ae8a=serializeRule(_0x591220),_0x45db64=_0x3772d2[_0x405e8e(0x1df)](_0x30ae8a);if(_0x45db64)_0x207a66=_0x45db64,_0x1f4e3a=undefined,_0x177173[_0x405e8e(0x18b)]&&console['error'](_0x405e8e(0x258)+_0x4d6b69[_0x405e8e(0x26a)]+_0x405e8e(0x23b)+_0x45db64);else{let _0x3df31a=![];if(_0x2fe4e1){const _0x56958d=_0x2fe4e1[_0x405e8e(0x1df)](_0x30ae8a);if(_0x56958d){const _0x22bf9e=_0x56958d[_0x405e8e(0x1d1)](_0x4e29e5=>!_0x1c625d[_0x405e8e(0x278)](_0x4e29e5));_0x22bf9e&&(_0x207a66=_0x22bf9e,_0x1c625d[_0x405e8e(0x1eb)](_0x22bf9e),_0x3772d2['set'](_0x30ae8a,_0x22bf9e),_0x3df31a=!![],_0x177173[_0x405e8e(0x18b)]&&console[_0x405e8e(0x1a3)](_0x405e8e(0x18d)+_0x22bf9e+'\x20(rule\x20match)'));}}if(!_0x3df31a){const _0x584fa3=generateJourneyLocalName(_0x4d6b69[_0x405e8e(0x26a)]);_0x584fa3&&(_0x207a66=_0x584fa3);let _0x476ad0=_0x207a66,_0x300ac5=0x2;while(_0x1c625d[_0x405e8e(0x278)](_0x476ad0)){_0x476ad0=_0x207a66+'_'+_0x300ac5,_0x300ac5++;}_0x1c625d[_0x405e8e(0x1eb)](_0x476ad0),_0x3772d2[_0x405e8e(0x269)](_0x30ae8a,_0x476ad0),_0x207a66=_0x476ad0;}}}const _0x185dc5={'name':_0x207a66,'isJourneyLocal':_0x406ee5,'definition':_0x1f4e3a};return _0x4d596b['set'](_0x186d6c,_0x185dc5),_0x185dc5;}catch(_0x59fd29){return _0x578dfc[_0x405e8e(0x18b)]&&console['error'](_0x405e8e(0x1e5)+_0x186d6c+':\x20'+_0x59fd29[_0x405e8e(0x194)]),{'name':_0x186d6c,'isJourneyLocal':![]};}},'resolveActivation':async _0x555427=>{const _0x1555db=_0x34ff3c,_0x1da321=_0x27f38f[_0x1555db(0x1df)](_0x555427);if(_0x1da321)return _0x1da321;try{const _0x453938=await _0x39e6f6[_0x1555db(0x1de)][_0x1555db(0x290)](_0x4f360d['id'],_0x555427),_0x1d0b0d=journeyActivationStepToYaml(_0x453938,_0x5a60fd,_0x4c29df),_0x494b87=JSON[_0x1555db(0x1cd)]({'name':_0x1d0b0d[_0x1555db(0x26a)],'connection':_0x1d0b0d['connection'],'connector_config':_0x1d0b0d[_0x1555db(0x219)]}),_0x291f3e=_0x20a2ae[_0x1555db(0x1df)](_0x494b87);if(_0x291f3e){const _0x3f15e7={'name':_0x291f3e,'isJourneyLocal':!![],'definition':_0x1d0b0d};return _0x27f38f[_0x1555db(0x269)](_0x555427,_0x3f15e7),_0x3f15e7;}const _0x2b3a00=_0x453938[_0x1555db(0x283)][_0x1555db(0x227)][_0x1555db(0x26a)]||_0x555427,_0xfc9c77=sanitizeYamlKey(_0x2b3a00)||_0x1555db(0x191)+_0x555427;let _0x2e966d=_0xfc9c77,_0x5289fd=0x2;while(_0x1d651e['has'](_0x2e966d)){_0x2e966d=_0xfc9c77+'_'+_0x5289fd,_0x5289fd++;}_0x1d651e[_0x1555db(0x1eb)](_0x2e966d),_0x20a2ae[_0x1555db(0x269)](_0x494b87,_0x2e966d);const _0x284b79={'name':_0x2e966d,'isJourneyLocal':!![],'definition':_0x1d0b0d};return _0x27f38f[_0x1555db(0x269)](_0x555427,_0x284b79),_0x284b79;}catch(_0x4a3293){return _0x578dfc[_0x1555db(0x18b)]&&console[_0x1555db(0x1a3)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x555427+':\x20'+_0x4a3293['message']),{'name':_0x555427,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x313fe4,_0x3c7fd1)=>{const _0x4eb045=_0x34ff3c;return resolveJumpTarget(_0x313fe4,_0x3c7fd1,_0x37b3ae,_0x8ce1b3=>_0x39e6f6[_0x4eb045(0x1de)][_0x4eb045(0x28e)](_0x8ce1b3));}},_0x4686f5=await journeyResponseToDef(_0x2ea9de,_0x9880b);_0x5c6e8b[_0x34ff3c(0x21e)]({'item':_0x4f360d,'yaml':_0x4686f5});}},{'verbose':_0x578dfc['verbose']});const _0x53dcd8=await _0x39e6f6[_0x1f2553(0x1de)]['getLatestJourneyId'](_0x584b3d[0x0][_0x1f2553(0x1c1)]),_0x4cf215=buildMergedJourneyDef(_0x5c6e8b,_0x2fe4e1,_0x53dcd8),_0x530d6a=normalizeJourneyDef(_0x4cf215,_0x5d54a6),_0x28a0de=toYamlString(_0x530d6a),_0xaf7c7e=_0x51ab26||a26_0x2d0323[_0x1f2553(0x1f7)](_0x27f3fe,sanitizeFileName(_0x352b8c)+_0x1f2553(0x1dd));!_0x51ab26&&_0xd1fd91&&!existsSync(_0x27f3fe)&&mkdirSync(_0x27f3fe,{'recursive':!![]});const _0x4c6c98=a26_0x2d0323[_0x1f2553(0x1d8)](process[_0x1f2553(0x1b4)](),_0xaf7c7e);if(existsSync(_0xaf7c7e)){const _0x4fd495=readFileSync(_0xaf7c7e,'utf-8'),_0x10cd52=generateDiff(_0x4fd495,_0x28a0de),_0x5d91ba=hasChanges(_0x10cd52);_0x3e7ee2['push']({'relativePath':_0x4c6c98,'absolutePath':_0xaf7c7e,'content':_0x28a0de,'isNew':![],'hasChanges':_0x5d91ba,'diff':_0x5d91ba?formatDiffWithColors(_0x10cd52):undefined});}else _0x3e7ee2[_0x1f2553(0x21e)]({'relativePath':_0x4c6c98,'absolutePath':_0xaf7c7e,'content':_0x28a0de,'isNew':!![],'hasChanges':![]});}const _0x2e4357=_0x3e7ee2['filter'](_0x426d45=>_0x426d45[_0x1f2553(0x206)]),_0x2ac13a=_0x3e7ee2['filter'](_0x5c0d91=>!_0x5c0d91[_0x1f2553(0x206)]&&_0x5c0d91[_0x1f2553(0x273)]),_0xa28bad=_0x3e7ee2['filter'](_0x298ff3=>!_0x298ff3[_0x1f2553(0x206)]&&!_0x298ff3[_0x1f2553(0x273)]),_0x31ab16=_0x4649ad[_0x1f2553(0x24a)],_0x10ca36=_0x173959['size'],_0x403268=_0x31ab16>_0x10ca36?'\x20('+_0x31ab16+_0x1f2553(0x1ad):'';console['error'](_0x1f2553(0x209)),console[_0x1f2553(0x1a3)]('\x20\x20'+a26_0x44a323[_0x1f2553(0x202)](_0x10ca36+_0x1f2553(0x1e2))+a26_0x44a323[_0x1f2553(0x20c)](_0x403268)),console[_0x1f2553(0x1a3)]('\x20\x20'+a26_0x44a323[_0x1f2553(0x1b1)]('+\x20'+_0x2e4357['length']+_0x1f2553(0x24f))),console['error']('\x20\x20'+a26_0x44a323[_0x1f2553(0x195)]('~\x20'+_0x2ac13a[_0x1f2553(0x24a)]+_0x1f2553(0x1cc))),console[_0x1f2553(0x1a3)]('\x20\x20'+a26_0x44a323[_0x1f2553(0x20c)]('=\x20'+_0xa28bad[_0x1f2553(0x24a)]+_0x1f2553(0x1e4))),console[_0x1f2553(0x1a3)](_0x1f2553(0x1c7)+a26_0x44a323[_0x1f2553(0x202)](_0x212739)+'\x0a');if(_0x2ac13a[_0x1f2553(0x24a)]>0x0)for(const _0x3b5e6e of _0x2ac13a){console[_0x1f2553(0x1a3)]('\x0aChanges\x20to\x20\x27'+_0x3b5e6e[_0x1f2553(0x250)]+'\x27:'),console[_0x1f2553(0x1a3)]('─'['repeat'](0x3c)),console[_0x1f2553(0x1a3)](_0x3b5e6e[_0x1f2553(0x1c5)]),console[_0x1f2553(0x1a3)]('─'[_0x1f2553(0x1ec)](0x3c));}if(_0x177173[_0x1f2553(0x252)])return console['error'](a26_0x44a323[_0x1f2553(0x195)](_0x1f2553(0x28a))),0x0;if(_0x2e4357[_0x1f2553(0x24a)]===0x0&&_0x2ac13a[_0x1f2553(0x24a)]===0x0)return console[_0x1f2553(0x1a3)](a26_0x44a323[_0x1f2553(0x1b1)](_0x1f2553(0x240))),saveSessionContext({'parent_segment':_0x24fcb6},_0x177173[_0x1f2553(0x261)]),console['error'](a26_0x44a323['green'](_0x1f2553(0x216)+a26_0x44a323[_0x1f2553(0x20c)](_0x1f2553(0x20d))+_0x1f2553(0x243)+a26_0x44a323[_0x1f2553(0x202)](_0x24fcb6))),0x0;if(!_0x177173[_0x1f2553(0x259)]&&(_0x2e4357[_0x1f2553(0x24a)]>0x0||_0x2ac13a[_0x1f2553(0x24a)]>0x0)){if(!isInteractive())return console[_0x1f2553(0x1a3)](a26_0x44a323['red'](_0x1f2553(0x1fc)),_0x1f2553(0x1b7)),console[_0x1f2553(0x1a3)](a26_0x44a323[_0x1f2553(0x20c)](_0x1f2553(0x1e1))),0x1;const _0x16b88b=await confirmKey(_0x1f2553(0x28d)+(_0x2e4357['length']+_0x2ac13a[_0x1f2553(0x24a)])+_0x1f2553(0x1f9));if(!_0x16b88b)return console[_0x1f2553(0x1a3)](a26_0x44a323['yellow'](_0x1f2553(0x234)),_0x1f2553(0x21b)),0x1;}!existsSync(_0x212739)&&mkdirSync(_0x212739,{'recursive':!![]});const _0x76ac63=a26_0x2d0323[_0x1f2553(0x1f7)](_0x212739,_0x1f2553(0x218));writeFileSync(_0x76ac63,createTdxConfigContent(_0x24fcb6),'utf-8');for(const _0x2d091b of _0x3e7ee2){(_0x2d091b[_0x1f2553(0x206)]||_0x2d091b['hasChanges'])&&writeFileSync(_0x2d091b[_0x1f2553(0x1fb)],_0x2d091b[_0x1f2553(0x279)],'utf-8');}return console[_0x1f2553(0x1a3)](a26_0x44a323[_0x1f2553(0x1b1)](_0x1f2553(0x1e3)+(_0x2e4357[_0x1f2553(0x24a)]+_0x2ac13a[_0x1f2553(0x24a)])+_0x1f2553(0x25b)+_0x212739)),saveSessionContext({'parent_segment':_0x24fcb6},_0x177173[_0x1f2553(0x261)]),console[_0x1f2553(0x1a3)](a26_0x44a323['green'](_0x1f2553(0x216)+a26_0x44a323[_0x1f2553(0x20c)]('parent_segment')+_0x1f2553(0x243)+a26_0x44a323[_0x1f2553(0x202)](_0x24fcb6))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a26_0x35994b(0x26a)]='journey:columns';['description']=a26_0x35994b(0x1fa);async[a26_0x35994b(0x1f1)](_0x4431fe){const _0x114496=a26_0x35994b,{options:_0x4888ed,args:_0xee0a09,tdx:_0x280f14}=_0x4431fe,_0x1ba9d7=_0xee0a09[0x0];if(!requireNameOrPath(_0x1ba9d7))return 0x1;_0x4888ed[_0x114496(0x18b)]&&console[_0x114496(0x1a3)](_0x114496(0x1ce)+_0x1ba9d7);const {journeyId:_0x24f66e}=await resolveJourneyIdFromInput(_0x1ba9d7,_0x4888ed,_0x280f14),_0x425acf=await withSpinner(_0x114496(0x272),()=>_0x280f14[_0x114496(0x1de)][_0x114496(0x197)](_0x24f66e),{'verbose':_0x4888ed[_0x114496(0x18b)]}),_0x2fb07d=_0x425acf['data'];return console[_0x114496(0x21c)](_0x114496(0x1ca)+_0x2fb07d[_0x114496(0x26d)]),console[_0x114496(0x21c)](_0x114496(0x238)+_0x2fb07d[_0x114496(0x27e)]),await handleSDKOutput(_0x2fb07d[_0x114496(0x203)],_0x4888ed),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x1da);[a26_0x35994b(0x19a)]=a26_0x35994b(0x221);async['execute'](_0x35f26d){const _0x213c8e=a26_0x35994b,{options:_0x1c2904,args:_0xf0d9ae,tdx:_0x1b3567}=_0x35f26d,_0x174632=_0xf0d9ae[0x0];if(!requireNameOrPath(_0x174632))return 0x1;_0x1c2904[_0x213c8e(0x18b)]&&console[_0x213c8e(0x1a3)]('Input:\x20'+_0x174632);const {journeyId:_0x101a0d}=await resolveJourneyIdFromInput(_0x174632,_0x1c2904,_0x1b3567),_0xac74bb=await withSpinner('Listing\x20journey\x20activations...',()=>_0x1b3567[_0x213c8e(0x1de)][_0x213c8e(0x268)](_0x101a0d),{'verbose':_0x1c2904['verbose']}),_0x31f6af=_0xac74bb[_0x213c8e(0x1b3)];return console['error'](_0x213c8e(0x1f3)+_0x31f6af['length']+_0x213c8e(0x1d2)+(_0x31f6af[_0x213c8e(0x24a)]!==0x1?'s':'')),await handleSDKOutput(_0x31f6af,_0x1c2904),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x245);[a26_0x35994b(0x19a)]=a26_0x35994b(0x24b);[a26_0x35994b(0x1c2)]=new SegmentPushCommand();async[a26_0x35994b(0x1f1)](_0x5d1cf3){const _0x69bc99=a26_0x35994b,_0x26eabb=_0x5d1cf3['args'][0x0];let _0x534505;if(_0x26eabb){const _0x47910e=await resolveTarget({'arg':_0x26eabb,'contextParent':_0x5d1cf3[_0x69bc99(0x1ae)][_0x69bc99(0x213)],'cwd':process[_0x69bc99(0x1b4)]()});isSuccessfulResolution(_0x47910e)&&_0x47910e[_0x69bc99(0x21a)]===_0x69bc99(0x28c)&&(_0x534505=_0x47910e[_0x69bc99(0x19e)]);}const _0x48bbac={..._0x5d1cf3,'options':{..._0x5d1cf3[_0x69bc99(0x1ae)],'journeysOnly':!![],..._0x534505&&{'singleFilePath':_0x534505}}};return this[_0x69bc99(0x1c2)]['execute'](_0x48bbac);}}export class JourneyVersionsCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x255);[a26_0x35994b(0x19a)]=a26_0x35994b(0x1b2);async[a26_0x35994b(0x1f1)](_0xc7adf7){const _0xad3bcc=a26_0x35994b,{options:_0x478df1,args:_0x4c3b92,tdx:_0x20bf6a}=_0xc7adf7,_0x1895d5=_0x4c3b92[0x0];if(!requireNameOrPath(_0x1895d5))return 0x1;if(_0x478df1[_0xad3bcc(0x18b)])console[_0xad3bcc(0x1a3)](_0xad3bcc(0x1ce)+_0x1895d5);const {journeyId:_0x1aade4}=await resolveJourneyIdFromInput(_0x1895d5,_0x478df1,_0x20bf6a),_0x191f82=await withSpinner(_0xad3bcc(0x1d5),()=>_0x20bf6a[_0xad3bcc(0x1de)][_0xad3bcc(0x266)](_0x1aade4),{'verbose':_0x478df1[_0xad3bcc(0x18b)]}),{bundleName:_0x1aa912,versions:_0x3c020d,latestJourneyId:_0x2d3738}=_0x191f82[_0xad3bcc(0x1b3)];console['error'](_0x1aa912+':\x20'+_0x3c020d[_0xad3bcc(0x24a)]+_0xad3bcc(0x1d7)+(_0x3c020d[_0xad3bcc(0x24a)]!==0x1?'s':''));const _0x909904=_0x3c020d['map'](_0x38e394=>({'version':_0x38e394['versionNumber'],'journey_id':_0x38e394[_0xad3bcc(0x231)],'name':_0x38e394['name'],'state':_0x38e394['state'],'paused':_0x38e394[_0xad3bcc(0x198)],'latest':_0x38e394['journeyId']===_0x2d3738,'created_at':_0x38e394[_0xad3bcc(0x254)]}));return await handleSDKOutput(_0x909904,_0x478df1),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a26_0x35994b(0x1ba);[a26_0x35994b(0x19a)]=a26_0x35994b(0x192);async[a26_0x35994b(0x1f1)](_0x4535f3){const _0x44e0e1=a26_0x35994b,{options:_0x567483,args:_0x1c76c1,tdx:_0x352d7e}=_0x4535f3,_0x487c8a=_0x1c76c1[0x0];if(!requireNameOrPath(_0x487c8a))return 0x1;if(_0x567483[_0x44e0e1(0x18b)])console[_0x44e0e1(0x1a3)](_0x44e0e1(0x1ce)+_0x487c8a);const {journeyId:_0x2b2125,journeyName:_0xaed696}=await resolveJourneyIdFromInput(_0x487c8a,_0x567483,_0x352d7e);if(!_0x567483[_0x44e0e1(0x259)]){const _0x31bf5b=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0xaed696+'\x22?');if(!_0x31bf5b)return console[_0x44e0e1(0x1a3)]('Cancelled'),0x0;}const _0x2f53d9=await withSpinner('Creating\x20new\x20version...',()=>_0x352d7e['journey'][_0x44e0e1(0x285)](_0x2b2125),{'verbose':_0x567483[_0x44e0e1(0x18b)]}),_0x13647a=_0x2f53d9['data'];return console[_0x44e0e1(0x1a3)](a26_0x44a323['green']('✔')+'\x20Created\x20v'+_0x13647a['attributes']['versionNumber']+'\x20(draft)\x20—\x20\x22'+_0x13647a[_0x44e0e1(0x283)][_0x44e0e1(0x26a)]+'\x22'),console[_0x44e0e1(0x1a3)]('\x20\x20Journey\x20ID:\x20'+_0x13647a['id']),await handleSingleObjectOutput({'id':_0x13647a['id'],'name':_0x13647a[_0x44e0e1(0x283)]['name'],'version':_0x13647a[_0x44e0e1(0x283)][_0x44e0e1(0x1a5)],'state':_0x13647a[_0x44e0e1(0x283)][_0x44e0e1(0x19d)],'bundle_id':_0x13647a[_0x44e0e1(0x283)][_0x44e0e1(0x1c1)],'created_at':_0x13647a[_0x44e0e1(0x283)][_0x44e0e1(0x254)]},_0x567483),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x204);['description']=a26_0x35994b(0x276);async['execute'](_0x4d6cdb){const _0x3ed7d8=a26_0x35994b,{options:_0x5991c1,args:_0x2a9820,tdx:_0x455f51}=_0x4d6cdb,_0x54c004=_0x2a9820[0x0];if(!requireNameOrPath(_0x54c004))return 0x1;const _0x5ab83b=_0x5991c1[_0x3ed7d8(0x244)];if(!_0x5ab83b)return console[_0x3ed7d8(0x1a3)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x3ed7d8(0x1a3)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x3baf26=parseInt(_0x5ab83b,0xa);if(isNaN(_0x3baf26)||_0x3baf26<0x1)return console['error'](_0x3ed7d8(0x256)+_0x5ab83b),0x1;if(_0x5991c1[_0x3ed7d8(0x18b)])console[_0x3ed7d8(0x1a3)]('Input:\x20'+_0x54c004+_0x3ed7d8(0x199)+_0x3baf26);const {journeyId:_0x50cab8,parentSegmentId:_0x3a9aee}=await resolveJourneyIdFromInput(_0x54c004,_0x5991c1,_0x455f51),_0x200efb=await withSpinner('Resolving\x20version...',()=>_0x455f51[_0x3ed7d8(0x1de)]['listVersions'](_0x50cab8),{'verbose':_0x5991c1[_0x3ed7d8(0x18b)]}),{versions:_0x11b410,latestJourneyId:_0xb9643e}=_0x200efb['data'],_0x52c879=_0x11b410[_0x3ed7d8(0x1d1)](_0x1ab9a8=>_0x1ab9a8['versionNumber']===_0x3baf26);if(!_0x52c879){const _0xf9d0d=_0x11b410[_0x3ed7d8(0x242)](_0x441951=>'v'+_0x441951[_0x3ed7d8(0x1a5)])[_0x3ed7d8(0x1f7)](',\x20');return console[_0x3ed7d8(0x1a3)](_0x3ed7d8(0x1a4)+_0x3baf26+'\x20not\x20found.\x20Available:\x20'+_0xf9d0d),0x1;}const _0x152abe=await withSpinner(_0x3ed7d8(0x1be)+_0x3baf26+_0x3ed7d8(0x1fd),()=>_0x455f51[_0x3ed7d8(0x1de)][_0x3ed7d8(0x28e)](_0x52c879[_0x3ed7d8(0x231)]),{'verbose':_0x5991c1['verbose']}),_0x28b9f2=_0x152abe[_0x3ed7d8(0x1b3)],_0x5b0f82=getConsoleNextUrl(_0x5991c1['site'],_0x3ed7d8(0x25e)+_0x3a9aee+'/e/'+_0x52c879[_0x3ed7d8(0x231)]+_0x3ed7d8(0x190));return await handleSingleObjectOutput({'id':_0x28b9f2['id'],'name':_0x28b9f2['attributes']['name'],'version':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x1a5)],'description':_0x28b9f2['attributes']['description'],'state':_0x28b9f2[_0x3ed7d8(0x283)]['state'],'paused':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x198)],'reentry_mode':_0x28b9f2['attributes']['reentryMode'],'stages':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x1e8)]?.[_0x3ed7d8(0x24a)]||0x0,..._0x28b9f2[_0x3ed7d8(0x283)]['goal']&&{'goal':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x23d)][_0x3ed7d8(0x26a)]},'latest':_0x52c879[_0x3ed7d8(0x231)]===_0xb9643e,'created_at':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x254)],'updated_at':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x23e)],'url':_0x5b0f82},_0x5991c1),0x0;}}
|
|
1
|
+
const a26_0xa84a1d=a26_0x250c;(function(_0x5af22c,_0x417e8e){const _0x4f4631=a26_0x250c,_0x2cb1a7=_0x5af22c();while(!![]){try{const _0x36f958=-parseInt(_0x4f4631(0x1c6))/0x1+parseInt(_0x4f4631(0x200))/0x2+-parseInt(_0x4f4631(0x231))/0x3*(-parseInt(_0x4f4631(0x1f6))/0x4)+-parseInt(_0x4f4631(0x212))/0x5+parseInt(_0x4f4631(0x1a6))/0x6+-parseInt(_0x4f4631(0x1c4))/0x7+parseInt(_0x4f4631(0x1d0))/0x8*(-parseInt(_0x4f4631(0x27c))/0x9);if(_0x36f958===_0x417e8e)break;else _0x2cb1a7['push'](_0x2cb1a7['shift']());}catch(_0x6b1caa){_0x2cb1a7['push'](_0x2cb1a7['shift']());}}}(a26_0x2e36,0x670d2));import a26_0xce81a1 from'chalk';import a26_0x5a6c84 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a26_0x250c(_0x2b937d,_0x532a1a){_0x2b937d=_0x2b937d-0x180;const _0x2e3668=a26_0x2e36();let _0x250c94=_0x2e3668[_0x2b937d];return _0x250c94;}import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x535178){const _0x19d41a=a26_0x250c;return!_0x535178&&(console[_0x19d41a(0x21f)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x19d41a(0x1e8))),!!_0x535178;}function withJsonFormat(_0x205dfd){const _0x1ecb0a=a26_0x250c;if(!_0x205dfd[_0x1ecb0a(0x249)]&&!_0x205dfd['json']&&!_0x205dfd[_0x1ecb0a(0x24c)]&&!_0x205dfd[_0x1ecb0a(0x1c5)])return{..._0x205dfd,'format':'json','json':!![]};return _0x205dfd;}function formatJourneyState(_0x506f05){const _0x361206=a26_0x250c;switch(_0x506f05){case _0x361206(0x284):return a26_0xce81a1[_0x361206(0x1e4)]('(running)');case _0x361206(0x1f1):return a26_0xce81a1[_0x361206(0x1c8)]('(draft)');case _0x361206(0x1c0):return a26_0xce81a1['yellow'](_0x361206(0x26e));case'completed':return a26_0xce81a1[_0x361206(0x269)](_0x361206(0x20c));case _0x361206(0x1d9):return a26_0xce81a1[_0x361206(0x1c8)]('(archived)');default:return'('+_0x506f05+')';}}function formatJourneyItem(_0x5e6eb1,_0x7d4157='',_0x25210b){const _0xdb898e=a26_0x250c,_0x9970c1=formatJourneyState(_0x5e6eb1[_0xdb898e(0x22f)]),_0x309b15=_0x25210b?hyperlink(_0x5e6eb1[_0xdb898e(0x216)],_0x25210b):_0x5e6eb1[_0xdb898e(0x216)];return _0x7d4157+'🗺️\x20'+_0x309b15+'\x20'+_0x9970c1;}function escapeRegex(_0x149cda){const _0x45ba7b=a26_0x250c;return _0x149cda[_0x45ba7b(0x218)](/[.*+?^${}()|[\]\\]/g,_0x45ba7b(0x1f8));}function globToRegex(_0x1f29eb){const _0xa40eeb=a26_0x250c,_0x5d5414=_0x1f29eb[_0xa40eeb(0x180)]('*')[_0xa40eeb(0x211)](escapeRegex);return new RegExp(_0x5d5414[_0xa40eeb(0x25e)]('.*'),'i');}function buildRuleToNameMapping(_0x528e57){const _0x1cdf20=a26_0x250c,_0x2fa102=new Map();if(_0x528e57[_0x1cdf20(0x250)])for(const [_0x2c5e39,_0x31990e]of Object['entries'](_0x528e57[_0x1cdf20(0x250)])){if(_0x31990e[_0x1cdf20(0x1d6)]){const _0x4da1a6=serializeRule(_0x31990e['rule']),_0x3e7617=_0x2fa102[_0x1cdf20(0x213)](_0x4da1a6);_0x3e7617?_0x3e7617[_0x1cdf20(0x1da)](_0x2c5e39):_0x2fa102[_0x1cdf20(0x196)](_0x4da1a6,[_0x2c5e39]);}}return _0x2fa102;}async function resolveJourneyIdFromInput(_0x5312a0,_0x25d5b8,_0x44baf9){const _0x3260c4=a26_0x250c,_0x1a9d07=await resolveJourneyTarget(_0x5312a0,_0x25d5b8[_0x3260c4(0x220)],_0x25d5b8[_0x3260c4(0x20f)]),_0x17e977=_0x1a9d07[_0x3260c4(0x220)];if(!_0x17e977)throw new SDKError(ErrorCode[_0x3260c4(0x233)],_0x3260c4(0x271));const _0x5d9fb7=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x44baf9[_0x3260c4(0x1ae)][_0x3260c4(0x24d)](_0x17e977),{'verbose':_0x25d5b8['verbose']}),_0x370b3a=_0x5d9fb7[_0x3260c4(0x226)],_0x149aa9=await withSpinner(_0x3260c4(0x1ba),()=>_0x44baf9[_0x3260c4(0x1d1)][_0x3260c4(0x219)](_0x370b3a,_0x1a9d07[_0x3260c4(0x1c3)]),{'verbose':_0x25d5b8[_0x3260c4(0x20f)]});return{'journeyId':_0x149aa9[_0x3260c4(0x226)],'journeyName':_0x1a9d07[_0x3260c4(0x1c3)],'parentSegmentId':_0x370b3a};}async function resolveJourneyTarget(_0x4e6423,_0x48603a,_0x4c875c){const _0x5a3d44=a26_0x250c;if(isYamlFilePath(_0x4e6423))try{const _0x32a925=await resolveYamlFilePath(_0x4e6423);return _0x4c875c&&(console[_0x5a3d44(0x21f)]('Resolved\x20YAML\x20file:\x20'+_0x4e6423),console['error'](_0x5a3d44(0x1b4)+_0x32a925['parentSegment']),console['error'](_0x5a3d44(0x276)+_0x32a925[_0x5a3d44(0x27f)]),console[_0x5a3d44(0x21f)](_0x5a3d44(0x280)+(_0x32a925[_0x5a3d44(0x1bc)]||_0x5a3d44(0x241)))),{'journeyName':_0x32a925[_0x5a3d44(0x27f)],'parentSegment':_0x32a925['parentSegment'],'resolved':_0x32a925};}catch(_0x5b9488){throw new SDKError(ErrorCode[_0x5a3d44(0x233)],_0x5a3d44(0x24b)+_0x5b9488[_0x5a3d44(0x27a)]);}if(!_0x48603a)throw new SDKError(ErrorCode[_0x5a3d44(0x233)],_0x5a3d44(0x1fc));return{'journeyName':_0x4e6423,'parentSegment':_0x48603a};}export class JourneyListCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x26f);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x209);async[a26_0xa84a1d(0x288)](_0x499b72){const _0x259bdd=a26_0xa84a1d,{options:_0x55afd7,args:_0x53ef12,tdx:_0x25a234}=_0x499b72,_0x5b2280=_0x53ef12[0x0],_0x396928=_0x55afd7[_0x259bdd(0x220)];if(!_0x396928)return console[_0x259bdd(0x21f)](_0x259bdd(0x26a)),console[_0x259bdd(0x21f)](_0x259bdd(0x237)),0x1;const _0x27a236=await withSpinner(_0x259bdd(0x26b),()=>_0x25a234['segment'][_0x259bdd(0x24d)](_0x396928),{'verbose':_0x55afd7[_0x259bdd(0x20f)]}),_0x234973=_0x27a236['data'];_0x55afd7[_0x259bdd(0x20f)]&&(console[_0x259bdd(0x21f)](_0x259bdd(0x23f)+_0x396928+_0x259bdd(0x1cd)+_0x234973+')'),_0x5b2280&&console[_0x259bdd(0x21f)](_0x259bdd(0x270)+_0x5b2280));const _0x2bf87f=await withSpinner(_0x259bdd(0x1a2),()=>_0x25a234[_0x259bdd(0x1ae)][_0x259bdd(0x229)](_0x234973),{'verbose':_0x55afd7[_0x259bdd(0x20f)]}),_0x2176d3=_0x2bf87f['data'],_0x4047a8=_0x2176d3[_0x259bdd(0x23c)],_0x52f6c6=await withSpinner(_0x259bdd(0x206),()=>_0x25a234[_0x259bdd(0x1d1)][_0x259bdd(0x258)](_0x234973,_0x4047a8),{'verbose':_0x55afd7['verbose']});let _0x47f62e=_0x52f6c6[_0x259bdd(0x226)]['journeys'];const _0x171cdf=_0x52f6c6[_0x259bdd(0x226)][_0x259bdd(0x1ad)],_0x59ae34=new Map();for(const _0x42a659 of _0x171cdf){_0x59ae34[_0x259bdd(0x196)](_0x42a659['id'],_0x42a659[_0x259bdd(0x1f9)]);}if(_0x5b2280){const _0x88030b=globToRegex(_0x5b2280);_0x47f62e=_0x47f62e[_0x259bdd(0x247)](_0x3fdfaf=>_0x88030b[_0x259bdd(0x1ef)](_0x3fdfaf['journeyBundleName']));}console[_0x259bdd(0x21f)](_0x259bdd(0x1d5)+_0x47f62e['length']+'\x20journey'+(_0x47f62e[_0x259bdd(0x1a7)]!==0x1?'s':''));const _0x33c1a2=_0x4c6f10=>{const _0x2bfe8b=_0x259bdd;return getConsoleNextUrl(_0x55afd7['site'],'/app/ps/'+_0x234973+_0x2bfe8b(0x1bf)+_0x4c6f10+'/j/da');};if(_0x55afd7[_0x259bdd(0x249)]==='table')await handleSDKOutput(_0x47f62e,_0x55afd7);else{if(_0x55afd7['format']===_0x259bdd(0x257)){const _0x4c5da7=_0x47f62e[_0x259bdd(0x211)](_0x20fcbe=>({..._0x20fcbe,'url':_0x33c1a2(_0x20fcbe['id'])}));await handleSDKOutput(_0x4c5da7,_0x55afd7);}else{console['log']('['+_0x396928+']');const _0x2be052=new Map(),_0x3da8cb=[];for(const _0x1ed05c of _0x47f62e){if(!_0x1ed05c[_0x259bdd(0x28b)]||_0x1ed05c[_0x259bdd(0x28b)]===_0x4047a8)_0x3da8cb['push'](_0x1ed05c);else{const _0x4d0548=_0x2be052[_0x259bdd(0x213)](_0x1ed05c['folderId'])||[];_0x4d0548[_0x259bdd(0x1da)](_0x1ed05c),_0x2be052['set'](_0x1ed05c[_0x259bdd(0x28b)],_0x4d0548);}}const _0x50b78b=(_0x2f557c,_0x349d83)=>_0x2f557c[_0x259bdd(0x216)][_0x259bdd(0x26d)](_0x349d83[_0x259bdd(0x216)],undefined,{'sensitivity':_0x259bdd(0x25f)});_0x3da8cb[_0x259bdd(0x234)](_0x50b78b);for(const _0x57cfe4 of _0x3da8cb){console[_0x259bdd(0x185)](formatJourneyItem(_0x57cfe4,'',_0x33c1a2(_0x57cfe4['id'])));}const _0x276873=[..._0x2be052['entries']()][_0x259bdd(0x234)]((_0x35835a,_0x20d4a8)=>{const _0x33c386=_0x259bdd,_0x5e9f73=_0x59ae34[_0x33c386(0x213)](_0x35835a[0x0])||_0x35835a[0x0],_0xf77f77=_0x59ae34['get'](_0x20d4a8[0x0])||_0x20d4a8[0x0];return _0x5e9f73['localeCompare'](_0xf77f77,undefined,{'sensitivity':_0x33c386(0x25f)});});for(const [_0x2186ff,_0x1a14db]of _0x276873){const _0x49257c=_0x59ae34[_0x259bdd(0x213)](_0x2186ff)||_0x2186ff;console['log'](_0x259bdd(0x18e)+_0x49257c),_0x1a14db[_0x259bdd(0x234)](_0x50b78b);for(const _0xbfa862 of _0x1a14db){console[_0x259bdd(0x185)](formatJourneyItem(_0xbfa862,'\x20\x20',_0x33c1a2(_0xbfa862['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1a4);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x264);async[a26_0xa84a1d(0x288)](_0x299fd3){const _0x571392=a26_0xa84a1d,{options:_0x3153ef,args:_0x299028,tdx:_0x25597e}=_0x299fd3,_0x5449e6=_0x299028[0x0];if(!_0x5449e6)return console[_0x571392(0x21f)](_0x571392(0x1ee)),console[_0x571392(0x21f)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x571392(0x21f)](_0x571392(0x193)),console['error'](_0x571392(0x201)),0x1;_0x3153ef[_0x571392(0x20f)]&&console[_0x571392(0x21f)](_0x571392(0x240)+_0x5449e6);const {journeyId:_0x1bd727,parentSegmentId:_0x172fc6}=await resolveJourneyIdFromInput(_0x5449e6,_0x3153ef,_0x25597e);if(_0x3153ef[_0x571392(0x205)]){const _0x4ded38=getConsoleNextUrl(_0x3153ef[_0x571392(0x236)],_0x571392(0x21a)+_0x172fc6+'/e/'+_0x1bd727+'/j/da/je');return console[_0x571392(0x21f)](a26_0xce81a1[_0x571392(0x1e4)]('✔')+_0x571392(0x1b0)+a26_0xce81a1[_0x571392(0x223)](_0x4ded38)),openBrowser(_0x4ded38),0x0;}const _0x4c7bb1=await withSpinner(_0x571392(0x20a),()=>_0x25597e['journey'][_0x571392(0x1eb)](_0x1bd727),{'verbose':_0x3153ef[_0x571392(0x20f)]}),_0x1b2da4=_0x4c7bb1[_0x571392(0x226)],_0x5ed23d=_0x3153ef[_0x571392(0x244)];let _0x5c4040;if(_0x5ed23d)try{const _0x1f7580=await withSpinner(_0x571392(0x273),()=>_0x25597e[_0x571392(0x1d1)][_0x571392(0x18d)](_0x1bd727),{'verbose':_0x3153ef[_0x571392(0x20f)]});_0x5c4040=_0x1f7580[_0x571392(0x226)];}catch{_0x3153ef[_0x571392(0x20f)]&&console[_0x571392(0x21f)](_0x571392(0x238));}const _0x20f306=getConsoleNextUrl(_0x3153ef['site'],'/app/ps/'+_0x172fc6+'/e/'+_0x1bd727+_0x571392(0x1c7)),_0x50debb={'id':_0x1b2da4['id'],'name':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x1f9)],'description':_0x1b2da4['attributes'][_0x571392(0x1cc)],'state':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x22f)],'paused':_0x1b2da4['attributes'][_0x571392(0x1c0)],'reentry_mode':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x228)],'stages':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x227)]?.[_0x571392(0x1a7)]||0x0,..._0x1b2da4[_0x571392(0x1b8)][_0x571392(0x26c)]&&{'goal':_0x1b2da4['attributes'][_0x571392(0x26c)][_0x571392(0x1f9)]},..._0x5c4040&&{'statistics':{'size':_0x5c4040[_0x571392(0x1fa)],'entered':_0x5c4040[_0x571392(0x1f2)],'goal_achieved':_0x5c4040[_0x571392(0x225)],'completion_rate':_0x5c4040[_0x571392(0x198)],'exit_or_jump':_0x5c4040['exitOrJumpSize'],'exit_or_jump_rate':_0x5c4040['exitOrJumpRate'],'stages':_0x5c4040['stages']}},'url':_0x20f306};return await handleSingleObjectOutput(_0x50debb,_0x3153ef),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x243);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x22c);async['execute'](_0x212411){const _0x172f9b=a26_0xa84a1d,{options:_0x40ead7,args:_0x5acfe1,tdx:_0x2bedc3}=_0x212411,_0x2eb440=_0x5acfe1[0x0];if(!requireNameOrPath(_0x2eb440))return 0x1;_0x40ead7['verbose']&&console[_0x172f9b(0x21f)]('Input:\x20'+_0x2eb440);const _0x43828e=_0x40ead7,_0x3f690c=_0x43828e[_0x172f9b(0x282)],_0x3b0d51=_0x43828e['to'],_0x584634=_0x43828e[_0x172f9b(0x1e5)],_0x4b38ad=_0x43828e['stage'];_0x584634&&!_0x3f690c&&!_0x3b0d51&&console['error']('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x2438c3=_0x584634?withJsonFormat(_0x40ead7):_0x40ead7,{journeyId:_0x282dc1,journeyName:_0x3d4050}=await resolveJourneyIdFromInput(_0x2eb440,_0x2438c3,_0x2bedc3),_0x2e8281=_0x3f690c||_0x3b0d51?{'from':_0x3f690c,'to':_0x3b0d51}:undefined,_0xc66f3=await withSpinner(_0x172f9b(0x273),()=>Promise[_0x172f9b(0x28c)]([_0x2bedc3['journey'][_0x172f9b(0x1eb)](_0x282dc1),_0x2bedc3[_0x172f9b(0x1d1)][_0x172f9b(0x18d)](_0x282dc1,_0x2e8281)]),{'verbose':_0x2438c3[_0x172f9b(0x20f)]}),[_0x20f7cd,_0x54341e]=_0xc66f3[_0x172f9b(0x226)];if(!_0x54341e||_0x54341e[_0x172f9b(0x1fb)]===null)return console[_0x172f9b(0x21f)](_0x172f9b(0x1a0)+_0x3d4050),console['error'](_0x172f9b(0x268)),0x0;const _0x51feab=buildStageNameMap(_0x20f7cd),_0x2d8761=!!(_0x2e8281&&_0x54341e['history']?.[_0x172f9b(0x1a7)]),_0x584a4a={'stageNameMap':_0x51feab,'hasPeriod':_0x2d8761,'includeHistory':!!_0x584634};if(_0x4b38ad&&_0x54341e['stages']){const _0x522094=_0x54341e[_0x172f9b(0x1e9)][_0x172f9b(0x286)](_0x18edf3=>{const _0x4ff8b1=_0x172f9b,_0xa6a3c5=_0x51feab[_0x4ff8b1(0x213)](_0x18edf3['id'])??'';return _0xa6a3c5[_0x4ff8b1(0x1ce)]()===_0x4b38ad['toLowerCase']();});if(_0x522094)return await handleSingleObjectOutput(formatStageStats(_0x522094,_0x584a4a),_0x2438c3),0x0;const _0x4eb3e9=_0x54341e['stages'][_0x172f9b(0x211)](_0x1ca316=>_0x51feab[_0x172f9b(0x213)](_0x1ca316['id'])??_0x1ca316['id']);return console[_0x172f9b(0x21f)](_0x172f9b(0x24a)+_0x4b38ad+_0x172f9b(0x279)),console[_0x172f9b(0x21f)](_0x172f9b(0x1a1)+_0x4eb3e9[_0x172f9b(0x25e)](',\x20')),0x1;}const _0x42deb6=_0x54341e['stages']?.[_0x172f9b(0x211)](_0x4e0342=>formatStageStats(_0x4e0342,_0x584a4a)),_0x32fda3=assembleJourneyStats(_0x54341e,{'from':_0x3f690c,'to':_0x3b0d51,'includeHistory':_0x584634});return await this[_0x172f9b(0x1dc)](_0x32fda3,_0x42deb6??[],_0x2438c3),0x0;}async['renderStats'](_0x4b2939,_0x5327af,_0x5c13ec){const _0x2d6d29=a26_0xa84a1d,_0x4c3b8e=_0x5c13ec[_0x2d6d29(0x249)]===_0x2d6d29(0x257)||_0x5c13ec[_0x2d6d29(0x249)]==='jsonl'||_0x5c13ec[_0x2d6d29(0x257)]||_0x5c13ec[_0x2d6d29(0x24c)];if(_0x4c3b8e){_0x4b2939['stages']=_0x5327af,await handleSingleObjectOutput(_0x4b2939,_0x5c13ec);return;}await handleSingleObjectOutput(_0x4b2939,_0x5c13ec);for(const _0x2180a1 of _0x5327af){console[_0x2d6d29(0x185)](''),console['log'](String(a26_0xce81a1[_0x2d6d29(0x223)][_0x2d6d29(0x210)]('['+_0x2180a1[_0x2d6d29(0x1f9)]+']'))+a26_0xce81a1[_0x2d6d29(0x1c8)]('\x20'+_0x2180a1['id']));const {id:_0x2a1961,name:_0x24d97a,..._0x38d69a}=_0x2180a1;await handleSingleObjectOutput(_0x38d69a,_0x5c13ec);}}}function a26_0x2e36(){const _0x464567=['\x20journeys','folders','segment','Fetching\x20journeys\x20and\x20folders...','\x20Opening\x20','cwd','version','getColumnMapping','\x20\x20Parent\x20segment:\x20','\x20version','add','Error:\x20Journey\x20\x27','attributes','Target\x20directory:\x20','Resolving\x20journey...','\x20files?','folderPath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parent_segment','/e/','paused','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','hasPeriod','journeyName','2641009YcsCQx','tsv','109062gZBhVj','/j/da/je','dim','\x20\x20-\x20','Error:\x20','listVersions','description','\x20(ID:\x20','toLowerCase','✔\x20Journey\x20\x22','8NJPzlC','journey','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Aborted.','journey:version:create','✔\x20Found\x20','rule','\x20=\x20','journey:traffic','archived','push','Table:\x20','renderStats','yes','setPhase','connection','journey:activations','relative','journey:columns','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','green','includeHistory','Getting\x20version\x20','limit','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','stages','Folder\x20path:\x20','getJourney','\x0aError:','history','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','test','✔\x20Context\x20set:\x20','draft','enteredSize','journey:versions','Error:\x20Version\x20','\x20activation','8HFuxkI','\x20details...','\x5c$&','name','size','journeyId','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','isNew','\x22\x20paused','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','1261220OZmXrf','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Found\x20','journey:resume','Resuming\x20journey...','web','Listing\x20journeys...','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20changed\x20files','List\x20journeys\x20in\x20current\x20context','Getting\x20journey\x20details...','View\x20a\x20specific\x20version\x20of\x20a\x20journey','(completed)','-\x20no\x20files\x20written','Getting\x20journey\x20traffic\x20data...','verbose','bold','map','619975oLkmPu','get','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','.yml','journeyBundleName','pause','replace','resolveJourneyId','/app/ps/','Write\x20','Getting\x20column\x20mapping...','repeat','\x22\x20resumed','error','parentSegment','\x20not\x20found.\x20Available:\x20','Fetching\x20users\x20and\x20connections...','cyan','journeyBundleId','goalSize','data','journeyStages','reentryMode','getParentFull','Cancelled','absolutePath','Show\x20journey\x20statistics','\x20(rule\x20match)','getSegment','state','listActivationsFlat','104568vQcDJR','utf-8','INVALID_ARGUMENT','sort','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','site','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20\x20Statistics\x20not\x20available','Pause\x20a\x20running\x20journey','user','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','rootFolderId','Listing\x20journey\x20activations...','stringify','Parent\x20segment:\x20','Input:\x20','(root)','getActivation','journey:stats','includeStats','resume','...','filter','Warning:\x20Could\x20not\x20resolve\x20activation\x20','format','Error:\x20Stage\x20\x22','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','jsonl','resolveParentId','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','List\x20activations\x20for\x20a\x20journey','segments','conversion','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','journey:pause','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','values','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','json','listJourneysWithFolders','file','milestoneSize','completeMilestoneRate','listJourneysFromParentSegment','\x20->\x20','join','base','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','relativePath','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','has','Show\x20journey\x20details','links','Error:\x20Invalid\x20version\x20number:\x20','session','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','blue','Error:\x20Parent\x20segment\x20context\x20required','Resolving\x20parent\x20segment...','goal','localeCompare','(paused)','journey:list','Pattern:\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','audienceId','Getting\x20journey\x20statistics...','✔\x20Pulled\x20','\x20\x20Journey\x20ID:\x20','\x20\x20Name:\x20','Resume\x20a\x20paused\x20journey','tdx.json','\x22\x20not\x20found','message','\x0aChanges\x20to\x20\x27','2872431bnBnKe','helpText','connector_config','segmentName','\x20\x20Folder\x20path:\x20','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','from','Fetching\x20','launched','resourceName','find','buildIdToEmailMap','execute','then','updatedAt','folderId','all','split','Database:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','root\x20folder','versionNumber','log','yellow','activationParams','segmentPushCommand','columns','diff','Error:\x20Invalid\x20--type\x20\x22','dryRun','getStatistics','📁\x20','exitOrJumpSize','type','Journey\x20name:\x20','\x0aPull\x20summary:','Options:','No\x20journeys\x20found','args','set','Error:\x20Journey\x20not\x20found:\x20','completionRate','hasChanges','options','Listing\x20journey\x20versions...','activation','createdAt','Error:\x20--version\x20option\x20is\x20required','Show\x20journey\x20table\x20column\x20mapping','No\x20statistics\x20available\x20for\x20journey:\x20','Available\x20stages:\x20','Fetching\x20parent\x20segment...','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)','journey:view','filePath','3907674nWBUbL','length','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','red'];a26_0x2e36=function(){return _0x464567;};return a26_0x2e36();}export class JourneyTrafficCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1d8);['description']=a26_0xa84a1d(0x252);async[a26_0xa84a1d(0x288)](_0x9d4bfe){const _0x21f811=a26_0xa84a1d,{options:_0x329a97,args:_0x45266e,tdx:_0x1123e9}=_0x9d4bfe,_0x5375ec=_0x45266e[0x0];if(!requireNameOrPath(_0x5375ec))return 0x1;_0x329a97[_0x21f811(0x20f)]&&console['error'](_0x21f811(0x240)+_0x5375ec);const _0x2559ec=_0x329a97,_0x3fa8e8=_0x2559ec['type'],_0x3b575d=_0x2559ec['from'],_0x5879c5=_0x2559ec['to'],_0x3e0877=_0x2559ec[_0x21f811(0x1e7)];if(_0x3fa8e8&&_0x3fa8e8!==_0x21f811(0x251)&&_0x3fa8e8!==_0x21f811(0x19c))return console[_0x21f811(0x21f)](_0x21f811(0x18b)+_0x3fa8e8+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x5bb337=withJsonFormat(_0x329a97),{journeyId:_0x48fad7,journeyName:_0x5009ac}=await resolveJourneyIdFromInput(_0x5375ec,_0x5bb337,_0x1123e9),_0x440f1c={'type':_0x3fa8e8,'from':_0x3b575d,'to':_0x5879c5,'limit':_0x3e0877},_0x154edc=await withSpinner(_0x21f811(0x20e),()=>_0x1123e9[_0x21f811(0x1d1)]['getTrafficData'](_0x48fad7,_0x440f1c),{'verbose':_0x5bb337[_0x21f811(0x20f)]}),_0x502360=_0x154edc[_0x21f811(0x226)],_0x1a5cb7=_0x502360['conversion']&&(_0x502360[_0x21f811(0x251)]['nodes'][_0x21f811(0x1a7)]>0x0||_0x502360[_0x21f811(0x251)][_0x21f811(0x265)][_0x21f811(0x1a7)]>0x0),_0x62c92f=_0x502360[_0x21f811(0x19c)]&&_0x502360[_0x21f811(0x19c)]['length']>0x0;if(!_0x1a5cb7&&!_0x62c92f)return console['error'](_0x21f811(0x281)+_0x5009ac),console[_0x21f811(0x21f)](_0x21f811(0x214)),_0x3b575d&&_0x5879c5&&console[_0x21f811(0x21f)](_0x21f811(0x1e3)),0x0;return await handleSingleObjectOutput(_0x502360,_0x5bb337),0x0;}}function formatStageStats(_0x17ea29,_0x10d21b){const _0x3c4120=a26_0xa84a1d,_0xd85232=_0x10d21b[_0x3c4120(0x1c2)]&&_0x17ea29[_0x3c4120(0x1ed)]?.[_0x3c4120(0x1a7)]?aggregateStageHistory(_0x17ea29[_0x3c4120(0x1ed)]):{'size':_0x17ea29['size'],'entered':_0x17ea29[_0x3c4120(0x1f2)],'milestone':_0x17ea29[_0x3c4120(0x25a)],'milestone_rate':_0x17ea29[_0x3c4120(0x25b)],'exit_or_jump':_0x17ea29[_0x3c4120(0x18f)],'exit_or_jump_rate':_0x17ea29['exitOrJumpRate']},_0x5687bb={'id':_0x17ea29['id'],'name':_0x10d21b['stageNameMap'][_0x3c4120(0x213)](_0x17ea29['id'])??_0x17ea29['id'],..._0xd85232};return _0x10d21b[_0x3c4120(0x1c2)]&&_0x10d21b[_0x3c4120(0x1e5)]&&_0x17ea29[_0x3c4120(0x1ed)]&&(_0x5687bb[_0x3c4120(0x1ed)]=_0x17ea29['history']),_0x5687bb;}export class JourneyPauseCommand extends BaseCommand{['name']=a26_0xa84a1d(0x253);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x239);async[a26_0xa84a1d(0x288)](_0x308415){const _0x5346e0=a26_0xa84a1d,{options:_0x2b99b5,args:_0x3c5f27,tdx:_0x37f3d1}=_0x308415,_0x581ad2=_0x3c5f27[0x0];if(!requireNameOrPath(_0x581ad2))return 0x1;_0x2b99b5[_0x5346e0(0x20f)]&&console[_0x5346e0(0x21f)]('Input:\x20'+_0x581ad2);const {journeyId:_0x3bca2c,journeyName:_0x6e03af}=await resolveJourneyIdFromInput(_0x581ad2,_0x2b99b5,_0x37f3d1);if(!_0x2b99b5[_0x5346e0(0x1dd)]){const _0x5269f7=await confirm(_0x5346e0(0x262)+_0x6e03af+'\x22?');if(!_0x5269f7)return console[_0x5346e0(0x21f)]('Cancelled'),0x0;}const _0x485422=await withSpinner('Pausing\x20journey...',()=>_0x37f3d1[_0x5346e0(0x1d1)][_0x5346e0(0x217)](_0x3bca2c),{'verbose':_0x2b99b5[_0x5346e0(0x20f)]}),_0x2e3bc9=_0x485422[_0x5346e0(0x226)];return console[_0x5346e0(0x21f)](_0x5346e0(0x1cf)+_0x2e3bc9['attributes'][_0x5346e0(0x1f9)]+_0x5346e0(0x1fe)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x203);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x277);async[a26_0xa84a1d(0x288)](_0x36c288){const _0x1cea92=a26_0xa84a1d,{options:_0x2af1b2,args:_0x109afe,tdx:_0x13836e}=_0x36c288,_0x1bc176=_0x109afe[0x0];if(!requireNameOrPath(_0x1bc176))return 0x1;_0x2af1b2[_0x1cea92(0x20f)]&&console[_0x1cea92(0x21f)](_0x1cea92(0x240)+_0x1bc176);const {journeyId:_0x122b06,journeyName:_0x3cc7c4}=await resolveJourneyIdFromInput(_0x1bc176,_0x2af1b2,_0x13836e);if(!_0x2af1b2[_0x1cea92(0x1dd)]){const _0x427fcc=await confirm(_0x1cea92(0x256)+_0x3cc7c4+'\x22?');if(!_0x427fcc)return console[_0x1cea92(0x21f)](_0x1cea92(0x22a)),0x0;}const _0x4cb2f9=await withSpinner(_0x1cea92(0x204),()=>_0x13836e[_0x1cea92(0x1d1)][_0x1cea92(0x245)](_0x122b06),{'verbose':_0x2af1b2[_0x1cea92(0x20f)]}),_0x4b7505=_0x4cb2f9[_0x1cea92(0x226)];return console[_0x1cea92(0x21f)](_0x1cea92(0x1cf)+_0x4b7505[_0x1cea92(0x1b8)][_0x1cea92(0x1f9)]+_0x1cea92(0x21e)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]='journey:pull';[a26_0xa84a1d(0x1cc)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a26_0xa84a1d(0x288)](_0x22003b){const _0x1e0f31=a26_0xa84a1d,{options:_0x140f4f,args:_0xb6634f,tdx:_0x47c9f1}=_0x22003b,_0x4ed7d7=_0x140f4f,_0x481cdc=_0xb6634f[0x0],_0x379e57=_0x481cdc&&isYamlFilePath(_0x481cdc),_0x386221=await resolveTarget({'arg':_0x379e57?_0x481cdc:undefined,'contextParent':_0x140f4f[_0x1e0f31(0x220)],'cwd':process[_0x1e0f31(0x1b1)]()});if(!isSuccessfulResolution(_0x386221))return _0x386221['errorCode']==='no_parent'?(console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x186)](_0x1e0f31(0x182))),console['error'](_0x1e0f31(0x1a3)),console[_0x1e0f31(0x21f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x1e0f31(0x21f)](_0x1e0f31(0x254)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1ab)](_0x1e0f31(0x1ca)+_0x386221[_0x1e0f31(0x27a)]+'\x0a')),_0x386221[_0x1e0f31(0x27d)]&&console['error'](a26_0xce81a1[_0x1e0f31(0x223)](_0x386221[_0x1e0f31(0x27d)]))),0x1;let _0x8250b0=_0x379e57?undefined:_0x481cdc,_0x94f9b6,_0x50d355;_0x386221[_0x1e0f31(0x190)]===_0x1e0f31(0x259)&&(_0x8250b0=_0x386221[_0x1e0f31(0x285)],_0x94f9b6=_0x386221[_0x1e0f31(0x1a5)],_0x50d355=_0x386221[_0x1e0f31(0x1bc)]);const _0x51d5b5=_0x386221['parentName'],_0x569b60=_0x386221['targetDir'];_0x4ed7d7[_0x1e0f31(0x20f)]&&(console[_0x1e0f31(0x21f)](_0x1e0f31(0x23f)+_0x51d5b5),console[_0x1e0f31(0x21f)](_0x1e0f31(0x1b9)+_0x569b60),_0x8250b0&&console[_0x1e0f31(0x21f)](_0x1e0f31(0x191)+_0x8250b0),_0x94f9b6&&console[_0x1e0f31(0x21f)]('Target\x20file:\x20'+_0x94f9b6),_0x50d355&&console[_0x1e0f31(0x21f)](_0x1e0f31(0x1ea)+_0x50d355));const _0x6debbd=await withSpinner(_0x1e0f31(0x26b),()=>_0x47c9f1[_0x1e0f31(0x1ae)][_0x1e0f31(0x24d)](_0x51d5b5),{'verbose':_0x140f4f[_0x1e0f31(0x20f)]}),_0x5ad056=_0x6debbd[_0x1e0f31(0x226)],{journeys:_0x53eb1d,folders:_0x48702b}=await withSpinner(_0x1e0f31(0x1af),async()=>{const _0x57cf8b=_0x1e0f31,[_0x455aa0,_0x354ecf]=await Promise[_0x57cf8b(0x28c)]([_0x47c9f1[_0x57cf8b(0x1d1)][_0x57cf8b(0x25c)](_0x5ad056,undefined,{'includeAllVersions':!![]}),_0x47c9f1[_0x57cf8b(0x1ae)]['listFolders'](_0x5ad056)]);return{'journeys':_0x455aa0,'folders':_0x354ecf};},{'verbose':_0x140f4f[_0x1e0f31(0x20f)]})[_0x1e0f31(0x289)](_0x53bed9=>_0x53bed9['data']);let _0x2ab84e=_0x53eb1d;const _0x3ff81b=buildFolderIdToPathMap(_0x48702b);if(_0x8250b0){const _0x40c911=_0x2ab84e[_0x1e0f31(0x247)](_0xc829c6=>_0xc829c6[_0x1e0f31(0x216)][_0x1e0f31(0x1ce)]()===_0x8250b0['toLowerCase']());if(_0x40c911[_0x1e0f31(0x1a7)]===0x0)return console[_0x1e0f31(0x21f)](_0x1e0f31(0x197)+_0x8250b0),console[_0x1e0f31(0x21f)](_0x1e0f31(0x1aa)),0x1;_0x2ab84e=_0x40c911;}if(_0x50d355!==undefined){const _0x1bc809=_0x2ab84e[_0x1e0f31(0x247)](_0x256b13=>{const _0x1efe77=_0x1e0f31,_0x4c5de5=_0x256b13[_0x1efe77(0x28b)]?_0x3ff81b[_0x1efe77(0x213)](_0x256b13[_0x1efe77(0x28b)])||'':'';return _0x4c5de5===_0x50d355;});if(_0x1bc809[_0x1e0f31(0x1a7)]===0x0&&_0x2ab84e[_0x1e0f31(0x1a7)]>0x0){console[_0x1e0f31(0x21f)](_0x1e0f31(0x1b7)+_0x8250b0+'\x27\x20not\x20found\x20in\x20'+(_0x50d355||_0x1e0f31(0x183))),console['error'](_0x1e0f31(0x24e));for(const _0x2ef661 of _0x2ab84e){const _0x2f362c=_0x2ef661['folderId']?_0x3ff81b[_0x1e0f31(0x213)](_0x2ef661[_0x1e0f31(0x28b)])||'':'';console['error'](_0x1e0f31(0x1c9)+(_0x2f362c||_0x1e0f31(0x241))+'/'+_0x2ef661[_0x1e0f31(0x216)]);}return 0x1;}_0x2ab84e=_0x1bc809;}if(_0x2ab84e[_0x1e0f31(0x1a7)]===0x0)return console['error'](_0x1e0f31(0x194)),0x0;const _0x3cdabd=new Map();for(const _0x10fd5b of _0x2ab84e){const _0x467e6c=_0x10fd5b[_0x1e0f31(0x224)];!_0x3cdabd[_0x1e0f31(0x263)](_0x467e6c)&&_0x3cdabd[_0x1e0f31(0x196)](_0x467e6c,[]),_0x3cdabd[_0x1e0f31(0x213)](_0x467e6c)[_0x1e0f31(0x1da)](_0x10fd5b);}for(const _0x28b232 of _0x3cdabd[_0x1e0f31(0x255)]()){_0x28b232[_0x1e0f31(0x234)]((_0x36500b,_0x2745f6)=>(_0x36500b[_0x1e0f31(0x184)]||0x0)-(_0x2745f6[_0x1e0f31(0x184)]||0x0));}const _0x53afa4=[],{idToEmailMap:_0xa207e3,connectionIdToNameMap:_0x2d8741}=await withSpinner(_0x1e0f31(0x222),async()=>{const _0x2fe982=_0x1e0f31,[_0x4078fc,_0x322cd7]=await Promise[_0x2fe982(0x28c)]([_0x47c9f1[_0x2fe982(0x23a)][_0x2fe982(0x287)](),_0x47c9f1[_0x2fe982(0x1df)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x4078fc,'connectionIdToNameMap':_0x322cd7};},{'verbose':_0x140f4f[_0x1e0f31(0x20f)]})[_0x1e0f31(0x289)](_0x5c8758=>_0x5c8758[_0x1e0f31(0x226)]);for(const _0x5b5462 of _0x3cdabd[_0x1e0f31(0x255)]()){const _0x26970d=_0x5b5462[0x0][_0x1e0f31(0x216)],_0x1d2849=_0x5b5462[0x0][_0x1e0f31(0x28b)],_0x1b8945=_0x1d2849?_0x3ff81b[_0x1e0f31(0x213)](_0x1d2849)||'':'',_0x225373=_0x1b8945?a26_0x5a6c84['join'](_0x569b60,_0x1b8945):_0x569b60,_0x3be61a=_0x94f9b6||a26_0x5a6c84['join'](_0x225373,sanitizeFileName(_0x26970d)+_0x1e0f31(0x215));let _0x60ac15,_0x2e4ad0;if(existsSync(_0x3be61a))try{const _0x419403=readFileSync(_0x3be61a,'utf-8'),_0xb69342=parseYamlString(_0x419403);_0x2e4ad0=_0xb69342,_0x60ac15=buildRuleToNameMapping(_0xb69342),_0x4ed7d7[_0x1e0f31(0x20f)]&&_0x60ac15[_0x1e0f31(0x1fa)]>0x0&&console['error'](_0x1e0f31(0x202)+_0x60ac15[_0x1e0f31(0x1fa)]+_0x1e0f31(0x23b)+_0x26970d);}catch(_0x2e9093){_0x4ed7d7['verbose']&&console['error'](_0x1e0f31(0x1ff)+_0x2e9093[_0x1e0f31(0x27a)]);}const _0x939e55=[],_0x31dfa5=new Set(),_0x3053ff=new Map(),_0x4d7aea=new Map(),_0x511135=new Set(),_0x42d7bf=new Map(),_0x29abc2=new Map(),_0x1f2b93=createJumpTargetCache();await withProgressSpinner(_0x1e0f31(0x283)+_0x26970d+_0x1e0f31(0x246),async _0x3961c0=>{const _0x194e9e=_0x1e0f31;for(const _0x59ac60 of _0x5b5462){const _0x512388=_0x5b5462[_0x194e9e(0x1a7)]>0x1?_0x59ac60['journeyBundleName']+'\x20v'+(_0x59ac60[_0x194e9e(0x184)]||0x1):_0x59ac60[_0x194e9e(0x216)];_0x3961c0[_0x194e9e(0x1de)](_0x194e9e(0x283)+_0x512388);const _0x34f540=await _0x47c9f1[_0x194e9e(0x1d1)]['getJourney'](_0x59ac60['id']),_0x3871e4=_0x34f540['attributes']?.[_0x194e9e(0x272)],_0x1ffd5e={'resolveSegment':async _0x2a4a21=>{const _0x372faf=_0x194e9e;if(!_0x3871e4)return{'name':_0x2a4a21,'isJourneyLocal':![]};const _0xe2f3d0=_0x3053ff[_0x372faf(0x213)](_0x2a4a21);if(_0xe2f3d0)return _0xe2f3d0;try{const _0x57f14d=await _0x47c9f1[_0x372faf(0x1ae)][_0x372faf(0x22e)](_0x3871e4,_0x2a4a21),_0x9613a7=_0x57f14d['kind']===SEGMENT_KIND_JOURNEY;let _0x12f870,_0x2196a4=_0x57f14d['name'];if(_0x9613a7&&_0x57f14d['rule']){const _0x5c551c=await segmentResponseToDef(_0x57f14d,{'resolveSegmentName':async _0x3b788b=>{const _0x375e59=_0x372faf,_0x5bbfa0=_0x3053ff[_0x375e59(0x213)](_0x3b788b);if(_0x5bbfa0)return _0x5bbfa0[_0x375e59(0x1f9)];const _0x3f090b=await _0x1ffd5e['resolveSegment'](_0x3b788b);return _0x3f090b[_0x375e59(0x1f9)];}}),_0x495088=_0x5c551c[_0x372faf(0x1d6)];_0x12f870={'description':_0x57f14d[_0x372faf(0x1cc)],'rule':_0x495088};const _0x1bdad3=serializeRule(_0x495088),_0x2ae5a7=_0x4d7aea[_0x372faf(0x213)](_0x1bdad3);if(_0x2ae5a7)_0x2196a4=_0x2ae5a7,_0x12f870=undefined,_0x4ed7d7[_0x372faf(0x20f)]&&console['error'](_0x372faf(0x1d2)+_0x57f14d[_0x372faf(0x1f9)]+_0x372faf(0x25d)+_0x2ae5a7);else{let _0xadb2c5=![];if(_0x60ac15){const _0x1dff54=_0x60ac15[_0x372faf(0x213)](_0x1bdad3);if(_0x1dff54){const _0x5cd164=_0x1dff54['find'](_0x404387=>!_0x31dfa5[_0x372faf(0x263)](_0x404387));_0x5cd164&&(_0x2196a4=_0x5cd164,_0x31dfa5[_0x372faf(0x1b6)](_0x5cd164),_0x4d7aea[_0x372faf(0x196)](_0x1bdad3,_0x5cd164),_0xadb2c5=!![],_0x4ed7d7[_0x372faf(0x20f)]&&console[_0x372faf(0x21f)](_0x372faf(0x1a8)+_0x5cd164+_0x372faf(0x22d)));}}if(!_0xadb2c5){const _0x15f8c0=generateJourneyLocalName(_0x57f14d['name']);_0x15f8c0&&(_0x2196a4=_0x15f8c0);let _0x5116f9=_0x2196a4,_0x483536=0x2;while(_0x31dfa5[_0x372faf(0x263)](_0x5116f9)){_0x5116f9=_0x2196a4+'_'+_0x483536,_0x483536++;}_0x31dfa5[_0x372faf(0x1b6)](_0x5116f9),_0x4d7aea[_0x372faf(0x196)](_0x1bdad3,_0x5116f9),_0x2196a4=_0x5116f9;}}}const _0x5a51f1={'name':_0x2196a4,'isJourneyLocal':_0x9613a7,'definition':_0x12f870};return _0x3053ff['set'](_0x2a4a21,_0x5a51f1),_0x5a51f1;}catch(_0x53f879){return _0x140f4f[_0x372faf(0x20f)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x2a4a21+':\x20'+_0x53f879[_0x372faf(0x27a)]),{'name':_0x2a4a21,'isJourneyLocal':![]};}},'resolveActivation':async _0x2ff2ce=>{const _0x41c951=_0x194e9e,_0x155b43=_0x42d7bf[_0x41c951(0x213)](_0x2ff2ce);if(_0x155b43)return _0x155b43;try{const _0x135ff7=await _0x47c9f1[_0x41c951(0x1d1)][_0x41c951(0x242)](_0x59ac60['id'],_0x2ff2ce),_0x259412=journeyActivationStepToYaml(_0x135ff7,_0xa207e3,_0x2d8741),_0x51cd54=JSON[_0x41c951(0x23e)]({'name':_0x259412[_0x41c951(0x1f9)],'connection':_0x259412[_0x41c951(0x1df)],'connector_config':_0x259412[_0x41c951(0x27e)]}),_0x416f2f=_0x29abc2[_0x41c951(0x213)](_0x51cd54);if(_0x416f2f){const _0x47c1c2={'name':_0x416f2f,'isJourneyLocal':!![],'definition':_0x259412};return _0x42d7bf['set'](_0x2ff2ce,_0x47c1c2),_0x47c1c2;}const _0x26bcca=_0x135ff7['attributes'][_0x41c951(0x187)]['name']||_0x2ff2ce,_0xe9e66e=sanitizeYamlKey(_0x26bcca)||'activation_'+_0x2ff2ce;let _0x3721e5=_0xe9e66e,_0x224e15=0x2;while(_0x511135[_0x41c951(0x263)](_0x3721e5)){_0x3721e5=_0xe9e66e+'_'+_0x224e15,_0x224e15++;}_0x511135['add'](_0x3721e5),_0x29abc2[_0x41c951(0x196)](_0x51cd54,_0x3721e5);const _0xc88533={'name':_0x3721e5,'isJourneyLocal':!![],'definition':_0x259412};return _0x42d7bf[_0x41c951(0x196)](_0x2ff2ce,_0xc88533),_0xc88533;}catch(_0xf3769f){return _0x140f4f['verbose']&&console['error'](_0x41c951(0x248)+_0x2ff2ce+':\x20'+_0xf3769f['message']),{'name':_0x2ff2ce,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0xb073a2,_0x2aa10b)=>{const _0x2959eb=_0x194e9e;return resolveJumpTarget(_0xb073a2,_0x2aa10b,_0x1f2b93,_0x3e01bf=>_0x47c9f1['journey'][_0x2959eb(0x1eb)](_0x3e01bf));}},_0x394a01=await journeyResponseToDef(_0x34f540,_0x1ffd5e);_0x939e55['push']({'item':_0x59ac60,'yaml':_0x394a01});}},{'verbose':_0x140f4f[_0x1e0f31(0x20f)]});const _0x327eec=await _0x47c9f1[_0x1e0f31(0x1d1)]['getLatestJourneyId'](_0x5b5462[0x0]['journeyBundleId']),_0x40de19=buildMergedJourneyDef(_0x939e55,_0x60ac15,_0x327eec),_0x47ba40=normalizeJourneyDef(_0x40de19,_0x2e4ad0),_0x2741b2=toYamlString(_0x47ba40),_0x2cc86b=_0x94f9b6||a26_0x5a6c84[_0x1e0f31(0x25e)](_0x225373,sanitizeFileName(_0x26970d)+_0x1e0f31(0x215));!_0x94f9b6&&_0x1b8945&&!existsSync(_0x225373)&&mkdirSync(_0x225373,{'recursive':!![]});const _0x497d5b=a26_0x5a6c84[_0x1e0f31(0x1e1)](process['cwd'](),_0x2cc86b);if(existsSync(_0x2cc86b)){const _0x51910e=readFileSync(_0x2cc86b,_0x1e0f31(0x232)),_0x2e4581=generateDiff(_0x51910e,_0x2741b2),_0x106768=hasChanges(_0x2e4581);_0x53afa4[_0x1e0f31(0x1da)]({'relativePath':_0x497d5b,'absolutePath':_0x2cc86b,'content':_0x2741b2,'isNew':![],'hasChanges':_0x106768,'diff':_0x106768?formatDiffWithColors(_0x2e4581):undefined});}else _0x53afa4[_0x1e0f31(0x1da)]({'relativePath':_0x497d5b,'absolutePath':_0x2cc86b,'content':_0x2741b2,'isNew':!![],'hasChanges':![]});}const _0x1444c8=_0x53afa4['filter'](_0x1f4a1e=>_0x1f4a1e[_0x1e0f31(0x1fd)]),_0x22cb34=_0x53afa4[_0x1e0f31(0x247)](_0x5d84f1=>!_0x5d84f1[_0x1e0f31(0x1fd)]&&_0x5d84f1['hasChanges']),_0x8a5e6a=_0x53afa4['filter'](_0x58c337=>!_0x58c337['isNew']&&!_0x58c337[_0x1e0f31(0x199)]),_0x3f4672=_0x2ab84e[_0x1e0f31(0x1a7)],_0x5997d8=_0x3cdabd[_0x1e0f31(0x1fa)],_0xe1856f=_0x3f4672>_0x5997d8?'\x20('+_0x3f4672+'\x20versions)':'';console[_0x1e0f31(0x21f)](_0x1e0f31(0x192)),console[_0x1e0f31(0x21f)]('\x20\x20'+a26_0xce81a1[_0x1e0f31(0x223)](_0x5997d8+_0x1e0f31(0x1ac))+a26_0xce81a1[_0x1e0f31(0x1c8)](_0xe1856f)),console[_0x1e0f31(0x21f)]('\x20\x20'+a26_0xce81a1['green']('+\x20'+_0x1444c8[_0x1e0f31(0x1a7)]+'\x20new\x20files')),console['error']('\x20\x20'+a26_0xce81a1[_0x1e0f31(0x186)]('~\x20'+_0x22cb34[_0x1e0f31(0x1a7)]+_0x1e0f31(0x208))),console[_0x1e0f31(0x21f)]('\x20\x20'+a26_0xce81a1[_0x1e0f31(0x1c8)]('=\x20'+_0x8a5e6a[_0x1e0f31(0x1a7)]+'\x20unchanged\x20files')),console['error']('\x20\x20Target:\x20'+a26_0xce81a1['cyan'](_0x569b60)+'\x0a');if(_0x22cb34['length']>0x0)for(const _0x4cb9d6 of _0x22cb34){console[_0x1e0f31(0x21f)](_0x1e0f31(0x27b)+_0x4cb9d6[_0x1e0f31(0x261)]+'\x27:'),console[_0x1e0f31(0x21f)]('─'[_0x1e0f31(0x21d)](0x3c)),console[_0x1e0f31(0x21f)](_0x4cb9d6[_0x1e0f31(0x18a)]),console[_0x1e0f31(0x21f)]('─'[_0x1e0f31(0x21d)](0x3c));}if(_0x4ed7d7[_0x1e0f31(0x18c)])return console[_0x1e0f31(0x21f)](a26_0xce81a1['yellow'](_0x1e0f31(0x1a9))),0x0;if(_0x1444c8[_0x1e0f31(0x1a7)]===0x0&&_0x22cb34[_0x1e0f31(0x1a7)]===0x0)return console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1e4)](_0x1e0f31(0x207))),saveSessionContext({'parent_segment':_0x51d5b5},_0x4ed7d7[_0x1e0f31(0x267)]),console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1e4)]('✔\x20Context\x20set:\x20'+a26_0xce81a1['dim'](_0x1e0f31(0x1be))+_0x1e0f31(0x1d7)+a26_0xce81a1[_0x1e0f31(0x223)](_0x51d5b5))),0x0;if(!_0x4ed7d7[_0x1e0f31(0x1dd)]&&(_0x1444c8[_0x1e0f31(0x1a7)]>0x0||_0x22cb34[_0x1e0f31(0x1a7)]>0x0)){if(!isInteractive())return console['error'](a26_0xce81a1[_0x1e0f31(0x1ab)](_0x1e0f31(0x1ec)),_0x1e0f31(0x1bd)),console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1c8)](_0x1e0f31(0x1c1))),0x1;const _0x2a7d3f=await confirmKey(_0x1e0f31(0x21b)+(_0x1444c8[_0x1e0f31(0x1a7)]+_0x22cb34[_0x1e0f31(0x1a7)])+_0x1e0f31(0x1bb));if(!_0x2a7d3f)return console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x186)](_0x1e0f31(0x1d3)),_0x1e0f31(0x20d)),0x1;}!existsSync(_0x569b60)&&mkdirSync(_0x569b60,{'recursive':!![]});const _0xc75b0f=a26_0x5a6c84[_0x1e0f31(0x25e)](_0x569b60,_0x1e0f31(0x278));writeFileSync(_0xc75b0f,createTdxConfigContent(_0x51d5b5),_0x1e0f31(0x232));for(const _0x5dea54 of _0x53afa4){(_0x5dea54['isNew']||_0x5dea54['hasChanges'])&&writeFileSync(_0x5dea54[_0x1e0f31(0x22b)],_0x5dea54['content'],_0x1e0f31(0x232));}return console['error'](a26_0xce81a1[_0x1e0f31(0x1e4)](_0x1e0f31(0x274)+(_0x1444c8[_0x1e0f31(0x1a7)]+_0x22cb34[_0x1e0f31(0x1a7)])+'\x20journey\x20files\x20to\x20'+_0x569b60)),saveSessionContext({'parent_segment':_0x51d5b5},_0x4ed7d7[_0x1e0f31(0x267)]),console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1e4)](_0x1e0f31(0x1f0)+a26_0xce81a1[_0x1e0f31(0x1c8)]('parent_segment')+_0x1e0f31(0x1d7)+a26_0xce81a1[_0x1e0f31(0x223)](_0x51d5b5))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1e2);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x19f);async[a26_0xa84a1d(0x288)](_0x389a91){const _0x3cc3ee=a26_0xa84a1d,{options:_0x5bc9ba,args:_0x25a67f,tdx:_0x30041a}=_0x389a91,_0x50d452=_0x25a67f[0x0];if(!requireNameOrPath(_0x50d452))return 0x1;_0x5bc9ba[_0x3cc3ee(0x20f)]&&console[_0x3cc3ee(0x21f)](_0x3cc3ee(0x240)+_0x50d452);const {journeyId:_0x2fefb2}=await resolveJourneyIdFromInput(_0x50d452,_0x5bc9ba,_0x30041a),_0x387048=await withSpinner(_0x3cc3ee(0x21c),()=>_0x30041a[_0x3cc3ee(0x1d1)][_0x3cc3ee(0x1b3)](_0x2fefb2),{'verbose':_0x5bc9ba[_0x3cc3ee(0x20f)]}),_0x4ad2b0=_0x387048[_0x3cc3ee(0x226)];return console[_0x3cc3ee(0x185)](_0x3cc3ee(0x181)+_0x4ad2b0['database']),console[_0x3cc3ee(0x185)](_0x3cc3ee(0x1db)+_0x4ad2b0['table']),await handleSDKOutput(_0x4ad2b0[_0x3cc3ee(0x189)],_0x5bc9ba),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a26_0xa84a1d(0x1e0);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x24f);async[a26_0xa84a1d(0x288)](_0x344693){const _0x476a73=a26_0xa84a1d,{options:_0x19509e,args:_0x40d920,tdx:_0xfb7daa}=_0x344693,_0x2db718=_0x40d920[0x0];if(!requireNameOrPath(_0x2db718))return 0x1;_0x19509e[_0x476a73(0x20f)]&&console[_0x476a73(0x21f)](_0x476a73(0x240)+_0x2db718);const {journeyId:_0x340159}=await resolveJourneyIdFromInput(_0x2db718,_0x19509e,_0xfb7daa),_0x4b767e=await withSpinner(_0x476a73(0x23d),()=>_0xfb7daa[_0x476a73(0x1d1)][_0x476a73(0x230)](_0x340159),{'verbose':_0x19509e[_0x476a73(0x20f)]}),_0x528dea=_0x4b767e[_0x476a73(0x226)];return console[_0x476a73(0x21f)](_0x476a73(0x202)+_0x528dea[_0x476a73(0x1a7)]+_0x476a73(0x1f5)+(_0x528dea[_0x476a73(0x1a7)]!==0x1?'s':'')),await handleSDKOutput(_0x528dea,_0x19509e),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]='journey:push';[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x260);[a26_0xa84a1d(0x188)]=new SegmentPushCommand();async['execute'](_0x1e9b72){const _0x15dea3=a26_0xa84a1d,_0x133703=_0x1e9b72[_0x15dea3(0x195)][0x0];let _0x22d9ac;if(_0x133703){const _0xe1d75e=await resolveTarget({'arg':_0x133703,'contextParent':_0x1e9b72[_0x15dea3(0x19a)]['parentSegment'],'cwd':process[_0x15dea3(0x1b1)]()});isSuccessfulResolution(_0xe1d75e)&&_0xe1d75e[_0x15dea3(0x190)]===_0x15dea3(0x259)&&(_0x22d9ac=_0xe1d75e[_0x15dea3(0x1a5)]);}const _0x3e685a={..._0x1e9b72,'options':{..._0x1e9b72[_0x15dea3(0x19a)],'journeysOnly':!![],..._0x22d9ac&&{'singleFilePath':_0x22d9ac}}};return this[_0x15dea3(0x188)][_0x15dea3(0x288)](_0x3e685a);}}export class JourneyVersionsCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1f3);[a26_0xa84a1d(0x1cc)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a26_0xa84a1d(0x288)](_0x288063){const _0x161ffc=a26_0xa84a1d,{options:_0x4a57e2,args:_0x152c4f,tdx:_0x218811}=_0x288063,_0x611e9=_0x152c4f[0x0];if(!requireNameOrPath(_0x611e9))return 0x1;if(_0x4a57e2[_0x161ffc(0x20f)])console['error'](_0x161ffc(0x240)+_0x611e9);const {journeyId:_0x55986e}=await resolveJourneyIdFromInput(_0x611e9,_0x4a57e2,_0x218811),_0x2f9763=await withSpinner(_0x161ffc(0x19b),()=>_0x218811['journey'][_0x161ffc(0x1cb)](_0x55986e),{'verbose':_0x4a57e2[_0x161ffc(0x20f)]}),{bundleName:_0x5553b2,versions:_0x2f6d73,latestJourneyId:_0x399fc7}=_0x2f9763['data'];console['error'](_0x5553b2+':\x20'+_0x2f6d73[_0x161ffc(0x1a7)]+_0x161ffc(0x1b5)+(_0x2f6d73[_0x161ffc(0x1a7)]!==0x1?'s':''));const _0x1e9911=_0x2f6d73[_0x161ffc(0x211)](_0x7e993b=>({'version':_0x7e993b[_0x161ffc(0x184)],'journey_id':_0x7e993b[_0x161ffc(0x1fb)],'name':_0x7e993b[_0x161ffc(0x1f9)],'state':_0x7e993b[_0x161ffc(0x22f)],'paused':_0x7e993b[_0x161ffc(0x1c0)],'latest':_0x7e993b['journeyId']===_0x399fc7,'created_at':_0x7e993b[_0x161ffc(0x19d)]}));return await handleSDKOutput(_0x1e9911,_0x4a57e2),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a26_0xa84a1d(0x1d4);[a26_0xa84a1d(0x1cc)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a26_0xa84a1d(0x288)](_0x4430a1){const _0x41d2f8=a26_0xa84a1d,{options:_0x2b5c62,args:_0x48d844,tdx:_0x3e04f9}=_0x4430a1,_0x86c59e=_0x48d844[0x0];if(!requireNameOrPath(_0x86c59e))return 0x1;if(_0x2b5c62['verbose'])console[_0x41d2f8(0x21f)]('Input:\x20'+_0x86c59e);const {journeyId:_0x5e5aba,journeyName:_0x41477c}=await resolveJourneyIdFromInput(_0x86c59e,_0x2b5c62,_0x3e04f9);if(!_0x2b5c62[_0x41d2f8(0x1dd)]){const _0x1b688f=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x41477c+'\x22?');if(!_0x1b688f)return console[_0x41d2f8(0x21f)](_0x41d2f8(0x22a)),0x0;}const _0x124f12=await withSpinner('Creating\x20new\x20version...',()=>_0x3e04f9[_0x41d2f8(0x1d1)]['createVersion'](_0x5e5aba),{'verbose':_0x2b5c62[_0x41d2f8(0x20f)]}),_0xc17b96=_0x124f12['data'];return console[_0x41d2f8(0x21f)](a26_0xce81a1[_0x41d2f8(0x1e4)]('✔')+'\x20Created\x20v'+_0xc17b96[_0x41d2f8(0x1b8)]['versionNumber']+'\x20(draft)\x20—\x20\x22'+_0xc17b96['attributes'][_0x41d2f8(0x1f9)]+'\x22'),console[_0x41d2f8(0x21f)](_0x41d2f8(0x275)+_0xc17b96['id']),await handleSingleObjectOutput({'id':_0xc17b96['id'],'name':_0xc17b96['attributes'][_0x41d2f8(0x1f9)],'version':_0xc17b96['attributes'][_0x41d2f8(0x184)],'state':_0xc17b96[_0x41d2f8(0x1b8)][_0x41d2f8(0x22f)],'bundle_id':_0xc17b96['attributes']['journeyBundleId'],'created_at':_0xc17b96[_0x41d2f8(0x1b8)][_0x41d2f8(0x19d)]},_0x2b5c62),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]='journey:version:view';['description']=a26_0xa84a1d(0x20b);async[a26_0xa84a1d(0x288)](_0x5b7afd){const _0x4a8f51=a26_0xa84a1d,{options:_0x324c27,args:_0x2d15b5,tdx:_0x3f3ee3}=_0x5b7afd,_0x3fe651=_0x2d15b5[0x0];if(!requireNameOrPath(_0x3fe651))return 0x1;const _0x51c844=_0x324c27[_0x4a8f51(0x1b2)];if(!_0x51c844)return console[_0x4a8f51(0x21f)](_0x4a8f51(0x19e)),console[_0x4a8f51(0x21f)](_0x4a8f51(0x235)),0x1;const _0x84892c=parseInt(_0x51c844,0xa);if(isNaN(_0x84892c)||_0x84892c<0x1)return console['error'](_0x4a8f51(0x266)+_0x51c844),0x1;if(_0x324c27[_0x4a8f51(0x20f)])console[_0x4a8f51(0x21f)](_0x4a8f51(0x240)+_0x3fe651+',\x20version:\x20'+_0x84892c);const {journeyId:_0x43fef7,parentSegmentId:_0x74aed5}=await resolveJourneyIdFromInput(_0x3fe651,_0x324c27,_0x3f3ee3),_0x19b448=await withSpinner('Resolving\x20version...',()=>_0x3f3ee3['journey']['listVersions'](_0x43fef7),{'verbose':_0x324c27['verbose']}),{versions:_0x26ccfe,latestJourneyId:_0x288501}=_0x19b448['data'],_0x339eda=_0x26ccfe[_0x4a8f51(0x286)](_0x58cf42=>_0x58cf42[_0x4a8f51(0x184)]===_0x84892c);if(!_0x339eda){const _0x359001=_0x26ccfe[_0x4a8f51(0x211)](_0x29ee52=>'v'+_0x29ee52[_0x4a8f51(0x184)])['join'](',\x20');return console[_0x4a8f51(0x21f)](_0x4a8f51(0x1f4)+_0x84892c+_0x4a8f51(0x221)+_0x359001),0x1;}const _0x3110e2=await withSpinner(_0x4a8f51(0x1e6)+_0x84892c+_0x4a8f51(0x1f7),()=>_0x3f3ee3[_0x4a8f51(0x1d1)][_0x4a8f51(0x1eb)](_0x339eda[_0x4a8f51(0x1fb)]),{'verbose':_0x324c27[_0x4a8f51(0x20f)]}),_0x4090af=_0x3110e2[_0x4a8f51(0x226)],_0x21a06f=getConsoleNextUrl(_0x324c27[_0x4a8f51(0x236)],_0x4a8f51(0x21a)+_0x74aed5+_0x4a8f51(0x1bf)+_0x339eda['journeyId']+_0x4a8f51(0x1c7));return await handleSingleObjectOutput({'id':_0x4090af['id'],'name':_0x4090af['attributes'][_0x4a8f51(0x1f9)],'version':_0x4090af['attributes']['versionNumber'],'description':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x1cc)],'state':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x22f)],'paused':_0x4090af['attributes'][_0x4a8f51(0x1c0)],'reentry_mode':_0x4090af[_0x4a8f51(0x1b8)]['reentryMode'],'stages':_0x4090af[_0x4a8f51(0x1b8)]['journeyStages']?.[_0x4a8f51(0x1a7)]||0x0,..._0x4090af[_0x4a8f51(0x1b8)]['goal']&&{'goal':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x26c)][_0x4a8f51(0x1f9)]},'latest':_0x339eda[_0x4a8f51(0x1fb)]===_0x288501,'created_at':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x19d)],'updated_at':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x28a)],'url':_0x21a06f},_0x324c27),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0xdb7100=a27_0x3cc2;(function(_0x2e6204,_0x1b3a0d){const _0x58dba8=a27_0x3cc2,_0x3e20d4=_0x2e6204();while(!![]){try{const _0x285c2a=-parseInt(_0x58dba8(0xdd))/0x1+parseInt(_0x58dba8(0xc0))/0x2+-parseInt(_0x58dba8(0xc7))/0x3*(-parseInt(_0x58dba8(0xb9))/0x4)+parseInt(_0x58dba8(0xe5))/0x5*(-parseInt(_0x58dba8(0xcb))/0x6)+parseInt(_0x58dba8(0xd1))/0x7*(-parseInt(_0x58dba8(0xe3))/0x8)+parseInt(_0x58dba8(0xe2))/0x9+parseInt(_0x58dba8(0xb1))/0xa*(-parseInt(_0x58dba8(0xe4))/0xb);if(_0x285c2a===_0x1b3a0d)break;else _0x3e20d4['push'](_0x3e20d4['shift']());}catch(_0x41cb7c){_0x3e20d4['push'](_0x3e20d4['shift']());}}}(a27_0x419f,0x5751c));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';function a27_0x3cc2(_0x42d2e7,_0x281ddc){_0x42d2e7=_0x42d2e7-0xb1;const _0x419fb4=a27_0x419f();let _0x3cc2b0=_0x419fb4[_0x42d2e7];return _0x3cc2b0;}import a27_0x14d748 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a27_0x419f(){const _0x44aafc=['yellow','cwd','24XgiPfD','Validation\x20failed:\x20','\x20journey(s)\x20valid','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','Error:\x20','log','13370AJztDW','\x20journey(s)\x20with\x20errors,\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','reason','message','Validate\x20journey\x20YAML\x20files','green','dim','type','validCount','description','\x20warning(s)','89581UKwYII','error','Error:\x20Directory\x20not\x20found:\x20','No\x20journey\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)\x20found','2113893FQkTDX','80tFgAyy','55YAEble','58385UlgYMM','\x20error(s)','file','892270tdqjor','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20segment\x20file(s)\x20skipped','warningCount','filePath','\x20(skipped:\x20','red','30460Omushg','no_parent','endsWith','invalidCount','execute','verbose','valid','1372464Uewsrc','journey:validate','relativePath','skippedCount','warnings','length','errors','15mTdCqe','targetDir'];a27_0x419f=function(){return _0x44aafc;};return a27_0x419f();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a27_0xdb7100(0xb2)]=a27_0xdb7100(0xc1);[a27_0xdb7100(0xdb)]=a27_0xdb7100(0xd6);async[a27_0xdb7100(0xbd)](_0x4c5613){const _0x2bff1f=a27_0xdb7100,{options:_0x10b153,args:_0x21fb20}=_0x4c5613,_0x317440=_0x10b153,_0x157dc4=await resolveTarget({'arg':_0x21fb20[0x0],'contextParent':_0x10b153['parentSegment'],'cwd':process[_0x2bff1f(0xca)]()});if(!isSuccessfulResolution(_0x157dc4))return _0x157dc4['errorCode']===_0x2bff1f(0xba)?(console['error'](a27_0x14d748[_0x2bff1f(0xc9)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x2bff1f(0xce)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x2bff1f(0xde)](_0x2bff1f(0xb3))):(console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xb8)](_0x2bff1f(0xcf)+_0x157dc4[_0x2bff1f(0xd5)]+'\x0a')),_0x157dc4['helpText']&&console[_0x2bff1f(0xde)](a27_0x14d748['cyan'](_0x157dc4['helpText']))),0x1;const _0x170e69=_0x157dc4[_0x2bff1f(0xc8)],_0x694d6e=_0x157dc4[_0x2bff1f(0xd9)]===_0x2bff1f(0xe7)?_0x157dc4[_0x2bff1f(0xb6)]:undefined;if(!_0x694d6e&&!existsSync(_0x170e69))return console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xb8)](_0x2bff1f(0xdf)+_0x170e69+'\x0a')),0x1;let _0x5a5765;if(_0x694d6e){if(!_0x694d6e[_0x2bff1f(0xbb)]('.yml')&&!_0x694d6e[_0x2bff1f(0xbb)]('.yaml'))return console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xb8)](_0x2bff1f(0xd3)+_0x694d6e+'\x0a')),0x1;_0x5a5765=[_0x694d6e];}else _0x5a5765=findYamlFiles(_0x170e69);if(_0x5a5765[_0x2bff1f(0xc5)]===0x0)return console[_0x2bff1f(0xde)](a27_0x14d748['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x170e69+'\x0a')),0x1;const _0x541aa4=validateYamlFiles(_0x5a5765,_0x170e69,{'filterType':'journey'}),_0xd0fe6d=calculateSummary(_0x541aa4),_0x3131e6=_0x541aa4['filter'](isValidationResult);if(_0x3131e6[_0x2bff1f(0xc5)]===0x0)return console['error'](a27_0x14d748['yellow'](_0x2bff1f(0xe0)+_0x170e69+'\x0a')),_0xd0fe6d[_0x2bff1f(0xc3)]>0x0&&console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xd8)]('('+_0xd0fe6d[_0x2bff1f(0xc3)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x287aa5 of _0x541aa4){if(!isValidationResult(_0x287aa5)){_0x317440[_0x2bff1f(0xbe)]&&console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xd8)]('-\x20'+_0x287aa5[_0x2bff1f(0xc2)]+_0x2bff1f(0xb7)+_0x287aa5[_0x2bff1f(0xd4)]+')'));continue;}const {relativePath:_0x2316b8,source:_0x247b8d,result:_0x11233a}=_0x287aa5;if(_0x11233a[_0x2bff1f(0xbf)]&&_0x11233a[_0x2bff1f(0xc4)][_0x2bff1f(0xc5)]===0x0)_0x317440[_0x2bff1f(0xbe)]&&console[_0x2bff1f(0xd0)](a27_0x14d748['green']('✔\x20'+_0x2316b8));else _0x11233a['valid']?(console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xc9)]('⚠\x20'+_0x2316b8+':\x20'+_0x11233a['warnings']['length']+_0x2bff1f(0xdc))),console[_0x2bff1f(0xd0)](formatValidationResult(_0x11233a,_0x247b8d,_0x2316b8))):(console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xb8)]('✖\x20'+_0x2316b8+':\x20'+_0x11233a[_0x2bff1f(0xc6)]['length']+_0x2bff1f(0xe6))),console[_0x2bff1f(0xd0)](formatValidationResult(_0x11233a,_0x247b8d,_0x2316b8)));}return console[_0x2bff1f(0xd0)](''),_0xd0fe6d['hasErrors']?(console[_0x2bff1f(0xd0)](a27_0x14d748['red'](_0x2bff1f(0xcc)+_0xd0fe6d[_0x2bff1f(0xbc)]+_0x2bff1f(0xd2)+_0xd0fe6d['validCount']+'\x20valid')),_0xd0fe6d[_0x2bff1f(0xb5)]>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748['yellow'](_0xd0fe6d['warningCount']+_0x2bff1f(0xe1))),_0xd0fe6d[_0x2bff1f(0xc3)]>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748['dim'](_0xd0fe6d[_0x2bff1f(0xc3)]+_0x2bff1f(0xb4))),0x1):(console['log'](a27_0x14d748[_0x2bff1f(0xd7)]('✔\x20All\x20'+_0xd0fe6d[_0x2bff1f(0xda)]+_0x2bff1f(0xcd))),_0xd0fe6d[_0x2bff1f(0xb5)]>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xc9)](_0xd0fe6d[_0x2bff1f(0xb5)]+'\x20warning(s)\x20found')),_0xd0fe6d['skippedCount']>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xd8)](_0xd0fe6d[_0x2bff1f(0xc3)]+_0x2bff1f(0xb4))),0x0);}}
|