@treasuredata/tdx 2026.9.2 → 2026.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/ai-usage-command-base.js +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/auth-command.d.ts.map +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-command.js.map +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-journey-command.d.ts +34 -0
  17. package/dist/commands/cas-journey-command.d.ts.map +1 -0
  18. package/dist/commands/cas-journey-command.js +1 -0
  19. package/dist/commands/cas-journey-command.js.map +1 -0
  20. package/dist/commands/cas-segment-command.js +1 -1
  21. package/dist/commands/chat-command.js +1 -1
  22. package/dist/commands/claude-command.d.ts +11 -0
  23. package/dist/commands/claude-command.d.ts.map +1 -1
  24. package/dist/commands/claude-command.js +1 -1
  25. package/dist/commands/claude-command.js.map +1 -1
  26. package/dist/commands/claude-statusline-command.js +1 -1
  27. package/dist/commands/claude-usage-command.js +1 -1
  28. package/dist/commands/codex-command.d.ts.map +1 -1
  29. package/dist/commands/codex-command.js +1 -1
  30. package/dist/commands/codex-command.js.map +1 -1
  31. package/dist/commands/command.js +1 -1
  32. package/dist/commands/connection-command.js +1 -1
  33. package/dist/commands/databases.js +1 -1
  34. package/dist/commands/delivery-command.js +1 -1
  35. package/dist/commands/describe.js +1 -1
  36. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  37. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  38. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  39. package/dist/commands/engage-campaign-pull-command.js +1 -1
  40. package/dist/commands/engage-campaign-push-command.js +1 -1
  41. package/dist/commands/engage-campaign-readiness-command.js +1 -1
  42. package/dist/commands/engage-campaign-validate-command.js +1 -1
  43. package/dist/commands/engage-command.js +1 -1
  44. package/dist/commands/engage-in-browser-message-command.js +1 -1
  45. package/dist/commands/engage-landing-page-command.js +1 -1
  46. package/dist/commands/engage-template-pull-command.js +1 -1
  47. package/dist/commands/engage-template-push-command.js +1 -1
  48. package/dist/commands/engage-template-validate-command.js +1 -1
  49. package/dist/commands/engage-workspace-assignment-command.js +1 -1
  50. package/dist/commands/job-command.js +1 -1
  51. package/dist/commands/journey-command.d.ts +46 -0
  52. package/dist/commands/journey-command.d.ts.map +1 -1
  53. package/dist/commands/journey-command.js +1 -1
  54. package/dist/commands/journey-command.js.map +1 -1
  55. package/dist/commands/journey-validate-command.js +1 -1
  56. package/dist/commands/llm-command.js +1 -1
  57. package/dist/commands/mcp-command.js +1 -1
  58. package/dist/commands/opencode-command.d.ts +25 -0
  59. package/dist/commands/opencode-command.d.ts.map +1 -1
  60. package/dist/commands/opencode-command.js +1 -1
  61. package/dist/commands/opencode-command.js.map +1 -1
  62. package/dist/commands/opencode-usage-command.js +1 -1
  63. package/dist/commands/p13n-command.js +1 -1
  64. package/dist/commands/parent-segment-command.js +1 -1
  65. package/dist/commands/policy-command.js +1 -1
  66. package/dist/commands/profile-command.js +1 -1
  67. package/dist/commands/profiles-command.js +1 -1
  68. package/dist/commands/query-command.js +1 -1
  69. package/dist/commands/schedule-command.js +1 -1
  70. package/dist/commands/segment-command.js +1 -1
  71. package/dist/commands/segment-create-command.js +1 -1
  72. package/dist/commands/segment-fields-command.js +1 -1
  73. package/dist/commands/segment-move-command.js +1 -1
  74. package/dist/commands/segment-pull-command.js +1 -1
  75. package/dist/commands/segment-push-command.js +1 -1
  76. package/dist/commands/segment-update-command.js +1 -1
  77. package/dist/commands/segment-use-command.js +1 -1
  78. package/dist/commands/segment-validate-command.js +1 -1
  79. package/dist/commands/segments.js +1 -1
  80. package/dist/commands/show.js +1 -1
  81. package/dist/commands/status-command.js +1 -1
  82. package/dist/commands/table-deleted.js +1 -1
  83. package/dist/commands/tables.js +1 -1
  84. package/dist/commands/unset-command.js +1 -1
  85. package/dist/commands/upgrade-command.js +1 -1
  86. package/dist/commands/use-command.js +1 -1
  87. package/dist/commands/user-command.js +1 -1
  88. package/dist/commands/work-command.js +1 -1
  89. package/dist/commands/workflow-command.js +1 -1
  90. package/dist/core/auth.d.ts +10 -1
  91. package/dist/core/auth.d.ts.map +1 -1
  92. package/dist/core/auth.js +1 -1
  93. package/dist/core/auth.js.map +1 -1
  94. package/dist/core/command-output.js +1 -1
  95. package/dist/core/config.js +1 -1
  96. package/dist/core/connection-cache.js +1 -1
  97. package/dist/core/constants.js +1 -1
  98. package/dist/core/credential-cache.js +1 -1
  99. package/dist/core/global-context.js +1 -1
  100. package/dist/core/keychain.js +1 -1
  101. package/dist/core/oauth-keychain.js +1 -1
  102. package/dist/core/oauth.js +1 -1
  103. package/dist/core/profile.js +1 -1
  104. package/dist/core/project-config.js +1 -1
  105. package/dist/core/session.js +1 -1
  106. package/dist/core/site-mismatch.js +1 -1
  107. package/dist/core/user-cache.js +1 -1
  108. package/dist/core/version.js +1 -1
  109. package/dist/index.js +1 -1
  110. package/dist/mcp/server.js +1 -1
  111. package/dist/mcp/tools/index.js +1 -1
  112. package/dist/mcp/tools/tdx-run.js +1 -1
  113. package/dist/mcp/tools/tdx-search.js +1 -1
  114. package/dist/mcp/tools/work-create-item.js +1 -1
  115. package/dist/mcp/utils.js +1 -1
  116. package/dist/proxy/claude-usage-tracker.d.ts +1 -0
  117. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  118. package/dist/proxy/claude-usage-tracker.js +1 -1
  119. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  120. package/dist/proxy/passthrough-server.d.ts +2 -0
  121. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  122. package/dist/proxy/passthrough-server.js +1 -1
  123. package/dist/proxy/passthrough-server.js.map +1 -1
  124. package/dist/proxy/sse-usage-parser.d.ts +2 -0
  125. package/dist/proxy/sse-usage-parser.d.ts.map +1 -1
  126. package/dist/proxy/sse-usage-parser.js +1 -1
  127. package/dist/proxy/sse-usage-parser.js.map +1 -1
  128. package/dist/sdk/agent/agent-config.js +1 -1
  129. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  130. package/dist/sdk/agent/agent-yaml.js +1 -1
  131. package/dist/sdk/agent/test/evaluator.js +1 -1
  132. package/dist/sdk/agent/test/executor.js +1 -1
  133. package/dist/sdk/agent/test/index.js +1 -1
  134. package/dist/sdk/agent/test/output.js +1 -1
  135. package/dist/sdk/agent/test/parser.js +1 -1
  136. package/dist/sdk/agent/tool-target-registry.js +1 -1
  137. package/dist/sdk/api.js +1 -1
  138. package/dist/sdk/auth-token.js +1 -1
  139. package/dist/sdk/cas/audience-context.d.ts +33 -0
  140. package/dist/sdk/cas/audience-context.d.ts.map +1 -0
  141. package/dist/sdk/cas/audience-context.js +1 -0
  142. package/dist/sdk/cas/audience-context.js.map +1 -0
  143. package/dist/sdk/cas/cas-api-client.js +1 -1
  144. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  145. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  146. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  147. package/dist/sdk/cas/cas-segment-schema.js +1 -1
  148. package/dist/sdk/cas/cas-segment-validator.js +1 -1
  149. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  150. package/dist/sdk/cas/index.d.ts +8 -0
  151. package/dist/sdk/cas/index.d.ts.map +1 -1
  152. package/dist/sdk/cas/index.js +1 -1
  153. package/dist/sdk/cas/index.js.map +1 -1
  154. package/dist/sdk/cas/pull-workflow.js +1 -1
  155. package/dist/sdk/cas/push-workflow.js +1 -1
  156. package/dist/sdk/cas/validate-files.js +1 -1
  157. package/dist/sdk/client/cdp-api-client.js +1 -1
  158. package/dist/sdk/client/delivery-api-client.js +1 -1
  159. package/dist/sdk/client/endpoints.js +1 -1
  160. package/dist/sdk/client/engage-api-client.js +1 -1
  161. package/dist/sdk/client/http-client.js +1 -1
  162. package/dist/sdk/client/llm-api-client.js +1 -1
  163. package/dist/sdk/client/oauth-refresh.js +1 -1
  164. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  165. package/dist/sdk/client/rate-limiter.js +1 -1
  166. package/dist/sdk/client/td-api-client.js +1 -1
  167. package/dist/sdk/client/trino-api-client.js +1 -1
  168. package/dist/sdk/client/workflow-client.js +1 -1
  169. package/dist/sdk/connection-validator.js +1 -1
  170. package/dist/sdk/connection.js +1 -1
  171. package/dist/sdk/delivery.js +1 -1
  172. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  173. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  174. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  175. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  176. package/dist/sdk/engage/campaign-pull.js +1 -1
  177. package/dist/sdk/engage/campaign-push.js +1 -1
  178. package/dist/sdk/engage/campaign-readiness-workflow.js +1 -1
  179. package/dist/sdk/engage/campaign-readiness.js +1 -1
  180. package/dist/sdk/engage/campaign-validator.js +1 -1
  181. package/dist/sdk/engage/campaign-yaml.js +1 -1
  182. package/dist/sdk/engage/in-browser-message-pull.js +1 -1
  183. package/dist/sdk/engage/in-browser-message-push.js +1 -1
  184. package/dist/sdk/engage/in-browser-message-validator.js +1 -1
  185. package/dist/sdk/engage/in-browser-message-yaml.js +1 -1
  186. package/dist/sdk/engage/landing-page-init.js +1 -1
  187. package/dist/sdk/engage/landing-page-public-asset.js +1 -1
  188. package/dist/sdk/engage/landing-page-pull.js +1 -1
  189. package/dist/sdk/engage/landing-page-push.js +1 -1
  190. package/dist/sdk/engage/landing-page-static-site.js +1 -1
  191. package/dist/sdk/engage/landing-page-validator.js +1 -1
  192. package/dist/sdk/engage/landing-page-workspace.js +1 -1
  193. package/dist/sdk/engage/landing-page-yaml.js +1 -1
  194. package/dist/sdk/engage/list-campaign-schema.js +1 -1
  195. package/dist/sdk/engage/list-campaign-yaml.js +1 -1
  196. package/dist/sdk/engage/template-pull.js +1 -1
  197. package/dist/sdk/engage/template-push.js +1 -1
  198. package/dist/sdk/engage/template-validator.js +1 -1
  199. package/dist/sdk/engage/template-yaml.js +1 -1
  200. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  201. package/dist/sdk/engage/types/campaign-def.js +1 -1
  202. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  203. package/dist/sdk/engage/types/in-browser-message-schema.js +1 -1
  204. package/dist/sdk/engage/types/landing-page-schema.js +1 -1
  205. package/dist/sdk/engage/types/template-schema.js +1 -1
  206. package/dist/sdk/engage/workspace-assignments.js +1 -1
  207. package/dist/sdk/engage.js +1 -1
  208. package/dist/sdk/errors.js +1 -1
  209. package/dist/sdk/index.js +1 -1
  210. package/dist/sdk/io/index.js +1 -1
  211. package/dist/sdk/io/node-filesystem.js +1 -1
  212. package/dist/sdk/job.js +1 -1
  213. package/dist/sdk/journey.d.ts +4 -1
  214. package/dist/sdk/journey.d.ts.map +1 -1
  215. package/dist/sdk/journey.js +1 -1
  216. package/dist/sdk/journey.js.map +1 -1
  217. package/dist/sdk/llm/chat-cache.js +1 -1
  218. package/dist/sdk/llm/index.js +1 -1
  219. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  220. package/dist/sdk/llm/model-factors.d.ts +5 -3
  221. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  222. package/dist/sdk/llm/model-factors.js +1 -1
  223. package/dist/sdk/llm/model-factors.js.map +1 -1
  224. package/dist/sdk/llm/user-settings.js +1 -1
  225. package/dist/sdk/p13n-studio-errors.js +1 -1
  226. package/dist/sdk/p13n-studio.js +1 -1
  227. package/dist/sdk/personalization.js +1 -1
  228. package/dist/sdk/policy.js +1 -1
  229. package/dist/sdk/query/deleted-table-validation.js +1 -1
  230. package/dist/sdk/query/index.js +1 -1
  231. package/dist/sdk/query/sql-parser.js +1 -1
  232. package/dist/sdk/realtime.js +1 -1
  233. package/dist/sdk/schedule.js +1 -1
  234. package/dist/sdk/segment/audience-context.js +1 -1
  235. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  236. package/dist/sdk/segment/fields-display.js +1 -1
  237. package/dist/sdk/segment/file-discovery.js +1 -1
  238. package/dist/sdk/segment/journey-utils.js +1 -1
  239. package/dist/sdk/segment/journey-validator.js +1 -1
  240. package/dist/sdk/segment/journey-yaml.js +1 -1
  241. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  242. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  243. package/dist/sdk/segment/pull-workflow.js +1 -1
  244. package/dist/sdk/segment/push-recovery.js +1 -1
  245. package/dist/sdk/segment/push-workflow.js +1 -1
  246. package/dist/sdk/segment/resolution-context.js +1 -1
  247. package/dist/sdk/segment/segment-path-parser.js +1 -1
  248. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  249. package/dist/sdk/segment/segment-validator.js +1 -1
  250. package/dist/sdk/segment/target-resolution.js +1 -1
  251. package/dist/sdk/segment/tdx-config.js +1 -1
  252. package/dist/sdk/segment/types/activation-schema.js +1 -1
  253. package/dist/sdk/segment/types/journey-def.js +1 -1
  254. package/dist/sdk/segment/types/journey-schema.js +1 -1
  255. package/dist/sdk/segment/types/segment-def.js +1 -1
  256. package/dist/sdk/segment/types/segment-schema.js +1 -1
  257. package/dist/sdk/segment/validate-files.js +1 -1
  258. package/dist/sdk/segment/yaml-validator.js +1 -1
  259. package/dist/sdk/segment.js +1 -1
  260. package/dist/sdk/types/index.js +1 -1
  261. package/dist/sdk/types/progress.js +1 -1
  262. package/dist/sdk/types/workspace.js +1 -1
  263. package/dist/sdk/user.js +1 -1
  264. package/dist/sdk/util/format-detector.js +1 -1
  265. package/dist/sdk/util/formatters.js +1 -1
  266. package/dist/sdk/util/index.js +1 -1
  267. package/dist/sdk/util/paginate.js +1 -1
  268. package/dist/sdk/util/tree-formatter.js +1 -1
  269. package/dist/sdk/util/tree-search.js +1 -1
  270. package/dist/sdk/workflow/archive-validation.js +1 -1
  271. package/dist/sdk/workflow/clone-workflow.js +1 -1
  272. package/dist/sdk/workflow/index.js +1 -1
  273. package/dist/sdk/workflow/pull-workflow.js +1 -1
  274. package/dist/sdk/workflow/push-workflow.js +1 -1
  275. package/dist/sdk/workflow/task-graph.js +1 -1
  276. package/dist/sdk/workflow/tdx-config.js +1 -1
  277. package/dist/sdk/workflow/workflow-utils.js +1 -1
  278. package/dist/sdk/workspace/access-tracker.js +1 -1
  279. package/dist/sdk/workspace/frontmatter.js +1 -1
  280. package/dist/sdk/workspace/git.js +1 -1
  281. package/dist/sdk/workspace/index.js +1 -1
  282. package/dist/sdk/workspace/templates.js +1 -1
  283. package/dist/sdk/workspace/weekly.js +1 -1
  284. package/dist/sdk/workspace/wikilinks.js +1 -1
  285. package/dist/test-utils/command-runner.js +1 -1
  286. package/dist/test-utils/factories.js +1 -1
  287. package/dist/test-utils/fixtures.js +1 -1
  288. package/dist/test-utils/http-mock.js +1 -1
  289. package/dist/test-utils/index.js +1 -1
  290. package/dist/utils/async.js +1 -1
  291. package/dist/utils/claude-code-state.js +1 -1
  292. package/dist/utils/colors.js +1 -1
  293. package/dist/utils/diff.js +1 -1
  294. package/dist/utils/file-permissions.js +1 -1
  295. package/dist/utils/file-reader.js +1 -1
  296. package/dist/utils/github-releases.js +1 -1
  297. package/dist/utils/global-cache.js +1 -1
  298. package/dist/utils/json-loader.js +1 -1
  299. package/dist/utils/local-cache.js +1 -1
  300. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  301. package/dist/utils/logger/formatters/index.js +1 -1
  302. package/dist/utils/logger/handlers/console-handler.js +1 -1
  303. package/dist/utils/logger/handlers/file-handler.js +1 -1
  304. package/dist/utils/logger/handlers/index.js +1 -1
  305. package/dist/utils/logger/handlers/null-handler.js +1 -1
  306. package/dist/utils/logger/index.js +1 -1
  307. package/dist/utils/logger/logger.js +1 -1
  308. package/dist/utils/logger/types.js +1 -1
  309. package/dist/utils/option-validation.js +1 -1
  310. package/dist/utils/process.js +1 -1
  311. package/dist/utils/prompt.js +1 -1
  312. package/dist/utils/proxy-fetch.js +1 -1
  313. package/dist/utils/spinner.js +1 -1
  314. package/dist/utils/sse-parser.js +1 -1
  315. package/dist/utils/string-utils.js +1 -1
  316. package/dist/utils/table-ref-parser.js +1 -1
  317. package/dist/utils/tdx-logger.js +1 -1
  318. package/dist/utils/version-check.js +1 -1
  319. package/package.json +2 -1
