@treasuredata/tdx 0.12.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.d.ts.map +1 -1
  11. package/dist/commands/agent-command.js +1 -1
  12. package/dist/commands/agent-command.js.map +1 -1
  13. package/dist/commands/api-command.js +1 -1
  14. package/dist/commands/auth-command.js +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/claude-command.js +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-command.js.map +1 -1
  25. package/dist/commands/job-command.js +1 -1
  26. package/dist/commands/journey-command.js +1 -1
  27. package/dist/commands/journey-validate-command.js +1 -1
  28. package/dist/commands/llm-command.js +1 -1
  29. package/dist/commands/llm-proxy.js +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profile-command.d.ts +50 -0
  32. package/dist/commands/profile-command.d.ts.map +1 -0
  33. package/dist/commands/profile-command.js +1 -0
  34. package/dist/commands/profile-command.js.map +1 -0
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-use-command.js.map +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/use-command.js +1 -1
  50. package/dist/commands/user-command.js +1 -1
  51. package/dist/commands/workflow-command.d.ts.map +1 -1
  52. package/dist/commands/workflow-command.js +1 -1
  53. package/dist/commands/workflow-command.js.map +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/command-output.js.map +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/profile.d.ts +7 -0
  64. package/dist/core/profile.d.ts.map +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/profile.js.map +1 -1
  67. package/dist/core/project-config.js +1 -1
  68. package/dist/core/session.js +1 -1
  69. package/dist/core/user-cache.js +1 -1
  70. package/dist/core/version.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-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/api.js +1 -1
  82. package/dist/sdk/client/cdp-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.d.ts +19 -0
  84. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  85. package/dist/sdk/client/endpoints.js +1 -1
  86. package/dist/sdk/client/endpoints.js.map +1 -1
  87. package/dist/sdk/client/engage-api-client.js +1 -1
  88. package/dist/sdk/client/http-client.js +1 -1
  89. package/dist/sdk/client/llm-api-client.js +1 -1
  90. package/dist/sdk/client/rate-limiter.js +1 -1
  91. package/dist/sdk/client/td-api-client.js +1 -1
  92. package/dist/sdk/client/trino-api-client.js +1 -1
  93. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  94. package/dist/sdk/client/workflow-client.js +1 -1
  95. package/dist/sdk/client/workflow-client.js.map +1 -1
  96. package/dist/sdk/connection-validator.js +1 -1
  97. package/dist/sdk/connection.js +1 -1
  98. package/dist/sdk/engage.js +1 -1
  99. package/dist/sdk/errors.js +1 -1
  100. package/dist/sdk/index.js +1 -1
  101. package/dist/sdk/io/index.js +1 -1
  102. package/dist/sdk/io/node-filesystem.js +1 -1
  103. package/dist/sdk/job.js +1 -1
  104. package/dist/sdk/journey.js +1 -1
  105. package/dist/sdk/llm/chat-cache.js +1 -1
  106. package/dist/sdk/llm/index.js +1 -1
  107. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  108. package/dist/sdk/llm/model-aliases.js +1 -1
  109. package/dist/sdk/llm/model-factors.js +1 -1
  110. package/dist/sdk/query/index.js +1 -1
  111. package/dist/sdk/query/sql-parser.js +1 -1
  112. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  113. package/dist/sdk/segment/fields-display.js +1 -1
  114. package/dist/sdk/segment/file-discovery.js +1 -1
  115. package/dist/sdk/segment/journey-utils.js +1 -1
  116. package/dist/sdk/segment/journey-yaml.js +1 -1
  117. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  118. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  119. package/dist/sdk/segment/pull-workflow.js +1 -1
  120. package/dist/sdk/segment/push-workflow.js +1 -1
  121. package/dist/sdk/segment/resolution-context.js +1 -1
  122. package/dist/sdk/segment/segment-path-parser.js +1 -1
  123. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  124. package/dist/sdk/segment/target-resolution.js +1 -1
  125. package/dist/sdk/segment/tdx-config.js +1 -1
  126. package/dist/sdk/segment/validate-files.js +1 -1
  127. package/dist/sdk/segment/yaml-validator.js +1 -1
  128. package/dist/sdk/segment.js +1 -1
  129. package/dist/sdk/types/index.js +1 -1
  130. package/dist/sdk/types/progress.js +1 -1
  131. package/dist/sdk/types/workflow.d.ts +6 -0
  132. package/dist/sdk/types/workflow.d.ts.map +1 -1
  133. package/dist/sdk/user.js +1 -1
  134. package/dist/sdk/util/format-detector.js +1 -1
  135. package/dist/sdk/util/formatters.d.ts +11 -0
  136. package/dist/sdk/util/formatters.d.ts.map +1 -1
  137. package/dist/sdk/util/formatters.js +1 -1
  138. package/dist/sdk/util/formatters.js.map +1 -1
  139. package/dist/sdk/util/index.js +1 -1
  140. package/dist/sdk/util/tree-formatter.js +1 -1
  141. package/dist/sdk/workflow/clone-workflow.js +1 -1
  142. package/dist/sdk/workflow/index.d.ts.map +1 -1
  143. package/dist/sdk/workflow/index.js +1 -1
  144. package/dist/sdk/workflow/index.js.map +1 -1
  145. package/dist/sdk/workflow/pull-workflow.js +1 -1
  146. package/dist/sdk/workflow/push-workflow.js +1 -1
  147. package/dist/sdk/workflow/tdx-config.js +1 -1
  148. package/dist/sdk/workflow/workflow-utils.js +1 -1
  149. package/dist/utils/async.js +1 -1
  150. package/dist/utils/colors.js +1 -1
  151. package/dist/utils/diff.js +1 -1
  152. package/dist/utils/file-permissions.js +1 -1
  153. package/dist/utils/json-loader.js +1 -1
  154. package/dist/utils/option-validation.js +1 -1
  155. package/dist/utils/port.js +1 -1
  156. package/dist/utils/process.js +1 -1
  157. package/dist/utils/prompt.js +1 -1
  158. package/dist/utils/spinner.js +1 -1
  159. package/dist/utils/sse-parser.js +1 -1
  160. package/dist/utils/string-utils.js +1 -1
  161. package/dist/utils/table-ref-parser.js +1 -1
  162. package/dist/utils/tdx-logger.js +1 -1
  163. package/dist/utils/version-check.js +1 -1
  164. package/package.json +2 -3
  165. package/LICENSE +0 -190
  166. package/dist/commands/context-command.d.ts +0 -15
  167. package/dist/commands/context-command.d.ts.map +0 -1
  168. package/dist/commands/context-command.js +0 -1
  169. package/dist/commands/context-command.js.map +0 -1
