@treasuredata/tdx 2026.8.5 → 2026.8.7

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 (311) hide show
  1. package/README.md +1 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.d.ts +1 -1
  5. package/dist/cli-categories.js +1 -1
  6. package/dist/cli-categories.js.map +1 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/activations.js +1 -1
  11. package/dist/commands/agent-command.js +1 -1
  12. package/dist/commands/agent-test-command.js +1 -1
  13. package/dist/commands/api-command.js +1 -1
  14. package/dist/commands/auth-command.js +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/codex-command.d.ts +52 -0
  22. package/dist/commands/codex-command.d.ts.map +1 -0
  23. package/dist/commands/codex-command.js +1 -0
  24. package/dist/commands/codex-command.js.map +1 -0
  25. package/dist/commands/command.js +1 -1
  26. package/dist/commands/connection-command.js +1 -1
  27. package/dist/commands/databases.js +1 -1
  28. package/dist/commands/delivery-command.js +1 -1
  29. package/dist/commands/describe.js +1 -1
  30. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  31. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  32. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  33. package/dist/commands/engage-campaign-pull-command.js +1 -1
  34. package/dist/commands/engage-campaign-push-command.js +1 -1
  35. package/dist/commands/engage-campaign-validate-command.js +1 -1
  36. package/dist/commands/engage-command.d.ts.map +1 -1
  37. package/dist/commands/engage-command.js +1 -1
  38. package/dist/commands/engage-command.js.map +1 -1
  39. package/dist/commands/engage-template-pull-command.js +1 -1
  40. package/dist/commands/engage-template-push-command.js +1 -1
  41. package/dist/commands/engage-template-validate-command.js +1 -1
  42. package/dist/commands/job-command.js +1 -1
  43. package/dist/commands/journey-command.js +1 -1
  44. package/dist/commands/journey-validate-command.js +1 -1
  45. package/dist/commands/llm-command.js +1 -1
  46. package/dist/commands/mcp-command.js +1 -1
  47. package/dist/commands/p13n-command.d.ts +16 -1
  48. package/dist/commands/p13n-command.d.ts.map +1 -1
  49. package/dist/commands/p13n-command.js +1 -1
  50. package/dist/commands/p13n-command.js.map +1 -1
  51. package/dist/commands/parent-segment-command.js +1 -1
  52. package/dist/commands/policy-command.js +1 -1
  53. package/dist/commands/profile-command.js +1 -1
  54. package/dist/commands/profiles-command.js +1 -1
  55. package/dist/commands/query-command.js +1 -1
  56. package/dist/commands/schedule-command.js +1 -1
  57. package/dist/commands/segment-command.js +1 -1
  58. package/dist/commands/segment-create-command.js +1 -1
  59. package/dist/commands/segment-fields-command.js +1 -1
  60. package/dist/commands/segment-move-command.js +1 -1
  61. package/dist/commands/segment-pull-command.js +1 -1
  62. package/dist/commands/segment-push-command.js +1 -1
  63. package/dist/commands/segment-update-command.js +1 -1
  64. package/dist/commands/segment-use-command.js +1 -1
  65. package/dist/commands/segment-validate-command.js +1 -1
  66. package/dist/commands/segments.js +1 -1
  67. package/dist/commands/show.js +1 -1
  68. package/dist/commands/status-command.js +1 -1
  69. package/dist/commands/table-deleted.js +1 -1
  70. package/dist/commands/tables.js +1 -1
  71. package/dist/commands/unset-command.d.ts +1 -0
  72. package/dist/commands/unset-command.d.ts.map +1 -1
  73. package/dist/commands/unset-command.js +1 -1
  74. package/dist/commands/unset-command.js.map +1 -1
  75. package/dist/commands/upgrade-command.js +1 -1
  76. package/dist/commands/use-command.d.ts +1 -0
  77. package/dist/commands/use-command.d.ts.map +1 -1
  78. package/dist/commands/use-command.js +1 -1
  79. package/dist/commands/use-command.js.map +1 -1
  80. package/dist/commands/user-command.js +1 -1
  81. package/dist/commands/work-command.js +1 -1
  82. package/dist/commands/workflow-command.js +1 -1
  83. package/dist/core/auth.js +1 -1
  84. package/dist/core/command-output.js +1 -1
  85. package/dist/core/config.js +1 -1
  86. package/dist/core/connection-cache.js +1 -1
  87. package/dist/core/constants.js +1 -1
  88. package/dist/core/credential-cache.js +1 -1
  89. package/dist/core/global-context.d.ts +1 -0
  90. package/dist/core/global-context.d.ts.map +1 -1
  91. package/dist/core/global-context.js +1 -1
  92. package/dist/core/global-context.js.map +1 -1
  93. package/dist/core/keychain.js +1 -1
  94. package/dist/core/oauth-keychain.js +1 -1
  95. package/dist/core/oauth.js +1 -1
  96. package/dist/core/profile.js +1 -1
  97. package/dist/core/project-config.js +1 -1
  98. package/dist/core/session.d.ts +2 -1
  99. package/dist/core/session.d.ts.map +1 -1
  100. package/dist/core/session.js +1 -1
  101. package/dist/core/session.js.map +1 -1
  102. package/dist/core/site-mismatch.js +1 -1
  103. package/dist/core/user-cache.js +1 -1
  104. package/dist/core/version.d.ts +3 -3
  105. package/dist/core/version.d.ts.map +1 -1
  106. package/dist/core/version.js +1 -1
  107. package/dist/core/version.js.map +1 -1
  108. package/dist/index.js +1 -1
  109. package/dist/mcp/server.js +1 -1
  110. package/dist/mcp/tools/index.js +1 -1
  111. package/dist/mcp/tools/tdx-run.js +1 -1
  112. package/dist/mcp/tools/tdx-search.js +1 -1
  113. package/dist/mcp/tools/work-create-item.js +1 -1
  114. package/dist/mcp/utils.js +1 -1
  115. package/dist/proxy/claude-usage-tracker.js +1 -1
  116. package/dist/proxy/passthrough-server.js +1 -1
  117. package/dist/proxy/sse-usage-parser.js +1 -1
  118. package/dist/sdk/agent/agent-config.js +1 -1
  119. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  120. package/dist/sdk/agent/agent-yaml.js +1 -1
  121. package/dist/sdk/agent/test/evaluator.js +1 -1
  122. package/dist/sdk/agent/test/executor.js +1 -1
  123. package/dist/sdk/agent/test/index.js +1 -1
  124. package/dist/sdk/agent/test/output.js +1 -1
  125. package/dist/sdk/agent/test/parser.js +1 -1
  126. package/dist/sdk/agent/tool-target-registry.js +1 -1
  127. package/dist/sdk/api.js +1 -1
  128. package/dist/sdk/auth-token.js +1 -1
  129. package/dist/sdk/cas/cas-api-client.js +1 -1
  130. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  131. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  132. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  133. package/dist/sdk/cas/cas-segment-schema.js +1 -1
  134. package/dist/sdk/cas/cas-segment-validator.js +1 -1
  135. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  136. package/dist/sdk/cas/index.js +1 -1
  137. package/dist/sdk/cas/pull-workflow.js +1 -1
  138. package/dist/sdk/cas/push-workflow.js +1 -1
  139. package/dist/sdk/cas/validate-files.js +1 -1
  140. package/dist/sdk/client/cdp-api-client.js +1 -1
  141. package/dist/sdk/client/delivery-api-client.js +1 -1
  142. package/dist/sdk/client/endpoints.js +1 -1
  143. package/dist/sdk/client/engage-api-client.d.ts +10 -2
  144. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  145. package/dist/sdk/client/engage-api-client.js +1 -1
  146. package/dist/sdk/client/engage-api-client.js.map +1 -1
  147. package/dist/sdk/client/http-client.js +1 -1
  148. package/dist/sdk/client/llm-api-client.js +1 -1
  149. package/dist/sdk/client/oauth-refresh.js +1 -1
  150. package/dist/sdk/client/p13n-studio-api-client.d.ts +65 -1
  151. package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -1
  152. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  153. package/dist/sdk/client/p13n-studio-api-client.js.map +1 -1
  154. package/dist/sdk/client/rate-limiter.js +1 -1
  155. package/dist/sdk/client/td-api-client.js +1 -1
  156. package/dist/sdk/client/trino-api-client.js +1 -1
  157. package/dist/sdk/client/workflow-client.js +1 -1
  158. package/dist/sdk/connection-validator.js +1 -1
  159. package/dist/sdk/connection.js +1 -1
  160. package/dist/sdk/delivery.js +1 -1
  161. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  162. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  163. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  164. package/dist/sdk/engage/always-on-campaign-yaml.d.ts.map +1 -1
  165. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  166. package/dist/sdk/engage/always-on-campaign-yaml.js.map +1 -1
  167. package/dist/sdk/engage/campaign-pull.js +1 -1
  168. package/dist/sdk/engage/campaign-push.js +1 -1
  169. package/dist/sdk/engage/campaign-validator.js +1 -1
  170. package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
  171. package/dist/sdk/engage/campaign-yaml.js +1 -1
  172. package/dist/sdk/engage/campaign-yaml.js.map +1 -1
  173. package/dist/sdk/engage/template-pull.js +1 -1
  174. package/dist/sdk/engage/template-push.js +1 -1
  175. package/dist/sdk/engage/template-validator.js +1 -1
  176. package/dist/sdk/engage/template-yaml.d.ts.map +1 -1
  177. package/dist/sdk/engage/template-yaml.js +1 -1
  178. package/dist/sdk/engage/template-yaml.js.map +1 -1
  179. package/dist/sdk/engage/types/always-on-campaign-schema.d.ts +1 -0
  180. package/dist/sdk/engage/types/always-on-campaign-schema.d.ts.map +1 -1
  181. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  182. package/dist/sdk/engage/types/campaign-def.js +1 -1
  183. package/dist/sdk/engage/types/campaign-schema.d.ts +2 -0
  184. package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
  185. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  186. package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
  187. package/dist/sdk/engage/types/template-schema.d.ts +1 -0
  188. package/dist/sdk/engage/types/template-schema.d.ts.map +1 -1
  189. package/dist/sdk/engage/types/template-schema.js +1 -1
  190. package/dist/sdk/engage/types/template-schema.js.map +1 -1
  191. package/dist/sdk/engage.d.ts +7 -2
  192. package/dist/sdk/engage.d.ts.map +1 -1
  193. package/dist/sdk/engage.js +1 -1
  194. package/dist/sdk/engage.js.map +1 -1
  195. package/dist/sdk/errors.js +1 -1
  196. package/dist/sdk/index.d.ts +5 -1
  197. package/dist/sdk/index.d.ts.map +1 -1
  198. package/dist/sdk/index.js +1 -1
  199. package/dist/sdk/index.js.map +1 -1
  200. package/dist/sdk/io/index.js +1 -1
  201. package/dist/sdk/io/node-filesystem.js +1 -1
  202. package/dist/sdk/job.js +1 -1
  203. package/dist/sdk/journey.js +1 -1
  204. package/dist/sdk/llm/chat-cache.js +1 -1
  205. package/dist/sdk/llm/index.js +1 -1
  206. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  207. package/dist/sdk/llm/model-factors.js +1 -1
  208. package/dist/sdk/llm/user-settings.js +1 -1
  209. package/dist/sdk/p13n-studio.d.ts +148 -1
  210. package/dist/sdk/p13n-studio.d.ts.map +1 -1
  211. package/dist/sdk/p13n-studio.js +1 -1
  212. package/dist/sdk/p13n-studio.js.map +1 -1
  213. package/dist/sdk/personalization.js +1 -1
  214. package/dist/sdk/policy.js +1 -1
  215. package/dist/sdk/query/deleted-table-validation.js +1 -1
  216. package/dist/sdk/query/index.js +1 -1
  217. package/dist/sdk/query/sql-parser.js +1 -1
  218. package/dist/sdk/realtime.js +1 -1
  219. package/dist/sdk/schedule.js +1 -1
  220. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  221. package/dist/sdk/segment/fields-display.js +1 -1
  222. package/dist/sdk/segment/file-discovery.js +1 -1
  223. package/dist/sdk/segment/journey-utils.js +1 -1
  224. package/dist/sdk/segment/journey-validator.js +1 -1
  225. package/dist/sdk/segment/journey-yaml.js +1 -1
  226. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  227. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  228. package/dist/sdk/segment/pull-workflow.js +1 -1
  229. package/dist/sdk/segment/push-recovery.js +1 -1
  230. package/dist/sdk/segment/push-workflow.js +1 -1
  231. package/dist/sdk/segment/resolution-context.js +1 -1
  232. package/dist/sdk/segment/segment-path-parser.js +1 -1
  233. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  234. package/dist/sdk/segment/segment-validator.js +1 -1
  235. package/dist/sdk/segment/target-resolution.js +1 -1
  236. package/dist/sdk/segment/tdx-config.js +1 -1
  237. package/dist/sdk/segment/types/activation-schema.js +1 -1
  238. package/dist/sdk/segment/types/journey-def.js +1 -1
  239. package/dist/sdk/segment/types/journey-schema.js +1 -1
  240. package/dist/sdk/segment/types/segment-def.js +1 -1
  241. package/dist/sdk/segment/types/segment-schema.js +1 -1
  242. package/dist/sdk/segment/validate-files.js +1 -1
  243. package/dist/sdk/segment/yaml-validator.js +1 -1
  244. package/dist/sdk/segment.js +1 -1
  245. package/dist/sdk/types/engage.d.ts +49 -0
  246. package/dist/sdk/types/engage.d.ts.map +1 -1
  247. package/dist/sdk/types/index.d.ts +3 -2
  248. package/dist/sdk/types/index.d.ts.map +1 -1
  249. package/dist/sdk/types/index.js +1 -1
  250. package/dist/sdk/types/index.js.map +1 -1
  251. package/dist/sdk/types/p13n-studio.d.ts +73 -0
  252. package/dist/sdk/types/p13n-studio.d.ts.map +1 -1
  253. package/dist/sdk/types/progress.js +1 -1
  254. package/dist/sdk/types/workspace.js +1 -1
  255. package/dist/sdk/user.js +1 -1
  256. package/dist/sdk/util/format-detector.js +1 -1
  257. package/dist/sdk/util/formatters.js +1 -1
  258. package/dist/sdk/util/index.js +1 -1
  259. package/dist/sdk/util/paginate.js +1 -1
  260. package/dist/sdk/util/tree-formatter.js +1 -1
  261. package/dist/sdk/util/tree-search.js +1 -1
  262. package/dist/sdk/workflow/archive-validation.js +1 -1
  263. package/dist/sdk/workflow/clone-workflow.js +1 -1
  264. package/dist/sdk/workflow/index.js +1 -1
  265. package/dist/sdk/workflow/pull-workflow.js +1 -1
  266. package/dist/sdk/workflow/push-workflow.js +1 -1
  267. package/dist/sdk/workflow/task-graph.js +1 -1
  268. package/dist/sdk/workflow/tdx-config.js +1 -1
  269. package/dist/sdk/workflow/workflow-utils.js +1 -1
  270. package/dist/sdk/workspace/access-tracker.js +1 -1
  271. package/dist/sdk/workspace/frontmatter.js +1 -1
  272. package/dist/sdk/workspace/git.js +1 -1
  273. package/dist/sdk/workspace/index.js +1 -1
  274. package/dist/sdk/workspace/templates.js +1 -1
  275. package/dist/sdk/workspace/weekly.js +1 -1
  276. package/dist/sdk/workspace/wikilinks.js +1 -1
  277. package/dist/test-utils/command-runner.js +1 -1
  278. package/dist/test-utils/factories.js +1 -1
  279. package/dist/test-utils/fixtures.js +1 -1
  280. package/dist/test-utils/http-mock.js +1 -1
  281. package/dist/test-utils/index.js +1 -1
  282. package/dist/utils/async.js +1 -1
  283. package/dist/utils/claude-code-state.js +1 -1
  284. package/dist/utils/colors.js +1 -1
  285. package/dist/utils/diff.js +1 -1
  286. package/dist/utils/file-permissions.js +1 -1
  287. package/dist/utils/file-reader.js +1 -1
  288. package/dist/utils/github-releases.js +1 -1
  289. package/dist/utils/global-cache.js +1 -1
  290. package/dist/utils/json-loader.js +1 -1
  291. package/dist/utils/local-cache.js +1 -1
  292. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  293. package/dist/utils/logger/formatters/index.js +1 -1
  294. package/dist/utils/logger/handlers/console-handler.js +1 -1
  295. package/dist/utils/logger/handlers/file-handler.js +1 -1
  296. package/dist/utils/logger/handlers/index.js +1 -1
  297. package/dist/utils/logger/handlers/null-handler.js +1 -1
  298. package/dist/utils/logger/index.js +1 -1
  299. package/dist/utils/logger/logger.js +1 -1
  300. package/dist/utils/logger/types.js +1 -1
  301. package/dist/utils/option-validation.js +1 -1
  302. package/dist/utils/process.js +1 -1
  303. package/dist/utils/prompt.js +1 -1
  304. package/dist/utils/proxy-fetch.js +1 -1
  305. package/dist/utils/spinner.js +1 -1
  306. package/dist/utils/sse-parser.js +1 -1
  307. package/dist/utils/string-utils.js +1 -1
  308. package/dist/utils/table-ref-parser.js +1 -1
  309. package/dist/utils/tdx-logger.js +1 -1
  310. package/dist/utils/version-check.js +1 -1
  311. package/package.json +2 -47
