@treasuredata/tdx 2026.3.35 → 2026.3.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- function a41_0x1a1a(){const _0x219945=['files','segment','isNew','165OUidfJ','Parent\x20segment:\x20','8NbfdJj','2010OfEicO','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','repeat','no_parent','\x0aPull\x20summary\x20for\x20\x27','\x20with\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','8078TZRNGh','filter','helpText','\x20=\x20','relativePath','journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20files?','276624rqNMIX','hasChanges','\x20unchanged\x20files','\x0aError:','session','targetDir','447170hYcZiL','length','dim','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20new\x20files','utf-8','\x20changed\x20files','Aborted.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segments','Site:\x20','1212735vanmEx','errorCode','cwd','-\x20no\x20files\x20written','content','\x27...','parentSegment','Target\x20resource:\x20','\x20versions)','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20activations','cyan','counts','red','journeyVersions','site','parent_segment','resourceName','yes','\x20segments','green','execute','error','4218250GugPHE','Pulling\x20segments\x20from\x20\x27','\x20\x20🎯\x20','8tafIpY','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','absolutePath','✔\x20All\x20files\x20are\x20up\x20to\x20date','parentName','694540LbUnAU','name','700536FWmVqF','segment:pull','yellow','type','verbose','✔\x20Context\x20set:\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','file','message'];a41_0x1a1a=function(){return _0x219945;};return a41_0x1a1a();}const a41_0x467f75=a41_0x511e;(function(_0x42c912,_0x5a8fc2){const _0x4e1361=a41_0x511e,_0x5bbe32=_0x42c912();while(!![]){try{const _0x3825aa=parseInt(_0x4e1361(0x1c1))/0x1+-parseInt(_0x4e1361(0x1c3))/0x2+parseInt(_0x4e1361(0x1f2))/0x3*(parseInt(_0x4e1361(0x1d1))/0x4)+-parseInt(_0x4e1361(0x1b9))/0x5+parseInt(_0x4e1361(0x1d2))/0x6*(-parseInt(_0x4e1361(0x1d9))/0x7)+-parseInt(_0x4e1361(0x1bc))/0x8*(parseInt(_0x4e1361(0x1e1))/0x9)+parseInt(_0x4e1361(0x1e7))/0xa*(parseInt(_0x4e1361(0x1cf))/0xb);if(_0x3825aa===_0x5a8fc2)break;else _0x5bbe32['push'](_0x5bbe32['shift']());}catch(_0x523ee5){_0x5bbe32['push'](_0x5bbe32['shift']());}}}(a41_0x1a1a,0x8956d));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a41_0x511e(_0x121a65,_0x4abd38){_0x121a65=_0x121a65-0x1a4;const _0x1a1ac2=a41_0x1a1a();let _0x511ee3=_0x1a1ac2[_0x121a65];return _0x511ee3;}import a41_0x56f11f from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a41_0xbdde81 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a41_0x467f75(0x1c2)]=a41_0x467f75(0x1c4);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a41_0x467f75(0x1b7)](_0x301465){const _0x55a109=a41_0x467f75,{options:_0x511526,args:_0x592fec,tdx:_0x454cf6}=_0x301465,_0xa37194=_0x511526,_0x16d34a=await resolveTarget({'arg':_0x592fec[0x0],'contextParent':_0x511526[_0x55a109(0x1a8)],'cwd':process[_0x55a109(0x1a4)]()});if(!isSuccessfulResolution(_0x16d34a))return _0x16d34a[_0x55a109(0x1f3)]===_0x55a109(0x1d5)?(console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1c5)](_0x55a109(0x1d8))),console[_0x55a109(0x1b8)](_0x55a109(0x1c9)),console[_0x55a109(0x1b8)](_0x55a109(0x1df)),console[_0x55a109(0x1b8)](_0x55a109(0x1ef))):(console['error'](a41_0x56f11f[_0x55a109(0x1af)]('Error:\x20'+_0x16d34a[_0x55a109(0x1cb)]+'\x0a')),_0x16d34a[_0x55a109(0x1db)]&&console['error'](a41_0x56f11f[_0x55a109(0x1ad)](_0x16d34a[_0x55a109(0x1db)]))),0x1;const _0x5cf737=_0x16d34a['parentName'],_0x539fc9=_0x16d34a['targetDir'],_0x33abff=_0x16d34a[_0x55a109(0x1c6)]===_0x55a109(0x1ca)?_0x16d34a[_0x55a109(0x1b3)]:undefined;_0xa37194[_0x55a109(0x1c7)]&&(console[_0x55a109(0x1b8)](_0x55a109(0x1f1)+_0xa37194[_0x55a109(0x1b1)]),console[_0x55a109(0x1b8)](_0x55a109(0x1d0)+_0x5cf737),_0x33abff&&console[_0x55a109(0x1b8)](_0x55a109(0x1a9)+_0x33abff));const _0x64ace9=await withProgressSpinner(_0x55a109(0x1ba)+_0x5cf737+_0x55a109(0x1a7),_0x23a155=>_0x454cf6[_0x55a109(0x1cd)]['pullSegments'](_0x5cf737,{'targetDir':_0x539fc9,'targetResourceName':_0x33abff,'verbose':_0xa37194[_0x55a109(0x1c7)],'progress':{'update':_0x3c4024=>{const _0x2fcc55=_0x55a109;_0x23a155['setPhase'](_0x3c4024),_0xa37194[_0x2fcc55(0x1c7)]&&console[_0x2fcc55(0x1b8)]('\x20\x20'+_0x3c4024);}}}),{'verbose':_0xa37194[_0x55a109(0x1c7)]}),_0x1dd0d9=_0x64ace9['data'];if(_0x1dd0d9['counts']['segments']===0x0&&_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1de)]===0x0)return console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1c5)](_0x55a109(0x1ab)+_0x1dd0d9[_0x55a109(0x1c0)]+'\x27')),0x0;const _0x1fefc9=_0x1dd0d9[_0x55a109(0x1cc)][_0x55a109(0x1da)](_0xe59ee6=>_0xe59ee6[_0x55a109(0x1ce)]),_0x87589e=_0x1dd0d9['files'][_0x55a109(0x1da)](_0x302959=>!_0x302959[_0x55a109(0x1ce)]&&_0x302959['hasChanges']),_0xb06c3=_0x1dd0d9[_0x55a109(0x1cc)][_0x55a109(0x1da)](_0x260dd0=>!_0x260dd0['isNew']&&!_0x260dd0[_0x55a109(0x1e2)]);console[_0x55a109(0x1b8)](_0x55a109(0x1d6)+_0x1dd0d9[_0x55a109(0x1c0)]+'\x27:'),console[_0x55a109(0x1b8)](_0x55a109(0x1bb)+a41_0x56f11f[_0x55a109(0x1ad)](_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1f0)]+_0x55a109(0x1b5))+_0x55a109(0x1d7)+a41_0x56f11f[_0x55a109(0x1ad)](_0x1dd0d9['counts']['activations']+_0x55a109(0x1ac)));if(_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1de)]>0x0){const _0x1382ac=_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1b0)]>_0x1dd0d9[_0x55a109(0x1ae)]['journeys']?'\x20('+_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1b0)]+_0x55a109(0x1aa):'';console['error']('\x20\x20🗺️\x20\x20'+a41_0x56f11f[_0x55a109(0x1ad)](_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1de)]+'\x20journeys')+a41_0x56f11f[_0x55a109(0x1e9)](_0x1382ac));}console['error']('\x20\x20'+a41_0x56f11f[_0x55a109(0x1b6)]('+\x20'+_0x1fefc9['length']+_0x55a109(0x1eb))),console[_0x55a109(0x1b8)]('\x20\x20'+a41_0x56f11f[_0x55a109(0x1c5)]('~\x20'+_0x87589e[_0x55a109(0x1e8)]+_0x55a109(0x1ed))),console[_0x55a109(0x1b8)]('\x20\x20'+a41_0x56f11f[_0x55a109(0x1e9)]('=\x20'+_0xb06c3['length']+_0x55a109(0x1e3))),console[_0x55a109(0x1b8)]('\x20\x20Target:\x20'+a41_0x56f11f[_0x55a109(0x1ad)](_0x1dd0d9[_0x55a109(0x1e6)])+'\x0a');if(_0x87589e[_0x55a109(0x1e8)]>0x0)for(const _0x31e7cc of _0x87589e){console[_0x55a109(0x1b8)]('\x0aChanges\x20to\x20\x27'+_0x31e7cc[_0x55a109(0x1dd)]+'\x27:'),console[_0x55a109(0x1b8)]('─'[_0x55a109(0x1d4)](0x3c)),console['error'](_0x31e7cc['diff']),console[_0x55a109(0x1b8)]('─'[_0x55a109(0x1d4)](0x3c));}if(_0xa37194['dryRun'])return console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1c5)](_0x55a109(0x1d3))),0x0;if(_0x1fefc9[_0x55a109(0x1e8)]===0x0&&_0x87589e[_0x55a109(0x1e8)]===0x0)return console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1b6)](_0x55a109(0x1bf))),saveSessionContext({'parent_segment':_0x1dd0d9[_0x55a109(0x1c0)]},_0xa37194[_0x55a109(0x1e5)]),console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1b6)]('✔\x20Context\x20set:\x20'+a41_0x56f11f[_0x55a109(0x1e9)](_0x55a109(0x1b2))+_0x55a109(0x1dc)+a41_0x56f11f['cyan'](_0x1dd0d9['parentName']))),0x0;if(!_0xa37194[_0x55a109(0x1b4)]){if(!isInteractive())return console['error'](a41_0x56f11f[_0x55a109(0x1af)](_0x55a109(0x1e4)),_0x55a109(0x1bd)),console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1e9)](_0x55a109(0x1ea))),0x1;const _0xdae1b3=await confirmKey('Write\x20'+(_0x1fefc9[_0x55a109(0x1e8)]+_0x87589e['length'])+_0x55a109(0x1e0));if(!_0xdae1b3)return console[_0x55a109(0x1b8)](a41_0x56f11f['yellow'](_0x55a109(0x1ee)),_0x55a109(0x1a5)),0x1;}for(const _0xf238ea of _0x1dd0d9[_0x55a109(0x1cc)]){if(_0xf238ea[_0x55a109(0x1ce)]||_0xf238ea[_0x55a109(0x1e2)]){const _0x34551f=a41_0xbdde81['dirname'](_0xf238ea[_0x55a109(0x1be)]);!existsSync(_0x34551f)&&mkdirSync(_0x34551f,{'recursive':!![]}),writeFileSync(_0xf238ea[_0x55a109(0x1be)],_0xf238ea[_0x55a109(0x1a6)],_0x55a109(0x1ec));}}return console['error'](a41_0x56f11f[_0x55a109(0x1b6)]('✔\x20Pulled\x20'+(_0x1fefc9['length']+_0x87589e[_0x55a109(0x1e8)])+'\x20files\x20to\x20'+_0x1dd0d9['targetDir'])),saveSessionContext({'parent_segment':_0x1dd0d9[_0x55a109(0x1c0)]},_0xa37194[_0x55a109(0x1e5)]),console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1b6)](_0x55a109(0x1c8)+a41_0x56f11f[_0x55a109(0x1e9)](_0x55a109(0x1b2))+_0x55a109(0x1dc)+a41_0x56f11f[_0x55a109(0x1ad)](_0x1dd0d9[_0x55a109(0x1c0)]))),0x0;}}
1
+ const a41_0x11dbd3=a41_0x3169;(function(_0x1a001a,_0x46f533){const _0x21a19a=a41_0x3169,_0x36a104=_0x1a001a();while(!![]){try{const _0x41d9b0=parseInt(_0x21a19a(0x1ac))/0x1+-parseInt(_0x21a19a(0x194))/0x2*(parseInt(_0x21a19a(0x189))/0x3)+parseInt(_0x21a19a(0x1a7))/0x4*(parseInt(_0x21a19a(0x1c2))/0x5)+parseInt(_0x21a19a(0x186))/0x6*(-parseInt(_0x21a19a(0x183))/0x7)+-parseInt(_0x21a19a(0x19f))/0x8*(parseInt(_0x21a19a(0x1b6))/0x9)+parseInt(_0x21a19a(0x1c6))/0xa*(-parseInt(_0x21a19a(0x19d))/0xb)+parseInt(_0x21a19a(0x196))/0xc;if(_0x41d9b0===_0x46f533)break;else _0x36a104['push'](_0x36a104['shift']());}catch(_0x3d0c83){_0x36a104['push'](_0x36a104['shift']());}}}(a41_0x55cf,0xdf41a));import{BaseCommand}from'./command.js';function a41_0x3169(_0x120e95,_0xb91e21){_0x120e95=_0x120e95-0x17b;const _0x55cf73=a41_0x55cf();let _0x316931=_0x55cf73[_0x120e95];return _0x316931;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a41_0x249172 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a41_0x55fa10 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a41_0x11dbd3(0x1b2);[a41_0x11dbd3(0x181)]=a41_0x11dbd3(0x1cc);async['execute'](_0x393483){const _0x29b536=a41_0x11dbd3,{options:_0x16a5ed,args:_0x37de44,tdx:_0x1eec06}=_0x393483,_0x49e0d6=_0x16a5ed,_0x2e8bf9=await resolveTarget({'arg':_0x37de44[0x0],'contextParent':_0x16a5ed[_0x29b536(0x198)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2e8bf9))return _0x2e8bf9[_0x29b536(0x1a2)]===_0x29b536(0x1c5)?(console[_0x29b536(0x1c3)](a41_0x249172[_0x29b536(0x1ba)](_0x29b536(0x184))),console['error'](_0x29b536(0x1a4)),console[_0x29b536(0x1c3)](_0x29b536(0x1bc)),console[_0x29b536(0x1c3)](_0x29b536(0x1bf))):(console[_0x29b536(0x1c3)](a41_0x249172[_0x29b536(0x188)](_0x29b536(0x1a3)+_0x2e8bf9[_0x29b536(0x195)]+'\x0a')),_0x2e8bf9['helpText']&&console[_0x29b536(0x1c3)](a41_0x249172[_0x29b536(0x1cb)](_0x2e8bf9[_0x29b536(0x1c8)]))),0x1;const _0x2a09b1=_0x2e8bf9['parentName'],_0x31c3b5=_0x2e8bf9[_0x29b536(0x197)],_0x1fbcd3=_0x2e8bf9['type']===_0x29b536(0x1bb)?_0x2e8bf9[_0x29b536(0x1b7)]:undefined;_0x49e0d6[_0x29b536(0x1c4)]&&(console[_0x29b536(0x1c3)](_0x29b536(0x1b9)+_0x49e0d6[_0x29b536(0x1c9)]),console[_0x29b536(0x1c3)](_0x29b536(0x182)+_0x2a09b1),_0x1fbcd3&&console['error'](_0x29b536(0x199)+_0x1fbcd3));const _0x4d757d=await withProgressSpinner(_0x29b536(0x17b)+_0x2a09b1+_0x29b536(0x1b0),_0x1bec21=>_0x1eec06[_0x29b536(0x18d)][_0x29b536(0x18e)](_0x2a09b1,{'targetDir':_0x31c3b5,'targetResourceName':_0x1fbcd3,'verbose':_0x49e0d6[_0x29b536(0x1c4)],'progress':{'update':_0xadc28=>{const _0x297fe8=_0x29b536;_0x1bec21[_0x297fe8(0x1ad)](_0xadc28),_0x49e0d6[_0x297fe8(0x1c4)]&&console[_0x297fe8(0x1c3)]('\x20\x20'+_0xadc28);}}}),{'verbose':_0x49e0d6[_0x29b536(0x1c4)]}),_0x380d34=_0x4d757d[_0x29b536(0x1b8)];if(_0x380d34[_0x29b536(0x1b1)]['segments']===0x0&&_0x380d34['counts'][_0x29b536(0x17c)]===0x0)return console['error'](a41_0x249172['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x380d34[_0x29b536(0x19b)]+'\x27')),0x0;const _0x223508=_0x380d34['files'][_0x29b536(0x1a6)](_0x3884db=>_0x3884db['isNew']),_0x15a110=_0x380d34['files'][_0x29b536(0x1a6)](_0x20fe1c=>!_0x20fe1c[_0x29b536(0x1a8)]&&_0x20fe1c[_0x29b536(0x1ca)]),_0x4bf62a=_0x380d34[_0x29b536(0x1a5)][_0x29b536(0x1a6)](_0x2f834a=>!_0x2f834a[_0x29b536(0x1a8)]&&!_0x2f834a[_0x29b536(0x1ca)]);console[_0x29b536(0x1c3)](_0x29b536(0x18a)+_0x380d34[_0x29b536(0x19b)]+'\x27:'),console[_0x29b536(0x1c3)](_0x29b536(0x192)+a41_0x249172[_0x29b536(0x1cb)](_0x380d34[_0x29b536(0x1b1)][_0x29b536(0x17e)]+_0x29b536(0x1ab))+_0x29b536(0x1b3)+a41_0x249172[_0x29b536(0x1cb)](_0x380d34[_0x29b536(0x1b1)][_0x29b536(0x19e)]+'\x20activations'));if(_0x380d34[_0x29b536(0x1b1)][_0x29b536(0x17c)]>0x0){const _0x32360a=_0x380d34[_0x29b536(0x1b1)][_0x29b536(0x17d)]>_0x380d34['counts'][_0x29b536(0x17c)]?'\x20('+_0x380d34[_0x29b536(0x1b1)][_0x29b536(0x17d)]+_0x29b536(0x1a9):'';console[_0x29b536(0x1c3)](_0x29b536(0x1be)+a41_0x249172['cyan'](_0x380d34['counts']['journeys']+_0x29b536(0x19c))+a41_0x249172['dim'](_0x32360a));}console[_0x29b536(0x1c3)]('\x20\x20'+a41_0x249172[_0x29b536(0x19a)]('+\x20'+_0x223508[_0x29b536(0x187)]+_0x29b536(0x1c0))),console['error']('\x20\x20'+a41_0x249172['yellow']('~\x20'+_0x15a110['length']+'\x20changed\x20files')),console['error']('\x20\x20'+a41_0x249172['dim']('=\x20'+_0x4bf62a[_0x29b536(0x187)]+_0x29b536(0x18f))),console['error'](_0x29b536(0x180)+a41_0x249172[_0x29b536(0x1cb)](_0x380d34['targetDir'])+'\x0a');if(_0x15a110[_0x29b536(0x187)]>0x0)for(const _0x323542 of _0x15a110){console['error']('\x0aChanges\x20to\x20\x27'+_0x323542[_0x29b536(0x1a1)]+'\x27:'),console[_0x29b536(0x1c3)]('─'[_0x29b536(0x185)](0x3c)),console[_0x29b536(0x1c3)](_0x323542[_0x29b536(0x1b5)]),console['error']('─'[_0x29b536(0x185)](0x3c));}if(_0x49e0d6['dryRun'])return console[_0x29b536(0x1c3)](a41_0x249172[_0x29b536(0x1ba)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x223508[_0x29b536(0x187)]===0x0&&_0x15a110[_0x29b536(0x187)]===0x0)return console['error'](a41_0x249172[_0x29b536(0x19a)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x380d34['parentName']},_0x49e0d6[_0x29b536(0x191)]),console[_0x29b536(0x1c3)](a41_0x249172[_0x29b536(0x19a)](_0x29b536(0x1cd)+a41_0x249172[_0x29b536(0x1b4)](_0x29b536(0x17f))+_0x29b536(0x1ae)+a41_0x249172['cyan'](_0x380d34[_0x29b536(0x19b)]))),0x0;if(!_0x49e0d6['yes']){if(!isInteractive())return console[_0x29b536(0x1c3)](a41_0x249172[_0x29b536(0x188)](_0x29b536(0x1c7)),_0x29b536(0x1bd)),console[_0x29b536(0x1c3)](a41_0x249172[_0x29b536(0x1b4)](_0x29b536(0x1aa))),0x1;const _0x3596f7=await confirmKey(_0x29b536(0x193)+(_0x223508[_0x29b536(0x187)]+_0x15a110[_0x29b536(0x187)])+'\x20files?');if(!_0x3596f7)return console['error'](a41_0x249172[_0x29b536(0x1ba)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x156512 of _0x380d34['files']){if(_0x156512[_0x29b536(0x1a8)]||_0x156512[_0x29b536(0x1ca)]){const _0x5b2866=a41_0x55fa10[_0x29b536(0x1a0)](_0x156512[_0x29b536(0x1c1)]);!existsSync(_0x5b2866)&&mkdirSync(_0x5b2866,{'recursive':!![]}),writeFileSync(_0x156512['absolutePath'],_0x156512[_0x29b536(0x18b)],_0x29b536(0x1af));}}return console[_0x29b536(0x1c3)](a41_0x249172['green'](_0x29b536(0x18c)+(_0x223508[_0x29b536(0x187)]+_0x15a110['length'])+_0x29b536(0x190)+_0x380d34[_0x29b536(0x197)])),saveSessionContext({'parent_segment':_0x380d34[_0x29b536(0x19b)]},_0x49e0d6[_0x29b536(0x191)]),console[_0x29b536(0x1c3)](a41_0x249172[_0x29b536(0x19a)]('✔\x20Context\x20set:\x20'+a41_0x249172['dim'](_0x29b536(0x17f))+_0x29b536(0x1ae)+a41_0x249172[_0x29b536(0x1cb)](_0x380d34[_0x29b536(0x19b)]))),0x0;}}function a41_0x55cf(){const _0x252622=['8304934AchphP','activations','8JhsyhH','dirname','relativePath','errorCode','Error:\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','files','filter','552FaSNAn','isNew','\x20versions)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20segments','1599440Zpvjhh','setPhase','\x20=\x20','utf-8','\x27...','counts','segment:pull','\x20with\x20','dim','diff','9523044eCHkGI','resourceName','data','Site:\x20','yellow','file','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20🗺️\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20new\x20files','absolutePath','47065fkpqRs','error','verbose','no_parent','10VUTKcv','\x0aError:','helpText','site','hasChanges','cyan','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','✔\x20Context\x20set:\x20','Pulling\x20segments\x20from\x20\x27','journeys','journeyVersions','segments','parent_segment','\x20\x20Target:\x20','description','Parent\x20segment:\x20','154usEorg','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','repeat','183732tItjSG','length','red','183LYQSfV','\x0aPull\x20summary\x20for\x20\x27','content','✔\x20Pulled\x20','segment','pullSegments','\x20unchanged\x20files','\x20files\x20to\x20','session','\x20\x20🎯\x20','Write\x20','2662hJaJBO','message','7008108KfTuQR','targetDir','parentSegment','Target\x20resource:\x20','green','parentName','\x20journeys'];a41_0x55cf=function(){return _0x252622;};return a41_0x55cf();}
@@ -1 +1 @@
1
- const a42_0x4aa2d9=a42_0x25c6;(function(_0x530d06,_0x2b70cc){const _0x550b6f=a42_0x25c6,_0x43533d=_0x530d06();while(!![]){try{const _0x54f680=parseInt(_0x550b6f(0x1b1))/0x1+parseInt(_0x550b6f(0x164))/0x2*(-parseInt(_0x550b6f(0x142))/0x3)+parseInt(_0x550b6f(0x172))/0x4*(parseInt(_0x550b6f(0x1b7))/0x5)+parseInt(_0x550b6f(0x190))/0x6+parseInt(_0x550b6f(0x1be))/0x7+-parseInt(_0x550b6f(0x189))/0x8+-parseInt(_0x550b6f(0x18e))/0x9;if(_0x54f680===_0x2b70cc)break;else _0x43533d['push'](_0x43533d['shift']());}catch(_0x184429){_0x43533d['push'](_0x43533d['shift']());}}}(a42_0x5aaa,0x3f95c));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a42_0x25c6(_0x57c0eb,_0x8da767){_0x57c0eb=_0x57c0eb-0x138;const _0x5aaac7=a42_0x5aaa();let _0x25c68c=_0x5aaac7[_0x57c0eb];return _0x25c68c;}function a42_0x5aaa(){const _0x1610b9=['helpText','updated','\x20to\x20create','\x20activations]','site','connection','results','audienceId','folderPath','versionNumber','segment','folderId','journeysOnly','\x20\x20Segments:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','type','getOutputSchemaWithCache','red','Delete\x20journey:','\x20\x20Source:\x20','blue','\x20updated','Fetching\x20existing\x20data...','repeat','\x20YAML\x20files\x20found','dim','user','253446LFmvbD','Changes\x20to\x20journey:','all','\x27...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','📁\x20','Fetching\x20connections\x20for\x20name\x20resolution...','buildUserMaps','segmentFolderId','parent_name','(Journey\x20will\x20be\x20deleted)','/app/ps/','\x20\x20\x20\x20','resolveParentId','get','Preparing\x20journeys...','error','Fetching\x20existing\x20activations...','push','cwd','New\x20journey:','journeyBundleId','segment\x20or\x20journey','yellow','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','state','segments','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20\x20📊\x20Segments:','parentName','segment:push','folders','2IwbELj','listActivations','toString','dryRun','join','\x20\x20Journeys:\x20','paused','Error:\x20','\x20to\x20update','Aborted.','unchanged','activations','nameToId','journey','596AtKMjB','data','No\x20','journeyId','\x0aError:','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','isScoped','listFolders','idToName','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','delete','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','map','Site:\x20','length','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','parentFolder','createdSegmentIds','name','toCreate','\x20changed','journeyBundleName','isNew','3239480rMoVoo','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','existingJourney','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','3543912Thfnmx','list','1259478WkaEtq','toDelete','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','yes','journeys','filter','New\x20segment:','yamlConfig','no_parent','targetDir','message','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20created','setPhase','then','/e/','Push\x20','existingSegment','\x20changes?','\x0aPush\x20summary\x20for\x20\x27','getJourney','\x0aValidation\x20failed:','diff','\x0a✔\x20Push\x20complete','new','\x20\x20Activations:','\x20new','verbose','\x20unchanged','parentSegment','green','created','relationships','177026DpUwtp','description','\x20to\x20delete','Source\x20directory:\x20','attributes','/sb/da/esr','11265xmkVat','set','listSegments','filePath','Delete\x20segment:','changed','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','2946951ezIIfv','cyan'];a42_0x5aaa=function(){return _0x1610b9;};return a42_0x5aaa();}import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a42_0x24aec8 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a42_0x4aa2d9(0x184)]=a42_0x4aa2d9(0x162);['description']=a42_0x4aa2d9(0x17d);async['execute'](_0x4a997d){const _0x46b65b=a42_0x4aa2d9,{options:_0x1ab175,args:_0x417c20,tdx:_0x319695}=_0x4a997d,_0x529a9c=_0x1ab175,_0x38907a=await resolveTarget({'arg':_0x417c20[0x0],'contextParent':_0x1ab175[_0x46b65b(0x1ad)],'cwd':process[_0x46b65b(0x156)]()});if(!isSuccessfulResolution(_0x38907a))return _0x38907a['errorCode']===_0x46b65b(0x198)?(console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)](_0x46b65b(0x15e))),console[_0x46b65b(0x153)](_0x46b65b(0x18c)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x46b65b(0x153)](_0x46b65b(0x15f))):(console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x16b)+_0x38907a[_0x46b65b(0x19a)]+'\x0a')),_0x38907a[_0x46b65b(0x1c0)]&&console[_0x46b65b(0x153)](a42_0x24aec8['cyan'](_0x38907a[_0x46b65b(0x1c0)]))),0x1;if(_0x38907a[_0x46b65b(0x1cf)]===_0x46b65b(0x14c))return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)]('Error:\x20Directory\x20not\x20found:\x20'+_0x38907a[_0x46b65b(0x199)]+'\x0a')),console[_0x46b65b(0x153)](a42_0x24aec8['cyan'](_0x46b65b(0x181))),0x1;const _0x91d0cb=_0x38907a[_0x46b65b(0x161)],_0xf8eaa8=_0x38907a['targetDir'],_0xe7def0=_0x38907a[_0x46b65b(0x1cf)]==='file'?_0x38907a[_0x46b65b(0x1ba)]:undefined,_0x5ccec3=getScopedDetails(_0x38907a),_0x3e4eaf=_0x5ccec3?.[_0x46b65b(0x178)]??![],_0x496227=_0x5ccec3?.['scopedFolderPath']??'';if(!existsSync(_0xf8eaa8))return console[_0x46b65b(0x153)](a42_0x24aec8['red']('Error:\x20Directory\x20not\x20found:\x20'+_0xf8eaa8+'\x0a')),console['error'](a42_0x24aec8[_0x46b65b(0x1bf)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x529a9c[_0x46b65b(0x1ab)]&&(console['error'](_0x46b65b(0x17f)+_0x529a9c[_0x46b65b(0x1c4)]),console[_0x46b65b(0x153)]('Parent\x20segment:\x20'+_0x91d0cb),console['error'](_0x46b65b(0x1b4)+_0xf8eaa8),_0x3e4eaf&&console['error']('Scoped\x20to\x20folder:\x20'+_0x496227));const _0x7af75=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x91d0cb+_0x46b65b(0x145),()=>_0x319695['segment'][_0x46b65b(0x150)](_0x91d0cb),{'verbose':_0x529a9c[_0x46b65b(0x1ab)]}),_0x41d8fd=_0x7af75[_0x46b65b(0x173)],{parentSegmentResult:_0x5255b9,segmentsResult:_0x2875da,foldersResult:_0x471c2d,journeysWithDetailsResult:_0x2b3d8b,userMaps:_0x1f0ee3}=await withSpinner(_0x46b65b(0x13d),async()=>{const _0x5bc61d=_0x46b65b,[_0x312241,_0x226180,_0x19f65f,_0x57ff03,_0x4c1a72]=await Promise['all']([_0x319695[_0x5bc61d(0x1ca)]['getParent'](_0x41d8fd),_0x319695[_0x5bc61d(0x1ca)][_0x5bc61d(0x1b9)](_0x41d8fd),_0x319695['segment'][_0x5bc61d(0x179)](_0x41d8fd),_0x319695[_0x5bc61d(0x171)]['listJourneysWithDetailsFromParentSegment'](_0x41d8fd,{'includeAllVersions':!![]}),_0x319695[_0x5bc61d(0x141)][_0x5bc61d(0x14a)]()]);return{'parentSegmentResult':_0x312241,'segmentsResult':_0x226180,'foldersResult':_0x19f65f,'journeysWithDetailsResult':_0x57ff03,'userMaps':_0x4c1a72};},{'verbose':_0x529a9c[_0x46b65b(0x1ab)]})[_0x46b65b(0x19e)](_0x2f9719=>_0x2f9719[_0x46b65b(0x173)]),_0x11b67e=_0x5255b9,_0x357c56=extractRootFolderId(_0x11b67e),_0x1bb0d2=_0x2875da,_0x258c60=_0x471c2d,{journeys:_0xef5323,activationStepsById:_0x3f8b87}=_0x2b3d8b,_0x112442=new Map(_0xef5323['map'](_0x1f54a8=>[_0x1f54a8['id'],_0x1f54a8])),_0x81379f=_0xef5323['map'](_0x36f007=>({'id':_0x36f007['id'],'name':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x184)],'journeyBundleName':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x187)]||'','journeyBundleId':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x158)]||'','versionNumber':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x1c9)],'description':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x1b2)],'state':_0x36f007['attributes'][_0x46b65b(0x15c)],'paused':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x16a)],'audienceId':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x1c7)],'folderId':_0x36f007[_0x46b65b(0x1b0)]?.[_0x46b65b(0x182)]?.[_0x46b65b(0x173)]?.['id'],'createdAt':_0x36f007[_0x46b65b(0x1b5)]['createdAt'],'updatedAt':_0x36f007[_0x46b65b(0x1b5)]['updatedAt']})),{emailToId:_0x3efd99,idToEmail:_0x2e9478}=_0x1f0ee3,_0x21c847=await withSpinner(_0x46b65b(0x149),async()=>{const _0x3c6eb1=_0x46b65b,_0xdc658e=await _0x319695[_0x3c6eb1(0x1c5)][_0x3c6eb1(0x18f)]();return buildConnectionMaps(_0xdc658e);},{'verbose':_0x529a9c[_0x46b65b(0x1ab)]})[_0x46b65b(0x19e)](_0x27eec4=>_0x27eec4[_0x46b65b(0x173)]),_0x1a4fe1=_0x21c847[_0x46b65b(0x170)],_0x2d82ee=_0x21c847[_0x46b65b(0x17a)],_0x58a599=_0x21c847['nameToType'],_0x44b654={'emailToIdMap':_0x3efd99,'connectionNameToIdMap':_0x1a4fe1,'connectionNameToTypeMap':_0x58a599,'getSchema':_0x20841b=>_0x319695[_0x46b65b(0x1c5)][_0x46b65b(0x1d0)](_0x20841b)};let {pathToId:_0x28e9b4,idToPath:_0x24da81}=buildFolderMaps(_0x258c60);const _0x290c9c=buildSegmentLookupMap(_0x1bb0d2,_0x24da81),_0x259f9c=buildSegmentNameToIdMap(_0x1bb0d2),_0x5742e9=buildJourneyBundleLookupMap(_0x81379f,_0x24da81);let _0x5c0cdd;if(_0xe7def0){if(!_0xe7def0['endsWith']('.yml')&&!_0xe7def0['endsWith']('.yaml'))return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x147)+_0xe7def0+'\x0a')),0x1;_0x5c0cdd=[_0xe7def0];}else _0x5c0cdd=findYamlFiles(_0xf8eaa8);if(_0x5c0cdd[_0x46b65b(0x180)]===0x0)return console[_0x46b65b(0x153)](a42_0x24aec8['red'](_0x46b65b(0x18d)+_0xf8eaa8+'\x0a')),console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x1bf)](_0x46b65b(0x19b))),0x1;let _0x142fc0,_0x2511c0;try{const _0x575d70=parseAndClassifyYamlFiles(_0x5c0cdd,_0xf8eaa8,{'skipSegments':_0x529a9c[_0x46b65b(0x1cc)]});_0x142fc0=_0x575d70[_0x46b65b(0x15d)],_0x2511c0=_0x575d70[_0x46b65b(0x194)];const _0x3378ce=validateParsedFiles(_0x575d70,_0xf8eaa8);if(_0x3378ce[_0x46b65b(0x180)]>0x0)return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x1a5))),console['error'](formatValidationErrors(_0x3378ce)),console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x564131){return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)]('Error\x20parsing\x20YAML:\x20'+(_0x564131 instanceof Error?_0x564131[_0x46b65b(0x19a)]:_0x564131))),0x1;}if(_0x142fc0[_0x46b65b(0x180)]===0x0&&_0x2511c0[_0x46b65b(0x180)]===0x0){const _0x18e83f=_0x529a9c['journeysOnly']?_0x46b65b(0x171):_0x46b65b(0x159);return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)](_0x46b65b(0x174)+_0x18e83f+_0x46b65b(0x13f))),0x0;}const _0x241e29=new Map();_0x1bb0d2[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x1cc)]&&await withSpinner(_0x46b65b(0x154),async()=>{await batchAsync(_0x1bb0d2,async _0x30578b=>{const _0x288f0d=a42_0x25c6,_0x2f173d=await _0x319695['segment'][_0x288f0d(0x165)](_0x41d8fd,_0x30578b['id']);_0x241e29[_0x288f0d(0x1b8)](_0x30578b['id'],_0x2f173d);});},{'verbose':_0x529a9c[_0x46b65b(0x1ab)]});const {segmentFiles:_0x5dbcdd,foldersToCreate:_0x423a41}=await prepareSegmentFiles(_0x142fc0,{'segmentByFolderAndName':_0x290c9c,'activationsBySegmentId':_0x241e29,'folderPathToId':_0x28e9b4,'idToEmailMap':_0x2e9478,'connectionIdToNameMap':_0x2d82ee},_0x44b654,_0x3e4eaf,_0x496227),_0x4891c8=_0xe7def0?[]:findSegmentsToDelete(_0x1bb0d2,_0x142fc0[_0x46b65b(0x17e)](({yamlConfig:_0xde9fbe,folderPath:_0x376ebc})=>({'yamlConfig':_0xde9fbe,'folderPath':resolveTDFolderPath(_0x376ebc,_0x3e4eaf,_0x496227)})),_0x24da81,_0x496227,_0x3e4eaf),{journeyFiles:_0x38460e,foldersToCreate:_0x55e17d}=await withProgressSpinner(_0x46b65b(0x152),async _0x291396=>prepareJourneyFiles(_0x2511c0,{'fetchJourney':async _0x7d8fc2=>_0x319695[_0x46b65b(0x171)][_0x46b65b(0x1a4)](_0x7d8fc2[_0x46b65b(0x175)]),'journeyBundlesByFolderAndName':_0x5742e9,'folderPathToId':_0x28e9b4,'idToEmailMap':_0x2e9478,'connectionIdToNameMap':_0x2d82ee,'existingSegments':_0x1bb0d2,'parentId':_0x41d8fd,'deps':_0x319695,'progress':{'update':_0x325531=>{const _0x14209c=_0x46b65b;_0x291396[_0x14209c(0x19d)](_0x325531),_0x529a9c['verbose']&&console[_0x14209c(0x153)]('\x20\x20'+_0x325531);}},'journeyById':_0x112442,'activationStepsById':_0x3f8b87},_0x3e4eaf,_0x496227),{'verbose':_0x529a9c[_0x46b65b(0x1ab)]})[_0x46b65b(0x19e)](_0x57df16=>_0x57df16[_0x46b65b(0x173)]);for(const _0x40f0f1 of _0x55e17d){_0x423a41['add'](_0x40f0f1);}const _0x5e7d66=_0xe7def0?[]:findJourneysToDelete(_0x81379f,_0x2511c0['map'](({yamlConfig:_0x44bfac,folderPath:_0xd1eee4})=>({'yamlConfig':_0x44bfac,'folderPath':resolveTDFolderPath(_0xd1eee4,_0x3e4eaf,_0x496227)})),_0x24da81,_0x496227,_0x3e4eaf),_0x55629f=calculatePushStats(_0x5dbcdd,_0x38460e,_0x423a41,_0x4891c8,_0x5e7d66,!!_0x529a9c[_0x46b65b(0x17c)],!!_0x529a9c['journeysOnly']),_0x1e856e=_0x55629f[_0x46b65b(0x15d)]['new'],_0x4bbab7=_0x55629f[_0x46b65b(0x15d)][_0x46b65b(0x1bc)],_0x489966=_0x55629f[_0x46b65b(0x15d)]['unchanged'],_0x3afcb3=_0x55629f[_0x46b65b(0x15d)][_0x46b65b(0x191)],_0x4f6aa1=_0x55629f[_0x46b65b(0x163)][_0x46b65b(0x185)],_0x4003fa=_0x55629f[_0x46b65b(0x194)][_0x46b65b(0x1a8)],_0x371b1d=_0x55629f[_0x46b65b(0x194)][_0x46b65b(0x1bc)],_0x28c67e=_0x55629f[_0x46b65b(0x194)][_0x46b65b(0x16e)],_0x4a1d71=_0x55629f[_0x46b65b(0x194)][_0x46b65b(0x191)],_0x3cf56a=_0x55629f[_0x46b65b(0x16f)][_0x46b65b(0x144)],_0x2378d9=_0x55629f[_0x46b65b(0x16f)][_0x46b65b(0x185)],_0x3c19e6=_0x55629f['activations']['toUpdate'],_0xbe84fb=_0x55629f['activations'][_0x46b65b(0x191)];console[_0x46b65b(0x153)](_0x46b65b(0x1a3)+_0x91d0cb+'\x27:');_0x4f6aa1[_0x46b65b(0x180)]>0x0&&console[_0x46b65b(0x153)]('\x20\x20'+a42_0x24aec8[_0x46b65b(0x13b)](_0x46b65b(0x148)+_0x4f6aa1[_0x46b65b(0x180)]+'\x20folders\x20to\x20create'));if(!_0x529a9c[_0x46b65b(0x1cc)]){console[_0x46b65b(0x153)](_0x46b65b(0x160)),console['error']('\x20\x20\x20\x20'+a42_0x24aec8[_0x46b65b(0x1ae)]('+\x20'+_0x1e856e['length']+_0x46b65b(0x1aa))),console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8['yellow']('~\x20'+_0x4bbab7[_0x46b65b(0x180)]+_0x46b65b(0x186)));if(_0x3afcb3['length']>0x0)console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x138)]('-\x20'+_0x3afcb3[_0x46b65b(0x180)]+_0x46b65b(0x1b3)));else _0x4891c8[_0x46b65b(0x180)]>0x0&&!_0x529a9c['delete']&&console['error'](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x140)](_0x4891c8[_0x46b65b(0x180)]+_0x46b65b(0x1bd)));console[_0x46b65b(0x153)]('\x20\x20\x20\x20'+a42_0x24aec8[_0x46b65b(0x140)]('=\x20'+_0x489966[_0x46b65b(0x180)]+_0x46b65b(0x1ac)));}if(_0x38460e['length']>0x0||_0x5e7d66[_0x46b65b(0x180)]>0x0){console[_0x46b65b(0x153)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x1ae)]('+\x20'+_0x4003fa['length']+_0x46b65b(0x1aa))),console[_0x46b65b(0x153)]('\x20\x20\x20\x20'+a42_0x24aec8['yellow']('~\x20'+_0x371b1d[_0x46b65b(0x180)]+_0x46b65b(0x186)));if(_0x4a1d71[_0x46b65b(0x180)]>0x0)console[_0x46b65b(0x153)]('\x20\x20\x20\x20'+a42_0x24aec8[_0x46b65b(0x138)]('-\x20'+_0x4a1d71[_0x46b65b(0x180)]+_0x46b65b(0x1b3)));else _0x5e7d66[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x17c)]&&console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x140)](_0x5e7d66[_0x46b65b(0x180)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x140)]('=\x20'+_0x28c67e[_0x46b65b(0x180)]+'\x20unchanged'));}_0x3cf56a['length']>0x0&&!_0x529a9c['journeysOnly']&&(console[_0x46b65b(0x153)](''),console[_0x46b65b(0x153)](_0x46b65b(0x1a9)),_0x2378d9[_0x46b65b(0x180)]>0x0&&console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x1ae)]('+\x20'+_0x2378d9[_0x46b65b(0x180)]+_0x46b65b(0x1c2))),_0x3c19e6[_0x46b65b(0x180)]>0x0&&console['error'](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x15a)]('~\x20'+_0x3c19e6[_0x46b65b(0x180)]+_0x46b65b(0x16c))),_0xbe84fb[_0x46b65b(0x180)]>0x0&&console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x138)]('-\x20'+_0xbe84fb['length']+'\x20to\x20delete')));console['error'](_0x46b65b(0x13a)+a42_0x24aec8[_0x46b65b(0x1bf)](_0xf8eaa8)+'\x0a');if(_0x4f6aa1['length']>0x0){console[_0x46b65b(0x153)]('Folders\x20to\x20create:');for(const _0xda1260 of _0x4f6aa1){console[_0x46b65b(0x153)]('\x20\x20'+a42_0x24aec8[_0x46b65b(0x13b)]('+')+'\x20'+_0xda1260);}console[_0x46b65b(0x153)]('');}if(_0x1e856e[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x1cc)])for(const _0x119b4b of _0x1e856e){const _0x2322f3=_0x119b4b['folderPath']?_0x119b4b[_0x46b65b(0x1c8)]+'/'+_0x119b4b[_0x46b65b(0x197)][_0x46b65b(0x184)]:_0x119b4b[_0x46b65b(0x197)][_0x46b65b(0x184)],_0x381021=_0x119b4b['yamlConfig']['activations']?.[_0x46b65b(0x180)]||0x0,_0x8c1eb3=_0x381021>0x0?a42_0x24aec8['dim']('\x20['+_0x381021+_0x46b65b(0x1c3)):'';console[_0x46b65b(0x153)]('\x0a'+a42_0x24aec8['green'](_0x46b65b(0x196))+'\x20'+_0x2322f3+_0x8c1eb3),console['error']('─'[_0x46b65b(0x13e)](0x3c)),_0x119b4b['diff']&&console['error'](_0x119b4b['diff']),console['error']('─'[_0x46b65b(0x13e)](0x3c));}if(_0x3afcb3[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x1cc)])for(const _0x4bfc5a of _0x3afcb3){const _0x12c054=_0x4bfc5a[_0x46b65b(0x14b)]?_0x24da81[_0x46b65b(0x151)](_0x4bfc5a['segmentFolderId'][_0x46b65b(0x166)]())||'':'',_0xa99815=_0x12c054?_0x12c054+'/'+_0x4bfc5a[_0x46b65b(0x184)]:_0x4bfc5a[_0x46b65b(0x184)],_0x8537e=_0x241e29[_0x46b65b(0x151)](_0x4bfc5a['id'])||[],_0x542358=_0x8537e[_0x46b65b(0x180)]>0x0?a42_0x24aec8[_0x46b65b(0x140)]('\x20['+_0x8537e[_0x46b65b(0x180)]+_0x46b65b(0x1c3)):'';console[_0x46b65b(0x153)]('\x0a'+a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x1bb))+'\x20'+_0xa99815+_0x542358),console[_0x46b65b(0x153)]('─'['repeat'](0x3c));const _0x1daa87=segmentWithActivationsToYaml(_0x4bfc5a,_0x8537e,undefined,_0x2e9478,_0x2d82ee),_0x22d5d6=segmentToYamlString(_0x1daa87),_0x5840b9=generateDiff(_0x22d5d6,'');console['error'](formatDiffWithColors(_0x5840b9)),console[_0x46b65b(0x153)]('─'['repeat'](0x3c));}const _0x30c9c5=_0x5dbcdd['filter'](_0x549006=>!_0x549006[_0x46b65b(0x188)]&&_0x549006[_0x46b65b(0x1a6)]);if(_0x30c9c5[_0x46b65b(0x180)]>0x0&&!_0x529a9c['journeysOnly'])for(const _0x543181 of _0x30c9c5){const _0x22513f=_0x543181['folderPath']?_0x543181[_0x46b65b(0x1c8)]+'/'+_0x543181[_0x46b65b(0x197)]['name']:_0x543181[_0x46b65b(0x197)][_0x46b65b(0x184)];console['error']('\x0a'+a42_0x24aec8['yellow']('Changes\x20to:')+'\x20'+_0x22513f),console['error']('─'['repeat'](0x3c)),console[_0x46b65b(0x153)](_0x543181[_0x46b65b(0x1a6)]),console[_0x46b65b(0x153)]('─'['repeat'](0x3c));}if(_0x4003fa[_0x46b65b(0x180)]>0x0)for(const _0x14082e of _0x4003fa){const _0x3d04e2=_0x14082e[_0x46b65b(0x1c8)]?_0x14082e[_0x46b65b(0x1c8)]+'/'+_0x14082e[_0x46b65b(0x197)]['name']:_0x14082e[_0x46b65b(0x197)][_0x46b65b(0x184)];console['error']('\x0a'+a42_0x24aec8[_0x46b65b(0x1ae)](_0x46b65b(0x157))+'\x20'+_0x3d04e2),console['error']('─'[_0x46b65b(0x13e)](0x3c)),_0x14082e[_0x46b65b(0x1a6)]&&console[_0x46b65b(0x153)](_0x14082e['diff']),console[_0x46b65b(0x153)]('─'[_0x46b65b(0x13e)](0x3c));}const _0x3920d0=_0x38460e[_0x46b65b(0x195)](_0x2b9ed9=>!_0x2b9ed9[_0x46b65b(0x188)]&&_0x2b9ed9[_0x46b65b(0x1a6)]);if(_0x3920d0['length']>0x0)for(const _0x5af95c of _0x3920d0){const _0x1fa91a=_0x5af95c[_0x46b65b(0x1c8)]?_0x5af95c[_0x46b65b(0x1c8)]+'/'+_0x5af95c[_0x46b65b(0x197)][_0x46b65b(0x184)]:_0x5af95c['yamlConfig']['name'];console[_0x46b65b(0x153)]('\x0a'+a42_0x24aec8[_0x46b65b(0x15a)](_0x46b65b(0x143))+'\x20'+_0x1fa91a),console[_0x46b65b(0x153)]('─'['repeat'](0x3c)),console[_0x46b65b(0x153)](_0x5af95c['diff']),console[_0x46b65b(0x153)]('─'[_0x46b65b(0x13e)](0x3c));}if(_0x4a1d71[_0x46b65b(0x180)]>0x0)for(const _0x2736c7 of _0x4a1d71){const _0x361a78=_0x2736c7[_0x46b65b(0x1cb)]?_0x24da81['get'](_0x2736c7[_0x46b65b(0x1cb)])||'':'',_0x42a61b=_0x361a78?_0x361a78+'/'+_0x2736c7['journeyBundleName']:_0x2736c7['journeyBundleName'];console[_0x46b65b(0x153)]('\x0a'+a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x139))+'\x20'+_0x42a61b),console[_0x46b65b(0x153)]('─'[_0x46b65b(0x13e)](0x3c)),console['error'](a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x14d))),console[_0x46b65b(0x153)]('─'[_0x46b65b(0x13e)](0x3c));}if(_0x529a9c[_0x46b65b(0x167)])return console[_0x46b65b(0x153)](a42_0x24aec8['yellow'](_0x46b65b(0x18a))),0x0;const _0x2402d5=_0x529a9c[_0x46b65b(0x1cc)]?![]:_0x1e856e['length']>0x0||_0x4bbab7[_0x46b65b(0x180)]>0x0||_0x3afcb3[_0x46b65b(0x180)]>0x0,_0x2317ae=_0x4003fa[_0x46b65b(0x180)]>0x0||_0x371b1d[_0x46b65b(0x180)]>0x0||_0x4a1d71[_0x46b65b(0x180)]>0x0,_0x149df0=_0x529a9c[_0x46b65b(0x1cc)]?![]:_0x3cf56a[_0x46b65b(0x180)]>0x0,_0x36bde1=_0x4f6aa1[_0x46b65b(0x180)]>0x0;if(!_0x2402d5&&!_0x2317ae&&!_0x149df0&&!_0x36bde1){const _0x3a5720=_0x529a9c[_0x46b65b(0x1cc)]?_0x46b65b(0x17b):_0x46b65b(0x1ce);console['error'](a42_0x24aec8[_0x46b65b(0x1ae)](_0x3a5720));if(_0xe7def0&&_0x489966[_0x46b65b(0x180)]===0x1){const _0x5e661b=_0x489966[0x0];if(_0x5e661b[_0x46b65b(0x1a1)]?.['id']){const _0x250cd0=getConsoleNextUrl(_0x529a9c[_0x46b65b(0x1c4)],_0x46b65b(0x14e)+_0x41d8fd+_0x46b65b(0x19f)+_0x5e661b[_0x46b65b(0x1a1)]['id']+'/sb/da/esr');console['error'](_0x46b65b(0x177)+a42_0x24aec8[_0x46b65b(0x1bf)](_0x250cd0));}}if(_0xe7def0&&_0x28c67e[_0x46b65b(0x180)]===0x1){const _0x554d6b=_0x28c67e[0x0];if(_0x554d6b[_0x46b65b(0x18b)]?.['id']){const _0x38ba5c=getConsoleNextUrl(_0x529a9c[_0x46b65b(0x1c4)],_0x46b65b(0x14e)+_0x41d8fd+_0x46b65b(0x19f)+_0x554d6b[_0x46b65b(0x18b)]['id']+'/j/da/je');console[_0x46b65b(0x153)]('\x20\x20'+a42_0x24aec8['cyan'](_0x38ba5c));}}return 0x0;}const _0x2a4023=_0x529a9c[_0x46b65b(0x1cc)]?_0x4003fa[_0x46b65b(0x180)]+_0x371b1d[_0x46b65b(0x180)]+_0x4a1d71[_0x46b65b(0x180)]+_0x4f6aa1['length']:_0x1e856e['length']+_0x4bbab7[_0x46b65b(0x180)]+_0x3afcb3[_0x46b65b(0x180)]+_0x4003fa[_0x46b65b(0x180)]+_0x371b1d[_0x46b65b(0x180)]+_0x4a1d71[_0x46b65b(0x180)]+_0x4f6aa1[_0x46b65b(0x180)]+_0x3cf56a[_0x46b65b(0x180)];if(!_0x529a9c[_0x46b65b(0x193)]&&_0x2a4023>0x0){if(!isInteractive())return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x176)),_0x46b65b(0x15b)),console['error'](a42_0x24aec8['dim'](_0x46b65b(0x146))),0x1;const _0x361efd=await confirmKey(_0x46b65b(0x1a0)+_0x2a4023+_0x46b65b(0x1a2));if(!_0x361efd)return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)](_0x46b65b(0x16d))),0x1;}const _0x144c10={'withProgress':async(_0xc68c3,_0xd57562)=>{const _0x361286=_0x46b65b,_0x376b86=await withSpinner(_0xc68c3,_0xd57562,{'verbose':_0x529a9c[_0x361286(0x1ab)]});return{'data':_0x376b86['data']};},'logInfo':_0x360e42=>console['error'](a42_0x24aec8[_0x46b65b(0x13b)]('✔\x20'+_0x360e42)),'logSuccess':_0x561bc5=>console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x1ae)]('✔\x20'+_0x561bc5)),'logWarning':_0x16f59c=>console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)]('⚠\x20'+_0x16f59c)),'logDeleted':_0x3d07f0=>console['error'](a42_0x24aec8[_0x46b65b(0x138)]('✔\x20'+_0x3d07f0))},_0x4b8e32={'segment':_0x319695['segment'],'journey':_0x319695[_0x46b65b(0x171)],'user':_0x319695[_0x46b65b(0x141)],'connection':_0x319695[_0x46b65b(0x1c5)]};_0x4f6aa1[_0x46b65b(0x180)]>0x0&&(_0x28e9b4=await executePushFolders(_0x4b8e32,_0x4f6aa1,_0x28e9b4,{'parentId':_0x41d8fd},_0x144c10));const _0x8747db={'rootFolderId':_0x357c56,'folderPathToId':_0x28e9b4,'folderIdToPath':_0x24da81,'segmentNameToId':_0x259f9c,'activationsBySegmentId':_0x241e29,'emailToIdMap':_0x3efd99,'idToEmailMap':_0x2e9478,'connectionNameToIdMap':_0x21c847[_0x46b65b(0x170)],'connectionIdToNameMap':_0x21c847[_0x46b65b(0x17a)],'connectionNameToTypeMap':_0x58a599},_0x24ff67=await executePushSegments(_0x4b8e32,_0x529a9c[_0x46b65b(0x1cc)]?[]:_0x5dbcdd,_0x8747db,{'parentId':_0x41d8fd},_0x144c10),_0x3e3242=_0x24ff67[_0x46b65b(0x1af)],_0x5b9803=_0x24ff67['updated'],_0x1efefb=_0x24ff67[_0x46b65b(0x16f)][_0x46b65b(0x1af)],_0x3759d1=_0x24ff67[_0x46b65b(0x16f)][_0x46b65b(0x1c1)],_0x4901d9=_0x24ff67[_0x46b65b(0x16f)]['deleted'];let _0x4d2619;if(_0xe7def0&&_0x5dbcdd[_0x46b65b(0x180)]===0x1){const _0x29ee95=_0x5dbcdd[0x0];_0x4d2619=_0x29ee95[_0x46b65b(0x1a1)]?.['id']??_0x24ff67[_0x46b65b(0x183)][_0x46b65b(0x151)](_0x29ee95[_0x46b65b(0x197)][_0x46b65b(0x184)]);}const _0x161827=await executePushSegmentDeletions(_0x4b8e32,_0x529a9c['journeysOnly']?[]:_0x3afcb3,_0x144c10);let _0x1d816d=0x0,_0x3a7d7d=0x0,_0x169dfd=0x0;const _0x54baa9=new Map(_0x259f9c);for(const [_0x1ff584,_0x4faa49]of _0x24ff67[_0x46b65b(0x183)]){_0x54baa9[_0x46b65b(0x1b8)](_0x1ff584,_0x4faa49);}if(_0x38460e[_0x46b65b(0x180)]>0x0){const _0x421e4c={..._0x8747db,'segmentNameToId':_0x54baa9,'existingSegments':_0x1bb0d2,'activationContext':_0x44b654},_0x53a51a=await executePushJourneys(_0x4b8e32,_0x38460e,_0x421e4c,{'parentId':_0x41d8fd,'rootFolderId':_0x357c56,'verbose':_0x529a9c[_0x46b65b(0x1ab)]},_0x144c10);_0x1d816d=_0x53a51a['created'],_0x3a7d7d=_0x53a51a[_0x46b65b(0x1c1)];if(_0xe7def0&&_0x53a51a[_0x46b65b(0x1c6)][_0x46b65b(0x180)]===0x1){const _0x31f8fe=_0x53a51a[_0x46b65b(0x1c6)][0x0];if(_0x31f8fe['journeyId']){const _0x355c19=getConsoleNextUrl(_0x529a9c[_0x46b65b(0x1c4)],_0x46b65b(0x14e)+_0x41d8fd+_0x46b65b(0x19f)+_0x31f8fe['journeyId']+'/j/da/je');console['error']('\x20\x20'+a42_0x24aec8[_0x46b65b(0x1bf)](_0x355c19));}}}for(const _0x3e6c7a of _0x4a1d71){console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)](_0x46b65b(0x192)+_0x3e6c7a[_0x46b65b(0x187)])),_0x169dfd++;}const _0x736dc4=[];if(_0x3e3242>0x0)_0x736dc4['push'](_0x3e3242+_0x46b65b(0x19c));if(_0x5b9803>0x0)_0x736dc4[_0x46b65b(0x155)](_0x5b9803+_0x46b65b(0x13c));if(_0x161827>0x0)_0x736dc4[_0x46b65b(0x155)](_0x161827+'\x20deleted');const _0x467e8a=[];if(_0x1d816d>0x0)_0x467e8a[_0x46b65b(0x155)](_0x1d816d+_0x46b65b(0x19c));if(_0x3a7d7d>0x0)_0x467e8a[_0x46b65b(0x155)](_0x3a7d7d+'\x20updated');if(_0x169dfd>0x0)_0x467e8a[_0x46b65b(0x155)](_0x169dfd+'\x20deleted');const _0x11d4fd=[];if(_0x1efefb>0x0)_0x11d4fd['push'](_0x1efefb+_0x46b65b(0x19c));if(_0x3759d1>0x0)_0x11d4fd[_0x46b65b(0x155)](_0x3759d1+_0x46b65b(0x13c));if(_0x4901d9>0x0)_0x11d4fd[_0x46b65b(0x155)](_0x4901d9+'\x20deleted');console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x1ae)](_0x46b65b(0x1a7)));_0x736dc4[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x1cc)]&&console['error'](_0x46b65b(0x1cd)+_0x736dc4[_0x46b65b(0x168)](',\x20'));_0x467e8a[_0x46b65b(0x180)]>0x0&&console[_0x46b65b(0x153)](_0x46b65b(0x169)+_0x467e8a['join'](',\x20'));_0x11d4fd[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x1cc)]&&console[_0x46b65b(0x153)]('\x20\x20Activations:\x20'+_0x11d4fd[_0x46b65b(0x168)](',\x20'));if(_0x4d2619){const _0x4054ab=getConsoleNextUrl(_0x529a9c[_0x46b65b(0x1c4)],'/app/ps/'+_0x41d8fd+'/e/'+_0x4d2619+_0x46b65b(0x1b6));console[_0x46b65b(0x153)](_0x46b65b(0x177)+a42_0x24aec8[_0x46b65b(0x1bf)](_0x4054ab));}return 0x0;}}
1
+ const a42_0x14c2ac=a42_0x48ed;(function(_0x4f4718,_0x3d7a33){const _0x5c3a6f=a42_0x48ed,_0x56f70e=_0x4f4718();while(!![]){try{const _0x3d24fe=-parseInt(_0x5c3a6f(0x153))/0x1*(-parseInt(_0x5c3a6f(0x1c0))/0x2)+parseInt(_0x5c3a6f(0x188))/0x3+parseInt(_0x5c3a6f(0x16f))/0x4+-parseInt(_0x5c3a6f(0x1a0))/0x5*(-parseInt(_0x5c3a6f(0x1d7))/0x6)+parseInt(_0x5c3a6f(0x18b))/0x7+parseInt(_0x5c3a6f(0x14e))/0x8*(parseInt(_0x5c3a6f(0x16d))/0x9)+-parseInt(_0x5c3a6f(0x1a3))/0xa*(parseInt(_0x5c3a6f(0x180))/0xb);if(_0x3d24fe===_0x3d7a33)break;else _0x56f70e['push'](_0x56f70e['shift']());}catch(_0x4cbd13){_0x56f70e['push'](_0x56f70e['shift']());}}}(a42_0x3464,0xf1562));function a42_0x3464(){const _0x2d2dcb=['\x0aError:','Folders\x20to\x20create:','journeyBundleName','getJourney','updatedAt','journeyId','Site:\x20','filter','then','message','Parent\x20segment:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','name','yes','updated','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','parentFolder','errorCode','paused','length','parent_name','journeyBundleId','yellow','error','New\x20segment:','results','4yNEuJT','diff','nameToType','execute','Changes\x20to\x20journey:','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','segment','description','audienceId','Preparing\x20journeys...','\x0aPush\x20summary\x20for\x20\x27','/sb/da/esr','Scoped\x20to\x20folder:\x20','add','(Journey\x20will\x20be\x20deleted)','segmentFolderId','verbose','getOutputSchemaWithCache','journey','new','Fetching\x20connections\x20for\x20name\x20resolution...','Delete\x20segment:','2899986VguOYx','Resolving\x20parent\x20segment\x20\x27','\x20YAML\x20files\x20found','\x20to\x20create','listJourneysWithDetailsFromParentSegment','dim','createdSegmentIds','.yaml','journeysOnly','nameToId','toDelete','green','data','endsWith','\x20deleted','\x20\x20\x20\x20','journeys','delete','\x20activations]','Error\x20parsing\x20YAML:\x20','targetDir','88ZZfnRM','toCreate','Push\x20','filePath','folderId','103606qmNIyH','segment:push','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','unchanged','red','📁\x20','changed','connection','/app/ps/','\x20\x20📊\x20Segments:','createdAt','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','blue','New\x20journey:','join','Changes\x20to:','Delete\x20journey:','activations','no_parent','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','existingSegment','set','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Aborted.','repeat','existingJourney','1601703jReeum','\x20\x20Segments:\x20','2316800lCxhjl','/e/','idToName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20new','attributes','\x20\x20Journeys:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','setPhase','get','listSegments','user','map','listFolders','isScoped','segments','330693hXNYhU','created','\x0aValidation\x20failed:','helpText','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','parentSegment','.yml','\x20updated','5255247PrTNuN','\x20created','/j/da/je','6367578VyUQRw','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','folderPath','parentName','\x0a✔\x20Push\x20complete','site','versionNumber','push','\x20folders\x20to\x20create','isNew','\x20\x20Activations:\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20to\x20delete','cwd','yamlConfig','type','all','\x20\x20Activations:','Fetching\x20existing\x20activations...','\x20changes?','Error:\x20','5QmFqDd','\x20changed','\x27...','1630LDCjAN','cyan'];a42_0x3464=function(){return _0x2d2dcb;};return a42_0x3464();}import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a42_0x48ed(_0x30549a,_0x30c789){_0x30549a=_0x30549a-0x14a;const _0x34642f=a42_0x3464();let _0x48edfb=_0x34642f[_0x30549a];return _0x48edfb;}import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a42_0x153597 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a42_0x14c2ac(0x1b1)]=a42_0x14c2ac(0x154);[a42_0x14c2ac(0x1c8)]=a42_0x14c2ac(0x18c);async[a42_0x14c2ac(0x1c3)](_0x36e5e4){const _0x34869d=a42_0x14c2ac,{options:_0x387ef2,args:_0x26b721,tdx:_0x3bdb1e}=_0x36e5e4,_0x11aa09=_0x387ef2,_0x250590=await resolveTarget({'arg':_0x26b721[0x0],'contextParent':_0x387ef2[_0x34869d(0x185)],'cwd':process[_0x34869d(0x198)]()});if(!isSuccessfulResolution(_0x250590))return _0x250590[_0x34869d(0x1b7)]===_0x34869d(0x165)?(console['error'](a42_0x153597[_0x34869d(0x1bc)](_0x34869d(0x155))),console[_0x34869d(0x1bd)](_0x34869d(0x169)),console[_0x34869d(0x1bd)](_0x34869d(0x15e)),console[_0x34869d(0x1bd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x157)](_0x34869d(0x19f)+_0x250590[_0x34869d(0x1ae)]+'\x0a')),_0x250590[_0x34869d(0x183)]&&console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x1a4)](_0x250590[_0x34869d(0x183)]))),0x1;if(_0x250590[_0x34869d(0x19a)]===_0x34869d(0x1ba))return console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x157)]('Error:\x20Directory\x20not\x20found:\x20'+_0x250590[_0x34869d(0x14d)]+'\x0a')),console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x1a4)](_0x34869d(0x176))),0x1;const _0x1f4d60=_0x250590[_0x34869d(0x18e)],_0x1f2227=_0x250590[_0x34869d(0x14d)],_0x420e1b=_0x250590[_0x34869d(0x19a)]==='file'?_0x250590[_0x34869d(0x151)]:undefined,_0x17ba2d=getScopedDetails(_0x250590),_0x97d3af=_0x17ba2d?.[_0x34869d(0x17e)]??![],_0xaf1da6=_0x17ba2d?.['scopedFolderPath']??'';if(!existsSync(_0x1f2227))return console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x157)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1f2227+'\x0a')),console['error'](a42_0x153597[_0x34869d(0x1a4)](_0x34869d(0x176))),0x1;_0x11aa09[_0x34869d(0x1d1)]&&(console[_0x34869d(0x1bd)](_0x34869d(0x1ab)+_0x11aa09[_0x34869d(0x190)]),console[_0x34869d(0x1bd)](_0x34869d(0x1af)+_0x1f4d60),console['error']('Source\x20directory:\x20'+_0x1f2227),_0x97d3af&&console[_0x34869d(0x1bd)](_0x34869d(0x1cd)+_0xaf1da6));const _0x581736=await withSpinner(_0x34869d(0x1d8)+_0x1f4d60+_0x34869d(0x1a2),()=>_0x3bdb1e[_0x34869d(0x1c7)]['resolveParentId'](_0x1f4d60),{'verbose':_0x11aa09[_0x34869d(0x1d1)]}),_0x341433=_0x581736[_0x34869d(0x1e3)],{parentSegmentResult:_0x361e20,segmentsResult:_0x2dc72f,foldersResult:_0x578542,journeysWithDetailsResult:_0x879891,userMaps:_0x160bd0}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x50b43b=_0x34869d,[_0x1c1125,_0x5474b4,_0x93b99,_0x351624,_0x6eb827]=await Promise[_0x50b43b(0x19b)]([_0x3bdb1e[_0x50b43b(0x1c7)]['getParent'](_0x341433),_0x3bdb1e[_0x50b43b(0x1c7)][_0x50b43b(0x17a)](_0x341433),_0x3bdb1e[_0x50b43b(0x1c7)][_0x50b43b(0x17d)](_0x341433),_0x3bdb1e[_0x50b43b(0x1d3)][_0x50b43b(0x1db)](_0x341433,{'includeAllVersions':!![]}),_0x3bdb1e[_0x50b43b(0x17b)]['buildUserMaps']()]);return{'parentSegmentResult':_0x1c1125,'segmentsResult':_0x5474b4,'foldersResult':_0x93b99,'journeysWithDetailsResult':_0x351624,'userMaps':_0x6eb827};},{'verbose':_0x11aa09[_0x34869d(0x1d1)]})[_0x34869d(0x1ad)](_0xb35bea=>_0xb35bea[_0x34869d(0x1e3)]),_0x3c540b=_0x361e20,_0x2cf720=extractRootFolderId(_0x3c540b),_0x5531a3=_0x2dc72f,_0x2634e5=_0x578542,{journeys:_0xd9f76a,activationStepsById:_0x28002b}=_0x879891,_0x18e98e=new Map(_0xd9f76a[_0x34869d(0x17c)](_0x37ad15=>[_0x37ad15['id'],_0x37ad15])),_0x4dfd05=_0xd9f76a[_0x34869d(0x17c)](_0x9e7859=>({'id':_0x9e7859['id'],'name':_0x9e7859[_0x34869d(0x174)][_0x34869d(0x1b1)],'journeyBundleName':_0x9e7859[_0x34869d(0x174)][_0x34869d(0x1a7)]||'','journeyBundleId':_0x9e7859[_0x34869d(0x174)][_0x34869d(0x1bb)]||'','versionNumber':_0x9e7859[_0x34869d(0x174)][_0x34869d(0x191)],'description':_0x9e7859[_0x34869d(0x174)][_0x34869d(0x1c8)],'state':_0x9e7859[_0x34869d(0x174)]['state'],'paused':_0x9e7859[_0x34869d(0x174)][_0x34869d(0x1b8)],'audienceId':_0x9e7859[_0x34869d(0x174)][_0x34869d(0x1c9)],'folderId':_0x9e7859['relationships']?.[_0x34869d(0x1b6)]?.[_0x34869d(0x1e3)]?.['id'],'createdAt':_0x9e7859['attributes'][_0x34869d(0x15d)],'updatedAt':_0x9e7859[_0x34869d(0x174)][_0x34869d(0x1a9)]})),{emailToId:_0x558cb2,idToEmail:_0x598997}=_0x160bd0,_0xee52e4=await withSpinner(_0x34869d(0x1d5),async()=>{const _0x801448=_0x34869d,_0x26f8ad=await _0x3bdb1e[_0x801448(0x15a)]['list']();return buildConnectionMaps(_0x26f8ad);},{'verbose':_0x11aa09[_0x34869d(0x1d1)]})[_0x34869d(0x1ad)](_0x4eeacc=>_0x4eeacc[_0x34869d(0x1e3)]),_0x29e0be=_0xee52e4[_0x34869d(0x1e0)],_0x22dd47=_0xee52e4['idToName'],_0x40990b=_0xee52e4[_0x34869d(0x1c2)],_0x4ed45f={'emailToIdMap':_0x558cb2,'connectionNameToIdMap':_0x29e0be,'connectionNameToTypeMap':_0x40990b,'getSchema':_0x295bb0=>_0x3bdb1e['connection'][_0x34869d(0x1d2)](_0x295bb0)};let {pathToId:_0x474b09,idToPath:_0x1e6f21}=buildFolderMaps(_0x2634e5);const _0x4cb2ad=buildSegmentLookupMap(_0x5531a3,_0x1e6f21),_0x24606c=buildSegmentNameToIdMap(_0x5531a3),_0x427fb9=buildJourneyBundleLookupMap(_0x4dfd05,_0x1e6f21);let _0x54c01c;if(_0x420e1b){if(!_0x420e1b[_0x34869d(0x1e4)](_0x34869d(0x186))&&!_0x420e1b[_0x34869d(0x1e4)](_0x34869d(0x1de)))return console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x157)](_0x34869d(0x184)+_0x420e1b+'\x0a')),0x1;_0x54c01c=[_0x420e1b];}else _0x54c01c=findYamlFiles(_0x1f2227);if(_0x54c01c['length']===0x0)return console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x157)](_0x34869d(0x196)+_0x1f2227+'\x0a')),console['error'](a42_0x153597[_0x34869d(0x1a4)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x2a21dd,_0x7af059;try{const _0x585817=parseAndClassifyYamlFiles(_0x54c01c,_0x1f2227,{'skipSegments':_0x11aa09[_0x34869d(0x1df)]});_0x2a21dd=_0x585817[_0x34869d(0x17f)],_0x7af059=_0x585817[_0x34869d(0x1e7)];const _0x3e4703=validateParsedFiles(_0x585817,_0x1f2227);if(_0x3e4703[_0x34869d(0x1b9)]>0x0)return console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x157)](_0x34869d(0x182))),console['error'](formatValidationErrors(_0x3e4703)),console['error'](a42_0x153597[_0x34869d(0x1bc)](_0x34869d(0x1b4))),0x1;}catch(_0x36e125){return console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x157)](_0x34869d(0x14c)+(_0x36e125 instanceof Error?_0x36e125['message']:_0x36e125))),0x1;}if(_0x2a21dd['length']===0x0&&_0x7af059[_0x34869d(0x1b9)]===0x0){const _0x55bbd0=_0x11aa09['journeysOnly']?_0x34869d(0x1d3):'segment\x20or\x20journey';return console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x1bc)]('No\x20'+_0x55bbd0+_0x34869d(0x1d9))),0x0;}const _0x51d8d8=new Map();_0x5531a3[_0x34869d(0x1b9)]>0x0&&!_0x11aa09[_0x34869d(0x1df)]&&await withSpinner(_0x34869d(0x19d),async()=>{await batchAsync(_0x5531a3,async _0xfd7c84=>{const _0x2cda91=a42_0x48ed,_0x51924d=await _0x3bdb1e[_0x2cda91(0x1c7)]['listActivations'](_0x341433,_0xfd7c84['id']);_0x51d8d8[_0x2cda91(0x168)](_0xfd7c84['id'],_0x51924d);});},{'verbose':_0x11aa09['verbose']});const {segmentFiles:_0x132d47,foldersToCreate:_0x4c8fb8}=await prepareSegmentFiles(_0x2a21dd,{'segmentByFolderAndName':_0x4cb2ad,'activationsBySegmentId':_0x51d8d8,'folderPathToId':_0x474b09,'idToEmailMap':_0x598997,'connectionIdToNameMap':_0x22dd47},_0x4ed45f,_0x97d3af,_0xaf1da6),_0xc6ae7e=_0x420e1b?[]:findSegmentsToDelete(_0x5531a3,_0x2a21dd[_0x34869d(0x17c)](({yamlConfig:_0x298ea2,folderPath:_0x1fd8ba})=>({'yamlConfig':_0x298ea2,'folderPath':resolveTDFolderPath(_0x1fd8ba,_0x97d3af,_0xaf1da6)})),_0x1e6f21,_0xaf1da6,_0x97d3af),{journeyFiles:_0x5e344e,foldersToCreate:_0x548bd1}=await withProgressSpinner(_0x34869d(0x1ca),async _0x4064de=>prepareJourneyFiles(_0x7af059,{'fetchJourney':async _0x1e3c09=>_0x3bdb1e[_0x34869d(0x1d3)][_0x34869d(0x1a8)](_0x1e3c09[_0x34869d(0x1aa)]),'journeyBundlesByFolderAndName':_0x427fb9,'folderPathToId':_0x474b09,'idToEmailMap':_0x598997,'connectionIdToNameMap':_0x22dd47,'existingSegments':_0x5531a3,'parentId':_0x341433,'deps':_0x3bdb1e,'progress':{'update':_0x23ca78=>{const _0x5b894f=_0x34869d;_0x4064de[_0x5b894f(0x178)](_0x23ca78),_0x11aa09['verbose']&&console[_0x5b894f(0x1bd)]('\x20\x20'+_0x23ca78);}},'journeyById':_0x18e98e,'activationStepsById':_0x28002b},_0x97d3af,_0xaf1da6),{'verbose':_0x11aa09['verbose']})[_0x34869d(0x1ad)](_0x3eeea3=>_0x3eeea3['data']);for(const _0x583ca0 of _0x548bd1){_0x4c8fb8[_0x34869d(0x1ce)](_0x583ca0);}const _0x1f0607=_0x420e1b?[]:findJourneysToDelete(_0x4dfd05,_0x7af059['map'](({yamlConfig:_0x240c31,folderPath:_0x3e309b})=>({'yamlConfig':_0x240c31,'folderPath':resolveTDFolderPath(_0x3e309b,_0x97d3af,_0xaf1da6)})),_0x1e6f21,_0xaf1da6,_0x97d3af),_0xce4e1=calculatePushStats(_0x132d47,_0x5e344e,_0x4c8fb8,_0xc6ae7e,_0x1f0607,!!_0x11aa09[_0x34869d(0x14a)],!!_0x11aa09[_0x34869d(0x1df)]),_0x4c35e6=_0xce4e1['segments']['new'],_0x3c788b=_0xce4e1['segments'][_0x34869d(0x159)],_0x216030=_0xce4e1[_0x34869d(0x17f)]['unchanged'],_0x52ae33=_0xce4e1['segments'][_0x34869d(0x1e1)],_0x3715c1=_0xce4e1['folders'][_0x34869d(0x14f)],_0x6f0803=_0xce4e1[_0x34869d(0x1e7)][_0x34869d(0x1d4)],_0x5e89ef=_0xce4e1[_0x34869d(0x1e7)]['changed'],_0x1a89b6=_0xce4e1[_0x34869d(0x1e7)][_0x34869d(0x156)],_0x419cd5=_0xce4e1['journeys']['toDelete'],_0xf8d38f=_0xce4e1['activations'][_0x34869d(0x19b)],_0x2b2aa4=_0xce4e1['activations']['toCreate'],_0x2c2798=_0xce4e1[_0x34869d(0x164)]['toUpdate'],_0x338ba7=_0xce4e1[_0x34869d(0x164)]['toDelete'];console[_0x34869d(0x1bd)](_0x34869d(0x1cb)+_0x1f4d60+'\x27:');_0x3715c1[_0x34869d(0x1b9)]>0x0&&console['error']('\x20\x20'+a42_0x153597['blue'](_0x34869d(0x158)+_0x3715c1['length']+_0x34869d(0x193)));if(!_0x11aa09[_0x34869d(0x1df)]){console['error'](_0x34869d(0x15c)),console[_0x34869d(0x1bd)](_0x34869d(0x1e6)+a42_0x153597[_0x34869d(0x1e2)]('+\x20'+_0x4c35e6['length']+_0x34869d(0x173))),console['error'](_0x34869d(0x1e6)+a42_0x153597[_0x34869d(0x1bc)]('~\x20'+_0x3c788b[_0x34869d(0x1b9)]+_0x34869d(0x1a1)));if(_0x52ae33[_0x34869d(0x1b9)]>0x0)console[_0x34869d(0x1bd)](_0x34869d(0x1e6)+a42_0x153597['red']('-\x20'+_0x52ae33[_0x34869d(0x1b9)]+_0x34869d(0x197)));else _0xc6ae7e[_0x34869d(0x1b9)]>0x0&&!_0x11aa09[_0x34869d(0x14a)]&&console['error']('\x20\x20\x20\x20'+a42_0x153597['dim'](_0xc6ae7e[_0x34869d(0x1b9)]+_0x34869d(0x166)));console[_0x34869d(0x1bd)](_0x34869d(0x1e6)+a42_0x153597[_0x34869d(0x1dc)]('=\x20'+_0x216030[_0x34869d(0x1b9)]+'\x20unchanged'));}if(_0x5e344e[_0x34869d(0x1b9)]>0x0||_0x1f0607[_0x34869d(0x1b9)]>0x0){console[_0x34869d(0x1bd)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x34869d(0x1e6)+a42_0x153597[_0x34869d(0x1e2)]('+\x20'+_0x6f0803[_0x34869d(0x1b9)]+_0x34869d(0x173))),console[_0x34869d(0x1bd)](_0x34869d(0x1e6)+a42_0x153597[_0x34869d(0x1bc)]('~\x20'+_0x5e89ef[_0x34869d(0x1b9)]+_0x34869d(0x1a1)));if(_0x419cd5[_0x34869d(0x1b9)]>0x0)console[_0x34869d(0x1bd)]('\x20\x20\x20\x20'+a42_0x153597[_0x34869d(0x157)]('-\x20'+_0x419cd5[_0x34869d(0x1b9)]+_0x34869d(0x197)));else _0x1f0607[_0x34869d(0x1b9)]>0x0&&!_0x11aa09[_0x34869d(0x14a)]&&console[_0x34869d(0x1bd)]('\x20\x20\x20\x20'+a42_0x153597['dim'](_0x1f0607[_0x34869d(0x1b9)]+_0x34869d(0x166)));console['error'](_0x34869d(0x1e6)+a42_0x153597[_0x34869d(0x1dc)]('=\x20'+_0x1a89b6[_0x34869d(0x1b9)]+'\x20unchanged'));}_0xf8d38f[_0x34869d(0x1b9)]>0x0&&!_0x11aa09[_0x34869d(0x1df)]&&(console['error'](''),console[_0x34869d(0x1bd)](_0x34869d(0x19c)),_0x2b2aa4[_0x34869d(0x1b9)]>0x0&&console[_0x34869d(0x1bd)]('\x20\x20\x20\x20'+a42_0x153597['green']('+\x20'+_0x2b2aa4[_0x34869d(0x1b9)]+_0x34869d(0x1da))),_0x2c2798[_0x34869d(0x1b9)]>0x0&&console['error'](_0x34869d(0x1e6)+a42_0x153597[_0x34869d(0x1bc)]('~\x20'+_0x2c2798['length']+'\x20to\x20update')),_0x338ba7[_0x34869d(0x1b9)]>0x0&&console[_0x34869d(0x1bd)](_0x34869d(0x1e6)+a42_0x153597[_0x34869d(0x157)]('-\x20'+_0x338ba7[_0x34869d(0x1b9)]+'\x20to\x20delete')));console[_0x34869d(0x1bd)]('\x20\x20Source:\x20'+a42_0x153597[_0x34869d(0x1a4)](_0x1f2227)+'\x0a');if(_0x3715c1[_0x34869d(0x1b9)]>0x0){console[_0x34869d(0x1bd)](_0x34869d(0x1a6));for(const _0x36c121 of _0x3715c1){console[_0x34869d(0x1bd)]('\x20\x20'+a42_0x153597[_0x34869d(0x15f)]('+')+'\x20'+_0x36c121);}console[_0x34869d(0x1bd)]('');}if(_0x4c35e6[_0x34869d(0x1b9)]>0x0&&!_0x11aa09[_0x34869d(0x1df)])for(const _0x1ca67f of _0x4c35e6){const _0x23539a=_0x1ca67f[_0x34869d(0x18d)]?_0x1ca67f['folderPath']+'/'+_0x1ca67f['yamlConfig'][_0x34869d(0x1b1)]:_0x1ca67f['yamlConfig'][_0x34869d(0x1b1)],_0x5c12a2=_0x1ca67f['yamlConfig'][_0x34869d(0x164)]?.[_0x34869d(0x1b9)]||0x0,_0x5a3f7c=_0x5c12a2>0x0?a42_0x153597[_0x34869d(0x1dc)]('\x20['+_0x5c12a2+_0x34869d(0x14b)):'';console['error']('\x0a'+a42_0x153597[_0x34869d(0x1e2)](_0x34869d(0x1be))+'\x20'+_0x23539a+_0x5a3f7c),console['error']('─'[_0x34869d(0x16b)](0x3c)),_0x1ca67f['diff']&&console[_0x34869d(0x1bd)](_0x1ca67f['diff']),console[_0x34869d(0x1bd)]('─'[_0x34869d(0x16b)](0x3c));}if(_0x52ae33[_0x34869d(0x1b9)]>0x0&&!_0x11aa09[_0x34869d(0x1df)])for(const _0x54e1e1 of _0x52ae33){const _0x52bcf8=_0x54e1e1[_0x34869d(0x1d0)]?_0x1e6f21[_0x34869d(0x179)](_0x54e1e1[_0x34869d(0x1d0)]['toString']())||'':'',_0x434b32=_0x52bcf8?_0x52bcf8+'/'+_0x54e1e1[_0x34869d(0x1b1)]:_0x54e1e1[_0x34869d(0x1b1)],_0x1d5a14=_0x51d8d8[_0x34869d(0x179)](_0x54e1e1['id'])||[],_0x2e1ff4=_0x1d5a14[_0x34869d(0x1b9)]>0x0?a42_0x153597[_0x34869d(0x1dc)]('\x20['+_0x1d5a14[_0x34869d(0x1b9)]+_0x34869d(0x14b)):'';console[_0x34869d(0x1bd)]('\x0a'+a42_0x153597[_0x34869d(0x157)](_0x34869d(0x1d6))+'\x20'+_0x434b32+_0x2e1ff4),console[_0x34869d(0x1bd)]('─'[_0x34869d(0x16b)](0x3c));const _0x3424f5=segmentWithActivationsToYaml(_0x54e1e1,_0x1d5a14,undefined,_0x598997,_0x22dd47),_0x38910d=segmentToYamlString(_0x3424f5),_0x1901a5=generateDiff(_0x38910d,'');console[_0x34869d(0x1bd)](formatDiffWithColors(_0x1901a5)),console[_0x34869d(0x1bd)]('─'[_0x34869d(0x16b)](0x3c));}const _0x4129d5=_0x132d47[_0x34869d(0x1ac)](_0x2d8bb9=>!_0x2d8bb9['isNew']&&_0x2d8bb9['diff']);if(_0x4129d5[_0x34869d(0x1b9)]>0x0&&!_0x11aa09[_0x34869d(0x1df)])for(const _0x2e46ea of _0x4129d5){const _0x43dc4a=_0x2e46ea[_0x34869d(0x18d)]?_0x2e46ea[_0x34869d(0x18d)]+'/'+_0x2e46ea['yamlConfig'][_0x34869d(0x1b1)]:_0x2e46ea[_0x34869d(0x199)][_0x34869d(0x1b1)];console[_0x34869d(0x1bd)]('\x0a'+a42_0x153597[_0x34869d(0x1bc)](_0x34869d(0x162))+'\x20'+_0x43dc4a),console[_0x34869d(0x1bd)]('─'[_0x34869d(0x16b)](0x3c)),console[_0x34869d(0x1bd)](_0x2e46ea[_0x34869d(0x1c1)]),console[_0x34869d(0x1bd)]('─'[_0x34869d(0x16b)](0x3c));}if(_0x6f0803[_0x34869d(0x1b9)]>0x0)for(const _0x33a8f7 of _0x6f0803){const _0x2be2bb=_0x33a8f7[_0x34869d(0x18d)]?_0x33a8f7[_0x34869d(0x18d)]+'/'+_0x33a8f7[_0x34869d(0x199)][_0x34869d(0x1b1)]:_0x33a8f7[_0x34869d(0x199)][_0x34869d(0x1b1)];console[_0x34869d(0x1bd)]('\x0a'+a42_0x153597['green'](_0x34869d(0x160))+'\x20'+_0x2be2bb),console[_0x34869d(0x1bd)]('─'[_0x34869d(0x16b)](0x3c)),_0x33a8f7['diff']&&console[_0x34869d(0x1bd)](_0x33a8f7[_0x34869d(0x1c1)]),console[_0x34869d(0x1bd)]('─'['repeat'](0x3c));}const _0x556fe4=_0x5e344e['filter'](_0x52a9f4=>!_0x52a9f4[_0x34869d(0x194)]&&_0x52a9f4[_0x34869d(0x1c1)]);if(_0x556fe4[_0x34869d(0x1b9)]>0x0)for(const _0x1e6742 of _0x556fe4){const _0x3bf108=_0x1e6742['folderPath']?_0x1e6742['folderPath']+'/'+_0x1e6742[_0x34869d(0x199)][_0x34869d(0x1b1)]:_0x1e6742[_0x34869d(0x199)]['name'];console['error']('\x0a'+a42_0x153597[_0x34869d(0x1bc)](_0x34869d(0x1c4))+'\x20'+_0x3bf108),console['error']('─'[_0x34869d(0x16b)](0x3c)),console['error'](_0x1e6742['diff']),console[_0x34869d(0x1bd)]('─'[_0x34869d(0x16b)](0x3c));}if(_0x419cd5[_0x34869d(0x1b9)]>0x0)for(const _0x567ca3 of _0x419cd5){const _0x1973c4=_0x567ca3[_0x34869d(0x152)]?_0x1e6f21[_0x34869d(0x179)](_0x567ca3[_0x34869d(0x152)])||'':'',_0x212d2b=_0x1973c4?_0x1973c4+'/'+_0x567ca3[_0x34869d(0x1a7)]:_0x567ca3['journeyBundleName'];console['error']('\x0a'+a42_0x153597['red'](_0x34869d(0x163))+'\x20'+_0x212d2b),console[_0x34869d(0x1bd)]('─'[_0x34869d(0x16b)](0x3c)),console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x157)](_0x34869d(0x1cf))),console[_0x34869d(0x1bd)]('─'[_0x34869d(0x16b)](0x3c));}if(_0x11aa09['dryRun'])return console[_0x34869d(0x1bd)](a42_0x153597['yellow'](_0x34869d(0x1b0))),0x0;const _0x1891e0=_0x11aa09[_0x34869d(0x1df)]?![]:_0x4c35e6[_0x34869d(0x1b9)]>0x0||_0x3c788b[_0x34869d(0x1b9)]>0x0||_0x52ae33[_0x34869d(0x1b9)]>0x0,_0x581490=_0x6f0803[_0x34869d(0x1b9)]>0x0||_0x5e89ef[_0x34869d(0x1b9)]>0x0||_0x419cd5[_0x34869d(0x1b9)]>0x0,_0x23d81e=_0x11aa09[_0x34869d(0x1df)]?![]:_0xf8d38f['length']>0x0,_0x1b8e2e=_0x3715c1['length']>0x0;if(!_0x1891e0&&!_0x581490&&!_0x23d81e&&!_0x1b8e2e){const _0x12e810=_0x11aa09[_0x34869d(0x1df)]?_0x34869d(0x1c5):_0x34869d(0x177);console['error'](a42_0x153597[_0x34869d(0x1e2)](_0x12e810));if(_0x420e1b&&_0x216030[_0x34869d(0x1b9)]===0x1){const _0xd2251e=_0x216030[0x0];if(_0xd2251e[_0x34869d(0x167)]?.['id']){const _0x1063c6=getConsoleNextUrl(_0x11aa09[_0x34869d(0x190)],'/app/ps/'+_0x341433+_0x34869d(0x170)+_0xd2251e[_0x34869d(0x167)]['id']+_0x34869d(0x1cc));console[_0x34869d(0x1bd)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a42_0x153597[_0x34869d(0x1a4)](_0x1063c6));}}if(_0x420e1b&&_0x1a89b6[_0x34869d(0x1b9)]===0x1){const _0x862272=_0x1a89b6[0x0];if(_0x862272['existingJourney']?.['id']){const _0x18db6e=getConsoleNextUrl(_0x11aa09['site'],_0x34869d(0x15b)+_0x341433+_0x34869d(0x170)+_0x862272[_0x34869d(0x16c)]['id']+_0x34869d(0x18a));console['error']('\x20\x20'+a42_0x153597[_0x34869d(0x1a4)](_0x18db6e));}}return 0x0;}const _0x2bb3c0=_0x11aa09[_0x34869d(0x1df)]?_0x6f0803[_0x34869d(0x1b9)]+_0x5e89ef[_0x34869d(0x1b9)]+_0x419cd5[_0x34869d(0x1b9)]+_0x3715c1[_0x34869d(0x1b9)]:_0x4c35e6[_0x34869d(0x1b9)]+_0x3c788b[_0x34869d(0x1b9)]+_0x52ae33[_0x34869d(0x1b9)]+_0x6f0803['length']+_0x5e89ef[_0x34869d(0x1b9)]+_0x419cd5[_0x34869d(0x1b9)]+_0x3715c1[_0x34869d(0x1b9)]+_0xf8d38f[_0x34869d(0x1b9)];if(!_0x11aa09[_0x34869d(0x1b2)]&&_0x2bb3c0>0x0){if(!isInteractive())return console[_0x34869d(0x1bd)](a42_0x153597['red'](_0x34869d(0x1a5)),_0x34869d(0x172)),console[_0x34869d(0x1bd)](a42_0x153597['dim'](_0x34869d(0x1c6))),0x1;const _0x35921a=await confirmKey(_0x34869d(0x150)+_0x2bb3c0+_0x34869d(0x19e));if(!_0x35921a)return console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x1bc)](_0x34869d(0x16a))),0x1;}const _0x1fb8a0={'withProgress':async(_0x3577c2,_0xf09fbf)=>{const _0x1604d2=_0x34869d,_0x3aaf5a=await withSpinner(_0x3577c2,_0xf09fbf,{'verbose':_0x11aa09[_0x1604d2(0x1d1)]});return{'data':_0x3aaf5a['data']};},'logInfo':_0x375fec=>console[_0x34869d(0x1bd)](a42_0x153597['blue']('✔\x20'+_0x375fec)),'logSuccess':_0x50e633=>console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x1e2)]('✔\x20'+_0x50e633)),'logWarning':_0x5c1f02=>console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x1bc)]('⚠\x20'+_0x5c1f02)),'logDeleted':_0x197d95=>console['error'](a42_0x153597[_0x34869d(0x157)]('✔\x20'+_0x197d95))},_0x402040={'segment':_0x3bdb1e['segment'],'journey':_0x3bdb1e[_0x34869d(0x1d3)],'user':_0x3bdb1e[_0x34869d(0x17b)],'connection':_0x3bdb1e[_0x34869d(0x15a)]};_0x3715c1[_0x34869d(0x1b9)]>0x0&&(_0x474b09=await executePushFolders(_0x402040,_0x3715c1,_0x474b09,{'parentId':_0x341433},_0x1fb8a0));const _0x34af6b={'rootFolderId':_0x2cf720,'folderPathToId':_0x474b09,'folderIdToPath':_0x1e6f21,'segmentNameToId':_0x24606c,'activationsBySegmentId':_0x51d8d8,'emailToIdMap':_0x558cb2,'idToEmailMap':_0x598997,'connectionNameToIdMap':_0xee52e4['nameToId'],'connectionIdToNameMap':_0xee52e4[_0x34869d(0x171)],'connectionNameToTypeMap':_0x40990b},_0x563bca=await executePushSegments(_0x402040,_0x11aa09[_0x34869d(0x1df)]?[]:_0x132d47,_0x34af6b,{'parentId':_0x341433},_0x1fb8a0),_0x30d480=_0x563bca['created'],_0x5d17c0=_0x563bca['updated'],_0x2b966b=_0x563bca[_0x34869d(0x164)][_0x34869d(0x181)],_0x4cbd95=_0x563bca[_0x34869d(0x164)][_0x34869d(0x1b3)],_0x52808c=_0x563bca[_0x34869d(0x164)]['deleted'];let _0x1314ba;if(_0x420e1b&&_0x132d47[_0x34869d(0x1b9)]===0x1){const _0x4f15a8=_0x132d47[0x0];_0x1314ba=_0x4f15a8[_0x34869d(0x167)]?.['id']??_0x563bca[_0x34869d(0x1dd)][_0x34869d(0x179)](_0x4f15a8[_0x34869d(0x199)][_0x34869d(0x1b1)]);}const _0x40b5a5=await executePushSegmentDeletions(_0x402040,_0x11aa09[_0x34869d(0x1df)]?[]:_0x52ae33,_0x1fb8a0);let _0x400e84=0x0,_0x12e477=0x0,_0x3d65a8=0x0;const _0x2f60c7=new Map(_0x24606c);for(const [_0x385e71,_0x1806f7]of _0x563bca['createdSegmentIds']){_0x2f60c7['set'](_0x385e71,_0x1806f7);}if(_0x5e344e[_0x34869d(0x1b9)]>0x0){const _0x2a45d9={..._0x34af6b,'segmentNameToId':_0x2f60c7,'existingSegments':_0x5531a3,'activationContext':_0x4ed45f},_0x32d03b=await executePushJourneys(_0x402040,_0x5e344e,_0x2a45d9,{'parentId':_0x341433,'rootFolderId':_0x2cf720,'verbose':_0x11aa09['verbose']},_0x1fb8a0);_0x400e84=_0x32d03b[_0x34869d(0x181)],_0x12e477=_0x32d03b[_0x34869d(0x1b3)];if(_0x420e1b&&_0x32d03b['results']['length']===0x1){const _0x225197=_0x32d03b[_0x34869d(0x1bf)][0x0];if(_0x225197[_0x34869d(0x1aa)]){const _0x357045=getConsoleNextUrl(_0x11aa09[_0x34869d(0x190)],'/app/ps/'+_0x341433+_0x34869d(0x170)+_0x225197[_0x34869d(0x1aa)]+_0x34869d(0x18a));console['error']('\x20\x20'+a42_0x153597[_0x34869d(0x1a4)](_0x357045));}}}for(const _0x49f29c of _0x419cd5){console['error'](a42_0x153597[_0x34869d(0x1bc)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x49f29c[_0x34869d(0x1a7)])),_0x3d65a8++;}const _0x30031c=[];if(_0x30d480>0x0)_0x30031c['push'](_0x30d480+'\x20created');if(_0x5d17c0>0x0)_0x30031c[_0x34869d(0x192)](_0x5d17c0+_0x34869d(0x187));if(_0x40b5a5>0x0)_0x30031c[_0x34869d(0x192)](_0x40b5a5+_0x34869d(0x1e5));const _0x46c4c0=[];if(_0x400e84>0x0)_0x46c4c0['push'](_0x400e84+_0x34869d(0x189));if(_0x12e477>0x0)_0x46c4c0['push'](_0x12e477+_0x34869d(0x187));if(_0x3d65a8>0x0)_0x46c4c0[_0x34869d(0x192)](_0x3d65a8+_0x34869d(0x1e5));const _0x2ffe71=[];if(_0x2b966b>0x0)_0x2ffe71[_0x34869d(0x192)](_0x2b966b+'\x20created');if(_0x4cbd95>0x0)_0x2ffe71[_0x34869d(0x192)](_0x4cbd95+_0x34869d(0x187));if(_0x52808c>0x0)_0x2ffe71[_0x34869d(0x192)](_0x52808c+'\x20deleted');console[_0x34869d(0x1bd)](a42_0x153597[_0x34869d(0x1e2)](_0x34869d(0x18f)));_0x30031c[_0x34869d(0x1b9)]>0x0&&!_0x11aa09[_0x34869d(0x1df)]&&console[_0x34869d(0x1bd)](_0x34869d(0x16e)+_0x30031c[_0x34869d(0x161)](',\x20'));_0x46c4c0[_0x34869d(0x1b9)]>0x0&&console[_0x34869d(0x1bd)](_0x34869d(0x175)+_0x46c4c0[_0x34869d(0x161)](',\x20'));_0x2ffe71[_0x34869d(0x1b9)]>0x0&&!_0x11aa09[_0x34869d(0x1df)]&&console[_0x34869d(0x1bd)](_0x34869d(0x195)+_0x2ffe71[_0x34869d(0x161)](',\x20'));if(_0x1314ba){const _0x46c7ca=getConsoleNextUrl(_0x11aa09[_0x34869d(0x190)],_0x34869d(0x15b)+_0x341433+_0x34869d(0x170)+_0x1314ba+_0x34869d(0x1cc));console['error'](_0x34869d(0x1b5)+a42_0x153597['cyan'](_0x46c7ca));}return 0x0;}}
@@ -1 +1 @@
1
- function a43_0x5bae(){const _0x10becd=['resolvePathToResource','554729amkbCR','type','kind','yellow','segmentPath','16KFVPDe','Parent\x20ID:\x20','4067127pUwpcH','2839150rrHqar','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','11pnUbED','segment','rule','includes','Resolved\x20type:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Resolved\x20relative\x20path\x20to:\x20','length','Update\x20existing\x20child\x20segment','Resolving\x20path\x20\x27','data','3vUIxfY','parentId','232xnUhaK','execute','Error:\x20Cannot\x20update\x20','name','5948946mLTzwj','resolveFolderId','folder','segmentId','407300oZcIUW','description','INTERNAL','\x20\x20\x20Path:\x20','segment:update','Segment\x20ID:\x20','\x27...','Updating\x20segment\x20\x27','error','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','ruleFile','Examples:','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','updateSegmentById','532738SRSQiD','5850jCJQOt'];a43_0x5bae=function(){return _0x10becd;};return a43_0x5bae();}const a43_0x477905=a43_0x1771;(function(_0x1fa49e,_0x528419){const _0x29db2e=a43_0x1771,_0x509fea=_0x1fa49e();while(!![]){try{const _0x1738a0=-parseInt(_0x29db2e(0x1ee))/0x1*(parseInt(_0x29db2e(0x206))/0x2)+-parseInt(_0x29db2e(0x207))/0x3*(-parseInt(_0x29db2e(0x1f0))/0x4)+-parseInt(_0x29db2e(0x1e0))/0x5+parseInt(_0x29db2e(0x1f4))/0x6+-parseInt(_0x29db2e(0x209))/0x7+-parseInt(_0x29db2e(0x1dd))/0x8*(-parseInt(_0x29db2e(0x1df))/0x9)+parseInt(_0x29db2e(0x1f8))/0xa*(-parseInt(_0x29db2e(0x1e3))/0xb);if(_0x1738a0===_0x528419)break;else _0x509fea['push'](_0x509fea['shift']());}catch(_0x2b12d1){_0x509fea['push'](_0x509fea['shift']());}}}(a43_0x5bae,0x7f50b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a43_0x1771(_0x5d59d3,_0x25ff71){_0x5d59d3=_0x5d59d3-0x1da;const _0x5bae1b=a43_0x5bae();let _0x1771bc=_0x5bae1b[_0x5d59d3];return _0x1771bc;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a43_0x4771c7 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a43_0x477905(0x1f3)]=a43_0x477905(0x1fc);[a43_0x477905(0x1f9)]=a43_0x477905(0x1eb);async[a43_0x477905(0x1f1)](_0x323643){const _0x46d243=a43_0x477905;console[_0x46d243(0x200)](a43_0x4771c7[_0x46d243(0x1db)](_0x46d243(0x1e8))),console['error'](a43_0x4771c7[_0x46d243(0x1db)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x400a76,args:_0x450cb3,tdx:_0x5ff525}=_0x323643,_0x346010=_0x400a76;if(_0x450cb3[_0x46d243(0x1ea)]===0x0)return console[_0x46d243(0x200)](_0x46d243(0x1e2)),console[_0x46d243(0x200)](_0x46d243(0x201)),console[_0x46d243(0x200)](_0x46d243(0x203)),console[_0x46d243(0x200)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x46d243(0x200)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x4c3134=_0x450cb3[0x0],_0x2f7d12=_0x400a76[_0x46d243(0x1dc)];let _0x1f6fae=_0x4c3134;_0x2f7d12&&!_0x4c3134[_0x46d243(0x1e6)]('/')&&(_0x1f6fae=_0x2f7d12+'/'+_0x4c3134,_0x346010[_0x46d243(0x1e1)]&&console[_0x46d243(0x200)](_0x46d243(0x1e9)+_0x1f6fae));const _0x7b3718=await withSpinner(_0x46d243(0x1ec)+_0x1f6fae+'\x27...',()=>_0x5ff525[_0x46d243(0x1e4)][_0x46d243(0x208)](_0x1f6fae),{'verbose':_0x346010[_0x46d243(0x1e1)]}),_0x5c88ee=_0x7b3718[_0x46d243(0x1ed)];_0x346010[_0x46d243(0x1e1)]&&console[_0x46d243(0x200)](_0x46d243(0x1e7)+_0x5c88ee[_0x46d243(0x20a)]);if(_0x5c88ee[_0x46d243(0x20a)]!==_0x46d243(0x1e4))return console[_0x46d243(0x200)](_0x46d243(0x1f2)+_0x5c88ee[_0x46d243(0x20a)]+_0x46d243(0x204)),console[_0x46d243(0x200)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x5c88ee[_0x46d243(0x1f7)])throw new SDKError(ErrorCode[_0x46d243(0x1fa)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3bd5cf=_0x5c88ee[_0x46d243(0x1ef)],_0x10818a=_0x5c88ee[_0x46d243(0x1f7)];_0x346010[_0x46d243(0x1e1)]&&(console[_0x46d243(0x200)](_0x46d243(0x1de)+_0x3bd5cf),console[_0x46d243(0x200)](_0x46d243(0x1fd)+_0x10818a));let _0x191608;if(_0x346010[_0x46d243(0x1f6)]){const _0x38bf3e=_0x346010[_0x46d243(0x1f6)],_0x3ae7ae=await withSpinner('Resolving\x20folder\x20\x27'+_0x38bf3e+'\x27...',()=>_0x5ff525[_0x46d243(0x1e4)][_0x46d243(0x1f5)](_0x3bd5cf,_0x38bf3e),{'verbose':_0x346010[_0x46d243(0x1e1)]});_0x191608=parseInt(_0x3ae7ae[_0x46d243(0x1ed)],0xa),_0x346010[_0x46d243(0x1e1)]&&console[_0x46d243(0x200)]('Resolved\x20folder\x20ID:\x20'+_0x191608);}const _0x2e0690=await loadJSONFromOptions(_0x346010[_0x46d243(0x1e5)],_0x346010[_0x46d243(0x202)]),_0x1d44e1={'name':_0x346010[_0x46d243(0x1f3)],'description':_0x346010[_0x46d243(0x1f9)],'rule':_0x2e0690,'kind':_0x346010['kind']!==undefined?parseInt(_0x346010[_0x46d243(0x1da)],0xa):undefined,'segmentFolderId':_0x191608},_0x1917b8=await withSpinner(_0x46d243(0x1ff)+_0x5c88ee['segmentName']+_0x46d243(0x1fe),()=>_0x5ff525[_0x46d243(0x1e4)][_0x46d243(0x205)](_0x3bd5cf,_0x10818a,_0x1d44e1),{'verbose':_0x346010['verbose']}),_0x5e25cb=_0x1917b8[_0x46d243(0x1ed)];return console['error']('✔\x20Updated\x20segment\x20\x27'+_0x5e25cb[_0x46d243(0x1f3)]+'\x27'),_0x1f6fae!==_0x4c3134&&console[_0x46d243(0x200)](_0x46d243(0x1fb)+_0x1f6fae),await handleSDKOutput([_0x5e25cb],_0x346010),0x0;}}
1
+ const a43_0x189d6d=a43_0x58ea;(function(_0x2c7b0a,_0x3f3f89){const _0x25e1f5=a43_0x58ea,_0x2ebb6c=_0x2c7b0a();while(!![]){try{const _0x4ac40d=-parseInt(_0x25e1f5(0xf2))/0x1*(parseInt(_0x25e1f5(0xf4))/0x2)+-parseInt(_0x25e1f5(0xed))/0x3*(-parseInt(_0x25e1f5(0x106))/0x4)+-parseInt(_0x25e1f5(0xe1))/0x5+parseInt(_0x25e1f5(0xeb))/0x6+parseInt(_0x25e1f5(0x108))/0x7*(parseInt(_0x25e1f5(0xfa))/0x8)+-parseInt(_0x25e1f5(0x109))/0x9*(-parseInt(_0x25e1f5(0xf1))/0xa)+-parseInt(_0x25e1f5(0xfd))/0xb;if(_0x4ac40d===_0x3f3f89)break;else _0x2ebb6c['push'](_0x2ebb6c['shift']());}catch(_0x3b0532){_0x2ebb6c['push'](_0x2ebb6c['shift']());}}}(a43_0x1ba7,0x50bab));function a43_0x58ea(_0x59be0e,_0x1b9055){_0x59be0e=_0x59be0e-0xdb;const _0x1ba768=a43_0x1ba7();let _0x58ea19=_0x1ba768[_0x59be0e];return _0x58ea19;}function a43_0x1ba7(){const _0x4e3fb1=['execute','✔\x20Updated\x20segment\x20\x27','ruleFile','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','type','947814jjDirJ','length','234PZzjSD','Segment\x20ID:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Examples:','260TCpghf','7wakALc','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','126134oBmsHy','Error:\x20Cannot\x20update\x20','verbose','Update\x20existing\x20child\x20segment','\x27...','INTERNAL','32544sBBTaE','includes','name','4697572AYNEYa','error','Segment\x20ID\x20missing\x20from\x20resolved\x20path','yellow','segmentName','segment','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','kind','description','31540vYeOZX','resolvePathToResource','693wsRKpz','176634lvwcNJ','Updating\x20segment\x20\x27','Resolved\x20folder\x20ID:\x20','data','segmentPath','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','folder','2434095zEZEnf','Resolving\x20path\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20type:\x20'];a43_0x1ba7=function(){return _0x4e3fb1;};return a43_0x1ba7();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a43_0x562a34 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a43_0x189d6d(0xfc)]='segment:update';[a43_0x189d6d(0x105)]=a43_0x189d6d(0xf7);async[a43_0x189d6d(0xe5)](_0x20abe1){const _0x26f06f=a43_0x189d6d;console[_0x26f06f(0xfe)](a43_0x562a34[_0x26f06f(0x100)](_0x26f06f(0xef))),console[_0x26f06f(0xfe)](a43_0x562a34['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x592cd3,args:_0x4d9216,tdx:_0x29f421}=_0x20abe1,_0x570398=_0x592cd3;if(_0x4d9216[_0x26f06f(0xec)]===0x0)return console['error'](_0x26f06f(0xe3)),console['error'](_0x26f06f(0xe9)),console[_0x26f06f(0xfe)](_0x26f06f(0xf0)),console[_0x26f06f(0xfe)](_0x26f06f(0x103)),console[_0x26f06f(0xfe)](_0x26f06f(0xdf)),0x1;const _0x39ee2d=_0x4d9216[0x0],_0x2917f5=_0x592cd3[_0x26f06f(0xde)];let _0x3ccab2=_0x39ee2d;_0x2917f5&&!_0x39ee2d[_0x26f06f(0xfb)]('/')&&(_0x3ccab2=_0x2917f5+'/'+_0x39ee2d,_0x570398['verbose']&&console[_0x26f06f(0xfe)](_0x26f06f(0xe8)+_0x3ccab2));const _0x1ba43c=await withSpinner(_0x26f06f(0xe2)+_0x3ccab2+_0x26f06f(0xf8),()=>_0x29f421[_0x26f06f(0x102)][_0x26f06f(0x107)](_0x3ccab2),{'verbose':_0x570398[_0x26f06f(0xf6)]}),_0x449351=_0x1ba43c[_0x26f06f(0xdd)];_0x570398[_0x26f06f(0xf6)]&&console[_0x26f06f(0xfe)](_0x26f06f(0xe4)+_0x449351[_0x26f06f(0xea)]);if(_0x449351[_0x26f06f(0xea)]!==_0x26f06f(0x102))return console[_0x26f06f(0xfe)](_0x26f06f(0xf5)+_0x449351['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x26f06f(0xfe)](_0x26f06f(0xf3)),0x1;if(!_0x449351['segmentId'])throw new SDKError(ErrorCode[_0x26f06f(0xf9)],_0x26f06f(0xff));const _0x374642=_0x449351['parentId'],_0x367637=_0x449351['segmentId'];_0x570398['verbose']&&(console['error']('Parent\x20ID:\x20'+_0x374642),console[_0x26f06f(0xfe)](_0x26f06f(0xee)+_0x367637));let _0x1e86cb;if(_0x570398[_0x26f06f(0xe0)]){const _0x53bdb0=_0x570398[_0x26f06f(0xe0)],_0x39e53a=await withSpinner('Resolving\x20folder\x20\x27'+_0x53bdb0+_0x26f06f(0xf8),()=>_0x29f421[_0x26f06f(0x102)]['resolveFolderId'](_0x374642,_0x53bdb0),{'verbose':_0x570398[_0x26f06f(0xf6)]});_0x1e86cb=parseInt(_0x39e53a[_0x26f06f(0xdd)],0xa),_0x570398['verbose']&&console[_0x26f06f(0xfe)](_0x26f06f(0xdc)+_0x1e86cb);}const _0x3051c3=await loadJSONFromOptions(_0x570398['rule'],_0x570398[_0x26f06f(0xe7)]),_0x23cf0a={'name':_0x570398[_0x26f06f(0xfc)],'description':_0x570398[_0x26f06f(0x105)],'rule':_0x3051c3,'kind':_0x570398[_0x26f06f(0x104)]!==undefined?parseInt(_0x570398['kind'],0xa):undefined,'segmentFolderId':_0x1e86cb},_0x178b33=await withSpinner(_0x26f06f(0xdb)+_0x449351[_0x26f06f(0x101)]+_0x26f06f(0xf8),()=>_0x29f421[_0x26f06f(0x102)]['updateSegmentById'](_0x374642,_0x367637,_0x23cf0a),{'verbose':_0x570398[_0x26f06f(0xf6)]}),_0x179f60=_0x178b33[_0x26f06f(0xdd)];return console['error'](_0x26f06f(0xe6)+_0x179f60['name']+'\x27'),_0x3ccab2!==_0x39ee2d&&console[_0x26f06f(0xfe)]('\x20\x20\x20Path:\x20'+_0x3ccab2),await handleSDKOutput([_0x179f60],_0x570398),0x0;}}
@@ -1 +1 @@
1
- function a44_0x13a7(){const _0x189b9d=['Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','execute','9UxHuWz','type','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','segmentPath','log','description','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','✔\x20Context\x20set\x20to:\x20','9550919gcUbbC','Site:\x20','red','config','resolvePathToResource','isAbsolute','1388GKqtMi','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','1131042icCnVv','Resolved\x20path\x20type:\x20','6108NaTZUT','segment:use','site','fullPath','isDirectory','Parent\x20ID:\x20','segments','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','folderId','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','308160flEcDO','Resolving\x20path\x20\x27','24744HKhAly','data','cyan','join','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Folder\x20ID:\x20','parentId','folderPath','length','green','parent_segment','segment','274090LYAWbe','Target\x20path:\x20','2271000cBffgB','1785dFKInK','dim','Resolved\x20relative\x20path\x20to:\x20','error','slice','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','verbose','parentName','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'];a44_0x13a7=function(){return _0x189b9d;};return a44_0x13a7();}function a44_0x31ad(_0x225b6d,_0x23f9f6){_0x225b6d=_0x225b6d-0x132;const _0x13a788=a44_0x13a7();let _0x31ad2d=_0x13a788[_0x225b6d];return _0x31ad2d;}const a44_0x16bbc1=a44_0x31ad;(function(_0x27312d,_0x1af880){const _0x424d2e=a44_0x31ad,_0x1559c9=_0x27312d();while(!![]){try{const _0x2d71e4=-parseInt(_0x424d2e(0x165))/0x1+parseInt(_0x424d2e(0x159))/0x2+parseInt(_0x424d2e(0x15b))/0x3*(parseInt(_0x424d2e(0x157))/0x4)+parseInt(_0x424d2e(0x13d))/0x5*(parseInt(_0x424d2e(0x167))/0x6)+-parseInt(_0x424d2e(0x151))/0x7+-parseInt(_0x424d2e(0x13c))/0x8+parseInt(_0x424d2e(0x148))/0x9*(parseInt(_0x424d2e(0x13a))/0xa);if(_0x2d71e4===_0x1af880)break;else _0x1559c9['push'](_0x1559c9['shift']());}catch(_0x36ff34){_0x1559c9['push'](_0x1559c9['shift']());}}}(a44_0x13a7,0xc7086));import{existsSync,statSync}from'fs';import a44_0x58b436 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a44_0x16bbc1(0x15c);[a44_0x16bbc1(0x14e)]=a44_0x16bbc1(0x142);async[a44_0x16bbc1(0x147)](_0x20f488){const _0xfd2834=a44_0x16bbc1,{options:_0x10df48,args:_0x52d5d5,tdx:_0x2bc022}=_0x20f488;if(_0x52d5d5[_0xfd2834(0x136)]===0x0)return console['error'](a44_0x58b436['red']('Error:\x20Path\x20is\x20required\x0a')),console[_0xfd2834(0x140)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0xfd2834(0x140)]('Examples:'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0xfd2834(0x140)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0xfd2834(0x140)](_0xfd2834(0x158)),0x1;const _0x3f9916=_0x52d5d5[0x0],_0x325ddd=_0x10df48['session'];try{if(_0x3f9916==='/')return saveSessionContext({'segment_path':undefined},_0x325ddd),console[_0xfd2834(0x14d)](a44_0x58b436[_0xfd2834(0x137)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x3f9916)&&statSync(_0x3f9916)[_0xfd2834(0x15f)]()){let _0x51265e;try{_0x51265e=findTdxConfig(_0x3f9916);}catch{return console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x153)](_0xfd2834(0x132)+_0x3f9916)),console[_0xfd2834(0x140)](a44_0x58b436['cyan'](_0xfd2834(0x146))),0x1;}const _0x30629e=_0x51265e[_0xfd2834(0x154)][_0xfd2834(0x138)];return saveSessionContext({'segment_path':_0x30629e,'parent_segment':_0x30629e},_0x325ddd),console[_0xfd2834(0x14d)](a44_0x58b436['green'](_0xfd2834(0x150)+a44_0x58b436[_0xfd2834(0x169)](_0x30629e))),0x0;}const _0x474ff9=_0x10df48[_0xfd2834(0x14c)];let _0x53b926=_0x3f9916;const _0x5d1249=parsePath(_0x3f9916);if(!_0x5d1249[_0xfd2834(0x156)]){if(!_0x474ff9)return console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x153)](_0xfd2834(0x14f))),console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x169)](_0xfd2834(0x162))),0x1;if(_0x3f9916==='..'){const _0x66f662=_0x474ff9['split']('/')[_0xfd2834(0x141)](0x0,-0x1)['join']('/');_0x53b926=_0x66f662||'/';}else _0x3f9916==='.'?_0x53b926=_0x474ff9:_0x53b926=_0x474ff9+'/'+_0x3f9916;_0x10df48[_0xfd2834(0x143)]&&console[_0xfd2834(0x140)](_0xfd2834(0x13f)+_0x53b926);}if(_0x53b926==='/'||_0x53b926==='')return saveSessionContext({'segment_path':undefined},_0x325ddd),console[_0xfd2834(0x14d)](a44_0x58b436[_0xfd2834(0x137)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x53b926=normalizePath(_0x53b926);const _0xc597be=parsePath(_0x53b926)[_0xfd2834(0x161)];if(_0xc597be[_0xfd2834(0x136)]===0x0)return saveSessionContext({'segment_path':undefined},_0x325ddd),console[_0xfd2834(0x14d)](a44_0x58b436[_0xfd2834(0x137)](_0xfd2834(0x14b))),0x0;_0x10df48[_0xfd2834(0x143)]&&(console[_0xfd2834(0x140)](_0xfd2834(0x152)+_0x10df48[_0xfd2834(0x15d)]),console['error'](_0xfd2834(0x13b)+_0x53b926));const _0x164348=await withSpinner(_0xfd2834(0x166)+_0x53b926+'\x27...',()=>_0x2bc022[_0xfd2834(0x139)][_0xfd2834(0x155)](_0x53b926),{'verbose':_0x10df48['verbose']}),_0x3ddc01=_0x164348[_0xfd2834(0x168)];_0x10df48[_0xfd2834(0x143)]&&(console[_0xfd2834(0x140)](_0xfd2834(0x15a)+_0x3ddc01[_0xfd2834(0x149)]),console[_0xfd2834(0x140)](_0xfd2834(0x160)+_0x3ddc01[_0xfd2834(0x134)]),_0x3ddc01[_0xfd2834(0x163)]&&console[_0xfd2834(0x140)](_0xfd2834(0x133)+_0x3ddc01['folderId']));if(_0x3ddc01[_0xfd2834(0x149)]===_0xfd2834(0x139))return console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x153)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0xfd2834(0x140)](_0xfd2834(0x145)),console['error'](a44_0x58b436[_0xfd2834(0x169)]('Use:\x20tdx\x20segment\x20use\x20'+_0x3ddc01[_0xfd2834(0x144)]+(_0x3ddc01[_0xfd2834(0x135)]?'/'+_0x3ddc01[_0xfd2834(0x135)][_0xfd2834(0x16a)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3ddc01[_0xfd2834(0x15e)],'parent_segment':_0x3ddc01[_0xfd2834(0x144)]},_0x325ddd),console['log'](a44_0x58b436['green']('✔\x20Context\x20set\x20to:\x20'+a44_0x58b436[_0xfd2834(0x169)](_0x3ddc01['fullPath']))),_0x10df48[_0xfd2834(0x143)]&&(console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x13e)](_0xfd2834(0x14a))),console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x13e)](_0xfd2834(0x164)))),0x0;}catch(_0x53e943){throw _0x53e943;}}}
1
+ const a44_0x2388d2=a44_0x15df;function a44_0x15df(_0x43bc6b,_0x56d00c){_0x43bc6b=_0x43bc6b-0x184;const _0x476ee8=a44_0x476e();let _0x15df0e=_0x476ee8[_0x43bc6b];return _0x15df0e;}(function(_0x1d766a,_0x384e4b){const _0x315f58=a44_0x15df,_0xa539c1=_0x1d766a();while(!![]){try{const _0x3fdd9b=parseInt(_0x315f58(0x186))/0x1*(-parseInt(_0x315f58(0x1ab))/0x2)+parseInt(_0x315f58(0x1a8))/0x3+-parseInt(_0x315f58(0x1b6))/0x4+parseInt(_0x315f58(0x1bd))/0x5+-parseInt(_0x315f58(0x1a0))/0x6*(-parseInt(_0x315f58(0x18d))/0x7)+parseInt(_0x315f58(0x195))/0x8+-parseInt(_0x315f58(0x1b3))/0x9*(parseInt(_0x315f58(0x192))/0xa);if(_0x3fdd9b===_0x384e4b)break;else _0xa539c1['push'](_0xa539c1['shift']());}catch(_0x44909c){_0xa539c1['push'](_0xa539c1['shift']());}}}(a44_0x476e,0xe40c0));import{existsSync,statSync}from'fs';import a44_0x292f5f from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a44_0x2388d2(0x1b5)]=a44_0x2388d2(0x198);[a44_0x2388d2(0x1bf)]=a44_0x2388d2(0x184);async[a44_0x2388d2(0x1a2)](_0x472597){const _0x3aa862=a44_0x2388d2,{options:_0x2fbe3,args:_0x11284e,tdx:_0x532a1e}=_0x472597;if(_0x11284e[_0x3aa862(0x191)]===0x0)return console['error'](a44_0x292f5f[_0x3aa862(0x1a4)](_0x3aa862(0x1ba))),console[_0x3aa862(0x19a)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x3aa862(0x19a)](_0x3aa862(0x193)),console[_0x3aa862(0x19a)](_0x3aa862(0x1b1)),console[_0x3aa862(0x19a)](_0x3aa862(0x18c)),console['error'](_0x3aa862(0x194)),console['error'](_0x3aa862(0x197)),0x1;const _0x3e6487=_0x11284e[0x0],_0x8ce3e3=_0x2fbe3[_0x3aa862(0x1a1)];try{if(_0x3e6487==='/')return saveSessionContext({'segment_path':undefined},_0x8ce3e3),console[_0x3aa862(0x1a7)](a44_0x292f5f[_0x3aa862(0x1a5)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x3e6487)&&statSync(_0x3e6487)[_0x3aa862(0x19e)]()){let _0x454a96;try{_0x454a96=findTdxConfig(_0x3e6487);}catch{return console['error'](a44_0x292f5f[_0x3aa862(0x1a4)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x3e6487)),console['error'](a44_0x292f5f['cyan'](_0x3aa862(0x19c))),0x1;}const _0x5135e3=_0x454a96['config'][_0x3aa862(0x18e)];return saveSessionContext({'segment_path':_0x5135e3,'parent_segment':_0x5135e3},_0x8ce3e3),console[_0x3aa862(0x1a7)](a44_0x292f5f[_0x3aa862(0x1a5)](_0x3aa862(0x199)+a44_0x292f5f[_0x3aa862(0x1ad)](_0x5135e3))),0x0;}const _0x4237a3=_0x2fbe3[_0x3aa862(0x1b8)];let _0x39dc23=_0x3e6487;const _0x50a2e8=parsePath(_0x3e6487);if(!_0x50a2e8['isAbsolute']){if(!_0x4237a3)return console[_0x3aa862(0x19a)](a44_0x292f5f[_0x3aa862(0x1a4)](_0x3aa862(0x1bc))),console[_0x3aa862(0x19a)](a44_0x292f5f[_0x3aa862(0x1ad)](_0x3aa862(0x185))),0x1;if(_0x3e6487==='..'){const _0x1fbf70=_0x4237a3['split']('/')['slice'](0x0,-0x1)[_0x3aa862(0x19d)]('/');_0x39dc23=_0x1fbf70||'/';}else _0x3e6487==='.'?_0x39dc23=_0x4237a3:_0x39dc23=_0x4237a3+'/'+_0x3e6487;_0x2fbe3[_0x3aa862(0x1a9)]&&console[_0x3aa862(0x19a)]('Resolved\x20relative\x20path\x20to:\x20'+_0x39dc23);}if(_0x39dc23==='/'||_0x39dc23==='')return saveSessionContext({'segment_path':undefined},_0x8ce3e3),console[_0x3aa862(0x1a7)](a44_0x292f5f[_0x3aa862(0x1a5)](_0x3aa862(0x1b9))),0x0;_0x39dc23=normalizePath(_0x39dc23);const _0x4bcf94=parsePath(_0x39dc23)[_0x3aa862(0x196)];if(_0x4bcf94['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x8ce3e3),console[_0x3aa862(0x1a7)](a44_0x292f5f[_0x3aa862(0x1a5)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x2fbe3[_0x3aa862(0x1a9)]&&(console[_0x3aa862(0x19a)](_0x3aa862(0x1ae)+_0x2fbe3[_0x3aa862(0x187)]),console[_0x3aa862(0x19a)](_0x3aa862(0x1a6)+_0x39dc23));const _0xb2640a=await withSpinner(_0x3aa862(0x18a)+_0x39dc23+'\x27...',()=>_0x532a1e[_0x3aa862(0x1bb)][_0x3aa862(0x1b2)](_0x39dc23),{'verbose':_0x2fbe3[_0x3aa862(0x1a9)]}),_0x371cab=_0xb2640a[_0x3aa862(0x1aa)];_0x2fbe3[_0x3aa862(0x1a9)]&&(console[_0x3aa862(0x19a)](_0x3aa862(0x1b4)+_0x371cab[_0x3aa862(0x1b0)]),console[_0x3aa862(0x19a)](_0x3aa862(0x189)+_0x371cab[_0x3aa862(0x190)]),_0x371cab['folderId']&&console[_0x3aa862(0x19a)](_0x3aa862(0x18b)+_0x371cab['folderId']));if(_0x371cab[_0x3aa862(0x1b0)]==='segment')return console[_0x3aa862(0x19a)](a44_0x292f5f['red'](_0x3aa862(0x1be))),console[_0x3aa862(0x19a)](_0x3aa862(0x19f)),console[_0x3aa862(0x19a)](a44_0x292f5f['cyan'](_0x3aa862(0x188)+_0x371cab['parentName']+(_0x371cab[_0x3aa862(0x1b7)]?'/'+_0x371cab[_0x3aa862(0x1b7)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x371cab[_0x3aa862(0x1ac)],'parent_segment':_0x371cab[_0x3aa862(0x18f)]},_0x8ce3e3),console['log'](a44_0x292f5f['green']('✔\x20Context\x20set\x20to:\x20'+a44_0x292f5f['cyan'](_0x371cab[_0x3aa862(0x1ac)]))),_0x2fbe3[_0x3aa862(0x1a9)]&&(console['error'](a44_0x292f5f[_0x3aa862(0x19b)](_0x3aa862(0x1af))),console[_0x3aa862(0x19a)](a44_0x292f5f['dim'](_0x3aa862(0x1a3)))),0x0;}catch(_0x4a8f26){throw _0x4a8f26;}}}function a44_0x476e(){const _0x42aa46=['Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','description','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','1IEAUva','site','Use:\x20tdx\x20segment\x20use\x20','Parent\x20ID:\x20','Resolving\x20path\x20\x27','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','7YuxKdv','parent_segment','parentName','parentId','length','400mkjFTd','Examples:','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','3955640CdEQRK','segments','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','segment:use','✔\x20Context\x20set\x20to:\x20','error','dim','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','join','isDirectory','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','10677984WRfuaR','session','execute','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','red','green','Target\x20path:\x20','log','2699751vBgYoq','verbose','data','2488714OsfGxm','fullPath','cyan','Site:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','type','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','resolvePathToResource','243819yUbRIg','Resolved\x20path\x20type:\x20','name','5937708HUJlVM','folderPath','segmentPath','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20Path\x20is\x20required\x0a','segment','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','7862340HCYrbE'];a44_0x476e=function(){return _0x42aa46;};return a44_0x476e();}
@@ -1 +1 @@
1
- const a45_0x15feb6=a45_0x4d97;function a45_0x4d97(_0x3a8767,_0x2efee7){_0x3a8767=_0x3a8767-0x1b5;const _0x49de4d=a45_0x49de();let _0x4d9794=_0x49de4d[_0x3a8767];return _0x4d9794;}(function(_0x465246,_0x2d67bd){const _0x91bbaa=a45_0x4d97,_0x495e79=_0x465246();while(!![]){try{const _0x587fd6=parseInt(_0x91bbaa(0x1c4))/0x1*(-parseInt(_0x91bbaa(0x1e7))/0x2)+parseInt(_0x91bbaa(0x1bf))/0x3+-parseInt(_0x91bbaa(0x1c7))/0x4*(parseInt(_0x91bbaa(0x1b9))/0x5)+-parseInt(_0x91bbaa(0x1b8))/0x6+-parseInt(_0x91bbaa(0x1bc))/0x7+-parseInt(_0x91bbaa(0x1c6))/0x8*(-parseInt(_0x91bbaa(0x1e3))/0x9)+-parseInt(_0x91bbaa(0x1b7))/0xa*(-parseInt(_0x91bbaa(0x1d5))/0xb);if(_0x587fd6===_0x2d67bd)break;else _0x495e79['push'](_0x495e79['shift']());}catch(_0xfb0ff2){_0x495e79['push'](_0x495e79['shift']());}}}(a45_0x49de,0x6cf73));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a45_0x2bceee from'chalk';function a45_0x49de(){const _0x341024=['\x20file(s)\x20with\x20errors,\x20','warningCount','error','file','\x20valid','3191679ewmryw','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Validation\x20failed:\x20','):\x20','2HmEerZ','verbose','parentSegment','6692930ZuwFBg','5014272pcSEGh','105qNISUt','validCount','\x20warning(s)','3419423tkNxUx','errorCode','dim','2461482fixxgb','errors','length','\x20warning(s)\x20found','red','299125Nnmxyv','helpText','16vPQvIP','152132XfQELO','cwd','log','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20file(s)\x20valid','Error:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','.yml','Validate\x20segment\x20and\x20journey\x20YAML\x20files','targetDir','yellow','endsWith','green','warnings','22WbeqpM','.yaml','no_parent','valid','\x20error(s)','cyan','invalidCount','type','hasErrors'];a45_0x49de=function(){return _0x341024;};return a45_0x49de();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']='segment:validate';['description']=a45_0x15feb6(0x1cf);async['execute'](_0x4bff02){const _0x4dfa5b=a45_0x15feb6,{options:_0x404476,args:_0x1d0494}=_0x4bff02,_0x2e03b0=_0x404476,_0x1cc75c=await resolveTarget({'arg':_0x1d0494[0x0],'contextParent':_0x404476[_0x4dfa5b(0x1b6)],'cwd':process[_0x4dfa5b(0x1c8)]()});if(!isSuccessfulResolution(_0x1cc75c))return _0x1cc75c[_0x4dfa5b(0x1bd)]===_0x4dfa5b(0x1d7)?(console[_0x4dfa5b(0x1e0)](a45_0x2bceee['yellow'](_0x4dfa5b(0x1cd))),console[_0x4dfa5b(0x1e0)](_0x4dfa5b(0x1ca)),console[_0x4dfa5b(0x1e0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x4dfa5b(0x1e0)](_0x4dfa5b(0x1e4))):(console['error'](a45_0x2bceee['red'](_0x4dfa5b(0x1cc)+_0x1cc75c['message']+'\x0a')),_0x1cc75c[_0x4dfa5b(0x1c5)]&&console[_0x4dfa5b(0x1e0)](a45_0x2bceee[_0x4dfa5b(0x1da)](_0x1cc75c[_0x4dfa5b(0x1c5)]))),0x1;const _0xa29b67=_0x1cc75c[_0x4dfa5b(0x1d0)],_0x3ca7b3=_0x1cc75c[_0x4dfa5b(0x1dc)]===_0x4dfa5b(0x1e1)?_0x1cc75c['filePath']:undefined;if(!_0x3ca7b3&&!existsSync(_0xa29b67))return console['error'](a45_0x2bceee[_0x4dfa5b(0x1c3)]('Error:\x20Directory\x20not\x20found:\x20'+_0xa29b67+'\x0a')),0x1;let _0x4f7127;if(_0x3ca7b3){if(!_0x3ca7b3[_0x4dfa5b(0x1d2)](_0x4dfa5b(0x1ce))&&!_0x3ca7b3[_0x4dfa5b(0x1d2)](_0x4dfa5b(0x1d6)))return console['error'](a45_0x2bceee['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x3ca7b3+'\x0a')),0x1;_0x4f7127=[_0x3ca7b3];}else _0x4f7127=findYamlFiles(_0xa29b67);if(_0x4f7127[_0x4dfa5b(0x1c1)]===0x0)return console[_0x4dfa5b(0x1e0)](a45_0x2bceee['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0xa29b67+'\x0a')),0x1;const _0x5dc679=validateYamlFiles(_0x4f7127,_0xa29b67),_0x4f10d8=calculateSummary(_0x5dc679);for(const _0x5be9a6 of _0x5dc679){if(!isValidationResult(_0x5be9a6))continue;const {relativePath:_0x5686dd,source:_0x544927,result:_0x48ab0e,fileType:_0x2b8127}=_0x5be9a6,_0xda0df1=_0x2b8127;if(_0x48ab0e[_0x4dfa5b(0x1d8)]&&_0x48ab0e[_0x4dfa5b(0x1d4)][_0x4dfa5b(0x1c1)]===0x0)_0x2e03b0[_0x4dfa5b(0x1b5)]&&console['log'](a45_0x2bceee['green']('✔\x20'+_0x5686dd)+a45_0x2bceee['dim']('\x20('+_0xda0df1+')'));else _0x48ab0e[_0x4dfa5b(0x1d8)]?(console[_0x4dfa5b(0x1c9)](a45_0x2bceee['yellow']('⚠\x20'+_0x5686dd)+a45_0x2bceee[_0x4dfa5b(0x1be)]('\x20('+_0xda0df1+_0x4dfa5b(0x1e6)+_0x48ab0e[_0x4dfa5b(0x1d4)]['length']+_0x4dfa5b(0x1bb))),console[_0x4dfa5b(0x1c9)](formatValidationResult(_0x48ab0e,_0x544927,_0x5686dd))):(console[_0x4dfa5b(0x1c9)](a45_0x2bceee[_0x4dfa5b(0x1c3)]('✖\x20'+_0x5686dd)+a45_0x2bceee[_0x4dfa5b(0x1be)]('\x20('+_0xda0df1+_0x4dfa5b(0x1e6)+_0x48ab0e[_0x4dfa5b(0x1c0)][_0x4dfa5b(0x1c1)]+_0x4dfa5b(0x1d9))),console[_0x4dfa5b(0x1c9)](formatValidationResult(_0x48ab0e,_0x544927,_0x5686dd)));}return console['log'](''),_0x4f10d8[_0x4dfa5b(0x1dd)]?(console[_0x4dfa5b(0x1c9)](a45_0x2bceee[_0x4dfa5b(0x1c3)](_0x4dfa5b(0x1e5)+_0x4f10d8[_0x4dfa5b(0x1db)]+_0x4dfa5b(0x1de)+_0x4f10d8[_0x4dfa5b(0x1ba)]+_0x4dfa5b(0x1e2))),_0x4f10d8[_0x4dfa5b(0x1df)]>0x0&&console[_0x4dfa5b(0x1c9)](a45_0x2bceee['yellow'](_0x4f10d8['warningCount']+_0x4dfa5b(0x1c2))),0x1):(console[_0x4dfa5b(0x1c9)](a45_0x2bceee[_0x4dfa5b(0x1d3)]('✔\x20All\x20'+_0x4f10d8[_0x4dfa5b(0x1ba)]+_0x4dfa5b(0x1cb))),_0x4f10d8[_0x4dfa5b(0x1df)]>0x0&&console[_0x4dfa5b(0x1c9)](a45_0x2bceee[_0x4dfa5b(0x1d1)](_0x4f10d8[_0x4dfa5b(0x1df)]+'\x20warning(s)\x20found')),0x0);}}
1
+ function a45_0x1592(){const _0x2663fd=['segment:validate','file','helpText','filePath','warningCount','hasErrors','Validation\x20failed:\x20','red','1428752LwqPcS','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','\x20error(s)','✔\x20All\x20','dim','warnings','errorCode','\x20valid','354424CWBuyQ','1122975OLkydh','Validate\x20segment\x20and\x20journey\x20YAML\x20files','cyan','78eOmBRl','errors','Error:\x20','name','.yml','2022020OvSnPg','Error:\x20Directory\x20not\x20found:\x20','734683aYpdqF','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','no_parent','yellow','\x20warning(s)\x20found','\x20warning(s)','596096MRdFuL','10776pQhjBr','verbose','parentSegment','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','8523ZWiZFV','targetDir','cwd','log','validCount','endsWith','.yaml','description','error','green','length'];a45_0x1592=function(){return _0x2663fd;};return a45_0x1592();}const a45_0x458722=a45_0x29b1;function a45_0x29b1(_0x4912bf,_0x5c8b0f){_0x4912bf=_0x4912bf-0x118;const _0x1592fb=a45_0x1592();let _0x29b1ee=_0x1592fb[_0x4912bf];return _0x29b1ee;}(function(_0x18c8c2,_0x3a5ae6){const _0x10a2ab=a45_0x29b1,_0x8a6810=_0x18c8c2();while(!![]){try{const _0x597676=parseInt(_0x10a2ab(0x134))/0x1+parseInt(_0x10a2ab(0x121))/0x2+parseInt(_0x10a2ab(0x12a))/0x3+parseInt(_0x10a2ab(0x13a))/0x4+parseInt(_0x10a2ab(0x132))/0x5+parseInt(_0x10a2ab(0x12d))/0x6*(-parseInt(_0x10a2ab(0x129))/0x7)+parseInt(_0x10a2ab(0x13b))/0x8*(-parseInt(_0x10a2ab(0x13f))/0x9);if(_0x597676===_0x3a5ae6)break;else _0x8a6810['push'](_0x8a6810['shift']());}catch(_0x16c6b6){_0x8a6810['push'](_0x8a6810['shift']());}}}(a45_0x1592,0x6c26b));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a45_0x43d88a from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a45_0x458722(0x130)]=a45_0x458722(0x119);[a45_0x458722(0x146)]=a45_0x458722(0x12b);async['execute'](_0x172177){const _0x43ebd0=a45_0x458722,{options:_0x17ba36,args:_0x36435e}=_0x172177,_0x2ec958=_0x17ba36,_0x2bcbc9=await resolveTarget({'arg':_0x36435e[0x0],'contextParent':_0x17ba36[_0x43ebd0(0x13d)],'cwd':process[_0x43ebd0(0x141)]()});if(!isSuccessfulResolution(_0x2bcbc9))return _0x2bcbc9[_0x43ebd0(0x127)]===_0x43ebd0(0x136)?(console[_0x43ebd0(0x147)](a45_0x43d88a[_0x43ebd0(0x137)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x43ebd0(0x147)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x43ebd0(0x147)](_0x43ebd0(0x122)),console[_0x43ebd0(0x147)](_0x43ebd0(0x135))):(console[_0x43ebd0(0x147)](a45_0x43d88a[_0x43ebd0(0x120)](_0x43ebd0(0x12f)+_0x2bcbc9['message']+'\x0a')),_0x2bcbc9[_0x43ebd0(0x11b)]&&console[_0x43ebd0(0x147)](a45_0x43d88a[_0x43ebd0(0x12c)](_0x2bcbc9['helpText']))),0x1;const _0x4fe7d8=_0x2bcbc9[_0x43ebd0(0x140)],_0x442f29=_0x2bcbc9['type']===_0x43ebd0(0x11a)?_0x2bcbc9[_0x43ebd0(0x11c)]:undefined;if(!_0x442f29&&!existsSync(_0x4fe7d8))return console[_0x43ebd0(0x147)](a45_0x43d88a[_0x43ebd0(0x120)](_0x43ebd0(0x133)+_0x4fe7d8+'\x0a')),0x1;let _0x35e2d9;if(_0x442f29){if(!_0x442f29['endsWith'](_0x43ebd0(0x131))&&!_0x442f29[_0x43ebd0(0x144)](_0x43ebd0(0x145)))return console['error'](a45_0x43d88a[_0x43ebd0(0x120)](_0x43ebd0(0x13e)+_0x442f29+'\x0a')),0x1;_0x35e2d9=[_0x442f29];}else _0x35e2d9=findYamlFiles(_0x4fe7d8);if(_0x35e2d9[_0x43ebd0(0x118)]===0x0)return console[_0x43ebd0(0x147)](a45_0x43d88a['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4fe7d8+'\x0a')),0x1;const _0x2994b5=validateYamlFiles(_0x35e2d9,_0x4fe7d8),_0x1d1d53=calculateSummary(_0x2994b5);for(const _0x22fa6d of _0x2994b5){if(!isValidationResult(_0x22fa6d))continue;const {relativePath:_0x372fa6,source:_0x26b609,result:_0x5b3d2e,fileType:_0x129d33}=_0x22fa6d,_0x5ecaac=_0x129d33;if(_0x5b3d2e['valid']&&_0x5b3d2e[_0x43ebd0(0x126)][_0x43ebd0(0x118)]===0x0)_0x2ec958[_0x43ebd0(0x13c)]&&console[_0x43ebd0(0x142)](a45_0x43d88a[_0x43ebd0(0x148)]('✔\x20'+_0x372fa6)+a45_0x43d88a['dim']('\x20('+_0x5ecaac+')'));else _0x5b3d2e['valid']?(console[_0x43ebd0(0x142)](a45_0x43d88a['yellow']('⚠\x20'+_0x372fa6)+a45_0x43d88a[_0x43ebd0(0x125)]('\x20('+_0x5ecaac+'):\x20'+_0x5b3d2e[_0x43ebd0(0x126)][_0x43ebd0(0x118)]+_0x43ebd0(0x139))),console[_0x43ebd0(0x142)](formatValidationResult(_0x5b3d2e,_0x26b609,_0x372fa6))):(console['log'](a45_0x43d88a[_0x43ebd0(0x120)]('✖\x20'+_0x372fa6)+a45_0x43d88a['dim']('\x20('+_0x5ecaac+'):\x20'+_0x5b3d2e[_0x43ebd0(0x12e)][_0x43ebd0(0x118)]+_0x43ebd0(0x123))),console[_0x43ebd0(0x142)](formatValidationResult(_0x5b3d2e,_0x26b609,_0x372fa6)));}return console['log'](''),_0x1d1d53[_0x43ebd0(0x11e)]?(console[_0x43ebd0(0x142)](a45_0x43d88a[_0x43ebd0(0x120)](_0x43ebd0(0x11f)+_0x1d1d53['invalidCount']+'\x20file(s)\x20with\x20errors,\x20'+_0x1d1d53[_0x43ebd0(0x143)]+_0x43ebd0(0x128))),_0x1d1d53[_0x43ebd0(0x11d)]>0x0&&console[_0x43ebd0(0x142)](a45_0x43d88a['yellow'](_0x1d1d53['warningCount']+_0x43ebd0(0x138))),0x1):(console[_0x43ebd0(0x142)](a45_0x43d88a[_0x43ebd0(0x148)](_0x43ebd0(0x124)+_0x1d1d53[_0x43ebd0(0x143)]+'\x20file(s)\x20valid')),_0x1d1d53[_0x43ebd0(0x11d)]>0x0&&console[_0x43ebd0(0x142)](a45_0x43d88a[_0x43ebd0(0x137)](_0x1d1d53['warningCount']+_0x43ebd0(0x138))),0x0);}}
@@ -1 +1 @@
1
- const a46_0x35af50=a46_0x2a9f;(function(_0x36da26,_0x5b15d7){const _0x1a34f7=a46_0x2a9f,_0x210c5d=_0x36da26();while(!![]){try{const _0x5f150a=parseInt(_0x1a34f7(0xf7))/0x1+-parseInt(_0x1a34f7(0x12a))/0x2*(parseInt(_0x1a34f7(0xea))/0x3)+parseInt(_0x1a34f7(0x108))/0x4+parseInt(_0x1a34f7(0x126))/0x5+parseInt(_0x1a34f7(0xf2))/0x6+-parseInt(_0x1a34f7(0xf5))/0x7*(-parseInt(_0x1a34f7(0x115))/0x8)+-parseInt(_0x1a34f7(0xee))/0x9;if(_0x5f150a===_0x5b15d7)break;else _0x210c5d['push'](_0x210c5d['shift']());}catch(_0x4f87e7){_0x210c5d['push'](_0x210c5d['shift']());}}}(a46_0x322b,0x6a565));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a46_0x2a9f(_0x2e4c4e,_0xa56e2d){_0x2e4c4e=_0x2e4c4e-0xe2;const _0x322b0f=a46_0x322b();let _0x2a9fbb=_0x322b0f[_0x2e4c4e];return _0x2a9fbb;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a46_0x322b(){const _0xbe900a=['✔\x20Found\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','folder','/j/da','Parent\x20segment\x20context:\x20','journeyBundleName','execute','includes','Resolving\x20parent\x20segment\x20\x27','Error:\x20','listRecursive','List\x20folders\x20and\x20child\x20segments','Building\x20hierarchy\x20tree...','name','440588hWdReC','/e/','listUnified','children','dim','listWithPattern','✔\x20Built\x20tree\x20with\x20','folders','localeCompare','maxDepth','Folder/pattern\x20arg:\x20','\x20segment','Listing\x20folders,\x20segments,\x20and\x20journeys...','2672iIoGsK','segments','(not\x20set)','segment','log','Folder\x20ID:\x20','replace','data','/app/ps/','parentSegment','test',',\x20and\x20','jsonl','error','length','filter','\x5c$&','3535835dzzTOR','Resolving\x20path\x20\x27','Parent\x20ID:\x20','Site:\x20','5554QyyHSQ','(empty)','recursive','Error:\x20No\x20parent\x20segment\x20context\x20set.',']\x20matching\x20\x27','cause','folderId','\x27...','\x20folder','journey','listUnifiedWithJourneys','json','type','parentId','471oQtpMk','resolvePathToResource','message','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','17220825asgtLq','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','site','format','4831986ZouAYF','\x20journey','verbose','10829ftTYBZ','sort','645628pDCeAC','map','journeys'];a46_0x322b=function(){return _0xbe900a;};return a46_0x322b();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a46_0x3ebd03 from'chalk';export class SegmentsCommand extends BaseCommand{[a46_0x35af50(0x107)]=a46_0x35af50(0x116);['description']=a46_0x35af50(0x105);async[a46_0x35af50(0x100)](_0x202752){const _0x1eda4c=a46_0x35af50,{options:_0x163e94,args:_0x130ddc}=_0x202752,_0x4969e1=_0x163e94[_0x1eda4c(0x12c)],_0x1ebda1=_0x130ddc[0x0];try{const _0x5c5ffa=_0x163e94[_0x1eda4c(0x11e)];_0x163e94[_0x1eda4c(0xf4)]&&(console[_0x1eda4c(0x122)](_0x1eda4c(0x129)+_0x163e94[_0x1eda4c(0xf0)]),console[_0x1eda4c(0x122)](_0x1eda4c(0xfe)+(_0x5c5ffa||_0x1eda4c(0x117))),_0x1ebda1&&console[_0x1eda4c(0x122)](_0x1eda4c(0x112)+_0x1ebda1),_0x4969e1&&console[_0x1eda4c(0x122)]('Recursive\x20mode:\x20enabled'));if(!_0x5c5ffa)return console[_0x1eda4c(0x122)](_0x1eda4c(0x12d)),console['error'](''),console[_0x1eda4c(0x122)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x1eda4c(0x122)](_0x1eda4c(0xef)),console[_0x1eda4c(0x122)](_0x1eda4c(0xfb)),console[_0x1eda4c(0x122)](''),console[_0x1eda4c(0x122)](_0x1eda4c(0xed)),0x1;const _0x53991a=_0x1ebda1&&(_0x1ebda1[_0x1eda4c(0x101)]('*')||_0x1ebda1['includes']('?'));if(_0x53991a)return await this[_0x1eda4c(0x10d)](_0x202752,_0x5c5ffa,_0x1ebda1);const _0x34394f=_0x1ebda1?_0x5c5ffa+'/'+_0x1ebda1:_0x5c5ffa;return _0x4969e1?await this['listRecursive'](_0x202752,_0x34394f):await this[_0x1eda4c(0x10a)](_0x202752,_0x34394f);}catch(_0x41728a){if(_0x41728a instanceof SDKError)return console['error'](_0x1eda4c(0x103)+_0x41728a[_0x1eda4c(0xec)]),_0x41728a[_0x1eda4c(0x12f)]&&console['error']('\x20\x20Cause:\x20'+_0x41728a[_0x1eda4c(0x12f)]),0x1;throw _0x41728a;}}async[a46_0x35af50(0x10d)](_0x4fd4f1,_0x313c0d,_0x4563f3){const _0x3d6849=a46_0x35af50,{options:_0x87fb84,tdx:_0xdb3556}=_0x4fd4f1,_0x19f8a2=await withSpinner(_0x3d6849(0x102)+_0x313c0d+_0x3d6849(0xe3),()=>_0xdb3556[_0x3d6849(0x118)][_0x3d6849(0xeb)](_0x313c0d),{'verbose':_0x87fb84[_0x3d6849(0xf4)]}),_0x573cea=_0x19f8a2[_0x3d6849(0x11c)],_0x245e2f=await withSpinner(_0x3d6849(0x114),()=>_0xdb3556[_0x3d6849(0x118)][_0x3d6849(0xe6)](_0x573cea[_0x3d6849(0xe9)],_0x573cea[_0x3d6849(0xe2)]),{'verbose':_0x87fb84[_0x3d6849(0xf4)]}),{folders:_0x2c3b9f,segments:_0x1e4dbd,journeys:_0xa36aac}=_0x245e2f[_0x3d6849(0x11c)],_0x51fdad=_0x4563f3[_0x3d6849(0x11b)](/[.+^${}()|[\]\\]/g,_0x3d6849(0x125))[_0x3d6849(0x11b)](/\*/g,'.*')[_0x3d6849(0x11b)](/\?/g,'.'),_0x5bfcc9=new RegExp('^'+_0x51fdad+'$','i'),_0x46eaca=_0x2c3b9f['filter'](_0x3533ed=>_0x5bfcc9['test'](_0x3533ed[_0x3d6849(0x107)])),_0x26ee56=_0x1e4dbd[_0x3d6849(0x124)](_0x1785dd=>_0x5bfcc9[_0x3d6849(0x11f)](_0x1785dd[_0x3d6849(0x107)])),_0x188383=_0xa36aac[_0x3d6849(0x124)](_0x3149fd=>_0x5bfcc9[_0x3d6849(0x11f)](_0x3149fd[_0x3d6849(0xff)])),_0x40286b=_0x46eaca['length']+_0x26ee56['length']+_0x188383['length'];console['error'](_0x3d6849(0xfa)+_0x46eaca[_0x3d6849(0x123)]+_0x3d6849(0xe4)+(_0x46eaca[_0x3d6849(0x123)]!==0x1?'s':'')+',\x20'+_0x26ee56['length']+_0x3d6849(0x113)+(_0x26ee56[_0x3d6849(0x123)]!==0x1?'s':'')+_0x3d6849(0x120)+_0x188383[_0x3d6849(0x123)]+_0x3d6849(0xf3)+(_0x188383[_0x3d6849(0x123)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x4563f3+'\x27');const _0x413325=_0x3c4ce0=>{const _0x2ddc64=_0x3d6849;return getConsoleNextUrl(_0x87fb84[_0x2ddc64(0xf0)],_0x2ddc64(0x11d)+_0x573cea[_0x2ddc64(0xe9)]+_0x2ddc64(0x109)+_0x3c4ce0);},_0xaece65=_0x87fb84['format']==='json'||_0x87fb84[_0x3d6849(0xf1)]===_0x3d6849(0x121);if(_0xaece65){const _0x5f4bf0=[..._0x46eaca['map'](_0x37c0e5=>({..._0x37c0e5,'type':_0x3d6849(0xfc)})),..._0x26ee56[_0x3d6849(0xf8)](_0x154bbd=>({..._0x154bbd,'type':'segment','url':_0x413325(_0x154bbd['id'])})),..._0x188383[_0x3d6849(0xf8)](_0x1a0232=>({..._0x1a0232,'name':_0x1a0232[_0x3d6849(0xff)],'type':_0x3d6849(0xe5)}))][_0x3d6849(0xf6)]((_0xb929f9,_0xdbc829)=>_0xb929f9['name']['localeCompare'](_0xdbc829[_0x3d6849(0x107)]));await handleSDKOutput(_0x5f4bf0,_0x87fb84);}else{if(_0x40286b===0x0)console[_0x3d6849(0x119)]('No\x20items\x20match\x20pattern:\x20'+_0x4563f3);else{console[_0x3d6849(0x119)](a46_0x3ebd03['dim']('['+_0x313c0d+_0x3d6849(0x12e)+_0x4563f3+'\x27'));const _0x41dd66=formatFlatList(_0x46eaca,_0x26ee56,{'showMetadata':!![],'getSegmentUrl':_0x413325},_0x188383);console[_0x3d6849(0x119)](_0x41dd66);}}return 0x0;}async[a46_0x35af50(0x10a)](_0x402d2f,_0x5254fd){const _0xfb730c=a46_0x35af50,{options:_0xb17d49,tdx:_0x3911d9}=_0x402d2f,_0x2769a3=await withSpinner(_0xfb730c(0x127)+_0x5254fd+'\x27...',()=>_0x3911d9[_0xfb730c(0x118)]['resolvePathToResource'](_0x5254fd),{'verbose':_0xb17d49[_0xfb730c(0xf4)]}),_0x555e11=_0x2769a3['data'];_0xb17d49[_0xfb730c(0xf4)]&&(console[_0xfb730c(0x122)](_0xfb730c(0x128)+_0x555e11[_0xfb730c(0xe9)]),_0x555e11[_0xfb730c(0xe2)]&&console['error'](_0xfb730c(0x11a)+_0x555e11['folderId']));const _0x44f13b=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x3911d9[_0xfb730c(0x118)][_0xfb730c(0xe6)](_0x555e11['parentId'],_0x555e11['folderId']),{'verbose':_0xb17d49[_0xfb730c(0xf4)]}),{folders:_0x51fd0e,segments:_0x416214,journeys:_0x31cb6b}=_0x44f13b[_0xfb730c(0x11c)],_0x4b7978=_0x51fd0e[_0xfb730c(0x123)]+_0x416214[_0xfb730c(0x123)]+_0x31cb6b[_0xfb730c(0x123)];console[_0xfb730c(0x122)](_0xfb730c(0xfa)+_0x51fd0e[_0xfb730c(0x123)]+_0xfb730c(0xe4)+(_0x51fd0e[_0xfb730c(0x123)]!==0x1?'s':'')+',\x20'+_0x416214[_0xfb730c(0x123)]+'\x20segment'+(_0x416214[_0xfb730c(0x123)]!==0x1?'s':'')+_0xfb730c(0x120)+_0x31cb6b[_0xfb730c(0x123)]+_0xfb730c(0xf3)+(_0x31cb6b[_0xfb730c(0x123)]!==0x1?'s':''));const _0x43128a=_0x2b24f0=>{const _0x46bd5b=_0xfb730c;return getConsoleNextUrl(_0xb17d49[_0x46bd5b(0xf0)],_0x46bd5b(0x11d)+_0x555e11['parentId']+'/e/'+_0x2b24f0);},_0x9cb04f=_0x3b4dca=>{const _0x3e9944=_0xfb730c;return getConsoleNextUrl(_0xb17d49[_0x3e9944(0xf0)],_0x3e9944(0x11d)+_0x555e11[_0x3e9944(0xe9)]+_0x3e9944(0x109)+_0x3b4dca+'/j/da');},_0x2d5225=_0xb17d49[_0xfb730c(0xf1)]===_0xfb730c(0xe7)||_0xb17d49[_0xfb730c(0xf1)]===_0xfb730c(0x121);if(_0x2d5225){const _0x2b5bb1=[..._0x51fd0e['map'](_0x49eb56=>({..._0x49eb56,'type':'folder'})),..._0x416214[_0xfb730c(0xf8)](_0x10e269=>({..._0x10e269,'type':_0xfb730c(0x118),'url':_0x43128a(_0x10e269['id'])})),..._0x31cb6b[_0xfb730c(0xf8)](_0x1be6a1=>({..._0x1be6a1,'name':_0x1be6a1[_0xfb730c(0xff)],'type':_0xfb730c(0xe5),'url':_0x9cb04f(_0x1be6a1['id'])}))][_0xfb730c(0xf6)]((_0x3724d9,_0x3c7afd)=>_0x3724d9[_0xfb730c(0x107)][_0xfb730c(0x110)](_0x3c7afd[_0xfb730c(0x107)]));await handleSDKOutput(_0x2b5bb1,_0xb17d49);}else{if(_0x4b7978===0x0)console['log'](a46_0x3ebd03[_0xfb730c(0x10c)]('['+_0x5254fd+']')),console[_0xfb730c(0x119)](_0xfb730c(0x12b));else{console[_0xfb730c(0x119)](a46_0x3ebd03[_0xfb730c(0x10c)]('['+_0x5254fd+']'));const _0x3a82c7=formatFlatList(_0x51fd0e,_0x416214,{'showMetadata':!![],'getSegmentUrl':_0x43128a,'getJourneyUrl':_0x9cb04f},_0x31cb6b);console[_0xfb730c(0x119)](_0x3a82c7);}}return 0x0;}async['listRecursive'](_0x12b780,_0x1399ac){const _0x8f5414=a46_0x35af50,{options:_0x2f61ad,tdx:_0x81ef06}=_0x12b780,_0x14e342=await withSpinner('Resolving\x20path\x20\x27'+_0x1399ac+'\x27...',()=>_0x81ef06[_0x8f5414(0x118)][_0x8f5414(0xeb)](_0x1399ac),{'verbose':_0x2f61ad['verbose']}),_0x4076b1=_0x14e342['data'];_0x2f61ad[_0x8f5414(0xf4)]&&(console[_0x8f5414(0x122)](_0x8f5414(0x128)+_0x4076b1['parentId']),_0x4076b1['folderId']&&console['error'](_0x8f5414(0x11a)+_0x4076b1[_0x8f5414(0xe2)]));const _0x5e59a8=_0x2f61ad[_0x8f5414(0x111)]||0xa,_0x3a8773=await withSpinner(_0x8f5414(0x106),()=>_0x81ef06[_0x8f5414(0x118)][_0x8f5414(0x104)](_0x4076b1[_0x8f5414(0xe9)],_0x4076b1[_0x8f5414(0xe2)],0x0,_0x5e59a8),{'verbose':_0x2f61ad['verbose']}),_0x4c8162=_0x3a8773[_0x8f5414(0x11c)],_0x430af2=_0x5035bf=>{const _0x9b0aca=_0x8f5414;let _0xab4dad=0x0,_0x10798f=0x0,_0x1cadd2=0x0;for(const _0x167474 of _0x5035bf){if(_0x167474[_0x9b0aca(0xe8)]===_0x9b0aca(0xfc))_0xab4dad++;else{if(_0x167474[_0x9b0aca(0xe8)]===_0x9b0aca(0x118))_0x10798f++;else{if(_0x167474[_0x9b0aca(0xe8)]===_0x9b0aca(0xe5))_0x1cadd2++;}}if(_0x167474[_0x9b0aca(0x10b)]){const _0x572193=_0x430af2(_0x167474['children']);_0xab4dad+=_0x572193[_0x9b0aca(0x10f)],_0x10798f+=_0x572193[_0x9b0aca(0x116)],_0x1cadd2+=_0x572193[_0x9b0aca(0xf9)];}}return{'folders':_0xab4dad,'segments':_0x10798f,'journeys':_0x1cadd2};},_0x3be3db=_0x430af2(_0x4c8162);console['error'](_0x8f5414(0x10e)+_0x3be3db[_0x8f5414(0x10f)]+_0x8f5414(0xe4)+(_0x3be3db[_0x8f5414(0x10f)]!==0x1?'s':'')+',\x20'+_0x3be3db[_0x8f5414(0x116)]+'\x20segment'+(_0x3be3db[_0x8f5414(0x116)]!==0x1?'s':'')+_0x8f5414(0x120)+_0x3be3db['journeys']+_0x8f5414(0xf3)+(_0x3be3db[_0x8f5414(0xf9)]!==0x1?'s':''));const _0xcb253d=_0x23c664=>{const _0xeb1f76=_0x8f5414;return getConsoleNextUrl(_0x2f61ad[_0xeb1f76(0xf0)],_0xeb1f76(0x11d)+_0x4076b1[_0xeb1f76(0xe9)]+'/e/'+_0x23c664);},_0x193713=_0x2a7814=>{const _0x3b819f=_0x8f5414;return getConsoleNextUrl(_0x2f61ad[_0x3b819f(0xf0)],_0x3b819f(0x11d)+_0x4076b1[_0x3b819f(0xe9)]+'/e/'+_0x2a7814+_0x3b819f(0xfd));};if(_0x2f61ad[_0x8f5414(0xf1)]===_0x8f5414(0xe7)||_0x2f61ad[_0x8f5414(0xf1)]===_0x8f5414(0x121))await handleSDKOutput(_0x4c8162,_0x2f61ad);else{console[_0x8f5414(0x119)](a46_0x3ebd03['dim']('['+_0x1399ac+']'));const _0x2e017b=formatTree(_0x4c8162,{'showMetadata':!![],'getSegmentUrl':_0xcb253d,'getJourneyUrl':_0x193713});console[_0x8f5414(0x119)](_0x2e017b);}return 0x0;}}
1
+ const a46_0x5ac297=a46_0x597c;(function(_0x42a198,_0x1916e1){const _0x4a1e43=a46_0x597c,_0x3a4c63=_0x42a198();while(!![]){try{const _0x2ee785=-parseInt(_0x4a1e43(0x110))/0x1+-parseInt(_0x4a1e43(0xfb))/0x2+parseInt(_0x4a1e43(0x117))/0x3+-parseInt(_0x4a1e43(0xf6))/0x4*(-parseInt(_0x4a1e43(0x105))/0x5)+parseInt(_0x4a1e43(0x12e))/0x6*(parseInt(_0x4a1e43(0x107))/0x7)+-parseInt(_0x4a1e43(0x13e))/0x8*(-parseInt(_0x4a1e43(0x113))/0x9)+-parseInt(_0x4a1e43(0x136))/0xa;if(_0x2ee785===_0x1916e1)break;else _0x3a4c63['push'](_0x3a4c63['shift']());}catch(_0x580158){_0x3a4c63['push'](_0x3a4c63['shift']());}}}(a46_0x2e80,0xb8508));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a46_0x597c(_0x27296d,_0xecee80){_0x27296d=_0x27296d-0xf6;const _0x2e80d6=a46_0x2e80();let _0x597c4f=_0x2e80d6[_0x27296d];return _0x597c4f;}function a46_0x2e80(){const _0x319d44=['7884858cdshEz','test','verbose','filter','\x20matching\x20\x27',']\x20matching\x20\x27','Listing\x20folders,\x20segments,\x20and\x20journeys...','json','30938360ipDJOe','map','site','(not\x20set)','log','journey','Resolving\x20parent\x20segment\x20\x27','jsonl','21704ORsiUO','localeCompare','folders','773268drCoBK','listUnified','\x20segment','folderId','journeys','81134hRRhWr','maxDepth','sort','\x27...','/app/ps/','No\x20items\x20match\x20pattern:\x20','Site:\x20','type','Resolving\x20path\x20\x27',',\x20and\x20','5BviajV','dim','7tHDTxc','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x20journey','Parent\x20ID:\x20','Folder\x20ID:\x20','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','recursive','includes','format','216481iXnqJa','✔\x20Found\x20','segment','4815PAqhRA','listRecursive','Error:\x20','Set\x20a\x20parent\x20segment\x20context\x20first:','3440763iGqIzu','resolvePathToResource','replace','\x5c$&','\x20folder','listWithPattern','Error:\x20No\x20parent\x20segment\x20context\x20set.','/e/','children','error','journeyBundleName','parentId','\x20\x20Cause:\x20','segments','execute','folder','cause','description','name','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','length','data','Parent\x20segment\x20context:\x20'];a46_0x2e80=function(){return _0x319d44;};return a46_0x2e80();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a46_0x16eb20 from'chalk';export class SegmentsCommand extends BaseCommand{[a46_0x5ac297(0x129)]=a46_0x5ac297(0x124);[a46_0x5ac297(0x128)]='List\x20folders\x20and\x20child\x20segments';async[a46_0x5ac297(0x125)](_0x3c3564){const _0x3f75ea=a46_0x5ac297,{options:_0x3a1c66,args:_0x257384}=_0x3c3564,_0x3144b2=_0x3a1c66[_0x3f75ea(0x10d)],_0x2eb11f=_0x257384[0x0];try{const _0x599e51=_0x3a1c66['parentSegment'];_0x3a1c66[_0x3f75ea(0x130)]&&(console['error'](_0x3f75ea(0x101)+_0x3a1c66[_0x3f75ea(0x138)]),console[_0x3f75ea(0x120)](_0x3f75ea(0x12d)+(_0x599e51||_0x3f75ea(0x139))),_0x2eb11f&&console[_0x3f75ea(0x120)]('Folder/pattern\x20arg:\x20'+_0x2eb11f),_0x3144b2&&console[_0x3f75ea(0x120)]('Recursive\x20mode:\x20enabled'));if(!_0x599e51)return console[_0x3f75ea(0x120)](_0x3f75ea(0x11d)),console[_0x3f75ea(0x120)](''),console['error'](_0x3f75ea(0x116)),console[_0x3f75ea(0x120)](_0x3f75ea(0x12a)),console[_0x3f75ea(0x120)](_0x3f75ea(0x108)),console[_0x3f75ea(0x120)](''),console[_0x3f75ea(0x120)](_0x3f75ea(0x10c)),0x1;const _0x21ac55=_0x2eb11f&&(_0x2eb11f[_0x3f75ea(0x10e)]('*')||_0x2eb11f[_0x3f75ea(0x10e)]('?'));if(_0x21ac55)return await this[_0x3f75ea(0x11c)](_0x3c3564,_0x599e51,_0x2eb11f);const _0x33798d=_0x2eb11f?_0x599e51+'/'+_0x2eb11f:_0x599e51;return _0x3144b2?await this['listRecursive'](_0x3c3564,_0x33798d):await this[_0x3f75ea(0xf7)](_0x3c3564,_0x33798d);}catch(_0x52d878){if(_0x52d878 instanceof SDKError)return console['error'](_0x3f75ea(0x115)+_0x52d878['message']),_0x52d878[_0x3f75ea(0x127)]&&console['error'](_0x3f75ea(0x123)+_0x52d878['cause']),0x1;throw _0x52d878;}}async[a46_0x5ac297(0x11c)](_0x247df4,_0x1edc8e,_0x5849b3){const _0x491f66=a46_0x5ac297,{options:_0x1e0515,tdx:_0x3e856a}=_0x247df4,_0x499638=await withSpinner(_0x491f66(0x13c)+_0x1edc8e+_0x491f66(0xfe),()=>_0x3e856a['segment'][_0x491f66(0x118)](_0x1edc8e),{'verbose':_0x1e0515['verbose']}),_0x5240bb=_0x499638[_0x491f66(0x12c)],_0x45838c=await withSpinner(_0x491f66(0x134),()=>_0x3e856a[_0x491f66(0x112)]['listUnifiedWithJourneys'](_0x5240bb[_0x491f66(0x122)],_0x5240bb['folderId']),{'verbose':_0x1e0515[_0x491f66(0x130)]}),{folders:_0x1a555a,segments:_0x5708e4,journeys:_0x173090}=_0x45838c[_0x491f66(0x12c)],_0x3120f4=_0x5849b3[_0x491f66(0x119)](/[.+^${}()|[\]\\]/g,_0x491f66(0x11a))[_0x491f66(0x119)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1ada69=new RegExp('^'+_0x3120f4+'$','i'),_0x33c81d=_0x1a555a[_0x491f66(0x131)](_0x53a3d6=>_0x1ada69['test'](_0x53a3d6[_0x491f66(0x129)])),_0x279abf=_0x5708e4[_0x491f66(0x131)](_0x3b96f2=>_0x1ada69[_0x491f66(0x12f)](_0x3b96f2['name'])),_0x385ad6=_0x173090[_0x491f66(0x131)](_0xf3e10=>_0x1ada69[_0x491f66(0x12f)](_0xf3e10[_0x491f66(0x121)])),_0xb8b690=_0x33c81d[_0x491f66(0x12b)]+_0x279abf[_0x491f66(0x12b)]+_0x385ad6[_0x491f66(0x12b)];console['error'](_0x491f66(0x111)+_0x33c81d[_0x491f66(0x12b)]+_0x491f66(0x11b)+(_0x33c81d[_0x491f66(0x12b)]!==0x1?'s':'')+',\x20'+_0x279abf[_0x491f66(0x12b)]+'\x20segment'+(_0x279abf['length']!==0x1?'s':'')+',\x20and\x20'+_0x385ad6['length']+_0x491f66(0x109)+(_0x385ad6[_0x491f66(0x12b)]!==0x1?'s':'')+_0x491f66(0x132)+_0x5849b3+'\x27');const _0x4fb1cc=_0x37e809=>{const _0x238b10=_0x491f66;return getConsoleNextUrl(_0x1e0515[_0x238b10(0x138)],_0x238b10(0xff)+_0x5240bb[_0x238b10(0x122)]+_0x238b10(0x11e)+_0x37e809);},_0x42a740=_0x1e0515[_0x491f66(0x10f)]===_0x491f66(0x135)||_0x1e0515[_0x491f66(0x10f)]===_0x491f66(0x13d);if(_0x42a740){const _0x2e95fd=[..._0x33c81d['map'](_0x43cc96=>({..._0x43cc96,'type':_0x491f66(0x126)})),..._0x279abf[_0x491f66(0x137)](_0x5026bb=>({..._0x5026bb,'type':_0x491f66(0x112),'url':_0x4fb1cc(_0x5026bb['id'])})),..._0x385ad6[_0x491f66(0x137)](_0x30d931=>({..._0x30d931,'name':_0x30d931['journeyBundleName'],'type':_0x491f66(0x13b)}))]['sort']((_0x5d469a,_0x545736)=>_0x5d469a['name']['localeCompare'](_0x545736[_0x491f66(0x129)]));await handleSDKOutput(_0x2e95fd,_0x1e0515);}else{if(_0xb8b690===0x0)console[_0x491f66(0x13a)](_0x491f66(0x100)+_0x5849b3);else{console['log'](a46_0x16eb20['dim']('['+_0x1edc8e+_0x491f66(0x133)+_0x5849b3+'\x27'));const _0x2d9fe8=formatFlatList(_0x33c81d,_0x279abf,{'showMetadata':!![],'getSegmentUrl':_0x4fb1cc},_0x385ad6);console[_0x491f66(0x13a)](_0x2d9fe8);}}return 0x0;}async[a46_0x5ac297(0xf7)](_0x4b5768,_0x2d32de){const _0x1af8e8=a46_0x5ac297,{options:_0x4ba6b4,tdx:_0x5f0962}=_0x4b5768,_0x2572e5=await withSpinner(_0x1af8e8(0x103)+_0x2d32de+'\x27...',()=>_0x5f0962[_0x1af8e8(0x112)]['resolvePathToResource'](_0x2d32de),{'verbose':_0x4ba6b4[_0x1af8e8(0x130)]}),_0x34d3ce=_0x2572e5[_0x1af8e8(0x12c)];_0x4ba6b4[_0x1af8e8(0x130)]&&(console[_0x1af8e8(0x120)](_0x1af8e8(0x10a)+_0x34d3ce[_0x1af8e8(0x122)]),_0x34d3ce[_0x1af8e8(0xf9)]&&console[_0x1af8e8(0x120)](_0x1af8e8(0x10b)+_0x34d3ce[_0x1af8e8(0xf9)]));const _0x18398f=await withSpinner(_0x1af8e8(0x134),()=>_0x5f0962[_0x1af8e8(0x112)]['listUnifiedWithJourneys'](_0x34d3ce[_0x1af8e8(0x122)],_0x34d3ce[_0x1af8e8(0xf9)]),{'verbose':_0x4ba6b4[_0x1af8e8(0x130)]}),{folders:_0xc680ad,segments:_0x889b62,journeys:_0xda3738}=_0x18398f['data'],_0x20ffcb=_0xc680ad['length']+_0x889b62[_0x1af8e8(0x12b)]+_0xda3738['length'];console[_0x1af8e8(0x120)](_0x1af8e8(0x111)+_0xc680ad[_0x1af8e8(0x12b)]+_0x1af8e8(0x11b)+(_0xc680ad[_0x1af8e8(0x12b)]!==0x1?'s':'')+',\x20'+_0x889b62[_0x1af8e8(0x12b)]+_0x1af8e8(0xf8)+(_0x889b62[_0x1af8e8(0x12b)]!==0x1?'s':'')+_0x1af8e8(0x104)+_0xda3738['length']+_0x1af8e8(0x109)+(_0xda3738[_0x1af8e8(0x12b)]!==0x1?'s':''));const _0x7f67aa=_0xfe28a4=>{const _0x4a2281=_0x1af8e8;return getConsoleNextUrl(_0x4ba6b4[_0x4a2281(0x138)],_0x4a2281(0xff)+_0x34d3ce[_0x4a2281(0x122)]+_0x4a2281(0x11e)+_0xfe28a4);},_0x5cd429=_0x227f77=>{const _0x35070a=_0x1af8e8;return getConsoleNextUrl(_0x4ba6b4['site'],_0x35070a(0xff)+_0x34d3ce[_0x35070a(0x122)]+_0x35070a(0x11e)+_0x227f77+'/j/da');},_0x42194b=_0x4ba6b4[_0x1af8e8(0x10f)]===_0x1af8e8(0x135)||_0x4ba6b4[_0x1af8e8(0x10f)]===_0x1af8e8(0x13d);if(_0x42194b){const _0x46c195=[..._0xc680ad['map'](_0x2b699c=>({..._0x2b699c,'type':_0x1af8e8(0x126)})),..._0x889b62['map'](_0x498770=>({..._0x498770,'type':'segment','url':_0x7f67aa(_0x498770['id'])})),..._0xda3738[_0x1af8e8(0x137)](_0x5ebe53=>({..._0x5ebe53,'name':_0x5ebe53[_0x1af8e8(0x121)],'type':_0x1af8e8(0x13b),'url':_0x5cd429(_0x5ebe53['id'])}))][_0x1af8e8(0xfd)]((_0x94d398,_0x25db6d)=>_0x94d398['name'][_0x1af8e8(0x13f)](_0x25db6d[_0x1af8e8(0x129)]));await handleSDKOutput(_0x46c195,_0x4ba6b4);}else{if(_0x20ffcb===0x0)console[_0x1af8e8(0x13a)](a46_0x16eb20[_0x1af8e8(0x106)]('['+_0x2d32de+']')),console['log']('(empty)');else{console[_0x1af8e8(0x13a)](a46_0x16eb20[_0x1af8e8(0x106)]('['+_0x2d32de+']'));const _0x463fc6=formatFlatList(_0xc680ad,_0x889b62,{'showMetadata':!![],'getSegmentUrl':_0x7f67aa,'getJourneyUrl':_0x5cd429},_0xda3738);console[_0x1af8e8(0x13a)](_0x463fc6);}}return 0x0;}async[a46_0x5ac297(0x114)](_0x3e1bb1,_0x321f77){const _0x506ec8=a46_0x5ac297,{options:_0xb42654,tdx:_0x54b8af}=_0x3e1bb1,_0x3dc87d=await withSpinner(_0x506ec8(0x103)+_0x321f77+_0x506ec8(0xfe),()=>_0x54b8af['segment'][_0x506ec8(0x118)](_0x321f77),{'verbose':_0xb42654[_0x506ec8(0x130)]}),_0x550df0=_0x3dc87d[_0x506ec8(0x12c)];_0xb42654[_0x506ec8(0x130)]&&(console[_0x506ec8(0x120)](_0x506ec8(0x10a)+_0x550df0[_0x506ec8(0x122)]),_0x550df0['folderId']&&console[_0x506ec8(0x120)](_0x506ec8(0x10b)+_0x550df0['folderId']));const _0x3a567c=_0xb42654[_0x506ec8(0xfc)]||0xa,_0x51027b=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x54b8af[_0x506ec8(0x112)][_0x506ec8(0x114)](_0x550df0[_0x506ec8(0x122)],_0x550df0[_0x506ec8(0xf9)],0x0,_0x3a567c),{'verbose':_0xb42654[_0x506ec8(0x130)]}),_0x15156d=_0x51027b[_0x506ec8(0x12c)],_0x1bbbee=_0x1836e0=>{const _0x33b15e=_0x506ec8;let _0x3dc3da=0x0,_0x330087=0x0,_0x8dfdf8=0x0;for(const _0x40db41 of _0x1836e0){if(_0x40db41[_0x33b15e(0x102)]===_0x33b15e(0x126))_0x3dc3da++;else{if(_0x40db41[_0x33b15e(0x102)]===_0x33b15e(0x112))_0x330087++;else{if(_0x40db41[_0x33b15e(0x102)]===_0x33b15e(0x13b))_0x8dfdf8++;}}if(_0x40db41['children']){const _0x3d69fd=_0x1bbbee(_0x40db41[_0x33b15e(0x11f)]);_0x3dc3da+=_0x3d69fd[_0x33b15e(0x140)],_0x330087+=_0x3d69fd['segments'],_0x8dfdf8+=_0x3d69fd[_0x33b15e(0xfa)];}}return{'folders':_0x3dc3da,'segments':_0x330087,'journeys':_0x8dfdf8};},_0xff4ae9=_0x1bbbee(_0x15156d);console[_0x506ec8(0x120)]('✔\x20Built\x20tree\x20with\x20'+_0xff4ae9[_0x506ec8(0x140)]+_0x506ec8(0x11b)+(_0xff4ae9[_0x506ec8(0x140)]!==0x1?'s':'')+',\x20'+_0xff4ae9[_0x506ec8(0x124)]+_0x506ec8(0xf8)+(_0xff4ae9['segments']!==0x1?'s':'')+_0x506ec8(0x104)+_0xff4ae9['journeys']+_0x506ec8(0x109)+(_0xff4ae9[_0x506ec8(0xfa)]!==0x1?'s':''));const _0x2eb3e3=_0x2cbaea=>{const _0x407d6d=_0x506ec8;return getConsoleNextUrl(_0xb42654[_0x407d6d(0x138)],_0x407d6d(0xff)+_0x550df0[_0x407d6d(0x122)]+'/e/'+_0x2cbaea);},_0x56fdf4=_0x2d8299=>{const _0x35228f=_0x506ec8;return getConsoleNextUrl(_0xb42654[_0x35228f(0x138)],'/app/ps/'+_0x550df0[_0x35228f(0x122)]+'/e/'+_0x2d8299+'/j/da');};if(_0xb42654[_0x506ec8(0x10f)]===_0x506ec8(0x135)||_0xb42654[_0x506ec8(0x10f)]===_0x506ec8(0x13d))await handleSDKOutput(_0x15156d,_0xb42654);else{console[_0x506ec8(0x13a)](a46_0x16eb20[_0x506ec8(0x106)]('['+_0x321f77+']'));const _0x190012=formatTree(_0x15156d,{'showMetadata':!![],'getSegmentUrl':_0x2eb3e3,'getJourneyUrl':_0x56fdf4});console['log'](_0x190012);}return 0x0;}}
@@ -1 +1 @@
1
- const a47_0x42ebc7=a47_0xcd84;(function(_0xaac560,_0x2f0a3f){const _0x4ebc6d=a47_0xcd84,_0x29d769=_0xaac560();while(!![]){try{const _0x4659ee=-parseInt(_0x4ebc6d(0x124))/0x1*(parseInt(_0x4ebc6d(0x100))/0x2)+parseInt(_0x4ebc6d(0x10b))/0x3+parseInt(_0x4ebc6d(0x104))/0x4*(-parseInt(_0x4ebc6d(0x103))/0x5)+parseInt(_0x4ebc6d(0x122))/0x6*(-parseInt(_0x4ebc6d(0x101))/0x7)+-parseInt(_0x4ebc6d(0x108))/0x8+parseInt(_0x4ebc6d(0x10f))/0x9+parseInt(_0x4ebc6d(0x119))/0xa;if(_0x4659ee===_0x2f0a3f)break;else _0x29d769['push'](_0x29d769['shift']());}catch(_0x1535fb){_0x29d769['push'](_0x29d769['shift']());}}}(a47_0x1015,0x1e1d9));import{BaseCommand}from'./command.js';function a47_0xcd84(_0x37b8f2,_0x13a227){_0x37b8f2=_0x37b8f2-0x100;const _0x1015db=a47_0x1015();let _0xcd84a2=_0x1015db[_0x37b8f2];return _0xcd84a2;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a47_0x1015(){const _0x591f7f=['showTable','\x20from\x20','database','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Limit:\x20','3587100ZZEbir','args','table','site','error','limit','catalog','message','Usage:\x20tdx\x20show\x20<database.table>','760902CHvFlQ','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','1KijIWR','252164DmzroA','7fUOnJE','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','10HajzmS','29752WIcNBL','validate','data','verbose','1314488UIBKEJ','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Table:\x20','45858GCqeWC','show','...','length','1632987NFNCvd','\x20\x20Cause:\x20','Show\x20table\x20contents','Error:\x20','Querying\x20'];a47_0x1015=function(){return _0x591f7f;};return a47_0x1015();}export class ShowCommand extends BaseCommand{['name']=a47_0x42ebc7(0x10c);['description']=a47_0x42ebc7(0x111);async['execute'](_0x102aac){return this['showTable'](_0x102aac);}async[a47_0x42ebc7(0x114)](_0x291c26){const _0x3bd697=a47_0x42ebc7,{options:_0x528579,args:_0x17e508,tdx:_0x540275}=_0x291c26;let _0x472cbf;try{_0x472cbf=parseTableReference(_0x17e508[0x0]);const _0x3ef1de=_0x528579['database'];!_0x472cbf['database']&&_0x3ef1de&&(_0x472cbf[_0x3bd697(0x116)]=_0x3ef1de);const _0x5326a3=validateTableDescribeReference(_0x472cbf);if(_0x5326a3)return console['error']('Error:\x20'+_0x5326a3),console['error'](_0x3bd697(0x121)),console[_0x3bd697(0x11d)](_0x3bd697(0x102)),console[_0x3bd697(0x11d)](_0x3bd697(0x109)),0x1;}catch(_0x104b2f){return console[_0x3bd697(0x11d)](_0x3bd697(0x112)+_0x104b2f[_0x3bd697(0x120)]),console[_0x3bd697(0x11d)](_0x3bd697(0x121)),console['error'](_0x3bd697(0x102)),console[_0x3bd697(0x11d)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x1762e4=_0x472cbf[_0x3bd697(0x11f)],_0x4e6109=_0x472cbf[_0x3bd697(0x116)],_0x4a78ad=_0x472cbf[_0x3bd697(0x11b)],_0x2a2493=resolveLimit(_0x528579[_0x3bd697(0x11e)],DEFAULT_DISPLAY_LIMIT);try{_0x528579[_0x3bd697(0x107)]&&(console[_0x3bd697(0x11d)]('Site:\x20'+_0x528579[_0x3bd697(0x11c)]),_0x1762e4&&console['error']('Catalog:\x20'+_0x1762e4),console['error']('Database:\x20'+_0x4e6109),console[_0x3bd697(0x11d)](_0x3bd697(0x10a)+_0x4a78ad),console[_0x3bd697(0x11d)](_0x3bd697(0x118)+_0x2a2493));const _0x866ed5=_0x1762e4?_0x1762e4+'.'+_0x4e6109+'.'+_0x4a78ad:_0x4e6109+'.'+_0x4a78ad,_0x154e25=await withSpinner(_0x3bd697(0x113)+_0x866ed5+_0x3bd697(0x10d),()=>_0x540275['query']['showTable'](_0x4e6109,_0x4a78ad,_0x2a2493,_0x1762e4),{'verbose':_0x528579[_0x3bd697(0x107)]}),_0x37b4fc=_0x154e25['data'],_0x40f3e1=_0x37b4fc[_0x3bd697(0x106)];return _0x40f3e1['length']===0x0?console[_0x3bd697(0x11d)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x3bd697(0x11d)]('✔\x20Retrieved\x20'+_0x40f3e1[_0x3bd697(0x10e)]+'\x20row'+(_0x40f3e1[_0x3bd697(0x10e)]!==0x1?'s':'')+_0x3bd697(0x115)+_0x866ed5),await handleSDKOutput(_0x40f3e1,_0x528579),0x0;}catch(_0x10c316){if(_0x10c316 instanceof SDKError)return console[_0x3bd697(0x11d)](_0x3bd697(0x112)+_0x10c316[_0x3bd697(0x120)]),_0x10c316['cause']&&console[_0x3bd697(0x11d)](_0x3bd697(0x110)+_0x10c316['cause']),0x1;throw _0x10c316;}}[a47_0x42ebc7(0x105)](_0x1c90b2){const _0x49af56=a47_0x42ebc7;if(_0x1c90b2['args']['length']===0x0)return _0x49af56(0x123);if(_0x1c90b2[_0x49af56(0x11a)][_0x49af56(0x10e)]>0x1)return _0x49af56(0x117);return undefined;}}
1
+ const a47_0x255587=a47_0x19e2;(function(_0x2dfa09,_0x2ee421){const _0x37f859=a47_0x19e2,_0x4b2efa=_0x2dfa09();while(!![]){try{const _0x1e39ca=parseInt(_0x37f859(0xed))/0x1+-parseInt(_0x37f859(0xe1))/0x2+-parseInt(_0x37f859(0xd3))/0x3+parseInt(_0x37f859(0xf5))/0x4+-parseInt(_0x37f859(0xd7))/0x5*(-parseInt(_0x37f859(0xf6))/0x6)+-parseInt(_0x37f859(0xf2))/0x7+parseInt(_0x37f859(0xea))/0x8;if(_0x1e39ca===_0x2ee421)break;else _0x4b2efa['push'](_0x4b2efa['shift']());}catch(_0x15577a){_0x4b2efa['push'](_0x4b2efa['shift']());}}}(a47_0x1c50,0x7a319));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a47_0x19e2(_0x270701,_0x201e49){_0x270701=_0x270701-0xd2;const _0x1c50b1=a47_0x1c50();let _0x19e2db=_0x1c50b1[_0x270701];return _0x19e2db;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a47_0x1c50(){const _0x437fea=['query','Error:\x20','5714513KXkEUQ','table','error','3527912TUVVyz','4344keWyya','data','name','verbose','2729415fzNJzq','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Table:\x20','site','565MEMxeZ','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','showTable','cause','validate','Site:\x20','catalog','Database:\x20','limit','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','792188XBoQXN','Limit:\x20','Usage:\x20tdx\x20show\x20<database.table>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20row','database','\x20from\x20','length','Querying\x20','8086664IvZIzg','message','execute','648140WoUEwy','✔\x20Retrieved\x20','show'];a47_0x1c50=function(){return _0x437fea;};return a47_0x1c50();}export class ShowCommand extends BaseCommand{[a47_0x255587(0xf8)]=a47_0x255587(0xef);['description']='Show\x20table\x20contents';async[a47_0x255587(0xec)](_0x256335){const _0x4554ac=a47_0x255587;return this[_0x4554ac(0xd9)](_0x256335);}async[a47_0x255587(0xd9)](_0x4f2f32){const _0x30de19=a47_0x255587,{options:_0x2e0f37,args:_0x14071b,tdx:_0x5407ff}=_0x4f2f32;let _0x310d02;try{_0x310d02=parseTableReference(_0x14071b[0x0]);const _0x351544=_0x2e0f37[_0x30de19(0xe6)];!_0x310d02[_0x30de19(0xe6)]&&_0x351544&&(_0x310d02[_0x30de19(0xe6)]=_0x351544);const _0x30a7e2=validateTableDescribeReference(_0x310d02);if(_0x30a7e2)return console['error'](_0x30de19(0xf1)+_0x30a7e2),console[_0x30de19(0xf4)](_0x30de19(0xe3)),console[_0x30de19(0xf4)](_0x30de19(0xe0)),console[_0x30de19(0xf4)](_0x30de19(0xd8)),0x1;}catch(_0x51c959){return console[_0x30de19(0xf4)](_0x30de19(0xf1)+_0x51c959[_0x30de19(0xeb)]),console['error'](_0x30de19(0xe3)),console[_0x30de19(0xf4)](_0x30de19(0xe0)),console[_0x30de19(0xf4)](_0x30de19(0xd8)),0x1;}const _0x48b62c=_0x310d02[_0x30de19(0xdd)],_0x32e75a=_0x310d02[_0x30de19(0xe6)],_0x1c98dd=_0x310d02[_0x30de19(0xf3)],_0x23f15e=resolveLimit(_0x2e0f37[_0x30de19(0xdf)],DEFAULT_DISPLAY_LIMIT);try{_0x2e0f37['verbose']&&(console[_0x30de19(0xf4)](_0x30de19(0xdc)+_0x2e0f37[_0x30de19(0xd6)]),_0x48b62c&&console['error']('Catalog:\x20'+_0x48b62c),console[_0x30de19(0xf4)](_0x30de19(0xde)+_0x32e75a),console[_0x30de19(0xf4)](_0x30de19(0xd5)+_0x1c98dd),console[_0x30de19(0xf4)](_0x30de19(0xe2)+_0x23f15e));const _0x37157b=_0x48b62c?_0x48b62c+'.'+_0x32e75a+'.'+_0x1c98dd:_0x32e75a+'.'+_0x1c98dd,_0x26c4d5=await withSpinner(_0x30de19(0xe9)+_0x37157b+'...',()=>_0x5407ff[_0x30de19(0xf0)][_0x30de19(0xd9)](_0x32e75a,_0x1c98dd,_0x23f15e,_0x48b62c),{'verbose':_0x2e0f37[_0x30de19(0xd2)]}),_0x12952b=_0x26c4d5[_0x30de19(0xf7)],_0x4ac4f1=_0x12952b[_0x30de19(0xf7)];return _0x4ac4f1['length']===0x0?console[_0x30de19(0xf4)](_0x30de19(0xe4)):console['error'](_0x30de19(0xee)+_0x4ac4f1['length']+_0x30de19(0xe5)+(_0x4ac4f1[_0x30de19(0xe8)]!==0x1?'s':'')+_0x30de19(0xe7)+_0x37157b),await handleSDKOutput(_0x4ac4f1,_0x2e0f37),0x0;}catch(_0x48a6f3){if(_0x48a6f3 instanceof SDKError)return console['error']('Error:\x20'+_0x48a6f3[_0x30de19(0xeb)]),_0x48a6f3[_0x30de19(0xda)]&&console[_0x30de19(0xf4)]('\x20\x20Cause:\x20'+_0x48a6f3[_0x30de19(0xda)]),0x1;throw _0x48a6f3;}}[a47_0x255587(0xdb)](_0x3ca0ed){const _0x64fd97=a47_0x255587;if(_0x3ca0ed['args'][_0x64fd97(0xe8)]===0x0)return _0x64fd97(0xd4);if(_0x3ca0ed['args'][_0x64fd97(0xe8)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}
@@ -1 +1 @@
1
- const a48_0x4f84f6=a48_0x3705;(function(_0x2eeff0,_0x4faaa4){const _0x399dbe=a48_0x3705,_0x3cbe64=_0x2eeff0();while(!![]){try{const _0x1b8ff6=-parseInt(_0x399dbe(0x1f8))/0x1*(-parseInt(_0x399dbe(0x1ee))/0x2)+-parseInt(_0x399dbe(0x205))/0x3+-parseInt(_0x399dbe(0x1f0))/0x4*(-parseInt(_0x399dbe(0x1e8))/0x5)+-parseInt(_0x399dbe(0x20e))/0x6+parseInt(_0x399dbe(0x219))/0x7*(-parseInt(_0x399dbe(0x1fd))/0x8)+-parseInt(_0x399dbe(0x1f1))/0x9+parseInt(_0x399dbe(0x202))/0xa;if(_0x1b8ff6===_0x4faaa4)break;else _0x3cbe64['push'](_0x3cbe64['shift']());}catch(_0x29af21){_0x3cbe64['push'](_0x3cbe64['shift']());}}}(a48_0x45f7,0xc4643));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a48_0x587ab9 from'chalk';function a48_0x45f7(){const _0x62ed9c=['green','yellow','status','message','profile','CLI\x20flag','506962NviDJm','cyan','env','account_id','site:\x20','5350280yLiigu','Name:','User:','N/A','config','25416460opkbLQ','log','getUserInfo','600114euVEFA','email','session','profileSource','cli','description','Read\x20credential\x20from\x20','first_name','red','9250368QuAUwR','✗\x20Validation\x20failed:\x20','Account\x20ID:','Show\x20authentication\x20status\x20and\x20current\x20context','(from\x20','✓\x20Authentication\x20successful\x0a','join','TDX_PROFILE\x20env','site','bold','jobs','14JpwptB','name','2063810IrCChJ','displayWithSources','Credential\x20type:\x20','\x20profile:\x20','error','dim','4CYYPwN','tdx','8OYZpFf','4476051QxfpFP'];a48_0x45f7=function(){return _0x62ed9c;};return a48_0x45f7();}function a48_0x3705(_0x4506ed,_0x45965c){_0x4506ed=_0x4506ed-0x1e8;const _0x45f7e6=a48_0x45f7();let _0x3705da=_0x45f7e6[_0x4506ed];return _0x3705da;}export class StatusCommand extends BaseCommand{[a48_0x4f84f6(0x21a)]=a48_0x4f84f6(0x1f4);[a48_0x4f84f6(0x20a)]=a48_0x4f84f6(0x211);async['execute'](_0x1585b8){const _0x50a256=a48_0x4f84f6,{options:_0x315024,tdx:_0x4ea012}=_0x1585b8,_0x4b00aa=_0x315024[_0x50a256(0x216)],_0x4a59f2=new GlobalContext(_0x315024),_0x1b239e=_0x4a59f2[_0x50a256(0x1f6)],_0x17ecad=_0x4a59f2[_0x50a256(0x208)],_0x33a332=_0x17ecad===_0x50a256(0x209)?_0x50a256(0x1f7):_0x17ecad===_0x50a256(0x207)?_0x50a256(0x207):_0x17ecad===_0x50a256(0x1fa)?_0x50a256(0x215):_0x17ecad==='config'?_0x50a256(0x201):null,_0x2414db=_0x1b239e?a48_0x587ab9[_0x50a256(0x1f9)](_0x1b239e):a48_0x587ab9[_0x50a256(0x1ed)](_0x50a256(0x200)),_0x4c04f8=_0x33a332?'\x20'+a48_0x587ab9[_0x50a256(0x1ed)](_0x50a256(0x212)+_0x33a332+')'):'';console[_0x50a256(0x203)](a48_0x587ab9[_0x50a256(0x217)](_0x50a256(0x1ef))+_0x50a256(0x1eb)+_0x2414db+_0x4c04f8+'\x20'+a48_0x587ab9[_0x50a256(0x1ed)]('(')+_0x50a256(0x1fc)+a48_0x587ab9[_0x50a256(0x1f9)](_0x4b00aa)+a48_0x587ab9[_0x50a256(0x1ed)](')'));const _0x53a8a9=await getOAuthTokens(_0x1b239e);if(_0x53a8a9)console['log'](_0x50a256(0x1ea)+a48_0x587ab9[_0x50a256(0x1f9)]('OAuth'));else{const _0x182bc8=await resolveAPIKeyAsync(_0x4b00aa,_0x1b239e);if(_0x182bc8){const {source:_0x586475,isDeprecated:_0x3a2cc9}=_0x182bc8,_0x14ca47=_0x50a256(0x20b)+a48_0x587ab9[_0x50a256(0x1f9)](_0x586475);console['log'](_0x3a2cc9?a48_0x587ab9['yellow'](_0x14ca47):_0x14ca47);}else console[_0x50a256(0x203)](a48_0x587ab9[_0x50a256(0x1f3)]('No\x20credential\x20found'));}let _0x59daf9=![];try{const _0x39f272=await _0x4ea012[_0x50a256(0x218)][_0x50a256(0x204)]();console['log'](a48_0x587ab9[_0x50a256(0x1f2)](_0x50a256(0x213))),console[_0x50a256(0x203)](a48_0x587ab9[_0x50a256(0x217)](_0x50a256(0x1ff))+'\x20'+a48_0x587ab9[_0x50a256(0x1f9)](_0x39f272[_0x50a256(0x206)]));if(_0x39f272[_0x50a256(0x20c)]||_0x39f272['last_name']){const _0x2ba291=[_0x39f272[_0x50a256(0x20c)],_0x39f272['last_name']]['filter'](Boolean)[_0x50a256(0x214)]('\x20');console[_0x50a256(0x203)](a48_0x587ab9[_0x50a256(0x217)](_0x50a256(0x1fe))+'\x20'+_0x2ba291);}_0x39f272[_0x50a256(0x1fb)]&&console[_0x50a256(0x203)](a48_0x587ab9[_0x50a256(0x217)](_0x50a256(0x210))+'\x20'+a48_0x587ab9[_0x50a256(0x1f3)](_0x39f272['account_id'])),_0x59daf9=!![];}catch(_0x34211f){_0x34211f instanceof HTTPClientError&&_0x34211f[_0x50a256(0x1f4)]===0x191?printAuthError(_0x34211f,!![],_0x1b239e):console[_0x50a256(0x1ec)](a48_0x587ab9[_0x50a256(0x20d)](_0x50a256(0x20f)+(_0x34211f instanceof Error?_0x34211f[_0x50a256(0x1f5)]:String(_0x34211f))));}return console[_0x50a256(0x203)](),_0x4a59f2[_0x50a256(0x1e9)](),_0x59daf9?0x0:0x1;}}
1
+ const a48_0x1c9230=a48_0x4eca;(function(_0x22c4ed,_0x3a1fba){const _0x2da663=a48_0x4eca,_0x3044a5=_0x22c4ed();while(!![]){try{const _0x505681=parseInt(_0x2da663(0x1eb))/0x1*(parseInt(_0x2da663(0x20a))/0x2)+-parseInt(_0x2da663(0x206))/0x3*(-parseInt(_0x2da663(0x1ef))/0x4)+-parseInt(_0x2da663(0x1f0))/0x5+-parseInt(_0x2da663(0x1ec))/0x6+parseInt(_0x2da663(0x1ed))/0x7+-parseInt(_0x2da663(0x20d))/0x8+-parseInt(_0x2da663(0x1f9))/0x9*(-parseInt(_0x2da663(0x20b))/0xa);if(_0x505681===_0x3a1fba)break;else _0x3044a5['push'](_0x3044a5['shift']());}catch(_0x18679c){_0x3044a5['push'](_0x3044a5['shift']());}}}(a48_0x527f,0x93feb));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a48_0x527f(){const _0x2fe4f3=['displayWithSources','14SkaiSx','963580boOVyW','first_name','8894552sckkbh','bold','error','red','email','execute','Account\x20ID:','N/A','User:','Read\x20credential\x20from\x20','profile','dim','cyan','173170hPifrL','3572430HghhmC','6347915gQfEUH','log','4PNvHAP','3400270GCwNdY','CLI\x20flag','tdx','\x20profile:\x20','site:\x20','yellow','account_id','Name:','getUserInfo','18mlWcgA','message','last_name','Credential\x20type:\x20','site','cli','name','description','config','status','OAuth','filter','No\x20credential\x20found','2045142zRqYIO','jobs','session'];a48_0x527f=function(){return _0x2fe4f3;};return a48_0x527f();}import a48_0x5f5d36 from'chalk';function a48_0x4eca(_0x3995e4,_0x3a4d04){_0x3995e4=_0x3995e4-0x1e2;const _0x527f06=a48_0x527f();let _0x4eca2d=_0x527f06[_0x3995e4];return _0x4eca2d;}export class StatusCommand extends BaseCommand{[a48_0x1c9230(0x1ff)]=a48_0x1c9230(0x202);[a48_0x1c9230(0x200)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a48_0x1c9230(0x1e3)](_0x3aa995){const _0x4136c5=a48_0x1c9230,{options:_0x4829ed,tdx:_0x411ad1}=_0x3aa995,_0x5a95c2=_0x4829ed[_0x4136c5(0x1fd)],_0x262145=new GlobalContext(_0x4829ed),_0x2c33ae=_0x262145[_0x4136c5(0x1e8)],_0x40d18a=_0x262145['profileSource'],_0x3b24d6=_0x40d18a===_0x4136c5(0x1fe)?_0x4136c5(0x1f1):_0x40d18a===_0x4136c5(0x208)?_0x4136c5(0x208):_0x40d18a==='env'?'TDX_PROFILE\x20env':_0x40d18a===_0x4136c5(0x201)?_0x4136c5(0x201):null,_0x4de0a5=_0x2c33ae?a48_0x5f5d36['cyan'](_0x2c33ae):a48_0x5f5d36[_0x4136c5(0x1e9)](_0x4136c5(0x1e5)),_0xa32156=_0x3b24d6?'\x20'+a48_0x5f5d36[_0x4136c5(0x1e9)]('(from\x20'+_0x3b24d6+')'):'';console[_0x4136c5(0x1ee)](a48_0x5f5d36[_0x4136c5(0x20e)](_0x4136c5(0x1f2))+_0x4136c5(0x1f3)+_0x4de0a5+_0xa32156+'\x20'+a48_0x5f5d36['dim']('(')+_0x4136c5(0x1f4)+a48_0x5f5d36[_0x4136c5(0x1ea)](_0x5a95c2)+a48_0x5f5d36[_0x4136c5(0x1e9)](')'));const _0x50a87b=await getOAuthTokens(_0x2c33ae);if(_0x50a87b)console[_0x4136c5(0x1ee)](_0x4136c5(0x1fc)+a48_0x5f5d36[_0x4136c5(0x1ea)](_0x4136c5(0x203)));else{const _0x31a6f4=await resolveAPIKeyAsync(_0x5a95c2,_0x2c33ae);if(_0x31a6f4){const {source:_0x416c50,isDeprecated:_0x2d1da1}=_0x31a6f4,_0x13e7cd=_0x4136c5(0x1e7)+a48_0x5f5d36[_0x4136c5(0x1ea)](_0x416c50);console[_0x4136c5(0x1ee)](_0x2d1da1?a48_0x5f5d36[_0x4136c5(0x1f5)](_0x13e7cd):_0x13e7cd);}else console[_0x4136c5(0x1ee)](a48_0x5f5d36['yellow'](_0x4136c5(0x205)));}let _0x2b5a95=![];try{const _0x29dbf5=await _0x411ad1[_0x4136c5(0x207)][_0x4136c5(0x1f8)]();console[_0x4136c5(0x1ee)](a48_0x5f5d36['green']('✓\x20Authentication\x20successful\x0a')),console[_0x4136c5(0x1ee)](a48_0x5f5d36[_0x4136c5(0x20e)](_0x4136c5(0x1e6))+'\x20'+a48_0x5f5d36['cyan'](_0x29dbf5[_0x4136c5(0x1e2)]));if(_0x29dbf5[_0x4136c5(0x20c)]||_0x29dbf5['last_name']){const _0x629dac=[_0x29dbf5['first_name'],_0x29dbf5[_0x4136c5(0x1fb)]][_0x4136c5(0x204)](Boolean)['join']('\x20');console[_0x4136c5(0x1ee)](a48_0x5f5d36[_0x4136c5(0x20e)](_0x4136c5(0x1f7))+'\x20'+_0x629dac);}_0x29dbf5[_0x4136c5(0x1f6)]&&console[_0x4136c5(0x1ee)](a48_0x5f5d36[_0x4136c5(0x20e)](_0x4136c5(0x1e4))+'\x20'+a48_0x5f5d36[_0x4136c5(0x1f5)](_0x29dbf5[_0x4136c5(0x1f6)])),_0x2b5a95=!![];}catch(_0x444e7b){_0x444e7b instanceof HTTPClientError&&_0x444e7b['status']===0x191?printAuthError(_0x444e7b,!![],_0x2c33ae):console[_0x4136c5(0x20f)](a48_0x5f5d36[_0x4136c5(0x210)]('✗\x20Validation\x20failed:\x20'+(_0x444e7b instanceof Error?_0x444e7b[_0x4136c5(0x1fa)]:String(_0x444e7b))));}return console['log'](),_0x262145[_0x4136c5(0x209)](),_0x2b5a95?0x0:0x1;}}