@@ -1 +1 @@
1
- const a25_0x108244=a25_0x424d;(function(_0x2b82b5,_0x4aeca5){const _0x8cb412=a25_0x424d,_0xf76e9=_0x2b82b5();while(!![]){try{const _0x3c4a1d=-parseInt(_0x8cb412(0xe5))/0x1+-parseInt(_0x8cb412(0x122))/0x2+-parseInt(_0x8cb412(0x118))/0x3+parseInt(_0x8cb412(0xff))/0x4+-parseInt(_0x8cb412(0x107))/0x5*(-parseInt(_0x8cb412(0xdc))/0x6)+parseInt(_0x8cb412(0x104))/0x7*(-parseInt(_0x8cb412(0x161))/0x8)+parseInt(_0x8cb412(0x15e))/0x9*(parseInt(_0x8cb412(0x141))/0xa);if(_0x3c4a1d===_0x4aeca5)break;else _0xf76e9['push'](_0xf76e9['shift']());}catch(_0x164f68){_0xf76e9['push'](_0xf76e9['shift']());}}}(a25_0x4df9,0x84ab8));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a25_0x424d(_0x26950e,_0x44e834){_0x26950e=_0x26950e-0xd0;const _0x4df982=a25_0x4df9();let _0x424d3a=_0x4df982[_0x26950e];return _0x424d3a;}import a25_0x28a98a from'chalk';function a25_0x4df9(){const _0x27f9e5=['Show\x20folder\x20or\x20child\x20segment\x20details','setJobId','toLocaleString','site','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','segment:view','fullPath','\x27\x20with\x20ID:\x20','type','segmentName','✔\x20Created\x20folder\x20\x27','Error:\x20','parent','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','folderId','2301543VWGLcV','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','verbose','\x27...','Site:\x20','getParent','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','json','1628900JbpQIr','\x20\x20Cause:\x20','segment:describe','segment:folder:list','execute','SEGMENT_NOT_FOUND','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SEGMENT_FOLDER_NOT_FOUND','Use:\x20tdx\x20ps\x20view\x20-w','\x20[Job\x20ID:\x20','folder','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','parentId','Target\x20path:\x20','Fetching\x20segment\x20details...','cause','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20rows\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','segmentId','/app/ps/','Options:','getSegment','Usage:\x20tdx\x20sg\x20show\x20<name>','cyan','segment:desc','message','information_schema','resolveParentId','25910xGZFHW','createFolder','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','stats','in\x20','segment:sql','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','/e/','listFolders','segment:folder:create','Examples:','Segment\x20ID\x20missing\x20from\x20resolved\x20path','code','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','error','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Use:\x20tdx\x20ps\x20desc','Resolving\x20\x27','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Creating\x20folder\x20\x27','description','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20\x20Full\x20path:\x20','parentSegment','✖\x20Query\x20failed\x20[','folderPath','7002LBIwwe','(root)','Executing\x20segment\x20query...','32Epgeoe','web','Resolving\x20folder\x20\x27','test','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Use:\x20tdx\x20ps\x20view','green','Parent\x20name:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','INVALID_ARGUMENT','Fetching\x20folder\x20details...','Get\x20SQL\x20query\x20for\x20child\x20segment','Resolving\x20parent\x20folder\x20\x27','Parent\x20ID:\x20','Resolved\x20parent\x20ID:\x20','url','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','jsonl','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20sql','1046172NKDJZe','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','segment','includes','resolvePathToResource','segmentPath','\x20folder','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','367730mUXQxc','data','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','name','jobId','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Create\x20segment\x20folder\x20for\x20organization','getFolder','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Resolving\x20parent\x20segment\x20\x27','\x20\x20Segment\x20name:\x20','Fetching\x20SQL\x20for\x20segment...','Folder\x20ID\x20missing\x20from\x20resolved\x20path','format','resolveFolderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Listing\x20folders\x20for\x20parent\x20\x27','getSegmentSQL','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','✔\x20Found\x20','\x20Opening\x20','Folder\x20name:\x20','query','Folder\x20ID:\x20','1766004QBgHFV','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','243047PZWJlk','Error:\x20Path\x20or\x20name\x20is\x20required','Fetching\x20parent\x20segment\x20details...','5CPxgrS'];a25_0x4df9=function(){return _0x27f9e5;};return a25_0x4df9();}async function resolveSegmentTarget(_0x5007aa,_0x3ecfdc,_0x47a376){const _0x55184c=a25_0x424d;if(isYamlFilePath(_0x5007aa))try{const _0x3369a4=await resolveYamlFilePath(_0x5007aa);return _0x47a376&&(console[_0x55184c(0x150)]('Resolved\x20YAML\x20file:\x20'+_0x5007aa),console['error']('\x20\x20Parent\x20segment:\x20'+_0x3369a4[_0x55184c(0x15b)]),console[_0x55184c(0x150)](_0x55184c(0xf1)+_0x3369a4[_0x55184c(0x111)]),console[_0x55184c(0x150)]('\x20\x20Folder\x20path:\x20'+(_0x3369a4[_0x55184c(0x15d)]||_0x55184c(0x15f))),console[_0x55184c(0x150)](_0x55184c(0x15a)+_0x3369a4[_0x55184c(0x10e)])),_0x3369a4[_0x55184c(0x10e)];}catch(_0x23239e){throw new SDKError(ErrorCode[_0x55184c(0x16b)],_0x55184c(0x16a)+_0x23239e[_0x55184c(0x13e)]);}if(!_0x3ecfdc)throw new SDKError(ErrorCode[_0x55184c(0x16b)],_0x55184c(0x120));return _0x3ecfdc+'/'+_0x5007aa;}export class SegmentDescribeCommand extends BaseCommand{['name']=a25_0x108244(0x124);[a25_0x108244(0x157)]='Show\x20segment\x20or\x20folder\x20details';async[a25_0x108244(0x126)](_0x4a2497){const _0x136b0d=a25_0x108244,{options:_0x3efec4,args:_0x1d3600,tdx:_0x18dd6b}=_0x4a2497,_0x408f95=_0x1d3600[0x0],_0x183b98=!_0x408f95&&!!_0x3efec4[_0x136b0d(0x15b)],_0x804581=_0x408f95||_0x3efec4[_0x136b0d(0x15b)];if(!_0x804581)return console[_0x136b0d(0x150)](_0x136b0d(0x105)),console['error'](_0x136b0d(0x165)),console[_0x136b0d(0x150)]('Examples:'),console[_0x136b0d(0x150)](_0x136b0d(0xef)),console[_0x136b0d(0x150)](_0x136b0d(0x100)),console[_0x136b0d(0x150)](_0x136b0d(0x129)),console[_0x136b0d(0x150)](_0x136b0d(0x152)),0x1;try{const _0x402710=_0x3efec4[_0x136b0d(0xe2)];let _0x580338=_0x804581;!_0x183b98&&_0x402710&&!_0x804581[_0x136b0d(0xe0)]('/')&&(_0x580338=_0x402710+'/'+_0x804581,_0x3efec4[_0x136b0d(0x11c)]&&console[_0x136b0d(0x150)](_0x136b0d(0x102)+_0x580338));const _0x4a06bb=await withSpinner(_0x136b0d(0x128)+_0x580338+_0x136b0d(0x11d),()=>_0x18dd6b[_0x136b0d(0xdf)]['resolvePathToResource'](_0x580338),{'verbose':_0x3efec4['verbose']}),_0x4eb027=_0x4a06bb[_0x136b0d(0xe6)];_0x3efec4['verbose']&&(console['error'](_0x136b0d(0xe7)+_0x4eb027['type']),console[_0x136b0d(0x150)](_0x136b0d(0xd3)+_0x4eb027['parentId']),_0x4eb027[_0x136b0d(0x117)]&&console[_0x136b0d(0x150)](_0x136b0d(0xfe)+_0x4eb027[_0x136b0d(0x117)]),_0x4eb027[_0x136b0d(0x137)]&&console[_0x136b0d(0x150)]('Segment\x20ID:\x20'+_0x4eb027[_0x136b0d(0x137)]));if(_0x4eb027[_0x136b0d(0x110)]===_0x136b0d(0x114)){const _0x2d7017=await withSpinner(_0x136b0d(0x106),()=>_0x18dd6b[_0x136b0d(0xdf)][_0x136b0d(0x11f)](_0x4eb027[_0x136b0d(0x130)]),{'verbose':_0x3efec4['verbose']});await handleSingleObjectOutput(_0x2d7017['data'],_0x3efec4);}else{if(_0x4eb027['type']===_0x136b0d(0x12d)){if(!_0x4eb027[_0x136b0d(0x117)])throw new SDKError(ErrorCode[_0x136b0d(0x12a)],_0x136b0d(0xf3));const _0x120230=await withSpinner('Fetching\x20folder\x20details...',()=>_0x18dd6b[_0x136b0d(0xdf)][_0x136b0d(0xed)](_0x4eb027['folderId']),{'verbose':_0x3efec4['verbose']});await handleSingleObjectOutput(_0x120230[_0x136b0d(0xe6)],_0x3efec4);}else{if(_0x4eb027['type']===_0x136b0d(0xdf)){if(!_0x4eb027[_0x136b0d(0x137)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x136b0d(0x14c));const _0x5a1559=await withSpinner('Fetching\x20segment\x20details...',()=>_0x18dd6b[_0x136b0d(0xdf)][_0x136b0d(0x13a)](_0x4eb027['parentId'],_0x4eb027['segmentId']),{'verbose':_0x3efec4[_0x136b0d(0x11c)]});await handleSingleObjectOutput(_0x5a1559['data'],_0x3efec4);}}}return 0x0;}catch(_0x5c50e4){if(_0x5c50e4 instanceof SDKError)return console[_0x136b0d(0x150)]('Error:\x20'+_0x5c50e4[_0x136b0d(0x13e)]),_0x5c50e4['cause']&&console[_0x136b0d(0x150)](_0x136b0d(0x123)+_0x5c50e4[_0x136b0d(0x133)]),0x1;throw _0x5c50e4;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x108244(0xe9)]='segment:show';[a25_0x108244(0x157)]=a25_0x108244(0x136);async[a25_0x108244(0x126)](_0x32d7c1){const _0x4cd887=a25_0x108244,{options:_0x25d875,args:_0xd83522,tdx:_0x51f63c}=_0x32d7c1,_0x92f9d1=_0xd83522[0x0];if(!_0x92f9d1)return console[_0x4cd887(0x150)](_0x4cd887(0x11a)),console[_0x4cd887(0x150)](_0x4cd887(0x13b)),console[_0x4cd887(0x150)](_0x4cd887(0xda)),console['error'](_0x4cd887(0x14b)),console[_0x4cd887(0x150)](_0x4cd887(0x14e)),console[_0x4cd887(0x150)](_0x4cd887(0x12f)),0x1;try{const _0x43be7a=_0x25d875[_0x4cd887(0x15b)],_0x297c4c=await resolveSegmentTarget(_0x92f9d1,_0x43be7a,_0x25d875[_0x4cd887(0x11c)]);_0x25d875['verbose']&&console[_0x4cd887(0x150)](_0x4cd887(0x131)+_0x297c4c);const _0x1b7f55=await withSpinner('Resolving\x20\x27'+_0x92f9d1+_0x4cd887(0x11d),()=>_0x51f63c[_0x4cd887(0xdf)][_0x4cd887(0xe1)](_0x297c4c),{'verbose':_0x25d875['verbose']}),_0x23d616=_0x1b7f55[_0x4cd887(0xe6)];_0x25d875[_0x4cd887(0x11c)]&&(console[_0x4cd887(0x150)]('Resolved\x20type:\x20'+_0x23d616[_0x4cd887(0x110)]),console[_0x4cd887(0x150)](_0x4cd887(0xd3)+_0x23d616[_0x4cd887(0x130)]));if(_0x23d616[_0x4cd887(0x110)]===_0x4cd887(0x12d))return console[_0x4cd887(0x150)](_0x4cd887(0x147)),console[_0x4cd887(0x150)](_0x4cd887(0xde)),0x1;if(_0x23d616[_0x4cd887(0x110)]==='parent')return console[_0x4cd887(0x150)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4cd887(0x150)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x23d616[_0x4cd887(0x137)])throw new SDKError(ErrorCode[_0x4cd887(0x127)],_0x4cd887(0x14c));const _0x3b6d5b=await withSpinner(_0x4cd887(0xf2),()=>_0x51f63c[_0x4cd887(0xdf)][_0x4cd887(0xf8)](_0x23d616[_0x4cd887(0x130)],_0x23d616[_0x4cd887(0x137)]),{'verbose':_0x25d875[_0x4cd887(0x11c)]});let _0xcb97e8=_0x3b6d5b[_0x4cd887(0xe6)];const _0xd1cab3=resolveLimit(_0x25d875['limit'],DEFAULT_DISPLAY_LIMIT),_0x463688=/\bLIMIT\s+\d+/i[_0x4cd887(0x164)](_0xcb97e8);!_0x463688&&(_0xcb97e8=_0xcb97e8['trim']()['replace'](/;+$/,''),_0xcb97e8='SELECT\x20*\x20FROM\x20(\x0a'+_0xcb97e8+_0x4cd887(0xee)+_0xd1cab3);_0x25d875[_0x4cd887(0x11c)]&&console['error']('SQL\x20query:\x0a'+_0xcb97e8);const _0x2512c4=await withProgressSpinner(_0x4cd887(0x160),async _0x33ed62=>{const _0x70f4cb=_0x4cd887,_0x19d70b=await _0x51f63c[_0x70f4cb(0xfd)][_0x70f4cb(0x126)](_0xcb97e8,{'catalog':'td','schema':_0x70f4cb(0x13f),'onJobId':_0x53ac38=>{const _0x169ace=_0x70f4cb;_0x33ed62[_0x169ace(0x109)](_0x53ac38);}});return _0x19d70b;},{'verbose':_0x25d875[_0x4cd887(0x11c)]}),_0x44b0cc=_0x2512c4[_0x4cd887(0xe6)],_0x32be0e=_0x44b0cc[_0x4cd887(0xea)]?_0x4cd887(0x12c)+_0x44b0cc[_0x4cd887(0xea)]+']':'';return console[_0x4cd887(0x150)](_0x4cd887(0x151)+_0x44b0cc[_0x4cd887(0x144)]['processedRows'][_0x4cd887(0x10a)]()+_0x4cd887(0x135)+(_0x4cd887(0x145)+formatElapsed(_0x44b0cc[_0x4cd887(0x144)]['elapsedTimeMillis'])+_0x32be0e)),await handleQueryOutput(_0x44b0cc,_0x25d875),0x0;}catch(_0x1fe7cb){if(_0x1fe7cb instanceof SDKError)return console['error'](_0x4cd887(0x15c)+_0x1fe7cb[_0x4cd887(0x14d)]+']'),console[_0x4cd887(0x150)]('\x0a'+_0x1fe7cb[_0x4cd887(0x13e)]),0x1;throw _0x1fe7cb;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a25_0x108244(0x125);[a25_0x108244(0x157)]=a25_0x108244(0x115);async[a25_0x108244(0x126)](_0x75667){const _0x5f172b=a25_0x108244,{options:_0x255e44,args:_0x55fe99,tdx:_0x401799}=_0x75667;if(_0x55fe99['length']===0x0)return console[_0x5f172b(0x150)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x5f172b(0x150)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x2b2013=_0x55fe99[0x0];try{_0x255e44[_0x5f172b(0x11c)]&&(console[_0x5f172b(0x150)]('Site:\x20'+_0x255e44[_0x5f172b(0x10b)]),console[_0x5f172b(0x150)](_0x5f172b(0x169)+_0x2b2013));const _0x3c1199=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2b2013+_0x5f172b(0x11d),()=>_0x401799[_0x5f172b(0xdf)][_0x5f172b(0x140)](_0x2b2013),{'verbose':_0x255e44[_0x5f172b(0x11c)]}),_0x2e12d2=_0x3c1199[_0x5f172b(0xe6)];_0x255e44[_0x5f172b(0x11c)]&&console[_0x5f172b(0x150)](_0x5f172b(0xd4)+_0x2e12d2);const _0xf89e72=await withSpinner(_0x5f172b(0xf7)+_0x2b2013+_0x5f172b(0x11d),()=>_0x401799[_0x5f172b(0xdf)][_0x5f172b(0x149)](_0x2e12d2),{'verbose':_0x255e44[_0x5f172b(0x11c)]}),_0x49bbda=_0xf89e72['data'];return console[_0x5f172b(0x150)](_0x5f172b(0xfa)+_0x49bbda[_0x5f172b(0xd9)]+_0x5f172b(0xe3)+(_0x49bbda[_0x5f172b(0xd9)]!==0x1?'s':'')),await handleSDKOutput(_0x49bbda,_0x255e44),0x0;}catch(_0x425f2a){if(_0x425f2a instanceof SDKError)return console[_0x5f172b(0x150)](_0x5f172b(0x113)+_0x425f2a[_0x5f172b(0x13e)]),_0x425f2a[_0x5f172b(0x133)]&&console['error'](_0x5f172b(0x123)+_0x425f2a[_0x5f172b(0x133)]),0x1;throw _0x425f2a;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x108244(0xe9)]='segment:folder:show';['description']=a25_0x108244(0x158);async['execute'](_0x26f31d){const _0x217de7=a25_0x108244,{options:_0xdfca54,args:_0x55ee8f,tdx:_0x3e1a8a}=_0x26f31d;if(_0x55ee8f[_0x217de7(0xd9)]===0x0)return console[_0x217de7(0x150)](_0x217de7(0xd6)),console[_0x217de7(0x150)](_0x217de7(0x11b)),0x1;try{const {parentId:_0x3929ef,childId:_0x1460eb}=parseSegmentRef(_0x55ee8f[0x0]);_0xdfca54[_0x217de7(0x11c)]&&(console[_0x217de7(0x150)](_0x217de7(0x11e)+_0xdfca54[_0x217de7(0x10b)]),console[_0x217de7(0x150)](_0x217de7(0x169)+_0x3929ef),_0x1460eb&&console['error'](_0x217de7(0xfc)+_0x1460eb));if(!_0x1460eb)return console[_0x217de7(0x150)](_0x217de7(0xeb)),0x1;const _0x46fcaa=await withSpinner(_0x217de7(0xf0)+_0x3929ef+_0x217de7(0x11d),()=>_0x3e1a8a[_0x217de7(0xdf)][_0x217de7(0x140)](_0x3929ef),{'verbose':_0xdfca54[_0x217de7(0x11c)]}),_0x4262ef=_0x46fcaa[_0x217de7(0xe6)];_0xdfca54[_0x217de7(0x11c)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x4262ef);const _0x4cb3c1=await withSpinner(_0x217de7(0x163)+_0x1460eb+_0x217de7(0x11d),()=>_0x3e1a8a[_0x217de7(0xdf)][_0x217de7(0xf5)](_0x4262ef,_0x1460eb),{'verbose':_0xdfca54['verbose']}),_0x48492a=_0x4cb3c1['data'];_0xdfca54['verbose']&&console[_0x217de7(0x150)]('Resolved\x20folder\x20ID:\x20'+_0x48492a);const _0x798ecb=await withSpinner('Fetching\x20folder\x20\x27'+_0x1460eb+_0x217de7(0x11d),()=>_0x3e1a8a[_0x217de7(0xdf)]['getFolder'](_0x48492a),{'verbose':_0xdfca54['verbose']});return await handleSDKOutput([_0x798ecb['data']],_0xdfca54),0x0;}catch(_0x608d4e){if(_0x608d4e instanceof SDKError)return console[_0x217de7(0x150)](_0x217de7(0x113)+_0x608d4e['message']),_0x608d4e[_0x217de7(0x133)]&&console[_0x217de7(0x150)](_0x217de7(0x123)+_0x608d4e['cause']),0x1;throw _0x608d4e;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a25_0x108244(0x146);[a25_0x108244(0x157)]=a25_0x108244(0xd1);async[a25_0x108244(0x126)](_0x556946){const _0x1c982a=a25_0x108244,{options:_0x29cf17,args:_0x10437d,tdx:_0x357611}=_0x556946,_0x417949=_0x10437d[0x0];if(!_0x417949)return console[_0x1c982a(0x150)](_0x1c982a(0x11a)),console[_0x1c982a(0x150)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x1c982a(0x150)](_0x1c982a(0x10c)),console[_0x1c982a(0x150)]('Examples:'),console[_0x1c982a(0x150)](_0x1c982a(0x103)),console[_0x1c982a(0x150)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x31a9f9=_0x29cf17[_0x1c982a(0x15b)],_0x1a0a7d=await resolveSegmentTarget(_0x417949,_0x31a9f9,_0x29cf17[_0x1c982a(0x11c)]);_0x29cf17[_0x1c982a(0x11c)]&&console['error'](_0x1c982a(0x131)+_0x1a0a7d);const _0x2da6e7=await withSpinner(_0x1c982a(0x154)+_0x417949+'\x27...',()=>_0x357611[_0x1c982a(0xdf)][_0x1c982a(0xe1)](_0x1a0a7d),{'verbose':_0x29cf17[_0x1c982a(0x11c)]}),_0x19456b=_0x2da6e7[_0x1c982a(0xe6)];_0x29cf17[_0x1c982a(0x11c)]&&(console['error'](_0x1c982a(0xe7)+_0x19456b[_0x1c982a(0x110)]),console[_0x1c982a(0x150)](_0x1c982a(0xd3)+_0x19456b['parentId']));if(_0x19456b[_0x1c982a(0x110)]===_0x1c982a(0x12d))return console['error']('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console['error'](_0x1c982a(0x12e)),0x1;if(_0x19456b[_0x1c982a(0x110)]==='parent')return console[_0x1c982a(0x150)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x1c982a(0x150)](_0x1c982a(0xdb)),0x1;if(!_0x19456b['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x50ae01=await withSpinner(_0x1c982a(0xf2),()=>_0x357611[_0x1c982a(0xdf)][_0x1c982a(0xf8)](_0x19456b[_0x1c982a(0x130)],_0x19456b[_0x1c982a(0x137)]),{'verbose':_0x29cf17['verbose']}),_0x5908eb=_0x50ae01['data'];return _0x29cf17[_0x1c982a(0xf4)]===_0x1c982a(0x121)||_0x29cf17['format']===_0x1c982a(0xd8)?await handleSDKOutput([{'sql':_0x5908eb}],_0x29cf17):console['log'](_0x5908eb),0x0;}catch(_0xb5937b){if(_0xb5937b instanceof SDKError)return console['error'](_0x1c982a(0x113)+_0xb5937b['message']),_0xb5937b[_0x1c982a(0x133)]&&console['error'](_0x1c982a(0x123)+_0xb5937b['cause']),0x1;throw _0xb5937b;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x108244(0xe9)]=a25_0x108244(0x14a);['description']=a25_0x108244(0xec);async['execute'](_0x210f3f){const _0x433666=a25_0x108244,{options:_0x8a49af,args:_0xd7c446,tdx:_0x4da5d3}=_0x210f3f,_0x178b71=_0x8a49af;if(_0xd7c446[_0x433666(0xd9)]<0x2)return console[_0x433666(0x150)](_0x433666(0x143)),console['error'](_0x433666(0x101)),0x1;const _0x480af1=_0xd7c446[0x0],_0x29c973=_0xd7c446[0x1];_0x178b71[_0x433666(0x11c)]&&(console['error'](_0x433666(0x11e)+_0x178b71[_0x433666(0x10b)]),console[_0x433666(0x150)]('Parent\x20segment:\x20'+_0x480af1),console[_0x433666(0x150)](_0x433666(0xfc)+_0x29c973));let _0x27f459;if(_0x178b71['parentFolder']){const _0x2f5673=_0x178b71['parentFolder'],_0x1ec02a=await withSpinner(_0x433666(0xf0)+_0x480af1+_0x433666(0x11d),()=>_0x4da5d3[_0x433666(0xdf)][_0x433666(0x140)](_0x480af1),{'verbose':_0x178b71[_0x433666(0x11c)]}),_0x1b1827=_0x1ec02a[_0x433666(0xe6)],_0x28831e=await withSpinner(_0x433666(0xd2)+_0x2f5673+_0x433666(0x11d),()=>_0x4da5d3[_0x433666(0xdf)][_0x433666(0xf5)](_0x1b1827,_0x2f5673),{'verbose':_0x178b71[_0x433666(0x11c)]});_0x27f459=_0x28831e[_0x433666(0xe6)],_0x178b71[_0x433666(0x11c)]&&console[_0x433666(0x150)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x27f459);}const _0x4f0b3c={'name':_0x29c973,'description':_0x178b71[_0x433666(0x157)],'parentFolderId':_0x27f459},_0x3333f5=await withSpinner(_0x433666(0x156)+_0x29c973+_0x433666(0x11d),()=>_0x4da5d3[_0x433666(0xdf)][_0x433666(0x142)](_0x480af1,_0x4f0b3c),{'verbose':_0x178b71[_0x433666(0x11c)]}),_0x317fa0=_0x3333f5['data'];return console[_0x433666(0x150)](_0x433666(0x112)+_0x317fa0[_0x433666(0xe9)]+_0x433666(0x10f)+_0x317fa0['id']),await handleSDKOutput([_0x317fa0],_0x178b71),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x108244(0xe9)]=a25_0x108244(0x10d);[a25_0x108244(0x157)]=a25_0x108244(0x108);async[a25_0x108244(0x126)](_0x1be02b){const _0x4abc4e=a25_0x108244,{options:_0x198c96,args:_0x1ddd36,tdx:_0x1ac576}=_0x1be02b,_0x136d77=_0x1ddd36[0x0];if(!_0x136d77)return console[_0x4abc4e(0x150)](_0x4abc4e(0x155)),console['error']('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x4abc4e(0x150)](_0x4abc4e(0xf6)),console['error'](_0x4abc4e(0x139)),console['error'](_0x4abc4e(0xd7)),console[_0x4abc4e(0x150)](_0x4abc4e(0x14b)),console[_0x4abc4e(0x150)](_0x4abc4e(0xe8)),console[_0x4abc4e(0x150)](_0x4abc4e(0x166)),console[_0x4abc4e(0x150)](_0x4abc4e(0xf9)),console[_0x4abc4e(0x150)](_0x4abc4e(0xe4)),0x1;try{const _0x5634f8=_0x198c96['parentSegment'],_0x5afcc6=await resolveSegmentTarget(_0x136d77,_0x5634f8,_0x198c96['verbose']);_0x198c96[_0x4abc4e(0x11c)]&&console[_0x4abc4e(0x150)]('Target\x20path:\x20'+_0x5afcc6);const _0x3b17b2=await withSpinner(_0x4abc4e(0x154)+_0x136d77+_0x4abc4e(0x11d),()=>_0x1ac576[_0x4abc4e(0xdf)][_0x4abc4e(0xe1)](_0x5afcc6),{'verbose':_0x198c96['verbose']}),_0x23adc0=_0x3b17b2[_0x4abc4e(0xe6)];_0x198c96[_0x4abc4e(0x11c)]&&(console[_0x4abc4e(0x150)](_0x4abc4e(0xe7)+_0x23adc0[_0x4abc4e(0x110)]),console[_0x4abc4e(0x150)]('Parent\x20ID:\x20'+_0x23adc0[_0x4abc4e(0x130)]),_0x23adc0['folderId']&&console[_0x4abc4e(0x150)](_0x4abc4e(0xfe)+_0x23adc0[_0x4abc4e(0x117)]),_0x23adc0[_0x4abc4e(0x137)]&&console[_0x4abc4e(0x150)]('Segment\x20ID:\x20'+_0x23adc0['segmentId']));if(_0x198c96[_0x4abc4e(0x162)]){if(_0x23adc0['type']==='folder')return console['error']('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x23adc0[_0x4abc4e(0x110)]===_0x4abc4e(0x114))return console[_0x4abc4e(0x150)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4abc4e(0x150)](_0x4abc4e(0x12b)),0x1;if(!_0x23adc0[_0x4abc4e(0x137)])throw new SDKError(ErrorCode[_0x4abc4e(0x127)],_0x4abc4e(0x14c));const _0xd332a3=getConsoleNextUrl(_0x198c96[_0x4abc4e(0x10b)],_0x4abc4e(0x138)+_0x23adc0['parentId']+_0x4abc4e(0x148)+_0x23adc0[_0x4abc4e(0x137)]);return console[_0x4abc4e(0x150)](a25_0x28a98a[_0x4abc4e(0x168)]('✔')+_0x4abc4e(0xfb)+a25_0x28a98a[_0x4abc4e(0x13c)](_0xd332a3)),openBrowser(_0xd332a3),0x0;}if(_0x23adc0[_0x4abc4e(0x110)]===_0x4abc4e(0x12d)){if(!_0x23adc0[_0x4abc4e(0x117)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x4abc4e(0xf3));const _0xae9226=await withSpinner(_0x4abc4e(0xd0),()=>_0x1ac576[_0x4abc4e(0xdf)][_0x4abc4e(0xed)](_0x23adc0[_0x4abc4e(0x117)]),{'verbose':_0x198c96[_0x4abc4e(0x11c)]});await handleSingleObjectOutput(_0xae9226[_0x4abc4e(0xe6)],_0x198c96);}else{if(_0x23adc0[_0x4abc4e(0x110)]===_0x4abc4e(0xdf)){if(!_0x23adc0[_0x4abc4e(0x137)])throw new SDKError(ErrorCode[_0x4abc4e(0x127)],_0x4abc4e(0x14c));const _0x1f9430=await withSpinner(_0x4abc4e(0x132),()=>_0x1ac576['segment']['getSegment'](_0x23adc0['parentId'],_0x23adc0['segmentId']),{'verbose':_0x198c96['verbose']}),_0x3df509=getConsoleNextUrl(_0x198c96[_0x4abc4e(0x10b)],_0x4abc4e(0x138)+_0x23adc0[_0x4abc4e(0x130)]+_0x4abc4e(0x148)+_0x23adc0['segmentId']),_0x527300=_0x1f9430[_0x4abc4e(0xe6)];_0x527300[_0x4abc4e(0xd5)]=_0x3df509,await handleSingleObjectOutput(_0x527300,_0x198c96);}else return console[_0x4abc4e(0x150)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x4abc4e(0x150)](_0x4abc4e(0x167)),0x1;}return 0x0;}catch(_0x3ca1c5){if(_0x3ca1c5 instanceof SDKError)return console[_0x4abc4e(0x150)](_0x4abc4e(0x113)+_0x3ca1c5['message']),_0x3ca1c5[_0x4abc4e(0x133)]&&console[_0x4abc4e(0x150)]('\x20\x20Cause:\x20'+_0x3ca1c5[_0x4abc4e(0x133)]),0x1;throw _0x3ca1c5;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x108244(0xe9)]=a25_0x108244(0x13d);['description']=a25_0x108244(0x134);async[a25_0x108244(0x126)](_0x58820a){const _0x22fc85=a25_0x108244,{options:_0x155f46,args:_0x445659,tdx:_0x3545a5}=_0x58820a,_0x4ef1ae=_0x445659[0x0];if(!_0x4ef1ae)return console['error'](_0x22fc85(0x11a)),console[_0x22fc85(0x150)](_0x22fc85(0x119)),console['error'](_0x22fc85(0xdd)),console[_0x22fc85(0x150)]('Examples:'),console[_0x22fc85(0x150)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x22fc85(0x150)](_0x22fc85(0x159)),0x1;try{const _0x3d79dc=_0x155f46[_0x22fc85(0x15b)],_0x1c041a=await resolveSegmentTarget(_0x4ef1ae,_0x3d79dc,_0x155f46['verbose']);_0x155f46[_0x22fc85(0x11c)]&&console[_0x22fc85(0x150)]('Target\x20path:\x20'+_0x1c041a);const _0x2bf635=await withSpinner(_0x22fc85(0x154)+_0x4ef1ae+_0x22fc85(0x11d),()=>_0x3545a5[_0x22fc85(0xdf)]['resolvePathToResource'](_0x1c041a),{'verbose':_0x155f46[_0x22fc85(0x11c)]}),_0x4d6e5b=_0x2bf635[_0x22fc85(0xe6)];_0x155f46['verbose']&&(console[_0x22fc85(0x150)](_0x22fc85(0xe7)+_0x4d6e5b[_0x22fc85(0x110)]),console['error'](_0x22fc85(0xd3)+_0x4d6e5b[_0x22fc85(0x130)]));if(_0x4d6e5b[_0x22fc85(0x110)]===_0x22fc85(0x12d))return console[_0x22fc85(0x150)](_0x22fc85(0x116)),console['error'](_0x22fc85(0x12e)),0x1;if(_0x4d6e5b[_0x22fc85(0x110)]===_0x22fc85(0x114))return console[_0x22fc85(0x150)](_0x22fc85(0x14f)),console['error'](_0x22fc85(0x153)),0x1;if(!_0x4d6e5b['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4278c2=await withSpinner(_0x22fc85(0xf2),()=>_0x3545a5[_0x22fc85(0xdf)][_0x22fc85(0xf8)](_0x4d6e5b[_0x22fc85(0x130)],_0x4d6e5b['segmentId']),{'verbose':_0x155f46['verbose']}),_0x538c04=_0x4278c2['data'],_0x11e115=await executeSchemaQuery(_0x538c04,_0x3545a5,_0x155f46);return await handleQueryOutput(_0x11e115,_0x155f46),0x0;}catch(_0x54ed35){if(_0x54ed35 instanceof SDKError)return console[_0x22fc85(0x150)](_0x22fc85(0x113)+_0x54ed35[_0x22fc85(0x13e)]),_0x54ed35[_0x22fc85(0x133)]&&console[_0x22fc85(0x150)](_0x22fc85(0x123)+_0x54ed35[_0x22fc85(0x133)]),0x1;throw _0x54ed35;}}}
1
+ function a25_0x1790(){const _0x6d6738=['\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getSegment','Target\x20path:\x20','\x20\x20Parent\x20segment:\x20','\x20\x20Full\x20path:\x20','parentFolder','getFolder','15teZjRF','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Usage:\x20tdx\x20sg\x20show\x20<name>','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Use:\x20tdx\x20ps\x20show','segment','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','(root)','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20rows\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','limit','stats','site','Folder\x20ID:\x20','\x27...','\x20\x20Cause:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','createFolder','/e/','cyan','3517772Eslxdo','Resolving\x20\x27','\x20\x20Folder\x20path:\x20','Executing\x20segment\x20query...','listFolders','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Folder\x20name:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','parentId','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','segment:show','test','description','in\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','length','Show\x20folder\x20or\x20child\x20segment\x20details','836190meecNo','Examples:','code','2938905IJGVOk','SEGMENT_NOT_FOUND','Parent\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','Parent\x20segment:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20describe\x20<path>','type','Error:\x20','url','Resolving\x20path\x20\x27','getSegmentSQL','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Show\x20child\x20segment\x20schema\x20(column\x20types)','getParent','Fetching\x20segment\x20details...','Options:','Site:\x20','segment:desc','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','16413yLbIyr','verbose','SEGMENT_FOLDER_NOT_FOUND','\x20[Job\x20ID:\x20','segment:describe','Resolved\x20relative\x20path\x20to:\x20','execute','687554BXNSXM','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20Opening\x20','setJobId','Usage:\x20tdx\x20sg\x20desc\x20<name>','✔\x20Query\x20completed:\x20Processed\x20','Create\x20segment\x20folder\x20for\x20organization','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x27\x20with\x20ID:\x20','folder','130077NgSWcT','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','parent','Segment\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','jobId','processedRows','Usage:\x20tdx\x20sg\x20sql\x20<name>','1302672GrwDVh','resolvePathToResource','Fetching\x20parent\x20segment\x20details...','Parent\x20name:\x20','name','parentSegment','Resolving\x20parent\x20segment\x20\x27','segmentName','cause','Resolved\x20type:\x20','Fetching\x20folder\x20details...','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Resolved\x20parent\x20folder\x20ID:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','/app/ps/','Resolved\x20parent\x20ID:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Resolving\x20parent\x20folder\x20\x27','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Creating\x20folder\x20\x27','SQL\x20query:\x0a','resolveParentId','228VZDPAn','trim','segmentId','segment:folder:create','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','replace','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20view','Error:\x20Folder\x20reference\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','folderId','INVALID_ARGUMENT','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','data','format','jsonl','web','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','message','query','✔\x20Found\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','error','Resolved\x20YAML\x20file:\x20','green','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'];a25_0x1790=function(){return _0x6d6738;};return a25_0x1790();}const a25_0x176d6e=a25_0x4728;(function(_0x48f0a2,_0x1dd47b){const _0x5ec1a0=a25_0x4728,_0x3a2bc7=_0x48f0a2();while(!![]){try{const _0x95808e=parseInt(_0x5ec1a0(0x1f4))/0x1+-parseInt(_0x5ec1a0(0x17c))/0x2*(parseInt(_0x5ec1a0(0x1e3))/0x3)+parseInt(_0x5ec1a0(0x1b9))/0x4+parseInt(_0x5ec1a0(0x1a0))/0x5*(parseInt(_0x5ec1a0(0x1cc))/0x6)+-parseInt(_0x5ec1a0(0x1ea))/0x7+parseInt(_0x5ec1a0(0x1fc))/0x8+-parseInt(_0x5ec1a0(0x1cf))/0x9;if(_0x95808e===_0x1dd47b)break;else _0x3a2bc7['push'](_0x3a2bc7['shift']());}catch(_0x329d43){_0x3a2bc7['push'](_0x3a2bc7['shift']());}}}(a25_0x1790,0x84524));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x330314 from'chalk';async function resolveSegmentTarget(_0x2e08d4,_0x57f632,_0x2d26eb){const _0x1d46e4=a25_0x4728;if(isYamlFilePath(_0x2e08d4))try{const _0x26b39a=await resolveYamlFilePath(_0x2e08d4);return _0x2d26eb&&(console[_0x1d46e4(0x195)](_0x1d46e4(0x196)+_0x2e08d4),console[_0x1d46e4(0x195)](_0x1d46e4(0x19c)+_0x26b39a['parentSegment']),console[_0x1d46e4(0x195)]('\x20\x20Segment\x20name:\x20'+_0x26b39a[_0x1d46e4(0x203)]),console['error'](_0x1d46e4(0x1bb)+(_0x26b39a['folderPath']||_0x1d46e4(0x1a7))),console['error'](_0x1d46e4(0x19d)+_0x26b39a['fullPath'])),_0x26b39a['fullPath'];}catch(_0x4e9917){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1d46e4(0x175)+_0x4e9917[_0x1d46e4(0x191)]);}if(!_0x57f632)throw new SDKError(ErrorCode[_0x1d46e4(0x189)],_0x1d46e4(0x1ac));return _0x57f632+'/'+_0x2e08d4;}export class SegmentDescribeCommand extends BaseCommand{['name']=a25_0x176d6e(0x1e7);['description']='Show\x20segment\x20or\x20folder\x20details';async['execute'](_0x103d7a){const _0x4a16c4=a25_0x176d6e,{options:_0x11a815,args:_0x386855,tdx:_0x318c53}=_0x103d7a,_0x40a0ab=_0x386855[0x0],_0x13f9b3=!_0x40a0ab&&!!_0x11a815[_0x4a16c4(0x201)],_0x5ec8c3=_0x40a0ab||_0x11a815[_0x4a16c4(0x201)];if(!_0x5ec8c3)return console[_0x4a16c4(0x195)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x4a16c4(0x195)](_0x4a16c4(0x1d5)),console['error'](_0x4a16c4(0x1cd)),console[_0x4a16c4(0x195)](_0x4a16c4(0x1a6)),console['error'](_0x4a16c4(0x199)),console[_0x4a16c4(0x195)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x4a16c4(0x195)](_0x4a16c4(0x176)),0x1;try{const _0x573191=_0x11a815['segmentPath'];let _0x4f0fef=_0x5ec8c3;!_0x13f9b3&&_0x573191&&!_0x5ec8c3['includes']('/')&&(_0x4f0fef=_0x573191+'/'+_0x5ec8c3,_0x11a815[_0x4a16c4(0x1e4)]&&console[_0x4a16c4(0x195)](_0x4a16c4(0x1e8)+_0x4f0fef));const _0x4a1f78=await withSpinner(_0x4a16c4(0x1d9)+_0x4f0fef+'\x27...',()=>_0x318c53[_0x4a16c4(0x1a5)][_0x4a16c4(0x1fd)](_0x4f0fef),{'verbose':_0x11a815[_0x4a16c4(0x1e4)]}),_0x3a91b9=_0x4a1f78['data'];_0x11a815[_0x4a16c4(0x1e4)]&&(console[_0x4a16c4(0x195)](_0x4a16c4(0x16c)+_0x3a91b9[_0x4a16c4(0x1d6)]),console['error'](_0x4a16c4(0x1d1)+_0x3a91b9[_0x4a16c4(0x1c1)]),_0x3a91b9[_0x4a16c4(0x188)]&&console['error'](_0x4a16c4(0x1b2)+_0x3a91b9[_0x4a16c4(0x188)]),_0x3a91b9['segmentId']&&console[_0x4a16c4(0x195)](_0x4a16c4(0x1f7)+_0x3a91b9[_0x4a16c4(0x17e)]));if(_0x3a91b9['type']==='parent'){const _0x97051a=await withSpinner(_0x4a16c4(0x1fe),()=>_0x318c53['segment'][_0x4a16c4(0x1dd)](_0x3a91b9['parentId']),{'verbose':_0x11a815[_0x4a16c4(0x1e4)]});await handleSingleObjectOutput(_0x97051a[_0x4a16c4(0x18c)],_0x11a815);}else{if(_0x3a91b9[_0x4a16c4(0x1d6)]===_0x4a16c4(0x1f3)){if(!_0x3a91b9[_0x4a16c4(0x188)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x4a16c4(0x1d4));const _0x1268c2=await withSpinner(_0x4a16c4(0x16d),()=>_0x318c53[_0x4a16c4(0x1a5)]['getFolder'](_0x3a91b9[_0x4a16c4(0x188)]),{'verbose':_0x11a815[_0x4a16c4(0x1e4)]});await handleSingleObjectOutput(_0x1268c2[_0x4a16c4(0x18c)],_0x11a815);}else{if(_0x3a91b9[_0x4a16c4(0x1d6)]===_0x4a16c4(0x1a5)){if(!_0x3a91b9['segmentId'])throw new SDKError(ErrorCode[_0x4a16c4(0x1d0)],_0x4a16c4(0x1f1));const _0x2909e9=await withSpinner(_0x4a16c4(0x1de),()=>_0x318c53['segment']['getSegment'](_0x3a91b9[_0x4a16c4(0x1c1)],_0x3a91b9[_0x4a16c4(0x17e)]),{'verbose':_0x11a815['verbose']});await handleSingleObjectOutput(_0x2909e9[_0x4a16c4(0x18c)],_0x11a815);}}}return 0x0;}catch(_0x1f9532){if(_0x1f9532 instanceof SDKError)return console['error']('Error:\x20'+_0x1f9532[_0x4a16c4(0x191)]),_0x1f9532[_0x4a16c4(0x16b)]&&console[_0x4a16c4(0x195)](_0x4a16c4(0x1b4)+_0x1f9532[_0x4a16c4(0x16b)]),0x1;throw _0x1f9532;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x176d6e(0x200)]=a25_0x176d6e(0x1c4);[a25_0x176d6e(0x1c6)]=a25_0x176d6e(0x1a3);async[a25_0x176d6e(0x1e9)](_0x1a42a4){const _0x14263a=a25_0x176d6e,{options:_0xb7bf24,args:_0x5d1d31,tdx:_0x2823b1}=_0x1a42a4,_0x3c510f=_0x5d1d31[0x0];if(!_0x3c510f)return console[_0x14263a(0x195)](_0x14263a(0x16e)),console[_0x14263a(0x195)](_0x14263a(0x1a2)),console[_0x14263a(0x195)](_0x14263a(0x170)),console['error'](_0x14263a(0x1cd)),console[_0x14263a(0x195)](_0x14263a(0x1db)),console[_0x14263a(0x195)](_0x14263a(0x16f)),0x1;try{const _0xa09114=_0xb7bf24[_0x14263a(0x201)],_0x13b26e=await resolveSegmentTarget(_0x3c510f,_0xa09114,_0xb7bf24[_0x14263a(0x1e4)]);_0xb7bf24[_0x14263a(0x1e4)]&&console[_0x14263a(0x195)](_0x14263a(0x19b)+_0x13b26e);const _0x1eae18=await withSpinner(_0x14263a(0x1ba)+_0x3c510f+'\x27...',()=>_0x2823b1['segment'][_0x14263a(0x1fd)](_0x13b26e),{'verbose':_0xb7bf24[_0x14263a(0x1e4)]}),_0x140945=_0x1eae18[_0x14263a(0x18c)];_0xb7bf24[_0x14263a(0x1e4)]&&(console[_0x14263a(0x195)](_0x14263a(0x16c)+_0x140945[_0x14263a(0x1d6)]),console[_0x14263a(0x195)](_0x14263a(0x1d1)+_0x140945[_0x14263a(0x1c1)]));if(_0x140945[_0x14263a(0x1d6)]===_0x14263a(0x1f3))return console[_0x14263a(0x195)](_0x14263a(0x1c3)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x140945[_0x14263a(0x1d6)]===_0x14263a(0x1f6))return console[_0x14263a(0x195)](_0x14263a(0x18a)),console['error'](_0x14263a(0x1a4)),0x1;if(!_0x140945[_0x14263a(0x17e)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x14263a(0x1f1));const _0x43868c=await withSpinner(_0x14263a(0x1d2),()=>_0x2823b1[_0x14263a(0x1a5)][_0x14263a(0x1da)](_0x140945[_0x14263a(0x1c1)],_0x140945[_0x14263a(0x17e)]),{'verbose':_0xb7bf24['verbose']});let _0x374459=_0x43868c[_0x14263a(0x18c)];const _0x1e1687=resolveLimit(_0xb7bf24[_0x14263a(0x1af)],DEFAULT_DISPLAY_LIMIT),_0x3e20db=/\bLIMIT\s+\d+/i[_0x14263a(0x1c5)](_0x374459);!_0x3e20db&&(_0x374459=_0x374459[_0x14263a(0x17d)]()[_0x14263a(0x183)](/;+$/,''),_0x374459=_0x14263a(0x1f8)+_0x374459+_0x14263a(0x181)+_0x1e1687);_0xb7bf24['verbose']&&console[_0x14263a(0x195)](_0x14263a(0x17a)+_0x374459);const _0x16bbe9=await withProgressSpinner(_0x14263a(0x1bc),async _0x341b41=>{const _0x11203f=_0x14263a,_0x3f3ffd=await _0x2823b1[_0x11203f(0x192)][_0x11203f(0x1e9)](_0x374459,{'catalog':'td','schema':'information_schema','onJobId':_0x1cc537=>{const _0x2c7c8b=_0x11203f;_0x341b41[_0x2c7c8b(0x1ed)](_0x1cc537);}});return _0x3f3ffd;},{'verbose':_0xb7bf24[_0x14263a(0x1e4)]}),_0x2ed037=_0x16bbe9[_0x14263a(0x18c)],_0x405bda=_0x2ed037['jobId']?_0x14263a(0x1e6)+_0x2ed037[_0x14263a(0x1f9)]+']':'';return console[_0x14263a(0x195)](_0x14263a(0x1ef)+_0x2ed037[_0x14263a(0x1b0)][_0x14263a(0x1fa)]['toLocaleString']()+_0x14263a(0x1ab)+(_0x14263a(0x1c7)+formatElapsed(_0x2ed037[_0x14263a(0x1b0)]['elapsedTimeMillis'])+_0x405bda)),await handleQueryOutput(_0x2ed037,_0xb7bf24),0x0;}catch(_0x543e0e){if(_0x543e0e instanceof SDKError)return console[_0x14263a(0x195)]('✖\x20Query\x20failed\x20['+_0x543e0e[_0x14263a(0x1ce)]+']'),console['error']('\x0a'+_0x543e0e[_0x14263a(0x191)]),0x1;throw _0x543e0e;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x176d6e(0x200)]='segment:folder:list';['description']=a25_0x176d6e(0x187);async[a25_0x176d6e(0x1e9)](_0x386b5c){const _0x3424d3=a25_0x176d6e,{options:_0x29d27f,args:_0x28af8c,tdx:_0x37d797}=_0x386b5c;if(_0x28af8c[_0x3424d3(0x1ca)]===0x0)return console[_0x3424d3(0x195)](_0x3424d3(0x1c2)),console[_0x3424d3(0x195)](_0x3424d3(0x1a8)),0x1;const _0x35d1d3=_0x28af8c[0x0];try{_0x29d27f['verbose']&&(console[_0x3424d3(0x195)](_0x3424d3(0x1e0)+_0x29d27f[_0x3424d3(0x1b1)]),console[_0x3424d3(0x195)](_0x3424d3(0x1ff)+_0x35d1d3));const _0x5337eb=await withSpinner(_0x3424d3(0x202)+_0x35d1d3+_0x3424d3(0x1b3),()=>_0x37d797[_0x3424d3(0x1a5)][_0x3424d3(0x17b)](_0x35d1d3),{'verbose':_0x29d27f[_0x3424d3(0x1e4)]}),_0x394b06=_0x5337eb[_0x3424d3(0x18c)];_0x29d27f[_0x3424d3(0x1e4)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x394b06);const _0x3a65ab=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x35d1d3+_0x3424d3(0x1b3),()=>_0x37d797[_0x3424d3(0x1a5)][_0x3424d3(0x1bd)](_0x394b06),{'verbose':_0x29d27f['verbose']}),_0x5a0afe=_0x3a65ab[_0x3424d3(0x18c)];return console[_0x3424d3(0x195)](_0x3424d3(0x193)+_0x5a0afe[_0x3424d3(0x1ca)]+'\x20folder'+(_0x5a0afe['length']!==0x1?'s':'')),await handleSDKOutput(_0x5a0afe,_0x29d27f),0x0;}catch(_0x58de12){if(_0x58de12 instanceof SDKError)return console['error'](_0x3424d3(0x1d7)+_0x58de12[_0x3424d3(0x191)]),_0x58de12[_0x3424d3(0x16b)]&&console['error'](_0x3424d3(0x1b4)+_0x58de12['cause']),0x1;throw _0x58de12;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a25_0x176d6e(0x1c6)]='Show\x20segment\x20folder\x20details';async[a25_0x176d6e(0x1e9)](_0x593479){const _0x46930d=a25_0x176d6e,{options:_0x3054ae,args:_0x52f1d7,tdx:_0x2ee5f9}=_0x593479;if(_0x52f1d7[_0x46930d(0x1ca)]===0x0)return console[_0x46930d(0x195)](_0x46930d(0x186)),console[_0x46930d(0x195)](_0x46930d(0x1ae)),0x1;try{const {parentId:_0x5db6a3,childId:_0x4d1716}=parseSegmentRef(_0x52f1d7[0x0]);_0x3054ae['verbose']&&(console[_0x46930d(0x195)](_0x46930d(0x1e0)+_0x3054ae['site']),console[_0x46930d(0x195)]('Parent\x20name:\x20'+_0x5db6a3),_0x4d1716&&console[_0x46930d(0x195)](_0x46930d(0x1bf)+_0x4d1716));if(!_0x4d1716)return console[_0x46930d(0x195)](_0x46930d(0x1be)),0x1;const _0x2263a5=await withSpinner(_0x46930d(0x202)+_0x5db6a3+_0x46930d(0x1b3),()=>_0x2ee5f9['segment'][_0x46930d(0x17b)](_0x5db6a3),{'verbose':_0x3054ae[_0x46930d(0x1e4)]}),_0x5b5e5b=_0x2263a5[_0x46930d(0x18c)];_0x3054ae['verbose']&&console['error'](_0x46930d(0x174)+_0x5b5e5b);const _0x1f038b=await withSpinner('Resolving\x20folder\x20\x27'+_0x4d1716+_0x46930d(0x1b3),()=>_0x2ee5f9[_0x46930d(0x1a5)]['resolveFolderId'](_0x5b5e5b,_0x4d1716),{'verbose':_0x3054ae['verbose']}),_0x13cb5e=_0x1f038b[_0x46930d(0x18c)];_0x3054ae['verbose']&&console[_0x46930d(0x195)]('Resolved\x20folder\x20ID:\x20'+_0x13cb5e);const _0x15e458=await withSpinner('Fetching\x20folder\x20\x27'+_0x4d1716+_0x46930d(0x1b3),()=>_0x2ee5f9[_0x46930d(0x1a5)][_0x46930d(0x19f)](_0x13cb5e),{'verbose':_0x3054ae[_0x46930d(0x1e4)]});return await handleSDKOutput([_0x15e458[_0x46930d(0x18c)]],_0x3054ae),0x0;}catch(_0x3cc2e8){if(_0x3cc2e8 instanceof SDKError)return console[_0x46930d(0x195)](_0x46930d(0x1d7)+_0x3cc2e8[_0x46930d(0x191)]),_0x3cc2e8[_0x46930d(0x16b)]&&console[_0x46930d(0x195)](_0x46930d(0x1b4)+_0x3cc2e8[_0x46930d(0x16b)]),0x1;throw _0x3cc2e8;}}}export class SegmentSQLCommand extends BaseCommand{['name']='segment:sql';[a25_0x176d6e(0x1c6)]=a25_0x176d6e(0x1c0);async[a25_0x176d6e(0x1e9)](_0x2a6aa6){const _0x1fa6f3=a25_0x176d6e,{options:_0x4f2e00,args:_0x48a1fa,tdx:_0x4165bd}=_0x2a6aa6,_0x5f629f=_0x48a1fa[0x0];if(!_0x5f629f)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1fa6f3(0x195)](_0x1fa6f3(0x1fb)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x1fa6f3(0x195)](_0x1fa6f3(0x1cd)),console['error'](_0x1fa6f3(0x1c8)),console[_0x1fa6f3(0x195)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x244785=_0x4f2e00[_0x1fa6f3(0x201)],_0x451e8b=await resolveSegmentTarget(_0x5f629f,_0x244785,_0x4f2e00[_0x1fa6f3(0x1e4)]);_0x4f2e00[_0x1fa6f3(0x1e4)]&&console['error'](_0x1fa6f3(0x19b)+_0x451e8b);const _0x1f8229=await withSpinner(_0x1fa6f3(0x1ba)+_0x5f629f+'\x27...',()=>_0x4165bd[_0x1fa6f3(0x1a5)][_0x1fa6f3(0x1fd)](_0x451e8b),{'verbose':_0x4f2e00['verbose']}),_0x520113=_0x1f8229[_0x1fa6f3(0x18c)];_0x4f2e00[_0x1fa6f3(0x1e4)]&&(console['error'](_0x1fa6f3(0x16c)+_0x520113[_0x1fa6f3(0x1d6)]),console[_0x1fa6f3(0x195)](_0x1fa6f3(0x1d1)+_0x520113[_0x1fa6f3(0x1c1)]));if(_0x520113[_0x1fa6f3(0x1d6)]===_0x1fa6f3(0x1f3))return console[_0x1fa6f3(0x195)](_0x1fa6f3(0x1e2)),console[_0x1fa6f3(0x195)](_0x1fa6f3(0x1c9)),0x1;if(_0x520113[_0x1fa6f3(0x1d6)]===_0x1fa6f3(0x1f6))return console['error'](_0x1fa6f3(0x1ad)),console[_0x1fa6f3(0x195)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x520113[_0x1fa6f3(0x17e)])throw new SDKError(ErrorCode[_0x1fa6f3(0x1d0)],_0x1fa6f3(0x1f1));const _0x47c3d0=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x4165bd[_0x1fa6f3(0x1a5)][_0x1fa6f3(0x1da)](_0x520113[_0x1fa6f3(0x1c1)],_0x520113['segmentId']),{'verbose':_0x4f2e00[_0x1fa6f3(0x1e4)]}),_0x568a81=_0x47c3d0[_0x1fa6f3(0x18c)];return _0x4f2e00['format']==='json'||_0x4f2e00[_0x1fa6f3(0x18d)]===_0x1fa6f3(0x18e)?await handleSDKOutput([{'sql':_0x568a81}],_0x4f2e00):console['log'](_0x568a81),0x0;}catch(_0x34aa3f){if(_0x34aa3f instanceof SDKError)return console[_0x1fa6f3(0x195)]('Error:\x20'+_0x34aa3f[_0x1fa6f3(0x191)]),_0x34aa3f[_0x1fa6f3(0x16b)]&&console['error']('\x20\x20Cause:\x20'+_0x34aa3f[_0x1fa6f3(0x16b)]),0x1;throw _0x34aa3f;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x176d6e(0x200)]=a25_0x176d6e(0x17f);[a25_0x176d6e(0x1c6)]=a25_0x176d6e(0x1f0);async[a25_0x176d6e(0x1e9)](_0x5d4fdb){const _0x348858=a25_0x176d6e,{options:_0x4db46c,args:_0xb0aa65,tdx:_0x891440}=_0x5d4fdb,_0x276598=_0x4db46c;if(_0xb0aa65['length']<0x2)return console[_0x348858(0x195)](_0x348858(0x182)),console[_0x348858(0x195)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3c8a95=_0xb0aa65[0x0],_0x20232d=_0xb0aa65[0x1];_0x276598[_0x348858(0x1e4)]&&(console[_0x348858(0x195)](_0x348858(0x1e0)+_0x276598[_0x348858(0x1b1)]),console[_0x348858(0x195)](_0x348858(0x1d3)+_0x3c8a95),console[_0x348858(0x195)](_0x348858(0x1bf)+_0x20232d));let _0x5098ff;if(_0x276598['parentFolder']){const _0x31fd0b=_0x276598[_0x348858(0x19e)],_0x12a8bd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3c8a95+'\x27...',()=>_0x891440['segment'][_0x348858(0x17b)](_0x3c8a95),{'verbose':_0x276598[_0x348858(0x1e4)]}),_0x23cd53=_0x12a8bd[_0x348858(0x18c)],_0x9a3261=await withSpinner(_0x348858(0x177)+_0x31fd0b+_0x348858(0x1b3),()=>_0x891440[_0x348858(0x1a5)]['resolveFolderId'](_0x23cd53,_0x31fd0b),{'verbose':_0x276598[_0x348858(0x1e4)]});_0x5098ff=_0x9a3261['data'],_0x276598[_0x348858(0x1e4)]&&console[_0x348858(0x195)](_0x348858(0x171)+_0x5098ff);}const _0x530f82={'name':_0x20232d,'description':_0x276598[_0x348858(0x1c6)],'parentFolderId':_0x5098ff},_0x5d7583=await withSpinner(_0x348858(0x179)+_0x20232d+'\x27...',()=>_0x891440['segment'][_0x348858(0x1b6)](_0x3c8a95,_0x530f82),{'verbose':_0x276598[_0x348858(0x1e4)]}),_0x9076fd=_0x5d7583[_0x348858(0x18c)];return console[_0x348858(0x195)]('✔\x20Created\x20folder\x20\x27'+_0x9076fd[_0x348858(0x200)]+_0x348858(0x1f2)+_0x9076fd['id']),await handleSDKOutput([_0x9076fd],_0x276598),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x176d6e(0x200)]='segment:view';[a25_0x176d6e(0x1c6)]=a25_0x176d6e(0x1cb);async[a25_0x176d6e(0x1e9)](_0x2c6f9c){const _0x493180=a25_0x176d6e,{options:_0x577a0c,args:_0x5e738e,tdx:_0x131768}=_0x2c6f9c,_0x964f0b=_0x5e738e[0x0];if(!_0x964f0b)return console['error'](_0x493180(0x1f5)),console[_0x493180(0x195)](_0x493180(0x190)),console[_0x493180(0x195)](_0x493180(0x180)),console[_0x493180(0x195)](_0x493180(0x1df)),console[_0x493180(0x195)](_0x493180(0x1a1)),console[_0x493180(0x195)](_0x493180(0x1cd)),console[_0x493180(0x195)](_0x493180(0x1b5)),console[_0x493180(0x195)](_0x493180(0x1eb)),console['error'](_0x493180(0x1aa)),console[_0x493180(0x195)](_0x493180(0x194)),0x1;try{const _0x572d2b=_0x577a0c['parentSegment'],_0xe096ba=await resolveSegmentTarget(_0x964f0b,_0x572d2b,_0x577a0c[_0x493180(0x1e4)]);_0x577a0c[_0x493180(0x1e4)]&&console[_0x493180(0x195)]('Target\x20path:\x20'+_0xe096ba);const _0x1d9982=await withSpinner('Resolving\x20\x27'+_0x964f0b+_0x493180(0x1b3),()=>_0x131768[_0x493180(0x1a5)][_0x493180(0x1fd)](_0xe096ba),{'verbose':_0x577a0c[_0x493180(0x1e4)]}),_0x710dd6=_0x1d9982[_0x493180(0x18c)];_0x577a0c['verbose']&&(console[_0x493180(0x195)](_0x493180(0x16c)+_0x710dd6[_0x493180(0x1d6)]),console[_0x493180(0x195)](_0x493180(0x1d1)+_0x710dd6[_0x493180(0x1c1)]),_0x710dd6[_0x493180(0x188)]&&console['error'](_0x493180(0x1b2)+_0x710dd6[_0x493180(0x188)]),_0x710dd6[_0x493180(0x17e)]&&console[_0x493180(0x195)](_0x493180(0x1f7)+_0x710dd6[_0x493180(0x17e)]));if(_0x577a0c[_0x493180(0x18f)]){if(_0x710dd6[_0x493180(0x1d6)]===_0x493180(0x1f3))return console[_0x493180(0x195)](_0x493180(0x198)),0x1;if(_0x710dd6[_0x493180(0x1d6)]===_0x493180(0x1f6))return console[_0x493180(0x195)](_0x493180(0x184)),console[_0x493180(0x195)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x710dd6[_0x493180(0x17e)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4d0fdc=getConsoleNextUrl(_0x577a0c[_0x493180(0x1b1)],'/app/ps/'+_0x710dd6[_0x493180(0x1c1)]+_0x493180(0x1b7)+_0x710dd6['segmentId']);return console['error'](a25_0x330314[_0x493180(0x197)]('✔')+_0x493180(0x1ec)+a25_0x330314[_0x493180(0x1b8)](_0x4d0fdc)),openBrowser(_0x4d0fdc),0x0;}if(_0x710dd6['type']===_0x493180(0x1f3)){if(!_0x710dd6['folderId'])throw new SDKError(ErrorCode[_0x493180(0x1e5)],_0x493180(0x1d4));const _0x2fcdb0=await withSpinner(_0x493180(0x16d),()=>_0x131768['segment'][_0x493180(0x19f)](_0x710dd6['folderId']),{'verbose':_0x577a0c[_0x493180(0x1e4)]});await handleSingleObjectOutput(_0x2fcdb0['data'],_0x577a0c);}else{if(_0x710dd6[_0x493180(0x1d6)]==='segment'){if(!_0x710dd6[_0x493180(0x17e)])throw new SDKError(ErrorCode[_0x493180(0x1d0)],_0x493180(0x1f1));const _0x4042c3=await withSpinner(_0x493180(0x1de),()=>_0x131768[_0x493180(0x1a5)][_0x493180(0x19a)](_0x710dd6[_0x493180(0x1c1)],_0x710dd6[_0x493180(0x17e)]),{'verbose':_0x577a0c['verbose']}),_0x48a8f4=getConsoleNextUrl(_0x577a0c['site'],_0x493180(0x173)+_0x710dd6['parentId']+_0x493180(0x1b7)+_0x710dd6[_0x493180(0x17e)]),_0x3e5c36=_0x4042c3[_0x493180(0x18c)];_0x3e5c36[_0x493180(0x1d8)]=_0x48a8f4,await handleSingleObjectOutput(_0x3e5c36,_0x577a0c);}else return console[_0x493180(0x195)](_0x493180(0x172)),console[_0x493180(0x195)](_0x493180(0x185)),0x1;}return 0x0;}catch(_0x31b3c1){if(_0x31b3c1 instanceof SDKError)return console[_0x493180(0x195)](_0x493180(0x1d7)+_0x31b3c1[_0x493180(0x191)]),_0x31b3c1['cause']&&console[_0x493180(0x195)](_0x493180(0x1b4)+_0x31b3c1[_0x493180(0x16b)]),0x1;throw _0x31b3c1;}}}export const SegmentInfoCommand=SegmentViewCommand;function a25_0x4728(_0x474a5d,_0xf63686){_0x474a5d=_0x474a5d-0x16b;const _0x1790e9=a25_0x1790();let _0x472895=_0x1790e9[_0x474a5d];return _0x472895;}export class SegmentDescCommand extends BaseCommand{[a25_0x176d6e(0x200)]=a25_0x176d6e(0x1e1);['description']=a25_0x176d6e(0x1dc);async['execute'](_0x474843){const _0x2929d9=a25_0x176d6e,{options:_0x33597a,args:_0x7b04b0,tdx:_0x2a164b}=_0x474843,_0x503bcb=_0x7b04b0[0x0];if(!_0x503bcb)return console[_0x2929d9(0x195)](_0x2929d9(0x16e)),console[_0x2929d9(0x195)](_0x2929d9(0x1ee)),console[_0x2929d9(0x195)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x2929d9(0x195)]('Examples:'),console[_0x2929d9(0x195)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x2929d9(0x195)](_0x2929d9(0x178)),0x1;try{const _0x22e33d=_0x33597a[_0x2929d9(0x201)],_0x380b76=await resolveSegmentTarget(_0x503bcb,_0x22e33d,_0x33597a[_0x2929d9(0x1e4)]);_0x33597a[_0x2929d9(0x1e4)]&&console[_0x2929d9(0x195)]('Target\x20path:\x20'+_0x380b76);const _0x274123=await withSpinner(_0x2929d9(0x1ba)+_0x503bcb+_0x2929d9(0x1b3),()=>_0x2a164b['segment'][_0x2929d9(0x1fd)](_0x380b76),{'verbose':_0x33597a[_0x2929d9(0x1e4)]}),_0x2bd992=_0x274123[_0x2929d9(0x18c)];_0x33597a[_0x2929d9(0x1e4)]&&(console[_0x2929d9(0x195)](_0x2929d9(0x16c)+_0x2bd992[_0x2929d9(0x1d6)]),console['error'](_0x2929d9(0x1d1)+_0x2bd992[_0x2929d9(0x1c1)]));if(_0x2bd992['type']===_0x2929d9(0x1f3))return console[_0x2929d9(0x195)](_0x2929d9(0x1a9)),console[_0x2929d9(0x195)](_0x2929d9(0x1c9)),0x1;if(_0x2bd992['type']===_0x2929d9(0x1f6))return console[_0x2929d9(0x195)](_0x2929d9(0x18b)),console[_0x2929d9(0x195)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x2bd992['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2929d9(0x1f1));const _0x2cfb7c=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2a164b['segment'][_0x2929d9(0x1da)](_0x2bd992[_0x2929d9(0x1c1)],_0x2bd992[_0x2929d9(0x17e)]),{'verbose':_0x33597a[_0x2929d9(0x1e4)]}),_0x43cf40=_0x2cfb7c[_0x2929d9(0x18c)],_0x32ae1d=await executeSchemaQuery(_0x43cf40,_0x2a164b,_0x33597a);return await handleQueryOutput(_0x32ae1d,_0x33597a),0x0;}catch(_0x2e369){if(_0x2e369 instanceof SDKError)return console[_0x2929d9(0x195)](_0x2929d9(0x1d7)+_0x2e369[_0x2929d9(0x191)]),_0x2e369[_0x2929d9(0x16b)]&&console['error']('\x20\x20Cause:\x20'+_0x2e369[_0x2929d9(0x16b)]),0x1;throw _0x2e369;}}}
@@ -1 +1 @@
1
- const a26_0x503f39=a26_0x4d9e;(function(_0x5b22f9,_0x33bc5e){const _0x5798c9=a26_0x4d9e,_0x5b42c1=_0x5b22f9();while(!![]){try{const _0x42f720=parseInt(_0x5798c9(0x98))/0x1+parseInt(_0x5798c9(0x95))/0x2*(-parseInt(_0x5798c9(0xa2))/0x3)+parseInt(_0x5798c9(0x74))/0x4*(parseInt(_0x5798c9(0x75))/0x5)+-parseInt(_0x5798c9(0x8c))/0x6+parseInt(_0x5798c9(0x8f))/0x7*(parseInt(_0x5798c9(0xa1))/0x8)+-parseInt(_0x5798c9(0x82))/0x9+-parseInt(_0x5798c9(0x79))/0xa*(-parseInt(_0x5798c9(0x84))/0xb);if(_0x42f720===_0x33bc5e)break;else _0x5b42c1['push'](_0x5b42c1['shift']());}catch(_0x33670d){_0x5b42c1['push'](_0x5b42c1['shift']());}}}(a26_0x507a,0x875ce));function a26_0x507a(){const _0x6d94f3=['32ROXzvk','111ECzKBP','verbose','invisible','segments','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x27...','159924vjKwGz','35OdVvhC','data','Create\x20child\x20segment\x20with\x20filtering\x20rules','description','10zYrkkV','length','Resolving\x20folder\x20path\x20\x27','ruleFile','execute','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment','error','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','3741129SwUDGo','Site:\x20','2177417yaKALP','segment:create','site','\x20\x20\x20Path:\x20','folder','Resolving\x20parent\x20segment\x20\x27','yellow','includes','2609172xKbFoh','Parent\x20path:\x20','Resolving\x20folder\x20\x27','6706IzFZEV','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','resolveFolderId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','kind','parent','7208nvFnWa','type','Segment\x20name:\x20','1056691fcCRkM','createSegment','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','rule','noCountPopulation','\x27\x20with\x20ID:\x20','✔\x20Created\x20segment\x20\x27','folderId'];a26_0x507a=function(){return _0x6d94f3;};return a26_0x507a();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x4d9e(_0x3099f5,_0x288a45){_0x3099f5=_0x3099f5-0x72;const _0x507a54=a26_0x507a();let _0x4d9e1e=_0x507a54[_0x3099f5];return _0x4d9e1e;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x561d2d from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a26_0x503f39(0x85);['description']=a26_0x503f39(0x77);async[a26_0x503f39(0x7d)](_0x4ec35c){const _0x425354=a26_0x503f39;console[_0x425354(0x80)](a26_0x561d2d[_0x425354(0x8a)](_0x425354(0x72))),console['error'](a26_0x561d2d[_0x425354(0x8a)](_0x425354(0x92)));const {options:_0x2fe7ec,args:_0x4c4983,tdx:_0x3ac729}=_0x4ec35c,_0x4f66a6=_0x2fe7ec;if(_0x4c4983[_0x425354(0x7a)]===0x0)return console[_0x425354(0x80)](_0x425354(0x7e)),console[_0x425354(0x80)](_0x425354(0x9b)),console['error']('Examples:'),console[_0x425354(0x80)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x425354(0x80)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x3d34b3=_0x4c4983[0x0],_0x5ad497=_0x2fe7ec['segmentPath'];let _0x380831=_0x3d34b3;_0x5ad497&&!_0x3d34b3[_0x425354(0x8b)]('/')&&(_0x380831=_0x5ad497+'/'+_0x3d34b3,_0x4f66a6[_0x425354(0xa3)]&&console[_0x425354(0x80)]('Resolved\x20relative\x20path\x20to:\x20'+_0x380831));const _0x2a0b25=parsePath(_0x380831);if(_0x2a0b25[_0x425354(0xa5)][_0x425354(0x7a)]<0x2)return console['error'](_0x425354(0x90)),console[_0x425354(0x80)](_0x425354(0x81)),0x1;const _0x5d07b8=_0x2a0b25[_0x425354(0xa5)][0x0],_0x50bdd5=getBaseName(_0x380831),_0x5e0167=getParentPath(_0x380831);_0x4f66a6['verbose']&&(console[_0x425354(0x80)](_0x425354(0x83)+_0x4f66a6[_0x425354(0x86)]),console[_0x425354(0x80)]('Target\x20path:\x20'+_0x380831),console[_0x425354(0x80)]('Parent:\x20'+_0x5d07b8),console[_0x425354(0x80)](_0x425354(0x97)+_0x50bdd5),console[_0x425354(0x80)](_0x425354(0x8d)+_0x5e0167));const _0x70fe04=await withSpinner(_0x425354(0x89)+_0x5d07b8+_0x425354(0x73),()=>_0x3ac729['segment']['resolveParentId'](_0x5d07b8),{'verbose':_0x4f66a6[_0x425354(0xa3)]}),_0x50ef57=_0x70fe04[_0x425354(0x76)];let _0xd80cc9;if(_0x2a0b25[_0x425354(0xa5)][_0x425354(0x7a)]>0x2){const _0x52abae=await withSpinner(_0x425354(0x7b)+_0x5e0167+_0x425354(0x73),()=>_0x3ac729['segment']['resolvePathToResource'](_0x5e0167),{'verbose':_0x4f66a6[_0x425354(0xa3)]}),_0x208d3e=_0x52abae[_0x425354(0x76)];if(_0x208d3e[_0x425354(0x96)]!==_0x425354(0x88)&&_0x208d3e[_0x425354(0x96)]!==_0x425354(0x94))return console[_0x425354(0x80)](_0x425354(0x9a)),0x1;_0xd80cc9=_0x208d3e[_0x425354(0xa0)];}else{if(_0x4f66a6[_0x425354(0x88)]){const _0x5abba6=await withSpinner(_0x425354(0x8e)+_0x4f66a6[_0x425354(0x88)]+_0x425354(0x73),()=>_0x3ac729[_0x425354(0x7f)][_0x425354(0x91)](_0x50ef57,_0x4f66a6[_0x425354(0x88)]),{'verbose':_0x4f66a6['verbose']});_0xd80cc9=_0x5abba6[_0x425354(0x76)];}}_0x4f66a6['verbose']&&_0xd80cc9&&console['error']('Resolved\x20folder\x20ID:\x20'+_0xd80cc9);const _0x170f2f=await loadJSONFromOptions(_0x4f66a6[_0x425354(0x9c)],_0x4f66a6[_0x425354(0x7c)]),_0x47f785={'name':_0x50bdd5,'description':_0x4f66a6[_0x425354(0x78)],'rule':_0x170f2f,'kind':_0x4f66a6[_0x425354(0x93)]!==undefined?parseInt(_0x4f66a6[_0x425354(0x93)],0xa):undefined,'isVisible':_0x4f66a6[_0x425354(0xa4)]?![]:undefined,'segmentFolderId':_0xd80cc9,'countPopulation':_0x4f66a6[_0x425354(0x9d)]?![]:undefined},_0x2d3d77=await withSpinner('Creating\x20segment\x20\x27'+_0x50bdd5+_0x425354(0x73),()=>_0x3ac729[_0x425354(0x7f)][_0x425354(0x99)](_0x50ef57,_0x47f785),{'verbose':_0x4f66a6[_0x425354(0xa3)]}),_0x34a89c=_0x2d3d77[_0x425354(0x76)];return console[_0x425354(0x80)](_0x425354(0x9f)+_0x34a89c['name']+_0x425354(0x9e)+_0x34a89c['id']),_0x380831!==_0x3d34b3&&console['error'](_0x425354(0x87)+_0x380831),await handleSDKOutput([_0x34a89c],_0x4f66a6),0x0;}}
1
+ const a26_0x36f60d=a26_0x5583;(function(_0x2ed507,_0xded58a){const _0x23c9ca=a26_0x5583,_0x1d1f7e=_0x2ed507();while(!![]){try{const _0x2bdfd4=parseInt(_0x23c9ca(0xb9))/0x1+parseInt(_0x23c9ca(0xdd))/0x2+parseInt(_0x23c9ca(0xe7))/0x3+parseInt(_0x23c9ca(0xbd))/0x4+parseInt(_0x23c9ca(0xe5))/0x5*(-parseInt(_0x23c9ca(0xca))/0x6)+parseInt(_0x23c9ca(0xea))/0x7+-parseInt(_0x23c9ca(0xd6))/0x8;if(_0x2bdfd4===_0xded58a)break;else _0x1d1f7e['push'](_0x1d1f7e['shift']());}catch(_0x2ed0c7){_0x1d1f7e['push'](_0x1d1f7e['shift']());}}}(a26_0x14c2,0x5223e));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x4b7544 from'chalk';function a26_0x5583(_0xd8a7e8,_0x5bf944){_0xd8a7e8=_0xd8a7e8-0xb7;const _0x14c2f=a26_0x14c2();let _0x5583a7=_0x14c2f[_0xd8a7e8];return _0x5583a7;}function a26_0x14c2(){const _0x2d55ce=['12840vRXsqQ','Create\x20child\x20segment\x20with\x20filtering\x20rules','resolveParentId','\x20\x20\x20Path:\x20','Resolved\x20relative\x20path\x20to:\x20','segment','resolvePathToResource','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segmentPath','parent','Examples:','\x27\x20with\x20ID:\x20','5563920SejnKC','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','✔\x20Created\x20segment\x20\x27','site','folder','segments','99208ilQmaO','name','resolveFolderId','ruleFile','Resolving\x20folder\x20\x27','yellow','verbose','data','1525sMVpKP','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','1923111lAaSLI','Resolving\x20parent\x20segment\x20\x27','Resolving\x20folder\x20path\x20\x27','2762620pQHAUm','Parent:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','execute','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','folderId','Resolved\x20folder\x20ID:\x20','Parent\x20path:\x20','Target\x20path:\x20','508627debXmD','Segment\x20name:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','\x27...','362832nySDOz','length','Site:\x20','createSegment','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','includes','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','error','kind','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Creating\x20segment\x20\x27','description','type'];a26_0x14c2=function(){return _0x2d55ce;};return a26_0x14c2();}export class SegmentCreateCommand extends BaseCommand{[a26_0x36f60d(0xde)]='segment:create';[a26_0x36f60d(0xc8)]=a26_0x36f60d(0xcb);async[a26_0x36f60d(0xed)](_0x51ebcf){const _0x3bd816=a26_0x36f60d;console['error'](a26_0x4b7544[_0x3bd816(0xe2)](_0x3bd816(0xee))),console['error'](a26_0x4b7544['yellow'](_0x3bd816(0xc6)));const {options:_0x501772,args:_0x592e4c,tdx:_0x2f9b41}=_0x51ebcf,_0xe75315=_0x501772;if(_0x592e4c['length']===0x0)return console[_0x3bd816(0xc4)](_0x3bd816(0xd8)),console['error'](_0x3bd816(0xbb)),console[_0x3bd816(0xc4)](_0x3bd816(0xd4)),console['error'](_0x3bd816(0xd7)),console[_0x3bd816(0xc4)](_0x3bd816(0xec)),console[_0x3bd816(0xc4)](_0x3bd816(0xe6)),0x1;const _0x57c4dc=_0x592e4c[0x0],_0x35385a=_0x501772[_0x3bd816(0xd2)];let _0x33427b=_0x57c4dc;_0x35385a&&!_0x57c4dc[_0x3bd816(0xc2)]('/')&&(_0x33427b=_0x35385a+'/'+_0x57c4dc,_0xe75315[_0x3bd816(0xe3)]&&console['error'](_0x3bd816(0xce)+_0x33427b));const _0x435518=parsePath(_0x33427b);if(_0x435518[_0x3bd816(0xdc)][_0x3bd816(0xbe)]<0x2)return console['error'](_0x3bd816(0xd1)),console[_0x3bd816(0xc4)](_0x3bd816(0xc3)),0x1;const _0x1dc1f2=_0x435518[_0x3bd816(0xdc)][0x0],_0xb7539d=getBaseName(_0x33427b),_0x4a387d=getParentPath(_0x33427b);_0xe75315[_0x3bd816(0xe3)]&&(console[_0x3bd816(0xc4)](_0x3bd816(0xbf)+_0xe75315[_0x3bd816(0xda)]),console['error'](_0x3bd816(0xb8)+_0x33427b),console[_0x3bd816(0xc4)](_0x3bd816(0xeb)+_0x1dc1f2),console['error'](_0x3bd816(0xba)+_0xb7539d),console[_0x3bd816(0xc4)](_0x3bd816(0xb7)+_0x4a387d));const _0x16284e=await withSpinner(_0x3bd816(0xe8)+_0x1dc1f2+'\x27...',()=>_0x2f9b41['segment'][_0x3bd816(0xcc)](_0x1dc1f2),{'verbose':_0xe75315['verbose']}),_0x5c7443=_0x16284e['data'];let _0x2316b8;if(_0x435518[_0x3bd816(0xdc)]['length']>0x2){const _0x267250=await withSpinner(_0x3bd816(0xe9)+_0x4a387d+'\x27...',()=>_0x2f9b41[_0x3bd816(0xcf)][_0x3bd816(0xd0)](_0x4a387d),{'verbose':_0xe75315[_0x3bd816(0xe3)]}),_0x1acceb=_0x267250[_0x3bd816(0xe4)];if(_0x1acceb[_0x3bd816(0xc9)]!==_0x3bd816(0xdb)&&_0x1acceb[_0x3bd816(0xc9)]!==_0x3bd816(0xd3))return console[_0x3bd816(0xc4)](_0x3bd816(0xc1)),0x1;_0x2316b8=_0x1acceb[_0x3bd816(0xef)];}else{if(_0xe75315[_0x3bd816(0xdb)]){const _0x5554dd=await withSpinner(_0x3bd816(0xe1)+_0xe75315[_0x3bd816(0xdb)]+'\x27...',()=>_0x2f9b41['segment'][_0x3bd816(0xdf)](_0x5c7443,_0xe75315[_0x3bd816(0xdb)]),{'verbose':_0xe75315[_0x3bd816(0xe3)]});_0x2316b8=_0x5554dd['data'];}}_0xe75315[_0x3bd816(0xe3)]&&_0x2316b8&&console[_0x3bd816(0xc4)](_0x3bd816(0xf0)+_0x2316b8);const _0xd479b1=await loadJSONFromOptions(_0xe75315['rule'],_0xe75315[_0x3bd816(0xe0)]),_0x1673d0={'name':_0xb7539d,'description':_0xe75315[_0x3bd816(0xc8)],'rule':_0xd479b1,'kind':_0xe75315[_0x3bd816(0xc5)]!==undefined?parseInt(_0xe75315[_0x3bd816(0xc5)],0xa):undefined,'isVisible':_0xe75315['invisible']?![]:undefined,'segmentFolderId':_0x2316b8,'countPopulation':_0xe75315['noCountPopulation']?![]:undefined},_0x79b6bb=await withSpinner(_0x3bd816(0xc7)+_0xb7539d+_0x3bd816(0xbc),()=>_0x2f9b41[_0x3bd816(0xcf)][_0x3bd816(0xc0)](_0x5c7443,_0x1673d0),{'verbose':_0xe75315[_0x3bd816(0xe3)]}),_0x5331c8=_0x79b6bb['data'];return console['error'](_0x3bd816(0xd9)+_0x5331c8[_0x3bd816(0xde)]+_0x3bd816(0xd5)+_0x5331c8['id']),_0x33427b!==_0x57c4dc&&console[_0x3bd816(0xc4)](_0x3bd816(0xcd)+_0x33427b),await handleSDKOutput([_0x5331c8],_0xe75315),0x0;}}
@@ -1 +1 @@
1
- function a27_0x5122(){const _0x43acc0=['segment:fields','verbose','listFields','\x27...','1192264fLuGBq','length','Parent\x20segment:\x20','✔\x20Found\x20','jsonl','3102556FgpfKJ','data','6507020OelqZX','2272eLKBht','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','site','name','18LXYFAJ','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20field','4254774bwVYIH','3bDaqjV','5NBRWBs','execute','List\x20available\x20fields\x20for\x20segmentation','error','18158WDOBDo','32306791nnTHbR','307714qbkste'];a27_0x5122=function(){return _0x43acc0;};return a27_0x5122();}const a27_0x363a3b=a27_0x2d41;(function(_0x20775f,_0x2fa89d){const _0x21661f=a27_0x2d41,_0x57e13b=_0x20775f();while(!![]){try{const _0x579d04=parseInt(_0x21661f(0x199))/0x1+-parseInt(_0x21661f(0x19e))/0x2*(parseInt(_0x21661f(0x1af))/0x3)+parseInt(_0x21661f(0x1a3))/0x4*(parseInt(_0x21661f(0x1b0))/0x5)+-parseInt(_0x21661f(0x1ae))/0x6+parseInt(_0x21661f(0x197))/0x7*(-parseInt(_0x21661f(0x1a6))/0x8)+parseInt(_0x21661f(0x1ab))/0x9*(-parseInt(_0x21661f(0x1a5))/0xa)+parseInt(_0x21661f(0x198))/0xb;if(_0x579d04===_0x2fa89d)break;else _0x57e13b['push'](_0x57e13b['shift']());}catch(_0x1b7d9b){_0x57e13b['push'](_0x57e13b['shift']());}}}(a27_0x5122,0xa546d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a27_0x2d41(_0x24236c,_0x3c28ea){_0x24236c=_0x24236c-0x197;const _0x51227b=a27_0x5122();let _0x2d41f5=_0x51227b[_0x24236c];return _0x2d41f5;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x363a3b(0x1aa)]=a27_0x363a3b(0x19a);['description']=a27_0x363a3b(0x1b2);async[a27_0x363a3b(0x1b1)](_0x16c7c6){const _0x39d1ef=a27_0x363a3b,{options:_0x16c315,args:_0x4b04ab,tdx:_0xc8efbc}=_0x16c7c6,_0x466bfd=_0x4b04ab[0x0]||_0x16c315['parentSegment'];if(!_0x466bfd)return console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1ac)),console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1a7)),console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1a8)),0x1;_0x16c315[_0x39d1ef(0x19b)]&&(console[_0x39d1ef(0x1b3)]('Site:\x20'+_0x16c315[_0x39d1ef(0x1a9)]),console['error'](_0x39d1ef(0x1a0)+_0x466bfd));const _0xc9f7d1=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x466bfd+_0x39d1ef(0x19d),()=>_0xc8efbc['segment'][_0x39d1ef(0x19c)](_0x466bfd),{'verbose':_0x16c315[_0x39d1ef(0x19b)]}),_0x46648f=_0xc9f7d1[_0x39d1ef(0x1a4)];console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1a1)+_0x46648f[_0x39d1ef(0x19f)]+_0x39d1ef(0x1ad)+(_0x46648f['length']!==0x1?'s':''));if(_0x16c315['json']||_0x16c315[_0x39d1ef(0x1a2)])return await handleSDKOutput(_0x46648f,_0x16c315),0x0;return displayFieldsHumanReadable(_0x46648f,_0x466bfd),0x0;}}
1
+ const a27_0x16ca38=a27_0x2cc6;(function(_0x367c22,_0x213486){const _0x3eee81=a27_0x2cc6,_0x20ac48=_0x367c22();while(!![]){try{const _0x31d227=-parseInt(_0x3eee81(0x154))/0x1+-parseInt(_0x3eee81(0x170))/0x2+-parseInt(_0x3eee81(0x15a))/0x3*(-parseInt(_0x3eee81(0x165))/0x4)+-parseInt(_0x3eee81(0x167))/0x5+parseInt(_0x3eee81(0x168))/0x6*(-parseInt(_0x3eee81(0x166))/0x7)+-parseInt(_0x3eee81(0x164))/0x8*(-parseInt(_0x3eee81(0x169))/0x9)+parseInt(_0x3eee81(0x161))/0xa;if(_0x31d227===_0x213486)break;else _0x20ac48['push'](_0x20ac48['shift']());}catch(_0x3b0d17){_0x20ac48['push'](_0x20ac48['shift']());}}}(a27_0x135c,0xdb9ba));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a27_0x135c(){const _0x4249d3=['387877gPkXtJ','1914025xKlggk','114hNhXEt','387GqnECS','segment','\x27...','\x20field','data','error','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','1599298sDkUzh','798046qkzvli','verbose','Listing\x20fields\x20for\x20\x27','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','parentSegment','Site:\x20','53559egZkcW','listFields','Parent\x20segment:\x20','execute','description','length','Error:\x20Parent\x20segment\x20name\x20is\x20required','27209980kfGQjF','segment:fields','name','29488wwRQlo','236cDENdf'];a27_0x135c=function(){return _0x4249d3;};return a27_0x135c();}import{withSpinner}from'../utils/spinner.js';function a27_0x2cc6(_0x5b2d40,_0x1da479){_0x5b2d40=_0x5b2d40-0x154;const _0x135c57=a27_0x135c();let _0x2cc6ee=_0x135c57[_0x5b2d40];return _0x2cc6ee;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x16ca38(0x163)]=a27_0x16ca38(0x162);[a27_0x16ca38(0x15e)]='List\x20available\x20fields\x20for\x20segmentation';async[a27_0x16ca38(0x15d)](_0x1aed41){const _0x182d82=a27_0x16ca38,{options:_0x191482,args:_0x36178a,tdx:_0x34f505}=_0x1aed41,_0x2d3592=_0x36178a[0x0]||_0x191482[_0x182d82(0x158)];if(!_0x2d3592)return console['error'](_0x182d82(0x160)),console[_0x182d82(0x16e)](_0x182d82(0x157)),console['error'](_0x182d82(0x16f)),0x1;_0x191482['verbose']&&(console[_0x182d82(0x16e)](_0x182d82(0x159)+_0x191482['site']),console[_0x182d82(0x16e)](_0x182d82(0x15c)+_0x2d3592));const _0x1d23b3=await withSpinner(_0x182d82(0x156)+_0x2d3592+_0x182d82(0x16b),()=>_0x34f505[_0x182d82(0x16a)][_0x182d82(0x15b)](_0x2d3592),{'verbose':_0x191482[_0x182d82(0x155)]}),_0x2919aa=_0x1d23b3[_0x182d82(0x16d)];console['error']('✔\x20Found\x20'+_0x2919aa[_0x182d82(0x15f)]+_0x182d82(0x16c)+(_0x2919aa['length']!==0x1?'s':''));if(_0x191482['json']||_0x191482['jsonl'])return await handleSDKOutput(_0x2919aa,_0x191482),0x0;return displayFieldsHumanReadable(_0x2919aa,_0x2d3592),0x0;}}
@@ -1 +1 @@
1
- const a28_0xbf23c7=a28_0x1cb3;(function(_0x2190f1,_0xa1e8d2){const _0x171cbc=a28_0x1cb3,_0x556b5b=_0x2190f1();while(!![]){try{const _0x4deec6=parseInt(_0x171cbc(0xa0))/0x1+parseInt(_0x171cbc(0x96))/0x2+-parseInt(_0x171cbc(0x8f))/0x3*(parseInt(_0x171cbc(0x90))/0x4)+-parseInt(_0x171cbc(0xb9))/0x5*(parseInt(_0x171cbc(0xb5))/0x6)+parseInt(_0x171cbc(0xa4))/0x7+parseInt(_0x171cbc(0x9b))/0x8*(parseInt(_0x171cbc(0xc7))/0x9)+parseInt(_0x171cbc(0xd0))/0xa;if(_0x4deec6===_0xa1e8d2)break;else _0x556b5b['push'](_0x556b5b['shift']());}catch(_0x35cbb9){_0x556b5b['push'](_0x556b5b['shift']());}}}(a28_0x89d0,0x37482));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x1b2128 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x2b733b from'path';function a28_0x89d0(){const _0x59038a=['session','cyan','\x0aPull\x20summary\x20for\x20\x27','\x20new\x20files','\x20changed\x20files','segment:pull','verbose','parentName','dirname','\x20activations','12lfzSOi','✔\x20Context\x20set:\x20','content','absolutePath','531995VrHUSF','\x20files?','cwd','\x20versions)','targetDir','yellow','utf-8','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','length','name','\x20unchanged\x20files','execute','\x20\x20🎯\x20','repeat','1103373ZioUmu','filter','errorCode','error','description','no_parent','green','activations','dryRun','2048730wCOmzc','journeys','site','red','parent_segment','3XlwMnE','880652tUpNNK','Pulling\x20segments\x20from\x20\x27','\x27...','hasChanges','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','dim','205956IwWvUk','Site:\x20','\x20=\x20','journeyVersions','\x20files\x20to\x20','16TFEHIe','\x20with\x20','Aborted.','\x20\x20🗺️\x20\x20','\x20segments','104329tgBbzF','isNew','helpText','segment','14147oOvKdn','counts','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20All\x20files\x20are\x20up\x20to\x20date','files','segments','\x20journeys'];a28_0x89d0=function(){return _0x59038a;};return a28_0x89d0();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x1cb3(_0x3fd6a6,_0x4f2524){_0x3fd6a6=_0x3fd6a6-0x8b;const _0x89d079=a28_0x89d0();let _0x1cb3b3=_0x89d079[_0x3fd6a6];return _0x1cb3b3;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a28_0xbf23c7(0xc2)]=a28_0xbf23c7(0xb0);[a28_0xbf23c7(0xcb)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a28_0xbf23c7(0xc4)](_0x4183a3){const _0x3b1f6e=a28_0xbf23c7,{options:_0x4867d5,args:_0x5548db,tdx:_0x469067}=_0x4183a3,_0x498aca=_0x4867d5,_0x369e2d=await resolveTarget({'arg':_0x5548db[0x0],'contextParent':_0x4867d5['parentSegment'],'cwd':process[_0x3b1f6e(0xbb)]()});if(!isSuccessfulResolution(_0x369e2d))return _0x369e2d[_0x3b1f6e(0xc9)]===_0x3b1f6e(0xcc)?(console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xbe)](_0x3b1f6e(0xc0))),console[_0x3b1f6e(0xca)]('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)'),console[_0x3b1f6e(0xca)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x3b1f6e(0xca)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0x8d)]('Error:\x20'+_0x369e2d['message']+'\x0a')),_0x369e2d[_0x3b1f6e(0xa2)]&&console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xac)](_0x369e2d[_0x3b1f6e(0xa2)]))),0x1;const _0x21ab83=_0x369e2d[_0x3b1f6e(0xb2)],_0x3dcf92=_0x369e2d[_0x3b1f6e(0xbd)];_0x498aca[_0x3b1f6e(0xb1)]&&(console[_0x3b1f6e(0xca)](_0x3b1f6e(0x97)+_0x498aca[_0x3b1f6e(0x8c)]),console[_0x3b1f6e(0xca)]('Parent\x20segment:\x20'+_0x21ab83));const _0x18e1f8=await withProgressSpinner(_0x3b1f6e(0x91)+_0x21ab83+_0x3b1f6e(0x92),_0x47cfeb=>_0x469067[_0x3b1f6e(0xa3)]['pullSegments'](_0x21ab83,{'targetDir':_0x3dcf92,'verbose':_0x498aca[_0x3b1f6e(0xb1)],'progress':{'update':_0x536c32=>{const _0x3fa684=_0x3b1f6e;_0x47cfeb['setPhase'](_0x536c32),_0x498aca[_0x3fa684(0xb1)]&&console[_0x3fa684(0xca)]('\x20\x20'+_0x536c32);}}}),{'verbose':_0x498aca[_0x3b1f6e(0xb1)]}),_0x154191=_0x18e1f8['data'];if(_0x154191[_0x3b1f6e(0xa5)]['segments']===0x0&&_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]===0x0)return console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xbe)](_0x3b1f6e(0x94)+_0x154191[_0x3b1f6e(0xb2)]+'\x27')),0x0;const _0x3d39a7=_0x154191['files'][_0x3b1f6e(0xc8)](_0x2c9cf5=>_0x2c9cf5['isNew']),_0x3680ef=_0x154191[_0x3b1f6e(0xa8)][_0x3b1f6e(0xc8)](_0x4ecbee=>!_0x4ecbee['isNew']&&_0x4ecbee[_0x3b1f6e(0x93)]),_0x119423=_0x154191[_0x3b1f6e(0xa8)][_0x3b1f6e(0xc8)](_0xdf84d6=>!_0xdf84d6[_0x3b1f6e(0xa1)]&&!_0xdf84d6[_0x3b1f6e(0x93)]);console[_0x3b1f6e(0xca)](_0x3b1f6e(0xad)+_0x154191[_0x3b1f6e(0xb2)]+'\x27:'),console['error'](_0x3b1f6e(0xc5)+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0xa9)]+_0x3b1f6e(0x9f))+_0x3b1f6e(0x9c)+a28_0x1b2128['cyan'](_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0xce)]+_0x3b1f6e(0xb4)));if(_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]>0x0){const _0x2767b1=_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x99)]>_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]?'\x20('+_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x99)]+_0x3b1f6e(0xbc):'';console['error'](_0x3b1f6e(0x9e)+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]+_0x3b1f6e(0xaa))+a28_0x1b2128[_0x3b1f6e(0x95)](_0x2767b1));}console[_0x3b1f6e(0xca)]('\x20\x20'+a28_0x1b2128['green']('+\x20'+_0x3d39a7[_0x3b1f6e(0xc1)]+_0x3b1f6e(0xae))),console[_0x3b1f6e(0xca)]('\x20\x20'+a28_0x1b2128['yellow']('~\x20'+_0x3680ef[_0x3b1f6e(0xc1)]+_0x3b1f6e(0xaf))),console[_0x3b1f6e(0xca)]('\x20\x20'+a28_0x1b2128[_0x3b1f6e(0x95)]('=\x20'+_0x119423[_0x3b1f6e(0xc1)]+_0x3b1f6e(0xc3))),console[_0x3b1f6e(0xca)]('\x20\x20Target:\x20'+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191[_0x3b1f6e(0xbd)])+'\x0a');if(_0x3680ef[_0x3b1f6e(0xc1)]>0x0)for(const _0x3dd7ee of _0x3680ef){console['error']('\x0aChanges\x20to\x20\x27'+_0x3dd7ee['relativePath']+'\x27:'),console[_0x3b1f6e(0xca)]('─'[_0x3b1f6e(0xc6)](0x3c)),console['error'](_0x3dd7ee['diff']),console[_0x3b1f6e(0xca)]('─'['repeat'](0x3c));}if(_0x498aca[_0x3b1f6e(0xcf)])return console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xbe)](_0x3b1f6e(0xa6))),0x0;if(_0x3d39a7['length']===0x0&&_0x3680ef[_0x3b1f6e(0xc1)]===0x0)return console['error'](a28_0x1b2128[_0x3b1f6e(0xcd)](_0x3b1f6e(0xa7))),saveSessionContext({'parent_segment':_0x154191[_0x3b1f6e(0xb2)]},_0x498aca[_0x3b1f6e(0xab)]),console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xcd)]('✔\x20Context\x20set:\x20'+a28_0x1b2128[_0x3b1f6e(0x95)](_0x3b1f6e(0x8e))+'\x20=\x20'+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191['parentName']))),0x0;if(!_0x498aca['yes']){const _0x1e1d07=await confirmKey('Write\x20'+(_0x3d39a7[_0x3b1f6e(0xc1)]+_0x3680ef[_0x3b1f6e(0xc1)])+_0x3b1f6e(0xba));if(!_0x1e1d07)return console[_0x3b1f6e(0xca)](_0x3b1f6e(0x9d)),0x1;}for(const _0xeeb4b9 of _0x154191['files']){if(_0xeeb4b9['isNew']||_0xeeb4b9['hasChanges']){const _0x1c90a6=a28_0x2b733b[_0x3b1f6e(0xb3)](_0xeeb4b9[_0x3b1f6e(0xb8)]);!existsSync(_0x1c90a6)&&mkdirSync(_0x1c90a6,{'recursive':!![]}),writeFileSync(_0xeeb4b9['absolutePath'],_0xeeb4b9[_0x3b1f6e(0xb7)],_0x3b1f6e(0xbf));}}return console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xcd)]('✔\x20Pulled\x20'+(_0x3d39a7[_0x3b1f6e(0xc1)]+_0x3680ef[_0x3b1f6e(0xc1)])+_0x3b1f6e(0x9a)+_0x154191[_0x3b1f6e(0xbd)])),saveSessionContext({'parent_segment':_0x154191[_0x3b1f6e(0xb2)]},_0x498aca[_0x3b1f6e(0xab)]),console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xcd)](_0x3b1f6e(0xb6)+a28_0x1b2128[_0x3b1f6e(0x95)](_0x3b1f6e(0x8e))+_0x3b1f6e(0x98)+a28_0x1b2128['cyan'](_0x154191[_0x3b1f6e(0xb2)]))),0x0;}}
1
+ function a28_0x1f7d(_0x442fe1,_0x542e7c){_0x442fe1=_0x442fe1-0xc3;const _0x5e40e1=a28_0x5e40();let _0x1f7d59=_0x5e40e1[_0x442fe1];return _0x1f7d59;}const a28_0x28382e=a28_0x1f7d;(function(_0x1a6a9b,_0x4bdc52){const _0x14884b=a28_0x1f7d,_0x28d4d5=_0x1a6a9b();while(!![]){try{const _0x27467f=parseInt(_0x14884b(0xce))/0x1*(parseInt(_0x14884b(0xcc))/0x2)+parseInt(_0x14884b(0xf0))/0x3+parseInt(_0x14884b(0xe6))/0x4+-parseInt(_0x14884b(0xf4))/0x5+-parseInt(_0x14884b(0xe1))/0x6*(parseInt(_0x14884b(0xda))/0x7)+-parseInt(_0x14884b(0xf6))/0x8+-parseInt(_0x14884b(0x106))/0x9*(-parseInt(_0x14884b(0xf3))/0xa);if(_0x27467f===_0x4bdc52)break;else _0x28d4d5['push'](_0x28d4d5['shift']());}catch(_0x400ba8){_0x28d4d5['push'](_0x28d4d5['shift']());}}}(a28_0x5e40,0xac7e3));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0xa8a0d from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a28_0x5e40(){const _0x3f1a24=['absolutePath','site','\x20versions)','cyan','2822232Esorud','session','length','40PctqbO','6499010obzyzc','\x20\x20🗺️\x20\x20','2336808JaMpMU','utf-8','repeat','pullSegments','relativePath','message','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','files','dirname','\x20journeys','Pulling\x20segments\x20from\x20\x27','verbose','green','filter','Aborted.','helpText','391572OXDvLs','segment','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','activations','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aChanges\x20to\x20\x27','\x20with\x20','execute','isNew','\x20files\x20to\x20','dim','5572kxRmfc','Site:\x20','378BDAJAq','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parentName','error','errorCode','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','red','parent_segment','journeyVersions','7LpRBDr','hasChanges','data','✔\x20Context\x20set:\x20','\x0aPull\x20summary\x20for\x20\x27','\x20\x20🎯\x20','counts','4977030OBEMVg','\x20=\x20','segments','dryRun','name','3840220qjwJps','no_parent','journeys','targetDir','\x20activations','\x20changed\x20files'];a28_0x5e40=function(){return _0x3f1a24;};return a28_0x5e40();}import a28_0x3b735d from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a28_0x28382e(0xe5)]='segment:pull';['description']=a28_0x28382e(0xd4);async[a28_0x28382e(0xc8)](_0x5a6a2f){const _0x150c40=a28_0x28382e,{options:_0x2188c,args:_0x32169e,tdx:_0x70aea5}=_0x5a6a2f,_0x485722=_0x2188c,_0x2e2a4b=await resolveTarget({'arg':_0x32169e[0x0],'contextParent':_0x2188c['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2e2a4b))return _0x2e2a4b[_0x150c40(0xd3)]===_0x150c40(0xe7)?(console[_0x150c40(0xd2)](a28_0xa8a0d[_0x150c40(0xcf)](_0x150c40(0xc5))),console[_0x150c40(0xd2)]('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)'),console[_0x150c40(0xd2)](_0x150c40(0xd6)),console[_0x150c40(0xd2)](_0x150c40(0xd0))):(console[_0x150c40(0xd2)](a28_0xa8a0d[_0x150c40(0xd7)]('Error:\x20'+_0x2e2a4b[_0x150c40(0xfb)]+'\x0a')),_0x2e2a4b[_0x150c40(0x105)]&&console[_0x150c40(0xd2)](a28_0xa8a0d['cyan'](_0x2e2a4b[_0x150c40(0x105)]))),0x1;const _0x40d42a=_0x2e2a4b['parentName'],_0x41a246=_0x2e2a4b[_0x150c40(0xe9)];_0x485722[_0x150c40(0x101)]&&(console[_0x150c40(0xd2)](_0x150c40(0xcd)+_0x485722[_0x150c40(0xed)]),console[_0x150c40(0xd2)](_0x150c40(0xd5)+_0x40d42a));const _0x48bbd4=await withProgressSpinner(_0x150c40(0x100)+_0x40d42a+'\x27...',_0xcc81f=>_0x70aea5[_0x150c40(0x107)][_0x150c40(0xf9)](_0x40d42a,{'targetDir':_0x41a246,'verbose':_0x485722['verbose'],'progress':{'update':_0x46e483=>{const _0x68b2cb=_0x150c40;_0xcc81f['setPhase'](_0x46e483),_0x485722[_0x68b2cb(0x101)]&&console['error']('\x20\x20'+_0x46e483);}}}),{'verbose':_0x485722[_0x150c40(0x101)]}),_0x592190=_0x48bbd4[_0x150c40(0xdc)];if(_0x592190['counts']['segments']===0x0&&_0x592190[_0x150c40(0xe0)]['journeys']===0x0)return console[_0x150c40(0xd2)](a28_0xa8a0d[_0x150c40(0xcf)](_0x150c40(0xfc)+_0x592190[_0x150c40(0xd1)]+'\x27')),0x0;const _0x14a253=_0x592190[_0x150c40(0xfd)][_0x150c40(0x103)](_0x501b35=>_0x501b35['isNew']),_0x15aa67=_0x592190['files']['filter'](_0x440de1=>!_0x440de1[_0x150c40(0xc9)]&&_0x440de1['hasChanges']),_0x4037db=_0x592190[_0x150c40(0xfd)][_0x150c40(0x103)](_0x3cf380=>!_0x3cf380[_0x150c40(0xc9)]&&!_0x3cf380[_0x150c40(0xdb)]);console[_0x150c40(0xd2)](_0x150c40(0xde)+_0x592190[_0x150c40(0xd1)]+'\x27:'),console[_0x150c40(0xd2)](_0x150c40(0xdf)+a28_0xa8a0d['cyan'](_0x592190[_0x150c40(0xe0)][_0x150c40(0xe3)]+'\x20segments')+_0x150c40(0xc7)+a28_0xa8a0d[_0x150c40(0xef)](_0x592190['counts'][_0x150c40(0xc4)]+_0x150c40(0xea)));if(_0x592190[_0x150c40(0xe0)][_0x150c40(0xe8)]>0x0){const _0x2c6008=_0x592190[_0x150c40(0xe0)][_0x150c40(0xd9)]>_0x592190['counts']['journeys']?'\x20('+_0x592190[_0x150c40(0xe0)]['journeyVersions']+_0x150c40(0xee):'';console[_0x150c40(0xd2)](_0x150c40(0xf5)+a28_0xa8a0d[_0x150c40(0xef)](_0x592190[_0x150c40(0xe0)]['journeys']+_0x150c40(0xff))+a28_0xa8a0d[_0x150c40(0xcb)](_0x2c6008));}console[_0x150c40(0xd2)]('\x20\x20'+a28_0xa8a0d[_0x150c40(0x102)]('+\x20'+_0x14a253[_0x150c40(0xf2)]+'\x20new\x20files')),console[_0x150c40(0xd2)]('\x20\x20'+a28_0xa8a0d[_0x150c40(0xcf)]('~\x20'+_0x15aa67[_0x150c40(0xf2)]+_0x150c40(0xeb))),console['error']('\x20\x20'+a28_0xa8a0d[_0x150c40(0xcb)]('=\x20'+_0x4037db['length']+'\x20unchanged\x20files')),console['error']('\x20\x20Target:\x20'+a28_0xa8a0d['cyan'](_0x592190[_0x150c40(0xe9)])+'\x0a');if(_0x15aa67[_0x150c40(0xf2)]>0x0)for(const _0x246be0 of _0x15aa67){console[_0x150c40(0xd2)](_0x150c40(0xc6)+_0x246be0[_0x150c40(0xfa)]+'\x27:'),console[_0x150c40(0xd2)]('─'[_0x150c40(0xf8)](0x3c)),console[_0x150c40(0xd2)](_0x246be0['diff']),console[_0x150c40(0xd2)]('─'[_0x150c40(0xf8)](0x3c));}if(_0x485722[_0x150c40(0xe4)])return console[_0x150c40(0xd2)](a28_0xa8a0d[_0x150c40(0xcf)](_0x150c40(0xc3))),0x0;if(_0x14a253['length']===0x0&&_0x15aa67[_0x150c40(0xf2)]===0x0)return console[_0x150c40(0xd2)](a28_0xa8a0d[_0x150c40(0x102)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x592190[_0x150c40(0xd1)]},_0x485722['session']),console[_0x150c40(0xd2)](a28_0xa8a0d[_0x150c40(0x102)](_0x150c40(0xdd)+a28_0xa8a0d['dim'](_0x150c40(0xd8))+_0x150c40(0xe2)+a28_0xa8a0d[_0x150c40(0xef)](_0x592190[_0x150c40(0xd1)]))),0x0;if(!_0x485722['yes']){const _0x369005=await confirmKey('Write\x20'+(_0x14a253[_0x150c40(0xf2)]+_0x15aa67[_0x150c40(0xf2)])+'\x20files?');if(!_0x369005)return console[_0x150c40(0xd2)](_0x150c40(0x104)),0x1;}for(const _0x2de7c2 of _0x592190['files']){if(_0x2de7c2[_0x150c40(0xc9)]||_0x2de7c2[_0x150c40(0xdb)]){const _0x55adf9=a28_0x3b735d[_0x150c40(0xfe)](_0x2de7c2[_0x150c40(0xec)]);!existsSync(_0x55adf9)&&mkdirSync(_0x55adf9,{'recursive':!![]}),writeFileSync(_0x2de7c2[_0x150c40(0xec)],_0x2de7c2['content'],_0x150c40(0xf7));}}return console[_0x150c40(0xd2)](a28_0xa8a0d[_0x150c40(0x102)]('✔\x20Pulled\x20'+(_0x14a253[_0x150c40(0xf2)]+_0x15aa67['length'])+_0x150c40(0xca)+_0x592190['targetDir'])),saveSessionContext({'parent_segment':_0x592190[_0x150c40(0xd1)]},_0x485722[_0x150c40(0xf1)]),console['error'](a28_0xa8a0d['green'](_0x150c40(0xdd)+a28_0xa8a0d['dim'](_0x150c40(0xd8))+'\x20=\x20'+a28_0xa8a0d[_0x150c40(0xef)](_0x592190[_0x150c40(0xd1)]))),0x0;}}
@@ -1 +1 @@
1
- function a29_0x11e3(){const _0x30fa61=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Delete\x20journey:','\x20\x20Activations:','delete','(Journey\x20will\x20be\x20deleted)','293814XCArNY','folders','\x20activations]','Changes\x20to\x20journey:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20unchanged','isScoped','Parent\x20segment:\x20','red','New\x20journey:','\x20\x20Journeys:\x20','buildUserMaps','message','join','87ZKrTpa','activations','folderPath','push','11qTLbeE','journeyBundleName','isNew','journeyId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Scoped\x20to\x20folder:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','Source\x20directory:\x20','\x20\x20Activations:\x20','unchanged','execute','\x20changes?','/app/ps/','getParent','nameToId','map','updated','results','\x20folders\x20to\x20create','3558TxDWdt','Fetching\x20existing\x20segments...','\x0aValidation\x20failed:','site','list','\x20new','dim','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Preparing\x20journeys...','toDelete','\x20YAML\x20files\x20found','all','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','connection','new','listFolders','No\x20','dryRun','\x20\x20Segments:\x20','error','listActivations','Delete\x20segment:','\x27...','journeys','Resolving\x20parent\x20segment\x20\x27','folderId','journey','segments','attributes','Aborted.','/e/','segment','\x20created','\x20\x20\x20\x20','9HeLezq','type','\x20changed','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Fetching\x20existing\x20folders...','yamlConfig','.yml','\x20to\x20update','paused','1279180Rthlew','get','toUpdate','journeyBundleId','4RZwMjG','cyan','name','state','blue','📁\x20','changed','no_parent','description','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','526812iFTUck','\x20deleted','\x20to\x20delete','filePath','1215730Sdfxkf','segmentFolderId','toString','set','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','length','createdSegmentIds','parentFolder','repeat','createdAt','updatedAt','Error\x20parsing\x20YAML:\x20','resolveParentId','data','Fetching\x20existing\x20activations...','user','existingJourney','\x0aPush\x20summary\x20for\x20\x27','add','yellow','Site:\x20','Fetching\x20parent\x20segment\x20details...','filter','then','versionNumber','Error:\x20Directory\x20not\x20found:\x20','17768chYFMm','file','Error:\x20','endsWith','New\x20segment:','green','errorCode','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','setPhase','segment\x20or\x20journey','verbose','getJourney','parent_name','Fetching\x20users\x20for\x20email\x20resolution...','\x20\x20📊\x20Segments:','journeysOnly','deleted','helpText','/j/da/je','1469265Axksuc','diff','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20to\x20create','\x20updated','listJourneysWithDetailsFromParentSegment','cwd','toCreate','targetDir','scopedFolderPath','nameToType'];a29_0x11e3=function(){return _0x30fa61;};return a29_0x11e3();}const a29_0x3a669c=a29_0x1808;(function(_0x247488,_0x21a216){const _0x4b31ce=a29_0x1808,_0x30e662=_0x247488();while(!![]){try{const _0x46c2c7=parseInt(_0x4b31ce(0x1e9))/0x1*(-parseInt(_0x4b31ce(0x200))/0x2)+parseInt(_0x4b31ce(0x239))/0x3+-parseInt(_0x4b31ce(0x22f))/0x4*(parseInt(_0x4b31ce(0x22b))/0x5)+parseInt(_0x4b31ce(0x1da))/0x6+parseInt(_0x4b31ce(0x1ca))/0x7+-parseInt(_0x4b31ce(0x1b7))/0x8*(parseInt(_0x4b31ce(0x222))/0x9)+parseInt(_0x4b31ce(0x23d))/0xa*(parseInt(_0x4b31ce(0x1ed))/0xb);if(_0x46c2c7===_0x21a216)break;else _0x30e662['push'](_0x30e662['shift']());}catch(_0x444395){_0x30e662['push'](_0x30e662['shift']());}}}(a29_0x11e3,0x22f6b));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x3bbddb from'chalk';function a29_0x1808(_0x2dd087,_0x31d7cb){_0x2dd087=_0x2dd087-0x1a5;const _0x11e382=a29_0x11e3();let _0x180850=_0x11e382[_0x2dd087];return _0x180850;}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a29_0x3a669c(0x231)]='segment:push';['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a29_0x3a669c(0x1f7)](_0x199a15){const _0x515249=a29_0x3a669c,{options:_0x4fe2c2,args:_0x51de86,tdx:_0x298f1b}=_0x199a15,_0x4ccd95=_0x4fe2c2,_0x43636b=await resolveTarget({'arg':_0x51de86[0x0],'contextParent':_0x4fe2c2['parentSegment'],'cwd':process[_0x515249(0x1d0)]()});if(!isSuccessfulResolution(_0x43636b))return _0x43636b[_0x515249(0x1bd)]===_0x515249(0x236)?(console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)](_0x515249(0x1f1))),console[_0x515249(0x213)]('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[_0x515249(0x213)](_0x515249(0x1d5)),console['error'](_0x515249(0x1de))):(console['error'](a29_0x3bbddb['red'](_0x515249(0x1b9)+_0x43636b['message']+'\x0a')),_0x43636b[_0x515249(0x1c8)]&&console['error'](a29_0x3bbddb[_0x515249(0x230)](_0x43636b['helpText']))),0x1;if(_0x43636b[_0x515249(0x223)]===_0x515249(0x1c3))return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1b6)+_0x43636b[_0x515249(0x1d2)]+'\x0a')),console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x230)](_0x515249(0x241))),0x1;const _0x577a22=_0x43636b['parentName'],_0xfb5e91=_0x43636b[_0x515249(0x1d2)],_0x474ed8=_0x43636b[_0x515249(0x223)]===_0x515249(0x1b8)?_0x43636b[_0x515249(0x23c)]:undefined,_0x4faf87=getScopedDetails(_0x43636b),_0x4eb55c=_0x4faf87?.[_0x515249(0x1e1)]??![],_0x5d8bf7=_0x4faf87?.[_0x515249(0x1d3)]??'';if(!existsSync(_0xfb5e91))return console['error'](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1b6)+_0xfb5e91+'\x0a')),console['error'](a29_0x3bbddb[_0x515249(0x230)](_0x515249(0x241))),0x1;_0x4ccd95[_0x515249(0x1c1)]&&(console[_0x515249(0x213)](_0x515249(0x1b1)+_0x4ccd95[_0x515249(0x203)]),console[_0x515249(0x213)](_0x515249(0x1e2)+_0x577a22),console[_0x515249(0x213)](_0x515249(0x1f4)+_0xfb5e91),_0x4eb55c&&console[_0x515249(0x213)](_0x515249(0x1f2)+_0x5d8bf7));const _0x418425=await withSpinner(_0x515249(0x218)+_0x577a22+_0x515249(0x216),()=>_0x298f1b['segment'][_0x515249(0x1a9)](_0x577a22),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),_0x3ce21d=_0x418425[_0x515249(0x1aa)],[_0x6e30e,_0x18e4d9,_0x25cddd,_0x50e29b,_0x341e91]=await Promise[_0x515249(0x20b)]([withSpinner(_0x515249(0x1b2),()=>_0x298f1b[_0x515249(0x21f)][_0x515249(0x1fa)](_0x3ce21d),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),withSpinner(_0x515249(0x201),()=>_0x298f1b['segment']['listSegments'](_0x3ce21d),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),withSpinner(_0x515249(0x226),()=>_0x298f1b['segment'][_0x515249(0x20f)](_0x3ce21d),{'verbose':_0x4ccd95['verbose']}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x298f1b[_0x515249(0x21a)][_0x515249(0x1cf)](_0x3ce21d),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),withSpinner(_0x515249(0x1c4),()=>_0x298f1b['user'][_0x515249(0x1e6)](),{'verbose':_0x4ccd95[_0x515249(0x1c1)]})[_0x515249(0x1b4)](_0x514aba=>_0x514aba['data'])]),_0x2c60aa=_0x6e30e['data'],_0x57b03c=extractRootFolderId(_0x2c60aa),_0x88dfb2=_0x18e4d9[_0x515249(0x1aa)],_0x23b4fe=_0x25cddd[_0x515249(0x1aa)],{journeys:_0x36f1d7,activationStepsById:_0x56b680}=_0x50e29b[_0x515249(0x1aa)],_0x18d68e=new Map(_0x36f1d7['map'](_0x121018=>[_0x121018['id'],_0x121018])),_0xe2ff26=_0x36f1d7[_0x515249(0x1fc)](_0x2d4d8d=>({'id':_0x2d4d8d['id'],'name':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x231)],'journeyBundleName':_0x2d4d8d['attributes'][_0x515249(0x1ee)]||'','journeyBundleId':_0x2d4d8d['attributes'][_0x515249(0x22e)]||'','versionNumber':_0x2d4d8d['attributes'][_0x515249(0x1b5)],'description':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x237)],'state':_0x2d4d8d['attributes'][_0x515249(0x232)],'paused':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x22a)],'audienceId':_0x2d4d8d[_0x515249(0x21c)]['audienceId'],'folderId':_0x2d4d8d['relationships']?.[_0x515249(0x244)]?.[_0x515249(0x1aa)]?.['id'],'createdAt':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x1a6)],'updatedAt':_0x2d4d8d['attributes'][_0x515249(0x1a7)]})),{emailToId:_0x375ae0,idToEmail:_0x1d4c3b}=_0x341e91,_0xf86b85=await withSpinner(_0x515249(0x1f3),async()=>{const _0x5e1480=_0x515249,_0x1d534f=await _0x298f1b[_0x5e1480(0x20d)][_0x5e1480(0x204)]();return buildConnectionMaps(_0x1d534f);},{'verbose':_0x4ccd95[_0x515249(0x1c1)]})[_0x515249(0x1b4)](_0x2ef9ee=>_0x2ef9ee[_0x515249(0x1aa)]),_0x308d3b=_0xf86b85[_0x515249(0x1fb)],_0x4b93f7=_0xf86b85['idToName'],_0x1c390c=_0xf86b85[_0x515249(0x1d4)],_0x6d306c={'emailToIdMap':_0x375ae0,'connectionNameToIdMap':_0x308d3b,'connectionNameToTypeMap':_0x1c390c,'getSchema':_0x29ef5c=>_0x298f1b[_0x515249(0x20d)]['getOutputSchemaWithCache'](_0x29ef5c)};let {pathToId:_0xf07735,idToPath:_0x48c8d0}=buildFolderMaps(_0x23b4fe);const _0x47ed5c=buildSegmentLookupMap(_0x88dfb2,_0x48c8d0),_0x5358c4=buildSegmentNameToIdMap(_0x88dfb2),_0x2baf70=buildJourneyBundleLookupMap(_0xe2ff26,_0x48c8d0);let _0x57cbf8;if(_0x474ed8){if(!_0x474ed8['endsWith'](_0x515249(0x228))&&!_0x474ed8[_0x515249(0x1ba)]('.yaml'))return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1cc)+_0x474ed8+'\x0a')),0x1;_0x57cbf8=[_0x474ed8];}else _0x57cbf8=findYamlFiles(_0xfb5e91);if(_0x57cbf8[_0x515249(0x242)]===0x0)return console[_0x515249(0x213)](a29_0x3bbddb['red'](_0x515249(0x1df)+_0xfb5e91+'\x0a')),console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x230)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x414b9b,_0x33c5a6;try{const _0x11041c=parseAndClassifyYamlFiles(_0x57cbf8,_0xfb5e91,{'skipSegments':_0x4ccd95[_0x515249(0x1c6)]});_0x414b9b=_0x11041c['segments'],_0x33c5a6=_0x11041c[_0x515249(0x217)];const _0x1fce2b=validateParsedFiles(_0x11041c,_0xfb5e91);if(_0x1fce2b[_0x515249(0x242)]>0x0)return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x202))),console[_0x515249(0x213)](formatValidationErrors(_0x1fce2b)),console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0xd7bec5){return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1a8)+(_0xd7bec5 instanceof Error?_0xd7bec5[_0x515249(0x1e7)]:_0xd7bec5))),0x1;}if(_0x414b9b[_0x515249(0x242)]===0x0&&_0x33c5a6[_0x515249(0x242)]===0x0){const _0x3d1c09=_0x4ccd95[_0x515249(0x1c6)]?_0x515249(0x21a):_0x515249(0x1c0);return console[_0x515249(0x213)](a29_0x3bbddb['yellow'](_0x515249(0x210)+_0x3d1c09+_0x515249(0x20a))),0x0;}const _0x5bf32d=new Map();_0x88dfb2[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1c6)]&&await withSpinner(_0x515249(0x1ab),async()=>{await batchAsync(_0x88dfb2,async _0x2b6c2e=>{const _0x20eddb=a29_0x1808,_0x2dc4de=await _0x298f1b['segment'][_0x20eddb(0x214)](_0x3ce21d,_0x2b6c2e['id']);_0x5bf32d[_0x20eddb(0x240)](_0x2b6c2e['id'],_0x2dc4de);});},{'verbose':_0x4ccd95[_0x515249(0x1c1)]});const {segmentFiles:_0x3b717d,foldersToCreate:_0x173156}=await prepareSegmentFiles(_0x414b9b,{'segmentByFolderAndName':_0x47ed5c,'activationsBySegmentId':_0x5bf32d,'folderPathToId':_0xf07735,'idToEmailMap':_0x1d4c3b,'connectionIdToNameMap':_0x4b93f7},_0x6d306c,_0x4eb55c,_0x5d8bf7),_0x2bdd7a=_0x474ed8?[]:findSegmentsToDelete(_0x88dfb2,_0x414b9b[_0x515249(0x1fc)](({yamlConfig:_0x47d41d,folderPath:_0x553e8b})=>({'yamlConfig':_0x47d41d,'folderPath':resolveTDFolderPath(_0x553e8b,_0x4eb55c,_0x5d8bf7)})),_0x48c8d0,_0x5d8bf7,_0x4eb55c),{journeyFiles:_0x24fcca,foldersToCreate:_0x201ac3}=await withProgressSpinner(_0x515249(0x208),async _0x5c3585=>prepareJourneyFiles(_0x33c5a6,{'fetchJourney':async _0x525c6e=>_0x298f1b[_0x515249(0x21a)][_0x515249(0x1c2)](_0x525c6e[_0x515249(0x1f0)]),'journeyBundlesByFolderAndName':_0x2baf70,'folderPathToId':_0xf07735,'idToEmailMap':_0x1d4c3b,'connectionIdToNameMap':_0x4b93f7,'existingSegments':_0x88dfb2,'parentId':_0x3ce21d,'deps':_0x298f1b,'progress':{'update':_0x426f23=>{const _0x3b988f=_0x515249;_0x5c3585[_0x3b988f(0x1bf)](_0x426f23),_0x4ccd95['verbose']&&console['error']('\x20\x20'+_0x426f23);}},'journeyById':_0x18d68e,'activationStepsById':_0x56b680},_0x4eb55c,_0x5d8bf7),{'verbose':_0x4ccd95[_0x515249(0x1c1)]})[_0x515249(0x1b4)](_0x5ca943=>_0x5ca943[_0x515249(0x1aa)]);for(const _0x4b2b2c of _0x201ac3){_0x173156[_0x515249(0x1af)](_0x4b2b2c);}const _0x2cf22d=_0x474ed8?[]:findJourneysToDelete(_0xe2ff26,_0x33c5a6[_0x515249(0x1fc)](({yamlConfig:_0x4a86a8,folderPath:_0x21f062})=>({'yamlConfig':_0x4a86a8,'folderPath':resolveTDFolderPath(_0x21f062,_0x4eb55c,_0x5d8bf7)})),_0x48c8d0,_0x5d8bf7,_0x4eb55c),_0x59c3f3=calculatePushStats(_0x3b717d,_0x24fcca,_0x173156,_0x2bdd7a,_0x2cf22d,!!_0x4ccd95[_0x515249(0x1d8)],!!_0x4ccd95[_0x515249(0x1c6)]),_0x32ad35=_0x59c3f3['segments'][_0x515249(0x20e)],_0x5e8417=_0x59c3f3[_0x515249(0x21b)]['changed'],_0x20f679=_0x59c3f3[_0x515249(0x21b)]['unchanged'],_0x4c01a5=_0x59c3f3[_0x515249(0x21b)]['toDelete'],_0x3b501b=_0x59c3f3[_0x515249(0x1db)][_0x515249(0x1d1)],_0x14a92d=_0x59c3f3[_0x515249(0x217)][_0x515249(0x20e)],_0x398faf=_0x59c3f3['journeys'][_0x515249(0x235)],_0x57e86e=_0x59c3f3[_0x515249(0x217)][_0x515249(0x1f6)],_0x1bab11=_0x59c3f3['journeys'][_0x515249(0x209)],_0x327864=_0x59c3f3[_0x515249(0x1ea)]['all'],_0x4452bf=_0x59c3f3[_0x515249(0x1ea)][_0x515249(0x1d1)],_0x4e7baa=_0x59c3f3[_0x515249(0x1ea)][_0x515249(0x22d)],_0x146651=_0x59c3f3['activations'][_0x515249(0x209)];console[_0x515249(0x213)](_0x515249(0x1ae)+_0x577a22+'\x27:');_0x3b501b[_0x515249(0x242)]>0x0&&console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x233)](_0x515249(0x234)+_0x3b501b[_0x515249(0x242)]+_0x515249(0x1ff)));if(!_0x4ccd95[_0x515249(0x1c6)]){console[_0x515249(0x213)](_0x515249(0x1c5)),console['error'](_0x515249(0x221)+a29_0x3bbddb['green']('+\x20'+_0x32ad35['length']+_0x515249(0x205))),console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x1b0)]('~\x20'+_0x5e8417[_0x515249(0x242)]+_0x515249(0x224)));if(_0x4c01a5[_0x515249(0x242)]>0x0)console['error']('\x20\x20\x20\x20'+a29_0x3bbddb['red']('-\x20'+_0x4c01a5[_0x515249(0x242)]+_0x515249(0x23b)));else _0x2bdd7a[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1d8)]&&console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x206)](_0x2bdd7a[_0x515249(0x242)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x515249(0x213)]('\x20\x20\x20\x20'+a29_0x3bbddb[_0x515249(0x206)]('=\x20'+_0x20f679[_0x515249(0x242)]+'\x20unchanged'));}if(_0x24fcca['length']>0x0||_0x2cf22d['length']>0x0){console[_0x515249(0x213)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x1bc)]('+\x20'+_0x14a92d[_0x515249(0x242)]+_0x515249(0x205))),console['error'](_0x515249(0x221)+a29_0x3bbddb['yellow']('~\x20'+_0x398faf[_0x515249(0x242)]+_0x515249(0x224)));if(_0x1bab11[_0x515249(0x242)]>0x0)console[_0x515249(0x213)]('\x20\x20\x20\x20'+a29_0x3bbddb[_0x515249(0x1e3)]('-\x20'+_0x1bab11[_0x515249(0x242)]+_0x515249(0x23b)));else _0x2cf22d[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1d8)]&&console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x206)](_0x2cf22d[_0x515249(0x242)]+_0x515249(0x207)));console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x206)]('=\x20'+_0x57e86e[_0x515249(0x242)]+_0x515249(0x1e0)));}_0x327864[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1c6)]&&(console['error'](''),console[_0x515249(0x213)](_0x515249(0x1d7)),_0x4452bf[_0x515249(0x242)]>0x0&&console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb['green']('+\x20'+_0x4452bf[_0x515249(0x242)]+_0x515249(0x1cd))),_0x4e7baa[_0x515249(0x242)]>0x0&&console[_0x515249(0x213)]('\x20\x20\x20\x20'+a29_0x3bbddb[_0x515249(0x1b0)]('~\x20'+_0x4e7baa['length']+_0x515249(0x229))),_0x146651[_0x515249(0x242)]>0x0&&console['error'](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x1e3)]('-\x20'+_0x146651[_0x515249(0x242)]+'\x20to\x20delete')));console[_0x515249(0x213)]('\x20\x20Source:\x20'+a29_0x3bbddb['cyan'](_0xfb5e91)+'\x0a');if(_0x3b501b['length']>0x0){console[_0x515249(0x213)]('Folders\x20to\x20create:');for(const _0x3f5d4d of _0x3b501b){console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x233)]('+')+'\x20'+_0x3f5d4d);}console['error']('');}if(_0x32ad35[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1c6)])for(const _0x1f3f25 of _0x32ad35){const _0x1a2371=_0x1f3f25[_0x515249(0x1eb)]?_0x1f3f25['folderPath']+'/'+_0x1f3f25[_0x515249(0x227)][_0x515249(0x231)]:_0x1f3f25[_0x515249(0x227)][_0x515249(0x231)],_0x41c355=_0x1f3f25['yamlConfig'][_0x515249(0x1ea)]?.[_0x515249(0x242)]||0x0,_0x48835d=_0x41c355>0x0?a29_0x3bbddb[_0x515249(0x206)]('\x20['+_0x41c355+_0x515249(0x1dc)):'';console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1bc)](_0x515249(0x1bb))+'\x20'+_0x1a2371+_0x48835d),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c)),_0x1f3f25[_0x515249(0x1cb)]&&console[_0x515249(0x213)](_0x1f3f25[_0x515249(0x1cb)]),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}if(_0x4c01a5['length']>0x0&&!_0x4ccd95[_0x515249(0x1c6)])for(const _0x304771 of _0x4c01a5){const _0x3c8aa9=_0x304771[_0x515249(0x23e)]?_0x48c8d0[_0x515249(0x22c)](_0x304771['segmentFolderId'][_0x515249(0x23f)]())||'':'',_0xffd923=_0x3c8aa9?_0x3c8aa9+'/'+_0x304771[_0x515249(0x231)]:_0x304771[_0x515249(0x231)],_0x479760=_0x5bf32d[_0x515249(0x22c)](_0x304771['id'])||[],_0x56125f=_0x479760[_0x515249(0x242)]>0x0?a29_0x3bbddb['dim']('\x20['+_0x479760[_0x515249(0x242)]+_0x515249(0x1dc)):'';console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x215))+'\x20'+_0xffd923+_0x56125f),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));const _0x3968b2=segmentWithActivationsToYaml(_0x304771,_0x479760,undefined,_0x1d4c3b,_0x4b93f7),_0xfe12c1=segmentToYamlString(_0x3968b2),_0x4f4c01=generateDiff(_0xfe12c1,'');console[_0x515249(0x213)](formatDiffWithColors(_0x4f4c01)),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}const _0x5dd79e=_0x3b717d[_0x515249(0x1b3)](_0x373eec=>!_0x373eec[_0x515249(0x1ef)]&&_0x373eec[_0x515249(0x1cb)]);if(_0x5dd79e[_0x515249(0x242)]>0x0&&!_0x4ccd95['journeysOnly'])for(const _0x5651fc of _0x5dd79e){const _0x32452a=_0x5651fc[_0x515249(0x1eb)]?_0x5651fc['folderPath']+'/'+_0x5651fc['yamlConfig']['name']:_0x5651fc['yamlConfig']['name'];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1b0)]('Changes\x20to:')+'\x20'+_0x32452a),console['error']('─'[_0x515249(0x1a5)](0x3c)),console['error'](_0x5651fc[_0x515249(0x1cb)]),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}if(_0x14a92d[_0x515249(0x242)]>0x0)for(const _0x40cc67 of _0x14a92d){const _0x4084d6=_0x40cc67[_0x515249(0x1eb)]?_0x40cc67['folderPath']+'/'+_0x40cc67[_0x515249(0x227)][_0x515249(0x231)]:_0x40cc67[_0x515249(0x227)][_0x515249(0x231)];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1bc)](_0x515249(0x1e4))+'\x20'+_0x4084d6),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c)),_0x40cc67[_0x515249(0x1cb)]&&console[_0x515249(0x213)](_0x40cc67[_0x515249(0x1cb)]),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}const _0x81a8d8=_0x24fcca[_0x515249(0x1b3)](_0x528fff=>!_0x528fff[_0x515249(0x1ef)]&&_0x528fff[_0x515249(0x1cb)]);if(_0x81a8d8[_0x515249(0x242)]>0x0)for(const _0xcfe54 of _0x81a8d8){const _0x3b0322=_0xcfe54[_0x515249(0x1eb)]?_0xcfe54[_0x515249(0x1eb)]+'/'+_0xcfe54[_0x515249(0x227)][_0x515249(0x231)]:_0xcfe54[_0x515249(0x227)]['name'];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1b0)](_0x515249(0x1dd))+'\x20'+_0x3b0322),console['error']('─'[_0x515249(0x1a5)](0x3c)),console[_0x515249(0x213)](_0xcfe54['diff']),console['error']('─'['repeat'](0x3c));}if(_0x1bab11[_0x515249(0x242)]>0x0)for(const _0x3a1793 of _0x1bab11){const _0x129e79=_0x3a1793[_0x515249(0x219)]?_0x48c8d0['get'](_0x3a1793[_0x515249(0x219)])||'':'',_0x4ca6d2=_0x129e79?_0x129e79+'/'+_0x3a1793[_0x515249(0x1ee)]:_0x3a1793[_0x515249(0x1ee)];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1d6))+'\x20'+_0x4ca6d2),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c)),console['error'](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1d9))),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}if(_0x4ccd95[_0x515249(0x211)])return console['error'](a29_0x3bbddb['yellow'](_0x515249(0x1be))),0x0;const _0xc213d7=_0x4ccd95[_0x515249(0x1c6)]?![]:_0x32ad35[_0x515249(0x242)]>0x0||_0x5e8417[_0x515249(0x242)]>0x0||_0x4c01a5['length']>0x0,_0x458dc8=_0x14a92d[_0x515249(0x242)]>0x0||_0x398faf[_0x515249(0x242)]>0x0||_0x1bab11['length']>0x0,_0x2b38f6=_0x4ccd95[_0x515249(0x1c6)]?![]:_0x327864[_0x515249(0x242)]>0x0,_0x4ca074=_0x3b501b[_0x515249(0x242)]>0x0;if(!_0xc213d7&&!_0x458dc8&&!_0x2b38f6&&!_0x4ca074){const _0x4c8df8=_0x4ccd95[_0x515249(0x1c6)]?_0x515249(0x225):_0x515249(0x238);console['error'](a29_0x3bbddb[_0x515249(0x1bc)](_0x4c8df8));if(_0x474ed8&&_0x57e86e[_0x515249(0x242)]===0x1){const _0x410828=_0x57e86e[0x0];if(_0x410828['existingJourney']?.['id']){const _0x407002=getConsoleNextUrl(_0x4ccd95['site'],'/app/ps/'+_0x3ce21d+_0x515249(0x21e)+_0x410828[_0x515249(0x1ad)]['id']+'/j/da/je');console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x230)](_0x407002));}}return 0x0;}const _0x3ecc57=_0x4ccd95[_0x515249(0x1c6)]?_0x14a92d[_0x515249(0x242)]+_0x398faf['length']+_0x1bab11[_0x515249(0x242)]+_0x3b501b['length']:_0x32ad35[_0x515249(0x242)]+_0x5e8417[_0x515249(0x242)]+_0x4c01a5['length']+_0x14a92d[_0x515249(0x242)]+_0x398faf[_0x515249(0x242)]+_0x1bab11[_0x515249(0x242)]+_0x3b501b[_0x515249(0x242)]+_0x327864['length'];if(!_0x4ccd95['yes']&&_0x3ecc57>0x0){const _0x2481ca=await confirmKey('Push\x20'+_0x3ecc57+_0x515249(0x1f8));if(!_0x2481ca)return console[_0x515249(0x213)](_0x515249(0x21d)),0x1;}const _0x30fddf={'withProgress':async(_0x1fec37,_0x5218f7)=>{const _0x23a8ae=_0x515249,_0x3c13c0=await withSpinner(_0x1fec37,_0x5218f7,{'verbose':_0x4ccd95[_0x23a8ae(0x1c1)]});return{'data':_0x3c13c0['data']};},'logInfo':_0x1a75bc=>console['error'](a29_0x3bbddb[_0x515249(0x233)]('✔\x20'+_0x1a75bc)),'logSuccess':_0x2dc798=>console['error'](a29_0x3bbddb[_0x515249(0x1bc)]('✔\x20'+_0x2dc798)),'logWarning':_0x3b15f2=>console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)]('⚠\x20'+_0x3b15f2)),'logDeleted':_0x59c049=>console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)]('✔\x20'+_0x59c049))},_0x4d8878={'segment':_0x298f1b[_0x515249(0x21f)],'journey':_0x298f1b['journey'],'user':_0x298f1b[_0x515249(0x1ac)],'connection':_0x298f1b['connection']};_0x3b501b[_0x515249(0x242)]>0x0&&(_0xf07735=await executePushFolders(_0x4d8878,_0x3b501b,_0xf07735,{'parentId':_0x3ce21d},_0x30fddf));const _0x338256={'rootFolderId':_0x57b03c,'folderPathToId':_0xf07735,'folderIdToPath':_0x48c8d0,'segmentNameToId':_0x5358c4,'activationsBySegmentId':_0x5bf32d,'emailToIdMap':_0x375ae0,'idToEmailMap':_0x1d4c3b,'connectionNameToIdMap':_0xf86b85[_0x515249(0x1fb)],'connectionIdToNameMap':_0xf86b85['idToName'],'connectionNameToTypeMap':_0x1c390c},_0x4ec03b=await executePushSegments(_0x4d8878,_0x4ccd95['journeysOnly']?[]:_0x3b717d,_0x338256,{'parentId':_0x3ce21d},_0x30fddf),_0x3ece40=_0x4ec03b['created'],_0xf0739c=_0x4ec03b[_0x515249(0x1fd)],_0x58edb2=_0x4ec03b[_0x515249(0x1ea)]['created'],_0x296d34=_0x4ec03b[_0x515249(0x1ea)][_0x515249(0x1fd)],_0x513578=_0x4ec03b[_0x515249(0x1ea)][_0x515249(0x1c7)],_0x54ee35=await executePushSegmentDeletions(_0x4d8878,_0x4ccd95[_0x515249(0x1c6)]?[]:_0x4c01a5,_0x30fddf);let _0x3a0ea7=0x0,_0x6c993c=0x0,_0x54140e=0x0;const _0x55ea42=new Map(_0x5358c4);for(const [_0x10a09d,_0xa9a0cf]of _0x4ec03b[_0x515249(0x243)]){_0x55ea42[_0x515249(0x240)](_0x10a09d,_0xa9a0cf);}if(_0x24fcca[_0x515249(0x242)]>0x0){const _0x1bd056={..._0x338256,'segmentNameToId':_0x55ea42,'existingSegments':_0x88dfb2,'activationContext':_0x6d306c},_0x3aa464=await executePushJourneys(_0x4d8878,_0x24fcca,_0x1bd056,{'parentId':_0x3ce21d,'rootFolderId':_0x57b03c,'verbose':_0x4ccd95[_0x515249(0x1c1)]},_0x30fddf);_0x3a0ea7=_0x3aa464['created'],_0x6c993c=_0x3aa464[_0x515249(0x1fd)];if(_0x474ed8&&_0x3aa464['results'][_0x515249(0x242)]===0x1){const _0x5d22fc=_0x3aa464[_0x515249(0x1fe)][0x0];if(_0x5d22fc[_0x515249(0x1f0)]){const _0x22e033=getConsoleNextUrl(_0x4ccd95[_0x515249(0x203)],_0x515249(0x1f9)+_0x3ce21d+_0x515249(0x21e)+_0x5d22fc[_0x515249(0x1f0)]+_0x515249(0x1c9));console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x230)](_0x22e033));}}}for(const _0x5b72ae of _0x1bab11){console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)](_0x515249(0x20c)+_0x5b72ae['journeyBundleName'])),_0x54140e++;}const _0x89ef05=[];if(_0x3ece40>0x0)_0x89ef05[_0x515249(0x1ec)](_0x3ece40+'\x20created');if(_0xf0739c>0x0)_0x89ef05[_0x515249(0x1ec)](_0xf0739c+_0x515249(0x1ce));if(_0x54ee35>0x0)_0x89ef05[_0x515249(0x1ec)](_0x54ee35+_0x515249(0x23a));const _0x4b2743=[];if(_0x3a0ea7>0x0)_0x4b2743[_0x515249(0x1ec)](_0x3a0ea7+_0x515249(0x220));if(_0x6c993c>0x0)_0x4b2743[_0x515249(0x1ec)](_0x6c993c+_0x515249(0x1ce));if(_0x54140e>0x0)_0x4b2743['push'](_0x54140e+_0x515249(0x23a));const _0x38d425=[];if(_0x58edb2>0x0)_0x38d425[_0x515249(0x1ec)](_0x58edb2+'\x20created');if(_0x296d34>0x0)_0x38d425[_0x515249(0x1ec)](_0x296d34+_0x515249(0x1ce));if(_0x513578>0x0)_0x38d425[_0x515249(0x1ec)](_0x513578+_0x515249(0x23a));return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1bc)]('\x0a✔\x20Push\x20complete')),_0x89ef05[_0x515249(0x242)]>0x0&&!_0x4ccd95['journeysOnly']&&console[_0x515249(0x213)](_0x515249(0x212)+_0x89ef05[_0x515249(0x1e8)](',\x20')),_0x4b2743['length']>0x0&&console[_0x515249(0x213)](_0x515249(0x1e5)+_0x4b2743['join'](',\x20')),_0x38d425['length']>0x0&&!_0x4ccd95[_0x515249(0x1c6)]&&console['error'](_0x515249(0x1f5)+_0x38d425[_0x515249(0x1e8)](',\x20')),0x0;}}
1
+ const a29_0x3871e9=a29_0xf07b;(function(_0x9fb080,_0xeb5c46){const _0x2a23bf=a29_0xf07b,_0x5eb64f=_0x9fb080();while(!![]){try{const _0x4cfc09=parseInt(_0x2a23bf(0x109))/0x1+parseInt(_0x2a23bf(0xd3))/0x2*(parseInt(_0x2a23bf(0x88))/0x3)+-parseInt(_0x2a23bf(0x124))/0x4+parseInt(_0x2a23bf(0x10c))/0x5*(parseInt(_0x2a23bf(0xc7))/0x6)+-parseInt(_0x2a23bf(0xad))/0x7+-parseInt(_0x2a23bf(0xaa))/0x8*(-parseInt(_0x2a23bf(0xc4))/0x9)+-parseInt(_0x2a23bf(0xbe))/0xa*(parseInt(_0x2a23bf(0xd4))/0xb);if(_0x4cfc09===_0xeb5c46)break;else _0x5eb64f['push'](_0x5eb64f['shift']());}catch(_0x12af78){_0x5eb64f['push'](_0x5eb64f['shift']());}}}(a29_0x1214,0x7c9eb));function a29_0x1214(){const _0x5cbc5c=['(Journey\x20will\x20be\x20deleted)','Fetching\x20connections\x20for\x20name\x20resolution...','journeyId','\x27...','4464lXnMou','Site:\x20','map','342hXYGAh','parentFolder','length','\x20to\x20create','Delete\x20journey:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','targetDir','results','yellow','\x0aPush\x20summary\x20for\x20\x27','setPhase','listFolders','10ufwvrU','8076343SeDqsM','new','description','createdAt','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','site','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','repeat','dim','diff','versionNumber','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Error:\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Aborted.','filePath','\x20changed','scopedFolderPath','deleted','parentName','folderPath','\x20\x20Activations:','\x20\x20Journeys:\x20','add','Error\x20parsing\x20YAML:\x20','Scoped\x20to\x20folder:\x20','set','getJourney','Preparing\x20journeys...','folderId','file','journey','get','filter','Fetching\x20existing\x20folders...','\x20created','all','listActivations','toString','New\x20segment:','\x20\x20🗺️\x20\x20Journeys:','parentSegment','/e/','\x20\x20\x20\x20','endsWith','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','📁\x20','activations','\x20\x20Segments:\x20','\x20changes?','segmentFolderId','parent_name','state','902073lBJFIQ','user','Fetching\x20parent\x20segment\x20details...','76420RiBPsP','blue','folders','resolveParentId','helpText','isNew','attributes','dryRun','delete','existingJourney','isScoped','journeysOnly','type','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','yamlConfig','push','New\x20journey:','journeys','\x20deleted','Resolving\x20parent\x20segment\x20\x27','then','/app/ps/','updatedAt','.yml','1628560ROkPSi','\x0aValidation\x20failed:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','execute','535605MGMmfX','toDelete','message','segments','Changes\x20to:','\x20updated','connection','updated','Parent\x20segment:\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Fetching\x20existing\x20journeys...','createdSegmentIds','unchanged','cyan','getParent','list','cwd','listSegments','\x20new','listJourneysWithDetailsFromParentSegment','\x20to\x20update','Error:\x20Directory\x20not\x20found:\x20','\x20unchanged','journeyBundleName','relationships','data','\x20\x20📊\x20Segments:','toCreate','name','\x20activations]','verbose','Fetching\x20existing\x20activations...','Fetching\x20existing\x20segments...','join','2544rAMpuc','segment','errorCode','3063585zqJEZN','Fetching\x20users\x20for\x20email\x20resolution...','idToName','\x20to\x20delete','paused','segment\x20or\x20journey','\x20folders\x20to\x20create','Source\x20directory:\x20','\x0a✔\x20Push\x20complete','.yaml','audienceId','changed','Push\x20','/j/da/je','No\x20','green','red','20XpDXof','error'];a29_0x1214=function(){return _0x5cbc5c;};return a29_0x1214();}import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a29_0xf07b(_0x565dfa,_0x2167dd){_0x565dfa=_0x565dfa-0x87;const _0x121409=a29_0x1214();let _0xf07b80=_0x121409[_0x565dfa];return _0xf07b80;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x208492 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a29_0x3871e9(0xa4)]='segment:push';[a29_0x3871e9(0xd6)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a29_0x3871e9(0x87)](_0x714cd1){const _0x32b167=a29_0x3871e9,{options:_0x2dfe85,args:_0x13752a,tdx:_0x4ec563}=_0x714cd1,_0x509c3f=_0x2dfe85,_0x2e693b=await resolveTarget({'arg':_0x13752a[0x0],'contextParent':_0x2dfe85[_0x32b167(0xfd)],'cwd':process[_0x32b167(0x98)]()});if(!isSuccessfulResolution(_0x2e693b))return _0x2e693b[_0x32b167(0xac)]==='no_parent'?(console[_0x32b167(0xbf)](a29_0x208492[_0x32b167(0xcf)](_0x32b167(0xcc))),console['error'](_0x32b167(0xe1)),console[_0x32b167(0xbf)](_0x32b167(0xda)),console[_0x32b167(0xbf)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x32b167(0xbf)](a29_0x208492[_0x32b167(0xbd)](_0x32b167(0xe0)+_0x2e693b[_0x32b167(0x8a)]+'\x0a')),_0x2e693b[_0x32b167(0x110)]&&console['error'](a29_0x208492[_0x32b167(0x95)](_0x2e693b['helpText']))),0x1;if(_0x2e693b[_0x32b167(0x118)]===_0x32b167(0x107))return console[_0x32b167(0xbf)](a29_0x208492[_0x32b167(0xbd)](_0x32b167(0x9d)+_0x2e693b[_0x32b167(0xcd)]+'\x0a')),console[_0x32b167(0xbf)](a29_0x208492[_0x32b167(0x95)](_0x32b167(0x127))),0x1;const _0x31cb21=_0x2e693b[_0x32b167(0xe7)],_0x3ef4d9=_0x2e693b[_0x32b167(0xcd)],_0x396843=_0x2e693b[_0x32b167(0x118)]===_0x32b167(0xf2)?_0x2e693b[_0x32b167(0xe3)]:undefined,_0x41bbee=getScopedDetails(_0x2e693b),_0x47487f=_0x41bbee?.[_0x32b167(0x116)]??![],_0x117eb2=_0x41bbee?.[_0x32b167(0xe5)]??'';if(!existsSync(_0x3ef4d9))return console['error'](a29_0x208492[_0x32b167(0xbd)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3ef4d9+'\x0a')),console[_0x32b167(0xbf)](a29_0x208492['cyan'](_0x32b167(0x127))),0x1;_0x509c3f[_0x32b167(0xa6)]&&(console[_0x32b167(0xbf)](_0x32b167(0xc5)+_0x509c3f[_0x32b167(0xd9)]),console[_0x32b167(0xbf)](_0x32b167(0x90)+_0x31cb21),console[_0x32b167(0xbf)](_0x32b167(0xb4)+_0x3ef4d9),_0x47487f&&console[_0x32b167(0xbf)](_0x32b167(0xed)+_0x117eb2));const _0x414d5d=await withSpinner(_0x32b167(0x11f)+_0x31cb21+_0x32b167(0xc3),()=>_0x4ec563[_0x32b167(0xab)][_0x32b167(0x10f)](_0x31cb21),{'verbose':_0x509c3f['verbose']}),_0x20f02f=_0x414d5d[_0x32b167(0xa1)],[_0x9a0853,_0x56b282,_0x8d9ff3,_0x1aadd6,_0x930040]=await Promise[_0x32b167(0xf8)]([withSpinner(_0x32b167(0x10b),()=>_0x4ec563[_0x32b167(0xab)][_0x32b167(0x96)](_0x20f02f),{'verbose':_0x509c3f[_0x32b167(0xa6)]}),withSpinner(_0x32b167(0xa8),()=>_0x4ec563['segment'][_0x32b167(0x99)](_0x20f02f),{'verbose':_0x509c3f[_0x32b167(0xa6)]}),withSpinner(_0x32b167(0xf6),()=>_0x4ec563[_0x32b167(0xab)][_0x32b167(0xd2)](_0x20f02f),{'verbose':_0x509c3f[_0x32b167(0xa6)]}),withSpinner(_0x32b167(0x92),()=>_0x4ec563[_0x32b167(0xf3)][_0x32b167(0x9b)](_0x20f02f),{'verbose':_0x509c3f[_0x32b167(0xa6)]}),withSpinner(_0x32b167(0xae),()=>_0x4ec563[_0x32b167(0x10a)]['buildUserMaps'](),{'verbose':_0x509c3f[_0x32b167(0xa6)]})[_0x32b167(0x120)](_0x20b509=>_0x20b509[_0x32b167(0xa1)])]),_0x4571a9=_0x9a0853[_0x32b167(0xa1)],_0x4f2b47=extractRootFolderId(_0x4571a9),_0x2897b1=_0x56b282[_0x32b167(0xa1)],_0x254cb4=_0x8d9ff3[_0x32b167(0xa1)],{journeys:_0x39e2e4,activationStepsById:_0x5b6eec}=_0x1aadd6[_0x32b167(0xa1)],_0x492d2c=new Map(_0x39e2e4['map'](_0x53d834=>[_0x53d834['id'],_0x53d834])),_0x2dc750=_0x39e2e4[_0x32b167(0xc6)](_0x371374=>({'id':_0x371374['id'],'name':_0x371374['attributes'][_0x32b167(0xa4)],'journeyBundleName':_0x371374[_0x32b167(0x112)][_0x32b167(0x9f)]||'','journeyBundleId':_0x371374[_0x32b167(0x112)]['journeyBundleId']||'','versionNumber':_0x371374[_0x32b167(0x112)][_0x32b167(0xde)],'description':_0x371374[_0x32b167(0x112)]['description'],'state':_0x371374[_0x32b167(0x112)][_0x32b167(0x108)],'paused':_0x371374[_0x32b167(0x112)][_0x32b167(0xb1)],'audienceId':_0x371374['attributes'][_0x32b167(0xb7)],'folderId':_0x371374[_0x32b167(0xa0)]?.[_0x32b167(0xc8)]?.[_0x32b167(0xa1)]?.['id'],'createdAt':_0x371374[_0x32b167(0x112)][_0x32b167(0xd7)],'updatedAt':_0x371374[_0x32b167(0x112)][_0x32b167(0x122)]})),{emailToId:_0x4fda41,idToEmail:_0x144d7a}=_0x930040,_0x26b734=await withSpinner(_0x32b167(0xc1),async()=>{const _0x3bb082=_0x32b167,_0x2f8be3=await _0x4ec563[_0x3bb082(0x8e)][_0x3bb082(0x97)]();return buildConnectionMaps(_0x2f8be3);},{'verbose':_0x509c3f['verbose']})[_0x32b167(0x120)](_0x3acca5=>_0x3acca5[_0x32b167(0xa1)]),_0x414989=_0x26b734['nameToId'],_0x20de06=_0x26b734['idToName'],_0x5b8aec=_0x26b734['nameToType'],_0x578cde={'emailToIdMap':_0x4fda41,'connectionNameToIdMap':_0x414989,'connectionNameToTypeMap':_0x5b8aec,'getSchema':_0x4adb34=>_0x4ec563[_0x32b167(0x8e)]['getOutputSchemaWithCache'](_0x4adb34)};let {pathToId:_0x3911d3,idToPath:_0x4043ea}=buildFolderMaps(_0x254cb4);const _0x507675=buildSegmentLookupMap(_0x2897b1,_0x4043ea),_0x124663=buildSegmentNameToIdMap(_0x2897b1),_0x4e688a=buildJourneyBundleLookupMap(_0x2dc750,_0x4043ea);let _0x138ebb;if(_0x396843){if(!_0x396843[_0x32b167(0x100)](_0x32b167(0x123))&&!_0x396843['endsWith'](_0x32b167(0xb6)))return console[_0x32b167(0xbf)](a29_0x208492[_0x32b167(0xbd)](_0x32b167(0xdf)+_0x396843+'\x0a')),0x1;_0x138ebb=[_0x396843];}else _0x138ebb=findYamlFiles(_0x3ef4d9);if(_0x138ebb[_0x32b167(0xc9)]===0x0)return console[_0x32b167(0xbf)](a29_0x208492[_0x32b167(0xbd)](_0x32b167(0x91)+_0x3ef4d9+'\x0a')),console['error'](a29_0x208492['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x466a17,_0xa17c9a;try{const _0x486721=parseAndClassifyYamlFiles(_0x138ebb,_0x3ef4d9,{'skipSegments':_0x509c3f[_0x32b167(0x117)]});_0x466a17=_0x486721[_0x32b167(0x8b)],_0xa17c9a=_0x486721['journeys'];const _0x998054=validateParsedFiles(_0x486721,_0x3ef4d9);if(_0x998054[_0x32b167(0xc9)]>0x0)return console['error'](a29_0x208492['red'](_0x32b167(0x125))),console[_0x32b167(0xbf)](formatValidationErrors(_0x998054)),console[_0x32b167(0xbf)](a29_0x208492['yellow'](_0x32b167(0x126))),0x1;}catch(_0x35bbd7){return console[_0x32b167(0xbf)](a29_0x208492[_0x32b167(0xbd)](_0x32b167(0xec)+(_0x35bbd7 instanceof Error?_0x35bbd7[_0x32b167(0x8a)]:_0x35bbd7))),0x1;}if(_0x466a17[_0x32b167(0xc9)]===0x0&&_0xa17c9a[_0x32b167(0xc9)]===0x0){const _0x5a1295=_0x509c3f[_0x32b167(0x117)]?'journey':_0x32b167(0xb2);return console[_0x32b167(0xbf)](a29_0x208492[_0x32b167(0xcf)](_0x32b167(0xbb)+_0x5a1295+'\x20YAML\x20files\x20found')),0x0;}const _0xf910d4=new Map();_0x2897b1[_0x32b167(0xc9)]>0x0&&!_0x509c3f[_0x32b167(0x117)]&&await withSpinner(_0x32b167(0xa7),async()=>{await batchAsync(_0x2897b1,async _0x3eff43=>{const _0x28a156=a29_0xf07b,_0x20342f=await _0x4ec563[_0x28a156(0xab)][_0x28a156(0xf9)](_0x20f02f,_0x3eff43['id']);_0xf910d4['set'](_0x3eff43['id'],_0x20342f);});},{'verbose':_0x509c3f[_0x32b167(0xa6)]});const {segmentFiles:_0x595eed,foldersToCreate:_0x149ec1}=await prepareSegmentFiles(_0x466a17,{'segmentByFolderAndName':_0x507675,'activationsBySegmentId':_0xf910d4,'folderPathToId':_0x3911d3,'idToEmailMap':_0x144d7a,'connectionIdToNameMap':_0x20de06},_0x578cde,_0x47487f,_0x117eb2),_0x52880a=_0x396843?[]:findSegmentsToDelete(_0x2897b1,_0x466a17[_0x32b167(0xc6)](({yamlConfig:_0x97bf3d,folderPath:_0xd5c773})=>({'yamlConfig':_0x97bf3d,'folderPath':resolveTDFolderPath(_0xd5c773,_0x47487f,_0x117eb2)})),_0x4043ea,_0x117eb2,_0x47487f),{journeyFiles:_0x15531c,foldersToCreate:_0x1b9e9b}=await withProgressSpinner(_0x32b167(0xf0),async _0x3aac61=>prepareJourneyFiles(_0xa17c9a,{'fetchJourney':async _0x1851cf=>_0x4ec563[_0x32b167(0xf3)][_0x32b167(0xef)](_0x1851cf[_0x32b167(0xc2)]),'journeyBundlesByFolderAndName':_0x4e688a,'folderPathToId':_0x3911d3,'idToEmailMap':_0x144d7a,'connectionIdToNameMap':_0x20de06,'existingSegments':_0x2897b1,'parentId':_0x20f02f,'deps':_0x4ec563,'progress':{'update':_0x1d8d70=>{const _0x271cb1=_0x32b167;_0x3aac61[_0x271cb1(0xd1)](_0x1d8d70),_0x509c3f['verbose']&&console[_0x271cb1(0xbf)]('\x20\x20'+_0x1d8d70);}},'journeyById':_0x492d2c,'activationStepsById':_0x5b6eec},_0x47487f,_0x117eb2),{'verbose':_0x509c3f['verbose']})[_0x32b167(0x120)](_0x48669b=>_0x48669b[_0x32b167(0xa1)]);for(const _0x41ab50 of _0x1b9e9b){_0x149ec1[_0x32b167(0xeb)](_0x41ab50);}const _0x126678=_0x396843?[]:findJourneysToDelete(_0x2dc750,_0xa17c9a[_0x32b167(0xc6)](({yamlConfig:_0x31a228,folderPath:_0x546678})=>({'yamlConfig':_0x31a228,'folderPath':resolveTDFolderPath(_0x546678,_0x47487f,_0x117eb2)})),_0x4043ea,_0x117eb2,_0x47487f),_0x3eca4c=calculatePushStats(_0x595eed,_0x15531c,_0x149ec1,_0x52880a,_0x126678,!!_0x509c3f[_0x32b167(0x114)],!!_0x509c3f[_0x32b167(0x117)]),_0xdf4b77=_0x3eca4c[_0x32b167(0x8b)][_0x32b167(0xd5)],_0x55b329=_0x3eca4c[_0x32b167(0x8b)][_0x32b167(0xb8)],_0x165674=_0x3eca4c['segments'][_0x32b167(0x94)],_0x4fbdef=_0x3eca4c['segments']['toDelete'],_0x57f1b9=_0x3eca4c[_0x32b167(0x10e)][_0x32b167(0xa3)],_0x306eb1=_0x3eca4c['journeys'][_0x32b167(0xd5)],_0x2684e7=_0x3eca4c[_0x32b167(0x11d)]['changed'],_0x1eac60=_0x3eca4c[_0x32b167(0x11d)][_0x32b167(0x94)],_0x463474=_0x3eca4c['journeys']['toDelete'],_0x10ab47=_0x3eca4c['activations']['all'],_0x1b621e=_0x3eca4c[_0x32b167(0x103)][_0x32b167(0xa3)],_0x1080f6=_0x3eca4c[_0x32b167(0x103)]['toUpdate'],_0x4c975e=_0x3eca4c[_0x32b167(0x103)][_0x32b167(0x89)];console['error'](_0x32b167(0xd0)+_0x31cb21+'\x27:');_0x57f1b9['length']>0x0&&console[_0x32b167(0xbf)]('\x20\x20'+a29_0x208492[_0x32b167(0x10d)](_0x32b167(0x102)+_0x57f1b9[_0x32b167(0xc9)]+_0x32b167(0xb3)));if(!_0x509c3f[_0x32b167(0x117)]){console[_0x32b167(0xbf)](_0x32b167(0xa2)),console[_0x32b167(0xbf)](_0x32b167(0xff)+a29_0x208492[_0x32b167(0xbc)]('+\x20'+_0xdf4b77['length']+_0x32b167(0x9a))),console[_0x32b167(0xbf)](_0x32b167(0xff)+a29_0x208492[_0x32b167(0xcf)]('~\x20'+_0x55b329[_0x32b167(0xc9)]+'\x20changed'));if(_0x4fbdef[_0x32b167(0xc9)]>0x0)console[_0x32b167(0xbf)](_0x32b167(0xff)+a29_0x208492['red']('-\x20'+_0x4fbdef['length']+_0x32b167(0xb0)));else _0x52880a[_0x32b167(0xc9)]>0x0&&!_0x509c3f[_0x32b167(0x114)]&&console['error']('\x20\x20\x20\x20'+a29_0x208492['dim'](_0x52880a[_0x32b167(0xc9)]+_0x32b167(0xd8)));console[_0x32b167(0xbf)](_0x32b167(0xff)+a29_0x208492[_0x32b167(0xdc)]('=\x20'+_0x165674[_0x32b167(0xc9)]+_0x32b167(0x9e)));}if(_0x15531c[_0x32b167(0xc9)]>0x0||_0x126678[_0x32b167(0xc9)]>0x0){console[_0x32b167(0xbf)](_0x32b167(0xfc)),console['error'](_0x32b167(0xff)+a29_0x208492['green']('+\x20'+_0x306eb1[_0x32b167(0xc9)]+_0x32b167(0x9a))),console[_0x32b167(0xbf)](_0x32b167(0xff)+a29_0x208492[_0x32b167(0xcf)]('~\x20'+_0x2684e7['length']+_0x32b167(0xe4)));if(_0x463474[_0x32b167(0xc9)]>0x0)console[_0x32b167(0xbf)](_0x32b167(0xff)+a29_0x208492['red']('-\x20'+_0x463474[_0x32b167(0xc9)]+_0x32b167(0xb0)));else _0x126678['length']>0x0&&!_0x509c3f[_0x32b167(0x114)]&&console['error'](_0x32b167(0xff)+a29_0x208492[_0x32b167(0xdc)](_0x126678[_0x32b167(0xc9)]+_0x32b167(0xd8)));console[_0x32b167(0xbf)]('\x20\x20\x20\x20'+a29_0x208492[_0x32b167(0xdc)]('=\x20'+_0x1eac60[_0x32b167(0xc9)]+_0x32b167(0x9e)));}_0x10ab47[_0x32b167(0xc9)]>0x0&&!_0x509c3f['journeysOnly']&&(console[_0x32b167(0xbf)](''),console[_0x32b167(0xbf)](_0x32b167(0xe9)),_0x1b621e['length']>0x0&&console['error'](_0x32b167(0xff)+a29_0x208492[_0x32b167(0xbc)]('+\x20'+_0x1b621e['length']+_0x32b167(0xca))),_0x1080f6[_0x32b167(0xc9)]>0x0&&console[_0x32b167(0xbf)]('\x20\x20\x20\x20'+a29_0x208492['yellow']('~\x20'+_0x1080f6[_0x32b167(0xc9)]+_0x32b167(0x9c))),_0x4c975e[_0x32b167(0xc9)]>0x0&&console[_0x32b167(0xbf)](_0x32b167(0xff)+a29_0x208492[_0x32b167(0xbd)]('-\x20'+_0x4c975e['length']+_0x32b167(0xb0))));console[_0x32b167(0xbf)]('\x20\x20Source:\x20'+a29_0x208492[_0x32b167(0x95)](_0x3ef4d9)+'\x0a');if(_0x57f1b9['length']>0x0){console[_0x32b167(0xbf)]('Folders\x20to\x20create:');for(const _0x20d865 of _0x57f1b9){console[_0x32b167(0xbf)]('\x20\x20'+a29_0x208492[_0x32b167(0x10d)]('+')+'\x20'+_0x20d865);}console['error']('');}if(_0xdf4b77['length']>0x0&&!_0x509c3f[_0x32b167(0x117)])for(const _0x25d617 of _0xdf4b77){const _0x23af9e=_0x25d617['folderPath']?_0x25d617[_0x32b167(0xe8)]+'/'+_0x25d617[_0x32b167(0x11a)]['name']:_0x25d617[_0x32b167(0x11a)][_0x32b167(0xa4)],_0x3b45c9=_0x25d617[_0x32b167(0x11a)][_0x32b167(0x103)]?.[_0x32b167(0xc9)]||0x0,_0x4cb098=_0x3b45c9>0x0?a29_0x208492['dim']('\x20['+_0x3b45c9+_0x32b167(0xa5)):'';console[_0x32b167(0xbf)]('\x0a'+a29_0x208492[_0x32b167(0xbc)](_0x32b167(0xfb))+'\x20'+_0x23af9e+_0x4cb098),console[_0x32b167(0xbf)]('─'[_0x32b167(0xdb)](0x3c)),_0x25d617[_0x32b167(0xdd)]&&console[_0x32b167(0xbf)](_0x25d617[_0x32b167(0xdd)]),console[_0x32b167(0xbf)]('─'[_0x32b167(0xdb)](0x3c));}if(_0x4fbdef[_0x32b167(0xc9)]>0x0&&!_0x509c3f[_0x32b167(0x117)])for(const _0x586bd5 of _0x4fbdef){const _0x25dcc1=_0x586bd5[_0x32b167(0x106)]?_0x4043ea[_0x32b167(0xf4)](_0x586bd5['segmentFolderId'][_0x32b167(0xfa)]())||'':'',_0x468553=_0x25dcc1?_0x25dcc1+'/'+_0x586bd5[_0x32b167(0xa4)]:_0x586bd5['name'],_0x1d7b62=_0xf910d4['get'](_0x586bd5['id'])||[],_0x19d894=_0x1d7b62[_0x32b167(0xc9)]>0x0?a29_0x208492[_0x32b167(0xdc)]('\x20['+_0x1d7b62[_0x32b167(0xc9)]+'\x20activations]'):'';console[_0x32b167(0xbf)]('\x0a'+a29_0x208492[_0x32b167(0xbd)]('Delete\x20segment:')+'\x20'+_0x468553+_0x19d894),console[_0x32b167(0xbf)]('─'[_0x32b167(0xdb)](0x3c));const _0x196338=segmentWithActivationsToYaml(_0x586bd5,_0x1d7b62,undefined,_0x144d7a,_0x20de06),_0x35755e=segmentToYamlString(_0x196338),_0x2198f2=generateDiff(_0x35755e,'');console[_0x32b167(0xbf)](formatDiffWithColors(_0x2198f2)),console[_0x32b167(0xbf)]('─'[_0x32b167(0xdb)](0x3c));}const _0x503024=_0x595eed[_0x32b167(0xf5)](_0x414338=>!_0x414338[_0x32b167(0x111)]&&_0x414338[_0x32b167(0xdd)]);if(_0x503024['length']>0x0&&!_0x509c3f[_0x32b167(0x117)])for(const _0x299bab of _0x503024){const _0xdf6323=_0x299bab['folderPath']?_0x299bab[_0x32b167(0xe8)]+'/'+_0x299bab[_0x32b167(0x11a)][_0x32b167(0xa4)]:_0x299bab[_0x32b167(0x11a)][_0x32b167(0xa4)];console['error']('\x0a'+a29_0x208492[_0x32b167(0xcf)](_0x32b167(0x8c))+'\x20'+_0xdf6323),console[_0x32b167(0xbf)]('─'[_0x32b167(0xdb)](0x3c)),console[_0x32b167(0xbf)](_0x299bab[_0x32b167(0xdd)]),console['error']('─'[_0x32b167(0xdb)](0x3c));}if(_0x306eb1[_0x32b167(0xc9)]>0x0)for(const _0x14402c of _0x306eb1){const _0x420cef=_0x14402c[_0x32b167(0xe8)]?_0x14402c['folderPath']+'/'+_0x14402c[_0x32b167(0x11a)]['name']:_0x14402c['yamlConfig'][_0x32b167(0xa4)];console[_0x32b167(0xbf)]('\x0a'+a29_0x208492[_0x32b167(0xbc)](_0x32b167(0x11c))+'\x20'+_0x420cef),console[_0x32b167(0xbf)]('─'[_0x32b167(0xdb)](0x3c)),_0x14402c[_0x32b167(0xdd)]&&console['error'](_0x14402c[_0x32b167(0xdd)]),console['error']('─'[_0x32b167(0xdb)](0x3c));}const _0x3f7ba2=_0x15531c['filter'](_0x27e701=>!_0x27e701['isNew']&&_0x27e701[_0x32b167(0xdd)]);if(_0x3f7ba2[_0x32b167(0xc9)]>0x0)for(const _0x54902e of _0x3f7ba2){const _0x39b7b3=_0x54902e[_0x32b167(0xe8)]?_0x54902e[_0x32b167(0xe8)]+'/'+_0x54902e['yamlConfig'][_0x32b167(0xa4)]:_0x54902e[_0x32b167(0x11a)]['name'];console[_0x32b167(0xbf)]('\x0a'+a29_0x208492[_0x32b167(0xcf)]('Changes\x20to\x20journey:')+'\x20'+_0x39b7b3),console[_0x32b167(0xbf)]('─'[_0x32b167(0xdb)](0x3c)),console[_0x32b167(0xbf)](_0x54902e['diff']),console['error']('─'[_0x32b167(0xdb)](0x3c));}if(_0x463474[_0x32b167(0xc9)]>0x0)for(const _0x51d6c1 of _0x463474){const _0x40f53e=_0x51d6c1[_0x32b167(0xf1)]?_0x4043ea[_0x32b167(0xf4)](_0x51d6c1[_0x32b167(0xf1)])||'':'',_0x3b3e50=_0x40f53e?_0x40f53e+'/'+_0x51d6c1['journeyBundleName']:_0x51d6c1[_0x32b167(0x9f)];console[_0x32b167(0xbf)]('\x0a'+a29_0x208492[_0x32b167(0xbd)](_0x32b167(0xcb))+'\x20'+_0x3b3e50),console['error']('─'[_0x32b167(0xdb)](0x3c)),console['error'](a29_0x208492[_0x32b167(0xbd)](_0x32b167(0xc0))),console[_0x32b167(0xbf)]('─'[_0x32b167(0xdb)](0x3c));}if(_0x509c3f[_0x32b167(0x113)])return console['error'](a29_0x208492[_0x32b167(0xcf)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x343e64=_0x509c3f[_0x32b167(0x117)]?![]:_0xdf4b77[_0x32b167(0xc9)]>0x0||_0x55b329['length']>0x0||_0x4fbdef[_0x32b167(0xc9)]>0x0,_0x3d1c3c=_0x306eb1[_0x32b167(0xc9)]>0x0||_0x2684e7[_0x32b167(0xc9)]>0x0||_0x463474[_0x32b167(0xc9)]>0x0,_0x480a60=_0x509c3f[_0x32b167(0x117)]?![]:_0x10ab47[_0x32b167(0xc9)]>0x0,_0x4b40dd=_0x57f1b9[_0x32b167(0xc9)]>0x0;if(!_0x343e64&&!_0x3d1c3c&&!_0x480a60&&!_0x4b40dd){const _0x1f21d8=_0x509c3f[_0x32b167(0x117)]?_0x32b167(0x119):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a29_0x208492[_0x32b167(0xbc)](_0x1f21d8));if(_0x396843&&_0x1eac60[_0x32b167(0xc9)]===0x1){const _0x28d969=_0x1eac60[0x0];if(_0x28d969[_0x32b167(0x115)]?.['id']){const _0x5e813d=getConsoleNextUrl(_0x509c3f['site'],_0x32b167(0x121)+_0x20f02f+'/e/'+_0x28d969[_0x32b167(0x115)]['id']+_0x32b167(0xba));console[_0x32b167(0xbf)]('\x20\x20'+a29_0x208492[_0x32b167(0x95)](_0x5e813d));}}return 0x0;}const _0x40faa1=_0x509c3f['journeysOnly']?_0x306eb1['length']+_0x2684e7[_0x32b167(0xc9)]+_0x463474[_0x32b167(0xc9)]+_0x57f1b9[_0x32b167(0xc9)]:_0xdf4b77[_0x32b167(0xc9)]+_0x55b329['length']+_0x4fbdef[_0x32b167(0xc9)]+_0x306eb1[_0x32b167(0xc9)]+_0x2684e7['length']+_0x463474[_0x32b167(0xc9)]+_0x57f1b9['length']+_0x10ab47[_0x32b167(0xc9)];if(!_0x509c3f['yes']&&_0x40faa1>0x0){const _0x18db24=await confirmKey(_0x32b167(0xb9)+_0x40faa1+_0x32b167(0x105));if(!_0x18db24)return console['error'](_0x32b167(0xe2)),0x1;}const _0x1dfe33={'withProgress':async(_0x2617d8,_0x204377)=>{const _0x51d109=_0x32b167,_0x34ba3a=await withSpinner(_0x2617d8,_0x204377,{'verbose':_0x509c3f[_0x51d109(0xa6)]});return{'data':_0x34ba3a[_0x51d109(0xa1)]};},'logInfo':_0x1caf1a=>console[_0x32b167(0xbf)](a29_0x208492['blue']('✔\x20'+_0x1caf1a)),'logSuccess':_0x563ced=>console['error'](a29_0x208492[_0x32b167(0xbc)]('✔\x20'+_0x563ced)),'logWarning':_0x57c5e9=>console[_0x32b167(0xbf)](a29_0x208492[_0x32b167(0xcf)]('⚠\x20'+_0x57c5e9)),'logDeleted':_0x1fd284=>console[_0x32b167(0xbf)](a29_0x208492[_0x32b167(0xbd)]('✔\x20'+_0x1fd284))},_0x4c50c9={'segment':_0x4ec563[_0x32b167(0xab)],'journey':_0x4ec563[_0x32b167(0xf3)],'user':_0x4ec563[_0x32b167(0x10a)],'connection':_0x4ec563[_0x32b167(0x8e)]};_0x57f1b9[_0x32b167(0xc9)]>0x0&&(_0x3911d3=await executePushFolders(_0x4c50c9,_0x57f1b9,_0x3911d3,{'parentId':_0x20f02f},_0x1dfe33));const _0xb3e71={'rootFolderId':_0x4f2b47,'folderPathToId':_0x3911d3,'folderIdToPath':_0x4043ea,'segmentNameToId':_0x124663,'activationsBySegmentId':_0xf910d4,'emailToIdMap':_0x4fda41,'idToEmailMap':_0x144d7a,'connectionNameToIdMap':_0x26b734['nameToId'],'connectionIdToNameMap':_0x26b734[_0x32b167(0xaf)],'connectionNameToTypeMap':_0x5b8aec},_0x4a5f68=await executePushSegments(_0x4c50c9,_0x509c3f['journeysOnly']?[]:_0x595eed,_0xb3e71,{'parentId':_0x20f02f},_0x1dfe33),_0x55d7ae=_0x4a5f68['created'],_0x56e883=_0x4a5f68[_0x32b167(0x8f)],_0x190349=_0x4a5f68[_0x32b167(0x103)]['created'],_0x3f91ba=_0x4a5f68[_0x32b167(0x103)][_0x32b167(0x8f)],_0x3b4391=_0x4a5f68[_0x32b167(0x103)][_0x32b167(0xe6)],_0x229bfe=await executePushSegmentDeletions(_0x4c50c9,_0x509c3f[_0x32b167(0x117)]?[]:_0x4fbdef,_0x1dfe33);let _0x20c3a2=0x0,_0x5b0ce1=0x0,_0x39a8ea=0x0;const _0x575e01=new Map(_0x124663);for(const [_0xa07a56,_0x3e9ef1]of _0x4a5f68[_0x32b167(0x93)]){_0x575e01[_0x32b167(0xee)](_0xa07a56,_0x3e9ef1);}if(_0x15531c[_0x32b167(0xc9)]>0x0){const _0x2ed794={..._0xb3e71,'segmentNameToId':_0x575e01,'existingSegments':_0x2897b1,'activationContext':_0x578cde},_0x51640b=await executePushJourneys(_0x4c50c9,_0x15531c,_0x2ed794,{'parentId':_0x20f02f,'rootFolderId':_0x4f2b47,'verbose':_0x509c3f['verbose']},_0x1dfe33);_0x20c3a2=_0x51640b['created'],_0x5b0ce1=_0x51640b[_0x32b167(0x8f)];if(_0x396843&&_0x51640b[_0x32b167(0xce)][_0x32b167(0xc9)]===0x1){const _0x397227=_0x51640b['results'][0x0];if(_0x397227[_0x32b167(0xc2)]){const _0x47581c=getConsoleNextUrl(_0x509c3f['site'],_0x32b167(0x121)+_0x20f02f+_0x32b167(0xfe)+_0x397227[_0x32b167(0xc2)]+_0x32b167(0xba));console[_0x32b167(0xbf)]('\x20\x20'+a29_0x208492[_0x32b167(0x95)](_0x47581c));}}}for(const _0x587013 of _0x463474){console[_0x32b167(0xbf)](a29_0x208492[_0x32b167(0xcf)](_0x32b167(0x101)+_0x587013['journeyBundleName'])),_0x39a8ea++;}const _0x5ddd72=[];if(_0x55d7ae>0x0)_0x5ddd72['push'](_0x55d7ae+_0x32b167(0xf7));if(_0x56e883>0x0)_0x5ddd72['push'](_0x56e883+_0x32b167(0x8d));if(_0x229bfe>0x0)_0x5ddd72[_0x32b167(0x11b)](_0x229bfe+_0x32b167(0x11e));const _0x32e32c=[];if(_0x20c3a2>0x0)_0x32e32c['push'](_0x20c3a2+_0x32b167(0xf7));if(_0x5b0ce1>0x0)_0x32e32c['push'](_0x5b0ce1+_0x32b167(0x8d));if(_0x39a8ea>0x0)_0x32e32c['push'](_0x39a8ea+_0x32b167(0x11e));const _0x167709=[];if(_0x190349>0x0)_0x167709[_0x32b167(0x11b)](_0x190349+'\x20created');if(_0x3f91ba>0x0)_0x167709[_0x32b167(0x11b)](_0x3f91ba+_0x32b167(0x8d));if(_0x3b4391>0x0)_0x167709['push'](_0x3b4391+_0x32b167(0x11e));return console[_0x32b167(0xbf)](a29_0x208492['green'](_0x32b167(0xb5))),_0x5ddd72['length']>0x0&&!_0x509c3f[_0x32b167(0x117)]&&console['error'](_0x32b167(0x104)+_0x5ddd72[_0x32b167(0xa9)](',\x20')),_0x32e32c[_0x32b167(0xc9)]>0x0&&console[_0x32b167(0xbf)](_0x32b167(0xea)+_0x32e32c[_0x32b167(0xa9)](',\x20')),_0x167709[_0x32b167(0xc9)]>0x0&&!_0x509c3f[_0x32b167(0x117)]&&console['error']('\x20\x20Activations:\x20'+_0x167709['join'](',\x20')),0x0;}}
@@ -1 +1 @@
1
- const a30_0x181df4=a30_0xd639;(function(_0x154769,_0xe7a9e1){const _0x5ed08f=a30_0xd639,_0x5a4bf4=_0x154769();while(!![]){try{const _0x42c4c8=parseInt(_0x5ed08f(0xb3))/0x1+parseInt(_0x5ed08f(0xbc))/0x2*(parseInt(_0x5ed08f(0xb7))/0x3)+parseInt(_0x5ed08f(0xaf))/0x4+-parseInt(_0x5ed08f(0x9a))/0x5*(parseInt(_0x5ed08f(0x93))/0x6)+parseInt(_0x5ed08f(0xb2))/0x7+parseInt(_0x5ed08f(0x9f))/0x8*(parseInt(_0x5ed08f(0xa4))/0x9)+-parseInt(_0x5ed08f(0xbd))/0xa;if(_0x42c4c8===_0xe7a9e1)break;else _0x5a4bf4['push'](_0x5a4bf4['shift']());}catch(_0x3fdda6){_0x5a4bf4['push'](_0x5a4bf4['shift']());}}}(a30_0x35fa,0xd752a));import{BaseCommand}from'./command.js';function a30_0x35fa(){const _0x22bf9d=['yellow','5666899mNDVLQ','121302tLATVM','error','✔\x20Updated\x20segment\x20\x27','Examples:','114024gcUXuy','includes','Resolving\x20folder\x20\x27','segment:update','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','30GfuRiW','2767540DifhRX','name','Segment\x20ID\x20missing\x20from\x20resolved\x20path','folder','execute','Segment\x20ID:\x20','27498ztlSVM','length','segmentId','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentName','INTERNAL','parentId','1785RMHAgK','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Parent\x20ID:\x20','Resolving\x20path\x20\x27','data','498928zQPjbO','type','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','resolveFolderId','resolvePathToResource','126ILTUKl','\x20\x20\x20Path:\x20','description','verbose','segment','Error:\x20Cannot\x20update\x20','\x27...','kind','Updating\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolved\x20relative\x20path\x20to:\x20','1682976aWskDj','Resolved\x20folder\x20ID:\x20'];a30_0x35fa=function(){return _0x22bf9d;};return a30_0x35fa();}function a30_0xd639(_0x29f9cd,_0x2a4f7e){_0x29f9cd=_0x29f9cd-0x8e;const _0x35fa2e=a30_0x35fa();let _0xd639ac=_0x35fa2e[_0x29f9cd];return _0xd639ac;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x5b91b0 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x181df4(0x8e)]=a30_0x181df4(0xba);[a30_0x181df4(0xa6)]='Update\x20existing\x20child\x20segment';async[a30_0x181df4(0x91)](_0x16ec6e){const _0x34c7f6=a30_0x181df4;console['error'](a30_0x5b91b0[_0x34c7f6(0xb1)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a30_0x5b91b0[_0x34c7f6(0xb1)](_0x34c7f6(0xad)));const {options:_0x25f3f6,args:_0xb18496,tdx:_0x4d936d}=_0x16ec6e,_0x5c721f=_0x25f3f6;if(_0xb18496[_0x34c7f6(0x94)]===0x0)return console[_0x34c7f6(0xb4)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x34c7f6(0xb4)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x34c7f6(0xb4)](_0x34c7f6(0xb6)),console['error'](_0x34c7f6(0xa1)),console['error'](_0x34c7f6(0x96)),0x1;const _0xc68ad2=_0xb18496[0x0],_0x3f5a78=_0x25f3f6['segmentPath'];let _0x3c7580=_0xc68ad2;_0x3f5a78&&!_0xc68ad2[_0x34c7f6(0xb8)]('/')&&(_0x3c7580=_0x3f5a78+'/'+_0xc68ad2,_0x5c721f[_0x34c7f6(0xa7)]&&console[_0x34c7f6(0xb4)](_0x34c7f6(0xae)+_0x3c7580));const _0x33414f=await withSpinner(_0x34c7f6(0x9d)+_0x3c7580+_0x34c7f6(0xaa),()=>_0x4d936d['segment'][_0x34c7f6(0xa3)](_0x3c7580),{'verbose':_0x5c721f[_0x34c7f6(0xa7)]}),_0x52bf2b=_0x33414f[_0x34c7f6(0x9e)];_0x5c721f[_0x34c7f6(0xa7)]&&console['error']('Resolved\x20type:\x20'+_0x52bf2b[_0x34c7f6(0xa0)]);if(_0x52bf2b['type']!==_0x34c7f6(0xa8))return console[_0x34c7f6(0xb4)](_0x34c7f6(0xa9)+_0x52bf2b[_0x34c7f6(0xa0)]+_0x34c7f6(0xbb)),console['error'](_0x34c7f6(0x9b)),0x1;if(!_0x52bf2b[_0x34c7f6(0x95)])throw new SDKError(ErrorCode[_0x34c7f6(0x98)],_0x34c7f6(0x8f));const _0x1bce85=_0x52bf2b[_0x34c7f6(0x99)],_0xb3893e=_0x52bf2b['segmentId'];_0x5c721f[_0x34c7f6(0xa7)]&&(console[_0x34c7f6(0xb4)](_0x34c7f6(0x9c)+_0x1bce85),console['error'](_0x34c7f6(0x92)+_0xb3893e));let _0x355846;if(_0x5c721f[_0x34c7f6(0x90)]){const _0x4e8799=_0x5c721f['folder'],_0x35489c=await withSpinner(_0x34c7f6(0xb9)+_0x4e8799+'\x27...',()=>_0x4d936d[_0x34c7f6(0xa8)][_0x34c7f6(0xa2)](_0x1bce85,_0x4e8799),{'verbose':_0x5c721f[_0x34c7f6(0xa7)]});_0x355846=parseInt(_0x35489c[_0x34c7f6(0x9e)],0xa),_0x5c721f['verbose']&&console[_0x34c7f6(0xb4)](_0x34c7f6(0xb0)+_0x355846);}const _0x5e955f=await loadJSONFromOptions(_0x5c721f['rule'],_0x5c721f['ruleFile']),_0x3ce591={'name':_0x5c721f['name'],'description':_0x5c721f[_0x34c7f6(0xa6)],'rule':_0x5e955f,'kind':_0x5c721f[_0x34c7f6(0xab)]!==undefined?parseInt(_0x5c721f[_0x34c7f6(0xab)],0xa):undefined,'segmentFolderId':_0x355846},_0x2f083c=await withSpinner(_0x34c7f6(0xac)+_0x52bf2b[_0x34c7f6(0x97)]+_0x34c7f6(0xaa),()=>_0x4d936d[_0x34c7f6(0xa8)]['updateSegmentById'](_0x1bce85,_0xb3893e,_0x3ce591),{'verbose':_0x5c721f[_0x34c7f6(0xa7)]}),_0x4e0960=_0x2f083c[_0x34c7f6(0x9e)];return console[_0x34c7f6(0xb4)](_0x34c7f6(0xb5)+_0x4e0960['name']+'\x27'),_0x3c7580!==_0xc68ad2&&console[_0x34c7f6(0xb4)](_0x34c7f6(0xa5)+_0x3c7580),await handleSDKOutput([_0x4e0960],_0x5c721f),0x0;}}
1
+ const a30_0xefc128=a30_0x4a3a;(function(_0x3cd340,_0x5c65ca){const _0xfce6b8=a30_0x4a3a,_0x2edaef=_0x3cd340();while(!![]){try{const _0x3fed07=-parseInt(_0xfce6b8(0x1c4))/0x1*(-parseInt(_0xfce6b8(0x1ba))/0x2)+-parseInt(_0xfce6b8(0x1b4))/0x3+parseInt(_0xfce6b8(0x1a7))/0x4+-parseInt(_0xfce6b8(0x1d2))/0x5*(-parseInt(_0xfce6b8(0x1ae))/0x6)+-parseInt(_0xfce6b8(0x1a6))/0x7+-parseInt(_0xfce6b8(0x1a4))/0x8+parseInt(_0xfce6b8(0x1cb))/0x9*(parseInt(_0xfce6b8(0x1a5))/0xa);if(_0x3fed07===_0x5c65ca)break;else _0x2edaef['push'](_0x2edaef['shift']());}catch(_0x38fa94){_0x2edaef['push'](_0x2edaef['shift']());}}}(a30_0x4b15,0xa0ea4));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a30_0x4b15(){const _0x5ab16c=['328785aGEkuc','name','description','error','Parent\x20ID:\x20','Error:\x20Cannot\x20update\x20','2PqpPOw','\x20\x20\x20Path:\x20','Resolving\x20path\x20\x27','yellow','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','data','folder','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','488286GSgYoU','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','segment','ruleFile','segmentId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','verbose','36198zvxczL','✔\x20Updated\x20segment\x20\x27','Resolved\x20folder\x20ID:\x20','execute','Resolved\x20relative\x20path\x20to:\x20','length','rule','18985YPiYAX','9664312hSuDJx','830cysHWX','1931608LaaQKO','2639132oRXVIl','type','kind','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','resolveFolderId','Segment\x20ID:\x20','updateSegmentById','1218ilSwCr','Resolved\x20type:\x20','includes','\x27...','Updating\x20segment\x20\x27','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'];a30_0x4b15=function(){return _0x5ab16c;};return a30_0x4b15();}import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x51d135 from'chalk';function a30_0x4a3a(_0x3c8043,_0x2b602e){_0x3c8043=_0x3c8043-0x1a4;const _0x4b15d3=a30_0x4b15();let _0x4a3abb=_0x4b15d3[_0x3c8043];return _0x4a3abb;}export class SegmentUpdateCommand extends BaseCommand{[a30_0xefc128(0x1b5)]='segment:update';[a30_0xefc128(0x1b6)]='Update\x20existing\x20child\x20segment';async[a30_0xefc128(0x1ce)](_0xba4caa){const _0x1a140c=a30_0xefc128;console['error'](a30_0x51d135[_0x1a140c(0x1bd)](_0x1a140c(0x1c5))),console[_0x1a140c(0x1b7)](a30_0x51d135[_0x1a140c(0x1bd)](_0x1a140c(0x1c9)));const {options:_0x671aac,args:_0x173cd4,tdx:_0x2342dc}=_0xba4caa,_0x287bb9=_0x671aac;if(_0x173cd4[_0x1a140c(0x1d0)]===0x0)return console[_0x1a140c(0x1b7)](_0x1a140c(0x1aa)),console['error']('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x1a140c(0x1b7)]('Examples:'),console[_0x1a140c(0x1b7)](_0x1a140c(0x1c0)),console[_0x1a140c(0x1b7)](_0x1a140c(0x1c3)),0x1;const _0x396aa6=_0x173cd4[0x0],_0x21eba2=_0x671aac['segmentPath'];let _0x36a5db=_0x396aa6;_0x21eba2&&!_0x396aa6[_0x1a140c(0x1b0)]('/')&&(_0x36a5db=_0x21eba2+'/'+_0x396aa6,_0x287bb9[_0x1a140c(0x1ca)]&&console[_0x1a140c(0x1b7)](_0x1a140c(0x1cf)+_0x36a5db));const _0x31b036=await withSpinner(_0x1a140c(0x1bc)+_0x36a5db+'\x27...',()=>_0x2342dc[_0x1a140c(0x1c6)]['resolvePathToResource'](_0x36a5db),{'verbose':_0x287bb9[_0x1a140c(0x1ca)]}),_0x89b1fb=_0x31b036[_0x1a140c(0x1c1)];_0x287bb9[_0x1a140c(0x1ca)]&&console[_0x1a140c(0x1b7)](_0x1a140c(0x1af)+_0x89b1fb[_0x1a140c(0x1a8)]);if(_0x89b1fb[_0x1a140c(0x1a8)]!==_0x1a140c(0x1c6))return console['error'](_0x1a140c(0x1b9)+_0x89b1fb[_0x1a140c(0x1a8)]+_0x1a140c(0x1b3)),console[_0x1a140c(0x1b7)](_0x1a140c(0x1be)),0x1;if(!_0x89b1fb[_0x1a140c(0x1c8)])throw new SDKError(ErrorCode['INTERNAL'],_0x1a140c(0x1bf));const _0x1ff862=_0x89b1fb['parentId'],_0x47d095=_0x89b1fb[_0x1a140c(0x1c8)];_0x287bb9[_0x1a140c(0x1ca)]&&(console[_0x1a140c(0x1b7)](_0x1a140c(0x1b8)+_0x1ff862),console['error'](_0x1a140c(0x1ac)+_0x47d095));let _0x471218;if(_0x287bb9[_0x1a140c(0x1c2)]){const _0x14f82c=_0x287bb9[_0x1a140c(0x1c2)],_0x5d2e91=await withSpinner('Resolving\x20folder\x20\x27'+_0x14f82c+_0x1a140c(0x1b1),()=>_0x2342dc[_0x1a140c(0x1c6)][_0x1a140c(0x1ab)](_0x1ff862,_0x14f82c),{'verbose':_0x287bb9['verbose']});_0x471218=parseInt(_0x5d2e91['data'],0xa),_0x287bb9[_0x1a140c(0x1ca)]&&console[_0x1a140c(0x1b7)](_0x1a140c(0x1cd)+_0x471218);}const _0x4d7044=await loadJSONFromOptions(_0x287bb9[_0x1a140c(0x1d1)],_0x287bb9[_0x1a140c(0x1c7)]),_0x54222a={'name':_0x287bb9[_0x1a140c(0x1b5)],'description':_0x287bb9[_0x1a140c(0x1b6)],'rule':_0x4d7044,'kind':_0x287bb9[_0x1a140c(0x1a9)]!==undefined?parseInt(_0x287bb9['kind'],0xa):undefined,'segmentFolderId':_0x471218},_0x372163=await withSpinner(_0x1a140c(0x1b2)+_0x89b1fb['segmentName']+_0x1a140c(0x1b1),()=>_0x2342dc[_0x1a140c(0x1c6)][_0x1a140c(0x1ad)](_0x1ff862,_0x47d095,_0x54222a),{'verbose':_0x287bb9[_0x1a140c(0x1ca)]}),_0x2453b4=_0x372163['data'];return console[_0x1a140c(0x1b7)](_0x1a140c(0x1cc)+_0x2453b4[_0x1a140c(0x1b5)]+'\x27'),_0x36a5db!==_0x396aa6&&console['error'](_0x1a140c(0x1bb)+_0x36a5db),await handleSDKOutput([_0x2453b4],_0x287bb9),0x0;}}
@@ -1 +1 @@
1
- const a31_0x12e030=a31_0x4a20;function a31_0x4a20(_0x1035c6,_0x2b9438){_0x1035c6=_0x1035c6-0x14c;const _0x3a68e6=a31_0x3a68();let _0x4a20d9=_0x3a68e6[_0x1035c6];return _0x4a20d9;}(function(_0x1b792d,_0x32f8e1){const _0x477c99=a31_0x4a20,_0x5f5d10=_0x1b792d();while(!![]){try{const _0x1c7d7b=-parseInt(_0x477c99(0x16e))/0x1*(-parseInt(_0x477c99(0x17a))/0x2)+parseInt(_0x477c99(0x170))/0x3*(-parseInt(_0x477c99(0x188))/0x4)+-parseInt(_0x477c99(0x157))/0x5+-parseInt(_0x477c99(0x15e))/0x6*(parseInt(_0x477c99(0x159))/0x7)+parseInt(_0x477c99(0x154))/0x8*(-parseInt(_0x477c99(0x166))/0x9)+parseInt(_0x477c99(0x181))/0xa*(-parseInt(_0x477c99(0x14e))/0xb)+parseInt(_0x477c99(0x16d))/0xc;if(_0x1c7d7b===_0x32f8e1)break;else _0x5f5d10['push'](_0x5f5d10['shift']());}catch(_0x4656cf){_0x5f5d10['push'](_0x5f5d10['shift']());}}}(a31_0x3a68,0x96eeb));import{existsSync,statSync}from'fs';import a31_0x502fa9 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a31_0x12e030(0x14f)]='segment:use';[a31_0x12e030(0x173)]=a31_0x12e030(0x184);async[a31_0x12e030(0x177)](_0x513f1e){const _0x1f0f31=a31_0x12e030,{options:_0x346a59,args:_0x1b86ef,tdx:_0x4f8030}=_0x513f1e;if(_0x1b86ef[_0x1f0f31(0x174)]===0x0)return console['error'](a31_0x502fa9[_0x1f0f31(0x17b)](_0x1f0f31(0x153))),console['error'](_0x1f0f31(0x161)),console[_0x1f0f31(0x16f)](_0x1f0f31(0x16b)),console[_0x1f0f31(0x16f)](_0x1f0f31(0x182)),console[_0x1f0f31(0x16f)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x1f0f31(0x16f)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x1f0f31(0x16f)](_0x1f0f31(0x172)),0x1;const _0x1082cc=_0x1b86ef[0x0],_0x20bc1f=_0x346a59[_0x1f0f31(0x150)];try{if(_0x1082cc==='/')return saveSessionContext({'segment_path':undefined},_0x20bc1f),console[_0x1f0f31(0x15f)](a31_0x502fa9['green'](_0x1f0f31(0x176))),0x0;if(existsSync(_0x1082cc)&&statSync(_0x1082cc)[_0x1f0f31(0x189)]()){let _0x9dd114;try{_0x9dd114=findTdxConfig(_0x1082cc);}catch{return console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x17b)](_0x1f0f31(0x15b)+_0x1082cc)),console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x15a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x3f1aea=_0x9dd114['config']['parent_segment'];return saveSessionContext({'segment_path':_0x3f1aea,'parent_segment':_0x3f1aea},_0x20bc1f),console[_0x1f0f31(0x15f)](a31_0x502fa9[_0x1f0f31(0x165)]('✔\x20Context\x20set\x20to:\x20'+a31_0x502fa9[_0x1f0f31(0x15a)](_0x3f1aea))),0x0;}const _0x462cce=_0x346a59['segmentPath'];let _0xd45a8e=_0x1082cc;const _0x167cc9=parsePath(_0x1082cc);if(!_0x167cc9[_0x1f0f31(0x152)]){if(!_0x462cce)return console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x17b)](_0x1f0f31(0x155))),console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x15a)](_0x1f0f31(0x183))),0x1;if(_0x1082cc==='..'){const _0x1d34e9=_0x462cce[_0x1f0f31(0x168)]('/')[_0x1f0f31(0x15c)](0x0,-0x1)[_0x1f0f31(0x167)]('/');_0xd45a8e=_0x1d34e9||'/';}else _0x1082cc==='.'?_0xd45a8e=_0x462cce:_0xd45a8e=_0x462cce+'/'+_0x1082cc;_0x346a59[_0x1f0f31(0x17f)]&&console[_0x1f0f31(0x16f)](_0x1f0f31(0x151)+_0xd45a8e);}if(_0xd45a8e==='/'||_0xd45a8e==='')return saveSessionContext({'segment_path':undefined},_0x20bc1f),console[_0x1f0f31(0x15f)](a31_0x502fa9['green'](_0x1f0f31(0x176))),0x0;_0xd45a8e=normalizePath(_0xd45a8e);const _0x49ec15=parsePath(_0xd45a8e)[_0x1f0f31(0x186)];if(_0x49ec15[_0x1f0f31(0x174)]===0x0)return saveSessionContext({'segment_path':undefined},_0x20bc1f),console['log'](a31_0x502fa9['green'](_0x1f0f31(0x176))),0x0;_0x346a59[_0x1f0f31(0x17f)]&&(console[_0x1f0f31(0x16f)](_0x1f0f31(0x17e)+_0x346a59['site']),console[_0x1f0f31(0x16f)](_0x1f0f31(0x175)+_0xd45a8e));const _0x2be9a4=await withSpinner(_0x1f0f31(0x180)+_0xd45a8e+_0x1f0f31(0x158),()=>_0x4f8030[_0x1f0f31(0x16c)]['resolvePathToResource'](_0xd45a8e),{'verbose':_0x346a59[_0x1f0f31(0x17f)]}),_0x441413=_0x2be9a4[_0x1f0f31(0x14c)];_0x346a59[_0x1f0f31(0x17f)]&&(console[_0x1f0f31(0x16f)](_0x1f0f31(0x156)+_0x441413[_0x1f0f31(0x160)]),console[_0x1f0f31(0x16f)](_0x1f0f31(0x171)+_0x441413[_0x1f0f31(0x16a)]),_0x441413[_0x1f0f31(0x162)]&&console[_0x1f0f31(0x16f)](_0x1f0f31(0x163)+_0x441413[_0x1f0f31(0x162)]));if(_0x441413[_0x1f0f31(0x160)]==='segment')return console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x17b)](_0x1f0f31(0x17c))),console[_0x1f0f31(0x16f)](_0x1f0f31(0x178)),console['error'](a31_0x502fa9[_0x1f0f31(0x15a)](_0x1f0f31(0x15d)+_0x441413['parentName']+(_0x441413[_0x1f0f31(0x179)]?'/'+_0x441413['folderPath']['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x441413[_0x1f0f31(0x164)],'parent_segment':_0x441413[_0x1f0f31(0x169)]},_0x20bc1f),console[_0x1f0f31(0x15f)](a31_0x502fa9[_0x1f0f31(0x165)](_0x1f0f31(0x187)+a31_0x502fa9[_0x1f0f31(0x15a)](_0x441413[_0x1f0f31(0x164)]))),_0x346a59[_0x1f0f31(0x17f)]&&(console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x14d)](_0x1f0f31(0x17d))),console[_0x1f0f31(0x16f)](a31_0x502fa9['dim'](_0x1f0f31(0x185)))),0x0;}catch(_0x56c0a1){throw _0x56c0a1;}}}function a31_0x3a68(){const _0x54f9be=['Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Site:\x20','verbose','Resolving\x20path\x20\x27','10UqHdxG','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','segments','✔\x20Context\x20set\x20to:\x20','146460TIxQYx','isDirectory','data','dim','6906779gzMnvO','name','session','Resolved\x20relative\x20path\x20to:\x20','isAbsolute','Error:\x20Path\x20is\x20required\x0a','248kwrYSe','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Resolved\x20path\x20type:\x20','3357155dZRipX','\x27...','1607648cLFGsV','cyan','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','slice','Use:\x20tdx\x20segment\x20use\x20','18ILmQSt','log','type','Usage:\x20tdx\x20segment\x20use\x20<path>','folderId','Folder\x20ID:\x20','fullPath','green','139554AZarwp','join','split','parentName','parentId','Examples:','segment','35054556vgYaSs','1008149HAIeDk','error','69UFDElV','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','description','length','Target\x20path:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','execute','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','folderPath','2Gygqob','red','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'];a31_0x3a68=function(){return _0x54f9be;};return a31_0x3a68();}
1
+ const a31_0x1e7acc=a31_0x46a3;(function(_0x40b350,_0x3f2b2d){const _0xfc2ab2=a31_0x46a3,_0x262331=_0x40b350();while(!![]){try{const _0x381f98=-parseInt(_0xfc2ab2(0xa9))/0x1*(-parseInt(_0xfc2ab2(0xdc))/0x2)+-parseInt(_0xfc2ab2(0xe3))/0x3*(-parseInt(_0xfc2ab2(0xb0))/0x4)+-parseInt(_0xfc2ab2(0xdd))/0x5*(-parseInt(_0xfc2ab2(0xc7))/0x6)+parseInt(_0xfc2ab2(0xcf))/0x7+-parseInt(_0xfc2ab2(0xb5))/0x8+-parseInt(_0xfc2ab2(0xaa))/0x9+-parseInt(_0xfc2ab2(0xae))/0xa*(-parseInt(_0xfc2ab2(0xbc))/0xb);if(_0x381f98===_0x3f2b2d)break;else _0x262331['push'](_0x262331['shift']());}catch(_0x111554){_0x262331['push'](_0x262331['shift']());}}}(a31_0x2f96,0xf2eb5));import{existsSync,statSync}from'fs';function a31_0x2f96(){const _0x3d5bad=['31916kIQFHp','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','error','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','11579384yHXNnQ','red','parentName','Folder\x20ID:\x20','dim','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','segment','1128721NdpcBr','Site:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segments','✔\x20Context\x20set\x20to:\x20','split','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','resolvePathToResource','Use:\x20tdx\x20segment\x20use\x20','isAbsolute','description','90vPcdCn','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20path\x20\x27','Resolved\x20path\x20type:\x20','data','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','slice','fullPath','3690645MaxDPQ','cyan','segmentPath','folderId','execute','parent_segment','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','session','green','Error:\x20Path\x20is\x20required\x0a','type','Target\x20path:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','1266476HyAIJd','554245AqVhYS','isDirectory','Parent\x20ID:\x20','Examples:','name','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','309FLkbVg','join','1bGWjBO','17288118mTlaeG','folderPath','length','verbose','70bohtMe','log'];a31_0x2f96=function(){return _0x3d5bad;};return a31_0x2f96();}import a31_0x113e5d from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a31_0x46a3(_0x3ef7f5,_0x1879cd){_0x3ef7f5=_0x3ef7f5-0xa9;const _0x2f9600=a31_0x2f96();let _0x46a30c=_0x2f9600[_0x3ef7f5];return _0x46a30c;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a31_0x1e7acc(0xe1)]='segment:use';[a31_0x1e7acc(0xc6)]=a31_0x1e7acc(0xba);async[a31_0x1e7acc(0xd3)](_0x4cca17){const _0x126498=a31_0x1e7acc,{options:_0x1268f3,args:_0xe29838,tdx:_0x4929ab}=_0x4cca17;if(_0xe29838[_0x126498(0xac)]===0x0)return console[_0x126498(0xb2)](a31_0x113e5d[_0x126498(0xb6)](_0x126498(0xd8))),console[_0x126498(0xb2)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x126498(0xb2)](_0x126498(0xe0)),console[_0x126498(0xb2)](_0x126498(0xd5)),console[_0x126498(0xb2)](_0x126498(0xbe)),console['error'](_0x126498(0xc2)),console[_0x126498(0xb2)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x42e7eb=_0xe29838[0x0],_0x4c1477=_0x1268f3[_0x126498(0xd6)];try{if(_0x42e7eb==='/')return saveSessionContext({'segment_path':undefined},_0x4c1477),console['log'](a31_0x113e5d[_0x126498(0xd7)](_0x126498(0xe2))),0x0;if(existsSync(_0x42e7eb)&&statSync(_0x42e7eb)[_0x126498(0xde)]()){let _0x229ea3;try{_0x229ea3=findTdxConfig(_0x42e7eb);}catch{return console['error'](a31_0x113e5d['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x42e7eb)),console[_0x126498(0xb2)](a31_0x113e5d['cyan'](_0x126498(0xdb))),0x1;}const _0x80b8bc=_0x229ea3['config'][_0x126498(0xd4)];return saveSessionContext({'segment_path':_0x80b8bc,'parent_segment':_0x80b8bc},_0x4c1477),console[_0x126498(0xaf)](a31_0x113e5d['green']('✔\x20Context\x20set\x20to:\x20'+a31_0x113e5d[_0x126498(0xd0)](_0x80b8bc))),0x0;}const _0x4490fa=_0x1268f3[_0x126498(0xd1)];let _0x5306b6=_0x42e7eb;const _0x58cd2b=parsePath(_0x42e7eb);if(!_0x58cd2b[_0x126498(0xc5)]){if(!_0x4490fa)return console[_0x126498(0xb2)](a31_0x113e5d[_0x126498(0xb6)](_0x126498(0xb3))),console[_0x126498(0xb2)](a31_0x113e5d[_0x126498(0xd0)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x42e7eb==='..'){const _0x59bb1c=_0x4490fa[_0x126498(0xc1)]('/')[_0x126498(0xcd)](0x0,-0x1)[_0x126498(0xe4)]('/');_0x5306b6=_0x59bb1c||'/';}else _0x42e7eb==='.'?_0x5306b6=_0x4490fa:_0x5306b6=_0x4490fa+'/'+_0x42e7eb;_0x1268f3[_0x126498(0xad)]&&console[_0x126498(0xb2)](_0x126498(0xc8)+_0x5306b6);}if(_0x5306b6==='/'||_0x5306b6==='')return saveSessionContext({'segment_path':undefined},_0x4c1477),console[_0x126498(0xaf)](a31_0x113e5d[_0x126498(0xd7)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x5306b6=normalizePath(_0x5306b6);const _0x3b5dab=parsePath(_0x5306b6)[_0x126498(0xbf)];if(_0x3b5dab['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x4c1477),console[_0x126498(0xaf)](a31_0x113e5d[_0x126498(0xd7)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x1268f3[_0x126498(0xad)]&&(console[_0x126498(0xb2)](_0x126498(0xbd)+_0x1268f3['site']),console['error'](_0x126498(0xda)+_0x5306b6));const _0x3d9d39=await withSpinner(_0x126498(0xc9)+_0x5306b6+'\x27...',()=>_0x4929ab[_0x126498(0xbb)][_0x126498(0xc3)](_0x5306b6),{'verbose':_0x1268f3[_0x126498(0xad)]}),_0x2f6f59=_0x3d9d39[_0x126498(0xcb)];_0x1268f3[_0x126498(0xad)]&&(console[_0x126498(0xb2)](_0x126498(0xca)+_0x2f6f59[_0x126498(0xd9)]),console[_0x126498(0xb2)](_0x126498(0xdf)+_0x2f6f59['parentId']),_0x2f6f59['folderId']&&console[_0x126498(0xb2)](_0x126498(0xb8)+_0x2f6f59[_0x126498(0xd2)]));if(_0x2f6f59[_0x126498(0xd9)]===_0x126498(0xbb))return console['error'](a31_0x113e5d['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x126498(0xb2)](_0x126498(0xb4)),console['error'](a31_0x113e5d[_0x126498(0xd0)](_0x126498(0xc4)+_0x2f6f59[_0x126498(0xb7)]+(_0x2f6f59[_0x126498(0xab)]?'/'+_0x2f6f59[_0x126498(0xab)][_0x126498(0xe4)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2f6f59[_0x126498(0xce)],'parent_segment':_0x2f6f59[_0x126498(0xb7)]},_0x4c1477),console[_0x126498(0xaf)](a31_0x113e5d[_0x126498(0xd7)](_0x126498(0xc0)+a31_0x113e5d[_0x126498(0xd0)](_0x2f6f59[_0x126498(0xce)]))),_0x1268f3[_0x126498(0xad)]&&(console['error'](a31_0x113e5d[_0x126498(0xb9)](_0x126498(0xb1))),console[_0x126498(0xb2)](a31_0x113e5d[_0x126498(0xb9)](_0x126498(0xcc)))),0x0;}catch(_0x4a9ccd){throw _0x4a9ccd;}}}
@@ -1 +1 @@
1
- {"version":3,"file":"segment-use-command.js","sourceRoot":"","sources":["../../src/commands/segment-use-command.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"segment-use-command.js","sourceRoot":"","sources":["../../src/commands/segment-use-command.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAuB,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAwB,MAAM,8BAA8B,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IACvC,IAAI,GAAG,aAAa,CAAC;IACrB,WAAW,GAAG,mDAAmD,CAAC;IAE3E,KAAK,CAAC,OAAO,CAAC,OAAuB;QACnC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;QAEvC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC,CAAC;YACtD,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;YAC/C,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;YACjD,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;YAC3D,OAAO,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;YACpE,OAAO,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACnE,OAAO,CAAC,CAAC;QACX,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;QAElC,IAAI,CAAC;YACH,mCAAmC;YACnC,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;gBACpB,kCAAkC;gBAClC,kBAAkB,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;gBAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC,CAAC;gBAC7D,OAAO,CAAC,CAAC;YACX,CAAC;YAED,sDAAsD;YACtD,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;gBAC3D,IAAI,MAAuB,CAAC;gBAC5B,IAAI,CAAC;oBACH,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;gBAClC,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,yCAAyC,OAAO,EAAE,CAAC,CAAC,CAAC;oBAC7E,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC,CAAC;oBACvG,OAAO,CAAC,CAAC;gBACX,CAAC;gBAED,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;gBAChD,kBAAkB,CAChB;oBACE,YAAY,EAAE,UAAU;oBACxB,cAAc,EAAE,UAAU;iBAC3B,EACD,SAAS,CACV,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,qBAAqB,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;gBACxE,OAAO,CAAC,CAAC;YACX,CAAC;YAED,oEAAoE;YACpE,MAAM,WAAW,GAAG,OAAO,CAAC,WAAiC,CAAC;YAE9D,qBAAqB;YACrB,IAAI,UAAU,GAAG,OAAO,CAAC;YAEzB,wBAAwB;YACxB,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;YAClC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;gBACvB,IAAI,CAAC,WAAW,EAAE,CAAC;oBACjB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC,CAAC;oBAC7E,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC,CAAC;oBACrG,OAAO,CAAC,CAAC;gBACX,CAAC;gBAED,wBAAwB;gBACxB,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;oBACrB,kBAAkB;oBAClB,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;oBACjE,UAAU,GAAG,UAAU,IAAI,GAAG,CAAC;gBACjC,CAAC;qBAAM,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;oBAC3B,uBAAuB;oBACvB,UAAU,GAAG,WAAW,CAAC;gBAC3B,CAAC;qBAAM,CAAC;oBACN,oCAAoC;oBACpC,UAAU,GAAG,GAAG,WAAW,IAAI,OAAO,EAAE,CAAC;gBAC3C,CAAC;gBAED,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;oBACpB,OAAO,CAAC,KAAK,CAAC,8BAA8B,UAAU,EAAE,CAAC,CAAC;gBAC5D,CAAC;YACH,CAAC;YAED,6BAA6B;YAC7B,IAAI,UAAU,KAAK,GAAG,IAAI,UAAU,KAAK,EAAE,EAAE,CAAC;gBAC5C,kBAAkB,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;gBAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC,CAAC;gBAC7D,OAAO,CAAC,CAAC;YACX,CAAC;YAED,8BAA8B;YAC9B,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;YAEvC,4BAA4B;YAC5B,MAAM,YAAY,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC;YAEpD,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9B,wBAAwB;gBACxB,kBAAkB,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;gBAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC,CAAC;gBAC7D,OAAO,CAAC,CAAC;YACX,CAAC;YAED,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,CAAC,KAAK,CAAC,SAAS,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;gBACvC,OAAO,CAAC,KAAK,CAAC,gBAAgB,UAAU,EAAE,CAAC,CAAC;YAC9C,CAAC;YAED,iDAAiD;YACjD,MAAM,kBAAkB,GAAG,MAAM,WAAW,CAC1C,mBAAmB,UAAU,MAAM,EACnC,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,UAAU,CAAC,EACnD,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAC7B,CAAC;YACF,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC;YAE7C,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,CAAC,KAAK,CAAC,uBAAuB,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC1D,OAAO,CAAC,KAAK,CAAC,cAAc,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACrD,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;oBAC1B,OAAO,CAAC,KAAK,CAAC,cAAc,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACvD,CAAC;YACH,CAAC;YAED,oDAAoD;YACpD,IAAI,YAAY,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBACpC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC,CAAC;gBACpE,OAAO,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;gBACxE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,wBAAwB,YAAY,CAAC,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;gBACtJ,OAAO,CAAC,CAAC;YACX,CAAC;YAED,0BAA0B;YAC1B,kBAAkB,CAChB;gBACE,YAAY,EAAE,YAAY,CAAC,QAAQ;gBACnC,cAAc,EAAE,YAAY,CAAC,UAAU,EAAE,wDAAwD;aAClG,EACD,SAAS,CACV,CAAC;YAEF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,qBAAqB,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;YACnF,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC,CAAC;gBAChF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC,CAAC;YAC1E,CAAC;YAED,OAAO,CAAC,CAAC;QACX,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,mCAAmC;YACnC,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}