@@ -1 +1 @@
1
- const a43_0x54d687=a43_0x1329;(function(_0x39a8aa,_0x4ec00c){const _0x35b26a=a43_0x1329,_0x78e120=_0x39a8aa();while(!![]){try{const _0x548066=parseInt(_0x35b26a(0x1fa))/0x1*(-parseInt(_0x35b26a(0x1f8))/0x2)+-parseInt(_0x35b26a(0x200))/0x3+-parseInt(_0x35b26a(0x1ee))/0x4+parseInt(_0x35b26a(0x1fb))/0x5*(-parseInt(_0x35b26a(0x1eb))/0x6)+-parseInt(_0x35b26a(0x1e6))/0x7*(parseInt(_0x35b26a(0x1ea))/0x8)+parseInt(_0x35b26a(0x201))/0x9+-parseInt(_0x35b26a(0x1f2))/0xa*(-parseInt(_0x35b26a(0x202))/0xb);if(_0x548066===_0x4ec00c)break;else _0x78e120['push'](_0x78e120['shift']());}catch(_0x3de69e){_0x78e120['push'](_0x78e120['shift']());}}}(a43_0x6479,0x7a928));function a43_0x6479(){const _0x37bdac=['18ZLVzqV','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','80294MyUTgm','125YDVkPc','length','json','✔\x20Found\x20','\x20field','61050MzbCUC','5396571IPqWhw','831809GCpEPp','data','parentSegment','2840495GQSOhh','\x27...','site','Parent\x20segment:\x20','16iQTnUN','148110qmzvDz','segment','name','1382720sFqwOH','List\x20available\x20fields\x20for\x20segmentation','error','jsonl','320cTXcHk','description','Listing\x20fields\x20for\x20\x27','verbose','execute','listFields'];a43_0x6479=function(){return _0x37bdac;};return a43_0x6479();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a43_0x1329(_0x102e5a,_0x24eb12){_0x102e5a=_0x102e5a-0x1e5;const _0x6479b7=a43_0x6479();let _0x1329ea=_0x6479b7[_0x102e5a];return _0x1329ea;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a43_0x54d687(0x1ed)]='segment:fields';[a43_0x54d687(0x1f3)]=a43_0x54d687(0x1ef);async[a43_0x54d687(0x1f6)](_0x485ba2){const _0x2d3dc4=a43_0x54d687,{options:_0x137aac,args:_0x371226,tdx:_0x3a963a}=_0x485ba2,_0x1784a7=_0x371226[0x0]||_0x137aac[_0x2d3dc4(0x1e5)];if(!_0x1784a7)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x2d3dc4(0x1f0)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console['error'](_0x2d3dc4(0x1f9)),0x1;_0x137aac[_0x2d3dc4(0x1f5)]&&(console[_0x2d3dc4(0x1f0)]('Site:\x20'+_0x137aac[_0x2d3dc4(0x1e8)]),console[_0x2d3dc4(0x1f0)](_0x2d3dc4(0x1e9)+_0x1784a7));const _0x5707b3=await withSpinner(_0x2d3dc4(0x1f4)+_0x1784a7+_0x2d3dc4(0x1e7),()=>_0x3a963a[_0x2d3dc4(0x1ec)][_0x2d3dc4(0x1f7)](_0x1784a7),{'verbose':_0x137aac['verbose']}),_0x14a5d8=_0x5707b3[_0x2d3dc4(0x203)];console[_0x2d3dc4(0x1f0)](_0x2d3dc4(0x1fe)+_0x14a5d8[_0x2d3dc4(0x1fc)]+_0x2d3dc4(0x1ff)+(_0x14a5d8[_0x2d3dc4(0x1fc)]!==0x1?'s':''));if(_0x137aac[_0x2d3dc4(0x1fd)]||_0x137aac[_0x2d3dc4(0x1f1)])return await handleSDKOutput(_0x14a5d8,_0x137aac),0x0;return displayFieldsHumanReadable(_0x14a5d8,_0x1784a7),0x0;}}
1
+ function a44_0x5b46(_0x2c129b,_0x3ae2c7){_0x2c129b=_0x2c129b-0x198;const _0x3a2b16=a44_0x3a2b();let _0x5b46de=_0x3a2b16[_0x2c129b];return _0x5b46de;}const a44_0x52aaec=a44_0x5b46;(function(_0x212a37,_0x43e99b){const _0x5ab0aa=a44_0x5b46,_0x54ee8f=_0x212a37();while(!![]){try{const _0x4aa42a=-parseInt(_0x5ab0aa(0x1ab))/0x1*(-parseInt(_0x5ab0aa(0x1ac))/0x2)+parseInt(_0x5ab0aa(0x1b0))/0x3+-parseInt(_0x5ab0aa(0x1ad))/0x4*(parseInt(_0x5ab0aa(0x1a3))/0x5)+parseInt(_0x5ab0aa(0x19e))/0x6+-parseInt(_0x5ab0aa(0x1ae))/0x7*(parseInt(_0x5ab0aa(0x19d))/0x8)+parseInt(_0x5ab0aa(0x1af))/0x9+-parseInt(_0x5ab0aa(0x19f))/0xa;if(_0x4aa42a===_0x43e99b)break;else _0x54ee8f['push'](_0x54ee8f['shift']());}catch(_0x1e0366){_0x54ee8f['push'](_0x54ee8f['shift']());}}}(a44_0x3a2b,0x3f588));import{BaseCommand}from'./command.js';function a44_0x3a2b(){const _0x364f11=['341244SGahfW','1526273HvfRoM','2961864IiGcqg','1286592XABERk','segment','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20field','Listing\x20fields\x20for\x20\x27','description','error','verbose','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','List\x20available\x20fields\x20for\x20segmentation','segment:fields','8syywWx','1275552ukSnXK','3654140vTnMtB','length','json','execute','15HCnDuU','site','data','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27...','Parent\x20segment:\x20','listFields','✔\x20Found\x20','6VZUtSZ','42766qEtlzn'];a44_0x3a2b=function(){return _0x364f11;};return a44_0x3a2b();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a44_0x52aaec(0x19c);[a44_0x52aaec(0x1b5)]=a44_0x52aaec(0x19b);async[a44_0x52aaec(0x1a2)](_0x1c8819){const _0x199ff5=a44_0x52aaec,{options:_0x4767ed,args:_0x3fccf0,tdx:_0x45f636}=_0x1c8819,_0xb58bde=_0x3fccf0[0x0]||_0x4767ed['parentSegment'];if(!_0xb58bde)return console[_0x199ff5(0x198)](_0x199ff5(0x1a6)),console[_0x199ff5(0x198)](_0x199ff5(0x1b2)),console[_0x199ff5(0x198)](_0x199ff5(0x19a)),0x1;_0x4767ed['verbose']&&(console[_0x199ff5(0x198)]('Site:\x20'+_0x4767ed[_0x199ff5(0x1a4)]),console['error'](_0x199ff5(0x1a8)+_0xb58bde));const _0x160f99=await withSpinner(_0x199ff5(0x1b4)+_0xb58bde+_0x199ff5(0x1a7),()=>_0x45f636[_0x199ff5(0x1b1)][_0x199ff5(0x1a9)](_0xb58bde),{'verbose':_0x4767ed[_0x199ff5(0x199)]}),_0x43be3e=_0x160f99[_0x199ff5(0x1a5)];console['error'](_0x199ff5(0x1aa)+_0x43be3e[_0x199ff5(0x1a0)]+_0x199ff5(0x1b3)+(_0x43be3e[_0x199ff5(0x1a0)]!==0x1?'s':''));if(_0x4767ed[_0x199ff5(0x1a1)]||_0x4767ed['jsonl'])return await handleSDKOutput(_0x43be3e,_0x4767ed),0x0;return displayFieldsHumanReadable(_0x43be3e,_0xb58bde),0x0;}}
@@ -1 +1 @@
1
- const a44_0x2f23ad=a44_0xa668;(function(_0x402531,_0x38ffbe){const _0x4b5c02=a44_0xa668,_0x29e8d8=_0x402531();while(!![]){try{const _0x1954be=parseInt(_0x4b5c02(0x11d))/0x1+parseInt(_0x4b5c02(0x13d))/0x2+-parseInt(_0x4b5c02(0x138))/0x3*(-parseInt(_0x4b5c02(0x14d))/0x4)+-parseInt(_0x4b5c02(0x168))/0x5*(parseInt(_0x4b5c02(0x13f))/0x6)+parseInt(_0x4b5c02(0x131))/0x7*(-parseInt(_0x4b5c02(0x14c))/0x8)+parseInt(_0x4b5c02(0x127))/0x9*(-parseInt(_0x4b5c02(0x167))/0xa)+-parseInt(_0x4b5c02(0x121))/0xb;if(_0x1954be===_0x38ffbe)break;else _0x29e8d8['push'](_0x29e8d8['shift']());}catch(_0x12f86c){_0x29e8d8['push'](_0x29e8d8['shift']());}}}(a44_0x57e0,0x87728));import{BaseCommand}from'./command.js';function a44_0x57e0(){const _0x587e20=['push','Segments:\x20','\x20\x20(id\x20','\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact','507013VNnHCh','Examples:','code','forEach','1688467YuNqwf','resolvePathToResource','name','Moving','moveSegments','dryRun','948177mOSMvm','\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.','red','\x27\x20matches\x20','error','SEGMENT_NOT_FOUND','Error:\x20\x27','filter','verbose','for\x20move\x20to','4113774CJHHtF','explainAmbiguousName','segment:move','execute','Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).','preserved:','✔\x20Moved\x20segment\x20\x27','519621FHhdby','type','description','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','\x27,\x20\x27','2146690PxvzPt','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:','696HZMTqU','segment','parentSegment','\x27\x20—\x20','Searching\x20the\x20tree...','[dry-run]\x20No\x20changes\x20made.\x20','Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)','\x20\x20•\x20','Searching\x20folders\x20for\x20\x27','cyan','test','get','join','8aPPmaQ','20CgJIgo','data','\x27...','length','path','\x27\x20to\x20folder\x20\x27','slot','Checking','\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:','toLowerCase','Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','Duplicate\x20segments\x20removed\x20(','map','Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a','ruleConditionCount','set','listRecursive','yellow','includes','has','Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a','Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22','\x20folder\x20\x27','Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22','folder','20YdzzVn','40505JxdBsR','rule\x20'];a44_0x57e0=function(){return _0x587e20;};return a44_0x57e0();}import{handleSDKOutput}from'../core/command-output.js';function a44_0xa668(_0x44daee,_0x41cfd2){_0x44daee=_0x44daee-0x11b;const _0x57e0dc=a44_0x57e0();let _0xa668b1=_0x57e0dc[_0x44daee];return _0xa668b1;}import{withSpinner}from'../utils/spinner.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import a44_0xb23bc7 from'chalk';export class SegmentMoveCommand extends BaseCommand{['name']=a44_0x2f23ad(0x133);[a44_0x2f23ad(0x13a)]=a44_0x2f23ad(0x157);async[a44_0x2f23ad(0x134)](_0x261ac1){const _0x9def15=a44_0x2f23ad,{options:_0x409ad0,args:_0x1002a2,tdx:_0x3e5706}=_0x261ac1,_0x5be704=_0x1002a2,_0x51b905=_0x409ad0[_0x9def15(0x166)];if(_0x5be704[_0x9def15(0x150)]===0x0||!_0x51b905)return console[_0x9def15(0x12b)](a44_0xb23bc7[_0x9def15(0x129)](_0x9def15(0x15b))),console['error'](_0x9def15(0x158)),console['error'](_0x9def15(0x11e)),console[_0x9def15(0x12b)](_0x9def15(0x13b)),console[_0x9def15(0x12b)]('\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501'),console[_0x9def15(0x12b)]('\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)'),console[_0x9def15(0x12b)](_0x9def15(0x128)),0x1;_0x409ad0['verbose']&&(console[_0x9def15(0x12b)](_0x9def15(0x16b)+_0x5be704[_0x9def15(0x14b)](',\x20')),console['error']('Target\x20folder:\x20'+_0x51b905));const _0x22c059=[...new Set(_0x5be704)];_0x22c059[_0x9def15(0x150)]<_0x5be704[_0x9def15(0x150)]&&console[_0x9def15(0x12b)](a44_0xb23bc7[_0x9def15(0x15f)](_0x9def15(0x159)+_0x5be704[_0x9def15(0x150)]+'\x20→\x20'+_0x22c059[_0x9def15(0x150)]+').'));const _0x558bc3=/^\d+$/,_0x34117a=_0x409ad0[_0x9def15(0x141)],_0x2a36b5=[..._0x22c059,_0x51b905]['some'](_0x64a357=>!_0x558bc3[_0x9def15(0x149)](_0x64a357));if(_0x2a36b5&&!_0x34117a)return console['error'](a44_0xb23bc7[_0x9def15(0x129)](_0x9def15(0x162))),console[_0x9def15(0x12b)](_0x9def15(0x165)),console[_0x9def15(0x12b)](_0x9def15(0x163)),console[_0x9def15(0x12b)](_0x9def15(0x145)),0x1;const _0x2126e1=_0x22c059['length'],_0x46410a=_0x409ad0[_0x9def15(0x126)]===!![];let _0x2bc8b3;try{const _0x177f51=await withSpinner((_0x46410a?_0x9def15(0x154):_0x9def15(0x124))+'\x20'+_0x2126e1+'\x20segment'+(_0x2126e1===0x1?'':'s')+'\x20'+((_0x46410a?_0x9def15(0x130):'to')+_0x9def15(0x164)+_0x51b905+_0x9def15(0x14f)),async()=>{const _0x302f10=_0x9def15,_0x296b26=[];_0x22c059['forEach']((_0x1d06a4,_0x24fd3c)=>{const _0x4621c8=a44_0xa668;if(!_0x558bc3[_0x4621c8(0x149)](_0x1d06a4))_0x296b26['push']({'name':_0x1d06a4,'expectType':_0x4621c8(0x140),'slot':_0x24fd3c});});if(!_0x558bc3[_0x302f10(0x149)](_0x51b905))_0x296b26[_0x302f10(0x16a)]({'name':_0x51b905,'expectType':_0x302f10(0x166),'slot':-0x1});const _0x1e4cb4=new Map();if(_0x296b26[_0x302f10(0x150)]>0x0){const _0xf93a08=await _0x3e5706[_0x302f10(0x140)]['resolveEntitiesInParent'](_0x34117a,_0x296b26['map'](({name:_0x4ed256,expectType:_0x174df1})=>({'name':_0x4ed256,'expectType':_0x174df1})));_0xf93a08[_0x302f10(0x120)]((_0x9e0ee0,_0x150651)=>_0x1e4cb4[_0x302f10(0x15d)](_0x296b26[_0x150651][_0x302f10(0x153)],_0x9e0ee0['id']));}const _0x5bac54=_0x22c059[_0x302f10(0x15a)]((_0x26f7e3,_0x2a55b1)=>_0x558bc3[_0x302f10(0x149)](_0x26f7e3)?_0x26f7e3:_0x1e4cb4[_0x302f10(0x14a)](_0x2a55b1)),_0x212bc1=_0x558bc3[_0x302f10(0x149)](_0x51b905)?_0x51b905:_0x1e4cb4['get'](-0x1);return _0x3e5706['segment'][_0x302f10(0x125)](_0x5bac54,_0x212bc1,_0x46410a);},{'verbose':_0x409ad0[_0x9def15(0x12f)]});_0x2bc8b3=_0x177f51[_0x9def15(0x14e)];}catch(_0x3e20ad){if(_0x3e20ad instanceof SDKError&&_0x3e20ad[_0x9def15(0x11f)]===ErrorCode[_0x9def15(0x12c)]&&_0x34117a)try{if(await this[_0x9def15(0x132)](_0x3e5706,_0x34117a,_0x22c059,_0x409ad0))return 0x1;}catch{}throw _0x3e20ad;}for(const _0x24036e of _0x2bc8b3){const _0x1f994b=_0x24036e[_0x9def15(0x15c)],_0x144f78=_0x9def15(0x169)+(_0x46410a?_0x9def15(0x161):_0x9def15(0x136))+'\x20'+_0x1f994b+'\x20condition'+(_0x1f994b===0x1?'':'s');console['error'](_0x46410a?a44_0xb23bc7[_0x9def15(0x148)]('•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27'+_0x24036e['id']+_0x9def15(0x152)+_0x24036e['segmentFolderId']+'\x27\x20—\x20'+_0x144f78):a44_0xb23bc7['green'](_0x9def15(0x137)+_0x24036e['id']+_0x9def15(0x152)+_0x24036e['segmentFolderId']+_0x9def15(0x142)+_0x144f78+'\x20(verified\x20by\x20re-read)'));}if(_0x46410a)console[_0x9def15(0x12b)](a44_0xb23bc7[_0x9def15(0x148)](_0x9def15(0x144)+_0x2126e1+'\x20segment(s)\x20would\x20be\x20moved.'));else _0x2bc8b3[_0x9def15(0x150)]>0x1&&console[_0x9def15(0x12b)](a44_0xb23bc7['green']('✔\x20'+_0x2bc8b3[_0x9def15(0x150)]+_0x9def15(0x11c)));return await handleSDKOutput(_0x2bc8b3,_0x409ad0),0x0;}async[a44_0x2f23ad(0x132)](_0x49fc87,_0x2d72b9,_0x832b48,_0x3205dc){const _0x429874=a44_0x2f23ad,_0x34b0df=_0x832b48[_0x429874(0x12e)](_0x12899c=>!/^\d+$/[_0x429874(0x149)](_0x12899c)&&!_0x12899c[_0x429874(0x160)]('/'));if(_0x34b0df[_0x429874(0x150)]===0x0)return![];const _0x4188a8=await withSpinner(_0x429874(0x147)+_0x34b0df['join'](_0x429874(0x13c))+_0x429874(0x14f),()=>_0x49fc87['segment'][_0x429874(0x122)](_0x2d72b9),{'verbose':_0x3205dc[_0x429874(0x12f)]}),_0x57dedc=(await withSpinner(_0x429874(0x143),()=>_0x49fc87[_0x429874(0x140)][_0x429874(0x15e)](_0x4188a8[_0x429874(0x14e)]['parentId'],_0x4188a8[_0x429874(0x14e)]['folderId'],0x0,0xa),{'verbose':_0x3205dc[_0x429874(0x12f)]}))[_0x429874(0x14e)];let _0x236cde=![];for(const _0x2029e0 of _0x34b0df){const _0x89ac00=searchTreeByName(_0x57dedc,_0x2029e0)['filter'](_0x73a0cb=>_0x73a0cb[_0x429874(0x139)]==='segment'&&_0x73a0cb[_0x429874(0x123)][_0x429874(0x156)]()===_0x2029e0[_0x429874(0x156)]());if(_0x89ac00[_0x429874(0x150)]>0x1){_0x236cde=!![],console[_0x429874(0x12b)](a44_0xb23bc7[_0x429874(0x129)](_0x429874(0x12d)+_0x2029e0+_0x429874(0x12a)+_0x89ac00[_0x429874(0x150)]+_0x429874(0x155)));for(const _0x17d0d6 of _0x89ac00)console['error'](_0x429874(0x146)+_0x17d0d6[_0x429874(0x151)]+_0x429874(0x11b)+_0x17d0d6['id']+')');}else _0x89ac00[_0x429874(0x150)]===0x1&&(_0x236cde=!![],console[_0x429874(0x12b)](a44_0xb23bc7['red'](_0x429874(0x12d)+_0x2029e0+_0x429874(0x13e))),console[_0x429874(0x12b)]('\x20\x20'+_0x89ac00[0x0]['path']+'\x20\x20(id\x20'+_0x89ac00[0x0]['id']+')'),console['error'](_0x429874(0x135)));}return _0x236cde;}}
1
+ function a45_0x30f4(_0x33fb8c,_0x2db935){_0x33fb8c=_0x33fb8c-0x94;const _0x2f539c=a45_0x2f53();let _0x30f42f=_0x2f539c[_0x33fb8c];return _0x30f42f;}const a45_0x137b53=a45_0x30f4;(function(_0x5d25fb,_0x8e7506){const _0x2fc263=a45_0x30f4,_0x1cdd93=_0x5d25fb();while(!![]){try{const _0x239ef8=parseInt(_0x2fc263(0xdc))/0x1+-parseInt(_0x2fc263(0xc2))/0x2*(-parseInt(_0x2fc263(0xaa))/0x3)+parseInt(_0x2fc263(0x94))/0x4+-parseInt(_0x2fc263(0xcd))/0x5+parseInt(_0x2fc263(0xb0))/0x6+-parseInt(_0x2fc263(0xa6))/0x7+-parseInt(_0x2fc263(0xad))/0x8;if(_0x239ef8===_0x8e7506)break;else _0x1cdd93['push'](_0x1cdd93['shift']());}catch(_0x2e382f){_0x1cdd93['push'](_0x1cdd93['shift']());}}}(a45_0x2f53,0x6fe5b));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';import{searchTreeByName}from'../sdk/util/tree-search.js';import a45_0x27246b from'chalk';function a45_0x2f53(){const _0x59b4c9=['2333624zwNyCJ','\x20folder\x20\x27','\x20\x20•\x20','description','filter','segment:move','slot','Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22','resolvePathToResource','\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501','explainAmbiguousName','some','Searching\x20folders\x20for\x20\x27','red','Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)','Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a','parentSegment','folder','6054391PwzCSv','moveSegments','Target\x20folder:\x20','\x27\x20to\x20folder\x20\x27','321xhpRrn','map','segment','4323576xDuwyg','green','\x20\x20(id\x20','2868426wwStUJ','length','✔\x20Moved\x20segment\x20\x27','SEGMENT_NOT_FOUND','Searching\x20the\x20tree...','Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder','data','parentId','folderId','\x20→\x20','type','push','•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27','listRecursive','\x20segment','\x27\x20—\x20','\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:','Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22','12142MgvxtB','Error:\x20\x27','path','set','includes','segmentFolderId','get','\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)','\x27...','\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact','Duplicate\x20segments\x20removed\x20(','3056775UxYFMu','cyan','test','Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).','resolveEntitiesInParent','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','error','execute','Examples:','code','yellow','join','Moving','has','toLowerCase','763972JuKpLI','verbose','Segments:\x20','forEach','ruleConditionCount','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','dryRun','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:'];a45_0x2f53=function(){return _0x59b4c9;};return a45_0x2f53();}export class SegmentMoveCommand extends BaseCommand{['name']=a45_0x137b53(0x99);[a45_0x137b53(0x97)]=a45_0x137b53(0xb5);async[a45_0x137b53(0xd4)](_0x1d1201){const _0x53fbe5=a45_0x137b53,{options:_0x26506d,args:_0x483e97,tdx:_0x100fed}=_0x1d1201,_0x44b05a=_0x483e97,_0x244472=_0x26506d[_0x53fbe5(0xa5)];if(_0x44b05a[_0x53fbe5(0xb1)]===0x0||!_0x244472)return console['error'](a45_0x27246b[_0x53fbe5(0xa1)]('Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a')),console[_0x53fbe5(0xd3)](_0x53fbe5(0xd2)),console[_0x53fbe5(0xd3)](_0x53fbe5(0xd5)),console['error'](_0x53fbe5(0xe1)),console['error'](_0x53fbe5(0x9d)),console[_0x53fbe5(0xd3)](_0x53fbe5(0xc9)),console[_0x53fbe5(0xd3)]('\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.'),0x1;_0x26506d[_0x53fbe5(0xdd)]&&(console[_0x53fbe5(0xd3)](_0x53fbe5(0xde)+_0x44b05a[_0x53fbe5(0xd8)](',\x20')),console[_0x53fbe5(0xd3)](_0x53fbe5(0xa8)+_0x244472));const _0x5200b4=[...new Set(_0x44b05a)];_0x5200b4[_0x53fbe5(0xb1)]<_0x44b05a[_0x53fbe5(0xb1)]&&console[_0x53fbe5(0xd3)](a45_0x27246b[_0x53fbe5(0xd7)](_0x53fbe5(0xcc)+_0x44b05a[_0x53fbe5(0xb1)]+_0x53fbe5(0xb9)+_0x5200b4[_0x53fbe5(0xb1)]+').'));const _0x5cdbee=/^\d+$/,_0x25836e=_0x26506d[_0x53fbe5(0xa4)],_0x210311=[..._0x5200b4,_0x244472][_0x53fbe5(0x9f)](_0x43cac9=>!_0x5cdbee[_0x53fbe5(0xcf)](_0x43cac9));if(_0x210311&&!_0x25836e)return console[_0x53fbe5(0xd3)](a45_0x27246b['red'](_0x53fbe5(0xa3))),console[_0x53fbe5(0xd3)](_0x53fbe5(0x9b)),console['error'](_0x53fbe5(0xc1)),console[_0x53fbe5(0xd3)](_0x53fbe5(0xa2)),0x1;const _0x4f4ab6=_0x5200b4[_0x53fbe5(0xb1)],_0x281681=_0x26506d[_0x53fbe5(0xe2)]===!![];let _0x3984c2;try{const _0x38e86d=await withSpinner((_0x281681?'Checking':_0x53fbe5(0xd9))+'\x20'+_0x4f4ab6+_0x53fbe5(0xbe)+(_0x4f4ab6===0x1?'':'s')+'\x20'+((_0x281681?'for\x20move\x20to':'to')+_0x53fbe5(0x95)+_0x244472+_0x53fbe5(0xca)),async()=>{const _0x3d3589=_0x53fbe5,_0x34c029=[];_0x5200b4[_0x3d3589(0xdf)]((_0x52835e,_0x38e78a)=>{const _0x5c8fe3=_0x3d3589;if(!_0x5cdbee['test'](_0x52835e))_0x34c029[_0x5c8fe3(0xbb)]({'name':_0x52835e,'expectType':_0x5c8fe3(0xac),'slot':_0x38e78a});});if(!_0x5cdbee[_0x3d3589(0xcf)](_0x244472))_0x34c029['push']({'name':_0x244472,'expectType':_0x3d3589(0xa5),'slot':-0x1});const _0x29b3f9=new Map();if(_0x34c029[_0x3d3589(0xb1)]>0x0){const _0x2322ca=await _0x100fed[_0x3d3589(0xac)][_0x3d3589(0xd1)](_0x25836e,_0x34c029[_0x3d3589(0xab)](({name:_0x5755f9,expectType:_0x268707})=>({'name':_0x5755f9,'expectType':_0x268707})));_0x2322ca[_0x3d3589(0xdf)]((_0x32ee93,_0x13535c)=>_0x29b3f9[_0x3d3589(0xc5)](_0x34c029[_0x13535c][_0x3d3589(0x9a)],_0x32ee93['id']));}const _0x20b0da=_0x5200b4[_0x3d3589(0xab)]((_0x179f57,_0xeed0ec)=>_0x5cdbee['test'](_0x179f57)?_0x179f57:_0x29b3f9['get'](_0xeed0ec)),_0x1cd461=_0x5cdbee[_0x3d3589(0xcf)](_0x244472)?_0x244472:_0x29b3f9[_0x3d3589(0xc8)](-0x1);return _0x100fed[_0x3d3589(0xac)][_0x3d3589(0xa7)](_0x20b0da,_0x1cd461,_0x281681);},{'verbose':_0x26506d['verbose']});_0x3984c2=_0x38e86d[_0x53fbe5(0xb6)];}catch(_0xd84471){if(_0xd84471 instanceof SDKError&&_0xd84471[_0x53fbe5(0xd6)]===ErrorCode[_0x53fbe5(0xb3)]&&_0x25836e)try{if(await this[_0x53fbe5(0x9e)](_0x100fed,_0x25836e,_0x5200b4,_0x26506d))return 0x1;}catch{}throw _0xd84471;}for(const _0x1a56e3 of _0x3984c2){const _0x32f4a9=_0x1a56e3[_0x53fbe5(0xe0)],_0xf597d1='rule\x20'+(_0x281681?_0x53fbe5(0xda):'preserved:')+'\x20'+_0x32f4a9+'\x20condition'+(_0x32f4a9===0x1?'':'s');console[_0x53fbe5(0xd3)](_0x281681?a45_0x27246b[_0x53fbe5(0xce)](_0x53fbe5(0xbc)+_0x1a56e3['id']+_0x53fbe5(0xa9)+_0x1a56e3[_0x53fbe5(0xc7)]+_0x53fbe5(0xbf)+_0xf597d1):a45_0x27246b[_0x53fbe5(0xae)](_0x53fbe5(0xb2)+_0x1a56e3['id']+_0x53fbe5(0xa9)+_0x1a56e3[_0x53fbe5(0xc7)]+_0x53fbe5(0xbf)+_0xf597d1+'\x20(verified\x20by\x20re-read)'));}if(_0x281681)console[_0x53fbe5(0xd3)](a45_0x27246b['cyan']('[dry-run]\x20No\x20changes\x20made.\x20'+_0x4f4ab6+'\x20segment(s)\x20would\x20be\x20moved.'));else _0x3984c2[_0x53fbe5(0xb1)]>0x1&&console['error'](a45_0x27246b[_0x53fbe5(0xae)]('✔\x20'+_0x3984c2[_0x53fbe5(0xb1)]+_0x53fbe5(0xcb)));return await handleSDKOutput(_0x3984c2,_0x26506d),0x0;}async[a45_0x137b53(0x9e)](_0x5d2667,_0x534901,_0x3e9867,_0x960bc8){const _0xb6c5ed=a45_0x137b53,_0x200f28=_0x3e9867[_0xb6c5ed(0x98)](_0x5a643c=>!/^\d+$/[_0xb6c5ed(0xcf)](_0x5a643c)&&!_0x5a643c[_0xb6c5ed(0xc6)]('/'));if(_0x200f28[_0xb6c5ed(0xb1)]===0x0)return![];const _0x53c13c=await withSpinner(_0xb6c5ed(0xa0)+_0x200f28[_0xb6c5ed(0xd8)]('\x27,\x20\x27')+_0xb6c5ed(0xca),()=>_0x5d2667[_0xb6c5ed(0xac)][_0xb6c5ed(0x9c)](_0x534901),{'verbose':_0x960bc8[_0xb6c5ed(0xdd)]}),_0xb4345e=(await withSpinner(_0xb6c5ed(0xb4),()=>_0x5d2667[_0xb6c5ed(0xac)][_0xb6c5ed(0xbd)](_0x53c13c['data'][_0xb6c5ed(0xb7)],_0x53c13c['data'][_0xb6c5ed(0xb8)],0x0,0xa),{'verbose':_0x960bc8[_0xb6c5ed(0xdd)]}))[_0xb6c5ed(0xb6)];let _0x1dd759=![];for(const _0x4f834a of _0x200f28){const _0x5b1a5a=searchTreeByName(_0xb4345e,_0x4f834a)['filter'](_0x27d906=>_0x27d906[_0xb6c5ed(0xba)]===_0xb6c5ed(0xac)&&_0x27d906['name']['toLowerCase']()===_0x4f834a[_0xb6c5ed(0xdb)]());if(_0x5b1a5a['length']>0x1){_0x1dd759=!![],console[_0xb6c5ed(0xd3)](a45_0x27246b[_0xb6c5ed(0xa1)](_0xb6c5ed(0xc3)+_0x4f834a+'\x27\x20matches\x20'+_0x5b1a5a[_0xb6c5ed(0xb1)]+_0xb6c5ed(0xc0)));for(const _0x3eb81b of _0x5b1a5a)console[_0xb6c5ed(0xd3)](_0xb6c5ed(0x96)+_0x3eb81b[_0xb6c5ed(0xc4)]+_0xb6c5ed(0xaf)+_0x3eb81b['id']+')');}else _0x5b1a5a[_0xb6c5ed(0xb1)]===0x1&&(_0x1dd759=!![],console[_0xb6c5ed(0xd3)](a45_0x27246b['red'](_0xb6c5ed(0xc3)+_0x4f834a+_0xb6c5ed(0xe3))),console['error']('\x20\x20'+_0x5b1a5a[0x0][_0xb6c5ed(0xc4)]+_0xb6c5ed(0xaf)+_0x5b1a5a[0x0]['id']+')'),console[_0xb6c5ed(0xd3)](_0xb6c5ed(0xd0)));}return _0x1dd759;}}
@@ -1 +1 @@
1
- function a45_0x29d8(){const _0x315d95=['filter','verbose','✔\x20Pulled\x20','\x20segments','journeyVersions','6869046PJgEku','\x0aPull\x20summary\x20for\x20\x27','repeat','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','yes','isNew','yellow','✔\x20All\x20files\x20are\x20up\x20to\x20date','counts','\x20journeys','7ixCLEJ','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','execute','\x20=\x20','type','579681xqtgeh','3094440zhRSqD','session','setPhase','helpText','activations','-\x20no\x20files\x20written','\x20\x20Target:\x20','460ZAKHrG','parent_segment','parentSegment','25595htndSE','content','green','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)','targetDir','489918MPZvDM','segment:pull','Write\x20','cwd','relativePath','Parent\x20segment:\x20','Site:\x20','Pulling\x20segments\x20from\x20\x27','\x20files?','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Aborted.','Error:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journeys','\x20versions)','pullSegments','segment','error','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x0aError:','dirname','\x20files\x20to\x20','2877136GphXyJ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segments','data','✔\x20Context\x20set:\x20','1138943SlqMwt','\x20activations','dim','\x20unchanged\x20files','\x27...','parentName','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','no_parent','cyan','utf-8','\x20new\x20files','resourceName','Target\x20resource:\x20','site','files','description','length','red','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','hasChanges'];a45_0x29d8=function(){return _0x315d95;};return a45_0x29d8();}const a45_0x87d82e=a45_0x4e7d;(function(_0x78c051,_0xe5164f){const _0x2cb992=a45_0x4e7d,_0x5b5142=_0x78c051();while(!![]){try{const _0x559851=parseInt(_0x2cb992(0xad))/0x1+parseInt(_0x2cb992(0xe6))/0x2+-parseInt(_0x2cb992(0xd7))/0x3+-parseInt(_0x2cb992(0xde))/0x4*(parseInt(_0x2cb992(0xe1))/0x5)+parseInt(_0x2cb992(0xc6))/0x6+parseInt(_0x2cb992(0xd0))/0x7*(-parseInt(_0x2cb992(0xa8))/0x8)+parseInt(_0x2cb992(0xd6))/0x9;if(_0x559851===_0xe5164f)break;else _0x5b5142['push'](_0x5b5142['shift']());}catch(_0x4db527){_0x5b5142['push'](_0x5b5142['shift']());}}}(a45_0x29d8,0x95be1));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 a45_0x3d20a2 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a45_0x274e14 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a45_0x4e7d(_0x1ddf6b,_0x5ad0c3){_0x1ddf6b=_0x1ddf6b-0xa3;const _0x29d8a4=a45_0x29d8();let _0x4e7d45=_0x29d8a4[_0x1ddf6b];return _0x4e7d45;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a45_0x87d82e(0xe7);[a45_0x87d82e(0xbc)]=a45_0x87d82e(0xef);async[a45_0x87d82e(0xd3)](_0x3e5a7f){const _0x1e2afe=a45_0x87d82e,{options:_0x8c53fe,args:_0x1e71ad,tdx:_0x366a37}=_0x3e5a7f,_0x43deba=_0x8c53fe,_0x1229e7=await resolveTarget({'arg':_0x1e71ad[0x0],'contextParent':_0x8c53fe[_0x1e2afe(0xe0)],'cwd':process[_0x1e2afe(0xe9)]()});if(!isSuccessfulResolution(_0x1229e7))return _0x1229e7['errorCode']===_0x1e2afe(0xb4)?(console['error'](a45_0x3d20a2[_0x1e2afe(0xcc)](_0x1e2afe(0xb3))),console[_0x1e2afe(0xa3)](_0x1e2afe(0xe4)),console[_0x1e2afe(0xa3)](_0x1e2afe(0xd2)),console['error'](_0x1e2afe(0xa9))):(console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xbe)](_0x1e2afe(0xf1)+_0x1229e7[_0x1e2afe(0xd1)]+'\x0a')),_0x1229e7[_0x1e2afe(0xda)]&&console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xb5)](_0x1229e7[_0x1e2afe(0xda)]))),0x1;const _0x2f86eb=_0x1229e7[_0x1e2afe(0xb2)],_0x51a357=_0x1229e7[_0x1e2afe(0xe5)],_0x1be603=_0x1229e7[_0x1e2afe(0xd5)]==='file'?_0x1229e7[_0x1e2afe(0xb8)]:undefined;_0x43deba[_0x1e2afe(0xc2)]&&(console[_0x1e2afe(0xa3)](_0x1e2afe(0xec)+_0x43deba[_0x1e2afe(0xba)]),console['error'](_0x1e2afe(0xeb)+_0x2f86eb),_0x1be603&&console[_0x1e2afe(0xa3)](_0x1e2afe(0xb9)+_0x1be603));const _0x28d45e=await withProgressSpinner(_0x1e2afe(0xed)+_0x2f86eb+_0x1e2afe(0xb1),_0x21b057=>_0x366a37[_0x1e2afe(0xf6)][_0x1e2afe(0xf5)](_0x2f86eb,{'targetDir':_0x51a357,'targetResourceName':_0x1be603,'verbose':_0x43deba['verbose'],'progress':{'update':_0x54a110=>{const _0x5b0653=_0x1e2afe;_0x21b057[_0x5b0653(0xd9)](_0x54a110),_0x43deba[_0x5b0653(0xc2)]&&console[_0x5b0653(0xa3)]('\x20\x20'+_0x54a110);}}}),{'verbose':_0x43deba[_0x1e2afe(0xc2)]}),_0x3906bb=_0x28d45e[_0x1e2afe(0xab)];if(_0x3906bb[_0x1e2afe(0xce)][_0x1e2afe(0xaa)]===0x0&&_0x3906bb[_0x1e2afe(0xce)][_0x1e2afe(0xf3)]===0x0)return console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xcc)](_0x1e2afe(0xa4)+_0x3906bb[_0x1e2afe(0xb2)]+'\x27')),0x0;const _0x450e43=_0x3906bb[_0x1e2afe(0xbb)][_0x1e2afe(0xc1)](_0xaf1dc6=>_0xaf1dc6[_0x1e2afe(0xcb)]),_0x3738a9=_0x3906bb[_0x1e2afe(0xbb)][_0x1e2afe(0xc1)](_0x37a3f6=>!_0x37a3f6[_0x1e2afe(0xcb)]&&_0x37a3f6[_0x1e2afe(0xc0)]),_0x3b606f=_0x3906bb[_0x1e2afe(0xbb)]['filter'](_0x41544a=>!_0x41544a[_0x1e2afe(0xcb)]&&!_0x41544a[_0x1e2afe(0xc0)]);console[_0x1e2afe(0xa3)](_0x1e2afe(0xc7)+_0x3906bb[_0x1e2afe(0xb2)]+'\x27:'),console['error']('\x20\x20🎯\x20'+a45_0x3d20a2[_0x1e2afe(0xb5)](_0x3906bb[_0x1e2afe(0xce)][_0x1e2afe(0xaa)]+_0x1e2afe(0xc4))+'\x20with\x20'+a45_0x3d20a2['cyan'](_0x3906bb[_0x1e2afe(0xce)][_0x1e2afe(0xdb)]+_0x1e2afe(0xae)));if(_0x3906bb[_0x1e2afe(0xce)]['journeys']>0x0){const _0x43a58c=_0x3906bb[_0x1e2afe(0xce)]['journeyVersions']>_0x3906bb[_0x1e2afe(0xce)]['journeys']?'\x20('+_0x3906bb['counts'][_0x1e2afe(0xc5)]+_0x1e2afe(0xf4):'';console[_0x1e2afe(0xa3)]('\x20\x20🗺️\x20\x20'+a45_0x3d20a2[_0x1e2afe(0xb5)](_0x3906bb['counts'][_0x1e2afe(0xf3)]+_0x1e2afe(0xcf))+a45_0x3d20a2[_0x1e2afe(0xaf)](_0x43a58c));}console[_0x1e2afe(0xa3)]('\x20\x20'+a45_0x3d20a2[_0x1e2afe(0xe3)]('+\x20'+_0x450e43[_0x1e2afe(0xbd)]+_0x1e2afe(0xb7))),console[_0x1e2afe(0xa3)]('\x20\x20'+a45_0x3d20a2[_0x1e2afe(0xcc)]('~\x20'+_0x3738a9['length']+'\x20changed\x20files')),console['error']('\x20\x20'+a45_0x3d20a2[_0x1e2afe(0xaf)]('=\x20'+_0x3b606f[_0x1e2afe(0xbd)]+_0x1e2afe(0xb0))),console['error'](_0x1e2afe(0xdd)+a45_0x3d20a2['cyan'](_0x3906bb[_0x1e2afe(0xe5)])+'\x0a');if(_0x3738a9[_0x1e2afe(0xbd)]>0x0)for(const _0x2ac6c8 of _0x3738a9){console['error']('\x0aChanges\x20to\x20\x27'+_0x2ac6c8[_0x1e2afe(0xea)]+'\x27:'),console[_0x1e2afe(0xa3)]('─'[_0x1e2afe(0xc8)](0x3c)),console[_0x1e2afe(0xa3)](_0x2ac6c8['diff']),console['error']('─'[_0x1e2afe(0xc8)](0x3c));}if(_0x43deba['dryRun'])return console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xcc)](_0x1e2afe(0xc9))),0x0;if(_0x450e43['length']===0x0&&_0x3738a9[_0x1e2afe(0xbd)]===0x0)return console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xe3)](_0x1e2afe(0xcd))),saveSessionContext({'parent_segment':_0x3906bb[_0x1e2afe(0xb2)]},_0x43deba['session']),console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xe3)]('✔\x20Context\x20set:\x20'+a45_0x3d20a2[_0x1e2afe(0xaf)](_0x1e2afe(0xdf))+_0x1e2afe(0xd4)+a45_0x3d20a2['cyan'](_0x3906bb[_0x1e2afe(0xb2)]))),0x0;if(!_0x43deba[_0x1e2afe(0xca)]){if(!isInteractive())return console[_0x1e2afe(0xa3)](a45_0x3d20a2['red'](_0x1e2afe(0xa5)),_0x1e2afe(0xbf)),console[_0x1e2afe(0xa3)](a45_0x3d20a2['dim'](_0x1e2afe(0xf2))),0x1;const _0x534003=await confirmKey(_0x1e2afe(0xe8)+(_0x450e43[_0x1e2afe(0xbd)]+_0x3738a9[_0x1e2afe(0xbd)])+_0x1e2afe(0xee));if(!_0x534003)return console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xcc)](_0x1e2afe(0xf0)),_0x1e2afe(0xdc)),0x1;}for(const _0x3aa0ac of _0x3906bb[_0x1e2afe(0xbb)]){if(_0x3aa0ac['isNew']||_0x3aa0ac[_0x1e2afe(0xc0)]){const _0x1d6d8a=a45_0x274e14[_0x1e2afe(0xa6)](_0x3aa0ac['absolutePath']);!existsSync(_0x1d6d8a)&&mkdirSync(_0x1d6d8a,{'recursive':!![]}),writeFileSync(_0x3aa0ac['absolutePath'],_0x3aa0ac[_0x1e2afe(0xe2)],_0x1e2afe(0xb6));}}return console[_0x1e2afe(0xa3)](a45_0x3d20a2['green'](_0x1e2afe(0xc3)+(_0x450e43[_0x1e2afe(0xbd)]+_0x3738a9[_0x1e2afe(0xbd)])+_0x1e2afe(0xa7)+_0x3906bb[_0x1e2afe(0xe5)])),saveSessionContext({'parent_segment':_0x3906bb['parentName']},_0x43deba[_0x1e2afe(0xd8)]),console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xe3)](_0x1e2afe(0xac)+a45_0x3d20a2['dim'](_0x1e2afe(0xdf))+'\x20=\x20'+a45_0x3d20a2['cyan'](_0x3906bb['parentName']))),0x0;}}
1
+ const a46_0x395430=a46_0x56d4;function a46_0x56d4(_0x2747ee,_0x5eec81){_0x2747ee=_0x2747ee-0xd8;const _0x153d98=a46_0x153d();let _0x56d473=_0x153d98[_0x2747ee];return _0x56d473;}(function(_0x15480c,_0x16ed13){const _0x4241f4=a46_0x56d4,_0x42c03e=_0x15480c();while(!![]){try{const _0x248c36=-parseInt(_0x4241f4(0x11d))/0x1*(parseInt(_0x4241f4(0xf3))/0x2)+-parseInt(_0x4241f4(0x123))/0x3+-parseInt(_0x4241f4(0xe8))/0x4*(parseInt(_0x4241f4(0xed))/0x5)+-parseInt(_0x4241f4(0x126))/0x6+parseInt(_0x4241f4(0xf5))/0x7+parseInt(_0x4241f4(0x128))/0x8*(parseInt(_0x4241f4(0x11e))/0x9)+parseInt(_0x4241f4(0xe1))/0xa;if(_0x248c36===_0x16ed13)break;else _0x42c03e['push'](_0x42c03e['shift']());}catch(_0x53de3a){_0x42c03e['push'](_0x42c03e['shift']());}}}(a46_0x153d,0x9d864));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a46_0x153d(){const _0x3419e1=['yellow','Target\x20resource:\x20','Parent\x20segment:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aPull\x20summary\x20for\x20\x27','Error:\x20','Aborted.','\x20\x20🗺️\x20\x20','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','setPhase','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','description','length','site','-\x20no\x20files\x20written','segment:pull','activations','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)','\x20segments','relativePath','filter','error','verbose','journeys','isNew','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','segments','diff','helpText','843NFfJmk','282114eSmmjk','message','red','Write\x20','hasChanges','3570216khdVac','\x20new\x20files','parent_segment','5822904eISkPi','counts','112KncdTU','yes','dim','\x20files\x20to\x20','absolutePath','\x20files?','pullSegments','repeat','cwd','content','44363160bwcADw','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20activations','errorCode','\x20=\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','5564aZJAPF','\x20unchanged\x20files','Site:\x20','cyan','targetDir','4555wvsbuA','session','no_parent','utf-8','name','parentName','2922Wtlwls','✔\x20All\x20files\x20are\x20up\x20to\x20date','3006080ONKxrc','files','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pulling\x20segments\x20from\x20\x27','file','parentSegment','resourceName','✔\x20Pulled\x20','✔\x20Context\x20set:\x20'];a46_0x153d=function(){return _0x3419e1;};return a46_0x153d();}import a46_0x1d938c from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a46_0x1a6a59 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{[a46_0x395430(0xf1)]=a46_0x395430(0x10f);[a46_0x395430(0x10b)]=a46_0x395430(0x10a);async['execute'](_0x699754){const _0x5edc19=a46_0x395430,{options:_0x54586f,args:_0x47f709,tdx:_0x21a6f1}=_0x699754,_0x5db9a3=_0x54586f,_0x237f0d=await resolveTarget({'arg':_0x47f709[0x0],'contextParent':_0x54586f[_0x5edc19(0xfa)],'cwd':process[_0x5edc19(0xdf)]()});if(!isSuccessfulResolution(_0x237f0d))return _0x237f0d[_0x5edc19(0xe5)]===_0x5edc19(0xef)?(console[_0x5edc19(0x115)](a46_0x1d938c['yellow'](_0x5edc19(0x107))),console[_0x5edc19(0x115)](_0x5edc19(0x111)),console[_0x5edc19(0x115)](_0x5edc19(0xe3)),console[_0x5edc19(0x115)](_0x5edc19(0x108))):(console[_0x5edc19(0x115)](a46_0x1d938c[_0x5edc19(0x120)](_0x5edc19(0x103)+_0x237f0d[_0x5edc19(0x11f)]+'\x0a')),_0x237f0d[_0x5edc19(0x11c)]&&console[_0x5edc19(0x115)](a46_0x1d938c[_0x5edc19(0xeb)](_0x237f0d[_0x5edc19(0x11c)]))),0x1;const _0x2b227d=_0x237f0d[_0x5edc19(0xf2)],_0x222926=_0x237f0d[_0x5edc19(0xec)],_0x2b8e97=_0x237f0d[_0x5edc19(0xe2)]===_0x5edc19(0xf9)?_0x237f0d[_0x5edc19(0xfb)]:undefined;_0x5db9a3[_0x5edc19(0x116)]&&(console['error'](_0x5edc19(0xea)+_0x5db9a3[_0x5edc19(0x10d)]),console[_0x5edc19(0x115)](_0x5edc19(0x100)+_0x2b227d),_0x2b8e97&&console['error'](_0x5edc19(0xff)+_0x2b8e97));const _0x29cd3e=await withProgressSpinner(_0x5edc19(0xf8)+_0x2b227d+'\x27...',_0x140bd0=>_0x21a6f1['segment'][_0x5edc19(0xdd)](_0x2b227d,{'targetDir':_0x222926,'targetResourceName':_0x2b8e97,'verbose':_0x5db9a3['verbose'],'progress':{'update':_0x23d8b2=>{const _0x1b4434=_0x5edc19;_0x140bd0[_0x1b4434(0x109)](_0x23d8b2),_0x5db9a3[_0x1b4434(0x116)]&&console[_0x1b4434(0x115)]('\x20\x20'+_0x23d8b2);}}}),{'verbose':_0x5db9a3[_0x5edc19(0x116)]}),_0x508f7c=_0x29cd3e['data'];if(_0x508f7c[_0x5edc19(0x127)]['segments']===0x0&&_0x508f7c[_0x5edc19(0x127)]['journeys']===0x0)return console[_0x5edc19(0x115)](a46_0x1d938c[_0x5edc19(0xfe)](_0x5edc19(0x119)+_0x508f7c[_0x5edc19(0xf2)]+'\x27')),0x0;const _0xb1ced3=_0x508f7c[_0x5edc19(0xf6)][_0x5edc19(0x114)](_0x5d0d59=>_0x5d0d59['isNew']),_0x189492=_0x508f7c['files'][_0x5edc19(0x114)](_0x32b241=>!_0x32b241[_0x5edc19(0x118)]&&_0x32b241['hasChanges']),_0x3ce390=_0x508f7c[_0x5edc19(0xf6)]['filter'](_0x536a92=>!_0x536a92['isNew']&&!_0x536a92[_0x5edc19(0x122)]);console[_0x5edc19(0x115)](_0x5edc19(0x102)+_0x508f7c[_0x5edc19(0xf2)]+'\x27:'),console[_0x5edc19(0x115)]('\x20\x20🎯\x20'+a46_0x1d938c[_0x5edc19(0xeb)](_0x508f7c[_0x5edc19(0x127)][_0x5edc19(0x11a)]+_0x5edc19(0x112))+'\x20with\x20'+a46_0x1d938c[_0x5edc19(0xeb)](_0x508f7c[_0x5edc19(0x127)][_0x5edc19(0x110)]+_0x5edc19(0xe4)));if(_0x508f7c[_0x5edc19(0x127)][_0x5edc19(0x117)]>0x0){const _0x3662e5=_0x508f7c[_0x5edc19(0x127)]['journeyVersions']>_0x508f7c['counts'][_0x5edc19(0x117)]?'\x20('+_0x508f7c['counts']['journeyVersions']+'\x20versions)':'';console['error'](_0x5edc19(0x105)+a46_0x1d938c['cyan'](_0x508f7c[_0x5edc19(0x127)][_0x5edc19(0x117)]+'\x20journeys')+a46_0x1d938c[_0x5edc19(0xd9)](_0x3662e5));}console[_0x5edc19(0x115)]('\x20\x20'+a46_0x1d938c[_0x5edc19(0x106)]('+\x20'+_0xb1ced3[_0x5edc19(0x10c)]+_0x5edc19(0x124))),console['error']('\x20\x20'+a46_0x1d938c[_0x5edc19(0xfe)]('~\x20'+_0x189492[_0x5edc19(0x10c)]+'\x20changed\x20files')),console['error']('\x20\x20'+a46_0x1d938c[_0x5edc19(0xd9)]('=\x20'+_0x3ce390[_0x5edc19(0x10c)]+_0x5edc19(0xe9))),console[_0x5edc19(0x115)]('\x20\x20Target:\x20'+a46_0x1d938c[_0x5edc19(0xeb)](_0x508f7c[_0x5edc19(0xec)])+'\x0a');if(_0x189492[_0x5edc19(0x10c)]>0x0)for(const _0x59b8b6 of _0x189492){console[_0x5edc19(0x115)]('\x0aChanges\x20to\x20\x27'+_0x59b8b6[_0x5edc19(0x113)]+'\x27:'),console[_0x5edc19(0x115)]('─'[_0x5edc19(0xde)](0x3c)),console[_0x5edc19(0x115)](_0x59b8b6[_0x5edc19(0x11b)]),console[_0x5edc19(0x115)]('─'[_0x5edc19(0xde)](0x3c));}if(_0x5db9a3['dryRun'])return console['error'](a46_0x1d938c[_0x5edc19(0xfe)](_0x5edc19(0x101))),0x0;if(_0xb1ced3[_0x5edc19(0x10c)]===0x0&&_0x189492[_0x5edc19(0x10c)]===0x0)return console[_0x5edc19(0x115)](a46_0x1d938c[_0x5edc19(0x106)](_0x5edc19(0xf4))),saveSessionContext({'parent_segment':_0x508f7c[_0x5edc19(0xf2)]},_0x5db9a3['session']),console[_0x5edc19(0x115)](a46_0x1d938c['green'](_0x5edc19(0xfd)+a46_0x1d938c[_0x5edc19(0xd9)](_0x5edc19(0x125))+_0x5edc19(0xe6)+a46_0x1d938c[_0x5edc19(0xeb)](_0x508f7c[_0x5edc19(0xf2)]))),0x0;if(!_0x5db9a3[_0x5edc19(0xd8)]){if(!isInteractive())return console[_0x5edc19(0x115)](a46_0x1d938c[_0x5edc19(0x120)]('\x0aError:'),_0x5edc19(0xf7)),console[_0x5edc19(0x115)](a46_0x1d938c['dim'](_0x5edc19(0xe7))),0x1;const _0x7af07e=await confirmKey(_0x5edc19(0x121)+(_0xb1ced3['length']+_0x189492[_0x5edc19(0x10c)])+_0x5edc19(0xdc));if(!_0x7af07e)return console['error'](a46_0x1d938c[_0x5edc19(0xfe)](_0x5edc19(0x104)),_0x5edc19(0x10e)),0x1;}for(const _0xd23008 of _0x508f7c['files']){if(_0xd23008[_0x5edc19(0x118)]||_0xd23008['hasChanges']){const _0xd4b856=a46_0x1a6a59['dirname'](_0xd23008['absolutePath']);!existsSync(_0xd4b856)&&mkdirSync(_0xd4b856,{'recursive':!![]}),writeFileSync(_0xd23008[_0x5edc19(0xdb)],_0xd23008[_0x5edc19(0xe0)],_0x5edc19(0xf0));}}return console['error'](a46_0x1d938c[_0x5edc19(0x106)](_0x5edc19(0xfc)+(_0xb1ced3[_0x5edc19(0x10c)]+_0x189492[_0x5edc19(0x10c)])+_0x5edc19(0xda)+_0x508f7c[_0x5edc19(0xec)])),saveSessionContext({'parent_segment':_0x508f7c[_0x5edc19(0xf2)]},_0x5db9a3[_0x5edc19(0xee)]),console[_0x5edc19(0x115)](a46_0x1d938c['green']('✔\x20Context\x20set:\x20'+a46_0x1d938c['dim']('parent_segment')+_0x5edc19(0xe6)+a46_0x1d938c['cyan'](_0x508f7c['parentName']))),0x0;}}
@@ -1 +1 @@
1
- function a46_0x29e8(){const _0x23e207=['\x20deleted','/e/','\x0aPush\x20summary\x20for\x20\x27','endsWith','2131003IzRFQF','\x0aValidation\x20failed:','isScoped','9qZGcNM','\x20\x20Journeys:\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20to\x20update','data','126358alBZLA','/app/ps/','toUpdate','repeat','set','journey','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','(Journey\x20will\x20be\x20deleted)','2645zxoVBL','paused','\x20\x20Activations:','Push\x20','created','segments','📁\x20','length','\x20\x20🗺️\x20\x20Journeys:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','updatedAt','\x20\x20📊\x20Segments:','listActivations','parent_name','getParent','\x20YAML\x20files\x20found','Parent\x20segment:\x20','then','delete','.yml','\x20changes?','Delete\x20journey:','isNew','map','journeyBundleName','\x20\x20\x20\x20','\x20folders\x20to\x20create','2617948AQlUpY','3083475wVEEag','message','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','helpText','Source\x20directory:\x20','toString','\x20new','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x0a✔\x20Push\x20complete','Resolving\x20parent\x20segment\x20\x27','blue','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','New\x20segment:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','getJourney','toDelete','Error\x20parsing\x20YAML:\x20','attributes','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','/sb/da/esr','journeysOnly','filter','\x20to\x20create','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','filePath','journeyId','activations','Site:\x20','get','connection','Error:\x20','dim','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)','targetDir','4596jYWrLC','/j/da/je','19851980tfRnQm','buildUserMaps','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','type','\x20updated','diff','\x0aError:','Changes\x20to:','audienceId','execute','parentSegment','\x20to\x20delete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','createdSegmentIds','createdAt','cwd','changed','updated','verbose','journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20unchanged','cyan','Error:\x20Directory\x20not\x20found:\x20','new','existingJourney','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','segment','nameToId','\x20activations]','folderId','journeyBundleId','yamlConfig','\x20\x20Segments:\x20','push','all','error','description','folderPath','\x20\x20Source:\x20','\x20changed','segment\x20or\x20journey','\x27...','add','8bzhdRE','No\x20','errorCode','name','deleted','listFolders','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','site','Preparing\x20journeys...','\x20created','Fetching\x20connections\x20for\x20name\x20resolution...','idToName','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Activations:\x20','file','4214624eunFUC','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','folders','user','Delete\x20segment:','unchanged','toCreate','yellow','state','nameToType','join','existingSegment','listSegments','segment:push'];a46_0x29e8=function(){return _0x23e207;};return a46_0x29e8();}const a46_0x14b204=a46_0x4550;(function(_0x1ec031,_0x44ae34){const _0xa615e=a46_0x4550,_0x591a5f=_0x1ec031();while(!![]){try{const _0x3243e4=parseInt(_0xa615e(0x142))/0x1*(-parseInt(_0xa615e(0x1b8))/0x2)+-parseInt(_0xa615e(0x167))/0x3+parseInt(_0xa615e(0x166))/0x4+parseInt(_0xa615e(0x14b))/0x5*(parseInt(_0xa615e(0x189))/0x6)+-parseInt(_0xa615e(0x13a))/0x7+parseInt(_0xa615e(0x128))/0x8*(-parseInt(_0xa615e(0x13d))/0x9)+parseInt(_0xa615e(0x18b))/0xa;if(_0x3243e4===_0x44ae34)break;else _0x591a5f['push'](_0x591a5f['shift']());}catch(_0x1431f3){_0x591a5f['push'](_0x591a5f['shift']());}}}(a46_0x29e8,0xa61c1));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 a46_0x1ac0c9 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 a46_0x4550(_0x197296,_0x40f9e6){_0x197296=_0x197296-0x11f;const _0x29e8e5=a46_0x29e8();let _0x455026=_0x29e8e5[_0x197296];return _0x455026;}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{[a46_0x14b204(0x1bb)]=a46_0x14b204(0x135);[a46_0x14b204(0x1b1)]='Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments';async[a46_0x14b204(0x195)](_0x22f8a){const _0x5a3fb2=a46_0x14b204,{options:_0x5dd04c,args:_0x423322,tdx:_0x41e6f5}=_0x22f8a,_0x362331=_0x5dd04c,_0x4a1dc6=await resolveTarget({'arg':_0x423322[0x0],'contextParent':_0x5dd04c[_0x5a3fb2(0x196)],'cwd':process[_0x5a3fb2(0x19b)]()});if(!isSuccessfulResolution(_0x4a1dc6))return _0x4a1dc6[_0x5a3fb2(0x1ba)]==='no_parent'?(console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x12f)](_0x5a3fb2(0x18e))),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x187)),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x1a0)),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x154))):(console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x185)+_0x4a1dc6[_0x5a3fb2(0x168)]+'\x0a')),_0x4a1dc6['helpText']&&console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x4a1dc6[_0x5a3fb2(0x16a)]))),0x1;if(_0x4a1dc6['type']===_0x5a3fb2(0x158))return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x1a3)+_0x4a1dc6[_0x5a3fb2(0x188)]+'\x0a')),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9['cyan'](_0x5a3fb2(0x11f))),0x1;const _0x2f94b0=_0x4a1dc6['parentName'],_0x340a60=_0x4a1dc6[_0x5a3fb2(0x188)],_0xabea65=_0x4a1dc6[_0x5a3fb2(0x18f)]===_0x5a3fb2(0x127)?_0x4a1dc6[_0x5a3fb2(0x17f)]:undefined,_0x4081eb=getScopedDetails(_0x4a1dc6),_0x5a7abe=_0x4081eb?.[_0x5a3fb2(0x13c)]??![],_0x3e1f63=_0x4081eb?.['scopedFolderPath']??'';if(!existsSync(_0x340a60))return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x1a3)+_0x340a60+'\x0a')),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x5a3fb2(0x11f))),0x1;_0x362331[_0x5a3fb2(0x19e)]&&(console['error'](_0x5a3fb2(0x182)+_0x362331[_0x5a3fb2(0x120)]),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x15b)+_0x2f94b0),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x16b)+_0x340a60),_0x5a7abe&&console[_0x5a3fb2(0x1b0)]('Scoped\x20to\x20folder:\x20'+_0x3e1f63));const _0x2c3de7=await withSpinner(_0x5a3fb2(0x170)+_0x2f94b0+_0x5a3fb2(0x1b6),()=>_0x41e6f5[_0x5a3fb2(0x1a7)]['resolveParentId'](_0x2f94b0),{'verbose':_0x362331[_0x5a3fb2(0x19e)]}),_0xeb7332=_0x2c3de7[_0x5a3fb2(0x141)],{parentSegmentResult:_0x1cd77c,segmentsResult:_0x4ba467,foldersResult:_0x1f61f0,journeysWithDetailsResult:_0x560516,userMaps:_0x50df22}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x5b2f74=_0x5a3fb2,[_0x278f81,_0x3cfd81,_0x5672b7,_0x2533ab,_0x1a37d0]=await Promise[_0x5b2f74(0x1af)]([_0x41e6f5[_0x5b2f74(0x1a7)][_0x5b2f74(0x159)](_0xeb7332),_0x41e6f5[_0x5b2f74(0x1a7)][_0x5b2f74(0x134)](_0xeb7332),_0x41e6f5['segment'][_0x5b2f74(0x1bd)](_0xeb7332),_0x41e6f5[_0x5b2f74(0x147)]['listJourneysWithDetailsFromParentSegment'](_0xeb7332,{'includeAllVersions':!![]}),_0x41e6f5[_0x5b2f74(0x12b)][_0x5b2f74(0x18c)]()]);return{'parentSegmentResult':_0x278f81,'segmentsResult':_0x3cfd81,'foldersResult':_0x5672b7,'journeysWithDetailsResult':_0x2533ab,'userMaps':_0x1a37d0};},{'verbose':_0x362331[_0x5a3fb2(0x19e)]})[_0x5a3fb2(0x15c)](_0x19e983=>_0x19e983[_0x5a3fb2(0x141)]),_0x435f1f=_0x1cd77c,_0x1a3478=extractRootFolderId(_0x435f1f),_0x22542a=_0x4ba467,_0x5c37d7=_0x1f61f0,{journeys:_0x3863dd,activationStepsById:_0x154e05}=_0x560516,_0x3f74fc=new Map(_0x3863dd['map'](_0x321b3c=>[_0x321b3c['id'],_0x321b3c])),_0x220c8a=_0x3863dd[_0x5a3fb2(0x162)](_0x1d7716=>({'id':_0x1d7716['id'],'name':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x1bb)],'journeyBundleName':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x163)]||'','journeyBundleId':_0x1d7716['attributes'][_0x5a3fb2(0x1ab)]||'','versionNumber':_0x1d7716[_0x5a3fb2(0x178)]['versionNumber'],'description':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x1b1)],'state':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x130)],'paused':_0x1d7716['attributes'][_0x5a3fb2(0x14c)],'audienceId':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x194)],'folderId':_0x1d7716['relationships']?.['parentFolder']?.[_0x5a3fb2(0x141)]?.['id'],'createdAt':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x19a)],'updatedAt':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x155)]})),{emailToId:_0x49998c,idToEmail:_0xce539d}=_0x50df22,_0x4b8126=await withSpinner(_0x5a3fb2(0x123),async()=>{const _0x2f768b=_0x5a3fb2,_0x4b97a1=await _0x41e6f5[_0x2f768b(0x184)]['list']();return buildConnectionMaps(_0x4b97a1);},{'verbose':_0x362331[_0x5a3fb2(0x19e)]})[_0x5a3fb2(0x15c)](_0x51c7aa=>_0x51c7aa[_0x5a3fb2(0x141)]),_0x139638=_0x4b8126[_0x5a3fb2(0x1a8)],_0x45f2f3=_0x4b8126[_0x5a3fb2(0x124)],_0x590122=_0x4b8126[_0x5a3fb2(0x131)],_0x487595={'emailToIdMap':_0x49998c,'connectionNameToIdMap':_0x139638,'connectionNameToTypeMap':_0x590122,'getSchema':_0x5a14e0=>_0x41e6f5[_0x5a3fb2(0x184)]['getOutputSchemaWithCache'](_0x5a14e0),'getMetadata':_0x3b02ea=>_0x41e6f5[_0x5a3fb2(0x184)]['getMetadataWithCache'](_0x3b02ea)};let {pathToId:_0x7bf0e8,idToPath:_0x1e89e3}=buildFolderMaps(_0x5c37d7);const _0x18e3fb=buildSegmentLookupMap(_0x22542a,_0x1e89e3),_0x58e3b8=buildSegmentNameToIdMap(_0x22542a),_0x18ff6e=buildJourneyBundleLookupMap(_0x220c8a,_0x1e89e3);let _0x5d0c8b;if(_0xabea65){if(!_0xabea65[_0x5a3fb2(0x139)](_0x5a3fb2(0x15e))&&!_0xabea65[_0x5a3fb2(0x139)]('.yaml'))return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x198)+_0xabea65+'\x0a')),0x1;_0x5d0c8b=[_0xabea65];}else _0x5d0c8b=findYamlFiles(_0x340a60);if(_0x5d0c8b[_0x5a3fb2(0x152)]===0x0)return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x148)+_0x340a60+'\x0a')),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x5a3fb2(0x16e))),0x1;let _0xc42d49,_0x176059;try{const _0x44debb=parseAndClassifyYamlFiles(_0x5d0c8b,_0x340a60,{'skipSegments':_0x362331[_0x5a3fb2(0x17b)]});_0xc42d49=_0x44debb['segments'],_0x176059=_0x44debb[_0x5a3fb2(0x19f)];const _0x25145b=validateParsedFiles(_0x44debb,_0x340a60);if(_0x25145b[_0x5a3fb2(0x152)]>0x0)return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x13b))),console[_0x5a3fb2(0x1b0)](formatValidationErrors(_0x25145b)),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x12f)](_0x5a3fb2(0x172))),0x1;}catch(_0xc592bc){return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x177)+(_0xc592bc instanceof Error?_0xc592bc[_0x5a3fb2(0x168)]:_0xc592bc))),0x1;}if(_0xc42d49[_0x5a3fb2(0x152)]===0x0&&_0x176059[_0x5a3fb2(0x152)]===0x0){const _0x39a2cb=_0x362331[_0x5a3fb2(0x17b)]?'journey':_0x5a3fb2(0x1b5);return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9['yellow'](_0x5a3fb2(0x1b9)+_0x39a2cb+_0x5a3fb2(0x15a))),0x0;}const _0x45ac52=new Map();_0x22542a[_0x5a3fb2(0x152)]>0x0&&!_0x362331['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x22542a,async _0x452de8=>{const _0x4750bf=a46_0x4550,_0x8cf56c=await _0x41e6f5[_0x4750bf(0x1a7)][_0x4750bf(0x157)](_0xeb7332,_0x452de8['id']);_0x45ac52[_0x4750bf(0x146)](_0x452de8['id'],_0x8cf56c);});},{'verbose':_0x362331[_0x5a3fb2(0x19e)]});const {segmentFiles:_0x4aa83c,foldersToCreate:_0x1d2ae4}=await prepareSegmentFiles(_0xc42d49,{'segmentByFolderAndName':_0x18e3fb,'activationsBySegmentId':_0x45ac52,'folderPathToId':_0x7bf0e8,'idToEmailMap':_0xce539d,'connectionIdToNameMap':_0x45f2f3},_0x487595,_0x5a7abe,_0x3e1f63),_0x4d3926=_0xabea65?[]:findSegmentsToDelete(_0x22542a,_0xc42d49['map'](({yamlConfig:_0x2314ca,folderPath:_0x143957})=>({'yamlConfig':_0x2314ca,'folderPath':resolveTDFolderPath(_0x143957,_0x5a7abe,_0x3e1f63)})),_0x1e89e3,_0x3e1f63,_0x5a7abe),{journeyFiles:_0x22addb,foldersToCreate:_0x4b2a3e}=await withProgressSpinner(_0x5a3fb2(0x121),async _0x3e1c5b=>prepareJourneyFiles(_0x176059,{'fetchJourney':async _0x452887=>_0x41e6f5[_0x5a3fb2(0x147)][_0x5a3fb2(0x175)](_0x452887[_0x5a3fb2(0x180)]),'journeyBundlesByFolderAndName':_0x18ff6e,'folderPathToId':_0x7bf0e8,'idToEmailMap':_0xce539d,'connectionIdToNameMap':_0x45f2f3,'existingSegments':_0x22542a,'parentId':_0xeb7332,'deps':_0x41e6f5,'progress':{'update':_0x3c053f=>{const _0x1c1ec5=_0x5a3fb2;_0x3e1c5b['setPhase'](_0x3c053f),_0x362331[_0x1c1ec5(0x19e)]&&console[_0x1c1ec5(0x1b0)]('\x20\x20'+_0x3c053f);}},'journeyById':_0x3f74fc,'activationStepsById':_0x154e05},_0x5a7abe,_0x3e1f63),{'verbose':_0x362331[_0x5a3fb2(0x19e)]})[_0x5a3fb2(0x15c)](_0x5d7631=>_0x5d7631[_0x5a3fb2(0x141)]);for(const _0x1d751c of _0x4b2a3e){_0x1d2ae4[_0x5a3fb2(0x1b7)](_0x1d751c);}const _0x5df8da=_0xabea65?[]:findJourneysToDelete(_0x220c8a,_0x176059['map'](({yamlConfig:_0x89154,folderPath:_0x3fadd5})=>({'yamlConfig':_0x89154,'folderPath':resolveTDFolderPath(_0x3fadd5,_0x5a7abe,_0x3e1f63)})),_0x1e89e3,_0x3e1f63,_0x5a7abe),_0x1c8eff=calculatePushStats(_0x4aa83c,_0x22addb,_0x1d2ae4,_0x4d3926,_0x5df8da,!!_0x362331[_0x5a3fb2(0x15d)],!!_0x362331[_0x5a3fb2(0x17b)]),_0x373d8b=_0x1c8eff[_0x5a3fb2(0x150)]['new'],_0x370797=_0x1c8eff[_0x5a3fb2(0x150)][_0x5a3fb2(0x19c)],_0x4edfbb=_0x1c8eff[_0x5a3fb2(0x150)][_0x5a3fb2(0x12d)],_0x3cdb4c=_0x1c8eff[_0x5a3fb2(0x150)][_0x5a3fb2(0x176)],_0x3cef4e=_0x1c8eff[_0x5a3fb2(0x12a)][_0x5a3fb2(0x12e)],_0x313eb4=_0x1c8eff['journeys'][_0x5a3fb2(0x1a4)],_0x11d50c=_0x1c8eff[_0x5a3fb2(0x19f)][_0x5a3fb2(0x19c)],_0x1f64dd=_0x1c8eff[_0x5a3fb2(0x19f)][_0x5a3fb2(0x12d)],_0x521f3a=_0x1c8eff[_0x5a3fb2(0x19f)][_0x5a3fb2(0x176)],_0x208f5a=_0x1c8eff[_0x5a3fb2(0x181)]['all'],_0x763bb5=_0x1c8eff[_0x5a3fb2(0x181)][_0x5a3fb2(0x12e)],_0x17db42=_0x1c8eff[_0x5a3fb2(0x181)][_0x5a3fb2(0x144)],_0xcfc0c5=_0x1c8eff[_0x5a3fb2(0x181)]['toDelete'];console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x138)+_0x2f94b0+'\x27:');_0x3cef4e[_0x5a3fb2(0x152)]>0x0&&console[_0x5a3fb2(0x1b0)]('\x20\x20'+a46_0x1ac0c9[_0x5a3fb2(0x171)](_0x5a3fb2(0x151)+_0x3cef4e['length']+_0x5a3fb2(0x165)));if(!_0x362331['journeysOnly']){console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x156)),console[_0x5a3fb2(0x1b0)]('\x20\x20\x20\x20'+a46_0x1ac0c9['green']('+\x20'+_0x373d8b['length']+_0x5a3fb2(0x16d))),console['error']('\x20\x20\x20\x20'+a46_0x1ac0c9[_0x5a3fb2(0x12f)]('~\x20'+_0x370797[_0x5a3fb2(0x152)]+_0x5a3fb2(0x1b4)));if(_0x3cdb4c['length']>0x0)console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x149)]('-\x20'+_0x3cdb4c[_0x5a3fb2(0x152)]+_0x5a3fb2(0x197)));else _0x4d3926['length']>0x0&&!_0x362331[_0x5a3fb2(0x15d)]&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x186)](_0x4d3926[_0x5a3fb2(0x152)]+_0x5a3fb2(0x125)));console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9['dim']('=\x20'+_0x4edfbb[_0x5a3fb2(0x152)]+'\x20unchanged'));}if(_0x22addb[_0x5a3fb2(0x152)]>0x0||_0x5df8da['length']>0x0){console['error'](_0x5a3fb2(0x153)),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x18d)]('+\x20'+_0x313eb4[_0x5a3fb2(0x152)]+'\x20new')),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x12f)]('~\x20'+_0x11d50c[_0x5a3fb2(0x152)]+_0x5a3fb2(0x1b4)));if(_0x521f3a[_0x5a3fb2(0x152)]>0x0)console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x149)]('-\x20'+_0x521f3a[_0x5a3fb2(0x152)]+_0x5a3fb2(0x197)));else _0x5df8da[_0x5a3fb2(0x152)]>0x0&&!_0x362331[_0x5a3fb2(0x15d)]&&console['error'](_0x5a3fb2(0x164)+a46_0x1ac0c9['dim'](_0x5df8da[_0x5a3fb2(0x152)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9['dim']('=\x20'+_0x1f64dd[_0x5a3fb2(0x152)]+_0x5a3fb2(0x1a1)));}_0x208f5a[_0x5a3fb2(0x152)]>0x0&&!_0x362331[_0x5a3fb2(0x17b)]&&(console['error'](''),console['error'](_0x5a3fb2(0x14d)),_0x763bb5[_0x5a3fb2(0x152)]>0x0&&console['error'](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x18d)]('+\x20'+_0x763bb5['length']+_0x5a3fb2(0x17d))),_0x17db42[_0x5a3fb2(0x152)]>0x0&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9['yellow']('~\x20'+_0x17db42[_0x5a3fb2(0x152)]+_0x5a3fb2(0x140))),_0xcfc0c5[_0x5a3fb2(0x152)]>0x0&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x149)]('-\x20'+_0xcfc0c5[_0x5a3fb2(0x152)]+_0x5a3fb2(0x197))));console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x1b3)+a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x340a60)+'\x0a');if(_0x3cef4e[_0x5a3fb2(0x152)]>0x0){console[_0x5a3fb2(0x1b0)]('Folders\x20to\x20create:');for(const _0x6591f8 of _0x3cef4e){console[_0x5a3fb2(0x1b0)]('\x20\x20'+a46_0x1ac0c9[_0x5a3fb2(0x171)]('+')+'\x20'+_0x6591f8);}console[_0x5a3fb2(0x1b0)]('');}if(_0x373d8b['length']>0x0&&!_0x362331[_0x5a3fb2(0x17b)])for(const _0x5a029c of _0x373d8b){const _0x32081a=_0x5a029c[_0x5a3fb2(0x1b2)]?_0x5a029c[_0x5a3fb2(0x1b2)]+'/'+_0x5a029c[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)]:_0x5a029c[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)],_0xdf0ac3=_0x5a029c[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x181)]?.['length']||0x0,_0x51a726=_0xdf0ac3>0x0?a46_0x1ac0c9[_0x5a3fb2(0x186)]('\x20['+_0xdf0ac3+_0x5a3fb2(0x1a9)):'';console[_0x5a3fb2(0x1b0)]('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x18d)](_0x5a3fb2(0x173))+'\x20'+_0x32081a+_0x51a726),console['error']('─'[_0x5a3fb2(0x145)](0x3c)),_0x5a029c[_0x5a3fb2(0x191)]&&console[_0x5a3fb2(0x1b0)](_0x5a029c['diff']),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c));}if(_0x3cdb4c[_0x5a3fb2(0x152)]>0x0&&!_0x362331[_0x5a3fb2(0x17b)])for(const _0x3ab3f0 of _0x3cdb4c){const _0x3569ef=_0x3ab3f0['segmentFolderId']?_0x1e89e3[_0x5a3fb2(0x183)](_0x3ab3f0['segmentFolderId'][_0x5a3fb2(0x16c)]())||'':'',_0x1878b6=_0x3569ef?_0x3569ef+'/'+_0x3ab3f0['name']:_0x3ab3f0[_0x5a3fb2(0x1bb)],_0x3b7075=_0x45ac52['get'](_0x3ab3f0['id'])||[],_0x300829=_0x3b7075['length']>0x0?a46_0x1ac0c9[_0x5a3fb2(0x186)]('\x20['+_0x3b7075[_0x5a3fb2(0x152)]+'\x20activations]'):'';console['error']('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x12c))+'\x20'+_0x1878b6+_0x300829),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c));const _0x4923a0=segmentWithActivationsToYaml(_0x3ab3f0,_0x3b7075,undefined,_0xce539d,_0x45f2f3),_0x32b3d8=segmentToYamlString(_0x4923a0),_0x41de83=generateDiff(_0x32b3d8,'');console['error'](formatDiffWithColors(_0x41de83)),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c));}const _0x592b18=_0x4aa83c['filter'](_0x5b7273=>!_0x5b7273[_0x5a3fb2(0x161)]&&_0x5b7273[_0x5a3fb2(0x191)]);if(_0x592b18[_0x5a3fb2(0x152)]>0x0&&!_0x362331['journeysOnly'])for(const _0x36fd20 of _0x592b18){const _0x2033a4=_0x36fd20['folderPath']?_0x36fd20[_0x5a3fb2(0x1b2)]+'/'+_0x36fd20['yamlConfig'][_0x5a3fb2(0x1bb)]:_0x36fd20[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)];console[_0x5a3fb2(0x1b0)]('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x12f)](_0x5a3fb2(0x193))+'\x20'+_0x2033a4),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c)),console[_0x5a3fb2(0x1b0)](_0x36fd20['diff']),console['error']('─'[_0x5a3fb2(0x145)](0x3c));}if(_0x313eb4[_0x5a3fb2(0x152)]>0x0)for(const _0xe19454 of _0x313eb4){const _0x3511d1=_0xe19454[_0x5a3fb2(0x1b2)]?_0xe19454[_0x5a3fb2(0x1b2)]+'/'+_0xe19454['yamlConfig'][_0x5a3fb2(0x1bb)]:_0xe19454[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)];console[_0x5a3fb2(0x1b0)]('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x18d)]('New\x20journey:')+'\x20'+_0x3511d1),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c)),_0xe19454[_0x5a3fb2(0x191)]&&console[_0x5a3fb2(0x1b0)](_0xe19454['diff']),console[_0x5a3fb2(0x1b0)]('─'['repeat'](0x3c));}const _0x499ae0=_0x22addb[_0x5a3fb2(0x17c)](_0x144f45=>!_0x144f45[_0x5a3fb2(0x161)]&&_0x144f45['diff']);if(_0x499ae0['length']>0x0)for(const _0x84efb9 of _0x499ae0){const _0x2549a5=_0x84efb9[_0x5a3fb2(0x1b2)]?_0x84efb9[_0x5a3fb2(0x1b2)]+'/'+_0x84efb9['yamlConfig'][_0x5a3fb2(0x1bb)]:_0x84efb9[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)];console[_0x5a3fb2(0x1b0)]('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x12f)]('Changes\x20to\x20journey:')+'\x20'+_0x2549a5),console['error']('─'[_0x5a3fb2(0x145)](0x3c)),console[_0x5a3fb2(0x1b0)](_0x84efb9[_0x5a3fb2(0x191)]),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c));}if(_0x521f3a[_0x5a3fb2(0x152)]>0x0)for(const _0x3d79ab of _0x521f3a){const _0x6b5b7f=_0x3d79ab[_0x5a3fb2(0x1aa)]?_0x1e89e3[_0x5a3fb2(0x183)](_0x3d79ab[_0x5a3fb2(0x1aa)])||'':'',_0x19856d=_0x6b5b7f?_0x6b5b7f+'/'+_0x3d79ab[_0x5a3fb2(0x163)]:_0x3d79ab[_0x5a3fb2(0x163)];console['error']('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x160))+'\x20'+_0x19856d),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c)),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x14a))),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c));}if(_0x362331['dryRun'])return console['error'](a46_0x1ac0c9[_0x5a3fb2(0x12f)](_0x5a3fb2(0x169))),0x0;const _0x5ce8ed=_0x362331[_0x5a3fb2(0x17b)]?![]:_0x373d8b['length']>0x0||_0x370797['length']>0x0||_0x3cdb4c['length']>0x0,_0x377ecf=_0x313eb4[_0x5a3fb2(0x152)]>0x0||_0x11d50c[_0x5a3fb2(0x152)]>0x0||_0x521f3a['length']>0x0,_0x66676f=_0x362331['journeysOnly']?![]:_0x208f5a[_0x5a3fb2(0x152)]>0x0,_0x3218ef=_0x3cef4e[_0x5a3fb2(0x152)]>0x0;if(!_0x5ce8ed&&!_0x377ecf&&!_0x66676f&&!_0x3218ef){const _0x52a599=_0x362331[_0x5a3fb2(0x17b)]?_0x5a3fb2(0x129):_0x5a3fb2(0x1a6);console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x18d)](_0x52a599));if(_0xabea65&&_0x4edfbb[_0x5a3fb2(0x152)]===0x1){const _0x113a57=_0x4edfbb[0x0];if(_0x113a57['existingSegment']?.['id']){const _0x3f4e46=getConsoleNextUrl(_0x362331['site'],'/app/ps/'+_0xeb7332+_0x5a3fb2(0x137)+_0x113a57[_0x5a3fb2(0x133)]['id']+_0x5a3fb2(0x17a));console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x13f)+a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x3f4e46));}}if(_0xabea65&&_0x1f64dd[_0x5a3fb2(0x152)]===0x1){const _0x3c1a15=_0x1f64dd[0x0];if(_0x3c1a15['existingJourney']?.['id']){const _0x269bb6=getConsoleNextUrl(_0x362331[_0x5a3fb2(0x120)],'/app/ps/'+_0xeb7332+'/e/'+_0x3c1a15[_0x5a3fb2(0x1a5)]['id']+_0x5a3fb2(0x18a));console['error']('\x20\x20'+a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x269bb6));}}return 0x0;}const _0x28eea9=_0x362331[_0x5a3fb2(0x17b)]?_0x313eb4[_0x5a3fb2(0x152)]+_0x11d50c['length']+_0x521f3a[_0x5a3fb2(0x152)]+_0x3cef4e[_0x5a3fb2(0x152)]:_0x373d8b[_0x5a3fb2(0x152)]+_0x370797['length']+_0x3cdb4c['length']+_0x313eb4[_0x5a3fb2(0x152)]+_0x11d50c[_0x5a3fb2(0x152)]+_0x521f3a[_0x5a3fb2(0x152)]+_0x3cef4e[_0x5a3fb2(0x152)]+_0x208f5a[_0x5a3fb2(0x152)];if(!_0x362331['yes']&&_0x28eea9>0x0){if(!isInteractive())return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x192)),_0x5a3fb2(0x174)),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9['dim'](_0x5a3fb2(0x17e))),0x1;const _0x390bbb=await confirmKey(_0x5a3fb2(0x14e)+_0x28eea9+_0x5a3fb2(0x15f));if(!_0x390bbb)return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9['yellow']('Aborted.')),0x1;}const _0x54135d={'withProgress':async(_0x47705e,_0x55ea4a)=>{const _0x1ec52c=_0x5a3fb2,_0x3003c1=await withSpinner(_0x47705e,_0x55ea4a,{'verbose':_0x362331[_0x1ec52c(0x19e)]});return{'data':_0x3003c1[_0x1ec52c(0x141)]};},'logInfo':_0x2e0d2f=>console['error'](a46_0x1ac0c9[_0x5a3fb2(0x171)]('✔\x20'+_0x2e0d2f)),'logSuccess':_0x5bbb4a=>console['error'](a46_0x1ac0c9[_0x5a3fb2(0x18d)]('✔\x20'+_0x5bbb4a)),'logWarning':_0xe0a0e7=>console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x12f)]('⚠\x20'+_0xe0a0e7)),'logDeleted':_0x22b929=>console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)]('✔\x20'+_0x22b929))},_0x310c80={'segment':_0x41e6f5[_0x5a3fb2(0x1a7)],'journey':_0x41e6f5[_0x5a3fb2(0x147)],'user':_0x41e6f5[_0x5a3fb2(0x12b)],'connection':_0x41e6f5['connection']};_0x3cef4e['length']>0x0&&(_0x7bf0e8=await executePushFolders(_0x310c80,_0x3cef4e,_0x7bf0e8,{'parentId':_0xeb7332},_0x54135d));const _0x52200f={'rootFolderId':_0x1a3478,'folderPathToId':_0x7bf0e8,'folderIdToPath':_0x1e89e3,'segmentNameToId':_0x58e3b8,'activationsBySegmentId':_0x45ac52,'emailToIdMap':_0x49998c,'idToEmailMap':_0xce539d,'connectionNameToIdMap':_0x4b8126[_0x5a3fb2(0x1a8)],'connectionIdToNameMap':_0x4b8126['idToName'],'connectionNameToTypeMap':_0x590122},_0x772897=await executePushSegments(_0x310c80,_0x362331[_0x5a3fb2(0x17b)]?[]:_0x4aa83c,_0x52200f,{'parentId':_0xeb7332},_0x54135d),_0x5330d1=_0x772897[_0x5a3fb2(0x14f)],_0x30b37e=_0x772897[_0x5a3fb2(0x19d)],_0x543d14=_0x772897[_0x5a3fb2(0x181)]['created'],_0x480ead=_0x772897['activations'][_0x5a3fb2(0x19d)],_0x2fe159=_0x772897[_0x5a3fb2(0x181)][_0x5a3fb2(0x1bc)];let _0x216b45;if(_0xabea65&&_0x4aa83c['length']===0x1){const _0x3b7812=_0x4aa83c[0x0];_0x216b45=_0x3b7812['existingSegment']?.['id']??_0x772897[_0x5a3fb2(0x199)][_0x5a3fb2(0x183)](_0x3b7812[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)]);}const _0x29eb1c=await executePushSegmentDeletions(_0x310c80,_0x362331[_0x5a3fb2(0x17b)]?[]:_0x3cdb4c,_0x54135d);let _0x193b37=0x0,_0x403712=0x0,_0x4de699=0x0;const _0x35b2a8=new Map(_0x58e3b8);for(const [_0x2d7698,_0x631049]of _0x772897[_0x5a3fb2(0x199)]){_0x35b2a8[_0x5a3fb2(0x146)](_0x2d7698,_0x631049);}if(_0x22addb[_0x5a3fb2(0x152)]>0x0){const _0x55ca99={..._0x52200f,'segmentNameToId':_0x35b2a8,'existingSegments':_0x22542a,'activationContext':_0x487595},_0x29a3af=await executePushJourneys(_0x310c80,_0x22addb,_0x55ca99,{'parentId':_0xeb7332,'rootFolderId':_0x1a3478,'verbose':_0x362331['verbose']},_0x54135d);_0x193b37=_0x29a3af[_0x5a3fb2(0x14f)],_0x403712=_0x29a3af['updated'];if(_0xabea65&&_0x29a3af['results'][_0x5a3fb2(0x152)]===0x1){const _0x4e67bc=_0x29a3af['results'][0x0];if(_0x4e67bc[_0x5a3fb2(0x180)]){const _0x187c41=getConsoleNextUrl(_0x362331['site'],'/app/ps/'+_0xeb7332+_0x5a3fb2(0x137)+_0x4e67bc[_0x5a3fb2(0x180)]+_0x5a3fb2(0x18a));console[_0x5a3fb2(0x1b0)]('\x20\x20'+a46_0x1ac0c9['cyan'](_0x187c41));}}}for(const _0x39bf65 of _0x521f3a){console['error'](a46_0x1ac0c9[_0x5a3fb2(0x12f)](_0x5a3fb2(0x179)+_0x39bf65[_0x5a3fb2(0x163)])),_0x4de699++;}const _0x1d2699=[];if(_0x5330d1>0x0)_0x1d2699[_0x5a3fb2(0x1ae)](_0x5330d1+_0x5a3fb2(0x122));if(_0x30b37e>0x0)_0x1d2699[_0x5a3fb2(0x1ae)](_0x30b37e+_0x5a3fb2(0x190));if(_0x29eb1c>0x0)_0x1d2699['push'](_0x29eb1c+_0x5a3fb2(0x136));const _0x34538d=[];if(_0x193b37>0x0)_0x34538d[_0x5a3fb2(0x1ae)](_0x193b37+_0x5a3fb2(0x122));if(_0x403712>0x0)_0x34538d['push'](_0x403712+_0x5a3fb2(0x190));if(_0x4de699>0x0)_0x34538d[_0x5a3fb2(0x1ae)](_0x4de699+_0x5a3fb2(0x136));const _0x39c22c=[];if(_0x543d14>0x0)_0x39c22c[_0x5a3fb2(0x1ae)](_0x543d14+_0x5a3fb2(0x122));if(_0x480ead>0x0)_0x39c22c['push'](_0x480ead+_0x5a3fb2(0x190));if(_0x2fe159>0x0)_0x39c22c[_0x5a3fb2(0x1ae)](_0x2fe159+'\x20deleted');console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x18d)](_0x5a3fb2(0x16f)));_0x1d2699['length']>0x0&&!_0x362331[_0x5a3fb2(0x17b)]&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x1ad)+_0x1d2699[_0x5a3fb2(0x132)](',\x20'));_0x34538d[_0x5a3fb2(0x152)]>0x0&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x13e)+_0x34538d[_0x5a3fb2(0x132)](',\x20'));_0x39c22c[_0x5a3fb2(0x152)]>0x0&&!_0x362331[_0x5a3fb2(0x17b)]&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x126)+_0x39c22c['join'](',\x20'));if(_0x216b45){const _0x1e40f8=getConsoleNextUrl(_0x362331['site'],_0x5a3fb2(0x143)+_0xeb7332+'/e/'+_0x216b45+_0x5a3fb2(0x17a));console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x13f)+a46_0x1ac0c9['cyan'](_0x1e40f8));}return 0x0;}}
1
+ const a47_0x2652ae=a47_0xea6e;(function(_0x1cd4ba,_0x1b17a){const _0x38121c=a47_0xea6e,_0x269965=_0x1cd4ba();while(!![]){try{const _0x5686c5=-parseInt(_0x38121c(0x1b1))/0x1*(parseInt(_0x38121c(0x1d4))/0x2)+parseInt(_0x38121c(0x21c))/0x3*(parseInt(_0x38121c(0x1a1))/0x4)+parseInt(_0x38121c(0x21e))/0x5*(parseInt(_0x38121c(0x1c0))/0x6)+-parseInt(_0x38121c(0x22d))/0x7+-parseInt(_0x38121c(0x19b))/0x8*(parseInt(_0x38121c(0x1c7))/0x9)+parseInt(_0x38121c(0x227))/0xa+parseInt(_0x38121c(0x19e))/0xb;if(_0x5686c5===_0x1b17a)break;else _0x269965['push'](_0x269965['shift']());}catch(_0x566e1d){_0x269965['push'](_0x269965['shift']());}}}(a47_0x3d4f,0x8c047));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 a47_0x864e50 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a47_0xea6e(_0x416310,_0x48e1f2){_0x416310=_0x416310-0x19b;const _0x3d4f90=a47_0x3d4f();let _0xea6e37=_0x3d4f90[_0x416310];return _0xea6e37;}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a47_0x3d4f(){const _0x3f0492=['journeys','\x20activations]','\x20\x20Source:\x20','12wSezEf','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','buildUserMaps','Folders\x20to\x20create:','new','add','createdAt','segment\x20or\x20journey','connection','existingSegment','user','name','.yml','created','errorCode','repeat','Error\x20parsing\x20YAML:\x20','push','filter','📁\x20','dryRun','versionNumber','.yaml','get','getOutputSchemaWithCache','unchanged','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parent_name','\x0a✔\x20Push\x20complete','Aborted.','length','No\x20','toDelete','activations','error','\x20created','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','cyan','all','\x20YAML\x20files\x20found','Changes\x20to\x20journey:','getJourney','journeysOnly','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','\x20\x20Journeys:\x20','existingJourney','type','Source\x20directory:\x20','results','deleted','listSegments','description','segmentFolderId','relationships','/sb/da/esr','green','isScoped','updatedAt','dim','Parent\x20segment:\x20','then','nameToId','attributes','resolveParentId','\x20\x20Segments:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20to\x20update','\x20\x20🗺️\x20\x20Journeys:','idToName','Delete\x20segment:','\x20deleted','verbose','849963ZMpNQR','\x0aError:','70kPNlvl','delete','data','\x20\x20📊\x20Segments:','yellow','blue','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','message','toUpdate','4221890vjClpX','state','parentName','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','segments','\x20updated','4410154SZeVdb','New\x20journey:','journey','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20changed','/j/da/je','red','getMetadataWithCache','Scoped\x20to\x20folder:\x20','segment:push','8SWyDwt','/app/ps/','Error:\x20Directory\x20not\x20found:\x20','8590703XcUehG','Fetching\x20existing\x20data...','set','12KajRMs','no_parent','parentSegment','updated','map','New\x20segment:','Site:\x20','Fetching\x20existing\x20activations...','\x20to\x20delete','\x20unchanged','changed','isNew','yamlConfig','\x20\x20\x20\x20','(Journey\x20will\x20be\x20deleted)','\x20new','118856HITnPP','\x20folders\x20to\x20create','journeyBundleName','setPhase','filePath','\x20\x20Activations:\x20','folderId','yes','diff','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','listJourneysWithDetailsFromParentSegment','file','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','folderPath','toCreate','339282POZlPl','targetDir','createdSegmentIds','journeyId','Push\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','scopedFolderPath','8353026FNrbrs','\x20changes?','Error:\x20','/e/','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','nameToType','segment','execute','site'];a47_0x3d4f=function(){return _0x3f0492;};return a47_0x3d4f();}export class SegmentPushCommand extends BaseCommand{[a47_0x2652ae(0x1df)]=a47_0x2652ae(0x236);[a47_0x2652ae(0x207)]=a47_0x2652ae(0x1ff);async[a47_0x2652ae(0x1cf)](_0x56cfa9){const _0x452f23=a47_0x2652ae,{options:_0x475126,args:_0x4c6d97,tdx:_0x25328a}=_0x56cfa9,_0x4da06f=_0x475126,_0x32b5ec=await resolveTarget({'arg':_0x4c6d97[0x0],'contextParent':_0x475126[_0x452f23(0x1a3)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x32b5ec))return _0x32b5ec[_0x452f23(0x1e2)]===_0x452f23(0x1a2)?(console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x222)](_0x452f23(0x1f8))),console[_0x452f23(0x1f6)]('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)'),console[_0x452f23(0x1f6)](_0x452f23(0x1cc)),console[_0x452f23(0x1f6)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x1c9)+_0x32b5ec['message']+'\x0a')),_0x32b5ec['helpText']&&console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x1f9)](_0x32b5ec['helpText']))),0x1;if(_0x32b5ec[_0x452f23(0x202)]===_0x452f23(0x1ef))return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x19d)+_0x32b5ec[_0x452f23(0x1c1)]+'\x0a')),console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x1f9)](_0x452f23(0x215))),0x1;const _0xb734c6=_0x32b5ec[_0x452f23(0x229)],_0x865458=_0x32b5ec[_0x452f23(0x1c1)],_0x15d1ab=_0x32b5ec[_0x452f23(0x202)]===_0x452f23(0x1bc)?_0x32b5ec[_0x452f23(0x1b5)]:undefined,_0x3304b5=getScopedDetails(_0x32b5ec),_0x484dac=_0x3304b5?.[_0x452f23(0x20c)]??![],_0x55ce74=_0x3304b5?.[_0x452f23(0x1c6)]??'';if(!existsSync(_0x865458))return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x19d)+_0x865458+'\x0a')),console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x1f9)](_0x452f23(0x215))),0x1;_0x4da06f[_0x452f23(0x21b)]&&(console['error'](_0x452f23(0x1a7)+_0x4da06f[_0x452f23(0x1d0)]),console['error'](_0x452f23(0x20f)+_0xb734c6),console['error'](_0x452f23(0x203)+_0x865458),_0x484dac&&console[_0x452f23(0x1f6)](_0x452f23(0x235)+_0x55ce74));const _0x564df3=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xb734c6+'\x27...',()=>_0x25328a[_0x452f23(0x1ce)][_0x452f23(0x213)](_0xb734c6),{'verbose':_0x4da06f[_0x452f23(0x21b)]}),_0x3f9a71=_0x564df3[_0x452f23(0x220)],{parentSegmentResult:_0x3f1cdb,segmentsResult:_0x34641b,foldersResult:_0x6e1e5d,journeysWithDetailsResult:_0x5e8c76,userMaps:_0x4fc993}=await withSpinner(_0x452f23(0x19f),async()=>{const _0x42f949=_0x452f23,[_0x2bcbf3,_0x1fea15,_0x2bb5bc,_0x3a5ee5,_0x59eb6c]=await Promise[_0x42f949(0x1fa)]([_0x25328a[_0x42f949(0x1ce)]['getParent'](_0x3f9a71),_0x25328a[_0x42f949(0x1ce)][_0x42f949(0x206)](_0x3f9a71),_0x25328a[_0x42f949(0x1ce)]['listFolders'](_0x3f9a71),_0x25328a['journey'][_0x42f949(0x1bb)](_0x3f9a71,{'includeAllVersions':!![]}),_0x25328a[_0x42f949(0x1de)][_0x42f949(0x1d6)]()]);return{'parentSegmentResult':_0x2bcbf3,'segmentsResult':_0x1fea15,'foldersResult':_0x2bb5bc,'journeysWithDetailsResult':_0x3a5ee5,'userMaps':_0x59eb6c};},{'verbose':_0x4da06f['verbose']})[_0x452f23(0x210)](_0x476165=>_0x476165[_0x452f23(0x220)]),_0x39ab15=_0x3f1cdb,_0x2ffaf5=extractRootFolderId(_0x39ab15),_0x5b2e02=_0x34641b,_0x1a2404=_0x6e1e5d,{journeys:_0x1b0fb9,activationStepsById:_0x4fcc92}=_0x5e8c76,_0x1805ff=new Map(_0x1b0fb9[_0x452f23(0x1a5)](_0x635dbc=>[_0x635dbc['id'],_0x635dbc])),_0x129248=_0x1b0fb9[_0x452f23(0x1a5)](_0x2d3045=>({'id':_0x2d3045['id'],'name':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x1df)],'journeyBundleName':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x1b3)]||'','journeyBundleId':_0x2d3045[_0x452f23(0x212)]['journeyBundleId']||'','versionNumber':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x1e9)],'description':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x207)],'state':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x228)],'paused':_0x2d3045[_0x452f23(0x212)]['paused'],'audienceId':_0x2d3045[_0x452f23(0x212)]['audienceId'],'folderId':_0x2d3045[_0x452f23(0x209)]?.['parentFolder']?.['data']?.['id'],'createdAt':_0x2d3045['attributes'][_0x452f23(0x1da)],'updatedAt':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x20d)]})),{emailToId:_0x562c00,idToEmail:_0x189ee2}=_0x4fc993,_0x3a4d64=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x1c1452=await _0x25328a['connection']['list']();return buildConnectionMaps(_0x1c1452);},{'verbose':_0x4da06f[_0x452f23(0x21b)]})['then'](_0x26feb4=>_0x26feb4[_0x452f23(0x220)]),_0x37a6b8=_0x3a4d64[_0x452f23(0x211)],_0x31257c=_0x3a4d64[_0x452f23(0x218)],_0x44263=_0x3a4d64[_0x452f23(0x1cd)],_0x2370e7={'emailToIdMap':_0x562c00,'connectionNameToIdMap':_0x37a6b8,'connectionNameToTypeMap':_0x44263,'getSchema':_0x7b48a3=>_0x25328a[_0x452f23(0x1dc)][_0x452f23(0x1ec)](_0x7b48a3),'getMetadata':_0x1a8fb6=>_0x25328a[_0x452f23(0x1dc)][_0x452f23(0x234)](_0x1a8fb6)};let {pathToId:_0x167a65,idToPath:_0x342dff}=buildFolderMaps(_0x1a2404);const _0x43f10b=buildSegmentLookupMap(_0x5b2e02,_0x342dff),_0x532707=buildSegmentNameToIdMap(_0x5b2e02),_0x1d6760=buildJourneyBundleLookupMap(_0x129248,_0x342dff);let _0x22ad01;if(_0x15d1ab){if(!_0x15d1ab['endsWith'](_0x452f23(0x1e0))&&!_0x15d1ab['endsWith'](_0x452f23(0x1ea)))return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x224)+_0x15d1ab+'\x0a')),0x1;_0x22ad01=[_0x15d1ab];}else _0x22ad01=findYamlFiles(_0x865458);if(_0x22ad01['length']===0x0)return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x230)+_0x865458+'\x0a')),console['error'](a47_0x864e50[_0x452f23(0x1f9)](_0x452f23(0x1cb))),0x1;let _0x21cd86,_0x8eeca4;try{const _0x5db837=parseAndClassifyYamlFiles(_0x22ad01,_0x865458,{'skipSegments':_0x4da06f['journeysOnly']});_0x21cd86=_0x5db837['segments'],_0x8eeca4=_0x5db837[_0x452f23(0x1d1)];const _0x192612=validateParsedFiles(_0x5db837,_0x865458);if(_0x192612[_0x452f23(0x1f2)]>0x0)return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)]('\x0aValidation\x20failed:')),console[_0x452f23(0x1f6)](formatValidationErrors(_0x192612)),console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x222)](_0x452f23(0x1bd))),0x1;}catch(_0x187f40){return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x1e4)+(_0x187f40 instanceof Error?_0x187f40[_0x452f23(0x225)]:_0x187f40))),0x1;}if(_0x21cd86[_0x452f23(0x1f2)]===0x0&&_0x8eeca4[_0x452f23(0x1f2)]===0x0){const _0xcd61fd=_0x4da06f[_0x452f23(0x1fe)]?_0x452f23(0x22f):_0x452f23(0x1db);return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x222)](_0x452f23(0x1f3)+_0xcd61fd+_0x452f23(0x1fb))),0x0;}const _0x57bf15=new Map();_0x5b2e02['length']>0x0&&!_0x4da06f[_0x452f23(0x1fe)]&&await withSpinner(_0x452f23(0x1a8),async()=>{await batchAsync(_0x5b2e02,async _0x28e148=>{const _0x1a493a=a47_0xea6e,_0x18c4e9=await _0x25328a['segment']['listActivations'](_0x3f9a71,_0x28e148['id']);_0x57bf15[_0x1a493a(0x1a0)](_0x28e148['id'],_0x18c4e9);});},{'verbose':_0x4da06f['verbose']});const {segmentFiles:_0x39ea67,foldersToCreate:_0x38a63c}=await prepareSegmentFiles(_0x21cd86,{'segmentByFolderAndName':_0x43f10b,'activationsBySegmentId':_0x57bf15,'folderPathToId':_0x167a65,'idToEmailMap':_0x189ee2,'connectionIdToNameMap':_0x31257c},_0x2370e7,_0x484dac,_0x55ce74),_0x49ce5d=_0x15d1ab?[]:findSegmentsToDelete(_0x5b2e02,_0x21cd86[_0x452f23(0x1a5)](({yamlConfig:_0xf8a24c,folderPath:_0x2a306a})=>({'yamlConfig':_0xf8a24c,'folderPath':resolveTDFolderPath(_0x2a306a,_0x484dac,_0x55ce74)})),_0x342dff,_0x55ce74,_0x484dac),{journeyFiles:_0x25bc55,foldersToCreate:_0x56a13b}=await withProgressSpinner('Preparing\x20journeys...',async _0xb57dcb=>prepareJourneyFiles(_0x8eeca4,{'fetchJourney':async _0x38a2a8=>_0x25328a[_0x452f23(0x22f)][_0x452f23(0x1fd)](_0x38a2a8[_0x452f23(0x1c3)]),'journeyBundlesByFolderAndName':_0x1d6760,'folderPathToId':_0x167a65,'idToEmailMap':_0x189ee2,'connectionIdToNameMap':_0x31257c,'existingSegments':_0x5b2e02,'parentId':_0x3f9a71,'deps':_0x25328a,'progress':{'update':_0x29a05d=>{const _0x38ab53=_0x452f23;_0xb57dcb[_0x38ab53(0x1b4)](_0x29a05d),_0x4da06f[_0x38ab53(0x21b)]&&console[_0x38ab53(0x1f6)]('\x20\x20'+_0x29a05d);}},'journeyById':_0x1805ff,'activationStepsById':_0x4fcc92},_0x484dac,_0x55ce74),{'verbose':_0x4da06f[_0x452f23(0x21b)]})['then'](_0x5b082d=>_0x5b082d[_0x452f23(0x220)]);for(const _0x5769e5 of _0x56a13b){_0x38a63c[_0x452f23(0x1d9)](_0x5769e5);}const _0xc0235c=_0x15d1ab?[]:findJourneysToDelete(_0x129248,_0x8eeca4[_0x452f23(0x1a5)](({yamlConfig:_0x40911b,folderPath:_0x53d20b})=>({'yamlConfig':_0x40911b,'folderPath':resolveTDFolderPath(_0x53d20b,_0x484dac,_0x55ce74)})),_0x342dff,_0x55ce74,_0x484dac),_0x2c3bff=calculatePushStats(_0x39ea67,_0x25bc55,_0x38a63c,_0x49ce5d,_0xc0235c,!!_0x4da06f[_0x452f23(0x21f)],!!_0x4da06f[_0x452f23(0x1fe)]),_0x39ab1e=_0x2c3bff[_0x452f23(0x22b)][_0x452f23(0x1d8)],_0x27a9c6=_0x2c3bff[_0x452f23(0x22b)]['changed'],_0x25387a=_0x2c3bff[_0x452f23(0x22b)][_0x452f23(0x1ed)],_0x10aef2=_0x2c3bff[_0x452f23(0x22b)][_0x452f23(0x1f4)],_0x5143c6=_0x2c3bff['folders'][_0x452f23(0x1bf)],_0x5cdd7a=_0x2c3bff['journeys'][_0x452f23(0x1d8)],_0x11635d=_0x2c3bff[_0x452f23(0x1d1)][_0x452f23(0x1ab)],_0x23b1b7=_0x2c3bff[_0x452f23(0x1d1)]['unchanged'],_0xc7f869=_0x2c3bff[_0x452f23(0x1d1)]['toDelete'],_0x208d82=_0x2c3bff['activations']['all'],_0x238e17=_0x2c3bff[_0x452f23(0x1f5)][_0x452f23(0x1bf)],_0x153fdd=_0x2c3bff[_0x452f23(0x1f5)][_0x452f23(0x226)],_0x39f893=_0x2c3bff[_0x452f23(0x1f5)]['toDelete'];console[_0x452f23(0x1f6)]('\x0aPush\x20summary\x20for\x20\x27'+_0xb734c6+'\x27:');_0x5143c6[_0x452f23(0x1f2)]>0x0&&console[_0x452f23(0x1f6)]('\x20\x20'+a47_0x864e50[_0x452f23(0x223)](_0x452f23(0x1e7)+_0x5143c6['length']+_0x452f23(0x1b2)));if(!_0x4da06f[_0x452f23(0x1fe)]){console[_0x452f23(0x1f6)](_0x452f23(0x221)),console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x20b)]('+\x20'+_0x39ab1e[_0x452f23(0x1f2)]+_0x452f23(0x1b0))),console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x222)]('~\x20'+_0x27a9c6[_0x452f23(0x1f2)]+_0x452f23(0x231)));if(_0x10aef2[_0x452f23(0x1f2)]>0x0)console[_0x452f23(0x1f6)]('\x20\x20\x20\x20'+a47_0x864e50[_0x452f23(0x233)]('-\x20'+_0x10aef2['length']+_0x452f23(0x1a9)));else _0x49ce5d['length']>0x0&&!_0x4da06f[_0x452f23(0x21f)]&&console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x20e)](_0x49ce5d[_0x452f23(0x1f2)]+_0x452f23(0x1ba)));console[_0x452f23(0x1f6)]('\x20\x20\x20\x20'+a47_0x864e50[_0x452f23(0x20e)]('=\x20'+_0x25387a[_0x452f23(0x1f2)]+_0x452f23(0x1aa)));}if(_0x25bc55[_0x452f23(0x1f2)]>0x0||_0xc0235c[_0x452f23(0x1f2)]>0x0){console[_0x452f23(0x1f6)](_0x452f23(0x217)),console['error'](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x20b)]('+\x20'+_0x5cdd7a[_0x452f23(0x1f2)]+'\x20new')),console[_0x452f23(0x1f6)]('\x20\x20\x20\x20'+a47_0x864e50[_0x452f23(0x222)]('~\x20'+_0x11635d[_0x452f23(0x1f2)]+_0x452f23(0x231)));if(_0xc7f869[_0x452f23(0x1f2)]>0x0)console['error'](_0x452f23(0x1ae)+a47_0x864e50['red']('-\x20'+_0xc7f869[_0x452f23(0x1f2)]+_0x452f23(0x1a9)));else _0xc0235c[_0x452f23(0x1f2)]>0x0&&!_0x4da06f[_0x452f23(0x21f)]&&console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x20e)](_0xc0235c[_0x452f23(0x1f2)]+_0x452f23(0x1ba)));console[_0x452f23(0x1f6)]('\x20\x20\x20\x20'+a47_0x864e50[_0x452f23(0x20e)]('=\x20'+_0x23b1b7[_0x452f23(0x1f2)]+'\x20unchanged'));}_0x208d82[_0x452f23(0x1f2)]>0x0&&!_0x4da06f['journeysOnly']&&(console[_0x452f23(0x1f6)](''),console[_0x452f23(0x1f6)]('\x20\x20Activations:'),_0x238e17[_0x452f23(0x1f2)]>0x0&&console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50['green']('+\x20'+_0x238e17[_0x452f23(0x1f2)]+'\x20to\x20create')),_0x153fdd[_0x452f23(0x1f2)]>0x0&&console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x222)]('~\x20'+_0x153fdd['length']+_0x452f23(0x216))),_0x39f893[_0x452f23(0x1f2)]>0x0&&console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x233)]('-\x20'+_0x39f893[_0x452f23(0x1f2)]+_0x452f23(0x1a9))));console['error'](_0x452f23(0x1d3)+a47_0x864e50[_0x452f23(0x1f9)](_0x865458)+'\x0a');if(_0x5143c6[_0x452f23(0x1f2)]>0x0){console['error'](_0x452f23(0x1d7));for(const _0x5ab06c of _0x5143c6){console[_0x452f23(0x1f6)]('\x20\x20'+a47_0x864e50[_0x452f23(0x223)]('+')+'\x20'+_0x5ab06c);}console['error']('');}if(_0x39ab1e[_0x452f23(0x1f2)]>0x0&&!_0x4da06f[_0x452f23(0x1fe)])for(const _0x4fbb05 of _0x39ab1e){const _0x4f169b=_0x4fbb05[_0x452f23(0x1be)]?_0x4fbb05[_0x452f23(0x1be)]+'/'+_0x4fbb05['yamlConfig'][_0x452f23(0x1df)]:_0x4fbb05[_0x452f23(0x1ad)][_0x452f23(0x1df)],_0x3e868b=_0x4fbb05[_0x452f23(0x1ad)][_0x452f23(0x1f5)]?.[_0x452f23(0x1f2)]||0x0,_0x3c6c5b=_0x3e868b>0x0?a47_0x864e50['dim']('\x20['+_0x3e868b+_0x452f23(0x1d2)):'';console['error']('\x0a'+a47_0x864e50[_0x452f23(0x20b)](_0x452f23(0x1a6))+'\x20'+_0x4f169b+_0x3c6c5b),console['error']('─'[_0x452f23(0x1e3)](0x3c)),_0x4fbb05[_0x452f23(0x1b9)]&&console[_0x452f23(0x1f6)](_0x4fbb05[_0x452f23(0x1b9)]),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c));}if(_0x10aef2[_0x452f23(0x1f2)]>0x0&&!_0x4da06f[_0x452f23(0x1fe)])for(const _0x4f13e9 of _0x10aef2){const _0x3bba0d=_0x4f13e9[_0x452f23(0x208)]?_0x342dff['get'](_0x4f13e9[_0x452f23(0x208)]['toString']())||'':'',_0x2271a6=_0x3bba0d?_0x3bba0d+'/'+_0x4f13e9[_0x452f23(0x1df)]:_0x4f13e9[_0x452f23(0x1df)],_0x4b227c=_0x57bf15[_0x452f23(0x1eb)](_0x4f13e9['id'])||[],_0x53e946=_0x4b227c[_0x452f23(0x1f2)]>0x0?a47_0x864e50[_0x452f23(0x20e)]('\x20['+_0x4b227c[_0x452f23(0x1f2)]+_0x452f23(0x1d2)):'';console[_0x452f23(0x1f6)]('\x0a'+a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x219))+'\x20'+_0x2271a6+_0x53e946),console['error']('─'[_0x452f23(0x1e3)](0x3c));const _0x9bc2ba=segmentWithActivationsToYaml(_0x4f13e9,_0x4b227c,undefined,_0x189ee2,_0x31257c),_0x23afa4=segmentToYamlString(_0x9bc2ba),_0x5134c0=generateDiff(_0x23afa4,'');console['error'](formatDiffWithColors(_0x5134c0)),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c));}const _0x4fa6bf=_0x39ea67[_0x452f23(0x1e6)](_0xd488df=>!_0xd488df['isNew']&&_0xd488df[_0x452f23(0x1b9)]);if(_0x4fa6bf[_0x452f23(0x1f2)]>0x0&&!_0x4da06f[_0x452f23(0x1fe)])for(const _0x81a76a of _0x4fa6bf){const _0x1e17a0=_0x81a76a[_0x452f23(0x1be)]?_0x81a76a[_0x452f23(0x1be)]+'/'+_0x81a76a[_0x452f23(0x1ad)][_0x452f23(0x1df)]:_0x81a76a['yamlConfig'][_0x452f23(0x1df)];console[_0x452f23(0x1f6)]('\x0a'+a47_0x864e50[_0x452f23(0x222)]('Changes\x20to:')+'\x20'+_0x1e17a0),console[_0x452f23(0x1f6)]('─'['repeat'](0x3c)),console[_0x452f23(0x1f6)](_0x81a76a[_0x452f23(0x1b9)]),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c));}if(_0x5cdd7a[_0x452f23(0x1f2)]>0x0)for(const _0x1cc830 of _0x5cdd7a){const _0x425015=_0x1cc830[_0x452f23(0x1be)]?_0x1cc830[_0x452f23(0x1be)]+'/'+_0x1cc830[_0x452f23(0x1ad)][_0x452f23(0x1df)]:_0x1cc830[_0x452f23(0x1ad)][_0x452f23(0x1df)];console[_0x452f23(0x1f6)]('\x0a'+a47_0x864e50[_0x452f23(0x20b)](_0x452f23(0x22e))+'\x20'+_0x425015),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c)),_0x1cc830['diff']&&console[_0x452f23(0x1f6)](_0x1cc830['diff']),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c));}const _0x2a1bb0=_0x25bc55[_0x452f23(0x1e6)](_0x47de36=>!_0x47de36[_0x452f23(0x1ac)]&&_0x47de36[_0x452f23(0x1b9)]);if(_0x2a1bb0[_0x452f23(0x1f2)]>0x0)for(const _0x57938b of _0x2a1bb0){const _0x2d0f26=_0x57938b[_0x452f23(0x1be)]?_0x57938b[_0x452f23(0x1be)]+'/'+_0x57938b[_0x452f23(0x1ad)][_0x452f23(0x1df)]:_0x57938b['yamlConfig'][_0x452f23(0x1df)];console[_0x452f23(0x1f6)]('\x0a'+a47_0x864e50[_0x452f23(0x222)](_0x452f23(0x1fc))+'\x20'+_0x2d0f26),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c)),console[_0x452f23(0x1f6)](_0x57938b['diff']),console['error']('─'[_0x452f23(0x1e3)](0x3c));}if(_0xc7f869[_0x452f23(0x1f2)]>0x0)for(const _0x75ff5a of _0xc7f869){const _0x483861=_0x75ff5a[_0x452f23(0x1b7)]?_0x342dff[_0x452f23(0x1eb)](_0x75ff5a[_0x452f23(0x1b7)])||'':'',_0x19626c=_0x483861?_0x483861+'/'+_0x75ff5a[_0x452f23(0x1b3)]:_0x75ff5a[_0x452f23(0x1b3)];console[_0x452f23(0x1f6)]('\x0a'+a47_0x864e50[_0x452f23(0x233)]('Delete\x20journey:')+'\x20'+_0x19626c),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c)),console[_0x452f23(0x1f6)](a47_0x864e50['red'](_0x452f23(0x1af))),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c));}if(_0x4da06f[_0x452f23(0x1e8)])return console['error'](a47_0x864e50[_0x452f23(0x222)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x6ca18e=_0x4da06f['journeysOnly']?![]:_0x39ab1e[_0x452f23(0x1f2)]>0x0||_0x27a9c6[_0x452f23(0x1f2)]>0x0||_0x10aef2['length']>0x0,_0x34b914=_0x5cdd7a[_0x452f23(0x1f2)]>0x0||_0x11635d[_0x452f23(0x1f2)]>0x0||_0xc7f869[_0x452f23(0x1f2)]>0x0,_0x7f9f57=_0x4da06f['journeysOnly']?![]:_0x208d82['length']>0x0,_0x145eb4=_0x5143c6['length']>0x0;if(!_0x6ca18e&&!_0x34b914&&!_0x7f9f57&&!_0x145eb4){const _0x471a8f=_0x4da06f[_0x452f23(0x1fe)]?_0x452f23(0x1d5):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a47_0x864e50[_0x452f23(0x20b)](_0x471a8f));if(_0x15d1ab&&_0x25387a[_0x452f23(0x1f2)]===0x1){const _0x3f1ad0=_0x25387a[0x0];if(_0x3f1ad0[_0x452f23(0x1dd)]?.['id']){const _0x56c2ac=getConsoleNextUrl(_0x4da06f[_0x452f23(0x1d0)],_0x452f23(0x19c)+_0x3f9a71+'/e/'+_0x3f1ad0[_0x452f23(0x1dd)]['id']+_0x452f23(0x20a));console['error'](_0x452f23(0x22a)+a47_0x864e50['cyan'](_0x56c2ac));}}if(_0x15d1ab&&_0x23b1b7[_0x452f23(0x1f2)]===0x1){const _0x12c7ee=_0x23b1b7[0x0];if(_0x12c7ee[_0x452f23(0x201)]?.['id']){const _0x28ffb3=getConsoleNextUrl(_0x4da06f['site'],_0x452f23(0x19c)+_0x3f9a71+_0x452f23(0x1ca)+_0x12c7ee[_0x452f23(0x201)]['id']+'/j/da/je');console[_0x452f23(0x1f6)]('\x20\x20'+a47_0x864e50[_0x452f23(0x1f9)](_0x28ffb3));}}return 0x0;}const _0x5a046a=_0x4da06f[_0x452f23(0x1fe)]?_0x5cdd7a['length']+_0x11635d[_0x452f23(0x1f2)]+_0xc7f869[_0x452f23(0x1f2)]+_0x5143c6['length']:_0x39ab1e[_0x452f23(0x1f2)]+_0x27a9c6['length']+_0x10aef2['length']+_0x5cdd7a[_0x452f23(0x1f2)]+_0x11635d['length']+_0xc7f869['length']+_0x5143c6[_0x452f23(0x1f2)]+_0x208d82[_0x452f23(0x1f2)];if(!_0x4da06f[_0x452f23(0x1b8)]&&_0x5a046a>0x0){if(!isInteractive())return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x21d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x452f23(0x1f6)](a47_0x864e50['dim'](_0x452f23(0x1ee))),0x1;const _0x14b300=await confirmKey(_0x452f23(0x1c4)+_0x5a046a+_0x452f23(0x1c8));if(!_0x14b300)return console[_0x452f23(0x1f6)](a47_0x864e50['yellow'](_0x452f23(0x1f1))),0x1;}const _0xbf98df={'withProgress':async(_0x4e1a33,_0x48166d)=>{const _0x560133=_0x452f23,_0x513580=await withSpinner(_0x4e1a33,_0x48166d,{'verbose':_0x4da06f[_0x560133(0x21b)]});return{'data':_0x513580[_0x560133(0x220)]};},'logInfo':_0x4ad993=>console['error'](a47_0x864e50[_0x452f23(0x223)]('✔\x20'+_0x4ad993)),'logSuccess':_0x474dc1=>console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x20b)]('✔\x20'+_0x474dc1)),'logWarning':_0x5a38bf=>console['error'](a47_0x864e50[_0x452f23(0x222)]('⚠\x20'+_0x5a38bf)),'logDeleted':_0x10a4b9=>console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)]('✔\x20'+_0x10a4b9))},_0x6d09d={'segment':_0x25328a['segment'],'journey':_0x25328a[_0x452f23(0x22f)],'user':_0x25328a[_0x452f23(0x1de)],'connection':_0x25328a[_0x452f23(0x1dc)]};_0x5143c6['length']>0x0&&(_0x167a65=await executePushFolders(_0x6d09d,_0x5143c6,_0x167a65,{'parentId':_0x3f9a71},_0xbf98df));const _0x10df20={'rootFolderId':_0x2ffaf5,'folderPathToId':_0x167a65,'folderIdToPath':_0x342dff,'segmentNameToId':_0x532707,'activationsBySegmentId':_0x57bf15,'emailToIdMap':_0x562c00,'idToEmailMap':_0x189ee2,'connectionNameToIdMap':_0x3a4d64[_0x452f23(0x211)],'connectionIdToNameMap':_0x3a4d64[_0x452f23(0x218)],'connectionNameToTypeMap':_0x44263},_0x3ad1c2=await executePushSegments(_0x6d09d,_0x4da06f[_0x452f23(0x1fe)]?[]:_0x39ea67,_0x10df20,{'parentId':_0x3f9a71},_0xbf98df),_0x1837d1=_0x3ad1c2['created'],_0x5e17f8=_0x3ad1c2[_0x452f23(0x1a4)],_0x71b9d2=_0x3ad1c2[_0x452f23(0x1f5)]['created'],_0x5733a1=_0x3ad1c2[_0x452f23(0x1f5)][_0x452f23(0x1a4)],_0x2d57e6=_0x3ad1c2[_0x452f23(0x1f5)][_0x452f23(0x205)];let _0x3eb6cd;if(_0x15d1ab&&_0x39ea67[_0x452f23(0x1f2)]===0x1){const _0x2ed397=_0x39ea67[0x0];_0x3eb6cd=_0x2ed397[_0x452f23(0x1dd)]?.['id']??_0x3ad1c2[_0x452f23(0x1c2)]['get'](_0x2ed397[_0x452f23(0x1ad)][_0x452f23(0x1df)]);}const _0xb867da=await executePushSegmentDeletions(_0x6d09d,_0x4da06f[_0x452f23(0x1fe)]?[]:_0x10aef2,_0xbf98df);let _0x336e6e=0x0,_0x5f13a5=0x0,_0xe2c6c6=0x0;const _0x57bef1=new Map(_0x532707);for(const [_0x21984e,_0x28a5bd]of _0x3ad1c2[_0x452f23(0x1c2)]){_0x57bef1[_0x452f23(0x1a0)](_0x21984e,_0x28a5bd);}if(_0x25bc55[_0x452f23(0x1f2)]>0x0){const _0x41da32={..._0x10df20,'segmentNameToId':_0x57bef1,'existingSegments':_0x5b2e02,'activationContext':_0x2370e7},_0x22020b=await executePushJourneys(_0x6d09d,_0x25bc55,_0x41da32,{'parentId':_0x3f9a71,'rootFolderId':_0x2ffaf5,'verbose':_0x4da06f[_0x452f23(0x21b)]},_0xbf98df);_0x336e6e=_0x22020b[_0x452f23(0x1e1)],_0x5f13a5=_0x22020b[_0x452f23(0x1a4)];if(_0x15d1ab&&_0x22020b['results'][_0x452f23(0x1f2)]===0x1){const _0x2d719c=_0x22020b[_0x452f23(0x204)][0x0];if(_0x2d719c[_0x452f23(0x1c3)]){const _0x21c9a9=getConsoleNextUrl(_0x4da06f['site'],_0x452f23(0x19c)+_0x3f9a71+'/e/'+_0x2d719c['journeyId']+_0x452f23(0x232));console['error']('\x20\x20'+a47_0x864e50[_0x452f23(0x1f9)](_0x21c9a9));}}}for(const _0x1c5566 of _0xc7f869){console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x222)](_0x452f23(0x1c5)+_0x1c5566[_0x452f23(0x1b3)])),_0xe2c6c6++;}const _0x2b94c2=[];if(_0x1837d1>0x0)_0x2b94c2[_0x452f23(0x1e5)](_0x1837d1+_0x452f23(0x1f7));if(_0x5e17f8>0x0)_0x2b94c2[_0x452f23(0x1e5)](_0x5e17f8+'\x20updated');if(_0xb867da>0x0)_0x2b94c2[_0x452f23(0x1e5)](_0xb867da+'\x20deleted');const _0x439e58=[];if(_0x336e6e>0x0)_0x439e58[_0x452f23(0x1e5)](_0x336e6e+'\x20created');if(_0x5f13a5>0x0)_0x439e58[_0x452f23(0x1e5)](_0x5f13a5+_0x452f23(0x22c));if(_0xe2c6c6>0x0)_0x439e58[_0x452f23(0x1e5)](_0xe2c6c6+'\x20deleted');const _0xd547a2=[];if(_0x71b9d2>0x0)_0xd547a2[_0x452f23(0x1e5)](_0x71b9d2+'\x20created');if(_0x5733a1>0x0)_0xd547a2[_0x452f23(0x1e5)](_0x5733a1+_0x452f23(0x22c));if(_0x2d57e6>0x0)_0xd547a2[_0x452f23(0x1e5)](_0x2d57e6+_0x452f23(0x21a));console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x20b)](_0x452f23(0x1f0)));_0x2b94c2[_0x452f23(0x1f2)]>0x0&&!_0x4da06f[_0x452f23(0x1fe)]&&console['error'](_0x452f23(0x214)+_0x2b94c2['join'](',\x20'));_0x439e58[_0x452f23(0x1f2)]>0x0&&console[_0x452f23(0x1f6)](_0x452f23(0x200)+_0x439e58['join'](',\x20'));_0xd547a2['length']>0x0&&!_0x4da06f[_0x452f23(0x1fe)]&&console['error'](_0x452f23(0x1b6)+_0xd547a2['join'](',\x20'));if(_0x3eb6cd){const _0x3b0483=getConsoleNextUrl(_0x4da06f['site'],'/app/ps/'+_0x3f9a71+_0x452f23(0x1ca)+_0x3eb6cd+_0x452f23(0x20a));console[_0x452f23(0x1f6)](_0x452f23(0x22a)+a47_0x864e50[_0x452f23(0x1f9)](_0x3b0483));}return 0x0;}}
@@ -1 +1 @@
1
- function a47_0x2729(){const _0x4cebcd=['resolvePathToResource','type','resolveFolderId','kind','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Segment\x20ID:\x20','1310nNhFTI','Resolved\x20relative\x20path\x20to:\x20','46644yejbHx','includes','name','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolving\x20path\x20\x27','length','Resolved\x20type:\x20','execute','segment','INTERNAL','segment:update','segmentPath','rule','yellow','52213phEyOz','3BulfFd','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','8DinPZa','verbose','Parent\x20ID:\x20','Examples:','Updating\x20segment\x20\x27','3115679LAxCkg','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','726cdKFYH','folder','Resolving\x20folder\x20\x27','\x27...','ruleFile','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20update\x20','3051uUayxN','1173188IzkFVQ','error','✔\x20Updated\x20segment\x20\x27','parentId','1650JYBWUj','3288vZUtLW','3029070xiIUZr','segmentName','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.'];a47_0x2729=function(){return _0x4cebcd;};return a47_0x2729();}function a47_0x4d01(_0x563c24,_0x497da1){_0x563c24=_0x563c24-0xc8;const _0x2729d8=a47_0x2729();let _0x4d014b=_0x2729d8[_0x563c24];return _0x4d014b;}const a47_0x758293=a47_0x4d01;(function(_0x33c734,_0xdb0a5){const _0x1b9beb=a47_0x4d01,_0x6bd807=_0x33c734();while(!![]){try{const _0x5b4089=-parseInt(_0x1b9beb(0xde))/0x1*(parseInt(_0x1b9beb(0xe3))/0x2)+-parseInt(_0x1b9beb(0xdf))/0x3*(-parseInt(_0x1b9beb(0xf2))/0x4)+-parseInt(_0x1b9beb(0xce))/0x5*(parseInt(_0x1b9beb(0xf6))/0x6)+parseInt(_0x1b9beb(0xe8))/0x7+parseInt(_0x1b9beb(0xf7))/0x8*(-parseInt(_0x1b9beb(0xf1))/0x9)+-parseInt(_0x1b9beb(0xf8))/0xa+parseInt(_0x1b9beb(0xea))/0xb*(parseInt(_0x1b9beb(0xd0))/0xc);if(_0x5b4089===_0xdb0a5)break;else _0x6bd807['push'](_0x6bd807['shift']());}catch(_0x2fb29e){_0x6bd807['push'](_0x6bd807['shift']());}}}(a47_0x2729,0x425b6));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a47_0xaeb643 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a47_0x758293(0xd2)]=a47_0x758293(0xda);['description']='Update\x20existing\x20child\x20segment';async[a47_0x758293(0xd7)](_0x2eec67){const _0x3799d6=a47_0x758293;console['error'](a47_0xaeb643['yellow'](_0x3799d6(0xfb))),console[_0x3799d6(0xf3)](a47_0xaeb643[_0x3799d6(0xdd)](_0x3799d6(0xe9)));const {options:_0x19df14,args:_0x5e489f,tdx:_0x21372a}=_0x2eec67,_0x9ab943=_0x19df14;if(_0x5e489f[_0x3799d6(0xd5)]===0x0)return console[_0x3799d6(0xf3)](_0x3799d6(0xe2)),console[_0x3799d6(0xf3)](_0x3799d6(0xd3)),console['error'](_0x3799d6(0xe6)),console[_0x3799d6(0xf3)](_0x3799d6(0xcc)),console[_0x3799d6(0xf3)](_0x3799d6(0xe0)),0x1;const _0xef2409=_0x5e489f[0x0],_0x21d8f3=_0x19df14[_0x3799d6(0xdb)];let _0x3c8c63=_0xef2409;_0x21d8f3&&!_0xef2409[_0x3799d6(0xd1)]('/')&&(_0x3c8c63=_0x21d8f3+'/'+_0xef2409,_0x9ab943[_0x3799d6(0xe4)]&&console[_0x3799d6(0xf3)](_0x3799d6(0xcf)+_0x3c8c63));const _0x49a103=await withSpinner(_0x3799d6(0xd4)+_0x3c8c63+'\x27...',()=>_0x21372a[_0x3799d6(0xd8)][_0x3799d6(0xc8)](_0x3c8c63),{'verbose':_0x9ab943[_0x3799d6(0xe4)]}),_0x58ed88=_0x49a103['data'];_0x9ab943[_0x3799d6(0xe4)]&&console['error'](_0x3799d6(0xd6)+_0x58ed88[_0x3799d6(0xc9)]);if(_0x58ed88[_0x3799d6(0xc9)]!==_0x3799d6(0xd8))return console['error'](_0x3799d6(0xf0)+_0x58ed88[_0x3799d6(0xc9)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x3799d6(0xf3)](_0x3799d6(0xfa)),0x1;if(!_0x58ed88[_0x3799d6(0xe1)])throw new SDKError(ErrorCode[_0x3799d6(0xd9)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x32b2d1=_0x58ed88[_0x3799d6(0xf5)],_0x26a43c=_0x58ed88['segmentId'];_0x9ab943[_0x3799d6(0xe4)]&&(console[_0x3799d6(0xf3)](_0x3799d6(0xe5)+_0x32b2d1),console[_0x3799d6(0xf3)](_0x3799d6(0xcd)+_0x26a43c));let _0x315754;if(_0x9ab943[_0x3799d6(0xeb)]){const _0x26a71f=_0x9ab943[_0x3799d6(0xeb)],_0x41b459=await withSpinner(_0x3799d6(0xec)+_0x26a71f+_0x3799d6(0xed),()=>_0x21372a[_0x3799d6(0xd8)][_0x3799d6(0xca)](_0x32b2d1,_0x26a71f),{'verbose':_0x9ab943[_0x3799d6(0xe4)]});_0x315754=parseInt(_0x41b459['data'],0xa),_0x9ab943[_0x3799d6(0xe4)]&&console[_0x3799d6(0xf3)](_0x3799d6(0xef)+_0x315754);}const _0x19c22e=await loadJSONFromOptions(_0x9ab943[_0x3799d6(0xdc)],_0x9ab943[_0x3799d6(0xee)]),_0x82f7a5={'name':_0x9ab943[_0x3799d6(0xd2)],'description':_0x9ab943['description'],'rule':_0x19c22e,'kind':_0x9ab943[_0x3799d6(0xcb)]!==undefined?parseInt(_0x9ab943['kind'],0xa):undefined,'segmentFolderId':_0x315754},_0x4ae126=await withSpinner(_0x3799d6(0xe7)+_0x58ed88[_0x3799d6(0xf9)]+_0x3799d6(0xed),()=>_0x21372a[_0x3799d6(0xd8)]['updateSegmentById'](_0x32b2d1,_0x26a43c,_0x82f7a5),{'verbose':_0x9ab943['verbose']}),_0x23c371=_0x4ae126['data'];return console[_0x3799d6(0xf3)](_0x3799d6(0xf4)+_0x23c371['name']+'\x27'),_0x3c8c63!==_0xef2409&&console[_0x3799d6(0xf3)]('\x20\x20\x20Path:\x20'+_0x3c8c63),await handleSDKOutput([_0x23c371],_0x9ab943),0x0;}}
1
+ const a48_0x5c1445=a48_0x3584;(function(_0x23f279,_0x1fa967){const _0x2e1cb4=a48_0x3584,_0x351e52=_0x23f279();while(!![]){try{const _0x4887df=parseInt(_0x2e1cb4(0x204))/0x1*(-parseInt(_0x2e1cb4(0x1fd))/0x2)+parseInt(_0x2e1cb4(0x1ff))/0x3*(-parseInt(_0x2e1cb4(0x209))/0x4)+parseInt(_0x2e1cb4(0x1f6))/0x5*(parseInt(_0x2e1cb4(0x20d))/0x6)+-parseInt(_0x2e1cb4(0x21c))/0x7*(-parseInt(_0x2e1cb4(0x1f8))/0x8)+-parseInt(_0x2e1cb4(0x21a))/0x9*(parseInt(_0x2e1cb4(0x21f))/0xa)+-parseInt(_0x2e1cb4(0x211))/0xb*(-parseInt(_0x2e1cb4(0x1fe))/0xc)+parseInt(_0x2e1cb4(0x203))/0xd;if(_0x4887df===_0x1fa967)break;else _0x351e52['push'](_0x351e52['shift']());}catch(_0x1b2196){_0x351e52['push'](_0x351e52['shift']());}}}(a48_0x382d,0x7bc2a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a48_0x3584(_0x107521,_0x116f37){_0x107521=_0x107521-0x1f2;const _0x382d13=a48_0x382d();let _0x35843d=_0x382d13[_0x107521];return _0x35843d;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a48_0x13caa1 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a48_0x5c1445(0x212)]='segment:update';[a48_0x5c1445(0x210)]=a48_0x5c1445(0x202);async[a48_0x5c1445(0x1f4)](_0x1947f3){const _0x120326=a48_0x5c1445;console['error'](a48_0x13caa1[_0x120326(0x223)](_0x120326(0x208))),console[_0x120326(0x213)](a48_0x13caa1[_0x120326(0x223)](_0x120326(0x200)));const {options:_0x33f479,args:_0x512f97,tdx:_0x1bdbe4}=_0x1947f3,_0xdbe4cc=_0x33f479;if(_0x512f97['length']===0x0)return console[_0x120326(0x213)](_0x120326(0x1f2)),console['error'](_0x120326(0x1f7)),console['error']('Examples:'),console['error'](_0x120326(0x21e)),console[_0x120326(0x213)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1ca5fe=_0x512f97[0x0],_0x1920b9=_0x33f479[_0x120326(0x1fb)];let _0x5af734=_0x1ca5fe;_0x1920b9&&!_0x1ca5fe[_0x120326(0x217)]('/')&&(_0x5af734=_0x1920b9+'/'+_0x1ca5fe,_0xdbe4cc[_0x120326(0x218)]&&console['error'](_0x120326(0x206)+_0x5af734));const _0x576c9a=await withSpinner(_0x120326(0x20b)+_0x5af734+_0x120326(0x205),()=>_0x1bdbe4['segment'][_0x120326(0x224)](_0x5af734),{'verbose':_0xdbe4cc[_0x120326(0x218)]}),_0x196972=_0x576c9a['data'];_0xdbe4cc[_0x120326(0x218)]&&console[_0x120326(0x213)](_0x120326(0x20e)+_0x196972[_0x120326(0x1f3)]);if(_0x196972['type']!==_0x120326(0x1f5))return console['error']('Error:\x20Cannot\x20update\x20'+_0x196972[_0x120326(0x1f3)]+_0x120326(0x1f9)),console[_0x120326(0x213)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x196972['segmentId'])throw new SDKError(ErrorCode[_0x120326(0x21b)],_0x120326(0x207));const _0x149341=_0x196972[_0x120326(0x215)],_0xb7996b=_0x196972[_0x120326(0x221)];_0xdbe4cc[_0x120326(0x218)]&&(console[_0x120326(0x213)]('Parent\x20ID:\x20'+_0x149341),console[_0x120326(0x213)](_0x120326(0x214)+_0xb7996b));let _0x185c04;if(_0xdbe4cc['folder']){const _0x16be96=_0xdbe4cc[_0x120326(0x20a)],_0x3ffc0e=await withSpinner(_0x120326(0x1fc)+_0x16be96+_0x120326(0x205),()=>_0x1bdbe4[_0x120326(0x1f5)][_0x120326(0x20c)](_0x149341,_0x16be96),{'verbose':_0xdbe4cc[_0x120326(0x218)]});_0x185c04=parseInt(_0x3ffc0e[_0x120326(0x220)],0xa),_0xdbe4cc[_0x120326(0x218)]&&console[_0x120326(0x213)](_0x120326(0x1fa)+_0x185c04);}const _0x26143e=await loadJSONFromOptions(_0xdbe4cc['rule'],_0xdbe4cc[_0x120326(0x201)]),_0x2f9aef={'name':_0xdbe4cc['name'],'description':_0xdbe4cc['description'],'rule':_0x26143e,'kind':_0xdbe4cc['kind']!==undefined?parseInt(_0xdbe4cc[_0x120326(0x21d)],0xa):undefined,'segmentFolderId':_0x185c04},_0xbfa3ab=await withSpinner(_0x120326(0x225)+_0x196972[_0x120326(0x216)]+_0x120326(0x205),()=>_0x1bdbe4[_0x120326(0x1f5)][_0x120326(0x20f)](_0x149341,_0xb7996b,_0x2f9aef),{'verbose':_0xdbe4cc[_0x120326(0x218)]}),_0x41aae8=_0xbfa3ab['data'];return console[_0x120326(0x213)](_0x120326(0x219)+_0x41aae8[_0x120326(0x212)]+'\x27'),_0x5af734!==_0x1ca5fe&&console[_0x120326(0x213)](_0x120326(0x222)+_0x5af734),await handleSDKOutput([_0x41aae8],_0xdbe4cc),0x0;}}function a48_0x382d(){const _0x3efc6b=['name','error','Segment\x20ID:\x20','parentId','segmentName','includes','verbose','✔\x20Updated\x20segment\x20\x27','13761qTthHx','INTERNAL','23765KyfccF','kind','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','6550OipoYu','data','segmentId','\x20\x20\x20Path:\x20','yellow','resolvePathToResource','Updating\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','type','execute','segment','147570rXbvKB','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','400MAhFEk','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolved\x20folder\x20ID:\x20','segmentPath','Resolving\x20folder\x20\x27','10PMSGyH','8349612LdlXeH','201PXpiFl','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','ruleFile','Update\x20existing\x20child\x20segment','15584972lPnzAF','38139zFCtzr','\x27...','Resolved\x20relative\x20path\x20to:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','25332EuhLkk','folder','Resolving\x20path\x20\x27','resolveFolderId','12AYXXdk','Resolved\x20type:\x20','updateSegmentById','description','11LCxFHV'];a48_0x382d=function(){return _0x3efc6b;};return a48_0x382d();}
@@ -1 +1 @@
1
- function a48_0x165e(_0x13fe07,_0x5ca043){_0x13fe07=_0x13fe07-0x8f;const _0x3a532c=a48_0x3a53();let _0x165ea5=_0x3a532c[_0x13fe07];return _0x165ea5;}const a48_0x12f37=a48_0x165e;(function(_0x1d7ef6,_0x5abd1b){const _0x4d59e7=a48_0x165e,_0x3a1bcd=_0x1d7ef6();while(!![]){try{const _0x387fbd=-parseInt(_0x4d59e7(0xc5))/0x1*(-parseInt(_0x4d59e7(0x9a))/0x2)+parseInt(_0x4d59e7(0xc2))/0x3+-parseInt(_0x4d59e7(0x93))/0x4+parseInt(_0x4d59e7(0x97))/0x5*(-parseInt(_0x4d59e7(0x95))/0x6)+parseInt(_0x4d59e7(0xb1))/0x7*(parseInt(_0x4d59e7(0xbd))/0x8)+parseInt(_0x4d59e7(0x9d))/0x9+-parseInt(_0x4d59e7(0xbc))/0xa;if(_0x387fbd===_0x5abd1b)break;else _0x3a1bcd['push'](_0x3a1bcd['shift']());}catch(_0x2c683b){_0x3a1bcd['push'](_0x3a1bcd['shift']());}}}(a48_0x3a53,0x87cd6));import{existsSync,statSync}from'fs';import a48_0x34420f from'chalk';import{BaseCommand}from'./command.js';function a48_0x3a53(){const _0x523e44=['parentId','segmentPath','2553708boCMpJ','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','5899542QUfged','parentName','5qHrdZW','length','description','266kRayFB','session','✔\x20Context\x20set\x20to:\x20','3194631TUuVWE','Site:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','green','Folder\x20ID:\x20','execute','fullPath','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','data','Resolved\x20relative\x20path\x20to:\x20','folderId','isAbsolute','error','Target\x20path:\x20','Resolving\x20path\x20\x27','segment','resolvePathToResource','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','type','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','1211iPyKzb','segment:use','Parent\x20ID:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','folderPath','slice','\x27...','cyan','log','Usage:\x20tdx\x20segment\x20use\x20<path>','verbose','535700tYMgWt','50672LBPYQK','Error:\x20Path\x20is\x20required\x0a','Resolved\x20path\x20type:\x20','site','dim','1161636POGmqt','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','config','2959Fzniut','join','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','red','split'];a48_0x3a53=function(){return _0x523e44;};return a48_0x3a53();}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a48_0x12f37(0xb2);[a48_0x12f37(0x99)]=a48_0x12f37(0x9f);async[a48_0x12f37(0xa2)](_0x5d2003){const _0x4ade18=a48_0x12f37,{options:_0x23bea2,args:_0x60f941,tdx:_0x240389}=_0x5d2003;if(_0x60f941[_0x4ade18(0x98)]===0x0)return console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0x8f)](_0x4ade18(0xbe))),console[_0x4ade18(0xa9)](_0x4ade18(0xba)),console[_0x4ade18(0xa9)]('Examples:'),console[_0x4ade18(0xa9)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x4ade18(0xa9)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x4ade18(0xa9)](_0x4ade18(0x94)),console[_0x4ade18(0xa9)](_0x4ade18(0xc3)),0x1;const _0x2300c8=_0x60f941[0x0],_0x1d9e28=_0x23bea2[_0x4ade18(0x9b)];try{if(_0x2300c8==='/')return saveSessionContext({'segment_path':undefined},_0x1d9e28),console[_0x4ade18(0xb9)](a48_0x34420f[_0x4ade18(0xa0)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x2300c8)&&statSync(_0x2300c8)['isDirectory']()){let _0x1a4638;try{_0x1a4638=findTdxConfig(_0x2300c8);}catch{return console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0x8f)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x2300c8)),console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0xb8)](_0x4ade18(0xae))),0x1;}const _0x4e79c5=_0x1a4638[_0x4ade18(0xc4)]['parent_segment'];return saveSessionContext({'segment_path':_0x4e79c5,'parent_segment':_0x4e79c5},_0x1d9e28),console['log'](a48_0x34420f[_0x4ade18(0xa0)](_0x4ade18(0x9c)+a48_0x34420f[_0x4ade18(0xb8)](_0x4e79c5))),0x0;}const _0x2fe4bb=_0x23bea2[_0x4ade18(0x92)];let _0xf1636e=_0x2300c8;const _0x1f2f76=parsePath(_0x2300c8);if(!_0x1f2f76[_0x4ade18(0xa8)]){if(!_0x2fe4bb)return console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0x8f)](_0x4ade18(0xb4))),console['error'](a48_0x34420f[_0x4ade18(0xb8)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x2300c8==='..'){const _0x5ecaf5=_0x2fe4bb[_0x4ade18(0x90)]('/')[_0x4ade18(0xb6)](0x0,-0x1)[_0x4ade18(0xc6)]('/');_0xf1636e=_0x5ecaf5||'/';}else _0x2300c8==='.'?_0xf1636e=_0x2fe4bb:_0xf1636e=_0x2fe4bb+'/'+_0x2300c8;_0x23bea2['verbose']&&console['error'](_0x4ade18(0xa6)+_0xf1636e);}if(_0xf1636e==='/'||_0xf1636e==='')return saveSessionContext({'segment_path':undefined},_0x1d9e28),console[_0x4ade18(0xb9)](a48_0x34420f[_0x4ade18(0xa0)](_0x4ade18(0xa4))),0x0;_0xf1636e=normalizePath(_0xf1636e);const _0x34cb7a=parsePath(_0xf1636e)['segments'];if(_0x34cb7a[_0x4ade18(0x98)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1d9e28),console[_0x4ade18(0xb9)](a48_0x34420f[_0x4ade18(0xa0)](_0x4ade18(0xa4))),0x0;_0x23bea2[_0x4ade18(0xbb)]&&(console[_0x4ade18(0xa9)](_0x4ade18(0x9e)+_0x23bea2[_0x4ade18(0xc0)]),console[_0x4ade18(0xa9)](_0x4ade18(0xaa)+_0xf1636e));const _0x52440c=await withSpinner(_0x4ade18(0xab)+_0xf1636e+_0x4ade18(0xb7),()=>_0x240389[_0x4ade18(0xac)][_0x4ade18(0xad)](_0xf1636e),{'verbose':_0x23bea2['verbose']}),_0x4712d0=_0x52440c[_0x4ade18(0xa5)];_0x23bea2[_0x4ade18(0xbb)]&&(console[_0x4ade18(0xa9)](_0x4ade18(0xbf)+_0x4712d0['type']),console['error'](_0x4ade18(0xb3)+_0x4712d0[_0x4ade18(0x91)]),_0x4712d0[_0x4ade18(0xa7)]&&console['error'](_0x4ade18(0xa1)+_0x4712d0[_0x4ade18(0xa7)]));if(_0x4712d0[_0x4ade18(0xaf)]===_0x4ade18(0xac))return console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0x8f)](_0x4ade18(0xb0))),console[_0x4ade18(0xa9)](_0x4ade18(0xc7)),console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0xb8)]('Use:\x20tdx\x20segment\x20use\x20'+_0x4712d0[_0x4ade18(0x96)]+(_0x4712d0[_0x4ade18(0xb5)]?'/'+_0x4712d0[_0x4ade18(0xb5)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x4712d0[_0x4ade18(0xa3)],'parent_segment':_0x4712d0['parentName']},_0x1d9e28),console[_0x4ade18(0xb9)](a48_0x34420f[_0x4ade18(0xa0)](_0x4ade18(0x9c)+a48_0x34420f[_0x4ade18(0xb8)](_0x4712d0[_0x4ade18(0xa3)]))),_0x23bea2['verbose']&&(console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0xc1)](_0x4ade18(0xc8))),console['error'](a48_0x34420f[_0x4ade18(0xc1)](_0x4ade18(0xc9)))),0x0;}catch(_0x5d033d){throw _0x5d033d;}}}
1
+ const a49_0x24b048=a49_0x516d;(function(_0x11833e,_0x25407c){const _0x4aa890=a49_0x516d,_0x249ed0=_0x11833e();while(!![]){try{const _0x2234fc=parseInt(_0x4aa890(0x1ec))/0x1+-parseInt(_0x4aa890(0x1e3))/0x2*(-parseInt(_0x4aa890(0x1fc))/0x3)+parseInt(_0x4aa890(0x1d2))/0x4*(-parseInt(_0x4aa890(0x1df))/0x5)+parseInt(_0x4aa890(0x1d7))/0x6+-parseInt(_0x4aa890(0x1ef))/0x7+-parseInt(_0x4aa890(0x1dd))/0x8+parseInt(_0x4aa890(0x1d0))/0x9;if(_0x2234fc===_0x25407c)break;else _0x249ed0['push'](_0x249ed0['shift']());}catch(_0x39e9bb){_0x249ed0['push'](_0x249ed0['shift']());}}}(a49_0x2a88,0xd67fd));function a49_0x516d(_0x4c6e54,_0x54878e){_0x4c6e54=_0x4c6e54-0x1cd;const _0x2a8883=a49_0x2a88();let _0x516db1=_0x2a8883[_0x4c6e54];return _0x516db1;}import{existsSync,statSync}from'fs';function a49_0x2a88(){const _0x4c48d4=['fullPath','execute','error','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','562197OfAIvw','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','✔\x20Context\x20set\x20to:\x20','1486359pWzTlf','isDirectory','red','Site:\x20','Target\x20path:\x20','dim','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','folderId','Examples:','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Folder\x20ID:\x20','slice','log','1137apllin','parentName','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','segment:use','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','verbose','type','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','\x27...','resolvePathToResource','5525793sChSnl','cyan','1473676ZMInUt','parentId','Resolved\x20path\x20type:\x20','name','site','7354086RVaZmI','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segmentPath','green','length','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','11502408FzKcYm','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','15JhJstF','segment','Use:\x20tdx\x20segment\x20use\x20','isAbsolute','6502kfBIYx','Resolving\x20path\x20\x27','folderPath','join','session'];a49_0x2a88=function(){return _0x4c48d4;};return a49_0x2a88();}import a49_0x9946cc from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a49_0x24b048(0x1d5)]=a49_0x24b048(0x1ff);['description']=a49_0x24b048(0x200);async[a49_0x24b048(0x1e9)](_0x4fb6be){const _0x40ab84=a49_0x24b048,{options:_0x206f21,args:_0x28643d,tdx:_0x15a8e0}=_0x4fb6be;if(_0x28643d[_0x40ab84(0x1db)]===0x0)return console[_0x40ab84(0x1ea)](a49_0x9946cc[_0x40ab84(0x1f1)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x40ab84(0x1ea)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error'](_0x40ab84(0x1f7)),console['error'](_0x40ab84(0x1ed)),console[_0x40ab84(0x1ea)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x40ab84(0x1ea)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x40ab84(0x1ea)](_0x40ab84(0x1fe)),0x1;const _0x1ec48b=_0x28643d[0x0],_0x1cb4ca=_0x206f21[_0x40ab84(0x1e7)];try{if(_0x1ec48b==='/')return saveSessionContext({'segment_path':undefined},_0x1cb4ca),console[_0x40ab84(0x1fb)](a49_0x9946cc['green'](_0x40ab84(0x1de))),0x0;if(existsSync(_0x1ec48b)&&statSync(_0x1ec48b)[_0x40ab84(0x1f0)]()){let _0x58b04c;try{_0x58b04c=findTdxConfig(_0x1ec48b);}catch{return console['error'](a49_0x9946cc[_0x40ab84(0x1f1)](_0x40ab84(0x203)+_0x1ec48b)),console['error'](a49_0x9946cc[_0x40ab84(0x1d1)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0xae59b6=_0x58b04c['config']['parent_segment'];return saveSessionContext({'segment_path':_0xae59b6,'parent_segment':_0xae59b6},_0x1cb4ca),console[_0x40ab84(0x1fb)](a49_0x9946cc['green'](_0x40ab84(0x1ee)+a49_0x9946cc[_0x40ab84(0x1d1)](_0xae59b6))),0x0;}const _0x1b6637=_0x206f21[_0x40ab84(0x1d9)];let _0xc287cd=_0x1ec48b;const _0x4a9824=parsePath(_0x1ec48b);if(!_0x4a9824[_0x40ab84(0x1e2)]){if(!_0x1b6637)return console[_0x40ab84(0x1ea)](a49_0x9946cc[_0x40ab84(0x1f1)](_0x40ab84(0x1f8))),console[_0x40ab84(0x1ea)](a49_0x9946cc[_0x40ab84(0x1d1)](_0x40ab84(0x1eb))),0x1;if(_0x1ec48b==='..'){const _0x28a309=_0x1b6637['split']('/')[_0x40ab84(0x1fa)](0x0,-0x1)[_0x40ab84(0x1e6)]('/');_0xc287cd=_0x28a309||'/';}else _0x1ec48b==='.'?_0xc287cd=_0x1b6637:_0xc287cd=_0x1b6637+'/'+_0x1ec48b;_0x206f21[_0x40ab84(0x201)]&&console[_0x40ab84(0x1ea)]('Resolved\x20relative\x20path\x20to:\x20'+_0xc287cd);}if(_0xc287cd==='/'||_0xc287cd==='')return saveSessionContext({'segment_path':undefined},_0x1cb4ca),console[_0x40ab84(0x1fb)](a49_0x9946cc[_0x40ab84(0x1da)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0xc287cd=normalizePath(_0xc287cd);const _0x32252a=parsePath(_0xc287cd)['segments'];if(_0x32252a[_0x40ab84(0x1db)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1cb4ca),console[_0x40ab84(0x1fb)](a49_0x9946cc['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x206f21[_0x40ab84(0x201)]&&(console[_0x40ab84(0x1ea)](_0x40ab84(0x1f2)+_0x206f21[_0x40ab84(0x1d6)]),console[_0x40ab84(0x1ea)](_0x40ab84(0x1f3)+_0xc287cd));const _0x1e655d=await withSpinner(_0x40ab84(0x1e4)+_0xc287cd+_0x40ab84(0x1ce),()=>_0x15a8e0[_0x40ab84(0x1e0)][_0x40ab84(0x1cf)](_0xc287cd),{'verbose':_0x206f21[_0x40ab84(0x201)]}),_0x89663a=_0x1e655d['data'];_0x206f21[_0x40ab84(0x201)]&&(console[_0x40ab84(0x1ea)](_0x40ab84(0x1d4)+_0x89663a['type']),console['error']('Parent\x20ID:\x20'+_0x89663a[_0x40ab84(0x1d3)]),_0x89663a[_0x40ab84(0x1f6)]&&console[_0x40ab84(0x1ea)](_0x40ab84(0x1f9)+_0x89663a['folderId']));if(_0x89663a[_0x40ab84(0x202)]===_0x40ab84(0x1e0))return console['error'](a49_0x9946cc['red'](_0x40ab84(0x1cd))),console[_0x40ab84(0x1ea)](_0x40ab84(0x1d8)),console[_0x40ab84(0x1ea)](a49_0x9946cc['cyan'](_0x40ab84(0x1e1)+_0x89663a[_0x40ab84(0x1fd)]+(_0x89663a[_0x40ab84(0x1e5)]?'/'+_0x89663a['folderPath'][_0x40ab84(0x1e6)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x89663a[_0x40ab84(0x1e8)],'parent_segment':_0x89663a[_0x40ab84(0x1fd)]},_0x1cb4ca),console['log'](a49_0x9946cc[_0x40ab84(0x1da)](_0x40ab84(0x1ee)+a49_0x9946cc[_0x40ab84(0x1d1)](_0x89663a[_0x40ab84(0x1e8)]))),_0x206f21[_0x40ab84(0x201)]&&(console[_0x40ab84(0x1ea)](a49_0x9946cc[_0x40ab84(0x1f4)](_0x40ab84(0x1f5))),console[_0x40ab84(0x1ea)](a49_0x9946cc[_0x40ab84(0x1f4)](_0x40ab84(0x1dc)))),0x0;}catch(_0x24e369){throw _0x24e369;}}}
@@ -1 +1 @@
1
- const a49_0x2b0b9f=a49_0xe30a;(function(_0x100a4c,_0x14d929){const _0x34a0c5=a49_0xe30a,_0x3d84cf=_0x100a4c();while(!![]){try{const _0x25747c=-parseInt(_0x34a0c5(0x127))/0x1*(parseInt(_0x34a0c5(0x14a))/0x2)+-parseInt(_0x34a0c5(0x13b))/0x3+parseInt(_0x34a0c5(0x129))/0x4*(-parseInt(_0x34a0c5(0x123))/0x5)+-parseInt(_0x34a0c5(0x140))/0x6*(-parseInt(_0x34a0c5(0x11b))/0x7)+-parseInt(_0x34a0c5(0x119))/0x8+-parseInt(_0x34a0c5(0x128))/0x9*(-parseInt(_0x34a0c5(0x147))/0xa)+parseInt(_0x34a0c5(0x13e))/0xb;if(_0x25747c===_0x14d929)break;else _0x3d84cf['push'](_0x3d84cf['shift']());}catch(_0x3de6e2){_0x3d84cf['push'](_0x3d84cf['shift']());}}}(a49_0x56f7,0x2f299));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a49_0x56f7(){const _0x259ceb=['\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','parentSegment','length','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','targetDir','green','574338lSqPRM','warningCount','cyan','5537565UjoZgW','endsWith','36pkApRB','.yml','Error:\x20','Validation\x20failed:\x20','warnings','Error:\x20Directory\x20not\x20found:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','590vWZwGT','\x20file(s)\x20valid','log','2WcfzXg','6464MIxfge','Validate\x20segment\x20and\x20journey\x20YAML\x20files','8561OugFOS','filePath','\x20warning(s)\x20found','valid','hasErrors','verbose','no_parent','message','11695CexVNX','helpText','red','.yaml','104001NzRhkS','43488xnVTbz','524mcWmxc','✔\x20All\x20','file','validCount','invalidCount','description','dim','name','\x20warning(s)','error','):\x20','yellow'];a49_0x56f7=function(){return _0x259ceb;};return a49_0x56f7();}function a49_0xe30a(_0x282b03,_0x4bb269){_0x282b03=_0x282b03-0x119;const _0x56f765=a49_0x56f7();let _0xe30a65=_0x56f765[_0x282b03];return _0xe30a65;}import a49_0x49ba06 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{[a49_0x2b0b9f(0x130)]='segment:validate';[a49_0x2b0b9f(0x12e)]=a49_0x2b0b9f(0x11a);async['execute'](_0x195401){const _0x203e24=a49_0x2b0b9f,{options:_0x29db19,args:_0x5872a8}=_0x195401,_0x57879b=_0x29db19,_0x2f7c65=await resolveTarget({'arg':_0x5872a8[0x0],'contextParent':_0x29db19[_0x203e24(0x136)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2f7c65))return _0x2f7c65['errorCode']===_0x203e24(0x121)?(console[_0x203e24(0x132)](a49_0x49ba06['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x203e24(0x132)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x203e24(0x132)](_0x203e24(0x135)),console[_0x203e24(0x132)](_0x203e24(0x146))):(console[_0x203e24(0x132)](a49_0x49ba06[_0x203e24(0x125)](_0x203e24(0x142)+_0x2f7c65[_0x203e24(0x122)]+'\x0a')),_0x2f7c65[_0x203e24(0x124)]&&console[_0x203e24(0x132)](a49_0x49ba06[_0x203e24(0x13d)](_0x2f7c65[_0x203e24(0x124)]))),0x1;const _0x518334=_0x2f7c65[_0x203e24(0x139)],_0x33928c=_0x2f7c65['type']===_0x203e24(0x12b)?_0x2f7c65[_0x203e24(0x11c)]:undefined;if(!_0x33928c&&!existsSync(_0x518334))return console[_0x203e24(0x132)](a49_0x49ba06['red'](_0x203e24(0x145)+_0x518334+'\x0a')),0x1;let _0x413668;if(_0x33928c){if(!_0x33928c[_0x203e24(0x13f)](_0x203e24(0x141))&&!_0x33928c[_0x203e24(0x13f)](_0x203e24(0x126)))return console[_0x203e24(0x132)](a49_0x49ba06[_0x203e24(0x125)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x33928c+'\x0a')),0x1;_0x413668=[_0x33928c];}else _0x413668=findYamlFiles(_0x518334);if(_0x413668[_0x203e24(0x137)]===0x0)return console['error'](a49_0x49ba06[_0x203e24(0x125)](_0x203e24(0x138)+_0x518334+'\x0a')),0x1;const _0x50fa22=validateYamlFiles(_0x413668,_0x518334),_0x5f165d=calculateSummary(_0x50fa22);for(const _0x27c87e of _0x50fa22){if(!isValidationResult(_0x27c87e))continue;const {relativePath:_0x50c3d3,source:_0x243c37,result:_0x1cd066,fileType:_0x365065}=_0x27c87e,_0x1264a4=_0x365065;if(_0x1cd066[_0x203e24(0x11e)]&&_0x1cd066[_0x203e24(0x144)][_0x203e24(0x137)]===0x0)_0x57879b[_0x203e24(0x120)]&&console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x13a)]('✔\x20'+_0x50c3d3)+a49_0x49ba06[_0x203e24(0x12f)]('\x20('+_0x1264a4+')'));else _0x1cd066[_0x203e24(0x11e)]?(console['log'](a49_0x49ba06['yellow']('⚠\x20'+_0x50c3d3)+a49_0x49ba06[_0x203e24(0x12f)]('\x20('+_0x1264a4+_0x203e24(0x133)+_0x1cd066[_0x203e24(0x144)][_0x203e24(0x137)]+_0x203e24(0x131))),console['log'](formatValidationResult(_0x1cd066,_0x243c37,_0x50c3d3))):(console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x125)]('✖\x20'+_0x50c3d3)+a49_0x49ba06[_0x203e24(0x12f)]('\x20('+_0x1264a4+_0x203e24(0x133)+_0x1cd066['errors']['length']+'\x20error(s)')),console['log'](formatValidationResult(_0x1cd066,_0x243c37,_0x50c3d3)));}return console[_0x203e24(0x149)](''),_0x5f165d[_0x203e24(0x11f)]?(console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x125)](_0x203e24(0x143)+_0x5f165d[_0x203e24(0x12d)]+'\x20file(s)\x20with\x20errors,\x20'+_0x5f165d[_0x203e24(0x12c)]+'\x20valid')),_0x5f165d[_0x203e24(0x13c)]>0x0&&console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x134)](_0x5f165d['warningCount']+'\x20warning(s)\x20found')),0x1):(console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x13a)](_0x203e24(0x12a)+_0x5f165d[_0x203e24(0x12c)]+_0x203e24(0x148))),_0x5f165d['warningCount']>0x0&&console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x134)](_0x5f165d[_0x203e24(0x13c)]+_0x203e24(0x11d))),0x0);}}
1
+ function a50_0x5be2(_0x29595a,_0x41ac97){_0x29595a=_0x29595a-0x1a1;const _0x4ede27=a50_0x4ede();let _0x5be289=_0x4ede27[_0x29595a];return _0x5be289;}const a50_0x1df10c=a50_0x5be2;(function(_0x4f7b3e,_0x422ac5){const _0x12fa72=a50_0x5be2,_0x128cb3=_0x4f7b3e();while(!![]){try{const _0x415321=-parseInt(_0x12fa72(0x1ca))/0x1*(-parseInt(_0x12fa72(0x1b2))/0x2)+parseInt(_0x12fa72(0x1bf))/0x3*(parseInt(_0x12fa72(0x1b6))/0x4)+parseInt(_0x12fa72(0x1d5))/0x5*(-parseInt(_0x12fa72(0x1bb))/0x6)+-parseInt(_0x12fa72(0x1b7))/0x7+parseInt(_0x12fa72(0x1b1))/0x8*(parseInt(_0x12fa72(0x1ae))/0x9)+parseInt(_0x12fa72(0x1d3))/0xa+-parseInt(_0x12fa72(0x1ba))/0xb*(parseInt(_0x12fa72(0x1bc))/0xc);if(_0x415321===_0x422ac5)break;else _0x128cb3['push'](_0x128cb3['shift']());}catch(_0x183c9f){_0x128cb3['push'](_0x128cb3['shift']());}}}(a50_0x4ede,0x63920));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a50_0x4ede(){const _0x223df2=['152VnZXen','Error:\x20','invalidCount','Error:\x20Directory\x20not\x20found:\x20','424324murPso','873306IjJdhM','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Validate\x20segment\x20and\x20journey\x20YAML\x20files','11NvRRGd','4404846pFWCIK','7298484jFPEep','✔\x20All\x20','log','15YalYLl','.yml','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','validCount','segment:validate','file','red','\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','):\x20','Validation\x20failed:\x20','endsWith','2272fovrBX','errors','type','error','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','\x20valid','message','length','4481830JeUOLL','cyan','5CIOSnA','description','warningCount','\x20error(s)','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','hasErrors','warnings','valid','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','errorCode','name','.yaml','green','verbose','\x20warning(s)\x20found','filePath','helpText','\x20file(s)\x20valid','3256587zuoPJc','execute','parentSegment','16AyWZaV'];a50_0x4ede=function(){return _0x223df2;};return a50_0x4ede();}import a50_0x1b5ebe 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{[a50_0x1df10c(0x1a6)]=a50_0x1df10c(0x1c3);[a50_0x1df10c(0x1d6)]=a50_0x1df10c(0x1b9);async[a50_0x1df10c(0x1af)](_0x4a7de1){const _0x5af4b4=a50_0x1df10c,{options:_0x2625db,args:_0x13b933}=_0x4a7de1,_0x413d43=_0x2625db,_0x21d1ae=await resolveTarget({'arg':_0x13b933[0x0],'contextParent':_0x2625db[_0x5af4b4(0x1b0)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x21d1ae))return _0x21d1ae[_0x5af4b4(0x1a5)]==='no_parent'?(console[_0x5af4b4(0x1cd)](a50_0x1b5ebe[_0x5af4b4(0x1cf)](_0x5af4b4(0x1a4))),console['error'](_0x5af4b4(0x1d9)),console[_0x5af4b4(0x1cd)](_0x5af4b4(0x1c6)),console['error'](_0x5af4b4(0x1b8))):(console[_0x5af4b4(0x1cd)](a50_0x1b5ebe[_0x5af4b4(0x1c5)](_0x5af4b4(0x1b3)+_0x21d1ae[_0x5af4b4(0x1d1)]+'\x0a')),_0x21d1ae[_0x5af4b4(0x1ac)]&&console[_0x5af4b4(0x1cd)](a50_0x1b5ebe[_0x5af4b4(0x1d4)](_0x21d1ae[_0x5af4b4(0x1ac)]))),0x1;const _0x20000d=_0x21d1ae['targetDir'],_0xf598b0=_0x21d1ae[_0x5af4b4(0x1cc)]===_0x5af4b4(0x1c4)?_0x21d1ae[_0x5af4b4(0x1ab)]:undefined;if(!_0xf598b0&&!existsSync(_0x20000d))return console[_0x5af4b4(0x1cd)](a50_0x1b5ebe[_0x5af4b4(0x1c5)](_0x5af4b4(0x1b5)+_0x20000d+'\x0a')),0x1;let _0x3e6b19;if(_0xf598b0){if(!_0xf598b0[_0x5af4b4(0x1c9)](_0x5af4b4(0x1c0))&&!_0xf598b0[_0x5af4b4(0x1c9)](_0x5af4b4(0x1a7)))return console['error'](a50_0x1b5ebe['red'](_0x5af4b4(0x1c1)+_0xf598b0+'\x0a')),0x1;_0x3e6b19=[_0xf598b0];}else _0x3e6b19=findYamlFiles(_0x20000d);if(_0x3e6b19['length']===0x0)return console[_0x5af4b4(0x1cd)](a50_0x1b5ebe['red'](_0x5af4b4(0x1ce)+_0x20000d+'\x0a')),0x1;const _0x4b0b10=validateYamlFiles(_0x3e6b19,_0x20000d),_0x35aebc=calculateSummary(_0x4b0b10);for(const _0x1fa69f of _0x4b0b10){if(!isValidationResult(_0x1fa69f))continue;const {relativePath:_0x2169ea,source:_0x2fccbc,result:_0x12066a,fileType:_0x16accc}=_0x1fa69f,_0x185ebb=_0x16accc;if(_0x12066a[_0x5af4b4(0x1a3)]&&_0x12066a[_0x5af4b4(0x1a2)][_0x5af4b4(0x1d2)]===0x0)_0x413d43[_0x5af4b4(0x1a9)]&&console[_0x5af4b4(0x1be)](a50_0x1b5ebe['green']('✔\x20'+_0x2169ea)+a50_0x1b5ebe['dim']('\x20('+_0x185ebb+')'));else _0x12066a[_0x5af4b4(0x1a3)]?(console[_0x5af4b4(0x1be)](a50_0x1b5ebe['yellow']('⚠\x20'+_0x2169ea)+a50_0x1b5ebe['dim']('\x20('+_0x185ebb+'):\x20'+_0x12066a[_0x5af4b4(0x1a2)][_0x5af4b4(0x1d2)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x12066a,_0x2fccbc,_0x2169ea))):(console[_0x5af4b4(0x1be)](a50_0x1b5ebe[_0x5af4b4(0x1c5)]('✖\x20'+_0x2169ea)+a50_0x1b5ebe['dim']('\x20('+_0x185ebb+_0x5af4b4(0x1c7)+_0x12066a[_0x5af4b4(0x1cb)][_0x5af4b4(0x1d2)]+_0x5af4b4(0x1d8))),console[_0x5af4b4(0x1be)](formatValidationResult(_0x12066a,_0x2fccbc,_0x2169ea)));}return console[_0x5af4b4(0x1be)](''),_0x35aebc[_0x5af4b4(0x1a1)]?(console[_0x5af4b4(0x1be)](a50_0x1b5ebe[_0x5af4b4(0x1c5)](_0x5af4b4(0x1c8)+_0x35aebc[_0x5af4b4(0x1b4)]+'\x20file(s)\x20with\x20errors,\x20'+_0x35aebc[_0x5af4b4(0x1c2)]+_0x5af4b4(0x1d0))),_0x35aebc[_0x5af4b4(0x1d7)]>0x0&&console[_0x5af4b4(0x1be)](a50_0x1b5ebe[_0x5af4b4(0x1cf)](_0x35aebc[_0x5af4b4(0x1d7)]+_0x5af4b4(0x1aa))),0x1):(console[_0x5af4b4(0x1be)](a50_0x1b5ebe[_0x5af4b4(0x1a8)](_0x5af4b4(0x1bd)+_0x35aebc[_0x5af4b4(0x1c2)]+_0x5af4b4(0x1ad))),_0x35aebc['warningCount']>0x0&&console[_0x5af4b4(0x1be)](a50_0x1b5ebe['yellow'](_0x35aebc[_0x5af4b4(0x1d7)]+_0x5af4b4(0x1aa))),0x0);}}