@@ -1 +1 @@
1
- const a52_0x3aa6be=a52_0xa9bf;(function(_0x3de832,_0x318861){const _0xba516a=a52_0xa9bf,_0x572c0f=_0x3de832();while(!![]){try{const _0x24f358=parseInt(_0xba516a(0xc5))/0x1+-parseInt(_0xba516a(0xdf))/0x2*(-parseInt(_0xba516a(0xac))/0x3)+-parseInt(_0xba516a(0xe4))/0x4+parseInt(_0xba516a(0xe9))/0x5*(parseInt(_0xba516a(0xf5))/0x6)+-parseInt(_0xba516a(0xb6))/0x7+parseInt(_0xba516a(0xca))/0x8*(parseInt(_0xba516a(0xe7))/0x9)+parseInt(_0xba516a(0xdc))/0xa*(-parseInt(_0xba516a(0xd3))/0xb);if(_0x24f358===_0x318861)break;else _0x572c0f['push'](_0x572c0f['shift']());}catch(_0x1d9120){_0x572c0f['push'](_0x572c0f['shift']());}}}(a52_0x4e80,0x61f36));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a52_0xa9bf(_0x46e753,_0x4a660a){_0x46e753=_0x46e753-0xab;const _0x4e80f7=a52_0x4e80();let _0xa9bfbf=_0x4e80f7[_0x46e753];return _0xa9bfbf;}import{searchTreeByName}from'../sdk/util/tree-search.js';import a52_0x579f0f from'chalk';function a52_0x4e80(){const _0x4a5e4b=['explainAmbiguousName','130ANquiB','\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact','toLowerCase','folderId','Moving','path','join','error','includes','green','Searching\x20the\x20tree...','\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)','13266PdRrEQ','moveSegments','21svDaDk','forEach','rule\x20','description','\x27\x20—\x20','type','\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501','parentSegment','parentId','segment','781277CUWIni','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','\x20(verified\x20by\x20re-read)','filter','cyan','Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a','\x27,\x20\x27','\x20segment','verbose','execute','\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.','\x27...','\x20condition','\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:','segmentFolderId','60030JausKN','Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22','data','length','name','83704lbzVhe','Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a','folder','push','map','Searching\x20folders\x20for\x20\x27','listRecursive','\x27\x20to\x20folder\x20\x27','Error:\x20\x27','479039LhFBUU','resolvePathToResource','Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)','Segments:\x20','\x20\x20(id\x20','\x20folder\x20\x27','segment:move','Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder','dryRun','30IJqEcS','has','\x20→\x20','186062zIUTkr','red','test','Duplicate\x20segments\x20removed\x20(','for\x20move\x20to','2049600dwkNLa','\x20segment(s)\x20would\x20be\x20moved.','\x27\x20matches\x20','333YfwJKU'];a52_0x4e80=function(){return _0x4a5e4b;};return a52_0x4e80();}export class SegmentMoveCommand extends BaseCommand{[a52_0x3aa6be(0xc9)]=a52_0x3aa6be(0xd9);[a52_0x3aa6be(0xaf)]=a52_0x3aa6be(0xda);async[a52_0x3aa6be(0xbf)](_0x5c5d8b){const _0x2926ce=a52_0x3aa6be,{options:_0x39d1f4,args:_0xb47573,tdx:_0x168cfa}=_0x5c5d8b,_0x8e3101=_0xb47573,_0x3a44b8=_0x39d1f4['folder'];if(_0x8e3101[_0x2926ce(0xc8)]===0x0||!_0x3a44b8)return console[_0x2926ce(0xf0)](a52_0x579f0f[_0x2926ce(0xe0)](_0x2926ce(0xcb))),console[_0x2926ce(0xf0)]('Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>'),console[_0x2926ce(0xf0)]('Examples:'),console[_0x2926ce(0xf0)](_0x2926ce(0xb7)),console[_0x2926ce(0xf0)](_0x2926ce(0xb2)),console[_0x2926ce(0xf0)](_0x2926ce(0xf4)),console[_0x2926ce(0xf0)](_0x2926ce(0xc0)),0x1;_0x39d1f4['verbose']&&(console[_0x2926ce(0xf0)](_0x2926ce(0xd6)+_0x8e3101[_0x2926ce(0xef)](',\x20')),console[_0x2926ce(0xf0)]('Target\x20folder:\x20'+_0x3a44b8));const _0x347a91=[...new Set(_0x8e3101)];_0x347a91['length']<_0x8e3101['length']&&console[_0x2926ce(0xf0)](a52_0x579f0f['yellow'](_0x2926ce(0xe2)+_0x8e3101[_0x2926ce(0xc8)]+_0x2926ce(0xde)+_0x347a91[_0x2926ce(0xc8)]+').'));const _0xe0360e=/^\d+$/,_0xf7ffb6=_0x39d1f4[_0x2926ce(0xb3)],_0x35e67b=[..._0x347a91,_0x3a44b8]['some'](_0x44966e=>!_0xe0360e[_0x2926ce(0xe1)](_0x44966e));if(_0x35e67b&&!_0xf7ffb6)return console[_0x2926ce(0xf0)](a52_0x579f0f[_0x2926ce(0xe0)](_0x2926ce(0xbb))),console[_0x2926ce(0xf0)](_0x2926ce(0xc6)),console[_0x2926ce(0xf0)]('Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22'),console[_0x2926ce(0xf0)](_0x2926ce(0xd5)),0x1;const _0x41ce46=_0x347a91['length'],_0x546786=_0x39d1f4[_0x2926ce(0xdb)]===!![];let _0x1a29a9;try{const _0xf9872=await withSpinner((_0x546786?'Checking':_0x2926ce(0xed))+'\x20'+_0x41ce46+_0x2926ce(0xbd)+(_0x41ce46===0x1?'':'s')+'\x20'+((_0x546786?_0x2926ce(0xe3):'to')+_0x2926ce(0xd8)+_0x3a44b8+'\x27...'),async()=>{const _0x411e49=_0x2926ce,_0xc4d5de=[];_0x347a91[_0x411e49(0xad)]((_0x5513e9,_0x356292)=>{const _0x2c87ca=_0x411e49;if(!_0xe0360e[_0x2c87ca(0xe1)](_0x5513e9))_0xc4d5de[_0x2c87ca(0xcd)]({'name':_0x5513e9,'expectType':'segment','slot':_0x356292});});if(!_0xe0360e['test'](_0x3a44b8))_0xc4d5de['push']({'name':_0x3a44b8,'expectType':_0x411e49(0xcc),'slot':-0x1});const _0x4a90de=new Map();if(_0xc4d5de[_0x411e49(0xc8)]>0x0){const _0x4332f5=await _0x168cfa[_0x411e49(0xb5)]['resolveEntitiesInParent'](_0xf7ffb6,_0xc4d5de[_0x411e49(0xce)](({name:_0xea73b4,expectType:_0x5d448b})=>({'name':_0xea73b4,'expectType':_0x5d448b})));_0x4332f5[_0x411e49(0xad)]((_0x1918e9,_0x14e8bd)=>_0x4a90de['set'](_0xc4d5de[_0x14e8bd]['slot'],_0x1918e9['id']));}const _0x336521=_0x347a91[_0x411e49(0xce)]((_0xed8f43,_0x5c562f)=>_0xe0360e[_0x411e49(0xe1)](_0xed8f43)?_0xed8f43:_0x4a90de['get'](_0x5c562f)),_0x8a4b33=_0xe0360e[_0x411e49(0xe1)](_0x3a44b8)?_0x3a44b8:_0x4a90de['get'](-0x1);return _0x168cfa[_0x411e49(0xb5)][_0x411e49(0xab)](_0x336521,_0x8a4b33,_0x546786);},{'verbose':_0x39d1f4[_0x2926ce(0xbe)]});_0x1a29a9=_0xf9872['data'];}catch(_0x1ee88f){if(_0x1ee88f instanceof SDKError&&_0x1ee88f['code']===ErrorCode['SEGMENT_NOT_FOUND']&&_0xf7ffb6)try{if(await this[_0x2926ce(0xe8)](_0x168cfa,_0xf7ffb6,_0x347a91,_0x39d1f4))return 0x1;}catch{}throw _0x1ee88f;}for(const _0x2f0cbe of _0x1a29a9){const _0x4b24d4=_0x2f0cbe['ruleConditionCount'],_0x362cc4=_0x2926ce(0xae)+(_0x546786?_0x2926ce(0xdd):'preserved:')+'\x20'+_0x4b24d4+_0x2926ce(0xc2)+(_0x4b24d4===0x1?'':'s');console['error'](_0x546786?a52_0x579f0f[_0x2926ce(0xba)]('•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27'+_0x2f0cbe['id']+_0x2926ce(0xd1)+_0x2f0cbe['segmentFolderId']+_0x2926ce(0xb0)+_0x362cc4):a52_0x579f0f['green']('✔\x20Moved\x20segment\x20\x27'+_0x2f0cbe['id']+_0x2926ce(0xd1)+_0x2f0cbe[_0x2926ce(0xc4)]+_0x2926ce(0xb0)+_0x362cc4+_0x2926ce(0xb8)));}if(_0x546786)console[_0x2926ce(0xf0)](a52_0x579f0f[_0x2926ce(0xba)]('[dry-run]\x20No\x20changes\x20made.\x20'+_0x41ce46+_0x2926ce(0xe5)));else _0x1a29a9[_0x2926ce(0xc8)]>0x1&&console[_0x2926ce(0xf0)](a52_0x579f0f[_0x2926ce(0xf2)]('✔\x20'+_0x1a29a9[_0x2926ce(0xc8)]+_0x2926ce(0xea)));return await handleSDKOutput(_0x1a29a9,_0x39d1f4),0x0;}async[a52_0x3aa6be(0xe8)](_0x291b84,_0x2febb2,_0x29b735,_0x33c579){const _0x3a63e9=a52_0x3aa6be,_0x3c39eb=_0x29b735[_0x3a63e9(0xb9)](_0x2ff4e9=>!/^\d+$/[_0x3a63e9(0xe1)](_0x2ff4e9)&&!_0x2ff4e9[_0x3a63e9(0xf1)]('/'));if(_0x3c39eb[_0x3a63e9(0xc8)]===0x0)return![];const _0x31f507=await withSpinner(_0x3a63e9(0xcf)+_0x3c39eb[_0x3a63e9(0xef)](_0x3a63e9(0xbc))+_0x3a63e9(0xc1),()=>_0x291b84[_0x3a63e9(0xb5)][_0x3a63e9(0xd4)](_0x2febb2),{'verbose':_0x33c579[_0x3a63e9(0xbe)]}),_0x2ed3e5=(await withSpinner(_0x3a63e9(0xf3),()=>_0x291b84['segment'][_0x3a63e9(0xd0)](_0x31f507['data'][_0x3a63e9(0xb4)],_0x31f507[_0x3a63e9(0xc7)][_0x3a63e9(0xec)],0x0,0xa),{'verbose':_0x33c579['verbose']}))[_0x3a63e9(0xc7)];let _0x598fb2=![];for(const _0x5dfbaa of _0x3c39eb){const _0x40f299=searchTreeByName(_0x2ed3e5,_0x5dfbaa)['filter'](_0x533a41=>_0x533a41[_0x3a63e9(0xb1)]==='segment'&&_0x533a41['name'][_0x3a63e9(0xeb)]()===_0x5dfbaa[_0x3a63e9(0xeb)]());if(_0x40f299['length']>0x1){_0x598fb2=!![],console[_0x3a63e9(0xf0)](a52_0x579f0f[_0x3a63e9(0xe0)](_0x3a63e9(0xd2)+_0x5dfbaa+_0x3a63e9(0xe6)+_0x40f299[_0x3a63e9(0xc8)]+_0x3a63e9(0xc3)));for(const _0x202b37 of _0x40f299)console[_0x3a63e9(0xf0)]('\x20\x20•\x20'+_0x202b37['path']+_0x3a63e9(0xd7)+_0x202b37['id']+')');}else _0x40f299[_0x3a63e9(0xc8)]===0x1&&(_0x598fb2=!![],console[_0x3a63e9(0xf0)](a52_0x579f0f['red'](_0x3a63e9(0xd2)+_0x5dfbaa+'\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:')),console[_0x3a63e9(0xf0)]('\x20\x20'+_0x40f299[0x0][_0x3a63e9(0xee)]+_0x3a63e9(0xd7)+_0x40f299[0x0]['id']+')'),console[_0x3a63e9(0xf0)]('Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).'));}return _0x598fb2;}}
1
+ const a53_0x5aa459=a53_0x5329;function a53_0x5329(_0x344b8a,_0x342e59){_0x344b8a=_0x344b8a-0xd8;const _0x175899=a53_0x1758();let _0x532964=_0x175899[_0x344b8a];return _0x532964;}(function(_0x5f2dc0,_0x8fe142){const _0x2428ab=a53_0x5329,_0xe09f17=_0x5f2dc0();while(!![]){try{const _0x5a5332=parseInt(_0x2428ab(0xf6))/0x1+-parseInt(_0x2428ab(0xfb))/0x2*(-parseInt(_0x2428ab(0xf7))/0x3)+-parseInt(_0x2428ab(0xec))/0x4+-parseInt(_0x2428ab(0xfc))/0x5*(parseInt(_0x2428ab(0xee))/0x6)+parseInt(_0x2428ab(0xf0))/0x7*(-parseInt(_0x2428ab(0xed))/0x8)+parseInt(_0x2428ab(0xe8))/0x9+parseInt(_0x2428ab(0xfe))/0xa;if(_0x5a5332===_0x8fe142)break;else _0xe09f17['push'](_0xe09f17['shift']());}catch(_0x3b6f88){_0xe09f17['push'](_0xe09f17['shift']());}}}(a53_0x1758,0x97ad8));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a53_0x1758(){const _0x19d3e4=['type','\x20\x20(id\x20','\x20folder\x20\x27','712962oqGnrY','9ShSOIw','\x27\x20—\x20','explainAmbiguousName','slot','184564DEGXHx','375AQzCZz','red','2912420DrCPqG','includes','parentSegment','length','Moving','moveSegments','Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a','for\x20move\x20to','Examples:','resolveEntitiesInParent','\x27\x20matches\x20','join','•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27','code','\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501','segment','✔\x20Moved\x20segment\x20\x27','name','\x20segment','\x27,\x20\x27','\x27...','preserved:','yellow','\x27\x20to\x20folder\x20\x27','\x20(verified\x20by\x20re-read)','error','segmentFolderId','toLowerCase','execute','\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.','Searching\x20the\x20tree...','Target\x20folder:\x20','set','folder','filter','Checking','Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)','[dry-run]\x20No\x20changes\x20made.\x20','push','green','data','path','test','Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder','get','Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).','\x20condition','forEach','\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact','\x20\x20•\x20','\x20→\x20','8827830dyYCNY','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','Error:\x20\x27','listRecursive','3168212PQtSJk','833832erOhfC','26196cHKlud','some','35JipnZS','verbose','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:'];a53_0x1758=function(){return _0x19d3e4;};return a53_0x1758();}import{searchTreeByName}from'../sdk/util/tree-search.js';import a53_0x502345 from'chalk';export class SegmentMoveCommand extends BaseCommand{[a53_0x5aa459(0x10f)]='segment:move';['description']=a53_0x5aa459(0xe0);async[a53_0x5aa459(0x11a)](_0x5cf3a6){const _0x34e57d=a53_0x5aa459,{options:_0x17ebff,args:_0x9447b9,tdx:_0xa98b4b}=_0x5cf3a6,_0x4712dd=_0x9447b9,_0x18c0a3=_0x17ebff[_0x34e57d(0x11f)];if(_0x4712dd['length']===0x0||!_0x18c0a3)return console[_0x34e57d(0x117)](a53_0x502345[_0x34e57d(0xfd)](_0x34e57d(0x104))),console[_0x34e57d(0x117)](_0x34e57d(0xe9)),console['error'](_0x34e57d(0x106)),console[_0x34e57d(0x117)]('\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501'),console[_0x34e57d(0x117)](_0x34e57d(0x10c)),console[_0x34e57d(0x117)]('\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)'),console[_0x34e57d(0x117)](_0x34e57d(0x11b)),0x1;_0x17ebff[_0x34e57d(0xf1)]&&(console[_0x34e57d(0x117)]('Segments:\x20'+_0x4712dd[_0x34e57d(0x109)](',\x20')),console[_0x34e57d(0x117)](_0x34e57d(0x11d)+_0x18c0a3));const _0x151449=[...new Set(_0x4712dd)];_0x151449[_0x34e57d(0x101)]<_0x4712dd[_0x34e57d(0x101)]&&console['error'](a53_0x502345[_0x34e57d(0x114)]('Duplicate\x20segments\x20removed\x20('+_0x4712dd[_0x34e57d(0x101)]+_0x34e57d(0xe7)+_0x151449[_0x34e57d(0x101)]+').'));const _0x510b62=/^\d+$/,_0xff9793=_0x17ebff[_0x34e57d(0x100)],_0x28aab8=[..._0x151449,_0x18c0a3][_0x34e57d(0xef)](_0x3cc8be=>!_0x510b62['test'](_0x3cc8be));if(_0x28aab8&&!_0xff9793)return console['error'](a53_0x502345[_0x34e57d(0xfd)]('Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a')),console['error']('Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22'),console[_0x34e57d(0x117)]('Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22'),console[_0x34e57d(0x117)](_0x34e57d(0xd9)),0x1;const _0x216136=_0x151449[_0x34e57d(0x101)],_0x557f3d=_0x17ebff['dryRun']===!![];let _0x5544a7;try{const _0x545f98=await withSpinner((_0x557f3d?_0x34e57d(0xd8):_0x34e57d(0x102))+'\x20'+_0x216136+_0x34e57d(0x110)+(_0x216136===0x1?'':'s')+'\x20'+((_0x557f3d?_0x34e57d(0x105):'to')+_0x34e57d(0xf5)+_0x18c0a3+_0x34e57d(0x112)),async()=>{const _0x3eb99d=_0x34e57d,_0x2324e0=[];_0x151449[_0x3eb99d(0xe4)]((_0x7a5401,_0x594e8b)=>{const _0x55a9b8=_0x3eb99d;if(!_0x510b62['test'](_0x7a5401))_0x2324e0[_0x55a9b8(0xdb)]({'name':_0x7a5401,'expectType':_0x55a9b8(0x10d),'slot':_0x594e8b});});if(!_0x510b62['test'](_0x18c0a3))_0x2324e0[_0x3eb99d(0xdb)]({'name':_0x18c0a3,'expectType':_0x3eb99d(0x11f),'slot':-0x1});const _0xcb1dd9=new Map();if(_0x2324e0[_0x3eb99d(0x101)]>0x0){const _0x2d1882=await _0xa98b4b['segment'][_0x3eb99d(0x107)](_0xff9793,_0x2324e0['map'](({name:_0x370629,expectType:_0x180944})=>({'name':_0x370629,'expectType':_0x180944})));_0x2d1882['forEach']((_0x1b9caa,_0x33cff1)=>_0xcb1dd9[_0x3eb99d(0x11e)](_0x2324e0[_0x33cff1][_0x3eb99d(0xfa)],_0x1b9caa['id']));}const _0x17bf20=_0x151449['map']((_0x370a45,_0x4019d4)=>_0x510b62[_0x3eb99d(0xdf)](_0x370a45)?_0x370a45:_0xcb1dd9[_0x3eb99d(0xe1)](_0x4019d4)),_0xd612a4=_0x510b62[_0x3eb99d(0xdf)](_0x18c0a3)?_0x18c0a3:_0xcb1dd9[_0x3eb99d(0xe1)](-0x1);return _0xa98b4b[_0x3eb99d(0x10d)][_0x3eb99d(0x103)](_0x17bf20,_0xd612a4,_0x557f3d);},{'verbose':_0x17ebff[_0x34e57d(0xf1)]});_0x5544a7=_0x545f98[_0x34e57d(0xdd)];}catch(_0x2bb840){if(_0x2bb840 instanceof SDKError&&_0x2bb840[_0x34e57d(0x10b)]===ErrorCode['SEGMENT_NOT_FOUND']&&_0xff9793)try{if(await this[_0x34e57d(0xf9)](_0xa98b4b,_0xff9793,_0x151449,_0x17ebff))return 0x1;}catch{}throw _0x2bb840;}for(const _0x1666f7 of _0x5544a7){const _0x45a7ff=_0x1666f7['ruleConditionCount'],_0x2bdd08='rule\x20'+(_0x557f3d?'has':_0x34e57d(0x113))+'\x20'+_0x45a7ff+_0x34e57d(0xe3)+(_0x45a7ff===0x1?'':'s');console[_0x34e57d(0x117)](_0x557f3d?a53_0x502345['cyan'](_0x34e57d(0x10a)+_0x1666f7['id']+_0x34e57d(0x115)+_0x1666f7[_0x34e57d(0x118)]+'\x27\x20—\x20'+_0x2bdd08):a53_0x502345[_0x34e57d(0xdc)](_0x34e57d(0x10e)+_0x1666f7['id']+_0x34e57d(0x115)+_0x1666f7['segmentFolderId']+_0x34e57d(0xf8)+_0x2bdd08+_0x34e57d(0x116)));}if(_0x557f3d)console[_0x34e57d(0x117)](a53_0x502345['cyan'](_0x34e57d(0xda)+_0x216136+'\x20segment(s)\x20would\x20be\x20moved.'));else _0x5544a7[_0x34e57d(0x101)]>0x1&&console[_0x34e57d(0x117)](a53_0x502345[_0x34e57d(0xdc)]('✔\x20'+_0x5544a7[_0x34e57d(0x101)]+_0x34e57d(0xe5)));return await handleSDKOutput(_0x5544a7,_0x17ebff),0x0;}async['explainAmbiguousName'](_0x195738,_0x45d5d1,_0x13157f,_0x1fed17){const _0x32530d=a53_0x5aa459,_0x5a273c=_0x13157f[_0x32530d(0x120)](_0x2f9199=>!/^\d+$/['test'](_0x2f9199)&&!_0x2f9199[_0x32530d(0xff)]('/'));if(_0x5a273c[_0x32530d(0x101)]===0x0)return![];const _0x309178=await withSpinner('Searching\x20folders\x20for\x20\x27'+_0x5a273c['join'](_0x32530d(0x111))+'\x27...',()=>_0x195738[_0x32530d(0x10d)]['resolvePathToResource'](_0x45d5d1),{'verbose':_0x1fed17[_0x32530d(0xf1)]}),_0x2946fa=(await withSpinner(_0x32530d(0x11c),()=>_0x195738[_0x32530d(0x10d)][_0x32530d(0xeb)](_0x309178[_0x32530d(0xdd)]['parentId'],_0x309178[_0x32530d(0xdd)]['folderId'],0x0,0xa),{'verbose':_0x1fed17[_0x32530d(0xf1)]}))[_0x32530d(0xdd)];let _0x159fe9=![];for(const _0x4c9d61 of _0x5a273c){const _0x537e3f=searchTreeByName(_0x2946fa,_0x4c9d61)[_0x32530d(0x120)](_0x5dd12c=>_0x5dd12c[_0x32530d(0xf3)]===_0x32530d(0x10d)&&_0x5dd12c[_0x32530d(0x10f)][_0x32530d(0x119)]()===_0x4c9d61['toLowerCase']());if(_0x537e3f[_0x32530d(0x101)]>0x1){_0x159fe9=!![],console[_0x32530d(0x117)](a53_0x502345['red']('Error:\x20\x27'+_0x4c9d61+_0x32530d(0x108)+_0x537e3f['length']+'\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:'));for(const _0xfa2b92 of _0x537e3f)console[_0x32530d(0x117)](_0x32530d(0xe6)+_0xfa2b92[_0x32530d(0xde)]+'\x20\x20(id\x20'+_0xfa2b92['id']+')');}else _0x537e3f['length']===0x1&&(_0x159fe9=!![],console[_0x32530d(0x117)](a53_0x502345[_0x32530d(0xfd)](_0x32530d(0xea)+_0x4c9d61+_0x32530d(0xf2))),console[_0x32530d(0x117)]('\x20\x20'+_0x537e3f[0x0]['path']+_0x32530d(0xf4)+_0x537e3f[0x0]['id']+')'),console['error'](_0x32530d(0xe2)));}return _0x159fe9;}}
@@ -1 +1 @@
1
- const a53_0x270b0c=a53_0x55e5;(function(_0x2c2e04,_0x58f953){const _0x34071d=a53_0x55e5,_0x70a08d=_0x2c2e04();while(!![]){try{const _0x260079=-parseInt(_0x34071d(0xf9))/0x1*(-parseInt(_0x34071d(0xf2))/0x2)+-parseInt(_0x34071d(0x106))/0x3*(parseInt(_0x34071d(0xdb))/0x4)+parseInt(_0x34071d(0xf6))/0x5*(parseInt(_0x34071d(0x10f))/0x6)+parseInt(_0x34071d(0xca))/0x7*(-parseInt(_0x34071d(0xff))/0x8)+-parseInt(_0x34071d(0xcb))/0x9+parseInt(_0x34071d(0x11c))/0xa*(parseInt(_0x34071d(0x116))/0xb)+parseInt(_0x34071d(0xfc))/0xc*(parseInt(_0x34071d(0x11d))/0xd);if(_0x260079===_0x58f953)break;else _0x70a08d['push'](_0x70a08d['shift']());}catch(_0xda580b){_0x70a08d['push'](_0x70a08d['shift']());}}}(a53_0x7fd3,0x4d829));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a53_0x2872cb from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a53_0x7fd3(){const _0xc84f67=['no_parent','\x20changed\x20files','files','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cyan','56148brgESV','dryRun','error','\x20files\x20to\x20','5HIpGtO','\x20=\x20','\x20\x20🎯\x20','14BbhnZM','\x20unchanged\x20files','\x20activations','36BGodoE','Site:\x20','segment','136776NhZCCW','setPhase','parentName','\x0aPull\x20summary\x20for\x20\x27','journeyVersions','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','✔\x20Context\x20set:\x20','12ZQWcfV','yellow','Aborted.','\x20with\x20','\x20files?','-\x20no\x20files\x20written','parent_segment','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aError:','3707196hlcShi','errorCode','segments','Write\x20','parentSegment','\x27...','length','4059KzFChK','✔\x20Pulled\x20','\x20journeys','verbose','site','isNew','11910NGGoDC','1442818bRcYsu','journeys','content','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','238RNgScf','3841416OjEACM','filter','cwd','utf-8','message','file','\x20new\x20files','\x20segments','description','activations','hasChanges','targetDir','type','relativePath','session','data','457736CvMyDi','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','yes','repeat','\x20\x20🗺️\x20\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)','red','diff','absolutePath','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','dim','Target\x20resource:\x20','Error:\x20','helpText','resourceName','counts'];a53_0x7fd3=function(){return _0xc84f67;};return a53_0x7fd3();}import a53_0x5f1507 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a53_0x55e5(_0x3ed260,_0x31b257){_0x3ed260=_0x3ed260-0xca;const _0x7fd322=a53_0x7fd3();let _0x55e54c=_0x7fd322[_0x3ed260];return _0x55e54c;}export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';[a53_0x270b0c(0xd3)]=a53_0x270b0c(0xe5);async['execute'](_0x247b8a){const _0x4edccb=a53_0x270b0c,{options:_0x4dd6fc,args:_0x548217,tdx:_0x3ab473}=_0x247b8a,_0x481387=_0x4dd6fc,_0x206981=await resolveTarget({'arg':_0x548217[0x0],'contextParent':_0x4dd6fc[_0x4edccb(0x113)],'cwd':process[_0x4edccb(0xcd)]()});if(!isSuccessfulResolution(_0x206981))return _0x206981[_0x4edccb(0x110)]===_0x4edccb(0xec)?(console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0x107)](_0x4edccb(0x121))),console[_0x4edccb(0xf4)](_0x4edccb(0xe1)),console[_0x4edccb(0xf4)](_0x4edccb(0xdd)),console[_0x4edccb(0xf4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x4edccb(0xf4)](a53_0x2872cb['red'](_0x4edccb(0xe8)+_0x206981[_0x4edccb(0xcf)]+'\x0a')),_0x206981[_0x4edccb(0xe9)]&&console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0xf1)](_0x206981[_0x4edccb(0xe9)]))),0x1;const _0xd7736b=_0x206981[_0x4edccb(0x101)],_0x241dbc=_0x206981[_0x4edccb(0xd6)],_0xf1b9eb=_0x206981[_0x4edccb(0xd7)]===_0x4edccb(0xd0)?_0x206981[_0x4edccb(0xea)]:undefined;_0x481387[_0x4edccb(0x119)]&&(console[_0x4edccb(0xf4)](_0x4edccb(0xfd)+_0x481387[_0x4edccb(0x11a)]),console[_0x4edccb(0xf4)]('Parent\x20segment:\x20'+_0xd7736b),_0xf1b9eb&&console[_0x4edccb(0xf4)](_0x4edccb(0xe7)+_0xf1b9eb));const _0x66a3d6=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0xd7736b+_0x4edccb(0x114),_0x378eb7=>_0x3ab473[_0x4edccb(0xfe)]['pullSegments'](_0xd7736b,{'targetDir':_0x241dbc,'targetResourceName':_0xf1b9eb,'verbose':_0x481387[_0x4edccb(0x119)],'progress':{'update':_0x506c30=>{const _0xbf3c8e=_0x4edccb;_0x378eb7[_0xbf3c8e(0x100)](_0x506c30),_0x481387[_0xbf3c8e(0x119)]&&console[_0xbf3c8e(0xf4)]('\x20\x20'+_0x506c30);}}}),{'verbose':_0x481387[_0x4edccb(0x119)]}),_0x491cca=_0x66a3d6[_0x4edccb(0xda)];if(_0x491cca['counts'][_0x4edccb(0x111)]===0x0&&_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0x11e)]===0x0)return console['error'](a53_0x2872cb[_0x4edccb(0x107)](_0x4edccb(0x104)+_0x491cca['parentName']+'\x27')),0x0;const _0x408ad8=_0x491cca['files'][_0x4edccb(0xcc)](_0x130108=>_0x130108['isNew']),_0x26c884=_0x491cca[_0x4edccb(0xee)][_0x4edccb(0xcc)](_0x18d562=>!_0x18d562[_0x4edccb(0x11b)]&&_0x18d562['hasChanges']),_0x21214e=_0x491cca['files'][_0x4edccb(0xcc)](_0xac6702=>!_0xac6702[_0x4edccb(0x11b)]&&!_0xac6702[_0x4edccb(0xd5)]);console[_0x4edccb(0xf4)](_0x4edccb(0x102)+_0x491cca[_0x4edccb(0x101)]+'\x27:'),console['error'](_0x4edccb(0xf8)+a53_0x2872cb[_0x4edccb(0xf1)](_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0x111)]+_0x4edccb(0xd2))+_0x4edccb(0x109)+a53_0x2872cb[_0x4edccb(0xf1)](_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0xd4)]+_0x4edccb(0xfb)));if(_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0x11e)]>0x0){const _0x2db8a1=_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0x103)]>_0x491cca[_0x4edccb(0xeb)]['journeys']?'\x20('+_0x491cca['counts'][_0x4edccb(0x103)]+'\x20versions)':'';console[_0x4edccb(0xf4)](_0x4edccb(0xe0)+a53_0x2872cb[_0x4edccb(0xf1)](_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0x11e)]+_0x4edccb(0x118))+a53_0x2872cb[_0x4edccb(0xe6)](_0x2db8a1));}console[_0x4edccb(0xf4)]('\x20\x20'+a53_0x2872cb['green']('+\x20'+_0x408ad8['length']+_0x4edccb(0xd1))),console[_0x4edccb(0xf4)]('\x20\x20'+a53_0x2872cb[_0x4edccb(0x107)]('~\x20'+_0x26c884[_0x4edccb(0x115)]+_0x4edccb(0xed))),console[_0x4edccb(0xf4)]('\x20\x20'+a53_0x2872cb[_0x4edccb(0xe6)]('=\x20'+_0x21214e[_0x4edccb(0x115)]+_0x4edccb(0xfa))),console[_0x4edccb(0xf4)]('\x20\x20Target:\x20'+a53_0x2872cb['cyan'](_0x491cca[_0x4edccb(0xd6)])+'\x0a');if(_0x26c884['length']>0x0)for(const _0x4a8198 of _0x26c884){console[_0x4edccb(0xf4)]('\x0aChanges\x20to\x20\x27'+_0x4a8198[_0x4edccb(0xd8)]+'\x27:'),console[_0x4edccb(0xf4)]('─'[_0x4edccb(0xdf)](0x3c)),console['error'](_0x4a8198[_0x4edccb(0xe3)]),console[_0x4edccb(0xf4)]('─'[_0x4edccb(0xdf)](0x3c));}if(_0x481387[_0x4edccb(0xf3)])return console[_0x4edccb(0xf4)](a53_0x2872cb['yellow'](_0x4edccb(0xf0))),0x0;if(_0x408ad8[_0x4edccb(0x115)]===0x0&&_0x26c884[_0x4edccb(0x115)]===0x0)return console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0x120)](_0x4edccb(0x10d))),saveSessionContext({'parent_segment':_0x491cca[_0x4edccb(0x101)]},_0x481387[_0x4edccb(0xd9)]),console['error'](a53_0x2872cb['green'](_0x4edccb(0x105)+a53_0x2872cb[_0x4edccb(0xe6)](_0x4edccb(0x10c))+_0x4edccb(0xf7)+a53_0x2872cb['cyan'](_0x491cca[_0x4edccb(0x101)]))),0x0;if(!_0x481387[_0x4edccb(0xde)]){if(!isInteractive())return console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0xe2)](_0x4edccb(0x10e)),_0x4edccb(0xdc)),console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0xe6)](_0x4edccb(0xef))),0x1;const _0x33559d=await confirmKey(_0x4edccb(0x112)+(_0x408ad8[_0x4edccb(0x115)]+_0x26c884[_0x4edccb(0x115)])+_0x4edccb(0x10a));if(!_0x33559d)return console[_0x4edccb(0xf4)](a53_0x2872cb['yellow'](_0x4edccb(0x108)),_0x4edccb(0x10b)),0x1;}for(const _0x154b81 of _0x491cca['files']){if(_0x154b81[_0x4edccb(0x11b)]||_0x154b81['hasChanges']){const _0x35fa89=a53_0x5f1507['dirname'](_0x154b81['absolutePath']);!existsSync(_0x35fa89)&&mkdirSync(_0x35fa89,{'recursive':!![]}),writeFileSync(_0x154b81[_0x4edccb(0xe4)],_0x154b81[_0x4edccb(0x11f)],_0x4edccb(0xce));}}return console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0x120)](_0x4edccb(0x117)+(_0x408ad8[_0x4edccb(0x115)]+_0x26c884[_0x4edccb(0x115)])+_0x4edccb(0xf5)+_0x491cca[_0x4edccb(0xd6)])),saveSessionContext({'parent_segment':_0x491cca[_0x4edccb(0x101)]},_0x481387[_0x4edccb(0xd9)]),console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0x120)](_0x4edccb(0x105)+a53_0x2872cb[_0x4edccb(0xe6)]('parent_segment')+'\x20=\x20'+a53_0x2872cb[_0x4edccb(0xf1)](_0x491cca[_0x4edccb(0x101)]))),0x0;}}
1
+ const a54_0xa278a4=a54_0x89ba;(function(_0x286194,_0x3cbbe9){const _0x86d5b7=a54_0x89ba,_0x1f8f3a=_0x286194();while(!![]){try{const _0x659916=-parseInt(_0x86d5b7(0x16d))/0x1+-parseInt(_0x86d5b7(0x15b))/0x2+parseInt(_0x86d5b7(0x148))/0x3*(parseInt(_0x86d5b7(0x16e))/0x4)+parseInt(_0x86d5b7(0x168))/0x5+parseInt(_0x86d5b7(0x135))/0x6*(-parseInt(_0x86d5b7(0x15a))/0x7)+-parseInt(_0x86d5b7(0x141))/0x8+parseInt(_0x86d5b7(0x163))/0x9;if(_0x659916===_0x3cbbe9)break;else _0x1f8f3a['push'](_0x1f8f3a['shift']());}catch(_0x29ba0d){_0x1f8f3a['push'](_0x1f8f3a['shift']());}}}(a54_0x2330,0xdac70));function a54_0x2330(){const _0x4fdeaf=['filter','site','name','\x20files?','\x20files\x20to\x20','setPhase','no_parent','✔\x20Pulled\x20','segment:pull','Error:\x20','\x27...','\x20\x20🗺️\x20\x20','counts','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','targetDir','\x20=\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)','732571yvPrjb','1008872VdGrQx','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20\x20🎯\x20','-\x20no\x20files\x20written','diff','activations','\x20with\x20','\x0aPull\x20summary\x20for\x20\x27','7568631qaEABb','isNew','parent_segment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','file','5630875vqWtxc','verbose','\x20changed\x20files','\x20journeys','yellow','287310qJhnVS','2324TwJiLN','repeat','journeyVersions','Write\x20','dim','description','✔\x20All\x20files\x20are\x20up\x20to\x20date','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','cwd','execute','cyan','Pulling\x20segments\x20from\x20\x27','message','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','✔\x20Context\x20set:\x20','absolutePath','relativePath','data','journeys','Aborted.','24IqQeqh','green','\x20new\x20files','parentName','length','dryRun','type','error','\x20activations','\x0aError:','Parent\x20segment:\x20','yes','10640104mBFWLT','dirname','segments','hasChanges','\x20versions)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','session','7587jRodYq'];a54_0x2330=function(){return _0x4fdeaf;};return a54_0x2330();}import{BaseCommand}from'./command.js';function a54_0x89ba(_0x2ec288,_0xbf0b47){_0x2ec288=_0x2ec288-0x132;const _0x23301a=a54_0x2330();let _0x89baff=_0x23301a[_0x2ec288];return _0x89baff;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a54_0x11ea59 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a54_0x3e92e7 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{[a54_0xa278a4(0x14b)]=a54_0xa278a4(0x151);[a54_0xa278a4(0x173)]=a54_0xa278a4(0x17b);async[a54_0xa278a4(0x177)](_0x4f0824){const _0x2f5d51=a54_0xa278a4,{options:_0xade8fc,args:_0xccc4a9,tdx:_0x33f232}=_0x4f0824,_0x74299=_0xade8fc,_0x3be4c0=await resolveTarget({'arg':_0xccc4a9[0x0],'contextParent':_0xade8fc['parentSegment'],'cwd':process[_0x2f5d51(0x176)]()});if(!isSuccessfulResolution(_0x3be4c0))return _0x3be4c0['errorCode']===_0x2f5d51(0x14f)?(console[_0x2f5d51(0x13c)](a54_0x11ea59[_0x2f5d51(0x16c)](_0x2f5d51(0x146))),console[_0x2f5d51(0x13c)](_0x2f5d51(0x159)),console['error'](_0x2f5d51(0x156)),console['error'](_0x2f5d51(0x15c))):(console[_0x2f5d51(0x13c)](a54_0x11ea59['red'](_0x2f5d51(0x152)+_0x3be4c0[_0x2f5d51(0x17a)]+'\x0a')),_0x3be4c0['helpText']&&console[_0x2f5d51(0x13c)](a54_0x11ea59[_0x2f5d51(0x178)](_0x3be4c0['helpText']))),0x1;const _0x4b2a0e=_0x3be4c0['parentName'],_0x2468bc=_0x3be4c0[_0x2f5d51(0x157)],_0x1bd8cc=_0x3be4c0[_0x2f5d51(0x13b)]===_0x2f5d51(0x167)?_0x3be4c0['resourceName']:undefined;_0x74299[_0x2f5d51(0x169)]&&(console[_0x2f5d51(0x13c)]('Site:\x20'+_0x74299[_0x2f5d51(0x14a)]),console[_0x2f5d51(0x13c)](_0x2f5d51(0x13f)+_0x4b2a0e),_0x1bd8cc&&console[_0x2f5d51(0x13c)]('Target\x20resource:\x20'+_0x1bd8cc));const _0x29cc97=await withProgressSpinner(_0x2f5d51(0x179)+_0x4b2a0e+_0x2f5d51(0x153),_0x40a480=>_0x33f232['segment']['pullSegments'](_0x4b2a0e,{'targetDir':_0x2468bc,'targetResourceName':_0x1bd8cc,'verbose':_0x74299[_0x2f5d51(0x169)],'progress':{'update':_0x4b4994=>{const _0x35cd11=_0x2f5d51;_0x40a480[_0x35cd11(0x14e)](_0x4b4994),_0x74299[_0x35cd11(0x169)]&&console['error']('\x20\x20'+_0x4b4994);}}}),{'verbose':_0x74299[_0x2f5d51(0x169)]}),_0x53dc39=_0x29cc97[_0x2f5d51(0x132)];if(_0x53dc39[_0x2f5d51(0x155)]['segments']===0x0&&_0x53dc39[_0x2f5d51(0x155)][_0x2f5d51(0x133)]===0x0)return console['error'](a54_0x11ea59[_0x2f5d51(0x16c)](_0x2f5d51(0x175)+_0x53dc39[_0x2f5d51(0x138)]+'\x27')),0x0;const _0x4ec405=_0x53dc39['files']['filter'](_0x5bc380=>_0x5bc380[_0x2f5d51(0x164)]),_0x3bc756=_0x53dc39['files'][_0x2f5d51(0x149)](_0x174cd5=>!_0x174cd5[_0x2f5d51(0x164)]&&_0x174cd5[_0x2f5d51(0x144)]),_0x6feef=_0x53dc39['files']['filter'](_0xf2d4b9=>!_0xf2d4b9['isNew']&&!_0xf2d4b9['hasChanges']);console['error'](_0x2f5d51(0x162)+_0x53dc39[_0x2f5d51(0x138)]+'\x27:'),console['error'](_0x2f5d51(0x15d)+a54_0x11ea59[_0x2f5d51(0x178)](_0x53dc39['counts'][_0x2f5d51(0x143)]+'\x20segments')+_0x2f5d51(0x161)+a54_0x11ea59[_0x2f5d51(0x178)](_0x53dc39[_0x2f5d51(0x155)][_0x2f5d51(0x160)]+_0x2f5d51(0x13d)));if(_0x53dc39['counts'][_0x2f5d51(0x133)]>0x0){const _0x3fb00f=_0x53dc39[_0x2f5d51(0x155)][_0x2f5d51(0x170)]>_0x53dc39['counts'][_0x2f5d51(0x133)]?'\x20('+_0x53dc39['counts'][_0x2f5d51(0x170)]+_0x2f5d51(0x145):'';console[_0x2f5d51(0x13c)](_0x2f5d51(0x154)+a54_0x11ea59['cyan'](_0x53dc39['counts'][_0x2f5d51(0x133)]+_0x2f5d51(0x16b))+a54_0x11ea59[_0x2f5d51(0x172)](_0x3fb00f));}console['error']('\x20\x20'+a54_0x11ea59[_0x2f5d51(0x136)]('+\x20'+_0x4ec405[_0x2f5d51(0x139)]+_0x2f5d51(0x137))),console[_0x2f5d51(0x13c)]('\x20\x20'+a54_0x11ea59[_0x2f5d51(0x16c)]('~\x20'+_0x3bc756[_0x2f5d51(0x139)]+_0x2f5d51(0x16a))),console['error']('\x20\x20'+a54_0x11ea59['dim']('=\x20'+_0x6feef[_0x2f5d51(0x139)]+'\x20unchanged\x20files')),console[_0x2f5d51(0x13c)]('\x20\x20Target:\x20'+a54_0x11ea59[_0x2f5d51(0x178)](_0x53dc39[_0x2f5d51(0x157)])+'\x0a');if(_0x3bc756[_0x2f5d51(0x139)]>0x0)for(const _0x5d0905 of _0x3bc756){console['error']('\x0aChanges\x20to\x20\x27'+_0x5d0905[_0x2f5d51(0x17e)]+'\x27:'),console[_0x2f5d51(0x13c)]('─'[_0x2f5d51(0x16f)](0x3c)),console[_0x2f5d51(0x13c)](_0x5d0905[_0x2f5d51(0x15f)]),console['error']('─'[_0x2f5d51(0x16f)](0x3c));}if(_0x74299[_0x2f5d51(0x13a)])return console['error'](a54_0x11ea59[_0x2f5d51(0x16c)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4ec405[_0x2f5d51(0x139)]===0x0&&_0x3bc756[_0x2f5d51(0x139)]===0x0)return console[_0x2f5d51(0x13c)](a54_0x11ea59[_0x2f5d51(0x136)](_0x2f5d51(0x174))),saveSessionContext({'parent_segment':_0x53dc39[_0x2f5d51(0x138)]},_0x74299[_0x2f5d51(0x147)]),console[_0x2f5d51(0x13c)](a54_0x11ea59[_0x2f5d51(0x136)](_0x2f5d51(0x17c)+a54_0x11ea59[_0x2f5d51(0x172)](_0x2f5d51(0x165))+_0x2f5d51(0x158)+a54_0x11ea59[_0x2f5d51(0x178)](_0x53dc39[_0x2f5d51(0x138)]))),0x0;if(!_0x74299[_0x2f5d51(0x140)]){if(!isInteractive())return console['error'](a54_0x11ea59['red'](_0x2f5d51(0x13e)),_0x2f5d51(0x166)),console['error'](a54_0x11ea59['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x21dc8b=await confirmKey(_0x2f5d51(0x171)+(_0x4ec405[_0x2f5d51(0x139)]+_0x3bc756['length'])+_0x2f5d51(0x14c));if(!_0x21dc8b)return console[_0x2f5d51(0x13c)](a54_0x11ea59[_0x2f5d51(0x16c)](_0x2f5d51(0x134)),_0x2f5d51(0x15e)),0x1;}for(const _0x293935 of _0x53dc39['files']){if(_0x293935[_0x2f5d51(0x164)]||_0x293935[_0x2f5d51(0x144)]){const _0x3a5d9b=a54_0x3e92e7[_0x2f5d51(0x142)](_0x293935['absolutePath']);!existsSync(_0x3a5d9b)&&mkdirSync(_0x3a5d9b,{'recursive':!![]}),writeFileSync(_0x293935[_0x2f5d51(0x17d)],_0x293935['content'],'utf-8');}}return console['error'](a54_0x11ea59['green'](_0x2f5d51(0x150)+(_0x4ec405[_0x2f5d51(0x139)]+_0x3bc756[_0x2f5d51(0x139)])+_0x2f5d51(0x14d)+_0x53dc39['targetDir'])),saveSessionContext({'parent_segment':_0x53dc39[_0x2f5d51(0x138)]},_0x74299['session']),console['error'](a54_0x11ea59['green'](_0x2f5d51(0x17c)+a54_0x11ea59[_0x2f5d51(0x172)](_0x2f5d51(0x165))+'\x20=\x20'+a54_0x11ea59['cyan'](_0x53dc39['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a54_0x176b0d=a54_0x2f30;(function(_0x386f1c,_0x25095e){const _0x224aeb=a54_0x2f30,_0xeaaeee=_0x386f1c();while(!![]){try{const _0x3de886=parseInt(_0x224aeb(0x11d))/0x1+parseInt(_0x224aeb(0x1af))/0x2*(-parseInt(_0x224aeb(0x146))/0x3)+parseInt(_0x224aeb(0x18f))/0x4+-parseInt(_0x224aeb(0x125))/0x5*(parseInt(_0x224aeb(0x1a0))/0x6)+-parseInt(_0x224aeb(0x136))/0x7+parseInt(_0x224aeb(0x15a))/0x8+parseInt(_0x224aeb(0x135))/0x9;if(_0x3de886===_0x25095e)break;else _0xeaaeee['push'](_0xeaaeee['shift']());}catch(_0x232c2d){_0xeaaeee['push'](_0xeaaeee['shift']());}}}(a54_0x4e73,0x27b48));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';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 a54_0x259b91 from'chalk';function a54_0x2f30(_0x454c6e,_0x58e117){_0x454c6e=_0x454c6e-0x119;const _0x4e732d=a54_0x4e73();let _0x2f3049=_0x4e732d[_0x454c6e];return _0x2f3049;}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';function a54_0x4e73(){const _0x5367c8=['\x20unchanged','Fetching\x20connections\x20for\x20name\x20resolution...','dryRun','join','No\x20','journeys','184522XbYFBX','\x20\x20Journeys:\x20','journeyBundleId','unchanged','dim','\x0aPush\x20summary\x20for\x20\x27','map','/j/da/je','10785PkaWpN','\x20YAML\x20files\x20found','add','no_parent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parentFolder','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20to\x20delete','changed','message','listFolders','existingSegment','createdSegmentIds','toString','getMetadataWithCache','\x20new','281340XydjER','1009764VuBPsm','parentSegment','\x20\x20\x20\x20','\x20\x20📊\x20Segments:','folderPath','delete','\x20to\x20update','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)','\x20deleted','length','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','description','get','yamlConfig','parent_name','attributes','12VmnzNW','error','setPhase','segment\x20or\x20journey','Scoped\x20to\x20folder:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','toDelete','idToName','type','\x0aValidation\x20failed:','\x20updated','journeyBundleName','(Journey\x20will\x20be\x20deleted)','journeyId','green','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Aborted.','site','Delete\x20journey:','Site:\x20','2305928UyyXRA','segmentFolderId','diff','all','toCreate','targetDir','Resolving\x20parent\x20segment\x20\x27','getJourney','execute','cyan','Delete\x20segment:','created','updatedAt','Parent\x20segment:\x20','listSegments','\x20\x20Activations:\x20','deleted','\x20changes?','isNew','then','resolveParentId','audienceId','Preparing\x20journeys...','Source\x20directory:\x20','connection','isScoped','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','/e/','getParent','buildUserMaps','.yml','\x0a✔\x20Push\x20complete','updated','journey','/app/ps/','New\x20segment:','Fetching\x20existing\x20data...','Push\x20','data','activations','\x0aError:','push','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','new','\x20to\x20create','filePath','yellow','journeysOnly','Error:\x20','\x20folders\x20to\x20create','Folders\x20to\x20create:','folderId','1223396AyeHAX','\x20created','red','relationships','\x20changed','\x20activations]','Error:\x20Directory\x20not\x20found:\x20','file','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','results','errorCode','segment','filter','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','verbose','792rsihOj','segments','\x20\x20Segments:\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','existingJourney','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','folders','/sb/da/esr','repeat','nameToId','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','user','blue','name','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','109132CqMApB','Error\x20parsing\x20YAML:\x20'];a54_0x4e73=function(){return _0x5367c8;};return a54_0x4e73();}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{[a54_0x176b0d(0x1ad)]='segment:push';['description']=a54_0x176b0d(0x1aa);async[a54_0x176b0d(0x162)](_0x33d862){const _0x14523c=a54_0x176b0d,{options:_0x3424cb,args:_0x559594,tdx:_0x58bf16}=_0x33d862,_0x5cb7c0=_0x3424cb,_0x20b21c=await resolveTarget({'arg':_0x559594[0x0],'contextParent':_0x3424cb[_0x14523c(0x137)],'cwd':process[_0x14523c(0x19d)]()});if(!isSuccessfulResolution(_0x20b21c))return _0x20b21c[_0x14523c(0x19a)]===_0x14523c(0x128)?(console[_0x14523c(0x147)](a54_0x259b91['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x14523c(0x147)](_0x14523c(0x13d)),console['error'](_0x14523c(0x19e)),console['error'](_0x14523c(0x198))):(console['error'](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x18b)+_0x20b21c['message']+'\x0a')),_0x20b21c['helpText']&&console['error'](a54_0x259b91[_0x14523c(0x163)](_0x20b21c['helpText']))),0x1;if(_0x20b21c[_0x14523c(0x14e)]===_0x14523c(0x144))return console[_0x14523c(0x147)](a54_0x259b91['red'](_0x14523c(0x195)+_0x20b21c['targetDir']+'\x0a')),console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x163)](_0x14523c(0x1a5))),0x1;const _0xaff5ff=_0x20b21c['parentName'],_0x10735a=_0x20b21c[_0x14523c(0x15f)],_0x5b081b=_0x20b21c[_0x14523c(0x14e)]===_0x14523c(0x196)?_0x20b21c[_0x14523c(0x188)]:undefined,_0x5eb224=getScopedDetails(_0x20b21c),_0x37087c=_0x5eb224?.[_0x14523c(0x173)]??![],_0x2dd484=_0x5eb224?.['scopedFolderPath']??'';if(!existsSync(_0x10735a))return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)]('Error:\x20Directory\x20not\x20found:\x20'+_0x10735a+'\x0a')),console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x163)](_0x14523c(0x1a5))),0x1;_0x5cb7c0['verbose']&&(console[_0x14523c(0x147)](_0x14523c(0x159)+_0x5cb7c0['site']),console[_0x14523c(0x147)](_0x14523c(0x167)+_0xaff5ff),console[_0x14523c(0x147)](_0x14523c(0x171)+_0x10735a),_0x37087c&&console[_0x14523c(0x147)](_0x14523c(0x14a)+_0x2dd484));const _0x225942=await withSpinner(_0x14523c(0x160)+_0xaff5ff+'\x27...',()=>_0x58bf16['segment'][_0x14523c(0x16e)](_0xaff5ff),{'verbose':_0x5cb7c0['verbose']}),_0x400fee=_0x225942['data'],{parentSegmentResult:_0x30ed1b,segmentsResult:_0x102cdb,foldersResult:_0x5f077f,journeysWithDetailsResult:_0x37782b,userMaps:_0x2e50c4}=await withSpinner(_0x14523c(0x17f),async()=>{const _0x5cd979=_0x14523c,[_0x54e68e,_0x5c374e,_0x19b7f2,_0x2be1d3,_0x5bf84f]=await Promise[_0x5cd979(0x15d)]([_0x58bf16['segment'][_0x5cd979(0x177)](_0x400fee),_0x58bf16[_0x5cd979(0x19b)][_0x5cd979(0x168)](_0x400fee),_0x58bf16[_0x5cd979(0x19b)][_0x5cd979(0x12f)](_0x400fee),_0x58bf16[_0x5cd979(0x17c)]['listJourneysWithDetailsFromParentSegment'](_0x400fee,{'includeAllVersions':!![]}),_0x58bf16[_0x5cd979(0x1ab)][_0x5cd979(0x178)]()]);return{'parentSegmentResult':_0x54e68e,'segmentsResult':_0x5c374e,'foldersResult':_0x19b7f2,'journeysWithDetailsResult':_0x2be1d3,'userMaps':_0x5bf84f};},{'verbose':_0x5cb7c0[_0x14523c(0x19f)]})[_0x14523c(0x16d)](_0x734c25=>_0x734c25[_0x14523c(0x181)]),_0x4e85ee=_0x30ed1b,_0x480462=extractRootFolderId(_0x4e85ee),_0x1ce3fb=_0x102cdb,_0x144d4c=_0x5f077f,{journeys:_0x3244ec,activationStepsById:_0x1a2b82}=_0x37782b,_0x14cc0b=new Map(_0x3244ec[_0x14523c(0x123)](_0x32ca1e=>[_0x32ca1e['id'],_0x32ca1e])),_0x1ced94=_0x3244ec[_0x14523c(0x123)](_0x4b4fbe=>({'id':_0x4b4fbe['id'],'name':_0x4b4fbe['attributes'][_0x14523c(0x1ad)],'journeyBundleName':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x151)]||'','journeyBundleId':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x11f)]||'','versionNumber':_0x4b4fbe[_0x14523c(0x145)]['versionNumber'],'description':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x141)],'state':_0x4b4fbe[_0x14523c(0x145)]['state'],'paused':_0x4b4fbe['attributes']['paused'],'audienceId':_0x4b4fbe['attributes'][_0x14523c(0x16f)],'folderId':_0x4b4fbe[_0x14523c(0x192)]?.[_0x14523c(0x12a)]?.[_0x14523c(0x181)]?.['id'],'createdAt':_0x4b4fbe[_0x14523c(0x145)]['createdAt'],'updatedAt':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x166)]})),{emailToId:_0x180459,idToEmail:_0x559a97}=_0x2e50c4,_0x237bed=await withSpinner(_0x14523c(0x1b2),async()=>{const _0x3a19a9=await _0x58bf16['connection']['list']();return buildConnectionMaps(_0x3a19a9);},{'verbose':_0x5cb7c0[_0x14523c(0x19f)]})[_0x14523c(0x16d)](_0xab439d=>_0xab439d[_0x14523c(0x181)]),_0x26cc27=_0x237bed[_0x14523c(0x1a9)],_0x1e07cb=_0x237bed[_0x14523c(0x14d)],_0x8f189f=_0x237bed['nameToType'],_0x5c3de8={'emailToIdMap':_0x180459,'connectionNameToIdMap':_0x26cc27,'connectionNameToTypeMap':_0x8f189f,'getSchema':_0x2c9add=>_0x58bf16[_0x14523c(0x172)]['getOutputSchemaWithCache'](_0x2c9add),'getMetadata':_0x37d9bf=>_0x58bf16[_0x14523c(0x172)][_0x14523c(0x133)](_0x37d9bf)};let {pathToId:_0x17bfe8,idToPath:_0x11aa74}=buildFolderMaps(_0x144d4c);const _0x174115=buildSegmentLookupMap(_0x1ce3fb,_0x11aa74),_0x4c2cd3=buildSegmentNameToIdMap(_0x1ce3fb),_0xfbdfdb=buildJourneyBundleLookupMap(_0x1ced94,_0x11aa74);let _0x4836f3;if(_0x5b081b){if(!_0x5b081b[_0x14523c(0x197)](_0x14523c(0x179))&&!_0x5b081b['endsWith']('.yaml'))return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x175)+_0x5b081b+'\x0a')),0x1;_0x4836f3=[_0x5b081b];}else _0x4836f3=findYamlFiles(_0x10735a);if(_0x4836f3[_0x14523c(0x13f)]===0x0)return console[_0x14523c(0x147)](a54_0x259b91['red'](_0x14523c(0x1ae)+_0x10735a+'\x0a')),console['error'](a54_0x259b91[_0x14523c(0x163)](_0x14523c(0x14b))),0x1;let _0x5b82fc,_0x4032b5;try{const _0x45a3fa=parseAndClassifyYamlFiles(_0x4836f3,_0x10735a,{'skipSegments':_0x5cb7c0[_0x14523c(0x18a)]});_0x5b82fc=_0x45a3fa[_0x14523c(0x1a1)],_0x4032b5=_0x45a3fa['journeys'];const _0x36f93e=validateParsedFiles(_0x45a3fa,_0x10735a);if(_0x36f93e[_0x14523c(0x13f)]>0x0)return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x14f))),console['error'](formatValidationErrors(_0x36f93e)),console['error'](a54_0x259b91[_0x14523c(0x189)](_0x14523c(0x185))),0x1;}catch(_0x42c368){return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x1b0)+(_0x42c368 instanceof Error?_0x42c368[_0x14523c(0x12e)]:_0x42c368))),0x1;}if(_0x5b82fc[_0x14523c(0x13f)]===0x0&&_0x4032b5[_0x14523c(0x13f)]===0x0){const _0x46a4dd=_0x5cb7c0[_0x14523c(0x18a)]?_0x14523c(0x17c):_0x14523c(0x149);return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)](_0x14523c(0x11b)+_0x46a4dd+_0x14523c(0x126))),0x0;}const _0x4473a4=new Map();_0x1ce3fb[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x1ce3fb,async _0x408d65=>{const _0x153cad=a54_0x2f30,_0x289a2e=await _0x58bf16[_0x153cad(0x19b)]['listActivations'](_0x400fee,_0x408d65['id']);_0x4473a4['set'](_0x408d65['id'],_0x289a2e);});},{'verbose':_0x5cb7c0[_0x14523c(0x19f)]});const {segmentFiles:_0x1acc32,foldersToCreate:_0x46a36e}=await prepareSegmentFiles(_0x5b82fc,{'segmentByFolderAndName':_0x174115,'activationsBySegmentId':_0x4473a4,'folderPathToId':_0x17bfe8,'idToEmailMap':_0x559a97,'connectionIdToNameMap':_0x1e07cb},_0x5c3de8,_0x37087c,_0x2dd484),_0x2ed6e7=_0x5b081b?[]:findSegmentsToDelete(_0x1ce3fb,_0x5b82fc[_0x14523c(0x123)](({yamlConfig:_0x285fb3,folderPath:_0x19c2c6})=>({'yamlConfig':_0x285fb3,'folderPath':resolveTDFolderPath(_0x19c2c6,_0x37087c,_0x2dd484)})),_0x11aa74,_0x2dd484,_0x37087c),{journeyFiles:_0x516161,foldersToCreate:_0x22f2cc}=await withProgressSpinner(_0x14523c(0x170),async _0x5dde6e=>prepareJourneyFiles(_0x4032b5,{'fetchJourney':async _0xd7f77b=>_0x58bf16['journey'][_0x14523c(0x161)](_0xd7f77b[_0x14523c(0x153)]),'journeyBundlesByFolderAndName':_0xfbdfdb,'folderPathToId':_0x17bfe8,'idToEmailMap':_0x559a97,'connectionIdToNameMap':_0x1e07cb,'existingSegments':_0x1ce3fb,'parentId':_0x400fee,'deps':_0x58bf16,'progress':{'update':_0x52a27b=>{const _0x3556db=_0x14523c;_0x5dde6e[_0x3556db(0x148)](_0x52a27b),_0x5cb7c0[_0x3556db(0x19f)]&&console[_0x3556db(0x147)]('\x20\x20'+_0x52a27b);}},'journeyById':_0x14cc0b,'activationStepsById':_0x1a2b82},_0x37087c,_0x2dd484),{'verbose':_0x5cb7c0[_0x14523c(0x19f)]})['then'](_0x213ae3=>_0x213ae3[_0x14523c(0x181)]);for(const _0x390567 of _0x22f2cc){_0x46a36e[_0x14523c(0x127)](_0x390567);}const _0x4d06c5=_0x5b081b?[]:findJourneysToDelete(_0x1ced94,_0x4032b5['map'](({yamlConfig:_0x3e6966,folderPath:_0x2a2457})=>({'yamlConfig':_0x3e6966,'folderPath':resolveTDFolderPath(_0x2a2457,_0x37087c,_0x2dd484)})),_0x11aa74,_0x2dd484,_0x37087c),_0x32a1e8=calculatePushStats(_0x1acc32,_0x516161,_0x46a36e,_0x2ed6e7,_0x4d06c5,!!_0x5cb7c0['delete'],!!_0x5cb7c0[_0x14523c(0x18a)]),_0x2d353c=_0x32a1e8[_0x14523c(0x1a1)][_0x14523c(0x186)],_0x54f7eb=_0x32a1e8[_0x14523c(0x1a1)][_0x14523c(0x12d)],_0x3cedbf=_0x32a1e8['segments'][_0x14523c(0x120)],_0x387ecd=_0x32a1e8[_0x14523c(0x1a1)][_0x14523c(0x14c)],_0xf94e11=_0x32a1e8[_0x14523c(0x1a6)][_0x14523c(0x15e)],_0x4859e8=_0x32a1e8[_0x14523c(0x11c)][_0x14523c(0x186)],_0x58aefc=_0x32a1e8['journeys'][_0x14523c(0x12d)],_0x2c5765=_0x32a1e8[_0x14523c(0x11c)][_0x14523c(0x120)],_0x575920=_0x32a1e8[_0x14523c(0x11c)][_0x14523c(0x14c)],_0x1ba904=_0x32a1e8[_0x14523c(0x182)][_0x14523c(0x15d)],_0x5690fe=_0x32a1e8[_0x14523c(0x182)][_0x14523c(0x15e)],_0x57a9d1=_0x32a1e8['activations']['toUpdate'],_0x12977=_0x32a1e8[_0x14523c(0x182)][_0x14523c(0x14c)];console[_0x14523c(0x147)](_0x14523c(0x122)+_0xaff5ff+'\x27:');_0xf94e11['length']>0x0&&console['error']('\x20\x20'+a54_0x259b91['blue']('📁\x20'+_0xf94e11['length']+_0x14523c(0x18c)));if(!_0x5cb7c0[_0x14523c(0x18a)]){console[_0x14523c(0x147)](_0x14523c(0x139)),console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91['green']('+\x20'+_0x2d353c[_0x14523c(0x13f)]+_0x14523c(0x134))),console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x189)]('~\x20'+_0x54f7eb[_0x14523c(0x13f)]+_0x14523c(0x193)));if(_0x387ecd[_0x14523c(0x13f)]>0x0)console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x191)]('-\x20'+_0x387ecd[_0x14523c(0x13f)]+_0x14523c(0x12c)));else _0x2ed6e7[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x13b)]&&console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x121)](_0x2ed6e7[_0x14523c(0x13f)]+_0x14523c(0x174)));console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91[_0x14523c(0x121)]('=\x20'+_0x3cedbf['length']+_0x14523c(0x1b1)));}if(_0x516161[_0x14523c(0x13f)]>0x0||_0x4d06c5[_0x14523c(0x13f)]>0x0){console[_0x14523c(0x147)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91['green']('+\x20'+_0x4859e8[_0x14523c(0x13f)]+_0x14523c(0x134))),console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91[_0x14523c(0x189)]('~\x20'+_0x58aefc[_0x14523c(0x13f)]+'\x20changed'));if(_0x575920['length']>0x0)console['error']('\x20\x20\x20\x20'+a54_0x259b91['red']('-\x20'+_0x575920['length']+_0x14523c(0x12c)));else _0x4d06c5[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x13b)]&&console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91[_0x14523c(0x121)](_0x4d06c5['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x121)]('=\x20'+_0x2c5765[_0x14523c(0x13f)]+_0x14523c(0x1b1)));}_0x1ba904['length']>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&(console[_0x14523c(0x147)](''),console['error']('\x20\x20Activations:'),_0x5690fe[_0x14523c(0x13f)]>0x0&&console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91['green']('+\x20'+_0x5690fe[_0x14523c(0x13f)]+_0x14523c(0x187))),_0x57a9d1['length']>0x0&&console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x189)]('~\x20'+_0x57a9d1[_0x14523c(0x13f)]+_0x14523c(0x13c))),_0x12977[_0x14523c(0x13f)]>0x0&&console['error'](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x191)]('-\x20'+_0x12977[_0x14523c(0x13f)]+_0x14523c(0x12c))));console[_0x14523c(0x147)]('\x20\x20Source:\x20'+a54_0x259b91[_0x14523c(0x163)](_0x10735a)+'\x0a');if(_0xf94e11[_0x14523c(0x13f)]>0x0){console[_0x14523c(0x147)](_0x14523c(0x18d));for(const _0x4e6165 of _0xf94e11){console[_0x14523c(0x147)]('\x20\x20'+a54_0x259b91['blue']('+')+'\x20'+_0x4e6165);}console['error']('');}if(_0x2d353c['length']>0x0&&!_0x5cb7c0['journeysOnly'])for(const _0x808dd6 of _0x2d353c){const _0x1fd7f2=_0x808dd6['folderPath']?_0x808dd6[_0x14523c(0x13a)]+'/'+_0x808dd6[_0x14523c(0x143)][_0x14523c(0x1ad)]:_0x808dd6['yamlConfig'][_0x14523c(0x1ad)],_0x5edf97=_0x808dd6['yamlConfig']['activations']?.[_0x14523c(0x13f)]||0x0,_0x163bcc=_0x5edf97>0x0?a54_0x259b91[_0x14523c(0x121)]('\x20['+_0x5edf97+'\x20activations]'):'';console['error']('\x0a'+a54_0x259b91[_0x14523c(0x154)](_0x14523c(0x17e))+'\x20'+_0x1fd7f2+_0x163bcc),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c)),_0x808dd6['diff']&&console[_0x14523c(0x147)](_0x808dd6[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x387ecd[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x18a)])for(const _0x74bb7 of _0x387ecd){const _0x116574=_0x74bb7[_0x14523c(0x15b)]?_0x11aa74[_0x14523c(0x142)](_0x74bb7['segmentFolderId'][_0x14523c(0x132)]())||'':'',_0x5501eb=_0x116574?_0x116574+'/'+_0x74bb7[_0x14523c(0x1ad)]:_0x74bb7['name'],_0x38daf4=_0x4473a4[_0x14523c(0x142)](_0x74bb7['id'])||[],_0x2c7a02=_0x38daf4[_0x14523c(0x13f)]>0x0?a54_0x259b91['dim']('\x20['+_0x38daf4['length']+_0x14523c(0x194)):'';console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x164))+'\x20'+_0x5501eb+_0x2c7a02),console['error']('─'[_0x14523c(0x1a8)](0x3c));const _0x2f0c7c=segmentWithActivationsToYaml(_0x74bb7,_0x38daf4,undefined,_0x559a97,_0x1e07cb),_0x26392=segmentToYamlString(_0x2f0c7c),_0x3204da=generateDiff(_0x26392,'');console['error'](formatDiffWithColors(_0x3204da)),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}const _0x1d9d58=_0x1acc32[_0x14523c(0x19c)](_0x362cc6=>!_0x362cc6[_0x14523c(0x16c)]&&_0x362cc6[_0x14523c(0x15c)]);if(_0x1d9d58[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0['journeysOnly'])for(const _0x2eb2c2 of _0x1d9d58){const _0x4c58da=_0x2eb2c2[_0x14523c(0x13a)]?_0x2eb2c2[_0x14523c(0x13a)]+'/'+_0x2eb2c2[_0x14523c(0x143)][_0x14523c(0x1ad)]:_0x2eb2c2['yamlConfig'][_0x14523c(0x1ad)];console['error']('\x0a'+a54_0x259b91[_0x14523c(0x189)]('Changes\x20to:')+'\x20'+_0x4c58da),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c)),console[_0x14523c(0x147)](_0x2eb2c2[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x4859e8[_0x14523c(0x13f)]>0x0)for(const _0x5acc8e of _0x4859e8){const _0x2a184a=_0x5acc8e[_0x14523c(0x13a)]?_0x5acc8e[_0x14523c(0x13a)]+'/'+_0x5acc8e[_0x14523c(0x143)][_0x14523c(0x1ad)]:_0x5acc8e['yamlConfig']['name'];console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x154)]('New\x20journey:')+'\x20'+_0x2a184a),console[_0x14523c(0x147)]('─'['repeat'](0x3c)),_0x5acc8e[_0x14523c(0x15c)]&&console[_0x14523c(0x147)](_0x5acc8e[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}const _0x43767f=_0x516161[_0x14523c(0x19c)](_0x647519=>!_0x647519[_0x14523c(0x16c)]&&_0x647519[_0x14523c(0x15c)]);if(_0x43767f[_0x14523c(0x13f)]>0x0)for(const _0x1fba90 of _0x43767f){const _0x488a2e=_0x1fba90[_0x14523c(0x13a)]?_0x1fba90[_0x14523c(0x13a)]+'/'+_0x1fba90[_0x14523c(0x143)]['name']:_0x1fba90[_0x14523c(0x143)][_0x14523c(0x1ad)];console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x189)]('Changes\x20to\x20journey:')+'\x20'+_0x488a2e),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c)),console[_0x14523c(0x147)](_0x1fba90[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x575920[_0x14523c(0x13f)]>0x0)for(const _0x40c304 of _0x575920){const _0x45a842=_0x40c304[_0x14523c(0x18e)]?_0x11aa74['get'](_0x40c304[_0x14523c(0x18e)])||'':'',_0x250d9b=_0x45a842?_0x45a842+'/'+_0x40c304['journeyBundleName']:_0x40c304[_0x14523c(0x151)];console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x158))+'\x20'+_0x250d9b),console[_0x14523c(0x147)]('─'['repeat'](0x3c)),console[_0x14523c(0x147)](a54_0x259b91['red'](_0x14523c(0x152))),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x5cb7c0[_0x14523c(0x119)])return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x480d51=_0x5cb7c0[_0x14523c(0x18a)]?![]:_0x2d353c[_0x14523c(0x13f)]>0x0||_0x54f7eb[_0x14523c(0x13f)]>0x0||_0x387ecd[_0x14523c(0x13f)]>0x0,_0x57f2b3=_0x4859e8['length']>0x0||_0x58aefc['length']>0x0||_0x575920[_0x14523c(0x13f)]>0x0,_0x5a73ac=_0x5cb7c0[_0x14523c(0x18a)]?![]:_0x1ba904[_0x14523c(0x13f)]>0x0,_0x4205c4=_0xf94e11['length']>0x0;if(!_0x480d51&&!_0x57f2b3&&!_0x5a73ac&&!_0x4205c4){const _0x34cc40=_0x5cb7c0[_0x14523c(0x18a)]?_0x14523c(0x1a3):_0x14523c(0x12b);console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x154)](_0x34cc40));if(_0x5b081b&&_0x3cedbf[_0x14523c(0x13f)]===0x1){const _0x2f1181=_0x3cedbf[0x0];if(_0x2f1181['existingSegment']?.['id']){const _0x4c67e8=getConsoleNextUrl(_0x5cb7c0[_0x14523c(0x157)],_0x14523c(0x17d)+_0x400fee+_0x14523c(0x176)+_0x2f1181[_0x14523c(0x130)]['id']+'/sb/da/esr');console[_0x14523c(0x147)](_0x14523c(0x155)+a54_0x259b91[_0x14523c(0x163)](_0x4c67e8));}}if(_0x5b081b&&_0x2c5765[_0x14523c(0x13f)]===0x1){const _0x3b999d=_0x2c5765[0x0];if(_0x3b999d[_0x14523c(0x1a4)]?.['id']){const _0xfda6e1=getConsoleNextUrl(_0x5cb7c0['site'],_0x14523c(0x17d)+_0x400fee+'/e/'+_0x3b999d[_0x14523c(0x1a4)]['id']+_0x14523c(0x124));console[_0x14523c(0x147)]('\x20\x20'+a54_0x259b91[_0x14523c(0x163)](_0xfda6e1));}}return 0x0;}const _0x37b5a3=_0x5cb7c0[_0x14523c(0x18a)]?_0x4859e8[_0x14523c(0x13f)]+_0x58aefc['length']+_0x575920[_0x14523c(0x13f)]+_0xf94e11[_0x14523c(0x13f)]:_0x2d353c[_0x14523c(0x13f)]+_0x54f7eb[_0x14523c(0x13f)]+_0x387ecd[_0x14523c(0x13f)]+_0x4859e8[_0x14523c(0x13f)]+_0x58aefc[_0x14523c(0x13f)]+_0x575920[_0x14523c(0x13f)]+_0xf94e11[_0x14523c(0x13f)]+_0x1ba904[_0x14523c(0x13f)];if(!_0x5cb7c0['yes']&&_0x37b5a3>0x0){if(!isInteractive())return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x183)),_0x14523c(0x129)),console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x121)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x396bcd=await confirmKey(_0x14523c(0x180)+_0x37b5a3+_0x14523c(0x16b));if(!_0x396bcd)return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)](_0x14523c(0x156))),0x1;}const _0x35e982={'withProgress':async(_0xa17b0,_0x489651)=>{const _0x245d7a=_0x14523c,_0x596f57=await withSpinner(_0xa17b0,_0x489651,{'verbose':_0x5cb7c0[_0x245d7a(0x19f)]});return{'data':_0x596f57[_0x245d7a(0x181)]};},'logInfo':_0x32acd2=>console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x1ac)]('✔\x20'+_0x32acd2)),'logSuccess':_0x23a75e=>console['error'](a54_0x259b91[_0x14523c(0x154)]('✔\x20'+_0x23a75e)),'logWarning':_0x1ac495=>console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)]('⚠\x20'+_0x1ac495)),'logDeleted':_0x5962b1=>console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)]('✔\x20'+_0x5962b1))},_0x5d9d48={'segment':_0x58bf16[_0x14523c(0x19b)],'journey':_0x58bf16['journey'],'user':_0x58bf16[_0x14523c(0x1ab)],'connection':_0x58bf16[_0x14523c(0x172)]};_0xf94e11[_0x14523c(0x13f)]>0x0&&(_0x17bfe8=await executePushFolders(_0x5d9d48,_0xf94e11,_0x17bfe8,{'parentId':_0x400fee},_0x35e982));const _0x30168c={'rootFolderId':_0x480462,'folderPathToId':_0x17bfe8,'folderIdToPath':_0x11aa74,'segmentNameToId':_0x4c2cd3,'activationsBySegmentId':_0x4473a4,'emailToIdMap':_0x180459,'idToEmailMap':_0x559a97,'connectionNameToIdMap':_0x237bed[_0x14523c(0x1a9)],'connectionIdToNameMap':_0x237bed[_0x14523c(0x14d)],'connectionNameToTypeMap':_0x8f189f},_0x371605=await executePushSegments(_0x5d9d48,_0x5cb7c0[_0x14523c(0x18a)]?[]:_0x1acc32,_0x30168c,{'parentId':_0x400fee},_0x35e982),_0x295067=_0x371605[_0x14523c(0x165)],_0x17584c=_0x371605[_0x14523c(0x17b)],_0x745f6a=_0x371605[_0x14523c(0x182)][_0x14523c(0x165)],_0x272b31=_0x371605[_0x14523c(0x182)][_0x14523c(0x17b)],_0x373beb=_0x371605[_0x14523c(0x182)][_0x14523c(0x16a)];let _0x33fdb3;if(_0x5b081b&&_0x1acc32[_0x14523c(0x13f)]===0x1){const _0x407c5d=_0x1acc32[0x0];_0x33fdb3=_0x407c5d[_0x14523c(0x130)]?.['id']??_0x371605['createdSegmentIds']['get'](_0x407c5d['yamlConfig'][_0x14523c(0x1ad)]);}const _0x2458ef=await executePushSegmentDeletions(_0x5d9d48,_0x5cb7c0[_0x14523c(0x18a)]?[]:_0x387ecd,_0x35e982);let _0x59f520=0x0,_0x1b3439=0x0,_0x209754=0x0;const _0x1a6082=new Map(_0x4c2cd3);for(const [_0x254dc2,_0x24c1ed]of _0x371605[_0x14523c(0x131)]){_0x1a6082['set'](_0x254dc2,_0x24c1ed);}if(_0x516161[_0x14523c(0x13f)]>0x0){const _0x25f8ac={..._0x30168c,'segmentNameToId':_0x1a6082,'existingSegments':_0x1ce3fb,'activationContext':_0x5c3de8},_0x3f66dd=await executePushJourneys(_0x5d9d48,_0x516161,_0x25f8ac,{'parentId':_0x400fee,'rootFolderId':_0x480462,'verbose':_0x5cb7c0['verbose']},_0x35e982);_0x59f520=_0x3f66dd[_0x14523c(0x165)],_0x1b3439=_0x3f66dd[_0x14523c(0x17b)];if(_0x5b081b&&_0x3f66dd[_0x14523c(0x199)][_0x14523c(0x13f)]===0x1){const _0x2f8bd7=_0x3f66dd['results'][0x0];if(_0x2f8bd7[_0x14523c(0x153)]){const _0x1ee98e=getConsoleNextUrl(_0x5cb7c0['site'],_0x14523c(0x17d)+_0x400fee+'/e/'+_0x2f8bd7[_0x14523c(0x153)]+_0x14523c(0x124));console['error']('\x20\x20'+a54_0x259b91[_0x14523c(0x163)](_0x1ee98e));}}}for(const _0x7c5311 of _0x575920){console[_0x14523c(0x147)](a54_0x259b91['yellow'](_0x14523c(0x140)+_0x7c5311[_0x14523c(0x151)])),_0x209754++;}const _0x1c08c5=[];if(_0x295067>0x0)_0x1c08c5[_0x14523c(0x184)](_0x295067+_0x14523c(0x190));if(_0x17584c>0x0)_0x1c08c5['push'](_0x17584c+_0x14523c(0x150));if(_0x2458ef>0x0)_0x1c08c5['push'](_0x2458ef+_0x14523c(0x13e));const _0x2ce719=[];if(_0x59f520>0x0)_0x2ce719[_0x14523c(0x184)](_0x59f520+_0x14523c(0x190));if(_0x1b3439>0x0)_0x2ce719[_0x14523c(0x184)](_0x1b3439+_0x14523c(0x150));if(_0x209754>0x0)_0x2ce719[_0x14523c(0x184)](_0x209754+'\x20deleted');const _0x281a76=[];if(_0x745f6a>0x0)_0x281a76['push'](_0x745f6a+_0x14523c(0x190));if(_0x272b31>0x0)_0x281a76[_0x14523c(0x184)](_0x272b31+_0x14523c(0x150));if(_0x373beb>0x0)_0x281a76[_0x14523c(0x184)](_0x373beb+_0x14523c(0x13e));console['error'](a54_0x259b91[_0x14523c(0x154)](_0x14523c(0x17a)));_0x1c08c5[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&console[_0x14523c(0x147)](_0x14523c(0x1a2)+_0x1c08c5[_0x14523c(0x11a)](',\x20'));_0x2ce719[_0x14523c(0x13f)]>0x0&&console[_0x14523c(0x147)](_0x14523c(0x11e)+_0x2ce719[_0x14523c(0x11a)](',\x20'));_0x281a76['length']>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&console[_0x14523c(0x147)](_0x14523c(0x169)+_0x281a76[_0x14523c(0x11a)](',\x20'));if(_0x33fdb3){const _0x3e0056=getConsoleNextUrl(_0x5cb7c0[_0x14523c(0x157)],_0x14523c(0x17d)+_0x400fee+_0x14523c(0x176)+_0x33fdb3+_0x14523c(0x1a7));console[_0x14523c(0x147)](_0x14523c(0x155)+a54_0x259b91[_0x14523c(0x163)](_0x3e0056));}return 0x0;}}
1
+ const a55_0x7b511b=a55_0x55d1;(function(_0x1bbab1,_0x43bd4c){const _0x38e27f=a55_0x55d1,_0x59826d=_0x1bbab1();while(!![]){try{const _0x163870=parseInt(_0x38e27f(0x21b))/0x1*(parseInt(_0x38e27f(0x211))/0x2)+parseInt(_0x38e27f(0x216))/0x3+parseInt(_0x38e27f(0x265))/0x4*(-parseInt(_0x38e27f(0x1f6))/0x5)+parseInt(_0x38e27f(0x205))/0x6+parseInt(_0x38e27f(0x20a))/0x7+parseInt(_0x38e27f(0x1df))/0x8*(parseInt(_0x38e27f(0x22a))/0x9)+parseInt(_0x38e27f(0x25e))/0xa*(-parseInt(_0x38e27f(0x209))/0xb);if(_0x163870===_0x43bd4c)break;else _0x59826d['push'](_0x59826d['shift']());}catch(_0x53b23e){_0x59826d['push'](_0x59826d['shift']());}}}(a55_0x317c,0xf145c));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';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 a55_0x12f718 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';function a55_0x55d1(_0xe3c7cb,_0xa44853){_0xe3c7cb=_0xe3c7cb-0x1dc;const _0x317c15=a55_0x317c();let _0x55d12a=_0x317c15[_0xe3c7cb];return _0x55d12a;}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{[a55_0x7b511b(0x271)]=a55_0x7b511b(0x253);[a55_0x7b511b(0x266)]=a55_0x7b511b(0x1e0);async['execute'](_0x5a67b8){const _0x175024=a55_0x7b511b,{options:_0x311947,args:_0x45b816,tdx:_0x5804c8}=_0x5a67b8,_0x143a9d=_0x311947,_0x2eddf4=await resolveTarget({'arg':_0x45b816[0x0],'contextParent':_0x311947[_0x175024(0x21c)],'cwd':process[_0x175024(0x21e)]()});if(!isSuccessfulResolution(_0x2eddf4))return _0x2eddf4[_0x175024(0x1f4)]===_0x175024(0x202)?(console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x218)](_0x175024(0x22c))),console[_0x175024(0x1e8)](_0x175024(0x245)),console[_0x175024(0x1e8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console['error'](_0x175024(0x21f))):(console['error'](a55_0x12f718['red'](_0x175024(0x1e5)+_0x2eddf4[_0x175024(0x1fa)]+'\x0a')),_0x2eddf4[_0x175024(0x206)]&&console[_0x175024(0x1e8)](a55_0x12f718['cyan'](_0x2eddf4['helpText']))),0x1;if(_0x2eddf4['type']===_0x175024(0x270))return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2eddf4[_0x175024(0x1ef)]+'\x0a')),console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x20b)](_0x175024(0x210))),0x1;const _0x2869be=_0x2eddf4['parentName'],_0x3b0006=_0x2eddf4[_0x175024(0x1ef)],_0x26316a=_0x2eddf4[_0x175024(0x1e1)]===_0x175024(0x260)?_0x2eddf4[_0x175024(0x26f)]:undefined,_0x409104=getScopedDetails(_0x2eddf4),_0x21102b=_0x409104?.[_0x175024(0x24a)]??![],_0x43e80c=_0x409104?.[_0x175024(0x249)]??'';if(!existsSync(_0x3b0006))return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3b0006+'\x0a')),console['error'](a55_0x12f718['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x143a9d[_0x175024(0x1e2)]&&(console[_0x175024(0x1e8)](_0x175024(0x1e7)+_0x143a9d['site']),console[_0x175024(0x1e8)]('Parent\x20segment:\x20'+_0x2869be),console[_0x175024(0x1e8)](_0x175024(0x238)+_0x3b0006),_0x21102b&&console[_0x175024(0x1e8)](_0x175024(0x26a)+_0x43e80c));const _0x53127a=await withSpinner(_0x175024(0x1fc)+_0x2869be+_0x175024(0x25f),()=>_0x5804c8[_0x175024(0x262)]['resolveParentId'](_0x2869be),{'verbose':_0x143a9d[_0x175024(0x1e2)]}),_0x25a2cd=_0x53127a[_0x175024(0x277)],{parentSegmentResult:_0x3c8040,segmentsResult:_0x498db8,foldersResult:_0x3c48dc,journeysWithDetailsResult:_0x4ec7c1,userMaps:_0x3173d3}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x286eb0=_0x175024,[_0xb82e5a,_0x82b754,_0x317f06,_0x54062d,_0x37f0ba]=await Promise[_0x286eb0(0x23f)]([_0x5804c8[_0x286eb0(0x262)][_0x286eb0(0x200)](_0x25a2cd),_0x5804c8['segment']['listSegments'](_0x25a2cd),_0x5804c8[_0x286eb0(0x262)][_0x286eb0(0x208)](_0x25a2cd),_0x5804c8[_0x286eb0(0x234)][_0x286eb0(0x214)](_0x25a2cd,{'includeAllVersions':!![]}),_0x5804c8[_0x286eb0(0x22f)][_0x286eb0(0x25d)]()]);return{'parentSegmentResult':_0xb82e5a,'segmentsResult':_0x82b754,'foldersResult':_0x317f06,'journeysWithDetailsResult':_0x54062d,'userMaps':_0x37f0ba};},{'verbose':_0x143a9d['verbose']})[_0x175024(0x272)](_0x1d0198=>_0x1d0198[_0x175024(0x277)]),_0x11d20d=_0x3c8040,_0x1c92a9=extractRootFolderId(_0x11d20d),_0x5af5bd=_0x498db8,_0x1cb598=_0x3c48dc,{journeys:_0x217888,activationStepsById:_0x14c417}=_0x4ec7c1,_0x4118f8=new Map(_0x217888['map'](_0x1ecff2=>[_0x1ecff2['id'],_0x1ecff2])),_0x2e9f11=_0x217888[_0x175024(0x212)](_0x3f3e98=>({'id':_0x3f3e98['id'],'name':_0x3f3e98['attributes']['name'],'journeyBundleName':_0x3f3e98[_0x175024(0x268)][_0x175024(0x1f3)]||'','journeyBundleId':_0x3f3e98[_0x175024(0x268)][_0x175024(0x25b)]||'','versionNumber':_0x3f3e98[_0x175024(0x268)]['versionNumber'],'description':_0x3f3e98[_0x175024(0x268)][_0x175024(0x266)],'state':_0x3f3e98[_0x175024(0x268)][_0x175024(0x1eb)],'paused':_0x3f3e98[_0x175024(0x268)][_0x175024(0x25c)],'audienceId':_0x3f3e98[_0x175024(0x268)][_0x175024(0x215)],'folderId':_0x3f3e98[_0x175024(0x246)]?.[_0x175024(0x222)]?.['data']?.['id'],'createdAt':_0x3f3e98['attributes']['createdAt'],'updatedAt':_0x3f3e98[_0x175024(0x268)][_0x175024(0x226)]})),{emailToId:_0x275c87,idToEmail:_0x131eff}=_0x3173d3,_0x50dec2=await withSpinner(_0x175024(0x225),async()=>{const _0x441a0d=_0x175024,_0x238d07=await _0x5804c8[_0x441a0d(0x23a)][_0x441a0d(0x263)]();return buildConnectionMaps(_0x238d07);},{'verbose':_0x143a9d[_0x175024(0x1e2)]})['then'](_0x38ad30=>_0x38ad30['data']),_0x479330=_0x50dec2[_0x175024(0x269)],_0x3d4431=_0x50dec2[_0x175024(0x1de)],_0x352f11=_0x50dec2[_0x175024(0x228)],_0x20ab22={'emailToIdMap':_0x275c87,'connectionNameToIdMap':_0x479330,'connectionNameToTypeMap':_0x352f11,'getSchema':_0x1bd4a9=>_0x5804c8[_0x175024(0x23a)][_0x175024(0x24b)](_0x1bd4a9),'getMetadata':_0x21f16c=>_0x5804c8['connection']['getMetadataWithCache'](_0x21f16c)};let {pathToId:_0x1d475f,idToPath:_0x2a8e8e}=buildFolderMaps(_0x1cb598);const _0x28c596=buildSegmentLookupMap(_0x5af5bd,_0x2a8e8e),_0x538d21=buildSegmentNameToIdMap(_0x5af5bd),_0x1fa2ac=buildJourneyBundleLookupMap(_0x2e9f11,_0x2a8e8e);let _0x2fb20b;if(_0x26316a){if(!_0x26316a['endsWith'](_0x175024(0x221))&&!_0x26316a[_0x175024(0x240)](_0x175024(0x213)))return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)](_0x175024(0x248)+_0x26316a+'\x0a')),0x1;_0x2fb20b=[_0x26316a];}else _0x2fb20b=findYamlFiles(_0x3b0006);if(_0x2fb20b['length']===0x0)return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)](_0x175024(0x267)+_0x3b0006+'\x0a')),console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x20b)](_0x175024(0x279))),0x1;let _0x518cb6,_0x26a88c;try{const _0x3fe462=parseAndClassifyYamlFiles(_0x2fb20b,_0x3b0006,{'skipSegments':_0x143a9d[_0x175024(0x237)]});_0x518cb6=_0x3fe462[_0x175024(0x235)],_0x26a88c=_0x3fe462[_0x175024(0x1dc)];const _0x1a5311=validateParsedFiles(_0x3fe462,_0x3b0006);if(_0x1a5311[_0x175024(0x224)]>0x0)return console[_0x175024(0x1e8)](a55_0x12f718['red']('\x0aValidation\x20failed:')),console[_0x175024(0x1e8)](formatValidationErrors(_0x1a5311)),console[_0x175024(0x1e8)](a55_0x12f718['yellow'](_0x175024(0x1e9))),0x1;}catch(_0x3ebff1){return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)](_0x175024(0x274)+(_0x3ebff1 instanceof Error?_0x3ebff1[_0x175024(0x1fa)]:_0x3ebff1))),0x1;}if(_0x518cb6['length']===0x0&&_0x26a88c[_0x175024(0x224)]===0x0){const _0x34ca38=_0x143a9d['journeysOnly']?'journey':_0x175024(0x252);return console[_0x175024(0x1e8)](a55_0x12f718['yellow'](_0x175024(0x1ed)+_0x34ca38+_0x175024(0x26d))),0x0;}const _0x36692c=new Map();_0x5af5bd[_0x175024(0x224)]>0x0&&!_0x143a9d['journeysOnly']&&await withSpinner(_0x175024(0x1fe),async()=>{await batchAsync(_0x5af5bd,async _0x1e66ca=>{const _0x305e0f=a55_0x55d1,_0x50e098=await _0x5804c8['segment'][_0x305e0f(0x22e)](_0x25a2cd,_0x1e66ca['id']);_0x36692c['set'](_0x1e66ca['id'],_0x50e098);});},{'verbose':_0x143a9d[_0x175024(0x1e2)]});const {segmentFiles:_0xea7a00,foldersToCreate:_0x2b549e}=await prepareSegmentFiles(_0x518cb6,{'segmentByFolderAndName':_0x28c596,'activationsBySegmentId':_0x36692c,'folderPathToId':_0x1d475f,'idToEmailMap':_0x131eff,'connectionIdToNameMap':_0x3d4431},_0x20ab22,_0x21102b,_0x43e80c),_0x46c021=_0x26316a?[]:findSegmentsToDelete(_0x5af5bd,_0x518cb6[_0x175024(0x212)](({yamlConfig:_0x3bcc3c,folderPath:_0x4ec712})=>({'yamlConfig':_0x3bcc3c,'folderPath':resolveTDFolderPath(_0x4ec712,_0x21102b,_0x43e80c)})),_0x2a8e8e,_0x43e80c,_0x21102b),{journeyFiles:_0x4d4d95,foldersToCreate:_0x530955}=await withProgressSpinner(_0x175024(0x26c),async _0xa92db8=>prepareJourneyFiles(_0x26a88c,{'fetchJourney':async _0x1249fe=>_0x5804c8[_0x175024(0x234)][_0x175024(0x23d)](_0x1249fe[_0x175024(0x244)]),'journeyBundlesByFolderAndName':_0x1fa2ac,'folderPathToId':_0x1d475f,'idToEmailMap':_0x131eff,'connectionIdToNameMap':_0x3d4431,'existingSegments':_0x5af5bd,'parentId':_0x25a2cd,'deps':_0x5804c8,'progress':{'update':_0x87fcbb=>{const _0x22e9db=_0x175024;_0xa92db8[_0x22e9db(0x258)](_0x87fcbb),_0x143a9d[_0x22e9db(0x1e2)]&&console[_0x22e9db(0x1e8)]('\x20\x20'+_0x87fcbb);}},'journeyById':_0x4118f8,'activationStepsById':_0x14c417},_0x21102b,_0x43e80c),{'verbose':_0x143a9d[_0x175024(0x1e2)]})[_0x175024(0x272)](_0x7cb77b=>_0x7cb77b['data']);for(const _0x522882 of _0x530955){_0x2b549e['add'](_0x522882);}const _0x512ea5=_0x26316a?[]:findJourneysToDelete(_0x2e9f11,_0x26a88c[_0x175024(0x212)](({yamlConfig:_0x596043,folderPath:_0x483271})=>({'yamlConfig':_0x596043,'folderPath':resolveTDFolderPath(_0x483271,_0x21102b,_0x43e80c)})),_0x2a8e8e,_0x43e80c,_0x21102b),_0x340315=calculatePushStats(_0xea7a00,_0x4d4d95,_0x2b549e,_0x46c021,_0x512ea5,!!_0x143a9d[_0x175024(0x257)],!!_0x143a9d[_0x175024(0x237)]),_0x33353f=_0x340315[_0x175024(0x235)][_0x175024(0x250)],_0x1ae4d4=_0x340315['segments']['changed'],_0x51e345=_0x340315[_0x175024(0x235)][_0x175024(0x223)],_0x112f69=_0x340315['segments']['toDelete'],_0x5bad2a=_0x340315[_0x175024(0x25a)][_0x175024(0x204)],_0x56a825=_0x340315[_0x175024(0x1dc)][_0x175024(0x250)],_0x3f1c9e=_0x340315[_0x175024(0x1dc)]['changed'],_0x1dfe8e=_0x340315['journeys'][_0x175024(0x223)],_0x59ec30=_0x340315[_0x175024(0x1dc)][_0x175024(0x20c)],_0x27f159=_0x340315[_0x175024(0x276)][_0x175024(0x23f)],_0x457b25=_0x340315[_0x175024(0x276)][_0x175024(0x204)],_0x3accea=_0x340315[_0x175024(0x276)][_0x175024(0x278)],_0x33fc28=_0x340315['activations']['toDelete'];console[_0x175024(0x1e8)](_0x175024(0x247)+_0x2869be+'\x27:');_0x5bad2a[_0x175024(0x224)]>0x0&&console[_0x175024(0x1e8)]('\x20\x20'+a55_0x12f718[_0x175024(0x256)](_0x175024(0x275)+_0x5bad2a[_0x175024(0x224)]+_0x175024(0x22d)));if(!_0x143a9d['journeysOnly']){console['error']('\x20\x20📊\x20Segments:'),console['error'](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x264)]('+\x20'+_0x33353f[_0x175024(0x224)]+_0x175024(0x24f))),console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x218)]('~\x20'+_0x1ae4d4[_0x175024(0x224)]+_0x175024(0x1f1)));if(_0x112f69[_0x175024(0x224)]>0x0)console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x23b)]('-\x20'+_0x112f69[_0x175024(0x224)]+_0x175024(0x24c)));else _0x46c021[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x257)]&&console['error'](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x1f5)](_0x46c021['length']+_0x175024(0x236)));console['error'](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x1f5)]('=\x20'+_0x51e345[_0x175024(0x224)]+_0x175024(0x26e)));}if(_0x4d4d95[_0x175024(0x224)]>0x0||_0x512ea5[_0x175024(0x224)]>0x0){console[_0x175024(0x1e8)](_0x175024(0x1fb)),console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718['green']('+\x20'+_0x56a825[_0x175024(0x224)]+'\x20new')),console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x218)]('~\x20'+_0x3f1c9e[_0x175024(0x224)]+_0x175024(0x1f1)));if(_0x59ec30['length']>0x0)console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x23b)]('-\x20'+_0x59ec30['length']+_0x175024(0x24c)));else _0x512ea5[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x257)]&&console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x1f5)](_0x512ea5[_0x175024(0x224)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x1f5)]('=\x20'+_0x1dfe8e['length']+_0x175024(0x26e)));}_0x27f159[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x237)]&&(console[_0x175024(0x1e8)](''),console[_0x175024(0x1e8)]('\x20\x20Activations:'),_0x457b25[_0x175024(0x224)]>0x0&&console['error'](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x264)]('+\x20'+_0x457b25[_0x175024(0x224)]+'\x20to\x20create')),_0x3accea[_0x175024(0x224)]>0x0&&console[_0x175024(0x1e8)]('\x20\x20\x20\x20'+a55_0x12f718[_0x175024(0x218)]('~\x20'+_0x3accea[_0x175024(0x224)]+_0x175024(0x21a))),_0x33fc28[_0x175024(0x224)]>0x0&&console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718['red']('-\x20'+_0x33fc28[_0x175024(0x224)]+_0x175024(0x24c))));console[_0x175024(0x1e8)](_0x175024(0x261)+a55_0x12f718['cyan'](_0x3b0006)+'\x0a');if(_0x5bad2a[_0x175024(0x224)]>0x0){console['error'](_0x175024(0x243));for(const _0x5262f6 of _0x5bad2a){console['error']('\x20\x20'+a55_0x12f718['blue']('+')+'\x20'+_0x5262f6);}console[_0x175024(0x1e8)]('');}if(_0x33353f[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x237)])for(const _0x29437d of _0x33353f){const _0x2f11b7=_0x29437d['folderPath']?_0x29437d[_0x175024(0x1ee)]+'/'+_0x29437d[_0x175024(0x273)][_0x175024(0x271)]:_0x29437d[_0x175024(0x273)][_0x175024(0x271)],_0x144c02=_0x29437d[_0x175024(0x273)][_0x175024(0x276)]?.[_0x175024(0x224)]||0x0,_0x208b1c=_0x144c02>0x0?a55_0x12f718[_0x175024(0x1f5)]('\x20['+_0x144c02+_0x175024(0x233)):'';console[_0x175024(0x1e8)]('\x0a'+a55_0x12f718[_0x175024(0x264)]('New\x20segment:')+'\x20'+_0x2f11b7+_0x208b1c),console[_0x175024(0x1e8)]('─'[_0x175024(0x217)](0x3c)),_0x29437d['diff']&&console[_0x175024(0x1e8)](_0x29437d[_0x175024(0x1f0)]),console['error']('─'[_0x175024(0x217)](0x3c));}if(_0x112f69[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x237)])for(const _0x69485c of _0x112f69){const _0x1acc2f=_0x69485c['segmentFolderId']?_0x2a8e8e['get'](_0x69485c['segmentFolderId'][_0x175024(0x1e6)]())||'':'',_0x444e47=_0x1acc2f?_0x1acc2f+'/'+_0x69485c['name']:_0x69485c[_0x175024(0x271)],_0x4be3a2=_0x36692c['get'](_0x69485c['id'])||[],_0x1d3fee=_0x4be3a2['length']>0x0?a55_0x12f718[_0x175024(0x1f5)]('\x20['+_0x4be3a2[_0x175024(0x224)]+_0x175024(0x233)):'';console['error']('\x0a'+a55_0x12f718[_0x175024(0x23b)](_0x175024(0x1ff))+'\x20'+_0x444e47+_0x1d3fee),console[_0x175024(0x1e8)]('─'[_0x175024(0x217)](0x3c));const _0x4ea129=segmentWithActivationsToYaml(_0x69485c,_0x4be3a2,undefined,_0x131eff,_0x3d4431),_0x422e4c=segmentToYamlString(_0x4ea129),_0x3b0fb9=generateDiff(_0x422e4c,'');console['error'](formatDiffWithColors(_0x3b0fb9)),console['error']('─'[_0x175024(0x217)](0x3c));}const _0x2502d8=_0xea7a00[_0x175024(0x1e3)](_0x1981ce=>!_0x1981ce[_0x175024(0x23c)]&&_0x1981ce[_0x175024(0x1f0)]);if(_0x2502d8['length']>0x0&&!_0x143a9d['journeysOnly'])for(const _0x4b269e of _0x2502d8){const _0x35f883=_0x4b269e[_0x175024(0x1ee)]?_0x4b269e['folderPath']+'/'+_0x4b269e[_0x175024(0x273)][_0x175024(0x271)]:_0x4b269e['yamlConfig'][_0x175024(0x271)];console['error']('\x0a'+a55_0x12f718[_0x175024(0x218)]('Changes\x20to:')+'\x20'+_0x35f883),console[_0x175024(0x1e8)]('─'['repeat'](0x3c)),console[_0x175024(0x1e8)](_0x4b269e[_0x175024(0x1f0)]),console['error']('─'['repeat'](0x3c));}if(_0x56a825[_0x175024(0x224)]>0x0)for(const _0x3ccddb of _0x56a825){const _0x553304=_0x3ccddb[_0x175024(0x1ee)]?_0x3ccddb['folderPath']+'/'+_0x3ccddb[_0x175024(0x273)][_0x175024(0x271)]:_0x3ccddb[_0x175024(0x273)][_0x175024(0x271)];console['error']('\x0a'+a55_0x12f718[_0x175024(0x264)]('New\x20journey:')+'\x20'+_0x553304),console['error']('─'[_0x175024(0x217)](0x3c)),_0x3ccddb[_0x175024(0x1f0)]&&console[_0x175024(0x1e8)](_0x3ccddb['diff']),console[_0x175024(0x1e8)]('─'[_0x175024(0x217)](0x3c));}const _0x307189=_0x4d4d95[_0x175024(0x1e3)](_0x42f744=>!_0x42f744['isNew']&&_0x42f744[_0x175024(0x1f0)]);if(_0x307189[_0x175024(0x224)]>0x0)for(const _0x3e4f9a of _0x307189){const _0x2f8dfc=_0x3e4f9a[_0x175024(0x1ee)]?_0x3e4f9a['folderPath']+'/'+_0x3e4f9a[_0x175024(0x273)][_0x175024(0x271)]:_0x3e4f9a[_0x175024(0x273)][_0x175024(0x271)];console['error']('\x0a'+a55_0x12f718['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x2f8dfc),console[_0x175024(0x1e8)]('─'[_0x175024(0x217)](0x3c)),console[_0x175024(0x1e8)](_0x3e4f9a[_0x175024(0x1f0)]),console['error']('─'[_0x175024(0x217)](0x3c));}if(_0x59ec30[_0x175024(0x224)]>0x0)for(const _0x19f586 of _0x59ec30){const _0x2889ae=_0x19f586[_0x175024(0x230)]?_0x2a8e8e['get'](_0x19f586[_0x175024(0x230)])||'':'',_0x19cd28=_0x2889ae?_0x2889ae+'/'+_0x19f586[_0x175024(0x1f3)]:_0x19f586[_0x175024(0x1f3)];console[_0x175024(0x1e8)]('\x0a'+a55_0x12f718[_0x175024(0x23b)](_0x175024(0x22b))+'\x20'+_0x19cd28),console[_0x175024(0x1e8)]('─'['repeat'](0x3c)),console['error'](a55_0x12f718[_0x175024(0x23b)](_0x175024(0x239))),console[_0x175024(0x1e8)]('─'[_0x175024(0x217)](0x3c));}if(_0x143a9d['dryRun'])return console['error'](a55_0x12f718[_0x175024(0x218)](_0x175024(0x1ea))),0x0;const _0x1ad57d=_0x143a9d[_0x175024(0x237)]?![]:_0x33353f[_0x175024(0x224)]>0x0||_0x1ae4d4[_0x175024(0x224)]>0x0||_0x112f69[_0x175024(0x224)]>0x0,_0x186d27=_0x56a825[_0x175024(0x224)]>0x0||_0x3f1c9e['length']>0x0||_0x59ec30[_0x175024(0x224)]>0x0,_0x213a5a=_0x143a9d[_0x175024(0x237)]?![]:_0x27f159[_0x175024(0x224)]>0x0,_0x438dfc=_0x5bad2a[_0x175024(0x224)]>0x0;if(!_0x1ad57d&&!_0x186d27&&!_0x213a5a&&!_0x438dfc){const _0x376d22=_0x143a9d[_0x175024(0x237)]?_0x175024(0x1ec):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x175024(0x1e8)](a55_0x12f718['green'](_0x376d22));if(_0x26316a&&_0x51e345[_0x175024(0x224)]===0x1){const _0x5505da=_0x51e345[0x0];if(_0x5505da[_0x175024(0x231)]?.['id']){const _0xe7dcdb=getConsoleNextUrl(_0x143a9d['site'],_0x175024(0x207)+_0x25a2cd+'/e/'+_0x5505da[_0x175024(0x231)]['id']+'/sb/da/esr');console[_0x175024(0x1e8)](_0x175024(0x20d)+a55_0x12f718['cyan'](_0xe7dcdb));}}if(_0x26316a&&_0x1dfe8e['length']===0x1){const _0x586182=_0x1dfe8e[0x0];if(_0x586182[_0x175024(0x1dd)]?.['id']){const _0x324b02=getConsoleNextUrl(_0x143a9d[_0x175024(0x26b)],_0x175024(0x207)+_0x25a2cd+_0x175024(0x227)+_0x586182['existingJourney']['id']+'/j/da/je');console[_0x175024(0x1e8)]('\x20\x20'+a55_0x12f718[_0x175024(0x20b)](_0x324b02));}}return 0x0;}const _0x3df1c4=_0x143a9d['journeysOnly']?_0x56a825[_0x175024(0x224)]+_0x3f1c9e['length']+_0x59ec30[_0x175024(0x224)]+_0x5bad2a[_0x175024(0x224)]:_0x33353f[_0x175024(0x224)]+_0x1ae4d4[_0x175024(0x224)]+_0x112f69[_0x175024(0x224)]+_0x56a825[_0x175024(0x224)]+_0x3f1c9e[_0x175024(0x224)]+_0x59ec30['length']+_0x5bad2a['length']+_0x27f159[_0x175024(0x224)];if(!_0x143a9d[_0x175024(0x1e4)]&&_0x3df1c4>0x0){if(!isInteractive())return console['error'](a55_0x12f718['red'](_0x175024(0x1f7)),_0x175024(0x254)),console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x1f5)](_0x175024(0x203))),0x1;const _0x4d6500=await confirmKey(_0x175024(0x255)+_0x3df1c4+_0x175024(0x20f));if(!_0x4d6500)return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x218)](_0x175024(0x232))),0x1;}const _0x4da282={'withProgress':async(_0x458c2e,_0x18a846)=>{const _0x438627=_0x175024,_0x1ec54a=await withSpinner(_0x458c2e,_0x18a846,{'verbose':_0x143a9d[_0x438627(0x1e2)]});return{'data':_0x1ec54a[_0x438627(0x277)]};},'logInfo':_0x5544f3=>console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x256)]('✔\x20'+_0x5544f3)),'logSuccess':_0xdd8d3=>console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x264)]('✔\x20'+_0xdd8d3)),'logWarning':_0x3446d4=>console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x218)]('⚠\x20'+_0x3446d4)),'logDeleted':_0xdf8d09=>console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)]('✔\x20'+_0xdf8d09))},_0x256056={'segment':_0x5804c8[_0x175024(0x262)],'journey':_0x5804c8['journey'],'user':_0x5804c8[_0x175024(0x22f)],'connection':_0x5804c8[_0x175024(0x23a)]};_0x5bad2a[_0x175024(0x224)]>0x0&&(_0x1d475f=await executePushFolders(_0x256056,_0x5bad2a,_0x1d475f,{'parentId':_0x25a2cd},_0x4da282));const _0x102cd2={'rootFolderId':_0x1c92a9,'folderPathToId':_0x1d475f,'folderIdToPath':_0x2a8e8e,'segmentNameToId':_0x538d21,'activationsBySegmentId':_0x36692c,'emailToIdMap':_0x275c87,'idToEmailMap':_0x131eff,'connectionNameToIdMap':_0x50dec2[_0x175024(0x269)],'connectionIdToNameMap':_0x50dec2[_0x175024(0x1de)],'connectionNameToTypeMap':_0x352f11},_0x27ddd9=await executePushSegments(_0x256056,_0x143a9d[_0x175024(0x237)]?[]:_0xea7a00,_0x102cd2,{'parentId':_0x25a2cd},_0x4da282),_0x8452fb=_0x27ddd9[_0x175024(0x21d)],_0x2d5ef2=_0x27ddd9['updated'],_0x57c9f3=_0x27ddd9[_0x175024(0x276)][_0x175024(0x21d)],_0x2df9fe=_0x27ddd9[_0x175024(0x276)]['updated'],_0x32e30=_0x27ddd9[_0x175024(0x276)]['deleted'];let _0x798477;if(_0x26316a&&_0xea7a00[_0x175024(0x224)]===0x1){const _0x1c25d2=_0xea7a00[0x0];_0x798477=_0x1c25d2[_0x175024(0x231)]?.['id']??_0x27ddd9[_0x175024(0x1f9)]['get'](_0x1c25d2[_0x175024(0x273)][_0x175024(0x271)]);}const _0x277885=await executePushSegmentDeletions(_0x256056,_0x143a9d[_0x175024(0x237)]?[]:_0x112f69,_0x4da282);let _0x42cca3=0x0,_0xb7a30=0x0,_0x45a9a1=0x0;const _0x1eaf22=new Map(_0x538d21);for(const [_0x375e92,_0xb6895f]of _0x27ddd9[_0x175024(0x1f9)]){_0x1eaf22[_0x175024(0x241)](_0x375e92,_0xb6895f);}if(_0x4d4d95[_0x175024(0x224)]>0x0){const _0x396309={..._0x102cd2,'segmentNameToId':_0x1eaf22,'existingSegments':_0x5af5bd,'activationContext':_0x20ab22},_0x5bd1b2=await executePushJourneys(_0x256056,_0x4d4d95,_0x396309,{'parentId':_0x25a2cd,'rootFolderId':_0x1c92a9,'verbose':_0x143a9d['verbose']},_0x4da282);_0x42cca3=_0x5bd1b2[_0x175024(0x21d)],_0xb7a30=_0x5bd1b2[_0x175024(0x242)];if(_0x26316a&&_0x5bd1b2[_0x175024(0x229)][_0x175024(0x224)]===0x1){const _0x4c454f=_0x5bd1b2['results'][0x0];if(_0x4c454f[_0x175024(0x244)]){const _0xd867eb=getConsoleNextUrl(_0x143a9d[_0x175024(0x26b)],_0x175024(0x207)+_0x25a2cd+'/e/'+_0x4c454f[_0x175024(0x244)]+_0x175024(0x259));console[_0x175024(0x1e8)]('\x20\x20'+a55_0x12f718[_0x175024(0x20b)](_0xd867eb));}}}for(const _0x49541a of _0x59ec30){console['error'](a55_0x12f718['yellow'](_0x175024(0x251)+_0x49541a['journeyBundleName'])),_0x45a9a1++;}const _0x2d7b64=[];if(_0x8452fb>0x0)_0x2d7b64[_0x175024(0x20e)](_0x8452fb+_0x175024(0x220));if(_0x2d5ef2>0x0)_0x2d7b64[_0x175024(0x20e)](_0x2d5ef2+'\x20updated');if(_0x277885>0x0)_0x2d7b64[_0x175024(0x20e)](_0x277885+_0x175024(0x1fd));const _0x49f934=[];if(_0x42cca3>0x0)_0x49f934[_0x175024(0x20e)](_0x42cca3+'\x20created');if(_0xb7a30>0x0)_0x49f934[_0x175024(0x20e)](_0xb7a30+_0x175024(0x1f2));if(_0x45a9a1>0x0)_0x49f934['push'](_0x45a9a1+_0x175024(0x1fd));const _0x223a97=[];if(_0x57c9f3>0x0)_0x223a97[_0x175024(0x20e)](_0x57c9f3+'\x20created');if(_0x2df9fe>0x0)_0x223a97[_0x175024(0x20e)](_0x2df9fe+'\x20updated');if(_0x32e30>0x0)_0x223a97['push'](_0x32e30+_0x175024(0x1fd));console['error'](a55_0x12f718[_0x175024(0x264)](_0x175024(0x24e)));_0x2d7b64[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x237)]&&console[_0x175024(0x1e8)]('\x20\x20Segments:\x20'+_0x2d7b64[_0x175024(0x24d)](',\x20'));_0x49f934[_0x175024(0x224)]>0x0&&console[_0x175024(0x1e8)](_0x175024(0x201)+_0x49f934['join'](',\x20'));_0x223a97['length']>0x0&&!_0x143a9d[_0x175024(0x237)]&&console[_0x175024(0x1e8)](_0x175024(0x219)+_0x223a97['join'](',\x20'));if(_0x798477){const _0x2c7b10=getConsoleNextUrl(_0x143a9d[_0x175024(0x26b)],_0x175024(0x207)+_0x25a2cd+_0x175024(0x227)+_0x798477+_0x175024(0x23e));console[_0x175024(0x1e8)](_0x175024(0x20d)+a55_0x12f718[_0x175024(0x20b)](_0x2c7b10));}return 0x0;}}function a55_0x317c(){const _0x47a14f=['listJourneysWithDetailsFromParentSegment','audienceId','4497522wVrjXn','repeat','yellow','\x20\x20Activations:\x20','\x20to\x20update','3254CfYVBu','parentSegment','created','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20created','.yml','parentFolder','unchanged','length','Fetching\x20connections\x20for\x20name\x20resolution...','updatedAt','/e/','nameToType','results','63wzyYhY','Delete\x20journey:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20folders\x20to\x20create','listActivations','user','folderId','existingSegment','Aborted.','\x20activations]','journey','segments','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeysOnly','Source\x20directory:\x20','(Journey\x20will\x20be\x20deleted)','connection','red','isNew','getJourney','/sb/da/esr','all','endsWith','set','updated','Folders\x20to\x20create:','journeyId','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)','relationships','\x0aPush\x20summary\x20for\x20\x27','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','scopedFolderPath','isScoped','getOutputSchemaWithCache','\x20to\x20delete','join','\x0a✔\x20Push\x20complete','\x20new','new','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','segment\x20or\x20journey','segment:push','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Push\x20','blue','delete','setPhase','/j/da/je','folders','journeyBundleId','paused','buildUserMaps','17482610SqubPD','\x27...','file','\x20\x20Source:\x20','segment','list','green','834512ShKHpl','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','attributes','nameToId','Scoped\x20to\x20folder:\x20','site','Preparing\x20journeys...','\x20YAML\x20files\x20found','\x20unchanged','filePath','parent_name','name','then','yamlConfig','Error\x20parsing\x20YAML:\x20','📁\x20','activations','data','toUpdate','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','journeys','existingJourney','idToName','1630744IGrqNi','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','type','verbose','filter','yes','Error:\x20','toString','Site:\x20','error','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','state','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','No\x20','folderPath','targetDir','diff','\x20changed','\x20updated','journeyBundleName','errorCode','dim','25fVzADu','\x0aError:','\x20\x20\x20\x20','createdSegmentIds','message','\x20\x20🗺️\x20\x20Journeys:','Resolving\x20parent\x20segment\x20\x27','\x20deleted','Fetching\x20existing\x20activations...','Delete\x20segment:','getParent','\x20\x20Journeys:\x20','no_parent','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','toCreate','4817358YstzLa','helpText','/app/ps/','listFolders','33WGixKj','13373115WUOEVu','cyan','toDelete','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','push','\x20changes?','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','1006gBWeaH','map','.yaml'];a55_0x317c=function(){return _0x47a14f;};return a55_0x317c();}
@@ -1 +1 @@
1
- const a55_0x102b4c=a55_0x1a59;(function(_0x27a0f2,_0x1e2537){const _0x20a71b=a55_0x1a59,_0x461823=_0x27a0f2();while(!![]){try{const _0x1a1f4c=parseInt(_0x20a71b(0x85))/0x1+parseInt(_0x20a71b(0x8f))/0x2+parseInt(_0x20a71b(0x75))/0x3+-parseInt(_0x20a71b(0x70))/0x4*(parseInt(_0x20a71b(0x8e))/0x5)+-parseInt(_0x20a71b(0x82))/0x6*(parseInt(_0x20a71b(0x6e))/0x7)+-parseInt(_0x20a71b(0x92))/0x8+parseInt(_0x20a71b(0x90))/0x9;if(_0x1a1f4c===_0x1e2537)break;else _0x461823['push'](_0x461823['shift']());}catch(_0x19b421){_0x461823['push'](_0x461823['shift']());}}}(a55_0x4c17,0x2646b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a55_0x1a59(_0x5d47da,_0x56ba6b){_0x5d47da=_0x5d47da-0x6e;const _0x4c1781=a55_0x4c17();let _0x1a591f=_0x4c1781[_0x5d47da];return _0x1a591f;}import{withSpinner}from'../utils/spinner.js';function a55_0x4c17(){const _0x59ea8d=['\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','data','type','segmentPath','resolveFolderId','description','Resolving\x20folder\x20\x27','segment','25ZlHLvA','135014HwcFBB','3502449SHsIwC','resolvePathToResource','310632scHswt','Resolved\x20relative\x20path\x20to:\x20','Update\x20existing\x20child\x20segment','kind','yellow','updateSegmentById','Segment\x20ID\x20missing\x20from\x20resolved\x20path','includes','1743ronfIY','✔\x20Updated\x20segment\x20\x27','75468FscacP','Segment\x20ID:\x20','ruleFile','INTERNAL','segmentName','17028pxiZgc','segmentId','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolved\x20folder\x20ID:\x20','Parent\x20ID:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','error','Updating\x20segment\x20\x27','Examples:','name','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','rule','folder','4302Aucwwf','\x27...','verbose','6132lHkZor'];a55_0x4c17=function(){return _0x59ea8d;};return a55_0x4c17();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a55_0x4569d8 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a55_0x102b4c(0x7e)]='segment:update';['description']=a55_0x102b4c(0x94);async['execute'](_0x3b3ddc){const _0x1e3f72=a55_0x102b4c;console[_0x1e3f72(0x7b)](a55_0x4569d8['yellow'](_0x1e3f72(0x7a))),console[_0x1e3f72(0x7b)](a55_0x4569d8[_0x1e3f72(0x96)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x33e80e,args:_0x207f94,tdx:_0x53a0e9}=_0x3b3ddc,_0x4504bb=_0x33e80e;if(_0x207f94['length']===0x0)return console[_0x1e3f72(0x7b)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x1e3f72(0x7b)](_0x1e3f72(0x7f)),console[_0x1e3f72(0x7b)](_0x1e3f72(0x7d)),console[_0x1e3f72(0x7b)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error'](_0x1e3f72(0x86)),0x1;const _0x1dcc64=_0x207f94[0x0],_0x74f701=_0x33e80e[_0x1e3f72(0x89)];let _0x4fec8e=_0x1dcc64;_0x74f701&&!_0x1dcc64[_0x1e3f72(0x99)]('/')&&(_0x4fec8e=_0x74f701+'/'+_0x1dcc64,_0x4504bb['verbose']&&console[_0x1e3f72(0x7b)](_0x1e3f72(0x93)+_0x4fec8e));const _0x4171d0=await withSpinner('Resolving\x20path\x20\x27'+_0x4fec8e+_0x1e3f72(0x83),()=>_0x53a0e9['segment'][_0x1e3f72(0x91)](_0x4fec8e),{'verbose':_0x4504bb[_0x1e3f72(0x84)]}),_0x4a429a=_0x4171d0[_0x1e3f72(0x87)];_0x4504bb[_0x1e3f72(0x84)]&&console['error']('Resolved\x20type:\x20'+_0x4a429a[_0x1e3f72(0x88)]);if(_0x4a429a[_0x1e3f72(0x88)]!=='segment')return console[_0x1e3f72(0x7b)]('Error:\x20Cannot\x20update\x20'+_0x4a429a[_0x1e3f72(0x88)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x1e3f72(0x7b)](_0x1e3f72(0x77)),0x1;if(!_0x4a429a[_0x1e3f72(0x76)])throw new SDKError(ErrorCode[_0x1e3f72(0x73)],_0x1e3f72(0x98));const _0x218219=_0x4a429a['parentId'],_0x19d5de=_0x4a429a['segmentId'];_0x4504bb[_0x1e3f72(0x84)]&&(console['error'](_0x1e3f72(0x79)+_0x218219),console[_0x1e3f72(0x7b)](_0x1e3f72(0x71)+_0x19d5de));let _0x4d01e5;if(_0x4504bb[_0x1e3f72(0x81)]){const _0x528e9d=_0x4504bb[_0x1e3f72(0x81)],_0x45d3fb=await withSpinner(_0x1e3f72(0x8c)+_0x528e9d+_0x1e3f72(0x83),()=>_0x53a0e9[_0x1e3f72(0x8d)][_0x1e3f72(0x8a)](_0x218219,_0x528e9d),{'verbose':_0x4504bb['verbose']});_0x4d01e5=parseInt(_0x45d3fb[_0x1e3f72(0x87)],0xa),_0x4504bb[_0x1e3f72(0x84)]&&console[_0x1e3f72(0x7b)](_0x1e3f72(0x78)+_0x4d01e5);}const _0x2f7c2d=await loadJSONFromOptions(_0x4504bb[_0x1e3f72(0x80)],_0x4504bb[_0x1e3f72(0x72)]),_0x6c0288={'name':_0x4504bb['name'],'description':_0x4504bb[_0x1e3f72(0x8b)],'rule':_0x2f7c2d,'kind':_0x4504bb[_0x1e3f72(0x95)]!==undefined?parseInt(_0x4504bb[_0x1e3f72(0x95)],0xa):undefined,'segmentFolderId':_0x4d01e5},_0x3f7b51=await withSpinner(_0x1e3f72(0x7c)+_0x4a429a[_0x1e3f72(0x74)]+_0x1e3f72(0x83),()=>_0x53a0e9['segment'][_0x1e3f72(0x97)](_0x218219,_0x19d5de,_0x6c0288),{'verbose':_0x4504bb['verbose']}),_0x2407e7=_0x3f7b51[_0x1e3f72(0x87)];return console[_0x1e3f72(0x7b)](_0x1e3f72(0x6f)+_0x2407e7[_0x1e3f72(0x7e)]+'\x27'),_0x4fec8e!==_0x1dcc64&&console['error']('\x20\x20\x20Path:\x20'+_0x4fec8e),await handleSDKOutput([_0x2407e7],_0x4504bb),0x0;}}
1
+ (function(_0x33f997,_0x451bbe){const _0x4c0384=a56_0x522e,_0xf0c9ed=_0x33f997();while(!![]){try{const _0x247b68=-parseInt(_0x4c0384(0x1b6))/0x1+-parseInt(_0x4c0384(0x1c5))/0x2+-parseInt(_0x4c0384(0x1a7))/0x3*(parseInt(_0x4c0384(0x1c3))/0x4)+-parseInt(_0x4c0384(0x1b9))/0x5*(parseInt(_0x4c0384(0x1a4))/0x6)+-parseInt(_0x4c0384(0x1a0))/0x7*(-parseInt(_0x4c0384(0x1a1))/0x8)+-parseInt(_0x4c0384(0x1b4))/0x9*(parseInt(_0x4c0384(0x1b7))/0xa)+parseInt(_0x4c0384(0x1b2))/0xb;if(_0x247b68===_0x451bbe)break;else _0xf0c9ed['push'](_0xf0c9ed['shift']());}catch(_0x167bf8){_0xf0c9ed['push'](_0xf0c9ed['shift']());}}}(a56_0x2c99,0x5ba77));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a56_0x2c99(){const _0x98ec5c=['resolveFolderId','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','kind','15782415nYuVtm','verbose','7551YrnFLd','error','429184GNRbLB','6680iUvDgG','Error:\x20Cannot\x20update\x20','75vwUnYT','ruleFile','segmentName','data','parentId','rule','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent\x20ID:\x20','INTERNAL','resolvePathToResource','34284oBivWk','Resolved\x20folder\x20ID:\x20','113716zheVdI','type','Updating\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','segmentId','segment','updateSegmentById','Resolved\x20relative\x20path\x20to:\x20','folder','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Segment\x20ID:\x20','66311gSWARv','536TYFQhp','Examples:','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','97884rpIHVU','\x27...','yellow','141WRhxQq','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','name','Resolving\x20path\x20\x27','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','length'];a56_0x2c99=function(){return _0x98ec5c;};return a56_0x2c99();}import{withSpinner}from'../utils/spinner.js';function a56_0x522e(_0x5300ea,_0x10c74c){_0x5300ea=_0x5300ea-0x196;const _0x2c99ac=a56_0x2c99();let _0x522e01=_0x2c99ac[_0x5300ea];return _0x522e01;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a56_0x2f9604 from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']='segment:update';['description']='Update\x20existing\x20child\x20segment';async['execute'](_0x5f5881){const _0x59d913=a56_0x522e;console[_0x59d913(0x1b5)](a56_0x2f9604[_0x59d913(0x1a6)](_0x59d913(0x1a3))),console['error'](a56_0x2f9604[_0x59d913(0x1a6)](_0x59d913(0x198)));const {options:_0x2ab580,args:_0xee356d,tdx:_0x3d19dd}=_0x5f5881,_0x44a97d=_0x2ab580;if(_0xee356d[_0x59d913(0x1ae)]===0x0)return console[_0x59d913(0x1b5)](_0x59d913(0x1bf)),console[_0x59d913(0x1b5)](_0x59d913(0x19e)),console[_0x59d913(0x1b5)](_0x59d913(0x1a2)),console[_0x59d913(0x1b5)](_0x59d913(0x1ad)),console[_0x59d913(0x1b5)](_0x59d913(0x1b0)),0x1;const _0x312f65=_0xee356d[0x0],_0x3118e1=_0x2ab580['segmentPath'];let _0x1bc475=_0x312f65;_0x3118e1&&!_0x312f65['includes']('/')&&(_0x1bc475=_0x3118e1+'/'+_0x312f65,_0x44a97d[_0x59d913(0x1b3)]&&console[_0x59d913(0x1b5)](_0x59d913(0x19c)+_0x1bc475));const _0x498e1f=await withSpinner(_0x59d913(0x1ab)+_0x1bc475+_0x59d913(0x1a5),()=>_0x3d19dd[_0x59d913(0x19a)][_0x59d913(0x1c2)](_0x1bc475),{'verbose':_0x44a97d['verbose']}),_0x4c6195=_0x498e1f[_0x59d913(0x1bc)];_0x44a97d[_0x59d913(0x1b3)]&&console['error']('Resolved\x20type:\x20'+_0x4c6195[_0x59d913(0x196)]);if(_0x4c6195[_0x59d913(0x196)]!==_0x59d913(0x19a))return console[_0x59d913(0x1b5)](_0x59d913(0x1b8)+_0x4c6195[_0x59d913(0x196)]+_0x59d913(0x1a8)),console['error'](_0x59d913(0x1a9)),0x1;if(!_0x4c6195[_0x59d913(0x199)])throw new SDKError(ErrorCode[_0x59d913(0x1c1)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5123e1=_0x4c6195[_0x59d913(0x1bd)],_0x5b54db=_0x4c6195[_0x59d913(0x199)];_0x44a97d[_0x59d913(0x1b3)]&&(console['error'](_0x59d913(0x1c0)+_0x5123e1),console['error'](_0x59d913(0x19f)+_0x5b54db));let _0x3c3730;if(_0x44a97d['folder']){const _0x1e446a=_0x44a97d[_0x59d913(0x19d)],_0x11f7d3=await withSpinner('Resolving\x20folder\x20\x27'+_0x1e446a+'\x27...',()=>_0x3d19dd[_0x59d913(0x19a)][_0x59d913(0x1af)](_0x5123e1,_0x1e446a),{'verbose':_0x44a97d[_0x59d913(0x1b3)]});_0x3c3730=parseInt(_0x11f7d3['data'],0xa),_0x44a97d[_0x59d913(0x1b3)]&&console[_0x59d913(0x1b5)](_0x59d913(0x1c4)+_0x3c3730);}const _0x5baf19=await loadJSONFromOptions(_0x44a97d[_0x59d913(0x1be)],_0x44a97d[_0x59d913(0x1ba)]),_0x2bceab={'name':_0x44a97d[_0x59d913(0x1aa)],'description':_0x44a97d['description'],'rule':_0x5baf19,'kind':_0x44a97d['kind']!==undefined?parseInt(_0x44a97d[_0x59d913(0x1b1)],0xa):undefined,'segmentFolderId':_0x3c3730},_0xc97c83=await withSpinner(_0x59d913(0x197)+_0x4c6195[_0x59d913(0x1bb)]+_0x59d913(0x1a5),()=>_0x3d19dd['segment'][_0x59d913(0x19b)](_0x5123e1,_0x5b54db,_0x2bceab),{'verbose':_0x44a97d[_0x59d913(0x1b3)]}),_0x3d7d20=_0xc97c83[_0x59d913(0x1bc)];return console[_0x59d913(0x1b5)]('✔\x20Updated\x20segment\x20\x27'+_0x3d7d20[_0x59d913(0x1aa)]+'\x27'),_0x1bc475!==_0x312f65&&console['error'](_0x59d913(0x1ac)+_0x1bc475),await handleSDKOutput([_0x3d7d20],_0x44a97d),0x0;}}
@@ -1 +1 @@
1
- const a56_0x5da207=a56_0x61f7;(function(_0x3fb80f,_0x51cb96){const _0x17fafe=a56_0x61f7,_0x20eece=_0x3fb80f();while(!![]){try{const _0x335537=parseInt(_0x17fafe(0x19d))/0x1+-parseInt(_0x17fafe(0x1a3))/0x2+-parseInt(_0x17fafe(0x185))/0x3*(parseInt(_0x17fafe(0x1a7))/0x4)+parseInt(_0x17fafe(0x17b))/0x5*(-parseInt(_0x17fafe(0x180))/0x6)+-parseInt(_0x17fafe(0x1ad))/0x7*(-parseInt(_0x17fafe(0x1b0))/0x8)+-parseInt(_0x17fafe(0x19e))/0x9*(-parseInt(_0x17fafe(0x17f))/0xa)+-parseInt(_0x17fafe(0x1a1))/0xb;if(_0x335537===_0x51cb96)break;else _0x20eece['push'](_0x20eece['shift']());}catch(_0x3df236){_0x20eece['push'](_0x20eece['shift']());}}}(a56_0x4b83,0xba51c));import{existsSync,statSync}from'fs';import a56_0x31cc40 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a56_0x4b83(){const _0x1f0590=['\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','folderId','data','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Examples:','split','slice','Use:\x20tdx\x20segment\x20use\x20','segment','parentName','\x27...','segmentPath','Folder\x20ID:\x20','segment:use','Usage:\x20tdx\x20segment\x20use\x20<path>','isDirectory','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','fullPath','1026596ZUUGJP','12710421LakmLo','Resolving\x20path\x20\x27','error','4264821xeIPiD','config','1651708FsOcWb','name','Resolved\x20path\x20type:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','3457068dhVRYO','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','type','cyan','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','14oKtgkK','verbose','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','3552304XopuKm','resolvePathToResource','site','length','description','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','execute','segments','log','dim','28585jSvCqG','Error:\x20Path\x20is\x20required\x0a','Site:\x20','session','10TrxCMf','510PaWKcT','isAbsolute','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20set\x20to:\x20','3rXPeqP','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','parentId','green','red','folderPath'];a56_0x4b83=function(){return _0x1f0590;};return a56_0x4b83();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a56_0x61f7(_0x252656,_0x54626a){_0x252656=_0x252656-0x173;const _0x4b8310=a56_0x4b83();let _0x61f75f=_0x4b8310[_0x252656];return _0x61f75f;}export class SegmentUseCommand extends BaseCommand{[a56_0x5da207(0x1a4)]=a56_0x5da207(0x198);[a56_0x5da207(0x175)]=a56_0x5da207(0x182);async[a56_0x5da207(0x177)](_0x3845d7){const _0x567e8c=a56_0x5da207,{options:_0x5b7f7b,args:_0x5caf2d,tdx:_0x1e0253}=_0x3845d7;if(_0x5caf2d[_0x567e8c(0x174)]===0x0)return console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x189)](_0x567e8c(0x17c))),console[_0x567e8c(0x1a0)](_0x567e8c(0x199)),console[_0x567e8c(0x1a0)](_0x567e8c(0x18f)),console[_0x567e8c(0x1a0)](_0x567e8c(0x1ac)),console['error'](_0x567e8c(0x18b)),console[_0x567e8c(0x1a0)](_0x567e8c(0x1a6)),console['error'](_0x567e8c(0x176)),0x1;const _0x1d0456=_0x5caf2d[0x0],_0x50302c=_0x5b7f7b[_0x567e8c(0x17e)];try{if(_0x1d0456==='/')return saveSessionContext({'segment_path':undefined},_0x50302c),console[_0x567e8c(0x179)](a56_0x31cc40[_0x567e8c(0x188)](_0x567e8c(0x1ab))),0x0;if(existsSync(_0x1d0456)&&statSync(_0x1d0456)[_0x567e8c(0x19a)]()){let _0x48e5a4;try{_0x48e5a4=findTdxConfig(_0x1d0456);}catch{return console[_0x567e8c(0x1a0)](a56_0x31cc40['red'](_0x567e8c(0x1a8)+_0x1d0456)),console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x1aa)](_0x567e8c(0x183))),0x1;}const _0x4f9d1e=_0x48e5a4[_0x567e8c(0x1a2)]['parent_segment'];return saveSessionContext({'segment_path':_0x4f9d1e,'parent_segment':_0x4f9d1e},_0x50302c),console['log'](a56_0x31cc40[_0x567e8c(0x188)](_0x567e8c(0x184)+a56_0x31cc40[_0x567e8c(0x1aa)](_0x4f9d1e))),0x0;}const _0x4f0125=_0x5b7f7b[_0x567e8c(0x196)];let _0x2d3fc0=_0x1d0456;const _0x3ea6d3=parsePath(_0x1d0456);if(!_0x3ea6d3[_0x567e8c(0x181)]){if(!_0x4f0125)return console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x189)](_0x567e8c(0x186))),console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x1aa)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x1d0456==='..'){const _0x131cf0=_0x4f0125[_0x567e8c(0x190)]('/')[_0x567e8c(0x191)](0x0,-0x1)['join']('/');_0x2d3fc0=_0x131cf0||'/';}else _0x1d0456==='.'?_0x2d3fc0=_0x4f0125:_0x2d3fc0=_0x4f0125+'/'+_0x1d0456;_0x5b7f7b[_0x567e8c(0x1ae)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x2d3fc0);}if(_0x2d3fc0==='/'||_0x2d3fc0==='')return saveSessionContext({'segment_path':undefined},_0x50302c),console[_0x567e8c(0x179)](a56_0x31cc40[_0x567e8c(0x188)](_0x567e8c(0x1ab))),0x0;_0x2d3fc0=normalizePath(_0x2d3fc0);const _0x4468f0=parsePath(_0x2d3fc0)[_0x567e8c(0x178)];if(_0x4468f0['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x50302c),console['log'](a56_0x31cc40['green'](_0x567e8c(0x1ab))),0x0;_0x5b7f7b['verbose']&&(console[_0x567e8c(0x1a0)](_0x567e8c(0x17d)+_0x5b7f7b[_0x567e8c(0x173)]),console[_0x567e8c(0x1a0)]('Target\x20path:\x20'+_0x2d3fc0));const _0x1e2366=await withSpinner(_0x567e8c(0x19f)+_0x2d3fc0+_0x567e8c(0x195),()=>_0x1e0253[_0x567e8c(0x193)][_0x567e8c(0x1b1)](_0x2d3fc0),{'verbose':_0x5b7f7b[_0x567e8c(0x1ae)]}),_0x57ec4b=_0x1e2366[_0x567e8c(0x18d)];_0x5b7f7b[_0x567e8c(0x1ae)]&&(console['error'](_0x567e8c(0x1a5)+_0x57ec4b['type']),console[_0x567e8c(0x1a0)]('Parent\x20ID:\x20'+_0x57ec4b[_0x567e8c(0x187)]),_0x57ec4b[_0x567e8c(0x18c)]&&console['error'](_0x567e8c(0x197)+_0x57ec4b[_0x567e8c(0x18c)]));if(_0x57ec4b[_0x567e8c(0x1a9)]===_0x567e8c(0x193))return console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x189)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x567e8c(0x1a0)](_0x567e8c(0x1af)),console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x1aa)](_0x567e8c(0x192)+_0x57ec4b[_0x567e8c(0x194)]+(_0x57ec4b[_0x567e8c(0x18a)]?'/'+_0x57ec4b[_0x567e8c(0x18a)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x57ec4b[_0x567e8c(0x19c)],'parent_segment':_0x57ec4b['parentName']},_0x50302c),console[_0x567e8c(0x179)](a56_0x31cc40['green'](_0x567e8c(0x184)+a56_0x31cc40['cyan'](_0x57ec4b[_0x567e8c(0x19c)]))),_0x5b7f7b[_0x567e8c(0x1ae)]&&(console['error'](a56_0x31cc40[_0x567e8c(0x17a)](_0x567e8c(0x18e))),console[_0x567e8c(0x1a0)](a56_0x31cc40['dim'](_0x567e8c(0x19b)))),0x0;}catch(_0x4f92b8){throw _0x4f92b8;}}}
1
+ const a57_0x35ee14=a57_0x370b;(function(_0x224bf5,_0x158fd6){const _0x3585f2=a57_0x370b,_0x212780=_0x224bf5();while(!![]){try{const _0x536ab6=-parseInt(_0x3585f2(0x15d))/0x1+-parseInt(_0x3585f2(0x136))/0x2+parseInt(_0x3585f2(0x129))/0x3+-parseInt(_0x3585f2(0x130))/0x4+parseInt(_0x3585f2(0x149))/0x5*(parseInt(_0x3585f2(0x14c))/0x6)+parseInt(_0x3585f2(0x147))/0x7+parseInt(_0x3585f2(0x12e))/0x8*(parseInt(_0x3585f2(0x148))/0x9);if(_0x536ab6===_0x158fd6)break;else _0x212780['push'](_0x212780['shift']());}catch(_0x598735){_0x212780['push'](_0x212780['shift']());}}}(a57_0x32c6,0x4fb90));function a57_0x32c6(){const _0x56a0ea=['parentId','Examples:','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Site:\x20','isAbsolute','cyan','Resolved\x20relative\x20path\x20to:\x20','session','✔\x20Context\x20set\x20to:\x20','2495752fbRSCY','467469MFEBYI','412630JVVSwF','Use:\x20tdx\x20segment\x20use\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','6lPLiZC','green','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','log','segment','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','join','error','site','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Parent\x20ID:\x20','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Resolving\x20path\x20\x27','folderId','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','description','581039sglpMt','name','red','738873BVfpwN','type','isDirectory','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','dim','128KgmPRx','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','1227476xGEbup','folderPath','parentName','verbose','execute','Target\x20path:\x20','603914MtnclA','fullPath','length','config','Folder\x20ID:\x20','Error:\x20Path\x20is\x20required\x0a','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','segments'];a57_0x32c6=function(){return _0x56a0ea;};return a57_0x32c6();}import{existsSync,statSync}from'fs';import a57_0x459131 from'chalk';import{BaseCommand}from'./command.js';function a57_0x370b(_0x530574,_0x57f400){_0x530574=_0x530574-0x128;const _0x32c62d=a57_0x32c6();let _0x370bec=_0x32c62d[_0x530574];return _0x370bec;}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{[a57_0x35ee14(0x15e)]='segment:use';[a57_0x35ee14(0x15c)]=a57_0x35ee14(0x15b);async[a57_0x35ee14(0x134)](_0x3a7677){const _0x2d222e=a57_0x35ee14,{options:_0x4d2c90,args:_0x2500c6,tdx:_0x845aef}=_0x3a7677;if(_0x2500c6[_0x2d222e(0x138)]===0x0)return console['error'](a57_0x459131[_0x2d222e(0x128)](_0x2d222e(0x13b))),console[_0x2d222e(0x153)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error'](_0x2d222e(0x13f)),console[_0x2d222e(0x153)](_0x2d222e(0x12c)),console[_0x2d222e(0x153)](_0x2d222e(0x14e)),console[_0x2d222e(0x153)](_0x2d222e(0x155)),console[_0x2d222e(0x153)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x10f6d2=_0x2500c6[0x0],_0xcdc774=_0x4d2c90[_0x2d222e(0x145)];try{if(_0x10f6d2==='/')return saveSessionContext({'segment_path':undefined},_0xcdc774),console[_0x2d222e(0x14f)](a57_0x459131[_0x2d222e(0x14d)](_0x2d222e(0x15a))),0x0;if(existsSync(_0x10f6d2)&&statSync(_0x10f6d2)[_0x2d222e(0x12b)]()){let _0x260bb8;try{_0x260bb8=findTdxConfig(_0x10f6d2);}catch{return console[_0x2d222e(0x153)](a57_0x459131[_0x2d222e(0x128)](_0x2d222e(0x14b)+_0x10f6d2)),console[_0x2d222e(0x153)](a57_0x459131['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x4bb641=_0x260bb8[_0x2d222e(0x139)]['parent_segment'];return saveSessionContext({'segment_path':_0x4bb641,'parent_segment':_0x4bb641},_0xcdc774),console[_0x2d222e(0x14f)](a57_0x459131[_0x2d222e(0x14d)](_0x2d222e(0x146)+a57_0x459131[_0x2d222e(0x143)](_0x4bb641))),0x0;}const _0x181f6c=_0x4d2c90['segmentPath'];let _0xad83ef=_0x10f6d2;const _0x401b20=parsePath(_0x10f6d2);if(!_0x401b20[_0x2d222e(0x142)]){if(!_0x181f6c)return console['error'](a57_0x459131[_0x2d222e(0x128)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x2d222e(0x153)](a57_0x459131[_0x2d222e(0x143)](_0x2d222e(0x151))),0x1;if(_0x10f6d2==='..'){const _0x5cdea0=_0x181f6c['split']('/')['slice'](0x0,-0x1)[_0x2d222e(0x152)]('/');_0xad83ef=_0x5cdea0||'/';}else _0x10f6d2==='.'?_0xad83ef=_0x181f6c:_0xad83ef=_0x181f6c+'/'+_0x10f6d2;_0x4d2c90['verbose']&&console[_0x2d222e(0x153)](_0x2d222e(0x144)+_0xad83ef);}if(_0xad83ef==='/'||_0xad83ef==='')return saveSessionContext({'segment_path':undefined},_0xcdc774),console['log'](a57_0x459131[_0x2d222e(0x14d)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0xad83ef=normalizePath(_0xad83ef);const _0x273688=parsePath(_0xad83ef)[_0x2d222e(0x13d)];if(_0x273688['length']===0x0)return saveSessionContext({'segment_path':undefined},_0xcdc774),console[_0x2d222e(0x14f)](a57_0x459131[_0x2d222e(0x14d)](_0x2d222e(0x15a))),0x0;_0x4d2c90[_0x2d222e(0x133)]&&(console[_0x2d222e(0x153)](_0x2d222e(0x141)+_0x4d2c90[_0x2d222e(0x154)]),console[_0x2d222e(0x153)](_0x2d222e(0x135)+_0xad83ef));const _0x176025=await withSpinner(_0x2d222e(0x158)+_0xad83ef+'\x27...',()=>_0x845aef[_0x2d222e(0x150)]['resolvePathToResource'](_0xad83ef),{'verbose':_0x4d2c90[_0x2d222e(0x133)]}),_0x177c79=_0x176025['data'];_0x4d2c90[_0x2d222e(0x133)]&&(console[_0x2d222e(0x153)]('Resolved\x20path\x20type:\x20'+_0x177c79[_0x2d222e(0x12a)]),console[_0x2d222e(0x153)](_0x2d222e(0x156)+_0x177c79[_0x2d222e(0x13e)]),_0x177c79[_0x2d222e(0x159)]&&console[_0x2d222e(0x153)](_0x2d222e(0x13a)+_0x177c79[_0x2d222e(0x159)]));if(_0x177c79['type']==='segment')return console['error'](a57_0x459131[_0x2d222e(0x128)](_0x2d222e(0x157))),console['error'](_0x2d222e(0x12f)),console['error'](a57_0x459131['cyan'](_0x2d222e(0x14a)+_0x177c79[_0x2d222e(0x132)]+(_0x177c79[_0x2d222e(0x131)]?'/'+_0x177c79[_0x2d222e(0x131)][_0x2d222e(0x152)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x177c79[_0x2d222e(0x137)],'parent_segment':_0x177c79[_0x2d222e(0x132)]},_0xcdc774),console[_0x2d222e(0x14f)](a57_0x459131[_0x2d222e(0x14d)](_0x2d222e(0x146)+a57_0x459131[_0x2d222e(0x143)](_0x177c79[_0x2d222e(0x137)]))),_0x4d2c90[_0x2d222e(0x133)]&&(console[_0x2d222e(0x153)](a57_0x459131[_0x2d222e(0x12d)](_0x2d222e(0x140))),console['error'](a57_0x459131[_0x2d222e(0x12d)](_0x2d222e(0x13c)))),0x0;}catch(_0x4b1bdf){throw _0x4b1bdf;}}}
@@ -1 +1 @@
1
- const a57_0x54c468=a57_0x2506;(function(_0x62af1e,_0x2516ad){const _0x4a1fa6=a57_0x2506,_0x26d436=_0x62af1e();while(!![]){try{const _0x3f848c=-parseInt(_0x4a1fa6(0x1d7))/0x1+parseInt(_0x4a1fa6(0x1cf))/0x2+parseInt(_0x4a1fa6(0x1bb))/0x3+parseInt(_0x4a1fa6(0x1c5))/0x4+-parseInt(_0x4a1fa6(0x1b4))/0x5*(parseInt(_0x4a1fa6(0x1b5))/0x6)+-parseInt(_0x4a1fa6(0x1d9))/0x7*(parseInt(_0x4a1fa6(0x1b2))/0x8)+-parseInt(_0x4a1fa6(0x1d2))/0x9;if(_0x3f848c===_0x2516ad)break;else _0x26d436['push'](_0x26d436['shift']());}catch(_0xc0bb91){_0x26d436['push'](_0x26d436['shift']());}}}(a57_0x692f,0x20ea7));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a57_0x2506(_0x166fb4,_0x4ebf9d){_0x166fb4=_0x166fb4-0x1af;const _0x692f17=a57_0x692f();let _0x2506fb=_0x692f17[_0x166fb4];return _0x2506fb;}import{existsSync}from'fs';function a57_0x692f(){const _0x4bcbde=['dim','endsWith','\x20warning(s)\x20found','\x20file(s)\x20valid','✔\x20All\x20','valid','288602hJifow','invalidCount','log','954999ppCTsy','\x20file(s)\x20with\x20errors,\x20','\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','cwd','.yaml','112376puPcFa','red','7651vcwRZQ','type','length','Error:\x20','error','):\x20','description','136YRzngw','hasErrors','5JqYLvS','80436hZWFeQ','Validate\x20segment\x20and\x20journey\x20YAML\x20files','name','targetDir','execute','filePath','228378abPExn','verbose','\x20error(s)','validCount','\x20warning(s)','yellow','errors','no_parent','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','message','659480MXBckk','helpText','warningCount','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a57_0x692f=function(){return _0x4bcbde;};return a57_0x692f();}import a57_0x5f0f6c 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{[a57_0x54c468(0x1b7)]='segment:validate';[a57_0x54c468(0x1b1)]=a57_0x54c468(0x1b6);async[a57_0x54c468(0x1b9)](_0x22db99){const _0x27ff57=a57_0x54c468,{options:_0xc247df,args:_0x3e9db7}=_0x22db99,_0x412282=_0xc247df,_0x49af2b=await resolveTarget({'arg':_0x3e9db7[0x0],'contextParent':_0xc247df['parentSegment'],'cwd':process[_0x27ff57(0x1d5)]()});if(!isSuccessfulResolution(_0x49af2b))return _0x49af2b['errorCode']===_0x27ff57(0x1c2)?(console[_0x27ff57(0x1af)](a57_0x5f0f6c[_0x27ff57(0x1c0)](_0x27ff57(0x1c8))),console[_0x27ff57(0x1af)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x27ff57(0x1af)](_0x27ff57(0x1d4)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a57_0x5f0f6c[_0x27ff57(0x1d8)](_0x27ff57(0x1dc)+_0x49af2b[_0x27ff57(0x1c4)]+'\x0a')),_0x49af2b[_0x27ff57(0x1c6)]&&console[_0x27ff57(0x1af)](a57_0x5f0f6c['cyan'](_0x49af2b[_0x27ff57(0x1c6)]))),0x1;const _0x15fbee=_0x49af2b[_0x27ff57(0x1b8)],_0x1c2ccf=_0x49af2b[_0x27ff57(0x1da)]==='file'?_0x49af2b[_0x27ff57(0x1ba)]:undefined;if(!_0x1c2ccf&&!existsSync(_0x15fbee))return console[_0x27ff57(0x1af)](a57_0x5f0f6c[_0x27ff57(0x1d8)]('Error:\x20Directory\x20not\x20found:\x20'+_0x15fbee+'\x0a')),0x1;let _0x40a12e;if(_0x1c2ccf){if(!_0x1c2ccf[_0x27ff57(0x1ca)]('.yml')&&!_0x1c2ccf['endsWith'](_0x27ff57(0x1d6)))return console[_0x27ff57(0x1af)](a57_0x5f0f6c[_0x27ff57(0x1d8)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1c2ccf+'\x0a')),0x1;_0x40a12e=[_0x1c2ccf];}else _0x40a12e=findYamlFiles(_0x15fbee);if(_0x40a12e['length']===0x0)return console[_0x27ff57(0x1af)](a57_0x5f0f6c[_0x27ff57(0x1d8)](_0x27ff57(0x1c3)+_0x15fbee+'\x0a')),0x1;const _0x2a1972=validateYamlFiles(_0x40a12e,_0x15fbee),_0x25e5a8=calculateSummary(_0x2a1972);for(const _0x1630da of _0x2a1972){if(!isValidationResult(_0x1630da))continue;const {relativePath:_0x19141d,source:_0x403b68,result:_0x1cb2d6,fileType:_0x33b23c}=_0x1630da,_0x487082=_0x33b23c;if(_0x1cb2d6[_0x27ff57(0x1ce)]&&_0x1cb2d6['warnings'][_0x27ff57(0x1db)]===0x0)_0x412282[_0x27ff57(0x1bc)]&&console['log'](a57_0x5f0f6c['green']('✔\x20'+_0x19141d)+a57_0x5f0f6c[_0x27ff57(0x1c9)]('\x20('+_0x487082+')'));else _0x1cb2d6[_0x27ff57(0x1ce)]?(console['log'](a57_0x5f0f6c[_0x27ff57(0x1c0)]('⚠\x20'+_0x19141d)+a57_0x5f0f6c[_0x27ff57(0x1c9)]('\x20('+_0x487082+_0x27ff57(0x1b0)+_0x1cb2d6['warnings'][_0x27ff57(0x1db)]+_0x27ff57(0x1bf))),console['log'](formatValidationResult(_0x1cb2d6,_0x403b68,_0x19141d))):(console[_0x27ff57(0x1d1)](a57_0x5f0f6c['red']('✖\x20'+_0x19141d)+a57_0x5f0f6c[_0x27ff57(0x1c9)]('\x20('+_0x487082+'):\x20'+_0x1cb2d6[_0x27ff57(0x1c1)][_0x27ff57(0x1db)]+_0x27ff57(0x1bd))),console[_0x27ff57(0x1d1)](formatValidationResult(_0x1cb2d6,_0x403b68,_0x19141d)));}return console[_0x27ff57(0x1d1)](''),_0x25e5a8[_0x27ff57(0x1b3)]?(console[_0x27ff57(0x1d1)](a57_0x5f0f6c[_0x27ff57(0x1d8)]('Validation\x20failed:\x20'+_0x25e5a8[_0x27ff57(0x1d0)]+_0x27ff57(0x1d3)+_0x25e5a8[_0x27ff57(0x1be)]+'\x20valid')),_0x25e5a8[_0x27ff57(0x1c7)]>0x0&&console[_0x27ff57(0x1d1)](a57_0x5f0f6c[_0x27ff57(0x1c0)](_0x25e5a8[_0x27ff57(0x1c7)]+_0x27ff57(0x1cb))),0x1):(console[_0x27ff57(0x1d1)](a57_0x5f0f6c['green'](_0x27ff57(0x1cd)+_0x25e5a8[_0x27ff57(0x1be)]+_0x27ff57(0x1cc))),_0x25e5a8[_0x27ff57(0x1c7)]>0x0&&console[_0x27ff57(0x1d1)](a57_0x5f0f6c[_0x27ff57(0x1c0)](_0x25e5a8[_0x27ff57(0x1c7)]+'\x20warning(s)\x20found')),0x0);}}
1
+ const a58_0x1d4496=a58_0x178b;(function(_0x481321,_0x595f64){const _0x29a450=a58_0x178b,_0x13863a=_0x481321();while(!![]){try{const _0x3e9b83=-parseInt(_0x29a450(0x7b))/0x1*(-parseInt(_0x29a450(0x76))/0x2)+parseInt(_0x29a450(0x77))/0x3*(-parseInt(_0x29a450(0x9b))/0x4)+-parseInt(_0x29a450(0x7f))/0x5*(-parseInt(_0x29a450(0xa3))/0x6)+parseInt(_0x29a450(0x72))/0x7+parseInt(_0x29a450(0x8f))/0x8+-parseInt(_0x29a450(0x98))/0x9*(parseInt(_0x29a450(0x9e))/0xa)+-parseInt(_0x29a450(0x73))/0xb*(parseInt(_0x29a450(0x6d))/0xc);if(_0x3e9b83===_0x595f64)break;else _0x13863a['push'](_0x13863a['shift']());}catch(_0x1e3bf5){_0x13863a['push'](_0x13863a['shift']());}}}(a58_0xb0b0,0x82987));import{BaseCommand}from'./command.js';function a58_0x178b(_0x4d0d75,_0x122151){_0x4d0d75=_0x4d0d75-0x6b;const _0xb0b074=a58_0xb0b0();let _0x178b4a=_0xb0b074[_0x4d0d75];return _0x178b4a;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a58_0x1fdcf8 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a58_0xb0b0(){const _0xd4723d=['name','execute','\x20file(s)\x20with\x20errors,\x20','1807946OeViQE','132dIqzhi','red','length','10bvxvAo','777774dxKega','helpText','Error:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','170908ypnHLD','.yml','Error:\x20Directory\x20not\x20found:\x20','):\x20','654565BSLwLL','\x20valid','warnings','verbose','.yaml','errorCode','yellow','type','filePath','file','cyan','endsWith','no_parent','Validate\x20segment\x20and\x20journey\x20YAML\x20files','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parentSegment','7802824WZFXCk','Validation\x20failed:\x20','hasErrors','targetDir','warningCount','validCount','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','✔\x20All\x20','segment:validate','23202oLDETW','\x20file(s)\x20valid','valid','4CgwtUB','\x20warning(s)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','390ixdLlM','dim','\x20error(s)','message','log','24ckGaTN','error','\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','1717104nrgzPa','green'];a58_0xb0b0=function(){return _0xd4723d;};return a58_0xb0b0();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a58_0x1d4496(0x6f)]=a58_0x1d4496(0x97);['description']=a58_0x1d4496(0x8c);async[a58_0x1d4496(0x70)](_0x193c1a){const _0x33f539=a58_0x1d4496,{options:_0x182683,args:_0xee0c6b}=_0x193c1a,_0x17a208=_0x182683,_0x58d42d=await resolveTarget({'arg':_0xee0c6b[0x0],'contextParent':_0x182683[_0x33f539(0x8e)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x58d42d))return _0x58d42d[_0x33f539(0x84)]===_0x33f539(0x8b)?(console[_0x33f539(0x6b)](a58_0x1fdcf8[_0x33f539(0x85)](_0x33f539(0x7a))),console[_0x33f539(0x6b)](_0x33f539(0x95)),console[_0x33f539(0x6b)](_0x33f539(0x6c)),console[_0x33f539(0x6b)](_0x33f539(0x9d))):(console[_0x33f539(0x6b)](a58_0x1fdcf8['red'](_0x33f539(0x79)+_0x58d42d[_0x33f539(0xa1)]+'\x0a')),_0x58d42d[_0x33f539(0x78)]&&console[_0x33f539(0x6b)](a58_0x1fdcf8[_0x33f539(0x89)](_0x58d42d[_0x33f539(0x78)]))),0x1;const _0x5791fa=_0x58d42d[_0x33f539(0x92)],_0x1eb7d0=_0x58d42d[_0x33f539(0x86)]===_0x33f539(0x88)?_0x58d42d[_0x33f539(0x87)]:undefined;if(!_0x1eb7d0&&!existsSync(_0x5791fa))return console[_0x33f539(0x6b)](a58_0x1fdcf8[_0x33f539(0x74)](_0x33f539(0x7d)+_0x5791fa+'\x0a')),0x1;let _0x303314;if(_0x1eb7d0){if(!_0x1eb7d0[_0x33f539(0x8a)](_0x33f539(0x7c))&&!_0x1eb7d0[_0x33f539(0x8a)](_0x33f539(0x83)))return console[_0x33f539(0x6b)](a58_0x1fdcf8['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1eb7d0+'\x0a')),0x1;_0x303314=[_0x1eb7d0];}else _0x303314=findYamlFiles(_0x5791fa);if(_0x303314[_0x33f539(0x75)]===0x0)return console['error'](a58_0x1fdcf8[_0x33f539(0x74)](_0x33f539(0x8d)+_0x5791fa+'\x0a')),0x1;const _0x525c94=validateYamlFiles(_0x303314,_0x5791fa),_0x2f6aff=calculateSummary(_0x525c94);for(const _0x4a5156 of _0x525c94){if(!isValidationResult(_0x4a5156))continue;const {relativePath:_0x4bbd9d,source:_0x514a68,result:_0xac56d0,fileType:_0x4c8f64}=_0x4a5156,_0x49917c=_0x4c8f64;if(_0xac56d0['valid']&&_0xac56d0[_0x33f539(0x81)][_0x33f539(0x75)]===0x0)_0x17a208[_0x33f539(0x82)]&&console[_0x33f539(0xa2)](a58_0x1fdcf8[_0x33f539(0x6e)]('✔\x20'+_0x4bbd9d)+a58_0x1fdcf8['dim']('\x20('+_0x49917c+')'));else _0xac56d0[_0x33f539(0x9a)]?(console['log'](a58_0x1fdcf8[_0x33f539(0x85)]('⚠\x20'+_0x4bbd9d)+a58_0x1fdcf8[_0x33f539(0x9f)]('\x20('+_0x49917c+_0x33f539(0x7e)+_0xac56d0[_0x33f539(0x81)][_0x33f539(0x75)]+_0x33f539(0x9c))),console[_0x33f539(0xa2)](formatValidationResult(_0xac56d0,_0x514a68,_0x4bbd9d))):(console[_0x33f539(0xa2)](a58_0x1fdcf8['red']('✖\x20'+_0x4bbd9d)+a58_0x1fdcf8[_0x33f539(0x9f)]('\x20('+_0x49917c+'):\x20'+_0xac56d0['errors'][_0x33f539(0x75)]+_0x33f539(0xa0))),console[_0x33f539(0xa2)](formatValidationResult(_0xac56d0,_0x514a68,_0x4bbd9d)));}return console[_0x33f539(0xa2)](''),_0x2f6aff[_0x33f539(0x91)]?(console['log'](a58_0x1fdcf8[_0x33f539(0x74)](_0x33f539(0x90)+_0x2f6aff['invalidCount']+_0x33f539(0x71)+_0x2f6aff[_0x33f539(0x94)]+_0x33f539(0x80))),_0x2f6aff[_0x33f539(0x93)]>0x0&&console[_0x33f539(0xa2)](a58_0x1fdcf8[_0x33f539(0x85)](_0x2f6aff[_0x33f539(0x93)]+'\x20warning(s)\x20found')),0x1):(console['log'](a58_0x1fdcf8[_0x33f539(0x6e)](_0x33f539(0x96)+_0x2f6aff[_0x33f539(0x94)]+_0x33f539(0x99))),_0x2f6aff[_0x33f539(0x93)]>0x0&&console[_0x33f539(0xa2)](a58_0x1fdcf8['yellow'](_0x2f6aff['warningCount']+'\x20warning(s)\x20found')),0x0);}}
@@ -1 +1 @@
1
- const a58_0x1582a6=a58_0x1682;(function(_0x5337d5,_0x102525){const _0x26ea23=a58_0x1682,_0xa00ec4=_0x5337d5();while(!![]){try{const _0x6fc65e=-parseInt(_0x26ea23(0xca))/0x1+parseInt(_0x26ea23(0xfc))/0x2*(-parseInt(_0x26ea23(0xee))/0x3)+parseInt(_0x26ea23(0xc2))/0x4*(parseInt(_0x26ea23(0xda))/0x5)+-parseInt(_0x26ea23(0xd8))/0x6*(-parseInt(_0x26ea23(0xcb))/0x7)+-parseInt(_0x26ea23(0xe1))/0x8*(-parseInt(_0x26ea23(0xf7))/0x9)+parseInt(_0x26ea23(0x116))/0xa+parseInt(_0x26ea23(0xf5))/0xb*(parseInt(_0x26ea23(0x10c))/0xc);if(_0x6fc65e===_0x102525)break;else _0xa00ec4['push'](_0xa00ec4['shift']());}catch(_0x525e90){_0xa00ec4['push'](_0xa00ec4['shift']());}}}(a58_0x1248,0x75c8d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a58_0x1248(){const _0x5e8bbd=['name','listRecursive','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','listWithPattern','padEnd','Parent\x20segment\x20context:\x20','1226230uTmsuI','toLowerCase','/app/ps/','journey','/e/','error','maxDepth','Resolving\x20path\x20\x27','4eKoMpc','Error:\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','✔\x20Built\x20tree\x20with\x20','format','map','path','\x27...','546851MusYpi','7rdCacX','parentId','Site:\x20','length','verbose','Parent\x20ID:\x20','parentSegment','dim','searchByName','Resolving\x20parent\x20segment\x20\x27',']\x20matching\x20\x27','description','\x20match','565350FyOwAm','Recursive\x20mode:\x20enabled','3515905XyhjBT','Listing\x20folders,\x20segments,\x20and\x20journeys...','Folder/pattern\x20arg:\x20','data','localeCompare','folder','sort','904yxFSYd','folders','(id\x20','filter','segment','No\x20folders\x20or\x20segments\x20match\x20','message','\x20journey','journeyBundleName','(empty)','type','Building\x20hierarchy\x20tree...','\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.','1419LqMBMI','Set\x20a\x20parent\x20segment\x20context\x20first:','List\x20folders\x20and\x20child\x20segments','listUnifiedWithJourneys','journeys','resolvePathToResource','Folder\x20ID:\x20','54846oWEwoU','\x20\x20Cause:\x20','53127GEtLsS','✔\x20Found\x20','\x20segment','Error:\x20No\x20parent\x20segment\x20context\x20set.','/j/da','3012jxKKcH','...','\x20folder',',\x20and\x20','test','children','log','jsonl','folderId','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','recursive','No\x20items\x20match\x20pattern:\x20','site','segments','\x20matching\x20\x27','json','372esLqRr','listUnified','Searching\x20the\x20tree\x20for\x20names\x20matching\x20','Found\x20'];a58_0x1248=function(){return _0x5e8bbd;};return a58_0x1248();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a58_0x1682(_0x2d0036,_0x163298){_0x2d0036=_0x2d0036-0xbf;const _0x12480a=a58_0x1248();let _0x168287=_0x12480a[_0x2d0036];return _0x168287;}import a58_0x568502 from'chalk';export class SegmentsCommand extends BaseCommand{[a58_0x1582a6(0x110)]=a58_0x1582a6(0x109);[a58_0x1582a6(0xd6)]=a58_0x1582a6(0xf0);async['execute'](_0x4a7647){const _0x5b8b2d=a58_0x1582a6,{options:_0x5ee588,args:_0x5222be}=_0x4a7647,_0x26d581=_0x5ee588[_0x5b8b2d(0x106)],_0x360a6c=_0x5222be[0x0];try{const _0x41e737=_0x5ee588[_0x5b8b2d(0xd1)];_0x5ee588[_0x5b8b2d(0xcf)]&&(console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xcd)+_0x5ee588[_0x5b8b2d(0x108)]),console[_0x5b8b2d(0xbf)](_0x5b8b2d(0x115)+(_0x41e737||'(not\x20set)')),_0x360a6c&&console['error'](_0x5b8b2d(0xdc)+_0x360a6c),_0x26d581&&console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xd9)));if(!_0x41e737)return console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xfa)),console['error'](''),console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xef)),console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xc4)),console['error'](_0x5b8b2d(0x105)),console[_0x5b8b2d(0xbf)](''),console['error'](_0x5b8b2d(0x112)),0x1;if(_0x360a6c&&_0x26d581)return await this[_0x5b8b2d(0xd3)](_0x4a7647,_0x41e737,_0x360a6c);const _0x3be4cf=_0x360a6c&&(_0x360a6c['includes']('*')||_0x360a6c['includes']('?'));if(_0x3be4cf)return await this[_0x5b8b2d(0x113)](_0x4a7647,_0x41e737,_0x360a6c);const _0x587009=_0x360a6c?_0x41e737+'/'+_0x360a6c:_0x41e737;return _0x26d581?await this[_0x5b8b2d(0x111)](_0x4a7647,_0x587009):await this[_0x5b8b2d(0x10d)](_0x4a7647,_0x587009);}catch(_0x596dea){if(_0x596dea instanceof SDKError)return console['error'](_0x5b8b2d(0xc3)+_0x596dea[_0x5b8b2d(0xe7)]),_0x596dea['cause']&&console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xf6)+_0x596dea['cause']),0x1;throw _0x596dea;}}async[a58_0x1582a6(0xd3)](_0x1ebd23,_0x31e893,_0x37e303){const _0xf8c8c4=a58_0x1582a6,{options:_0x36e804,tdx:_0x5584e9}=_0x1ebd23,_0x5dfa4f='\x22'+_0x37e303+'\x22',_0x169830=await withSpinner(_0xf8c8c4(0xc1)+_0x31e893+_0xf8c8c4(0xc9),()=>_0x5584e9[_0xf8c8c4(0xe5)]['resolvePathToResource'](_0x31e893),{'verbose':_0x36e804[_0xf8c8c4(0xcf)]}),_0x5aca56=_0x169830[_0xf8c8c4(0xdd)],_0x587a06=_0x36e804['maxDepth']||0xa,_0xa03f53=await withSpinner(_0xf8c8c4(0x10e)+_0x5dfa4f+_0xf8c8c4(0xfd),()=>_0x5584e9['segment']['listRecursive'](_0x5aca56[_0xf8c8c4(0xcc)],_0x5aca56[_0xf8c8c4(0x104)],0x0,_0x587a06),{'verbose':_0x36e804[_0xf8c8c4(0xcf)]}),_0x2a836a=searchTreeByName(_0xa03f53[_0xf8c8c4(0xdd)],_0x37e303),_0x1f541c=_0x6d1274=>getConsoleNextUrl(_0x36e804[_0xf8c8c4(0x108)],_0xf8c8c4(0x118)+_0x5aca56[_0xf8c8c4(0xcc)]+'/e/'+_0x6d1274),_0x39cfbd=[..._0x2a836a][_0xf8c8c4(0xe0)]((_0x544120,_0x5ec1ec)=>_0x544120[_0xf8c8c4(0xc8)][_0xf8c8c4(0xde)](_0x5ec1ec[_0xf8c8c4(0xc8)])),_0xa106a2=0x32,_0x42f7d4=_0xf8c8c4(0x10f)+_0x2a836a[_0xf8c8c4(0xce)]+_0xf8c8c4(0xd7)+(_0x2a836a['length']!==0x1?'es':'');console[_0xf8c8c4(0xbf)](_0x2a836a[_0xf8c8c4(0xce)]>_0xa106a2?'✔\x20'+_0x42f7d4+'\x20—\x20that\x27s\x20a\x20lot\x20to\x20eyeball.\x20Narrow\x20the\x20pattern\x20(add\x20more\x20of\x20the\x20name,\x20or\x20use\x20*\x20/\x20?),\x20or\x20use\x20--format\x20json\x20and\x20filter\x20with\x20jq/grep.':'✔\x20'+_0x42f7d4);if(_0x36e804[_0xf8c8c4(0xc6)]===_0xf8c8c4(0x10b)||_0x36e804[_0xf8c8c4(0xc6)]===_0xf8c8c4(0x103)){const _0x26f8e8=_0x39cfbd[_0xf8c8c4(0xc7)](_0x412182=>({..._0x412182,..._0x412182[_0xf8c8c4(0xeb)]===_0xf8c8c4(0xe5)?{'url':_0x1f541c(_0x412182['id'])}:{}}));return await handleSDKOutput(_0x26f8e8,_0x36e804),0x0;}if(_0x2a836a['length']===0x0)return console[_0xf8c8c4(0x102)](_0xf8c8c4(0xe6)+_0x5dfa4f),0x0;for(const _0x5dfd5a of _0x39cfbd){console['log'](_0x5dfd5a['type'][_0xf8c8c4(0x114)](0x8)+'\x20'+_0x5dfd5a[_0xf8c8c4(0xc8)]+'\x20\x20'+a58_0x568502[_0xf8c8c4(0xd2)](_0xf8c8c4(0xe3)+_0x5dfd5a['id']+')'));}const _0x4f02d4=_0x2a836a['filter'](_0x4e4d1f=>_0x4e4d1f[_0xf8c8c4(0xeb)]===_0xf8c8c4(0xe5)),_0x11f9a9=new Set(_0x4f02d4[_0xf8c8c4(0xc7)](_0x59df5e=>_0x59df5e[_0xf8c8c4(0x110)][_0xf8c8c4(0x117)]()))['size']===0x1;return _0x4f02d4[_0xf8c8c4(0xce)]>0x1&&_0x11f9a9&&console[_0xf8c8c4(0x102)](a58_0x568502['dim']('\x0a'+_0x4f02d4[_0xf8c8c4(0xce)]+_0xf8c8c4(0xed))),0x0;}async['listWithPattern'](_0x359ca4,_0x121fa9,_0x400ac9){const _0x46d477=a58_0x1582a6,{options:_0x22b50d,tdx:_0x38a428}=_0x359ca4,_0x45a4e6=await withSpinner(_0x46d477(0xd4)+_0x121fa9+_0x46d477(0xc9),()=>_0x38a428[_0x46d477(0xe5)][_0x46d477(0xf3)](_0x121fa9),{'verbose':_0x22b50d['verbose']}),_0x1b7aa3=_0x45a4e6['data'],_0x55b2ea=await withSpinner(_0x46d477(0xdb),()=>_0x38a428['segment'][_0x46d477(0xf1)](_0x1b7aa3['parentId'],_0x1b7aa3[_0x46d477(0x104)]),{'verbose':_0x22b50d[_0x46d477(0xcf)]}),{folders:_0x4ac0c9,segments:_0x53a7eb,journeys:_0x2926a0}=_0x55b2ea[_0x46d477(0xdd)],_0x32d6fe=_0x400ac9['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x49ac53=new RegExp('^'+_0x32d6fe+'$','i'),_0x3f9294=_0x4ac0c9[_0x46d477(0xe4)](_0x2dd289=>_0x49ac53[_0x46d477(0x100)](_0x2dd289[_0x46d477(0x110)])),_0x1dfede=_0x53a7eb['filter'](_0x5e4ae8=>_0x49ac53[_0x46d477(0x100)](_0x5e4ae8[_0x46d477(0x110)])),_0xae7370=_0x2926a0[_0x46d477(0xe4)](_0x4e851e=>_0x49ac53[_0x46d477(0x100)](_0x4e851e[_0x46d477(0xe9)])),_0x368053=_0x3f9294[_0x46d477(0xce)]+_0x1dfede[_0x46d477(0xce)]+_0xae7370[_0x46d477(0xce)];console['error'](_0x46d477(0xf8)+_0x3f9294[_0x46d477(0xce)]+_0x46d477(0xfe)+(_0x3f9294[_0x46d477(0xce)]!==0x1?'s':'')+',\x20'+_0x1dfede['length']+_0x46d477(0xf9)+(_0x1dfede[_0x46d477(0xce)]!==0x1?'s':'')+_0x46d477(0xff)+_0xae7370[_0x46d477(0xce)]+_0x46d477(0xe8)+(_0xae7370['length']!==0x1?'s':'')+_0x46d477(0x10a)+_0x400ac9+'\x27');const _0x4eda19=_0xea7cfd=>{return getConsoleNextUrl(_0x22b50d['site'],'/app/ps/'+_0x1b7aa3['parentId']+'/e/'+_0xea7cfd);},_0x138bb2=_0x22b50d[_0x46d477(0xc6)]==='json'||_0x22b50d[_0x46d477(0xc6)]===_0x46d477(0x103);if(_0x138bb2){const _0x11a05b=[..._0x3f9294['map'](_0x7ff07e=>({..._0x7ff07e,'type':_0x46d477(0xdf)})),..._0x1dfede[_0x46d477(0xc7)](_0x1dfd25=>({..._0x1dfd25,'type':_0x46d477(0xe5),'url':_0x4eda19(_0x1dfd25['id'])})),..._0xae7370[_0x46d477(0xc7)](_0xb1bc8=>({..._0xb1bc8,'name':_0xb1bc8[_0x46d477(0xe9)],'type':_0x46d477(0x119)}))]['sort']((_0x15e186,_0x2fe8d2)=>_0x15e186[_0x46d477(0x110)]['localeCompare'](_0x2fe8d2[_0x46d477(0x110)]));await handleSDKOutput(_0x11a05b,_0x22b50d);}else{if(_0x368053===0x0)console[_0x46d477(0x102)](_0x46d477(0x107)+_0x400ac9);else{console[_0x46d477(0x102)](a58_0x568502[_0x46d477(0xd2)]('['+_0x121fa9+_0x46d477(0xd5)+_0x400ac9+'\x27'));const _0x596872=formatFlatList(_0x3f9294,_0x1dfede,{'showMetadata':!![],'getSegmentUrl':_0x4eda19},_0xae7370);console[_0x46d477(0x102)](_0x596872);}}return 0x0;}async[a58_0x1582a6(0x10d)](_0x40a195,_0x2e2d30){const _0xfdf88a=a58_0x1582a6,{options:_0x45efe5,tdx:_0x2bad67}=_0x40a195,_0x25f026=await withSpinner(_0xfdf88a(0xc1)+_0x2e2d30+_0xfdf88a(0xc9),()=>_0x2bad67[_0xfdf88a(0xe5)][_0xfdf88a(0xf3)](_0x2e2d30),{'verbose':_0x45efe5[_0xfdf88a(0xcf)]}),_0x2a5fdd=_0x25f026[_0xfdf88a(0xdd)];_0x45efe5['verbose']&&(console['error'](_0xfdf88a(0xd0)+_0x2a5fdd[_0xfdf88a(0xcc)]),_0x2a5fdd[_0xfdf88a(0x104)]&&console[_0xfdf88a(0xbf)](_0xfdf88a(0xf4)+_0x2a5fdd[_0xfdf88a(0x104)]));const _0x49996e=await withSpinner(_0xfdf88a(0xdb),()=>_0x2bad67['segment'][_0xfdf88a(0xf1)](_0x2a5fdd[_0xfdf88a(0xcc)],_0x2a5fdd[_0xfdf88a(0x104)]),{'verbose':_0x45efe5['verbose']}),{folders:_0x17dd0c,segments:_0x300652,journeys:_0x118d50}=_0x49996e[_0xfdf88a(0xdd)],_0x413aaf=_0x17dd0c[_0xfdf88a(0xce)]+_0x300652[_0xfdf88a(0xce)]+_0x118d50[_0xfdf88a(0xce)];console[_0xfdf88a(0xbf)]('✔\x20Found\x20'+_0x17dd0c['length']+_0xfdf88a(0xfe)+(_0x17dd0c[_0xfdf88a(0xce)]!==0x1?'s':'')+',\x20'+_0x300652[_0xfdf88a(0xce)]+'\x20segment'+(_0x300652[_0xfdf88a(0xce)]!==0x1?'s':'')+_0xfdf88a(0xff)+_0x118d50[_0xfdf88a(0xce)]+_0xfdf88a(0xe8)+(_0x118d50[_0xfdf88a(0xce)]!==0x1?'s':''));const _0x52dc5c=_0x438272=>{const _0x4671dc=_0xfdf88a;return getConsoleNextUrl(_0x45efe5[_0x4671dc(0x108)],_0x4671dc(0x118)+_0x2a5fdd[_0x4671dc(0xcc)]+'/e/'+_0x438272);},_0x437896=_0x54f1e3=>{const _0x3aaa2e=_0xfdf88a;return getConsoleNextUrl(_0x45efe5['site'],'/app/ps/'+_0x2a5fdd[_0x3aaa2e(0xcc)]+_0x3aaa2e(0x11a)+_0x54f1e3+_0x3aaa2e(0xfb));},_0x1b3c81=_0x45efe5[_0xfdf88a(0xc6)]===_0xfdf88a(0x10b)||_0x45efe5[_0xfdf88a(0xc6)]===_0xfdf88a(0x103);if(_0x1b3c81){const _0x4f7fce=[..._0x17dd0c['map'](_0x209575=>({..._0x209575,'type':_0xfdf88a(0xdf)})),..._0x300652[_0xfdf88a(0xc7)](_0x496411=>({..._0x496411,'type':_0xfdf88a(0xe5),'url':_0x52dc5c(_0x496411['id'])})),..._0x118d50[_0xfdf88a(0xc7)](_0x4bfce8=>({..._0x4bfce8,'name':_0x4bfce8['journeyBundleName'],'type':'journey','url':_0x437896(_0x4bfce8['id'])}))][_0xfdf88a(0xe0)]((_0x3a28e7,_0xecd19d)=>_0x3a28e7[_0xfdf88a(0x110)][_0xfdf88a(0xde)](_0xecd19d[_0xfdf88a(0x110)]));await handleSDKOutput(_0x4f7fce,_0x45efe5);}else{if(_0x413aaf===0x0)console[_0xfdf88a(0x102)](a58_0x568502[_0xfdf88a(0xd2)]('['+_0x2e2d30+']')),console[_0xfdf88a(0x102)](_0xfdf88a(0xea));else{console['log'](a58_0x568502['dim']('['+_0x2e2d30+']'));const _0x5699be=formatFlatList(_0x17dd0c,_0x300652,{'showMetadata':!![],'getSegmentUrl':_0x52dc5c,'getJourneyUrl':_0x437896},_0x118d50);console['log'](_0x5699be);}}return 0x0;}async['listRecursive'](_0x8f9578,_0x1f50a5){const _0x440499=a58_0x1582a6,{options:_0x437c38,tdx:_0x55c442}=_0x8f9578,_0x429afa=await withSpinner('Resolving\x20path\x20\x27'+_0x1f50a5+_0x440499(0xc9),()=>_0x55c442[_0x440499(0xe5)][_0x440499(0xf3)](_0x1f50a5),{'verbose':_0x437c38[_0x440499(0xcf)]}),_0x44e5f6=_0x429afa[_0x440499(0xdd)];_0x437c38['verbose']&&(console[_0x440499(0xbf)](_0x440499(0xd0)+_0x44e5f6[_0x440499(0xcc)]),_0x44e5f6[_0x440499(0x104)]&&console[_0x440499(0xbf)](_0x440499(0xf4)+_0x44e5f6['folderId']));const _0x9e46e8=_0x437c38[_0x440499(0xc0)]||0xa,_0x6be93=await withSpinner(_0x440499(0xec),()=>_0x55c442[_0x440499(0xe5)][_0x440499(0x111)](_0x44e5f6['parentId'],_0x44e5f6[_0x440499(0x104)],0x0,_0x9e46e8),{'verbose':_0x437c38[_0x440499(0xcf)]}),_0x4af064=_0x6be93[_0x440499(0xdd)],_0x147f2c=_0x17773d=>{const _0x59d651=_0x440499;let _0x30e1aa=0x0,_0x4cc678=0x0,_0x1e9f4d=0x0;for(const _0x4a4fb4 of _0x17773d){if(_0x4a4fb4[_0x59d651(0xeb)]===_0x59d651(0xdf))_0x30e1aa++;else{if(_0x4a4fb4[_0x59d651(0xeb)]===_0x59d651(0xe5))_0x4cc678++;else{if(_0x4a4fb4[_0x59d651(0xeb)]===_0x59d651(0x119))_0x1e9f4d++;}}if(_0x4a4fb4['children']){const _0x3fe137=_0x147f2c(_0x4a4fb4[_0x59d651(0x101)]);_0x30e1aa+=_0x3fe137['folders'],_0x4cc678+=_0x3fe137[_0x59d651(0x109)],_0x1e9f4d+=_0x3fe137[_0x59d651(0xf2)];}}return{'folders':_0x30e1aa,'segments':_0x4cc678,'journeys':_0x1e9f4d};},_0x2602e9=_0x147f2c(_0x4af064);console['error'](_0x440499(0xc5)+_0x2602e9[_0x440499(0xe2)]+'\x20folder'+(_0x2602e9[_0x440499(0xe2)]!==0x1?'s':'')+',\x20'+_0x2602e9[_0x440499(0x109)]+_0x440499(0xf9)+(_0x2602e9[_0x440499(0x109)]!==0x1?'s':'')+_0x440499(0xff)+_0x2602e9[_0x440499(0xf2)]+'\x20journey'+(_0x2602e9[_0x440499(0xf2)]!==0x1?'s':''));const _0x597d32=_0x4b682f=>{const _0x2a7cf0=_0x440499;return getConsoleNextUrl(_0x437c38[_0x2a7cf0(0x108)],_0x2a7cf0(0x118)+_0x44e5f6[_0x2a7cf0(0xcc)]+'/e/'+_0x4b682f);},_0x54b164=_0x151898=>{const _0x36204f=_0x440499;return getConsoleNextUrl(_0x437c38[_0x36204f(0x108)],_0x36204f(0x118)+_0x44e5f6[_0x36204f(0xcc)]+_0x36204f(0x11a)+_0x151898+'/j/da');};if(_0x437c38['format']===_0x440499(0x10b)||_0x437c38[_0x440499(0xc6)]===_0x440499(0x103))await handleSDKOutput(_0x4af064,_0x437c38);else{console[_0x440499(0x102)](a58_0x568502[_0x440499(0xd2)]('['+_0x1f50a5+']'));const _0x2173e7=formatTree(_0x4af064,{'showMetadata':!![],'getSegmentUrl':_0x597d32,'getJourneyUrl':_0x54b164});console[_0x440499(0x102)](_0x2173e7);}return 0x0;}}
1
+ const a59_0x48fbc7=a59_0x4d80;(function(_0x1e64a5,_0x161215){const _0x5e0726=a59_0x4d80,_0xf28a66=_0x1e64a5();while(!![]){try{const _0x239a82=parseInt(_0x5e0726(0x20f))/0x1*(parseInt(_0x5e0726(0x22f))/0x2)+parseInt(_0x5e0726(0x21c))/0x3+parseInt(_0x5e0726(0x1de))/0x4+parseInt(_0x5e0726(0x202))/0x5+-parseInt(_0x5e0726(0x20b))/0x6+-parseInt(_0x5e0726(0x206))/0x7*(parseInt(_0x5e0726(0x1f3))/0x8)+-parseInt(_0x5e0726(0x20d))/0x9*(-parseInt(_0x5e0726(0x221))/0xa);if(_0x239a82===_0x161215)break;else _0xf28a66['push'](_0xf28a66['shift']());}catch(_0x1d84ff){_0xf28a66['push'](_0xf28a66['shift']());}}}(a59_0x373a,0x1afcf));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 a59_0x4d80(_0x5cec3a,_0x28df66){_0x5cec3a=_0x5cec3a-0x1d6;const _0x373a78=a59_0x373a();let _0x4d807b=_0x373a78[_0x5cec3a];return _0x4d807b;}function a59_0x373a(){const _0x2d3bc6=['\x20matching\x20\x27',']\x20matching\x20\x27','114955rSvRSA','...','Found\x20','message','28VbcXft','resolvePathToResource','folder','path','\x27...','715728WSnxkb',',\x20and\x20','36081VuqogO','Error:\x20','50493hlVzFJ','\x20journey','journey','List\x20folders\x20and\x20child\x20segments','length','cause','type','segments','\x20folder','journeys','listUnifiedWithJourneys','log','dim','99009FrXvZp','format','jsonl','json','maxDepth','270ItxRfZ','listWithPattern','No\x20folders\x20or\x20segments\x20match\x20','parentId','Searching\x20the\x20tree\x20for\x20names\x20matching\x20','verbose','folders','listUnified','Folder\x20ID:\x20','Folder/pattern\x20arg:\x20','filter','includes','replace','name','2OiELEj','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','sort','listRecursive','Resolving\x20parent\x20segment\x20\x27','/j/da','/e/','padEnd','Error:\x20No\x20parent\x20segment\x20context\x20set.','parentSegment','847236gZXsZy','(empty)','site','localeCompare','journeyBundleName','/app/ps/','data','(id\x20','size','Parent\x20segment\x20context:\x20','\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.','execute','description','✔\x20Found\x20','Building\x20hierarchy\x20tree...','segment','\x20—\x20that\x27s\x20a\x20lot\x20to\x20eyeball.\x20Narrow\x20the\x20pattern\x20(add\x20more\x20of\x20the\x20name,\x20or\x20use\x20*\x20/\x20?),\x20or\x20use\x20--format\x20json\x20and\x20filter\x20with\x20jq/grep.','\x5c$&','Site:\x20','map','Parent\x20ID:\x20','393416qtPqzh','\x20segment','(not\x20set)','Set\x20a\x20parent\x20segment\x20context\x20first:','folderId','\x20match','Resolving\x20path\x20\x27','test','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','error','Listing\x20folders,\x20segments,\x20and\x20journeys...','toLowerCase','children'];a59_0x373a=function(){return _0x2d3bc6;};return a59_0x373a();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a59_0x28c3bd from'chalk';export class SegmentsCommand extends BaseCommand{[a59_0x48fbc7(0x22e)]='segments';[a59_0x48fbc7(0x1ea)]=a59_0x48fbc7(0x212);async[a59_0x48fbc7(0x1e9)](_0x47c31c){const _0x1961a9=a59_0x48fbc7,{options:_0x5288a0,args:_0x3c9da3}=_0x47c31c,_0x874fc7=_0x5288a0['recursive'],_0x1692e6=_0x3c9da3[0x0];try{const _0x165683=_0x5288a0[_0x1961a9(0x1dd)];_0x5288a0['verbose']&&(console['error'](_0x1961a9(0x1f0)+_0x5288a0[_0x1961a9(0x1e0)]),console[_0x1961a9(0x1fc)](_0x1961a9(0x1e7)+(_0x165683||_0x1961a9(0x1f5))),_0x1692e6&&console[_0x1961a9(0x1fc)](_0x1961a9(0x22a)+_0x1692e6),_0x874fc7&&console[_0x1961a9(0x1fc)]('Recursive\x20mode:\x20enabled'));if(!_0x165683)return console[_0x1961a9(0x1fc)](_0x1961a9(0x1dc)),console[_0x1961a9(0x1fc)](''),console[_0x1961a9(0x1fc)](_0x1961a9(0x1f6)),console[_0x1961a9(0x1fc)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x1961a9(0x1fc)](_0x1961a9(0x1fb)),console[_0x1961a9(0x1fc)](''),console[_0x1961a9(0x1fc)](_0x1961a9(0x230)),0x1;if(_0x1692e6&&_0x874fc7)return await this['searchByName'](_0x47c31c,_0x165683,_0x1692e6);const _0x15dbe0=_0x1692e6&&(_0x1692e6[_0x1961a9(0x22c)]('*')||_0x1692e6[_0x1961a9(0x22c)]('?'));if(_0x15dbe0)return await this[_0x1961a9(0x222)](_0x47c31c,_0x165683,_0x1692e6);const _0x2fce16=_0x1692e6?_0x165683+'/'+_0x1692e6:_0x165683;return _0x874fc7?await this[_0x1961a9(0x1d7)](_0x47c31c,_0x2fce16):await this[_0x1961a9(0x228)](_0x47c31c,_0x2fce16);}catch(_0x3347fe){if(_0x3347fe instanceof SDKError)return console[_0x1961a9(0x1fc)](_0x1961a9(0x20e)+_0x3347fe[_0x1961a9(0x205)]),_0x3347fe[_0x1961a9(0x214)]&&console[_0x1961a9(0x1fc)]('\x20\x20Cause:\x20'+_0x3347fe['cause']),0x1;throw _0x3347fe;}}async['searchByName'](_0x7d4524,_0x1b3ebe,_0x244fc4){const _0x21a148=a59_0x48fbc7,{options:_0x42af65,tdx:_0x51dd1a}=_0x7d4524,_0x2cca48='\x22'+_0x244fc4+'\x22',_0x200262=await withSpinner(_0x21a148(0x1f9)+_0x1b3ebe+'\x27...',()=>_0x51dd1a['segment'][_0x21a148(0x207)](_0x1b3ebe),{'verbose':_0x42af65['verbose']}),_0x522fb5=_0x200262[_0x21a148(0x1e4)],_0x181e8e=_0x42af65[_0x21a148(0x220)]||0xa,_0x5ca293=await withSpinner(_0x21a148(0x225)+_0x2cca48+_0x21a148(0x203),()=>_0x51dd1a[_0x21a148(0x1ed)][_0x21a148(0x1d7)](_0x522fb5[_0x21a148(0x224)],_0x522fb5['folderId'],0x0,_0x181e8e),{'verbose':_0x42af65[_0x21a148(0x226)]}),_0x98ea25=searchTreeByName(_0x5ca293[_0x21a148(0x1e4)],_0x244fc4),_0x116cc8=_0x501dd0=>getConsoleNextUrl(_0x42af65[_0x21a148(0x1e0)],_0x21a148(0x1e3)+_0x522fb5[_0x21a148(0x224)]+'/e/'+_0x501dd0),_0x1999d6=[..._0x98ea25][_0x21a148(0x1d6)]((_0x212f90,_0x33989d)=>_0x212f90['path'][_0x21a148(0x1e1)](_0x33989d[_0x21a148(0x209)])),_0x97f041=0x32,_0xb8dd3e=_0x21a148(0x204)+_0x98ea25[_0x21a148(0x213)]+_0x21a148(0x1f8)+(_0x98ea25['length']!==0x1?'es':'');console['error'](_0x98ea25[_0x21a148(0x213)]>_0x97f041?'✔\x20'+_0xb8dd3e+_0x21a148(0x1ee):'✔\x20'+_0xb8dd3e);if(_0x42af65[_0x21a148(0x21d)]===_0x21a148(0x21f)||_0x42af65[_0x21a148(0x21d)]===_0x21a148(0x21e)){const _0x466e5a=_0x1999d6[_0x21a148(0x1f1)](_0xe51a2c=>({..._0xe51a2c,..._0xe51a2c[_0x21a148(0x215)]===_0x21a148(0x1ed)?{'url':_0x116cc8(_0xe51a2c['id'])}:{}}));return await handleSDKOutput(_0x466e5a,_0x42af65),0x0;}if(_0x98ea25[_0x21a148(0x213)]===0x0)return console[_0x21a148(0x21a)](_0x21a148(0x223)+_0x2cca48),0x0;for(const _0x356e85 of _0x1999d6){console[_0x21a148(0x21a)](_0x356e85[_0x21a148(0x215)][_0x21a148(0x1db)](0x8)+'\x20'+_0x356e85[_0x21a148(0x209)]+'\x20\x20'+a59_0x28c3bd[_0x21a148(0x21b)](_0x21a148(0x1e5)+_0x356e85['id']+')'));}const _0x1e5b65=_0x98ea25[_0x21a148(0x22b)](_0x1960d6=>_0x1960d6[_0x21a148(0x215)]===_0x21a148(0x1ed)),_0x1d9d90=new Set(_0x1e5b65[_0x21a148(0x1f1)](_0x4e5d7c=>_0x4e5d7c[_0x21a148(0x22e)][_0x21a148(0x1fe)]()))[_0x21a148(0x1e6)]===0x1;return _0x1e5b65['length']>0x1&&_0x1d9d90&&console[_0x21a148(0x21a)](a59_0x28c3bd['dim']('\x0a'+_0x1e5b65[_0x21a148(0x213)]+_0x21a148(0x1e8))),0x0;}async[a59_0x48fbc7(0x222)](_0x15fdf2,_0x30f6e6,_0x5c80b0){const _0x1a9f7c=a59_0x48fbc7,{options:_0x2d6096,tdx:_0x4af338}=_0x15fdf2,_0x27874d=await withSpinner(_0x1a9f7c(0x1d8)+_0x30f6e6+'\x27...',()=>_0x4af338['segment']['resolvePathToResource'](_0x30f6e6),{'verbose':_0x2d6096[_0x1a9f7c(0x226)]}),_0x2a8834=_0x27874d[_0x1a9f7c(0x1e4)],_0x4c83c9=await withSpinner(_0x1a9f7c(0x1fd),()=>_0x4af338[_0x1a9f7c(0x1ed)][_0x1a9f7c(0x219)](_0x2a8834['parentId'],_0x2a8834[_0x1a9f7c(0x1f7)]),{'verbose':_0x2d6096[_0x1a9f7c(0x226)]}),{folders:_0x5c3f41,segments:_0x2b5707,journeys:_0x3cb12a}=_0x4c83c9[_0x1a9f7c(0x1e4)],_0x18050a=_0x5c80b0[_0x1a9f7c(0x22d)](/[.+^${}()|[\]\\]/g,_0x1a9f7c(0x1ef))[_0x1a9f7c(0x22d)](/\*/g,'.*')[_0x1a9f7c(0x22d)](/\?/g,'.'),_0x57e8eb=new RegExp('^'+_0x18050a+'$','i'),_0x3ddcc4=_0x5c3f41['filter'](_0x216a59=>_0x57e8eb[_0x1a9f7c(0x1fa)](_0x216a59[_0x1a9f7c(0x22e)])),_0x3e2c55=_0x2b5707[_0x1a9f7c(0x22b)](_0x46c327=>_0x57e8eb['test'](_0x46c327[_0x1a9f7c(0x22e)])),_0x109e19=_0x3cb12a[_0x1a9f7c(0x22b)](_0x4a2714=>_0x57e8eb[_0x1a9f7c(0x1fa)](_0x4a2714[_0x1a9f7c(0x1e2)])),_0x50274e=_0x3ddcc4[_0x1a9f7c(0x213)]+_0x3e2c55['length']+_0x109e19[_0x1a9f7c(0x213)];console[_0x1a9f7c(0x1fc)](_0x1a9f7c(0x1eb)+_0x3ddcc4[_0x1a9f7c(0x213)]+_0x1a9f7c(0x217)+(_0x3ddcc4[_0x1a9f7c(0x213)]!==0x1?'s':'')+',\x20'+_0x3e2c55[_0x1a9f7c(0x213)]+_0x1a9f7c(0x1f4)+(_0x3e2c55['length']!==0x1?'s':'')+_0x1a9f7c(0x20c)+_0x109e19['length']+'\x20journey'+(_0x109e19['length']!==0x1?'s':'')+_0x1a9f7c(0x200)+_0x5c80b0+'\x27');const _0x222718=_0x1ef6f7=>{const _0x24ba8b=_0x1a9f7c;return getConsoleNextUrl(_0x2d6096[_0x24ba8b(0x1e0)],'/app/ps/'+_0x2a8834['parentId']+_0x24ba8b(0x1da)+_0x1ef6f7);},_0x2f44c5=_0x2d6096[_0x1a9f7c(0x21d)]==='json'||_0x2d6096[_0x1a9f7c(0x21d)]==='jsonl';if(_0x2f44c5){const _0x15d139=[..._0x3ddcc4[_0x1a9f7c(0x1f1)](_0x29c6ff=>({..._0x29c6ff,'type':_0x1a9f7c(0x208)})),..._0x3e2c55[_0x1a9f7c(0x1f1)](_0x34d23f=>({..._0x34d23f,'type':_0x1a9f7c(0x1ed),'url':_0x222718(_0x34d23f['id'])})),..._0x109e19[_0x1a9f7c(0x1f1)](_0x4f95d8=>({..._0x4f95d8,'name':_0x4f95d8[_0x1a9f7c(0x1e2)],'type':_0x1a9f7c(0x211)}))]['sort']((_0x4324f0,_0x5b6090)=>_0x4324f0[_0x1a9f7c(0x22e)]['localeCompare'](_0x5b6090[_0x1a9f7c(0x22e)]));await handleSDKOutput(_0x15d139,_0x2d6096);}else{if(_0x50274e===0x0)console[_0x1a9f7c(0x21a)]('No\x20items\x20match\x20pattern:\x20'+_0x5c80b0);else{console['log'](a59_0x28c3bd[_0x1a9f7c(0x21b)]('['+_0x30f6e6+_0x1a9f7c(0x201)+_0x5c80b0+'\x27'));const _0x42abb9=formatFlatList(_0x3ddcc4,_0x3e2c55,{'showMetadata':!![],'getSegmentUrl':_0x222718},_0x109e19);console[_0x1a9f7c(0x21a)](_0x42abb9);}}return 0x0;}async[a59_0x48fbc7(0x228)](_0x14dcff,_0x4346ce){const _0x3bb8e6=a59_0x48fbc7,{options:_0x358fa8,tdx:_0x9df5fe}=_0x14dcff,_0x5dca71=await withSpinner('Resolving\x20path\x20\x27'+_0x4346ce+_0x3bb8e6(0x20a),()=>_0x9df5fe['segment']['resolvePathToResource'](_0x4346ce),{'verbose':_0x358fa8[_0x3bb8e6(0x226)]}),_0x7ba4cf=_0x5dca71[_0x3bb8e6(0x1e4)];_0x358fa8[_0x3bb8e6(0x226)]&&(console['error'](_0x3bb8e6(0x1f2)+_0x7ba4cf[_0x3bb8e6(0x224)]),_0x7ba4cf[_0x3bb8e6(0x1f7)]&&console[_0x3bb8e6(0x1fc)](_0x3bb8e6(0x229)+_0x7ba4cf[_0x3bb8e6(0x1f7)]));const _0x5ca459=await withSpinner(_0x3bb8e6(0x1fd),()=>_0x9df5fe['segment'][_0x3bb8e6(0x219)](_0x7ba4cf['parentId'],_0x7ba4cf[_0x3bb8e6(0x1f7)]),{'verbose':_0x358fa8[_0x3bb8e6(0x226)]}),{folders:_0x1f9c9c,segments:_0x558bd4,journeys:_0x1bfe64}=_0x5ca459['data'],_0x46c67b=_0x1f9c9c['length']+_0x558bd4[_0x3bb8e6(0x213)]+_0x1bfe64['length'];console[_0x3bb8e6(0x1fc)](_0x3bb8e6(0x1eb)+_0x1f9c9c['length']+_0x3bb8e6(0x217)+(_0x1f9c9c[_0x3bb8e6(0x213)]!==0x1?'s':'')+',\x20'+_0x558bd4[_0x3bb8e6(0x213)]+_0x3bb8e6(0x1f4)+(_0x558bd4[_0x3bb8e6(0x213)]!==0x1?'s':'')+_0x3bb8e6(0x20c)+_0x1bfe64['length']+_0x3bb8e6(0x210)+(_0x1bfe64[_0x3bb8e6(0x213)]!==0x1?'s':''));const _0x293318=_0x454fc3=>{const _0x463d06=_0x3bb8e6;return getConsoleNextUrl(_0x358fa8[_0x463d06(0x1e0)],_0x463d06(0x1e3)+_0x7ba4cf[_0x463d06(0x224)]+_0x463d06(0x1da)+_0x454fc3);},_0x5bbb72=_0x390779=>{const _0x6d162d=_0x3bb8e6;return getConsoleNextUrl(_0x358fa8[_0x6d162d(0x1e0)],_0x6d162d(0x1e3)+_0x7ba4cf[_0x6d162d(0x224)]+_0x6d162d(0x1da)+_0x390779+'/j/da');},_0x48cade=_0x358fa8[_0x3bb8e6(0x21d)]==='json'||_0x358fa8['format']===_0x3bb8e6(0x21e);if(_0x48cade){const _0x1cf5aa=[..._0x1f9c9c['map'](_0x43a36c=>({..._0x43a36c,'type':'folder'})),..._0x558bd4[_0x3bb8e6(0x1f1)](_0x2d63d9=>({..._0x2d63d9,'type':_0x3bb8e6(0x1ed),'url':_0x293318(_0x2d63d9['id'])})),..._0x1bfe64[_0x3bb8e6(0x1f1)](_0x4f8829=>({..._0x4f8829,'name':_0x4f8829[_0x3bb8e6(0x1e2)],'type':_0x3bb8e6(0x211),'url':_0x5bbb72(_0x4f8829['id'])}))][_0x3bb8e6(0x1d6)]((_0x5653b8,_0x4c1840)=>_0x5653b8['name'][_0x3bb8e6(0x1e1)](_0x4c1840[_0x3bb8e6(0x22e)]));await handleSDKOutput(_0x1cf5aa,_0x358fa8);}else{if(_0x46c67b===0x0)console[_0x3bb8e6(0x21a)](a59_0x28c3bd['dim']('['+_0x4346ce+']')),console[_0x3bb8e6(0x21a)](_0x3bb8e6(0x1df));else{console[_0x3bb8e6(0x21a)](a59_0x28c3bd[_0x3bb8e6(0x21b)]('['+_0x4346ce+']'));const _0x1c05f7=formatFlatList(_0x1f9c9c,_0x558bd4,{'showMetadata':!![],'getSegmentUrl':_0x293318,'getJourneyUrl':_0x5bbb72},_0x1bfe64);console[_0x3bb8e6(0x21a)](_0x1c05f7);}}return 0x0;}async['listRecursive'](_0x29bdc9,_0x26ba37){const _0x31c876=a59_0x48fbc7,{options:_0x2d2b48,tdx:_0x13a01b}=_0x29bdc9,_0x18c7b7=await withSpinner(_0x31c876(0x1f9)+_0x26ba37+'\x27...',()=>_0x13a01b['segment'][_0x31c876(0x207)](_0x26ba37),{'verbose':_0x2d2b48[_0x31c876(0x226)]}),_0x51bc31=_0x18c7b7[_0x31c876(0x1e4)];_0x2d2b48[_0x31c876(0x226)]&&(console[_0x31c876(0x1fc)](_0x31c876(0x1f2)+_0x51bc31['parentId']),_0x51bc31[_0x31c876(0x1f7)]&&console[_0x31c876(0x1fc)]('Folder\x20ID:\x20'+_0x51bc31[_0x31c876(0x1f7)]));const _0x3d1ee4=_0x2d2b48[_0x31c876(0x220)]||0xa,_0xa28237=await withSpinner(_0x31c876(0x1ec),()=>_0x13a01b[_0x31c876(0x1ed)]['listRecursive'](_0x51bc31[_0x31c876(0x224)],_0x51bc31[_0x31c876(0x1f7)],0x0,_0x3d1ee4),{'verbose':_0x2d2b48['verbose']}),_0x4d972e=_0xa28237[_0x31c876(0x1e4)],_0x354b0c=_0x2971c9=>{const _0x440c7f=_0x31c876;let _0x5e8e2e=0x0,_0xe3646e=0x0,_0x5622cb=0x0;for(const _0x4a7f00 of _0x2971c9){if(_0x4a7f00[_0x440c7f(0x215)]===_0x440c7f(0x208))_0x5e8e2e++;else{if(_0x4a7f00[_0x440c7f(0x215)]==='segment')_0xe3646e++;else{if(_0x4a7f00[_0x440c7f(0x215)]===_0x440c7f(0x211))_0x5622cb++;}}if(_0x4a7f00[_0x440c7f(0x1ff)]){const _0x5a2182=_0x354b0c(_0x4a7f00['children']);_0x5e8e2e+=_0x5a2182['folders'],_0xe3646e+=_0x5a2182['segments'],_0x5622cb+=_0x5a2182['journeys'];}}return{'folders':_0x5e8e2e,'segments':_0xe3646e,'journeys':_0x5622cb};},_0x587a33=_0x354b0c(_0x4d972e);console[_0x31c876(0x1fc)]('✔\x20Built\x20tree\x20with\x20'+_0x587a33['folders']+_0x31c876(0x217)+(_0x587a33[_0x31c876(0x227)]!==0x1?'s':'')+',\x20'+_0x587a33[_0x31c876(0x216)]+'\x20segment'+(_0x587a33[_0x31c876(0x216)]!==0x1?'s':'')+_0x31c876(0x20c)+_0x587a33[_0x31c876(0x218)]+'\x20journey'+(_0x587a33[_0x31c876(0x218)]!==0x1?'s':''));const _0x5f1f82=_0xe3ab52=>{const _0x1996c7=_0x31c876;return getConsoleNextUrl(_0x2d2b48[_0x1996c7(0x1e0)],_0x1996c7(0x1e3)+_0x51bc31[_0x1996c7(0x224)]+'/e/'+_0xe3ab52);},_0x490b46=_0x1aff58=>{const _0x2bebc6=_0x31c876;return getConsoleNextUrl(_0x2d2b48[_0x2bebc6(0x1e0)],_0x2bebc6(0x1e3)+_0x51bc31['parentId']+'/e/'+_0x1aff58+_0x2bebc6(0x1d9));};if(_0x2d2b48['format']===_0x31c876(0x21f)||_0x2d2b48[_0x31c876(0x21d)]===_0x31c876(0x21e))await handleSDKOutput(_0x4d972e,_0x2d2b48);else{console['log'](a59_0x28c3bd[_0x31c876(0x21b)]('['+_0x26ba37+']'));const _0x331843=formatTree(_0x4d972e,{'showMetadata':!![],'getSegmentUrl':_0x5f1f82,'getJourneyUrl':_0x490b46});console['log'](_0x331843);}return 0x0;}}