@treasuredata/tdx 0.9.4 → 0.9.5

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 (151) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/engage-api-client.js +1 -1
  9. package/dist/client/http-client.js +1 -1
  10. package/dist/client/llm-api-client.js +1 -1
  11. package/dist/client/rate-limiter.js +1 -1
  12. package/dist/client/td-api-client.d.ts +45 -1
  13. package/dist/client/td-api-client.d.ts.map +1 -1
  14. package/dist/client/td-api-client.js +1 -1
  15. package/dist/client/td-api-client.js.map +1 -1
  16. package/dist/client/trino-api-client.js +1 -1
  17. package/dist/client/workflow-client.js +1 -1
  18. package/dist/commands/activations.js +1 -1
  19. package/dist/commands/agent-command.js +1 -1
  20. package/dist/commands/api-command.js +1 -1
  21. package/dist/commands/auth-command.js +1 -1
  22. package/dist/commands/chat-command.js +1 -1
  23. package/dist/commands/claude-command.js +1 -1
  24. package/dist/commands/claude-statusline-command.js +1 -1
  25. package/dist/commands/claude-usage-command.js +1 -1
  26. package/dist/commands/command.js +1 -1
  27. package/dist/commands/connection-command.d.ts +35 -0
  28. package/dist/commands/connection-command.d.ts.map +1 -1
  29. package/dist/commands/connection-command.js +1 -1
  30. package/dist/commands/connection-command.js.map +1 -1
  31. package/dist/commands/context-command.js +1 -1
  32. package/dist/commands/databases.js +1 -1
  33. package/dist/commands/describe.js +1 -1
  34. package/dist/commands/engage-command.js +1 -1
  35. package/dist/commands/job-command.js +1 -1
  36. package/dist/commands/journey-command.d.ts.map +1 -1
  37. package/dist/commands/journey-command.js +1 -1
  38. package/dist/commands/journey-command.js.map +1 -1
  39. package/dist/commands/llm-command.js +1 -1
  40. package/dist/commands/llm-proxy.js +1 -1
  41. package/dist/commands/parent-segment-command.js +1 -1
  42. package/dist/commands/profiles-command.js +1 -1
  43. package/dist/commands/query-command.js +1 -1
  44. package/dist/commands/segment-command.js +1 -1
  45. package/dist/commands/segment-create-command.js +1 -1
  46. package/dist/commands/segment-fields-command.js +1 -1
  47. package/dist/commands/segment-pull-command.d.ts.map +1 -1
  48. package/dist/commands/segment-pull-command.js +1 -1
  49. package/dist/commands/segment-pull-command.js.map +1 -1
  50. package/dist/commands/segment-push-command.d.ts.map +1 -1
  51. package/dist/commands/segment-push-command.js +1 -1
  52. package/dist/commands/segment-push-command.js.map +1 -1
  53. package/dist/commands/segment-update-command.js +1 -1
  54. package/dist/commands/segment-use-command.js +1 -1
  55. package/dist/commands/segments.js +1 -1
  56. package/dist/commands/show.js +1 -1
  57. package/dist/commands/tables.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/workflow-command.js +1 -1
  61. package/dist/core/auth.js +1 -1
  62. package/dist/core/config.js +1 -1
  63. package/dist/core/connection-cache.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/index.js +1 -1
  72. package/dist/proxy/anthropic-adapter.js +1 -1
  73. package/dist/proxy/claude-usage-tracker.js +1 -1
  74. package/dist/proxy/context-signature.js +1 -1
  75. package/dist/proxy/conversation-utils.js +1 -1
  76. package/dist/proxy/server.js +1 -1
  77. package/dist/proxy/session-cache.js +1 -1
  78. package/dist/sdk/agent/agent-yaml.js +1 -1
  79. package/dist/sdk/api.js +1 -1
  80. package/dist/sdk/connection-validator.d.ts +119 -0
  81. package/dist/sdk/connection-validator.d.ts.map +1 -0
  82. package/dist/sdk/connection-validator.js +1 -0
  83. package/dist/sdk/connection-validator.js.map +1 -0
  84. package/dist/sdk/connection.d.ts +120 -1
  85. package/dist/sdk/connection.d.ts.map +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/connection.js.map +1 -1
  88. package/dist/sdk/engage.js +1 -1
  89. package/dist/sdk/errors.d.ts +4 -0
  90. package/dist/sdk/errors.d.ts.map +1 -1
  91. package/dist/sdk/errors.js +1 -1
  92. package/dist/sdk/errors.js.map +1 -1
  93. package/dist/sdk/index.js +1 -1
  94. package/dist/sdk/job.js +1 -1
  95. package/dist/sdk/journey.js +1 -1
  96. package/dist/sdk/llm.js +1 -1
  97. package/dist/sdk/query.js +1 -1
  98. package/dist/sdk/segment/child-segment-yaml.d.ts +22 -6
  99. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  100. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  101. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  102. package/dist/sdk/segment/journey-yaml.js +1 -1
  103. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  104. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  105. package/dist/sdk/segment.js +1 -1
  106. package/dist/sdk/user.js +1 -1
  107. package/dist/sdk/workflow.js +1 -1
  108. package/dist/types/connector-schema.d.ts +182 -0
  109. package/dist/types/connector-schema.d.ts.map +1 -0
  110. package/dist/types/connector-schema.js +1 -0
  111. package/dist/types/connector-schema.js.map +1 -0
  112. package/dist/types/endpoints.js +1 -1
  113. package/dist/types/index.d.ts +2 -0
  114. package/dist/types/index.d.ts.map +1 -1
  115. package/dist/types/index.js +1 -1
  116. package/dist/utils/agent-config.js +1 -1
  117. package/dist/utils/agent-ref-parser.js +1 -1
  118. package/dist/utils/async.js +1 -1
  119. package/dist/utils/chat-cache.js +1 -1
  120. package/dist/utils/colors.js +1 -1
  121. package/dist/utils/command-output.js +1 -1
  122. package/dist/utils/constants.js +1 -1
  123. package/dist/utils/diff.js +1 -1
  124. package/dist/utils/fields-display.js +1 -1
  125. package/dist/utils/file-permissions.js +1 -1
  126. package/dist/utils/format-detector.js +1 -1
  127. package/dist/utils/formatters.js +1 -1
  128. package/dist/utils/journey-utils.d.ts.map +1 -1
  129. package/dist/utils/journey-utils.js +1 -1
  130. package/dist/utils/journey-utils.js.map +1 -1
  131. package/dist/utils/json-loader.js +1 -1
  132. package/dist/utils/llm-backup-utils.js +1 -1
  133. package/dist/utils/model-aliases.js +1 -1
  134. package/dist/utils/model-factors.js +1 -1
  135. package/dist/utils/option-validation.js +1 -1
  136. package/dist/utils/port.js +1 -1
  137. package/dist/utils/process.js +1 -1
  138. package/dist/utils/prompt.js +1 -1
  139. package/dist/utils/segment-path-parser.js +1 -1
  140. package/dist/utils/segment-ref-parser.js +1 -1
  141. package/dist/utils/spinner.js +1 -1
  142. package/dist/utils/sql-parser.js +1 -1
  143. package/dist/utils/sse-parser.js +1 -1
  144. package/dist/utils/string-utils.js +1 -1
  145. package/dist/utils/table-ref-parser.js +1 -1
  146. package/dist/utils/tdx-config.js +1 -1
  147. package/dist/utils/tdx-logger.js +1 -1
  148. package/dist/utils/tree-formatter.js +1 -1
  149. package/dist/utils/version-check.js +1 -1
  150. package/dist/utils/workflow-utils.js +1 -1
  151. package/package.json +1 -1
@@ -1 +1 @@
1
- const a34_0x20baed=a34_0x1638;function a34_0x1638(_0x16506d,_0x5262c2){_0x16506d=_0x16506d-0x16b;const _0x1a6e60=a34_0x1a6e();let _0x1638ed=_0x1a6e60[_0x16506d];return _0x1638ed;}(function(_0x1e38d6,_0x2988dd){const _0x44b83b=a34_0x1638,_0x15d2c6=_0x1e38d6();while(!![]){try{const _0x341bbb=-parseInt(_0x44b83b(0x16b))/0x1+parseInt(_0x44b83b(0x16d))/0x2+-parseInt(_0x44b83b(0x188))/0x3*(parseInt(_0x44b83b(0x187))/0x4)+parseInt(_0x44b83b(0x171))/0x5*(parseInt(_0x44b83b(0x179))/0x6)+parseInt(_0x44b83b(0x17b))/0x7+parseInt(_0x44b83b(0x184))/0x8*(-parseInt(_0x44b83b(0x176))/0x9)+-parseInt(_0x44b83b(0x182))/0xa*(-parseInt(_0x44b83b(0x17c))/0xb);if(_0x341bbb===_0x2988dd)break;else _0x15d2c6['push'](_0x15d2c6['shift']());}catch(_0x566d36){_0x15d2c6['push'](_0x15d2c6['shift']());}}}(a34_0x1a6e,0x55985));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';function a34_0x1a6e(){const _0x27cb51=['564745UUfIWK','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','1018032fewoKU','description','\x27...','site','3154885vNSoVu','verbose','execute','json','\x20field','171WgTTUQ','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Error:\x20Parent\x20segment\x20name\x20is\x20required','6EpcEsf','segment','2068388BoPYzw','5522UxiZux','length','Listing\x20fields\x20for\x20\x27','List\x20available\x20fields\x20for\x20segmentation','segment:fields','parentSegment','2710XyJDuO','jsonl','32088PeLpoY','name','listFields','36248TvnoXE','192szAnaf','error'];a34_0x1a6e=function(){return _0x27cb51;};return a34_0x1a6e();}export class SegmentFieldsCommand extends BaseCommand{[a34_0x20baed(0x185)]=a34_0x20baed(0x180);[a34_0x20baed(0x16e)]=a34_0x20baed(0x17f);async[a34_0x20baed(0x173)](_0x57f3b5){const _0x2e0442=a34_0x20baed,{options:_0x513a6,args:_0x59de52,tdx:_0x14016a}=_0x57f3b5,_0x3ca96=_0x59de52[0x0]||_0x513a6[_0x2e0442(0x181)];if(!_0x3ca96)return console[_0x2e0442(0x189)](_0x2e0442(0x178)),console[_0x2e0442(0x189)](_0x2e0442(0x177)),console[_0x2e0442(0x189)](_0x2e0442(0x16c)),0x1;_0x513a6[_0x2e0442(0x172)]&&(console[_0x2e0442(0x189)]('Site:\x20'+_0x513a6[_0x2e0442(0x170)]),console['error']('Parent\x20segment:\x20'+_0x3ca96));const _0x242980=await withSpinner(_0x2e0442(0x17e)+_0x3ca96+_0x2e0442(0x16f),()=>_0x14016a[_0x2e0442(0x17a)][_0x2e0442(0x186)](_0x3ca96),{'verbose':_0x513a6[_0x2e0442(0x172)]}),_0x54afe4=_0x242980['data'];console[_0x2e0442(0x189)]('✔\x20Found\x20'+_0x54afe4[_0x2e0442(0x17d)]+_0x2e0442(0x175)+(_0x54afe4[_0x2e0442(0x17d)]!==0x1?'s':''));if(_0x513a6[_0x2e0442(0x174)]||_0x513a6[_0x2e0442(0x183)])return await handleSDKOutput(_0x54afe4,_0x513a6),0x0;return displayFieldsHumanReadable(_0x54afe4,_0x3ca96),0x0;}}
1
+ const a34_0x5b4f10=a34_0x1576;(function(_0xa378a7,_0x500b5c){const _0x248861=a34_0x1576,_0x534ee8=_0xa378a7();while(!![]){try{const _0x5c6421=-parseInt(_0x248861(0x96))/0x1+-parseInt(_0x248861(0x9c))/0x2+parseInt(_0x248861(0x8b))/0x3+parseInt(_0x248861(0x9d))/0x4*(parseInt(_0x248861(0xa3))/0x5)+parseInt(_0x248861(0xa6))/0x6*(parseInt(_0x248861(0x94))/0x7)+-parseInt(_0x248861(0x8d))/0x8*(-parseInt(_0x248861(0x8e))/0x9)+parseInt(_0x248861(0x91))/0xa*(-parseInt(_0x248861(0x97))/0xb);if(_0x5c6421===_0x500b5c)break;else _0x534ee8['push'](_0x534ee8['shift']());}catch(_0x36e8d6){_0x534ee8['push'](_0x534ee8['shift']());}}}(a34_0xaebd,0x21195));function a34_0x1576(_0x3c6be7,_0x57e0b6){_0x3c6be7=_0x3c6be7-0x8b;const _0xaebd73=a34_0xaebd();let _0x157628=_0xaebd73[_0x3c6be7];return _0x157628;}function a34_0xaebd(){const _0x17340e=['Listing\x20fields\x20for\x20\x27','1434tAVNlv','274743CUbvXD','site','488qxmhlg','17883LvRMmb','name','verbose','870wtPOGc','segment:fields','description','3920MdvpHa','data','204882gjdmev','17193fJwlEE','length','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Parent\x20segment:\x20','execute','110754hiCTnP','4004yWREPi','\x27...','List\x20available\x20fields\x20for\x20segmentation','json','Site:\x20','parentSegment','925JoVmYN','error'];a34_0xaebd=function(){return _0x17340e;};return a34_0xaebd();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a34_0x5b4f10(0x8f)]=a34_0x5b4f10(0x92);[a34_0x5b4f10(0x93)]=a34_0x5b4f10(0x9f);async[a34_0x5b4f10(0x9b)](_0xfb0331){const _0x3b1bf9=a34_0x5b4f10,{options:_0x448706,args:_0x25f0b5,tdx:_0x2768ca}=_0xfb0331,_0x11bc09=_0x25f0b5[0x0]||_0x448706[_0x3b1bf9(0xa2)];if(!_0x11bc09)return console[_0x3b1bf9(0xa4)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x3b1bf9(0x99)),console[_0x3b1bf9(0xa4)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x448706['verbose']&&(console['error'](_0x3b1bf9(0xa1)+_0x448706[_0x3b1bf9(0x8c)]),console['error'](_0x3b1bf9(0x9a)+_0x11bc09));const _0x25a47b=await withSpinner(_0x3b1bf9(0xa5)+_0x11bc09+_0x3b1bf9(0x9e),()=>_0x2768ca['segment']['listFields'](_0x11bc09),{'verbose':_0x448706[_0x3b1bf9(0x90)]}),_0x2f7d20=_0x25a47b[_0x3b1bf9(0x95)];console[_0x3b1bf9(0xa4)]('✔\x20Found\x20'+_0x2f7d20[_0x3b1bf9(0x98)]+'\x20field'+(_0x2f7d20[_0x3b1bf9(0x98)]!==0x1?'s':''));if(_0x448706[_0x3b1bf9(0xa0)]||_0x448706['jsonl'])return await handleSDKOutput(_0x2f7d20,_0x448706),0x0;return displayFieldsHumanReadable(_0x2f7d20,_0x11bc09),0x0;}}
@@ -1 +1 @@
1
- {"version":3,"file":"segment-pull-command.d.ts","sourceRoot":"","sources":["../../src/commands/segment-pull-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAqDhE;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,oDAAoD;IAElE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmiBxD"}
1
+ {"version":3,"file":"segment-pull-command.d.ts","sourceRoot":"","sources":["../../src/commands/segment-pull-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAsDhE;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,oDAAoD;IAElE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAqiBxD"}
@@ -1 +1 @@
1
- const a35_0x3aadc2=a35_0x6691;function a35_0x6691(_0x338e4f,_0x3facf7){_0x338e4f=_0x338e4f-0xd1;const _0x37b0bc=a35_0x37b0();let _0x669193=_0x37b0bc[_0x338e4f];return _0x669193;}(function(_0x3ec8be,_0x2188b4){const _0x5314e6=a35_0x6691,_0xb98255=_0x3ec8be();while(!![]){try{const _0x230d47=parseInt(_0x5314e6(0xe3))/0x1*(parseInt(_0x5314e6(0xfc))/0x2)+-parseInt(_0x5314e6(0xd8))/0x3+parseInt(_0x5314e6(0x12d))/0x4+-parseInt(_0x5314e6(0x125))/0x5+parseInt(_0x5314e6(0x102))/0x6*(parseInt(_0x5314e6(0x110))/0x7)+parseInt(_0x5314e6(0x116))/0x8*(-parseInt(_0x5314e6(0x131))/0x9)+parseInt(_0x5314e6(0x142))/0xa;if(_0x230d47===_0x2188b4)break;else _0xb98255['push'](_0xb98255['shift']());}catch(_0x57fe74){_0xb98255['push'](_0xb98255['shift']());}}}(a35_0x37b0,0xf03cc));import{BaseCommand}from'./command.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';import{apiToYamlAsync,toYamlString as a35_0x574df3}from'../sdk/segment/journey-yaml.js';import a35_0x5d72ef from'chalk';import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a35_0x5ecdff from'path';function a35_0x37b0(){const _0xfe4e2f=['8764410CELsDz','Write\x20','yaml','utf-8','setExtra','set','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','relativePath','\x20=\x20','description','✔\x20All\x20files\x20are\x20up\x20to\x20date','map','journeyBundleId','7AyKaoJ','attributes','getJourney','parent_segment','Found\x20tdx.json\x20at:\x20','listActivations','2472omiTcB','message','from','journeyBundleName','yellow','\x20\x20Target:\x20','hasChanges','Fetching\x20journey\x20\x27','\x20with\x20','parentFolderId','values','\x20changed\x20files','listSegments','data','\x20\x20🎯\x20','6738540pISGLN','\x20unchanged\x20files','\x20versions)','dirname','\x20segments','getSegment','✔\x20Pulled\x20','execute','3458872BzmDYs','segmentFolderId','\x0aPull\x20summary\x20for\x20\x27','isNew','54099rZuUBX','kind','reduce','add','session','filter','name','diff','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)','Fetching\x20segments...','Resolving\x20parent\x20segment\x20\x27','push','rule','dim','Fetching\x20journeys...','then','connection','17085090wNjrsH','parentSegment','setPhase','Site:\x20','length','journey','repeat','\x20new\x20files','\x20\x20🗺️\x20\x20','folderId','red','Aborted.','size','\x20journeys','segment','3910653bGKyZJ','resolveParentId','audienceId','getActivation','dryRun','verbose','user','Fetching\x20parent\x20segment\x20info...','Fetching\x20folders...','green','join','486236wsASfQ','Resolved\x20parent\x20name:\x20','getParent','\x20files?','get','tdx.json','absolutePath','cyan','error','Fetching\x20connections\x20for\x20name\x20resolution...','Using\x20parent\x20segment:\x20','listJourneysFromParentSegment','Fetching\x20activations...','Processing\x20journeys...','buildIdToNameMap','slice','Fetching\x20users\x20for\x20email\x20resolution...','relative','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','sort','Warning:\x20Could\x20not\x20resolve\x20activation\x20','listFolders','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aChanges\x20to\x20\x27','isDirectory','6YylJGx','versionNumber','Parent\x20segment:\x20','✔\x20Context\x20set:\x20','all','has'];a35_0x37b0=function(){return _0xfe4e2f;};return a35_0x37b0();}import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{[a35_0x3aadc2(0x137)]='segment:pull';[a35_0x3aadc2(0x10c)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a35_0x3aadc2(0x12c)](_0x333d72){const _0x8d2583=a35_0x3aadc2,{options:_0x1eeaa9,args:_0x5a2141,tdx:_0x4b3379}=_0x333d72,_0x3ae9bb=_0x1eeaa9,_0x53b855=_0x1eeaa9[_0x8d2583(0x143)],_0x214f8f=_0x5a2141[0x0],_0x294bee=findTdxConfigPath();let _0x3b5334,_0x1f44cf;if(!_0x214f8f&&_0x294bee){const _0xabf35d=loadTdxConfig(_0x294bee);_0x3b5334=_0xabf35d[_0x8d2583(0x113)],_0x1f44cf=a35_0x5ecdff[_0x8d2583(0x128)](_0x294bee),_0x3ae9bb[_0x8d2583(0xdd)]&&(console[_0x8d2583(0xeb)]('Found\x20existing\x20tdx.json\x20at:\x20'+_0x294bee),console[_0x8d2583(0xeb)](_0x8d2583(0xed)+_0x3b5334));}else{if(_0x214f8f){if(existsSync(_0x214f8f)&&statSync(_0x214f8f)[_0x8d2583(0xfb)]()){const _0x3b187c=findTdxConfigPath(_0x214f8f);if(_0x3b187c){const _0x255ca2=loadTdxConfig(_0x3b187c);_0x3b5334=_0x255ca2[_0x8d2583(0x113)],_0x1f44cf=a35_0x5ecdff[_0x8d2583(0x128)](_0x3b187c),_0x3ae9bb[_0x8d2583(0xdd)]&&(console[_0x8d2583(0xeb)](_0x8d2583(0x114)+_0x3b187c),console[_0x8d2583(0xeb)](_0x8d2583(0xed)+_0x3b5334));}else return console[_0x8d2583(0xeb)](a35_0x5d72ef[_0x8d2583(0xd3)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x214f8f+'\x0a')),console['error'](a35_0x5d72ef[_0x8d2583(0xea)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}else _0x3b5334=_0x214f8f;}else _0x3b5334=_0x53b855;}if(!_0x3b5334)return console[_0x8d2583(0xeb)](a35_0x5d72ef[_0x8d2583(0x11a)](_0x8d2583(0xf9))),console[_0x8d2583(0xeb)](_0x8d2583(0x139)),console[_0x8d2583(0xeb)](_0x8d2583(0x109)),console[_0x8d2583(0xeb)](_0x8d2583(0xf5)),0x1;_0x3ae9bb[_0x8d2583(0xdd)]&&(console['error'](_0x8d2583(0x145)+_0x3ae9bb['site']),console[_0x8d2583(0xeb)](_0x8d2583(0xfe)+_0x3b5334));const _0x5f33dd=await withSpinner(_0x8d2583(0x13b)+_0x3b5334+'\x27...',()=>_0x4b3379[_0x8d2583(0xd7)][_0x8d2583(0xd9)](_0x3b5334),{'verbose':_0x3ae9bb[_0x8d2583(0xdd)]}),_0x227700=_0x5f33dd[_0x8d2583(0x123)],_0x1a1d8d=await withSpinner(_0x8d2583(0xdf),()=>_0x4b3379['segment'][_0x8d2583(0xe5)](_0x227700),{'verbose':_0x3ae9bb['verbose']}),_0x57e0b5=_0x1a1d8d[_0x8d2583(0x123)][_0x8d2583(0x111)][_0x8d2583(0x137)];_0x3ae9bb[_0x8d2583(0xdd)]&&console[_0x8d2583(0xeb)](_0x8d2583(0xe4)+_0x57e0b5);const [_0x1d49fc,_0x22c6bf,_0x5456b6]=await Promise['all']([withSpinner(_0x8d2583(0x13a),()=>_0x4b3379[_0x8d2583(0xd7)][_0x8d2583(0x122)](_0x227700),{'verbose':_0x3ae9bb[_0x8d2583(0xdd)]}),withSpinner(_0x8d2583(0xe0),()=>_0x4b3379['segment'][_0x8d2583(0xf8)](_0x227700),{'verbose':_0x3ae9bb[_0x8d2583(0xdd)]}),withSpinner(_0x8d2583(0x13f),()=>_0x4b3379[_0x8d2583(0x147)][_0x8d2583(0xee)](_0x227700),{'verbose':_0x3ae9bb['verbose']})]),_0x593be9=_0x1d49fc[_0x8d2583(0x123)],_0x34b191=_0x22c6bf['data'],_0x4370f1=_0x5456b6[_0x8d2583(0x123)];if(_0x593be9[_0x8d2583(0x146)]===0x0&&_0x4370f1['length']===0x0)return console[_0x8d2583(0xeb)](a35_0x5d72ef[_0x8d2583(0x11a)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x57e0b5+'\x27')),0x0;const _0xd20299=buildFolderPathMap(_0x34b191),_0x414034=_0x1f44cf||getSegmentRootDir(sanitizeFileName(_0x3b5334)),_0x33df80=new Map();await withSpinner(_0x8d2583(0xef),async()=>{await batchAsync(_0x593be9,async _0x5aff9b=>{const _0x3b99bd=a35_0x6691,_0x5ef2d9=await _0x4b3379[_0x3b99bd(0xd7)][_0x3b99bd(0x115)](_0x227700,_0x5aff9b['id']);_0x33df80['set'](_0x5aff9b['id'],_0x5ef2d9);});},{'verbose':_0x3ae9bb[_0x8d2583(0xdd)]});const _0x3bade8=await withSpinner(_0x8d2583(0xf3),()=>_0x4b3379[_0x8d2583(0xde)]['buildIdToEmailMap'](),{'verbose':_0x3ae9bb['verbose']})[_0x8d2583(0x140)](_0x40f52b=>_0x40f52b[_0x8d2583(0x123)]),_0x264f01=await withSpinner(_0x8d2583(0xec),()=>_0x4b3379[_0x8d2583(0x141)][_0x8d2583(0xf1)](),{'verbose':_0x3ae9bb['verbose']})[_0x8d2583(0x140)](_0x1e1e50=>_0x1e1e50['data']),_0xf9b3fc=[],_0x4b2c71=a35_0x5ecdff[_0x8d2583(0xe2)](_0x414034,_0x8d2583(0xe8)),_0x34b319=createTdxConfigContent(_0x57e0b5);_0xf9b3fc[_0x8d2583(0x13c)](prepareFile(_0x4b2c71,_0x34b319,_0x414034));const _0x4fb30f=new Map();for(const _0x15705d of _0x593be9){if(_0x15705d['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x5d1583=_0x15705d[_0x8d2583(0x12e)]?_0xd20299['get'](_0x15705d[_0x8d2583(0x12e)])||'':'',_0x43fd0a=_0x33df80[_0x8d2583(0xe7)](_0x15705d['id'])||[],_0x47bf0d=segmentWithActivationsToYaml(_0x15705d,_0x43fd0a,undefined,_0x3bade8,_0x264f01),_0x50d22c=_0x5d1583?a35_0x5ecdff[_0x8d2583(0xe2)](_0x414034,_0x5d1583):_0x414034,_0x17031a=sanitizeFileName(_0x15705d[_0x8d2583(0x137)]),_0x193fc3=getUniqueFileName(_0x50d22c,_0x17031a,_0x4fb30f),_0x17bac9=a35_0x5ecdff[_0x8d2583(0xe2)](_0x50d22c,_0x193fc3+'.yml'),_0x1dfb70=segmentToYamlString(_0x47bf0d);_0xf9b3fc[_0x8d2583(0x13c)](prepareFile(_0x17bac9,_0x1dfb70,_0x414034));}const _0x35cc4d=new Map();for(const _0x2010ce of _0x593be9){_0x35cc4d[_0x8d2583(0x107)](_0x2010ce['id'],_0x2010ce);}const _0x1573b8=new Map();for(const _0x12484a of _0x4370f1){const _0xec1ed9=_0x12484a[_0x8d2583(0x10f)];!_0x1573b8[_0x8d2583(0x101)](_0xec1ed9)&&_0x1573b8['set'](_0xec1ed9,[]),_0x1573b8[_0x8d2583(0xe7)](_0xec1ed9)[_0x8d2583(0x13c)](_0x12484a);}for(const _0xe36f7 of _0x1573b8['values']()){_0xe36f7[_0x8d2583(0xf6)]((_0x99ef44,_0x342b9a)=>(_0x99ef44[_0x8d2583(0xfd)]||0x0)-(_0x342b9a[_0x8d2583(0xfd)]||0x0));}const _0x2c0139=()=>{const _0x5455b8=_0x8d2583,_0x4d1188=new Set(),_0x2ca38a=new Set(),_0x285616=new Map(),_0x40c222=new Map(),_0x5a8ee0=createJumpTargetCache(),_0xf4a637=(_0x446b02,_0x371d67)=>({'resolveSegment':async _0x1decff=>{const _0xe47707=a35_0x6691,_0x2ce2b2=_0x285616[_0xe47707(0xe7)](_0x1decff);if(_0x2ce2b2!==undefined)return{'name':_0x2ce2b2,'isJourneyLocal':!![]};if(!_0x371d67)return{'name':_0x1decff,'isJourneyLocal':![]};try{let _0x29fbab=_0x35cc4d['get'](_0x1decff);!_0x29fbab&&(_0x29fbab=await _0x4b3379[_0xe47707(0xd7)][_0xe47707(0x12a)](_0x371d67,_0x1decff));const _0x2776e3=generateJourneyLocalName(_0x29fbab[_0xe47707(0x137)]),_0x340df4=_0x29fbab[_0xe47707(0x132)]===SEGMENT_KIND_JOURNEY&&_0x2776e3!==undefined;let _0x56d912=_0x29fbab[_0xe47707(0x137)];if(_0x340df4&&_0x2776e3){let _0x5ba600=_0x2776e3,_0x4e1d16=0x2;while(_0x4d1188[_0xe47707(0x101)](_0x5ba600)){_0x5ba600=_0x2776e3+'_'+_0x4e1d16,_0x4e1d16++;}_0x4d1188[_0xe47707(0x134)](_0x5ba600),_0x56d912=_0x5ba600,_0x285616[_0xe47707(0x107)](_0x1decff,_0x56d912);}let _0x1e2cc6;return _0x340df4&&_0x29fbab['rule']&&(_0x1e2cc6={'description':_0x29fbab['description'],'rule':apiRuleToYaml(_0x29fbab[_0xe47707(0x13d)])}),{'name':_0x56d912,'isJourneyLocal':_0x340df4,'definition':_0x1e2cc6};}catch(_0xe99377){return _0x3ae9bb['verbose']&&console[_0xe47707(0xeb)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x1decff+':\x20'+_0xe99377[_0xe47707(0x117)]),{'name':_0x1decff,'isJourneyLocal':![]};}},'resolveActivation':async _0x564b52=>{const _0x4100d9=a35_0x6691,_0x459a87=_0x40c222[_0x4100d9(0xe7)](_0x564b52);if(_0x459a87!==undefined)return{'name':_0x459a87,'isJourneyLocal':!![]};try{const _0x343bd3=await _0x4b3379[_0x4100d9(0x147)][_0x4100d9(0xdb)](_0x446b02,_0x564b52),_0x2f84da=_0x343bd3[_0x4100d9(0x111)]['activationParams'][_0x4100d9(0x137)]||_0x564b52,_0x4b76d2=sanitizeYamlKey(_0x2f84da)||'activation_'+_0x564b52;let _0x471b0f=_0x4b76d2,_0x50d354=0x2;while(_0x2ca38a['has'](_0x471b0f)){_0x471b0f=_0x4b76d2+'_'+_0x50d354,_0x50d354++;}_0x2ca38a[_0x4100d9(0x134)](_0x471b0f),_0x40c222[_0x4100d9(0x107)](_0x564b52,_0x471b0f);const _0x4673ad=journeyActivationStepToYaml(_0x343bd3,_0x3bade8,_0x264f01);return{'name':_0x471b0f,'isJourneyLocal':!![],'definition':_0x4673ad};}catch(_0x44aa0a){return _0x3ae9bb[_0x4100d9(0xdd)]&&console['error'](_0x4100d9(0xf7)+_0x564b52+':\x20'+_0x44aa0a[_0x4100d9(0x117)]),{'name':_0x564b52,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xd4e5f4,_0x2bb58a)=>resolveJumpTarget(_0xd4e5f4,_0x2bb58a,_0x5a8ee0,_0x156ffd=>_0x4b3379[_0x5455b8(0x147)][_0x5455b8(0x112)](_0x156ffd))});return{'createYamlContext':_0xf4a637};};if(_0x1573b8[_0x8d2583(0xd5)]>0x0){const _0x35c0d5=Array[_0x8d2583(0x118)](_0x1573b8[_0x8d2583(0x120)]()),_0x5d1d25=await withQuerySpinner(_0x8d2583(0xf0),async _0x58490c=>{const _0xbaf7d4=_0x8d2583,_0x34b3dd=[];let _0x1bb73d=0x0;const _0x1c76ff=0x5;for(let _0x31f330=0x0;_0x31f330<_0x35c0d5[_0xbaf7d4(0x146)];_0x31f330+=_0x1c76ff){const _0x262f7e=_0x35c0d5[_0xbaf7d4(0xf2)](_0x31f330,_0x31f330+_0x1c76ff),_0x5d4ac3=await Promise[_0xbaf7d4(0x100)](_0x262f7e[_0xbaf7d4(0x10e)](async _0x3a4942=>{const _0x57bbb1=_0xbaf7d4,_0x481586=_0x3a4942[0x0],_0x189246=_0x481586[_0x57bbb1(0x119)];_0x58490c[_0x57bbb1(0x144)](_0x57bbb1(0x11d)+_0x189246+'\x27');const _0x1df476=_0x481586[_0x57bbb1(0xd2)]?_0xd20299[_0x57bbb1(0xe7)](_0x481586['folderId'])||'':'',{createYamlContext:_0xf039c8}=_0x2c0139(),_0x1d6cdf=[];for(const _0x5377b3 of _0x3a4942){const _0x40d2ec=await _0x4b3379[_0x57bbb1(0x147)][_0x57bbb1(0x112)](_0x5377b3['id']),_0x439dc6=_0x40d2ec['attributes']?.[_0x57bbb1(0xda)],_0x5d1f7c=_0xf039c8(_0x5377b3['id'],_0x439dc6),_0xf83c86=await apiToYamlAsync(_0x40d2ec,_0x5d1f7c);_0x1d6cdf['push']({'item':_0x5377b3,'yaml':_0xf83c86});}let _0x5c929f;return _0x1d6cdf[_0x57bbb1(0x146)]===0x1?_0x5c929f=_0x1d6cdf[0x0][_0x57bbb1(0x104)]:_0x5c929f=buildMergedJourneyYaml(_0x1d6cdf),{'bundleName':_0x189246,'folderPath':_0x1df476,'finalYaml':_0x5c929f};}));_0x34b3dd['push'](..._0x5d4ac3),_0x1bb73d+=_0x262f7e[_0xbaf7d4(0x146)],_0x58490c[_0xbaf7d4(0x106)]('('+_0x1bb73d+'/'+_0x35c0d5[_0xbaf7d4(0x146)]+')');}return _0x34b3dd;},{'verbose':_0x3ae9bb[_0x8d2583(0xdd)]});for(const {bundleName:_0x5e4540,folderPath:_0x49e039,finalYaml:_0x4119e1}of _0x5d1d25[_0x8d2583(0x123)]){const _0x43820d=a35_0x574df3(_0x4119e1),_0x11e627=_0x49e039?a35_0x5ecdff['join'](_0x414034,_0x49e039):_0x414034,_0x360e58=sanitizeFileName(_0x5e4540),_0x170fc5=getUniqueFileName(_0x11e627,_0x360e58,_0x4fb30f),_0x2206a5=a35_0x5ecdff[_0x8d2583(0xe2)](_0x11e627,_0x170fc5+'.yml');_0xf9b3fc[_0x8d2583(0x13c)](prepareFile(_0x2206a5,_0x43820d,_0x414034));}}const _0x3171ea=Array[_0x8d2583(0x118)](_0x33df80[_0x8d2583(0x120)]())[_0x8d2583(0x133)]((_0x1daf56,_0x2fc434)=>_0x1daf56+_0x2fc434[_0x8d2583(0x146)],0x0),_0x4fde8f=_0xf9b3fc[_0x8d2583(0x136)](_0x5b307a=>_0x5b307a['isNew']),_0x44f63f=_0xf9b3fc['filter'](_0x30728b=>!_0x30728b[_0x8d2583(0x130)]&&_0x30728b['hasChanges']),_0x2e6ba2=_0xf9b3fc['filter'](_0x3598f0=>!_0x3598f0[_0x8d2583(0x130)]&&!_0x3598f0[_0x8d2583(0x11c)]),_0x490186=_0x593be9[_0x8d2583(0x136)](_0x254017=>_0x254017['kind']!==SEGMENT_KIND_JOURNEY);console[_0x8d2583(0xeb)](_0x8d2583(0x12f)+_0x57e0b5+'\x27:'),console['error'](_0x8d2583(0x124)+a35_0x5d72ef[_0x8d2583(0xea)](_0x490186[_0x8d2583(0x146)]+_0x8d2583(0x129))+_0x8d2583(0x11e)+a35_0x5d72ef[_0x8d2583(0xea)](_0x3171ea+'\x20activations'));if(_0x1573b8['size']>0x0){const _0x2bdd65=_0x4370f1['length'],_0x2117bf=_0x1573b8[_0x8d2583(0xd5)],_0x117f6e=_0x2bdd65>_0x2117bf?'\x20('+_0x2bdd65+_0x8d2583(0x127):'';console[_0x8d2583(0xeb)](_0x8d2583(0xd1)+a35_0x5d72ef[_0x8d2583(0xea)](_0x2117bf+_0x8d2583(0xd6))+a35_0x5d72ef['dim'](_0x117f6e));}console[_0x8d2583(0xeb)]('\x20\x20'+a35_0x5d72ef[_0x8d2583(0xe1)]('+\x20'+_0x4fde8f[_0x8d2583(0x146)]+_0x8d2583(0x149))),console['error']('\x20\x20'+a35_0x5d72ef[_0x8d2583(0x11a)]('~\x20'+_0x44f63f[_0x8d2583(0x146)]+_0x8d2583(0x121))),console[_0x8d2583(0xeb)]('\x20\x20'+a35_0x5d72ef[_0x8d2583(0x13e)]('=\x20'+_0x2e6ba2[_0x8d2583(0x146)]+_0x8d2583(0x126))),console[_0x8d2583(0xeb)](_0x8d2583(0x11b)+a35_0x5d72ef[_0x8d2583(0xea)](_0x414034)+'\x0a');if(_0x44f63f['length']>0x0)for(const _0x2f0cc7 of _0x44f63f){console[_0x8d2583(0xeb)](_0x8d2583(0xfa)+_0x2f0cc7[_0x8d2583(0x10a)]+'\x27:'),console[_0x8d2583(0xeb)]('─'[_0x8d2583(0x148)](0x3c)),console[_0x8d2583(0xeb)](_0x2f0cc7[_0x8d2583(0x138)]),console['error']('─'[_0x8d2583(0x148)](0x3c));}if(_0x3ae9bb[_0x8d2583(0xdc)])return console['error'](a35_0x5d72ef[_0x8d2583(0x11a)](_0x8d2583(0x108))),0x0;if(_0x4fde8f[_0x8d2583(0x146)]===0x0&&_0x44f63f[_0x8d2583(0x146)]===0x0)return console[_0x8d2583(0xeb)](a35_0x5d72ef['green'](_0x8d2583(0x10d))),saveSessionContext({'parent_segment':_0x57e0b5},_0x3ae9bb[_0x8d2583(0x135)]),console[_0x8d2583(0xeb)](a35_0x5d72ef[_0x8d2583(0xe1)](_0x8d2583(0xff)+a35_0x5d72ef[_0x8d2583(0x13e)](_0x8d2583(0x113))+'\x20=\x20'+a35_0x5d72ef[_0x8d2583(0xea)](_0x57e0b5))),0x0;if(!_0x3ae9bb['yes']&&(_0x4fde8f[_0x8d2583(0x146)]>0x0||_0x44f63f[_0x8d2583(0x146)]>0x0)){const _0x4eac83=await confirmKey(_0x8d2583(0x103)+(_0x4fde8f['length']+_0x44f63f[_0x8d2583(0x146)])+_0x8d2583(0xe6));if(!_0x4eac83)return console[_0x8d2583(0xeb)](_0x8d2583(0xd4)),0x1;}for(const _0x195931 of _0xf9b3fc){if(_0x195931['isNew']||_0x195931[_0x8d2583(0x11c)]){const _0x17771=a35_0x5ecdff[_0x8d2583(0x128)](_0x195931['absolutePath']);!existsSync(_0x17771)&&mkdirSync(_0x17771,{'recursive':!![]}),writeFileSync(_0x195931[_0x8d2583(0xe9)],_0x195931['content'],_0x8d2583(0x105));}}return console[_0x8d2583(0xeb)](a35_0x5d72ef['green'](_0x8d2583(0x12b)+(_0x4fde8f[_0x8d2583(0x146)]+_0x44f63f[_0x8d2583(0x146)])+'\x20files\x20to\x20'+_0x414034)),saveSessionContext({'parent_segment':_0x57e0b5},_0x3ae9bb[_0x8d2583(0x135)]),console['error'](a35_0x5d72ef[_0x8d2583(0xe1)](_0x8d2583(0xff)+a35_0x5d72ef['dim'](_0x8d2583(0x113))+_0x8d2583(0x10b)+a35_0x5d72ef['cyan'](_0x57e0b5))),0x0;}}function buildFolderPathMap(_0x1929b6){const _0x494e60=a35_0x3aadc2,_0x474ea7=new Map(),_0x2bcb91=new Map();for(const _0x18cb5a of _0x1929b6){_0x2bcb91[_0x494e60(0x107)](_0x18cb5a['id'],_0x18cb5a);}const _0x6d7010=new Set();for(const _0xea2c04 of _0x1929b6){!_0xea2c04[_0x494e60(0x11f)]&&_0x6d7010[_0x494e60(0x134)](_0xea2c04['id']);}function _0x76318f(_0x14d71c){const _0x39dda3=_0x494e60;if(_0x474ea7[_0x39dda3(0x101)](_0x14d71c['id']))return _0x474ea7[_0x39dda3(0xe7)](_0x14d71c['id']);if(_0x6d7010[_0x39dda3(0x101)](_0x14d71c['id']))return _0x474ea7[_0x39dda3(0x107)](_0x14d71c['id'],''),'';if(_0x14d71c[_0x39dda3(0x11f)]){const _0xe94e0f=_0x2bcb91[_0x39dda3(0xe7)](_0x14d71c[_0x39dda3(0x11f)]);if(_0xe94e0f){const _0x455cf2=_0x76318f(_0xe94e0f),_0xcf1775=_0x455cf2?_0x455cf2+'/'+_0x14d71c[_0x39dda3(0x137)]:_0x14d71c[_0x39dda3(0x137)];return _0x474ea7[_0x39dda3(0x107)](_0x14d71c['id'],_0xcf1775),_0xcf1775;}}const _0x39a55c=_0x14d71c['name'];return _0x474ea7[_0x39dda3(0x107)](_0x14d71c['id'],_0x39a55c),_0x39a55c;}for(const _0xbed4c3 of _0x1929b6){_0x76318f(_0xbed4c3);}return _0x474ea7;}function getUniqueFileName(_0x524450,_0x1b6694,_0x32fd1f){const _0xf5cdcf=a35_0x3aadc2,_0x5e6a34=_0x524450+':'+_0x1b6694,_0x3bd4d5=_0x32fd1f[_0xf5cdcf(0xe7)](_0x5e6a34)||0x0;_0x32fd1f[_0xf5cdcf(0x107)](_0x5e6a34,_0x3bd4d5+0x1);if(_0x3bd4d5===0x0)return _0x1b6694;return _0x1b6694+'-'+_0x3bd4d5;}function prepareFile(_0x587a78,_0x26e6ed,_0x5ab0b4){const _0x503393=a35_0x3aadc2,_0x212dc8=a35_0x5ecdff[_0x503393(0xf4)](_0x5ab0b4,_0x587a78);if(existsSync(_0x587a78)){const _0x15d448=readFileSync(_0x587a78,'utf-8'),_0x3ac7fd=generateDiff(_0x15d448,_0x26e6ed),_0x298626=hasChanges(_0x3ac7fd);return{'relativePath':_0x212dc8,'absolutePath':_0x587a78,'content':_0x26e6ed,'isNew':![],'hasChanges':_0x298626,'diff':_0x298626?formatDiffWithColors(_0x3ac7fd):undefined};}return{'relativePath':_0x212dc8,'absolutePath':_0x587a78,'content':_0x26e6ed,'isNew':!![],'hasChanges':![]};}
1
+ const a35_0x3666ed=a35_0x48a6;(function(_0xbf0cff,_0x399d9d){const _0x685709=a35_0x48a6,_0x2c0a9e=_0xbf0cff();while(!![]){try{const _0x37bfac=parseInt(_0x685709(0x10e))/0x1+parseInt(_0x685709(0xe1))/0x2*(-parseInt(_0x685709(0xd1))/0x3)+parseInt(_0x685709(0xd9))/0x4+-parseInt(_0x685709(0x12d))/0x5+-parseInt(_0x685709(0x109))/0x6+-parseInt(_0x685709(0x135))/0x7+parseInt(_0x685709(0x137))/0x8;if(_0x37bfac===_0x399d9d)break;else _0x2c0a9e['push'](_0x2c0a9e['shift']());}catch(_0x4894fb){_0x2c0a9e['push'](_0x2c0a9e['shift']());}}}(a35_0x1b07,0xce427));function a35_0x1b07(){const _0x1ad3a7=['\x20journeys','rule','\x20files\x20to\x20','size','segmentFolderId','3210678rpbDaB','Fetching\x20users\x20for\x20email\x20resolution...','\x20with\x20','\x27...','get','775590uWvYRK','session','Fetching\x20journeys...','repeat','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20Target:\x20','message','execute','\x20new\x20files','✔\x20Pulled\x20','setExtra','dim','listSegments','kind','filter','folderId','has','add','buildIdToEmailMap','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','tdx.json','then','\x20versions)','set','dirname','dryRun','slice','from','Resolved\x20parent\x20name:\x20','Site:\x20','7399940pZcHRj','Using\x20parent\x20segment:\x20','Fetching\x20parent\x20segment\x20info...','reduce','yellow','getJourney','parent_segment','\x20segments','7233590XHyuYT','\x20files?','27625592hqwlrI','activation_','buildIdToNameMap','\x20\x20🎯\x20','length','Found\x20tdx.json\x20at:\x20','\x0aPull\x20summary\x20for\x20\x27','parentSegment','isDirectory','✔\x20Context\x20set:\x20','Fetching\x20segments...','segment','description','\x20=\x20','listFolders','549QJXMpg','attributes','.yml','journeyBundleId','\x20activations','hasChanges','listJourneysFromParentSegment','Write\x20','880436WCCphd','✔\x20All\x20files\x20are\x20up\x20to\x20date','listActivations','Fetching\x20activations...','Found\x20existing\x20tdx.json\x20at:\x20','data','green','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','6072ZMOmrb','Processing\x20journeys...','segment:pull','\x20unchanged\x20files','push','content','user','error','journey','parentFolderId','name','verbose','audienceId','relativePath','site','utf-8','diff','Fetching\x20journey\x20\x27','values','Parent\x20segment:\x20','setPhase','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Warning:\x20Could\x20not\x20resolve\x20activation\x20','all','yaml','Resolving\x20parent\x20segment\x20\x27','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)','getSegment','absolutePath','map','isNew','\x0aChanges\x20to\x20\x27','cyan','Fetching\x20folders...','resolveParentId'];a35_0x1b07=function(){return _0x1ad3a7;};return a35_0x1b07();}import{BaseCommand}from'./command.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';function a35_0x48a6(_0x1bfe38,_0x10a135){_0x1bfe38=_0x1bfe38-0xd1;const _0x1b07cf=a35_0x1b07();let _0x48a692=_0x1b07cf[_0x1bfe38];return _0x48a692;}import{apiToYamlAsync,toYamlString as a35_0x3dd726,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a35_0x577f83 from'chalk';import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a35_0x554742 from'path';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{[a35_0x3666ed(0xeb)]=a35_0x3666ed(0xe3);[a35_0x3666ed(0x143)]=a35_0x3666ed(0xe0);async[a35_0x3666ed(0x115)](_0x1569e4){const _0x1fa34f=a35_0x3666ed,{options:_0x4bdad3,args:_0x5290e8,tdx:_0x5db3f0}=_0x1569e4,_0x423df8=_0x4bdad3,_0x8e6756=_0x4bdad3[_0x1fa34f(0x13e)],_0x428457=_0x5290e8[0x0],_0x4d54fb=findTdxConfigPath();let _0x3bf1c2,_0x50f9fb;if(!_0x428457&&_0x4d54fb){const _0x1b7146=loadTdxConfig(_0x4d54fb);_0x3bf1c2=_0x1b7146[_0x1fa34f(0x133)],_0x50f9fb=a35_0x554742[_0x1fa34f(0x127)](_0x4d54fb),_0x423df8[_0x1fa34f(0xec)]&&(console[_0x1fa34f(0xe8)](_0x1fa34f(0xdd)+_0x4d54fb),console[_0x1fa34f(0xe8)](_0x1fa34f(0x12e)+_0x3bf1c2));}else{if(_0x428457){if(existsSync(_0x428457)&&statSync(_0x428457)[_0x1fa34f(0x13f)]()){const _0x1c9f84=findTdxConfigPath(_0x428457);if(_0x1c9f84){const _0xa4de5d=loadTdxConfig(_0x1c9f84);_0x3bf1c2=_0xa4de5d[_0x1fa34f(0x133)],_0x50f9fb=a35_0x554742[_0x1fa34f(0x127)](_0x1c9f84),_0x423df8[_0x1fa34f(0xec)]&&(console[_0x1fa34f(0xe8)](_0x1fa34f(0x13c)+_0x1c9f84),console[_0x1fa34f(0xe8)](_0x1fa34f(0x12e)+_0x3bf1c2));}else return console[_0x1fa34f(0xe8)](a35_0x577f83['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x428457+'\x0a')),console[_0x1fa34f(0xe8)](a35_0x577f83[_0x1fa34f(0x101)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}else _0x3bf1c2=_0x428457;}else _0x3bf1c2=_0x8e6756;}if(!_0x3bf1c2)return console[_0x1fa34f(0xe8)](a35_0x577f83[_0x1fa34f(0x131)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x1fa34f(0xe8)](_0x1fa34f(0xfb)),console[_0x1fa34f(0xe8)](_0x1fa34f(0xf6)),console[_0x1fa34f(0xe8)](_0x1fa34f(0x122)),0x1;_0x423df8[_0x1fa34f(0xec)]&&(console[_0x1fa34f(0xe8)](_0x1fa34f(0x12c)+_0x423df8[_0x1fa34f(0xef)]),console[_0x1fa34f(0xe8)](_0x1fa34f(0xf4)+_0x3bf1c2));const _0x3972c2=await withSpinner(_0x1fa34f(0xfa)+_0x3bf1c2+_0x1fa34f(0x10c),()=>_0x5db3f0[_0x1fa34f(0x142)][_0x1fa34f(0x103)](_0x3bf1c2),{'verbose':_0x423df8[_0x1fa34f(0xec)]}),_0x48c9d1=_0x3972c2['data'],_0x5ee5a2=await withSpinner(_0x1fa34f(0x12f),()=>_0x5db3f0[_0x1fa34f(0x142)]['getParent'](_0x48c9d1),{'verbose':_0x423df8[_0x1fa34f(0xec)]}),_0x4f3227=_0x5ee5a2[_0x1fa34f(0xde)][_0x1fa34f(0xd2)][_0x1fa34f(0xeb)];_0x423df8[_0x1fa34f(0xec)]&&console[_0x1fa34f(0xe8)](_0x1fa34f(0x12b)+_0x4f3227);const [_0x4c7347,_0x53bfcf,_0x42e5da]=await Promise[_0x1fa34f(0xf8)]([withSpinner(_0x1fa34f(0x141),()=>_0x5db3f0[_0x1fa34f(0x142)][_0x1fa34f(0x11a)](_0x48c9d1),{'verbose':_0x423df8[_0x1fa34f(0xec)]}),withSpinner(_0x1fa34f(0x102),()=>_0x5db3f0['segment'][_0x1fa34f(0x145)](_0x48c9d1),{'verbose':_0x423df8[_0x1fa34f(0xec)]}),withSpinner(_0x1fa34f(0x110),()=>_0x5db3f0[_0x1fa34f(0xe9)][_0x1fa34f(0xd7)](_0x48c9d1),{'verbose':_0x423df8['verbose']})]),_0x534af4=_0x4c7347[_0x1fa34f(0xde)],_0x2ca9a1=_0x53bfcf[_0x1fa34f(0xde)],_0x2dbb55=_0x42e5da[_0x1fa34f(0xde)];if(_0x534af4[_0x1fa34f(0x13b)]===0x0&&_0x2dbb55[_0x1fa34f(0x13b)]===0x0)return console[_0x1fa34f(0xe8)](a35_0x577f83[_0x1fa34f(0x131)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x4f3227+'\x27')),0x0;const _0x4628d8=buildFolderPathMap(_0x2ca9a1),_0x4d2263=_0x50f9fb||getSegmentRootDir(sanitizeFileName(_0x3bf1c2)),_0x2da022=new Map();await withSpinner(_0x1fa34f(0xdc),async()=>{await batchAsync(_0x534af4,async _0x308870=>{const _0x7e49e4=a35_0x48a6,_0x4be22a=await _0x5db3f0['segment'][_0x7e49e4(0xdb)](_0x48c9d1,_0x308870['id']);_0x2da022[_0x7e49e4(0x126)](_0x308870['id'],_0x4be22a);});},{'verbose':_0x423df8['verbose']});const _0x3466be=await withSpinner(_0x1fa34f(0x10a),()=>_0x5db3f0[_0x1fa34f(0xe7)][_0x1fa34f(0x120)](),{'verbose':_0x423df8[_0x1fa34f(0xec)]})[_0x1fa34f(0x124)](_0x16ae42=>_0x16ae42[_0x1fa34f(0xde)]),_0x30d141=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',()=>_0x5db3f0['connection'][_0x1fa34f(0x139)](),{'verbose':_0x423df8[_0x1fa34f(0xec)]})[_0x1fa34f(0x124)](_0x3f204b=>_0x3f204b[_0x1fa34f(0xde)]),_0x4bb989=[],_0x2e663c=a35_0x554742[_0x1fa34f(0x121)](_0x4d2263,_0x1fa34f(0x123)),_0x3d1772=createTdxConfigContent(_0x4f3227);_0x4bb989['push'](prepareFile(_0x2e663c,_0x3d1772,_0x4d2263));const _0x4ff0ef=new Map();for(const _0x2b9e4e of _0x534af4){if(_0x2b9e4e['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x58430c=_0x2b9e4e[_0x1fa34f(0x108)]?_0x4628d8[_0x1fa34f(0x10d)](_0x2b9e4e[_0x1fa34f(0x108)])||'':'',_0x189578=_0x2da022[_0x1fa34f(0x10d)](_0x2b9e4e['id'])||[],_0x394c98=segmentWithActivationsToYaml(_0x2b9e4e,_0x189578,undefined,_0x3466be,_0x30d141),_0x45ff71=_0x58430c?a35_0x554742[_0x1fa34f(0x121)](_0x4d2263,_0x58430c):_0x4d2263,_0x476c26=sanitizeFileName(_0x2b9e4e[_0x1fa34f(0xeb)]),_0xcc624e=getUniqueFileName(_0x45ff71,_0x476c26,_0x4ff0ef),_0x77124e=a35_0x554742[_0x1fa34f(0x121)](_0x45ff71,_0xcc624e+'.yml'),_0x4843e4=segmentToYamlString(_0x394c98);_0x4bb989['push'](prepareFile(_0x77124e,_0x4843e4,_0x4d2263));}const _0x3d414e=new Map();for(const _0x340efc of _0x534af4){_0x3d414e[_0x1fa34f(0x126)](_0x340efc['id'],_0x340efc);}const _0x2e5218=new Map();for(const _0x3d41c4 of _0x2dbb55){const _0x34d345=_0x3d41c4[_0x1fa34f(0xd4)];!_0x2e5218['has'](_0x34d345)&&_0x2e5218[_0x1fa34f(0x126)](_0x34d345,[]),_0x2e5218['get'](_0x34d345)[_0x1fa34f(0xe5)](_0x3d41c4);}for(const _0x15192c of _0x2e5218[_0x1fa34f(0xf3)]()){_0x15192c['sort']((_0x57729d,_0x390dbb)=>(_0x57729d['versionNumber']||0x0)-(_0x390dbb['versionNumber']||0x0));}const _0x1aeaa2=()=>{const _0x519c7c=_0x1fa34f,_0x4e487a=new Set(),_0xdcd34d=new Set(),_0x4caa43=new Map(),_0x1d3a1d=new Map(),_0x376bf6=createJumpTargetCache(),_0x2704db=(_0x3cd645,_0x401487)=>({'resolveSegment':async _0x4bb57b=>{const _0x16d8a8=a35_0x48a6,_0xed1a60=_0x4caa43[_0x16d8a8(0x10d)](_0x4bb57b);if(_0xed1a60!==undefined)return{'name':_0xed1a60,'isJourneyLocal':!![]};if(!_0x401487)return{'name':_0x4bb57b,'isJourneyLocal':![]};try{let _0x172151=_0x3d414e[_0x16d8a8(0x10d)](_0x4bb57b);!_0x172151&&(_0x172151=await _0x5db3f0[_0x16d8a8(0x142)][_0x16d8a8(0xfc)](_0x401487,_0x4bb57b));const _0x544345=generateJourneyLocalName(_0x172151[_0x16d8a8(0xeb)]),_0x125c22=_0x172151[_0x16d8a8(0x11b)]===SEGMENT_KIND_JOURNEY&&_0x544345!==undefined;let _0x28086f=_0x172151[_0x16d8a8(0xeb)];if(_0x125c22&&_0x544345){let _0x5b8257=_0x544345,_0x1349fa=0x2;while(_0x4e487a[_0x16d8a8(0x11e)](_0x5b8257)){_0x5b8257=_0x544345+'_'+_0x1349fa,_0x1349fa++;}_0x4e487a['add'](_0x5b8257),_0x28086f=_0x5b8257,_0x4caa43[_0x16d8a8(0x126)](_0x4bb57b,_0x28086f);}let _0x2d9da4;return _0x125c22&&_0x172151[_0x16d8a8(0x105)]&&(_0x2d9da4={'description':_0x172151[_0x16d8a8(0x143)],'rule':apiRuleToYaml(_0x172151[_0x16d8a8(0x105)])}),{'name':_0x28086f,'isJourneyLocal':_0x125c22,'definition':_0x2d9da4};}catch(_0x25ab92){return _0x423df8[_0x16d8a8(0xec)]&&console[_0x16d8a8(0xe8)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x4bb57b+':\x20'+_0x25ab92['message']),{'name':_0x4bb57b,'isJourneyLocal':![]};}},'resolveActivation':async _0x9581c6=>{const _0x218614=a35_0x48a6,_0xe3003a=_0x1d3a1d[_0x218614(0x10d)](_0x9581c6);if(_0xe3003a!==undefined)return{'name':_0xe3003a,'isJourneyLocal':!![]};try{const _0x5c5bf5=await _0x5db3f0[_0x218614(0xe9)]['getActivation'](_0x3cd645,_0x9581c6),_0x2b6357=_0x5c5bf5[_0x218614(0xd2)]['activationParams'][_0x218614(0xeb)]||_0x9581c6,_0x5bbb57=sanitizeYamlKey(_0x2b6357)||_0x218614(0x138)+_0x9581c6;let _0x1e9b8f=_0x5bbb57,_0xf822f2=0x2;while(_0xdcd34d['has'](_0x1e9b8f)){_0x1e9b8f=_0x5bbb57+'_'+_0xf822f2,_0xf822f2++;}_0xdcd34d[_0x218614(0x11f)](_0x1e9b8f),_0x1d3a1d[_0x218614(0x126)](_0x9581c6,_0x1e9b8f);const _0x1aac04=journeyActivationStepToYaml(_0x5c5bf5,_0x3466be,_0x30d141);return{'name':_0x1e9b8f,'isJourneyLocal':!![],'definition':_0x1aac04};}catch(_0x23b033){return _0x423df8['verbose']&&console['error'](_0x218614(0xf7)+_0x9581c6+':\x20'+_0x23b033[_0x218614(0x114)]),{'name':_0x9581c6,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3954b7,_0x55ce42)=>resolveJumpTarget(_0x3954b7,_0x55ce42,_0x376bf6,_0x3d236d=>_0x5db3f0[_0x519c7c(0xe9)][_0x519c7c(0x132)](_0x3d236d))});return{'createYamlContext':_0x2704db};};if(_0x2e5218[_0x1fa34f(0x107)]>0x0){const _0x54af31=Array[_0x1fa34f(0x12a)](_0x2e5218[_0x1fa34f(0xf3)]()),_0x2e62b3=await withQuerySpinner(_0x1fa34f(0xe2),async _0xb93275=>{const _0xbb6e65=_0x1fa34f,_0x1cd335=[];let _0x5aa153=0x0;const _0x1c77ab=0x5;for(let _0x59ff89=0x0;_0x59ff89<_0x54af31[_0xbb6e65(0x13b)];_0x59ff89+=_0x1c77ab){const _0x4e1dda=_0x54af31[_0xbb6e65(0x129)](_0x59ff89,_0x59ff89+_0x1c77ab),_0x569d3c=await Promise[_0xbb6e65(0xf8)](_0x4e1dda[_0xbb6e65(0xfe)](async _0x206889=>{const _0x165920=_0xbb6e65,_0x3c93e6=_0x206889[0x0],_0x573891=_0x3c93e6['journeyBundleName'];_0xb93275[_0x165920(0xf5)](_0x165920(0xf2)+_0x573891+'\x27');const _0x4b84cd=_0x3c93e6[_0x165920(0x11d)]?_0x4628d8[_0x165920(0x10d)](_0x3c93e6[_0x165920(0x11d)])||'':'',{createYamlContext:_0x29f96c}=_0x1aeaa2(),_0x4ff2bf=[];for(const _0x2c8b4b of _0x206889){const _0x42f7a2=await _0x5db3f0[_0x165920(0xe9)][_0x165920(0x132)](_0x2c8b4b['id']),_0x377ce6=_0x42f7a2[_0x165920(0xd2)]?.[_0x165920(0xed)],_0x1336b2=_0x29f96c(_0x2c8b4b['id'],_0x377ce6),_0x2103a7=await apiToYamlAsync(_0x42f7a2,_0x1336b2);_0x4ff2bf[_0x165920(0xe5)]({'item':_0x2c8b4b,'yaml':_0x2103a7});}let _0x1b63fb;return _0x4ff2bf[_0x165920(0x13b)]===0x1?_0x1b63fb=_0x4ff2bf[0x0][_0x165920(0xf9)]:_0x1b63fb=buildMergedJourneyYaml(_0x4ff2bf),{'bundleName':_0x573891,'folderPath':_0x4b84cd,'finalYaml':_0x1b63fb};}));_0x1cd335[_0xbb6e65(0xe5)](..._0x569d3c),_0x5aa153+=_0x4e1dda[_0xbb6e65(0x13b)],_0xb93275[_0xbb6e65(0x118)]('('+_0x5aa153+'/'+_0x54af31[_0xbb6e65(0x13b)]+')');}return _0x1cd335;},{'verbose':_0x423df8['verbose']});for(const {bundleName:_0xfa6c9e,folderPath:_0x4ac8e9,finalYaml:_0x507aad}of _0x2e62b3[_0x1fa34f(0xde)]){const _0x505157=normalizeJourneyYaml(_0x507aad),_0x294d41=a35_0x3dd726(_0x505157),_0x37e989=_0x4ac8e9?a35_0x554742['join'](_0x4d2263,_0x4ac8e9):_0x4d2263,_0x249905=sanitizeFileName(_0xfa6c9e),_0x3b0589=getUniqueFileName(_0x37e989,_0x249905,_0x4ff0ef),_0x5be6c7=a35_0x554742[_0x1fa34f(0x121)](_0x37e989,_0x3b0589+_0x1fa34f(0xd3));_0x4bb989[_0x1fa34f(0xe5)](prepareFile(_0x5be6c7,_0x294d41,_0x4d2263));}}const _0x312346=Array[_0x1fa34f(0x12a)](_0x2da022['values']())[_0x1fa34f(0x130)]((_0x1715b8,_0x5d00ae)=>_0x1715b8+_0x5d00ae[_0x1fa34f(0x13b)],0x0),_0x55d07f=_0x4bb989[_0x1fa34f(0x11c)](_0x9cce9f=>_0x9cce9f[_0x1fa34f(0xff)]),_0x17f736=_0x4bb989[_0x1fa34f(0x11c)](_0x6572d6=>!_0x6572d6[_0x1fa34f(0xff)]&&_0x6572d6[_0x1fa34f(0xd6)]),_0x5203ac=_0x4bb989[_0x1fa34f(0x11c)](_0x5b6d3a=>!_0x5b6d3a['isNew']&&!_0x5b6d3a['hasChanges']),_0x380c11=_0x534af4['filter'](_0xa2a4e7=>_0xa2a4e7[_0x1fa34f(0x11b)]!==SEGMENT_KIND_JOURNEY);console[_0x1fa34f(0xe8)](_0x1fa34f(0x13d)+_0x4f3227+'\x27:'),console[_0x1fa34f(0xe8)](_0x1fa34f(0x13a)+a35_0x577f83[_0x1fa34f(0x101)](_0x380c11[_0x1fa34f(0x13b)]+_0x1fa34f(0x134))+_0x1fa34f(0x10b)+a35_0x577f83['cyan'](_0x312346+_0x1fa34f(0xd5)));if(_0x2e5218[_0x1fa34f(0x107)]>0x0){const _0x28dbd3=_0x2dbb55[_0x1fa34f(0x13b)],_0x105071=_0x2e5218[_0x1fa34f(0x107)],_0x2b1891=_0x28dbd3>_0x105071?'\x20('+_0x28dbd3+_0x1fa34f(0x125):'';console[_0x1fa34f(0xe8)]('\x20\x20🗺️\x20\x20'+a35_0x577f83[_0x1fa34f(0x101)](_0x105071+_0x1fa34f(0x104))+a35_0x577f83[_0x1fa34f(0x119)](_0x2b1891));}console[_0x1fa34f(0xe8)]('\x20\x20'+a35_0x577f83['green']('+\x20'+_0x55d07f['length']+_0x1fa34f(0x116))),console['error']('\x20\x20'+a35_0x577f83[_0x1fa34f(0x131)]('~\x20'+_0x17f736[_0x1fa34f(0x13b)]+'\x20changed\x20files')),console['error']('\x20\x20'+a35_0x577f83[_0x1fa34f(0x119)]('=\x20'+_0x5203ac['length']+_0x1fa34f(0xe4))),console['error'](_0x1fa34f(0x113)+a35_0x577f83[_0x1fa34f(0x101)](_0x4d2263)+'\x0a');if(_0x17f736[_0x1fa34f(0x13b)]>0x0)for(const _0x37b873 of _0x17f736){console[_0x1fa34f(0xe8)](_0x1fa34f(0x100)+_0x37b873[_0x1fa34f(0xee)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x37b873[_0x1fa34f(0xf1)]),console[_0x1fa34f(0xe8)]('─'[_0x1fa34f(0x111)](0x3c));}if(_0x423df8[_0x1fa34f(0x128)])return console[_0x1fa34f(0xe8)](a35_0x577f83[_0x1fa34f(0x131)](_0x1fa34f(0x112))),0x0;if(_0x55d07f[_0x1fa34f(0x13b)]===0x0&&_0x17f736[_0x1fa34f(0x13b)]===0x0)return console[_0x1fa34f(0xe8)](a35_0x577f83[_0x1fa34f(0xdf)](_0x1fa34f(0xda))),saveSessionContext({'parent_segment':_0x4f3227},_0x423df8[_0x1fa34f(0x10f)]),console[_0x1fa34f(0xe8)](a35_0x577f83['green'](_0x1fa34f(0x140)+a35_0x577f83['dim'](_0x1fa34f(0x133))+_0x1fa34f(0x144)+a35_0x577f83['cyan'](_0x4f3227))),0x0;if(!_0x423df8['yes']&&(_0x55d07f['length']>0x0||_0x17f736[_0x1fa34f(0x13b)]>0x0)){const _0x1a600e=await confirmKey(_0x1fa34f(0xd8)+(_0x55d07f['length']+_0x17f736['length'])+_0x1fa34f(0x136));if(!_0x1a600e)return console['error']('Aborted.'),0x1;}for(const _0x5cbedd of _0x4bb989){if(_0x5cbedd[_0x1fa34f(0xff)]||_0x5cbedd[_0x1fa34f(0xd6)]){const _0xeaeddc=a35_0x554742[_0x1fa34f(0x127)](_0x5cbedd[_0x1fa34f(0xfd)]);!existsSync(_0xeaeddc)&&mkdirSync(_0xeaeddc,{'recursive':!![]}),writeFileSync(_0x5cbedd[_0x1fa34f(0xfd)],_0x5cbedd[_0x1fa34f(0xe6)],_0x1fa34f(0xf0));}}return console['error'](a35_0x577f83['green'](_0x1fa34f(0x117)+(_0x55d07f[_0x1fa34f(0x13b)]+_0x17f736[_0x1fa34f(0x13b)])+_0x1fa34f(0x106)+_0x4d2263)),saveSessionContext({'parent_segment':_0x4f3227},_0x423df8[_0x1fa34f(0x10f)]),console['error'](a35_0x577f83['green'](_0x1fa34f(0x140)+a35_0x577f83[_0x1fa34f(0x119)](_0x1fa34f(0x133))+_0x1fa34f(0x144)+a35_0x577f83[_0x1fa34f(0x101)](_0x4f3227))),0x0;}}function buildFolderPathMap(_0x3e76a8){const _0x389ebc=a35_0x3666ed,_0x50afdc=new Map(),_0xfbcfa0=new Map();for(const _0x3b769c of _0x3e76a8){_0xfbcfa0[_0x389ebc(0x126)](_0x3b769c['id'],_0x3b769c);}const _0x370542=new Set();for(const _0x4cda1f of _0x3e76a8){!_0x4cda1f['parentFolderId']&&_0x370542[_0x389ebc(0x11f)](_0x4cda1f['id']);}function _0x3c4daf(_0x2ee5c9){const _0xf6866e=_0x389ebc;if(_0x50afdc[_0xf6866e(0x11e)](_0x2ee5c9['id']))return _0x50afdc[_0xf6866e(0x10d)](_0x2ee5c9['id']);if(_0x370542[_0xf6866e(0x11e)](_0x2ee5c9['id']))return _0x50afdc[_0xf6866e(0x126)](_0x2ee5c9['id'],''),'';if(_0x2ee5c9[_0xf6866e(0xea)]){const _0xf31e2a=_0xfbcfa0['get'](_0x2ee5c9[_0xf6866e(0xea)]);if(_0xf31e2a){const _0x17ae14=_0x3c4daf(_0xf31e2a),_0x5eec0e=_0x17ae14?_0x17ae14+'/'+_0x2ee5c9[_0xf6866e(0xeb)]:_0x2ee5c9[_0xf6866e(0xeb)];return _0x50afdc['set'](_0x2ee5c9['id'],_0x5eec0e),_0x5eec0e;}}const _0x50252c=_0x2ee5c9['name'];return _0x50afdc[_0xf6866e(0x126)](_0x2ee5c9['id'],_0x50252c),_0x50252c;}for(const _0x4a63a5 of _0x3e76a8){_0x3c4daf(_0x4a63a5);}return _0x50afdc;}function getUniqueFileName(_0x2d1846,_0x4d86a5,_0x4f94c1){const _0x22eb8b=a35_0x3666ed,_0x40b813=_0x2d1846+':'+_0x4d86a5,_0x13e360=_0x4f94c1[_0x22eb8b(0x10d)](_0x40b813)||0x0;_0x4f94c1[_0x22eb8b(0x126)](_0x40b813,_0x13e360+0x1);if(_0x13e360===0x0)return _0x4d86a5;return _0x4d86a5+'-'+_0x13e360;}function prepareFile(_0x2a210a,_0x42c8d6,_0x4ea566){const _0x3ab1c4=a35_0x554742['relative'](_0x4ea566,_0x2a210a);if(existsSync(_0x2a210a)){const _0x2eaa85=readFileSync(_0x2a210a,'utf-8'),_0x1d0e5c=generateDiff(_0x2eaa85,_0x42c8d6),_0x16e1df=hasChanges(_0x1d0e5c);return{'relativePath':_0x3ab1c4,'absolutePath':_0x2a210a,'content':_0x42c8d6,'isNew':![],'hasChanges':_0x16e1df,'diff':_0x16e1df?formatDiffWithColors(_0x1d0e5c):undefined};}return{'relativePath':_0x3ab1c4,'absolutePath':_0x2a210a,'content':_0x42c8d6,'isNew':!![],'hasChanges':![]};}
@@ -1 +1 @@
1
- {"version":3,"file":"segment-pull-command.js","sourceRoot":"","sources":["../../src/commands/segment-pull-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,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EAAE,OAAO,CAAC,CAAC;QACpD,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QAEjC,OAAO;YACL,YAAY;YACZ,YAAY;YACZ,OAAO;YACP,KAAK,EAAE,KAAK;YACZ,UAAU,EAAE,OAAO;YACnB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;SACvD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,YAAY;QACZ,YAAY;QACZ,OAAO;QACP,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,KAAK;KAClB,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"segment-push-command.d.ts","sourceRoot":"","sources":["../../src/commands/segment-push-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAuMhE;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,wDAAwD;IAEtE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAooDxD"}
1
+ {"version":3,"file":"segment-push-command.d.ts","sourceRoot":"","sources":["../../src/commands/segment-push-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAyMhE;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,wDAAwD;IAEtE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAopDxD"}
@@ -1 +1 @@
1
- const a36_0x3acda7=a36_0x2d92;function a36_0xe3b9(){const _0x5bc94d=['/app/ps/','2737388PWuwCS','Delete\x20journey:','\x20to\x20delete','\x20\x20Activations:','Entry\x20criteria:\x20','\x20new','folderPath','\x27\x20with\x20ID:\x20','error','DecisionPoint','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20folders\x20to\x20create','Activation','\x20updated','buildIdToNameMap','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','execute','resolveParentId','\x20created','listSegments','Segment\x20not\x20found:\x20','updated','Fetching\x20parent\x20segment\x20details...','dirname','update','cyan','max','\x20journey\x20\x27','journeysOnly','toLowerCase','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','📁\x20','existingActivation','\x20\x20Segments:\x20','state','createFolder','toString','\x27\x20v','Updating\x20segment\x20\x27','entryCriteria','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','activationParams','Changes\x20to:','absolutePath','getActivation','\x20changed','split','action','3023eAHMZo','✔\x20Created\x20folder\x20\x27','sort','SEGMENT_UPDATE_ERROR','config','item','10327644htObmz','join','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','diff','parentSegment','\x27\x20not\x20found\x20in\x20journey\x20\x27','\x27...','parentSegmentFolder','steps','\x20\x20Created\x20embedded\x20segment\x20\x27','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Resolving\x20parent\x20segment\x20\x27','\x20\x20Source:\x20','segmentId','✔\x20Created\x20segment\x20\x27','New\x20journey:','Activation\x20not\x20found:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','activations','isNew','type','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','relationships','stages','Site:\x20','212prtjqi','resolve','journeyId','journey_entry_criteria_','from','existingJourney','\x20deleted','\x20\x20\x20\x20','journeyBundleName','\x0a\x20\x20','\x20\x20📊\x20Segments:','.yml','ACTIVATION_UPDATE_ERROR','\x20activation\x20\x27','size','existingSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','9134986HjAErG','yellow','draft','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parentFolderId','createSegment','\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20','yes','unchanged','New\x20segment:','Creating','✔\x20Deleted\x20segment\x20\x27','versionNumber','✔\x20Updated\x20journey\x20\x27','dryRun','yamlConfig','\x20\x20✔\x20Updated\x20activation\x20\x27','\x20unchanged','SEGMENT_NOT_FOUND','delete',')\x20with\x20ID:\x20','journey','buildNameToIdMap','Creating\x20activation\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','getJourney','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/j/da/je','keys','find','all','activation_','\x20YAML\x20files\x20found','replace',').\x20','listFolders','ACTIVATION_SYNTAX_ERROR','repeat','create','6364161fMPdnO','Folders\x20to\x20create:','Failed\x20to\x20','red','INTERNAL','name','.yaml','values','buildUserMaps','flatMap','/e/','verbose','Stage\x20\x27','No\x20','8JbBcmH','listActivations','\x27:\x20','attributes','endsWith','✔\x20Created\x20journey\x20\x27','map','\x20activations]','(Journey\x20will\x20be\x20deleted)','\x20\x20Activations:\x20','Scoped\x20to\x20folder:\x20','rule','Parent\x20segment:\x20','blue','\x20\x20🗺️\x20\x20Journeys:','segment','entries','slice','activationActions','push','dim','createActivation',')\x20with\x20journeyId:\x20','length','\x20\x20✔\x20Created\x20activation\x20\x27','green','randomUUID','site','entry','NOT_FOUND','5046095KQLilR','has','get','Changes\x20to\x20journey:','\x27\x20details...','utf-8','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','add','isFile','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','3813117zjrZrp','cwd','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','hasChanges','segmentFolderId','created','JOURNEY_UPDATE_ERROR','data','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','SEGMENT_SYNTAX_ERROR','description','user','\x20to\x20update','Fetching\x20journey\x20\x27','journeyActivationStepId','journeyStages','stringify','Creating\x20segment\x20\x27','Error\x20parsing\x20','relative','message','resolveJourneyId','connection','\x20changes?','Deleting\x20segment\x20\x27','\x20\x20✔\x20Deleted\x20activation\x20\x27','Push\x20','parse','folderId','Aborted.','Source\x20directory:\x20','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','JOURNEY_SYNTAX_ERROR','\x20\x20Journeys:\x20','Updating\x20activation\x20\x27','entry_criteria','\x27\x20(internal:\x20','getSegment','kind','configDir','\x20journey\x20from\x20file:\x20','\x20\x20Created\x20embedded\x20activation\x20\x27','parent_segment','createJourneySegment','filter','folder','set','deleteSegment','\x27\x20with\x20journeyId:\x20','\x20to\x20create','Deleting\x20activation\x20\x27','✔\x20Updated\x20segment\x20\x27','startsWith','yamlActivation','segment\x20or\x20journey','branches','then','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID'];a36_0xe3b9=function(){return _0x5bc94d;};return a36_0xe3b9();}(function(_0x1e4407,_0x33ab3f){const _0x325c4d=a36_0x2d92,_0x31819b=_0x1e4407();while(!![]){try{const _0x1a5e8c=parseInt(_0x325c4d(0x2b7))/0x1*(-parseInt(_0x325c4d(0x1de))/0x2)+parseInt(_0x325c4d(0x24c))/0x3+parseInt(_0x325c4d(0x287))/0x4+-parseInt(_0x325c4d(0x242))/0x5+-parseInt(_0x325c4d(0x2bd))/0x6+parseInt(_0x325c4d(0x1ef))/0x7*(parseInt(_0x325c4d(0x224))/0x8)+parseInt(_0x325c4d(0x216))/0x9;if(_0x1a5e8c===_0x33ab3f)break;else _0x31819b['push'](_0x31819b['shift']());}catch(_0x3a87fa){_0x31819b['push'](_0x31819b['shift']());}}}(a36_0xe3b9,0xdfc66));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../sdk/errors.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,yamlActivationToUpdateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x1dccde,yamlToApi as a36_0x4a4bea,toYamlString as a36_0x238ca4,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';function a36_0x2d92(_0x215564,_0x584b08){_0x215564=_0x215564-0x1dc;const _0xe3b91f=a36_0xe3b9();let _0x2d9230=_0xe3b91f[_0x215564];return _0x2d9230;}import a36_0x20973d from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a36_0x23b535 from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a36_0x575e8b from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX='__pending_';function createPendingSegmentId(_0x136f7b){return''+PENDING_SEGMENT_PREFIX+_0x136f7b+'__';}function isPendingSegmentId(_0x294b02){const _0x468356=a36_0x2d92;return _0x294b02[_0x468356(0x280)](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x1c9a5d){const _0x578a9b=a36_0x2d92;return _0x1c9a5d[_0x578a9b(0x210)](/^__pending_(.+)__$/,'$1');}const PENDING_ACTIVATION_PREFIX='__pending_act_';function createPendingActivationId(_0x42d76b){return''+PENDING_ACTIVATION_PREFIX+_0x42d76b+'__';}function isPendingActivationId(_0x15cafc){return _0x15cafc['startsWith'](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x35652f){const _0x396097=a36_0x2d92;return _0x35652f[_0x396097(0x210)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x5396a9){const _0x3d4a7c=a36_0x2d92;!_0x5396a9[_0x3d4a7c(0x256)]&&(_0x5396a9[_0x3d4a7c(0x256)]=''),!_0x5396a9[_0x3d4a7c(0x2a9)]&&(_0x5396a9[_0x3d4a7c(0x2a9)]=_0x3d4a7c(0x1f1));}function tryFindTdxConfig(_0x548d80){try{return findTdxConfig(_0x548d80);}catch{return null;}}function resolveTDFolderPath(_0x39f854,_0x895df2,_0x1b0590){if(!_0x895df2)return _0x39f854;return _0x39f854?_0x1b0590+'/'+_0x39f854:_0x1b0590;}export class SegmentPushCommand extends BaseCommand{[a36_0x3acda7(0x21b)]='segment:push';['description']=a36_0x3acda7(0x26b);async[a36_0x3acda7(0x297)](_0x3d4e90){const _0x4e4f1c=a36_0x3acda7,{options:_0x5c00b6,args:_0x3bb252,tdx:_0x412c11}=_0x3d4e90,_0x1a7b21=_0x5c00b6,_0x353089=_0x5c00b6[_0x4e4f1c(0x2c1)],_0x20c381=_0x3bb252[0x0];let _0x1b8a64,_0x457cf4,_0x2427e5,_0x1d4589;if(_0x20c381){if(existsSync(_0x20c381)&&statSync(_0x20c381)['isDirectory']()){const _0x448d04=tryFindTdxConfig(_0x20c381);if(_0x448d04)_0x1b8a64=_0x448d04[_0x4e4f1c(0x2bb)][_0x4e4f1c(0x276)],_0x457cf4=_0x20c381,_0x2427e5=_0x448d04['configDir'];else return console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x219)](_0x4e4f1c(0x296)+_0x20c381+'\x0a')),console[_0x4e4f1c(0x28f)](a36_0x20973d['cyan'](_0x4e4f1c(0x209))),0x1;}else{if(existsSync(_0x20c381)&&statSync(_0x20c381)[_0x4e4f1c(0x24a)]()){const _0x7e5f4d=a36_0x23b535[_0x4e4f1c(0x29e)](_0x20c381),_0x3bbb87=tryFindTdxConfig(_0x7e5f4d);if(_0x3bbb87)_0x1b8a64=_0x3bbb87['config'][_0x4e4f1c(0x276)],_0x2427e5=_0x3bbb87[_0x4e4f1c(0x273)],_0x457cf4=_0x3bbb87[_0x4e4f1c(0x273)],_0x1d4589=a36_0x23b535[_0x4e4f1c(0x1df)](_0x20c381);else return console[_0x4e4f1c(0x28f)](a36_0x20973d['red'](_0x4e4f1c(0x296)+_0x7e5f4d+'\x0a')),console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x2a0)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}else _0x1b8a64=_0x20c381;}}else{const _0x5974a1=tryFindTdxConfig(process[_0x4e4f1c(0x24d)]());_0x5974a1?(_0x1b8a64=_0x5974a1[_0x4e4f1c(0x2bb)][_0x4e4f1c(0x276)],_0x457cf4=process['cwd'](),_0x2427e5=_0x5974a1[_0x4e4f1c(0x273)]):_0x1b8a64=_0x353089;}if(!_0x1b8a64)return console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x1f0)](_0x4e4f1c(0x24e))),console[_0x4e4f1c(0x28f)]('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[_0x4e4f1c(0x28f)](_0x4e4f1c(0x2c8)),console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x1ee)),0x1;const _0x5b7a6f=_0x457cf4||getSegmentRootDir(sanitizeFileName(_0x1b8a64)),_0x2bca27=_0x2427e5||_0x5b7a6f,_0x360e87=a36_0x23b535[_0x4e4f1c(0x25f)](_0x2bca27,_0x5b7a6f),_0x27eca8=_0x360e87!==''&&_0x360e87!=='.';if(!existsSync(_0x5b7a6f))return console[_0x4e4f1c(0x28f)](a36_0x20973d['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x5b7a6f+'\x0a')),console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x2a0)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x1a7b21[_0x4e4f1c(0x221)]&&(console['error'](_0x4e4f1c(0x1dd)+_0x1a7b21[_0x4e4f1c(0x23f)]),console['error'](_0x4e4f1c(0x230)+_0x1b8a64),console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x26a)+_0x5b7a6f),_0x27eca8&&console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x22e)+_0x360e87));const _0x41297e=await withSpinner(_0x4e4f1c(0x2c9)+_0x1b8a64+'\x27...',()=>_0x412c11['segment'][_0x4e4f1c(0x298)](_0x1b8a64),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]}),_0x21f120=_0x41297e[_0x4e4f1c(0x253)],[_0x38dc86,_0x28bb42,_0x4ad8c5,_0x4f8125,_0x42c240]=await Promise[_0x4e4f1c(0x20d)]([withSpinner(_0x4e4f1c(0x29d),()=>_0x412c11[_0x4e4f1c(0x233)]['getParent'](_0x21f120),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x412c11['segment'][_0x4e4f1c(0x29a)](_0x21f120),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x412c11[_0x4e4f1c(0x233)][_0x4e4f1c(0x212)](_0x21f120),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x412c11[_0x4e4f1c(0x204)]['listJourneysFromParentSegment'](_0x21f120),{'verbose':_0x1a7b21['verbose']}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x412c11[_0x4e4f1c(0x257)][_0x4e4f1c(0x21e)](),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]})[_0x4e4f1c(0x284)](_0x32fa37=>_0x32fa37['data'])]),_0x29ae5a=_0x38dc86[_0x4e4f1c(0x253)],_0x5e821c=_0x29ae5a['relationships']?.[_0x4e4f1c(0x2c4)]?.[_0x4e4f1c(0x253)]?.['id']||_0x29ae5a[_0x4e4f1c(0x2d4)]?.['parentFolder']?.[_0x4e4f1c(0x253)]?.['id'],_0x193067=_0x28bb42[_0x4e4f1c(0x253)],_0x35e0ab=_0x4ad8c5['data'],_0x464d02=_0x4f8125[_0x4e4f1c(0x253)],{emailToId:_0x1e5a5f,idToEmail:_0x4e534f}=_0x42c240,[_0x2e76a9,_0x4941da]=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x2364e0=_0x4e4f1c,[_0x171461,_0x13c80d]=await Promise[_0x2364e0(0x20d)]([_0x412c11[_0x2364e0(0x262)][_0x2364e0(0x205)](),_0x412c11[_0x2364e0(0x262)][_0x2364e0(0x295)]()]);return[_0x171461,_0x13c80d];},{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]})['then'](_0x1a084a=>_0x1a084a[_0x4e4f1c(0x253)]),_0x268b36=buildFolderPathToIdMap(_0x35e0ab),_0xe23df7=new Map();for(const [_0x455f3b,_0x2dfc1e]of _0x268b36[_0x4e4f1c(0x234)]()){_0xe23df7[_0x4e4f1c(0x27a)](_0x2dfc1e,_0x455f3b);}const _0x205db8=new Map();for(const _0x33612a of _0x193067){const _0x233c28=_0x33612a[_0x4e4f1c(0x250)]?_0xe23df7[_0x4e4f1c(0x244)](_0x33612a['segmentFolderId'][_0x4e4f1c(0x2ab)]())||'':'',_0x50fc6a=_0x233c28+':'+_0x33612a[_0x4e4f1c(0x21b)];_0x205db8['set'](_0x50fc6a,_0x33612a);}const _0x586bbf=new Map();for(const _0x4097c1 of _0x193067){_0x586bbf[_0x4e4f1c(0x27a)](_0x4097c1[_0x4e4f1c(0x21b)],_0x4097c1['id']);}const _0x1b2919=new Map();for(const _0x1a643e of _0x464d02){const _0x56cdd5=_0x1a643e[_0x4e4f1c(0x268)]?_0xe23df7[_0x4e4f1c(0x244)](_0x1a643e[_0x4e4f1c(0x268)])||'':'',_0x3d55ef=_0x56cdd5+':'+_0x1a643e['journeyBundleName'];!_0x1b2919['has'](_0x3d55ef)&&_0x1b2919['set'](_0x3d55ef,[]),_0x1b2919[_0x4e4f1c(0x244)](_0x3d55ef)[_0x4e4f1c(0x237)](_0x1a643e);}for(const _0x1dda76 of _0x1b2919[_0x4e4f1c(0x21d)]()){_0x1dda76[_0x4e4f1c(0x2b9)]((_0x28f9dd,_0x561380)=>(_0x28f9dd[_0x4e4f1c(0x1fb)]||0x0)-(_0x561380[_0x4e4f1c(0x1fb)]||0x0));}let _0xc52129;if(_0x1d4589){if(!_0x1d4589[_0x4e4f1c(0x228)](_0x4e4f1c(0x1e9))&&!_0x1d4589[_0x4e4f1c(0x228)](_0x4e4f1c(0x21c)))return console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x219)](_0x4e4f1c(0x24b)+_0x1d4589+'\x0a')),0x1;_0xc52129=[_0x1d4589];}else _0xc52129=findYamlFiles(_0x5b7a6f);if(_0xc52129['length']===0x0)return console[_0x4e4f1c(0x28f)](a36_0x20973d['red'](_0x4e4f1c(0x1f2)+_0x5b7a6f+'\x0a')),console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x2a0)](_0x4e4f1c(0x248))),0x1;const _0x42c254=[],_0x46cc3e=[];for(const _0x79b301 of _0xc52129){const _0x4baad9=a36_0x23b535[_0x4e4f1c(0x25f)](_0x5b7a6f,a36_0x23b535[_0x4e4f1c(0x29e)](_0x79b301)),_0x55deff=_0x4baad9==='.'?'':_0x4baad9,_0x538009=readFileSync(_0x79b301,_0x4e4f1c(0x247));try{const _0x10f406=a36_0x575e8b[_0x4e4f1c(0x267)](_0x538009);if(isJourneyYaml(_0x10f406)){const _0x2e0f26=a36_0x1dccde(_0x538009);_0x46cc3e[_0x4e4f1c(0x237)]({'yamlConfig':_0x2e0f26,'folderPath':_0x55deff,'sourcePath':_0x79b301});}else{if(!_0x1a7b21[_0x4e4f1c(0x2a3)]){const _0x304a63=parseSegmentYamlFile(_0x538009),_0x40aab8=normalizeChildSegmentYaml(_0x304a63);_0x42c254[_0x4e4f1c(0x237)]({'yamlConfig':_0x40aab8,'folderPath':_0x55deff,'sourcePath':_0x79b301});}}}catch(_0x1b81db){return console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x219)](_0x4e4f1c(0x25e)+_0x79b301+':\x20'+(_0x1b81db instanceof Error?_0x1b81db[_0x4e4f1c(0x260)]:_0x1b81db))),0x1;}}if(_0x42c254['length']===0x0&&_0x46cc3e[_0x4e4f1c(0x23b)]===0x0){const _0x4af277=_0x1a7b21[_0x4e4f1c(0x2a3)]?'journey':_0x4e4f1c(0x282);return console['error'](a36_0x20973d[_0x4e4f1c(0x1f0)](_0x4e4f1c(0x223)+_0x4af277+_0x4e4f1c(0x20f))),0x0;}const _0x40c4bc=new Map();_0x193067[_0x4e4f1c(0x23b)]>0x0&&!_0x1a7b21['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x193067,async _0x5a7c45=>{const _0x40ea6f=a36_0x2d92,_0x1e2650=await _0x412c11[_0x40ea6f(0x233)][_0x40ea6f(0x225)](_0x21f120,_0x5a7c45['id']);_0x40c4bc[_0x40ea6f(0x27a)](_0x5a7c45['id'],_0x1e2650);});},{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]});const _0xf41464=[],_0x51eca8=new Set();for(const {yamlConfig:_0x2d4662,folderPath:_0x2b333c,sourcePath:_0xa9c1ff}of _0x42c254){const _0x5bd13e=resolveTDFolderPath(_0x2b333c,_0x27eca8,_0x360e87),_0x418898=_0x5bd13e+':'+_0x2d4662[_0x4e4f1c(0x21b)],_0xf8fc16=_0x205db8[_0x4e4f1c(0x244)](_0x418898),_0x3908a7=_0xf8fc16?_0x40c4bc['get'](_0xf8fc16['id'])||[]:[];if(_0x5bd13e&&!_0x268b36[_0x4e4f1c(0x243)](_0x5bd13e)){const _0x4b87bd=_0x5bd13e[_0x4e4f1c(0x2b5)]('/');let _0x697702='';for(const _0x1026a8 of _0x4b87bd){_0x697702=_0x697702?_0x697702+'/'+_0x1026a8:_0x1026a8,!_0x268b36[_0x4e4f1c(0x243)](_0x697702)&&_0x51eca8['add'](_0x697702);}}const _0x37cdf6=calculateActivationActions(_0x2d4662[_0x4e4f1c(0x2d0)]||[],_0x3908a7,_0x4e534f,_0x4941da),_0x1e5176=segmentToYamlString(_0x2d4662);let _0x113628,_0x477ecc=![],_0x4da142;if(_0xf8fc16){const _0x14b952=segmentWithActivationsToYaml(_0xf8fc16,_0x3908a7,undefined,_0x4e534f,_0x4941da),_0x2cae34=segmentToYamlString(_0x14b952);_0x113628=generateDiff(_0x2cae34,_0x1e5176),_0x477ecc=hasChanges(_0x113628),_0x477ecc&&(_0x4da142=formatDiffWithColors(_0x113628));}else _0x113628=generateDiff('',_0x1e5176),_0x4da142=formatDiffWithColors(_0x113628);_0xf41464[_0x4e4f1c(0x237)]({'relativePath':_0x2d4662[_0x4e4f1c(0x21b)],'absolutePath':_0xa9c1ff,'yamlConfig':_0x2d4662,'folderPath':_0x5bd13e,'existingSegment':_0xf8fc16,'existingActivations':_0x3908a7,'isNew':!_0xf8fc16,'hasChanges':_0x477ecc,'diff':_0x4da142,'activationActions':_0x37cdf6});}let _0x1cbbcd=[];if(!_0x1d4589){const _0x556c22=new Set();for(const {yamlConfig:_0x968a2b,folderPath:_0x319127}of _0x42c254){const _0x5af6b1=resolveTDFolderPath(_0x319127,_0x27eca8,_0x360e87);_0x556c22[_0x4e4f1c(0x249)](_0x5af6b1+':'+_0x968a2b['name']);}_0x1cbbcd=_0x193067[_0x4e4f1c(0x278)](_0x6cde77=>{const _0x3034eb=_0x4e4f1c,_0x1c64e5=_0x6cde77[_0x3034eb(0x250)]?_0xe23df7['get'](_0x6cde77[_0x3034eb(0x250)][_0x3034eb(0x2ab)]())||'':'',_0x3f9b48=_0x1c64e5+':'+_0x6cde77[_0x3034eb(0x21b)];if(_0x556c22['has'](_0x3f9b48))return![];if(_0x27eca8)return _0x1c64e5===_0x360e87||_0x1c64e5[_0x3034eb(0x280)](_0x360e87+'/');return!![];});}const _0xcae309=[];for(const {yamlConfig:_0x42e914,folderPath:_0x1d3b6f,sourcePath:_0x5186e5}of _0x46cc3e){const _0x506cdb=resolveTDFolderPath(_0x1d3b6f,_0x27eca8,_0x360e87),_0x3e20a2=_0x506cdb+':'+_0x42e914['name'],_0x7d39b0=_0x1b2919[_0x4e4f1c(0x244)](_0x3e20a2);let _0x3f8bbf,_0x7631eb;if(_0x7d39b0&&_0x7d39b0[_0x4e4f1c(0x23b)]>0x0){const _0x34276a=new Set(),_0x590e66=new Set(),_0x296038=new Map(),_0x2fa03b=new Map(),_0x19a4d9=createJumpTargetCache(),_0x72504f=_0x2b1f14=>({'resolveSegment':async _0x43cb4d=>{const _0x51d273=_0x4e4f1c,_0x1c07a1=_0x2fa03b[_0x51d273(0x244)](_0x43cb4d);if(_0x1c07a1!==undefined)return{'name':_0x1c07a1,'isJourneyLocal':!![]};try{let _0x55a30b=_0x193067[_0x51d273(0x20c)](_0x4b4d1b=>_0x4b4d1b['id']===_0x43cb4d);!_0x55a30b&&(_0x55a30b=await _0x412c11['segment'][_0x51d273(0x271)](_0x21f120,_0x43cb4d));const _0x9949ac=generateJourneyLocalName(_0x55a30b['name']),_0x4fba85=_0x55a30b[_0x51d273(0x272)]===SEGMENT_KIND_JOURNEY&&_0x9949ac!==undefined;let _0x536cff=_0x55a30b[_0x51d273(0x21b)];if(_0x4fba85&&_0x9949ac){let _0x322f66=_0x9949ac,_0x2f10ee=0x2;while(_0x34276a[_0x51d273(0x243)](_0x322f66)){_0x322f66=_0x9949ac+'_'+_0x2f10ee,_0x2f10ee++;}_0x34276a[_0x51d273(0x249)](_0x322f66),_0x536cff=_0x322f66,_0x2fa03b[_0x51d273(0x27a)](_0x43cb4d,_0x536cff);}let _0xf9954a;return _0x4fba85&&_0x55a30b[_0x51d273(0x22f)]&&(_0xf9954a={'description':_0x55a30b[_0x51d273(0x256)],'rule':apiRuleToYaml(_0x55a30b[_0x51d273(0x22f)])}),{'name':_0x536cff,'isJourneyLocal':_0x4fba85,'definition':_0xf9954a};}catch{return{'name':_0x43cb4d,'isJourneyLocal':![]};}},'resolveActivation':async _0x421057=>{const _0x53ab87=_0x4e4f1c,_0x3e12fb=_0x296038[_0x53ab87(0x244)](_0x421057);if(_0x3e12fb!==undefined)return{'name':_0x3e12fb,'isJourneyLocal':!![]};try{const _0x2c3da9=await _0x412c11['journey'][_0x53ab87(0x2b3)](_0x2b1f14,_0x421057),_0xa9fe9d=_0x2c3da9[_0x53ab87(0x227)][_0x53ab87(0x2b0)][_0x53ab87(0x21b)]||_0x421057,_0x4c3dca=sanitizeYamlKey(_0xa9fe9d)||_0x53ab87(0x20e)+_0x421057;let _0x5b88ed=_0x4c3dca,_0x4c9581=0x2;while(_0x590e66[_0x53ab87(0x243)](_0x5b88ed)){_0x5b88ed=_0x4c3dca+'_'+_0x4c9581,_0x4c9581++;}_0x590e66[_0x53ab87(0x249)](_0x5b88ed),_0x296038[_0x53ab87(0x27a)](_0x421057,_0x5b88ed);const _0xa704c3=journeyActivationStepToYaml(_0x2c3da9,_0x4e534f,_0x4941da);return{'name':_0x5b88ed,'isJourneyLocal':!![],'definition':_0xa704c3};}catch{return{'name':_0x421057,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xd87f1,_0x34a1e8)=>resolveJumpTarget(_0xd87f1,_0x34a1e8,_0x19a4d9,_0xe4d0b4=>_0x412c11[_0x4e4f1c(0x204)][_0x4e4f1c(0x208)](_0xe4d0b4))}),_0x300e14=hasMultipleVersions(_0x42e914);if(_0x300e14&&_0x7d39b0['length']>0x1){const _0x210f88=[];for(const _0x3b2053 of _0x7d39b0){const _0x3013e4=await withSpinner(_0x4e4f1c(0x259)+_0x42e914[_0x4e4f1c(0x21b)]+_0x4e4f1c(0x2ac)+(_0x3b2053[_0x4e4f1c(0x1fb)]||0x1)+'...',()=>_0x412c11[_0x4e4f1c(0x204)]['getJourney'](_0x3b2053['id']),{'verbose':_0x1a7b21['verbose']}),_0x52520e=_0x72504f(_0x3b2053['id']),_0x82ba84=await apiToYamlAsync(_0x3013e4[_0x4e4f1c(0x253)],_0x52520e);_0x210f88[_0x4e4f1c(0x237)]({'item':_0x3b2053,'yaml':_0x82ba84});}_0x7631eb=buildMergedJourneyYaml(_0x210f88);const _0x138ea0=Math[_0x4e4f1c(0x2a1)](..._0x210f88['map'](_0x1cb14a=>_0x1cb14a[_0x4e4f1c(0x2bc)][_0x4e4f1c(0x1fb)]||0x0)),_0x4ef4c6=_0x7d39b0['find'](_0x411953=>(_0x411953[_0x4e4f1c(0x1fb)]||0x0)===_0x138ea0);_0x4ef4c6&&(_0x3f8bbf=await _0x412c11[_0x4e4f1c(0x204)][_0x4e4f1c(0x208)](_0x4ef4c6['id']));}else{const _0x60b864=_0x7d39b0[_0x7d39b0[_0x4e4f1c(0x23b)]-0x1],_0x44050b=await withSpinner(_0x4e4f1c(0x259)+_0x42e914[_0x4e4f1c(0x21b)]+_0x4e4f1c(0x246),()=>_0x412c11[_0x4e4f1c(0x204)][_0x4e4f1c(0x208)](_0x60b864['id']),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]});_0x3f8bbf=_0x44050b[_0x4e4f1c(0x253)];const _0x1ce8f5=_0x72504f(_0x60b864['id']);_0x7631eb=await apiToYamlAsync(_0x3f8bbf,_0x1ce8f5);}}if(_0x506cdb&&!_0x268b36[_0x4e4f1c(0x243)](_0x506cdb)){const _0x38cc13=_0x506cdb[_0x4e4f1c(0x2b5)]('/');let _0x1da2fb='';for(const _0x34b163 of _0x38cc13){_0x1da2fb=_0x1da2fb?_0x1da2fb+'/'+_0x34b163:_0x34b163,!_0x268b36['has'](_0x1da2fb)&&_0x51eca8[_0x4e4f1c(0x249)](_0x1da2fb);}}const _0x44ef96=normalizeJourneyYaml(_0x42e914),_0x54f2d1=a36_0x238ca4(_0x44ef96);let _0x148bd9=![],_0x5ebb55;if(_0x7631eb){const _0x3df01e=normalizeJourneyYaml(_0x7631eb),_0x4f04d6=a36_0x238ca4(_0x3df01e),_0x48b458=generateDiff(_0x4f04d6,_0x54f2d1);_0x148bd9=hasChanges(_0x48b458),_0x148bd9&&(_0x5ebb55=formatDiffWithColors(_0x48b458));}else{const _0x571120=generateDiff('',_0x54f2d1);_0x5ebb55=formatDiffWithColors(_0x571120);}_0xcae309['push']({'relativePath':_0x42e914[_0x4e4f1c(0x21b)],'absolutePath':_0x5186e5,'yamlConfig':_0x42e914,'folderPath':_0x506cdb,'existingJourney':_0x3f8bbf,'isNew':!_0x3f8bbf,'hasChanges':_0x148bd9,'diff':_0x5ebb55});}let _0x31acd4=[];if(!_0x1d4589){const _0x4f7d37=new Set();for(const {yamlConfig:_0xd59869,folderPath:_0xcd2dc6}of _0x46cc3e){const _0x172fee=resolveTDFolderPath(_0xcd2dc6,_0x27eca8,_0x360e87);_0x4f7d37[_0x4e4f1c(0x249)](_0x172fee+':'+_0xd59869['name']);}_0x31acd4=_0x464d02[_0x4e4f1c(0x278)](_0x1e6924=>{const _0x374106=_0x4e4f1c,_0xaaa07b=_0x1e6924['folderId']?_0xe23df7[_0x374106(0x244)](_0x1e6924[_0x374106(0x268)])||'':'',_0x1e83b0=_0xaaa07b+':'+_0x1e6924[_0x374106(0x1e6)];if(_0x4f7d37[_0x374106(0x243)](_0x1e83b0))return![];if(_0x27eca8)return _0xaaa07b===_0x360e87||_0xaaa07b[_0x374106(0x280)](_0x360e87+'/');return!![];});}const _0x6f41bd=_0xf41464[_0x4e4f1c(0x278)](_0x1d6db3=>_0x1d6db3['isNew']),_0x100d02=_0xf41464[_0x4e4f1c(0x278)](_0x4f288b=>!_0x4f288b[_0x4e4f1c(0x2d1)]&&_0x4f288b[_0x4e4f1c(0x24f)]),_0x817128=_0xf41464[_0x4e4f1c(0x278)](_0x5357d9=>!_0x5357d9['isNew']&&!_0x5357d9[_0x4e4f1c(0x24f)]),_0x50b7fc=Array[_0x4e4f1c(0x1e2)](_0x51eca8)[_0x4e4f1c(0x2b9)](),_0xf13393=_0x1a7b21[_0x4e4f1c(0x202)]?_0x1cbbcd:[],_0x2c0ee0=_0x1a7b21[_0x4e4f1c(0x202)]?_0x31acd4:[],_0x167d72=_0xf41464[_0x4e4f1c(0x21f)](_0x475aa6=>_0x475aa6[_0x4e4f1c(0x236)]),_0x51da42=_0x167d72['filter'](_0x35a415=>_0x35a415[_0x4e4f1c(0x2d2)]===_0x4e4f1c(0x215)),_0x134543=_0x167d72['filter'](_0x4dffa8=>_0x4dffa8[_0x4e4f1c(0x2d2)]===_0x4e4f1c(0x29f)),_0x2a7c77=_0x167d72[_0x4e4f1c(0x278)](_0xdf7334=>_0xdf7334[_0x4e4f1c(0x2d2)]===_0x4e4f1c(0x202)),_0xb7efa1=_0xcae309[_0x4e4f1c(0x278)](_0x5df0e1=>_0x5df0e1[_0x4e4f1c(0x2d1)]),_0x594f6f=_0xcae309['filter'](_0x11722d=>!_0x11722d[_0x4e4f1c(0x2d1)]&&_0x11722d[_0x4e4f1c(0x24f)]),_0x59bae3=_0xcae309[_0x4e4f1c(0x278)](_0x4eed34=>!_0x4eed34[_0x4e4f1c(0x2d1)]&&!_0x4eed34['hasChanges']);console[_0x4e4f1c(0x28f)]('\x0aPush\x20summary\x20for\x20\x27'+_0x1b8a64+'\x27:');_0x50b7fc[_0x4e4f1c(0x23b)]>0x0&&console['error']('\x20\x20'+a36_0x20973d[_0x4e4f1c(0x231)](_0x4e4f1c(0x2a6)+_0x50b7fc[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x292)));if(!_0x1a7b21['journeysOnly']){console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x1e8)),console['error'](_0x4e4f1c(0x1e5)+a36_0x20973d['green']('+\x20'+_0x6f41bd[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x28c))),console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x1e5)+a36_0x20973d['yellow']('~\x20'+_0x100d02[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x2b4)));if(_0xf13393[_0x4e4f1c(0x23b)]>0x0)console['error'](_0x4e4f1c(0x1e5)+a36_0x20973d[_0x4e4f1c(0x219)]('-\x20'+_0xf13393['length']+_0x4e4f1c(0x289)));else _0x1cbbcd[_0x4e4f1c(0x23b)]>0x0&&!_0x1a7b21[_0x4e4f1c(0x202)]&&console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x1e5)+a36_0x20973d[_0x4e4f1c(0x238)](_0x1cbbcd[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x2cf)));console[_0x4e4f1c(0x28f)]('\x20\x20\x20\x20'+a36_0x20973d[_0x4e4f1c(0x238)]('=\x20'+_0x817128[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x200)));}if(_0xcae309[_0x4e4f1c(0x23b)]>0x0||_0x31acd4['length']>0x0){console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x232)),console['error']('\x20\x20\x20\x20'+a36_0x20973d[_0x4e4f1c(0x23d)]('+\x20'+_0xb7efa1[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x28c))),console[_0x4e4f1c(0x28f)]('\x20\x20\x20\x20'+a36_0x20973d['yellow']('~\x20'+_0x594f6f[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x2b4)));if(_0x2c0ee0['length']>0x0)console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x1e5)+a36_0x20973d[_0x4e4f1c(0x219)]('-\x20'+_0x2c0ee0[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x289)));else _0x31acd4['length']>0x0&&!_0x1a7b21[_0x4e4f1c(0x202)]&&console['error'](_0x4e4f1c(0x1e5)+a36_0x20973d[_0x4e4f1c(0x238)](_0x31acd4[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x2cf)));console['error'](_0x4e4f1c(0x1e5)+a36_0x20973d[_0x4e4f1c(0x238)]('=\x20'+_0x59bae3[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x200)));}_0x167d72[_0x4e4f1c(0x23b)]>0x0&&!_0x1a7b21[_0x4e4f1c(0x2a3)]&&(console[_0x4e4f1c(0x28f)](''),console['error'](_0x4e4f1c(0x28a)),_0x51da42[_0x4e4f1c(0x23b)]>0x0&&console[_0x4e4f1c(0x28f)]('\x20\x20\x20\x20'+a36_0x20973d['green']('+\x20'+_0x51da42[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x27d))),_0x134543[_0x4e4f1c(0x23b)]>0x0&&console['error'](_0x4e4f1c(0x1e5)+a36_0x20973d['yellow']('~\x20'+_0x134543[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x258))),_0x2a7c77[_0x4e4f1c(0x23b)]>0x0&&console['error'](_0x4e4f1c(0x1e5)+a36_0x20973d[_0x4e4f1c(0x219)]('-\x20'+_0x2a7c77[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x289))));console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x2ca)+a36_0x20973d['cyan'](_0x5b7a6f)+'\x0a');if(_0x50b7fc[_0x4e4f1c(0x23b)]>0x0){console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x217));for(const _0x56aa13 of _0x50b7fc){console[_0x4e4f1c(0x28f)]('\x20\x20'+a36_0x20973d[_0x4e4f1c(0x231)]('+')+'\x20'+_0x56aa13);}console[_0x4e4f1c(0x28f)]('');}if(_0x6f41bd[_0x4e4f1c(0x23b)]>0x0&&!_0x1a7b21['journeysOnly'])for(const _0x7d33bb of _0x6f41bd){const _0x3a7e34=_0x7d33bb[_0x4e4f1c(0x28d)]?_0x7d33bb[_0x4e4f1c(0x28d)]+'/'+_0x7d33bb[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)]:_0x7d33bb['yamlConfig'][_0x4e4f1c(0x21b)],_0x4a2d65=_0x7d33bb['yamlConfig'][_0x4e4f1c(0x2d0)]?.[_0x4e4f1c(0x23b)]||0x0,_0xcd84ad=_0x4a2d65>0x0?a36_0x20973d[_0x4e4f1c(0x238)]('\x20['+_0x4a2d65+_0x4e4f1c(0x22b)):'';console[_0x4e4f1c(0x28f)]('\x0a'+a36_0x20973d[_0x4e4f1c(0x23d)](_0x4e4f1c(0x1f8))+'\x20'+_0x3a7e34+_0xcd84ad),console[_0x4e4f1c(0x28f)]('─'[_0x4e4f1c(0x214)](0x3c)),_0x7d33bb['diff']&&console[_0x4e4f1c(0x28f)](_0x7d33bb[_0x4e4f1c(0x2c0)]),console['error']('─'[_0x4e4f1c(0x214)](0x3c));}if(_0xf13393[_0x4e4f1c(0x23b)]>0x0&&!_0x1a7b21[_0x4e4f1c(0x2a3)])for(const _0x55312a of _0xf13393){const _0x2261d6=_0x55312a[_0x4e4f1c(0x250)]?_0xe23df7[_0x4e4f1c(0x244)](_0x55312a['segmentFolderId'][_0x4e4f1c(0x2ab)]())||'':'',_0x4eb4dd=_0x2261d6?_0x2261d6+'/'+_0x55312a[_0x4e4f1c(0x21b)]:_0x55312a['name'],_0x512a57=_0x40c4bc['get'](_0x55312a['id'])||[],_0x24235f=_0x512a57[_0x4e4f1c(0x23b)]>0x0?a36_0x20973d[_0x4e4f1c(0x238)]('\x20['+_0x512a57[_0x4e4f1c(0x23b)]+_0x4e4f1c(0x22b)):'';console['error']('\x0a'+a36_0x20973d[_0x4e4f1c(0x219)]('Delete\x20segment:')+'\x20'+_0x4eb4dd+_0x24235f),console['error']('─'['repeat'](0x3c));const _0x43f64e=segmentWithActivationsToYaml(_0x55312a,_0x512a57,undefined,_0x4e534f,_0x4941da),_0x23d36f=segmentToYamlString(_0x43f64e),_0x5e2f1d=generateDiff(_0x23d36f,'');console[_0x4e4f1c(0x28f)](formatDiffWithColors(_0x5e2f1d)),console['error']('─'[_0x4e4f1c(0x214)](0x3c));}const _0x3d7d4a=_0xf41464[_0x4e4f1c(0x278)](_0x53ed24=>!_0x53ed24[_0x4e4f1c(0x2d1)]&&_0x53ed24['diff']);if(_0x3d7d4a['length']>0x0&&!_0x1a7b21[_0x4e4f1c(0x2a3)])for(const _0x5395ee of _0x3d7d4a){const _0x3a2514=_0x5395ee[_0x4e4f1c(0x28d)]?_0x5395ee[_0x4e4f1c(0x28d)]+'/'+_0x5395ee[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)]:_0x5395ee[_0x4e4f1c(0x1fe)]['name'];console[_0x4e4f1c(0x28f)]('\x0a'+a36_0x20973d[_0x4e4f1c(0x1f0)](_0x4e4f1c(0x2b1))+'\x20'+_0x3a2514),console[_0x4e4f1c(0x28f)]('─'[_0x4e4f1c(0x214)](0x3c)),console['error'](_0x5395ee[_0x4e4f1c(0x2c0)]),console[_0x4e4f1c(0x28f)]('─'[_0x4e4f1c(0x214)](0x3c));}if(_0xb7efa1[_0x4e4f1c(0x23b)]>0x0)for(const _0x5ebf0e of _0xb7efa1){const _0x1b84a4=_0x5ebf0e[_0x4e4f1c(0x28d)]?_0x5ebf0e[_0x4e4f1c(0x28d)]+'/'+_0x5ebf0e[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)]:_0x5ebf0e[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)];console[_0x4e4f1c(0x28f)]('\x0a'+a36_0x20973d['green'](_0x4e4f1c(0x2cd))+'\x20'+_0x1b84a4),console[_0x4e4f1c(0x28f)]('─'['repeat'](0x3c)),_0x5ebf0e[_0x4e4f1c(0x2c0)]&&console['error'](_0x5ebf0e[_0x4e4f1c(0x2c0)]),console['error']('─'[_0x4e4f1c(0x214)](0x3c));}const _0x4c580c=_0xcae309[_0x4e4f1c(0x278)](_0x45d9b2=>!_0x45d9b2[_0x4e4f1c(0x2d1)]&&_0x45d9b2[_0x4e4f1c(0x2c0)]);if(_0x4c580c[_0x4e4f1c(0x23b)]>0x0)for(const _0x19062e of _0x4c580c){const _0x11eb39=_0x19062e[_0x4e4f1c(0x28d)]?_0x19062e[_0x4e4f1c(0x28d)]+'/'+_0x19062e[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)]:_0x19062e[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)];console[_0x4e4f1c(0x28f)]('\x0a'+a36_0x20973d[_0x4e4f1c(0x1f0)](_0x4e4f1c(0x245))+'\x20'+_0x11eb39),console[_0x4e4f1c(0x28f)]('─'[_0x4e4f1c(0x214)](0x3c)),console[_0x4e4f1c(0x28f)](_0x19062e[_0x4e4f1c(0x2c0)]),console[_0x4e4f1c(0x28f)]('─'['repeat'](0x3c));}if(_0x2c0ee0[_0x4e4f1c(0x23b)]>0x0)for(const _0x1fae15 of _0x2c0ee0){const _0x3b1804=_0x1fae15['folderId']?_0xe23df7[_0x4e4f1c(0x244)](_0x1fae15[_0x4e4f1c(0x268)])||'':'',_0x163915=_0x3b1804?_0x3b1804+'/'+_0x1fae15['journeyBundleName']:_0x1fae15[_0x4e4f1c(0x1e6)];console[_0x4e4f1c(0x28f)]('\x0a'+a36_0x20973d[_0x4e4f1c(0x219)](_0x4e4f1c(0x288))+'\x20'+_0x163915),console[_0x4e4f1c(0x28f)]('─'[_0x4e4f1c(0x214)](0x3c)),console[_0x4e4f1c(0x28f)](a36_0x20973d['red'](_0x4e4f1c(0x22c))),console['error']('─'[_0x4e4f1c(0x214)](0x3c));}if(_0x1a7b21[_0x4e4f1c(0x1fd)])return console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x1f0)](_0x4e4f1c(0x207))),0x0;const _0x17f128=_0x1a7b21[_0x4e4f1c(0x2a3)]?![]:_0x6f41bd[_0x4e4f1c(0x23b)]>0x0||_0x100d02[_0x4e4f1c(0x23b)]>0x0||_0xf13393['length']>0x0,_0x40dcdc=_0xb7efa1['length']>0x0||_0x594f6f[_0x4e4f1c(0x23b)]>0x0||_0x2c0ee0[_0x4e4f1c(0x23b)]>0x0,_0x4d413b=_0x1a7b21[_0x4e4f1c(0x2a3)]?![]:_0x167d72[_0x4e4f1c(0x23b)]>0x0,_0x4becc5=_0x50b7fc[_0x4e4f1c(0x23b)]>0x0;if(!_0x17f128&&!_0x40dcdc&&!_0x4d413b&&!_0x4becc5){const _0xd2aa36=_0x1a7b21[_0x4e4f1c(0x2a3)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x4e4f1c(0x2a5);console[_0x4e4f1c(0x28f)](a36_0x20973d['green'](_0xd2aa36));if(_0x1d4589&&_0x59bae3[_0x4e4f1c(0x23b)]===0x1){const _0x4497f3=_0x59bae3[0x0];if(_0x4497f3[_0x4e4f1c(0x1e3)]?.['id']){const _0x39a29d=getConsoleNextUrl(_0x1a7b21['site'],'/app/ps/'+_0x21f120+_0x4e4f1c(0x220)+_0x4497f3[_0x4e4f1c(0x1e3)]['id']+_0x4e4f1c(0x20a));console[_0x4e4f1c(0x28f)]('\x20\x20'+a36_0x20973d['cyan'](_0x39a29d));}}return 0x0;}const _0xaa6510=_0x1a7b21[_0x4e4f1c(0x2a3)]?_0xb7efa1[_0x4e4f1c(0x23b)]+_0x594f6f[_0x4e4f1c(0x23b)]+_0x2c0ee0['length']+_0x50b7fc[_0x4e4f1c(0x23b)]:_0x6f41bd[_0x4e4f1c(0x23b)]+_0x100d02[_0x4e4f1c(0x23b)]+_0xf13393[_0x4e4f1c(0x23b)]+_0xb7efa1[_0x4e4f1c(0x23b)]+_0x594f6f[_0x4e4f1c(0x23b)]+_0x2c0ee0['length']+_0x50b7fc[_0x4e4f1c(0x23b)]+_0x167d72[_0x4e4f1c(0x23b)];if(!_0x1a7b21[_0x4e4f1c(0x1f6)]&&_0xaa6510>0x0){const _0x1993a0=await confirmKey(_0x4e4f1c(0x266)+_0xaa6510+_0x4e4f1c(0x263));if(!_0x1993a0)return console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x269)),0x1;}for(const _0x4cf759 of _0x50b7fc){const _0x508f1e=_0x4cf759[_0x4e4f1c(0x2b5)]('/'),_0xd628ee=_0x508f1e[_0x508f1e[_0x4e4f1c(0x23b)]-0x1],_0x48b4c9=_0x508f1e[_0x4e4f1c(0x235)](0x0,-0x1)[_0x4e4f1c(0x2be)]('/'),_0x400162=_0x268b36[_0x4e4f1c(0x244)](_0x48b4c9),_0x56a71c={'name':_0xd628ee,'parentFolderId':_0x400162},_0x378745=await withSpinner('Creating\x20folder\x20\x27'+_0x4cf759+_0x4e4f1c(0x2c3),()=>_0x412c11[_0x4e4f1c(0x233)][_0x4e4f1c(0x2aa)](_0x21f120,_0x56a71c),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]});_0x268b36[_0x4e4f1c(0x27a)](_0x4cf759,_0x378745[_0x4e4f1c(0x253)]['id']),console['error'](a36_0x20973d[_0x4e4f1c(0x231)](_0x4e4f1c(0x2b8)+_0x4cf759+'\x27'));}let _0x32dbd0=0x0,_0x1e3753=0x0,_0x17942c=0x0,_0x42d14d=0x0,_0x2e8082=0x0,_0x402015=0x0;const _0x3121c3=new Map();for(const _0x2e4c99 of _0x1a7b21[_0x4e4f1c(0x2a3)]?[]:_0xf41464){const _0x142321=_0x2e4c99[_0x4e4f1c(0x28d)]?_0x268b36[_0x4e4f1c(0x244)](_0x2e4c99[_0x4e4f1c(0x28d)]):undefined;let _0x1c2623;try{if(_0x2e4c99[_0x4e4f1c(0x2d1)]){const _0xe43a71=yamlToCreateRequest(_0x2e4c99[_0x4e4f1c(0x1fe)],_0x142321),_0x187be6=await withSpinner(_0x4e4f1c(0x25d)+_0x2e4c99[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)]+'\x27...',()=>_0x412c11[_0x4e4f1c(0x233)][_0x4e4f1c(0x1f4)](_0x21f120,_0xe43a71),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]});_0x1c2623=_0x187be6[_0x4e4f1c(0x253)]['id'],_0x3121c3['set'](_0x2e4c99[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)],_0x1c2623),console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x23d)](_0x4e4f1c(0x2cc)+_0x2e4c99[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)]+'\x27')),_0x32dbd0++;}else{if(_0x2e4c99[_0x4e4f1c(0x24f)]){const _0x64952e=yamlToUpdateRequest(_0x2e4c99[_0x4e4f1c(0x1fe)]);_0x142321!==_0x2e4c99['existingSegment']?.[_0x4e4f1c(0x250)]&&(_0x64952e[_0x4e4f1c(0x250)]=_0x142321?parseInt(_0x142321,0xa):undefined),await withSpinner(_0x4e4f1c(0x2ad)+_0x2e4c99[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)]+'\x27...',()=>_0x412c11[_0x4e4f1c(0x233)]['updateSegmentById'](_0x21f120,_0x2e4c99[_0x4e4f1c(0x1ed)]['id'],_0x64952e),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]}),_0x1c2623=_0x2e4c99['existingSegment']['id'],console['error'](a36_0x20973d[_0x4e4f1c(0x1f0)](_0x4e4f1c(0x27f)+_0x2e4c99[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)]+'\x27')),_0x1e3753++;}else _0x1c2623=_0x2e4c99[_0x4e4f1c(0x1ed)]['id'];}}catch(_0x328891){const _0xc61a08=isHttp400Error(_0x328891),_0x586d31=_0xc61a08?ErrorCode[_0x4e4f1c(0x255)]:ErrorCode[_0x4e4f1c(0x2ba)],_0x5e4eef=getErrorMessage(_0x328891);throw new SDKError(_0x586d31,_0x4e4f1c(0x218)+(_0x2e4c99[_0x4e4f1c(0x2d1)]?'create':_0x4e4f1c(0x29f))+'\x20segment\x20from\x20file:\x20'+_0x2e4c99[_0x4e4f1c(0x2b2)]+_0x4e4f1c(0x1e7)+_0x5e4eef,_0x328891);}for(const _0x1eef10 of _0x2e4c99[_0x4e4f1c(0x236)]){try{if(_0x1eef10[_0x4e4f1c(0x2d2)]===_0x4e4f1c(0x215)&&_0x1eef10[_0x4e4f1c(0x281)]){const _0x387849=yamlActivationToCreateRequest(_0x1eef10[_0x4e4f1c(0x281)],_0x1e5a5f,_0x2e76a9);await withSpinner(_0x4e4f1c(0x206)+_0x1eef10[_0x4e4f1c(0x21b)]+_0x4e4f1c(0x2c3),()=>_0x412c11['segment'][_0x4e4f1c(0x239)](_0x21f120,_0x1c2623,_0x387849),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]}),console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x23d)](_0x4e4f1c(0x23c)+_0x1eef10[_0x4e4f1c(0x21b)]+'\x27')),_0x42d14d++;}else{if(_0x1eef10[_0x4e4f1c(0x2d2)]===_0x4e4f1c(0x29f)&&_0x1eef10[_0x4e4f1c(0x281)]&&_0x1eef10['existingActivation']){const _0x2fe227=yamlActivationToUpdateRequest(_0x1eef10[_0x4e4f1c(0x281)],_0x1e5a5f,_0x2e76a9);await withSpinner(_0x4e4f1c(0x26e)+_0x1eef10[_0x4e4f1c(0x21b)]+_0x4e4f1c(0x2c3),()=>_0x412c11[_0x4e4f1c(0x233)]['updateActivation'](_0x21f120,_0x1c2623,_0x1eef10[_0x4e4f1c(0x2a7)]['id'],_0x2fe227),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]}),console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x1f0)](_0x4e4f1c(0x1ff)+_0x1eef10[_0x4e4f1c(0x21b)]+'\x27')),_0x2e8082++;}else _0x1eef10[_0x4e4f1c(0x2d2)]===_0x4e4f1c(0x202)&&_0x1eef10[_0x4e4f1c(0x2a7)]&&(await withSpinner(_0x4e4f1c(0x27e)+_0x1eef10[_0x4e4f1c(0x21b)]+_0x4e4f1c(0x2c3),()=>_0x412c11[_0x4e4f1c(0x233)]['deleteActivation'](_0x21f120,_0x1c2623,_0x1eef10[_0x4e4f1c(0x2a7)]['id']),{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]}),console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x219)](_0x4e4f1c(0x265)+_0x1eef10[_0x4e4f1c(0x21b)]+'\x27')),_0x402015++);}}catch(_0x1255e5){const _0x5d2329=isHttp400Error(_0x1255e5),_0x344d1a=_0x5d2329?ErrorCode[_0x4e4f1c(0x213)]:ErrorCode[_0x4e4f1c(0x1ea)],_0x6b1fe7=getErrorMessage(_0x1255e5);throw new SDKError(_0x344d1a,'Failed\x20to\x20'+_0x1eef10[_0x4e4f1c(0x2d2)]+_0x4e4f1c(0x1eb)+_0x1eef10[_0x4e4f1c(0x21b)]+'\x27\x20from\x20file:\x20'+_0x2e4c99[_0x4e4f1c(0x2b2)]+_0x4e4f1c(0x1e7)+_0x6b1fe7,_0x1255e5);}}}for(const _0xf4bbe6 of _0x1a7b21[_0x4e4f1c(0x2a3)]?[]:_0xf13393){await withSpinner(_0x4e4f1c(0x264)+_0xf4bbe6[_0x4e4f1c(0x21b)]+_0x4e4f1c(0x2c3),()=>_0x412c11[_0x4e4f1c(0x233)][_0x4e4f1c(0x27b)](_0xf4bbe6['id']),{'verbose':_0x1a7b21['verbose']}),console['error'](a36_0x20973d[_0x4e4f1c(0x219)](_0x4e4f1c(0x1fa)+_0xf4bbe6[_0x4e4f1c(0x21b)]+'\x27')),_0x17942c++;}let _0x488864=0x0,_0x3e3782=0x0,_0x510e35=0x0;const _0x240859=new Map(_0x586bbf);for(const _0x382bd5 of _0xf41464){_0x382bd5[_0x4e4f1c(0x2d1)]&&_0x3121c3[_0x4e4f1c(0x243)](_0x382bd5['yamlConfig'][_0x4e4f1c(0x21b)])&&_0x240859[_0x4e4f1c(0x27a)](_0x382bd5[_0x4e4f1c(0x1fe)]['name'],_0x3121c3[_0x4e4f1c(0x244)](_0x382bd5[_0x4e4f1c(0x1fe)][_0x4e4f1c(0x21b)]));}if(_0xcae309[_0x4e4f1c(0x23b)]>0x0){const _0x12b06d=await withQuerySpinner('Pushing\x20journeys...',async _0x52721e=>{const _0x322932=_0x4e4f1c,_0x38626f=[];let _0x523358=0x0;const _0x600d37=0x5;for(let _0x2cf8d7=0x0;_0x2cf8d7<_0xcae309[_0x322932(0x23b)];_0x2cf8d7+=_0x600d37){const _0x1cb7e7=_0xcae309[_0x322932(0x235)](_0x2cf8d7,_0x2cf8d7+_0x600d37),_0x32f2d4=await Promise[_0x322932(0x20d)](_0x1cb7e7[_0x322932(0x22a)](async _0x1ceb11=>{const _0x277b4c=_0x322932;if(!_0x1ceb11[_0x277b4c(0x2d1)]&&!_0x1ceb11[_0x277b4c(0x24f)])return{'action':_0x277b4c(0x1f7),'name':_0x1ceb11[_0x277b4c(0x1fe)][_0x277b4c(0x21b)],'journeyId':_0x1ceb11[_0x277b4c(0x1e3)]?.['id']};const _0x50eeff=_0x1ceb11[_0x277b4c(0x28d)]?_0x268b36['get'](_0x1ceb11[_0x277b4c(0x28d)]):undefined,_0x51ff0f=_0x1ceb11[_0x277b4c(0x2d1)]?_0x277b4c(0x1f9):'Updating';_0x52721e['setPhase'](_0x51ff0f+_0x277b4c(0x2a2)+_0x1ceb11['yamlConfig'][_0x277b4c(0x21b)]+'\x27');const _0x5d2f82=new Map(),_0x4f0615=new Map(),_0x3619b6=new Map(),_0x26bad9={'resolveSegmentId':async _0x40e098=>{const _0x30b33d=_0x277b4c,_0x4026dc=_0x240859[_0x30b33d(0x244)](_0x40e098);if(!_0x4026dc)throw new SDKError(ErrorCode[_0x30b33d(0x201)],_0x30b33d(0x29b)+_0x40e098+'\x20(referenced\x20in\x20journey\x20'+_0x1ceb11[_0x30b33d(0x1fe)]['name']+')');return _0x4026dc;},'resolveEmbeddedSegmentId':async(_0x201b0b,_0x29ec2a)=>{const _0x25b52c=_0x277b4c,_0x3b621f=_0x240859[_0x25b52c(0x244)](_0x201b0b);if(_0x3b621f)return _0x3b621f;const _0x4747c7=_0x193067[_0x25b52c(0x20c)](_0x5e11ee=>_0x5e11ee[_0x25b52c(0x21b)]===_0x201b0b);if(_0x4747c7)return _0x240859[_0x25b52c(0x27a)](_0x201b0b,_0x4747c7['id']),_0x4747c7['id'];if(_0x1ceb11[_0x25b52c(0x2d1)]){const _0xbea223=_0x1ceb11[_0x25b52c(0x1fe)][_0x25b52c(0x1dc)]||_0x1ceb11[_0x25b52c(0x1fe)]['journeys']?.[0x0]?.[_0x25b52c(0x1dc)]||[];let _0x4fb7c0=_0x25b52c(0x240),_0xb44021=_0x201b0b;for(const _0x150855 of _0xbea223){if(_0x150855[_0x25b52c(0x26f)]?.[_0x25b52c(0x233)]===_0x201b0b){_0x4fb7c0=_0x150855[_0x25b52c(0x21b)],_0xb44021=_0x150855[_0x25b52c(0x26f)][_0x25b52c(0x21b)]||_0x201b0b;break;}}return _0x4f0615['set'](_0x201b0b,{'definition':_0x29ec2a,'stageName':_0x4fb7c0,'criteriaName':_0xb44021}),createPendingSegmentId(_0x201b0b);}const _0x5009c0=_0x1ceb11[_0x25b52c(0x1e3)]?.['id'];if(!_0x5009c0)throw new SDKError(ErrorCode[_0x25b52c(0x21a)],_0x25b52c(0x285));const _0x19e632=_0x25b52c(0x1e1)+crypto[_0x25b52c(0x23e)]();try{const _0x56bd61=await _0x412c11['segment'][_0x25b52c(0x277)]({'name':_0x19e632,'description':_0x29ec2a[_0x25b52c(0x256)]||_0x25b52c(0x28b)+_0x201b0b,'journeyId':_0x5009c0,'rule':yamlRuleToApi(_0x29ec2a[_0x25b52c(0x22f)],!![]),'countPopulation':!![],'parentFolderId':_0x5e821c||'','audienceId':_0x21f120});return _0x1a7b21[_0x25b52c(0x221)]&&console[_0x25b52c(0x28f)](_0x25b52c(0x2c6)+_0x201b0b+'\x27\x20(internal:\x20'+_0x19e632+_0x25b52c(0x203)+_0x56bd61),_0x240859['set'](_0x201b0b,_0x56bd61),_0x56bd61;}catch(_0x189906){throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],'Failed\x20to\x20create\x20embedded\x20segment\x20\x27'+_0x201b0b+'\x27:\x20'+getErrorMessage(_0x189906),_0x189906);}},'resolveActivationId':async _0x5a0456=>{const _0x40be6f=_0x277b4c,_0x5839d3=_0x5d2f82[_0x40be6f(0x244)](_0x5a0456);if(_0x5839d3)return _0x5839d3;if(_0x1ceb11['existingJourney']){const _0x29031f=await _0x412c11[_0x40be6f(0x204)][_0x40be6f(0x225)](_0x1ceb11[_0x40be6f(0x1e3)]['id']),_0x4dbc6a=_0x29031f[_0x40be6f(0x20c)](_0x255976=>_0x255976[_0x40be6f(0x227)][_0x40be6f(0x2b0)]?.[_0x40be6f(0x21b)]===_0x5a0456);if(_0x4dbc6a)return _0x5d2f82[_0x40be6f(0x27a)](_0x5a0456,_0x4dbc6a['id']),_0x4dbc6a['id'];}throw new SDKError(ErrorCode[_0x40be6f(0x241)],_0x40be6f(0x2ce)+_0x5a0456+'\x20(referenced\x20in\x20journey\x20'+_0x1ceb11['yamlConfig']['name']+_0x40be6f(0x211)+_0x40be6f(0x254));},'resolveEmbeddedActivationId':async(_0x231b67,_0x1d55ca)=>{const _0xae834=_0x277b4c,_0x58d127=_0x5d2f82[_0xae834(0x244)](_0x231b67);if(_0x58d127)return _0x58d127;if(_0x1ceb11[_0xae834(0x2d1)])return _0x3619b6[_0xae834(0x27a)](_0x231b67,_0x1d55ca),createPendingActivationId(_0x231b67);if(_0x1ceb11[_0xae834(0x1e3)]){const _0x21bf7c=await _0x412c11['journey']['listActivations'](_0x1ceb11[_0xae834(0x1e3)]['id']),_0x53dd6f=_0x21bf7c[_0xae834(0x20c)](_0xed8cc2=>_0xed8cc2[_0xae834(0x227)]['activationParams']?.[_0xae834(0x21b)]===_0x1d55ca['name']);if(_0x53dd6f)return _0x5d2f82[_0xae834(0x27a)](_0x231b67,_0x53dd6f['id']),_0x53dd6f['id'];try{const _0x34c3af=yamlActivationToCreateRequest(_0x1d55ca,_0x1e5a5f,_0x2e76a9),_0x2857d4=await _0x412c11[_0xae834(0x204)][_0xae834(0x239)](_0x1ceb11[_0xae834(0x1e3)]['id'],_0x34c3af);return _0x1a7b21[_0xae834(0x221)]&&console[_0xae834(0x28f)](_0xae834(0x275)+_0x231b67+_0xae834(0x28e)+_0x2857d4['id']),_0x5d2f82['set'](_0x231b67,_0x2857d4['id']),_0x2857d4['id'];}catch(_0x634c30){throw new SDKError(ErrorCode[_0xae834(0x252)],'Failed\x20to\x20create\x20embedded\x20activation\x20\x27'+_0x231b67+'\x27:\x20'+getErrorMessage(_0x634c30),_0x634c30);}}throw new SDKError(ErrorCode[_0xae834(0x21a)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x1168cb=>{const _0x937cc7=_0x277b4c;try{return await _0x412c11['journey'][_0x937cc7(0x261)](_0x21f120,_0x1168cb);}catch(_0x27432f){throw new SDKError(ErrorCode[_0x937cc7(0x241)],'Journey\x20\x27'+_0x1168cb+_0x937cc7(0x2d3)+_0x1ceb11[_0x937cc7(0x1fe)]['name']+'\x27)',_0x27432f);}},'resolveStageId':async(_0x447138,_0x2b955f)=>{const _0x396a48=_0x277b4c,_0x322909=await _0x412c11[_0x396a48(0x204)][_0x396a48(0x208)](_0x447138),_0x3c36e9=_0x322909[_0x396a48(0x227)][_0x396a48(0x25b)][_0x396a48(0x20c)](_0x37ebbd=>_0x37ebbd[_0x396a48(0x21b)][_0x396a48(0x2a4)]()===_0x2b955f['toLowerCase']());if(!_0x3c36e9?.['id'])throw new SDKError(ErrorCode[_0x396a48(0x241)],_0x396a48(0x222)+_0x2b955f+_0x396a48(0x2c2)+(_0x322909[_0x396a48(0x227)]['journeyBundleName']||_0x322909[_0x396a48(0x227)][_0x396a48(0x21b)])+'\x27');return _0x3c36e9['id'];}};try{const _0x1619ab=await a36_0x4a4bea(_0x1ceb11[_0x277b4c(0x1fe)],_0x21f120,_0x26bad9),_0x2423ac=_0x50eeff||_0x5e821c;_0x2423ac&&(_0x1619ab[_0x277b4c(0x2d4)]={'parentFolder':{'data':{'id':_0x2423ac,'type':_0x277b4c(0x279)}}});if(_0x1ceb11['isNew']){if(_0x4f0615['size']>0x0||_0x3619b6[_0x277b4c(0x1ec)]>0x0){const _0x2831a1=JSON[_0x277b4c(0x267)](JSON[_0x277b4c(0x25c)](_0x1619ab));ensureJourneyDefaults(_0x2831a1[_0x277b4c(0x227)]);for(const _0x2f5987 of _0x2831a1[_0x277b4c(0x227)][_0x277b4c(0x25b)]){_0x2f5987[_0x277b4c(0x2ae)]?.['segmentId']&&isPendingSegmentId(_0x2f5987['entryCriteria'][_0x277b4c(0x2cb)])&&delete _0x2f5987[_0x277b4c(0x2ae)];if(_0x2f5987[_0x277b4c(0x2c5)])for(const _0x2dd45d of Object['keys'](_0x2f5987[_0x277b4c(0x2c5)])){const _0x3b2789=_0x2f5987[_0x277b4c(0x2c5)][_0x2dd45d];_0x3b2789['type']===_0x277b4c(0x293)&&_0x3b2789[_0x277b4c(0x25a)]&&isPendingActivationId(_0x3b2789[_0x277b4c(0x25a)])&&(_0x3b2789[_0x277b4c(0x25a)]='');if(_0x3b2789[_0x277b4c(0x2d2)]===_0x277b4c(0x290)&&_0x3b2789[_0x277b4c(0x283)])for(const _0x1dd2d7 of _0x3b2789[_0x277b4c(0x283)]){_0x1dd2d7[_0x277b4c(0x2cb)]&&isPendingSegmentId(_0x1dd2d7[_0x277b4c(0x2cb)])&&(_0x1dd2d7['segmentId']='');}}}_0x1a7b21['verbose']&&console[_0x277b4c(0x28f)]('\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20'+JSON[_0x277b4c(0x25c)](_0x2831a1,null,0x2));const _0x6ff24e=await _0x412c11['journey'][_0x277b4c(0x215)](_0x2831a1),_0x495b41=_0x6ff24e['id'],_0x33dc70=new Map();for(const _0x66d6a8 of _0x6ff24e[_0x277b4c(0x227)][_0x277b4c(0x25b)]){_0x33dc70[_0x277b4c(0x27a)](_0x66d6a8[_0x277b4c(0x21b)][_0x277b4c(0x2a4)](),_0x66d6a8['id']);}const _0x59c9d4=new Map();for(const [_0x1cedf8,{definition:_0x98bdbc,criteriaName:_0x2393db}]of _0x4f0615){const _0x14d0f8=generateJourneyLocalName(_0x2393db)||_0x277b4c(0x1e1)+crypto[_0x277b4c(0x23e)]();_0x1a7b21[_0x277b4c(0x221)]&&console['error'](_0x277b4c(0x2bf)+_0x1cedf8+_0x277b4c(0x270)+_0x14d0f8+_0x277b4c(0x23a)+_0x495b41);const _0x44a67d=await _0x412c11[_0x277b4c(0x233)]['createJourneySegment']({'name':_0x14d0f8,'description':_0x98bdbc[_0x277b4c(0x256)]||'Entry\x20criteria:\x20'+_0x1cedf8,'journeyId':_0x495b41,'rule':yamlRuleToApi(_0x98bdbc[_0x277b4c(0x22f)],!![]),'countPopulation':!![],'parentFolderId':_0x2423ac||'','audienceId':_0x21f120});_0x59c9d4['set'](_0x1cedf8,_0x44a67d),_0x240859[_0x277b4c(0x27a)](_0x1cedf8,_0x44a67d),_0x1a7b21[_0x277b4c(0x221)]&&console[_0x277b4c(0x28f)](_0x277b4c(0x2c6)+_0x1cedf8+_0x277b4c(0x28e)+_0x44a67d);}const _0x217079=new Map();for(const [_0x1d5c70,_0x41d452]of _0x3619b6){_0x1a7b21[_0x277b4c(0x221)]&&console[_0x277b4c(0x28f)](_0x277b4c(0x2af)+_0x1d5c70+_0x277b4c(0x27c)+_0x495b41);try{const _0x49f42e=yamlActivationToCreateRequest(_0x41d452,_0x1e5a5f,_0x2e76a9),_0x37d741=await _0x412c11[_0x277b4c(0x204)][_0x277b4c(0x239)](_0x495b41,_0x49f42e);_0x217079[_0x277b4c(0x27a)](_0x1d5c70,_0x37d741['id']),_0x5d2f82[_0x277b4c(0x27a)](_0x1d5c70,_0x37d741['id']),_0x1a7b21[_0x277b4c(0x221)]&&console[_0x277b4c(0x28f)]('\x20\x20Created\x20embedded\x20activation\x20\x27'+_0x1d5c70+_0x277b4c(0x28e)+_0x37d741['id']);}catch(_0x35fa9c){throw new SDKError(ErrorCode[_0x277b4c(0x252)],_0x277b4c(0x2c7)+_0x1d5c70+_0x277b4c(0x226)+getErrorMessage(_0x35fa9c),_0x35fa9c);}}const _0x1267dd=JSON[_0x277b4c(0x267)](JSON[_0x277b4c(0x25c)](_0x1619ab));_0x1267dd['id']=_0x495b41,ensureJourneyDefaults(_0x1267dd[_0x277b4c(0x227)]);for(const _0x542300 of _0x1267dd[_0x277b4c(0x227)][_0x277b4c(0x25b)]){const _0xb35b8a=_0x33dc70['get'](_0x542300[_0x277b4c(0x21b)][_0x277b4c(0x2a4)]());_0xb35b8a&&(_0x542300['id']=_0xb35b8a);if(_0x542300[_0x277b4c(0x2ae)]?.[_0x277b4c(0x2cb)]&&isPendingSegmentId(_0x542300[_0x277b4c(0x2ae)][_0x277b4c(0x2cb)])){const _0x486cb0=extractPendingSegmentName(_0x542300[_0x277b4c(0x2ae)][_0x277b4c(0x2cb)]),_0x169667=_0x59c9d4[_0x277b4c(0x244)](_0x486cb0);_0x169667&&(_0x542300[_0x277b4c(0x2ae)][_0x277b4c(0x2cb)]=_0x169667);}if(_0x542300['steps']){const _0x337d23=_0x4345f6=>_0x1619ab[_0x277b4c(0x227)]['journeyStages'][_0x277b4c(0x20c)](_0x8c8e0d=>_0x8c8e0d[_0x277b4c(0x21b)][_0x277b4c(0x2a4)]()===_0x542300['name'][_0x277b4c(0x2a4)]())?.[_0x277b4c(0x2c5)]?.[_0x4345f6];for(const _0x3bf682 of Object[_0x277b4c(0x20b)](_0x542300[_0x277b4c(0x2c5)])){const _0x51e5c0=_0x542300[_0x277b4c(0x2c5)][_0x3bf682],_0x48bb08=_0x337d23(_0x3bf682);if(_0x51e5c0[_0x277b4c(0x2d2)]===_0x277b4c(0x293)&&_0x51e5c0['journeyActivationStepId']&&(isPendingActivationId(_0x51e5c0[_0x277b4c(0x25a)])||_0x51e5c0[_0x277b4c(0x25a)]==='')){if(_0x48bb08?.[_0x277b4c(0x25a)]&&isPendingActivationId(_0x48bb08['journeyActivationStepId'])){const _0x2b4488=extractPendingActivationName(_0x48bb08[_0x277b4c(0x25a)]),_0x203ba4=_0x217079['get'](_0x2b4488);_0x203ba4&&(_0x51e5c0['journeyActivationStepId']=_0x203ba4);}}if(_0x51e5c0[_0x277b4c(0x2d2)]===_0x277b4c(0x290)&&_0x51e5c0[_0x277b4c(0x283)]&&_0x48bb08?.[_0x277b4c(0x283)])for(let _0x4e2fcb=0x0;_0x4e2fcb<_0x51e5c0['branches']['length'];_0x4e2fcb++){const _0x522e27=_0x51e5c0['branches'][_0x4e2fcb],_0x3830eb=_0x48bb08['branches'][_0x4e2fcb];if(_0x3830eb?.[_0x277b4c(0x2cb)]&&isPendingSegmentId(_0x3830eb[_0x277b4c(0x2cb)])){const _0x5d939d=extractPendingSegmentName(_0x3830eb[_0x277b4c(0x2cb)]),_0x36e077=_0x59c9d4['get'](_0x5d939d);_0x36e077&&(_0x522e27[_0x277b4c(0x2cb)]=_0x36e077);}}}}}return _0x1a7b21[_0x277b4c(0x221)]&&console['error'](_0x277b4c(0x1f5)+JSON[_0x277b4c(0x25c)](_0x1267dd,null,0x2)),await _0x412c11[_0x277b4c(0x204)][_0x277b4c(0x29f)](_0x495b41,_0x1267dd),{'action':_0x277b4c(0x251),'name':_0x1ceb11['yamlConfig'][_0x277b4c(0x21b)],'journeyId':_0x495b41};}else{ensureJourneyDefaults(_0x1619ab[_0x277b4c(0x227)]);_0x1a7b21['verbose']&&console[_0x277b4c(0x28f)]('\x20\x20Journey\x20API\x20request:\x20'+JSON[_0x277b4c(0x25c)](_0x1619ab,null,0x2));const _0x3efaed=await _0x412c11[_0x277b4c(0x204)][_0x277b4c(0x215)](_0x1619ab);return{'action':_0x277b4c(0x251),'name':_0x1ceb11[_0x277b4c(0x1fe)][_0x277b4c(0x21b)],'journeyId':_0x3efaed['id']};}}else{if(_0x1ceb11[_0x277b4c(0x24f)]&&_0x1ceb11[_0x277b4c(0x1e3)])return ensureJourneyDefaults(_0x1619ab[_0x277b4c(0x227)]),await _0x412c11[_0x277b4c(0x204)][_0x277b4c(0x29f)](_0x1ceb11[_0x277b4c(0x1e3)]['id'],_0x1619ab),{'action':_0x277b4c(0x29c),'name':_0x1ceb11[_0x277b4c(0x1fe)][_0x277b4c(0x21b)],'journeyId':_0x1ceb11[_0x277b4c(0x1e3)]['id']};}return{'action':_0x277b4c(0x1f7),'name':_0x1ceb11[_0x277b4c(0x1fe)][_0x277b4c(0x21b)],'journeyId':_0x1ceb11[_0x277b4c(0x1e3)]?.['id']};}catch(_0x567001){const _0x3a282d=isHttp400Error(_0x567001),_0x4db260=_0x3a282d?ErrorCode[_0x277b4c(0x26c)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x59f57f=getErrorMessage(_0x567001);throw new SDKError(_0x4db260,_0x277b4c(0x218)+(_0x1ceb11['isNew']?_0x277b4c(0x215):'update')+_0x277b4c(0x274)+_0x1ceb11[_0x277b4c(0x2b2)]+_0x277b4c(0x1e7)+_0x59f57f,_0x567001);}}));_0x38626f[_0x322932(0x237)](..._0x32f2d4),_0x523358+=_0x1cb7e7[_0x322932(0x23b)],_0x52721e['setExtra']('('+_0x523358+'/'+_0xcae309[_0x322932(0x23b)]+')');}return _0x38626f;},{'verbose':_0x1a7b21[_0x4e4f1c(0x221)]});for(const _0x2a02a7 of _0x12b06d[_0x4e4f1c(0x253)]){if(_0x2a02a7[_0x4e4f1c(0x2b6)]==='created')console['error'](a36_0x20973d['green'](_0x4e4f1c(0x229)+_0x2a02a7[_0x4e4f1c(0x21b)]+'\x27')),_0x488864++;else _0x2a02a7['action']==='updated'&&(console[_0x4e4f1c(0x28f)](a36_0x20973d[_0x4e4f1c(0x1f0)](_0x4e4f1c(0x1fc)+_0x2a02a7[_0x4e4f1c(0x21b)]+'\x27')),_0x3e3782++);}if(_0x1d4589&&_0x12b06d[_0x4e4f1c(0x253)]['length']===0x1){const _0x5914c6=_0x12b06d[_0x4e4f1c(0x253)][0x0];if(_0x5914c6[_0x4e4f1c(0x1e0)]){const _0xf49139=getConsoleNextUrl(_0x1a7b21[_0x4e4f1c(0x23f)],_0x4e4f1c(0x286)+_0x21f120+_0x4e4f1c(0x220)+_0x5914c6['journeyId']+_0x4e4f1c(0x20a));console[_0x4e4f1c(0x28f)]('\x20\x20'+a36_0x20973d['cyan'](_0xf49139));}}}for(const _0x5868c7 of _0x2c0ee0){console[_0x4e4f1c(0x28f)](a36_0x20973d['yellow'](_0x4e4f1c(0x291)+_0x5868c7[_0x4e4f1c(0x1e6)])),_0x510e35++;}const _0x26f5da=[];if(_0x32dbd0>0x0)_0x26f5da['push'](_0x32dbd0+_0x4e4f1c(0x299));if(_0x1e3753>0x0)_0x26f5da[_0x4e4f1c(0x237)](_0x1e3753+_0x4e4f1c(0x294));if(_0x17942c>0x0)_0x26f5da[_0x4e4f1c(0x237)](_0x17942c+_0x4e4f1c(0x1e4));const _0x131337=[];if(_0x488864>0x0)_0x131337[_0x4e4f1c(0x237)](_0x488864+'\x20created');if(_0x3e3782>0x0)_0x131337[_0x4e4f1c(0x237)](_0x3e3782+_0x4e4f1c(0x294));if(_0x510e35>0x0)_0x131337[_0x4e4f1c(0x237)](_0x510e35+'\x20deleted');const _0x458123=[];if(_0x42d14d>0x0)_0x458123[_0x4e4f1c(0x237)](_0x42d14d+'\x20created');if(_0x2e8082>0x0)_0x458123[_0x4e4f1c(0x237)](_0x2e8082+_0x4e4f1c(0x294));if(_0x402015>0x0)_0x458123[_0x4e4f1c(0x237)](_0x402015+_0x4e4f1c(0x1e4));return console['error'](a36_0x20973d['green']('\x0a✔\x20Push\x20complete')),_0x26f5da[_0x4e4f1c(0x23b)]>0x0&&!_0x1a7b21['journeysOnly']&&console['error'](_0x4e4f1c(0x2a8)+_0x26f5da[_0x4e4f1c(0x2be)](',\x20')),_0x131337[_0x4e4f1c(0x23b)]>0x0&&console['error'](_0x4e4f1c(0x26d)+_0x131337['join'](',\x20')),_0x458123['length']>0x0&&!_0x1a7b21[_0x4e4f1c(0x2a3)]&&console[_0x4e4f1c(0x28f)](_0x4e4f1c(0x22d)+_0x458123[_0x4e4f1c(0x2be)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x516d09){const _0x1361fa=a36_0x3acda7,_0x59ea57=new Map(),_0x1d43f6=new Map();for(const _0x10d1ba of _0x516d09){_0x1d43f6[_0x1361fa(0x27a)](_0x10d1ba['id'],_0x10d1ba);}const _0x2e2a7c=new Set();for(const _0x80cf11 of _0x516d09){!_0x80cf11[_0x1361fa(0x1f3)]&&_0x2e2a7c['add'](_0x80cf11['id']);}function _0x3a531e(_0x275ed0){const _0x45cb2b=_0x1361fa;if(_0x2e2a7c[_0x45cb2b(0x243)](_0x275ed0['id']))return'';if(_0x275ed0[_0x45cb2b(0x1f3)]){const _0x3fd5e6=_0x1d43f6[_0x45cb2b(0x244)](_0x275ed0[_0x45cb2b(0x1f3)]);if(_0x3fd5e6){const _0x3c33cb=_0x3a531e(_0x3fd5e6);return _0x3c33cb?_0x3c33cb+'/'+_0x275ed0['name']:_0x275ed0[_0x45cb2b(0x21b)];}}return _0x275ed0['name'];}for(const _0x58bd39 of _0x516d09){const _0x5ea4db=_0x3a531e(_0x58bd39);_0x59ea57[_0x1361fa(0x27a)](_0x5ea4db,_0x58bd39['id']);}return _0x59ea57;}function findYamlFiles(_0x34e0f4){const _0x14d25e=[];function _0xdf248e(_0x1ab8bd){const _0xa9f8b7=a36_0x2d92,_0x2b1308=readdirSync(_0x1ab8bd,{'withFileTypes':!![]});for(const _0xd1dfaa of _0x2b1308){const _0x4b6b4c=a36_0x23b535[_0xa9f8b7(0x2be)](_0x1ab8bd,_0xd1dfaa[_0xa9f8b7(0x21b)]);if(_0xd1dfaa['isDirectory']())_0xdf248e(_0x4b6b4c);else(_0xd1dfaa[_0xa9f8b7(0x21b)][_0xa9f8b7(0x228)](_0xa9f8b7(0x1e9))||_0xd1dfaa[_0xa9f8b7(0x21b)][_0xa9f8b7(0x228)]('.yaml'))&&_0x14d25e[_0xa9f8b7(0x237)](_0x4b6b4c);}}return _0xdf248e(_0x34e0f4),_0x14d25e;}function calculateActivationActions(_0xc4528d,_0xcfb57d,_0x18c5cb,_0x225368){const _0x17b858=a36_0x3acda7,_0x47d7b4=[],_0x2fcb8b=new Map();for(const _0x71bdc6 of _0xcfb57d){_0x2fcb8b[_0x17b858(0x27a)](_0x71bdc6['name'],_0x71bdc6);}const _0x357eba=new Map();for(const _0x45b6cf of _0xc4528d){_0x357eba[_0x17b858(0x27a)](_0x45b6cf[_0x17b858(0x21b)],_0x45b6cf);}for(const _0x23f13b of _0xc4528d){const _0x372cff=_0x2fcb8b[_0x17b858(0x244)](_0x23f13b[_0x17b858(0x21b)]);if(!_0x372cff)_0x47d7b4[_0x17b858(0x237)]({'type':_0x17b858(0x215),'name':_0x23f13b[_0x17b858(0x21b)],'yamlActivation':_0x23f13b});else{const _0x3f8e72=activationToYaml(_0x372cff,_0x18c5cb,_0x225368),_0x3a15e9=a36_0x575e8b['stringify'](_0x3f8e72),_0x2df5f7=a36_0x575e8b['stringify'](_0x23f13b);_0x3a15e9!==_0x2df5f7&&_0x47d7b4[_0x17b858(0x237)]({'type':_0x17b858(0x29f),'name':_0x23f13b[_0x17b858(0x21b)],'yamlActivation':_0x23f13b,'existingActivation':_0x372cff});}}for(const _0x5629b0 of _0xcfb57d){!_0x357eba[_0x17b858(0x243)](_0x5629b0[_0x17b858(0x21b)])&&_0x47d7b4[_0x17b858(0x237)]({'type':_0x17b858(0x202),'name':_0x5629b0[_0x17b858(0x21b)],'existingActivation':_0x5629b0});}return _0x47d7b4;}
1
+ const a36_0xb9787e=a36_0x5329;(function(_0x224ef8,_0x48b496){const _0x51c798=a36_0x5329,_0x2d6afc=_0x224ef8();while(!![]){try{const _0x210cbd=-parseInt(_0x51c798(0x270))/0x1+parseInt(_0x51c798(0x1ed))/0x2*(parseInt(_0x51c798(0x2af))/0x3)+parseInt(_0x51c798(0x22a))/0x4*(parseInt(_0x51c798(0x20d))/0x5)+parseInt(_0x51c798(0x1ef))/0x6*(-parseInt(_0x51c798(0x27f))/0x7)+parseInt(_0x51c798(0x2e6))/0x8*(parseInt(_0x51c798(0x224))/0x9)+-parseInt(_0x51c798(0x277))/0xa+parseInt(_0x51c798(0x279))/0xb*(-parseInt(_0x51c798(0x225))/0xc);if(_0x210cbd===_0x48b496)break;else _0x2d6afc['push'](_0x2d6afc['shift']());}catch(_0x51adc5){_0x2d6afc['push'](_0x2d6afc['shift']());}}}(a36_0xab8e,0x6e3ef));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../sdk/errors.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x4b8566,yamlToApi as a36_0x46dd4c,toYamlString as a36_0x4acde4,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a36_0x55ad09 from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';function a36_0xab8e(){const _0x46c022=['journey_entry_criteria_','segment\x20or\x20journey','draft',').\x20','✔\x20Created\x20segment\x20\x27','Fetching\x20existing\x20journeys...','\x20activations]','filter','unchanged','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20folders\x20to\x20create','Scoped\x20to\x20folder:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Creating','green','\x20\x20Journeys:\x20','split','\x27...','entries','existingJourney','\x27\x20not\x20found\x20in\x20journey\x20\x27','execute','Fetching\x20existing\x20folders...','journeys','absolutePath','error','activationParams','\x20\x20Source:\x20','\x27:\x20','red','createActivation','Aborted.','from','137691wMOOBc','\x20\x20\x20\x20','activations','\x0a✔\x20Push\x20complete','\x27\x20details...','entryCriteria','\x20journey\x20\x27','listFolders','parse','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','parentFolder','\x20to\x20delete','getSegment','Segment\x20not\x20found:\x20','__pending_','\x27\x20from\x20file:\x20','\x20unchanged','getJourney','.yaml','Folders\x20to\x20create:','segment','\x20\x20📊\x20Segments:','Stage\x20\x27','Fetching\x20journey\x20\x27','DecisionPoint','\x20\x20Segments:\x20','slice',')\x20with\x20journeyId:\x20','cwd','activationActions','isFile','steps','Fetching\x20parent\x20segment\x20details...','Delete\x20journey:','/app/ps/','sort','Changes\x20to\x20journey:','Creating\x20folder\x20\x27','map','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','/e/','journeyId','Entry\x20criteria:\x20','all','setPhase','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','listActivations','Fetching\x20existing\x20segments...','entry','listSegments','\x0a\x20\x20','diff','stages','JOURNEY_UPDATE_ERROR','\x20to\x20create','1520aIZcYc','No\x20','Failed\x20to\x20create\x20embedded\x20segment\x20\x27','existingSegment','18FBLjBP','getActivation','188364ZXHNhx','keys','item','folderPath','then','isNew','\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20','existingActivation','relationships','segmentFolderId','Activation\x20not\x20found:\x20','\x20changes?','\x20new','✔\x20Deleted\x20segment\x20\x27','branches','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','✔\x20Created\x20journey\x20\x27','resolve','\x20\x20Activations:\x20','size','create','yamlActivation','createJourneySegment','📁\x20','journeyBundleName','parentSegmentFolder','dirname','attributes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','join','30iqFTMi','segment:push','parentSegment','push','\x20\x20✔\x20Updated\x20activation\x20\x27','parentFolderId','endsWith','Error\x20parsing\x20','folder','journeyStages','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)','segmentId','max','Journey\x20\x27','randomUUID','Updating\x20activation\x20\x27','user','\x20(referenced\x20in\x20journey\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','utf-8','SEGMENT_SYNTAX_ERROR','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','.yml','22104gJFFLW','120YErpZI','\x20\x20✔\x20Created\x20activation\x20\x27','\x20\x20🗺️\x20\x20Journeys:','data','updated','451032jEyqDJ','deleteSegment','Activation','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','type','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','relative','buildUserMaps','\x20created','\x27\x20v','hasChanges','verbose','delete','yellow','INTERNAL','action','stringify','Fetching\x20connections\x20for\x20name\x20resolution...','✔\x20Updated\x20segment\x20\x27','set','\x20activation\x20\x27','\x20changed','...','journey','deleteActivation','message','configDir','config','name','getOutputSchemaWithCache','kind','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','validatedRequest','\x27\x20with\x20ID:\x20','dim','JOURNEY_SYNTAX_ERROR','New\x20journey:','rule','toString','Push\x20','add','created','SEGMENT_NOT_FOUND','yamlConfig','Deleting\x20activation\x20\x27','SEGMENT_UPDATE_ERROR','site','find','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/j/da/je','Failed\x20to\x20','versionNumber','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','connection','createFolder','createSegment','__pending_act_','toLowerCase','\x20\x20Created\x20embedded\x20segment\x20\x27','folderId','ACTIVATION_UPDATE_ERROR','journeysOnly','updateSegmentById','get','cyan','parent_segment','Parent\x20segment:\x20','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','resolveJourneyId','\x20YAML\x20files\x20found','439260IhrhTn','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Error:\x20Directory\x20not\x20found:\x20','\x27\x20(internal:\x20','replace','startsWith','state','5649700QlowAX','\x20deleted','75977uoBmLC','journeyActivationStepId','description','✔\x20Updated\x20journey\x20\x27','NOT_FOUND',')\x20with\x20ID:\x20','7KtJron','entry_criteria','length','blue','Creating\x20activation\x20\x27','\x20\x20Created\x20embedded\x20activation\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','has','\x20to\x20update','repeat','(Journey\x20will\x20be\x20deleted)','\x20updated','update','Pushing\x20journeys...','values'];a36_0xab8e=function(){return _0x46c022;};return a36_0xab8e();}import a36_0x5e769c from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a36_0x14c597 from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';function a36_0x5329(_0x2160ed,_0x2d075f){_0x2160ed=_0x2160ed-0x1ec;const _0xab8e83=a36_0xab8e();let _0x532995=_0xab8e83[_0x2160ed];return _0x532995;}import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX=a36_0xb9787e(0x2bd);function createPendingSegmentId(_0x1d8a8f){return''+PENDING_SEGMENT_PREFIX+_0x1d8a8f+'__';}function isPendingSegmentId(_0x2124c4){return _0x2124c4['startsWith'](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x35b2c){const _0x256c9e=a36_0xb9787e;return _0x35b2c[_0x256c9e(0x274)](/^__pending_(.+)__$/,'$1');}const PENDING_ACTIVATION_PREFIX=a36_0xb9787e(0x262);function createPendingActivationId(_0x40d04a){return''+PENDING_ACTIVATION_PREFIX+_0x40d04a+'__';}function isPendingActivationId(_0xc27646){const _0x3c27fc=a36_0xb9787e;return _0xc27646[_0x3c27fc(0x275)](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x12ed88){const _0x4947f9=a36_0xb9787e;return _0x12ed88[_0x4947f9(0x274)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x49d4f8){const _0x28d0e3=a36_0xb9787e;!_0x49d4f8[_0x28d0e3(0x27b)]&&(_0x49d4f8[_0x28d0e3(0x27b)]=''),!_0x49d4f8[_0x28d0e3(0x276)]&&(_0x49d4f8[_0x28d0e3(0x276)]=_0x28d0e3(0x290));}function tryFindTdxConfig(_0x5c8cad){try{return findTdxConfig(_0x5c8cad);}catch{return null;}}function resolveTDFolderPath(_0x50db92,_0x6b90da,_0xcea48){if(!_0x6b90da)return _0x50db92;return _0x50db92?_0xcea48+'/'+_0x50db92:_0xcea48;}export class SegmentPushCommand extends BaseCommand{[a36_0xb9787e(0x246)]=a36_0xb9787e(0x20e);[a36_0xb9787e(0x27b)]=a36_0xb9787e(0x26d);async[a36_0xb9787e(0x2a3)](_0xad03f2){const _0x463af4=a36_0xb9787e,{options:_0x37f3fa,args:_0x5c4d8c,tdx:_0x1789c1}=_0xad03f2,_0x20a340=_0x37f3fa,_0x4c09ca=_0x37f3fa[_0x463af4(0x20f)],_0xff00fb=_0x5c4d8c[0x0];let _0x43f474,_0xed54b4,_0x29a59e,_0xb58b48;if(_0xff00fb){if(existsSync(_0xff00fb)&&statSync(_0xff00fb)['isDirectory']()){const _0x14e290=tryFindTdxConfig(_0xff00fb);if(_0x14e290)_0x43f474=_0x14e290['config'][_0x463af4(0x26b)],_0xed54b4=_0xff00fb,_0x29a59e=_0x14e290[_0x463af4(0x244)];else return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x29a)+_0xff00fb+'\x0a')),console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x26a)](_0x463af4(0x25a))),0x1;}else{if(existsSync(_0xff00fb)&&statSync(_0xff00fb)[_0x463af4(0x2cd)]()){const _0x3753b5=a36_0x5e769c[_0x463af4(0x209)](_0xff00fb),_0x4f68fd=tryFindTdxConfig(_0x3753b5);if(_0x4f68fd)_0x43f474=_0x4f68fd['config'][_0x463af4(0x26b)],_0x29a59e=_0x4f68fd[_0x463af4(0x244)],_0xed54b4=_0x4f68fd[_0x463af4(0x244)],_0xb58b48=a36_0x5e769c[_0x463af4(0x200)](_0xff00fb);else return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x29a)+_0x3753b5+'\x0a')),console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x26a)](_0x463af4(0x25a))),0x1;}else _0x43f474=_0xff00fb;}}else{const _0x6fb221=tryFindTdxConfig(process[_0x463af4(0x2cb)]());_0x6fb221?(_0x43f474=_0x6fb221[_0x463af4(0x245)][_0x463af4(0x26b)],_0xed54b4=process[_0x463af4(0x2cb)](),_0x29a59e=_0x6fb221['configDir']):_0x43f474=_0x4c09ca;}if(!_0x43f474)return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x237)](_0x463af4(0x20b))),console[_0x463af4(0x2a7)](_0x463af4(0x217)),console[_0x463af4(0x2a7)](_0x463af4(0x285)),console[_0x463af4(0x2a7)](_0x463af4(0x21f)),0x1;const _0x593d7e=_0xed54b4||getSegmentRootDir(sanitizeFileName(_0x43f474)),_0x35e3a7=_0x29a59e||_0x593d7e,_0x3478a9=a36_0x5e769c[_0x463af4(0x230)](_0x35e3a7,_0x593d7e),_0x416614=_0x3478a9!==''&&_0x3478a9!=='.';if(!existsSync(_0x593d7e))return console['error'](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x272)+_0x593d7e+'\x0a')),console[_0x463af4(0x2a7)](a36_0x55ad09['cyan'](_0x463af4(0x25a))),0x1;_0x20a340[_0x463af4(0x235)]&&(console[_0x463af4(0x2a7)]('Site:\x20'+_0x20a340[_0x463af4(0x258)]),console[_0x463af4(0x2a7)](_0x463af4(0x26c)+_0x43f474),console['error']('Source\x20directory:\x20'+_0x593d7e),_0x416614&&console[_0x463af4(0x2a7)](_0x463af4(0x299)+_0x3478a9));const _0x18c3d9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x43f474+_0x463af4(0x29f),()=>_0x1789c1[_0x463af4(0x2c3)]['resolveParentId'](_0x43f474),{'verbose':_0x20a340['verbose']}),_0x5c1555=_0x18c3d9[_0x463af4(0x228)],[_0x226a7c,_0x22241f,_0x5edf51,_0xefb1ca,_0x508ab7]=await Promise[_0x463af4(0x2da)]([withSpinner(_0x463af4(0x2cf),()=>_0x1789c1[_0x463af4(0x2c3)]['getParent'](_0x5c1555),{'verbose':_0x20a340['verbose']}),withSpinner(_0x463af4(0x2de),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x2e0)](_0x5c1555),{'verbose':_0x20a340['verbose']}),withSpinner(_0x463af4(0x2a4),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x2b6)](_0x5c1555),{'verbose':_0x20a340[_0x463af4(0x235)]}),withSpinner(_0x463af4(0x293),()=>_0x1789c1['journey']['listJourneysFromParentSegment'](_0x5c1555),{'verbose':_0x20a340['verbose']}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x1789c1[_0x463af4(0x21d)][_0x463af4(0x231)](),{'verbose':_0x20a340[_0x463af4(0x235)]})[_0x463af4(0x1f3)](_0x463156=>_0x463156[_0x463af4(0x228)])]),_0x1897c7=_0x226a7c['data'],_0x2ec87b=_0x1897c7['relationships']?.[_0x463af4(0x208)]?.[_0x463af4(0x228)]?.['id']||_0x1897c7[_0x463af4(0x1f7)]?.[_0x463af4(0x2b9)]?.['data']?.['id'],_0x3e6b12=_0x22241f[_0x463af4(0x228)],_0x20a776=_0x5edf51['data'],_0x3b6170=_0xefb1ca[_0x463af4(0x228)],{emailToId:_0x4d1b84,idToEmail:_0x52bfe1}=_0x508ab7,[_0x15c7bb,_0x4fcd35,_0x4a647f]=await withSpinner(_0x463af4(0x23b),async()=>{const _0x38c928=_0x463af4,_0x5249ab=await _0x1789c1[_0x38c928(0x25f)]['list'](),_0x52c2fe=new Map(),_0x2481cd=new Map(),_0x1766ea=new Map();for(const _0x26d724 of _0x5249ab){_0x52c2fe[_0x38c928(0x23d)](_0x26d724[_0x38c928(0x246)],parseInt(_0x26d724['id'],0xa)),_0x2481cd[_0x38c928(0x23d)](_0x26d724['id'],_0x26d724[_0x38c928(0x246)]),_0x1766ea[_0x38c928(0x23d)](_0x26d724[_0x38c928(0x246)],_0x26d724[_0x38c928(0x22e)]);}return[_0x52c2fe,_0x2481cd,_0x1766ea];},{'verbose':_0x20a340['verbose']})[_0x463af4(0x1f3)](_0x20a980=>_0x20a980['data']),_0x16b623={'emailToIdMap':_0x4d1b84,'connectionNameToIdMap':_0x15c7bb,'connectionNameToTypeMap':_0x4a647f,'getSchema':_0x28475a=>_0x1789c1[_0x463af4(0x25f)][_0x463af4(0x247)](_0x28475a)},_0x37de8c=buildFolderPathToIdMap(_0x20a776),_0x3bce0e=new Map();for(const [_0x66544b,_0x57196e]of _0x37de8c[_0x463af4(0x2a0)]()){_0x3bce0e['set'](_0x57196e,_0x66544b);}const _0x4b8da3=new Map();for(const _0x5035b8 of _0x3e6b12){const _0x47e7ff=_0x5035b8[_0x463af4(0x1f8)]?_0x3bce0e[_0x463af4(0x269)](_0x5035b8[_0x463af4(0x1f8)]['toString']())||'':'',_0x576859=_0x47e7ff+':'+_0x5035b8[_0x463af4(0x246)];_0x4b8da3[_0x463af4(0x23d)](_0x576859,_0x5035b8);}const _0x13464f=new Map();for(const _0x212ad1 of _0x3e6b12){_0x13464f[_0x463af4(0x23d)](_0x212ad1['name'],_0x212ad1['id']);}const _0x2d51f5=new Map();for(const _0x405848 of _0x3b6170){const _0xa06b8b=_0x405848[_0x463af4(0x265)]?_0x3bce0e[_0x463af4(0x269)](_0x405848[_0x463af4(0x265)])||'':'',_0xd2079=_0xa06b8b+':'+_0x405848[_0x463af4(0x207)];!_0x2d51f5[_0x463af4(0x286)](_0xd2079)&&_0x2d51f5[_0x463af4(0x23d)](_0xd2079,[]),_0x2d51f5['get'](_0xd2079)[_0x463af4(0x210)](_0x405848);}for(const _0x237a50 of _0x2d51f5[_0x463af4(0x28d)]()){_0x237a50[_0x463af4(0x2d2)]((_0x45d02a,_0x2d0b0c)=>(_0x45d02a['versionNumber']||0x0)-(_0x2d0b0c[_0x463af4(0x25d)]||0x0));}let _0x5f0a0e;if(_0xb58b48){if(!_0xb58b48['endsWith'](_0x463af4(0x223))&&!_0xb58b48['endsWith'](_0x463af4(0x2c1)))return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x2dc)+_0xb58b48+'\x0a')),0x1;_0x5f0a0e=[_0xb58b48];}else _0x5f0a0e=findYamlFiles(_0x593d7e);if(_0x5f0a0e[_0x463af4(0x281)]===0x0)return console['error'](a36_0x55ad09['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x593d7e+'\x0a')),console['error'](a36_0x55ad09[_0x463af4(0x26a)](_0x463af4(0x25e))),0x1;const _0x1576b9=[],_0xef11d6=[];for(const _0x1b6bec of _0x5f0a0e){const _0x7c5809=a36_0x5e769c[_0x463af4(0x230)](_0x593d7e,a36_0x5e769c[_0x463af4(0x209)](_0x1b6bec)),_0x58f1b4=_0x7c5809==='.'?'':_0x7c5809,_0x4b716f=readFileSync(_0x1b6bec,_0x463af4(0x220));try{const _0x1cd7ef=a36_0x14c597['parse'](_0x4b716f);if(isJourneyYaml(_0x1cd7ef)){const _0x462f09=a36_0x4b8566(_0x4b716f);_0xef11d6[_0x463af4(0x210)]({'yamlConfig':_0x462f09,'folderPath':_0x58f1b4,'sourcePath':_0x1b6bec});}else{if(!_0x20a340[_0x463af4(0x267)]){const _0x4ad540=parseSegmentYamlFile(_0x4b716f),_0x4c9cac=normalizeChildSegmentYaml(_0x4ad540);_0x1576b9[_0x463af4(0x210)]({'yamlConfig':_0x4c9cac,'folderPath':_0x58f1b4,'sourcePath':_0x1b6bec});}}}catch(_0x9656c6){return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x214)+_0x1b6bec+':\x20'+(_0x9656c6 instanceof Error?_0x9656c6[_0x463af4(0x243)]:_0x9656c6))),0x1;}}if(_0x1576b9['length']===0x0&&_0xef11d6[_0x463af4(0x281)]===0x0){const _0xf0952e=_0x20a340[_0x463af4(0x267)]?_0x463af4(0x241):_0x463af4(0x28f);return console[_0x463af4(0x2a7)](a36_0x55ad09['yellow'](_0x463af4(0x2e7)+_0xf0952e+_0x463af4(0x26f))),0x0;}const _0x57494c=new Map();_0x3e6b12['length']>0x0&&!_0x20a340['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x3e6b12,async _0x530c88=>{const _0x92a19d=a36_0x5329,_0x4e960a=await _0x1789c1[_0x92a19d(0x2c3)][_0x92a19d(0x2dd)](_0x5c1555,_0x530c88['id']);_0x57494c[_0x92a19d(0x23d)](_0x530c88['id'],_0x4e960a);});},{'verbose':_0x20a340['verbose']});const _0x24107c=[],_0xd0573d=new Set();for(const {yamlConfig:_0x533979,folderPath:_0x5d530a,sourcePath:_0x1b325a}of _0x1576b9){const _0x2121f0=resolveTDFolderPath(_0x5d530a,_0x416614,_0x3478a9),_0x4df79e=_0x2121f0+':'+_0x533979[_0x463af4(0x246)],_0x1be3ff=_0x4b8da3[_0x463af4(0x269)](_0x4df79e),_0x82445e=_0x1be3ff?_0x57494c[_0x463af4(0x269)](_0x1be3ff['id'])||[]:[];if(_0x2121f0&&!_0x37de8c[_0x463af4(0x286)](_0x2121f0)){const _0x485756=_0x2121f0[_0x463af4(0x29e)]('/');let _0x55a2a3='';for(const _0x3b93da of _0x485756){_0x55a2a3=_0x55a2a3?_0x55a2a3+'/'+_0x3b93da:_0x3b93da,!_0x37de8c[_0x463af4(0x286)](_0x55a2a3)&&_0xd0573d[_0x463af4(0x252)](_0x55a2a3);}}const _0xb58437=calculateActivationActions(_0x533979[_0x463af4(0x2b1)]||[],_0x82445e,_0x52bfe1,_0x4fcd35);for(const _0x33ff42 of _0xb58437){(_0x33ff42[_0x463af4(0x22e)]===_0x463af4(0x203)||_0x33ff42[_0x463af4(0x22e)]===_0x463af4(0x28b))&&_0x33ff42[_0x463af4(0x204)]&&(_0x33ff42[_0x463af4(0x24a)]=await yamlActivationToCreateRequest(_0x33ff42[_0x463af4(0x204)],_0x16b623));}const _0x15ef35=segmentToYamlString(_0x533979);let _0x2b7a29,_0x54be46=![],_0xaae5d;if(_0x1be3ff){const _0x335895=segmentWithActivationsToYaml(_0x1be3ff,_0x82445e,undefined,_0x52bfe1,_0x4fcd35),_0xfcc059=segmentToYamlString(_0x335895);_0x2b7a29=generateDiff(_0xfcc059,_0x15ef35),_0x54be46=hasChanges(_0x2b7a29),_0x54be46&&(_0xaae5d=formatDiffWithColors(_0x2b7a29));}else _0x2b7a29=generateDiff('',_0x15ef35),_0xaae5d=formatDiffWithColors(_0x2b7a29);_0x24107c['push']({'relativePath':_0x533979['name'],'absolutePath':_0x1b325a,'yamlConfig':_0x533979,'folderPath':_0x2121f0,'existingSegment':_0x1be3ff,'existingActivations':_0x82445e,'isNew':!_0x1be3ff,'hasChanges':_0x54be46,'diff':_0xaae5d,'activationActions':_0xb58437});}let _0x1f9b96=[];if(!_0xb58b48){const _0x16844c=new Set();for(const {yamlConfig:_0x501ca7,folderPath:_0x1e85bd}of _0x1576b9){const _0x16860a=resolveTDFolderPath(_0x1e85bd,_0x416614,_0x3478a9);_0x16844c[_0x463af4(0x252)](_0x16860a+':'+_0x501ca7[_0x463af4(0x246)]);}_0x1f9b96=_0x3e6b12['filter'](_0x2acc79=>{const _0x4e4768=_0x463af4,_0x386723=_0x2acc79['segmentFolderId']?_0x3bce0e[_0x4e4768(0x269)](_0x2acc79[_0x4e4768(0x1f8)][_0x4e4768(0x250)]())||'':'',_0x1298af=_0x386723+':'+_0x2acc79[_0x4e4768(0x246)];if(_0x16844c[_0x4e4768(0x286)](_0x1298af))return![];if(_0x416614)return _0x386723===_0x3478a9||_0x386723[_0x4e4768(0x275)](_0x3478a9+'/');return!![];});}const _0x2ed3cc=[];for(const {yamlConfig:_0x164878,folderPath:_0x5deda2,sourcePath:_0x34f3a6}of _0xef11d6){const _0x4fb576=resolveTDFolderPath(_0x5deda2,_0x416614,_0x3478a9),_0x6a6f6e=_0x4fb576+':'+_0x164878[_0x463af4(0x246)],_0x1dd3c3=_0x2d51f5['get'](_0x6a6f6e);let _0x2435f4,_0xa0e1e4;if(_0x1dd3c3&&_0x1dd3c3[_0x463af4(0x281)]>0x0){const _0x2fcf8d=new Set(),_0x24d3a1=new Set(),_0x105637=new Map(),_0x19b75b=new Map(),_0xae62c1=createJumpTargetCache(),_0x4c09de=_0x5196d8=>({'resolveSegment':async _0x506fb2=>{const _0x5ab9a3=_0x463af4,_0x2432a5=_0x19b75b['get'](_0x506fb2);if(_0x2432a5!==undefined)return{'name':_0x2432a5,'isJourneyLocal':!![]};try{let _0xc4078e=_0x3e6b12[_0x5ab9a3(0x259)](_0x1af168=>_0x1af168['id']===_0x506fb2);!_0xc4078e&&(_0xc4078e=await _0x1789c1['segment'][_0x5ab9a3(0x2bb)](_0x5c1555,_0x506fb2));const _0x1ed8d2=generateJourneyLocalName(_0xc4078e['name']),_0x4c8bba=_0xc4078e[_0x5ab9a3(0x248)]===SEGMENT_KIND_JOURNEY&&_0x1ed8d2!==undefined;let _0x4aa245=_0xc4078e[_0x5ab9a3(0x246)];if(_0x4c8bba&&_0x1ed8d2){let _0x4c7fac=_0x1ed8d2,_0xd84256=0x2;while(_0x2fcf8d[_0x5ab9a3(0x286)](_0x4c7fac)){_0x4c7fac=_0x1ed8d2+'_'+_0xd84256,_0xd84256++;}_0x2fcf8d[_0x5ab9a3(0x252)](_0x4c7fac),_0x4aa245=_0x4c7fac,_0x19b75b['set'](_0x506fb2,_0x4aa245);}let _0x4c3afe;return _0x4c8bba&&_0xc4078e[_0x5ab9a3(0x24f)]&&(_0x4c3afe={'description':_0xc4078e[_0x5ab9a3(0x27b)],'rule':apiRuleToYaml(_0xc4078e[_0x5ab9a3(0x24f)])}),{'name':_0x4aa245,'isJourneyLocal':_0x4c8bba,'definition':_0x4c3afe};}catch{return{'name':_0x506fb2,'isJourneyLocal':![]};}},'resolveActivation':async _0x23f5d3=>{const _0x6d8bf6=_0x463af4,_0xb49d1=_0x105637[_0x6d8bf6(0x269)](_0x23f5d3);if(_0xb49d1!==undefined)return{'name':_0xb49d1,'isJourneyLocal':!![]};try{const _0x400e30=await _0x1789c1[_0x6d8bf6(0x241)][_0x6d8bf6(0x1ee)](_0x5196d8,_0x23f5d3),_0x56d6cd=_0x400e30['attributes'][_0x6d8bf6(0x2a8)][_0x6d8bf6(0x246)]||_0x23f5d3,_0xefdf74=sanitizeYamlKey(_0x56d6cd)||'activation_'+_0x23f5d3;let _0x466141=_0xefdf74,_0x5c5915=0x2;while(_0x24d3a1['has'](_0x466141)){_0x466141=_0xefdf74+'_'+_0x5c5915,_0x5c5915++;}_0x24d3a1[_0x6d8bf6(0x252)](_0x466141),_0x105637[_0x6d8bf6(0x23d)](_0x23f5d3,_0x466141);const _0x4b0a4a=journeyActivationStepToYaml(_0x400e30,_0x52bfe1,_0x4fcd35);return{'name':_0x466141,'isJourneyLocal':!![],'definition':_0x4b0a4a};}catch{return{'name':_0x23f5d3,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x529046,_0x51aaaa)=>resolveJumpTarget(_0x529046,_0x51aaaa,_0xae62c1,_0x3d406a=>_0x1789c1[_0x463af4(0x241)]['getJourney'](_0x3d406a))}),_0x58d30b=hasMultipleVersions(_0x164878);if(_0x58d30b&&_0x1dd3c3['length']>0x1){const _0x6c3ec9=[];for(const _0x2ef70b of _0x1dd3c3){const _0x5d78b1=await withSpinner(_0x463af4(0x2c6)+_0x164878[_0x463af4(0x246)]+_0x463af4(0x233)+(_0x2ef70b[_0x463af4(0x25d)]||0x1)+_0x463af4(0x240),()=>_0x1789c1[_0x463af4(0x241)]['getJourney'](_0x2ef70b['id']),{'verbose':_0x20a340['verbose']}),_0x5b9d96=_0x4c09de(_0x2ef70b['id']),_0x36fbc5=await apiToYamlAsync(_0x5d78b1[_0x463af4(0x228)],_0x5b9d96);_0x6c3ec9['push']({'item':_0x2ef70b,'yaml':_0x36fbc5});}_0xa0e1e4=buildMergedJourneyYaml(_0x6c3ec9);const _0x5871a8=Math[_0x463af4(0x219)](..._0x6c3ec9[_0x463af4(0x2d5)](_0x3b153d=>_0x3b153d[_0x463af4(0x1f1)][_0x463af4(0x25d)]||0x0)),_0x52664d=_0x1dd3c3['find'](_0x6e65f1=>(_0x6e65f1[_0x463af4(0x25d)]||0x0)===_0x5871a8);_0x52664d&&(_0x2435f4=await _0x1789c1[_0x463af4(0x241)][_0x463af4(0x2c0)](_0x52664d['id']));}else{const _0x3c5554=_0x1dd3c3[_0x1dd3c3['length']-0x1],_0x2bd5ad=await withSpinner(_0x463af4(0x2c6)+_0x164878[_0x463af4(0x246)]+_0x463af4(0x2b3),()=>_0x1789c1[_0x463af4(0x241)][_0x463af4(0x2c0)](_0x3c5554['id']),{'verbose':_0x20a340['verbose']});_0x2435f4=_0x2bd5ad['data'];const _0xad16dc=_0x4c09de(_0x3c5554['id']);_0xa0e1e4=await apiToYamlAsync(_0x2435f4,_0xad16dc);}}if(_0x4fb576&&!_0x37de8c[_0x463af4(0x286)](_0x4fb576)){const _0x3fe2e7=_0x4fb576['split']('/');let _0x5d069d='';for(const _0x557c92 of _0x3fe2e7){_0x5d069d=_0x5d069d?_0x5d069d+'/'+_0x557c92:_0x557c92,!_0x37de8c[_0x463af4(0x286)](_0x5d069d)&&_0xd0573d['add'](_0x5d069d);}}const _0x44172e=normalizeJourneyYaml(_0x164878),_0x38a546=a36_0x4acde4(_0x44172e);let _0x706771=![],_0x19cc65;if(_0xa0e1e4){const _0x4715bc=normalizeJourneyYaml(_0xa0e1e4),_0x17a497=a36_0x4acde4(_0x4715bc),_0x3d517d=generateDiff(_0x17a497,_0x38a546);_0x706771=hasChanges(_0x3d517d),_0x706771&&(_0x19cc65=formatDiffWithColors(_0x3d517d));}else{const _0x13af63=generateDiff('',_0x38a546);_0x19cc65=formatDiffWithColors(_0x13af63);}_0x2ed3cc[_0x463af4(0x210)]({'relativePath':_0x164878[_0x463af4(0x246)],'absolutePath':_0x34f3a6,'yamlConfig':_0x164878,'folderPath':_0x4fb576,'existingJourney':_0x2435f4,'isNew':!_0x2435f4,'hasChanges':_0x706771,'diff':_0x19cc65});}let _0x5ee661=[];if(!_0xb58b48){const _0xb291cc=new Set();for(const {yamlConfig:_0xa6abe1,folderPath:_0x443ee0}of _0xef11d6){const _0x13749e=resolveTDFolderPath(_0x443ee0,_0x416614,_0x3478a9);_0xb291cc[_0x463af4(0x252)](_0x13749e+':'+_0xa6abe1[_0x463af4(0x246)]);}_0x5ee661=_0x3b6170[_0x463af4(0x295)](_0x37601c=>{const _0x1508bb=_0x463af4,_0xd4fd54=_0x37601c[_0x1508bb(0x265)]?_0x3bce0e['get'](_0x37601c['folderId'])||'':'',_0xdfabc=_0xd4fd54+':'+_0x37601c[_0x1508bb(0x207)];if(_0xb291cc[_0x1508bb(0x286)](_0xdfabc))return![];if(_0x416614)return _0xd4fd54===_0x3478a9||_0xd4fd54[_0x1508bb(0x275)](_0x3478a9+'/');return!![];});}const _0x52514a=_0x24107c[_0x463af4(0x295)](_0x1fd3ed=>_0x1fd3ed[_0x463af4(0x1f4)]),_0x50355e=_0x24107c[_0x463af4(0x295)](_0x2dac40=>!_0x2dac40[_0x463af4(0x1f4)]&&_0x2dac40[_0x463af4(0x234)]),_0x21a75d=_0x24107c[_0x463af4(0x295)](_0x4869a4=>!_0x4869a4['isNew']&&!_0x4869a4['hasChanges']),_0x9b4d36=Array[_0x463af4(0x2ae)](_0xd0573d)[_0x463af4(0x2d2)](),_0x697027=_0x20a340[_0x463af4(0x236)]?_0x1f9b96:[],_0x3d4c25=_0x20a340[_0x463af4(0x236)]?_0x5ee661:[],_0x1ecb39=_0x24107c['flatMap'](_0x1fa8da=>_0x1fa8da[_0x463af4(0x2cc)]),_0x1a8ce4=_0x1ecb39[_0x463af4(0x295)](_0x5cb3dc=>_0x5cb3dc[_0x463af4(0x22e)]==='create'),_0x59d85e=_0x1ecb39['filter'](_0x147a90=>_0x147a90[_0x463af4(0x22e)]==='update'),_0x1e02fe=_0x1ecb39[_0x463af4(0x295)](_0x34f85f=>_0x34f85f[_0x463af4(0x22e)]===_0x463af4(0x236)),_0xb00d72=_0x2ed3cc[_0x463af4(0x295)](_0x290950=>_0x290950[_0x463af4(0x1f4)]),_0x43aa11=_0x2ed3cc[_0x463af4(0x295)](_0x329e4a=>!_0x329e4a[_0x463af4(0x1f4)]&&_0x329e4a[_0x463af4(0x234)]),_0xce6658=_0x2ed3cc['filter'](_0x25babc=>!_0x25babc[_0x463af4(0x1f4)]&&!_0x25babc['hasChanges']);console[_0x463af4(0x2a7)]('\x0aPush\x20summary\x20for\x20\x27'+_0x43f474+'\x27:');_0x9b4d36[_0x463af4(0x281)]>0x0&&console[_0x463af4(0x2a7)]('\x20\x20'+a36_0x55ad09['blue'](_0x463af4(0x206)+_0x9b4d36[_0x463af4(0x281)]+_0x463af4(0x298)));if(!_0x20a340[_0x463af4(0x267)]){console[_0x463af4(0x2a7)](_0x463af4(0x2c4)),console['error']('\x20\x20\x20\x20'+a36_0x55ad09['green']('+\x20'+_0x52514a['length']+_0x463af4(0x1fb))),console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x237)]('~\x20'+_0x50355e[_0x463af4(0x281)]+_0x463af4(0x23f)));if(_0x697027['length']>0x0)console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09[_0x463af4(0x2ab)]('-\x20'+_0x697027['length']+_0x463af4(0x2ba)));else _0x1f9b96[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x236)]&&console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09[_0x463af4(0x24c)](_0x1f9b96[_0x463af4(0x281)]+_0x463af4(0x271)));console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09['dim']('=\x20'+_0x21a75d['length']+_0x463af4(0x2bf)));}if(_0x2ed3cc['length']>0x0||_0x5ee661['length']>0x0){console[_0x463af4(0x2a7)](_0x463af4(0x227)),console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x29c)]('+\x20'+_0xb00d72[_0x463af4(0x281)]+_0x463af4(0x1fb))),console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x237)]('~\x20'+_0x43aa11[_0x463af4(0x281)]+_0x463af4(0x23f)));if(_0x3d4c25[_0x463af4(0x281)]>0x0)console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x2ab)]('-\x20'+_0x3d4c25[_0x463af4(0x281)]+_0x463af4(0x2ba)));else _0x5ee661[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x236)]&&console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09[_0x463af4(0x24c)](_0x5ee661[_0x463af4(0x281)]+_0x463af4(0x271)));console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09[_0x463af4(0x24c)]('=\x20'+_0xce6658[_0x463af4(0x281)]+'\x20unchanged'));}_0x1ecb39[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x267)]&&(console['error'](''),console[_0x463af4(0x2a7)]('\x20\x20Activations:'),_0x1a8ce4[_0x463af4(0x281)]>0x0&&console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09[_0x463af4(0x29c)]('+\x20'+_0x1a8ce4[_0x463af4(0x281)]+_0x463af4(0x2e5))),_0x59d85e[_0x463af4(0x281)]>0x0&&console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x237)]('~\x20'+_0x59d85e[_0x463af4(0x281)]+_0x463af4(0x287))),_0x1e02fe[_0x463af4(0x281)]>0x0&&console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x2ab)]('-\x20'+_0x1e02fe[_0x463af4(0x281)]+_0x463af4(0x2ba))));console[_0x463af4(0x2a7)](_0x463af4(0x2a9)+a36_0x55ad09[_0x463af4(0x26a)](_0x593d7e)+'\x0a');if(_0x9b4d36[_0x463af4(0x281)]>0x0){console[_0x463af4(0x2a7)](_0x463af4(0x2c2));for(const _0x67b9a1 of _0x9b4d36){console[_0x463af4(0x2a7)]('\x20\x20'+a36_0x55ad09[_0x463af4(0x282)]('+')+'\x20'+_0x67b9a1);}console['error']('');}if(_0x52514a[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x267)])for(const _0x24c5e7 of _0x52514a){const _0x1d332a=_0x24c5e7[_0x463af4(0x1f2)]?_0x24c5e7[_0x463af4(0x1f2)]+'/'+_0x24c5e7[_0x463af4(0x255)][_0x463af4(0x246)]:_0x24c5e7['yamlConfig'][_0x463af4(0x246)],_0x56ecf5=_0x24c5e7[_0x463af4(0x255)]['activations']?.[_0x463af4(0x281)]||0x0,_0x3494d2=_0x56ecf5>0x0?a36_0x55ad09['dim']('\x20['+_0x56ecf5+_0x463af4(0x294)):'';console['error']('\x0a'+a36_0x55ad09[_0x463af4(0x29c)]('New\x20segment:')+'\x20'+_0x1d332a+_0x3494d2),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c)),_0x24c5e7[_0x463af4(0x2e2)]&&console[_0x463af4(0x2a7)](_0x24c5e7['diff']),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));}if(_0x697027[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x267)])for(const _0x3ca730 of _0x697027){const _0x562dfe=_0x3ca730[_0x463af4(0x1f8)]?_0x3bce0e['get'](_0x3ca730['segmentFolderId'][_0x463af4(0x250)]())||'':'',_0x5b8847=_0x562dfe?_0x562dfe+'/'+_0x3ca730[_0x463af4(0x246)]:_0x3ca730[_0x463af4(0x246)],_0x5403de=_0x57494c[_0x463af4(0x269)](_0x3ca730['id'])||[],_0xa22ed0=_0x5403de['length']>0x0?a36_0x55ad09[_0x463af4(0x24c)]('\x20['+_0x5403de[_0x463af4(0x281)]+_0x463af4(0x294)):'';console[_0x463af4(0x2a7)]('\x0a'+a36_0x55ad09[_0x463af4(0x2ab)]('Delete\x20segment:')+'\x20'+_0x5b8847+_0xa22ed0),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));const _0x557a59=segmentWithActivationsToYaml(_0x3ca730,_0x5403de,undefined,_0x52bfe1,_0x4fcd35),_0x39b2ca=segmentToYamlString(_0x557a59),_0x5234ff=generateDiff(_0x39b2ca,'');console[_0x463af4(0x2a7)](formatDiffWithColors(_0x5234ff)),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));}const _0x5284d0=_0x24107c[_0x463af4(0x295)](_0x1e72cf=>!_0x1e72cf[_0x463af4(0x1f4)]&&_0x1e72cf[_0x463af4(0x2e2)]);if(_0x5284d0[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x267)])for(const _0xc21ffc of _0x5284d0){const _0x143008=_0xc21ffc[_0x463af4(0x1f2)]?_0xc21ffc[_0x463af4(0x1f2)]+'/'+_0xc21ffc[_0x463af4(0x255)][_0x463af4(0x246)]:_0xc21ffc[_0x463af4(0x255)][_0x463af4(0x246)];console[_0x463af4(0x2a7)]('\x0a'+a36_0x55ad09[_0x463af4(0x237)]('Changes\x20to:')+'\x20'+_0x143008),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c)),console[_0x463af4(0x2a7)](_0xc21ffc[_0x463af4(0x2e2)]),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));}if(_0xb00d72[_0x463af4(0x281)]>0x0)for(const _0x271b34 of _0xb00d72){const _0x43f3b7=_0x271b34[_0x463af4(0x1f2)]?_0x271b34[_0x463af4(0x1f2)]+'/'+_0x271b34[_0x463af4(0x255)][_0x463af4(0x246)]:_0x271b34[_0x463af4(0x255)][_0x463af4(0x246)];console[_0x463af4(0x2a7)]('\x0a'+a36_0x55ad09['green'](_0x463af4(0x24e))+'\x20'+_0x43f3b7),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c)),_0x271b34[_0x463af4(0x2e2)]&&console[_0x463af4(0x2a7)](_0x271b34[_0x463af4(0x2e2)]),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));}const _0x9348a9=_0x2ed3cc['filter'](_0x3fde26=>!_0x3fde26[_0x463af4(0x1f4)]&&_0x3fde26[_0x463af4(0x2e2)]);if(_0x9348a9[_0x463af4(0x281)]>0x0)for(const _0x44755c of _0x9348a9){const _0x4d0e47=_0x44755c['folderPath']?_0x44755c[_0x463af4(0x1f2)]+'/'+_0x44755c[_0x463af4(0x255)][_0x463af4(0x246)]:_0x44755c['yamlConfig'][_0x463af4(0x246)];console[_0x463af4(0x2a7)]('\x0a'+a36_0x55ad09[_0x463af4(0x237)](_0x463af4(0x2d3))+'\x20'+_0x4d0e47),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c)),console['error'](_0x44755c['diff']),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));}if(_0x3d4c25[_0x463af4(0x281)]>0x0)for(const _0x4b9b9e of _0x3d4c25){const _0x36a18c=_0x4b9b9e['folderId']?_0x3bce0e[_0x463af4(0x269)](_0x4b9b9e['folderId'])||'':'',_0x2eaca2=_0x36a18c?_0x36a18c+'/'+_0x4b9b9e[_0x463af4(0x207)]:_0x4b9b9e['journeyBundleName'];console[_0x463af4(0x2a7)]('\x0a'+a36_0x55ad09['red'](_0x463af4(0x2d0))+'\x20'+_0x2eaca2),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c)),console['error'](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x289))),console['error']('─'['repeat'](0x3c));}if(_0x20a340['dryRun'])return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x237)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x480df6=_0x20a340[_0x463af4(0x267)]?![]:_0x52514a[_0x463af4(0x281)]>0x0||_0x50355e[_0x463af4(0x281)]>0x0||_0x697027[_0x463af4(0x281)]>0x0,_0x376df1=_0xb00d72[_0x463af4(0x281)]>0x0||_0x43aa11['length']>0x0||_0x3d4c25['length']>0x0,_0x3c82ed=_0x20a340[_0x463af4(0x267)]?![]:_0x1ecb39[_0x463af4(0x281)]>0x0,_0x38b9a5=_0x9b4d36[_0x463af4(0x281)]>0x0;if(!_0x480df6&&!_0x376df1&&!_0x3c82ed&&!_0x38b9a5){const _0x1a8573=_0x20a340[_0x463af4(0x267)]?_0x463af4(0x22d):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x463af4(0x2a7)](a36_0x55ad09['green'](_0x1a8573));if(_0xb58b48&&_0xce6658[_0x463af4(0x281)]===0x1){const _0x3dbdc0=_0xce6658[0x0];if(_0x3dbdc0['existingJourney']?.['id']){const _0x489d41=getConsoleNextUrl(_0x20a340[_0x463af4(0x258)],_0x463af4(0x2d1)+_0x5c1555+'/e/'+_0x3dbdc0[_0x463af4(0x2a1)]['id']+_0x463af4(0x25b));console[_0x463af4(0x2a7)]('\x20\x20'+a36_0x55ad09['cyan'](_0x489d41));}}return 0x0;}const _0xdd232=_0x20a340['journeysOnly']?_0xb00d72[_0x463af4(0x281)]+_0x43aa11['length']+_0x3d4c25[_0x463af4(0x281)]+_0x9b4d36['length']:_0x52514a[_0x463af4(0x281)]+_0x50355e[_0x463af4(0x281)]+_0x697027[_0x463af4(0x281)]+_0xb00d72[_0x463af4(0x281)]+_0x43aa11[_0x463af4(0x281)]+_0x3d4c25['length']+_0x9b4d36['length']+_0x1ecb39[_0x463af4(0x281)];if(!_0x20a340['yes']&&_0xdd232>0x0){const _0x40134a=await confirmKey(_0x463af4(0x251)+_0xdd232+_0x463af4(0x1fa));if(!_0x40134a)return console[_0x463af4(0x2a7)](_0x463af4(0x2ad)),0x1;}for(const _0x81258a of _0x9b4d36){const _0x1468da=_0x81258a[_0x463af4(0x29e)]('/'),_0x53151c=_0x1468da[_0x1468da[_0x463af4(0x281)]-0x1],_0x84ef6a=_0x1468da[_0x463af4(0x2c9)](0x0,-0x1)['join']('/'),_0x335027=_0x37de8c[_0x463af4(0x269)](_0x84ef6a),_0x442165={'name':_0x53151c,'parentFolderId':_0x335027},_0x249ca1=await withSpinner(_0x463af4(0x2d4)+_0x81258a+_0x463af4(0x29f),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x260)](_0x5c1555,_0x442165),{'verbose':_0x20a340[_0x463af4(0x235)]});_0x37de8c[_0x463af4(0x23d)](_0x81258a,_0x249ca1['data']['id']),console[_0x463af4(0x2a7)](a36_0x55ad09['blue']('✔\x20Created\x20folder\x20\x27'+_0x81258a+'\x27'));}let _0x3448f7=0x0,_0x4b4fc2=0x0,_0x18421c=0x0,_0x233b1b=0x0,_0xdeba32=0x0,_0x3441e2=0x0;const _0xc52272=new Map();for(const _0x4f69ad of _0x20a340[_0x463af4(0x267)]?[]:_0x24107c){const _0x3a21e5=_0x4f69ad[_0x463af4(0x1f2)]?_0x37de8c['get'](_0x4f69ad['folderPath']):undefined;let _0xdf03a2;try{if(_0x4f69ad['isNew']){const _0x53724b=yamlToCreateRequest(_0x4f69ad[_0x463af4(0x255)],_0x3a21e5),_0x212501=await withSpinner('Creating\x20segment\x20\x27'+_0x4f69ad[_0x463af4(0x255)][_0x463af4(0x246)]+_0x463af4(0x29f),()=>_0x1789c1['segment'][_0x463af4(0x261)](_0x5c1555,_0x53724b),{'verbose':_0x20a340[_0x463af4(0x235)]});_0xdf03a2=_0x212501[_0x463af4(0x228)]['id'],_0xc52272[_0x463af4(0x23d)](_0x4f69ad[_0x463af4(0x255)][_0x463af4(0x246)],_0xdf03a2),console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x29c)](_0x463af4(0x292)+_0x4f69ad[_0x463af4(0x255)][_0x463af4(0x246)]+'\x27')),_0x3448f7++;}else{if(_0x4f69ad[_0x463af4(0x234)]){const _0x4372d0=yamlToUpdateRequest(_0x4f69ad[_0x463af4(0x255)]);_0x3a21e5!==_0x4f69ad[_0x463af4(0x1ec)]?.['segmentFolderId']&&(_0x4372d0[_0x463af4(0x1f8)]=_0x3a21e5?parseInt(_0x3a21e5,0xa):undefined),await withSpinner('Updating\x20segment\x20\x27'+_0x4f69ad[_0x463af4(0x255)][_0x463af4(0x246)]+'\x27...',()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x268)](_0x5c1555,_0x4f69ad['existingSegment']['id'],_0x4372d0),{'verbose':_0x20a340['verbose']}),_0xdf03a2=_0x4f69ad[_0x463af4(0x1ec)]['id'],console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x237)](_0x463af4(0x23c)+_0x4f69ad[_0x463af4(0x255)][_0x463af4(0x246)]+'\x27')),_0x4b4fc2++;}else _0xdf03a2=_0x4f69ad[_0x463af4(0x1ec)]['id'];}}catch(_0x2b9fd4){const _0x63e762=isHttp400Error(_0x2b9fd4),_0x296cb7=_0x63e762?ErrorCode[_0x463af4(0x221)]:ErrorCode[_0x463af4(0x257)],_0x5821da=getErrorMessage(_0x2b9fd4);throw new SDKError(_0x296cb7,_0x463af4(0x25c)+(_0x4f69ad[_0x463af4(0x1f4)]?_0x463af4(0x203):_0x463af4(0x28b))+'\x20segment\x20from\x20file:\x20'+_0x4f69ad[_0x463af4(0x2a6)]+_0x463af4(0x2e1)+_0x5821da,_0x2b9fd4);}for(const _0x3a8f30 of _0x4f69ad[_0x463af4(0x2cc)]){try{if(_0x3a8f30['type']==='create'&&_0x3a8f30[_0x463af4(0x24a)])await withSpinner(_0x463af4(0x283)+_0x3a8f30['name']+_0x463af4(0x29f),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x2ac)](_0x5c1555,_0xdf03a2,_0x3a8f30[_0x463af4(0x24a)]),{'verbose':_0x20a340['verbose']}),console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x29c)](_0x463af4(0x226)+_0x3a8f30[_0x463af4(0x246)]+'\x27')),_0x233b1b++;else{if(_0x3a8f30[_0x463af4(0x22e)]===_0x463af4(0x28b)&&_0x3a8f30['validatedRequest']&&_0x3a8f30[_0x463af4(0x1f6)])await withSpinner(_0x463af4(0x21c)+_0x3a8f30[_0x463af4(0x246)]+_0x463af4(0x29f),()=>_0x1789c1['segment']['updateActivation'](_0x5c1555,_0xdf03a2,_0x3a8f30['existingActivation']['id'],_0x3a8f30[_0x463af4(0x24a)]),{'verbose':_0x20a340[_0x463af4(0x235)]}),console[_0x463af4(0x2a7)](a36_0x55ad09['yellow'](_0x463af4(0x211)+_0x3a8f30['name']+'\x27')),_0xdeba32++;else _0x3a8f30[_0x463af4(0x22e)]===_0x463af4(0x236)&&_0x3a8f30[_0x463af4(0x1f6)]&&(await withSpinner(_0x463af4(0x256)+_0x3a8f30[_0x463af4(0x246)]+_0x463af4(0x29f),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x242)](_0x5c1555,_0xdf03a2,_0x3a8f30[_0x463af4(0x1f6)]['id']),{'verbose':_0x20a340[_0x463af4(0x235)]}),console[_0x463af4(0x2a7)](a36_0x55ad09['red']('\x20\x20✔\x20Deleted\x20activation\x20\x27'+_0x3a8f30[_0x463af4(0x246)]+'\x27')),_0x3441e2++);}}catch(_0x4c450a){const _0x6a4e0e=isHttp400Error(_0x4c450a),_0x3b56cd=_0x6a4e0e?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x463af4(0x266)],_0x389810=getErrorMessage(_0x4c450a);throw new SDKError(_0x3b56cd,_0x463af4(0x25c)+_0x3a8f30[_0x463af4(0x22e)]+_0x463af4(0x23e)+_0x3a8f30[_0x463af4(0x246)]+_0x463af4(0x2be)+_0x4f69ad[_0x463af4(0x2a6)]+'\x0a\x20\x20'+_0x389810,_0x4c450a);}}}for(const _0x17d2c4 of _0x20a340[_0x463af4(0x267)]?[]:_0x697027){await withSpinner('Deleting\x20segment\x20\x27'+_0x17d2c4['name']+_0x463af4(0x29f),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x22b)](_0x17d2c4['id']),{'verbose':_0x20a340[_0x463af4(0x235)]}),console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x1fc)+_0x17d2c4[_0x463af4(0x246)]+'\x27')),_0x18421c++;}let _0xf8126b=0x0,_0x49b210=0x0,_0x4d7f5c=0x0;const _0x26d46e=new Map(_0x13464f);for(const _0x3d77e6 of _0x24107c){_0x3d77e6[_0x463af4(0x1f4)]&&_0xc52272[_0x463af4(0x286)](_0x3d77e6[_0x463af4(0x255)][_0x463af4(0x246)])&&_0x26d46e[_0x463af4(0x23d)](_0x3d77e6['yamlConfig']['name'],_0xc52272[_0x463af4(0x269)](_0x3d77e6[_0x463af4(0x255)][_0x463af4(0x246)]));}if(_0x2ed3cc['length']>0x0){const _0x5cc12d=await withQuerySpinner(_0x463af4(0x28c),async _0x36d365=>{const _0x3a189d=_0x463af4,_0x11fddb=[];let _0x21d94a=0x0;const _0x222bc8=0x5;for(let _0x5e7e48=0x0;_0x5e7e48<_0x2ed3cc[_0x3a189d(0x281)];_0x5e7e48+=_0x222bc8){const _0x27aad0=_0x2ed3cc[_0x3a189d(0x2c9)](_0x5e7e48,_0x5e7e48+_0x222bc8),_0x12bafe=await Promise[_0x3a189d(0x2da)](_0x27aad0['map'](async _0x345219=>{const _0x3b4d8e=_0x3a189d;if(!_0x345219['isNew']&&!_0x345219[_0x3b4d8e(0x234)])return{'action':_0x3b4d8e(0x296),'name':_0x345219[_0x3b4d8e(0x255)]['name'],'journeyId':_0x345219[_0x3b4d8e(0x2a1)]?.['id']};const _0xf7430e=_0x345219[_0x3b4d8e(0x1f2)]?_0x37de8c[_0x3b4d8e(0x269)](_0x345219[_0x3b4d8e(0x1f2)]):undefined,_0x2936ab=_0x345219[_0x3b4d8e(0x1f4)]?_0x3b4d8e(0x29b):'Updating';_0x36d365[_0x3b4d8e(0x2db)](_0x2936ab+_0x3b4d8e(0x2b5)+_0x345219[_0x3b4d8e(0x255)][_0x3b4d8e(0x246)]+'\x27');const _0x21d4d7=new Map(),_0xfe395a=new Map(),_0x11dc2d=new Map(),_0x157770={'resolveSegmentId':async _0x219f6c=>{const _0x27ee9f=_0x3b4d8e,_0x1d4da1=_0x26d46e[_0x27ee9f(0x269)](_0x219f6c);if(!_0x1d4da1)throw new SDKError(ErrorCode[_0x27ee9f(0x254)],_0x27ee9f(0x2bc)+_0x219f6c+_0x27ee9f(0x21e)+_0x345219['yamlConfig'][_0x27ee9f(0x246)]+')');return _0x1d4da1;},'resolveEmbeddedSegmentId':async(_0x2696f3,_0x357d8a)=>{const _0x49d91e=_0x3b4d8e,_0x194be5=_0x26d46e[_0x49d91e(0x269)](_0x2696f3);if(_0x194be5)return _0x194be5;const _0x4c8823=_0x3e6b12['find'](_0x482027=>_0x482027[_0x49d91e(0x246)]===_0x2696f3);if(_0x4c8823)return _0x26d46e['set'](_0x2696f3,_0x4c8823['id']),_0x4c8823['id'];if(_0x345219[_0x49d91e(0x1f4)]){const _0xbcd6a5=_0x345219['yamlConfig'][_0x49d91e(0x2e3)]||_0x345219['yamlConfig'][_0x49d91e(0x2a5)]?.[0x0]?.[_0x49d91e(0x2e3)]||[];let _0xaea39=_0x49d91e(0x2df),_0x3e4011=_0x2696f3;for(const _0x16959d of _0xbcd6a5){if(_0x16959d[_0x49d91e(0x280)]?.[_0x49d91e(0x2c3)]===_0x2696f3){_0xaea39=_0x16959d[_0x49d91e(0x246)],_0x3e4011=_0x16959d[_0x49d91e(0x280)][_0x49d91e(0x246)]||_0x2696f3;break;}}return _0xfe395a[_0x49d91e(0x23d)](_0x2696f3,{'definition':_0x357d8a,'stageName':_0xaea39,'criteriaName':_0x3e4011}),createPendingSegmentId(_0x2696f3);}const _0x170599=_0x345219[_0x49d91e(0x2a1)]?.['id'];if(!_0x170599)throw new SDKError(ErrorCode[_0x49d91e(0x238)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x2e8799=_0x49d91e(0x28e)+crypto[_0x49d91e(0x21b)]();try{const _0x42b075=await _0x1789c1['segment'][_0x49d91e(0x205)]({'name':_0x2e8799,'description':_0x357d8a[_0x49d91e(0x27b)]||_0x49d91e(0x2d9)+_0x2696f3,'journeyId':_0x170599,'rule':yamlRuleToApi(_0x357d8a[_0x49d91e(0x24f)],!![]),'countPopulation':!![],'parentFolderId':_0x2ec87b||'','audienceId':_0x5c1555});return _0x20a340[_0x49d91e(0x235)]&&console[_0x49d91e(0x2a7)](_0x49d91e(0x264)+_0x2696f3+_0x49d91e(0x273)+_0x2e8799+_0x49d91e(0x27e)+_0x42b075),_0x26d46e['set'](_0x2696f3,_0x42b075),_0x42b075;}catch(_0x26d44d){throw new SDKError(ErrorCode[_0x49d91e(0x257)],_0x49d91e(0x2e8)+_0x2696f3+_0x49d91e(0x2aa)+getErrorMessage(_0x26d44d),_0x26d44d);}},'resolveActivationId':async _0xfcae4b=>{const _0x5ed47c=_0x3b4d8e,_0x57a93c=_0x21d4d7[_0x5ed47c(0x269)](_0xfcae4b);if(_0x57a93c)return _0x57a93c;if(_0x345219['existingJourney']){const _0x5b3ab7=await _0x1789c1['journey'][_0x5ed47c(0x2dd)](_0x345219[_0x5ed47c(0x2a1)]['id']),_0x259bc3=_0x5b3ab7[_0x5ed47c(0x259)](_0x59345d=>_0x59345d[_0x5ed47c(0x20a)][_0x5ed47c(0x2a8)]?.[_0x5ed47c(0x246)]===_0xfcae4b);if(_0x259bc3)return _0x21d4d7[_0x5ed47c(0x23d)](_0xfcae4b,_0x259bc3['id']),_0x259bc3['id'];}throw new SDKError(ErrorCode['NOT_FOUND'],_0x5ed47c(0x1f9)+_0xfcae4b+'\x20(referenced\x20in\x20journey\x20'+_0x345219[_0x5ed47c(0x255)][_0x5ed47c(0x246)]+_0x5ed47c(0x291)+_0x5ed47c(0x249));},'resolveEmbeddedActivationId':async(_0x1386d8,_0x1ff737)=>{const _0x3406df=_0x3b4d8e,_0xd45dd6=_0x21d4d7[_0x3406df(0x269)](_0x1386d8);if(_0xd45dd6)return _0xd45dd6;if(_0x345219[_0x3406df(0x1f4)])return _0x11dc2d[_0x3406df(0x23d)](_0x1386d8,_0x1ff737),createPendingActivationId(_0x1386d8);if(_0x345219[_0x3406df(0x2a1)]){const _0x2630bd=await _0x1789c1[_0x3406df(0x241)][_0x3406df(0x2dd)](_0x345219[_0x3406df(0x2a1)]['id']),_0x25cae1=_0x2630bd[_0x3406df(0x259)](_0x428659=>_0x428659[_0x3406df(0x20a)]['activationParams']?.[_0x3406df(0x246)]===_0x1ff737['name']);if(_0x25cae1)return _0x21d4d7['set'](_0x1386d8,_0x25cae1['id']),_0x25cae1['id'];try{const _0x145455=await yamlActivationToCreateRequest(_0x1ff737,_0x16b623),_0x3780f7=await _0x1789c1[_0x3406df(0x241)][_0x3406df(0x2ac)](_0x345219[_0x3406df(0x2a1)]['id'],_0x145455);return _0x20a340[_0x3406df(0x235)]&&console[_0x3406df(0x2a7)](_0x3406df(0x284)+_0x1386d8+_0x3406df(0x24b)+_0x3780f7['id']),_0x21d4d7[_0x3406df(0x23d)](_0x1386d8,_0x3780f7['id']),_0x3780f7['id'];}catch(_0x4134d7){throw new SDKError(ErrorCode[_0x3406df(0x2e4)],_0x3406df(0x2d6)+_0x1386d8+'\x27:\x20'+getErrorMessage(_0x4134d7),_0x4134d7);}}throw new SDKError(ErrorCode[_0x3406df(0x238)],_0x3406df(0x222));},'resolveJourneyId':async _0x1a817d=>{const _0x1135a6=_0x3b4d8e;try{return await _0x1789c1[_0x1135a6(0x241)][_0x1135a6(0x26e)](_0x5c1555,_0x1a817d);}catch(_0x5d55be){throw new SDKError(ErrorCode[_0x1135a6(0x27d)],_0x1135a6(0x21a)+_0x1a817d+_0x1135a6(0x2b8)+_0x345219['yamlConfig'][_0x1135a6(0x246)]+'\x27)',_0x5d55be);}},'resolveStageId':async(_0x114d20,_0x3ab532)=>{const _0x5d49da=_0x3b4d8e,_0x2b6231=await _0x1789c1[_0x5d49da(0x241)][_0x5d49da(0x2c0)](_0x114d20),_0xe89e1b=_0x2b6231[_0x5d49da(0x20a)][_0x5d49da(0x216)][_0x5d49da(0x259)](_0x57896c=>_0x57896c['name']['toLowerCase']()===_0x3ab532[_0x5d49da(0x263)]());if(!_0xe89e1b?.['id'])throw new SDKError(ErrorCode[_0x5d49da(0x27d)],_0x5d49da(0x2c5)+_0x3ab532+_0x5d49da(0x2a2)+(_0x2b6231[_0x5d49da(0x20a)][_0x5d49da(0x207)]||_0x2b6231[_0x5d49da(0x20a)][_0x5d49da(0x246)])+'\x27');return _0xe89e1b['id'];}};try{const _0x2e41b0=await a36_0x46dd4c(_0x345219[_0x3b4d8e(0x255)],_0x5c1555,_0x157770),_0x4d45bd=_0xf7430e||_0x2ec87b;_0x4d45bd&&(_0x2e41b0[_0x3b4d8e(0x1f7)]={'parentFolder':{'data':{'id':_0x4d45bd,'type':_0x3b4d8e(0x215)}}});if(_0x345219[_0x3b4d8e(0x1f4)]){if(_0xfe395a[_0x3b4d8e(0x202)]>0x0||_0x11dc2d[_0x3b4d8e(0x202)]>0x0){const _0x204eb3=JSON[_0x3b4d8e(0x2b7)](JSON[_0x3b4d8e(0x23a)](_0x2e41b0));ensureJourneyDefaults(_0x204eb3[_0x3b4d8e(0x20a)]);for(const _0x564512 of _0x204eb3[_0x3b4d8e(0x20a)][_0x3b4d8e(0x216)]){_0x564512[_0x3b4d8e(0x2b4)]?.[_0x3b4d8e(0x218)]&&isPendingSegmentId(_0x564512['entryCriteria']['segmentId'])&&delete _0x564512[_0x3b4d8e(0x2b4)];if(_0x564512['steps'])for(const _0x30a7ba of Object[_0x3b4d8e(0x1f0)](_0x564512[_0x3b4d8e(0x2ce)])){const _0x3ce309=_0x564512[_0x3b4d8e(0x2ce)][_0x30a7ba];_0x3ce309[_0x3b4d8e(0x22e)]===_0x3b4d8e(0x22c)&&_0x3ce309[_0x3b4d8e(0x27a)]&&isPendingActivationId(_0x3ce309[_0x3b4d8e(0x27a)])&&(_0x3ce309[_0x3b4d8e(0x27a)]='');if(_0x3ce309[_0x3b4d8e(0x22e)]===_0x3b4d8e(0x2c7)&&_0x3ce309['branches'])for(const _0x29b0a1 of _0x3ce309[_0x3b4d8e(0x1fd)]){_0x29b0a1[_0x3b4d8e(0x218)]&&isPendingSegmentId(_0x29b0a1[_0x3b4d8e(0x218)])&&(_0x29b0a1['segmentId']='');}}}_0x20a340[_0x3b4d8e(0x235)]&&console['error'](_0x3b4d8e(0x1f5)+JSON['stringify'](_0x204eb3,null,0x2));const _0x5e0f4a=await _0x1789c1[_0x3b4d8e(0x241)][_0x3b4d8e(0x203)](_0x204eb3),_0x184241=_0x5e0f4a['id'],_0x83f032=new Map();for(const _0x4ffc52 of _0x5e0f4a[_0x3b4d8e(0x20a)]['journeyStages']){_0x83f032[_0x3b4d8e(0x23d)](_0x4ffc52[_0x3b4d8e(0x246)]['toLowerCase'](),_0x4ffc52['id']);}const _0x5bb0cc=new Map();for(const [_0x269c39,{definition:_0x2183e5,criteriaName:_0x385a96}]of _0xfe395a){const _0x407677=generateJourneyLocalName(_0x385a96)||'journey_entry_criteria_'+crypto[_0x3b4d8e(0x21b)]();_0x20a340[_0x3b4d8e(0x235)]&&console['error'](_0x3b4d8e(0x22f)+_0x269c39+_0x3b4d8e(0x273)+_0x407677+_0x3b4d8e(0x2ca)+_0x184241);const _0x501f89=await _0x1789c1[_0x3b4d8e(0x2c3)][_0x3b4d8e(0x205)]({'name':_0x407677,'description':_0x2183e5[_0x3b4d8e(0x27b)]||'Entry\x20criteria:\x20'+_0x269c39,'journeyId':_0x184241,'rule':yamlRuleToApi(_0x2183e5['rule'],!![]),'countPopulation':!![],'parentFolderId':_0x4d45bd||'','audienceId':_0x5c1555});_0x5bb0cc['set'](_0x269c39,_0x501f89),_0x26d46e[_0x3b4d8e(0x23d)](_0x269c39,_0x501f89),_0x20a340[_0x3b4d8e(0x235)]&&console[_0x3b4d8e(0x2a7)](_0x3b4d8e(0x264)+_0x269c39+_0x3b4d8e(0x24b)+_0x501f89);}const _0x3b34dd=new Map();for(const [_0x56d005,_0x269414]of _0x11dc2d){_0x20a340['verbose']&&console['error'](_0x3b4d8e(0x1fe)+_0x56d005+'\x27\x20with\x20journeyId:\x20'+_0x184241);try{const _0x2704b8=await yamlActivationToCreateRequest(_0x269414,_0x16b623),_0x524aee=await _0x1789c1['journey'][_0x3b4d8e(0x2ac)](_0x184241,_0x2704b8);_0x3b34dd[_0x3b4d8e(0x23d)](_0x56d005,_0x524aee['id']),_0x21d4d7[_0x3b4d8e(0x23d)](_0x56d005,_0x524aee['id']),_0x20a340[_0x3b4d8e(0x235)]&&console['error']('\x20\x20Created\x20embedded\x20activation\x20\x27'+_0x56d005+_0x3b4d8e(0x24b)+_0x524aee['id']);}catch(_0x1bae0e){throw new SDKError(ErrorCode[_0x3b4d8e(0x2e4)],_0x3b4d8e(0x2d6)+_0x56d005+_0x3b4d8e(0x2aa)+getErrorMessage(_0x1bae0e),_0x1bae0e);}}const _0x612f31=JSON[_0x3b4d8e(0x2b7)](JSON[_0x3b4d8e(0x23a)](_0x2e41b0));_0x612f31['id']=_0x184241,ensureJourneyDefaults(_0x612f31[_0x3b4d8e(0x20a)]);for(const _0x1775b3 of _0x612f31['attributes']['journeyStages']){const _0x4123c0=_0x83f032['get'](_0x1775b3[_0x3b4d8e(0x246)][_0x3b4d8e(0x263)]());_0x4123c0&&(_0x1775b3['id']=_0x4123c0);if(_0x1775b3[_0x3b4d8e(0x2b4)]?.[_0x3b4d8e(0x218)]&&isPendingSegmentId(_0x1775b3['entryCriteria'][_0x3b4d8e(0x218)])){const _0x418fab=extractPendingSegmentName(_0x1775b3[_0x3b4d8e(0x2b4)][_0x3b4d8e(0x218)]),_0x253312=_0x5bb0cc[_0x3b4d8e(0x269)](_0x418fab);_0x253312&&(_0x1775b3['entryCriteria']['segmentId']=_0x253312);}if(_0x1775b3['steps']){const _0x1293de=_0x126805=>_0x2e41b0[_0x3b4d8e(0x20a)][_0x3b4d8e(0x216)][_0x3b4d8e(0x259)](_0x4de781=>_0x4de781[_0x3b4d8e(0x246)][_0x3b4d8e(0x263)]()===_0x1775b3[_0x3b4d8e(0x246)][_0x3b4d8e(0x263)]())?.[_0x3b4d8e(0x2ce)]?.[_0x126805];for(const _0x1ca792 of Object['keys'](_0x1775b3['steps'])){const _0x77cfeb=_0x1775b3[_0x3b4d8e(0x2ce)][_0x1ca792],_0x32510e=_0x1293de(_0x1ca792);if(_0x77cfeb[_0x3b4d8e(0x22e)]===_0x3b4d8e(0x22c)&&_0x77cfeb[_0x3b4d8e(0x27a)]&&(isPendingActivationId(_0x77cfeb[_0x3b4d8e(0x27a)])||_0x77cfeb[_0x3b4d8e(0x27a)]==='')){if(_0x32510e?.[_0x3b4d8e(0x27a)]&&isPendingActivationId(_0x32510e['journeyActivationStepId'])){const _0x5a8b4b=extractPendingActivationName(_0x32510e['journeyActivationStepId']),_0x4b4667=_0x3b34dd[_0x3b4d8e(0x269)](_0x5a8b4b);_0x4b4667&&(_0x77cfeb[_0x3b4d8e(0x27a)]=_0x4b4667);}}if(_0x77cfeb[_0x3b4d8e(0x22e)]===_0x3b4d8e(0x2c7)&&_0x77cfeb[_0x3b4d8e(0x1fd)]&&_0x32510e?.[_0x3b4d8e(0x1fd)])for(let _0x3fb4a0=0x0;_0x3fb4a0<_0x77cfeb[_0x3b4d8e(0x1fd)][_0x3b4d8e(0x281)];_0x3fb4a0++){const _0x435b2d=_0x77cfeb[_0x3b4d8e(0x1fd)][_0x3fb4a0],_0x20a4b2=_0x32510e[_0x3b4d8e(0x1fd)][_0x3fb4a0];if(_0x20a4b2?.[_0x3b4d8e(0x218)]&&isPendingSegmentId(_0x20a4b2[_0x3b4d8e(0x218)])){const _0x887544=extractPendingSegmentName(_0x20a4b2['segmentId']),_0x188801=_0x5bb0cc['get'](_0x887544);_0x188801&&(_0x435b2d[_0x3b4d8e(0x218)]=_0x188801);}}}}}return _0x20a340['verbose']&&console[_0x3b4d8e(0x2a7)]('\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20'+JSON[_0x3b4d8e(0x23a)](_0x612f31,null,0x2)),await _0x1789c1[_0x3b4d8e(0x241)]['update'](_0x184241,_0x612f31),{'action':'created','name':_0x345219[_0x3b4d8e(0x255)][_0x3b4d8e(0x246)],'journeyId':_0x184241};}else{ensureJourneyDefaults(_0x2e41b0['attributes']);_0x20a340['verbose']&&console[_0x3b4d8e(0x2a7)]('\x20\x20Journey\x20API\x20request:\x20'+JSON[_0x3b4d8e(0x23a)](_0x2e41b0,null,0x2));const _0x2c263b=await _0x1789c1[_0x3b4d8e(0x241)][_0x3b4d8e(0x203)](_0x2e41b0);return{'action':'created','name':_0x345219[_0x3b4d8e(0x255)][_0x3b4d8e(0x246)],'journeyId':_0x2c263b['id']};}}else{if(_0x345219[_0x3b4d8e(0x234)]&&_0x345219[_0x3b4d8e(0x2a1)])return ensureJourneyDefaults(_0x2e41b0[_0x3b4d8e(0x20a)]),await _0x1789c1['journey']['update'](_0x345219[_0x3b4d8e(0x2a1)]['id'],_0x2e41b0),{'action':_0x3b4d8e(0x229),'name':_0x345219[_0x3b4d8e(0x255)][_0x3b4d8e(0x246)],'journeyId':_0x345219['existingJourney']['id']};}return{'action':'unchanged','name':_0x345219['yamlConfig'][_0x3b4d8e(0x246)],'journeyId':_0x345219[_0x3b4d8e(0x2a1)]?.['id']};}catch(_0x5dc05d){const _0x263efa=isHttp400Error(_0x5dc05d),_0x312bd4=_0x263efa?ErrorCode[_0x3b4d8e(0x24d)]:ErrorCode[_0x3b4d8e(0x2e4)],_0x10811a=getErrorMessage(_0x5dc05d);throw new SDKError(_0x312bd4,'Failed\x20to\x20'+(_0x345219[_0x3b4d8e(0x1f4)]?_0x3b4d8e(0x203):'update')+'\x20journey\x20from\x20file:\x20'+_0x345219[_0x3b4d8e(0x2a6)]+'\x0a\x20\x20'+_0x10811a,_0x5dc05d);}}));_0x11fddb[_0x3a189d(0x210)](..._0x12bafe),_0x21d94a+=_0x27aad0['length'],_0x36d365['setExtra']('('+_0x21d94a+'/'+_0x2ed3cc['length']+')');}return _0x11fddb;},{'verbose':_0x20a340[_0x463af4(0x235)]});for(const _0x895676 of _0x5cc12d[_0x463af4(0x228)]){if(_0x895676[_0x463af4(0x239)]===_0x463af4(0x253))console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x29c)](_0x463af4(0x1ff)+_0x895676[_0x463af4(0x246)]+'\x27')),_0xf8126b++;else _0x895676[_0x463af4(0x239)]==='updated'&&(console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x237)](_0x463af4(0x27c)+_0x895676[_0x463af4(0x246)]+'\x27')),_0x49b210++);}if(_0xb58b48&&_0x5cc12d[_0x463af4(0x228)][_0x463af4(0x281)]===0x1){const _0x3ea8df=_0x5cc12d[_0x463af4(0x228)][0x0];if(_0x3ea8df[_0x463af4(0x2d8)]){const _0x4de8b7=getConsoleNextUrl(_0x20a340['site'],'/app/ps/'+_0x5c1555+_0x463af4(0x2d7)+_0x3ea8df[_0x463af4(0x2d8)]+'/j/da/je');console[_0x463af4(0x2a7)]('\x20\x20'+a36_0x55ad09[_0x463af4(0x26a)](_0x4de8b7));}}}for(const _0x2039db of _0x3d4c25){console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x237)](_0x463af4(0x297)+_0x2039db[_0x463af4(0x207)])),_0x4d7f5c++;}const _0x56edc4=[];if(_0x3448f7>0x0)_0x56edc4[_0x463af4(0x210)](_0x3448f7+_0x463af4(0x232));if(_0x4b4fc2>0x0)_0x56edc4[_0x463af4(0x210)](_0x4b4fc2+_0x463af4(0x28a));if(_0x18421c>0x0)_0x56edc4['push'](_0x18421c+_0x463af4(0x278));const _0x15105b=[];if(_0xf8126b>0x0)_0x15105b[_0x463af4(0x210)](_0xf8126b+'\x20created');if(_0x49b210>0x0)_0x15105b['push'](_0x49b210+_0x463af4(0x28a));if(_0x4d7f5c>0x0)_0x15105b[_0x463af4(0x210)](_0x4d7f5c+_0x463af4(0x278));const _0x2d01b5=[];if(_0x233b1b>0x0)_0x2d01b5[_0x463af4(0x210)](_0x233b1b+'\x20created');if(_0xdeba32>0x0)_0x2d01b5[_0x463af4(0x210)](_0xdeba32+_0x463af4(0x28a));if(_0x3441e2>0x0)_0x2d01b5[_0x463af4(0x210)](_0x3441e2+'\x20deleted');return console[_0x463af4(0x2a7)](a36_0x55ad09['green'](_0x463af4(0x2b2))),_0x56edc4[_0x463af4(0x281)]>0x0&&!_0x20a340['journeysOnly']&&console[_0x463af4(0x2a7)](_0x463af4(0x2c8)+_0x56edc4[_0x463af4(0x20c)](',\x20')),_0x15105b[_0x463af4(0x281)]>0x0&&console[_0x463af4(0x2a7)](_0x463af4(0x29d)+_0x15105b[_0x463af4(0x20c)](',\x20')),_0x2d01b5['length']>0x0&&!_0x20a340[_0x463af4(0x267)]&&console['error'](_0x463af4(0x201)+_0x2d01b5[_0x463af4(0x20c)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x2ebee9){const _0x3c0df3=a36_0xb9787e,_0x4ae849=new Map(),_0x103ecf=new Map();for(const _0x5b91c4 of _0x2ebee9){_0x103ecf['set'](_0x5b91c4['id'],_0x5b91c4);}const _0x3c203c=new Set();for(const _0x1d89ff of _0x2ebee9){!_0x1d89ff[_0x3c0df3(0x212)]&&_0x3c203c[_0x3c0df3(0x252)](_0x1d89ff['id']);}function _0x66ff67(_0x50b6ba){const _0x2bf44d=_0x3c0df3;if(_0x3c203c['has'](_0x50b6ba['id']))return'';if(_0x50b6ba[_0x2bf44d(0x212)]){const _0x4ccdc1=_0x103ecf['get'](_0x50b6ba['parentFolderId']);if(_0x4ccdc1){const _0x3754e8=_0x66ff67(_0x4ccdc1);return _0x3754e8?_0x3754e8+'/'+_0x50b6ba[_0x2bf44d(0x246)]:_0x50b6ba[_0x2bf44d(0x246)];}}return _0x50b6ba[_0x2bf44d(0x246)];}for(const _0x413bf8 of _0x2ebee9){const _0x127b73=_0x66ff67(_0x413bf8);_0x4ae849[_0x3c0df3(0x23d)](_0x127b73,_0x413bf8['id']);}return _0x4ae849;}function findYamlFiles(_0x48e3b7){const _0x2b785a=[];function _0x5e394b(_0x3cd1b1){const _0x46c350=a36_0x5329,_0x566d70=readdirSync(_0x3cd1b1,{'withFileTypes':!![]});for(const _0x4ea177 of _0x566d70){const _0x17b437=a36_0x5e769c[_0x46c350(0x20c)](_0x3cd1b1,_0x4ea177[_0x46c350(0x246)]);if(_0x4ea177['isDirectory']())_0x5e394b(_0x17b437);else(_0x4ea177[_0x46c350(0x246)]['endsWith']('.yml')||_0x4ea177[_0x46c350(0x246)][_0x46c350(0x213)](_0x46c350(0x2c1)))&&_0x2b785a[_0x46c350(0x210)](_0x17b437);}}return _0x5e394b(_0x48e3b7),_0x2b785a;}function calculateActivationActions(_0x51c1a9,_0x50f6ff,_0x1ca9a4,_0x25fb33){const _0x1065d6=a36_0xb9787e,_0x2cbda9=[],_0x4ef866=new Map();for(const _0x349f45 of _0x50f6ff){_0x4ef866[_0x1065d6(0x23d)](_0x349f45[_0x1065d6(0x246)],_0x349f45);}const _0xb61535=new Map();for(const _0x3342a6 of _0x51c1a9){_0xb61535[_0x1065d6(0x23d)](_0x3342a6['name'],_0x3342a6);}for(const _0x827540 of _0x51c1a9){const _0x42a70c=_0x4ef866[_0x1065d6(0x269)](_0x827540[_0x1065d6(0x246)]);if(!_0x42a70c)_0x2cbda9[_0x1065d6(0x210)]({'type':_0x1065d6(0x203),'name':_0x827540[_0x1065d6(0x246)],'yamlActivation':_0x827540});else{const _0x35c6ae=activationToYaml(_0x42a70c,_0x1ca9a4,_0x25fb33),_0x23d18b=a36_0x14c597[_0x1065d6(0x23a)](_0x35c6ae),_0x33bde0=a36_0x14c597[_0x1065d6(0x23a)](_0x827540);_0x23d18b!==_0x33bde0&&_0x2cbda9[_0x1065d6(0x210)]({'type':'update','name':_0x827540['name'],'yamlActivation':_0x827540,'existingActivation':_0x42a70c});}}for(const _0xbecf6e of _0x50f6ff){!_0xb61535['has'](_0xbecf6e[_0x1065d6(0x246)])&&_0x2cbda9['push']({'type':_0x1065d6(0x236),'name':_0xbecf6e[_0x1065d6(0x246)],'existingActivation':_0xbecf6e});}return _0x2cbda9;}